diff --git a/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_content_list.json b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9a68b9646ad43c746d7e99937fc3c81f016db9fd
--- /dev/null
+++ b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54a5841040483a09adb57ab2df276f4c09998fd33554fa0e3012776d6eaa752c
+size 103059
diff --git a/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_model.json b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..de52b8a236bc664800bfaf3db6cd2128642f0ca7
--- /dev/null
+++ b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e873c8cfa77c4cc99790af1ffc11ecb5442717184cf931fc789096e41f2a8441
+size 122121
diff --git a/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_origin.pdf b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f4c7eb2bcf007cf7631c3c146dce5b68a43e166f
--- /dev/null
+++ b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/2ad7003a-8690-410a-9883-91bd50ef7431_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d30085112c40768c93b60e283da46df194a2fb6b944c257ea41b66c8af027cac
+size 5139992
diff --git a/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/full.md b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3bb0f647bfbc690ff93bdf280d724b61fdb6b026
--- /dev/null
+++ b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/full.md
@@ -0,0 +1,346 @@
+# OVERCOMING THE PITFALLS OF VISION-LANGUAGE
+MODEL FINETUNING FOR OOD GENERALIZATION
+
+Yuhang Zang\*1, Hanlin Goh?, Josh Susskind?, Chen Huang?
+
+$^{1}$ Nanyang Technological University $^{2}$ Apple Inc.
+
+zang0012@ntu.edu.sg {hanlin, jsusskind, chen-huang}@apple.com
+
+# ABSTRACT
+
+Existing vision-language models exhibit strong generalization on a variety of visual domains and tasks. However, such models mainly perform zero-shot recognition in a closed-set manner, and thus struggle to handle open-domain visual concepts by design. There are recent finetuning methods, such as prompt learning, that not only study the discrimination between in-distribution (ID) and out-of-distribution (OOD) samples, but also show some improvements in both ID and OOD accuracies. In this paper, we first demonstrate that vision-language models, after long enough finetuning but without proper regularization, tend to overfit the known classes in the given dataset, with degraded performance on unknown classes. Then we propose a novel approach OGEN to address this pitfall, with the main focus on improving the OOD GENeralization of finetuned models. Specifically, a class-conditional feature generator is introduced to synthesize OOD features using just the class name of any unknown class. Such synthesized features will provide useful knowledge about unknowns and help regularize the decision boundary between ID and OOD data when optimized jointly. Equally important is our adaptive self-distillation mechanism to regularize our feature generation model during joint optimization, i.e., adaptively transferring knowledge between model states to further prevent overfitting. Experiments validate that our method yields convincing gains in OOD generalization performance in different settings. Code: https://github.com/apple/ml-ogen.
+
+# 1 INTRODUCTION
+
+Large-scale pre-trained vision-language models like CLIP (Radford et al., 2021) demonstrate promising generalizability on various visual domains and tasks in the real world. However, their zero-shot in-distribution (ID) performance can be limited for some downstream datasets. Also due to their zero-shot evaluation in a closed-set manner (i.e., to match input image to a predefined set of classes), vision-language models often struggle to handle the out-of-distribution (OOD) samples from novel classes. Such shortcomings create major safety risks in the open domain that often require capabilities of OOD detection and/or accurate identification of both novel and seen classes.
+
+Some recent works attempt to improve the zero-shot OOD detection performance of existing vision-language models, either by simple softmax scaling (Ming et al., 2022) or training an extra text generator (Esmaeilpour et al., 2022). Alternatively, Fort et al. (2021) first show the promise of CLIP models finetuned on an ID dataset. Encouragingly both ID and OOD accuracies are improved after finetuning. Parameter-efficient finetuning methods, such as prompt learning (Zhou et al., 2022a;b) or adaptor tuning (Zhang et al., 2022), illustrate similar benefits without heavy training.
+
+Despite the success of prior finetuning methods, we found from our extensive benchmarking that finetuning on ID datasets is prone to overfitting (Fig. 1(b)). More specifically, we observed that models after long enough finetuning but without proper regularization, tend to overfit the known classes in the given dataset, with inferior generalization on unknown classes. Unfortunately, an explicit regularization mechanism has not been explored in literature to address this pitfall, and simple
+
+
+(a)
+
+
+
+
+
+
+(b)
+Figure 1: (a) We study OOD generalization when finetuning the vision-language model CLIP on various downstream tasks. We consider both within-dataset generalization where one dataset has ID vs. OOD (or known vs. unknown) class splits for finetuning and evaluation respectively, and the more challenging cross-dataset generalization setting. More clarifications on the problem definition in Appendix A. (b) Examples of within-dataset generalization: we show learning curves of the prompt learning method CoOp (Zhou et al., 2022a) that finetunes CLIP for long enough (200 epochs) on three datasets (more in Appendix B). Apparently, CoOp overfits the known classes of each dataset with notable accuracy drop on the unknowns. Our proposed method OGEN largely reduces such overfitting through effective regularization.
+
+
+
+
+
+regularization strategies like early stopping seem insufficient. E.g. in Fig. 1(b), it is difficult to find an early model checkpoint with good trade-off between the known and unknown class performance.
+
+One main challenge of effective model regularization is the missing knowledge about unknowns. Such knowledge could actually offer useful supervision signals to avoid overconfident predictions on OOD data. In this paper, we propose a novel method that features 1) image feature synthesis for unknown classes and 2) an unknown-aware finetuning algorithm with effective model regularization. The goal is to improve OOD generalization without hurting the ID performance of finetuned models. To synthesize unknown features, we introduce a class-conditional feature generator: i.e., generating image features just given the name of an unknown class. This is made possible by CLIP's well-aligned image-text feature spaces. Our feature generator is implemented by a lightweight attention module, with an "extrapolating bias" on the unknown classes. It generalizes well to "unknown unknowns" and hence can model the complex distributions of visual classes in the open domain. Then we use both the ID and synthesized OOD data for joint optimization, leading to a better regularized decision boundary. Another contribution is an adaptive self-distillation mechanism that regularizes our feature generator to further reduce overfitting during joint optimization. The idea is to find an adaptive teacher model of the feature generator from historical training epochs (with less overfitting) to guide optimization at the current epoch (student model, often with more overfitting).
+
+Our overall approach OGEN is applicable to different finetuning methods e.g., (Zhou et al., 2022a;b; Jia et al., 2022) for CLIP-like models. OGEN is shown to consistently improve the OOD generalization performance (by up to absolute $18.77\%$ ) under two settings: within-dataset (base-to-new class) generalization and cross-dataset generalization. Summarizing, our main contributions are:
+
+- Provide the first comprehensive study on OOD generalization that unveils the pitfalls of finetuning methods (based on prompt learning) for vision-language models.
+- A class-conditional feature generator to synthesize OOD data for effective regularization.
+- Adaptive self-distillation on our feature generator to further reduce overfitting.
+
+# 2 RELATED WORK
+
+Vision-Language Models. Recent large-scale vision-language models like ViLT (Kim et al., 2021) and PaLI (Chen et al., 2023) simply consume image-and-text features for multimodal downstream tasks with remarkable performance. Another popular paradigm used in CLIP (Radford et al., 2021) and ALIGN (Jia et al., 2021) contrastively aligns image and text encoders. These contrastive models are trained on massive web-scale image-text pairs, also showing strong adaptability to a range of
+
+downstream tasks, such as semantic segmentation (Zang et al., 2022a; Ghiasi et al., 2021) and video classification (Qian et al., 2022). Numerous follow-up works (Li et al., 2022; Zhou et al., 2022a) aim to improve CLIP-like models in data efficiency or generalization. However, the zero-shot performance on some tasks can still be limited for existing vision-language models. Hu et al. (2023) found that they make different kinds of errors, e.g., PaLI is erroneous at tail visual concepts while CLIP may fail for common ones. This paper mainly studies and improves the generalization of finetuned CLIP models, but our approach is model-agnostic and thus applicable to other vision-language models as well.
+
+Finetuning methods have been studied to improve the downstream performance of vision-language models over their zero-shot counterparts. Fort et al. (2021) showed that after finetuning the CLIP model on datasets of interest, both the ID and OOD generalization performance will be improved. More parameter-efficient finetuning methods are popularized in recent years. In particular, prompt learning focuses on learning visual (Jia et al., 2022), textual (Zhou et al., 2022a;b; Yao et al., 2023; Wang et al., 2023; Shu et al., 2023; Khattak et al., 2023b) or multi-modal Zang et al. (2022b); Khattak et al. (2023a) prompts, while adaptor tuning (Zhang et al., 2022) optimizes feature representations with the model backbone kept frozen. In this paper, we first unveil the overfitting issue of recent finetuning methods, and then propose a new regularization method to prevent overfitting. Our approach is orthogonal to the finetuning research, and shows consistent gains over various finetuning baselines.
+
+Outlier synthesis proves effective for model regularization in the absence of OOD data. Previous methods rely on GANs (Lee et al., 2018) to synthesize outlier images. More recent methods like VOS (Du et al., 2022) directly synthesize virtual features which allows greater flexibility. Tao et al. (2023) propose non-parametric outlier synthesis, without the restrictive Gaussian assumption on feature distributions in VOS. Here we present a new feature synthesis method that has the same format as the CLIP framework and hence facilitates multimodal regularization. Specifically, given the name of an unknown class, we synthesize its example features in a generalizable way.
+
+Model distillation techniques transfer knowledge from a teacher model to student models, e.g., from a large model to its efficient counterparts (Hinton et al., 2015) or from a weakly augmented model to the strongly augmented (Sohn et al., 2020). Here we aim to reduce overfitting for unseen classes and propose to distill knowledge from early to current epochs (i.e., self-distillation). Specifically, we extend Mean teacher (Tarvainen & Valpola, 2017) to an adaptive localized one with suitable teacher curriculum. In the vision-language domain, our approach differs from distillation into smaller models (Li et al., 2023) or towards various downstream tasks (Gu et al., 2022; Dai et al., 2022; Mal et al., 2022). Our approach is also orthogonal (and applicable) to recent distillation frameworks for improved multimodal pretraining (Dong et al., 2023; Li et al., 2021; Zhong et al., 2022).
+
+# 3 METHODOLOGY
+
+# 3.1 PRELIMINARIES
+
+CLIP (Radford et al., 2021) is the vision-language model that we mainly study in this paper, although our study is applicable to other popular models. CLIP consists of an image encoder $\phi$ and a text encoder $\psi$ , which map the image and text inputs into a joint feature space. The CLIP training aims at aligning the image and text modalities by maximizing their feature similarity. Given an input image $\pmb{x}$ that belongs to one of the classes $\pmb{Y} = \{\pmb{y}_1, \pmb{y}_2, \dots, \pmb{y}_C\}$ , the image encoder $\phi$ first extracts image features $\pmb{z} = f_{\phi}(\pmb{x}) \in \mathbb{R}^d$ . To obtain the corresponding text features $\pmb{w}_{c \in \{1, \dots, C\}}$ , all the given class names can be fed into a fixed prompt template $\{\text{a photo of a [CLASS]}\}$ , leading to text descriptions $\pmb{A}$ which are further encoded by $\psi$ into the text embeddings $\pmb{W} = f_{\psi}(\pmb{A}) \in \mathbb{R}^{d \times C}$ (hence $\pmb{w}_{c} = \pmb{W}_{:,c}$ ). The image-text alignment is optimized based on the cosine feature similarity:
+
+$$
+p (y = c \mid \boldsymbol {x}) = \frac {\exp (\cos (\boldsymbol {w} _ {c} , \boldsymbol {z}) / \tau)}{\sum_ {i = 1} ^ {C} \exp (\cos (\boldsymbol {w} _ {i} , \boldsymbol {z}) / \tau)}, \tag {1}
+$$
+
+where $\tau$ is the temperature. A larger cosine score often indicates stronger image-text alignment in their underlying semantics.
+
+Prompt Learning. For efficient model finetuning on downstream tasks, recent prompt learning approaches like CoOp (Zhou et al., 2022a) replace the aforementioned fixed prompts with learnable
+
+
+(a)
+
+
+(b)
+
+
+(c)
+Figure 2: (a) To improve OOD generalization, we propose to gain knowledge of unknown classes by directly synthesizing their image features. This helps to learn a more reliable decision boundary between known and unknown classes in the feature space. (b) Prompt learning based on discriminating both the known and synthesized unknown features (from our class-conditional feature generator $\theta$ , see details in text). (c) Implementation of $\theta$ using a lightweight attention module.
+
+ones $\pmb{V} = [\pmb{v}_1, \pmb{v}_2, \dots, \pmb{v}_L] \in \mathbb{R}^{d \times L}$ where $L$ is the prompt length. Then the text encoder $\psi$ of CLIP will be able to convert the learned prompts $\pmb{V}$ (together with $\pmb{Y}$ ) into adapted text embeddings $\hat{\pmb{W}} = f_{\psi}([\pmb{V}, \pmb{Y}]) \in \mathbb{R}^{d \times C}$ . Note $\pmb{V}$ is learned on each downstream task using the task-specific loss. The image encoder $\phi$ and text encoder $\psi$ of CLIP are kept frozen during prompt learning.
+
+# 3.2 CLASS-CONDITIONAL FEATURE GENERATOR
+
+As shown in Fig. 1(b), the "prompt-tuned" CLIP model tends to overfit the known classes (aka base classes $\mathbf{Y}^b = \{\pmb{y}_1, \pmb{y}_2, \dots, \pmb{y}_{C_b}\}$ from the downstream task, while OOD generalization on unknown classes (aka new classes $\mathbf{Y}^n$ with $|\mathbf{Y}^n| = C_n$ ) will deteriorate. To reduce overfitting, one might choose model regularization strategies, which will inevitably suffer from the missing knowledge about unknowns. Moreover, the potential number of unknown classes $C_n$ is huge and $C_n \gg C_b$ . Hence it is very challenging to model their complex distributions for effective regularization.
+
+Here we make one step towards gaining knowledge of unknowns in a class-conditional manner, in order to provide supervision signals for the vast space of unknown data. Given a textual description or simply the class name of any unknown class, we aim to synthesize the class example features without seeing labeled instances (Fig. 2(a)), leveraging the well-aligned image-text feature spaces of CLIP. Such synthesized image features will then facilitate learning a regularized decision boundary between known and unknown classes, leading to improved OOD generalization capabilities.
+
+In early experiments, we found that directly generating OOD image features out of class names is hard due to the highly non-linear and high-dimensional nature of the former. This is similarly observed in those strong cases of OOD generalization in (Abbe et al., 2023), where the manifold embeddings are typically nonlinear and, more critically, part of the distribution domain is entirely unseen at training. It is proved that successful learning under such extreme distribution shift leads to extrapolating solutions since memorization is voided on the unseen domain. Following the "extrapolating bias" on the unknown, we reframe our feature synthesis problem as an easier one — extrapolating from the most similar classes of the seen data, e.g., to generate features of the unknown class raccoon by extrapolating features of the similar training classes like cat and bear.
+
+More specifically, for prompt learning, given the learned prompts and one unknown [CLASS] from the open set $\mathbf{Y}^n$ , we first obtain the corresponding text features $\hat{\boldsymbol{w}}^n \in \mathbb{R}^d$ through the text encoder $\psi$ of CLIP. Then we find for $\hat{\boldsymbol{w}}^n$ its kNN classes from the entire set of text features of known classes $\hat{\boldsymbol{W}}^b \in \mathbb{R}^{d \times C_b}$ , resulting in $\hat{\boldsymbol{W}}_R^b \in \mathbb{R}^{d \times K}$ where $R$ is the neighbor set with $|R| = K$ . From each of the kNN classes, we randomly sample only one class example and obtain its text-aligned image features from the image encoder $\phi$ , leading to the same number of $K$ image feature vectors $Z_R^b \in \mathbb{R}^{d \times K}$ . Our goal is to train a class-conditional feature generator $f_{\theta}(\hat{\boldsymbol{w}}^n, \hat{\boldsymbol{W}}_R^b, Z_R^b)$ that can synthesize unknown image features conditioned on the text features $\hat{\boldsymbol{w}}^n$ of an unknown class and auxiliary text/image features $(\hat{\boldsymbol{W}}_R^b, Z_R^b)$ of kNN known classes, see Fig. 2 (b).
+
+Remarks. To retrieve semantically similar kNN classes $\hat{W}_R^b$ from $\hat{W}^b$ , we choose to use the cosine similarity score between the text features (not image features) of class pairs. Then the kNN retrieval
+
+process can be formally defined as:
+
+$$
+\underset {R \subset \{1, \dots , C _ {b} \}: | R | = K} {\arg \max } \sum_ {i \in R} \cos \left(\hat {\boldsymbol {w}} ^ {n}, \hat {\boldsymbol {w}} _ {i} ^ {b}\right), \text {w h e r e} \hat {\boldsymbol {w}} _ {i} ^ {b} = \hat {\boldsymbol {W}} _ {:, i} ^ {b}. \tag {2}
+$$
+
+On another note, our empirical study shows that the one random example sampled from each kNN class is enough for assisting new feature generation. Such randomness encourages the diversity of the synthesized features for new classes.
+
+Extrapolating per class. Recall the tuple $(\hat{W}_R^b, Z_R^b)$ consists of $K$ text and image feature vectors respectively (one for each similar known class). One straightforward feature synthesis method for an unknown class (with text features $\hat{w}^n$ ) is to extrapolate each image feature vector in $Z_R^b$ based on some notion of similarity with $\hat{w}^n$ , leading to a total of $K$ extrapolated image features from $K$ known classes (e.g., $cat \rightarrow raccoon$ , $bear \rightarrow raccoon, \ldots$ ). The similarity notion can be well learned by Multi-Head Cross-Attention (MHCA) that operates on the triplets of queries, keys and values $(\hat{w}^n, \hat{W}_R^b, Z_R^b)$ . This way, we can effectively take into account the similarity between the unknown class and each known class in $R$ as well as all other between-class similarities. Summarizing, the matrix form of our "extrapolating-per-class" scheme is given as:
+
+$$
+\boldsymbol {Z} ^ {n} = \operatorname {L N} \left(\boldsymbol {Z} _ {R} ^ {b} + \hat {\boldsymbol {Z}} ^ {n}\right) \in \mathbb {R} ^ {d \times K}, \quad \hat {\boldsymbol {Z}} ^ {n} = \mathrm {M H C A} \left(\hat {\boldsymbol {w}} ^ {n} \cdot \mathbf {1} _ {K} ^ {\top}, \hat {\boldsymbol {W}} _ {R} ^ {b}, \boldsymbol {Z} _ {R} ^ {b}\right) \in \mathbb {R} ^ {d \times K}, \tag {3}
+$$
+
+where $\hat{Z}^n$ are the learned feature residuals when extrapolating each of the $K$ known classes. LN denotes layer normalization. Obviously, our feature generator $\theta$ is lightweight with only one MHCA layer and one LN layer. The simplicity benefits from the "extrapolating bias" in our generator design.
+
+Finally, we use the synthesized features $Z^n$ to regularize prompt learning and perform joint discrimination of $C_b$ known and $C_n$ unknown class features. The objective of maximizing the image-text alignment in Eq. (1) now becomes:
+
+$$
+p (y = c \mid \boldsymbol {Z} ^ {n}) = \frac {1}{K} \sum_ {k = 1} ^ {K} \frac {\exp \left(\cos \left(\hat {\boldsymbol {w}} _ {c} , \boldsymbol {z} _ {k} ^ {n}\right) / \tau\right)}{\sum_ {i = 1} ^ {C _ {b} + C _ {n}} \exp \left(\cos \left(\hat {\boldsymbol {w}} _ {i} , \boldsymbol {z} _ {k} ^ {n}\right) / \tau\right)}, \forall c \in \{1, \dots , C _ {b} + C _ {n} \}, \tag {4}
+$$
+
+where $\hat{\boldsymbol{w}}_c = [\hat{\boldsymbol{W}}^b, \hat{\boldsymbol{W}}^n]_{:,c}$ and $\boldsymbol{z}_k^n = \boldsymbol{Z}_{:,k}^n$ . Note under the "extrapolating-per-class" scheme, we have synthesized $K$ image features for the same unknown class. We simply aggregate them at the score level when computing the cosine feature similarity score in Eq. (4).
+
+Extrapolating jointly is a more collaborative approach for new feature synthesis. As the name hints, we extrapolate a single image feature vector $\mathbf{z}^n$ from all the kNN known class features $(\hat{\mathbf{W}}_R^b, \mathbf{Z}_R^b)$ , based on the cross attention against $\hat{\mathbf{w}}^n$ :
+
+$$
+\boldsymbol {z} ^ {n} = \operatorname {L N} \left(\operatorname {F F N} \left(\hat {\boldsymbol {w}} ^ {n}\right) + \hat {\boldsymbol {z}} ^ {n}\right) \in \mathbb {R} ^ {d}, \quad \hat {\boldsymbol {z}} ^ {n} = \operatorname {M H C A} \left(\hat {\boldsymbol {w}} ^ {n}, \hat {\boldsymbol {W}} _ {R} ^ {b}, \boldsymbol {Z} _ {R} ^ {b}\right) \in \mathbb {R} ^ {d}, \tag {5}
+$$
+
+where $\hat{z}^n$ is the residual image feature vector, while text features $\hat{\boldsymbol{w}}^n$ are projected into the image feature space via a two-layer fully connected feed-forward network FFN. Note $\mathrm{FFN}(\hat{\boldsymbol{w}}^n)$ could be replaced by some anchor point directly searched in the image feature space, e.g., a weighted average of kNN image features from $Z_R^b$ . However, searching is a hard problem itself and learning an explicit text-to-image feature mapping works consistently better in our experiments. Fig. 2 (c) summarizes the overall network architecture, and the objective function in Eq. (4) could be updated as:
+
+$$
+p (y = c \mid z ^ {n}) = \frac {\exp \left(\cos \left(\hat {\boldsymbol {w}} _ {c} , \boldsymbol {z} ^ {n}\right) / \tau\right)}{\sum_ {i = 1} ^ {C _ {b} + C _ {n}} \exp \left(\cos \left(\hat {\boldsymbol {w}} _ {i} , \boldsymbol {z} ^ {n}\right) / \tau\right)}, \forall c \in \{1, \dots , C _ {b} + C _ {n} \}. \tag {6}
+$$
+
+Remarks. Our ablation study (Table 4) shows that "extrapolating jointly" (our default approach) is better than "extrapolating per class" at synthesizing useful unknown features for joint optimization. We train our class-conditional feature generator using the "known" and "unknown" class splits from the training set of downstream tasks. Fig. 3 demonstrates the ability of our feature generator to generalize to "unknown unknowns" during testing, with faithful image feature synthesis.
+
+# 3.3 ADAPTIVE SELF-DISTILLATION
+
+Optimizing both known and synthesized unknown features generally improves OOD generalization and oftentimes the ID performance too. However, that does not take into account the optimization
+
+
+Figure 3: Visualizing image feature synthesis based on the joint extrapolation scheme (Eq. (5)) on Flowers102 dataset. Note our feature generator is not trained on the unknown classes, but can still synthesize faithful image features (red triangle) lying close to the real ones (gray cross). This is achieved by extrapolating an unseen instance from the kNN class examples (only a random one per kNN class is used), effectively combining their related patterns like the shape and texture of flowers.
+
+
+
+dynamics that could also impact the ID-OOD performance tradeoff, especially with long finetuning runs. Take Fig. 1(b) for example. Without proper regularization, the CoOp baseline achieves either suboptimal ID performance at early epochs, or saturated ID performance but decreasing OOD performance (i.e., overfitting) later on. To address this issue, we introduce an adaptive self-distillation method that regularizes optimization dynamics to further reduce overfitting.
+
+More specifically, we use the model checkpoints from earlier epochs (i.e., teacher model often with less overfitting) to guide optimization at the current epoch (i.e., student model often with more overfitting). Since the CLIP model is frozen during prompt learning, the "model" we consider here is our feature generator $\theta$ whose synthesized OOD features will impact the joint ID-OOD optimization. Hence we enforce the consistency between the final prediction probabilities (Eq. (4) or (6)) induced by the teacher model $p^T$ and student model $p^S$ using the mean squared error $\mathrm{MSE}(p^T,p^S)$ . Ideally, this will help us to avoid OOD performance drop while preserving the ID performance.
+
+The key to our self-distillation method is the choice of teacher model $\theta^T$ . Obviously, selecting $\theta^T$ as one single model checkpoint at a historical epoch time is unlikely to strike a good trade-off between the ID and OOD performance. Mean Teacher (MT) (Tarvainen & Valpola, 2017) is a better alternative, which calculates an Exponential Moving Average (EMA) over the past checkpoints up until the current time $t$ (Eq. (7)). Here we propose Adaptive Local Mean Teacher (ALMT) that extends MT in two ways: 1) calculating EMA only within a local time window $[t - m_t, t]$ using the last $m_t$ checkpoints. This avoids the negative impact on the teacher's ID performance from those underfit early checkpoints. 2) the window size $m_t$ is time-adaptive such that $m_t$ is small in the early stage of finetuning (for the same purpose of ruling out underfit checkpoints), and then $m_t$ gradually increases in order to cover older checkpoints with improved ID performance but less overfitting. Such curriculum is summarized in Eq. (8) as below:
+
+$$
+\mathbf {M T} _ {[ 1, t ]}: \theta_ {i} ^ {T} = \alpha \theta_ {i - 1} ^ {T} + (1 - \alpha) \theta_ {i}, \quad f o r \quad i = \{1, \dots , t \}, \tag {7}
+$$
+
+$$
+\mathbf {A L M T} _ {t}: \mathbf {M T} _ {[ t - m _ {t}, t ]}, \quad m _ {t} = \left\lfloor \left(1 + \cos \left(\frac {t _ {\max } + t}{t _ {\max }} \pi\right)\right) \cdot \frac {1}{2} \left(m _ {\max } - m _ {\min }\right) + m _ {\min } \right\rfloor , \tag {8}
+$$
+
+where $m_{\mathrm{max}} = 9$ , $m_{\mathrm{min}} = 2$ , $t_{\mathrm{max}}$ is the maximum number of finetuning epochs, and the window size $m_t$ is increased following a cosine schedule. Note our ALMT method requires maintaining a queue of past $m_t$ checkpoints and re-calculating EMA for each time $t$ , both of which are cheap thanks to our compact model size of $\theta_i$ and the small window size $m_t \in \{2, \dots, 9\}$ .
+
+# 4 EXPERIMENTS
+
+We evaluate OOD generalization under the two settings introduced in (Zhou et al., 2022b) (more details in Appendix A): 1) generalization from ID (base) to OOD (new) classes within one dataset. The base and new class splits are used for finetuning and evaluation respectively. 2) cross-dataset generalization with one ID dataset for finetuning and other datasets for OOD evaluation. The cross
+
+Table 1: Base-to-new class generalization. Our OGEN approach consistently improves the new class generalization for all prompt learning baselines on average (across 11 datasets). OGEN also maintains or improves the average performance on base classes. H: Harmonic mean of base and new accuracies $(\%)$
+
+
+OGEN
CoOp
CoCoOp
VPT
SHIP
KgCoOp
MaPLe
PromptSRC
X
✓
X
✓
X
✓
X
✓
X
✓
X
✓
X
✓
Avg across 11 datasets
Base
82.69
83.47
80.47
79.86
82.51
82.52
80.03
80.79
80.73
81.34
82.28
82.40
84.26
84.17
New
63.22
69.54
71.69
73.35
69.01
70.61
73.69
76.14
73.60
75.68
75.14
76.37
76.10
76.86
Δ
+6.32
+1.66
+1.60
+2.45
+2.08
+1.23
+0.76
H
71.66
75.87
75.83
76.47
75.16
76.10
76.73
78.40
77.00
78.40
78.55
79.27
79.97
80.34
ImageNet
Base
76.47
76.40
75.98
76.50
75.96
75.09
75.87
76.14
75.83
75.88
76.66
77.02
77.60
77.50
New
67.88
68.80
70.43
70.23
67.32
67.66
69.95
71.18
69.96
70.93
70.54
70.73
70.73
70.97
H
71.92
72.40
73.10
73.23
71.38
71.18
72.79
73.58
72.78
73.32
73.47
73.74
74.01
74.09
Caltech101
Base
98.00
96.67
97.96
96.67
97.50
96.33
97.55
98.09
97.72
98.52
97.74
98.37
98.10
98.32
New
89.81
92.61
93.81
94.79
94.10
92.36
95.20
95.26
94.39
94.12
94.36
94.54
94.03
94.76
H
93.73
94.59
95.84
95.72
95.77
94.30
96.36
96.65
96.03
96.27
96.02
96.42
96.02
96.50
OxfordPets
Base
93.67
95.18
95.20
96.49
96.05
96.05
95.37
96.95
94.65
95.91
95.43
95.11
95.33
95.96
New
95.29
96.45
97.69
97.86
95.84
96.84
97.87
97.33
97.76
97.65
97.76
97.89
97.30
97.48
H
94.47
95.81
96.43
97.17
95.94
96.45
96.61
97.14
96.18
96.77
96.58
96.47
96.30
96.71
Stanford Cars
Base
78.12
78.65
70.49
68.96
75.00
74.23
68.57
68.63
71.76
71.86
72.94
73.63
78.27
77.59
New
60.40
65.28
73.59
74.23
63.45
67.97
73.90
75.45
75.04
75.95
74.00
74.30
74.97
75.17
H
68.13
71.35
72.01
71.50
68.74
70.96
71.14
71.88
73.36
73.84
73.47
73.96
76.58
76.38
Flowers102
Base
97.60
97.38
94.87
93.95
96.89
98.03
94.02
94.67
95.00
95.83
95.92
96.52
98.07
97.34
New
59.67
67.70
71.75
72.08
70.02
69.15
74.40
76.49
74.73
74.75
72.46
74.46
76.50
77.67
H
74.06
79.87
81.71
81.57
81.29
81.09
83.06
84.61
83.65
83.98
82.56
84.06
85.95
86.39
Food101
Base
88.33
89.21
90.70
91.17
88.88
91.50
90.54
91.07
90.50
90.80
90.71
91.02
90.67
90.69
New
82.26
87.22
91.29
91.67
88.95
88.53
91.03
92.79
91.70
92.01
92.05
92.02
91.53
91.68
H
85.19
88.21
90.99
91.42
88.91
89.99
90.78
91.92
91.09
91.40
91.38
91.52
91.10
91.19
FGVC Aircraft
Base
40.44
41.67
33.41
35.33
38.33
39.33
34.27
35.47
36.21
37.08
37.44
37.07
42.73
41.26
New
22.30
29.14
23.71
34.41
25.27
26.55
32.33
34.32
33.55
37.19
35.61
37.41
37.87
40.26
H
28.75
34.29
27.74
34.86
30.46
31.70
33.28
34.89
34.83
37.14
36.50
37.24
40.15
40.75
SUN397
Base
80.60
80.86
79.74
80.27
80.27
79.06
79.54
81.14
80.29
81.91
80.82
81.06
82.67
82.57
New
65.89
67.49
76.86
75.69
74.36
74.49
75.27
75.94
76.53
78.83
78.70
81.07
78.47
78.83
H
72.51
73.57
78.27
77.91
77.20
76.71
77.35
78.45
78.36
80.34
79.75
81.06
80.52
80.65
DTD
Base
79.44
79.16
77.01
75.00
77.08
77.43
74.88
76.02
77.55
78.01
80.36
79.73
83.37
83.75
New
41.18
50.96
56.00
56.44
53.62
55.79
56.88
64.62
54.99
62.56
59.18
62.68
62.97
62.54
H
54.24
62.01
64.85
64.41
63.24
64.85
64.65
69.86
64.35
69.43
68.16
70.18
71.75
71.60
EuroSAT
Base
92.19
91.67
87.49
78.33
91.67
90.00
88.62
89.17
85.64
86.05
94.07
93.83
92.90
93.40
New
54.74
73.51
60.04
64.69
58.31
66.75
66.87
74.28
64.34
70.18
73.23
74.30
73.90
76.74
H
68.69
81.59
71.21
70.86
71.28
76.65
76.22
81.05
73.48
77.30
82.35
82.93
82.32
84.25
UCF101
Base
84.69
91.33
82.33
85.78
80.07
90.68
81.08
81.33
82.89
82.84
83.00
82.99
87.10
87.44
New
56.05
65.81
73.45
74.78
74.50
70.54
76.85
79.83
76.67
78.28
78.66
80.68
78.80
79.28
H
67.46
76.50
77.64
79.90
77.18
79.35
78.91
80.57
79.65
80.49
80.77
81.82
82.74
83.16
+
+dataset setting is more challenging since there will be both domain- and class-incremental distribution shift, e.g., from generic object classification on ImageNet (Deng et al., 2009) to satellite imagery recognition on EuroSAT (Helber et al., 2019).
+
+Datasets. For both settings we use 11 datasets: ImageNet (Deng et al., 2009), Caltech101 (Fei-Fei et al., 2004), OxfordPnts (Parkhi et al., 2012), StanfordCars (Krause et al., 2013), Flowers102 (Nilsback & Zisserman, 2008), Food101 (Bossard et al., 2014), FGVC-Aircraft (Maji et al., 2013), SUN397 (Xiao et al., 2010), UCF101 (Soomro et al., 2012), DTD (Cimpoi et al., 2014) and EuroSAT (Helber et al., 2019).
+
+Baselines. For finetuning, we consider prompt learning approaches CoOp (Zhou et al., 2022a), CoCoOp (Zhou et al., 2022b), VPT (Jia et al., 2022), and the state-of-the-art methods SHIP (Wang et al., 2023), KgCoOp (Yao et al., 2023), MaPLe (Khattak et al., 2023a) and PromptSRC (Khattak et al., 2023b). For each baseline, we apply our method (dubbed OGEN) to obtain an OOD GENeralization improved version. For fairness, we use the same implementation details of each baseline, including the prompt length, vision backbone in CLIP (Radford et al., 2021) (i.e., ViT-B/16) and train/test data splitting. The reported results are an average over three random seeds.
+
+# 4.1 GENERALIZATION FROM BASE TO NEW CLASSES
+
+The base-to-new generalization setting creates a strictly class-incremental distribution shift since the base and new class splits in one dataset are disjoint. All prompt learners are trained on the base classes, and tested on the base and new classes separately to evaluate the trade-off between ID and OOD performance. Here we follow (Xian et al., 2017) to report the harmonic mean of base and new class accuracies to quantify such trade-off.
+
+Table 2: Cross-dataset generalization: CLIP finetuning (prompt learning) on the source dataset ImageNet, followed by testing on 10 target datasets. Our method OGEN improves the generalization performance of both CoOp and CoCoOp on all the target datasets.
+
+
Source
Target
ImageNet
Caltech101
OxfordPets
StanfordCars
Flowers102
Food101
FGVCAir
SUN397
DTD
EuroSAT
UCF101
Average
CoOp
71.51
93.70
89.14
64.51
68.71
85.30
18.47
64.15
41.92
46.39
66.55
63.88
OGEN-CoOp
71.52
94.60
90.73
65.07
70.55
87.26
19.84
65.77
44.90
49.53
69.36
65.76
CoCoOp
71.02
94.43
90.14
65.32
71.88
86.06
22.94
67.36
45.73
45.37
68.21
65.74
OGEN-CoCoOp
71.28
95.12
91.37
66.04
72.90
86.54
22.95
68.42
46.38
45.82
69.74
66.53
+
+Table 1 summarizes the results on 11 datasets. On average, our OGEN method consistently improves the new class accuracy for all the prompt learning baselines. CoOp is particularly interesting since its default learning schedule (200 epochs) is much longer than that of CoCoOp and VPT (10 epochs). Without proper regularization, CoOp inevitably shows more serious overfitting to the base classes (82.69% on average) with low performance on new classes (63.22%) after long training runs. Our OGEN is especially useful in this case, significantly improving the average new class accuracy of CoOp from 63.22% to 69.54%. As also visualized in Appendix C - Fig. 6(a), the new class generalization sees notable gains on 3 datasets — DTD for texture classification, EuroSAT for satellite image recognition and UCF101 for action recognition, which all demonstrate large inter-class variations. This validates the superior generalizability of OGEN, thanks to its capability of OOD feature synthesis and regularization. OGEN also improves the average base class accuracy of CoOp from 82.69% to 83.47%. Specifically, OGEN improves on 6 datasets with negligible performance drop on other 5, see Fig. 6(b). The gains on base classes can be attributed to 1) the joint discrimination of known and unknown classes and 2) our adaptive self-distillation method that strikes a good ID-OOD performance tradeoff.
+
+For CoCoOp and VPT with a significantly shorter training schedule, they suffer from much less overfitting with higher new but lower base accuracies than CoOp. This makes our OGEN unable to unleash its full potential to address overfitting. That said, we find both OGEN-CoCoOp and OGEN-VPT can still improve the average new class accuracy while achieving a similar base class accuracy. We are likely to further improve the base accuracy when given a longer optimization schedule that allows more ID-OOD performance balancing.
+
+Among the state-of-the-art methods, SHIP (+CoOp) and PromptSRC are related to our OGEN approach in the use of similar techniques of feature synthesis and self-regularization respectively. Table 1 shows that OGEN can improve the new class generalization of both SHIP and PromptSRC by exploring the synergy between regularization and OOD feature synthesis. OGEN also consistently improves the average base and new class accuracies for KgCoOp and MaPLe. Fig. 5 uses KgCoOp to exemplify how these methods still suffer from overfitting (although reduced to some extent by various techniques), and how our OGEN improves the learning curves of both base and new classes. It is worth noting that different methods are trained for different numbers of epochs, thus again, they have different levels of overfitting. OGEN improves generalization more over SHIP (200 epochs) and KgCoOp (100 epochs) with long learning schedules (more serious overfitting). Our gains are smaller over MaPLe (5 epochs) and PromptSRC (20 epochs) with short training runs, but larger gains are expected when trained for longer runs.
+
+# 4.2 CROSS-DATASET GENERALIZATION
+
+Table 2 shows the generalization performance from ImageNet to 10 target datasets. We consider the representative CoOp and CoCoOp baselines with long and short training runs respectively. As shown in the table, our OGEN uniformly improves the generalization performance (across baselines and target datasets) with competitive source dataset performance. The improvements are especially large on those low performing datasets DTD, EuroSAT, UCF101 with large distribution shift from ImageNet. This highlights the benefits of our OOD feature generation module. OGEN also obtains reasonable gains on the high performing datasets like OxfordPets that contains similar classes (e.g., different dog breeds) with ImageNet, demonstrating the universality of our approach.
+
+Table 3: Ablating our class-conditional feature generator $\theta$ (Eq. (5)) and self-distillation method ALMT (Eq. (8)). H: Harmonic mean of the base and new class accuracies averaged on 11 datasets.
+
+
θ
ALMT
Base
New
H
X
X
82.69±1.08
63.22±0.51
71.66±0.54
✓
X
82.49±0.95
69.02±0.64
75.15±1.12
✓
✓
83.47±0.30
69.54±0.34
75.88±0.11
+
+Table 5: Class-conditional feature generator: kNN retrieval vs. Random sampling of known classes with varying $K$ .
+
+
K
Base
New
H
kNN
1
82.76±0.49
67.01±1.35
74.06±0.63
2
82.35±0.76
67.79±2.37
74.36±1.19
3
82.49±0.95
69.02±1.25
75.15±1.12
4
82.37±0.46
68.85±0.52
75.00±0.13
Rand
3
81.69±0.35
68.30±0.38
74.40±0.36
+
+Table 4: Class-conditional feature generator: different design choices of no extrapolation from kNN classes, extrapolating per class (Eq. (3)) and extrapolating jointly (Eq. (5)).
+
+
Base
New
H
No Extrap
83.34±0.26
64.08±0.95
72.46±0.68
Extrap per class
82.90±0.35
66.04±0.89
73.52±0.63
Extrap jointly
82.49±0.95
69.02±1.25
75.15±1.12
+
+Table 6: Self-distillation: Mean Teacher (MT) vs. Adaptive Local Mean Teacher (ALMT) with fixed window size $m$ or adaptive ${m}_{t}$ (default).
+
+
Base
New
H
No distillation
82.49±0.65
69.02±0.64
75.15±1.12
MT
83.34±0.15
68.30±0.77
75.08±0.47
ALMT (m=2)
81.70±0.59
68.47±0.59
74.50±0.55
ALMT (m=9)
82.21±0.80
68.57±0.85
74.77±0.29
ALMT (mt)
83.47±0.30
69.54±0.34
75.88±0.11
+
+# 4.3 ABLATION STUDIES
+
+Our ablation studies are conducted using OGEN-CoOp with a meaningfully long learning schedule. We start with ablating the two main components of OGEN: class-conditional feature generator $\theta$ and adaptive self-distillation method ALMT. Table 3 confirms both components are useful (more visuals in Appendix B). We see the feature generator improves the new class accuracy by a large margin without hurting the base class accuracy. This suggests the high quality of its generated OOD features and the need of joint ID-OOD feature optimization. ALMT is shown to further improve on both base and new classes, leading to a higher Harmonic mean and a much lower performance variance. This highlights the need of regularizing joint optimization for a good performance tradeoff.
+
+Table 4 compares different design choices of our class-conditional feature generator. Recall that we adopt an extrapolation scheme that extrapolates new image features from the kNN base class features. What if we use no extrapolation at all, and directly learn a mapping from the new class name to new image features? As shown in the table, this only slightly helps the new class generalization probably because the generated features are not faithful enough from an unconstrained text-to-image mapping. Then between the "Extrapolating per class" and "Extrapolating jointly" schemes, the latter improves on new classes much more significantly, showing the benefits of collaborative class relation modeling for extrapolation. Table 5 further ablates on the number of kNN base classes needed for extrapolation, arriving at the best $K = 3$ . By comparison, randomly selecting 3 base classes does not perform as well. Finally, Appendix D illustrates the advantage of our feature synthesis approach over replay-based methods using real data.
+
+Table 6 compares various self-distillation baselines applied on top of our feature generator. Notably, the simple Mean Teacher (MT) is not helping, which inspires us to use a local version to completely rule out the early-stage underfit model checkpoints. We further propose Adaptive Local Mean Teacher (ALMT) that calculates EMA within a local time window of increasing size $m_{t}$ (from $m_{\min} = 2$ to $m_{\max} = 9$ ). As shown in the table, ALMT achieves the best performance due to the adaptiveness of $m_{t}$ , which effectively avoids both the underfitting (from early epochs) and overfitting (from recent epochs) effects in the teacher model. Apparently, this is not possible with a fixed window size ( $m = m_{\min}$ or $m_{\max}$ ) which hurts performance.
+
+# 5 CONCLUSIONS AND FUTURE WORK
+
+In this paper, we study the OOD generalization of recent CLIP finetuners and propose an effective approach to reduce their overfitting to seen classes. For that, a class-conditional feature generator is used to synthesize OOD features for joint optimization, and the optimization dynamics are further regularized by an adaptive distillation scheme. The superior generalization capability of our approach is demonstrated under different OOD settings. In the future, we plan to go beyond prompt learning and evaluate how much our benefits hold for other finetuning methods like adaptor tuning. Moreover, it would be interesting to figure out how well our "unknown-aware" approach can model uncertainties on unseen data, which can be evaluated on existing OOD detection benchmarks.
+
+# REFERENCES
+
+Emmanuel Abbe, Samy Bengio, Aryo Lotfi, and Kevin Rizk. Generalization on the unseen, logic reasoning and degree curriculum. In ICML, 2023.
+Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101-mining discriminative components with random forests. In ECCV, 2014.
+Xi Chen, Xiao Wang, Soravit Changpinyo, AJ Piergiovanni, Piotr Padlewski, Daniel Salz, Sebastian Alexander Goodman, Adam Grycner, Basil Mustafa, Lucas Beyer, Alexander Kolesnikov, Joan Puigcerver, Nan Ding, Keran Rong, Hassan Akbari, Gaurav Mishra, Linting Xue, Ashish Thapliyal, James Bradbury, Weicheng Kuo, Mojtaba Seyedhosseini, Chao Jia, Burcu Karagol Ayan, Carlos Riquelme, Andreas Steiner, Anelia Angelova, Xiaohua Zhai, Neil Houlsby, and Radu Soricut. PaLI: A jointly-scaled multilingual language-image model. In ICLR, 2023.
+Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In CVPR, 2014.
+Wenliang Dai, Lu Hou, Lifeng Shang, Xin Jiang, Qun Liu, and Pascale Fung. Enabling multimodal generation on CLIP via vision-language knowledge distillation. In ACL, 2022.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009.
+Xiaoyi Dong, Jianmin Bao, Yinglin Zheng, Ting Zhang, Dongdong Chen, Hao Yang, Ming Zeng, Weiming Zhang, Lu Yuan, Dong Chen, Fang Wen, and Nenghai Yu. MaskCLIP: Masked self-distillation advances contrastive language-image pretraining. In CVPR, 2023.
+Xuefeng Du, Zhaoning Wang, Mu Cai, and Yixuan Li. Vos: Learning what you don't know by virtual outlier synthesis. In ICLR, 2022.
+Sepideh Esmaeilpour, Bing Liu, Eric Robertson, and Lei Shu. Zero-shot out-of-distribution detection based on the pretrained model clip. In AAAI, 2022.
+Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In CVPR workshop, 2004.
+Stanislav Fort, Jie Jessie Ren, and Balaji Lakshminarayanan. Exploring the limits of out-of-distribution detection. In NeurIPS, 2021.
+Golnaz Ghiasi, Xiuye Gu, Yin Cui, and Tsung-Yi Lin. Open-vocabulary image segmentation. arXiv preprint arXiv:2112.12143, 2021.
+Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. Open-vocabulary object detection via vision and language knowledge distillation. In ICLR, 2022.
+Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens., 2019.
+Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+Hexiang Hu, Yi Luan, Yang Chen, Urvashi Khandelwal, Mandar Joshi, Kenton Lee, Kristina Toutanova, and Ming-Wei Chang. Open-domain visual entity recognition: Towards recognizing millions of wikipedia entities. arXiv preprint arXiv:2302.11154, 2023.
+Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021.
+Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In ECCV, 2022.
+
+Muhammad Uzair Khattak, Hanoona Rasheed, Muhammad Maaz, Salman Khan, and Fahad Shahbaz Khan. MaPLe: Multi-modal prompt learning. In CVPR, 2023a.
+Muhammad Uzair Khattak, Syed Talal Wasim, Muzammal Naseer, Salman Khan, Ming-Hsuan Yang, and Fahad Shahbaz Khan. Self-regulating prompts: Foundational model adaptation without forgetting. In ICCV, 2023b.
+Wonjae Kim, Bokyung Son, and Ildoo Kim. Vilt: Vision-and-language transformer without convolution or region supervision. In ICML, 2021.
+Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In ICCV workshops, 2013.
+Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. In ICLR, 2018.
+Junnan Li, Ramprasaath R. Selvaraju, Akhilesh Deepak Gotmare, Shafiq Joty, Caiming Xiong, and Steven Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, 2021.
+Xuanlin Li, Yunhao Fang, Minghua Liu, Zhan Ling, Zhuowen Tu, and Hao Su. Distilling large vision-language model with out-of-distribution generalizability. In ICCV, 2023.
+Yangguang Li, Feng Liang, Lichen Zhao, Yufeng Cui, Wanli Ouyang, Jing Shao, Fengwei Yu, and Junjie Yan. Supervision exists everywhere: A data efficient contrastive language-image pretraining paradigm. In ICLR, 2022.
+Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
+Z. Mal, G. Luo, J. Gao, L. Li, Y. Chen, S. Wang, C. Zhang, and W. Hu. Open-vocabulary one-stage detection with hierarchical visual-language knowledge distillation. In CVPR, 2022.
+Yifei Ming, Ziyang Cai, Jiuxiang Gu, Yiyou Sun, Wei Li, and Yixuan Li. Delving into out-of-distribution detection with vision-language representations. In NeurIPS, 2022.
+Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In ICVGIP, 2008.
+Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In CVPR, 2012.
+Rui Qian, Yeqing Li, Zheng Xu, Ming-Hsuan Yang, Serge Belongie, and Yin Cui. Multimodal open-vocabulary video classification via pre-trained vision and language models. arXiv preprint arXiv:2207.07646, 2022.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
+Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. LAION-400M: open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
+Yang Shu, Xingzhuo Guo, Jialong Wu, Ximei Wang, Jianmin Wang, and Mingsheng Long. CLIPood: Generalizing clip to out-of-distributions. In ICML, 2023.
+Kihyuk Sohn, David Berthelot, Nicholas Carlini, Zizhao Zhang, Han Zhang, Colin A Raffel, Ekin Dogus Cubuk, Alexey Kurakin, and Chun-Liang Li. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. In NeurIPS, 2020.
+Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012.
+
+Leitian Tao, Xuefeng Du, Jerry Zhu, and Yixuan Li. Non-parametric outlier synthesis. In ICLR, 2023.
+Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In NeurIPS, 2017.
+Zhengbo Wang, Jian Liang, Ran He, Nan Xu, Zilei Wang, and Tieniu Tan. Improving zero-shot generalization for clip with synthesized prompts. In ICCV, 2023.
+Yongqin Xian, Bernt Schiele, and Zeynep Akata. Zero-shot learning-the good, the bad and the ugly. In CVPR, 2017.
+Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In CVPR, 2010.
+Hantao Yao, Rui Zhang, and Changsheng Xu. Visual-language prompt tuning with knowledge-guided context optimization. In CVPR, 2023.
+Yuhang Zang, Wei Li, Kaiyang Zhou, Chen Huang, and Chen Change Loy. Open-vocabulary detr with conditional matching. In ECCV, 2022a.
+Yuhang Zang, Wei Li, Kaiyang Zhou, Chen Huang, and Chen Change Loy. Unified vision and language prompt learning. arXiv preprint arXiv:2210.07225, 2022b.
+Renrui Zhang, Zhang Wei, Rongyao Fang, Peng Gao, Kunchang Li, Jifeng Dai, Yu Jiao Qiao, and Hongsheng Li. Tip-adapter: Training-free adaption of clip for few-shot classification. In ECCV, 2022.
+Yiwu Zhong, Jianwei Yang, Pengchuan Zhang, Chunyuan Li, Noel Codella, Liunian Harold Li, Luowei Zhou, Xiyang Dai, Lu Yuan, Yin Li, et al. Regionclip: Region-based language-image pretraining. In CVPR, 2022.
+Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. IJCV, 2022a.
+Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In CVPR, 2022b.
+
+
+
+
+
+
+
+
+Figure 4: More example learning curves of the long finetuning runs (200 epochs) with CoOp (Zhou et al., 2022a) method. Under the within-dataset generalization setting, CoOp typically overfits the known classes and achieves decreasing accuracy for the unknown classes. The class-conditional feature generator plays a key role in our full method OGEN, which reduces overfitting by generating OOD features for the unknown-aware optimization. Our adaptive self-distillation method further reduces overfitting via regularizing the optimization dynamics.
+
+
+
+
+
+
+Figure 5: Learning curves of the long finetuning runs (100 epochs) with KgCoOp (Yao et al., 2023) vs. OGEN-KgCoOp methods (within-dataset generalization setting). Despite the overfitting reducing technique used in KgCoOp, it still suffers from some extent of overfitting. See how OGEN often improves the learning curves of both base and new classes.
+
+
+
+
+
+# A REMARKS ON PROBLEM DEFINITION
+
+The focus of this paper is to understand the behaviors of and improve OOD generalization of CLIP finetuning. As shown in Fig. 1(a) of the main paper, the CLIP model can be finetuned on various downstream tasks before evaluating OOD generalization. Two settings are considered: 1) within-dataset generalization where one dataset has ID (base) vs. OOD (new) class splits for finetuning and evaluation respectively; 2) cross-dataset generalization with one ID dataset for finetuning and other OOD datasets for evaluation.
+
+Note CLIP is pretrained on enormous volumes of data, which inevitably could have class overlap with some "OOD" data for evaluation. Also, there could be potential class overlap between the curated ID and OOD data themselves, e.g., under the cross-dataset generalization setting where the dataset pair may include similar categories in their class taxonomies. Therefore, we consider more of a generalized OOD generalization test for the large-scale pretrained CLIP model. That is, whenever the class overlap happens, the domain-incremental distribution shift is considered in our evaluation, otherwise we evaluate under the strictly class-incremental distribution shift.
+
+
+Figure 6: Base-to-new class generalization when our OGEN approach is applied to the CoOp baseline that suffers from overfitting due to a long learning schedule (200 epochs). OGEN largely overcomes overfitting and (a) improves OOD generalization on new classes for all 11 datasets, sometimes by a large margin. (b) At the same time, OGEN is able to improve the base class accuracies on most datasets, with only minor accuracy drop on a few others.
+
+
+
+# B OVERFITTING WITH CLIP FINETUNING: MORE EXAMPLES
+
+Fig. 4 shows more learning curves of the prompt learning method CoOp (Zhou et al., 2022a) that finetunes CLIP on a long schedule. Clearly, CoOp overfits on all the considered datasets with decreasing generalization performance on the unknown classes. While both components of our proposed OGEN method - class-conditional feature generator and adaptive self-distillation - are found useful to address overfitting. Our feature generator is observed to play a key role by generating OOD features for the following unknown-aware optimization and regularization.
+
+Fig. 5 shows example learning curves of one of the state-of-the-art methods KgCoOp (Yao et al., 2023). This method has relatively long finetuning runs by default (100 epochs). We can see that KgCoOp still suffers from some extent of overfitting, although there is an overfitting reducing component in it. Our OGEN can further alleviate overfitting with KgCoOp, improving its learning curves of both base and new classes.
+
+# C VISUALIZING PER-Dataset RESULTS
+
+Fig. 6 breaks down the performance gap between CoOp and our OGEN-CoOp on both the base and new classes for 11 datasets. The base-to-new class generalization setting is considered on each dataset.
+
+# D FEATURE SYNTHESIS VS. REPLAY-BASED METHOD
+
+Recall the goal of our class-conditional feature generator is to model the vast space and complex distribution of unknown class data in OOD domains. Here we investigate how well our synthesized OOD features can represent the real world of unknown data. Specifically, we explore the use of replay methods by sampling real OOD data from the large-scale LAION-400M dataset (Schuhmann et al., 2021) and using the sampled data for replay. We compare our synthesized OOD features against those real OOD data in terms of their contribution to training regularization on downstream tasks.
+
+Experimental details. We experiment under the base-to-new class generalization setting where CoOp (Zhou et al., 2022a) is the CLIP finetuning baseline on each of the 11 downstream datasets. For fair comparison between the OGEN- and replay-boosted CoOp variants, we always use ALMT with the only difference in the OOD data source (synthesis vs. replay).
+
+# Sampling of replay data.
+
+- Class filtering: to ensure the replay data serve as a good proxy of OOD data for each downstream task, we need to perform class filtering when sampling image-text-pairs from LAION-400M, i.e., we filter image-text-pairs that are semantically close to those "known" classes on the considered dataset. We do so by using CLIP to calculate the cosine similarity
+
+
+
+
+
+
+
+
+Figure 7: OOD feature synthesis is much more data efficient than replaying real OOD data. Real OOD data are sampled from LAION-400M dataset with varying data scale, i.e., multiple times more than the synthesized data. Here we use the CoOp baseline for base-to-new class generalization, and measure the Harmonic mean of base and new accuracies. (a) We can see that OGEN with OOD feature synthesis creates about $3.5\mathrm{x}$ and $7.5\mathrm{x}$ gain in data efficiency on average across 11 datasets, when compared to the replay method with hard sample mining and random sampling strategy respectively (see text for details). (b-c) The replayed OOD samples, despite being data inefficient, are more helpful when they have a closer semantic or data distribution with the downstream dataset (e.g., Caltech101) so to act as semi-hard negatives. They are far less useful for distributionally different DTD, the texture database. On the other hand, OGEN benefits from dataset-specific OOD feature synthesis, which often offers hard negatives to boost data efficiency for training.
+
+between the text features of the query text and known class names, and then dropping query texts with the maximum similarity score higher than 0.82. Note our synthesized features are guaranteed to be OOD since they are generated in a class-conditional manner with the query classes disjoint from known classes.
+
+- Sampling strategy: with class filtering in place, we consider both random data sampling and hard sample mining to retrieve replay data from LAION-400M. For hard sample mining, we first rank the query texts from a sufficiently large pool (randomly sampled) in terms of the maximum similarity score mentioned above. Then we simply select the top similar query texts and use the corresponding images as hard replay data (similar to hard negatives from hard negative sampling).
+- Sampling data size: given the large amount of image-text-pairs in LAION-400M, we increase the data size of the replay data (either random or hard) by 1-to-12x more than the size of our synthesized OOD data on each downstream dataset. Note our feature generator synthesizes the same amount of OOD features as the "unknown" class splits of the training set of considered dataset.
+
+# Observations from Fig. 7.
+
+- Better performance is generally obtained with the use of more real OOD data for replay, and performance grows faster with hard mined replay data. When sufficient replay data are used, the performance can surpass that of our synthesized OOD features. This demonstrates the benefits of sampling big and diverse OOD data for training regularization purposes.
+- However, our feature synthesis approach is much more data efficient than replay-based methods. The key reason behind such advantage is that our feature generator is more likely to generate hard OOD samples to better regularize decision boundaries, in comparison to real-world samples. In our case, 1) the feature generator itself is trained on the downstream dataset, thus can synthesize dataset-specific OOD features that adapt better to the task at hand. 2) Recall that we extrapolate OOD features from kNN known class features. This suggests there is inevitable shared information between the known class and synthesized features, further increasing the hardness of the latter. On the other hand, both of the aforementioned factors are missing for the real OOD data sampled from a separate domain, which contributes to their data inefficiency in training regularization. Real OOD data are most useful when they are distributionally similar to the downstream dataset (e.g., Caltech101) and hence can act as semi-hard negatives. Otherwise, data efficiency will see a significant drop when replaying OOD data on distributionally distant dataset like DTD. On
+
+average (across 11 datasets), our feature synthesis method is about $3.5\mathrm{x}$ and $7.5\mathrm{x}$ more data efficient than the replay method with hard mining and random sampling respectively.
+
+Summary. Replay-based methods perform well with large data size, but suffer from low data efficiency as well as large memory cost (to maintain replay data). Our class-conditional feature generator avoids these issues by synthesizing hard OOD features on the fly. Note our feature generator is lightweight and only incurs small computational cost. Its runtime on GPU is 0.019 seconds, which is significantly smaller than that of the feature extraction step of CLIP (text encoder: 0.046 seconds, image encoder: 1.016 seconds). One promising future direction is the combination of our feature synthesis method and replay methods, aiming to take advantage of their respective benefits of data efficiency and diversity.
\ No newline at end of file
diff --git a/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/images.zip b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d67e8e9b5a3768e28ab5547c45c0c24bcc148395
--- /dev/null
+++ b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:574e73db8c2cf027a85f7f602ba4a553a584d3c59f8e45a3695a954749a6f8f6
+size 905135
diff --git a/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/layout.json b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7304eb26080b1a7a2527b48e7b93fbf8388736ee
--- /dev/null
+++ b/overcomingthepitfallsofvisionlanguagemodelfinetuningforoodgeneralization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:298ec82d391c0cf0a7bb6d54eeacec1758e969a7b564152375e3bf95b520b344
+size 473805
diff --git a/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_content_list.json b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..437e4e93de45f3490b422c0fdbcca8ba108423e6
--- /dev/null
+++ b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5d77b920ab837471a22eef976243169ad2a96f903aee5a76198c52126a36fa8b
+size 151270
diff --git a/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_model.json b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..50b1de30c5ebb35d64de7af561be6eb59aa965b0
--- /dev/null
+++ b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8508b8788f4454cfb7baf5e0be0c1ad5475d8d30467c53a0492c7628d9f891a
+size 176993
diff --git a/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_origin.pdf b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..86b6101a7f752781c5b299994a04f788925333f5
--- /dev/null
+++ b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/545b26ce-6dd1-47a9-8f7a-cc0a3bbd491d_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41f103cb0b09840ec4e45cdf49ec93bd04de53f1cc77f333ac7eb3e7a4d95d6a
+size 1641190
diff --git a/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/full.md b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..387a4e0b6cf24a8584c031259f46f1aebff37eec
--- /dev/null
+++ b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/full.md
@@ -0,0 +1,654 @@
+# $\mathbf{P}^2\mathrm{OT}$ : PROGRESSIVE PARTIAL OPTIMAL TRANSPORT FOR DEEP IMBALANCED CLUSTERING
+
+Chuyu Zhang $^{1,2,*}$ Hui Ren $^{1,*}$ Xuming He $^{1,3}$
+
+$^{1}$ ShanghaiTech University, Shanghai, China $^{2}$ Lingang Laboratory, Shanghai, China
+$^{3}$ Shanghai Engineering Research Center of Intelligent Vision and Imaging, Shanghai, China
+
+{zhangchy2, renhui, hexm}@shanghaiitech.edu.cn
+
+# ABSTRACT
+
+Deep clustering, which learns representation and semantic clustering without labels information, poses a great challenge for deep learning-based approaches. Despite significant progress in recent years, most existing methods focus on uniformly distributed datasets, significantly limiting the practical applicability of their methods. In this paper, we first introduce a more practical problem setting named deep imbalanced clustering, where the underlying classes exhibit an imbalance distribution. To tackle this problem, we propose a novel pseudo-labeling-based learning framework. Our framework formulates pseudo-label generation as a progressive partial optimal transport problem, which progressively transports each sample to imbalanced clusters under prior distribution constraints, thus generating imbalance-aware pseudo-labels and learning from high-confident samples. In addition, we transform the initial formulation into an unbalanced optimal transport problem with augmented constraints, which can be solved efficiently by a fast matrix scaling algorithm. Experiments on various datasets, including a human-curated long-tailed CIFAR100, challenging ImageNet-R, and large-scale subsets of fine-grained iNaturalist2018 datasets, demonstrate the superiority of our method.
+
+# 1 INTRODUCTION
+
+Human beings possess the innate ability to categorize similar concepts, even when encountering them for the first time. In contrast, artificial models struggle to group similar concepts without labels, although they excel primarily in scenarios where extensive semantic labeling is available. Deep clustering, which aims to learn representation and semantic clustering, is proposed to enable models to achieve that. Currently, many works (Ji et al., 2019; Van Gansbeke et al., 2020; Ronen et al., 2022) are advancing the field of deep clustering. However, they focus on developing methods on balanced datasets, limiting their application in reality, where the data distributions are imbalanced.
+
+In this paper, we propose a practical deep imbalanced clustering problem, bridging the gap between the existing deep clustering and real-world application. Existing methods are broadly categorized into relation matching-based (Dang et al., 2021), mutual information maximization-based (Ji et al., 2019), and pseudo-labeling (PL)-based (Van Gansbeke et al., 2020). They face significant challenges when dealing with imbalanced clustering. Relation matching and mutual information maximization act as surrogate losses for clustering and show inferior results compared to the PL method (Van Gansbeke et al., 2020; Niu et al., 2022). PL, on the other hand, tends to learn degenerate solutions (Caron et al., 2018) and heavily relies on the quality of the pseudo-labels. This reliance often requires an additional training stage for representation initialization and sensitive hyperparameter tuning to mitigate confirmation bias (Arazo et al., 2020; Wei et al., 2021), especially in challenging imbalanced clustering scenarios, where imbalanced learning will seriously affect the quality of pseudo labels.
+
+To mitigate the above weakness, we propose a novel PL-based progressive learning framework for deep imbalanced clustering. Our framework introduces a novel Progressive Partial Optimal Transport $(\mathrm{P}^2\mathrm{OT})$ algorithm, which integrates imbalance class distribution modeling and confident sample selection within a single optimization problem, enabling us to generate imbalanced pseudo labels and learn from high-confident samples in a progressive manner. Computationally, we reformulate our $\mathrm{P}^2\mathrm{OT}$ as a typical unbalanced OT problem with a theoretical guarantee and employ the light-speed scaling algorithm (Cuturi, 2013; Chizat et al., 2018) to solve it.
+
+Specifically, in our progressive PL-based learning framework, we leverage cluster estimation to generate soft pseudo-labels while imposing a set of prior constraints, including an inequality constraint governing sample weight, a Kullback-Leibler ( $KL$ ) divergence constraint on cluster size uniform distribution, and a total mass constraint. Notably, the $KL$ divergence-based uniform distribution constraint empowers our method to avoid degenerate solutions. And our approach with $KL$ , which represents a relaxed constraint compared to an equality constraint, facilitates the generation of imbalanced pseudo-labels. The total mass constraint allows us to selectively learn from high-confident samples by adjusting their weights through optimization, alleviating the noisy pseudo-label learning, and eliminating the sensitive and hand-crafted confidence threshold tuning. As training progresses, we incrementally raise the total mass value, facilitating a gradual transition from learning easy samples to tackling more difficult ones. To solve our $\mathrm{P}^2\mathrm{OT}$ problem efficiently, we introduce a virtual cluster and replace the naive $KL$ with the weighted $KL$ constraint, thus reformulating our $\mathrm{P}^2\mathrm{OT}$ into an unbalanced optimal transport problem under transformed constraints. Then, we solve the unbalanced OT with a scaling algorithm that relies on light-speed matrix-vector multiplications.
+
+To validate our method, we propose a new challenging benchmark, which encompasses a diverse range of datasets, including the human-curated CIFAR100 dataset (Krizhevsky et al., 2009), challenging 'out-of-distribution' ImageNet-R dataset (Hendrycks et al., 2021), and large-scale subsets of fine-grained iNaturalist18 dataset (Van Horn et al., 2018). Experiments on those challenging datasets demonstrate the superiority of our method. In summary, our contribution is as follows:
+
+- We generalize the deep clustering problem to more realistic and challenging imbalance scenarios, and establish a new benchmark.
+- We propose a novel progressive PL-based learning framework for deep imbalance clustering, which formulates the pseudo label generation as a novel $\mathrm{P}^2\mathrm{OT}$ problem, enabling us to consider class imbalance distribution and progressive learning concurrently.
+- We reformulate the $\mathrm{P}^2\mathrm{OT}$ problem as an unbalanced OT problem with a theoretical guarantee, and solve it with the efficient scaling algorithm.
+- Our method achieves the SOTA performance on most datasets compared with existing methods on our newly proposed challenging and large-scale benchmark.
+
+# 2 RELATED WORK
+
+Deep clustering. The goal of deep clustering (Zhou et al., 2022a; Huang et al., 2022) is to learn representation and cluster data into semantic classes simultaneously. Based on clustering methods, current works can be grouped into three categories: relation matching, mutual information maximization, and pseudo labeling. Specifically, relation matching (Chang et al., 2017; Van Gansbeke et al., 2020; Tao et al., 2020) involves the minimization of the distance between instances considered 'similar' by representation distance, thus achieving clustering in a bottom-up way. Mutual information maximization (Ji et al., 2019; Li et al., 2021; Shen et al., 2021) either in the prediction or representation space, aims at learning invariant representations, thereby achieving clustering implicitly (Ben-Shaul et al., 2023). Pseudo labeling (PL) (Lee et al., 2013), which is widely used in semi-supervised learning (SSL) (Sohn et al., 2020; Zhang et al., 2021a), assigns each instance to semantic clusters and has demonstrated exceptional performance in the domain of deep clustering (Caron et al., 2018; Van Gansbeke et al., 2020; Asano et al., 2020; Niu et al., 2022). In contrast to the relatively clean pseudo-labels produced by SSL, deep clustering often generates noisier pseudo-labels, particularly in scenarios characterized by data imbalance, imposing a great challenge on pseudo-label generation. In this paper, our primary focus is on PL, and we introduce a novel $\mathrm{P^2OT}$ algorithm. This algorithm progressively generates high-quality pseudo labels by simultaneously considering class imbalance distribution and sample confidence through a single convex optimization problem.
+
+Optimal transport and its application. Optimal Transport (OT) (Villani et al., 2009; Peyre et al., 2017; Chizat et al., 2018; Khamis et al., 2023) aims to find the most efficient transportation plan while adhering to marginal distribution constraints. It has been used in a broad spectrum of machine learning tasks, including but not limited to generative model (Frogner et al., 2015; Gulrajani et al., 2017), semi-supervised learning (Tai et al., 2021; Taherkhani et al., 2020), clustering (Asano et al., 2020; Caron et al., 2020), and domain adaptation (Flamary et al., 2016; Chang et al., 2022; Liu et al., 2023; Chang et al., 2023). Of particular relevance to our work is its utilization in pseudo labeling (Asano et al., 2020; Tai et al., 2021; Zhang et al., 2023). Asano et al. (2020) initially
+
+introduces an equality constraint on cluster size, formulating pseudo-label generation as an optimal transport problem. Subsequently, Tai et al. (2021) enhances the flexibility of optimal transport by incorporating relaxation on the constraint, which results in its failure in deep imbalanced clustering, and introduces label annealing strategies through an additional total mass constraint. Recently, Zhang et al. (2023) relaxes the equality constraint to a $KL$ divergence constraint on cluster size, thereby addressing imbalanced data scenarios. In contrast to these approaches, which either ignore class imbalance distribution or the confidence of samples, our novel $\mathrm{P}^2\mathrm{OT}$ algorithm takes both into account simultaneously, allowing us to generate pseudo-labels progressively and with an awareness of class imbalance. In terms of computational efficiency, we transform our $\mathrm{P}^2\mathrm{OT}$ into an unbalanced optimal transport (OT) problem under specific constraints and utilize a light-speed scaling algorithm.
+
+# 3 PRELIMINARY
+
+Optimal Transport (OT) is the general problem of moving one distribution of mass to another with minimal cost. Mathematically, given two probability vectors $\pmb{\mu} \in \mathbb{R}^{m \times 1}$ , $\pmb{\nu} \in \mathbb{R}^{n \times 1}$ , as well as a cost matrix $\mathbf{C} \in \mathbb{R}^{m \times n}$ defined on joint space, the objective function which OT minimizes is as follows:
+
+$$
+\min _ {\mathbf {Q} \in \mathbb {R} ^ {m \times n}} \left\langle \mathbf {Q}, \mathbf {C} \right\rangle_ {F} + F _ {1} \left(\mathbf {Q} \mathbf {1} _ {n}, \boldsymbol {\mu}\right) + F _ {2} \left(\mathbf {Q} ^ {\top} \mathbf {1} _ {m}, \boldsymbol {\nu}\right) \tag {1}
+$$
+
+where $\mathbf{Q} \in \mathbb{R}^{m \times n}$ is the transportation plan, $\langle, \rangle_F$ denotes the Frobenius product, $F_1, F_2$ are constraints on the marginal distribution of $\mathbf{Q}$ and $\mathbf{1}_n \in \mathbb{R}^{n \times 1}$ , $\mathbf{1}_m \in \mathbb{R}^{m \times 1}$ are all ones vector. For example, if $F_1, F_2$ are equality constraints, i.e. $\mathbf{Q}\mathbf{1}_n = \boldsymbol{\mu}, \mathbf{Q}^\top\mathbf{1}_m = \boldsymbol{\nu}$ , the above OT becomes a widely-known Kantorovich's form (Kantorovich, 1942). And if $F_1, F_2$ are $KL$ divergence or inequality constraints, Equ.(1) turns into the unbalanced OT problem (Liero et al., 2018).
+
+In practice, to efficiently solve Kantorovich's form OT problem, Cuturi (2013) introduces an entropy term $-\epsilon \mathcal{H}(\mathbf{Q})$ to Equ.(1) and solve the entropic regularized OT with the efficient scaling algorithm (Knight, 2008). Subsequently, Chizat et al. (2018) generalizes the scaling algorithm to solve the unbalanced OT problem. Additionally, one can introduce the total mass constraint to Equ.(1), and it can be solved by the efficient scaling algorithm by adding a dummy or virtual point to absorb the total mass constraint into marginal. We detail the scaling algorithm in Appendix A and refer readers to (Cuturi, 2013; Chizat et al., 2018) for more details.
+
+# 4 METHOD
+
+# 4.1 PROBLEM SETUP AND METHOD OVERVIEW
+
+In deep imbalanced clustering, the training dataset is denoted as $\mathcal{D} = \{(x_i)\}_{i=1}^N$ , where the cluster labels and distribution are unknown. The number of clusters $K$ is given as a prior. The goal is to learn representation and semantic clusters. To achieve that, we learn representation and pseudo-label alternately, improving the data representation and the quality of cluster assignments. Specifically, given the cluster prediction, we utilize our novel Progressive Partial Optimal Transport $(\mathrm{P}^2\mathrm{OT})$ algorithm to generate high-quality pseudo labels. Our $\mathrm{P}^2\mathrm{OT}$ algorithm has two advantages: 1) generating pseudo labels in an imbalanced manner; 2) reweighting confident samples through optimization. Then, given the pseudo label, we update the representation. We alternate the above two steps until convergence. In the following section, we mainly detail our $\mathrm{P}^2\mathrm{OT}$ algorithm.
+
+# 4.2 PROGRESSIVE PARTIAL OPTIMAL TRANSPORT $(\mathrm{P}^2\mathrm{OT})$
+
+In this section, we derive the formulation of our novel $\mathrm{P}^2\mathrm{OT}$ algorithm and illustrate how to infer pseudo label $\mathbf{Q}$ by the $\mathrm{P}^2\mathrm{OT}$ algorithm. Given the model's prediction and its pseudo-label, the loss function is denoted as follows:
+
+$$
+\mathcal {L} = - \sum_ {i = 1} ^ {N} \mathbf {Q} _ {i} \log \mathbf {P} _ {i} = \langle \mathbf {Q}, - \log \mathbf {P} \rangle_ {F}, \tag {2}
+$$
+
+where $\mathbf{Q},\mathbf{P}\in \mathbb{R}_{+}^{N\times K}$ , $\mathbf{Q}_i,\mathbf{P}_i$ is the pseudo label and prediction of sample $x_{i}$ . Note that we have absorbed the normalize term $\frac{1}{N}$ into $\mathbf{Q}$ for simplicity, thus $\mathbf{Q}\mathbf{1}_K = \frac{1}{N}\mathbf{1}_N$ .
+
+In deep clustering, it is typical to impose some constraint on the cluster size distribution to avoid a degenerate solution, where all the samples are assigned to a single cluster. As the cluster distribution is
+
+long-tailed and unknown, we adopt a $KL$ divergence constraint and only assume the prior distribution is uniform. Therefore, with two marginal distribution constraints, we can formulate the pseudo-label generation problem as an unbalanced OT problem:
+
+$$
+\min _ {\mathbf {Q} \in \Pi} \left\langle \mathbf {Q}, - \log \mathbf {P} \right\rangle_ {F} + \lambda K L \left(\mathbf {Q} ^ {\top} \mathbf {1} _ {N}, \frac {1}{K} \mathbf {1} _ {K}\right) \tag {3}
+$$
+
+$$
+\text {s . t .} \quad \Pi = \left\{\mathbf {Q} \in \mathbb {R} _ {+} ^ {N \times K} \mid \mathbf {Q} \mathbf {1} _ {K} = \frac {1}{N} \mathbf {1} _ {N} \right\} \tag {4}
+$$
+
+where $\langle ,\rangle_F$ is the Frobenius product, and $\lambda$ is a scalar factor. In Equ.(3), the first term is exactly $\mathcal{L}$ , the $KL$ term is a constraint on cluster size, and the equality term ensures each sample is equally important. However, the unbalanced OT algorithm treats each sample equally, which may generate noisy pseudo labels, due to the initial representation being poor, resulting in confirmation bias. Inspired by curriculum learning, which first learns from easy samples and gradually learns hard samples, we select only a fraction of high-confident samples to learn initially and increase the fraction gradually. However, instead of manually selecting confident samples through thresholding, we formulate the selection process as a total mass constraint in Equ.(5). This approach allows us to reweight each sample through joint optimization with the pseudo-label generation, eliminating the need for sensitive hyperparameter tuning. Therefore, the formulation of our novel $\mathrm{P}^2\mathrm{OT}$ is as follows:
+
+$$
+\min _ {\mathbf {Q} \in \Pi} \left\langle \mathbf {Q}, - \log \mathbf {P} \right\rangle_ {F} + \lambda K L \left(\mathbf {Q} ^ {\top} \mathbf {1} _ {N}, \frac {\rho}{K} \mathbf {1} _ {K}\right) \tag {5}
+$$
+
+$$
+\text {s . t .} \quad \Pi = \left\{\mathbf {Q} \in \mathbb {R} _ {+} ^ {N \times K} \mid \mathbf {Q} \mathbf {1} _ {K} \leq \frac {1}{N} \mathbf {1} _ {N}, \mathbf {1} _ {N} ^ {\top} \mathbf {Q} \mathbf {1} _ {K} = \rho \right\} \tag {6}
+$$
+
+where $\rho$ is the fraction of selected mass and will increase gradually, and $KL$ is the unnormalized divergence measure, enabling us to handle imbalance distribution. The resulted $\mathbf{Q1}_K$ is the weight for samples. Intuitively, the $\mathrm{P}^2\mathrm{OT}$ subsumes a set of prior distribution constraints, achieving imbalanced pseudo-label generation and confident sample "selection" in a single optimization problem.
+
+Increasing strategy of $\rho$ . In our formulation, the ramp-up strategy for the parameter $\rho$ plays an important role in model performance. Instead of starting with 0 and incrementally increasing to 1, we introduce an initial value $\rho_0$ to mitigate potential issues associated with the model learning from very limited samples in the initial stages. And we utilize the sigmoid ramp-up function, a technique commonly employed in semi-supervised learning (Samuli Laine, 2017; Tarvainen & Valpola, 2017). Therefore, the increasing strategy of $\rho$ is expressed as follows:
+
+$$
+\rho = \rho_ {0} + (1 - \rho_ {0}) \cdot e ^ {- 5 (1 - t / T) ^ {2}}, \tag {7}
+$$
+
+where $T$ represents the total number of iterations, and $t$ represents the current iteration. We analyze and compare alternate design choices (e.g. linear ramp-up function) in our ablation study. Furthermore, we believe that a more sensible approach to setting $\rho$ involves adaptively increasing it based on the model's learning progress rather than relying on a fixed parameterization tied to the number of iterations. We leave the advanced design of $\rho$ for future work.
+
+# 4.3 EFFICIENT SOLVER FOR $\mathbf{P}^2\mathrm{OT}$
+
+In this section, we reformulate our $\mathrm{P}^2\mathrm{OT}$ into an unbalanced OT problem and solve it with an efficient scaling algorithm. Our approach involves introducing a virtual cluster onto the marginal (Caffarelli & McCann, 2010; Chapel et al., 2020). This virtual cluster serves the purpose of absorbing the $1 - \rho$ unselected mass, enabling us to transform the total mass constraint into the marginal constraint. Additionally, we replace the $KL$ constraint with a weighted $KL$ constraint to ensure strict adherence to the total mass constraint. As a result, we can reformulate Equ.(5) into a form akin to Equ.(1) and prove their solutions can be interconverted. Subsequently, we resolve this reformulated problem using an efficient scaling algorithm. As shown in Sec.5.3, compared to the generalized scaling solver proposed by (Chizat et al., 2018), our solver is two times faster.
+
+Specifically, we denote the assignment of samples on the virtual cluster as $\xi$ . Then, we extend $\xi$ to $\mathbf{Q}$ , and denote the extended $\mathbf{Q}$ as $\hat{\mathbf{Q}}$ which satisfies the following constraints:
+
+$$
+\hat {\mathbf {Q}} = \left[ \mathbf {Q}, \boldsymbol {\xi} \right] \in \mathbb {R} ^ {N \times (K + 1)}, \quad \boldsymbol {\xi} \in \mathbb {R} ^ {N \times 1}, \quad \hat {\mathbf {Q}} \mathbf {1} _ {K + 1} = \mathbf {1} _ {N}. \tag {8}
+$$
+
+Due to $\mathbf{1}_N^\top \mathbf{Q}\mathbf{1}_K = \rho$ , we know that,
+
+$$
+\mathbf {1} _ {N} ^ {\top} \hat {\mathbf {Q}} \mathbf {1} _ {K + 1} = \mathbf {1} _ {N} ^ {\top} \mathbf {Q} \mathbf {1} _ {K} + \mathbf {1} _ {N} ^ {\top} \boldsymbol {\xi} = 1 \Rightarrow \mathbf {1} _ {N} ^ {\top} \boldsymbol {\xi} = 1 - \rho . \tag {9}
+$$
+
+Therefore,
+
+$$
+\hat {\mathbf {Q}} ^ {\top} \mathbf {1} _ {N} = \left[ \begin{array}{l} \mathbf {Q} ^ {\top} \mathbf {1} _ {N} \\ \boldsymbol {\xi} ^ {\top} \mathbf {1} _ {N} \end{array} \right] = \left[ \begin{array}{c} \mathbf {Q} ^ {\top} \mathbf {1} _ {N} \\ 1 - \rho \end{array} \right]. \tag {10}
+$$
+
+The equation is due to $1_N^\top \pmb {\xi} = \pmb{\xi}^T\mathbf{1}_N = 1 - \rho$ . We denote $\mathbf{C} = [-\log \mathbf{P},\mathbf{0}_N]$ and replace $\mathbf{Q}$ with $\hat{\mathbf{Q}}$ thus the Equ.(5) can be rewritten as follows:
+
+$$
+\min _ {\hat {\mathbf {Q}} \in \Phi} \langle \hat {\mathbf {Q}}, \mathbf {C} \rangle_ {F} + \lambda K L (\hat {\mathbf {Q}} ^ {\top} \mathbf {1} _ {N}, \beta), \tag {11}
+$$
+
+$$
+\text {s . t .} \quad \Phi = \left\{\hat {\mathbf {Q}} \in \mathbb {R} _ {+} ^ {N \times (K + 1)} \mid \hat {\mathbf {Q}} \mathbf {1} _ {K + 1} = \frac {1}{N} \mathbf {1} _ {N} \right\}, \quad \beta = \left[ \begin{array}{c} \frac {\rho}{K} \mathbf {1} _ {K} \\ 1 - \rho \end{array} \right]. \tag {12}
+$$
+
+However, the Equ.(11) is not equivalent to Equ.(5), due to the $KL$ constraint can not guarantee Equ.(10) is strictly satisfied, i.e. $\pmb{\xi}^{\top}\mathbf{1}_N = 1 - \rho$ . To solve this problem, we replace the $KL$ constraint with weighted $KL$ , which enables us to control the constraint strength for each class. The formula of weighted $KL$ is denoted as follows:
+
+$$
+\hat {K L} \left(\hat {\mathbf {Q}} ^ {\top} \mathbf {1} _ {N}, \boldsymbol {\beta}, \boldsymbol {\lambda}\right) = \sum_ {i = 1} ^ {K + 1} \boldsymbol {\lambda} _ {i} \left[ \hat {\mathbf {Q}} ^ {\top} \mathbf {1} _ {N} \right] _ {i} \log \frac {\left[ \hat {\mathbf {Q}} ^ {\top} \mathbf {1} _ {N} \right] _ {i}}{\boldsymbol {\beta} _ {i}}. \tag {13}
+$$
+
+Therefore, the Equ.(5) can be rewritten as follows:
+
+$$
+\min _ {\hat {\mathbf {Q}} \in \Phi} \langle \hat {\mathbf {Q}}, \mathbf {C} \rangle_ {F} + K \hat {L} \left(\hat {\mathbf {Q}} ^ {\top} \mathbf {1} _ {N}, \boldsymbol {\beta}, \boldsymbol {\lambda}\right) \tag {14}
+$$
+
+$$
+\text {s . t .} \quad \Phi = \left\{\hat {\mathbf {Q}} \in \mathbb {R} _ {+} ^ {N \times (K + 1)} \mid \hat {\mathbf {Q}} \mathbf {1} _ {K + 1} = \frac {1}{N} \mathbf {1} _ {N} \right\}, \quad \beta = \left[\begin{array}{l}\frac {\rho}{K} \mathbf {1} _ {K}\\1 - \rho\end{array}\right], \quad \boldsymbol {\lambda} _ {K + 1} \rightarrow + \infty . \tag {15}
+$$
+
+Intuitively, to assure Equ.(10) is strictly satisfied, we set $\lambda_{K + 1}\to +\infty$ . This places a substantial penalty on the virtual cluster, compelling the algorithm to assign a size of $1 - \rho$ to the virtual cluster.
+
+Proposition 1 If $\mathbf{C} = [-\log \mathbf{P}, \mathbf{0}_N]$ , and $\lambda_{:K} = \lambda, \lambda_{K+1} \to +\infty$ , the optimal transport plan $\hat{\mathbf{Q}}^{\star}$ of Equ.(14) can be expressed as:
+
+$$
+\hat {\mathbf {Q}} ^ {\star} = \left[ \mathbf {Q} ^ {\star}, \boldsymbol {\xi} ^ {\star} \right], \tag {16}
+$$
+
+where $\mathbf{Q}^{\star}$ is optimal transport plan of Equ.(5), and $\pmb{\xi}^{\star}$ is the last column of $\hat{\mathbf{Q}}^{\star}$ .
+
+The proof is in Appendix B. Consequently, we focus on solving Equ.(14) to obtain the optimal $\hat{\mathbf{Q}}^*$ .
+
+Proposition 2 Adding a entropy regularization $-\epsilon \mathcal{H}(\hat{\mathbf{Q}})$ to Equ.(14), we can solve it by efficient scaling algorithm. We denote $\mathbf{M} = \exp (-\mathbf{C} / \epsilon),\pmb {f} = \frac{\lambda}{\lambda + \epsilon},\pmb {\alpha} = \frac{1}{N}\mathbf{1}_N$ . The optimal $\hat{\mathbf{Q}}^{\star}$ is denoted as follows:
+
+$$
+\mathbf {Q} ^ {\star} = \operatorname {d i a g} (\mathbf {a}) \mathbf {M} \operatorname {d i a g} (\mathbf {b}), \tag {17}
+$$
+
+where $\mathbf{a},\mathbf{b}$ are two scaling coefficient vectors and can be derived by the following recursion formula:
+
+$$
+\mathbf {a} \leftarrow \frac {\alpha}{\mathbf {M b}}, \quad \mathbf {b} \leftarrow \left(\frac {\beta}{\mathbf {M} ^ {\top} \mathbf {a}}\right) ^ {\circ f}, \tag {18}
+$$
+
+where $\circ$ denotes Hadamard power, i.e., element-wise power. The recursion will stop until $\mathbf{b}$ converges.
+
+The proof is in Appendix C, and the pseudo-code is shown in Alg.1. The efficiency analysis is in the Sec.5.3. In practice, rather than solving the $\mathrm{P}^2\mathrm{OT}$ for the entire dataset, we implement a mini-batch approach and store historical predictions as a memory buffer to stabilize optimization.
+
+# 5 EXPERIMENTS
+
+# 5.1 EXPERIMENTAL SETUP
+
+Datasets. To evaluate our method, we have established a realistic and challenging benchmark, including CIFAR100 (Krizhevsky et al., 2009), ImageNet-R (abbreviated as ImgNet-R) (Hendrycks et al., 2021) and iNaturalist2018 (Van Horn et al., 2018) datasets. To quantify the level of class imbalance, we introduce the imbalance ratio denoted as $R$ , calculated as the ratio of $N_{max}$ to $N_{min}$ ,
+
+Algorithm 1: Scaling Algorithm for $\mathrm{P^2OT}$
+Input: Cost matrix $-\log \mathbf{P},\epsilon ,\lambda ,\rho ,N,K$ a large value $\iota$ $\mathbf{C}\gets [-\log \mathbf{P},\mathbf{0}_N],\quad \boldsymbol {\lambda}\gets [\lambda ,\dots,\lambda ,\iota ]^\top$ $\beta \leftarrow [\frac{\rho}{K}\mathbf{1}_K^\top ,1 - \rho ]^\top$ , $\alpha \leftarrow \frac{1}{N}\mathbf{1}_N$
+b $\leftarrow 1_{K + 1}$ ,M $\leftarrow \exp (-\mathbf{C} / \epsilon)$ ,f $\leftarrow \frac{\lambda}{\lambda + \epsilon}$
+while b not converge do
+a $\leftarrow \frac{\alpha}{\mathrm{Mb}}$
+b $\leftarrow (\frac{\beta}{\mathrm{M}^{\top}\mathrm{a}})^{\circ f}$
+end
+Q $\leftarrow$ diag(a)Mdiag(b)
+return Q[::K]
+
+where $N_{max}$ represents the largest number of images in a class, and $N_{min}$ represents the smallest. For CIFAR100, as in (Cao et al., 2019), we artificially construct a long-tailed CIFAR100 dataset with an imbalance ratio of 100. For ImgNet-R, which has renditions of 200 classes resulting in 30k images and is inherently imbalanced, we split 20 images per class as the test set, leaving the remaining data as the training set ( $R = 13$ ). Note that the data distribution of ImgNet-R is different from the ImageNet, which is commonly used for training unsupervised pre-trained models, posing a great challenge to its clustering. Consequently, ImgNet-R serves as a valuable resource for assessing the robustness of various methods. Furthermore, we incorporate the iNaturalist2018 dataset, a natural long-tailed dataset frequently used in supervised long-tailed learning (Cao et al., 2019; Zhang et al., 2021b). This dataset encompasses 8,142 classes, posing significant challenges for clustering. To mitigate this complexity, we extract subsets of 100, 500, and 1000 classes, creating the iNature100 ( $R = 67$ ), iNature500 ( $R = 111$ ), and iNature1000 ( $R = 111$ ) datasets, respectively. iNature100 is the subset of iNature500, and iNature500 is the subset of iNature1000. The distribution of datasets is in Appendix E. We perform evaluations on both the imbalanced training set and the corresponding balanced test set. Note that we do not conduct experiments on ImageNet datasets because the unsupervised pretrained models have trained on the whole balanced ImageNet.
+
+Evaluation Metric. We evaluate our method using the clustering accuracy (ACC) metric averaged over classes, normalized mutual information (NMI), and F1-score. We also provide the adjusted Rand index (ARI) metrics, which is not a suitable metric for imbalanced datasets, in Appendix H. To provide a more detailed analysis, we rank the classes by size in descending order and divide the dataset into Head, Medium, and Tail categories, maintaining a ratio of 3:4:3 across all datasets. Then, we evaluate performance on the Head, Medium, and Tail, respectively.
+
+Implementation Details. Building upon the advancements in transformer (Dosovitskiy et al., 2020) and unsupervised pre-trained models (He et al., 2022), we conduct experiments on the ViT-B16, which is pre-trained with DINO (Caron et al., 2021). To provide a comprehensive evaluation, we re-implement most methods from the existing literature, including the typical IIC (Ji et al., 2019), PICA (Huang et al., 2020), CC (Li et al., 2021), SCAN (Van Gansbeke et al., 2020), strong two-stage based SCAN* (Van Gansbeke et al., 2020) and SPICE (Niu et al., 2022), and the recently proposed DivClust (Metaxas et al., 2023). In addition, we also implement BCL (Zhou et al., 2022b), which is specifically designed for representation learning with long-tailed data. It is important to note that all of these methods are trained using the same backbone, data augmentation, and training configurations to ensure a fair comparison. Specifically, we train 50 epochs and adopt the Adam optimizer with the learning rate decay from 5e-4 to 5e-6 for all datasets. The batch size is 512. Further details can be found in Appendix F. For hyperparameters, we set $\lambda$ as 1, $\epsilon$ as 0.1, and initial $\rho$ as 0.1. The stop criterion of Alg.1 is when the change of $\mathbf{b}$ is less than 1e-6, or the iteration reaches 1000. We utilize the loss on training sets for clustering head and model selection. For evaluation, we conduct experiments with each method three times and report the mean results.
+
+# 5.2 MAIN RESULTS
+
+In Tab.1, we provide a comprehensive comparison of our method with existing approaches on various imbalanced training sets. The results for iNature1000 and balanced test sets can be found in Appendix H. On the relatively small-scale CIFAR100 dataset, our method outperforms the previous state-of-the-art by achieving an increase of 0.9 in ACC, 0.3 in NMI, and 0.6 in F1 score. On the ImgNet-R datasets, our method demonstrates its effectiveness with significant improvements of 2.4
+
+Table 1: Comparison with SOTA methods on different imbalanced training sets. The best results are shown in boldface, and the next best results are indicated with an underscore.
+
+
Method
CIFAR100
ImgNet-R
iNature100
iNature500
ACC
NMI
F1
ACC
NMI
F1
ACC
NMI
F1
ACC
NMI
F1
DINO
36.6
68.9
31.0
20.5
39.6
22.2
40.1
67.8
34.2
29.8
67.0
24.0
BCL
35.7
66.0
29.9
20.7
40.0
22.4
41.9
67.2
35.4
28.1
64.7
22.4
IIC
27.3±3.1
65.0±1.8
23.0±2.6
18.7±1.5
39.6±1.1
15.9±1.5
28.5±1.6
63.9±1.0
22.2±1.2
13.1±0.3
58.4±0.3
7.1±0.2
PICA
29.8±0.6
59.9±0.2
24.0±0.2
12.6±0.3
34.0±0.0
12.1±0.2
34.8±2.4
54.8±0.6
23.8±1.2
16.3±0.3
55.9±0.1
11.3±0.1
SCAN
37.2±0.9
69.4±0.4
31.4±0.7
21.8±0.7
42.6±0.3
21.7±0.8
38.7±0.6
66.3±0.5
28.4±0.6
29.0±0.3
66.7±0.2
21.6±0.2
SCAN*
30.2±0.9
68.5±2.3
25.4±1.1
23.6±0.2
44.1±0.2
22.8±0.1
39.5±0.4
68.5±0.2
30.7±0.1
19.0±0.7
65.9±0.5
12.5±0.5
CC
29.0±0.6
60.7±0.6
24.6±0.5
12.1±0.6
30.5±0.1
11.2±0.9
28.2±2.4
56.1±1.2
20.6±2.1
16.5±0.7
55.5±0.0
12.3±0.4
DivClust
31.8±0.3
64.0±0.4
26.1±0.8
14.8±0.2
33.9±0.4
13.8±0.2
33.7±0.2
59.3±0.5
23.3±0.7
17.2±0.5
56.4±0.3
12.5±0.4
P2OT
38.2±0.8
69.6±0.3
32.0±0.9
25.9±0.9
45.7±0.5
27.3±1.4
44.2±1.2
67.0±0.6
36.9±2.0
32.2±2.0
67.2±0.3
25.2±1.7
+
+
+Figure 1: Head, Medium, and Tail comparison on several datasets.
+
+
+PICA
+
+
+SCAN
+Figure 2: The T-SNE analysis on iNature100 training set.
+
+
+DivClust
+
+
+P2OT
+
+in ACC, 1.6 in NMI, and 4.5 in F1 score, highlighting its robustness in out-of-distribution scenarios. When applied to the fine-grained iNature datasets, our approach consistently delivers substantial performance gains across each subset in terms of ACC and F1 scores. Specifically, on ACC, we achieve improvements of 5.9 on iNature100 and 3.4 on iNature500. On the F1 score, we obtain improvements of 1.5 and 1.2 on the two datasets, respectively. In terms of NMI, we observe a 0.6 improvement on iNature500 but a 1.5 decrease on iNature100. It's worth noting that our method is an efficient one-stage approach, unlike SCAN*, which is a two-stage pseudo-labeling-based method. Additionally, another pseudo-labeling-based method, SPICE, exhibits a degenerate solution in the imbalance scenario (see Appendix F). Those results indicate the naive pseudo-labeling methods encounter a great challenge and demonstrate our superiority in handling imbalance scenarios.
+
+In addition, we provide a detailed analysis of the results for the Head, Medium, and Tail classes, offering a more comprehensive understanding of our method's performance across different class sizes. As depicted in Fig. 1, our improvements are predominantly driven by the Medium and Tail classes, especially in challenging scenarios like ImgNet-R and iNature500, although our results show some reductions in performance for the Head classes. These results highlight the effectiveness of our $\mathrm{P}^2\mathrm{OT}$ algorithm in generating imbalance-aware pseudo-labels, making it particularly advantageous for the Medium and Tail classes. Furthermore, in Fig.2, we present a T-SNE (Van der Maaten & Hinton, 2008) comparison of features before the clustering head. The T-SNE results illustrate our method learns more distinct clusters, particularly benefiting Medium and Tail classes.
+
+# 5.3 ABLATION STUDY
+
+Component Analysis. To assess the $KL$ constraint and the progressive $\rho$ , we conduct ablation experiments to analyze their individual contributions. As shown in Tab.2, we compare our full $\mathrm{P}^2\mathrm{OT}$ method with three ablated versions: OT, POT and UOT. OT (Asano et al., 2020) imposes equality constraint on cluster size and without the progressive $\rho$ component. POT signifies the replacement of
+
+Table 2: Analysis of different formulations. SLA is proposed by (Tai et al., 2021) in semi-supervised learning. OT (Asano et al., 2020), POT and UOT are variants of our $\mathrm{P}^2\mathrm{OT}$ . POT substitutes the $KL$ constraint with the equality constraint. UOT removes the progressive $\rho$ .
+
+
Formulation
CIFAR100
ImgNet-R
iNature500
Head
Medium
Tail
ACC
Head
Medium
Tail
ACC
Head
Medium
Tail
ACC
SLA
-
-
-
3.26
-
-
-
1.00
-
-
-
6.33
OT
35.0
30.2
18.7
28.2
24.4
19.3
10.7
18.2
27.1
27.5
16.4
24.1
POT
39.6
42.9
14.5
33.4
25.5
23.3
17.6
22.2
31.7
32.7
19.7
28.5
UOT
43.4
42.5
19.6
35.9
27.7
23.9
14.6
22.2
32.2
29.0
18.3
26.7
P²OT
45.1
45.5
21.6
38.2
31.5
29.3
16.1
25.9
36.3
37.0
21.6
32.2
+
+
+Figure 3: Confusion matrix on the balanced CIFAR100 test set. The two red rectangles represent the Medium and Tail classes.
+
+
+
+
+
+
+Figure 4: Precision, Recall analysis on train dataset with different training epoch. The weighted precision and recall are derived by reweighting each sample by our $\mathrm{P^2OT}$ algorithm.
+
+
+
+
+
+the $KL$ term in the original $\mathrm{P}^2\mathrm{OT}$ formulation with a typical uniform constraint. UOT denotes the removal of the progressive $\rho$ component from the original $\mathrm{P}^2\mathrm{OT}$ formulation. Furthermore, we also compare with SLA (Tai et al., 2021), which relaxes the equality constraint of POT by utilizing an upper bound. However, due to this relaxation, samples are erroneously assigned to a single cluster in the early stages, rendering its failure for clustering imbalanced data. We detail their formulation and further analysis in Appendix J. The results show POT and UOT both significantly surpass the OT, indicating that both of our components yield satisfactory effects. Compared to POT, we achieve improvements of 5.8, 3.8, and 3.6 on CIFAR100, ImgNet-R, and iNature500, respectively. Our improvement is mainly from Head and Tail classes, demonstrating that our P2OT with $KL$ constraint can generate imbalanced pseudo labels. Compared to UOT, we realize gains of 2.3, 3.8, and 5.4 on CIFAR100, ImgNet-R, and iNature500, respectively. Furthermore, as depicted in Fig.3, the confusion matrix for the CIFAR100 test set also validates our improvement on Medium and Tail classes. These remarkable results underscore the effectiveness of each component in our $\mathrm{P}^2\mathrm{OT}$ .
+
+Pseudo Label Quality Analysis. To provide a deeper understanding, we conduct an analysis of the pseudo-label quality generated by our $\mathrm{P}^2\mathrm{OT}$ . We evaluate precision and recall metrics to assess the pseudo-label quality for the entire training set. Notably, our $\mathrm{P}^2\mathrm{OT}$ algorithm conducts selection through reweighting, rather than hard selection. Consequently, we reweight each sample and present the weighted precision and recall results. As depicted in Fig.4, our weighted precision and recall consistently outperform precision and recall across different epochs. In the early stages, weighted precision and recall exhibit more rapid improvements compared to precision and recall. However,
+
+Table 3: Analysis of $\rho_0$ and different ramp up function. Fixed denotes $\rho$ as a constant value.
+
+
ρ0
Sigmoid
Linear
Fixed
0.00
0.05
0.1
0.15
0.2
0
0.1
0.2
0.1
0.2
CIFAR100
32.9
37.9
38.2
36.3
37.6
35.0
36.6
36.8
37.4
37.1
ImgNet-R
26.5
27.2
25.9
26.0
26.6
25.8
28.5
23.0
25.5
24.7
iNature500
32.6
31.7
32.2
32.8
32.9
31.9
32.0
30.5
29.9
30.3
+
+
+Figure 5: Time cost comparison of our solver with Generalized Scaling Algorithm (GSA).
+
+
+
+they eventually plateau around 10 epochs ( $\rho \approx 0.15$ ), converging gradually with precision and recall. The decline observed in weighted precision and recall over time suggests that our current ramp-up function may not be optimal, and raising to 1 for $\rho$ may not be necessary. We believe that the ramp-up strategy for $\rho$ should be adaptive to the model's learning progress. In this paper, we have adopted a typical sigmoid ramp-up strategy, and leave more advanced designs for future work.
+
+Analysis of $\rho$ . In our $\mathrm{P}^2\mathrm{OT}$ algorithm, the choice of initial $\rho_0$ and the specific ramp-up strategy are important hyperparameters. In this section, we systematically investigate the impact of varying $\rho_0$ values and alternative ramp-up strategy. The term "Linear" signifies that $\rho$ is increased to 1 from $\rho_0$ using a linear function, while "Fixed" indicates that $\rho$ remains constant as $\rho_0$ . The results in Tab.3 provide several important insights: 1) Our method exhibits consistent performance across various $\rho_0$ values when using the sigmoid ramp-up function, highlighting its robustness on datasets like ImgNet-R and iNature500; 2) The linear ramp-up strategy, although slightly less effective than sigmoid, still demonstrates the importance of gradually increasing $\rho$ during the early training stage; 3) The fixed $\rho$ approach results in suboptimal performance, underscoring the necessity of having a dynamically increasing $\rho$ . These findings suggest that a good starting value for $\rho_0$ is around 0.1, and it should be progressively increased during training.
+
+Efficiency Analysis. To demonstrate the efficiency of our solver, we perform a comparison between our solver and the Generalized Scaling Algorithm (GSA) proposed by (Chizat et al., 2018). The pseudo-code of GSA is in Appendix K. This comparison is conducted on iNaure1000 using identical conditions (NVIDIA TITAN RTX, $\epsilon = 0.1$ , $\lambda = 1$ ), without employing any acceleration strategies for both. To ensure the comprehensiveness of our time cost analysis, we conduct experiments by varying both the number of data points and the $\rho$ value. Subsequently, we average the time costs for different numbers of data points across different $\rho$ values and vice versa. The results presented in Fig.5 reveal several insights: 1) the time cost of both methods increases near linearly with the number of points; 2) as $\rho$ approaches 1, the time cost of GSA increases rapidly due to the tightening inequality constraint, whereas our time cost decreases; 3) as shown in the left figure, our solver is $2\times$ faster than GSA. Those results demonstrate the efficiency of our solver.
+
+# 6 CONCLUSION
+
+In this paper, we introduce a more practical problem called "deep imbalanced clustering," which aims to learn representations and semantic clusters from imbalanced data. To address this challenging problem, we propose a novel progressive PL-based learning framework, which formulates the pseudolabel generation as a progressive partial optimal transport $(\mathrm{P}^2\mathrm{OT})$ algorithm. The $\mathrm{P}^2\mathrm{OT}$ enables us to generate high-quality pseudo-labels in an imbalance-aware and progressive manner, thereby significantly improving model learning and clustering performance. To efficiently solve the $\mathrm{P}^2\mathrm{OT}$ algorithm, we introduce a virtual cluster and a weighted $KL$ constraint. Subsequently, by imposing certain constraints, we transform our problem into an unbalanced optimal transport problem, which can be efficiently solved using a scaling algorithm. Finally, extensive results on the human-curated long-tailed CIFAR100 dataset, challenging ImageNet-R datasets, and several large-scale fine-grained iNature datasets validate the superiority of our method.
+
+# ACKNOWLEDGMENTS
+
+This work was supported by National Science Foundation of China under grant 62350610269, Shanghai Frontiers Science Center of Human-centered Artificial Intelligence, and MoE Key Lab of Intelligent Perception and Human-Machine Collaboration (ShanghaiTech University). We thank Wanxing Chang for her valuable and inspiring comments.
+
+# REFERENCES
+
+Eric Arazo, Diego Ortego, Paul Albert, Noel E O'Connor, and Kevin McGuinness. Pseudo-labeling and confirmation bias in deep semi-supervised learning. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1-8. IEEE, 2020.
+Yuki M. Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. In International Conference on Learning Representations (ICLR), 2020.
+Ido Ben-Shaul, Ravid Shwartz-Ziv, Tomer Galanti, Shai Dekel, and Yann LeCun. Reverse engineering self-supervised learning. arXiv preprint arXiv:2305.15614, 2023.
+Luis A Caffarelli and Robert J McCann. Free boundaries in optimal transport and monge-ampere obstacle problems. Annals of mathematics, pp. 673-730, 2010.
+Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in neural information processing systems, 32, 2019.
+Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European conference on computer vision (ECCV), pp. 132-149, 2018.
+Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. Advances in Neural Information Processing Systems, 33:9912-9924, 2020.
+Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650-9660, 2021.
+Jianlong Chang, Lingfeng Wang, Gaofeng Meng, Shiming Xiang, and Chunhong Pan. Deep adaptive image clustering. In Proceedings of the IEEE international conference on computer vision, pp. 5879-5887, 2017.
+Wanxing Chang, Ye Shi, Hoang Tuan, and Jingya Wang. Unified optimal transport framework for universal domain adaptation. Advances in Neural Information Processing Systems, 35:29512-29524, 2022.
+Wanxing Chang, Ye Shi, and Jingya Wang. Csot: Curriculum and structure-aware optimal transport for learning with noisy labels. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.
+Laetitia Chapel, Mokhtar Z Alaya, and Gilles Gasso. Partial optimal transport with applications on positive-unlabeled learning. Advances in Neural Information Processing Systems, 33:2903-2913, 2020.
+Lenaic Chizat, Gabriel Peyre, Bernhard Schmitzer, and François-Xavier Vialard. Scaling algorithms for unbalanced optimal transport problems. Mathematics of Computation, 87(314):2563-2609, 2018.
+Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013.
+
+Zhiyuan Dang, Cheng Deng, Xu Yang, Kun Wei, and Heng Huang. Nearest neighbor matching for deep clustering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 13693-13702, June 2021.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2020.
+R Flamary, N Courty, D Tuia, and A Rakotomamonjy. Optimal transport for domain adaptation. IEEE Trans. Pattern Anal. Mach. Intell, 1:1-40, 2016.
+Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya, and Tomaso A Poggio. Learning with a wasserstein loss. Advances in neural information processing systems, 28, 2015.
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. Advances in neural information processing systems, 30, 2017.
+Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16000-16009, 2022.
+Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. ICCV, 2021.
+Jiabo Huang, Shaogang Gong, and Xiatian Zhu. Deep semantic clustering by partition confidence maximisation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
+Zhizhong Huang, Jie Chen, Junping Zhang, and Hongming Shan. Learning representation for clustering via prototype scattering and positive sampling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
+Xu Ji, Joao F Henriques, and Andrea Vedaldi. Invariant information clustering for unsupervised image classification and segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9865-9874, 2019.
+Ziyu Jiang, Tianlong Chen, Bobak J Mortazavi, and Zhangyang Wang. Self-damaging contrastive learning. In International Conference on Machine Learning, pp. 4927-4939. PMLR, 2021.
+L. Kantorovich. On the transfer of masses (in russian). Doklady Akademii Nauk, 37:227-229, 1942.
+Abdelwahed Khamis, Russell Tsuchida, Mohamed Tarek, Vivien Rolland, and Lars Petersson. Earth movers in the big data era: A review of optimal transport in machine learning. arXiv preprint arXiv:2305.05080, 2023.
+Philip A Knight. The sinkhorn-knopp algorithm: convergence and applications. SIAM Journal on Matrix Analysis and Applications, 30(1):261-275, 2008.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
+Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, volume 3, pp. 896. Atlanta, 2013.
+Yunfan Li, Peng Hu, Zitao Liu, Dezhong Peng, Joey Tianyi Zhou, and Xi Peng. Contrastive clustering. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 8547-8555, 2021.
+Matthias Liero, Alexander Mielke, and Giuseppe Savare. Optimal entropy-transport problems and a new hellinger-kantorovich distance between positive measures. Inventiones mathematicae, 211(3): 969-1117, 2018.
+
+Hong Liu, Jeff Z HaoChen, Adrien Gaidon, and Tengyu Ma. Self-supervised learning is more robust to dataset imbalance. 2022.
+Yang Liu, Zhipeng Zhou, and Baigui Sun. Cot: Unsupervised domain adaptation with clustering and optimal transport. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 19998-20007, June 2023.
+Ioannis Maniadis Metaxas, Georgios Tzimiropoulos, and Ioannis Patras. Divclust: Controlling diversity in deep clustering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3418-3428, 2023.
+Chuang Niu, Hongming Shan, and Ge Wang. Spice: Semantic pseudo-labeling for image clustering. IEEE Transactions on Image Processing, 31:7264-7278, 2022.
+Gabriel Peyre, Marco Cuturi, et al. Computational optimal transport. Center for Research in Economics and Statistics Working Papers, (2017-86), 2017.
+Meitar Ronen, Shahaf E. Finder, and Oren Freifeld. Deepdpm: Deep clustering with an unknown number of clusters. In Conference on Computer Vision and Pattern Recognition, 2022.
+Timo Aila Samuli Laine. Temporal ensembling for semi-supervised learning. International Conference on Learning Representations (ICLR), 30, 2017.
+Yuming Shen, Ziyi Shen, Menghan Wang, Jie Qin, Philip Torr, and Ling Shao. You never cluster alone. Advances in Neural Information Processing Systems, 34:27734-27746, 2021.
+Kihyuk Sohn, David Berthelot, Nicholas Carlini, Zizhao Zhang, Han Zhang, Colin A Raffel, Ekin Dogus Cubuk, Alexey Kurakin, and Chun-Liang Li. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. Advances in Neural Information Processing Systems, 33:596-608, 2020.
+Fariborz Taherkhani, Ali Dabouei, Sobhan Soleymani, Jeremy Dawson, and Nasser M Nasrabadi. Transporting labels via hierarchical optimal transport for semi-supervised learning. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part IV 16, pp. 509-526. Springer, 2020.
+Kai Sheng Tai, Peter D Bailis, and Gregory Valiant. Sinkhorn label allocation: Semi-supervised classification via annealed self-training. In International Conference on Machine Learning, pp. 10065-10075. PMLR, 2021.
+Yaling Tao, Kentaro Takagi, and Kouta Nakata. Clustering-friendly representation learning via instance discrimination and feature decorrelation. In International Conference on Learning Representations, 2020.
+Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. Advances in neural information processing systems, 30, 2017.
+Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
+Wouter Van Gansbeke, Simon Vandenhende, Stamatios Georgoulis, Marc Proesmans, and Luc Van Gool. Scan: Learning to classify images without labels. In Proceedings of the European Conference on Computer Vision, 2020.
+Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8769-8778, 2018.
+Cédric Villani et al. Optimal transport: old and new, volume 338. Springer, 2009.
+Chen Wei, Kihyuk Sohn, Clayton Mellina, Alan Yuille, and Fan Yang. Crest: A class-rebalancing self-training framework for imbalanced semi-supervised learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10857-10866, June 2021.
+
+Bowen Zhang, Yidong Wang, Wenxin Hou, Hao Wu, Jindong Wang, Manabu Okumura, and Takahiro Shinozaki. Flexmatch: Boosting semi-supervised learning with curriculum pseudo labeling. Advances in Neural Information Processing Systems, 34:18408-18419, 2021a.
+Chuyu Zhang, Ruijie Xu, and Xuming He. Novel class discovery for long-tailed recognition. Transactions on Machine Learning Research, 2023.
+Songyang Zhang, Zeming Li, Shipeng Yan, Xuming He, and Jian Sun. Distribution alignment: A unified framework for long-tail visual recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2361-2370, 2021b.
+Sheng Zhou, Hongjia Xu, Zhuonan Zheng, Jiawei Chen, Jiajun Bu, Jia Wu, Xin Wang, Wenwu Zhu, Martin Ester, et al. A comprehensive survey on deep clustering: Taxonomy, challenges, and future directions. arXiv preprint arXiv:2206.07579, 2022a.
+Zhihan Zhou, Jiangchao Yao, Yan-Feng Wang, Bo Han, and Ya Zhang. Contrastive learning with boosted memorization. In International Conference on Machine Learning, pp. 27367-27377. PMLR, 2022b.
+
+# A EFFICIENT SCALING ALGORITHM FOR SOLVING OPTIMAL TRANSPORT
+
+In this section, we detail how to solve the optimal transport by an efficient scaling algorithm. Let's recall the definition of optimal transport, given two probability vectors $\mu \in \mathbb{R}^{m\times 1},\nu \in \mathbb{R}^{n\times 1}$ , as well as a cost matrix $\mathbf{C}\in \mathbb{R}_+^{m\times n}$ defined on joint space, the objective function which OT minimizes is as follows:
+
+$$
+\min _ {\mathbf {Q} \in \mathbb {R} _ {+} ^ {m \times n}} \left\langle \mathbf {Q}, \mathbf {C} \right\rangle_ {F} + F _ {1} \left(\mathbf {Q} \mathbf {1} _ {n}, \boldsymbol {\mu}\right) + F _ {2} \left(\mathbf {Q} ^ {\top} \mathbf {1} _ {m}, \boldsymbol {\nu}\right) \tag {S19}
+$$
+
+where $\mathbf{Q} \in \mathbb{R}_+^{m \times n}$ is the transportation plan, $\langle, \rangle_F$ denotes the Frobenius product, $F_1, F_2$ are constraints on the marginal distribution of $\mathbf{Q}$ , which are convex, lower semicontinuous and lower bounded functions, and $\mathbf{1}_n \in \mathbb{R}^{n \times 1}$ , $\mathbf{1}_m \in \mathbb{R}^{m \times 1}$ are all ones vector. To solve it efficiently, motivated by Cuturi (2013), we first introduce an entropy constraint, $-\epsilon \mathcal{H}(\mathbf{Q})$ . Therefore, the first term of Equ.(S19) is as follows:
+
+$$
+\begin{array}{l} < \mathbf {Q}, \mathbf {C} > _ {F} - \epsilon \mathcal {H} (\mathbf {Q}) = \epsilon < \mathbf {Q}, \mathbf {C} / \epsilon + \log \mathbf {Q} > _ {F} (S20) \\ = \epsilon < \mathbf {Q}, \log \frac {\mathbf {Q}}{\exp (- \mathbf {C} / \epsilon)} > _ {F} (S21) \\ = \epsilon K L (\mathbf {Q}, \exp (- \mathbf {C} / \epsilon)), (S22) \\ \end{array}
+$$
+
+The entropic optimal transport can be reformulated as follows:
+
+$$
+\min _ {\mathbf {Q} \in \mathbb {R} _ {+} ^ {m \times n}} \epsilon K L (\mathbf {Q}, \exp (- \mathbf {C} / \epsilon)) + F _ {1} (\mathbf {Q} \mathbf {1} _ {n}, \boldsymbol {\mu}) + F _ {2} (\mathbf {Q} ^ {\top} \mathbf {1} _ {m}, \boldsymbol {\nu}) \tag {S23}
+$$
+
+Then, this problem can be approximately solved by an efficient scaling Alg.2, where the proximal operator is as follows:
+
+$$
+\operatorname {p r o x} _ {F / \epsilon} ^ {K L} (\mathbf {z}, \boldsymbol {\mu}) = \operatorname {a r g m i n} _ {\mathbf {x} \in \mathbb {R} _ {+} ^ {n}} F (\mathbf {x}, \boldsymbol {\mu}) + \epsilon K L (\mathbf {x}, \mathbf {z}) \tag {S24}
+$$
+
+Intuitively, it is the iterative projection on affine subspaces for the KL divergence. We refer readers to (Chizat et al., 2018) for more derivation. Consequently, for OT problems with any proper constraint, if we can transform it into the form of Equ.(S19) and derive the corresponding proximal operator, we can solve it with Alg.2 efficiently.
+
+# Algorithm 2: Scaling Algorithm for Optimal Transport
+
+```txt
+Input: Cost matrix $\mathbf{C},\epsilon ,m,n,\pmb {\mu},\pmb{\nu}$ $\mathbf{M} = \exp (-\mathbf{C} / \epsilon)$
+b $\leftarrow$ 1n
+while b not converge do a $\leftarrow$ proxKL(F1/ε(Mb,μ)/(Mb) b $\leftarrow$ proxKL(F2/ε(Ma,ν)/(Ma)
+end
+return diag(a)Mdiag(b);
+```
+
+# B PROOF OF PROPOSITION 1
+
+In this section, we prove the Proposition 1. Assume the optimal transportation plan of Equ.(14) is $\hat{\mathbf{Q}}^{\star}$ , which can be decomposed as $[\hat{\mathbf{Q}}^{\star},\pmb {\xi}^{\star}]$ , and the optimal transportation plan of Equ.(5) is $\mathbf{Q}^{\star}$ .
+
+Step 1. We first prove $\pmb{\xi}^{\star \top}\mathbf{1}_N = 1 - \rho$ . To prove that, we expand the second $K\hat{L}$ term and rewrite it as follows:
+
+$$
+\begin{array}{l} \hat {K L} \left(\hat {\mathbf {Q}} ^ {\star \top} \mathbf {1} _ {N}, \boldsymbol {\beta}, \boldsymbol {\lambda}\right) = \sum_ {i = 1} ^ {K} \boldsymbol {\lambda} _ {i} \left[ \tilde {\mathbf {Q}} ^ {\star \top} \mathbf {1} _ {N} \right] _ {i} \log \frac {\left[ \tilde {\mathbf {Q}} ^ {\star \top} \mathbf {1} _ {N} \right] _ {i}}{\boldsymbol {\beta} _ {i}} + \boldsymbol {\lambda} _ {K + 1} \boldsymbol {\xi} ^ {\star \top} \mathbf {1} _ {N} \log \frac {\boldsymbol {\xi} ^ {\star \top} \mathbf {1} _ {N}}{1 - \rho} (S25) \\ = \lambda K L \left(\tilde {\mathbf {Q}} ^ {\star \top} \mathbf {1} _ {N}, \frac {\rho}{K} \mathbf {1} _ {K}\right) + \lambda_ {K + 1} \boldsymbol {\xi} ^ {\star \top} \mathbf {1} _ {N} \log \frac {\boldsymbol {\xi} ^ {\star \top} \mathbf {1} _ {N}}{1 - \rho} (S26) \\ \end{array}
+$$
+
+Due to $\pmb{\lambda}_{K + 1}\rightarrow +\infty$ , if $\pmb{\xi}^{\star \top}\mathbf{1}_N$ is not equal to $1 - \rho$ , the cost of Equ.(14) will be $+\infty$ . In such case, we can find a more optimal $\hat{\mathbf{Q}}^\dagger$ , which satisfies $\pmb{\xi}^{\dagger \top}\mathbf{1}_N = 1 - \rho$ , and its cost is finite, contradicting to our assumption. Therefore, $\pmb{\xi}^{\star \top}\mathbf{1}_N = 1 - \rho$ , and $K\hat{L} (\hat{\mathbf{Q}}^{\star \top}\mathbf{1}_N,\beta ,\lambda) = \lambda KL(\tilde{\mathbf{Q}}^{\star \top}\mathbf{1}_N,\frac{\rho}{K}\mathbf{1}_K)$
+
+Step 2. We then prove $\tilde{\mathbf{Q}}^{\star},\mathbf{Q}^{\star}$ are in the same constraint set. Due to
+
+$$
+\hat {\mathbf {Q}} ^ {\star} \mathbf {1} _ {K + 1} = \left[ \tilde {\mathbf {Q}} ^ {\star}, \boldsymbol {\xi} ^ {\star} \right] \mathbf {1} _ {K + 1} = \tilde {\mathbf {Q}} ^ {\star} \mathbf {1} _ {K} + \boldsymbol {\xi} ^ {\star} = \mathbf {1} _ {N}, \tag {S27}
+$$
+
+and $\pmb{\xi}^{\star}\geq 0$ , we know $\tilde{\mathbf{Q}}^{\star}\mathbf{1}_{K} = \mathbf{1}_{N} - \pmb{\xi}^{\star}\leq \mathbf{1}_{N}$ . Furthermore,
+
+$$
+\mathbf {1} _ {N} ^ {\top} \hat {\mathbf {Q}} ^ {\star} \mathbf {1} _ {K + 1} = \mathbf {1} _ {N} ^ {\top} \left(\tilde {\mathbf {Q}} ^ {\star} \mathbf {1} _ {K} + \boldsymbol {\xi} ^ {\star}\right) = \mathbf {1} _ {N} ^ {\top} \tilde {\mathbf {Q}} ^ {\star} \mathbf {1} _ {K} + \mathbf {1} _ {N} ^ {\top} \boldsymbol {\xi} ^ {\star} = 1, \tag {S28}
+$$
+
+and $\pmb{\xi}^{\star \top}\mathbf{1}_N = \mathbf{1}_N^\top \pmb{\xi}^{\star} = 1 - \rho$ , we derive that
+
+$$
+\mathbf {1} _ {N} ^ {\top} \tilde {\mathbf {Q}} ^ {\star} \mathbf {1} _ {K} = 1 - \mathbf {1} _ {N} ^ {\top} \boldsymbol {\xi} ^ {\star} = 1 - (1 - \rho) = \rho . \tag {S29}
+$$
+
+In summary, $\tilde{\mathbf{Q}}^{\star} \in \{\tilde{\mathbf{Q}}^{\star} \in \mathbb{R}^{N \times K} | \tilde{\mathbf{Q}}^{\star} \mathbf{1}_{K} \leq \frac{1}{N} \mathbf{1}_{N}, \mathbf{1}_{N}^{\top} \tilde{\mathbf{Q}}^{\star} \mathbf{1}_{K} = \rho\}$ , which is the same $\Pi$ in Equ.(5).
+
+Step 3. Finally, we prove $\tilde{\mathbf{Q}}^{\star} = \mathbf{Q}^{\star}$ . According to Proposition 1, $\mathbf{C} = [-\log \mathbf{P}, \mathbf{0}_N]$ . We plug it into Equ.(14), and the cost of $\hat{\mathbf{Q}}^{\star}$ is as follows:
+
+$$
+\begin{array}{l} \langle \hat {\mathbf {Q}} ^ {\star}, \mathbf {C} \rangle_ {F} + K \hat {L} \left(\hat {\mathbf {Q}} ^ {\star \top} \mathbf {1} _ {N}, \boldsymbol {\beta}, \boldsymbol {\lambda}\right) = \left\langle \left[ \tilde {\mathbf {Q}} ^ {\star}, \boldsymbol {\xi} ^ {\star} \right], \left[ - \log \mathbf {P}, \mathbf {0} _ {N} \right] \right\rangle_ {F} + \lambda K L \left(\tilde {\mathbf {Q}} ^ {\star \top} \mathbf {1} _ {N}, \frac {\rho}{K} \mathbf {1} _ {K}\right) (S30) \\ = \left\langle \tilde {\mathbf {Q}} ^ {\star}, - \log \mathbf {P} \right\rangle_ {F} + \lambda K L \left(\tilde {\mathbf {Q}} ^ {\star^ {\top}} \mathbf {1} _ {N}, \frac {\rho}{K} \mathbf {1} _ {K}\right) (S31) \\ = C _ {1} (S32) \\ \end{array}
+$$
+
+And in Equ.(5), the cost for $\mathbf{Q}^{\star}$ is as follows:
+
+$$
+\langle \mathbf {Q} ^ {\star}, - \log \mathbf {P} \rangle_ {F} + \lambda K L \left(\mathbf {Q} ^ {\star^ {\top}} \mathbf {1} _ {N}, \frac {\rho}{K} \mathbf {1} _ {K}\right) = C _ {2} \tag {S33}
+$$
+
+From step 2, we know that $\tilde{\mathbf{Q}}^{\star},\mathbf{Q}^{\star}$ are in the same set. Consequently, the form of Equ.(S30) is the same as Equ.(S33), and in set $\Pi$ , $\langle \mathbf{Q}, - \log \mathbf{P}\rangle_F + \lambda KL\big(\mathbf{Q}^\top \mathbf{1}_N,\frac{\rho}{K}\mathbf{1}_K\big)$ is a convex function.
+
+If $C_1 = C_2$ , due to it is a convex function, $\tilde{\mathbf{Q}}^{\star} = \mathbf{Q}^{\star}$ .
+
+If $C_1 > C_2$ , we can construct a transportation plan $\hat{\mathbf{Q}}^{\dagger} = [\mathbf{Q}^{\star}, \boldsymbol{\xi}^{\star}]$ for Equ.(14), which cost is $C_2$ , achieving smaller cost than $\hat{\mathbf{Q}}^{\star}$ . The results contradict the initial assumption that $\hat{\mathbf{Q}}^{\star}$ is the optimal transport plan. Therefore, $C_1$ can not be larger than $C_2$ .
+
+If $C_1 < C_2$ , we can construct a transportation plan $\tilde{\mathbf{Q}}^*$ for Equ.(5), which cost is $C_1$ , achieving smaller cost than $\mathbf{Q}^*$ . The results contradict the initial assumption that $\mathbf{Q}^*$ is the optimal transport plan. Therefore, $C_1$ can not be smaller than $C_2$ .
+
+In conclusion, $C_1 = C_2$ and $\tilde{\mathbf{Q}}^{\star} = \mathbf{Q}^{\star}$ , i.e. $\hat{\mathbf{Q}}^{\star} = [\mathbf{Q}^{\star},\pmb {\xi}^{\star}]$ . We can derive $\mathbf{Q}^{\star}$ by omitting the last column of $\hat{\mathbf{Q}}^{\star}$ . Therefore, Proposition 1 is proved.
+
+# C PROOF OF PROPOSITION 2
+
+From the Appendix A, we know the key to proving Proposition 2 is to derive the proximal operator for $F_{1}, F_{2}$ . Without losing generality, we rewrite the entropic version of Equ.(14) in a more simple and general form, which is detailed as follows:
+
+$$
+\min _ {\hat {\mathbf {Q}} \in \Phi} \epsilon K L (\mathbf {Q}, \exp (- \mathbf {C} / \epsilon)) + K \hat {L} (\mathbf {Q} ^ {\top} \mathbf {1} _ {N}, \boldsymbol {\beta}, \boldsymbol {\lambda}) \tag {S34}
+$$
+
+$$
+\text {s . t .} \quad \Phi = \left\{\mathbf {Q} \in \mathbb {R} _ {+} ^ {N \times K} \mid \mathbf {Q} \mathbf {1} _ {K} = \boldsymbol {\alpha} \right\}, \tag {S35}
+$$
+
+In Equ.(S34), the equality constraint means that $F_{1}$ is an indicator function, formulated as:
+
+$$
+F _ {1} (\mathbf {x}, \boldsymbol {\alpha}) = \left\{ \begin{array}{l l} 0, & \mathbf {x} = \boldsymbol {\alpha} \\ + \infty , & \text {o t h e r w i s e} \end{array} \right. \tag {S36}
+$$
+
+Therefore, we can plug in the above $F_{1}$ to Equ.(S24), and derive the proximal operator for $F_{1}$ is $\alpha$ . For the weighted $KL$ constraint, the proximal operator is as follows:
+
+$$
+\begin{array}{l} \operatorname {p r o x} _ {F _ {2} / \epsilon} ^ {K L} (\mathbf {z}, \boldsymbol {\beta}) = \operatorname {a r g m i n} _ {\mathbf {x} \in \mathbb {R} _ {+} ^ {K}} \hat {K L} (\mathbf {x}, \boldsymbol {\beta}, \boldsymbol {\lambda}) + \epsilon K L (\mathbf {x}, \mathbf {z}) (S37) \\ = \operatorname {a r g m i n} _ {\mathbf {x} \in \mathbb {R} _ {+} ^ {K}} \sum_ {i} \boldsymbol {\lambda} _ {i} \mathbf {x} _ {i} \log \frac {\mathbf {x} _ {i}}{\beta_ {i}} - \boldsymbol {\lambda} _ {i} \mathbf {x} _ {i} + \boldsymbol {\beta} _ {i} + \epsilon \mathbf {x} _ {i} \log \frac {\mathbf {x} _ {i}}{\mathbf {z} _ {i}} - \epsilon \mathbf {x} _ {i} + \mathbf {z} _ {i} (S38) \\ = \operatorname {a r g m i n} _ {\mathbf {x} \in \mathbb {R} _ {+} ^ {K}} \sum_ {i} \boldsymbol {\lambda} _ {i} \mathbf {x} _ {i} \log \frac {\mathbf {x} _ {i}}{\boldsymbol {\beta} _ {i}} - \boldsymbol {\lambda} _ {i} \mathbf {x} _ {i} + \epsilon \mathbf {x} _ {i} \log \frac {\mathbf {x} _ {i}}{\mathbf {z} _ {i}} - \epsilon \mathbf {x} _ {i} (S39) \\ = \operatorname {a r g m i n} _ {\mathbf {x} \in \mathbb {R} _ {+} ^ {K}} \sum_ {i} \left(\boldsymbol {\lambda} _ {i} + \epsilon\right) \mathbf {x} _ {i} \log \mathbf {x} _ {i} - \left(\boldsymbol {\lambda} _ {i} \log \boldsymbol {\beta} _ {i} + \boldsymbol {\lambda} _ {i} + \epsilon \log \mathbf {z} _ {i} + \epsilon\right) \mathbf {x} _ {i} \quad (\mathrm {S 4 0}) \\ \end{array}
+$$
+
+The first line to the second is that we expand the unnormalized $KL$ . The second line to the third is that we omit the variable unrelated to $\mathbf{x}$ . The third line to the fourth line is that we reorganize the equation. Now, we consider a function as follows:
+
+$$
+g (x) = a x \log x - b x \tag {S41}
+$$
+
+Its first derivative is denoted as:
+
+$$
+g ^ {\prime} (x) = a + a \log x - b \tag {S42}
+$$
+
+Therefore, $\operatorname{argmin}_x g(x) = \exp \left(\frac{b - a}{a}\right)$ . According to this conclusion, we know that:
+
+$$
+\mathbf {x} _ {i} = \exp \left(\frac {\boldsymbol {\lambda} _ {i} \log \boldsymbol {\beta} _ {i} + \epsilon \log \mathbf {z} _ {i}}{\boldsymbol {\lambda} _ {i} + \epsilon}\right) = \boldsymbol {\beta} _ {i} ^ {\frac {\boldsymbol {\lambda} _ {i}}{\boldsymbol {\lambda} _ {i} + \epsilon}} \mathbf {z} _ {i} ^ {\frac {\epsilon}{\boldsymbol {\lambda} _ {i} + \epsilon}} \tag {S43}
+$$
+
+And the vectorized version is as follows::
+
+$$
+\mathbf {x} = \boldsymbol {\beta} ^ {\circ f} \mathbf {z} ^ {\circ (1 - f)}, \quad \mathbf {f} = \frac {\boldsymbol {\lambda}}{\boldsymbol {\lambda} + \epsilon}. \tag {S44}
+$$
+
+Finally, we plug in the two proximal operators into Alg.2. The iteration of $\mathbf{a}$ , $\mathbf{b}$ is as follows:
+
+$$
+\mathbf {a} \leftarrow \operatorname {p r o x} _ {F _ {1} / \epsilon} ^ {K L} (\mathbf {M b}, \alpha) / (\mathbf {M b}) = \frac {\boldsymbol {\alpha}}{\mathbf {M} \cdot \mathbf {b}} \tag {S45}
+$$
+
+$$
+\mathbf {b} \leftarrow \operatorname {p r o x} _ {F _ {2} / \epsilon} ^ {K L} (\mathbf {M} ^ {\top} \mathbf {a}, \boldsymbol {\beta}) / (\mathbf {M} ^ {\top} \mathbf {a}) = \beta^ {\circ f} (\mathbf {M} ^ {\top} \mathbf {a}) ^ {\circ (1 - f)} / (\mathbf {M} ^ {\top} \mathbf {a}) = \left(\frac {\boldsymbol {\beta}}{\mathbf {M} ^ {\top} \mathbf {a}}\right) ^ {\circ f} \tag {S46}
+$$
+
+Consequently, Proposition 2 is proved.
+
+# D MORE DISCUSSION ON UNIFORM CONSTRAINT
+
+In deep clustering, the uniform constraint is widely used to avoid degenerate solutions. Among them, KL constraint is a common feature in many clustering baselines, such as SCAN (Van Gansbeke et al., 2020), PICA(Huang et al., 2020), CC(Li et al., 2021), and DivClust(Metaxas et al., 2023). These methods employ an additional entropy regularization loss term on cluster size to prevent degenerate solutions, which is equivalent to the KL constraint. Different from above, Huang et al. (2022) achieves uniform constraints by maximizing the inter-clusters distance between prototypical representations. By contrast, our method incorporates KL constraint in pseudo-label generation, constituting a novel OT problem. As demonstrated in 1, our approach significantly outperforms these baselines.
+
+# E DATASETS DETAILS
+
+Fig.S6 displays the class distribution of ImgNet-R and several training datasets from iNaturalist18. As evident from the figure, the class distribution in several iNature datasets is highly imbalanced. While ImgNet-R exhibits a lower degree of imbalance, its data distribution still presents a significant challenge for clustering tasks.
+
+# F MORE IMPLEMENTATION DETAILS
+
+In this section, we illustrate the implementation details of other methods.
+
+
+
+
+
+
+Figure S6: The class distribution of different datasets.
+
+
+
+# F.1 DEEP CLUSTERING
+
+In our study, we employed various methods, all utilizing the same datasets and finetuning the last block of ViT-B16. All methods are trained for 50 epochs due to convergence observation.
+
+For our $\mathrm{P}^2\mathrm{OT}$ method, we use a batch size of 512. To stabilize the mini-batch $\mathrm{P}^2\mathrm{OT}$ , We incorporate a memory buffer queue of size 5120 for history prediction after the first epoch to stabilize optimization. During training, we apply two transformations to the same sample and cross-utilize the two pseudolabels as supervision, thereby encouraging the model to maintain equivariance. We employ 2 clustering heads on the CIFAR100 dataset and 1 clustering head on others. The clustering heads are designed with the sample cluster number as ground truth. Since the sum of sample weights in the pseudo label $\mathbf{Q}$ is $\rho$ , we adjust the loss on training sets for the clustering head and model selection as $\mathcal{L} / \rho$ .
+
+For IIC, we adopt their method (loss function) from GitHub. They aim at maximizing the mutual information of class assignments between different transformations of the same sample. In all experiments, we use a batch size of 512. We follow their over-clustering strategy, i.e., using two heads, one matching the ground-truth cluster number and the other set at 200 for CIFAR100 and iNature100, 400 for ImgNet-R, and 700 for iNature500. We do not use over-clustering for iNature1000 due to resource and efficiency considerations. Models from the last epoch are selected.
+
+For PICA, we adopt their method (loss function) from GitHub. Their basic idea is to minimize cluster-wise Assignment Statistics Vector(ASV) cosine similarity. In our implementation, the batch size, over-clustering strategy, and model selection are the same as IIC above.
+
+For SCAN, we adopt their code from GitHub. For clustering, their basic idea is to make use of the information of nearest neighbors from pretrained model embeddings. We use a batch size of 512. Following their implementation, we use 10 heads for CIFAR100, iNature100, iNature500, and ImgNet-R. We use 1 head for iNature1000 due to resource and efficiency considerations. While the authors select models based on loss on test sets, we argue that this strategy may not be suitable as test sets are unavailable during training. For the fine-tuning stage of SCAN, they use high-confident samples to obtain pseudo labels. Following their implementation, we use the confidence threshold
+
+of 0.99 on CIFAR. On other datasets, we use the confidence threshold of 0.7 because the model is unable to select confident samples if we use 0.99.
+
+For CC, we adopt their code from GitHub. They perform both instance- and cluster-level contrastive learning. Following their implementation, we use a batch size of 128, and the models of the last epochs are selected.
+
+For DivClust, we adopt their code from GitHub. Their basic idea is to enlarge the diversity of multiple clusterings. Following their implementation, we use a batch size of 256, with 20 clusterings for CIFAR100, ImgNet-R, iNature100, and iNature500. We use 2 clusterings for iNature1000 due to resource and efficiency considerations. The models of the last epoch along with the best heads are selected.
+
+Table S4: SPICE accuracy on different datasets.
+
+
Dataset Imbalance ratio
CIFAR100 100
ImgNet-R 13
iNature100 67
iNature500 111
iNature1000 111
SPICE
6.74
2.58
10.29
2.15
0.74
+
+We also tried to implement SPICE from GitHub on imbalanced datasets. Given a pre-trained backbone, they employ a two-stage training process: initially training the clustering head while keeping the backbone fixed, and subsequently training both the backbone and clustering head jointly. For the first stage, they select an equal number of confident samples for each cluster and generate pseudo-labels to train the clustering head. However, on imbalanced datasets, this strategy can easily lead to degraded results as presented in Tab.S4. For example, for the medium and tail classes, the selected confident samples will easily include many samples from head classes, causing clustering head degradation. For the second stage, they utilize neighbor information to generate reliable pseudo-labels for further training. However, the degradation of the clustering head, which occurs as a result of the first stage's limitations, poses a hurdle in the selection of reliable samples for the second stage, thus preventing the training of the second stage. For comparison with SPICE on the balanced training set, please refer to Sec.I.
+
+# F.2 REPRESENTATION LEARNING WITH LONG-TAILED DATA
+
+In the literature, (Zhou et al., 2022b; Liu et al., 2022; Jiang et al., 2021) aims to learn unbiased representation with long-tailed data. For a fair comparison, we adopt the pre-trained ViT-B16, finetune the last block of the ViT-B16 with their methods by 500 epochs, and perform K-means on representation space to evaluate the clustering ability. However, we exclude reporting results from (Liu et al., 2022; Jiang et al., 2021) for the following reasons: 1) (Jiang et al., 2021) prunes the ResNet, making it challenging to transfer to ViT; 2) (Liu et al., 2022) has not yet open-sourced the code for kernel density estimation, which is crucial for its success.
+
+# G ARIMETRIC
+
+Additionally, we report the results on the Adjusted Rand Index (ARI) metric. Interestingly, on the imbalanced training set (Fig.S5), methods like IIC and SCAN* tend to exhibit a bias toward head classes (Fig.S7) and achieve very high ARI scores, even though they perform inferiorly compared to our method in terms of ACC and NMI. However, as shown in Fig.S6, on the balanced test set, the performance of IIC and SCAN* is relatively poor compared to our method. This inconsistency in performance across different class distributions highlights that ARI can be sensitive to the distribution of data and may not be a suitable metric in imbalance scenarios.
+
+# H MORE COMPARISON
+
+iNature1000 dataset. As shown in Tab.S7, in the large-scale iNature1000 dataset, our method achieves comparable results with Strong SCAN. Specifically, we achieve improvements of 0.5 in ACC and 0.3 in F1 score, while there is a slight decrease of 0.6 in the NMI metric. It's important to note that pseudo-labeling-based methods face significant challenges in large-scale scenarios, as
+
+
+
+
+
+
+Figure S7: Prediction distribution comparison of IIC, SCAN* and $\mathrm{P}^2\mathrm{OT}$ on CIFAR100.
+
+
+
+Table S5: ARI Comparison with SOTA methods on imbalanced training datasets.
+
+
Dataset Imbalance ratio
CIFAR100 100
ImgNet-R 13
iNature100 67
iNature500 111
iNature1000 111
IIC
43.3±3.9
13.2±0.8
33.6±6.2
19.2±0.6
20.2±1.5
PICA
24.6±0.2
5.2±0.1
12.6±0.5
7.1±0.1
5.4±0.2
SCAN
34.7±0.5
13.5±0.4
18.2±0.2
13.6±0.1
14.3±0.2
SCAN*
50.0±2.4
15.8±0.2
21.0±0.4
27.6±1.3
28.0±1.6
CC
29.8±0.4
6.0±0.3
13.9±0.8
13.6±1.3
11.9±0.6
DivClust
29.0±1.1
7.1±0.2
14.2±0.5
11.0±0.5
10.8±0.9
P²OT
36.9±1.3
16.0±0.7
23.1±0.5
14.3±0.3
12.6±0.2
+
+Table S6: ARI Comparison with SOTA methods on balanced test datasets.
+
+
Dataset Imbalance ratio
CIFAR100 100
ImgNet-R 13
iNature100 67
iNature500 111
iNature1000 111
IIC
21.5±1.6
11.6±0.9
16.9±1.7
7.7±0.4
4.4±0.1
PICA
19.9±0.5
5.2±0.0
17.6±3.4
6.4±0.3
3.6±0.2
SCAN
28.2±0.2
12.0±0.5
25.0±1.7
17.0±0.3
14.0±0.3
SCAN*
21.7±1.8
13.9±0.1
27.7±0.6
11.1±0.6
5.8±0.2
CC
19.1±0.7
4.3±0.3
15.1±0.4
6.8±0.5
4.3±0.1
DivClust
21.3±0.6
5.5±0.5
19.2±1.1
8.0±0.6
4.5±0.3
P2OT
28.8±0.8
13.4±0.8
29.7±1.7
18.9±0.4
14.2±0.7
+
+generating high-quality pseudo-labels becomes increasingly difficult. Despite this challenge, our method demonstrates competitive performance in such a challenging setting.
+
+Results on the balanced test sets. As presented in Tab.S8, we conduct a comprehensive comparison of our method with existing approaches on balanced test sets, validating their ability in an inductive setting. On the relatively small-scale CIFAR100 dataset, our method outperforms the previous state-of-the-art (SCAN) by margins of 1.4, respectively. On the ImgNet-R datasets, our method demonstrates its effectiveness with a notable improvement of 2.2, highlighting its robustness in out-of-distribution scenarios. On the fine-grained iNature datasets, our performance gains are substantial across each subset. Particularly, we observe improvements of 5.2 on iNature100, 3.2 on iNature500, and 1.2 on iNature1000. Note that SPCIE degrades in the imbalance scenario (see Appendix F), and SCAN* performs worse than SCAN in some cases, indicating the ineffectiveness of naive
+
+Table S7: Comparison with SOTA methods on iNature1000 training set.
+
+
Method
iNature1000
ACC
NMI
F1
IIC
7.8±0.5
56.9±0.4
4.2±0.2
PICA
12.4±0.2
55.0±0.1
8.5±0.1
SCAN
26.2±0.2
68.0±0.0
19.6±0.1
SCAN*
10.5±0.2
63.9±0.5
6.4±0.2
CC
12.1±0.4
55.2±0.4
9.1±0.4
DivClust
13.0±0.2
56.0±0.3
9.5±0.2
P2OT
26.7±0.5
67.4±0.4
19.9±0.4
+
+Table S8: ACC Comparison with SOTA methods on balanced test sets. SCAN* (Van Gansbeke et al., 2020) denotes performing another self-labeling training stage based on SCAN.
+
+
Dataset Imbalance ratio
CIFAR100 100
ImgNet-R 13
iNature100 67
iNature500 111
iNature1000 111
IIC
29.4±3.0
21.4±1.7
35.1±2.7
19.8±0.7
13.3±1.0
PICA
30.3±0.4
16.6±0.1
43.5±3.3
31.4±0.3
28.3±0.2
SCAN
37.5±0.3
23.8±0.8
44.0±0.9
39.0±0.1
36.5±0.3
SCAN*
30.5±0.6
25.2±0.1
44.8±0.7
24.3±0.6
14.5±0.2
CC
29.1±1.3
14.7±0.2
38.2±1.4
29.7±1.1
26.6±0.5
DivClust
31.8±0.6
16.8±0.3
42.4±1.2
31.6±0.5
26.9±0.1
P2OT
38.9±1.1
27.5±1.2
50.0±2.1
42.2±1.1
37.7±0.2
+
+Table S9: NMI Comparison with SOTA methods on balanced test sets.
+
+
Dataset Imbalance ratio
CIFAR100 100
ImgNet-R 13
iNature100 67
iNature500 111
iNature1000 111
IIC
56.0±1.6
53.9±1.0
75.4±1.4
73.9±0.4
71.2±0.6
PICA
54.5±0.5
51.9±0.1
78.2±1.5
79.7±0.2
80.0±0.2
SCAN
63.0±0.1
57.0±0.5
80.8±0.5
83.4±0.1
84.2±0.1
SCAN*
57.6±2.0
57.1±0.3
81.9±0.6
77.0±0.6
72.8±0.3
CC
54.2±0.6
48.5±0.3
76.3±0.3
78.3±0.7
78.7±0.2
DivClust
58.1±0.3
50.4±0.3
78.7±0.6
79.2±0.5
78.8±0.2
P2OT
63.1±0.8
58.0±0.7
83.0±0.9
84.3±0.1
84.4±0.2
+
+Table S10: F1 Comparison with SOTA methods on balanced test sets.
+
+
Dataset Imbalance ratio
CIFAR100 100
ImgNet-R 13
iNature100 67
iNature500 111
iNature1000 111
IIC
21.0±3.6
17.7±1.9
25.7±2.8
10.6±0.4
5.0±0.7
PICA
28.2±0.6
16.6±0.2
38.7±3.5
28.3±0.2
26.0±0.1
SCAN
34.9±0.4
23.8±0.9
36.5±1.1
33.3±0.3
31.8±0.4
SCAN*
19.8±0.8
23.5±0.2
36.8±1.3
14.4±0.4
5.8±0.2
CC
25.6±1.3
14.2±0.4
32.4±0.6
26.5±1.4
23.9±0.8
DivClust
28.9±0.6
16.4±0.3
36.1±1.4
27.8±0.6
24.3±0.2
P²OT
35.9±0.8
28.1±1.3
44.2±2.1
37.2±1.4
33.0±0.2
+
+self-labeling training. These strong results demonstrate the superiority of our method in fine-grained and large-scale scenarios.
+
+The NMI and F1 result comparisons of our method with existing approaches are presented in Tab.S9 and Tab.S10. For NMI, our method achieves comparable results with previous state-of-the-art (SCAN) on the CIFAR100 and iNature1000 datasets. On ImgNet-R, iNature100, and iNature500, our method outperforms state-of-the-art by $\sim 1\%$ . For F1, our method surpasses the previous method by a large margin, demonstrating the effectiveness of our method in handling imbalance learning.
+
+Table S11: Comparison with SPICE on balanced training set
+
+
Method
Backbone
Fine Tune
Confidence Ratio
Time Cost(h)
CIFAR100
ACC
NMI
ARI
SPICEs
ViT-B16
False
-
3.6
31.9
57.7
22.5
SPICEs
ViT-B16
True
-
6.7
60.9
69.2
46.3
SPICE
ViT-B16
False
>0
3.6
Fail
Fail
Fail
SPICE
ViT-B16
True
>0.6
6.7
Fail
Fail
Fail
SPICE
ViT-B16
True
0.5
21.6
68.0
77.7
54.8
Ours
ViT-B16
False
-
2.9
61.9
72.1
48.8
+
+# I COMPARISON AND ANALYSIS ON BALANCED TRAINING DATASET
+
+To compare and analyze our method with baselines on balanced datasets, we conduct experiments using the balanced CIFAR100 dataset as demonstrated in Tab.S11. Overall, we have achieved superior performance on imbalanced datasets, and on balanced datasets, we have achieved satisfactory results. However, in balanced settings, we believe that it is a bit unfair to compare our proposed method to methods developed in balanced scenarios, which usually take advantage of the uniform prior.
+
+Note that, as imagenet-r and iNaturelist2018 subsets are inherently imbalanced, we do not conduct experiments on them.
+
+For all methods, we employ the ImageNet-1K pre-trained ViT-B16 backbone. Fine tune refers to the first training stage of SPICE, which trains the model on the target dataset using self-supervised learning, like MoCo. $\mathsf{SPICE}_s$ corresponds to the second stage of training, which fixes the backbone and learns the clustering head by selecting top-K samples for each class, heavily relying on the uniform distribution assumption. SPICE refers to the final joint training stage, which selects an equal number of reliable samples for each class based on confidence ratio and applies FixMatch-like training. In SPICE, the confidence ratio varies across different datasets. Time cost denotes the accumulated time cost in hours on A100 GPUs.
+
+The observed results in the table reveal several key findings: 1) Without self-supervised training on the target dataset, $\mathrm{SPICE}_s$ yields inferior results; 2) SPICE tends to struggle without self-supervised training and demonstrates sensitivity to hyperparameters; 3) SPICE incurs a prolonged training time; 4) Our method achieves comparable results with $\mathrm{SPICE}_s$ and inferior results than SPICE.
+
+On imbalanced datasets, as demonstrated in Tab.S4, SPICE encounters difficulties in clustering tail classes due to the noisy top-K selection, resulting in a lack of reliable samples for these classes. In contrast, our method attains outstanding performance on imbalanced datasets without the need for further hyperparameter tuning.
+
+In summary, the strength of SPICE lies in its ability to leverage the balanced prior and achieve superior results in balanced scenarios. However, SPICE exhibits weaknesses: 1) It necessitates multi-stage training, taking 21.6 hours and 7.45 times our training cost; 2) It requires meticulous tuning of multiple hyperparameters for different scenarios and may fail without suitable hyperparameters, while our method circumvents the need for tedious hyperparameter tuning; 3) It achieves unsatisfactory results on imbalanced datasets due to its strong balanced assumption.
+
+In contrast, the advantage of our method lies in its robustness to dataset distribution, delivering satisfactory results on balanced datasets and superior performance on imbalanced datasets.
+
+# J FURTHER ANALYSIS OF POT, UOT AND SLA
+
+In this section, we provide a comprehensive explanation of the formulations of POT, UOT, and SLA (Tai et al., 2021), followed by an analysis of their limitations in the context of deep imbalanced scenarios. POT replaces the $KL$ constraint with an equality constraint, and its formulation is as
+
+Algorithm 3: Generalized Scaling Algorithm for $\mathrm{P^2OT}$
+Input: Cost matrix - log P, $\epsilon ,\lambda ,\rho ,N,K$
+C<-logP
+ $\beta \leftarrow \frac{\rho}{K}\mathbf{1}_K^{\top},\quad \alpha \leftarrow \frac{1}{N}\mathbf{1}_N,$
+b $\leftarrow 1_{K},\quad s\gets 1,\quad \mathbf{M}\leftarrow \exp (-\mathbf{C} / \epsilon),\quad f\leftarrow \frac{\lambda}{\lambda + \epsilon}$
+while b not converge do a $\leftarrow$ min( $\frac{\alpha}{s\mathrm{Mb}},1)$ b $\leftarrow (\frac{\beta}{s\mathbf{M}^{\top}\mathbf{a}})^{f}$ $s\gets \frac{\rho}{\mathbf{a}^{\top}\mathbf{M}\mathbf{b}}$
+end
+return diag(a)Mdiag(b);
+
+follows:
+
+$$
+\min _ {\mathbf {Q} \in \Pi} \left\langle \mathbf {Q}, - \log \mathbf {P} \right\rangle_ {F} \tag {S47}
+$$
+
+$$
+\text {s . t .} \quad \Pi = \left\{\mathbf {Q} \in \mathbb {R} _ {+} ^ {N \times K} \mid \mathbf {Q} \mathbf {1} _ {K} \leq \frac {1}{N} \mathbf {1} _ {N}, \mathbf {Q} ^ {\top} \mathbf {1} _ {N} = \frac {\rho}{K} \mathbf {1} _ {K}, \mathbf {1} _ {N} ^ {\top} \mathbf {Q} \mathbf {1} _ {K} = \rho \right\} \tag {S48}
+$$
+
+This formulation overlooks the class imbalance distribution, thus making it hard to generate accurate pseudo-labels in imbalance scenarios.
+
+On the other hand, UOT eliminates the progressive $\rho$ , and its corresponding formulation is denoted as follows:
+
+$$
+\min _ {\mathbf {Q} \in \Pi} \left\langle \mathbf {Q}, - \log \mathbf {P} \right\rangle_ {F} + \lambda K L \left(\mathbf {Q} ^ {\top} \mathbf {1} _ {N}, \frac {1}{K} \mathbf {1} _ {K}\right) \tag {S49}
+$$
+
+$$
+\text {s . t .} \quad \Pi = \left\{\mathbf {Q} \in \mathbb {R} _ {+} ^ {N \times K} \mid \mathbf {Q} \mathbf {1} _ {K} = \frac {1}{N} \mathbf {1} _ {N} \right\} \tag {S50}
+$$
+
+UOT has the capability to generate imbalanced pseudo-labels, but it lacks the ability to effectively reduce the impact of noisy samples, which can adversely affect the model's learning process.
+
+SLA (Tai et al., 2021), represented by Equ.(S51), relaxes the equality constraint using an upper bound $b$ . However, during the early training stages when $\rho$ is smaller than the value in $b\mathbf{1}_K$ , SLA tends to assign all the mass to a single cluster, leading to a degenerate representation.
+
+$$
+\min _ {\mathbf {Q} \in \Pi} \left\langle \mathbf {Q}, - \log \mathbf {P} \right\rangle_ {F} \tag {S51}
+$$
+
+$$
+\text {s . t .} \quad \Pi = \left\{\mathbf {Q} \in \mathbb {R} _ {+} ^ {N \times K} \mid \mathbf {Q} \mathbf {1} _ {K} \leq \frac {1}{N} \mathbf {1} _ {N}, \mathbf {Q} ^ {\top} \mathbf {1} _ {N} \leq b \mathbf {1} _ {K}, \mathbf {1} _ {N} ^ {\top} \mathbf {Q} \mathbf {1} _ {K} = \rho \right\} \tag {S52}
+$$
+
+# K GENERALIZED SCALING ALGORITHM FOR $\mathbf{P}^2\mathrm{OT}$
+
+We provide the pseudo-code for the Generalized Scaling Algorithm (GSA) proposed by (Chizat et al., 2018) in Alg.3.
\ No newline at end of file
diff --git a/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/images.zip b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..6e7526f8e3f93ff7400f9aee5a9167d6a30a6c65
--- /dev/null
+++ b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10741dfda7256ccf7cee03c5e696491969f7e6b423ca9bfe34571a0232291204
+size 1108534
diff --git a/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/layout.json b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c198769897bb3b80fa7c2e352218dedbfdce09f5
--- /dev/null
+++ b/p2otprogressivepartialoptimaltransportfordeepimbalancedclustering/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3a5f1b75b020418e13cdd40f2c780e7c4937c1ae7e5074b1fc0438179d2c8b5
+size 789671
diff --git a/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_content_list.json b/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b6b3283cbb60aace2276d5319ef2a9e393d0705
--- /dev/null
+++ b/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c9a4affcf79002ad1838821c6936001a04d359811d9610570643211bbb37e7e
+size 77437
diff --git a/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_model.json b/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b7c1d8181cc5780a4e9fb89815f2b268f3db6862
--- /dev/null
+++ b/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a592371cb3d49d94e27780e277b922015f1d845babcc972138723015b9138be8
+size 98670
diff --git a/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_origin.pdf b/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f1101706a006e02963b1118166f5161e8e30a30e
--- /dev/null
+++ b/p2segpointlysupervisedsegmentationviamutualdistillation/301223cf-5861-4dd3-8b6c-02ceef166340_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:04aed188f3c503140197d3165ca8b4ea695af2a827916ae2bd0e362a76d30171
+size 2947445
diff --git a/p2segpointlysupervisedsegmentationviamutualdistillation/full.md b/p2segpointlysupervisedsegmentationviamutualdistillation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b4cf66d23a015f3163b26d9eb66be50dbb0b574c
--- /dev/null
+++ b/p2segpointlysupervisedsegmentationviamutualdistillation/full.md
@@ -0,0 +1,295 @@
+# P2SEG: POINTLY-SUPERVISED SEGMENTATION VIA MUTUAL DISTILLATION
+
+Zipeng Wang $^{1*}$ , Xuehui Yu $^{1*}$ , Xumeng Han $^{1}$ , Wenwen Yu $^{1}$ , Zhixun Huang $^{2}$ , Jianbin Jiao $^{1}$ , Zhenjun Han $^{1\dagger}$
+
+1University of Chinese Academy of Sciences 2Xiaomi AI Lab, Beijing, China
+
+wangzipeng22@mails.ucas.ac.cn
+
+# ABSTRACT
+
+Point-level Supervised Instance Segmentation (PSIS) aims to enhance the applicability and scalability of instance segmentation by utilizing low-cost yet instance-informative annotations. Existing PSIS methods usually rely on positional information to distinguish objects, but predicting precise boundaries remains challenging due to the lack of contour annotations. Nevertheless, weakly supervised semantic segmentation methods are proficient in utilizing intra-class feature consistency to capture the boundary contours of the same semantic regions. In this paper, we design a Mutual Distillation Module (MDM) to leverage the complementary strengths of both instance position and semantic information and achieve accurate instance-level object perception. The MDM consists of Semantic to Instance (S2I) and Instance to Semantic (I2S). S2I is guided by the precise boundaries of semantic regions to learn the association between annotated points and instance contours. I2S leverages discriminative relationships between instances to facilitate the differentiation of various objects within the semantic map. Extensive experiments substantiate the efficacy of MDM in fostering the synergy between instance and semantic information, consequently improving the quality of instance-level object representations. Our method achieves $55.7\mathrm{mAP}_{50}$ and $17.6\mathrm{mAP}$ on the PASCAL VOC and MS COCO datasets, significantly outperforming recent PSIS methods and several box-supervised instance segmentation competitors. Our code is available on https://github.com/ucas-vg/P2Seg-Public.
+
+# 1 INTRODUCTION
+
+Instance segmentation is a critical task in computer vision, where semantic segmentation estimation and instance discrimination are equally important. In recent years, instance segmentation has gained extensive interest due to its significance in various application scenarios and research domains (Dai et al., 2016a; 2015; 2016b; He et al., 2017b; Kirillov et al., 2017; Liu et al., 2016; Novotny et al., 2018) and it aims not only to locate objects accurately but also to estimate their boundaries to differentiate instances of the same category. The advanced instance segmentation methods use point annotations that only approximate object positions, making it difficult to capture detailed features and accurate boundaries. Hence, relying solely on point annotations has limitations that would not allow instance segmentation methods to provide precise object contours. On the other hand, semantic segmentation in computer vision involves image classification, object recognition, and semantic region boundary delineation, and its goal is to divide the image into distinct regions and assign category labels. Although advanced semantic segmentation excels at precise semantic region boundaries, it often struggles with instance-level discrimination within the same category.
+
+Semantic information struggles to define precise boundaries when multiple same-class objects are close or overlapping. For example, if an image contains multiple bottles, semantic information methods lumps them into one "bottle" region, unable to distinguish between different bottles. Therefore, considering the limitations both instance information and semantic information have, it can be concluded that instance information is vital for accurate discrimination among instances but is limited
+
+
+Figure 1: Two limitations of PSIS methods: Left: severe local responses caused by points separated with image features. Right: ambiguous boundaries caused by missing instance information.
+
+
+Figure 2: The illustration of S2I and I2S Complementary Advantage. Semantic and instance information is mutually distilled, resulting in high-quality instance segmentation maps.
+
+to only instance point annotations; semantic information excels in scene understanding and object recognition but struggles with instance-level information. Both have their own merits. In summary, as shown in Fig. 1 the two problems faced by Point-level Supervised Instance Segmentation (PSIS) methods are:
+
+- The local response caused by the separation of points from image features. Image features and point supervision are decoupled and heavily rely on off-the-shelf proposals for instance segmentation, resulting in localized outcomes.
+- The semantic segmentation estimation and instance differentiation are separated. Point supervision is underutilized in the interaction of semantic segmentation and instance information, resulting in inaccurate instance estimation and challenges in distinguishing similar object boundaries.
+
+In this paper, we aim to solve the above two problems through the Mutual Distillation Module (MDM) of the P2seg method, which leverages the advantages of instance and semantic segmentation. We achieve this by employing the Semantic to Instance (S2I) and Instance to Semantic (I2S) modules within MDM for knowledge distillation. Specifically, our contributions are as follows:
+
+- We design an MDM module that mutually distills instance and semantic information to facilitate improved PSIS without relying on pre-trained proposals.
+- We develop the S2I method to transfer semantic information to instances, guiding the network toward producing improved final instance segmentation labels. These enhanced labels lead to superior performance in the subsequent segmentor training.
+- We propose the I2S module that merges instance details with class map (semantic score predicted by HRNet (Sun et al., 2019)) via affinity matrix. This integration embeds instance information into semantic context to facilitate mutual distillation and improve instance estimation accuracy.
+
+# 2 RELATED WORK
+
+Weakly-Supervised Semantic Segmentation(WSSS). Most WSSS methods extract object location using CAM from CNNs with image-level labels. However, CAM lacks precise boundaries and is insufficient for training semantic networks. ReCAM (Chen et al., 2022) refines CAM with SCE loss. CLIMS (Xie et al., 2022) uses a text-driven approach for better object activation. AFA (Ru et al., 2022) adds an attention affinity module in the transformer to refine CAM. MCTformer (Xu et al., 2022) improves CAM using patch-level pairwise affinity and transformer. L2G (Jiang et al., 2022) learns comprehensive attention knowledge from multiple maps. (Kweon et al., 2023) improves the quality of CAM by reducing the inferability between segments. WSSS focuses on pixel-level classification and cannot distinguish instances within the same category.
+
+
+Figure 3: The architecture of MDM. In S2I branch, instance segmentation map is generated from the results of semantic segmentation using the offset map. In I2S branch, semantic segmentation results are influenced by instance segmentation map using affinity matrix. Finally, instance segmentation map generated by the trained S2I branch of MDM is used as supervision for training the segmentor.
+
+Weakly-Supervised Instance Segmentation(WSIS). Weakly-supervised instance segmentation (WSIS) struggles with obtaining instance-level information from image-level labels. IRNet (Ahn et al., 2019) learns class-agnostic instance maps and pixel pair similarities, deriving pseudo instance segmentation labels without predefined proposals or extra supervision. In contrast, Label-PEnet (Ahn et al., 2019; Ge et al., 2019) transforms image-level labels into pixel-wise labels through a cascaded pipeline where the modules in this pipeline share a backbone network and use curriculum learning to enhance accuracy gradually. PDSL (Shen et al., 2021) unifies object detection and segmentation by integrating bottom-up cues into a top-down pipeline. The detection-segmentation separation allows both to perform better in their respective tasks.
+
+Pointly-Supervised Instance Segmentation(PSIS). The aim of PSIS is to leverage point annotations for improved segmentation, and PSIS methods, such as WISE-Net (Laradji et al., 2020), use point-level labels. To generate high quality mask proposals, WISE-Net trains L-Net with point annotations to locate objects and then uses E-Net to group pixels, generating high quality mask proposals. BESTIE (Kim et al., 2022) refines mask proposals using point supervision and instance-level cues for robust instance segmentation. It addresses semantic drift by using self-refinement and instance-aware guidance and enhances segmentation accuracy by effectively integrating semantic and instance information, thus surpassing methods relying solely on image-level labels. SAM (Kirillov et al., 2023b) is an interactive image segmentation framework that can segment specified objects in an image using coarse hints, such as points, bounding boxes, and textual descriptions. Point2Mask (Li et al., 2023) is employed in panoramic segmentation tasks. It uses ground truth points as supervisory information to generate pseudo-label masks, thereby reducing annotation costs.
+
+Mutual Distillation. Knowledge distillation (Bucilua et al., 2006; Hinton et al., 2015) distills knowledge from a complex teacher model into a simpler, compressed student model to achieve satisfactory performance. Mutual learning strategy (Zhang et al., 2018) involves collaboration among students, allowing them to learn from each other. (Wu et al., 2019) applies mutual learning to each block of a salient object detection backbone. (Zhang et al., 2019) suggests self-distillation within network. (Crowley et al., 2018) transforms a teacher network into a student network. (Hou et al., 2019) uses self-attention distillation for lane detection. (Yun et al., 2020) distills prediction distribution among same-labeled samples. (Wei et al., 2020) employs mutual learning for image classification with noisy labels, aiming to reduce network diversity during training. (Pang et al., 2020) introduces an aggregate interaction module to handle feature fusion challenges. (Yuan et al., 2020) proposes teacher-free knowledge distillation with improved label smoothing regularization. (Yang et al., 2021) introduces mutual learning by considering network width and resolution simultaneously. Inspired by these methods, we propose mutual distillation learning for PSIS. It achieves effective fusion and information promotion from instances and semantics, thereby improving the quality of segmentation results.
+
+# 3 METHOD
+
+Overview. As shown in Fig. 3, our proposed MDM consists of distillation from semantic to instance information and instance to semantic information. In our framework, HRNet serves as the backbone network for feature extraction, which following BESTIE, predicts offset maps, class maps, and instance affinity matrices separately. MDM is a recurrent learning module.
+
+Initially, S2I branch obtains initial offset maps from the generated semantic segmentation map, serving as the initial instance segmentation labels. The offset maps predicted by HRNet connect with the semantic segmentation maps to produce new instance segmentation maps.
+
+Then, the I2S branch uses the newly generated instance segmentation maps to compute the instance affinity matrix. A new semantic segmentation map is generated by multiplying the affinity matrix with the semantic scores (i.e., class map) predicted from HRNet. The instance segmentation map generated at the final stage of MDM is used as pseudo labels to supervise the learning of the segmentor.
+
+
+Figure 4: The abstract concept of semantic and instance information interaction. Corresponding to Fig. 3, the S2I branch is colored in green, while the I2S branch is colored in blue.
+
+# 3.1 SEMANTIC TOINSTANCE
+
+As shown in Fig. 5 regarding the information distilled from semantic to instance, we introduce the S2I branch that combines point annotations and weakly supervised semantic segmentation results to create initial instance segmentation labels. It also calculates instance-level offset maps by measuring inter-pixel distances within the initial results. Initially, it identifies preliminary instance regions using connected component labeling based on the semantic segmentation. Then, these regions are matched with the set of point annotations $E = \{e_1, e_2, \dots, e_K\}$ , where $K$ denotes the number of point annotations. In cases of conflicts (e.g., multiple annotations in one region), a distance separation strategy is used. The distance is defined as:
+
+$$
+k ^ {*} = \arg \min _ {k} \| e _ {k} - p \|, \tag {1}
+$$
+
+where $p$ denotes the points in semantic segmentation map, $e_k$ denotes the $k$ -th annotation point, $k^*$ represents the point $p$ assigned to the $k^*$ -th annotation point $e_{k^*}$ . After obtaining the initial
+
+
+Figure 5: The architecture of the S2I branch. Left: The semantic segmentation map generates the offset map and class maps as supervised. Right: The process of generating the new instance segmentation map.
+
+instance segmentation labels from the distance separation strategy, it generates the corresponding offset maps from the initial labels. Similar to BESTIE, we calculate the offset map for all instance points belonging to the annotation points by calculating the offset between the annotation and other points. The formula is as follows:
+
+$$
+\mathcal {O} = \bigcup_ {e _ {k} \in E} \| e _ {k} - m \|, \tag {2}
+$$
+
+where $m$ denotes the points within the instance region to which the $k$ -th annotated point $e_k$ belongs. $\mathcal{O}$ denotes the offset maps.
+
+The offset maps generated by HRNet prediction is not only used for generating class-agnostic instance segmentation maps based on points but also contributes to the calculation of the loss function with initial offset map to facilitate further network learning through gradient back-propagation. The class-agnostic instance segmentation map is multiplied with the semantic segmentation map generated through I2S branch, leading to new instance segmentation results. It is important to note that instance adaptive grouping is based on point annotations for mask grouping. Our network creates final instance segmentation labels based on a combination of predicted semantic segmentation results, instance similarity matrices, and point annotations. In case of discrepancies between semantic and point-based segmentation, point annotations take precedence. For points without clear instance predictions, a default pseudo-box of size $16 \times 16$ is assigned as their segmentation prediction.
+
+In the first stage, semantic map for S2I consists of pseudo-labels generated from the off-the-shelf segmentation map (e.g. SAM). Since the second stage, the semantic map input to MDM is generated from the previous stage. The instance segmentation map generated in the final stage will serve as pseudo-labels for the instance segmentor and perform the ultimate fine-tuning of the model.
+
+# 3.2INSTANCE TO SEMANTIC
+
+As shown in the blue region in Fig. 3, through the I2S branch, semantic information is distilled into instances. First, the branch obtains an affinity matrix from the instance segmentation map generated by S2I, representing the instance affinity between pairs of pixels. Specifically, in the instance similarity matrix, if two pixels belong to the same instance, their value is set to 1, otherwise, it is set to 0. Subsequently, this branch uses the affinity matrix $\mathcal{A} \in \mathbb{R}^{hw \times hw}$ predicted by HRNet as weights to adjust the class map $\mathcal{C} \in \mathbb{R}^{hw \times (c + 1)}$ generated by HRNet. This adjustment enables the class map to incorporate instance information and generate the updated semantic segmentation map $S = \mathcal{A}^{\circ \beta} * \mathcal{C}$ , where $\mathcal{A}^{\circ \beta}$ denotes the $\beta$ times Hadamard power of $\mathcal{A}$ , which smoothes the distribution to attain the optimal semantic segmentation map. Then affinity matrix generated from the instance segmentation map is used to compute the $\mathcal{L}_{I2S}$ (see Sec. 3.3) with the predicted affinity from HRNet to facilitate gradient backpropagation and promote self-learning of the network. The semantic segmentation map obtained through I2S serves as the semantic information input for the next stage. Through the constraints of instances, I2S enriches the semantic segmentation results with instance information. I2S can be widely applied to various weakly supervised segmentation tasks to allow the segmentation prediction with instance-wise information.
+
+# 3.3 Loss
+
+As shown in Fig. 3, our framework consists of two branches corresponding to the respective two loss functions, namely the S2I loss $\mathcal{L}_{S2I}$ , the I2S loss $\mathcal{L}_{I2S}$ .
+
+S2I Loss. S2I loss consists of the offset loss and the segmentation loss, i.e., $\mathcal{L}_{S2I} = \mathcal{L}_{off} + \mathcal{L}_{seg}$ , which is primarily used to constrain the network to capture instance information. Based on the annotations, we generate the offset map of the pixel value of the corresponding instance object according to the point annotations, which is represented by vector $(x,y)$ . Offset map collects sets of pixels for labeled instance regions from pseudo labels, and set is denoted as $\mathcal{P}_{\mathrm{pseudo}}$ . The offset loss is expressed as follows:
+
+$$
+\mathcal {L} _ {o f f} = \frac {1}{| \mathcal {P} _ {\text {p s e u d o}} |} \sum_ {(i, j) \in \mathcal {P} _ {\text {p s e u d o}}} \mathcal {W} (i, j) \cdot \text {s m o o t h} _ {L 1} | \hat {\mathcal {O}} (i, j) - \mathcal {O} (i, j) |, \tag {3}
+$$
+
+where predicted pseudos in the former stage are $\hat{\mathcal{O}}$ , $\mathcal{O}$ , respectively. $\mathcal{W}$ means the weight of the pseudo loss. Offset loss represents the instance object's scale range that can well constrain the network regression. For semantic segmentation branch, the objective function is defined as:
+
+$$
+\mathcal {L} _ {s e g} = \frac {1}{| \mathcal {P} _ {s e g} |} \sum_ {(i, j) \in \mathcal {P} _ {s e g}} \operatorname {C E} \left(p _ {\hat {\mathcal {C}} (i, j)}, \mathcal {C} (i, j)\right), \tag {4}
+$$
+
+where $\hat{\mathcal{C}},\mathcal{C}$ respectively represent the class map predicted by the network and the class map obtained at the S2I stage while acquiring the offset map, $p_{\hat{\mathcal{C}} (i,j)}$ represents the probabilities predicted by the network for each category in the class map, and $\mathcal{P}_{seg}$ is the set of all pixels in $\hat{\mathcal{C}}$
+
+I2S Loss. I2S loss uses the instance ownership relation between pixels to model the affinity matrix. The expression of I2S loss is as follows:
+
+
+Figure 6: Comparison of distillation from S2I. The yellow area represents BESTIE method, and the green zone indicates the S2I branch.
+
+$$
+\mathcal {L} _ {I 2 S} = \frac {1}{N ^ {+}} \sum_ {(i, j) \in R ^ {+}} \left(2 - \sigma \left(\mathcal {A} ^ {i j}\right) - \sigma \left(\hat {\mathcal {A}} ^ {i j}\right)\right) + \frac {1}{N ^ {-}} \sum_ {(k, l) \in R ^ {-}} \left(\sigma \left(\mathcal {A} ^ {k l}\right) + \sigma \left(\hat {\mathcal {A}} ^ {k l}\right)\right), \tag {5}
+$$
+
+where $\sigma$ represents the sigmoid activation function. $R^{+}$ and $R^{-}$ denote the set of affinity and non-affinity pixel-pair samples. $(i,j)$ , $(k,l)$ denote the pixel pairs, respectively. $N^{+}$ and $N^{-}$ count the number of $R^{+}$ and $R^{-}$ , $\mathcal{A}$ and $\hat{\mathcal{A}}$ means the the affinity matrix generated from the instance map produced by the S2I process and predicted instance affinity matrix by the network HRNet. Eq. 5 reinforces the network to learn highly confident instance affinity relations from iterative training. On the other hand, since the instance affinity prediction is used by semantic segmentation branch, it also benefits the learning of global instance features and further helps to discover the integral object regions. The overall loss is finally formulated as $\mathcal{L} = \lambda_{I2S}\mathcal{L}_{I2S} + \lambda_{\mathrm{S2I}}\mathcal{L}_{S2I}$ .
+
+# 4 EXPERIMENT
+
+# 4.1 IMPLEMENTATION DETAILS
+
+Datasets. Our experiments are conducted on PASCAL VOC 2012 (Everingham et al., 2010) and MS COCO 2017 (Lin et al., 2014) datasets. VOC dataset contains 20 instance classes, which is usually augmented with the SBD (Hariharan et al., 2011) dataset. It includes 10,582, 1,449, and 1,464 images for training, validation, and testing, respectively. COco dataset contains 80 classes and includes $118k$ images for training and $5k$ images for validation. The images we used for training are annotated with point-level labels only.
+
+Evaluation Metrics. We assess the performance of instance segmentation using two measures. We measure the performance using the standard protocol mean Average Precision(mAP). First, we measure the performance using the standard protocol mean Average Precision(mAP) with intersection-over-union(IoU) thresholds of 0.5, 0.7, and 0.75 for VOC. Second, the averaged AP over IoU thresholds from 0.5 to 0.95 is used on COCO dataset.
+
+Training details. We use an AdamW (Loshchilov & Hutter, 2017) optimizer to train our network. The initial learning rate is set as $5 \times 10^{-5}$ and the batch size is set as 8. For the experiments on the VOC dataset, we train the network for 50,000 iterations. To ensure the initial pseudo labels are favorable, we warm-up the network for 2,000 iterations. For experiments on the COCO dataset, the total iterations number is 100,000 and the number of warm-up iterations is 5,000. The weights of semantic segmentation loss, offset map loss and instance affinity matrix loss are set as 1.0, 0.01, 1.0, respectively. The data augmentation strategies used here include random resizing between 0.7 and 1.3, random cropping, random flipping, and photometric distortion. In the fine-tuning phase of the network's instance segmentor, we primarily employ the Mask R-CNN (He et al., 2017a) to retrain the instance segmentation map obtained from the last stage of MDM. We use SGD optimizer with a learning rate of 0.02 and the batch size is 16 with 12 epochs for both VOC and COCO dataset.
+
+# 4.2 COMPARISON WITH STATE-OF-THE-ART METHODS.
+
+Results on Pascal VOC 2012. We report the performance of the proposed method on the commonly used VOC validation dataset( $\dagger$ represents the method reproduced in this paper). As shown in Table 1, the methods are grouped as image-supervised, box-supervised, and pointly-supervised methods from top to bottom. Our method achieves the best performance among all competing methods and even outperforms the most competitive BESTIE on both $\mathrm{mAP}_{50}$ and $\mathrm{mAP}_{75}$ .
+
+Table 1: Quantitative comparison of the state-of-the-art WSIS methods on VOC 2012 val-set. We denote the supervision sources as: $\mathcal{F}$ (full mask), $\mathcal{B}$ (box-level label), $\mathcal{I}$ (image-level label), $\mathcal{P}$ (point-level label), and $\mathcal{C}$ (object count). The off-the-shelf proposal techniques are denoted as follows: $\mathcal{M}$ (segment proposal (Pont-Tuset et al., 2016)), $\mathcal{R}$ (region proposal (Uijlings et al., 2013)), and $\mathcal{S}_{\mathcal{I}}$ (salient instance segmentor (Fan et al., 2019)).
+
+
Method
Sup.
Backbone
Extra
\(mAP_{25}\)
\(mAP_{50}\)
\(mAP_{70}\)
\(mAP_{75}\)
Mask R-CNN (He et al., 2017a)
\(\mathcal{F}\)
ResNet-50
-
76.7
67.9
-
44.9
End-to-End weakly-supervised models.
PRM (Zhou et al., 2018)
\(\mathcal{I}\)
ResNet-50
\(\mathcal{M}\)
44.3
26.8
-
9.0
IAM (Zhu et al., 2019)
\(\mathcal{I}\)
ResNet-50
\(\mathcal{M}\)
45.9
28.3
-
11.9
Label-PEnet (Ge et al., 2019)
\(\mathcal{I}\)
VGG-16
\(\mathcal{R}\)
49.2
30.2
-
12.9
CL (Hwang et al., 2021)
\(\mathcal{I}\)
ResNet-50
\(\mathcal{M},\mathcal{R}\)
56.6
38.1
-
12.3
BBTP (Hsu et al., 2019)
\(\mathcal{B}\)
ResNet-101
-
23.1
54.1
-
17.1
BBTP w/CRF
\(\mathcal{B}\)
ResNet-101
-
27.5
59.1
-
21.9
BoxInst (Tian et al., 2021)
\(\mathcal{B}\)
ResNet-101
-
-
60.1
-
34.6
OCIS (Cholakkal et al., 2019)
\(\mathcal{C}\)
ResNet-50
\(\mathcal{M}\)
48.5
30.2
-
14.4
Point2Mask Li et al. (2023)
\(\mathcal{P}\)
ResNet-101
-
-
48.4
-
22.8
Multi-Stage weakly-supervised models.
WISE (Laradji et al., 2019)
\(\mathcal{I}\)
ResNet-50
\(\mathcal{M}\)
49.2
41.7
-
23.7
IRN (Ahn et al., 2019)
\(\mathcal{I}\)
ResNet-50
-
-
46.7
23.5
-
LIID (Liu et al., 2020)
\(\mathcal{I}\)
ResNet-50
\(\mathcal{M},\mathcal{S}_{\mathcal{I}}\)
-
48.4
-
24.9
Arun et al. (Arun et al., 2020)
\(\mathcal{I}\)
ResNet-101
\(\mathcal{M}\)
59.7
50.9
30.2
28.5
WISE-Net (Laradji et al., 2020)
\(\mathcal{P}\)
ResNet-50
\(\mathcal{M}\)
53.5
43.0
-
25.9
BESTIE† (Kim et al., 2022)
\(\mathcal{P}\)
HRNet-48
-
62.8
52.8
-
31.2
SAM (Kirillov et al., 2023a)
\(\mathcal{P}+\mathcal{S}\)
ViT-S/22.1M
-
59.4
39.9
-
19.0
Ours
\(\mathcal{P}\)
ResNet-101
-
64.1
53.9
37.7
32.0
Ours
\(\mathcal{P}\)
HRNet-48
-
65.8
55.6
40.2
34.4
+
+Table 2: Quantitative comparison of the state-of-the-art WSIS methods on MS COCO 2017 val-set. We denote the supervision sources as: $\mathcal{F}$ (full mask), $\mathcal{B}$ (box-level label), $\mathcal{I}$ (image-level label), and $\mathcal{P}$ (point-level label). The off-the-shelf proposal techniques are denoted as follows: $\mathcal{M}$ (segment proposal (Pont-Tuset et al., 2016)).
+
+
Method
Sup.
Backbone
Extra
AP
\( AP_{50} \)
\( AP_{75} \)
Mask R-CNN (He et al., 2017a)
\(\mathcal{F}\)
ResNet-50
-
34.6
56.5
36.6
End-to-End weakly-supervised models.
BBTP (Hsu et al., 2019)
\(\mathcal{B}\)
ResNet-101
-
21.1
45.5
17.2
BoxInst (Tian et al., 2021)
\(\mathcal{B}\)
ResNet-101
-
31.6
54.0
31.9
Point2Mask (Li et al., 2023)
\(\mathcal{P}\)
ResNet-101
-
12.8
26.3
11.2
Multi-Stage weakly-supervised models.
IRN (Ahn et al., 2019)
\(\mathcal{I}\)
ResNet-50
-
6.1
11.7
5.5
WISE-Net (Laradji et al., 2020)
\(\mathcal{P}\)
ResNet-50
\(\mathcal{M}\)
7.8
18.2
8.8
\(BESTIE^{\dagger}\)(Kim et al., 2022)
\(\mathcal{P}\)
HRNet-48
-
14.2
28.4
22.5
Ours
\(\mathcal{P}\)
HRNet-48
-
17.6
33.6
28.1
+
+Results on MS COCO 2017. The proposed P2Seg is compared with the state-of-the-art on more challenging COCO dataset( $\dagger$ represents the method reproduced in this paper). In Table 2, our method achieves the best performance among all competing methods and even outperforms the most competitive BESTIE on both $\mathrm{AP}_{50}$ and $\mathrm{AP}_{75}$ . We find that P2Seg significantly outperforms weakly supervised methods and is on par with top-performing box-supervised methods.
+
+Overall Analysis. In summary of all the above experimental results, P2Seg significantly enhances AP75, leading to overall segmentation performance improvement. The experiments illustrate that the mutual distillation method, leveraging instance and semantic information, can effectively estimate target scale and shape without requiring subsequent network fine-tuning. This optimization enhances handling of fine-grained segmentation details and resolves challenges with adjacent objects of the same class, ultimately improving segmentation performance.
+
+# 4.3 ABLATION STUDY AND ANALYSIS
+
+In order to further investigate the effectiveness of the instance-based and semantic-based mutual distillation algorithm, this section will conduct corresponding ablation experiments on the mutual
+
+Table 3: Ablation study for Table 4: Ablation study for differ-our S2I and I2S, compared with ent Segmentor Backbones. BESTIE.
+
+
S→I
I→S
mAP50
BESTIE
52.8
S2I
53.2
S2I
I2S
55.7
+
+Table 5: Ablation experiment to analyze the impact of hard pixel ratio.
+
+
Method
Segmentor
\( \mathrm{mAP}_{50} \)
BESTIE Ours
Mask-RCNN
52.8 55.6
BESTIE Ours
SOLOv2
51.9 54.1
+
+
Hard pixel ratio
mAP50
0.1
52.0
0.2
50.8
0.4
51.5
0.8
50.9
+
+Table 6: The comparison of BESTIE and our P2Seg for IoU with the ground truth.
+
+
Method
IoU>50
IoU>70
IoU>90
overall IoU
Semantic Results First
5782
4939
2440
58.49
Points First
9544
7417
2558
66.57
+
+distillation method. Unless otherwise specified, the datasets used in this section are from the PAS-CAL VOC 2012 dataset.
+
+Effect of S2I. The motivation of S2I is to distill the semantic segmentation information into instance segmentation information. Based on the point annotation, S2I also shows its powerful ability to merge semantic segmentation results with point annotations. As shown in Fig. 6, the yellow part illustrates the Semantic Knowledge Transfer method proposed in BESTIE, which has a similar role to the S2I proposed in this paper. However, BESTIE does not fully utilize existing point annotations, whose design only considers scenarios where point annotations and foreground regions have no conflicts, leading to the loss of adjacent objects. In contrast, S2I assigns a unique instance region to represent each point's instance, ensuring better distinction and allocation of instances. As shown in Table.3, S2I obtains $1.4\mathrm{mAP}_{50}$ performance improvement on PSIS tasks compared with the previous methods, showing the effectiveness of S2I statistically.
+
+Effect of I2S. I2S module improves instance discrimination in the same class by using the instance affinity matrix. As shown in Table 3, I2S raises $\mathrm{mAP}_{50}$ from 53.2 to 55.7. The Hadamard power of the affinity matrix provides additional information.
+
+Other Segmentors for Instance Segmentation. As shown in the Table 4, we further evaluate instance segmentation networks trained with our pseudo labels, comparing them to SOLOv2 (Wang et al., 2020) and Mask R-CNN (He et al., 2017a), which are effective networks for single-stage and two-stage methods, respectively. The table displays results of Mask R-CNN and SOLOv2 trained with our pseudo labels, showing significant improvement over the previous state-of-the-art BESTIE. Our method outperforms BESTIE by $2.8\mathrm{mAP}_{50}$ on Mask R-CNN and $2.2\mathrm{mAP}_{50}$ on SOLOv2, highlighting the superiority of mutual distillation over one-way distillation.
+
+Hard pixel ratio. As shown in Table 5, the term "hard pixel ratio" refers to the proportion of challenging samples used in loss computation. A lower proportion of hard pixels during training yields higher $\mathrm{mAP}_{50}$ , which is the validated result without a segmentor. However, reducing this proportion can lead to overfitting on easier examples and limit the model's ability to handle diverse scenarios, resulting in decreased generalization performance. We set the hard pixel ratio to 0.2.
+
+Prediction Mask Quality Comparison. Considering that the post-processing in this approach involves fine-tuning the Mask RCNN network, this study further evaluates the quality of the predicted masks obtained before inputting them into the Mask RCNN network. Table 6 displays data from the PASCAL VOC 2012 dataset, showing the number of predicted masks with IoU thresholds of 0.5, 0.7, and 0.9 compared to ground truth masks in the first three columns. The "average IoU" column presents the mean IoU between predicted instance masks and ground truth masks.
+
+Backbone. We make the ablation experiments about our method on the backbone layer of the network. As shown in Table 1, our method has consistent effects in different feature extracting methods from the backbone network.
+
+# 4.4 VISUALIZATION
+
+As shown in Fig. 7, the results demonstrate image segments using our method and the baseline. P2Seg effectively distinguishes boundaries between neighboring objects in the same class to enhance
+
+
+Figure 7: Visualization result on COCO. First row: Original image. Second row: Segmentation results of BESTIE before fine-tuning. Third row: Segmentation results of the point-supervised instance segmentation network constructed in this paper before fine-tuning. Fourth row: GT.
+
+
+Image
+
+
+initial
+
+
+$5000^{\mathrm{th}}$ iter
+
+
+w/o Mutual Distillation
+10000thiter
+
+
+15000thiter
+
+
+20000thiter
+
+
+50000thiter
+
+
+Label
+Figure 8: Comparison of class-agnostic instance segmentation learning. Left: Original image and class-agnostic instance segmentation annotations. Right: Learning progression from initialization to 50,000 iterations. The top without mutual distillation, and the bottom with it.
+
+
+initial
+
+
+$5000^{\mathrm{th}}$ iter
+
+
+w/ Mutual Distillation
+$10000^{\mathrm{th}}$ iter
+
+
+15000thiter
+
+
+2000thiter
+
+
+$50000^{\mathrm{th}}$ iter
+
+completeness and boundary clarity. The study validates the impact of mutual distillation on instance features through visualizations of class-agnostic instance segmentation maps. As shown in Fig. 8, we compare the segmentation results with and without mutual distillation reveals that the network gains more instance information over time with MDM, allowing it to segment more objects. MDM method significantly enhances the point-supervised instance segmentation network.
+
+# 5 CONCLUSION
+
+We propose MDM, a mutual distillation network using point-level data. It effectively combines point annotations with features and facilitates mutual distillation of information between instance-level and semantic-level information, and distinguishes object boundaries within the same class. MDM employs S2I and I2S processes, enhancing simple class and localization attentions for fully supervised instance segmentation training. Trained on Pascal VOC 2012, MDM shows outstanding performance in both instance and semantic segmentation tasks, showing the power of mutual distillation.
+
+# 6 ACKNOWLEDGMENTS
+
+This work was supported in part by the Youth Innovation Promotion Association CAS, the National Natural Science Foundation of China (NSFC) under Grant No. 61836012 and 61771447, the Strategic Priority Research Program of the Chinese Academy of Sciences under Grant No.XDA27000000.
+
+# REFERENCES
+
+Jiwoon Ahn, Sunghyun Cho, and Suha Kwak. Weakly supervised learning of instance segmentation with inter-pixel relations. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2204-2213, 2019.
+Aditya Arun, CV Jawahar, and M Pawan Kumar. Weakly supervised instance segmentation by learning annotation consistent instances. In European Conference on Computer Vision, pp. 254-270. Springer, 2020.
+Cristian Bucilua, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 535-541, 2006.
+Zhaozheng Chen, Tan Wang, Xiongwei Wu, Xian-Sheng Hua, Hanwang Zhang, and Qianru Sun. Class reactivation maps for weakly-supervised semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 969-978, 2022.
+Hisham Cholakkal, Guolei Sun, Fahad Shahbaz Khan, and Ling Shao. Object counting and instance segmentation with image-level supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12397-12405, 2019.
+Elliot J Crowley, Gavin Gray, and Amos J Storkey. Moonshine: Distilling with cheap convolutions. Advances in Neural Information Processing Systems, 31, 2018.
+J. Dai, K. He, and J. Sun. Convolutional feature masking for joint object and stuff segmentation. In Computer Vision and Pattern Recognition, 2015.
+J. Dai, K. He, Y. Li, S. Ren, and J. Sun. Instance-sensitive fully convolutional networks. arXiv e-prints, 2016a.
+Jifeng Dai, Kaiming He, and Jian Sun. Instance-aware semantic segmentation via multi-task network cascades. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3150-3158, 2016b.
+Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision, 88:303-338, 2010.
+Ruochen Fan, Qibin Hou, Ming-Ming Cheng, Gang Yu, Ralph R Martin, and Shi-Min Hu. Associating interimage salient instances for weakly supervised semantic segmentation. In Proceedings of the European conference on computer vision (ECCV), pp. 367-383, 2018.
+Ruochen Fan, Ming-Ming Cheng, Qibin Hou, Tai-Jiang Mu, Jingdong Wang, and Shi-Min Hu. S4net: Single stage salient-instance segmentation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6103-6112, 2019.
+Weifeng Ge, Sheng Guo, Weilin Huang, and Matthew R Scott. Label-penet: Sequential label propagation and enhancement networks for weakly supervised instance segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3345-3354, 2019.
+Bharath Hariharan, Pablo Arbeláez, Lubomir Bourdev, Subhransu Maji, and Jitendra Malik. Semantic contours from inverse detectors. In 2011 international conference on computer vision, pp. 991-998. IEEE, 2011.
+Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 2961-2969, 2017a.
+Kaiming He, Georgia Gkioxari, Piotr Dlár, and Ross Girshick. Mask r-cnn. In ICCV, 2017b.
+Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+Yuenan Hou, Zheng Ma, Chunxiao Liu, and Chen Change Loy. Learning to steer by mimicking features from heterogeneous auxiliary networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 8433-8440, 2019.
+
+Cheng-Chun Hsu, Kuang-Jui Hsu, Chung-Chi Tsai, Yen-Yu Lin, and Yung-Yu Chuang. Weakly supervised instance segmentation using the bounding box tightness prior. Advances in Neural Information Processing Systems, 32, 2019.
+Jaedong Hwang, Seohyun Kim, Jeany Son, and Bohyung Han. Weakly supervised instance segmentation by deep community learning. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1020-1029, 2021.
+Peng-Tao Jiang, Yuqi Yang, Qibin Hou, and Yunchao Wei. L2g: A simple local-to-global knowledge transfer framework for weakly supervised semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16886-16896, 2022.
+Beomyoung Kim, Young Joon Yoo, Chae-Eun Rhee, and Junmo Kim. Beyond semantic to instance segmentation: Weakly-supervised instance segmentation via semantic knowledge transfer and self-refinement. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4268-4277, 2022.
+A. Kirillov, E. Levinkov, B. Andres, B. Savchynskyy, and C. Rother. Instanccut: From edges to instances with multicut. In IEEE Conference on Computer Vision and Pattern Recognition, 2017.
+Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643, 2023a.
+Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643, 2023b.
+Hyeokjun Kweon, Sung-Hoon Yoon, and Kuk-Jin Yoon. Weakly supervised semantic segmentation via adversarial learning of classifier and reconstructor. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11329-11339, 2023.
+Issam H Laradji, David Vazquez, and Mark Schmidt. Where are the masks: Instance segmentation with image-level supervision. arXiv preprint arXiv:1907.01430, 2019.
+Issam H Laradji, Negar Rostamzadeh, Pedro O Pinheiro, David Vazquez, and Mark Schmidt. Proposal-based instance segmentation with point supervision. In 2020 IEEE International Conference on Image Processing (ICIP), pp. 2126-2130. IEEE, 2020.
+Wentong Li, Yuqian Yuan, Song Wang, Jianke Zhu, Jianshu Li, Jian Liu, and Lei Zhang. Point2mask: Point-supervised panoptic segmentation via optimal transport. arXiv preprint arXiv:2308.01779, 2023.
+Yi Li, Zhanghui Kuang, Liyang Liu, Yimin Chen, and Wayne Zhang. Pseudo-mask matters in weakly-supervised semantic segmentation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 6964-6973, 2021.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dolar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740-755. Springer, 2014.
+S. Liu, X. Qi, J. Shi, H. Zhang, and J. Jia. Multi-scale patch aggregation (mpa) for simultaneous detection and segmentation. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
+Yun Liu, Yu-Huan Wu, Pei-Song Wen, Yu-Jun Shi, Yu Qiu, and Ming-Ming Cheng. Leveraging instance-, image-and dataset-level information for weakly supervised instance segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
+Ilya Loshchilov and Frank Hutter. Fixing weight decay regularization in adam. CoRR, abs/1711.05101, 2017.
+David Novotny, Samuel Albanie, Diane Larlus, and Andrea Vedaldi. Semi-convolutional operators for instance segmentation. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 86-102, 2018.
+Youwei Pang, Xiaoqi Zhao, Lihe Zhang, and Huchuan Lu. Multi-scale interactive network for salient object detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9413-9422, 2020.
+Jordi Pont-Tuset, Pablo Arbelaez, Jonathan T Barron, Ferran Marques, and Jitendra Malik. Multiscale combinatorial grouping for image segmentation and object proposal generation. IEEE transactions on pattern analysis and machine intelligence, 39(1):128-140, 2016.
+
+Lixiang Ru, Yibing Zhan, Baosheng Yu, and Bo Du. Learning affinity from attention: End-to-end weakly-supervised semantic segmentation with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16846-16855, 2022.
+Yunhang Shen, Liujuan Cao, Zhiwei Chen, Baochang Zhang, Chi Su, Yongjian Wu, Feiyue Huang, and Rongrong Ji. Parallel detection-and-segmentation learning for weakly supervised instance segmentation. 2021 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 8178-8188, 2021.
+Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5693-5703, 2019.
+Zhi Tian, Chunhua Shen, Xinlong Wang, and Hao Chen. Boxinst: High-performance instance segmentation with box annotations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5443-5452, 2021.
+Jasper RR Uijlings, Koen EA Van De Sande, Theo Gevers, and Arnold WM Smeulders. Selective search for object recognition. International journal of computer vision, 104:154-171, 2013.
+Xinlong Wang, Rufeng Zhang, Tao Kong, Lei Li, and Chunhua Shen. Solov2: Dynamic and fast instance segmentation. Advances in Neural information processing systems, 33:17721-17732, 2020.
+Hongxin Wei, Lei Feng, Xiangyu Chen, and Bo An. Combating noisy labels by agreement: A joint training method with co-regularization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 13726-13735, 2020.
+Runmin Wu, Mengyang Feng, Wenlong Guan, Dong Wang, Hutchuan Lu, and Errui Ding. A mutual learning method for salient object detection with intertwined multi-supervision. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8150-8159, 2019.
+Jinheng Xie, Xianxu Hou, Kai Ye, and Linlin Shen. Cross language image matching for weakly supervised semantic segmentation. arXiv preprint arXiv:2203.02668, 2022.
+Lian Xu, Wanli Ouyang, Mohammed Bennamoun, Farid Boussaid, and Dan Xu. Multi-class token transformer for weakly supervised semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4310-4319, 2022.
+Taojiannan Yang, Sijie Zhu, Matias Mendieta, Pu Wang, Ravikumar Balakrishnan, Minwoo Lee, Tao Han, Mubarak Shah, and Chen Chen. Mutualnet: Adaptive convnet via mutual learning from different model configurations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(1):811-827, 2021.
+Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3903-3911, 2020.
+Sukmin Yun, Jongjin Park, Kimin Lee, and Jinwoo Shin. Regularizing class-wise predictions via self-knowledge distillation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 13876-13885, 2020.
+Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chenglong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 3713-3722, 2019.
+Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep mutual learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4320-4328, 2018.
+Yanzhao Zhou, Yi Zhu, Qixiang Ye, Qiang Qiu, and Jianbin Jiao. Weakly supervised instance segmentation using class peak response. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3791-3800, 2018.
+Yi Zhu, Yanzhao Zhou, Huijuan Xu, Qixiang Ye, David Doermann, and Jianbin Jiao. Learning instance activation maps for weakly supervised instance segmentation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 3116-3125, 2019.
\ No newline at end of file
diff --git a/p2segpointlysupervisedsegmentationviamutualdistillation/images.zip b/p2segpointlysupervisedsegmentationviamutualdistillation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..33a38cfa43e023ba725d399682c873bd6a5ffdca
--- /dev/null
+++ b/p2segpointlysupervisedsegmentationviamutualdistillation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:23dc149111bbfae028a9ecd48750adaf567a8236b6b4efd051139bc8762dd1fd
+size 580105
diff --git a/p2segpointlysupervisedsegmentationviamutualdistillation/layout.json b/p2segpointlysupervisedsegmentationviamutualdistillation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..aa35d08660aa86c4a7d901df1db2796638eae198
--- /dev/null
+++ b/p2segpointlysupervisedsegmentationviamutualdistillation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a8f79ba8b8e58018a34358d4deb2a6ba96c1007ee03fd22a3b5fdc82450c26a9
+size 405944
diff --git a/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_content_list.json b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7f1d2042926e2145f0374b9668c3483322b50d55
--- /dev/null
+++ b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6855235e44d7e9ef152f6fab1d4ed9f13cb3dff04b733d73f97c56f5bc299ce3
+size 156334
diff --git a/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_model.json b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a1342cc91f0342652da8d1484782e22287a5a2dd
--- /dev/null
+++ b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:adb57ac7398fa1b570a52a196f0c57ab0f9954584ccd580514a40c9a32647e76
+size 176485
diff --git a/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_origin.pdf b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6bada11cfad49d0713943afa32345d87b319d71f
--- /dev/null
+++ b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/b1e240a5-63a9-45b2-9edf-2f0f76e4b7e7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c48e83677c93b8eebbb59cd3dd2b6b79192c88686eeffb82275816568a707b31
+size 841840
diff --git a/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/full.md b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..859767bd4f6f155b9323ab06e7f6472e3fa483c2
--- /dev/null
+++ b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/full.md
@@ -0,0 +1,461 @@
+# PAC-FNO: PARALLEL-STRUCTURED ALL-COMPONENT FOURIER NEURAL OPERATORS FOR RECOGNIZING LOW-QUALITY IMAGES
+
+Jinsung Jeon1, Hyundong Jin1, Jonghyun Choi2, Sanghyun Hong3, Dongeun Lee4, Kookjin Lee5, Noseong Park6
+
+$^{1}$ Yonsei University, $^{2}$ Seoul National University, $^{3}$ Oregon State University,
+
+$^{4}$ Texas A&M University-Commerce, $^{5}$ Arizona State University, $^{6}$ KAIST
+
+{jjsjjs0902,tuzi04}@yonsei.ac.kr,jonghyunchoi@snu.ac.kr
+
+sanghyun.hong@oregonstate.edu, dongeun.lee@tamuc.edu,
+
+kookjin.lee@asu.edu,noseong@kaist.ac.kr
+
+# ABSTRACT
+
+A standard practice in developing image recognition models is to train a model on a specific image resolution and then deploy it. However, in real-world inference, models often encounter images different from the training sets in resolution and/or subject to natural variations such as weather changes, noise types and compression artifacts. While traditional solutions involve training multiple models for different resolutions or input variations, these methods are computationally expensive and thus do not scale in practice. To this end, we propose a novel neural network model, parallel-structured and all-component Fourier neural operator (PAC-FNO), that addresses the problem. Unlike conventional feed-forward neural networks, PAC-FNO operates in the frequency domain, allowing it to handle images of varying resolutions within a single model. We also propose a two-stage algorithm for training PAC-FNO with a minimal modification to the original, downstream model. Moreover, the proposed PAC-FNO is ready to work with existing image recognition models. Extensively evaluating methods with seven image recognition benchmarks, we show that the proposed PAC-FNO improves the performance of existing baseline models on images with various resolutions by up to $77.1\%$ and various types of natural variations in the images at inference.
+
+# 1 INTRODUCTION
+
+Deep neural networks have enabled many breakthroughs in visual recognition (Simonyan & Zisserman, 2014; He et al., 2016; Szegedy et al., 2016; Krizhevsky et al., 2017; Dosovitskiy et al., 2020; Liu et al., 2022). A common practice of developing these models is to learn a model on training images with a fixed input resolution and then deploy the model to many applications.
+
+In practice, when these models are deployed to real world, they are likely to face low-quality inputs at inference, e.g., images with resolutions different from the training data and/or those with natural input variations such as weather changes, noise types, and compression artifacts. The use of such low-quality inputs significantly degrades the performance of visual recognition models. For example, Figure 1 shows that the ConvNeXt models (Liu et al., 2022) trained on ImageNet-1k (Rus-sakovsky et al., 2015) suffer from (top-1) accuracy degradation when their inputs are of low-quality.
+
+
+Figure 1: Performance improvements by PAC-FNO in ImageNet-1k and ImageNet-C/P (Fog). PAC-FNO improves the top-1 accuracy of ConvNeXt models when low-quality inputs are used, compared to the 'resize' baselines which is resize-and-feed using interpolation. ImageNet-C/P (Fog) is a dataset on which the 'fog' variation is applied to the inputs.
+
+A naive approach for using low-resolution images is to resize-and-feed them using interpolation methods. However, the figure shows that even when we use the best-performing interpolation method, the model's performance degrades significantly (i.e., the images with a $32 \times 32$ resolution resized to $224 \times 224$ decreases the top-1 accuracy by $58\%$ ). Similarly, we observe the performance decrease in the ConvNeXt models if the images in weather changes such as fog. It becomes much worse when multiple variations are combined; for example, resizing $32 \times 32$ inputs containing the foggy weather condition leads to a decrease in the top-1 accuracy of the ConvNeXt models by $87\%$ .
+
+Here, we propose a novel architecture that can significantly alleviate the performance degradation of visual recognition models under low-quality inputs. (1) Unlike the prior work (Geirhos et al., 2018; Wang et al., 2020; Zhu et al., 2020; Yan et al., 2022a;b), our method addresses both the low-resolutions and input data variations at the same time. (2) Compared to existing methods (Haris et al., 2018; Anwar & Barnes, 2020) that require training multiple super-resolution models to accommodate different input resolutions (and/or input data variations), we only need a single model to support these input quality degradations.
+
+To address both issues, we develop parallel-structured and all-component Fourier neural operator (PAC-FNO). By operating in the frequency domain, PAC-FNO is able to learn the semantics of images in various resolutions and/or natural variations for challenging image recognition with a single model. The proposed PAC-FNO is ready to work with deep neural visual recognition models to improve their performance.
+
+We perform a comprehensive evaluation of PAC-FNO with seven image recognition benchmarks under various input quality degradation. In the evaluation, PAC-FNO demonstrates superior performance over other baselines in multiple variations such as weather changes at low resolution, with a performance increase of at least $11\%$ at a $32 \times 32$ resolution.
+
+Contributions. We summarize our contributions as follows:
+
+- We propose PAC-FNO, a novel neural network architecture that operates in the frequency domain and offers resilience to image quality degradation, such as resolution changes and/or natural variations, a visual recognition model typically faces in real-world settings.
+- Our design choices of PAC-FNO can offer such resilience with a single model, able to attach to a downstream visual recognition model. Not only does this handle multiple input variations at once, but the approach also minimizes the changes in the downstream model during fine-tuning.
+- We perform an extensive evaluation of PAC-FNO with seven benchmarking tasks. We show that existing image recognition models, fine-tuned with PAC-FNO, can handle any input resolution degradation and are resilient to input variations that occur in real-world deployment settings.
+
+# 2 PRELIMINARIES AND RELATED WORK
+
+Visual recognition with low-quality images. Although low-quality images can be characterized by both low resolution and quality degradation, previous studies have only considered: i) resolution degradation or ii) quality degradation due to noise and weather changes, to name a few. For low-resolution images, they design a specific network for low-resolution classification (Zhu et al., 2020; Yan et al., 2022a;b) or attach an additional model that can handle low-resolution images, such as super-resolution (SR) models, in front of the pre-trained classification models (Cai et al., 2019). For quality degradation, an approach to solving this problem is to use images for training, which makes the model robust to image variations (Geirhos et al., 2018; Wang et al., 2020). Although they are successful in handling low resolution and input variations, respectively, to our knowledge, there is no method that considers the co-existence of resolution degradation and input variation
+
+Fourier neural operators (FNOs). The FNOs achieve remarkable performance in solving PDEs with small computational costs and have been adopted by many other applications (Guibas et al., 2021; Li et al., 2020a;b; Rahman et al., 2022). First of all, FNOs are mathematically defined under the infinite dimensional continuous space regime and for this reason, they can process various resolutions of the continuous space without model changes. However, since the infinite dimensional continuous function of FNOs cannot be implemented in modern computers, the real implementation of FNOs follows the following quantized version:
+
+$$
+\mathbf {h} _ {\ell} = \sigma \left(\mathcal {F} ^ {- 1} \left(\mathrm {R} _ {\theta} \odot \xi \left(\mathcal {F} \left(\mathbf {h} _ {\ell - 1}\right)\right)\right) + \mathbf {h} _ {\ell - 1} \mathbf {W}\right), \tag {1}
+$$
+
+
+Figure 2: Comparison of parallel-structured and all-component FNO (PAC-FNO) with existing FNOs. (a) illustrates the vanilla FNOs. Each FNO block contains an ideal low-pass filter, a learnable filter $(\mathbb{R}_{\theta})$ operating in the frequency domain, and a $1\times 1$ convolutional operator $(\mathbf{W})$ . FNOs can have a series of these blocks. (b) shows a U-shaped FNO (UNO), connecting the FNO blocks in U-shape. (c) depicts Adaptive FNO, which replaces the learnable filter in the FNO block with adaptive global convolution (AGC). Our PAC-FNO shown in (d) uses all frequency components by removing the low-pass filter of the FNO block and runs forward with the AC-FNO block in parallel. (architecture advances are shown from (a) to (d) in red).
+
+where $\mathbf{h}_{\ell} \in \mathbb{R}^{C_{in} \times H \times W}$ is a hidden vector at $\ell$ -th layer. The kernel operator $\mathcal{F}(\kappa)$ is a Fourier transform that transforms the hidden vector into the frequency domain. $\xi$ is an ideal low-pass filter that removes signal components whose frequencies are greater than a threshold from the hidden vector. $\odot$ denotes Hadamard product with a learnable filter $\mathrm{R}_{\theta}$ in the frequency domain. The kernel operator $\mathcal{F}^{-1}(\kappa)$ is an inverse Fourier transform. $\mathbf{W}$ is a $1 \times 1$ convolutional operation. $\sigma$ is a non-linear activation function. For efficiency, FNOs restrict the size of the parameter $\mathrm{R}_{\theta}$ by using an ideal low-pass filter. Then, $\mathrm{R}_{\theta} \in \mathbb{C}^{C_{in} \times C_{out} \times H_r \times W_r}$ , where $C_{in}(C_{out})$ is the channel size of the input (output) hidden vector and $H_r(W_r)$ means the height (width) after the ideal low-pass filter in the frequency domain (cf. Figure 2 (a)).
+
+FNOs for visual recognition. FNOs' resolution invariance is attractive for visual recognition. Recently, applying FNOs to visual recognition has received attention (Guibas et al., 2021; Rahman et al., 2022; Viswanath et al., 2022; Pan et al., 2022; Wu et al., 2023), such as replacing the Vision Transformer's token mixer or detecting embers during wildfire, etc. Among them, U-shaped FNOs (Rahman et al., 2022) change the block configuration of FNOs, which is serial in FNOs, to an encoder and decoder structure using skip connection (cf. Figure 2 (b)).
+
+In addition, adaptive FNO block (Guibas et al., 2021) replaces a token mixer of the Vision Transformer's self-attention (Dosovitskiy et al., 2020) by mixing tokens in the frequency domain. They improved memory and computational efficiency by replacing the learnable filter in the FNO block, which is not suitable for high-resolution input, with small-sized filters interpreted by the adaptive global convolution (AGC) operator. They parallelized AGCs to increase computational efficiency. Here, for a fair comparison, the A-FNO block is set to the same structure as the FNO (cf. Figure 2 (c)). As briefly reviewed here, FNOs are used as one part of the visual recognition model (e.g., token mixing), and their use in visual recognition is still in the early stage of research.
+
+# 3 PAC-FNO: PARALLEL-STRUCTURED AND ALL-COMPONENT FOURIER NEURAL OPERATORS
+
+Despite the success of FNOs in visual recognition (Rahman et al., 2022; Viswanath et al., 2022; Wu et al., 2023), there are significant challenges in applying it to image classification. Wang et al. (2020) shows that there is a trade-off between model performance and generalization depending on image frequency components captured by the neural network in image classification. If the model
+
+
+Figure 3: Parallel-structured and all-component Fourier neural operator (PAC-FNO) architecture in detail. (a) AC-FNO blocks use all frequency components and rely on Zero-padding and Interpolation to construct the images for the target resolution. (b) Contrary to previous FNOs, PAC-FNO consists of multiple AC-FNO blocks in a parallel manner. $\mathbf{h}_{l_j}^{l_i}$ is $(l_{i},l_{j})$ -th hidden vector $(l_{i}\in \{0,\dots ,m\} ,l_{j}\in \{0,\dots ,n\})$ . In (c), $D_{R}$ is a set of image datasets with different resolutions, $h_f$ is a hidden vector processed from PAC-FNO, and $\hat{y}$ is a predicted class (see §3.1 and 3.2 for more details about PAC-FNO).
+
+captures low-frequency components, the accuracy of the model increases, whereas if it captures high-frequency components, generalization improves.
+
+However, to reduce the complexity of post-processing in FNO, an ideal low-pass filter is used after the Fourier transform (Li et al., 2020a), which removes high-frequency components that represent detail in the image. We argue that the low pass filter removes useful information for generalization of the model and harms the image classification accuracy. Thus, we propose a FNO block without the low pass filter, and call it 'all component' FNO (AC-FNO). We then propose to stack the AC-FNO blocks in a parallel structure to increase the capacity of encoding spatial information of images, call the whole structure as 'parallel' AC-FNO or PAC-FNO. We depict its architecture in Figure 3.
+
+# 3.1 AC-FNO BLOCK
+
+When solving PDEs describing fluid dynamics with FNOs, the input signal is assumed periodic in the frequency domain. For efficiency, non-significant parts are removed using a low-pass filter (in other words, high-frequency information is removed). However, in the case of images, high-frequency information sometimes plays an important role in image classification, especially when detailed information is required (type of bird, type of car, etc.). To this end, we propose an AC-FNO block without any band pass filters. Formally, our AC-FNO block is written as:
+
+$$
+\mathbf {h} _ {\ell} = \sigma \left(\mathcal {F} ^ {- 1} \left(\chi \left(\mathrm {R} _ {\theta} \odot \mathcal {F} \left(\mathbf {h} _ {\ell - 1}\right)\right)\right) + \psi \left(\mathbf {h} _ {\ell - 1} \mathbf {W}\right)\right), \tag {2}
+$$
+
+where $\mathrm{R}_{\theta} \in \mathbb{C}^{3 \times 3 \times \mathrm{H}_{\mathrm{r}} \times \mathrm{W}_{\mathrm{r}}}$ denotes a learnable filter that maintains 3 channels of the image where $H_{r}$ and $W_{r}$ denotes the height and the width of the image (resolution) in the frequency domain, $\chi$ is an optional zero-padding, and $\psi$ is an optional interpolation to scale up the processed outcomes for low-resolution inputs only — the sizes of the processed outcomes are scaled up to the target resolution for which the backbone model was trained. Therefore, the AC-FNO block allows the processing of images in various resolutions while maintaining all frequency components (cf. Figure 3 (a)).
+
+# 3.2 PARALLEL CONFIGURATION OF AC-FNO BLOCKS
+
+We now propose to configure AC-FNO blocks in a parallel structure to increase the capacity to learn various types of input variations. Previous FNO models have a serial structure, and the first layer of the model, which is directly related to data, consists of only one block. It has too small a capacity to consider all components of the data. Therefore, we increase the capacity of the first layer with the parallel configuration of AC-FNO blocks, allowing it to utilize all frequencies of the image, including high-frequency and low-frequency components.
+
+There are $n \times m$ AC-FNO blocks, where $n$ is the number of stages and $m$ is the number of parallel AC-FNO blocks in a stage. We then concatenate all the $m$ processed outcomes with a linear layer, followed by a batch normalization. The overall flow of the AC-FNO block can be written as follows:
+
+$$
+\mathbf {h} _ {\ell_ {j}} ^ {\ell_ {i}} = \operatorname {A C - F N O - B l o c k} _ {\ell_ {j}} ^ {\ell_ {i}} \left(\mathbf {h} _ {\ell_ {j} - 1} ^ {\ell_ {i}}\right), \forall \ell_ {i}, \ell_ {j}, \tag {3}
+$$
+
+$$
+\mathbf {h} _ {f} = \operatorname {B N} \left(\operatorname {L i n e a r} \left(\mathbf {h} _ {n} ^ {1}, \mathbf {h} _ {n} ^ {2}, \dots , \mathbf {h} _ {n} ^ {m}\right)\right), \mathbf {h} _ {n} ^ {\ell_ {i}} \in \mathbb {R} ^ {3 \times H _ {t} \times W _ {t}}, \tag {4}
+$$
+
+where AC-FNO-Block $_{\ell_j}$ is the $(\ell_i, \ell_j)$ -th AC-FNO block in Eq. 2. $\mathbf{h}_n^{\ell_i} \in \mathbb{R}^{3 \times H_t \times W_t}$ is the last stage of the hidden vectors where $H_t(W_t)$ is the height (width) of the target resolution, Linear denotes the linear layer that transforms from $3 \times m$ channel to 3 channel, and BN denotes a batch normalization layer. $\mathbf{h}_f$ is an input to the following backbone model. See §4.3 for the impact of PAC-FNO configurations on input variation.
+
+# 3.3 TWO-STAGE LEARNING ALGORITHM
+
+To leverage the pre-trained model in training a PAC-FNO model, we propose a two-stage training algorithm for stable training. Specifically, we jointly train the PAC-FNO and the pre-trained backbone model together using only the target resolution dataset ( $D_{target}$ ) for which the backbone model was trained. Since the pre-trained backbone model may not be able to fully understand the hidden space created by the PAC-FNO, we train them in a two-stage algorithm.
+
+In the first phase, if the PAC-FNO and backbone model are well harmonized1 for target resolution, the second phase begins. In the second phase, we fine-tune the well-harmonized model with images in low resolutions to generate a unified hidden space for all resolutions. If we use three low-resolution datasets with different resolutions for training, such as 32, 64, and 128, then $R$ in $D_R$ has a set of $\{target, low_1, low_2, low_3\}$ . In AC-FNO blocks, interpolation and zero-padding operations are optionally performed on low-resolution images to match the size of the processing result. Then, $\mathbf{h}_f$ , the output of PAC-FNO, is a hidden vector that represents commonalities in images of various resolutions and is used as input to a pre-trained backbone model to predict the class $(\hat{y})$ .
+
+In both stages, we use the cross-entropy loss for training. See §4.3 for the effectiveness of our proposed two-phase training algorithm. We describe the two-stage training algorithm in the Appendix (Algorithm 1) for the sake of space.
+
+In addition, the computational cost of PAC-FNO is small since the number of parameters in the PAC-FNO is $1 - 13\%$ of that of the backbone model. The parameters of PAC-FNO for various backbone models are reported in the Appendix $\S F.2$ .
+
+# 4 EVALUATION
+
+For empirical validations, we evaluate PAC-FNOs and other state of the arts for low-quality visual recognition. After we train them with a pre-trained backbone model, we evaluate the model in low-resolution and input variations tasks at the same time. We then investigate the benefit of proposed components by ablation studies, and analyze the PAC-FNO further by sensitivity studies. Detailed setup is found in Appendix §F.1.
+
+Datasets. We use seven image recognition benchmark datasets to evaluate PAC-FNO. For low-resolution tasks, six image recognition benchmark datasets are used to evaluate PAC-FNO: ImageNet-1k (Russakovsky et al., 2015), Stanford Cars (Krause et al., 2013), Oxford-IIIT Pets (Parkhi et al., 2012), Flowers (Nilsback & Zisserman, 2008), FGVC Aircraft (Maji et al., 2013), and Food-101 (Bossard et al., 2014). For input variation task, we use ImageNet-C/P (Hendrycks & Dietterich, 2019) which is an image dataset containing 19 common corruptions and perturbations.
+
+Backbone architectures. We use four image classification models pre-trained on ImageNet-1k: two convolutional neural networks, ResNet-18 (He et al., 2016) and Inception-V3 (Szegedy et al., 2016), Vision Transformer (ViT) (Dosovitskiy et al., 2020) for a different architecture, and ConvNeXt-Tiny (Liu et al., 2022).
+
+Table 1: Performance of PAC-FNO on the low-resolution tasks using ImageNet-1k. We report top-1 accuracy on low-resolution images generated from ImageNet-1k.
+
+
Model
Method
Resolution
28
32
56
64
112
128
224
299
ResNet-18
Resize
16.7
22.1
45.7
50.5
63.7
65.5
69.8
-
ViT-B16
Resize
41.6
47.4
66.0
68.9
76.8
78.1
81.1
-
Fine-tune
1.01
2.15
10.2
16.3
34.5
50.6
65.0
-
DRLN
0.22
-
17.1
-
62.8
-
69.8
-
DRPN
31.6
-
55.6
-
67.5
-
69.8
-
FNO
40.2
45.2
59.1
61.5
67.6
68.5
70.1
-
UNO
39.9
45.3
58.9
61.3
67.1
68.1
69.4
-
A-FNO
43.3
49.5
60.2
62.5
66.9
67.5
68.5
-
PAC-FNO
42.7
47.7
60.5
62.8
68.3
69.1
70.2
-
Inception-V3
Resize
16.7
22.0
48.6
53.9
69.5
71.8
-
77.3
Fine-tune
39.6
47.2
63.7
69.8
72.9
73.3
-
77.5
FNO
48.9
54.0
68.5
70.2
74.9
76.5
-
78.4
UNO
42.2
48.1
65.4
68.0
74.7
75.5
-
77.3
A-FNO
33.4
39.6
59.6
62.7
71.0
72.1
-
74.9
PAC-FNO
49.3
54.9
68.8
70.7
76.1
76.9
-
78.4
+
+Baselines. We use three baseline types: i) resizing, ii) super-resolution (SR) models, and iii) Fourier neural operator models. Resizing includes Resize and Fine-tune methods that do not require additional networks. Resize is a method that directly feeds the resized images to a pre-trained classification model using interpolation, while Fine-tune is a method of fine-tuning the pre-trained classification model with the resized images. SR models include DRLN (Anwar & Barnes, 2020) and DRPN (Haris et al., 2018), and these two models are representative models capable of up to 8 times super-resolution. With SR models, low-resolution images are upscaled to the target resolution and fed into a pre-trained model. Fourier neural operator models include vanilla FNO (Li et al., 2020a), UNO (Rahman et al., 2022), and A-FNO (Guibas et al., 2021). These models are most similar to our PAC-FNO and are trained by our proposed training method for fair comparison.
+
+Metrics. We use two metrics for the evaluation: top-1 accuracy and relative accuracy. Relative accuracy is defined as the ratio of a model's accuracy in low quality to that in the original resolution. This metric enables us to compare the effectiveness of methods in the same resolution across different datasets and models.
+
+Image degradation types. We generate low-resolution images by resizing and cropping the original images. We consider resolutions in $\{28, 32, 56, 64, 112, 128, 224, 299\}$ , which are frequently used in image classification. For training we use $\{224\}$ or $\{299\}$ as target resolution depending on the backbone model along with $\{32, 64, 128\}$ low resolution. During inference, seven resolutions are used, including three datasets not used for training. Super-resolution models can only be upscaled by 2, 4, or 8 times, so they can be inferred only at resolutions of 28, 56, and 112.
+
+# 4.1 LOW-RESOLUTION IMAGE RECOGNITION
+
+Table 1 shows the top-1 accuracy results of ImageNet-1k. In most cases, PAC-FNO shows good performance. In particular, PAC-FNO shows the best performance not only at low resolution but also at the target resolution of 299 in Inception-V3. We also find that in ConvNeXT-Tiny, PAC-FNO shows the best accuracy at all low resolutions, even if the result at the target resolution is lower than the Resize method (81.5 vs. 82.5). This suggests that PAC-FNO shows good performance in terms of relative accuracy which we proposed. The results of relative accuracy are in the Appendix §F.5.
+
+For fine-grained image datasets, ConvNeXt-Tiny pre-trained with ImageNet-1k is fine-tuned for each dataset with a target resolution. After that, the same algorithm used in ImageNet-1k is applied to the fine-tuned ConvNeXt-Tiny model. Table 2 shows the experimental results for four fine-grained datasets. The proposed method, PAC-FNO, shows good performance at low resolutions by a large margin for all datasets.
+
+In particular, among the Fourier neural operator models, only the PAC-FNO shows better performance than Fine-tune method. This represents the effectiveness of the ideal low-pass filter in the FNO block, which removes detailed image signals that play an important role in classification in the fine-grained dataset. In Food-101, the target resolution accuracy is $2\%$ lower than Fine-tune method,
+
+Table 2: Performance of PAC-FNO on the low-resolution tasks using fine-grained datasets. We report top-1 accuracy for the ConvNext-Tiny model on low-resolution images generated from fine-grained datasets.
+
+
Dataset
Method
Resolution
28
32
56
64
112
128
Oxford-IIIT Pets
Resize
29.4
36.4
70.1
77.0
89.9
91.2
Fine-tune
32.6
41.1
73.2
79.3
91.0
91.5
DRLN
3.37
-
36.8
-
88.1
-
DRPN
41.5
-
84.2
-
92.6
-
FNO
19.1
54.0
60.6
70.2
86.7
90.4
UNO
11.1
15.7
43.2
50.5
80.1
83.8
A-FNO
27.0
33.3
63.5
70.2
85.2
86.9
PAC-FNO
73.4
77.3
86.0
87.6
90.5
91.1
Flowers
Resize
39.5
47.6
75.3
80.3
92.1
93.7
Fine-tune
44.3
51.1
78.8
81.9
92.5
94.0
DRLN
9.92
-
53.4
-
91.3
-
DRPN
64.5
-
89.0
-
95.0
-
FNO
25.3
32.8
65.9
73.0
91.7
93.7
UNO
23.2
30.2
64.5
71.7
90.8
92.6
A-FNO
26.8
33.6
63.7
70.0
86.2
88.8
PAC-FNO
74.1
78.0
87.6
89.3
93.6
94.2
FGVC Aircraft
Resize
2.46
2.76
27.3
41.8
71.0
74.3
Fine-tune
8.5
16.2
40.2
58.3
77.2
76.0
DRLN
1.14
-
13.1
-
68.9
-
DRPN
18.4
-
59.6
-
77.0
-
FNO
26.3
33.2
59.4
64.0
74.6
75.7
UNO
1.65
1.70
9.17
22.7
73.0
76.4
A-FNO
6.78
11.5
50.8
59.2
75.1
77.0
PAC-FNO
37.7
45.1
67.0
69.4
77.0
78.6
Food-101
Resize
40.1
48.1
76.2
80.2
88.1
89.2
Fine-tune
50.2
54.1
80.3
82.0
88.3
89.6
DRLN
7.06
-
39.1
-
86.8
-
DRPN
54.8
-
81.6
-
59.5
-
FNO
43.6
51.3
77.9
81.0
88.2
89.0
UNO
50.5
56.7
75.5
78.3
85.2
86.0
A-FNO
46.0
51.7
72.2
75.8
83.8
84.8
PAC-FNO
74.9
77.8
85.5
86.9
89.2
89.7
+
+Table 3: Performance of PAC-FNO on the input variation tasks. We report top-1 accuracy for the ConvNext-Tiny model on four natural input corruptions, chosen from ImageNet-C/P (Hendrycks & Dietterich, 2019).
+
+
Variation
Method
Resolution
24
32
54
64
112
224
Fog
Resize
8.21
10.8
27.2
31.9
48.5
52.3
Fine-tune
23.2
28.2
47.5
51.4
61.0
62.2
DRLN
0.16
-
6.54
-
33.5
-
DRPN
0.67
-
0.99
-
1.32
-
FNO
14.4
18.6
38.9
43.5
56.6
58.4
UNO
24.6
29.7
46.8
49.5
59.2
60.4
A-FNO
11.0
14.9
33.4
38.3
51.9
53.6
PAC-FNO
25.4
30.4
48.2
51.7
60.1
61.4
Brightness
Resize
22.0
28.2
52.7
56.8
67.8
69.9
Fine-tune
42.8
48.9
65.8
68.1
73.5
74.4
DRLN
6.64
-
35.71
-
56.1
-
DRPN
3.09
-
1.08
-
8.01
-
FNO
34.9
40.7
59.4
62.6
70.0
71.3
UNO
50.8
55.6
66.7
67.9
71.4
72.1
A-FNO
37.6
43.2
59.4
62.5
68.8
69.8
PAC-FNO
51.9
56.5
68.2
69.8
73.4
74.1
Spatter
Resize
18.5
22.9
40.7
44.1
56.3
58.9
Fine-tune
35.6
39.8
52.5
54.8
61.8
63.0
DRLN
1.85
-
17.5
-
37.3
-
DRPN
0.83
-
0.36
-
0.34
-
FNO
28.5
31.9
44.9
47.8
57.5
59.4
UNO
40.2
42.9
50.5
52.2
57.7
58.8
A-FNO
32.0
35.0
45.8
48.4
55.9
57.4
PAC-FNO
43.2
46.0
54.5
56.4
61.3
62.3
Saturate
Resize
17.0
22.6
47.5
52.2
64.7
67.1
Fine-tune
35.6
41.7
61.4
64.5
71.4
72.5
DRLN
1.26
-
19.4
-
44.5
-
DRPN
0.78
-
0.56
-
0.72
-
FNO
30.3
36.0
55.7
59.0
67.3
68.7
UNO
45.8
50.7
63.5
65.3
70.2
71.0
A-FNO
37.9
43.3
59.3
62.1
68.2
69.0
PAC-FNO
44.2
56.5
64.5
69.8
71.9
74.1
+
+but PAC-FNO shows the highest accuracy in all other low resolutions. Compared to the Fine-tune method, accuracy increased by $48.3\%$ , $43.8\%$ , $6.48\%$ , and $5.98\%$ , at 28, 32, 56, and 64 resolutions, respectively. Results for the rest of the fine-grained datasets and best hyperparameter settings are in the Appendix §F.4 and §E. Additionally, we conducted a fine-grained classification experiment on Oxford-IIIT Pets with the ViT model (cf. Appendix §F.4).
+
+# 4.2 RESILIENCE TO NATURAL INPUT VARIATIONS
+
+We now test the resilience of input data variations in test-time, such as weather changes, that likely occurs in real-world deployment settings. We run experiments with ImageNet-C/P (Hendrycks & Dietterich, 2019). ImageNet-C/P has 19 noises that can be used to test resilience against image quality degradation. Table 3 summarizes the top-1 accuracy of PAC-FNO under four input variations—fog, brightness, spatter, and saturate.
+
+PAC-FNO shows superior performance in most cases, especially at low resolution. Only the Fine-tune method shows slightly better performance than PAC-FNO at a target resolution of 224 in fog and brightness. However, the Fine-tune method in fog has a greater performance degradation than PAC-FNO at low resolution. In particular, at $32 \times 32$ resolution, there is a $7.6\%$ performance difference (35.6% vs. 43.2%) between Fine-tune and PAC-FNO. Table 3 shows that the resolution invariant models show good performance at low resolutions and Resize and Fine-tune methods show good performance at relatively high resolutions. In the case of SR models, performance is completely reduced at low-resolution input variation. Our proposed PAC-FNO is more resilient to input changes regardless of resolution than other baseline methods. Results for the rest of the fifteen input
+
+variations are in Appendix §F.6 for the sake of space. We also show in Appendix F.8 an analysis of how the parallel structure of PAC-FNO affects input variation.
+
+# 4.3 ABLATION STUDIES
+
+We now investigate the effect of PAC-FNO's contribution. We conduct experiments for parallel configurations of PAC-FNO and a two-stage training algorithm. The results of the ablation study of PAC-FNO with low and high pass filters were reported in Appendix §F.7 for the sake of space.
+
+Configurations of PAC-FNO layer. We investigate the benefit of our parallel structure to increase the capacity to learn various types of input variants by comparing the performance of the parallel and serial configurations using eight AC-FNO blocks so that total number of AC-FNO blocks are the same but in difference configuration.
+
+For the experiment, ConvNeXt-Tiny is used for the backbone network with ImageNet-1k and ImageNet-1k with fog degradation. Figure 4 shows that the parallel configuration increases performance in terms of accuracy compared to the serial configuration with the same number of AC-FNO blocks on both datasets at all resolutions. It implies that the parallel structure has a clear benefit to better encode the images.
+
+In addition, Figure 4 shows the resilience to input variations depending on the PAC-FNO con
+
+Figurations. In target resolution (224), the performance decrease is reduced in parallel configuration compared to serial configuration such as $22.9\%$ ( $81.5\% \to 62.8\%$ ) in parallel and $39.3\%$ ( $79.1\% \to 48.0\%$ ) in serial configuration. As expected, parallel architectures seem to consider more frequency components than serial architectures.
+
+
+Figure 4: Benefit of parallel structure. We show the top-1 performance of PAC-FNO models with different configurations. $n$ and $m$ are the number of blocks in series and parallel, respectively. Note that the total number of AC-FNO blocks is the same for both configurations. We use ImageNet-1k and ImageNet-C/P (Fog). Compared to serial configuration, our proposed parallel configuration shows less performance degradations at target resolution (39.1% vs. 22.9%)
+
+Two-stage Training Algorithm for PACFNO. We also conducted an ablation study on our proposed two-stage training algorithm. We compare the two-stage training algorithm with i) only the first training stage with the target resolution and ii) only the second training stage with low-resolutions without the first training stage.
+
+We show the result in Figure 5. As shown in the figure, our two-stage training algorithm has a clear benefit. 'First stage only', which does not use low-resolution images but only trains with target resolution, shows a performance decrease at low resolution. 'Second stage only', which is trained directly with low-resolutions and target resolution without a first stage, shows higher performance than 'First
+
+
+Figure 5: Benefit of two-stage training algorithm. We show the top-1 accuracy of the ablation study of the two-stage algorithm. 'First stage only' refers to a model that was trained only with the first stage, and 'Second stage only' refers to a model that was trained only with the second stage, and 'Two-stage algorithm' refers to a model that was trained by our two-stage training algorithm. We use ResNet-18 in ImageNet-1k.
+
+stage only' at low-resolutions, but it shows that performance does not increase as the resolution increases, but that performance is good at intermediate resolutions. Without our full training scheme, the model does not converge well and the accuracy in its target resolution is severely degraded.
+
+# 4.4 SENSITIVITY STUDIES
+
+We then investigate the performance according to the PAC-FNO configuration and the number of trained resolutions.
+
+
+(a) ImageNet-1k $(n = 1)$
+
+
+(b) ImageNet-1k $(m = 2)$
+Figure 6: Results for the number of stages $n$ and blocks $m$ in PAC-FNO.
+
+We vary $n$ and $m$ from $\{1, 2, 4\}$ , respectively, and show the model performance in low-resolution inputs.
+
+Table 4: Results for a number of seen resolutions during training. We show the top-1 accuracy of ResNet-18 models according to the number of resolutions during training time. The image resolutions we used are on the left, and the inference resolutions we test are on the right. We use ImageNet-1k.
+
+
Training Resolution
Inference Resolution
Training Resolution
Inference Resolution
32
48
64
96
128
160
192
224
32
48
64
96
128
160
192
224
{32, 64, 128, 224}
47.7
57.8
62.8
67.1
69.1
70.0
70.0
70.2
{32, 224}
53.0
55.5
59.3
64.1
66.4
68.0
69.0
69.3
+
+Sensitivity study of PAC-FNO layer. We show the impact of changing the number of stages $(n)$ and the number of AC-FNO blocks $(m)$ constituting the PAC-FNO. While one of the $n$ and $m$ is controlled, the other parameter is manipulated, varying as 1, 2, and 4. For the experiment, ResNet-18 is used for the backbone network with ImageNet-1k.
+
+As shown in Figure 6, the appropriate number of stages and AC-FNO blocks for ImageNet-1k is $n = 1$ and $m = 2$ . $n$ and $m$ show differences depending on the backbone models and datasets, but $m \geq 2$ in all cases. In other words, we found that our proposed parallel configuration of AC-FNO blocks is effective in low-resolution image recognition. The best hyperparameters for PAC-FNO configuration are reported in the Appendix §B.
+
+Number of resolutions during training. We show the performance of PAC-FNO depending on the number of resolutions used for training. We use two models for comparison and report top-1 accuracy in Table 4. One is a model trained with resolutions frequently used in image classification, such as $\{32,64,128,224\}$ , and the other one is a model trained with extreme resolutions of $\{32,224\}$ . Both models show meaningful results even for resolutions that are not used for training.
+
+However, the model trained with a wider number of resolutions shows better performance except for the results at $32 \times 32$ resolution. This shows that better performance can be achieved in real-world applications with various resolutions without a process to resize to the target resolution. In addition, this result shows the efficacy of our neural operator-based mechanism which has a strong point in utilizing images in real-world applications.
+
+# 5 CONCLUSION
+
+We proposed parallel-structured and all-component Fourier neural operators (PAC-FNOs) for visual recognition under low-quality images. To this end, we design i) an AC-FNO block without any band pass filters and ii) a parallel configuration of AC-FNO blocks with increased capacity to learn different types of input variations.
+
+In addition, we also propose a two-stage training algorithm for the training of the stable PAC-FNO model. As a result, PAC-FNO provides two advantages over existing methods: (i) It can handle both low-resolution and input variations typically observed in low-quality images with a single model; (ii) One can attach PAC-FNO to any visual recognition model and fine-tune it. In the evaluation with four visual recognition models and seven datasets, we show that PAC-FNO achieves high accuracy for various resolutions and input variations. In particular, it shows the highest accuracy on low-quality inputs that combine multiple effects (e.g., low-resolution images in foggy weather).
+
+Future Work. An interesting line of work is to apply PAC-FNO in complex real-world settings, e.g., where multiple degradations of input can occur (e.g., the low-resolution surveillance camera mixed with motion blur and fog).
+
+# ETHICS STATEMENT
+
+Our approach fine-tunes PAC-FNO and pre-trained image recognition models together, allowing a single model to handle all input resolution degradation and to be resilient to input changes that occur in real-world deployment settings. In the process of fine-tuning the carbon emissions of the machine for training and running, it is essential. However, this can significantly reduce carbon emissions compared to approaches that require training and running a resolution degradation model and an input variations model separately.
+
+# REPRODUCIBILITY STATEMENT
+
+For reproducibility, we attached the source codes in our supplementary materials. There are detailed descriptions for experimental environment settings, datasets, training processes, and evaluation processes in README.md. In the Appendix §E, we also list all the detailed hyperparameters.
+
+# ACKNOWLEDGMENTS
+
+This work was partly supported by the NRF grant (No.2022R1A2C4002300, $10\%$ ) and IITP grants (No.2020-0-01361 ( $20\%$ , Yonsei AI), No.2021-0-01343 ( $10\%$ , SNU AI), No.2022-0-00077 ( $10\%$ , No.2022-0-00113 ( $40\%$ ), No.2021-0-02068 ( $10\%$ , AI Innov. Hub)) funded by the Korea government (MSIT). Sanghyun is partially supported by the Google Faculty Research Award. Work is done when J. Choi and N. Park are with Yonsei University. J. Choi and N. Park are co-corresponding authors.
+
+# REFERENCES
+
+Saeed Anwar and Nick Barnes. Densely residual laplacian super-resolution. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(3):1192-1204, 2020.
+Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101 - mining discriminative components with random forests. In European Conference on Computer Vision, 2014.
+Dingding Cai, Ke Chen, Yanlin Qian, and Joni-Kristian Kämäräinen. Convolutional low-resolution fine-grained classification. Pattern Recognition Letters, 119:166-171, 2019.
+Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of imagenet as an alternative to the CIFar datasets. arXiv preprint arXiv:1707.08819, 2017.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
+Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. arXiv preprint arXiv:1811.12231, 2018.
+John Guibas, Morteza Mardani, Zongyi Li, Andrew Tao, Anima Anandkumar, and Bryan Catanzaro. Adaptive fourier neural operators: Efficient token mixers for transformers. arXiv preprint arXiv:2111.13587, 2021.
+Muhammad Haris, Gregory Shakhnarovich, and Norimichi Ukita. Deep back-projection networks for super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1664-1673, 2018.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016.
+Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019.
+
+Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84-90, 2017.
+Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. arXiv preprint arXiv:2010.08895, 2020a.
+Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Neural operator: Graph kernel network for partial differential equations. arXiv preprint arXiv:2003.03485, 2020b.
+Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11976-11986, 2022.
+Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
+Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics and Image Processing, Dec 2008.
+Hongyi Pan, Diaa Badawi, Chang Chen, Adam Watts, Erdem Koyuncu, and Ahmet Enis Cetin. Deep neural network with walsh-hadamard transform layer for Ember detection during a wildfire. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 257-266, 2022.
+Omkar M. Parkhi, Andrea Vedaldi, Andrew Zisserman, and C. V. Jawahar. Cats and dogs. In IEEE Conference on Computer Vision and Pattern Recognition, 2012.
+Md Ashiqur Rahman, Zachary E Ross, and Kamyar Azizzadenesheli. U-no: U-shaped neural operators. arXiv preprint arXiv:2204.11127, 2022.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211-252, 2015. doi: 10.1007/s11263-015-0816-y.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818-2826, 2016.
+Hrishikesh Viswanath, Md Ashiqur Rahman, Rashmi Bhaskara, and Aniket Bera. Nio: Lightweight neural operator-based architecture for video frame interpolation. arXiv preprint arXiv:2211.10791, 2022.
+Haohan Wang, Xindi Wu, Zeyi Huang, and Eric P Xing. High-frequency component helps explain the generalization of convolutional neural networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8684-8694, 2020.
+Hao Wu, Wei Xion, Fan Xu, Xiao Luo, Chong Chen, Xian-Sheng Hua, and Haixin Wang. Past-net: Introducing physical inductive biases for spatio-temporal video prediction. arXiv preprint arXiv:2305.11421, 2023.
+Tiantian Yan, Haojie Li, Baoli Sun, Zhihui Wang, and Zhongxuan Luo. Discriminative feature mining and enhancement network for low-resolution fine-grained image recognition. IEEE Transactions on Circuits and Systems for Video Technology, 32(8):5319-5330, 2022a.
+
+Tiantian Yan, Jian Shi, Haojie Li, Zhongxuan Luo, and Zhihui Wang. Discriminative information restoration and extraction for weakly supervised low-resolution fine-grained image recognition. Pattern Recognition, 127:108629, 2022b.
+Fanghua Yu, Xintao Wang, Mingdeng Cao, Gen Li, Ying Shan, and Chao Dong. Osrt: Omnidirectional image super-resolution with distortion-aware transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13283-13292, 2023.
+Xiaobin Zhu, Zhuangzi Li, Xianbo Li, Shanshan Li, and Feng Dai. Attention-aware perceptual enhancement nets for low-resolution image classification. Information Sciences, 515:233-247, 2020.
+
+# APPENDIX
+
+# A VARIOUS RESOLUTION IMAGES
+
+There are no image datasets prepared for various resolutions. Therefore, creating images in various resolutions through an appropriate resizing method is important in our task. Chrabaszcz et al. (2017) showed that low-resolution images resized by some interpolations have the characteristics of the original image. Among various interpolation methods, the bilinear interpolation method retains the most characteristics of the original images. Therefore, we constructed low-resolution image datasets applying the same bilinear interpolation method to the original dataset.
+
+After constructing the low-resolution datasets, we examined the performance decrease with various pre-trained models. To check the performance decrease, the low-resolution images were resized back to the target resolution (224) with various interpolation methods. Table 5 shows that the bicubic interpolation has the smallest performance decrease. As mentioned in Section 1, images resized by the bicubic interpolation were used as input to various pre-trained models.
+
+Table 5: The top-1 accuracy of pre-trained ConvNeXt-Tiny in various resolutions when resized up with each interpolating method.
+
+
Method
Acc. (%)
Resolution
32
64
128
224
Nearest
Top-1
0.9
18.17
58.27
82.52
Bilinear
Top-1
29.47
60.36
76.98
82.52
Bicubic
Top-1
34.51
64.88
77.27
82.52
Area
Top-1
0.9
34.92
74.42
82.52
Nearest-exact
Top-1
0.9
18.27
58.27
82.52
+
+Table 6: Classification accuracy drops when scaling up low-resolution images, i.e., 32, 64, 128, to target resolution, i.e., 224 or 299, using existing image interpolation methods. We report the best interpolation method's results.
+
+
Model
Acc. (%)
Resolution
#Param.
32
64
128
224
299
ResNet-18
Top-1
22.09
50.53
65.52
69.76
-
11.69M
Relative
31.67
72.43
93.91
100
-
Inception-V3
Top-1
22.05
53.92
71.77
-
77.29
27.16M
Relative
33.69
72.39
93.51
-
100
ViT-B16
Top-1
47.39
68.91
78.13
81.07
-
86.57M
Relative
58.46
85.00
69.37
100
-
ConvNeXt-Tiny
Top-1
34.51
64.88
77.27
82.52
-
28.59M
Relative
42.02
79.00
94.08
100
-
+
+# B DETAILED DESCRIPTION OF DATASETS
+
+The following are detailed descriptions of the datasets used in our experiments. The number of classes, train images, and test images are organized in Table 7.
+
+# B.1 IMAGENET-1K
+
+ImageNet-1k (Russakovsky et al., 2015) is the most widely used dataset in image classification along with iNaturalist. In particular, the most widely used dataset, ImageNet Large Scale Visual Recognition Challenge 2012 (ILSVRC2012), contains 1000 categories of 1.2 million images. ImageNet is built with the WordNet hierarchy which means each category is explained by several words or phrases. Thus, its goal is to offer a set of qualified images in the same hierarchical words or phrases.
+
+# B.2 FINE-GRAINED DATASETS
+
+Fine-grained Datasets contain classes from a single category, such as cars, birds, flowers, aircraft, or food, and these are more difficult to classify where detailed elements must be considered.
+
+Stanford Cars Stanford Cars (Krause et al., 2013) is a dataset containing car images. There are 196 classes with information on make, model, and year (e.g., 2012 BMW M3 coupe).
+
+Oxford-III Pets Oxford-IIIT Pets (Parkhi et al., 2012) contains images of cats and dogs with 37 categories. The label consisted of species and breeds. This dataset also provides a bounding box for segmentation tasks.
+
+Flowers Flowers (Nilsback & Zisserman, 2008) includes 102 categories of flowers that are mainly found in the United Kingdom. Even flowers belonging to the same categories have large variations in pose, size, and light.
+
+FGVC Aircraft FGVC Aircraft (Maji et al., 2013) is used in the fine-grained recognition challenge 2013 (FGComp). Aircraft with various sizes, purposes, driving forces, and other features are classified by those fine-grained features. The 100 categories of aircraft include the make or name of the model series.
+
+Food-101 Food-101 (Bossard et al., 2014) contains 101 kinds of food images, which were originally provided to be used for RandomForest. The number of images is much larger compared to other fine-grained datasets. The images in this dataset are already rescaled and contain noises ranging from color intensity to wrong labels.
+
+Table 7: The number of classes, train images and test images.
+
+
Datasets
# of classes
# of train images
# of test images
ImageNet-1k
1000
1,281,167
50,000
Stanford Cars
196
8,144
8,041
Oxford-IIIT Pets
37
3,680
3,669
Flowers
102
1,020
6,149
FGVC Aircraft
100
3,334
3,333
Food-101
101
75,750
25,250
+
+# C TRAINING ALGORITHM
+
+We describe a two-stage training algorithm in Algorithm. 1. We first stage for training with target resolution in the first while loop, followed by the second while loop for training with various resolutions.
+
+Algorithm 1: 2-stage Training of PAC-FNO
+Input: Target resolution data $D_{target}$ , Number of low-resolutions $N$ , Low resolution data $\{D_{low_1},\dots ,D_{low_N}\}$ , Class label $y$ , Predicted class label $\hat{y}$ , First phase iteration number $K_{first}$ , Second phase iteration number $K_{second}$ , PAC-FNO parameters $\theta_o$ , Pre-trained backbone model parameters $\theta_p$ , cross-entropy loss $CE$
+Initialize $\theta_o$ ;
+ $k\gets 0$ ;
+/* First training stage
+while $k < K_{first}$ do
+ for each mini-batch $B\subseteq D_{target}$ do
+ $\{\hat{y}_i\}_{i = 1}^{|B|}\gets$ Backbone(PAC-FNO $(B;\theta_o);\theta_p)$ ;
+ Train $\theta_o$ and $\theta_p$ with $CE(\{\hat{y}_i\}_{i = 1}^{|B|},\{\mathbf{y}_i\}_{i = 1}^{|B|})$ ;
+ $k\gets k + 1$ ;
+end
+ $k\gets 0$ ;
+/* Second training stage
+while $k < K_{second}$ do
+ for $i\gets 1$ to $N$ do
+ for each mini-batch $B\subseteq D_{low_i}$ do
+ $\{\hat{y}_i\}_{i = 1}^{|B|}\gets$ Backbone(PAC-FNO $(B;\theta_o);\theta_p)$ ;
+ Train $\theta_o$ with $CE(\{\hat{y}_i\}_{i = 1}^{|B|},\{\mathbf{y}_i\}_{i = 1}^{|B|})$ ;
+ for each mini-batch $B\subseteq D_{target}$ do
+ $\{\hat{y}_i\}_{i = 1}^{|B|}\gets$ Backbone(PAC-FNO $(B;\theta_o);\theta_p)$ ;
+ Train $\theta_o$ with $CE(\{\hat{y}_i\}_{i = 1}^{|B|},\{\mathbf{y}_i\}_{i = 1}^{|B|})$ ;
+ $k\gets k + 1$ ;
+end
+
+# D BACKBONE MODELS
+
+We propose a plug-in module for multi-scale classification. Therefore, we applied various pretrained classification models from CNN-based to ViT-based classification models. All classification models were trained with ImageNet-1k from scratch with the settings in Table 8. TORCHVISION provides all such pre-trained models.
+
+ResNet-18 Residual network (ResNet) is a model that applies the concept of residual connection to CNN architectures. ResNet-18 (He et al., 2016) consists of 18 convolutional blocks and 8 residual layers. It is the most fundamental model in image classification.
+
+Table 8: Recipe for the pre-trained models provided in TORCHVISION.
+
+
Model
ResNet-18
ViT-B16
ConvNeXt-Tiny
Epochs
90
300
600
Batch size
32
512
128
Optimizer
sgd
adamw
adamw
Learning rate (lr.)
0.1
3e-3
1e-3
Weight decay
1e-4
0.3
0.05
lr. scheduler
steplr
cosineannealinglr
cosineannealinglr
lr. warmup method
-
linear
linear
lr. warmup epochs
-
30
5
lr. warmup decay
-
0.033
0.01
Amp
-
○
-
Random erase
-
-
0.1
Label smoothing
-
0.11
0.1
Mixup alpha
-
0.2
0.2
Auto augment
-
ra
ta wide
Clip grad norm
-
1
-
Ra sampler
-
○
○
Cutmix alpha
-
1.0
1.0
Model-ema
-
○
○
Norm weight decay
-
-
0.0
Train crop size
224
224
176
Test resize size
256
256
232
Test crop size
224
224
224
Ra reps
-
3
4
+
+Inception-V3 Inception networks (Szegedy et al., 2016) are one of the most popular classification models, which stacks deep convolutional layers in an efficient way. They proposed techniques such as the concatenation of convolutional layers with different kernel sizes, kernel decomposition, and backpropagation with an auxiliary classifier for efficient training. We used the pre-trained Inception-V3 model provided by TORCHVISION, and there is no training recipe for training from scratch.
+
+ViT-B16 Vision Transformer (Dosovitskiy et al., 2020) (ViT) is a model that uses transformers based on a self-attention architecture in the image domain. It divides an image into patches and calculates all patch-by-patch relationships through self-attention. Because of these calculations, much memory and training time are required. Among those ViT-based models, ViT-B16 has the smallest model size and divides an image into 16 patches.
+
+ConvNeXt-Tiny ConvNeXt (Liu et al., 2022) is one of the most recent models with good performance using only convolutional networks. It shows better performance with fewer parameters compared to ViT. To achieve good performance, it utilizes several advanced training schemes for convolutional networks. ConvNeXt-Tiny refers to the smallest model size in the ConvNeXt family.
+
+# E HYPERPARAMETERS
+
+In Tables 9 and 10, we list all the key hyperparameters in our experiments for each dataset. Our Appendix accompanies some trained checkpoints and one can easily reproduce.
+
+Table 9: The best hyperparameter of our main experiments (ImageNet-1k).
+
+
ImageNet-1k
ResNet-18
Inception-V3
Vision
Transformer
ConvNeXt-Tiny
# of parallel AC-FNO blocks (m)
2
2
2
4
# of stages (n)
1
1
1
2
First phase training lr.
1e-3
1e-3
1e-3
2e-4
Second phase training lr.
1e-6
1e-6
1e-6
2e-6
+
+Table 10: The best hyperparameter of our experiments on the fine-grained datasets.
+
+
ConvNeXt-Tiny
StanfordCars
Oxford-IIIT
Pets Flowers
FGVC
Aircraft Food-101
# of parallel AC-FNO blocks (m)
4
2
2
2
2
# of stages (n)
2
2
1
1
1
First phase training lr.
1e-3
1e-3
1e-3
1e-3
1e-3
Second phase training lr.
1e-6
1e-5
1e-6
1e-6
1e-6
+
+# F EVALUATION
+
+# F.1 EXPERIMENTAL SETUP
+
+We run our experiments on a machine equipped with Intel i9 CPUs and Nvidia RTX A5000/A6000 GPUs. We implement PAC-FNO using Python v3.8 and PyTorch v1.12.
+
+# F.2 NUMBER OF PARAMETERS OF PAC-FNO
+
+We report the number of parameters of PAC-FNO according to backbone models and datasets.
+
+Table 11: The number of parameters according Table 12: The number of parameters according to backbone models. datasets
+
+
ImageNet-1k
ResNet-18
Inception-V3
Vision Transformer
ConvNeXt-Tiny
ConvNeXt-Tiny
StanfordCars
Oxford-IIIT
Pets Flowers
FGVC
Aircraft Food
Food-101
# of PAC-FNO parameters
+0.91M
+1.61M
+0.91M
+3.65M
# of PAC-FNO parameters
+3.65M
+3.65M
+3.65M
+3.65M
+3.65M
+3.65M
+
+# F.3 ADDITIONAL SUPER-RESOLUTION METHODS
+
+In this section, we report experimental results with the additional latest super-resolution baseline. We fine-tune a pre-trained classification model with low-resolution images that are upscaled by the super-resolution model. We note that we used the latest super-resolution model.
+
+In Table 13, combining the super-resolution and fine-tune methods shows better performance than simply upscaling low-resolution images to the target resolution using the super-resolution model. Even at 32 resolution, it shows slightly better performance than PAC-FNO. However, this super-resolution method has two major drawbacks. The first drawback is the model size. DRPN's $\times 8$ upscaling model has a similar number of parameters than the pre-trained model size, i.e., 23.21M vs.28.59M. Second, a model is needed for each resolution. In other words, upscaling models for $\times 8$ , $\times 4$ , and $\times 2$ are needed to handle 28, 56, and 112 resolutions, respectively. In contrast, our proposed PAC-FNO can handle images of all resolutions with an additional 3.65M network and shows good performance.
+
+Additionally, we verify the superiority of PAC-FNO by providing a comparison with a method equipped with the latest super-resolution model. OSRT (Yu et al., 2023) is a state-of-the-art model in the super-resolution domain but it does not support $\times 8$ upscale. Therefore, we only use the $\times 2$ and $\times 4$ upscale models of OSRT. As a result, PAC-FNO shows better performance than OSRT and OSRT (fine-tune) methods.
+
+Table 13: Results with the additional latest super-resolution method. For the experiment, we used ConvNeXt-Tiny as a pre-trained model. (Left: ImageNet-1k, Right: ImageNet-C/P Fog)
+
+
Model
Method
Metric
Resolution
28
32
56
64
112
128 224
ConvNeXt-Tiny
Resize
Top1-Acc (%)
27.5
34.5
60.7
64.9
75.0
77.3 82.5
Fine-tune
Top1-Acc (%)
40.2
62.3
65.8
76.0
76.4
80.7 81.8
DRPN
Top1-Acc (%)
40.7
-
68.2
-
79.4
- 82.5
# of Parameters (M)
23.21
-
10.43
-
5.95
-
DRPN
Top1-Acc (%)
60.8
-
72.5
-
76.7
- 82.5
(Fine-tune)# of Parameters (M)
23.21
-
10.43
-
5.95
-
OSRT
Top1-Acc (%)
-
-
61.4
-
75.4
- 82.5
# of Parameters (M)
-
-
11.93
-
11.79
-
OSRT
Top1-Acc (%)
-
-
71.2
-
78.4
- 81.2
(Fine-tune)# of Parameters (M)
-
-
11.93
-
11.79
-
PAC-FNO
Top1-Acc (%)
58.9
63.2
77.6
76.2
80.2
80.7 81.8
# of Parameters (M)
3.65
+
+
Model
Method
Metric
Resolution
28
32
56
64
112
128 224
ConvNeXt-Tiny
Resize
Top1-Acc (%)
8.12
10.8
27.2
31.9
48.5
52.3 58.4
Fine-tune
Top1-Acc (%)
23.2
28.2
47.5
51.4
61.0
62.2 63.0
DRPN
Top1-Acc (%)
0.67
-
0.99
-
1.32
-
# of Parameters (M)
23.21
-
10.43
-
5.95
-
DRPN
Top1-Acc (%)
21.8
-
42.3
-
56.8
-
(Fine-tune)# of Parameters (M)
23.21
-
10.43
-
5.95
-
-
OSRT
Top1-Acc (%)
-
-
19.4
-
37.9
-
# of Parameters (M)
-
-
11.93
-
11.79
-
OSRT
Top1-Acc (%)
-
-
42.3
-
56.4
-
(Fine-tune)# of Parameters (M)
-
-
-
11.93
-
11.79
-
PAC-FNO
Top1-Acc (%)
25.4
30.4
48.2
51.7
60.1
61.4 62.8
# of Parameters (M)
3.65
+
+# F.4 ADDITIONAL FINE-GRAINED DATASETS
+
+Tables 14 and 15 show the performance of the remaining fine-grained dataset, Stanford Cars. PAC-FNO shows good performance in most cases, especially at low-resolution compared to other models. Tables 16 and 17 show the performance of the Oxford-IIIT Pets with the ViT model. PAC-FNO shows good performance than FNO at all resolutions.
+
+Table 14: Top-1 accuracy on low-resolution.
+Table 15: Relative accuracy on low-resolution.
+
+
Dataset
Method
Resolution
Dataset
Method
Resolution
28
32
56
64
112
128
224
28
32
56
64
112
128
224
Standford Cars
Resize
14.7
22.5
66.3
73.6
88.2
89.6
91.5
Standford Cars
Resize
16.1
24.5
72.4
80.4
96.4
97.9
100
Fine-tune
12.3
66.5
70.5
88.5
91.2
92.4
92.6
Fine-tune
13.6
71.9
76.1
95.6
98.5
99.8
100
DRLN
1.98
-
36.1
-
87.0
-
91.5
DRLN
2.16
-
39.4
-
95.1
-
100
DRPN
41.5
-
84.2
-
90.9
-
91.5
DRPN
51.9
-
92.1
-
99.3
-
100
FNO
11.9
19.2
67.8
75.3
91.0
92.6
93.9
FNO
12.7
20.5
72.2
80.2
96.9
98.6
100
UNO
57.4
66.2
85.9
87.8
91.6
92.1
92.3
UNO
62.2
71.7
93.1
95.1
99.2
99.8
100
A-FNO
67.6
74.4
88.0
89.7
92.1
92.3
92.7
A-FNO
72.9
80.2
94.9
96.7
99.4
99.5
100
PAC-FNO
70.4
76.6
89.0
90.0
92.6
92.8
93.5
PAC-FNO
75.3
81.9
95.2
96.3
99.0
99.3
100
+
+Table 16: Top-1 accuracy on low-resolution.
+Table 17: Relative accuracy on low-resolution.
+
+
Dataset
Method
Resolution
Model
Method
Resolution
28
32
56
64
112
128
224
28
32
56
64
112
128
224
Oxford-IIT Pets
FNO
26.3
33.0
58.1
64.8
82.9
85.8
91.3
Oxford-IIT Pets
FNO
28.8
36.1
63.6
71.0
90.8
94.0
100
PAC-FNO
40.3
46.2
69.0
72.5
86.8
89.2
92.2
PAC-FNO
43.7
50.1
74.8
78.6
94.1
96.7
100
+
+# F.5 ADDITIONAL METRIC FOR IMAGENET-1K AND FINE-GRAINED DATASETS
+
+Table 18 and 19 show the relative accuracy of low-resolution images generated by ImageNet-1k and fine-grained datasets. In ImageNet-1k, the performance of PAC-FNO is the best in most of the datasets, and especially in lower resolution. In fine-grained datasets, PAC-FNO shows good performance in all cases. In other words, PAC-FNO works very well for low-resolution image classification.
+
+Table 18: Relative accuracy on low-resolution images generated from ImageNet-1k
+
+
Model
Method
Resolution
28
32
56
64
112
128
224.299
ResNet-18
Resize
23.9
31.7
65.5
72.3
91.3
93.8
100
Fine-tune
1.6
3.3
15.7
25.1
53.1
77.8
100
DRLN
0.3
-
24.5
-
90.0
-
100
DRPN
45.3
-
79.7
-
96.7
-
100
FNO
57.3
64.5
84.3
87.7
96.4
97.7
100
UNO
57.5
65.3
84.9
88.3
96.7
98.1
100
A-FNO
63.2
72.3
87.9
91.2
97.7
98.5
100
PAC-FNO
60.8
67.9
86.2
89.5
97.3
98.4
100
Inception-V3
Resize
21.6
28.5
62.9
69.7
89.9
92.9
-
Fine-tune
51.1
60.9
82.2
90.1
94.1
94.6
-
FNO
62.4
68.9
87.4
89.5
95.5
97.6
-
UNO
54.6
62.2
84.6
88.0
96.6
97.7
-
A-FNO
44.6
52.9
79.6
83.7
94.8
96.3
-
PAC-FNO
62.9
70.0
87.8
90.2
97.1
98.1
-
ViT-B16
Resize
51.3
58.4
81.4
85.0
94.7
96.3
100
Fine-tune
49.1
59.8
82.1
85.8
95.3
96.7
100
DRLN
4.6
-
51.8
-
94.9
-
100
DRPN
64.4
-
90.0
-
98.6
-
100
FNO
49.1
58.5
83.1
86.8
96.7
97.9
100
UNO
54.5
63.1
84.7
87.7
97.1
98.3
100
A-FNO
69.1
74.8
90.9
93.2
98.5
99.2
100
PAC-FNO
58.5
65.5
86.7
89.9
97.6
98.7
100
ConvNeXt-Tiny
Resize
33.3
41.8
73.6
78.7
90.9
93.7
100
Fine-tune
49.1
76.2
80.4
92.9
93.4
98.7
100
DRLN
0.4
-
30.4
-
87.0
-
100
DRPN
49.3
-
82.7
-
96.2
-
100
FNO
54.0
61.7
85.1
88.1
96.6
97.7
100
UNO
72.7
78.0
91.4
93.7
98.1
98.9
100
A-FNO
61.8
68.5
87.2
90.3
97.8
98.1
100
PAC-FNO
72.3
77.5
91.4
93.5
98.4
99.0
100
+
+Table 19: Relative accuracy on low-resolution images generated from Fine-grained datasets
+
+
Dataset
Method
Resolution
28
32
56
64
112
128
Oxford-IIIT Pets
Resize
31.4
38.8
74.8
82.2
95.9
97.3
Fine-tune
34.8
43.8
78.0
84.5
97.0
97.5
DRLN
3.6
-
39.3
-
94.0
-
DRPN
44.3
-
89.9
-
98.8
-
FNO
20.9
59.1
66.3
76.8
94.9
98.9
UNO
12.3
17.4
47.8
55.9
88.7
92.8
A-FNO
30.3
37.4
71.3
78.8
95.6
97.5
PAC-FNO
80.0
84.3
93.8
95.5
98.7
99.3
Flowers
Resize
41.2
49.6
78.5
83.7
96.0
97.7
Fine-tune
46.2
53.3
82.2
85.4
96.5
98.0
DRLN
10.3
-
55.7
-
95.2
-
DRPN
67.3
-
92.8
-
99.1
-
FNO
26.2
34.0
68.2
75.6
94.9
97.0
UNO
24.1
31.4
67.1
74.6
94.5
96.4
A-FNO
29.2
36.6
69.3
76.2
93.8
96.6
PAC-FNO
78.5
82.6
92.8
94.6
99.2
99.8
FGVC Aircraft
Resize
3.1
3.5
34.3
52.4
89.1
93.2
Fine-tune
10.7
20.3
50.4
73.1
96.7
95.2
DRLN
1.4
-
16.4
-
86.4
-
DRPN
23.1
-
74.8
-
96.6
-
FNO
32.6
41.1
73.6
79.3
92.4
93.8
UNO
2.0
2.1
11.2
27.8
89.5
93.6
A-FNO
8.4
14.2
62.9
73.3
92.9
95.3
PAC-FNO
46.5
55.6
82.6
85.6
94.9
96.9
Food-101
Resize
44.0
52.8
83.6
88.0
96.7
97.9
Fine-tune
55.0
59.3
88.0
89.9
96.8
98.2
DRLN
7.7
-
42.9
-
95.3
-
DRPN
60.2
-
89.6
-
65.3
-
FNO
48.0
56.5
85.8
89.2
97.1
98.0
UNO
57.5
64.5
85.9
91.6
96.9
97.8
A-FNO
52.2
58.6
81.9
85.9
95.0
96.1
PAC-FNO
82.9
86.1
94.6
96.1
98.7
99.2
+
+# F.6 ADDITIONAL NATURAL INPUT VARIATIONS
+
+Table 20 shows the remaining input variation results of ImageNet-C/P Hendrycks & Dietterich (2019). For the remaining input variations, we report results at 32, 64, 128, and 224 resolution, excluding SR models whose performance appears to be meaningless. In most cases, PAC-FNO shows good performance at 32 and 64 resolution, and Fine-tune shows good performance at $128 \times 128$ and $224 \times 224$ resolution. However, at 128 and 224, there is a performance difference of up to $5\%$ (Glass noise $44.2\%$ vs. $39.5\%$ at $128 \times 128$ resolution), but at 32 and 63, there is a performance difference of up to $47\%$ (Pixelate $44.2\%$ vs. $39.5\%$ at $32 \times 32$ resolution). In other words, PAC-FNO shows good performance by a large margin at low-resolution.
+
+Table 20: Performance of PAC-FNO on the input variation tasks. We show the top-1 accuracy of the ConvNext-Tiny model on remaining input variations, chosen from ImageNet-C/P (Hendrycks & Dietterich, 2019).
+
+
Variation
Model
Resolution
Variation
Model
Resolution
Variation
Model
Resolution
32
64
128
224
32
64
128
224
32
64
128
224
Gaussian Noise
Resize
11.3
37.9
55.3
47.9
Motion Noise
Resize
10.6
36.5
54.0
48.1
Elastic Transform
Resize
12.2
40.0
56.8
53.2
Fine-tune
11.6
39.5
57.4
51.5
Fine-tune
11.5
39.6
58.8
55.9
Fine-tune
12.6
41.5
59.1
56.6
FNO
38.4
47.1
46.5
43.4
FNO
36.3
46.9
48.7
47.4
FNO
38.3
49.7
52.1
51.5
UNO
42.8
54.6
56.5
52.1
UNO
41.3
50.6
49.3
47.9
UNO
45.4
52.8
50.5
48.4
A-FNO
37.8
43.1
44.0
42.8
A-FNO
37.6
44.9
42.6
41.3
A-FNO
41.3
48.2
47.8
45.4
PAC-FNO
48.0
54.8
56.5
52.3
PAC-FNO
50.4
56.5
55.3
54.1
PAC-FNO
51.8
57.3
55.8
53.5
Shot Noise
Resize
11.3
37.3
53.8
45.4
Zoom Noise
Resize
10.3
25.7
43.0
43.6
Pixelate
Resize
14.5
81.0
63.8
53.2
Fine-tune
11.6
39.0
56.2
49.5
Fine-tune
10.9
26.8
46.4
48.9
Fine-tune
15.1
52.9
66.8
56.6
FNO
38.2
45.9
43.9
41.1
FNO
35.2
38.5
37.3
37.0
FNO
48.6
66.7
62.5
42.9
UNO
41.2
53.6
55.2
50.5
UNO
33.5
40.2
39.4
39.5
UNO
40.8
70.9
64.6
52.2
A-FNO
38.1
42.9
42.8
41.2
A-FNO
36.0
35.9
33.8
33.5
A-FNO
53.2
67.8
58.9
40.8
PAC-FNO
47.7
54.0
55.0
50.0
PAC-FNO
49.6
48.8
46.5
44.6
PAC-FNO
62.6
73.2
67.9
54.4
Impulse Noise
Resize
10.8
36.9
53.2
44.6
Snow
Resize
4.9
20.2
46.6
49.6
Jpeg Compression
Resize
12.9
44.4
64.3
62.4
Fine-tune
11.3
38.5
55.5
48.5
Fine-tune
5.2
21.8
49.0
52.5
Fine-tune
13.3
45.9
66.3
65.5
FNO
37.2
45.2
41.8
38.5
FNO
20.3
31.1
41.6
45.9
FNO
45.2
62.5
65.2
63.7
UNO
37.2
53.5
54.3
48.9
UNO
40.1
36.5
44.0
43.6
UNO
61.1
61.2
64.4
62.2
A-FNO
36.5
41.3
39.3
37.2
A-FNO
18.1
27.4
37.5
40.4
A-FNO
50.9
64.8
63.9
61.1
PAC-FNO
46.7
53.5
54.1
50.2
PAC-FNO
31.9
41.1
48.3
49.4
PAC-FNO
52.3
63.2
64.8
63.0
Defocus Noise
Resize
10.0
32.2
48.3
43.2
Frost
Resize
6.5
30.8
54.9
54.1
Speckle Noise
Resize
12.1
41.2
59.2
53.5
Fine-tune
11.1
36.9
56.9
55.9
Fine-tune
6.9
32.3
56.7
57.0
Fine-tune
12.5
42.6
66.2
57.1
FNO
35.8
44.9
47.4
47.6
FNO
27.8
42.3
49.0
50.9
FNO
41.6
52.7
51.3
48.8
UNO
47.2
51.5
50.5
47.3
UNO
46.0
48.8
54.0
53.6
UNO
48.3
58.6
59.9
56.2
A-FNO
38.6
47.2
47.4
47.2
A-FNO
22.6
37.7
45.3
46.0
A-FNO
42.7
49.6
49.8
48.3
PAC-FNO
51.3
57.7
57.5
56.2
PAC-FNO
40.3
52.4
56.9
56.9
PAC-FNO
52.1
60.3
61.4
57.8
Glass Noise
Resize
11.7
33.5
38.7
31.5
Contrast
Resize
8.1
40.4
62.9
59.5
Gaussian Blur
Resize
10.4
34.8
51.1
46.9
Fine-tune
12.7
36.9
44.2
38.8
Fine-tune
8.5
41.7
65.8
64.7
Fine-tune
11.5
39.1
59.0
58.4
FNO
39.8
43.3
34.9
32.4
FNO
31.8
53.5
63.3
63.5
FNO
37.3
47.8
50.6
50.8
UNO
26.1
43.4
33.4
30.7
UNO
59.2
59.6
65.2
62.8
UNO
51.2
54.0
53.3
50.2
A-FNO
42.8
39.6
28.7
26.1
A-FNO
34.8
55.6
62.1
59.2
A-FNO
40.1
50.2
51.3
51.2
PAC-FNO
54.4
50.9
39.5
35.1
PAC-FNO
44.9
59.9
65.1
62.3
PAC-FNO
52.5
60.0
60.7
59.4
+
+Table 21: Performance of PAC-FNO according to low and high-frequency filter. We report top-1 accuracy on low-resolution images generated from ImageNet-1k in ConvNeXt-Tiny.
+
+
ImageNet-1k
32
64
128
224
PAC-FNO (low pass filter)
53.5
71.4
78.7
79.0
PAC-FNO (high pass filter)
21.6
49.4
68.2
74.8
PAC-FNO
58.9
74.5
80.2
81.5
+
+
ImageNet-C/P Fog
32
64
128
224
PAC-FNO (low pass filter)
18.0
41.7
52.4
54.4
PAC-FNO (high pass filter)
5.92
23.0
43.2
50.2
PAC-FNO
25.4
48.2
60.1
62.8
+
+# F.7 ADDITIONAL ABLATION STUDIES
+
+We provide an analysis of the impact of low and high-frequency information on accuracy/generalization through ablation experiments. Table 21 shows that compared to PAC-FNO, using low-pass and high-pass filters results in lower accuracy and generalization. When using a high-pass filter, it is expected to show good performance in ImageNet-C/P Fog, but since the perfor
+
+
+Figure 7: Comparison of spectral responses according to the configuration of the AC-FNO block. We test the ConvNeXT-Tiny backbone model on ImageNet-1k and visualize only the hidden vector of the first layer ( $m = 1$ ) for the hidden vectors $\mathbf{h}_n^m$ . In the case of parallel (solid line), there are four hidden vectors $(\mathbf{h}_n^1, n \in \{1, 2, 3, 4\})$ , and in the case of serial (dashed line), there is one hidden vector $(\mathbf{h}_n^1, n \in \{1\})$ .
+
+mance even on clean images is not good, it does not show good performance in terms of generalization. Therefore, only PAC-FNO, which uses both low and high-frequency components, shows good performance in terms of accuracy/generalization.
+
+# F.8 EFFECTIVENESS OF PARALLEL ARCHITECTURE
+
+In this section, we show the efficacy of the parallel configuration of the AC-FNO block by visualizing which frequencies are captured. For fair comparison, we visualize the first layer output, which contains the most information of an original input sample, for the following two settings: AC-FNO in our proposed parallel configuration and AC-FNO in a serial configuration. Figure 7 shows spectral responses according to the configuration of the AC-FNO block. The farther it is from the center, the higher its frequency is.
+
+In Figure 7, We show that in the parallel configuration, each hidden vector not only captures the low-frequency components but also captures the high-frequency components. Moreover, their frequencies are sometimes complementary to each other. In particular, $\mathbf{h}_4^1$ has large normalized magnitudes at high frequency ranges, which means that $\mathbf{h}_3^1$ captures high-frequency components well. On the other hand, the hidden vector of the serial configuration (dashed line) is concentrated at low-frequency (center).
+
+Additionally, since the parallel configuration of the AC-FNO block captures both high and low-frequency components, it also shows good performance for image degradations as shown in Figure 8. Figures 8d and 8e are visualizations in the frequency domain. In other words, PAC-FNO consider high-frequency information well in those cases.
+
+
+
+
+(b) Original with Fog
+
+
+
+
+(a) Original
+(d) Frequency domain of fog
+Figure 8: Visualization of image degradation. (d) and (e) are visualizations of degradation without clean images e.g., (b)-(a) and (c)-(a) in the frequency domain.
+
+
+(c) Original with Gaussian Blur
+(e) Frequency domain of Gaussian blur
+
+# F.9 FLOPS AND RUNTIME
+
+We report the FLOPs and runtime on data at different resolutions
+
+Table 22: Results of FLOPs and runtime on ImageNet-1k in ConvNeXt-Tine.
+
+
ImageNet-1k
Method
Metrics
Resolution
28
56
112
224
ConvNeXt-Tiny
Resize
GFLOPs
8.96
8.96
8.96
8.96
Runtimes (s)
0.006
0.006
0.006
0.006
Fine-tune
GFLOPs
8.96
8.96
8.96
8.96
Runtimes (s)
0.006
0.006
0.006
0.006
DRLN
GFLOPs
180.66
412.05
1200.50
8.96
Runtimes (s)
0.378
0.498
0.913
0.007
DRPN
GFLOPs
1220.42
576.94
387.88
8.96
Runtimes (s)
0.1532
0.164
0.171
0.007
FNO
GFLOPs
9.78
9.78
9.78
9.78
Runtimes (s)
0.016
0.016
0.016
0.016
UNO
GFLOPs
9.10
9.10
9.10
9.10
Runtimes (s)
0.018
0.018
0.018
0.018
AFNO
GFLOPs
8.96
8.96
8.96
8.96
Runtimes (s)
0.010
0.010
0.010
0.010
PAC-FNO
GFLOPs
8.98
8.98
8.98
8.98
Runtimes (s)
0.013
0.013
0.013
0.013
\ No newline at end of file
diff --git a/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/images.zip b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..529fd5a0aa9c63f580ee46ef92636f545183fc15
--- /dev/null
+++ b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37d09641d2565a9632efee3290bc9fb0ea559a69f72a433cd7980f56c9c41a5c
+size 1507436
diff --git a/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/layout.json b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b8c3eb4044f76485142f4f4455b632cde5961e11
--- /dev/null
+++ b/pacfnoparallelstructuredallcomponentfourierneuraloperatorsforrecognizinglowqualityimages/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e6ced7ed6432434f06b1fedc4e604532d9fc773c28b69252bc2f6ef9d037e7e6
+size 625089
diff --git a/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_content_list.json b/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..069e1e76278804c43ad62243a187ddde048d6f45
--- /dev/null
+++ b/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91166a9978650245b147ba797cf34a7fb2fdba33327e237e08d4a23d4d408031
+size 141202
diff --git a/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_model.json b/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8b9b97a9e3ce04a269b1ead59e2dc5204e4867b2
--- /dev/null
+++ b/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1a01ef317d6ea245157e45c3ad04232b3b93ad33b595ae89b4832bed75eac728
+size 169211
diff --git a/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_origin.pdf b/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..175996dc3472ec5bfd6f03b370872021dfdad7e4
--- /dev/null
+++ b/pacpredictionsetsunderlabelshift/80aefd3c-e03b-40b1-a6e1-2b267f349698_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e493dcd83c4f7c1c216a0df33aba4e5d4c8f4db1cce7bbd503e4f85bd9f4d881
+size 1592252
diff --git a/pacpredictionsetsunderlabelshift/full.md b/pacpredictionsetsunderlabelshift/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8a6b46ac26194e54e4a09cb2665cda2aed99fae3
--- /dev/null
+++ b/pacpredictionsetsunderlabelshift/full.md
@@ -0,0 +1,694 @@
+# PAC PREDICTION SETS UNDER LABEL SHIFT
+
+Wenwen Si $^{1}$ , Sangdon Park $^{2}$ , Insup Lee $^{1}$ , Edgar Dobriban $^{3}$ , Osbert Bastani $^{1}$
+
+$^{1}$ Department of Computer & Information Science, University of Pennsylvania
+2Graduate School of AI and Computer Science & Engineering, POSTECH
+$^{3}$ Department of Statistics and Data Science, University of Pennsylvania
+
+{wenwens,lee,obastani}@seas.upenn.edu,sangdon@postech.ac.kr
+
+dobriban@wharton.upenn.edu
+
+# ABSTRACT
+
+Prediction sets capture uncertainty by predicting sets of labels rather than individual labels, enabling downstream decisions to conservatively account for all plausible outcomes. Conformal inference algorithms construct prediction sets guaranteed to contain the true label with high probability. These guarantees fail to hold in the face of distribution shift, which is precisely when reliable uncertainty quantification can be most useful. We propose a novel algorithm for constructing prediction sets with PAC guarantees in the label shift setting, where the probabilities of labels can differ between the source and target distributions. Our algorithm relies on constructing confidence intervals for importance weights by propagating uncertainty through a Gaussian elimination algorithm. We evaluate our approach on four datasets: the CIFAR-10 and ChestX-Ray image datasets, the tabular CDC Heart Dataset, and the AGNews text dataset. Our algorithm satisfies the PAC guarantee while producing smaller prediction set sizes compared to several baselines.
+
+# 1 INTRODUCTION
+
+Uncertainty quantification can be a critical tool for building reliable systems from machine learning components. For example, a medical decision support system can convey uncertainty to a doctor, or a robot can act conservatively with respect to uncertainty. These approaches are particularly important when the data distribution shifts as the predictive system is deployed, since they enable the decision-maker to react to degraded performance.
+
+Conformal prediction (Vovk et al., 2005; Angelopoulos & Bates, 2021) is a promising approach to uncertainty quantification, aiming to outputs sets of labels instead of a single label. Under standard assumptions (i.i.d. or exchangeable data), it guarantees that the prediction set contains the true label with high probability. We consider probably approximately correct (PAC) (or calibration-set-conditional) guarantees (Vovk, 2012; Park et al., 2019), which ensure high probability coverage over calibration datasets used to construct the prediction sets.
+
+In this paper, we propose a novel prediction set algorithm that provides PAC guarantees under the label shift setting, where the distribution of the labels may shift, but the distribution of covariates conditioned on the labels remains fixed. For instance, during a pandemic, a disease may spread to a much larger fraction of the population, but the manifestations of the disease may remain the same. As another example, real-world data may have imbalanced classes, unlike the balanced classes typical of curated training datasets. We consider the unsupervised domain adaptation setting (Ben-David et al., 2006), where we are given labeled examples from a source domain, but only unlabeled examples from the target domain, and care about performance in the target domain.
+
+A standard way to adapt conformal inference to handle distribution shift is by using importance weighting to "convert" data from the source distribution into data from the target distribution (Tibshirani et al., 2019). In the label shift setting, one possible way to express the importance weights is $w^{*} = \mathbf{C}_{P}^{-1}q^{*}$ , where $\mathbf{C}_P$ is the confusion matrix and $q^{*}$ is the distribution of predicted labels (Lipton et al., 2018); see details below. However, the estimation error for the unknown $\mathbf{C}_P$ and $q^{*}$ breaks the PAC guarantee.
+
+
+Figure 1: An example of our approach on the ChestX-ray dataset. In the unshifted setting, standard PAC prediction sets guarantee high-probability coverage, but this guarantee fails under label shift. Our approach addresses this challenge and continues to work in the shifted environment.
+
+Instead, we construct confidence intervals around $\mathbf{C}_P$ and $q^*$ , and then devise a novel algorithm to propagate these intervals through the Gaussian elimination algorithm used to compute $w^*$ . Finally, we leverage an existing strategy for constructing PAC prediction sets when given confidence intervals for the importance weights (Park et al., 2021).
+
+We empirically evaluate our approach on four datasets across three application domains: CIFAR-10 (Krizhevsky et al., 2009) in the computer vision domain, the CDC Heart Dataset (Centers for Disease Control and Prevention (CDC), 1984) and ChestX-ray (National Institutes of Health and others, 2022) in the medical domain, and AGNews (Zhang et al., 2015) in the language domain.
+
+Contributions. We propose a novel algorithm for constructing PAC prediction sets in the presence of label shift, which computes provably valid intervals around the true importance weights. Our algorithm is based on a technique for propagating confidence intervals through the updates of Gaussian elimination, which to our knowledge is a novel approach to uncertainty propagation in a prediction set construction setting. Finally, we empirically demonstrate that our approach satisfies the PAC guarantee while constructing smaller prediction sets than several baselines.
+
+Example. Figure 1 illustrates a use case of our technique on the ChestX-ray dataset. In medical settings, prediction sets (denoted PS) provide a rigorous way to quantify uncertainty for making downstream decisions. In particular, they can guarantee that the prediction set contains the true label (in this case, a diagnosis) with high probability. However, label shift happens commonly in medical settings, for instance, many illnesses have varying rates of incidence over time even when the patient population remains the same. Unfortunately, label shift breaks the PAC coverage guarantee. Our approach (denoted PSW) corrects for the label shift via importance weighting; it does so in a provably correct way. The resulting prediction sets satisfy the PAC guarantee.
+
+Related work. There has been recent interest in conformal inference under distribution shift, much of it focusing on covariate shift (Tibshirani et al., 2019; Lei & Candès, 2021; Qiu et al., 2022). (Podkopaev & Ramdas, 2021) develop methods for marginal coverage under label shift, whereas we are interested in training-set conditional—or PAC—guarantees. Furthermore, they formally assume that the true importance weights are known exactly, which is rarely the case. In the label shift setting, the importance weights can be estimated (Lipton et al., 2018), but as we show in our experiments, uncertainty in these estimates must be handled for the PAC guarantee to hold.
+
+We leverage the method of (Park et al., 2021) to handle estimation error in the importance weights. That work studies covariate shift, and uses a heuristic to obtain intervals around the importance weights. For the label shift setting, we can in fact obtain stronger guarantees: we modify Gaussian
+
+elimination to propagate uncertainty through the computation of the weights $w^{*} = \mathbf{C}_{P}^{-1}q^{*}$ . We give a more comprehensive discussion of related work in Appendix A.
+
+# 2 PROBLEM FORMULATION
+
+# 2.1 BACKGROUND ON LABEL SHIFT
+
+Consider the goal of training a classifier $g: \mathcal{X} \to \mathcal{Y}$ , where $\mathcal{X} \subseteq \mathbb{R}^d$ is the covariate space, and $\mathcal{Y} = [K] = \{1, \dots, K\}$ is the set of labels. We consider the setting where we train on one distribution $P$ over $\mathcal{X} \times \mathcal{Y}$ —called the source—with a probability density function (PDF) $p: (x, y) \mapsto p(x, y)$ and evaluate on a potentially different test distribution $Q$ —called the target—with PDF $q: (x, y) \mapsto q(x, y)$ . We focus on the unsupervised domain adaptation setting (Ben-David et al., 2007), where we are given an i.i.d. sample $S_m \sim P^m$ of $m$ labeled datapoints, and an i.i.d. sample of $n$ unlabeled datapoints $T_X^n \sim Q_X^n$ . The label shift setting (Lipton et al., 2018) assumes that only the label distribution $Q_Y$ may be change from $P_Y$ , and the conditional covariate distributions remain the same:
+
+Assumption 2.1. (Label shift) We have $p(x \mid y) = q(x \mid y)$ for all $x \in \mathcal{X}, y \in \mathcal{Y}$ .
+
+We denote $p(y) = P_{Y}(Y = y)$ for all $y \in \mathcal{V}$ and analogously for $Q$ . (Lipton et al., 2018) consider two additional mild assumptions:
+
+Assumption 2.2. For all $y \in \mathcal{V}$ such that $q(y) > 0$ , we have $p(y) > 0$ .
+
+Next, given the trained classifier $g: \mathcal{X} \to \mathcal{Y}$ let $\mathbf{C}_P \in \mathbb{R}^{K \times K}$ denote its expected confusion matrix—i.e., $c_{ij} := (\mathbf{C}_P)_{ij} = \mathbb{P}_{(X,Y) \sim P}(g(X) = i, Y = j)$ .
+
+Assumption 2.3. The confusion matrix $\mathbf{C}_P$ is invertible.
+
+This last assumption requires that the per-class expected predictor outputs be linearly independent; for instance, it is satisfied when $g$ is reasonably accurate across all labels. In addition, one may test whether this assumption holds (Lipton et al., 2018).
+
+Denoting the importance weights $w^{*} \coloneqq (q(y) / p(y))_{y \in \mathcal{Y}} \in \mathbb{R}^{K}$ , and $\hat{y} \coloneqq g(x)$ , we will write $p(\hat{y} | y) = \mathbb{P}_{(X,Y) \sim P}[g(X) = \hat{y} | Y = y]$ , and define $p(\hat{y}, y)$ , $p_{\hat{y}}$ as well as the corresponding expressions for $q$ analogously. Since $\hat{y}$ depends only on $x$ , we have $q(\hat{y} | y) = p(\hat{y} | y)$ . Thus, see e.g., Lipton et al. (2018),
+
+$$
+q _ {\hat {y}} = \sum_ {y \in \mathcal {Y}} q (\hat {y} \mid y) q (y) = \sum_ {y \in \mathcal {Y}} p (\hat {y} \mid y) q (y) = \sum_ {y \in \mathcal {Y}} p (\hat {y}, y) \frac {q (y)}{p (y)},
+$$
+
+or in a matrix form, $q^{*} = \mathbf{C}_{P}w^{*}$ , where $q^{*} \coloneqq (q_{\hat{y}})_{\hat{y} \in \mathcal{Y}} \in \mathbb{R}^{K}$ . As we assume $\mathbf{C}_P$ is invertible,
+
+$$
+w ^ {*} = \mathbf {C} _ {P} ^ {- 1} q ^ {*}. \tag {1}
+$$
+
+Our algorithm uses this equation to approximate $w^{*}$ , and then use its approximation to construct PAC prediction sets that remain valid under label shift.
+
+# 2.2 PAC PREDICTION SETS UNDER LABEL SHIFT
+
+We are interested in constructing a prediction set $C: \mathcal{X} \to 2^{\mathcal{V}}$ , which outputs a set of labels $C(x) \subseteq \mathcal{V}$ for each given input $x \in \mathcal{X}$ rather than a single label. The benefit of outputting a set of labels is that we can obtain correctness guarantees such as:
+
+$$
+\mathbb {P} _ {(X, Y) \sim P} [ Y \in C (X) ] \geq 1 - \varepsilon , \tag {2}
+$$
+
+where $\varepsilon \in (0,1)$ is a user-provided confidence level. Then, downstream decisions can be made in a way that accounts for all labels $y \in C(x)$ rather than for a single label. Thus, prediction sets quantify uncertainty. Intuitively, equation 2 can be achieved if we output $C(x) = \mathcal{Y}$ for all $x \in \mathcal{X}$ , but this is not informative. Instead, the typical goal is to output prediction sets that are as small as possible.
+
+The typical strategy for constructing prediction sets is to leverage an fixed existing model. In particular, we assume given a scoring function $f: \mathcal{X} \times \mathcal{Y} \to \mathbb{R}$ ; most deep learning algorithms provide such scores in the form of predicted probabilities, with the corresponding classifier being $g(x) =$
+
+arg $\max_{y\in \mathcal{Y}}f(x,y)$ . The scores do not need to be reliable in any way; if they are unreliable, the PAC prediction set algorithm will output larger sets. Then, we consider prediction sets parameterized by a real-valued threshold $\tau \in \mathbb{R}$ :
+
+$$
+C _ {\tau} (x) = \{y \in \mathcal {Y} \mid f (x, y) \geq \tau \}.
+$$
+
+In other words, we include all labels with score at least $\tau$ . First, we focus on correctness for $P$ , in which case we only need $S_{m}$ , usually referred to as the calibration set. Then, a prediction set algorithm constructs a threshold $\hat{\tau}(S_m) \in \mathbb{R}$ and returns $C_{\hat{\tau}(S_m)}$ .
+
+Finally, we want $\hat{\tau}$ to satisfy (2); one caveat is that it may fail to do so due to randomness in $S_{m}$ . Thus, we allow an additional probability $\delta \in \mathbb{R}$ of failure, resulting in the following desired guarantee:
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}} \left[ \mathbb {P} _ {(X, Y) \sim P} [ Y \in C _ {\hat {\tau} (S _ {m})} (X) ] \geq 1 - \varepsilon \right] \geq 1 - \delta . \tag {3}
+$$
+
+Vovk (2012); Park et al. (2019) propose an algorithm $\hat{\tau}$ that satisfies (3), see Appendix B.
+
+Finally, we are interested in constructing PAC prediction sets in the label shift setting, using both the labeled calibration dataset $S_{m} \sim P^{m}$ from the source domain, and the unlabeled calibration dataset $T_{n}^{X} \sim Q^{n}$ from the target distribution. Our goal is to construct $\hat{\tau}(S_{m}, T_{n}^{X})$ based on both $S_{m}$ and $T_{n}^{X}$ , which satisfies the coverage guarantee over $Q$ instead of $P$ :
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}, T _ {n} ^ {X} \sim Q _ {X} ^ {n}} \left[ \mathbb {P} _ {(X, Y) \sim Q} [ Y \in C _ {\hat {\tau} (S _ {m}, T _ {n} ^ {X})} (X) ] \geq 1 - \varepsilon \right] \geq 1 - \delta . \tag {4}
+$$
+
+Importantly, the inner probability is over the shifted distribution $Q$ instead of $P$ .
+
+# 3 ALGORITHM
+
+To construct prediction sets valid under label shift, we first notice that it is enough to find elementwise confidence intervals for the importance weights $w^{*}$ . Suppose that we can construct $W = \prod_{k\in \mathcal{Y}}[\underline{w}_k,\overline{w}_k]\subseteq \mathbb{R}^K$ such that $w^{*}\in W$ . Then, when adapted to our setting, the results of Park et al. (2021)—originally for the covariate shift problem—provide an algorithm that returns a threshold $\hat{\tau} (S_m,V,W,b)$ , where $V\sim \mathrm{Uniform}([0,1])^{K}$ is a vector of random variables, such that
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}, V \sim U ^ {K}} \left[ \mathbb {P} _ {(X, Y) \sim Q} [ Y \in C _ {\hat {\tau} (S _ {m}, V, W, b)} ] \geq 1 - \varepsilon \right] \geq 1 - \delta . \tag {5}
+$$
+
+This is similar to equation 4 but it accounts for the randomness used by our algorithm—via $V$ —in the outer probability. We give the details in Appendix C.
+
+The key challenge is to construct $W = \prod_{k\in \mathcal{Y}}[\underline{w}_k,\overline{w}_k]$ such that $w^{*}\in W$ with high probability. The approach from Park et al. (2021) for the covariate shift problem relies on training a source-target discriminator, which is not possible in our case since we do not have class labels from the target domain. Furthermore, Park et al. (2021)'s approach is does not provide conditions under which one can provide a valid confidence interval for the importance weights in their setting.
+
+Our algorithm uses a novel approach, where we propagate intervals through the computation of importance weights. The weights $w^{*}$ are determined by the system of linear equations $\mathbf{C}_P w^{*} = q^{*}$ . Since $\mathbf{C}_P$ and $q^{*}$ are unknown, we start by constructing element-wise confidence intervals
+
+$$
+\underline {{\mathbf {C}}} _ {P} \leq \mathbf {C} _ {P} \leq \overline {{\mathbf {C}}} _ {P} \quad \text {a n d} \quad \underline {{q}} ^ {*} \leq q ^ {*} \leq \bar {q} ^ {*}, \tag {6}
+$$
+
+with probability at least $1 - \delta$ over our calibration datasets $S_{m}$ and $T_{n}^{X}$ . We then propagate these confidence intervals through each step of Gaussian elimination, such that at the end of the algorithm, we obtain confidence intervals for its output—i.e.,
+
+$$
+\underline {{w}} ^ {*} \leq w ^ {*} \leq \overline {{w}} ^ {*} \quad \text {w i t h p r o b a b i l i t y a t l e a s t} 1 - \delta . \tag {7}
+$$
+
+Finally, we can use (7) with the algorithm from (Park et al., 2021) to construct PAC prediction sets under label shift. We describe our approach below.
+
+# 3.1 ELEMENTWISE CONFIDENCE INTERVALS FOR $\mathbf{C}_P$ AND $q^{*}$
+
+Recall that $\mathbf{C}_P = (c_{ij})_{ij\in \mathcal{Y}}$ and $q^{*} = (q_{k})_{k\in \mathcal{Y}}$ . Note that $c_{ij} = \mathbb{P}[g(X) = i,Y = j]$ is the mean of the Bernoulli random variable $\mathbb{1}(g(X) = i,Y = j)$ over the randomness in $(X,Y)\sim P$ .
+
+Similarly, $q_{k}$ is the mean of $\mathbb{1}(g(X) = k)$ over the randomness in $X \sim Q_{X}$ . Thus, we can use the Clopper-Pearson (CP) intervals (Clopper & Pearson, 1934) for a Binomial success parameter to construct intervals around $c_{ij}$ and $q_{k}$ . Given a confidence level $\delta \in (0,1)$ and the sample mean $\hat{c}_{ij} = \frac{1}{m}\sum_{(x,y)\in S_m}\mathbb{1}(g(x) = i,y = j)$ distributed as a scaled Binomial random variable—this is an interval $\mathrm{CP}(\hat{c}_{ij},m,\delta) = [\underline{c}_{ij},\overline{c}_{ij}]$ such that
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}} [ c _ {i j} \in \mathrm {C P} (\hat {c} _ {i j}, m, \delta) ] \geq 1 - \delta .
+$$
+
+Similarly, for $q_{k}$ , we can construct CP intervals based on $\hat{q}_{k} = \frac{1}{n}\sum_{x\in T_{n}^{X}}\mathbb{1}(g(x) = k)$ . Together, for confidence levels $\delta_{ij}$ and $\delta_{k}$ chosen later, we obtain for all $i,j,k\in [K]$
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}} \left[ \underline {{c}} _ {i j} \leq c _ {i j} \leq \bar {c} _ {i j} \right] \geq 1 - \delta_ {i j}, \quad \mathbb {P} _ {T _ {n} ^ {X} \sim Q _ {X} ^ {n}} \left[ \underline {{q}} _ {k} \leq q _ {k} \leq \bar {q} _ {k} \right] \geq 1 - \delta_ {k}. \tag {8}
+$$
+
+Then, the following result holds by a union bound: Given any $\delta_{ij},\delta_k\in (0,\infty)$ , for all $i,j,k\in [K]$ letting $[\underline{c}_{ij},\overline{c}_{ij}] = \mathrm{CP}(\hat{c}_{ij},m,\delta_{ij})$ and $[\underline{q}_k,\overline{q}_k] = \mathrm{CP}(\hat{q}_k,n,\delta_k)$ , and letting $\delta = \sum_{i,j\in [K]}\delta_{ij} + \sum_{k\in [K]}\delta_k$ , we have
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}, T _ {n} ^ {X} \sim Q _ {X} ^ {n}} \left[ \bigwedge_ {i, j \in [ K ]} \underline {{c}} _ {i j} \leq c _ {i j} \leq \bar {c} _ {i j}, \bigwedge_ {k \in [ K ]} \underline {{q}} _ {k} \leq q _ {k} \leq \bar {q} _ {k} \right] \geq 1 - \delta . \tag {9}
+$$
+
+# 3.2 GAUSSIAN ELIMINATION WITH INTERVALS
+
+We also need to set up notation for Gaussian elimination, which requires us to briefly recall the algorithm. To solve $\mathbf{C}_P w^* = q^*$ , Gaussian elimination (see e.g., Golub & Van Loan, 2013) proceeds in two phases. Starting with $c^0 = \mathbf{C}_P$ and $q^0 = q^*$ , on iteration $t \geq 1$ , Gaussian elimination uses row $k = t$ to eliminate the $k$ th column of rows $i \in \{k + 1, \dots, K\}$ (we introduce a separate variable $k$ for clarity). In particular, if $c_{kk}^t \neq 0$ , we denote
+
+$$
+c _ {i j} ^ {t + 1} = \left\{ \begin{array}{l l} c _ {i j} ^ {t} - \frac {c _ {i k} ^ {t} c _ {k j} ^ {t}}{c _ {k k} ^ {t}} & \text {i f} i > k, \\ c _ {i j} ^ {t} & \text {o t h e r w i s e}; \end{array} \right. \qquad q _ {i} ^ {t + 1} = \left\{ \begin{array}{l l} q _ {i} ^ {t} - \frac {c _ {i k} ^ {t} q _ {k} ^ {t}}{c _ {k k} ^ {t}} & \text {i f} i > k \\ q _ {i} ^ {t} & \text {o t h e r w i s e}, \end{array} \right. \qquad \forall i, j \in [ K ].
+$$
+
+If $c_{kk}^t = 0$ , but there is an element $j > k$ in the $k$ th column such that $c_{jk}^t \neq 0$ , the $k$ th and the $j$ th rows are swapped and the above steps are executed. If no such element exists, the algorithm proceeds to the next step. At the end of the first phase, the matrix $c^{K-1}$ has all elements below the diagonal equal to zero—i.e., $c_{ij}^{K-1} = 0$ if $j < i$ . In the second phase, the Gaussian elimination algorithm solves for $w_i^*$ backwards from $i = K$ to $i = 1$ , introducing the following notation. For each $i$ , if $c_{ii}^{K-1} \neq 0$ , we denote $w_i^* = (q_i - s_i) / c_{ii}^{K-1}$ , where $s_i = \sum_{j=i+1}^{K} c_{ij}^{K-1} w_j^*$ .
+
+In our setting, we do not know $c^0$ and $q^0$ ; instead, we assume given entrywise confidence intervals as in equation 6, which amount to $\underline{c}^0 \leq c^0 \leq \overline{c}^0$ and $\underline{q}^0 \leq q^0 \leq \overline{q}^0$ . We now work on the event $\Omega$ that these bounds hold, and prove that our algorithm works on this event; later, we combine this result with Equation 9 to obtain a high-probability guarantee. Then, our goal is to compute $\underline{c}^t, \overline{c}^t, \underline{q}^t, \overline{q}^t$ such that for all iterations $t \in \{0,1,\dots,K-1\}$ , we have elementwise confidence intervals specified by $\underline{c}^t, \overline{c}^t, \underline{q}^t$ and $\overline{c}^t$ for the outputs $c^t, q^t$ of the Gaussian elimination algorithm:
+
+$$
+\underline {{c}} ^ {t} \leq c ^ {t} \leq \bar {c} ^ {t} \quad \text {a n d} \quad \underline {{q}} ^ {t} \leq q ^ {t} \leq \bar {q} ^ {t}. \tag {10}
+$$
+
+The base case $t = 0$ holds by the assumption. Next, to propagate the uncertainty through the Gaussian elimination updates for each iteration $t \in [K - 1]$ , our algorithm sets
+
+$$
+\underline {{c}} _ {i j} ^ {t + 1} = \left\{ \begin{array}{l l} 0 & \text {i f} i > k, j \leq k, \\ \underline {{c}} _ {i j} ^ {t} - \frac {\bar {c} _ {i k} ^ {t} \bar {c} _ {k j} ^ {t}}{\underline {{c}} _ {k k} ^ {t}} & \text {i f} i, j > k, \quad \forall i, j \in [ K ] \\ \underline {{c}} _ {i j} ^ {t} & \text {o t h e r w i s e} \end{array} \right. \tag {11}
+$$
+
+for the lower bound, and computes
+
+$$
+\bar {c} _ {i j} ^ {t + 1} = \left\{ \begin{array}{l l} 0 & \text {i f} i > k, j \leq k, \\ \bar {c} _ {i j} ^ {t} - \frac {\underline {{c}} _ {i k} ^ {t} \underline {{c}} _ {k j} ^ {t}}{\bar {c} _ {k k} ^ {t}} & \text {i f} i, j > k, \quad \forall i, j \in [ K ] \\ \bar {c} _ {i j} ^ {t} & \text {o t h e r w i s e} \end{array} \right. \tag {12}
+$$
+
+for the upper bound. The first case handles the fact that Gaussian elimination is guaranteed to zero out entries below the diagonal, and thus these entries have no uncertainty remaining. The second rule constructs confidence intervals based on the previous intervals and the algebraic update formulas used in Gaussian elimination for the entries for which $i,j > k$ . For instance, the above confidence intervals use that on the event $\Omega$ , and by induction on $t$ , if $c_{ij}^{t}\geq 0$ and $c_{ii}^{t} > 0$ for all $i,j\in [K]$ and for all $t$ , the Gaussian elimination update $c_{ij}^{t + 1} = c_{ij}^{t} - c_{it}^{t}c_{tj}^{t} / c_{tt}^{t}$ can be upper bounded as
+
+$$
+c _ {i j} ^ {t + 1} = c _ {i j} ^ {t} - \frac {c _ {i t} ^ {t} c _ {t j} ^ {t}}{c _ {t t} ^ {t}} \leq \bar {c} _ {i j} ^ {t} - \frac {\underline {{c}} _ {i t} ^ {t} \underline {{c}} _ {t j} ^ {t}}{\bar {c} _ {t t} ^ {t}} = \bar {c} _ {i j} ^ {t + 1}, \tag {13}
+$$
+
+The assumptions that $\underline{c}_{ij}^t \geq 0$ and $\underline{c}_{ii}^t > 0$ for all $i, j \in [K]$ and for all $t$ may appear a little stringent, but the former can be removed at the cost of slightly larger intervals propagated to the next step, see Section D. The latter condition is satisfied by any classifier that obtains sufficient accuracy on all labels. We further discuss these conditions in Section D. The third rule in equation 11 and equation 12 handles the remaining entries, which do not change; and thus the confidence intervals from the previous step can be used. The rules for $q$ are similar, and have a similar justification:
+
+$$
+\underline {{q}} _ {i} ^ {t + 1} = \left\{ \begin{array}{l l} \underline {{q}} _ {i} ^ {t} - \frac {\overline {{c}} _ {i k} ^ {t} \overline {{q}} _ {i} ^ {t}}{\underline {{c}} _ {k k} ^ {t}} & \text {i f} i > k, \\ \underline {{q}} _ {i} ^ {t} & \text {o t h e r w i s e}; \end{array} \right. \quad \overline {{q}} _ {i} ^ {t + 1} = \left\{ \begin{array}{l l} \overline {{q}} _ {i} ^ {t} - \frac {\underline {{c}} _ {i k} ^ {t} \underline {{q}} _ {i} ^ {t}}{\overline {{c}} _ {k k} ^ {t}} & \text {i f} i > k, \\ \overline {{q}} _ {i} ^ {t} & \text {o t h e r w i s e}. \end{array} \right. \quad \forall i \in [ K ]. \tag {14}
+$$
+
+For these rules, our algorithm assumes $\underline{q}_i^t \geq 0$ for all $i \in [K]$ and all $t$ , and raises an error if this fails. As with the first condition above, this one can be straightforwardly relaxed; see Appendix D.
+
+In the second phase, we compute $w_{i}^{*}$ starting from $i = K$ and iterating to $i = 1$ . On iteration $i$ , we assume we have the confidence intervals $\underline{w}_{j}^{*} \leq w_{j}^{*} \leq \overline{w}_{j}^{*}$ for $j > i$ . Then, we compute confidence intervals for the sum $s_{i}$ , with a similar justification based on the Gaussian elimination updates:
+
+$$
+\underline {{s}} _ {i} = \sum_ {j = i + 1} ^ {n} \underline {{c}} _ {i j} ^ {K - 1} \underline {{w}} _ {j} ^ {*} \quad \text {a n d} \quad \overline {{s}} _ {i} = \sum_ {j = i + 1} ^ {n} \bar {c} _ {i j} ^ {K - 1} \bar {w} _ {j} ^ {*}, \tag {15}
+$$
+
+and show that they satisfy $\underline{s}_i\leq s_i\leq \overline{s}_i$ on the event $\Omega$ . Finally, we compute confidence intervals for $w_{i}^{*}$ , assuming $\underline{c}_{ii}^{K - 1} > 0$ :
+
+$$
+\underline {{w}} _ {i} ^ {*} = \frac {\underline {{q}} _ {i} - \bar {s} _ {i}}{\bar {c} _ {i i} ^ {K - 1}} \quad \text {a n d} \quad \overline {{w}} _ {i} ^ {*} = \frac {\bar {q} _ {i} - \underline {{s}} _ {i}}{\underline {{c}} _ {i i} ^ {K - 1}}, \tag {16}
+$$
+
+for which we can show that they satisfy $\underline{w}_i^* \leq w_i^* \leq \overline{w}_i^*$ based on the Gaussian elimination updates. Letting $W = \{w \mid \underline{w}^* \leq w \leq \overline{w}^*\}$ , we have the following (see Appendix E for a proof).
+
+Lemma 3.1 (Elementwise Confidence Interval for Importance Weights). If (6) holds, and for all $i,j,t\in [K]$ , $\underline{c}_{ij}^{t}\geq 0$ , $\underline{c}_{ii}^{t} > 0$ , and $\underline{q}_i^t\geq 0$ , then $w^{*} = \mathbf{C}_{P}^{-1}q^{*}\in W$
+
+We mention here that the idea of algorithmic uncertainty propagation may be of independent interest. In future work, it may further be developed to other methods for solving linear systems (e.g., the LU decomposition, Golub & Van Loan (2013)), and other linear algebraic and numerical computations.
+
+# 3.3 OVERALL ALGORITHM
+
+Algorithm 1 summarizes our approach. As can be seen, the coverage levels for the individual Clopper-Pearson intervals are chosen to satisfy the overall $1 - \delta$ coverage guarantee. In particular, the PAC guarantee equation 4 follows from equation 5, equation 9, Lemma 3.1, and a union bound; we provide a more detailed explanation in Appendix F.
+
+Theorem 3.2 (PAC Prediction Sets under Label Shift). For any given $\varepsilon, \delta \in (0,1)$ , under Assumptions 2.1, 2.2 and 2.3, if $\forall i, j, t \in [K]$ , we have $\underline{c}_{ij}^t \geq 0$ , $\underline{c}_{ii}^t > 0$ , and $\underline{q}_i^t \geq 0$ , then Algorithm 1 satisfies
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}, T _ {n} ^ {X} \sim Q ^ {n}, V \sim U ^ {m}} \left[ \mathbb {P} _ {(X, Y) \sim Q} \left[ Y \in C _ {\hat {\tau} (S _ {m}, V, W, b)} (X) \right] \geq 1 - \varepsilon \right] \geq 1 - \delta .
+$$
+
+As discussed in Appendix D, we can remove the requirement that $\underline{c}_{ij}^t\geq 0$ and $\underline{q}_i^t\geq 0$ for $i\neq j$
+
+Algorithm 1 PS-W: PAC prediction sets in the label shift setting.
+1: procedure LABELSHIFTPREDICTIONSET(Sm,Tx,f,ε,δ)
+2: c, $\overline{c},\underline{q},\overline{q}\gets$ CPINTERVAL(Sm,Tx,x→arg maxy∈yf(x,y),K(K+1)/(K(K+1)+1)δ)
+3: W←INTERVALGAUSSIANELIM(c, $\overline{c},\underline{q},\overline{q})$
+4: if W=0 then return 0
+5: return IWPREDICTIONSET(Sm,f,W,ε,δ/[K(K+1)+1])
+6: procedure CPINTERVAL(Sm,Tx,g,δ)
+7: for i,j∈[K] do
+8: Compute [cij, $\overline{c}_{ij}]$ =CP(m-1∑(x,y)∈Sm1(g(x)=i,y=j),m,δ/(K(K+1)))
+9: for k∈[K] do
+10: Compute [k, $\overline{q}_k$ ]=CP(n-1∑x∈TnX1(g(x)=k),n,δ/(K(K+1)))
+11: return c, $\overline{c},\underline{q},\overline{q}$
+12: procedure INTERVALGAUSSIANELIM(c0, $\overline{c}^0,\underline{q}^0,\overline{q}^0$ )
+13: for t∈[1,...,K-1] do
+14: for i,j∈[K] do
+15: Compute $\underline{c}_{ij}^{t},\overline{c}_{ij}^{t}$ using (11)&(12), and $\underline{q}_i^t,\overline{q}_i^t$ using (14)
+16: if $\underline{c}_{ij}^{t}< 0$ for some $i\neq j$ or $\underline{c}_{ii}^{t}\leq 0$ for some $i$ or $\underline{q}_i^t\leq 0$ for some $i$ , then return 0
+17: for i∈[K,...,1] do
+18: Compute $\underline{s}_i^t,\overline{s}_i^t$ using (15), and $\underline{w}_i,\overline{w}_i$ using (16)
+19: return W= $\prod_{i=1}^{k}[\underline{w}_i,\overline{w}_i]$
+20: procedure IWPREDICTIONSET(Sm,f,W= $\prod_{k=1}^{K}[\underline{w}_k,\overline{w}_k],\varepsilon,\delta$ )
+21: V~Uniform([0,1])m
+22: return $\hat{\tau}(S_m,V,W,\max_{k\in[K]}\overline{w}_k,\varepsilon,\delta)$ as in (18)
+
+# 4 EXPERIMENTS
+
+# 4.1 EXPERIMENTAL SETUP
+
+Predictive models. We analyze four datasets: the CDC Heart dataset, CIFAR-10, Chest X-ray, and the AG News dataset; details are provided in Section 4.2. We use a two-layer MLP for the CDC Heart data with an SGD optimizer having a learning rate of 0.03 and a momentum of 0.9, using a batch size of 64 for 30 epochs. For CIFAR-10, we finetune a pretrained ResNet50 He et al. (2016), with a learning rate of 0.01 for 56 epochs. For the ChestX-ray14 dataset, we use a pre-trained CheXNet (Rajpurkar et al., 2017) with a DenseNet121 (Huang et al., 2017) backbone with a learning rate of 0.0003 for two epochs. For AGNews, we fine-tune a pre-trained Electra sequence classifier for one epoch with an AdamW optimizer using a learning rate of 0.00001.
+
+Hyperparameter choices. There are two user-specified hyperparameters that control the guarantees, namely $\delta$ and $\varepsilon$ . In our experiments, we choose $\delta = 5 \times 10^{-4}$ to ensure that, over 100 independent datasets $S_{m}$ , there is a $95\%$ probability that the error rate is not exceeded. Specifically, this ensures that $\mathbb{P}_{(X,Y)\sim P}[Y \in C_{\hat{\tau}(S_m)}(X)] \geq 1 - \varepsilon$ holds for all 100 trials, with probability approximately $1 - 0.95^{1/100} \approx 5 \times 10^{-4}$ . We select $\varepsilon$ for each dataset in a way that the resulting average prediction set size is greater than one. This ensures that the coverage guarantee is non-trivial, as a single-valued classifier should not achieve the desired coverage rate (as $\delta$ is small).
+
+Dataset construction. We follow the label shift simulation strategies from previous work (Lipton et al., 2018). First, we split the full dataset into training data, and "base" source and target datasets. We use the training dataset to fit a score function. Given label distributions $P_{Y}$ and $Q_{Y}$ , we generate the source dataset $S_{m}$ , target dataset $T_{n}^{X}$ , and a labeled, size $o$ target test dataset (sampled from $Q$ ) by sampling with replacement from the corresponding base datasets. We consider two choices of $P_{Y}$ and $Q_{Y}$ : (i) a tweak-one shift, where change the probability of one label, and keep the relative proportions of the other labels equally likely, and (ii) a general shift, where we shift each probability as described later.
+
+Baselines. We compare our approach (PS-W) with several baselines (see Appendix G):
+
+- PS: PAC prediction sets that do not account for label shift (Vovk, 2012; Park et al., 2019). This does not come with PAC guarantees under label shift.
+- WCP: Weighted conformal prediction under label shift, which targets marginal coverage (Podkopaev & Ramdas, 2021). This does not come with PAC guarantees under label shift either.
+- PS-R: PAC prediction sets that account for label shift but ignore uncertainty in the importance weights; again without guarantees.
+- PS-C: This addresses label shift via a conservative upper bound on the empirical loss (see Appendix G for details). This is the only baseline with a PAC guarantee under label shift.
+
+We compare to other baselines in Appendix I.5, and to an oracle with the true weights in Appendix H. Results for other hyperparameters are in Appendix I.
+
+Metrics. We measure performance via the prediction set error, i.e., the fraction of $(x,y)\sim Q$ such that $y\notin C_{\tau}(x)$ ; and the average prediction set size, i.e., the mean of $|C_{\tau}(x)|$ , evaluated on the held-out test set. We report the results over 100 independent repetitions, randomizing both dataset generation and our algorithm.
+
+# 4.2 RESULTS & DISCUSSION
+
+CDC Heart. We use the CDC Heart dataset, a binary classification problem (Centers for Disease Control and Prevention (CDC), 1984). The goal is to predict the risk of heart attack given features such as level of exercise or weight. We use $\varepsilon = 0.1$ and $\delta = 5 \times 10^{-4}$ . We consider both large and small shifts. For the large shift, the label distributions—denoted $(\text{pos}\%, \text{neg})$ —are $(94\%, 6\%)$ for
+
+
+(a) Prediction set error and size under small shifts on the CDC Heart dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+
+
+Figure 2: Prediction set results on the CDC Heart dataset.
+
+
+(b) Prediction set error and size under large shifts on the CDC Heart dataset, Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+source, and (63.6%, 36.4%) for target; results are in Figure 2b. We also consider a small shift with label distributions (94%, 6%) for source, and (91.3%, 8.7%) for target; results are in Figure 2a. As can be seen, our PS-W algorithm satisfies the PAC guarantee while achieving smaller prediction set size than PS-C, the only baseline to satisfy the PAC guarantee. The PS and PS-R algorithms violate the PAC guarantee.
+
+CIFAR-10. Next, we consider CIFAR-10 (Krizhevsky et al., 2009), which has 10 labels. We use $\varepsilon = 0.1$ and $\delta = 5 \times 10^{-4}$ . We consider a large and a small tweak-one shift. For the large shift, the label probability is $10\%$ for all labels in the source, $40.0\%$ for the tweaked label, and $6.7\%$ for other labels in the target; results are in Figure 3a. For small shifts, we use $10\%$ for all labels for the source, $11.76\%$ for the tweaked label, and $9.8\%$ for other labels for the target; results are in Figure 3b. Under large shifts, our PS-W algorithm satisfies the PAC guarantee while outperforming PS-C by a large margin. When the shift is very small, PS-W still satisfies the PAC guarantee, but generates more conservative prediction sets similar in size to those of PS-C (e.g., Figure 3b) given the limited data. Results for a non-uniform source distribution and general shifts are shown in Appendix I.8.
+
+AGNews. AG News is a subset of AG's corpus of news articles (Zhang et al., 2015). It is a text classification dataset with four labels: World, Sports, Business, and Sci/Tech. It contains 31,900 unique examples for each class. We use $\varepsilon = 0.05$ and $\delta = 5 \times 10^{-4}$ . We use tweak-one label shifts. We consider a large shift and a medium-sized calibration dataset, with label distributions equalling $(30.8\%, 30.8\%, 7.7\%, 30.8\%)$ for the source, and $(12.5\%, 12.5\%, 62.5\%, 12.5\%)$ for the target; results are in Figure 4a. As before, our PS-W approach satisfies the PAC guarantee while achieving smaller set sizes than PS-C.
+
+ChestX-ray. ChestX-ray14 (Wang et al., 2017) is a medical imaging dataset containing about 112K frontal-view X-ray images of 30K unique patients with fourteen disease labels. This dataset contains
+
+Figure 3: Prediction set results on the CIFAR-10 dataset.
+
+(a) Prediction set error and size with larger shift on the CIFAR-10. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 27000$ , $n = 19997$ , and $t = 19997$ .
+
+
+
+
+(b) Prediction set error and size with small shift on the CIFAR-10. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 27000$ , $n = 16500$ , and $t = 16500$ .
+
+
+
+Figure 4: Prediction set results on the ChestX-ray dataset.
+
+(a) Prediction set error and size on the AGNews Dataset. Parameters are $\varepsilon = 0.05$ , $\delta = 5 \times 10^{-4}$ , $m = 26000$ , $n = 12800$ , and $t = 12800$ .
+
+
+(b) Prediction set error and size on the ChestX-ray dataset. Parameters are $\varepsilon = 0.3$ , $\delta = 5 \times 10^{-4}$ , $m = 67200$ , $n = 35200$ , and $o = 3520$ .
+
+
+
+
+
+instances with multiple labels, which we omit. We also omit classes with few positively labeled datapoints, leaving six classes: Atelectasis, Effusion, Infiltration, Mass, Nodule, Pneumothorax. We consider a general label shift. We consider a large tweak-one shift, with label distributions of $(19.1\%, \ldots, 19.1\%, 4.5\%, 19.1\%)$ for the source, and $(11.1\%, \ldots, 11.1\%, 44.5\%, 11.1\%)$ for the target. Results for $\varepsilon = 0.3$ are in Figure 4b. As before, our PS-W approach satisfies the PAC guarantee while outperforming PS-C. The PS-R and WCP methods violate the constraint.
+
+Discussion. In all our experiments, our approach satisfies the PAC guarantee; furthermore, it produces smaller prediction set sizes than PS-C—the only baseline to consistently satisfy the PAC guarantee—except when the label shift is small and the calibration dataset is limited. In contrast, the PS baseline does not account for label shift, and the PS-R baseline does not account for uncertainty in the importance weights, so they do not satisfy the PAC guarantee. The WCP baseline is designed to target a different guarantee, and it does not satisfy the PAC guarantee. Thus, these results demonstrate the efficacy of our approach.
+
+**Limitations.** Our approach is focused on problem settings where the label shift is not too small and sufficient calibration data is available; and may produce conservative prediction sets otherwise. This reflects the intrinsic difficulty of the problem in these settings. Importantly, our PAC coverage guarantees still hold.
+
+# 5 CONCLUSION
+
+We have proposed a PAC prediction set algorithm for the label shift setting, and illustrated its effectiveness in experiments. Directions for future work include improving performance when the calibration dataset or the label shift is small.
+
+Reproducibility statement. Our code is available at https://github.com/averysi224/pac-ps-label-shift for reproducing our experiments.
+
+# ACKNOWLEDGEMENT
+
+This work was supported in part by ARO W911NF-20-1-0080 ARO W911NF-23-1-0296, NSF 2031895, NSF 2046874, ONR N00014-21-1-2843, the Sloan Foundation, and Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019-0-01906, Artificial Intelligence Graduate School Program (POSTECH)). Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the Army Research Office (ARO), or the Department of Defense, or the United States Government.
+
+# REFERENCES
+
+Anastasios N Angelopoulos and Stephen Bates. A gentle introduction to conformal prediction and distribution-free uncertainty quantification. arXiv preprint arXiv:2107.07511, 2021.
+Kamyar Azizzadenesheli, Anqi Liu, Fanny Yang, and Animashree Anandkumar. Regularized learning for domain adaptation under label shifts. arXiv preprint arXiv:1903.09734, 2019.
+Vineeth Balasubramanian, Shen-Shyang Ho, and Vladimir Vovk. Conformal prediction for reliable machine learning: theory, adaptations and applications. Newnes, 2014.
+Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19, 2006.
+Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In Advances in neural information processing systems, pp. 137-144, 2007.
+Maxime Cauchois, Suyash Gupta, Alnur Ali, and John C Duchi. Robust validation: Confident predictions even when distributions shift. arXiv preprint arXiv:2008.04267, 2020.
+Centers for Disease Control and Prevention (CDC). Behavioral risk factor surveillance system, 1984. URL https://www.cdc.gov/brfss/annual_data/annual_data.htm.
+Yee Seng Chan and Hwee Tou Ng. Word sense disambiguation with distribution estimation. In *IJCAI*, volume 5, pp. 1010-5, 2005.
+Charles J Clopper and Egon S Pearson. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26(4):404-413, 1934.
+Edgar Dobriban and Mengxin Yu. Symmpi: Predictive inference for data with group symmetries. arXiv preprint arXiv:2312.16160, 2023.
+Robin Dunn, Larry Wasserman, and Aaditya Ramdas. Distribution-free prediction sets for two-layer hierarchical models. Journal of the American Statistical Association, 0(0):1-12, 2022.
+Donald Alexander Stuart Fraser. Nonparametric methods in statistics. John Wiley & Sons Inc, 1956.
+Saurabh Garg, Yifan Wu, Sivaraman Balakrishnan, and Zachary Lipton. A unified view of label shift estimation. Advances in Neural Information Processing Systems, 33:3290-3300, 2020.
+Saurabh Garg, Sivaraman Balakrishnan, and Zachary C Lipton. Domain adaptation under open set label shift. arXiv preprint arXiv:2207.13048, 2022.
+Gene H Golub and Charles F Van Loan. Matrix computations. JHU press, 2013.
+Arthur Gretton, Alex Smola, Jiayuan Huang, Marcel Schmittfull, Karsten Borgwardt, and Bernhard Schölkopf. Covariate shift by kernel mean matching. *Dataset shift in machine learning*, 3(4):5, 2009.
+I. Guttman. Statistical Tolerance Regions: Classical and Bayesian. Griffin's statistical monographs & courses. Hafner Publishing Company, 1970. URL https://books.google.com/books?id=3Q7vAAAAMAAJ.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016.
+Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700-4708, 2017.
+Jiayuan Huang, Arthur Gretton, Karsten Borgwardt, Bernhard Scholkopf, and Alex Smola. Correcting sample selection bias by unlabeled data. Advances in neural information processing systems, 19, 2006.
+
+Ramneet Kaur, Susmit Jha, Anirban Roy, Sangdon Park, Edgar Dobriban, Oleg Sokolsky, and Insup Lee. idecode: In-distribution equivariance for conformal out-of-distribution detection. In Proceedings of the AAAI Conference on Artificial Intelligence, 2022.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
+Jing Lei, Alessandro Rinaldo, and Larry Wasserman. A conformal prediction approach to explore functional data. Annals of Mathematics and Artificial Intelligence, 74(1):29-43, 2015.
+Lihua Lei and Emmanuel J Candès. Conformal inference of counterfactuals and individual treatment effects. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2021.
+Shuo Li, Xiayan Ji, Edgar Dobriban, Oleg Sokolsky, and Insup Lee. Pac-wrap: Semi-supervised pac anomaly detection. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2022.
+Zachary Lipton, Yu-Xiang Wang, and Alexander Smola. Detecting and correcting for label shift with black box predictors. In International conference on machine learning, pp. 3122-3130. PMLR, 2018.
+National Institutes of Health and others. Nih clinical center provides one of the largest publicly available chest x-ray datasets to scientific community, 2022.
+Harris Papadopoulos, Kostas Proedrou, Volodya Vovk, and Alex Gammerman. Inductive confidence machines for regression. In European Conference on Machine Learning, pp. 345-356. Springer, 2002.
+Sangdon Park, Osbert Bastani, Nikolai Matni, and Insup Lee. Pac confidence sets for deep neural networks via calibrated prediction. arXiv preprint arXiv:2001.00106, 2019.
+Sangdon Park, Shuo Li, Insup Lee, and Osbert Bastani. Pac confidence predictions for deep neural network classifiers. arXiv preprint arXiv:2011.00716, 2020.
+Sangdon Park, Edgar Dobriban, Insup Lee, and Osbert Bastani. Pac prediction sets under covariate shift. arXiv preprint arXiv:2106.09848, 2021.
+Sangdon Park, Edgar Dobriban, Insup Lee, and Osbert Bastani. Pac prediction sets for meta-learning. arXiv preprint arXiv:2207.02440, 2022.
+Aleksandr Podkopaev and Aaditya Ramdas. Distribution-free uncertainty quantification for classification under label shift. In Uncertainty in Artificial Intelligence, pp. 844-853. PMLR, 2021.
+Hongxiang Qiu, Edgar Dobriban, and Eric Tchetgen Tchetgen. Prediction sets adaptive to unknown covariate shift. arXiv preprint arXiv:2203.06126, 2022.
+Hongxiang Qiu, Eric Tchetgen Tchetgen, and Edgar Dobriban. Efficient and multiply robust risk estimation under general forms of dataset shift. arXiv preprint arXiv:2306.16406, 2023.
+Pranav Rajpurkar, Jeremy Irvin, Kaylie Zhu, Brandon Yang, Hershel Mehta, Tony Duan, Daisy Ding, Aarti Bagul, Curtis Langlotz, Katie Shpanskaya, et al. Chexnet: Radiologist-level pneumonia detection on chest x-rays with deep learning. arXiv preprint arXiv:1711.05225, 2017.
+Yaniv Romano, Matteo Sesia, and Emmanuel Candes. Classification with valid and adaptive coverage. Advances in Neural Information Processing Systems, 33:3581-3591, 2020.
+Reuven Y Rubinstein and Dirk P Kroese. Simulation and the Monte Carlo method. John Wiley & Sons, 2016.
+Mauricio Sadinle, Jing Lei, and Larry Wasserman. Least ambiguous set-valued classifiers with bounded error levels. Journal of the American Statistical Association, 114(525):223-234, 2019.
+Marco Saerens, Patrice Latinne, and Christine Decaestecker. Adjusting the outputs of a classifier to new a priori probabilities: a simple procedure. Neural computation, 14(1):21-41, 2002.
+
+Alexander Shapiro. Monte carlo sampling methods. *Handbooks in operations research and management science*, 10:353-425, 2003.
+Amos Storkey et al. When training and test sets are different: characterizing learning transfer. Dataset shift in machine learning, 30:3-28, 2009.
+Masashi Sugiyama, Shinichi Nakajima, Hisashi Kashima, Paul Buenau, and Motoaki Kawanabe. Direct importance estimation with model selection and its application to covariate shift adaptation. Advances in neural information processing systems, 20, 2007.
+Ryan J Tibshirani, Rina Foygel Barber, Emmanuel Candes, and Aaditya Ramdas. Conformal prediction under covariate shift. Advances in neural information processing systems, 32, 2019.
+John Von Neumann. Various techniques used in connection with random digits. Appl. Math Ser, 12 (36-38):3, 1951.
+Vladimir Vovk. Conditional validity of inductive conformal predictors. In *Asian conference on machine learning*, pp. 475-490. PMLR, 2012.
+Vladimir Vovk, Alexander Gammerman, and Glenn Shafer. Algorithmic learning in a random world. Springer Science & Business Media, 2005.
+Xiaosong Wang, Yifan Peng, Le Lu, Zhiyong Lu, Mohammadhadi Bagheri, and Ronald M Summers. Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2097-2106, 2017.
+Samuel S Wilks. Determination of sample sizes for setting tolerance limits. The Annals of Mathematical Statistics, 12(1):91-96, 1941.
+Bianca Zadrozny. Learning and evaluating classifiers under sample selection bias. In Proceedings of the twenty-first international conference on Machine learning, pp. 114, 2004.
+Kun Zhang, Bernhard Schölkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under target and conditional shift. In International conference on machine learning, pp. 819-827. PMLR, 2013.
+Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28, 2015.
+
+# A ADDITIONAL RELATED WORK
+
+Conformal Prediction. Our work falls into the broad areas of distribution-free uncertainty quantification, conformal prediction and tolerance regions (e.g., Guttman, 1970; Vovk et al., 2005; Balasubramanian et al., 2014; Angelopoulos & Bates, 2021; Kaur et al., 2022; Li et al., 2022; Dobriban & Yu, 2023, etc), which aim to construct prediction sets with finite sample coverage guarantees. The prediction sets are often realized by a setting a threshold on the values of a traditional single-label predictor (i.e. conformity/non-conformity score function) and predict all labels with scores above this threshold. Our setting is related to inductive conformal prediction (Papadopoulos et al., 2002; Vovk, 2012; Lei et al., 2015), where the dataset is split into a training set for fitting the scoring function and a calibration set for constructing the prediction sets.
+
+PAC Prediction Sets. A standard coverage guarantee for conformal prediction methods is marginal coverage over the training, calibration and test data. For inductive conformal prediction, training-data conditional correctness (Vovk, 2012; Park et al., 2019) aims to achieve an $(\varepsilon, \delta)$ -coverage guarantee, where coverage over test points exceeds the desired error rate level $\varepsilon$ with probability at most $\delta$ . Sets satisfying this guarantee have been termed PAC prediction sets (Park et al., 2019). This guarantee is also equivalent to the classical coverage properties of tolerance regions (Wilks, 1941; Fraser, 1956). PAC coverage may be desired when a slight excess of the desired error rate cab causes a significant safety concern.
+
+
Covariate shift
Label shift
Importance weights, as a function of x, y
q(x)/p(x)
q(y)/p(y)
Shared conditional distribution, for all x, y
p(y|x) = q(y|x)
p(x|y) = q(x|y)
+
+Table 1: Comparison of covariate shift and label shift.
+
+Label shift. Label shift (Zadrozny, 2004; Huang et al., 2006; Sugiyama et al., 2007; Gretton et al., 2009) supposes that the conditional covariate distribution is fixed but the label distribution may change from a source to a target distribution; see Table 1. In more detail, let $p$ and $q$ denote the probability density functions of the source and target domains with respect to a common dominating measure, respectively. Label shift assumes that for all labels $y$ , $q(y)$ may differ from $p(y)$ , but for all features $x$ and labels $y$ , we have $p(x \mid y) = q(x \mid y)$ . Label shift can arise when the representations of the classes changes, for instance in scenarios like medical diagnosis and object recognition (Storkey et al., 2009; Saerens et al., 2002; Lipton et al., 2018).
+
+Early solutions required the estimation of $q$ and $p$ , which may scale poorly with the dimension (Chan & Ng, 2005; Storkey et al., 2009; Zhang et al., 2013). More recently, two approaches achieved scalability by assuming an approximate relationship between ground truth labels $y$ and the outputs $\hat{y}$ of a classifier (Lipton et al., 2018; Azizzadenesheli et al., 2019; Saerens et al., 2002): Black Box Shift Estimation (BBSE) (Lipton et al., 2018) and RLLS (Azizzadenesheli et al., 2019) provided consistency results and finite-sample guarantees assuming the confusion matrix is invertible. Subsequent work developed a unified framework that decomposes the error in computing importance weights into miscalibration error and estimation error, with BBSE as a special case (Garg et al., 2020); this approach was extended to open set label shift domain adaptation (Garg et al., 2022). We also mention that label shift is a special case of a more general class of distribution shifts that allow the source and target distributions to be related by sharing sequential conditional distributions (Qiu et al., 2023).
+
+Conformal methods and distribution shift. Conformal prediction has been adapted to distribution shifts such as covariate shift (Tibshirani et al., 2019; Lei & Candès, 2021; Qiu et al., 2022). (Podkopaev & Ramdas, 2021) considers label shift when the true importance weights are exactly known. Importance weights are typically estimated with uncertainty. We address this by developing an algorithm to find confidence intervals for the importance weights. More broadly, prediction sets have been studied in the meta-learning setting (Dunn et al., 2022; Park et al., 2022), as well as the setting of robustness to all distribution shifts with bounded $f$ -divergence (Cauchois et al., 2020).
+
+Class-conditional prediction sets. Although not designed specifically for solving the label shift problem, methods for class-conditional coverage (Sadinle et al., 2019) and adaptive prediction sets (APS) (Romano et al., 2020) can improve robustness to label shifts. However, class-conditional
+
+coverage is a stronger guarantee that leads to prediction sets larger than for our algorithm, while APS does not satisfy a PAC guarantee; we compare empirically to these approaches in Appendix I.5.
+
+# B BACKGROUND ON PAC PREDICTION SETS
+
+Finding the maximum $\tau$ that satisfies (3) is equivalent to choosing the largest $\tau$ such that the empirical error
+
+$$
+\bar {L} _ {S _ {m}} \left(C _ {\tau}\right) := \sum_ {(x, y) \in S _ {m}} \mathbb {1} (y \notin C _ {\tau} (x))
+$$
+
+on the calibration set $S_{m}$ is bounded Vovk et al. (2005); Park et al. (2019). Let $F(k;m,\varepsilon) = \sum_{i=0}^{k} \binom{m}{k} \varepsilon^{i}(1 - \varepsilon)^{m - i}$ be the cumulative distribution function (CDF) of the binomial distribution $\operatorname{Binom}(m,\varepsilon)$ with $m$ trials and success probability $\varepsilon$ evaluated at $k$ . Then, Park et al. (2019) constructs $C_{\hat{\tau}}$ via
+
+$$
+\hat {\tau} = \max _ {\tau \in T} \tau \quad \text {s u b j . t o} \quad \bar {L} _ {S _ {m}} \left(C _ {\tau}\right) \leq k (m, \varepsilon , \delta), \tag {17}
+$$
+
+where $k(m,\varepsilon ,\delta) = \max_{k\in \mathbb{N}\cup \{0\}}k$ subj. to $F(k;m,\varepsilon)\leq \delta$
+
+Their approach is equivalent to the method from Vovk (2012), but formulated in the language of learning theory. By viewing the prediction set as a binary classifier, the PAC guarantee via this construction can be connected to the Binomial distribution. Indeed, for fixed $C$ , $\bar{L}_{S_m}(C)$ has distribution $\mathrm{Bionm}(m, L_P(C))$ , since $\mathbb{1}(y \notin C(x))$ has a Bernoulli $(L_P(C))$ distribution when $(x, y) \sim P$ . Thus, $k(m, \varepsilon, \delta)$ defines a bound such that if $L_P(C) \leq \varepsilon$ , then $\bar{L}_{S_m}(C) \leq k(m, \varepsilon, \delta)$ with probability at least $1 - \delta$ .
+
+# C BACKGROUND ON PREDICTION SETS UNDER DISTRIBUTION SHIFT
+
+Here we demonstrate how to obtain prediction sets given intervals $\underline{w}^{*}\leq w^{*}\leq \overline{w}^{*}$ around the true importance weights. This approach is based closely on the strategy in (Park et al., 2021) for constructing prediction sets under covariate shift, but adapts it to the label shift setting (indeed, our setting is simpler since there are finitely many importance weights). The key challenge is computing the importance weight intervals, which we describe in detail below.
+
+Given the true importance weights $w^{*}$ , one strategy would be to use rejection sampling (Von Neumann, 1951; Shapiro, 2003; Rubinstein & Kroese, 2016) to subsample $S_{m}$ to obtain a dataset that effectively consists of $N \leq m$ i.i.d. samples from $Q$ (here, $N$ is a random variable, but this turns out not to be an issue). Essentially, for each $(x_{i},y_{i}) \in S_{m}$ , we sample a random variable $V_{i} \sim \mathrm{Uniform}([0,1])$ and then accept samples where $V_{i} \leq w_{y_{i}}^{*} / b$ , where $b$ is an upper bound on $w_{y}^{*}$ :
+
+$$
+T _ {N} (S _ {m}, V, w ^ {*}, b) = \left\{(x _ {i}, y _ {i}) \in S _ {m} \middle | V _ {i} \leq \frac {w _ {y _ {i}} ^ {*}}{b} \right\}.
+$$
+
+In our setting, we can take $b = \max_{y\in \mathcal{Y}}w_y^*$ . Then, we return $\hat{\tau} (T_N(S_m,V,w^*,b))$ . Since $T_{N}(S_{m},V,w^{*},b)$ consists of an i.i.d. sample from $Q$ , we obtain the desired PAC guarantee (4).
+
+In practice, we do not know the true importance weights $w^{*}$ . Instead, suppose we can obtain intervals $W_{y} = [\underline{w}_{y}^{*},\overline{w}_{y}^{*}]$ such that $w_{y}^{*}\in W_{y}$ with high probability. We let $W = \prod_{y\in \mathcal{Y}}W_{y}$ , and assume $w^{*}\in W$ with probability at least $1 - \delta$ . The algorithm proposed in (Park et al., 2021) adjusts the above algorithm to conservatively account for this uncertainty—i.e., it chooses $\tau$ so the PAC guarantee (4) holds for any importance weights $w\in W$ :
+
+$$
+\hat {\tau} \left(S _ {m}, V, W, b\right) = \min _ {w \in W} \hat {\tau} \left(T _ {N} \left(S _ {m}, V, w, b\right)\right). \tag {18}
+$$
+
+We minimize over $\tau$ since choosing smaller $\tau$ leads to larger prediction sets, which is more conservative. (Park et al., 2021) show how to compute (18) efficiently. We have the following guarantee:
+
+Theorem C.1 (Theorem 4 in (Park et al., 2021)). Assume that $w^{*} \in W$ . Letting $U = \mathrm{Uniform}([0,1])$
+
+$$
+\mathbb {P} _ {S _ {m} \sim P ^ {m}, V \sim U ^ {m}} \left[ \mathbb {P} _ {(X, Y) \sim Q} [ y \in C _ {\hat {\tau} (S _ {m}, V, W, b)} ] \geq 1 - \varepsilon \right] \geq 1 - \delta .
+$$
+
+In other words, the PAC guarantee (4) holds, with the modification that the outer probability includes the randomness over the samples $V \sim U^{m}$ used by our algorithm.
+
+# D ENSURING THE CONFIDENCE BOUNDS AT EACH STEP
+
+The diagonal elements $c_{kk}$ of the confusion matrix of an accurate classifier, are typically much larger than the other elements. Indeed, for an accurate classifier, the probabilities of correct predictions $c_{kk} = P(g(x) = k, y = k)$ are higher than those of incorrect predictions $c_{ik} := P(g(x) = i, y = k), i \neq k$ . On the other hand, the Clopper-Pearson interval is expected to be short (for instance, the related Wald interval has length or order $1 / \sqrt{m}$ , where $m$ is the sample size). Thus, we expect that
+
+$$
+\bar {c} _ {i k} ^ {0} \ll \underline {{c}} _ {k k} ^ {0}, k = 1, \dots , K, i \neq k. \tag {19}
+$$
+
+Without loss of generality, we consider equation 11 as an example. In the Gaussian elimination process, recall that the update at step $t$ is
+
+$$
+\underline {{c}} _ {i j} ^ {t + 1} = \underline {{c}} _ {i j} ^ {t} - \frac {\bar {c} _ {i k} ^ {t}}{\underline {{c}} _ {k k} ^ {t}} \bar {c} _ {k j} ^ {t} \quad \text {i f} i, j > k. \tag {20}
+$$
+
+Combining with equation 19, the factor by which the $k$ -th row is multiplied is small, i.e., $\overline{c}_{ik}^{t} / \underline{c}_{kk}^{t}\ll 1$ . Thus the resulting $i$ -th diagonal elements
+
+$$
+\underline {{c}} _ {i i} ^ {t + 1} = \underline {{c}} _ {i i} ^ {t} - \frac {\overline {{c}} _ {i k} ^ {t}}{\underline {{c}} _ {k k} ^ {t}} \overline {{c}} _ {k i} ^ {t}
+$$
+
+change little after each elimination step, and are expected to remain positive. Next we discuss intervals for off-diagonal elements.
+
+Balanced classifier. For a balanced classifier, when $c_{ik}$ and $c_{jk}$ are close for all $i,j$ such that $i \neq k$ , $j \neq k$ , since the factor $\overline{c}_{ik}^t / \underline{c}_{kk}^t$ is small, the lower bound in equation 20 is expected to be positive.
+
+Imbalanced classifier. For the more general case of a possibly imbalanced classifier, $c_{ij}$ and $c_{kj}$ may not be close. This could cause non-positive bounds at certain steps, so the confidence interval may not be valid at the next steps; e.g., equation 13 may fail. However, note that since
+
+$$
+c _ {i k} ^ {t} \in [ \underline {{c}} _ {i k} ^ {t}, \overline {{c}} _ {i k} ^ {t} ], c _ {k j} ^ {t} \in [ \underline {{c}} _ {k j} ^ {t}, \overline {{c}} _ {k j} ^ {t} ],
+$$
+
+we have
+
+$$
+c _ {i k} ^ {t} c _ {k j} ^ {t} \leq \max \{\left| \underline {{c}} _ {i k} ^ {t} \right|, \left| \overline {{c}} _ {i k} ^ {t} \right| \} \cdot \max \{\left| \underline {{c}} _ {k j} ^ {t} \right|, \left| \overline {{c}} _ {k j} ^ {t} \right| \}
+$$
+
+and hence
+
+$$
+\frac {c _ {i k} ^ {t} c _ {k j} ^ {t}}{c _ {k k} ^ {t}} \leq \frac {\operatorname* {m a x} \{\left| \underline {{c}} _ {i k} ^ {t} \right| , \left| \overline {{c}} _ {i k} ^ {t} \right| \} \cdot \operatorname* {m a x} \{\left| \underline {{c}} _ {k j} ^ {t} \right| , \left| \overline {{c}} _ {k j} ^ {t} \right| \}}{\underline {{c}} _ {k k} ^ {t}}.
+$$
+
+In fact, one can derive the even tighter bound
+
+$$
+\max \left(\frac {\overline {{c}} _ {i k} ^ {t} \overline {{c}} _ {k j} ^ {t}}{\underline {{c}} _ {k k} ^ {t}}, \frac {\underline {{c}} _ {i k} ^ {t} \overline {{c}} _ {k j} ^ {t}}{\underline {{c}} _ {k k} ^ {t}}, \frac {\underline {{c}} _ {i k} ^ {t} \underline {{c}} _ {k j} ^ {t}}{\underline {{c}} _ {k k} ^ {t}}, \frac {\overline {{c}} _ {i k} ^ {t} \overline {{c}} _ {k j} ^ {t}}{\overline {{c}} _ {k k} ^ {t}}, \frac {\underline {{c}} _ {i k} ^ {t} \overline {{c}} _ {k j} ^ {t}}{\overline {{c}} _ {k k} ^ {t}}, \frac {\underline {{c}} _ {i k} ^ {t} \underline {{c}} _ {k j} ^ {t}}{\overline {{c}} _ {k k} ^ {t}}, \frac {\overline {{c}} _ {i k} ^ {t} \underline {{c}} _ {k j} ^ {t}}{\overline {{c}} _ {k k} ^ {t}}\right).
+$$
+
+This can be checked by carefully going through all possible cases of positive and negative values of the bounds. Similar changes can be made to computing the upper bounds.
+
+It is possible for our final interval $W$ to contain negative lower bounds due to loose element-wise intervals or other factors. Since importance weights are non-negative, negative importance weight bounds act the same way as zero lower bounds in rejection sampling, and preserve our guarantees.
+
+Finally, the requirement of an accurate classifier is already imposed by methods such as BBSE to ensure the invertibility of the confusion matrix. Therefore, our Gaussian elimination approach does not impose significantly stronger assumptions.
+
+# E PROOF OF LEMMA 3.1
+
+For the first phase, we prove by induction on $t$ that (10) holds for all $t$ . The base case $t = 0$ holds by assumption. For the induction step, we focus on $\underline{c}_{ij}^{t + 1}$ ; the remaining bounds $\overline{c}_{ij}^{t + 1}, \underline{q}_k^{t + 1}$ , and $\overline{q}_k^{t + 1}$ follow similarly. There are three sub-cases i, each corresponding to one of the update rules in (11). For the first update rule $\overline{c}_{ij}^{t + 1} = 0$ , equation 10 follows since the Gaussian elimination algorithm
+
+guarantees that $c_{ij}^{t + 1} = 0$ . For the second and third update rules, equation 10 follows by direct algebra and the induction hypothesis. For instance, for $i,j > t$ , equation 13 holds, and similarly $c_{ij}^{t + 1}\geq c_{ij}^{t + 1}$
+
+For the second phase, the fact that $\underline{s} \leq s \leq \overline{s}$ and $\underline{w}^* \leq w^* \leq \overline{w}^*$ follows by a similar induction argument. Since Gaussian elimination guarantees that $w^* = \mathbf{C}_P^{-1} q^*$ , and we have shown that $w^* \in W = \prod_{i=1}^{K} [\underline{w}_i, \overline{w}_i]$ , the claim follows.
+
+# F PROOF SKETCH OF THEOREM 3.2
+
+First, Theorem 3.2 follows from equation 5, assuming the given confidence intervals $W_{i} = [\underline{w}_{i}, \overline{w}_{i}]$ for each importance weight $w_{i}^{*}$ is valid—i.e., $w_{i}^{*} \in W_{i}$ . Equation 5 follows by Theorem 4 in Park et al. (2021). Roughly speaking, if $w_{i}^{*}$ is known, then we can use a standard rejection sampling procedure based on $w_{i}^{*}$ to convert $S_{m}$ into a set of i.i.d. samples from $Q$ . Then, the PAC guarantee would follow by standard conformal prediction results, e.g., Park et al. (2020). When $w_{i}^{*}$ is not known, then intuitively, Park et al. (2021) takes the worst case over all $w_{i}^{*} \in W_{i}$ . They use a reparameterization trick to do so in a computationally efficient way. Finally, by Lemma 3.1, we have $w_{i}^{*} \in W_{i}$ for all $i \in [n]$ with high probability, so Theorem 3.2 follows by a union bound.
+
+# G CONSERVATIVE BASELINE
+
+We describe PS-C, the conservative baseline summarized in Algorithm 2. In particular, given an upper bound $b \geq w^{*}$ on the importance weight, we use the upper bound
+
+$$
+\mathbb {E} _ {(X, Y) \sim P} [ \ell (g (X), Y) \cdot w _ {Y} ^ {*} ] \leq b \cdot \mathbb {E} _ {(X, Y) \sim P} [ \ell (g (X), Y) ].
+$$
+
+As a consequence, we can run the original prediction set algorithm from Vovk (2012); Park et al. (2019) with a more conservative choice of $\varepsilon$ that accounts for this upper bound.
+
+Algorithm 2 PS-C: an algorithm using the CP bound in equation 21.
+1: procedure PS-C $(S_{m},T_{n}^{X},f,\mathcal{T},\varepsilon ,\delta_{w},\delta_{C})$
+2: $\underline{c},\overline{c},\underline{q},\overline{q}\gets \mathrm{CPINTERVAL}(S_m,T_n^X,x\mapsto \arg \max_{y\in \mathcal{Y}}f(x,y),\delta_w)$
+3: $W\gets \mathrm{INTERVALGAUSSIANELIM}(\underline{c},\overline{c},\underline{q},\overline{q})$
+4: $b\gets \max_{k\in [K]}\overline{w}_k$
+5: return PS(Sm,f,T,ε/b,δC)
+
+Lemma G.1. Algorithm 2 satisfies the PAC guarantee under label shift equation 4.
+
+Proof. Having constructed the importance weight intervals $w^{*}$ , we can use $b = \max_{k\in [K]}\overline{w}_k$ to find a conservative upper bound on the risk as follows:
+
+$$
+\begin{array}{l} E _ {(X, Y) \sim Q} [ \mathbb {1} (Y \notin C _ {\tau} (X) ] = \int q (x, y) \mathbb {1} (y \notin C _ {\tau} (x)) d x d y \\ = \int p (x, y) w (y) \mathbb {1} (y \notin C _ {\tau} (x)) d x d y \leq b E _ {(X, Y) \sim P} [ \mathbb {1} (Y \notin C _ {\tau} (X) ]. \tag {21} \\ \end{array}
+$$
+
+Hence, using the PS prediction set algorithm with parameters $(\varepsilon /b,\delta)$ , the output is $(\varepsilon ,\delta)$ -PAC.
+
+# H ORACLE IMPORTANCE WEIGHT RESULTS
+
+Here, we show comparisons to an oracle that is given the ground truth importance weights (which are unknown and must be estimated in most practical applications). It uses rejection sampling according to these weights rather than conservatively accounting for uncertainty in the weights. In contrast to our baselines (which need to estimate $w$ ), this oracle represents a "gold (yet not achievable) standard" to compare with. It enables us to quantify the increase in average prediction set size due to uncertainty in our estimates of $w$ , stemming from (i) finite sample error, accounted for by Clopper-Pearson intervals, and (ii) label shift, accounted for by our interval Gaussian elimination algorithm.
+
+Figure 5: Prediction set results with comparison to the oracle importance weight (Ora).
+
+(a) Prediction set error and size on the CDC dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+(b) Prediction set error and size on the CIFAR10. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 27000$ , $n = 19997$ , and $t = 19997$ .
+
+
+
+
+
+First, for the CDC heart dataset, we consider the following label distributions: source (94%, 6%), target: (63.6%, 36.4%); see Figure 5a for the results. Second, for the CIFAR-10 dataset, we consider the following label distributions: source (10%, 10%, 10%, 10%, 10%, 10%, 10%, 10%, 10%), target: (6.7%, 6.7%, 6.7%, 40.0%, 6.7%, 6.7%, 6.7%, 6.7%, 6.7%, 6.7%) and source (20%, 20%, 20%, 20%, 20%, 20%, 20%).
+
+# I ADDITIONAL RESULTS
+
+# I.1 CDC HEART
+
+
+
+
+
+Figure 6: More Prediction set results with different hyperparameters on the CDC Heart dataset.
+
+(a) Prediction set error and size under small shifts on the CDC Heart dataset. Parameters are $\varepsilon = 0.05$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+(c) Prediction set error and size under small shifts on the CDC Heart dataset. Parameters are $\varepsilon = 0.03$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+
+
+
+
+(b) Prediction set error and size under large shifts on the CDC Heart dataset, Parameters are $\varepsilon = 0.05$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+(d) Prediction set error and size under large shifts on the CDC Heart dataset, Parameters are $\varepsilon = 0.03$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+Figure 7: More Prediction set results with different hyperparameters on the CDC Heart dataset.
+
+(a) Prediction set error and size under reversed small shifts $(91.3\%, 8.7\%) \rightarrow (94\%, 6\%)$ on the CDC Heart dataset. Parameters are $\varepsilon = 0.05$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+(b) Prediction set error and size under reversed large shifts $(63.6\%, 36.4\%) \rightarrow (94\%, 6\%)$ on the CDC Heart dataset, Parameters are $\varepsilon = 0.05$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+
+
+
+# I.2 CIFAR-10
+
+Figure 8: More Prediction set results with different hyperparameters on the CIFAR-10 dataset.
+
+(a) Prediction set error and size with larger shift on the CIFAR-10. Parameters are $\varepsilon = 0.05$ , $\delta = 5 \times 10^{-4}$ , $m = 27000$ , $n = 19997$ , and $t = 19997$ .
+
+
+(b) Prediction set error and size with larger shift on the CIFAR-10. Parameters are $\varepsilon = 0.03$ , $\delta = 5 \times 10^{-4}$ , $m = 27000$ , $n = 19997$ , and $t = 19997$ .
+
+
+
+
+
+# I.3 AGNEWS
+
+Figure 9: More Prediction set results with different hyperparameters on the AGNews dataset.
+
+(a) Prediction set error and size on the AGNews Dataset. Parameters are $\varepsilon = 0.03$ , $\delta = 5 \times 10^{-4}$ , $m = 26000$ , $n = 12800$ , and $t = 12800$ .
+
+
+
+
+(b) Prediction set error and size on the AGNews Dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 26000$ , $n = 12800$ , and $t = 12800$ .
+
+
+
+# I.4 CHESTX-RAY
+
+Figure 10: More Prediction set results with different hyperparameters on the ChestX-ray dataset.
+
+(a) Prediction set error and size on the ChestX-ray dataset. Parameters are $\varepsilon = 0.3$ , $\delta = 5 \times 10^{-4}$ , $m = 33600$ , $n = 17600$ , and $t = 3520$ .
+
+
+
+
+(b) Prediction set error and size on the ChestX-ray dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 67200$ , $n = 35200$ , and $t = 3520$ .
+
+
+
+# I.5 ADDITIONAL BASELINES
+
+Class-conditional conformal predictors fit separate thresholds for each label and demonstrate robustness to label shift. In Figure 11, we show the class-conditional results for both conformal prediction tuned for average coverage and our PAC prediction set, on the CDC and CIFAR-10 dataset. Here, LWCP is a baseline from the label-conditional setting from Sadinle et al. (2019), which does not satisfy a PAC guarantee. PS-LW adapts the standard PAC prediction set algorithm (Vovk, 2012; Park et al., 2020) to the label-conditional setting; our approach is PS-W. Most relevantly, while PS-LW approximately satisfies the desired error guarantee, it is more conservative than our approach (PS-W) and produces prediction sets that are larger on average. Intuitively, it satisfies a stronger guarantee than necessary for our setting, leading it to be overly conservative.
+
+
+Figure 11: Prediction set error and size on the CDC dataset under small shifts. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ .
+
+
+
+Empirically, we find that while APS improves coverage in the label shift setting, it does not satisfy our desired PAC guarantee. In particular, we show results for the APS scoring function with vanilla prediction sets in Figure 12; as can be seen, it does not satisfy the desired coverage guarantee. Due to its unusual structure, it is not clear how APS can be adapted to the PAC setting, which is our focus.
+
+
+Figure 12: Prediction set error and size on the CDC dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ . Label distribution (94%, 6%) with small shift (91.3%, 8.7%) in the target.
+
+
+
+# I.6 CIFAR-100
+
+We show results on CIFAR-100 in Figure 13. The scores are the logits of a pretrained ViT model. The results show that both PS-C and PS-W attain the desired coverage guarantee, while the remaining approaches do not do so. Furthermore, PS-W outperforms PS-C in terms of average prediction set size.
+
+In this case, both PS-C and PS-W are quite conservative, due to two main reasons. First, the Clopper-Pearson intervals can be conservative when $\delta$ is very small, and we need to divide $\delta$ by $K(K + 1) + 1$ , since we need to take a union bound over $K(K + 1) + 1$ events in equation 8. Second, although our Gaussian "interval" elimination algorithm does uncertainty propagation in time $O(K^3)$ , the resulting confidence intervals $(\underline{w}, \overline{w})$ may be conservative, thereby amplifying the first issue. With more calibration data, our approach would be less conservative.
+
+
+Figure 13: Prediction set error and size on the CIFAR-100 dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 270k$ , $n = 180k$ , and $o = 5950$ . Label distribution is $[1.01\%] \times 99 + [0.3\%]$ for source, and $[0.84\%] \times 99 + [16.8\%]$ for target.
+
+
+
+# I.7 LARGE $\varepsilon$
+
+We provide results on larger choices of $\varepsilon$ in Figures 14 & 15.
+
+
+Figure 14: Prediction set error and size on the CDC dataset. Parameters are $\varepsilon = 0.3$ , $\delta = 5 \times 10^{-4}$ , $m = 42000$ , $n = 42000$ , and $o = 9750$ . Label distribution is $(94\%, 6\%)$ for source, and $(63.6\%, 36.4\%)$ for target.
+
+
+
+# I.8 NON-UNIFORM SOURCE DISTRIBUTIONS
+
+We provide results with a non-uniform source distribution in Figure 16.
+
+
+Figure 15: Prediction set error and size with large shifts on the CIFAR-10 dataset. Parameters are $\varepsilon = 0.2$ , $\delta = 5 \times 10^{-4}$ , $m = 27000$ , $n = 19997$ , and $t = 19997$ .
+
+
+
+
+Figure 16: Prediction set error and size on the CIFAR-10 dataset. Parameters are $\varepsilon = 0.1$ , $\delta = 5 \times 10^{-4}$ , $m = 34k$ , $n = 45k$ , and $o = 45k$ . Label distribution is $(10.53\%, 5.26\%, 15.79\%, 5.26\%, 5.26\%, 10.53\%, 15.79\%, 10.53\%, 5.26\%, 15.79\%)$ for source, and $(3.57\%, 7.14\%, 10.71\%, 35.71\%, 3.57\%, 7.14\%, 10.71\%, 3.57\%, 7.14\%, 10.71\%)$ for target.
+
+
\ No newline at end of file
diff --git a/pacpredictionsetsunderlabelshift/images.zip b/pacpredictionsetsunderlabelshift/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..862f1274727bcd20a05d3eb9af5b1f29744bc5e0
--- /dev/null
+++ b/pacpredictionsetsunderlabelshift/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8fc308f4c2db58054f2779f33e97ee33338d921091569bcba2ca87052c33dbe9
+size 912469
diff --git a/pacpredictionsetsunderlabelshift/layout.json b/pacpredictionsetsunderlabelshift/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c850a9e1cb512a059bd91b2ec23b49dcf8d5eca8
--- /dev/null
+++ b/pacpredictionsetsunderlabelshift/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce61a1ad369170ff64bf6914e2b3f464d3d663de6a27690825ce554bdfe5ee10
+size 1077102
diff --git a/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_content_list.json b/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..85617f548d7d1fbd7c39ce7cfa2406058306828d
--- /dev/null
+++ b/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3db92e3725db3a72442d3b74457d832059ff56e39a0735ac095972e49ec7e174
+size 142382
diff --git a/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_model.json b/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..edeb010e4fa6f2ece5011959aa34feb833ed4cd9
--- /dev/null
+++ b/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb33349bd5e6da1952c99a2551cfd0ccf258e1d119441b3fe98c9a9106e655c9
+size 168853
diff --git a/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_origin.pdf b/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..a0fe7b6ddd67da996f1ec6f684f58a1726077447
--- /dev/null
+++ b/paereinforcementlearningfromexternalknowledgeforefficientexploration/246f10dd-6824-4248-ac26-a65e26c6cf25_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7901329789b276368cd5d49ec33c2d9ff19ed7a3f906367f7b3063ff6c82f005
+size 13473066
diff --git a/paereinforcementlearningfromexternalknowledgeforefficientexploration/full.md b/paereinforcementlearningfromexternalknowledgeforefficientexploration/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2ba5fb0596df55a3afb6c84fabff4e75d13e5641
--- /dev/null
+++ b/paereinforcementlearningfromexternalknowledgeforefficientexploration/full.md
@@ -0,0 +1,595 @@
+# PAE: REINFORCEMENT LEARNING FROM EXTERNAL KNOWLEDGE FOR EFFICIENT EXPLORATION
+
+Zhe $\mathbf{W}\mathbf{u}^{*1}$ , Haofei Lu\* 2, Junliang Xing'2,
+
+You Wu $^{1,3}$ , Renye Yan $^{1,4}$ , Yaozhong Gan $^{1}$ , Yuanchun Shi $^{1,2}$
+
+$^{1}$ QiYuan Lab, $^{2}$ Department of Computer Science and Technology, Tsinghua University
+
+$^{3}$ Nanjing University, $^{4}$ Peking University
+
+{wuzhe, wuyou, yanrenye, ganyaozhong}@qiyuanlab.com,
+
+luhf23@mails.tsinghua.edu.cn,{jlxing, shiyc}@tsinghua.edu.cn
+
+# ABSTRACT
+
+Human intelligence is adept at absorbing valuable insights from external knowledge. This capability is equally crucial for artificial intelligence. In contrast, classical reinforcement learning agents lack such capabilities and often resort to extensive trial and error to explore the environment. This paper introduces PAE: Planner-Actor-Evaluator, a novel framework for teaching agents to learn to absorb external knowledge. PAE integrates the Planner's knowledge-state alignment mechanism, the Actor's mutual information skill control, and the Evaluator's adaptive intrinsic exploration reward to achieve 1) effective cross-modal information fusion, 2) enhanced linkage between knowledge and state, and 3) hierarchical mastery of complex tasks. Comprehensive experiments across 11 challenging tasks from the BabyAI and MiniHack environment suites demonstrate PAE's superior exploration efficiency with good interpretability.
+
+# 1 INTRODUCTION
+
+Accepting suggestions from external guidance is an integral part of human learning. Humans can absorb insightful external knowledge and seamlessly integrate it into their strategies to tackle complex tasks (Council et al., 2000; Mills et al., 2010). By leveraging existing knowledge, human players can quickly adapt to completely unfamiliar games after just a few rounds of playing. Their ability to swiftly transfer and align existing knowledge with the current environment is a true testament to human intelligence. Building intelligent systems that can learn and integrate like humans is an ultimate goal we relentlessly pursue. Currently, reinforcement learning (RL) has demonstrated its potential towards this goal, with remarkable breakthroughs in numerous domains, approaching or even surpassing human capabilities on Atari Games (Mnih et al., 2013), Go (Silver et al., 2016) and StarCraft (Vinyals et al., 2019).
+
+However, currently RL struggles to efficiently capture and integrate the vast amount of expert
+
+knowledge already existing in the domain. Specifically, RL faces challenges in long-term and sparse reward tasks due to a lack of guidance, requiring extensive trial and error. Our primary focus in this
+
+
+Figure 1: The Planner-Actor-Evaluator (PAE) framework consists of three key components.
+
+work is teaching agents to leverage external knowledge and approach optimal solutions faster in sparse reward environments.
+
+Although mimicking human capabilities benefits RL, it remains challenging for RL agents to realize the above capabilities (Chowdhury et al., 2023). Three main challenges arise when training agents to absorb external knowledge to improve their capabilities. (1) *Difficulties in knowledge acquisition and representation*. Existing approaches utilize Behavioral Cloning (BC) to acquire knowledge by imitating human behaviors directly (Codevilla et al., 2018) or adopt Inverse Reinforcement Learning (IRL) to learn reward functions for providing knowledge (Arora & Doshi, 2021). However, this necessitates many demonstrations, which are costly to label and collect. (2) *Obstacles to the integration of external knowledge and internal strategies*. Integration requires bridging the gap between the discrete nature of external knowledge and the continuous nature of internal strategies. Two potential directions emerge: one is enabling internal strategies to query external knowledge, but it faces challenges at the retrieval level (Reid et al., 2022). The other approach is directly encoding domain knowledge as propositional rules into neural networks for a warm start, leading to training difficulties and poor generalization (Silva & Gombolay, 2021). (3) *Challenge of synergistic updating of external knowledge and internal strategies*. Large Language Models (LLMs) have recently demonstrated impressive capabilities (Chowdhery et al., 2022; Brown et al., 2020), but constant changes in the external world can quickly render them obsolete for time-sensitive tasks (e.g., news question answering). While some recent studies have attempted to directly map the rich semantic knowledge within LLMs to actions (Carta et al., 2023; Mezghani et al., 2023), these mappings cannot be updated or come with high update costs.
+
+We propose using natural language as a knowledge source to bypass the difficulties of knowledge acquisition and representation. The language contains natural and flexible prior knowledge for efficient exploration and skill acquisition, enabling rapid generalization across tasks. Truly understanding the semantics and focusing on the key information is a good start to integrating external knowledge and internal strategies. To synergize the updating of external knowledge and internal strategies, external knowledge sources and internal strategies should retain the ability to learn and improve over time.
+
+To bridge the gap between RL and human in handling sparse reward tasks, as shown in Figure 1, we propose a novel paradigm for guiding agent learning to absorb external knowledge called PAE: Planner-Actuator-Evaluator. The Planner is equipped with a state-knowledge alignment mechanism. This mechanism enables the Planner to access external knowledge sources and retrieve suitable knowledge that aligns with the current state. This aligned knowledge is progressively provided to the Actor, increasing in complexity. The Actor leverages the state information and the external knowledge provided by the Planner for joint reasoning. It incorporates a cross-attention mechanism, allowing the Actor to precisely focus on the critical state and external knowledge features. Additionally, the Actor employs a discriminative network to reverse-infer the Planner's guidance, strengthening the connection between states and knowledge. The Evaluator calculates intrinsic rewards based on the quality of external knowledge the Planner provides and the Actor's reasoning effectiveness. These intrinsic rewards guide independent updates of the Planner and the Actor.
+
+To summarize, our contributions are as follows:
+
+- We present a novel framework, PAE, for learning to incorporate external knowledge to achieve better and faster solutions in sparse reward environments. We demonstrate that knowledge instructing significantly improves strategy exploration in RL.
+- Our PAE framework introduces a circular feedback mechanism. The Evaluator's feedback keeps the Planner aware of the scenario. The external knowledge the Planner provides aligns with the Actor's current capabilities, enabling the Actor to master knowledge from easy to complex.
+- Our proposed framework produces interpretable sequences of steps, with the Planner providing a comprehensible plan in natural language form.
+
+We evaluated our proposed PAE framework across 11 challenging tasks from the BabyAI (Chevalier-Boisvert et al., 2018) and MiniHack (Samvelyan et al., 2021) environment suites. Compared to non-knowledge-guided baseline methods, our PAE framework improves performance by an average of $148\%$ and achieves convergence at least $40\%$ faster. Compared to baseline approaches using language guidance, the PAE framework exhibits an average performance improvement of at least $13\%$ and converges at least $31\%$ faster.
+
+# 2 RELATED WORK
+
+We build upon extensive work in areas related to the study of knowledge and reinforcement learning (RL). Our focus lies in knowledge acquisition and representation, the integration of external knowledge and internal strategies, and exploration in RL.
+
+Knowledge Acquisition and Representation Converting and representing extracted knowledge effectively is the primary challenge in enhancing a reinforcement learning agent's capabilities with external knowledge. Imitation learning and inverse reinforcement learning capture domain knowledge by mimicking human actions via state-action pairs, yet these often require laborious human labeling and feedback (Codevilla et al., 2018; Ho & Ermon, 2016). Representing knowledge as a graph (Xu et al., 2020; Zhang et al., 2022), such as a knowledge or scene graph, encounters issues of limited structured data and sparse valid information. He et al. (2017) treat documents as external knowledge; the agent must learn to interpret them for task-solving. Bougie & Ichise (2018) use environmental data from object detectors as external knowledge, broadening its applicability. In contrast, our approach employs natural language directly as external knowledge, eliminating the need for preprocessing. This fosters agent exploration guided by human-intuitive, natural interaction.
+
+External Knowledge and Internal Strategy Integration Incorporating external knowledge to enhance agent decision-making is crucial. Some methods teach AI to use language for querying external knowledge (Carta et al., 2022; Liu et al., 2022) but grapple with generating sizable, retrievable language queries. Several approaches (Humbird et al., 2018; Silva & Gombolay, 2021) aim to embed human domain knowledge into neural decision trees yet face the challenge of bridging tree-to-neural network gaps. Our focus is linking natural language with policies to guide agent learning. Like Language-conditioned RL, our approach trains agents to follow instructions in interactive environments (Luketina et al., 2019). While prior research explored this setting for various tasks in 2D or 3D environments (Colas et al., 2020; Chevalier-Boisvert et al., 2018), we aim to craft a comprehensive framework that encompasses knowledge selection and representation, the integration of external knowledge and internal strategies, and updating knowledge-guided strategy. Our approach absorbs and understands key parts of the language for joint reasoning and selects external knowledge to provide knowledge appropriate to the current agent's capabilities. This results in enhanced task performance, greater adaptability, and improved interpretability. Some more recent work (Carta et al., 2023; Du et al., 2023) have extracted and employed knowledge from LLMs for decision-making tasks. These approaches often directly map the internal knowledge of LLMs to actions. However, this mapping weakens the policy update potential of reinforcement learning algorithms and might present challenges regarding update costs for time-sensitive tasks.
+
+Exploration in RL Exploration stands as a crucial challenge in reinforcement learning, covering $\epsilon$ -greedy action selection (Strouse et al., 2021), state counting (Bellemare et al., 2016), curiosity-driven exploration (Schmidhuber, 1991), and intrinsic motivation (Oudeyer et al., 2007). Our approach aligns with intrinsic motivation, where novelty fosters access to new states. Other forms of intrinsic motivation include empowerment (Klyubin et al., 2005), promoting agent control over the environment, and goal diversity (Pong et al., 2020), encouraging increased entropy within the goal distribution. In contrast, we propose intrinsic motivation as a "cyclic feedback mechanism": The Evaluator's intrinsic reward prompts the Planner to equip the Actor with knowledge suitable for its current capacity, guiding the Actor to execute tasks aided by external knowledge. Our approach also emphasizes enhancing reinforcement learning through language-guided exploration (Mu et al., 2022; Carta et al., 2022). This methodology typically assumes an annotator's presence to generate language descriptions for intrinsic rewards, guiding exploration. We adopt this framework while automating and unifying the entire process, encompassing knowledge representation and selection, integrating external knowledge and intrinsic strategies, and computation of guided intrinsic rewards.
+
+# 3 PRELIMINARIES
+
+We formally define the problem formulation of Knowledge-Instructed Reinforcement Learning. We consider augmented Partially Observable Markov Decision Processes (POMDPs) (Kaelbling et al., 1998). Our augmented POMDP can be described by a 7-tuple $\mathcal{M} = \langle S, \mathcal{A}, \mathcal{T}, \mathcal{R}, \Omega, O, \mathcal{K} \rangle$ . $\mathcal{S}$ is the state space. $\mathcal{A}$ donates the action space. $\Omega$ is the observation space. $\mathcal{K}$ is the knowledge set. $\mathcal{T}: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \mapsto \mathbb{R}^{+}$ is the state transition function. $\mathcal{O}: \mathcal{S} \times \mathcal{A} \times \Omega \mapsto \mathbb{R}^{+}$ is the observation
+
+function. $\mathcal{R}:S\times \mathcal{A}\times \mathcal{K}\mapsto \mathbb{R}$ represents the state-action reward. At each time step $t$ , the agent receives an observation $o_{t}\in \Omega$ and a knowledge $k\in \mathcal{K}$ . Based on these inputs, the agent selects an action $a_{t}\in \mathcal{A}$ , and transits to the next state $s_{t + 1}\in S$ . Via RL, our goal is to find some policy $\pi :\mathcal{S}\times \mathcal{K}\mapsto \mathcal{A}$ that maximizes the expected return.
+
+We assume that the environment provides knowledge following previous work (Jiang et al., 2019; Mirchandani et al., 2021; Waytowich et al., 2019; Mu et al., 2022). We impose no specific representation requirements and present all knowledge in natural language. Natural language's hierarchical structure and rich semantics profoundly impact an agent's cognitive functions (Colas et al., 2022). Agents can update internal strategies guided by language's generality and abstraction, enhancing comprehension of complex concepts and alignment with human values. Many modern RL environments include language by default (Mu et al., 2022), like BabyAI (Chevalier-Boisvert et al., 2018), NetHack (Küttler et al., 2020), MiniHack (Samvelyan et al., 2021), text-based games (Côté et al., 2019; Shridhar et al., 2020; Urbanek et al., 2019), and most video games. In language-absent environments, language descriptions relevant to the agent's state can be produced by generative models of language trained on gigantic amounts of text such as GPT (Brown et al., 2020), PaLM (Chowdhery et al., 2022), and Llama (Touvron et al., 2023).
+
+# 4 METHOD
+
+We introduce the PAE framework, a novel approach for instructing agents to learn to absorb knowledge. As shown in Figure 1, PAE consists of three core components: (1) the Planner, a policy network that delivers language-based external knowledge guidance, adapting in complexity following both task features and the Actor's current capabilities; (2) the Actor, a knowledge-conditioned policy, designed to integrate external knowledge and environment states for joint reasoning; and (3) the Evaluator, a module that offers intrinsic rewards to both the Planner and Actor, guiding their strategy updates.
+
+# 4.1 ALIGNING EXTERNAL KNOWLEDGE AND STATES VIA PLANNER
+
+To enhance guidance, the Planner must progressively select increasingly challenging knowledge for the Actor during the training procedure. This presents two key challenges: 1) correctly understanding knowledge in natural language and aligning it with the current environmental state, and 2) adjusting the complexity of the chosen knowledge based on the Actors' abilities. To achieve this, we consider the Planner as a policy network $\pi_p(k|s_0,\mathcal{K};\pmb{\theta})$ modeled by an MDP: it inputs an initial state $s_0^1$ and a set of knowledge $\mathcal{K}$ and selects a piece of knowledge $k\in \mathcal{K}$ as output. The Planner provides new knowledge whenever a new episode starts, or the Actor reaches an intrinsic goal guided by the knowledge. The Planner receives rewards only when the Actor completes the task using the provided knowledge, aiming to maximize cumulative rewards. Figure 2 provides an overview of the Planner.
+
+Encoding. To assist the Planner in better comprehending hidden information within the environment and knowledge, we introduce a state encoder and a knowledge encoder to encode state and knowledge information to embedded features separately. Specifically, for the state encoder, visual state embeddings $s_0 \in \mathbb{R}^{HW \times c}$ are fed to a shape-preserving 2D convolution layer to generate the state feature $\hat{s}_0 \in \mathbb{R}^{HW \times d_s}$ . To capture both the content and spatial characteristics of the states, position embeddings $\mathbf{E}_{pos}$ are added to $\hat{s}_0$ , which is formulated as:
+
+$$
+\hat {\mathbf {s}} _ {0} = \operatorname {C o n v} \left(s _ {0}\right) + \mathbf {E} _ {p o s}, \quad s _ {0} \in \mathbb {R} ^ {H W \times C} \quad \hat {\mathbf {s}} _ {0}, \mathbf {E} _ {p o s} \in \mathbb {R} ^ {H W \times d _ {s}}, \tag {1}
+$$
+
+where $c$ is the dimension of embedding vectors and $d_{s}$ is the channels of feature maps after convolution. For the knowledge encoder, each unit of knowledge $k_{i} \in \mathcal{K}$ is encoded using a pre-trained language model (e.g. BERT-base) with frozen parameters, yielding the knowledge embeddings $\hat{k}_{i}$ :
+
+$$
+\hat {\mathbf {k}} = \left[ \hat {k} ^ {(1)}, \hat {k} ^ {(2)}, \dots , \hat {k} ^ {(n)} \right] = \operatorname {P r o j} \left(\mathrm {L M} \left(\left[ k ^ {(1)}, k ^ {(2)}, \dots , k ^ {(n)} \right]\right)\right), \quad \hat {\mathbf {k}} \in \mathbb {R} ^ {n \times d _ {k}}, \tag {2}
+$$
+
+where $\mathrm{Proj}(\cdot)$ is a linear projection layer and $d_{k}$ is the dimension of knowledge embedding vectors.
+
+
+Figure 2: Overview of the Planner Network
+
+Alignment. To better align external knowledge with the current environment, we utilize the scaled dot-product cross-attention mechanism to enable the Planner to attend between knowledge and states. Specifically, we compute the query $Q$ using the knowledge embeddings $\hat{\mathbf{k}}$ and compute the key $K$ and value $V$ using the position-embedded state feature $\hat{\mathbf{s}}_0$ . In summary, the alignment procedure can be formulated as:
+
+$$
+\hat {\mathbf {k}} _ {s _ {0}} = \operatorname {A t t e n t i o n} (Q, K, V) = \operatorname {S o f t M a x} \left(\frac {Q K ^ {T}}{\sqrt {d _ {k}}}\right) V \tag {3}
+$$
+
+$$
+\text {w h e r e} Q = \hat {\mathbf {k}} W _ {Q}, K = \hat {\mathbf {s}} _ {0} W _ {K}, V = \hat {\mathbf {s}} _ {0} W _ {V},
+$$
+
+where $W_{Q}\in \mathbb{R}^{d_{k}\times d_{k}}$ , $W_{K}\in \mathbb{R}^{d_{s}\times d_{k}}$ and $W_{V}\in \mathbb{R}^{d_{s}\times d_{k}}$ are learnable projection matrices.
+
+**Forwarding.** The cross-attention layer produces $n$ context vectors $\hat{\mathbf{k}}_{s_0} = [\hat{k}_{s_0}^{(1)},\hat{k}_{s_0}^{(2)},\dots ,\hat{k}_{s_0}^{(n)}]$ that aggregates critical information from both the knowledge set and the state, emphasizing knowledge most relevant to the current state. Then, $\hat{\mathbf{k}}_{s_0}\in \mathbb{R}^{n\times d_k}$ will be linear projected to $n$ 1-dimensional scales and go through a softmax layer, aiding the Planner in selecting the appropriate instruction for the Actor.
+
+$$
+\pi_ {p} (k | s _ {0}, \mathcal {K}; \boldsymbol {\theta}) = \operatorname {S o f t M a x} (\mathrm {L N} (\hat {\mathbf {k}} _ {s _ {0}})). \tag {4}
+$$
+
+# 4.2 TRAINING ACTOR-SPECIFIC INIncrementAL SKILLS WITH EXTERNAL KNOWLEDGE
+
+The Actor is a knowledge-conditioned policy parameterized as $\pi_{a}(a_{t}|^{p}s_{t},k;\omega)$ . Once the Planner provides the Actor with suitable external knowledge, we aim for the Actor's competence in two key areas. First, like the Planner, the Actor must comprehensively grasp knowledge in its natural language form. Second, we want the guiding knowledge to influence the state reached by the Actor, such that different knowledge leads to distinct skills. Accordingly, we seek to strengthen the correlation between knowledge and state.
+
+Encoding, Alignment & Forwarding. To master language comprehension and align knowledge with current observable states, the Actor adopts a three-stage pipeline similar to the Planner: encoding, alignment, and forward. However, unlike the Planner, the Actor receives ${}^p s_t \in \mathbb{R}^{hw \times c}$ , a partially observable state of size $h \times w$ , and $k$ , a single piece of knowledge filtered by the Planner, at each time step $t$ . In the Encoding stage, due to the reduced information content of the input state ${}^p s_t$ , we remove the shape-preserving convolution and directly add position information to state embeddings. Meanwhile, we also utilize the parameter-frozen language model to encode the existing knowledge effectively:
+
+$$
+\begin{array}{c} ^ {p} \hat {\mathbf {s}} _ {t} = ^ {p} s _ {t} + \mathbf {e} _ {p o s} \\ \hat {\mathbf {\Phi}} \end{array} \quad^ {p} \hat {\mathbf {s}} _ {t}, ^ {p} s _ {t}, \mathbf {e} _ {p o s} \in \mathbb {R} ^ {h w \times c} \tag {5}
+$$
+
+$$
+\hat {k} = \operatorname {P r o j} (\operatorname {L M} (k)) \quad \hat {k} \in \mathbb {R} ^ {1 \times d _ {k}}
+$$
+
+During the Alignment stage, we also incorporate the scaled dot-product cross-attention mechanism to achieve the knowledge-state alignment.
+
+$$
+{ } ^ { p } \hat { k } _ { s _ { t } } = \operatorname { A t t e n t i o n } ( Q , K , V ) = \operatorname { S o f t M a x } \left( \frac { Q K ^ { T } } { \sqrt { d _ { k } } } \right) V \tag {6}
+$$
+
+$$
+\text {w h e r e} Q = \hat {k} W _ {Q}, K = ^ {p} \hat {\mathbf {s}} _ {t} W _ {K}, V = ^ {p} \hat {\mathbf {s}} _ {t} W _ {V}
+$$
+
+
+Figure 3: Overview of the Actor Network
+
+Moving on to the Forward stage, we aim to enhance the Actor's attention to current state information. To achieve this, we employ strided convolution to extract state information further. We then concatenate this extracted information with the state-aligned knowledge, passing it through a Linear and a softmax layer to generate the distribution over actions.
+
+$$
+\pi_ {a} \left(a _ {t} \mid s _ {t}, k; \omega\right) = \operatorname {S o f t M a x} \left(\operatorname {L N} \left(\left[ \operatorname {C o n v} \left(^ {p} s _ {t}\right), ^ {p} \hat {k} _ {s _ {t}} \right]\right)\right). \tag {7}
+$$
+
+Maximize the mutual information between knowledge and states. We utilize the mutual information maximization objective to build on the idea that knowledge should dictate the states the agent visits. Our approach maximizes the mutual information $I(s; k)$ between knowledge and states. The objective can be written as follows:
+
+$$
+\begin{array}{l} I (s; k) = \mathcal {H} (k) - \mathcal {H} (k | s) \\ = \mathbb {E} _ {k \sim p (k), s \sim \pi} [ \log p (k | s) ] - \mathbb {E} _ {k \sim p (k)} [ \log p (k) ] \tag {8} \\ \geq \mathbb {E} _ {k \sim p (k), s \sim \pi} \left[ \log q _ {\phi} (k | s) - \log p (k) \right]. \\ \end{array}
+$$
+
+As we cannot compute $p(k|s)$ exactly by integrating over all states and their associated knowledge, we approximate $p(k|s)$ using a trainable discriminative network $q_{\phi}(k|s)$ . Previous work (Eysenbach et al., 2018) has proved that maximizing the mutual information between $s$ and $k$ can translate into maximizing the variational lower bound obtained by replacing $p(k|s)$ with $q_{\phi}(k|s)$ (as shown in Equation 8). From this variational lower bound, we give the mutual information rewards $r_{MI}$ used to encourage the Actor to strengthen the connection between state and knowledge:
+
+$$
+r _ {I} = \log q _ {\phi} (k | ^ {p} s) - \log p (k). \tag {9}
+$$
+
+The discriminative network $q_{\phi}(k|^{p}s)$ is optimized using a cross-entropy loss $\mathcal{L}_{\phi}$ , denoting as:
+
+$$
+\mathcal {L} _ {\phi} \left(^ {p} s, k\right) = - \sum_ {k ^ {\prime} \in \mathcal {K}} \left(k ^ {\prime} = k\right) \cdot \log \left(q _ {\phi} \left(k ^ {\prime} \mid^ {p} s\right)\right). \tag {10}
+$$
+
+In summary, the Planner samples a piece of knowledge $k$ from the logits output by $\pi_p(k|s_0,\mathcal{K};\pmb{\theta})$ and provides it to the Actor. The Actor employs the conditional network $\pi_a(a_t|^p s_t,k;\omega)$ to make decisions in the environment guided by this knowledge $k$ . The Actor is motivated to explore states that offer higher rewards and have a close relationship with $k$ . The discriminative network $q_{\phi}(k|s)$ uses the $k$ provided by the Planner as ground truth and updates through supervised learning to better infer knowledge $k$ from the visited states. $p(k)$ is provided by the Planner's policy network $\pi_p(k|s_0,\mathcal{K};\pmb{\theta})$ . More implementation details are shown in Appendix A.3. Algorithm 1 in Appendix A.4.1 summarizes our PAE procedure.
+
+# 4.3 EVALUATION MECHANISM
+
+Reinforcement learning in long-term and sparse reward tasks is often difficult and requires a lot of trial and error. The standard solution to speed up this process is introducing additional reward signals to better guide learning. Incorporating external knowledge offers a more straightforward approach to reward shaping.
+
+For the Actor, the external knowledge from the Planner serves as the missing signal in the environment. In addition to the extrinsic reward for accomplishing the final task, the Actor receives an
+
+additional intrinsic reward of $+1$ for each subtask completed per the Planner's guidance. Consequently, the total rewards for the Actor comprise three terms: environmental extrinsic rewards $r_{ex}$ , the maximization of the mutual information term $r_{MI}$ , and intrinsic rewards $r_{in}$ :
+
+$$
+r _ {\text {a c t o r}} = r _ {e x} + r _ {i n} \left(\mathbb {I} \left(\pi_ {a} \left(a _ {t} \mid s _ {t}, k; \omega\right) \mapsto k\right)\right) + \alpha_ {I} r _ {I}, \tag {11}
+$$
+
+where $\mathbb{I}$ is the indicator function, $\pi_{a}(a_{t}|^{p}s_{t},k;\omega)\mapsto k$ denotes that the Actor completed the subtask following external knowledge guidance, $\alpha_{I} > 0$ is a scaling factor.
+
+For the Planner, we follow the previous approach (Mu et al., 2022; Campero et al., 2020) of using the Actor's task completion as an intrinsic reward. This task is neither too easy (i.e., the knowledge given by the Planner is too simple) nor impossible (i.e., the knowledge given by the Planner is too complex) for the Actor to complete the current task, i.e., an automatic curriculum. Specifically, we evaluate the Planner using the number of steps required for the Actor to follow the guidance proposed by the Planner; if the number of steps required for the Actor to follow the guidance is within the threshold $t^*$ , or if the guidance can not be followed until the end of the episode, the Planner receives a reward of $-\beta$ , otherwise, the Planner gets a reward of $+\alpha$ :
+
+$$
+r _ {\text {p l a n n e r}} = r _ {e x} + r _ {i n}; r _ {i n} = \left\{ \begin{array}{l l} + \alpha & \text {i f} t \geq t ^ {*} \\ - \beta & \text {i f} t < t ^ {*} \text {o r} t > t _ {\max } \end{array} \right. \tag {12}
+$$
+
+For the value of $t^*$ , we use an adaptive but heuristic approach, where the threshold increases linearly by one when the Actor successfully follows the guidance ten times.
+
+# 5 EXPERIMENTAL EVALUATION
+
+Our experimental evaluation aims to test our central hypothesis: that external knowledge improves the exploration efficiency for RL algorithms in sparse reward environments. We conducted a series of experiments organized as follows: 1) In Section 5.1, we quantitatively evaluate the exploratory capabilities of the PAE by comparing it to various baseline methods. 2) In Section 5.2, we revealed the underlying mechanisms of the PAE through ablation experiments. 3) In Section 5.3, we elucidate the interpretability of PAE's strategy by visualizing the agent's learning process at different stages. See Appendix A.5 for additional experimental results. More implementation details of PAE are shown in Appendix A.3.
+
+**Environments:** We evaluated our method across two task types, totaling six environments within the BabyAI environment: Key Corridor tasks (KEYCORRS3R3, KEYCORRS4R3, KEYCORRS5R3) and Obstructed Maze tasks (OBSTRMAZE1DL, OBSTRMAZE2DLHB, OBSTRMAZE1Q). The suffix signifies the environment's size; a larger environment increases the exploration difficulty in the same type of task. To demonstrate PAE's scalability, we extended our PAE approach to the more challenging MiniHack tasks. MiniHack consists of procedurally generated tasks within a Roguelike game, offering a richer observation space than the BabyAI environment. Additionally, it presents up to 75 dimensions of structured and context-sensitive action space. Our comparisons of PAE with baseline methods encompassed five MiniHack environments: LAVACROSS-RING, LAVACROSS-POTION, LAVACROSS-FULL, RIVER-MONSTER, and MULTIROOM-N4-MONSTER. See Appendix A.2 for more details.
+
+We follow the previous work (Mu et al., 2022) to introduce knowledge. In BabyAI, the Planner receives a fully observed state and a set of 652 instructions from the BabyAI platform. Meanwhile, the Actor gets a $7 \times 7$ representation of its field of view and a single instruction filtered by the Planner. See Table 3 in Appendix A.2 for a list of knowledge provided by BabyAI. In MiniHack, the Planner and Actor have the same field of view. Observations consist of a $21 \times 79$ matrix of glyph identifiers, a 21-dimensional vector with the agent's statistics (like location and health), and a series of 256-character knowledge entries. The Planner accesses multiple knowledge entries, whereas the Actor receives a selectively filtered entry from the Planner. See Table 4 in Appendix A.2 for a list of knowledge provided by MiniHack.
+
+# 5.1 QUALITATIVE RESULTS: COMPARE TO BASELINES
+
+We compare PAE with six baseline algorithms across three categories to highlight PAE's advantages. 1) Vanilla Baseline Algorithms: IMPALA (Espeholt et al., 2018), a standard asynchronous
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: Performance of PAE, IMPALA, RND, ICM, AMIGo, L-AMIGo and L-NovelD in eleven environments, with error regions to indicate standard deviation over five random seeds.
+
+
+
+
+
+
+
+
+
+
+
+
+
+actor-critic method, focuses on rapid parallel training and learns only from raw environmental rewards, without any intrinsic motivation or external guidance. 2) Intrinsic Motivation Algorithms: RND (Burda et al., 2018) uses a randomly initialized neural network to compute prediction errors, which serve as intrinsic rewards for exploring new states. ICM (Pathak et al., 2017) encourages exploration by predicting the outcomes of actions and generating intrinsic rewards from prediction errors. AMIGo (Campero et al., 2020) pairs a goal-generating teacher with a goal-conditioned student policy, enriching environmental rewards with intrinsic goals. 3) Language-Instructed Algorithms: L-AMIGo (Mu et al., 2022) builds on AMIGo's model, using language to spotlight relevant abstract concepts in the environment. L-NovelD (Mu et al., 2022) combines natural language with an intrinsic motivation approach to reward states described in natural language that transitions from low to high novelty. While all the above baselines, except the vanilla ones, incorporate some form of external guidance, L-AMIGo is the most similar to ours. However, it introduces language knowledge solely at the level of external guidance without focusing on its integration with internal strategies. The full hyperparameter sweep for PAE and all baselines is reported in Appendix A.3.4.
+
+As shown in Figure 4, PAE achieves almost the fastest convergence across all eleven environments. Notably, AMIGo, RND, ICM, and IMPALA fail to converge within the current step limit. Compared to the best performance in non-knowledge-guided baseline methods (AMIGo, ICM, RND), our PAE framework improves performance by an average of $148\%$ and achieves convergence at least $40\%$ faster. Compared to baseline approaches using language guidance, the PAE framework exhibits an average performance improvement of $13\%$ and converges at least $31\%$ faster. Tables 6 and 7 in Appendix A.5 give the quantitative performance of all models in the BabyAI and MiniHack environments, respectively. Furthermore, we observe excellent training stability in PAE, especially after convergence.
+
+# 5.2 ABLATION EXPERIMENT AND ANALYSIS
+
+To better understand the advantages PAE brings through introducing external knowledge, this section compares the mechanisms for introducing external knowledge in removing or replacing implementations. Full-Model is the full version of PAE. In w/o Curriculum, the Planner attaches equal weight to all external knowledge. w/o Planner eliminates the entire Planner's guidance to the Actor. Table 1 displays the final mean extrinsic rewards and the number of steps (in millions) needed for each model to converge. Each entry consists of two rows of results, with the top row being the average extrinsic reward at the end of training and the bottom row being the minimal stable steps to attain that reward. Lower bottom row values signify quicker convergence, and “ $>$ $x$ ” indicates a lack of convergence within the maximum training steps “ $x$ ”. Training curves for the ablation study are provided in Appendix A.5.
+
+Table 1: Comparison of PAE and ablation models.
+
+
Model
Key Corridor Tasks
Obstructed Maze Tasks
KEYCORRS3R3
KEYCORRS4R3
KEYCORRS5R3
OBSTRMAZE1D1
OBSTRMAZE2D1HB
OBSTRMAZE1Q
Full-Model
0.89 ± 0.0026M
0.92 ± 0.00530M
0.94 ± 0.00190M
0.93 ± 0.0046M
0.87 ± 0.018150M
0.89 ± 0.006150M
w/o Curriculum
0.86 ± 0.02020M
0.00 ± 0.000>60M
0.00 ± 0.000>200M
0.93 ± 0.00412M
0.71 ± 0.324>200M
0.85 ± 0.047250M
w/o Planner
0.00 ± 0.000>20M
0.00 ± 0.000>60M
0.00 ± 0.000>200M
0.00 ± 0.000>20M
0.00 ± 0.000>200M
0.00 ± 0.000>300M
+
+We can see that the 'w/o Curriculum,' the Planner attaches equal weight to all external knowledge, performs well in four of the six environments (KEYCORRS3R3, OBSTRMAZE1DL, OBSTRMAZE2DLHB, OBSTRMAZE1Q) but requires at least $54\%$ more training steps compared to the FULL-MODEL in these four environments. 'w/o Curriculum' earned zero rewards in the other two environments (KEYCORRS4R3, KEYCORRS5R3). We analyze this because tasks like ObstructedMaze require more robust exploration to unlock critical states, while tasks like KeyCorridor emphasize easy-to-difficult completion of the final task. The 'w/o Planner' model earned no external rewards in all six environments. The above results and analysis prove the critical role of introducing external knowledge, especially of suitable difficulty, for exploration in sparse reward environments.
+
+# 5.3 INTERPRETABILITY
+
+One advantage of PAE's introduction of language knowledge is that it can provide insights into developing an agent's abilities during training. We first show in Figure 5 (a) that PAE has a similar capability to the approach of the automatic curriculum: Planner generates an interpretable curriculum. In the KeyCorridorS3R3 environment, the Planner first provides the Actor with easily achievable external knowledge (open the door) and gradually increases the difficulty as training progresses (go to the door, pick up the key), ultimately converging to the final goal (pick up a ball).
+
+
+(a) Planner, Knowledge curriculum
+
+
+(b) Actor, Knowledge acquisition
+Figure 5: Interpretation of knowledge-instructed exploration. The knowledge curriculum introduced by the Planner (left) and the Actor's knowledge acquisition process (right) are illustrated in the KeyCorridorS3R3 environment.
+
+In addition to generating a similar curriculum, Figure 5 (b) also visualizes the number of steps required for the Actor to follow each external knowledge, offering insights into this incremental capability acquisition. We can see that the Planner provides increasingly difficult knowledge during the training process, reflected in a gradual increase in the probability of complex knowledge being presented. Conversely, the Actor gradually improves his proficiency in mastering each knowledge fragment during the training process, reflected in a gradual decrease in the required steps.
+
+# 6 CONCLUSION
+
+In this work, we propose Planner-Actor-Evaluator (PAE), a knowledge-instructed reinforcement learning framework for efficient exploration in sparse reward environments. PAE has several desirable properties: it achieves alignment and joint inference of external knowledge and internal agent states and emerges as an interpretable curriculum. Moreover, PAE is algorithm agnostic, making it compatible with any deep reinforcement learning algorithm.
+
+# ACKNOWLEDGEMENT
+
+This work was partly supported by the Natural Science Foundation of China under Grant No. 62222606 and 62076238.
+
+# REFERENCES
+
+Saurabh Arora and Prashant Doshi. A survey of inverse reinforcement learning: Challenges, methods and progress. Artificial Intelligence, 297:103500, 2021.
+Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. Advances in Neural Information Processing Systems, 29, 2016.
+Nicolas Bougie and Ryutaro Ichise. Deep reinforcement learning boosted by external knowledge. In Proceedings of the 33rd Annual ACM Symposium on Applied Computing, pp. 331-338, 2018.
+Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in Neural Information Processing Systems, 33:1877-1901, 2020.
+Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
+Andres Campero, Roberta Raileanu, Heinrich Kuttler, Joshua B Tenenbaum, Tim Rocktaschel, and Edward Grefenstette. Learning with amigo: Adversarily motivated intrinsic goals. arXiv preprint arXiv:2006.12122, 2020.
+Thomas Carta, Pierre-Yves Oudeyer, Olivier Sigaud, and Sylvain Lamprier. Eager: Asking and answering questions for automatic reward shaping in language-guided rl. Advances in Neural Information Processing Systems, 35:12478-12490, 2022.
+Thomas Carta, Clément Romac, Thomas Wolf, Sylvain Lamprier, Olivier Sigaud, and Pierre-Yves Oudeyer. Grounding large language models in interactive environments with online reinforcement learning. arXiv preprint arXiv:2302.02662, 2023.
+Liting Chen, Lu Wang, Hang Dong, Yali Du, Jie Yan, Fangkai Yang, Shuang Li, Pu Zhao, Si Qin, Saravan Rajmohan, et al. Introspective tips: Large language model for in-context decision making. arXiv preprint arXiv:2305.11598, 2023.
+Maxime Chevalier-Boisvert, Dzmitry Bahdanau, Salem Lahlou, Lucas Willems, Chitwan Saharia, Thien Huu Nguyen, and Yoshua Bengio. Babyai: A platform to study the sample efficiency of grounded language learning. arXiv preprint arXiv:1810.08272, 2018.
+Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
+Tanmoy Chowdhury, Chen Ling, Xuchao Zhang, Xujiang Zhao, Guangji Bai, Jian Pei, Haifeng Chen, and Liang Zhao. Knowledge-enhanced neural machine reasoning: A review. arXiv preprint arXiv:2302.02093, 2023.
+Felipe Codevilla, Matthias Müller, Antonio López, Vladlen Koltun, and Alexey Dosovitskiy. End-to-end driving via conditional imitation learning. In 2018 IEEE International Conference on Robotics and Automation, pp. 4693-4700. IEEE, 2018.
+Cédric Colas, Tristan Karch, Nicolas Lair, Jean-Michel Dussoux, Clément Moulin-Frier, Peter Dominey, and Pierre-Yves Oudeyer. Language as a cognitive tool to imagine goals in curiosity driven exploration. Advances in Neural Information Processing Systems, 33:3761-3774, 2020.
+Cédric Colas, Tristan Karch, Clément Moulin-Frier, and Pierre-Yves Oudeyer. Language and culture internalization for human-like autotelic ai. Nature Machine Intelligence, 4(12):1068-1076, 2022.
+
+Marc-Alexandre Côté, Akos Kádár, Xingdi Yuan, Ben Kybartas, Tavian Barnes, Emery Fine, James Moore, Matthew Hausknecht, Layla El Asri, Mahmoud Adada, et al. Textworld: A learning environment for text-based games. In Computer Games: 7th Workshop, CGW 2018, pp. 41-75. Springer, 2019.
+National Research Council et al. How people learn: Brain, mind, experience, and school: Expanded edition, volume 1. National Academies Press, 2000.
+Yuqing Du, Olivia Watkins, Zihan Wang, Cédric Colas, Trevor Darrell, Pieter Abbeel, Abhishek Gupta, and Jacob Andreas. Guiding pretraining in reinforcement learning with large language models. arXiv preprint arXiv:2302.06692, 2023.
+Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Vlad Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. In International Conference on Machine Learning, pp. 1407-1416. PMLR, 2018.
+Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06070, 2018.
+Ji He, Mari Ostendorf, and Xiaodong He. Reinforcement learning with external knowledge and two-stage q-functions for predicting popular reddit threads. arXiv preprint arXiv:1704.06217, 2017.
+Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. Advances in Neural Information Processing Systems, 29, 2016.
+Kelli D Humbird, J Luc Peterson, and Ryan G McClarren. Deep neural network initialization with decision trees. IEEE Transactions on Neural Networks and Learning Systems, 30(5):1286-1295, 2018.
+Yiding Jiang, Shixiang Shane Gu, Kevin P Murphy, and Chelsea Finn. Language as an abstraction for hierarchical deep reinforcement learning. Advances in Neural Information Processing Systems, 32, 2019.
+Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra. Planning and acting in partially observable stochastic domains. Artificial Intelligence, 101(1-2):99-134, 1998.
+Alexander S Klyubin, Daniel Polani, and Chystopher L Nehaniv. Empowerment: A universal agent-centric measure of control. In IEEE Congress on Evolutionary Computation, volume 1, pp. 128-135. IEEE, 2005.
+Heinrich Küttler, Nantas Nardelli, Thibaut Lavril, Marco Selvatici, Viswanath Sivakumar, Tim Rocktäschel, and Edward Grefenstette. Torchbeast: A pytorch platform for distributed rl. arXiv preprint arXiv:1910.03552, 2019.
+Heinrich Kuttler, Nantas Nardelli, Alexander Miller, Roberta Raileanu, Marco Selvatici, Edward Grefenstette, and Tim Rocktäschel. The nethack learning environment. Advances in Neural Information Processing Systems, 33:7671-7684, 2020.
+Iou-Jen Liu, Xingdi Yuan, Marc-Alexandre Côté, Pierre-Yves Oudeyer, and Alexander Schwing. Asking for knowledge (afk): Training rl agents to query external knowledge using language. In International Conference on Machine Learning, pp. 14073-14093. PMLR, 2022.
+Jelena Luketina, Nantas Nardelli, Gregory Farquhar, Jakob Foerster, Jacob Andreas, Edward Grefenstette, Shimon Whiteson, and Tim Rocktäschel. A survey of reinforcement learning informed by natural language. arXiv preprint arXiv:1906.03926, 2019.
+Lina Mezghani, Piotr Bojanowski, Karteek Alahari, and Sainbayar Sukhbaatar. Think before you act: Unified policy for interleaving language reasoning with actions. In Workshop on Reincarnating Reinforcement Learning at ICLR, 2023.
+
+Candice M Mills, Christine H Legare, Megan Bills, and Caroline Mejias. Preschoolers use questions as a tool to acquire knowledge from different sources. Journal of Cognition and Development, 11 (4):533-560, 2010.
+Suvir Mirchandani, Siddharth Karamcheti, and Dorsa Sadigh. Ella: Exploration through learned language abstraction. Advances in Neural Information Processing Systems, 34:29529-29540, 2021.
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
+Jesse Mu, Victor Zhong, Roberta Raileanu, Minqi Jiang, Noah Goodman, Tim Roktäschel, and Edward Grefenstette. Improving intrinsic exploration with language abstractions. Advances in Neural Information Processing Systems, 35:33947-33960, 2022.
+Pierre-Yves Oudeyer, Frédric Kaplan, and Verena V Hafner. Intrinsic motivation systems for autonomous mental development. IEEE Transactions on Evolutionary Computation, 11(2):265-286, 2007.
+Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning, pp. 2778-2787. PMLR, 2017.
+Vitchyr H Pong, Murtaza Dalal, Steven Lin, Ashvin Nair, Shikhar Bahl, and Sergey Levine. Skewfit: state-covering self-supervised reinforcement learning. In International Conference on Machine Learning, pp. 7783-7792, 2020.
+Roberta Raileanu and Tim Rocktäschel. Ride: Rewarding impact-driven exploration for procedurally-generated environments. arXiv preprint arXiv:2002.12292, 2020.
+Machel Reid, Yutaro Yamada, and Shixiang Shane Gu. Can wikipedia help offline reinforcement learning? arXiv preprint arXiv:2201.12122, 2022.
+Mikayel Samvelyan, Robert Kirk, Vitaly Kurin, Jack Parker-Holder, Minqi Jiang, Eric Hambro, Fabio Petroni, Heinrich Kuttler, Edward Grefenstette, and Tim Roktaschel. Minihack the planet: A sandbox for open-ended reinforcement learning research. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2021.
+Jürgen Schmidhuber. A possibility for implementing curiosity and boredom in model-building neural controllers. In Proc. of the International Conference on Simulation of Adaptive Behavior: From animals to animals, pp. 222-227, 1991.
+Mohit Shridhar, Xingdi Yuan, Marc-Alexandre Côté, Yonatan Bisk, Adam Trischler, and Matthew Hausknecht. Alfworld: Aligning text and embodied environments for interactive learning. arXiv preprint arXiv:2010.03768, 2020.
+Andrew Silva and Matthew Gombolay. Encoding human domain knowledge to warm start reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 5042-5050, 2021.
+David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484-489, 2016.
+DJ Strouse, Kate Baumli, David Warde-Farley, Volodymyr Mnih, and Steven Stenberg Hansen. Learning more skills through optimistic exploration. In International Conference on Learning Representations, 2021.
+Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
+
+Jack Urbanek, Angela Fan, Siddharth Karamcheti, Saachi Jain, Samuel Humeau, Emily Dinan, Tim Rocktäschel, Douwe Kiela, Arthur Szlam, and Jason Weston. Learning to speak and act in a fantasy text adventure game. arXiv preprint arXiv:1903.03094, 2019.
+Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michael Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350-354, 2019.
+Nicholas Waytowich, Sean L Barton, Vernon Lawhern, and Garrett Warnell. A narration-based reward shaping approach using grounded natural language commands. arXiv preprint arXiv:1911.00497, 2019.
+Yunqiu Xu, Meng Fang, Ling Chen, Yali Du, Joey Tianyi Zhou, and Chengqi Zhang. Deep reinforcement learning with stacked hierarchical attention for text-based games. Advances in Neural Information Processing Systems, 33:16495-16507, 2020.
+Yifeng Zhang, Ming Jiang, and Qi Zhao. Query and attention augmentation for knowledge-based explainable reasoning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15576-15585, 2022.
+
+# A APPENDIX
+
+The supplementary material provides additional results, discussions, and implementation details.
+
+- In Section A.1, we discuss the limitations of our PAE approach and provide insights on related work.
+- In Section A.2, we detail the BabyAI and MiniHack environments and the chosen testing tasks.
+- In Section A.3, we provide the implementation and training details for the PAE and the baseline algorithms.
+- In Section A.4, we describe our PAE algorithm and the baseline algorithms.
+- In Section A.5, we present additional experimental results and analysis.
+
+# A.1 LIMITATIONS AND DISCUSSIONS
+
+Limitations Despite the impressive results of our approach, we acknowledge at least two limitations. Firstly, our framework relies on environments like BabyAI and MiniHack to provide knowledge. This dependency means that applying PAE in environments lacking Oracle knowledge is challenging. However, we are fully committed to exploring the use of Large Language Models to provide knowledge. Secondly, our current approach only accepts unimodal knowledge in natural language. More exciting extensions will involve human interaction to provide more natural and multimodal knowledge, which deserves further exploration.
+
+Relationship with LLM-based frameworks LLM-based agents are gaining popularity in solving RL tasks, and very recent studies have shown considerable potential (Carta et al., 2023; Chen et al., 2023). There are currently two main categories of LLM-based agents for decision-making: 1. Finetuning LLMs using RL for decision-making, and 2. Employing LLMs directly for decision-making as plug-ins. These differ significantly from PAE, which uses external knowledge to enhance RL algorithms. In contrast, recent LLM-based agent studies primarily showcase the abilities of LLMs or expand their capabilities using RL methods. In our PAE approach, LLMs are a tool to aid agents in understanding the semantics of knowledge.
+
+# A.2 ENVIRONMENT AND TASK DETAILS
+
+BabyAI and Minigrid The BabyAI platform enables research in grounded language learning involving humans. In BabyAI, agents maximize rewards by completing tasks within limited steps, guided by language instructions. The platform utilizes a grid world environment (Minigrid), a partially observable 2D grid world housing agents and objects (available in 6 colors): boxes, balls, doors, and keys. These entities occupy $N \times M$ tiled rooms interconnected by doors, which may be locked or closed. Agents can pick up, drop, and move objects, while doors require color-matching keys for unlocking. As shown in Figure 6, we evaluated our approach in the BabyAI across six environments spanning two task types: the Key Corridor task (KEYCORRS3R3, KEYCORRS4R3, KEYCORRS5R3) and the Obstructed Maze task (OBSTRMAZE1DL, OBSTRMAZE2DLHB, OBSTRMAZE1Q). Table 2 illustrates critical properties of the Minigrid environment. Table 3 shows the 66 categories of templates provided by BabyAI, totaling 652 pieces of language knowledge.
+
+Key Corridor In the Key Corridor task, the 'S' in the environment name's suffix indicates the room's size, while 'R' signifies the number of rows. The agent must retrieve an item behind a locked door. The key, concealed in a different room, must be found by the agent exploring the environment. Figure 11 illustrates the flow chart for the agent to complete the Key Corridor tasks.
+
+Obstructed Maze In the Obstructed Maze task, a small blue ball is concealed in a corner. With the door locked and blocked by the ball, the key to unlock it is hidden inside a box. The agent must execute a series of precise steps. Typically, this involves opening the box to obtain the correctly colored key, using the key to unlock the door, and subsequently accessing the door to reach the objective. Figure 12 illustrates the flow chart for the agent to complete the Obstructed Maze tasks.
+
+MiniHack The MiniHack environment is a graphical adaptation of NetHack (Küttler et al., 2020), featuring a richer observation space compared to BabyAI. It includes more symbols and supports
+
+
+(a) KeyCorridorS3R3
+
+
+(b) KeyCorridorS4R3
+
+
+(c) KeyCorridorS5R3
+
+
+(d) ObstructedMaze-1Dl
+
+
+(e) ObstructedMaze-2D1hb
+
+
+(f)ObstructedMaze-1Q
+Figure 6: Six challenging environments in BabyAI we used to evaluate PAE.
+
+up to 75 different actions. Observations comprise a $21 \times 79$ matrix of glyph identifiers, a 21-dimensional vector detailing agent statistics, location and health, and real natural language messages received during gameplay. As shown in Figure 7, we evaluate our approach in five environments of MiniHack, including two task types: navigation tasks (RIVER-MONSTER, MULTIROOM-N4-MONSTER) and skill acquisition tasks (LAVACROSS-RING, LAVACROSS-POTION, LAVACROSS-FULL). Navigation tasks in MiniHack challenge the agent program to navigate various obstacles, like crossing a river by maneuvering boulders or traversing intricate or randomly generated mazes to reach a specific destination. Skill Acquisition tasks leverage the extensive variety of NetHack's objects, monsters, and dungeon features, including their interplay. For instance, to wear a ring, the agent must choose the PUTON action, select the ring from the inventory, and decide which hand to wear it on. Table 2 details MiniHack's main features, while Table 4 enumerates some real natural language messages received by the agent during gameplay.
+
+Knowledge in BabyAI and MiniHack (1) The knowledge presented in Table 3 for BabyAI and in Table 4 for MiniHack can be regarded as target states. For example, in MiniGrid, the message "go to the door" can be interpreted as "(in this state), go to the door." In MiniHack, the message "the o is killed!" can be interpreted as "(in this state), kill the o!). We can view these system text descriptions as the required states that the Planner hopes the Actor will achieve after taking a series of actions. Consequently, the Actor must either take the appropriate action to achieve these goals or extract useful strategies from the actions (trajectories) previously taken toward these goals. (2) Much of the knowledge in MiniHack does not directly contribute to task completion. Given that MiniHack's knowledge is derived from actual player feedback during gameplay, it naturally includes irrelevant or emotional messages, such as "ouch!" and "never mind." A rough estimate is provided here: an agent capable of solving the Lavacross task will encounter approximately 80 messages, of which only 6-10 (8-13%) are necessary for a successful trajectory. This requires the Planner to semantically understand these environment messages and filter and exclude those useless knowledge.
+
+# A.3 IMPLEMENTATION DETAILS
+
+# A.3.1 MODEL ARCHITECTURE DETAILS OF PLANNER
+
+This section provides more details of the Planner architecture used in our method. Planner consists of three components, i.e., encoding, alignment, and forwarding of states and knowledge.
+
+Encoding Following BabyAI, the environment observation is a symbolic $H \times W \times 3$ fully observed representation, with $N$ varying according to the environment's size. Each cell in the $H \times W$ grid has 3 features indicating the object's type (e.g., boxes, balls, doors, keys), color (from 6 possible
+
+Table 2: Examples of BabyAI and MiniHack environments and their entity labeling.
+
+
Illustration
Observation
Other Properties
Goal
+Door
+Agent
+Obstruction
Observation: In BabyAI, the agent's observation space is an ego-centric 7x7 grid representation oriented in the direction the agent faces. Each cell within this grid has three defining features: object, color, and state. These features identify the object in the cell, its color, and its state (e.g., distinguishing between a locked and unlocked door).
Action:
+Turn left, Turn right, Move forward, Pick up an object, Drop, Toggle, Done
+Reward:
+A reward of ‘1 - 0.9 × (step_count / max_steps)’ is given for success and 0 for failure.
+Termination:
+The agent picks up the correct object.
+Timeout.
Observation: In MiniHack, the agent's observation consists of a 21 × 79 matrix of glyph identifiers, a 21-dimensional vector with the agent's statistics (like location and health), and a series of messages. A “message” is the UTF-8 encoding of the on-screen message displayed at the top of the screen, represented as a 256-dimensional vector. Each glyph represents a completely unique entity, with integers ranging from 0 to MAX_GLYPH (5991).
Action:
+MiniHack contains 75 actions, including movement commands, managing inventory, casting spells, chopping wands, and more.
+Reward & Termination:
+MiniHack's RewardManager allows you to specify one or more events that can yield varying (positive or negative) rewards. It also enables you to control which subsets of events are sufficient or required for episode termination.
+
+choices), and its state (like open or closed for doors). The Planner embeds these features into type/color/state embeddings with dimensions of 5, 3, and 2, resulting in a visual embedding $s_0$ of size $HW \times 10$ . To process $s_0$ , the Planner employs a 4-layer shape-preserving convolution neural network interleaved with the Exponential Linear Units, where each convolution layer has 16 filters with a size of 3times3, a stride of 1 and padding of 1. The convolution neural network's output $\hat{s}_t$ provides an embedding layer sized $HW \times 16$ . The Planner integrates a randomly initialized, trainable position embedding $\mathbf{E}_{pos}$ with $\mathrm{Conv}(s_0)$ to encapsulate the state's content and spatial features and make preparations for alignment.
+
+Meanwhile, the Planner utilized a pre-trained BERT model with frozen parameters to understand the semantics and encode knowledge. Specifically, we use the vector output of the encoder (in this case, BERT) in the [CLS] position for the sentence embedding. This model encoded a set of $n$ natural language instructions, supplied by the Oracle, into instruction embeddings with dimensions of $n \times 768$ . Subsequently, a linear projection layer transformed these embeddings to produce outputs with dimensions of $n \times 16$ , denoting as $\hat{\mathbf{k}}$ .
+
+**Alignment** To integrate the two types of input embeddings, $\hat{\mathbf{s}}_0 \in \mathbb{R}^{HW \times 10}$ , $\hat{\mathbf{k}} \in \mathbb{R}^{n \times 16}$ , we employ the scaled dot-product cross-attention mechanism. The query $Q$ is computed using $\hat{\mathbf{k}} W_{Q}$ , and the key and value are derived from $\hat{\mathbf{s}}_t W_K$ and $\hat{\mathbf{s}}_t W_V$ , respectively.
+
+Forward After aligning knowledge and environment states, the cross-attention layer yields an output, $\hat{\mathbf{k}}_{s_0}$ , which is a $n \times 16$ context vector capturing the correlation between the knowledge set and the current state. We project this context vector onto n-dimensional logits through a linear layer and finally get the most suitable external knowledge for the Actor after softmax sampling.
+
+Table 3: All knowledge is provided by BabyAI and covers 66 template categories totaling 652 entries. [C] is one of 6 possible colors: green, grey, yellow, blue, purple, and red.
+
+
Go to the <Object>
Open the <Object>
Pick Up the <Object>
go to the ball
go to the box
pick up the ball
go to the door
open the box
pick up the box
go to the key
open the door
pick up the key
go to the <C> ball
open the <C> box
pick up the <C> ball
go to the <C> box
open the <C> door
pick up the <C> box
go to the <C> door
pick up the <C> key
go to the <C> key
Put the <Object> Next to the <Object>
put the ball next to the ball
put the ball next to the <C> ball
put the ball next to the box
put the ball next to the <C> box
put the ball next to the door
put the ball next to the <C> door
put the <C> box next to the <C> ball
put the ball next to the key
put the ball next to the <C> key
put the <C> box next to the <C> box
put the box next to the ball
put the box next to the <C> ball
put the <C> box next to the <C> key
put the box next to the box
put the box next to the <C> box
put the <C> key next to the <C> ball
put the box next to the door
put the box next to the <C> door
put the <C> key next to the <C> box
put the box next to the key
put the box next to the <C> key
put the <C> key next to the <C> door
put the key next to the ball
put the key next to the <C> ball
put the <C> key next to the <C> key
put the key next to the box
put the key next to the <C> box
put the key next to the door
put the key next to the <C> door
put the key next to the key
put the key next to the <C> key
+
+
+(a) LavaCross-Ring
+
+
+(b) LavaCross-Potion
+
+
+(c) LavaCross-Full
+
+
+(d) MultiRoom-N4-Monster
+
+
+(e) River-Monster
+
+
+Figure 7: Five challenging environments in MiniHack we used to evaluate PAE.
+
+# A.3.2 MODEL ARCHITECTURE DETAILS OF ACTOR
+
+This section details the Actor architecture used in our approach. The Actor consists of a policy network and a discriminative network.
+
+The policy network adopts a similar network architecture as the Planner, with the difference that the inputs to the policy network at each time step $t$ are a partial observation of size $7 \times 7 \times 3$ and a single piece of knowledge $k$ filtered by the Planner. Due to the reduction of the information content of the input state, we remove the shape-preserving convolution and add the position information directly to the state embedding ${}^p s_t$ , obtaining ${}^p\hat{s}_t$ of size $(7 \times 7) \times 10$ . For the knowledge selected by the Planner, we utilize the same parameter-frozen BERT model to get the knowledge embedding $\hat{k}$ of dimension 64 after a linear projection. We compute the cross attention of ${}^p\hat{s}_t$ and $\hat{k}$ by using
+
+Table 4: Some natural language messages in MiniHack. A "message" is the UTF-8 encoding of the on-screen message displayed at the top of the screen.
+
+
River-Monster
MultiRoom-N4-Monster
LavaCross
-the stairs are solidly fixed to the floor.
-in what direction?
-what do you want to throw?
-with great effort you move the boulder.
-that hurts!
-you would burn to a crisp trying to pick things up.
-that was close.
-it's a wall.
-what do you want to use or apply?
-it's solid stone.
-you see no door there.
-you move over some lava.
-you don't have anything to zap.
-you kick at empty space.
-the flint stone falls down the stairs.
-you hit the o.
-you strain a muscle.
-the flint stone hits another object.
-you try to crawl out of the water.
-this door is locked.
-you see here a uncursed flint stone.
-your movements are slowed slightly because of your load.
-dumb move!
-sorry, i don't know how to use that.
-the o is killed!
-ouch!
-you float in the opposite direction.
-you try to move the boulder but in vain.
-as you kick the door, it crashes open!
-there is a staircase up here.
-you pull free from the o.
-this door is broken.
-you don't have anything to drink.
-you are almost hit by a dart.
-as you kick the door, it shatters to pieces!
-in what direction?
-the o picks up a food ration.
-this doorway has no door.
-it's a wall.
-you have a little trouble lifting i-a scroll.
-what a strange direction!
-there is nothing here to pick up.
-you have a little trouble lifting j-a o corpse.
-your leg feels better.
-you don't have anything to use or apply.
-...
-never mind.
-emile's ghost touches you!
-...
-agent's ghost touches you!
+
+$\hat{k}_t$ to generate query $Q$ , ${}^p\hat{s}_t$ for key $K$ and value $Q$ . Then, we used four strided convolution layers to extract the state information to get $1 \times 1 \times 32$ state embedding. Finally, we concatenated state embedding and knowledge-state alignment embedding and passed it through one linear layer and softmax layer to get the logit distribution over the seven actions.
+
+The Actor uses a separate discriminative network $q_{\phi}(k|^{p}s_{t})$ to infer the knowledge provided by the Planner from the learned strategies. Intuitively, the Actor is motivated to bridge the connection between knowledge and states and explore states with a close relationship with $k$ . The discriminative network $q_{\phi}(k|^{p}s_{t})$ is optimized using a cross-entropy loss $\mathcal{L}_{\phi}$ , denoting as:
+
+$$
+\mathcal {L} _ {\phi} \left(^ {p} s _ {t}, k\right) = - \sum_ {k ^ {\prime} \in \mathcal {K}} \left(k ^ {\prime} = k\right) \cdot \log \left(q _ {\phi} \left(k ^ {\prime} \mid^ {p} s _ {t}\right)\right) \tag {13}
+$$
+
+Specifically, we employ a same-structure strided convolution network in the policy network to get the state feature ${}^p{\widetilde{s}}_t$ , and knowledge embeddings $\widehat{\mathbf{k}}$ similar to the Planner:
+
+$$
+\tilde {s} _ {t} = \mathrm {C o n v} \left(^ {p} s _ {t}\right) \qquad \qquad \qquad \in \mathbb {R} ^ {1 \times 3 2}
+$$
+
+$$
+\hat {\mathbf {k}} _ {a} = \operatorname {P r o j} \left(\mathrm {L M} \left([ k ^ {(1)}, k ^ {(2)}, \dots , k ^ {(n)} ]\right)\right) \quad \in \mathbb {R} ^ {n \times 3 2} \tag {14}
+$$
+
+Then a dot-product operation between ${}^p\tilde{s}_t$ and knowledge embeddings is performed, followed by a softmax layer outputting $q_{\phi}(k|^{p}s_{t})$ :
+
+$$
+q _ {\phi} (k | ^ {p} s _ {t}) = \operatorname {S o f t M a x} \left(\hat {\mathbf {k}} _ {a} \cdot^ {p} \tilde {s} _ {t} ^ {T}\right) \tag {15}
+$$
+
+Interestingly, whereas the discriminative network was initially derived from the definition of mutual information, we find that the discriminative network can be viewed as predicting and modeling the knowledge distribution of the planner from its perspective to strengthen the connection between state and knowledge.
+
+# A.3.3 TRAINING DETAILS
+
+Each model was trained using five independent seeds on a system with 112 Intel® Xeon® Platinum 8280 cores and 6 Nvidia RTX 3090 GPUs. Run times ranged from 10 hours (for OBSTRUCTED-MAZE1DL) to 100 hours (for the longest KEYCORRIDORS5R3 task).
+
+# A.3.4 HYPERPARAMETERS
+
+For PAE, we ran a grid search over batch size $\in \{8,32,150\}$ , unroll length $\in \{20,40,100,200\}$ , entropy cost for the Actor $\in \{0.0001,0.0005,0.001\}$ , the Actor learning rate $\in \{0.0001,0.0005,0.001\}$ , the Planner learning rate $\in \{0.0001,0.0005,0.001\}$ , entropy cost for the Planner $\in \{0.001,0.005,0.01\}$ . Table 5 shows the best parameters obtained from the search.
+
+For RND and ICM, we followed previous work (Raileanu & Rocktäschel, 2020) and used batch size of 32, unroll length of 100, RMSProp optimizer learning rate of 0.0001 with $\epsilon = 0.01$ and momentum of 0, intrinsic reward coefficient of 0.1, and entropy coefficient of 0.0005, which were the best values they found using grid searches in the same tasks.
+
+For AMIGo and L-AMIGo, we followed previous work (Campero et al., 2020; Mu et al., 2022) and used teacher policy batch size of 32, student policy batch size of 32, teacher grounder batch size of 100, RMSProp optimizer learning rate of 0.0001 with $\epsilon = 0.01$ and momentum of 0, intrinsic reward coefficient of 1, unroll length of 100, value loss cost of 0.5, entropy cost of 0.0005, which were the best values for the same tasks described in their paper.
+
+Table 5: Hyperparameters of PAE adopted in all the experiments.
+
+
Parameter
Value
Actor batch size B
32
Planner batch size Bp
32
Unroll Length
100
Discount
0.99
Value loss cost
0.5
Actor entropy cost
0.0005
Planner entropy cost
0.5
Actor mutual information cost αI
0.0001
Actor cross attention head number
1
Planner cross attention head number
1
Pretrained language model
Bert-base
Pretrained language model output dim
768
Actor language embedding dim
64
Planner language embedding dim
256
Planner embedding projection dim
16
Actor learning rate
5e-4
Planner learning rate
5e-4
Adam betas
(0.9, 0.999)
Adam ε
1e-8
Clip gradient norm
40.0
+
+# A.4 ALGORITHMS DETAILS
+
+# A.4.1 ALGORITHMS DETAILS OF THE PAE
+
+Algorithm 1 illustrates the overall rollout process of PAE. We implemented the PAE and reproduction baseline algorithms using TorchBeast $^2$ (Küttler et al., 2019), an IMPALA-based PyTorch platform for rapid asynchronous parallel training in reinforcement learning.
+
+Algorithm 1: Asynchronous learning algorithm for PAE
+Input: Buffer B, Actor batch $\mathbb{B}$ , Planner batch $\mathbb{B}_p$ , Actor batch size $B$ , Planner batch size $B_{p}$ Initialize: $\mathbf{B}\gets \varnothing ,\mathbb{B}\gets \varnothing ,\mathbb{B}_p\gets \varnothing ,\pi_a(a_st,k;\omega)\gets \omega_0,\pi_p(k|s_0,\mathcal{K};\theta)\gets \theta_0$
+Function INTERACT(Actor Policy: $\pi_{a}^{*}$ , Planner Policy: $\pi_{p}^{*}$ , Buffer: B):
+ $\{s_0,p_s_0\} \leftarrow$ Env Reset(0) $\triangleright s_0$ denotes full observation, $^p s_0$ denotes partial observation
+ $k\gets \pi_p^* (k_0|s_0,\mathcal{K};\boldsymbol {\theta}^*)$ $k_{steps}\gets 0$
+while True do
+ $at\gets \pi_a^* (at|^p st,k;\omega^*)$ $\{s_{t + 1},{}^p s_{t + 1},r_t,k_{done},s_{done}\} \leftarrow$ Env.Step $(a_{t})$ Interact with the environment
+ $k_{steps}\gets k_{steps} + 1$
+if $s_{done}$ then
+ $\{s_0,p_s_0\} \leftarrow$ Env Reset(0) This episode is finished
+ $k\gets \pi_p^* (k_0|s_0,\mathcal{K};\boldsymbol{\theta}^*)$ $k_{steps}\gets 0$
+end
+if $k_{done}$ then
+ $k\gets \pi_p^* (k|s_0,\mathcal{K};\boldsymbol{\theta}^*)$ The Actor successfully followed the Planner's guidance
+ $k_{steps}\gets 0$
+end
+Update B Update Buffer B using newly collected experience
+end
+end
+Function MAIN():
+ $\pi_a^*\gets \pi_a.\mathrm{copy()}$ Make a parameter-fixed copy of $\pi_{a}$ for environment interacting
+ $\pi_p^*\gets \pi_p.\mathrm{copy()}$ Make a parameter-fixed copy of $\pi_p$ for environment interacting
+Th $\leftarrow$ Thread(INTERACT, $\pi_a^*,\pi_p^*,\mathbf{B})$ Create a thread for environment interacting
+while not converged do
+Update $\mathbb{B}\gets \mathbb{B}$ Sample batch $\mathbb{B}$ of size $B$ from Buffer B
+Train $\pi_a(at)^p s_t,k;\omega)$ on $\mathbb{B}$ Training policy $\pi_{a}$ using reinforcement learning
+Train $q_{\phi}(k|^{p}s_{t})$ on $\mathbb{B}$ Training discriminative network $q_{\phi}$ using supervised learning
+Update $\pi_a^*\gets \pi_a.\mathrm{copy()}$ Update $\pi_a^*$ with latest model $\pi_{a}$
+Update $\mathbb{B}_p$ with $\{s_0,k,k_{steps},s_{done}\}$ from $\mathbb{B}_p$
+if $|\mathbb{B}_p| > B_p$ then
+Train $\pi_p(k|s_0,\mathcal{K};\boldsymbol {\theta})$ on $\mathbb{B}_p$ Training policy $\pi_p$ using reinforcement learning
+ $\mathbb{B}_p\gets \emptyset$
+Update $\pi_p^*\gets \pi_p.\mathrm{copy()}$ Update $\pi_p^*$ with latest model $\pi_p$
+end
+end
+Th. join () Stop interacting with the environment
+
+# A.4.2 DETAILS OF THE BASELINE ALGORITHMS
+
+Below, we describe the implementation details of the various baseline algorithms. IMPALA is an off-policy actor-critic framework. The actor-critic agent maintains a policy $\pi_{\theta}(a|x)$ and a value function $v_{\theta}(x)$ , both parameterized by $\theta$ . Both the policy and value functions are refined using the actor-critic update rule. IMPALA also incorporates an entropy regularization loss. The update is derived from the gradient of a specific pseudo-loss function:
+
+$$
+\begin{array}{l} \mathcal {L} _ {\mathrm {V a l u e}} (\theta) = \sum_ {s \in \mathrm {T}} \left(v _ {s} - V _ {\theta} (x _ {s})\right) ^ {2} \\ \mathcal {L} _ {\text {P o l i c y}} (\theta) = - \sum_ {s \in \mathrm {T}} \rho_ {s} \log \pi_ {\theta} \left(a _ {s} \mid x _ {s}\right) \left(r _ {s} + \gamma v _ {s + 1} - V _ {\theta} \left(x _ {s}\right)\right) \tag {16} \\ \end{array}
+$$
+
+$$
+\mathcal {L} _ {\text {E n t r o p y}} (\theta) = - \sum_ {s \in \mathrm {T}} \sum_ {a} \pi_ {\theta} (a | x _ {s}) \log \pi_ {\theta} (a | x _ {s})
+$$
+
+$$
+\mathcal {L} (\theta) = g _ {v} \mathcal {L} _ {\text {V a l u e}} (\theta) + g _ {p} \mathcal {L} _ {\text {P o l i c y}} (\theta) + g _ {e} \mathcal {L} _ {\text {E n t r o p y}} (\theta).
+$$
+
+This decoupled architecture facilitates high throughput. Nonetheless, there can be a bias since the policy generating the trajectory might lag several updates behind the learner's policy when computing the gradient. IMPALA addresses this potential bias by employing the V-trace, which balances the variance-contraction trade-off in these off-policy updates.
+
+RND The main idea of RND is to calculate intrinsic reward based on the prediction error linked to an agent's transfer. RND employs two neural networks: a fixed, randomly initialized target network that defines the prediction task and a predictor network trained on the agent's collected data. RND considers the prediction error from the predictor network, based on features produced by the target network, as a reward for novel states. We followed AMIGo (Campero et al., 2020), using a re-implemented version based on TorchBeast (Küttler et al., 2019) provided by (Raileanu & Roektäschel, 2020).
+
+ICM utilizes curiosity as an intrinsic reward, defining it as the agent's error in predicting its own behavior's consequences within a feature space learned through a self-supervised inverse dynamics model. Specifically, ICM encodes states $s_t$ and $s_{t+1}$ as features $\phi(s_t)$ and $\phi(s_{t+1})$ , respectively, trained to predict $a_t$ (i.e., the inverse dynamics model). The forward model takes $\phi(s_t)$ and $a_t$ as inputs and predicts the feature representation $\phi(s_{t+1})$ for $s_{t+1}$ . The prediction error within the feature space serves as a curiosity-driven intrinsic reward. We followed AMIGo (Campero et al., 2020) using a re-implemented version of ICM provided by (Raileanu & Roktaschel, 2020). based on TorchBeast (Küttler et al., 2019).
+
+AMIGo is a meta-learning method that automatically learns to self-propose adversarial motivational intrinsic goals. AMIGo consists of two subsystems: a goal-conditioned student policy that outputs the agent's actions in the environment and a goal-generating teacher that guides the student's training. These two components train in adversarial training, where the student maximizes rewards by reaching the goal as quickly as possible, and the teacher maximizes rewards by proposing goals that the student can reach but not too quickly. We use the open-source AMIGo (Campero et al., 2020) code3 as a baseline for our PAE method.
+
+L-AMIGo utilizes language as a generalized medium to emphasize relevant environmental abstractions. It is an extension of AMIGo where the teacher presents goals using language instead of coordinates $(x, y)$ . The student is a conditional policy, receiving language goals $g_{t}$ instead of $(x, y)$ . Specifically, the student network is decomposed into policy and grounding networks. The policy network produces a distribution of goals based on the student's state, while the grounding network predicts the probability of achieving the goal.
+
+L-NovelD combines natural language with an intrinsic motivation approach to reward states described in natural language that transitions from low to high novelty. It is an extension of NovelD, which includes two main terms. The first term measures the novelty of state transitions, encouraging exploration without penalizing revisiting less novel states. The second term rewards the agent only for first-time state visits in an episode.
+
+# A.5 ADDITIONAL RESULTS
+
+# A.5.1 QUANTITATIVE RESULTS
+
+Figure 4 shows the training curves of our PAE method alongside the IMPALA, RND, ICM, AMIGo, L-NovelD, and L-AMIGo baseline algorithms. Each model was trained using five independent random seeds. The results reported for each baseline and each environment are the best performance configuration of the policy for that environment. Tables 6 and 7 give the quantitative results of these comparison experiments in the BabyAI and MiniHack environments, respectively, and show the average extrinsic reward and the number of steps (in millions) required for each model to converge. Each entry consists of two rows of results, with the top row being the average extrinsic reward at the end of training and the bottom row being the minimal stable steps to attain that reward. Lower bottom row values signify quicker convergence, and “ $>$ $x$ ” indicates a lack of convergence within the maximum training steps “ $x$ ”.
+
+Table 6: Comparison of PAE and baseline methods in BabyAI environment
+
+
Model
Key Corridor Tasks
Obstructed Maze Tasks
KEYCORRS3R3
KEYCORRS4R3
KEYCORRS5R3
OBSTRMAZE1D1
OBSTRMAZE2D1HB
OBSTRMAZE1Q
PAE (Ours)
0.89 ± 0.0026M
0.92 ± 0.00530M
0.94 ± 0.00190M
0.93 ± 0.0046M
0.87 ± 0.018150M
0.89 ± 0.006150M
L-AMIGo
0.86 ± 0.04012M
0.90 ± 0.01160M
0.93 ± 0.016160M
0.90 ± 0.03020M
0.23 ± 0.403>200M
0.47 ± 0.029>300M
L-NovelD
0.63 ± 0.097>20M
0.15 ± 0.195>60M
0.55 ± 0.484>200M
0.79 ± 0.255>20M
0.57 ± 0.164>200M
0.60 ± 0.107>300M
AMIGo
0.43 ± 0.246>20M
0.22 ± 0.343>60M
0.43 ± 0.599>200M
0.45 ± 0.366>20M
0.10 ± 0.175>200M
0.18 ± 0.023>300M
ICM
0.04 ± 0.052>20M
0.30 ± 0.511>60M
0.00 ± 0.000>200M
0.31 ± 0.54215M
0.00 ± 0.000>200M
0.00 ± 0.000>300M
IMPALA
0.00 ± 0.000>20M
0.00 ± 0.000>60M
0.00 ± 0.000>200M
0.00 ± 0.006>20M
0.00 ± 0.000>200M
0.00 ± 0.000>300M
RND
0.00 ± 0.000>20M
0.00 ± 0.000>60M
0.00 ± 0.000>200M
0.00 ± 0.000>20M
0.00 ± 0.000>200M
0.00 ± 0.000>300M
+
+Table 7: Comparison of PAE and baseline methods in MiniHack environment
+
+
Model
LAVACROSS-RING
LAVACROSS-POTION
LAVACROSS-FULL
MULTIROOM-N4-MONSTER
RIVER-MONSTER
PAE (Ours)
1.00 ± 0.00122M
0.99 ± 0.00235M
1.00 ± 0.00124M
0.72 ± 0.020>40M
0.13 ± 0.018>20M
L-AMIGo
0.57 ± 0.223>40M
0.58 ± 0.214>40M
0.45 ± 0.111>40M
0.31 ± 0.035>40M
0.09 ± 0.016>20M
L-NovelD
0.88 ± 0.197>40M
0.99 ± 0.00930M
0.98 ± 0.01530M
0.51 ± 0.122>40M
0.02 ± 0.017>20M
AMIGo
0.46 ± 0.116>40M
0.54 ± 0.048>40M
0.44 ± 0.101>40M
0.29 ± 0.026>40M
0.08 ± 0.009>20M
ICM
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.18 ± 0.199>40M
0.12 ± 0.028>20M
IMPALA
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>20M
RND
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>40M
0.00 ± 0.000>20M
+
+# A.5.2 ABLATION EXPERIENTIAL RESULTS
+
+Figure 8 illustrates the effect of introducing external knowledge on PAE performance. Full-Model is the full version of PAE. w/o Curriculum provides randomized guidance to the Actors through external knowledge, while w/o Planner eliminates the Planner's guidance.
+
+
+
+
+
+
+
+Figure 8: Ablation of PAE's external knowledge.
+
+Full-Model (Ours)
+
+
+w/o Curriculum
+
+
+w/o Planner
+
+# A.5.3 QUALITATIVE RESULTS
+
+Figure 9 shows an example of PAE completing a task in KeyCorRS5R3. In this example, the Actor first needs to explore the environment to find the key, then open the door of the corresponding color, drop the key, and retrieve the item behind the door. Figure 10 shows the flow of the Planner forming an automatic curriculum in KeyCorS5R3 and the progressive acquisition of skills by the Actor. Typically, in the early stages, the Planner provides easy guidance. As the training progresses and the Actor's ability increases, the Planner provides more hard guidance. We can see in the trajectory that the Planner and Actor are progressing together and eventually complete the task successfully.
+
+
+Figure 9: Example of PAE in completing a task in KeyCORRS5R3. To save space, we only sampled one sub-trajectory for display.
+
+
+Figure 10: An illustration of the training process. The Planner forms an automatic curriculum as the training progresses, and the Actor progressively masters the skills.
+
+# A.6 FLOW CHART
+
+
+Figure 11 and Figure 12 show flowcharts of the agent completing the Key Corridor task and the Obstructed Maze task, respectively.
+
+
+Figure 11: Flow chart of an agent completing Key Corridor tasks.
+Figure 12: Flow chart of an agent completing Obstructed Maze tasks.
\ No newline at end of file
diff --git a/paereinforcementlearningfromexternalknowledgeforefficientexploration/images.zip b/paereinforcementlearningfromexternalknowledgeforefficientexploration/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f0cbf6e638fe0f3fea2aa2644e0c430e7925139a
--- /dev/null
+++ b/paereinforcementlearningfromexternalknowledgeforefficientexploration/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5cd621203cb674c1349ad190459f6f43caea218cf2e987ae481f575ac3998b73
+size 1512750
diff --git a/paereinforcementlearningfromexternalknowledgeforefficientexploration/layout.json b/paereinforcementlearningfromexternalknowledgeforefficientexploration/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ccba24c0a2db31681d2abe5e521943e35de7c912
--- /dev/null
+++ b/paereinforcementlearningfromexternalknowledgeforefficientexploration/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b582bd6b7d583674b7fd65c8605db2a2cc061208b1ea5dd94af1fcdc2891b1ce
+size 759368
diff --git a/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_content_list.json b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..640b2e674654e9e7f4904b4d0eb29729a714fcc2
--- /dev/null
+++ b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67ea1489d8b985cf3e1aac01992a8ec1d55549067f1a5419f290d7024b2d1bf3
+size 114394
diff --git a/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_model.json b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..03b4a3bf211a9ca820f0e78767207ba13d8390d7
--- /dev/null
+++ b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3993bc3eb1f66289cd2a06f08812a3c485e78ea8d62093de36bb7e40ff13ec47
+size 143837
diff --git a/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_origin.pdf b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7308b6f9bfec1ba1ae21cdc0c9e35e482ddd25aa
--- /dev/null
+++ b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/b39aaa9f-61cc-44c3-a665-5d8f55ab0c3f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dc113212202bcc77497eebe010df18c9743e66d3c957b6551e74bbdfb145873c
+size 3877295
diff --git a/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/full.md b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..758a0a13375f6537026035796ff32b1abb4f4afa
--- /dev/null
+++ b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/full.md
@@ -0,0 +1,362 @@
+# PANDALM: AN AUTOMATIC EVALUATION BENCHMARK FOR LLM INSTRUCTION TUNING OPTIMIZATION
+
+Yidong Wang $^{1,2*}$ , Zhuohao Yu $^{1*}$
+
+Wenjin Yao $^{1}$ , Zhengran Zeng $^{1}$ , Linyi Yang $^{2}$ , Cunxiang Wang $^{2}$
+
+Hao Chen $^{3}$ , Chaoya Jiang $^{1}$ , Rui Xie $^{1}$ , Jindong Wang $^{3}$ , Xing Xie $^{3}$
+
+Wei Ye $^{1\dagger}$ , Shikun Zhang $^{1\dagger}$ , Yue Zhang $^{2\dagger}$
+
+$^{1}$ Peking University $^{2}$ Westlake University $^{3}$ Microsoft Research Asia
+
+# ABSTRACT
+
+Instruction tuning large language models (LLMs) remains a challenging task, owing to the complexity of hyperparameter selection and the difficulty involved in evaluating the tuned models. To determine the optimal hyperparameters, an automatic, robust, and reliable evaluation benchmark is essential. However, establishing such a benchmark is not a trivial task due to the challenges associated with evaluation accuracy and privacy protection. In response to these challenges, we introduce a judge large language model, named PandaLM, which is trained to distinguish the superior model given several LLMs. PandaLM's focus extends beyond just the objective correctness of responses, which is the main focus of traditional evaluation datasets. It addresses vital subjective factors such as relative conciseness, clarity, adherence to instructions, comprehensiveness, and formality. To ensure the reliability of PandaLM, we collect a diverse human-annotated test dataset, where all contexts are generated by humans and labels are aligned with human preferences. On evaluations using our collected test dataset, our findings reveal that PandaLM-7B offers performance comparable to both GPT-3.5 and GPT-4. Impressively, PandaLM-70B surpasses their performance. PandaLM enables the evaluation of LLM to be fairer but with less cost, evidenced by significant improvements achieved by models tuned through PandaLM compared to their counterparts trained with default Alpaca's hyperparameters. In addition, PandaLM does not depend on API-based evaluations, thus avoiding potential data leakage.
+
+# 1 INTRODUCTION
+
+Large language models (LLMs) have attracted increasing attention in the field of artificial intelligence (OpenAI, 2023; Google, 2023; Zeng et al., 2022a; Brown et al., 2020; Chowdhery et al., 2022; Anil et al., 2023; Zhang et al., 2023), with various applications from question answering (Hirschman & Gaizauskas, 2001; Kwiatkowski et al., 2019; Wang et al., 2021), machine translation (Vaswani et al., 2017; Stahlberg, 2020) to content creation (Biswas, 2023; Adams & Chuah, 2022). The Alpaca project (Taori et al., 2023) has been a pioneering effort in instruction tuning of LLaMA (Touvron et al., 2023), setting a precedent for instruction tuning LLMs, followed by Vicunna (Chiang et al., 2023). Subsequent research (Diao et al., 2023; Ji et al., 2023; Chaudhary, 2023) have typically adopted Alpaca's hyperparameters as a standard for training their LLMs. Given the necessity of instruction tuning for these pre-trained models to effectively understand and follow natural language instructions (Wang et al., 2022c; Taori et al., 2023; Peng et al., 2023), optimizing their tuning hyperparameters is crucial for peak performance. Critical factors such as optimizer selection, learning rate, number of training epochs, and quality and size of training data significantly influence the model's performance (Liaw et al., 2018; Tan & Le, 2019). However, a research gap remains in the area of hyperparameter optimization specifically designed for instruction tuning LLMs. To address this issue,
+
+we aim to construct an automated, reliable, and robust evaluation method, which can be integrated into any open-sourced LLMs and used as the judging basis for hyperparameter optimization.
+
+The development of such an evaluation method presents its challenges (Guo et al., 2023; Chang et al., 2023), including ensuring evaluation reliability and privacy protection. In the context of our paper, when we refer to "privacy", we primarily allude to the principles ingrained in federated learning (Zhang et al., 2021a) which enables model training across multiple devices or servers while keeping the data localized, thus offering a degree of privacy. Current methods often involve either crowd-sourcing work or API usage, which could be costly, and time-consuming. Besides, these methods face challenges in terms of consistency and reproducibility. This is primarily due to the lack of transparency regarding language model change logs and the inherent subjectivity of human annotations. Note that utilizing API-based evaluations carries the risk of potentially high costs associated with addressing data leaks. Although open-sourced LLMs can be alternative evaluators, they are not specifically designed for assessment, thus making it difficult to deploy them directly as evaluators.
+
+On the other hand, the labels of previous evaluation methods (Zheng et al., 2023; Gao et al., 2021; Wang et al., 2023b;c) simply definite answers and fail to consider the language complexity in practice. The evaluation metrics of these procedures are typically accuracy and F1-score, without considering the subjective evaluation metrics that autoregressive generative language models should pay attention to, thus not reflecting the potential of such models to generate contextually relevant text. The appropriate subjective evaluation metrics can be relative conciseness, clarity, adherence to instructions, comprehensiveness, formality, and context relevance.
+
+To tackle these challenges, we introduce a judge language model, aiming for Reproducible and Automated Language Model Assessment (PandaLM). Tuned from LLaMA, PandaLM is used to distinguish the most superior model among various candidates, each fine-tuned with different hyperparameters, and is also capable of providing the rationale behind its choice based on the reference response for the context. PandaLM surpasses the limitations of traditional evaluation methods and focuses on more subjective aspects, such as relative conciseness, clarity, comprehensiveness, formality, and adherence to instructions. Furthermore, the robustness of PandaLM is strengthened by its ability to identify and rectify problems such as logical fallacies, unnecessary repetitions, grammatical inaccuracies, and context irrelevance. By considering these diverse aspects, we leverage PandaLM's ability to distinguish the most superior model among candidates on the validation set and then provide insights for facilitating hyperparameter optimization of instruction tuning.
+
+In practice, we generate paired responses from a diverse set of similarly sized foundation models including LLaMA-7B (Touvron et al., 2023), Bloom-7B (Scao et al., 2022), Cerebras-GPT-6.7B (Dey et al., 2023), OPT-7B (Zhang et al., 2022a), and Pythia-6.9B (Biderman et al., 2023). Each of these models is fine-tuned using the same data and hyperparameters as Alpaca (Taori et al., 2023). The paired responses from these tuned LLMs constitute the input of training data for PandaLM. The most straightforward approach to generate the corresponding target of training data is through human annotation, but this method can be costly and time-consuming (Wang et al., 2023h). And the lack of sufficiently annotated training data has always been a significant issue in the era of deep learning Ouali et al. (2020); Wang et al. (2023e); Zhang et al. (2021b); Chen et al. (2023); Wang et al. (2022a). Considering that GPT-3.5 can provide a reliable evaluation to some extent, to reduce costs, we follow self-instruct (Wang et al., 2022c), which is a methodology that capitalizes on pre-existing knowledge within large language models to generate annotations or outputs through self-generated instructions. To distil data from GPT-3.5 and apply heuristic data filtering strategies to mitigate noise. Specifically, we filter out invalid evaluations from gpt-3.5-turbo with hand-crafted rules. To address position bias, we also filter out inconsistent samples when swapping the orders of responses in the prompt. Despite the utilization of data distilled from GPT-3.5, the active removal of noise enhances the quality of the training data, fostering a more efficient and robust training process for PandaLM.
+
+To ensure the reliability of PandaLM, we develop a test dataset that aligns with human preference and covers a wide range of tasks and contexts. The instructions and inputs of test data are sampled from the human evaluation dataset of self-instruct (Wang et al., 2022c), with responses generated by different LLMs and each label independently provided by three different human evaluators. Samples with significant divergences are excluded to ensure the Inter Annotator Agreement (IAA) of each annotator remains larger than 0.85. As illustrated in Table 2, PandaLM-7B showcases robust and competitive performance. Remarkably, the efficacy of PandaLM-70B is even more pronounced,
+
+
+(a) Comparison Results of GPT-3.5.
+
+
+Figure 1: The models are evaluated and compared using both GPT-3.5, GPT-4 and human annotators. The 'Win' count represents the number of responses where models fine-tuned with PandaLM-selected optimal hyperparameters outperform models using Alpaca's hyperparameters. Conversely, the 'Lose' count represents the number of responses where models utilizing Alpaca's hyperparameters produce superior responses compared with those fine-tuned with the optimal hyperparameters determined by PandaLM. Note that the overall test set comprises 170 instances, and 'Tie' scenarios are not considered in this illustration.
+
+
+(b) Comparison Results of GPT-4.
+(c) Comparison Results of Human.
+
+exceeding the performance metrics of GPT-4. This enhancement is largely attributable to the effective noise mitigation strategies employed during the training phase.
+
+Moreover, as illustrated in Figure 1, adopting PandaLM's selected optimal hyperparameters covering optimizer selection, learning rate, number of training epochs, and learning rate scheduler brings noteworthy improvements. When assessed using GPT-4 with a set of 170 instructions, a group of five open language models, tuned with optimal hyperparameters selected by PandaLM, achieves an average of 47.0 superior responses and 26.2 inferior responses, outperforming those trained using Alpaca's hyperparameters. Note that the training data remains the same for conducting fair comparisons. Moreover, when these LLMs are evaluated by human experts, using the same set of 170 instructions, they exhibit an average of 79.8 superior responses and 25.2 inferior responses, once again surpassing the performance of models trained with Alpaca's hyperparameters. The experimental results underline the effectiveness of PandaLM in determining optimal hyperparameters for choosing the best LLMs. In addition, when the fine-tuned LLMs are assessed using the lm-eval (Gao et al., 2021), a unified framework to test LLM on a large number of different traditional evaluation tasks, the results further reinforce the superiority of LLMs optimized by PandaLM.
+
+In conclusion, our work delivers three key contributions:
+
+- We introduce PandaLM, a privacy-protected judge language model for evaluating and optimizing hyperparameters for LLMs.
+- We create a reliable human-annotated dataset, essential for validating PandaLM's performance and further research.
+- We make use of PandaLM to optimize the hyperparameters of a series of open-sourced LLMs. In comparison to those LLMs tuned using hyperparameters identified by Alpaca, tuning models with PandaLM-selected hyperparameters yields substantial performance enhancements.
+
+# 2 RELATED WORK
+
+This section reviews the relevant literature on the topic of hyperparameter optimization and the evaluation of language models.
+
+Hyperparameter Optimization The importance of hyperparameter optimization in machine learning (Yu & Zhu, 2020; Falkner et al., 2018; Li et al., 2017; Xu et al., 2023; Wang et al., 2023a; Wu et al., 2019), particularly in the context of fine-tuning deep learning language models such as BERT (Kenton & Toutanova, 2019) and GPT (Radford et al.), cannot be ignored. For these models, the choice of hyperparameters like the learning rate, batch size, or the number of training epochs can significantly influence their performance (Godbole et al., 2023; Sun et al., 2019; Tunstall et al., 2022). This selection process becomes even more critical when fine-tuning these models on domain-specific tasks,
+
+
+Figure 2: The pipeline of instruction tuning LLMs.
+
+where the optimal set of hyperparameters can vary significantly among different domains (Dodge et al., 2020; Sun et al., 2019).
+
+Evaluation of Language Models Accurate evaluation of language models is crucial in determining optimal hyperparameters, thus improving the models' overall performance (Sun et al., 2019; Godbole et al., 2023). Conventional objective metrics like perplexity (Mallio et al., 2023) and accuracy (Xu et al., 2020; Wang et al.; Yang et al., 2022a; Zhong et al., 2023) on downstream tasks (Gao et al., 2021) provide valuable insights, but they may not effectively guide the choice of hyperparameters to enhance LLMs (Rogers et al., 2021) because evaluating LLMs requires other subjective metrics. Advanced language models, such as GPT-4 (OpenAI, 2023) and Bard (Google, 2023), incorporate human evaluations as part of their testing method for LLMs, aiming to better align with human judgements (Wang et al., 2023h). Although human-based evaluation methods offer considerable insight into a model's performance, they are costly and labor-intensive, making it less feasible for iterative hyperparameter optimization processes. Recent advancements in NLP have brought forth model-based metrics such as BERTScore (Zhang et al., 2019) and MAUVE (Pillutla et al., 2021). While these metrics offer valuable insights, there are significant areas where they may not align perfectly with the objectives of response evaluation. Firstly, BERTScore and MAUVE are engineered to measure the similarity between generated content and reference text. However, they are not inherently designed to discern which of multiple responses is superior. A response is closer to a human-written reference doesn't necessarily mean it adheres better to given instructions or satisfies a specific context. Secondly, while these metrics yield scores that represent content similarity, they aren't always intuitive to users. Interpreting these scores and translating them into actionable feedback can be a challenge. In contrast, PandaLM offers a more straightforward approach. It is tailored to directly output the evaluation result in an interpretable manner, making the feedback process transparent and easily understood by humans. In conclusion, while metrics like BERTScore and MAUVE provide valuable insights into content similarity, there is a pressing need for specialized evaluation tools like PandaLM. Tools that not only discern response quality but also do so in a user-friendly, human-comprehensible manner.
+
+Subjective qualitative analysis of a model's outputs, such as its ability to handle ambiguous instructions and provide contextually appropriate responses, is increasingly being recognized as a valuable metric for evaluating models (Zheng et al., 2023). Optimizing hyperparameters with considerations towards these qualitative measures could lead to models that perform more robustly in diverse real-world scenarios. The previous qualitative analysis can be achieved either through human evaluators or through APIs of advanced language models, which is different from our motivation.
+
+# 3 METHODOLOGY
+
+As shown in Figure 2, the process of instruction tuning begins with a foundation model, which is then fine-tuned using instructions. The performance of each tuned model is evaluated to determine the best output. This involves exploring numerous models, each tuned with different hyperparameters, to identify the optimal one. To facilitate this pipeline, a reliable and automated language model assessment system is essential. To address this, we introduce PandaLM - a judge LLM specifically designed to assess the performance of LLMs fine-tuned with various parameters. Our goal is to identify the superior model from a pool of candidates accurately.
+
+
+Figure 3: The top 16 words used in the PandaLM-7B evaluation reasons from randomly sampled $80\mathrm{k}$ evaluation outputs. An example of evaluation reason and evaluation outputs can be found in Figure 5. Stop words are filtered.
+
+# 3.1 TRAIN DATA COLLECTION AND PREPROCESSING
+
+The training data collection aims to create a rich dataset that allows the model to evaluate different responses in a given context and generate an evaluation reason and a reference response using the same context. As demonstrated in Appendix A, each training data instance consists of an input tuple (instruction, input, response1, response2) and an output tuple (evaluation result, evaluation reason, reference response). The instructions and inputs in the input tuple are sampled from the Alpaca 52K dataset (Taori et al., 2023). The response pairs are produced by various instruction-tuned models: LLaMA-7B (Touvron et al., 2023), Bloom-7B (Scao et al., 2022), Cerebras-GPT-6.7B (Dey et al., 2023), OPT-7B (Zhang et al., 2022a), and Pythia-6.9B (Biderman et al., 2023). These models are selected due to their comparable sizes and the public availability of their model weights. Each is fine-tuned using the same instruction data and hyperparameters following Alpaca (Taori et al., 2023). The corresponding output tuple includes an evaluation result, a brief explanation for the evaluation, and a reference response. The evaluation result would be either '1' or '2', indicating that response 1 or response 2 is better, and 'Tie' indicates that two responses are similar in quality. The training prompt of PandaLM is shown at Appendix A. As it is impractical to source millions of output tuples from human annotators, and given that GPT-3.5 is capable of evaluating LLMs to some degree, we follow self-instruct (Wang et al., 2022c) to generate output tuples using GPT-3.5. As illustrated in Figure 3, we design prompts carefully to guide the generation of training data for PandaLM. The goal is to ensure PandaLM not only prioritizes objective response correctness but also emphasizes critical subjective aspects such as relative conciseness, clarity, comprehensiveness, formality, and adherence to instructions. Besides, we encourage PandaLM to identify and rectify issues like logical fallacies, unnecessary repetitions, grammatical inaccuracies, and the absence of context relevance. A heuristic data filtering strategy is then applied to remove noisy data. Specifically, to address the observed inherent bias in GPT-3.5 regarding the order of input responses even with carefully designed prompts, samples from the training dataset are removed if their evaluation results conflict when the orders of input responses are swapped. We finally obtain a filtered dataset containing 300K samples.
+
+# 3.2 PANDALM TRAINING
+
+In this subsection, we provide details about the training procedure for PandaLM. The backbone of PandaLM is LLaMA model, as it exhibits strong performance on multiple complicated NLP tasks (Beeching et al., 2023).
+
+During the fine-tuning phase of PandaLM, we use the standard cross-entropy loss targeting the next token prediction. The model operates in a sequence-to-sequence paradigm without the necessity for a separate classification head. We train PandaLM with the DeepSpeed (Rasley et al., 2020) library, and Zero Redundancy Optimizer (ZeRO) (Rajbhandari et al., 2020; Ren et al., 2021) Stage 2, on 8 NVIDIA A100-SXM4-80GB GPUs. We use the bfloat16 (BF16) computation precision option to further optimize the model's speed and efficiency. Regarding the training hyperparameters, we apply the AdamW (Loshchilov & Hutter, 2017) optimizer with a learning rate of 2e-5 and a cosine learning rate scheduler. The model is trained for 2 epochs. The training process uses a warmup ratio of 0.03 to
+
+
+(a) DAG of GPT-3.5.
+
+
+(b) DAG of GPT-4.
+
+
+(c) DAG of humans.
+Figure 4: Comparative Visualization of Model Performance. The instruction-tuned models use the same training data and hyperparameters. A directed edge from node A to B indicates model A's significant superiority over B, while a dashed undirected edge indicates the two models are similar in performance. The number associated with the directed edge (A, B) represents the difference between the number of wins and losses for model A compared to model B. The absence of a number on the dashed undirected edge indicates that the difference between the number of wins and losses for the models is smaller than 5. We swap the order of two responses to perform inference twice on each data. The conflicting evaluation results are then modified to 'Tie'.
+
+
+(d) DAG of PandaLM.
+
+avoid large gradients at the beginning of training. We use a batch size of 2 per GPU with all inputs truncated to a maximum of 1024 tokens and employ a gradient accumulation strategy with 8 steps.
+
+# 4 RELIABILITY EVALUATION OF PANDALM
+
+To ensure the reliability of PandaLM, we create a test dataset that is labeled by humans and designed to align with human preferences for responses. Each instance of this test dataset consists of one instruction and input, and two responses produced by different instruction-tuned LLMs. The paired responses are provided by LLaMA-7B, Bloom-7B, Cerebras-GPT-6.7B, OPT-7B, and Pythia-6.9B, all instruction tuned using the same instruction data and hyperparameters following Alpaca (Taori et al., 2023). The test data is sampled from the diverse human evaluation dataset of self-instruct (Wang et al., 2022c), which includes data from Grammarly, Wikipedia, National Geographic and nearly one hundred apps or websites. The inputs and labels are solely human-generated and include a range of tasks and contents. Three different human evaluators independently annotate the labels indicating the preferred response. Samples with significant divergences are excluded to ensure the Inter Annotator Agreement (IAA) of each annotator remains larger than 0.85. This is because such samples demand additional knowledge or hard-to-obtain information, making them challenging for humans to evaluate. The filtered test dataset contains 1K samples, while the original unfiltered dataset has 2.5K samples.
+
+To maintain high-quality crowdsourcing work, we involve three experts to annotate the same data point concurrently during the annotation process. There is no prior relationship between the experts and the authors. The experts are hired from an annotation company. These experts receive specialized training that goes beyond evaluating response correctness, enabling them to emphasize other crucial aspects like relative conciseness, clarity, comprehensiveness, formality, and adherence to instructions. Furthermore, we guide these annotators in identifying and addressing issues such as logical fallacies, unnecessary repetitions, grammatical inaccuracies, and a lack of contextual relevance. All human ratings are collected consistently within the same session. To ensure clarity and consistency, we provide comprehensive instructions for every annotator. After the trial phase of data annotation, we eliminate some low-quality labeled data. The final IAA amongst the three annotators, as measured by Cohen's Kappa (Cohen, 1960), yields average scores of 0.85, 0.86, and 0.88 respectively, indicating a relatively high level of reliability for our test dataset. To refine the model's performance assessment compared to human evaluators, we can use the inter-annotator agreement (IAA) of 0.85 as a benchmark. If our model exceeds this, it indicates strong performance. However, setting a realistic target slightly above this human IAA, say around 0.90, offers a challenging yet achievable goal. The distribution of the test data comprises 105 instances of ties, 422 instances where Response 1 wins, and 472 instances where Response 2 takes the lead. Note that the human-generated dataset has no
+
+Table 1: Comparative analysis of evaluation results from various annotation models. The tuple in the table means (#win,#lose,#tie). Specifically, (72,28,11) in the first line of the table indicates that LLaMA-7B outperforms Bloom-7B in 72 responses, underperforms in 28, and matches the quality in 11 responses. The 'Judged By' column represents different methods of response evaluation. 'Human' indicates that humans evaluate the result, and 'PandaLM' indicates that our proposed PandaLM model evaluates the result.
+
+
Judged By
Base Model
LLaMA-7B
Bloom-7B
Cerebras-6.7B
OPT-7B
Pythia-6.9B
Human
LLaMA-7B
/
(72,28,11)
(80,24,6)
(71,24,11)
(58,27,9)
Bloom-7B
(28,72,11)
/
(59,30,11)
(43,35,11)
(47,49,11)
Cerebras-6.7B
(24,80,6)
(30,59,11)
/
(33,49,9)
(27,53,11)
OPT-7B
(24,71,11)
(35,43,11)
(49,33,9)
/
(32,53,15)
Pythia-6.9B
(27,58,9)
(49,47,11)
(53,27,11)
(53,32,15)
/
GPT-3.5
LLaMA-7B
/
(59,19,33)
(71,13,26)
(58,17,31)
(49,16,29)
Bloom-7B
(19,59,33)
/
(40,19,41)
(36,30,23)
(33,34,40)
Cerebras-6.7B
(13,71,26)
(19,40,41)
/
(24,38,29)
(22,43,26)
OPT-7B
(17,58,31)
(30,36,23)
(38,24,29)
/
(30,30,40)
Pythia-6.9B
(16,49,29)
(34,33,40)
(43,22,26)
(30,30,40)
/
GPT-4
LLaMA-7B
/
(58,15,38)
(69,9,32)
(58,14,34)
(52,17,25)
Bloom-7B
(15,58,38)
/
(47,16,37)
(35,31,23)
(32,33,42)
Cerebras-6.7B
(9,69,32)
(16,47,37)
/
(23,40,28)
(17,41,33)
OPT-7B
(14,58,34)
(31,35,23)
(40,23,28)
/
(25,37,38)
Pythia-6.9B
(17,52,25)
(33,32,42)
(41,17,33)
(37,25,38)
/
PandaLM-7B
LLaMA-7B
/
(46,29,36)
(68,18,24)
(52,26,28)
(35,28,31)
Bloom-7B
(29,46,36)
/
(50,18,32)
(36,30,23)
(36,31,40)
Cerebras-6.7B
(18,68,24)
(18,50,32)
/
(28,39,24)
(24,46,21)
OPT-7B
(26,52,28)
(30,36,23)
(39,28,24)
/
(30,32,38)
Pythia-6.9B
(28,35,31)
(31,36,40)
(46,24,21)
(32,30,38)
/
+
+Table 2: Comparison between Human Annotation results and Judged Model evaluation results.
+
+
Judged Model
Accuracy
Precision
Recall
F1
GPT-3.5
0.6296
0.6195
0.6359
0.5820
GPT-4
0.6647
0.6620
0.6815
0.6180
PandaLM-7B
0.5926
0.5728
0.5923
0.5456
PandaLM-70B,LoRA
0.6186
0.7757
0.6186
0.6654
PandaLM-70B
0.6687
0.7402
0.6687
0.6923
+
+personally identifiable information or offensive content, and all annotators receive redundant labor fees.
+
+After obtaining the human-labeled test dataset, we can assess and compare the evaluation performances of GPT-3.5, GPT-4, and PandaLM. An interesting observation from Table 1 is the shared similar partial order graph between GPT-3.5, GPT-4, PandaLM-7B, and humans. Furthermore, Figure 4 illustrates directed orders of model superiority (if model A outperforms model B, a directed edge from A to B is drawn; if model A and model B perform similarly, a dashed line from A to B is drawn.), and provides a visual representation of comparative model effectiveness. The experimental results indicate similarities in the preferences of GPT-3.5, GPT-4, PandaLM-7B, and humans. Note that for PandaLM, GPT-3.5, and GPT-4, we swap the input response order and infer twice to procure the final evaluation output. The conflicting evaluation results are revised to 'Tie'.
+
+As shown in Table 2, we conduct a statistical analysis comparing the accuracy, precision, recall, and F1-score of GPT-3.5, GPT-4, and PandaLM against human annotations. The performance of PandaLM-70B even surpasses that of GPT-4. The results indicate the efficacy of removing noise in training data and the choosing of foundational model architectures and instructions.
+
+To prove the robustness and adaptability of PandaLM across distribution shifts, we also concentrate our evaluations on distinct areas, with a particular emphasis on the legal (LSAT) and biological (PubMedQA and BioASQ) domains. The introduction of the used datasets can be found at Appendix D. Note that for generating responses, we employ open-sourced language models such as Vicuna and Alpaca. Due to constraints in time, GPT-4 is adopted to produce the gold standard answers (win/tie/lose of responses) instead of human annotators. The results illustrated in Table 3 underscore PandaLM's prowess not only in general contexts but also in specific domains such as law (via LSAT) and biology (via PubMedQA and BioASQ). Since we are addressing a three-category classification task (win/lose/tie), where a random guess would lead to around $33\%$ in the precision, recall, and F1 score. PandaLM-7B's results are notably above this level. To further validate PandaLM-7B, we conducted a human evaluation with 30 samples on the BioASQ evaluation. The human evaluation showed that both PandaLM-7B and GPT-4 tended to favor Vicuna over Alpaca, indicating a consistent trend in their evaluations. The marked improvement in performance as the model scales up reaffirms PandaLM's promise across varied applications, further emphasizing its reliability amidst different content distributions.
+
+We further investigate the performance of PandaLM by contrasting its efficacy when trained solely on numerical comparisons (win/tie/lose) — akin to a traditional reward model — with the holistic
+
+Table 3: Performance evaluation of PandaLM across diverse domains. The table showcases the accuracy, precision, recall, and F1 scores achieved by PandaLM of two different sizes (finetuned from LLaMA-7B and LLaMA2-70B) on three distinct datasets: LSAT, PubMedQA, and BioASQ. These datasets are representative of the legal and biological domains, chosen to demonstrate the robustness and adaptability of PandaLM to different distribution shifts. It's worth noting that GPT-4 was employed for generating the gold standard answers instead of human annotations.
+
+
Accuracy
Precision
Recall
F1 Score
LSAT (PandaLM-7B)
0.4717
0.7289
0.4717
0.5345
LSAT (PandaLM-70B)
0.6604
0.7625
0.6604
0.6654
PubMedQA (PandaLM-7B)
0.6154
0.8736
0.6154
0.6972
PubMedQA (PandaLM-70B)
0.7692
0.7811
0.7692
0.7663
BioASQ (PandaLM-7B)
0.5152
0.7831
0.5152
0.5602
BioASQ (PandaLM-70B)
0.7727
0.8076
0.7727
0.7798
+
+Table 4: Comparison of PandaLM performance w/ and w/o reasons and references.
+
+
Accuracy
Precision
Recall
F1 Score
PandaLM-7B with only win/tie/lose
0.4725
0.4505
0.4725
0.3152
PandaLM-7B
0.5926
0.5728
0.5923
0.5456
+
+Table 5: Evaluation of the effectiveness of PandaLM's selected hyperparameters and Alpaca's hyperparameters. The tuple in the table means (#win,#lose,#tie). Specifically, (45,26,99) in the first line of the table indicates that PandaLM's hyperparameter-tuned LLaMA-7B outperforms Alpaca's version in 45 responses, underperforms in 26, and matches the quality in 99 instances. The 'Judged By' column represents different methods of response evaluation.
+
+
Judge Model
LLaMA-7B
Bloom-7B
Cerebras-6.7B
OPT-7B
Pythia-6.9B
GPT-3.5
(45,26,99)
(48,24,98)
(58,21,91)
(48,34,88)
(59,20,91)
GPT-4
(40,17,113)
(44,34,92)
(60,20,90)
(39,30,101)
(52,30,88)
Human
(82,21,67)
(79,23,68)
(88,25,57)
(68,26,76)
(82,31,57)
+
+approach of the standard PandaLM that incorporates evaluation reasons and reference responses. As shown in Table 4, it become evident that the evaluation reasons and reference responses significantly aid LLMs in understanding the evaluation tasks. Note that in Appendix G, the results clearly demonstrate that a smaller model, when precisely tuned, has the capability to outperform a larger, untuned model in evaluation metrics. This finding emphasizes the significant impact of targeted tuning on model performance in evaluation scenarios. We also provide an analysis on PandaLM across model shifts in Appendix K.
+
+In addition, beyond performance metrics, PandaLM introduces unique advantages that are not present in models like GPT-3.5 and GPT-4. It offers open-source availability, enabling reproducibility, and protecting data privacy. Furthermore, it provides unlimited access, removing any restrictions that might hinder comprehensive evaluation and application.
+
+# 5 USING PANDALM TO INSTRUCTION TUNE LLMS
+
+To highlight the effectiveness of using PandaLM for instruction tuning LLMs, we compare the performance of models tuned with PandaLM's selected optimal hyperparameters against those tuned with Alpaca's parameters using GPT-3.5, GPT-4, and human experts. It is noteworthy that PandaLM-7B is employed for this comparison due to considerations regarding computational resources. Given the proven effectiveness of PandaLM-7B, there is a grounded expectation that the performance of PandaLM-70B will exhibit further enhancement. This comparison evaluates multiple tuned LLMs: LLaMA-7B, Bloom-7B, Cerebras-GPT-6.7B, OPT-7B, and Pythia-6.9B. The assessment is conducted on a validation set comprising 170 distinct instructions and inputs obtained from our 1K test set introduced in Section 4. Alpaca's tuning protocol involves training for three epochs with the final iteration's checkpoints being used. It uses the AdamW (Loshchilov & Hutter, 2017) optimizer with a learning rate of 2e-5 and a cosine learning rate scheduler. We perform a wider range of hyperparameters to tune LLMs using PandaLM-7B. Specifically, we explore checkpoints from each epoch (ranging from epoch 1 to epoch 5), four different learning rates (2e-6, 1e-5, 2e-5, 2e-4), two types of optimizers (SGD (Goodfellow et al., 2016) and AdamW), and two learning rate schedulers (cosine and linear). In total, this creates a configuration space of 80 different possibilities per model.
+
+We search for optimal hyperparameters among the 80 configurations. These are divided into four blocks, each containing 20 configurations. Sequential comparisons identify the best configuration in each block. The top configurations from each block are then compared to determine the overall best configuration. We repeat each comparison twice for robustness and carry out 800 comparisons in total. The conflicting evaluation results are modified to 'Tie'. Key insights from our tuning process include: Bloom-7B performs best with SGD, a learning rate of 2e-5, and a cosine schedule over 5 epochs. Cerebras-GPT-6.7B also favors SGD with the same learning rate but with a linear schedule. LLaMA-7B prefers AdamW, a learning rate of 1e-5, and a linear schedule over 4 epochs. OPT-6.7B achieves top results with AdamW, a learning rate of 2e-5, and a linear scheduler over 5 epochs. Pythia-6.9B prefers SGD, a learning rate of 1e-5, a cosine schedule, and 5 epochs. This highlights the importance of customized hyperparameter tuning for different models to achieve peak performance. We also provide the analysis on data size, quality and LoRA in Appendix E and Appedix F.
+
+As illustrated in Table 5, for GPT-3.5, GPT-4, and human, all base models achieve superior performance when tuned with PandaLM's selected hyperparameters compared to Alpaca's hyperparameters. Note that the procedure of switching the order of input responses, as applied for PandaLM, is also implemented for GPT-3.5 and GPT-4 to acquire more robust evaluation results. This outcome not only supports the claim that PandaLM-7B can enhance the performance of models but also highlights its potential to further improve various large language models. Besides, as shown in Appendix B, based on PandaLM's evaluation, the model demonstrating superior performance is LLaMA-PandaLM. Note that the base foundation model's characteristics can be a significant factor in performance, as evidenced by LLaMA models securing the top two positions. The ranking pattern observed aligns closely with the base model rankings presented in Figure 4. We also provide a hyperparameter optimization analysis in Appendix J.
+
+Moreover, Table 6 in Appendix C compares fine-tuned LLMs on various traditional tasks with lm-eval (Gao et al., 2021). Interestingly, while most language models display enhanced performance with PandaLM finetuning, Cerebras experiences a dip. This underscores the value of subjective evaluation (win/tie/lose of responses), as evaluations from humans, GPT-4, and GPT-3.5 all indicate superior performance for Cerebras with PandaLM.
+
+# 6 LIMITATIONS
+
+While the outcomes of our study are encouraging, we discuss several limitations here. Firstly, the selected range of hyperparameters used in this work is based on common practice and prior literature, and thus may not encompass the absolute optimal hyperparameters. While extending the search bond will inevitably increase the computational cost. While the core data, derived from GPT-3.5, may not fully resonate with human preferences, it's essential to recognize that the efficacy of LLMs hinges not just on training data but also on foundational model architectures and instructions. Currently, our emphasis is primarily on outcome-based evaluation, which is indeed resource-intensive. However, integrating behavior prediction (e.g., using rational analysis Lu et al. (2022); Wang et al. (2023d; 2020); Yang et al. (2021; 2023a)) into an evaluation framework could offer a more comprehensive understanding of LLM performance. For instance, analyzing and evaluating the extended text outputs of an untuned LLM can help predict how a tuned version might behave in various scenarios. This approach could provide a more efficient and insightful way to balance resource-heavy outcome assessments. Besides, we only research on supervised training of LLMs, but the realistic data could be imbalanced or unlabeled, hence semi-supervised Wang et al. (2023e); Chen et al. (2023); Wang et al. (2022b), noisy Zhang et al. (2022b); Chen et al. (2024) and imbalanced training Yang et al. (2022b); Wang et al. (2023f,g) are also our future directions.
+
+# 7 CONCLUSION
+
+In our exploration of hyperparameter optimization, we apply PandaLM: an automatic and reliable judge model for the tuning of LLMs. Our findings demonstrate that the use of PandaLM is feasible and consistently produces models of superior performance compared to those tuned with Alpaca's default parameters. We are dedicated to continually enhancing PandaLM by expanding its capacity to support larger models and analyzing its intrinsic features, thereby developing increasingly robust versions of the judging model in the future.
+
+# ACKNOWLEDGEMENT
+
+We would like to thank the anonymous reviewers for their insightful comments and suggestions to help improve the paper. This publication has emanated from research conducted with the financial support of the Pioneer and "Leading Goose" R&D Program of Zhejiang under Grant Number 2022SDXHDX0003 and the National Natural Science Foundation of China Key Program under Grant Number 62336006.
+
+# REFERENCES
+
+Donnie Adams and Kee-Man Chuah. Artificial intelligence-based tools in research writing: Current trends and future potentials. Artificial Intelligence in Higher Education, pp. 169-184, 2022.
+Rohan Anil, Andrew M Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos, Siamak Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. Palm 2 technical report. arXiv preprint arXiv:2305.10403, 2023.
+Edward Beeching, Sheon Han, Nathan Lambert, Nazneen Rajani, Omar Sanseviero, Lewis Tunstall, and Thomas Wolf. Open llm leaderboard. https://huggingface.co/spaces/HuggingFaceH4/open_11m_leaderboard, 2023.
+Stella Biderman, Hailey Schoelkopf, Quentin Anthony, Herbie Bradley, Kyle O'Brien, Eric Hallahan, Mohammad Aflah Khan, Shivanshu Purohit, USVSN Sai Prashanth, Edward Raff, et al. Pythia: A suite for analyzing large language models across training and scaling. arXiv preprint arXiv:2304.01373, 2023.
+Som Biswas. Chatgpt and the future of medical writing, 2023.
+Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020.
+Yupeng Chang, Xu Wang, Jindong Wang, Yuan Wu, Kaijie Zhu, Hao Chen, Linyi Yang, Xiaoyuan Yi, Cunxiang Wang, Yidong Wang, et al. A survey on evaluation of large language models. arXiv preprint arXiv:2307.03109, 2023.
+Sahil Chaudhary. Code alpaca: An instruction-following llama model for code generation. https://github.com/sahil280114/codealpaca, 2023.
+Hao Chen, Ran Tao, Yue Fan, Yidong Wang, Jindong Wang, Bernt Schiele, Xing Xie, Bhiksha Raj, and Marios Savvides. Softmatch: Addressing the quantity-quality trade-off in semi-supervised learning. 2023.
+Hao Chen, Jindong Wang, Lei Feng, Xiang Li, Yidong Wang, Xing Xie, Masashi Sugiyama, Rita Singh, and Bhiksha Raj. A general framework for learning from weak supervision. arXiv preprint arXiv:2402.01922, 2024.
+Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E Gonzalez, et al. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ chatgpt quality. See https://vicuna.lmsys.org (accessed 14 April 2023), 2023.
+Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
+Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
+Jacob Cohen. Kappa: Coefficient of concordance. Educ Psych Measurement, 20(37):37-46, 1960.
+
+Nolan Dey, Gurpreet Gosal, Hemant Khachane, William Marshall, Ribhu Pathria, Marvin Tom, Joel Hestness, et al. Cerebras-gpt: Open compute-optimal language models trained on the cerebras wafer-scale cluster. arXiv preprint arXiv:2304.03208, 2023.
+Shizhe Diao, Rui Pan, Hanze Dong, KaShun Shum, Jipeng Zhang, Wei Xiong, and Tong Zhang. Lmflow: An extensible toolkit for finetuning and inference of large foundation models. https://optimalscale.github.io/LmFlow/, 2023.
+Jesse Dodge, Gabriel Ilharco, Roy Schwartz, Ali Farhadi, Hannaneh Hajishirzi, and Noah Smith. Fine-tuning pretrained language models: Weight initializations, data orders, and early stopping. arXiv preprint arXiv:2002.06305, 2020.
+Qingxiu Dong, Lei Li, Damai Dai, Ce Zheng, Zhiyong Wu, Baobao Chang, Xu Sun, Jingjing Xu, and Zhifang Sui. A survey on in-context learning. arXiv preprint arXiv:2301.00234, 2022.
+Stefan Falkner, Aaron Klein, and Frank Hutter. Bohb: Robust and efficient hyperparameter optimization at scale. In International Conference on Machine Learning, pp. 1437-1446. PMLR, 2018.
+Leo Gao, Jonathan Tow, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Kyle McDonell, Niklas Muennighoff, Jason Phang, Laria Reynolds, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. A framework for few-shot language model evaluation, September 2021. URL https://doi.org/10.5281/zenodo.5371628.
+Varun Godbole, George E. Dahl, Justin Gilmer, Christopher J. Shallue, and Zachary Nado. Deep learning tuning playbook, 2023. URL http://github.com/google-research/tuningPlaybook. Version 1.0.
+Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
+Google.Bard.2023
+Zishan Guo, Renren Jin, Chuang Liu, Yufei Huang, Dan Shi, Linhao Yu, Yan Liu, Jiaxuan Li, Bojian Xiong, Deyi Xiong, et al. Evaluating large language models: A comprehensive survey. arXiv preprint arXiv:2310.19736, 2023.
+Lynette Hirschman and Robert Gaizauskas. Natural language question answering: the view from here. natural language engineering, 7(4):275-300, 2001.
+Edward J Hu, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, Weizhu Chen, et al. Lora: Low-rank adaptation of large language models. In International Conference on Learning Representations.
+Yunjie Ji, Yong Deng, Yiping Peng Yan Gong, Qiang Niu, Lei Zhang, Baochang Ma, and Xiangang Li. Exploring the impact of instruction data scaling on large language models: An empirical study on real-world use cases. arXiv preprint arXiv:2303.14742, 2023.
+Jacob Devlin Ming-Wei Chang Kenton and Lee Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT, pp. 4171-4186, 2019.
+Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453-466, 2019.
+Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research, 18(1):6765-6816, 2017.
+Richard Liaw, Eric Liang, Robert Nishihara, Philipp Moritz, Joseph E Gonzalez, and Ion Stoica. Tune: A research platform for distributed model selection and training. arXiv preprint arXiv:1807.05118, 2018.
+
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+Jinghui Lu, Linyi Yang, Brian Mac Namee, and Yue Zhang. A rationale-centric framework for human-in-the-loop machine learning. arXiv preprint arXiv:2203.12918, 2022.
+Carlo A Mallio, Andrea C Sertorio, Caterina Bernetti, and Bruno Beomonte Zobel. Large language models for structured reporting in radiology: performance of gpt-4, chatgpt-3.5, perplexity and bing. La radiologia medica, pp. 1-5, 2023.
+OpenAI. Gpt-4 technical report. 2023.
+Yassine Ouali, Céline Hudelot, and Myriam Tami. An overview of deep semi-supervised learning. arXiv preprint arXiv:2006.05278, 2020.
+Baolin Peng, Chunyuan Li, Pengcheng He, Michel Galley, and Jianfeng Gao. Instruction tuning with gpt-4. arXiv preprint arXiv:2304.03277, 2023.
+Krishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun, Sean Welleck, Yejin Choi, and Zaid Harchaoui. Mauve: Measuring the gap between neural text and human text using divergence frontiers. Advances in Neural Information Processing Systems, 34:4816-4828, 2021.
+Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. Improving language understanding by generative pre-training.
+Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. Zero: Memory optimizations toward training trillion parameter models. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1-16. IEEE, 2020.
+Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 3505-3506, 2020.
+Jie Ren, Samyam Rajbhandari, Reza Yazdani Aminabadi, Olatunji Ruwase, Shuangyan Yang, Minjia Zhang, Dong Li, and Yuxiong He. Zero-offload: Democratizing billion-scale model training. In USENIX Annual Technical Conference, pp. 551-564, 2021.
+Anna Rogers, Olga Kovaleva, and Anna Rumshisky. A primer in bertology: What we know about how bert works. Transactions of the Association for Computational Linguistics, 8:842-866, 2021.
+Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2022.
+Anastasia Shimorina and Anya Belz. The human evaluation datasheet: A template for recording details of human evaluation experiments in NLP. In Proceedings of the 2nd Workshop on Human Evaluation of NLP Systems (HumEval), pp. 54-75, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.humeval-1.6. URL https://aclanthology.org/2022.humeval-1.6.
+Felix Stahlberg. Neural machine translation: A review. Journal of Artificial Intelligence Research, 69:343-418, 2020.
+Chi Sun, Xipeng Qiu, Yige Xu, and Xuanjing Huang. How to fine-tune bert for text classification? In Chinese Computational Linguistics: 18th China National Conference, CCL 2019, Kunming, China, October 18-20, 2019, Proceedings 18, pp. 194-206. Springer, 2019.
+Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning, pp. 6105-6114. PMLR, 2019.
+Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
+
+Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
+Lewis Tunstall, Leandro Von Werra, and Thomas Wolf. Natural language processing with transformers. "O'Reilly Media, Inc.", 2022.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
+Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations.
+Chi Wang, Susan Xueqing Liu, and Ahmed H Awadallah. Cost-effective hyperparameter optimization for large language model generation inference. arXiv preprint arXiv:2303.04673, 2023a.
+Cunxiang Wang, Shuailong Liang, Yue Zhang, Xiaonan Li, and Tian Gao. Does it make sense? and why? a pilot study for sense making and explanation, 2020.
+Cunxiang Wang, Pai Liu, and Yue Zhang. Can generative pre-trained language models serve as knowledge bases for closed-book qa?, 2021.
+Cunxiang Wang, Sirui Cheng, Qipeng Guo, Yuanhao Yue, Bowen Ding, Zhikun Xu, Yidong Wang, Xiangkun Hu, Zheng Zhang, and Yue Zhang. Evaluating open-QA evaluation. In Thirty-seventh Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2023b. URL https://openreview.net/forum?id=UErNpveP6R.
+Cunxiang Wang, Xiaoze Liu, Yuanhao Yue, Xiangru Tang, Tianhang Zhang, Cheng Jiayang, Yunzhi Yao, Wenyang Gao, Xuming Hu, Zehan Qi, Yidong Wang, Linyi Yang, Jindong Wang, Xing Xie, Zheng Zhang, and Yue Zhang. Survey on factuality in large language models: Knowledge, retrieval and domain-specificity, 2023c.
+Cunxiang Wang, Haofei Yu, and Yue Zhang. RFiD: Towards rational fusion-in-decoder for open-domain question answering. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (eds.), Findings of the Association for Computational Linguistics: ACL 2023, pp. 2473-2481, Toronto, Canada, July 2023d. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-acl.155. URL https://aclanthology.org/2023-findings-acl.155.
+Yidong Wang, Hao Chen, Yue Fan, Wang Sun, Ran Tao, Wenxin Hou, Renjie Wang, Linyi Yang, Zhi Zhou, Lan-Zhe Guo, Heli Qi, Zhen Wu, Yu-Feng Li, Satoshi Nakamura, Wei Ye, Marios Savvides, Bhiksha Raj, Takahiro Shinozaki, Bernt Schiele, Jindong Wang, Xing Xie, and Yue Zhang. Usb: A unified semi-supervised learning benchmark for classification. In Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2022a. doi: 10.48550/ARXIV.2208.07204. URL https://arxiv.org/abs/2208.07204.
+Yidong Wang, Hao Wu, Ao Liu, Wenxin Hou, Zhen Wu, Jindong Wang, Takahiro Shinozaki, Manabu Okumura, and Yue Zhang. Exploiting unlabeled data for target-oriented opinion words extraction. arXiv preprint arXiv:2208.08280, 2022b.
+Yidong Wang, Hao Chen, Qiang Heng, Wenxin Hou, Yue Fan, , Zhen Wu, Jindong Wang, Marios Savvides, Takahiro Shinozaki, Bhiksha Raj, Bernt Schiele, and Xing Xie. Freematch: Self-adaptive thresholding for semi-supervised learning. 2023e.
+Yidong Wang, Zhuohao Yu, Jindong Wang, Qiang Heng, Hao Chen, Wei Ye, Rui Xie, Xing Xie, and Shikun Zhang. Exploring vision-language models for imbalanced learning. International Journal of Computer Vision, 2023f.
+Yidong Wang, Bowen Zhang, Wenxin Hou, Zhen Wu, Jindong Wang, and Takahiro Shinozaki. Margin calibration for long-tailed visual recognition. In Asian Conference on Machine Learning, pp. 1101-1116. PMLR, 2023g.
+
+Yiming Wang, Zhuosheng Zhang, and Rui Wang. Element-aware summarization with large language models: Expert-aligned evaluation and chain-of-thought method. arXiv preprint arXiv:2305.13412, 2023h.
+Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A Smith, Daniel Khashabi, and Hannaneh Hajishirzi. Self-instruct: Aligning language model with self generated instructions. arXiv preprint arXiv:2212.10560, 2022c.
+Jia Wu, Xiu-Yun Chen, Hao Zhang, Li-Dong Xiong, Hang Lei, and Si-Hao Deng. Hyperparameter optimization for machine learning models based on bayesian optimization. Journal of Electronic Science and Technology, 17(1):26-40, 2019.
+Canwen Xu, Daya Guo, Nan Duan, and Julian McAuley. Baize: An open-source chat model with parameter-efficient tuning on self-chat data. arXiv preprint arXiv:2304.01196, 2023.
+Liang Xu, Hai Hu, Xuanwei Zhang, Lu Li, Chenjie Cao, Yudong Li, Yechen Xu, Kai Sun, Dian Yu, Cong Yu, et al. Clue: A Chinese language understanding evaluation benchmark. In Proceedings of the 28th International Conference on Computational Linguistics, pp. 4762-4772, 2020.
+Linyi Yang, Jiazheng Li, Pádraig Cunningham, Yue Zhang, Barry Smyth, and Ruihai Dong. Exploring the efficacy of automatically generated counterfactuals for sentiment analysis. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 306-316, 2021.
+Linyi Yang, Shuibai Zhang, Libo Qin, Yafu Li, Yidong Wang, Hanmeng Liu, Jindong Wang, Xing Xie, and Yue Zhang. Glue-x: Evaluating natural language understanding models from an out-of-distribution generalization perspective. arXiv preprint arXiv:2211.08073, 2022a.
+Linyi Yang, Yaoxian Song, Xuan Ren, Chenyang Lyu, Yidong Wang, Jingming Zhuo, Lingqiao Liu, Jindong Wang, Jennifer Foster, and Yue Zhang. Out-of-distribution generalization in natural language processing: Past, present, and future. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 4533-4559, 2023a.
+Linyi Yang, Shuibai Zhang, Zhuohao Yu, Guangsheng Bao, Yidong Wang, Jindong Wang, Ruochen Xu, Wei Ye, Xing Xie, Weizhu Chen, et al. Supervised knowledge makes large language models better in-context learners. arXiv preprint arXiv:2312.15918, 2023b.
+Lu Yang, He Jiang, Qing Song, and Jun Guo. A survey on long-tailed visual recognition. International Journal of Computer Vision, 130(7):1837-1872, 2022b.
+Tong Yu and Hong Zhu. Hyper-parameter optimization: A review of algorithms and applications. arXiv preprint arXiv:2003.05689, 2020.
+Zhuohao Yu, Chang Gao, Wenjin Yao, Yidong Wang, Wei Ye, Jindong Wang, Xing Xie, Yue Zhang, and Shikun Zhang. Kieval: A knowledge-grounded interactive evaluation framework for large language models. arXiv preprint arXiv:2402.15043, 2024.
+Aohan Zeng, Xiao Liu, Zhengxiao Du, Zihan Wang, Hanyu Lai, Ming Ding, Zhuoyi Yang, Yifan Xu, Wendi Zheng, Xiao Xia, et al. Glm-130b: An open bilingual pre-trained model. arXiv preprint arXiv:2210.02414, 2022a.
+Zhengran Zeng, Hanzhuo Tan, Haotian Zhang, Jing Li, Yuqun Zhang, and Lingming Zhang. An extensive study on pre-trained models for program understanding and generation. In Sukyoung Ryu and Yannis Smaragdakis (eds.), ISSTA '22: 31st ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual Event, South Korea, July 18 - 22, 2022, pp. 39-51. ACM, 2022b. doi: 10.1145/3533767.3534390. URL https://doi.org/10.1145/3533767.3534390.
+Chen Zhang, Yu Xie, Hang Bai, Bin Yu, Weihong Li, and Yuan Gao. A survey on federated learning. Knowledge-Based Systems, 216:106775, 2021a.
+Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022a.
+
+Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. Bertscore: Evaluating text generation with bert. In International Conference on Learning Representations, 2019.
+Xin Zhang, Guangwei Xu, Yueheng Sun, Meishan Zhang, and Pengjun Xie. Crowdsourcing learning as domain adaptation: A case study on named entity recognition. In Chengqing Zong, Fei Xia, Wenjie Li, and Roberto Navigli (eds.), Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 5558-5570, Online, August 2021b. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.432. URL https://aclanthology.org/2021.acl-long.432.
+Xin Zhang, Guangwei Xu, Yueheng Sun, Meishan Zhang, Xiaobin Wang, and Min Zhang. Identifying Chinese opinion expressions with extremely-noisy crowdsourcing annotations. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio (eds.), Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2801-2813, Dublin, Ireland, May 2022b. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.200. URL https://aclanthology.org/2022.acl-long.200.
+Xin Zhang, Zehan Li, Yanzhao Zhang, Dingkun Long, Pengjun Xie, Meishan Zhang, and Min Zhang. Language models are universal embeddings. arXiv preprint arXiv:2310.08232, 2023.
+Lianmin Zheng, Ying Sheng, Wei-Lin Chiang, Hao Zhang, Joseph Gonzalez, E., and Ion Stoica. Chatbot arena: Benchmarking llms in the wild with elo ratings. *GitHub repository*, 2023.
+Qihuang Zhong, Liang Ding, Juhua Liu, Bo Du, and Dacheng Tao. Can chatgpt understand too? a comparative study on chatgpt and fine-tuned bert. arXiv preprint arXiv:2302.10198, 2023.
+
+
+Figure 5: A training data example for PandaLM.
+
+
+Figure 6: The prompt for training PandaLM.
+
+# A TRAINING PROMPT DETAILS
+
+We introduce the detailed prompt of training PandaLM in Figure 6.
+
+# B DIRECTED ACYCLIC GRAPH DEPICTING THE MIXTURE RANKING OF MODELS TRAINED USING BOTH ALPACA'S AND PANDALM'S HYPERPARAMETERS.
+
+A directed acyclic graph (DAG) is presented in Figure 7, illustrating the relative rankings of various models fine-tuned with different sets of hyperparameters. Notably, this ranking differs from those in Figure4, due to the variance in the test data: the test data for 7 is a sampled subset from that used in Figure4 which is deliberately chosen to ensure a high Inter-Annotator Agreement (IAA). A discernible pattern emerges from the rankings: models fine-tuned using PandaLM's hyperparameters consistently outshine their counterparts fine-tuned with Alpaca's. The top-rated model is PandaLM-LLaMA, followed by Alpaca-LLaMA, PandaLM-Bloom, PandaLM-Pythia, PandaLM-OPT, PandaLM-Cerebras-GPT, Alpaca-OPT, Alpaca-Bloom, Alpaca-Pythia, and Alpaca-Cerebras-GPT, in descending order of performance. This juxtaposition accentuates the effectiveness of PandaLM's hyperparameter selection in improving model performance, as models optimized with PandaLM consistently rank higher than those using Alpaca's hyperparameters in the hybrid ranking. These findings underscore the potential of PandaLM as a powerful tool in enhancing the performance of large language models, further supporting the assertion of its efficacy.
+
+
+Figure 7: Directed Acyclic Graph depicting the mixture ranking of models trained using both Alpaca's and PandaLM's hyperparameters. The models are ranked from strongest to weakest in the following order: PandaLM-LLaMA, Alpaca-LLaMA, PandaLM-Bloom, PandaLM-Pythia, PandaLM-OPT, PandaLM-Cerebras-GPT, Alpaca-OPT, Alpaca-Bloom, Alpaca-Pythia, Alpaca-Cerebras-GPT.
+
+Table 6: Comparison on several downstream tasks using lm-eval(Gao et al., 2021) between foundation models fine-tuned on Alpaca's hyperparameters, and foundation models fine-tuned with PandaLM. Note that the MMLU task consists of 57 subtasks, which means providing a comprehensive standard deviation here is not feasible.
+
+
ARC-Challenge-acc_norm(25-shot)
Hellaswag-acc_norm(10-shot)
MMLU-average-acc(5-shot)
TruthfulQA-mc2(0-shot)
Average
llama-7b original
0.4923±0.0146
0.7583±0.0043
0.3306
0.3703±0.0141
0.4879
llama-7b w/ PandaLM
0.5162±0.0146
0.7764±0.0042
0.3396
0.3801±0.0145
0.5031
opt-6.7b original
0.3805±0.0142
0.6535±0.0047
0.2476
0.3587±0.0139
0.4101
opt-6.7b w/ PandaLM
0.3771±0.0142
0.6540±0.0047
0.2502
0.3609±0.0142
0.4106
pythia-6.9b original
0.3848±0.0142
0.6093±0.0049
0.2490
0.4187±0.0148
0.4155
pythia-6.9b w/ PandaLM
0.4130±0.0144
0.6337±0.0048
0.2581
0.3972±0.0144
0.4255
bloom-7b original
0.3985±0.0143
0.6086±0.0049
0.2635
0.3975±0.0148
0.4170
bloom-7b w/ PandaLM
0.3951±0.0143
0.6084±0.0049
0.2520
0.3997±0.0149
0.4138
Cerebras-GPT-6.7B original
0.3524±0.0140
0.5613±0.0050
0.2584
0.3624±0.0140
0.3836
Cerebras-GPT-6.7B w/ PandaLM
0.3558±0.0140
0.5550±0.0050
0.2452
0.3448±0.0141
0.3752
+
+# C COMPARISONS BETWEEN ORIGINAL MODELS AND MODELS TUNED USING PANDALM ON TRADITIONAL TASKS
+
+We compare fine-tuned LLMs on various traditional tasks with lm-eval (Gao et al., 2021). Although the majority of language models exhibit improved performance after finetuning with PandaLM, Cerebras exhibits a decline. This highlights the importance of nuanced, subjective evaluations (win/tie/lose of responses). Human evaluations, as well as assessments from GPT-4 and GPT-3.5, all concur in indicating a better performance from Cerebras when paired with PandaLM. This is also confirmed in (Yu et al., 2024).
+
+As shown in Table 7, the evaluation results of language models show that lower perplexity, indicating better predictive ability in pretraining or other tasks, does not always mean better overall performance of instruction-tuned models. For example, LLaMA-PandaLM has a higher perplexity than LLaMA-Alpaca but outperforms it in both pairwise comparisons (PandaLM, GPT, Human) and traditional
+
+Table 7: Analysis on perplexity and other evaluation metrics. Note that we report the win rate over 170 samples of PandaLM, GPT, and Human.
+
+
Model
Perplexity (↓)
PandaLM-7B (↑)
PandaLM-70B (↑)
GPT-3.5 (↑)
GPT-4 (↑)
Human (↑)
lm-eval avg. score (↑)
LLaMA-Alpaca
2.75
15.88%
22.94%
15.29%
10.00%
12.35%
0.4879
LLaMA-PandaLM
2.81
19.41%
35.88%
26.47%
23.53%
48.24%
0.5031
+
+tasks (lm-eval). This suggests that while perplexity is not feasible for instruction-tuned models where lower perplexity might mean overfitting and less generalizability.
+
+# D LAW / BIOMEDICAL DATASETS INTRODUCTION
+
+Specifically, we assess PandaLM's proficiency using the LSAT (Law School Admission Test) dataset, which serves as an entrance exam question set for American law schools. This dataset incorporates 1,009 questions, further divided into three subsets: AR, LR, and RC. In the realm of biomedicine, we use the PubMedQA dataset—a vast repository for biomedical retrieval QA data, boasting 1k expert annotations, 61.2k unlabeled entries, and a massive 211.3k human-generated QA instances. For our evaluation, we rely on the labeled section (PubMedQA-1) that contains 1k instances. Each instance encompasses a question, context, and label. Additionally, we tap into the BioASQ dataset, specifically leveraging the task b dataset from its 11th challenge. This dataset is renowned for its biomedical semantic indexing and question-answering (QA) capabilities. From it, we use 1k samples for our assessment. We will test code/math dataset Cobbe et al. (2021); Zeng et al. (2022b) in future work.
+
+# E DATA SIZE AND QUALITY ANALYSIS IN INSTRUCTION TUNING
+
+We conduct an ablation study to investigate the impact of training data size (up to 1,344,000) on the performance of the model, given optimal hyperparameters. Importantly, a relationship exists between the size and quality of training data. Thus, we focus on an ablation study of data size here, but conducting a similar experiment on data quality is feasible. We derive the results from PandaLM-7B. The objective is to discern how much training data is required to reach each model's peak performance. Table 8 reveals the optimal quantity of training data varies among models. More training data typically enhances model performance. However, an optimal point exists for each model, beyond which further data doesn't improve performance. For example, the OPT model peaks at 992,000 data points, indicating additional data does not enhance the model's performance.
+
+Table 8: Optimal training data size for each model.
+
+
Model
Bloom
Cerebras-GPT
LLaMA
OPT
Pythia
Optimal Training Data Size
1,216,000
1,344,000
11,520,000
992,000
1,344,000
+
+# F LORA ANALYSIS IN INSTRUCTION TUNING
+
+We further aim to evaluate the efficacy of Low-Rank Adaptation (LoRA) (Hu et al.) compared to full fine-tuning across various models, utilizing optimal hyperparameters. The results are also obtained from PandaLM-7B. Our analysis seeks to provide a comparative understanding of these tuning methodologies. As shown in Table 9, the results for the Bloom model reveal a distinct advantage for full fine-tuning, which triumphs over LoRA in 66 instances as opposed to LoRA's 35. Notably, they tie in 69 instances. In the case of the Cerebras model, full fine-tuning again proves superior, leading in 59 cases compared to LoRA's 40, despite drawing even 71 times. The trend of full fine-tuning superiority is consistent in the LLaMA model. Out of 170 instances, full fine-tuning results in better performance in 48 instances, whereas LoRA emerges victorious in only 28 instances. The majority of the results are tied, amounting to 94 instances. In the OPT model, full fine-tuning once more showcases its advantage with 64 instances of superior performance compared to LoRA's 33, while recording a tie in 73 instances. Lastly, for the Pythia model, full fine-tuning leads the race with 71 instances of better performance against LoRA's 21, and a tie occurring in 78 instances. These results
+
+underscore that full fine-tuning generally yields more favorable results compared to the use of LoRA, though the outcomes can vary depending on the model. Despite the considerable number of ties, full fine-tuning holds the upper hand in most models, thereby highlighting its effectiveness. This suggests that while LoRA may provide comparable results in some instances, a strategy of full fine-tuning often proves to be the more beneficial approach in enhancing model performance.
+
+Table 9: Comparison of LoRA and Full Fine-tuning.
+
+
Model
LoRA Wins
Full Fine-tuning Wins
Ties
Bloom
35
66
69
Cerebras-GPT
40
59
71
LLaMA
28
48
94
OPT
33
64
73
Pythia
21
71
78
+
+# G LEVERAGING PRE-TRAINED MODELS AND OTHER INSTRUCTION TUNED MODELS FOR EVALUATION
+
+Employing LLMs for response evaluation without additional training is a natural direction for the task. However, implementing evaluation criteria through zero-shot or few-shot methods is challenging for LLMs due to the necessity for extended context lengths.
+
+We have undertaken experiments using zero-shot and few-shot (in-context learning Dong et al. (2022); Yang et al. (2023b)) evaluations with LLaMA. Our observations indicate that an un-tuned LLaMA struggles with adhering to user-specified format requirements. Consequently, our experiments focused on computing and comparing the log-likelihood of generating continuations (e.g., determining whether "Response 1 is better," "Response 2 is better," or if both responses are similar in quality) from the same context. We regard the choice with the highest log-likelihood as the prediction result. We also alternated response order in our experiments to reduce position bias. Furthermore, we undertook experiments with Vicuna, a finetuned version of LLaMA. The experiments demonstrated that the evaluation capabilities of instruction-tuned models possess significant potential for enhancement.
+
+The results in Table 10 highlight the importance of tailored tuning for evaluation, a precisely-tuned smaller model outperforms a larger one in zero and few-shot scenarios.
+
+# H ENHANCING PANDALM WITH REFINED SUPERVISION.
+
+In our supervision goal, we incorporate not only the comparative result of responses but also a succinct explanation and a reference response. This methodology augments PandaLM's comprehension of the evaluation criteria.
+
+Table 10: Ablation study of directly using pre-trained models and instruction tuned models for evaluation.
+
+
Model
Accuracy
Precision
Recall
F1 score
LLaMA-7B 0-shot (log-likelihood)
12.11
70.23
34.52
8.77
LLaMA-30B 0-shot (log-likelihood)
31.43
56.48
43.12
32.83
LLaMA-7B 5-shot (log-likelihood)
24.82
46.99
39.79
25.43
LLaMA-30B 5-shot (log-likelihood)
42.24
61.99
51.76
42.93
Vicuna-7B (log-likelihood)
15.92
57.53
34.90
14.90
Vicuna-13B (log-likelihood)
35.24
57.45
43.65
36.29
PandaLM-7B
59.26
57.28
59.23
54.56
PandaLM-7B (log-likelihood)
59.26
59.70
63.07
55.78
+
+Table 11: Ablation study of supervision goal.
+
+
Model
Accuracy
Precision
Recall
F1
PandaLM-7B (with only eval label)
0.4725
0.4505
0.4725
0.3152
PandaLM-7B
0.5926
0.5728
0.5923
0.5456
+
+To empirically gauge the significance of this explanation, an experiment was executed. Here, the explanation and reference were omitted during training, and only the categorical outcomes (0/1/2 or Tie/Win/Lose) were retained in the dataset for training a fresh iteration of PandaLM. The results, as depicted in Table 11, demonstrate that in the absence of the explanation, PandaLM encounters difficulties in precisely determining the preferable response.
+
+# I HUMAN EVALUATION DATASHEET
+
+We employ human annotators from a crowdsourcing company and pay them fairly. In particular, we pay our annotators 50 dollars per hour, which is above the average local income level. We have filled out the Google Sheet provided in (Shimorina & Belz, 2022).
+
+# J HYPERPARAMETER OPTIMIZATION ANALYSIS
+
+In our hyperparameter searching process, we explored a range of learning rates, epochs, optimizers, and schedulers. The learning rates tested varied from 2e-6 to 2e-4, with model checkpoints saved at the end of each epoch. Performance was rigorously assessed through pairwise comparisons between checkpoints, counting the win rounds for each model, as detailed in Figure 8.
+
+Our analysis, as depicted in Figure 8a, suggests a tendency towards a learning rate of 2e-5, although this preference was not uniformly clear across all models. Figure 8b demonstrates the variability in the optimal number of epochs, with a trend showing that peak performance often occurs around the fourth or fifth epoch. This evidence points to the complex interplay of hyperparameters with model performance, which is further influenced by data distribution, optimizer, and scheduler choices.
+
+The findings from our hyperparameter optimization process highlight that there is no universally optimal setting for different models and training setups. While a pattern emerged suggesting that a learning rate around 2e-5 and an epoch count near 4 might be beneficial in some cases, these results are not conclusive. This reinforces the need for specific hyperparameter searches for different models, as demonstrated in our visualizations. A tailored approach to hyperparameter optimization is essential, as it allows for a more nuanced understanding of model performance across various scenarios.
+
+Besides, we implemented an early stopping strategy using Pandalm. We focus specifically on LLaMA. Our experiments showed that in some cases, a model's performance at epoch 3 was inferior to that at epoch 2. However, subsequent epochs demonstrated performance improvements. This indicates that early stopping may not always be suitable for large model fine-tuning, as it could prematurely halt training before reaching optimal performance.
+
+Table 12: Analysis of PandaLM's Evaluation Capability on Unseen Models.
+
+
Model Comparison
PandaLM
Human
Metrics (P, R, F1)
llama1-7b vs llama2-7b
(23,61,16)
(23,70,7)
(0.7061, 0.7100, 0.6932)
llama1-13b vs llama2-13b
(18,73,9)
(20,68,12)
(0.7032, 0.6800, 0.6899)
llama1-65b vs llama2-70b
(20,66,14)
(34,56,10)
(0.7269, 0.6600, 0.6808)
+
+# K MODEL SHIFT ANALYSIS
+
+In Table 12, we provide a detailed comparison of PandaLM's performance against human benchmarks and in the context of different versions of instruction-tuned LLaMA models. Note that llama1-13b, llama1-65b and llama2 are indicative of model shift. The results demonstrate that PandaLM aligns
+
+
+(a) Comparison Results of GPT-4.
+
+
+(b) Comparison Results of Human.
+Figure 8: Hyperparameter Optimization Analysis in PandaLM. The figure illustrates the performance across different learning rates and variability in model performance across epochs.
+
+closely with humans, consistently showing a preference for the LLama-2 model. This alignment is in line with expectations, as LLama-2 benefits from more pre-training data. Such findings highlight the significance of extensive pre-training in developing language models that are more skilled at understanding and correctly responding to various instructions.
\ No newline at end of file
diff --git a/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/images.zip b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..3f7aa36153e502569794078d11b89df8765abfe3
--- /dev/null
+++ b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:36f0762c11316884455970d819c2969d0a793df7c1789e5000668f69b846edb0
+size 587819
diff --git a/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/layout.json b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f73b8dc73c2f165ff20cf1ab3bc1e64761547231
--- /dev/null
+++ b/pandalmanautomaticevaluationbenchmarkforllminstructiontuningoptimization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:62553ff364fe25099d3d46938be7daacf60d70ca64e710391a70c12a86b75d9e
+size 462129
diff --git a/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_content_list.json b/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..067bc2fde4a572c09f752c38bba6711b589d54aa
--- /dev/null
+++ b/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6d61c694bb0fe95c6db439f4f66e54f2875b4f66c24df79dde7c9443d609af56
+size 127414
diff --git a/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_model.json b/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e5210a6654fbcb1072fa68025c5be92c65540057
--- /dev/null
+++ b/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad67f2022cac9f969006e889ee6265b75f695f715b4d618922e47f053a3bdc5f
+size 152627
diff --git a/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_origin.pdf b/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..46932df73958aaadb043c4ceb98bed940c0756e5
--- /dev/null
+++ b/panodiffusion360degreepanoramaoutpaintingviadiffusion/f283e772-e24b-4d76-8ec5-dab59382e974_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f8d3783de3f07c3e4b41ca279ace7620762107e5737886afde9a0f7c4e97faa
+size 2022210
diff --git a/panodiffusion360degreepanoramaoutpaintingviadiffusion/full.md b/panodiffusion360degreepanoramaoutpaintingviadiffusion/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a849fca6ee8436ad6338d0160974463d91fe5cc2
--- /dev/null
+++ b/panodiffusion360degreepanoramaoutpaintingviadiffusion/full.md
@@ -0,0 +1,556 @@
+# PANODIFFUSION: 360-DEGREE PANORAMA OUTPAINTING VIA DIFFUSION
+
+Tianhao Wu $^{1\dagger}$ , Chuanxia Zheng $^{2}$ & Tat-Jen Cham $^{1}$
+
+†S-Lab, Nanyang Technological University
+
+tianhao001@e.ntu.edu.sg, astjcham@ntu.edu.sg
+
+$^{2}$ University of Oxford
+
+cxzheng@robots.ox.ac.uk
+
+# ABSTRACT
+
+Generating complete $360^{\circ}$ panoramas from narrow field of view images is ongoing research as omnidirectional RGB data is not readily available. Existing GAN-based approaches face some barriers to achieving higher quality output, and have poor generalization performance over different mask types. In this paper, we present our $360^{\circ}$ indoor RGB-D panorama outpainting model using latent diffusion models (LDM), called PanoDiffusion. We introduce a new bi-modal latent diffusion structure that utilizes both RGB and depth panoramic data during training, which works surprisingly well to outpaint depth-free RGB images during inference. We further propose a novel technique of introducing progressive camera rotations during each diffusion denoising step, which leads to substantial improvement in achieving panorama wraparound consistency. Results show that our PanoDiffusion not only significantly outperforms state-of-the-art methods on RGB-D panorama outpainting by producing diverse well-structured results for different types of masks, but can also synthesize high-quality depth panoramas to provide realistic 3D indoor models.
+
+# 1 INTRODUCTION
+
+Omnidirectional $360^{\circ}$ panoramas serve as invaluable assets in various applications, such as lighting estimation (Gardner et al., 2017; 2019; Song & Funkhouser, 2019) and new scene synthesis (Somanath & Kurz, 2021) in the Augmented and Virtual Reality (AR & VR). However, an obvious limitation is that capturing, collecting, and restoring a dataset with $360^{\circ}$ images is a high-effort and high-cost undertaking (Akimoto et al., 2019; 2022), while manually creating a 3D space from scratch can be a demanding task (Lee et al., 2017; Choi et al., 2015; Newcombe et al., 2011).
+
+
+(a) Masked input
+Figure 1: Example results of $360^{\circ}$ Panorama Outpainting on various masks. Compared to BIPS (Oh et al., 2022) and OmniDreamer (Akimoto et al., 2022), our model not only effectively generates semantically meaningful content and plausible appearances with many objects, such as beds, sofas and TV's, but also provides multiple and diverse solutions for this ill-posed problem. (Masked regions are shown in blue for better visualization. Zoom in to see the details.)
+
+
+(b) Ours PanoDiffusion
+
+
+(c) BIPS
+
+
+(d) OmniDreamer
+
+To mitigate this dataset issue, the latest learning methods (Akimoto et al., 2019; Somanath & Kurz, 2021; Akimoto et al., 2022; Oh et al., 2022) have been proposed, with a specific focus on generating omnidirectional RGB panoramas from narrow field of view (NFOV) images. These methods are typically built upon Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), which have shown remarkable success in creating new content. However, GAN architectures face some notable problems, including 1) mode collapse (seen in Fig. 1(c)), 2) unstable training (Salimans et al., 2016), and 3) difficulty in generating multiple structurally reasonable objects (Epstein et al., 2022). These limitations lead to obvious artifacts in synthesizing complex scenes (Fig. 1).
+
+The recent endeavors of (Lugmayr et al., 2022; Li et al., 2022; Xie et al., 2023; Wang et al., 2023) directly adopt the latest latent diffusion models (LDMs) (Rombach et al., 2022) in image inpainting tasks, which achieve a stable training of generative models and spatially consistent images. However, specifically for a $360^{\circ}$ panorama outpainting scenario, these inpainting works usually lead to grossly distorted results. This is because: 1) the missing (masked) regions in $360^{\circ}$ panorama outpainting is generally much larger than masks in normal inpainting and 2) it necessitates generating semantically reasonable objects within a given scene, as opposed to merely filling in generic background textures in an empty room (as shown in Fig. 1 (c)). To achieve this, we propose an alternative method for $360^{\circ}$ indoor panorama outpainting via the latest latent diffusion models (LDMs) (Rombach et al., 2022), termed as PanoDiffusion. Unlike existing diffusion-based inpainting methods, we introduce depth information through a novel bi-modal latent diffusion structure during the training, which is also significantly different from the latest concurrent works (Tang et al., 2023; Lu et al., 2023) that aims for text-guided $360^{\circ}$ panorama image generation. Our key motivation for doing so is that the depth information is crucial for helping the network understand the physical structure of objects and the layout of the scene (Ren et al., 2012). It is worth noting that our model only uses partially visible RGB images as input during inference, without requirement for any depth information, yet achieving significant improvement on both RGB and depth synthesis (Tables 1 and 2).
+
+Another distinctive challenge in this task stems from the unique characteristic of panorama images: 3) both ends of the image must be aligned to ensure the integrity and wraparound consistency of the entire space, given that the indoor space lacks a definitive starting and ending point. To enhance this property in the generated results, we introduce two strategies: First, during the training process, a camera-rotation approach is employed to randomly crop and stitch the images for data augmentation. It encourages the networks to capture information from different views in a $360^{\circ}$ panorama. Second, a two-end alignment mechanism is applied at each step of the inference denoising process (Fig. 4), which explicitly enforces the two ends of an image to be wraparound-consistent.
+
+We evaluate the proposed method on the Structured3D dataset (Zheng et al., 2020). Experimental results demonstrate that our PanoDiffusion not only significantly outperforms previous state-of-the-art methods, but is also able to provide multiple and diverse well-structured results for different types of masks (Fig. 1). In summary, our main contributions are as follows:
+
+- A new bi-modal latent diffusion structure that utilizes both RGB and depth panoramic data to better learn spatial layouts and patterns during training, but works surprisingly well to outpaint normal RGB-D coronas during inference, even without depth input;
+- A novel technique of introducing progressive camera rotations during each diffusion denoising step, which leads to substantial improvement in achieving panorama wraparound consistency;
+- With either partially or fully visible RGB inputs, our PanoDiffusion can synthesize high-quality indoor RGB-D panoramas simultaneously to provide realistic 3D indoor models.
+
+# 2 RELATED WORK
+
+# 2.1 IMAGE INPAINTING/OUTPAINTING
+
+Driven by advances in various generative models, such as VAEs (Kingma & Welling, 2014) and GANs (Goodfellow et al., 2014), a series of learning-based approaches (Pathak et al., 2016; Iizuka et al., 2017; Yu et al., 2018; Zheng et al., 2019; Zhao et al., 2020; Wan et al., 2021; Zheng et al., 2022) have been proposed to generate semantically meaningful content from a partially visible image. More recently, state-of-the-art methods (Lugmayr et al., 2022; Li et al., 2022; Xie et al., 2023;
+
+
+Figure 2: The overall pipeline of our proposed PanoDiffusion method. (a) During training, the model is optimized for RGB-D panorama synthesis, without the mask. (b) During inference, however, the depth information is no longer needed for masked panorama outpainting. (c) Finally, a super-resolution model is implemented to further enhance the high-resolution outpainting. We only show the input/output of each stage and omit the details of circular shift and adding noise. Note that the VQ-based encoder-decoders are pre-trained in advance, and fixed in the rest of our framework.
+
+Wang et al., 2023) directly adopt the popular diffusion models (Rombach et al., 2022) for image inpainting, achieving high-quality completed images with consistent structure and diverse content. However, these diffusion-based models either focus on background inpainting, or require input text as guidance to produce plausible objects within the missing regions. This points to an existing gap in achieving comprehensive and contextually rich inpainting/outpainting results across a wider spectrum of scenarios, especially in the large scale $360^{\circ}$ Panorama scenes.
+
+# 2.2 $360^{\circ}$ PANORAMA OUTPAINTING
+
+Unlike NFoV images, $360^{\circ}$ panorama images are subjected to nonlinear perspective distortion, such as equirectangular projection. Consequently, objects and layouts within these images appear substantially distorted, particularly those closer to the top and bottom poles. The image completion has to not only preserve the distorted structure but also ensure visual plausibility, with the additional requirement of wraparound-consistency at both ends. Previous endeavors (Akimoto et al., 2019; Somanath & Kurz, 2021) mainly focused on deterministic completion of $360^{\circ}$ RGB images, with BIPS (Oh et al., 2022) further extending this to RGB-D panorama synthesis. In order to generate diverse results (Zheng et al., 2019; 2021), various strategies have been employed. For instance, SIG-SS (Hara et al., 2021) leverages a symmetry-informed CVAE, while OmniDreamer (Akimoto et al., 2022) employs transformer-based sampling. In contrast, our PanoDiffusion is built upon DDPM, wherein each reverse diffusion step inherently introduces stochastic, naturally resulting in multiple and diverse results. Concurrently with our work, MVDiffusion (Tang et al., 2023) generates panorama images by sampling consistent multi-view images, and AOGNet (Lu et al., 2023) does $360^{\circ}$ outpainting through an autoregressive process. Compared to the concurrent models, our PanoDiffusion excels in generating semantically multi-objects for large masked regions, without the need of text prompts. More importantly, PanoDiffusion is capable of simultaneously generating the corresponding RGB-D output, using only partially visible RGB images as input during the inference.
+
+# 3 METHODS
+
+Given a $360^{\circ}$ image $x \in \mathbb{R}^{H \times W \times C}$ , degraded by a number of missing pixels to become a masked image $x_{m}$ , our main goal is to infer semantically meaningful content with reasonable geometry for the missing regions, while simultaneously generating visually realistic appearances. While this task is conceptually similar to conventional learning-based image inpainting, it presents greater challenges due to the following differences: 1) our output is a $360^{\circ}$ RGB- $D$ panorama that requires wraparound consistency; 2) the masked/missing areas are generally much larger than the masks in traditional inpainting; 3) our goal is to generate multiple appropriate objects within a scene, instead of simply filling in with the generic background; 4) the completed results should be structurally plausible, which can be reflected by a reasonable depth map.
+
+
+Figure 3: Our LDM outpainting structure with camera rotation mechanism. During training (a), we randomly select a rotation angle to generate a new panorama for data augmentation. During inference (b), we sample the visible region from the encoded features (above) and the invisible part from the denoising output (below). The depth map is not needed, and is set to random noise. At each denoising step, we crop a $90^{\circ}$ -equivalent area of the intermediate result from the right and stitch it to the left, denoted by the circle following $z_{t}^{mixed}$ — this strongly improves wraparound consistency.
+
+To tackle these challenges, we propose a novel diffusion-based framework for $360^{\circ}$ panoramic outpainting, called PanoDiffusion. The training process, as illustrated in Fig. 2(a), starts with two branches dedicated to RGB $x$ and depth $d_x$ information. Within each branch, following (Rombach et al., 2022), the input data is first embedded into the latent space using the corresponding pretrained VQ model. These representations are then concatenated to yield $z_{rgbd}$ , which subsequently undergoes the forward diffusion step to obtain $z_T$ . The resulting $z_T$ is then subjected to inverse denoising, facilitated by a trained UNet, ultimately returning to the original latent domain. Finally, the pre-trained decoder is employed to rebuild the completed RGB-D results.
+
+During inference, our system takes a masked RGB image as input and conducts panoramic outpainting. It is noteworthy that our proposed model does not inherently require harder-to-acquire depth maps as input, relying solely on a partial RGB image (Fig. 2(b)). The output is further super-resolved into the final image in a refinement stage (Fig. 2(c)).
+
+# 3.1 PRELIMINARIES
+
+Latent Diffusion. Our PanoDiffusion builds upon the latest Latent Diffusion Model (LDM) (Rombach et al., 2022), which executes the denoising process in the latent space of an autoencoder. This design choice yields a twofold advantage: it reduces computational costs while maintaining a high level of visual quality by storing the domain information in the encoder $\mathcal{E}(\cdot)$ and decoder $\mathcal{D}(\cdot)$ . During the training, the given image $x_0$ is initially embedded to yield the latent representation $z_0 = \mathcal{E}(x_0)$ , which is then perturbed by adding the noise in a Markovian manner:
+
+$$
+q \left(z _ {t} \mid z _ {t - 1}\right) = \mathcal {N} \left(z _ {t}; \sqrt {1 - \beta_ {t}} z _ {t - 1}, \beta_ {t} I\right), \tag {1}
+$$
+
+where $t = [1, \dots, T]$ is the number of steps in the forward process. The hyperparameters $\beta_{t}$ denote the noise level at each step $t$ . For the denoising process, the network in LDM is trained to predict the noise as proposed in DDPM (Ho et al., 2020), where the training objective can be expressed as:
+
+$$
+\mathcal {L} = \mathbb {E} _ {\mathcal {E} (x _ {0}), \epsilon \sim \mathcal {N} (0, I), t} [ \| \epsilon_ {\theta} (z _ {t}, t) - \epsilon \| _ {2} ^ {2} ] \tag {2}
+$$
+
+Diffusion Outpainting. The existing pixel-level diffusion inpainting methods (Lugmayr et al., 2022; Horita et al., 2022) are conceptually similar to that used for image generation, except $x_{t}$ incorporates partially visible information, rather than purely sampling from a Gaussian distribution during the inference. In particular, let $x_{0}$ denote the original image in step 0, while $x_{0}^{visible} = m\odot x_{0}$ and $x_{0}^{invisible} = (1 - m)\odot x_{0}$ contain the visible and missing pixels, respectively. Then, as shown in Fig. 3, the reverse denoising sampling process unfolds as follows:
+
+$$
+x _ {t} ^ {\text {v i s i b l e}} \sim q \left(x _ {t} \mid x _ {t - 1}\right), \tag {3}
+$$
+
+$$
+x _ {t - 1} ^ {\text {i n v i s i b l e}} \sim p _ {\theta} \left(x _ {t - 1} \mid x _ {t}\right), \tag {4}
+$$
+
+$$
+x _ {t - 1} = m \odot x _ {t - 1} ^ {\text {v i s i b l e}} + (1 - m) \odot x _ {t - 1} ^ {\text {i n v i s i b l e}}. \tag {5}
+$$
+
+
+Figure 4: An example of our two-end alignment mechanism. During inference, we rotate the scene for $90^{\circ}$ in each denoising step. Within a total of 200 sampling steps, our PanoDiffusion will effectively achieve wraparound consistency.
+
+Here, $q$ is the forward distribution in the diffusion process and $p_{\theta}$ is the inverse distribution. After $T$ iterations, $x_0$ is restored to the original image space.
+
+Relation to Prior Work. In contrast to these inpainting methods at pixel-level, our PanoDiffusion builds upon the LDM. Despite the fact that the original LDM provided the ability to inpainting images, such inpainting focuses on removing objects from the image, rather than generating a variety of meaningful objects in panoramic outpainting. In short, the $x_0$ is embedded into the latent space, yielding $z_0 = \mathcal{E}(x_0)$ , while the subsequent sampling process follows the equations (3)-(5). The key motivation behind this is to perform our task on higher resolution $512 \times 1024$ panoramas. More importantly, we opt to go beyond RGB outpainting, and to deal with RGB-D synthesis (Sec. 3.3), which is useful for downstream tasks in 3D reconstruction. Additionally, existing approaches can not ensure the wraparound consistency during completion, while our proposed rotational outpainting mechanism in Sec. 3.2 significantly improves such a wraparound consistency.
+
+# 3.2 WRAPAROUND CONSISTENCY MECHANISM
+
+Camera Rotated Data Augmentation. It is expected that the two ends of any $360^{\circ}$ panorama should be seamlessly aligned, creating a consistent transition from one end to the other. This is especially crucial in applications where a smooth visual experience is required, such as 3D reconstruction and rendering. To promote this property, we implement a circular shift data augmentation, termed camera-rotation, to train our PanoDiffusion. As shown in Fig. 3(a), we randomly select a rotation angle, which is subsequently employed to crop and reassemble image patches, generating a new panorama for training purposes.
+
+Two-Ends Alignment Sampling. While the above camera-rotation technique can improve the model's implicit grasp of the wraparound consistency using the augmentation of data examples, it may not impose strong enough constraints on wraparound alignment of the results. Therefore, in the inference process, we introduce a novel two-end alignment mechanism that can be seamlessly integrated into our latent diffusion outpainting process. In particular, the reverse denoising process within the DDPM is characterized by multiple iterations, rather than a single step. During each iteration, we apply the camera-rotation operation, entailing $90^{\circ}$ rotation of both the latent vectors and mask, before performing a denoising outpainting step. This procedure more effectively connects the two ends of the panorama from the previous step, resulting in significant improvement in visual results (as shown in Fig. 8). Without changing the size of the images, generating overlapping content, or introducing extra loss functions, we provide 'hints' to the model by rotating the panorama horizontally, thus enhancing the effect of alignment at both ends (examples shown in Fig. 4).
+
+# 3.3 BI-MODAL LATENT DIFFUSION MODEL
+
+In order to deal with RGB-D synthesis, one straightforward idea could be to use Depth as an explicit condition during training and inference, where the depth information may be compressed into latent space and then introduced into the denoising process of the RGB images via concatenation or cross-attention. However, we found that such an approach often leads to blurry results in our experiments (as shown in Fig. 11). Alternatively, using two parallel LDMs to reconstruct Depth and RGB images separately, together with a joint loss, may also appear to be an intuitive solution. Nonetheless, this idea presents significant implementation challenges due to the computational resources required for multiple LDMs.
+
+Therefore, we devised a bi-modal latent diffusion structure to introduce depth information while generating high-quality RGB output. It is important to note that this depth information is solely
+
+
+(a) NFoV
+
+
+(b) Camera
+
+
+(c) Random
+
+
+(d) Layout
+Figure 5: Examples of various mask types. See text for details.
+
+necessary during the training phase. Specifically, we trained two VAE models independently for RGB and depth images, and then concatenate $z_{rgb} \in \mathbb{R}^{h \times w \times 3}$ with $z_{depth} \in \mathbb{R}^{h \times w \times 1}$ at the latent level to get $z_{rgbd} \in \mathbb{R}^{h \times w \times 4}$ . The training of VAEs is exactly the same as in (Rombach et al., 2022) with downsampling factor $f = 4$ . Then we follow the standard process to train an unconditional DDPM with $z_{rgbd}$ via a variant of the original LDM loss:
+
+$$
+\mathcal {L} _ {R G B - D} = \mathbb {E} _ {z _ {r g b d}, \epsilon \sim \mathcal {N} (0, 1), t} [ \| \epsilon_ {\theta} (z _ {t}, t) - \epsilon \| _ {2} ^ {2} ], z _ {r g b d} = \mathcal {E} _ {1} (x) \oplus \mathcal {E} _ {2} (d _ {x}) \tag {6}
+$$
+
+Reconstructed RGB-D images can be obtained by decoupling $z_{rgbd}$ and decoding. It is important to note that during training, we use the full RGB-D image as input, without masks. Conversely, during the inference stage, the model can perform outpainting of the masked RGB image directly without any depth input, with the fourth channel of $z_{rgbd}$ replaced by random noise.
+
+# 3.4 REFINENET
+
+Although mapping images to a smaller latent space via an autoencoder prior to diffusion can save training space and thus allow larger size inputs, the panorama size of $512 \times 1024$ is still a heavy burden for LDM (Rombach et al., 2022). Therefore, we adopt a two-stage approach to complete the outpainting task. Initially, the original input is downscaled to $256 \times 512$ as the input to the LDM. Correspondingly, the image size of the LDM output is also $256 \times 512$ . Therefore, an additional module is needed to upscale the output image size to $512 \times 1024$ . Since panorama images are distorted and the objects and layouts do not follow the regular image patterns, we trained a super-resolution GAN model for panoramas to produce visually plausible results at a higher resolution.
+
+# 4 EXPERIMENTS
+
+# 4.1 EXPERIMENTAL DETAILS
+
+Dataset. We estimated our model on the Structured3D dataset (Zheng et al., 2020), which provides $360^{\circ}$ indoor RGB-D data following equirectangular projection with a $512 \times 1024$ resolution. We split the dataset into 16930 train, 2116 validation, and 2117 test instances.
+
+Metrics. For RGB outpainting, due to large masks, we should not require the completed image to be exactly the same as the original image, since there are many plausible solutions (e.g. new furniture and ornaments, and their placement). Therefore, we mainly report the following dataset-level metrics: 1) Fréchet Inception Distance (FID) (Heusel et al., 2017), 2) Spatial FID (sFID) (Nash et al., 2021), 3) density and coverage (Naeem et al., 2020). FID compares the distance between distributions of generated and original images in a deep feature domain, while sFID is a variant of FID that uses spatial features rather than the standard pooled features. Additionally, density reflects how accurate the generated data is to the real data stream, while coverage reflects how well the generated data generalizes the real data stream. For depth synthesis, we use RMSE, MAE, AbsREL, and Delta1.25 as implemented in (Cheng et al., 2018; Zheng et al., 2018), which are commonly used to measure the accuracy of depth estimates. Implementation details can be found in section 5.
+
+Mask Types. Most works focused on generating omnidirectional images from NFoV images (Fig. 5(a)). However, partial observability may also occur due to sensor damage in $360^{\circ}$ cameras. Such masks can be roughly simulated by randomly sampling a number of NFoV camera views within the panorama (Fig. 5(b)). We also experimented with other types of masks, such as randomly generated regular masks (Fig. 5(c)). Finally, the regions with floors and ceilings in panoramic images are often less interesting than the central regions. Hence, we also generated layout masks that muffle all areas except floors and ceilings, to more incisively test the model's generative power (Fig. 5(d)).
+
+
+(a) Ground Truth
+
+
+(b) Masked Input
+
+
+(c) PanoDiffusion (RGB)
+(d) PanoDiffusion (RGB-D)
+
+
+
+
+(e) $\mathrm{BIPS}_{\mathrm{ECCV}^{\prime}2022}$
+
+
+(f) OmniDreamerCVPR'2022
+Figure 6: Qualitative comparison for RGB panorama outpainting. Our PanoDiffusion generated more objects with appropriate layout, and with better visual quality. For BIPS and OmniDreamer, despite the seemingly reasonable results, the outpainted areas tend to fill the walls and lack diverse items. As for TFill, it generates blurry results for large invisible areas. For Inpaint anything, it generates multiple objects but they appear to be structurally and semantically implausible. Compared to them, PanoDiffusion generates more reasonable details in the masked region, such as pillows, paintings on the wall, windows, and views outside. More comparisons are provided in Appendix.
+
+
+(g) TFillCVPR'2022
+(h) Inpaint AnythingarXiv'2023
+
+
+
+Table 1: Quantitative results for RGB outpainting. All models were re-trained and evaluated using the same standardized dataset. Note that, we tested all models without the depth input.
+
+
Methods
Camera Mask
NFoV Mask
Layout Mask
Random Box Mask
FID ↓
sFID ↓
D ↑
C ↑
FID ↓
sFID ↓
D ↑
C ↑
FID ↓
sFID ↓
D ↑
C ↑
FID ↓
sFID ↓
D ↑
C ↑
BIPS
31.70
28.89
0.769
0.660
57.69
44.68
0.205
0.277
32.25
24.66
0.645
0.579
25.35
22.60
0.676
0.798
OmniDreamer
65.47
37.04
0.143
0.175
62.56
36.24
0.125
0.184
82.71
28.40
0.103
0.120
45.10
24.12
0.329
0.576
LaMa
115.92
107.69
0.034
0.082
125.77
136.32
0.002
0.006
129.77
35.23
0.018
0.043
45.25
24.21
0.429
0.701
TFill
83.84
61.40
0.075
0.086
93.62
76.13
0.037
0.027
97.99
43.40
0.046
0.052
46.84
30.72
0.368
0.574
Inpainting Anything
97.38
54.73
0.076
0.133
105.77
59.70
0.054
0.035
92.18
32.00
0.116
0.085
46.30
26.71
0.372
0.632
RePaint
82.84
84.39
0.096
0.105
95.38
82.35
0.0639
0.078
69.14
31.63
0.294
0.263
55.47
38.78
0.433
0.581
PanoDiffusion
21.55
26.95
0.867
0.708
21.41
27.80
0.790
0.669
23.06
22.39
1.000
0.737
16.13
20.39
1.000
0.883
+
+Baseline Models. For RGB panorama outpainting, we mainly compared with the following state-of-the-art methods: including image inpainting models LaMa (Suvorov et al., 2022) $_{\mathrm{WACV}^{\prime}2022}$ and TFill (Zheng et al., 2022) $_{\mathrm{CVPR}^{\prime}2022}$ , panorama outpainting models BIPS (Oh et al., 2022) $_{\mathrm{ECCV}^{\prime}2022}$ and OmniDreamer (Akimoto et al., 2022) $_{\mathrm{CVPR}^{\prime}2022}$ , diffusion-based image inpainting models Repaint (Lugmayr et al., 2022) $_{\mathrm{CVPR}^{\prime}2022}$ and Inpaint Anything (Yu et al., 2023) $_{\mathrm{arXiv}^{\prime}2023}$ . To evaluate the quality of depth panorama, we compare our method with three image-guided depth synthesis methods including BIPS (Oh et al., 2022), NLSPN (Park et al., 2020), and CSPN (Cheng et al., 2018). All models are retrained on the Structured3D dataset using their publicly available codes.
+
+# 4.2 MAIN RESULTS
+
+Following prior works, we report the quantitative results for RGB panorama outpainting with camera masks in Table 1. All instantiations of our model significantly outperform all state-of-the-art models. Specifically, the FID score is substantially better (relative $67.0\%$ improvement).
+
+It is imperative to note that our model is trained unconditionally, with masks only employed during the inference phase. Therefore, it is expected to handle a broader spectrum of mask types. To validate this assertion, we further evaluated our model with the baseline models across all four different mask types (displayed in Fig. 5). The results in Table 1 show that PanoDiffusion consistently outperforms the baseline models on all types of masks. Conversely, baseline models' performance displays significant variability in the type of mask used. Although the visible regions of the layout masks are always larger than the camera masks, the performances of baseline models on camera masks are significantly better. This is likely because the masks in the training process are closer to the NFoV distribution. In contrast, PanoDiffusion has a more robust performance, producing high-quality and diverse output images for all mask distributions.
+
+The qualitative results are visualized in Fig. 6. Here we show an example of outpainting on a layout mask (more comparisons in Appendix). Besides the fact that PanoDiffusion generates more visually realistic results than baseline models, comparing the RGB (trained without depth) and RGB-D versions of our PanoDiffusion, in Fig. 6(c), some unrealistic structures are generated on the center
+
+
+(a) RGB Input
+
+
+(b) Depth GT
+
+
+(c) Ours PanoDiffusion
+
+
+(d)CSPN
+Figure 7: Qualitative comparison for depth panorama synthesis.
+
+
+(e) BIPS
+
+
+(f) NLSPN
+
+Table 2: Depth map ablations. All models are trained and evaluated on the Structured3D dataset.
+
+
Noise Level
Camera Mask
NFoV Mask
Layout Mask
Random Box Mask
FID ↓
sFID ↓
D ↑
C ↑
FID ↓
sFID ↓
D ↑
C ↑
FID ↓
sFID ↓
D ↑
C ↑
FID ↓
sFID ↓
D ↑
C ↑
no depth
24.33
29.00
0.667
0.635
24.01
30.00
0.639
0.617
25.37
22.92
0.785
0.677
17.88
21.21
0.913
0.857
50%
21.65
28.12
0.678
0.660
21.99
29.37
0.678
0.561
24.24
23.05
0.855
0.724
17.02
21.22
0.919
0.837
30%
21.78
27.96
0.714
0.674
21.78
29.39
0.643
0.658
24.11
23.00
0.919
0.724
16.87
21.25
0.937
0.855
10%
21.68
27.79
0.721
0.658
21.49
29.74
0.558
0.620
24.02
22.68
0.938
0.741
16.60
21.02
0.932
0.853
full depth
21.55
26.95
0.867
0.708
21.41
27.80
0.790
0.669
23.06
22.39
1.000
0.737
16.13
20.39
1.000
0.883
+
+(a) Usage of depth maps (training). We use different sparsity levels of depth for training and the results (more intense color means better performance) verify the effectiveness of depth for RGB outpainting. It also proves that the model can accept sparse depth as input.
+
+
Methods
Input Depth
FID ↓
sFID ↓
D ↑
C ↑
BIPS
fully visible
29.74
30.59
0.931
0.721
PanoDiffusion
21.90
26.78
0.829
0.693
BIPS
partial visible
31.70
28.89
0.769
0.660
PanoDiffusion
22.34
26.74
0.856
0.686
BIPS
fully masked
68.79
42.62
0.306
0.412
PanoDiffusion
21.55
26.95
0.867
0.708
+
+(b) Usage of depth maps (inference). BIPS heavily relies on the availability of input depth during inference, while our model is minimally affected.
+
+
Methods
Input Depth
RMSE↓
MAE↓
AbsREL↓
Delta1.25 ↑
BIPS
323
207
0.1842
0.8436
CSPN
374
282
0.2273
0.6618
NLSPN
fully masked
284
183
0.1692
0.8544
PanoDiffusion
276
193
0.1355
0.9060
BIPS
247
136
0.1098
0.9032
CSPN
291
195
0.1547
0.8182
NLSPN
partial visible
221
124
0.1058
0.9143
PanoDiffusion
219
123
0.1127
0.9278
+
+(c) Depth panorama synthesis. Our model outperforms baseline models in most of the metrics.
+
+wall, and when we look closely at the curtains generated by the RGB model, the physical structure of the edges is not quite real. In contrast, the same region of RGB-D result (Fig. 6(d)) appears more structurally appropriate. Such improvement proves the advantages of jointly learning to synthesize depth data along with RGB images, even when depth is not used during test time, suggesting the depth information is significant for assisting the RGB completion.
+
+# 4.3 ABLATION EXPERIMENTS
+
+We ran a number of ablations to analyze the effectiveness of each core component in our PanoDiffusion. Results are shown in tables 2 and 3 and figs. 7 and 8 and discussed in detail next.
+
+Depth Maps. In practice applications, depth data may exhibit sparsity due to the hardware limitations (Park et al., 2020). To ascertain the model's proficiency in accommodating sparse depth maps as input, we undertook a training process using depth maps with different degrees of sparsity (i.e., randomized depth value will be set to 0). The result is reported in Table 2(a). The denser colors in the table represent better performance. As the sparsity of the depth input decreases, the performance of RGB outpainting constantly improves. Even if we use $50\%$ sparse depth for training, the result is overall better than the original LDM.
+
+We then evaluated the importance of depth maps during inference, and compared it with the state-of-the-art BIPS (Oh et al., 2022), which is also trained with RGB-D images. The quantitative results are reported in Table 2(b). As can be seen, BIPS's performance appears to deteriorate significantly when
+
+
+(a) PanoDiffusion w/ TA
+Figure 8: Examples of stitched ends of the outpainted images. For each image, the left half was unmasked (i.e. ground truth), while the right half was masked and synthesized. The results generated with rotation are more naturally connected at both ends (a).
+
+
+
+
+(b) PanoDiffusion w/o TA
+
+
+
+
+
+
+(c) OmniDreamer
+
+
+
+
+
+
+(d) BIPS
+
+
+
+
+
+Table 3: Two-end alignment ablations. Using rotational outpainting, we achieve optimal consistency at both ends of the PanoDiffusion output.
+
+
Methods\Mask Type
Camera
NfoV
Layout
Random Box
Methods\Mask Type
Camera
NfoV
Layout
Random Box
PanoDiffusion (w/ rotation)
90.41
89.74
88.01
85.04
PanoDiffusion (w/o rotation)
125.82
128.33
128.10
128.19
BIPS
117.59
96.82
132.15
148.78
OmniDreamer
115.6
109.00
146.37
136.68
LaMa
119.51
119.39
133.54
136.35
TFill
155.16
157.60
136.94
122.96
+
+the input depth visual area is reduced. Conversely, our PanoDiffusion is not sensitive to these depth maps, indicating that the generic model has successfully handled the modality. Interestingly, we noticed that having fully visible depth at test time did not improve the performance of PanoDiffusion, and in fact, the result deteriorated slightly. A reasonable explanation is that during the training process, the signal-to-noise ratios (SNR) of RGB and depth pixels are roughly the same within each iteration since no masks were used. However, during outpainting, the SNR balance will be disrupted when RGB input is masked and depth input is fully visible. Therefore, the results are degraded, but only slightly because PanoDiffusion has effectively learned the distribution of spatial visual patterns across all modalities, without being overly reliant on depth. This also explains why our model is more robust to depth inputs with different degrees of visibility.
+
+Finally, we evaluated the depth synthesis ability of PanoDiffusion, seen in Table 2(c) and Fig. 7. The results show that our model achieves the best performance on most of the metrics and the qualitative results also show that PanoDiffusion is able to accurately estimate the depth map. This not only indicates that PanoDiffusion can be used for depth synthesis and estimation but also proves that it has learned the spatial patterns of panorama images.
+
+Two-end Alignment. Currently, there is no metric to evaluate the performance of aligning the two ends of an image. To make a reasonable comparison, we make one side of the input image fully visible, and the other side fully masked and then compare the two ends of output. Based on the Left-Right Consistency Error (LRCE) (Shen et al., 2022) which is used to evaluate the consistency of two ends of the depth maps, we designed a new RGB-LRCE to calculate the difference between the two ends of the image: $LRCE = \frac{1}{N}\sum_{i=1}^{N}|P_{first}^{col} - P_{last}^{col}|$ , and reported results in table 3.
+
+The qualitative results are shown in fig. 8. To compare as many results, we only show the end regions that are stitched together to highlight the contrast. They show that the consistency of the two ends of the results is improved after the use of rotational outpainting, especially the texture of the walls and the alignment of the layout. Still, differences can be found with rotated outpainting. We believe it is mainly due to the fact that rotational denoising is based on the latent level, which may introduce extra errors during decoding.
+
+# 5 CONCLUSION
+
+In this paper, we show that our proposed method, the two-stage RGB-D PanoDiffusion, achieves state-of-the-art performance for indoor RGB-D panorama outpainting. The introduction of depth information via our bi-modal LDM structure significantly improves the performance of the model. Such improvement illustrates the effectiveness of using depth during training as an aid to guide RGB panorama generation. In addition, we show that the alignment mechanism we employ at each step of the denoising process of the diffusion model enhances the wraparound consistency of the results. With the use of these novel mechanisms, our two-stage structure is capable of generating high-quality RGB-D panoramas at $512 \times 1024$ resolution.
+
+# ACKNOWLEDGEMENT
+
+This study is supported under the RIE2020 Industry Alignment Fund - Industry Collaboration Projects (IAF-ICP) Funding Initiative, as well as cash and in-kind contribution from the industry partner(s).
+
+# REFERENCES
+
+Naofumi Akimoto, Seito Kasai, Masaki Hayashi, and Yoshimitsu Aoki. 360-degree image completion by two-stage conditional gans. In 2019 IEEE International Conference on Image Processing (ICIP), pp. 4704-4708. IEEE, 2019.
+Naofumi Akimoto, Yuhi Matsuo, and Yoshimitsu Aoki. Diverse plausible 360-degree image outpainting for efficient 3dcbg background creation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11441-11450, 2022.
+Xinjing Cheng, Peng Wang, and Ruigang Yang. Depth estimation via affinity learned with convolutional spatial propagation network. In Proceedings of the European conference on computer vision (ECCV), pp. 103-119, 2018.
+Sungjoon Choi, Qian-Yi Zhou, and Vladlen Koltun. Robust reconstruction of indoor scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5556-5565, 2015.
+Dave Epstein, Taesung Park, Richard Zhang, Eli Shechtman, and Alexei A Efros. Blobgan: Spatially disentangled scene representations. In Computer Vision-ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part XV, pp. 616-635. Springer, 2022.
+Marc-Andre Gardner, Kalyan Sunkavalli, Ersin Yumer, Xiaohui Shen, Emiliano Gambaretto, Christian Gagné, and Jean-François Lalonde. Learning to predict indoor illumination from a single image. ACM Transactions on Graphics (TOG), 36(6):1-14, 2017.
+Marc-Andre Gardner, Yannick Hold-Geoffroy, Kalyan Sunkavalli, Christian Gagne, and Jean-François Lalonde. Deep parametric indoor lighting estimation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7175-7183, 2019.
+Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 27, 2014.
+Takayuki Hara, Yusuke Mukuta, and Tatsuya Harada. Spherical image generation from a single image by considering scene symmetry. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 1513-1521, 2021.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
+Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840-6851, 2020.
+Daichi Horita, Jiaolong Yang, Dong Chen, Yuki Koyama, and Kiyoharu Aizawa. A structure-guided diffusion model for large-hole diverse image completion. arXiv preprint arXiv:2211.10437, 2022.
+Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa. Globally and locally consistent image completion. ACM Transactions on Graphics (ToG), 36(4):1-14, 2017.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In editor (ed.), Proceedings of the International Conference on Learning Representations (ICLR), 2014.
+Jeong-Kyun Lee, Jaewon Yea, Min-Gyu Park, and Kuk-Jin Yoon. Joint layout estimation and global multi-view registration for indoor reconstruction. In Proceedings of the IEEE international conference on computer vision, pp. 162-171, 2017.
+
+Wenbo Li, Xin Yu, Kun Zhou, Yibing Song, Zhe Lin, and Jiaya Jia. Sdm: Spatial diffusion model for large hole image inpainting. arXiv preprint arXiv:2212.02963, 2022.
+Zhuqiang Lu, Kun Hu, Chaoyue Wang, Lei Bai, and Zhiyong Wang. Autoregressive omni-aware outpainting for open-vocabulary 360-degree image generation. arXiv preprint arXiv:2309.03467, 2023.
+Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11461-11471, 2022.
+Muhammad Ferjad Naeem, Seong Joon Oh, Youngjung Uh, Yunjoy Choi, and Jaejun Yoo. Reliable fidelity and diversity metrics for generative models. In International Conference on Machine Learning, pp. 7176-7185. PMLR, 2020.
+Charlie Nash, Jacob Menick, Sander Dieleman, and Peter W Battaglia. Generating images with sparse representations. arXiv preprint arXiv:2103.03841, 2021.
+Richard A Newcombe, Shahram Izadi, Otmar Hilliges, David Molyneaux, David Kim, Andrew J Davison, Pushmeet Kohi, Jamie Shotton, Steve Hodges, and Andrew Fitzgibbon. Kinectfusion: Real-time dense surface mapping and tracking. In 2011 10th IEEE international symposium on mixed and augmented reality, pp. 127-136. IEEE, 2011.
+Changgyoon Oh, Wonjune Cho, Yujeong Chae, Daehee Park, Lin Wang, and Kuk-Jin Yoon. Bips: Bi-modal indoor panorama synthesis via residual depth-aided adversarial learning. In Computer Vision-ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part XVI, pp. 352-371. Springer, 2022.
+Jinsun Park, Kyungdon Joo, Zhe Hu, Chi-Kuei Liu, and In So Kweon. Non-local spatial propagation network for depth completion. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XIII 16, pp. 120-136. Springer, 2020.
+Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2536-2544, 2016.
+Xiaofeng Ren, Liefeng Bo, and Dieter Fox. Rgb-(d) scene labeling: Features and algorithms. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pp. 2759-2766. IEEE, 2012.
+Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684-10695, 2022.
+Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in neural information processing systems, 29, 2016.
+Zhijie Shen, Chunyu Lin, Kang Liao, Lang Nie, Zishuo Zheng, and Yao Zhao. Panofformer: Panorama transformer for indoor 360-degree depth estimation. In European Conference on Computer Vision, pp. 195-211. Springer, 2022.
+Gowri Somanath and Daniel Kurz. HDR environment map estimation for real-time augmented reality. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11298-11306, 2021.
+Shuran Song and Thomas Funkhouser. Neural illumination: Lighting prediction for indoor environments. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6918-6926, 2019.
+Roman Suvorov, Elizaveta Logacheva, Anton Mashikhin, Anastasia Remizova, Armenii Ashukha, Aleksei Silvestrov, Naejin Kong, Harshith Goka, Kiwoong Park, and Victor Lempitsky. Resolution-robust large mask inpainting with fourier convolutions. In Proceedings of the IEEE/CVF winter conference on applications of computer vision, pp. 2149-2159, 2022.
+
+Shitao Tang, Fuyang Zhang, Jiacheng Chen, Peng Wang, and Yasutaka Furukawa. Mvdiffusion: Enabling holistic multi-view image generation with correspondence-aware diffusion. arXiv preprint arXiv:2307.01097, 2023.
+Ziyu Wan, Jingbo Zhang, Dongdong Chen, and Jing Liao. High-fidelity pluralistic image completion with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 4692-4701, October 2021.
+Su Wang, Chitwan Sahara, Ceslee Montgomery, Jordi Pont-Tuset, Shai Noy, Stefano Pellegrini, Yasumasa Onoe, Sarah Laszlo, David J Fleet, Radu Soricut, et al. Imagen editor and editbench: Advancing and evaluating text-guided image inpainting. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18359-18369, 2023.
+Shaoan Xie, Zhifei Zhang, Zhe Lin, Tobias Hinz, and Kun Zhang. Smartbrush: Text and shape guided object inpainting with diffusion model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22428-22437, 2023.
+Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
+Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative image inpainting with contextual attention. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5505-5514, 2018.
+Tao Yu, Runseng Feng, Ruoyu Feng, Jinming Liu, Xin Jin, Wenjun Zeng, and Zhibo Chen. Inpaint anything: Segment anything meets image inpainting. arXiv preprint arXiv:2304.06790, 2023.
+Shengyu Zhao, Jonathan Cui, Yilun Sheng, Yue Dong, Xiao Liang, I Eric, Chao Chang, and Yan Xu. Large scale image completion via co-modulated generative adversarial networks. In International Conference on Learning Representations, 2020.
+Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. T2net: Synthetic-to-realistic translation for solving single-image depth estimation tasks. In Proceedings of the European conference on computer vision (ECCV), pp. 767-783, 2018.
+Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. Pluralistic image completion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1438-1447, 2019.
+Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. Pluralistic free-form image completion. International Journal of Computer Vision, 129:2786-2805, 2021.
+Chuanxia Zheng, Tat-Jen Cham, Jianfei Cai, and Dinh Phung. Bridging global context interactions for high-fidelity image completion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11512-11522, 2022.
+Jia Zheng, Junfei Zhang, Jing Li, Rui Tang, Shenghua Gao, and Zihan Zhou. Structured3d: A large photo-realistic dataset for structured 3d modeling. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part IX 16, pp. 519-535. Springer, 2020.
+
+# APPENDIX
+
+The supplementary materials are organized as follows:
+
+1. A video is added to illuminate the work with more results.
+2. The reproducible code is included.
+3. An additional PDF for implementation, training, metrics details, as well as more quantitative and qualitative results.
+
+# IMPLEMENT DETAILS
+
+# TRAINING OF VQ MODELS FOR RGB AND DEPTH PANorama
+
+The reason why LDMs (Rombach et al., 2022) can be trained on larger image scales is that perceptual image compression is used so that the diffusion process can be conducted in latent space, with the decoder $\mathcal{D}$ used for returning the latent vector $z\in \mathbb{R}^{h\times w\times c}$ to high-resolution image $x\in \mathbb{R}^{H\times W\times C}$ . During this process, the inherent spatial structure of the image does not change but is downscaled. Such spatial constancy is critical for our work as the partially visible regions will not be changed during outpainting, shown in Fig. 9.
+
+
+(a) Masked Image
+
+
+Figure 9: Masking at different levels. (a)(c) are pixel-level masked images, while (b)(d) are corresponding latent-level masked images. They are aligned well, except for the different mask values.
+
+
+(b) Masked Latent Image
+(c) Masked Image
+
+
+(d) Masked Latent Image
+
+Two VQ models, $VQ_{rgb}$ and $VQ_{depth}$ with downsampling factor $f = 4$ are trained using RGB and depth data respectively. The output channel numbers of $VQ_{rgb}$ and $VQ_{depth}$ are set to 3 and 1. For the training of $VQ_{rgb}$ , we finetuned on the pre-trained VQ-f4 model provided by Rombach et al. (Rombach et al., 2022). Due to the lack of a pre-trained model, $VQ_{depth}$ is trained from scratch. Both $VQ_{rgb}$ and $VQ_{depth}$ are trained for 30 epochs and we select the models that perform best on the validation data for the training of bi-modal LDM. Throughout the process, the datasets used during training, validation, and testing are exactly matched for $VQ_{rgb}$ and $VQ_{depth}$ .
+
+# TRAINING OF LATENT DIFFUSION MODEL
+
+The training of PanoDiffusion initially loaded the LSUN-Bedrooms (Yu et al., 2015) pre-trained model provided by official LDM (Rombach et al., 2022). Despite the fact that the LSUN-Bedrooms images are in normal view, where the objects and the layout are not subjected to equirectangular projection, we believe that it can provide useful priori knowledge of item semantics, texture, etc. for the outpainting of the indoor panoramas. At the same time, pre-trained $VQ_{rgb}$ and $VQ_{depth}$ are loaded and fixed during the training of our bi-modal LDM.
+
+# CAMERA-ROTATION DIRECTION
+
+During the training stage, we restrict random angle rotation solely to the horizontal direction. As panorama images typically follow equirectangular projection, the distortion increases non-uniformly towards the top and bottom poles. Introducing random angle rotation in the vertical direction would lead to substantial changes in the projection results, and require more complex preprocessing, which will increase training costs. Conversely, distortion is uniform horizontally - image manipulation here only involves horizontal cropping and splicing, without the need for reprojection.
+
+Here we show two examples where the camera has a 90-degree vertical rotation as Fig 10.
+
+
+Horizontal Rotation
+
+
+Original View
+Figure 10: Examples of vertical and horizontal camera rotation. No matter how many degrees the panorama is rotated horizontally, the distortion of each component remains unchanged. However, when the panorama is rotated vertically, even by a small angle, the distortion of the entire scene changes significantly, which can be a hindrance for PanoDiffusion to learn.
+
+
+Vertical Rotation
+
+# REFINENET IMPLEMENTATION
+
+For the second stage of our structure, to generate visually plausible $512 \times 1024$ results, we trained a GAN for super-resolution. It consists of a generator G and a discriminator D. For training G, we use a weighted sum of the pixel-wise L1 loss and adversarial loss. The pixel-wise L1 loss is denoted as $L_{pixel}$ , measuring the difference between the GT and the output panorama.
+
+$$
+L _ {\text {p i x e l}} = L _ {1} \left(g t, G \left(g t _ {l r}\right)\right), \tag {7}
+$$
+
+$$
+L _ {a d v} = \frac {1}{2} \mathbb {E} \left[ \left(D \left(G \left(g t _ {l r}\right) - 1\right) ^ {2} \right], \right. \tag {8}
+$$
+
+$$
+L _ {G} = \lambda L _ {\text {p i x e l}} + L _ {\text {a d v}}. \tag {9}
+$$
+
+The training data is randomly downscaled from $512 \times 1024$ GT images to $128 \times 256$ or $256 \times 512$ and upscaled back to $512 \times 1024$ using the traditional interpolation method, which will erase details from GT images. Then they are used as the input of our super-resolution GAN, denoted as $gt_{lr}$ . Here the value of $\lambda$ is set to 20 during the training.
+
+# QUANTITIVE METRICS
+
+In this section, we will describe how the quantitative metrics used in this paper are implemented.
+
+Fréchet inception distance (FID) FID (Heusel et al., 2017) is used to capture the similarity of generated images to real ones. We used the official PyTorch implementation of FID to evaluate the similarity between the final average pooling features of GT images and model outputs.
+
+Spatial FID (sFID) Spatial FID (Nash et al., 2021) is a variant of FID, using spatial features rather than the standard pooled features. As standard pool_3 features compress spatial information to a large extent, making it less sensitive to spatial variability, mixed 6/conv features can provide a sense of spatial distributional similarity between models. sFID is calculated using the first 7 channels from the intermediate mixed 6/conv feature maps in order to obtain a feature space of size $7 \times 17 \times 17 = 2023$ , which is comparable to the final average pooling features of size 2048.
+
+Density and Coverage Density and coverage metrics are proposed by Naeem et al. (Naeem et al., 2020), who argue that even the latest version of the precision and recall metrics are still not reliable. Therefore, they proposed density and coverage, which can provide more interpretable and reliable signals. In this paper, we used their official implementation with nearest neighbor $k = 3$ to calculate the density and coverage of the final average pooling features of the GT panoramas and the generated output.
+
+Depth Estimation Metrics Given ground truth depth $D_{gt} = \{d_{gt}\}$ and predicted depth $D_{pred} = \{d_{pred}\}$ , we use the following metrics to evaluate the quality of our depth estimates.
+
+$$
+R M S E = \sqrt {\frac {1}{| D |} \sum \left\| d _ {g t} - d _ {p r e d} \right\| ^ {2}}, \tag {10}
+$$
+
+$$
+M A E = \frac {1}{| D |} \sum \left| d _ {g t} - d _ {p r e d} \right|, \tag {11}
+$$
+
+$$
+A b s R E L = \frac {1}{| D |} \sum \frac {\left| d _ {g t} - d _ {p r e d} \right|}{d _ {g t}}, \tag {12}
+$$
+
+$$
+D e l t a 1.25 = \% o f d _ {p r e d} i n D _ {p r e d}, s. t. \max \left(\frac {d _ {p r e d}}{d _ {g t}}, \frac {d _ {g t}}{d _ {p r e d}}\right) < 1.25 \tag{13}
+$$
+
+# ADDITIONAL RESULTS AND EXAMPLES
+
+# QUANTITATIVE COMPARISON FOR DEPTH-CONDITIONED LDM
+
+As described in the main paper, to introduce depth information to aid RGB generation, an intuitive idea would be to use depth information as an explicit condition during training and inference. By compressing depth information into latent space $z_{depth}$ , it can be introduced into the denoising process of the RGB images via cross-attention, denoted as depth-conditioned LDM (DC LDM). However, we have found that such an approach often leads to blurry results, as the image examples we have shown in the main paper (more examples are shown in Fig. 11).
+
+
+Figure 11: Outpainting with a basic depth-conditioned LDM. This leads to blurry results.
+
+Since DC LDM is also trained with RGB-D images, here we report its performance on depth inputs with different degrees of visibility together with BIPS and our RGB-D PanoDiffusion, shown in Table 4.
+
+Table 4: Full quantitative results for RGB outpainting with different depth input at test time.
+
+
Methods
Input Depth
FID ↓
sFID ↓
Density ↑
Coverage ↑
BIPS
29.74
30.59
0.931
0.721
DC LDM
fully visible
77.75
44.47
0.051
0.086
RGB-D PanoDiffusion
21.90
26.87
0.829
0.693
BIPS
31.70
28.89
0.769
0.660
DC LDM
partially visible
77.77
44.44
0.054
0.080
RGB-D PanoDiffusion
22.34
26.74
0.856
0.686
BIPS
68.79
42.62
0.306
0.412
DC LDM
fully masked
78.15
44.29
0.048
0.073
RGB-D PanoDiffusion
21.55
26.95
0.867
0.708
+
+The results show that the DC LDM does not perform well in terms of both visual and quantitative results. Even if complete depth information is provided as a condition, the improvement in results is very marginal. This indicates that the conditional LDM structure cannot make good use of depth information to assist RGB panorama outpainting, which proves the effectiveness of our bi-modal LDM structure.
+
+# FULL QUANTITATIVE COMPARISON FOR REFINENET
+
+As we only show the results of our RefineNet on camera and NFoV mask in the main paper, here we report the full quantitative results on all types of masks with both RGB and RGB-D PanoDiffusion
+
+
+(a) Classical Interpolation Output
+
+
+(b) Super Resolution Output
+Figure 12: Examples of upscaled results using classical interpolation method and out superresolution GAN.
+
+(Table 5). A visualized comparison example is shown in Fig. 12. The results show that our superresolution GAN improves the quality of PanoDiffusion output comprehensively, except for a slight degradation of the sFID of RGB PanoDiffusion on the NFoV mask.
+
+Table 5: Full quantitative results for RefineNet. (-): classical interpolation. (+): super-resolution.
+
+
Mask Type
Version
SR
FID ↓
sFID ↓
Density ↑
Coverage ↑
Mask Type
Version
SR
FID ↓
sFID ↓
Density ↑
Coverage ↑
Camera
RGB-D
-
24.29
28.05
0.805
0.663
Layout
RGB-D
-
26.16
24.21
0.920
0.689
+
21.55
26.95
0.867
0.708
+
23.06
22.39
1.000
0.737
RGB
-
26.75
29.89
0.581
0.570
RGB
-
28.18
24.50
0.751
0.650
+
24.33
29.00
0.667
0.635
+
25.37
22.92
0.785
0.677
NFoV
RGB-D
-
23.96
28.19
0.775
0.645
Random Box
RGB-D
-
20.05
22.77
0.996
0.836
+
21.41
27.80
0.790
0.669
+
16.13
20.39
1.000
0.883
RGB
-
26.72
29.94
0.648
0.595
RGB
-
21.77
23.72
0.853
0.800
+
24.01
30.00
0.639
0.617
+
17.88
21.21
0.913
0.857
+
+# ABLATION STUDY ON CAMERA-ROTATION ANGLES
+
+We additionally explored the effect of different rotation angles, including $180^{\circ}$ , $90^{\circ}$ (chosen for our final result), and $45^{\circ}$ , on the outpainting results, seen as Table 6. The results show that the wrap-around consistency of outpainting results is improved across all settings. Compared to $180^{\circ}$ , $90^{\circ}$ leads to better consistency. However, diminishing the angle further to $45^{\circ}$ did not lead to additional improvements. We believe this is reasonable, as the model is expected to generate coherent content when the two ends are in contact for enough denoising steps. Therefore, smaller rotation angles than $90^{\circ}$ and longer connections do not necessarily lead to more consistent results.
+
+Table 6: Camera-rotation angles ablations.
+
+
Methods \ Mask Type
Camera
NfoV
Layout
Random Box
End
PanoDiffusion(w/o rotation)
125.82
128.33
128.10
128.19
132.69
PanoDiffusion(180°)
95.11
96.57
90.93
85.23
119.60
PanoDiffusion(90°)
90.41
89.74
88.01
85.04
116.77
PanoDiffusion(45°)
90.67
90.25
87.65
86.50
112.47
+
+# ADDITIONAL VISUALIZATION EXAMPLES OF RGB PANorama OUTPAINTING
+
+Due to page limitations, we only provide one group of comparative results for RGB outpainting in the main paper. Here we will provide more visualization examples, shown in Fig. 13. Same as in the main paper, we compare PanoDiffusion with LaMa (Suvorov et al., 2022), TFill (Zheng et al., 2022), OmniDreamer (Akimoto et al., 2022), BIPS (Oh et al., 2022), Repaint (Lugmayr et al., 2022), and Inpaint Anything (Yu et al., 2023) on different types of masks. It can be seen that our method outperforms the baseline models by generating various objects with appropriate layout, and with better visual quality. Besides, to prove that our PanoDiffusion can perform diverse and plausible completions on a given input, we provide two different outpainting results for each example.
+
+# ADDITIONAL VISUALIZATION EXAMPLES OF DEPTH PANorama SYNTHESIS
+
+Due to page limitations, we only provide one group of comparative results for Depth synthesis in the main paper. Here we will provide more visualization examples, shown in Fig. 14. Same as in the main paper, we compare PanoDiffusion with BIPS (Oh et al., 2022), NLSPN (Park et al., 2020), and CSPN (Cheng et al., 2018). It can be seen that our method outperforms the baseline models by accurately estimating the depth map.
+
+
GT RGB
+Image
Masked RGB
+Image (Input)
Ours 1
Ours 2
LaMa
TFill
BIPS
OmniDreamer
Inpaint
+Anything
RePaint
+
+
+Figure 13: Additional qualitative comparisons for RGB panorama outpainting. Our PanoDiffusion generated more objects with appropriate layout, and with better visual quality. Please zoom in to see the details.
+
+# QUALITATIVE RESULTS OF ZERO-SHOT TEST ON MATTERPORT3D DATASET.
+
+To test the generalization capability of PanoDiffusion, we conducted additional tests using a set of panorama images from the Matterport3D dataset. Here we provide six groups of examples from the outpainting results, which show that our model can have a decent outpainting effect on the real panorama dataset as well.
+
+
+Figure 14: Additional qualitative comparisons for Depth panorama synthesis. Our PanoDiffusion achieves most accurate estimation. Please zoom in to see the details.
+
+
+Figure 15: Results of zero-shot test on Matterport3D dataset. Zoom in to see the details.
+
+# QUALITATIVE RESULTS OF DISCRETE MASK ABLATION.
+
+To explicitly assess our model's performance with discrete masks, we flipped the camera mask - swapping the originally visible and invisible parts to simulate this situation. This type of mask is equivalent to randomly sampling several NFoV masks and making them invisible. Here we provide examples from the outpainting results as Fig 16.
+
+
+
+
+
+
+
+
+
+
+Figure 16: Outpainting Results on discrete masks.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Masked Image (Input)
+
+
+Generated RGB
+
+
+Generated Depth
+Figure 17: Synthesized RGB-D Panorama Outpainting Results.
+
+QUALITATIVE RESULTS OF SYNTHESIZED RGB-D PANorama RESULTS.
+
+In Fig. 17 we provide some synthesized RGB-D panorama examples where RGB is partially visible and depth is fully masked. The results show that our PanoDiffusion can outpainting plausible and consistent RGB-D panoramas simultaneously.
+
+# COMPLEXITY ANALYSIS
+
+Table 7: Training and inference time comparison
+
+
Method
Type
Depth
Training (mins/epoch)
Inference (sec/image)
PanoDiffusion
bi-modal LDM
+
82
5
BIPS
GAN
+
131
<1
RePaint
Diffusion model
-
78
45
LDM
LDM
-
72
4
OmniDreamer
Transformer + VQGAN
-
158
61
+
+For training, we compared average training time (minutes) for one epoch of PanoDiffusion against baseline models on the same devices, using the same batch size 4 and the same training dataset. For inference, we compared the time (seconds) required to infer a single image.
+
+The results show that while our model is not the fastest, it remains within a reasonable and acceptable range. It's also noteworthy that, compared to the original LDM framework, our bi-modal structure achieves a significant improvement in the quality of outpainting. This improvement comes without a proportionate increase in resource consumption – we observed only a modest increase of $13.8\%$ in training time and $25\%$ in inference time.
\ No newline at end of file
diff --git a/panodiffusion360degreepanoramaoutpaintingviadiffusion/images.zip b/panodiffusion360degreepanoramaoutpaintingviadiffusion/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4dd6de7fcb8bc797f777912d77a1945ca6c9905b
--- /dev/null
+++ b/panodiffusion360degreepanoramaoutpaintingviadiffusion/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:732223d8ab69a97d5eed0f84b64f1506c702df43826d504f97cfe9ab821b4b2e
+size 1517447
diff --git a/panodiffusion360degreepanoramaoutpaintingviadiffusion/layout.json b/panodiffusion360degreepanoramaoutpaintingviadiffusion/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b041720c8ca96a510f738ad34cdea57dc2c58755
--- /dev/null
+++ b/panodiffusion360degreepanoramaoutpaintingviadiffusion/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:82a9850115a7f7de276690a03fb6b7a4d7fcd969c85a15b403dc869af5676f27
+size 665308
diff --git a/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_content_list.json b/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..caa9b481bd8218a5b8de60c485c87a132e76a8a1
--- /dev/null
+++ b/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c09864fb4ddfd678ce96c6fa32620ec19a84b026deef6a4d343a23cf35e75574
+size 175802
diff --git a/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_model.json b/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..92264cd748221846e1f93f1984c60bbddb7ca12d
--- /dev/null
+++ b/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e429a764077365219e05480178103e94e62f30e49e264d6eff7c3fbb7531a52
+size 203458
diff --git a/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_origin.pdf b/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6fc4a4586b59dfe78173a79d5c4e1d1e6637ba8d
--- /dev/null
+++ b/parallelizingnonlinearsequentialmodelsoverthesequencelength/780516c7-792c-4bed-a463-a618813362e0_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f79b473ab4a023008cfbf6cfd9f1f13d1ade35b0b1dfa8662deed3dc34c1719c
+size 897258
diff --git a/parallelizingnonlinearsequentialmodelsoverthesequencelength/full.md b/parallelizingnonlinearsequentialmodelsoverthesequencelength/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f66b358b96870ae5a36152a773bae210278b2120
--- /dev/null
+++ b/parallelizingnonlinearsequentialmodelsoverthesequencelength/full.md
@@ -0,0 +1,780 @@
+# PARALLELIZING NON-LINEARSEQUENTIAL MODELS OVER THE SEQUENCE LENGTH
+
+Y. H. Lim $^{1}$ , Q. Zhu $^{1}$ , J. Selfridge $^{2*}$ , M. F. Kasim $^{1\dagger}$
+
+1 Machine Discovery Ltd., UK, 2 University of Oxford, UK {yi.heng, qi.zhu, muhammad}@machine-discovery.com joshua.selfridge@trinity.ox.ac.uk
+
+# ABSTRACT
+
+Sequential models, such as Recurrent Neural Networks and Neural Ordinary Differential Equations, have long suffered from slow training due to their inherent sequential nature. For many years this bottleneck has persisted, as many thought sequential models could not be parallelized. We challenge this long-held belief with our parallel algorithm that accelerates GPU evaluation of sequential models by up to 3 orders of magnitude faster without compromising output accuracy. The algorithm does not need any special structure in the sequential models' architecture, making it applicable to a wide range of architectures. Using our method, training sequential models can be more than 10 times faster than the common sequential method without any meaningful difference in the training results. Leveraging this accelerated training, we discovered the efficacy of the Gated Recurrent Unit in a long time series classification problem with 17k time samples. By overcoming the training bottleneck, our work serves as the first step to unlock the potential of non-linear sequential models for long sequence problems.
+
+# 1 INTRODUCTION
+
+Parallelization is arguably a main workhorse in driving the rapid progress in deep learning over the past decade. Through specialized hardware accelerators such as GPU and TPU, matrix multiplications which are prevalent in deep learning can be evaluated swiftly, enabling rapid trial-and-error in research. Despite the widespread use of parallelization in deep learning, sequential models such as Recurrent Neural Networks (RNN) (Hochreiter & Schmidhuber, 1997; Cho et al., 2014) and Neural Ordinary Differential Equations (NeuralODE) (Chen et al., 2018; Kidger et al., 2020) have not fully benefited from it due to their inherent need for serial evaluations over sequence lengths.
+
+Serial evaluations have become the bottleneck in training sequential deep learning models. This bottleneck might have diverted research away from se
+
+quential models. For example, attention mechanism (Bahdanau et al., 2014) and transformers (Vaswani et al., 2017) have dominated language modelling over RNN in recent years, partly due to their ability to be trained in parallel (Hooker, 2021). Continuous Normalizing Flows (CNF) (Chen et al., 2018; Grathwohl et al., 2018), which used to utilize NeuralODE as their models, has been moving towards the direction where the training does not involve simulating the ODE (Lipman et al., 2022; Rozen et al., 2021; Ben-Hamu et al., 2022). More recent works (Orvieto et al., 2023;
+
+
+(a)
+Figure 1: Evaluating sequential models using (a) sequential method and (b) iterative method that is parallelizable.
+
+
+(b)
+
+Huang et al., 2022) have attempted to resurrect the sequential RNN, but they focus on linear recurrent layers that can be evaluated in parallel with prefix scan (Blelloch, 1990; Martin & Cundy, 2018; Smith et al., 2022), leaving non-linear recurrent layers unparallelizable over their sequence length.
+
+In this paper, we present an algorithm that can parallelize the evaluation and training of non-linear sequential models like RNN and NeuralODE without changing the output of the models beyond reasonable numerical precision. We do this by introducing a general framework to solve non-linear differential equations by restating them as fixed-point iteration problems with quadratic convergence, equivalent to Newton's method for root finding. The fixed-point iteration involves parallelizable operations and an inverse linear operator that can be evaluated in parallel even for sequential models like RNN and ODE (see Figure 1). As the convergence is quadratic, the number of fixed-point iterations can be quite small especially when the initial starting point is close to the converged solution. Most importantly, the proposed algorithm does not need a special structure of sequential models, removing the need to change models' architecture to be able to take advantage of the parallelization.
+
+# 2 RELATED WORKS
+
+There have been some attempts to parallelize the evaluation and training of sequential models, especially for RNN. However, most (if not all) of them require special structures of recurrent layers. Lei et al. (2017) changed the matrix multiplication involving the states into element-wise multiplication to enable parallelization. Luo et al. (2020) segments the sequence into several groups to be evaluated by RNN in parallel and their groups interdependency are learned by a higher-level RNN. Huang et al. (2022), Orvieto et al. (2023), and Martin & Cundy (2018) use linear recurrent layer where it can be evaluated in parallel using prefix scan (Blelloch, 1990).
+
+On the NeuralODE side, the parallelization effort mainly comes from the past works in parallelizing the ODE solver. One of the main idea is the multiple shooting method (Kiehl, 1994; Gander & Vandewalle, 2007; Chartier & Philippe, 1993; Bellen & Zennaro, 1989; Lions et al., 2001) where the time sequence is split into several segments then multiple ODE solvers are executed for each segment in parallel. The process is repeated iteratively until the solutions from all segments are matched. Although multiple ODE solvers can be executed in parallel, each ODE solver itself still requires sequential operation. The multiple shooting method has been adapted in training NeuralODE in Massaroli et al. (2021). The multi-grid idea is also applied to parallelize a special RNN unit and ResNet by converting them to an ODE (Gunther et al., 2020; Moon & Cyr, 2022). Another work, neural rough ODE (Morrill et al., 2021) has shown that it is possible to train NeuralODE for very long sequence by computing log-signature of the signals over large steps and enable the ODE solver to take a big step. The calculation of the log-signature can be done in parallel. However, solving the ODE still requires sequential operation even though the time step is larger than the original.
+
+Over the past few years, there have been increasing interests in using fixed points finders (e.g., root-finder) in deep learning. DEQ (Bai et al., 2019; 2021) employs root-finding in evaluating neural networks with infinite identical layers. The concept of infinite layers paired with root-finders has been applied to various problems and has yielded impressive results (Bai et al., 2020; Liu et al., 2022; Huang et al., 2021). Nonetheless, these works do not talk about parallelizing sequential models.
+
+Several recent works have also looked into parallelizing sequential models using fixed-point iterations or root finders. In the context of stochastic generative modelling, Shih et al. (2023) divides the time span into several regions and then employs Picard iteration that are parallelizable in solving the ODE. Wang & Ragni (2021) recast RNN evaluation as a fixed-point iteration and solve it by only doing a small number of iterations without checking the convergence. As a result, this approach might produce different results than evaluating RNN sequentially. Song et al. (2021) evaluates feedforward computations by solving non-linear equations using Jacobian or Gauss-Seidel iterations. Notably, the works mentioned above only use zeroth order fixed-point iterations that converge slower than our method and might not be able to converge at all if the mapping is not contracting.
+
+# 3 DEER FRAMEWORK
+
+We will present the DEER framework: "non-linear Differential Equation as fixed point itERation" with quadratic convergence and show its relation to Newton's method. This framework can be ap-
+
+plied to 1D differential equations, i.e., ODEs, as well as differential equations in higher dimensions, i.e. Partial Differential Equations (PDEs). The same framework can also be adopted to discrete difference equations to achieve the same convergence rate, which can be applied to RNN. With the framework, we can devise a parallel algorithm to evaluate RNN and ODE without significant changes to the results.
+
+# 3.1 DEER FRAMEWORK
+
+Consider an output signal of interest $\mathbf{y}(\mathbf{r})\in \mathbb{R}^n$ which consists of $n$ signals on a $d$ -dimensional space, where the coordinate is denoted as $\mathbf{r}\in \mathbb{R}^d$ . The output signal, $\mathbf{y}(\mathbf{r})$ , might depend on an input signal, $\mathbf{x}(\mathbf{r})$ , via some non-linear delayed differential equation (DE),
+
+$$
+L [ \mathbf {y} (\mathbf {r}) ] = \mathbf {f} \left(\mathbf {y} (\mathbf {r} - \mathbf {s} _ {1}), \mathbf {y} (\mathbf {r} - \mathbf {s} _ {2}), \dots , \mathbf {y} (\mathbf {r} - \mathbf {s} _ {P}), \mathbf {x} (\mathbf {r}), \theta\right) \tag {1}
+$$
+
+where $L[\cdot ]:\mathbb{R}^n\to \mathbb{R}^n$ is the linear operator of the DE, and $\mathbf{f}$ is the non-linear function that depends on values of $\mathbf{y}$ at $P$ different locations, external inputs $\mathbf{x}$ , and parameters $\theta$ . This form is general enough to capture various continuous differential equations such as ODE (with $L[\cdot ] = d / dt$ and $\mathbf{r} = t$ ), partial differential equations (PDEs), or even a discrete difference equations for RNN.
+
+Now let's add $\mathbf{G}_p(\mathbf{r})\mathbf{y}(\mathbf{r} - \mathbf{s}_p)$ terms on the left and right hand side, where $\mathbf{G}_p(\mathbf{r}): \mathbb{R}^{n\times n}$ is an $n$ -by- $n$ matrix that depends on the location $\mathbf{r}$ . The values of $\mathbf{G}_p$ will be determined later. Equation 1 now becomes
+
+$$
+L [ \mathbf {y} (\mathbf {r}) ] + \sum_ {p = 1} ^ {P} \mathbf {G} _ {p} (\mathbf {r}) \mathbf {y} (\mathbf {r} - \mathbf {s} _ {p}) = \mathbf {f} \left(\mathbf {y} (\mathbf {r} - \mathbf {s} _ {1}), \dots , \mathbf {x} (\mathbf {r}), \theta\right) + \sum_ {p = 1} ^ {P} \mathbf {G} _ {p} (\mathbf {r}) \mathbf {y} (\mathbf {r} - \mathbf {s} _ {p}) \tag {2}
+$$
+
+$$
+\mathbf {y} (\mathbf {r}) = L _ {\mathbf {G}} ^ {- 1} \left[ \mathbf {f} \left(\mathbf {y} (\mathbf {r} - \mathbf {s} _ {1}), \dots , \mathbf {x} (\mathbf {r}), \theta\right) + \sum_ {p = 1} ^ {P} \mathbf {G} _ {p} (\mathbf {r}) \mathbf {y} (\mathbf {r} - \mathbf {s} _ {p}) \right] \tag {3}
+$$
+
+The left hand side of equation 2 is a linear equation with respect to $\mathbf{y}$ , which can be solved more easily than solving the non-linear equation in most cases. In equation 3, we introduce the notation $L_{\mathbf{G}}^{-1}[\cdot]$ as a linear operator that solves the linear operator on the left-hand side of equation 2 with some given boundary conditions.
+
+Equation 3 can be seen as a fixed-point iteration problem, i.e., given an initial guess $\mathbf{y}^{(0)}(\mathbf{r})$ , we can iteratively compute the right hand side of the equation until it converges. To analyze the convergence near the true solution, let's denote the value of $\mathbf{y}$ at $i$ -th iteration as $\mathbf{y}^{(i)}(\mathbf{r}) = \mathbf{y}^* (\mathbf{r}) + \delta \mathbf{y}^{(i)}(\mathbf{r})$ with $\mathbf{y}^{\ast}(\mathbf{r})$ as the true solution that satisfies equation 3. Putting $\mathbf{y}^{(i)}$ into equation 3 to get $\mathbf{y}^{(i + 1)}$ , and performing Taylor expansion up to the first order, we obtain
+
+$$
+\delta \mathbf {y} ^ {(i + 1)} (\mathbf {r}) = L _ {\mathbf {G}} ^ {- 1} \left[ \sum_ {p = 1} ^ {P} \left[ \partial_ {p} \mathbf {f} + \mathbf {G} _ {p} (\mathbf {r}) \right] \delta \mathbf {y} ^ {(i)} \left(\mathbf {r} - \mathbf {s} _ {p}\right) + O \left(\delta \mathbf {y} ^ {2}\right) \right] \tag {4}
+$$
+
+where $\partial_p\mathbf{f}$ is the Jacobian matrix of $\mathbf{f}$ with respect to its $p$ -th parameters. From the equation above, the first order term of $\delta \mathbf{y}^{(i + 1)}$ can be made 0 by choosing
+
+$$
+\mathbf {G} _ {p} (\mathbf {r}) = - \partial_ {p} \mathbf {f} \left(\mathbf {y} \left(\mathbf {r} - \mathbf {s} _ {1}\right), \dots , \mathbf {y} \left(\mathbf {r} - \mathbf {s} _ {P}\right), \mathbf {x} (\mathbf {r}), \theta\right). \tag {5}
+$$
+
+It shows that the fastest convergence around the solution can be achieved by choosing the matrix $\mathbf{G}_p$ according to the equation above. It can also be shown that the iteration in equation 3 and equation 5 is equivalent to the realization of Newton's method in Banach space, therefore offering a quadratic convergence. The details of the relationship can be found in Appendix A.1 and the proof of quadratic convergence can be seen in Appendix A.3.
+
+Iterative process in equation 3 involves evaluating the function $\mathbf{f}$ , its Jacobian, and matrix multiplifications that can be parallelized in modern accelerators (such as GPU and TPU). If solving the linear equation can be done in parallel, then the whole iteration process can take advantage of parallel computing. Another advantage of solving non-linear differential equations as a fixed point iteration problem in the deep learning context is that the solution from the previous training step can be used as the initial guess for the next training step if it fits in the memory. Better initial guess can lower the number of iterations required to find the solution of the non-linear DE.
+
+# 3.1.1 DERIVATIVES
+
+To utilize the framework above in deep learning context, we need to know how to calculate the forward and backward derivatives. For the forward derivative, we would like to know how much $\mathbf{y}$ is perturbed (denoted as $\delta \mathbf{y}$ ) if the parameter $\theta$ is slightly perturbed by $\delta \theta$ . By applying the Taylor series expansion to the first order to equation 1 and using $\mathbf{G}_p(\mathbf{r})$ as in equation 5, we obtain
+
+$$
+\delta \mathbf {y} = L _ {\mathbf {G}} ^ {- 1} \left[ \frac {\partial \mathbf {f}}{\partial \theta} \left(\mathbf {y} \left(\mathbf {r} - \mathbf {s} _ {1}\right), \dots , \mathbf {y} \left(\mathbf {r} - \mathbf {s} _ {P}\right), \mathbf {x} (\mathbf {r}), \theta\right) \delta \theta \right]. \tag {6}
+$$
+
+The equation above means that to compute $\delta \mathbf{y}$ , one can compute the forward derivative of the outputs of $\mathbf{f}$ from $\delta \theta$ (denoted as $\delta \mathbf{f}$ ), then execute the inverse linear operator $L_{\mathbf{G}}^{-1}$ on $\delta \mathbf{f}$ .
+
+For the backward derivative, the objective is to obtain the gradient of a loss function $\mathcal{L}$ with respect to the parameter, $\partial \mathcal{L} / \partial \theta$ , given the gradient of the loss function to the output signal, $\partial \mathcal{L} / \partial \mathbf{y}$ . To obtain the backward derivative, we write
+
+$$
+\frac {\partial \mathcal {L}}{\partial \theta} = \frac {\partial \mathcal {L}}{\partial \mathbf {y}} \frac {\partial \mathbf {y}}{\partial \theta} = \left(\left(\frac {\partial \mathcal {L}}{\partial \mathbf {y}} L _ {\mathbf {G}} ^ {- 1}\right) \frac {\partial \mathbf {f}}{\partial \theta} (\mathbf {y} (\mathbf {r} - \mathbf {s} _ {1}), \dots , \mathbf {y} (\mathbf {r} - \mathbf {s} _ {P}), \mathbf {x} (\mathbf {r}), \theta)\right). \tag {7}
+$$
+
+Note that the order of evaluation in computing the backward gradient should follow the brackets in the equation above. In contrast to equations 3 and 6, the linear operator $L_{\mathbf{G}}^{-1}$ is operated to the left in the innermost bracket in equation 7. This is known as the dual operator of $L_{\mathbf{G}}^{-1}$ and in practice can be evaluated by applying the vector-Jacobian product of the linear operator $L_{\mathbf{G}}^{-1}[\cdot]$ . The results of the dual operator in the innermost bracket are then followed by vector-Jacobian product of the function $\mathbf{f}$ . The forward and backward derivatives for $\mathbf{x}$ are similar to the expressions for $\theta$ : just substitute the differential with respect to $\theta$ into the differential with respect to $\mathbf{x}$ .
+
+The forward and backward gradient computations involve only one operation of $L_{\mathbf{G}}^{-1}$ , in contrast to the forward evaluation that requires multiple iterations of $L_{\mathbf{G}}^{-1}$ evaluations. This allows the gradient computations to be evaluated more quickly than the forward evaluation. Moreover, the trade-off between memory and speed can be made in the gradient computations. If one wants to gain the speed, the matrix $\mathbf{G}$ from the forward evaluation can be saved to be used in the gradient computation. Otherwise, the matrix $\mathbf{G}$ can be recomputed in the gradient computation to save memory.
+
+The gradient equations above apply even if the forward evaluation does not follow the algorithm in the previous subsection. For example, if equation 3 does not converge and forward evaluation is done differently (e.g., sequentially for RNN), the backward gradient can still be computed in parallel according to equation 7. This might still provide some acceleration during the training.
+
+# 3.2 PRACTICAL IMPLEMENTATION
+
+Equation 1 has a very general form that can capture ordinary differential equations (ODEs), most partial differential equations (PDEs), and even discrete difference equations. To apply DEER framework in equation 3 to a problem, there are several steps that need to be followed. The first step is to recast the problem into equation 1 to define the variable $\mathbf{y}$ , the linear operator $L[\cdot]$ , and the nonlinear function $\mathbf{f}(\cdot)$ . The second step is to implement what we call the shifter function. The shifter function takes the whole discretized values of $\mathbf{y}(\mathbf{r})$ and returns a list of the values of $\mathbf{y}$ at the shifted positions, i.e. $\mathbf{y}(\mathbf{r} - \mathbf{s}_p)$ for $p = \{1,\dots,P\}$ . The shifter function might need some additional information such as the initial or boundary conditions. The output of the shifter function will be the input to the non-linear function. The next step, and usually the hardest step, is to implement the inverse operator $L_{\mathbf{G}}^{-1}[\mathbf{h}]$ given the list of matrices $\mathbf{G}_p$ and the vector values $\mathbf{h}$ discretized at some points. The inverse operator $L_{\mathbf{G}}^{-1}[\mathbf{h}]$ might also need the information on the boundary conditions.
+
+Once everything is defined, iterating equation 3 can be implemented following the code in appendix B.1. The Jacobian matrix in equation 5 can be calculated using automatic differentiation packages (Paszke et al., 2017; Frostig et al., 2018).
+
+DEER framework can be applied to any differential or difference equations as long as the requirements above can be provided. This includes ordinary differential equations, discrete sequential models, and even partial differential equations (see Appendix A.4). To keep focused, we only present the application of DEER in parallelizing ODE and discrete sequential models.
+
+# 3.3 PARALLELIZING ORDINARY DIFFERENTIAL EQUATIONS (ODE)
+
+An ODE typically takes the form of $d\mathbf{y} / dt = \mathbf{f}(\mathbf{y}(t),\mathbf{x}(t),\theta)$ where the initial condition $\mathbf{y}(0)$ is given. The ODE form above can be represented by equation 1 with $\mathbf{r} = t$ , $L = d / dt$ , $P = 1$ , and $\mathbf{s}_1 = 0$ . This means that the operator $L_{\mathbf{G}}^{-1}$ in ODE is equivalent to solving the linear equation below given the initial condition $\mathbf{y}(0)$ ,
+
+$$
+\frac {d \mathbf {y}}{d t} (t) + \mathbf {G} (t) \mathbf {y} (t) = \mathbf {z} (t) \iff \mathbf {y} (t) = L _ {\mathbf {G}} ^ {- 1} [ \mathbf {z} (t) ]. \tag {8}
+$$
+
+Assuming that $\mathbf{G}(t)$ and $\mathbf{z}(t)$ are constants between $t = t_i$ and $t = t_{i + 1}$ as $\mathbf{G}_i$ and $\mathbf{z}_i$ respectively, we can write the relations between $\mathbf{y}_{i + 1} = \mathbf{y}(t_{i + 1})$ and $\mathbf{y}_i = \mathbf{y}(t_i)$ as
+
+$$
+\mathbf {y} _ {i + 1} = \bar {\mathbf {G}} _ {i} \mathbf {y} _ {i} + \bar {\mathbf {z}} _ {i} \tag {9}
+$$
+
+with $\bar{\mathbf{G}}_i = \exp (-\mathbf{G}_i\Delta_i)$ , $\bar{\mathbf{z}}_i = \mathbf{G}_i^{-1}(\mathbf{I} - \bar{\mathbf{G}}_i)\mathbf{z}_i$ , $\Delta_i = t_{i + 1} - t_i$ , $\mathbf{I}$ the identity matrix, and $\exp (\cdot)$ the matrix exponential. Equation 9 can be evaluated using the parallel prefix scan algorithm as described in Blelloch (1990) and Smith et al. (2022). Specifically, we define a pair of variables $c_{i + 1} = (\bar{\mathbf{G}}_i|\bar{\mathbf{z}}_i)$ for every discrete time point $t_i$ , the initial values $c_{0} = (\mathbf{I}|\mathbf{y}_{0})$ , and an associative operator,
+
+$$
+c _ {i + 1} \bullet c _ {j + 1} = \left(\bar {\mathbf {G}} _ {j} \bar {\mathbf {G}} _ {i} \mid \bar {\mathbf {G}} _ {j} \bar {\mathbf {z}} _ {i} + \bar {\mathbf {z}} _ {j}\right). \tag {10}
+$$
+
+Given the initial value of $c_{0}$ and the associative operator above, we can run the associative scan in parallel to get the cumulative value of the operator above. The solution $\mathbf{y}_i$ can be taken from the second element of the results of the parallel scan operator.
+
+On the implementation note, we can reduce the computational error by taking the $\mathbf{G}_i$ and $\mathbf{z}_i$ as the mid-point value, i.e. $\mathbf{G}_i = \frac{1}{2} [\mathbf{G}(t_i) + \mathbf{G}(t_{i + 1})]$ and $\mathbf{z}_i = \frac{1}{2} [\mathbf{z}(t_i) + \mathbf{z}(t_{i + 1})]$ . By taking the mid-point value, we can obtain the third order local truncation error $O(\Delta_i^3)$ instead of second order error using either the left or the right value, with only a small amount of additional computational expenses. The details can be seen in Appendix A.5.
+
+The materialization of DEER framework on ODE can be seen as direct multiple shooting method (Chartier & Philippe, 1993; Massaroli et al., 2021) that splits the time horizon as multiple regions. However, in our case each region is infinitesimally small, making the Newton step follows equation 9 and parallelizable. The details of the relationship between our method with direct multiple shooting method can be seen in Appendix A.2.
+
+# 3.4 PARALLELIZING RNN
+
+Recurrent Neural Network (RNN) can be seen as a discretization of ODE. Having the input signal at index $i$ as $\mathbf{x}_i$ and the previous states $\mathbf{y}_{i - 1}$ , the current states can be written as $\mathbf{y}_i = \mathbf{f}(\mathbf{y}_{i - 1},\mathbf{x}_i,\theta)$ . This form can capture the common RNN units, such as LSTM (Hochreiter & Schmidhuber, 1997) and GRU (Cho et al., 2014). Also, the form can be written as equation 1 with $\mathbf{r} = i$ , $L[\mathbf{y}] = \mathbf{y}$ , $P = 1$ and $\mathbf{s}_1 = 1$ . This means that the inverse linear operator can be calculated by solving the equation below, given the initial states $\mathbf{y}_0$ ,
+
+$$
+\mathbf {y} _ {i} + \mathbf {G} _ {i} \mathbf {y} _ {i - 1} = \mathbf {z} _ {i} \Longleftrightarrow \mathbf {y} _ {1 \dots T} = L _ {\mathbf {G}} ^ {- 1} [ \mathbf {z} _ {1 \dots T} ]. \tag {11}
+$$
+
+Solving the equation above is equivalent to solving equation 9 from the previous subsection. It means that it can be parallelized by using the parallel prefix scan with the defined associative operator in equation 10.
+
+# 3.5 COMPLEXITY AND LIMITATIONS
+
+The algorithms for solving non-linear ODE and RNN in parallel are simply repeatedly evaluating equation 3 from an initial guess. However, the equation requires the explicit Jacobian matrix for each sequence element for each shift. If $\mathbf{y}$ has $n$ elements, $L$ sampling points, and $P$ shifted arguments, storing the Jacobian matrices requires $O(n^{2}LP)$ memory. Also, the prefix scan for solving the linear differential equation requires matrix multiplication of matrices $\mathbf{G}_p$ at different sampling points. This would introduce $O(n^{3}LP)$ time complexity. As the algorithm has $O(n^{2})$ memory complexity and $O(n^{3})$ time complexity, this algorithm would offer significant acceleration for small number of $n$ .
+
+
+
+
+Figure 2: The speed up of GRU calculated using DEER method (this paper) vs commonly-used sequential method on a V100 GPU for (top) forward and (bottom) forward + gradient calculations. The missing data for large number of dimensions and sequence lengths is due to insufficient memory in the DEER method. The bar height represents the mean speed up over 5 different random seeds.
+
+As the proposed method is a realization of Newton's method in Banach space, it has the same limitations as Newton's method. If the starting point is sufficiently far from the solution, the iteration might not converge. This problem might be addressed by using modified Newton's method with convergence guarantee such as Nesterov & Polyak (2006) and Doikov & Nesterov (2023). However, we leave the use of globally-converged Newton's method as the future work.
+
+There is only one additional hyperparameter in our method: the tolerance for convergence. As our method has quadratic convergence, the tolerance value does not have a big effect on the number of iterations required for convergence, as long as it is not too close to the numerical precision value and not too big. In fact, using respectively $10^{-4}$ and $10^{-7}$ for single- and double-precision floating point precisions are enough for our experiments.
+
+Parallelizing ODE and RNN both require parallelizing the evaluation of equations 9 and 11. Those equations can be parallelized using parallel prefix scan of a custom associative operation in equation 10. This is relatively straightforward using JAX's jax.laxassociative.scan (Frostig et al., 2018) or TensorFlow's tfp.math.scan_associative (Abadi, 2016). However, as of the time of writing this paper, this operation cannot be implemented easily using PyTorch (Paszke et al., 2017). For this reason, we used JAX for our experiments in this paper as well as flax and equinox (Kidger & Garcia, 2021) for the neural networks.
+
+# 4 EXPERIMENTS
+
+# 4.1 PERFORMANCE BENCHMARKING
+
+The first test is to compare the speed on evaluating an RNN using the presented DEER method against the common sequential method. Specifically, we're using an untrained Gated Recurrent Unit (GRU) cell from flax.linen (a JAX neural network framework) using 32-bits floating points random inputs with 16 batch size, various number of dimensions (i.e., $n$ ), and various number of sequence lengths. The initial guess for DEER is all zeros for all the benchmark runs. The speed up on a V100 GPU obtained by the method presented in this paper is shown in figure 2.
+
+
+Figure 3: (a) The comparison between the outputs of GRU evaluated with sequential method vs DEER method. The line for sequential method output is almost not visible because overlaid by the output of DEER method. Only the last 200 indices are shown for clarity. (b) The difference between the outputs of sequential and DEER method for the whole 10k sample length.
+
+
+
+The figure shows that the largest speed up is achieved on long sequence lengths with small number of dimensions. With 1M sequence length, 16 batch size, and $n = 1$ , the sequential evaluation required 8.7 s while DEER method only took 15 ms, which translates to a speed up of over 500. However, the speed up decreases as the number of dimensions increases, where the speed up is only about 25% with 64 dimensions (64 hidden elements in GRU). This is due to the explicit computation of Jacobian matrix and the matrix multiplication that scales to $O(n^3)$ .
+
+The speed up for forward $^+$ gradient calculations is even greater than the speed up for forward evaluations only. With the same set up, the speed up for 1M sequence length with 1 dimension could be more than 1000 times faster. This is because the backward gradient calculations require only one evaluation of $L_{\mathbf{G}}^{-1}$ in equation 7 as opposed to multiple evaluations in forward calculations.
+
+Table 4 in Appendix C.2 presents the tables of speed up for Figure 2 as well as speed up when using smaller batch sizes. Generally, the speed up increases with smaller batch size, where speed up of above 2600 can be achieved with batch size 2. This means that with more devices, greater speed up can be achieved by having a distributed data parallel, effectively reducing the batch size per device.
+
+Figure 3 shows the comparison between the output of an untrained GRU of 32 hidden elements evaluated using sequential vs DEER method. The input to the GRU is a Gaussian-random tensor with 10k sequence length and 32 dimensions. From figure 3, we see that the output of GRU evaluated using DEER method is almost identical to the output obtained using the sequential method. The small error in figure 3(b) is due to numerical precision limits of the single precision floating point.
+
+# 4.2 LEARNING PHYSICAL SYSTEMS WITH NEURALODE
+
+We test the capability of DEER method in training a deep neural network model using a simple case from physics. Given the positions and velocities as a function of time of a two-body system interacting with gravitational force, we trained Hamiltonian Neural Networks (HNN) (Greydanus et al., 2019) to match the data. There are $n = 8$ states in this case. Note that this set up is different from the original HNN paper where they train the network to match the velocity + acceleration, given position + velocity at every point in time. In this case, only positions and velocities as a function of time are given and the network needs to solve the ODE to make a prediction. We use 10,000 time points sampled uniformly, whereas other works in this area typically only use less than 1,000 sampling points for the training (Matsubara & Yaguchi, 2022; Chen et al., 2019). The details of the setup can be seen in Appendix B.2.
+
+The losses during the training using DEER method vs using RK45 (Atkinson, 1991) are shown in figure 4(a, b). We use the RK45 algorithm from JAX's experimental feature. From the figure, it can be seen that the training can be 11 times faster when using DEER method presented in this paper than using the ordinary ODE solver without significant difference in the validation losses between the two methods. To achieve 55k training steps, DEER method only spent 1 day + 6 hours, while training with RK45 required about 2 weeks of training. The small difference of the validation losses between the two methods potentially comes from different methods in solving the ODE as well as from the numerical precision issue as shown in Figure 3(b).
+
+
+
+
+
+
+Figure 4: (Top) The validation losses of HNN with NeuralODE training using DEER method (shown in blue) vs RK45 method (in orange) as a function of (a) training hours and (b) training steps. (Bottom) The validation accuracy of RNN training using DEER method (blue) vs the sequential method (orange) as a function of (c) training hours and (d) training steps.
+
+
+
+# 4.3 TIME-SERIES CLASSIFICATION WITH RECURRENT NEURAL NETWORK (RNN)
+
+Faster training enabled by DEER method allows us to use classical RNN architectures, such as Gated Recurrent Unit (GRU, Cho et al. (2014)), for problems with long time series. In this subsection, we trained a neural network that consists of GRUs to classify Eigen-Worms dataset (Brown et al., 2013) from UEA (Bagnall et al., 2018) with 17,984 time samples for each entry. The details of the training and architecture can be found in Appendix B.3.
+
+Figure 4(c)-(d) shows the comparison of validation accuracy during the training of the GRU network using DEER method vs the common sequential method. From the figure, we can see that the validation accuracy plot when using DEER is similar to the validation plot obtained with the sequential method. The difference in the validation accuracy might be due to numerical precision issue as shown in Figure 3(b) that
+
+is accumulated at long sequence. However, the training using DEER is up to 22 times faster than the training using the sequential method. What would have taken more than 1 day to train using the common sequential method, only takes 1 hour using DEER.
+
+The classification results of the test dataset from EigenWorms for various methods are shown in Table 1. As we can see from the table, the network with GRUs can be as competitive as more
+
+
Model
Accuracy (%)
ODE-RNN (folded), step: 128
47.9 ± 5.3
NCDE, step: 4
66.7 ± 11.8
NRDE (depth 3), step: 32
75.2 ± 3.0
NRDE (depth 2), step: 128
76.1 ± 5.9
NRDE (depth 2), step: 4
83.8 ± 3.0
UnICORNN (2 layers)
90.3 ± 3.0
LEM
92.3 ± 1.8
GRU (from this paper)
88.0 ± 4.4
LEM (our reproducibility attempt)
92.3 ± 2.1
+
+Table 1: The classification accuracy of EigenWorms dataset for various methods, including folded ODE-RNN (Rubanova et al., 2019), Neural CDE (Kidger et al., 2020), Neural RDE (Morrill et al., 2021), UnICORNN (Rusch & Mishra, 2021), LEM (Rusch et al., 2021), and GRU. The mean and standard deviations of the accuracy were obtained from 3 times repetition with different seeds. The numbers of non-GRU methods were obtained from Morrill et al. (2021) and Rusch et al. (2021).
+
+modern methods (Morrill et al., 2021; Rusch & Mishra, 2021; Rusch et al., 2021) for this long time series dataset. The long training time of GRUs using the sequential method could be the main factor hindering the trial-and-error process of exploring GRU architectures for this dataset with long sequences. However, our DEER method enables much faster training of GRUs, facilitating iterative experimentation to identify optimal GRU architectures and hyperparameters.
+
+To demonstrate the applicability of DEER to other architecture, we performed an experiment to reproduce the results from LEM (Rusch et al., 2021). The reimplementation of LEM from PyTorch to JAX makes the reproducibility attempt not straightforward. Moreover, as the EigenWorms dataset is very small, slight changes could change the results quite significantly. With DEER, we can run more experiments than using sequential methods, allowing us to tune hyperparameters faster. Our attempt has produced similar results to the original attempt at Rusch et al. (2021). With DEER, one epoch can be done in 18 seconds while the sequential method could take about 116 seconds.
+
+# 4.4 SEQUENCE CLASSIFICATION WITH MULTIPLE HEADS RNN
+
+One way to avoid unfavorable scaling with respect to $n$ in DEER is to use multi-head recurrent unit. For example, instead of having a unit with $n = 256$ channels, we split the unit into 32 heads with each head has $n = 8$ channels. Each head can also have different strides with exponentially increasing values, for example, the first head has stride $2^{0}$ , second head has stride $2^{1}$ , and so on. The use of multiple heads is inline with the idea from state-spaces (Gu et al., 2021b; a; 2022; Smith et al., 2022) where states are grouped and each group has different length scale.
+
+We performed an experiment using the multihead GRU on a standard sequential CIFAR-10 dataset. The details of the experimental setup can be found in Appendix B.4. Running an experiment with DEER using multi-head GRU is about 3 times faster than using sequential method. The speed up is not as big as in the previous subsections because of shorter effective sequence lengths due to larger strides. However, the speed up still allows us to run multiple experiments to find a good configuration.
+
+
Model
Accuracy
State-space or linear recurrent
LSSL (Gu et al., 2021b)
84.65%
S4 (Gu et al., 2021a)
91.80%
Liquid-S4 (Hasani et al., 2022)
92.02%
LRU (Orvieto et al., 2023)
89.0%
Convolution
TrellisNet (Bai et al., 2018)
73.42%
FlexConv (Romero et al., 2021)
80.82%
MultiresNet (Shi et al., 2023)
93.15%
Non-linear recurrent
r-LSTM (Trinh et al., 2018)
72.2%
UR-GRU (Gu et al., 2020)
74.4%
Multi-head GRU (ours)
90.25%
+
+Table 2: The classification test dataset accuracy of sequential CIFAR-10 dataset for various methods, grouped according to their architecture classes. Underlined scores are the best score for each architecture class.
+
+Table 2 shows that multi-head GRU can achieve $89.35\%$ test accuracy. Although the result is not the state-of-the-art, this is the best result on sequential CIFAR-10 using non-linear recurrent units. We show that a simple modification of GRU and the capability to run more experiments enabled by DEER has uncover the potential of classical recurrent units such as GRU in competing with more modern architectures. Please note that our aim for this paper is not to focus on new architectures, but to focus on a new computational method that enables faster experimentation on non-linear sequential models. Finding new non-linear sequential models enabled by DEER is for the future work.
+
+# 5 CONCLUSION
+
+We introduced a method to parallelize the evaluation and training of inherently sequential models, such as ODE and RNN. Evaluations using our approach can be up to 3 orders of magnitude faster than traditional sequential methods when dealing with long sequences. When training sequential models with reasonable settings, our method can achieve over a 10-fold speed increase without significantly altering the results. By having a technique to accelerate the training and evaluation of sequential models, we anticipate a hastened pace of research in this domain, potentially catalyzing the emergence of novel and interesting non-linear sequential models in the future.
+
+# REPRODUCIBILITY STATEMENT
+
+The code required for reproducing the algorithm and results in this paper can be found in https://github.com/machine-discovery/deer/.
+
+# ACKNOWLEDGEMENT
+
+We acknowledge the support from Google Cloud start up program for their cloud computing credit that being used in large part of this research.
+
+# REFERENCES
+
+Martín Abadi. Tensorflow: learning functions at scale. In Proceedings of the 21st ACM SIGPLAN international conference on functional programming, pp. 1-1, 2016.
+Kendall Atkinson. An introduction to numerical analysis. John wiley & sons, 1991.
+Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
+Anthony Bagnall, Hoang Anh Dau, Jason Lines, Michael Flynn, James Large, Aaron Bostrom, Paul Southam, and Eamonn Keogh. The uea multivariate time series classification archive, 2018. arXiv preprint arXiv:1811.00075, 2018.
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
+Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. arXiv preprint arXiv:1810.06682, 2018.
+Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Deep equilibrium models. Advances in Neural Information Processing Systems, 32, 2019.
+Shaojie Bai, Vladlen Koltun, and J Zico Kolter. Multiscale deep equilibrium models. Advances in Neural Information Processing Systems, 33:5238-5250, 2020.
+Shaojie Bai, Vladlen Koltun, and J Zico Kolter. Neural deep equilibrium solvers. In International Conference on Learning Representations, 2021.
+Alfredo Bellen and Marino Zennaro. Parallel algorithms for initial-value problems for difference and differential equations. Journal of Computational and applied mathematics, 25(3):341-350, 1989.
+Heli Ben-Hamu, Samuel Cohen, Joey Bose, Brandon Amos, Maximillian Nickel, Aditya Grover, Ricky TQ Chen, and Yaron Lipman. Matching normalizing flows and probability paths on manifolds. In International Conference on Machine Learning, pp. 1749-1763. PMLR, 2022.
+Guy E Blelloch. Prefix sums and their applications. 1990.
+Andre EX Brown, Eviatar I Yemini, Laura J Grundy, Tadas Jucikas, and William R Schafer. A dictionary of behavioral motifs reveals clusters of genes affecting caenorhabditis elegans locomotion. Proceedings of the National Academy of Sciences, 110(2):791-796, 2013.
+P Chartier and B Philippe. A parallel shooting technique for solving dissipative ode's. Computing, 51(3-4):209-236, 1993.
+Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. Advances in neural information processing systems, 31, 2018.
+Zhengdao Chen, Jianyu Zhang, Martin Arjovsky, and Léon Bottou. Symplectic recurrent neural networks. In International Conference on Learning Representations, 2019.
+
+Kyunghyun Cho, Bart Van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
+Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In International conference on machine learning, pp. 933-941. PMLR, 2017.
+Nikita Doikov and Yuri Nesterov. Gradient regularization of newton method with bregman distances. Mathematical Programming, pp. 1-25, 2023.
+Roy Frostig, Matthew James Johnson, and Chris Leary. Compiling machine learning programs via high-level tracing. Systems for Machine Learning, 4(9), 2018.
+Martin J Gander and Stefan Vandewalle. Analysis of the parareal time-parallel time-integration method. SIAM Journal on Scientific Computing, 29(2):556-578, 2007.
+Will Grathwohl, Ricky TQ Chen, Jesse Bettencourt, Ilya Sutskever, and David Duvenaud. Ffjord: Free-form continuous dynamics for scalable reversible generative models. In International Conference on Learning Representations, 2018.
+Samuel Greydanus, Misko Dzamba, and Jason Yosinski. Hamiltonian neural networks. Advances in neural information processing systems, 32, 2019.
+Albert Gu, Caglar Gulcehre, Thomas Paine, Matt Hoffman, and Razvan Pascanu. Improving the gating mechanism of recurrent neural networks. In International Conference on Machine Learning, pp. 3800-3809. PMLR, 2020.
+Albert Gu, Karan Goel, and Christopher Ré. Efficiently modeling long sequences with structured state spaces. arXiv preprint arXiv:2111.00396, 2021a.
+Albert Gu, Isys Johnson, Karan Goel, Khaled Saab, Tri Dao, Atri Rudra, and Christopher Ré. Combining recurrent, convolutional, and continuous-time models with linear state space layers. Advances in neural information processing systems, 34:572-585, 2021b.
+Albert Gu, Karan Goel, Ankit Gupta, and Christopher Re. On the parameterization and initialization of diagonal state space models. Advances in Neural Information Processing Systems, 35:35971-35983, 2022.
+Stefanie Gunther, Lars Ruthotto, Jacob B Schroder, Eric C Cyr, and Nicolas R Gauger. Layer-parallel training of deep residual neural networks. SIAM Journal on Mathematics of Data Science, 2(1):1-23, 2020.
+Ramin Hasani, Mathias Lechner, Tsun-Hsuan Wang, Makram Chahine, Alexander Amini, and Daniela Rus. Liquid structural state-space models. arXiv preprint arXiv:2209.12951, 2022.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735-1780, 1997.
+Sara Hooker. The hardware lottery. Communications of the ACM, 64(12):58-65, 2021.
+Feiqing Huang, Kexin Lu, CAI Yuxi, Zhen Qin, Yanwen Fang, Guangjian Tian, and Guodong Li. Encoding recurrence into transformers. In The Eleventh International Conference on Learning Representations, 2022.
+Zhichun Huang, Shaojie Bai, and J Zico Kolter. Implicit²: Implicit layers for implicit representations. Advances in Neural Information Processing Systems, 34:9639-9650, 2021.
+Carl T Kelley. Iterative methods for linear and nonlinear equations. SIAM, 1995.
+Patrick Kidger and Cristian Garcia. Equinox: neural networks in JAX via callable PyTrees and filtered transformations. Differentiable Programming workshop at Neural Information Processing Systems 2021, 2021.
+
+Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. Advances in Neural Information Processing Systems, 33:6696-6707, 2020.
+Martin Kiehl. Parallel multiple shooting for the solution of initial value problems. Parallel computing, 20(3):275-295, 1994.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Tao Lei, Yu Zhang, Sida I Wang, Hui Dai, and Yoav Artzi. Simple recurrent units for highly parallelizable recurrence. arXiv preprint arXiv:1709.02755, 2017.
+Jacques-Louis Lions, Yvon Maday, and Gabriel Turinici. Résolution d'edp par un schéma en temps "pararéel". Comptes Rendus de l'Académie des Sciences-Series I-Mathematics, 332(7):661-668, 2001.
+Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations, 2022.
+Juncheng Liu, Bryan Hooi, Kenji Kawaguchi, and Xiaokui Xiao. Mgnni: Multiscale graph neural networks with implicit layers. Advances in Neural Information Processing Systems, 35:21358-21370, 2022.
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+Yi Luo, Zhuo Chen, and Takuya Yoshioka. Dual-path rnn: efficient long sequence modeling for time-domain single-channel speech separation. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 46-50. IEEE, 2020.
+Eric Martin and Chris Cundy. Parallelizing linear recurrent neural nets over sequence length. In International Conference on Learning Representations, 2018.
+Stefano Massaroli, Michael Poli, Sho Sonoda, Taiji Suzuki, Jinkyoo Park, Atsushi Yamashita, and Hajime Asama. Differentiable multiple shooting layers. Advances in Neural Information Processing Systems, 34:16532-16544, 2021.
+Takashi Matsubara and Takaharu Yaguchi. Finde: Neural differential equations for finding and preserving invariant quantities. In The Eleventh International Conference on Learning Representations, 2022.
+Gordon Euhyun Moon and Eric C Cyr. Parallel training of gru networks with a multi-grid solver for long sequences. arXiv preprint arXiv:2203.04738, 2022.
+James Morrill, Christopher Salvi, Patrick Kidger, and James Foster. Neural rough differential equations for long time series. In International Conference on Machine Learning, pp. 7829-7838. PMLR, 2021.
+Yurii Nesterov and Boris T Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177-205, 2006.
+Antonio Orvieto, Samuel L Smith, Albert Gu, Anushan Fernando, Caglar Gulcehre, Razvan Pascanu, and Soham De. Resurrecting recurrent neural networks for long sequences. arXiv preprint arXiv:2303.06349, 2023.
+Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
+David W Romero, Robert-Jan Bruintjes, Jakub M Tomczak, Erik J Bekkers, Mark Hoogendoorn, and Jan C van Gemert. Flexconv: Continuous kernel convolutions with differentiable kernel sizes. arXiv preprint arXiv:2110.08059, 2021.
+
+Noam Rozen, Aditya Grover, Maximilian Nickel, and Yaron Lipman. Moser flow: Divergence-based generative modeling on manifolds. Advances in Neural Information Processing Systems, 34:17669-17680, 2021.
+Yulia Rubanova, Ricky TQ Chen, and David K Duvenaud. Latent ordinary differential equations for irregularly-sampled time series. Advances in neural information processing systems, 32, 2019.
+T Konstantin Rusch and Siddhartha Mishra. Unicornn: A recurrent model for learning very long time dependencies. In International Conference on Machine Learning, pp. 9168-9178. PMLR, 2021.
+T Konstantin Rusch, Siddhartha Mishra, N Benjamin Erichson, and Michael W Mahoney. Long expressive memory for sequence modeling. arXiv preprint arXiv:2110.04744, 2021.
+Jiaxin Shi, Ke Alexander Wang, and Emily Fox. Sequence modeling with multiresolution convolutional memory. In International Conference on Machine Learning, pp. 31312-31327. PMLR, 2023.
+Andy Shih, Suneel Belkhale, Stefano Ermon, Dorsa Sadigh, and Nima Anari. Parallel sampling of diffusion models. arXiv preprint arXiv:2305.16317, 2023.
+Jimmy TH Smith, Andrew Warrington, and Scott W Linderman. Simplified state space layers for sequence modeling. arXiv preprint arXiv:2208.04933, 2022.
+Yang Song, Chenlin Meng, Renjie Liao, and Stefano Ermon. Accelerating feedforward computation via parallel nonlinear equation solving. In International Conference on Machine Learning, pp. 9791-9800. PMLR, 2021.
+Trieu Trinh, Andrew Dai, Thang Luong, and Quoc Le. Learning longer-term dependencies in rnns with auxiliary losses. In International Conference on Machine Learning, pp. 4965-4974. PMLR, 2018.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
+Zhengxiong Wang and Anton Ragni. Approximate fixed-points in recurrent neural networks. arXiv preprint arXiv:2106.02417, 2021.
+
+# A THEORETICAL RESULTS
+
+# A.1 RELATIONTO NEWTON'S METHOD
+
+The main method presented in this paper is basically a realization of Newton's method in Banach space. Finding the root of functional $\mathbf{q}(\mathbf{y}) = \mathbf{0}$ can be done by performing the Newton's method iteration $\mathbf{y}^{(i + 1)} = \mathbf{y}^{(i)} - [D\mathbf{q}(\mathbf{y}^{(i)})]^{-1}\mathbf{q}(\mathbf{y}^{(i)})$ where $D\mathbf{q}$ is the Fréchet derivative of $\mathbf{q}$ . In equation 1, the function $\mathbf{q}(\mathbf{y})$ is given by $\mathbf{q}(\mathbf{y}(\mathbf{r})) = L[\mathbf{y}(\mathbf{r})] - \mathbf{f}(\mathbf{y}(\mathbf{r} - \mathbf{s}_1),\dots,\mathbf{x}(\mathbf{r}),\theta)$ . Therefore, the Fréchet derivative of functional $\mathbf{q}$ operated on a function $\mathbf{h}(\mathbf{r})$ is given by
+
+$$
+D \mathbf {q} (\mathbf {y}) [ \mathbf {h} (\mathbf {r}) ] = L [ \mathbf {h} (\mathbf {r}) ] - \sum_ {p = 1} ^ {P} \partial_ {p} \mathbf {f h} (\mathbf {r} - \mathbf {s} _ {p}). \tag {12}
+$$
+
+Therefore, the Newton's method iteration to find the root of functional $\mathbf{q}(\mathbf{y}) = \mathbf{0}$ is
+
+$$
+\mathbf {y} ^ {(i + 1)} = \mathbf {y} ^ {(i)} - \left(D \mathbf {q} (\mathbf {y})\right) ^ {- 1} \left[ L \left[ \mathbf {y} ^ {(i)} \right] - \mathbf {f} \left(\mathbf {y} ^ {(i)} \left(\mathbf {r} - \mathbf {s} _ {1}\right), \dots , \mathbf {x} (\mathbf {r}), \theta\right) \right]. \tag {13}
+$$
+
+The inverse Fréchet derivative terms can be computed by solving the equation below for $\mathbf{y}^{(i)} - \mathbf{y}^{(i + 1)}$ ,
+
+$$
+D \mathbf {q} (\mathbf {y}) [ \mathbf {y} ^ {(i)} - \mathbf {y} ^ {(i + 1)} ] = L [ \mathbf {y} ^ {(i)} ] - \mathbf {f} (\mathbf {y} ^ {(i)} (\mathbf {r} - \mathbf {s} _ {1}), \dots , \mathbf {x} (\mathbf {r}), \theta) \tag {14}
+$$
+
+Expanding $D\mathbf{q}(\mathbf{y})$ from equation 12 on $\mathbf{y}^{(i)}$ , we obtain
+
+$$
+D \mathbf {q} (\mathbf {y}) [ \mathbf {y} ^ {(i + 1)} ] = \mathbf {f} \left(\mathbf {y} ^ {(i)} \left(\mathbf {r} - \mathbf {s} _ {1}\right), \dots , \mathbf {x} (\mathbf {r}), \theta\right) - \sum_ {p = 1} ^ {P} \partial_ {p} \mathbf {f} \mathbf {y} ^ {(i)} \left(\mathbf {r} - \mathbf {s} _ {p}\right) \tag {15}
+$$
+
+Solving for $\mathbf{y}^{(i + 1)}$ on the equation above will produce the equation 3, showing that equation 3 is just a realization of Newton's method in solving equation 1.
+
+# A.2 RELATION TO DIRECT MULTIPLE SHOOTING
+
+One popular way to parallelize an ODE solver is to perform direct multiple shooting (MS) method (Chartier & Philippe, 1993; Massaroli et al., 2021). The following parts will follow Massaroli et al. (2021) very closely. Consider an initial value problem with $d\mathbf{y} / dt = \mathbf{f}(\mathbf{y},t)$ for $t\in [0,T]$ with $\mathbf{y}(0) = \mathbf{y}_0$ . With MS, we first split the time horizon into $N$ multiple regions with $0 = t_0 < t_1 < t_2 < \ldots < t_N = T$ , have a guess on initial values at each region, $\mathbf{y}(t_i) = \mathbf{b}_i$ , then apply the ODE solver for each region. After applying the ODE, the guessed values $\mathbf{b}_i$ can then be updated to match the results of ODE from the previous region. Denote a function $\phi (\mathbf{b}_i,t_i,t_{i + 1})$ as the value of $\mathbf{y}$ at $t_{i + 1}$ after solving the initial value problem with initial value $\mathbf{y}(t_i) = \mathbf{b}_i$ . Evaluating this function $\phi$ requires solving an ODE from $t_i$ to $t_{i + 1}$ . With the function above, we can write the constraints to be solved, $\mathbf{b}_{i + 1} = \phi (\mathbf{b}_i,t_i,t_{i + 1})$ with $\mathbf{b}_0 = \mathbf{y}_0$ .
+
+The works by Chartier & Philippe (1993) and Massaroli et al. (2021) update $\mathbf{b}_i$ by applying Newton method. Specifically, at $k$ -th iteration with values of $\mathbf{b}_i^{(k)}$ are available for all $i$ -s, the values at the next iteration can be determined by (Massaroli et al., 2021)
+
+$$
+\mathbf {b} _ {i + 1} ^ {(k + 1)} = \phi \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}, t _ {i + 1}\right) + \frac {\partial \phi}{\partial \mathbf {b}} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}, t _ {i + 1}\right) \left(\mathbf {b} _ {i} ^ {(k + 1)} - \mathbf {b} _ {i} ^ {(k)}\right); \quad \mathbf {b} _ {0} ^ {(k + 1)} = \mathbf {y} _ {0}. \tag {16}
+$$
+
+The term $\mathbf{b}_i^{(k + 1)}$ makes the equation above needs to be evaluated sequentially, in addition to computing the function $\phi$ that requires solving an ODE.
+
+If we assume there are large numbers of regions, $N \to \infty$ and $\Delta t_{i} = t_{i + 1} - t_{i} \to 0$ , then the MS method becomes equivalent to the DEER realization on solving the ODE. In this limit, we can write
+
+$$
+\phi \left(\mathbf {b} _ {i}, t _ {i}, t _ {i + 1}\right) = \mathbf {b} _ {i} + \mathbf {f} \left(\mathbf {b} _ {i}, t _ {i}\right) \Delta t _ {i} \text {a n d} \frac {\partial \phi}{\partial \mathbf {b}} = \mathbf {I} + \frac {\partial \mathbf {f}}{\partial \mathbf {b}} \left(\mathbf {b} _ {i}, t _ {i}\right), \tag {17}
+$$
+
+with $\Delta t_{i} = t_{i + 1} - t_{i}$ and $\mathbf{I}$ an identity matrix. Substituting equation 17 to equation 16, we obtain
+
+$$
+\mathbf {b} _ {i + 1} ^ {(k + 1)} = \left(\mathbf {I} + \frac {\partial \mathbf {f}}{\partial \mathbf {b}} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}\right) \Delta t _ {i}\right) \mathbf {b} _ {i} ^ {(k + 1)} + \left[ \mathbf {f} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}\right) - \frac {\partial \mathbf {f}}{\partial \mathbf {b}} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}\right) \mathbf {b} _ {i} ^ {(k)} \right] \Delta t _ {i}. \tag {18}
+$$
+
+By re-arranging the equation above, we get
+
+$$
+\left(\frac {\mathbf {b} _ {i + 1} ^ {(k + 1)} - \mathbf {b} _ {i} ^ {(k + 1)}}{\Delta t _ {i}}\right) - \frac {\partial \mathbf {f}}{\partial \mathbf {b}} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}\right) \mathbf {b} _ {i} ^ {(k + 1)} = \mathbf {f} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}\right) - \frac {\partial \mathbf {f}}{\partial \mathbf {b}} \left(\mathbf {b} _ {i} ^ {(k)}, t _ {i}\right) \mathbf {b} _ {i} ^ {(k)}. \tag {19}
+$$
+
+With the limit $\Delta t_i\to 0$ and $N\to \infty$ , the term $\mathbf{b}_i$ can be written as $\mathbf{y}(t_i)$ and $(\mathbf{b}_{i + 1}^{(k + 1)} - \mathbf{b}_i^{(k)}) / \Delta t_i$ equals to $d\mathbf{y}^{(k + 1)} / dt$ . By rewriting the equation above in $\mathbf{y}$ , we obtain
+
+$$
+\frac {d \mathbf {y} ^ {(k + 1)}}{d t} - \frac {\partial \mathbf {f}}{\partial \mathbf {y}} (\mathbf {y} ^ {(k)}, t) \mathbf {y} ^ {(k + 1)} = \mathbf {f} (\mathbf {y} ^ {(k)}, t) - \frac {\partial \mathbf {f}}{\partial \mathbf {y}} (\mathbf {y} ^ {(k)}, t) \mathbf {y} ^ {(k)}. \tag {20}
+$$
+
+With a little bit of algebra, one can show that the equation above is equivalent to equations 3 and 8. By having a large number of regions, we can approximate $\phi$ as in equation 17 that can be evaluated very quickly.
+
+# A.3 PROOF OF QUADRATIC CONVERGENCE OF DEER ITERATION
+
+This proof is inspired by standard results on the order of convergence of Newton's method and follows the argument of Kelley (1995), §§4 and 5.1. Throughout, we will make repeated use of the Cauchy-Schwarz (CS) and triangle (T) inequalities.
+
+We employ the standard Euclidean norm on $\mathbb{R}^n$
+
+$$
+\left\| \mathbf {y} \right\| := \sqrt {\mathbf {y} \cdot \mathbf {y}} = \sqrt {y _ {1} ^ {2} + \cdots + y _ {n} ^ {2}}, \mathbf {y} = (y _ {1}, \dots , y _ {n}) ^ {T} \in \mathbb {R} ^ {n}, \tag {21}
+$$
+
+and the induced operator norm on $\mathbb{R}^{n\times n}$
+
+$$
+\left\| \mathbf {A} \right\| := \sup \left\{\left\| \mathbf {A} \mathbf {y} \right\|, \left\| \mathbf {y} \right\| = 1, \mathbf {A} \in \mathbb {R} ^ {n \times n}, \mathbf {y} \in \mathbb {R} ^ {n} \right\}. \tag {22}
+$$
+
+Note that the Fréchet derivative $D\mathbf{q}(\mathbf{y}) \in \mathbb{R}^{n \times n}$ .
+
+We denote the value of $\mathbf{y}$ at the $i$ th iteration as $\mathbf{y}^{(i)}(\mathbf{r}) = \mathbf{y}^* (\mathbf{r}) + \delta \mathbf{y}^{(i)}(\mathbf{r})$ , where $\mathbf{y}^*$ exactly satisfies equation 3. Following on from A.1, we assume that $D\mathbf{q}(\mathbf{y})$ is Lipschitz continuous with Lipschitz constant $\gamma$ , i.e.:
+
+$$
+\left\| D \mathbf {q} (\mathbf {y}) - D \mathbf {q} (\mathbf {z}) \right\| \leq \gamma \| \mathbf {y} - \mathbf {z} \| \quad \forall \mathbf {y}, \mathbf {z} \in \mathbb {R} ^ {n}. \tag {23}
+$$
+
+Consider the operators $\mathbf{A} = D\mathbf{q}(\mathbf{y})$ and $\mathbf{B} = D\mathbf{q}(\mathbf{y}^*)$ . We assume that both are invertible and that $\left\| \mathbf{I} - \mathbf{B}^{-1}\mathbf{A}\right\| < 1$ :
+
+$$
+\begin{array}{l} \mathbf {A} ^ {- 1} \mathbf {B} = \left(\mathbf {I} - \left(\mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A}\right)\right) ^ {- 1} \\ = \sum_ {n = 0} ^ {\infty} \left(\mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A}\right) ^ {n} \quad (\text {N e u m a n n s e r i e s f o r m a t r i x i n v e r s e}). \tag {24} \\ \end{array}
+$$
+
+Post-multiplying by $\mathbf{B}^{-1}$ and taking norms:
+
+$$
+\begin{array}{l} \left\| \mathbf {A} ^ {- 1} \right\| = \left\| \left(\sum_ {n = 0} ^ {\infty} \left(\mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A}\right) ^ {n}\right) \mathbf {B} ^ {- 1} \right\| \\ \stackrel {(C S)} {\leq} \left\| \sum_ {n = 0} ^ {\infty} \left(\mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A}\right) ^ {n} \right\| \| \mathbf {B} ^ {- 1} \| \\ \stackrel {(T)} {\leq} \left(\sum_ {n = 0} ^ {\infty} \left\| \left(\mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A}\right) ^ {n} \right\|\right) \| \mathbf {B} ^ {- 1} \| \tag {25} \\ \stackrel {(C S)} {\leq} \left(\sum_ {n = 0} ^ {\infty} \left\| \mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A} \right\| ^ {n}\right) \left\| \mathbf {B} ^ {- 1} \right\| \\ = \frac {\left\| \mathbf {B} ^ {- 1} \right\|}{1 - \left\| \mathbf {I} - \mathbf {B} ^ {- 1} \mathbf {A} \right\|} \\ \left\| \left[ D \mathbf {q} (\mathbf {y}) \right] ^ {- 1} \right\| \leq \frac {\left\| \left[ D \mathbf {q} (\mathbf {y} ^ {*}) \right] ^ {- 1} \right\|}{1 - \left\| \mathbf {I} - \left[ D \mathbf {q} (\mathbf {y} ^ {*}) \right] ^ {- 1} D \mathbf {q} (\mathbf {y}) \right\|}. \\ \end{array}
+$$
+
+We denote the ball of radius $\epsilon$ as $\mathcal{B}(\epsilon) = \{\mathbf{y} \mid \| \delta \mathbf{y} \| < \epsilon\}$ , where $\delta \mathbf{y} = \mathbf{y} - \mathbf{y}^*$ .
+
+$$
+\begin{array}{l} \left\| \mathbf {I} - \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} D \mathbf {q} (\mathbf {y}) \right\| = \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \left(D \mathbf {q} \left(\mathbf {y} ^ {*}\right) - D \mathbf {q} (\mathbf {y})\right) \right\| \\ \stackrel {(C S)} {\leq} \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\| \left\| D \mathbf {q} \left(\mathbf {y} ^ {*}\right) - D \mathbf {q} (\mathbf {y}) \right\| \tag {26} \\ \stackrel {(2 3)} {\leq} \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\| \gamma \| \mathbf {y} ^ {*} - \mathbf {y} \| \\ = \gamma \| \delta \mathbf {y} \| \| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \| \\ \end{array}
+$$
+
+Let $0 < \epsilon < \left(2\gamma \left\| [D\mathbf{q}(\mathbf{y}^{*})]^{-1}\right\|\right)^{-1}$ . Then $\forall \mathbf{y} \in \mathcal{B}(\epsilon)$ :
+
+$$
+\begin{array}{l} \left\| \mathbf {I} - \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} D \mathbf {q} (\mathbf {y}) \right\| \leq \gamma \| \delta \mathbf {y} \| \| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \| \\ \leq \gamma \epsilon \| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \| \tag {27} \\ < \frac {1}{2}. \\ \end{array}
+$$
+
+This means that
+
+$$
+\left\| \left[ D \mathbf {q} (\mathbf {y}) \right] ^ {- 1} \right\| \leq 2 \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\|. \tag {28}
+$$
+
+The fundamental theorem of calculus can be expressed as:
+
+$$
+\mathbf {q} (\mathbf {y}) - \mathbf {q} \left(\mathbf {y} ^ {*}\right) = \int_ {0} ^ {1} D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \left(\mathbf {y} - \mathbf {y} ^ {*}\right)\right) \left(\mathbf {y} - \mathbf {y} ^ {*}\right) d \lambda \tag {29}
+$$
+
+$$
+\mathbf {q} (\mathbf {y}) = \int_ {0} ^ {1} D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y}\right) \delta \mathbf {y} d \lambda .
+$$
+
+Therefore,
+
+$$
+\begin{array}{l} \delta \mathbf {y} ^ {(i + 1)} = \delta \mathbf {y} ^ {(i)} - [ D \mathbf {q} (\mathbf {y} ^ {(i)}) ] ^ {- 1} \mathbf {q} (\mathbf {y} ^ {(i)}) \\ = \delta \mathbf {y} ^ {(i)} - \left[ D \mathbf {q} \left(\mathbf {y} ^ {(i)}\right) \right] ^ {- 1} \int_ {0} ^ {1} D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)}\right) \delta \mathbf {y} ^ {(i)} d \lambda \tag {30} \\ = \left[ D \mathbf {q} \left(\mathbf {y} ^ {(i)}\right) \right] ^ {- 1} \int_ {0} ^ {1} \left(D \mathbf {q} \left(\mathbf {y} ^ {(i)}\right) - D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)}\right)\right) \delta \mathbf {y} ^ {(i)} d \lambda . \\ \end{array}
+$$
+
+Let $\mathbf{y}^{(i)}\in \mathcal{B}(\epsilon)$ . Then:
+
+$$
+\begin{array}{l} \left\| \delta \mathbf {y} ^ {(i + 1)} \right\| = \left\| [ D \mathbf {q} (\mathbf {y} ^ {(i)}) ] ^ {- 1} \int_ {0} ^ {1} \left(D \mathbf {q} (\mathbf {y} ^ {(i)}) - D \mathbf {q} (\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)})\right) \delta \mathbf {y} ^ {(i)} d \lambda \right\| \\ \stackrel {(C S)} {\leq} \left\| [ D \mathbf {q} (\mathbf {y} ^ {(i)}) ] ^ {- 1} \right\| \left\| \int_ {0} ^ {1} \left(D \mathbf {q} (\mathbf {y} ^ {(i)}) - D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)}\right)\right) \delta \mathbf {y} ^ {(i)} d \lambda \right\| \\ \stackrel {(2 8)} {\leq} 2 \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\| \left\| \int_ {0} ^ {1} \left(D \mathbf {q} \left(\mathbf {y} ^ {(i)}\right) - D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)}\right)\right) \delta \mathbf {y} ^ {(i)} d \lambda \right\| \\ \stackrel {(T)} {\leq} 2 \left\| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \right\| \int_ {0} ^ {1} \left\| \left(D \mathbf {q} (\mathbf {y} ^ {(i)}) - D \mathbf {q} (\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)})\right) \delta \mathbf {y} ^ {(i)} \right\| d \lambda \\ \stackrel {(C S)} {\leq} 2 \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\| \int_ {0} ^ {1} \left\| D \mathbf {q} \left(\mathbf {y} ^ {(i)}\right) - D \mathbf {q} \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)}\right) \right\| d \lambda \left\| \delta \mathbf {y} ^ {(i)} \right\| \tag {31} \\ \stackrel {(2 3)} {\leq} 2 \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\| \int_ {0} ^ {1} \gamma \left\| \mathbf {y} ^ {(i)} - \left(\mathbf {y} ^ {*} + \lambda \delta \mathbf {y} ^ {(i)}\right) \right\| d \lambda \left\| \delta \mathbf {y} ^ {(i)} \right\| \\ = 2 \left\| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \right\| \int_ {0} ^ {1} \gamma \left\| (1 - \lambda) \delta \mathbf {y} ^ {(i)} \right\| d \lambda \left\| \delta \mathbf {y} ^ {(i)} \right\| \\ \stackrel {(C S)} {\leq} 2 \left\| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \right\| \int_ {0} ^ {1} \gamma \| 1 - \lambda \| d \lambda \left\| \delta \mathbf {y} ^ {(i)} \right\| ^ {2} \\ = 2 \left\| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \right\| \frac {\gamma}{2} \left\| \delta \mathbf {y} ^ {(i)} \right\| ^ {2} \\ = \gamma \| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \| \| \delta \mathbf {y} ^ {(i)} \| ^ {2}. \\ \end{array}
+$$
+
+So $\left\| \delta \mathbf{y}^{(i + 1)}\right\|$ is bounded by $\left\| \delta \mathbf{y}^{(i)}\right\| ^2$ with constant $\gamma \left\| [D\mathbf{q}(\mathbf{y}^{*})]^{-1}\right\|$ . For quadratic convergence, the norms of successive errors must decrease. If we shrink $\epsilon$ such that $\gamma \epsilon \left\| [D\mathbf{q}(\mathbf{y}^{*})]^{-1}\right\| < 1$ , then:
+
+$$
+\begin{array}{l} \left\| \delta \mathbf {y} ^ {(i + 1)} \right\| \leq \gamma \left\| \left[ D \mathbf {q} \left(\mathbf {y} ^ {*}\right) \right] ^ {- 1} \right\| \left\| \delta \mathbf {y} ^ {(i)} \right\| ^ {2} \\ < \gamma \epsilon \| [ D \mathbf {q} (\mathbf {y} ^ {*}) ] ^ {- 1} \| \| \delta \mathbf {y} ^ {(i)} \| \tag {32} \\ < \left\| \delta \mathbf {y} ^ {(i)} \right\| \\ \end{array}
+$$
+
+and the sequence therefore converges quadratically to $\mathbf{y}^*$ .
+
+
+
+# A.4 APPLICATION TO PARTIAL DIFFERENTIAL EQUATIONS (PDEs)
+
+We have mentioned that equation 1 can be applied to Partial Differential Equations (PDEs). As this paper is concerning about Ordinary Differential Equations (ODEs) and discrete difference equation, we only present in this appendix the example of equation 1 in representing a simple PDE. Let's rewrite the equation 1 as a reminder,
+
+$$
+L [ \mathbf {y} (\mathbf {r}) ] = \mathbf {f} \left(\mathbf {y} (\mathbf {r} - \mathbf {s} _ {1}), \dots , \mathbf {y} (\mathbf {r} - \mathbf {s} _ {P}), \mathbf {x} (\mathbf {r}), \theta\right), \tag {33}
+$$
+
+where $L[\cdot ]$ is the linear operator, $\mathbf{f}$ is the non-linear function, $\mathbf{y}$ is the signal of interest, $\mathbf{x}$ is the external signal, $\mathbf{r}$ is the coordinate, $\theta$ is the parameters of $\mathbf{f}$ , and $\mathbf{s}_i$ is the shifted location.
+
+We will take the Burgers' equation as an example. Burgers' equation can be written as
+
+$$
+\frac {\partial u}{\partial t} + \frac {1}{2} \frac {\partial \left(u ^ {2}\right)}{\partial x} - \nu \frac {\partial^ {2} u}{\partial x ^ {2}} = 0 \tag {34}
+$$
+
+where $u$ is a function of $x$ and $t$ , $u(x,t)$ . If we define $w = u^2$ , we can write the Burgers' equation to be
+
+$$
+\left( \begin{array}{c c} \frac {\partial}{\partial t} - v \frac {\partial^ {2}}{\partial x ^ {2}} & \frac {1}{2} \frac {\partial}{\partial x} \\ 0 & 1 \end{array} \right) \left( \begin{array}{c} u \\ w \end{array} \right) = \left( \begin{array}{c} 0 \\ u ^ {2} \end{array} \right). \tag {35}
+$$
+
+From the equation above, we can define the signal of interest $\mathbf{y} = (u,w)^T$ , the coordinates $\mathbf{r} = (x,t)^T$ , the non-linear function $\mathbf{f} = (0,u^2)^T$ , and the linear operator
+
+$$
+L = \left( \begin{array}{c c} \frac {\partial}{\partial t} - v \frac {\partial^ {2}}{\partial x ^ {2}} & \frac {1}{2} \frac {\partial}{\partial x} \\ 0 & 1 \end{array} \right). \tag {36}
+$$
+
+Given the relations between the Burgers' equation and equation 1, we can analytically compute the $\mathbf{G}$ matrix and the argument of $L_{\mathbf{G}}^{-1}$ ,
+
+$$
+\mathbf {G} = - \frac {\partial \mathbf {f}}{\partial \mathbf {y}} = \left( \begin{array}{l l} 0 & 0 \\ - 2 u & 0 \end{array} \right) \tag {37}
+$$
+
+$$
+\mathbf {h} = \mathbf {f} + \mathbf {G y} = \binom {0} {- u ^ {2}}. \tag {38}
+$$
+
+Therefore, the linear operation that needs to be solved, $L_{\mathbf{G}}^{-1}[\mathbf{h}]$ , is
+
+$$
+\frac {\partial u}{\partial t} + \frac {1}{2} \frac {\partial w}{\partial x} - \nu \frac {\partial^ {2} u}{\partial x ^ {2}} = 0 \tag {39}
+$$
+
+$$
+g _ {2 1} (x, t) u + w = h _ {2} (x, t), \tag {40}
+$$
+
+given $h_2(x,t) = -u^2$ and $g_{21}(x,t) = -2u$ with $u$ from the previous iteration. The equations above can still be further simplified into
+
+$$
+\left[ \frac {\partial}{\partial t} - \frac {g _ {2 1} (x , t)}{2} \frac {\partial}{\partial x} - \frac {1}{2} \frac {\partial g _ {2 1}}{\partial x} (x, t) - \nu \frac {\partial^ {2}}{\partial x ^ {2}} \right] u = - \frac {1}{2} \frac {\partial h _ {2}}{\partial x} (x, t). \tag {41}
+$$
+
+The equation above can be repeatedly evaluated until the convergence is achieved.
+
+# A.5 ERROR BOUND ON TAKING THE MIDPOINTS IN ODE
+
+The exact analytical solution to the ODE
+
+$$
+\frac {d \mathbf {y}}{d t} (t) + \mathbf {G} (t) \mathbf {y} (t) = \mathbf {z} (t) \tag {42}
+$$
+
+is
+
+$$
+\mathbf {y} (t) = e ^ {- \mathbf {M} (t)} \left[ \mathbf {y} (0) + \int_ {0} ^ {t} e ^ {\mathbf {M} (\tau)} \mathbf {z} (\tau) d \tau \right], \tag {43}
+$$
+
+where
+
+$$
+\mathbf {M} (t) = \int_ {0} ^ {t} \mathbf {G} (\lambda) d \lambda . \tag {44}
+$$
+
+Equation 43 is the form that equation 3 takes in the ODE case. The approximation we wish to take involves inserting $\mathbf{G}(t) = \frac{1}{2} (\mathbf{G}(t_i) + \mathbf{G}(t_{i+1}))$ and $\mathbf{z}(t) = \frac{1}{2} (\mathbf{z}(t_i) + \mathbf{z}(t_{i+1}))$ into 43, which yields equation 9. In order to find the local truncation error when applying this method, we need to find and compare the Taylor expansions of equations 43 and 9.
+
+We define $\square_0^{(n)} = \left.\frac{d^n\square}{dt^n}\right|_{t = 0}$ so that, for instance, $\mathbf{G}_0 = \mathbf{G}(0),\mathbf{G}_0' = \left.\frac{d\mathbf{G}}{dt}\right|_{t = 0},\mathbf{G}_0'' = \left.\frac{d^2\mathbf{G}}{dt^2}\right|_{t = 0}$ and $\mathbf{G}_0^{(3)} = \left.\frac{d^3\mathbf{G}}{dt^3}\right|_{t = 0}$ . We can then write the Taylor expansion of $\mathbf{M}(t)$ as:
+
+$$
+\begin{array}{l} \mathbf {M} (t) = \int_ {0} ^ {t} \mathbf {G} (\lambda) d \lambda \\ = \int_ {0} ^ {t} \left(\mathbf {G} _ {0} + \mathbf {G} _ {0} ^ {\prime} \lambda + \frac {1}{2} \mathbf {G} _ {0} ^ {\prime \prime} \lambda^ {2} + \mathcal {O} (\lambda^ {3})\right) d \lambda \tag {45} \\ = \mathbf {G} _ {0} t + \frac {1}{2} \mathbf {G} _ {0} ^ {\prime} t ^ {2} + \frac {1}{6} \mathbf {G} _ {0} ^ {\prime \prime} t ^ {3} + \mathcal {O} (t ^ {4}), \\ \end{array}
+$$
+
+whence we immediately get
+
+$$
+\mathbf {M} _ {0} ^ {(n)} = \mathbf {G} _ {0} ^ {(n - 1)}, \tag {46}
+$$
+
+as expected from the Leibniz integral rule. Therefore:
+
+$$
+\begin{array}{l} e ^ {\pm \mathbf {M} (t)} = \mathbf {I} \pm \mathbf {M} (t) + \frac {1}{2} \mathbf {M} (t) ^ {2} \pm \frac {1}{6} \mathbf {M} (t) ^ {3} + \mathcal {O} (\mathbf {M} (t) ^ {4}) \\ = \mathbf {I} \pm \mathbf {G} _ {0} t + \frac {1}{2} \left(\mathbf {G} _ {0} ^ {2} \pm \mathbf {G} _ {0} ^ {\prime}\right) t ^ {2} \pm \frac {1}{1 2} \left(2 \mathbf {G} _ {0} ^ {3} \pm 3 \mathbf {G} _ {0} \mathbf {G} _ {0} ^ {\prime} \pm 3 \mathbf {G} _ {0} ^ {\prime} \mathbf {G} _ {0} + 2 \mathbf {G} _ {0} ^ {\prime \prime}\right) t ^ {3} + \mathcal {O} (t ^ {4}) \\ \equiv \mathbf {I} \pm \mathbf {G} _ {0} t + \mathbf {A} _ {\pm} t ^ {2} \pm \mathbf {B} _ {\pm} t ^ {3} + \mathcal {O} \left(t ^ {4}\right), \tag {47} \\ \end{array}
+$$
+
+where for ease of notation we have introduced the new variables $\mathbf{A}_{\pm} = \frac{1}{2}\left(\mathbf{G}_0^2 \pm \mathbf{G}_0'\right)t^2$ and $\mathbf{B}_{\pm} = \frac{1}{12}\left(2\mathbf{G}_0^3 \pm 3\mathbf{G}_0\mathbf{G}_0' \pm 3\mathbf{G}_0'\mathbf{G}_0 + 2\mathbf{G}_0''\right)$ . As the ODE in section 3 is originally cast in the form $\frac{dy}{dt} = f(y(t), x(t), \theta)$ , the right hand side of 42 is
+
+$$
+\mathbf {z} (t) = \mathbf {f} (\mathbf {y} (t), \mathbf {x} (t), \theta) + \mathbf {G} (t) \mathbf {y} (t), \tag {48}
+$$
+
+which can be expressed using the Taylor expansions of $\mathbf{f}$ , $\mathbf{G}$ , and $\mathbf{y}$ as:
+
+$$
+\mathbf {z} (t) = \mathbf {f} _ {0} + \mathbf {G} _ {0} \mathbf {y} _ {0} + \left(\mathbf {f} _ {0} ^ {\prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0}\right) t + \frac {1}{2} \left(\mathbf {f} _ {0} ^ {\prime \prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime \prime} + 2 \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime \prime} \mathbf {y} _ {0}\right) t ^ {2} + \mathcal {O} (t ^ {3}). \tag {49}
+$$
+
+Then,
+
+$$
+\begin{array}{l} \int_ {0} ^ {t} e ^ {\mathbf {M} (\tau)} \mathbf {z} (\tau) d \tau = \int_ {0} ^ {t} \left(\mathbf {I} + \mathbf {G} _ {0} \tau + \mathbf {A} _ {+} \tau^ {2} + \mathcal {O} (\tau^ {3})\right) \left(\mathbf {f} _ {0} + \mathbf {G} _ {0} \mathbf {y} _ {0} + \left(\mathbf {f} _ {0} ^ {\prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0}\right) \tau^ {2}\right). \\ \left. + \frac {1}{2} \left(\mathbf {f} _ {0} ^ {\prime \prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime \prime} + 2 \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime \prime} \mathbf {y} _ {0}\right) \tau^ {2} + \mathcal {O} (\tau^ {3})\right) d \tau \\ = \left(\mathbf {f} _ {0} + \mathbf {G} _ {0} \mathbf {y} _ {0}\right) t + \frac {1}{2} \left(\mathbf {f} _ {0} ^ {\prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} + \mathbf {G} _ {0} \mathbf {f} _ {0} + \mathbf {G} _ {0} ^ {2} \mathbf {y} _ {0}\right) t ^ {2} \\ + \frac {1}{6} \left(\mathbf {f} _ {0} ^ {\prime \prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime \prime} + 2 \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime \prime} \mathbf {y} _ {0} + 2 \mathbf {G} _ {0} \mathbf {f} _ {0} ^ {\prime} + 2 \mathbf {G} _ {0} ^ {2} \mathbf {y} _ {0} ^ {\prime} + 2 \mathbf {G} _ {0} \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} \right. \\ \left. + \mathbf {G} _ {0} ^ {2} \mathbf {f} _ {0} + \mathbf {G} _ {0} ^ {3} \mathbf {y} _ {0} + \mathbf {G} _ {0} ^ {\prime} \mathbf {f} _ {0} + \mathbf {G} _ {0} ^ {\prime} \mathbf {G} _ {0} \mathbf {y} _ {0}\right) t ^ {3} + \mathcal {O} \left(t ^ {4}\right) \\ \equiv \mathbf {C} t + \mathbf {D} t ^ {2} + \mathbf {E} t ^ {3} + \mathcal {O} (t ^ {4}), \tag {50} \\ \end{array}
+$$
+
+where we have introduced $\mathbf{C}$ , $\mathbf{D}$ , and $\mathbf{E}$ as the coefficients of $t$ , $t^2$ , and $t^3$ respectively. Then,
+
+$$
+\begin{array}{l} e ^ {- \mathbf {M} (t)} \int_ {0} ^ {t} e ^ {\mathbf {M} (\tau)} \mathbf {z} (\tau) d \tau = \left(\mathbf {I} - \mathbf {G} _ {0} t + \mathbf {A} _ {-} t ^ {2} + \mathcal {O} (t ^ {3})\right) \left(\mathbf {C} t + \mathbf {D} t ^ {2} + \mathbf {E} t ^ {3} + \mathcal {O} (t ^ {4})\right) \\ = \left(\mathbf {f} _ {0} + \mathbf {G} _ {0} \mathbf {y} _ {0}\right) t + \frac {1}{2} \left(\mathbf {f} _ {0} ^ {\prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} - \mathbf {G} _ {0} \mathbf {f} _ {0} - \mathbf {G} _ {0} ^ {2} \mathbf {y} _ {0}\right) t ^ {2} \\ + \frac {1}{6} \left(\mathbf {f} _ {0} ^ {\prime \prime} + \mathbf {G} _ {0} \mathbf {y} _ {0} ^ {\prime \prime} + 2 \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} ^ {\prime} + \mathbf {G} _ {0} ^ {\prime \prime} \mathbf {y} _ {0} - \mathbf {G} _ {0} \mathbf {f} _ {0} ^ {\prime} - \mathbf {G} _ {0} ^ {2} \mathbf {y} _ {0} ^ {\prime} \right. \\ \left. - \mathbf {G} _ {0} \mathbf {G} _ {0} ^ {\prime} \mathbf {y} _ {0} + \mathbf {G} _ {0} ^ {2} \mathbf {f} _ {0} + \mathbf {G} _ {0} ^ {3} \mathbf {y} _ {0} - 2 \mathbf {G} _ {0} ^ {\prime} \mathbf {f} _ {0} - 2 \mathbf {G} _ {0} ^ {\prime} \mathbf {G} _ {0} \mathbf {y} _ {0}\right) t ^ {3} + \mathcal {O} (t ^ {4}) \\ \equiv \mathbf {F} t + \mathbf {H} t ^ {2} + \mathbf {J} t ^ {3} + \mathcal {O} \left(t ^ {4}\right), \tag {51} \\ \end{array}
+$$
+
+where again we have introduced new variables for the coefficients: $\mathbf{F},\mathbf{H}$ , and $\mathbf{J}$ . We define $\square_{i} = \square(t_{i})$ , and take $t_{i} = 0$ and $t = t_{i+1}$ . This means that $\square_{0} = \square_{i}$ and we can substitute $t$ with $\Delta_{i}$ . Therefore, treating equation 43 as a fixed-point iteration problem gives:
+
+$$
+\begin{array}{l} \mathbf {y} ^ {(i + 1)} (\Delta_ {i}) = e ^ {- \mathbf {M} (\Delta_ {i})} \left[ \mathbf {y} (0) + \int_ {0} ^ {\Delta_ {i}} e ^ {\mathbf {M} (\tau)} \left(\mathbf {f} (\mathbf {y} ^ {(i)} (\tau), \mathbf {x} (\tau), \theta) + \mathbf {G} (\tau) \mathbf {y} ^ {(i)} (\tau)\right) d \tau \right] \\ = \left(\mathbf {I} - \mathbf {G} _ {i} \Delta_ {i} + \mathbf {A} _ {-} \Delta_ {i} ^ {2} - \mathbf {B} _ {-} \Delta_ {i} ^ {3}\right) \mathbf {y} _ {i} + \mathbf {F} \Delta_ {i} + \mathbf {H} \Delta_ {i} ^ {2} + \mathbf {J} \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right) \\ = \mathbf {y} _ {i} + \mathbf {f} _ {i} \Delta_ {i} + \frac {1}{2} \left(\mathbf {f} _ {i} ^ {\prime} + \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime} - \mathbf {G} _ {i} \mathbf {f} _ {i}\right) \Delta_ {i} ^ {2} + \frac {1}{6} \left(\mathbf {f} _ {i} ^ {\prime \prime} + \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime \prime} + 2 \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} ^ {\prime} - \mathbf {G} _ {i} \mathbf {f} _ {i} ^ {\prime} - \mathbf {G} _ {i} ^ {2} \mathbf {y} _ {i} ^ {\prime} \right. \\ \left. + \frac {1}{2} \mathbf {G} _ {i} \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} + \mathbf {G} _ {i} ^ {2} \mathbf {f} _ {i} - 2 \mathbf {G} _ {i} ^ {\prime} \mathbf {f} _ {i} - \frac {1}{2} \mathbf {G} _ {i} ^ {\prime} \mathbf {G} _ {i} \mathbf {y} _ {i}\right) \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right). \tag {52} \\ \end{array}
+$$
+
+As $\mathbf{z}(t) = \mathbf{f}(\mathbf{y}(t),\mathbf{x}(t),\theta) + \mathbf{G}(t)\mathbf{y}(t)$ , equation 9 is:
+
+$$
+\begin{array}{l} \mathbf {y} _ {i + 1} = e ^ {- \mathbf {G} _ {c} \Delta_ {i}} \mathbf {y} _ {i} + \mathbf {G} _ {c} ^ {- 1} \left(\mathbf {I} - e ^ {- \mathbf {G} _ {c} \Delta_ {i}}\right) \left(\mathbf {f} _ {c} + \mathbf {G} _ {c} \mathbf {y} _ {c}\right) \\ = \left(\mathbf {I} - \mathbf {G} _ {c} \Delta_ {i} + \frac {1}{2} \mathbf {G} _ {c} ^ {2} \Delta_ {i} ^ {2} - \frac {1}{6} \mathbf {G} _ {c} ^ {3} \Delta_ {i} ^ {3}\right) \mathbf {y} _ {i} + \mathbf {G} _ {c} ^ {- 1} \left(\mathbf {G} _ {c} \Delta_ {i} - \frac {1}{2} \mathbf {G} _ {c} ^ {2} \Delta_ {i} ^ {2} + \frac {1}{6} \mathbf {G} _ {c} ^ {3} \Delta_ {i} ^ {3}\right) \\ \times \left(\mathbf {f} _ {c} + \mathbf {G} _ {c} \mathbf {y} _ {c}\right) + \mathcal {O} \left(\Delta_ {i} ^ {4}\right) \\ = \mathbf {y} _ {i} + \left(\mathbf {f} _ {c} + \mathbf {G} _ {c} \left(\mathbf {y} _ {c} - \mathbf {y} _ {i}\right)\right) \Delta_ {i} - \frac {1}{2} \left(\mathbf {G} _ {c} \mathbf {f} _ {c} + \mathbf {G} _ {c} ^ {2} \left(\mathbf {y} _ {c} - \mathbf {y} _ {i}\right)\right) \Delta_ {i} ^ {2} + \frac {1}{6} \left(\mathbf {G} _ {c} ^ {2} \mathbf {f} _ {c} + \mathbf {G} _ {c} ^ {3} \left(\mathbf {y} _ {c} - \mathbf {y} _ {i}\right)\right) \\ \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right), \tag {53} \\ \end{array}
+$$
+
+with $\mathbf{f}_c = \frac{1}{2} (\mathbf{f}_i + \mathbf{f}_{i + 1}),\mathbf{G}_c = \frac{1}{2} (\mathbf{G}_i + \mathbf{G}_{i + 1})$ , and $\mathbf{y}_c = \frac{1}{2}\left(\mathbf{y}_i + \mathbf{y}_{i + 1}\right)$ for $t_i\leq t < t_{i + 1}$
+
+The Taylor expansions of the midpoint approximations are:
+
+$$
+\mathbf {f} _ {c} = \mathbf {f} _ {i} + \frac {1}{2} \mathbf {f} _ {i} ^ {\prime} \Delta_ {i} + \frac {1}{4} \mathbf {f} _ {i} ^ {\prime \prime} \Delta_ {i} ^ {2} + \mathcal {O} (\Delta_ {i} ^ {3})
+$$
+
+$$
+\mathbf {G} _ {c} = \mathbf {G} _ {i} + \frac {1}{2} \mathbf {G} _ {i} ^ {\prime} \Delta_ {i} + \frac {1}{4} \mathbf {G} _ {i} ^ {\prime \prime} \Delta_ {i} ^ {2} + \mathcal {O} \left(\Delta_ {i} ^ {3}\right) \tag {54}
+$$
+
+$$
+\mathbf {y} _ {c} = \mathbf {y} _ {i} + \frac {1}{2} \mathbf {y} _ {i} ^ {\prime} \Delta_ {i} + \frac {1}{4} \mathbf {y} _ {i} ^ {\prime \prime} \Delta_ {i} ^ {2} + \mathcal {O} (\Delta_ {i} ^ {3}).
+$$
+
+Recall that $\mathbf{y}^{(i + 1)}(\Delta_i)$ is the $(i + 1)$ th iterated guess of the form of $\mathbf{y}$ , given $\mathbf{y}(0)$ and the previous guess $\mathbf{y}^{(i)}(t)$ , evaluated at $t = t_{i + 1} = \Delta_i$ . Meanwhile, $\mathbf{y}_{i + 1}$ is the value of the approximation to $\mathbf{y}^{(i + 1)}$ at $t = t_{i + 1} = \Delta_i$ , given $\mathbf{y}(0)$ and the previous guess $\mathbf{y}^{(i)}(t)$ . This gives the local truncation error as:
+
+$$
+\begin{array}{l} \mathrm {L T E} = \mathbf {y} ^ {(i + 1)} (\Delta_ {i}) - \mathbf {y} _ {i + 1} \\ = \left[ \mathbf {f} _ {i} - \mathbf {f} _ {c} - \mathbf {G} _ {c} \left(\mathbf {y} _ {c} - \mathbf {y} _ {i}\right) \right] \Delta_ {i} + \frac {1}{2} \left[ \mathbf {f} _ {i} ^ {\prime} + \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime} - \mathbf {G} _ {i} \mathbf {f} _ {i} + \mathbf {G} _ {c} \mathbf {f} _ {c} + \mathbf {G} _ {c} ^ {2} \left(\mathbf {y} _ {c} - \mathbf {y} _ {i}\right) \right] \Delta_ {i} ^ {2} \\ + \frac {1}{6} \left[ \mathbf {f} _ {i} ^ {\prime \prime} + \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime \prime} + 2 \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} ^ {\prime} - \mathbf {G} _ {i} \mathbf {f} _ {i} ^ {\prime} - \mathbf {G} _ {i} ^ {2} \mathbf {y} _ {i} ^ {\prime} + \frac {1}{2} \mathbf {G} _ {i} \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} + \mathbf {G} _ {i} ^ {2} \mathbf {f} _ {i} - 2 \mathbf {G} _ {i} ^ {\prime} \mathbf {f} _ {i} \right. \\ \left. - \frac {1}{2} \mathbf {G} _ {i} ^ {\prime} \mathbf {G} _ {i} \mathbf {y} _ {i} - \mathbf {G} _ {c} ^ {2} \mathbf {f} _ {c} - \mathbf {G} _ {c} ^ {3} (\mathbf {y} _ {c} - \mathbf {y} _ {i}) \right] \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right) \\ = \left[ \mathbf {f} _ {i} - \mathbf {f} _ {i} - \frac {1}{2} \mathbf {f} _ {i} ^ {\prime} \Delta_ {i} - \frac {1}{4} \mathbf {f} _ {i} ^ {\prime \prime} \Delta_ {i} ^ {2} - \frac {1}{2} \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime} \Delta_ {i} - \frac {1}{4} \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime \prime} \Delta_ {i} ^ {2} - \frac {1}{4} \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} ^ {\prime} \Delta_ {i} ^ {2} \right] \Delta_ {i} \\ + \frac {1}{2} \left[ \mathbf {f} _ {i} ^ {\prime} + \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime} - \mathbf {G} _ {i} \mathbf {f} _ {i} + \mathbf {G} _ {i} \mathbf {f} _ {i} + \frac {1}{2} \mathbf {G} _ {i} \mathbf {f} _ {i} ^ {\prime} \Delta_ {i} + \frac {1}{2} \mathbf {G} _ {i} ^ {\prime} \mathbf {f} _ {i} \Delta_ {i} + \frac {1}{2} \mathbf {G} _ {i} ^ {2} \mathbf {y} _ {i} ^ {\prime} \Delta_ {i} \right] \Delta_ {i} ^ {2} \\ + \frac {1}{6} \left[ \mathbf {f} _ {i} ^ {\prime \prime} + \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime \prime} + 2 \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} ^ {\prime} - \mathbf {G} _ {i} \mathbf {f} _ {i} ^ {\prime} - \mathbf {G} _ {i} ^ {2} \mathbf {y} _ {i} ^ {\prime} + \frac {1}{2} \mathbf {G} _ {i} \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} + \mathbf {G} _ {i} ^ {2} \mathbf {f} _ {i} - 2 \mathbf {G} _ {i} ^ {\prime} \mathbf {f} _ {i} \right. \\ \left. - \frac {1}{2} \mathbf {G} _ {i} ^ {\prime} \mathbf {G} _ {i} \mathbf {y} _ {i} - \mathbf {G} _ {i} ^ {2} \mathbf {f} _ {i} \right] \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right) \\ = \frac {1}{1 2} \left[ - \mathbf {f} _ {i} ^ {\prime \prime} - \mathbf {G} _ {i} \mathbf {y} _ {i} ^ {\prime \prime} + \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} ^ {\prime} + \mathbf {G} _ {i} \mathbf {f} _ {i} ^ {\prime} + \mathbf {G} _ {i} ^ {2} \mathbf {y} _ {i} ^ {\prime} + \mathbf {G} _ {i} \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} - \mathbf {G} _ {i} ^ {\prime} \mathbf {f} _ {i} - \mathbf {G} _ {i} ^ {\prime} \mathbf {G} _ {i} ^ {\prime} \mathbf {y} _ {i} \right] \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right). \tag {55} \\ \end{array}
+$$
+
+Recalling from section 3 that $\mathbf{G}(t) = -\frac{\partial\mathbf{f}}{\partial\mathbf{y}}$ , we define $\mathbf{f}_i^{(m,n)} = \left.\frac{\partial^{m + n}\mathbf{f}}{\partial\mathbf{y}^m\partial\mathbf{x}^n}\right|_{t = 0}$ and expand the total derivatives:
+
+$$
+\mathbf {f} _ {i} ^ {\prime} = \mathbf {f} _ {i} ^ {(1, 0)} \mathbf {y} _ {i} ^ {\prime} + \mathbf {f} _ {i} ^ {(0, 1)} \mathbf {x} _ {i} ^ {\prime}
+$$
+
+$$
+\mathbf {f} _ {i} ^ {\prime \prime} = \mathbf {f} _ {i} ^ {(1, 0)} \mathbf {y} _ {i} ^ {\prime \prime} + \left(\mathbf {f} _ {i} ^ {(2, 0)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {y} _ {i} ^ {\prime} + \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {x} _ {i} ^ {\prime} + \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {y} _ {i} ^ {\prime} + \left(\mathbf {f} _ {i} ^ {(0, 2)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {x} _ {i} ^ {\prime} + \mathbf {f} _ {i} ^ {(0, 1)} \mathbf {x} _ {i} ^ {\prime \prime} \tag {56}
+$$
+
+$$
+\mathbf {G} _ {i} = - \mathbf {f} _ {i} ^ {(1, 0)}
+$$
+
+$$
+\mathbf {G} _ {i} ^ {\prime} = - \mathbf {f} _ {i} ^ {(2, 0)} \mathbf {y} _ {i} ^ {\prime} - \mathbf {f} _ {i} ^ {(1, 1)} \mathbf {x} _ {i} ^ {\prime}.
+$$
+
+The local truncation error can therefore also be written:
+
+$$
+\begin{array}{l} \mathrm {L T E} = \frac {1}{1 2} \left[ - 2 \left(\mathbf {f} _ {i} ^ {(2, 0)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {y} _ {i} ^ {\prime} - \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {x} _ {i} ^ {\prime} - 2 \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {y} _ {i} ^ {\prime} - \left(\mathbf {f} _ {i} ^ {(0, 2)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {x} _ {i} ^ {\prime} - \mathbf {f} _ {i} ^ {(0, 1)} \mathbf {x} _ {i} ^ {\prime \prime} \right. \\ - \mathbf {f} _ {i} ^ {(1, 0)} \mathbf {f} _ {i} ^ {(0, 1)} \mathbf {x} _ {i} ^ {\prime} + \mathbf {f} _ {i} ^ {(1, 0)} \left(\mathbf {f} _ {i} ^ {(2, 0)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {y} _ {i} + \mathbf {f} _ {i} ^ {(1, 0)} \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {y} _ {i} + \left(\mathbf {f} _ {i} ^ {(2, 0)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {f} _ {i} \tag {57} \\ \left. + \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {f} _ {i} - \left(\mathbf {f} _ {i} ^ {(2, 0)} \mathbf {y} _ {i} ^ {\prime}\right) \mathbf {f} _ {i} ^ {(1, 0)} \mathbf {y} _ {i} - \left(\mathbf {f} _ {i} ^ {(1, 1)} \mathbf {x} _ {i} ^ {\prime}\right) \mathbf {f} _ {i} ^ {(1, 0)} \mathbf {y} _ {i} \right] \Delta_ {i} ^ {3} + \mathcal {O} \left(\Delta_ {i} ^ {4}\right). \\ \end{array}
+$$
+
+Accordingly, taking the midpoint values for the approximation enables us to obtain a cubic local truncation error, $\mathrm{LTE} = K\Delta_i^3 +\mathcal{O}(\Delta_i^4)$
+
+
Interpolation
Error
Expressions
Midpoint
O(Δ3)
y i+1 = G i y i + z i with G i = exp(-G i Δi) and z i = G i-1(I - G i)z i, where G i = (G(t i) + G(t i+1))/2 and z i = (z(t i) + z(t i+1))/2
Left value
O(Δ2)
y i+1 = G i y i + z i with G i = exp(-G i Δi) and z i = G i-1(I - G i)z i, where G i = G(t i) and z i = z(t i)
Right value
O(Δ2)
y i+1 = G i y i + z i with G i = exp(-G i Δi) and z i = G i-1(I - G i)z i, where G i = G(t i+1) and z i = z(t i+1)
Linear
O(Δ3)
y i+1 = e-M(t) [y i + ∫t i+1eM(τ)z(τ)dτ] where M(t) = G(t i)(t - t i) + G(t i+1)-G(t i)/2(t i+1-t i)(t - t i)2 and z(t) = z(t i) + z(t i+1)-z(t i)/t i+1-t i(t - t i)
Quadratic
O(Δ5)
y i+1 = e-M(t) [y i + ∫t i+1eM(τ)z(τ)dτ] where M(t) = ∫t iG(τ)dτ with G(τ) and z(τ) are interpolated quadratically using the values at t i-1, t i, and t i+1.
+
+Table 3: Error bounds and expressions to be evaluated in ODE for various types of interpolations.
+
+# A.6 OTHER KINDS OF INTERPOLATIONS
+
+The choice on midpoint interpolation was made based on the consideration of both error bound and the evaluation simplicity. Table 3 provide the error bounds and expression to be evaluated for various interpolations. From the table, it is clear that midpoint interpolation provides a good balance between error and ease-of-compute expression.
+
+# B EXPERIMENTAL DETAILS
+
+# B.1 CODE IN JAX
+
+```python
+def deer_iteration (
+ invlin: Callable[[List[jnp.ndearray], jnp.ndearray, Any], jnp.ndearray], func: Callable[[List[jnp.ndearray], Any, Any], jnp.ndearray], shifter_func: Callable[[jnp.ndearray, Any], List[jnp.ndearray]], p_num: int,
+ params: Any, # gradable
+ xinput: Any, # gradable
+ invlin.params: Any, # gradable
+ shifter_func.params: Any, # gradable
+ yinit Guess: jnp.ndearray,
+ max_iter: int = 100,
+) -> Tuple[jnp.ndearray, List[jnp.ndearray], Callable]:
+ # obtain the functions to compute the jacobians and the function
+ jacfunc = jax.vmap(jax.jacfwd(func, argnums=0), in.axes=(0, 0, None))
+ func2 = jax.vmap(func, in.axes=(0, 0, None))
+ dtype = yinit Guess.dtype
+ # set the tolerance
+ tol = 1e-7 if dtype == jnp.float64 else 1e-4
+ def iter_func(iter_inp):
+ err, yt, iiter = iter_inp
+ # yt: (nsamples, ndims)
+```
+
+```python
+ytparams = shifter_func(yt, shifter_func.params)
+# [p_num] + (nsamples, ndims, ndims)
+gts = [-gt for gt in jacfunc(ytparams, xinput, params)] # FUNCVAL
+# rhs: (nsamples, ndims)
+rhs = func2(ytparams, xinput, params) # FUNCVAL
+rhs += sum([jnp.einsum("...ij,...j->...i", gt, ytp) for gt, ytp in zip(gts, ytlparams)]) # GTMULT
+# yt_next: (nsamples, ndims)
+yt_next = invlin(gts, rhs, invlin_parameters) # INVLIN
+err = jnp.max(jnp.abs(yt_next - yt)) # checking convergence
+return err, yt_next, iiter + 1
+def cond_func(iter_inp) -> bool:
+ err, _, iiter = iter_inp
+ return jnp.logical_and(err > tol, iiter < max_iter)
+err = jnp.array(1e10, dtype=npdtype) # very high initial error
+gt = jnp.zeros((yinit Guess.shape[0], yinit Guess.shape[-1], yinit Guess.shape[-1]), dtype=npdtype)
+gts = [gt] * p_num
+iiter = jnp.array(0, dtype=jnp.int32)
+err, yt, iiter = jax.lax while loop( cond_func, iter_func, (err, yinit Guess, iiter))
+return yt
+```
+
+# B.2 HAMILTONIAN NEURAL NETWORK TRAINING WITH NEURALODE
+
+Let's denote $\mathbf{s}$ as the states of the system. In the two-body case, the states are positions and velocities of the two masses, $\mathbf{s} = (x_{1},y_{1},v_{x1},v_{y1},x_{2},y_{2},v_{x2},v_{y2})^{T}$ . For typical works in learning physical systems, a neural network is designed to take the states $\mathbf{s}$ as the input and produces the states dynamics $\dot{\mathbf{s}}$ as the output. In those works, a set of states and the states dynamics are given as the training data, $\{\dots,(\mathbf{s}_i,\dot{\mathbf{s}}_i),\dots\}$ , so the neural network can just be trained without solving an ODE.
+
+In our set up, the training data is only given as the states as a function of time $\{\dots, \mathbf{s}_i(t), \dots\}$ . To train the model with the given dataset, we need to roll out the states as a function of time $\mathbf{s}(t)$ using NeuralODE. In our case, the dataset is generated by generating the initial condition randomly and the dynamics are governed by the gravitational force. The initial conditions are chosen so the orbits of the two-body system does not diverge and the orbits are still close to a circle, to make the simulation numerically stable. The states are rolled out from $t = 0$ to $t = 10$ with 10,000 sampled time. Within the time period, the system makes about 2-4 rounds of orbit. There are 1000 rows of dataset generated and split into 800 for the training, 100 for the validation, and 100 for the test.
+
+In order to speed up the training, we start from 20 time points at the beginning of the training and increase the number of time points by 20 every 50 training steps until it reaches 10k time points. We performed the training using ADAM optimizer (Kingma & Ba, 2014).
+
+For the model, we are using Hamiltonian neural network (Greydanus et al., 2019) that consists of 6 linear layers with softplus activation except on the last linear layer. The hidden layers have 64 elements each. The input to the network has 8 elements (corresponding to the states s) and the output of the network has only 1 element that corresponds to the Hamiltonian value.
+
+For every training step during the training with DEER method, we save the predicted trajectory for every row of the dataset. The saved trajectory will be used as the initial guess of the DEER method for the next training step. The training was performed using ADAM optimizer with $10^{-3}$ learning rate. To speed up the training, we start from 20 time points at the beginning of the training and increase the number of time points by 20 every 1 epoch (50 training steps) until it reaches the maximum 10k time points. The loss function for the training is a simple mean squared error.
+
+# B.3 TIME SERIES CLASSIFICATION WITH GRU
+
+The dataset used in this case is Eigenworms (Brown et al., 2013). There are 259 worm samples with very long sequences (length $N = 17984$ ) in this dataset, which are then divided into train, validation
+
+
+Figure 5: Architecture for the EigenWorms experiments.
+
+and test sets using a $70\%$ , $15\%$ , $15\%$ split following Morrill et al. (2021). Each sample is classified as either wild-type or one of four mutant types based on the representation using six base shapes.
+
+The model used is shown in Figure 5. It consists of four main components: encoder, GRU, MLP and decoder. The encoder would project the input features to a higher dimension of 24, and the encoded input would then go through 5 layers of GRU and MLP pair, in that order. The number of hidden states for each GRU and MLP is set to 24. Then, the output of the GRU and MLP pair would go through a decoder to project it down to 5 classes. We then take the mean over the sequence length to obtain the final output. Residual connection followed by LayerNorm is applied to each GRU and MLP sublayer. Both the encoder and decoder are also simple MLPs, and all MLPs in the architecture have a depth of 1 with ReLU activation function in the hidden layer.
+
+The training is done using cross entropy loss with the patience for early stopping set to 200 epochs per validation accuracy. The optimization algorithm we used is ADAM optimizer with $3 \times 10^{-4}$ learning rate and the gradient is clipped at 1.0 per global norm. The initial guesses for the DEER method are always initialized at zeros.
+
+# B.4 SEQUENTIAL CLASSIFICATION WITH MULTI-HEAD GRU
+
+The dataset we are using for this subsection is CIFAR-10 from torchvision. Each channel is normalized with mean (0.4914, 0.4822, 0.4465) and standard deviation (0.2023, 0.1994, 0.2010) and applying random horizontal flipping before transforming it to a sequence with 3 channels by simply reshaping the signal. Although the dataset from torchvision is already shuffled, we reshuffle the training dataset and split training and validation with $90\%$ and $10\%$ portions respectively. Our results that we present in this paper is the accuracy on the test dataset from torchvision using the checkpoint that gives the best validation accuracy.
+
+For the architecture, we first use a linear layer to convert 3 channels into 256 channels, then we apply $M = 4$ composite layers of multi-head GRUs, and finally we apply another linear layer to convert from 256 channels into 10 channels for classification. Each composite layer of multi-head GRU consists of (1) a multi-head GRU with 32 heads, each with 8 channels with strides $\{2^0, 2^1, \dots, 2^7\}$ uniformly assigned to each head, (2) a linear layer from 256 channels to 512 channels, (3) a gated linear unit (GLU) (Dauphin et al., 2017) to convert the channels back to 256, and (4) a skip connection followed by (5) a layer norm (Ba et al., 2016). Dropout with 0.1 drop probability was also inserted to the model. The total number of trainable parameters of the model is 1,347,082.
+
+During the training, we use the cosine annealing with linear warmup for 100,000 training steps. The linear warmup stage took 10,000 steps to increase the learning rate from $10^{-7}$ to $2 \times 10^{-3}$ while the cosine annealing took the remaining 90,000 steps to get it down to $10^{-7}$ . In each training step, we applied gradient clipping by global norm equals to 1.0. The training was performed using ADAMW optimizer (Loshchilov & Hutter, 2017) with 0.01 weight decay.
+
+# C ADDITIONAL RESULTS
+
+# C.1 EFFECT OF TOLERANCE LEVEL ON CONVERGENCE
+
+The only hyperparameter of DEER is the tolerance level for the convergence criteria. In our implementation, if the maximum absolute deviation of the iterated values is below the tolerance level, then it is marked as "converge". The number of iterations to reach the convergence for float32 and float64 precision for various tolerance values are shown in Figure 6. From the figure, we can see that setting the tolerance level of $10^{-4}$ for float32 has the same number of convergence if setting the tolerance level of $3 \times 10^{-7}$ . In both cases, either $10^{-4}$ or $3 \times 10^{-7}$ tolerance levels, the maximum absolute error of the DEER output with respect to the sequential method are both relatively low: $1.788 \times 10^{-7}$ . This shows the insensitivity of the hyperparameter of DEER method to the convergence of the method.
+
+# C.2 BENCHMARKS
+
+Table 4 shows the speed up for batch size 16 and 8. It can be seen that the smaller batch size can achieve higher speed up on average.
+
+Another interesting finding that we found can be seen in Figure 7. The figure shows the speed up comparison when using V100 GPU and when using A100 GPU. Although for smaller number of dimensions A100 can achieve larger speed up than V100, the speed up when using 32 dimensions on A100 suddenly drops to below 1. This effect is not as severe in V100.
+
+Furthermore, we performed profiling to see where the bottleneck is. On the code in appendix B.1, we have denoted three lines of interest with FUNCVAL, GTMULT, and INVLIN. Table 4 shows the run time using GRU with various number of dimensions with batch size of 16. From the table, we can see that the bottleneck is in solving $L_{\mathbf{G}}^{-1}$ .
+
+
+Figure 6: The mean number of iterations required to achieve the convergence for float32 and float64 precision. The case is an untrained GRU with 2 hidden size and 10000 sequence length. The mean and std of the plots were obtained from 16 data points each. The vertical black dashed lines show the 'eps' value of float32 and float64 $(1.1927 \times 10^{-7}$ and $2.22 \times 10^{-16}$ respectively).
+
+
+
+
+
+
+Figure 7: Speed up of DEER GRU over sequential method achieved in (top) V100 and (bottom) A100.
+
+Table 4: The speed up of GRU calculated using DEER method (this paper) vs commonly-used sequential method on a V100 GPU with batch size of 16, 8, 4, and 2. The missing data for large number of dimensions and sequence lengths are due to insufficient memory in computing the DEER method. The numbers in the table represent the mean speed up over 5 different random seeds.
+
+
#dims
Sequence lengths (batch size = 16)
1k
3k
10k
30k
100k
300k
1M
1
15.7
43.5
114
182
309
394
516
2
24.4
47.6
75.0
78.4
72.4
77.1
74.6
4
22.1
35.4
46.5
44.4
52.1
54.2
51.3
8
14.8
20.0
21.9
24.0
25.2
25.1
-
16
7.11
8.37
8.89
9.23
9.46
-
-
32
3.74
3.76
4.16
4.24
-
-
-
64
1.29
1.26
1.27
-
-
-
-
#dims
Sequence lengths (batch size = 8)
1k
3k
10k
30k
100k
300k
1M
1
16.9
44.9
131
264
521
604
945
2
22.5
58.0
113
149
119
141
138
4
24.1
50.7
79.0
95.9
101
103
104
8
21.4
31.9
42.3
45.1
47.9
49.6
49.6
16
11.7
15.3
16.8
18.5
18.6
18.7
-
32
6.32
7.72
8.02
8.32
8.30
-
-
64
2.64
2.67
2.78
2.54
-
-
-
#dims
Sequence lengths (batch size = 4)
1k
3k
10k
30k
100k
300k
1M
1
16.6
45.1
130
316
809
1110
1530
2
23.1
62.7
162
256
301
294
306
4
24
63.1
131
174
171
199
207
8
23.1
48.1
73.9
89.3
95.7
98.4
100
16
18.2
28.6
32.7
35.1
37.4
39.1
38
32
11.8
14.9
15.9
17
17.3
15.2
-
64
5.14
5.7
5.62
5.22
-
-
-
#dims
Sequence lengths (batch size = 2)
1k
3k
10k
30k
100k
300k
1M
1
17.2
43.1
128
357
1030
1860
2660
2
24.8
66.7
187
382
589
516
610
4
25.2
64
172
280
372
416
433
8
24.4
60.5
114
162
178
181
202
16
22.5
45.5
62.8
68.5
75.3
78.1
77.7
32
16.7
25.7
32
31.4
34.3
35.1
-
64
9.18
10.4
11.1
10.4
10.7
-
-
+
+Table 5: The run time of one iteration of a GRU cell in a V100 GPU in nanoseconds. Numbers that are less than $30~\mu s$ are not present in our profiling tool.
+
+
Line label
Number of dimensions
1
2
4
8
16
32
FUNCEVAL
31,430
432,184
911,824
1,194,010
3,419,370
5,249,474
GTMULT
88,256
248,562
428,030
1,357,965
4,724,395
INVLIN
147,669
1,336,836
2,015,883
4,460,318
9,786,933
19,248,959
+
+Table 6: GPU memory consumption in MiB for evaluating GRU using DEER method with batch size = 16 and for various number of dimensions.
+
+
Number of dimensions
1
2
4
8
16
32
GPU memory (MiB)
18.32
73.25
161.14
380.87
1351.68
5038.08
+
+
+Figure 8: (a) The wall-clock comparison and (b) training step comparison of training LEM with DEER and with sequential method using the same amount of memory by increasing the batch size for sequential method.
+
+
+
+We also did benchmark the GPU memory consumption as a function of number of dimensions with batch size equals to 16 in the GRU case. The results can be seen in Table 6. From the table, it can be seen that the GPU memory consumption approximately grows quadratically, as expected from storing the matrices $\mathbf{G}$ explicitly.
+
+# C.3 DEER VS SEQUENTIAL WITH THE SAME MEMORY CONSUMPTION
+
+To make another fair comparison, we ran an experiment comparing DEER vs sequential method using the same memory consumption. In this case, we use LEM architecture (Rusch et al., 2021) on EigenWorms (Brown et al., 2013) dataset. All of the hyperparameters are set to be the same, except the batch size. We increase the batch size for sequential method to match the memory consumption of DEER. With DEER, we set the batch size equals to 3 while for sequential method, we set it to 70. The GPU memory usage for both cases is about 2.6 GB GPU.
+
+The results can be seen in 8. From the figure, we can see that although DEER uses smaller batch size and requires more steps to converge, it can achieve desirable results faster than using sequential method in terms of wall-clock time.
\ No newline at end of file
diff --git a/parallelizingnonlinearsequentialmodelsoverthesequencelength/images.zip b/parallelizingnonlinearsequentialmodelsoverthesequencelength/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..809039f7e9103924323355f7b0380c91e019a9d8
--- /dev/null
+++ b/parallelizingnonlinearsequentialmodelsoverthesequencelength/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:00046e6049746830f0e58b687ca458d9b709c302737ceac29af52cd2c55756f5
+size 1471470
diff --git a/parallelizingnonlinearsequentialmodelsoverthesequencelength/layout.json b/parallelizingnonlinearsequentialmodelsoverthesequencelength/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..47a362790623fc502161ac30f84df3eda5694bf6
--- /dev/null
+++ b/parallelizingnonlinearsequentialmodelsoverthesequencelength/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1cabc624808ea1b677428881b37b49557a87d36a4d45fc18c579cbecf75b9f5e
+size 885583
diff --git a/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_content_list.json b/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..3ad3ffe99afc29de91d60da64c2181487e7d982a
--- /dev/null
+++ b/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7a1c4d0b0a4e711dcf2d36bbbef4cd5419da838895941ccd22d17cea25bea48c
+size 180737
diff --git a/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_model.json b/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a40543e560c1c0a6f992fd8691cfa8438f192a95
--- /dev/null
+++ b/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85bf812de90d25ce0db749a023685055206837b876e86fb67ed206480aa5cea9
+size 222212
diff --git a/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_origin.pdf b/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f7d5fe8572172998f6ccfe220a0385774f63ed26
--- /dev/null
+++ b/parameterefficientmultitaskmodelfusionwithpartiallinearization/19b63e21-0374-4947-b0df-b3e0c8fd2f77_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c5930377b2dcf6a969e34ac1e5f8d1702929f1785929edac8cf62bc29c8c647a
+size 1041056
diff --git a/parameterefficientmultitaskmodelfusionwithpartiallinearization/full.md b/parameterefficientmultitaskmodelfusionwithpartiallinearization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2fe78bdb8c21774e5e561cdcb349ce7f7ac98298
--- /dev/null
+++ b/parameterefficientmultitaskmodelfusionwithpartiallinearization/full.md
@@ -0,0 +1,779 @@
+# PARAMETER EFFICIENT MULTI-TASK MODEL FUSION WITH PARTIAL LINEARIZATION
+
+Anke Tang $^{1}$ , Li Shen $^{2*}$ , Yong Luo $^{1*}$ , Yibing Zhan $^{2}$ , Han Hu $^{3}$ , Bo Du $^{1}$ , Yixin Chen $^{4}$ , Dacheng Tao $^{5}$
+
+1Wuhan University, China 2JD Explore Academy, China 3Beijing Institute of Technology, China
+$^{4}$ Washington University, USA $^{5}$ Nanyang Technological University, Singapore
+1{anketang,luoyong,dubo}@whu.edu.cn
+$^{2}$ mathshenli@gmail.com,zybjy@mail.ustc.edu.cn $^{3}$ hhu@bit.edu.cn
+4chen@cse.wustl.edu 5dacheng.tao@ntu.edu.sg
+
+# ABSTRACT
+
+Large pre-trained models have enabled significant advances in machine learning and served as foundation components. Model fusion methods, such as task arithmetic, have been proven to be powerful and scalable to incorporate fine-tuned weights from different tasks into a multi-task model. However, efficiently fine-tuning large pre-trained models on multiple downstream tasks remains challenging, leading to inefficient multi-task model fusion. In this work, we propose a novel method to improve multi-task fusion for parameter-efficient fine-tuning techniques like LoRA fine-tuning. Specifically, our approach partially linearizes only the adapter modules and applies task arithmetic over the linearized adapters. This allows us to leverage the advantages of model fusion over linearized fine-tuning, while still performing fine-tuning and inference efficiently. We demonstrate that our partial linearization technique enables a more effective fusion of multiple tasks into a single model, outperforming standard adapter tuning and task arithmetic alone. Experimental results demonstrate the capabilities of our proposed partial linearization technique to effectively construct unified multi-task models via the fusion of fine-tuned task vectors. We evaluate performance over an increasing number of tasks and find that our approach outperforms standard parameter-efficient fine-tuning techniques. The results highlight the benefits of partial linearization for scalable and efficient multi-task model fusion.
+
+# 1 INTRODUCTION
+
+Pre-trained models play a crucial role in machine learning systems, serving as foundational components. In order to optimize their performance for specific downstream tasks (Ilharco et al., 2022; Wortsman et al., 2022b; Matena & Raffel, 2022), address biases or undesired behavior (Santurkar et al., 2021; Ribeiro & Lundberg, 2022; Murty et al., 2022), align them with human preferences (Ouyang et al., 2022; Ribeiro & Lundberg, 2022), or incorporate new information (Mitchell et al., 2022a;b), it is often necessary to further customize or edit these models after pre-training.
+
+Multi-task model fusion is a powerful approach to extracting knowledge from models fine-tuned on different downstream tasks, allowing us to create a unified model that performs well across multiple tasks. This approach proves to be helpful when only the fine-tuned model can be obtained but the data remains private and inaccessible (Wu et al., 2019; Lou et al., 2020; Tang et al., 2023); besides, it can expedite the fine-tuning of the multi-task model, since compared to the pre-trained model, we have a better starting point from which to fine-tune (Kaddour, 2022; Sanyal et al., 2023). In recent studies, researchers have introduced many powerful methods for editing pre-trained models and merging task-specific fine-tuned models. We further introduce this field in Section 2.
+
+The vast parameter size of pre-trained models poses challenges in terms of computational efficiency and memory usage during the fine-tuning process; these difficulties further lead to inefficient multitask model fusion. Fine-tuning large-scale models requires significant computational resources and
+
+memory, making the process inefficient. To address this concern, many parameter-efficient fine-tuning (PEFT) techniques are proposed, these approaches significantly reduce the number of parameters that need to be fine-tuned, meanwhile achieving comparable performance to full parameter fine-tuning. However, naively combining models that were fine-tuned in a parameter-efficient manner can more readily result in representational interference between tasks, which makes model fusion algorithms suboptimal. While some research has explored fusing parameter-efficient fine-tuned models for multi-task model fusion (Chronopoulou et al., 2023; Zhang et al., 2023; Huang et al., 2023), performance still lags considerably behind fusing fully fine-tuned models. Therefore, the key challenge is performing PEFT while also preventing negative interference between task-specific representations. Motivated by these concerns, we aim to enhance the multi-task model fusion capabilities of parameter-efficient fine-tuned models.
+
+In this work, we present a novel approach to improve the multi-task fusion capability of parameter-efficient fine-tuning models. Recent advances in understanding task arithmetic and weight disentanglement have demonstrated that linearizing the entire model and fine-tuning the corresponding tangent model in tangent space can enable more effective task arithmetic (Guillermo Ortiz-Jimenez et al., 2023). While promising, completely linearizing a large pre-trained model can be computationally expensive. Typically, this approach requires two to three times the computational resources needed for fine-tuning and inference. Our key insight is that we can perform efficient fine-tuning and disentangle task representations by only linearizing a subset of parameters appended to a fixed pretrained backbone. In essence, we are proposing a hybrid approach that leverages parameter-efficient fine-tuning for efficiency, while locally linearizing the adaptable modules to attain enhanced disentanglement and improved multi-task fusion capabilities.
+
+Our experiments on image classification and natural language processing tasks demonstrate that our partial linearization technique enables more effective model fusion, achieving superior performance across tasks compared to conventional PEFT methods and model fusion algorithms alone. In some cases, our proposed method is even comparable to full fine-tuning. In addition to the direct comparison of multi-task model fusion performance, we also visualize the weight disentanglement gain of our method on different downstream task pairs. The results show that our method can effectively improve the weight disentanglement of parameter-efficient fine-tuning models, which is the key to improving the multi-task fusion capability of parameter-efficient fine-tuning models.
+
+To summarize, our contributions are as follows:
+
+- We propose a novel partial linearization method for parameter-efficient fine-tuning models in order to improve the multi-task fusion capability of fine-tuned task-specific models with a low computational cost overhead.
+- We apply our method to the LoRA modules to construct Linearized LoRA (L-LoRA) modules and conduct extensive experiments on seven tasks from the GLUE benchmark to demonstrate that our method is effective in improving the multi-task fusion capability of fine-tuned task-specific models.
+- We present an extension of weight disentanglement property and weight disentanglement error for parameter-efficient fine-tuning models to analyze the impact of the linearization process on parameter-efficient modules. We evaluate fine-tuned models to visualize and analyze the weight disentanglement gain of L-LoRA on downstream tasks.
+
+# 2 RELATED WORK
+
+Model Fusion. In practical training scenarios, it is common practice to train multiple models with various hyperparameter configurations. Subsequently, the top-performing individual model is selected, or an ensemble of models is constructed to attain optimal performance (Dietterich, 2000). However, deploying an ensemble of models incurs additional computing expenses during inference. Meanwhile, selecting a single top-performing model typically entails discarding the remaining trained models, resulting in neglecting their encoded knowledge.
+
+Model fusion integrates the knowledge from multiple models into a single unified model (Li et al., 2023). There are two main works for model fusion. The first line of work focuses on the fusion of entire models. Interpolating the entire weight space of multiple models by taking their average or weighted combination can be effective for model fusion as demonstrated in previous work (Garipov
+
+et al., 2018; Ilharco et al., 2022; Matena & Raffel, 2022; Wortsman et al., 2022a; Ilharco et al., 2023; Liu & Soatto, 2023). When the models are not well aligned or lie in different loss basins, techniques have been proposed to align the feature representation before fusion (Liu et al., 2022a; Wang et al., 2022; Ainsworth et al., 2023; Jin et al., 2023). This feature alignment helps matching the models to similar behaviors or transforming to a same loss basin. Fusing the full model can leverage knowledge from all layers but can be computationally expensive.
+
+The second line of work focuses on fusing parts of the model. For example, (George Stoica et al., 2023) aligns and fuses a large portion of the models to combine models trained on disjoint tasks and supports partial zipping up to a specified layer to create a multi-head model. (Yadav et al., 2023) removes redundant and potentially interfering values and resolves sign conflicts before doing weight interpolation. Other researches explore merging parameter-efficient modules as a more lightweight approach (Chronopoulou et al., 2023; Huang et al., 2023; Zhang et al., 2023; Wu et al., 2023).
+
+Parameter-efficient fine-tuning (PEFT). The use of transfer learning from pre-trained models has become a widely accepted practice, resulting in impressive performance across various domains (Devlin et al., 2019; Radford et al., 2019). In addition to fine-tuning all the model parameters, parameter-efficient fine-tuning techniques have been proposed to reduce the number of parameters that need to be fine-tuned, such as adapter tuning (Houlsby et al., 2019), prefix tuning (Li & Liang, 2021), prompt tuning (Lester et al., 2021), LoRA (Hu et al., 2021) and $(\mathrm{IA})^3$ Liu et al. (2022b) et al. These methods only update a small subset of (extra) parameters, lowering computational costs and memory requirements compared to full fine-tuning, while retaining comparable performance.
+
+# 3 RETHINKING MODEL FUSION IN PEFT SETTING
+
+In this section, we first introduce the preliminary formulas of parameter-efficient fine-tuning and define task vectors for parameter-efficient fine-tuning models. Then, we introduce the weight disentanglement property and weight disentanglement error in PEFT setting.
+
+# 3.1 PRELIMINARY
+
+Under the framework of supervised learning, assume we have a set of tasks $T = \{\tau_1, \tau_2, \dots, \tau_n\}$ and a pre-trained language model $f_{\theta_0}$ parameterized by $\theta_0$ which is trained on a massive dataset. Each task $\tau_i$ is associated with a dataset $D_{\tau_i} = \{(x_{\tau_i}^{(j)}, y_{\tau_i}^{(j)})\}_{j=1}^{s_i}$ , where $s_i$ is dataset size of $D_{\tau_i}$ , $\{x_{\tau_i}^{(j)}\}_{j=1}^{s_i}$ is the input data, and $\{y_{\tau_i}^{(j)}\}_{j=1}^{s_i}$ is the output data.
+
+Given a specific task $\tau_{i}$ , the pre-trained model $f_{\theta_0}$ is fine-tuned on the task-specific dataset $D_{\tau_i}$ to obtain a task-specific model. We consider full parameter fine-tuning and parameter-efficient fine-tuning methods. If the model $f_{\theta_0}$ is fully fine-tuned on task $\tau_{i}$ , the parameters $\theta_0$ are updated to $\theta_{i}$ by minimizing the loss function $\theta_{i} = \arg \min_{\theta}\mathcal{L}(\tau_{i};\theta)$ on the task-specific dataset $D_{\tau_i}$ . Otherwise, if the model $f_{\theta_0}$ is parameter-efficiently fine-tuned on task $\tau_{i}$ , the original parameters $\theta_0$ are fixed and some extra added parameters $\phi$ (the number of parameters of $\phi$ is much less than $\theta_0$ , i.e., $|\phi | / |\theta_0| \ll 1$ ) are updated to $\phi_{i}$ by minimizing the loss function $\phi_{i} = \arg \min_{\phi}\mathcal{L}(\tau_{i};\theta_{0},\phi)$ on the task-specific dataset $D_{\tau_i}$ . Where $\mathcal{L}$ is typically the Cross-Entropy loss function to maximize conditional posterior probability $p(y|x)$ , more specifically
+
+$$
+\mathcal {L} \left(\tau_ {i}; \theta_ {0}, \phi\right) = \frac {1}{s _ {i}} \sum_ {j = 1} ^ {s _ {i}} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}} ^ {(j)}; \phi\right), y _ {\tau_ {i}} ^ {(j)}\right) \in \mathbb {R} ^ {+}. \tag {1}
+$$
+
+Task vector. We define the task vector as the difference between the fine-tuned trainable parameters and their initial state. The task vector is denoted as $\nu_{i} = \theta_{i} - \theta_{0}$ for full fine-tuning or $\nu_{i} = \phi_{i} - \phi_{0}$ for parameter-efficient fine-tuning. We elaborate on this definition in Appendix A, discussing the rationale behind this definition and its associated benefits.
+
+# 3.2 WEIGHT DISENTANGLEMENT FOR PARAMETER-EFFICIENT FINE-TUNING
+
+In this subsection, we discuss and present an extension of the weight disentanglement property and weight disentanglement error to parameter-efficient fine-tuning models, which are original introduced in (Guillermo Ortiz-Jimenez et al., 2023).
+
+
+(a)
+
+
+(b)
+Figure 1: Loss landscape visualization. Here, we visualize the loss landscape $\mathcal{L}(\tau_1;\theta) + \mathcal{L}(\tau_2;\theta)$ for CLIP model on combinations of three downstream image classification tasks by interpolating on the 2D plane. $\theta = \theta_0 + \sum_{i=1}^{2}\lambda_i(\theta_i - \theta_0)$ , where $\theta_0$ are the pre-trained weights, $\theta_i$ are the task-specific full fine-tuned weights for task $\tau_i$ . From these heatmaps, we observe that task-specific models reside in the same loss basin when evaluated on the joint task.
+
+
+(c)
+
+Weight disentanglement for parameter-efficient fine-tuning. The weight disentanglement is defined by the function outputs of the merged model. Consider a PEFT model denoted as $f_{\theta_0}(x; \phi_0)$ whose tunable weights are initialized as $\phi_0$ . We define this model to possess weight disentanglement characteristics in relation to a specific set of task vectors $\{\nu_i | \nu_i = \phi_i - \phi_0\}_{i \in [n]}$ and their corresponding support datasets $\{D_{\tau_i}\}_{i \in [n]}$ if the following condition is satisfied:
+
+$$
+f _ {\theta} (x; \phi + \sum_ {i = 1} ^ {n} \lambda_ {i} \nu_ {i}) = \sum_ {i = 1} ^ {n} g _ {i} (x; \lambda_ {i} \nu_ {i}) + g _ {0} (x), \tag {2}
+$$
+
+where $g_{i}(x;\lambda_{i}\nu_{i}) = 0$ for $x \notin D_{\nu_i}$ and $i = 1,2,\dots,n$ and $g_0(x) = 0$ for $x \in \bigcup_{i \in [n]} D_{\tau_i}$ . This condition ensures that the model $f_{\theta}(x;\phi)$ can be expressed as a linear combination of individual terms $g_{i}(x;\lambda_{i}\nu_{i})$ , incorporating the respective task vectors and an additional term $g_0(x)$ . Through adhering to this disentanglement condition, the model demonstrates the desired capability of effectively separating and disentangling the weights associated with the function outputs, enhancing its capacity to capture task-specific information.
+
+However, it is important to highlight that weight disentanglement is a characteristic specific to the function outputs and is not directly linked to their performance. In other words, a model may exhibit weight disentanglement property yet still perform weakly. Since weight disentanglement of function outputs does not guarantee task success in itself, as other factors, such as the evaluation metrics, can be non-linear to determine the overall performance. Therefore, it is crucial to consider weight disentanglement alongside other performance metrics when analyzing model behavior and effectiveness across different tasks.
+
+Weight disentanglement error in PEFT setting. Given two task vectors $\{\nu_i\}_{i = 1,2}$ , we define the extension of disentanglement error for model $f_{\theta_0}(x;\phi_0)$ as follows:
+
+$$
+\xi \left(\lambda_ {1}, \lambda_ {2}\right) = \sum_ {i = 1} ^ {2} \mathbb {E} _ {x \sim P \left(D _ {\tau_ {i}}\right)} \left[ \operatorname {d i s t} \left(f _ {\theta_ {0}} \left(x; \phi_ {0} + \lambda_ {i} v _ {i}\right), f _ {\theta_ {0}} \left(x; \phi_ {0} + \lambda_ {1} v _ {1} + \lambda_ {2} v _ {2}\right)\right) \right]. \tag {3}
+$$
+
+Where $\mathrm{dist}(\cdot, \cdot)$ represents any chosen distance metric between two vector outputs. Taking classification tasks as an example, dist can be chosen as the prediction error, i.e., $\mathrm{dist}(y_1, y_2) = \mathbb{1}(y_1 \neq y_2)$ . Intuitively, this measures how much the prediction changes when adding each task vector individually versus adding both together. If task knowledge is well-disentangled, adding the specialized vectors independently or together should yield similar predictions, minimizing $\xi$ . The disentangle-ment error quantifies the degree of interference between task vectors. Lower values indicate task knowledge that can be combined with less destructive interaction during model merging.
+
+# 3.3 GEOMETRIC INTUITION FOR MODEL FUSION
+
+In previous work, it is generally believed that the closer the orthogonal between task vectors, the less interference between tasks and the better the effect of weight disentanglement (Ilharco et al., 2023; Chen et al., 2023; Guillermo Ortiz-Jimenez et al., 2023). The intuition is that orthogonal
+
+
+(a) full fine-tuning
+
+
+(b) LoRA fine-tuning
+Figure 2: Similarity heatmaps. These figures show heatmaps of the cosine similarity between task vectors from task-specific CLIP models (Radford et al., 2021) fine-tuned on different tasks. (a) Cos similarity matrix of task vectors when using full fine-tuning of the entire model. (b) Task vector similarities when using LoRA. (c) Cos similarity of task vectors when using L-LoRA, our proposed partial linearization approach that linearizes PEFT modules and fine-tunes in tangent space.
+
+
+(c) L-LoRA fine-tuning
+
+task vectors indicate that the specialized knowledge captured for each task lies in distinct subspaces with minimal overlap or redundancy. This enables better preservation of specialized knowledge and avoids destructive interference during model merging.
+
+We visualize the loss landscape of the joint tasks in Figure 1 (Li et al., 2018), where we interpolate between the pre-trained weights $\theta_0$ and two task-specific fine-tuned weights $\theta_{1},\theta_{2}$ for CLIP models (Radford et al., 2021). The 2D heatmaps show the loss values $\mathcal{L}(\tau_1,\theta) + \mathcal{L}(\tau_2,\theta)$ evaluated on the joint tasks. Notably, we observe that the task-specific models reside at the edge of the same low-loss basin, with no significant barriers or discontinuities in between. It provides geometric intuition for why a simple linear arithmetic operation of task-specific parameters $\theta_{1}$ and $\theta_{2}$ can produce effective merging for multitask learning, as empirically observed.
+
+The results in Figures 2(a-b) and 8(a-b) show the cosine similarity between task vectors from CLIP and Flan-T5 (Chung et al., 2022), which are fully fine-tuned or LoRA fine-tuned on image classification tasks and natural language processing (NLP) tasks respectively. We observe that vectors from full fine-tuning are closer to orthogonal than those from LoRA, which indicates that models fine-tuned with full fine-tuning are more independent than those in LoRA. This finding is consistent with the discussion about task addition in (Ilharco et al., 2023), the experimental results from Figures 4 and 5 also support our statement. The experimental details are described in Appendix C.
+
+Remark 3.1 At first glance, it may seem unfair to compare the task vectors from full fine-tuning to those from parameter-efficient fine-tuning methods, since full fine-tuning has access to much more trainable parameters. In fact for full fine-tuning we have $f_{\theta}(x) = f_{\theta}(x; \phi_0)$ so that
+
+$$
+\frac {\langle \nu_ {i} , \nu_ {j} \rangle}{\| \nu_ {i} \| _ {2} \| \nu_ {j} \| _ {2}} = \frac {\langle [ \theta_ {i} - \theta_ {0} , \mathbf {0} ] , [ \theta_ {j} - \theta_ {0} , \mathbf {0} ] \rangle}{\| [ \theta_ {i} - \theta_ {0} , \mathbf {0} ] \| _ {2} \| [ \theta_ {j} - \theta_ {0} , \mathbf {0} ] \| _ {2}} = \frac {\langle [ \theta_ {i} - \theta_ {0} , \phi_ {0} - \phi_ {0} ] , [ \theta_ {j} - \theta_ {0} , \phi_ {0} - \phi_ {0} ] \rangle}{\| [ \theta_ {i} - \theta_ {0} , \phi_ {0} - \phi_ {0} ] \| _ {2} \| [ \theta_ {j} - \theta_ {0} , \phi_ {0} - \phi_ {0} ] \| _ {2}};
+$$
+
+on the other hand, for parameter-efficient fine-tuning we have
+
+$$
+\frac {\langle \nu_ {i} , \nu_ {j} \rangle}{\| \nu_ {i} \| _ {2} \| \nu_ {j} \| _ {2}} = \frac {\langle [ \mathbf {0} , \phi_ {i} - \phi_ {0} ] , [ \mathbf {0} , \phi_ {j} - \phi_ {0} ] \rangle}{\| [ \mathbf {0} , \phi_ {i} - \phi_ {0} ] \| _ {2} , \| [ \mathbf {0} , \phi_ {j} - \phi_ {0} ] \| _ {2}} = \frac {\langle [ \theta_ {0} - \theta_ {0} , \phi_ {i} - \phi_ {0} ] , [ \theta_ {0} - \theta_ {0} , \phi_ {j} - \phi_ {0} ]}{\| [ \theta_ {0} - \theta_ {0} , \phi_ {i} - \phi_ {0} ] \| _ {2} \| [ \theta_ {0} - \theta_ {0} , \phi_ {j} - \phi_ {0} ] \| _ {2}}.
+$$
+
+Therefore, the comparison between full fine-tuning and parameter-efficient fine-tuning methods can be made fair by viewing them as updating different subsets of the joint parameter space $(\theta ,\phi)$ .
+
+# 4 METHODOLOGY
+
+Based on the above observations, we propose a novel partial linearization method for parameter-efficient fine-tuning models in order to enhance the weight disentanglement and improve the multitask fusion capability of fine-tuned task-specific models with a low computational cost overhead.
+
+# 4.1 LINEARIZED PARAMETER-EFFICIENT FINE-TUNING
+
+To monitor the progressive of trainable parameters $\phi$ throughout the training trajectory, we treat $\phi$ as a function of the training time $t$ , denoted as $\phi(t)$ . Where $t$ ranges from 0 to $T$ . By employing a
+
+
+Trainable
+
+
+Fixed
+Parameters
+
+
+Linearized
+Part
+
+
+(a)
+
+
+Parameters
+(b)
+
+
+(c)
+Figure 3: Four types of fine-tuning paradigms. (a) Full parameter fine-tuning. (b) Full-model linearization. (c) Parameter-efficient fine-tuning. (d) Linearized parameter-efficient fine-tuning. In this paper, we explore LoRA fine-tuning and linearized LoRA (L-LoRA) fine-tuning.
+
+
+(d)
+
+first-order Taylor expansion, we can streamline the dynamics of network learning as (Weng, 2022):
+
+$$
+f _ {\theta_ {0}} (x; \phi (t)) \approx f _ {\theta_ {0}} ^ {\operatorname {l i n}} (x; \phi (t)) = f _ {\theta_ {0}} (x; \phi (0)) + \nabla_ {\phi} f _ {\theta_ {0}} (x; \phi (0)) ^ {\top} (\phi (t) - \phi (0)). \tag {4}
+$$
+
+The linearized model, described by Eq.(4) also referred to as a tangent model, approximates the behavior of the neural network $f_{\theta_0}(x,\phi (t))$ at a specific time $t$ , where $\theta_0$ , $f_{\theta_0}(x;\phi (0))$ , $\nabla_{\phi}f_{\theta_0}(x;\phi (0))$ are all constants. Consequently, the linearized function $f_{\theta_0}^{\mathrm{lin}}(\phi (t);x)$ is a linear function of $\phi (t)$ .
+
+Grounded in the key result detailed in Appendix B, where we characterize the evolution of model outputs. We hypothesize that by partially linearizing only a subset of parameters within the adaptable modules, the model can gain from a more disentangled representation. This partial linearization facilitates the separation of task-specific knowledge; hence, model fusion becomes more robust against the negative transfer effects and task interference in multi-task learning settings.
+
+Figure 3 illustrates four different types of fine-tuning paradigms. The first three are existing methods, while the fourth is our proposed partial linearization fine-tuning method. (a) The full fine-tuning paradigm, all parameters $\theta$ are updated during fine-tuning. (b) The full-model linearization paradigm, but instead we fine-tune the tangent model in the tangent space. It is worth noting that although the Jacobian-vector products can be computed in a single forward pass (Pearlmutter, 1994), training and inference in this paradigm are usually twice or three times as expensive as full fine-tuning, a quantitative comparison is shown in Tables 3 and 4. (c) The PEFT paradigm, only a small number of parameters $\phi$ are updated while $\theta$ is fixed at $\theta_0$ . (d) the linearized PEFT (L-PEFT) paradigm, which is similar to PEFT fine-tuning, where $\phi$ is updated while $\theta_0$ is fixed. However, in L-PEFT, only the linearized PEFT modules are fine-tuned in the tangent space. This approach incurs only a fraction of the training and inference costs compared to standard PEFT fine-tuning. In this paper, we explore LoRA fine-tuning and linearized LoRA (L-LoRA) fine-tuning.
+
+From Figures 2 and 8, we observe that task vectors from L-LoRA fine-tuning are closer to orthogonal than those from LoRA, which indicates that models fine-tuned with L-LoRA are more task-independent than those in LoRA. This is because the trainable parameters $\phi$ with L-LoRA are fine-tuned in the tangent space, which is a linear space, while $\phi$ in LoRA are fine-tuned in the original ambient space, which is a non-linear space. Besides, in some cases, the cosine similarity of task vectors from full fine-tuning are more orthogonal than those from L-LoRA. This may due to the larger space of trainable parameters available to full fine-tuning, providing an extremely high-dimensional space to encode specialized task knowledge. So even though L-LoRA tunes parameters in a linear subspace, the total capacity is restricted compared to full fine-tuning.
+
+# 4.2 THE PARAMETER-SCALING LAW FOR WEIGHT DISENTANGLEMENT
+
+Previous findings in (Ilharco et al., 2023; Guillermo Ortiz-Jimenez et al., 2023) also suggest an empirical parameter-scaling law wherein weight disentanglement improves with increased number of trainable model parameters. Intuitively, (1) The larger the number of parameters, the stronger the expressive ability of the model, which can better learn the correlation between different tasks, thus facilitating weight disentanglement. (2) The over-parameterization brought about by a large number of parameters can provide more degrees of freedom to learn the feature representation required for
+
+
+
+
+(a) CLIP-ViT-B-16 model on image classification tasks.
+(b) Flan-T5-Base model on NLP tasks.
+Figure 4: Pairs of model fusion. These figures show scatter plots demonstrating the performance of different model fusion techniques on pairs of tasks. Each plot corresponds to a different fusion method. The x and y axes in each plot denote the normalized scores on the two tasks. Points indicate the performance of specific instances. Dashed lines represent the average performance per task for each method. (a) Image classification tasks. (b) NLP tasks.
+
+each task and reduce parameter competition or interference between different tasks. Figure 5(a) shows that even though L-LoRA fine-tuning has far fewer trainable parameters compared to full fine-tuning $(<1\%)$ , it achieves comparable average normalized scores to full fine-tuning.
+
+# 5 EXPERIMENTS
+
+In this section, we conduct experiments on diverse tasks spanning both vision and natural language domains. We employ CLIP and Flan-T5 models on vision and language domains, respectively. For detailed descriptions, please refer to Appendix C.
+
+Throughout the following experiments, we compare the performance when models are fine-tuned using full fine-tuning, LoRA (Hu et al., 2021), and our proposed L-LoRA fine-tuning. A more detailed experimental description of model fine-tuning is provided in Appendix C.
+
+Baseline methods. We compare our fine-tuning method combined with four baseline multi-task model fusion methods: simple average, task arithmetic (Ilharco et al., 2023; Zhang et al., 2023), ties-merging (Yadav et al., 2023), and LoraHub (Huang et al., 2023). Please refer to Appendix E.1 for a more detailed description of these methods and hyper-parameter settings in our experiments.
+
+# 5.1 MULTI-TASK MODEL FUSION ON VISION AND LANGUAGE DOMAINS
+
+We extensively investigate the multi-task model fusion by considering all possible subsets of the tasks, amounting to a total of $2^{n} - (n + 1)$ subsets (excluding subsets with a single task and an empty set). We employ various model fusion algorithms to accomplish this. Subsequently, we assess the performance of the final model across the downstream tasks in both the vision and language domains. Detailed experimental settings are provided in Appendix E.
+
+Figure 4 shows scatter plots demonstrating the performance of four fusion methods: simple averaging, task arithmetic, ties-merging, and LoraHub. Each plot corresponds to one fusion approach applied to two tasks. This analysis of pairs of tasks highlights distinctions between fusion techniques. For image classification tasks, we observe that L-LoRA fine-tuning surpasses LoRA fine-tuning with all four model fusion algorithms, with task arithmetic and LoraHub even exceeds full fine-tuning. As for NLP tasks, we observe comparable results between LoRA fine-tuning and L-LoRA fine-tuning, although not as strong as full fine-tuning in some cases.
+
+
+(a) CLIP-ViT-B-16 model on image classification tasks.
+
+
+(b) Flan-T5-Base model on NLP tasks.
+Figure 5: Multi-task model fusion. we construct multi-task models by utilizing task vectors specific to individual tasks, employing various model fusion algorithms. In the evaluation, the x-axis represents the number of task vectors used in building the multi-task model, while the y-axis represents the average normalized scores of the resulting models across all seven downstream tasks. The lines on the plot represent the average normalized scores of all multi-task models when considering a fixed number of tasks, and the shaded area corresponds to the standard deviation.
+
+Table 1: The average of the normalized scores for all combinations (avg. ± std.).
+
+
Fine-tuning method
Simple average
Task Arithmetic
Ties-merging
LoraHub
CLIP-ViT-B-16
full fine-tuning
0.65 ± 0.04
0.69 ± 0.06
0.69 ± 0.06
0.61 ± 0.03
LoRA fine-tuning
0.58 ± 0.18
0.64 ± 0.03
0.63 ± 0.03
0.65 ± 0.04
L-LoRA fine-tuning
0.66 ± 0.02
0.77 ± 0.05
0.73 ± 0.04
0.77 ± 0.05
Flan-T5-Base
full fine-tuning
0.19 ± 0.08
0.32 ± 0.08
0.28 ± 0.08
0.24 ± 0.06
LoRA fine-tuning
0.06 ± 0.07
0.21 ± 0.07
0.21 ± 0.08
0.23 ± 0.07
L-LoRA fine-tuning
0.05 ± 0.07
0.26 ± 0.05
0.24 ± 0.06
0.28 ± 0.08
+
+Figures 5, 10 and 11 show the performance of multi-task models constructed using different fine-tuning methods and fusion algorithms over an increasing number of task vectors. Table 1 shows the average over all combinations. In line with (Ilharco et al., 2023), we compare the normalized scores of merged multi-task models. The normalized score is defined as the absolute score divided by the score of the corresponding single-task model. These results highlight the capability of model fusion methods to effectively leverage knowledge into a single unified multi-task model.
+
+In Figure 5, we also notice that for full fine-tuning, the ties-merging performs better than LoraHub on visual tasks, while this is not the case on NLP tasks. Ties-merging introduces several innovations to address the challenges of parameter interference. This indicates that the degree of interference between visual tasks is higher than that between NLP tasks. Compare the cosine similarities matrix between Figure 2(a) and Figure 8(a), indeed, the task vectors on vision domain have higher cosine similarity, which is consistent with this model fusion phenomenon. Since the higher cosine similarity between task vectors implies greater redundancy and overlap in the knowledge captured. This results in more destructive task interference when naively merging the specialized models.
+
+For both image classification tasks and NLP tasks, we observe that the normalized scores of L-LoRA surpass LoRA fine-tuning in most cases, and L-LoRA even exceeds full fine-tuning with task
+
+
+
+
+
+
+
+
+
+
+Figure 6: Weight disentanglement error visualization (LoRA vs L-LoRA): The heatmaps demonstrate the disentanglement error, denoted as $\xi (\lambda_1,\lambda_2)$ , for both a LoRA fine-tuned flan-t5-base models and their L-LoRA counterparts across various NLP task pairs. In these heatmaps, lighter regions indicate lower weight disentanglement error, indicating stronger weight disentanglement. Within the heatmaps, the red box outlines the specific search space utilized to calculate the optimal $\lambda$ hyperparameters for our multi-model fusion experiments (refer to Section 5.1 and Appendix E).
+
+
+
+
+
+
+
+arithmetic and ties-merging. In addition, LoRA is more effective than L-LoRA for a smaller number of tasks in some cases, but as the number of task vectors increases, L-LoRA surpasses LoRA. This phenomenon also suggests the effectiveness of L-LoRA fine-tuning for multi-task model fusion, we further discuss it in Appendix E.2.
+
+A more in-depth analysis comparison between LoRA and L-LoRA is provided in Figures 10 and 11. For further elaboration and supplementary details, please refer to Appendix E.
+
+# 5.2 WEIGHT DISENTANGLEMENT VISUALIZATION
+
+To analyze the impact of the partial linearization process of PEFT modules on weight disentangle-. ment, we evaluate LoRA fine-tuned models and their L-LoRA counterparts to visualize in Figure 6.
+
+The heatmaps allow us to compare the error landscapes in the interpolation space. There are clear differences between the LoRA and L-LoRA heatmaps. The results indicate that the LoRA models exhibit a negligible disentanglement error confined to a narrow region in proximity to their pretrained model. On the contrary, the L-LoRA models showcase a low-error distribution across a wider area. These findings strongly suggest that the proposed partial linearization process employed in L-LoRA fine-tuning offers notable advantages in effectively disentangling the weights learned for each specific task, thereby enhancing its ability to capture task-specific information and improve performance across diverse tasks.
+
+# 6 CONCLUSION
+
+In this work, we propose a novel partial linearization method to improve multi-task fusion for parameter-efficient fine-tuning techniques. Specifically, our approach partially linearizes only the adapter modules and applies model fusion algorithms over the linearized adapters. This allows us to leverage the advantages of model fusion over linearized fine-tuning, while still performing fine-tuning and inference efficiently. Our experiments are conduct on both vision and language domains extensively. The results demonstrate that partially linearized LoRA models enable a more effective fusion of multiple tasks into a unified multi-task model, outperforming standard LoRA fine-tuning and model fusion algorithms alone.
+
+Future work could further explore partial linearization, where some parameters are fine-tuned in a linear space while others remain nonlinear. This hybrid approach could trade-off between specialized single-task performance and weight disentanglement capability.
+
+# ACKNOWLEDGMENTS
+
+This work is supported in part by the National Key Research and Development Program of China under No. 2023YFC2705700, the Special Fund of Hubei Luojia Laboratory under Grant 220100014, the National Natural Science Foundation of China (Grant No. 62225113, U23A20318 and 62276195), and CCF-Zhipu AI Large Model Fund OF 202224.
+
+# REFERENCES
+
+Samuel K. Ainsworth, Jonathan Hayase, and Siddhartha Srinivasa. Git Re-Basin: Merging Models modulo Permutation Symmetries, March 2023. URL http://arxiv.org/abs/2209.04836. arXiv:2209.04836 [cs] Read_Status: Read Read_Status_Date: 2023-08-31T10:29:51.597Z.
+Hong-You Chen, Jike Zhong, Mingda Zhang, Xuhui Jia, Hang Qi, Boqing Gong, Wei-Lun Chao, and Li Zhang. Federated Learning of Shareable Bases for Personalization-Friendly Image Classification, April 2023. URL http://arxiv.org/abs/2304.07882. arXiv:2304.07882 [cs].
+Gong Cheng, Junwei Han, and Xiaoqiang Lu. Remote Sensing Image Scene Classification: Benchmark and State of the Art. Proceedings of the IEEE, 105(10):1865-1883, October 2017. ISSN 0018-9219, 1558-2256. doi: 10.1109/JPROC.2017.2675998. URL http://arxiv.org/abs/1703.00121. arXiv:1703.00121 [cs].
+Alexandra Chronopoulou, Matthew E. Peters, Alexander Fraser, and Jesse Dodge. AdapterSoup: Weight Averaging to Improve Generalization of Pretrained Language Models, March 2023. URL http://arxiv.org/abs/2302.07027. arXiv:2302.07027 [cs] Read_Status: Read Read_Status_Date: 2023-08-31T09:57:45.371Z.
+Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Alex Castro-Ros, Marie Pellat, Kevin Robinson, Dasha Valter, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei. Scaling Instruction-Finetuned Language Models, December 2022. URL http://arxiv.org/abs/2210.11416.arXiv:2210.11416 [cs].
+Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing Textures in the Wild. In 2014 IEEE Conference on Computer Vision and Pattern Recognition, pp. 3606-3613, Columbus, OH, USA, June 2014. IEEE. ISBN 978-1-4799-5118-5. doi: 10. 1109/CVPR.2014.461. URL https://ieeexplore.ieee.org/document/6909856.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, May 2019. URL http://arxiv.org/abs/1810.04805.arXiv:1810.04805 [cs].
+Thomas G. Dietterich. Ensemble methods in machine learning. In Multiple classifier systems, pp. 1-15, Berlin, Heidelberg, 2000. Springer Berlin Heidelberg. ISBN 978-3-540-45014-6. Read_Status: Read Read_Status_Date: 2023-08-31T09:58:47.346Z.
+Timur Garipov, Pavel Izmailov, Dmitrii Podoprikhin, Dmitry Vetrov, and Andrew Gordon Wilson. Loss Surfaces, Mode Connectivity, and Fast Ensembling of DNNs, October 2018. URL http://arxiv.org/abs/1802.10026.arXiv:1802.10026 [cs, stat].
+George Stoica, Daniel Bolya, Jakob Bjorner, Taylor Hearn, and Judy Hoffman. ZipIt! Merging Models from Different Tasks without Training, May 2023. URL http://arxiv.org/abs/2305.03053.arXiv:2305.03053 [cs].
+Guillermo Ortiz-Jimenez, Alessandro Favero, and Pascal Frossard. Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models, May 2023. URL http://arxiv.org/abs/2305.12827. arXiv:2305.12827 [cs] Read_Status: Read Read_Status_Date: 2023-08-31T08:15:40.043Z.
+
+Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Introducing eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. In IGARSS 2018-2018 IEEE International Geoscience and Remote Sensing Symposium, pp. 204-207. IEEE, 2018.
+Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-Efficient Transfer Learning for NLP, June 2019. URL http://arxiv.org/abs/1902.00751. arXiv:1902.00751 [cs, stat].
+Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-Rank Adaptation of Large Language Models, October 2021. URL http://arxiv.org/abs/2106.09685. arXiv:2106.09685 [cs].
+Chengsong Huang, Qian Liu, Bill Yuchen Lin, Tianyu Pang, Chao Du, and Min Lin. *LoraHub: Efficient Cross-Task Generalization via Dynamic LoRA Composition*, July 2023. URL http://arxiv.org/abs/2307.13269. arXiv:2307.13269 [cs] Read_Status: Read Read_Status_Date: 2023-08-31T09:57:31.585Z.
+Gabriel Ilharco, Mitchell Wortsman, Samir Yitzhak Gadre, Shuran Song, Hannaneh Hajishirzi, Simon Kornblith, Ali Farhadi, and Ludwig Schmidt. Patching open-vocabulary models by interpolating weights, October 2022. URL http://arxiv.org/abs/2208.05592.arXiv:2208.05592 [cs].
+Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi, and Ali Farhadi. Editing Models with Task Arithmetic, March 2023. URL http://arxiv.org/abs/2212.04089.arXiv:2212.04089 [cs].
+Arthur Jacot, Franck Gabriel, and Hongler Clement. Neural Tangent Kernel: Convergence and Generalization in Neural Networks. In Advances in Neural Information Processing Systems 31 (NeurIPS 2018), 2018.
+Weisen Jiang, Baijiong Lin, Han Shi, Yu Zhang, Zhenguo Li, and James T. Kwok. Effective and Parameter-Efficient Reusing Fine-Tuned Models, October 2023. URL http://arxiv.org/abs/2310.01886.arXiv:2310.01886 [cs] version: 2.
+Xisen Jin, Xiang Ren, Daniel Preotiuc-Pietro, and Pengxiang Cheng. Dataless Knowledge Fusion by Merging Weights of Language Models, April 2023. URL http://arxiv.org/abs/2212.09849. arXiv:2212.09849 [cs].
+Jean Kaddour. Stop Wasting My Time! Saving Days of ImageNet and BERT Training with Latest Weight Averaging, October 2022. URL http://arxiv.org/abs/2209.14981.arXiv:2209.14981 [cs, stat].
+Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3D Object Representations for Fine-Grained Categorization. In 2013 IEEE International Conference on Computer Vision Workshops, pp. 554-561, December 2013. doi: 10.1109/ICCVW.2013.77. URL https://ieeexplore.ieee.org/document/6755945.
+Brian Lester, Rami Al-Rfou, and Noah Constant. The Power of Scale for Parameter-Efficient Prompt Tuning, September 2021. URL http://arxiv.org/abs/2104.08691.arXiv:2104.08691 [cs].
+Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the Loss Landscape of Neural Nets, November 2018. URL http://arxiv.org/abs/1712.09913.arXiv:1712.09913 [cs, stat].
+Weishi Li, Yong Peng, Miao Zhang, Liang Ding, Han Hu, and Li Shen. Deep Model Fusion: A Survey, September 2023. URL http://arxiv.org/abs/2309.15698.
+Xiang Lisa Li and Percy Liang. Prefix-Tuning: Optimizing Continuous Prompts for Generation, January 2021. URL http://arxiv.org/abs/2101.00190. arXiv:2101.00190 [cs].
+
+Chang Liu, Chenfei Lou, Runzhong Wang, Alan Yuhan Xi, Li Shen, and Junchi Yan. Deep Neural Network Fusion via Graph Matching with Applications to Model Ensemble and Federated Learning. In Proceedings of the 39th International Conference on Machine Learning, pp. 13857-13869. PMLR, June 2022a. URL https://proceedings.mlr.press/v162/1iu22k.html.
+Haokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta, Tenghao Huang, Mohit Bansal, and Colin Raffel. Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning, August 2022b. URL http://arxiv.org/abs/2205.05638.arXiv:2205.05638 [cs].
+Jialin Liu, Antoine Moreau, Mike Preuss, Baptiste Roziere, Jeremy Rapin, Fabien Teytaud, and Olivier Teytaud. Versatile Black-Box Optimization, April 2020. URL http://arxiv.org/abs/2004.14014. arXiv:2004.14014 [cs].
+Tian Yu Liu and Stefano Soatto. Tangent Model Composition for Ensembling and Continual Finetuning, July 2023. URL http://arxiv.org/abs/2307.08114. arXiv:2307.08114 [cs] Read_Status: Read Read_Status_Date: 2023-08-31T09:58:40.830Z.
+Yihang Lou, Ling Yu Duan, Yong Luo, Ziqian Chen, Tongliang Liu, Shiqi Wang, and Wen Gao. Towards Efficient Front-End Visual Sensing for Digital Retina: A Model-Centric Paradigm. IEEE Transactions on Multimedia, 22(11):3002-3013, 2020. ISSN 19410077. doi: 10.1109/TMM.2020.2966885. ISBN: 1901014738.
+Michael Matena and Colin Raffel. Merging Models with Fisher-Weighted Averaging, August 2022. URL http://arxiv.org/abs/2111.09832.arXiv:2111.09832 [cs].
+Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D. Manning. Fast Model Editing at Scale, June 2022a. URL http://arxiv.org/abs/2110.11309.arXiv:2110.11309 [cs].
+Eric Mitchell, Charles Lin, Antoine Bosselut, Christopher D. Manning, and Chelsea Finn. Memory-Based Model Editing at Scale. In Proceedings of the 39th International Conference on Machine Learning, pp. 15817-15831. PMLR, June 2022b. URL https://proceedings.mlrpress/v162/mitchell122a.html. ISSN: 2640-3498.
+Shikhar Murty, Christopher Manning, Scott Lundberg, and Marco Tulio Ribeiro. Fixing Model Bugs with Natural Language Patches. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 11600-11613, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.emnlp-main.797. URL https://aclanthology.org/2022.emnlp-main.797.
+Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading Digits in Natural Images with Unsupervised Feature Learning. 2021.
+Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback, March 2022. URL http://arxiv.org/abs/2203.02155. arXiv:2203.02155 [cs].
+Barak A. Pearlmutter. Fast Exact Multiplication by the Hessian. Neural Computation, 6(1):147-160, January 1994. ISSN 0899-7667, 1530-888X. doi: 10.1162/neco.1994.6.1.147. URL https://direct.mit.edu/neco/article/6/1/147-160/5766.
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language Models are Unsupervised Multitask Learners. 1:9, 2019.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning Transferable Visual Models From Natural Language Supervision, February 2021. URL http://arxiv.org/abs/2103.00020. arXiv:2103.00020 [cs].
+
+Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer, July 2020. URL http://arxiv.org/abs/1910.10683.arXiv:1910.10683 [cs, stat].
+Marco Tulio Ribeiro and Scott Lundberg. Adaptive Testing and Debugging of NLP Models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3253-3267, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.230. URL https://aclanthology.org/2022.acl-long.230.
+Shibani Santurkar, Dimitris Tsipras, Mahalaxmi Elango, David Bau, Antonio Torralba, and Aleksander Madry. Editing a classifier by rewriting its prediction rules. In Advances in Neural Information Processing Systems, volume 34, pp. 23359-23373. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper/2021/hash/c46489a2d5a9a9ecfc53b17610926ddd-Abstract.html.
+Sunny Sanyal, Jean Kaddour, Abhishek Kumar, and Sujay Sanghavi. Understanding the Effectiveness of Early Weight Averaging for Training Large Language Models, June 2023. URL http://arxiv.org/abs/2306.03241.arXiv:2306.03241 [cs].
+J. Stallkamp, M. Schlipsing, J. Salmen, and C. Igel. Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition. Neural Networks, 32:323-332, August 2012. ISSN 0893-6080. doi: 10.1016/j.neunet.2012.02.016. URL https://www.sciencedirect.com/science/article/pii/S0893608012000457.
+Tianxiang Sun, Yunfan Shao, Hong Qian, Xuanjing Huang, and Xipeng Qiu. Black-Box Tuning for Language-Model-as-a-Service, June 2022. URL http://arxiv.org/abs/2201.03514.arXiv:2201.03514 [cs].
+Anke Tang, Yong Luo, Han Hu, Fengxiang He, Kehua Su, Bo Du, Yixin Chen, and Dacheng Tao. Improving Heterogeneous Model Reuse by Density Estimation. volume 4, pp. 4244-4252, August 2023. doi: 10.24963/ijcai.2023/472. URL https://www.ijcai.org/proceedings/2023/472. ISSN: 1045-0823.
+Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 353–355, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-5446. URL http://aclweb.org/anthology/W18-5446.
+Zhenyi Wang, Xiaoyang Wang, Li Shen, Qiuling Suo, Kaiqiang Song, Dong Yu, Yan Shen, and Mingchen Gao. Meta-learning without data via Wasserstein distributionally-robust model fusion. In Proceedings of the Thirty-Eighth Conference on Uncertainty in Artificial Intelligence, pp. 2045-2055. PMLR, August 2022. URL https://proceedings.mlr.press/v180/wang22a.html.
+Lilian Weng. Some math behind neural tangent kernel. *Lil'Log*, Sep 2022. URL https://lilianweng.github.io/posts/2022-09-08-ntk/.
+Mitchell Wortsman, Gabriel Ilharco, Samir Yitzhak Gadre, Rebecca Roelofs, Raphael Gontijo-Lopes, Ari S. Morcos, Hongseok Namkoong, Ali Farhadi, Yair Carmon, Simon Kornblith, and Ludwig Schmidt. Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time, July 2022a. URL http://arxiv.org/abs/2203.05482. rate: 4 Read_Status: Read Read_Status_Date: 2023-08-31T10:29:57.393Z.
+Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo-Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, and Ludwig Schmidt. Robust fine-tuning of zero-shot models, June 2022b. URL http://arxiv.org/abs/2109.01903.arXiv:2109.01903 [cs].
+
+Chengyue Wu, Teng Wang, Yixiao Ge, Zeyu Lu, Ruisong Zhou, Ying Shan, and Ping Luo. $\pi$ -Tuning: Transferring Multimodal Foundation Models with Optimal Multi-task Interpolation, May 2023. URL http://arxiv.org/abs/2304.14381.arXiv:2304.14381 [cs].
+Xi Zhu Wu, Song Liu, and Zhi Hua Zhou. Heterogeneous model reuse via optimizing multiparty multiclass margin. 36th International Conference on Machine Learning, ICML 2019, 2019-June: 11862-11871, 2019. ISBN: 9781510886988 rate: 0.
+Jianxiong Xiao, James Hays, Krista A. Ehinger, Aude Oliva, and Antonio Torralba. SUN database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 3485-3492, San Francisco, CA, USA, June 2010. IEEE. ISBN 978-1-4244-6984-0. doi: 10.1109/CVPR.2010.5539970. URL http://ieeexplore.ieee.org/document/5539970/.
+Prateek Yadav, Derek Tam, Leshem Choshen, Colin Raffel, and Mohit Bansal. Resolving Interference When Merging Models, June 2023. URL http://arxiv.org/abs/2306.01708.arXiv:2306.01708 [cs] Read_Status: Read Read_Status_Date: 2023-08-31T08:12:34.747Z.
+Jinghan Zhang, Shiqi Chen, Junteng Liu, and Junxian He. Composing Parameter-Efficient Modules with Arithmetic Operations, June 2023. URL http://arxiv.org/abs/2306.14870.arXiv:2306.14870 [cs].
+
+# A DEFINITION OF TASK VECTOR
+
+In this section, we provide insights into the rationale behind defining the task vector and the associated advantages. Our definition of the task vector for full fine-tuning is consistent with that introduced in (Ilharco et al., 2023). However, for parameter-efficient fine-tuning, we define the task vector as $\phi_{i} - \phi_{0}$ on the trainable parameter space instead of the change of $\theta$ on the original model parameter space as done in (Jiang et al., 2023; Zhang et al., 2023). This deliberate decision is carefully considered and corresponds to the nature of our fine-tuning approach.
+
+Take LoRA as an example, when partially linearizing a LoRA model, we focus on the dynamics of the trainable parameters and compute the Jacobian-vector product for all trainable parameters, specifically the LoRA parameters denoted by $\phi$ . The original model parameters, $\theta_0$ , remain constant throughout the fine-tuning process and serve as fixed foundations or buffers that enable the adaptable components of the model, the LoRA parameters, to manifest their effects.
+
+From a mathematical standpoint, we perform a first-order Taylor expansion exclusively on the trainable parameters. This expansion does not include the parameter merging operations of LoRA:
+
+$$
+f _ {\theta_ {0}} ^ {\operatorname {l i n}} (x; \phi) = f _ {\theta_ {0}} (x; \phi_ {0}) + \nabla_ {\phi} f _ {\theta_ {0}} (x; \phi_ {0}) ^ {\top} (\phi - \phi_ {0}) \tag {5}
+$$
+
+It is essential to emphasize that the application of this Taylor expansion is restricted to the parameters explicitly designated as trainable. These are the parameters that undergo active adjustments during the fine-tuning phase, representing the modifiable components of the model.
+
+What's more, while our experiments have primarily utilized LoRA fine-tuning, such a definition proves beneficial for generalizing our method to other parameter-efficient fine-tuning techniques, such as adapter-tuning.
+
+# B MODEL LINEARIZATION FROM A NTK PERSPECTIVE
+
+In this section, we show that a linearized model is more capable to separate the function outputs in different directions in weight space, thus leading to an enhancement of weight disentanglement and offering advantages over non-linear models for model fusion.
+
+The linearized model, described by Eq.(4) approximates the behavior of the neural network $f_{\theta_0}(x,\phi (t))$ at a specific time $t$ , where $\theta_0,f_{\theta_0}(x;\phi (0)),\nabla_\phi f_{\theta_0}(x;\phi (0))$ are all constants. Consequently, the linearized function $f_{\theta_0}^{\mathrm{lin}}(\phi (t);x)$ is a linear function of $\phi (t)$ .
+
+Assuming the trainable parameters are updated by gradient descent on task $\tau_{i}$ , hence
+
+$$
+\begin{array}{l} \nabla_ {\phi} \mathcal {L} \left(\tau_ {i}; \theta_ {0}, \phi\right) = \mathbb {E} _ {\left(x _ {\tau_ {i}}, y _ {\tau_ {i}}\right) \sim D _ {\tau_ {i}}} \left[ \nabla_ {\phi} f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi\right) \nabla_ {f} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi\right), y _ {\tau_ {i}}\right) \right] (6) \\ \phi (\Delta t) - \phi (0) = - \eta \nabla_ {\phi} \mathcal {L} \left(\tau_ {i}; \theta_ {0}, \phi (0)\right) (7) \\ = - \eta \mathbb {E} _ {\left(x _ {\tau_ {i}}, y _ {\tau_ {i}}\right) \sim D _ {\tau_ {i}}} \left[ \nabla_ {\phi} f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right) \nabla_ {f} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right), y _ {\tau_ {i}}\right) \right], (8) \\ \end{array}
+$$
+
+where $\eta$ denotes the learning rate and $\mathcal{L}_{\mathrm{CE}}$ is the cross-entropy loss. Consequently,
+
+$$
+\begin{array}{l} f _ {\theta_ {0}} ^ {\operatorname {l i n}} (x; \phi (\Delta t)) - f _ {\theta_ {0}} (x; \phi (0)) (9) \\ = \nabla_ {\phi} f _ {\theta_ {0}} (x; \phi (0)) ^ {\top} (\phi (\Delta t) - \phi (0)) (10) \\ = - \eta \mathbb {E} _ {\left(x _ {\tau_ {i}}, y _ {\tau_ {i}}\right) \sim D _ {\tau_ {i}}} \left[ \nabla_ {\phi} f _ {\theta_ {0}} (x; \phi (0)) ^ {\top} \nabla_ {\phi} f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right) \nabla_ {f} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right), y _ {\tau_ {i}}\right) \right] (11) \\ = - \eta \mathbb {E} _ {\left(x _ {\tau_ {i}}, y _ {\tau_ {i}}\right) \sim D _ {\tau_ {i}}} \left[ K (x, x _ {\tau_ {i}}; \phi (0)) \nabla_ {f} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right), y _ {\tau_ {i}}\right) \right], (12) \\ \end{array}
+$$
+
+where $\pmb{K}$ is known as neural tangent kernel (Jacot et al., 2018), which is defined as $\pmb{K}(\pmb{x},\pmb{x}';\phi) = \langle \nabla_{\phi}f_{\theta_0}(x;\phi),\nabla_{\phi}f_{\theta_0}(x';\phi)\rangle \in \mathbb{R}^{|x|}\times \mathbb{R}^{|x|}\to \mathbb{R}^{|f|\times |f|}$ . Since the NTK term is fixed throughout the training, the change in the model output $\Delta f_{\theta_0}^{\mathrm{lin}}(x;\phi (\Delta t))$ is solely determined by the gradient of the loss $\nabla_f\mathcal{L}_{\mathrm{CE}}(f_{\theta_0}(x_{\tau_i};\phi (0)),y_{\tau_i})$ . This establishes the connection between the neural network dynamics and kernel methods, allowing us to analyze the model through the lens of NTK.
+
+Connection between linearization and weight disentanglement. Integrating the concept of a linearized model, we can express how the linearized model's output for a given input sample $x$ evolves from its initial state $\phi(0)$ over time as follows: For any small time increment $\Delta t$ , the difference in
+
+output from the linearized model $f_{\theta_0}^{\mathrm{lin}}$ at the state $\phi(\Delta t)$ compared to the original model $f_{\theta_0}$ at the initial state $\phi(0)$ is calculated by projecting the gradient of the model output with respect to its initial parameters $\nabla_{\phi}f(x;\phi(0))$ onto the parameter change $\phi(\Delta t) - \phi(0)$ . Symbolically, this relationship is denoted as:
+
+$$
+f _ {\theta_ {0}} ^ {\ln} (x; \phi (\Delta t)) - f _ {\theta_ {0}} (x; \phi (0)) = \nabla_ {\phi} f _ {\theta_ {0}} (x; \phi (0)) ^ {\top} (\phi (\Delta t) - \phi (0)), \tag {13}
+$$
+
+which further simplifies to a term involving the expectation over the dataset $D_{\tau_i}$ , capturing the interaction between the kernel representation $\pmb{K}$ of the input samples and the gradient of the loss function $\nabla_f\mathcal{L}_{\mathrm{CE}}$ . Mathematically, this term is represented as Eq.(12):
+
+$$
+- \eta \mathbb {E} _ {\left(x _ {\tau_ {i}}, y _ {\tau_ {i}}\right) \sim D _ {\tau_ {i}}} \left[ K (x, x _ {\tau_ {i}}; \phi (0)) \nabla_ {f} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right), y _ {\tau_ {i}}\right) \right]. \tag {14}
+$$
+
+Building upon this derivation, we arrive at a fundamental equation that depicts the proportional relationship between the expected task-specific gradient of the loss function and the modification in parameters for the linearized model:
+
+$$
+\phi (\Delta t) - \phi (0) \propto \mathbb {E} _ {\left(x _ {\tau_ {i}}, y _ {\tau_ {i}}\right) \sim D _ {\tau_ {i}}} [ K (x, x _ {\tau_ {i}}; \phi (0)) \nabla_ {f} \mathcal {L} _ {\mathrm {C E}} \left(f _ {\theta_ {0}} \left(x _ {\tau_ {i}}; \phi (0)\right), y _ {\tau_ {i}}\right) ]. \tag {15}
+$$
+
+In essence, this formula underscores the direct correspondence between the changes in weights of a linearized model and the gradient of the loss. It hints at the underlying mechanisms of weight disentanglement, revealing that the adjustment in parameters is essentially directed by the aggregated gradient information from the task-specific data. This understanding is crucial as it provides insight into how a model's weights evolve in response to the learning process.
+
+# C MODEL FINE-TUNING DETAILS
+
+All of our experiments were performed using the same hardware consisting of eight NVIDIA GTX 3090 GPUs with 24GB video memory. We used PyTorch 2.0 and Python 3 throughout all experiments.
+
+Model, Evaluation Tasks, and Metrics. We conduct experiments on diverse tasks spanning both vision and natural language domains. The model, evaluation datasets and metrics settings are as follows:
+
+- For vision tasks, we utilize CLIP (Radford et al., 2021) as our pre-trained model. For fine-tuning, we employ the CLIP-ViT-B-16 models on seven image classification tasks derived with the same random seed 42 to initialize the parameter-efficient models. These tasks are Stanford Cars (Krause et al., 2013), DTD (Cimpoi et al., 2014), EuroSAT (Helber et al., 2018), GT-SRB (Stallkamp et al., 2012), RESISC45 (Cheng et al., 2017), SUN397 (Xiao et al., 2010), and SVHN (Netzer et al., 2021). We report top-1 accuracy as a performance metric.
+- For NLP tasks, we utilize Flan-T5 (Chung et al., 2022) as our pre-trained language model. For fine-tuning, we employ the Flan-T5-base models on seven tasks derived from the GLUE benchmark (Wang et al., 2018) with the same random seed 42 to initialize the parameter-efficient models. These tasks are CoLA, MNLI, MRPC, QQP, RTE, SST2, and STSB. We report Spearman's $\rho$ for STSB and accuracy for others.
+
+Vision domain. All the fine-tuning experiments on image classification tasks using AdamW optimizer. We fine-tune pre-trained CLIP-ViT-B-16 (Radford et al., 2021) downloaded from HuggingFace $^{1}$ . For image classification tasks we use the text prompt template 'a photo of {label}' to compute the text embeddings. We initialize all parameter-efficient modules (LoRA and L-LoRA) with the same random seed 42. We use a batch size of 64 and a learning rate of 1e-5 and a weight decay of 0.1 with a warm-up cosine scheduler for 6000 steps for all downstream tasks.
+
+Language domain. The fine-tuning experiments on NLP tasks in our study follow the same experimental setup as described in (Raffel et al., 2020) using Adam optimizer. We fine-tune pre-trained Flan-T5-base model (Chung et al., 2022) download from HuggingFace ${}^{2}$ . In line with the previous setup, we convert all the downstream NLP tasks into a text-to-text format. For specific examples,
+
+Table 2: Hyperparameters for model fine-tuning.
+
+
Scenario
Learning rate
Steps
Batch size
Weight decay
LoRA r
CLIP-ViT-B-16 on vision tasks
full fine-tuning
1e-5 (warm-up cos)
6000
64
0.1
-
LoRA
1e-5 (warm-up cos)
6000
64
0.1
16
L-LoRA
1e-5 (warm-up cos)
6000
64
0.1
16
Flan-T5-Base on NLP tasks
full fine-tuning
1e-5,2e-5
2000
16
0
-
LoRA
1e-5,2e-5,3e-5,4e-5
2000
16
0
16
L-LoRA
1e-5,2e-5,3e-5,4e-5
2000
16
0
16
+
+Table 3: Summary of fine-tuning statistics.
+
+
Fine-tune diagram
Trainable params.
Total params.
Trainable%
VRAM
Checkpoint size
CLIP-ViT-B-16 on vision tasks (batch size=64)
full fine-tuning
85M
85M
100%
≈ 12.4GB
328MB
LoRA (r=16)
294K
86M
0.34%
≈ 9.2GB
1.2MB
L-LoRA (r=16)
294K
93M
0.32%
≈ 9.3GB
1.2MB
+
+Flan-T5-Base on NLP tasks (batch size=16)
+
+
full fine-tuning
247M
247M
100%
≈ 16.3GB × 4
945MB
LoRA (r=8)
885K
248.5M
0.36%
≈ 11.3GB × 4
3.5MB
LoRA (r=16)
1,769K
249.3M
0.71%
≈ 11.4GB × 4
6.9MB
L-LoRA (r=8)
885K
291.8M
0.30%
≈ 11.3GB × 4
3.5MB
L-LoRA (r=16)
1,769K
293.5M
0.60%
≈ 11.4GB × 4
6.9MB
+
+please refer to F.1. This standardized format facilitates the training process and ensures consistency across different tasks, enabling effective fine-tuning of the models. We initialize all the parameter-efficient modules (LoRA and L-LoRA) with the same random seed 42. For standard full fine-tuning, a constant learning rate of 1e-5 or 2e-5 was used for 2000 steps with a batch size of 16 and no weight decay. For LoRA and L-LoRA fine-tuning, a sweep of learning rates from 1e-5 to 4e-5 was conducted, while keeping the other hyperparameters the same. The hyperparameter LoRA r is set to 16 for both LoRA and L-LoRA but is not applicable for full parameter fine-tuning. The learning rate sweep aims to find optimal values for different methods. Each fine-tuning run is conducted on four GPUs, utilizing the power of distributed data parallelism (DDP). This approach allows for efficient training of the model by dividing the batch across multiple GPUs and processing it simultaneously.
+
+Table 2 summarizes the key hyperparameters used during the fine-tuning of CLIP-ViT-B-16 and Flan-T5-base model under three different scenarios: standard full fine-tuning (FFT), fine-tuning with LoRA, and fine-tuning with L-LoRA.
+
+Table 3 presents a summary of the fine-tuning statistics for several different fine-tune diagrams. The table provides information on the trainable parameters, total parameters, trainable parameter percentage, VRAM utilization (with a batch size of 16) and checkpoint sizes.
+
+Taking the Flan-T5-Base model as an example, full parameter fine-tuning updates all parameters, while leading to very high VRAM usage of around 16.3GB per GPU and a large 945MB checkpoint size. On the contrary, the Low-Rank adaptation (LoRA) models have significantly fewer trainable parameters, ranging from 885K to 1.7M. This corresponds to only $0.3 - 0.7\%$ of the total parameters being trainable. Consequently, the VRAM usage is much lower at 11.3-11.4GB per GPU. The checkpoint sizes are also smaller, from 3.5-6.9MB. The linearized LoRA fine-tuning has VRAM usage similar to LoRA. They have more total parameters at 291.8-293.5M because we need to cache
+
+Table 4: Summary of training and inference cost.
+
+
Scenerio
Training (Adam)
Inference
Time
VRAM
Time
VRAM
CLIP-ViT-B-32 (batch size=64)
full fine-tuning (Figure 3(a))
8.25 it/s
≈ 4.2GB
13.28 it/s
≈ 0.9GB
full linearization (Figure 3(b))
4.94 it/s
≈ 6.3GB
8.52 it/s
≈ 2.0GB
LoRA (r=16) (Figure 3(c))
8.43 it/s
≈ 2.6GB
13.01 it/s
≈ 0.9GB
L-LoRA (r=16) (Figure 3(d))
7.55 it/s
≈ 2.7GB
10.65 it/s
≈ 1.0GB
CLIP-ViT-B-16 (batch size=64)
full fine-tuning
2.97 it/s
≈ 12.4GB
8.92 it/s
≈ 1.6GB
full linearization
1.49 it/s
≈ 20.1GB
2.50 it/s
≈ 3.7GB
LoRA (r=16)
3.83 it/s
≈ 9.1GB
8.60 it/s
≈ 1.6GB
L-LoRA (r=16)
3.24 it/s
≈ 9.2GB
7.23 it/s
≈ 1.8GB
CLIP-ViT-L-14 (batch size=16)
full fine-tuning
2.55 it/s
≈ 13.9GB
8.23 it/s
≈ 1.8GB
full linearization
1.32 it/s
≈ 21.8GB
2.26 it/s
≈ 4.8GB
LoRA (r=16)
3.49 it/s
≈ 9.1GB
7.99 it/s
≈ 1.8GB
L-LoRA (r=16)
2.99 it/s
≈ 9.3GB
6.55 it/s
≈ 1.9GB
+
+the initiation values of LoRA modules to compute the Jacobian vector products. The checkpoint sizes match LoRA as well.
+
+In summary of Table 3, full parameter fine-tuning has the most parameters but is costly to fine-tune. LoRA reduces the trainable subset of weights, enabling more efficient adaptation. L-LoRA increases the total parameters while maintaining a small trainable subset. Our partial linearization approach incurs minimal additional cost compared to standard LoRA fine-tuning. The training and inference costs increase only marginally and are negligible over LoRA.
+
+Table 4 summarizes the training and inference cost for different fine-tuning methods applied to CLIP vision models of varying sizes. The costs are broken down in terms of training/inference time (iterations/sec) and video RAM (VRAM) usage.
+
+Several key trends can be observed from Table 4. Full linearization is the slowest for both training and inference due to the increased computational cost. It also requires the most VRAM. LoRA is faster than full tuning for training and on par for inference, while using less VRAM for training due to the parameter-efficient fine-tuning. L-LoRA is slightly slower than LoRA. Its resource usage is comparable to LoRA.
+
+In Figure 7, we report the single task performance of different fine-tuning methods: full parameter fine-tuning, LoRA fine-tuning and L-LoRA fine-tuning. These results demonstrate that nonlinear fine-tuning consistently achieves higher single-task performance compared to linearized fine-tuning. Among the non-linear methods, full fine-tuning gives the highest task-specific accuracy, while LoRA tuning performs slightly worse, but is more parameter efficient. L-LoRA fine-tuning exhibits the lowest individual task performance. However, it provides improved multitask fusion capabilities. Although L-LoRA underperforms on single tasks, when evaluated on joint tasks, it can surpass LoRA fine-tuning due to enhanced representation disentanglement. The trade-off between specialized single-task accuracy and generalizable multi-task performance is evident when comparing full fine-tuning to LoRA and L-LoRA in Section 5.1 and Appendix E.
+
+Future work could further explore partial linearization, where some parameters are fine-tuned in a linear space while others remain nonlinear. This hybrid approach could trade-off between specialized single-task performance and weight disentanglement. Specifically, partitioning the parameters into fixed and linearly tuned subsets may combine the representation benefits of linearization with the expressiveness of nonlinear tuning. The non-linear parameters could capture task-specific adaptations, maximizing per-task accuracy. Meanwhile, the linearized parameters could encourage independence in different directions of weight space between tasks.
+
+
+(a) Performance of task-specific CLIP-ViT-B-16 models on downstream image classification tasks.
+
+
+(b) Performance of task-specific Flan-T5-Base models on downstream NLP task.
+
+# D LOSS LANDSCAPE AND COS SIMILARITY BETWEEN TASK VECTORS
+
+
+Figure 7: Performance of full fine-tuning, LoRA, and L-LoRA on downstream tasks. Full fine-tuning achieves the best individual task performance, followed by LoRA and then L-LoRA which trades off some task-specific accuracy for improved parameter efficiency.
+(a) full fine-tuning
+Figure 8: Similarity heatmap of task vectors. These figures show heatmaps of the cosine similarity between task vectors from task-specific Flan-T5 model (Chung et al., 2022) fine-tuned on different NLP tasks from GLUE benchmark (Wang et al., 2018). The task vector represents the parameter differences between the fine-tuned models and the original pre-trained model. (a) Cos similarity matrix of task vectors when using full fine-tuning of the entire model. (b) Task vector similarities when using LoRA, a parameter-efficient fine-tuning method. (c) Cos similarity of task vectors from L-LoRA, our proposed linearized tuning approach that fine-tunes parameter-efficient modules in tangent space.
+
+
+(b) LoRA fine-tuning
+
+
+(c) L-LoRA
+
+Figures 2 and 8 visualize the similarity between task-specific models fine-tuned on different tasks using full fine-tuning, LoRA, and linearized LoRA (L-LoRA). Full fine-tuning results in a low similarity between task vectors, indicating greater independence between task-specific representations. In contrast, LoRA tuning induces higher similarity and entanglement between tasks. L-LoRA improves over LoRA by further reducing the cosine similarity, demonstrating that linearized tuning of parameter-efficient modules enhances disentanglement compared to standard LoRA. The results are consistent across both a vision model (CLIP) fine-tuned on image datasets, and a language model (Flan-T5) fine-tuned on NLP datasets. This supports the hypothesis that constrained optimization techniques like L-LoRA can improve representational disentanglement compared to unstructured tuning approaches.
+
+# E MULTI-TASK MODEL FUSION
+
+# E.1 FURTHER DETAILS ABOUT BASELINES
+
+This section provides further implementation and configuration details for the baseline methods been compared in our experiments. An overview of the four baseline methods is provided as following. In Appendixes E.1.1, E.1.2, E.1.3 and E.1.4, the parameter settings used for each method in the experiments are explained.
+
+- Simple Weight Average: We average the trainable weights of the models fine-tuned on different tasks with different fine-tune methods, this method is also referred to as ModelSoup (Wortsman et al., 2022a) and AdapterSoup (Chronopoulou et al., 2023) in the literature. The averaged model is then evaluated on the validation set of each task. For full fine-tuned models, the weights of the models are averaged directly (i.e., let $\theta = 1/n\sum_{i=1}^{n}\theta_{i}$ ). For parameter-efficient fine-tuning, we average the added weights and then apply to the parameter-efficient modules, i.e., let $\phi = \frac{1}{n}\sum_{i=1}^{n}\phi_{i}$ and $f(x) = f_{\theta_0}(x;\phi)$ .
+- Task Arithmetic (Ilharco et al., 2023; Zhang et al., 2023): As defined in Section 3.1, the task vector is computed on the set of trainable parameters. We compute the task vector for each task and then add them to construct a multi-task vector. The multi-task vector is then multiplied by a scaling factor $\lambda$ element-wisely and added to the initial parameters of the pretrained model to obtain a multi-task model, i.e. $\theta = \theta_0 + \lambda \sum_i (\theta_i - \theta_0)$ for full fine-tuning and $\phi = \phi_0 + \lambda \sum_i (\phi_i - \phi_0)$ , $f(x) = f_{\theta_0}(x; \phi)$ for parameter-efficient fine-tuning, where $\lambda$ is a hyperparameter that the best-performing model is chosen on validation set.
+- Ties-Merging (Yadav et al., 2023): Ties-merging is a method for merging multiple task-specific models into a single multi-task model. This algorithm follows three steps (trim, elect sign of parameters, and disjoint merge) to obtain a merged task vector $\nu$ . Given the final merged task vector $\nu$ , the final model is chosen in a similar way as task arithmetic, i.e. $\theta = \theta_0 + \lambda \nu$ for full fine-tuning and $\phi = \phi_0 + \lambda \nu$ , $f(x) = f_{\theta_0}(x;\phi)$ for parameter-efficient fine-tuning, where $\lambda$ is a hyperparameter that the best-performing model is chosen on validation set.
+- LoraHub (Huang et al., 2023): Lorahub is a method to apply arithmetic operations to parameter-efficient modules. With the help of a few examples from a novel task, LoraHub estimates the optimal weights $\{w_{i}\}_{i}$ for the parameter-efficient modules by utilizing a black-box optimization technique (Liu et al., 2020; Sun et al., 2022) to minimize $\mathcal{L} + \alpha \sum_{i}|w_{i}|$ , where $\alpha$ is a hyperparameter. The final model is $f(x) = f_{\theta_0}(x;\phi)$ , where $\phi = \sum_{i}w_{i}\phi_{i}$ s.t. $\sum_{i}\alpha_{i} = 1$ . In practical implementation, we construct the final model with task vector arithmetic because we have $\nu = \phi -\phi_0 = (\sum_i w_i\phi_i) - \phi_0 = \sum_i w_i\nu_i$ , so $\phi = \phi_0 + \sum_i w_i\nu_i$ . We evaluate LoraHub with both LoRA fine-tuning and L-LoRA fine-tuning.
+
+# E.1.1 SIMPLE WEIGHT AVERAGE
+
+In our comparison, we employ the method known as ModelSoup (Wortsman et al., 2022a) or AdapterSoup (Chronopoulou et al., 2023) in the literature, which involves averaging the trainable weights of models. We adapt simple averaging to models that have been fine-tuned on different tasks using different fine-tuning methods. By averaging the weights in this manner, we create a combined model that incorporates the knowledge and expertise gained from multiple tasks and training methods. This averaged model is subsequently evaluated on the validation set of each respective task to assess its performance.
+
+For full fine-tuned models, we directly average the weights by computing the mean, represented as $\theta = \frac{1}{n}\sum_{i=1}^{n}\theta_{i}$ , where $n$ is the total number of models being averaged.
+
+When it comes to parameter-efficient fine-tuning, we compute the average of the added weights and then apply them to the parameter-efficient modules. This is accomplished by calculating the mean of the added weights as $\phi = \frac{1}{n}\sum_{i=1}^{n}\phi_i$ , and utilizing this average weight configuration in the parameter-efficient modules. Consequently, the function $f(x)$ is defined as $f(x) = f_{\theta_0}(x;\phi)$ , taking into account the updated averaged weights. We create a total of $2^7 - 8 = 120$ multi-task models for each fine-tuning method.
+
+# E.1.2 TASK ARITHMETIC
+
+As defined in Section 3.1, the task vector is computed on the set of trainable parameters. We compute the task vector for each task and then add them to construct a multi-task vector. The multi-task vector is then multiplied by a scaling factor $\lambda$ element-wisely and added to the initial parameters of the pre-trained model to obtain a multi-task model, i.e. $\theta = \theta_0 + \lambda \sum_i (\theta_i - \theta_0)$ for full fine-tuning (Ilharco et al., 2023) and $\phi = \phi_0 + \lambda \sum_i (\phi_i - \phi_0)$ , $f(x) = f_{\theta_0}(x; \phi)$ for parameter-efficient fine-tuning (Zhang et al., 2023), where $\lambda$ is a hyperparameter that the best-performing model is chosen on validation set.
+
+Following the practice from (Ilharco et al., 2023), we add task vectors together and use a single scaling coefficient for the sum of vectors, $\lambda \in \{0,0.05,0.1,\dots ,1.0\}$ . That is, for each set of tasks from the power set of $\{\tau_i\}_{i = 1}^7$ , we construct 21 candidate models with different $\lambda$ values. We then evaluate the performance of each model on the validation set of each combination of tasks, and choose the best-performing model for each combination of tasks. Finally, we evaluate the performance of the best-performing model on the test set of each task. Here we have created a total of $21\times (2^{7} - 8) = 2520$ multi-task models for each fine-tuning method.
+
+# E.1.3 TIES-MERGING
+
+The Ties-Merging method, proposed in the paper by Yadav et al. (Yadav et al., 2023), is employed for merging multiple task-specific models into a unified multi-task model. This merging process involves three key steps: trim, elect sign of parameters, and disjoint merge, ultimately resulting in a merged task vector denoted as $\nu$ . Once the final merged task vector $\nu$ is obtained, the selection of the final model parallels the approach used in task arithmetic. For full fine-tuning, the updated parameters are computed as $\theta = \theta_0 + \lambda \nu$ , while for parameter-efficient fine-tuning, the updated parameters are computed as $\phi = \phi_0 + \lambda \nu$ , and the function $f(x)$ is defined as $f_{\theta_0}(x;\phi)$ . As previously mentioned, the hyperparameter $\lambda$ is chosen based on the performance of the model on the validation set.
+
+We sweep the hyperparameters $k$ from the parameter trim step and scaling factor over a range of values $\{0.25, 0.50, 0.75, 1.00\}$ . This results in a total of 16 combinations, whereby each combination is evaluated to determine the best-performing model. Here we have created a total of $4^2 \times (2^7 - 8) = 1920$ multi-task models for each fine-tune method.
+
+# E.1.4 LORAHUB
+
+LoraHub, as introduced by Huang et al. (Huang et al., 2023), is a method specifically designed for applying arithmetic operations to parameter-efficient modules. This technique leverages a set of example inputs from a novel task to estimate the optimal weights $\{w_{i}\}_{i}$ for the parameter-efficient modules. To achieve this, LoraHub utilizes a black-box optimization technique, such as the one described in the works of Liu et al. (Liu et al., 2020) and Sun et al. (Sun et al., 2022). The optimization process aims to minimize the objective function $\mathcal{L} + \alpha \sum_{i}|w_{i}|$ , where $\alpha$ is a hyperparameter.
+
+The final model obtained through LoraHub is defined as $f(x) = f_{\theta_0}(x;\phi)$ , where $\phi = \sum_i w_i \phi_i$ subject to the constraint $\sum_i \alpha_i = 1$ . In practical implementations, the final model is constructed using task vector arithmetic. This is possible due to the relationship $\nu = \phi - \phi_0 = (\sum_i w_i \phi_i) - \phi_0 = \sum_i w_i \nu_i$ , which allows us to express $\phi$ as $\phi = \phi_0 + \sum_i w_i \nu_i$ .
+
+We adapt the original implementation form (Huang et al., 2023) and fix the hyperparameter $\alpha$ at 0.05. The maximum inference step for the gradient-free optimization algorithm Shiwa is 40, which results in up to $40 \times (2^{7} - 8) = 4800$ multi-task models for each fine-tune method.
+
+Table 5: Normalized scores of seven-task model fusion (CLIP-ViT-B/16) across individual datasets.
+
+
Method
Cars
DTD
EuroSAT
GTSRB
RESISC45
SUN397
SVHN
Mean
Simple Average
FFT
0.77
0.62
0.76
0.49
0.71
0.87
0.56
0.68
LoRA
0.81
0.69
0.39
0.40
0.62
0.93
0.16
0.57
L-LoRA
0.87
0.86
0.41
0.58
0.74
0.97
0.19
0.66
Task Arithmetic
FFT
0.80
0.63
0.87
0.73
0.78
0.86
0.85
0.79
LoRA
0.86
0.72
0.51
0.50
0.73
0.91
0.48
0.67
L-LoRA
0.95
0.91
0.65
0.74
0.86
0.96
0.78
0.84
Ties-Merging
FFT
0.78
0.65
0.92
0.69
0.83
0.88
0.93
0.81
LoRA
0.81
0.74
0.54
0.50
0.71
0.92
0.40
0.66
L-LoRA
0.89
0.91
0.60
0.69
0.82
0.97
0.51
0.77
LoraHub
FFT
0.93
0.90
0.32
0.30
0.47
0.77
0.13
0.55
LoRA
0.83
0.68
0.38
0.76
0.70
0.86
0.64
0.69
L-LoRA
0.94
0.88
0.73
0.85
0.85
0.91
0.80
0.85
+
+# E.2 EXPERIMENTAL RESULTS VISUALIZATION AND DISCUSSIONS
+
+We fine-tune all models with hyperparameter settings as shown in Table 2. We construct multi-task models by utilizing task vectors specific to individual tasks, employing various model fusion algorithms. Due to the extensive volume of data and multitude of models in the validation set of downstream NLP tasks, feasibility constraints led us to run only the first 50 batches for each NLP task. This approach allowed us to manage computational resources while still obtaining a representative evaluation within practical limits.
+
+In Figures 10 and 11, we examine four different model fusion techniques - simple averaging, task arithmetic, ties merging, and LoraHub - for constructing multi-task models using an increasing number of task vectors on both vision and language domains.
+
+Simple averaging doesn't account for the relationships or interactions between different tasks. As more tasks are combined, destructive interference may occur between incompatible task vectors. This indicates that simply averaging task vectors is insufficient for effectively combining knowledge across many NLP tasks. In contrast, the other three fusion methods demonstrate steady gains or maintain average multi-task model performance as the number of task vectors increases.
+
+For image classification tasks, ties-merging exhibits the strongest overall performance, with the highest average normalized scores across different numbers of task vectors. This may be because ties-merging introduces several innovations to address the challenges of parameter interference during model merging. The higher degree of interference between vision tasks, evident in the cosine similarity matrix in Figures 2 and 8, increases the importance of these techniques.
+
+In contrast, for NLP tasks, LoraHub demonstrates the strongest performance with the highest average normalized scores. The learned routing between shared fixed parameters and task-specific adapters enables more effective fusion for language tasks.
+
+In Table 5, we present the normalized scores of seven-task model fusion (CLIP-ViT-B/16) across individual datasets. We observe that L-LoRA outperforms LoRA and FFT in most cases. This is because L-LoRA fine-tuning is able to better disentangle the task-specific knowledge from the shared knowledge. Besides, different fusion techniques can be more aligned with certain parameter-efficient methods, leading to substantial performance divergence depending on the chosen approach.
+
+Another key observation from Figures 11 is that LoRA performs better than L-LoRA when the number of task vectors being fused is small. As the number of task vectors increases, the average
+
+
+
+
+(a) CLIP-ViT-B-16 model on image classification tasks.
+(b) Flan-T5-Base model on NLP tasks.
+Figure 9: Multi-task model fusion: we construct multi-task models by utilizing task vectors specific to individual tasks, employing various model fusion algorithms. In the evaluation, the x-axis represents the number of task vectors used in building the multi-task model, while the y-axis represents the average (normalized) scores of the multi-task models across all seven downstream tasks. The line on the plot represents the average (normalized) scores of all multi-task models when considering a fixed number of tasks, while the shaded area corresponds to the standard deviation. The y-axis ticks are shared across these plots. A more detailed comparison between LoRA and L-LoRA is shown in Figures 10 and 11.
+
+
+
+
+
+
+
+
+(a) Simple Average
+
+
+(b) Task Arithmetic
+
+
+
+
+
+
+
+
+
+
+
+
+(c) Ties-Merging
+(d) LoraHub
+
+
+Figure 10: LoRA vs L-LoRA (CLIP-ViT-B-16 model on vision tasks). We construct multi-task models by utilizing task vectors specific to individual tasks, employing various model fusion algorithms. In the evaluation, the x-axis represents the number of task vectors used in building the multi-task model, while the y-axis represents the average score of the multi-task model across the seven GLUE tasks. Each point on the plot corresponds to the average score of a specific multi-task model, and the line represents the average score of all multi-task models considering a fixed number of tasks.
+
+
+
+
+
+
+
+
+
+
+(a) Simple Average
+
+
+
+
+(b) Task Arithmetic
+
+
+
+
+
+
+
+
+(c) Ties-Merging
+(d) LoraHub
+
+
+Figure 11: LoRA vs L-LoRA (Flan-T5-Base model on NLP tasks). We construct multi-task models by utilizing task vectors specific to individual tasks, employing various model fusion algorithms. In the evaluation, the x-axis represents the number of task vectors used in building the multi-task model, while the y-axis represents the average score of the multi-task model across the seven GLUE tasks. Each point on the plot corresponds to the average score of a specific multi-task model, and the line represents the average score of all multi-task models considering a fixed number of tasks.
+
+performance of L-LoRA becomes better than that of LoRA. It becomes evident that LoRA excels in fusing a smaller number of tasks or leveraging its effectiveness through simple averaging. On the other hand, L-LoRA shows an enhanced ability to exploit interactions within a larger set of tasks. This is because the linearization of PEFT modules in L-LoRA is fine-tuned in tangent space, which is a linear space, while the PEFT modules in LoRA are fine-tuned in the original non-linear ambient space. The non-linear space fine-tuning results in a superior performance of the single-task model, which is also known as the non-linear advantage (Guillermo Ortiz-Jimenez et al., 2023). However, as the number of tasks increases, L-LoRA becomes more effective than LoRA. This suggests that the learned linear combination of task vectors used in L-LoRA is able to leverage interactions between a larger number of tasks more effectively, and L-LoRA is better able to scale to handle multi-task model fusion across a large number of tasks.
+
+# F IMPLEMENTATION DETAILS
+
+Here, we provide more details about the implementation of our method, including some basic code.
+
+# F.1 PREPROCESSED EXAMPLES
+
+In this subsection, we provide some examples of the preprocessed data for the downstream tasks. We use the same preprocessing steps as described in (Raffel et al., 2020).
+
+# F.1.1 CoLA
+
+We assign label 0 as "unacceptable" and label 1 as "acceptable".
+
+Original inputs:
+
+- sentence: Our friends won't buy this analysis, let alone the next one we propose.
+- label: 1
+
+Preprocessed:
+
+- input: cola sentence: Our friends won't buy this analysis, let alone the next one we propose.
+- target: acceptable
+
+# F.1.2 MNLI
+
+We assign label 0 as "entailment", label 1 as "neutral" and label 2 as "contradiction".
+
+Original inputs:
+
+- hypothesis: Product and geography are what make cream skimming work.
+- premise: Conceptually cream skimming has two basic dimensions - product and geography.
+- label: 1
+
+Preprocessed:
+
+- input: mnli hypothesis: Product and geography are what make cream skimming work. premise: Conceptually cream skimming has two basic dimensions - product and geography.
+- target: neutral
+
+# F.1.3 MRPC
+
+We assign label 0 as "not_quivalent" and label 1 as "equivalent".
+
+Original inputs:
+
+- sentence1: Amrozi accused his brother, whom he called "the witness", of deliberately distorting his evidence.
+- sentence2: Referring to him as only "the witness", Amrozi accused his brother of deliberately distorting his evidence.
+- label: 1
+
+# Preprocessed:
+
+- input: mrpc sentence1: Amrozi accused his brother, whom he called "the witness", of deliberately distorting his evidence. sentence2: Referring to him as only "the witness", Amrozi accused his brother of deliberately distorting his evidence.
+- output: equivalent
+
+# F.1.4 QQP
+
+We assign label 0 as "notDuplicate" and label 1 as "duplicate".
+
+Original inputs:
+
+- question1: How is the life of a math student? Could you describe your own experiences?
+- question2: Which level of preparation is enough for the exam jlpt5?
+- label: 0
+
+# Preprocessed:
+
+- input: qqp question1: How is the life of a math student? Could you describe your own experiences? question2: Which level of preparation is enough for the exam jlpt5?
+- output: not Duplicate
+
+# F.1.5 RTE
+
+We assign label 0 as "entailment" and label 1 as "not_entiailment".
+
+Original inputs:
+
+- sentence1: No Weapons of Mass Destruction Found in Iraq Yet.
+- sentence2: Weapons of Mass Destruction Found in Iraq.
+- label: 1
+
+Preprocessed:
+
+- input: rte sentence1: No Weapons of Mass Destruction Found in Iraq Yet. sentence2: Weapons of Mass Destruction Found in Iraq.
+- output: not_entailment
+
+# F.1.6 SST2
+
+We assign label 0 as "negative" and label 1 as "positive".
+
+Original inputs:
+
+- sentence: hide new secretions from the parental units
+- label: 0
+
+Preprocessed:
+
+- input: sst2 sentence: hide new secretions from the parental units
+- output: negative
+
+# F.1.7 STSB
+
+We format the 'label' argument as a string with one decimal place, the corresponding Python code is x"{':.1f'}".format (label)'.
+
+Original inputs:
+
+- sentence1: A plane is taking off.
+- sentence2: An air plane is taking off.
+- label: 5
+
+Preprocessed:
+
+- input: stsb sentence1: A plane is taking off. sentence2: An air plane is taking off.
+output: 5.0
+
+# F.2 DISCUSSION ON THE CHOICE OF PROMPTTEMPLATES
+
+Table 6: Comparison of the templates used in our experiments and a better version of prompt templates.
+
+
Task
Prompt Templates
input text
target text
CoLA
Templates in Appendix F.1
“cola sentence: {sentence}”
“unacceptable” if label=0 else “acceptable”
Improved Prompt Templates
“Indicate if the following sentence is grammatically correct or not: ‘{sentence}’. Answer ‘acceptable’ or ‘unacceptable’.”
“entailment”, “neutral”, “contradiction” if label is 0, 1,2, respectively
Improved Prompt Templates
“Does the premise: ‘{premise}’, logically imply, contradict, or is neutral to the hypothesis: ‘{hypothesis}’? Answer with ‘entailment’, ‘contradiction’, or ‘neutral’.”
“entailment”, “neutral”, “contradiction” if label is 0, 1,2, respectively
“Does the text: ‘{sentence1}’ entail that ‘{sentence2}’ is true? Provide ‘yes’ or ‘no’.”
“yes” if label=0, else “no”
+
+To optimize the model's output, providing more explicit cues within the input is essential. An illustrative prompt, such as "sentence. Is this sentence 'positive' or 'negative'? as suggested in Appendix F.1.6, signals clearly to the language model that the desired response should be categorized as either 'positive' or 'negative', potentially leading to improved accuracy.
+
+To validate this approach, we conducted a set of focused multi-task model fusion experiments targeting three downstream tasks: CoLA, MNLI, and RTE. Across all fine-tuning processes, we employed the Adam optimizer, standardized the batch size to 16, and set the number of fine-tuning steps to 2000 for all models. While the learning rate was configured to 1e-5 for full fine-tuning, for both LoRA and L-LoRA, we increased the learning rate to 4e-5.
+
+Table 6 provides a comparison between the original prompt templates and an enhanced version. Table 7 outlines the individual performance of fine-tuned models using different prompt templates.
+
+Table 7: individual performance of fine-tuned models with different prompt templates
+
+
Fine-tuning Method
CoLA
MNLI
RTE
Mean
Prompt Templates in Appendix F.1
full fine-tuning
0.75
0.82
0.85
0.81
LoRA fine-tuning
0.69
0.76
0.83
0.76
L-LoRA fine-tuning
0.69
0.46
0.75
0.63
Better Prompt Templates
full fine-tuning
0.75
0.83(+1%)
0.86(+1%)
0.81
LoRA fine-tuning
0.69
0.83(+9%)
0.84(+11%)
0.79(+4%)
L-LoRA fine-tuning
0.69
0.82(+78%)
0.81(+29%)
0.77(+22%)
+
+Table 8: Three-model fusion using simple model averaging, we evaluate 'exact-match' accuracy on validation datasets. These results show that a better and more predictable prompt yields superior results, with L-LoRA outperforming LoRA in terms of both absolute scores and normalized scores.
+
+
Method
Prompt Templates in Appendix F.1
Improved Prompt Templates
CoLA
MNLI
RTE
Mean
CoLA
MNLI
RTE
MEAN
Absolute Score
FFT
0.67
0.37
0.54
0.53
0.70
0.78
0.82
0.76
LoRA
0.35
0.00
0.42
0.25
0.69
0.63
0.82
0.71
L-LoRA
0.35
0.00
0.23
0.20
0.69
0.73
0.81
0.74
Normalized Score
FFT
0.90
0.45
0.63
0.66
0.93
0.94
0.95
0.94
LoRA
0.50
0.00
0.50
0.34
1.00
0.76
0.98
0.91
L-LoRA
0.51
0.00
0.31
0.28
1.00
0.89
1.00
0.96
+
+In Table 8, we evaluate 'exact-match' accuracy on validation datasets through a simple model averaging technique for three-model fusion. Our results indicate that a more effective and predictable prompt yields superior performance, with L-LoRA outperforming LoRA in terms of both absolute scores and normalized scores. In the "Absolute Score" section, the full fine-tuning (FFT) method appears to show the highest scores with both sets of prompt templates, indicating superior performance in both original and improved settings. However, L-LoRA shows an increase in performance with the improved prompts compared to the original prompts, particularly in the MNLI and RTE columns and subsequently in the MEAN column. The "Normalized Score" section provides a relative comparison of each method's performance. In this section, it suggests that despite FFT showing high performance in absolute terms, L-LoRA demonstrates increased normalized scores with better prompt templates, indicating greater effectiveness on weight disentanglement when adjusted to more appropriate prompting.
+
+This experiment demonstrates that the choice of prompt templates can impact the performance of these model fusion methods. It illustrates how a more effective prompting strategy, especially one that is better aligned with the model and task at hand, can lead to significant improvements in performance. Besides, the highest normalized scores with these better prompt templates are achieved by L-LoRA, suggesting that it is the most responsive to prompt optimization among the methods tested.
+
+F.3 MODEL LINEARIZATION
+Listing 1: Pytorch code to linearize a model.
+```python
+class LinearizedModelWrapper(nnModule): def __init__(self, model: nn.Module, init_model: nn.Module = None): "" Initialize a linearized model.
+6 Args: model (nn(Module): The underlying PyTorch model to be linearized. init_model (nn(Module): The initial PyTorch model used to compute the linearization parameters ( default: None).
+9 super(..__init_()
+11 self.model = model
+12 if init_model is None: init_model = model
+13 assert not hasattr(self, "params0")
+15 params0 = deepcopy([k, vdetach]) for k, v in init_modelnamed_parameters])
+16 self.params0_keys = [k for k, v in params0]
+17 self.params0_values = nn.CriteriaList([v for k, v in params0])
+18 for p in self.params0_values: prequires_grad_(False)
+20 def tuple.params_to_dict(self, tuple.params):
+22 Converte a tuple of parameters to a dictionary with keys corresponding to the parameter names.
+24 Args: tuple.params (Tuple[Tensor, ...]): A tuple of parameters.
+27 Returns: Dict[str, Tensor]: A dictionary with keys corresponding to the parameter names and values
+30 corresponding to the parameter values.
+31 ""
+32 assert len(tuple.params) == len(self.params0_keys)
+33 state_dict = {}
+34 for k, p in zip(self.params0_keys, tuple.params): state_dict[k] = p
+35 return state_dict
+37 def forward(self, *args, **kwargs):
+39 ""
+40 Comutes the linearized model output using a first-order Taylor decomposition.
+41 Args: *args: Positional arguments to be passed to the model. \*\*kwargs: Keyword arguments to be passed to the model.
+45 Returns: torch.Tensor: The output of the linearized model, computed using a first-order Taylor decomposition.
+48 ""
+49 params0 = tuple(self.params0_values)
+50 params = dict.params_to_tuple(OrderedDict(self.named_parameters()))
+51 dparams = tuple(p - p0 for p, p0 in zip.params, params0))
+52 out, dp = jvp( lambda *param: functional_call( self.model, self.tuple.params_to_dict(param), args, kwargs) ,
+56 params0,
+57 dparams,
+58 )
+59 return out + dp
+```
+
+The LinearizedModelWrapper class linearizes a given PyTorch model using a first-order Taylor expansion. The linearized model is computed using the forward method, which takes positional and keyword arguments and returns the output of the linearized model. The tuple.params_to_dict method converts a tuple of parameters to a dictionary with keys corresponding to the parameter names.
+
+With the help of LinearizedModelWrapper class, we can linearize the LoRA modules in a pre-trained language model, as the following code snippet shows:
+
+```txt
+def __get_submodules(model: nnModule, key):
+ __m
+Retrieves the parent module, target module, and target module name for a given key in a PyTorch model.
+Args:
+ model (nnModule): The PyTorch model to retrieve submodules from.
+ key (str): The key representing the submodule to retrieve.
+Returns:
+ Tuple[nnModule, nnModule, str]: A tuple containing the parent module, target module, and target module name.
+```
+
+Listing 2: Linearize all the LoRA modules in a LLM
+```python
+parent $=$ model.get_submodule("".join(key.split("\\.")[: -1])
+target_name $\equiv$ key.split("\\.")[-1]
+target $=$ model.get_submodule(key)
+return parent, target, target_name
+def linearize_lora_model(model: nnModule):
+"Linearizes the LoraLayer modules in a PyTorch model..
+Args: model (nnModule): The PyTorch model to be linearized.
+Returns: nnModule: The linearized PyTorch model.
+"" for key, module in model.named Modules(): if isinstance/module,LoraLayer) and isinstance/module, nn.Linear): log.debug(f"convert {key} to linearized lora layer") parent, target, target_name $=$ _get_submodules(model, key) setattr(parent, target_name, LinearizedModelWrapper(target)) return model
+```
+
+Where the _get_submodules function takes a PyTorch model and a key representing a submodule in the model and returns a tuple containing the parent module, the target module, and the target module name. The parent module is the module that contains the target module.
+
+The linearize_lora_model function takes a PyTorch model and linearizes all LoraLayer modules in the model. If a LoraLayer module is also an instance of nn.Linear, it is converted to a LinearizedModelWrapper object. The function returns the linearized PyTorch model.
\ No newline at end of file
diff --git a/parameterefficientmultitaskmodelfusionwithpartiallinearization/images.zip b/parameterefficientmultitaskmodelfusionwithpartiallinearization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f735a16ea52810da0f0552f3a63701c8b0129267
--- /dev/null
+++ b/parameterefficientmultitaskmodelfusionwithpartiallinearization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a7fc4e696ffa3a720eef6f77aa9cb08c98e4995841c04572ed707e0c8d2a3a81
+size 1461399
diff --git a/parameterefficientmultitaskmodelfusionwithpartiallinearization/layout.json b/parameterefficientmultitaskmodelfusionwithpartiallinearization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..469abb34ac3d1aa8cdd6e471c2c0d5681376953a
--- /dev/null
+++ b/parameterefficientmultitaskmodelfusionwithpartiallinearization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:59c898fe72a38c6563069d249333064ce61bf3a2de79463dab4f8a8f52940779
+size 931900
diff --git a/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_content_list.json b/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1df572080ed213e98eb2272ec3c864bf88090702
--- /dev/null
+++ b/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b725faf444a6c2f7088dddacaef79d601a0f1b40a39d5787a415cf8628cfc29
+size 235458
diff --git a/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_model.json b/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e45de0dd09643e8d256374bfe703507134d5f9dc
--- /dev/null
+++ b/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cd90ef2852d6323530a57288cd6e860ed6f48fba8645b94920e214028a03800b
+size 293945
diff --git a/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_origin.pdf b/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c19c04d1c97ee540fa9f5f5185cc71a4c48992e6
--- /dev/null
+++ b/parameterefficientorthogonalfinetuningviabutterflyfactorization/ee772309-1e4b-4e82-87cf-4ea3ce02d87b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b2f1f7b4dd9c0316836340b3313d8ffe2f1b9b6febec3bb7b62fe2b4b1c1254
+size 11555034
diff --git a/parameterefficientorthogonalfinetuningviabutterflyfactorization/full.md b/parameterefficientorthogonalfinetuningviabutterflyfactorization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..5c9a303bd72cc489fa0847b31af9bb49b5e0c04e
--- /dev/null
+++ b/parameterefficientorthogonalfinetuningviabutterflyfactorization/full.md
@@ -0,0 +1,1157 @@
+# PARAMETER-EFFICIENT ORTHOGONAL FINETUNING VIA BUTTERFLY FACTORIZATION
+
+Weiyang Liu $^{1,2,*}$ Zeju Qiu $^{1,*}$ Yao Feng $^{1,3,\dagger}$ Yuliang Xiu $^{1,\dagger}$ Yuxuan Xue $^{4,\dagger}$ Longhui Yu $^{2,\dagger}$ Haiwen Feng $^{1}$
+Zhen Liu $^{5}$ Juyeon Heo $^{2}$ Songyou Peng $^{1,3}$ Yandong Wen $^{1}$ Michael J. Black $^{1}$ Adrian Weller $^{2,6}$ Bernhard Scholkopf $^{1}$ $^{1}$ Max Planck Institute for Intelligent Systems - Tübingen $^{2}$ University of Cambridge $^{3}$ ETH Zürich
+ $^{4}$ University of Tübingen $^{5}$ Mila, Université de Montréal $^{6}$ The Alan Turing Institute boft.wyliu.com
+
+# ABSTRACT
+
+Large foundation models are becoming ubiquitous, but training them from scratch is prohibitively expensive. Thus, efficiently adapting these powerful models to downstream tasks is increasingly important. In this paper, we study a principled finetuning paradigm – Orthogonal Finetuning (OFT) – for downstream task adaptation. Despite demonstrating good generalizability, OFT still uses a fairly large number of trainable parameters due to the high dimensionality of orthogonal matrices. To address this, we start by examining OFT from an information transmission perspective, and then identify a few key desiderata that enable better parameter-efficiency. Inspired by how the Cooley-Tukey fast Fourier transform algorithm enables efficient information transmission, we propose an efficient orthogonal parameterization using butterfly structures. We apply this parameterization to OFT, creating a novel parameter-efficient finetuning method, called Orthogonal Butterfly (BOFT). By subsuming OFT as a special case, BOFT introduces a generalized orthogonal finetuning framework. Finally, we conduct an extensive empirical study of adapting large vision transformers, large language models, and text-to-image diffusion models to various downstream tasks in vision and language.
+
+# 1 INTRODUCTION
+
+Recent models such as ChatGPT [4, 9] and Stable Diffusion [73], demonstrate the remarkable generalization ability of large foundation models. The rapid increase in the performance of such models is paired with a dramatic increase in the number of parameters (e.g., GPT-3 has around 175B parameters). As a result, it has become increasingly challenging for researchers to train a foundation model from scratch. Broad progress in the field therefore requires the ability to adapt such models without retraining them from scratch. That is, we must be able to efficiently adapt existing foundation models to downstream tasks. There are primarily three ways to perform efficient task adaptation: model finetuning [6, 23, 29, 67, 69, 92, 97], where the model architecture remains unchanged and a subset of the model parameters gets finetuned; adapter tuning [24, 28, 48, 65, 71], where additional trainable parameters are added to the original model; and prompt tuning [39, 42], where additional trainable prefix tokens are attached to the input. Among these methods, model finetuning distinguishes itself as a simple yet powerful approach, and more importantly, introduces no inference latency.
+
+The fundamental principle behind model finetuning is to ensure that the pretrained model and the finetuned model are similar based on certain measurements, such that the pretraining knowledge is preserved. For instance, current model finetuning methods often adopt a small learning rate. This ad hoc approach encourages a small discrepancy between the pretrained and the finetuned model. Given the structured nature of weight matrices, a more principled approach tries to preserve the relational information of the weight matrices, i.e. the pairwise angles between neurons. This insight leads to a novel model finetuning framework, known as Orthogonal Finetuning (OFT) [67], where neurons in the same layer are transformed by the same orthogonal matrix such that pairwise angles between neurons are provably preserved throughout the finetuning process. Although OFT has demonstrated promising generalizability and convergence for finetuning text-to-image diffusion models [67], the number of trainable parameters in OFT can be quite large due to the high dimensionality of orthogonal matrices. To address this, OFT introduces a block-diagonal structure to reduce the number of parameters. However, the parameter efficiency also comes at a price - the orthogonal matrix has a fixed sparsity pattern and the orthogonal transformation is applied independently in different blocks. This block-
+
+diagonal sparsity pattern, despite saving parameters, may introduce some undesirable inductive biases (e.g., the block-diagonal orthogonal matrix reduces expressiveness and cannot approximate classic linear transforms), and more importantly, how to find a good sparsity pattern remains a mystery.
+
+The key to addressing this problem is to generate a dense orthogonal matrix, while still being parameter-efficient. While this may seem infeasible at first glance since a $d$ -dimensional dense orthogonal matrix requires $\mathcal{O}(d^2)$ parameters, we take a novel route to compose a dense orthogonal matrix with multiple factorized sparse matrices. This approach is guided by the insight that the number of trainable parameters can be reduced by trading computation time for space. Since we represent the orthogonal matrix with the multiplication of sparse matrices, the multiplication has to be performed repeatedly in each training iteration. To put the matrix factorization into perspective, we interpret the generation of a dense orthogonal matrix as an information transmission problem. Under this problem formulation, generating a dense orthogonal matrix by multiplying sparse matrices can be understood as transmitting information on a grid-structured graph. This information transmission framework enables us to design many possible ways to perform sparse matrix factorization that limit the number of trainable parameters while still being expressive enough to generate dense matrices.
+
+To achieve parameter efficiency in our information transmission framework, we draw inspiration from the butterfly structures in the Cooley-Tukey fast Fourier transform algorithm [12] in which information from different nodes can be exchanged efficiently [36]. Specifically, the butterfly graph in the Cooley-Tukey algorithm inherently induces a way to perform sparse matrix factorization, called butterfly factorization. With butterfly factorization, we are able to generate a $d$ -dimensional dense matrix with a product of $\mathcal{O}(\log d)$ sparse matrices, each with $\mathcal{O}(d)$ non-zero entries. By ensuring that each sparse matrix is orthogonal, we arrive at an efficient orthogonal parameterization with only $\mathcal{O}(d\log d)$ parameters, which is a significant reduction from the original parameterization. By leveraging such an efficient orthogonal parameterization, we propose a novel parameter-efficient finetuning method - Orthogonal Butterfly (BOFT). BOFT subsumes OFT as a special case and provides a general orthogonal finetuning framework. There is a shared characteristic for the block-diagonal structure and the butterfly structure - sparsity. Both structures introduce data sparsity into orthogonal matrices to reduce the effective number of trainable parameters. It is interesting to contrast our approach with the low-rank structure in LoRA [29]; both low-rank matrices and sparse matrices are major families of structured matrices [5] that achieve parameter efficiency.
+
+Compared to the block-diagonal structure that OFT uses to trade off expressivity and regularity, BOFT uses the butterfly structure to construct a smoother interpolation between matrices from the full orthogonal group (expressivity) and identity matrices (regularity). This enables us to find a smaller hypothesis class within the orthogonal group for downstream tasks. Given the widespread use of the butterfly structure in many fast linear transforms, such as the discrete Fourier and discrete cosine transforms, we argue that our structured approach to parameter efficiency will introduce an implicit inductive bias that benefits generalizability and prevents overfitting. Our intuition comes from the property that the butterfly structure can easily recover many classic linear transforms while it is impossible for the block-diagonal structure in OFT to recover any. Our contributions are listed below:
+
+- We study the problem of parameter efficiency in orthogonal finetuning with a novel information transmission framework. This framework transforms the task of crafting a parameter-efficient dense orthogonal matrix into an information transmission problem within a grid-structured graph.
+- Inspired by the butterfly structures in the Cooley-Tukey algorithm, we propose Orthogonal Butterfly, a parameter-efficient orthogonal finetuning method, within the information transmission framework.
+- We provide a few theoretical insights for why BOFT is able to significantly reduce the number of trainable parameters while still yielding a good expressivity and training stability. Thanks to the matrix factorization, BOFT also comes with an intriguing weight interpolation (see Figure 10).
+- For the very first time, we apply orthogonal finetuning to various tasks beyond controllable text-to-image generation [67], showing its great potential as a generic model finetuning method. To this end, we apply BOFT to a number of adaptation applications ranging from computer vision to natural language processing. BOFT outperforms current state-of-the-art methods by a considerable margin, validating its superior parameter-efficiency and generalization ability.
+
+# 2 RELATED WORK
+
+Parameter-efficient finetuning (PEFT). As foundation models (e.g., [4, 35, 68, 73]) become increasingly large and powerful, finetuning these models for downstream tasks in a parameter-efficient
+
+way has sparked considerable interest [18, 45, 82]. Among many PEFT methods [1, 3, 8, 10, 19, 21, 23, 24, 28-31, 33, 39, 42, 46, 49, 54, 56, 78, 79, 86, 88, 92, 98], reparameterization-based methods [1, 19, 29] are the most relevant to our work. LoRA [29] updates the pretrained weight matrix by adding a product of two low-rank matrices, achieving promising performance on natural language tasks. Since the rank of all added matrices is set to a constant in LoRA, several methods [84, 95, 97] dynamically adjust the rank for different layers such that the parameter budget is adequately allocated. Due to its simplicity, such a low-rank weight reparameterization has gained great popularity [6, 16, 102]. Inspired by how hyperspherical energy characterizes generalization [50, 52], [67] proposes orthogonal finetuning, an alternative yet effective method to finetune text-to-image diffusion models. Specifically, OFT learns an orthogonal matrix to transform the neurons of the same layer, and it achieves stronger generalization and consistently more stable training than LoRA. Despite strong performance, OFT generally has more trainable parameters than LoRA. Therefore, making OFT more parameter-efficient is a useful goal. Moreover, whether OFT is applicable to a wider spectrum of adaptation tasks (beyond controlling text-to-image diffusion models [67]) is unknown. BOFT improves the parameter efficiency of OFT via butterfly factorization. Thanks to this, we are now able to demonstrate the power of orthogonal finetuning in general adaptation tasks.
+
+Butterfly structures. The radix-2 Cooley-Tukey algorithm recursively reduces the $N$ -point discrete Fourier transform to two $\frac{N}{2}$ -point discrete Fourier transforms, and this process induces a butterfly structure that can be written as a product of multiple sparse matrices (the product is also called a butterfly matrix). Butterfly matrices have already been used to parameterize orthogonal matrices to avoid pivoting in Gaussian elimination and improve efficiency [63], to stabilize the training of recurrent neural networks [32] and in kernel approximation [60]. [13, 14] learn fast linear transforms with butterfly parameterizations. [7, 15] utilize butterfly matrices to enable the efficient training of neural networks. Butterfly structures are also found useful in fast matrix-vector multiplication [57, 61], data-sparse matrix approximation [43], and network transmission [36, 40, 70]. In contrast to previous work, we focus on harnessing butterfly structures to enhance the parameter efficiency of OFT.
+
+# 3 AN INFORMATION TRANSMISSION VIEW ON ORTHOGONAL FINETUNING
+
+We start with some preliminaries of OFT. To finetune the pretrained weight matrix, OFT reparameterizes the new weight matrix as the product of a learnable orthogonal matrix and the frozen pretrained weight matrix. Compared to LoRA
+
+
+(a) Low-rank Structure in LoRA
+
+
+(b) Orthogonal Structure in OFT
+Figure 1: A comparison of reparameterization between LoRA and OFT.
+
+which updates the weights with an additive low-rank matrix, OFT uses a multiplicative orthogonal matrix to update the weights. To achieve parameter-efficiency, LoRA uses a low-rank structure, and in contrast, the original OFT uses a block-diagonal orthogonal structure [67] (the smaller the size of diagonal blocks is, the more parameter-efficient OFT is). An intuitive comparison is given in Figure 1. The motivation for applying orthogonal transformation to finetune the weight matrix is to preserve the pair-wise angles of neurons [50, 52, 67], such that the semantic knowledge from pretraining can be largely preserved. Concretely, OFT optimizes an orthogonal matrix $\pmb{R} \in \mathbb{R}^{d \times d}$ for a pretrained linear layer $W^0 \in \mathbb{R}^{d \times n}$ , and modifies the forward pass from $\pmb{z} = (W^0)^\top \pmb{x}$ to $\pmb{z} = (RW^0)^\top \pmb{x}$ , where $\pmb{x} \in \mathbb{R}^d$ and $\pmb{z} \in \mathbb{R}^n$ are the input and output vector, respectively. To achieve zero initialization, OFT initializes $\pmb{R}$ as an identity matrix. To ensure the orthogonality of $\pmb{R}$ throughout the finetuning process, we follow [52, 67] to employ Cayley parameterization, i.e., $\pmb{R} = (\pmb{I} + \pmb{Q})(\pmb{I} - \pmb{Q})^{-1}$ where $\pmb{Q}$ is a skew-symmetric matrix with $\pmb{Q} = -\pmb{Q}^\top$ . For parameter-efficiency, the block-diagonal structure is introduced by parameterizing the orthogonal matrix $\pmb{R}$ as $\mathrm{diag}(R_1, R_2, \dots, R_r)$ where $R_i \in \mathcal{R}^{b \times b}, \forall i$ is a small orthogonal matrix and $br = d$ . The parameter-efficiency brought by the block-diagonal structure comes at a price - it introduces an assumption that the dimensions of a neuron (i.e., a column vector of the weight matrix $W^0$ ) are divided by $r$ groups and dimensions in different groups are transformed separately using different orthogonal matrices. Despite the empirical effectiveness of the block-diagonal structure, it makes no sense to divide the dimensions of a neuron into $r$ groups based on their indices, which makes dense orthogonal matrices desirable. A natural question arises: Can we construct a dense orthogonal matrix without losing the parameter-efficiency?
+
+To address this question, we propose to compose a dense orthogonal matrix with a product of multiple sparse orthogonal matrices. To provide a unified yet intuitive perspective to study the sparsity pattern
+
+of orthogonal matrix factorization, we frame the problem of generating a dense orthogonal matrix in OFT as an information transmission problem. Specifically, generating a dense matrix $\mathbf{R} \in \mathbb{R}^{d \times d}$ by a product of $m$ square matrices $\mathbf{R} = \mathbf{B}_m \mathbf{B}_{m-1} \cdots \mathbf{B}_1$ can be viewed as transmitting information in a grid with $d \times (m+1)$ nodes, as illustrated in Figure 2. The motivation behind the information transmission view comes from the observation that a $d$ -dimensional dense square matrix can be interpreted as a dense connectivity from $d$ nodes to another $d$ nodes. For the matrix $\mathbf{R}$ , if the element $R_{ij}$ is zero, then it indicates that information from the $j$ -th node cannot flow to the $i$ -th node. If $R_{ij}$ is non-zero, then the information can be transmitted. Therefore, representing the dense matrix $\mathbf{R}$ with multiple matrices $B_m B_{m-1} \cdots B_1$ can also be interpreted as perform
+
+
+Figure 2: An illustration of the information transmission view on generating dense matrices. This example uses $d = 4$ and $m = 5$ .
+
+ing sequential information exchange based on the graphs induced by $B_{i}, \forall i$ . The information flows following $B_{1}$ first and $B_{n}$ in the end. As a concrete example in Figure 2, we consider the factorization $R = B_{5}B_{4}B_{3}B_{2}B_{1}$ whose sparsity patterns and induced graph are visualized. The graph in Figure 2 is the result of unrolling the matrix multiplication. In the induced graph, the matrix $B_{i}$ is viewed as the connectivity matrix from the $i$ -th level nodes to the $(i + 1)$ -th level nodes. More specifically, the $(j_{1}, j_{2})$ element of $B_{i}$ denotes whether there is a directed edge from the $j_{2}$ -th node in the $i$ -th level to the $j_{1}$ -th node in the $(i + 1)$ -th level (zero means no edge). For $B_{5}B_{4}B_{3}B_{2}B_{1}$ to be a dense matrix, every node in the first level should be able to transmit information to all the nodes in the 6-th level. If we only consider $R = B_{4}B_{3}B_{2}B_{1}$ which corresponds to the source nodes in the first level and the receiver nodes in 5-th level, then we find that information from the node 1 cannot be transmitted to the node 3. Therefore, the sparsity pattern of $B_{4}B_{3}B_{2}B_{1}$ has a zero element at the $(3, 1)$ position. Considering $R = B_{3}B_{2}B_{1}$ and $R = B_{2}B_{1}$ , the same correspondence holds between the induced graph and the sparsity pattern. Generally, for a matrix $R \in \mathbb{R}^{d \times d}$ to be dense, the $m$ factorization matrices $B_{m}, \dots, B_{1}$ needs to correspond to a set of directed edges on a $d \times (m + 1)$ grid where one directed edge can only connect two nodes between adjacent levels (i.e., columns), such that information from every node in the first level can be transmitted to every node in the $(m + 1)$ -th level.
+
+The information transmission view can help us gain a better understanding of the sparsity pattern of factorization matrices in OFT. Figure 3 visualizes the block-diagonal structure of $\pmb{R}$ in the original OFT. Despite reducing the number of trainable parameters, the block-diagonal structure cannot construct a dense matrix $\pmb{R}$ . Our goal is to compose a dense orthogonal matrix with $m$ sparse orthogonal matrices, using as few effective trainable parameters as possible. Under the information transmission view, the general desiderata
+
+towards our goal are $(i)$ dense connectivity: every node in the first level has at least one path to every node in the last level, and $(ii)$ minimum free edges: the total number of edges should be as small as possible under the orthogonality constraint. We note that orthogonality injects a delicate constraint to the edges between adjacent levels. For example, for each matrix $B_{i}$ to be full-rank (a necessary condition of orthogonality), we need to have $d$ edges to form a bijection between all the nodes in the $i$ -th level and all the nodes in the $(i = 1)$ -th level, which makes the number of edges between adjacent levels at least $d$ (e.g., 4 for the example in Figure 2). These $d$ edges is necessary for orthogonality and should not be counted into the number of edges, because these elements are not trainable (e.g., for a $d \times d$ orthogonal with $d$ non-zero entries, these entries can only be $\pm 1$ ). Because orthogonal matrices require less number of parameters than full matrices, the orthogonality constraint will bring in additional dependency among edges. As an example, for a $2 \times 2$ orthogonal matrix, one zero at the $(1,1)$ position will imply another zero at the $(2,2)$ position (i.e., one missing edge could imply another missing edge). Therefore, for each feasible set of edge connections, the orthogonality may sometimes add or remove some edges. By visualizing the non-zero pattern of the composed orthogonal matrix, the information transmission framework is particularly useful in OFT, because we only care about the non-zero trainable elements of $\mathbf{R}$ and their specific values do not matter.
+
+
+Figure 3: An example of block-diagonal structure in OFT.
+
+A naive dense connection between two levels takes $\mathcal{O}(d^2)$ edges (i.e., a single dense orthogonal matrix), yielding $d^{2} - d$ edges (for $d = 4$ , it is 12 edges). Figure 2 gives an example of a feasible matrix
+
+factorization and it takes 10 edges in total, which is actually less than a single dense orthogonal matrix. This framework enables us to study the parameter-efficiency of OFT from a graphical perspective, and we can easily come up with feasible factorizations with this framework. We draw inspiration from an interesting topology from the Cooley-Tukey algorithm, called butterfly graphs [12], which can densely connect $d$ source nodes and $d$ receiver nodes efficiently with $\mathcal{O}(d\log d)$ edges. For example, the topology in Figure 2 takes 10 edges to achieve dense connectivity, while the butterfly network only takes 8 edges. Next, we introduce how the butterfly structure can improve parameter efficiency.
+
+# 4 ORTHOGONAL PARAMETERIZATION BY BUTTERFLY FACTORIZATION
+
+The butterfly structure is originally used in the Cooley-Tukey algorithm to perform fast Fourier transform. In Fourier transform, a local change in the frequency domain can cause a global change in the spatial domain, which is conceptually similar to our information transmission problem - every node in the first level can transmit information to all the nodes in the last level. The butterfly structure also becomes a popular computer network topology [41, 75] used for efficient information exchange. Assuming that $k \geq 2$ is a power of 2, we start by defining the butterfly factor $B^{F}(k)$ as
+
+$$
+\boldsymbol {B} ^ {F} (k) = \left[ \begin{array}{l l} \operatorname {d i a g} \left(\boldsymbol {d} _ {1}\right) & \operatorname {d i a g} \left(\boldsymbol {d} _ {2}\right) \\ \operatorname {d i a g} \left(\boldsymbol {d} _ {3}\right) & \operatorname {d i a g} \left(\boldsymbol {d} _ {4}\right) \end{array} \right] \in \mathbb {R} ^ {k \times k}, \tag {1}
+$$
+
+where $\pmb{d}_i \in \mathbb{R}^{\frac{k}{2}}$ , $\forall i$ are some vectors. With $d = 2^{N}$ , we then define the $d$ -dimensional butterfly matrix $B(d) \in \mathbb{R}^{d \times d}$ recursively as
+
+$$
+\boldsymbol {B} (d) = \tilde {\boldsymbol {B}} (d, d) \cdot \left[ \begin{array}{c c} \boldsymbol {B} _ {1} (\frac {d}{2}) & \boldsymbol {0} \\ \boldsymbol {0} & \boldsymbol {B} _ {2} (\frac {d}{2}) \end{array} \right] = \tilde {\boldsymbol {B}} (d, d) \tilde {\boldsymbol {B}} (d, \frac {d}{2}) \dots \tilde {\boldsymbol {B}} (d, 2), \tag {2}
+$$
+
+where $B_{1}\left(\frac{d}{2}\right)$ and $B_{2}\left(\frac{d}{2}\right)$ are two $\frac{d}{2}$ -dimensional butterfly matrices.
+
+We then define the butterfly component as $\tilde{B}(d,k) = \mathrm{diag}(B_1^F(k),\dots,B_{d/k}^F(k))$ that is a block-diagonal matrix of size $d\times d$ with the block size $k$ , where $B_i^F(k),\forall i$ are butterfly factors defined in Equation 1. Now we are ready to use the butterfly matrix to parameterize an orthogonal matrix. To achieve this, we only need to ensure that all multiplicative factors $\tilde{B}(d,k),\forall k$ in the butterfly matrix $B(d)$ are orthogonal. We first look into the block-diagonal matrix $\tilde{B}(d,2)$ with the block size 2, and we can easily guarantee $\tilde{B}(d,2)$ to be orthogonal with Cayley transform (or 2-dimensional rotation) to parameterize each block, same as [52, 67]. The non-zero pattern of every butterfly component can be viewed as a permutation of the non-zero pattern of $\tilde{B}(d,2)$ , so all the butterfly components can be easily parameterized as orthogonal matrices. This gives us an efficient parameterization of orthogonal matrices built upon many $2\times 2$ orthogonal matrices. We generalize the butterfly matrices following [7], and define a block butterfly component $\tilde{B}^b(d,k)$ where each entry in $d_i,\forall i$ becomes a $b\times b$ matrix. To guarantee the block butterfly component $\tilde{B}^b(d,2)$ to be orthogonal, we parameterize each $2b\times 2b$ block matrix to be orthogonal. The non-zero pattern of the other butterfly components $\tilde{B}^b(d,k),k > 2$ are the block-wise permutation of the non-zero pattern of $\tilde{B}^b(d,2)$ and therefore can be similarly turned into orthogonal matrices. Combining pieces, the forward pass in BOFT is
+
+$$
+\boldsymbol {z} = \left(\boldsymbol {R} (m, b) \cdot \boldsymbol {W} ^ {0}\right) ^ {\top} \boldsymbol {x}, \quad \text {s . t .} \left\{\boldsymbol {R} (m, b) = \prod_ {i = 1} ^ {m} \tilde {\boldsymbol {B}} _ {(d, i)} ^ {b} \& \underbrace {\left(\tilde {\boldsymbol {B}} _ {(d , j)} ^ {b}\right) ^ {\top} \tilde {\boldsymbol {B}} _ {(d , j)} ^ {b}} _ {\forall j \in [ 1, m ]} = \tilde {\boldsymbol {B}} _ {(d, j)} ^ {b} \left(\tilde {\boldsymbol {B}} _ {(d, j)} ^ {b}\right) ^ {\top} = \boldsymbol {I} _ {d} \right\},
+$$
+
+where we denote $\tilde{B}^b (d,2^{m - i + 1})$ as $\tilde{B}_{(d,i)}^b$ for simplicity, and $I_{d}$ is an identity matrix of size $d$ . The orthogonal matrix $\pmb {R}(m,b)\in \mathbb{R}^{d\times d}$ is composed of a product of multiple orthogonal butterfly components. For convenience, we denote BOFT with $\pmb {R}(m,\frac{b}{2})$ as BOFT(m,b), where $b\geq 2$ . When $m = 1$ , then BOFT(1,b) reduces to the block-diagonal OFT [67] with the block size $b$ . BOFT(1,d) reduces to the original OFT [67] with an unconstrained full orthogonal matrix. BOFT $(\log \frac{2d}{b},b)$ uses the block butterfly matrix $\pmb{B}^{\frac{b}{2}}(d)$ as $\pmb{R}$ , and yields a dense orthogonal matrix $\pmb{R}$ . In general, BOFT(m,b) takes $\frac{1}{2} (b - 1)dm$ effective trainable parameters for finetuning a linear layer of size $d\times n$ . If we use the butterfly matrix, i.e., $m = \log d,b = 2$ , BOFT uses $\mathcal{O}(d\log d)$ parameters. In contrast, the original OFT with a full dense orthogonal matrix uses $\mathcal{O}(d^2)$ parameters, and the block-diagonal OFT with the block number $r$ uses $\mathcal{O}(bd)$ . Therefore, the original OFT has to use the block size $b = d$ to generate a dense orthogonal matrix, while BOFT can use any $b$ to achieve this.
+
+
+Figure 4: The butterfly structure $(d = 8)$ .
+
+Identity initialization for BOFT. Finetuning methods usually start with the exact pretrained model such that the finetuned model will not deviate too much from the pretrained one. For example, LoRA uses zero initialization for the low-rank weights. In BOFT, we initialize all the butterfly components with identity matrices (i.e., the skew-symmetric matrix is initialized as zeros in Cayley transform).
+
+Multiplicative Dropout for BOFT. LoRA [29] further implements a Dropout layer for the low-rank weight update to prevent overfitting. The conventional Dropout [77] naturally works for LoRA, but not for BOFT due to our multiplicative weight update. To address this, we propose a multiplicative Dropout for BOFT. Because the orthogonal matrix $\mathbf{R}(m,b)$ is composed of $m$ orthogonal butterfly components which can be easily permuted to $2b \times 2b$ block-diagonal orthogonal matrices. The multiplicative Dropout first randomly picks $p_1$ percent of the butterfly components and $p_2$ percent of the diagonal blocks in each butterfly component, and then replaces these blocks as identity matrices.
+
+# 5 INTRIGUING INSIGHTS AND DISCUSSIONS
+
+Expressivity of BOFT. The butterfly structure along with permutations can perfectly recover many classic fast linear transform [13, 14] (e.g., fast Fourier transform, Hadamard transform), but how well our orthogonal butterfly matrix can approximate a general orthogonal matrix remains unknown. We start by conducting a simulation to approximate a random dense orthogonal matrix [2] with size $512 \times 512$ . The results in Figure 5 are averaged over 10 random seeds. The y-axis denotes the approximation error, and the x-axis denotes the number of effective trainable parameters. Each curve with the same color denotes BOFT with the same
+
+block size, and the leftmost point is the error of BOFT(1,b) (i.e., the original block-diagonal OFT with block size $b$ ). BOFT generally yields better parameter efficiency than OFT. For example, the expressiveness of BOFT(9,2) is better than that of BOFT(1,16) but has much less parameters. BOFT with smaller $b$ and larger $m$ is generally more parameter-efficient. For example, BOFT(6,4) uses much less parameters but yields a similar approximation error to BOFT(2,16). In general, the butterfly matrix represents a more structured subset of the orthogonal group (compared to the block-diagonal structure), which makes BOFT provably more expressive than OFT with the same block size.
+
+
+Figure 5: Expressiveness of BOFT.
+
+Theorem 1 (Expressivity of BOFT). BOFT is more expressive than OFT with the same block size. For the butterfly matrix to approximate all orthogonal matrices of size $d$ , we can multiply butterfly matrices with $B_{d-1,1}(d)B_{d-1,2}^{\top}(d)\cdots B_{1,1}(d)B_{1,2}^{\top}(d)$ , where $B_{i,j}(d), \forall i, \forall j$ are butterfly matrices.
+
+Theorem 1 suggests a simple generalization for BOFT - the final orthogonal matrix is generalized to $\mathbf{R}^G(m_1, b_1, m_2, b_2, l) = \mathbf{R}_{l,1}(m_1, b_1)\mathbf{R}_{l,2}^T(m_2, b_2) \cdots \mathbf{R}_{1,1}(m_1, b_1)\mathbf{R}_{1,2}^T(m_2, b_2)$ where $\mathbf{R}_{i,j}^T(m, b)$ denotes the orthogonal matrix used in BOFT. When $m_1 = m_2 = \log d$ , $b_1 = b_2 = 2$ and $l = d - 1$ , then $\mathbf{R}^G(m_1, b_1, m_2, b_2, l)$ can represent the entire orthogonal group. Such a matrix composition is also called kaleidoscope hierarchy [14]. However, we note that better expressiveness does not always lead to better performance in finetuning, as full finetuning, despite its universal expressiveness, often yields unsatisfactory performance. The trade-off between expressivity and regularity is the key to the generalizability of model finetuning. BOFT enlarges the finetuning parameter space with structural priors, which enables us to find a better trade-off between expressivity and regularity.
+
+Spectral properties. Orthogonal finetuning generally yields better spectral property than LoRA, because it perfectly preserves the spectral norm of the pretrained weight matrix $\boldsymbol{W}^{0}$ . We can see this by singular value decomposition: $\boldsymbol{W}^{0} = \boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^{\top}$ where $\boldsymbol{U}, \boldsymbol{V}$ are orthogonal matrices and $\boldsymbol{\Sigma}$ is a singular value diagonal matrix. Both OFT and BOFT multiply an orthogonal matrix $\boldsymbol{R}$ to the left and obtain the finetuned weights $\boldsymbol{RU}\boldsymbol{\Sigma}\boldsymbol{V}^{\top}$ , which does not affect the largest singular value (i.e., the spectral norm of $\boldsymbol{W}^{0}$ ). Such a preservation has been shown to greatly benefit training stability and generalization [58, 90]. We introduce more interesting mathematical properties in Appendix G.
+
+Orthogonal finetuning as learning bilinear similarity. BOFT can be written as learning the bilinear similarity $\boldsymbol{w}_i^0 \boldsymbol{R} \boldsymbol{x}$ where $\boldsymbol{w}_i^0$ is the $i$ -th neuron (i.e., column vector) of the weight matrix $\boldsymbol{W}^0$ . BOFT can be viewed as learning the bilinear similarity matrix $\boldsymbol{R}$ with a strong regularity (i.e., $\boldsymbol{R}$ needs to be orthogonal), which intrinsically connects to distance metric learning [89] and bilinear form [72].
+
+Inductive bias and generalization in BOFT. Since $R(m, b)$ in BOFT usually represents a structured subset of the orthogonal group which constrains the hypothesis class, BOFT will naturally induce an inductive bias. We argue that the structured inductive bias induced by butterfly factorization is
+
+beneficial to generalization, as it has a shared structured pattern of many classic linear transforms [14], such as discrete Fourier transform, discrete sine/cosine transform and Hadamard transform. Moreover, the sparse matrix factorization in BOFT may also bring some implicit inductive bias [22, 44, 51].
+
+Comparison to butterfly-based sparse training. There are quite a few works [7, 13-15] that study sparse training with the butterfly parameterization. They typically focus on reparameterizing the weight matrices directly with the butterfly parameterization and training neural networks from scratch. [15] considers finetuning the pretrained weights by first projecting the weights on a variant of butterfly matrices and then optimizing the projected components for downstream tasks. BOFT proposes a very different finetuning strategy that transforms the weights with layer-shared weight matrices.
+
+# 6 APPLICATIONS AND EMPIRICAL RESULTS
+
+We apply BOFT to finetune large language models (DeBERTaV3 [25], Llama-2 [81]), vision foundation models (DINOv2 [62], SAM [35]), and text-to-image generative models (Stable Diffusion [73]) on various downstream tasks. To ensure a fair comparison, we use exactly the same settings for all the compared baselines. The results are averaged over 5 random seeds, and the gains have passed significant tests with $p < 0.05$ . Experimental details and more results are provided in the appendices.
+
+# 6.1 ADAPTATION OF LARGE LANGUAGE MODELS (LLMS)
+
+Natural language understanding. To evaluate the performance of BOFT on LLM adaptation, we first finetune a pretrained DeBERTaV3-base model [25] on the GLUE benchmark [87], which consists of some representative sentence classification tasks and is widely used for assessing the natural language un
+
+
Method
#Param
MNLI
SST-2
CoLA
QQP
QNLI
RTE
MRPC
STS-B
All
Full Finetuning
184M
89.90
95.63
69.19
92.40
94.03
83.75
89.46
91.60
88.25
BitFit [92]
0.1M
89.37
94.84
66.96
88.41
92.24
78.70
87.75
91.35
86.20
H-Adapter [28]
1.22M
90.13
95.53
68.64
91.91
94.11
84.48
89.95
91.48
88.28
P-Adapter [65]
1.18M
90.33
95.61
68.77
92.04
94.29
85.20
89.46
91.54
88.41
LoRAr=8 [29]
1.33M
90.65
94.95
69.82
91.99
93.87
85.20
89.95
91.60
88.50
AdaLoRA [97]
1.27M
90.76
96.10
71.45
92.23
94.55
88.09
90.69
91.84
89.46
OFTb=16
0.79M
90.33
96.33
73.91
92.10
94.07
87.36
92.16
91.91
89.77
BOFTm=b=2
0.75M
90.25
96.44
72.95
92.10
94.23
88.81
92.40
91.92
89.89
+
+Table 1: Results on the GLUE development set. We report the matched accuracy for MNLI, Matthew's correlation for CoLA, average correlation for STS-B and accuracy for other tasks.
+
+derstanding ability [17, 25, 53]. Results are presented in Table 1. "# Param" in the table denotes the total number of effective trainable parameters for each method. We note that OFT [67] with the block size 16 is BOFT(1,16). One can observe that orthogonal finetuning performs better than current state-of-the-art methods. More importantly, BOFT outperforms OFT while still using less parameters.
+
+Massive multitask language understanding. We use Alpaca [80] as our finetuning dataset and evaluate both zero-shot and few-shot performance on the MMLU dataset [27] which consists of 57 language tasks. All methods use the pretrained Llama-2-7B
+
+
Method
# Param
MMLU (5-shot)
MMLU (0-shot)
Hums.
STEM
Social
Other
Avg.
Hums.
STEM
Social
Other
Avg.
Llama-2-7B
-
43.0
36.9
51.6
52.1
45.7
38.8
33.3
46.8
45.0
40.8
\( LoRA_{r=16} \)
0.125%
42.9
38.5
54.5
53.8
47.0
42.5
37.1
51.5
52.3
45.5
\( LoRA_{r=32} \)
0.25%
42.9
38.7
54.6
54.7
47.3
42.5
36.7
52.8
52.7
45.9
\( OFT_{b=16} \)
0.13%
44.0
38.9
54.2
54.3
47.5
44.0
36.7
52.9
52.0
46.2
\( OFT_{b=8}^{m=2} \)
0.12%
44.5
39.0
54.4
55.1
47.9
44.3
37.4
53.1
52.8
46.7
+
+Table 2: Accuracy (%) on MMLU. " #Param" denotes the percentage of finetuned parameters.
+
+model [81]. Results in Table 2 show a consistent improvement over LoRA, but BOFT uses fewer parameters. Notably, BOFT(2,8) produces a block-diagonal orthogonal matrix with the block size 16, and yet still outperforms OFT with the same block size (i.e., BOFT(1,16)) by a considerable margin. This result implies that the butterfly structure can incorporate a generalizable inductive bias.
+
+Mathematical question answering. We also evaluate our method in mathematical question answering using two challenging benchmarks: GSM8K [11] and MATH [27]. For all the finetuning methods, we use MetaMathQA-40K [91] as the finetuning dataset, and the Llama2-7B model [81] as the pretrained backbone. As can be observed in Table 3, BOFT excels in mathematical reasoning on both datasets. We note that even though improvement on the MATH dataset is in
+
+
Method
#Param
GSM8K
MATH
Llama-2-7B
-
14.6
2.5
\( LoRA_{r=32} \)
0.25%
50.2
7.8
\( OFT_{b=16} \)
0.13%
50.1
8.4
\( BOFT_{b=8}^{m=2} \)
0.12%
50.6
8.6
+
+Table 3: Results on GSM8K and MATH.
+
+fact quite challenging, BOFT achieves more than $10\%$ relative improvement over LoRA while only using half of the number of trainable parameters for LoRA. Moreover, BOFT outperforms OFT even with the same effective block number, again verifying that the butterfly structure can introduce a generalizable inductive bias. We also provide a case study of a few questions in Appendix E.
+
+
# param (M)
Natural
Specialized
Structured
Cifar100
Caltech101
DTD
Flower102
Pets
SVHN
Sun397
Camelyon
EuroSAT
Resisc45
Retinopathy
Clev-Count
Clev-Dist
DMLab
KITTI-Dist
dSpr-Loc
dSpr-Ori
sNORB-Azim
sNORB-Ele
Average
Full Finetuning
304.4
67.6
91.7
77.9
99.7
93.7
92.8
52.3
88.1
96.1
90.9
77.2
67.2
59.8
58.1
82.8
83.6
62.0
36.9
39.4
74.6
Linear Probing
0
73.2
90.9
78.1
99.7
95.2
40.3
59.3
84.2
92.9
86.8
75.6
48.1
44.4
45.9
65.4
25.5
37.0
18.5
30.9
62.7
BitFit [92]
0.27
78.5
91.7
80.4
99.7
95.0
67.3
60.2
85.2
96.1
90.7
75.7
84.1
63.0
52.7
78.9
83.8
61.9
28.0
37.7
74.2
FacTttr=16 [31]
0.12
76.2
89.4
77.3
99.7
94.7
89.6
58.9
87.1
94.3
88.7
74.0
83.1
63.3
56.2
83.1
61.7
37.1
23.3
32.6
72.1
FacTtkr=32 [31]
0.12
75.0
89.1
78.6
99.7
95.0
92.1
58.9
86.1
94.6
89.5
74.2
84.3
62.0
57.7
85.2
68.4
38.3
31.2
44.2
73.9
LoRAr=4 [29]
1.77
77.2
92.8
80.3
99.7
94.8
92.7
59.5
88.3
96.4
91.4
77.4
74.7
62.4
58.1
85.2
85.8
57.2
31.8
37.2
76.6
GLORAr=4 [6]
4.87
80.1
93.7
80.2
99.7
94.4
89.6
59.9
85.9
96.0
91.0
76.2
61.8
62.3
56.9
85.8
65.7
57.2
37.0
41.4
74.5
OFTb=16
2.10
77.7
91.9
80.1
99.7
94.7
92.9
59.3
88.4
96.4
91.5
77.2
81.0
64.7
60.5
84.0
92.2
61.1
34.8
40.3
77.3
BOFTm=b=8
1.99
78.1
92.5
80.6
99.7
95.0
93.0
59.9
88.9
96.6
91.6
77.3
84.5
64.9
61.4
84.1
93.9
62.0
36.2
40.0
77.9
BOFTm=b=4
1.77
78.2
91.4
79.6
99.7
94.9
92.8
59.4
88.1
96.4
91.6
76.2
81.9
65.4
60.0
84.5
92.9
61.3
37.1
39.3
77.4
BOFTm=b=2
1.11
78.3
91.5
79.9
99.7
95.0
92.0
60.2
88.2
96.5
91.4
77.2
80.5
64.1
61.4
85.0
91.6
60.8
34.0
38.5
77.1
+
+Table 4: Results (%) on the VTAB-1K benchmark. "# param" specifies the number of trainable parameters of each method. The average accuracy is obtained by averaging over all 19 tasks. The best results are marked with "bold", and the second/third best results are marked with "underline".
+
+# 6.2 ADAPTATION OF VISION FOUNDATION MODELS
+
+Transfer learning on VTAB-1K. We evaluate the finetuning performance of BOFT on the VTAB-1K benchmark [94], which has been extensively used to evaluate parameter-efficient transfer learning algorithms. VTAB-1K consists of 19 image classification tasks that are divided into three
+
+categories: natural images, specialized tasks (e.g., remote sensing and medical images), and structured tasks (e.g., depth and orientation prediction). In VTAB-1k, each dataset provides 800 labeled training set samples, a subset of their original training set. We use them to fine-tune our base model and the Top-1 classification accuracy on their respective original test set is used as the performance measure. Notably, all compared methods introduce no inference latency, so they have the same inference speed. Because the final classification layer will always get retrained and the trainable parameters of that linear classification layer vary across different tasks, we follow the common practice and do not take them into account when reporting the total trainable parameters for each method. Different from [6], we use a much larger pretrained vision transformer [62] (DINOv2-large) with more than 300M parameters. The accuracies are given in Table 4. We observe that orthogonal finetuning achieves the best overall testing accuracy on the VTAB-1K benchmark, and BOFT with $m = 4$ , $b = 4$ again achieves the best performance. Remarkably, BOFT's performance enhancement is both stable and consistent across tasks, as almost all our results outperform the simplest full finetuning baseline. BOFT is marginally worse than full finetuning on three tasks: dSpr-Ori $(-0.7\%)$ , Caltech101 $(-0.3\%)$ and sNORB-Ele $(-0.1\%)$ . In contrast, LoRA is significantly worse than full finetuning on sNORB-Azim and dSpr-Ori by $5\%$ . These results validate the effectiveness of BOFT for vision transformers.
+
+High-quality segmentation with SAM. The Segment Anything Model (SAM) [35] is a vision foundation model for promptable image segmentation, demonstrating impressive zero-shot capabilities. SAM consists of three main components: a pre-trained image encoder to generate a feature embedding of the input image, a prompt encoder to embed prompts, and a mask decoder to map these input embeddings to a segmentation mask. Despite its impressive performance in general image segmentation, SAM lacks the ability to perform highly accurate segmentation in challenging situations. To address this, HQ-
+
+SAM [34] proposes to train an additional HQ-Output Token and a global-local feature fusion module on a high-quality segmentation dataset, HQSeg-44K [34], to improve the mask quality, achieving state-of-the-art performance in high-quality segmentation. Using the same dataset and loss function
+
+
+Figure 6: Qualitative comparison of between SAM and BOFT-SAM.
+
+
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+Text prompt: a woman with her mouth open
+Control signal
+Figure 7: Qualitative comparison of controllable generation. The figure is best viewed digitally, in color and significantly zoomed in.
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+Control signal
+
+
+Text prompt: a man wearing a hat
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+Text prompt: a woman with long black hair
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+as HQ-SAM, we finetune the original SAM with BOFT for 10 epochs. Specifically, we only apply BOFT to all linear layers of the mask decoder of SAM, while keeping the other part of SAM frozen. We compare to finetuning the entire mask decoder, training the HQ-SAM modules [34] and finetuning linear layers with BOFT. Table 5 shows that BOFT-SAM uses only $3\%$ of trainable parameters used in HQ-SAM, and yet matches its performance. Moreover, since the multiplicative weights learned by BOFT can be combined back to the weights of SAM, BOFT-SAM has exactly the same inference speed as SAM, while, in contrast, HQ-SAM has additional modules that affect its inference speed.
+
+# 6.3 CONTROLLING TEXT-TO-IMAGE DIFFUSION MODELS
+
+Since OFT is originally used to control text-to-image diffusion models [67], we also evaluate BOFT with the same task for better comparison. We finetune the pretrained Stable Diffusion [73] for two tasks: controllable generation (e.g., [59, 96]) and subject-driven generation (e.g., [74]). Controllable generation enables adding spatial control signals to the text-to-image diffusion models. Subject-driven generation aims to synthesize images of a subject in novel contexts by finetuning on a few images of that subject to learn a unique identifier. We follow the same setting as [67] for evaluating controllable generation. To be easily comparable to OFT, where the block structure is characterized by the number of blocks $r$ , we also use the number of blocks to characterize BOFT (instead of the block size $b$ ). Because $rd = b$ , larger $r$ indicates less number of parameters. For example, for BOFT with $r = 32$ to generate a dense orthogonal matrix, we need to have $m = 6$ .
+
+We start by comparing LoRA, OFT and BOFT with a small parameter budget (less than 3M parameters). We see from Table 6 that BOFT with $r = 32$ , $m = 2$ yields significantly better performance than both LoRA and OFT with the block number 16 under the 3M parameter budget. Under this small budget setting, we also provide a qualitative comparison among LoRA ( $r = 16$ ), OFT ( $r = 16$ ) and BOFT ( $r = 32$ , $m = 2$ ) in Figure 7. We also evaluate how BOFT performs with a dense orthogonal matrix using $r = 16$ , $m = 4$ and $r = 8$ , $m = 4$ . We observe that BOFT with $r = 8$ , $m = 4$ achieves the best performance and significantly outperforms LoRA with a similar number of parameters.
+
+Finally, we conduct an ablation study on how the number of butterfly components $m$ affects the performance of controllable generation. We first fix the block number as $r = 32$ , and then vary the number of butterfly components in BOFT from 0 (i.e., OFT with the block number 32) to 6 (BOFT with a dense orthogonal matrix). Figure 8 shows that BOFT with a larger $m$ yields better control performance for Stable Diffusion finetuning. More interestingly, we also find that, with the same number of blocks, an increased number of butterfly components generally leads to faster and more stable convergence. This implies that orthogonal finetuning with a denser orthogonal matrix converges faster
+
+in finetuning text-to-image diffusion models. This also matches our intuition that a dense orthogonal matrix can transform neurons more effectively due to its more efficient information transmission.
+
+BOFT also performs consistently better than both LoRA and the original OFT in subject-driven generation. A qualitative comparison is given in Figure 9 and Appendix C. For all the compared methods, we use the best possible hyperparameters. We empirically observe that BOFT can generally capture more intrinsic identity characteristics of the input subject, and therefore, the generated images
+
+
Method
#Param
Error↓
\( LoRA_{r=16} \)
2.52M
8.878
\( LoRA_{r=64} \)
10.08M
8.062
\( LoRA_{r=128} \)
20.17M
8.038
\( OFT_{r=16} \)
2.71M
8.876
\( OFT_{r=4} \)
10.50M
6.537
\( OFT_{r=2} \)
20.89M
6.407
\( BOFT_m=2_{r=32} \)
2.66M
8.070
\( BOFT_m=6_{r=32} \)
7.69M
6.731
\( BOFT_m=5_{r=16} \)
12.93M
6.387
\( BOFT_m=4_{r=8} \)
20.76M
5.667
+
+Table 6: Face landmark error between control signal and prediction.
+
+
+Figure 8: How $m$ affects controllability.
+
+
+
+
+
+
+
+
+
+
+Figure 9: Qualitative comparison of subject-driven generation. The figure is best viewed digitally, in color and significantly zoomed in.
+
+
+
+
+
+
+
+
+Control signal
+
+
+
+
+BOFT (6 matrices)
+
+
+
+
+5 matrices
+
+
+
+
+4 matrices
+Figure 10: Model weight interpolation by setting the trained butterfly components one by one to identity matrix. We use BOFT $(m = 5, r = 16)$ to finetune Stable Diffusion (SD). No retraining is performed when we gradually set each trained orthogonal matrix $(\tilde{B}_i)$ to an identity. The number in the figure denotes the number of remaining orthogonal butterfly components that has not been set to identity. Text prompt: a man with a beard smiling (for the first row) and a smiling woman (for the second row). *0 matrix is the case of SD with a learned control head.
+
+
+
+
+3 matrices
+
+
+
+
+2 matrices
+
+
+
+
+1 matrix
+
+
+
+
+$\mathrm{SD^{*}}$ (0 matrix)
+
+are visually more plausible in terms of the subject identity preservation. We can see from Figure 9 that the original OFT also shows good performance in preserving subject identity while LoRA has better text prompt following ability. In sharp contrast, BOFT can achieve the best of both worlds by simultaneously demonstrating good subject identity preservation as well as accurate text prompt following ability. Notably, for the bottom-left toy duck case in Figure 9, we observe that BOFT can capture the essence of the toy and generate a cubed shaped toy with a conceptually similar color.
+
+BOFT comes with free weight interpolation. We have a surprising yet interesting discovery that uniquely distinguishes BOFT from existing methods in controllable generation. BOFT consists of multiple orthogonal matrices (i.e., multiple butterfly components), and the product of these matrices gives the complete finetuned model. However, what will happen if we set the trained orthogonal butterfly components to identity matrix one by one without retraining? If we set all the butterfly components to identity, the model reduces to Stable Diffusion. If no butterfly components are set to identity, then we have the full BOFT-finetuned model. After the BOFT training, the structure of multiple butterfly components provides us with a free weight interpolation on the orthogonal manifold. We perform the weight interpolation for all the BOFT-finetuned layers in Stable Diffusion. Specifically, we use BOFT with $m = 5$ , $r = 16$ , so we have 6 butterfly components. We set the butterfly components one by one to identity matrix, starting from left-hand side. The results are given in Figure 10. Surprisingly, although these interpolated weights have not been retrained, they can still generate plausible images. In fact, as we set more butterfly components to identity, the interpolated model produces a smooth interpolated result, from a landmark-controlled image to an uncontrolled Stable Diffusion image. These results well validate that the hypothesis weight space (i.e., model space) in BOFT can well preserve the semantics and effectively eliminate many bad local minima.
+
+# 7 CONCLUDING REMARKS AND LIMITATIONS
+
+Our paper proposes Orthogonal Butterfly, a generic parameter-efficient finetuning method for foundation models based on the butterfly structure. The key insight to better parameter-efficiency is to
+
+parameterize a dense orthogonal matrix with the product multiple sparse orthogonal matrices. To easily find feasible matrix factorizations, we propose a graphical information transmission framework. Under this framework, we find that the butterfly structure can effectively achieve our desiderata of sparse orthogonal matrix factorization. We demonstrate the empirical effectiveness of BOFT in finetuning large language models, large vision models and text-to-image generative models. Our experiments also validate the superiority of BOFT as a generic mode finetuning method.
+
+Despite empirical effectiveness, BOFT is by no means perfect. Since the final orthogonal matrix in BOFT is the product of multiple orthogonal matrix, the training runtime overhead is slightly larger than OFT. How to improve BOFT's training runtime remains an open problem. Fortunately, after the finetuning stage, the BOFT-learned orthogonal matrices can be directly multiplied into the pretrained model and there is no additional inference latency. Moreover, whether the butterfly network is the most efficient way to transmit information is also unknown. Our information transmission framework further enables us to draw inspiration from a distinct research discipline - computer networking, where the efficiency of a network topology for transmitting information is heavily studied. We expect that more efficient network structures can be used for composing dense orthogonal matrices.
+
+# ACKNOWLEDGMENT AND AUTHOR CONTRIBUTION
+
+The authors would like to sincerely thank Peter Kulits for careful proofreading, Tim Z. Xiao and many other colleagues at Max Planck Institute for Intelligent Systems for countless helpful suggestions. This work was supported by the German Federal Ministry of Education and Research (BMBF): Tubingen AI Center, FKZ: 01IS18039B, and by the Machine Learning Cluster of Excellence, EXC number 2064/1 - Project number 390727645. WL was supported by the German Research Foundation (DFG): SFB 1233, Robust Vision: Inference Principles and Neural Mechanisms, TP XX, project number: 276693517. YF and SP are partially supported by the Max Planck ETH Center for Learning Systems. Yuliang Xiu is funded by the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No.860768 (CLIPE). AW acknowledges support from a Turing AI Fellowship under grant EP/V025279/1, The Alan Turing Institute, and the Leverhulme Trust via CFI. MJB has received research gift funds from Adobe, Intel, Nvidia, Meta/Facebook, and Amazon. MJB has financial interests in Amazon, Datagen Technologies, and Meshcapade GmbH. While MJB is a consultant for Meshcapade, his research in this project was performed solely at, and funded solely by, the Max Planck Society.
+
+Weiyang Liu and Zeju Qiu contributed equally as the joint first author. Yao Feng, Yuliang Xiu, Yuxuan Xue and Longhui Yu contributed equally as the joint second author. Authors with equal contributions are listed in alphabetical order and allowed to change their orders freely on their resume and website. Michael J. Black, Adrian Weller and Bernhard Scholkopf jointly supervised the project, provided generous computing support and contributed significantly to the project (including but not limit to idea discussion, direction suggestion and paper writing).
+
+Weiyang Liu initialized the core idea, organized the project, co-developed the current method, co-supervised the experiments, and wrote the draft. Zeju Qiu co-initialized the core idea, co-developed the current method, implemented most of the prototypes, conducted the GLUE, VTAB-1K and SAM finetuning experiments, co-supervised the experiments and contributed to the draft writing. Yao Feng implemented a fast version of BOFT in CUDA, contributed to the method development, and conducted the experiments of multi-modal finetuning. Yuliang Xiu led the experimental efforts in controlling text-to-image diffusion models, conducted the experiments of both controllable (ControlNet) and subject-driven (DreamBooth) generation, contributed to the method development and paper writing. Yuxuan Xue contributed to the method development and the experiments of vision foundation models. Longhui Yu led the experimental efforts in MMLU and mathematical question answering and contributed to the method development. Haiwen Feng contributed to the method development and the experiments of text-to-image generation. Juyeon Heo conducted the robustness experiments. All the team members made necessary contributions to the method development and paper writing.
+
+Large language models: the experiments are jointly led by Zeju Qiu and Longhui Yu. Weiyang Liu contributed to the model debugging.
+
+Vision foundation models: the experiments are led by Zeju Qiu. Yuxuan Xue contributed to the baseline experiments and model debugging. Weiyang Liu contributed to the model debugging.
+
+Text-to-image diffusion models: the experiments are led by Yuliang Xiu. Zeju Qiu, Weiyang Liu and Haiwen Feng contributed to the model debugging.
+
+# REFERENCES
+
+[1] Armen Aghajanyan, Luke Zettlemoyer, and Sonal Gupta. Intrinsic dimensionality explains the effectiveness of language model fine-tuning. arXiv preprint arXiv:2012.13255, 2020. 3
+[2] Theodore W Anderson, Ingram Olkin, and Les G Underhill. Generation of random orthogonal matrices. SIAM Journal on Scientific and Statistical Computing, 1987. 6
+[3] Alan Ansell, Edoardo Ponti, Anna Korhonen, and Ivan Vulić. Composable sparse fine-tuning for cross-lingual transfer. In ACL, 2022. 3
+[4] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020. 1, 2
+[5] Emmanuel J Candès, Xiaodong Li, Yi Ma, and John Wright. Robust principal component analysis? Journal of the ACM, 2011. 2
+[6] Arnav Chavan, Zhuang Liu, Deepak Gupta, Eric Xing, and Zhiqiang Shen. One-for-all: Generalized lora for parameter-efficient fine-tuning. arXiv preprint arXiv:2306.07967, 2023.1, 3, 8, 19
+[7] Beidi Chen, Tri Dao, Kaizhao Liang, Jiaming Yang, Zhao Song, Atri Rudra, and Christopher Re. Pixelated butterfly: Simple and efficient sparse training for neural network models. In ICLR, 2022. 3, 5, 7
+[8] Jiaao Chen, Aston Zhang, Xingjian Shi, Mu Li, Alex Smola, and Diyi Yang. Parameter-efficient fine-tuning design spaces. In ICLR, 2023. 3
+[9] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021. 1
+[10] Shoufa Chen, Chongjian Ge, Zhan Tong, Jiangliu Wang, Yibing Song, Jue Wang, and Ping Luo. Adaptformer: Adapting vision transformers for scalable visual recognition. In NeurIPS, 2022. 3
+[11] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. 7
+[12] James W Cooley and John W Tukey. An algorithm for the machine calculation of complex fourier series. Mathematics of computation, 19(90):297-301, 1965. 2, 5
+[13] Tri Dao, Albert Gu, Matthew Eichhorn, Atri Rudra, and Christopher Ré. Learning fast algorithms for linear transforms using butterfly factorizations. In ICML, 2019. 3, 6, 7
+[14] Tri Dao, Nimit Sohoni, Albert Gu, Matthew Eichhorn, Amit Blonder, Megan Leszczyński, Atri Rudra, and Christopher Ré. Kaleidoscope: An efficient, learnable representation for all structured linear maps. In ICLR, 2020. 3, 6, 7, 29
+[15] Tri Dao, Beidi Chen, Nimit S Sohoni, Arjun Desai, Michael Poli, Jessica Grogan, Alexander Liu, Aniruddh Rao, Atri Rudra, and Christopher Ré. Monarch: Expressive structured matrices for efficient and accurate training. In ICML, 2022. 3, 7
+[16] Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. Qlora: Efficient finetuning of quantized llms. arXiv preprint arXiv:2305.14314, 2023. 3
+[17] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding, 2019. 7
+[18] Ning Ding, Yujia Qin, Guang Yang, Fuchao Wei, Zonghan Yang, Yusheng Su, Shengding Hu, Yulin Chen, Chi-Min Chan, Weize Chen, et al. Parameter-efficient fine-tuning of large-scale pre-trained language models. Nature Machine Intelligence, 2023. 3
+
+[19] Ali Edalati, Marzieh Tahaei, Ivan Kobyzev, Vahid Partovi Nia, James J Clark, and Mehdi Rezagholizadeh. Krona: Parameter efficient tuning with kronecker adapter. arXiv preprint arXiv:2212.10650, 2022. 3
+[20] Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H Bermano, Gal Chechik, and Daniel Cohen-Or. An image is worth one word: Personalizing text-to-image generation using textual inversion. arXiv preprint arXiv:2208.01618, 2022. 20
+[21] Mozhdeh Gheini, Xiang Ren, and Jonathan May. Cross-attention is all you need: Adapting pretrained transformers for machine translation. In EMNLP, 2021. 3
+[22] Suriya Gunasekar, Blake E Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nati Srebro. Implicit regularization in matrix factorization. In NeurIPS, 2017. 7
+[23] Demi Guo, Alexander M Rush, and Yoon Kim. Parameter-efficient transfer learning with diff pruning. arXiv preprint arXiv:2012.07463, 2020. 1, 3
+[24] Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Towards a unified view of parameter-efficient transfer learning. arXiv preprint arXiv:2110.04366, 2021. 1, 3
+[25] Pengcheng He, Jianfeng Gao, and Weizhu Chen. Debertav3: Improving deberta using electrastyle pre-training with gradient-disentangled embedding sharing. In ICLR, 2022. 7, 19
+[26] Wu Hecong. ControlLoRA: A Lightweight Neural Network To Control Stable Diffusion Spatial Information. https://github.com/HighCWu/ControlLoRA, 2023. 20
+[27] Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. In ICLR, 2021. 7
+[28] Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In ICML, 2019. 1, 3, 7
+[29] Edward J Hu, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, Weizhu Chen, et al. Lora: Low-rank adaptation of large language models. In ICLR, 2022. 1, 2, 3, 6, 7, 8
+[30] Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In ECCV, 2022.
+[31] Shibo Jie and Zhi-Hong Deng. Fact: Factor-tuning for lightweight adaptation on vision transformer. In AAAI, 2023. 3, 8
+[32] Li Jing, Yichen Shen, Tena Dubcek, John Peurifoy, Scott Skirlo, Yann LeCun, Max Tegmark, and Marin Soljačić. Tunable efficient unitary neural networks (eunn) and their application to rnns. In ICML, 2017. 3
+[33] Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. Compacter: Efficient low-rank hypercomplex adapter layers. In NeurIPS, 2021. 3
+[34] Lei Ke, Mingqiao Ye, Martin Danelljan, Yifan Liu, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu. Segment anything in high quality. In NeurIPS, 2023. 8, 9, 20
+[35] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643, 2023. 2, 7, 8, 20
+[36] Ralf Klasing, Burkhard Monien, Regine Peine, and Elena A Stöhr. Broadcasting in butterfly and debruijn networks. Discrete Applied Mathematics, 53(1-3):183-197, 1994. 2, 3
+[37] Nupur Kumari, Bingliang Zhang, Richard Zhang, Eli Shechtman, and Jun-Yan Zhu. Multi-concept customization of text-to-image diffusion. In CVPR, 2023. 20
+
+[38] Benjamin Lefaudeau, Francisco Massa, Diana Liskovich, Wenhan Xiong, Vittorio Caggiano, Sean Naren, Min Xu, Jieru Hu, Marta Tintore, Susan Zhang, Patrick Labatut, and Daniel Haziza. xformers: A modular and hackable transformer modelling library. https://github.com/facebookresearch/xformers, 2022. 20
+[39] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021. 1, 3
+[40] S-YR Li, Raymond W Yeung, and Ning Cai. Linear network coding. IEEE transactions on information theory, 2003. 3
+[41] Shuo-Yen Robert Li, Qifu Tyler Sun, and Ziyu Shao. Linear network coding: Theory and algorithms. Proceedings of the IEEE, 2011. 5
+[42] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In ACL, 2021. 1, 3
+[43] Yingzhou Li, Haizhao Yang, Eileen R Martin, Kenneth L Ho, and Lexing Ying. Butterfly factorization. Multiscale Modeling & Simulation, 13(2):714-732, 2015. 3
+[44] Yuanzhi Li, Tengyu Ma, and Hongyang Zhang. Algorithmic regularization in overparameterized matrix sensing and neural networks with quadratic activations. In COLT, 2018. 7
+[45] Vladislav Lialin, Vijeta Deshpande, and Anna Rumshisky. Scaling down to scale up: A guide to parameter-efficient fine-tuning. arXiv preprint arXiv:2303.15647, 2023. 3
+[46] Dongze Lian, Daquan Zhou, Jiashi Feng, and Xinchao Wang. Scaling & shifting your features: A new baseline for efficient model tuning. In NeurIPS, 2022. 3
+[47] Jun Hao Liew, Scott Cohen, Brian Price, Long Mai, and Jiashi Feng. Deep interactive thin object selection. In WACV, 2021. 8
+[48] Zhaojiang Lin, Andrea Madotto, and Pascale Fung. Exploring versatile generative language model via parameter-efficient transfer learning. arXiv preprint arXiv:2004.03829, 2020. 1
+[49] Haokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta, Tenghao Huang, Mohit Bansal, and Colin A Raffel. Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. In NeurIPS, 2022. 3
+[50] Weiyang Liu, Rongmei Lin, Zhen Liu, Lixin Liu, Zhiding Yu, Bo Dai, and Le Song. Learning towards minimum hyperspherical energy. In NeurIPS, 2018. 3
+[51] Weiyang Liu, Zhen Liu, James M Rehg, and Le Song. Neural similarity learning. In NeurIPS, 2019. 7
+[52] Weiyang Liu, Rongmei Lin, Zhen Liu, James M Rehg, Liam Paull, Li Xiong, Le Song, and Adrian Weller. Orthogonal over-parameterized training. In CVPR, 2021. 3, 5
+[53] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach, 2019. 7
+[54] Gen Luo, Minglang Huang, Yiyi Zhou, Xiaoshuai Sun, Guannan Jiang, Zhiyu Wang, and Rongrong Ji. Towards efficient visual adaption via structural re-parameterization. arXiv preprint arXiv:2302.08106, 2023. 3
+[55] Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, and Sayak Paul. Peft: State-of-the-art parameter-efficient fine-tuning methods. https://github.com/huggingface/peft, 2022. 20
+[56] Yuning Mao, Lambert Mathias, Rui Hou, Amjad Almahairi, Hao Ma, Jiawei Han, Wen-tau Yih, and Madian Khabsa. Unipelt: A unified framework for parameter-efficient language model tuning. arXiv preprint arXiv:2110.07577, 2021. 3
+
+[57] Eric Michielssen and Amir Boag. A multilevel matrix decomposition algorithm for analyzing scattering from large structures. IEEE Transactions on Antennas and Propagation, 1996. 3
+[58] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018. 6
+[59] Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, and Xiaohu Qie. T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion models. arXiv preprint arXiv:2302.08453, 2023. 9
+[60] Marina Munkhoeva, Yermek Kapushev, Evgeny Burnaev, and Ivan Oseledets. Quadrature-based features for kernel approximation. In NeurIPS, 2018. 3
+[61] Michael O'Neil, Franco Woolfe, and Vladimir Rokhlin. An algorithm for the rapid evaluation of special function transforms. Applied and Computational Harmonic Analysis, 2010. 3
+[62] Maxime Oquab, Timothee Darcet, Théo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023. 7, 8, 19
+[63] Douglass Stott Parker. *Random butterfly transformations with applications in computational linear algebra*. UCLA Computer Science Department, 1995. 3, 30
+[64] John Peca-Medlin. Numerical, spectral, and group properties of random butterfly matrices. University of California, Irvine, 2021. 30, 31, 32
+[65] Jonas Pfeiffer, Aishwarya Kamath, Andreas Rückle, Kyunghyun Cho, and Iryna Gurevych. Adapterfusion: Non-destructive task composition for transfer learning. arXiv preprint arXiv:2005.00247, 2020.1, 7
+[66] Xuebin Qin, Hang Dai, Xiaobin Hu, Deng-Ping Fan, Ling Shao, and Luc Van Gool. Highly accurate dichotomous image segmentation. In ECCV, 2022. 8
+[67] Zeju Qiu, Weiyang Liu, Haiwen Feng, Yuxuan Xue, Yao Feng, Zhen Liu, Dan Zhang, Adrian Weller, and Bernhard Scholkopf. Controlling text-to-image diffusion by orthogonal finetuning. In NeurIPS, 2023. 1, 2, 3, 5, 7, 9, 20
+[68] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021. 2
+[69] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 2020. 1
+[70] Indra Rajasingh, Paul Manuel, N Parthiban, D Azubha Jemilet, and R Sundara Rajan. Transmission in butterfly networks. The Computer Journal, 2016. 3
+[71] Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In NeurIPS, 2017. 1
+[72] Steven Roman, S Axler, and FW Gehring. Advanced linear algebra, volume 3. Springer, 2005. 6
+[73] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, 2022. 1, 2, 7, 9, 20
+[74] Nataniel Ruiz, Yuzheng Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. In CVPR, 2023. 9, 20
+[75] Yan Solihin. Fundamentals of parallel multicore architecture. CRC Press, 2015. 5
+
+[76] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In ICLR, 2021. 20
+[77] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 2014. 6
+[78] Yi-Lin Sung, Varun Nair, and Colin A Raffel. Training neural networks with fixed sparse masks. NeurIPS, 2021. 3
+[79] Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. Lst: Ladder side-tuning for parameter and memory efficient transfer learning. In NeurIPS, 2022. 3
+[80] Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023. 7, 20
+[81] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. 7
+[82] Marcos Treviso, Ji-Ung Lee, Tianchu Ji, Betty van Aken, Qingqing Cao, Manuel R Ciosici, Michael Hassid, Kenneth Heafield, Sara Hooker, Colin Raffel, et al. Efficient methods for natural language processing: A survey. Transactions of the Association for Computational Linguistics, 2023. 3
+[83] Thomas Trogdon. On spectral and numerical properties of random butterfly matrices. Applied Mathematics Letters, 95:48-58, 2019. 30
+[84] Mojtaba Valipour, Mehdi Rezagholizadeh, Ivan Kobyzev, and Ali Ghodsi. Dylora: Parameter efficient tuning of pre-trained models using dynamic search-free low-rank adaptation. arXiv preprint arXiv:2210.07558, 2022. 3
+[85] Patrick von Platen, Suraj Patil, Anton Lozhkov, Pedro Cuenca, Nathan Lambert, Kashif Rasul, Mishig Davaadorj, and Thomas Wolf. Diffusers: State-of-the-art diffusion models. https://github.com/huggingface/diffusers, 2022. 20
+[86] Tu Vu, Brian Lester, Noah Constant, Rami Al-Rfou, and Daniel Cer. Spot: Better frozen model adaptation through soft prompt transfer. In ACL, 2022. 3
+[87] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding, 2019. 7, 19
+[88] Yaqing Wang, Subhabrata Mukherjee, Xiaodong Liu, Jing Gao, Ahmed Hassan Awadallah, and Jianfeng Gao. Adamix: Mixture-of-adapter for parameter-efficient tuning of large language models. In EMNLP, 2022. 3
+[89] Eric Xing, Michael Jordan, Stuart J Russell, and Andrew Ng. Distance metric learning with application to clustering with side-information. In NeurIPS, 2002. 6
+[90] Yuichi Yoshida and Takeru Miyato. Spectral norm regularization for improving the generalizability of deep learning. arXiv preprint arXiv:1705.10941, 2017. 6
+[91] Longhui Yu, Weisen Jiang, Han Shi, Jincheng Yu, Zhengying Liu, Yu Zhang, James T Kwok, Zhenguo Li, Adrian Weller, and Weiyang Liu. Metamath: Bootstrap your own mathematical questions for large language models. arXiv preprint arXiv:2309.12284, 2023. 7, 20
+[92] Elad Ben Zaken, Yoav Goldberg, and Shauli Ravfogel. BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-models. In ACL, 2022. 1, 3, 7, 8
+[93] Yi Zeng, Pingping Zhang, Jianming Zhang, Zhe Lin, and Huchuan Lu. Towards high-resolution salient object detection. In ICCV, 2019. 8
+
+[94] Xiaohua Zhai, Joan Puigcerver, Alexander Kolesnikov, Pierre Ruyssen, Carlos Riquelme, Mario Lucic, Josip Djolonga, Andre Susano Pinto, Maxim Neumann, Alexey Dosovitskiy, et al. A large-scale study of representation learning with the visual task adaptation benchmark. arXiv preprint arXiv:1910.04867, 2019. 8
+[95] Feiyu Zhang, Liangzhi Li, Junhao Chen, Zhouqiang Jiang, Bowen Wang, and Yiming Qian. Increlora: Incremental parameter allocation method for parameter-efficient fine-tuning. arXiv preprint arXiv:2308.12043, 2023. 3
+[96] Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models. In ICCV, 2023. 9, 20
+[97] Qingru Zhang, Minshuo Chen, Alexander Bukharin, Pengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao. Adaptive budget allocation for parameter-efficient fine-tuning. In ICLR, 2023. 1, 3, 7, 19
+[98] Yuanhan Zhang, Kaiyang Zhou, and Ziwei Liu. Neural prompt search. arXiv preprint arXiv:2206.04673, 2022.3
+[99] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In CVPR, 2017. 20
+[100] Bolei Zhou, Hang Zhao, Xavier Puig, Tete Xiao, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision, 2019. 20
+[101] Hao Zhu, Wayne Wu, Wentao Zhu, Liming Jiang, Siwei Tang, Li Zhang, Ziwei Liu, and Chen Change Loy. CelebV-HQ: A large-scale video facial attributes dataset. In ECCV, 2022. 20
+[102] Bojia Zi, Xianbiao Qi, Lingzhi Wang, Jianan Wang, Kam-Fai Wong, and Lei Zhang. Delta-lora: Fine-tuning high-rank parameters with the delta of low-rank matrices. arXiv preprint arXiv:2309.02411, 2023. 3
+
+# Appendix
+
+# Table of Contents
+
+A Experimental Details 19
+
+A.1 Natural Language Understanding 19
+A.2 Transfer Learning on VTAB-1K 19
+A.3 Experimental Details in Llama Finetuning 19
+A.4 Experimental Details in SAM Finetuning 20
+A.5 Experimental Details in ControlNet and DreamBooth 20
+
+B More Qualitative Results on High-quality Segmentation 21
+C More Qualitative Results in Subject-driven Generation 22
+D More Qualitative Results in Controllable Generation 26
+E Mathematical Question-Answering Case Study 28
+F Proof of Theorem 1 29
+G Mathematical Properties of Butterfly Matrices 30
+
+G.1 Balanced Entry-wise Learning Rate 30
+G.2 An Alternative Definition of Orthogonal Butterfly Matrices 30
+G.3 Topological Properties 31
+G.4 Input Sensitivity 32
+G.5 Random Orthogonal Butterfly Matrices 32
+
+H Illustration of Block Butterfly Matrices 33
+
+I More Results on Expressiveness of BOFT 34
+
+# A EXPERIMENTAL DETAILS
+
+# A.1 NATURAL LANGUAGE UNDERSTANDING
+
+For our experiments on the GLUE benchmark [87], we follow the setting of [97] and only tune the learning rate, the multiplicative dropout rate, and the number of training epochs. We use the pre-trained DeBERTaV3 [25] as our base model and apply the OFT and BOFT to every linear layer in every transformer blocks. All runs can be trained on a single NVIDIA A100-SXM4-80GB GPU. See the hyperparameters used in our runs in Table 7.
+
+
Method
Dataset
MNLI
SST-2
MRPC
CoLA
QNLI
QQP
RTE
STS-B
DeBERTaV3-base OFT (16)
Batch Size
32
32
32
32
32
32
32
32
# Epochs
5
2
14
5
4
9
34
11
Learning Rate
8E-05
2E-04
9E-04
4E-04
2E-04
3E-04
3E-04
7E-04
OFT Dropout
1E-01
1E-01
1E-01
5E-02
1E-01
1E-01
5E-02
1E-01
Max Seq. Len.
256
128
320
64
512
320
320
128
DeBERTaV3-base OFT (8,1)
Batch Size
32
32
32
32
32
32
32
32
# Epochs
10
11
16
15
4
10
6
8
Learning Rate
7E-05
5E-05
8E-04
5E-04
2E-04
3E-04
4E-04
7E-04
OFT Dropout
15E-02
15E-02
1E-01
15E-02
5E-02
5E-02
5E-02
5E-02
Max Seq. Len.
256
128
320
64
512
320
320
128
+
+# A.2 TRANSFER LEARNING ON VTAB-1K
+
+In our VTAB-1K experiments, we employ the DINOv2-large $[62]^2$ as our base model for fine-tuning. Our architecture design aligns with GLoRA [6], injecting trainable OFT and BOFT weights into every linear layer in all multihead self-attention (MSA) and MLP blocks. To ensure a fair comparison, we maintain the identical training setups for our and the baseline methods: a total number of 30 training epochs, a fixed training batch size of 64, an AdamW optimizer, and a cosine learning rate scheduler with a warmup ratio of 0.1. Notably, due to the supernet structure of GLoRA [6], we tested both training for 30 and 100 epochs. We conduct a grid search on the learning rate for both our method and baseline methods and report the best final test set's Top-1 classification accuracy after the final epoch. For BOFT and OFT, we additionally adopt a multiplicative dropout rate of 0.1 and apply a weight decay rate of 0.02. All methods are trained on a single NVIDIA A100-SXM4-80GB GPU. The exact learning rate details for OFT and BOFT can be found in Table 8.
+
+Table 7: Hyperparameter setup used for DeBERTaV3-base on the GLUE benchmark.
+
+
Dataset
Cifar100
Caltech101
DTD
Flowers102
Pets
SVHN
Sun397
Camelyon
EurosAT
Resic45
Retinopathy
Clevr-Count
Clevr-Dist
DMLab
KITTI-Dist
dSpr-Loc
dSpr-Ori
sNORB-Azim
sNORB-Ele
OFTb=16
8e-4
5e-4
6e-4
2e-3
3e-4
3e-3
1e-3
9e-4
9e-4
5e-4
1e-3
2e-4
4e-4
2e-3
1e-3
2e-3
3e-4
4e-3
6e-4
BOFTm=4b=4
8e-4
5e-4
6e-4
2e-3
3e-4
3e-3
1e-3
1e-3
6e-4
9e-4
2e-3
2e-4
3e-4
3e-3
9e-4
4e-3
5e-4
5e-3
8e-4
BOFTm=6b=2
8e-4
9e-4
1e-3
1e-3
8e-4
3e-3
1e-3
4e-3
9e-4
1e-3
2e-3
4e-4
4e-4
4e-3
3e-3
4e-3
8e-4
4e-3
9e-4
+
+Table 8: Hyperparameter setup (i.e., learning rate) used for DINOv2-large on the VTAB-1K benchmark.
+
+# A.3 EXPERIMENTAL DETAILS IN LLAMA FINETUNING
+
+In the Llama-related finetuning experiments, language understanding and mathematical question answering, we fixed the batch size as 64 and the training epoch as 2. For all the Lora, OFT, and BOFT experiments, we use the cosine learning scheduler and the warmup of the first 100 learning steps. We finetune the Llama model on the first generated 512 tokens, which is sufficient for these two tasks. We use the AdamW optimizer with a 1e-4 learning rate and 8e-4 learning rate for the language understanding task and mathematical question-answering task, respectively. The multiplicative dropout used for language understanding and mathematical question answering is 0.1 and 0.05,
+
+respectively. For language understanding, we evaluate the performance on MMLU with both zero-shot and 5-shot evaluation. For mathematical question answering, we basically follow the evaluation tools in MetaMathQA [91], where they use the Alpaca [80] prompt and evaluate the model in zero-shot. The generation temperature is set as 0 for both tasks.
+
+# A.4 EXPERIMENTAL DETAILS IN SAM FINETUNING
+
+We generally follow the training and evaluation settings as HQ-SAM [34]. Specifically, we use a learning rate of 0.0005, a cosine annealing learning rate scheduler, AdamW optimizer with a weight decay rate of 0.01 and a multiplicative dropout rate of 0.005. During fine-tuning, we keep the SAM model $[35]^3$ frozen.
+
+# A.5 EXPERIMENTAL DETAILS IN CONTROLNET AND DREAMBOOTH
+
+For our experiments on the ControlNet [96] and DreamBooth [74], we mainly follow the setting of OFT [67] but re-implement them using HuggingFace's Diffusers [85] and Parameter-Efficient Fine-Tuning (PEFT) $[55]^4$ . Specifically, we use Stable Diffusion [73] $(v2.1)^5$ as our pretrained model, and DDIMScheduler [76] as our scheduler function. The attached fine-tuned PEFT layers within UNet are $\{\text{to_q}, \text{to_v}, \text{to_k}, \text{query}, \text{value}, \text{key}\}$ . Both training and testing are conducted on NVIDIA A100-SXM4-80GB, memory efficient attention from xFormers [38] is employed. Some specific settings for ControlNet and DreamBooth are as follows:
+
+ControlNet We train ControlNet image encoder (lightweight 8-conv-layer network same as ControlLoRA [26]) and the attached PEFT layers within UNet, with the learning rate of 1e-5. Regarding the optimizer, we use AdamW with a weight decay as 1e-2, adam epsilon as 1e-8, and a constant learning rate scheduler. For datasets, we train Segmentation-to-Image (S2I) task on ADE20K [99, 100], and Landmark-to-Face (L2F) task on CelebV-HQ [101], both for 20 epochs, with 16 batch size. Specifically, we employ dropout $(p_2 = 0.1)$ and $\{\mathrm{PEFT}\}_{\text{only}}$ bias type on PEFT layers (BOFT, OFT, LoRA).
+
+DreamBooth Instead of fine-tuning text transformer [20, 37], we exclusively fine-tune the cross-attention layers (K, V, Q) of UNet with a learning rate of 3e-5, batch size of 4 for 2000 steps. Regarding the optimizer, we use AdamW with a weight decay as 1e-2 and Adam epsilon as 1e-8, a constant learning rate scheduler. Furthermore, we pre-generate 200 images conditioned on each class of input images, for prior preservation training weighted by 1.0. We use the same dataset as DreamBooth [74] with the resolution of 512. Same as ControlNet, we employ dropout $(p_2 = 0.1)$ and $\{\mathrm{PEFT}\}_{-\mathrm{only}}$ bias type on PEFT layers (BOFT, OFT, LoRA).
+
+More Results For ControlNet, apart from Landmark-to-Face (L2F) generation, we also benchmark different finetuning methods on Segmentation-to-Image (S2I) generation. The quantitative results are given in Table 9. Notably, these reported numbers represent the best possible results achieved by methods, across all variations of parameter configurations (#Param spans from 2M to 20M), trained for 20 epochs. We observe that different control task requires different finetuning flexibility and some control task may be easier than the
+
+
Task
Metric
LoRA
OFT
BOFT
# Params
2.52M
20.89M
20.76M
S2I
mIoU ↑
24.72
29.44
28.83
mAcc ↑
37.88
42.12
41.24
aAcc ↑
60.43
67.53
67.74
L2F
Error ↓
8.038
6.407
5.667
+
+Table 9: Quantitative evaluation of S21 and L2F. The best results are marked with "bold", and the second best results are marked with "underline".
+
+other. We find that the S2I task is generally easier than the L2F task and does not require strong finetuning flexibility. In the S2I task, the best performance of BOFT from 2M to 20M is similar to that of OFT. However, BOFT can still achieve better control performance than OFT given less amount of parameter budget, demonstrating its parameter efficiency.
+
+More qualitative results of ControlNet are shown in Figure 17 and Figure 16. Regarding DreamBooth, more subject-driven generations are shown from Figure 9 to Figure 15.
+
+# B MORE QUALITATIVE RESULTS ON HIGH-QUALITY SEGMENTATION
+
+
+Figure 11: More qualitative comparison of mask prediction between SAM and BOFT-SAM.
+
+# C MORE QUALITATIVE RESULTS IN SUBJECT-DRIVEN GENERATION
+
+
+Figure 12: Qualitative comparison of Subject-driven Generation.
+
+
+
+Text prompt: a [V] vase on a cobblestone street
+
+
+
+
+
+
+
+Text prompt: a [V] vase on top of the sidewalk in a crowded street
+
+
+
+
+
+
+
+Text prompt: a [V] vase on top of a white rug
+
+
+
+
+
+
+
+Text prompt: a [V] sneaker on top of a dirt road
+
+
+Input images
+
+
+
+
+
+
+
+Text prompt: a [V] sneaker on top of green grass with sunflowers around it
+
+
+
+
+
+
+
+Text prompt: a [V] sneaker with a city in the background
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+Figure 13: Qualitative comparison of Subject-driven Generation.
+
+
+
+Text prompt: a [V] glasses with a blue house in the background
+
+
+
+
+
+
+
+Text prompt: a [V] glasses with a mountain in the background
+
+
+
+
+
+
+
+Text prompt: a [V] glasses on top of a white rug
+
+
+
+
+
+
+
+Text prompt: a [V] toy on the beach
+
+
+Input images
+
+
+
+
+
+
+
+Text prompt: a shiny [V] toy
+
+
+
+
+
+
+
+Text prompt: a [V] toy with a wheat field in the background
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+Figure 14: Qualitative comparison of Subject-driven Generation.
+
+
+
+Text prompt: a [V] dog with a blue house in the background
+
+
+
+
+
+
+
+Text prompt: a [V] dog wearing a Santa hat
+
+
+
+
+
+
+
+Text prompt: a [V] dog on top of a purple rug in a forest
+
+
+
+
+
+
+
+Text prompt: [V] stuffed animal in the jungle
+
+
+Input images
+
+
+
+
+
+
+
+Text prompt: a [V] stuffed animal floating on top of water
+
+
+
+
+
+
+
+Text prompt: a wet [V] stuffed animal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+Figure 15: Qualitative comparison of Subject-driven Generation.
+
+# D MORE QUALITATIVE RESULTS IN CONTROLLABLE GENERATION
+
+
+GT
+
+
+Control signal
+
+
+Text prompt: a man with a beard
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a man with a beard
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a man with sunglasses on
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a man with grey hair and beards
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a man with long hair
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a man with wet hair
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a woman wearing sunglasses and holding a rose
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a woman wearing sunglasses and holding a rose
+Control signal
+Figure 16: More qualitative results in landmark-to-face generation.
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Control signal
+
+
+Text prompt: a house
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Control signal
+
+
+Text prompt: a brick building
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a building with stairs leading up to it
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: a thomas train at disneyland world
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Control signal
+
+
+I prompt: a man with a beard.
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Text prompt: people looking at an aquarium
+Control signal
+
+
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Control signal
+
+
+Text prompt: an empty room
+LoRA
+
+
+OFT
+
+
+BOFT
+
+
+GT
+
+
+Control signal
+Figure 17: More qualitative results in segmentation map-to-image generation.
+
+
+t prompt: a conference room
+LoRA
+
+
+OFT
+
+
+BOFT
+
+# E MATHEMATICAL QUESTION-ANSWERING CASE STUDY
+
+# Example E.1: Case Study 1
+
+Question: James buys 5 packs of beef that are 4 pounds each. The price of beef is $5.50 per pound. How much did he pay? (Ground-truth answer is 110)
+
+Llama-2 Answer: James bought 5 packs of beef that are 4 pounds each. The price of beef is $5.50 per pound. So he paid 5 * 4 * 5.50 = 137.50 dollars. The answer is 137.50.
+
+BOFT Answer: James bought 5 packs of beef, and each pack is 4 pounds, so he bought a total of $5 * 4 = 20$ pounds of beef. The price of beef is $5.50 per pound, so James paid 20 *$ 5.50 = $110. The answer is: 110
+
+# Example E.2: Case Study 2
+
+Question: James decides to run 3 sprints 3 times a week. He runs 60 meters each sprint. How many total meters does he run a week? (Ground-truth answer is 540)
+
+Llama-2 Answer: James runs 60 meters each sprint. So he runs $60 * 3 = 180$ meters each week. The answer is 180.
+
+BOFT Answer: James runs 3 sprints 3 times a week, so he runs 3 sprints x 3 times = 9 sprints in a week. Each sprint is 60 meters, so James runs 9 sprints x 60 meters = 540 meters in a week. Therefore, James runs a total of 540 meters in a week. The answer is: 540
+
+# Example E.3: Case Study 3
+
+Question: Carl buys ten packs of cookies. Each pack of cookies has six cookies inside. Each cookie costs $0.10. How much change does Carl receive if he pay with a $10 bill? (Ground-truth answer is 4)
+
+Llama-2 Answer: Carl buys ten packs of cookies. Each pack of cookies has six cookies inside. Each cookie cost $0.10. So he pays $10 for 60 cookies. Now he gets 60 * 0.10 = $6 change. The answer is $6.
+
+BOFT Answer: Carl buys ten packs of cookies, so he buys 10 * 6 = 60 cookies. The total cost of the cookies is 60 * $0.10 = $6. Carl pays with a $10 bill, so he receives $10 - $6 = $4 in change. The answer is: 4
+
+# Example E.4: Case Study 4
+
+Question: Miguel uses 2 pads of paper a week for his drawing. If there are 30 sheets of paper on a pad of paper, how many sheets of paper does he use every month? (Ground-truth answer is 240)
+
+Llama-2 Answer: Miguel uses 2 pads of paper a week. There are 30 sheets of paper on a pad of paper. So he uses $2 * 30 = 60$ sheets of paper every week. Now he uses $60 * 4 = 240$ sheets of paper every month. The answer is 240.
+
+BOFT Answer: Miguel uses 2 pads of paper a week, and there are 30 sheets of paper on a pad, so he uses 2 x $30 = 60$ sheets of paper every week. Since there are 4 weeks in a month, Miguel uses $60 \times 4 = 240$ sheets of paper every month. Therefore, Miguel uses 240 sheets of paper every month. The answer is: 240
+
+# Example E.5: Case Study 5
+
+Question: After transferring to a new school, Amy made 20 more friends than Lily. If Lily made 50 friends, how many friends do Lily and Amy have together? (Ground-truth answer is 120)
+
+Llama-2 Answer: Amy made 20 more friends than Lily. So Lily had $50 - 20 = 30$ friends. Amy had $30 + 20 = 50$ friends. So Lily and Amy have $50 + 50 = 100$ friends together. The answer is 100.
+
+BOFT Answer: If Lily made 50 friends, and Amy made 20 more friends than Lily, then Amy made $50 + 20 = 70$ friends. Together, Lily and Amy have $50 + 70 = 120$ friends. The answer is: 120
+
+# Example E.6: Case Study 6
+
+Question: After Andrea saved some money, she then spent the rest of her money on an $11 sweater and gave her brother$ 4. If she had $36 in the beginning, how much did Andrea save? (Ground-truth answer is 21)
+
+Llama-2 Answer: Andrea started with 36 dollars. She then saved some money. Then she spent the rest of her money on an $11 sweater and gave her brother $4. So she spent 36 - (saved money) - (sweater price) - (brother price) = 36 - 10 - 11 - 4 = 11 dollars. The answer is 11.
+
+BOFT Answer: After Andrea saved some money, she then spent the rest of her money on an $11 sweater and gave her brother $4. If she had $36 in the beginning, how much did Andrea save? Andrea saved $36 - $11 - $4 = $21 Therefore, Andrea saved $21. The answer is: 21
+
+# F PROOF OF THEOREM 1
+
+We first show that BOFT is always more expressive than OFT with the same block size. We write down the final orthogonal matrix in BOFT with block size $2b$ :
+
+$$
+\begin{array}{l} \boldsymbol {R} _ {\text {B O F T}} (m, b) = \prod_ {i = 1} ^ {m} \tilde {\boldsymbol {B}} ^ {b} \left(d, 2 ^ {m - i + 1}\right) \tag {3} \\ = \tilde {\boldsymbol {B}} ^ {b} (d, 2 ^ {m}) \dots \tilde {\boldsymbol {B}} ^ {b} (d, 2 ^ {2}) \cdot \tilde {\boldsymbol {B}} ^ {b} (d, 2 ^ {1}) \\ \end{array}
+$$
+
+where we can let $\tilde{B}^b (d,2^m),m\in [2,m]$ to be identity matrices. Then we have
+
+$$
+\begin{array}{l} \boldsymbol {R} _ {\mathrm {B O F T}} (m, b) = \underbrace {\tilde {\boldsymbol {B}} ^ {b} \left(d , 2 ^ {m}\right) \cdots \tilde {\boldsymbol {B}} ^ {b} \left(d , 2 ^ {2}\right)} _ {= I} \cdot \tilde {\boldsymbol {B}} ^ {b} (d, 2) \tag {4} \\ = \tilde {\boldsymbol {B}} ^ {b} (d, 2) \\ \end{array}
+$$
+
+which is an orthogonal matrix with the block size $2b$ . This is exactly the orthogonal matrix used in OFT with the block size $2b$ . Therefore, BOFT with $m > 1$ is always more expressive than OFT with the same block size. When $m = 1$ , BOFT reduces to OFT.
+
+Then we proceed to prove that the following expression can represent any orthogonal matrix:
+
+$$
+\boldsymbol {R} _ {\text {E x t}} = \boldsymbol {B} _ {d - 1, 1} (d) \boldsymbol {B} _ {d - 1, 2} ^ {\top} (d) \dots \boldsymbol {B} _ {1, 1} (d) \boldsymbol {B} _ {1, 2} ^ {\top} (d) \tag {5}
+$$
+
+where $B_{i,j}(d), \forall i, \forall j$ are butterfly matrices. $R_{\mathrm{Ext}}$ fall into the category of kaleidoscope matrices [14] (with the diagonal matrix being an identity). [14] has shown that the orthogonal kaleidoscope matrix can represent any orthogonal matrices. The overall proof idea is simple and can be given by the following two results from [14]:
+
+- Any orthogonal matrix can be represented by QR factorization which can be decomposed by $n - 1$ Householder reflections.
+- All Householder reflections can be represented by $\mathbf{B}_i(d)\mathbf{B}_i^\top (d)$ .
+
+Then we can easily arrive at the conclusion that $\pmb{R}_{\mathrm{Ext}}$ can represent any orthogonal matrix.
+
+# G MATHEMATICAL PROPERTIES OF BUTTERFLY MATRICES
+
+Due to its nice spectral and numerical properties, butterfly structures (especially random butterfly matrices) are introduced by [63] to remove the need of pivoting in Gaussian elimination. In this section, we discuss a few intriguing mathematical properties of butterfly matrices. Because orthogonal butterfly matrices are a special subset of the orthogonal matrices, they introduce additional inductive biases that help to further regularize the finetuned model. To gain a deeper understanding of the induced inductive biases, we delve into the mathematical properties of orthogonal butterfly matrices with the hope to understand the effect of such additional inductive biases. We note that these properties are natural and direct consequences of the established results in [64, 83]. For our results to be self-contained, we also provide the brief proof of the results here.
+
+# G.1 BALANCED ENTRY-WISE LEARNING RATE
+
+Butterfly matrices also have an interesting balanced learning rate property. We take 8-dimensional butterfly matrix as an example. Assume that we fill all the entries in each butterfly component with 1.
+
+$$
+\begin{array}{l} \left[ \begin{array}{c c c c c c c c} 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \end{array} \right]. \left[ \begin{array}{c c c c c c c c} 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 \end{array} \right]. \left[ \begin{array}{c c c c c c c c} 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{array} \right] \\ = \left[ \begin{array}{c c c c c c c c} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & \end{array} \right] \\ \end{array}
+$$
+
+which means that the butterfly matrix preserves the learning rate in each entry of the butterfly component. For block butterfly matrices, we consider the following example:
+
+$$
+\left[ \begin{array}{c c c c c c c c} 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\ 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \\ 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\ 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \end{array} \right]. \left[ \begin{array}{c c c c c c c c} 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \end{array} \right] = \left[ \begin{array}{c c c c c c c c} 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\ 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\ 2 & 2 & 2 & 2 & 2 & 2 & 2 \\ [ - ] {2} ^ {2} + [ - ] {2} ^ {3} + [ - ] {2} ^ {4} + [ - ] {2} ^ {5} + [ - ] {2} ^ {6} + [ - ] {2} ^ {7} + [ - ] {2} ^ {8} + [ - ] {2} ^ {9} + [ - ] {2} ^ {1} + [ - ] {2} ^ {2} + [ - ] {2} ^ {3} + [ - ] {2} ^ {4} + [ - ] {2} ^ {5} + [ - ] {2} ^ {6} + [ - ] {2} ^ {7} + [ - ] {2} ^ {8} + [ - ] {2} ^ {9} + [ - ] {2} ^ {1} + \end{array} \right]
+$$
+
+which shows that the product of all-one block butterfly components still have the balanced learning rate property. However, we also note that whenever we initialize a butterfly component, the elements are not the same (Each butterfly component is initialized as an identity matrix). While butterfly matrices have the property of balanced entry-wise learning rate, we note that the same property does not necessarily exist for general sparse matrix factorization.
+
+# G.2 AN ALTERNATIVE DEFINITION OF ORTHOGONAL BUTTERFLY MATRICES
+
+In the main paper, we define the butterfly matrices by first constructing the pattern of non-zero elements in each butterfly component and then constraining each block matrix as an orthogonal matrix. Alternatively, orthogonal butterfly matrices can also be defined in an reverse order by first constructing orthogonal matrices and then build the butterfly matrix from ground up.
+
+Definition 1 (Generalized Rotation Matrix). A generalized rotation matrix is a $N \times N$ matrix ( $N$ is even) of the following form:
+
+$$
+\left[ \begin{array}{l l} \boldsymbol {C} & \boldsymbol {S} \\ - \boldsymbol {S} & \boldsymbol {C} \end{array} \right], \tag {6}
+$$
+
+where $C$ and $S$ are commuting, symmetric real matrices of the size $\frac{N}{2} \times \frac{N}{2}$ , and $C^2 + S^2 = I$ . The scalar rotation matrices use scalar matrices $C, S$ . The diagonal rotation matrices use diagonal matrices $C, S$ .
+
+Definition 2 (Orthogonal Butterfly Matrix). An orthogonal butterfly matrix, denoted collectively as $\mathcal{OB}(N)$ , is an iteratively defined matrix of order $N = 2^n$ :
+
+$$
+\left[ \begin{array}{l l} C A _ {1} & S A _ {2} \\ - S A _ {1} & C A _ {2} \end{array} \right] = \left[ \begin{array}{c c} C & S \\ - S & C \end{array} \right] \cdot \left[ \begin{array}{l l} A _ {1} & 0 \\ 0 & A _ {2} \end{array} \right], \tag {7}
+$$
+
+where $A_1, A_2 \in \mathcal{OB}\left(\frac{N}{2}\right)$ , and $\begin{bmatrix} C & S \\ -S & C \end{bmatrix}$ is a generalized rotation matrix. An orthogonal butterfly matrix is simple if $A_1 = A_2$ at each iteration step, and is non-simple otherwise. When $N = 1$ , the orthogonal butterfly matrix is defined as 1.
+
+Definition 3 (Diagonal and Scalar Butterfly Matrix). The diagonal and scalar butterfly matrices are the orthogonal butterfly matrices constructed iteratively with diagonal and scalar rotation matrices, respectively. We denote the order- $N$ simple scalar butterfly matrices as $\mathcal{O}\mathcal{B}_s(N)$ . For $\pmb{B} \in \mathcal{O}\mathcal{B}_s(N)$ , we define $\pmb{B} = \mathcal{O}\mathcal{B}(\pmb{A},\theta)$ where $\pmb{A} = \mathcal{O}\mathcal{B}_s\left(\frac{N}{2}\right)$ if $\pmb{B}$ is of the following form:
+
+$$
+\begin{array}{l} \left[ \begin{array}{l l} \cos (\theta) \boldsymbol {A} & \sin (\theta) \boldsymbol {A} \\ - \sin (\theta) \boldsymbol {A} & \cos (\theta) \boldsymbol {A} \end{array} \right] = \left[ \begin{array}{l l} \cos (\theta) \boldsymbol {I} & \sin (\theta) \boldsymbol {I} \\ - \sin (\theta) \boldsymbol {I} & \cos (\theta) \boldsymbol {I} \end{array} \right] \cdot \left[ \begin{array}{l l} \boldsymbol {A} & \boldsymbol {0} \\ \boldsymbol {0} & \boldsymbol {A} \end{array} \right] \tag {8} \\ = \left[ \begin{array}{c c} \boldsymbol {A} & \boldsymbol {0} \\ \boldsymbol {0} & \boldsymbol {A} \end{array} \right] \cdot \left[ \begin{array}{c c} \cos (\theta) \boldsymbol {I} & \sin (\theta) \boldsymbol {I} \\ - \sin (\theta) \boldsymbol {I} & \cos (\theta) \boldsymbol {I} \end{array} \right]. \\ \end{array}
+$$
+
+We use $\mathcal{OB}(N)$ to denote the non-simple scalar butterfly matrices.
+
+We also define that
+
+$$
+\mathcal {O B} (\boldsymbol {\theta}) = \bigotimes_ {i = 1} ^ {n} \mathcal {O B} (n - i + 1) = \mathcal {O B} \left(\theta_ {n}\right) \otimes \dots \otimes \mathcal {O B} \left(\theta_ {1}\right). \tag {9}
+$$
+
+where $\otimes$ denotes the Kronecker product and $\mathcal{OB}(\theta_i) \in \mathrm{SO}(2)$ .
+
+Remark 1. We note that the butterfly matrices considered in the main paper is what we define as non-simple diagonal butterfly matrices here. Despite not directly discussing the properties of such family of butterfly matrices, we aim to provide some useful insights through a few necessary simplifications.
+
+# G.3 TOPOLOGICAL PROPERTIES
+
+Proposition 1 ([64]). $\mathcal{OB}(N)$ and $\mathcal{OB}_s(N)$ are compact spaces in $\mathrm{SO}(N)$ , which are homeomorphic to quotients of higher dimensional tori $\mathbb{T}^n$ and $\mathbb{T}^{N - 1}$ where $N = 2^n$ .
+
+Proposition 2 ([64]). The diagonal simple and non-simple butterfly matrices are compact spaces in $\mathrm{SO}(N)$ , which are homeomorphic to quotients of higher dimensional tori $\mathbb{T}^{N-1}$ and $\mathbb{T}^{\frac{1}{2} Nn}$ ( $N = 2^n$ ), respectively.
+
+These two propositions characterize the topological properties of orthogonal butterfly matrices. There are also many interesting group properties. For example, $\mathcal{OB}_s(N)$ is a compact abelian subgroup of $\mathrm{SO}(N)$ . These topological and group structures and connections provide many unique inductive biases for the orthogonal finetuning.
+
+# G.4 INPUT SENSITIVITY
+
+One interesting property to study for the butterfly matrices is how the input parameter changes the output matrix norm. Specifically, we can upper bound the difference between the input-perturbed butterfly matrix and the original butterfly matrix. Specifically, we have the following result from [64]:
+
+Proposition 3 (Upper Bound for Simple Scalar Butterfly Matrices). Let $\mathcal{OB}(\pmb{\theta}) \in \mathcal{OB}_s(N)$ and $\pmb{\epsilon} \in \mathbb{R}^n$ where $N = 2^n$ . Then we have that
+
+$$
+\left\| \mathcal {O B} (\boldsymbol {\theta}) - \mathcal {O B} (\boldsymbol {\theta} + \boldsymbol {\epsilon}) \right\| _ {F} \leq \sqrt {N} \| \boldsymbol {\epsilon} \| _ {1} \tag {10}
+$$
+
+Proposition 4 (Upper Bound for General Scalar Butterfly Matrices). Let $\mathcal{OB}(\pmb{\theta}) \in \mathcal{OB}(N)$ and $\epsilon \in \mathbb{R}^{N-1}$ . Then we have that
+
+$$
+\left\| \mathcal {O B} (\boldsymbol {\theta}) - \mathcal {O B} (\boldsymbol {\theta} + \boldsymbol {\epsilon}) \right\| _ {F} \leq \sqrt {N - 1} \| \boldsymbol {\epsilon} \| _ {2} \tag {11}
+$$
+
+The above two propositions show that the map $\pmb{\theta} \rightarrow \mathcal{OB}(\pmb{\theta})$ is Lipsshitz continuous.
+
+# G.5 RANDOM ORTHOGONAL BUTTERFLY MATRICES
+
+Definition 4 (Random Orthogonal Butterfly Matrix). A random orthogonal butterfly matrix is a butterfly matrix that is generated by random generalized rotation matrices with
+
+$$
+\Sigma := \left\{\boldsymbol {C} _ {j}, \boldsymbol {S} _ {j} \right\} _ {j \geq 1} \tag {12}
+$$
+
+which is an independent sequence of pairs of matrices. Each pair $\{C_j, S_j\}$ generates a random generalized rotation matrix of order $2^{j-1}$
+
+# H ILLUSTRATION OF BLOCK BUTTERFLY MATRICES
+
+We provide an illustration for block butterfly components and matrices in Figure 18.
+
+
+(a) 16-dimensional butterfly matrix with the block size 1
+
+
+
+
+
+
+
+
+(b) 8-dimensional butterfly matrix with the block size 2
+
+
+
+
+
+
+(c) 4-dimensional butterfly matrix with the block size 4
+
+
+Figure 18: Block butterfly components and matrices with the block size 1, 2 and 4.
+
+# I MORE RESULTS ON EXPRESSIVENESS OF BOFT
+
+We use a full dense orthogonal matrix to finetune DINOv2 on downstream tasks and then obtain such a dense orthogonal matrix (with 10 random seeds). We finally obtain 10 finetuned $1024 \times 1024$ dense orthogonal matrices and conduct the same experiment as Figure 5. The results in Figure 19 still validate that BOFT yields better expressiveness under the same number of parameters.
+
+
+Figure 19: Expressiveness of BOFT for learned dense orthogonal matrices (10 random seeds).
\ No newline at end of file
diff --git a/parameterefficientorthogonalfinetuningviabutterflyfactorization/images.zip b/parameterefficientorthogonalfinetuningviabutterflyfactorization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4e9cf704b3212558f6b308966a9583d81f357044
--- /dev/null
+++ b/parameterefficientorthogonalfinetuningviabutterflyfactorization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f93ea987805725c9ede188748ba8288bf1e46d264243489007c733d7f20161b5
+size 2824945
diff --git a/parameterefficientorthogonalfinetuningviabutterflyfactorization/layout.json b/parameterefficientorthogonalfinetuningviabutterflyfactorization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c1e220ce84123138b35ac28eca3b9b8d711002ff
--- /dev/null
+++ b/parameterefficientorthogonalfinetuningviabutterflyfactorization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0bec56eae4c39670bf04f90b90e7a8edefbf65ad9502c6e962ee034311700ed5
+size 1483895
diff --git a/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_content_list.json b/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1c8f09956edc108e46f4d798fea40145032def8b
--- /dev/null
+++ b/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54c123a26ce467034e0b740baa3a879f3bcb9f70c9bcdd46ce596618b0082afe
+size 187704
diff --git a/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_model.json b/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..546d57da936abdceef5d262e7ea0801be3d221f5
--- /dev/null
+++ b/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:83f864acfbc9fdf8ffb34463b3d62adc1eae5435252f7d962903ce4c87ab3aa5
+size 218038
diff --git a/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_origin.pdf b/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..865b4f1534e1098918e4da3fe1c5d1878585e741
--- /dev/null
+++ b/parametricaugmentationfortimeseriescontrastivelearning/00086be0-db4b-490d-9a22-8b78a9fb8a78_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7bfb7d373271f535b0bba4e2e68e4f939e30a92237afa515f467bb64a748afd5
+size 1633611
diff --git a/parametricaugmentationfortimeseriescontrastivelearning/full.md b/parametricaugmentationfortimeseriescontrastivelearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0e9b1082d3d90a3b13beddaae318046bf177da57
--- /dev/null
+++ b/parametricaugmentationfortimeseriescontrastivelearning/full.md
@@ -0,0 +1,593 @@
+# PARAMETRIC AUGMENTATION FOR TIME SERIES CONTRASTIVE LEARNING
+
+Xu Zheng $^{1}$ , Tianchun Wang $^{2}$ , Wei Cheng $^{3}$ , Aitian Ma $^{1}$ , Haifeng Chen $^{3}$ , Mo Sha $^{1}$ , Dongsheng Luo $^{1\boxtimes}$
+
+$^{1}$ School of Computing and Information Sciences, Florida International University, US
+$^{2}$ College Information Sciences and Technology, The Pennsylvania State University, US
+$^{3}$ NEC Laboratories America, US
+
+{xzhen019,aima,msha,dluo}@fiu.edu
+
+tkw5356@psu.edu,
+
+{weicheng,haifeng}@nec-labs.com
+
+# ABSTRACT
+
+Modern techniques like contrastive learning have been effectively used in many areas, including computer vision, natural language processing, and graph-structured data. Creating positive examples that assist the model in learning robust and discriminative representations is a crucial stage in contrastive learning approaches. Usually, preset human intuition directs the selection of relevant data augmentations. Due to patterns that are easily recognized by humans, this rule of thumb works well in the vision and language domains. However, it is impractical to visually inspect the temporal structures in time series. The diversity of time series augmentations at both the dataset and instance levels makes it difficult to choose meaningful augmentations on the fly. In this study, we address this gap by analyzing time series data augmentation using information theory and summarizing the most commonly adopted augmentations in a unified format. We then propose a contrastive learning framework with parametric augmentation, AutoTCL, which can be adaptively employed to support time series representation learning. The proposed approach is encoder-agnostic, allowing it to be seamlessly integrated with different backbone encoders. Experiments on univariate forecasting tasks demonstrate the highly competitive results of our method, with an average $6.5\%$ reduction in MSE and $4.7\%$ in MAE over the leading baselines. In classification tasks, AutoTCL achieves a $1.2\%$ increase in average accuracy. The source code is available at https://github.com/AslanDing/AutoTCL.
+
+# 1 INTRODUCTION
+
+Time series data is complex and high-dimensional, making it more difficult to gather the label than images or languages. This property hinders the deployment of powerful deep learning methods, which typically require a large amount of labeled data for training(Eldele et al., 2021). Self-supervised learning is a promising solution due to its capacity to learn from unlabelled data. Self-supervised learning methods learn a fixed-dimension embedding of the time series data that preserves its inherent features with better transferability and generalization capacity. A representative framework, contrastive learning, has been successful in representation learning for various types of data including vision, language, and graphs(Chen et al., 2020; Xie et al., 2020; You et al., 2020). These methods train an encoder to map instances to an embedding space where similar instances (positive pairs) are easily distinguished from dissimilar ones (negative pairs). As a result, model predictions are unaffected by minor noise introduced into the inputs or hidden states. As a key component, data augmentation such as jittering, scaling, permutation, and subsequence extraction (Fan et al., 2020; Wen et al., 2021), is usually adopted to produce positive pairs.
+
+Recently, some efforts have been made to develop contrastive learning methods for time series data (Eldele et al., 2021; Franceschi et al., 2019; Fan et al., 2020; Tonekaboni et al., 2021). However,
+
+due to the diversity and variability of real-world time series data, it is challenging to apply a general augmentation technique to all datasets. As a result, current approaches to contrastive learning for time series data frequently need particular data augmentation techniques that are guided by domain knowledge and necessitate trial and error to identify the most appropriate augmentations. Attempts have recently been made to study the theory behind adaptive augmentation selection for contrastive learning (Tian et al., 2020; Suresh et al., 2021; Xu et al., 2021). Good augmentations, according to InfoMin (Tian et al., 2020), produce label-preserving views with less shared information. They discover the best perspectives through adversarial training in unsupervised or self-supervised environments by adding an invertible flow-based generative model. The InfoMin principle performs well in the vision area and has been successfully applied to graph-structured data (Xu et al., 2021; Suresh et al., 2021; Yin et al., 2022; You et al., 2022). However, in a self-supervised environment, most existing studies soften the label-preserving property and place a more significant emphasis on enhancing diversity by reducing the exchange of information between different views. They frequently use stronger transformers as augmentations and undermine the semantics, which is inapplicable to time series data.
+
+To accommodate various augmentation tactics for time series contrastive learning, we investigate the data augmentation for time series from the information theory perspective and provide a theoretically sound definition of good augmentations based on input factorization. We further present a contrastive learning framework with parametric augmentation, AutoTCL, to adaptively augment data for contrastive time series learning based on the proposed factorization technique, which can prevent ad-hoc decisions or laborious trial-and-error tuning. Specifically, we utilize a parametric neural network to learn to factorize an instance into two parts: the informative part and the task-irrelevant part. The informative component is then applied to a lossless transform function which keeps the instance's semantics. The adaptive transformation produces a prior mask for the input instance to generate workable positive samples. We demonstrate how the most effective time series data augmentation methods can be viewed as specialized forms of the suggested mask-based transformation. By including another random variable with adequate variance, the diversity of the augmented view is further increased. In order to learn representations through contrast, augmented pairs are then fed into a time series encoder along with randomly chosen negative pairings. Parameters in the factorization and transform functions are optimized in tandem with contrastive learning loss. Our main contributions are summarized as follows.
+
+- We introduce a novel factorization-based framework to guide data augmentations for contrastive self-supervised learning without prefabricated knowledge.
+- To automatically learn workable augmentations for time series data, we provide a straightforward yet effective instantiation that can handle a variety of frequently applied augmentations.
+- With comprehensive experimental studies, we empirically verify the advantage of the proposed method on benchmark time series forecasting datasets. We achieve highly competitive performances with a $6.5\%$ reduction in MSE, $4.7\%$ in MAE on univariate forecasting, a $2.9\%$ reduction in MSE, and $1.2\%$ in MAE on multivariate forecasting. In classification tasks, our method achieves a $1.2\%$ increase in average accuracy.
+
+# 2 RELATED WORK
+
+Contrastive learning for time series. Contrastive learning has been widely used in representation learning, achieving superior results across various domains (Chen et al., 2020; Xie et al., 2020; You et al., 2020). Recently, there have been efforts to apply contrastive learning to the time series domain (Khaertdinov et al., 2021; Oord et al., 2018; Franceschi et al., 2019; Fan et al., 2020; Eldele et al., 2021; Tonekaboni et al., 2021; Yue et al., 2022; Yang & Hong, 2022). In (Franceschi et al., 2019), Franceschi et al. utilize subsequences to generate positive and negative pairs. TNC uses a debiased contrastive objective to make sure that in the representation space, signals from the local neighborhood are distinct from those that are not neighbors (Tonekaboni et al., 2021). TS2Vec uses hierarchical contrastive learning to acquire a representation for each time stamp (Yue et al., 2022). TF-C utilizes the distance between time and frequency components as the self-supervised signal for representation learning. Each component is independently optimized by contrastive estimation (Zhang et al., 2022). In (Nonnenmacher et al., 2022), the authors introduce an approach that incorporates expert knowledge into time-series representation learning using expert features, surpassing existing
+
+methods in unsupervised and semi-supervised learning on real-world datasets. CLUDA (Ozyurt et al., 2023), a novel framework for unsupervised domain adaptation of time series data, utilizes contrastive learning to learn contextual representations that preserve label information, achieving state-of-the-art performance in time series unsupervised domain adaptation.
+
+Adaptive data augmentation. Data augmentation is a crucial aspect of contrastive learning. Previous studies have shown that the choice of optimal augmentation methods depends on the specific task and dataset being used (Chen et al., 2020; Fan et al., 2020). Some studies have explored the adaptive selection of augmentation methods in the visual domain Tamkin et al. (2021); Cubuk et al. (2019); Hataya et al. (2020); Li et al. (2020); Tian et al. (2020); Rommel et al. (2022); Aboussalah et al. (2023); Ho et al. (2019). For example, AutoAugment (Cubuk et al., 2019) uses a reinforcement learning method to search for the best combination of policies. Later, CADDA investigates a gradient-based class-wise method to support larger search spaces for EGG signals (Rommel et al., 2022). DACL adopts a domain-agnostic approach that does not rely on domain-specific data augmentation techniques (Verma et al., 2021). MetAug (Li et al., 2022) and Hallucinator (Wu et al., 2023) aim to generate augmentations in the latent space. In the contrastive learning frameworks, the InfoMin theory is applied to guide the selection of good views for contrastive learning in the vision domain (Tian et al., 2020), it further proposes a flow-based generative model to transfer images from natural color spaces into novel color spaces for data augmentation.
+
+However, given the complexity of time series data, directly applying the InfoMin framework may not be suitable. Different from previous works, our focus is on the time series domain and we propose an end-to-end differentiable method to automatically learn the optimal augmentations for each time series instance.
+
+Time series forecasting. Forecasting is an essential component of time series analysis, and various deep learning architectures have been employed in the literature, such as MLP (Ekambaram et al., 2023), Recurrent Neural Networks (RNNs) (Salinas et al., 2020; Oreshkin et al., 2020), Convolutional Neural Networks (CNNs) (Bai et al., 2018; Zhang et al., 2023b), Transformers (Li et al., 2019; Zhou et al., 2021; Lin et al., 2023; Yu et al., 2023; Nie et al., 2023; Zhang et al., 2023a), and Graph Neural Networks (GNNs) for this task (Cao et al., 2020). In contrast to these works, the aim of our research is to learn general representations for time series data that can be applied not only to forecasting but also to other tasks, such as classification. Additionally, the proposed framework is designed to be compatible with multiple types of architectures as encoders.
+
+# 3 METHODOLOGY
+
+In this section, we first describe the notations used in this paper. Then, we try to answer the following research questions. (1) What are the good views for contrastive learning in the self-supervised setting? (2) How to obtain good views for each time series instance for contrastive learning?
+
+# 3.1 NOTATIONS
+
+We use a $T \times F$ matrix to represent a time series instance $x$ , where $T$ is the length of its sequence and $F$ is the dimension of features. With $F > 1$ , $x$ is a multivariate time series instance. Otherwise, with $F = 1$ , $x$ is a single variate instance. Self-supervised contrastive learning aims to learn an encoder $f$ that maps $x$ from $\mathbb{R}^{T \times F}$ to a vector space $\mathbb{R}^D$ , where $D$ is the dimension of embedding vectors. In the paper, to distinguish random variables and instances, we use the Sans-serif style lowercase letters, such as $\times$ , to represent random time series variables, and italic lowercase letters, such as $x$ , for real instances. Important notations are summarized in Appendix.
+
+# 3.2 WHAT MAKES GOOD VIEWS FOR CONTRASTIVE SELF-SUPERVISED LEARNING?
+
+In the literature, a well-accepted intuitive principle for view generation is that good views preserve the semantics and provide sufficient variances (Tian et al., 2020; Yin et al., 2022; Suresh et al., 2021). In the supervised setting, where training labels are available, the semantics of an instance is usually approximated with the label. On the other hand, semantics-preserving is much less explored in the more popular self-supervised learning. Moreover, while the semantics of images and natural
+
+language sentences can be manually verified, the underlying semantics of time series data are not easily recognizable to humans. This makes it challenging, if not impossible, to apply strong yet faithful data augmentations to such data. To avoid the degenerate solutions caused by dismissing the semantics-preserving, InfoMin utilizes an invertible flow-based function, denoted by $g$ , to generate a view $v$ for an input $x$ (Tian et al., 2020). Such that $x$ can be restored by $x = g^{-1}(v)$ . However, from the information theory perspective, invertible functions fail to include extra variance to the original variable. Formally, we have the following property.
+
+Property 1. If view $\mathsf{v}$ is generated from $\times$ with an invertible function $\nu = g(\times)$ . Then $H(\mathsf{v}) = H(\mathsf{x}) = MI(\mathsf{x};\mathsf{v})$ , where $H(\mathsf{x}), H(\mathsf{v})$ are entropy of variables $\times$ and $\mathsf{v}$ , respectively; $MI(\mathsf{v};\mathsf{x})$ is mutual information between $\mathsf{v}$ and $\mathsf{x}$ .
+
+The detailed proof can be found in the Appendix. This property shows that the entropy of the augmented view, $H(\mathsf{v})$ , is no larger than that of original data, $H(\mathsf{x})$ , indicating that the existing data augmentation methods don't bring new information for input instances, which limits their expressive power for time series contrastive learning. To address the challenge and facilitate powerful self-supervised learning in the time series domain, we propose a novel factorized augmentation technique. Specifically, given an instance $x$ , we assume that $x$ can be factorized into two parts, informative $x^{*}$ and task-irreverent part $\Delta x$ . Formally,
+
+$$
+x = x ^ {*} + \Delta x. \tag {1}
+$$
+
+As the informative part, $x^{*}$ encodes the semantics of the original $x$ . Motivated by the intuitive principle, we formally define good views for contrastive learning as follows.
+
+Definition 1 (Good View). Given a random variable $\times$ with its semantics $\times^*$ , a good view $\mathbf{v}$ for contrastive learning can be achieved by $\mathbf{v} = \eta(g(\mathbf{x}^*), \Delta \mathbf{v})$ , where $g$ is an inverible function, $\Delta \mathbf{v}$ is a task-irrelevant noise, satisfying $H(\Delta \mathbf{v}) \geq H(\Delta \mathbf{x})$ , and $\eta$ is an augmentation function that satisfies that $g(\mathbf{x}^*) \to \mathbf{v}$ is a one-to-many mapping.
+
+Intuitively, a good view, based on our definition, maintains the useful information in the original variable and at the same time, includes a larger variance to boost the robustness of encoder training. We theoretically show that the defined good view has the following properties.
+
+Property 2 (Task Agnostic Label Preserving). If a variable $\vee$ is a good view of $\times$ , and the downstream task label $\mathsf{y}$ (although not visible to training) is independent to noise in $\times$ , the mutual information between $\mathsf{v}$ and $\mathsf{y}$ is equivalent to that between raw input $\times$ and $\mathsf{y}$ , i.e., $MI(\mathsf{v};\mathsf{y}) = MI(\mathsf{x};\mathsf{y})$ .
+
+Property 3 (Containing More Information). A good view $\mathsf{v}$ contains more information comparing to the raw input $\times$ , i.e., $H(\mathsf{v}) \geq H(\mathsf{x})$ .
+
+Detailed proofs are given in the appendix. These properties show that in the self-supervised setting, adopting a good view for contrastive learning theoretically guarantees that we will not decrease the fidelity, regardless of the downstream tasks. Simultaneously, the good view is flexible to the choice of $\Delta v$ , meaning that strong augmentations may be utilized to incorporate enough diversity for training.
+
+# 3.3 HOW TO ACHIEVE GOOD VIEWS?
+
+The theoretical analysis suggests a factorized augmentation to preserve task-agnostic labels and improve the diversity of views. In this part, we introduce a practical instantiation to obtain good views based on parametric augmentations as demonstrated in Fig. 1. First, a factorization function $h: \mathbb{R}^{T \times F} \to \{0,1\}^{T \times 1}$ is introduced to discover where are the informative parts in input. Formally1,
+
+$$
+\boldsymbol {h} = h (x), \quad x ^ {*} = \boldsymbol {h} \odot x, \quad \Delta x = x - x ^ {*}, \tag {2}
+$$
+
+where $\pmb{h}$ is the factorization mask, $x^{*}$ is the informative component, and $\Delta x$ is the noise component. $\odot$ is a generalized Hadamard product operation performed between two vectors(matrices). When the inputs both are vectors, denoted as $\pmb{v}$ and $\pmb{m}$ , the expression $\pmb{v} \odot \pmb{m}$ refers to the element-wise product. In the case where the first operand is a vector $\pmb{v} \in \mathbb{R}^{N}$ and the second operand is a matrix $M \in \mathbb{R}^{N \times M}$ , the procedure involves duplicating $\pmb{v}$ to form a matrix $V \in \mathbb{R}^{N \times M}$ and then
+
+
+Figure 1: The framework of our AutoTCL. The augmentation network extracts the informative part from the original instance and losslessly transforms it to $v^{*}$ . The encoder network is optimized with the contrastive objective.
+
+applying the standard Hadamard product to $V$ and $M$ . If both inputs are matrices of the same shape, the symbol $\odot$ signifies the standard Hadamard product. For the invertible transformation function applied on $x^{*}$ , we present a mask-based instantiation. More sophisticated mechanisms, such as normalizing flows (Kobyzev et al., 2020; Wang et al., 2023), can also be used as plug-and-play components. Specifically, we introduce a non-zero mask $g \in \mathbb{R}_{\neq 0}^T$ to form the transformation, such that $v^{*} = g \odot x^{*}$ . It is easy to show that such a non-zero mask transformation is lossless as the original $x^{*}$ can be restored by $x^{*} = \frac{1}{g} \odot v^{*}$ . Due to the varied nature of time series instances, which might differ even within a dataset, it is impractical to have a universal mask that applies to all instances. For instance, the cutout and jitter transform might not work well for the same time series data. To ensure each instance has a suitable transform adaptively, a parametric mask generator, denoted by $g: \mathbb{R}^{T \times F} \to \mathbb{R}_{\neq 0}^T$ , is proposed to generate the non-zero mask by learning for lossless transformation through a data-driven approach. Formally, $g = g(x)$ . Then a good view $v$ for contrastive learning can be represented as follows by integrating the factorization function, the mask generator, and introducing random noise for perturbation $(\Delta v)$ .
+
+$$
+\begin{array}{l} v = \eta (v ^ {*}, \Delta v) = \eta (\boldsymbol {g} \odot x ^ {*}, \Delta v) \\ = \eta (g (x) \odot h (x) \odot x, \Delta v). \tag {3} \\ \end{array}
+$$
+
+Relationship to existing augmentations for time series. Various types of data augmentation techniques have been applied to enhance the performance of deep learning on time series data (Wen et al., 2021; Yue et al., 2022; Fan et al., 2020), including time domain, frequency domain, and their hybrids. Our instantiation can be considered a general augmentation framework in the time domain. Most existing augmentation operations in this category, such as cropping, flipping, scaling, and jittering can be unified in our framework. For example, by setting $\eta(v^{*}, \Delta v) = v^{*}$ , cropping, which deletes a subsequence, can be achieved by letting $g = \mathbb{1}$ and the cropping time steps in $h$ be 0; scaling, which multiplies the input time series by a scaling factor, either a constant or being sampled from a Gaussian distribution, can also be obtained by setting $h = \mathbb{1}$ and $g$ being the scaling factor.
+
+Practical instantiation with augmentation neural network. According to the Universal Approximation Theorem (Chapter 6 in (Goodfellow et al., 2016)), we implement $g(x)$ and $h(x)$ with neural networks, respectively. We first utilize the same input layer and a stacked dilated CNN module (Franceschi et al., 2019; Yue et al., 2022) for both $g(x)$ and $h(x)$ , respectively. Then, we include two projector heads, a factorization head for $h(x)$ , and an transformation head for $g(x)$ . The architecture of the overall augmentation network is shown in Fig. 1. To ensure the binary output of the factorization function $h(x)$ , we introduce a stochastic mechanism following the factorization head. Specifically, we assume that each element in the output $h$ , denoted by $h_i$ , is drawn from a Bernoulli distribution parameterized by $\pi_i$ , which is calculated by the factorization head.
+
+To enable efficient optimization with gradient-based methods, we approximate the discrete Bernoulli processes with hard binary concrete distributions (Louizos et al., 2018). Specifically, we first draw $\tilde{h}_i$ from a binary concrete distribution with $\pi_i$ indicating the location (Maddison et al., 2017; Jang et al.,
+
+2017). Formally,
+
+$$
+\tilde {h} _ {i} = \sigma \left(\left(\log \epsilon - \log (1 - \epsilon) + \log \frac {\pi_ {i}}{1 - \pi_ {i}}\right) / \tau\right), \tag {4}
+$$
+
+where $\epsilon \sim \mathrm{Uniform}(0,1)$ is an independent variable, $\sigma (\cdot)$ is the sigmoid function, and $\tau$ is the temperature. The output of the binary concrete distribution is in the range of (0,1). To further facilitate the binary selection, we stretch $\tilde{h}_i$ the range to $(\gamma ,\zeta)$ , with $\gamma < 0$ and $\zeta >1$ . Then, the final masking element $h_i$ is obtained by clipping values to the range [0, 1]. Formally,
+
+$$
+h _ {i} = \min (1, \max (\tilde {h} _ {i} (\zeta - \gamma) + \gamma , 0)). \tag {5}
+$$
+
+$\eta(v^{*}, \Delta v)$ as random timestamp masking. To increase the variance of augmented views, inspired by Dropout (Srivastava et al., 2014) and TS2Vec (Yue et al., 2022), we implement the function $\eta(v^{*}, \Delta v)$ by randomly masking the hidden representation. Specifically, given a latent vector of a view $v$ , after the first hidden layer, we randomly mask it along the time dimension with a binary vector. Each element is sampled independently from a Bernoulli distribution, $\mathrm{Bern}(0.5)$ .
+
+# 3.4 TRAINING ALGORITHM
+
+There are two parametric neural networks to be optimized in the proposed framework, i.e., the encoder and the augmentation networks. The augmentation network aims to generate good views with high diversities, and the encoder is trained with a contrastive learning objective. Our method is used as plug and play component and can be used in a wide range of contrastive learning frameworks, such as TS2Vec (Yue et al., 2022) and CoST (Woo et al., 2022). In this section, we first introduce a new objective to train the augmentation network followed by the alternating training of encoder and augmentation networks.
+
+Training the augmentation network with the principle of relevant information. Existing optimization techniques for the learnable augmentation and the encoder generally follow the principle of Information Bottleneck (IB) (Tishby et al., 2000), which aims to achieve sufficient and minimal representations (Tian et al., 2020; Yin et al., 2022; Suresh et al., 2021). However, IB relies on the class labels from the downstream task, making it unsuitable for self-supervised training where there are few or no labels. Instead of following previous works that adversarially train the encoder and augmentation networks, which may fail to preserve the semantics in time series data, we train the augmentation network based on the Principle of Relevant Information (PRI) (Principe, 2010). Unlike supervised IB which relies on another variable as well as their joint distributions, PRI only exploits the self-organization of a random variable, making it fully unsupervised. Specifically, with PRI training the augmentation network, we aim to achieve a reduced statistical representation $\mathbf{v}^*$ by minimizing the following function.
+
+$$
+\beta H \left(\mathrm {v} ^ {*}\right) + D \left(P _ {\mathrm {x}} \mid \mid P _ {\mathrm {v} ^ {*}}\right), \tag {6}
+$$
+
+where $\beta$ is the trade-off hyper-parameter, $H(\mathbf{v}^{*})$ is the entropy of representation variable $\mathbf{v}^{*}$ , and $D(P_{\mathbf{x}}||P_{\mathbf{v}^{*}})$ is the divergence between distributions of the original variable $\mathbf{x}$ and transformed variable $\mathbf{v}^{*}$ . The minimization of $H(\mathbf{v}^{*})$ aims to reduce uncertainty and obtain statistical regularity in $\mathbf{v}^{*}$ and the second term is for preserving the descriptive power of $\mathbf{v}^{*}$ about $\mathbf{x}$ .
+
+Given an instance $x$ , the transformed informative part $v^{*}$ is obtained by applying a binary factorization mask $h \in \{0,1\}^T$ on $x$ and then an invertible transformation function, thus, minimizing the first term in Eq. (6), $H(\mathbf{v}^{*})$ , can be achieved by minimizing the number of non-zero elements in the factorization mask, i.e. $||h||_0$ . According to the calculation of $h$ in Eq. (5), we have
+
+$$
+\left| \left| \boldsymbol {h} \right| \right| _ {0} = \sum_ {t = 1} ^ {T} \left(1 - \sigma \left(\tau \log \frac {- \gamma \left(1 - \pi_ {t}\right)}{\zeta \pi_ {t}}\right)\right). \tag {7}
+$$
+
+To preserve the descriptive power of $\mathsf{v}^*$ about $\mathbf{x}$ , we follow existing works and estimate the second term $D(P_{\mathbf{x}}||P_{\mathbf{v}^{*}})$ with the maximum mean discrepancy, $\mathrm{MMD}(P_{\mathbf{x}},P_{\mathbf{v}^{*}})$ (Gretton et al., 2012). In practice, given a mini-batch of samples, $\mathbb{X}$ , and its associated view set $\mathbb{V}^*$ , we first compute the embeddings by passing all instances from $\mathbb{X}$ through the function $f$ . The same procedure applies to $\mathbb{V}^*$ . Then, the loss function to train the augmentation network is shown as follows,
+
+$$
+\mathcal {L} _ {\mathrm {P R I}} = \frac {1}{| \mathbb {X} |} \sum_ {x \in \mathbb {X}} \beta \| \boldsymbol {h} ^ {(x)} \| _ {0} + \| \frac {1}{| \mathbb {X} |} \sum_ {x \in \mathbb {X}} f (x) - \frac {1}{| \mathbb {V} ^ {*} |} \sum_ {v ^ {*} \in \mathbb {V} ^ {*}} f (v ^ {*}) \| ^ {2}. \tag {8}
+$$
+
+Regularization of temporal consistency. As shown in previous studies (Luo et al., 2023), informative signals tend to be continuous. Thus, we include regularization of temporal consistency when generating the factorization mask. Specifically, given a batch $\mathbb{X}$ , for each instance $x\in \mathbb{X}$ , we randomly select a time point $a$ as the anchor. Then we randomly select a time point $p$ from the left or right position of $a$ to create a positive pair $(a,p)$ . Their mask values $h_a^{(x)}$ and $h_p^{(x)}$ should be similar, compared to another point $n$ that is far away from $a$ , whose mask value is denoted by $h_n^{(x)}$ . Formally, we have the following triplet loss.
+
+$$
+\mathcal {L} _ {\mathrm {t}} = \frac {1}{| \mathbb {X} |} \sum_ {x \in \mathbb {X}} \left(\left| h _ {a} ^ {(x)} - h _ {p} ^ {(x)} \right| - \left| h _ {a} ^ {(x)} - h _ {n} ^ {(x)} \right|\right). \tag {9}
+$$
+
+With a trade-off parameter $\lambda$ , the final augmentation network loss could be formulated as:
+
+$$
+\mathcal {L} _ {\mathrm {a u g}} = \mathcal {L} _ {\mathrm {P R I}} + \lambda \mathcal {L} _ {\mathrm {t}} \tag {10}
+$$
+
+Alternative Training. To train encoder and augmentation networks, we follow GAN (Goodfellow et al., 2020) to use an alternating training schedule that trains the encoder network $M$ times and then trains the augmentation network one time. $M$ is a hyper-parameter determined by grid search.
+
+# 4 EXPERIMENTS
+
+We compare AutoTCL with extensive baselines on both forecasting and classification tasks. We also conduct ablation studies to show insights into each component in AutoTCL. Detailed experimental setups, full experimental results, and extensive experiments are presented in the Appendix.
+
+# 4.1 TIME SERIES FORECASTING
+
+Datasets and baselines. Six benchmark datasets, ETTh1, ETTh2, ETTm1, (Zhou et al., 2021), Electricity (Dua & Graff, 2017), Weather $^2$ , and Lora dataset are adopted for time series forecasting in both univariate and multivariate settings. Lora dataset is a new introduced real-world dataset that captures the wireless signal data using the LoRa devices $^3$ . It contains 74 days of data with timestamps. The proposed AutoTCL model is compared to representative state-of-the-art methods such as TS2Vec (Yue et al., 2022), Informer (Zhou et al., 2021), StemGNN (Cao et al., 2020), TCN (Bai et al., 2018), LogTrans (Li et al., 2019), LSTnet (Lai et al., 2018), CoST (Woo et al., 2022), TNC(Tonekaboni et al., 2021), TS-TCC (Eldele et al., 2021), InfoTS (Luo et al., 2023) and N-BEATS (Oreshkin et al., 2020), with N-BEATS being exclusive to univariate forecasting and StemGNN to multivariate.
+
+Setup. We follow CoST (Woo et al., 2022) network architecture. A multi-layer dilated CNN module is used for the backbone and we remove the seasonal feature disentangler module. The Augmentation network has the same feature extract architecture and two projectors as shown in Fig. 1. In addition, the proposed AutoTCL is a general contrastive learning framework that can also be combined with more recent methods, such as BTSF (Yang & Hong, 2022), TF-C (Zhang et al., 2022), and LsST (Wang et al., 2022) to further improve accuracy performances. We leave this as our future work. Time series forecasting aims to predict future time stamps, using the last $L_{x}$ observations. Following the method presented in (Yue et al., 2022), a linear model regularized with L2 norm penalty, is trained to make predictions. Specifically, After pretraining by contrastive learning, the encoder network will be frozen in the following fine-tuning. A linear model is used to map representations to results. The linear model is trained by Linear least squares with l2 regularization in the package sk-learn Pedregosa et al. (2011). We use the default setting during training. This part is kept the same for other competing methods for a fair comparison. In the univariate case, the model's output has a dimension of $L_{y}$ , while in the multivariate case, it has a dimension of $L_{y} \times F$ . The evaluation is based on standard regression metrics, Mean Squared Error (MSE), and Mean Absolute Error (MAE). To comprehensively evaluate the performances, we consider different prediction lengths, $L_{y}$ .
+
+Results. For each dataset, we calculate the average forecasting performances in both univariate and multivariate settings. The results are shown in Table 1 and Table 2, respectively. The detailed results of univariate and multivariate time series forecasting can be found in Table 10 and Table 11 in the Appendix. From these tables, we have several observations. First, in general, contrastive learning methods, including AutoTCL, TS2vec, CoST, and InfoTS, achieve better performances compared to traditional baselines, indicating the effectiveness of contrastive learning for learning time series representations. Second, the consistent improvement of our method over CoST indicates that universal data augmentations may not be the most informative for generating positive pairs in various datasets. Specifically, Compared to CoST, AutoTCL decreases both MAE and MSE in all datasets in the univariate setting. On average, AutoTCL decreases the average MSE by $6.5\%$ and the average MAE by $4.8\%$ in the univariate setting. This is because AutoTCL can adaptively learn the most suitable augmentations in a data-driven manner, preserving semantics and ensuring sufficient variance. Encoders trained with these informative augmentations lead to representations with higher quality. In the multivariate setting, AutoTCL outperforms CoST in 7 cases. On average, it decreases the average MSE by $2.9\%$ and the average MAE by $1.2\%$ .
+
+Table 1: Univariate time series forecasting results.
+
+
Dataset
AutoTCL
TS2Vec
Informer
LogTrans
N-BEATS
TCN
CoST
TNC
TS-TCC
InfoTS
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
\( \text{ETTh}_1 \)
0.076
0.207
0.110
0.252
0.186
0.347
0.196
0.365
0.218
0.375
0.263
0.431
0.091
0.228
0.150
0.303
0.168
0.316
0.091
0.227
\( \text{ETTh}_2 \)
0.158
0.299
0.170
0.321
0.204
0.358
0.217
0.391
0.326
0.442
0.219
0.362
0.161
0.307
0.168
0.322
0.298
0.428
0.149
0.299
\( \text{ETTm}_1 \)
0.046
0.154
0.069
0.186
0.241
0.382
0.270
0.416
0.162
0.326
0.200
0.349
0.054
0.164
0.069
0.191
0.158
0.299
0.050
0.157
Elec.
0.366
0.345
0.393
0.370
0.464
0.388
0.744
0.528
0.727
0.482
0.525
0.423
0.375
0.353
0.378
0.359
0.511
0.603
0.369
0.348
WTH
0.160
0.287
0.181
0.308
0.243
0.370
0.280
0.411
0.256
0.374
0.166
0.291
0.183
0.307
0.175
0.303
0.302
0.442
0.176
0.304
Lora
0.177
0.273
0.356
0.385
1.574
0.999
0.656
0.550
0.311
0.349
1.160
0.927
0.186
0.282
0.620
0.565
0.490
0.591
0.333
0.325
Avg.
0.157
0.258
0.207
0.301
0.486
0.477
0.382
0.441
0.320
0.388
0.419
0.465
0.168
0.271
0.256
0.340
0.315
0.441
0.188
0.274
+
+Table 2: Multivariate time series forecasting results.
+
+
Dataset
AutoTCL
TS2Vec
Informer
LogTrans
StemGNN
TCN
CoST
TNC
TS-TCC
InfoTS
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
\( ETTh_1 \)
0.656
0.590
0.788
0.646
0.907
0.739
1.043
0.890
0.738
0.632
1.021
0.816
0.650
0.585
0.904
0.702
0.748
0.635
0.784
1.622
\( ETTh_2 \)
1.191
0.815
1.566
0.937
2.371
1.199
2.898
1.356
1.940
1.077
2.574
1.265
1.283
0.851
1.869
1.053
2.120
1.109
1.474
0.914
\( ETTh_m_1 \)
0.409
0.441
0.628
0.553
0.749
0.640
0.965
0.914
0.729
0.626
0.818
0.849
0.409
0.439
0.740
0.599
0.612
0.564
0.568
0.521
Elec.
0.175
0.272
0.319
0.397
0.495
0.488
0.351
0.412
0.501
0.489
0.332
0.404
0.165
0.268
0.387
0.446
0.511
0.602
0.289
0.376
WTH
0.423
0.457
0.451
0.474
0.574
0.552
0.645
0.617
0.353
0.593
0.440
0.461
0.430
0.464
0.441
0.466
0.483
0.535
0.455
0.472
Lora
0.346
0.372
0.356
0.384
0.743
0.586
0.766
0.520
0.258
0.492
1.013
0.814
0.350
0.378
0.590
0.518
0.490
0.591
0.345
0.368
Avg.
0.545
0.499
0.697
0.571
0.990
0.708
1.138
0.798
0.753
0.651
1.057
0.781
0.561
0.505
0.837
0.637
0.838
0.675
0.665
0.556
+
+# 4.2 TIME SERIES CLASSIFICATION
+
+Datasets and baselines. For the classification task, we evaluate our method on the UEA dataset (Dau et al., 2019), which contains 30 multivariate time series datasets. We compare our method with 8 state-of-the-art baselines, including TS2Vec (Yue et al., 2022), T-Loss (Franceschi et al., 2019), TNC (Tonekaboni et al., 2021), TS-TCC (Eldele et al., 2021), TST (Zerveas et al., 2021), DTW (Chen et al., 2013), TF-C (Zhang et al., 2022) and InfoTS (Luo et al., 2023).
+
+Setup. We use TS2Vec (Yue et al., 2022) network architecture. In the training stage, we use the same strategy as the forecasting tasks which could be found in Appendix. We follow the previous setting (Yue et al., 2022) that the evaluation is conducted in a standard supervised manner. A radial basis function kernel SVM classifier is trained on the training set and then makes predictions on test data. We report two metrics in the results, accuracy(ACC) and rank(RANK).
+
+Results. The results on the 30 UEA datasets are summarized in Table 3. The detailed results can be found in Table 12 in the Appendix. Overall, AutoTCL substantially outperforms baselines with an average rank value 2.3. As shown in Table 12, our method achieves the best results in 16 out of 30 datasets. In addition, it improves the classification accuracy by $1.6\%$ , on average, over the second-best baseline, InfoTS. The comprehensive comparison indicates the effectiveness of the proposed method.
+
+# 4.3 ABLATION STUDY AND MODEL ANALYSIS.
+
+In this set of experiments, we conduct ablation studies to investigate the effectiveness of each component in the proposed method. To present deep insights into automatic data augmentation and
+
+Table 3: Classification result of the UEA dataset
+
+
Dataset
AutoTCL
TS2Vec
T-Loss
TNC
TS-TCC
TST
DTW
TF-C
InfoTS
Avg. ACC
0.742
0.704
0.658
0.670
0.668
0.617
0.629
0.298
0.730
Avg. RANK
2.300
3.700
4.667
5.433
5.133
6.133
5.400
8.200
2.367
+
+factorization, we compare AutoTCL with multiple groups of variants. (1) W/o $h(x)$ , W/o $g(x)$ , and W/o $\Delta v$ are ablation studies about the effectiveness of each part of AutoTCL. In our experiments, W/o $h(x)$ means the whole input instance would be regarded as the informative part. W/o $g(x)$ represents the transformation head $g(x)$ would be replaced by all 1 vectors and no noise will be added in W/o $\Delta v$ setting. (2) Cutout and Jitter are two commonly adopted data augmentation techniques for time series contrastive learning. We replace the augmentation network in AutoTCL with these two static transformations as variants. (3) Adversarial training is routinely adopted in the literature to learn views for contrastive learning. For this variant, we adversarially train the augmentation network by minimizing the mutual information between views and original instances, approximated by the InfoNCE (Tian et al., 2020). (4), Random Aug. randomly select augmentation operations from Cutout and Jitter with different parameters. The parameter of cutout ranges from 0.3 to 0.8. The mean of Jitter is set to 0, and the standard deviation ranges from 0.3 to 1.0. We report the averaged performances in Table 4 and the full results are shown in Table 6 in Appendix.
+
+We have several observations in Table 4. First, by removing the factorization head, $\mathbf{W} / \mathbf{o} h(x)$ increase the MSE by $10.19\%$ and MAE by $4.65\%$ respectively, verifying the effectiveness of the factorization. The comparison between AutoTCL and W/o $g(x)$ , indicates the importance of invertible view generation. Specifically, W/o $g(x)$ increases the MSE by $37.6\%$ and MAE by $9.3\%$ ; The difference between AutoTCL and W/o $\Delta v$ indicates the importance of diversity in data augmentation. Second, the comparison between W/o Aug and Cutout shows that universal and non-parametric augmentation techniques may harm the performances of time series contrastive learning. On average, Cutout performs even worse than W/o Aug. This observation is consistent with the conclusion drawn in TS2Vec (Yue et al., 2022). By adaptive learning suitable augmentations, our methods can consistently and significantly outperform these baselines. Third, with the augmentation network trained in an adversarial manner, the variant, Adversarial improves the performances, indicating the necessity of adaptive augmentation for time series data. However, overlooking the semantic preservation may generate trivial augmented views, hindering the performance of downstream contrastive learning. On the other hand, our method achieves the best performances in most cases, especially for forecasting long periods, which verifies the advantage of our training algorithm. The comparison between AutoTCL and Random Aug. further indicates the advantage of parametric augmentation.
+
+Table 4: Ablation studies and model analysis
+
+
Dataset
AutoTCL
W/o h(x)
W/o g(x)
W/o Δv
W/o Aug
Cutout
Jitter
Adversarial
Random Aug.
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
0.076
0.207
0.077
0.208
0.078
0.209
0.086
0.219
0.095
0.231
0.088
0.221
0.086
0.219
0.089
0.224
0.112
0.254
ETTh2
0.158
0.299
0.168
0.305
0.178
0.312
0.176
0.311
0.170
0.309
0.160
0.306
0.173
0.317
0.187
0.319
0.168
0.321
ETTm1
0.046
0.154
0.052
0.161
0.050
0.159
0.051
0.163
0.053
0.162
0.053
0.164
0.056
0.170
0.052
0.163
0.065
0.187
Elec.
0.365
0.348
0.371
0.349
0.365
0.348
0.366
0.347
0.368
0.354
0.367
0.345
0.366
0.344
0.365
0.345
0.376
0.358
WTH
0.160
0.287
0.172
0.301
0.166
0.295
0.164
0.293
0.183
0.309
0.167
0.294
0.174
0.304
0.166
0.294
0.184
0.310
Lora
0.177
0.273
0.237
0.309
0.489
0.385
0.304
0.361
0.711
0.412
0.783
0.442
0.285
0.346
0.445
0.373
0.191
0.299
Avg.
0.157
0.258
0.173
0.270
0.216
0.282
0.185
0.280
0.260
0.294
0.266
0.394
0.184
0.281
0.212
0.284
0.176
0.286
+
+# 5 CONCLUSION AND FUTURE WORK
+
+We present a novel factorization-based augmentation framework for time series representation learning in the self-supervised setting. Theoretical analysis from the information theory perspective shows that the proposed framework is more flexible to persevere semantics and includes sufficient variances to augment views. On top of that, we provide a simple and effective instantiation and an efficient training algorithm. With time series forecasting as the downstream task, we compare the proposed method, AutoTCL, with representative methods and verify its effectiveness. In addition, AutoTCL exploits the informative part of time series data, which might help users better understand the time series data. In the future, we plan to investigate the usage of parametric augmentation in other contrastive learning frameworks and extend the technique to other domains.
+
+# ACKNOWLEDGMENTS
+
+This project was partially supported by NSF grants IIS-2331908 and CNS-2150010. The views and conclusions contained in this paper are those of the authors and should not be interpreted as representing any funding agencies.
+
+# REFERENCES
+
+Amine Mohamed Aboussalah, Minjae Kwon, Raj G Patel, Cheng Chi, and Chi-Guhn Lee. Recursive time series data augmentation. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=5lgD4vU-124s.
+Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.
+Defu Cao, Yujing Wang, Juanyong Duan, Ce Zhang, Xia Zhu, Congrui Huang, Yunhai Tong, Bixiong Xu, Jing Bai, Jie Tong, et al. Spectral temporal graph neural network for multivariate time-series forecasting. Advances in neural information processing systems, 33:17766-17778, 2020.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, pp. 1597-1607, 2020.
+Yanping Chen, Bing Hu, Eamonn Keogh, and Gustavo EAPA Batista. Dtw-d: time series semi-supervised learning from a single example. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 383-391, 2013.
+Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In CVPR, pp. 113-123, 2019.
+Hoang Anh Dau, Anthony Bagnall, Kaveh Kamgar, Chin-Chia Michael Yeh, Yan Zhu, Shaghayegh Gharghabi, Chotirat Ann Ratanamahatana, and Eamonn Keogh. The ucr time series archive. IEEE/CAA Journal of Automatica Sinica, 6(6):1293-1305, 2019. doi: 10.1109/JAS.2019.1911747.
+Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml.
+Vijay Ekambaram, Arindam Jati, Nam Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. Tsmixer: Lightweight mlp-mixer model for multivariate time series forecasting. In Ambuj Singh, Yizhou Sun, Leman Akoglu, Dimitrios Gunopoulos, Xifeng Yan, Ravi Kumar, Fatma Ozcan, and Jieping Ye (eds.), Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD 2023, Long Beach, CA, USA, August 6-10, 2023, pp. 459-469. ACM, 2023. doi: 10.1145/3580305.3599533. URL https://doi.org/10.1145/3580305.3599533.
+Emadeldeen Eldele, Mohamed Ragab, Zhenghua Chen, Min Wu, Chee Keong Kwoh, Xiaoli Li, and Cuntai Guan. Time-series representation learning via temporal and contextual contrasting. In Zhi-Hua Zhou (ed.), Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI 2021, Virtual Event / Montreal, Canada, 19-27 August 2021, pp. 2352-2359. ijcai.org, 2021. doi: 10.24963/ijcai.2021/324. URL https://doi.org/10.24963/ijcai.2021/324.
+Haoyi Fan, Fengbin Zhang, and Yue Gao. Self-supervised time series representation learning by inter-intra relational reasoning. arXiv preprint arXiv:2011.13548, 2020.
+Jean-Yves Franceschi, Aymeric Dieuleveut, and Martin Jaggi. Unsupervised scalable representation learning for multivariate time series. Advances in neural information processing systems, 32, 2019.
+Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook.org.
+Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139-144, 2020.
+
+Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander Smola. A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723-773, 2012.
+Ryuichiro Hataya, Jan Zdenek, Kazuki Yoshizoe, and Hideki Nakayama. Faster autoaugment: Learning augmentation strategies using backpropagation. In ECCV, pp. 1-16. Springer, 2020.
+Daniel Ho, Eric Liang, Xi Chen, Ion Stoica, and Pieter Abbeel. Population based augmentation: Efficient learning of augmentation policy schedules. In International conference on machine learning, pp. 2731-2741. PMLR, 2019.
+Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=rkE3y85ee.
+Bulat Khaertdinov, Esam Ghaleb, and Stylianos Asteriadis. Contrastive self-supervised learning for sensor-based human activity recognition. In 2021 IEEE International Joint Conference on Biometrics (IJCB), pp. 1-8. IEEE, 2021.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Ivan Kobyzev, Simon JD Prince, and Marcus A Brubaker. Normalizing flows: An introduction and review of current methods. IEEE transactions on pattern analysis and machine intelligence, 43 (11):3964-3979, 2020.
+Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and short-term temporal patterns with deep neural networks. In SIGIR, pp. 95-104, 2018.
+Jiangmeng Li, Wenwen Qiang, Changwen Zheng, Bing Su, and Hui Xiong. Metaug: Contrastive learning via meta feature augmentation. In International Conference on Machine Learning, pp. 12964-12978. PMLR, 2022.
+Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In NeurIPS, pp. 5243-5253, 2019.
+Yonggang Li, Guosheng Hu, Yongtao Wang, Timothy Hospedales, Neil M. Robertson, and Yongxin Yang. Differentiable automatic data augmentation. In Computer Vision - ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXII, pp. 580-595, Berlin, Heidelberg, 2020. Springer-Verlag. ISBN 978-3-030-58541-9. doi: 10.1007/978-3-030-58542-6_35. URL https://doi.org/10.1007/978-3-030-58542-6_35.
+Shengsheng Lin, Weiwei Lin, Wentai Wu, Songbo Wang, and Yongxiang Wang. Performer: Long-term time series forecasting via placeholder-enhanced transformer. arXiv preprint arXiv:2308.04791, 2023.
+Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through 1_0 regularization. In International Conference on Learning Representations, 2018.
+Dongsheng Luo, Wei Cheng, Yingheng Wang, Dongkuan Xu, Jingchao Ni, Wenchao Yu, Xuchao Zhang, Yanchi Liu, Yuncong Chen, Haifeng Chen, et al. Time series contrastive learning with information-aware augmentations. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 4534-4542, 2023.
+Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=S1jE5L5gl.
+Yuqi Nie, Nam H Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. A time series is worth 64 words: Long-term forecasting with transformers. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=Jbdc0vTOcol.
+
+Manuel T Nonnenmacher, Lukas Oldenburg, Ingo Steinwart, and David Reeb. Utilizing expert features for contrastive learning of time-series representations. In International Conference on Machine Learning, pp. 16969-16989. PMLR, 2022.
+Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
+Boris N. Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio. N-beats: Neural basis expansion analysis for interpretable time series forecasting. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=r1ecqn4YwB.
+Yilmazcan Ozyurt, Stefan Feuerriegel, and Ce Zhang. Contrastive learning for unsupervised domain adaptation of time series. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=xPkJYRsQGM.
+F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
+Jose C Principe. Information theoretic learning: Renyi's entropy and kernel perspectives. Springer Science & Business Media, 2010.
+Cédric Rommel, Thomas Moreau, Joseph Paillard, and Alexandre Gramfort. Cadda: Class-wise automatic differentiable data augmentation for eeg signals. In ICLR 2022-International Conference on Learning Representations, 2022.
+David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deeper: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3): 1181-1191, 2020.
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958, 2014.
+Susheel Suresh, Pan Li, Cong Hao, and Jennifer Neville. Adversarial graph augmentation to improve graph contrastive learning. Advances in Neural Information Processing Systems, 34:15920-15933, 2021.
+Alex Tamkin, Mike Wu, and Noah Goodman. Viewmaker networks: Learning views for unsupervised representation learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=enoVQWLsfyL.
+Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning? Advances in neural information processing systems, 33:6827-6839, 2020.
+Naftali Tishby, Fernando C Pereira, and William Bialek. The information bottleneck method. arXiv preprint physics/0004057, 2000.
+Sana Tonekaboni, Danny Eytan, and Anna Goldenberg. Unsupervised representation learning for time series with temporal neighborhood coding. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=8qDwejCuCN.
+Vikas Verma, Thang Luong, Kenji Kawaguchi, Hieu Pham, and Quoc Le. Towards domain-agnostic contrastive learning. In International Conference on Machine Learning, pp. 10530-10541. PMLR, 2021.
+Tianchun Wang, Farzaneh Mirzazadeh, Xiang Zhang, and Jie Chen. Gc-flow: A graph-based flow network for effective clustering. arXiv preprint arXiv:2305.17284, 2023.
+Zhiyuan Wang, Xovee Xu, Goce Trajcevski, Weifeng Zhang, Ting Zhong, and Fan Zhou. Learning latent seasonal-trend representations for time series forecasting. In Advances in Neural Information Processing Systems, 2022.
+
+Qingsong Wen, Liang Sun, Xiaomin Song, Jingkun Gao, Xue Wang, and Huan Xu. Time series data augmentation for deep learning: A survey. In AAAI, 2021.
+Gerald Woo, Chenghao Liu, Doyen Sahoo, Akshit Kumar, and Steven Hoi. CoST: Contrastive learning of disentangled seasonal-trend representations for time series forecasting. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=PilZY3omXV2.
+Jing Wu, Jennifer Hobbs, and Naira Hovakimyan. Hallucination improves the performance of unsupervised visual representation learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 16132-16143, 2023.
+Qizhe Xie, Zihang Dai, Eduard Hovy, Thang Luong, and Quoc Le. Unsupervised data augmentation for consistency training. Advances in neural information processing systems, 33:6256-6268, 2020.
+Dongkuan Xu, Wei Cheng, Dongsheng Luo, Haifeng Chen, and Xiang Zhang. Infogcl: Information-aware graph contrastive learning. Advances in Neural Information Processing Systems, 34: 30414-30425, 2021.
+Ling Yang and Shenda Hong. Unsupervised time-series representation learning with iterative bilinear temporal-spectral fusion. In International Conference on Machine Learning, pp. 25038-25054. PMLR, 2022.
+Yihang Yin, Qingzhong Wang, Siyu Huang, Haoyi Xiong, and Xiang Zhang. Autogcl: Automated graph contrastive learning via learnable view generators. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 8892-8900, 2022.
+Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. In NeurIPS, pp. 5812-5823, 2020.
+Yuning You, Tianlong Chen, Zhangyang Wang, and Yang Shen. Bringing your own view: Graph contrastive learning without prefabricated data augmentations. In Proceedings of the Fifteenth ACM International Conference on Web Search and Data Mining, pp. 1300-1309, 2022.
+Chengqing Yu, Fei Wang, Zezhi Shao, Tao Sun, Lin Wu, and Yongjun Xu. Dsformer: A double sampling transformer for multivariate time series long-term prediction. arXiv preprint arXiv:2308.03274, 2023.
+Zhihan Yue, Yujing Wang, Juanyong Duan, Tianmeng Yang, Congrui Huang, Yunhai Tong, and Bixiong Xu. Ts2vec: Towards universal representation of time series. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 8980-8987, 2022.
+George Zerveas, Srideepika Jayaraman, Dhaval Patel, Anuradha Bhamidipaty, and Carsten Eickhoff. A transformer-based framework for multivariate time series representation learning. In SIGKDD, pp. 2114-2124, 2021.
+Wenrui Zhang, Ling Yang, Shijia Geng, and Shenda Hong. Self-supervised time series representation learning via cross reconstruction transformer. IEEE Transactions on Neural Networks and Learning Systems, 2023a.
+Xiang Zhang, Ziyuan Zhao, Theodoros Tsiligkaridis, and Marinka Zitnik. Self-supervised contrastive pre-training for time series via time-frequency consistency. Advances in Neural Information Processing Systems, 35:3988-4003, 2022.
+Zhiqiang Zhang, Yuxuan Chen, Dandan Zhang, Yining Qian, and Hongbing Wang. Ctfnet: Long-sequence time-series forecasting based on convolution and time-frequency analysis. IEEE Transactions on Neural Networks and Learning Systems, 2023b.
+Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In AAAI, 2021.
+
+# APPENDIX: PARAMETRIC AUGMENTATION FOR TIME SERIES CONTRASTIVE LEARNING
+
+# A NOTATIONS
+
+Important notations are summarized in Table 5.
+
+Table 5: Notations and their meanings.
+
+
Symbol
Meaning
x, x
Time series
x*, x*
Informative part of x
Δx, Δx
Task-irrelevant part of x
v, v
Augmented view
v*, v*
Informative part of v
Δv, Δv
Task-irrelevant noise
y, y
Downstream task label
T
Length of time series
F
Number of features of time series
D
Dimensions of hidden representations
f
Encoder function
g
Transformation function
h
Factorization function
η
Augmentation function
H(·)
Entropy
MI(·;·)
Mutual information
h
Factorization mask
g
Transformation mask
h_i
i-th element of h
h_i
Intermediate result from concrete distribution
πi
Parameter in Bern. distribution
ε
Random variable from uniform distribution
τ
Temperature in Concrete distribution
ζ, γ
Hyper-parameters in hard concrete distribution
X
A batch/set of time series instances
a, p, n
Anchor, positive and negative time stamp
β, λ
Trade-off hyper-parameters
M
Hyper-parameter for training
+
+# B DETAILED PROOFS
+
+Property 1. If view $\mathsf{v}$ is generated from $\times$ with an invertible function $\nu = g(\times)$ . Then $H(\mathsf{v}) = H(\mathsf{x}) = M I(\mathsf{x};\mathsf{v})$ , where $H(\mathsf{x}), H(\mathsf{v})$ are entropy of variables $\times$ and $\nu$ , respectively; $M I(\mathsf{v};\mathsf{x})$ is the mutual information between $\nu$ and $\times$ .
+
+Proof. Since $g$ is an invertible function and $\mathsf{v} = g(\mathsf{x})$ , we have an one-to-one mapping between variables $\mathsf{v}$ and $\mathsf{x}$ . Thus, $v = g(x)$ for each pair of $x$ and $v$ . We have $\mathbb{P}[\mathsf{x} = x] = \mathbb{P}[\mathsf{v} = v]$ . From the definition of Shannon entropy, we have
+
+$$
+\begin{array}{l} H (\mathbf {\Delta x}) = - \sum_ {x} p (x) \log p (x) = - \sum_ {x} \mathbb {P} [ \mathbf {\Delta x} = x ] \log \mathbb {P} [ \mathbf {\Delta x} = x ] \\ = - \sum_ {v} \mathbb {P} [ v = v ] \log \mathbb {P} [ v = v ] = - \sum_ {x} p (v) \log p (v) \\ = H (\mathsf {v}). \\ \end{array}
+$$
+
+From the definition of conditional entropy, we have
+
+$$
+H (\mathsf {x} | \mathsf {v}) = \sum_ {v, x} p (v, x) \log \frac {p (v , x)}{p (v)},
+$$
+
+$$
+H (\mathsf {x} | \mathsf {v}) = \sum_ {v, x} p (v) \log \frac {p (v)}{p (v)} = 0.
+$$
+
+The above results in the mutual information between $\nu$ and $\times$ , given by
+
+$$
+\operatorname {M I} (\mathsf {v}; \mathsf {x}) = H (\mathsf {x}) - H (\mathsf {x} | \mathsf {v}) = H (\mathsf {v}).
+$$
+
+
+
+Property 2 (Task agnostic label preserving). If a variable $\mathsf{v}$ is a good view of $\times$ , and the downstream task label $\mathsf{y}$ (although not visible to training) is independent to noise in $\times$ , the mutual information between $\mathsf{v}$ and $\mathsf{y}$ is equivalent to that between raw input $\times$ and $\mathsf{y}$ , i.e., $MI(\mathsf{v};\mathsf{y}) = MI(\mathsf{x};\mathsf{y})$ .
+
+Proof. From the definition of the good view, we have
+
+$$
+x = x ^ {*} + \Delta x
+$$
+
+$$
+\mathsf {v} = \eta (g (\mathsf {x} ^ {*}), \Delta \mathsf {v}).
+$$
+
+We first analyze the relationship between $\mathrm{MI}(\mathsf{x},\mathsf{y})$ and $\mathrm{MI}(\mathsf{x}^*,\mathsf{y})$
+
+$$
+\begin{array}{l} \operatorname {M I} (\mathfrak {x}, \mathfrak {y}) = H (\mathfrak {y}) - H (\mathfrak {y} | \mathfrak {x}) \\ = H (y) + \sum_ {x, y} p (x, y) \log \frac {p (x , y)}{p (x)} \\ = H (y) + \sum_ {x ^ {*}, \Delta x, y} p \left(x ^ {*}, \Delta x, y\right) \log \frac {p \left(x ^ {*} , \Delta x , y\right)}{p \left(x ^ {*} , \Delta x\right)} \\ = H (y) + \sum_ {x ^ {*}, \Delta x, y} p \left(x ^ {*}, \Delta x, y\right) \log \frac {p \left(\Delta x , y \mid x ^ {*}\right)}{p \left(\Delta x \mid x ^ {*}\right)}. \\ \end{array}
+$$
+
+With the safe independence assumption, we have
+
+$$
+p \left(\Delta x, y \mid x ^ {*}\right) = p \left(\Delta x \mid x ^ {*}\right) p \left(y \mid x ^ {*}\right).
+$$
+
+Thus, we show that
+
+$$
+\begin{array}{l} \operatorname {M I} (\mathbf {\Delta x}, \mathbf {y}) = H (\mathbf {y}) + \sum_ {x ^ {*}, \Delta x, y} p (x ^ {*}, \Delta x, y) \log \frac {p (x ^ {*} , y)}{p (x ^ {*})} \\ = H (y) + \sum_ {x ^ {*}, y} p \left(x ^ {*}, y\right) \log \frac {p \left(x ^ {*} , y\right)}{p \left(x ^ {*}\right)} \\ = H (\mathcal {Y}) - H (\mathcal {Y} | \mathfrak {x} ^ {*}) \\ = \operatorname {M I} \left(x ^ {*}, y\right). \\ \end{array}
+$$
+
+Letting $\mathbf{v}^{*} = g(\mathbf{x}^{*})$ , from the Property 1, we have
+
+$$
+\operatorname {M I} \left(\mathrm {x} ^ {*}, \mathrm {y}\right) = \operatorname {M I} \left(\mathrm {v} ^ {*}, \mathrm {y}\right).
+$$
+
+Since $\Delta v$ is a random noise and is independent to the label $y$ , similarly, we have
+
+$$
+\begin{array}{l} \operatorname {M I} (\mathrm {v}, \mathrm {y}) = \operatorname {M I} \left(\eta \left(\mathrm {v} ^ {*}, \Delta v\right), \mathrm {y}\right) \\ = \mathbf {M I} ((\mathbf {v} ^ {*}, \Delta v), \mathbf {y}) \\ = \operatorname {M I} \left(\mathrm {v} ^ {*}, \mathrm {y}\right) \\ \end{array}
+$$
+
+Combining them together results in
+
+$$
+\operatorname {M I} (\mathrm {v}, \mathrm {y}) = \operatorname {M I} (\mathrm {x}, \mathrm {y}).
+$$
+
+Property 3. (Containing more information). A good view $\mathsf{v}$ contains more information comparing to the raw input $\mathsf{x}$ , i.e., $H(\mathsf{v}) \geq H(\mathsf{x})$ .
+
+Proof. Since $\Delta v$ denotes the included random noise, we assume that its generation is independent of the augmented view $v^{*}$ . Thus we have
+
+$$
+\mathrm {M I} \left(\Delta \mathrm {v}, \mathrm {v} ^ {*}\right) = 0. \tag {11}
+$$
+
+Further, with our decomposing model, we can rewrite the entropy of $\times$ as the joint entropy of $\times^*$ and $\Delta \times$ . Formally, we have
+
+$$
+H (\mathbf {x}) = H \left(\mathbf {x} ^ {*}, \Delta \mathbf {x}\right) = H \left(\mathbf {x} ^ {*}\right) + H \left(\Delta \mathbf {x}\right) - \operatorname {M I} \left(\Delta \mathbf {x}, \mathbf {x} ^ {*}\right).
+$$
+
+Then $H(\mathbf{x}^{*}) = H(\mathbf{v}^{*})$ holds (Property 1). From the definition of the good view, we have $H(\Delta \mathbf{v}) \geq H(\Delta \mathbf{x})$ . Thus, we have
+
+$$
+\begin{array}{l} H (\mathbf {x}) = H \left(\mathbf {x} ^ {*}\right) + H (\Delta \mathbf {x}) - \mathbf {M I} (\Delta \mathbf {x}, \mathbf {x} ^ {*}) \\ \leq H \left(\mathrm {v} ^ {*}\right) + H (\Delta \mathrm {v}) \\ = H \left(v ^ {*}\right) + H \left(\Delta v\right) - M I \left(\Delta v, v ^ {*}\right) \\ = H \left(\Delta v, v ^ {*}\right) = H \left(\eta \left(v ^ {*}, \Delta v\right)\right) \\ = H (\mathsf {v}). \\ \end{array}
+$$
+
+
+
+Derivation of Eq. (7) As described in Section 3.4, the factorization mask $h$ is generated with a hard concrete distribution. Thus, the number of non-zero entries in $h$ can be reformulated with
+
+$$
+\left| \left| \boldsymbol {h} \right| \right| _ {0} = \sum_ {t} (1 - \mathbb {P} _ {h _ {t}} (0)),
+$$
+
+where $\mathbb{P}_{h_t}(0)$ is the cumulative distribution function (CDF) of $h_t$ (before clipping). We let $\mathbf{S}(\cdot)$ be an affine function of the stretch process in Eq. (5), such that
+
+$$
+h _ {t} = \mathbf {S} (\tilde {h} _ {t}) = \tilde {h} _ {t} (\zeta - \gamma) + \gamma ,
+$$
+
+where $\gamma \in (-\infty, 0)$ and $\zeta \in (1, \infty)$ . As derived in (Maddison et al., 2017), the density of $h_t$ is
+
+$$
+p _ {\mathfrak {h} _ {t}} (h _ {t}) = \frac {\tau \alpha_ {t} h _ {t} ^ {- \tau - 1} (1 - h _ {t}) ^ {- \tau - 1}}{(\alpha_ {t} h _ {t} ^ {- \tau} + (1 - h _ {t}) ^ {- \tau}) ^ {2}},
+$$
+
+where $\alpha_{t} = \log \frac{\pi_{t}}{1 - \pi_{t}}$ . The CDF of $h_t$ reads
+
+$$
+\mathbb {P} _ {h _ {t}} \left(h _ {t}\right) = \sigma \left(\left(\log h _ {t} - \log \left(1 - h _ {t}\right)\right) \tau - \alpha_ {t}\right).
+$$
+
+Thus, the probability density function of $h_t$ is
+
+$$
+\begin{array}{l} p _ {\mathfrak {h} _ {t}} \left(h _ {t}\right) = p _ {\mathfrak {h} _ {t}} \left(\mathbf {S} ^ {- 1} \left(h _ {t}\right)\right) \left| \frac {\partial}{\partial h _ {t}} \mathbf {S} ^ {- 1} \left(h _ {t}\right) \right| \\ = \frac {(\zeta - \gamma) \tau \alpha_ {t} (h _ {t} - \gamma) ^ {- \tau - 1} (\zeta - h _ {t}) ^ {- \tau - 1}}{(\alpha_ {t} (h _ {t} - \gamma) ^ {- \tau} + (\zeta - h _ {t}) ^ {- \tau}) ^ {2}}. \\ \end{array}
+$$
+
+The CDF of $h_t$ is given by
+
+$$
+\begin{array}{l} \mathbb {P} _ {\mathfrak {h} _ {t}} \left(h _ {t}\right) = \mathbb {P} _ {\tilde {\mathfrak {h}} _ {t}} ^ {-} \left(\mathbf {S} ^ {- 1} \left(h _ {t}\right)\right) \\ = \sigma ((\log (h _ {t} - \gamma) - \log (\zeta - h _ {t})) \tau - \alpha_ {t}). \\ \end{array}
+$$
+
+When setting $h_t = 0$ , we have the
+
+$$
+\mathbb {P} _ {\mathsf {h} _ {t}} (0) = \sigma (\tau \log \frac {- \gamma}{\zeta} - \alpha_ {t}).
+$$
+
+# C IMPLEMENTATION DETAILS
+
+# C.1 TRAINING THE ENCODER WITH LOCAL AND GLOBAL CONTRASTS.
+
+Similar to the augmentation network, our method can work with different architectures. We formulate the feature extraction encoder as $f: \mathbb{R}^{T \times F} \to \mathbb{R}^D$ , where $D$ is the dimensionality of output embeddings. Following existing work (Luo et al., 2023), we use both global and local contrastive losses.
+
+Global contrast aims to improve the inter-instance robustness for representation learning. Given a batch of time series instances $\mathbb{X}$ , for each instance $x\in \mathbb{X}$ , we generate an augmented view $v$ . Such a pair of the original instance $x$ and the corresponding view $v$ is then used as a positive pair. Other pairs of instances and views are treated as negative pairs. Formally, $(x,v^{\prime})$ is a negative pair, where $v^{\prime}$ is an augmented view of $x^{\prime}$ and $x^{\prime}\neq x$ . Following (Chen et al., 2020), we use the InfoNCE as the global-wise contrastive loss to train the encoder network. Formally, we have
+
+$$
+\mathcal {L} _ {g} = - \frac {1}{| \mathbb {X} |} \sum_ {x \in \mathbb {X}} \log \frac {\exp \left(\operatorname {s i m} \left(\boldsymbol {z} _ {x} , \boldsymbol {z} _ {v}\right)\right)}{\sum_ {x ^ {\prime} \in \mathbb {X} _ {B}} \exp \left(\operatorname {s i m} \left(\boldsymbol {z} _ {x} , \boldsymbol {z} _ {v ^ {\prime}}\right)\right)}, \tag {12}
+$$
+
+where $\mathbf{z}_x = f(x), \mathbf{z}_v = f(v), \mathbf{z}_{x'} = f(x'), \mathbf{z}_{v'} = f(v')$ are representations of $x, v, x'$ and $v'$ , respectively.
+
+Local contrast is designed to enhance the encoder network to capture the intra-instance relationship. Given an augmented view $v$ , we first segment it into a set of subsequences $\mathbb{S}$ , where each subsequence $s \in \mathbb{S}$ has length $L$ . Following (Tonekaboni et al., 2021), two close subsequences $(s, p)$ are considered as a positive pair, and the ones with a large distance lead to a negative pair. Formally, the loss of local contrast is:
+
+$$
+\mathcal {L} _ {l _ {x}} = - \frac {1}{| \mathbb {S} |} \sum_ {s \in \mathbb {S}} \log \frac {\exp \left(\operatorname {s i m} \left(\boldsymbol {z} _ {s} , \boldsymbol {z} _ {p}\right)\right)}{\exp \left(\operatorname {s i m} \left(\boldsymbol {z} _ {s} , \boldsymbol {z} _ {p}\right)\right) + \sum_ {j \in \bar {\mathcal {N}} _ {s}} \exp \left(\operatorname {s i m} \left(\boldsymbol {z} _ {s} , \boldsymbol {z} _ {j}\right)\right)}, \tag {13}
+$$
+
+where $\bar{\mathcal{N}}_s$ is the set of negative pairs for a subsequence $s$ . $z_{s} = f(s), z_{p} = f(p), z_{n} = f(n)$ are representations of $s, p$ and $n$ generated by function $f$ , respectively. Considering all instances in a batch, we have
+
+$$
+\mathcal {L} _ {l} = \frac {1}{| \mathbb {X} |} \sum_ {x \in \mathbb {X}} \mathcal {L} _ {l _ {x}}. \tag {14}
+$$
+
+With both local and global contrasts, we have our contrastive loss as follows.
+
+$$
+\mathcal {L} _ {\text {c o n}} = \mathcal {L} _ {g} + \alpha \mathcal {L} _ {l}, \tag {15}
+$$
+
+where $\alpha$ is the hyper-parameter to achieve the trade-off between global and local losses.
+
+# C.2 TRAINING ALGORITHM
+
+In the training stage, AutoTCL optimizes the augmentation network and encoder network simultaneously. Similar to GAN (Goodfellow et al., 2016), these networks were randomly initialized. Different from GAN, AutoTCL is less affected by the problem of gradient explosion and mode collapse, because our encoder network aims to embed the information part from different views rather than distinguish them. Although our argumentation network tries to reduce the distribution between original instances and arguments, AutoTCL augmentations preserve the information part by using a reversible mapping function, which alleviates the mode collapse problem. Our training algorithm is shown in Alg. 1.
+
+# D EXPERIMENTAL SETTINGS
+
+All experiments are conducted on a Linux machine with 8 NVIDIA A100 GPUs, each with 40GB of memory. The software environment is CUDA 11.6 and Driver Version 520.61.05. We used Python 3.9.13 and Pytorch 1.12.1 to construct our project.
+
+Algorithm 1 AutoTCL training algorithm
+Require: augmentation network $f_{\mathrm{aug}}$ encoder network $f_{\mathrm{enc}}$ , epochs $E$ , a hyperparameter $M$ epoch $\leftarrow 0$
+while epoch $< E$ do
+for $x$ in dataset do
+ $x_{a}\gets f_{\mathrm{aug}}(x)$ $z_{x}\gets f_{\mathrm{enc}}(x)$ $z_{a}\gets f_{\mathrm{enc}}(x_{a})$
+if epoch%M==0 then Compute loss with using Eq. (10) Update parameters in $f_{\mathrm{aug}}$ with backpropagation end if
+Compute loss with using Eq. (15) Update parameters in $f_{\mathrm{enc}}$ with backpropagation
+end for
+epoch $\leftarrow$ epoch + 1
+end while
+
+# D.1 BASELINE SETTINGS
+
+In forecasting tasks, we conducted baseline methods on six benchmark datasets by following the experiment setting of TS2Vec(Yue et al., 2022) for most baseline methods, such as Informer (Zhou et al., 2021), (Tonekaboni et al., 2021), StemGNN (Cao et al., 2020), TCN (Bai et al., 2018), N-BEATS (Oreshkin et al., 2020), etc. For TS2Vec(Yue et al., 2022), CoST (Woo et al., 2022), we followed its code default setting for Lora and Weather datasets. The representation dimension was 320 and the learning rate and batch size were 0.001 and 8. For InfoTS (Luo et al., 2023), We used the default setting to conduct experiments. As for TS-TCC (Eldele et al., 2021) in forecasting tasks, we used the Epilepsy config as the default config and modified the network model to make the input and output channels remain the same. Due to its pooling layers, the network would require 3 times the lengths of inputs of other baselines which is unfair for forecasting tasks. In the experiments, we used another interpolate layer to make the length of input data and prediction data the same. In classification tasks, similar to the forecasting task, we followed the experiment setting of TS2Vec(Yue et al., 2022). In TF-C (Zhang et al., 2022) classification experiments, we use its HAR config as the default setting. Similar to TS-TCC, we modify the network so that the transformer encoder could fit the input length and the pre-train dataset is the same as the fine tune dataset.
+
+# D.2 HYPERPARAMETERS
+
+In our experiments, we used grid search to obtain the best performance. We used the same strategy in forecasting and classification tasks that each dataset had its own group of hyperparameters. We provided all of the hyperparameters as well as their configurations in the following:
+
+- Optimizer: Two Adam optimizers (Kingma & Ba, 2014) were used for the augmentation network and feature extraction network with learning rate and other hyperparameters were setting with default decay rates setting to 0.001 and (0.9,0.999) respectively.
+- Encoder architecture: The depth of the multi-layer dilated CNN module and the hidden dimension were designed to be able to change, which were searched in $\{6,7,8,9,10\}$ and $\{256,128,64,32,16,8\}$ . In training, we used a designed dropout rate to avoid overfitting, which was tuned in [0.01, 1].
+- Augmentation architecture: Same as encoder, the depth of multi-layer dilated CNN module and hidden dimension are hyperparameters, searched in $\{1,2,3,4,5\}$ and $\{256,128,64,32,16,8\}$ and as mention in equation Eq. 5, $\zeta$ is another hyperparameter, tuned in $[0.0005,0.5]$ .
+Trade-off hyperparameters: $\beta$ in Eq. (8), and $\lambda$ in Eq. (10) are tuned in [0, 0.3].
+- Alternating training hyperparameters: $M$ in Sec. (3.4) is tuned in $\{1,2,4,8,16,32\}$ .
+
+# D.3 EXTRA EXPERIMENTS
+
+# D.3.1 PERFORMANCE WITH DIFFERENT BACKBONES
+
+As a general framework for time series contrastive learning, AutoTCL can be used as a plug-and-play component to boost performance. To further verify the generalization capacity of AutoTCL. Table 6 shows the full results of ablation studies and model analysis with CoST as the backbone. In addition, we adopt Ts2vec (Yue et al., 2022) as the backbone and show the results in Table 7. We can draw similar conclusions that by adaptively selecting the optimal augmentations with the principle of relevant information, AutoTCL can outperform the vanilla TS2vec and other baselines.
+
+Table 6: Ablation studies using CoST backbone
+
+
Dataset
Ly
AutoTCL
W/o h(x)
W/o g(x)
W/o ΔV
W/o Aug
Cutout
Jitter
Adversarial
Random Aug.
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
24
0.037
0.148
0.037
0.148
0.037
0.148
0.038
0.149
0.037
0.148
0.037
0.147
0.038
0.147
0.039
0.149
0.056
0.178
48
0.054
0.176
0.054
0.176
0.054
0.177
0.055
0.180
0.055
0.178
0.053
0.175
0.054
0.176
0.056
0.180
0.076
0.208
168
0.078
0.210
0.079
0.210
0.080
0.211
0.083
0.217
0.100
0.237
0.078
0.210
0.081
0.212
0.090
0.227
0.132
0.278
336
0.093
0.231
0.093
0.231
0.094
0.232
0.096
0.234
0.108
0.251
0.092
0.230
0.095
0.233
0.106
0.250
0.137
0.289
720
0.120
0.272
0.121
0.274
0.124
0.277
0.157
0.317
0.175
0.340
0.179
0.345
0.163
0.325
0.152
0.313
0.157
0.318
ETTh2
24
0.079
0.206
0.077
0.204
0.076
0.205
0.079
0.209
0.078
0.208
0.076
0.204
0.092
0.217
0.078
0.207
0.090
0.229
48
0.117
0.255
0.124
0.258
0.113
0.256
0.118
0.259
0.127
0.259
0.110
0.253
0.135
0.272
0.124
0.265
0.125
0.272
168
0.176
0.319
0.191
0.329
0.212
0.346
0.240
0.358
0.220
0.347
0.191
0.340
0.207
0.356
0.227
0.361
0.175
0.331
336
0.193
0.344
0.201
0.350
0.243
0.371
0.204
0.349
0.200
0.357
0.201
0.355
0.212
0.366
0.253
0.375
0.207
0.368
720
0.223
0.373
0.246
0.384
0.246
0.380
0.238
0.379
0.227
0.374
0.220
0.376
0.217
0.374
0.251
0.385
0.245
0.405
ETTm1
24
0.016
0.091
0.014
0.087
0.015
0.090
0.015
0.089
0.013
0.085
0.017
0.092
0.015
0.091
0.015
0.092
0.020
0.107
48
0.026
0.120
0.025
0.119
0.025
0.117
0.027
0.122
0.024
0.116
0.028
0.123
0.027
0.124
0.028
0.125
0.032
0.138
96
0.036
0.145
0.037
0.146
0.038
0.146
0.039
0.150
0.036
0.144
0.039
0.150
0.043
0.158
0.040
0.151
0.045
0.165
288
0.063
0.191
0.074
0.205
0.072
0.204
0.072
0.205
0.080
0.216
0.078
0.211
0.082
0.218
0.075
0.205
0.093
0.238
672
0.090
0.225
0.108
0.250
0.098
0.239
0.104
0.248
0.114
0.248
0.104
0.246
0.112
0.260
0.100
0.240
0.134
0.285
Elec.
24
0.240
0.266
0.244
0.266
0.241
0.267
0.242
0.264
0.243
0.272
0.241
0.264
0.240
0.264
0.242
0.265
0.251
0.279
48
0.285
0.294
0.291
0.295
0.285
0.295
0.287
0.294
0.290
0.300
0.286
0.291
0.284
0.292
0.287
0.294
0.298
0.309
168
0.392
0.371
0.400
0.371
0.392
0.366
0.394
0.367
0.398
0.372
0.394
0.365
0.395
0.362
0.393
0.364
0.413
0.383
336
0.542
0.461
0.547
0.465
0.541
0.464
0.542
0.461
0.541
0.470
0.545
0.460
0.545
0.457
0.539
0.457
0.541
0.460
WTH
24
0.093
0.211
0.098
0.220
0.092
0.209
0.091
0.207
0.096
0.215
0.092
0.210
0.093
0.212
0.092
0.209
0.100
0.222
48
0.131
0.256
0.139
0.266
0.130
0.255
0.127
0.250
0.141
0.266
0.129
0.252
0.134
0.260
0.131
0.257
0.142
0.266
168
0.182
0.311
0.194
0.324
0.185
0.314
0.184
0.316
0.208
0.336
0.186
0.315
0.195
0.327
0.185
0.315
0.207
0.335
336
0.195
0.325
0.210
0.342
0.208
0.342
0.206
0.341
0.231
0.357
0.209
0.339
0.215
0.349
0.203
0.335
0.225
0.355
720
0.198
0.330
0.218
0.353
0.217
0.353
0.211
0.349
0.240
0.369
0.220
0.352
0.231
0.370
0.218
0.352
0.244
0.371
Lora
24
0.052
0.141
0.060
0.152
0.138
0.219
0.128
0.213
0.078
0.171
0.067
0.170
0.158
0.223
0.057
0.154
0.070
0.185
48
0.080
0.181
0.092
0.196
0.117
0.225
0.181
0.264
0.127
0.223
0.112
0.218
0.185
0.257
0.084
0.189
0.096
0.218
168
0.155
0.263
0.246
0.317
0.196
0.308
0.232
0.334
0.481
0.393
0.676
0.433
0.311
0.359
0.235
0.323
0.169
0.290
336
0.229
0.335
0.302
0.372
0.395
0.444
0.363
0.433
0.941
0.532
1.403
0.619
0.378
0.429
0.535
0.475
0.245
0.353
720
0.370
0.445
0.483
0.509
1.60
0.729
0.617
0.561
1.926
0.739
1.655
0.771
0.395
0.461
1.315
0.722
0.375
0.450
Avg.
0.157
0.258
0.173
0.270
0.216
0.282
0.185
0.280
0.260
0.294
0.266
0.394
0.184
0.281
0.212
0.284
0.176
0.286
+
+# D.3.2 VISUALIZATION OF AUGMENTATION
+
+The intuitive understanding of Property 3 is that if the map between $\times$ and $\vee$ is one-to-many, the generated view will contain more information compared to the raw input $\times$ . In other words, a good augmentation should preserve the underlying semantics that two different $x$ cannot map the same $v$ . In order to further explore the effectiveness of AutoTCL in generating diverse and semantic-preserving views, we used T-SNE to visualize the embeddings of different augmented views in Figure 2. We chose an instance, denoted by $x$ , from dataset $\mathrm{ETTh}_1$ and compare different augmentation methods, including Cutout, Jitter, and Adversarial. To avoid the special case, we reported 10 augmented views for AutoTCL. We also include another $x'$ instance as a reference. As shown in Figure 2, the instances augmented by AutoTCL include more diversity compared with Jitter and Cutout. Moreover, the augmentation generated by the Adversarial is closer to $x'$ or $x$ , indicating that it fails to preserve the underlying semantics.
+
+# D.3.3 VISUALIZATION OF CONVERGENCE
+
+To show the convergence of our method, we plotted the curves of Eq.(10) and Eq. (15) on different datasets. As shown in Figure 3, our method converged easily in both the argumentation network and the embedding network. In Figure 3(a) and 3(d), we observed that after the argumentation network converged to a certain level, the encoding network still benefited from that. In Figure 3(b), 3(c), and 3(e), they have the same patterns that the augmentation loss arrived at the convergence level almost the
+
+Table 7: Ablation studies using TS2Vec backbone
+
+
Dataset
Ly
AutoTCL
W/o h(x)
W/o g(x)
W/o ΔV
W/o Aug
Cutout
Jitter
Adversarial
Random Aug.
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
24
0.039
0.146
0.039
0.148
0.047
0.165
0.047
0.164
0.039
0.149
0.043
0.155
0.040
0.150
0.041
0.151
0.047
0.166
48
0.058
0.180
0.060
0.185
0.075
0.212
0.073
0.205
0.063
0.190
0.063
0.187
0.063
0.190
0.062
0.186
0.069
0.203
168
0.106
0.245
0.115
0.259
0.145
0.298
0.131
0.278
0.119
0.264
0.118
0.262
0.111
0.253
0.114
0.255
0.127
0.280
336
0.121
0.266
0.139
0.289
0.159
0.317
0.148
0.303
0.141
0.291
0.133
0.285
0.130
0.277
0.132
0.280
0.140
0.300
720
0.154
0.314
0.181
0.347
0.198
0.365
0.180
0.344
0.193
0.359
0.167
0.331
0.164
0.323
0.167
0.330
0.171
0.342
ETTh2
24
0.106
0.252
0.108
0.250
0.095
0.235
0.104
0.248
0.108
0.251
0.105
0.250
0.105
0.249
0.107
0.252
0.101
0.246
48
0.131
0.284
0.134
0.285
0.129
0.279
0.136
0.289
0.140
0.290
0.133
0.287
0.135
0.287
0.137
0.288
0.129
0.281
168
0.182
0.343
0.185
0.344
0.212
0.365
0.211
0.366
0.203
0.360
0.198
0.355
0.194
0.353
0.195
0.353
0.185
0.344
336
0.190
0.351
0.191
0.351
0.205
0.362
0.209
0.366
0.206
0.367
0.204
0.363
0.201
0.362
0.199
0.360
0.201
0.362
720
0.204
0.370
0.204
0.368
0.203
0.366
0.200
0.364
0.205
0.369
0.205
0.367
0.200
0.364
0.194
0.359
0.234
0.329
ETTm1
24
0.014
0.085
0.018
0.098
0.015
0.089
0.014
0.087
0.014
0.087
0.015
0.089
0.014
0.087
0.014
0.085
0.021
0.109
48
0.026
0.117
0.027
0.121
0.028
0.123
0.026
0.120
0.027
0.121
0.027
0.121
0.027
0.121
0.026
0.117
0.036
0.144
96
0.038
0.147
0.039
0.149
0.039
0.147
0.041
0.153
0.041
0.153
0.041
0.153
0.038
0.147
0.038
0.147
0.050
0.171
288
0.081
0.216
0.083
0.219
0.082
0.216
0.084
0.222
0.084
0.222
0.084
0.222
0.081
0.215
0.081
0.216
0.106
0.251
672
0.119
0.263
0.123
0.269
0.122
0.266
0.124
0.271
0.124
0.270
0.121
0.267
0.120
0.265
0.119
0.263
0.176
0.329
Elec.
24
0.247
0.269
0.249
0.271
0.248
0.269
0.247
0.270
0.250
0.271
0.248
0.270
0.249
0.273
0.250
0.270
0.251
0.277
48
0.297
0.301
0.302
0.306
0.297
0.301
0.297
0.303
0.298
0.302
0.296
0.302
0.297
0.307
0.298
0.302
0.393
0.303
168
0.408
0.380
0.413
0.381
0.408
0.380
0.410
0.380
0.408
0.377
0.408
0.383
0.410
0.384
0.408
0.377
0.405
0.372
336
0.541
0.468
0.553
0.472
0.541
0.469
0.547
0.470
0.542
0.471
0.545
0.470
0.470
0.547
0.542
0.471
0.554
0.458
WTH
24
0.093
0.212
0.096
0.214
0.094
0.210
0.096
0.214
0.094
0.211
0.099
0.215
0.096
0.213
0.096
0.213
0.104
0.227
48
0.133
0.258
0.134
0.259
0.130
0.253
0.134
0.258
0.134
0.257
0.132
0.256
0.135
0.259
0.133
0.254
0.142
0.268
168
0.188
0.316
0.192
0.322
0.184
0.313
0.192
0.322
0.197
0.324
0.189
0.317
0.192
0.321
0.193
0.322
0.195
0.323
336
0.201
0.333
0.208
0.341
0.202
0.335
0.208
0.341
0.216
0.347
0.208
0.338
0.211
0.342
0.212
0.344
0.209
0.340
720
0.204
0.339
0.210
0.347
0.204
0.339
0.210
0.347
0.225
0.357
0.211
0.343
0.220
0.353
0.217
0.352
0.211
0.344
Lora
24
0.053
0.140
0.061
0.156
0.076
0.169
0.061
0.156
0.188
0.219
0.062
0.158
0.080
0.173
0.062
0.157
0.076
0.177
48
0.082
0.188
0.087
0.193
0.136
0.229
0.086
0.193
0.296
0.285
0.086
0.192
0.155
0.238
0.088
0.195
0.115
0.222
168
0.161
0.278
0.210
0.306
0.210
0.308
0.344
0.360
0.341
0.371
0.188
0.294
0.229
0.318
0.219
0.310
0.219
0.321
336
0.231
0.347
0.454
0.431
0.274
0.369
0.299
0.391
0.400
0.420
0.369
0.407
0.281
0.373
0.488
0.438
0.323
0.401
720
0.375
0.451
0.369
0.447
0.400
0.473
0.370
0.428
0.484
0.482
0.367
0.446
0.443
0.493
0.364
0.454
0.465
0.512
Avg.
0.165
0.271
0.179
0.280
0.178
0.284
0.180
0.283
0.199
0.291
0.175
0.279
0.176
0.284
0.179
0.279
0.185
0.292
+
+
+(a) Samples $a$
+
+
+(b) Samples $b$
+Figure 2: T-SNE visualization of different augmentation instances. In samples $a$ and $b$ , AutoTCL-generated samples are closer to the original instance $x$ than other instances $x'$ with large variety
+
+same as the contrastive loss. While the situation was different in Figure 3(f), at the beginning the augmentation network benefited from encoding loss, then two losses converged gradually.
+
+# D.3.4 PARAMETER SENSITIVITY STUDIES
+
+In the proposed AutoTCL, we have three hyper-parameters, $\alpha$ in Eq. (15), $\beta$ in Eq. (8), and $\gamma$ in Eq. (10), to get the trade-off in training the augmentation network and the encoder network. In this part, we chose different values for these three variables in the range from 0.0001 to 0.3 and reported MSE and MAE scores in the ETTh1 dataset. The results of this part could be found in Figure 4. The sensitivity studies result of three hyper-parameters are shown in Figure 4. From this figure, some results could be observed that our method is able to achieve comparative performances with a wide range of choices for these three hyperparameters, indicating the robustness of our method. The $\beta$ in
+
+
+(a) $\mathrm{ETTh}_1$
+
+
+(b) $\mathrm{ETTh}_2$
+
+
+(c) $\mathrm{ETTm}_1$
+
+
+(d) Elec.
+
+
+(e) WTH
+
+
+(f) Lora
+Figure 3: The augmentation loss, Eq. (10) and contrastive loss, Eq. (15), in the training process
+
+Eq. (8), and $\gamma$ in Eq. (10) have the opposite effect as the weight goes up. Second, we observe that small values, such as 0.001, give good performances on ETTh1 datasets as well as others.
+
+
+(a) MSE
+
+
+(b) MAE
+Figure 4: Parameter sensitivity studies on $\mathrm{ETTh}_1$ .
+
+# D.3.5 CASE STUDY
+
+To further explore the augmentation of AutoTCL, we have done the case study in this section. We selected four instances to show the effectiveness of our method in Table 9. As shown in Table 9, we used the CricketX dataset as input instances and got the informative part by using the augmentation network to get masks, the result of $h(x)$ . With the regularization loss help in Eq. (9), our method could have a continuous mask that makes the informative part more consistent. From the results, the informative parts detected by $h()$ appear to retain the prominent peaks and troughs of the original sequence, which are typically considered significant by domain experts. In time series analysis, such prominent features often correspond to critical events or changes in the underlying system's behavior.
+
+# D.3.6 EXPERIMENTS ON OTHER DOMAIN DATASET
+
+In order to further verify the adaptability of our method, we conducted experiments on Traffic4 dataset. This dataset comprises hourly information sourced from the California Department of Transportation.
+
+This dataset delineates road occupancy rates as observed by various sensors deployed on the freeways in the San Francisco Bay area. Following the default setting, we adopt CoST as the backbone and conduct forecasting in both univariate and multivariate forecasting settings. We also include another SOTA method, TS2Vec as a comparison. The results are shown in Table 8. We observe that, in both univariate and multivariate forecasting settings, AutoTCL achieves the best results in all prediction lengths. On average, AutoTCL decreases MSE by $9.4\%$ , MAE by $5.7\%$ in the univariate forecasting setting and MSE by $5.0\%$ , MAE by $9.3\%$ in the multivariate forecasting setting comparing to the baseline.
+
+Table 8: Forecasting results on Traffic dataset.
+
+
Settings
Ly
AutoTCL
TS2Vec
CoST
MSE
MAE
MSE
MAE
MSE
MAE
Univariate
96
0.253
0.353
0.431
0.484
0.284
0.379
192
0.271
0.373
0.437
0.489
0.302
0.398
336
0.312
0.414
0.453
0.500
0.340
0.435
720
0.357
0.447
0.464
0.508
0.390
0.474
Avg.
0.298
0.397
0.446
0.495
0.329
0.421
Multivariate
96
0.715
0.396
1.038
0.574
0.759
0.442
192
0.722
0.396
1.042
0.588
0.757
0.434
336
0.730
0.396
1.064
0.594
0.765
0.435
720
0.746
0.403
1.085
0.604
0.784
0.444
Avg.
0.728
0.398
1.057
0.590
0.766
0.439
+
+# D.4 FULL EXPERIMENTS
+
+Univariate forecasting. Full experiment results of univariate time series forecasting results can be found in Table 10. In these experiments, AutoTCL achieved minimum error in most cases. Compared to the state-of-the-art CoST method, AutoTCL reduced the average MSE error by $6.5\%$ and the average MAE by $4.8\%$ .
+
+Multivariate forecasting. We provided our full experiment results of multivariate time series forecasting results in Table 11. In multivariate forecasting tasks, our method achieved fewer best results than univariate forecasting. AutoTCL reduced the average MSE error by $2.9\%$ and the average MAE by $1.2\%$ than CoST. In the column of stemGNN, because of the error out-of-memory, we can't report part results.
+
+Classification. In Table 12, the full results of 30 class datasets are provided. AutoTCL is the most powerful method than other baselines with the highest average accuracy rate and ranks. Some results are not available due to out-of-memory errors.
+
+Table 9: Case study of parametric augmentation. The inputs are from the CricketX dataset, which is a univariate time series dataset. We demonstrate the informative parts in two settings, w/ and w/o $(\gamma = 0)$ regularization loss.
+
+
Input
γ
h(x)
x*
0.0
1.0
0.2
0.8
0.8
0.8
0.8
0.8
0.8
0.8
0.8
0.8
0.8
0.8
0.8
+
+Table 10: Univariate time series forecasting results.
+
+
Dataset
Ly
AutoTCL
TS2Vec
Informer
LogTrans
N-BEATS
TCN
CoST
TNC
TS-TCC
InfoTS
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
24
0.037
0.148
0.039
0.152
0.098
0.247
0.103
0.259
0.094
0.238
0.075
0.210
0.040
0.152
0.057
0.184
0.103
0.237
0.039
0.149
48
0.054
0.176
0.062
0.191
0.158
0.319
0.167
0.328
0.210
0.367
0.227
0.402
0.060
0.186
0.094
0.239
0.139
0.279
0.056
0.179
168
0.078
0.210
0.134
0.282
0.183
0.346
0.207
0.375
0.232
0.391
0.316
0.493
0.097
0.236
0.171
0.329
0.253
0.408
0.100
0.239
336
0.093
0.231
0.154
0.310
0.222
0.387
0.230
0.398
0.232
0.388
0.306
0.495
0.112
0.258
0.192
0.357
0.155
0.318
0.117
0.264
720
0.120
0.272
0.163
0.327
0.269
0.435
0.273
0.463
0.322
0.490
0.390
0.557
0.148
0.306
0.235
0.408
0.190
0.337
0.141
0.302
ETTh2
24
0.079
0.206
0.090
0.229
0.093
0.240
0.102
0.255
0.198
0.345
0.103
0.249
0.079
0.207
0.097
0.238
0.239
0.391
0.081
0.215
48
0.117
0.255
0.124
0.273
0.155
0.314
0.169
0.348
0.234
0.386
0.142
0.290
0.118
0.259
0.131
0.281
0.260
0.405
0.115
0.261
168
0.176
0.319
0.208
0.360
0.232
0.389
0.246
0.422
0.331
0.453
0.227
0.376
0.189
0.339
0.197
0.354
0.291
0.420
0.171
0.327
336
0.193
0.344
0.213
0.369
0.263
0.417
0.267
0.437
0.431
0.508
0.296
0.430
0.206
0.360
0.207
0.366
0.336
0.453
0.183
0.341
720
0.223
0.373
0.214
0.374
0.277
0.431
0.303
0.493
0.437
0.517
0.325
0.463
0.214
0.371
0.207
0.370
0.362
0.472
0.194
0.357
ETThm1
24
0.016
0.091
0.015
0.092
0.030
0.137
0.065
0.202
0.054
0.184
0.041
0.157
0.015
0.088
0.019
0.103
0.089
0.228
0.014
0.087
48
0.026
0.120
0.027
0.126
0.069
0.203
0.078
0.220
0.190
0.361
0.101
0.257
0.025
0.117
0.036
0.142
0.134
0.280
0.025
0.117
96
0.036
0.145
0.044
0.161
0.194
0.372
0.199
0.386
0.183
0.353
0.142
0.311
0.038
0.147
0.054
0.178
0.159
0.305
0.036
0.142
288
0.063
0.191
0.103
0.246
0.401
0.554
0.411
0.572
0.186
0.362
0.318
0.472
0.077
0.209
0.098
0.244
0.204
0.327
0.071
0.200
672
0.090
0.225
0.156
0.307
0.512
0.644
0.598
0.702
0.197
0.368
0.397
0.547
0.113
0.257
0.136
0.290
0.206
0.354
0.102
0.240
Elec.
24
0.241
0.262
0.260
0.288
0.251
0.275
0.528
0.447
0.427
0.330
0.263
0.279
0.243
0.264
0.252
0.278
0.379
0.561
0.245
0.269
48
0.287
0.292
0.319
0.324
0.346
0.339
0.409
0.414
0.551
0.392
0.373
0.344
0.292
0.300
0.300
0.308
0.453
0.600
0.294
0.301
168
0.394
0.365
0.427
0.394
0.544
0.424
0.959
0.612
0.893
0.538
0.609
0.462
0.405
0.375
0.412
0.384
0.575
0.616
0.402
0.367
336
0.543
0.460
0.565
0.474
0.713
0.512
1.079
0.639
1.035
0.669
0.855
0.606
0.560
0.473
0.548
0.466
0.637
0.633
0.533
0.453
WTH
24
0.093
0.211
0.096
0.215
0.117
0.251
0.136
0.279
0.136
0.264
0.109
0.217
0.096
0.213
0.102
0.221
0.221
0.386
0.101
0.222
48
0.131
0.256
0.140
0.264
0.178
0.318
0.206
0.356
0.198
0.319
0.143
0.269
0.138
0.262
0.139
0.264
0.255
0.406
0.141
0.266
168
0.182
0.311
0.207
0.335
0.266
0.398
0.309
0.439
0.309
0.420
0.188
0.319
0.207
0.334
0.198
0.328
0.339
0.458
0.199
0.328
336
0.195
0.325
0.231
0.360
0.297
0.416
0.359
0.484
0.369
0.460
0.192
0.320
0.230
0.356
0.215
0.347
0.372
0.491
0.220
0.351
720
0.198
0.330
0.233
0.365
0.359
0.466
0.388
0.499
0.270
0.406
0.198
0.329
0.242
0.370
0.219
0.353
0.322
0.467
0.218
0.353
Lora
24
0.052
0.141
0.212
0.268
0.917
0.720
0.264
0.371
0.072
0.170
0.981
0.899
0.053
0.144
0.206
0.273
0.365
0.514
0.058
0.149
48
0.080
0.181
0.267
0.316
1.067
0.786
0.364
0.424
0.115
0.223
0.981
0.898
0.082
0.184
0.286
0.349
0.426
0.562
0.090
0.192
168
0.155
0.263
0.355
0.389
1.745
1.067
0.452
0.465
0.286
0.350
1.276
0.946
0.166
0.274
0.523
0.549
0.481
0.587
0.156
0.267
336
0.229
0.335
0.425
0.441
1.661
1.050
0.950
0.683
0.405
0.429
1.273
0.943
0.252
0.355
0.772
0.724
0.588
0.645
0.313
0.386
720
0.370
0.445
0.523
0.509
2.482
1.370
1.248
0.807
0.679
0.573
1.290
0.950
0.379
0.451
1.313
0.929
0.592
0.649
1.047
0.635
Avg.
0.157
0.258
0.207
0.301
0.486
0.477
0.382
0.441
0.320
0.388
0.419
0.465
0.168
0.271
0.256
0.340
0.315
0.441
0.188
0.274
+
+Table 11: Multivariate time series forecasting results.
+
+
AutoTCL
TS2Vec
Informer
LogTrans
StemGNN
TCN
CoST
TNC
TS-TCC
InfoTS
Dataset
Ly
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
24
0.389
0.439
0.599
0.534
0.577
0.549
0.686
0.604
0.614
0.571
0.767
0.612
0.386
0.429
0.708
0.592
0.516
0.508
0.564
0.520
48
0.447
0.477
0.629
0.555
0.685
0.625
0.766
0.757
0.748
0.618
0.713
0.617
0.437
0.464
0.749
0.619
0.644
0.579
0.607
0.553
168
0.615
0.574
0.755
0.636
0.931
0.752
1.002
0.846
0.663
0.608
0.995
0.738
0.643
0.582
0.884
0.699
0.678
0.619
0.746
0.638
336
0.802
0.671
0.907
0.717
1.128
0.873
1.362
0.952
0.927
0.730
1.175
0.800
0.812
0.679
1.020
0.768
0.967
0.754
0.904
0.722
720
1.028
0.789
1.048
0.790
1.215
0.896
1.397
1.291
-
-
1.453
1.311
0.970
0.771
1.157
0.830
0.935
0.715
1.098
0.811
ETTh2
24
0.337
0.433
0.398
0.461
0.720
0.665
0.828
0.750
1.292
0.883
1.365
0.888
0.447
0.502
0.612
0.595
0.782
0.666
0.383
0.462
48
0.572
0.576
0.578
0.573
1.457
1.001
1.806
1.034
1.099
0.847
1.395
0.960
0.699
0.637
0.840
0.716
1.357
0.881
0.567
0.582
168
1.470
0.947
1.901
1.065
3.489
1.515
4.070
1.681
2.282
1.228
3.166
1.407
1.549
0.982
2.359
1.213
4.318
1.728
1.789
1.048
336
1.685
1.027
2.304
1.215
2.723
1.340
3.875
1.763
3.086
1.351
3.256
1.481
1.749
1.042
2.782
1.349
2.097
1.145
2.120
1.161
720
1.890
1.092
2.650
1.373
3.467
1.473
3.913
1.552
-
-
3.690
1.588
1.971
1.092
2.753
1.394
2.047
1.127
2.511
1.316
ETM1
24
0.256
0.339
0.443
0.436
0.323
0.369
0.419
0.412
0.620
0.570
0.324
0.374
0.246
0.329
0.522
0.472
0.403
0.455
0.391
0.408
48
0.339
0.396
0.582
0.515
0.494
0.503
0.507
0.583
0.744
0.628
0.477
0.450
0.331
0.386
0.695
0.567
0.618
0.552
0.503
0.475
96
0.376
0.422
0.622
0.549
0.678
0.614
0.768
0.792
0.709
0.624
0.636
0.602
0.378
0.419
0.731
0.595
0.607
0.572
0.537
0.503
288
0.464
0.484
0.709
0.609
1.056
0.786
1.462
1.320
0.843
0.683
1.270
1.351
0.472
0.486
0.818
0.649
0.722
0.638
0.653
0.579
672
0.608
0.566
0.786
0.655
1.192
0.926
1.669
1.461
-
-
1.381
1.467
0.620
0.574
0.932
0.712
0.708
0.601
0.757
0.642
Elec.
24
0.153
0.250
0.287
0.374
0.312
0.387
0.297
0.374
0.439
0.388
0.305
0.384
0.136
0.242
0.354
0.423
0.379
0.561
0.255
0.350
48
0.167
0.264
0.307
0.388
0.392
0.431
0.316
0.389
0.413
0.455
0.317
0.392
0.153
0.258
0.376
0.438
0.453
0.600
0.279
0.368
168
0.179
0.275
0.332
0.407
0.515
0.509
0.426
0.466
0.506
0.518
0.358
0.423
0.175
0.275
0.402
0.456
0.575
0.616
0.302
0.385
336
0.199
0.297
0.349
0.420
0.759
0.625
0.365
0.417
0.647
0.596
0.349
0.416
0.196
0.296
0.417
0.466
0.637
0.633
0.320
0.399
WTH
24
0.302
0.364
0.307
0.363
0.335
0.381
0.435
0.477
0.283
0.507
0.321
0.367
0.298
0.360
0.320
0.373
0.356
0.463
0.316
0.369
48
0.361
0.412
0.374
0.418
0.395
0.459
0.426
0.495
0.337
0.573
0.386
0.423
0.359
0.411
0.380
0.421
0.429
0.500
0.381
0.420
168
0.455
0.484
0.491
0.506
0.608
0.567
0.727
0.671
0.397
0.652
0.491
0.501
0.464
0.491
0.479
0.495
0.511
0.550
0.490
0.501
336
0.487
0.505
0.525
0.530
0.702
0.620
0.754
0.670
0.394
0.639
0.502
0.507
0.497
0.517
0.505
0.514
0.575
0.584
0.532
0.527
720
0.508
0.519
0.556
0.552
0.831
0.731
0.885
0.773
-
-
0.498
0.508
0.533
0.542
0.519
0.525
0.547
0.577
0.554
0.543
Lora
24
0.198
0.252
0.212
0.267
0.376
0.345
0.456
0.394
0.161
0.373
0.854
0.775
0.202
0.259
0.264
0.302
0.365
0.514
0.198
0.243
48
0.254
0.301
0.266
0.316
0.428
0.420
0.663
0.467
0.204
0.439
0.851
0.774
0.258
0.307
0.319
0.345
0.426
0.562
0.254
0.297
168
0.346
0.377
0.354
0.389
0.734
0.597
0.682
0.510
0.270
0.536
1.118
0.839
0.350
0.383
0.474
0.477
0.481
0.587
0.345
0.374
336
0.414
0.428
0.425
0.441
0.995
0.738
1.068
0.608
0.395
0.618
1.111
0.836
0.417
0.432
0.625
0.588
0.588
0.645
0.412
0.427
720
0.517
0.502
0.522
0.509
1.181
0.831
0.959
0.622
-
-
1.131
0.844
0.524
0.507
1.266
0.876
0.592
0.649
0.514
0.501
Avg.
0.545
0.499
0.697
0.571
0.990
0.708
1.138
0.798
0.753
0.651
1.057
0.781
0.561
0.505
0.837
0.637
0.838
0.675
0.665
0.556
+
+Table 12: Classification result of the UEA dataset
+
+
Dataset
AutoTCL
TS2Vec
T-Loss
TNC
TS-TCC
TST
DTW
TF-C
InfoTS
ArticulatoryWordRecognition
0.983
0.987
0.943
0.973
0.953
0.977
0.987
0.467
0.993
AtrialFibrillation
0.467
0.200
0.133
0.133
0.267
0.067
0.200
0.040
0.267
BasicMotions
1.000
0.975
1.000
0.975
1.000
0.975
0.975
0.475
1.000
CharacterTrajectories
0.976
0.995
0.993
0.967
0.985
0.975
0.989
0.090
0.987
Cricket
1.000
0.972
0.972
0.958
0.917
1.000
1.000
0.125
1.000
DuckDuckGeese
0.700
0.680
0.650
0.460
0.380
0.620
0.600
0.340
0.600
EigenWorms
0.901
0.847
0.840
0.840
0.779
0.748
0.618
-
0.748
Epilepsy
0.978
0.964
0.971
0.957
0.957
0.949
0.964
0.217
0.993
ERing
0.944
0.874
0.133
0.852
0.904
0.874
0.133
0.167
0.953
EthanolConcentration
0.354
0.308
0.205
0.297
0.285
0.262
0.323
0.247
0.323
FaceDetection
0.581
0.501
0.513
0.536
0.544
0.534
0.529
0.502
0.525
FingerMovements
0.640
0.480
0.580
0.470
0.460
0.560
0.530
0.510
0.620
HandMovementDirection
0.432
0.338
0.351
0.324
0.243
0.243
0.231
0.405
0.514
Handwriting
0.384
0.515
0.451
0.249
0.498
0.225
0.286
0.051
0.554
Heartbeat
0.785
0.683
0.741
0.746
0.751
0.746
0.717
0.737
0.771
JapaneseVowels
0.984
0.984
0.989
0.978
0.930
0.978
0.949
0.135
0.986
Libras
0.833
0.867
0.883
0.817
0.822
0.656
0.870
0.067
0.889
LSST
0.554
0.537
0.509
0.595
0.474
0.408
0.551
0.314
0.593
MotorImagery
0.570
0.510
0.580
0.500
0.610
0.500
0.500
0.500
0.610
NATOPS
0.944
0.928
0.917
0.911
0.822
0.850
0.883
0.533
0.939
PEMS-SF
0.838
0.682
0.676
0.699
0.734
0.740
0.711
0.312
0.757
PenDigits
0.984
0.989
0.981
0.979
0.974
0.560
0.977
0.236
0.989
PhonemeSpectra
0.218
0.233
0.222
0.207
0.252
0.085
0.151
0.026
0.233
RacketSports
0.914
0.855
0.855
0.776
0.816
0.809
0.803
0.480
0.829
SelfRegulationSCP1
0.891
0.812
0.843
0.799
0.823
0.754
0.775
0.502
0.887
SelfRegulationSCP2
0.578
0.578
0.539
0.550
0.533
0.550
0.539
0.500
0.527
SpokenArabicDigits
0.925
0.932
0.905
0.934
0.970
0.923
0.963
0.100
0.988
StandWalkJump
0.533
0.467
0.333
0.400
0.333
0.267
0.200
0.333
0.467
UWaveGestureLibrary
0.893
0.884
0.875
0.759
0.753
0.575
0.903
0.125
0.906
InsectWingbeat
0.488
0.466
0.156
0.469
0.264
0.105
-
0.108
0.472
Avg. ACC
0.742
0.704
0.658
0.670
0.668
0.617
0.629
0.298
0.730
Avg. RANK
2.300
3.700
4.667
5.433
5.133
6.133
5.400
8.200
2.367
\ No newline at end of file
diff --git a/parametricaugmentationfortimeseriescontrastivelearning/images.zip b/parametricaugmentationfortimeseriescontrastivelearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..fa33d829ac922362887dda8d3a168a499fa164b1
--- /dev/null
+++ b/parametricaugmentationfortimeseriescontrastivelearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:178b964c190bfb4baadadac05ff15eca639e5db3a1f0fb25aabe2efe8aede87d
+size 2022072
diff --git a/parametricaugmentationfortimeseriescontrastivelearning/layout.json b/parametricaugmentationfortimeseriescontrastivelearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..71d4d479fe316cef66048bb760ad0853b0a36d6b
--- /dev/null
+++ b/parametricaugmentationfortimeseriescontrastivelearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09cc505e34eea047cd3e911e6454910903301a0032d07be5c861c138bce0d0f6
+size 898456
diff --git a/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_content_list.json b/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f520b7e019ac267e88e83c9c6d7a9b4a68ec6bbc
--- /dev/null
+++ b/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6eec11cc60af742c6ef80aab04497cc3619f05c5140efb97f7dd24a19afce109
+size 184856
diff --git a/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_model.json b/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b18140656c25d9d37844b7723e27bca05361626
--- /dev/null
+++ b/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77d0fdf0813afeb78743ef7e183e6eb1f7d80f9b90bb9f9396467e8da0a78152
+size 233422
diff --git a/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_origin.pdf b/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..26a2688b38bb3f4c357c37eae1d7d9aee6dd83a9
--- /dev/null
+++ b/paretodeeplongtailedrecognitionaconflictaversesolution/8761befc-ed68-47b8-bee0-9a720ca5730a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f59668d0419e0f0622a29d3cfb0d2ee735c46ec10b3fa437ddbd01914277ddd0
+size 3533904
diff --git a/paretodeeplongtailedrecognitionaconflictaversesolution/full.md b/paretodeeplongtailedrecognitionaconflictaversesolution/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8ea6a46da74f1fd0b3aa137cb6a5e31d17ffeb6d
--- /dev/null
+++ b/paretodeeplongtailedrecognitionaconflictaversesolution/full.md
@@ -0,0 +1,858 @@
+# PARETO DEEP LONG-TAILED RECOGNITION: A CONFLICT-AVERSE SOLUTION
+
+Zhipeng Zhou $^{1}$ , Liu Liu $^{2,\dagger}$ , Peilin Zhao $^{2}$ , Wei Gong $^{1,\dagger}$
+
+1University of Science and Technology of China, 2Tencent AI Lab
+
+zzp1994@mail.ustc.edu.cn, {leonliuliu, masonzhao}@tencent.com
+
+weigong@ustc.edu.cn
+
+# ABSTRACT
+
+Deep long-tailed recognition (DLTR) has attracted much attention due to its close touch with realistic scenarios. Recent advances have focused on re-balancing across various aspects, e.g., sampling strategy, loss re-weighting, logit adjustment, and input/parameter perturbation, etc. However, few studies have considered dynamic re-balancing to address intrinsic optimization conflicts, which are identified as prevalent and critical issues in this study. In this paper, we empirically establish the severity of the optimization conflict issue in the DLTR scenario, which leads to a degradation of representation learning. This observation serves as the motivation for pursuing Pareto optimal solutions. Unfortunately, a straightforward integration of multi-objective optimization (MOO) with DLTR methods is infeasible due to the disparity between multi-task learning (MTL) and DLTR. Therefore, we propose effective alternatives by decoupling MOO-based MTL from a temporal perspective rather than a structural one. Furthermore, we enhance the integration of MOO and DLTR by investigating the generalization and convergence problems. Specifically, we propose optimizing the variability collapse loss, guided by the derived MOO-based DLTR generalization bound, to improve generalization. Additionally, we anticipate worst-case optimization to ensure convergence. Building upon the proposed MOO framework, we introduce a novel method called Pareto deep LOng-Tailed recognition (PLOT). Extensive evaluations demonstrate that our method not only generally improves mainstream pipelines, but also achieves an augmented version to realize state-of-the-art performance across multiple benchmarks. Code is available at https://github.com/zzpustc/PLOT.
+
+# 1 INTRODUCTION
+
+Nowadays success of machine learning (ML) techniques are largely attributed to the growing scale of the training dataset, as well as the assumption of it being independent and identically distributed (i.i.d) with the test distribution. However, such an assumption can hardly hold in many realistic scenarios where training sets show an imbalanced or even long-tailed distribution, raising a critical challenge to the traditional ML community (Zhang et al., 2021b). To address this issue, recent researches devoted on deep long-tailed recognition (DLTR) has gained increasing interests, which strives to mitigate the bias toward certain categories and generalize well on a balanced test dataset.
+
+Plenty of approaches have been proposed to realize re-balancing from various aspects in DLTR (Zhang et al., 2021b): sampling strategy (Zang et al., 2021; Cai et al., 2021), loss function (Wang et al., 2013; Ren et al., 2020; Tan et al., 2020), logit adjustment (Cao et al., 2019; Li et al., 2022), data augmentation (Kim et al., 2020; Wang et al., 2021), input/parameter perturbation (Rangwani et al., 2022; Zhou et al., 2023), decoupling learning regime (Kang et al., 2019), and diverse experts (Wang et al., 2020b; Guo & Wang, 2021), etc. Usually, these works design fixed re-balancing strategies according to the prior of the class frequency to ensure all categories are generally equally optimized.
+
+Several very recent researches (Ma et al., 2023; Sinha & Ohashi, 2023; Tan et al., 2023) empirically indicate that a dynamic re-balancing strategy is required, and achieve it by designing a quantitative
+
+
+(a) ERM
+
+
+(b) LDAM-DRW
+
+
+(c) Bal. Softmax
+
+
+(d) M2m
+
+
+(e) MiSLAS
+
+
+(f) GCL
+
+
+Figure 1: Gradient conflicts among categories. 'Bal. Softmax' is short for Balanced Softmax. The horizontal and vertical coordinates are for each category and the heat map represents the gradient similarity.
+(a) ERM
+Figure 2: Gradient similarities during optimization. '0', '4', and '9' denote the corresponding categories in CIFAR10-LT, belonging to the 'head', 'medium', 'tail' classes. Please refer to the gradient norm examination in Section 4.5 of the Appendix.
+
+
+(b) LDAM-DRW
+
+
+(c) Bal. Softmax
+
+
+(d) M2m
+
+
+(e) MiSLAS
+
+
+(f) GCL
+
+measurement of semantic scale imbalance and a meta module to learn from logit, etc. All these works take the instant rather than prior imbalance into consideration, enabling them to reach a competitive performance across various imbalanced scenarios. Nevertheless, a question is naturally raised:
+
+Is instant imbalance enough for designing a dynamic re-balancing strategy?
+
+We then delve into the optimization of representative DLTR models and present related observations from the perspective of multi-objective optimization (MOO) in Fig. 1 and Fig. 2. As depicted, intrinsic optimization conflicts among categories are prevalent and might be aggravated due to the dominated trajectories of certain categories, which would lead to sub-optimal solutions for the remaining ones. Such an issue is rarely discussed for the above question and cannot be addressed by current dynamic strategies due to their lack of design nature (Refer to Section 3 for more details).
+
+To fill this gap, we approach DLTR from a new angle, i.e., mitigate optimization conflicts via dynamic re-balancing, which is usually neglected in past works. We first identify the existing intrinsic gradient conflicts among categories in the optimization of prevailing DLTR methods and show their connection with the adopted fix re-balancing strategies. To prevent the representation from being overwhelmed by dominated categories' properties, we introduce MOO in MTL to mine the shared features among categories. Unfortunately, a naive combination is not applicable due to the structure difference between MTL and DLTR as illustrated in Fig. 6. Specifically, MOO-based MTL usually assumes that the model architecture is consist of a backbone network and several separate task-specific branches on top of the backbone network, and strives to learn task-shared features with backbone network via MOO algorithms. While DLTR targets only one task and owns only one branch. Hence a critical challenge appears:
+
+# How to engage MOO into DLTR?
+
+As depicted in Fig. 6, we tackle this challenge with two key enablers: (1) Regarding a multiclass classification task as multiple binary classification tasks, (2) transform the shared feature extraction and task-specific optimization from structural to temporal. Besides, by investigating several popular MOO approaches and choosing a stable one, we provide instructions on the integration of DLTR and MOO, propose variability collapse loss, and anticipate worst-case optimization to ensure generalization and convergence. It should be noted that our goal is to provide a distinct angle of re-balancing rather than design a new instant imbalance metric or MOO method, thus comparing our approach with these counterparts is beyond the scope of this paper.
+
+Contributions: Our contributions can mainly be summarized as four-fold:
+
+- Through the lens of MOO, we empirically identify the phenomena of optimization conflicts among categories and establish its severity for representation learning in DLTR.
+- To mitigate the above issues, we endow prevailing re-balancing models with Pareto property via innovatively transforming the MOO-based MTL from structural to temporal, enabling the application of MOO algorithm in DLTR without model architecture modifications.
+- Moreover, two theoretical motivated operations, i.e., variability collapse loss, and anticipating worst-case optimization are proposed to further ensure the generalization and convergence of MOO-based DLTR.
+- Extensive evaluations have demonstrated that our method, PLOT, can significantly enhance the performance of mainstream DLTR methods, and achieve state-of-the-art results across multiple benchmarks compared to its advanced counterparts.
+
+# 2 PRELIMINARIES
+
+Problem Setup: Taking a $K$ -way classification task for example, assume we are given a long-tailed training set $\mathcal{S} = (\pmb{x}_i,\pmb{y}_i|i = 1,\dots ,n)$ for the DLTR problem. And the corresponding per-class sample numbers are $\{n_1,n_2,\ldots ,n_K\}$ , $n = \sum_{i}^{K}n_{i}$ . Without loss of generality, we assume $n_i < n_j$ if $i < j$ , and usually $n_K\gg n_1$ . Following the general DLTR setting, all models are finally evaluated on a balanced test dataset.
+
+Pareto Concept: Our framework hinges on MOO-based MTL, which strives to achieve the Pareto optimum under the MTL situation. Formally, assume that there are $N$ tasks at hand, and their differentiable loss functions are $\mathcal{L}_i(\pmb{\theta}), i \in [N]$ . The weighted loss is $\mathcal{L}_{\omega} = \sum_{i=1}^{N} \omega_i \mathcal{L}_i(\pmb{\theta}), \omega \in \mathcal{W}$ , where $\pmb{\theta}$ is the parameter of the model and $\mathcal{W}$ is the probability simplex on $[N]$ . A point $\pmb{\theta}'$ is said to Pareto dominate $\pmb{\theta}$ , only if $\forall i, \mathcal{L}_i(\pmb{\theta}') \leq \mathcal{L}_i(\pmb{\theta})$ . And therefore the Pareto optimal is the situation that no $\pmb{\theta}'$ can be found that holds $\forall i, \mathcal{L}_i(\pmb{\theta}') \leq \mathcal{L}_i(\pmb{\theta})$ for the point $\pmb{\theta}$ . All points that satisfy the above conditions are called Pareto sets, and their solutions are so-called Pareto fronts. Another concept called Pareto stationary, which requires $\min_{\omega \in \mathcal{W}} \|g_{\omega}\| = 0$ , where $g_{\omega}$ is the weighted gradient. In this paper, since we regard the $K$ -way classification task as $K$ binary tasks, $N$ is assigned as $K$ .
+
+Definition 2.1 (Gradient Similarity). Denote $\phi_{ij}$ as the angle between two task gradients $\mathbf{g}_i$ and $\mathbf{g}_j$ , then we define the gradient similarity as $\cos \varphi_{ij}$ and the gradients as conflicting when $\cos \phi_{ij} < 0$ .
+
+Definition 2.2 (Dominated Conflicting). For task gradients $\pmb{g}_i$ and $\pmb{g}_j$ , assume their average gradient as $\pmb{g}_0$ , and $\| \pmb{g}_i \| < \| \pmb{g}_j \|$ . Then we define the gradients as dominated conflicting when $\cos \phi_{0i} < 0$ .
+
+# 3 MOTIVATION AND EMPIRICAL OBSERVATIONS
+
+Intrinsic Property in Definition and Difference with MTL: As outlined in Section 2, a DLTR model is trained on an imbalanced dataset but is expected to generalize well to all categories, which aligns with the motivation of Pareto optimality, i.e., improving all individual tasks (categories). However, unlike MTL, which employs a distinct structure where the backbone and corresponding branches are responsible for shared feature extraction and task-specific optimization, respectively, the structures in DLTR are attributed to all categories. This difference impedes DLTR models from achieving Pareto properties. Therefore, in Section 4, we introduce the MOO-based DLTR pipeline. Optimization Conflicts under Imbalanced Scenarios: As depicted in Fig. 3, it is evident that
+
+
+Figure 3: Illustration of gradient conflict scenarios.
+
+each task exhibits improvement when optimized using the average gradient, i.e., $g_{mean}$ , in balanced
+
+Table 1: Benefits of MOO methods for mainstream DLTR models on CIFAR10-LT. We re-implement all models via their publicly released code, and all results are reported over 3 random seeds experiments. $\checkmark$ indicates outperforms/underperforms their vanilla versions, while the early stop version is colored and the naive integration version is underlined.
+
+
Amb.
cRT+Mixup
LDAM-DRW
Vanilla
w/ EPO
w/ MGDA
w/ CAGrad
Vanilla
w/ EPO
w/ MGDA
w/ CAGrad
200
73.06
33.45
76.24▲
68.05
75.98▲
75.15
76.02▲
71.38
56.04
73.64▲
67.18
74.08▲
100
79.15
34.27
79.69▲
73.71
79.26▲
79.58
80.16▲
77.71
66.49
77.25▼
73.70
77.79▲
50
84.21
36.53
83.79▼
79.27
84.15▼
83.52
84.49▲
81.78
72.60
81.62▼
78.24
81.58▼
Amb.
Balanced Softmax
M2m
Vanilla
w/ EPO
w/ MGDA
w/ CAGrad
Vanilla
w/ EPO
w/ MGDA
w/ CAGrad
200
81.33
45.37
81.40▲
74.13
80.90▼
79.20
80.93▼
73.43
51.90
73.07▼
57.14
72.63▼
100
84.90
44.33
85.30▲
79.06
85.10▲
83.77
85.40▲
77.55
57.89
76.57▼
52.37
76.48▼
50
89.17
41.43
88.97▼
79.43
88.90▼
88.00
89.27▲
80.94
42.07
81.19▲
46.38
80.66▼
Amb.
MiSLAS
GCL
Vanilla
w/ EPO
w/ MGDA
w/ CAGrad
Vanilla
w/ EPO
w/ MGDA
w/ CAGrad
200
76.59
36.62
76.97▲
63.40
76.12▼
76.30
77.43▲
79.25
62.08
79.73▲
75.43
80.03▲
100
81.33
39.92
81.22▼
68.09
82.00▲
82.10
82.47▲
82.85
74.78
82.75▼
79.01
82.81▼
50
85.23
44.78
84.60▼
70.20
84.84▼
85.20
85.33▲
86.00
78.42
84.55▼
81.89
85.58▼
+
+scenarios where conflicts arise. However, in imbalanced scenarios, the utilization of $g_{mean}$ tends to favor the dominant tasks. This preference becomes particularly pronounced in extreme cases, where even when $g_{mean}$ and $g_{j}$ are in conflict (referred to as Dominated Conflicting in Definition 2.2), the optimization of task $i$ leads to an enhancement in its performance at the expense of task $j$ . In order to investigate the presence of optimization conflict issues in DLTR, we meticulously analyze several re-balancing regimes: (1) Cost-sensitive loss approaches, such as LDAM-DRW (Cao et al., 2019) and BalancedSoftmax (Ren et al., 2020); (2) Augmentation techniques, such as M2m (Kim et al., 2020); and (3) Decoupling methods, including cRT + Mixup (Kang et al., 2019), MiSLAS (Zhong et al., 2021), and GCL (Li et al., 2022). By computing the cosine similarities among gradients (referred to as Gradient Similarity in Definition 2.1) associated with different categories, we illustrate the conflict status of these methods in Fig. 11. As depicted, all the selected methods exhibit varying degrees of gradient conflicts, which persist in the early stages of training (refer to Section 4.2 in the Appendix). Furthermore, we examine the optimization preference of DLTR models in Fig. 2, revealing that certain categories dominate the overall optimization process. Additionally, we provide statistical analysis on the frequency of dominated conflicting instances in Fig. 5, establishing a roughly positive correlation between the frequency of dominated conflicting and the imbalance ratio.
+
+
+(a) Class 0 in vanilla.
+
+
+(b) Class 9 in vanilla.
+
+
+Figure 4: Hessian spectrum analysis of before and after addressing optimization conflict issue.
+
+
+(c) Class 0 in addressed one.(d) Class 9 in addressed one.
+
+The Benefit of Addressing Optimization Conflicts: Here we provide a preview of the advantages achieved by addressing optimization conflicts through the utilization of our temporal design, as outlined in Section 4.1. We present the benefits from two perspectives: (1) representation analysis and (2) performance improvements. To gain insights into the impact of addressing the optimization conflict issue on representation learning, we conducted a Hessian spectrum analy-
+
+
+Figure 6: Comparison of MOO-based MTL and MOO-based DLTR.
+
+sis (Rangwani et al., 2022) and visualized the results in Fig. 4. Our analysis reveals that addressing optimization conflicts results in flatter minima for each class, thereby mitigating the risk of being trapped at saddle points and facilitating the acquisition of more generalized representations. Furthermore, we demonstrate the performance benefits achieved by employing various MOO approaches in Table 1. The results effectively showcase the potential of integrating MOO with DLTR.
+
+Urgency of Conflict-Averse Strategy: Currently, our MOO-based DLTR framework can primarily be classified as a specialized dynamic re-balancing strategy, formally formulated as $\mathcal{L}(\boldsymbol{x},\boldsymbol{y}) = \frac{\sum_{k=1}^{K}\omega_k\cdot B_j\cdot l(\boldsymbol{x}_*^k,\boldsymbol{y}_*)}{B}$ . Here $B$ is the batch size, $B_*$ and $\omega_*$ represent the frequency and dynamic re-weighting factor of class *, respectively, and $\bar{l}(\boldsymbol{x}_*^k,\boldsymbol{y}_*)$ is the average loss of class *. While there are existing studies that explore the concept of dynamic rebalancing (Tan et al., 2023; Sinha & Ohashi, 2023; Ma et al., 2023), none of them address the issue of optimization conflicts from a comprehensive perspective. Consequently, the intrinsic optimization conflicts among cate
+
+gories cannot be effectively mitigated (See Section 4.4 in the Appendix). Fortunately, our work bridges this gap and offers a solution to this problem.
+
+
+Figure 5: Statistical of dominated conflicts.
+
+# 4 PARETO DEEP LONG-TAILED RECOGNITION
+
+Building on the aforementioned analysis, we present a detailed design for integrating MOO into DLTR, which encompasses its adaptation from MTL to DLTR and an augmented version to ensure generalization and convergence. For complete proofs of the proposed theorems, please refer to Section 1 of the Appendix.
+
+# 4.1 MOO: FROM MTL TO DLTR
+
+As stated previously, a straightforward integration of MOO is not feasible for DLTR scenarios due to differences in task properties and architectures. Upon revisiting the function of each component in MOO-based MTL, they can be categorized into two aspects: (1) Shared feature extraction (SFE) and (2) Task-specific optimization (TSO). SFE aims to extract shared representations among distinct tasks, while TSO is responsible for the corresponding task performance with the independent branch. In this study, we approach the multi-classification task by treating it as multiple binary classification tasks. Each binary classification task is considered as a single objective in MOO, and we re-design SFE and TSO from a temporal perspective during the training stage, rather than a structural one. Specifically, we implement SFE in the first $E$ epochs by applying MOO algorithms in DLTR models, but release it in the subsequent stages, as illustrated in Fig. 6. This approach can also be interpreted as an early stopping operation, inspired by previous research (Cadena et al., 2018; Hu et al., 2021) suggesting that the early layers of neural networks undergo fewer changes in the later stages of training. To validate the effectiveness of this design, we employ three representative MOO algorithms, i.e., MGDA (Désidéri, 2012), EPO (Mahapatra & Rajan, 2020), and CAGrad (Liu et al., 2021a), to
+
+equip them on the aforementioned six DLTR models, and the results are presented in Table. 1. The results demonstrate that our design enables MOO to enhance DLTR models in most cases, which also highlights the potential benefits of addressing the optimization conflict problem. Moreover, the performance would significantly deteriorate without an early stop (naive integration version), indicating class-specific feature degradation. It is also noteworthy that CAGrad exhibits a relatively stable performance across various baselines, thus we select it as the fundamental framework for further enhancement2.
+
+Remark (No Modifications on Model Architecture). Once again, it is important to emphasize that our approach does not involve any modifications to the model architecture. Rather, our method represents an effective learning paradigm for the application of MOO in DLTR.
+
+# 4.2 CHALLENGES OF CAGRAD UNDER DLTR
+
+Generalization Problem: Prior to delving into the additional technical designs of PLOT, it is necessary to establish the learning guarantees for the MOO-based DLTR framework. To this end, we introduce $\omega_{k}$ into the definition of Rademacher complexity (Cortes et al., 2020), which can be reformulated as follows:
+
+$$
+\mathfrak {R} _ {S} (\boldsymbol {\mathcal {G}}, \boldsymbol {\omega}) = \underset {\sigma} {\mathbb {E}} \left[ \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \sum_ {k = 1} ^ {K} \boldsymbol {\omega} _ {\boldsymbol {k}} \frac {1}{m _ {k}} \sum_ {i = 1} ^ {m _ {k}} \sigma_ {i} \cdot l \left(\boldsymbol {h} \left(\boldsymbol {x} _ {i} ^ {k}\right), \boldsymbol {y} _ {i} ^ {k}\right) \right] \tag {1}
+$$
+
+where $\mathcal{G}$ is associated to the hypothesis set as $\mathcal{H}:\{\mathcal{G}:(\boldsymbol {x},\boldsymbol {y})\mapsto l(\boldsymbol {h}(\boldsymbol {x}),\boldsymbol {y}):\forall \boldsymbol {h}\in \mathcal{H}\}$ ; $\sigma_{i}$ is the independent uniformly distributed random variables taking values in $\{-1, + 1\}$ . From this definition, we have the following theorem:
+
+Theorem 4.1. (MOO-based DLTR Generalization Bound) If the loss function $l_{k}$ belonging to $k_{th}$ category is $M_{k}$ -Lipschitz, and $\forall (\pmb{x},\pmb{y}),(\pmb{x}^{\prime},\pmb{y}^{\prime})\in \mathcal{X}\times \mathcal{Y},\forall \pmb {h}\in \mathcal{H}$ $\| [h(\pmb {x}),\pmb {y}] - [\pmb {h}(\pmb{x}^{\prime}),\pmb{y}^{\prime}]\| \leq$ $\mathcal{D}_{\mathcal{H}}$ assume $M_{k}\mathcal{D}_{\mathcal{H}}$ is bounded by $M$ then for any $\epsilon >0$ and $\delta >0$ with probability at least $1 - \delta$ the following inequality holds for $\forall \pmb {h}\in \mathcal{H}$ and $\forall \omega \in \mathcal{W}$ ..
+
+$$
+\mathcal {L} _ {\boldsymbol {\omega}} (\pmb {h}) \leq \hat {\mathcal {L}} _ {\boldsymbol {\omega}} (\pmb {h}) + 2 \Re_ {S} (\pmb {\mathscr {G}}, \boldsymbol {\omega}) + \sum_ {k = 1} ^ {K} \omega_ {k} M \sqrt {\frac {\log \frac {1}{\delta}}{2}}
+$$
+
+The above derived generalization bound indicates that we should minimize $\hat{\mathcal{L}}_{\omega}(h)$ as well as constrain the intra-class loss variability $M$ . With this theoretical insight, we design the following variability collapse loss:
+
+$$
+\mathcal {L} _ {v c} = \frac {1}{K} \sum_ {k = 1} ^ {K} \operatorname {S t d} \left(\widetilde {l} \left(\boldsymbol {x} _ {*} ^ {k}, \boldsymbol {y} _ {*} ^ {k}\right)\right) \tag {2}
+$$
+
+where $\mathrm{Std}(\cdot)$ is the standard deviation function and $\widetilde{l} (\pmb{x}_{*}^{k},\pmb{y}_{*}^{k})$ is the loss set of the $k_{th}$ category in a mini-batch. It is worth noting that our proposed design shares a similar concept with a recent study (Liu et al., 2023), which aims to induce Neural Collapse in the DLTR setting. However, our approach is distinct in that we propose it from the perspective of MOO with theoretical analysis.
+
+Convergence Problem: On the other hand, although CA-Grad exhibits stability, it may not always yield improvements, as evidenced by Table 1. Consequently, we delve deeper into CAGrad and demonstrate its limitations in the DLTR scenario. Based on the convergence analysis of CAGrad, we present the following theorem:
+
+
+(a) Head
+Figure 7: Loss landscape of LDAM.
+
+
+(b) Tail
+
+Theorem 4.2. (Convergence of CAGrad in DLTR) With a fix step size $\alpha$ and the assumption of $H$ -Lipschitz on gradients, i.e., $\| \nabla \mathcal{L}_i(\pmb {\theta}) - \nabla \mathcal{L}_i(\pmb {\theta}')\| \leq H\| \pmb {\theta} - \pmb {\theta}'\|$ for $i = 1,2,\dots,K$ . Denote $\pmb {d}^{*}(\pmb{\theta}_{t})$ as the optimization direction
+
+$$
+\underline {{\mathcal {L} (\boldsymbol {\theta} _ {t + 1}) - \mathcal {L} (\boldsymbol {\theta} _ {t})}} \leq - \frac {\alpha}{2} (1 - c ^ {2}) \| \boldsymbol {g} _ {0} (\boldsymbol {\theta} _ {t}) \| ^ {2} + \frac {\alpha}{2} (H \alpha - 1) \| \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2},
+$$
+
+where $c \in (0,1)$ and $g_0(\theta_t)$ is the corresponding average gradient of $\theta_t$ . The convergence of CAGrad is inherently influenced by the value of $H$ , as observed in our experiments. This observation is further supported by a related study (Fernando et al., 2022), which introduces random noise to the optimization trajectory of CAGrad and demonstrates convergence failures. Additionally, it is widely acknowledged that achieving a small value of $H$ for tail classes in DLTR models is often unattainable (Rangwani et al., 2022; Zhou et al., 2023). To visually illustrate this point, we provide a depiction of the LDAM-DRW loss landscape in Fig. 7 (for more visual illustrations, please refer to Section 7.2 in the Appendix). In this particular case, the loss landscape of the tail class exhibits a sharp minimum, indicating a large value of $H$ and consequently posing challenges for achieving convergence when integrating CAGrad with DLTR models. To solve this problem, we constrain $H$ by anticipating worst-case optimization (Foret et al., 2020), i.e., Sharpness aware minimization (SAM):
+
+$$
+\min _ {\boldsymbol {\theta}} \max _ {\epsilon (\boldsymbol {\theta})} \mathcal {L} (\boldsymbol {\theta} + \epsilon (\boldsymbol {\theta})) \text {, w h e r e} \| \epsilon (\boldsymbol {\theta}) \| _ {2} \leq \rho , \tag {3}
+$$
+
+where the inner optimization can be approximated via the first order Taylor expansion, which results in the following solution ( $\rho$ is a hyper-parameter):
+
+$$
+\hat {\epsilon} (\boldsymbol {\theta}) = \rho \nabla_ {\boldsymbol {\theta}} \mathcal {L} (\boldsymbol {\theta}) / \left(\| \nabla_ {\boldsymbol {\theta}} \mathcal {L} (\boldsymbol {\theta}) \| _ {2} ^ {2}\right) ^ {\frac {1}{2}} \tag {4}
+$$
+
+Overall Optimization Procedure: At the $t_\mathrm{th}$ step of the SFE stage, we first compute the original loss $\mathcal{L}(\theta)$ for a mini-batch, and obtain the perturbative loss $\mathcal{L}_{SAM} = \mathcal{L}(\pmb {\theta} + \hat{\epsilon} (\pmb {\theta}))$ according to Eqn. 4, as well as the variability collapse loss $\mathcal{L}_{vc}$ defined in Eqn. 2 based on perturbative loss. Thus we have the average gradient $\pmb {g_0}$ and the class-specific gradient $\pmb {g}_i,i\in \{1,2,\dots,K\}$ by back propagating $\mathcal{L}_{moo} = \mathcal{L}_{SAM} + \mathcal{L}_{vc}$ . Finally, the dynamic class weights $\omega = \{\omega_{1},\omega_{2},\dots,\omega_{K}\}$ is obtained by solving CAGrad (Liu et al., 2021a):
+
+$$
+\min _ {\boldsymbol {\omega} \in \mathcal {W}} F (\omega) := \boldsymbol {g} _ {\boldsymbol {\omega}} ^ {\top} \boldsymbol {g} _ {\boldsymbol {0}} + \sqrt {\phi} \| \boldsymbol {g} _ {\boldsymbol {\omega}} \|, \text {w h e r e} \phi = c ^ {2} \| \boldsymbol {g} _ {\boldsymbol {0}} \| ^ {2}, \tag {5}
+$$
+
+and update the model via: $\theta_{t} = \theta_{t - 1} - \alpha \left(g_{0} + \frac{\phi^{1 / 2}}{\|g_{\omega}\|} g_{\omega}\right), g_{\omega} = \sum_{i}^{K}\omega_{i}*g_{i}$ . The overall pseudo algorithm is summarized in the Section 6.2 of the Appendix.
+
+# 4.3 IMPLEMENTATION DETAILS
+
+We implement our code with Python 3.8 and PyTorch 1.4.0, while all experiments are carried out on Tesla V100 GPUs. We train each model with batch size of 64 (for CIFAR10-LT and CIFAR100-LT) / 128 (for Places-LT) / 256 (for ImageNet-LT and iNaturalist), SGD optimizer with momentum of 0.9.
+
+# 5 EVALUATION
+
+Following the mainstream protocols, we conduct experiments on popular DLTR benchmarks: CIFAR10-/CIFAR100-LT, Places-LT (Liu et al., 2019), ImageNet-LT (Liu et al., 2019) and iNaturalist2018 (Van Horn et al., 2018). To show the versatility of PLOT, we equip it with the aforementioned popular re-balancing regimes under various imbalance scenarios. Moreover, PLOT achieves the state-of-the-art (SOTA) performance by augmenting the advanced baseline across large scale datasets. Micro benchmarks are elaborated to show the effectiveness of each components finally. For fair comparison, we exclude ensemble or pre-training models in our experiments.
+
+Table 2: Performance on CIFAR datasets.
+
+
CIFAR10-LT
CIFAR100-LT
Imb.
200
100
50
200
100
50
LDAM-DRW
71.38
77.71
81.78
36.50
41.40
46.61
LDAM-DRW + PLOT
74.32
78.19
82.09
37.31
42.31
47.04
M2m
73.43
77.55
80.94
35.81
40.77
45.73
M2m + PLOT
74.48
78.42
81.79
38.43
43.00
47.19
cRT + Mixup
73.06
79.15
84.21
41.73
45.12
50.86
cRT + Mixup + PLOT
78.99
80.55
84.58
43.80
47.59
51.43
Logit Adjustment
-
78.01
-
-
43.36
-
Logit Adjustment + PLOT
-
79.40
-
-
44.19
-
MiSLAS
76.59
81.33
85.23
42.97
47.37
51.42
MiSLAS + PLOT
77.73
81.88
85.70
44.28
47.91
52.66
GCL
79.25
82.85
86.00
44.88
48.95
52.85
GCL + PLOT
80.08
83.35
85.90
45.61
49.50
53.05
+
+# 5.1 VERSATILITY VERIFICATION
+
+Given the inherent optimization conflicts in advanced DLTR models, PLOT can serve as a valuable augmentation technique. Our experimental results, presented in Table 2, demonstrate that PLOT brings improvements in most scenarios by addressing the problem from a new dimension that is orthogonal to current solutions. Notably, cRT + Mixup and LDAM-DRW exhibit the most conflict scenarios and gain the most from PLOT. In fact, cRT + Mixup even achieves competitive performance compared to the state-of-the-art under certain imbalance ratio settings, highlighting the efficacy of PLOT in addressing optimization conflict problems. We also observe a marginal effect of this augmentation, as GCL exhibits marginal improvement or even degradation, owing to the absence of significant optimization conflicts (see Fig. 1).
+
+# 5.2 COMPARISONS WITH SOTA
+
+We further evaluate the effectiveness of PLOT on large-scale datasets, i.e., Places-LT, ImageNet-LT, and iNaturalist, and compare it against mainstream methods in Table 3. Through augmenting two advanced baselines (cRT + Mixup and MiS-LAS), PLOT achieves state-of-the-art performance. Specifically, our approach exhibits a substantial performance advantage over other DLTR models on Places-LT and iNaturalist, two recognized challenging benchmarks due to their high imbalance ratios.
+
+# 5.3 ABLATION STUDY
+
+Our system comprises multiple components, and we aim to demonstrate their individual effectiveness. To this end, we conduct ablation studies and present the relationship between each component and the final performance in Table 4. Our results indicate that the proposed operations, i.e., temporal design (temp), variability collapse loss (var.) and anticipate worst-case optimization (anti.), can significantly enhance the system's performance.
+
+# 5.4 OPTIMIZATION TRAJECTORY ANALYSIS
+
+We capture the optimization trajectories of different categories in LDAM-DRW + PLOT and present them in Fig. 8. In the left figure, the gradient similarity is computed between each category and the average gradient, while in the right figure, it is calculated between each category and the gradient aggregated by MOO. By comparison, the original LDAM-DRW approach exhibits a dominance of head classes in representation learning, resulting in a deterioration of shared feature extraction. In contrast, our augmented version with PLOT demonstrates relatively comparable and stable similarities among categories, indicating the potential for effective extraction of shared features across categories.
+
+Table 3: Performance on large-scale Datasets.
+
+
Dataset
Method
Backbone
Overall
Places-LT
CE
ResNet-152
30.2
Decouple-τ-norm
ResNet-152
37.9
Balanced Softmax
ResNet-152
38.6
LADE
ResNet-152
38.8
RSG
ResNet-152
39.3
DisAlign
ResNet-152
39.3
ResLT
ResNet-152
39.8
GCL
ResNet-152
40.6
cRT + Mixup
ResNet-152
38.5
cRT + Mixup + PLOT
ResNet-152
41.0
MiSLAS
ResNet-152
40.2
MiSLAS + PLOT
ResNet-152
40.5
ImageNet-LT
CE
ResNeXt-50
44.4
Decouple-τ-norm
ResNet-50
46.7
Balanced Softmax
ResNeXt-50
52.3
LADE
ResNeXt-50
52.3
RSG
ResNeXt-50
51.8
DisAlign
ResNet-50
52.9
ResNeXt-50
53.4
ResLT
ResNeXt-50
52.9
LDAM-DRW + SAM
ResNet-50
53.1
GCL
ResNet-50
54.9
cRT + Mixup
ResNet-50
51.7
cRT + Mixup + PLOT
ResNeXt-50
54.3
MiSLAS
ResNet-50
52.7
MiSLAS + PLOT
ResNet-50
53.5
iNat-2018
CE
ResNet-50
61.7
Decouple-τ-norm
ResNet-50
65.6
Balanced Softmax
ResNet-50
70.6
LADE
ResNet-50
70.0
RSG
ResNet-50
70.3
DisAlign
ResNet-50
70.6
ResLT
ResNet-50
70.2
LDAM-DRW + SAM
ResNet-50
70.1
GCL
ResNet-50
72.0
cRT + Mixup
ResNet-50
69.5
cRT + Mixup + PLOT
ResNet-50
71.3
MiSLAS
ResNet-50
71.6
MiSLAS + PLOT
ResNet-50
72.1
+
+Table 4: Ablation studies on CIFAR10-LT when imbalance ratio is set as 200.
+
+
cRT + Mixup | w/ temp | w/ anti. | w/ var. | Acc.
✓
73.06
✓
✓
76.02
✓
✓
✓
77.79
✓
✓
✓
✓
78.99
+
+Figure 8: Gradient similarity with the aggregated gradient before / after applying PLOT on LDAM-DRW.
+
+(a) Gradient similari(b) Gradient similarities of LDAM-DRW. ties of PLOT.
+
+
+
+# 6 RELATED WORKS
+
+# 6.1 DEEP LONG-TAILED RECOGNITION
+
+Recent advancements in DLTR have been driven by three distinct design philosophies: (1) rebalancing strategies on various aspects, (2) ensemble learning, and (3) representation learning. In the first category, considerable efforts have been dedicated to re-sampling (Wang et al., 2019; Zang et al., 2021; Cai et al., 2021; Wei et al., 2021), re-weighting (Park et al., 2021; Kini et al., 2021), re-margining (Feng et al., 2021; Cao et al., 2019; Koltchinskii & Panchenko, 2002), logit adjustment (Menon et al., 2020; Zhang et al., 2021a), and information augmentation (Kim et al., 2020; Yang & Xu, 2020; Zhang et al., 2021), etc. As anticipated, these approaches aim to manually re-balance the model by addressing sample number (through sampling and augmentation), cost sensitivity, prediction margin/logit, and other factors, thereby reducing the bias towards major classes. Ensemble learning-based approaches strive to leverage the expertise of multiple models. Generally, there are several methods for aggregating these models. BBN (Zhou et al., 2020) and SimCAL (Wang et al., 2020a) train experts using both long-tailed and uniformly distributed data and aggregate their outputs. On the other hand, ACE (Cai et al., 2021), ResLT (Cui et al., 2022), and BAGS (Li et al., 2020) train experts on different subsets of categories. SADE (Zhang et al., 2022) employs diverse experts, including long-tailed, uniform, and inverse long-tailed, and adaptively aggregates them using a self-supervised objective.
+
+Recent efforts in representation learning have emerged in decoupling and contrastive learning, which employ distinct regimes to obtain general representations for all categories. Decoupling-based methods (Kang et al., 2019; Zhong et al., 2021; Li et al., 2022) have shown that the representation learned via random sampling strategies is powerful enough, and additional effort devoted to the second stage, i.e., classifier adjustment, can help achieve advanced performance. A recent study (Liu et al., 2021b) has empirically found that contrastive learning-based methods are less sensitive to imbalance scenarios. Thus, these methods (Cui et al., 2021; Zhu et al., 2022) extract general representations via supervised contrastive learning and achieve competitive performance. Our work takes a new approach to DLTR by developing a gradient conflict-averse solution, which is almost orthogonal to current solutions and has been verified to be effective.
+
+# 6.2 MOO-BASED MTL
+
+Multi-task learning (MTL), particularly MOO-based MTL, has garnered significant attention in the machine learning community as a fundamental and practical task. MGDA-UB (Sener & Koltun, 2018) achieves Pareto optimality by optimizing a derived upper bound in large-scale MTL scenarios. PCGrad (Yu et al., 2020) mitigates conflict challenges by projecting gradients on the corresponding orthogonal directions. In contrast, CAGrad (Liu et al., 2021a) develops a provably convergent solution by optimizing the worst relative individual task and constraining it around the average solution. Additionally, EPO (Mahapatra & Rajan, 2020) proposes a preference-guided method that can search for Pareto optimality tailored to the prior. Our work represents the first attempt to integrate MOO into DLTR. We bridge the gap between MTL and DLTR and propose two improvements for further augmentation. Although evaluating PLOT under the MTL setting would be a satisfactory choice, it is beyond the scope of this paper and is left for future investigation.
+
+# 7 CONCLUSION
+
+This paper has presented a novel approach to bridging the gap between MTL and DLTR. Specifically, we proposed a re-design of the MOO paradigm from structural to temporal, with the aim of addressing the challenge of optimization conflicts. To further ensure the convergence and generalization of the MOO algorithm, we optimized the derived MOO-based DLTR generation bound and seek a flatter minima. Our experimental results demonstrated the benefits of injecting the Pareto property across multiple benchmarks. We hope that our findings provide valuable insights for researchers studying the integration of MOO and DLTR, which has been shown to hold great promise. Our future works lie in developing adaptive strategies to apply MOO algorithm more efficiently.
+
+# 8 ACKNOWLEDGEMENTS
+
+We thank anonymous reviewers for their valuable comments. This work was supported by the NSFC under Grants 61932017 and 61971390.
+
+# 9 REPRODUCIBILITY STATEMENT
+
+Further implementation details can be found in Section 2 of the Appendix. Specifically, the supplementary material includes the attached code, which serves as a reference and provides additional information. The provided code demo consists of a prototype trained on the CIFAR10-/100-LT datasets.
+
+# REFERENCES
+
+Santiago A Cadena, Marissa A Weis, Leon A Gatys, Matthias Bethge, and Alexander S Ecker. Diverse feature visualizations reveal invariances in early layers of deep neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 217-232, 2018.
+Jiarui Cai, Yizhou Wang, and Jenq-Neng Hwang. Ace: Ally complementary experts for solving long-tailed recognition in one-shot. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 112-121, 2021.
+Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in neural information processing systems, 32, 2019.
+Corinna Cortes, Mehryar Mohri, Javier Gonzalvo, and Dmitry Storchus. Agnostic learning with multiple objectives. Advances in Neural Information Processing Systems, 33:20485-20495, 2020.
+Jiequan Cui, Zhisheng Zhong, Shu Liu, Bei Yu, and Jiaya Jia. Parametric contrastive learning. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 715-724, 2021.
+Jiequan Cui, Shu Liu, Zhuotao Tian, Zhisheng Zhong, and Jiaya Jia. Result: Residual learning for long-tailed recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
+Jean-Antoine Désideri. Multiple-gradient descent algorithm (mgda) for multiobjective optimization. Comptes Rendus Mathematique, 350(5-6):313-318, 2012.
+Chengjian Feng, Yujie Zhong, and Weilin Huang. Exploring classification equilibrium in long-tailed object detection. In Proceedings of the IEEE/CVF International conference on computer vision, pp. 3417-3426, 2021.
+Heshan Devaka Fernando, Han Shen, Miao Liu, Subhajit Chaudhury, Keerthiram Murugesan, and Tianyi Chen. Mitigating gradient bias in multi-objective learning: A provably convergent approach. In The Eleventh International Conference on Learning Representations, 2022.
+Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020.
+Hao Guo and Song Wang. Long-tailed multi-label visual recognition by collaborative training on uniform and re-balanced samplings. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15089-15098, 2021.
+Jie Hu, Liujuan Cao, Tong Tong, Qixiang Ye, Shengchuan Zhang, Ke Li, Feiyue Huang, Ling Shao, and Rongrong Ji. Architecture disentanglement for deep neural networks. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 672-681, 2021.
+Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. arXiv preprint arXiv:1910.09217, 2019.
+
+Jaehyung Kim, Jongheon Jeong, and Jinwoo Shin. M2m: Imbalanced classification via major-to-minor translation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 13896-13905, 2020.
+Ganesh Ramachandra Kini, Orestis Paraskevas, Samet Oymak, and Christos Thrampoulidis. Label-imbalanced and group-sensitive classification under overparameterization. Advances in Neural Information Processing Systems, 34:18970-18983, 2021.
+Vladimir Koltchinskii and Dmitry Panchenko. Empirical margin distributions and bounding the generalization error of combined classifiers. The Annals of Statistics, 30(1):1-50, 2002.
+Mengke Li, Yiu-ming Cheung, and Yang Lu. Long-tailed visual recognition via gaussian clouded logit adjustment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6929-6938, 2022.
+Yu Li, Tao Wang, Bingyi Kang, Sheng Tang, Chunfeng Wang, Jintao Li, and Jiashi Feng. Overcoming classifier imbalance for long-tail object detection with balanced group softmax. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10991-11000, 2020.
+Bo Liu, Xingchao Liu, Xiaojie Jin, Peter Stone, and Qiang Liu. Conflict-averse gradient descent for multi-task learning. Advances in Neural Information Processing Systems, 34:18878-18890, 2021a.
+Hong Liu, Jeff Z HaoChen, Adrien Gaidon, and Tengyu Ma. Self-supervised learning is more robust to dataset imbalance. arXiv preprint arXiv:2110.05025, 2021b.
+Xuantong Liu, Jianfeng Zhang, Tianyang Hu, He Cao, Yuan Yao, and Lujia Pan. Inducing neural collapse in deep long-tailed learning. In International Conference on Artificial Intelligence and Statistics, pp. 11534-11544. PMLR, 2023.
+Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X Yu. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2537-2546, 2019.
+Yanbiao Ma, Licheng Jiao, Fang Liu, Yuxin Li, Shuyuan Yang, and Xu Liu. Delving into semantic scale imbalance. The Eleventh International Conference on Learning Representations, 2023.
+Debabrata Mahapatra and Vaibhav Rajan. Multi-task learning with user preferences: Gradient descent with controlled ascent in pareto optimization. In International Conference on Machine Learning, pp. 6597-6607. PMLR, 2020.
+Aditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Himanshu Jain, Andreas Veit, and Sanjiv Kumar. Long-tail learning via logit adjustment. arXiv preprint arXiv:2007.07314, 2020.
+Seulki Park, Jongin Lim, Younghan Jeon, and Jin Young Choi. Influence-balanced loss for imbalanced visual classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 735-744, 2021.
+Harsh Rangwani, Sumukh K Aithal, Mayank Mishra, et al. Escaping saddle points for effective generalization on class-imbalanced data. Advances in Neural Information Processing Systems, 35: 22791-22805, 2022.
+Jiawei Ren, Cunjun Yu, Xiao Ma, Haiyu Zhao, Shuai Yi, et al. Balanced meta-softmax for long-tailed visual recognition. Advances in neural information processing systems, 33:4175–4186, 2020.
+Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. Advances in neural information processing systems, 31, 2018.
+Saptarshi Sinha and Hiroki Ohashi. Difficulty-net: Learning to predict difficulty for long-tailed recognition. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 6444-6453, 2023.
+Jingru Tan, Changbao Wang, Buyu Li, Quanquan Li, Wanli Ouyang, Changqing Yin, and Junjie Yan. Equalization loss for long-tailed object recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11662-11671, 2020.
+
+Jingru Tan, Bo Li, Xin Lu, Yongqiang Yao, Fengwei Yu, Tong He, and Wanli Ouyang. The equalization losses: Gradient-driven training for long-tailed object recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023.
+Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8769-8778, 2018.
+Jialei Wang, Peilin Zhao, and Steven CH Hoi. Cost-sensitive online classification. IEEE Transactions on Knowledge and Data Engineering, 26(10):2425-2438, 2013.
+Jianfeng Wang, Thomas Lukasiewicz, Xiaolin Hu, Jianfei Cai, and Zhenghua Xu. Rsg: A simple but effective module for learning imbalanced datasets. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3784-3793, 2021.
+Tao Wang, Yu Li, Bingyi Kang, Junnan Li, Junhao Liew, Sheng Tang, Steven Hoi, and Jiashi Feng. The devil is in classification: A simple framework for long-tail instance segmentation. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XIV 16, pp. 728-744. Springer, 2020a.
+Xudong Wang, Long Lian, Zhongqi Miao, Ziwei Liu, and Stella X Yu. Long-tailed recognition by routing diverse distribution-aware experts. arXiv preprint arXiv:2010.01809, 2020b.
+Yiru Wang, Weihao Gan, Jie Yang, Wei Wu, and Junjie Yan. Dynamic curriculum learning for imbalanced data classification. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 5017-5026, 2019.
+Chen Wei, Kihyuk Sohn, Clayton Mellina, Alan Yuille, and Fan Yang. Crest: A class-rebalancing self-training framework for imbalanced semi-supervised learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10857-10866, 2021.
+Yuzhe Yang and Zhi Xu. Rethinking the value of labels for improving class-imbalanced learning. Advances in neural information processing systems, 33:19290-19301, 2020.
+Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. Advances in Neural Information Processing Systems, 33: 5824-5836, 2020.
+Yuhang Zang, Chen Huang, and Chen Change Loy. Fasa: Feature augmentation and sampling adaptation for long-tailed instance segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3457-3466, 2021.
+Songyang Zhang, Zeming Li, Shipeng Yan, Xuming He, and Jian Sun. Distribution alignment: A unified framework for long-tail visual recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2361-2370, 2021a.
+Yifan Zhang, Bingyi Kang, Bryan Hooi, Shuicheng Yan, and Jiashi Feng. Deep long-tailed learning: A survey. arXiv preprint arXiv:2110.04596, 2021b.
+Yifan Zhang, Bryan Hooi, Lanqing Hong, and Jiashi Feng. Self-supervised aggregation of diverse experts for test-agnostic long-tailed recognition. Advances in Neural Information Processing Systems, 35:34077-34090, 2022.
+Zhisheng Zhong, Jiequan Cui, Shu Liu, and Jiaya Jia. Improving calibration for long-tailed recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16489-16498, 2021.
+Boyan Zhou, Quan Cui, Xiu-Shen Wei, and Zhao-Min Chen. Bbn: Bilateral-branch network with cumulative learning for long-tailed visual recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9719–9728, 2020.
+
+Zhipeng Zhou, Lanqing Li, Peilin Zhao, Pheng-Ann Heng, and Wei Gong. Class-conditional sharpness-aware minimization for deep long-tailed recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3499–3509, June 2023.
+Jianggang Zhu, Zheng Wang, Jingjing Chen, Yi-Ping Phoebe Chen, and Yu-Gang Jiang. Balanced contrastive learning for long-tailed visual recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6908-6917, 2022.
+
+# APPENDIX FOR: PARETO DEEP LONG-TAILED RECOGNITION: A CONFLICT-AVERSE SOLUTION
+
+# Anonymous authors
+
+Paper under double-blind review
+
+# CONTENTS
+
+1 Theoretical proofs 2
+
+1.1 Proof of Theorem 4.1 2
+1.2 Proof of Theorem 4.2 2
+
+2 Details of Implementations 3
+
+2.1 DLTR Methods 3
+2.2 MOO-based MTL Methods 4
+2.3 Datasets 5
+
+3 Open Long-Tailed Recognition Evaluation 5
+4 Additional Experiment Results 5
+
+4.1 Identify Optimization Conflict under Various Conditions 5
+4.2 Gradient Conflicts in the Early Training Stage 6
+4.3 Frequency vs. Loss Value 6
+4.4 Gradient Conflicts Status of Dynamic Re-weighting Approach 7
+4.5 Gradient Norm Examination 7
+4.6 Gradient Similarity Examination after PLOT augmentation 8
+4.7 Apply PLOT on Different Layers 8
+4.8 Gradient Conflicts Status under the Balanced Setting 8
+
+5 Limitation 8
+6 Computational Complexity and Scalability Analysis 9
+
+6.1 Computational Complexity 9
+6.2 Scalability 9
+
+7 Visualizations 10
+
+7.1 Feature Representation Analysis 10
+7.2 Loss Landscape of DLTR models 10
+7.3 Embedding Visualization 11
+7.4 Canonical Correlation Analysis 11
+
+8 Detailed Results on Mainstream Datasets 12
+
+# 1 THEORETICAL PROOFS
+
+# 1.1 PROOF OF THEOREM 4.1
+
+Theorem 1. (MOO-based DLTR Generalization Bound) If the loss function $l_{k}$ belonging to $k_{th}$ category is $M_{k}$ -Lipschitz, and $\forall (\pmb{x},\pmb{y}),(\pmb{x}',\pmb{y}') \in \mathcal{X} \times \mathcal{Y}, \forall \pmb{h} \in \mathcal{H}: \| [\pmb{h}(\pmb{x}),\pmb{y}] - [\pmb{h}(\pmb{x}',\pmb{y}')\| \leq \mathcal{D}_{\mathcal{H}}$ , assume $M_{k}\mathcal{D}_{\mathcal{H}}$ is bounded by $M$ , then for any $\epsilon >0$ and $\delta >0$ , with probability at least $1 - \delta$ , the following inequality holds for $\forall \pmb{h} \in \mathcal{H}$ and $\forall \omega \in \mathcal{W}$ :
+
+$$
+\mathcal {L} _ {\boldsymbol {\omega}} (\boldsymbol {h}) \leq \hat {\mathcal {L}} _ {\boldsymbol {\omega}} (\boldsymbol {h}) + 2 \Re_ {S} (\boldsymbol {\mathcal {G}}, \boldsymbol {\omega}) + \sum_ {k = 1} ^ {K} \omega_ {k} M \sqrt {\frac {\log \frac {1}{\delta}}{2}}
+$$
+
+Proof. $\forall \omega \in \mathcal{W}$ and sample $S = \{(x_1, y_1), \dots, (x_N, y_N)\}$ , let $\Phi(S) = \sup_{h \in \mathcal{H}} \mathcal{L}_{\omega}(h) - \hat{\mathcal{L}_{\omega}}(h)$ . And assume $S'$ is another sample set that contains only one point $(x', y')$ different from $S$ . Thus, we have
+
+$$
+\begin{array}{l} \Phi (S ^ {\prime}) - \Phi (S) = \sup _ {\pmb {h} \in \pmb {\mathcal {H}}} [ \mathcal {L} _ {\pmb {\omega}} (\pmb {h}) - \hat {\mathcal {L}} _ {\pmb {\omega}} ^ {\prime} (\pmb {h}) ] - \sup _ {\pmb {h} \in \pmb {\mathcal {H}}} [ \mathcal {L} _ {\pmb {\omega}} (\pmb {h}) - \hat {\mathcal {L}} _ {\pmb {\omega}} (\pmb {h}) ] \\ \leq \sup _ {\boldsymbol {h} \in \mathcal {H}} [ \mathcal {L} _ {\omega} (\boldsymbol {h}) - \hat {\mathcal {L}} _ {\omega} ^ {\prime} (\boldsymbol {h}) - \mathcal {L} _ {\omega} (\boldsymbol {h}) + \hat {\mathcal {L}} _ {\omega} ^ {\prime} (\boldsymbol {h}) ] \\ = \sup _ {\boldsymbol {h} \in \mathcal {H}} [ \hat {\mathcal {L}} _ {\omega} (\boldsymbol {h}) - \hat {\mathcal {L}} _ {\omega} ^ {\prime} (\boldsymbol {h}) ] \\ = \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \left[ \sum_ {k = 1} ^ {K} \omega_ {k} \frac {1}{m _ {k}} \sum_ {i = 1} ^ {m _ {k}} l \left(\boldsymbol {x} _ {i} ^ {\prime}, \boldsymbol {y} _ {i} ^ {\prime}\right) - \sum_ {k = 1} ^ {K} \omega_ {k} \frac {1}{m _ {k}} \sum_ {i = 1} ^ {m _ {k}} l \left(\boldsymbol {x} _ {i}, \boldsymbol {y} _ {i}\right) \right] \\ = \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \sum_ {k = 1} ^ {K} \omega_ {k} \frac {1}{m _ {k}} \left[ l \left(\boldsymbol {x} _ {\boldsymbol {i}} ^ {\prime}, \boldsymbol {y} _ {\boldsymbol {i}} ^ {\prime}\right) - l \left(\boldsymbol {x} _ {\boldsymbol {i}}, \boldsymbol {y} _ {\boldsymbol {i}}\right) \right] \\ = \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \sum_ {k = 1} ^ {K} \omega_ {k} \frac {1}{m _ {k}} \left[ l \left(\boldsymbol {x} _ {i} ^ {\prime}, \boldsymbol {y} _ {i} ^ {\prime}\right) - l \left(\boldsymbol {x} _ {i}, \boldsymbol {y} _ {i}\right) \right] \\ \leq \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \sum_ {k = 1} ^ {K} \omega_ {k} \frac {1}{m _ {k}} M _ {k} \| [ \boldsymbol {h} (\boldsymbol {x}), \boldsymbol {y} ] - [ \boldsymbol {h} (\boldsymbol {x} ^ {\prime}), \boldsymbol {y} ^ {\prime} ] \| \\ \leq \sup _ {\boldsymbol {h} \in \mathcal {H}} \sum_ {k = 1} ^ {K} \omega_ {k} \frac {1}{m _ {k}} M _ {k} \mathcal {D} _ {\mathcal {H}} \\ \leq \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \sum_ {k = 1} ^ {K} \omega_ {k} M \\ \end{array}
+$$
+
+According to McDiarmid's inequality, for any $\delta > 0$ with probability at least $1 - \delta$ for any $h \in \mathcal{H}$ , we have:
+
+$$
+\begin{array}{l} \mathcal {L} _ {\boldsymbol {\omega}} (\boldsymbol {h}) \leq \hat {\mathcal {L}} _ {\boldsymbol {\omega}} (\boldsymbol {h}) + \mathbb {E} \left[ \sup _ {\boldsymbol {h} \in \boldsymbol {\mathcal {H}}} \mathcal {L} _ {\boldsymbol {\omega}} (\boldsymbol {h}) - \hat {\mathcal {L}} _ {\boldsymbol {\omega}} (h) \right] + \sum_ {k = 1} ^ {K} \omega_ {k} M \sqrt {\frac {\log \frac {1}{\delta}}{2}} \\ \leq \hat {\mathcal {L}} _ {\boldsymbol {\omega}} (\boldsymbol {h}) + 2 \Re_ {S} (\boldsymbol {\mathcal {G}}, \boldsymbol {\omega}) + \sum_ {k = 1} ^ {K} \omega_ {k} M \sqrt {\frac {\log \frac {1}{\delta}}{2}} \\ \end{array}
+$$
+
+
+
+# 1.2 PROOF OF THEOREM 4.2
+
+# Pseudo Code of CAGrad:
+
+Algorithm 1: Training Paradigm of CAGrad
+
+Input: Initial model parameter $\theta$ , differentiable loss functions are $\mathcal{L}_i(\pmb{\theta})$ , $i \in [N]$ , a constant $c \in [0,1]$ and learning rate $\alpha \in \mathbb{R}^+$ .
+
+Output: Model trained with CAGrad
+
+while not converged do
+
+At the $t_{th}$ optimization step, define $\pmb{g_0} = \frac{1}{K}\sum_{i = 1}^{K}\nabla_\pmb{\theta}\mathcal{L}_i(\pmb{\theta}_{t - 1})$ and $\phi = c^2\| \pmb {g_0}\|$ Solve
+
+$$
+\min _ {\boldsymbol {\omega} \in \mathcal {W}} F (\boldsymbol {\omega}) := \boldsymbol {g} _ {\boldsymbol {\omega}} ^ {\top} \boldsymbol {g} _ {\boldsymbol {0}} + \sqrt {\phi} \left\| \boldsymbol {g} _ {\boldsymbol {\omega}} \right\|, \text {w h e r e} \phi = c ^ {2} \left\| \boldsymbol {g} _ {\boldsymbol {0}} \right\| ^ {2}
+$$
+
+Update $\pmb{\theta}_{t} = \pmb{\theta}_{t - 1} - \alpha \left(\pmb{g}_{0} + \frac{\phi^{1 / 2}}{\|\pmb{g}_{\omega}\|}\pmb{g}_{\omega}\right)$
+
+Theorem 2. (Convergence of CAGrad in DLTR) With a fix step size $\alpha$ and the assumption of $H$ -Lipschitz on gradients, i.e., $\| \nabla \mathcal{L}_i(\pmb {\theta}) - \nabla \mathcal{L}_i(\pmb {\theta}^{\prime})\| \leq H\| \pmb {\theta} - \pmb {\theta}^{\prime}\|$ for $i = 1,2,\ldots ,K$ . Denote $\pmb {d}^{*}(\pmb {\theta}_{t})$ as the optimization direction of CAGrad at step $t$ , then we have:
+
+$$
+\mathcal {L} \left(\boldsymbol {\theta} _ {t + 1}\right) - \mathcal {L} \left(\boldsymbol {\theta} _ {t}\right) \leq - \frac {\alpha}{2} \left(1 - c ^ {2}\right) \left\| \boldsymbol {g} _ {0} \left(\boldsymbol {\theta} _ {t}\right) \right\| ^ {2} + \frac {\alpha}{2} (H \alpha - 1) \left\| \boldsymbol {d} ^ {*} \left(\boldsymbol {\theta} _ {t}\right) \right\| ^ {2}
+$$
+
+Proof.
+
+$$
+\begin{array}{l} \mathcal {L} \left(\boldsymbol {\theta} _ {t + 1}\right) - \mathcal {L} \left(\boldsymbol {\theta} _ {t}\right) = \mathcal {L} \left(\boldsymbol {\theta} _ {t} - \alpha \boldsymbol {d} ^ {*} \left(\boldsymbol {\theta} _ {t}\right)\right) - \mathcal {L} \left(\boldsymbol {\theta} _ {t}\right) \\ \leq - \alpha g _ {0} (\boldsymbol {\theta} _ {t}) ^ {\top} \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) + \frac {H \alpha^ {2}}{2} \| \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2} \\ \leq - \frac {\alpha}{2} \left(\| g _ {0} (\boldsymbol {\theta} _ {t}) \| ^ {2} + \| \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2} - \| g _ {0} (\boldsymbol {\theta} _ {t}) - \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2}\right) + \frac {H \alpha^ {2}}{2} \| \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2} \\ = - \frac {\alpha}{2} \left(\| g _ {0} (\boldsymbol {\theta} _ {t}) \| ^ {2} - \| g _ {0} (\boldsymbol {\theta} _ {t}) - \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2}\right) + \frac {H \alpha^ {2}}{2} \| \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2} - \frac {\alpha}{2} \| \boldsymbol {d} ^ {*} (\boldsymbol {\theta} _ {t}) \| ^ {2} \\ \leq - \frac {\alpha}{2} \left(1 - c ^ {2}\right) \left\| \boldsymbol {g} _ {0} \left(\boldsymbol {\theta} _ {t}\right) \right\| ^ {2} + \frac {\alpha}{2} (H \alpha - 1) \left\| \boldsymbol {d} ^ {*} \left(\boldsymbol {\theta} _ {t}\right) \right\| ^ {2} \\ \end{array}
+$$
+
+
+
+# 2 DETAILS OF IMPLEMENTATIONS
+
+We conduct all experiments according to their publicly released code if applicable, please refer to these code for more details. Our early stop hyper-parameter $E$ is selected from $\{10, 30, 50, 80\}$ , while anticipating worst-case optimization hyper-parameter $\rho$ is searched over $\{1.0\mathrm{e} - 3, 1.0\mathrm{e} - 4, 1.0\mathrm{e} - 5\}$ .
+
+# 2.1 DLTR METHODS
+
+LDAM-DRW. LDAM-DRW re-balances the model via logit adjustment. It enforces the theoretical derived margins that is class frequency-related to achieve cost-sensitive learning. Its publicly released code can be found at https://github.com/kaidic/LDAM-DRW.
+
+Balanced Softmax. Balanced Softmax is another cost-sensitive learning approach, which re-formulate softmax function in with the combination of link function and Bayesian inference. Its publicly released code can be found at https://github.com/jiawei-ren/BalancedMetaSoftmax-Classification.
+
+M2m. M2m takes advantage of generating adversarial samples from major to minor classes and thus re-balance via augmentation. Its publicly released code can be found at https://github.com/ alinlab/M2m.
+
+cRT + Mixup. cRT is a milestone decoupling method, which re-trains the classifier with a balanced sampling strategy in the second stage. Despite the official implementation is available, it does not
+
+include a version that utilizes ResNet-32 and is evaluated on CIFAR10-/CIFAR100-LT, which are the mainstream protocols. Therefore, we have re-implemented the method and achieved similar performance to that reported in GCL. In our implementation, we have adopted the same learning rate decay strategy as GCL, which involves multiplying the learning rate by 0.1 after the $160^{th}$ and $180^{th}$ epochs.
+
+MiSLAS. MiSLAS follows the decoupling regime and adopts a class-frequency related label smoothing operation to achieve both the improvement of accuracy and calibration. Its publicly released code can be found at https://github.com/dvlab-research/MiSLAS.
+
+GCL. Likewise, GCL is also a pioneer two-stage method, which observes the problem of softmax saturation and proposes to tackle it by Gaussian perturbation of different class logits with varied amplitude. Its publicly released code can be found at https://github.com/Keke921/GCLLoss.
+
+difficultyNet. As a dynamic re-balancing method, difficultyNet employs meta learning to learn the adjustment of class re-weighting from logits. Its publicly released code can be found at https://github.com/hitachi-rd-cv/Difficulty_Net.
+
+BBN. BBN Zhou et al. (2020) takes care of both representation learning and classifier learning by equipping with a novel cumulative learning strategy on two branches. Its publicly released code can be found at https://github.com/megvii-research/BBN.
+
+PaCo. PaCo Cui et al. (2021) introduces a set of parametric class-wise learnable centers to rebalance from an optimization perspective, addressing the bias on high-frequency classes in supervised contrastive loss. Its publicly released code can be found at https://github.com/dvlab-research/Parametric-Contrastive-Learning.
+
+BCL. BCL Zhu et al. (2022) proposes class-averaging and class-complement methods to help form a regular simplex for representation learning in supervised contrastive learning. Its publicly released code can be found at https://github.com/FlamieZhu/Balanced-Contrastive-Learning.
+
+# 2.2 MOO-BASED MTL METHODS
+
+MGDA. MGDA is a classical baseline for MOO-based MTL. This approach is particularly appealing due to its ability to guarantee convergence to a Pareto stationary point under mild conditions. Building upon this foundation, MGDA-UP introduces an upper bound on the multi-objective loss, aiming to optimize it and thereby achieve the Pareto optimal solution. In practice, it suggests task weighting based on the Frank-Wolfe algorithm (Jaggi, 2013). We conduct evaluations with the re-implementation in the publicly released code of CAGrad.
+
+EPO. Different from the general MOO-based MTL, EPO provides a preference-specific MOO frameworks, which can effectively find the expected Pareto front from the Pareto set by carefully controlling ascent to traverse the Pareto front in a principled manner. Generally, the re-balancing purpose also requires a preference for MOO. Its publicly released code can be found at https://github.com/dbmpr/EOSEarch.
+
+CAGrad. CAGrad improves MGDA mainly by the ideas of worst-case optimization and convergence guarantee. It strikes a balance between Pareto optimality and globe convergence by regulating the combined gradients in proximity to the average gradient.:
+
+$$
+\max _ {\boldsymbol {d} \in \mathbb {R} ^ {m} \boldsymbol {\omega} \in \mathcal {W}} \min _ {\boldsymbol {\omega}} \boldsymbol {g} _ {\boldsymbol {\omega}} ^ {\top} \boldsymbol {d} \quad \text {s . t .} \| \boldsymbol {d} - \boldsymbol {g} _ {\boldsymbol {0}} \| \leq c \| \boldsymbol {g} _ {\boldsymbol {0}} \| \tag {1}
+$$
+
+where $\pmb{d}$ represents the combined gradient, while $g_0$ denotes the averaged gradient, and $c$ is the hyperparameter. Its publicly released code can be found at https://github.com/Cranial-XIX/CAGrad.
+
+Why we choose CAGrad as the baseline? CAGrad is widely recognized as a robust baseline in MOO-based MTL. In contrast to MGDA, which consistently favors individuals with smaller gradient norms, CAGrad achieves a delicate balance between Pareto optimality and global convergence. This unique characteristic allows CAGrad to preserve the Pareto property while maximizing individual progress. Conversely, EPO necessitates manual tuning of the preference hyper-parameter, which plays a crucial role in its performance but proves challenging to optimize in practical scenarios, particularly
+
+for classification tasks with a large number of categories. In comparison, CAGrad requires less effort in terms of hyper-parameter tuning.
+
+# 2.3 DATASETS
+
+CIFAR10-/CIFAR100-LT. CIFAR10-/CIFAR100-LT is a subset of CIFAR10/CIFAR100, which is formed by sampling from the original 50,000 training images to create a long-tailed distribution. In our evaluation, we set the imbalance ratio $\beta = \frac{n_{max}}{n_{min}}$ to $\{200, 100, 50\}$ , where $n_{max}$ and $n_{min}$ represent the sample numbers of the most and least frequent classes, respectively.
+
+Places-LT & ImageNet-LT. Places-LT and ImageNet-LT are long-tailed variants of Places-365 and ImageNet, respectively. Places-LT comprises a total of 62.5K training images distributed across 365 classes, resulting in an imbalance ratio of 996. Similarly, ImageNet-LT consists of 115.8K training images spanning 1000 classes, with an imbalance ratio of 256.
+
+iNaturalist 2018. iNaturalist 2018 is a naturally occurring long-tailed classification dataset that comprises 437.5K training images distributed across 8142 categories, resulting in an imbalance ratio of 512. In our evaluations, we have followed the official split.
+
+# 3 OPEN LONG-TAILED RECOGNITION EVALUATION
+
+To further demonstrate the robustness of the learned representations by PLOT, we conduct an evaluation known as open long-tailed recognition (OLTR) (Liu et al., 2019) on Places-LT and ImageNet-LT datasets. The results are presented in Table 1. Based on the comparison of F-measures, our method achieves state-of-the-art performance in OLTR. It is worth noting that we employ a cosine similarity measurement between incoming representations and prototypes proposed by (Liu et al., 2019), which allows us to compete favorably against bells and whistles OLTR methods (e.g., LUNA (Cai et al., 2022)). This highlights the superiority of the mechanism proposed by PLOT for representation learning.
+
+Table 1: Open long-tailed recognition on Places-LT and ImagetNet-LT.
+
+
F-measure ↑
CE
Lifted Loss
Focal Loss
Range Loss
MinMax
OLTR
IEM
LUNA
CC-SAM
cRT + Mixup + PLOT
ImageNet-LT
0.295
0.374
0.371
0.373
0.368
0.474
0.525
0.579
0.552
0.563
Places-LT
0.366
0.459
0.453
0.457
0.458
0.464
0.486
0.491
0.510
0.516
+
+# 4 ADDITIONAL EXPERIMENT RESULTS
+
+# 4.1 IDENTIFY OPTIMIZATION CONFLICT UNDER VARIOUS CONDITIONS
+
+Generally, the optimization objectives of samples from different classes tend to exhibit some conflicts, as they need to learn class-specific features in addition to the shared features across classes. In the case of a balanced training set, this conflict does not significantly impact the simultaneous optimization of individual classes. However, in an imbalanced scenario, the model optimization becomes dominated by the majority class, exacerbating this conflict issue. Consequently, the performance of the minority class is compromised in favor of optimizing the majority class. This outcome hinders the effective learning of category-sharing features. Importantly, this problem is intuitively independent of hyperparameters, optimizers, and other related factors.
+
+To validate the aforementioned hypothesis, we have conducted an extensive investigation into the gradient conflict and dominated categories issues by thoroughly examining LDAM-DRW across various experimental settings. These settings encompassed diverse mini-batch sizes, learning rates, and optimizers. The meticulous presentation of our findings is shown in Fig. 1 and Fig. 2. Notably, Fig. 1 provides a snapshot of the instantaneous gradient conflict status at an early stage, while Fig. 2 illustrates the continuous gradient similarity status throughout the optimization process. It is important to emphasize that Figs. 2 (a) and (b) are presented on a larger scale in their axes, resulting in a less apparent discrepancy. However, it should be noted that these subfigures do not differ significantly from the other subfigures when placed on the same scale.
+
+
+(a) SGD-128-0.1
+
+
+(b) Adam-128-0.1
+
+
+(c) SGD-256-0.1 (d) SGD-512-0.1
+
+
+(e) SGD-128-0.01
+
+
+(f) SGD-128-1e-3
+
+
+Figure 1: Gradient conflict status of LDAM-DRW under various conditions. Each sub-figure is named as (Optimizer)-(Batch-Size)-(Learning-Rate).
+(a) Adam-128-0.1
+Figure 2: Continual gradient similarity status of LDAM-DRW under various conditions. Each sub-figure is named as (Optimizer)-(Batch-Size)-(Learning-Rate).
+
+
+(b) Adam-128-1e-3
+
+
+(c) SGD-256-0.1
+(d) SGD-512-0.1
+
+
+
+
+(e) SGD-128-0.01
+
+
+(f) SGD-128-1e-3
+
+As anticipated, we have observed the presence of the gradient conflict and dominated categories issues in all tested scenarios. These findings significantly contribute to validating the universality of the gradient conflict issue. If deemed applicable, we are fully committed to providing additional evidence and conducting further analysis in the updated version to reinforce the robustness of our findings.
+
+
+(a)ERM
+
+
+(b) LDAM-DRW
+
+
+(c) Bal. Softmax
+
+
+(d) M2m
+
+
+(e) MiSLAS
+
+
+(f) GCL
+
+
+(g)ERM
+Figure 3: Gradient conflicts among categories at step 50 (a-f) and step 84(g-l).
+
+
+(h) LDAM-DRW
+
+
+(i) Bal. Softmax
+
+
+(j) M2m
+
+
+(k) MiSLAS
+
+
+(1) GCL
+
+# 4.2 GRADIENT CONFLICTS IN THE EARLY TRAINING STAGE
+
+Here we further present the existing of optimization conflicts at different steps in Fig. 3. As depicted, such conflicts remain for a long time in the early stage.
+
+# 4.3 FREQUENCY VS. LOSS VALUE
+
+In Fig. 4, we present our observations of class-wise weighted loss, denoted as $\frac{B_k \cdot \bar{l}(\boldsymbol{x}_*^k, \boldsymbol{y}_*^k)}{B}$ , to compare the norms of $B_* / B$ and $\bar{l}(\boldsymbol{x}_*^k, \boldsymbol{y}_*^k)$ . Our results indicate that BalancedSoftmax, which functions as a re-balancing method by adjusting the loss function, is still dominated by class frequency, i.e., $B_* / B$ . Conversely, LDAM-DRW exhibits a balanced weighted loss for both head and tail classes, thereby demonstrating the effectiveness of its re-balancing strategy.
+
+
+(a) cRT + Mixup
+
+
+(b) LDAM-DRW
+Figure 4: Class-wise weighted loss comparison on CIFAR10-LT when imbalance ratio is set as 200 and batch size is set as 64.
+
+
+(c) BalancedSoftmax
+
+# 4.4 GRADIENT CONFLICTS STATUS OF DYNAMIC RE-WEIGHTING APPROACH
+
+As a form of dynamic re-weighting method, we further investigate the optimization conflicts associated with other dynamic re-weighting approaches to showcase our distinct research perspective. In this regard, we employ difficultyNet as the baseline for conducting a verification experiment, and the results are depicted in Fig. 5. It is evident that difficultyNet fails to address optimization conflicts during its early training stage, primarily due to its inherent lack of design nature.
+
+
+Figure 5: Optimization conflicts of diff. Net.
+(a) Epoch 0
+
+
+(b) Epoch 30
+
+# 4.5 GRADIENT NORM EXAMINATION
+
+In this section, we expand our analysis by conducting a thorough investigation into the phenomenon of gradient norm domination within mainstream DLTR approaches. To quantify this domination, we calculate the mean gradient of the corresponding category and present the results of our examination in Figure 6(a-f). As depicted, all the examined approaches demonstrate a consistent pattern, mirroring the tendency observed in Figure 2 of the main text. Specifically, we observe that the tail class is extremely under-optimized, indicating the explicit dominance of specific categories during the optimization process. These compelling findings provide strong support for the motivation underlying our proposed method, which aims to effectively mitigate such domination and its associated adverse effects. For comparative purposes, we also provide the PLOT-augmented gradient norm examinations in Figure 6(g-l). As expected, the results reveal that no individuals (categories) exhibit explicit domination during the early stage of representation learning.
+
+
+(a) ERM
+
+
+(b) LDAM-DRW
+
+
+(c) Bal. Softmax
+
+
+(d) M2m
+
+
+(e) MiSLAS
+
+
+(f) GCL
+
+
+(g)ERM
+Figure 6: Gradient norm examination for mainstream DLTR approaches (a-f). 'Norm Ratio' is calculated between the individuals and the mean gradient. (g-l) are the PLOT-augmented ones.
+
+
+(h) LDAM-DRW
+
+
+(i) Bal. Softmax
+
+
+(j) M2m
+
+
+(k) MiSLAS
+
+
+(1) GCL
+
+# 4.6 GRADIENT SIMILARITY EXAMINATION AFTER PLOT AUGMENTATION
+
+To substantiate the effectiveness of the PLOT, which facilitates simultaneous progress for all individuals, we compute the cosine similarities between individuals and the gradient derived from MOO. These cosine similarities are then compared with the corresponding vanilla results presented in Figure 2 of the main text. The comparative results are depicted in Figure 7. As observed, the DLTR methods augmented with PLOT exhibit a more balanced cosine similarity, indicating that all individuals achieve more equitable progress and improvements.
+
+
+(a)ERM
+
+
+(b) LDAM-DRW
+
+
+Figure 7: Gradient similarity examination for PLOT-augmented mainstream DLTR approaches. 'Cosine Similarity' is calculated between the individuals and the MOO derived gradient.
+
+
+(c) Bal. Softmax
+(d) M2m
+
+
+(e) MiSLAS
+
+
+(f) GCL
+
+# 4.7 APPLY PLOT ON DIFFERENT LAYERS
+
+MOO algorithms are recognized to be computationally intensive, particularly when the number of tasks scales up. To address this issue, we propose applying PLOT to select specific layers rather than the entire model. In this study, we examine the impact of different layers to demonstrate the robustness of our approach. Specifically, we apply PLOT to different layers, i.e., layer1, layer2, and layer3 in ResNet-32, and present their final performance in Figure 8. Our results indicate that the last layer is the optimal choice across various evaluations.
+
+
+Figure 8: Impact of different layers.
+
+# 4.8 GRADIENT CONFLICTS STATUS UNDER THE BALANCED SETTING
+
+We investigate the gradient conflict and similarity status in a balanced setting to motivate the integration of MOO and DLTR. To this end, we train $\mathrm{ERM}^1$ with the full (roughly balanced) CIFAR10 dataset for 200 epochs and achieve a final accuracy of $92.84\%$ . We record the class-wise gradient and compute their similarities. As shown in Fig 9, gradients among categories also exhibit conflict cases but play a roughly equal role during optimization2.
+
+# 5 LIMITATION
+
+The limitations of PLOT can be attributed to two main factors. Firstly, the approach incurs additional computational overhead due to multiple gradient backpropagation and MOO. To address this issue, we propose applying PLOT to select layers rather than the entire model, which serves as an efficient alternative. Additionally, we randomly sample a small set of categories to participate in MOO for large-scale datasets. Secondly, the early stopping mechanism
+
+is currently controlled by a hyper-parameter, which introduces additional tuning complexities. To simplify this process, we select the hyper-parameter from a fixed set of values.
+
+Figure 9: Gradient conflicts and similarity of ERM.
+
+
+(a) Gradient conflicts.
+
+
+(b) Gradient sim.
+
+# 6 COMPUTATIONAL COMPLEXITY AND SCALABILITY ANALYSIS
+
+# 6.1 COMPUTATIONAL COMPLEXITY
+
+As noted in the Limitations section, our method is more complex than its baselines. However, we would like to emphasize that our approach only applies MOO to a subset of the model parameters in a mini-batch, which contains fewer classes. This results in a lower time cost than expected. Additionally, we only apply MOO in the early stage of DLTR training for shared feature extraction. For large-scale datasets such as ImageNet-LT, we further adopt a class sampling strategy to reduce the computation cost. We believe that these optimizations help to mitigate the complexity of our approach while maintaining its effectiveness in addressing the long-tailed recognition problem. Here we provide a simple comparison of the time cost of running on a Tesla T4 GPU:
+
+Table 2: Training time cost comparison running on Tesla T4.
+
+
Method
CE
LDAM-DRW
cRT + Mixup
cRT + Mixup + PLOT
LDAM-DRW + PLOT
GPU Time (h)
0.62
0.68
0.65
0.83
0.86
+
+# 6.2 SCALABILITY
+
+As previous research has indicated (Cadena et al., 2018; Hu et al., 2021; Zimmermann et al., 2021; Liu et al., 2019), the parameters of backbone layers tend to be more stable in the later stages of training. Therefore, our temporal-style MOO learning paradigm is designed to address the gradient conflict problem that occurs during the early stages of representation learning. This approach enables compatibility with mainstream DLTR models. Here, we provide examples of how our approach can be integrated with Decoupling using pseudo code, as shown in Algorithm 2 (Please refer Eqns. 2, 3, 4 in the maintext):
+
+Algorithm 2: Representation Training Paradigm of Decoupling + PLOT
+Input: Training Dataset $\mathcal{S}\sim p_s(\pmb {x},\pmb {y}) = p_s(\pmb {x}|\pmb {y})p_s(\pmb {y})$
+Output: Model trained with PLOT
+Stage SFE:
+Initialize $\theta$ randomly
+while epoch $\leq$ E do
+foreach batch $\mathcal{B}_i$ in $s$ do Compute empirical loss $L_{S}$ with $\mathcal{B}_i$ and obtain its gradient $g_{S}$ Perturb $\theta$ with $g_{S}$ according to Eqn. 3 and Eqn. 4 Compute the perturbative loss $\mathcal{L}_{SAM}$ and the variability collapse loss $\mathcal{L}_{vc}$ according to Eqn.2. Estimate the class-specific gradient set $G = \{\pmb {g}_1,\pmb {g}_2,\dots,\pmb {g}_k\}$ with respect to $\mathcal{L}_{moo} = \mathcal{L}_{SAM} + \mathcal{L}_{vc}$ Update $\theta$ by solving Eqn. 6: $\theta \gets \theta -\alpha (g_0 + \frac{\phi^{1 / 2}}{\|g_\omega\|} g_\omega)$ .
+Stage TSO:
+while epoch $>\mathrm{E}$ do
+foreach batch $\mathcal{B}_i$ in $s$ do Computing empirical loss $L_{S}$ with $\mathcal{B}_i$ Update $\theta$ .. $\theta \leftarrow \theta -\nabla_{\theta}\mathcal{L}_{S}(\theta)$
+
+# 7 VISUALIZATIONS
+
+# 7.1 FEATURE REPRESENTATION ANALYSIS
+
+More class-specific Hessian spectral analysis ${}^{3}$ are provided in Figs. 10 11,which align with the conclusion in the main text,i.e.,PLOT leads to a flatter minima for each class,thereby reducing the risk of getting stuck at saddle points.
+
+
+(a) Class 1
+
+
+(b) Class 2
+
+
+(c) Class 3
+
+
+(d) Class 4
+
+
+(e) Class 5
+
+
+(f) Class 6
+
+
+(g) Class 7
+Figure 10: Hessian spectrum analysis of vanilla cRT + Mixup.
+
+
+(h) Class 8
+
+
+(a) Class 1
+
+
+(b) Class 2
+
+
+(c) Class 3
+
+
+(d) Class 4
+
+
+(e) Class 5
+Figure 11: Hessian spectrum analysis of PLOT-augmented cRT + Mixup.
+
+
+(f) Class 6
+
+
+(g) Class 7
+
+
+(h) Class 8
+
+# 7.2 LOSS LANDSCAPE OF DLTR MODELS
+
+To further illustrate the unattainable small value of $H$ in the DLTR models, we have included additional loss landscape visualizations in Fig. 12. These visualizations reveal that the tail classes of the models exhibit sharp minima, with the exception of M2m. Additionally, we observe that PLOT displays flat minima in both head and tail classes.
+
+
+(a) Head of ERM
+
+
+(b) Head of LDAM-DRW
+
+
+(c) Head of M2m
+
+
+(d) Head of MiSLAS
+
+
+(e) Head of PLOT
+
+
+(f) Tail of ERM
+
+
+(g) Tail of LDAM-DRW
+
+
+(h) Tail of M2m
+
+
+Figure 12: Loss landscapes of head and tail classes in ERM, LDAM-DRW, M2m, MiSLAS, and PLOT.
+
+
+(i) Tail of MiSLAS
+(j) Tail of PLOT
+
+# 7.3 EMBEDDING VISUALIZATION
+
+In addition, we present visualizations of the extracted embeddings from both the vanilla and PLOT-augmented approaches by projecting them into a 2D plane using t-SNE Van der Maaten & Hinton (2008). The corresponding visualizations can be found in Figure 13 (a)(b). As anticipated, the tail classes of the cRT + Mixup + PLOT approach exhibit increased separability compared to the vanilla approach. This observation suggests that the incorporation of PLOT enhances the representation of all categories, as intended.
+
+
+(a) $\mathrm{cRT + Mixup}$
+
+
+(b) cRT + Mixup + PLOT
+
+
+(c)
+Figure 13: (a) and (b) are the t-SNE visualization results. (c) Representation similarity between head and tail classes.
+
+# 7.4 CANONICAL CORRELATION ANALYSIS
+
+To further investigate the shared feature representation across categories in the early stage, we examine the Canonical Correlation Analysis (CCA) scores (Raghu et al., 2017) of representations between head and tail categories in CIFAR10-LT, as learned by both the standard and PLOT empowered LDAM-DRW. As illustrated in Fig. 13 (c), the PLOT augmented version exhibits a greater degree of similarity among categories in comparison to the conventional model, thereby substantiating the efficacy of our conflict-averse solution.
+
+# 8 DETAILED RESULTS ON MAINSTREAM DATASETS
+
+In order to demonstrate the generalization of PLOT and its impact on different subsets, we provide more detailed results in this section. Specifically, we compare PLOT with two state-of-the-art DLTR approaches, namely BBN and PaCo, by augmenting them with PLOT. The consistent improvements observed in Table 4 indicate that PLOT can effectively enhance various types of DLTR approaches. Furthermore, we present detailed results on large-scale datasets in Table 3, which empirically illustrate that PLOT successfully augments medium and tail classes without significantly compromising the performance of major classes.
+
+
Dataset
Method
Backbone
Many
Medium
Few
Overall
Places-LT
CE
ResNet-152
45.7
27.3
8.20
30.2
Decouple-τ-norm Kang et al. (2019)
ResNet-152
37.8
40.7
31.8
37.9
Balanced Softmax Ren et al. (2020)
ResNet-152
42.0
39.3
30.5
38.6
LADHong et al. (2021)
ResNet-152
42.8
39.0
31.2
38.8
RSG Wang et al. (2021)
ResNet-152
41.9
41.4
32.0
39.3
DisAlign Zhang et al. (2021)
ResNet-152
40.4
42.4
30.1
39.3
ResLT Cui et al. (2022)
ResNet-152
39.8
43.6
31.4
39.8
GCL Li et al. (2022)
ResNet-152
-
-
-
40.6
cRT + Mixup Kang et al. (2019)
ResNet-152
44.1
38.5
27.1
38.1
cRT + Mixup + PLOT
ResNet-152
40.9
43.1
37.1
41.0
MiSLAS Zhong et al. (2021)
ResNet-152
39.2
43.2
36.5
40.2
MiSLAS + PLOT
ResNet-152
39.2
43.5
36.9
40.5
ImageNet-LT
CE
ResNeXt-50
65.9
37.5
7.7
44.4
Decouple-τ-norm Kang et al. (2019)
ResNet-50
56.6
44.2
27.4
46.7
Balanced Softmax Ren et al. (2020)
ResNeXt-50
64.1
48.2
33.4
52.3
LADHong et al. (2021)
ResNeXt-50
64.4
47.7
34.3
52.3
RSG Wang et al. (2021)
ResNeXt-50
63.2
48.2
32.2
51.8
DisAlign Zhang et al. (2021)
ResNet-50
61.3
52.2
31.4
52.9
ResNeXt-50
62.7
52.1
31.4
53.4
ResLT Cui et al. (2022)
ResNeXt-50
63.0
50.5
35.5
52.9
LDAM-DRW + SAM Rangwani et al. (2022)
ResNet-50
62.0
52.1
34.8
53.1
GCL Li et al. (2022)
ResNet-50
-
-
-
54.9
cRT + Mixup Kang et al. (2019)
ResNeXt-50
61.5
49.3
36.8
51.7
cRT + Mixup + PLOT
ResNeXt-50
62.6
52.0
39.4
54.3
MiSLAS Zhong et al. (2021)
ResNet-50
61.7
51.3
35.8
52.7
MiSLAS + PLOT
ResNet-50
61.4
52.3
37.5
53.5
BCL Zhu et al. (2022)
ResNet-50
65.7
53.7
37.3
56.0
BCL + PLOT
ResNet-50
67.4
54.4
38.8
57.2
iNat-2018
CE
ResNet-50
72.2
63.0
57.2
61.2
Decouple-τ-norm Kang et al. (2019)
ResNet-50
65.6
65.3
65.9
65.6
Balanced Softmax Ren et al. (2020)
ResNet-50
-
-
-
70.6
LADHong et al. (2021)
ResNet-50
-
-
-
70.0
RSG Wang et al. (2021)
ResNet-50
-
-
-
70.3
DisAlign Zhang et al. (2021)
ResNet-50
-
-
-
70.6
ResLT Cui et al. (2022)
ResNet-50
-
-
-
70.2
LDAM-DRW + SAM Rangwani et al. (2022)
ResNet-50
64.1
70.5
71.2
70.1
GCL Li et al. (2022)
ResNet-50
-
-
-
72.0
cRT + Mixup Kang et al. (2019)
ResNet-50
74.2
71.1
68.2
70.2
cRT + Mixup + PLOT
ResNet-50
74.2
72.5
69.4
71.3
MiSLAS Zhong et al. (2021)
ResNet-50
73.2
72.4
70.4
71.6
MiSLAS + PLOT
ResNet-50
73.1
72.9
71.2
72.1
+
+Table 3: Detailed Top-1 Accuracy on Places-LT, ImageNet-LT, and iNaturalist-2018.
+
+Table 4: Top-1 Accuracy on CIFAR datasets.
+
+
CIFAR10-LT
CIFAR100-LT
Imb.
200
100
50
200
100
50
LDAM-DRW
71.38
77.71
81.78
36.50
41.40
46.61
LDAM-DRW + PLOT
74.32
78.19
82.09
37.31
42.31
47.04
M2m
73.43
77.55
80.94
35.81
40.77
45.73
M2m + PLOT
74.48
78.42
81.79
38.43
43.00
47.19
cRT + Mixup
73.06
79.15
84.21
41.73
45.12
50.86
cRT + Mixup + PLOT
78.99
80.55
84.58
43.80
47.59
51.43
Logit Adjustment
-
78.01
-
-
43.36
-
Logit Adjustment + PLOT
-
79.40
-
-
44.19
-
BBN
73.52
77.43
80.19
36.14
39.77
45.64
BBN + PLOT
74.34
78.49
82.44
36.21
40.29
46.13
MiSLAS
76.59
81.33
85.23
42.97
47.37
51.42
MiSLAS + PLOT
77.73
81.88
85.70
44.28
47.91
52.66
GCL
79.25
82.85
86.00
44.88
48.95
52.85
GCL + PLOT
80.08
83.35
85.90
45.61
49.50
53.05
PaCo
-
-
-
47.28
51.71
55.74
PaCo + PLOT
-
-
-
47.75
52.60
56.61
+
+# REFERENCES
+
+Santiago A Cadena, Marissa A Weis, Leon A Gatys, Matthias Bethge, and Alexander S Ecker. Diverse feature visualizations reveal invariances in early layers of deep neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 217-232, 2018.
+Jiarui Cai, Yizhou Wang, Hung-Min Hsu, Jenq-Neng Hwang, Kelsey Magrane, and Craig S Rose. Luna: Localizing unfamiliarity near acquaintance for open-set long-tailed recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 131-139, 2022.
+Jiequan Cui, Zhisheng Zhong, Shu Liu, Bei Yu, and Jiaya Jia. Parametric contrastive learning. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 715-724, 2021.
+Jiequan Cui, Shu Liu, Zhuotao Tian, Zhisheng Zhong, and Jiaya Jia. Result: Residual learning for long-tailed recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
+Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020.
+Youngkyu Hong, Seungju Han, Kwanghee Choi, Seokjun Seo, Beomsu Kim, and Buru Chang. Disentangling label distribution for long-tailed visual recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6626-6636, 2021.
+Jie Hu, Liujuan Cao, Tong Tong, Qixiang Ye, Shengchuan Zhang, Ke Li, Feiyue Huang, Ling Shao, and Rongrong Ji. Architecture disentanglement for deep neural networks. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 672-681, 2021.
+Martin Jaggi. Revisiting frank-wolfe: Projection-free sparse convex optimization. In International conference on machine learning, pp. 427-435. PMLR, 2013.
+Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. arXiv preprint arXiv:1910.09217, 2019.
+Mengke Li, Yiu-ming Cheung, and Yang Lu. Long-tailed visual recognition via gaussian clouded logit adjustment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6929-6938, 2022.
+Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X Yu. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2537-2546, 2019.
+
+Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. Advances in neural information processing systems, 30, 2017.
+Harsh Rangwani, Sumukh K Aithal, Mayank Mishra, et al. Escaping saddle points for effective generalization on class-imbalanced data. Advances in Neural Information Processing Systems, 35: 22791-22805, 2022.
+Jiawei Ren, Cunjun Yu, Xiao Ma, Haiyu Zhao, Shuai Yi, et al. Balanced meta-softmax for long-tailed visual recognition. Advances in neural information processing systems, 33:4175-4186, 2020.
+Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
+Jianfeng Wang, Thomas Lukasiewicz, Xiaolin Hu, Jianfei Cai, and Zhenghua Xu. Rsg: A simple but effective module for learning imbalanced datasets. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3784-3793, 2021.
+Songyang Zhang, Zeming Li, Shipeng Yan, Xuming He, and Jian Sun. Distribution alignment: A unified framework for long-tail visual recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2361-2370, 2021.
+Zhisheng Zhong, Jiequan Cui, Shu Liu, and Jiaya Jia. Improving calibration for long-tailed recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16489-16498, 2021.
+Boyan Zhou, Quan Cui, Xiu-Shen Wei, and Zhao-Min Chen. Bbn: Bilateral-branch network with cumulative learning for long-tailed visual recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9719-9728, 2020.
+Jianggang Zhu, Zheng Wang, Jingjing Chen, Yi-Ping Phoebe Chen, and Yu-Gang Jiang. Balanced contrastive learning for long-tailed visual recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6908-6917, 2022.
+Roland S Zimmermann, Judy Borowski, Robert Geirhos, Matthias Bethge, Thomas Wallis, and Wieland Brendel. How well do feature visualizations support causal understanding of cnn activations? Advances in Neural Information Processing Systems, 34:11730-11744, 2021.
\ No newline at end of file
diff --git a/paretodeeplongtailedrecognitionaconflictaversesolution/images.zip b/paretodeeplongtailedrecognitionaconflictaversesolution/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..51edf5e89a897a2a17a752a18aa1e1c22c5db5d5
--- /dev/null
+++ b/paretodeeplongtailedrecognitionaconflictaversesolution/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f4d3a45ec020f20dd1d0dad1f2e9fcde0fbd3f08ef3f3b7f5d91ec3920926d7a
+size 1614808
diff --git a/paretodeeplongtailedrecognitionaconflictaversesolution/layout.json b/paretodeeplongtailedrecognitionaconflictaversesolution/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..54257cadcb4f9b94d3c7bd3075daaa24d7254386
--- /dev/null
+++ b/paretodeeplongtailedrecognitionaconflictaversesolution/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb2574c56ed117ffcfab1e95065c5393238104d46bd0b9cd4e2fb3086a6afa87
+size 1045518
diff --git a/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_content_list.json b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6d2b645b44d2719f452ca56f7e4eb7259f84fd7c
--- /dev/null
+++ b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e169eb35b9f1cf35675b4ccb469905b14b20a92b53534f0724abeaec3d1bce00
+size 282105
diff --git a/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_model.json b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b798208485be4eb45c7e3b5a8dbd9d177752a48
--- /dev/null
+++ b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:19151c7ce529c0f1f821da00064f5dbc80f52b2201366502c6c05acd123f6fe4
+size 332570
diff --git a/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_origin.pdf b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ae851ff3d8f600e8c6de92e23f5397e789d9bab7
--- /dev/null
+++ b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/343418e9-0c87-4e7b-803c-cdf071d8fcd2_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6720aa3adc368ce2f3bf1318e6d8098121358e95bac330e76f33995ece4b2c49
+size 8442974
diff --git a/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/full.md b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..4f5878bcbe250e6a63656802b51e8def9f784524
--- /dev/null
+++ b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/full.md
@@ -0,0 +1,1310 @@
+# PARL: A UNIFIED FRAMEWORK FOR POLICY ALIGNMENT IN REINFORCEMENT LEARNING FROM HUMAN FEEDBACK
+
+Souradip Chakraborty1, Amrit Singh Bedi2, Alec Koppel3, Huazheng Wang4, Dinesh Manocha1, Mengdi Wang5, Furong Huang1
+
+1University of Maryland, College Park, 2University of Central Florida, 3J.P. Morgan AI Research, 4Oregon State University, 5Princeton University {schakra3}@umd.edu
+
+# ABSTRACT
+
+We present a novel unified bilevel optimization-based framework, PARL, formulated to address the recently highlighted critical issue of policy alignment in reinforcement learning using utility or preference-based feedback. We identify a major gap within current algorithmic designs for solving policy alignment due to a lack of precise characterization of the dependence of the alignment objective on the data generated by policy trajectories. This shortfall contributes to the sub-optimal performance observed in contemporary algorithms. Our framework addressed these concerns by explicitly parameterizing the distribution of the upper alignment objective (reward design) by the lower optimal variable (optimal policy for the designed reward). Interestingly, from an optimization perspective, our formulation leads to a new class of stochastic bilevel problems where the stochasticity at the upper objective depends upon the lower-level variable. True to our best knowledge, this work presents the first formulation of the RLHF as a bilevel optimization problem which generalizes the existing RLHF formulations and addresses the existing distribution shift issues in RLHF formulations. To demonstrate the efficacy of our formulation in resolving alignment issues in RL, we devised an algorithm named A-PARL to solve PARL problem, establishing sample complexity bounds of order $\mathcal{O}(1 / T)$ . Our empirical results substantiate that the proposed PARL can address the alignment concerns in RL by showing significant improvements (up to $63\%$ in terms of required samples) for policy alignment in large-scale environments of the Deepmind control suite and Meta world tasks.
+
+# 1 INTRODUCTION
+
+The increasing complexity and widespread use of artificial agents highlight the critical need to ensure that their behavior aligns well (AI alignment) with the broader utilities such as human preferences, social welfare, and economic impacts (Frye & Feige, 2019; Butlin, 2021; Liu et al., 2022). In this work, we study the alignment problem in the context of reinforcement learning (RL), because a policy trained on misspecified reward functions could lead to catastrophic failures (Ngo et al., 2022; Casper et al., 2023). For instance, an RL agent trained for autonomous driving could focus on reaching its destination as quickly as possible, neglecting safety constraints (misalignment). This could lead to catastrophic failures, such as causing high-speed accidents. The question of alignment in RL may be decomposed into two parts: (i) How can we efficiently align the behavior (policy) of RL agents with the broader utilities or preferences? (ii) How to reliably evaluate if the current RL policy is well aligned or not? Addressing the first question is crucial because it serves as a preventive measure, ensuring that the RL agent operates within desired boundaries from the outset. The second question is equally vital as it acts as a diagnostic tool, enabling real-time or retrospective assessment of the RL agent's behavior which could help identify early signs of misalignment to avoid severe consequences.
+
+
+(a)
+(b)
+Figure 1: (a) This figure shows the proposed PARL framework for policy alignment in reinforcement learning. The standard RL is at the lower level (LL), and the alignment objective is at the upper level (UL). (b) This figure shows the performance gap of the SOTA approach due to policy misalignment. The blue curve should be as close as possible to the red dotted line of oracle.
+
+In this work, we propose a novel unified bilevel framework called PARL, capturing the challenge of policy alignment in reinforcement learning using utility or human preference-based feedback. Our PARL framework shown in Figure 1(a) consists of upper level (UL) and lower level (LL). The lower level performs the policy alignment step for a given parametrized reward function (addressing question (i)), and the upper level evaluates the optimal lower-level policy to check possible alignment (addressing the question (ii)). A bilevel approach is crucial because of the dependence of the alignment objective on the data generated by the optimal policy of the RL agent.
+
+There are existing approaches such as PEBBLE (Lee et al., 2021) and SURF (Park et al., 2022), which have proposed a heuristic iterative procedure for possible policy alignment in RL but do not focus on the entanglement between the alignment objective and the trajectory collecting policy. This gap (our formulation resolved this) in existing state-of-the-art (SOTA) approaches results in a misaligned objective for alignment evaluation and sub-optimal performance in terms of alignment. We highlight the performance gap of the SOTA approach in Figure 1(b). This gap exists because, without considering the correct evaluation objective at the upper level, existing alignment methods set the initial trajectory for the agent, but they do not offer ongoing assurance of the agent's behavior. Policies can drift or become misaligned due to various factors such as data distribution shifts, model updates, or environmental changes (which we observe in 1(b)). Our proposed formulation provides a rigorous mathematical formulation to address questions (i) and (ii) and improves the performance to achieve policy alignment in practice. We summarize our contributions as follows.
+
+- Bilevel formulation for policy alignment in RL: we formulate the RL agent policy alignment as a bilevel optimization problem where the upper-level centers on reward design through policy evaluation over the horizon, and the lower level pertains to policy alignment with the designed reward via policy optimization.
+- Correct evaluation objective for policy alignment in RL: We highlight the dependence of data distribution of the alignment objective on the RL agent policy, which is missing from the prior research. This provides a reliable objective to evaluate the performance of the current policy of the RL agent at the upper level.
+- Analysis of new class of stochastic bilevel problems: Interestingly, our bilevel problem does not fall under the class of standard stochastic bilevel optimization problems in the literature (Chen et al., 2022; Kwon et al., 2023; Li et al., 2022b; Ji et al., 2021; Cao et al., 2023; Akhtar et al., 2022; Ghadimi & Wang, 2018b) with the only exception being (Lu, 2023), which also studies coupled decision dependent bilevel optimization problem but not in the context of RL. The unique feature of our problem is to explicitly consider the dependence of data collection at the upper level on the optimal policy parameter at the lower level. We also propose a novel A-PARL algorithm to solve the bilevel problem and derive precise sample complexity bounds of $\mathcal{O}(1 / T)$ , where $T$ is the number of episodes.
+- Empirical evidence of improved policy alignment. We evaluate the proposed approach on various large-scale continuous control robotics environments in DeepMind control suite (Tassa et al., 2018) and MetaWorld (Yu et al., 2021). We show that our approach archives better policy alignment due to the use of the corrected upper-level objective we propose in this work. We achieve up to $63\%$ improvement in samples required to solve the task.
+
+# 2 RELATED WORKS
+
+Preference Based RL. Revealed preferences is a concept in economics that states that humans in many cases do not know what they prefer until they are exposed to examples via comparisons (Caplin & Dean, 2015). This idea gained traction as it provided a substantive basis for querying humans and elucidating feedback on decision-making problems with metrics whose quantification is not obvious, such as trustworthiness or fairness. Efforts to incorporate pairwise comparison into RL, especially as a mechanism to incorporate preference information, have been extensively studied in recent years - see Wirth et al. (2017) for a survey. A non-exhaustive list of works along these lines is (Roth et al., 2016; Hill et al., 2021; Wirth et al., 2017; Zhu et al., 2023; Xu et al., 2020; Saha et al., 2023; Chakraborty et al., 2023c; 2024).
+
+Inverse RL and Reward Design. Reward design has also been studied through an alternative lens in which an agent is provided with demonstrations or trajectories and seeks to fit a reward function. Inverse reinforcement learning (Ziebart et al., 2008a; Brown et al., 2019; Arora & Doshi, 2020) learns a reward to learn behaviors deemed appropriate by an expert. On the other hand, imitation learning directly seeks to mimic the behavior of demonstrations (Ho & Ermon, 2016; Kang et al., 2018; Ghasemipour et al., 2019; Xiao et al., 2019). However, acquiring high-quality demonstrations can be expensive or infeasible (Bai et al., 2022; Chen et al., 2023; Wolf et al., 2023). It also sidesteps some questions about whether a reward can be well-posed for a given collection of trajectories. A further detailed context of related works has been discussed in the Appendix B
+
+# 3 PROBLEM FORMULATION
+
+Consider the Markov Decision Process (MDP) tuple $\mathcal{M} \coloneqq \{\mathcal{S}, \mathcal{A}, \gamma, P, r\}$ with state space $\mathcal{S}$ , action space $\mathcal{A}$ , transition dynamics $P$ , discount factor $\gamma \in (0,1)$ , and reward $r: \mathcal{S} \times \mathcal{A} \to \mathbb{R}$ . Starting from state $s \in \mathcal{S}$ , an agent takes action $a$ , and transitions to $s' \sim P(\cdot \mid s, a)$ . The agent follows a stochastic policy that maps states to distributions over actions $\pi_{\theta}: \mathcal{S} \to \triangle_{|\mathcal{A}|}$ , which is parameterized by $\theta \in \mathbb{R}^d$ . The standard finite horizon policy optimization problem is
+
+$$
+\max _ {\theta} V _ {s} (\theta) := \mathbb {E} \left[ \sum_ {h = 0} ^ {H - 1} \gamma^ {h} r \left(s _ {h}, a _ {h}\right) \mid a _ {h} \sim \pi_ {\theta} \left(a _ {h} \mid s _ {h}\right), s _ {0} = s \right], \tag {1}
+$$
+
+where the expectation is with respect to the stochasticity in the policy $\pi_{\theta}$ and the transition dynamics $P$ . We note that the formulation in (1) learns a policy for a specific reward function $r$ (fixed a priori). As detailed in the introduction, if the reward function $r$ does not capture the intended behavior required by humans, it would lead to learning a misaligned policy. Therefore, policy learning with a fixed reward does not allow one to tether the training process to an external objective such as human preferences (Christiano et al., 2017), social welfare (Balcan et al., 2014), or market stability (Buehler et al., 2019). To address this issue, we propose a bilevel framework for policy alignment next.
+
+# 3.1 POLICY ALIGNMENT IN REINFORCEMENT LEARNING: A BILEVEL FORMULATION
+
+To achieve policy alignment in RL, we consider the following bilevel optimization problem:
+
+$$
+\text {(u p p e r)} \quad \max _ {\nu} G (\nu , \theta^ {*} (\nu)) \tag {2}
+$$
+
+$$
+\text {(l o w e r)} \quad \text {s . t .} \theta^ {*} (\nu) := \arg \max _ {\theta} \mathbb {E} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} r _ {\nu} (s _ {h}, a _ {h}) \mid a _ {h} \sim \pi_ {\theta} (a _ {h} | s _ {h}). s _ {0} = s \right],
+$$
+
+where $\theta$ is the policy parameter as in (1) and $\nu \in \mathbb{R}^n$ is the reward parameter. We discuss the formulation in (2) in detail as follows.
+
+Lower Level (LL): This is the policy learning stage for a given reward parameterization $\nu$ . For a fixed $\nu$ , LL problem is the same as in (1) but note the explicit dependence of LL objective in (2) on the reward parameter $\nu$ which is different from (1). In this work, we restrict focus to the case that the optimizer $\theta^{*}(\nu)$ at the lower level is unique, which mandates that one parameterize the policy in a tabular (Agarwal et al., 2020; Bhandari & Russo, 2021) or softmax fashion (Mei et al., 2020a); otherwise, at most one can hope for with a policy gradient iteration is to obtain approximate local extrema (Zhang et al., 2020). We defer a more technical discussion of this aspect to Section 5.
+
+Upper Level (UL)): This level (we also call it the designer level) evaluates the optimal policy learned at the lower level and tests for alignment. In (2), we aim to maximize an objective function $G(\nu, \theta^{*}(\nu))$ , which depends on the reward parameters $\nu$ and optimal policy parameter $\theta^{*}(\nu)$ , which is an implicit function of $\nu$ . To be specific, we consider a utility (which is the alignment objective) at the upper level of the form
+
+$$
+G (\nu , \theta^ {*} (\nu)) = \Upsilon \left(\pi_ {\theta^ {*} (\nu)}\right) + Z (\nu), \tag {3}
+$$
+
+which is comprised of two terms: a quantifier $\Upsilon(\pi_{\theta^{*}(\nu)})$ of the merit of design parameters $\nu \in \mathbb{R}^n$ , and $Z(\nu)$ representing a regularizer or prior directly defined over the parameters of the reward function. More specifically, the explicit mathematical form of $\Upsilon(\pi_{\theta^{*}(\nu)})$ decides the quality of policy $\pi_{\theta^{*}(\nu)}$ by collecting trajectories (denoted by $\tau$ ) and associating a designer's evaluation reward $U_{\nu}(\tau)$ given by
+
+$$
+\Upsilon \left(\pi_ {\theta^ {*} (\nu)}\right) = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} [ U _ {\nu} (\tau) ] = \sum_ {\tau} U _ {\nu} (\tau) \cdot \rho (\tau ; \theta^ {*} (\nu)), \tag {4}
+$$
+
+where $\rho(\tau; \theta^{*}(\nu))$ denotes the probability distribution over the trajectories $\tau$ and can be explicitly expressed as $\rho(\tau; \theta^{*}(\nu)) = \rho(s_0) \prod_{h=0}^{H_u} P(s_{h+1} \mid s_h, a_h) \pi_{\theta^{*}(\nu)}(a_h | s_h)$ , where $H_u$ denotes the length of upper-level trajectory, $\rho(s_0)$ represent the initial state distribution. We discuss the explicit form of such an objective $U_\nu$ in detail in Section 3.2 and also in Appendix C.
+
+Remark 1 (Contrast with Standard Stochastic Bilevel Optimization). We highlight an important difference between our formulation in (2) and the standard stochastic bilevel optimization (SBO) in literature (Ghadimi & Wang, 2018a; Akhtar et al., 2022). We note that in (2), the distribution of stochastic upper-level alignment objective depends on the lower-level optimal variable (policy in our case). This differs from the existing works SBO where the expectation is over data whose distribution does not depend upon the lower level optimization variable. Hence, developing solutions for (2) exhibits unique technical challenges not found in the prior research.
+
+# 3.2 REINFORCEMENT LEARNING FROM HUMAN FEEDBACK (RLHF) - A SPECIAL CASE
+
+In this section, we demonstrate how our formulation proposed in (3) generalizes the RLHF paradigm (Christiano et al., 2017; Lee et al., 2021; Park et al., 2022). In RLHF, as proposed in Christiano et al. (2017), operates mainly in three iterative steps: we start by (step 1) learning a policy (say $\pi_{\theta^{*}(\nu)}$ ) for a given reward $r_{\nu}$ by solving $\arg \max_{\theta} \mathbb{E}\left[\sum_{h=0}^{H_{\ell}-1} \gamma^{h} r_{\nu}(s_{h},a_{h})\right]$ , (step 2) collect human feedback after collecting trajectories (denoted by dataset $\mathcal{D}$ ) from $\pi_{\theta^{*}(\nu)}$ , (step 3) learn a new aligned reward model $\nu$ by solving $\min_{\nu} \mathbb{E}_{y,\tau_0,\tau_1 \sim \mathcal{D}}[\ell(\nu;y,\tau_0,\tau_1)]$ where $\ell$ denotes the alignment objective, and then go back to (step 1). This iterative process is repeated over multiple iterations as detailed in Christiano et al. (2017); Lee et al. (2021); Park et al. (2022). Irrespective of its effectiveness in practice, a rigorous mathematical formulation for RLHF is missing from the literature. Furthermore, the existing RLHF pipeline, in step 3, completely ignores the fact that the data $\mathcal{D}$ is the function of $\pi_{\theta^{*}(\nu)}$ , which results in an incorrect objective to learn a reward parameter. This results in policy misalignment and a performance gap, as highlighted in Figure 1(b). We reformulate the RLHF problem following our bilevel formulation as follows
+
+$$
+\max _ {\nu} \mathbb {E} _ {y, \tau_ {0}, \tau_ {1} \sim \rho_ {h} (\tau ; \theta^ {*} (\nu))} [ y \log P _ {\nu} (\tau_ {0} > \tau_ {1}) + (1 - y) \log P _ {\nu} (\tau_ {0} < \tau_ {1}) ] \tag {5}
+$$
+
+$$
+\text {s . t .} \theta^ {*} (\nu) := \arg \max _ {\theta} \mathbb {E} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} r _ {\nu} (s _ {h}, a _ {h}) |, s _ {0} = s \right],
+$$
+
+where $P_{\nu}(\tau_0 > \tau_1)$ is the probability of preferring $\tau_0$ over $\tau_1$ (denoted by $y = 1$ ). We can model $P_{\nu}$ using the well-known Bradley Terry model (Bradley & Terry, 1952) by
+
+$$
+P _ {\nu} \left(\tau_ {0} > \tau_ {1}\right) = \frac {\exp \sum_ {h = 0} ^ {H _ {u} - 1} r _ {\nu} \left(s _ {h} ^ {0} , a _ {h} ^ {0}\right)}{\exp \sum_ {h = 0} ^ {H _ {u} - 1} r _ {\nu} \left(s _ {h} ^ {0} , a _ {h} ^ {0}\right) + \exp \sum_ {h = 0} ^ {H _ {u} - 1} r _ {\nu} \left(s _ {h} ^ {1} , a _ {h} ^ {1}\right)}, \tag {6}
+$$
+
+where $(s_h^i, a_h^i)$ denotes state-action pair at $h^{\mathrm{th}}$ time-step in the $i^{\mathrm{th}}$ trajectory. At the upper level in (5), we highlight the dependence of data distribution $\rho_h(\tau; \theta^*(\nu))$ on the parameter $\nu$ via optimal policy $\pi_{\theta^*(\nu)}$ . The sampling distribution is given as $\rho_h(y, \tau_0, \tau_1; \theta^*(\nu)) =$
+
+$h(y|\tau_0,\tau_1)P(\tau_0;\theta^* (\nu))P(\tau_1;\theta^* (\nu))$ , where, $h(y|\tau_0,\tau_1)$ represents the human distribution of trajectory preference (unknown and realized only through samples). The trajectories $\tau_0,\tau_1$ are sampled as $\tau \sim \rho (\tau ;\theta^{*}(\nu))$ with the policy given by $\pi_{\theta^{*}(\nu)}(a|s)$ . Hence, looking at (5), we note that it matches exactly with our formulation in (2) with upper level objective
+
+$$
+G (\nu , \theta^ {*} (\nu)) := \mathbb {E} _ {y, \tau_ {0}, \tau_ {1} \sim \rho_ {h} (\tau ; \theta^ {*} (\nu))} [ y \log P _ {\nu} (\tau_ {0} > \tau_ {1}) + (1 - y) \log P _ {\nu} (\tau_ {0} < \tau_ {1}) ]. \tag {7}
+$$
+
+# 4 PROPOSED APPROACH: AN ALGORITHM TO SOLVE PARL
+
+As mentioned in Remark 1, the resulting bilevel optimization problem in (2) differs from the standard bilevel problem studied well in the optimization literature. Hence, we cannot directly apply any off-the-shelf algorithm to solve 2. In this section, we provide a step-by-step development of an iterative procedure to solve the policy alignment in (2) based on the bilevel algorithm1 available in Ghadimi & Wang (2018b). Let us begin by deriving the gradient of the upper objective (cf. (3) and (4)) with respect to design parameter $\nu$ , which is given by
+
+$$
+\begin{array}{l} \nabla_ {\nu} G (\nu , \theta^ {*} (\nu)) = \nabla_ {\nu} \sum_ {\tau} U _ {\nu} (\tau) \cdot \rho (\tau ; \theta^ {*} (\nu)) + \nabla_ {\nu} Z (\nu) \tag {8} \\ = \sum_ {\tau} U _ {\nu} (\tau) \cdot \nabla_ {\nu} \log \left(\rho \left(\tau ; \theta^ {*} (\nu)\right)\right) \cdot \rho (\tau ; \theta^ {*} (\nu)) + \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} \left[ \nabla_ {\nu} U _ {\nu} (\tau) \right] + \nabla_ {\nu} Z (\nu) \\ = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} [ U _ {\nu} (\tau) \cdot \nabla_ {\nu} \log (P (\tau ; \theta^ {*} (\nu))) ] + \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} [ \nabla_ {\nu} U _ {\nu} (\tau) ] + \nabla_ {\nu} Z (\nu) \\ = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} \left[ U _ {\nu} (\tau) \cdot \sum_ {h = 0} ^ {H _ {u} - 1} \nabla_ {\nu} \log \pi_ {\theta^ {*} (\nu)} (a _ {h} | s _ {h}) \right] + \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} [ \nabla_ {\nu} U _ {\nu} (\tau) ] + \nabla_ {\nu} Z (\nu), \\ \end{array}
+$$
+
+where we have used the log-trick and standard rule of expectation to get the final expression in (8) (Williams, 1992; Sutton et al., 1999).
+
+Novel terms in gradient evaluation: We emphasize two terms (a) the score function term $\nabla_{\nu}\log \pi_{\theta^{*}(\nu)}(a|s)$ in (8), denotes the gradient of logarithm of the optimal policy with respect to the design parameter $\nu$ ; and (b) the expectation is with respect to the trajectory distribution $\rho (\tau ;\theta^{*}(\nu))$ generated under policy at the lower-level $\pi_{\theta^{*}(\nu)}$ . This term captures the change of optimal policy with respect to the reward parameters. This is crucial because the designer (such as a regulatory body or central planner) at the upper level can directly control the policy learning by modifying the reward parameters. We remark that both these terms are missing from the existing RLHF formulation in literature (such as in the objective in step 1 detailed in Section 3.2).
+
+Challenges: However, the estimation of $\nabla_{\nu}\log \pi_{\theta^{*}(\nu)}(a_h|s_h)$ is nontrivial as it depends on the solution of the lower-level problem in (2), and therefore requires the evaluation of hypergradient $\nabla_{\nu}\theta^{*}(\nu)$ . To see that, let us employ the shorthand notation $f_{h}(\theta^{*}(\nu))\coloneqq \log \pi_{\theta^{*}(\nu)}(a_h|s_h)$ , we can rewrite the gradient² as
+
+$$
+\nabla_ {\nu} f _ {h} \left(\theta^ {*} (\nu)\right) = \nabla_ {\nu} \theta^ {*} (\nu) \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right). \tag {9}
+$$
+
+Now, from the first order optimality condition for the lower level in (2), it holds that
+
+$$
+\nabla_ {\theta} V _ {s} (\nu , \theta^ {*} (\nu)) = 0, \tag {10}
+$$
+
+which is the gradient of lower-level objective with respect to parameter $\theta$ evaluated at the optimal $\theta^{*}(\nu)$ . Now, differentiating again with respect to $\nu$ on both sides of (34), we obtain
+
+$$
+\nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) + \nabla_ {\nu} \theta^ {*} (\nu) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) = 0. \tag {11}
+$$
+
+The above expression would imply that we can write the final expression for the gradient in (9) as
+
+$$
+\nabla_ {\nu} f _ {h} \left(\theta^ {*} (\nu)\right) = - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right). \tag {12}
+$$
+
+Algorithm 1 Algorithm for Policy Alignment in Reinforcement Learning (A-PARL)
+
+1: Input: Reward parametrization $\nu_{0}$ policy initialization $\theta^{0}$ , upper and lower-level step sizes $\alpha_{u} > 0, \alpha_{\ell} > 0$ respectively f
+2: for all $t = 0,1,2,\dots,T - 1$ do
+
+3: for all $k = 0,2,\dots,K - 1$ do
+
+4: Sample $N$ trajectories $\tau \sim \rho (\tau ;\theta^K (\nu_t))$ and estimate policy gradient $\nabla_{\theta}V_{s}(\nu_{t},\theta^{K}(\nu_{t}))$ from equation (15)
+5: Update the policy gradient parameter as :
+
+$$
+\pi_ {\theta^ {k + 1} \left(\nu_ {t}\right)} \leftarrow \pi_ {\theta^ {k} \left(\nu_ {t}\right)} + \alpha_ {\ell} \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right) \quad \dots \text {p o l i c y u p d a t e}
+$$
+
+6: Update the reward parameterization in the upper-level from equation (14) as :
+
+$$
+r _ {\nu_ {t + 1}} \leftarrow r _ {\nu_ {t}} - \alpha_ {u} \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) \quad \dots \text {r e w a r d u p d a t e}
+$$
+
+7: Output: $\nu_{T},\theta^{K}(\nu_{T})$
+
+We substitute (12) into (8) to write the final expression for the gradient of the upper objective in (2) as
+
+$$
+\begin{array}{l} \nabla_ {\nu} G [ \nu , \theta^ {*} (\nu) ] = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} \left[ U _ {\nu} (\tau) \cdot \sum_ {h = 0} ^ {H _ {u} - 1} \left[ - \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} \nabla_ {\theta} f _ {h} (\theta^ {*} (\nu)) \right] \right] \\ + \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} \left[ \nabla_ {\nu} U _ {\nu} (\tau) \right] + \nabla_ {\nu} Z (\nu). \tag {13} \\ \end{array}
+$$
+
+Even for the gradient expression in (13), there are three intertwined technical challenges such as the requirement to estimate $\pi_{\theta^{*}(\nu)}$ , evaluating Jacobians and Hessians of the lower-level problem, and sampling trajectories in an unbiased manner from $\rho(\tau; \theta^{*}(\nu))$ which depends upon $\pi_{\theta^{*}(\nu)}$ . We write the explicit values of the terms as follows. This establishes a precise connection to the generalized alignment objective.
+
+Upper-level gradient estimation: To estimate the gradient of the upper-level objective in (8), we require information about $\pi_{\theta^{*}(\nu)}$ which is not available in general unless the lower-level objective has a closed-form solution. Hence, we approximate $\pi_{\theta^{*}(\nu_{t})}$ with $\pi_{\theta^K (\nu_t)}$ i.e., running K-step policy gradient steps at the lower level to obtain the approximate gradient of the upper level at $\nu_{t}$ as
+
+$$
+\widetilde {\nabla} _ {\nu} G \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) = \mathbb {E} _ {\rho \left(\tau ; \theta^ {K} \left(\nu_ {t}\right)\right)} \left[ U _ {\nu} (\tau) \cdot \sum_ {t = 0} ^ {H _ {u} - 1} \left[ \widetilde {M} ^ {K} \left(\nu_ {t}\right) \nabla_ {\theta} f _ {h} \left(\theta^ {K} \left(\nu_ {t}\right)\right) \right] + \nabla_ {\nu} U _ {\nu} (\tau) \right] + \nabla_ {\nu} Z \left(\nu_ {t}\right), \tag {14}
+$$
+
+where $\widetilde{M}^K (\nu_t) = -\nabla_{v,\theta}^2 V_s(\nu_t,\theta^K (\nu_t))\nabla_\theta^2 V_s(\nu_t,\theta^K (\nu_t))^{-1}$ .
+
+Lower-level objective gradient, Jacobian, and Hessian estimation: Here, we derive the gradients for the lower-level objective and, subsequently the Hessian and mixed Hessian terms for our algorithmic description. First, we write down the gradient of lower-level objectives using the policy gradient theorem (Williams, 1992; Sutton et al., 1999) as
+
+$$
+\nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) = \mathbb {E} _ {\rho \left(\tau ; \theta^ {K} \left(\nu_ {t}\right)\right)} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right) \right], \tag {15}
+$$
+
+where $H_{\ell}$ is the horizon or the episode length. Similarly, the Hessian of the lower objective is:
+
+$$
+\nabla_ {\theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) = \mathbb {E} _ {\rho \left(\tau ; \theta^ {K} \left(\nu_ {t}\right)\right)} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right) \right], \tag {16}
+$$
+
+Finally, we can write the mixed second-order Jacobian matrix as
+
+$$
+\nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) = \mathbb {E} _ {\rho \left(\tau ; \theta^ {K} \left(\nu_ {t}\right)\right)} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \left[ \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right) \right] ^ {T}\right) \right]. \tag {17}
+$$
+
+Now, utilizing the expressions in (14)-(17), we summarize the proposed steps in Algorithm 1. We explain the execution of Algorithm 1 with the help of Figure 4 in the Appendix B. We denote the number of lower-level iterates by $K$ for better exposition which is a function of upper iterations $t \in T$ in the convergence analysis. Before shifting to analyzing the convergence behavior of Algorithm 1, we close with a remark.
+
+Remark 2. We have only presented the analytical forms of the first and second-order information required to obtain a numerical solver for problem in (2). However, in practice, these update directions are unavailable due to their dependence on distributions $\rho (\tau ;\theta^{*}(\nu))$ and MDP transition model $P$ . Therefore, only sampled estimates of the expressions in (14)-(17) are available. For this work, we sidestep this challenge by assuming access to the oracles to (14)-(17). This helps us to focus more on the policy and reward entanglement in our bilevel formulation. We can extend the analysis to stochastic settings utilizing the standard techniques in stochastic optimization literature (Chen et al., 2022; Kwon et al., 2023; Li et al., 2022b; Ji et al., 2021; Ghadimi & Wang, 2018b).
+
+Remark 3 (Gradient derivations for RLHF problem in Section 3.2). For the special case of RLHF discussed in, we provide a detailed derivations for the gradients at the lower and upper level objectives in Appendix D.
+
+# 5 CONVERGENCE ANALYSIS
+
+In this section, we analyze the convergence behavior of Algorithm 1. Since the upper level $G(\nu, \theta^{*}(\nu))$ is non-convex with respect to $\nu$ , we consider $\nabla_{\nu}G(\nu, \theta^{*}(\nu))$ as our convergence criteria and show its convergence to a first-order stationary point, as well as the convergence of $\theta^{K}(\nu)$ to $\theta^{*}(\nu)$ . Taken together, these constitute a local KKT point (Boyd & Vandenberghe, 2004)[Ch. 5] Without loss of generality, our convergence analysis is for the minimization (upper and lower level objectives). We proceed then by introducing some technical conditions required for our main results.
+
+Assumption 1 (Lipschitz gradient of upper objective). For any $\nu \in \mathbb{R}^n$ , the gradient of the upper objective is Lipschitz continuous w.r.t to second argument with parameter $L_{g}$ , i.e., we may write
+
+$$
+\left\| \nabla_ {\nu} G (\nu , \theta) - \nabla_ {\nu} G \left(\nu , \theta^ {\prime}\right) \right\| \leq L _ {g} \| \theta - \theta^ {\prime} \|. \tag {18}
+$$
+
+Assumption 2. For all $s \in S$ and $a \in A$ , reward function is bounded as $r_{\nu}(s, a) \leq R$ and Lipschitz w.r.t to $\nu$ , i.e., $|r_{\nu_1}(s, a) - r_{\nu_2}(s, a)| \leq L_r \| \nu_1 - \nu_2 \|$ .
+
+Assumption 3. The policy $\pi_{\theta}$ is Lipschitz with respect to parameter $\theta$ , which implies $\| \pi_{\theta_1}(\cdot |s) - \pi_{\theta_2}(\cdot |s)\| \leq L_{\pi}\| \theta_1 - \theta_2\|$ for all $\theta_1,\theta_2$ . The score function $\nabla_{\theta}\log \pi_{\theta}(a|s)$ is bounded $\| \nabla_{\theta}\log \pi_{\theta}(a|s)\| \leq B$ and Lipschitz, which implies
+
+$$
+\left\| \nabla_ {\theta} \log \pi_ {\theta_ {1}} (\cdot | s) - \nabla_ {\theta} \log \pi_ {\theta_ {2}} (\cdot | s) \right\| \leq L _ {1} \| \theta_ {1} - \theta_ {2} \|. \tag {19}
+$$
+
+Further, the policy parameterization induces a score function whose Hessian is Lipschitz as
+
+$$
+\left\| \nabla_ {\theta} ^ {2} \log \pi_ {\theta_ {1}} (\cdot | s) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta_ {2}} (\cdot | s) \right\| \leq L _ {2} \| \theta_ {1} - \theta_ {2} \| f o r a l l \theta_ {1}, \theta_ {2}. \tag {20}
+$$
+
+Assumption 4. The value function $V_{s}(\nu, \theta)$ satisfies the Polyak-Lojasiewicz (PL) condition (with unique minima) with respect to $\theta$ with parameter $\mu$ . We denote $\{\lambda (\nabla_{\theta}^{2}V_{s}(\nu, \theta))_{j}\}_{j=1}^{d}$ as the eigenvalues of Hessian matrix $\nabla_{\theta}^{2}V_{s}(\nu, \theta)$ . Although, $V_{s}(\nu, \theta)$ is non-convex in $\theta$ , but follows the restriction on the eigenvalues as $\lambda (\nabla_{\theta}^{2}V_{s}(\nu, \theta)) \in [-\hat{l}, -\hat{\mu}] \cup [\hat{\mu}, \hat{l}]$ .
+
+Assumption 1 is standard in the analysis of non-convex optimization, and Assumption 2 is common in RL which bounds the reward function value (Zhang et al., 2020; Agarwal et al., 2020; Bhandari & Russo, 2021). In Assumption 3, the score function Lipschitz part is considered in the literature. But because we are dealing with a bilevel formulation here, which requires dealing with evaluating the lower level policy at the upper level, and also utilizing second-order information of the value function (cf. (13)), we need to assume policy and Hessian of policy are Lipschitz as well. Also, the second-order smoothness condition was studied in establishing conditions under which a local extremum is attainable in the non-convex setting (Zhang et al., 2020)[Sec. 5]. Additionally, we need Assumption 4 because we are in a bilevel regime without lower level strong convexity (Huang, 2023; Liu et al., 2023). However, the value function satisfies the Polyak-Lojasiewicz (PL) condition under common policy parameterizations (Bhandari & Russo, 2021; Mei et al., 2020b). $\hat{\mu},\hat{l}$ defined in Appendix 4. we provide a detailed discuss in Appendix I. Next, we introduce key technical lemmas
+
+
+Figure 2: In this figure, we compare the performance of our algorithm A-PARL against SOTA baselines Pebble (Lee et al., 2021), PEBBLE+SURF (Park et al., 2022) and Oracle (true reward) for Walker (DMSuite (Tassa et al., 2018)), DoorOpen and ButtonPress (MetaWorld Yu et al. (2021)) w.r.t ground truth return (averaged over 5 seeds). It clearly demonstrates the superiority of our algorithm over existing baselines in terms of episodic return, where A-PARL achieves near-oracle performance in a much faster time. This highlights the importance of our bilevel framework which considers the dependence (missing from existing literature) of distribution on the lower-level policy parameter during training.
+
+regarding the iterates generated by Algorithm 1. We begin by quantifying the distributional drift associated with the transition model under approximate policy $\pi_{\theta^{K}(\nu_{t})}$ as compared with $\pi_{\theta^{*}(\nu_{t})}$ at the lower level, which results in a transient effect at the upper level.
+
+Lemma 1. Under Assumptions 1 - 4, for trajectory $\tau = \{s_h,a_h\}_{h = 1}^{H_u}$ , it holds that
+
+$$
+D _ {f} \left(\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \theta^ {K} (\nu))\right) \leq \frac {H _ {u} L _ {2}}{2} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {21}
+$$
+
+where $D_{f}$ is the $f$ -divergence between distributions and $L_{2}$ is the Lipschitz parameter (cf. Assum. 3).
+
+The proof of Lemma 1 in provided in Appendix G.1. We highlight that the upper bound in Lemma 1 is novel to our analysis of bilevel RL which will not appear in the RLHF setup considered in the literature. Next, we establish some error bound conditions on key second-order terms that appear in equations (14)-(17) when we substitute $\theta^{*}(\nu_{t})$ by $\theta^K (\nu_t)$ .
+
+Lemma 2. Under Assumptions 1-(4), the lower level iterates of Algorithm 1 satisfies $\| \theta^K (\nu_t) - \theta^* (\nu)\| ^2\leq \frac{\eta^K L_6}{\mu} Z$ , where, $Z\coloneqq \max_{\nu}\| \theta^{0} - \theta^{*}(\nu)\|^{2}$ , $\eta \coloneqq 1 - \alpha_3$ , $\alpha_{3} = \alpha_{\ell}(1 - \frac{\alpha_{\ell}L_{6}}{2})\frac{\mu}{2}$ , $L_{6} = L_{5}\frac{HL_{2}}{2} +L_{5}$ , $L_{5} = H_{l}^{2}RL_{1}$ , $\mu$ is the PL constant, and $K$ denotes the number of lower-level iterations, and policy gradient step-size satisfies $\alpha_{\ell} < 2 / \min (H_{\ell}L_{2},\mu)$ , with $\mu$ as the PL constant (Assumption 4).
+
+The proof of Lemma 2 is provided in Appendix H.7. The proof relies on the assumption that the value function satisfies a Polyak Lojasiewicz (PL) condition under appropriate policy parametrization.
+
+Theorem 1. Under Assumptions 1-4, for the proposed Algorithm 1, it holds that
+
+$$
+\frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} \leq \frac {G _ {0} - G ^ {*}}{\delta_ {1} T} + \frac {\eta \delta_ {2} L _ {6} Z}{T \delta_ {1} \mu (1 - \eta)} \tag {22}
+$$
+
+where $G_0 \coloneqq G(\nu_0, \theta^*(\nu_0))$ and $G^*$ denotes the global optimum of the upper objective, $\delta_1 = \alpha_u \left( 1 - \frac{1}{2c_1} - L_g \alpha_u \right)$ and $\delta_2 = \alpha_u \left( \frac{c_1}{2} + L_g \alpha_u \right)$ , $c_1$ is a positive constant defined in eqn. (45), and the step-size range of satisfies $\alpha_u < 1 / L_g$ , with $L_g$ as in Assumption 1 and $\alpha_\ell$ as stated in Lemma 2.
+
+In Theorem 1, we note that we achieve a final rate of $\mathcal{O}(1 / T)$ , which matches with bilevel optimization for non-convex upper objective without requiring strong convexity at the lower level in (Ghadimi & Wang, 2018a).
+
+# 6 EXPERIMENTAL EVALUATIONS
+
+We consider the challenging tasks of robotic locomotion and manipulation in the human preference-based RL setting as also considered in Lee et al. (2021); Park et al. (2022); Metcalf et al. (2022).
+
+Human Feedback: Although real-human preferences would have been ideal for the experiments, but it is hard to get them. Hence, we leverage simulated human teachers as used in prior research (Lee et al., 2021; Park et al., 2022). The simulated teacher provides preferences on pairwise trajectories to the agent according to the underlying true reward function, which helps us to evaluate the policy alignment efficiently. To design more human-like teachers, various human behaviors like stochasticity, myopic behavior, mistakes, etc. are integrated while generating preferences as in Lee et al. (2021); Park et al. (2022).
+
+Baselines: We consider two state-of-the-art baselines for preference-based RL, which are PEBBLE (Lee et al., 2021) and PEBBLE+SURF (Park et al., 2022). We specifically compare with these two algorithms since PEBBLE+SURF (Park et al., 2022) and PEBBLE (Lee et al., 2021) already outperforms all the other existing algorithms, including (Metcalf et al., 2022; Christiano et al., 2017) in similar environment and configurations. It is important to note that PEBBLE+SURF utilizes additional unsupervised data and augmentations to improve the performance of PEBBLE, and hence depending on the quality and amount of the unsupervised information, the performance of PEBBLE+SURF varies rapidly. Hence, it is not extremely fair to compare PEBBLE+SURF with ours due to this obvious benefit, but still, we observe that our algorithm performs better than PEBBLE+SURF with controlled augmentations.
+
+Experimental Results Discussions and Evaluation: To evaluate the performance of our algorithm against baselines, we select true episodic reward return as a valid metric. Since the eventual goal of any RL agent is to maximize the expected value of the episodic reward return, which is widely used in the literature. We conduct the experimental evaluations primarily centered on three key ideas - i.) First, we characterize the gap in the performance of the current SOTA methods due to inexact alignment strategies as demonstrated in Figure 1 which clearly shows a significant gap in current SOTA methods. ii.) Second, we compare the performance of our algorithm against baselines in the above benchmarks w.r.t ground truth return as shown in Figure 2 (averaged over 5 seeds). Environments: We evaluate the performance of the proposed algorithm for our framework PARL on large-scale continuous control robotics tasks in DM Control suite (Tassa et al., 2018) and Meta-World (Yu et al., 2021).
+
+It demonstrates our algorithm's superiority over existing baselines in terms of episodic return, where A-PARL achieves near-oracle performance in a much faster time with an improved sample efficiency of approximately $63\%$ . iii.) Finally, we test the alignment behavior of our learned policy by validating the generated trajectories on interacting with the environment against potential hacking or spurious learning. We validated if the agent is learning desired behaviors or has learned to hack the fitted reward due to the issue of reward overoptimization in RLHF (Gao et al., 2022) (specifically at an early stage of learning where it hits the high reward point). As observed in Figure 3, our agent learns the desired behavior and is able to open the door, whereas the existing algorithm (PEBBLE) fails to do so, demonstrating the effectiveness of our algorithm in alignment.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 3: A visualization of learned behavior for the baseline Pebble (top row) and proposed (in the bottom row) (with policy at Env-Step $0.5 \times 10^{6}$ ). We note that the proposed A-PARL algorithm has been able to learn the aligned behavior of opening the door in the generated trajectory (top-right) whereas PEBBLE gets stuck depicting our algorithm's efficiency in alignment.
+
+
+(b)
+
+
+
+
+
+
+
+# 7 CONCLUSION
+
+Potentially misaligned agents pose a severe risk to society; thus making AI alignment at the forefront of research of the current times (Liu et al., 2022). We identify a major gap within current algorithmic designs for AI alignment due to a lack of characterization of the dependence of the alignment objective on the data generated by policy trajectories. To mitigate the gap, we develop a unified bilevel optimization-based framework, PARL as a first step to address the policy alignment issue in reinforcement learning. Our proposed algorithm demonstrates superior performance over existing SOTA methods in large-scale robotics control tasks with provable convergence guarantees of rate $\mathcal{O}(1 / T)$
+
+# 8 ACKNOWLEDGEMENT
+
+Chakraborty and Huang are supported by the National Science Foundation NSF-IIS-FAI program, DOD-ONR-Office of Naval Research, DOD Air Force Office of Scientific Research, DOD-DARPA-Defense Advanced Research Projects Agency Guaranteeing AI Robustness against Deception (GARD), Adobe, Capital One, and JP Morgan faculty fellowships. Manocha and Bedi would like to acknowledge the support by Army Cooperative Agreement W911NF2120076 and Amazon Research Awards 2022.
+
+# REFERENCES
+
+Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. Optimality and approximation with policy gradient methods in markov decision processes. In Conference on Learning Theory, pp. 64-66. PMLR, 2020.
+Zeeshan Akhtar, Amrit Singh Bedi, Srujan Teja Thomdapu, and Ketan Rajawat. Projection-free stochastic bi-level optimization. IEEE Transactions on Signal Processing, 70:6332-6347, 2022.
+Saurabh Arora and Prashant Doshi. A survey of inverse reinforcement learning: Challenges, methods and progress, 2020.
+Yu Bai, Chi Jin, Huan Wang, and Caiming Xiong. Sample-efficient learning of stackelberg equilibria in general-sum games. Advances in Neural Information Processing Systems, 34:25799-25811, 2021.
+Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, Nicholas Joseph, Saurav Kadavath, Jackson Kernion, Tom Conerly, Sheer El-Showk, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, Tristan Hume, Scott Johnston, Shauna Kravec, Liane Lovitt, Neel Nanda, Catherine Olsson, Dario Amodei, Tom Brown, Jack Clark, Sam McCandlish, Chris Olah, Ben Mann, and Jared Kaplan. Training a helpful and harmless assistant with reinforcement learning from human feedback, 2022.
+Maria-Florina Balcan, Amit Daniely, Ruta Mehta, Ruth Urner, and Vijay V Vazirani. Learning economic parameters from revealed preferences. In Web and Internet Economics: 10th International Conference, WINE 2014, Beijing, China, December 14-17, 2014. Proceedings 10, pp. 338-353. Springer, 2014.
+Amrit Singh Bedi, Souradip Chakraborty, Anjaly Parayil, Brian M Sadler, Pratap Tokekar, and Alec Koppel. On the hidden biases of policy mirror ascent in continuous action spaces. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato (eds.), Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 1716-1731. PMLR, 17-23 Jul 2022. URL https://proceedings.mlr.press/v162/bedi22a.html.
+Viktor Bengs, R $\tilde{A}^3$ bert Busa-Fekete, Adil El Mesaoudi-Paul, and Eyke H $\tilde{A}^1$ llermeier. Preference-based online learning with dueling bandits: A survey. Journal of Machine Learning Research, 22 (7):1-108, 2021. URL http://jmlr.org/papers/v22/18-546.html.
+Dimitris Bertsimas and Constantine Caramanis. Finite adaptability in multistage linear optimization. IEEE Transactions on Automatic Control, 55(12):2751-2766, 2010.
+Dimitris Bertsimas, Dan A Iancu, and Pablo A Parrilo. Optimality of affine policies in multistage robust optimization. Mathematics of Operations Research, 35(2):363-394, 2010.
+Jalaj Bhandari and Daniel Russo. On the linear convergence of policy gradient methods for finite mdps. In International Conference on Artificial Intelligence and Statistics, pp. 2386-2394. PMLR, 2021.
+Stephen P Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
+Jerome Bracken and James T McGill. Mathematical programs with optimization problems in the constraints. Operations research, 21(1):37-44, 1973.
+
+Ralph Allan Bradley and Milton E. Terry. Rank analysis of incomplete block designs: I. the method of paired comparisons. Biometrika, 39:324, 1952. URL https://api-semanticscholar.org/CorpusID:125209808.
+Daniel S. Brown, Wonjoon Goo, Prabhat Nagarajan, and Scott Niekum. Extrapolating beyond suboptimal demonstrations via inverse reinforcement learning from observations, 2019.
+Hans Buehler, Lukas Gonon, Josef Teichmann, and Ben Wood. Deep hedging. Quantitative Finance, 19(8):1271-1291, 2019.
+Patrick Butlin. Ai alignment and human reward. In Proceedings of the 2021 AAAI/ACM Conference on AI, Ethics, and Society, pp. 437-445, 2021.
+Jincheng Cao, Ruichen Jiang, Nazanin Abolfazli, Erfan Yazdandoost Hamedani, and Aryan Mokhtari. Projection-free methods for stochastic simple bilevel optimization with convex lower-level problem, 2023.
+Zehong Cao, KaiChiu Wong, and Chin-Teng Lin. Weak human preference supervision for deep reinforcement learning, 2020.
+Andrew Caplin and Mark Dean. Revealed preference, rational inattention, and costly information acquisition. *American Economic Review*, 105(7):2183-2203, 2015.
+Stephen Casper, Xander Davies, Claudia Shi, Thomas Krendl Gilbert, Jérémy Scheurer, Javier Rando, Rachel Freedman, Tomasz Korbak, David Lindner, Pedro Freire, et al. Open problems and fundamental limitations of reinforcement learning from human feedback. arXiv preprint arXiv:2307.15217, 2023.
+Souradip Chakraborty, Amrit Singh Bedi, Alec Koppel, Pratap Tokekar, and Dinesh Manocha. Dealing with sparse rewards in continuous control robotics via heavy-tailed policies, 2022.
+Souradip Chakraborty, Amrit Singh Bedi, Alec Koppel, Brian M. Sadler, Furong Huang, Pratap Tokekar, and Dinesh Manocha. Posterior coreset construction with kernelized stein discrepancy for model-based reinforcement learning, 2023a.
+Souradip Chakraborty, Amrit Singh Bedi, Alec Koppel, Mengdi Wang, Furong Huang, and Dinesh Manocha. Steering: Stein information directed exploration for model-based reinforcement learning, 2023b.
+Souradip Chakraborty, Amisha Bhaskar, Anukriti Singh, Pratap Tokekar, Dinesh Manocha, and Amit Singh Bedi. Rebel: A regularization-based solution for reward overoptimization in reinforcement learning from human feedback, 2023c.
+Souradip Chakraborty, Jiahao Qiu, Hui Yuan, Alec Koppel, Furong Huang, Dinesh Manocha, Amit Singh Bedi, and Mengdi Wang. Maxmin-rlhf: Towards equitable alignment of large language models with diverse human preferences, 2024.
+Pei-Yu Chen, Myrthe L. Tielman, Dirk K. J. Heylen, Catholijn M. Jonker, and M. Birna van Riemsdijk. Ai alignment dialogues: An interactive approach to ai alignment in support agents, 2023.
+Tianyi Chen, Yuejiao Sun, Quan Xiao, and Wotao Yin. A single-timescale method for stochastic bilevel optimization. In Gustau Camps-Valls, Francisco J. R. Ruiz, and Isabel Valera (eds.), Proceedings of The 25th International Conference on Artificial Intelligence and Statistics, volume 151 of Proceedings of Machine Learning Research, pp. 2466-2488. PMLR, 28-30 Mar 2022. URL https://proceedings.mlr.press/v151/chen22e.html.
+Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30, 2017.
+Miroslav Dudík, Katja Hofmann, Robert E. Schapire, Aleksandrs Slivkins, and Masour Zoghi. Contextual dueling bandits, 2015.
+
+Tanner Fiez, Benjamin Chasnov, and Lillian J Ratliff. Convergence of learning dynamics in stackelberg games. arXiv preprint arXiv:1906.01217, 2019.
+Tanner Fiez, Benjamin Chasnov, and Lillian Ratliff. Implicit learning dynamics in stackelberg games: Equilibria characterization, convergence analysis, and empirical study. In International Conference on Machine Learning, pp. 3133-3144. PMLR, 2020.
+Chelsea Finn, Paul Christiano, Pieter Abbeel, and Sergey Levine. A connection between generative adversarial networks, inverse reinforcement learning, and energy-based models, 2016.
+Christopher Frye and Ilya Feige. Parenting: Safe reinforcement learning from human input. arXiv preprint arXiv:1902.06766, 2019.
+Johannes Fünkranz, Eyke Hüllermeier, Weiwei Cheng, and Sang-Hyeun Park. Preference-based reinforcement learning: A formal framework and a policy iteration algorithm. Mach. Learn., 89 (1-2):123-156, oct 2012. ISSN 0885-6125. doi: 10.1007/s10994-012-5313-8. URL https://doi.org/10.1007/s10994-012-5313-8.
+Leo Gao, John Schulman, and Jacob Hilton. Scaling laws for reward model overoptimization, 2022.
+Saeed Ghadimi and Mengdi Wang. Approximation methods for bilevel programming. arXiv preprint arXiv:1802.02246, 2018a.
+Saeed Ghadimi and Mengdi Wang. Approximation methods for bilevel programming, 2018b. URL https://arxiv.org/abs/1802.02246.
+Seyed Kamyar Seyed Ghasemipour, Richard Zemel, and Shixiang Gu. A divergence minimization perspective on imitation learning methods, 2019.
+Denizalp Goktas, Sadie Zhao, and Amy Greenwald. Zero-sum stochastic stackelberg games. Advances in Neural Information Processing Systems, 35:11658-11672, 2022.
+Edward W. Hill, Marco Bardoscia, and Arthur E. Turrell. Solving heterogeneous general equilibrium economic models with deep reinforcement learning. *ArXiv*, abs/2103.16977, 2021.
+Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning, 2016.
+Jonathan Ho, Jayesh K. Gupta, and Stefano Ermon. Model-free imitation learning with policy optimization, 2016.
+Zehong Hu, Yitao Liang, Jie Zhang, Zhao Li, and Yang Liu. Inference aided reinforcement learning for incentive mechanism design in crowdsourcing. Advances in Neural Information Processing Systems, 31, 2018.
+Feihu Huang. On momentum-based gradient methods for bilevel optimization with nonconvex lower-level. arXiv preprint arXiv:2303.03944, 2023.
+Feihu Huang, Junyi Li, Shangqian Gao, and Heng Huang. Enhanced bilevel optimization via bregman distance. Advances in Neural Information Processing Systems, 35:28928-28939, 2022.
+Leonid Hurwicz. Mechanism design without games. Advances in Economic Design, pp. 429-437, 2003.
+Borja Ibarz, Jan Leike, Tobias Pohlen, Geoffrey Irving, Shane Legg, and Dario Amodei. Reward learning from human preferences and demonstrations in atari, 2018.
+Kaiyi Ji and Yingbin Liang. Lower bounds and accelerated algorithms for bilevel optimization. Journal of Machine Learning Research, 23:1-56, 2022.
+Kaiyi Ji, Junjie Yang, and Yingbin Liang. Bilevel optimization: Convergence analysis and enhanced design, 2021.
+Bingyi Kang, Zequn Jie, and Jiashi Feng. Policy optimization with demonstrations. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2469-2478. PMLR, 10-15 Jul 2018. URL https://proceedings.mlr.press/v80/kang18a.html.
+
+Prashant Khanduri, Siliang Zeng, Mingyi Hong, Hoi-To Wai, Zhaoran Wang, and Zhuoran Yang. A near-optimal algorithm for stochastic bilevel optimization via double-momentum. Advances in neural information processing systems, 34:30271-30283, 2021.
+Jeongyeol Kwon, Dohyun Kwon, Stephen Wright, and Robert Nowak. A fully first-order method for stochastic bilevel optimization, 2023.
+Kimin Lee, Laura Smith, and Pieter Abbeel. Pebble: Feedback-efficient interactive reinforcement learning via relabeling experience and unsupervised pre-training, 2021.
+Tyler Lekang and Andrew Lamperski. Simple algorithms for dueling bandits, 2019.
+Junyi Li, Bin Gu, and Heng Huang. A fully single loop algorithm for bilevel optimization without hessian inverse. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 7426-7434, 2022a.
+Junyi Li, Feihu Huang, and Heng Huang. Local stochastic bilevel optimization with momentum-based variance reduction, 2022b.
+Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
+Risheng Liu, Yaohua Liu, Wei Yao, Shangzhi Zeng, and Jin Zhang. Averaged method of multipliers for bi-level optimization without lower-level strong convexity. arXiv preprint arXiv:2302.03407, 2023.
+Ruibo Liu, Ge Zhang, Xinyu Feng, and Soroush Vosoughi. Aligning generative language models with human values. In Findings of the Association for Computational Linguistics: NAACL 2022, pp. 241-252, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022-findings-naacl.18. URL https://aclanthology.org/2022-findings-naacl.18.
+Songtao Lu. Bilevel optimization with coupled decision-dependent distributions. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett (eds.), Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pp. 22758-22789. PMLR, 23-29 Jul 2023. URL https://proceedings.mlr.press/v202/1u23a.html.
+Boxiang Lyu, Qinglin Meng, Shuang Qiu, Zhaoran Wang, Zhuoran Yang, and Michael I Jordan. Learning dynamic mechanisms in unknown environments: A reinforcement learning approach. arXiv preprint arXiv:2202.12797, 2022a.
+Boxiang Lyu, Zhaoran Wang, Mladen Kolar, and Zhuoran Yang. Pessimism meets vcg: Learning dynamic mechanism design via offline reinforcement learning. In International Conference on Machine Learning, pp. 14601-14638. PMLR, 2022b.
+Hamid R. Maei, Csaba Szepesvári, Shalabh Bhatnagar, Doina Precup, David Silver, and Richard S. Sutton. Convergent temporal-difference learning with arbitrary smooth function approximation. In Proceedings of the 22nd International Conference on Neural Information Processing Systems, NIPS'09, pp. 1204-1212, Red Hook, NY, USA, 2009. Curran Associates Inc. ISBN 9781615679119.
+Chinmay Maheshwari, S Shankar Sasty, Lillian Ratliff, and Eric Mazumdar. Convergent first-order methods for bi-level optimization and stackelberg games. arXiv preprint arXiv:2302.01421, 2023.
+Eric S Maskin. Mechanism design: How to implement social goals. American Economic Review, 98 (3):567-576, 2008.
+Jincheng Mei, Chenjun Xiao, Csaba Szepesvari, and Dale Schuurmans. On the global convergence rates of softmax policy gradient methods. In International Conference on Machine Learning, pp. 6820-6829. PMLR, 2020a.
+
+Jincheng Mei, Chenjun Xiao, Csaba Szepesvari, and Dale Schuurmans. On the global convergence rates of softmax policy gradient methods. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 6820-6829. PMLR, 13-18 Jul 2020b. URL https://proceedings.mlr.press/v119/mei20b.html.
+Katherine Metcalf, Miguel Sarabia, and Barry-John Theobald. Rewards encoding environment dynamics improves preference-based reinforcement learning, 2022.
+Roger B Myerson. Mechanism design. Springer, 1989.
+Andrew Y. Ng and Stuart J. Russell. Algorithms for inverse reinforcement learning. In Proceedings of the Seventeenth International Conference on Machine Learning, ICML '00, pp. 663-670, San Francisco, CA, USA, 2000. Morgan Kaufmann Publishers Inc. ISBN 1558607072.
+Richard Ngo, Lawrence Chan, and Soren Mindermann. The alignment problem from a deep learning perspective. arXiv preprint arXiv:2209.00626, 2022.
+Aldo Pacchiano, Aadirupa Saha, and Jonathan Lee. Dueling rl: Reinforcement learning with trajectory preferences, 2023.
+Jongjin Park, Younggyo Seo, Jinwoo Shin, Honglak Lee, Pieter Abbeel, and Kimin Lee. Surf: Semi-supervised reward learning with data augmentation for feedback-efficient preference-based reinforcement learning, 2022.
+Georg Ch Pflug and Alois Pichler. Multistage stochastic optimization, volume 1104. Springer, 2014.
+Aaron Roth, Jonathan Ullman, and Zhiwei Steven Wu. Watch and learn: Optimizing from revealed preferences feedback. In Proceedings of the Forty-Eighth Annual ACM Symposium on Theory of Computing, STOC '16, pp. 949-962, New York, NY, USA, 2016. Association for Computing Machinery. ISBN 9781450341325. doi: 10.1145/2897518.2897579. URL https://doi.org/10.1145/2897518.2897579.
+Aadirupa Saha, Aldo Pacchiano, and Jonathan Lee. Dueling rl: Reinforcement learning with trajectory preferences. In International Conference on Artificial Intelligence and Statistics, pp. 6263-6289. PMLR, 2023.
+Kyriacos Shiarlis, Joao Messias, and Shimon Whiteson. Inverse reinforcement learning from failure. In Proceedings of the 2016 International Conference on Autonomous Agents & Multiagent Systems, AAMAS '16, pp. 1060-1068, Richland, SC, 2016. International Foundation for Autonomous Agents and Multiagent Systems. ISBN 9781450342391.
+Bharath K. Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Scholkopf, and Gert R. G. Lanckriet. On integral probability metrics, $\phi$ -divergences and binary classification, 2009.
+Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. Advances in neural information processing systems, 12, 1999.
+Richard S. Sutton, Hamid Reza Maei, Doina Precup, Shalabh Bhatnagar, David Silver, Csaba Szepesvári, and Eric Wiewiora. Fast gradient-descent methods for temporal-difference learning with linear function approximation. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML '09, pp. 993-1000, New York, NY, USA, 2009. Association for Computing Machinery. ISBN 9781605585161. doi: 10.1145/1553374.1553501. URL https://doi.org/10.1145/1553374.1553501.
+Pingzhong Tang. Reinforcement mechanism design. In *IJCAI*, pp. 5146-5150, 2017.
+Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdelmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite, 2018.
+Heinrich Von Stackelberg. Market structure and equilibrium. Springer Science & Business Media, 2010.
+
+Quoc-Liem Vu, Zane Alumbaugh, Ryan Ching, Quanches Ding, Arnav Mahajan, Benjamin Chasnov, Sam Burden, and Lillian J Ratliff. Stackelberg policy gradient: Evaluating the performance of leaders and followers. In ICLR 2022 Workshop on Gamification and Multiagent Solutions.
+Paweł Wawrzyński. Real-time reinforcement learning by sequential actor-critics and experience replay. Neural Networks, 22(10):1484-1497, 2009. ISSN 0893-6080. doi: https://doi.org/10.1016/j.neunet.2009.05.011. URL https://www.sciencedirect.com/science/article/pii/S0893608009001026.
+Kasun Weerakoon, Souradip Chakraborty, Nare Karapetyan, Adarsh Jagan Sathyamoorthy, Amir Singh Bedi, and Dinesh Manocha. Htron: efficient outdoor navigation with sparse rewards via heavy tailed adaptive reinforce algorithm, 2022.
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Reinforcement learning, pp. 5-32, 1992.
+Aaron Wilson, Alan Fern, and Prasad Tadepalli. A bayesian approach for policy learning from trajectory preference queries. In F. Pereira, C.J. Burges, L. Bottou, and K.Q. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 25. Curran Associates, Inc., 2012. URL https://proceedings.neurips.cc/paper_files/paper/2012/file/16c222aa19898e5058938167c8ab6c57-Paper.pdf.
+Christian Wirth, Riad Akrour, Gerhard Neumann, Johannes Furnkranz, et al. A survey of preference-based reinforcement learning methods. Journal of Machine Learning Research, 18(136):1-46, 2017.
+Yotam Wolf, Noam Wies, Yoav Levine, and Amnon Shashua. Fundamental limitations of alignment in large language models, 2023.
+Markus Wulfmeier, Peter Ondruska, and Ingmar Posner. Maximum entropy deep inverse reinforcement learning, 2016.
+Huang Xiao, Michael Herman, Joerg Wagner, Sebastian Ziesche, Jalal Etesami, and Thai Hong Linh. Wasserstein adversarial imitation learning, 2019.
+Yichong Xu, Ruosong Wang, Lin Yang, Aarti Singh, and Artur Dubrawski. Preference-based reinforcement learning with finite-time guarantees. Advances in Neural Information Processing Systems, 33:18784-18794, 2020.
+Junjie Yang, Kaiyi Ji, and Yingbin Liang. Provably faster algorithms for bilevel optimization. Advances in Neural Information Processing Systems, 34:13670-13682, 2021.
+Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Avnish Narayan, Hayden Shively, Adithya Bellathur, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning, 2021.
+Kaiqing Zhang, Alec Koppel, Hao Zhu, and Tamer Basar. Global convergence of policy gradient methods to (almost) locally optimal policies. SIAM Journal on Control and Optimization, 58(6): 3586-3612, 2020.
+Han Zhong, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Can reinforcement learning find stackelberg-nash equilibria in general-sum markov games with myopic followers? arXiv preprint arXiv:2112.13521, 2021.
+Banghua Zhu, Jiantao Jiao, and Michael I. Jordan. Principled reinforcement learning with human feedback from pairwise or $k$ -wise comparisons, 2023. URL https://arxiv.org/abs/2301.11270.
+Brian D. Ziebart, Andrew Maas, J. Andrew Bagnell, and Anind K. Dey. Maximum entropy inverse reinforcement learning. In Proceedings of the 23rd National Conference on Artificial Intelligence - Volume 3, AAAI'08, pp. 1433-1438. AAAI Press, 2008a. ISBN 9781577353683.
+
+Brian D. Ziebart, Andrew Maas, J. Andrew Bagnell, and Anind K. Dey. Maximum entropy inverse reinforcement learning. In Proceedings of the 23rd National Conference on Artificial Intelligence - Volume 3, AAAI'08, pp. 1433-1438. AAAI Press, 2008b. ISBN 9781577353683.
+Brian D. Ziebart, J. Andrew Bagnell, and Anind K. Dey. Modeling interaction via the principle of maximum causal entropy. In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML '10, pp. 1255-1262, Madison, WI, USA, 2010. Omnipress. ISBN 9781605589077.
+
+# Appendix
+
+# Table of Contents
+
+A Notations 18
+B Detailed Context of Related Work 18
+C Additional Motivating Examples 20
+D Gradient Evaluations for RLHF 21
+E Additional Lemmas 22
+F Proof of Theorem 1 23
+G Proof of Lemmas 26
+
+G.1 Proof of Lemma 1 26
+G.2 Proof of Lemma 3 28
+
+H Additional Supporting Lemmas 31
+
+H.1 Proof of Lipschitzness and Boundedness condition for $f_{1}(\cdot)$ defined in (74) 31
+H.2 Proof of Lipschitzness and Boundedness for $f_{3}(\cdot)$ defined in (82) 32
+H.3 Proof of Smoothness Condition on the Value function 32
+H.4 Upper-bound on the Norm of the hessian for the Bilevel RL 34
+H.5 Upper-bound on the Norm of the 2nd Order Mixed-Jacobian term for the Bilevel RL 34
+H.6 Proof of Lemma 4 35
+H.7 Proof of Lemma 2 36
+
+I Discuss of Assumption 3 and Assumption 4 37
+J Additional Experimental Details 38
+K Additional Experimental Descriptions 39
+
+# A NOTATIONS
+
+We collectively describe the notations used in this work in Table 1.
+
+Table 1:
+
+
Notations
Details
S, A
State space, action space
(s, a)
State-action pair
P(s'|s, a)
Transition kernel
rν(s, a)
Reward function parameterized by designer's parameters ν ∈ Rn
πθ(ν)(·|s)
Policy parameterized by θ(ν) ∈ Rd for design parameters ν
Vs(ν, θ(ν))
lower objective - Value function for state s at upper parameter ν and policy parameter θ(ν)
G(ν, θ*(ν))
upper objective
+
+# B DETAILED CONTEXT OF RELATED WORK
+
+Bilevel Optimization. Multi-stage optimization has a long-history in optimization and operations research, both for deterministic (Bertsimas & Caramanis, 2010) and stochastic objectives (Pflug & Pichler, 2014). In general, these problems exhibit NP-hardness if the objectives are general non-convex functions. Therefore, much work in this area restricts focus to classes of problems, such as affine (Bertsimas & Caramanis, 2010; Bertsimas et al., 2010). From both the mathematical optimization community (Bracken & McGill, 1973) and algorithmic game theory (Von Stackelberg, 2010), extensive interest has been given to specifically two-stage problems. A non-exhaustive list contains the following works (Ghadimi & Wang, 2018b; Yang et al., 2021; Khanduri et al., 2021; Li et al., 2022a; Ji & Liang, 2022; Huang et al., 2022). Predominately, one these works do not consider that either stage is a MDP, and therefore while some of the algorithmic strategies are potentially generalizable to the RL agent alignment problem, they are not directly comparable to the problem studied here.
+
+Stackleberg Games. Algorithmic methods for Sackleberg games are a distinct line of inquiry that develops methods to reach the Stackleberg equilibrium of a game, which have received significant attention in recent years. Beginning with the static Stackleberg game setting, conditions for gradient play to achieve local equilibria have been established in (Fiez et al., 2019). Follow on work studied conditions for gradient play to converge without convexity, but does not allow for MDP/trajectory dependence of objective functions at either stage (Maheshwari et al., 2023). On the other hand, the access to information structures have gradually been relaxed to allow bandit feedback (Bai et al., 2021) and linear MDPs (Zhong et al., 2021). Value iteration schemes have been proposed to achieve Stackleberg-Nash equilibria as well (Goktas et al., 2022), although it is unclear how to generalize them to handle general policy parameterization in a scalable manner. Most similar to our work are those that develop implicit function-theorem based gradient play (Fiez et al., 2020; Vu et al.); however, there are no performance certificates for these approaches.
+
+Mechanism Design. In this line of research, one studies the interrelationship between the incentives of an individual economic actor and their macro-level behavior at the level of a social welfare objective. This literature can be traced back to (Myerson, 1989; Hurwicz, 2003; Maskin, 2008), and typically poses the problem as one that does not involve sequential interactions. More recently, efforts to cast the evolution of the upper-stage which quantifies social welfare or ethnical considerations as a sequential process, i.e., an MDP, have been considered (Tang, 2017; Hu et al., 2018). In these works, agents' behavior is treated as fixed and determining of the state transition dynamics, which gives rise to a distinct subclass of policy optimization problems (Lyu et al., 2022a;b).
+
+Reinforcement Learning with Preferences. Revealed preferences is a concept in economics that states that humans in many cases do not know what they prefer until they are exposed to examples (Caplin & Dean, 2015). This idea gained traction as it provided a substantive basis for querying
+
+
+Figure 4: This figure describes the implementation flowchart of the iterative process of policy alignment in reinforcement learning. We start with some initial reward $r_0$ , learn an optimal policy $\pi_0$ for that particular reward function at instant $t = 0$ , and utility evaluates the policy to generate an updated reward function $r_1$ . Then at the next iterate $t = 1$ , we learn $\pi_1$ and so on.
+
+humans and elucidating feedback on decision-making problems with metrics whose quantification is not obvious, such as trustworthiness or fairness. In its early stages, (Wilson et al., 2012) proposed a Bayesian framework to learn a posterior distribution over the policies directly from preferences. However, (Furnkranz et al., 2012) focused on learning a cost or utility function as a supervised learning objective to maximize the likelihood of the preferences and subsequently maximize the policy under the estimated utility. An alternative and interesting line of research involves dueling bandits, which focuses on the comparison of two actions/trajectories and aims to minimize regret based on pairwise comparisons (Dudík et al., 2015; Bengs et al., 2021; Lekang & Lamperski, 2019; Pacchiano et al., 2023). (Christiano et al., 2017) was one of the first to scale deep preference-based learning for large-scale continuous control tasks by learning a reward function aligned with expert preferences. This was later improved by introducing additional demonstrations (Ibarz et al., 2018) and non-binary rankings (Cao et al., 2020). Most recent works (Lee et al., 2021; Park et al., 2022) improve the efficiency of preference-based learning for large-scale environments with off-policy learning and pre-training. However, a rigorous mathematical formulation analysis of the problem is still missing from the literature with special emphasis on the alignment objective and evaluations.
+
+Inverse Reinforcement Learning & Behavioral Cloning. Implicitly contained in the RL with preferences framework is the assumption that humans should design a reward function to drive an agent toward the correct behavior through its policy optimization process. This question of reward design has also been studied through an alternative lens in which one provides demonstrations or trajectories, and seeks to fit a reward function to represent this information succinctly. Inverse RL (IRL) is concerned with inferring the underlying reward function from a set of demonstrations by human experts. Pioneering work in IRL, notably by Ng and Russell Ng & Russell (2000), centers on the max-margin inverse reinforcement learning framework for reward function estimation. Another prominent direction by Ziebart et al. (2008b; 2010) introduced the Max Entropy IRL framework which excelled in handling noisy trajectories with imperfect behavior via adopting a probabilistic perspective for reward learning. However, a major drawback in all these prior methods was the inability to incorporate unsuccessful demonstration which was efficiently solved in Shiarlis et al. (2016) with a constraint optimization formulation, by also maximizing the between the empirical feature expectation of unsuccessful examples and the feature expectation learned from the data. Interestingly Ho et al. (2016) posed it in the min-max formulation where the objective is to maximize the optimal policy and minimize the divergence to the occupancy indicated by the current policy and expert trajectories.
+
+Later, with Deep RL methods, Finn et al. (2016); Wulfmeier et al. (2016) extended the maximum entropy deep IRL to continuous action and state spaces. Although IRL methods are effective, they still are extremely dependent on high-quality demonstrations which are expensive and might be hard to obtain for real-world sequential decision-making problems. Hence, there has been recent research on reward shaping and information-directed approaches Chakraborty et al. (2023b); Weerakoon et al. (2022); Bedi et al. (2022); Chakraborty et al. (2023a; 2022) which provides principled methods to learn under sparsity. However, such methods fail to scale in large state space robotics environments.
+
+# C ADDITIONAL MOTIVATING EXAMPLES
+
+Example 1: Energy efficient and sustainable design for robotic manipulation. Consider a robotic manipulation task where the objective of the agent is to learn an optimal policy to transport components from a fixed position to a target position $\nu := (x, y)$ . On the other hand, the designer's objective is to select the work-bench position $\nu$ to minimize the energy consumption of the robotic arm during the transportation task. Hence, it naturally boils down to the following bilevel problem as
+
+$$
+\max _ {\nu : = (x, y)} \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} \left[ \sum_ {h = 1} ^ {H _ {u}} - a _ {h} w _ {h} \mid a _ {h} \sim \pi_ {\theta^ {*} (\nu)} (\cdot | s _ {h}) \right] \tag {23}
+$$
+
+$$
+\text {s . t .} \theta^ {*} (\nu) := \arg \max _ {\theta} \mathbb {E} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} r _ {\nu} (s _ {h}, a _ {h}) \mid a _ {h} \sim \pi_ {\theta} (a _ {h} | s _ {h}), s _ {0} = s \right],
+$$
+
+where $\mathbb{E}_{\rho(\tau; \theta^{*}(\nu))}$ denotes the expectation with respect to the trajectories collected by the lower-level optimal policy $\pi_{\theta^{*}(\nu)}$ . In (23), action $a_h$ denotes the angular acceleration of the robotic arm, the state is represented by $s_h = (\alpha_h, w_h)$ , $\alpha_t$ is the discretized angle, and $w_h$ angular velocity of the robotic arm. We define the transitions as $(\alpha_{t+1}, w_{t+1}) = (\alpha_h + w_h, w_h + a_h)$ . The reward of the lower objective $r_\nu(s_h, a_h) = -\lambda_1 \| s_h - \nu \|^2 - \lambda_2 \| w_h \|^2$ , i.e., reward increases as the arm moves closer to the workbench with a controlled angular velocity. The upper objective focuses on minimizing the energy emission during transport and is thus entangled with the trajectories generated under the optimal policy obtained via the lower-level. Therefore, to see that the problem in (23) is a special case of (2), we note that the upper objective (cf. (3)) takes the special form as follows $G(\nu, \theta^{*}(\nu)) = U(\pi_{\theta^{*}(\nu)}) = \mathbb{E}_{\rho(\tau; \theta^{*}(\nu))} \left[ \sum_{h=1}^{H_u} -a_h w_h \mid a_h \sim \pi_{\theta^{*}(\nu)}(\cdot | s_h) \right]$ , where $Z(\nu) = 0$ for this example.
+
+Example 2: Social welfare aligned tax design for households. Consider the problem of tax design for individual households while remaining attuned to social welfare, motivated by (Hill et al., 2021). From the household's perspective, each household seeks to maximize its own utility $u_{h}$ based on the number of working hours, consumption of goods, and net worth. Let us denote the accumulated asset as state $s_{h}$ . At each time step $h$ , the household agent selects an action $a_{h} = (n_{h}, c_{i,h})$ , $a_{h} \sim \pi_{\theta}(a_{h}|s_{h})$ , where $n_{h}$ is the number of hours worked, and $c_{i,h}$ is the consumption of good $i$ at a pre-tax price of $p_{i}$ , and $\theta$ denotes the policy parameter. We denote $f(s_{h})$ as the reward for the accumulative asset $s_{h}$ , updated at each time step by $s_{h+1} = s_{h} + (1 - x)wn_{h} - \sum_{i=1}^{M}c_{i,h}$ and $\nu = (x,y_{i})$ is the income tax rate and consumption tax rate for good $i$ . Here we note that $x$ is a uniform tax across all households, whereas $y_{i}$ is a household-specific tax rate. Then the household agent's utility at time step $h$ is given by the equation $u_{h} = f(s_{h}) - \gamma n_{h}^{2} + \prod_{i=1}^{M}\left(\frac{c_{i,h}}{p_{i}(1+y_{i})}\right)^{\nu_{i}}$ , where the product term corresponds to Cobb-Douglas function (Roth et al., 2016). In contrast, the objective of the regulatory body or government (upper-level) is to maximize the social welfare $v_{t}$ by adjusting the tax rates $\nu$ based on the optimal policy of the household agent (lower level). Hence, the upper objective representing the social welfare is defined as $v_{h} = g(s_{h}) + \sum_{i=1}^{M}\frac{c_{i,h}}{1+y_{i}} + \psi\ln\left(\frac{\prod_{i=1}^{M}c_{i,t}y_{i}}{\prod_{i=1}^{M}(1+y_{i})} +wx_{n}h\right)$ , where $g(\cdot)$ is the reward for the accumulative asset, $\psi$ is a positive constant, and $w$ is the wage rate. The household agent follows a policy that maximizes its discounted cumulative reward, while the social planner aims to maximize the discounted total social welfare by tuning the tax rates $x$ and $y_{i}$ .
+
+Thus, the bilevel formulation is given by
+
+$$
+\max _ {\nu} \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} \left[ \sum_ {h = 0} ^ {H _ {u} - 1} v _ {\nu} \left(s _ {h}, a _ {h}\right) \right] \tag {24}
+$$
+
+$$
+\mathrm {s . t .} \theta^ {*} (\nu) := \arg \max _ {\theta} \mathbb {E} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} u _ {\nu} (s _ {h}, a _ {h}) | a _ {h} \sim \pi_ {\theta} (a _ {h} | s _ {h}), s _ {0} = s \right],
+$$
+
+where $\gamma$ is the discount rate, and $\theta^{*}(\nu)$ represents the optimal lower policy of the household agent, which maximizes its expected cumulative return over a time horizon $H_{\ell}$ .
+
+Example 3: Cost-effective robot navigation with Human feedback. Consider an $N \times N$ maze-world environment where the robot needs to navigate from a start state $s$ to a goal state $g$ . The maze is represented by a grid with discrete positions $(i, j)$ , and the robot can take four actions $\{\uparrow, \downarrow, \leftarrow, \rightarrow\}$ . The agent receives a reward $R_g(\tau)$ on reaching the goal and the objective of the agent is to learn the optimal policy $\pi_{\theta^*}$ for goal reaching. The designer on the other hand, bears an additional cost of moving the goal position from the terminal state $(N - 1, N - 1)$ and hence need to optimize for a general utility metric considering both the objectives and can be formulated as the bilevel optimization as
+
+$$
+\max _ {g} - \lambda_ {1} \| g - (N - 1, N - 1) \| _ {2} + \lambda_ {2} \mathbb {E} _ {\pi_ {\theta^ {*} (\nu)}} [ R _ {g} (\tau) ] \tag {25}
+$$
+
+$$
+\text {s . t .} \theta^ {*} (g) := \arg \max _ {\theta} \mathbb {E} \left[ \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h} r _ {g} \left(s _ {h}, a _ {h}\right) \mid a _ {h} \sim \pi_ {\theta} \left(a _ {h} \mid s _ {h}\right), s _ {0} = s \right],
+$$
+
+where the reward function is characterized by the goal state $g$ . The upper objective deals with finding a suitable position of the goal state that can optimize the sustainability metric and the lower objective deals with optimal policy and reward achieved under the same.
+
+# D GRADIENT EVALUATIONS FOR RLHF
+
+In this section, we demonstrate how our A-PARL algorithm is applicable to the Reinforcement Learning from Human preferences paradigm. We begin by writing the gradient of the upper-level preference objective in equation (7) as
+
+$$
+\begin{array}{l} \nabla_ {\nu} G \left(\nu , \theta^ {*} (\nu)\right) = \nabla_ {\nu} \mathbb {E} \left[ y \log P _ {\nu} \left(\tau_ {0} > \tau_ {1}\right) + (1 - y) \log P _ {\nu} \left(\tau_ {0} < \tau_ {1}\right) \right] \tag {26} \\ = \nabla_ {\nu} \mathbb {E} [ f _ {\nu} (\tau_ {0}, \tau_ {1}, y) ] \\ = \nabla_ {\nu} \sum_ {\tilde {\tau}} f _ {\nu} (\tau_ {0}, \tau_ {1}, y) \cdot \rho (y, \tau_ {0}, \tau_ {1}; \theta^ {*} (\nu)) \\ \end{array}
+$$
+
+where, let's denote $f_{\nu}(\tau_0,\tau_1,y) = y\log P_{\nu}(\tau_0 > \tau_1) + (1 - y)\log P_{\nu}(\tau_0 < \tau_1)$ for simplicity of notation and as stated before $\widetilde{\tau} = (\tau_0,\tau_1,y)$ . Now expanding upon the gradient in equation (30), we have
+
+$$
+\nabla_ {\nu} G (\nu , \theta^ {*} (\nu)) = \mathbb {E} [ \nabla_ {\nu} [ f _ {\nu} (\tau_ {0}, \tau_ {1}, y) ] ] + \sum_ {\tau^ {\prime}} f _ {\nu} (\tau_ {0}, \tau_ {1}, y) \cdot \nabla_ {\nu} \rho (y, \tau_ {0}, \tau_ {1}, \theta^ {*} (\nu)) \tag {27}
+$$
+
+where, we use the chain-rule and replace summation with expectation to get the equation (27).
+
+$$
+\begin{array}{l} \nabla_ {\nu} G (\nu , \theta^ {*} (\nu)) = \mathbb {E} [ \nabla_ {\nu} [ f (\tau_ {0}, \tau_ {1}, y, \nu) ] ] + \sum_ {\tilde {\tau}} f (\tau_ {0}, \tau_ {1}, y, \nu) \cdot \nabla_ {\nu} \rho (y, \tau_ {0}, \tau_ {1}; \theta^ {*} (\nu)) \tag {28} \\ = \underbrace {\mathbb {E} \left[ \nabla_ {\nu} \left[ f \left(\tau_ {0} , \tau_ {1} , y , \nu\right) \right] \right]} _ {\text {T e r m 1}} + \underbrace {\mathbb {E} \left[ f \left(\tau_ {0} , \tau_ {1} , y , \nu\right) \cdot \nabla_ {\nu} \log \rho \left(y , \tau_ {0} , \tau_ {1} ; \theta^ {*} (\nu)\right) \right]} _ {\text {T e r m 2}} \\ \end{array}
+$$
+
+where, we divide and multiply the second term by the $\rho (y,\tau_0,\tau_1;\theta^* (\nu))$ to get the log gradient term inside expectation. Now, to compute the expression, we first compute the gradient of $f(\tau_0,\tau_1,y,\nu)$ . From the definition in equation (6), we know that
+
+$$
+P _ {\nu} \left(\tau_ {0} > \tau_ {1}\right) = \frac {\exp R _ {\nu} \left(\tau_ {0}\right)}{\exp R _ {\nu} \left(\tau_ {0}\right) + \exp R _ {\nu} \left(\tau_ {1}\right)} \tag {29}
+$$
+
+$$
+\log P _ {\nu} \left(\tau_ {0} > \tau_ {1}\right) = R _ {\nu} \left(\tau_ {0}\right) - \log \left(\exp R _ {\nu} \left(\tau_ {0}\right) + \exp R _ {\nu} \left(\tau_ {1}\right)\right)
+$$
+
+$$
+\log P _ {\nu} \left(\tau_ {1} > \tau_ {0}\right) = R _ {\nu} \left(\tau_ {1}\right) - \log \left(\exp R _ {\nu} \left(\tau_ {0}\right) + \exp R _ {\nu} \left(\tau_ {1}\right)\right)
+$$
+
+Now, with the above equation, the expression of Term 1 in equation (28) can be expanded as
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \nabla_ {\nu} f \left(\tau_ {0}, \tau_ {1}, y, \nu\right) \right] = \mathbb {E} \left[ y \nabla_ {\nu} \log P _ {\nu} \left(\tau_ {0} > \tau_ {1}\right) + (1 - y) \nabla_ {\nu} \log P _ {\nu} \left(\tau_ {0} < \tau_ {1}\right) \right] \tag {30} \\ = \mathbb {E} [ y \nabla_ {\nu} R _ {\nu} (\tau_ {0}) + (1 - y) R _ {\nu} (\tau_ {1}) - \frac {\nabla_ {\nu} R _ {\nu} (\tau_ {0}) \exp R _ {\nu} (\tau_ {0}) + \nabla_ {\nu} R _ {\nu} (\tau_ {1}) \exp R _ {\nu} (\tau_ {1})}{\exp R _ {\nu} (\tau_ {0}) + \exp R _ {\nu} (\tau_ {1})} ] \\ = \mathbb {E} [ y \nabla_ {\nu} R _ {\nu} (\tau_ {0}) + (1 - y) R _ {\nu} (\tau_ {1}) - \nabla_ {\nu} R _ {\nu} (\tau_ {0}) P _ {\nu} (\tau_ {0} > \tau_ {1}) - \nabla_ {\nu} R _ {\nu} (\tau_ {1}) P _ {\nu} (\tau_ {1} > \tau_ {0}) ] \\ \end{array}
+$$
+
+Note that this term can be easily estimated under any differentiable parametrization of the reward function $R_{\nu}$ . Next, we move to term 2, where the trajectories $\tau_0, \tau_1$ are drawn from the distribution $\rho(\tau; \theta^*(\nu))$ parametrized by the policy $\pi(\theta^*(\nu))$ . The Term 2 from equation (28) can be written as:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ f _ {\nu} \left(\tau_ {0}, \tau_ {1}, y\right) \cdot \nabla_ {\nu} \log \rho \left(y, \tau_ {0}, \tau_ {1}; \theta^ {*} (\nu)\right) \right] \tag {31} \\ = \mathbb {E} \left[ f _ {\nu} \left(\tau_ {0}, \tau_ {1}, y\right) \cdot \nabla_ {\nu} \log \left(h (y | \tau_ {0}, \tau_ {1}) \rho \left(\tau_ {0}; \theta^ {*} (\nu)\right) \rho \left(\tau_ {1}; \theta^ {*} (\nu)\right)\right) \right] \\ = \mathbb {E} \left[ f _ {\nu} \left(\tau_ {0}, \tau_ {1}, y\right) \cdot \left(\nabla_ {\nu} \log \rho \left(\tau_ {0}; \theta^ {*} (\nu)\right) + \nabla_ {\nu} \log \rho \left(\tau_ {1}; \theta^ {*} (\nu)\right)\right) \right] \\ \end{array}
+$$
+
+Now, the term $\nabla_{\nu}\log \rho (\tau_1,\theta^* (\nu))$ can be expressed as exactly done in equation (8)
+
+$$
+\nabla_ {\nu} \log \rho \left(\tau_ {1}; \theta^ {*} (\nu)\right) = \sum_ {t} \nabla_ {\nu} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {t} \mid s _ {t}\right) \tag {32}
+$$
+
+Now, exactly following the similar steps as done from equation (33) to equation (36) we can rewrite the gradient in the context of Bilevel RLHF as
+
+$$
+\nabla_ {\nu} f _ {h} \left(\theta^ {*} (\nu)\right) = \nabla_ {\nu} \theta^ {*} (\nu) ^ {T} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right). \tag {33}
+$$
+
+From the first order optimality condition for the lower level objective, it holds that
+
+$$
+\nabla_ {\theta} V _ {s} (\nu , \theta^ {*} (\nu)) = 0, \tag {34}
+$$
+
+which is the gradient of lower-level objective with respect to parameter $\theta$ evaluated at the optimal $\theta^{*}(\nu)$ . Now, differentiating again with respect to $\nu$ on both sides of (34), we obtain
+
+$$
+\nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) + \nabla_ {\nu} \theta^ {*} (\nu) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) = 0. \tag {35}
+$$
+
+The above expression would imply that we can write the final expression for the gradient in (33) as
+
+$$
+\nabla_ {\nu} f _ {h} \left(\theta^ {*} (\nu)\right) = - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right). \tag {36}
+$$
+
+Now, replacing this in Term 2 we will get the final expression. It is important to note that it requires the same gradient computations as shown in Section 4 for our generalized policy alignment algorithm.
+
+# E ADDITIONAL LEMMAS
+
+Lemma 3 (Value function related upper bounds). Under Assumptions 1 - 4, it holds that
+
+(i) The second order Jacobian term $\nabla_{\nu,\theta}^2 V_s(\nu_t, \theta^K(\nu_t))$ is bounded as $\| \nabla_{\nu,\theta}^2 V_s(\nu_t, \theta^K(\nu_t)) \| \leq H_\ell^2 L_r B$ , where $H_\ell$ is the horizon length for the lower level [cf. (2)], $L_r$ is the reward Lipschitz parameter [cf. Assumption 2], and $B$ is the score function bound [cf. Assumption 3].
+
+(ii) The Hessian of the value function is Lipschitz with parameter as
+
+$$
+\left\| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \right\| \leq L ^ {\prime} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {37}
+$$
+
+where, $L' = L_{f_1} \chi_1 \frac{H_\ell}{2} L_2 + L_{f_1}$ and $L_{f_1} = L_2 H_\ell^2 R$ . Here, $H_\ell$ is the horizon length at the lower level, $\chi_1$ is a constant defined in (77), $R$ is the maximum reward (cf. Assumption 2), and $L_2$ is the Lipschitz parameter of the Hessian of the policy defined in Assumption 3.
+
+(iii) The second order mixed jacobian term $\nabla_{\nu ,\theta}^2 V_s(\nu ,\theta^K (\nu))$ is Lipschitz continuous w.r.t $\theta$ i.e
+
+$$
+\left\| \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu_ {t})\right) - \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} (\nu)\right) \right\| \leq L ^ {\prime \prime} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \tag {38}
+$$
+
+where, $L'' = L_{f_3} \chi_2 \frac{H_\ell}{2} L_2 + L_{f_3}$ and $L_{f_3} = L_r L_1 H_\ell^2$ . Here, $\chi_2$ is a constant defined in equation (85), and other constants are as defined in statement (ii).
+
+The proof of Lemma 3 is in Appendix G.2. To prove this result, we start by considering the value function expression, and evaluating it's gradient, Hessian, and Jacobians. After expanding each of them, we separate the reward and policy-related terms and then utilize the aforementioned assumptions to upper bound them, respectively.
+
+Lemma 4. Let us define the update direction associated with the gradient in (13) as
+
+$$
+\phi_ {1} (\tau) := U (\tau) \cdot \sum_ {t = 0} ^ {H _ {u}} \left[ - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right) \right], \tag {39}
+$$
+
+$$
+a n d \phi_ {2} (\tau) := U (\tau) \cdot \sum_ {t = 0} ^ {H _ {u}} \left[ - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\nu , \theta^ {K} (\nu)\right) \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {K} (\nu)\right) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) \right]. \tag {40}
+$$
+
+Under Assumptions 1 - 4, it holds that
+
+$$
+\left\| \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} \left[ \phi_ {1} (\tau) - \phi_ {2} (\tau) \right] \right\| \leq H _ {u} ^ {2} \tilde {u} \gamma_ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {41}
+$$
+
+where $\gamma_{1} := \kappa L_{1} + \frac{L_{\nu,\theta}L^{\prime}}{l_{\pi}^{2}} + \frac{L^{\prime\prime}}{l_{\pi}}$ . Here, $\tilde{u}$ is the upper bound of utility $U(\tau)$ defined in (4), $l_{\pi}, L_{1}$ are policy-related Lipschitz parameters (cf. Assumption 3), $L^{\prime}$ and $L^{\prime\prime}$ as defined in Lemma 3, and $\kappa$ mixed condition number defined in equation (109) and $L_{\nu,\theta}$ upper-bound of the norm of second order mixed jacobian term, defined in equation (107)
+
+The proof of Lemma 4 is in Appendix H.6.
+
+# F PROOF OF THEOREM 1
+
+Without loss of generality, for the analysis, we consider the algorithm updates as if we are minimizing at the upper and lower level both.
+
+Proof. We begin by the smoothness assumption in the upper-level objective (cf. Assumption 18), which implies that
+
+$$
+G \left[ \nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right) \right] \leq G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) + \left\langle \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right), \nu_ {t + 1} - \nu_ {t} \right\rangle + \frac {L _ {g}}{2} \| \nu_ {t + 1} - \nu_ {t} \| ^ {2}. \tag {42}
+$$
+
+From the update of upper parameter $\nu_{t + 1}$ (cf. (14)), we holds that
+
+$$
+\begin{array}{l} G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) \leq G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) + \left\langle \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right), - \alpha_ {u} \widetilde {\nabla} _ {\nu} G \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) \right\rangle \tag {43} \\ + \frac {L _ {g} \alpha_ {u} ^ {2}}{2} \| \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) \| ^ {2}. \\ \end{array}
+$$
+
+We add subtract the original gradient $\nabla_{\nu}G(\nu_t,\theta^* (\nu_t))$ [cf. (13)] in (43) as follows
+
+$$
+\begin{array}{l} G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) \leq G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) + \left\langle \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right), - \alpha_ {u} \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \right\rangle (44) \\ + \alpha_ {u} \langle \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})), \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) - \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) \rangle \\ + \frac {L _ {g} \alpha_ {u} ^ {2}}{2} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) + \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) - \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \| ^ {2} \\ = G \left(\nu_ {t}, \theta^ {*} (\nu_ {t})\right) - \alpha_ {u} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} (\nu_ {t})\right) \| ^ {2} (45) \\ + \alpha_ {u} \langle \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})), \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) - \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) \rangle \\ + \frac {L _ {g} \alpha_ {u} ^ {2}}{2} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) + \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) - \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \| ^ {2}. \\ \end{array}
+$$
+
+Using Peter-Paul inequality for the third term on the right hand side of (45), we get
+
+$$
+\begin{array}{l} G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) \leq G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) - \alpha_ {u} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} + \frac {\alpha_ {u}}{2 c _ {1}} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} \tag {46} \\ + \frac {\alpha_ {u} c _ {1}}{2} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) - \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) \| ^ {2} \\ + \frac {L _ {g} \alpha_ {u} ^ {2}}{2} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) + \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) - \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \| ^ {2}. \\ \end{array}
+$$
+
+where $c_{1} \geq 0$ . Next, after grouping the terms, we get
+
+$$
+\begin{array}{l} G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) \leq G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) - \alpha_ {u} \left(1 - \frac {1}{2 c _ {1}}\right) \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} \\ + \frac {\alpha_ {u} c _ {1}}{2} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) - \widetilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) \| ^ {2} \\ + L _ {g} \alpha_ {u} ^ {2} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \| ^ {2} + L _ {g} \alpha_ {u} ^ {2} \| \tilde {\nabla} _ {\nu} G (\nu_ {t}, \theta^ {K} (\nu_ {t})) - \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \| ^ {2} \\ = G \left(\nu_ {t}, \theta^ {*} (\nu_ {t})\right) - \alpha_ {u} \left(1 - \frac {1}{2 c _ {1}} - L _ {g} \alpha_ {u}\right) \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} (\nu_ {t})\right) \| ^ {2} \\ + \alpha_ {u} \left(\frac {c _ {1}}{2} + L _ {g} \alpha_ {u}\right) \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) - \widetilde {\nabla} _ {\nu} G \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) \| ^ {2}, \tag {47} \\ \end{array}
+$$
+
+where we use the inequality $\| a + b\| ^2\leq 2\| a\| ^2 +2\| b\| ^2$ , followed by algebraic operations to get the final expression of equation (47). Next, we analyze the term $\| \nabla_{\nu}G(\nu_{t},\theta^{*}(\nu_{t})) - \widetilde{\nabla}_{\nu}G(\nu_{t},\theta^{K}(\nu_{t}))\|^{2}$ from equation (47). It is important to note that the dependency of the lower optimal variable on the sampling distribution of the upper objective is novel compared to the standard class of stochastic bilevel problems and requires a novel analysis which we emphasize in the subsequent sections. Let us start by considering the explicit expressions of $\nabla_{\nu}G(\nu ,\theta^{*}(\nu))$ and $\widetilde{\nabla}_{\nu}G(\nu_{t},\theta^{K}(\nu_{t}))$ in equations (13) and (14) as
+
+$$
+\nabla_ {\nu} G (\nu , \theta^ {*} (\nu)) - \widetilde {\nabla} _ {\nu} G (\nu , \theta^ {K} (\nu)) = \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {*} (\nu))} [ \phi_ {1} (\tau) ] - \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {2} (\tau) ], \tag {48}
+$$
+
+where we define
+
+$$
+\phi_ {1} (\tau) = U _ {\nu} (\tau) \cdot \sum_ {t = 0} ^ {H _ {u}} \left[ - \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right) \right] + \nabla_ {\nu} U _ {\nu} (\tau), \tag {49}
+$$
+
+$$
+\text {a n d} \phi_ {2} (\tau) = U _ {\nu} (\tau) \cdot \sum_ {t = 0} ^ {H _ {u}} \left[ - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\nu , \theta^ {K} (\nu)\right) \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {K} (\nu)\right) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) \right] + \nabla_ {\nu} U _ {\nu} (\tau). \tag {50}
+$$
+
+Now, we expand the terms in (48) by adding subtracting the term $\mathbb{E}_{\tau \sim \rho (\tau ;\theta^K (\nu))}[\phi_1(\tau)]$ in the right hand side as follows
+
+$$
+\begin{array}{l} \nabla_ {\nu} G (\nu , \theta^ {*} (\nu)) - \tilde {\nabla} _ {\nu} G (\nu , \theta^ {K} (\nu)) = \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {*} (\nu))} [ \phi_ {1} (\tau) ] - \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) ] (51) \\ + \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) ] - \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {2} (\tau) ] \\ = \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {*} (\nu))} [ \phi_ {1} (\tau) ] - \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) ] \\ + \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) - \phi_ {2} (\tau) ]. (52) \\ \end{array}
+$$
+
+This is an extremely critical point of departure from existing bilevel algorithms where we characterize the complexity in the sampling distribution (mentioned above) by breaking into 2 parts and introducing a notion of probabilistic divergence in the analysis. We note that the first term on the right-hand side of (52) can be written as:
+
+$$
+\mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {*} (\nu))} [ \phi_ {1} (\tau) ] - \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) ] \leq \sup _ {\phi \in \mathcal {F}} \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {*} (\nu))} [ \phi_ {1} (\tau) ] - \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) ] \tag {53}
+$$
+
+This boils down to the standard definition of Integral Probability Metric(IPM) which, under suitable assumption on the function class $\mathcal{F}$ can generalize various popular distance measures in probability theory for ex : Total variation, Wasserstein, Dudley metric etc. For a more detailed discussion on the connection to f-divergence and IPM, refer to (Sriperumbudur et al., 2009). Specifically, for our analysis, we will be dealing primarily with a subclass of f-divergences that satisfy the triangle inequality as $D_{f}(p,q)\leq D_{f}(p,r) + D_{f}(r,q)$ which includes divergences such as Total variation or Hellinger distances. Specifically, we show that under certain boundedness conditions on the function class $\phi \in \mathcal{F}:\| \phi \| \leq \zeta$ , we can upper-bound the divergence which is a critical and interesting point of our analysis. Interestingly for the Reinforcement learning problem under study, $\phi$ satisfies such a boundedness condition which we prove in sections. Thus we were able to utilize the special structure in RL to solve this special type of Bilevel problems.
+
+On the other-hand, the second term on the right-hand side of (52) is an expected difference between the two functions. Hence, we can write (52) as
+
+$$
+\begin{array}{l} \nabla_ {\nu} G (\nu , \theta^ {*} (\nu)) - \widetilde {\nabla} _ {\nu} G (\nu , \theta^ {K} (\nu)) = D _ {f} \left(\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \theta^ {K} (\nu))\right) \\ + \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} [ \phi_ {1} (\tau) - \phi_ {2} (\tau) ], \tag {54} \\ \end{array}
+$$
+
+where $D_{f}$ denotes the f-divergence between two distributions. Taking the norm on both sides and from the statements of Lemma 1 and Lemma 4, we can write
+
+$$
+\left\| \nabla_ {\nu} G \left(\nu , \theta^ {*} (\nu)\right) - \widetilde {\nabla} _ {\nu} G \left(\nu , \theta^ {K} (\nu)\right) \right\| ^ {2} \leq \left(\frac {H _ {u} ^ {2} L _ {2} ^ {2}}{2} + 2 H _ {u} ^ {4} \tilde {u} ^ {2} \gamma_ {1} ^ {2}\right) \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| ^ {2}. \tag {55}
+$$
+
+Utilizing this bound in (47), we get
+
+$$
+\begin{array}{l} G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) - G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \\ \leq - \alpha_ {u} \left(1 - \frac {1}{2 c _ {1}} - L _ {g} \alpha_ {u}\right) \left\| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \right\| ^ {2} \\ + \alpha_ {u} \left(\frac {c _ {1}}{2} + L _ {g} \alpha_ {u}\right) \left(\frac {H _ {u} ^ {2} L _ {2} ^ {2}}{2} + 2 H _ {u} ^ {4} \tilde {u} ^ {2} \gamma_ {1} ^ {2}\right) \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| ^ {2}, \tag {56} \\ \end{array}
+$$
+
+where we write the final expression for the convergence analysis from equation (47) and for simplicity of notations, let's assume $\delta_1 = \alpha_u\left(1 - \frac{1}{2c_1} - L_g\alpha_u\right)$ and $\delta_2 = \alpha_u\left(\frac{c_1}{2} + L_g\alpha_u\right)\left(\frac{H_u^2L_2^2}{2} + 2H_u^4\tilde{u}^2\gamma_1^2\right)$ , which leads to the simplified version of the equation (56)
+
+$$
+G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) - G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \leq - \delta_ {1} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} + \delta_ {2} \| \theta^ {*} \left(\nu_ {t}\right) - \theta^ {K} \left(\nu_ {t}\right) \| ^ {2}. \tag {57}
+$$
+
+From the statement of Lemma 2, we can upper bound the above expression as
+
+$$
+G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) - G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \leq - \delta_ {1} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} + \delta_ {2} \frac {\eta^ {K} L _ {6}}{\mu} Z, \tag {58}
+$$
+
+where we know $\eta \in (0,1)$ . Next, we select $K = t + 1$ to obtain
+
+$$
+G \left(\nu_ {t + 1}, \theta^ {*} \left(\nu_ {t + 1}\right)\right) - G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \leq - \delta_ {1} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} + \delta_ {2} \frac {\eta^ {t + 1} L _ {6}}{\mu} Z. \tag {59}
+$$
+
+Taking the summation over $t = 0$ to $T - 1$ on both sides, we get
+
+$$
+G \left( \right.\nu_ {T}, \theta^ {*} \left(\nu_ {T}\right) - G \left(\nu_ {0}, \theta^ {*} \left(\nu_ {0}\right)\right) \leq - \delta_ {1} \sum_ {t = 0} ^ {T - 1} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} + \frac {\delta_ {2} L _ {6} Z}{\mu} \sum_ {t = 0} ^ {T - 1} \eta^ {t + 1} \tag {60}
+$$
+
+After rearranging the terms, we get
+
+$$
+\begin{array}{l} \sum_ {t = 0} ^ {T - 1} \| \nabla_ {\nu} G (\nu_ {t}, \theta^ {*} (\nu_ {t})) \| ^ {2} \leq \frac {G (\nu_ {0} , \theta^ {*} (\nu_ {0})) - G (\nu_ {T} , \theta^ {*} (\nu_ {T})}{\delta_ {1}} + \frac {\eta \delta_ {2} L _ {6} Z}{\delta_ {1} \mu} \sum_ {t = 0} ^ {T - 1} \eta^ {t} \\ \leq \frac {G \left(\nu_ {0} , \theta^ {*} \left(\nu_ {0}\right)\right) - G \left(\nu_ {T} , \theta^ {*} \left(\nu_ {T}\right) \right.}{\delta_ {1}} + \frac {\eta \delta_ {2} L _ {6} Z}{\delta_ {1} \mu (1 - \eta)}. \tag {61} \\ \end{array}
+$$
+
+Let us denote $G_0 \coloneqq G(\nu_0, \theta^*(\nu_0))$ and upper bound $-G(\nu_T, \theta^*(\nu_T)) \leq -G^*$ where $G^*$ denotes the global optimal value of the upper objective. After dividing both sides in (61) by $T$ , we get
+
+$$
+\frac {1}{T} \sum_ {t = 0} ^ {T - 1} \| \nabla_ {\nu} G \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \| ^ {2} \leq \frac {G _ {0} - G ^ {*}}{\delta_ {1} T} + \frac {\eta \delta_ {2} L _ {6} Z}{T \delta_ {1} \mu (1 - \eta)}. \tag {62}
+$$
+
+
+
+# G PROOF OF LEMMAS
+
+# G.1 PROOF OF LEMMA 1
+
+Proof. The probability distribution of the trajectory $\tau = \{s_h, a_h\}_{h=1}^H$ is given by (as defined after the equation (3) in main body)
+
+$$
+\rho (\tau ; \theta^ {*} (\nu)) = \rho (s _ {0}) \prod_ {h = 1} ^ {H} \pi_ {\theta^ {*} (\nu)} \left(a _ {h} \mid s _ {h}\right) P \left(s _ {h + 1} \mid s _ {h}, a _ {h}\right). \tag {63}
+$$
+
+Similarly, we can derive an equivalent expression for the probability of trajectory induced by the policy $\pi_{\theta^{K}(\nu)}$ by replacing $\theta^{*}(\nu)$ with $\theta^{K}(\nu)$ . Here, $P(s_{h+1}|s_h,a_h)$ is the transition probability which remains the same for both and $\rho(s_0)$ is the initial state distribution. Next, the f-divergence between the two distributions $D_f(\rho(\tau;\theta^{*}(\nu)),\rho(\tau;\theta^{K}(\nu)))$ can be written as
+
+$$
+D _ {f} \left(\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \theta^ {K} (\nu))\right) \leq \underbrace {D _ {f} \left(\rho (\tau ; \theta^ {*} (\nu)) , \rho (\tau ; \beta)\right)} _ {I} + \underbrace {D _ {f} \left(\rho (\tau ; \beta) , \rho (\tau ; \theta^ {K} (\nu))\right)} _ {I I}, \tag {64}
+$$
+
+which holds by triangle inequality of the class of f-divergences we considered as discussed above. $\rho (\tau ;\beta)$ represents the trajectory probability induced by another hybrid policy $\pi_{\beta}(\cdot |s)$ which executes the action based on the policy $\pi_{\theta^K (\nu)}(\cdot |s)$ for the first time-step and then follows the policy $\pi_{\theta^{*}(\nu)}(\cdot |s)$ for subsequent timesteps. Now, we focus on term I in (64), we get
+
+$$
+\begin{array}{l} D _ {f} (\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \beta)) \\ = \sum_ {\tau} \rho (\tau ; \beta) f \left(\frac {\rho (\tau ; \theta^ {*} (\nu))}{\rho (\tau ; \beta)}\right) \tag {65} \\ = \sum_ {\tau} \rho (\tau ; \beta)) f \left(\frac {\rho (s _ {0}) \pi_ {\theta^ {*} (\nu)} (a _ {0} | s _ {0}) P (s _ {1} | s _ {0} , a _ {0}) \prod_ {h = 1} ^ {H} \pi_ {\theta^ {*} (\nu)} (a _ {h} | s _ {h}) P (s _ {h + 1} | s _ {h} , a _ {h})}{\rho (s _ {0}) \pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0}) P (s _ {1} | s _ {0} , a _ {0}) \prod_ {h = 1} ^ {H} \pi_ {\theta^ {*} (\nu)} (a _ {h} | s _ {h}) P (s _ {h + 1} | s _ {h} , a _ {h})}\right) \\ = \sum_ {\tau} \rho (\tau ; \beta)) f \left(\frac {\pi_ {\theta^ {*} (\nu)} (a _ {0} | s _ {0})}{\pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0})}\right), \\ \end{array}
+$$
+
+where first we expand upon the definition of the trajectory distribution induced by both policies and get the final expression of the equation (65). By expanding the term $\rho (\tau ;\beta)$ in (65), we obtain
+
+$$
+\begin{array}{l} D _ {f} (\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \beta)) = \sum_ {s _ {0}} \rho (s _ {0}) \sum_ {a _ {0}} \pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0}) f \left(\frac {\pi_ {\theta^ {*} (\nu)} (a _ {0} | s _ {0})}{\pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0})}\right) \sum_ {s _ {1}} P (s _ {1} | s _ {0}, a _ {0}) \dots \\ = \sum_ {s} \rho (s) \sum_ {a} \pi_ {\theta^ {K} (\nu)} (a | s) f \left(\frac {\pi_ {\theta^ {*} (\nu)} (a | s)}{\pi_ {\theta^ {K} (\nu)} (a | s)}\right) \\ = \mathbb {E} _ {\rho (s)} \sum_ {a} \pi_ {\theta^ {K} (\nu)} (a | s) f \left(\frac {\pi_ {\theta^ {*} (\nu)} (a | s)}{\pi_ {\theta^ {K} (\nu)} (a | s)}\right) \\ = \mathbb {E} _ {\rho (s)} \left[ D _ {f} \left(\pi_ {\theta^ {*} (\nu)} (a | s), \pi_ {\theta^ {K} (\nu)} (a | s)\right) \right], \tag {66} \\ \end{array}
+$$
+
+where, in the first equation we expand upon the sum over all trajectories with the occupancy distribution over states and actions, and replacing with f-divergence, we get the final expression.
+
+Next, we expand similarly for the term II in (64) and expand as
+
+$$
+\begin{array}{l} D _ {f} (\rho (\tau ; \beta), \rho (\tau ; \theta^ {K} (\nu))) \\ = \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu))) f \left(\frac {\rho (\tau ; \beta)}{\rho (\tau ; \theta^ {K} (\nu))}\right) \\ = \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu))) f \left(\frac {\rho (s _ {0}) \pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0}) P (s _ {1} | s _ {0} , a _ {0}) \prod_ {h = 1} ^ {H} \pi_ {\theta^ {*} (\nu)} (a _ {h} | s _ {h}) P (s _ {h + 1} | s _ {h} , a _ {h})}{\rho_ {0} (s _ {0}) \pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0}) P (s _ {1} | s _ {0} , a _ {0}) \prod_ {h = 1} ^ {H} \pi_ {\theta^ {K} (\nu)} (a _ {h} | s _ {h}) P (s _ {h + 1} | s _ {h} , a _ {h})}\right) \\ = \sum_ {s _ {0}} \rho (s _ {0}) \sum_ {a _ {1}} \pi_ {\theta^ {K} (\nu)} (a _ {0} | s _ {0}) \sum_ {s _ {1}} P (s _ {1} | s _ {0}, a _ {0}) \dots f \left(\frac {\prod_ {h = 1} ^ {H} \pi_ {\theta^ {*} (\nu)} (a _ {h} | s _ {h}) P (s _ {h + 1} | s _ {h} , a _ {h})}{\prod_ {h = 1} ^ {H} \pi_ {\theta^ {K} (\nu)} (a _ {h} | s _ {h}) P (s _ {h + 1} | s _ {h} , a _ {h})}\right) \\ = \sum_ {s _ {0}} \rho (s _ {0}) \sum_ {a _ {1}} \pi_ {\theta^ {K} (\nu)} (a _ {1} | s _ {0}) \sum_ {\tau_ {1}} \rho (\tau_ {1}; \theta^ {K} (\nu), \frac {\rho (\tau_ {1} ; \theta^ {*} (\nu)}{\rho (\tau_ {1} ; \theta^ {K} (\nu))} \\ = \sum_ {s _ {0}} \rho (s _ {0}) \sum_ {a _ {1}} \pi_ {\theta^ {K} (\nu)} \left(a _ {1} \mid s _ {0}\right) D _ {f} \left(\rho \left(\tau_ {1}; \theta^ {*} (\nu), \rho \left(\tau_ {1}; \theta^ {K} (\nu)\right), \right. \right. \tag {67} \\ \end{array}
+$$
+
+where we expand the trajectory distribution induced by the policies and subsequently express as the ratio of the probability of trajectories wrt $\tau_{1}$ , we get the final expression. Now, we expand upon the f-divergence of the trajectory $\tau_{1}$ distribution as
+
+$$
+\begin{array}{l} D _ {f} \left(\rho (\tau ; \beta), \rho (\tau ; \theta^ {K} (\nu))\right) = \sum_ {s _ {0}} \rho (s _ {0}) \sum_ {a _ {1}} \pi_ {\theta^ {K} (\nu)} \left(a _ {1} \mid s _ {0}\right) D _ {f} \left(\rho \left(\tau_ {1}; \theta^ {*} (\nu), \rho \left(\tau_ {1}; \theta^ {K} (\nu)\right) \right. \right. \tag {68} \\ \leq \sum_ {s _ {0}} \rho (s _ {0}) \sum_ {a _ {1}} \pi_ {\theta^ {\kappa} (\nu)} (a _ {1} | s _ {0}) \Big (D _ {f} (\rho (\tau_ {1}; \theta^ {*} (\nu)), \rho (\tau_ {1}; \beta)) \\ \left. + D _ {f} \left(\rho \left(\tau_ {1}; \beta\right), \rho \left(\tau_ {1}; \theta^ {K} (\nu)\right)\right)\right), \\ \end{array}
+$$
+
+where using the triangle inequality and get back the similar form with which we had started in equation (64) similar to term I and term II. Here, similarly continuing this expansion, we finally get
+
+$$
+\begin{array}{l} D _ {f} \left(\rho \left(\tau ; \theta^ {*} (\nu)\right), \rho \left(\tau ; \theta^ {K} (\nu)\right)\right) \leq \sum_ {h = 0} ^ {H - 1} \mathbb {E} _ {s \sim \rho_ {\theta K _ {(\nu)}} ^ {P} (s)} D _ {f} \left(\pi_ {\theta^ {*} (\nu)} (a | s), \pi_ {\theta^ {K} (\nu)} (a | s)\right) \\ \leq H \mathbb {E} _ {s \sim \rho_ {\theta K} (\nu)} (s) D _ {f} \left(\pi_ {\theta^ {*} (\nu)} (a | s), \pi_ {\theta^ {K} (\nu)} (a | s)\right) \\ \leq H \sum_ {s} \rho_ {\theta^ {K} (\nu)} (s) D _ {f} \left(\pi_ {\theta^ {*} (\nu)} (a | s), \pi_ {\theta^ {K} (\nu)} (a | s)\right) \\ \leq H D _ {f} \left(\pi_ {\theta^ {*} (\nu)} \left(a ^ {\prime} \mid s ^ {\prime}\right), \pi_ {\theta^ {K} (\nu)} \left(a ^ {\prime} \mid s ^ {\prime}\right)\right), \tag {69} \\ \end{array}
+$$
+
+where, we upper bound the first equation by the total number of timesteps or horizon length $H$ of the trajectory and subsequently upper-bound the divergence by the state $(s, a)$ pair for which the $D_{f}(\pi_{\theta^{*}(\nu)}(a|s), \pi_{\theta^{K}(\nu)}(a|s))$ is maximum and is given as $(s', a')$ . Next, in (69), by considering the total variation as the f-divergence (it falls into the class of f-divergence under consideration) and expanding using definition with countable measures to obtain
+
+$$
+\begin{array}{l} D _ {f} \left(\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \theta^ {K} (\nu))\right) \leq H D _ {T V} \left(\pi_ {\theta^ {*} (\nu)} \left(a ^ {\prime} \mid s ^ {\prime}\right), \pi_ {\theta^ {K} (\nu)} \left(a ^ {\prime} \mid s ^ {\prime}\right)\right) \\ \leq \frac {H}{2} \left\| \pi_ {\theta^ {*} (\nu)} \left(a ^ {\prime} \mid s ^ {\prime}\right) - \pi_ {\theta^ {K} (\nu)} \left(a ^ {\prime} \mid s ^ {\prime}\right) \right\| _ {1} \\ \leq \frac {H L _ {2}}{2} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {70} \\ \end{array}
+$$
+
+where, we use the gradient-boundedness condition on the score function (cf. Assumption 3) on the policy parameter to get the final expression of equation (70). We note that the result holds for any general horizon length $H$ .
+
+# G.2 PROOF OF LEMMA 3
+
+# G.2.1 PROOF OF LEMMA 3 STATEMENT (I)
+
+Proof. We start with the definition from (17)
+
+$$
+\begin{array}{l} \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu_ {t}, \theta^ {K} (\nu_ {t})) = \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu_ {t})) \left[ \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h} \cdot \nabla_ {\nu} r _ {\nu_ {t}} (s _ {h}, a _ {h}) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j})\right) ^ {T} \right] \\ \leq \left[ \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h} \cdot \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h} ^ {\prime}, a _ {h} ^ {\prime}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} ^ {\prime} \mid s _ {j} ^ {\prime}\right)\right) ^ {T} \right] \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu_ {t})) \\ = \left[ \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h} \cdot \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h} ^ {\prime}, a _ {h} ^ {\prime}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} ^ {\prime} \mid s _ {j} ^ {\prime}\right)\right) ^ {T} \right], \tag {71} \\ \end{array}
+$$
+
+where $\tau' = [(s_0', a_0') \cdot (s_h', a_h') \cdots]$ represents the trajectory for which the lower product term is maximum and thereby upper-bounding with that leads to expression in equation (71). Next we upper-bound the norm of the $\| \nabla_{\nu, \theta}^2 V_s(\nu_t, \theta^K(\nu_t))\|$ as
+
+$$
+\begin{array}{l} \| \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu_ {t}, \theta^ {K} (\nu_ {t})) \| \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h} \cdot \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h} ^ {\prime}, a _ {h} ^ {\prime}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu_ {t})} \left(a _ {j} ^ {\prime} \mid s _ {j} ^ {\prime}\right)\right) ^ {T} \right\| \\ \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h} \cdot \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h} ^ {\prime}, a _ {h} ^ {\prime}\right) \right\| \cdot \left\| \sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} ^ {\prime} \mid s _ {j} ^ {\prime}\right) \right\| \\ \leq H _ {\ell} ^ {2} L _ {r} B, \tag {72} \\ \end{array}
+$$
+
+where we apply the Cauchy-Schwarz inequality to get the inequality in the second line. Subsequently, we apply triangle inequality with reward boundedness assumption from Assumption 2 and bounded score function of the policy from Assumption 3 to get the final bound for the mixed hessian term. $\square$
+
+# G.2.2 PROOF OF LEMMA 3 STATEMENT (II)
+
+Proof. We start by considering the term
+
+$$
+\nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {2} (\tau), \tag {73}
+$$
+
+where we define
+
+$$
+f _ {1} (\tau) = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right) \tag {74}
+$$
+
+$$
+f _ {2} (\tau) = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} \left(s _ {k}, a _ {k}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta K _ {(\nu)}} \left(a _ {j} \mid s _ {j}\right)\right). \tag {75}
+$$
+
+Subsequently, we write the norm of the equation (73) into 2 parts as
+
+$$
+\begin{array}{l} \left\| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \right\| \\ = \| \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {1} (\tau) + \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {2} (\tau) \| \\ \leq \left\| T _ {1} \right\| + \left\| T _ {2} \right\|, \tag {76} \\ \end{array}
+$$
+
+First we use triangle inequality and then add and subtract $\mathbb{E}_{\rho(\tau; \theta^{K}(\nu))} f_1(\tau)$ to get the expression where, $T_1 = \mathbb{E}_{\rho(\tau; \theta^*(\nu))} f_1(\tau) - \mathbb{E}_{\rho(\tau; \theta^{K}(\nu))} f_1(\tau)$ and $T_2 = \mathbb{E}_{\rho(\tau; \theta^{K}(\nu))} f_1(\tau) - \mathbb{E}_{\rho(\tau; \theta^{K}(\nu))} f_2(\tau)$ . This is an interesting point of departure from existing Bilevel analysis where the stochasticity is mainly iid noise. Hence to deal with this, we separate the terms 1. divergence b/w two probability distributions and 2. expected diff b/w two functions under the same distribution. We next, upper-bound the individual terms to get the final Lispchitz constant.
+
+First, we focus on the first term of inequality i.e $T_{1}$ given as
+
+$$
+\begin{array}{l} T _ {1} = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {1} (\tau) \tag {77} \\ \leq \sup _ {f _ {1}} [ \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {1} (\tau) ] \\ \leq \chi_ {1} d _ {T V} (\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \theta^ {K} (\nu))) \\ \leq \chi_ {1} \frac {H _ {\ell}}{2} L _ {2} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \\ \end{array}
+$$
+
+where we first upper-bound the expression to a standard Integral Probability Metric form by taking the supremum and then dividing and multiplying with the norm of the function given by $\chi_{1} = \| f_{1}(\cdot)\| = H_{l}^{2}RL_{1}$ from equation (96). With that, we get the expression as the of Total variation distance(by definition (Sriperumbudur et al., 2009)) in the third inequality. Then, we upper-bounded the total variation using the results from equation (70) to get the final expression. Note that, in equation (70), we have shown for any general $H$ , which will be $H_{l}$ for our case.
+
+Now, we proceed to the second term of the equation $T_{2}$ and derive an upper bound as
+
+$$
+\begin{array}{l} T _ {2} = \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu)) (f _ {1} (\tau) - f _ {2} (\tau)) \tag {78} \\ \leq f _ {1} \left(\tau^ {\prime}\right) - f _ {2} \left(\tau^ {\prime}\right) \\ = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} (s _ {h}, a _ {h}) \cdot \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu)} (a _ {j} | s _ {j})\right)\right) \\ \end{array}
+$$
+
+where we consider the trajectory $\tau'$ in the sum with the maximum value and upper bound by that and expand the definition of $f_1, f_2$ to get expression in equation (78).
+
+$$
+\begin{array}{l} \left\| T _ {2} \right\| \leq \left\| \right. \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right)\right) \| \tag {79} \\ \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right)\right) \right\| \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \| r _ {\nu_ {t}} (s _ {h}, a _ {h}) \| \left(\sum_ {j = 0} ^ {h} \left(\| \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu)} (a _ {j} | s _ {j}) \|\right)\right) \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \left\| r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \right\| H _ {\ell} L _ {2} \left\| \theta^ {*} (\nu) - \theta^ {K} (\nu) \right\| \\ = L _ {2} R H _ {\ell} ^ {2} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \\ \end{array}
+$$
+
+where we use Cauchy-Schwartz and triangle inequality repetitively to get to the third inequality. Next, we use Assumption 3 on the Hessian Lipschitzness of the score function and the bounded reward norm $\max_{(s,a)}\| r_{\nu}(s,a)\| = R$ to get the next inequality. Finally, we use the upper bound on the geometric series to obtain the final expression. Adding equations (77) and (79), we get the
+
+$$
+\left\| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \right\| \leq L ^ {\prime} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \tag {80}
+$$
+
+where, $L^{\prime} = L_{1}L_{2}R\frac{H_{l}^{3}}{2} +L_{2}RH_{\ell}^{2}$
+
+# G.2.3 PROOF OF LEMMA 3 STATEMENT (III)
+
+Proof. We start by considering the term
+
+$$
+\nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \leq \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {3} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {4} (\tau) \tag {81}
+$$
+
+where we define
+
+$$
+f _ {3} (\tau) = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {H _ {\ell}} \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right) ^ {T} \tag {82}
+$$
+
+$$
+f _ {4} (\tau) = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {H _ {\ell}} \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right) ^ {T}. \tag {83}
+$$
+
+Subsequently, we write the norm of the equation (81) into 2 parts as
+
+$$
+\begin{array}{l} \left\| \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) - \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu , \theta^ {K} (\nu)\right) \right\| \leq \left\| \mathbb {E} _ {\rho \left(\tau ; \theta^ {*} (\nu)\right)} f _ {3} (\tau) - \mathbb {E} _ {\rho \left(\tau ; \theta^ {K} (\nu)\right)} f _ {3} (\tau) \right. \tag {84} \\ + \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {3} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {4} (\tau) \| \\ \leq \left\| T _ {3} \right\| + \left\| T _ {4} \right\|, \\ \end{array}
+$$
+
+where, $T_{3} = \mathbb{E}_{\rho (\tau ;\theta^{*}(\nu))}f_{3}(\tau) - \mathbb{E}_{\rho (\tau ;\theta^{\kappa}(\nu))}f_{3}(\tau)$ and $T_{4} = \mathbb{E}_{\rho (\tau ;\theta^{\kappa}(\nu))}f_{3}(\tau) - \mathbb{E}_{\rho (\tau ;\theta^{\kappa}(\nu))}f_{4}(\tau)$ . We next, upper-bound the individual terms to get the final Lipschitz constant.
+
+First, we focus on the first term of inequality i.e $T_{3}$ given as
+
+$$
+\begin{array}{l} T _ {3} = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {3} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {3} (\tau) \tag {85} \\ \leq \sup _ {f _ {3}} [ \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} f _ {3} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} f _ {1} (\tau) ] \\ \leq \chi_ {3} d _ {T V} (\rho (\tau ; \theta^ {*} (\nu)), \rho (\tau ; \theta^ {K} (\nu))) \\ \leq \chi_ {3} \frac {H _ {\ell}}{2} L _ {2} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \\ \end{array}
+$$
+
+where we convert the inequality first to a standard Integral Probability Metric form by taking the supremum. Then we divide and multiply with the norm of the function $f_{3}$ given by $\| f_3(\cdot)\| = \chi_3 = H_l^2 BL_r$ from equation (95), and then we get the final expression in terms of Total variation distance (from definition (53)). Then, we upper-bounded the total variation using the results from equation (70) to get the final expression. Now, we proceed to the second term of the equation $T_{4}$ and derive an upper bound as
+
+$$
+\begin{array}{l} T _ {4} = \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu)) (f _ {3} (\tau) - f _ {4} (\tau)) \tag {86} \\ \leq f _ {3} \left(\tau^ {\prime}\right) - f _ {4} \left(\tau^ {\prime}\right) \\ = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} (s _ {h}, a _ {h}) \cdot \left(\sum_ {j = 0} ^ {H _ {\ell}} \left(\nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu)} (a _ {j} | s _ {j})\right)\right) ^ {T} \\ \end{array}
+$$
+
+where we consider the trajectory $\tau'$ in the sum with the maximum value and upper bound by that to get equation (86). Next, we upper-bound the norm $\|T_4\|$ as
+
+$$
+\begin{array}{l} \| T _ {4} \| \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right) - \nabla_ {\theta} \log \pi_ {\theta^ {\kappa} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right)\right) ^ {T} \right\| \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \| \nabla_ {\nu} r _ {\nu} (s _ {h}, a _ {h}) \| \left(\sum_ {j = 0} ^ {h} \| \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu)} (a _ {j} | s _ {j})) \|\right) \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \| \nabla_ {\nu} r _ {\nu} (s _ {h}, a _ {h}) \| H _ {\ell} L _ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \\ \leq L _ {1} L _ {r} H _ {\ell} ^ {2} \left\| \theta^ {*} (\nu) - \theta^ {K} (\nu) \right\|, \tag {87} \\ \end{array}
+$$
+
+where we use Cauchy-Schwartz and triangle inequality repetitively to get to the third inequality. Next, we use Assumption 3 on the Lipschitzness of the gradient of the score function and the bounded
+
+reward $R$ (cf. Assumption 2). Finally, we upper-bound sum of this geometric series to obtain the final expression. Adding equations (85) and (87), we get the
+
+$$
+\left\| \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} \left(\nu_ {t}\right)\right) - \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} (\nu)\right) \right\| \leq L ^ {\prime \prime} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \tag {88}
+$$
+
+where, $L'' = L_2L_rB\frac{H_l^3}{2} +L_1L_rH_\ell^2$
+
+# H ADDITIONAL SUPPORTING LEMMAS
+
+# H.1 PROOF OF LISPCHITZNESS AND BOUNDEDNESS CONDITION FOR $f_{1}(\cdot)$ DEFINED IN (74)
+
+Here, we prove that the function denoted as $f_{1}(\theta^{*}(\nu)) = \sum_{h=0}^{H_{\ell}} \gamma^{h-1} \cdot r_{\nu_{t}}(s_{h}, a_{h}) \cdot \left( \sum_{j=0}^{h} \nabla_{\theta}^{2} \log \pi_{\theta^{*}(\nu)}(a_{j}|s_{j}) \right)$ is Lipschitz continuous w.r.t $\theta$ with Lipschitz constant $L_{f_{1}}$ i.e
+
+$$
+\left\| f _ {1} \left(\theta^ {*} (\nu)\right) - f _ {1} \left(\theta^ {K} (\nu)\right) \right\| \leq L _ {f _ {1}} \left\| \theta^ {*} (\nu) - \theta^ {K} (\nu) \right\|. \tag {89}
+$$
+
+First, we begin with the different term as :
+
+$$
+\left. f _ {1} \left(\theta^ {*} (\nu)\right) - f _ {1} \left(\theta^ {K} (\nu)\right) = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right)\right). \right. \tag {90}
+$$
+
+Subsequently, taking the norm we get
+
+$$
+\begin{array}{l} \left\| f _ {1} \big (\theta^ {*} (\nu) \big) - f _ {1} \big (\theta^ {K} (\nu) \big) \right\| \\ = \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {\kappa} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right)\right) \right\| \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \| r _ {\nu_ {t}} (s _ {h}, a _ {h}) \| \cdot \left(\sum_ {j = 0} ^ {h} \| \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu)} (a _ {j} | s _ {j}) \|\right) \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \| r _ {\nu_ {t}} (s _ {h}, a _ {h}) \| L _ {2} H _ {\ell} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \\ \leq L _ {2} H _ {\ell} ^ {2} R \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {91} \\ \end{array}
+$$
+
+where we use Cauchy-Schwartz and triangle inequality to get the subsequent expressions. In the third inequality, we use the Hessian Lipschitzness assumption of score function of policy parameters from Assumption 3 and finally using the boundedness of the reward values and upper-bounding the Geometric series, we get the final expression. Thus we show that $f_{1}(\cdot)$ is Lipschitz continuous w.r.t $\theta$ with Lipschitz constant $L_{f_1} = L_2H_\ell^2 R$ .
+
+Similarly, we can derive the boundedness condition on the norm of the function $\| f_1(\cdot)\|$ , $\forall \theta$ as
+
+$$
+\begin{array}{l} \left\| f _ {1} \right\| = \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta} \left(a _ {j} \mid s _ {j}\right)\right) \right\| \tag {92} \\ \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot r _ {\nu_ {t}} (s _ {h}, a _ {h}) \right\| \cdot \left\| \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta} (a _ {j} | s _ {j})\right) \right\| \\ \leq H _ {l} ^ {2} R L _ {1} (= \chi_ {1}) \\ \end{array}
+$$
+
+where first we use Cauchy-Schwartz and triangle inequality and subsequently use the bounded reward assumption (2) and Hessian Lipschitzness assumption of the score function of the policy parameter from assumption (3).
+
+# H.2 PROOF OF LISPCHITZNESS AND BOUNDEDNESS FOR $f_{3}(\cdot)$ DEFINED IN (82)
+
+Here, we prove that the function denoted as
+
+$$
+f _ {3} (\theta^ {*} (\nu)) = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} (s _ {h}, a _ {h}) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j})\right) ^ {T}
+$$
+
+is Lipschitz continuous w.r.t $\theta$ with Lipschitz constant $L_{f_3}$ i.e
+
+$$
+\left\| f _ {3} \left(\theta^ {*} (\nu)\right) - f _ {3} \left(\theta^ {K} (\nu)\right) \right\| \leq L _ {f _ {3}} \left\| \theta^ {*} (\nu) - \theta^ {K} (\nu) \right\|. \tag {93}
+$$
+
+First, we begin with the difference term as:
+
+$$
+\begin{array}{l} f _ {3} \left(\theta^ {*} (\nu)\right) - f _ {3} \left(\theta^ {K} (\nu)\right) \tag {94} \\ = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} (s _ {h}, a _ {h}) \cdot \left(\sum_ {j = 0} ^ {h} (\nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}))\right) ^ {T}. \\ \end{array}
+$$
+
+Subsequently, taking the norm, we get
+
+$$
+\begin{array}{l} \left\| f _ {3} \left(\theta^ {*} (\nu)\right) - f _ {3} \left(\theta^ {K} (\nu)\right) \right\| \\ = \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \left(\nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right) - \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right)\right) ^ {T} \right\| \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \| \nabla_ {\nu} r _ {\nu} (s _ {h}, a _ {h}) \| \cdot \left(\sum_ {j = 0} ^ {h} \left(\| \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) - \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} (a _ {j} | s _ {j}) \|\right)\right) \\ \leq L _ {r} L _ {1} H _ {\ell} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \\ \leq L _ {r} L _ {1} H _ {\ell} ^ {2} \left\| \theta^ {*} (\nu) - \theta^ {K} (\nu) \right\|, \tag {95} \\ \end{array}
+$$
+
+where we use Cauchy-Schwartz and triangle inequality repeatedly to get the subsequent inequalities. In the third inequality, we use the smoothness assumption of the score function of the policy parameters of Assumption 3. Finally, using the Assumption 2 i.e reward Lipschitzness and upper-bounding the Geometric series, we get the final expression. Thus $f_{3}(\theta^{*}(\nu))$ is Lipschitz continuous w.r.t $\theta$ with Lipschitz constant $L_{f_3} = L_rL_1H_\ell^2$ .
+
+Similarly, we can derive the boundedness condition on the norm of the function $\| f_3(\cdot)\|$ , $\forall \theta$ as
+
+$$
+\begin{array}{l} \left\| f _ {3} \right\| = \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} \left(s _ {h}, a _ {h}\right) \cdot \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right) ^ {T} \right\| \tag {96} \\ \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \cdot \nabla_ {\nu} r _ {\nu} \left(s _ {h}, a _ {h}\right) \right\| \cdot \left\| \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu)} \left(a _ {j} \mid s _ {j}\right)\right) \right\| \\ \leq H _ {l} ^ {2} B L _ {r} (= \chi_ {3}) \\ \end{array}
+$$
+
+where, first we use Cauchy-Schwartz and triangle inequality and subsequently using the Lipschitzness property in reward function assumption (2) and bounded score function of the policy parameter from assumption (3), we get the final expression.
+
+# H.3 PROOF OF SMOOTHNESS CONDITION ON THE VALUE FUNCTION
+
+Here, we prove the smoothness of the value function i.e. the gradient of the value function is Lipschitz continuous w.r.t $\theta$ with Lipschitz constant $L_{1}$ . We begin with the definition of the gradient difference
+
+of the value function from the equation (15) as:
+
+$$
+\begin{array}{l} \nabla_ {\theta} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} V _ {s} (\nu_ {t}, \theta^ {K} (\nu)) = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} V _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} V _ {2} (\tau) \tag {97} \\ = \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} V _ {1} (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} V _ {1} (\tau) \\ + \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} [ V _ {1} (\tau) - V _ {2} (\tau) ] \\ = \Sigma_ {1} + \Sigma_ {2}, \\ \end{array}
+$$
+
+where, first we substitute
+
+$$
+V _ {1} = \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h - 1} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {H _ {\ell} - 1} \nabla_ {\theta} \log \pi_ {\theta^ {*} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right), \tag {98}
+$$
+
+$$
+V _ {2} = \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h - 1} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {H _ {\ell} - 1} \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right). \tag {99}
+$$
+
+Subsequently, by adding and subtracting $\mathbb{E}_{\rho(\tau; \theta^{K}(\nu))} V_{2}(\tau)$ , we get the final expression, where $\Sigma_{1} = \mathbb{E}_{\rho(\tau; \theta^{*}(\nu))} V_{1}(\tau) - \mathbb{E}_{\rho(\tau; \theta^{K}(\nu))} V_{1}(\tau)$ and $\Sigma_{2} = \mathbb{E}_{\rho(\tau; \theta^{K}(\nu))}[V_{1}(\tau) - V_{2}(\tau)]$ . Now, first, we derive the Lipschitz constant for $V_{1}$ as
+
+$$
+\begin{array}{l} \left\| V _ {1} \left(\theta^ {*} (\nu) - V _ {1} \left(\theta^ {K} (\nu)\right) \right\| \right. \\ \leq \sum_ {h = 0} ^ {H _ {\ell} - 1} \gamma^ {h - 1} \| r _ {\nu_ {t}} (s _ {h}, a _ {h}) \| \left(\sum_ {j = 0} ^ {H _ {\ell} - 1} \| \nabla_ {\theta} \log \pi_ {\theta^ {*} (\nu_ {t})} (a _ {j} | s _ {j}) - \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j}) \|\right) \\ \leq H _ {l} ^ {2} R L _ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {100} \\ \end{array}
+$$
+
+where we first use Cauchy-Schwartz and triangle inequality to get the first inequality. Next, we upper-bound the reward with $R$ from Assumption 2, Lipschitzness of policy gradient from Assumption 3, and finally upper-bounding the Geometric series, we get the final expression. The Lipschitz constant $L_{5} = H_{l}^{2}RL_{1}$ .
+
+We can subsequently upper-bound $\Sigma_{1}$ with the total variation distance as
+
+$$
+\begin{array}{l} \Sigma_ {1} \leq \sup _ {V} \left[ \mathbb {E} _ {\rho (\tau ; \theta^ {*} (\nu))} V (\tau) - \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} V (\tau) \right] \tag {101} \\ \leq L _ {5} d _ {T V} \left(\rho (\tau ; \theta^ {K} (\nu)), \rho (\tau ; \theta^ {*} (\nu))\right) \\ \leq L _ {5} \frac {H L _ {2}}{2} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \\ \end{array}
+$$
+
+where first we divide by the Lipschitz constant of the function and subsequently upper-bound with the Total Variation distance. Finally, we substitute the total variation distance expression from the equation (70) to get the final expression. Now, the second term can be written as
+
+$$
+\Sigma_ {2} = \mathbb {E} _ {\rho (\tau ; \theta^ {K} (\nu))} \left[ V _ {1} (\tau) - V _ {2} (\tau) \right] \leq V _ {1} \left(\tau^ {\prime}\right) - V _ {2} \left(\tau^ {\prime}\right), \tag {102}
+$$
+
+where we take the trajectory with the maximum difference and upper-bound the term. Subsequently, $\| \Sigma_2\| \leq \| V_1(\tau ') - V_2(\tau ')\| = H_l^2 RL_{\theta_1}\| \theta^* (\nu) - \theta^K (\nu)\|$ from equation (100).
+
+Finally, the norm of the gradient difference of the value function from equation (97) as
+
+$$
+\left\| \nabla_ {\theta} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {K} (\nu)\right) \right\| \leq L _ {6} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \tag {103}
+$$
+
+where $L_{6} = L_{5}\frac{HL_{2}}{2} +L_{5}$ and $L_{5} = H_{l}^{2}RL_{\theta_{1}}$
+
+# H.4 UPPER-BOUND ON THE NORM OF THE HESSIAN FOR THE BILEVEL RL
+
+Here, we prove an upper-bound on the norm of the hessian defined in (16) given as
+
+$$
+\begin{array}{l} \nabla_ {\theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) = \mathbb {E} _ {\rho \left(\tau ; \theta^ {K} \left(\nu_ {t}\right)\right)} \left[ \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right) \right] \tag {104} \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} r _ {\nu_ {t}} (s _ {h}, a _ {h}) \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j})\right) \sum_ {\tau} \rho (\tau ; \theta^ {K} (\nu_ {t})) \\ = \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} r _ {\nu_ {t}} (s _ {h}, a _ {h}) \left(\sum_ {j = 0} ^ {H _ {\ell}} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j})\right), \\ \end{array}
+$$
+
+where, first we upper-bound the expression by considering the trajectory which has the maximum lower-value and $\sum_{\tau} \rho(\tau; \theta^{K}(\nu_{t})) = 1$ . Next, we, upper-bound the norm as
+
+$$
+\begin{array}{l} \left\| \nabla_ {\theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) \right\| \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right) \right\| \tag {105} \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \| r _ {\nu_ {t}} (s _ {h}, a _ {h}) \| \left(\sum_ {j = 0} ^ {h} \| \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j}) \|\right) \\ \leq H _ {l} ^ {2} R L _ {\pi} ^ {1}, \\ \end{array}
+$$
+
+where, we first upper-bound with successive application of Cauchy-Schwartz and Triangle inequality to get the second inequality. Finally, with the upper bound on $\| r_{\nu_t}(s_h,a_h)\| \leq R$ from Assumption (2) and smoothness condition on the policy gradients from Assumption 3 and upper-bounding the geometric series, we get the final expression.
+
+# H.5 UPPER-BOUND ON THE NORM OF THE 2ND ORDER MIXED-JACCOBIAN TERM FOR THE BILEVEL RL
+
+Here, we prove an upper-bound on the norm of the mixed second-order Jacobian term defined in (17) given as
+
+$$
+\begin{array}{l} \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu_ {t}, \theta^ {K} (\nu_ {t})) = \mathbb {E} _ {P (\tau ; \theta^ {K} (\nu_ {t}))} \left[ \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \nabla_ {\nu} r _ {\nu_ {t}} (s _ {h}, a _ {h}) \Big (\sum_ {j = 0} ^ {h} [ \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j}) ] ^ {T} \Big) \right] \\ \leq \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \left[ \nabla_ {\theta} \log \pi_ {\theta K \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right) \right] ^ {T}\right), \tag {106} \\ \end{array}
+$$
+
+where first we upper-bound the expression with the trajectory which has the maximum lower value. Next, we, upper-bound the norm as
+
+$$
+\begin{array}{l} \left\| \nabla_ {\nu , \theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) \right\| \leq \left\| \sum_ {h = 0} ^ {H _ {\ell}} \gamma^ {h - 1} \nabla_ {\nu} r _ {\nu_ {t}} \left(s _ {h}, a _ {h}\right) \left(\sum_ {j = 0} ^ {h} \left[ \nabla_ {\theta} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right) \right] ^ {T}\right) \right\| \tag {107} \\ \leq \sum_ {h = 0} ^ {h} \gamma^ {h - 1} \| \nabla_ {\nu} r _ {\nu_ {t}} (s _ {h}, a _ {h}) \| \left(\sum_ {j = 0} ^ {h} \| \nabla_ {\theta} \log \pi_ {\theta^ {K} (\nu_ {t})} (a _ {j} | s _ {j}) \|\right) \\ \leq H _ {l} ^ {2} L _ {r} B, \\ \end{array}
+$$
+
+where we first upper-bound with the successive application of Cauchy-Schwartz and Triangle inequality to get the second inequality. Finally, with the upper bound on $\| \nabla_{\nu}r_{\nu_t}(s_h,a_h)\| \leq L_r$ from smoothness condition on the reward function from Assumption (2), bounded score function of policy parameter from Assumption 3 and upper-bounding the geometric series, we get the final expression. We denote $L_{\nu ,\theta} = H_l^2 L_rB$ for simplicity.
+
+# H.6 PROOF OF LEMMA 4
+
+Proof. Let us start by first deriving the upper bounds for the terms $\phi_{1}$ and $\phi_{2}$ as defined in the equation (54) as follows. For $\phi_1(\tau)$ , we have
+
+$$
+\left\| \phi_ {1} (\tau) \right\| = \left\| U _ {\nu} (\tau) \cdot \sum_ {h = 0} ^ {H - 1} \left[ - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right) \right] + \nabla_ {\nu} U _ {\nu} (\tau) \right\|. \tag {108}
+$$
+
+We define the term $\kappa$ which explains the relative conditioning of the two matrix norms. We define the mixed condition number as
+
+$$
+\kappa = \frac {\left\| \nabla_ {v , \theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) \right\|}{\left\| \nabla_ {\theta} ^ {2} V _ {s} \left(\nu , \theta^ {*} (\nu)\right) \right\|} \leq \frac {H _ {l} L _ {r} B}{l _ {\pi} (1 - \gamma)} \tag {109}
+$$
+
+Next, to upper-bound the second term relating to the difference in $\| \phi_1 - \phi_2\|$ in the equation, we proceed first by upper-bounding the product difference
+
+$$
+\left\| \Delta \right\| = \left\| \Delta_ {1} - \Delta_ {2} \right\|, \tag {110}
+$$
+
+where we define
+
+$$
+\Delta_ {1} = \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right), \tag {111}
+$$
+
+$$
+\Delta_ {2} = \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right). \tag {112}
+$$
+
+Also, for simplicity of notation, let us take
+
+$$
+\psi_ {1} = \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1}, \tag {113}
+$$
+
+$$
+\text {a n d} \psi_ {2} = \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1}, \tag {114}
+$$
+
+which thus (110) boils down to upper-bounding
+
+$$
+\begin{array}{l} \Delta = \left\| \psi_ {1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right) - \psi_ {2} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) \right\| \tag {115} \\ = \| \psi_ {1} \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right) - \psi_ {1} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) + \psi_ {1} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) - \psi_ {2} \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) \| \\ \leq \| \psi_ {1} \| \| \nabla_ {\theta} f _ {h} \left(\theta^ {*} (\nu)\right) - \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) \| + \| \psi_ {1} - \psi_ {2} \| \| \nabla_ {\theta} f _ {h} \left(\theta^ {K} (\nu)\right) \| \\ \leq \kappa L _ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| + B \| \psi_ {1} - \psi_ {2} \|, \\ \end{array}
+$$
+
+where, first we expand and subtract the term $\psi_{1}\nabla_{\theta}f_{h}(\theta^{K}(\nu))$ , and subsequently by applying Cauchy-Schwartz and triangle inequality, we get to the third inequality. For the final inequality, we apply equation and Lispchitzness assumptions on the score function of the policy parameter Assumption (3) to get the final expression in equation (115). Next, we focus on upper bounding the second term of the expression specifically $\| \psi_1 - \psi_2\|$
+
+$$
+\begin{array}{l} \left\| \psi_ {1} - \psi_ {2} \right\| = \left\| \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} - \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \right. \tag {116} \\ + \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} - \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \| \\ = \| \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} - \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \| \\ + \left\| \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} - \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \right\| \\ = \Psi_ {2 1} + \Psi_ {2 2}, \\ \end{array}
+$$
+
+where we expand the definition of $\| \psi_1 - \psi_2\|$ and subsequently apply triangle inequality and Cauchy-Schwartz which then boils to upper-bounding the sum of two terms $\Psi_{21} + \Psi_{22}$ . For $\Psi_{21}$ , we have
+
+$$
+\begin{array}{l} \Psi_ {2 1} \leq \| \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \| \| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} - \nabla_ {v, \theta} ^ {2} V _ {s} \left(\theta^ {K} (\nu)\right) ^ {- 1} \| \tag {117} \\ \leq L _ {\nu , \theta} \| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \| \\ = L _ {\nu , \theta} \| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) ^ {- 1} \left(\nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu))\right) \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) ^ {- 1} \| \\ \leq L _ {\nu , \theta} \| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) \| ^ {- 1} \| (\nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu)) - \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu))) \| \| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \| ^ {- 1} \\ \leq \frac {L _ {\nu , \theta} L ^ {\prime}}{l _ {\pi} ^ {2}} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \\ \end{array}
+$$
+
+where we use Cauchy-Schwartz inequality and triangle inequality iteratively to get the final inequality. Next, we use the upper bounds and lower bounds of the hessian and mixed hessian matrices defined in Assumptions to get the final expression. Now, $L_{\nu,\theta} = H_l^2 L_r B$ from equation (107), $L' = L_{f_1} \chi_1 \frac{H_\ell}{2} L_2 + L_2 R H_\ell^2$ and $L_{f_1} = L_2 H_\ell^2 R$ from equation (80). Finally, the second-term $\Psi_{22}$ from equation (116) can be upper-bounded as
+
+$$
+\begin{array}{l} \Psi_ {2 2} \leq \| \nabla_ {\nu , \theta} ^ {2} V _ {s} (\nu , \theta^ {*} (\nu) - \nabla_ {v, \theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \| \| \nabla_ {\theta} ^ {2} V _ {s} (\nu , \theta^ {K} (\nu)) \| ^ {- 1} \\ \leq \frac {L ^ {\prime \prime}}{l _ {\pi}} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \tag {118} \\ \end{array}
+$$
+
+where, similarly we use triangle inequality with Cauchy-Schwartz to get the final upper-bound of equation (118). Now, $L'' = L_{f_3} \chi_2 \frac{H_\ell}{2} L_2 + L_1 L_r H_\ell^2$ and $L_{f_3} = L_r L_1 H_\ell^2$ from equation (88).
+
+Now, combining equations (117) and (118), we get the final upper-bound of the $\| \psi_1 - \psi_2\|$ in equation (116) as
+
+$$
+\left\| \psi_ {1} - \psi_ {2} \right\| \leq \left(\frac {L _ {\nu , \theta} L ^ {\prime}}{l _ {\pi} ^ {2}} + \frac {L ^ {\prime \prime}}{l _ {\pi}}\right) \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|. \tag {119}
+$$
+
+Hence, finally replacing the upper-bound of $\Psi_{2}$ from equation (119) in equation (115) to obtain the upper-bound on the function difference term $\Delta$ as
+
+$$
+\begin{array}{l} \Delta \leq \kappa L _ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| + \left(\frac {L _ {\nu , \theta} L ^ {\prime}}{l _ {\pi} ^ {2}} + \frac {L ^ {\prime \prime}}{l _ {\pi}}\right) \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \| \tag {120} \\ = \gamma_ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \\ \end{array}
+$$
+
+with $\gamma_{1} := \kappa L_{1} + \frac{L_{\nu,\theta}L^{\prime}}{l_{\pi}^{2}} + \frac{L^{\prime\prime}}{l_{\pi}}$ . Hence, with the above bounds, we proceed to upper-bound the term II in equation (51) i.e. $\| \mathbb{E}_{\tau \sim \rho (\tau ;\theta^{K}(\nu))}[\phi_{1}(\tau) - \phi_{2}(\tau)]\|$ as
+
+$$
+\begin{array}{l} \left\| \mathbb {E} _ {\tau \sim \rho (\tau ; \theta^ {K} (\nu))} \left[ \phi_ {1} (\tau) - \phi_ {2} (\tau) \right] \right\| \leq \left\| \phi_ {1} \left(\tau^ {\prime}\right) - \phi_ {1} \left(\tau^ {\prime}\right) \right\| \tag {121} \\ = \| U (\tau) \cdot \sum_ {h = 0} ^ {H - 1} \left(\Delta_ {1} - \Delta_ {2}\right) \| \\ \leq \| \sum_ {h ^ {\prime} = 0} ^ {H - 1} u \left(s _ {h}, a _ {h}\right) \| \| \sum_ {h = 0} ^ {H - 1} \left(\Delta_ {1} - \Delta_ {2}\right) \| \\ \leq H ^ {2} \tilde {u} \| \Delta_ {1} - \Delta_ {2} \| \\ \leq H ^ {2} \tilde {u} \gamma_ {1} \| \theta^ {*} (\nu) - \theta^ {K} (\nu) \|, \\ \end{array}
+$$
+
+where first we select the trajectory $\tau'$ with the maximum sum and subsequently using the Cauchy-Schwartz inequality we get the second equation. Based on the assumption of bounded utility $u(s, a) \leq \tilde{u}, \forall (s, a)$ , we get the third equation and finally using the upper bound of $\Delta_1 - \Delta_2$ from equation (120), we get the final expression for equation (121).
+
+# H.7 PROOF OF LEMMA 2
+
+Proof. Here, we derive an upper bound on the tracking term due to the use of surrogate gradients $\| \theta^{*}(\nu_{t}) - \theta^{K}(\nu_{t})\|$ . To begin the proof, we start with the smoothness in the value function shown in equation (103), as
+
+$$
+\begin{array}{l} V _ {s} \left(\nu_ {t}, \theta^ {k + 1} (\nu_ {t})\right) \leq V _ {s} \left(\nu_ {t}, \theta^ {k} (\nu_ {t})\right) + \left\langle \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {k + 1} (\nu_ {t})\right), \theta^ {k + 1} (\nu_ {t}) - \theta^ {k} (\nu_ {t}) \right\rangle \tag {122} \\ + \frac {L _ {6}}{2} \| \theta^ {k + 1} (\nu_ {t}) - \theta^ {k} (\nu_ {t}) \| ^ {2}. \\ \end{array}
+$$
+
+where $L_{6} = L_{5}\frac{H_{\ell}^{2}L_{2}}{2} + L_{5}$ and $L_{5} = H_{l}RL_{\theta_{1}}$ . Now, from the update of $\theta$ from Algorithm 2, we know that
+
+$$
+\theta^ {k + 1} \left(\nu_ {t}\right) = \theta^ {k} \left(\nu_ {t}\right) - \alpha_ {\ell} \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right). \tag {123}
+$$
+
+Replacing the update in equation (122), we have
+
+$$
+\begin{array}{l} V _ {s} \left(\nu_ {t}, \theta^ {k + 1} \left(\nu_ {t}\right)\right) \leq V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right) + \left\langle \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {k + 1} \left(\nu_ {t}\right)\right), - \alpha_ {\ell} \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right) \right\rangle \\ + \frac {L _ {6}}{2} \| - \alpha_ {\ell} \nabla_ {\theta} V _ {s} (\nu_ {t}, \theta^ {k} (\nu_ {t})) \| ^ {2} \\ = V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right) - \alpha_ {\ell} \left(1 - \frac {\alpha_ {\ell} L _ {6}}{2}\right) \| \nabla_ {\theta} V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right) \| ^ {2}, \tag {124} \\ \end{array}
+$$
+
+where we expand the expression after replacing the update in equation (122). Next, from Assumption 4, we note that for the value function, it holds that
+
+$$
+\left\| \nabla_ {\theta} V _ {s} \left(\nu , \theta^ {k} (\nu)\right) \right\| ^ {2} \geq \frac {\mu}{2} \left(V _ {s} \left(\nu , \theta^ {k} (\nu)\right) - V _ {s} \left(\nu , \theta^ {*} (\nu)\right)\right). \tag {125}
+$$
+
+Assumption 4 ensures that the objective satisfies the gradient dominance or the PL condition, which can be satisfied in practice for various settings. For instance, Assumption 4 can be satisfied in our setting for softmax policy parametrization Now, replacing the PL condition in equation (124), we have
+
+$$
+\begin{array}{l} V _ {s} (\nu_ {t}, \theta^ {k + 1} (\nu_ {t})) - V _ {s} (\nu_ {t}, \theta^ {k} (\nu_ {t})) \leq - \alpha_ {\ell} (1 - \frac {\alpha_ {\ell} L _ {6}}{2}) \frac {\mu}{2} (V _ {s} (\nu , \theta^ {k} (\nu)) - V _ {s} (\nu , \theta^ {*} (\nu))) \\ = - \alpha_ {3} \left(V _ {s} \left(\nu_ {t}, \theta^ {k} \left(\nu_ {t}\right)\right) - V _ {s} \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right)\right), \tag {126} \\ \end{array}
+$$
+
+where, after replacing the PL condition in equation (124), we substitute $\alpha_{3} = \alpha_{\ell}(1 - \frac{\alpha_{\ell}L_{6}}{2})\frac{\mu}{2}$ for simplicity of calculations.
+
+$$
+\begin{array}{l} V _ {s} (\nu_ {t}, \theta^ {k + 1} (\nu_ {t})) - V _ {s} (\nu_ {t}, \theta^ {*} (\nu_ {t}))) \leq (1 - \alpha_ {3}) (V _ {s} (\nu_ {t}, \theta^ {k} (\nu_ {t})) - V _ {s} (\nu_ {t}, \theta^ {*} (\nu_ {t}))) \\ V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) - V _ {s} \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right)) \leq \left(1 - \alpha_ {3}\right) ^ {K} \left(V _ {s} \left(\nu_ {t}, \theta^ {0} \left(\nu_ {t}\right)\right) - V _ {s} \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right)\right), \tag {127} \\ \end{array}
+$$
+
+where the first equation comes from algebraic manipulation and applying the equation recursively, we get the second inequality, assuming $0 \leq \alpha_{3} \leq 1$ . Now, we note that from the smoothness of value function, we have the upper bound
+
+$$
+V _ {s} \left(\nu_ {t}, \theta^ {0} \left(\nu_ {t}\right)\right) - V _ {s} \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \leq \frac {L _ {6}}{2} \| \theta^ {*} \left(\nu_ {t}\right) - \theta^ {0} \left(\nu_ {t}\right) \| ^ {2}, \tag {128}
+$$
+
+where $L_{6} = L_{5}\frac{HL_{2}}{2} +L_{5},L_{5} = H_{l}^{2}RL_{1}$ and we use the Lipschitz smoothness assumption and expand along the point $\nu_{t},\theta^{*}$ , for which the gradient term vanishes. Also, since PL implies quadratic growth, it holds that
+
+$$
+V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) - V _ {s} \left(\nu_ {t}, \theta^ {*} \left(\nu_ {t}\right)\right) \geq \frac {\mu}{2} \| \theta^ {K} \left(\nu_ {t}\right) - \theta^ {*} \left(\nu_ {t}\right) \| ^ {2}. \tag {129}
+$$
+
+Now, substituting the equations (128), (129) in (127) to obtain
+
+$$
+\left\| \theta^ {K} \left(\nu_ {t}\right) - \theta^ {*} (\nu) \right\| ^ {2} \leq \left(1 - \alpha_ {3}\right) ^ {K} \frac {L _ {6}}{\mu} Z, \tag {130}
+$$
+
+where, $Z \coloneqq \max_{\nu} \| \theta^0 - \theta^*(\nu) \|^2$ , $\alpha_3 = \alpha_\ell (1 - \frac{\alpha_\ell L_6}{2}) \frac{\mu}{2}$ and $L_6 = L_5 \frac{H_\ell L_2}{2} + L_5$ and $L_5 = H_l^2 R L_1$ .
+
+# I DISCUSS OF ASSUMPTION 3 AND ASSUMPTION 4
+
+- Assumption 3 ensure certain properties of the policy parametrization such as Lipschitz policy, bounded score function, Lipschitz score function, and Lipschitz Hessian of the log of the policy. We remark that these assumptions are not restrictive and satisfied in practice for practical classes of policies. For example, this assumption is satisfied for softmax policy parametrization.
+
+$$
+\pi_ {\theta} (a | s) = \frac {\exp \theta^ {T} \phi (s , a)}{\sum_ {a ^ {\prime}} \exp \theta^ {T} \phi \left(s , a ^ {\prime}\right)}, \tag {131}
+$$
+
+where, first we write down the expression of the softmax policy gradient parametrization with function approximation $\phi$ . Subsequently, taking log and taking the gradient w.r.t to the policy parameterization using chain-rule, we get
+
+$$
+\begin{array}{l} \nabla_ {\theta} \log \pi_ {\theta} (a | s) = \phi (s, a) - \frac {1}{\sum_ {a ^ {\prime}} \exp \left(\theta^ {T} \phi \left(s , a ^ {\prime}\right)\right)} \sum_ {a ^ {\prime}} \exp \left(\theta^ {T} \phi \left(s, a ^ {\prime}\right)\right) \phi \left(s, a ^ {\prime}\right) \tag {132} \\ = \phi (s, a) - \sum_ {a ^ {\prime}} \frac {\exp (\theta^ {T} \phi (s , a ^ {\prime}))}{\sum_ {a ^ {\prime \prime}} \exp (\theta^ {T} \phi (s , a ^ {\prime \prime}))} \phi (s, a ^ {\prime}) \\ = \phi (s, a) - \sum_ {a ^ {\prime}} \pi_ {\theta} \left(a ^ {\prime} \mid s\right) \phi \left(s, a ^ {\prime}\right) \\ = \phi (s, a) - \widehat {\phi} _ {s} \\ \end{array}
+$$
+
+where we can denote $\widehat{\phi}_s = \sum_{a'} \pi_\theta(a'|s) \phi(s, a')$ . Now, taking the norm on the LHS of equation (132), we get
+
+$$
+\begin{array}{l} \left\| \nabla_ {\theta} \log \pi_ {\theta} (a | s) \right\| \leq \left\| \phi (s, a) \right\| + \left\| \phi (s, a ^ {\prime}) \right\| \tag {133} \\ = 2 \zeta_ {1} \\ \end{array}
+$$
+
+where we apply triangle inequality to get the final bound, which imposes certain constraints on the norm of the function approximation specifically $\| \phi (s,a)\| \leq \zeta_1$ which is a common assumption in various scenarios (Sutton et al., 2009; Maei et al., 2009). Thus this shows how for soft-max policy with function approximations satisfy Assumptions (3). where, we expand $\nabla_{\theta}\log \pi_{\theta}(a|s) = \frac{1}{\pi_{\theta}(a|s)}\nabla_{\theta}\pi_{\theta}(a|s)$ .
+
+- Assumption 4 ensures that the objective function satisfies certain geometric properties such as PL condition. We remark that the value function satisfies PL condition with softmax policy parametrization (see Lemma8 (Mei et al., 2020b)). Further, a property that we need for our analysis to hold is that the Hessian of the objective function has all non-zero eigenvalues. This assumption holds for softmax parametrizations. Now, in order to show that we first consider the softmax-parametrization considered in equation (132), we first compute the hessian as
+
+$$
+\begin{array}{l} \nabla_ {\theta} ^ {2} \log \pi_ {\theta} (a | s) = \nabla_ {\theta} [ \phi (s, a) - \sum_ {a ^ {\prime}} \pi_ {\theta} \left(a ^ {\prime} \mid s\right) \phi \left(s, a ^ {\prime}\right) ] \tag {134} \\ = - \sum_ {a ^ {\prime}} \nabla_ {\theta} \pi_ {\theta} (a ^ {\prime} | s) \phi (s, a ^ {\prime}) ^ {T} \\ = - \mathbb {E} _ {\boldsymbol {\pi}} [ \nabla_ {\boldsymbol {\theta}} \log \pi_ {\boldsymbol {\theta}} (a ^ {\prime} | s) \phi (s, a ^ {\prime}) ^ {T} ] \\ = \mathbb {E} _ {\pi} [ \widehat {\phi} (s) \phi (s, a ^ {\prime}) ^ {T} - \phi (s, a ^ {\prime}) \phi (s, a ^ {\prime}) ^ {T} ] \\ \end{array}
+$$
+
+Now, finally, we substitute this to the equation of hessian of the value function in equation (134)
+
+$$
+\begin{array}{l} \nabla_ {\theta} ^ {2} V _ {s} \left(\nu_ {t}, \theta^ {K} \left(\nu_ {t}\right)\right) = \mathbb {E} _ {\rho (\tau ; \theta)} \left[ R (\tau) \left(\sum_ {j = 0} ^ {H _ {\ell} - 1} \nabla_ {\theta} ^ {2} \log \pi_ {\theta^ {K} \left(\nu_ {t}\right)} \left(a _ {j} \mid s _ {j}\right)\right) \right] \tag {135} \\ = \mathbb {E} _ {\rho (\tau ; \theta)} \mathbb {E} _ {\pi} \left[ R (\tau) \left(\sum_ {j = 0} ^ {H _ {\ell} - 1} \left[ \widehat {\phi} (s) \phi (s, a ^ {\prime}) ^ {T} - \phi (s, a ^ {\prime}) \phi (s, a ^ {\prime}) ^ {T} \right]\right) \right] \\ \end{array}
+$$
+
+From the above, it is evident to ensure non-singular eigenvalues, we need to ensure non-singularity for the function approximation matrix $\phi \phi^T$ which has been a standard assumption in several settings (Sutton et al., 2009; Maei et al., 2009).
+
+# J ADDITIONAL EXPERIMENTAL DETAILS
+
+Implementation details of our Algorithm For the experiments, we use the same configuration of hyperparameters for all the baselines (Lee et al., 2021; Park et al., 2022) including learning rate, optimizer, etc. PEBBLE with SURF improves the performance of PEBBLE significantly as also shown in (Park et al., 2022). However, it depends on the quality and amount of augmentations used
+
+
Hyperparameter
Value
Hyperparameter
Value
Initial temperature
0.1
Hidden units per each layer
1024 (DMControl), 256 (Meta-world)
Learning rate
0.001
Batch Size
1024 (DMControl), 512 (Meta-world)
0.0005 (walker)
Optimizer
Adam
Critic target update freq
2
Critic EMA τ
0.005
(β1, β2)
(.9, .999)
Discount γ
.99
+
+Table 2: Hyperparameters of the SAC algorithm. We use similar hyperparameter configurations as in (Lee et al., 2021; Park et al., 2022)
+
+and the performance of PEBBLE+SURF varies rapidly. We used a limited amount of augmentations and pseudo-labels for a fair comparison. However, increasing the quality and amount significantly can improve the performance of PEBBLE+SURF. Hence, naturally leveraging augmentations in our unified framework with PARL will be an interesting direction of future research. We observed the effect of augmentation much more significant in DM-Control Suite than in MetaWorld. For the implementation, we have leveraged standard repositories like Torchopt (or BOML in Tensorflow) which are widely used to evaluate the meta gradient. We have also leveraged first-order approximate algorithms for performing and replicating our results, which improves the computation traceability. A rigorous and thorough evaluation of multiple other environments remains a scope for future study.
+
+# K ADDITIONAL EXPERIMENTAL DESCRIPTIONS
+
+In this section, we describe the environmental setup and configurations leveraged in the experiment with more specific details. To demonstrate the performance of our algorithm we primarily leverage 4 environments (two Locomotion and two manipulation) from DM-control Suite ((Tassa et al., 2018) and Meta World (Yu et al., 2021) in the human preference-based RL setting as also in (Christiano et al., 2017; Lee et al., 2021; Park et al., 2022). First, we describe the environments for the same
+
+- Walker (Tassa et al., 2018) This is a bipedal walker introduced in (Lillicrap et al., 2015) and later leveraged with some modifications in (Tassa et al., 2018) where the objective of the agent is to move forward as quickly as possible without falling down or pitching the torso too far forward or backward and the reward is a combination of the above.
+- Cheetah (Tassa et al., 2018) Cheetah or Half-Cheetah as introduced by (Wawrzyński, 2009) is a 6 degrees of freedom planar robot composed of nine links, eight joints, and two paws where angles of the fourth and the fifth joint are fixed while others are controllable. The objective is to make the cheetah run as fast as possible and the reward is directly proportional to its forward velocity but only up to a speed threshold. Later, this was leveraged in the (Tassa et al., 2018) with minor modifications.
+- Door Open and Button Press (Yu et al., 2021): These are taken from the (Yu et al., 2021) suite of 50 diverse simulated manipulation tasks all of which are contained in a shared, table-top environment with a simulated Sawyer arm. For the Door open environment, the objective of the agent is to control the robotic arm to open a door with a revolving joint for randomized door positions. Similarly, for Button press, the objective of the agent is to control the arm to press a button for randomized button positions. button is random
+
+Design Simulated Human Feedback. Although it would be ideal to evaluate the real-world effectiveness of our algorithm based on actual human feedback, for simulation and comparisons on benchmark it is hard to collect a large amount of human feedback. Hence, to emulate human feedback, we leverage simulated human teachers as used in prior research (Lee et al., 2021; Park et al., 2022), whose preferences are based on ground-truth reward functions which help us to evaluate the agent efficiently. Next, we discuss simulating human preferences using the ground-truth reward model as in (Lee et al., 2021).
+
+Let's say $r^*(s, a)$ represents the ground-truth reward function for state-action $s$ , $a$ in the environments as discussed above based on the objectives, which are known to us. Now, the perfectly rational and
+
+
+(a) Walker
+
+
+
+
+(c) Door Open
+
+
+(b) Cheetah
+(d) Button Press
+Figure 5: Figure demonstrates the visual representation of the environments considered in the experimental setup
+
+deterministic human behavior would result in trajectory preferences $(\tau_0, \tau_1)$ as
+
+$$
+y = \left\{ \begin{array}{l l} (1, 0) & \text {I f} \sum_ {t = 1} ^ {H} r ^ {*} \left(s _ {t} ^ {0}, a _ {t} ^ {0}\right) > \sum_ {t = 1} ^ {H} r ^ {*} \left(s _ {t} ^ {1}, a _ {t} ^ {1}\right) \\ (0, 1) & \text {o t h e r w i s e ,} \end{array} \right. \tag {136}
+$$
+
+where, superscript 0, 1 represents the state-action in the trajectory $\tau_0, \tau_1$ respectively. However, human preferences are not always deterministic or rational as discussed in (Lee et al., 2021). Hence, the stochastic preference model can be written as
+
+$$
+P \left[ \tau_ {0} > \tau_ {1}; \beta , \gamma \right] = \frac {\exp \left(\beta \sum_ {t = 1} ^ {H} \gamma^ {H - t} r \left(s _ {t} ^ {0} , a _ {t} ^ {0}\right)\right)}{\exp \left(\beta \sum_ {t = 1} ^ {H} \gamma^ {H - t} r \left(s _ {t} ^ {0} , a _ {t} ^ {0}\right)\right) + \exp \left(\beta \sum_ {t = 1} ^ {H} \gamma^ {H - t} r \left(s _ {t} ^ {1} , a _ {t} ^ {1}\right)\right)} \tag {137}
+$$
+
+where the preference model is the well-known Bradley Terry model (Bradley & Terry, 1952) $\gamma \in [0,1)$ is the discount factor and $\beta$ is the rationality constant. For example, $\beta \rightarrow \infty$ indicates a perfectly rational human, and $\beta = 0$ indicates a noisy/sub-optimal human producing random choices. To design further human-like teachers, various human behaviors like myopic behavior, mistakes, etc. are integrated while generating preferences as in Lee et al. (2021); Park et al. (2022).
+
+Now, as the preference-generating mechanism becomes clear, it is evident that the oracle reward in the plots indicates the ground truth $r^*$ generating the preferences. The upper-level objective deals with maximizing the likelihood of the human preferences received on the trajectories generated by the inner optimal policy under the current reward estimate. In all the environments, A-PARL achieves near-oracle performance in a much faster time. This highlights the importance of our bi-level framework, which considers the dependence (missing from existing literature) of distribution on the lower-level policy parameter during training the upper-level objective.
\ No newline at end of file
diff --git a/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/images.zip b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..72117ddc6bab8cd637ed11027bbf738f19f9f7e8
--- /dev/null
+++ b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ca9f3fca75dd438eabb8c55edb137de107ee78bc7dbdffc62ee3b350eaa30170
+size 2374871
diff --git a/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/layout.json b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8144bf97de3cb35b2f4db7cb2189fd11c76a2329
--- /dev/null
+++ b/parlaunifiedframeworkforpolicyalignmentinreinforcementlearningfromhumanfeedback/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:de7e7439af50aefa6f67fbb65c856e13d71b9917eee3fbc77c3079773a03e1a9
+size 1371834
diff --git a/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_content_list.json b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6875852c89da839fea554e8956697b8d6f46809b
--- /dev/null
+++ b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7894c0b2eb93fa24f8b820beff6fa6b2548b122b8cd79727b3c949d851b4a89d
+size 119491
diff --git a/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_model.json b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..824baa655d61f42b15d1fec2b9f701db8ec69f84
--- /dev/null
+++ b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9acf87fbef99c78ef8398bbf89dd086cd3f91c8a7905c644477c72ccf518849
+size 138401
diff --git a/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_origin.pdf b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..073f36204257f72df0c5546fcd6632f8b6e0f435
--- /dev/null
+++ b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/8a2962f0-1e5a-4efd-95d5-19b8bd87c31e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a4089266b9e48ac48ced731947d08cf610fa8767bc70afcffa8ace68025db9db
+size 3680443
diff --git a/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/full.md b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f4f228b3c363d08f09c64c42203042745e43e4d4
--- /dev/null
+++ b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/full.md
@@ -0,0 +1,550 @@
+# PARSING NEURAL DYNAMICS WITH INFINITE RECURRENT SWITCHING LINEAR DYNAMICAL SYSTEMS
+
+Victor Geadah1, The International Brain Laboratory, Jonathan W. Pillow1,2
+
+1Program in Applied and Computational Mathematics, Princeton University.
+$^{2}$ Princeton Neuroscience Institute, Princeton University.
+
+{victor.geaday, pillow}@princeton.edu, info@internationalbrainlab.org
+
+# ABSTRACT
+
+Unsupervised methods for dimensionality reduction of neural activity and behavior have provided unprecedented insights into the underpinnings of neural information processing. One popular approach involves the recurrent switching linear dynamical system (rSLDS) model, which describes the latent dynamics of neural spike train data using discrete switches between a finite number of low-dimensional linear dynamical systems. However, a few properties of rSLDS model limit its deployability on trial varying data, such as a fixed number of states over trials, and no latent structure nor organization of states. Here we overcome these limitations by endowing the rSLDS model with a semi-Markov discrete state process, with latent geometry, that captures key properties of stochastic processes over partitions with flexible state cardinality. We leverage partial differential equations (PDE) theory to derive an efficient, semi-parametric formulation for dynamical sufficient statistics to the discrete states. This process, combined with switching dynamics, defines our infinite recurrent switching linear dynamical system (irSLDS) model class. We first validate and demonstrate the capabilities of our model on synthetic data. Next, we turn to the analysis of mice electrophysiological data during decision-making, and uncover strong non-stationary processes underlying both within-trial and trial-averaged neural activity.
+
+# 1 INTRODUCTION
+
+Parsing behavioral and neural dynamics into simpler alternating states is providing unprecedented insights into the nature of computation in the brain (Wiltschko et al., 2015; Calhoun et al., 2019; Ashwood et al., 2022; Bolkan et al., 2022). Such data, conventionally collected over multiple trials and spanning considerable lengths of time, is often related to latent processes that exhibit complex dynamics across multiple timescales (Cowley et al., 2020; Roy et al., 2021; Nassar et al., 2019; Yu et al., 2009). Learning is one important example of such non-stationarity, but other changes may be present, such as fatigue (Marcora et al., 2009) or arousal (Schriver et al., 2018). However, inferring those latent processes from data, either within or across trials, remains challenging.
+
+The state-space models that perform this segmentation into discrete states commonly revolve around the hidden Markov model (HMM). This model posits an underlying, hidden, discrete Markov chain, with a different observation model for each state giving rise to the data. Each discrete state can also be extended to capture a different dynamical regime, governing the dynamics of some continuous-space stochastic process. The resulting switching state-space models capture activity that alternate between a discrete set of dynamical regimes, and have proved useful in the modeling of complex nonlinear activity (Fox et al., 2010; Smith et al., 2021). A significant step in capturing online dependencies in such models is through recurrence (Linderman et al., 2016; Zoltowski et al., 2020), where the continuous dynamical variables govern switches between the discrete states. Such models have been providing powerful insights into the time-dependence of those processes (e.g. Glaser et al. (2020)), but suffer from training challenges due to the fixed cardinality of the discrete states and a lack of geometry over states.
+
+Indeed, traditional HMMs, and models built upon them such as switching state-space models, use a fixed number of discrete states. This fixed cardinality is typically determined by cross-validation, a
+
+procedure that can prove computationally expensive. Furthermore, it does not encourage the use of fewer discrete states on any subset of trials or sessions, so that they can be interpreted and determined as needed. To overcome these limitations, multiple avenues have considered expending HMMs with flexible state cardinality (Beal et al., 2001; Fox et al., 2011). These models revolve around the Hierarchical Dirichlet Process (HDP), which places a flexible non-parametric prior over the transition probabilities between the (theoretically infinite) states. Unfortunately, while the HDP and its generalizations can capture state dependence and persistence (Teh et al., 2006; Fox et al., 2008), in their standard formulation they do not allow for recurrence and other dependencies between the discrete states allocations.
+
+Furthermore, HMMs do not have any a priori state geometry. In particular, the discrete states are permutation invariant, such that the model is equivalent under any permutation in the label ordering of the discrete states (see schematic in Appendix Fig. 4B). This induces non-identifiability and limits the interpretability of the inferred latent discrete states. While recent work has focused on variability in discrete dynamical regimes (Nassar et al., 2019; Linderman et al., 2019; Costacurta et al., 2022) yielding impressive results in terms of flexibility, most of these can be cast as "local" variations; they consider perturbations or parametrized variations of the parameters associated with each discrete states. To our understanding, none specifically tackle the geometric nature of the discrete states space.
+
+In this work, we use partial differential equations (PDE) theory to develop an alternate prior over the discrete state transitions in recurrent switching state-space models. Our formulation allows us to (1) capture important properties of the stochastic processes for flexible state cardinality, while supporting the use of recurrent connections, (2) induce a geometry over the discrete states, and (3) induce semi-Markovian discrete states dynamics to capture more intricate temporal dependencies. After reviewing relevant background in Section §2, we present in Section §3 our model, the infinite recurrent switching linear dynamical system (irSLDS), and provide details on its generative formalism and inference procedure. In Section §4, we first validate the model on synthetic data and showcase its properties, before turning to mice electro-physiology data from the International Brain Laboratory (IBL). The PDE prior is defined by less parameters than the traditional HMM-based transitions model, yet we show that it maintains or even outperform the traditional model while offering an interpretable structure that is amenable to uncovering trial-varying structure.
+
+# 2 BACKGROUND
+
+We review in this section the key models considered in this work. We consider time-stamped data $\{(t_n, \pmb{y}_n)\}_{n=1}^T$ with time steps $t_n$ and data $\pmb{y}_n \in \mathbb{R}^M$ .
+
+# 2.1 SWITCHING LINEAR DYNAMICAL SYSTEMS
+
+Hidden Markov Models (HMM) posit an underlying discrete-state Markov chain with states $z_{n} \in \{1, \dots, K\}$ , and conditionally independent observations $p(\pmb{x}_n | z_n)$ . Auto-regressive HMMs (AR-HMM) extend this framework by endowing the observations $\pmb{x}_n \in \mathbb{R}^D$ with linear dynamics, dependent on the discrete state $z_{n}$ . The generative model reads as
+
+$$
+z _ {n + 1} \sim P \left(z _ {n + 1} \mid z _ {n}, n, \boldsymbol {x} _ {n}\right) \tag {1}
+$$
+
+$$
+\boldsymbol {x} _ {n + 1} \sim \mathcal {N} \left(A ^ {\left(z _ {n}\right)} \boldsymbol {x} _ {n} + a ^ {\left(z _ {n}\right)}, \Sigma_ {x}\right) \tag {2}
+$$
+
+at time $n \in \{0, \dots, T\}$ , with a different set of dynamics $A^{(z_n)} \in \mathbb{R}^{D \times D}$ and bias $a^{(z_n)} \in \mathbb{R}^D$ for each discrete state $z_n$ , and covariance $\Sigma_x$ . The switching process in (eq. 1) is described by a transition matrix, written in full generality, but is usually taken to be time- $(n)$ and observation $(\pmb{x}_n)$ independent such that $P(z_{n+1} = j \mid z_n = i) = A_{ij}$ for some transition matrix $A$ .
+
+In this work, we are interested in leveraging those models to study possibly high-dimensional data $y_{n} \in \mathbb{R}^{M}$ , $M \geq D$ , such as spike train data. We thus turn to Switching Linear Dynamical Systems (SLDS) models, which model the AR-HMM observations $x_{n}$ as a (low-dimensional) representation of the data, and model the data $y_{1:T}$ as conditionally independent linear Gaussian emissions
+
+$$
+\boldsymbol {y} _ {n} \sim \mathcal {N} \left(C \boldsymbol {x} _ {n} + c, \Sigma_ {y}\right) \tag {3}
+$$
+
+for $n\in \{0,\ldots ,T\}$ , with decoding weights $C\in \mathbb{R}^{M\times D},c\in \mathbb{R}^{M}$ , and emission covariance $\Sigma_y$ . Finally, inputs $\pmb{u}_n$ , e.g. the time steps $t_n$ , may be linearly encoded in the continuous dynamics (eq. 2)
+
+or directly along with the emissions in (eq. 3). Following Fox et al. (2010), we refer to AR-HMM and SLDS models as instances of Markov switching processes, or generally switching state-space models.
+
+A vital augmentation of Markov switching processes is to allow observations or internal states to guide the switches in discrete states. Linderman et al. (2016) introduced such a $\boldsymbol{x}_n \to z_{n+1}$ dependency (blue arrows in Fig. 1E) in the SLDS model class, coining it recurrence. Now in the recurrent SLDS (rSLDS), in place of the general equation in eq. (1), the continuous states $\boldsymbol{x}_n$ guide the switching through
+
+$$
+z _ {n + 1} \mid z _ {n}, \boldsymbol {x} _ {n} \propto R ^ {(z _ {n})} \boldsymbol {x} _ {n} + r ^ {(z _ {n})}
+$$
+
+for recurrent encoding matrices $R^{(\cdot)}\in \mathbb{R}^{K\times D}$ and biases $r^{(\cdot)}\in \mathbb{R}^K$ . This is the central model we consider in this work--see Fig. 1E for the graphical model.
+
+# 2.2 DISTANCE DEPENDENT CHINESE RESTAURANT PROCESS
+
+The switching process in (eq. 1) sets the discrete dynamical modes of the continuous dynamics. Modeling and inferring trajectories under this process amounts to the problem of clustering the dynamics in a discrete set of dynamical modes. As stated in the introduction, we wish to infer the number of states $K$ from the data, contrary to the formulation above. Dirichlet Processes (DP) are a classical tool in this case, as they provide an infinite random measure over cluster partitions (Ferguson, 1973; Antoniak, 1974). They can be described by the Chinese Restaurant Process (CRP, a form of Pólya urn process, see primer in Appendix §A), which captures the self-reinforcing and non-parametric structure of the prior. A key limitation is that points under the CRP are exchangeable (Blei & Frazier, 2011) (see schematic in Appendix Fig. 4A)—under any permutation of the ordering, the probability of a configuration is the same. The purpose of recurrence is to actively control the dynamical mode transition, which fundamentally breaks exchangeability.
+
+We seek a stochastic process over discrete state partitions that will allow us to capture recurrent (i.e. online) dependencies on the data or latent states. To this end, we turn to the distance dependent CRP (dist-CRP) from Blei & Frazier (2011). This variant of the CRP breaks exchangeability by associating each time step to another, and then perform clustering based on pairwise assignments. Specifically, at time step $n$ , this process assigns time step $i \in [n]$ with $c_{i} \in [n]$ following
+
+$$
+p \left(c _ {i} = j \mid D, \alpha , \beta\right) \propto \left\{ \begin{array}{l l} f \left(D _ {i j}; \beta\right) & \text {i f} i \neq j \\ \alpha & \text {e l s e} \end{array} \right. \tag {4}
+$$
+
+with distance matrix $D_{ij}$ , decay function $f(\cdot ;\beta)$ and decay parameter $\beta > 0$ . As we consider time-stamped data, we consider the time difference $D_{ij} = t_i - t_j$ for $i \geq j$ , and enforce that no step is assigned with future steps by setting $f(D_{ij}) = 0$ if $i < j$ . Finally, we use the entire history $c_{:n} = \{c_{:n-1}, c_n\}$ of pairwise assignments to perform clustering: if $c_i = c_j$ , then $i$ and $j$ are in the same cluster $z_i$ . Applying this to the history $c_{:n}$ , we get $z_{:n}$ , thereby setting $z_n$ . The graphical model for this process is illustrated in Fig. 1A.
+
+# 3 INFINITE RECURRENT SWITCHING LINEAR DYNAMICAL SYSTEMS
+
+Our technical contribution consists in using key properties of the dist-CRP to guide the switching process in the rSLDS in a manner that supports efficient inference and generation. Section §3.1 presents the pitfalls of a naive combination, providing details on how conventional methods relying on Pólya-gamma augmentation yield intractable Bayesian inference in this case. Section §3.2 motivates our alternative approach to modeling based on sufficient statistics and partial differential equations (PDEs), and highlights key non-exchangeable and geometrical properties of our model. Finally, Section §3.3 provides implementation details for both generation and inference.
+
+# 3.1 PÓLYA-GAMMA AUGMENTATION YIELDS INTRACTABLE INFERENCE
+
+Pólya-gamma augmentation (Polson et al., 2013; Linderman et al., 2015) is a powerful augmentation strategy that handles non-Gaussian factors by introducing additional latent variables to obtain joint Gaussian likelihoods. It was used in the original formulation of the rSLDS model by Linderman et al. (2016) to allow tractable inference with message passing. We show in Appendix §C.1 that
+
+
+A Distance Dependent CRP
+
+
+F Infinite Recurrent Switching LDS
+
+
+
+
+E Recurrent Switching LDS
+
+
+Figure 1: Modeling details. (A) Graphical model for the distance dependent CRP (dist-CRP) in its conventional form. (B) The generative process of the dist-CRP can be summarized with a sufficient statistic $\mathbf{w}(j,t)$ for state $j$ at time $t$ , showcasing a typical choice-driven exponential decay. (C) We induce a geometry over the state space $j \in \mathcal{I}$ , and add a spatial smoothness prior. (top) Each time a state is chosen (red bar), its probability is increased for future steps and so is the probability of nearby states. (D) Modeling the influence function $\mathbf{w}(j,t)$ as a solution to the heat equation. (E) Graphical model for the recurrent switching linear dynamical system (rSLDS). The recurrence is highlighted by the blue arrows. (F) The infinite rSLDS model combines the heat-equation generalization of the dist-CRP for the discrete states with the rSLDS switching linear dynamics emission process. (G) The irSLDS discrete state prior better supports geometric analyses (top) and a variable number of occupied states (bottom).
+
+
+
+for appropriate choices of decay function $f$ , we can also leverage Pólya-gamma augmentation to similarly handle the non-Gaussian factors emerging from recurrence. However, the resulting Gaussian augmentation grows linearly for each step $n$ , making it computationally inefficient. Luckily as we'll see below, we can use sufficient statistics and recurrent dynamics to circumvent this problem.
+
+# 3.2 PDE PRIOR FOR EFFICIENT PARAMETRIZATION AND NON-EXCHANGEABILITY
+
+To remedy the challenges arising out of a naive combination of the original dist-CRP and SLDS models, we rely on the following sufficient statistic to express the cluster allocations
+
+$$
+p \left(z _ {n} = j \mid \mathbf {c}: n, \alpha , \beta\right) = p \left(z _ {n} = j \mid \mathbf {w} (\cdot , t _ {n}), \alpha , \beta\right) \propto \left\{ \begin{array}{l l} \mathbf {w} (j, t _ {n}; \beta) & \text {i f} j \text {i n h i s t o r y} \\ \alpha & \text {e l s e} \end{array} \right. \tag {5}
+$$
+
+where $\mathbf{w}(j,t)$ denotes the influence function of state $j$ at time $t$
+
+$$
+\mathbf {w}: \mathcal {J} \times \mathbb {R} _ {+} \rightarrow \mathbb {R} _ {+}, \quad \mathbf {w} (j, t) = \sum_ {\{i: t _ {i} \leq t, z _ {i} = j \}} f (t - t _ {i}; \beta)
+$$
+
+with distance function $f(\cdot ;\beta)$ and decay parameter $\beta >0$ . Using this sufficient statistic makes the entire process Markovian. Setting $f(x;\beta) = \kappa \exp (-\beta x)$ to be an exponentially decreasing function, notice that we can rewrite $\mathbf{w}(j,t)$ above as a solution to the continuous time ODE
+
+$$
+\frac {\partial}{\partial t} \mathbf {w} (j, t) = - \beta \mathbf {w} (j, t) + \kappa \mathbf {1} _ {\{z _ {n} = j \}}, \quad \forall j \in \mathcal {J} \tag {6}
+$$
+
+with càdlàg trajectories $\mathbf{w}(j,t)$ in time $t$ . Each time $t_n$ a discrete state $z_{n} = j$ is chosen, its influence function is bumped by $\kappa >0$ , increasing the weight of this state for future time steps (see Fig. 1B). This has a similar effect as the "stickiness" parameter in the sticky HDP-HMM (Fox et al., 2008).
+
+In practice, we need to evolve in parallel the influence functions $\mathbf{w}$ for each state $j$ . For any fixed $t$ , we make the modeling choice of relating these states to one another by using a smoothness prior (see Fig. 1C). Inspired by the temporal dynamics in (eq. 6), we model the sufficient statistic to evolve according to a partial differential equation (PDE), the heat equation (see Fig. 1)
+
+$$
+\frac {\partial}{\partial t} \mathbf {w} (j, t) = \gamma \frac {\partial^ {2}}{\partial j ^ {2}} \mathbf {w} (j, t) \tag {7}
+$$
+
+with diffusion coefficient $\gamma > 0$ and with initial conditions for $t \geq t_n$
+
+$$
+\mathbf {w} (\cdot , t _ {n}) = \lim _ {t \uparrow t _ {n}} \mathbf {w} (\cdot , t) + \kappa \mathbf {1} _ {z _ {n}}, \quad \mathbf {w} (\cdot , 0) = \mathbf {0}
+$$
+
+over the state space $j \in \mathcal{J}$ . While many alternate priors could offer a form of spatial smoothness with similar temporal dynamics, we choose the heat-equation for several reasons:
+
+1. The temporal dynamics encompass the dist-CRP. Indeed, by standard separation of variables argument, the temporal component of a solution $\mathbf{w}$ to (eq. 7) exhibits the exponential decay desired in (eq. 6) for some appropriate $\beta >0$ .
+2. The spatial dynamics offer an intuitive notion of diffusion of probabilities. Each time a discrete state $j$ is chosen, "nearby" states also become more probable at the next time step (see Fig. 1C top).
+3. The heat-equation as a differential operator on functions possesses numerous linearity qualities, which makes general numerical behavior and approximations favorable.
+
+We stress the meaning of "nearby": in models based around an HMM, the states do not have an inherent geometry1. In comparison, here discrete states can be interpreted as points on a continuous state space $\mathcal{I}$ . We can restrain this space to a discrete number of states, and we discuss how to do so in practice in the next subsection.
+
+# 3.3 IMPLEMENTATION AND INFERENCE IN INFINITE RECURRENT SLDS
+
+We proceed by describing some of the implementation implications of the PDE prior presented in the previous section. We assume from now on regularly-sampled data in time, of difference $\Delta t$ , and drop the inclusion of the time data $t_n$ to only consider the emissions data $\mathbf{y}_n$ . The code for this work builds on the SSM package (Linderman et al., 2020), and we present in Appendix C.2 the relevant modules.
+
+PDE prior implementation with finite difference methods We use finite difference methods to implement a sufficient statistic $\mathbf{w}$ solving the heat-equation prior. Let $[\pmb{w}_{n + 1}]_{j + 1} \coloneqq \mathbf{w}(j + \Delta j, (n + 1)\Delta t)$ be our discrete approximation. We use a forward difference of the time derivative and central difference approximation to the second order spatial partial derivative to obtain the solution
+
+$$
+\boldsymbol {w} _ {n + 1} = U \boldsymbol {w} _ {n}, \quad U = \operatorname {t r i d i a g} (\beta , 1 - 2 \beta , \beta) \in \mathbb {R} ^ {K \times K}
+$$
+
+where $\beta = \gamma \frac{\Delta t}{\Delta j^2}$ . We impose $\Delta t \leq \frac{(\Delta j)^2}{4\gamma}$ as a general requirement for stability, and let $\Delta j$ be adjusted accordingly given $\gamma$ (model parameter) and $\Delta t$ (data parameter). Inputs can be added to drive the system, including (1) the desired $\kappa \mathbf{1}_{z_n = j}$ adding self-reinforcement to the system, and (2) the past internal states encoded by a module of weight $R \in \mathbb{R}^{K \times D}$ and bias $r \in \mathbb{R}^K$ for recurrence. The dimension $K$ of $\boldsymbol{w}_n \in \mathbb{R}^K$ is a fixed hyperparameter. Importantly, however, the heat equation dynamics capture properties of the dist-CRP, such that $K$ rather acts as an upper bound on the parsimonious number of states used per trajectory. In all, the dynamics of $\boldsymbol{w}_n$ follow
+
+$$
+\boldsymbol {w} _ {n + 1} \mid \left\{\boldsymbol {w} _ {n}, \boldsymbol {x} _ {n}, z _ {n} = i \right\} = U \boldsymbol {w} _ {n} + \kappa \mathbf {1} _ {i} + R \boldsymbol {x} _ {n} + r \tag {8}
+$$
+
+with parameters of diffusion and decay $\gamma \propto \beta > 0$ and self-reinforcement $\kappa \in \mathbb{R}$ . The $j$ -th entry of the vector $\boldsymbol{w}_{n+1}$ in (eq. 8) defines, up to a necessary row-normalization factor, the $ij$ -th entry of our transition matrix $[W_{n+1}]_{ij}$ . Dynamical modes $z_{n}$ are then sampled according to (eq. 5), with final random transition parameter $\alpha > 0$ . Now a few scalar parameters $\{\alpha, \gamma, \kappa\}$ govern the discrete state $z_{n}$ process, contrasting with the $K \times K$ matrix in the rSLDS. In all eqs. (8, 5) with the switching continuous dynamics in (eq. 2) and emissions in (eq. 3) together define the infinite recurrent SLDS (irSLDS, see graphical model in Fig. 1F). We refer to Appendix §D.3 for a study of the behavior of the model as we scale $K$ , the influence of $\{\alpha, \gamma, \kappa\}$ , and the values used for the latter.
+
+Inference with variational Laplace-EM The added sufficient statistic $\boldsymbol{w}_n$ in (eq. 8) is deterministically determined given $z_{n - 1}$ and $\pmb{x}_{n - 1}$ , thus adds no component to the posterior inference. We follow prior work and perform inference in this model using variational Laplace-EM from Zoltowski et al. (2020). As an overview, we posit the same structured mean-field approximation $q(\pmb{z}_{1:T})q(\pmb{x}_{1:T})$ to the states posterior. For our continuous states posterior, we use a Laplace approximation around the most likely path $\hat{\pmb{x}}_{1:T}$ (Paninski et al., 2009). Given a continuous states trajectory under this posterior, the transition matrices $W_{1:T}$ can be computed to define our model joint $p(\pmb{y}_{1:T},\pmb{z}_{1:T},\pmb{x}_{1:T})$ . From there, the discrete state posterior approximation is found by locally maximizing the expected model joint under the continuous state posterior. Generally, conditioned on samples $\pmb{x}_{1:T}$ , the factor graph for our $\pmb{z}$ posterior is equivalent to that of an heterogeneous HMM. Common tools can then be used, such as importantly the Viterbi algorithm to obtain the most likely discrete state sequence $\hat{\pmb{z}}_{1:T}$ conditioned on $\hat{\pmb{x}}_{1:T}$ , which we will consider below.
+
+Discrete state geometry The support of $w_{n}$ is taken to be the set $\{\Delta_j, 2\Delta_j, \dots, K\Delta_j\}$ , which lives on the latent geometry $\mathcal{J}$ used in our PDE formalism. In this work we consider one possible way to leverage this geometry: to define intermediate states. Indeed, the continuity of $\mathcal{J}$ allows for interpolation between states. From any distribution on our discrete states $z_{n} \in \{1, \dots, K\}$ , or continuous interpolation thereof, one can define different statistics of interest such as the mean or the mode. Such statistics can take continuous values in $\mathcal{J}$ , and are ill-defined for traditional HMM-based models due to permutation invariance. In particular, given the most likely sequence $\hat{z}_{1:T}$ and our posterior $q(z_{n+1} \mid z_{n}, x_{n})$ with interpolation function $\tilde{q}$ over $\mathcal{J}$ , we will consider the interpolated sequence $\tilde{z}_{1:T}$ as the interpolated posterior modes
+
+$$
+\tilde {z} _ {n} = \underset {z \in \mathcal {J}} {\arg \max } \tilde {q} (z _ {n} = z \mid \hat {z} _ {n - 1}, \hat {\boldsymbol {x}} _ {n - 1}), \quad n \in \{1, \dots , T \}, \tilde {z} _ {0} = \arg \max \tilde {q} (z _ {0}) \tag {9}
+$$
+
+Parallelizing transition matrix dynamics with scans In both generation and inference, the core computational difference in terms of complexity between the irSLDS and the (r)SLDS models is that the transition matrix $W_{n}$ for the discrete states $z_{n}$ now possesses its own recurrent dynamics (from eq. (8), see Appendix eq. (13)). While the (r)SLDS models also have time-varying transition matrices, they do not have such a recurrent term. To illustrate the difference, considering eq. (8) for row $i$ of the transition matrix $W_{n}$ , the equivalent notation for the rSLDS would be
+
+$$
+\pmb {w} _ {n + 1} \mid \{\pmb {x} _ {n}, z _ {n} \} = [ \pmb {w} _ {0} ] _ {z _ {n}} + R \pmb {x} _ {n} + r.
+$$
+
+Computing the $z_{n}$ transition matrices in the rSLDS thus amounts to the cost of encoding the continuous state sequence $x_{1:T}$ , which can be distributed over different processors. In comparison, we are forced to compute sequentially the transition matrices statistics $W_{n}$ , naively taking $\mathcal{O}(K^3 T)$ operations in addition to the sequential encoding of $x_{1:T}$ . Fortunately, notice that the dynamics (Appendix eq. 13) are linear. In this case, as presented by Blelloch (1990), computing the transition matrices can be cast as a scan operation (see Smith et al. (2023) for a recent application of this concept). With this, we can efficiently parallelize our transition matrix dynamics and reduce the computation to $\mathcal{O}(K^3 (T / L + \log L))$ operations over $L$ processors, resulting in similar time complexity as the rSLDS model. We refer to Appendix C.2 for code and more details on our use of the parallel scan.
+
+# 4 EXPERIMENTS
+
+We train models by maximizing the Evidence Lower Bound (ELBO) using variational Laplace-EM from Zoltowski et al. (2020). We compare model performance using the marginal log likelihood (LL)
+
+$$
+\log p (\tilde {\boldsymbol {y}} _ {1: T}) = \int p (\tilde {\boldsymbol {y}} _ {1: T} | \boldsymbol {x} _ {1: T}, \boldsymbol {z} _ {1: T}) p (\boldsymbol {x} _ {1: T}, \boldsymbol {z} _ {1: T}) d \boldsymbol {x} _ {1: T} d \boldsymbol {z} _ {1: T},
+$$
+
+which is the log-probability of held-out test data $\tilde{y}_{1:T}$ under a given model, where test data arises from a 4:1 train-to-test split of the full dataset (see details in Appendix §B). The required integral is high-dimensional and intractable, and we thus resort to sequential Monte Carlo (SMC), also known as particle filtering, to compute it (Del Moral et al., 2006; Kantas et al., 2009).
+
+# 4.1 VALIDATION ON THE SYNTHETIC NASCAR TASK
+
+We consider the synthetic NASCAR task as used by Linderman et al. (2016). In the original task, the true underlying model is a rSLDS with $K = 4$ states, dissecting the 2-D state space in four
+
+
+
+
+C Continuous states $x$ , posterior mean
+
+
+D Sample $x_{t}$ -NASCAR
+
+
+Figure 2: Synthetic NASCAR experiments. (A-B) True flow field for the NASCAR task in A. The extended NASCAR task alternates between the flow field in A and the extended flow field in B. (C) Mean continuous trajectories $\hat{x}_{1:T}$ under the variational Laplace posterior, per task. (D-E) Sample continuous latent states $x_{1:T}$ trajectories per model (NASCAR in D, extended NASCAR in E). (F) Most likely discrete state trajectories $\hat{z}_{1:T}$ for the rSLDS (top) and irSLDS (ours, bottom) for one data trajectory in the extended NASCAR task (color scheme matches E), along with the interpolated sequence $\tilde{z}_{1:T}$ (eq. 9) in black for the irSLDS.
+
+
+Extended NASCAR
+
+Table 1: Performance metrics on NASCAR experiments. We report the marginal log-likelihood on test data (Test LL), evaluated with SMC. Test data-sets consist of $T = 200$ excluded steps in NASCAR, and excluded trajectory of $T = 1000$ steps in extended NASCAR. Column values for $K$ denote value set for the model. We also report the dynamical mean-square error (Dyn. MSE) between the sample $x$ state-space flow and true flow field. See Appendix Table 2 for dynamical MSE error bars and number of parameters.
+
+
Model
NASCAR
Extended NASCAR
Test LL (↑)
Dyn. MSE (↓)
Test LL (↑)
Dyn. MSE (↓)
K=4
K=8
K=4
K=8
K=6
SLDS
1331.35
1592.81
0.930
305.046
7353.22
316.75
rSLDS
1628.57
1613.53
0.010
0.011
8015.93
0.35
irSLDS (ours)
1656.10
1611.45
0.015
0.011
8219.41
0.24
+
+quadrants with rotational and bias dynamics (see Fig. 2A). The resulting continuous latent states $\mathbf{x}_n$ resemble car tracks on a NASCAR driving track (see Fig. 2C-left for corresponding mean posterior estimates under variational Laplace-EM), and the data is obtained from high-dimensional ( $N = 10$ ) Gaussian emissions of the $\mathbf{x}_n$ dynamics. We compare the irSLDS against the rSLDS and SLDS models, presenting results over 5 random initialization seeds.
+
+First, we found both our model, the irSLDS, and the true generative model, the rSLDS, to be similarly able to generate accurate samples of the dynamics (see Fig. 2D). In terms of performance on held-out time steps of the trajectory $(T = 200)$ , both models attained similar accuracy (see Tab. 1). The irSLDS attained the higher mean on the true number of states $K = 4$ , and both models performed similarly for the over-complete $K = 8$ . The SLDS however did not perform as well, as to be expected—this NASCAR task was introduced to test the inclusion of recurrence in the rSLDS,
+
+compared to the standard SLDS. While the SLDS model attained relatively high test LL (see Tab. 1), it struggled to accurately depict the true dynamics (see Fig. 2D-left). We refer to this generating process accuracy as dynamical accuracy, which we quantify by reporting the mean squared error (MSE) between the learned dynamics and the true, available, dynamics. We minimize the MSE over reflections and rotations of the learned dynamics field. The SLDS model showed poor dynamical accuracy (see Tab. 1), while the irSLDS matched the accuracy of the true rSLDS. In all, this validates the incorporating of recurrence into our model, and furthermore provides evidence that the PDE prior can mimic the performance and generative capabilities of the fully-trained HMM prior.
+
+The original NASCAR task has a periodic temporal structure (a property unchanged by permutation invariance) with a constant number of required states $K$ both stationary properties. Before turning to our target experimental data, we assess the handling of non-stationary challenges by considering an extended NASCAR task. In this new task, the dynamics alternate between the original dynamics (Fig. 2A) and a set of new extended dynamics (Fig. 2B) where two additional bias dynamics are introduced. This effectively changes the true number of discrete states from $K = 4 \rightarrow 6$ during this extended dynamics block. We consider $B \in \{2,3\}$ blocks of alternating dynamics, each of same expected block lengths $T / B$ . In this new task, we found the irSLDS to outperform the rSLDS, in turn outperform the SLDS (Tab. 1). Looking into the learned solutions for the rSLDS and irSLDS models, we observe that the sample trajectories (Fig. 2E) in the irSLDS more closely match the posterior mean from data. Furthermore, the irSLDS model correctly identifies two new states after the switch (see Fig. 2F-bottom). Interestingly, the posterior ends up attributing these two states to be in between previous states, such that the sequence of discrete states exhibits this traversing trajectory. In contrast, the rSLDS model mistakenly maintains only 4 active states after the switch to the alternate dynamics (Fig. 2F-top). Together, this provides evidence for the performance of the irSLDS in non-stationary tasks and an example on how we can leverage the discrete state geometry of the irSLDS.
+
+# 4.2 THE IRSLDS UNCOVERS TRIAL-VARYING STRUCTURE IN NEURAL DYNAMICS REGIMES
+
+Next, we turn our attention to an electrophysiological dataset from the International Brain Laboratory (IBL), recorded in mice during a sensory-motor decision-making task. In this task, mice reported the location of a sinusoidal grating stimulus by turning a wheel either left or right, with task difficulty controlled by stimulus constraint (Fig. 3A) (Laboratory et al., 2021). We consider Neuropixels probe recordings from the "Brainwide map" data release (Laboratory, 2022). For our analyses, we projected spike train data onto the top principal components to obtain firing rates, making it amenable to analysis by state-space models with Gaussian emissions (Fig. 3B-C) (further methodological and data details can be found in Appendix §B, including firing-rate and continuous latent dimensions). As the irSLDS directly expands on the rSLDS, we focus on comparing these two models in this section. We picked $K = 8$ discrete states (see Appendix Tab. 3 for test marginal LL values for $K \in \{2,4,8\}$ ).
+
+First, we found that the models uncovered discrete latent states that switched at task-relevant event times. Indeed, we did not provide the models with task event times such as the stimulus onset ("Stim On") or reward, or behavioral measurements such as the movement onset time ("First movement"). Given that a task event occurred at time step $t$ , we plot in Fig. 3D the estimated probability of a switch a time-step $t + l$ for a lag $l$ ( $p(\mathrm{switch}_{t + l}|\mathrm{event}_t)$ ), for the irSLDS. We compare this against the baseline probability $p(\mathrm{switch}_t)$ , obtained by trial shuffling. The models learned task switches significantly different from chance, capturing a switch in discrete states either preceding or following a relevant task event. We thus posit that the statistical models capture relevant dynamics for the tasks.
+
+Second, we found that the irSLDS uncovered differences in the discrete state distribution over trials. In Fig. 3E we plot the number of active states used in the most likely $\hat{z}_{1:T}$ trajectories under the variational posterior. We fit a spline function to this data for both models, determined from the minimal $p$ -value of the $F$ -test for a comparison against a constant function (computed over various degrees of smoothness and degree). While both models differed significantly from a constant function ( $p \ll 0.001$ ), the irSLDS uncovered larger fluctuations in the number-of-discrete-states-per-trial curve. Fluctuations were much smaller for the rSLDS model, and the spline provided a poorer fit ( $R^2$ of 0.16 vs. 0.46 for irSLDS). This indicates that discrete state distribution over trials fluctuated more dramatically and systematically under the irSLDS model, with substantially more discrete states used in the middle of the session than at the beginning or end. The irSLDS attained a slightly higher log-likelihood on held-out test trials (see Tab. 3), so in all this indicates that those fluctuations are important, and might be missed by traditional HMM-based priors.
+
+
+
+
+
+
+
+
+Trial-level modeling
+
+
+
+
+Figure 3: Results on neural electro-physiology data from the IBL. (A) Experimental paradigm in the IBL task, taken from Laboratory (2022). See text for further details. (B) Example spike train data, plotting spike times per neuron, for one trial in one session. (C) The trial in B, pre-processed with kernel smoothing and PCA, along with relevant trial events. (D) Switching probability as a function of the time-step difference (lag $l$ ) for two key trial events, either conditioning on the event happening at lag 0 ("conditional", black), or without conditioning ("baseline", gray). (E) Number of actives states occupied by most likely discrete states trajectories per trial. Curve fits, either constant of spline, are plotted against the number of states per trial in gray. The $R^2$ for the spline fit is indicated top right. (F) Most likely discrete states $\hat{z}_{1:N_{\mathrm{trials}}}$ trajectories underlying per-trial average neural responses.
+
+
+
+To further investigate the task-induced neural activity, we turn from trial-level modeling to session-level modeling. Specifically, we focus on the average firing rate $\pmb{y}_t \in \mathbb{R}^D$ , averaging from 200ms before the stimulus onset to the reward, for each trial $n \in [N_{\mathrm{trials}}]$ . Fig. 3F shows the most likely discrete state sequences $\hat{z}_{1:N_{\mathrm{trials}}}$ under each model. Both models achieve similar training ELBO (see Appendix Tab. 3). We observe that the irSLDS showcases a distinctive slow geometric drift in the discrete states occupied, as observed from $\hat{z}$ and further solidified by the trace of the interpolated $\tilde{z}$ (defined in eq. 9). Finally, we note how the interpolation also indicates the presence of uncertainty between states 3 and 4 at the end of the session. Such conclusions cannot be drawn in the (r)SLDS, as any permutation of the discrete states yields an equivalent visualization of the discrete state process.
+
+# 5 CONCLUSION
+
+In this work, we extend recurrent switching state-space models with an input-driven heat-equation prior over the dynamics of the transition matrix. This results in a semi-Markov discrete state process that captures the behavior of stochastic processes on partitions for a variable number of states per trajectory, as well as inducing a continuous geometry on the discrete states. We show that while this process is defined by less parameters than the traditional HMM models, it still matches or outperforms the original model while providing insights into time-varying processes in data. We showcase the model on a synthetic task, before turning to electrophysiological data from the IBL. The IBL hosts extensive datasets covering multiple repeated- to brain-wide recordings (Laboratory et al., 2022; Laboratory, 2022), and the modeling presented here provides grounds for further investigation into the time-varying processes underlying neural data.
+
+# ACKNOWLEDGMENTS
+
+The authors would like to thank Rich Pang and David Zoltowski for helpful discussions and code suggestions early in the project. VG was supported by doctoral scholarships from the Natural Sciences and Engineering Research Council of Canada (NSERC) [PGSD3-557875-2021] and the Fonds de Recherche du Québec Nature et technologies (FRONT) [B2X 297667]. JWP was supported by grants from the Simons Foundation (SCGB AWD543027), the NIH (R01EY017366), the NIH BRAIN initiative (NS104899 and 9R01DA056404-04), and the CAREER award (IIS-1150186).
+
+# REFERENCES
+
+Charles E. Antoniak. Mixtures of dirichlet processes with applications to bayesian nonparametric problems. Ann. Statist., 2(6), nov 1974. doi: 10.1214/aos/1176342871. URL https://doi.org/10.1214%2Faos%2F1176342871.
+Zoe C. Ashwood, Nicholas A. Roy, Iris R. Stone, Anne E. Urai, Anne K. Churchland, Alexandre Pouget, and Jonathan W. Pillow and. Mice alternate between discrete strategies during perceptual decision-making. Nature Neuroscience, 25(2):201-212, February 2022. doi: 10.1038/ s41593-021-01007-z. URL https://doi.org/10.1038/s41593-021-01007-z.
+Matthew Beal, Zoubin Ghahramani, and Carl Rasmussen. The Infinite Hidden Markov Model. In T. Dietterich, S. Becker, and Z. Ghahramani (eds.), Advances in Neural Information Processing Systems, volume 14. MIT Press, 2001. URL https://proceedings.neurips.cc/paper/2001/file/e3408432c1a48a52fb6c74d926b38886-Paper.pdf.
+D. M. Blei and P. I. Frazier. Distance Dependent Chinese Restaurant Processes. Journal of Machine Learning Research, 12(74):2461-2488, 2011. URL http://jmlr.org/papers/v12/blei11a.html.
+Guy E. Blelloch. Prefix sums and their applications. Technical Report CMU-CS-90-190, School of Computer Science, Carnegie Mellon University, November 1990.
+Scott S. Bolkan, Iris R. Stone, Lucas Pinto, Zoe C. Ashwood, Jorge M. Iravedra Garcia, Alison L. Herman, Priyanka Singh, Akhil Bandi, Julia Cox, Christopher A. Zimmerman, Jounhong Ryan Cho, Ben Engelhard, Jonathan W. Pillow, and Ilana B. Witten. Opponent control of behavior by dorsomedial striatal pathways depends on task demands and internal state. Nat Neurosci, 25 (3):345-357, mar 2022. doi: 10.1038/s41593-022-01021-9. URL https://doi.org/10.1038%2Fs41593-022-01021-9.
+Adam J. Calhoun, Jonathan W. Pillow, and Mala Murthy. Unsupervised identification of the internal states that shape natural behavior. Nature Neuroscience, 22(12):2040-2049, November 2019. doi: 10.1038/s41593-019-0533-x. URL https://doi.org/10.1038/s41593-019-0533-x.
+Julia C Costacurta, Lea Duncker, Blue Sheffer, Winthrop Gillis, Caleb Weinreb, Jeffrey Evan Markowitz, Sandeep R. Datta, Alex H Williams, and Scott Linderman. Distinguishing discrete and continuous behavioral variability using warped autoregressive HMMs. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=6Kj1wCgiUp_.
+Benjamin R. Cowley, Adam C. Snyder, Katerina Acar, Ryan C. Williamson, Byron M. Yu, and Matthew A. Smith. Slow drift of neural activity as a signature of impulsivity in macaque visual and prefrontal cortex. Neuron, 108(3):551-567.e8, November 2020. doi: 10.1016/j.neuron.2020.07.021. URL https://doi.org/10.1016/j.neuron.2020.07.021.
+Pierre Del Moral, Arnaud Doucet, and Ajay Jasra. Sequential monte carlo samplers. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(3):411-436, 2006.
+Thomas S. Ferguson. A bayesian analysis of some nonparametric problems. Ann. Statist., 1(2), mar 1973. doi: 10.1214/aos/1176342360. URL https://doi.org/10.1214%2Faos%2F1176342360.
+
+E. Fox, E. B. Sudderth, M. I. Jordan, and A. S. Willsky. Bayesian nonparametric inference of switching dynamic linear models. IEEE Transactions on Signal Processing, 59(4):1569-1585, 4 2011. doi: 10.1109/tsp.2010.2102756. URL https://doi.org/10.1109%2Ftsp.2010.2102756.
+Emily B. Fox, Erik B. Sudderth, Michael I. Jordan, and Alan S. Willsky. An hdp-hmm for systems with state persistence. In Proceedings of the 25th International Conference on Machine Learning, ICML '08, pp. 312-319, New York, NY, USA, 2008. Association for Computing Machinery. ISBN 9781605582054. doi: 10.1145/1390156.1390196. URL https://doi.org/10.1145/1390156.1390196.
+Emily B. Fox, Erik B. Sudderth, Michael I. Jordan, and Alan S. Willsky. Bayesian nonparametric methods for learning markov switching processes. IEEE Signal Processing Magazine, 27(6):43-54, 2010. doi: 10.1109/MSP.2010.937999.
+Joshua Glaser, Matthew Whiteway, John P Cunningham, Liam Paninski, and Scott Linderman. Recurrent Switching Dynamical Systems Models for Multiple Interacting Neural Populations. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 14867-14878. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/aalf5f73327ba40d47ebce155e785AAF-Paper.pdf.
+Nicholas Kantas, Arnaud Doucet, Sumeetpal Sindhu Singh, and Jan Marian Maciejowski. An overview of sequential monte carlo methods for parameter estimation in general state-space models. IFAC Proceedings Volumes, 42(10):774-785, 2009.
+International Brain Laboratory. Data release - Brainwide map - Q4 2022, 11 2022. URL https://figshare.com/articles/preprint/Data_release-_Brainwide_map-_Q4_2022/21400815.
+International Brain Laboratory, Valeria Aguillon-Rodriguez, Dora Angelaki, Hannah Bayer, Niccolò Bonacchi, Matteo Carandini, Fanny Cazettes, Gabelle Chapuis, Anne K Churchland, Yang Dan, et al. Standardized and reproducible measurement of decision-making in mice. *Elife*, 10:e63711, 2021.
+International Brain Laboratory, Kush Banga, Julius Benson, Niccolò Bonacchi, Sebastian A Bruijns, Rob Campbell, Gaëlle A Chapuis, Anne K Churchland, M Felicia Davatolhagh, Hyun Dong Lee, Mayo Faulkner, Fei Hu, Julia Hunterberg, Anup Khanal, Christopher Krasniak, Guido T Meijer, Nathaniel J Miska, Zeinab Mohammadi, Jean-Paul Noel, Liam Paninski, Alejandro Pan-Vazquez, Noam Roth, Michael Schartner, Karolina Socha, Nicholas A Steinmetz, Karel Svoboda, Marsa Taheri, Anne E Urai, Miles Wells, Steven J West, Matthew R Whiteway, Olivier Winter, and Ilana B Witten. Reproducibility of in-vivo electrophysiological measurements in mice. May 2022. URL https://doi.org/10.1101/2022.05.09.491042.
+S. W. Linderman, M. J. Johnson, and R. P. Adams. Dependent multinomial models made easy: Stick-breaking with the polya-gamma augmentation. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 3456-3464, 2015. URL https://proceedings.neurips.cc/paper/2015/bit/07a4e20a7bbeeb7a736682b26b16ebe8-Abstract.html.
+S. W. Linderman, A. C. Miller, R. P. Adams, D. M. Blei, L. Paninski, and M. J. Johnson. Recurrent switching linear dynamical systems, 2016. URL https://arxiv.org/abs/1610.08466.
+Scott Linderman, Annika Nichols, David Blei, Manuel Zimmer, and Liam Paninski. Hierarchical recurrent state space models reveal discrete and continuous dynamics of neural activity in c. elegans. April 2019. URL https://doi.org/10.1101/621540.
+Scott Linderman, Benjamin Antin, David Zoltowski, and Joshua Glaser. Ssm: Bayesian learning and inference for state space models, 2020. URL https://github.com/lindermanlab/ssm.
+
+Samuele M. Marcora, Walter Staiano, and Victoria Manning. Mental fatigue impairs physical performance in humans. Journal of Applied Physiology, 106(3):857-864, March 2009. doi: 10.1152/japplphysiol.91324.2008. URL https://doi.org/10.1152/japplphysiol.91324.2008.
+Josue Nassar, Scott Linderman, Monica Bugallo, and Il Memming Park. Tree-structured recurrent switching linear dynamical systems for multi-scale modeling. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=HkzRQhR9YX.
+Liam Paninski, Yashar Ahmadian, Daniel Gil Ferreira, Shinsuke Koyama, Kamiar Rahnama Rad, Michael Vidne, Joshua Vogelstein, and Wei Wu. A new look at state-space models for neural data. Journal of Computational Neuroscience, 29(1-2):107-126, August 2009. doi: 10.1007/s10827-009-0179-x. URL https://doi.org/10.1007/s10827-009-0179-x.
+Nicholas G. Polson, James G. Scott, and Jesse Windle. Bayesian inference for logistic models using polya-gamma latent variables. Journal of the American Statistical Association, 108(504): 1339-1349, 2013. ISSN 01621459. URL http://www.jstor.org/stable/24247065.
+Nicholas A. Roy, Ji Hyun Bak, Athena Akrami, Carlos D. Brody, and Jonathan W. Pillow. Extracting the dynamics of behavior in sensory decision-making experiments. Neuron, 109(4):597-610.e6, February 2021. doi: 10.1016/j.neuron.2020.12.004. URL https://doi.org/10.1016/j.neuron.2020.12.004.
+Brian J. Schriver, Svetlana Bagdasarov, and Qi Wang. Pupil-linked arousal modulates behavior in rats performing a whisker deflection direction discrimination task. Journal of Neurophysiology, 120(4):1655-1670, October 2018. doi: 10.1152/jn.00290.2018. URL https://doi.org/10.1152/jn.00290.2018.
+Hideaki Shimazaki and Shigeru Shinomoto. A method for selecting the bin size of a time histogram. Neural Computation, 19(6):1503-1527, June 2007. doi: 10.1162/neco.2007.19.6.1503. URL https://doi.org/10.1162/neco.2007.19.6.1503.
+Jimmy Smith, Scott Linderman, and David Sussillo. Reverse engineering recurrent neural networks with Jacobian switching linear dynamical systems. In Advances in Neural Information Processing Systems, volume 34, pp. 16700-16713. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper/2021/bit/8b77b4b5156dc11dec152c6c71481565-Abstract.html.
+Jimmy T.H. Smith, Andrew Warrington, and Scott Linderman. Simplified state space layers for sequence modeling. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=Ai8Hw3AXqks.
+Yee Whye Teh, Michael I Jordan, Matthew J Beal, and David M Blei. Hierarchical dirichlet processes. Journal of the American Statistical Association, 101(476):1566-1581, dec 2006. doi: 10.1198/016214506000000302.
+Alexander B. Wiltschko, Matthew J. Johnson, Giuliano Iurilli, Ralph E. Peterson, Jesse M. Katon, Stan L. Pashkovski, Victoria E. Abraira, Ryan P. Adams, and Sandeep Robert Datta. Mapping sub-second structure in mouse behavior. Neuron, 88(6):1121-1135, December 2015. doi: 10.1016/j.neuron.2015.11.031. URL https://doi.org/10.1016/j.neuron.2015.11.031.
+Byron M. Yu, John P. Cunningham, Gopal Santhanam, Stephen I. Ryu, Krishna V. Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. Journal of Neurophysiology, 102(1):614-635, July 2009. doi: 10.1152/jn.90941.2008. URL https://doi.org/10.1152/jn.90941.2008.
+D. M. Zoltowski, J. W. Pillow, and S. W. Linderman. Unifying and generalizing models of neural dynamics during decision-making, 2020. URL https://arxiv.org/abs/2001.04571.
+
+Broader Impact The modeling here presented is targeted towards enhancing our understanding of neural computation. Analysis of electrophysiological data can have long-term implications for the treatment and understanding of medical treatment and neurological disorders. However, these considerations are far removed for the preliminary analysis and modeling presented, and we foresee no immediate societal consequences of this work.
+
+**Limitations** We highlight a few limitations. First, in practice for our experiments, our implementation of the scan operation for parallel computing, as presented in section §3.3, does not support the automatic differentiation used for our variational inference. We thus only use the scan partially—we refer to section C.2 for more details on the manner. Second, we present early results on ephys data, for a limited number of sessions, probe locations, animals, etc. We do not aim to make general claims about computation in neural systems, but rather highlight the properties of our models in uncovering time-dependent processes. Expanding to the aforementioned data modalities is grounds for rich future work.
+
+Compute All experiments were run on an external clusters. For reference, training on a single session for the ephys IBL data might take up 12 hours for a single model, with some multiprocessing. Training a single model for the synthetic NASCAR data can be accomplished on the order of 30 minutes.
+
+# A BACKGROUND
+
+# A.1 CHINESE RESTAURANT PROCESS
+
+Dirichlet Processes (DP) mixture models provide a powerful random measure over clusterings. We refer to Ferguson (1973); Antoniak (1974) for a measure-theoretic treatment of DPs, and Teh et al. (2006) for a machine-learning overview. They can be alternatively defined through the Chinese Restaurant Process (CRP), a process akin to the Polya Urn process. The analogy goes as follows: upon entering a restaurant, a customer $i$ selects to sit at a table $k$ with probability proportional to the number of people already sat at that table. With some fixed rate $\alpha$ , they may decide to start a new table. Put otherwise, for a new customer $i$ , its table allocation $z_{i}$ follows
+
+$$
+p \left(z _ {i} = k \mid z _ {: i}, \alpha\right) \propto \left\{ \begin{array}{l l} n _ {k} & \text {i f} k \leq K \\ \alpha & \text {i f} k = K + 1 \end{array} \right. \tag {10}
+$$
+
+with $n_k$ the size of cluster $k \in [K]$ . In this work, one should think of tables as clusters or dynamical modes, and the customers $i$ as time-steps. It can be easily seen that this process induces a joint probability over cluster assignments that is invariant to the order of customers entering. We call this property exchangeability. This enforces a strong and limited prior on distributions of partitions that can arise from this model.
+
+# B TRAINING DETAILS
+
+# B.1 NASCAR TASK
+
+Data generation We generate NASCAR track trajectories by instantiating the true model as described, and generating a sample trajectory running for $T = 1000$ steps. We then split the first 800 steps as train data, and keep the last 200 steps as test data (4:1 split). We repeat this procedure for 5 random seeds. For all models, we use $K = 4$ , $D = 2$ ( $x_{t}$ dimension) and $M = 10$ (observation $y_{t}$ dimension).
+
+# B.2 IBL TASK
+
+Pre-processing Given spike train data from a given period, we first perform the following preprocessing steps to obtain the firing rates over the period
+
+1. Kernel smoothing against a Gaussian kernel to obtain firing rate graphs. We use a standard-deviation of $100\mathrm{ms}$ if the period is a whole trial, and of $30\mathrm{ms}$ if the period is the Open-Loop period.
+
+
+Figure 4: Schematic representation of (A) exchangeability, notably in the Chinese Restaurant Process, and (B) permutation invariance, notably in HMMs and HMM-based models.
+
+
+
+2. The firing rate graphs are evaluated over an evenly space grid over the period interval. The bin size for the grid is determined following Algorithm 1 from Shimazaki & Shinomoto (2007), taking the minimal value, after removing outliers, over trials. We define outliers as values falling outside the $[Q1 - 1.5 * \mathrm{IQR}, Q3 + 1.5 * \mathrm{IQR}]$ quartile interval. The chosen bin size is on the order of $40\mathrm{ms}$ for whole-trial period, and $10\mathrm{ms}$ for the Open-loop period.
+
+After the firing rates are obtained, the next step in processing depends on the nature of the data analyzed, and involves using PCA. If we consider trial-level modeling, then perform PCA to project the firing rates onto the top PCs ( $M = 50$ PCs, over $90\%$ variance explained). If we consider session-level modeling, we first average the firing rates from 200ms before to the stimulus onset to the reward, then perform PCA to project the per-trial activity onto the top PCs from the concatenated trials ( $M = 10$ PCs, over $85\%$ variance explained).
+
+Finally set our internal states $\pmb{x}_n$ to be of dimension $D = 4$ for per-trial neural activity, and $D = 2$ for per-trial-averaged activity.
+
+Ephys data details We use Neuropixels recordings tied to the Brainwide data release Laboratory (2022). The results in this paper pertain to the first available session, with session id ae8787b1-4229-4d56-b0c2-566b61a25b77. We refer the reader to the data release website to obtain more information on the specific probe: https://viz.internationalbrainlab.org/app.
+
+Data we use a 4:1 train to test split for the per-trial spike train analysis. $20\%$ of the trials are randomly selected as test trials – these trials span the whole session.
+
+# C MODELING
+
+# C.1 POLYA-GAMMA AUGMENTATION FOR GIBBS SAMPLING IN INFINITE RECURRENT SLDS
+
+We provide more details on inference challenges in an infinite recurrent SLDS model naively combining the dist-CRP and the SLDS. Following previous methodologies, we could use Gibbs sampling and leverage message passing to perform inference. It would require us to handle the conditional density
+
+$$
+p \left(\boldsymbol {x} _ {1: N} \mid \boldsymbol {c} _ {1: N}, \boldsymbol {z} _ {1: N}, \left\{\boldsymbol {y} _ {1: N}, \boldsymbol {t} _ {1: N} \right\}\right) \propto \prod_ {n = 1} ^ {N} \psi \left(\boldsymbol {x} _ {n - 1}, \boldsymbol {x} _ {n}, z _ {n}\right) \psi \left(\boldsymbol {x} _ {n - 1}, c _ {n}, \boldsymbol {t} _ {: n}\right) \psi \left(\boldsymbol {x} _ {n}, \boldsymbol {y} _ {n}\right)
+$$
+
+where $\psi (\pmb {x}_n,\pmb{x}_{n + 1},c_{n + 1})$ is the potential from the continuous recurrent dynamics, and $\psi (\pmb {x}_n,y_n)$ the evidence potentials. The recurrent connections introduce the dependencies captured in $\psi (\pmb {x}_n,c_{n + 1})$ which adds significant challenges for inference. Without it, in the standard SLDS, the potentials are all Gaussian, allowing for analytical integration.
+
+Following Linderman et al. (2016), we can leverage Pólya-gamma augmentation (Polson et al., 2013; Linderman et al., 2015) to deal with these non-Gaussian factors. The key is that instead of performing a categorical choice over a pre-determined set of $K$ dynamical modes, we perform an association, a categorical choice, with a previous time-step $j \in \{1, \dots, t\}$ . Because of the conceptual categorical similarities in updating, we find similarities in inference methodology with the rSLDS. This is where
+
+the choice of decay function $f$ comes in, in enforcing that link. This non-Gaussian factor is
+
+$$
+\begin{array}{l} \psi (\boldsymbol {x} _ {n - 1}, c _ {n}, \boldsymbol {t}: n) = p (c _ {n} | \boldsymbol {x} _ {n - 1}, \boldsymbol {t}: n) \propto \prod_ {j = 1} ^ {n} f (t _ {n} - t _ {j}; \beta (\boldsymbol {x} _ {n - 1})) ^ {\mathbb {I} [ c _ {n} = j ]} \alpha^ {\mathbb {I} [ c _ {n} = n ]} \\ = \alpha^ {\mathbb {I} [ c _ {n} = n ]} \prod_ {j = 1} ^ {n - 1} \left(\frac {e ^ {[ \pmb {\nu} _ {n} ] _ {j}}}{1 + e ^ {[ \pmb {\nu} _ {n} ] _ {j}}}\right) ^ {\mathbb {I} [ c _ {n} = j ]} \\ \end{array}
+$$
+
+for $\pmb{\nu}_n\in \mathbb{R}^{n - 1}$ , $[\pmb{\nu}_n]_j\coloneqq \beta (\pmb{x}_{n - 1})\cdot (t_n - t_j)$ . We can leverage the following integral quantity
+
+$$
+\frac {(e ^ {\nu}) ^ {a}}{(1 + e ^ {\nu}) ^ {b}} = 2 ^ {- b} e ^ {\kappa \nu} \int_ {0} ^ {\infty} e ^ {- \omega \nu^ {2} / 2} p _ {\mathrm {P G}} (\omega | b, 0) \mathrm {d} \omega \qquad b > 0, \kappa = a - \frac {b}{2}
+$$
+
+to introduce auxiliary variables $\{\omega_{j}\}_{j = 1}^{n}$ such that the conditional density $p(c_{n + 1}|\boldsymbol {x}_n,\boldsymbol{t}_{:n + 1},\omega_n)$ becomes Gaussian
+
+$$
+\psi \left(\boldsymbol {x} _ {n}, c _ {n + 1}, \boldsymbol {t} _ {: n + 1}, \omega_ {n}\right) \propto \alpha \mathcal {N} \left(\boldsymbol {\nu} _ {n} \mid \Omega_ {n} ^ {- 1} \boldsymbol {\kappa} _ {n}, \Omega_ {n} ^ {- 1}\right) \tag {11}
+$$
+
+where $\Omega_{n} = \mathrm{diag}(\omega_{1:t - 1})$ , and $[\kappa_n]_j = \frac{1}{2}\mathbb{I}[c_n = j]$ , $\kappa_{n}\in \mathbb{R}^{n}$ . With this augmentation, the required potentials are Gaussian and the integral can be calculated analytically. We refer the reader to Blei & Frazier (2011) for subsequent details on how one handles the messages $m_{n\to n + 1}(c_{n + 1})$ .
+
+While we do obtain an analytical expression for the augmented potentials in (eq. 11), such potentials are multivariate Gaussians of size $n$ for each time-step $n \in \{1, \dots, N\}$ . This adds significant computational complexity, both in handling the potentials and in any required marginalization.
+
+# C.2 IMPLEMENTATION OF THE IRSLDS
+
+In this appendix subsection, we present code modules and functions relevant to the modeling.
+
+Parallel scan We cast the linear dynamics of the transition matrices $W_{n}$ as a scan operation to efficiently parallelize the computation. The SSM package relies on Numba and autograd, the latter not having a readily implemented associate scan operation. To this end, we implemented in Numba and Numpy the scan operation, using numba for the parallelization (Listing 1). Unfortunately, this scan operation cannot leverage the automatic differentiation from autograd. We found however that including the scan in the computation does not significantly change the learned solutions in the irSLDS parameters. Thus in practice, we use the scan to do faster hyperparameter search or gradient-free computation (e.g. generating samples, evaluating likelihoods), but rely on the full sequential version for the final training.
+
+```python
+1 @numba.jit()
+2 def binary_operator(q_i, q_j):
+3 r"" Binary operator for parallel scan of linear recurrence.
+4 Args:
+5 q_i: tuple containing U_i and b_i at position i (K,K), (K,K)
+6 q_j: tuple containing U_j and b_j at position j (K,K), (K,K)
+7 Returns:
+8 new element (U_out, bias_out)
+9 ""
+10 U_i, b_i = q_i
+11 U_j, b_j = q_j
+12 return np/matmul(U_i, U_j), np/matmul(b_i, U_j) + b_j
+13
+14 @numba.jit(parallel=True, forceobj=True)
+15 def apply_scan(U, bias_elements):
+2 r''
+3 Apply parallel scan for a length T linear recurrence of the form
+4 x[0] = bias_elements[0]
+5 x[t] = U x[t-1] + bias_elements[t]
+6 Args:
+7 U: Recurrent matrix, np.ndarray (K,K),
+8 bias_elements: Additive bias elements, np.ndarray (T+1,K),
+9 First bias element is the initialization for x.
+10 Returns:
+11 X: State dynamics, np.ndarray (T,K,)
+12 ""
+13 T = len(bias_elements) - 1
+14 K = U.shape[0]
+15 # Initialization
+16 X = np.empty((T, K, K), dtype=np.float64)
+17 q_i = (np.eye(K), np.zeros_like(bias_elements[0]))
+```
+
+Listing 1: Numba implementation of associative scan
+```python
+Use numba prange for parallelization
+for i in numba.prange(T):
+ q_i = binary_operator(q_i, c_i)
+X[i] = q_i[1]
+return X[1:]
+```
+
+Transition module We implement the irSLDS within the SSM package from Linderman et al. (2020). This can be accomplished by using the same SLDS parent class as the (r)SLDS models, and specifying a new discrete state process. We implement this discrete state process as a ssm.transitions.Transitions module.
+
+```python
+class HeatRecurrentTransition(Transitions):
+ Use w_t as a probability dist to sample z_{t+1} from.
+ w_t follows the heat equation: w_t \in L^1 satisfying
+ D_t w_t = \gamma gamma D_xx w_t
+ def __init__(self, K, D, M=0, gamma=1.0, kappa=0.4, scan=False):
+ super().__init__(K, D, M)
+ # Parameters linking past state to current state distribution
+ self.beta = beta
+ self.scan = scan
+ self._set_beta()
+ self._set_U() # FDM matrix for heat equation
+ self.kappa = kappa
+ # Parameters linking past observations to state distribution
+ self.Vs = npr.randn(K, M) # Inputs encoding, per state
+ self.Rs = npr.randn(K, D) # Previous observations encoding, per state
+ self.r = npr.randn(K)
+ def _set_beta(self):
+ delta_t = 1.0 # assume regular emissions.
+ delta_x = np.sqrt((8 * self.gamma * delta_t)) # determine the delta x such that FMD is stable
+ assert delta_t <= (delta_x ** 2) / (4 * self.gamma) # general assertion for stability
+ self.beta = (self.gamma * delta_t) / (delta_x ** 2)
+ def _set_U(self):
+ self.U = self.beta * np.diag(np.ones(self.K-1), k=1) + \
+ (1-2 * self.beta) * np.diag(np.ones(self.K)) + \
+ self.beta * np.diag(np.ones(self.K-1), k=-1)
+ def get_sufficient_statistics(self, data, input, mask, tag, w_state=None, SCAN=False):
+ T, _ = data.shape
+ # Initialization
+ ws = []
+ if (w_state is None): # Init
+ wt = 1/self.K * np.ones((self.K, self.K))
+ # Dynamics
+ if SCAN:
+ # Use eaxsum to parallelize over time the biases encoding
+ kappa_U = np.einsum('ij,jk->ik', self.U, self.kappa * np.eye(self.K))
+ bias_elements = np.reduce(kappa_U[np.newaxis, :, :, T, axis=0] + \
+ np.reduce(np.einsum('tm,mk->tk', input, self.Vs.T)[:, np.newaxis, :,], self.K, axis=1) + \
+ np.reduce(np.einsum('td,dk->tk', data, self.Rs.T)[:, np.newaxis, :,], self.K, axis=1)
+ # Add initial condition to initial bias
+ bias_elements = np monetenate([wt[np.newaxis, :, ], bias_elements], axis=0)
+ # Use the scan operation to parallelize the linear dynamics over time
+ ws = apply_scan(self.U, bias-elements)
+ return ws
+ else:
+ # Use sequential dynamics computation
+ for t in np.arange(T-1):
+ wt = np.dot(wt, self.U.T) # FDM
+ wt = wt + self.kappa * np.eye(self.K) # self reinforcement.
+ wt = wt + np.dot(input[t], self.Vs.T) + np.dot(data[t], self.Rs.T) # inputs
+ ws.append(wt)
+ ws = np.array(ws)
+ return ws
+def log_transition_matrices(self, data, input, mask, tag, w_state=None):
+ ws = self.get_sufficient_statistics(data, input, mask, tag, w_state=w_state, SCAN-self.scan)
+normalized_log_Ps = ws - logsumexp(ws, axis=2, keepdims=True)
+if self.alpha>0:
+ reweighted_log_Ps = (1-self.alpha) * normalized_log_Ps
+out = reweighted_log_Ps - logsumexp(reweighted_log_Ps, axis=2, keepdims=True)
+```
+
+```makefile
+else: out $=$ normalized_log_Ps return out
+```
+
+Listing 2: Basic implementation of the transition matrix dynamics with heat-equation prior
+
+# C.3 TRANSITION MATRIX DYNAMICS
+
+We explicit here the dynamics of the transition matrix $W_{n} \in \mathbb{R}^{K \times K}$ . The equation for the sufficient statistic $\boldsymbol{w}_{n}$ dynamics in (8), which we rewrite here for reference,
+
+$$
+\boldsymbol {w} _ {n + 1} \mid \left\{\boldsymbol {w} _ {n}, \boldsymbol {x} _ {n}, z _ {n} = i \right\} = U \boldsymbol {w} _ {n} + \kappa \mathbf {1} _ {i} + R \boldsymbol {x} _ {n} + r,
+$$
+
+refers to row $i$ of the transition matrix $W_{n + 1}$ , so that
+
+$$
+\left[ W _ {n + 1} \right] _ {i, j} = \left[ \boldsymbol {w} _ {n + 1} \mid \left\{\boldsymbol {x} _ {n}, z _ {n} = i \right\} \right] _ {j}. \tag {12}
+$$
+
+We note that all vectors are columns vectors.
+
+To get the dynamics of the transition matrix itself, we must expand out the computation for each row. Specifically, given $W_{n}$ , we obtain
+
+$$
+\begin{array}{l} W _ {n + 1} = \left[ \begin{array}{c} {\left(U [ W _ {n} ] _ {1,:} ^ {\top}\right) ^ {\top}} \\ \vdots \\ {\left(U [ W _ {n} ] _ {K,:} ^ {\top}\right) ^ {\top}} \end{array} \right] + \left[ \begin{array}{c} {\kappa \mathbf {1} _ {1} ^ {\top}} \\ \vdots \\ {\kappa \mathbf {1} _ {K} ^ {\top}} \end{array} \right] + \left[ \begin{array}{c} {(R \boldsymbol {x} _ {n} + r) ^ {\top}} \\ \vdots \\ {(R \boldsymbol {x} _ {n} + r) ^ {\top}} \end{array} \right] \\ = \left[ \begin{array}{c} {[ W _ {n} ] _ {1,:} U ^ {\top}} \\ \vdots \\ {[ W _ {n} ] _ {K,:} U ^ {\top}} \end{array} \right] + \kappa \mathrm {I d} + (R \boldsymbol {x} _ {n} + r) ^ {\top} \otimes \mathbf {1} \\ = W _ {n} U ^ {\top} + \kappa \operatorname {I d} + \left(R \boldsymbol {x} _ {n} + r\right) ^ {\top} \otimes \mathbf {1} \tag {13} \\ \end{array}
+$$
+
+as the dynamics of the transition matrix. One can find these dynamics in our implementation of the transition module in Listing 2, lines 62-64. Unless otherwise noted, we use $\kappa = 0.4$ , and $\beta = 1.0$ for defining $U$ .
+
+# D RESULTS
+
+# D.1 ACCURACY METRICS
+
+All models were trained for 100 iterations, for every task. We only report the "mean" test log-likelihood, i.e. the log of the mean of the test likelihoods.
+
+Table 2: Performance metrics on NASCAR experiments-Expanded. We report the marginal log-likelihood on test data, evaluated with Sequential Monte Carlo. Test data-sets consist of $T = 200$ excluded steps in NASCAR, and excluded trajectory of $T = 1000$ steps in extended NASCAR. We also report the dynamical mean-square error (MSE) between the sample $x$ state-space flow and true flow field. We first reflect and rotate the sample trajectories to best align them with the flow field.
+
+
Model
K
# parameters
Test log-likelihood (↑) (nats)
Dynamical MSE (↓)
Mean
IQR
NASCAR
SLDS
4
92
1331.35
0.930
[0.247, 0.629]
8
176
1592.81
305.046
[0.058, 0.759]
rSLDS
4
100
1628.57
0.010
[0.005, 0.015]
8
192
1613.53
0.011
[0.010, 0.013]
irSLDS
4
88
1656.10
0.015
[0.007, 0.015]
8
136
1611.45
0.011
[0.006, 0.014]
Extended NASCAR
SLDS
6
130
7353.22
316.75
[0.29, 5.46]
rSLDS
6
142
8015.93
0.35
[0.04, 0.48]
irSLDS
6
112
8219.41
0.24
[0.10, 0.27]
+
+Table 3: Performance metrics on IBL experiments: Marginal Log-Likelihood of held-out test data, evaluated with Sequential Monte Carlo. Higher is better.
+
+
Model
Per trial
Per session
Test log-likelihood (↑)
ELBO (↑)
K=2
K=4
K=8
K=8
rSLDS
-1469.759
-1437.519
-1399.030
-6.67 × 103
irSLDS
-1446.692
-1461.777
-1392.508
-6.69 × 103
+
+# D.2 EMPIRICAL RUNNING TIMES
+
+Table 4: Empirical running times, in seconds per EM iteration, reported for the standard NASCAR task and trial-level IBL. The experiments were ran on an AMD EPYC 7H12 64-Core Processor, on 10 cores. No GPU was used.
+
+
(s/iter)
+Model
NASCAR
+K=4
Per trial IBL
K=2
K=4
K=8
SLDS
0.13 ± 0.02
6.02 ± 0.06
12.9 ± 0.2
8.7 ± 0.3
rSLDS
0.18 ± 0.03
7.32 ± 0.10
12.3 ± 0.6
18.2 ± 0.3
irSLDS
3.21 ± 0.71
48.47 ± 2.91
56.4 ± 3.1
70.0 ± 5.3
irSLDS (w/ scan)
0.54 ± 0.08
11.73 ± 0.50
14.0 ± 0.8
18.4 ± 1.0
+
+# D.3 HYPER-PARAMETER INFLUENCE
+
+Scaling the number of states $K$ We include results in Fig. 5 on the impact of scaling $K$ across models. We consider the standard NASCAR task, and evaluate model performance on $T = 200$ held-out time steps, averaged 5 random initialization seeds, and report mean and standard deviation.
+
+
+Figure 5: Impact of scaling $K$ on model performance. Test log-likelihood on NASCAR task as a function of the hyperparameter $K$ . See text for details.
+
+
+Figure 6: Impact of the hyperparameters $\{\gamma, \kappa\}$ on the irSLDS model. We report test log-likelihood on NASCAR task as a function of the hyperparameters, and plot example discrete state trajectories. See text for details.
+
+We trained and tested models using $K \in \{4, 8, 12, 16\}$ states, thus considering the over-parametrized regime over the true $K = 4$ states for the NASCAR task. We observe that the irSLDS maintains a high performance across seeds, matched by and slightly over-performing the true rSLDS model class. The SLDS model class exhibits more variability. Note that in contrast to Table 1, we generated new train/test datasets for each seed.
+
+Heat equation parameters in the irSLDS We consider the impact on performance of the self-reinforcement parameter $\kappa \in \mathbb{R}$ and the parameter of decay $\gamma > 0$ in the heat equation prior of eq. equation 8 in §3.3. For all experiments and results reported throughout the paper, we chose $\gamma = 1.0$ and $\kappa = 0.4$ , we let $\Delta t = 1.0$ , and we set $\Delta j = \sqrt{8\gamma\Delta t} = 2\sqrt{2}$ (for stability). We report in Fig. 6 test log-likelihood for the standard NASCAR task, on one random seed, over a grid of hyper-parameter $\{\gamma, \kappa\}$ combinations. In terms of performance, we observe that the specific choice of hyper parameters has minimal effect for a low number of states $K = 4$ . The impact becomes more evident when increased to $K = 16$ , as a consequence of the more fine grained discrete state space support for the heat equation PDE. We plot prior sample trajectories, with $\alpha = 0$ , for two exemplar combination of parameters to illustrate their influence.
\ No newline at end of file
diff --git a/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/images.zip b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..717cde81cb005cc1cad844874caef1b24a1057f8
--- /dev/null
+++ b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c7bfaf05c3aa4c7c65cec83e91731171224e1c9f1b5f43c5ad7557fd35d63fa
+size 645594
diff --git a/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/layout.json b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..60e70083be7bee656f7421090110b558172c3496
--- /dev/null
+++ b/parsingneuraldynamicswithinfiniterecurrentswitchinglineardynamicalsystems/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f6359c44caaa9568c68d975edad2611139253a1a288abfa3fe04d0efd1e6c15f
+size 652728
diff --git a/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_content_list.json b/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..4db0c989e7dbccd4cc45caceaef3ee0d9cb107f3
--- /dev/null
+++ b/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b7cd14c9cc15d87f3ce18af65aed1a4d380c9489edcf93d8c4cc1db348d6cb1b
+size 196384
diff --git a/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_model.json b/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..01123953e7d00852397cdd721deb7746bbdeeddf
--- /dev/null
+++ b/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d0f3a285e27f4315d31945638cd45c85c8e71cc49b6f94b8bec961adb4d6f7f2
+size 229089
diff --git a/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_origin.pdf b/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..a5cd501dc4f3656d33ce0397a80dcea06c833082
--- /dev/null
+++ b/particleguidancenoniiddiversesamplingwithdiffusionmodels/b86b65fe-1a3c-4309-b416-28f267e1c2f4_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e383f1f8fe8b616a8b075fffa3baae3aae50a6f5cc34331d0575cc1411d2b51b
+size 28236783
diff --git a/particleguidancenoniiddiversesamplingwithdiffusionmodels/full.md b/particleguidancenoniiddiversesamplingwithdiffusionmodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a76845803687be935bb69ea7fbbee08b90e0426d
--- /dev/null
+++ b/particleguidancenoniiddiversesamplingwithdiffusionmodels/full.md
@@ -0,0 +1,920 @@
+# PARTICLE GUIDANCE: NON-I.I.D. DIVERSE SAMPLING WITH DIFFUSION MODELS
+
+Gabriele Corso\*1, Yilun Xu\*1, Valentin de Bortoli2, Regina Barzilay1, Tommi Jaakkola1
+
+1CSAIL, Massachusetts Institute of Technology, 2ENS, PSL University
+
+# ABSTRACT
+
+In light of the widespread success of generative models, a significant amount of research has gone into speeding up their sampling time. However, generative models are often sampled multiple times to obtain a diverse set incurring a cost that is orthogonal to sampling time. We tackle the question of how to improve diversity and sample efficiency by moving beyond the common assumption of independent samples. We propose particle guidance, an extension of diffusion-based generative sampling where a joint-particle time-evolving potential enforces diversity. We analyze theoretically the joint distribution that particle guidance generates, how to learn a potential that achieves optimal diversity, and the connections with methods in other disciplines. Empirically, we test the framework both in the setting of conditional image generation, where we are able to increase diversity without affecting quality, and molecular conformer generation, where we reduce the state-of-the-art median error by $13\%$ on average.
+
+# 1 INTRODUCTION
+
+Deep generative modeling has become pervasive in many computational tasks across computer vision, natural language processing, physical sciences, and beyond. In many applications, these models are used to take a number of representative samples of some distribution of interest like Van Gogh's style paintings or the 3D conformers of a small molecule. Although independent samples drawn from a distribution will perfectly represent it in the limit of infinite samples, for a finite number, this may not be the optimal strategy. Therefore, while deep learning methods have so far largely focused on the task of taking independent identically distributed (I.I.D.) samples from some distribution, this paper examines how one can use deep generative models to take a finite number of samples that can better represent the distribution of interest.
+
+In other fields where finite-samples approximations are critical, researchers have developed various techniques to tackle this challenge. In molecular simulations, several enhanced sampling methods, like metadynamics and replica exchange, have been proposed to sample diverse sets of low-energy structures and estimate free energies. In statistics, Stein Variational Gradient Descent (SVGD) is an iterative technique to match a distribution with a finite set of particles. However, these methods are not able to efficiently sample complex distributions like images.
+
+Towards the goal of better finite-samples generative models, that combine the power of recent advances with sample efficiency, we propose a general framework for sampling sets of particles using diffusion models. This framework, which we call particle guidance (PG), is based on the use of a time-evolving potential to guide the inference process. We present two different strategies to instantiate this new framework: the first, fixed potential particle guidance, provides ready-to-use potentials that require no further training and have little inference overhead; the second, learned potential particle guidance, requires a training process but offers better control and theoretical guarantees.
+
+The theoretical analysis of the framework leads us to two key results. On one hand, we obtain an expression for the joint marginal distribution of the sampled process when using any arbitrary guidance potential. On the other, we derive a simple objective one can use to train a model to learn a time-evolving potential that exactly samples from a joint distribution of interest. We show this provides optimal joint distribution given some diversity constraint and it can be adapted to the addition of further constraints such as the preservation of marginal distributions. Further, we also
+
+
+Figure 1: Comparison of I.I.D. and particle guidance sampling. The center figure represents each step, with the distribution in pink and the samples as yellow crosses, where particle guidance uses not only the score (in blue) but also the guidance from joint-potential (red), leading it to discover different modes (right-hand samples vs those on the left). At the bottom, Van Gogh cafe images samples generated with Stable Diffusion with and without particle guidance. A more detailed discussion on the suboptimality of I.I.D. sampling is presented in Appendix B.1.
+
+demonstrate the relations of particle guidance to techniques for non-I.I.D. sampling developed in other fields and natural processes and discuss its advantages.
+
+Empirically, we demonstrate the effectiveness of the method in both synthetic experiments and two of the most successful applications of diffusion models: text-to-image generation and molecular conformer generation. In the former, we show that particle guidance can improve the diversity of the samples generated with Stable Diffusion [Rombach et al., 2021] while maintaining a quality comparable to that of I.I.D. sampling. For molecular conformer generation, applied to the state-of-the-art method Torsional Diffusion [Jing et al., 2022], particle guidance is able to simultaneously improve precision and coverage, reducing their median error by respectively $19\%$ and $8\%$ . In all settings, we also study the critical effect that different potentials can have on the diversity and sample quality.
+
+# 2 BACKGROUND
+
+Diffusion models Let $p(x)$ be the data distribution we are interested in learning. Diffusion models [Song et al., 2021] define a forward diffusion process that has $p$ as the initial distribution and is described by $d\mathbf{x} = \mathbf{f}(\mathbf{x},t)dt + g(t)d\mathbf{w}$ , where $\mathbf{w}$ is the Wiener process. This forward diffusion process is then reversed using the corresponding reverse diffusion SDE $d\mathbf{x} = [-\mathbf{f}(\mathbf{x},T - t) + g(T - t)^{2}\nabla_{\mathbf{x}}\log p_{T - t}(\mathbf{x})]dt + g(T - t)d\mathbf{w}$ (using the forward time convention) where the evolving score $\nabla_{\mathbf{x}}\log p_t(\mathbf{x})$ is approximated with a learned function $s_{\theta}(\mathbf{x},t)$ .
+
+One key advantage of diffusion models over the broad class of energy-based models [Teh et al., 2003] is their finite-time sampling property for taking a single sample. Intuitively, by using a set of smoothed-out probability distributions diffusion models are able to overcome energy barriers and sample every mode in finite time as guaranteed by the existence of the reverse diffusion SDE [Anderson, 1982]. In general, for the same order of discretization error, reverse diffusion SDE can efficiently sample from data distribution in much fewer steps than Langevin dynamics in energy-based models. For instance, Theorem 1 of Chen et al. [2022] shows that, assuming accurate learning of score, the convergence of diffusion SDE is independent of the isoperimetry constant of the target distribution. Langevin dynamics mixing speed can be exponentially slow if the spectral gap/isoperimetry constant is small. This critical property is orthogonal to the efficiency in the number of samples one needs to generate to cover a distribution; in this work, we aim to achieve sample efficiency while preserving the finite-time sampling of diffusion models.
+
+Diffusion models were extended to Riemannian manifolds by De Bortoli et al. [2022], this formulation has found particular success [Jing et al., 2022; Corso et al., 2022; Yim et al., 2023] in scientific domains where data distributions often lie close to predefined submanifolds [Corso, 2023].
+
+Classifier guidance (CG) [Dhariwal & Nichol, 2021] has been another technical development that has enabled the success of diffusion models on conditional image generation. Here a classifier $p_{\theta}(y|\mathbf{x}_t,t)$ , trained to predict the probability of $\mathbf{x}_t$ being obtained from a sample of class $y$ , is used to guide a conditional generation of class $y$ following:
+
+$$
+d \mathbf {x} = [ - \mathbf {f} (\mathbf {x}, t ^ {\prime}) + g (t ^ {\prime}) ^ {2} (s _ {\theta} (\mathbf {x}, t ^ {\prime}) + \alpha \nabla_ {\mathbf {x}} \log p _ {\theta} (y | \mathbf {x}, t ^ {\prime})) ] d t + g (t ^ {\prime}) d \mathbf {w} \quad \mathrm {w h e r e} t ^ {\prime} = T - t
+$$
+
+where $\alpha$ in theory should be 1, but, due to overspreading of the distribution, researchers often set it to larger values. This, however, often causes the collapse of the generation to a single or few modes, hurting the samples' diversity.
+
+# 3 PARTICLE GUIDANCE
+
+Our goal is to define a sampling process that promotes the diversity of a finite number of samples while retaining the advantages and flexibility that characterize diffusion models. Let $p(\mathbf{x})$ be some probability distribution of interest and $\nabla_{\mathbf{x}}\log p_t(\mathbf{x})$ be the score that we have learned to reverse the diffusion process $d\mathbf{x} = f(\mathbf{x},t)dt + g(t)d\mathbf{w}$ . Similarly to how classifier guidance is applied, we modify the reverse diffusion process by adding the gradient of a potential. However, we are now sampling together a whole set of particles $\mathbf{x}_1,\dots,\mathbf{x}_n$ , and the potential $\log \Phi_t$ is not only a function of the current point but a permutation invariant function of the whole set:
+
+$$
+d \mathbf {x} _ {i} = \left[ - f \left(\mathbf {x} _ {i}, t ^ {\prime}\right) + g ^ {2} \left(t ^ {\prime}\right) \left(\nabla_ {\mathbf {x} _ {i}} \log p _ {t ^ {\prime}} \left(\mathbf {x} _ {i}\right) + \nabla_ {\mathbf {x} _ {i}} \log \Phi_ {t ^ {\prime}} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right)\right) \right] d t + g \left(t ^ {\prime}\right) d \mathbf {w}. \tag {1}
+$$
+
+where the points are initially sampled I.I.D. from a prior distribution $p_T$ . We call this idea particle guidance (PG). This framework allows one to impose different properties, such as diversity, on the set of particles being sampled without the need to retrain a new score model operating directly on the space of sets.
+
+We will present and study two different instantiations of this framework:
+
+1. Fixed Potential PG where the time-evolving joint potential is handcrafted, leading to very efficient sampling of diverse sets without the need for any additional training. We present this instantiation in Section 5 and show its effectiveness on critical real-world applications of diffusion models in Section 6.
+2. Learned Potential PG where we learn the time-evolving joint potential to provably optimal joint distributions. Further, this enables direct control of important properties such as the preservation of marginal distributions. We present this instantiation in Section 7.
+
+# 4 CONNECTIONS WITH EXISTING METHODS
+
+As discussed in the introduction, other fields have developed methods to improve the tradeoff between sampling cost and coverage of the distribution of interest. In this section, we will briefly introduce four methods (coupled replicas, metadynamics, SVGD and electrostatics) and draw connections with particle guidance.
+
+# 4.1 COUPLED REPLICAS AND METADYNAMICS
+
+In many domains linked to biochemistry and material science, researchers study the properties of the physical systems by collecting several samples from their Boltzmann distributions using molecular dynamics or other enhanced sampling methods. Motivated by the significant cost that sampling each individual structure requires, researchers have developed a range of techniques to improve sample efficiency and speed by, for example, reducing the correlation of subsequent samples from slow-mixing Markov chains. The most popular of these techniques are parallel sampling with coupled replicas and sequential sampling with metadynamics.
+
+As the name suggests, replica methods involve directly taking $n$ samples of a system with the different sampling processes, replicas, occurring in parallel. In particular, coupled replica methods
+
+[Hummer & Kofinger, 2015; Pasarkar et al., 2023] create a dependency between the replicas by adding, like particle guidance, an extra potential $\Phi$ to the energy function to enforce diversity or match experimental observables. This results in energy-based sampling procedures that target:
+
+$$
+\tilde {p} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) = \Phi \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) \prod_ {i = 1} ^ {n} p \left(\mathbf {x} _ {i}\right).
+$$
+
+Metadynamics [Laio & Parrinello, 2002; Barducci et al., 2008] was also developed to more efficiently sample the Boltzmann distribution of a given system. Unlike replica methods and our approach, metadynamics is a sequential sampling technique where new samples are taken based on previously taken ones to ensure diversity, typically across certain collective variables of interest $s(\mathbf{x})$ . In its original formulation, the Hamiltonian at the $k^{\mathrm{th}}$ sample is augmented with a potential as:
+
+$$
+\tilde {H} _ {k} = H - \omega \sum_ {j < k} \exp \left(- \frac {\| s (\mathbf {x}) - s \left(\mathbf {x} _ {j} ^ {0}\right) \| ^ {2}}{2 \sigma^ {2}}\right)
+$$
+
+where $H$ is the original Hamiltonian, $\mathbf{x}_j^0$ are the previously sampled elements and $\omega$ and $\sigma$ parameters set a priori. Once we take the gradient and perform Langevin dynamics to sample, we obtain dynamics that, with the exception of the fixed Hamiltonian, resemble those of particle guidance in Eq. 4 where
+
+$$
+\nabla_ {\mathbf {x} _ {i}} \log \Phi_ {t} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) \gets \nabla_ {\mathbf {x} _ {i}} \omega \sum_ {j < i} \exp \left(- \frac {\| s (\mathbf {x} _ {i}) - s (\mathbf {x} _ {j} ^ {0}) \| ^ {2}}{2 \sigma^ {2}}\right).
+$$
+
+Although they differ in their parallel or sequential approach, both coupled replicas and metadynamics can be broadly classified as energy-based generative models. As seen here, energy-based models offer a simple way of controlling the joint distribution one converges to by simply adding a potential to the energy function. On the other hand, however, the methods typically employ an MCMC sampling procedure, which lacks the critical finite-time sampling property of diffusion models and significantly struggles to cover complex probability distributions such as those of larger molecules and biomolecular complexes. Additionally, the MCMC typically necessitates a substantial number of steps, generally proportional to a polynomial of the data dimension [Chewi et al., 2020]. With particle guidance, we instead aim to achieve both properties (controllable diversity and finite time sampling) at the same time. We can simulate the associated SDE/ODE with a total number of steps that is independent of the data dimension.
+
+# 4.2 SVGD
+
+Stein Variational Gradient Descent (SVGD) [Liu & Wang, 2016] is a well-established method in the variational inference community to iteratively transport a set of particles to match a target distribution. Given a set of initial particles $\{\mathbf{x}_1^0 \ldots \mathbf{x}_n^0\}$ , it updates them at every iteration as:
+
+$$
+\mathbf {x} _ {i} ^ {\ell - 1} \leftarrow \mathbf {x} _ {i} ^ {\ell} + \epsilon_ {\ell} \psi \left(\mathbf {x} _ {i} ^ {\ell}\right) \quad \text {w h e r e} \quad \psi (\mathbf {x}) = \frac {1}{n - 1} \sum_ {j = 1} ^ {n} \left[ k \left(\mathbf {x} _ {j} ^ {\ell}, \mathbf {x}\right) \nabla_ {\mathbf {x} _ {j} ^ {\ell}} \log p \left(\mathbf {x} _ {j} ^ {\ell}\right) + \nabla_ {\mathbf {x} _ {j} ^ {\ell}} k \left(\mathbf {x} _ {j} ^ {\ell}, \mathbf {x}\right) \right] \tag {2}
+$$
+
+where $k$ is some (similarity) kernel and $\epsilon_{\ell}$ the step size. Although SVGD was developed with the intent of sampling a set of particles that approximate some distribution $p$ without the direct goal of obtaining diverse samples, SVGD and our method have a close relation.
+
+This relation between our method and SVGD can be best illustrated under specific choices for drift and potential under which the probability flow ODE discretization of particle guidance can be approximated as (derivation in Appendix A.5):
+
+$$
+\mathbf {x} _ {i} ^ {t + \Delta t} \approx \mathbf {x} _ {i} ^ {t} + \epsilon_ {t} (\mathbf {x} _ {i}) \psi_ {t} \left(\mathbf {x} _ {i} ^ {t}\right) \quad \text {w h e r e} \quad \psi (\mathbf {x}) = \frac {1}{n - 1} \sum_ {j = 1} ^ {n} \left[ k _ {t} \left(\mathbf {x} _ {j} ^ {t}, \mathbf {x}\right) \nabla_ {\mathbf {x}} \log p _ {t} (\mathbf {x}) + \nabla_ {\mathbf {x} _ {j} ^ {t}} k _ {t} \left(\mathbf {x} _ {j} ^ {t}, \mathbf {x}\right) \right] \tag {3}
+$$
+
+Comparing this with Eq. 2, we can see a clear relation in the form of the two methods, with some key distinctions. Apart from the different constants, the two methods use different terms for the total score component. Interestingly both methods use smoothed-out scores, however, on the one hand, particle guidance uses the diffused score at the specific particle $\mathbf{x}_i$ , $\nabla_{\mathbf{x}_i}\log p_t(\mathbf{x}_i)$ , while on the other, SVGD smoothes it out by taking a weighted average of the score of nearby particles weighted by the similarity kernel $(\sum_jk(\mathbf{x}_i,\mathbf{x}_j)\nabla_{\mathbf{x}_j}\log p(\mathbf{x}_j)) / (\sum_jk(\mathbf{x}_i,\mathbf{x}_j))$
+
+The reliance of SVGD on other particles for the "smoothing of the score", however, causes two related problems, firstly, it does not have the finite-time sampling guarantee that the time evolution of diffusion models provides and, secondly, it suffers from the collapse to few local modes near the initialization and cannot discover isolated modes in data distribution [Wenliang & Kanagawa, 2020]. This challenge has been theoretically [Zhuo et al., 2018] and empirically [Zhang et al., 2020] studied with several works proposing practical solutions. In particular, relevant works use an annealing schedule to enhance exploration [D'Angelo & Fortuin, 2021] or use score matching to obtain a noise-conditioned kernel for SVGD [Chang et al., 2020]. Additionally, we empirically observe that the score smoothing in SVGD results in blurry samples in image generation.
+
+# 4.3 ELECTROSTATICS
+
+Recent works [Xu et al., 2022; 2023b] have shown promise in devising novel generative models inspired by the evolution of point charges in high-dimensional electric fields defined by the data distribution. It becomes natural therefore to ask whether particle guidance could be seen as describing the evolution of point charges when these are put in the same electric field such that they are not only attracted by the data distribution but also repel one another. One can show that this evolution can indeed be seen as the combination of Poisson Flow Generative Models with particle guidance, where the similarity kernel is the extension of Green's function in $N + 1$ -dimensional space, i.e., $k(x,y) \propto 1 / ||x - y||^{N - 1}$ . We defer more details to Appendix A.6.
+
+# 5 FIXED POTENTIAL PARTICLE GUIDANCE
+
+In this section, we will present and study a simple, yet effective, instantiation of particle guidance based on the definition of the time-evolving potential as a combination of predefined kernels. As we will see in the experiments in Section 6, this leads to significant sample efficiency improvements with no additional training required and little inference overhead.
+
+To promote diversity and sample efficiency, in our experiments, we choose the potential $\log \Phi_t$ to be the negative of the sum of a pairwise similarity kernel $k$ between each pair of particles $\log \Phi_t(\mathbf{x}_1,\ldots \mathbf{x}_n) = -\frac{\alpha_t}{2}\sum_{i,j}k_t(\mathbf{x}_i,\mathbf{x}_j)$ obtaining:
+
+$$
+d \mathbf {x} _ {i} = \left[ - f \left(\mathbf {x} _ {i}, t ^ {\prime}\right) + g ^ {2} \left(t ^ {\prime}\right) \left(\nabla_ {\mathbf {x} _ {i}} \log p _ {t ^ {\prime}} \left(\mathbf {x} _ {i}\right) - \alpha_ {t ^ {\prime}} \nabla_ {\mathbf {x} _ {i}} \sum_ {j = 1} ^ {n} k _ {t ^ {\prime}} \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}\right)\right) \right] d t + g \left(t ^ {\prime}\right) d \mathbf {w} \tag {4}
+$$
+
+Intuitively, the kernel term will push our different samples to be dissimilar from one another while at the same time the score term will try to match our distribution. Critically, this does not come at a significant additional runtime as, in most domains, the cost of running the pairwise similarity kernels is very small compared to the execution of the large score network architecture. Moreover, it allows the use of domain-specific similarity kernels and does not require training any additional classifier or score model. We can also view the particle guidance Eq. (4) as a sum of reverse-time SDE and a guidance term. Thus, to attain a more expedited generation speed, the reverse-time SDE can also be substituted with the probability flow ODE [Song et al., 2021].
+
+# 5.1 THEORETICAL ANALYSIS
+
+To understand the effect that particle guidance has beyond simple intuition, we study the joint distribution of sets of particles generated by the proposed reverse diffusion. However, unlike methods related to energy-based models (see coupled replicas, metadynamics, SVGD in Sec. 4) analyzing the effect of the addition of a time-evolving potential $\log \Phi_t$ in the reverse diffusion is non-trivial.
+
+While the score component in particle guidance is the score of the sequence of probability distributions $\tilde{p}_t(\mathbf{x}_1,\dots ,\mathbf{x}_n) = \Phi_t(\mathbf{x}_1,\dots ,\mathbf{x}_n)\prod_{i = 1}^n p_t(\mathbf{x}_i)$ , we are not necessarily sampling exactly $\tilde{p}_0$ because, for an arbitrary time-evolving potential $\Phi_t$ , this sequence of marginals does not correspond to a diffusion process. One strategy used by other works in similar situations [Du et al., 2023] relies on taking, after every step or at the end, a number of Langevin steps to reequilibrate and move the distribution back towards $\tilde{p}_t$ . This, however, increases significantly the runtime cost (every Langevin step requires score evaluation) and is technically correct only in the limit of infinite steps leaving uncertainty in the real likelihood of our samples. Instead, in Theorem 1, we use the Feynman-Kac theorem to derive a formula for the exact reweighting that particle guidance has on a distribution (derivation in Appendix A.1):
+
+Theorem 1. Under integrability assumptions, sampling $\mathbf{x}_1^T,\dots,\mathbf{x}_n^T$ from $p_T$ and following the particle guidance reverse diffusion process, we obtain samples from the following joint probability distribution at time $t = 0$ :
+
+$$
+\hat {p} _ {0} (\mathbf {x} _ {1}, \ldots , \mathbf {x} _ {n}) = \mathbb {E} [ Z \exp [ - \int_ {0} ^ {T} g (t) ^ {2} \{\langle \nabla \log \Phi_ {t} (\mathbf {X} _ {t}), \nabla \log \hat {p} _ {t} (\mathbf {X} _ {t}) \rangle + \Delta \log \Phi_ {t} (\mathbf {X} _ {t}) \} \mathrm {d} t ] ],
+$$
+
+with $Z$ (explicit in the appendix) such that
+
+$$
+\prod_ {i = 1} ^ {N} p _ {0} (\mathbf {x} _ {i}) = \mathbb {E} [ Z ],
+$$
+
+$(\mathbf{X}_t)_{t\in [0,T]}$ is a stochastic process driven by the equation
+
+$$
+\mathrm {d} \mathbf {X} _ {t} = \left\{f \left(\mathbf {X} _ {t}, t\right) - g (t) ^ {2} \nabla \log p _ {t} \left(\mathbf {X} _ {t}\right) \right\} \mathrm {d} t + g (t) \mathrm {d} \mathbf {w}, \quad \mathbf {X} _ {0} = \left\{\mathbf {x} _ {i} \right\} _ {i = 1} ^ {N}.
+$$
+
+Hence the density $\hat{p}_0$ can be understood as a reweighting of the random variable $Z$ that represents I.I.D. sampling.
+
+Riemannian Manifolds. Note that our theoretical insights can also be extended to the manifold framework. This is a direct consequence of the fact that the Feynman-Kac theorem can be extended to the manifold setting, see for instance Benton et al. [2022].
+
+# 5.2 PRESERVING INVARIANCES
+
+The objects that we learn to sample from with generative models often present invariances such as the permutation of the atoms in a molecule or the roto-translation of a conformer. To simplify the learning process and ensure these are respected, it is common practice to build such invariances in the model architecture. In the case of diffusion models, to obtain a distribution that is invariant to the action of some group $G$ such as that of rotations or permutations, it suffices to have an invariant prior and build a score model that is $G$ -equivariant [Köhler et al., 2020; Xu et al., 2021]. Similarly, in our case, we are interested in distributions that are invariant to the action of $G$ on any of the set elements (see Section 6.2), we show that a sufficient condition for this invariance to be maintained is that the time-evolving potential $\Phi_t$ is itself invariant to $G$ -transformations of any of its inputs (see Proposition 1 in Appendix A.4).
+
+# 6 EXPERIMENTS
+
+Fixed potential particle guidance can be implemented on top of any existing trained diffusion model with the only requirement of specifying the potential/kernel to be used in the domain. We present three sets of empirical results in three very diverse domains. First, in Appendix C, we work with a synthetic experiment formed by a two-dimensional Gaussian mixture model, where we can visually highlight some properties of the method. In this section instead, we consider text-to-image and molecular conformer generation, two important tasks where diffusion models have established new state-of-the-art performances, and show how, in each of these tasks, particle guidance can provide improvements in sample efficiency pushing the diversity-quality Pareto frontier. The code is available at https://github.com/gcorso/particle-guidance.
+
+# 6.1 TEXT-TO-IMAGE GENERATION
+
+In practice, the most prevalent text-to-image diffusion models, such as Stable Diffusion [Rombach et al., 2021] or Midjourney, generally constrain the output budget to four images per given prompt. Ideally, this set of four images should yield a diverse batch of samples for user selection. However, the currently predominant method of classifier-free guidance [Ho, 2022] tends to push the mini-batch samples towards a typical mode to enhance fidelity, at the expense of diversity.
+
+To mitigate this, we apply the proposed particle guidance to text-to-image generation. We use Stable Diffusion v1.5, pre-trained on LAION-5B [Schuhmann et al., 2022] with a resolution of $512 \times 512$ , as our testbed. We apply an Euler solver with 30 steps to solve for the ODE version of particle guidance. Following [Xu et al., 2023a], we use the validation set in COCO 2014 [Lin et al., 2014] for evaluation, and the CLIP [Hessel et al., 2021]/Aesthetic score [Team, 2022] (higher is better) to assess the text-image alignment/visual quality, respectively. To evaluate the diversity within each batch of generated images corresponding to a given prompt, we introduce the in-batch similarity
+
+score. This metric represents the average pairwise cosine similarity of features within an image batch, utilizing the pre-trained DINO [Caron et al., 2021] as the feature extractor. Contrasting the FID score, the in-batch similarity score specifically measures the diversity of a batch of images generated for a given prompt. We use a classifier-free guidance scale from 6 to 10 to visualize the trade-off curve between the diversity and CLIP/Aesthetic score, in line with prior works [Xu et al., 2023a; Sahara et al., 2022]. For particle guidance, we implement the RBF kernel on the down-sampled pixel space (the latent space of the VAE encoder-) in Stable Diffusion, as well as the feature space of DINO. Please refer to Appendix E.1 for more experimental details.
+
+
+(a) In-batch similarity versus CLIP score
+
+
+(b) In-batch similarity versus Aesthetic score
+
+
+Figure 2: In-batch similarity score versus (a) CLIP ViT-g/14 score and (b) Aesthetic score for text-to-image generation at $512 \times 512$ resolution, using Stable Diffusion v1.5 with a varying guidance scale from 6 to 10.
+(a) I.I.D.
+Figure 3: Text prompt: (a,b) "A baby eating a cake with a tie around his neck with balloons in the background" (COCO); (c,d,e) "VAN GOGH CAFE TERASSE copy.jpg", with original training data in (c).
+
+
+(b) PG
+
+
+(c) Training data
+
+
+(d) I.I.D.
+
+
+(e) PG
+
+As shown in Fig. 2(a) and Fig. 2(b), particle guidance (PG) consistently obtains a better (lower) in-batch similarity score in most cases, given the same CLIP/Aesthetic score, with a classifier-free guidance scale ranging from 6 to 10. Conversely, we observe that while in-batch similarity score of I.I.D. sampling improves with the reduced classifier-free guidance scale, particle guidance continues to surpass I.I.D. sampling in terms of CLIP/Aesthetic score given the same in-batch similarity. When the potential is the similarity kernel applied in the feature space, particle guidance notably attains a lower in-batch similarity score compared to I.I.D. sampling or to the approach in the original downsampled pixel space. This suggests that utilizing a semantically meaningful feature space is more appropriate for determining distances between images.
+
+In Fig. 3, we further visualize generated batches of four images per prompt by I.I.D. sampling and particle guidance (feature) with the same random seeds, when fixing the classifier-free guidance scale to 9. We can see that particle guidance improves the visual diversity in the generated batch. Interestingly, particle guidance can also help to alleviate the memorization issue of Stable Diffusion [Somepalli et al., 2023]. For example, given the text prompt of a painting from LAION dataset, particle guidance (Fig. 3(e)) avoids the multiple replications of the training data in the I.I.D. setting (the top-left and the bottom-right images in Fig. 3(d)). We provide extended samples in Appendix F, and additionally show that SVGD (Eq. 2) fails to promote diversity, instead yielding a set of blurry images.
+
+# 6.2 MOLECULAR CONFORMER GENERATION
+
+Molecular conformer generation is a key task in computational chemistry that consists of finding the set of different conformations that a molecule most likely takes in 3D space. Critically it is often important to find all or most of the low-energy conformers as each can determine a different behavior
+
+Table 1: Quality of generated conformer ensembles for the GEOM-DRUGS test set in terms of Coverage (\%) and Average Minimum RMSD (Å). We follow the experimental setup from [Ganea et al., 2021], for experimental details and introduction of the baselines please refer to Appendix D.
+
+
Method
Recall
Precision
Coverage ↑
AMR ↓
Coverage ↑
AMR ↓
Mean
Med
Mean
Med
Mean
Med
Mean
Med
RDKit ETKDG
38.4
28.6
1.058
1.002
40.9
30.8
0.995
0.895
OMEGA
53.4
54.6
0.841
0.762
40.5
33.3
0.946
0.854
GeoMol
44.6
41.4
0.875
0.834
43.0
36.4
0.928
0.841
GeoDiff
42.1
37.8
0.835
0.809
24.9
14.5
1.136
1.090
Torsional Diffusion
72.7
80.0
0.582
0.565
55.2
56.9
0.778
0.729
TD w/ particle guidance
77.0
82.6
0.543
0.520
68.9
78.1
0.656
0.594
+
+(e.g. by binding to a protein). This necessity is reflected in the metrics used by the community that look both at coverage (also called recall) and precision over the set predictions.
+
+Over the past few years, molecular conformer generation has been extensively studied by the machine learning community, with well-established benchmarks [Axelrod & Gomez-Bombarelli, 2022] and several generative models designed specifically for this task [Ganea et al., 2021; Xu et al., 2021; Jing et al., 2022]. However, all these methods are based on training a generative model to generate single samples and then running this model several times (more than 200 on average in the standard GEOM-DRUGS dataset) to generate a large number of I.I.D. samples.
+
+As discussed before, however, this strategy is suboptimal to generate representative sets of samples and cover the distribution. Therefore, we take the state-of-the-art conformer generation model, torsional diffusion, and, without retraining the model itself, we show that we can obtain significant improvements in both coverage and precision via particle guidance.
+
+Torsional diffusion [Jing et al., 2022] defines the diffusion process over the manifold defined by changes in torsion angles from some initial conformer because of the relative rigidity of the remaining degrees of freedom. Given this observation, we also define the guidance kernel on this manifold as an RBF kernel over the dihedral angle differences.
+
+Another important consideration when dealing with molecular conformers is given by the permutation symmetries that characterize several molecules: conformers that appear different might be very similar under permutations of the order of the atoms that do not change the bond structure. To maximize the sample efficiency and avoid generating similar conformers, we make the kernel invariant to these transformations. For this, we employ the simple strategy to take the minimum value of the original kernel under the different perturbations (formalized in Appendix D).
+
+Table 1 shows that by applying particle guidance to SDE-based reverse process of torsional diffusion (see Appendix D for details) we are able to balance coverage and precision being able to obtain, without retraining the model, significantly improved results on both metrics with $8\%$ and $19\%$ simultaneous reductions respectively in recall and precision median AMR.
+
+# 7 LEARNED POTENTIAL PARTICLE GUIDANCE
+
+While the fixed potential particle guidance seen so far is very effective in improving the diversity of samples with little overhead, it is hard to argue about the optimality of the resulting joint distribution. This is because of the complexity of the expression obtained in Theorem 1 and its dependence on the data distribution itself. Furthermore, in some domains, particularly in scientific applications, researchers need to control the distribution that they are sampling. This is necessary, for example, to apply correct importance weights or compute free energy differences. While Theorem 1 allows us to theoretically analyze properties of the distribution, the joint and marginal distributions remain largely intractable.
+
+In this section, we analyze how we can sample from desired joint probability distribution by learning a tailored time-evolving potential for particle guidance. Using the maximum entropy theorem [Csiszár, 1975], we can show that the distribution satisfying a bound on the expected value of a
+
+(diversity) metric $\Phi_0$ while minimizing the KL divergence with the independent distribution is:
+
+$$
+\hat {p} _ {0} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) \propto \Phi_ {0} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) ^ {\beta (\alpha)} \prod_ {i = 1} ^ {n} p \left(\mathbf {x} _ {i}\right) \tag {5}
+$$
+
+where $\beta$ is a function of $\alpha$ , the value of the bound on $E_{\hat{p}}[\log \Phi_0]$ .
+
+# 7.1 TRAINING PROCEDURE
+
+We now have to learn a time-evolving potential $\Phi_t$ that when used as part of the particle guidance framework generates $\hat{p}_0$ (we assume $\Phi_0$ is chosen such that $\beta(\alpha) = 1$ ). To achieve this, we mandate that the generation process of particle guidance in Eq. 1 adheres to the sequence of marginals $\hat{p}_t(\mathbf{x}_1^t, \dots, \mathbf{x}_n^t) = \Phi_t(\mathbf{x}_1^t, \dots, \mathbf{x}_n^t) \prod_{i=1}^{n} p_t(\mathbf{x}_i^0)$ and learn $\Phi_t^\theta$ to satisfy this evolution. Under mild assumptions, using Doob $h$ -theory (derivation in Appendix A.2), we show that we can learn the $\Phi_t^\theta$ by the following objective:
+
+$$
+\theta^ {*} = \underset {\theta} {\arg \min } \mathbb {E} _ {\mathbf {x} _ {1} ^ {0}, \dots , \mathbf {x} _ {n} ^ {0} \sim p _ {0}} \mathbb {E} _ {\mathbf {x} _ {i} ^ {t} \sim p _ {t | 0} (\cdot | \mathbf {x} _ {i} ^ {0})} [ \| \Phi_ {0} (\mathbf {x} _ {1} ^ {0}, \dots , \mathbf {x} _ {n} ^ {0}) - \Phi_ {t} ^ {\theta} (\mathbf {x} _ {1} ^ {t}, \dots , \mathbf {x} _ {n} ^ {t}) \| ^ {2} ] \qquad (6)
+$$
+
+where $p_{t|0}$ is the Gaussian perturbation kernel in diffusion models. Importantly, here the initial $\mathbf{x}_i^0$ are sampled independently from the data distribution so this training scheme can be easily executed in parallel to learning the score of $p_t$ .
+
+# 7.2 PRESERVING MARGINAL DISTRIBUTIONS
+
+While the technique discussed in the previous section is optimal in the maximum entropy perspective, it does not (for arbitrary $\Phi_0$ ) preserve the marginal distributions of individual particles, i.e. marginalizing $\mathbf{x}_i$ over $\hat{p}$ does not recover $p$ . Although not critical in many settings and not respected, for a finite number of particles, neither by the related methods in Section 4 nor by the fixed potential PG, this is an important property in some applications.
+
+Using again the maximum entropy theorem, we can show that the distribution satisfying a bound on the expected value of a (diversity) metric $\Phi_0^{\prime}$ and preserving the marginal distribution while minimizing the KL divergence with the independent distribution can be written as:
+
+$$
+\hat {p} _ {0} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) \propto \Phi_ {0} ^ {\prime} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) ^ {\beta (\alpha)} \prod_ {i = 1} ^ {n} p \left(\mathbf {x} _ {i}\right) \gamma_ {\theta} \left(\mathbf {x} _ {i}\right) \tag {7}
+$$
+
+for some scalar function over individual particles $\gamma_{\theta}$ . In Appendix A.3, we derive a new training scheme to learn the parameters of $\gamma_{\theta}$ . This relies on setting the normalization constant to an arbitrary positive value and learning values of $\theta$ that respect the marginals. Once $\gamma_{\theta}$ is learned, its parameters can be frozen and the training procedure of Eq. 6 can be started.
+
+# 8 CONCLUSION
+
+In this paper, we have analyzed how one can improve the sample efficiency of generative models by moving beyond I.I.D. sampling and enforcing diversity, a critical challenge in many real applications that has been largely unexplored. Our proposed framework, particle guidance, steers the sampling process of diffusion models toward more diverse sets of samples via the definition of a time-evolving joint potential. We have studied the theoretical properties of the framework such as the joint distribution it converges to for an arbitrary potential and how to learn potential functions that sample some given joint distribution achieving optimality and, if needed, preserving marginal distributions. Finally, we evaluated its performance in two important applications of diffusion models text-to-image generation and molecular conformer generation, and showed how in both cases it is able to push the Pareto frontier of sample diversity vs quality.
+
+We hope that particle guidance can become a valuable tool for practitioners to ensure diversity and fair representation in existing tools even beyond the general definition of diversity directly tackling known biases of generative models. Further, we hope that our methodological and theoretical contributions can spark interest in the research community for better joint-particle sampling methods.
+
+# ACKNOWLEDGMENTS
+
+We thank Xiang Cheng, Bowen Jing, Timur Garipov, Shangyuan Tong, Renato Berlinghieri, Saro Passaro, Simon Olsson, and Hannes Stark for their invaluable help with discussions and review of the manuscript. We also thank the anonymous reviewers for their useful feedback and suggestions. Concurrently with our work, Alex Pondaven also developed a similar idea1.
+This work was supported by the NSF Expeditions grant (award 1918839: Collaborative Research: Understanding the World Through Code), the Machine Learning for Pharmaceutical Discovery and Synthesis (MLPDS) consortium, the Abdul Latif Jameel Clinic for Machine Learning in Health, the DTRA Discovery of Medical Countermeasures Against New and Emerging (DOMANE) threats program, the DARPA Accelerated Molecular Discovery program, the NSF AI Institute CCF-2112665, the NSF Award 2134795, the GIST-MIT Research Collaboration grant, MIT-DSTA Singapore collaboration, and MIT-IBM Watson AI Lab.
+
+# REFERENCES
+
+Brian DO Anderson. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 1982.
+Simon Axelrod and Rafael Gomez-Bombarelli. Geom, energy-annotated molecular conformations for property prediction and molecular generation. Scientific Data, 2022.
+Alessandro Barducci, Giovanni Bussi, and Michele Parrinello. Well-tempered metadynamics: a smoothly converging and tunable free-energy method. Physical review letters, 2008.
+Joe Benton, Yuyang Shi, Valentin De Bortoli, George Deligiannidis, and Arnaud Doucet. From denoising diffusions to denoising markov models. arXiv preprint arXiv:2211.03595, 2022.
+Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, 2021.
+Wei-Cheng Chang, Chun-Liang Li, Youssef Mroueh, and Yiming Yang. Kernel stein generative modeling. arXiv preprint arXiv:2007.03074, 2020.
+Sitan Chen, Sinho Chewi, Jungshian Li, Yuanzhi Li, Adil Salim, and Anru R. Zhang. Sampling is as easy as learning the score: theory for diffusion models with minimal data assumptions. ArXiv, abs/2209.11215, 2022. URL https://api(semanticscholar.org/CorpusID:252438904.
+Sinho Chewi, Chen Lu, Kwangjun Ahn, Xiang Cheng, Thibaut Le Gouic, and Philippe Rigollet. Optimal dimension dependence of the metropolis-adjusted Langevin algorithm. *ArXiv*, abs/2012.12810, 2020.
+Gabriele Corso. Modeling molecular structures with intrinsic diffusion models. arXiv preprint arXiv:2302.12255, 2023.
+Gabriele Corso, Hannes Stärk, Bowen Jing, Regina Barzilay, and Tommi Jaakkola. Diffdock: Diffusion steps, twists, and turns for molecular docking. arXiv preprint arXiv:2210.01776, 2022.
+Imre Csiszár. I-divergence geometry of probability distributions and minimization problems. The annals of probability, pp. 146-158, 1975.
+Francesco D'Angelo and Vincent Fortuin. Annealedstein variational gradient descent. arXiv preprint arXiv:2101.09815, 2021.
+Valentin De Bortoli, Emile Mathieu, Michael Hutchinson, James Thornton, Yee Whye Teh, and Arnaud Doucet. Riemannian score-based generative modeling. arXiv preprint arXiv:2202.02763, 2022.
+Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in neural information processing systems, 2021.
+
+Yilun Du, Conor Durkan, Robin Strudel, Joshua B Tenenbaum, Sander Dieleman, Rob Fergus, Jascha Sohl-Dickstein, Arnaud Doucet, and Will Sussman Grathwohl. Reduce, reuse, recycle: Compositional generation with energy-based diffusion models and mcmc. In International Conference on Machine Learning. PMLR, 2023.
+Octavian Ganea, Lagnajit Pattanaik, Connor Coley, Regina Barzilay, Klavs Jensen, William Green, and Tommi Jaakkola. Geomol: Torsional geometric generation of molecular 3d conformer ensembles. Advances in Neural Information Processing Systems, 2021.
+John Geweke. Antithetic acceleration of monte carlo integration in bayesian inference. Journal of Econometrics, 38(1-2):73-89, 1988.
+Paul CD Hawkins and Anthony Nicholls. Conformer generation with omega: learning from the data set and the analysis of failures. Journal of chemical information and modeling, 2012.
+Jack Hessel, Ari Holtzman, Maxwell Forbes, Ronan Joseph Le Bras, and Yejin Choi. Clipscore: A reference-free evaluation metric for image captioning. In Conference on Empirical Methods in Natural Language Processing, 2021.
+Jonathan Ho. Classifier-free diffusion guidance. ArXiv, abs/2207.12598, 2022.
+Gerhard Hummer and Jürgen Kofinger. Bayesian ensemble refinement by replica simulations and reweighting. The Journal of chemical physics, 2015.
+John Ingraham, Max Baranov, Zak Costello, Vincent Frappier, Ahmed Ismail, Shan Tie, Wujie Wang, Vincent Xue, Fritz Obermeyer, Andrew Beam, et al. Illuminating protein space with a programmable generative model. BioRxiv, 2022.
+Bowen Jing, Gabriele Corso, Jeffrey Chang, Regina Barzilay, and Tommi Jaakkola. Torsional diffusion for molecular conformer generation. arXiv preprint arXiv:2206.01729, 2022.
+Ioannis Karatzas and Steven Shreve. Brownian motion and stochastic calculus. Springer Science & Business Media, 1991.
+Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. Advances in Neural Information Processing Systems, 2022.
+Jonas Kohler, Leon Klein, and Frank Noé. Equivariant flows: exact likelihood generative learning for symmetric densities. In International conference on machine learning, pp. 5361-5370. PMLR, 2020.
+Alex Kulesza, Ben Taskar, et al. Determinantal point processes for machine learning. Foundations and Trends® in Machine Learning, 5(2-3):123-286, 2012.
+Alessandro Laio and Michele Parrinello. Escaping free-energy minima. Proceedings of the national academy of sciences, 2002.
+Greg Landrum et al. Rdkit: A software suite for cheminformatics, computational chemistry, and predictive modeling, 2013.
+Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dóllár, and C. Lawrence Zitnick. Microsoft coco: Common objects in context. In European Conference on Computer Vision, 2014.
+Qiang Liu and Dilin Wang. Stein variational gradient descent: A general purpose bayesian inference algorithm. Advances in neural information processing systems, 29, 2016.
+Amey P Pasarkar, Gianluca M Bencomo, Simon Olsson, and Adji Bousso Dieng. Vendi sampling for molecular simulations: Diversity as a force for faster convergence and better exploration. The Journal of Chemical Physics, 159(14), 2023.
+Philipp Pracht, Fabian Bohle, and Stefan Grimme. Automated exploration of the low-energy chemical space with fast quantum chemical methods. Physical Chemistry Chemical Physics, 2020.
+Robin Rombach, A. Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
+
+Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L. Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, Seyedeh Sara Mahdavi, Raphael Gontijo Lopes, Tim Salimans, Jonathan Ho, David J. Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding. ArXiv, abs/2205.11487, 2022.
+Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, Patrick Schramowski, Srivatsa Kundurthy, Katherine Crowson, Ludwig Schmidt, Robert Kaczmarczyk, and Jenia Jitsev. Laion-5b: An open large-scale dataset for training next generation image-text models. ArXiv, abs/2210.08402, 2022.
+Chence Shi, Shitong Luo, Minkai Xu, and Jian Tang. Learning gradient fields for molecular conformation generation. In International Conference on Machine Learning, 2021.
+Richard Sinkhorn. A relationship between arbitrary positive matrices and doubly stochastic matrices. Annals of Mathematical Statistics, 35:876-879, 1964. URL https://api.sementicscholar.org/CorpusID:120846714.
+Growthami Somepalli, Vasu Singla, Micah Goldblum, Jonas Geiping, and Tom Goldstein. Diffusion art or digital forgery? investigating data replication in diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023.
+Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021.
+LAION-AI Team. Laion-aesthetics predictor v2. https://github.com/ christophschuhmann/improved-aesthetic-predictor, 2022.
+Yee Whye Teh, Max Welling, Simon Osindero, and Geoffrey E Hinton. Energy-based models for sparse overcomplete representations. Journal of Machine Learning Research, 2003.
+Oleg Trot and Arthur J Olson. Autodock vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading. Journal of computational chemistry, 2010.
+Li Kevin Wenliang and Heishiro Kanagawa. Blindness of score-based methods to isolated components and mixing proportions. 2020.
+Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, and Jian Tang. Geodiff: A geometric diffusion model for molecular conformation generation. In International Conference on Learning Representations, 2021.
+Yilun Xu, Ziming Liu, Max Tegmark, and Tommi Jaakkola. Poisson flow generative models. Advances in Neural Information Processing Systems, 2022.
+Yilun Xu, Mingyang Deng, Xiang Cheng, Yonglong Tian, Ziming Liu, and Tommi Jaakkola. Restart sampling for improving generative processes. arXiv preprint arXiv:2306.14878, 2023a.
+Yilun Xu, Ziming Liu, Yonglong Tian, Shangyuan Tong, Max Tegmark, and T. Jaakkola. Pfgm++: Unlocking the potential of physics-inspired generative models. In International Conference on Machine Learning, 2023b.
+Jason Yim, Brian L Trippe, Valentin De Bortoli, Emile Mathieu, Arnaud Doucet, Regina Barzilay, and Tommi Jaakkola. Se(3) diffusion model with application to protein backbone generation. arXiv preprint, 2023.
+Jianyi Zhang, Ruiyi Zhang, Lawrence Carin, and Changyou Chen. Stochastic particle-optimization sampling and the non-asymptotic convergence theory. In International Conference on Artificial Intelligence and Statistics. PMLR, 2020.
+Jingwei Zhuo, Chang Liu, Jiaxin Shi, Jun Zhu, Ning Chen, and Bo Zhang. Message passing stein variational gradient descent. In International Conference on Machine Learning. PMLR, 2018.
+
+# A DERIVATIONS
+
+# A.1 JOINT DISTRIBUTION UNDER PARTICLE GUIDANCE
+
+In this section, we provide the proof of Theorem 1. First, we restate the Feynman-Kac theorem. Let $u:[0,T]\times \mathbb{R}^d$ such that for any $t\in [0,T]$ and $x\in \mathbb{R}^d$ we have
+
+$$
+\partial_ {t} u (t, x) + \langle b (t, x), \nabla u (t, x) \rangle + (1 / 2) \langle \Sigma (t, x), \nabla^ {2} u (t, x) \rangle - V (t, x) u (t, x) + f (t, x) = 0, \tag {8}
+$$
+
+with $u(T,x) = \Phi (T,x)$ . Then, under integrability and regularity assumptions, see Karatzas & Shreve [1991] for instance, we have
+
+$$
+u (0, x) = \mathbb {E} \left[ \int_ {0} ^ {T} \exp \left[ - \int_ {0} ^ {r} V (\tau , \mathbf {X} _ {\tau}) \mathrm {d} \tau \right] f (r, \mathbf {X} _ {r}) \mathrm {d} r + \exp \left[ - \int_ {0} ^ {T} V (\tau , \mathbf {X} _ {\tau}) \mathrm {d} \tau \right] \Phi (T, \mathbf {X} _ {T}) \mid \mathbf {X} _ {0} = x \right], \tag {9}
+$$
+
+with $u(T,x) = \Phi (T,x)$ and $\mathrm{d}\mathbf{X}_t = b(t,\mathbf{X}_t)\mathrm{d}t + \Sigma (t,\mathbf{X}_t)\mathrm{d}\mathbf{B}_t$ . In the rest of this section, we derive the specific case of Theorem 1.
+
+We recall that the generative model with particle guidance is given by $(\hat{p}_t)_{t\in [0,T]}$ and is associated with the generative model
+
+$$
+\mathrm {d} \hat {\mathbf {Y}} _ {t} = \left\{- f \left(\hat {\mathbf {Y}} _ {t}, T - t\right) + g (T - t) ^ {2} \left(s _ {\theta} \left(\hat {\mathbf {Y}} _ {t}, T - t\right) + \nabla \log \Phi_ {T - t} \left(\hat {\mathbf {Y}} _ {t}\right)\right) \right\} \mathrm {d} t + g (T - t) \mathrm {d} \mathbf {w}. \tag {10}
+$$
+
+We also recall that the generative model without particle guidance is given by $(q_{t})_{t\in [0,T]}$ and is associated with the generative model
+
+$$
+\mathrm {d} \mathbf {Y} _ {t} = \{- f (\mathbf {Y} _ {t}, T - t) + g (T - t) ^ {2} s _ {\theta} (\mathbf {Y} _ {t}, T - t) \} \mathrm {d} t + g (T - t) \mathrm {d} \mathbf {w}. \tag {11}
+$$
+
+Using the Fokker-Planck equation associated with equation 11 we have for any $x\in (\mathbb{R}^d)^N$
+
+$$
+\partial_ {t} q _ {t} (x) + \operatorname {d i v} \left(\{- f (T - t, \cdot) + g (T - t) ^ {2} s _ {\theta} (T - t, \cdot) \} q _ {t}\right) (x) - (g (T - t) ^ {2} / 2) \Delta q _ {t} (x) = 0. \tag {12}
+$$
+
+This can also be rewritten as
+
+$$
+\begin{array}{l} \partial_ {t} q _ {t} (x) + \left\langle - f (T - t, x) + g (T - t) ^ {2} s _ {\theta} (x, T - t), \nabla q _ {t} (x) \right\rangle - \left(g (T - t) ^ {2} / 2\right) \Delta q _ {t} (x) (13) \\ + \operatorname {d i v} \left(\{- f (\cdot , T - t) + g (T - t) ^ {2} s _ {\theta} (T - t, \cdot) \}\right) (x) q _ {t} (x) = 0 (14) \\ \end{array}
+$$
+
+Denoting $u_{t} = q_{T - t}$ we have
+
+$$
+\begin{array}{l} \partial_ {t} u _ {t} (x) + \langle f (x, t) - g (t) ^ {2} s _ {\theta} (x, t), \nabla u _ {t} (x) \rangle + (g (t) ^ {2} / 2) \Delta u _ {t} (x) (15) \\ - \operatorname {d i v} \left(\{- f (t, \cdot) + g (t) ^ {2} s _ {\theta} (\cdot , t) \}\right) (x) u _ {t} (x) = 0. (16) \\ \end{array}
+$$
+
+Note that since $u_{t} = q_{T - t}$ , we have that $u_{t} = p_{t}$ with the conventions from 3. Now combining this result with equation 8 and equation 9 with $V(t,x) = \mathrm{div}\left(\{-f(\cdot ,t) + g(t)^{2}s_{\theta}(t,\cdot)\}\right)(x)$ and $f = 0$ we have that
+
+$$
+u _ {0} (x) = \mathbb {E} [ Z ], \tag {17}
+$$
+
+with
+
+$$
+Z = \exp \left[ - \int_ {0} ^ {T} V (\tau , \mathbf {X} _ {\tau}) \mathrm {d} \tau \right] p _ {0} \left(\mathbf {X} _ {T}\right), \tag {18}
+$$
+
+and
+
+$$
+\mathrm {d} \mathbf {X} _ {t} = \left\{f (t, \mathbf {X} _ {t}) - g (t) ^ {2} s _ {\theta} (\mathbf {X} _ {t}, t) \right\} \mathrm {d} t + g (t) \mathrm {d} \mathbf {w}. \tag {19}
+$$
+
+with $\mathbf{X}_0 = x$ . We now consider a similar analysis in the case of the generative with particle guidance. Using the Fokker-Planck equation associated with equation 10 we have for any $x \in (\mathbb{R}^d)^N$
+
+$$
+\partial_ {t} \tilde {q} _ {t} (x) + \operatorname {d i v} \left(\{- f (\cdot , T - t) + g (T - t) ^ {2} \left(s _ {\theta} (\cdot , T - t) + \nabla \log \Phi_ {T - t}\right) \} \tilde {q} _ {t}\right) (x) - \left(g (T - t) ^ {2} / 2\right) \Delta \tilde {q} _ {t} (x) = 0. \tag {20}
+$$
+
+This can also be rewritten as
+
+$$
+\begin{array}{l} \partial_ {t} \tilde {q} _ {t} (x) + \langle - f (x, T - t) + g (T - t) ^ {2} s _ {\theta} (x, T - t), \nabla \tilde {q} _ {t} (x) \rangle - (g (T - t) ^ {2} / 2) \Delta \tilde {q} _ {t} (x) (21) \\ + \operatorname {d i v} \left(\{- f (\cdot , T - t) + g (T - t) ^ {2} s _ {\theta} (\cdot , T - t) \}\right) (x) \tilde {q} _ {t} (x) (22) \\ + g (T - t) ^ {2} \left(\left\langle \log \Phi_ {T - t} (x), \nabla \log \tilde {q} _ {t} (x) \right\rangle + \Delta \log \Phi_ {T - t} (x)\right) \tilde {q} _ {t} (x) = 0. (23) \\ \end{array}
+$$
+
+Denoting $\hat{u}_t = \tilde{q}_{T - t}$ we have
+
+$$
+\begin{array}{l} \partial_ {t} \hat {u} _ {t} (x) + \langle f (t, x) - g (t) ^ {2} s _ {\theta} (x, t), \nabla \hat {u} _ {t} (x) \rangle + (g (t) ^ {2} / 2) \Delta \hat {u} _ {t} (x) (24) \\ - \operatorname {d i v} \left(\{- f (\cdot , t) + g (t) ^ {2} s _ {\theta} (t, \cdot) \}\right) (x) \hat {u} _ {t} (x) (25) \\ - g (t) ^ {2} \left(\left\langle \nabla \log \Phi_ {t} (x), \nabla \log \tilde {q} _ {T - t} (x) \right\rangle + \Delta \log \Phi_ {t} (x)\right) \hat {u} _ {t} (x) = 0. (26) \\ \end{array}
+$$
+
+Following the convention of 3, we have that $\hat{u}_t = \hat{p}_0$ . Now combining this result with equation 8 and equation 9 with $\hat{V}(t,x) = \mathrm{div}(\{-f(\cdot,t) + g(t)^2 s_\theta (\cdot,t)\})(x) + g(t)^2 (\langle \nabla \log \Phi_t(x), \nabla \log \tilde{p}_{T - t}(x) \rangle + \Delta \log \Phi_t(x))$ and $f = 0$ we have that
+
+$$
+\hat {u} _ {0} (x) = \mathbb {E} [ \hat {Z} ], \tag {27}
+$$
+
+with
+
+$$
+\hat {Z} = \exp \left[ - \int_ {0} ^ {T} \hat {V} (\tau , \mathbf {X} _ {\tau}) \mathrm {d} \tau \right] p _ {0} \left(\mathbf {X} _ {T}\right), \tag {28}
+$$
+
+and
+
+$$
+\mathrm {d} \mathbf {X} _ {t} = \left\{f \left(\mathbf {X} _ {t}, t\right) - g (t) ^ {2} s _ {\theta} \left(\mathbf {X} _ {t}, t\right) \right\} \mathrm {d} t + g (t) \mathrm {d} \mathbf {w}. \tag {29}
+$$
+
+again with $\mathbf{X}_0 = x$ . We conclude the proof upon noting that
+
+$$
+\hat {Z} = Z \exp \left[ - \int_ {0} ^ {T} g (t) ^ {2} \left(\left\langle \nabla \log \Phi_ {t} (\mathbf {X} _ {t}), \nabla \log \hat {u} _ {t} (\mathbf {X} _ {t}) \right\rangle + \Delta \log \Phi_ {t} (\mathbf {X} _ {t})\right) d t \right]. \tag {30}
+$$
+
+Interpretation An interpretation of this reweighting term can be given through the lens of SVGD. We introduce the Stein operator as in Liu & Wang [2016] given by for any $\Psi : (\mathbb{R}^d)^N \to (\mathbb{R}^d)^N$ by
+
+$$
+\mathcal {A} _ {\hat {p} _ {t}} \left(\Psi_ {t}\right) = \nabla \log \hat {p} _ {t} \Psi_ {t} ^ {\top} + \nabla \Psi_ {t}. \tag {31}
+$$
+
+Using $\Psi_t = \nabla \log \Phi_t$ , we get that
+
+$$
+\operatorname {T r} \left(\mathcal {A} _ {\hat {p} _ {t}} \left(\Psi_ {t}\right)\right) = \left\langle \nabla \log \Phi_ {t}, \nabla \log \hat {p} _ {t} \right\rangle + \Delta \log \Phi_ {t}. \tag {32}
+$$
+
+The squared expectation of this quantity w.r.t. a distribution $q$ on $(\mathbb{R}^d)^N$ is the Kernel Stein Discrepancy (KSD) between $q$ and $\hat{p}_t$ given the kernel $\log \Phi_t$ .
+
+# A.2 SAMPLING A PREDEFINED JOINT DISTRIBUTION
+
+For ease of derivation via the Doob h-transform, we temporarily reverse the time from $t$ to $T - t$ . Here, $p_T$ is treated as the data distribution, and $\Phi_T$ is regarded as the potential, as specified by users. We now consider another model. Namely, we are looking for a generative model $\hat{p}_t$ with $t \in [0,T]$ such that for any $t \in [0,T]$ we have $\hat{p}_t = p_t\Phi_t$ with $\Phi_T$ given by the user. In layman's terms, this means that we are considering a factorized model for all times $t$ with the additional requirement that at the final time $T$ , the model is given by $p_T = \hat{p}_T\Phi_T$ with $\Phi_T$ known. This is to be compared with Theorem 1. Indeed in Theorem 1 while the update on the generative dynamics is explicit (particle guidance term), the update on the density is not. In what follows, we are going to see, using tools from Doob $h$ -transform theory, that we can obtain an expression for the update of the drift in the generative process when considering models of the form $\hat{p}_t = p_t\Phi_t$ .
+
+More precisely, we consider the following model. Let $\hat{p}_T = p_T$ and for any $s,t\in [0,T]$ with $s < t$ and $\mathbf{x}_s^{1:n} = \{\mathbf{x}_t^i\}_{i = 1}^n\in (\mathbb{R}^d)^n$ and $\mathbf{x}_t^{1:n} = \{\mathbf{x}_t^i\}_{i = 1}^n\in (\mathbb{R}^d)^n$ we define
+
+$$
+\hat {p} _ {t | s} \left(\mathbf {x} _ {t} ^ {1: n} \mid \mathbf {x} _ {s} ^ {1: n}\right) = p _ {t | s} \left(\mathbf {x} _ {t} ^ {1: n} \mid \mathbf {x} _ {s} ^ {1: n}\right) \Phi_ {t} \left(\mathbf {x} _ {t} ^ {1: n}\right) / \Phi_ {s} \left(\mathbf {x} _ {s} ^ {1: n}\right), \tag {33}
+$$
+
+with $\Phi_t$ which satisfies for any $\mathbf{x}_t^{1:n} \in (\mathbb{R}^d)^n$
+
+$$
+\partial_ {t} \Phi_ {t} \left(\mathbf {x} _ {t} ^ {1: n}\right) + \left\langle - f _ {T - t} \left(\mathbf {x} _ {t} ^ {1: n}\right) + g (T - t) ^ {2} \nabla \log p _ {t} \left(\mathbf {x} _ {t} ^ {1: n}\right), \nabla \Phi_ {t} \left(\mathbf {x} _ {t} ^ {1: n}\right) \right\rangle + \left(g (T - t) ^ {2} / 2\right) \Delta \Phi_ {t} \left(\mathbf {x} _ {t} ^ {1: n}\right) = 0, \tag {34}
+$$
+
+with $\Phi_T$ given. Note that equation 34 expresses that $\Phi_t$ satisfies the backward Kolmogorov equation. Under mild assumptions, using Doob $h$ -theory, we get that there exists $(\hat{\mathbf{X}}_t)_{t \in [0,T]}$ such that for any $t \in [0,T]$ we have $\hat{\mathbf{Y}}_t \sim \hat{p}_t$ and for any $t \in [0,T]$
+
+$$
+\mathrm {d} \hat {\mathbf {Y}} _ {t} = \left\{- f _ {T - t} \left(\hat {\mathbf {Y}} _ {t}\right) + g (T - t) ^ {2} \left[ \nabla \log p _ {t} \left(\hat {\mathbf {Y}} _ {t}\right) + \nabla \log \Phi_ {t} \left(\hat {\mathbf {Y}} _ {t}\right) \right] \right\} \mathrm {d} t + g (T - t) \mathrm {d} \mathbf {w}. \tag {35}
+$$
+
+The main difficulty is to compute $\Phi_t$ for any $t \in [0, T]$ . Under mild assumptions, solutions to the backward Kolmogorov equation 34 are for any $t \in [0, T]$ by
+
+$$
+\Phi_ {t} \left(\mathbf {x} _ {t} ^ {1: n}\right) = \mathbb {E} \left[ \Phi_ {T} \left(\mathbf {Y} _ {T}\right) \mid \mathbf {Y} _ {t} = \mathbf {x} _ {t} ^ {1: n} \right] = \int \Phi_ {T} \left(\mathbf {Y} _ {T} = \mathbf {x} _ {T} ^ {1: n}\right) p _ {T | t} \left(\mathbf {x} _ {T} ^ {1: n} \mid \mathbf {x} _ {t} ^ {1: n}\right) d \mathbf {x} _ {T} ^ {1: n}, \tag {36}
+$$
+
+where we have
+
+$$
+\mathrm {d} \mathbf {Y} _ {t} = \left\{- f _ {T - t} \left(\mathbf {Y} _ {t}\right) + g (T - t) ^ {2} \nabla \log p _ {t} \left(\mathbf {Y} _ {t}\right) \right\} \mathrm {d} t + g (T - t) \mathrm {d} \mathbf {w}. \tag {37}
+$$
+
+This means that $(\mathbf{Y}_t)_{t\in [0,T]}$ is given by the original generative model, with time-dependent marginals $p_t$ . The expression equation 36, suggests to parameterize $\Phi_t$ by $\Phi_t^\theta$ and to consider the loss function
+
+$$
+\ell_ {t} (\theta) = \mathbb {E} _ {\mathbf {Y} _ {T}} \mathbb {E} _ {\mathbf {Y} _ {t} \sim p _ {t | T} (\cdot | \mathbf {Y} _ {T})} [ \| \Phi_ {T} (\mathbf {Y} _ {T}) - \Phi_ {t} ^ {\theta} (\mathbf {Y} _ {t}) \| ^ {2} ]. \tag {38}
+$$
+
+Then, we can define a global loss function $\mathcal{L}(\theta) = \int_0^T\lambda (t)\ell_t(\theta)\mathrm{d}t$ where $\lambda_{t}$ is some weight. One problem with this original loss function is that it requires sampling and integrating with respect to $\mathbf{Y}_t$ which requires sampling from the generative model.
+
+Recall that we reverse the time from $t$ to $T - t$ at the beginning. Reverse back to the original convention in the main text, Eq. (39) can be expressed as
+
+$$
+\ell_ {t} (\theta) = \mathbb {E} _ {\mathbf {X} _ {0} \sim p _ {0}} \mathbb {E} _ {\mathbf {X} _ {t} \sim p _ {t | 0} (\cdot | \mathbf {X} _ {T})} [ \| \Phi_ {0} (\mathbf {X} _ {0}) - \Phi_ {t} ^ {\theta} (\mathbf {X} _ {t}) \| ^ {2} ]. \tag {39}
+$$
+
+# A.3 PRESERVING MARGINAL DISTRIBUTIONS
+
+For arbitrary time evolving potentials $\Phi_t(\mathbf{x}_1, \dots, \mathbf{x}_n)$ sampling using particle guidance does not preserve the marginals $p(\mathbf{x}_i) \neq \int_{\mathbf{x}_1, \dots, \mathbf{x}_{i-1}, \mathbf{x}_{i+1}, \dots, \mathbf{x}_n} \hat{p}(\mathbf{x}_1, \dots, \mathbf{x}_n) d\mathbf{x}_1 \dots d\mathbf{x}_{i-1} d\mathbf{x}_{i+1} \dots d\mathbf{x}_n$ . In many domains this is not required and none of the methods discussed in Section 4 have this property for finite number of particles, however, in domains where, for example, one wants to obtain unbiased estimates of some function this property may be useful.
+
+While the technique discussed in Section 7 allows us to use any potential $\Phi_0(\mathbf{x}_1,\dots,\mathbf{x}_n)$ choosing $\Phi_0$ in such a way that preserves marginals is hard for non-trivial potentials and distributions. Therefore, we propose to learn a non-trivial marginal preserving $\Phi_0^\theta$ from the data in the following way. Let $\Phi_0^\theta (\mathbf{x}_1,\ldots ,\mathbf{x}_n) = \Phi_0'(\mathbf{x}_1,\ldots ,\mathbf{x}_n)\prod_i\gamma_\theta (\mathbf{x}_i)$ where $\Phi_0^{\prime}$ is some predefined joint potential that, for example, encourages diversity in the joint distribution and $\gamma_{\theta}$ is a learned scalar function operating on individual points that counterbalances the effect that $\Phi_0^{\prime}$ has on marginals while maintaining its effect on sample diversity.
+
+How do we learn such scaling function $\gamma_{\theta}$ to preserve marginals? By definition, the individual marginal distribution is (consider $i = 1$ w.l.o.g.):
+
+$$
+\begin{array}{l} \hat {p} _ {1} (\mathbf {x} _ {1}) = \frac {\int_ {\mathbf {x} _ {2} , \ldots , \mathbf {x} _ {n}} \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1} , \ldots , \mathbf {x} _ {n}) \prod_ {i} p (\mathbf {x} _ {i}) \gamma_ {\theta} (\mathbf {x} _ {i}) d \mathbf {x} _ {2} \ldots d \mathbf {x} _ {n}}{\int_ {\mathbf {x} _ {1} ^ {\prime} , \ldots , \mathbf {x} _ {n} ^ {\prime}} \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1} ^ {\prime} , \ldots , \mathbf {x} _ {n} ^ {\prime}) \prod_ {i} p (\mathbf {x} _ {i} ^ {\prime}) \gamma_ {\theta} (\mathbf {x} _ {i} ^ {\prime}) d \mathbf {x} _ {1} ^ {\prime} \ldots d \mathbf {x} _ {n} ^ {\prime}} = \\ = \frac {p (\mathbf {x} _ {1}) E _ {\mathbf {x} _ {2} , \ldots , \mathbf {x} _ {n} \sim \prod_ {i > 1} p (\mathbf {x} _ {i})} \left[ \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1} , \ldots , \mathbf {x} _ {n}) \prod_ {i} \gamma_ {\theta} (\mathbf {x} _ {i}) \right]}{E _ {\mathbf {x} _ {1} ^ {\prime} , \ldots , \mathbf {x} _ {n} ^ {\prime} \sim \prod_ {i} p (\mathbf {x} _ {i} ^ {\prime})} \left[ \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1} ^ {\prime} , \ldots , \mathbf {x} _ {n} ^ {\prime}) \prod_ {i} \gamma_ {\theta} (\mathbf {x} _ {i} ^ {\prime}) \right]} = \\ = p (\mathbf {x} _ {1}) \frac {E _ {\mathbf {x} _ {2} , \ldots , \mathbf {x} _ {n} \sim \prod_ {i > 1} p (\mathbf {x} _ {i})} \left[ \Phi_ {0} ^ {\theta} (\mathbf {x} _ {1} , \ldots , \mathbf {x} _ {n}) \right]}{E _ {\mathbf {x} _ {1} ^ {\prime} , \ldots , \mathbf {x} _ {n} ^ {\prime} \sim \prod_ {i} p (\mathbf {x} _ {i} ^ {\prime})} \left[ \Phi_ {0} ^ {\theta} (\mathbf {x} _ {1} ^ {\prime} , \ldots , \mathbf {x} _ {n} ^ {\prime}) \right]} \\ \end{array}
+$$
+
+Therefore $\hat{p}_1 = p$ if and only if the fraction is always equal to 1 (intuitively for the marginal to be maintained on average the potential should have no effect). Assuming that the joint potential $\Phi_0^{\prime}$ is invariant to the permutation to its inputs. Then one can also prove that, $\hat{p}_1 = p$ if and only if $E_{\mathbf{x}_2,\dots,\mathbf{x}_n} \sim \prod_{i > 1} p(\mathbf{x}_i)\left[\Phi_0^\theta (\mathbf{x}_1,\dots,\mathbf{x}_n)\right]$ is equal to a positive constant $C$ for any $x_1$ . We can then minimize the following regression loss to learn the scalar function $\gamma_\theta$ , by matching $E_{\mathbf{x}_2,\dots,\mathbf{x}_n} \sim \prod_{i > 1} p(\mathbf{x}_i)\left[\Phi_0^\theta (\mathbf{x}_1,\dots,\mathbf{x}_n)\right]$ and $C$ :
+
+$$
+\min _ {\theta} E _ {\mathbf {x} _ {1}} (E _ {\mathbf {x} _ {2}, \dots , \mathbf {x} _ {n} \sim \prod_ {i} p (\mathbf {x} _ {i})} [ \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) \prod_ {i \neq 1} \gamma_ {\theta} (\mathbf {x} _ {i}) ] - \frac {C}{\gamma_ {\theta} (\mathbf {x} _ {1})}) ^ {2}
+$$
+
+However, achieving this objective necessitates costly Monte Carlo estimations for the expectation over $n - 1$ independent samples. Moreover, obtaining an unbiased estimator for the full-batch gradient in a mini-batch setup is challenging. To bypass this issue, we implement a greedy update rule that optimizes the value $\gamma_{\theta}(\mathbf{x}_1)$ on the single sample $\mathbf{x}_1$ . The greedy update can be viewed as continuous extension of the Iterative Proportional Fitting (IPF) for symmetry matrices. The essence of the IPF algorithm lies in determining scaling factors for each row and column of a given matrix, ensuring that the sum of each row and column (the marginals) aligns with a specified target value. IPF is known for its uniqueness and convergence guarantees [Sinkhorn, 1964]. Let's denote
+
+$\phi_{i}(\mathbf{x}_{1},\dots,\mathbf{x}_{n}) = \text{stop\_grad}(\Phi_{0}'(\mathbf{x}_{1},\dots,\mathbf{x}_{n})\prod_{j\neq i}\gamma_{\theta}(\mathbf{x}_{j}))$ , the objective for the greedy update rule is as follows:
+
+$$
+\min _ {\gamma_ {\theta} (\mathbf {x} _ {1})} E _ {\mathbf {x} _ {1}} \left(E _ {\mathbf {x} _ {2}, \dots , \mathbf {x} _ {n}} \sim \prod_ {i \neq 1} p (\mathbf {x} _ {i}) \phi_ {1} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) - \frac {C}{\gamma_ {\theta} (\mathbf {x} _ {1})}\right) ^ {2}
+$$
+
+The gradient w.r.t $\theta$ in the objective above is:
+
+$$
+\theta^ {\prime} = \theta - \beta E _ {\mathbf {x} _ {1}, \mathbf {x} _ {2}, \dots , \mathbf {x} _ {n} \sim \prod_ {i} p (\mathbf {x} _ {i})} \left[ \frac {2 C}{\gamma_ {\theta} ^ {2} (\mathbf {x} _ {1})} \left(\phi_ {1} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) - \frac {C}{\gamma_ {\theta} (\mathbf {x} _ {1})}\right) \right] \nabla_ {\theta} \gamma_ {\theta} (x _ {1}) \tag {40}
+$$
+
+where $\beta$ is the learning rate. The corresponding update by stochastic gradient is:
+
+$$
+\begin{array}{l} \theta^ {\prime} = \theta - \beta \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ \frac {2 C}{\gamma_ {\theta} ^ {2} (\mathbf {x} _ {i})} \left(\phi_ {i} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) - \frac {C}{\gamma_ {\theta} (\mathbf {x} _ {i})}\right) \right] \nabla_ {\theta} \gamma_ {\theta} \left(x _ {i}\right) (41) \\ = \theta - \beta \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ \frac {2 C}{\gamma_ {\theta} ^ {3} (\mathbf {x} _ {i})} \left(\Phi_ {0} ^ {\theta} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}\right) - C\right) \right] \nabla_ {\theta} \gamma_ {\theta} (x _ {i}) (42) \\ \end{array}
+$$
+
+for $\mathbf{x}_1, \ldots, \mathbf{x}_n \sim \prod_i p(\mathbf{x}_i)$ . The stochastic gradient is an unbiased estimator of the gradient in Eq. (40).
+
+# A.3.1 EMPIRICAL SYNTHETIC EXPERIMENTS
+
+We demonstrate this training paradigm in a synthetic experiment using a mixture of Gaussian distributions in 2D. In particular, we set $p$ to be a mixture of 7 Gaussians with the same variance with placed as shown in Figure 4.A. The middle Gaussian has a weight that is four times that of the others.
+
+
+
+
+
+
+Figure 4: Synthetic experiment on learning a potential that preserves marginal distributions. The description of each plot can be found in the text.
+
+
+
+Figure 4.B shows the marginal distribution when sampling 10 particles with joint distribution:
+
+$$
+\tilde {p} _ {0} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) \propto \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) \prod_ {i = 1} ^ {n} p (\mathbf {x} _ {i})
+$$
+
+where $\Phi_0^{\prime}$ is a measure of diversity that in this case we take to be the exponential of the negative of the mean of pairwise Euclidean RBF similarity kernels. Table 2 highlights how sampling from
+
+this modified joint distribution significantly increases the diversity of the samples, especially when it comes to the expected value of $\log \Phi_0^{\prime}$ itself. However, as clear from Figure 4.B, the marginal distribution is significantly changed with the middle mode being sampled only $13\%$ of the times instead of $40\%$ and even the shape of the outer modes being altered.
+
+To fix this we learn a function $\gamma_{\theta}$ , here parameterized simply as the set of values on a grid representing the domain. We follow the training scheme presented in Eq. (41) obtaining the function presented in Figure 4.D. As evident from the plot, this has the effect of overweighing samples in the central mode, while downsampling samples in the outside modes, especially when coming from the outer parts. In Figure 4.C we plot the marginal of the resulting distribution:
+
+$$
+\hat {p} _ {0} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) \propto \Phi_ {0} ^ {\prime} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) \prod_ {i = 1} ^ {n} p (\mathbf {x} _ {i}) \gamma_ {\theta} (\mathbf {x} _ {i}).
+$$
+
+Although the marginals closely match, $\hat{p}_0$ still has more diversity in its sets of samples compared to I.I.D. sampling of $p$ , however, as seen in Table 2 the level of diversity in $\hat{p}_0$ is lower than that of $\tilde{p}_0$ , highlighting the "cost" of imposing the preservation of marginals.
+
+Table 2: Values of different observables under different joint probability distributions. For every method we take 5000 samples (of 10 particles), samples from $\tilde{p}_0$ and $\hat{p}_0$ were obtained reweighting 50000 samples of the independent I.I.D. distribution.
+
+
Observable
I.I.D. p
\(\tilde{p}_{0}\)
\(\hat{p}_{0}\)
Number of modes recovered at every sample
4.9
5.9
5.3
Expected value of \(\log \Phi_{0}^{\prime}\)
-37.3
-31.8
-36.3
+
+# A.4 INVARIANCE OF PARTICLE GUIDANCE
+
+Proposition 1. Let $G$ be the group of rotations or permutations of a set of vectors. Assuming that $p_T(\mathbf{x})$ is a $G$ -invariant distribution, the learned score $s(\mathbf{x}, t)$ and $f(\mathbf{x}, t)$ are $G$ -equivariant and the potential $\log \Phi_t(\mathbf{x}_1 \ldots \mathbf{x}_n)$ is $G$ -invariant to a transformation of any of its inputs, then the resulting distribution we sample from will also be $G$ -invariant to a transformation of any of the elements of the set.
+
+Note that in this section we will derive this specific formulation for the group of rotations or permutations and the Brownian motion in Euclidean space. For a more general statement on Lie groups $G$ and Brownian motions associated with a given metric, one could generalize the result from Yim et al. [2023] Proposition F.2.
+
+Proof. For simplicity, we will consider Euler discretization steps going with time from $T$ to 0 (as used in our experiments), however, the proposition applies in the continuous setting too:
+
+$$
+p _ {\theta} (\mathbf {x} _ {i} ^ {(t - 1)} | \mathbf {x} _ {1: n} ^ {(t)}) = p _ {\mathbf {z}} (\mathbf {x} _ {i} ^ {(t - 1)} - \mathbf {x} _ {i} ^ {(t)} + f (\mathbf {x} _ {i} ^ {(t)}, t) - g ^ {2} (\mathbf {s} _ {\theta} (\mathbf {x} _ {i} ^ {(t)}, t) + \nabla_ {\mathbf {x} _ {i} ^ {(t)}} \log \Phi_ {t} (\mathbf {x} _ {1: n} ^ {(t)})))
+$$
+
+where $\mathbf{z} \sim N(0, g^2 I)$ . Without loss of generality since the whole method is invariant to permutations of the particles, consider $\mathbf{x}_n$ to be the particle to which we apply $T_g$ the transformation of an arbitrary group element $g$ .
+
+Since by assumption $\log \Phi_t(\mathbf{x}_{1:n}^{(t)}) = \log \Phi_t(\mathbf{x}_{1:n-1}^{(t)}, T_g(\mathbf{x}_n^{(t)}))$ we have $p_\theta(\mathbf{x}_i^{(t-1)}|\mathbf{x}_{1:n}^{(t)}) = p_\theta(\mathbf{x}_i^{(t-1)}|\mathbf{x}_{1:n-1}^{(t)}, T_g(\mathbf{x}_n^{(t)}))$ .
+
+On the other hand, since $\log \Phi_t(\mathbf{x}_{1:n}^{(t)})$ is invariant to $G$ transformations of $\mathbf{x}_n^{(t)}$ , its gradient w.r.t. the same variable will be $G$ -equivariant. Therefore:
+
+$$
+\begin{array}{l} p _ {\theta} (T _ {g} (\mathbf {x} _ {n} ^ {(t - 1)}) | \mathbf {x} _ {1: n - 1} ^ {(t)}, T _ {g} (\mathbf {x} _ {n} ^ {(t)})) = \\ = p _ {\mathbf {z}} (T _ {g} (\mathbf {x} _ {n} ^ {(t - 1)}) - T _ {g} (\mathbf {x} _ {n} ^ {(t)}) + f (T _ {g} (\mathbf {x} _ {n} ^ {(t)}), t) - g ^ {2} (\mathbf {s} _ {\theta} (T _ {g} (\mathbf {x} _ {n} ^ {(t)}), t) + \nabla_ {\mathbf {x} _ {n} ^ {(t)}} \log \Phi_ {t} (\mathbf {x} _ {1: n - 1} ^ {(t)}, T _ {g} (\mathbf {x} _ {n} ^ {(t)})))) \\ = p _ {\mathbf {z}} \left(T _ {g} \left(\mathbf {x} _ {n} ^ {(t - 1)}\right) - T _ {g} \left(\mathbf {x} _ {n} ^ {(t)}\right) + T _ {g} \left(f \left(\mathbf {x} _ {n} ^ {(t)}, t\right)\right) - g ^ {2} \left(T _ {g} \left(\mathbf {s} _ {\theta} \left(\mathbf {x} _ {n} ^ {(t)}, t\right)\right) + T _ {g} \left(\nabla_ {\mathbf {x} _ {n} ^ {(t)}} \log \Phi_ {t} \left(\mathbf {x} _ {1: n} ^ {(t)}\right)\right)\right)\right) \\ = p _ {\mathbf {z}} (T _ {g} (\mathbf {x} _ {n} ^ {(t - 1)} - \mathbf {x} _ {n} ^ {(t)} + f (\mathbf {x} _ {n} ^ {(t)}, t) - g ^ {2} (\mathbf {s} _ {\theta} (\mathbf {x} _ {n} ^ {(t)}, t) + \nabla_ {\mathbf {x} _ {n} ^ {(t)}} \log \Phi_ {t} (\mathbf {x} _ {1: n} ^ {(t)}))) = p _ {\theta} (\mathbf {x} _ {n} ^ {(t - 1)} | \mathbf {x} _ {1: n} ^ {(t)}) \\ \end{array}
+$$
+
+where between lines 2 and 3 we have used the equivariance assumptions and in the latter two the properties of elements of $G$ .
+
+Putting these together, we follow a similar derivation of Proposition 1 from Xu et al. [2021]:
+
+$$
+\begin{array}{l} p _ {\theta} (\mathbf {x} _ {1: n - 1} ^ {(0)}, T _ {g} (\mathbf {x} _ {n} ^ {(0)})) = \\ = \int p (\mathbf {x} _ {1: n - 1} ^ {(T)}, T _ {g} (\mathbf {x} _ {n} ^ {(T)})) \prod_ {t = 1} ^ {T} p _ {\theta} (\mathbf {x} _ {1: n - 1} ^ {(t - 1)}, T _ {g} (\mathbf {x} _ {n} ^ {(t - 1)}) | \mathbf {x} _ {1: n - 1} ^ {(t)}, T _ {g} (\mathbf {x} _ {n} ^ {(t)})) = \\ = \int \left(\prod_ {i < n} p (\mathbf {x} _ {i} ^ {(T)})\right) \left(\prod_ {t = 1} ^ {T} \prod_ {i < n} p _ {\theta} (\mathbf {x} _ {i} ^ {(t - 1)} | \mathbf {x} _ {1: n - 1} ^ {(t)}, T _ {g} (\mathbf {x} _ {n} ^ {(t)}))\right). \\ \cdot \left(p (T _ {g} (\mathbf {x} _ {n} ^ {(T)})) \prod_ {t = 1} ^ {T} p _ {\theta} (T _ {g} (\mathbf {x} _ {n} ^ {(t - 1)}) | \mathbf {x} _ {1: n - 1} ^ {(t)}, T _ {g} (\mathbf {x} _ {n} ^ {(t)}))\right) = \\ = \int \left(\prod_ {i < n} p (\mathbf {x} _ {i} ^ {(T)})\right) \left(\prod_ {t = 1} ^ {T} \prod_ {i < n} p _ {\theta} (\mathbf {x} _ {i} ^ {(t - 1)} | \mathbf {x} _ {1: n} ^ {(t)})\right) \left(p (\mathbf {x} _ {n} ^ {(T)}) \prod_ {t = 1} ^ {T} p _ {\theta} (\mathbf {x} _ {n} ^ {(t - 1)} | \mathbf {x} _ {1: n} ^ {(t)})\right) = p _ {\theta} (\mathbf {x} _ {1: n} ^ {(0)}) \\ \end{array}
+$$
+
+
+
+# A.5 PARTICLE GUIDANCE AS SVGD
+
+In this section, we derive the approximation of Eq. 3 starting from the probability flow ODE equivalent of Eq. 4 under the assumptions of no drift $f(x,t) = 0$ and using the following form for $\Phi_t(x_1,\dots,x_n) = (\sum_{i,j}k_t(x_i,x_j))^{-\frac{n - 1}{2}}$ where $k_{t}$ is a similarity kernel based on the Euclidean distance (e.g. RBF kernel).
+
+$$
+\begin{array}{l} d x _ {i} = \left[ f (x _ {i}, t) - \frac {1}{2} g ^ {2} (t) \Bigg (\nabla_ {x _ {i}} \log p _ {t} (x _ {i}) + \nabla_ {x _ {i}} \log \Big (\sum_ {i j} k _ {t} (x _ {i}, x _ {j}) \Big) ^ {- \frac {n - 1}{2}} \Bigg) \right] d t \\ = - \frac {1}{2} g ^ {2} (t) d t \left(\nabla_ {x _ {i}} \log p _ {t} (x _ {i}) - \frac {\frac {1}{2} \nabla_ {x _ {i}} \sum_ {i j} k _ {t} (x _ {i} , x _ {j})}{\frac {1}{n - 1} \sum_ {i j} k _ {t} (x _ {i} , x _ {j})}\right) \\ \end{array}
+$$
+
+Now we can simplify the numerator using the fact that $k_{t}$ is symmetric and approximate the denominator assuming that different particles will have similar average distances to other particles:
+
+$$
+\begin{array}{l} \approx - \frac {1}{2} g ^ {2} (t) d t \bigg (\nabla_ {x _ {i}} \log p _ {t} (x _ {i}) - \frac {\nabla_ {x _ {i}} \sum_ {j} k _ {t} (x _ {i} , x _ {j})}{\sum_ {j} k _ {t} (x _ {i} , x _ {j})} \bigg) \\ = - \frac {g ^ {2} (t) d t}{2 S (x _ {i})} \bigg (\sum_ {j} k _ {t} (x _ {i}, x _ {j}) \nabla_ {x _ {i}} \log p _ {t} (x _ {i}) - \nabla_ {x _ {i}} k _ {t} (x _ {i}, x _ {j}) \bigg) \\ \end{array}
+$$
+
+where $S(x_{i}) = \sum_{j}k_{t}(x_{i},x_{j})$ . Now we can use the fact that $\nabla_{x_i}k_t(x_i,x_j) = -\nabla_{x_j}k_t(x_i,x_j)$ because the kernel only depends on the Euclidean distance between the two points:
+
+$$
+= - \frac {n g ^ {2} (t) d t}{2 S (x _ {i})} \left(\frac {1}{n - 1} \sum_ {j} k _ {t} \left(x _ {i}, x _ {j}\right) \nabla_ {x _ {i}} \log p _ {t} \left(x _ {i}\right) + \nabla_ {x _ {j}} k _ {t} \left(x _ {i}, x _ {j}\right)\right)
+$$
+
+Letting $\epsilon_t(x_i) = \frac{n g^2(t) \Delta t}{2 S(x_i)}$ , we obtain Eq. 3:
+
+$$
+x _ {i} ^ {t - \Delta t} \approx x _ {i} ^ {t} + \epsilon_ {t} (x _ {i}) \psi_ {t} \left(x _ {i} ^ {t}\right) \quad \text {w h e r e} \quad \psi (x) = \frac {1}{n - 1} \sum_ {j = 1} ^ {n} \left[ k _ {t} \left(x _ {j} ^ {t}, x\right) \nabla_ {x} \log p _ {t} (x) + \nabla_ {x _ {j} ^ {t}} k _ {t} \left(x _ {j} ^ {t}, x\right) \right]
+$$
+
+# A.6 PARTICLE GUIDANCE IN POISSON FLOW GENERATIVE MODELS
+
+In this section, we consider the more general Poisson Flow Generative Models++ [Xu et al., 2023b] framework in which the $N$ -dimensional data distribution is embedded into $N + D$ -dimensional space, where $D$ is a positive integer ( $D = 1 / D \to \infty$ recover PFGM [Xu et al., 2022]/diffusion models). The data distribution is interpreted as a positive charge distribution. Each particle independently follows the electric field generated by the $N$ -dimensional data distribution $p(x)$ embedded in a $N + D$ -dimensional space. One can similarly do particle guidance in the PFGM++ scenarios, treating the group of particles as negative charges, not only attracted by the data distribution but also exerting the mutually repulsive force. Formally, for the augmented data the ODE in PFGM++ (Eq.4 in Xu et al. [2023b]) is
+
+$$
+\frac {d x}{d r} = \frac {E (x , r) _ {x}}{E (x , r) _ {r}}
+$$
+
+where $E_{x}$ and $E_{r}$ are the electric fields for different coordinates:
+
+$$
+E (x, r) _ {x} = \frac {1}{S _ {N + D - 1} (1)} \int \frac {x - y}{\left(\| x - y \| ^ {2} + r ^ {2}\right) ^ {\frac {N + D}{2}}} p (y) d y
+$$
+
+$$
+E (x, r) _ {r} = \frac {1}{S _ {N + D - 1} (1)} \int \frac {r}{\left(\| x - y \| ^ {2} + r ^ {2}\right) ^ {\frac {N + D}{2}}} p (y) d y
+$$
+
+Note that when $r = \sigma \sqrt{D}, D \to \infty$ , the ODE is $\frac{dx}{dr} = \frac{E(x,r)_x}{E(x,r)_r} = -\frac{\sigma}{\sqrt{D}} \nabla_x \log p_\sigma(x)$ and the framework degenerates to diffusion models.
+
+Now if we consider the repulsive forces among a set of (uniformly weighted) particles with the same anchor variables $r$ , $\{(x_i, r)\}_{i=1}^n$ , only the electric field in the $x$ coordinate changes (the component in the $r$ coordinate is zero). Denote the new electric field in $x$ component as $\hat{E}_x$ :
+
+$$
+\hat {E} (x _ {i}, r) _ {x} = \underbrace {E (x _ {i} , r) _ {x}} _ {\text {a t t r a c t i v e f o r c e b y d a t a}} + \underbrace {\frac {1}{S _ {N + D - 1} (1)} \frac {1}{n - 1} \sum_ {j \neq i} \frac {x _ {j} - x _ {i}}{\left(\| x _ {j} - x _ {i} \| ^ {2}\right) ^ {\frac {N + D}{2}}}} _ {\text {r e p u l s i v e f o r c e b e t w e e n p a r t i c l e s}}
+$$
+
+The corresponding new ODE for the $i$ -th particle is
+
+$$
+\begin{array}{l} \frac {d x _ {i}}{d r} = \frac {\hat {E} (x _ {i} , r) _ {x}}{E (x _ {i} , r) _ {r}} \\ = \frac {E (x _ {i} , r) _ {x}}{E (x _ {i} , r) _ {r}} + \frac {\frac {1}{S _ {N + D - 1} (1)} \frac {1}{n - 1} \sum_ {j \neq i} \frac {x _ {j} - x _ {i}}{\left(\| x _ {j} - x _ {i} \| ^ {2}\right) ^ {\frac {N + D}{2}}}}{E (x _ {i} , r) _ {r}} \\ = \underbrace {\frac {E (x _ {i} , r) _ {x}}{E (x _ {i} , r) _ {r}}} _ {\text {p r e d i c t e d b y p r e - t r a i n e d m o d e l s}} + \underbrace {\frac {\frac {1}{n - 1} \sum_ {j \neq i} \frac {x _ {j} - x _ {i}}{\left(\| x _ {j} - x _ {i} \| ^ {2}\right) ^ {\frac {N + D}{2}}}}{\int \frac {r}{\left(\| x - y \| ^ {2} + r ^ {2}\right) ^ {\frac {N + D}{2}}} p (y) d y}} _ {\text {p a r t i c l e g u i d a n c e}} \\ = \frac {E (x _ {i} , r) _ {x}}{E (x _ {i} , r) _ {r}} + \frac {\frac {1}{n - 1} \sum_ {j \neq i} \frac {x _ {j} - x _ {i}}{\| x _ {j} - x _ {i} \| ^ {N + D}}}{\frac {S _ {N + D - 1}}{r ^ {D - 1} S _ {D - 1}} p _ {r} (x _ {i})} \\ \end{array}
+$$
+
+where $p_r$ is the intermediate distribution, and $S_n$ is the surface area of $n$ -sphere. Clearly, the direction of the guidance term can be regarded as the sum of the gradient of $N + D$ -dimensional Green's function $G(x,y) \propto 1 / ||x - y||^{N + D - 2}$ , up to some scaling factors:
+
+$$
+\nabla_ {x _ {i}} G (x _ {i}, x _ {j}) = \frac {x _ {i} - x _ {j}}{\| x _ {j} - x _ {i} \| ^ {N + D}}
+$$
+
+# A.7 COMBINATORIAL ANALYSIS OF SYNTHETIC EXPERIMENTS
+
+Proposition 2. Let us have a random variable taking a value equiprobably between $N$ distinct bins. The expectation of the proportion of bins discovered (i.e. sampled at least once) after $N$ samples is $1 - \left(\frac{N - 1}{N}\right)^{N}$ which tends to $1 - 1 / e$ as $N$ tends to infinity.
+
+Proof. Let $n_i$ be the number of samples in the $i^{th}$ bin. The proportion of discovered bins is equal to:
+
+$$
+\frac {1}{N} \mathbb {E} \bigg [ \sum_ {i = 1} ^ {N} I _ {n _ {i} > 0} \bigg ] = \frac {1}{N} \sum_ {i = 1} ^ {N} \mathbb {E} [ I _ {n _ {i} > 0} ] = P (n _ {i} > 0) = 1 - P (n _ {i} = 0) = 1 - \bigg (\frac {N - 1}{N} \bigg) ^ {N}
+$$
+
+In the limit of $N\to \infty$
+
+$$
+\lim _ {N \to \infty} 1 - \left(\frac {N - 1}{N}\right) ^ {N} = 1 - y = 1 - \frac {1}{e}
+$$
+
+since (using L'Hôpital's rule):
+
+$$
+\log y = \lim _ {N \to \infty} N \log \left(\frac {N - 1}{N}\right) = \lim _ {N \to \infty} \frac {\log (\frac {N - 1}{N})}{1 / N} = \lim _ {N \to \infty} \frac {1 / N ^ {2}}{- 1 / N ^ {2}} = - 1
+$$
+
+
+
+Therefore for $N = 10$ we would expect $10 * (1 - 0.9^{10}) \approx 6.51$ , which corresponds to what is observed in the empirical results of Section C.
+
+Proposition 3. (Coupon collector's problem) Let us have a random variable taking a value equipropbably between $N$ distinct bins. The expectation of the number of samples required to discover all the bins is $NH_{N}$ , where $H_{N}$ is the $N^{th}$ harmonic number, which is $\Theta (N\log N)$ as $N$ tends to infinity.
+
+Proof. Let $L_{i|j}$ be the number of samples it takes to go from $j$ to $i$ bins discovered. We are therefore interested in $\mathbb{E}[L_{N|0}]$ .
+
+$$
+\mathbb {E} [ L _ {j | j - 1} ] = \frac {N - (j - 1)}{N} * 1 + \frac {j - 1}{N} [ \mathbb {E} [ L _ {j | j - 1} ] + 1 ] \Rightarrow \mathbb {E} [ L _ {j | j - 1} ] = \frac {N}{N - (j - 1)}
+$$
+
+Therefore:
+
+$$
+\mathbb {E} \left[ L _ {N | 0} \right] = \mathbb {E} \left[ \sum_ {j = 1} ^ {N} L _ {j | j - 1} \right] = \sum_ {j = 1} ^ {N} \mathbb {E} \left[ L _ {j | j - 1} \right] = N \sum_ {j = 1} ^ {N} \frac {1}{N - (j - 1)} = N \sum_ {j = 1} ^ {N} \frac {1}{j} = N H _ {N}
+$$
+
+Since $H_{N}$ is $\Theta (\log N)$ , then $\mathbb{E}[L_{N|0}]$ is $\Theta (N\log N)$ .
+
+For $N = 10$ , $\mathbb{E}[L_{10|0}] \approx 29.29$ .
+
+# B DISCUSSIONS
+
+# B.1 SUBOPTIMALITY OF I.I.D. SAMPLING
+
+**Combinatorial analysis** Let us consider again the setting of a random variable taking a value equiprobably between N distinct bins. In Fig. 5, we plot the expected number of modes (or bins) captured as a function of the number of steps as derived in Appendix A.7. This suggests that the region where I.I.D. sampling is considerably suboptimal in these regards (capturing the modes of the distribution) is when the number of samples is comparable with the number of modes: if the number of modes is much larger than I.I.D. samples are still likely to capture separate modes, and if the number of samples is much larger the number of uncaptured modes is likely to be small.
+
+
+Figure 5: Plot of the functions $y = N(1 - (\frac{N - 1}{N})^x)$ and $y = \min(x, N)$ for $N = 1000$ representing, respectively, the expected number of modes captured by I.I.D. sampling a distribution with N equiprobable modes and the optimal coverage.
+
+Literature There is a vast literature that has studied the suboptimality of I.I.D. sampling from a statistical perspective and proposed different solutions. For example, in the field of Bayesian inference, antithetic sampling [Geweke, 1988] has been proposed as a way to reduce the variance of Monte Carlo estimates. Determinantal Point Processes [Kulesza et al., 2012] have also been widely studied as a technique to improve the diversity of samples.
+
+# B.2 RUNTIME AND MEMORY OVERHEAD
+
+The runtime overhead due to the addition of particle guidance to the inference procedure largely depends on the potential that is used and on the size of the set $n$ . In particular, while computing kernels tends to be significantly cheaper than running the score model, the number of kernel computations scales quadratically with $n$ while the number of score model executions at every step is $n$ .
+
+In terms of memory, particle guidance does not create any significant overhead since the kernel computations can be aggregated per element. However, when running inference on GPU if $n$ is larger than the batch size that fits the GPU memory when running score model inference, the data might have to be moved back and forth between RAM and GPU memory to enable synchronous steps for particle guidance, causing further overhead.
+
+In the case of our experiments on Stable Diffusion, the number of samples extracted (4) does not create significant overhead. However, in the setting of conformer generation on DRUGS different molecules can have very different numbers of conformers with some even having thousands of them. For efficiency, we therefore cap the size of $n$ in particle guidance to 128 and perform batches of 128 samples until the total number of conformers is satisfied.
+
+Other limitations A badly chosen potential or in general one with a guidance weight too high can overly change the marginal likelihood and negatively impact the sampling quality. As an example in Fig. 6 the use of a particle guidance parameter four times larger than the best one caused various aliasing artifacts on the image.
+
+However, in fixed potential particle guidance, its parameters can be easily fit at inference time, therefore, it is typically relatively inexpensive to test the optimal value of the guidance for the application of interest and the chosen potential. This leads to the prevention of too high guidance weights and the simple detection of bad potential when the optimal weight is close to 0.
+
+
+Figure 6: Example of a too large PG weight causing aliasing artifacts.
+
+# C SYNTHETIC EXPERIMENTS
+
+To show visually the properties of particle guidance and its effect on sample efficiency, we use a two-dimensional Gaussian mixture model. In particular, we consider a mixture of $N = 10$ identical Gaussian distributions whose centers are equally spaced over the unit circle and whose variance is 0.005. These Gaussians form a set of approximately disjoint equal bins. As we are interested in inference, no model is trained and the true score of the distribution is given as an oracle.
+
+As expected if one runs normal I.I.D. diffusion, the sample falls in one bin at random. Taking ten samples, as shown in Fig. 7, some of them will fall in the same bin and some bins will be left unfound. The empirical experiments confirm the combinatorial analysis (see Appendix A.7) which shows that the expected number of bins discovered with $N = 10$ samples is only 6.5 and it takes on average more than 29 samples to discover all the bins.
+
+
+
+
+Figure 7: Left: plot of random samples (in blue) of the two-dimensional Gaussian mixture distribution (density depicted in red). I.I.D. samples often recover the same modes, while particle guidance with a radial kernel captures all modes. Right: average number of modes recovered with 10 samples as a function of the weight given by the diffusion noising terms and the potential weight when using an RBF kernel with Euclidean and radial distances respectively. As expected with little weight to the potential terms we obtain approximately 6.5 modes recovered in line with the I.I.D. diffusion performance. Further increasing the potential weight on the Euclidean creates instability.
+
+
+
+
+
+In many settings this behavior is suboptimal, and we would want our model to discover all the modes of the distribution with as few samples as possible. Using the straightforward application of particle guidance with a simple RBF kernel based on the squared Euclidean distance, we are able to encourage diversity obtaining, on average, the discovery of nearly 9 bins on average from 10 samples (see Fig. 7).
+
+Intrinsic diffusion models [Corso, 2023] have shown significant improvements when diffusion models operate on the submanifold where the data lies. Similarly, here building into the kernel the degrees of freedom over which the diversity lies helps the particle guidance to effectively distribute the samples over the distribution. We know that the different modes are distributed in a radial fashion, and thus we build an RBF kernel based on the angle difference w.r.t. the origin. Using this lower-dimensional kernel enables us to consistently discover all modes of the distribution. This submanifold observation aligns well with the practice of methods such as metadynamics where the kernels are defined over some lower-dimensional collective variables of interest.
+
+# D MOLECULAR CONFORMER GENERATION EXPERIMENTS
+
+# D.1 DATASET, METRICS AND BASELINES
+
+Dataset We evaluate the method for the task of molecular conformer generation using the data from GEOM [Axelrod & Gomez-Bombarelli, 2022], a collection of datasets that has become the standard benchmark for this task in the machine learning community. In particular, we focus on
+
+GEOM-DRUGS, the largest, most pharmaceutically relevant and widely used dataset in GEOM which consists of 304k drug-like molecules. For each of these molecules, an ensemble of conformers was generated with metadynamics in CREST [Pracht et al., 2020], a procedure that gives accurate structures but is prohibitive in high-throughput applications, costing an average of 90 core-hours per molecule. To be able to use existing pretrained models we rely on the experimental setup and splits introduced by Ganea et al. [2021] and used by several papers afterward. As we do not retrain the score model, we do not use the training set, instead, we finetune the inference parameters for particle guidance and the other ablation experiments on a random subset of 200 molecules out of 30433 from the validation set.
+
+Evaluation metrics To evaluate conformer generation methods we want to test the ability of a method to generate a set of conformers that are both individually good poses (precision) and as a set cover the distribution of true conformers (recall). For this we employ the same evaluation setup and metrics used by several papers in the field starting from Ganea et al. [2021]. In this setup, methods are asked to generate twice as many conformers as in the original ensemble and then the so-called Average Minimum RMSD (AMR) and Coverage (COV) are measured for precision (P) and recall (R). For $K = 2L$ let $\{C_l^*\}_{l\in [1,L]}$ and $\{C_k\}_{k\in [1,K]}$ be respectively the sets of ground truth and generated conformers:
+
+$$
+\operatorname {C O V - R} := \frac {1}{L} \left| \{l \in [ 1.. L ]: \exists k \in [ 1.. K ], \operatorname {R M S D} \left(C _ {k}, C _ {l} ^ {*}\right) < \delta \right| \tag {43}
+$$
+
+$$
+\mathrm{AMR - R}:= \frac{1}{L}\sum_{l\in [1..L]}\min_{k\in [1..K]}\mathrm{RMSD}(C_{k},C_{l}^{*})
+$$
+
+where $\delta$ is the coverage threshold (set to $0.75\AA$ for the GEOM-DRUGS experiments). Swapping ground truth and generated conformers in the equations above we obtain the precision metrics.
+
+Baselines As baselines we report the performances of previous methods as measured by Ganea et al. [2021] and Jing et al. [2022]. Cheminformatics conformer prediction methods rely on rules and heuristics derived from chemical structures to fix the local degrees of freedom and then use a combination of search and template techniques to set the more flexible degrees of freedom like torsion angles. The most accurate and widely used such methods include the open-source software RDKit ETKDG [Landrum et al., 2013] and the commercial tool OMEGA [Trott & Olson, 2010; Hawkins & Nicholls, 2012].
+
+Before the already introduced Torsional Diffusion [Jing et al., 2022], a number of other machine learning approaches were proposed for this task, among these: GeoMol [Ganea et al., 2021] uses a GNN to sample directly from a random seed local structures around each atom and then torsion angles, GeoDiff [Xu et al., 2021] defines a equivariant diffusion model over atom coordinates, and CGCF [Shi et al., 2021] learns an energy-based model over the space of pairwise distance matrices.
+
+# D.2 PARTICLE GUIDANCE SETUP
+
+Reverse diffusion As discussed in Section 6.2, we applied particle guidance to torsional diffusion, as this is currently considered to be state-of-the-art and it uses, like most ML-based methods before, I.I.D. sampling during inference. We define the particle guidance kernel to operate directly on the implicit hypertorus manifold where torsional diffusion defines the diffusion process, this, at the same time, makes the kernel lower dimensional and it involves a minor modification to the existing inference procedure. The reverse diffusion process that we apply is:
+
+$$
+\begin{array}{l} d \boldsymbol {\tau} _ {i} = \underbrace {\frac {1}{2} g ^ {2} (T - t) \mathbf {s} (\boldsymbol {\tau} _ {i} , L , T - t) d t} _ {\text {d i f f u s i o n O D E}} + \underbrace {\beta_ {T - t} \left(\frac {1}{2} g ^ {2} (t) \mathbf {s} (\boldsymbol {\tau} _ {i} , L , T - t) d t + g (T - t) d \mathbf {w}\right)} _ {\text {L a n g e v i n d i f f u s i o n S D E}} \\ + \underbrace {\frac {\gamma_ {T - t}}{2} g ^ {2} (T - t) \nabla_ {\boldsymbol {\tau} _ {i}} \log \Phi_ {T - t} (\boldsymbol {\tau} _ {1} , \dots , \boldsymbol {\tau} _ {n}) d t} _ {\text {p a r t i c l e g u i d a n c e}} \\ \end{array}
+$$
+
+where we follow the idea from Karras et al. [2022] of dividing the different components of the reverse diffusion and tuning their individual parameters. The potential was chosen to be:
+
+$$
+\log \Phi_ {t} \left(\boldsymbol {\tau} _ {1}, \dots \boldsymbol {\tau} _ {n}\right) = - \frac {\alpha_ {t}}{2 n} \sum_ {i, j} k _ {t} \left(\boldsymbol {\tau} _ {i}, \boldsymbol {\tau} _ {j}\right) \quad \text {w h e r e} \quad k _ {t} \left(\boldsymbol {\tau} _ {i}, \boldsymbol {\tau} _ {j}\right) = \exp \left(- \frac {\left| \left| \boldsymbol {\tau} _ {i} - \boldsymbol {\tau} _ {j} \right| \right| ^ {2}}{h _ {t}}\right) \tag {44}
+$$
+
+where the difference of each torsion angle is computed to be in $(- \pi, \pi]$ . $\alpha_{t}$ , $\beta_{t}$ , $\gamma_{t}$ and $h_{t}$ are inference hyperparameters that are 'logarithmically interpolated' between two end values chosen with hyperparameter tuning (using $T = 1$ ), e.g. $\alpha_{t} = \exp(t \log(\alpha_{1}) + (1 - t) \log(\alpha_{0}))$ .
+
+Permutation invariant kernel Since the kernel operates on the torsion angle differences it is naturally invariant to SE(3) transformations, i.e. translations or rotations, of the conformers in space. Moreover, as illustrated in Fig. 2 of Jing et al. [2022], while exact torsion angle values depend on arbitrary choices of neighbors or orientation (to compute the dihedral angle) differences in torsion angles are invariant to these choices. However, one transformation that the kernel in Equation 44 is not invariant to are permutations of the atoms in the molecule. Many of these permutations lead to isomorphic molecular graphs where however each of the torsion angles may now refer to a different dihedral. To maximize the sample efficiency we make the kernel invariant to these by taking the minimum over the values of the kernel under all such permutations:
+
+$$
+k _ {t} ^ {\prime} (\boldsymbol {\tau} _ {i}, \boldsymbol {\tau} _ {j}) = \min _ {\pi \in \Pi} k _ {t} (\boldsymbol {\tau} _ {i}, P _ {\pi} \boldsymbol {\tau} _ {j})
+$$
+
+where $\Pi$ is the set of all permutations that keep the graph isomorphic (but do change the torsion angles assignment) and $P_{\pi}$ is the permutation matrix corresponding to some permutation $\pi$ . In practice, these isomorphisms can be precomputed efficiently, however, to limit the overhead from applying the kernel multiple times, whenever there are more than 32 isomorphic graphs leading to a change in dihedral assignments we subsample these to only keep 32.
+
+Batch size The number of conformers one has to generate is given, for every molecule, by the benchmark (2L) and can vary significantly. To avoid significant computational overheads, we use batches of up to $n = 128$ until all the conformers for that particular molecule are generated.
+
+# D.3 FULL RESULTS
+
+We provide in Table 3 again the results reported in Table 1 with the additions of other baselines and ablation experiments. In particular, as ablations, on top of running non-invariant particle guidance i.e. without the minimization over the permutations described in the previous section, we also test low-temperature sampling, another variation of the inference-time procedure that has been proposed for diffusion models that we applied as described below.
+
+Low-temperature sampling. Low-temperature sampling of some distribution $p(\mathbf{x})$ with temperature $\lambda^{-1} < 1$ consists of sampling the distribution $p_{\lambda}(\mathbf{x}) \propto p(\mathbf{x})^{\lambda}$ . This helps mitigate the overdispersion problem by concentrating more on high-likelihood modes and trading off sample diversity for quality. Exact low-temperature sampling is intractable for diffusion models, however, various approximation schemes exist. We use an adaptation of Hybrid Langevin-Reverse Time SDE proposed by Ingraham et al. [2022]:
+
+$$
+d \pmb {\tau} = - \left(\lambda_ {t} + \frac {\lambda \psi}{2}\right) \mathbf {s} _ {\theta , G} (C, t) g ^ {2} (t) d t + \sqrt {1 + \psi} g (t) d \mathbf {w} \quad \mathrm {w i t h} \lambda_ {t} = \frac {\sigma_ {d} + \sigma_ {t}}{\sigma_ {d} + \sigma_ {t} / \lambda}
+$$
+
+where $\lambda$ (the inverse temperature), $\psi$ and $\sigma_{d}$ are parameters that can be tuned.
+
+# EXPERIMENTAL DETAILS ON STABLE DIFFUSION
+
+# E.1 SETUP
+
+In this section, we detail the experimental setup on Stable Diffusion. We replace the score function $(\nabla_{\mathbf{x}_i}\log p_{t'}(\mathbf{x}_i))$ in the original particle guidance formula (Eq. (4)) with the classifier-free guidance formula [Ho, 2022]:
+
+$$
+\tilde {s} (\mathbf {x} _ {i}, c, t ^ {\prime}) = w \nabla_ {\mathbf {x} _ {i}} \log p _ {t ^ {\prime}} (\mathbf {x} _ {i}, c) + (1 - w) \nabla_ {\mathbf {x} _ {i}} \log p _ {t ^ {\prime}} (\mathbf {x} _ {i})
+$$
+
+Table 3: Quality of generated conformer ensembles for the GEOM-DRUGS test set in terms of Coverage (\%) and Average Minimum RMSD (Å). Minimizing recall and precision refers to the hyperparameter choices that minimize the respective median AMR on the validation set.
+
+
Method
Recall
Precision
Coverage ↑
AMR ↓
Coverage ↑
AMR ↓
Mean
Med
Mean
Med
Mean
Med
Mean
Med
RDKit ETKDG
38.4
28.6
1.058
1.002
40.9
30.8
0.995
0.895
OMEGA
53.4
54.6
0.841
0.762
40.5
33.3
0.946
0.854
CGCF
7.6
0.0
1.247
1.225
3.4
0.0
1.837
1.830
GeoMol
44.6
41.4
0.875
0.834
43.0
36.4
0.928
0.841
GeoDiff
42.1
37.8
0.835
0.809
24.9
14.5
1.136
1.090
Torsional Diffusion
72.7
80.0
0.582
0.565
55.2
56.9
0.778
0.729
TD w/ low temperature
- minimizing recall
73.3
77.7
0.570
0.551
66.4
73.8
0.671
0.613
- minimizing precision
68.0
69.6
0.617
0.604
72.4
81.3
0.607
0.548
TD w/ non-invariant PG
- minimizing recall
75.8
81.5
0.542
0.520
66.2
72.4
0.668
0.607
- minimizing precision
58.9
56.8
0.730
0.746
76.8
88.8
0.555
0.488
TD w/ invariant PG
- minimizing recall
77.0
82.6
0.543
0.520
68.9
78.1
0.656
0.594
- minimizing precision
72.5
75.1
0.575
0.578
72.3
83.9
0.617
0.523
+
+where $c$ symbolizes the text condition, $w \in \mathbb{R}^+$ is the guidance scale, and $\nabla_{\mathbf{x}_i}\log p_{t'}(\mathbf{x}_i,c) / \log p_{t'}(\mathbf{x}_i)$ is the conditional/unconditional scores, respectively. As probability ODE with classifier-free guidance is the prevailing method employed in text-to-image models [Saharia et al., 2022], we substitute the reverse-time SDE in Eq. (4) with the marginally equivalent ODE. Assuming that $f(\mathbf{x}_i,t') = 0$ , the new backward ODE with particle guidance is
+
+$$
+d \mathbf {x} _ {i} = \left[ \frac {1}{2} g ^ {2} (t ^ {\prime}) \Bigg (\tilde {s} (\mathbf {x} _ {i}, c, t ^ {\prime}) - \alpha_ {t ^ {\prime}} \nabla_ {\mathbf {x} _ {i}} \sum_ {j = 1} ^ {n} k _ {t ^ {\prime}} (\mathbf {x} _ {i}, \mathbf {x} _ {j}) \Bigg) \right] d t
+$$
+
+Following SVGD [Liu & Wang, 2016], we employ RBF kernel $k_{t}(\pmb{\tau}_{i},\pmb{\tau}_{j}) = \exp \left(-\frac{||\pmb{\tau}_{i} - \pmb{\tau}_{j}||^{2}}{h_{t}}\right)$ with $h_t = m_t^2 / \log n$ , where $m_{t}$ is the median of particle distances. We implement the kernel both in the original down-sampled pixel space (the latent of VAE) or the feature space of DINO-VIT-b/8 [Caron et al., 2021]. Defining the DINO feature extractor as $g_{\mathrm{DINO}}$ , the formulation in the feature space becomes:
+
+$$
+d \mathbf {x} _ {i} = \left[ \frac {1}{2} g ^ {2} (t ^ {\prime}) \Bigg (\tilde {s} (\mathbf {x} _ {i}, c, t ^ {\prime}) - \alpha_ {t ^ {\prime}} \nabla_ {\mathbf {x} _ {i} ^ {0}} \sum_ {j = 1} ^ {n} k _ {t ^ {\prime}} \left(g _ {\mathrm {D I N O}} (\mathbf {x} _ {i} ^ {0}), g _ {\mathrm {D I N O}} (\mathbf {x} _ {j} ^ {0})\right) \Bigg) \right] d t
+$$
+
+where we set the input to the DINO feature extractor $g_{\mathrm{DINO}}$ to the $\mathbf{x}_0$ -prediction: $\mathbf{x}_i^0 = \mathbf{x}_i + \sigma(t')^2 \tilde{s}(\mathbf{x}_i, c, t')$ , as $\mathbf{x}_0$ -prediction lies in the data manifold rather than noisy images. $\sigma(t)$ is the standard deviation of Gaussian perturbation kernel given time $t$ in diffusion models. The gradient w.r.t. $\mathbf{x}_i^0$ can be calculated by forward-mode auto-diff. We hypothesize that defining Euclidean distance in the feature space is markedly more natural and effective compared to the pixel space, allowing the repulsion in a more semantically meaningful way. Our experimental results in Fig. 6.1 corroborate the hypothesis.
+
+To construct the data for evaluation, we randomly sample 500 prompts from the COCO validation set [Lin et al., 2014]. For each prompt, we generate a batch of four images. To get the average CLIP score/Aesthetic score versus in-batch similarity score curve, for I.I.D. sampling, we use $w \in \{6,7.5,8.5,9\}$ . We empirically observed that particle guidance achieved a much lower in-batch similarity score (better diversity) than IID sampling. As diversity typically improves with smaller guidance weights [Ho, 2022; Sahara et al., 2022], we chose a set of smaller guidance weights for I.I.D. sampling to further improve its diversity, keeping it in the relatively similar
+
+range as particle guidance. Hence for particle guidance, we use a set of larger guidance scales: $w \in \{7.5, 8, 9, 9.5, 10\}$ . Indeed, the experimental results suggest that even though I.I.D. sampling used a smaller guidance weight to promote diversity, its in-batch similarity score was still worse than that of particle guidance. . We set the hyper-parameter $\alpha_{t'}$ to $8\sigma(t)$ in particle guidance (feature) and $30\sigma(t)^2$ in particle guidance (pixel). We use an Euler solver with 30 NFE in all the experiments.
+
+# E.2 IN-BATCH SIMILARITY SCORE
+
+We propose in-batch similarity score to capture the diversity of a small set of generated samples $\{\mathbf{x}_1,\dots ,\mathbf{x}_n\}$ given a prompt $c$ ..
+
+$$
+\text {I n - b a t c h s i m i l a r i t y} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {n}) = \frac {1}{n (n - 1)} \sum_ {i \neq j} \frac {g _ {\mathrm {D I N O}} (\mathbf {x} _ {i}) ^ {T} g _ {\mathrm {D I N O}} (\mathbf {x} _ {j})}{| | g _ {\mathrm {D I N O}} (\mathbf {x} _ {i}) | | _ {2} | | g _ {\mathrm {D I N O}} (\mathbf {x} _ {j}) | | _ {2}}
+$$
+
+To save memory, we use the DINO-VIT-s/8 [Caron et al., 2021] as the feature extractor $g_{\mathrm{DINO}}$
+
+# F EXTENDED IMAGE SAMPLES
+
+In Fig. 8-Fig. 12, we visualize samples generated by the I.I.D. sampling process, particle guidance in the pixel space, and particle guidance in the DINO feature space, on four different prompts. For Fig. 8-Fig. 10, we select the prompts in Somepalli et al. [2023], with which Stable Diffusion is shown to replicate content directly from the LAION dataset. We also include the generated samples of SVGD-guidance, in which we replace the particle guidance term with SVGD formula (Eq. (2)). In Fig. 13, we observe that SVGD generally leads to blurry images when increasing the guidance scale $\alpha_{t}$ . This is predictable as the guidance term in SVGD involves a weighted sum of scores of nearby samples, which will steer the samples toward the mean of samples.
+
+Further, we provide at this URL https://anonymous.4open.science/r/pg-images/the (non-cherry picked) images generated from the first 50 text prompts of COCO using the same hyperparameters, the same random seed. We set the guidance scale to commonly used $w = 8$ . When comparing visually the differences are subjective, but, to our eyes, many of the generations with PG show clear improvements in sample diversity. For example, for the first prompt "A baby eating a cake with a tie around his neck with balloons in the background", conventional iid sampling tends to generate a brown-haired white child, while particle guidance generates diverse depictions of babies with varying hair and skin colors.
+
+
+(a) I.I.D.
+
+
+(b) particle guidance (pixel)
+
+
+(c) particle guidance (feature)
+Figure 8: Text prompt: Captain Marvel Exclusive Ccxp Poster Released Online By Marvel
+
+
+(a) I.I.D.
+
+
+(b) particle guidance (pixel)
+
+
+(c) particle guidance (feature)
+Figure 9: Text prompt: Portrait of Tiger in black and white by Lukas Holas
+
+
+(a) I.I.D.
+Figure 10: Text prompt: VAN GOGH CAFE TERASSE copy.jpg
+
+
+(b) particle guidance (pixel)
+
+
+(c) particle guidance (feature)
+
+
+(a) I.I.D.
+
+
+(b) particle guidance (pixel)
+
+
+(c) particle guidance (feature)
+Figure 11: Text prompt: A transparent sculpture of a duck made out of glass
+
+
+(a) I.I.D.
+
+
+(b) particle guidance (pixel)
+
+
+(c) particle guidance (feature)
+Figure 12: Text prompt: A unicorn in a snowy forest
+
+
+(a) $\alpha_{t} = 0.1$
+
+
+(b) $\alpha_{t} = 0.3$
+Figure 13: SVGD guidance, with varying $\alpha_{t}$
+
+
+(c) $\alpha_{t} = 1$
+
+
+(d) $\alpha_{t} = 2$
\ No newline at end of file
diff --git a/particleguidancenoniiddiversesamplingwithdiffusionmodels/images.zip b/particleguidancenoniiddiversesamplingwithdiffusionmodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..069ff411b4a776b0fd0cf39876762e088759fc80
--- /dev/null
+++ b/particleguidancenoniiddiversesamplingwithdiffusionmodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:122f01b00a31b2660c105038934ca3344d50981e99d07e46cb65d48cdcc7080f
+size 1990818
diff --git a/particleguidancenoniiddiversesamplingwithdiffusionmodels/layout.json b/particleguidancenoniiddiversesamplingwithdiffusionmodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8b9c28e094cb7bee9645ec71c31d96e2178f6b82
--- /dev/null
+++ b/particleguidancenoniiddiversesamplingwithdiffusionmodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a299ae4b3322eae44fdb903b1f52de2b444a4a0f5305670860a709937eb779e7
+size 1028704
diff --git a/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_content_list.json b/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7c470066f68194e07b46b1269ce1f2d1edf68585
--- /dev/null
+++ b/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:23d92a1cc0f117360999105f0006274ebf52ff82ba90750054389c5aacab4934
+size 123043
diff --git a/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_model.json b/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3490a4a120425421df16533e4332660df846f037
--- /dev/null
+++ b/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69bd23198e14000a21b7cb206305c23d95fe71379bb5850bdf4c9906a32d6167
+size 147366
diff --git a/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_origin.pdf b/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8fbbe6d43d5b1920639286d1e33162fe1011e049
--- /dev/null
+++ b/partitioningmessagepassingforgraphfrauddetection/bcd0d4a8-51c1-4c46-a54f-6bf0304e477f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:28b10dda5409a627e8f6d8cb2dcbbb4cef7c14a0c5978924e133f2961441f441
+size 855031
diff --git a/partitioningmessagepassingforgraphfrauddetection/full.md b/partitioningmessagepassingforgraphfrauddetection/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..487a5a0db81a509606740a8d0bf42fa0336f8a2c
--- /dev/null
+++ b/partitioningmessagepassingforgraphfrauddetection/full.md
@@ -0,0 +1,434 @@
+# PARTITIONINGMESSAGEPASSINGFORGRAPHFRAUD DETECTION
+
+Wei Zhuo $^{1}$ , Zemin Liu $^{2}$ , Bryan Hooi $^{2}$ , Bingsheng He $^{2*}$ , Guang Tan $^{1*}$ , Rizal Fathony $^{3}$ , Jia Chen $^{3}$
+
+1Shenzhen Campus of Sun Yat-sen University, 2National University of Singapore,
+
+3GrabTaxi Holdings Pte. Ltd.
+
+zhuow5@mail2.sysu.edu.cn, zeminliu@nus.edu.sg, {bhooi, hebs}@comp.nus.edu.sg, tanguang@mail.sysu.edu.cn, {rizal.fathony, jia.chen}@grab.com
+
+# ABSTRACT
+
+Label imbalance and homophily-heterophily mixture are the fundamental problems encountered when applying Graph Neural Networks (GNNs) to Graph Fraud Detection (GFD) tasks. Existing GNN-based GFD models are designed to augment graph structure to accommodate the inductive bias of GNNs towards homophily, by excluding heterophilic neighbors during message passing. In our work, we argue that the key to applying GNNs for GFD is not to exclude but to distinguish neighbors with different labels. Grounded in this perspective, we introduce Partitioning Message Passing (PMP), an intuitive yet effective message passing paradigm expressly crafted for GFD. Specifically, in the neighbor aggregation stage of PMP, neighbors with different classes are aggregated with distinct node-specific aggregation functions. By this means, the center node can adaptively adjust the information aggregated from its heterophilic and homophilic neighbors, thus avoiding the model gradient being dominated by benign nodes which occupy the majority of the population. We theoretically establish a connection between the spatial formulation of PMP and spectral analysis to characterize that PMP operates an adaptive node-specific spectral graph filter, which demonstrates the capability of PMP to handle heterophily-homophily mixed graphs. Extensive experimental results show that PMP can significantly boost the performance on GFD tasks. Our code is available at https://github.com/Xtra-Computing/PMP.
+
+# 1 INTRODUCTION
+
+With the explosive growth of online information, fraudulent activities have significantly increased in financial networks (Ngai et al., 2011; Lin et al., 2021), social media (Deng et al., 2022), review networks (Rayana & Akoglu, 2015), and academic networks (Cho et al., 2021), making the detection of such activities an area of paramount importance. To fully exploit the rich graph structures contained in fraud graphs, recent studies have increasingly adopted Graph Neural Networks (GNNs) (Wu et al., 2020) to Graph Fraud Detection (GFD).
+
+Applying message passing GNNs (Gilmer et al., 2017) in GFD encounters two significant challenges: label imbalance (Liu et al., 2023) and a mixture of heterophily and homophily (Gao et al., 2023a). Network attackers often employ sophisticated tactics to mimic regular network patterns, by strategically injecting a limited number of fraud nodes in the main contexts of the target graph to hide their fraudulent activities. The label imbalance problem causes the GNN to primarily capture the patterns and characteristics of benign nodes, compromising their ability to accurately identify fraudulent ones. Additionally, the heterophily-homophily mixture violates the homophily (Zhu et al., 2020) inductive bias of GNNs, as fraud nodes are often strategically placed within benign communities to exhibit heterophily, while the context around benign nodes exhibits homophily. Therefore, it is pivotal to develop GNNs that can navigate these challenges adeptly.
+
+To alleviate these issues, several methods have been proposed from a spatial perspective to diminish the impact of heterophilic neighbors during the aggregation process. These strategies commonly involve utilizing a trainable approach or predetermining a mechanism to resample neighbors (Dou et al., 2020; Liu et al., 2021c; 2020) or reweight edges (Wang et al., 2019; Cui et al., 2020; Shi et al.,
+
+
+(a) Generic message passing.
+
+
+(b) Partitioning message passing.
+Figure 1: Comparison between generic message passing GNN and partitioning message passing GNN. Red, blue and grey mean fraud, benign and unlabeled nodes, respectively.
+
+2022; Liu et al., 2021a). From a spectral view, GHRN (Gao et al., 2023a) shows using a high-pass filter helps identify heterophilic neighbors, pruning inter-class edges to highlight the high frequencies of the graph. BWGNN (Tang et al., 2022) reveals the 'right-shift' phenomenon of spectral energy and suggests a Beta wavelet-based band-pass graph filter.
+
+However, from the spatial perspective, augmenting the graph structure to exclude heterophilic neighbors during message passing to accommodate the inductive bias of GNNs is non-trivial for two reasons. Firstly, semi-supervised GFD usually makes pruning or reweighting of unlabeled neighbors based on predicted logits unreliable (Gao et al., 2023c). In other words, the edge weight or pruning probability depends on the similarity of the predicted representations between nodes, therefore any prediction error may accumulate and impact the final result. Secondly, these methods face scalability issues on large-scale graphs. On the other hand, spectral-based models can keep the graph fixed and learn the spectral graph filter beyond low-pass (Bo et al., 2021; He et al., 2021; Tang et al., 2022; Gao et al., 2023c), which demonstrate efficacy in addressing heterophily. However, these models usually struggle with label imbalance due to shared parameters and require the entire graph input, hindering the mini-batch training.
+
+In this paper, we argue that complicated trainable or predetermined strategies for excluding heterophilic neighbors are unnecessary. Instead, the key of applying GNNs on fraud graphs is to distinguish neighbors during the message passing process, rather than exclusion. A powerful model should inherently have the capacity to adaptively modulate the information derived from both homophilic and heterophilic neighbors.
+
+Based on this insight, we propose an intuitive yet effective message passing paradigm named Partitioning Message Passing (PMP). At the neighbor aggregation stage of PMP, we employ distinct aggregation functions to independently handle homophilic and heterophilic neighbors. It ensures that parameter sharing is confined to nodes within the same class, thereby preventing the gradients from being dominated by the majority class nodes. For neighbors with unknown classes, we configure their aggregation function to be a flexible composite of the aggregation functions used for labeled neighbors, where the combination weight is derived from an adaptable scalar function unique to the center node. Besides, since the fraud graph is homophily-heterophily mixed, the amount of information that different nodes obtain from homophilic neighbors and heterophilic neighbors should also be adaptively adjusted according to the node. To achieve it, we treat the parameter matrices of aggregation functions as the output of weight generators with respect to the center node. By this means, each node can adaptively adjust the influence from different classes of neighbors without additional parameters. Moreover, our theoretical analysis for PMP bridges the gap between the spatial form of the model and the spectral explanation, which proves that PMP can be interpreted as a node-specific spectral convolution, i.e., each node has its own spectral graph filter. It shows that our model is more suitable for graphs with homophilic and heterophilic mixtures because the uniform graph filter can not balance both aspects. Extensive experiments on four benchmark datasets demonstrate the effectiveness of PMP.
+
+# 2 BACKGROUND AND MOTIVATION
+
+# 2.1 BACKGROUND
+
+Notations. A multi-relational attributed fraud graph is denoted as $\mathcal{G} = (\mathcal{V},\{E_r\}_{r = 1}^R,\mathbf{X},\mathcal{Y})$ where $\mathcal{V} = \{v_{1},\dots ,v_{N}\}$ represents the node set with $N$ nodes, $E_{r}$ represents the edge set under the
+
+$r$ -relation, and $R$ is the total number of relations. Thus, $G$ can be seen as a combination of $r$ separate single-relational graphs, each of which is characterized by an adjacency matrix $\mathbf{A}_r \in \mathbb{R}^{N \times N}$ derived from its corresponding edge set $E_r$ , i.e., if an edge $e_{ij} \in E_r$ , $\mathbf{A}_{r,ij} = 1$ ; otherwise $\mathbf{A}_{r,ij} = 0$ . $\mathbf{X} \in \mathbb{R}^{N \times d}$ is a node feature matrix, wherein the $i$ -th row $\boldsymbol{x}_i$ is the feature vector of $v_i$ . $\mathcal{V}$ represents the set of labels, where each node $v_i$ is assigned a binary label $y_i \in \mathcal{V}$ , i.e., $y_i = 1$ denotes fraud node, and 0 denotes benign node. Due to the label imbalance nature in fraud graphs, the quantity of benign nodes (the majority class) substantially outweighs that of the fraud ones (the minority class). For a node $v_i$ and its neighbor $v_j$ , if $y_i = y_j$ , $v_j$ is a homophilic neighbor; otherwise, it is heterophilic.
+
+Graph Neural Networks. In a typical GNN, the $l$ -th message passing layer for a node $v_{i}$ operates by iteratively aggregating data from its immediate neighbors, and then combining the aggregated messages with its own node representation (Gilmer et al., 2017):
+
+$$
+\mathbf {h} _ {i} ^ {(l)} = \operatorname {C o m b} ^ {(l - 1)} \left(f _ {\text {s e l f}} ^ {(l - 1)} \left(\mathbf {h} _ {i} ^ {(l - 1)}\right), f _ {\text {a g g}} ^ {(l - 1)} \left(\left\{\mathbf {h} _ {j} ^ {(l - 1)} \mid v _ {j} \in \mathcal {N} (v _ {i}) \right\}\right)\right), \tag {1}
+$$
+
+where $\mathbf{h}_i^{(l)}$ is the $l$ -th layer hidden representation of $v_{i}$ , $\mathrm{Comb}(\cdot)$ is a combination function, $f_{\mathrm{self}}(\cdot)$ is a function on the center node, $f_{\mathrm{agg}}(\cdot)$ is permutation invariant neighbor aggregation function, and $\mathcal{N}(v_i)$ is the neighbor set of $v_{i}$ . $f_{\mathrm{agg}}(\cdot)$ typically encompasses two essential components: feature transformation and message fusion. Existing GNNs have primarily focused on elaborating on message fusion functions based on Laplacian (Kipf & Welling, 2017; Defferrard et al., 2016), diffusion (Gasteiger et al., 2019a;b; Chien et al., 2021), attention (Velicković et al., 2018), or a combination of multiple aggregators (Corso et al., 2020). However, these methods adopt simple linear feature transformations by employing weight matrices shared across all neighbors. This can lead to a learning process that is biased by the potential label imbalance. The backpropagation of gradients, which aims to minimize the overall loss, tends to be dominated by the majority class neighbors. This limits the ability of the model to learn from the minority class effectively. If the center node belongs to a minority class, the graph embodies heterophily. Such interplay of heterophily and label imbalance in fraud graphs provides a unique challenge for GNNs.
+
+Related Work. (1) Label Imbalanced Learning on Graphs. GNNs are known to be sensitive to label imbalance (Liu et al., 2023). Currently, several studies have proposed different strategies to address this challenge, such as by implementing adversarial constraints (Shi et al., 2020), generating minority instances using techniques like GAN (Qu et al., 2021) or SMOTE (Zhao et al., 2021), and modifying the degree of imbalance compensation (Song et al., 2022). Despite their effectiveness, their success heavily relies on augmenting graph structure to balance the label distribution, which can hardly be adaptive to fraud detection tasks on large-scale graphs. (2) Graph Heterophily Learning. Heterophily has emerged as a significant concern for GNNs. This issue was initially highlighted by Pei et al. (2020). Separating ego- and neighbor-embeddings (Zhu et al., 2020; Platonov et al., 2023; Hamilton et al., 2017) proves to be an effective technique for learning on heterophilic graphs. Given that nodes sharing the same class are distantly placed within heterophilic graphs, several approaches aim to extend the local neighbors to non-local ones by integrating multiple layers (Chien et al., 2021; Abu-El-Haija et al., 2019), and identifying potential neighbors through attention mechanisms (Liu et al., 2021b; Yang et al., 2022b) or similarity measures (Zhuo & Tan, 2022; Jin et al., 2021). Spectral-based methods (Luan et al., 2021) overcome this challenge by introducing additional graph filters and mixture strategy, which aims to adaptively integrate information by emphasizing certain frequencies. This approach shares a similar goal with our work. We discuss in detail how our model relates to this method in Appendix C. (3) GNN-based Fraud Detection. GNNs have been leveraged to detect fraudulent activities in financial services (Rao et al., 2022; Xu et al., 2021; Lin et al., 2021; Chen et al., 2024), telecommunications (Nabeel et al., 2021), social networks (Deng et al., 2022), and healthcare (Cui et al., 2020). CARE-GNN (Dou et al., 2020) employs a label-aware similarity measure to identify informative neighbors and leverages reinforcement learning to selectively integrate similar neighbors. PC-GNN (Liu et al., 2021c) utilizes label-balanced samplers for sub-graph training. Spectral-based methods (Tang et al., 2022; Gao et al., 2023c) conduct spectral analysis on fraud graphs, designing band-pass or high-pass graph filters specifically tailored to detect fraud nodes. GAGA (Wang et al., 2023) groups neighbors by augmenting neighbor features with their labels explicitly and treating unlabeled neighbors as a new class.
+
+# 2.2 MOTIVATION ANALYSIS
+
+To probe the reasons why message passing based GNNs experience shortcomings in fraud detection tasks, our investigation is conducted through an analysis of the mutual influence between nodes resulting from the message passing process. Inspired by (Xu et al., 2018; Zhang et al., 2021), the influence of node $v_{j}$ on the center node $v_{i}$ can be quantified by measuring how alterations in the input feature of $v_{j}$ affect the representation of $v_{i}$ after $k$ iterations of message passing. For any $v_{i}$ and its neighbor $v_{j} \in \mathcal{N}(v_{i})$ , given the message passing form $\mathbf{H}^{(k)} = \hat{\mathbf{A}}^{k}\mathbf{H}^{(0)}\mathbf{W}$ where $\mathbf{H}^{(0)} = \mathbf{X}$ , considering the $h$ -th feature of $\mathbf{X}$ , the influence of $v_{j}$ on the final representation of $v_{i}$ is defined as:
+
+$$
+I (k) _ {i j} = \left[ \frac {\partial \mathbf {H} _ {i h} ^ {(k)}}{\partial \mathbf {H} _ {j h} ^ {(0)}} \right] _ {\forall h \in \{1, \dots d \}} = \hat {\mathbf {A}} _ {i j} ^ {k} \mathbf {W}. \tag {2}
+$$
+
+Since the gradient is independent of the feature dimension $h$ (Zhang et al., 2021), the final result omits the $h$ . In a fraud graph characterized by imbalanced label distribution, let $m$ represent the number of benign neighbors $\mathcal{N}_{\mathrm{be}}(v_i)$ of node $v_i$ , and $n$ represents the number of fraud neighbors $\mathcal{N}_{\mathrm{fr}}(v_i)$ . In this context, $m \gg n$ . Since we specifically study the class imbalance problem, to rule out potential interference from other variables, we assume the graph to be regular. Consequently, all non-zero off-diagonal entries in $\hat{\mathbf{A}}^k$ are assumed to be equal, and this common value is denoted by $\gamma$ . The total influence of benign neighbors on the center node $v_i$ is $I_{\mathcal{N}_{\mathrm{be}}(v_i) \to v_i} = \frac{1}{\gamma} \sum_{j \in \mathcal{N}_{\mathrm{be}}(v_i)} \hat{\mathbf{A}}_{ij}^k w = m\mathbf{W}$ , where we use $\gamma$ to scale the influence score. Similarly, for fraud neighbors we have $I_{\mathcal{N}_{\mathrm{fr}}(v_i) \to v_i} = n\mathbf{W}$ . Then, the total influence from neighbors is given by $(m + n)\mathbf{W} \approx I_{\mathcal{N}_{\mathrm{be}}(v_i) \to v_i}$ , which tends to over-amplify the influence from the majority class neighbors (benign) while neglecting that from the minority class neighbors (fraudulent). Such an imbalance in influence can skew the message passing process, causing it to be insufficiently responsive to the nuances of the minority class nodes. As a result, the capacity of the network to capture critical features from the minority class neighbors diminishes, potentially undermining its effectiveness in fraud detection especially when the graph exhibits heterophily.
+
+To address the aforementioned problems, many existing GNN-based fraud detection models adopt strategies such as re-weighting neighbors from different classes using predefined indicators (Liu et al., 2021c) or learnable attention values (Wang et al., 2019; Liu et al., 2021a; Shi et al., 2022; Cui et al., 2020). Additionally, they often incorporate a learnable sampler to selectively focus on potential neighbors belonging to the same class as the center node (Dou et al., 2020; Liu et al., 2020). These works typically utilize additional modules to augment the graph structure, aiming to homogenize contextual information in graphs. The essential goal of these methods is to modify the graph to exclude heterophilic neighbors (i.e., neighbors that belong to different classes than the center node), thereby tailoring the graph topology for more effective processing by GNNs in fraud detection tasks. However, augmenting the graph structure often leads to high time and memory complexity, limiting scalability to large graphs. In our work, we argue that adapting the graph to fit GNNs is both costly and unnecessary, but keeping the graph fixed and modifying the GNN model to fit the graph can be more efficient and effective.
+
+Upon observing the formation of the total influence $(m + n)\mathbf{W}$ , we find that both fraud and benign neighbors are weighted equally with $\mathbf{W}$ , which leads to benign neighbors dominating the gradient of $\mathbf{W}$ during the backpropagation. It naturally motivates us to ask whether handling neighbors of two distinct classes with separate weight matrices might allow for adaptive adjustment in their influence on the center node, i.e., $m\mathbf{W}_1 + n\mathbf{W}_2$ . Such an approach may effectively mitigate issues related to label imbalance and heterophily, without doing any operations on the graph itself.
+
+# 3 PARTITIONINGMESSAGEPASSING
+
+Our preliminary analysis in Section 2.2 reveals a relationship between parameter sharing within GNNs and biases in the learning process. In this section, we formally present our method, Partitioning Message Passing (PMP), which is a simple, intuitive, yet powerful approach tailored for the fraud detection task. The basic idea of PMP is to utilize the label information to partition the message passing process, enabling the model to distinguish neighbors according to their classes by learning different weights for each class during message passing, thereby enhancing its ability to adaptively adjust the influence propagated from class-imbalanced neighboring nodes. As shown in Fig. 1b, the
+
+$l$ -th message passing iteration of PMP for a node $v_{i}$ is described as follows:
+
+$$
+\begin{array}{l} \mathbf {h} _ {i} ^ {(l)} = \operatorname {C o m b} ^ {(l - 1)} \left(f _ {\text {s e l f}} ^ {(l - 1)} \left(\mathbf {h} _ {i} ^ {(l - 1)}\right), f _ {\mathrm {f r}} ^ {(l - 1)} \left(\mathbf {h} _ {j} ^ {(l - 1)} \mid v _ {j} \in \mathcal {N} _ {\mathrm {f r}} (v _ {i})\right)\right), \tag {3} \\ \left. f _ {\mathrm {b e}} ^ {(l - 1)} \left(\mathbf {h} _ {j} ^ {(l - 1)} \mid v _ {j} \in \mathcal {N} _ {\mathrm {b e}} (v _ {i})\right), f _ {\mathrm {u n}} ^ {(l - 1)} \left(\mathbf {h} _ {j} ^ {(l - 1)} \mid v _ {j} \notin \mathcal {N} _ {\mathrm {b e}} (v _ {i}) \cup \mathcal {N} _ {\mathrm {f r}} (v _ {i})\right)\right), \\ \end{array}
+$$
+
+where $f_{\mathrm{fr}}^{(l)}(\cdot), f_{\mathrm{be}}^{(l)}(\cdot)$ , and $f_{\mathrm{un}}^{(l)}(\cdot)$ correspond to the handling of neighbors categorized as fraud, benign, and unlabeled, respectively. These functions are parameterized by the weight matrices $\mathbf{W}_{\mathrm{fr}}^{(l)}$ , $\mathbf{W}_{\mathrm{be}}^{(l)}$ and $\mathbf{W}_{\mathrm{un}}^{(l)} \in \mathbb{R}^{d \times d'}$ , aligning with the aforementioned categories. We simply set the message fusion of aggregation functions to sum: $f_{\mathrm{fr}}^{(l-1)}(\mathbf{h}_j^{(l-1)}|v_j \in \mathcal{N}_{\mathrm{fr}}(v_i)) = \sum_{v_j \in \mathcal{N}_{\mathrm{fr}}(v_i)} \mathbf{h}_j^{(l-1)}\mathbf{W}_{\mathrm{fr}}^{(l-1)}$ .
+
+Handling unlabeled neighbors as a weighted combination of fraud and benign labels. For unlabeled neighbors, we face the challenge of determining an appropriate transformation that acknowledges the uncertainty of these connections. Treating $f_{\mathrm{un}}$ for unlabeled neighbors independently from those for fraud and benign neighbors is not suitable, as it would mean forcing an additional, definite label on these neighbors. For binary classification fraud detection task, unlabeled neighbors share characteristics with both benign and fraud categories, while a separate, definite label might make it harder to model the continuous spectrum between clear-cut benign and fraud behavior and can not leverage the knowledge captured by $f_{\mathrm{fr}}$ and $f_{\mathrm{be}}$ . Instead, PMP aims to treat unlabeled neighbors in a way that reflects their uncertain and mixed nature. Thus we define $\mathbf{W}_{\mathrm{un}}^{(l)}$ as a weighted combination of $\mathbf{W}_{\mathrm{fr}}^{(l)}$ and $\mathbf{W}_{\mathrm{be}}^{(l)}$ :
+
+$$
+\mathbf {W} _ {\mathrm {u n}} ^ {(l)} = \alpha_ {i} ^ {(l)} \mathbf {W} _ {\mathrm {f r}} ^ {(l)} + (1 - \alpha_ {i} ^ {(l)}) \mathbf {W} _ {\mathrm {b e}} ^ {(l)}, \tag {4}
+$$
+
+where $\alpha_{i}^{(l)}\in \mathbb{R}^{(0,1)}$ is a scalar to modulate the class tendency of unlabeled neighbors associated with the center node $v_{i}$ . In other words, a large $\alpha_{i}^{(l)}$ means that the model treats unlabeled neighbors more similarly to fraud nodes, indicating a tendency or suspicion toward fraud for those particular connections, and vice versa. The parameter $\alpha_{i}^{(l)}$ thus serves as a continuous dial that allows the model to smoothly interpolate between treating unlabeled neighbors as either benign or fraud nodes, by dynamically adjusting $\alpha_{i}^{(l)}$ based on characteristics of each center node $v_{i}$ . Since $\alpha_{i}^{(l)}$ should be node-specific and adaptive, we define $\alpha_{i}^{(l)}$ as a function of $v_{i},\alpha_{i}^{(l)} = \Phi (\mathbf{h}_{i}^{(l - 1)})$ , where $\Phi :\mathbb{R}^d\to \mathbb{R}$ is a single-layered MLP with a sigmoid activation shared across all nodes.
+
+Root-specific weight matrix generation. In Eq. (3), the influence from the majority and minority class neighbors on $v_{i}$ can be adaptively adjusted by $\mathbf{W}_{\mathrm{be}}$ and $\mathbf{W}_{\mathrm{fr}}$ respectively. Following the analysis in Section 2.2, the total influence from labeled neighbors on $v_{i}$ is $m\mathbf{W}_{\mathrm{be}} + n\mathbf{W}_{\mathrm{fr}}$ , where $\mathbf{W}_{\mathrm{be}}$ and $\mathbf{W}_{\mathrm{fr}}$ are shared across all center nodes when performing message passing. Further, in various contexts across the graph, nodes often exhibit unique characteristics and patterns of interactions. These differences can arise from distinct node attributes or their positional contexts within the graph structure. Given this variability, a uniform approach to regulating the influence from different classes of neighbors might oversimplify these interactions. Instead, a more adaptive and node-specific method would better capture the intricate dynamics between a node and its diverse neighborhoods. However, directly equipping every center node with individualized weight matrices, $\mathbf{W}_{\mathrm{fr}}^{(l)}$ and $\mathbf{W}_{\mathrm{be}}^{(l)}$ , is intractable. To circumvent this, we introduce learnable weight generators that model $\mathbf{W}_{\mathrm{fr}}^{(l)}$ and $\mathbf{W}_{\mathrm{be}}^{(l)}$ as functions of the center node. Importantly, while these generators produce node-specific weight matrices, their underlying parameters are shared across all center nodes. Such design strikes a balance between adaptability and model compactness, eliminating the risk of an exponential surge in parameter count. Specifically, for a center node $v_{i}$ , the $(l + 1)$ -th layer weight matrices of its aggregation functions are defined as:
+
+$$
+\mathbf {W} _ {\mathrm {f r}, i} ^ {(l)} = \Psi_ {\mathrm {f r}} \left(\mathbf {h} _ {i} ^ {(l)}\right) \quad \mathbf {W} _ {\mathrm {b e}, i} ^ {(l)} = \Psi_ {\mathrm {b e}} \left(\mathbf {h} _ {i} ^ {(l)}\right), \tag {5}
+$$
+
+where $\Psi_{\mathrm{fr}}, \Psi_{\mathrm{be}}: \mathbb{R}^d \to \mathbb{R}^{d \times d'}$ are two learnable weight generators defined as $\Psi_{\mathrm{fr}}(x) = \mathrm{MLP}_{\mathrm{fr}}(\mathrm{diag}(x))$ and $\Psi_{\mathrm{be}}(x) = \mathrm{MLP}_{\mathrm{be}}(\mathrm{diag}(x))$ , and they are both implemented as single-layered MLPs; $\mathrm{diag}(x)$ is the diagonal matrix of the input vector. Each node $v_i$ can receive a distinct $\mathbf{W}_{\mathrm{fr},i}^{(l)}$
+
+
+(a)
+
+
+(b)
+Figure 2: (a) A Barabási-Albert graph with 500 nodes, with $10\%$ nodes are fraud. Features of benign nodes (depicted in blue) follow a Gaussian distribution, $\mathcal{N}(1,1)$ , while those of fraud nodes (shown in red) are drawn from $\mathcal{N}(5,1)$ . (b) Spectral convolution filters of PMP for a random node $v_{i}$ .
+
+and $\mathbf{W}_{\mathrm{be},i}^{(l)}$ tailored to its unique features, while the generation process $\mathrm{MLP_{fr}}$ and $\mathrm{MLP_{be}}$ remains consistent and is governed by shared parameters across all nodes.
+
+To summarize, PMP works as Algorithm 1 of Appendix A under the $r$ -th relation, utilizing mini-batch training. For $R$ -relational graphs, we perform PMP propagation for each relation separately, resulting in $R$ representations for each node. We then add a concatenation pooling followed by an MLP to integrate $R$ node representations for each node to produce the final node representation.
+
+# 4 THEORETICAL INSIGHTS
+
+As mentioned in Section 2.1, graphs with fraud usually exhibit a heterophily-homophily mixture, as attackers would like to sparsely inject a limited number of fraud nodes into benign communities to camouflage their activities and spread influence. For regions exhibiting homophily, where the center node and its neighbors predominantly share the same label, the desired GNN should act as a loss-pass filter to smooth the feature representations in the locality. Conversely, in heterophilic regions, where the center node's label diverges from most of its neighbors, the GNN must adaptively shift its spectral response to capture such contrasting label information. Some work (Yang et al., 2022a; Wang & Zhang, 2022) show that assigning each feature dimension a separate spectral filter improves the performance of GNNs. Differently, our model achieves adaptivity at the node level, with each node being assigned a separate spectral filter. Specifically, we present the following theorem.
+
+Theorem 1. Consider an undirected graph $\mathcal{G}$ , let $\mathbf{L} = \mathbf{U}\Lambda \mathbf{U}^{\top}$ represent the eigendecomposition of the symmetric normalized Laplacian $\mathbf{L} = \mathbf{I} - \mathbf{D}^{-1/2}\mathbf{A}\mathbf{D}^{-1/2}$ , where $\mathbf{U}$ is the matrix of eigenvectors and $\Lambda = \mathrm{diag}([\lambda_i]_{i=1\dots N})$ is the diagonal matrix of eigenvalues and $0 = \lambda_1 \leq \dots \leq \lambda_n \leq 2$ . Given two sets of $d'$ graph signals $\mathbf{XW}_{fr}$ and $\mathbf{XW}_{be}$ , PMP scheme described in Eq. (3) operates as an adaptive graph filter, with the node-specific spectral convolution for node $v_i$ on $\mathbf{XW}_{fr}$ and $\mathbf{XW}_{be}$ is given as:
+
+$$
+\mathbf {H} (v _ {i}) = g _ {f r} ^ {i} (\mathbf {L}) \mathbf {X} \mathbf {W} _ {f r} + g _ {b e} ^ {i} (\mathbf {L}) \mathbf {X} \mathbf {W} _ {b e} = \mathbf {U} g _ {f r} ^ {i} (\Lambda) \mathbf {U} ^ {\top} \mathbf {X} \mathbf {W} _ {f r} + \mathbf {U} g _ {b e} ^ {i} (\Lambda) \mathbf {U} ^ {\top} \mathbf {X} \mathbf {W} _ {b e} \tag {6}
+$$
+
+where the spectral convolution filters are diagonal matrices defined as:
+
+$$
+g _ {f r} ^ {i} (\Lambda) [ j, j ] = \left\{ \begin{array}{l l} 1 - \lambda_ {j} & v _ {j} \in \mathcal {N} _ {f r} (v _ {i}) \\ 0 & v _ {j} \in \mathcal {N} _ {b e} (v _ {i}) \\ \alpha_ {i} (1 - \lambda_ {j}) & \text {o t h e r w i s e} \end{array} \quad g _ {b e} ^ {i} (\Lambda) [ j, j ] = \left\{ \begin{array}{l l} 0 & v _ {j} \in \mathcal {N} _ {f r} (v _ {i}) \\ 1 - \lambda_ {j} & v _ {j} \in \mathcal {N} _ {b e} (v _ {i}) \\ (1 - \alpha_ {i}) (1 - \lambda_ {j}) & \text {o t h e r w i s e} \end{array} \right. \right. \tag {7}
+$$
+
+where $\mathcal{N}_{fr}(v_i)$ and $\mathcal{N}_{be}(v_i)$ are respectively the fraud neighbors and benign neighbors of $v_i$ in the training set. The $i$ -th row of the matrix $\mathbf{H}(v_i)$ , i.e., $\mathbf{H}(v_i)[i,:]$ , is the representation of $v_i$ .
+
+We provide a proof in Appendix B. The inherent mixed homophily-heterophily characteristics of fraud graphs underline the importance of utilizing node-specific adaptive filters. As different center nodes locate in diverse contexts within the graph, they each reflect distinct degrees of homophily or heterophily. This variability implies that a one-size-fits-all approach, using a universal graph filter across all nodes (Defferrard et al., 2016; Kipf & Welling, 2017; Tang et al., 2022), is not only suboptimal but could lead to inaccuracies in fraud detection. PMP ensures that the filters are tailored
+
+Table 1: Experiment Results on Yelp and Amazon (40% training ratio).
+
+
Method
Yelp
Amazon
AUC
F1-Macro
G-Mean
AUC
F1-Macro
G-Mean
GCN
59.83±0.49
56.20±0.67
43.65±2.62
83.69±1.25
64.86±6.94
57.18±19.51
GAT
57.15±0.29
48.79±2.30
16.59±7.89
81.02±1.79
64.64±3.87
66.75±13.45
GraphSAGE
89.38±0.19
75.46±0.81
73.07±4.79
93.16±0.87
88.26±0.62
83.46±1.49
GPRGNN
82.85±0.66
63.19±0.80
75.62±1.24
93.72±0.68
80.66±1.82
85.56±2.73
FAGCN
74.23±0.27
61.18±0.75
67.37±1.26
95.00±0.81
87.29±1.53
79.62±0.96
Care-GNN
76.19±2.92
63.32±0.94
67.91±3.59
90.67±1.49
86.39±1.66
70.52±0.21
PC-GNN
79.87±0.14
63.00±2.30
71.60±1.30
95.86±0.14
89.56±0.77
90.30±0.44
H2-FDetector
89.48±1.26
74.38±2.42
79.15±2.57
96.03±0.69
86.91±1.01
91.74±0.47
BWGNN
90.54±0.49
76.96±0.89
77.12±0.99
97.42±0.48
91.72±0.84
90.01±0.36
GHRN
90.57±0.36
77.54±1.02
74.21±1.57
97.07±0.73
92.36±0.97
90.58±0.45
GDN
90.34±0.80
76.05±0.60
80.84±0.09
97.09±0.16
90.68±0.42
90.78±0.11
PMP
93.97±0.15
81.96±0.56
83.92±1.04
97.57±0.12
92.03±0.79
91.85±0.65
+
+Table 2: Experiment Results on T-Finance and T-Social (40% training ratio). OOM: out of memory; OOT: out of time (running time $>1$ day).
+
+
Method
T-Finance
T-Social
AUC
F1-Macro
G-Mean
AUC
F1-Macro
G-Mean
GCN
93.31±0.75
86.86±0.77
80.43±0.82
76.00±2.47
46.85±1.64
71.19±2.73
GAT
92.77±1.12
62.19±0.98
77.46±2.20
63.45±1.36
57.22±0.81
69.53±2.18
GraphSAGE
95.05±0.22
90.37±0.49
85.35±0.38
94.19±1.65
74.97±2.49
72.07±2.39
GPRGNN
54.82±0.78
56.25±0.27
32.96±0.25
82.79±1.21
49.23±0.87
50.03±7.62
FAGCN
OOM
OOM
OOM
OOM
OOM
OOM
Care-GNN
93.79±0.92
82.59±0.86
84.58±1.26
78.91±0.84
51.87±1.76
63.60±0.77
PC-GNN
92.09±0.58
55.81±0.34
81.96±0.42
88.98±0.66
44.13±1.07
75.07±0.80
H2-FDetector
94.99±0.68
74.21±0.70
85.91±0.69
OOT
OOT
OOT
BWGNN
95.84±0.46
88.66±0.72
85.16±1.66
94.72±1.88
84.06±2.89
81.51±4.08
GHRN
95.77±0.60
87.92±0.75
81.65±0.43
90.60±1.78
68.28±0.73
63.42±2.81
GDN
95.53±0.74
88.75±2.26
87.84±0.97
88.06±0.43
56.89±1.11
30.33±3.67
PMP
97.10±0.23
91.90±0.50
88.51±1.26
99.62±0.07
95.27±0.32
92.97±0.64
+
+to the unique neighborhood characteristics of each node, enhancing both sensitivity and specificity in identifying fraud patterns. Fig. 2 shows an example of PMP on a $BA(500)$ graph. We can find that $g_{\mathrm{fr}}^i (\Lambda)$ and $g_{\mathrm{be}}^i (\Lambda)$ are two complementary filters that cover all frequencies in the spectral domain.
+
+# 5 EXPERIMENTS
+
+# 5.1 EXPERIMENTAL SETUP
+
+Datasets and Baselines. We evaluate our approach using five datasets tailored for GFD: Yelp (Rayana & Akoglu, 2015), Amazon (McAuley & Leskovec, 2013), T-Finance, T-Social (Tang et al., 2022). Besides, we have evaluated our model on a large-scale real graph from our industry partner, Grab. The statistics of these datasets are provided in Table 4 of Appendix D. We compare our model against 11 state-of-the-art approaches, including generic GNNs: GCN (Kipf & Welling, 2017), GraphSAGE (Hamilton et al., 2017), and GAT (Veličković et al., 2018); beyond homophily GNNs: GPRGNN (Chien et al., 2021) and FAGCN (Bo et al., 2021); fraud detection tailored GNNs: CareGNN (Dou et al., 2020), PC-GNN (Liu et al., 2021c), H2-FDetector (Shi et al., 2022), BWGNN (Tang et al., 2022), GHRN (Gao et al., 2023c), and GDN (Gao et al., 2023b).
+
+Metrics and Implementation Details. We employ three commonly used metrics for imbalanced classification in deep learning evaluations: AUC, F1-Macro and G-Mean. We provide a detailed explanation of each metric in Appendix D.3. Following (Tang et al., 2022), we adopt the data splitting ratios of $40\% : 20\% : 40\%$ for training, validation, and test set in the supervised scenario. In the semi-supervised scenario, the data splitting ratio is $1\% : 10\% : 89\%$ . For consistency in our evaluations, each model underwent 10 trials with varied random seeds. We present the average performance
+
+
+(a) Yelp
+
+
+(b) Amazon
+
+
+(c) T-Finance
+Figure 4: Influence distribution.
+
+and standard deviation for each model as benchmarks for comparison. We provide the detailed hyperparameter tuning strategies of baselines and hyperparameter setting of PMP in Appendix D.4.
+
+# 5.2 PERFORMANCE COMPARISON
+
+For public datasets, results derived from the supervised setting can be found in Tables 1 and 2, while those from the semi-supervised setting are detailed in Tables 6 and 7 of Appendix E.1. For the Grab dataset, results are shown in Appendix E.2. The results demonstrate that PMP consistently surpasses baseline performances across almost all datasets and metrics. One explanation for its enhanced performance over generic GNNs—where the learnable weights of the aggregation function are uniformly applied across all neighbors—is that PMP encodes class-specific discriminative information into the model parameters.
+
+This is achieved by distinguishing neighbors of distinct classes during the message passing phase. Besides, the adaptive modulation between $\mathbf{W}_{\mathrm{fr}}$ and $\mathbf{W}_{\mathrm{be}}$ allows nodes to judiciously calibrate the information flow from distinct classes of neighbors. By segregating the processing of neighbors based on their labels, our model can adaptively emphasize and give importance to rare patterns, which is vital in imbalanced and heterophilic scenarios. Among generic GNNs, GraphSAGE exhibits better performance due to its separation between ego- and neighbor embeddings, which is beneficial when learning under heterophily, and our model also inherits such design.
+
+In comparison to the six GNNs tailored for GFD, our model also demonstrates a markedly superior performance. For instance, on Yelp, our model shows improvements of $3.4\%$ in AUC, $4.42\%$ in F1-Macro, and $3.08\%$ in G-Mean. Interestingly, our evaluation reveals that GraphSAGE, despite its fundamental design, serves as a potent baseline, even surpassing some models specifically crafted for GFD. Many of these specialized baselines incorporate intricate preprocessing steps rooted in feature engineering (e.g., GHRN) or employ learnable edge reweighting/sampling techniques (e.g., H2-FDetector) for graph augmentation. Such findings suggest that elaborate manipulations to tailor the graph structure for the model might be superfluous. Instead, adapting the model to align better with the inherent graph characteristics could prove to be a more effective strategy. Our model presented in Eq. (3) can be seen as a variant of GraphSAGE. Notably, relative to GraphSAGE, our model exhibits substantial performance enhancements, underscoring the efficacy of the proposed partitioning message passing strategy. In Fig. 3, we show that our model achieves the optimal trade-off between inference speed and effectiveness in comparison to baselines. PMP follows the iterative aggregation framework of GNNs, thus the number of layers and the dimension of hidden layers are two core parameters that determine the receptive field and representation power of the model. Thus, we analyze the sensitivity of the model to these two parameters in Appendix D.5.
+
+
+Figure 3: AUC vs. testing time on T-Social.
+
+# 5.3 HOW DOES PMP SOLVE THE PROBLEMS OF HETEROPHILY AND LABEL IMBALANCE?
+
+To answer this question, we investigate the influence of neighbors with different labels on the center fraud nodes. Given a center fraud node $v_{i}$ , we measure the influence of its fraud neighbors on the final representation of $v_{i}$ as $I_{f}(v_{i}) = \sum_{v_{j}\in \mathcal{N}_{\mathrm{fr}}(v_{i})}\frac{\partial Z_{i}}{\partial X_{j}}$ , where $Z_{i} = H_{i}^{(L)}$ is the output representation of the last layer. Correspondingly, the influence of benign neighbors is captured by
+
+Table 3: Ablation study
+
+
Method
Yelp
Amazon
T-Finance
AUC
F1-Macro
AUC
F1-Macro
AUC
F1-Macro
GraphSAGE
89.38
75.46
93.16
88.26
95.05
90.37
+partition
93.15
78.02
96.33
89.64
95.92
91.43
++adaptive combination
93.51
79.93
97.61
91.29
96.86
91.31
+++root-specific weights (full PMP)
93.97
81.96
97.57
92.03
97.10
91.90
+
+$I_{b}(v_{i}) = \sum_{v_{j}\in \mathcal{N}_{\mathrm{be}}(v_{i})}\frac{\partial Z_{i}}{\partial X_{j}}.$ Then, the larger $I_{f}(v_{i}) - I_{b}(v_{i})$ , the larger influence of homophilic neighbors on the center fraud node, which indicates that the model is robust, effectively mitigating the issues of label imbalance and heterophily. In Fig. 4, we show the distribution of $I_{f} - I_{b}$ with respect to all fraud nodes. It is evident that, in comparison to GCN and BWGNN, the representations learned through PMP exhibit a higher $I_{f} - I_{b}$ for a greater number of fraud nodes. This metric underscores PMP's efficacy in enhancing the impact of homophilic (fraud) neighbors on the center fraud node, despite them being in the minority, on the center node, thereby showcasing its superior ability to resist the challenges posed by label imbalance and heterophily.
+
+# 5.4 ABLATION STUDY
+
+As shown in Eq. (3), the main difference between PMP and GraphSAGE rests in their aggregation methods: while GraphSAGE employs a uniform aggregation with shared feature transformations for all neighbors, PMP distinctly partitions message passing, applying varied feature transformations contingent upon neighbor labels. The results in Section 5.2 show our model consistently outperforms GraphSAGE across all datasets and evaluation metrics, which demonstrates that such a simple design can significantly enhance GNN performance in GFD.
+
+Additionally, we delve deeper to validate two pivotal components of our model: the adaptive blending of unlabeled neighbors as a weighted fusion of labeled data, as shown in Eq. (4), and the root-specific weight matrices in Eq. (5). Table 3 shows the results, where we employ GraphSAGE as the benchmark model, given its conceptual proximity to our proposal, to methodically illustrate the incremental benefits introduced by our design choices. “+partition” denotes adopting distinct weight matrices for labeled fraud benign neighbors, while for unlabeled neighbors, a separate, independent weight matrix is employed. Subsequently, “++adaptive combination” denotes that the weight matrix for unlabeled neighbors is treated as an adaptive combination of the weights of labeled neighbors as introduced in Eq. (4). “+++root-specific weights” implies that the weight matrices for fraud and benign neighbors are dynamically generated as functions of the center node as presented in Eq. (5).
+
+From our evaluations, it is evident that GraphSAGE lags behind in performance across all metrics. This underscores the inherent limitation of uniformly aggregating information from all neighbors during the message passing process. Such an approach, while general and versatile, might miss out on capturing the relationships and contextual dependencies intrinsic to GFD. The "+"partition" contributes to major improvements, which affirms that the core feature of our model, distinguishing between different classes of neighbors during message passing, stands as a pivotal mechanism for enhancing GNNs' efficacy in GFD. Besides, the subsequent extensions, "adaptive combination" and "root-specific weights", also contribute positively to the overall performance. Specifically, the "+"adaptive combination", building upon the "+"partition", brings incremental improvements across all datasets. The "+"root-specific weights", further extending the preceding component, enhances performance on most metrics in most datasets. Combined, these two components contribute to a cumulative improvement of more than $1\%$ over the "+"partition" baseline.
+
+# 6 CONCLUSIONS
+
+This work presents a simple yet effective GNN framework, PMP, for fraud detection task. We propose that the key of applying GNNs on fraud detection is to distinguish neighbors with different labels during message passing. With this insight, neighbor aggregation is partitioned based on labels using distinct node-specific aggregation functions. In this way, the center node can adaptively adjust the information propagated from its homophilic and heterophilic neighbors, thus avoiding model overfitting the majority class nodes (i.e., benign), and alleviating the problem of heterophily. The theoretical analysis of PMP demonstrates that PMP learns an adaptive spectral filter for each node separately. Extensive experiments show that our model achieves new state-of-the-art results on several public GFD datasets, verifying the power of partitioning message passing for GFD.
+
+# ACKNOWLEDGMENTS
+
+This research is supported by the National Research Foundation, Singapore under its AI Singapore Programme (AISG Award No: AISG2-TC-2021-002); Shenzhen Baisc Research Fund under grant JCYJ20200109142217397.
+
+# REFERENCES
+
+Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In international conference on machine learning, pp. 21-29. PMLR, 2019.
+Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. Beyond low-frequency information in graph convolutional networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 3950-3957, 2021.
+Nan Chen, Zemin Liu, Bryan Hooi, Bingsheng He, Rizal Fathony, Jun Hu, and Jia Chen. Consistency training with learnable data augmentation for graph anomaly detection with limited supervision. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=e1MKXvhhQ9.
+Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=n6jl7fLxrP.
+Hyunsoo Cho, Jinseok Seol, and Sang-goo Lee. Masked contrastive learning for anomaly detection. arXiv preprint arXiv:2105.08793, 2021.
+Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Lio, and Petar Velickovic. Principal neighbourhood aggregation for graph nets. In Advances in Neural Information Processing Systems, 2020.
+Limeng Cui, Haeseung Seo, Maryam Tabar, Fenglong Ma, Suhang Wang, and Dongwon Lee. Deterrent: Knowledge guided graph attention network for detecting healthcare misinformation. In Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 492-502, 2020.
+Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, 2016. URL https://arxiv.org/abs/1606.09375.
+Leyan Deng, Chenwang Wu, Defu Lian, Yongji Wu, and Enhong Chen. Markov-driven graph convolutional networks for social spammer detection. IEEE Transactions on Knowledge and Data Engineering, 2022.
+Yushun Dong, Kaize Ding, Brian Jalaian, Shuiwang Ji, and Jundong Li. Adagnn: Graph neural networks with adaptive frequency response filter. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, pp. 392-401, 2021.
+Yingtong Dou, Zhiwei Liu, Li Sun, Yutong Deng, Hao Peng, and Philip S Yu. Enhancing graph neural network-based fraud detectors against camouflaged fraudsters. In Proceedings of the 29th ACM international conference on information & knowledge management, pp. 315-324, 2020.
+Yuan Gao, Xiang Wang, Xiangnan He, Zhenguang Liu, Huamin Feng, and Yongdong Zhang. Addressing heterophily in graph anomaly detection: A perspective of graph spectrum. In Proceedings of the ACM Web Conference 2023, pp. 1528-1538, 2023a.
+Yuan Gao, Xiang Wang, Xiangnan He, Zhenguang Liu, Huamin Feng, and Yongdong Zhang. Alleviating structural distribution shift in graph anomaly detection. In Proceedings of the Sixteenth ACM International Conference on Web Search and Data Mining, pp. 357-365, 2023b.
+
+Yuan Gao, Xiang Wang, Xiangnan He, Zhenguang Liu, Huamin Feng, and Yongdong Zhang. Addressing heterophily in graph anomaly detection: A perspective of graph spectrum. In WWW, 2023c.
+Johannes Gasteiger, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In International Conference on Learning Representations (ICLR), 2019a.
+Johannes Gasteiger, Stefan Weißenberger, and Stephan Gunnemann. Diffusion improves graph learning. Advances in neural information processing systems, 32, 2019b.
+Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International conference on machine learning, pp. 1263-1272. PMLR, 2017.
+Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. Advances in neural information processing systems, 30, 2017.
+Mingguo He, Zhewei Wei, Hongteng Xu, et al. Bernnet: Learning arbitrary graph spectral filters via bernstein approximation. Advances in Neural Information Processing Systems, 34:14239-14251, 2021.
+Wei Jin, Tyler Derr, Yiqi Wang, Yao Ma, Zitao Liu, and Jiliang Tang. Node similarity preserving graph convolutional networks. In Proceedings of the 14th ACM international conference on web search and data mining, pp. 148-156, 2021.
+Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
+Derek Lim, Xiuyu Li, Felix Hohne, and Ser-Nam Lim. New benchmarks for learning on nonhomophilous graphs. arXiv preprint arXiv:2104.01404, 2021.
+Wangli Lin, Li Sun, Qiwei Zhong, Can Liu, Jinghua Feng, Xiang Ao, and Hao Yang. Online credit payment fraud detection via structure-aware hierarchical recurrent neural network. In *IJCAI*, pp. 3670-3676, 2021.
+Can Liu, Li Sun, Xiang Ao, Jinghua Feng, Qing He, and Hao Yang. Intention-aware heterogeneous graph attention networks for fraud transactions detection. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 3280-3288, 2021a.
+Meng Liu, Zhengyang Wang, and Shuiwang Ji. Non-local graph neural networks. IEEE transactions on pattern analysis and machine intelligence, 44(12):10270-10276, 2021b.
+Yang Liu, Xiang Ao, Zidi Qin, Jianfeng Chi, Jinghua Feng, Hao Yang, and Qing He. Pick and choose: A gnn-based imbalanced learning approach for fraud detection. In Proceedings of the Web Conference 2021, pp. 3168-3177, 2021c.
+Zemin Liu, Yuan Li, Nan Chen, Qian Wang, Bryan Hooi, and Bingsheng He. A survey of imbalanced learning on graphs: Problems, techniques, and future directions. arXiv preprint arXiv:2308.13821, 2023.
+Zhiwei Liu, Yingtong Dou, Philip S Yu, Yutong Deng, and Hao Peng. Alleviating the inconsistency problem of applying graph neural network to fraud detection. In Proceedings of the 43rd international ACM SIGIR conference on research and development in information retrieval, pp. 1569-1572, 2020.
+Sitao Luan, Chenqing Hua, Qincheng Lu, Jiaqi Zhu, Mingde Zhao, Shuyuan Zhang, Xiao-Wen Chang, and Doina Precup. Is heterophily a real nightmare for graph neural networks to do node classification? arXiv preprint arXiv:2109.05641, 2021.
+Julian John McAuley and Jure Leskovec. From amateurs to connoisseurs: modeling the evolution of user expertise through online reviews. In Proceedings of the 22nd international conference on World Wide Web, pp. 897-908, 2013.
+
+Mohamed Nabeel, Enes Altinisik, Haipei Sun, Issa Khalil, Hui Wang, and Ting Yu. Cadue: Contentagnostic detection of unwanted emails for enterprise security. In Proceedings of the 24th International Symposium on Research in Attacks, Intrusions and Defenses, pp. 205-219, 2021.
+Eric WT Ngai, Yong Hu, Yiu Hing Wong, Yijun Chen, and Xin Sun. The application of data mining techniques in financial fraud detection: A classification framework and an academic review of literature. Decision support systems, 50(3):559-569, 2011.
+Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=S1e2agrFvS.
+Oleg Platonov, Denis Kuznedelev, Michael Diskin, Artem Babenko, and Liudmila Prokhorenkova. A critical look at evaluation of gnns under heterophily: Are we really making progress? In The Eleventh International Conference on Learning Representations, 2023.
+Liang Qu, Huaisheng Zhu, Ruiqi Zheng, Yuhui Shi, and Hongzhi Yin. Imgagn: Imbalanced network embedding via generative adversarial graph networks. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 1390-1398, 2021.
+Susie Xi Rao, Shuai Zhang, Zhichao Han, Zitao Zhang, Wei Min, Zhiyao Chen, Yinan Shan, Yang Zhao, and Ce Zhang. xfraud: Explainable fraud transaction detection. VLDB, 2022. doi: 10.14778/3494124.3494128.
+Shebuti Rayana and Leman Akoglu. Collective opinion spam detection: Bridging review networks and metadata. In Proceedings of the 21th acm sigkdd international conference on knowledge discovery and data mining, pp. 985-994, 2015.
+Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne Van Den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In *The Semantic Web: 15th International Conference, ESWC* 2018, Heraklion, Crete, Greece, June 3-7, 2018, Proceedings 15, pp. 593-607. Springer, 2018.
+Fengzhao Shi, Yanan Cao, Yanmin Shang, Yuchen Zhou, Chuan Zhou, and Jia Wu. H2-fdetector: A gnn-based fraud detector with homophilic and heterophilic connections. In Proceedings of the ACM Web Conference 2022 (TheWebConf), pp. 1486-1494, 2022.
+Min Shi, Yufei Tang, Xingquan Zhu, David Wilson, and Jianxun Liu. Multi-class imbalanced graph convolutional network learning. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20), 2020.
+Jaeyun Song, Joonhyung Park, and Eunho Yang. Tam: topology-aware margin loss for class-imbalanced node classification. In International Conference on Machine Learning, pp. 20369-20383. PMLR, 2022.
+Jianheng Tang, Jiajin Li, Ziqi Gao, and Jia Li. Rethinking graph neural networks for anomaly detection. In International Conference on Machine Learning, pp. 21076-21089. PMLR, 2022.
+Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph Attention Networks. International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJXMpikCZ.
+Daixin Wang, Jianbin Lin, Peng Cui, Quanhui Jia, Zhen Wang, Yanming Fang, Quan Yu, Jun Zhou, Shuang Yang, and Yuan Qi. A semi-supervised graph attentive network for financial fraud detection. In 2019 IEEE International Conference on Data Mining (ICDM), pp. 598-607. IEEE, 2019.
+Xiyuan Wang and Muhan Zhang. How powerful are spectral graph neural networks. In International Conference on Machine Learning, pp. 23341-23362. PMLR, 2022.
+Yuchen Wang, Jinghui Zhang, Zhengjie Huang, Weibin Li, Shikun Feng, Ziheng Ma, Yu Sun, Dianhai Yu, Fang Dong, Jiahui Jin, et al. Label information enhanced fraud detection against low homophily in graphs. In Proceedings of the ACM Web Conference 2023, pp. 406-416, 2023.
+
+Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 32(1):4-24, 2020.
+Bingbing Xu, Huawei Shen, Bingjie Sun, Rong An, Qi Cao, and Xueqi Cheng. Towards consumer loan fraud detection: Graph neural networks with role-constrained conditional random field. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 4537-4545, 2021.
+Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International conference on machine learning, pp. 5453-5462. PMLR, 2018.
+Mingqi Yang, Yanming Shen, Rui Li, Heng Qi, Qiang Zhang, and Baocai Yin. A new perspective on the effects of spectrum in graph neural networks. In International Conference on Machine Learning, pp. 25261-25279. PMLR, 2022a.
+Tianmeng Yang, Yujing Wang, Zhihan Yue, Yaming Yang, Yunhai Tong, and Jing Bai. Graph pointer neural networks. In Proceedings of the AAAI conference on artificial intelligence, volume 36, pp. 8832-8839, 2022b.
+Wentao Zhang, Mingyu Yang, Zeang Sheng, Yang Li, Wen Ouyang, Yangyu Tao, Zhi Yang, and Bin Cui. Node dependent local smoothing for scalable graph learning. Advances in Neural Information Processing Systems, 34:20321-20332, 2021.
+Tianxiang Zhao, Xiang Zhang, and Suhang Wang. Graphsmote: Imbalanced node classification on graphs with graph neural networks. In Proceedings of the 14th ACM international conference on web search and data mining, pp. 833-841, 2021.
+Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. Beyond homophily in graph neural networks: Current limitations and effective designs. Advances in neural information processing systems, 33:7793-7804, 2020.
+Meiqi Zhu, Xiao Wang, Chuan Shi, Houye Ji, and Peng Cui. Interpreting and unifying graph neural networks with an optimization framework. In Proceedings of the Web Conference 2021, pp. 1215-1226, 2021.
+Wei Zhuo and Guang Tan. Proximity enhanced graph neural networks with channel contrast. In Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI-22, pp. 2448-2455, 2022.
+
+# A ALGORITHMIC DETAILS
+
+Algorithm 1 PMP forward propagation
+Input: Fraud graph $\mathcal{G} = (\mathcal{V},E_r,\mathbf{X},\mathcal{Y})$ ; Depth $L$ ; Batch size $B$
+Output: Logits $\mathbf{Z}\in \mathbb{R}^{N}$
+1: for $l\in \{1,\dots ,L\}$ do
+2: for each batch $\subseteq G$ of size $B$ do
+3: for $v_{i}\in$ batch do
+4: $\widehat{\mathbf{h}}_i^{(l)}\gets f_{\mathrm{self}}^{(l - 1)}(\mathbf{h}_i^{(l - 1)})$
+5: $\alpha_{i}^{(l - 1)}\gets \Phi (\mathbf{h}_{i}^{(l - 1)})$
+6: $\mathbf{W}_{\mathrm{fr},i}^{(l - 1)}\leftarrow \Psi_{\mathrm{fr}}(\mathbf{h}_i^{(l - 1)});\mathbf{W}_{\mathrm{be},i}^{(l - 1)} = \Psi_{\mathrm{be}}(\mathbf{h}_i^{(l - 1)});\mathbf{W}_{\mathrm{un},i}^{(l - 1)} = \alpha_i^{(l - 1)}\mathbf{W}_{\mathrm{fr}}^{(l - 1)} + (1-$ $\alpha_{i}^{(l - 1)})\mathbf{W}_{\mathrm{be},i}^{(l - 1)}//$ Generate weight matrices for $v_{i}$
+7: $\begin{array}{rlr}{\bf a}_i^{(l)} & = & {f_{\mathrm{fr},i}^{(l - 1)}\left({\bf h}_j^{(l - 1)}|v_j\in \mathcal{N}_{\mathrm{fr}}(v_i)\right) + }\\ & & {f_{\mathrm{un},i}^{(l - 1)}\left({\bf h}_j^{(l - 1)}|v_j\notin \mathcal{N}_{\mathrm{be}}(v_i)\cup \mathcal{N}_{\mathrm{fr}}(v_i)\right) //} \end{array}$ $f_{\mathrm{be},i}^{(l - 1)}\left({\bf h}_j^{(l - 1)}|v_j\in \mathcal{N}_{\mathrm{be}}(v_i)\right) +$ $f_{\mathrm{un},i}^{(l - 1)},f_{\mathrm{be},i}^{(l - 1)}$ and $f_{\mathrm{un},i}^{(l - 1)}$ are parame-
+terized by $\mathbf{W}_{\mathrm{fr},i}^{(l - 1)},\mathbf{W}_{\mathrm{be},i}^{(l - 1)}$ and $\mathbf{W}_{\mathrm{un},i}^{(l - 1)}$ respectively.
+8: $\begin{array}{rl}{\bf h}_i^{(l)} = \widehat{\bf h}_i^{(l)} + {\bf a}_i^{(l)} \end{array}$
+9: end for
+10: end for
+11: end for
+12: $\widetilde{\mathbf{H}} = \mathrm{MLP}(\mathbf{H}^{(L)})\in \mathbb{R}^{N\times 1}$
+13: $\mathbf{Z}_i\gets$ Sigmoid( $\widetilde{\mathbf{H}}$
+14: $\mathcal{L} = \sum_{i}(y_{i}\log (\mathbf{Z}_{i}) + (1 - y_{i})\log (1 - \mathbf{Z}_{i}))//$ Cross-entropy loss
+
+Time Complexity The time complexity of an $L$ -layer PMP propagation is $\mathcal{O}(LNd + L|E|d^2)$ . For the adaptive combination of unlabeled neighbors, a single-layer MLP is employed, resulting in a complexity of $\mathcal{O}(Nd)$ . Additionally, generating the root-specific weight matrix carries a time complexity of $\mathcal{O}(Nd^2)$ . Thus, the aggregate time complexity of the PMP can be summarized as $\mathcal{O}(LNd + (L|E| + N)d^2)$ .
+
+# B PROOF OF THEOREM 1
+
+Proof. Assuming the node indices are fixed, let $\mathbf{F}$ , $\mathbf{B}$ be diagonal label mask matrices, which mask benign nodes and fraud nodes respectively with 0 in the main diagonal elements. Specifically, for a node $v_{i}$ labeled 1 (fraud) in the training set, we assign $\mathbf{F}_{ii} = 1$ , otherwise 0. Similarly, for training benign nodes, $\mathbf{B}_{ii} = 1$ otherwise 0. Then the mask matrix of unlabeled nodes is thus $\mathbf{I} - \mathbf{F} - \mathbf{B}$ . For the sake of simplicity, we analyze the first layer of PMP as an example and omit superscripts. Specifically, the feature transformation step of Eq. (3) can be reformulated as:
+
+$$
+\mathbf {F X W} _ {\mathrm {f r}} + \mathbf {B X W} _ {\mathrm {b e}} + (\mathbf {I} - \mathbf {F} - \mathbf {B}) \mathbf {X} \left(\alpha_ {i} \mathbf {W} _ {\mathrm {f r}} + (1 - \alpha_ {i}) \mathbf {W} _ {\mathrm {b e}}\right)
+$$
+
+$$
+= \left(\mathbf {F} + \alpha_ {i} \mathbf {I} - \alpha_ {i} \mathbf {F} - \alpha_ {i} \mathbf {B}\right) \mathbf {X W} _ {\mathrm {f r}} + \left(\mathbf {B} + (1 - \alpha_ {i}) \mathbf {I} - (1 - \alpha_ {i}) \mathbf {B} - (1 - \alpha_ {i}) \mathbf {B}\right) \mathbf {X W} _ {\mathrm {b e}}. \tag {8}
+$$
+
+Let $\mathbf{K}(v_i) = \mathbf{F} + \alpha_i\mathbf{I} - \alpha_i\mathbf{F} - \alpha_i\mathbf{B}$ , Eq. (8) can be rewritten as:
+
+$$
+\mathbf {K} (v _ {i}) \mathbf {X} \mathbf {W} _ {\mathrm {f r}} + (\mathbf {I} - \mathbf {K} (v _ {i})) \mathbf {X} \mathbf {W} _ {\mathrm {b e}}
+$$
+
+$$
+\text {w h e r e} \quad \mathbf {K} (v _ {i}) [ j, j ] = \left\{ \begin{array}{l l} 1 & v _ {j} \in \mathcal {N} _ {\mathrm {f r}} (v _ {i}) \\ 0 & v _ {j} \in \mathcal {N} _ {\mathrm {b e}} (v _ {i}) \\ \alpha_ {i} & \text {o t h e r w i s e} \end{array} . \right. \tag {9}
+$$
+
+To facilitate the spectral analysis, we align the definition of the graph convolution with GCNs (Kipf & Welling, 2017), using the normalized adjacency matrix, $\mathbf{D}^{-1/2}\mathbf{A}\mathbf{D}^{-1/2} = \mathbf{I} - \mathbf{L}$ . Note that although our model utilizes summation as the convolution method, this doesn't alter its inherent
+
+spectral properties (Dong et al., 2021; Zhu et al., 2021). Since the matrix $\mathbf{K}(\cdot)$ is node-specific, for $v_{i}$ , it induces a separate message passing matrix form:
+
+$$
+\begin{array}{l} \mathbf {H} (v _ {i}) = (\mathbf {I} - \mathbf {L}) \mathbf {K} (v _ {i}) \mathbf {X} \mathbf {W} _ {\mathrm {f r}} + (\mathbf {I} - \mathbf {L}) (\mathbf {I} - \mathbf {K} (v _ {i})) \mathbf {X} \mathbf {W} _ {\mathrm {b e}} \\ = \mathbf {U} g _ {\mathrm {f r}} ^ {i} (\Lambda) \mathbf {U} ^ {\top} \mathbf {X} \mathbf {W} _ {\mathrm {f r}} + \mathbf {U} g _ {\mathrm {b e}} ^ {i} (\Lambda) \mathbf {U} ^ {\top} \mathbf {X} \mathbf {W} _ {\mathrm {b e}}, \tag {10} \\ \end{array}
+$$
+
+where the node-specific convolution filters $g_{\mathrm{fr}}^i (\Lambda)$ and $g_{\mathrm{be}}^i (\Lambda)$ can be derived as Eq. (7). $\mathbf{H}(v_i)\in$ $\mathbb{R}^{N\times d'}$ is a representation matrix induced by the convolution kernel functions associated with $v_{i}$ thus its $i$ -th row $\mathbf{H}(v_i)[i,:]$ gives the PMP representation for $v_{i}$ . For another node $v_{j}$ , it yields a corresponding PMP representation matrix $\mathbf{H}(v_j)$ whose $j$ -th row is the representation of $v_{j}$ . Besides, we can find that the spectral filters depend on the node indices and the label distribution. For the frequency $\lambda_{j}$ with its index $j$ satisfying $v_{j}\notin \mathcal{N}_{\mathrm{fr}}(v_{i})\cup \mathcal{N}_{\mathrm{be}}(v_{i})$ , then its response $g^{i}(\lambda_{j})$ is node-adaptive given that $\alpha_{i}$ is inherently a function of $v_{i}$ . Since in real-world networks, where most nodes remain unlabeled, we can conclude that PMP is an adaptive node-specific spectral convolution.
+
+# C RELATION OF PMP TO ACM
+
+The basic idea of Adaptive Channel Mixture (ACM) (Luan et al., 2021) is to attribute negative weights to heterophilic neighbors through a spectral synthesis of low-pass and high-pass filters. This technique fundamentally differs from our PMP. It is because the use of negative weights in ACM is indicative of removing (or subtracting) the heterophilic components from the homophilic neighbors. This can be interpreted as a form of information "forgetting" where heterophilic features are de-emphasized in favor of homophilic features. It is different from PMP which preserves and utilizes all available information. From the perspective of methodology, ACM is rooted in spectral graph theory, while PMP is spatially oriented. This difference is not just theoretical but has practical implications. The spectral nature of ACM inherently influences its scalability, particularly in the context of large graphs. Typically, spectral-based models, including ACM, require the entire graph as input, which can pose challenges for mini-batch training and thereby limit scalability. In contrast, our PMP model, with its spatial-based framework, inherently supports mini-batch training and is thus more adaptable to large-scale graphs. Furthermore, considering the application of ACM in GFD tasks, its formulation, with removed nonlinearity for simplicity's sake, can be
+
+expressed as $H_{\mathbf{ACM}}^{(l + 1)} = \alpha F_L \begin{bmatrix} H_{fr}^{(l)} \\ H_{be}^{(l)} \\ H_{un}^{(l)} \end{bmatrix} W_1^{(l)} + \beta F_H \begin{bmatrix} H_{fr}^{(l)} \\ H_{be}^{(l)} \\ H_{un}^{(l)} \end{bmatrix} W_2^{(l)}$ where $F_L$ and $F_H$ are distinct
+
+spectral filters. We can observe that the trainable weight matrix $W_{L}^{(l)}$ and $W_{H}^{(l)}$ are both shared across all nodes. In contrast, our PMP model, when represented in matrix form, can be rewritten
+
+as $H_{\mathbf{PMP}}^{(l + 1)} = F \left[ \begin{array}{c} H_{fr}^{(l)} W_1 \\ H_{be}^{(l)} W_2 \\ H_{un}^{(l)} (\alpha W_1 + (1 - \alpha) W_2) \end{array} \right]$ where $F$ is the normalized adjacency matrix. Unlike
+
+ACM, trainable weight matrices in PMP, $W_{1}$ and $W_{2}$ , are specifically applied to nodes with different labels, where $W_{1}$ and $W_{2}$ capture the information of fraud nodes and benign nodes respectively, reflecting a more label-aware and adaptive approach to message passing in the context of GFD.
+
+# D EXPERIMENTAL DETAILS
+
+# D.1 DATASETS
+
+Table 4 summarizes the dataset statistics, including the number of nodes, edges, and relations, the proportion of fraud nodes, feature dimension, and the homophily score. The imbalance-aware homophily score (Lim et al., 2021) is defined as:
+
+$$
+\hat {\eta} = \frac {1}{C - 1} \sum_ {k = 0} ^ {C - 1} \left[ \eta_ {k} - \frac {| C _ {k} |}{N} \right] _ {+} \tag {11}
+$$
+
+where $[\cdot]_{+} = \max(\cdot, 0)$ . $C$ , representing the number of classes, is set to 2 for GFD. $C_k$ denotes the set of nodes in class $k$ , with $k = 0$ corresponding to benign nodes and $k = 1$ to fraud nodes. $\eta_k$ is the
+
+class-wise homophily metric:
+
+$$
+\eta_ {k} = \frac {\sum_ {v _ {i} \in C _ {k}} | \mathcal {N} _ {k} (v _ {i}) |}{\sum_ {v _ {i} \in C _ {k}} | \mathcal {N} (v _ {i}) |} \tag {12}
+$$
+
+where $\mathcal{N}_k(v_i)|$ is the neighbors of $v_{i}$ with label $k$ . $\hat{\eta} \in [0,1]$ where $\hat{\eta} = 1$ corresponds to a fully homophilic graph, while $\hat{\eta} < 0.5$ indicates a highly heterophilic graph.
+
+We compare the fraud detection performance of different baselines on YelpChi, Amazon, T-Finance, and T-Social. Among them, 1) YelpChi comprises both filtered (spam) and recommended (legitimate) reviews of hotels and restaurants, as collected by Yelp.com. This dataset has three types of relations: R-U-R, representing reviews by the same user; R-S-R, for reviews under the same product receiving identical star ratings; and R-T-R, which groups reviews for the same product posted within the same month. 2) The Amazon dataset collects reviews from the musical instruments category on Amazon. It also has three relations, where the U-P-U relationship links users who have reviewed the same product; the U-S-U relationship connects users who assigned identical ratings within a week; the U-V-U relationship bridges users showcasing the top $5\%$ of mutual review text similarities measured by TF-IDF metrics. 3) T-Finance is a single-relational fraud graph, capturing anomalous accounts within transaction networks. In this dataset, nodes represent anonymized accounts, with attributes including registration days, login activities, and interaction frequencies. Edges mean the existence of transaction records between two accounts. Nodes are annotated as anomalies by human experts if they exhibit behaviors characteristic of fraud, money laundering, or online gambling. 4) T-Social is designed to identify anomalous accounts within social networks. two nodes are interconnected if they sustain a friendship for over three months. 5) The industrial graph includes the transaction of a month in a leading super app. Due to the anonymity and privacy policy, we exclude the exact details of the graph but roughly the graph includes over 1 million nodes and over 10 million edges.
+
+Table 4: Summary of dataset statistics.
+
+
Dataset
# Nodes
#Edges
# Relations
Frauds (%)
#Features
η
YelpChi
45,954
3,846,979
3
14.53%
32
0.0538
Amazon
11,944
4,398,392
3
6.87%
25
0.0512
T-Finance
39,357
21,222,543
1
4.58%
10
0.4363
T-Social
5,781,065
73,105,508
1
3.01%
10
0.1003
Industrial graph
~1M
~10M
1
0.54%
17
-
+
+# D.2 LABEL DISTRIBUTION
+
+In Fig. 5, we show the label distributions of the labeled neighborhoods of training nodes. We use $\frac{|\mathcal{N}_{fr}|}{|\mathcal{N}_{be}|}$ to represent the number of fraud neighbors relative to benign neighbors for a central node. $\frac{|\mathcal{N}_{fr}|}{|\mathcal{N}_{be}|} < 1$ indicates that the number of labeled fraud neighbors is fewer than benign neighbors. Specifically, if $\frac{|\mathcal{N}_{fr}|}{|\mathcal{N}_{be}|} < 0.5$ , it indicates that the central node has far fewer fraud neighbors compared to benign ones, denoting a highly imbalanced neighborhood. The height of each bar means the number of center training nodes under a certain $\frac{|\mathcal{N}_{fr}|}{|\mathcal{N}_{be}|}$ . Our results show that commonly used datasets such as Yelp, Amazon, and T-Finance suffer from significant label imbalance in the neighborhoods, because the neighborhoods' label distribution is long-tail, i.e., the number of fraud neighbors is far less than benign ones. It requires the model can enhance the influence from the minority class neighbors on the center nodes during neighbor aggregation. Combining with the empirical results in Section 5.3, our PMP method effectively achieves this, enhancing the influence from minority class neighbors more efficiently than traditional GNN approaches.
+
+# D.3 METRICS
+
+AUC is the area under the ROC curve, and it provides an aggregate measure of performance across all possible classification thresholds, reflecting the model's ability to distinguish between positive and negative classes. F1-Macro computes the F1 score for each class independently and then takes the average. Lastly, the G-Mean, or geometric mean, calculates the square root of the product of the sensitivity and specificity, offering an insight into the balance between true positive rate and
+
+
+(a) Yelp
+
+
+(b) Amazon
+
+
+(c) T-Finance
+Figure 5: Label distributions of the labeled neighborhoods of the training nodes.
+
+true negative rate performance. Higher values of these metrics signify superior performance of the methods.
+
+# D.4 HYPERPARAMETER SETTINGS
+
+To mitigate bias, we individually fine-tune the hyperparameters of each model for every benchmark and report the best performance on the validation set. For each model, we explored the following searching ranges for general hyperparameters: learning rate $lr \in \{0.01, 0.005, 0.001\}$ , weight decay $wd \in \{0, 5e - 5, 1e - 4\}$ , dropout $do \in \{0, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8\}$ , hidden dimension $d' \in \{32, 64, 128, 256, 512\}$ . For spatial-based models, batch size is an important hyperparameter that highly depends on the graph size. Specifically, for Yelp, Amazon, and T-Finance, batch size $bs \in \{64, 128, 256, 512, 1024\}$ . For the large-scale graph T-Social, $bs \in \{2^{17}, 2^{18}, 2^{19}\}$ . For model-specific hyperparameters, we also carefully calibrate parameters in accordance with varying datasets and training sizes. Here we provide the optimal hyperparameters of PMP in Table 5.
+
+Table 5: Hyperparameter settings for PMP.
+
+
Dataset
lr
wd
do
bs
L
d'
Yelp
0.01
0
0
512
1
256
Amazon
0.01
0
0.6
128
1
128
T-Finance
0.01
0
0.4
256
1
64
T-Social
0.001
0
0
217
1
128
+
+# D.5 PARAMETER STUDY
+
+We investigate the sensitivity in relation to the key hyperparameters in our model: the number of layers $L$ and the hidden dimension $d'$ . For each dataset, we vary $L$ over the range [1, 2, 3], and $d'$ over [32, 64, 128, 256, 512]. We employed a grid search methodology to test combinations of hyperparameters. As illustrated in Fig. 6, PMP consistently performs optimally with a single layer, and more layers bring about a continuous decrease in effect. This phenomenon can be attributed to the issue of oversmoothing. We find that all these datasets have a high average degree. Specifically, the average degree of Yelp, Amazon and T-Finance are 167, 740, and 1078, respectively, and we further investigate the number of nodes within the first two hops of neighborhoods. Eliminating duplication, the average number of nodes in the first two-hop neighborhoods across all nodes stands at 1229 for Yelp, 11338 for Amazon, and 24480 for T-Finance. The remarkable density of these benchmark datasets implies that even a two-layer GNN might aggregate an overwhelming quantum of information from the global, thereby obfuscating the essential local features. Additionally, Furthermore, our findings reveal that the optimal value of $d'$ varies across datasets. This calls for meticulous tuning to ascertain peak performance. A potential rationale for this sensitivity lies in the substantial variability in the dimensions of input node features across different datasets.
+
+# D.6 COMPUTING RESOURCES
+
+For all experiments, we use a single NVIDIA A100 GPU with 80GB GPU memory.
+
+
+(a) Yelp
+
+
+(b) Amazon
+
+
+(c) T-Finance
+Figure 6: Sensitivity study of different hyperparameter combinations.
+
+# E MORE EXPERIMENTAL RESULTS
+
+# E.1 SEMI-SUPERVISED FRAUD DETECTION ON PUBLIC DATASETS
+
+In Table 6 and Table 7, we show the performance of fraud detection under a semi-supervised setting (1% training ratio).
+
+Table 6: Experiment Results on Yelp and Amazon (1% training ratio).
+
+
Method
Yelp
Amazon
AUC
F1-Macro
G-Mean
AUC
F1-Macro
G-Mean
GCN
54.06±0.72
52.48±0.50
46.53±0.98
82.85±0.71
67.93±1.42
58.12±1.97
GAT
50.95±1.39
50.27±2.31
26.83±8.94
73.45±1.26
60.84±2.47
42.24±5.73
GraphSAGE
82.59±0.26
64.21±9.12
57.09±9.56
87.50±0.66
77.88±2.53
70.00±2.26
GPRGNN
54.19±2.95
46.07±1.38
8.29±2.63
80.77±0.31
51.14±2.38
19.93±4.69
FAGCN
70.92±0.92
46.27±0.28
5.90±3.17
92.07±1.51
84.82±0.73
80.13±1.25
Care-GNN
73.96±0.13
61.25±0.34
63.87±0.20
88.30±0.60
69.24±0.27
78.17±0.26
PC-GNN
75.35±0.15
55.05±0.21
68.05±0.25
91.73±0.52
87.58±0.20
80.35±1.68
H2-FDetector
74.19±0.52
57.42±0.45
67.92±0.21
83.26±0.17
67.60±0.31
55.25±0.36
BWGNN
79.31±0.25
66.59±0.16
66.12±0.36
88.37±0.77
86.50±0.59
83.35±0.46
GHRN
76.76±0.37
64.30±0.61
61.73±1.03
90.27±0.30
89.16±0.89
83.68±2.22
GDN
72.31±0.36
58.28±2.13
53.07±1.00
86.38±0.29
76.20±0.08
83.19±0.59
PMP
83.94±0.37
68.60±0.76
72.39±0.42
91.82±0.74
87.72±1.15
83.77±0.66
+
+Table 7: Experiment Results on T-Finance and T-Social (1% training ratio)
+
+
Method
T-Finance
T-Social
AUC
F1-Macro
G-Mean
AUC
F1-Macro
G-Mean
GCN
74.37±0.73
57.51±1.62
72.58±0.90
59.61±1.37
52.34±0.31
52.35±3.93
GAT
83.38±0.67
67.18±0.3
59.71±0.92
68.55±1.46
47.03±1.27
71.26±0.86
GraphSAGE
92.53±0.51
85.09±0.64
82.86±1.73
88.89±0.77
49.24±0.83
22.76±7.66
GPRGNN
89.57±0.65
80.47±1.19
69.34±1.95
74.30±2.57
49.24±0.84
2.72±1.10
FAGCN
OOM
OOM
OOM
OOM
OOM
OOM
Care-GNN
90.73±0.24
76.25±0.29
74.38±0.63
68.32±1.73
53.31±1.52
63.75±0.60
PC-GNN
92.29±0.17
76.17±0.16
81.93±0.73
84.66±1.57
49.38±0.94
57.06±2.65
H2-FDetector
94.37±1.66
83.44±2.53
79.32±2.02
OOT
OOT
OOT
BWGNN
89.54±5.03
85.17±2.81
78.99±5.12
86.40±14.62
77.35±12.89
72.17±16.48
GHRN
89.18±2.31
73.20±1.54
70.08±1.65
87.28±0.29
65.37±0.33
57.93±0.17
GDN
93.32±0.69
87.26±1.77
83.04±1.04
87.37±0.80
56.48±2.85
29.34±3.34
PMP
93.78±0.19
88.89±0.37
84.91±2.57
97.14±0.75
84.58±0.30
83.16±0.64
+
+# E.2 EXPERIMENTAL RESULTS ON GRAB
+
+In Table 8 and Table 9, we show the fraud detection performance on the Grab dataset under supervised and semi-supervised settings.
+
+# E.3 COMPARISON WITH R-GCN
+
+As an extension of the comparative analysis presented in Fig. 4, we include R-GCN due to its ability to handle multiple types of relationships within a graph. R-GCN (Schlichtkrull et al., 2018) extends
+
+Table 8: Experiment Results on Grab (40% training ratio)
+
+
Method
Grab
AUC
F1-Macro
G-Mean
Care-GNN
99.58±0.01
68.87±0.21
98.31±0.03
PC-GNN
98.97±0.02
66.32±1.15
98.08±0.14
H2-FDetector
OOT
OOT
OOT
BWGNN
99.79±0.03
80.63±0.47
99.32±0.01
GHRN
99.71±0.01
76.65±1.46
99.11±0.01
GDN
99.73±0.04
80.83±1.47
99.64±0.02
PMP
99.82±0.02
82.42±0.90
99.63±0.08
+
+Table 9: Experiment Results on Grab (1% training ratio)
+
+
Method
Grab
AUC
F1-Macro
G-Mean
Care-GNN
99.56±0.03
71.73±0.22
98.65±0.02
PC-GNN
96.35±0.24
71.51±2.33
98.98±0.15
H2-FDetector
OOT
OOT
OOT
BWGNN
98.78±0.12
81.53±0.79
99.40±0.02
BHomo-GHRN
99.53±0.02
69.78±1.07
98.42±0.26
GDN
99.72±0.02
79.33±0.46
99.27±0.43
PMP
99.72±0.00
79.73±0.06
99.54±0.04
+
+the GCN model to account for different types of relations in the graph. Fig. 7 illustrates the influence distributions for the multi-relational Yelp and Amazon datasets. It is evident that accounting for multiple relationships results in a rightward (positive) shift in the influence distributions. Despite the relational capabilities of R-GCN, our model demonstrates superior performance on both datasets.
+
+
+(a) Yelp
+Figure 7: Influence distribution.
+
+
+(b) Amazon
\ No newline at end of file
diff --git a/partitioningmessagepassingforgraphfrauddetection/images.zip b/partitioningmessagepassingforgraphfrauddetection/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..a7ce52259794a6e1c0d729d2da16a840ae0b282b
--- /dev/null
+++ b/partitioningmessagepassingforgraphfrauddetection/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:267438cec61ceecc6439893dd370d102f93cba8862698fa397a6462e53c66b30
+size 739644
diff --git a/partitioningmessagepassingforgraphfrauddetection/layout.json b/partitioningmessagepassingforgraphfrauddetection/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..cfe46c32bb9fa093abc30e7e04071c5eee60d476
--- /dev/null
+++ b/partitioningmessagepassingforgraphfrauddetection/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:34084a000e175309325cf526bde5999ee8e4d2a04a31b2277d3e680a142dada9
+size 672529
diff --git a/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_content_list.json b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..fe698b2bcc6902614a68b51b9a3b9ab73d7c6363
--- /dev/null
+++ b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:97f6ebefe252d1372042415a3f9159ce23097841ba155790320281dbbc2961d3
+size 90977
diff --git a/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_model.json b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..16512cd77249371e2b475acfd3aeaac1fac88670
--- /dev/null
+++ b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:572f7bd76ff6b99ad71fbe932c0881604b91897afd9ae981a5bb50e8bbe3a5bc
+size 110435
diff --git a/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_origin.pdf b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..2969a30b040014da37bce30c2932a716d52ce781
--- /dev/null
+++ b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/c1260aef-24d8-43e2-9943-e875bbe4b11e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:61d0a37f9c949224e8df09f381743cf05bdec6280bfd6cf1258a3bcb982a80a7
+size 8410485
diff --git a/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/full.md b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..1aa751580d9d277e13d2d25e75ae6262f5c24b8e
--- /dev/null
+++ b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/full.md
@@ -0,0 +1,362 @@
+# PATCHED DENOISING DIFFUSION MODELS FOR HIGH-RESOLUTION IMAGE SYNTHESIS
+
+Zheng Ding $^{1*}$ Mengqi Zhang $^{1*}$ Jiajun Wu $^{2}$ Zhuowen Tu $^{1}$
+
+$^{1}$ UC San Diego $^{2}$ Stanford University
+
+
+Figure 1: Generated image of size $1024 \times 512$ using the model trained on 21k natural images using a 148M-parameters model.
+
+# ABSTRACT
+
+We propose an effective denoising diffusion model for generating high-resolution images (e.g., $1024 \times 512$ ), trained on small-size image patches (e.g., $64 \times 64$ ). We name our algorithm Patch-DM, in which a new feature collage strategy is designed to avoid the boundary artifact when synthesizing large-size images. Feature collage systematically crops and combines partial features of the neighboring patches to predict the features of a shifted image patch, allowing the seamless generation of the entire image due to the overlap in the patch feature space. Patch-DM produces high-quality image synthesis results on our newly collected dataset of nature images ( $1024 \times 512$ ), as well as on standard benchmarks of LHQ( $1024 \times 1024$ ), FFHQ( $1024 \times 1024$ ) and on other datasets with smaller sizes ( $256 \times 256$ ), including LSUN-Bedroom, LSUN-Church, and FFHQ. We compare our method with previous patch-based generation methods and achieve state-of-the-art FID scores on all six datasets. Further, Patch-DM also reduces memory complexity compared to the classic diffusion models. Project page: https://patchdm.github.io.
+
+# 1 INTRODUCTION
+
+There have been explosive developments in generative adversarial learning (Tu, 2007; Goodfellow et al., 2014; Radford et al., 2016; Arjovsky et al., 2017; Karras et al., 2019; Donahue et al., 2017), though many GAN models remain hard to train. VAE models (Kingma & Welling, 2014) are easier to train, but the resulting image quality is often blurry. Diffusion generative models have lately gained tremendous popularity with generated images of superb quality (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song & Ermon, 2020; Song et al., 2020; Croitoru et al., 2023; Ramesh et al., 2022). Despite the excellent modeling capability of generative diffusion models, the current models still face challenges in both training and synthesis.
+
+Due to direct optimization in the pixel space and multi-timestep training and inference, diffusion models are hard to scale up to high-resolution image generation. Therefore, current state-of-the-art models either use super-resolution methods to increase the generated images to higher resolutions (Ramesh et al., 2022; Sahara et al., 2022a), or optimize the latent space instead of the pixel space (Rombach et al., 2022). However, both types of approaches still consist of high-resolution image generators that consume a large memory with a big model size.
+
+To ameliorate the limitations in the current diffusion models, we propose a new method, PatchDM, to generate high-resolution images with a newly-introduced feature collage strategy. The basic operating point for Patch-DM is a patch-level model that is relatively compact compared to those modeling the entire image. Though it appears to have introduced compromises for a patch-based representation, Patch-DM can perform seamless full-size high-resolution image synthesis without artifacts of the boundary effects for pixels near the borders of the image patches. The effectiveness of Patch-DM in directly generating high-resolution images is enabled by a novel feature collage strategy. This strategy helps feature sharing by implementing a sliding-window based shifted image patch generation process, ensuring consistency across neighboring image patches; this is a key design in our proposed Patch-DM method to alleviate the boundary artifacts without requiring additional parameters. To summarize, the contributions of our work are listed as follows:
+
+- We develop a new denoising diffusion model based on patches, Patch-DM, to generate images of high-resolutions. Patch-DM can perform direct high-resolution image synthesis without introducing boundary artifacts.
+- We design a new feature collage strategy where each image patch to be synthesized obtains features partially from its shifted input patch. Through systematic window sliding, the entire image is being synthesized by forcing feature consistency across neighboring patches. This strategy, named feature collage, gives rise to a compact model of Patch-DM that is patch-based for high-resolution image generation.
+
+Patch-DM points to a promising direction for generative diffusion modeling at a flexible patch-based representation level, which allows high-resolution image synthesis with lightweight models.
+
+# 2 RELATED WORK
+
+Generative diffusion models. Generative diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song & Ermon, 2020) which learn to denoise noisy images into real images have gained much attention lately due to its training stability and high image quality. Lots of progress has been made in diffusion models such as faster sampling(Song et al., 2021), conditional generation(Nichol & Dhariwal, 2021; Dhariwal & Nichol, 2021) or high-resolution image synthesis(Rombach et al., 2022). The traits of diffusion models have been amplified particularly by the success of DALL-E 2 (Ramesh et al., 2022) and Imagen (Saharia et al., 2022a) which generate high quality images from the given texts.
+
+Patch-based image synthesis. The practice of employing image patches of relatively small sizes to generate images of larger sizes has been a longstanding technique in computer vision and graphics, particularly in the context of exemplar-based texture synthesis (Efros & Leung, 1999). While generative adversarial networks (GANs) have been utilized for expanding non-stationary textures(Zhou et al., 2018), image synthesis is still considered more challenging due to the complex structures present in images. To address this challenge, COCO-GAN(Lin et al., 2019) uses micro coordinates and latent vectors to synthesize large images by generating small patches first. InfinityGAN(Lin et al., 2022) further improves this by introducing Structure Synthesizer and Padding Free Generator to disentangle global structures and local textures and also generate consistent pixel values at the same spatial locations. ALIS(Skorokhodov et al., 2021) proposes an alignment mechanism on latent and image space to generate larger images. Anyres-GAN(Chai et al., 2022), on the other hand, adopts a two-stage training method by first learning the global information from low-resolution downsampled images and then learning the detailed information from small patches. There are also some works share similar directions on patch-based diffusion models. Luhman & Luhman (2022) does a reshaping operation on the input image which pushes the dimensions of the height and width to the channels. The model still takes the whole image as input just with the shape changed. Wang et al. (2023) does a patch operation during the training stage by concatenating another position embedding layer to the input while still requires full-resolution during the inference
+
+stage. There are also other works applying patch-based diffusion models to specific applications like image restoration under weather conditions(Ozdenizci & Legenstein, 2023) and anomaly detection in brain MRI(Behrendt et al., 2024). Both of them utilize a conditional diffusion mechanism by utilizing the weather-degraded images or images that miss some patches as conditions.
+
+Our work, Patch-DM consists of a new design, feature collage, in which partial features of neighboring patches are cropped and combined for predicting a shifted patch. We borrow the term "collage" from the picture collage task (Wang et al., 2006) for the ease of understanding of our method, though our feature collage strategy only has a loose conceptual connection to picture collage (Wang et al., 2006). Adopting positional embedding in Patch-DM also makes it easier to maintain spatial regularity. Although Patch-DM employs a shifted window strategy, its motivation and implementation are different from those of the widely-known Swin Transformers (Liu et al., 2021).
+
+# 3 BACKGROUND
+
+Denoising diffusion models generate real images from randomly sampled noise images by learning a denoising function (Ho et al., 2020). Instead of directly denoising the random noise image to a real image, denoising diffusion models learn to denoise the noise image through $T$ steps. The forward process adds noise to the image $x_0$ gradually while the learned denoising function $f_{\theta}$ tries to reverse this process from the $x_{T} \sim \mathcal{N}(0,\mathbf{I})$ . More formally, the forward process at time step $t(t = 1\dots T)$ can be defined as
+
+$$
+x _ {t} \sim \mathcal {N} \left(x _ {t - 1}; \sqrt {1 - \beta_ {t}} x _ {t - 1}, \beta_ {t} \mathbf {I}\right), \tag {1}
+$$
+
+where $\beta_{t}$ are hyperparameters that control the noise, making the noise level of $x_{t}$ gradually larger through the timesteps. Note that $x_{t}$ can be directly derived from the original image $x_0$ since Eq. 1 can be rewritten as
+
+$$
+x _ {t} \sim \mathcal {N} \left(x _ {0}; \sqrt {\alpha_ {t}} x _ {0}, (1 - \alpha_ {t}) \mathbf {I}\right), \tag {2}
+$$
+
+where $\alpha_{t} = \prod_{s=1}^{t}(1 - \beta_{s})$ . In order to generate the images from the noise input, the denoising model $f_{\theta}$ learns to reverse from $x_{t}$ to $x_{t-1}$ , which is defined as
+
+$$
+\hat {\epsilon} _ {t} = f _ {\theta} \left(x _ {t}, t\right), \tag {3}
+$$
+
+$$
+x _ {t - 1} \sim \mathcal {N} \left(x _ {t}; \frac {1}{\sqrt {1 - \beta_ {t}}} \left(x _ {t} - \frac {\beta_ {t}}{\sqrt {1 - \alpha_ {t}}} \hat {\epsilon} _ {t}\right), \sigma_ {t} \mathbf {I}\right), \tag {4}
+$$
+
+where $\sigma_{t}$ are hyperparameters that control the variance of the denoising process. The objective of the denoising model is $||\epsilon_t - \hat{\epsilon}_t||^2$ . $\epsilon_{t}$ is ground truth noise added on image.
+
+Therefore, after the denoising model is trained, the model can generate real images from random noise using Eq. 4. As can be seen, the whole generation process depends fully on the denoising process. Since the model denoises the image in the pixel space directly, the computation would be very expensive once the resolution gets higher.
+
+# 4 PACHED DENOISING DIFFUSION MODEL
+
+In this section, we describe our proposed Patched Denoising Diffusion Model (Patch-DM). Rather than using entire complete images for training, our model only takes patches for training and inference, and uses our proposed feature collage mechanism to systematically combine partial features of neighboring patches. Consequently, Patch-DM is capable of resolving the issue of high computational costs associated with generating high-resolution images, as it is resolution-agnostic.
+
+Before we dive into our model's training details, we first give an overview of the image generation process of our method. The training image from the dataset is $x_0 \in \mathbf{R}^{C \times H \times W}$ , we split $x_0$ into $x_0^{(i,j)}$ where $i,j$ is the row and column number of the patch, $x_0^{(i,j)} \in \mathbf{R}^{C \times h \times w}$ . Instead of directly generating $x_0$ like most of methods do, our model only generates $x_0^{(i,j)}$ and concatenate them together to form a complete image.
+
+A very basic way to do this is what we show in Figure 2(a) where the denoising model takes the noised image patch $x_{t}^{(i,j)}$ as input and output the corresponding noise $\hat{\epsilon}_{t}^{(i,j)}$ . However, since the patches do not interact with each other, there will be severe borderline artifacts.
+
+
+(a) No Collage on Patches
+
+
+(b) Patch Collage in Pixel Space
+
+
+(c) Patch Collage in Feature Space (Ours)
+Figure 2: Patch Generation For Image Synthesis. (a) shows a very basic method of patch-wise image synthesis by simply splitting the images and generating patches independently. This method brings severe border artifacts. (b) alleviates the border artifacts by using shifted windows while generating images and doing patch collage in pixel space. (c) is our proposed method which collages the patches in the feature space. The features for neighboring features will be split and collaged for a new patch synthesis. We will show this method is a key design for us to generate high-quality images without border artifacts.
+
+A further way to do this is to shift image patches during each time step depicted in Figure 2(b). At different time steps, the model will take either the original split patch $x_{t}^{(i,j)}$ or the shifted split patch $x_{t}^{\prime (i,j)}$ so that the border artifacts can be alleviated which we call "Patch Collage in Pixel Space". However, in Section 6 we show that the border artifacts still exist.
+
+To further improve this method, we propose a novel feature collage mechanism depicted in Figure 2(c). Instead of performing patch collage in the pixel space, we perform it in the feature space. The patch collage in the feature space is more in-depth and supports multi-level interaction. This allows the patches to be more cognizant of the adjacent features and prevent border artifacts from appearing while generating the complete images. More formally,
+
+$$
+\left[ z _ {1} ^ {(i, j)}, z _ {2} ^ {(i, j)}, \dots , z _ {n} ^ {(i, j)} \right] = f _ {\theta} ^ {E} \left(x _ {t} ^ {(i, j)}, t\right), \tag {5}
+$$
+
+where $f_{\theta}^{E}$ is the UNet encoder and $z_1^{(i,j)},z_2^{(i,j)},\dots,z_n^{(i,j)}$ are the internal feature maps. We then split the feature maps and collage the split feature maps to generate shift patches
+
+$$
+\hat {z} _ {k} ^ {\prime (i, j)} = \left[ P _ {1} \left(z _ {k} ^ {(i, j)}\right), P _ {2} \left(z _ {k} ^ {(i, j + 1)}\right), \right.
+$$
+
+$$
+P _ {3} \left(z _ {k} ^ {(i + 1, j)}\right), P _ {4} \left(z _ {k} ^ {(i + 1, j + 1)}\right) ], \tag {6}
+$$
+
+where $P1, P2, P3, P4$ are split functions as shown in Figure 2(c). Then we send these collaged shift features $\hat{z}_k^{\prime(i,j)}$ to the UNet decoder to get the predicted shift patch noise:
+
+$$
+\epsilon_ {t} ^ {\prime (i, j)} = f _ {\theta} ^ {D} \left(\left[ z _ {1} ^ {\prime (i, j)}, z _ {2} ^ {\prime (i, j)}, \dots , z _ {n} ^ {\prime (i, j)} \right], t\right). \tag {7}
+$$
+
+In order to make the model generate more semantically consistent images, we also add position embedding and semantic embedding to the model so that $f_{\theta}$ will take another two inputs which are $\mathcal{P}(i,j)$ and $\mathcal{E}(x_0)$ .
+
+During inference time, we take a $3 \times 3$ example as illustrated in Figure 3, in order to generate the border patches, we first pad the images so that the feature collage can be done for each patch without information loss. At each time step $t$ , image $x_{t}$ is decomposed into patches which are fed into the subsequent encoder. Before a feature map goes through the decoder, a split and collage operation is applied to it. Thus, the decoder outputs the predicted noise of the shifted patch. According to Eq.4, we are able to obtain $x_{t-1}$ and thus generate the final complete images.
+
+
+Figure 3: Detailed Inference process at each time step.
+
+Table 1: Quantitative comparison with previous patch-based image generation methods. All models are trained on the natural images dataset (1024×512), standard benchmarks LHQ(1024×1024) and FFHQ(1024×1024). We use FID to measure the overall quality of generated images and sFID for the quality of high-level structures.
+
+
Nature-21K(1024×512)
LHQ(1024×1024)
FFHQ(1024×1024)
Method
Patch Size
FID
sFID
FID
sFID
FID
sFID
COCO-GAN(Lin et al., 2019)
64×64
70.980
74.208
35.693
88.988
80.059
209.683
InfinityGAN(Lin et al., 2022)
101×101
46.550
70.041
50.646
92.577
174.789
270.699
Anyres-GAN(Chai et al., 2022)
64×64
44.173
34.430
130.591
100.041
67.076
170.911
Patch-DM (Ours)
64×64
20.369
34.405
23.777
37.217
19.696
36.512
+
+
+Figure 4: Generated $2048 \times 1024$ image. We double the number of patches so that the model can generate images with $2\mathrm{x}$ resolution from $1024 \times 512$ . The left image is a $2048 \times 1024$ image, and the right image is a zoom-in of the red bounding box, with a resolution of $256 \times 256$ .
+
+
+
+# 5 EXPERIMENTS
+
+# 5.1 IMPLEMENTATION DETAILS
+
+Architecture. For the model architecture, we base our denoising U-Net model from (Dhariwal & Nichol, 2021) with changes of taking global conditions and positional embeddings. We use two methods to obtain the global conditions. The first is to use a pretrained model to obtain the image features and use the image features as the global conditions, while optimizing the features directly during training. In this case, we do not have to increase the model parameters and can scale to high-resolution images. However, when the number of images in the training dataset is too large, optimizing the pre-obtained image features requires more effort. We use this approach for global conditioning when training on datasets of $1024 \times 512$ images. The pretrained model we use for obtaining the image embeddings is CLIP(Radford et al., 2021). We resize the images to $224 \times 224$ and send them to ViT-B/16 to obtain the features as global conditions; we then optimize these global conditions directly.
+
+The second is jointly training an image encoder and using its output as the global conditions. Here, the jointly training image encoder may borrow the same architecture as in the denoising U-Net's encoder. It works particularly well when the training dataset is large. However, it requires another model, which would be a bottleneck in training on high-resolution datasets, since the computation would increase significantly as the resolution increases. We use this approach when training on large datasets of $256 \times 256$ images. We utilize global conditions with a dimension of 512 in both methods.
+
+Classifier-free guidance. We also use the classifier-free guidance (Ho & Salimans, 2022) to improve the training speed and quality. We use classifier-free guidance on both the global conditions and position embeddings. The dropout rate is 0.1 for the global conditions and 0.5 for position embeddings.
+
+Patch size. We use a patch size of $64 \times 64$ in all our experiments. The denoising U-Net model's architecture is the same across all the datasets, as it is only related to the patch size regardless of the training images' resolution.
+
+Inference. Once the denoising U-Net model has been trained, we train another latent diffusion model for unconditional image synthesis. The latent diffusion model's architecture is based on the
+
+
+Figure 5: Generated images on FFHQ, LSUN-Bedroom, and LSUN-Church datasets using our proposed method. All the resolutions are $256 \times 256$ .
+
+one described in (Preechakul et al., 2022). The data we use for training the latent diffusion model is either from the output of the trained image encoder or the directly optimized image embeddings. To synthesize an image, we will first sample a latent code from the latent diffusion model and then use this latent code to serve as the global conditions for sampling an image. During the sampling stage, we use the inference process proposed by DDIM (Song et al., 2021) and set the sampling step to 50.
+
+Evaluation. We conduct both qualitative and quantitative evaluations on four datasets. For quantitative evaluation, we use FID, a popular metric in generative modeling(Heusel et al., 2017) and sFID(Nash et al., 2021) for the quality of high-level structures. To compute FID, we follow the setting of (Heusel et al., 2017) and generate 50K images to compute the metrics over the full dataset. We apply the same setting for sFID.
+
+# 5.2 RESULTS ON 1K-RESOLUTION IMAGES
+
+Setup. To show our model's capability on direct high-resolution image synthesis, we show our model's performance on three datasets: LHQ(1024 × 1024), FFHQ(1024 × 1024) and a self-collected 21443 natural images from Wallpaperscraft (2013-2023)(1024 × 512). We use a patch size of 64 × 64 across all datasets. Therefore, each image is split into 16 × 16 for 1024 × 1024-resolution and 16 × 8 for 1024 × 512-resolution.
+
+We use the CLIP ViT-B/16 pretrained image visual encoder to obtain the image embeddings first. While downsampling to fit the CLIP model may result in the loss of some detailed image information in the embeddings, these details can still be "recovered" during the embedding optimization in the training process, aided by the supervision of the original high-resolution image. Each image patch can be trained and sampled independently with feature collage assisting to be aware of the surrounding information. Since every image is segmented into smaller patches, the total number of model parameters is much smaller than other large diffusion models.
+
+As most existing diffusion models merely can directly generate images of 1k resolution, and the general strategy for high-resolution synthesis is to sample hierarchically (generate relatively low-resolution images first and then perform super-resolution), our Patch-DM simplifies sample procedure using much more lightweight models, which is one of the main advantages.
+
+Results. We compare our model with previous patch-based image generation methods in Table 1. From the table, we can see our method delivers the best overall quality of the generated images on both FID and sFID scores. Apart from the quantitative evaluation, we also present an image generated by our model in Figure 1. For more generated images, please refer to our supplementary material.
+
+# 5.3 RESULTS ON $256\times 256$ IMAGES
+
+Setup. To compare with other existing generative models, we also train our Patch-DM on three standard public datasets: FFHQ, LSUN-Bedroom, and LSUN-Church, and evaluate its sampling performance. All the resolution is $256 \times 256$ . Thus, the number of patches is $4 \times 4$ . Notice that the
+
+model architecture keeps the same; the only change here is the number of patches during training and inference. We use the same training setting across the three datasets.
+
+Results. We report the quantitative results in Table 2 and qualitative results in Figure 5, respectively. In Table 2, we can see our model achieves competitive results while still outperforms previous patch-based methods. Figure 5 illustrates that despite producing small image patches, our denoising model exhibits minimal boundary artifacts and offers good visual quality. This demonstrates the effectiveness of our feature collage mechanism.
+
+Table 2: Evaluation Metrics of unconditional image synthesis on three $256 \times 256$ datasets: FFHQ, LSUN-Bedroom, and LSUN-Church. For a fair comparison, results are reproduced in the same sampling steps as ours i.e. 50, using provided pretrained checkpoints of other diffusion models. We adopt a patch size of $64 \times 64$ for Patch-DM, Anyres-GAN, COCO-GAN and $101 \times 101$ for InfinityGAN. We bold the numbers to denote the best numbers in the same category (top: non-patch-based methods, bottom:patch-based methods).
+
+
Method
FFHQ
LSUN-Bedroom
LSUN-Church
FID
sFID
FID
sFID
FID
sFID
LDM Rombach et al. (2022)
8.76
7.09
3.40
7.53
4.23
11.44
UDM Kim et al. (2022)
5.54
-
4.57
-
-
-
DiffAE Preechakul et al. (2022)
9.71
10.24
-
-
-
-
PGGAN Karras et al. (2018)
-
-
8.34
9.21
6.42
10.48
StyleGAN Karras et al. (2018)
-
-
2.35
6.62
4.21
-
COCO-GANLin et al. (2019)
34.02
37.44
41.84
62.69
17.91
73.94
InfinityGAN Lin et al. (2022)
28.87
127.92
10.71
19.28
7.08
33.58
Anyres-GAN Chai et al. (2022)
24.48
55.77
15.65
56.24
17.09
80.66
Patch-DM (Ours)
10.02
10.58
6.04
9.93
5.49
14.80
+
+Model size comparison. Compared with other widely used diffusion models, our proposed method could achieve competitive performance using a smaller model with above mentioned indispensable components. Patch-DM is fully built upon the network on $64 \times 64$ patches regardless of the target image resolution and uses optimized global conditions to avoid the increase of model parameter amounts brought by higher input resolution. Comparison of model parameters with other classic diffusion models on $256 \times 256$ resolution is shown in Table 3. Notice that we use the same diffusion model architecture for the $1024 \times 1024$ and the $1024 \times 512$ resolutions.
+
+Table 3: Number of parameters comparison between different diffusion models on $256\times 256$ resolution. SE means semantic encoder to extract global information. The size of our previously trained $1024\times 1024$ and $1024\times 512$ models is $70\mathrm{M} + [$ size of optimized semantic embeddings] during training and [63M latent DPM] in inference.
+
+
Method
Model Size ↓
Base model + Super-resolution
SR3 Sahara et al. (2022b)
B[64]+625M
Direct generation
ADM Dhariwal & Nichol (2021)
552M
DiffAE Preechakul et al. (2022)
232M
LDM Rombach et al. (2022)
274M
Patch-DM (Ours, full model)
154M
Patch-DM (Ours, w/ SE, w/o latent DPM)
91M
Patch-DM (Ours, w/o SE, w/o latent DPM)
70M
+
+# 5.4 APPLICATIONS
+
+We now demonstrate several applications of our Patch-DM. All of them are conducted without posttraining.
+
+Beyond patch generation. Since our method samples images using patches, we have the option to incorporate more patches during testing. This enables the model to produce images with higher resolutions compared to the ones in the training set without requiring further training. We adopt two ways to achieve this.
+
+The first one is to add more patches internally. We test this on our Nature-21K dataset. To generate $512 \times 1024$ images which has the same resolution as the training dataset, we need $8 \times 16$ patches (random gaussian noise maps) to start with. To generate a $2 \times$ resolution images, we can add another $8 \times 16$ patches internally so that the total patch number will become $16 \times 32$ that can generate images
+
+
+COCO-GAN
+
+
+InfinityGAN
+
+
+Patch-DM(Ours)
+
+
+
+
+Figure 6: Synthesized $384 \times 384$ images on LSUN-Bedroom $(256 \times 256)$ and LSUN-Church $(256 \times 256)$ . The left half of each group is LSUN-Bedroom and the right half of each group is LSUN-Church. Despite only being trained on $256 \times 256$ images, our model can generate $384 \times 384$ images by adding more patches (outside the red bounding box). Extended images generated by our models are compared with COCOGAN and InfinityGAN, which also have the ability to extend fields without further training.
+Figure 7: Image outpainting on LSUN-Church and LSUN-Bedroom. The image inside the red bounding box is the input image from the validation dataset. We pad the image patches from $4 \times 4$ to $6 \times 6$ to enable the image outpainting. The image parts outside the red bounding box are the outpainting results.
+
+with a resolution of $1024 \times 2048$ . The global conditions we use for these patches is the same as the original, while we interpolate the position embeddings in this setting. We provide a generated $2048 \times 1024$ image in Figure 4. As can be seen, our model can still generate consistent patches even though the newly added patches have never been used in the training process.
+
+The second one is to add patches outside the original image. This way is similar to beyond-boundary generation in COCO-GAN(Lin et al., 2019) with a key difference that it needs a post-training process to improve the continuity among patches. We conduct an experiment on LSUN-Bedroom and LSUN-Church by adding more patches. The original resolution in the training data we use is $256 \times 256$ , which is divided by $4 \times 4$ patches. We add more patches to the existing $4 \times 4$ patches so that the number grows to $6 \times 6$ . Therefore, the model can generate an image with a resolution of $384 \times 384$ . For the original $4 \times 4$ patches, we use the condition generated from the latent diffusion model and the position embeddings as pre-defined. For the additional patches, we use the same semantic condition, while we don't use position embeddings for these added ones as in this case we're adding patches outside which the position embeddings could not be interpolated. Thus the model needs to synthesize the additional patches only according to the global conditions and the neighboring context information. We present our results in Figure 6 and compare it with COCO-GAN(Lin et al., 2019) without post-training and InfinityGAN(Lin et al., 2022) under the same setting.
+
+Image outpainting. Another practical application would be image outpainting that only draws the outer part of the image while keeping the input image the same. To do this, we experiment using the model trained on LSUN-Church and LSUN-Bedroom. First, we send images from the LSUN-Church validation dataset and LSUN-Bedroom validation dataset to the image encoder to obtain the global conditions. Then, to keep the original image the same, we replace the inner predicted noised image patches with the ground truth noised images patches (adding corresponding noise to the input images) during each timestep while sampling. We present our results in Figure 7. It can be seen from the results that our model can "imagine" the surrounding areas reasonably and generate rather consistent outer parts of the image without obvious border effects.
+
+Image inpainting. In this task, we infill the corrupted images with random masks, which requires the restored results to be consistent in context. We experiment on the LSUN-Church validation set using already trained models without further tailored training. The original images are masked by different numbers of blocks ranging from 1 to 6, and the sampling process is only conditioned on local position embeddings w/o global conditions. The results are presented in Figure 8. From the figure, we can see that our model can infill the blocks consistently using surrounding patches, demonstrating that feature collage facilitates the model with the capability to be aware of adjacent information, enabling it to be naturally applied to inpainting tasks.
+
+# 6 ABLATION STUDY
+
+Three indispensable components: semantic code, position embeddings and shift window strategy on feature levels, considerably eliminate border artifacts and improve our model performance. Here,
+
+
+Figure 8: Image Inpainting on LSUN-Church. Six pairs of images are presented here. For each pair, the left side is the masked image; the right one is the inpainted result by our model without further training on this task. The number of masked patches increasing from left to right.
+
+we conduct ablation study to investigate the effects of these modules. We provide both qualitative results and quantitative results in Figure 9 and Table 4 respectively.
+
+Global conditions. We study the problem without global conditions; thus, the generation process will fully rely on the positional embedding and neighboring context information. We present our images in Figure 9 (a). It's interesting to see how the model generates when no global conditions are given, which is a strong constraint for the model to generate semantic-related patches. From the given image, we can see that the model can still generate locally-consistent images; the image quality is however relatively low.
+
+Position embeddings. The last section shows that global conditions are necessary for our model to generate high-quality images. We then condition the model only on those to investigate the role of positional embeddings. The results are shown in Figure 9 (b). Without the position information, the model would generate distorted images with patchTheelonging to where they should be, although the whole image may follow a certain style. Hence, the positional embeddings are vital to our model.
+
+Collage in the pixel space. A straightforward idea is to perform collage in the pixel space as present in Figure 2(b); the images are decomposed by window-shifted patches from their original positions. To maintain patch size consistency, we add zero padding around the image. For the sampling procedure: In an odd-number step, original patches are generated independently, while in an even-number step, patches with shifted positions are sampled.
+
+Under this scheme, we experiment in two different settings. The first is to take a fixed shift step (half patch size) along the height and width direction. The sample result is shown in Figure 9(c). There are still apparent artifacts along the border. This proves that even though the shift window on the image level could enable patches to be aware of surroundings during sampling, the awareness level is quite limited, and the final generation is similar to breaking the image into smaller patches.
+
+The second setting is to shift the patch position with a randomly sampled step ranging from zero to patch size. The inference result is shown in Figure 9(d). The sample quality is much improved compared to the previous situation. However, the result is still not as photo-realistic as Patch-DM. The reason is that although the random shift enables finer surrounding awareness, it lacks in-depth feature interaction as our model does. Therefore, the feature-level window shift and collage can significantly eliminate border artifacts and improve final inference quality.
+
+Table 4: FID evaluation on 1,000 images of different ablation settings to investigate the importance of semantic condition, position embedding, and feature-level window shift.
+
+
Method
FID (1k) ↓
No global semantic condition
79.33
No position embedding
48.82
Pixel space fixed shift
49.80
Pixel space random shift
52.11
Patch-DM (Ours)
37.99
+
+
+(a) No global conditions (b) No position embeddings (c) Pixel space fixed shift (d) Pixel space random shift
+Figure 9: Ablation study on global conditions (a), position embeddings (b), and feature level shift (c, d).
+
+
+
+
+
+
+
+
+
+# 7 CONCLUSION
+
+We have presented a new algorithm, Patch-DM, a patch-based denoising diffusion model for generating high-resolution images. We introduce a feature collage strategy to combat the boundary effect for patch-based image synthesis. Patch-DM achieves a significant reduction in model size and training complexity compared to the standard diffusion models trained on the original size images. Competitive quantitative and qualitative results are obtained for Patch-DM when trained on several image datasets.
+
+# ACKNOWLEDGMENTS
+
+This work is supported by NSF Award IIS-2127544 and IIS-2211258.
+
+# REFERENCES
+
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In ICML, 2017.
+Finn Behrendt, Debayan Bhattacharya, Julia Krüger, Roland Opfer, and Alexander Schlaefer. Patched diffusion models for unsupervised anomaly detection in brain mri. In Medical Imaging with Deep Learning, pp. 1019-1032. PMLR, 2024.
+Lucy Chai, Michael Gharbi, Eli Shechtman, Phillip Isola, and Richard Zhang. Any-resolution training for high-resolution image synthesis. In Computer Vision-ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part XVI, pp. 170-188. Springer, 2022.
+Florinel-Alin Croitoru, Vlad Hondru, Radu Tudor Ionescu, and Mubarak Shah. Diffusion models in vision: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023.
+Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780-8794, 2021.
+Jeff Donahue, Philipp Krahenbuhl, and Trevor Darrell. Adversarial feature learning. In ICLR, 2017.
+Alexei A Efros and Thomas K Leung. Texture synthesis by non-parametric sampling. In Proceedings of the seventh IEEE international conference on computer vision, pp. 1033-1038, 1999.
+Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, 2014.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
+Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022.
+Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840-6851, 2020.
+Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In International Conference on Learning Representations, 2018.
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4401-4410, 2019.
+Tero Karras, Miika Aittala, Samuli Laine, Erik Härkönen, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Alias-free generative adversarial networks. In Proc. NeurIPS, 2021.
+Dongjun Kim, Seungjae Shin, Kyungwoo Song, Wanmo Kang, and Il-Chul Moon. Soft truncation: A universal training technique of score-based diffusion model for high precision score estimation. In International Conference on Machine Learning, pp. 11201-11228. PMLR, 2022.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
+Chieh Hubert Lin, Chia-Che Chang, Yu-Sheng Chen, Da-Cheng Juan, Wei Wei, and Hwann-Tzong Chen. Coco-gan: generation by parts via conditional coordinating. In ICCV, pp. 4512-4521, 2019.
+
+Chieh Hubert Lin, Yen-Chi Cheng, Hsin-Ying Lee, Sergey Tulyakov, and Ming-Hsuan Yang. InfinityGAN: Towards infinite-pixel image synthesis. In ICLR, 2022.
+Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021.
+Troy Luhman and Eric Luhman. Improving diffusion model efficiency through patching. arXiv preprint arXiv:2207.04316, 2022.
+Charlie Nash, Jacob Menick, Sander Dieleman, and Peter W Battaglia. Generating images with sparse representations. arXiv preprint arXiv:2103.03841, 2021.
+Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pp. 8162-8171. PMLR, 2021.
+Ozan Özdenizci and Robert Legenstein. Restoring vision in adverse weather conditions with patch-based denoising diffusion models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023.
+Konpat Preechakul, Nattanat Chathee, Suttisak Wizadwongsa, and Supasorn Suwajanakorn. Diffusion autoencoders: Toward a meaningful and decodable representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10619-10629, 2022.
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748-8763. PMLR, 2021.
+Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
+Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684-10695, 2022.
+Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022a.
+Chitwan Sahara, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. In ICLR Workshop Track, 2022b.
+Axel Sauer, Katja Schwarz, and Andreas Geiger. Stylegan-xl: Scaling stylegan to large diverse datasets. In ACM SIGGRAPH 2022 conference proceedings, pp. 1-10, 2022.
+Ivan Skorokhodov, Grigorii Sotnikov, and Mohamed Elhoseiny. Aligning latent and image spaces to connect the unconnectable. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 14144-14153, 2021.
+Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256-2265, 2015.
+Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021.
+Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. Advances in neural information processing systems, 33:12438-12448, 2020.
+
+Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2020.
+Zhuowen Tu. Learning generative models via discriminative approaches. In CVPR, 2007.
+Wallpaperscraft. Wallpaperscraft. https://wallpaperscraft.com/, 2013-2023.
+Jingdong Wang, Long Quan, Jian Sun, Xiaou Tang, and Heung-Yeung Shum. Picture collage. In CVPR, pp. 347-354, 2006.
+Zhendong Wang, Yifan Jiang, Huangjie Zheng, Peihao Wang, Pengcheng He, Zhangyang Wang, Weizhu Chen, Mingyuan Zhou, et al. Patch diffusion: Faster and more data-efficient training of diffusion models. Advances in Neural Information Processing Systems, 36, 2023.
+Yang Zhou, Zhen Zhu, Xiang Bai, Dani Lischinski, Daniel Cohen-Or, and Hui Huang. Nonstationary texture synthesis by adversarial expansion. ACM Transactions on Graphics (TOG), 37(4):1-13, 2018.
+
+# A MODEL HYPERPARAMETERS
+
+For model architecture, we base our diffusion model from Dhariwal & Nichol (2021) with changes of taking global semantic condition and positional embedding. The hyperparameters for the main denoising U-Net model are specified in Table 5. Since the model is resolution agnostic, the main architectures for all datasets keep the same. We adopt two methods to obtain global semantic conditions: for relatively low-resolution images, an encoder is trained with architecture borrowed from the first half of the U-Net model, and the architecture details of the encoder are shown in Table 6. For high-resolution images such as $1024 \times 512$ , a pretrained image encoder is used to avoid scaling up the overall model size. We use ViT-B/16 in CLIP to obtain the image embeddings and optimize them during training. For position embeddings, we use sinusoidal positional embeddings. Time embedding and positional embedding are concatenated and modulated into ResBlocks together with the global code.
+
+For realizing unconditional image synthesis, a latent diffusion model is trained on semantic embeddings. The implementation is based on the one proposed in Preechakul et al. (2022) with MLP + skip connections architecture. The parameter details are specified in Table 7.
+
+# B MORE QUALITATIVE RESULTS
+
+We provide more unconditional sampling results with the models trained on our self-collected nature images $(1024\times 512)$ in Figure 10-12. We also provide results on LHQ $(1024\times 1024)$ and FFHQ $(1024\times 1024)$ in Figures 14 and 13 respectively as well as three other standard benchmarks with a resolution of $256\times 256$ : LSUN-Bedroom (Figure 15), LSUN-Church (Figure 16), and FFHQ (Figure 17).
+
+
Parameter
Patch-DM
Patch input size
3×64×64
Channel multiplier
[1, 2, 4, 8]
Net channel
64
ResBlock number
2
Attention resolution
16
Batch size
16
Diffusion steps
1000
Noise scheduler
Linear
Learning rate
0.0001
Optimizer
Adam
+
+Table 5: Model Architecture for diffusion model.
+
+
Parameter
Semantic Encoder
Input size
3×256×256
Channel multiplier
[1, 2, 4, 8, 8]
Net channel
64
ResBlock number
2
Attention resolution
16
Global condition dimension
512
Batch size
16
Learning rate
0.0001
Optimizer
Adam
+
+Table 6: Model Architecture for image semantic encoder.
+
+
Parameter
Latent Diffusion
Input size
512
MLP layers
10
MLP hidden size
2048
Noise scheduler
Constant 0.008
Batch size
256
Learning rate
0.0001
Optimizer
Adam (weight decay 0.01)
+
+Table 7: Model Architecture for latent diffusion model.
+
+
+
+
+Figure 10: Additional qualitative results on self-collected nature dataset $(1024\times 512)$
+
+
+
+
+Figure 11: Additional qualitative results on self-collected nature dataset $(1024\times 512)$
+
+
+
+
+Figure 12: Additional qualitative results on self-collected nature dataset $(1024\times 512)$
+
+
+Figure 13: Additional qualitative results on high resolution FFHQ dataset $(1024\times 1024)$
+
+
+Figure 14: Additional qualitative results on high resolution LHQ dataset $(1024\times 1024)$
+
+
+Figure 15: Additional qualitative results on LSUN-Bedroom $(256\times 256)$
+
+
+Figure 16: Additional qualitative results on LSUN-Church $(256\times 256)$
+
+
+Figure 17: Additional qualitative results on FFHQ $(256\times 256)$
+
+# C Failed CASES COMPARISON ON FFHQ1024
+
+To provide a more thorough understanding of the limitations of our proposed method, we compare our FFHQ1024 results with other non-patch-based methods. We use FFHQ1024 as it's a more structural dataset while other landscape datasets are not that structural, thus FFHQ1024 could better show how well the models learn the structural information. As there lacks results for FFHQ1024 using diffusion models, we compare our results with two state-of-the-art GAN-based methods on FFHQ1024: StyleGAN3(Karras et al., 2021) and StyleGAN-XL(Sauer et al., 2022) in Figure 18. It can be seen that non-patch GAN-based methods generally perform well on global consistency while ours may not perform well in such cases. For example, in the first row of our results, the wrinkles around the mouth are asymmetrical. And in the second row of our results, the eyes/eyeglasses are asymmetrical. As our method uses a patch size of $64 \times 64$ and there are a total of $16 \times 16 = 256$ patches, the global consistency sometimes may not perform well. We think one can further improve this by utilizing a larger patch size or introducing better global-consistency-enforcing mechanisms which we leave for future work.
+
+
+
+
+
+
+
+
+StyleGAN3-T
+
+
+StyleGAN-XL
+Figure 18: Comparison on FFHQ1024 with StyleGAN3-T, StyleGAN-XL and our failed cases. Ours might fail on global consistency such as the wrinkles around the mouth in the first row and the eyes/glasses in the second row.
+
+
+Our Failed Cases
\ No newline at end of file
diff --git a/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/images.zip b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..bc8944257bbd1ca9b673ae6223ba55c2d3b3ad3c
--- /dev/null
+++ b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98ede7fb473fc3ee18765ecaa627f1f88eaa21d9de2753d90d195776db4e0331
+size 2303946
diff --git a/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/layout.json b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..16647ea602ade59dc37dcf020007a76916ef7613
--- /dev/null
+++ b/patcheddenoisingdiffusionmodelsforhighresolutionimagesynthesis/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb960280f0d39da7dac384b23969c8d7ea079188574973486650db2f6e53114a
+size 492394
diff --git a/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_content_list.json b/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..11bb166196fa39f280149077e1b1544c4532a099
--- /dev/null
+++ b/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c160dda8d0542476b7f51a609337d560a73d9446f3cb6650072d41a6a2246719
+size 141149
diff --git a/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_model.json b/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..532a60ca82787d147cf205157aff5456e8040290
--- /dev/null
+++ b/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44881cf156cb34bbb73f47ed942a8752dc84ece9c3ee648ce19c2d6e91a75449
+size 164462
diff --git a/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_origin.pdf b/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4415ae02c985c85435d4a0b7cd9b750977c0eabd
--- /dev/null
+++ b/pathchoicemattersforclearattributionsinpathmethods/bb1e5fb4-cafa-46c0-a760-9967b7c0e64b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:80131ac11fce9f0e8b856db4aa39080b5a1bf4b72fae6c4a225416b2c14415a5
+size 36146875
diff --git a/pathchoicemattersforclearattributionsinpathmethods/full.md b/pathchoicemattersforclearattributionsinpathmethods/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..fb1f9431729b6efae528a599814424430cc17fe9
--- /dev/null
+++ b/pathchoicemattersforclearattributionsinpathmethods/full.md
@@ -0,0 +1,662 @@
+# PATH CHOICE MATTERS FOR CLEAR Attribution IN PATH METHODS
+
+Borui Zhang, Wenzhao Zheng, Jie Zhou, Jiwen Lu*
+
+Department of Automation, Tsinghua University, China
+
+{zhang-br21, zhengwz18}@mails.tsinghua.edu.cn; {jzhou, lujiwen}@tsinghua.edu.cn
+
+# ABSTRACT
+
+Rigorousness and clarity are both essential for interpretations of DNNs to engender human trust. Path methods are commonly employed to generate rigorous attributions that satisfy three axioms. However, the meaning of attributions remains ambiguous due to distinct path choices. To address the ambiguity, we introduce Concentration Principle, which centrally allocates high attributions to indispensable features, thereby endowing aesthetic and sparsity. We then present SAMP, a model-agnostic interpreter, which efficiently searches the near-optimal path from a pre-defined set of manipulation paths. Moreover, we propose the infinitesimal constraint (IC) and momentum strategy (MS) to improve the rigorousness and optimality. Visualizations show that SAMP can precisely reveal DNNs by pinpointing salient image pixels. We also perform quantitative experiments and observe that our method significantly outperforms the counterparts.
+
+# 1 INTRODUCTION
+
+The lack of transparency in deep neural networks (DNNs) hinders our understanding of how these complex models make decisions (Bodria et al., 2021; Zhang & Zhu, 2018; Gilpin et al., 2018), which poses significant risks in safety-critical applications like autonomous driving and healthcare. Numerous interpretation methods (Zeiler & Fergus, 2014; Bach et al., 2015; Zhou et al., 2016; Selvaraju et al., 2017) have been proposed to shed light on the underlying behavior of DNNs. These methods attribute model outputs to specific input features to reveal the contributions. In this way, attribution methods serve as valuable debugging tools for identifying model or data mistakes. However, despite these efforts, users often lack confidence in attributions, which can be blamed on lack of rigorousness and clarity in current methods. Attributions are influenced by three types of artifacts (Sundararajan et al., 2017), namely data artifacts, model mistakes, and interpretation faults. To enhance user trust, it is crucial to sever the impact of the last factor.
+
+One way to enhance the reliability of interpretations is ensuring their theoretical rigourousness. Given a complex mapping function $f: \mathcal{X} \mapsto \mathbb{R}$ , we define the target point $\boldsymbol{x}^T \in \mathcal{X}$ and the baseline point $\boldsymbol{x}^0$ . Interpretations aim at explaining how the baseline output $y^0$ gradually becomes $y^T$ when baseline $\boldsymbol{x}^0$ changes to $\boldsymbol{x}^T$ . Early interpretation methods (Selvaraju et al., 2017; Montavon et al., 2018) employ Taylor expansion on the baseline as $y^T = y^0 + \nabla f(\boldsymbol{x}^0)^T (\boldsymbol{x}^T - \boldsymbol{x}^0) + R_1(\boldsymbol{x}^T)$ . However, the local linear approximation can hardly interpret nonlinear models due to non-negligible errors of the Lagrangian remainder $R_1(\boldsymbol{x}^T)$ , which makes attributions less convincing. An intuitive solution is to split the path from $\boldsymbol{x}^0$ to $\boldsymbol{x}^T$ into small segments, each of which tends to be infinitesimal. In this formulation, the variation $\Delta y$ can be formulated in integral form as $\Delta y = y^T - y^0 = \int_l \nabla f(x)^T \, \mathrm{d}\boldsymbol{x}$ . The attributions $a_i$ of each feature $x_i$ is gradually accumulated through the line integral, which is commonly referred to as path methods (Friedman, 2004; Sundararajan et al., 2017; Xu et al., 2020; Kapishnikov et al., 2021). Game theory research (Friedman, 2004) has proved that path methods are the only method satisfying three axioms, namely dummy, additivity, and efficiency.
+
+Ensuring rigorousness alone is insufficient for convincing interpretations. Distinct path choices in existing path methods highly impact attributions and lead to ambiguity in interpretations. Integrated Gradients (IG) (Sundararajan et al., 2017) adopts a simple straight line from $\pmb{x}^0$ to $\pmb{x}^T$ for symmetry. BlurIG (Xu et al., 2020) defines a path by progressively blurring the data $\pmb{x}^T$ adhering to additional
+
+scale-space axioms. GuidedIG (Kapishnikov et al., 2021) slightly modifies the straight line to bypass points with sharp gradients. However, the question of which path choice is better remains unanswered. The lack of research on the optimal path selection hampers the clarity of attributions.
+
+To the best of our knowledge, we are the first to consider the optimal path for clarity. To start with, we define the Concentration Principle. This principle guides the interpreter to identify the most essential features and allocate significant attributions to them, resulting in aesthetic and sparse interpretations. Subsequently, we propose SAMP (Salient Manipulation Path), which greedily searches the near-optimal path from a pre-defined set of manipulation paths. Moreover, we constrain the $l1$ -norm of each manipulation step below an upper bound to ensure the infinitesimal condition for the line integral and employ the momentum strategy to avoid converging to local solutions. Visualizations on MNIST (Deng, 2012), CIFAR-10 (Krizhevsky et al., 2009), and ImageNet (Deng et al., 2009) demonstrate the superiority of SAMP in discovering salient pixels. We also conduct quantitative experiments
+
+
+Figure 1: we propose SAMP to eliminate ambiguity of attributions by path methods, which can precisely pinpoint important pixels and produce clear saliency maps. Quantitative results show a consistent improvement in Deletion/Insertion metrics.
+
+
+
+and observe a clear improvement compared with other interpretation methods as shown in Figure 1. We highlight our contributions as follows:
+
+- Concentration Principle for Clear Attributions. We introduce Concentration Principle, which enhances the clarity of attributions by prioritizing sparse salient features.
+- A Model-agnostic Interpreter, SAMP. The proposed interpreter SAMP is able to efficiently discovers the near-optimal path from a pre-defined set of manipulation paths.
+- Two Play-and-plug Auxiliary Modules. We design infinitesimal constraint (IC) and the momentum strategy (MS) to ensure rigorousness and optimality.
+- Consistent Improvement in Explainability. Qualitative and quantitative experiments show SAMP pinpoints salient areas accurately and consistently outperforms counterparts.
+
+# 2 RELATED WORK
+
+Considerable attempts expect to reveal the mysterious veil of DNNs by different techniques. Ad-hoc methods (Zhang et al., 2018b; Liang et al., 2020; Agarwal et al., 2021; Wan et al., 2020; Wang & Wang, 2021; Shen et al., 2021; Barbiero et al., 2022) try to observe or intervene in latent variables of DNNs, which rely on specific model types. On the contrary, post-hoc methods (Simonyan et al., 2014; Bach et al., 2015; Zhou et al., 2016; Selvaraju et al., 2017; Lundberg & Lee, 2017) ignore concrete implementations and focus on imitating the outside behavior. According to how attributions are generated, we mainly divide post-hoc methods into two categories: perturbation methods (Ribeiro et al., 2016; Fong & Vedaldi, 2017; Petsiuk et al., 2018) and back-propagation methods (Zeiler & Fergus, 2014; Bach et al., 2015; Selvaraju et al., 2017).
+
+Perturbation Methods. An intuitive idea for attributions is to perturb the inputs and observe the output variations. Occlusion method (Zeiler & Fergus, 2014) simply covers up partial areas of input and examines the score change. LIME (Ribeiro et al., 2016) interprets the local space around the prediction by linear regression. Prediction difference analysis (Zintgraf et al., 2017) describes the output variation from a probabilistic perspective. Meaningful perturbation (Fong & Vedaldi, 2017) aims at discovering the deletion regions with compact information, which is further extended by RISE (Petsiuk et al., 2018) by the weighted average of multiple random masks. DANCE (Lu et al., 2021) introduces a subtle perturbation to input without influence on internal variables. Most perturbation methods require multiple iterations, which leads to a heavy computation burden. Moreover, most of these methods lack rigorous axiomatic guarantees.
+
+Back-propagation Methods. Another kind of interpretations recovers signals or generates attributions by back-propagating information layer by layer. Early research (e.g., Deconvolution (Zeiler & Fergus, 2014) and Guided-BP (Springenberg et al., 2015)) reverses the forward procedure and
+
+recover active signals in input space. Recent attempts generate attributions by propagating gradients (Shrikumar et al., 2016), relevance (Bach et al., 2015), and difference-from-reference (Shrikumar et al., 2017). Most methods choose gradients as the propagation intermediary for ease. GradCAM (Selvaraju et al., 2017) and its variants (Chattopadhyay et al., 2018) directly interpolate gradients from the top layer to input size as the saliency map. SmoothGrad (Smilkov et al., 2017) aims at removing noise by averaging multiple gradients at neighbor points. The first-order Taylor decomposition (Montavon et al., 2018) assigns attributions by linearization with the gradient around the given root point. Since the difference between the data and the root is often not infinitesimal, expansion based on a single-point gradient results in a large error (Lagrangian remainder), which damages the rigorousness of interpretations. Path methods (Sundararajan et al., 2017; Xu et al., 2020; Kapishnikov et al., 2021) fix this issue by dividing the integral path into small segments. Game theory guarantees that path methods are the only method satisfying three fundamental axioms (see Proposition 1 in Friedman et al. (Friedman, 2004)). However, different path choices (e.g., straight line in space (Sundararajan et al., 2017) or frequency (Xu et al., 2020) and guided path along flat landscape (Kapishnikov et al., 2021)) indicate distinct attribution allocations, which makes the meaning of attribution ambiguous. Therefore, we introduce the Concentration Principle and discuss how to obtain a near-optimal path through the proposed SAMP method.
+
+# 3 METHOD
+
+In this section, we first summarize the canonical path methods (Friedman, 2004). Then we define Concentration Principle in Section 3.2. Subsequently, we propose the Salient Manipulation Path and derive an efficient algorithm under Brownian motion assumption in Section 3.3. Finally, we introduce infinitesimal constraint (IC) for rigorous line integrals and momentum strategy (MS) to escape from local sub-optimal solutions in Section 3.4.
+
+
+(a)
+
+
+(b)
+Figure 2: (a) Concentration Principle prioritizes attributions (green point $A$ ) with large distance from mean point $P$ . (b) SAMP chooses the directions with max gradient projection (colored in red), and attributions allocated along this path mainly concentrate on salient pixels.
+
+# 3.1 PRELIMINARY: PATH METHOD
+
+Path methods (Friedman, 2004) for additive cost-sharing methods are derived from Aumann-Shapley (Aumann & Shapley, 1974), which is first introduced to machine learning by IG (Sundararajan et al., 2017). We define the many-to-one mapping as $f: \mathcal{X} \to \mathbb{R}$ , where input $\boldsymbol{x}^T \in \mathcal{X}$ has $d$ features and $y^T$ denotes its output. An intuitive idea of interpreting models is to analyze how the output $y^0$ turns to $y^T$ when gradually changing baseline $\boldsymbol{x}^0$ to $\boldsymbol{x}^T$ . Considering the difference between $\boldsymbol{x}^0$ and $\boldsymbol{x}^T$ is not infinitesimal, the naive Taylor decomposition $y^T = y^0 + \nabla f(\boldsymbol{x}^0)^T (\boldsymbol{x}^T - \boldsymbol{x}^0) + R_1(\boldsymbol{x}^T)$ suffers from large Lagrangian remainder $R_1(\boldsymbol{x}^T)$ . Therefore, it is a natural improvement to divide path from $\boldsymbol{x}^0$ to $\boldsymbol{x}^T$ into multiple segments, which should be small enough. Assuming the model $f$ is differentiable, the output variation $\Delta y$ can be expanded as
+
+$$
+\Delta y = y ^ {T} - y ^ {0} = \int_ {\rho = 0} ^ {1} \frac {\partial f (\boldsymbol {\gamma} (\rho))}{\partial \boldsymbol {\gamma} (\rho)} \frac {\partial \boldsymbol {\gamma} (\rho)}{\partial \rho} d \rho , \tag {1}
+$$
+
+where $\gamma (\rho)$ is path function $\pmb {x} = \gamma (\rho)$ and $\gamma (0) = x^0,\gamma (1) = x^T$ . We define each feature's attribution as $a_{i}$ and $\Delta y$ equals sum of $a_{i}$ (namely completeness (Sundararajan et al., 2017)):
+
+$$
+a _ {i} \triangleq \int_ {\rho = 0} ^ {1} \frac {\partial f (\gamma (\rho))}{\partial \gamma_ {i} (\rho)} \frac {\partial \gamma_ {i} (\rho)}{\partial \rho} d \rho , \Delta y = \sum_ {i = 1} ^ {d} a _ {i}. \tag {2}
+$$
+
+Game theory research (Friedman, 2004) has proved that the path method is the only interpretation method satisfying three fundamental axioms (i.e., completeness, additivity, and dummy). However, choices of path function $\gamma (\rho)$ highly impact the attribution allocation, which hampers the clarity of the interpretations. In this paper, we explore an explicit selection criterion among candidate paths.
+
+# 3.2 CRITERION AND CANDIDATE SET
+
+Existing path methods lack clarity due to various path choices. In Eq. (2), the attribution $\mathbf{a}$ is a function of the selected path $\gamma$ as $\mathbf{a} = g(\gamma)$ given $\mathbf{x}^T, \mathbf{x}^0, f$ . However, conventional interpretations often scatter the attributions over all pixels (Kapishnikov et al., 2021; Smilkov et al., 2017) due to unpredictable distractors. To address this, we propose the Concentration Principle, which introduces a selection preference for the allocation of attributions. Instead of scattering attributions across all features, we aim to concentrate them centrally on the indispensable features.
+
+Definition 1 (Concentration Principle). A path function $\gamma^{*}$ is said to satisfy Concentration Principle if the attribution $\mathbf{a}$ achieves the max $Var(\mathbf{a}) = \frac{1}{d}\sum_{i=1}^{d}(a_i - \bar{a})^2$ .
+
+Remark. Considering $\sum_{i=1}^{d} a_i$ is a constant $C = \Delta y$ , the variance of $\mathbf{a}$ could depict the concentration degree. For a 3-feature case, this principle prefers $\mathbf{a} = (0.7, 0.2, 0.1)$ to $(0.4, 0.3, 0.3)$ . For image input in Figure 1, this principle achieves aesthetic and sparsity. Our method clearly pinpoints important pixels while IG (Sundararajan et al., 2017) spreads attributions over most pixels. We also conduct a counting model example in Appendix A.2 to illustrate the potential challenge.
+
+Under this principle, we explore to formulate a tractable optimization problem. To maintain consistency in our formulation, we introduce the start point $\boldsymbol{x}^S$ and the end point $\boldsymbol{x}^E$ . To approximate the line integral in Eq. (1), we use Riemann sum by dividing the path into $n$ segments as:
+
+$$
+\Delta y = \sum_ {k = 1} ^ {n} \nabla f \left(\boldsymbol {x} ^ {k}\right) ^ {T} \mathrm {d} \boldsymbol {x} ^ {k}, \tag {3}
+$$
+
+where $\mathrm{d}\pmb{x}^k$ is the $k^{th}$ segment along the path and $\pmb{x}^k = \pmb{x}^S +\sum_{l = 1}^k\mathrm{d}\pmb{x}^l$ . Analogous to Eq. (2), we calculate each attribution $a_i$ as $a_{i} = \sum_{k = 1}^{n}(\nabla f(\pmb{x}^{k}))_{i}(\mathrm{d}\pmb{x}^{k})_{i}$ . However, it is intractable to directly find the optimal path from the infinite set $\Gamma$ of all path functions. Thus we construct a finite Manipulation Path set $\Gamma_s\subseteq \Gamma$ , along which we manipulate images by inserting or deleting $s = d / n$ pixels per step. The formal definition is as follows:
+
+Definition 2 (Manipulation Path). The $k^{th}$ segment $\mathrm{d}\pmb{x}^k$ of a manipulation path $\gamma \in \Gamma_s$ satisfies
+
+$$
+\left(\mathrm {d} \boldsymbol {x} ^ {k}\right) _ {i} = \left\{ \begin{array}{l l} x _ {i} ^ {E} - x _ {i} ^ {k}, & i \in \Omega_ {k} \\ 0, & \text {O t h e r w i s e} \end{array} , \right. \tag {4}
+$$
+
+where $|\Omega_k| = s$ and all $\Omega_k$ consist of a non-overlapping partition of all pixel indices which satisfy that $\forall k \neq l$ , $\Omega_k \cap \Omega_l = \emptyset$ and $\bigcup_{k=1}^n \Omega_k = \{1, \dots, d\}$ .
+
+Remark. $\Gamma_s$ is a finite set and $|\Gamma_s|$ equals to $d! / (s!)^n$ .
+
+Following Definitions 1 and 2, we formulate the optimal path selection problem as follows:
+
+$$
+\boldsymbol {\gamma} ^ {*} = \underset {\boldsymbol {\gamma} \in \Gamma_ {s}} {\arg \max } V a r (\boldsymbol {a}) = \frac {1}{d} \sum_ {i = 1} ^ {d} \left(a _ {i} - \frac {C}{d}\right) ^ {2}. \tag {5}
+$$
+
+Solving Equation 5 directly is computationally challenging. To overcome this, we propose SAMP algorithm, which leverages Brownian motion assumption to efficiently search for the optimal path.
+
+# 3.3 SALIENT MANIPULATION PATH
+
+The intuition of Eq. (5) is to enlarge the distance $D_{ap}$ between $\mathbf{a}$ (limited in the hyperplane $\sum_{i=1}^{d} a_i = C$ ) and the center point $(C / d, \dots, C / d)$ in Figure 2a. We need to introduce prior knowledge to accelerate the search process. Without loss of generality, we set $s = 1$ for ease of derivation. Since the attributions are assigned sequentially, we regard the allocation process as a stochastic process2. We define the partial sum $u_k$ as $\sum_{i=1}^{k} a_i$ and make the following assumption:
+
+Assumption 1 (Allocation as Brownian motion). We assume the additive process $\{u_t, t \geq 0\}$ as the Brownian motion and $u_t \sim \mathcal{N}(0, \sigma t)$ if without any constraint condition.
+
+We now explain the rationality of the assumption. In the model-agnostic case, we consider the input space to be isotropic. If without any constraint condition, we assume $\mathbb{E}(a_i) = \mathbb{E}(\mathrm{d}y^i) = 0$ with randomly sampled step $\mathrm{d}\pmb{x}^i$ and $a_{i},a_{j}$ for any $i\neq j$ are independent. It is important to note that we do NOT directly assume the $a_{i},a_{j}$ as conditional independent given the condition $\sum_{i = 1}^{d}a_{i} = C$ . Then we assume that every $a_{i}$ complies with a Gaussian distribution (i.e., $a_{i}\sim \mathcal{N}(0,\sigma)$ ). If we subdivide time infinitely, the additive process $\{u_t,t\geq 0\}$ tends to a Brownian motion.
+
+Proposition 1. By Brownian motion assumption, the conditional joint distribution $P(\tilde{\mathbf{a}} | C) = P(a_{1}, \dots, a_{d-1} | u_{d} = C)$ is a multivariate Gaussian distribution as:
+
+$$
+P (\tilde {\boldsymbol {a}} | C) = \frac {1}{(2 \pi) ^ {\frac {d - 1}{2}} \sqrt {| \boldsymbol {\Sigma} |}} \exp \left\{- \frac {1}{2} \left\| \tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1} \right\| _ {\boldsymbol {\Sigma} ^ {- 1}} ^ {2} \right\}, \tag {6}
+$$
+
+where $\Sigma = \sigma (I - \frac{J}{d})\in \mathbb{R}^{(d - 1)\times (d - 1)}$ and $J$ is all-one matrix.
+
+Remark. See proof in Appendix A.1. Eq. (6) reveals that the conditional distribution is centered at point $\mathcal{P}$ in Figure 2a. For any $i \neq j$ , $\mathrm{Cov}(a_i, a_j | u_d = C) = -\sigma / d$ indicates that allocating more to $a_i$ results in less to $a_j$ . Moreover, $\mathbb{E}(u_k | u_d = C) = kC / d$ reveals that a randomly selected path tends to produce a linear variation in output. Surprisingly, we observe the curve shapes of IG (Sundararajan et al., 2017), XRAI (Kapishnikov et al., 2019), and Grad-CAM (Selvaraju et al., 2017) in Figure 1 are nearly straight lines, which is consistent with theoretical analysis.
+
+As the dimension of images is always high, we investigate the asymptotic property of $P(\tilde{a} | C)$ as:
+
+Proposition 2. Since $\lim_{d\to \infty}\Sigma = \sigma I$ conditional covariance $Cov(a_i,a_j|u_d = C)$ is nearly zero with high dimension $d$ . Thus we can approximate Eq. (6) as:
+
+$$
+\hat {P} (\tilde {\boldsymbol {a}} | C) = \frac {\exp \left(- \frac {D _ {a p} ^ {2}}{2 \sigma}\right)}{\left(2 \pi\right) ^ {\frac {d - 1}{2}} \sqrt {| \boldsymbol {\Sigma} |}} \tag {7}
+$$
+
+Remark. $\hat{P} (\tilde{\pmb{a}} |C) = P(\tilde{\pmb{a}} |C)e^{a_d^2 /(2\sigma)}$ As the last attribution $a_{d}$ tends to 0 if $d$ is high enough, the approximation error of $\hat{P} (\tilde{\pmb{a}} |C)$ is tolerable.
+
+Since image dimension is always high, we regard any two attributions $a_{i}, a_{j}$ as nearly independent by Proposition 2. Therefore, we can maximize each attribution separately with negligible error while reducing the computational complexity from facto
+
+rial $\mathcal{O}(d!)$ to linear $\mathcal{O}(d)$ . Specifically, we choose $s$ pixels with the largest projection of gradient $\nabla f(\pmb{x}^k)$ onto $\mathrm{d}\pmb{x}^k$ . We name this greedy selection strategy as Salient Manipulation Path (SAMP) and take insertion direction as an example to formulate SAMP as:
+
+$$
+\left(\mathrm {d} \boldsymbol {x} ^ {k}\right) _ {i} = \left\{ \begin{array}{l l} x _ {i} ^ {E} - x _ {i} ^ {k}, & i \in \mathbb {M} _ {k} \\ 0, & \text {O t h e r w i s e} \end{array} , \right. \tag {8}
+$$
+
+where $\mathbb{M}_k = \{i\mid i\in top_s\{\alpha_j\}\}$ ( $top_{s}(\cdot)$ means the largest $s$ elements) and $\alpha_{j} = (\nabla f(\pmb{x}^{k}))_{j}(x_{j}^{E} - x_{j}^{k})$ if $x_{j}^{E}\neq x_{j}^{k}$ and $-\infty$ otherwise. It is obvious that the path defined above belongs to $\Gamma_s$ .
+
+# 3.4 TOWARDS RIGOROUSNESS AND OPTIMALITY
+
+Two potential issues still remain in our proposed SAMP interpreter. First, if the step size $|\mathrm{d}\pmb{x}^k|$ is too large, the infinitesimal condition may be violated, thereby breaking the completeness axiom in
+
+# Algorithm 1: The SAMP++ algorithm.
+
+Input: Start point $\pmb{x}^S$ ; End point $\pmb{x}^E$ ; Upper bound $\eta$ ; Momentum coefficient $\lambda$ .
+
+Output: Attribution $a$ ; Path segments $\mathbb{D}$ .
+
+1 Reset $k = 0$ and set of path segments $\mathbb{D} = \emptyset$ ;
+2 Initialize $\pmb{x}^k = \pmb{x}^S$ , $\pmb{a}^k = \mathbf{0}$ , $\pmb{g}^k = \nabla f(\pmb{x}^S)$ ;
+3 while $x^{k}\neq x^{E}$ do
+4 Increase index $k$ by 1;
+5 Update $\pmb{g}^{k} = \lambda \pmb{g}^{k - 1} + (1 - \lambda)\nabla f(\pmb{x}^{k})$
+6 Compute $\alpha_{j} = g_{j}^{k}(x_{j}^{E} - x_{j}^{k})$ if $x_{j}^{E}\neq x_{j}^{k}$
+$-\infty$ otherwise;
+7 Construct $\mathbb{M}_k = \{i\mid i\in top_s\{\alpha_j\} \}$
+8 Compute $(\mathrm{d}\pmb{x}^k)_i = x_i^E -x_i^k$ if $i\in \mathbb{M}_k$ and 0 otherwise;
+9 If $\| \mathrm{d}\pmb{x}^k\| _1 > \eta$ : $\mathrm{d}\pmb{x}^k = \frac{\eta}{\|\mathrm{d}\pmb{x}^k\|_1}\mathrm{d}\pmb{x}^k;$
+10 Move current point $\pmb{x}^k = \pmb{x}^{k-1} + \mathrm{d}\pmb{x}^k$ ;
+11 Update attribution $\pmb{a}^{k} = \pmb{a}^{k - 1} + \pmb{g}^{k}\cdot \mathrm{d}\pmb{x}^{k};$
+12 Expand $\mathbb{D} = \mathbb{D}\bigcup \{\mathrm{d}\pmb{x}^k\}$
+13 Return $\pmb{a}^k$ , D.
+
+To choose $s$ pixels with the largest projection of gradient direction strategy as Salient Manipulation Path (SAMP), we formulate SAMP as:
+
+Eq. (2). Besides, most greedy algorithms tend to get stuck in the local sub-optimal solution. To address these, we propose the infinitesimal constraint and the momentum strategy respectively.
+
+Infinitesimal Constraint (IC). To ensure the completeness axiom, we need to restrict each step size below a given bound $\eta > 0$ . Therefore we rectify $\mathrm{d}\pmb{x}^k$ in Eq. (8) as:
+
+$$
+\mathrm {d} \hat {\boldsymbol {x}} ^ {k} = \left\{ \begin{array}{l l} \frac {\eta}{\| \mathrm {d} \boldsymbol {x} ^ {k} \| _ {1}} \mathrm {d} \boldsymbol {x} ^ {k}, & \text {i f} \| \mathrm {d} \boldsymbol {x} ^ {k} \| _ {1} > \eta \\ \mathrm {d} \boldsymbol {x} ^ {k}, & \text {O t h e r w i s e} \end{array} \right. \tag {9}
+$$
+
+Note that the above constraint does not affect the convergence of SAMP. According to the definition of manipulation paths, it is easy to know the sum of L1 norm of all steps is a constant value as $\sum_{k=1}^{n} \| \mathrm{d}\pmb{x}^k \|_1 = \| \pmb{x}^S - \pmb{x}^E \|_1 = C$ . As long as $\eta > 0$ , the constrained SAMP can certainly converge after finite iterations.
+
+Momentum Strategy (MS). Due to the nature of greedy algorithms, SAMP runs the risk of falling into a local optimum. Inspired by the gradient descent with momentum, we incorporate the momentum strategy to coast across the flat landscape through the inertia mechanism as follows:
+
+$$
+\boldsymbol {g} ^ {k} = \lambda \boldsymbol {g} ^ {k - 1} + (1 - \lambda) \nabla f (\boldsymbol {x} ^ {k}). \tag {10}
+$$
+
+By substituting $\mathrm{d}\pmb{x}^k$ with $\mathrm{d}\hat{\pmb{x}}^k$ and $\nabla f(\pmb{x}^k)$ with $\pmb{g}^k$ , we formulate SAMP++ in Algorithm 1.
+
+# 4 EXPERIMENT
+
+In this section, we conduct qualitative and quantitative experiments to demonstrate the superiority of our proposed SAMP method. Due to the wide variety of interpretability methods, they often need to be evaluated from multiple dimensions (Nauta et al., 2022). Our proposed SAMP method belongs to attribution methods. We first perform qualitative experiments to verify the Concentration Principle claimed above and compare the visualization results with other counterparts in Section 4.2. Subsequently, we employ Deletion/Insertion metrics (Petsiuk et al., 2018) to examine SAMP quantitatively and conduct a completeness check with the Sensitivity-N metric (Ancona et al., 2018) in Section 4.3. Extensive ablation studies demonstrate the effectiveness of each feature in Section 4.4.
+
+# 4.1 EXPERIMENTAL SETTING
+
+Datasets and Models. We evaluate SAMP on the widely used MNIST (Deng, 2012), CIFAR-10 (Krizhevsky et al., 2009), and ImageNet (Deng et al., 2009). For MNIST and CIFAR-10 datasets, we simply build two five-layer CNNs (c.f. Appendix A.3) and train them to convergence using AdamW optimizer (Loshchilov & Hutter, 2017). For ImageNet dataset, we use the pre-trained ResNet-50 model (He et al., 2016) from PyTorch torchvision package (Paszke et al., 2019).
+
+Metrics. Interpretations should faithfully reveal the attention of model decisions. One evaluation for judging attributions is to check whether features with large attribution have a significant effect outputs. Therefore, we choose the Deletion/Insertion metrics (Petsiuk et al., 2018) for quantitative comparison. We delete/insert pixels sequentially in the descending order of attributions, plot the output curve, and calculate the area under the curve (AUC). For Deletion, a smaller AUC indicates better interpretability; for insertion, a larger AUC is expected. Moreover, we wish to examine the effect of the infinitesimal constraint (IC) on the rigorousness of SAMP. Therefore, we adopt the Sensitivity-N metric (Ancona et al., 2018) by calculating the Pearson correlation between the sum of attributions and the model output for completeness check.
+
+Implementation Details. We compare Deletion/Insertion metrics of SAMP with 12 mainstream interpretation methods. Following the configuration (Petsiuk et al., 2018), we set the baseline point as a zero-filled image for Deletion and a Gaussian-blurred image for Insertion. We randomly select 100 images from each dataset and report the mean and standard deviation of AUCs. Specifically, for MNIST and CIFAR-10, we set the Gaussian blur kernel size $s_g$ to 11 the variance $\sigma_g$ to 5, and the step size for calculating metrics $s_m$ to 10; for ImageNet, $s_g = 31$ , $\sigma_g = 5$ , and $s_m = 224 \times 8$ . If without special specifications, we fix the step size $s$ in SAMP as $224 \times 16$ for ImageNet and 10 for other datasets, the ratio of the infinitesimal upper bound $\eta$ to $\| \Delta x \|_1$ as 0.1, and the momentum coefficient $\lambda$ as 0.5. We perform all experiments with PyTorch on one NVIDIA 3090 card.
+
+
+(a)
+
+
+(b)
+
+
+Figure 3: Verification of Concentration Principle. (a) Visualizations of intermediate points and corresponding attributions along the path solved by SAMP. (b) The output score curve from the baseline point to the target image.
+Figure 4: Visualizations on MNIST, CIFAR-10, and ImageNet compared with other methods.
+
+# 4.2 QUALITATIVE VISUALIZATION
+
+# 4.2.1 VERIFICATION OF PROPERTIES
+
+We first verify whether SAMP can reach an expected path towards Concentration Principle. For clear visualization, we set the baseline point as zero-filled, and choose the manipulation direction from $\pmb{x}^0$ to $\pmb{x}^T$ . Along the path solved by SAMP, the intermediate points and corresponding attributions at different stages are visualized separately, as shown in Figure 3a. We can see that the first $25\%$ of the path has precisely pinpointed the subject animal. Besides, we plot the output scores at different stages along the manipulation path in Figure 3b. A rapid rise can be observed at the start, which indicates that SAMP tends to capture the most salient pixels first. At the same time, there is a small drop at the end. We ascribe this to background pixels, which interfere with the output score.
+
+# 4.2.2 VISUALIZATION COMPARISON
+
+We compare the visualization results of SAMP with other mainstream interpretation methods (Ribeiro et al., 2016; Selvaraju et al., 2017; Sundararajan et al., 2017; Smilkov et al., 2017; Shrikumar et al., 2017; Bach et al., 2015; Petsiuk et al., 2018; Kapishnikov et al., 2019; Xu et al., 2020; Kapishnikov et al., 2021). After randomly selecting input images on MNIST, CIFAR-10, and ImageNet, we calculate the attribution results of each method. We first convert the attributions to a grayscale image for visualization and also superimpose the attribution values with the original image. Figure 4 shows the comparison of the SAMP method with existing methods. As can be seen, the attribution results allocated by our method pinpoint important pixels and localize all pixels on salient objects most completely. Additionally, the attribution results of the $\mathrm{SAMP + + }$ approach are broadly similar to SAMP, but the results of $\mathrm{SAMP + + }$ are more fine-grained due to the infinitesimal constraints (for instance, the subject is more separated from the background).
+
+# 4.3 QUANTITATIVE ANALYSIS
+
+We conducted quantitative experiments to assess the performance of SAMP, including metrics such as Deletion/Insertion and Sensitivity-N check. In addition, we also carried out evaluations such as $\mu$ Fidelity (Novello et al., 2022) and pointing game (Zhang et al., 2018a) in Section A.5.4.
+
+Table 1: Deletion/Insertion metrics on MNIST, CIFAR-10, and ImageNet.
+
+
Method
MNIST
CIFAR-10
ImageNet
Deletion↓
Insertion↑
Deletion↓
Insertion↑
Deletion↓
Insertion↑
LRP
-0.003 (±0.13)
0.808 (±0.10)
-0.257 (±0.49)
1.452 (±0.37)
0.210 (±0.13)
0.575 (±0.15)
CAM
0.221 (±0.15)
0.715 (±0.11)
0.314 (±0.31)
0.863 (±0.23)
0.313 (±0.129)
0.897 (±0.13)
LIME
0.282 (±0.14)
0.597 (±0.09)
0.479 (±0.29)
0.722 (±0.24)
0.312 (±0.13)
0.898 (±0.14)
Grad-CAM
0.221 (±0.15)
0.715 (±0.11)
0.314 (±0.31)
0.863 (±0.23)
0.313 (±0.13)
0.897 (±0.13)
IG
-0.038 (±0.14)
0.795 (±0.11)
-0.372 (±0.54)
1.452 (±0.40)
0.197 (±0.13)
0.725 (±0.20)
SmoothGrads
0.003 (±0.13)
0.547 (±0.11)
0.777 (±0.55)
0.517 (±0.28)
0.300 (±0.13)
0.605 (±0.17)
DeepLIFT
-0.025 (±0.14)
0.791 (±0.11)
-0.300 (±0.51)
1.443 (±0.38)
0.216 (±0.12)
0.688 (±0.18)
RISE
0.059 (±0.11)
0.651 (±0.12)
0.149 (±0.35)
0.904 (±0.27)
0.282 (±0.13)
0.849 (±0.15)
XRAI
0.120 (±0.12)
0.754 (±0.10)
0.248 (±0.33)
0.910 (±0.21)
0.346 (±0.16)
0.865 (±0.14)
Blur IG
0.021 (±0.02)
0.804 (±0.17)
-0.107 (±0.39)
1.407 (±0.47)
0.261 (±0.14)
0.712 (±0.22)
Guided IG
-0.041 (±0.14)
0.762 (±0.10)
-0.276 (±0.47)
1.209 (±0.35)
0.167 (±0.13)
0.699 (±0.21)
SAMP (ours)
-0.093 (±0.14)
1.074 (±0.18)
-0.733 (±0.67)
1.458 (±0.40)
0.154 (±0.12)
0.984 (±0.20)
SAMP++ (ours)
-0.137 (±0.151)
1.050 (±0.18)
-0.899 (±0.72)
1.514 (±0.43)
0.145 (±0.12)
1.116 (±0.24)
+
+
+(a)
+
+
+(b)
+
+
+(a)
+Figure 5: Sensitivity-N check for IC.
+Figure 6: Impact of momentum coefficient $\lambda$ .
+
+# 4.3.1 DELETION/INSERTION COMPARISON
+
+To precisely compare the performance, we calculate the Deletion/Insertion metrics (Petsiuk et al., 2018). We randomly sampled 100 images and report the mean and standard deviation of the AUCs (see Table 1), where "SAMP" represents the original algorithm described in Eq. (8) and "SAMP++" denotes Algorithm 1 with the infinitesimal constraint (IC) and momentum strategy (MS). Our method consistently outperforms all other methods on three datasets. We ascribe this to Concentration Principle that facilitates our method to perform clear saliency rankings. In addition, the improved version significantly improves the original one in most cases. We believe that the momentum strategy plays an essential role in prompting the algorithm to break free from the local point (c.f. Section 4.4 for ablation studies.).
+
+# 4.3.2 SENSITIVITY-N CHECK
+
+In this part, we show the importance of the infinitesimal constraint (IC) on rigorousness (or completeness (Sundararajan et al., 2017)). Sensitivity-N (Ancona et al., 2018) checks the completeness by calculating the Pearson correlation of $\sum_{j}a_{j}$ and $\Delta y$ . We gradually increase $\beta = \| x\| _1 / \eta$ (i.e., decrease the upper bound $\eta$ in Eq. (9)) and draw the curve of the correlation w.r.t. $\beta$ (see Figure 5). With the decrease of $\eta$ , the correlation increases significantly. This is because IC limits each step to be infinitesimal, which ensures that Lagrangian remainder tends to 0, thereby enhancing rigorousness of Eq. (3). Interestingly, Figure 5a shows that with the further decrease of $\eta$ , the numerical error becomes the main error source, and the correlation no longer rises; because $\eta$ is not small enough at the start of Figure 5b, most steps are not cropped, thereby leading to a flat correlation curve.
+
+# 4.4 ABLATION STUDY
+
+# 4.4.1 INFLUENCE OF IC AND MS
+
+We perform ablation studies on the infinitesimal constraint (IC) and momentum strategy (MS), as shown in Table 2. As we can see, the improvement of SAMP in Deletion/Insertion metrics mainly comes from MS. According to Figure 6, SAMP achieves the largest improvement when $\lambda \approx 0.3$ . Table 3 shows that IC has no significant impact on Deletion/Insertion metrics, which can be attributed to the fact that IC is primarily designed to maintain rigor and lacks a direct connection with
+
+Table 2: Ablation study on IC and MS.
+
+
Setting
ImageNet
Deletion↓
Insertion↑
SAMP
0.154 (±0.118)
0.984 (±0.195)
+MS
0.144 (±0.115)
1.088 (±0.251)
+IC
0.159 (±0.121)
1.056 (±0.185)
+MS/IC
0.145 (±0.116)
1.116 (±0.241)
+
+Table 3: Influence of upper bound $\eta$
+
+
Bound-1
+(||Δx||1/η)
ImageNet
Deletion↓
Insertion↑
1/10
0.159 (±0.121)
1.056 (±0.185)
1/50
0.218 (±0.133)
1.130 (±0.168)
1/100
0.249 (±0.142)
1.031 (±0.155)
1/200
0.279 (±0.147)
0.939 (±0.159)
+
+enhancing metrics. In addition, smaller eta (e.g., $\eta = 1 / 200$ ) leads to finer-grained visualization (see Figure 8), which is due to the shortened step size that focuses more on details.
+
+# 4.4.2 CHOICE OF BASELINE POINTS
+
+We wonder whether different baseline choices affect the performance of SAMP. Therefore, we set four different sets of baseline points with $\eta = \| x\| _1 / 50$ . "B" means padding with zero, "W" means padding with one, "U" denotes uniformly random initialization, and "G" denotes Gaussian random initialization. In the symbol "X+Y", X represents the deletion direction, and Y represents the insertion direction. Figure 7 shows that the impact of different baselines on the explanations is not significant compared to different methods in Figure 4. Specifically, dif
+
+ferent baselines have little impact on the contour information, but they do significantly affect the overall intensity (e.g., brightness), which leads to visual differences.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 7: Visualization of different baseline. SAMP (Ours)
+Figure 8: Results with different upper bound $\eta$ .
+
+# 4.4.3 CHOICE OF PATHS
+
+The choice of path also has a certain influence on Deletion/Insertion (as shown in Table 4). We discover that only using the path $\boldsymbol{x}^T \to \boldsymbol{x}^0$ achieves the best Deletion; only using $\boldsymbol{x}^0 \to \boldsymbol{x}^T$ reaches the highest Insertion. We actually use both directions at the same time, and sum attributions generated by two directions to obtain a trade-off between two metrics.
+
+Table 4: Influence of path choices.
+
+
Path
ImageNet
to x0
to xT
Deletion↓
Insertion↑
✓
0.108 (±0.107)
0.659 (±0.171)
✓
0.199 (±0.135)
1.330 (±0.230)
✓
✓
0.159 (±0.121)
1.056 (±0.185)
+
+# 5 CONCLUSION
+
+To obtain user trust, interpretations should possess rigorousness and clarity. Even though path method (Sundararajan et al., 2017) identifies fundamental axioms for rigorousness, attributions remain ambiguous due to indeterminate path choices. In this paper, we first define Concentration Principle. Subsequently, we propose Salient Manipulation Path (SAMP), which is a fast and greedy interpreter for solving the approximate optimal path efficiently. To enhance the rigorousness and optimality of SAMP, we propose the infinitesimal constraint (IC) and momentum strategy (MS) respectively. Visualization experiments show that the attribution generated by our method accurately discovers significant pixels and completely pinpoints all pixels of salient objects. Quantitative experiments demonstrate that our method significantly outperforms the current mainstream interpretation methods. Moreover, qualitative experiments also reveal that SAMP can obtain higher-quality semantic segmentations by visualizing the attribution values only employing class-level annotations. Investigating the utility of saliency-based explanations in annotation-limited tasks (such as weakly-supervised object recognition) and other promising domains (with a focus on NLP and medical image analysis) represents an exciting direction for further study.
+
+# ACKNOWLEDGEMENT
+
+This work was supported in part by the National Key Research and Development Program of China under Grant 2022ZD0160102, and in part by the National Natural Science Foundation of China under Grant 62125603, Grant 62321005, and Grant 62336004.
+
+# REFERENCES
+
+Rishabh Agarwal, Levi Melnick, Nicholas Frosst, Xuezhou Zhang, Ben Lengerich, Rich Caruana, and Geoffrey E Hinton. Neural additive models: Interpretable machine learning with neural nets. In NeurIPS, pp. 4699-4711, 2021.
+Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. In ICLR, 2018.
+Robert J Aumann and Lloyd S Shapley. Values of non-atomic games. Princeton University Press, 1974.
+Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. *PloS one*, 10(7):e0130140, 2015.
+Pietro Barbiero, Gabriele Ciravegna, Francesco Giannini, Pietro Lio, Marco Gori, and Stefano Melacci. Entropy-based logic explanations of neural networks. In AAAI, pp. 6046-6054, 2022.
+Francesco Bodria, Fosca Giannotti, Riccardo Guidotti, Francesca Naretto, Dino Pedreschi, and Salvatore Rinzivillo. Benchmarking and survey of explanation methods for black box models. arXiv, abs/2102.13076, 2021.
+Aditya Chattopadhy, Anirban Sarkar, Prantik Howlader, and Vineeth N Balasubramanian. Gradcam++: Generalized gradient-based visual explanations for deep convolutional networks. In WACV, pp. 839-847, 2018.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pp. 248-255, 2009.
+Li Deng. The mnist database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141-142, 2012.
+Ruth C Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. In ICCV, 2017.
+Eric J Friedman. Paths and consistency in additive cost sharing. International Journal of Game Theory, 32(4):501-518, 2004.
+Leilani H Gilpin, David Bau, Ben Z Yuan, Ayesha Bajwa, Michael Specter, and Lalana Kagal. Explaining explanations: An overview of interpretability of machine learning. In DSAA, pp. 80-89, 2018.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pp. 770-778, 2016.
+Andrei Kapishnikov, Tolga Bolukbasi, Fernanda Viégas, and Michael Terry. Xrai: Better attributions through regions. In ICCV, pp. 4948-4957, 2019.
+Andrei Kapishnikov, Subhashini Venugopalan, Besim Avci, Ben Wedin, Michael Terry, and Tolga Bolukbasi. Guided integrated gradients: An adaptive path method for removing noise. In CVPR, pp. 5050-5058, 2021.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
+
+Haoyu Liang, Zhihao Ouyang, Yuyuan Zeng, Hang Su, Zihao He, Shu-Tao Xia, Jun Zhu, and Bo Zhang. Training interpretable convolutional neural networks by differentiating class-specific filters. In ECCV, pp. 622-638, 2020.
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv, abs/1711.05101, 2017.
+Yang Young Lu, Wenbo Guo, Xinyu Xing, and William Stafford Noble. Dance: Enhancing saliency maps using decoys. In ICML, pp. 7124-7133, 2021.
+Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In NeurlPS, volume 30, 2017.
+Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Methods for interpreting and understanding deep neural networks. Digital signal processing, 73:1-15, 2018.
+Meike Nauta, Jan Trienes, Shreyasi Pathak, Elisa Nguyen, Michelle Peters, Yasmin Schmitt, Jörg Schlötterer, Maurice van Keulen, and Christin Seifert. From anecdotal evidence to quantitative evaluation methods: A systematic review on evaluating explainable ai. arXiv, abs/2201.08164, 2022.
+Paul Novello, Thomas Fel, and David Vigouroux. Making sense of dependence: Efficient black-box explanations using dependence measure. Advances in Neural Information Processing Systems, 35:4344-4357, 2022.
+Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. NeurIPS, 32, 2019.
+Vitali Petsiuk, Abir Das, and Kate Saenko. Rise: Randomized input sampling for explanation of black-box models. In BMVC, 2018.
+Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should i trust you?" explaining the predictions of any classifier. In KDD, pp. 1135-1144, 2016.
+Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In ICCV, pp. 618-626, 2017.
+Wen Shen, Zhihua Wei, Shikun Huang, Binbin Zhang, Jiaqi Fan, Ping Zhao, and Quanshi Zhang. Interpretable compositional convolutional neural networks. arXiv, abs/2107.04474, 2021.
+Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences. arXiv, abs/1605.01713, 2016.
+Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. In ICML, pp. 3145-3153, 2017.
+Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. In ICLR (Workshop), 2014.
+Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. Smoothgrad: removing noise by adding noise. arXiv, abs/1706.03825, 2017.
+Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller. Striving for simplicity: The all convolutional net. In ICLR (Workshop), 2015.
+Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In ICML, pp. 3319-3328, 2017.
+Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011.
+
+Alvin Wan, Lisa Dunlap, Daniel Ho, Jihan Yin, Scott Lee, Henry Jin, Suzanne Petryk, Sarah Adel Bargal, and Joseph E Gonzalez. Nbdt: neural-backed decision trees. arXiv, abs/2004.00221, 2020.
+Yipei Wang and Xiaogian Wang. Self-interpretable model with transformation equivariant interpretation. In NeurIPS, pp. 2359-2372, 2021.
+Shawn Xu, Subhashini Venugopalan, and Mukund Sundararajan. Attribution in scale and space. In CVPR, pp. 9680-9689, 2020.
+Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In ECCV, pp. 818-833, 2014.
+Jianming Zhang, Sarah Adel Bargal, Zhe Lin, Jonathan Brandt, Xiaohui Shen, and Stan Sclaroff. Top-down neural attention by excitation backprop. International Journal of Computer Vision, 126 (10):1084-1102, 2018a.
+Quan-shi Zhang and Song-Chun Zhu. Visual interpretability for deep learning: a survey. Frontiers of Information Technology & Electronic Engineering, 19(1):27-39, 2018.
+Quanshi Zhang, Ying Nian Wu, and Song-Chun Zhu. Interpretable convolutional neural networks. In CVPR, pp. 8827-8836, 2018b.
+Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, pp. 2921-2929, 2016.
+Luisa M Zintgraf, Taco S Cohen, Tameem Adel, and Max Welling. Visualizing deep neural network decisions: Prediction difference analysis. arXiv, abs/1702.04595, 2017.
+
+# A APPENDIX
+
+# A.1 THEORETICAL SUPPLEMENTARY
+
+# A.1.1 PROOF OF PROPOSITION 1
+
+Proof. By assumption, $\{u_t,t\geq 0\}$ is a Brownian motion and $u_{t}\sim \mathcal{N}(0,\sigma t)$
+
+$$
+P (u _ {t}) = \frac {1}{\sqrt {2 \pi \sigma t}} \exp \left\{- \frac {u _ {t} ^ {2}}{2 \sigma t} \right\}
+$$
+
+To treat attributions equally, we consider the subset $\{u_t,t\in \mathbb{N}\}$ with uniform time intervals $(u_0 = 0)$ . According to the Markov property, we can get $\forall k\in \mathbb{N},u_k - u_{k - 1}\sim \mathcal{N}(0,\sigma)$ . Thus we can formulate the joint probability distribution as follows:
+
+$$
+\begin{array}{l} P (u _ {1}, u _ {2}, \dots , u _ {d}) \\ = \prod_ {k = 1} ^ {d} P (u _ {k} | u _ {k - 1}, \dots , u _ {1}) \\ = \prod_ {k = 1} ^ {d} P (u _ {k} - u _ {k - 1} | u _ {k - 1}) \\ = \prod_ {k = 1} ^ {d} \frac {1}{\sqrt {2 \pi \sigma}} \exp \left\{- \frac {(u _ {k} - u _ {k - 1}) ^ {2}}{2 \sigma} \right\} \\ = \frac {1}{(2 \pi \sigma) ^ {\frac {d}{2}}} \exp \left\{- \sum_ {k = 1} ^ {d} \frac {(u _ {k} - u _ {k - 1}) ^ {2}}{2 \sigma} \right\}. \tag {11} \\ \end{array}
+$$
+
+As $\forall k\in \{1,\dots ,d\} ,a_k = u_k - u_{k - 1}$ , we have
+
+$$
+\begin{array}{l} \left(a _ {1}, a _ {2}, \dots , a _ {d}\right) = J \left(u _ {1}, u _ {2}, \dots , u _ {d}\right) \\ = \left[ \begin{array}{c c c c c} 1 & 0 & 0 & \dots & 0 \\ - 1 & 1 & 0 & \dots & 0 \\ 0 & - 1 & 1 & \dots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \dots & 1 \end{array} \right] \left[ \begin{array}{c} u _ {1} \\ u _ {2} \\ u _ {3} \\ \vdots \\ u _ {d} \end{array} \right]. \\ \end{array}
+$$
+
+Thus $P(a_{1}, a_{2}, \dots, a_{d}) = P(u_{1}, u_{2}, \dots, u_{d}) / |\mathbf{J}| = P(u_{1}, u_{2}, \dots, u_{d})$ . If dividing $P(a_{1}, a_{2}, \dots, a_{d})$ by $P(u_{d})$ , we get the conditional distribution $P(\tilde{\boldsymbol{a}} | C) = P(a_{1}, \dots, a_{d-1} | u_{d} = C)$ as follows:
+
+$$
+\begin{array}{l} P \left(a _ {1}, a _ {2}, \dots , a _ {d - 1} \mid u _ {d} = C\right) \\ = P \left(a _ {1}, a _ {2}, \dots , a _ {d} \mid u _ {d} = C\right) \\ = P \left(a _ {1}, a _ {2}, \dots , a _ {d}\right) / P \left(u _ {d} = C\right) \\ = \frac {\sqrt {d}}{(2 \pi \sigma) ^ {\frac {d - 1}{2}}} \exp \left\{\frac {u _ {d} ^ {2}}{2 \sigma d} - \sum_ {k = 1} ^ {d} \frac {a _ {k} ^ {2}}{2 \sigma} \right\} \\ = \frac {\sqrt {d}}{\left(2 \pi \sigma\right) ^ {\frac {d - 1}{2}}} \exp \left\{\frac {C ^ {2}}{2 \sigma d} - \frac {\left(C - \sum_ {k = 1} ^ {d - 1} a _ {k}\right) ^ {2}}{2 \sigma} - \sum_ {k = 1} ^ {d - 1} \frac {a _ {k} ^ {2}}{2 \sigma} \right\} \\ = \frac {\sqrt {d}}{\left(2 \pi \sigma\right) ^ {\frac {d - 1}{2}}} \exp \left\{\frac {- 1}{2 \sigma} \left[ \tilde {\boldsymbol {a}} ^ {T} \tilde {\boldsymbol {a}} + (C - \mathbf {1} ^ {T} \tilde {\boldsymbol {a}}) ^ {2} - \frac {C ^ {2}}{d} \right] \right\} \\ = \frac {\sqrt {d}}{\left(2 \pi \sigma\right) ^ {\frac {d - 1}{2}}} \exp \left\{\frac {- 1}{2 \sigma} \left[ \tilde {\boldsymbol {a}} ^ {T} \left(\boldsymbol {I} + \mathbf {1 1} ^ {T}\right) \tilde {\boldsymbol {a}} - 2 C \mathbf {1} \tilde {\boldsymbol {a}} + \frac {(d - 1) C ^ {2}}{d} \right] \right\}. \tag {12} \\ \end{array}
+$$
+
+Let $\Sigma = \frac{\sigma}{d} (d\mathbf{I} - \mathbf{1}\mathbf{1}^T) \in \mathbb{R}^{(d-1) \times (d-1)}$ . We can easily get that $|\Sigma| = \frac{\sigma^{d-1}}{d}$ and $\Sigma^{-1} = \frac{1}{\sigma} (\mathbf{I} + \mathbf{1}\mathbf{1}^T)$ . Thus we can simplify Eq. (12) as:
+
+$$
+\begin{array}{l} P \left(a _ {1}, a _ {2}, \dots , a _ {d - 1} \mid u _ {d} = C\right) \\ = \frac {\sqrt {d}}{\left(2 \pi \sigma\right) ^ {\frac {d - 1}{2}}} \exp \left\{- \frac {1}{2} \left[ \tilde {\boldsymbol {a}} ^ {T} \Sigma^ {- 1} \tilde {\boldsymbol {a}} - 2 \frac {C}{d} \mathbf {1} \Sigma^ {- 1} \tilde {\boldsymbol {a}} + \frac {C ^ {2}}{d ^ {2}} \mathbf {1} ^ {T} \Sigma^ {- 1} \mathbf {1} \right] \right\} \\ = \frac {\sqrt {d}}{(2 \pi \sigma) ^ {\frac {d - 1}{2}}} \exp \left\{- \frac {1}{2} \left(\tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1}\right) ^ {T} \Sigma^ {- 1} \left(\tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1}\right) \right\} \\ = \frac {1}{(2 \pi) ^ {\frac {d - 1}{2}} \sqrt {| \Sigma |}} \exp \left\{- \frac {1}{2} \left\| \tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1} \right\| _ {\Sigma^ {- 1}} ^ {2} \right\}. \tag {13} \\ \end{array}
+$$
+
+Therefore, $\tilde{\pmb{a}} |u_d\sim \mathcal{N}(\frac{C}{d}\mathbf{1},\Sigma)$ where $\boldsymbol {\Sigma} = \frac{\sigma}{d} (d\pmb {I} - \mathbf{11}^T)$
+
+# A.1.2 SUPPLEMENTARY OF PROPOSITION 2
+
+(1) How to derive Eq. (7): We can reformulate Eq. (13):
+
+$$
+\begin{array}{l} P (\tilde {\boldsymbol {a}} | C) = P \left(a _ {1}, a _ {2}, \dots , a _ {d - 1} \mid u _ {d} = C\right) \\ = \frac {\sqrt {d}}{(2 \pi \sigma) ^ {\frac {d - 1}{2}}} \exp \left\{- \frac {1}{2 \sigma} \left(\tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1}\right) ^ {T} \left(\tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1}\right) \right. \\ \left. - \frac {1}{2 \sigma} \left(\tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1}\right) ^ {T} \mathbf {1} \mathbf {1} ^ {T} \left(\tilde {\boldsymbol {a}} - \frac {C}{d} \mathbf {1}\right) \right\} \\ = \frac {\sqrt {d}}{\left(2 \pi \sigma\right) ^ {\frac {d - 1}{2}}} \exp \left\{- \frac {D _ {a p} ^ {2}}{2 \sigma} - \frac {1}{2 \sigma} \left(C - \sum_ {k = 1} ^ {d - 1} a _ {k}\right) ^ {2} \right\} \\ = \frac {\sqrt {d}}{(2 \pi \sigma) ^ {\frac {d - 1}{2}}} \exp \left\{- \frac {D _ {a p} ^ {2} + a _ {d} ^ {2}}{2 \sigma} \right\} \\ = \hat {P} (\tilde {\boldsymbol {a}} | C) e ^ {- a _ {d} ^ {2} / (2 \sigma)}, \tag {14} \\ \end{array}
+$$
+
+where $\hat{P} (\tilde{\mathbf{a}} |C)$ is the estimation of $P(\tilde{\mathbf{a}} |C)$ . By Proposition 1 we know that $a_{d}|u_{d}\sim \mathcal{N}(\frac{C}{d},\sigma \frac{d - 1}{d})$ . Although the expectation of $a_{d}$ gradually approaches zero with the increase of $d$ , the variance gradually approaches $\sigma$ . Thus the approximation error cannot be completely zero. Fortunately, the experimental results show that the attribution allocation is not completely homogeneous. Figure 3b reveals that the last allocated $a_{d}$ is usually approximately zero due to the saturation region. Therefore, the approximation error in Proposition 2 is generally acceptable.
+
+(2) Element-wise limit: Note that $\lim_{d\to \Sigma} = \sigma I$ actually means the element-by-element limit rather than the limit in terms of the matrix norm. Given $\Sigma (d) = \frac{\sigma}{d} (dI - 11^T)$ , we can easily get that
+
+$$
+\forall i, j \in \mathbb {N}, \lim _ {d \rightarrow \infty} \Sigma_ {i j} = \left\{\begin{array}{l}\sigma , i = j\\0, i \neq j.\end{array}\right. \tag {15}
+$$
+
+It is hard to find a norm $\| \cdot \|$ such that $\lim_{d\to \infty}\| \Sigma -\sigma I\| = 0$ . For example, $\| \Sigma -\sigma I\|_{m_{\infty}} = (d - 1)\max_{ij}|\Sigma_{ij} - \sigma I_{ij}|$ is always 1, not tending to 0. Therefore, Proposition 2 has certain limitations. The continuous mapping such as the determinant $(\operatorname*{det}(\cdot))$ and the limit operation $(\lim_{d\to \infty}(\cdot))$ are not commutative.
+
+# A.2 POTENTIAL CHALLENGE OF CONCENTRATION PRINCIPLE
+
+As a path method, SAMP generates attributions with three axioms (linearity, dummy, and efficiency). These axioms ensure that SAMP does not blindly pursue high variance path and only ignores ambiguous elements rather than essential ones. We visualize a blue-pixel counting model in Fig.9, and SAMP achieves consistent attributions.
+
+
+Figure 9: Counting model examples for Concentration Principle.
+
+
+
+
+
+
+
+
+
+# A.3 MODEL ARCHITECTURE
+
+The architecture of 5-layer CNNs adopted on the MNIST (Deng, 2012) and CIFAR-10 (Krizhevsky et al., 2009) datasets is shown in Table 5. We employ the most common ReLU activation function and an adaptive max-pooling layer to reduce the spatial dimension to 1.
+
+Table 5: CNNs for MNIST and CIFAR-10.
+
+
Layer
5-layer CNNs
for MNIST
for CIFAR-10
Input 1 × 28 × 28
Input 3 × 32 × 32
conv1
5 × 5, 8 + ReLU
5 × 5 + ReLU
conv2
2 × 2, 24, stride 2
2 × 2, 64, stride 2
conv3
4 × 4, 288 + ReLU
4 × 4, 512 + ReLU
conv4
2 × 2, 864, stride 2
2 × 2, 1536, stride 2
conv5
3 × 3, 2592 + ReLU
3 × 3, 4608 + ReLU
pool
adaptive max pool
+
+# A.4 EVALUATION DETAIL
+
+# A.4.1 EVALUATION PROTOCOL
+
+We employ classification models for Deletion/Insertion evaluation. Conventional classification models output the final scores with a soft-max layer as
+
+$$
+\tilde {y} _ {i} = \frac {e ^ {y _ {i}}}{\sum_ {j} e ^ {y _ {j}}}.
+$$
+
+However, $\tilde{y}_i$ is coupled with the output score $y_j$ ( $j \neq i$ ) of other classes. Therefore, we directly utilize the output score $y_i$ before the soft-max layer to compute metrics.
+
+Given any input data $\mathbf{x}$ , we employ the interpretation method to obtain the attribution $\mathbf{a}$ . We first rank the attribution $\mathbf{a}$ in descending order. Then we select $s_m$ pixels to delete or insert according to the sorting, so as to obtain a series of output scores as:
+
+$$
+\boldsymbol {y} = \left\{ \begin{array}{l l} \{y ^ {T}, y ^ {K - 1}, \dots , y ^ {1}, y ^ {0} \} & \text {F o r D e l e t i o n} \\ \{y ^ {0}, y ^ {1}, \dots , y ^ {K - 1}, y ^ {T} \} & \text {F o r I n s e r t i o n} \end{array} . \right.
+$$
+
+where $y^0$ and $y^T$ are path-independent values. We can normalize the series of scores as
+
+$$
+\hat {y} ^ {k} = y ^ {k} / y ^ {T},
+$$
+
+and the normalized area under the curve is computed as $s_{auc} = \frac{1}{K + 1}\sum_{i = 0}^{K}\hat{y}$ . Note that Note that $s_{auc}$ is not necessarily constrained between 0 and 1. For Deletion, the intermediate $y^k$ may be greater than $y^T$ ; for insertion, the intermediate $y^k$ may be less than 0.
+
+# A.4.2 HYPERPARAMETER CHOICE
+
+$\lambda$ setting: $\lambda \approx 0.3$ in Section 4.4.1 is only optimal on ImageNet, so we set $\lambda = 0.5$ for all three datasets in Section 4.1.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(a)
+
+
+Figure 10: (a) Visualization results of images with high classification confidence. (b) Images with low classification confidence.
+
+
+
+
+(b)
+
+
+
+
+
+
+Figure 11: Additional visualization of different baseline.
+
+Table 6: Influence of baseline choices.
+
+
Baseline
ImageNet
xT x0
x0 xT
Deletion↓
Insertion↑
B
B
0.254 (±0.137)
0.779 (±0.178)
B
W
0.272 (±0.137)
0.743 (±0.166)
B
U
0.257 (±0.130)
0.681 (±0.179)
B
G
0.218 (±0.133)
1.130 (±0.168)
+
+$\eta$ setting: Since smaller $\eta$ needs more computation, we set a balanced $\eta = 0.1$ in Section 4.1. Besides, we set $\eta = 0.02$ for visual comparison because Figure 8 shows that smaller $\eta$ produces more subtle visualizations.
+
+# A.4.3 REIMPLEMENTED BENCHMARK FOR FAIRNESS
+
+Results of different works (Bodria et al., 2021; Petsiuk et al., 2018) are quite distinct. To compare fairly, we reimplement all methods and fix some bugs in the public code. We remove the final softmax layer to avoid interaction of classes and $N = 100$ can already produce stable results. We will also release benchmark code after the paper is accepted.
+
+# A.5 ADDITIONAL EXPERIMENT
+
+# A.5.1 CONSISTENCY ON OUTPUTS AND ATTRIBUTIONS
+
+The ultimate goal of attributions is to monitor the potential mistakes of models and data. We normalize the final scores through a soft-max layer and visualize the attributions of images with high confidence and low confidence shown in Figure 10a and Figure 10b respectively. It can be seen
+
+that for images with high confidence, the corresponding attributions are concentrated on the salient objects, while for images with low confidence, the corresponding attributions are scattered on both the objects and the background.
+
+# A.5.2 ADDITIONAL COMPARISON WITH COUNTERPARTS
+
+To further illustrate the significance of the improvement of the SAMP method compared with other interpretation methods, we show more comparison examples, as shown in Figure 16 and Figure 17. We can observe a clear improvement in the granularity of attributions.
+
+# A.5.3 ADDITIONAL ABLATION STUDY ON BASELINE CHOICES
+
+We show more visualization here to further illustrate that the choice of baselines has a marginal impact in Figure 11. We also test the Deletion/Insertion metrics as Table 6. Different from the visualization results, the choice of baselines will significantly affect metrics. Specifically, for the Deletion/Insertion metrics, we refer to the open-source code4 from RISE (Petsiuk et al., 2018). In calculating these metrics, RISE uses a black image (i.e., "B") as the baseline for the Deletion metric and a Gaussian blurred image (i.e., "G") as the baseline for the Insertion metric. Therefore, based on the results in Table 6, if we also adopt the "B+G" baseline to generate explanations, which aligns with the metric calculation setup in RISE, the Deletion/Insertion metric would be best.
+
+# A.5.4 ADDITIONAL VISUALIZATION ON DIFFERENT BOUND $\eta$
+
+
+Figure 12: Additional visualization with different upper bound $\eta$ .
+
+Here we show more visualization results with different upper bound $\eta$ , and compare them with the mainstream IG (Sundararajan et al., 2017) and GuidedIG (Kapishnikov et al., 2021), as shown in
+
+
+Figure 13: Visual comparison with Shapley values.
+Figure 12. We can see that SAMP can locate salient pixels more clearly, and as $\eta$ decreases, the fineness of localization is higher.
+
+# A.5.5 OTHER EVALUATIONS
+
+Why Deletion/Insertion: Explainability evaluations are still an open problem (Bodria et al., 2021). It is controversial to compare explanations against ground truth since there is no guarantee that models use the same features as humans. Therefore, we choose to employ self-comparison evaluations (e.g., Deletion/Insertion), even though they have potential information leakage.
+
+$\mu$ Fidelity and Pointing game results: Despite the controversy, we conduct pointing game experiments for the test set of PASCAL VOC2007 shown in Table 7. We can see that RISE is the most accurate method. RISE has an inherent advantage in pointing game because the block-level methods like RISE (with $7 \times 7$ resolution) are not sensitive to outliers. Compared with other path methods (IG, BlurIG and GuidedIG), SAMP still has a significant improvement. We also evaluate the $\mu$ Fidelity on MNIST. We can see that $\mathrm{SAMP}++$ achieves competitive performance compared with other methods.
+
+Table 7: $\mu$ Fidelity on MNIST and pointing game on VOC2007.
+
+
MWP
SG
RISE
IG
BlurIG
GuidedIG
SAMP++
μFidelity↑
-
0.327
0.286
0.453
0.292
0.453
0.461
Pointing Acc.↑
76.90
-
87.33
76.31
76.19
72.82
80.75
Time(s) (on MNIST)
-
0.204
0.191
0.207
0.205
0.344
0.235
+
+# A.5.6 COMPARISON WITH SHAPLEY VALUES
+
+Table 8: Comparison with Shapley-based methods on MNIST.
+
+
| ApproShapley
Deep SHAP (Lundberg & Lee, 2017)
SAMP++
Deletion↓ / Insertion↑
0.014 / 0.808
0.029 / 0.955
-0.137 / 1.050
Time(s) (on MNIST)
14.390
0.748
0.235
+
+we compare SAMP with two Shapley-based methods. ApproShapley computes the Shapley value by the Monte Carlo method and Deep SHAP (Lundberg & Lee, 2017) is a high-speed approximation. Tab.8 shows that $\mathrm{SAMP + + }$ achieves better Deletion/Insertion with less computation burden and Fig.13 visualizes the attributions.
+
+# A.5.7 VISUALIZATION ON MULTI-LABEL CLASSIFICATION
+
+To comprehensively explore the application for more complex scenarios, we constructed 2x2 image combinations using images from the MNIST dataset, where each image contained multiple digits.
+
+
+Figure 14: Visualizations on multi-label classification.
+
+
+
+Then, we utilized CNNs to classify these images and applied the SAMP method for visualizing the attributions of each classification. The visualization results in Figure 14 demonstrate that SAMP can accurately pinpoint specific data related to certain categories (for example, in synthetic images containing 0, 5, and 7, when attributing to the 0 class, SAMP only attributes to the 0 digit). This suggests that the SAMP method can be effectively applied to multi-class classification problems.
+
+# A.5.8 VISUALIZATION ON FINE-GRAINED DATASET: CUB-200-2011
+
+The CUB-200-2011 (Wah et al., 2011) dataset is a widely used fine-grained bird dataset consisting of 200 types of birds. We employ a ResNet50 network pre-trained on the ImageNet dataset to fine-tune on the CUB-200-2011 dataset until training convergence, achieving an accuracy rate above $98\%$ on the training set. To evaluate the impact of the SAMP method on fine-grained data, we randomly select 5 images from various categories in the CUB-200-2011 dataset and compute attributions on these images with their corresponding 5 category labels, generating a total of 25 visualized images arranged in a $5 \times 5$ grid, as shown in Figure 15. In this figure, the diagonal is outlined in green borders, representing the attribution result for the image's corresponding category, while non-diagonal elements are outlined in red borders, denoting attribution results for other categories. It is evident that the attribution results for the image's corresponding category are significantly more prominent compared to those for other categories. However, we acknowledge the presence of some intensity in the attribution results of other categories, suggesting that attributions for fine-grained datasets have not yet fully decoupled from the category, which is also a further direction we aim to further investigate.
+
+# A.6 LIMITATIONS AND FUTURE DIRECTIONS
+
+In this section, we will briefly outline the limitations of the SAMP approach and suggest potential future research directions.
+
+- Theoretically, our paper presents the concentration principle to address the issue of ambiguous path selection in traditional path methods. However, directly solving the concentration principle involves an exponentially complex combinatorial optimization problem. To address this, we proposed the SAMP algorithm based on the Brownian motion assumption, which reduces the exponential complexity to linear complexity and can obtain a near-optimal solution to the original problem. Nonetheless, this paper does not provide a thorough investigation of the optimality of the SAMP algorithm in solving the
+
+
+Figure 15: Visualizations on CUB-200-2011.
+
+problem, and we intend to conduct rigorous theoretical analysis of the optimality of the SAMP algorithm in the future and explore if more efficient and accurate algorithms exist for solving the problem.
+
+- Experimentally, the SAMP algorithm reduces the original exponentially complex problem to linear complexity and maintains comparability with mainstream path methods (e.g., IG, BlurIG, GuidedIG). However, the SAMP algorithm still requires multiple forward and backward passes for each sample, leading to a certain computational overhead in practical applications, and its calculation speed is slower than CAM and Grad-CAM. In the future, we plan to explore if there are more efficient approximation algorithms that can improve execution efficiency while maintaining explanation accuracy.
+
+
+Figure 16: Additional visualization comparison with counterparts.
+
+
+Figure 17: Additional visualization comparison with counterparts.
\ No newline at end of file
diff --git a/pathchoicemattersforclearattributionsinpathmethods/images.zip b/pathchoicemattersforclearattributionsinpathmethods/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..84ca16f102ee4ea432a1b51cfaf82ac2bffc0ced
--- /dev/null
+++ b/pathchoicemattersforclearattributionsinpathmethods/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eaeb1a13999514cb86c36142966db31f2552e0ab43e6edd9046770fc08d793ce
+size 1684873
diff --git a/pathchoicemattersforclearattributionsinpathmethods/layout.json b/pathchoicemattersforclearattributionsinpathmethods/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8507eb288bcdf9b057f41ecf35ce6db7eee72020
--- /dev/null
+++ b/pathchoicemattersforclearattributionsinpathmethods/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3c57867607386456f4e0ed13f6436c596ce3d29fe16788e69032fcde7fc8b8e4
+size 849458
diff --git a/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_content_list.json b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8fd61590ff1defcbb887a476fa09cceff62fac9f
--- /dev/null
+++ b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2217e636c2613becb114132f899356c8b8fb109a65652e96d292feb3e7baf003
+size 135984
diff --git a/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_model.json b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4ff9181f7864af26ace391847140242f25d2f63e
--- /dev/null
+++ b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a03e8af3e7ccfa75beb919002c8828355fc2deed55bd99d9eb26fd80b05fd321
+size 159891
diff --git a/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_origin.pdf b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c0ebb907e8e6f6cc894580c5836961d766718187
--- /dev/null
+++ b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/949675dc-7986-4d67-831c-1a942d40d06f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d7e5333de95c761b9d68aaf48dc8082ec06ff6140b80f2a90d7367c5c68905d
+size 3033816
diff --git a/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/full.md b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f0657b1024fe61a18fd5f4a9b330305672e58d7f
--- /dev/null
+++ b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/full.md
@@ -0,0 +1,349 @@
+# PATHFORMER: MULTI-SCALE TRANSFORMERS WITH ADAPTIVE PATHWAYS FOR TIME SERIES FORECASTING
+
+Peng Chen $^{1*}$ , Yingying Zhang $^{2}$ , Yunyao Cheng $^{3}$ , Yang Shu $^{1\dagger}$ , Yihang Wang $^{1*}$ , Qingsong Wen $^{2}$ , Bin Yang $^{1}$ , Chenjuan Guo $^{1}$
+
+$^{1}$ East China Normal University, $^{2}$ Alibaba Group, $^{3}$ Aalborg University
+{pchen, yhwang}@stu.ecnu.edu.cn, congrrong.zyy@alibaba-inc.com
+{yshu, cjguo, byang}@dase.ecnu.edu.cn, yunyaoc@cs.aau.dk
+qingsongedu@gmail.com
+
+# ABSTRACT
+
+Transformers for time series forecasting mainly model time series from limited or fixed scales, making it challenging to capture different characteristics spanning various scales. We propose Pathformer, a multi-scale Transformer with adaptive pathways. It integrates both temporal resolution and temporal distance for multi-scale modeling. Multi-scale division divides the time series into different temporal resolutions using patches of various sizes. Based on the division of each scale, dual attention is performed over these patches to capture global correlations and local details as temporal dependencies. We further enrich the multiscale Transformer with adaptive pathways, which adaptively adjust the multi-scale modeling process based on the varying temporal dynamics of the input, improving the accuracy and generalization of Pathformer. Extensive experiments on eleven real-world datasets demonstrate that Pathformer not only achieves state-of-the-art performance by surpassing all current models but also exhibits stronger generalization abilities under various transfer scenarios. The code is made available at https://github.com/decisionintelligence/pathformer.
+
+# 1 INTRODUCTION
+
+Time series forecasting is an essential function for various industries, such as energy, finance, traffic, logistics, and cloud computing (Chen et al., 2012; Cirstea et al., 2022b; Ma et al., 2014; Zhu et al., 2023; Pan et al., 2023; Pedersen et al., 2020), and is also a foundational building block for other time series analytics, e.g., outlier detection Campos et al. (2022); Kieu et al. (2022b). Motivated by its widespread application in sequence modeling and impressive success in various fields such as CV and NLP (Dosovitskiy et al., 2021; Brown et al., 2020), Transformer (Vaswani et al., 2017) receives emerging attention in time series (Wen et al., 2023; Wu et al., 2021; Chen et al., 2022; Liu et al., 2022c). Despite the growing performance, recent works have started to challenge the existing designs of Transformers for time series forecasting by proposing simpler linear models with better performance (Zeng et al., 2023). While the capabilities of Transformers are still promising in time series forecasting (Nie et al., 2023), it calls for better designs and adaptations to fulfill its potential.
+
+Real-world time series exhibit diverse variations and fluctuations at different temporal scales. For instance, the utilization of CPU, GPU, and memory resources in cloud computing reveals unique temporal patterns spanning daily, monthly, and seasonal scales Pan et al. (2023). This calls for multi-scale modeling (Mozer, 1991; Ferreira et al., 2006) for time series forecasting, which extracts temporal features and dependencies from various scales of temporal intervals. There are two aspects to consider for multiple scales in time series: temporal resolution and temporal distance. Temporal resolution corresponds to how we view the time series in the model and determines the length of each temporal patch or unit considered for modeling. In Figure 1, the same time series can be divided
+
+
+Figure 1: Left: Time series are divided into patches of varying sizes as temporal resolution. The intervals in blue, orange, and red represent different patch sizes. Right: Local details (black arrows) and global correlations (color arrows) are modeled through different temporal distances.
+
+into small patches (blue) or large ones (yellow), leading to fine-grained or coarse-grained temporal characteristics. Temporal distance corresponds to how we explicitly model temporal dependencies and determines the distances between the time steps considered for temporal modeling. In Figure 1, the black arrows model the relations between nearby time steps, forming local details, while the colored arrows model time steps across long ranges, forming global correlations.
+
+To further explore the capability of extracting correlations in Transformers for time series forecasting, in this paper, we focus on the aspect of enhancing multi-scale modeling with the Transformer architecture. Two main challenges limit the effective multi-scale modeling in Transformers. The first challenge is the incompleteness of multi-scale modeling. Viewing the data from different temporal resolutions implicitly influences the scale of the subsequent modeling process (Shabani et al., 2023). However, simply changing temporal resolutions cannot emphasize temporal dependencies in various ranges explicitly and efficiently. On the contrary, considering different temporal distances enables modeling dependencies from different ranges, such as global and local correlations (Li et al., 2019). However, the exact temporal distances of global and local intervals are influenced by the division of data, which is incomplete from a single view of temporal resolution. The second challenge is the fixed multi-scale modeling process. Although multi-scale modeling reaches a more complete understanding of time series, different series prefer different scales depending on their specific temporal characteristics and dynamics. For example, comparing the two series in Figure 1, the series above shows rapid fluctuations, which may imply more attention to fine-grained and short-term characteristics. The series below, on the contrary, may need more focus on coarse-grained and long-term modeling. The fixed multi-scale modeling for all data hinders the grasp of critical patterns of each time series, and manually tuning the optimal scales for a dataset or each time series is time-consuming or intractable. Solving these two challenges calls for adaptive multi-scale modeling, which adaptively models the current data from certain multiple scales.
+
+Inspired by the above understanding of multi-scale modeling, we propose Multi-scale Transformers with Adaptive Pathways (Pathformer) for time series forecasting. To enable the ability of more complete multi-scale modeling, we propose a multi-scale Transformer block unifying multi-scale temporal resolution and temporal distance. Multi-scale division is proposed to divide the time series into patches of different sizes, forming views of diverse temporal resolutions. Based on each size of divided patches, dual attention encompassing inter-patch and intra-patch attention is proposed to capture temporal dependencies, with inter-patch attention capturing global correlations across patches and intra-patch attention capturing local details within individual patches. We further propose adaptive pathways to activate the multi-scale modeling capability and endow it with adaptive modeling characteristics. At each layer of the model, a multi-scale router adaptively selects specific sizes of patch division and the subsequent dual attention in the Transformer based on the input data, which controls the extraction of multi-scale characteristics. We equip the router with trend and seasonality decomposition to enhance its ability to grasp the temporal dynamics. The router works with an aggregator to adaptively combine multi-scale characteristics through weighted aggregation. The layer-by-layer routing and aggregation form the adaptive pathways of multi-scale modeling throughout the Transformer. To the best of our knowledge, this is the first study that introduces adaptive multi-scale modeling for time series forecasting. Specifically, we make the following contributions:
+
+- We propose a multi-scale Transformer architecture. It integrates the two perspectives of temporal resolution and temporal distance and equips the model with the capacity of a more complete multi-scale time series modeling.
+
+- We further propose adaptive pathways within multi-scale Transformers. The multi-scale router with temporal decomposition works together with the aggregator to adaptively extract and aggregate multi-scale characteristics based on the temporal dynamics of input data, realizing adaptive multi-scale modeling for time series.
+- We conduct extensive experiments on different real-world datasets and achieve state-of-the-art prediction accuracy. Moreover, we perform transfer learning experiments across datasets to validate the strong generalization of the model.
+
+# 2 RELATED WORK
+
+Time Series Forecasting. Time series forecasting predicts future observations based on historical observations. Statistical modeling methods based on exponential smoothing and its different flavors serve as a reliable workhorse for time series forecasting (Hyndman & Khandakar, 2008; Li et al., 2022a). Among deep learning methods, GNNs model spatial dependency for correlated time series forecasting (Jin et al., 2023a; Wu et al., 2020; Zhao et al., 2024; Cheng et al., 2024; Miao et al., 2024; Cirstea et al., 2021). RNNs model the temporal dependency (Chung et al., 2014; Kieu et al., 2022a; Wen et al., 2017; Cirstea et al., 2019). DeepAR (Rangapuram et al., 2018) uses RNNs and autoregressive methods to predict future short-term series. CNN models use the temporal convolution to extract the sub-series features (Sen et al., 2019; Liu et al., 2022a; Wang et al., 2023). TimesNet (Wu et al., 2023a) transforms the original one-dimensional time series into a two-dimensional space and captures multi-period features through convolution. LLM-based methods also show effective performance in this field (Jin et al., 2023b; Zhou et al., 2023). Additionally, some methods are incorporating neural architecture search to discover optimal architectures (Wu et al., 2022; 2023b).
+
+Transformer models have recently received emerging attention in time series forecasting (Wen et al., 2023). Informer (Zhou et al., 2021) proposes prob-sparse self-attention to select important keys, Triformer (Cirstea et al., 2022a) employs a triangular architecture, which manages to reduce the complexity. Autoformer (Wu et al., 2021) proposes auto-correlation mechanisms to replace self-attention for modeling temporal dynamics. FEDformer (Zhou et al., 2022) utilizes fourier transformation from the perspective of frequency to model temporal dynamics. However, researchers have raised concerns about the effectiveness of Transformers for time series forecasting, as simple linear models prove to be effective or even outperform previous Transformers (Li et al., 2022a; Challu et al., 2023; Zeng et al., 2023). Meanwhile, PatchTST (Nie et al., 2023) employs patching and channel independence with Transformers to effectively enhance the performance, showing that the Transformer architecture still has its potential with proper adaptation in time series forecasting.
+
+Multi-scale Modeling for Time Series. Modeling multi-scale characteristics proves to be effective for correlation learning and feature extraction in the fields such as computer vision (Wang et al., 2021; Li et al., 2022b; Wang et al., 2022b) and multi-modal learning (Hu et al., 2020; Wang et al., 2022a), which is relatively less explored in time series forecasting. N-HiTS (Challu et al., 2023) employs multi-rate data sampling and hierarchical interpolation to model features of different resolutions. Pyraformer (Liu et al., 2022b) introduces a pyramid attention to extract features at different temporal resolutions. Scaleformer (Shabani et al., 2023) proposes a multi-scale framework, and the need to allocate a predictive model at different temporal resolutions results in higher model complexity. Different from these methods, which use fixed scales and cannot adaptively change the multi-scale modeling for different time series, we propose a multi-scale Transformer with adaptive pathways that adaptively model multi-scale characteristics based on diverse temporal dynamics.
+
+# 3 METHODOLOGY
+
+To effectively capture multi-scale characteristics, we propose multi-scale Transformers with adaptive pathways (named Pathformer). As depicted in Figure 2, the whole forecasting network is composed of Instance Norm, stacking of Adaptive Multi-Scale Blocks (AMS Blocks), and Predictor. Instance Norm (Kim et al., 2022) is a normalization technique employed to address the distribution shift between training and testing data. Predictor is a fully connected neural network, proposed due to its applicability to forecasting for long sequences (Zeng et al., 2023; Das et al., 2023).
+
+The core of our design is the AMS Block for adaptive modeling of multi-scale characteristics, which consists of the multi-scale Transformer block and adaptive pathways. Inspired by the idea of patch-
+
+
+Figure 2: The architecture of Pathformer. The Multi-scale Transformer Block (MST Block) comprises patch division with multiple patch sizes and dual attention. The adaptive pathways select the patch sizes with the top $K$ weights generated by the router to capture multi-scale characteristics, and the selected patch sizes are represented in blue. Then, the aggregator applies weighted aggregation to the characteristics obtained from the MST Block.
+
+ing in Transformers (Nie et al., 2023), the multi-scale Transformer block integrates multi-scale temporal resolutions and distances by introducing patch division with multiple patch sizes and dual attention on the divided patches, equipping the model with the capability to comprehensively model multi-scale characteristics. Based on various options of multi-scale modeling in the Transformer block, adaptive pathways utilize the multi-scale modeling capability and endow it with adaptive modeling characteristics. A multi-scale router selects specific sizes of patch division and the subsequent dual attention in the Transformer based on the input data, which controls the extraction of multi-scale features. The router works with an aggregator to combine these multi-scale characteristics through weighted aggregation. The layer-by-layer routing and aggregation form the adaptive pathways of multi-scale modeling throughout the Transformer blocks. In the following parts, we describe the multi-scale Transformer block and the adaptive pathways of the AMS Block in detail.
+
+# 3.1 MULTI-SCALE TRANSFORMER BLOCK
+
+Multi-scale Division. For the simplicity of notations, we use a univariate time series for description, and the method can be easily extended to multivariate cases by considering each variable independently. In the multi-scale Transformer block, We define a collection of $M$ patch size values as $S = \{S_{1},\ldots ,S_{M}\}$ , with each patch size $S$ corresponding to a patch division operation. For the input time series $\mathrm{X}\in \mathbb{R}^{H\times d}$ , where $H$ denotes the length of the time series and $d$ denotes the dimension of features, each patch division operation with the patch size $S$ divides $\mathrm{X}$ into $P$ (with $P = H / S$ ) patches as $(\mathrm{X}^1,\mathrm{X}^2,\dots,\mathrm{X}^P)$ , where each patch $\mathrm{X}^i\in \mathbb{R}^{S\times d}$ contains $S$ time steps. Different patch sizes in the collection lead to various scales of divided patches and give various views of temporal resolutions for the input series. This multi-scale division works with the dual attention mechanism described below for multi-scale modeling.
+
+Dual Attention. Based on the patch division of each scale, we propose dual attention to model temporal dependencies over the divided patches. To grasp temporal dependencies from different temporal distances, we utilize patch division as guidance for different temporal distances, and the dual attention mechanism consists of intra-patch attention within each divided patch and inter-patch attention across different patches, as shown in Figure 3(a).
+
+Consider a set of patches $(\mathrm{X}^1,\mathrm{X}^2,\ldots ,\mathrm{X}^P)$ divided with the patch size $S$ , intra-patch attention establishes relationships between time steps within each patch. For the $i$ -th patch $\mathrm{X}^i\in \mathbb{R}^{S\times d}$ , we first embed the patch along the feature dimension $d$ to get $X_{\mathrm{intra}}^i\in \mathbb{R}^{S\times d_m}$ , where $d_{m}$ represents the dimension of embedding. Then we perform trainable linear transformations on $\mathrm{X}_{\mathrm{intra}}^i$ to obtain the key and value in attention operations, denoted as $K_{\mathrm{intra}}^i$ , $V_{\mathrm{intra}}^i\in \mathbb{R}^{S\times d_m}$ . We employ a trainable query matrix $Q_{\mathrm{intra}}^i\in \mathbb{R}^{1\times d_m}$ to merge the context of the patch and subsequently compute the
+
+
+(a) Multi-Scale Transformer Block
+
+
+(b) Multi-Scale Router
+
+
+Figure 3: (a) The structure of the Multi-Scale Transformer Block, which mainly consists of Patch Division, Inter-patch attention, and Intra-patch attention. (b) The structure of the Multi-Scale Router.
+
+cross-attention between $Q_{\mathrm{intra}}^i, K_{\mathrm{intra}}^i, V_{\mathrm{intra}}^i$ to model local details within the $i$ -th patch:
+
+$$
+\operatorname {A t t n} _ {\text {i n t r a}} ^ {i} = \operatorname {S o f t m a x} \left(Q _ {\text {i n t r a}} ^ {i} \left(K _ {\text {i n t r a}} ^ {i}\right) ^ {T} / \sqrt {d _ {m}}\right) V _ {\text {i n t r a}} ^ {i}. \tag {1}
+$$
+
+After intra-patch attention, each patch has transitioned from its original input length of $S$ to the length of 1. The attention results from all the patches are concatenated to produce the output of intra-attention on the divided patches as $\mathrm{Attn}_{\mathrm{intra}} \in \mathbb{R}^{P \times d_m}$ , which represents the local details from nearby time steps in the time series:
+
+$$
+\operatorname {A t t n} _ {\text {i n t r a}} = \operatorname {C o n c a t} \left(\operatorname {A t t n} _ {\text {i n t r a}} ^ {1}, \dots , \operatorname {A t t n} _ {\text {i n t r a}} ^ {P}\right). \tag {2}
+$$
+
+Inter-patch attention establishes relationships between patches to capture global correlations. For the patch-divided time series $\mathrm{X} \in \mathbb{R}^{P \times S \times d}$ , we first perform feature embedding along the feature dimension from $d$ to $d_{m}$ and then rearrange the data to combine the two dimensions of patch quantity $S$ and feature embedding $d_{m}$ , resulting in $\mathrm{X}_{\mathrm{inter}} \in \mathbb{R}^{P \times d_{m}^{\prime}}$ , where $d_{m}^{\prime} = S \cdot d_{m}$ . After such embedding and rearranging process, the time steps within the same patch are combined, and thus we perform self-attention over $\mathrm{X}_{\mathrm{inter}}$ to model correlations between patches. Following the standard self-attention protocol, we obtain the query, key, and value through linear mapping on $\mathrm{X}_{\mathrm{inter}}$ , denoted as $Q_{\mathrm{inter}}$ , $K_{\mathrm{inter}}$ , $V_{\mathrm{inter}} \in \mathbb{R}^{P \times d_{m}^{\prime}}$ . Then, we compute the attention Attn inter, which involves interaction between patches and represents the global correlations of the time series:
+
+$$
+\operatorname {A t t n} _ {\text {i n t e r}} = \operatorname {S o f t m a x} \left(Q _ {\text {i n t e r}} \left(K _ {\text {i n t e r}}\right) ^ {T} / \sqrt {d _ {m} ^ {\prime}}\right) V _ {\text {i n t e r}}. \tag {3}
+$$
+
+To fuse global correlations and local details captured by dual attention, we rearrange the outputs of intra-patch attention to $\mathrm{Attn}_{\mathrm{intra}} \in \mathbb{R}^{P \times S \times d_m}$ , performing linear transformations on the patch size dimension from 1 to $S$ , to combine time steps in each patch, and then add it with inter-patch attention $\mathrm{Attn}_{\mathrm{inter}} \in \mathbb{R}^{P \times S \times d_m}$ to obtain the final output of dual attention $\mathrm{Attn} \in \mathbb{R}^{P \times S \times d_m}$ .
+
+Overall, the multi-scale division provides different views of the time series with different patch sizes, and the changing patch sizes further influence the dual attention, which models temporal dependencies from different distances guided by the patch division. These two components work together to enable multiple scales of temporal modeling in the Transformer.
+
+# 3.2 ADAPTIVE PATHWAYS
+
+The design of the multi-scale Transformer block equips the model with the capability of multiscale modeling. However, different series may prefer diverse scales, depending on their specific temporal characteristics and dynamics. Simply applying more scales may bring in redundant or useless signals, and manually tuning the optimal scales for a dataset or each time series is time-consuming or intractable. An ideal model needs to figure out such critical scales based on the input data for more effective modeling and better generalization of unseen data.
+
+Pathways and Mixture of Experts are used to achieve adaptive modeling (Dean, 2021; Shazeer et al., 2016). Based on these concepts, we propose adaptive pathways based on multi-scale Transformer to model adaptive multi-scale, depicted in Figure 2. It contains two main components: the multi-scale router and the multi-scale aggregator. The multi-scale router selects specific sizes of patch division based on the input data, which activates specific parts in the Transformer and controls the extraction of multi-scale characteristics. The router works with the multi-scale aggregator to combine these characteristics through weighted aggregation, obtaining the output of the Transformer block.
+
+Multi-Scale Router. The multi-scale router enables data-adaptive routing in the multi-scale Transformer, which selects the optimal sizes for patch division and thus controls the process of multi-scale modeling. Since the optimal or critical scales for each time series can be impacted by its complex inherent characteristics and dynamic patterns, like the periodicity and trend, we introduce a temporal decomposition module in the router that encompasses both seasonality and trend decomposition to extract periodicity and trend patterns, as illustrated in Figure 3(b).
+
+Seasonality decomposition involves transforming the time series from the temporal domain into the frequency domain to extract the periodic patterns. We utilize the Discern Fourier Transform (DFT) (Cooley & Tukey, 1965), denoted as $\mathrm{DFT}(\cdot)$ , to decompose the input X into Fourier basis and select the $K_{f}$ basis with the largest amplitudes to keep the sparsity of frequency domain. Then, we obtain the periodic patterns $\mathrm{X}_{\mathrm{sea}}$ through an inverse DFT, denoted as $\mathrm{IDFT}(\cdot)$ . The process is as follows:
+
+$$
+\mathrm {X} _ {\text {s e a}} = \operatorname {I D F T} \left(\left\{f _ {1}, \dots , f _ {K _ {f}} \right\}, A, \Phi\right), \tag {4}
+$$
+
+where $\Phi$ and $A$ represent the phase and amplitude of each frequency from DFT(X), $\{f_1,\dots ,f_{K_f}\}$ represents the frequencies with the top $K_{f}$ amplitudes. Trend decomposition uses different kernels of average pooling for moving averages to extract trend patterns based on the remaining part after the seasonality decomposition $\mathrm{X}_{\mathrm{rem}} = \mathrm{X} - \mathrm{X}_{\mathrm{sea}}$ . For the results obtained from different kernels, a weighted operation is applied to obtain the representation of the trend component:
+
+$$
+\mathrm {X} _ {\text {t r e n d}} = \operatorname {S o f t m a x} \left(L \left(\mathrm {X} _ {\text {r e m}}\right)\right) \cdot \left(\operatorname {A v g p o o l} \left(\mathrm {X} _ {\text {r e m}}\right) _ {\text {k e r n e l} _ {1}}, \dots , \operatorname {A v g p o o l} \left(\mathrm {X} _ {\text {r e m}}\right) _ {\text {k e r n e l} _ {N}}\right), \tag {5}
+$$
+
+where $\mathrm{Avgpool}(\cdot)_{\mathrm{kernel}_i}$ is the pooling function with the $i$ -th kernel, $N$ corresponds to the number of kernels, $\mathrm{Softmax}(L(\cdot))$ controls the weights for the results from different kenerls. We add the seasonality pattern and trend pattern with the original input X, and then perform a linear mapping $\mathrm{Linear}(\cdot)$ to transform and merge them along the temporal dimension to get $\mathrm{X}_{\mathrm{trans}} \in \mathbb{R}^d$ .
+
+Based on the results $\mathrm{X}_{\mathrm{trans}}$ from temporal decomposition, the router employs a routing function to generate the pathway weights, which determines the patch sizes to choose for the current data. To avoid consistently selecting a few patch sizes, causing the corresponding scales to be repeatedly updated while neglecting other potentially useful scales in the multi-scale Transformer, we introduce noise terms to add randomness in the weight generation process. The whole process of generating pathway weights is as follows:
+
+$$
+R \left(\mathrm {X} _ {\text {t r a n s}}\right) = \operatorname {S o f t m a x} \left(\mathrm {X} _ {\text {t r a n s}} W _ {r} + \epsilon \cdot \operatorname {S o f t p l u s} \left(\mathrm {X} _ {\text {t r a n s}} W _ {\text {n o i s e}}\right)\right), \epsilon \sim \mathcal {N} (0, 1), \tag {6}
+$$
+
+where $R(\cdot)$ represents the whole routing function, $W_{r}$ and $W_{\mathrm{noise}} \in \mathbb{R}^{d \times M}$ are learnable parameters for weight generation, with $d$ denoting the feature dimension of $\mathrm{X}_{\mathrm{trans}}$ and $M$ denoting the number of patch sizes. To introduce sparsity in the routing and encourage the selection of critical scales, we perform top $K$ selection on the pathway weights, keeping the top $K$ pathway weights and setting the rest weights as 0, and denote the final result as $\bar{R}(\mathrm{X}_{\mathrm{trans}})$ .
+
+Multi-Scale Aggregator. Each dimension of the generated pathway weights $\bar{R} (\mathrm{X}_{\mathrm{trans}})\in \mathbb{R}^{M}$ correspond to a patch size in the multi-scale Transformer, with $\bar{R} (\mathrm{X}_{\mathrm{trans}})_i > 0$ indicating performing this size $S_{i}$ of patch division and the dual attention and $\bar{R} (\mathrm{X}_{\mathrm{trans}})_i = 0$ indicating ignoring this patch size for the current data. Let $\mathrm{X}_{\mathrm{out}}^i$ denote the output of the multi-scale Transformer with the patch size $S_{i}$ , due to the varying temporal dimensions produced by different patch sizes, the aggregator first performs a transformation function $T_{i}(\cdot)$ to align the temporal dimension from different scales. Then, the aggregator performs weighted aggregation for the multi-scale outputs based on the pathway weights to get the final output of this AMS block:
+
+$$
+\mathrm {X} _ {\text {o u t}} = \sum_ {i = 1} ^ {M} \mathcal {I} (\bar {R} \left(\mathrm {X} _ {\text {t r a n s}}\right) _ {i} > 0) R \left(\mathrm {X} _ {\text {t r a n s}}\right) _ {i} T _ {i} \left(\mathrm {X} _ {\text {o u t}} ^ {i}\right). \tag {7}
+$$
+
+$\mathcal{I}(\bar{R} (\mathrm{X}_{\mathrm{trans}})_i > 0)$ is the indicator function which outputs 1 when $\bar{R} (\mathrm{X}_{\mathrm{trans}})_i > 0$ , and otherwise outputs 0, indicating that only the top $K$ patch sizes and the corresponding outputs from the Transformer are considered or needed during aggregation.
+
+# 4 EXPERIMENTS
+
+# 4.1 TIME SERIES FORECASTING
+
+Datasets. We conduct experiments on nine real-world datasets to assess the performance of Pathformer, encompassing a range of domains, including electricity transportation, weather forecasting, and cloud computing. These datasets include ETT (ETTh1, ETTh2, ETTm1, ETTm2), Weather, Electricity, Traffic, ILI, and Cloud Cluster (Cluster-A, Cluster-B, Cluster-C).
+
+Baselines and Metrics. We choose some state-of-the-art models to serve as baselines, including PatchTST (Nie et al., 2023), NLinear (Zeng et al., 2023), Scaleformer (Shabani et al., 2023), TIDE (Das et al., 2023), FEDformer (Zhou et al., 2022), Pyraformer (Liu et al., 2022b), and Autoformer (Wu et al., 2021). To ensure fair comparisons, all models follow the same input length ( $H = 36$ for the ILI dataset and $H = 96$ for others) and prediction length ( $F \in \{24, 49, 96, 192\}$ for Cloud Cluster datasets, $F \in \{24, 36, 48, 60\}$ for ILI dataset and $F \in \{96, 192, 336, 720\}$ for others). We select two common metrics in time series forecasting: Mean Absolute Error (MAE) and Mean Squared Error (MSE).
+
+Implementation Details. Pathformer utilizes the Adam optimizer (Kingma & Ba, 2015) with a learning rate set at $10^{-3}$ . The default loss function employed is L1 Loss, and we implement early stopping within 10 epochs during the training process. All experiments are conducted using PyTorch and executed on an NVIDIA A800 80GB GPU. Pathformer is composed of 3 Adaptive Multi-Scale Blocks (AMS Blocks). Each AMS Block contains 4 different patch sizes. These patch sizes are selected from a pool of commonly used options, namely $\{2, 3, 6, 12, 16, 24, 32\}$ .
+
+Main Results. Table 1 shows the prediction results of multivariable time series forecasting, where Pathformer stands out with the best performance in 81 cases and the second-best in 5 cases out of the overall 88 cases. Compared with the second-best baseline, PatchTST, Pathformer demonstrates a significant improvement, with an impressive $8.1\%$ reduction in MSE and a $6.4\%$ reduction in MAE. Compared with the strong linear models NLinear, Pathformer also outperforms them comprehensively, especially on large datasets such as Electricity and Traffic. This demonstrates the potential of Transformer architecture for time series forecasting. Compared with the multi-scale models Pyraformer and Scaleformer, Pathformer exhibits good performance improvements, with a substantial $36.4\%$ reduction in MSE and a $19.1\%$ reduction in MAE. This illustrates that the proposed comprehensive modeling from both temporal resolution and temporal distance with adaptive pathways is more effective for multi-scale modeling.
+
+# 4.2 TRANSFER LEARNING
+
+Experimental Setting. To assess the transferability of Pathformer, we benchmark it against three baselines: PatchTST, FEDformer, and Autoformer, devising two distinct transfer experiments. In the context of evaluating transferability across different datasets, models initially undergo pre-training on the ETTh1 and ETTm1. Subsequently, we fine-tune them using the ETTh2 and ETTm2. For assessing transferability towards future data, models are pre-trained on the first $70\%$ of the training data sourced from three clusters: Cluster-A, Cluster-B, and Cluster-C. This pre-training is followed by fine-tuning the remaining $30\%$ of the training data specific to each cluster. In terms of methodology for baselines, we explore two approaches: direct prediction (zero-shot) and full-tuning. Deviating from these approaches, Pathformer integrates a part-tuning strategy. In this approach, specific parameters, like those of the router network, undergo fine-tuning, resulting in a significant reduction in computational resource demands.
+
+Transfer Learning Results. Table 2 presents the outcomes of our transfer learning evaluation. Across both direct prediction and full-tuning methods, Pathformer surpasses the baseline models, highlighting its enhanced generalization and transferability. One of the key strengths of Pathformer lies in its adaptive capacity to select varying scales for different temporal dynamics. This adaptability allows it to effectively capture complex temporal patterns present in diverse datasets, consequently demonstrating superior generalization and transferability. Part-tuning is a lightweight fine-tuning method that demands fewer computational resources and reduces training time on average by $52\%$ , while still achieving prediction accuracy nearly comparable to Pathformer full-tuning. Moreover, it outperforms the full-tuning of other baseline models on the majority of datasets. This demonstrates that Pathformer can provide effective lightweight transfer learning for time series forecasting.
+
+Table 1: Multivariate time series forecasting results. The input length $H = 96$ ( $H = 36$ for ILI). The best results are highlighted in bold, and the second-best results are underlined.
+
+
Method
Pathformer
PatchTST
NLinear
Scaleformer
TiDE
FEDformer
Pyraformer
Autoformer
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
96
0.382
0.400
0.394
0.408
0.386
0.392
0.396
0.440
0.427
0.450
0.376
0.419
0.664
0.612
0.449
0.459
192
0.440
0.427
0.446
0.438
0.440
0.430
0.434
0.460
0.472
0.486
0.420
0.448
0.790
0.681
0.500
0.482
336
0.454
0.432
0.485
0.455
0.480
0.443
0.462
0.476
0.527
0.527
0.459
0.465
0.891
0.738
0.521
0.496
720
0.479
0.461
0.495
0.474
0.486
0.472
0.494
0.500
0.644
0.605
0.506
0.507
0.963
0.782
0.514
0.512
ETTh2
96
0.279
0.331
0.294
0.343
0.290
0.339
0.364
0.407
0.304
0.359
0.346
0.388
0.645
0.597
0.358
0.397
192
0.349
0.380
0.378
0.394
0.379
0.395
0.466
0.458
0.394
0.422
0.429
0.439
0.788
0.683
0.456
0.452
336
0.348
0.382
0.382
0.410
0.421
0.431
0.479
0.476
0.385
0.421
0.496
0.487
0.907
0.747
0.482
0.486
720
0.398
0.424
0.412
0.433
0.436
0.453
0.487
0.492
0.463
0.475
0.463
0.474
0.963
0.783
0.515
0.511
ETTm1
96
0.316
0.346
0.324
0.361
0.339
0.369
0.355
0.398
0.356
0.381
0.379
0.419
0.543
0.510
0.505
0.475
192
0.366
0.370
0.362
0.383
0.379
0.386
0.428
0.455
0.391
0.399
0.426
0.441
0.557
0.537
0.553
0.496
336
0.386
0.394
0.390
0.402
0.411
0.407
0.524
0.487
0.424
0.423
0.445
0.459
0.754
0.655
0.621
0.537
720
0.460
0.432
0.461
0.438
0.478
0.442
0.558
0.517
0.480
0.456
0.543
0.490
0.908
0.724
0.671
0.561
ETTm2
96
0.170
0.248
0.177
0.260
0.177
0.257
0.182
0.275
0.182
0.264
0.203
0.287
0.435
0.507
0.255
0.339
192
0.238
0.295
0.248
0.306
0.241
0.297
0.251
0.318
0.256
0.323
0.269
0.328
0.730
0.673
0.281
0.340
336
0.293
0.331
0.304
0.342
0.302
0.337
0.340
0.375
0.313
0.354
0.325
0.366
1.201
0.845
0.339
0.372
720
0.390
0.389
0.403
0.397
0.405
0.396
0.435
0.433
0.419
0.410
0.421
0.415
3.625
1.451
0.433
0.432
Weather
96
0.156
0.192
0.177
0.218
0.168
0.208
0.288
0.365
0.202
0.261
0.238
0.314
0.896
0.556
0.249
0.329
192
0.206
0.240
0.224
0.258
0.217
0.255
0.368
0.425
0.242
0.298
0.275
0.329
0.622
0.624
0.325
0.370
336
0.254
0.282
0.277
0.297
0.267
0.292
0.447
0.469
0.287
0.335
0.339
0.377
0.739
0.753
0.351
0.391
720
0.340
0.336
0.350
0.345
0.351
0.346
0.640
0.574
0.351
0.386
0.389
0.409
1.004
0.934
0.415
0.426
Electricity
96
0.145
0.236
0.180
0.264
0.185
0.266
0.182
0.297
0.194
0.277
0.186
0.302
0.386
0.449
0.196
0.313
192
0.167
0.256
0.188
0.275
0.189
0.276
0.188
0.300
0.193
0.280
0.197
0.311
0.386
0.443
0.211
0.324
336
0.186
0.275
0.206
0.291
0.204
0.289
0.210
0.324
0.206
0.296
0.213
0.328
0.378
0.443
0.214
0.327
720
0.231
0.309
0.247
0.328
0.245
0.319
0.232
0.339
0.242
0.328
0.233
0.344
0.376
0.445
0.236
0.342
ILI
24
1.587
0.758
1.724
0.843
2.725
1.069
0.232
0.339
2.154
0.992
2.624
1.095
1.420
2.012
2.906
1.182
36
1.429
0.711
1.536
0.752
2.530
1.032
2.745
1.075
2.436
1.042
2.516
1.021
7.394
2.031
2.585
1.038
48
1.505
0.742
1.821
0.832
2.510
1.031
2.748
1.072
2.532
1.051
2.505
1.041
7.551
2.057
3.024
1.145
60
1.731
0.799
1.923
0.842
2.492
1.026
2.793
1.059
2.748
1.142
2.742
1.122
7.662
2.100
2.761
1.114
Traffic
96
0.479
0.283
0.492
0.324
0.645
0.388
2.678
1.071
0.568
0.352
0.576
0.359
2.085
0.468
0.597
0.371
192
0.484
0.292
0.487
0.303
0.599
0.365
0.564
0.351
0.612
0.371
0.610
0.380
0.867
0.467
0.607
0.382
336
0.503
0.299
0.505
0.317
0.606
0.367
0.570
0.349
0.605
0.374
0.608
0.375
0.869
0.469
0.623
0.387
720
0.537
0.322
0.542
0.337
0.645
0.388
0.576
0.349
0.647
0.410
0.621
0.375
0.881
0.473
0.639
0.395
Cluster-A
24
0.100
0.205
0.126
0.234
0.134
0.235
0.128
0.247
0.128
0.244
0.131
0.260
0.131
0.268
0.372
0.461
48
0.160
0.264
0.208
0.302
0.214
0.310
0.182
0.319
0.192
0.299
0.175
0.307
0.170
0.311
0.390
0.471
96
0.227
0.321
0.313
0.372
0.335
0.410
0.274
0.328
0.247
0.338
0.293
0.349
0.243
0.375
0.466
0.514
192
0.349
0.400
0.452
0.453
0.442
0.452
0.372
0.451
0.356
0.422
0.350
0.439
0.378
0.437
0.585
0.584
Cluster-B
24
0.121
0.224
0.126
0.237
0.130
0.241
0.125
0.241
0.128
0.240
0.128
0.243
0.129
0.263
0.242
0.369
48
0.172
0.270
0.183
0.290
0.173
0.285
0.164
0.280
0.165
0.288
0.156
0.287
0.168
0.296
0.299
0.425
96
0.242
0.322
0.272
0.352
0.281
0.365
0.252
0.342
0.244
0.334
0.277
0.389
0.315
0.436
0.366
0.471
192
0.437
0.427
0.476
0.461
0.479
0.456
0.438
0.447
0.452
0.467
0.414
0.478
0.389
0.485
0.597
0.563
Cluster-C
24
0.064
0.169
0.075
0.188
0.100
0.205
0.074
0.204
0.082
0.199
0.076
0.212
0.107
0.247
0.189
0.341
48
0.102
0.218
0.118
0.241
0.163
0.286
0.110
0.242
0.121
0.266
0.108
0.246
0.142
0.284
0.210
0.363
96
0.162
0.276
0.188
0.305
0.245
0.318
0.177
0.321
0.201
0.305
0.171
0.323
0.181
0.328
0.289
0.421
192
0.304
0.369
0.354
0.413
0.375
0.457
0.326
0.428
0.341
0.424
0.338
0.453
0.332
0.396
0.419
0.511
+
+Table 2: Transfer Learning results. The best results are in bold, and the second results are underlined.
+
+
Mdoels
Predict
Pathformer Part-tuning
Full-tuning
PatchTST
FEDformer
Autoformer
Predict
Full-tuning
Predict
Full-tuning
Predict
Full-tuning
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh2
96
0.340
0.369
0.287
0.333
0.276
0.328
0.346
0.369
0.287
0.337
0.420
0.449
0.326
0.337
0.397
0.439
0.342
0.386
192
0.411
0.406
0.358
0.382
0.350
0.376
0.422
0.420
0.366
0.385
0.475
0.475
0.409
0.430
0.543
0.511
0.415
0.428
336
0.384
0.401
0.342
0.384
0.337
0.374
0.408
0.419
0.377
0.405
0.416
0.446
0.378
0.416
0.521
0.515
0.415
0.442
720
0.450
0.448
0.416
0.437
0.401
0.426
0.479
0.467
0.410
0.432
0.529
0.517
0.46
0.487
0.694
0.602
0.452
0.469
ETTm2
96
0.220
0.294
0.181
0.260
0.172
0.251
0.189
0.284
0.177
0.261
0.256
0.378
0.201
0.285
0.331
0.406
0.212
0.293
192
0.258
0.306
0.240
0.299
0.237
0.294
0.263
0.322
0.243
0.304
0.427
0.441
0.266
0.324
0.435
0.461
0.275
0.331
336
0.325
0.350
0.305
0.339
0.302
0.334
0.332
0.365
0.305
0.339
0.429
0.448
0.335
0.369
0.506
0.501
0.333
0.370
720
0.422
0.408
0.406
0.398
0.391
0.392
0.429
0.419
0.405
0.395
0.530
0.503
0.423
0.417
0.680
0.573
0.444
0.433
Cluster-A
24
0.121
0.223
0.100
0.205
0.097
0.202
0.143
0.250
0.115
0.221
0.200
0.326
0.171
0.298
0.382
0.471
0.349
0.445
48
0.186
0.281
0.159
0.261
0.144
0.254
0.231
0.322
0.192
0.289
0.240
0.360
0.219
0.342
0.372
0.463
0.362
0.450
96
0.249
0.334
0.215
0.313
0.193
0.302
0.350
0.396
0.290
0.359
0.326
0.418
0.299
0.392
0.395
0.490
0.375
0.432
192
0.372
0.416
0.312
0.381
0.292
0.371
0.524
0.491
0.406
0.433
0.381
0.463
0.338
0.432
0.948
0.761
0.592
0.602
Cluster-B
24
0.140
0.243
0.120
0.226
0.117
0.221
0.145
0.248
0.124
0.231
0.167
0.283
0.147
0.271
0.226
0.342
0.192
0.318
48
0.202
0.298
0.174
0.275
0.170
0.270
0.207
0.306
0.178
0.282
0.225
0.310
0.162
0.283
0.247
0.361
0.234
0.354
96
0.296
0.357
0.253
0.327
0.244
0.321
0.298
0.365
0.264
0.242
0.347
0.427
0.318
0.408
0.307
0.430
0.280
0.399
192
0.464
0.468
0.441
0.425
0.425
0.420
0.529
0.495
0.471
0.463
0.528
0.497
0.434
0.478
0.618
0.614
0.584
0.578
Cluster-C
24
0.069
0.173
0.064
0.166
0.062
0.165
0.074
0.184
0.072
0.182
0.109
0.243
0.097
0.229
0.212
0.344
0.194
0.332
48
0.144
0.254
0.104
0.219
0.101
0.215
0.138
0.246
0.115
0.233
0.150
0.285
0.118
0.260
0.228
0.366
0.214
0.362
96
0.174
0.284
0.166
0.275
0.162
0.272
0.194
0.303
0.182
0.298
0.228
0.342
0.190
0.325
0.281
0.436
0.263
0.405
192
0.327
0.386
0.316
0.374
0.301
0.365
0.376
0.413
0.349
0.407
0.344
0.444
0.332
0.441
0.508
0.537
0.417
0.507
+
+# 4.3 ABLATION STUDIES
+
+To ascertain the impact of different modules within Pathformer, we perform ablation studies focusing on inter-patch attention, intra-patch attention, time series decomposition, and Pathways. The W/O Pathways configuration entails using all patch sizes from the patch size pool for every dataset, eliminating adaptive selection. Table 3 illustrates the unique impact of each module. The influence of Pathways is significant; omitting them results in a marked decrease in prediction accuracy. This emphasizes the criticality of optimizing the mix of patch sizes to extract multi-scale characteristics, thus markedly improving the model's prediction accuracy. Regarding efficiency, intra-patch attention is notably adept at discerning local patterns, contrasting with inter-patch attention which primarily captures wider global patterns. The time series decomposition module decomposes trend
+
+Table 3: Ablation study. W/O Inter, W/O Intra, W/O Decompose represent removing the inter-patch attention, intra-patch attention, and time series decomposition, respectively.
+
+
Models
W/O Inter
W/O Intra
W/O Decompose
W/O Pathways
Pathformer
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
Weather
96
0.162
0.196
0.170
0.203
0.162
0.198
0.168
0.204
0.156
0.192
192
0.219
0.248
0.220
0.249
0.212
0.244
0.219
0.250
0.206
0.240
336
0.262
0.290
0.272
0.292
0.256
0.285
0.269
0.290
0.254
0.282
720
0.350
0.349
0.358
0.357
0.344
0.340
0.349
0.348
0.340
0.336
Electricity
96
0.166
0.259
0.182
0.264
0.152
0.244
0.168
0.256
0.145
0.236
192
0.185
0.270
0.193
0.275
0.176
0.264
0.185
0.272
0.167
0.256
336
0.216
0.301
0.214
0.297
0.195
0.281
0.210
0.296
0.186
0.275
720
0.239
0.322
0.253
0.327
0.235
0.316
0.254
0.332
0.231
0.309
+
+Table 4: Parameter sensitivity study. The prediction accuracy varies with $K$ .
+
+
Metric
K=1
K=2
K=3
K=4
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh2
96
0.283
0.333
0.279
0.331
0.286
0.337
0.282
0.333
192
0.357
0.380
0.349
0.380
0.354
0.383
0.359
0.384
336
0.342
0.379
0.348
0.382
0.338
0.377
0.347
0.380
720
0.411
0.430
0.398
0.424
0.406
0.428
0.407
0.432
Electricity
96
0.162
0.247
0.145
0.236
0.147
0.238
0.152
0.244
192
0.175
0.260
0.167
0.256
0.176
0.265
0.178
0.266
336
0.192
0.278
0.186
0.275
0.181
0.274
0.190
0.277
720
0.234
0.311
0.231
0.309
0.230
0.308
0.235
0.313
+
+and periodic patterns to improve the ability to capture the temporal dynamics of its input, assisting in the identification of appropriate patch sizes for combination.
+
+Varying the Number of Adaptively Selected Patch Sizes. Pathformer adaptively selects the top $K$ patch sizes for combination, adjusting to different time series samples. We evaluate the influence of different $K$ values on prediction accuracy in Table 4. Our findings show that $K = 2$ and $K = 3$ yield better results than $K = 1$ and $K = 4$ , highlighting the advantage of adaptively modeling critical multi-scale characteristics for improved accuracy. Additionally, distinct time series samples benefit from feature extraction using varied patch sizes, but not all patch sizes are equally effective.
+
+Visualization of Pathways Weights. We show three samples and depict their average Pathways weights for each patch size in Figure 4. Our observations reveal that the samples possess unique Pathways weight distributions. Both Samples 1 and 2, which demonstrate longer seasonality and similar trend patterns, show similar visualized Pathways weights. This manifests in the higher weights they attribute to the larger patch sizes. On the other hand, Sample 3, which is characterized by its shorter seasonality pattern, aligns with higher weights for the smaller patch sizes. These observations underscore Pathformer's adaptability, emphasizing its ability to discern and apply the optimal patch size combinations for the diverse seasonality and trend patterns across samples.
+
+
+Figure 4: The average pathways weights of different patch sizes for the Weather. $B_{1}$ , $B_{2}$ , and $B_{3}$ denote distinct AMS (Adaptive Multi-Scale) blocks, while $S_{1}$ , $S_{2}$ , $S_{3}$ , and $S_{4}$ represent varying patch sizes within each AMS block, with patch size decreasing sequentially.
+
+
+
+
+
+
+
+# 5 CONCLUSION
+
+In this paper, we propose Pathformer, a Multi-Scale Transformer with Adaptive Pathways for time series forecasting. It integrates multi-scale temporal resolutions and temporal distances by introducing patch division with multiple patch sizes and dual attention on the divided patches, enabling the comprehensive modeling of multi-scale characteristics. Furthermore, adaptive pathways dynamically select and aggregate scale-specific characteristics based on the different temporal dynamics. These innovative mechanisms collectively empower Pathformer to achieve outstanding prediction performance and demonstrate strong generalization capability on several forecasting tasks.
+
+# ACKNOWLEDGMENTS
+
+This work was supported by National Natural Science Foundation of China (62372179) and Alibaba Innovative Research Program.
+
+# REFERENCES
+
+Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
+David Campos, Tung Kieu, Chenjuan Guo, Feiteng Huang, Kai Zheng, Bin Yang, and Christian S. Jensen. Unsupervised time series outlier detection with diversity-driven convolutional ensembles. Proceedings of the VLDB Endowment, 2022.
+Cristian Challu, Kin G. Olivares, Boris N. Oreshkin, Federico Garza Ramírez, Max Mergenthaler Canseco, and Artur Dubrawski. NHITS: neural hierarchical interpolation for time series forecasting. In Association for the Advancement of Artificial Intelligence (AAAI), 2023.
+Cathy WS Chen, Richard Gerlach, Edward MH Lin, and WCW Lee. Bayesian forecasting for financial risk management, pre and post the global financial crisis. Journal of Forecasting, 2012.
+Weiqi Chen, Wenwei Wang, Bingqing Peng, Qingsong Wen, Tian Zhou, and Liang Sun. Learning to rotate: Quaternion transformer for complicated periodical time series forecasting. In International Conference on Knowledge Discovery & Data Mining (KDD), 2022.
+Yunyao Cheng, Peng Chen, Chenjuan Guo, Kai Zhao, Qingsong Wen, Bin Yang, and Christian S. Jensen. Weakly guided adaptation for robust time series forecasting. Proceedings of the VLDB Endowment, 2024.
+Junyoung Chung, Caglar Gülcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. CoRR, 2014.
+Razvan-Gabriel Cirstea, Bin Yang, and Chenjuan Guo. Graph attention recurrent neural networks for correlated time series forecasting. In International Conference on Knowledge Discovery & Data Mining (KDD), 2019.
+Razvan-Gabriel Cirstea, Tung Kieu, Chenjuan Guo, Bin Yang, and Sinno Jialin Pan. EnhanceNet: Plugin neural networks for enhancing correlated time series forecasting. In IEEE International Conference on Data Engineering (ICDE), 2021.
+Razvan-Gabriel Cirstea, Chenjuan Guo, Bin Yang, Tung Kieu, Xuanyi Dong, and Shirui Pan. Triformer: Triangular, variable-specific attentions for long sequence multivariate time series forecasting. In International Joint Conference on Artificial Intelligence (IJCAI), 2022a.
+Razvan-Gabriel Cirstea, Bin Yang, Chenjuan Guo, Tung Kieu, and Shirui Pan. Towards spatiotemporal aware traffic time series forecasting. In IEEE International Conference on Data Engineering (ICDE), 2022b.
+James W Cooley and John W Tukey. An algorithm for the machine calculation of complex fourier series. Mathematics of computation, 1965.
+Abhimanyu Das, Weihao Kong, Andrew Leach, Rajat Sen, and Rose Yu. Long-term forecasting with tide: Time-series dense encoder. arXiv, 2023.
+Jeff Dean. Introducing pathways: A next-generation ai architecture, 2021.
+
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021.
+Marco AR Ferreira, David M Higdon, Herbert KH Lee, and Mike West. Multi-scale and hidden resolution time series models. 2006.
+Ronghang Hu, Amanpreet Singh, Trevor Darrell, and Marcus Rohrbach. Iterative answer prediction with pointer-augmented multimodal transformers for textvqa. In Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
+Rob J Hyndman and Yeasmin Khandakar. Automatic time series forecasting: the forecast package for r. Journal of statistical software, 2008.
+Ming Jin, Huan Yee Koh, Qingsong Wen, Daniele Zambon, Cesare Alippi, Geoffrey I Webb, Irwin King, and Shirui Pan. A survey on graph neural networks for time series: Forecasting, classification, imputation, and anomaly detection. arXiv, 2023a.
+Ming Jin, Shiyu Wang, Lintao Ma, Zhixuan Chu, James Y Zhang, Xiaoming Shi, Pin-Yu Chen, Yuxuan Liang, Yuan-Fang Li, Shirui Pan, et al. Time-LLM: Time series forecasting by reprogramming large language models. arXiv, 2023b.
+Tung Kieu, Bin Yang, Chenjuan Guo, Razvan-Gabriel Cirstea, Yan Zhao, Yale Song, and Christian S. Jensen. Anomaly detection in time series with robust variational quasi-recurrent autoencoders. In IEEE International Conference on Data Engineering (ICDE), 2022a.
+Tung Kieu, Bin Yang, Chenjuan Guo, Christian S. Jensen, Yan Zhao, Feiteng Huang, and Kai Zheng. Robust and explainable autoencoders for unsupervised time series outlier detection. In IEEE International Conference on Data Engineering (ICDE), 2022b.
+Taesung Kim, Jinhee Kim, Yunwon Tae, Cheonbok Park, Jang-Ho Choi, and Jaegul Choo. Reversible instance normalization for accurate time-series forecasting against distribution shift. In International Conference on Learning Representations (ICLR), 2022.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), International Conference on Learning Representations (ICLR), 2015.
+Hao Li, Jie Shao, Kewen Liao, and Mingjian Tang. Do simpler statistical methods perform better in multivariate long sequence time-series forecasting? In International Conference on Information & Knowledge Management (CIKM), 2022a.
+Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
+Yanghao Li, Chao-Yuan Wu, Haoqi Fan, Karttikeya Mangalam, Bo Xiong, Jitendra Malik, and Christoph Feichtenhofer. Mvitv2: Improved multiscale vision transformers for classification and detection. In Conference on Computer Vision and Pattern Recognition (CVPR), 2022b.
+Minhao Liu, Ailing Zeng, Muxi Chen, Zhijian Xu, Qiuxia Lai, Lingna Ma, and Qiang Xu. Scinet: Time series modeling and forecasting with sample convolution and interaction. In Advances in Neural Information Processing Systems (NeurIPS), 2022a.
+Shizhan Liu, Hang Yu, Cong Liao, Jianguo Li, Weiyao Lin, Alex X. Liu, and Schahram Dustdar. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting. In International Conference on Learning Representations (ICLR), 2022b.
+Yong Liu, Haixu Wu, Jianmin Wang, and Mingsheng Long. Non-stationary transformers: Exploring the stationarity in time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2022c.
+Yu Ma, Bin Yang, and Christian S. Jensen. Enabling time-dependent uncertain eco-weights for road networks. In Proceedings of the ACM on Management of Data, 2014.
+
+Hao Miao, Yan Zhao, Chenjuan Guo, Bin Yang, Zheng Kai, Feiteng Huang, Jiandong Xie, and Christian S. Jensen. A unified replay-based continuous learning framework for spatio-temporal prediction on streaming data. In IEEE International Conference on Data Engineering (ICDE), 2024.
+Michael Mozer. Induction of multiscale temporal structure. In Advances in Neural Information Processing Systems (NeurIPS), 1991.
+Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. A time series is worth 64 words: Long-term forecasting with transformers. In International Conference on Learning Representations (ICLR), 2023.
+Zhicheng Pan, Yihang Wang, Yingying Zhang, Sean Bin Yang, Yunyao Cheng, Peng Chen, Chenjuan Guo, Qingsong Wen, Xiduo Tian, Yunliang Dou, et al. Magicscaler: Uncertainty-aware, predictive autoscaling. Proceedings of the VLDB Endowment, 2023.
+Simon Aagaard Pedersen, Bin Yang, and Christian S. Jensen. Anytime stochastic routing with hybrid learning. Proceedings of the VLDB Endowment, 2020.
+Syama Sundar Rangapuram, Matthias W. Seeger, Jan Gasthaus, Lorenzo Stella, Yuyang Wang, and Tim Januschowski. Deep state space models for time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
+Rajat Sen, Hsiang-Fu Yu, and Inderjit S. Dhillon. Think globally, act locally: A deep neural network approach to high-dimensional time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
+Mohammad Amin Shabani, Amir H. Abdi, Lili Meng, and Tristan Sylvain. Scaleformer: Iterative multi-scale refining transformers for time series forecasting. In International Conference on Learning Representations (ICLR), 2023.
+Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In International Conference on Learning Representations (ICLR), 2016.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems (NeurIPS), 2017.
+Huiqiang Wang, Jian Peng, Feihu Huang, Jince Wang, Junhui Chen, and Yifei Xiao. MICN: multiscale local and global context modeling for long-term series forecasting. In International Conference on Learning Representations (ICLR), 2023.
+Junke Wang, Zuxuan Wu, Wenhao Ouyang, Xintong Han, Jingjing Chen, Yu-Gang Jiang, and Ser-Nam Lim. M2TR: multi-modal multi-scale transformers for deepfake detection. In International Conference on Multimedia Retrieval (ICMR), 2022a.
+Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In International Conference on Computer Vision (ICCV), 2021.
+Wenxiao Wang, Lu Yao, Long Chen, Binbin Lin, Deng Cai, Xiaofei He, and Wei Liu. Crossformer: A versatile vision transformer hinging on cross-scale attention. In International Conference on Learning Representations (ICLR), 2022b.
+Qingsong Wen, Tian Zhou, Chaoli Zhang, Weiqi Chen, Ziqing Ma, Junchi Yan, and Liang Sun. Transformers in time series: A survey. In International Joint Conference on Artificial Intelligence (IJCAI), 2023.
+Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A multi-horizon quantile recurrent forecaster. arXiv, 2017.
+
+Haixu Wu, Jiehui Xu, Jianmin Wang, and Mingsheng Long. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
+Haixu Wu, Tengge Hu, Yong Liu, Hang Zhou, Jianmin Wang, and Mingsheng Long. Timesnet: Temporal 2d-variation modeling for general time series analysis. In International Conference on Learning Representations (ICLR), 2023a.
+Xinle Wu, Dalin Zhang, Chenjuan Guo, Chaoyang He, Bin Yang, and Christian S. Jensen. AutoCTS: Automated correlated time series forecasting. Proceedings of the VLDB Endowment, 2022.
+Xinle Wu, Dalin Zhang, Miao Zhang, Chenjuan Guo, Bin Yang, and Christian S. Jensen. AutoCTS+: Joint neural architecture and hyperparameter search for correlated time series forecasting. Proceedings of the ACM on Management of Data, 2023b.
+Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, Xiaojun Chang, and Chengqi Zhang. Connecting the dots: Multivariate time series forecasting with graph neural networks. In International Conference on Knowledge Discovery & Data Mining (KDD), 2020.
+Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? In Association for the Advancement of Artificial Intelligence (AAAI), 2023.
+Kai Zhao, Chenjuan Guo, Peng Han, Miao Zhang, Yunyao Cheng, and Bin Yang. Multiple time series forecasting with dynamic graph modeling. Proceedings of the VLDB Endowment, 2024.
+Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Association for the Advancement of Artificial Intelligence (AAAI), 2021.
+Tian Zhou, Ziqing Ma, Qingsong Wen, Xue Wang, Liang Sun, and Rong Jin. FEDformer: Frequency enhanced decomposed transformer for long-term series forecasting. In International Conference on Machine Learning (ICML), 2022.
+Tian Zhou, Peisong Niu, Xue Wang, Liang Sun, and Rong Jin. One fits all: Power general time series analysis by pretrained Im. arXiv, 2023.
+Zhaoyang Zhu, Weiqi Chen, Rui Xia, Tian Zhou, Peisong Niu, Bingqing Peng, Wenwei Wang, Hengbo Liu, Ziqing Ma, Xinyue Gu, et al. Energy forecasting with robust, flexible, and explainable machine learning algorithms. AI Magazine, 2023.
+
+# A APPENDIX
+
+# A.1 EXPERIMENTAL DETAILS
+
+# A.1.1 DATASETS
+
+The Special details about experiment datasets are as follows: ETT1 datasets consist of 7 variables, originating from two different electric transformers. It covers the period from January 2016 to January 2018. Each electric transformer has data recorded at 15-minute and 1-hour granularities, labeled as ETTh1, ETTh2, ETTm1, and ETTm2. Weather2 dataset comprises 21 meteorological indicators in Germany, collected every 10 minutes. Electricity3 dataset contains the power consumption of 321 users, recorded every hour, spanning from July 2016 to July 2019. ILI4 collects weekly data on patients with influenza-like illness from the Centers for Disease Control and Prevention of the United States spanning the years 2002 to 2021. Traffic5 comprises hourly data sourced from the California Department of Transportation. This dataset delineates road occupancy rates measured by various sensors on the freeways of the San Francisco Bay area. Cloud cluster datasets are private business data, documenting customer resource demands at 1-minute intervals for three clusters: cluster-A, cluster-B, cluster-C, where A,B,C represent different cities, covering the period from February 2023 to April 2023. For dataset preparation, we follow the established practice from previous studies (Zhou et al., 2021; Wu et al., 2021). Detailed statistics are shown in Table 5.
+
+Table 5: The statistics of datasets
+
+
Datasets
ETTh1&ETTh2
ETTm1&ETTm2
Weather
Electricity
ILI
Traffic
Cluster
Variables
7
7
21
321
7
862
6
Timestamps
17420
69680
52696
26304
966
17544
256322
Split Ratio
6:2:2
6:2:2
7:1:2
7:1:2
7:1:2
7:1:2
7:1:2
+
+# A.1.2 BASELINES
+
+In the realm of time series forecasting, numerous models have surfaced in recent years. We choose models with superior predictive performance from 2021 to 2023 as baselines, including the 2021 state-of-the-art (SOTA) Autoformer, the 2022 SOTA FEDformer, and the 2023 SOTA PatchTST and NLinear, among others. The specific code repositories for each of these models are as follows:
+
+- PatchTST: https://github.com/yuqinie98/PatchTST
+- NLinear: https://github.com/cure-lab/LTSF-Linear
+- FEDformer: https://github.com/MAZiqing/FEDformer
+- Scaleformer: https://github.com/borealisai/scaleformer
+- TiDE: https://github.com/google-research/google-research/tree/master/tide
+- Pyraformer: https://github.com/ant-research/Pyraformer
+- Autoformer: https://github.com/thuml/Autoformer
+
+# A.2 UNIVARIATE TIME SERIES FORECASTING
+
+We conducted univariate time series forecasting experiments on the ETT and Cloud cluster datasets. As shown in Table 6, Pathformer stands out with the best performance in 50 cases and as the second-best in 5 out of 56 instances. Pathformer has outperformed the second-best baseline PatchTST, especially on the Cloud cluster datasets. Our model Pathformer demonstrates excellent predictive performance in both multivariate and univariate time series forecasting.
+
+Table 6: Univariate time series forecasting results. The input length $H = 96$ , and the prediction length $F \in \{96, 192, 336, 720\}$ (for cloud clusters datasets $F \in \{24, 48, 96, 192\}$ ). The best results are highlighted in bold.
+
+
Models
Pathformer
PatchTST
FEDformer
Autoformer
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
96
0.057
0.180
0.057
0.179
0.079
0.215
0.071
0.206
192
0.075
0.208
0.076
0.209
0.104
0.245
0.114
0.262
336
0.076
0.216
0.093
0.240
0.119
0.270
0.107
0.258
720
0.090
0.238
0.097
0.245
0.142
0.299
0.126
0.283
ETTh2
96
0.128
0.274
0.127
0.273
0.128
0.271
0.153
0.306
192
0.177
0.330
0.178
0.328
0.185
0.330
0.204
0.351
336
0.180
0.340
0.221
0.374
0.231
0.378
0.246
0.389
720
0.213
0.371
0.250
0.403
0.278
0.420
0.268
0.409
ETTm1
96
0.029
0.126
0.030
0.127
0.033
0.140
0.056
0.183
192
0.042
0.160
0.043
0.165
0.058
0.186
0.081
0.216
336
0.058
0.185
0.059
0.185
0.084
0.231
0.076
0.218
720
0.079
0.217
0.081
0.218
0.102
0.250
0.110
0.267
ETTm2
96
0.062
0.179
0.064
0.181
0.072
0.206
0.065
0.189
192
0.096
0.230
0.097
0.231
0.102
0.245
0.118
0.256
336
0.128
0.268
0.129
0.270
0.130
0.279
0.154
0.305
720
0.179
0.326
0.181
0.330
0.178
0.325
0.182
0.335
Cluster-A
24
0.137
0.218
0.174
0.256
0.203
0.303
0.455
0.483
48
0.218
0.280
0.299
0.343
0.308
0.364
0.508
0.504
96
0.298
0.337
0.434
0.409
0.361
0.403
0.563
0.524
192
0.390
0.401
0.589
0.480
0.409
0.447
0.669
0.583
Cluster-B
24
0.100
0.206
0.107
0.218
0.130
0.253
0.197
0.339
48
0.146
0.251
0.158
0.265
0.149
0.272
0.247
0.390
96
0.219
0.301
0.234
0.327
0.230
0.342
0.313
0.429
192
0.454
0.404
0.461
0.444
0.415
0.412
0.512
0.544
Cluster-C
24
0.080
0.191
0.092
0.210
0.120
0.258
0.206
0.354
48
0.117
0.232
0.138
0.261
0.151
0.302
0.229
0.365
96
0.176
0.286
0.222
0.330
0.198
0.342
0.293
0.420
192
0.345
0.390
0.404
0.443
0.361
0.444
0.441
0.524
+
+# A.3 VARYING THE INPUT LENGTH WITH TRANSFORMER MODELS
+
+In time series forecasting tasks, the size of the input length determines how much historical information the model receives. We select models with better predictive performance from the main experiments as baselines. We configure different input lengths to evaluate the effectiveness of Pathformer and visualize the prediction results for input lengths of 48,192. From Figure 5, Pathformer consistently outperforms the baselines on the ETTh1, ETTh2, Weather, and Electricity. As depicted in Table 7 and Table 8, for $H = 48$ , 192, Pathformer stands out with the best performance in 46, 44 cases out of 48, respectively. Based on the results above, it is evident that Pathformer outperforms the baselines across different input lengths. As the input length increases, the prediction metrics of Pathformer continue to decrease, indicating that it is capable of modeling longer sequences.
+
+
+Figure 5: Results with different input length for ETTh1, ETTh2, Weather and Electricity.
+
+Table 7: Multivariate time series forecasting results. The input length $H = 48$ , and the prediction length $F \in \{96, 192, 336, 720\}$ . The best results are highlighted in bold.
+
+
Models
Pathformer
PatchTST
FEDformer
Autoformer
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
96
0.390
0.403
0.410
0.417
0.382
0.419
0.406
0.432
192
0.454
0.434
0.469
0.448
0.451
0.456
0.451
0.452
336
0.483
0.445
0.516
0.469
0.499
0.487
0.461
0.464
720
0.507
0.475
0.509
0.487
0.510
0.504
0.498
0.500
ETTh2
96
0.295
0.335
0.307
0.348
0.330
0.373
0.344
0.383
192
0.366
0.381
0.397
0.399
0.440
0.436
0.425
0.426
336
0.368
0.390
0.412
0.420
0.543
0.504
0.445
0.452
720
0.428
0.435
0.434
0.441
0.471
0.483
0.483
0.481
ETTm1
96
0.420
0.392
0.424
0.403
0.428
0.432
0.745
0.556
192
0.446
0.410
0.468
0.429
0.476
0.460
0.715
0.556
336
0.469
0.431
0.501
0.453
0.526
0.494
0.816
0.590
720
0.512
0.465
0.553
0.484
0.630
0.528
0.746
0.572
ETTm2
96
0.181
0.256
0.189
0.272
0.185
0.274
0.211
0.299
192
0.251
0.301
0.260
0.371
0.256
0.318
0.277
0.388
336
0.323
0.349
0.328
0.359
0.329
0.365
0.347
0.380
720
0.420
0.406
0.429
0.415
0.447
0.432
0.441
0.432
Weather
96
0.188
0.223
0.212
0.243
0.241
0.309
0.291
0.357
192
0.227
0.257
0.254
0.277
0.308
0.356
0.349
0.391
336
0.276
0.297
0.310
0.316
0.385
0.406
0.409
0.424
720
0.345
0.349
0.385
0.365
0.438
0.432
0.437
0.431
Electricity
96
0.201
0.280
0.225
0.293
0.240
0.349
0.211
0.322
192
0.210
0.285
0.229
0.299
0.248
0.357
0.224
0.331
336
0.236
0.305
0.239
0.316
0.265
0.370
0.259
0.362
720
0.272
0.338
0.282
0.349
0.326
0.405
0.313
0.407
+
+Table 8: Multivariate time series forecasting results. The input length $H = 192$ , and the prediction length $F \in \{96, 192, 336, 720\}$ . The best results are highlighted in bold.
+
+
Models
Pathformer
PatchTST
FEDformer
Autoformer
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
96
0.377
0.394
0.384
0.403
0.388
0.423
0.430
0.441
192
0.428
0.421
0.428
0.425
0.433
0.456
0.487
0.467
336
0.424
0.419
0.452
0.436
0.445
0.462
0.478
0.474
720
0.474
0.459
0.453
0.459
0.476
0.490
0.518
0.519
ETTh2
96
0.283
0.334
0.285
0.340
0.397
0.424
0.362
0.401
192
0.343
0.374
0.356
0.387
0.439
0.458
0.430
0.447
336
0.332
0.374
0.351
0.396
0.471
0.481
0.408
0.447
720
0.393
0.421
0.395
0.427
0.479
0.490
0.440
0.469
ETTm1
96
0.295
0.335
0.295
0.345
0.381
0.424
0.510
0.428
192
0.336
0.361
0.330
0.365
0.412
0.441
0.619
0.545
336
0.359
0.384
0.364
0.388
0.435
0.455
0.561
0.500
720
0.432
0.420
0.423
0.424
0.473
0.474
0.580
0.512
ETTm2
96
0.169
0.250
0.169
0.254
0.223
0.305
0.244
0.321
192
0.230
0.290
0.230
0.294
0.281
0.339
0.302
0.362
336
0.286
0.328
0.281
0.329
0.321
0.364
0.346
0.390
720
0.375
0.384
0.373
0.384
0.417
0.420
0.423
0.428
Weather
96
0.152
0.189
0.160
0.205
0.239
0.316
0.298
0.363
192
0.198
0.237
0.204
0.245
0.274
0.326
0.322
0.379
336
0.246
0.276
0.258
0.285
0.334
0.369
0.378
0.409
720
0.329
0.331
0.329
0.337
0.401
0.412
0.435
0.431
Electricity
96
0.136
0.232
0.146
0.240
0.231
0.343
0.198
0.313
192
0.143
0.248
0.152
0.252
0.258
0.361
0.218
0.335
336
0.172
0.274
0.178
0.271
0.273
0.372
0.252
0.352
720
0.218
0.299
0.223
0.308
0.308
0.402
0.275
0.371
+
+# A.4 MORE COMPARISONS WITH SOME BASIC BASELINES
+
+To validate the effectiveness of Pathformer, we conducted extensive experiments with some recent basic baselines that exhibited good performance: DLinear, NLinear, and N-HiTS, using long input sequence length $(H = 336)$ . As depicted in Table 9, our proposed model Pathformer outperforms
+
+Table 9: Multivariate time series forecasting results. The input length $H = 336$ (for ILI dataset $H = 106$ ), and the prediction length $F \in \{96, 192, 336, 720\}$ (for ILI dataset $F \in \{24, 36, 48, 60\}$ ). The best results are highlighted in bold.
+
+
Method
Pathformer
DLinear
NLinear
N-HiTS
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
96
0.369
0.395
0.375
0.399
0.374
0.394
0.378
0.393
192
0.414
0.418
0.405
0.416
0.408
0.415
0.427
0.436
336
0.401
0.419
0.439
0.443
0.429
0.427
0.458
0.484
720
0.440
0.452
0.472
0.490
0.440
0.453
0.561
0.501
ETTh2
96
0.276
0.334
0.289
0.353
0.277
0.338
0.274
0.345
192
0.329
0.372
0.383
0.418
0.344
0.381
0.353
0.401
336
0.324
0.377
0.448
0.465
0.357
0.400
0.382
0.425
720
0.366
0.410
0.605
0.551
0.394
0.436
0.625
0.557
ETTm1
96
0.285
0.336
0.299
0.353
0.306
0.348
0.302
0.350
192
0.331
0.361
0.335
0.365
0.349
0.375
0.347
0.383
336
0.362
0.382
0.369
0.386
0.375
0.388
0.369
0.402
720
0.412
0.414
0.425
0.421
0.433
0.422
0.431
0.441
ETTm2
96
0.163
0.248
0.167
0.260
0.167
0.255
0.176
0.255
192
0.220
0.286
0.224
0.303
0.221
0.293
0.245
0.305
336
0.275
0.325
0.281
0.342
0.274
0.327
0.295
0.346
720
0.363
0.381
0.397
0.421
0.368
0.384
0.401
0.413
Weather
96
0.144
0.184
0.176
0.237
0.182
0.232
0.158
0.195
192
0.191
0.229
0.220
0.282
0.225
0.269
0.211
0.247
336
0.234
0.268
0.265
0.319
0.271
0.301
0.274
0.300
720
0.316
0.323
0.323
0.362
0.338
0.348
0.351
0.353
Electricity
96
0.134
0.218
0.140
0.237
0.141
0.237
0.147
0.249
192
0.142
0.235
0.153
0.249
0.154
0.248
0.167
0.269
336
0.162
0.257
0.169
0.267
0.171
0.265
0.186
0.290
720
0.200
0.290
0.203
0.301
0.210
0.297
0.243
0.340
ILI
24
1.411
0.705
2.215
1.081
1.683
0.868
1.862
0.869
36
1.365
0.727
1.963
0.963
1.703
0.859
2.071
0.934
48
1.537
0.764
2.130
1.024
1.719
0.884
2.134
0.932
60
1.418
0.772
2.368
1.096
1.819
0.917
2.137
1.968
Traffic
96
0.373
0.241
0.410
0.282
0.410
0.279
0.402
0.282
192
0.380
0.252
0.423
0.287
0.423
0.284
0.420
0.297
336
0.395
0.256
0.436
0.296
0.435
0.290
0.448
0.313
720
0.425
0.280
0.466
0.315
0.464
0.307
0.539
0.353
+
+these baselines for the input length 336. Zeng et al. (2023) point out that the previous Transformer cannot extract temporal relations well from longer input sequences, but our proposed Pathformer performs better with a longer input length, indicating that considering adaptive multi-scale modeling can be an effective way to enhance such a relation extraction ability of Transformers.
+
+# A.5 DISCUSSION
+
+# A.5.1 COMPARE WITH PACHTST
+
+PatchTST divides time series into patches, with empirical evidence proving that patching is an effective method to enhance model performance in time series forecasting. Our proposed model Pathformer extends the patching approach to incorporate multi-scale modeling. The main differences with PatchTST are as follows: (1) Partitioning with Multiple Patch Sizes: PatchTST employs a single patch size to partition time series, obtaining features with a singular resolution. In contrast, Pathformer utilizes multiple different patch sizes at each layer for partitioning. This approach captures multi-scale features from the perspective of temporal resolutions. (2) Global correlations between patches and local details in each patch: PatchTST performs attention between divided patches, overlooking the internal details in each patch. In contrast, Pathformer not only considers the correlations between patches but also the detailed information within each patch. It introduces dual attention(inter-patch attention and intra-patch attention) to integrate global correlations and local details, capturing multi-scale features from the perspective of temporal distances. (3)Adaptive Multi-scale Modeling: PatchTST employs a fixed patch size for all data, hindering the grasp of critical patterns in different time series. We propose adaptive pathways that dynamically select varying patch sizes tailored to the features of individual samples, enabling adaptive multi-scale modeling.
+
+# A.5.2 COMPARE WITH N-HITS
+
+N-HiTS utilizes the modeling of multi-scale features for time series forecasting, but it differs from Pathformer in the following aspects: (1) N-HiTS models time series features of different resolutions through multi-rate data sampling and hierarchical interpolation. In contrast, Pathformer not only takes into account time series features of different resolutions but also approaches multi-scale modeling from the perspective of temporal distance. Simultaneously considering temporal resolutions and temporal distances enables a more comprehensive approach to multi-scale modeling. (2) N-HiTS employs fixed sampling rates for multi-rate data sampling, lacking the ability to adaptively perform multi-scale modeling based on differences in time series samples. In contrast, Pathformer has the capability for adaptive multi-scale modeling. (3) N-HiTS adopts a linear structure to build its model framework, whereas Pathformer enables multi-scale modeling in a Transformer architecture.
+
+# A.5.3 COMPARE WITH SCALEFORMER
+
+Scaleformer also utilizes the modeling of multi-scale features for time series forecasting. It differs from Pathformer in the following aspects: (1) Scaleformer obtains multi-scale features with different temporal resolutions through downsampling. In contrast, Pathformer not only considers time series features of different resolutions but also models from the perspective of temporal distance, taking into account global correlations and local details. This provides a more comprehensive approach to multi-scale modeling through both temporal resolutions and temporal distances. (2) Scaleformer requires the allocation of a predictive model at different temporal resolutions, resulting in higher model complexity than Pathformer. (3) Scaleformer employs fixed sampling rates, while Pathformer has the capability for adaptive multi-scale modeling based on the differences in time series samples.
+
+# A.6 EXPERIMENTS ON LARGE DATASETS
+
+The current time series forecasting benchmarks are relatively small, and there is a concern that the predictive performance of the model might be influenced by overfitting. To address this issue, we explore larger datasets to validate the effectiveness of the proposed model. The detailed process is as follows: We seek larger datasets from two perspectives: data volume and the number of variables. We add two datasets, the Wind Power dataset, and the PEMS07 dataset, to evaluate the performance of Pathformer on larger datasets. The Wind Power dataset comprises 7397147 timestamps, reaching a sample size in the millions, and the PEMS07 dataset includes 883 variables. As depicted in Table 10, Pathformer demonstrates superior predictive performance on these larger datasets compared with some state-of-the-art methods such as PatchTST, DLinear, and Scaleformer.
+
+Table 10: Results on large datasets: PEMS07 and Wind Power.
+
+
Methods
Pathformer
PatchTST
DLinear
Scaleformer
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
PEMS07
96
0.135
0.243
0.146
0.259
0.564
0.536
0.152
0.268
192
0.177
0.271
0.185
0.286
0.596
0.555
0.195
0.302
336
0.188
0.278
0.205
0.289
0.475
0.482
0.276
0.394
720
0.208
0.296
0.235
0.325
0.543
0.523
0.305
0.410
Wind Power
96
0.062
0.146
0.070
0.158
0.078
0.184
0.089
0.167
192
0.123
0.214
0.131
0.237
0.133
0.252
0.163
0.246
336
0.200
0.283
0.215
0.307
0.205
0.325
0.225
0.352
720
0.388
0.414
0.404
0.429
0.407
0.457
0.414
0.426
+
+# A.7 VISUALIZATION
+
+We visualize the prediction results of Pathformer on the Electricity dataset. As illustrated in Figure 6, for prediction lengths $F = 96$ , 192, 336, 720, the prediction curve closely aligns with the Ground Truth curve, indicating the outstanding predictive performance of Pathformer. Meanwhile, Pathformer demonstrates effectiveness in capturing multi-period and complex trends present in diverse samples. This serves as evidence of its adaptive modeling capability for multi-scale characteristics.
+
+
+(a) Prediciton Length $F = 96$
+
+
+(b) Prediciton Length $F = 192$
+
+
+(c) Prediciton Length $F = 336$
+
+
+(d) Prediciton Length $F = 720$
+Figure 6: Visualization of Pathformer's prediction results on Electricity. The input length $H = 96$
\ No newline at end of file
diff --git a/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/images.zip b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2fadc2752edb4a55b9737f03f3758dc48b8155aa
--- /dev/null
+++ b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce87ab231e309a92bf8dc472905920cc8bfe8ffe3db993c57bca74a880b1dd8e
+size 1724167
diff --git a/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/layout.json b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..af1b22414d3c7b4f8b437f7d545712af632940dc
--- /dev/null
+++ b/pathformermultiscaletransformerswithadaptivepathwaysfortimeseriesforecasting/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3cc1c9e00b7065ae698d9c8a9ac9c26f149d220c4a5844cb03e771bf9b95f576
+size 552898
diff --git a/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_content_list.json b/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..73bf7c5ad302076cf2cb7456e0284ca986d50c1a
--- /dev/null
+++ b/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8d464e473a607033d7be2305f03d41947e1bb18014ec1c073c6af02db3a64666
+size 102510
diff --git a/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_model.json b/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..bd75f6c87f722b8d158c9abd57f91cc0675008fb
--- /dev/null
+++ b/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f0188c0a6e58586fe951dc605c22b139852d7503f9dd2de634988c4fe3ba27a
+size 125516
diff --git a/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_origin.pdf b/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9be2eeddd14b37e84bb758a48a1ab812d133758d
--- /dev/null
+++ b/pbadetaonestageanchorfreeapproachforpartbodyassociation/63169eb9-c2e4-4961-b2c3-60e8b95a7e18_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:247096486d5b96170a3e90f1e8f7d5e30d2149e1608afcd22a96ee599395037d
+size 3193831
diff --git a/pbadetaonestageanchorfreeapproachforpartbodyassociation/full.md b/pbadetaonestageanchorfreeapproachforpartbodyassociation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..82129744786d2fe236dc00adbcb54a953114859c
--- /dev/null
+++ b/pbadetaonestageanchorfreeapproachforpartbodyassociation/full.md
@@ -0,0 +1,370 @@
+# PBADET: A ONE-STAGE ANCHOR-FREE APPROACH FOR PART-BODY ASSOCIATION
+
+Zhongpai Gao $^{1}$ , Huayi Zhou $^{2}$ , Abhishek Sharma $^{1}$ , Meng Zheng $^{1}$ , Benjamin Planche $^{1}$ , Terrence Chen $^{1}$ , Ziyan Wu $^{1}$
+
+1United Imaging Intelligence, Burlington, MA 01803, USA
+
+$^{2}$ Shanghai Jiao Tong University, Shanghai 200240, China
+
+{first.last}@uui-ai.com, sjtu.zhy@sjtu.edu.cn
+
+# ABSTRACT
+
+The detection of human parts (e.g., hands, face) and their correct association with individuals is an essential task, e.g., for ubiquitous human-machine interfaces and action recognition. Traditional methods often employ multi-stage processes, rely on cumbersome anchor-based systems, or do not scale well to larger part sets. This paper presents $PBADet$ , a novel one-stage, anchor-free approach for part-body association detection. Building upon the anchor-free object representation across multi-scale feature maps, we introduce a singular part-to-body center offset that effectively encapsulates the relationship between parts and their parent bodies. Our design is inherently versatile and capable of managing multiple parts-to-body associations without compromising on detection accuracy or robustness. Comprehensive experiments on various datasets underscore the efficacy of our approach, which not only outperforms existing state-of-the-art techniques but also offers a more streamlined and efficient solution to the part-body association challenge.
+
+
+Body-to-Part Association (BPJDet)
+Human Body Object
+Body Part Object
+No Object
+
+$\mathcal{O}^b = (1,b_x^b,b_y^b,b_w^b,b_h^b,1,0,0,0,$ $d_{x_1}^b,d_{y_1}^b,d_{x_2}^b,d_{y_2}^b,d_{x_3}^b,d_{y_3}^b)$
+
+$\mathcal{O}^p = (1,b_x^p,b_y^p,b_w^p,b_h^p,0,1,0,0,$ $\rightarrow$ head
+ $\mathcal{O}^p = (1,b_x^p,b_y^p,b_w^p,b_h^p,0,0,1,0,$ $\rightarrow$ left hand
+ $\mathcal{O}^p = (1,b_x^p,b_y^p,b_w^p,b_h^p,0,0,0,1,$ $\rightarrow$ right hana
+
+$\mathcal{O}^0 = (0, -, -, -, -, 0, 0, 0,$ $-, -, -, -, -, -)$
+
+Representation Length: $6 + K + 2K$ $(\mathbf{K} = \#$ of Parts
+
+
+Part-to-Body Association
+Our proposed PBADet
+Human Body Object
+Body Part Object
+No Object
+
+$\mathcal{O}^b = (b_p^b,b_p^b,b_p^c,b_p^b,$ 1,0,0,0,0, - , - )
+
+$\mathcal{O}^p = (b_t^p,b_t^p,b_r^p,b_r^p,$ 0,1,0,0,m,n) $\rightarrow$ $O^{p} = (b_{t}^{p},b_{t}^{p},b_{r}^{p},b_{r}^{p})$
+
+0,0,1,0,m,n) → left hand $O^p = (b_p^0,b_p^1,b_p^2,b_p^3)$
+
+0,0,0,1,m,n) → right hand
+
+$\mathcal{O}^0 = (-,\cdot , - ,\cdot ,$ 0,0,0,0,0,-)
+
+Representation Length: $5 + K + 2$ ( $k = \#$ of Parts)
+
+Figure 1: A comparative illustration between BPJDet (Zhou et al., 2023a) and our $PBADet$ in terms of the extended representations. Using the joint detection of three parts—head, left hand, and right hand—as an example, the original BPJDet's body-to-part configuration demands an extended representation of length 15 $(6 + K + 2K, K = 3)$ . Due to unused positions in the part object representation, this approach can result in inefficiencies and redundancies. In contrast, our $PBADet$ , operating on a part-to-body principle, adopts a more concise representation of length 10 $(5 + K + 2, K = 3)$ , optimizing for greater utilization and efficiency.
+
+# 1 INTRODUCTION
+
+Human part-body association refers to the task of detecting human parts within an image and identifying the location of the corresponding person for each detected part, e.g., left and right hands, face, left and right feet, etc. This task is vital in scenarios where multiple individuals are present, and, e.g., specific gestures from a particular person must be recognized and acted upon. An illustrative example is found in medical scan rooms, where technicians use hand gestures to locate the scanning area of a patient and initiate the scanning process. In such intricate scenarios, it is crucial that the
+
+system responds only to the technician's gestures, effectively filtering out the patient's hands to avoid unintended interference. By achieving this nuanced recognition, part-body association serves as a foundational technology across various fields, including human-computer interaction, virtual reality, robotics, and medical analysis, paving the way for more intuitive and precise control systems.
+
+Despite the evident necessity of part-body association, achieving accuracy in complex scenarios remains a significant challenge. Existing approaches often involve two-stage processes that rely on heuristic strategies or learned association networks. For example, Zhou et al. (2018) presents an approach that detects hands and the human body pose, employing a heuristic matching strategy for hand-body association; specifically, they verify whether a left or right arm joint falls within a bounding box of a raised hand. BodyHands (Narasimhaswamy et al., 2022) proposes to detect hands and bodies separately, utilizing a hand-body association network to predict association scores between them. However, these methods predict hand-body relationships in two distinct stages. The two-stage nature potentially introduces complexity and possibly compromises efficiency, highlighting the need for a more streamlined approach to hand-body association.
+
+BPJDet (Zhou et al., 2023b) introduces a body-part joint detector that can be integrated with one-stage anchor-based detectors, such as the YOLO series (Redmon et al., 2016; Redmon & Farhadi, 2018; Jocher et al., 2022; Wang et al., 2023b). This method extends object detection by incorporating center offsets from a body to specific body parts, such as the left and right hands, left and right feet, and head. These center offsets act as bridges, enabling body-part association with post-processing. However, the method poses some inherent challenges. Incorporating center offsets to each body part means that as the number of body parts increases, so does the complexity of the object detection representation, which causes the lack of flexibility to handle various numbers of body parts. This increase in complexity leads to a corresponding degradation in the overall detection performance. Furthermore, not all body parts are always visible within a body image, and when they are obscured, the corresponding center offsets become invalid, rendering the method less effective.
+
+This paper introduces a novel one-stage anchor-free approach for part-body association, called PBADet, which creatively extends anchor-free object detection by introducing a single part-to-body center offset. The key innovations of our method are detailed in three primary aspects. First, anchor-free object detection methods (Tian et al., 2019; Feng et al., 2021) inherently contain information about part-body association, as each location within a bounding box predicts a 4D vector representing distances to the bounding box's sides. Our approach leverages this natural relationship by supplementing it with a 2D vector, denoting the distances from the location to the center of the body bounding box, thereby explicitly representing the part-body association in a logical extension to current techniques. Second, using a single part-body center offset, our method can accommodate any number of body parts without increasing the number of center offsets correspondingly. This scalable design avoids degrading the overall object detection performance and provides an elegant solution for part-body association. Lastly, unlike body-part center offsets, which may involve one-to-many correspondence and become invalid when some parts are invisible, our method guarantees a one-to-one correspondence between each part and a body. The part-body center offset is always valid, providing a well-defined ground truth for supervised training. In addition, this one-to-one correspondence simplifies post-processing and ensures precise part-body associations.
+
+In summary, the contributions of this paper are as follows:
+
+- We introduce a novel extension to one-stage anchor-free object detection methods for part-body association. This extension is characterized by incorporating a single part-body center offset, offering a streamlined and intuitive approach to identifying part-body relationships.
+- Our proposed method serves as a universal framework, capable of supporting multiple parts-to-body associations. The innovative design ensures scalability without compromising the accuracy and robustness of the detection process.
+- Through experiments, we validate that our method delivers state-of-the-art performance, demonstrating its efficacy and potential as a new standard in part-body association techniques.
+
+# 2 RELATED WORK
+
+Body-part Joint Detection. Human body and part detection fall within the broader category of general object detection (Girshick, 2015; Redmon et al., 2016; Liu et al., 2016) and have seen signif
+
+icant exploration and advancement in recent years (Dollar et al., 2011; Liu et al., 2019; Deng et al., 2020; Bambach et al., 2015). This surge in research has been facilitated by the availability of public human body and part datasets, such as COCO-WholeBody (Jin et al., 2020), COCO-HumanParts (Yang et al., 2020), CrowdHuman (Shao et al., 2018), Wider Face (Yang et al., 2016), among others. In the context of this rich landscape, our paper specifically targets the challenge of human body-part joint detection and association.
+
+Previous works have approached the task of body-part joint detection using various strategies. DA-RNN (Zhang et al., 2019) proposes to detect bodies and heads in pairs using a double-anchor RPN to enhance person detection in crowded environments. JointDet (Chi et al., 2020b) incorporates a head-body relationship discriminating module to facilitate relational learning between human bodies and heads, aiming to improve human detection accuracy and reduce head false positives. BFJDet (Wan et al., 2021) introduces a head hook center in object representation and employs an embedding matching loss to associate the body and face of the same person. Hier R-CNN (Yang et al., 2020) extends the Mask R-CNN (He et al., 2017) pipeline, adopting a two-branch system to detect human bodies through the faster branch and human parts through an anchor-free Hier branch utilizing a per-pixel prediction mechanism. Detector-in-Detector (Li et al., 2019) takes a similar approach, using Faster R-CNN (Ren et al., 2015) with two detectors to separately focus on the human body and parts in a coarse-to-fine manner. Distinct from these methods, our paper introduces a one-stage anchor-free approach for hand-body association.
+
+Human-object Interaction. Human-object interaction (HOI) and body-part association aim to understand spatial relationships but present distinct characteristics. In the realm of HOI, various methods have been proposed to handle different aspects of the problem. GPNN (Wang et al., 2020) treats HOI as a keypoint detection and grouping challenge, whereas HOTR (Kim et al., 2021) directly predicts human, object, and interaction triplets from an image, utilizing a transformer encoder-decoder architecture. Additionally, in the specialized field of hand-contact detection, Shan et al. (Shan et al., 2020) developed a hand-object detector that furnishes detailed hand attributes such as the location, side, contact state, and bounding box of the interacting object. ContactHands (Narasimhaswamy et al., 2020) builds upon this by localizing hands and deploying another object detector to determine physical contact. However, part-body association focuses solely on the connection between human parts and the body, simplifying the task but requiring specific attention to this nuanced relationship.
+
+Multi-person Pose Estimation. Multi-person pose estimation, exemplified by works such as Jin et al. (2022); Nie et al. (2019); Newell et al. (2017), bears a significant resemblance to the task of hand-body association. In Jin et al. (2022), the concept of centripetal offsets is introduced to effectively group human joints, thereby facilitating efficient and accurate multi-person pose estimation. YOLO-Pose (Maji et al., 2022), an advancement in the YOLO series, integrates bounding box detection with simultaneous 2D pose prediction for multiple individuals within a single processing framework. Similarly, ED-Pose (Yang et al., 2023) employs a dual explicit box detection approach to synergize human-level and keypoint-level contextual learning. Despite these advancements, multiperson pose estimation methods typically do not provide specific bounding boxes for human parts, an essential element for tasks like hand-body association.
+
+Note that while Jin et al. (2022) and our proposed method both utilize part-to-body center offsets, their functionalities and roles within each framework are different. Jin et al. (2022) leverages these offsets primarily for grouping in pose estimation, whereas our method focuses on establishing a one-to-one correspondence for accurate part-body association.
+
+Anchor-free Detection. The utilization of anchor boxes, featured prominently in detection architectures such as Faster R-CNN (Ren et al., 2015), SSD (Liu et al., 2016), and YOLOv3 (Redmon & Farhadi, 2018), has become foundational in many detection frameworks. Nevertheless, these anchor boxes introduce numerous hyper-parameters, necessitating meticulous tuning for optimal performance. Furthermore, they present challenges from the imbalance between positive and negative training samples. Crucially, for our specific task of part-body association, the part-body center offset can fall far outside the predefined anchor boxes designated for the parts. This characteristic makes the task of learning part-body association using anchor-based methods particularly challenging.
+
+Recent years have witnessed the emergence of several anchor-free methods. YOLOv1 (Redmon et al., 2016), for example, determines bounding boxes using points proximal to object centers. How-
+
+ever, this approach exhibits a lower recall than its anchor-based counterparts, primarily because it relies solely on near-center points. In a departure from this strategy, FCOS (Tian et al., 2019) leverages all points within a ground-truth bounding box, incorporating a centerness branch to suppress suboptimal detected boxes. However, this method performs object classification and localization independently, which may cause a lack of interaction between the two tasks, leading to inconsistent predictions. Instead of using a centerness branch, TOOD (Feng et al., 2021) introduces task alignment learning to enhance interaction between the two tasks for high-quality predictions. This refined concept from TOOD serves as the foundation for our part-body association method.
+
+# 3 METHODOLOGY
+
+# 3.1 TASK FORMULATION
+
+Given an input image, we consider the task of regressing a set of bounding boxes, the corresponding classes (i.e., body and each part), and the corresponding association offsets to the bodies.
+
+Anchor-free Dense Bounding-box Prediction. Let $F_{i} \in \mathbb{R}^{H_{i} \times W_{i} \times C_{i}}$ represents the feature map at layer $i \in \{1, \dots, L\}$ of a backbone CNN, with $s_{i}$ being the total stride up to that layer; $H_{i}, W_{i}$ , and $C_{i}$ the height, width, and depth of the feature maps respectively; and $L$ the number of layers whose feature maps are considered. We task a sub-network to regress the bounding-box of each target and another to classify the boxes, i.e., to match the ground-truth targets $T = (B, c)$ . Here $B = \{x_{l}, y_{t}, x_{r}, y_{b}\} \in \mathbb{R}^{4}$ denotes the coordinates of the left-top and right-bottom corners of the bounding box; $c \in \{1, 2, \dots, N\}$ specifies the class of the object within the bounding box; $N$ stands for the total number of classes. For example, $N = 4$ when focusing on the body, left hand, right hand, and face. In the anchor-free paradigm, detection is formulated as a dense inference, i.e., in a per-pixel prediction fashion in feature maps. For each position $p_{i} = (x_{i}, y_{i})$ in $F_{i}$ , the detection head regresses a 4D vector $(l_{i}, t_{i}, r_{i}, b_{i})$ , which represents the relative offsets from the four sides of a bounding box anchored in $p_{i}$ . Based on the relation $(x_{i}, y_{i}) = (\lfloor \frac{x}{s_{i}} \rfloor, \lfloor \frac{y}{s_{i}} \rfloor)$ between feature map locations $p_{i}$ and corresponding locations $p = (x, y)$ in the original image, the predicted values should satisfy the following equations w.r.t. the ground-truth $B$ :
+
+$$
+\left\lfloor \frac {x _ {l}}{s _ {i}} \right\rfloor = x _ {i} - l _ {i}, \quad \left\lfloor \frac {y _ {t}}{s _ {i}} \right\rfloor = y _ {i} - t _ {i}, \quad \left\lfloor \frac {x _ {r}}{s _ {i}} \right\rfloor = x _ {i} + r _ {i}, \quad \left\lfloor \frac {y _ {b}}{s _ {i}} \right\rfloor = y _ {i} + b _ {i}. \tag {1}
+$$
+
+Note that anchor points $p_i$ are selected from multi-level feature maps, which aids in detecting objects of varying sizes and enhances the robustness of predictions. Similarly, a classification head densely returns a score vector $o_c \in \mathbb{R}^N$ w.r.t. each class for each position in the feature maps.
+
+Part-to-body Association. In anchor-free approaches, all points enclosed within a ground-truth bounding box are treated as positive samples, i.e., only those are used to supervise the bounding box during training (Tian et al., 2019). We utilize this property to naturally enable part-to-body associativity: any anchor point belonging to a part's bounding-box should also belong to the body's bounding box; and thus should satisfy Equation (1) for both sets of bounding parameters. Hence, we can extend the part detection task to not only predicting the 4D vector corresponding to the part's own bounding box, but also a second vector pertaining to the corresponding body's bounding box. For a more concise delineation of the part-body association, we define the second vector as only the 2D center offset from part to body (i.e., transitioning from a 4D vector to a 2D vector).
+
+Therefore, we extend the ground-truth target as $T = \{B, c, c^b\} \in \mathbb{R}^4 \times \{1, 2, \dots, N\} \times \mathbb{R}^2$ , where $c^b = \{c_x^b, c_y^b\}$ is the center of the body that encloses the part. For an anchor point within the part's bounding box, we thus additionally regress a 2D vector $(m_i, n_i)$ , representing the offset from the anchor point to the body center to encode the part-body association, which should satisfy:
+
+$$
+\left\lfloor \frac {c _ {x} ^ {b}}{s _ {i}} \right\rfloor = x _ {i} + \lambda m _ {i}, \quad \left\lfloor \frac {c _ {y} ^ {b}}{s _ {i}} \right\rfloor = y _ {i} + \lambda n _ {i}, \tag {2}
+$$
+
+where $\lambda$ is a scaling factor of $m_{i}$ and $n_i$ to control the range of the network outputs. The part-body association prediction is also performed over the multi-level feature maps.
+
+In summary, our per-position network predictions can be denoted as $o = \{o_b, o_c, o_d\}$ , where $o_b = \{l_i, t_i, r_i, b_i\}$ is the bounding box prediction, $o_c = \{c_1, \dots, c_N\}$ is the classification result, and $o_d = \{m_i, n_i\}$ relates to the part-body association. It is worth noting that our discussion of the human
+
+
+Figure 2: Illustration of the proposed pipeline.
+
+part-body association serves as a representative example. However, this formulation stands as a universal framework, aptly addressing various parts-to-body association challenges (e.g., the wheel-and-car association) without requiring any modifications. Since we define the part-body association as a 2D vector that denotes the center offset from the part to the body, it can seamlessly accommodate associations involving multiple parts.
+
+# 3.2 NETWORK ARCHITECTURE
+
+Our approach is founded on one-stage anchor-free detectors, including models like YOLOv5 (Jocher, 2020), YOLOv7 (Wang et al., 2023a), YOLOv8 (Jocher et al., 2023), among others. While YOLOv5 and YOLOv7 were originally designed as anchor-based methods, they can be conveniently adapted with anchor-free heads. Given the feature maps $\pmb{F}_i \in \mathbb{R}^{H_i \times W_i \times C_i}$ produced by the backbone network as inputs, the detection head comprises three distinct output branches. These branches are responsible for bounding box prediction, class prediction, and part-body association prediction, respectively. Each branch is constructed using a three-layer convolutional network, where the kernel sizes are $\{3 \times 3, 3 \times 3, 1 \times 1\}$ and the stride is 1. Specifically, the bounding-box sub-network has the channel structure $\{C_i, \lfloor \frac{C_i}{4} \rfloor, \lfloor \frac{C_i}{4} \rfloor, 64\}$ and is followed by a DFL module (Li et al., 2022) to output $O_b = \in \mathbb{R}^{H_i \times W_i \times 4}$ (2D map of $o_b$ predictions), the class branch adopts $\{C_i, C_i, C_i, N\}$ to output $O_c \in \mathbb{R}^{H_i \times W_i \times N}$ , and the part-body association branch uses $\{C_i, \lfloor \frac{C_i}{4} \rfloor, \lfloor \frac{C_i}{4} \rfloor, 2\}$ to output $O_d \in \mathbb{R}^{H_i \times W_i \times 2}$ .
+
+# 3.3 LOSS FUNCTIONS
+
+Our method incorporates the task-alignment learning strategy from TOOD (Feng et al., 2021) to supervise bounding box and class predictions, which includes a bounding-box IoU loss $\mathcal{L}_{iou}$ , a bounding-box DFL loss $\mathcal{L}_{dfl}$ , and a classification loss $\mathcal{L}_{cls}$ (refer to Feng et al. (2021) and Li et al. (2022) for the explicit definition of these functions). Furthermore, a dedicated part-body association loss is introduced for our specific objective.
+
+Given the feature maps $\pmb{F}_i \in \mathbb{R}^{H_i \times W_i \times C_i}$ , the part-body association detection branch produces an output $\pmb{O}_d \in \mathbb{R}^{H_i \times W_i \times 2}$ , indicating that each anchor point yields a 2D vector. Drawing inspiration from the task-alignment learning concept, the anchor assignment for the part-body association remains consistent with those used for bounding-box and class supervision—"a well-aligned anchor point should be able to predict a high classification score with a precise localization jointly" (Feng et al., 2021). The anchor alignment metric is expressed as $t = s^{\alpha} \cdot u^{\beta}$ , where $s$ and $u$ denote a classification score and an IoU value, respectively. $\alpha$ and $\beta$ are hyper-parameters used to control the impact of the two tasks over the anchor alignment metric $t$ . Utilizing the proposed metric $t$ , we choose the top $K$ anchor points for supervision at each training step. The part-body association loss is then articulated as:
+
+$$
+\mathcal{L}_{assoc} = \frac{1}{K}\frac{1}{P}\sum_{\substack{j\in J\\ i\in \{1,\cdot ,L\}}}\frac{1}{2}\left(\left\| \left\lfloor \frac{c_{x}^{b}[j]}{s_{i}}\right\rfloor -\left(x_{i}[j] + \lambda m_{i}[j]\right)\right\|_{1} + \left\| \left\lfloor \frac{c_{y}^{b}[j]}{s_{i}}\right\rfloor -\left(y_{i}[j] + \lambda n_{i}[j]\right)\right\|_{1}\right), \tag{3}
+$$
+
+with $J$ representing the index list of the top $K$ aligned anchor points for each part and $P$ indicating the number of parts in the image. Thus, the overall loss is expressed as:
+
+$$
+\mathcal {L} = \lambda_ {i o u} \mathcal {L} _ {i o u} + \lambda_ {d f l} \mathcal {L} _ {d f l} + \lambda_ {c l s} \mathcal {L} _ {c l s} + \lambda_ {\text {a s s o c}} \mathcal {L} _ {\text {a s s o c}}. \tag {4}
+$$
+
+with $\lambda_{iou}$ , $\lambda_{dfl}$ , $\lambda_{cls}$ , and $\lambda_{assoc}$ are the objective-weighting hyper-parameters.
+
+# 3.4 DECODING PART-TO-BODY ASSOCIATIONS
+
+Our model predicts the center offset between a part and its corresponding body, serving as a crucial link in the part-to-body relationship. During inference, we initiate the process by filtering out overlapping predictions through non-maximum suppression (NMS). This yields refined results for parts and bodies as follows:
+
+$$
+\hat {\boldsymbol {O}} ^ {b} = \operatorname {N M S} \left(\boldsymbol {O} ^ {b}, \tau_ {\text {c o n f}} ^ {b}, \tau_ {i o u} ^ {b}\right), \quad \hat {\boldsymbol {O}} ^ {p} = \operatorname {N M S} \left(\boldsymbol {O} ^ {p}, \tau_ {\text {c o n f}} ^ {p}, \tau_ {i o u} ^ {p}\right), \tag {5}
+$$
+
+where $\tau_{conf}^{b},\tau_{conf}^{p},\tau_{iou}^{b}$ and $\tau_{iou}^{p}$ represent the confidence and IoU overlap thresholds for both the body and part in the NMS procedure.
+
+Subsequently, for each part, we compute its anticipated body center using the relationship defined in Equation (2) as:
+
+$$
+\hat {c} _ {x} ^ {b} = s _ {i} \left(x _ {i} + \lambda m _ {i}\right), \quad \hat {c} _ {y} ^ {b} = s _ {i} \left(y _ {i} + \lambda n _ {i}\right). \tag {6}
+$$
+
+Finally, for each individual part, we determine the Euclidean $(\ell_2)$ distance between the estimated body center and the centers of the bodies that are unassigned and also enclose the part. The body with the smallest distance is chosen as the corresponding body for the given part.
+
+The decoding mechanism in our part-to-body association is notably more straightforward than the body-to-part association employed in BPJDet (Zhou et al., 2023b). In BPJDet, complexities arise since each body can be associated with various parts due to occlusions.
+
+# 4 EXPERIMENTS
+
+# 4.1 EVALUATION PROTOCOLS
+
+Datasets. We evaluate our method on two datasets: BodyHands (Narasimhaswamy et al., 2022) and COCOHumanParts (Yang et al., 2020). Additional experiments on CrowdHuman (Shao et al., 2018) are provided in Appendix A.1. BodyHands is a large-scale dataset containing unconstrained images with annotations for hand and body locations and correspondences. This dataset consists of 18,861 training images and 1,629 test images. COCOHumanParts is an instance-level human-part dataset with rich-annotated and various scenarios based on COCO 2017 (Lin et al., 2014). This dataset consists of 66,808 training images, 64,115 test images, and 2,693 validation images.
+
+Evaluation Metric. We report the standard VOC average precision (AP) metric with IoU = 0.5 to evaluate the detection of bodies and parts. We also present the log-average miss rate on false positive per image (FPPI) in the range of $[10^{-2}, 10^{0}]$ shortened as $\mathrm{MR}^{-2}$ (Dollar et al., 2011) of the body and its parts. To qualify the part-body association, we report the log-average miss matching rate $(\mathrm{mMR}^{-2})$ on FPPI of part-body pairs in $[10^{-2}, 10^{0}]$ , which was originally proposed by BFJDet (Wan et al., 2021) for exhibiting the proportion of body-face pairs that are mismatched. For BodyHands, we provide the conditional accuracy and joint AP defined by BodyHands (Narasimhaswamy et al., 2022). Lastly, for COCOHumanParts, we follow the evaluation protocols defined in Hier R-CNN (Yang et al., 2020) and report the detection performance with a series of APs (AP.5::95, AP.5, AM, AL) as in COCO metrics where subordinate APs represent the part-body association state.
+
+Implementation Specifics. Our experimentation framework is constructed using PyTorch (Paszke et al., 2019), and the models are trained across 4 Tesla V100 GPUs, leveraging automatic mixed precision (AMP) over a span of 100 epochs. Consistent with YOLOv7 (Wang et al., 2023a), we utilize the same learning rate scheduler, SGD optimizer (Robbins & Monro, 1951), and prescribed data augmentations. We follow the same protocol established in BPJDet (Zhou et al., 2023b) that uses pretrained YOLO weights. The input image resolution is $1024 \times 1024$ , and the batch size is 24. We employ two backbone architectures, YOLOv7 and YOLOv5l6, to demonstrate the versatility and adaptability of our approach.
+
+In our experiments, we set the loss weights $\lambda_{iou} = 7.5$ , $\lambda_{dfl} = 1.5$ , $\lambda_{cls} = 0.5$ , $\lambda_{assoc} = 0.2$ , the scaling factor $\lambda = 2.0$ , and the anchor alignment parameters $K = 13$ , $\alpha = 1.0$ , $\beta = 6.0$ . During inference, we set the NMS parameters as: the body thresholds $\tau_{conf}^{b} = 0.05$ , $\tau_{iou}^{b} = 0.6$ ; while the part thresholds $\tau_{conf}^{p} = 0.05$ , $\tau_{iou}^{p} = 0.6$ for BodyHands, and $\tau_{conf}^{p} = 0.005$ , $\tau_{iou}^{p} = 0.75$ for COCOHumanParts.
+
+
+
+
+
+
+
+
+BodyHands
+
+
+BPJDet (YOLOv5l6)
+
+
+Ours (YOLOv516)
+Figure 3: Qualitative results on BodyHands. Red arrows highlight our correct predictions.
+
+
Methods
Param (M)
Size
Hand AP↑
Cond. Accuracy↑
Joint AP↑
OpenPose (2017)
199.0
1536
39.7
74.03
27.81
Keypoint Com. (2021)
27.3
1536
33.6
71.48
20.71
MaskRCNN+FD (2017)
266.0
1536
84.8
41.38
23.16
MaskRCNN+FS (2017)
266.0
1536
84.8
39.12
23.30
MaskRCNN+LD (2017)
266.0
1536
84.8
72.83
50.42
MaskRCNN+IoU (2017)
266.0
1536
84.8
74.52
51.74
BodyHands (2022)
700.3
1536
84.8
83.44
63.48
BodyHands* (2022)
700.3
1536
84.8
84.12
63.87
BPJDet (YOLOv5s6) (2023a)
15.3
1536
84.0
85.68
77.86
BPJDet (YOLOv5m6) (2023a)
41.2
1536
85.3
86.80
78.13
BPJDet (YOLOv5l6) (2023a)
86.1
1536
85.9
86.91
84.39
Ours (YOLOv7)
36.9
1024
89.1
92.62
85.98
Ours (YOLOv5l6)
86.1
1024
88.1
92.71
85.73
+
+Table 1: Quantitative evaluation on BodyHands.
+
+# 4.2 COMPARISON WITH STATE-OF-THE-ART
+
+BodyHands. We conduct the hand-body association task on the BodyHands dataset (Narasimhaswamy et al., 2022). Notably, this dataset contains only one type of part annotation since it does not distinguish between left and right hands. Table 1 compares our $PBADet$ with leading methods. Our approach surpasses competitors across all metrics, including hand AP, conditional accuracy, and joint AP, by large margins. In particular, our YOLOv7 model, despite having a smaller model size than BPJDet (YOLOv5m6) (Zhou et al., 2023a), delivers superior performance. Furthermore, our YOLOv5l6 model, which utilizes the same backbone as BPJDet (YOLOv5l6), also demonstrates enhanced results. Figure 3 shows that our method demonstrates the best body and part detection and part-body association detection.
+
+COCOHumanParts. We evaluate our approach for the multi-part-to-body association task using the COCOHumanParts dataset (Yang et al., 2020), which includes six distinct body parts: head, face, left hand, right hand, left foot, and right foot. Tables 2 and 3 provide a comparative analysis with leading methods. As depicted in Table 2, our method achieves APs that are on par with BJPDet (Zhou et al., 2023b). Notably, we lead in metrics such as $\mathrm{AP}_M$ , $\mathrm{AP}_L$ , and APs specific to person and feet detections. Furthermore, Table 3 underscores our method in achieving the lowest average $\mathrm{mMR}^{-2}$ across categories like head, face, both left and right hands, and right foot, emphasizing
+
+
+
+
+
+
+
+
+Figure 4: Qualitative results on COCOHumanParts. Yellow and red arrows highlight other methods' failure cases and our correct predictions, respectively.
+
+
+
+
+
+
Methods
Joint Detect?
All categories APs↑ (original / subordinate)
Per categories APs↑
AP.5::95
AP.5
APM
APL
person
head
face
r-hand
l-hand
r-foot
Faster-C4-R50 (2015)
32.0/—
55.5/—
54.9/—
52.4/—
50.5
47.5
35.5
27.2
24.9
19.2
Faster-FPN-R50 (2017)
✓
34.8/19.1
60/38.5
55.4/22.4
52.2/33.6
51.4
48.7
36.7
31.7
29.7
22.4
RetinaNet-R50 (2017b)
32.2/—
54.7/—
54.5/—
53.8/—
49.7
47.1
33.7
28.7
26.7
19.7
FCOS-R50 (2019)
34.1/—
58.6/—
55.1/—
55.1/—
51.1
45.7
40.0
29.8
28.1
22.2
Faster-FPN-X101 (2017)
36.7/—
62.8/—
57.4/—
55.3/—
53.6
49.7
37.3
33.8
32.2
25
Hier-R50 (2020)
✓
36.8/33.3
65.7/67.1
53.9/29.9
47.5/47.1
53.2
50.9
41.5
31.3
29.3
25.5
Hier-R101 (2020)
37.2/—
65.9/—
55.1/—
50.3/—
54.0
50.4
41.6
31.6
30.1
26.0
Hier-X101 (2020)
✓
38.8/36.6
68.1/69.7
56.6/32.6
52.3/51.1
55.4
52.3
43.2
33.5
32.0
27.4
Hier-R50†‡ (2020)
✓
40.6/37.3
70.1/72.5
57.5/35.4
51.5/48.9
—
—
—
—
—
—
Hier-X101†‡ (2020)
✓
42.0/38.8
71.6/72.3
59.0/37.4
53.3/50.3
—
—
—
—
—
—
BPJDet (YOLOv5s6)
✓
38.9/38.4
65.5/64.4
59.1/57.7
49.7/47.5
56.3
53.5
41.9
34.7
33.7
25.5
BPJDet (YOLOv5m6)
✓
42.0/41.7
68.9/68.1
62.3/61.6
54.6/52.9
59.8
55.7
44.7
38.7
37.6
28.6
BPJDet (YOLOv5l6)
✓
43.6/43.3
70.6/69.8
63.8/63.2
61.8/58.9
61.3
56.6
46.3
40.4
39.6
30.2
Ours (YOLOv7)
✓
42.7/41.5
69.5/67.9
65.8/64.4
66.7/63.3
62.1
54.5
44.7
38.7
37.5
30.4
Ours (YOLOv5l6)
✓
43.0/41.8
70.0/68.4
66.2/65.0
67.2/64.4
62.4
54.6
44.6
39.0
37.7
30.9
+
+our method's superior part-body association capabilities. Figure 4 demonstrates that our method performs as well as (or better than) BPJDet and much better than Hier R-CNN.
+
+Comparison to Multi-person Pose Estimation. We present a qualitative analysis contrasting our approach with ED-Pose (Yang et al., 2023), a state-of-the-art multi-person pose estimation method, as illustrated in Figure 5 (see quantitative restuls in Appendix A.2) Despite utilizing the powerful Swin-L backbone (Liu et al., 2021), ED-Pose occasionally provides imprecise or speculative pre
+
+Table 2: Quantitative evaluation on COCOHumanParts with all and per categories APs. All categories APs include the original detection APs and subordinate APs. The marker †‡ in Hier R-CNN indicates using deformable convolutional layers and multi-scale training (Yang et al., 2020).
+
+
Methods
Params (M)
Size
head
face
l-hand
r-hand
r-foot
l-foot
BPJDet (YOLOv5s6)
15.3
1536
33.4
36.7
50.2
51.4
58.3
58.4
BPJDet (YOLOv5m6)
41.2
1536
29.7
32.7
42.5
44.2
53.4
52.3
BPJDet (YOLOv5l6)
86.1
1536
30.8
31.8
41.6
42.2
49.1
50.4
Ours (YOLOv7)
36.9
1024
29.2
31.3
41.1
42.7
52.6
52.5
Ours (YOLOv5l6)
86.1
1024
27.9
30.5
36.2
40.8
50.4
47.9
+
+Table 3: Quantitative evaluation on COCOHumanParts with the average ${\mathrm{{mMR}}}^{-2}$ .
+
+dictions, especially for limbs such as legs and arms. Such unreliable results cloud the discernment of the relationship between a body and its corresponding parts. Our part-body association detention method can effectively address and diminish this issue.
+
+
+Figure 5: Qualitative comparison with ED-Pose (Yang et al., 2023) on images from COCO. Yellow circles highlight erroneous predictions.
+
+# 4.3 ABLATION STUDY
+
+
Methods
Hand AP↑
Cond. Accuracy↑
Joint AP↑
w/o Lassoc (baseline)
89.1
80.78
78.07
w/o Multi-scale
88.8
91.64
85.46
w/o Task-align
89.0
92.08
85.78
Full
89.1
92.62
85.98
+
+Table 4: Ablation experiments on BodyHands with the YOLOv7 backbone architecture.
+
+To better understand the contribution of various components in our approach, we undertake ablation experiments on the BodyHands dataset with the YOLOv7 backbone architecture, summarized in Table 4 and more in Table 8 in Appendix A.4. Initially, we examine a configuration without the association loss, $\mathcal{L}_{assoc}$ , which serves as our baseline for detecting human bodies and parts. For part-body association in this scenario, we utilize Euclidean distances between a part center and the unassigned body centers. The body that encloses the part and has the minimal distance is then tagged as the corresponding body for the given part. Compared to the baseline model, the introduction of our association prediction head maintains the accuracy in hand detection, and considerably boosts the efficacy of part-body association.
+
+In our subsequent variant, the center offset is defined in relation to the multi-scale feature anchor points. When this center offset is interpreted as a normalized absolute distance (i.e., w/o Multi-scale), we observe a decline in metrics, including hand prediction accuracy, conditional accuracy, and joint AP. Lastly, our method adopts task alignment learning for supervising part-body associations. Disregarding task alignment (i.e., w/o Task-align), where all positive samples are used for training, leads to decreased performance in all metrics, in contrast with our full model.
+
+# 5 CONCLUSION
+
+The task of human part-body detection and association is critical for a wide range of computer vision applications. In this work, we introduced an innovative one-stage, anchor-free methodology for this purpose. By extending the anchor-free object representation across multi-scale feature maps, we incorporate a singular part-to-body center offset, effectively bridging parts and their corresponding bodies. Our approach is purposely designed to handle multiple parts-to-body associations without sacrificing detection accuracy or robustness. Experimental results validate that our proposed method sets new standards in the domain, surpassing existing state-of-the-art solutions.
+
+# REFERENCES
+
+Sven Bambach, Stefan Lee, David J Crandall, and Chen Yu. Lending a hand: Detecting hands and recognizing activities in complex egocentric interactions. In Proceedings of the IEEE international conference on computer vision, pp. 1949-1957, 2015.
+Jinkun Cao, Hongyang Tang, Hao-Shu Fang, Xiaoyong Shen, Cewu Lu, and Yu-Wing Tai. Cross-domain adaptation for animal pose estimation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9498-9507, 2019.
+Zhe Cao, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Realtime multi-person 2d pose estimation using part affinity fields. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7291-7299, 2017.
+Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pp. 213-229. Springer, 2020.
+Cheng Chi, Shifeng Zhang, Junliang Xing, Zhen Lei, Stan Z Li, and Xudong Zou. Pedhunter: Occlusion robust pedestrian detector in crowded scenes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 10639-10646, 2020a.
+Cheng Chi, Shifeng Zhang, Junliang Xing, Zhen Lei, Stan Z Li, and Xudong Zou. Relational learning for joint head and human detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 10647-10654, 2020b.
+Xuangeng Chu, Anlin Zheng, Xiangyu Zhang, and Jian Sun. Detection in crowded scenes: One proposal, multiple predictions. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12214-12223, 2020.
+Jiankang Deng, Jia Guo, Evangelos Ververas, Irene Kotsia, and Stefanos Zafeiriou. Retinaface: Single-shot multi-level face localisation in the wild. In CVPR, 2020.
+Piotr Dollar, Christian Wojek, Bernt Schiele, and Pietro Perona. Pedestrian detection: An evaluation of the state of the art. IEEE transactions on pattern analysis and machine intelligence, 34(4): 743-761, 2011.
+Chengjian Feng, Yujie Zhong, Yu Gao, Matthew R Scott, and Weilin Huang. Tood: Task-aligned one-stage object detection. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 3490-3499. IEEE Computer Society, 2021.
+Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 1440-1448, 2015.
+Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 2961-2969, 2017.
+Xin Huang, Zheng Ge, Zequn Jie, and Osamu Yoshie. Nms by representative region: Towards crowded pedestrian detection by proposal pairing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10750-10759, 2020.
+Lei Jin, Xiaojuan Wang, Xuecheng Nie, Luoqi Liu, Yandong Guo, and Jian Zhao. Grouping by center: Predicting centripetal offsets for the bottom-up human pose estimation. IEEE Transactions on Multimedia, 2022.
+Sheng Jin, Lumin Xu, Jin Xu, Can Wang, Wentao Liu, Chen Qian, Wanli Ouyang, and Ping Luo. Whole-body human pose estimation in the wild. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part IX 16, pp. 196-214. Springer, 2020.
+Glenn Jocher. *Ultralytics yolov5*, 2020. URL https://github.com/ultralytics/yolov5.
+
+Glenn Jocher, Ayush Chaurasia, Alex Stoken, Jirka Borovec, Yonghye Kwon, Kalen Michael, Jia-cong Fang, Zeng Yifu, Colin Wong, Diego Montes, et al. ultralytics/yolov5: v7. 0-yolov5 sota realtime instance segmentation. Zenodo, 2022.
+Glenn Jocher, Ayush Chaurasia, and Jing Qiu. *Ultralytics yolov8*, 2023. URL https://github.com/ultralytics/ultralytics.
+Bumsoo Kim, Junhyun Lee, Jaewoo Kang, Eun-Sol Kim, and Hyunwoo J Kim. Hotr: End-to-end human-object interaction detection with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 74-83, 2021.
+Xiang Li, Chengqi Lv, Wenhai Wang, Gang Li, Lingfeng Yang, and Jian Yang. Generalized focal loss: Towards efficient representation learning for dense object detection. IEEE transactions on pattern analysis and machine intelligence, 45(3):3139-3153, 2022.
+Xiaojie Li, Lu Yang, Qing Song, and Fuqiang Zhou. Detector-in-detector: Multi-level analysis for human-parts. In Computer Vision-ACCV 2018: 14th Asian Conference on Computer Vision, Perth, Australia, December 2-6, 2018, Revised Selected Papers, Part II 14, pp. 228-240. Springer, 2019.
+Matthieu Lin, Chuming Li, Xingyuan Bu, Ming Sun, Chen Lin, Junjie Yan, Wanli Ouyang, and Zhidong Deng. Detr for crowd pedestrian detection. arXiv preprint arXiv:2012.06785, 2020.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740-755. Springer, 2014.
+Tsung-Yi Lin, Piotr Dólar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2117-2125, 2017a.
+Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980-2988, 2017b.
+Songtao Liu, Di Huang, and Yunhong Wang. Adaptive nms: Refining pedestrian detection in a crowd. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6459-6468, 2019.
+Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In Computer Vision-ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part I 14, pp. 21-37. Springer, 2016.
+Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10012-10022, 2021.
+Debapriya Maji, Soyeb Nagori, Manu Mathew, and Deepak Poddar. Yolo-pose: Enhancing yolo for multi person pose estimation using object keypoint similarity loss. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2637-2646, 2022.
+Supreeth Narasimhaswamy, Trung Nguyen, and Minh Hoai Nguyen. Detecting hands and recognizing physical contact in the wild. Advances in neural information processing systems, 33: 7841-7851, 2020.
+Supreeth Narasimhaswamy, Thanh Nguyen, Mingzhen Huang, and Minh Hoai. Whose hands are these? hand detection and hand-body association in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4889-4899, 2022.
+Alejandro Newell, Zhiao Huang, and Jia Deng. Associative embedding: End-to-end learning for joint detection and grouping. Advances in neural information processing systems, 30, 2017.
+
+Xuecheng Nie, Jiashi Feng, Jianfeng Zhang, and Shuicheng Yan. Single-stage multi-person pose machines. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 6951-6960, 2019.
+Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019.
+Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018.
+Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 779-788, 2016.
+Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems, 28, 2015.
+Herbert Robbins and Sutton Monro. A stochastic approximation method. The annals of mathematical statistics, pp. 400-407, 1951.
+Dandan Shan, Jiaqi Geng, Michelle Shu, and David F Fouhey. Understanding human hands in contact at internet scale. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9869-9878, 2020.
+Shuai Shao, Zijian Zhao, Boxun Li, Tete Xiao, Gang Yu, Xiangyu Zhang, and Jian Sun. Crowdhuman: A benchmark for detecting human in a crowd. arXiv preprint arXiv:1805.00123, 2018.
+Peize Sun, Rufeng Zhang, Yi Jiang, Tao Kong, Chenfeng Xu, Wei Zhan, Masayoshi Tomizuka, Lei Li, Zehuan Yuan, Changhu Wang, et al. Sparse r-cnn: End-to-end object detection with learnable proposals. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 14454-14463, 2021.
+Yi Tang, Baopu Li, Min Liu, Boyu Chen, Yaonan Wang, and Wanli Ouyang. Autopedestrian: an automatic data augmentation and loss function search scheme for pedestrian detection. IEEE Transactions on Image Processing, 30:8483-8496, 2021.
+Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9627-9636, 2019.
+Junfeng Wan, Jiangfan Deng, Xiaosong Qiu, and Feng Zhou. Body-face joint detection via embedding and head hook. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2959-2968, 2021.
+Chien-Yao Wang, Alexey Bochkovskiy, and Hong-Yuan Mark Liao. Yolov7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023a.
+Chien-Yao Wang, Alexey Bochkovskiy, and Hong-Yuan Mark Liao. Yolov7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7464-7475, 2023b.
+Tiancai Wang, Tong Yang, Martin Danelljan, Fahad Shahbaz Khan, Xiangyu Zhang, and Jian Sun. Learning human-object interaction detection using interaction points. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4116-4125, 2020.
+Zixuan Xu, Banghuai Li, Ye Yuan, and Anhong Dang. Beta r-cnn: Looking into pedestrian detection from another perspective. Advances in Neural Information Processing Systems, 33:19953-19963, 2020.
+
+Jie Yang, Ailing Zeng, Shilong Liu, Feng Li, Ruimao Zhang, and Lei Zhang. Explicit box detection unifies end-to-end multi-person pose estimation. In International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=s4WVupnJjmX.
+Lu Yang, Qing Song, Zhihui Wang, Mengjie Hu, and Chun Liu. Hier r-cnn: Instance-level human parts detection and a new benchmark. IEEE Transactions on Image Processing, 30:39-54, 2020.
+Shuo Yang, Ping Luo, Chen-Change Loy, and Xiaou Tang. Wider face: A face detection benchmark. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5525-5533, 2016.
+Hang Yu, Yufei Xu, Jing Zhang, Wei Zhao, Ziyu Guan, and Dacheng Tao. Ap-10k: A benchmark for animal pose estimation in the wild. arXiv preprint arXiv:2108.12617, 2021.
+Duncan Zauss, Sven Kreiss, and Alexandre Alahi. Keypoint communities. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 11057-11066, 2021.
+Kevin Zhang, Feng Xiong, Peize Sun, Li Hu, Boxun Li, and Gang Yu. Double anchor r-cnn for human detection in a crowd. arXiv preprint arXiv:1909.09998, 2019.
+Yuang Zhang, Huanyu He, Jianguo Li, Yuxi Li, John See, and Weiyao Lin. Variational pedestrian detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11622-11631, 2021.
+Anlin Zheng, Yang Zhang, Xiangyu Zhang, Xiaojuan Qi, and Jian Sun. Progressive end-to-end object detection in crowded scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 857-866, 2022.
+Huayi Zhou, Fei Jiang, and Ruimin Shen. Who are raising their hands? hand-raiser seeking based on object detection and pose estimation. In *Asian Conference on Machine Learning*, pp. 470-485. PMLR, 2018.
+Huayi Zhou, Fei Jiang, and Hongtao Lu. Body-part joint detection and association via extended object representation. In 2023 IEEE International Conference on Multimedia and Expo (ICME), pp. 168-173. IEEE, 2023a.
+Huayi Zhou, Fei Jiang, Jiaxin Si, Yue Ding, and Hongtao Lu. Bpjdet: Extended object representation for generic body-part joint detection. arXiv preprint arXiv:2304.10765, 2023b.
+Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. International Conference on Learning Representations, 2020.
+
+
Methods
Stage
MR-2↓ body
MR-2↓ face
AP↑ body
AP↑ face
mMR-2↓ body-face
RetinaNet+POS (2017b)
One
52.3
60.1
79.6
58.0
73.7
RetinaNet+BFJ (2017b)
One
52.7
59.7
80.0
58.7
63.7
FPN+POS (2017a)
Two
43.5
54.3
87.8
70.3
66.0
FPN+BFJ (2017a)
Two
43.4
53.2
88.8
70.0
52.5
CrowdDet+POS (2020)
Two
41.9
54.1
90.7
69.6
64.5
CrowdDet+BFJ (2020)
Two
41.9
53.1
90.3
70.5
52.3
BPJDet (YOLOv5s6) (2023a)
One
41.3
45.9
89.5
80.8
51.4
BPJDet (YOLOv5m6) (2023a)
One
39.7
45.0
90.7
82.2
50.6
BPJDet (YOLOv5l6) (2023a)
One
40.7
46.3
89.5
81.6
50.1
Ours (YOLOv7)
One
36.5
44.7
91.6
81.6
50.8
Ours (YOLOv5l6)
One
37.5
45.3
91.4
81.2
50.9
+
+Table 5: Quantitative evaluation on CrowdHuman for the face-body association task.
+
+
Methods
Joint Detect?
Backbone
body MR-2↓
body AP↑
mMR-2↓
Adaptive-NMS (2019)
X
CNN
49.7
84.7
—
PBM (2020)
X
CNN
43.3
89.3
—
CrowdDet (2020)
X
CNN
41.4
90.7
—
AEVB (2021)
X
CNN
40.7
—
—
AutoPedestrian (2021)
X
CNN
40.6
—
—
Beta RCNN(KLth=7) (2020)
X
CNN
40.3
88.2
—
PedHunter (2020a)
X
CNN
39.5
—
—
Sparse-RCNN (2021)
X
DETR
44.8
91.3
—
Deformable-DETR (2020)
X
DETR
43.7
91.5
—
PED-DETR (2020)
X
DETR
43.7
91.6
—
Iter-E2EDET (2022)
X
DETR
41.6
92.5
—
DA-RCNN (2019)
✓
CNN
52.3
—
—
DA-RCNN + J-NMS (2019)
✓
CNN
51.8
—
—
JointDet (2020b)
✓
CNN
46.5
—
—
BPJDet (YOLOv5s6) (2023b)
✓
CNN
41.3
89.5
51.4
BPJDet (YOLOv5m6) (2023b)
✓
CNN
39.7
90.7
50.6
BPJDet (YOLOv5l6) (2023b)
✓
CNN
40.7
89.5
50.1
Ours (YOLOv7)
✓
CNN
36.5
91.6
50.8
Ours (YOLOv5l6)
✓
CNN
37.5
91.4
50.9
+
+Table 6: The performance comparison of our method for the joint face-body detection task with other crowded person detection methods in the val-set of CrowdHuman.
+
+# A APPENDIX
+
+# A.1 EXPERIMENTS ON CROWDHUMAN
+
+We additionally conduct experiments on the CrowdHuman dataset (Shao et al., 2018). CrowdHuman is a dataset tailored for crowded scenarios, providing individual annotations for each pedestrian. This dataset includes 15,000 training images and 4,375 validation images. The initial annotations include boxes for visible bodies and heads. Labels of faces are added by BFJDet (Wan et al., 2021) for the body-face association.
+
+In our experiments, the input image resolution is $1536 \times 1536$ , and the batch size is 12. The other settings are the same as in the main paper. During inference, we set the NMS parameters as: the body thresholds $\tau_{conf}^{b} = 0.05$ , $\tau_{iou}^{b} = 0.6$ ; while the part thresholds $\tau_{conf}^{p} = 0.1$ , $\tau_{iou}^{p} = 0.3$ as in BPJDet (Zhou et al., 2023b).
+
+We benchmark our approach for the face-body association task utilizing the CrowdHuman dataset (Shao et al., 2018). The results, as illustrated in Table 5, draw a comparison between our proposed PBADet and existing methods. Performance-wise, PBADet is comparable with BPJDet, with our PBADet (YOLOv7) achieving the best metrics in $\mathrm{MR}^{-2}$ for both body and face, as well as AP for the body. It's essential to highlight that the face-body association task is singular in nature, involving just one part. Consequently, the advantages of our method over BPJDet are not as pronounced as seen in scenarios with multiple parts-to-body associations, such as on the BodyHands and COCO-HumanParts datasets.
+
+Besides, we also try to compare our joint detector $PBADet$ with other methods specifically designed for crowded person detection, either CNN-based or DETR-based (Carion et al., 2020). As shown in Table 6, apart from obtaining the best $\mathrm{MR}^{-2}$ result for body detection, our $PBADet$ achieves a comparable AP performance with those cumbersome DETR-based detectors such as PED-DETR (Lin et al., 2020) and Iter-E2EDET (Zheng et al., 2022). Comparing with the counterpart BPJDet, our superiority is still evident. This indicates that our proposed $PBADet$ for addressing the face-body association task can keep a better balance between detection and association.
+
+A.2 QUANTITATIVE COMPARISON TO MULTI-PERSON POSE ESTIMATION
+
+
ED-Pose (2023)
Ours
Parts
Precision↑
Recall↑
F1↑
Precision↑
Recall↑
F1↑
lefthand
18.36
30.34
22.87
37.63
60.82
46.50
righthand
19.57
31.59
24.17
38.58
61.26
47.34
leftfoot
29.32
65.28
40.46
41.56
66.24
51.08
rightfoot
29.13
65.58
40.34
40.86
65.55
50.34
all parts
24.09
45.51
31.51
39.41
63.09
48.52
+
+Table 7: Comparison with ED-Pose (Yang et al., 2023), a state-of-the-art multi-person pose estimation method.
+
+We compare our method with ED-Pose (Yang et al., 2023), a current leading method in multi-person pose estimation. A qualitative comparison with ED-Pose on images from COCO (Lin et al., 2014) is presented in Figure 5.
+
+For a fair and meaningful quantitative comparison, we conducted evaluations on the COCO validation set (Lin et al., 2014), as ED-Pose was also trained on the COCO dataset. This validation set contains 2,693 images, each featuring at least one person. To ensure consistency, we utilized the ground truth body-part bounding boxes from COCO-HumanParts, which are derived from the original COCO annotations. We excluded facial and head parts due to their inconsistent number of keypoints and focused on four challenging and smaller parts: left hand, right hand, left foot, and right foot, which can be determined by one keypoint. For evaluation, we used the ED-Pose model (Swin-L) trained on the COCO training set and our PBADet model (YOLOv5l6) trained on the COCO-HumanParts training set.
+
+In assessing performance, we considered a predicted keypoint by ED-Pose as a true positive if it fell within a ground truth part box. In favor of ED-Pose, we do not use a part detection model but directly use the ground truth part boxes. For PBADet, a predicted part box with successful part-body association was deemed a true positive when it achieved an IoU greater than 0.5 with the ground truth box. The results, as shown in the table below, indicate that PBADet demonstrates superior robustness in part-body association compared to ED-Pose, especially in the precision, recall, and F1 score metrics for the selected body parts. This comparative analysis underscores the efficacy of PBADet in handling part-body associations, affirming its robustness and precision over existing methods in this domain.
+
+# A.3 EXPERIMENTS ON ANIMAL DATASETS
+
+We expand our research to include experiments on AnimalPose (Cao et al., 2019) and AP-10K (Yu et al., 2021) to demonstrate our model's scalability and performance in domains beyond human part-to-body associations.
+
+
+Figure 6: Qualitative results on AP-10K (Yu et al., 2021).
+
+Our study includes five common quadruped animals: dogs, cats, sheep, horses, and cows. These animals are chosen due to the similarity in their anatomical structure, particularly having five identifiable parts: head and four feet. This similarity allows us to treat these diverse animal types as a single class for analysis purposes. The body bounding boxes for these animals are derived from the provided ground truth labels in the datasets, while the part bounding boxes are generated based on keypoint annotations. In our experiments, we use 4,608 images with 6,117 instances of animal bodies from AnimalPose (Cao et al., 2019) for training and use 2,000 images containing 7,962 body instances from AP-10K (Yu et al., 2021) for evaluation. We train our PBADet (YOLOv5l6) model with the same experimental setup as described in Section 4.1 of the main paper.
+
+Qualitative results, as illustrated in Figure 6, showcase successful part-body association in these animals. These outcomes affirm that extending our method to quadruped animals not only is feasible but also yields convincing and meaningful results, demonstrating the potential of our approach for broader applications in part-body association tasks across different domains.
+
+A.4 MORE ABLATION STUDY
+
+
Methods
Param (M)
Size
Hand AP↑
Cond. Accuracy↑
Joint AP↑
BPJDet (anchor-based body-to-part)
41.2
1536
85.3
86.80
78.13
Ours (anchor-based part-to-body)
36.9
1024
88.4
92.31
85.28
Ours (anchor-free part-to-body)
36.9
1024
89.1
92.62
85.98
+
+Table 8: Comparison of anchor-based vs. anchor-free backbones and body-to-part vs. part-to-body definitions.
+
+We conduct an ablation study to compare our model with the traditional anchor-based YOLOv7 model, using the same association definition of part-to-body center offset as in our approach. This comparison has been instrumental in highlighting the advantages of the anchor-free design, especially in the context of part-body association tasks. Our findings show that the anchor-free version of YOLOv7 outperforms its anchor-based counterpart, validating the effectiveness of our method. Furthermore, we compared the traditional anchor-based YOLOv7 model with BPJDet, which also adopts an anchor-based approach but utilizes a body-to-part association definition. This comparison demonstrates that our part-to-body association definition significantly enhances performance, offering clear evidence of the superiority of our approach over previous methods.
+
+A.5 DETAIL RESULTS OF COCOHUMANPARTS
+
+
All categories APs↑ (original / subordinate)
AP.5::.95
AP.5
AP.75
APS
APM
APL
Ours (YOLOv7)
42.7 / 41.5
69.5 / 67.9
43.5 / 42.2
31.4 / 30.3
65.8 / 64.4
66.7 / 63.3
Ours (YOLOv5l6)
43.0 / 41.8
70.0 / 68.4
43.7 / 42.4
31.5 / 30.3
66.2 / 65.0
67.2 / 64.4
+
+Table 9: Evaluation results of the proposed method on COCOHumanParts with all categories APs.
+
+In the original Hier R-CNN paper (Yang et al., 2020), small objects are further categorized into small and tiny objects, and AP for small objects is not explicitly provided. Similarly, another comparison
+
+method, BPJDet (Zhou et al., 2023b), also does not offer AP details for small objects. We further include the results of AP.75 and $\mathrm{AP}_S$ in Table 9 for transparency and comparison to future work. We emphasize that Table 2 demonstrates our method's competitive object detection accuracy relative to state-of-the-art approaches. More importantly, the critical metric for our task is association accuracy, where, as shown in Table 3, our method achieves superior performance.
\ No newline at end of file
diff --git a/pbadetaonestageanchorfreeapproachforpartbodyassociation/images.zip b/pbadetaonestageanchorfreeapproachforpartbodyassociation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..991ac0e25ffc5a9a5d676fa6445e99a4a489ed1a
--- /dev/null
+++ b/pbadetaonestageanchorfreeapproachforpartbodyassociation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bab9deca2722f1fa05b9259c477abf93e7443d45c5b86b7f4be8a0a0a8bc9a40
+size 1187087
diff --git a/pbadetaonestageanchorfreeapproachforpartbodyassociation/layout.json b/pbadetaonestageanchorfreeapproachforpartbodyassociation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..12089c1887d9854ddeda110c796147ab2ab1d9e4
--- /dev/null
+++ b/pbadetaonestageanchorfreeapproachforpartbodyassociation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2f0fcc5356798796733703fbd8a1c408ab1682e4d133302e8318d71c729178c3
+size 503688
diff --git a/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_content_list.json b/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6fa669bae0b533ec25dd90a8a062df59508e4521
--- /dev/null
+++ b/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5059549c00775c6d2227c0e884b9d4743cf80a5232906f5703eba7555198025f
+size 86506
diff --git a/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_model.json b/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..f6a1c9781bb385a5d96b3c3b847c6df63b4b653f
--- /dev/null
+++ b/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c0d12bc3940fed85fbd562aec4168bc7de652193bc4ad335566fd666cfd4218c
+size 108389
diff --git a/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_origin.pdf b/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..538b84d695722a71e0adfda07dc3a93f008dcaf7
--- /dev/null
+++ b/pbllmpartiallybinarizedlargelanguagemodels/8a299aa1-365e-4e20-9a42-b23acb2ae608_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:042cb48e144c46c39600001a9cf2f6d353fb3453c1105efcd12f635fdf2c0704
+size 986070
diff --git a/pbllmpartiallybinarizedlargelanguagemodels/full.md b/pbllmpartiallybinarizedlargelanguagemodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c962742c733826a9dd6ab34c15688b603a2b5de1
--- /dev/null
+++ b/pbllmpartiallybinarizedlargelanguagemodels/full.md
@@ -0,0 +1,362 @@
+# PB-LLM: PARTIALLY BINARIZED LARGE LANGUAGE MODELS
+
+Zhihang Yuan
+
+Houmo AI
+
+Zhen Dong
+
+UC Berkeley
+
+# ABSTRACT
+
+This paper explores network binarization, a radical form of quantization, compressing model weights to a single bit, specifically for Large Language Models (LLMs) compression. Due to previous binarization methods collapsing LLMs, we propose a novel approach, Partially-Binarized LLM (PB-LLM), which can achieve extreme low-bit quantization while maintaining the linguistic reasoning capacity of quantized LLMs. Specifically, our exploration first uncovers the ineffectiveness of naive applications of existing binarization algorithms and highlights the imperative role of salient weights in achieving low-bit quantization. Thus, PB-LLM filters a small ratio of salient weights during binarization, allocating them to higher-bit storage, i.e., partially-binarization. PB-LLM is extended to recover the capacities of quantized LMMs, by analyzing from the perspective of post-training quantization (PTQ) and quantization-aware training (QAT). Under PTQ, combining the concepts from GPTQ, we reconstruct the binarized weight matrix guided by the Hessian matrix and successfully recover the reasoning capacity of PB-LLM in low-bit. Under QAT, we freeze the salient weights during training, explore the derivation of optimal scaling factors crucial for minimizing the quantization error, and propose a scaling mechanism based on this derived scaling strategy for residual binarized weights. Those explorations and the developed methodologies significantly contribute to rejuvenating the performance of low-bit quantized LLMs and present substantial advancements in the field of network binarization for LLMs. The code is available at PB-LLM.
+
+# 1 INTRODUCTION
+
+Recently, large language models (LLMs) have gained significant traction in artificial intelligence. It can be attributed to the success of models such as ChatGPT [Brown et al., 2020, Ouyang et al., 2022]. Following its lead, other LLMs such as OPT [Zhang et al., 2022], BLOOM [Scao et al., 2022], and LLaMA [Touvron et al., 2023] have emerged, proving that an increase in model size typically results in enhanced capabilities. As a result, models with tens to hundreds of billions of parameters have become the norm. However, their vast size poses considerable deployment challenges on memory-constrained devices. A model such as the LLAMA-65B (with 65 billion parameters) requires at least 130GB of memory for inference - a number that often exceeds the capacity of a single GPU or server.
+
+Many methods have been proposed to reduce the memory consumption of LLMs [Yuan et al., 2024]. Those methods can be categorized into weight quantization [Dettmers et al., 2022], network pruning [Frantar and Alistarh, 2023], and low-rank factorization [Zhang et al., 2023]. Among these compression paradigms, weight quantization is particularly prominent and widely adopted for LLMs. Since it preserves the original model architecture and leverages well-trained LLMs' full-precision checkpoints, the compression process is greatly simplified [Zhu et al., 2023]. However, state-of-the-art LLM quantization methods show a marked decline in quality beyond 4 bits [Liu et al., 2023a].
+
+More aggressive compression methods are required to push the LLM quantization into the lower bit range. The network binarization technique stands out, reducing the bit-width of weights to just one bit [Helwegen et al., 2019, Rusci et al., 2020, Qin et al., 2020a; 2023]. The binarized models take little storage and memory, and accelerate the inference by efficient bitwise operations. Compared to other aggressive compression technologies like high-sparsity pruning, network binarization has potent topological generics, as it only applies to parameters. Binarization is widely studied in
+
+
+(a) One basic block of the Partially-Binarized LLM.
+
+
+
+
+(b) Performance on BoolQ.
+Figure 1: (a) We introduce Partially-Binarized Large Language Model (PB-LLM), where a small subset of the weights of the LLM are frozen and preserved with higher bit precision, while the remaining weights are binarized utilizing an optimal scaling factor strategy; (b) By using PB-LLM, an extremely low-bit LLM can be acquired efficiently (i.e., quantization-aware training converges quickly) while maintaining its language reasoning capabilities.
+
+academic research as a standalone compression technique, rather than simply a 1-bit specialization of quantization. Some SoTA binarization algorithms have even achieved full-precision performance on large-scale tasks, e.g., ReActNet [Liu et al., 2020a] for ImageNet classification [Deng et al., 2009]. It is theoretically possible to significantly lower the LLM quantization if we generalize the idea of binarizing the weights of LLMs.
+
+In this paper, we explore network binarization specifically for LLM quantization and propose Partially-binarized LLMs (abbreviated as PB-LLM). This methodology aims to achieve extreme quantization to the lowest possible bit, while maintaining the language reasoning capacity inherent in LLMs. The explorations indicate that simple adaptations of existing binarization algorithms do not work well for LLM quantization. As a result of this realization, attention is directed towards the salient-weight property of LLM quantization. In order to achieve the desired extreme low-bit quantization, salient weights must be fully exploited. We investigate the salient weights in aspects of their detection criteria and granularity, as well as the storage costs. Then, we propose the partially binarized matrix, storing the salient weights in higher bits. After establishing the foundation of PB-LLM, the exploration extends to regain the lost reasoning capacity of the quantized LLMs, under the frameworks of posttraining quantization (PTQ) and quantization-aware training (QAT). In the view of PTQ, inspired by the concepts of GPTQ [Frantar et al., 2022], we reconstruct the PB-LLM matrix guided by the Hessian matrix and successfully recover the reasoning capacity of PB-LLM in low-bit. In the view of QAT, salient weights are frozen throughout the binarization process for efficient training. In addition, from the perspective of quantization error minimization, we explore how binarized LLMs should be scaled based on the ideal scaling factor. We scale the binarized weight based on the derived scaling strategy shown in Fig. 1a. Low-bit quantized LLMs can significantly improve their performance with such explorations. Benefited from explorations of PTQ and QAT, PB-LLM can efficiently obtain an extremely low-bit LLM with comparable reasoning capacity (see Fig. 1b). The methodologies applied and the insights gained within this study stand to contribute substantially to the advancement of knowledge and development in the field of network binarization for LLMs.
+
+# 2 RELATED WORK
+
+# 2.1 NETWORK BINARIZATION.
+
+Binarization uses the sign function to binarize weights and activations to $\pm 1$ . To eliminate the vanishing gradient issue caused by the sign function in the binarization, the straight-through estimator (STE) [Bengio et al., 2013] is utilized for the network backpropagation. Based on this archetype, copious studies contribute to improving the performance of BNNs. Binarization techniques can
+
+be broadly classified into three categories: the enhancement of training objectives, the reduction of gradient mismatch, and the minimization of quantization errors [Qin et al., 2020b; 2023, Yuan and Agaian, 2023]. To illustrate: Gradient Mismatch: Liu et al. [2020b] introduce double residual connections paired with full-precision downsampling layers. This approach addresses the gradient vanishing problem that arises due to binarization. Training Objectives: Martinez et al. [2020], Shang et al. [2022a,b; 2021] focus on optimizing the loss function during training. They suggest aligning the spatial attention maps derived from both binary and real-valued convolutions. Quantization Error Minimization: Rastegari et al. [2016] identify that the disparity in quantization between full-precision and binarized weights can impede the representational abilities of BNNs. As a solution, they introduce a scaling factor—determined by the L1 norm—for both weights and activation functions.
+
+While binarization has proven successful in computer vision, its exploration in natural language processing remains limited. Existing methods [Bai et al., 2020, Qin et al., 2022, Liu et al., 2022; 2023b] primarily target smaller language models (e.g., BERT-base [Devlin et al., 2018] with 110M parameters) potentially hindering their generalization to larger ones (e.g., LLAMA-7B [Touvron et al., 2023] with 7B parameters). We investigate binarization for LLMs comprehensively in this paper and propose PB-LLM, which is an attempt to compress LLMs using binarization.
+
+# 2.2 LARGE LANGUAGE MODEL QUANTIZATION.
+
+Quantization, a prominent method in model compression, addresses the storage and computational overhead of deep learning models. Recent research efforts successfully apply quantization to compress Large Language Models (LLMs), including Quantization-Aware Training (QAT) and Post-Training Quantization (PTQ).
+
+In the domain of QAT, innovative strategies like LLM-QAT [Liu et al., 2023a] address challenges in acquiring training data for LLMs by leveraging pre-trained models for data-free distillation. Additionally, techniques such as QLORA [Dettmers et al., 2023a] focus on parameter-efficient fine-tuning (PEFT), expediting model compression and inference acceleration. In PTQ, approaches range from quantizing only the weights of LLMs to jointly quantizing both weights and activations. Methods like GPTQ [Frantar et al., 2022] and QuIP [Chee et al., 2023] optimize matrix multiplications and propose novel layer-wise quantization techniques achieving high compression rates. SqueezeLLM [Kim et al., 2023] and SpQR [Dettmers et al., 2023b] identify weights that lead to particularly large quantization errors and subsequently storing them with higher precision to mitigate the accuracy degradation caused by weight quantization. AWQ [Lin et al., 2023] and OWQ [Lee et al., 2023] contend that when quantizing weights, it is crucial to account for the impact of activation outliers on weights. Norm Tweaking [Li et al., 2023] addresses the issue of activation value deviation by training LayerNorm. For activation quantization, ZeroQuant [Yao et al., 2022] proposes a fine-grained quantization method that can be applied to both weights and activations. Methods like SmoothQuant [Xiao et al., 2022] and Outlier Suppression [Wei et al., 2022; 2023] shift the quantization challenge from activations to weights by proposing a mathematically equivalent per-channel scaling transformation. Omni-Quant [Shao et al., 2023] further enhances performance by training the quantization parameters. RPTQ [Yuan et al., 2023a] proposed proposes performance improvement through grouped quantization after clustering similar channels. In this paper, our primary focus lies in the binarization of weights exclusively, employing both PTQ and QAT methodologies.
+
+# 3 PARTIALLY BINARIZING LARGE LANGUAGE MODELS (PB-LLM)
+
+In this section, we elaborate on the methodology of Partially Binarizing Large Language Models, named PB-LLM. To begin, a review of the foundational framework of binarized neural networks is presented, showcasing its applicability and limitation to LLM quantization. Subsequently, a novel format for the quantized matrix is formulated, specifically tailored for the binarization of LLMs. Taking advantage of the proposed partially-binarized weight matrix, we delve into its potential in the realms of post-training quantization and training-aware training for LLMs, to break the trade-off between bit-width and performance. It is crucial to note that, due to constraints in computational resources, the methodology exploration predominantly utilizes OPT-1.3B [Zhang et al., 2022] to perform the majority of experiments. Given the space constraints, this section primarily focuses on key aspects of the methodology. For detailed discussions, exact result values, and specific implementation details in codes, readers are referred to the supplemental materials.
+
+# 3.1 PRELIMINARY: NETWORK BINARIZATION
+
+To begin with, we briefly review the general concept of network binarization and binarized neural networks (BNNs) in [Courbariaux et al., 2016, Hubara et al., 2016]. As most estimizable quantized structures of LLMs are linear layers (see Fig. 1a) in LLMs, we use a one-layer Perceptron to show the training and inference processes of the BNN. The one-layer neural network is defined as $f(\mathbf{x}) = (\mathbf{W})(\mathbf{a})$ , where $\mathbf{a} \in \mathbb{R}^{d_i}$ is the input activation and $\mathbf{W}: \mathbb{R}^{d_i} \longmapsto \mathbb{R}^{d_o}$ stands for the weight matrix, with $d_{i}$ and $d_{o}$ representing the sizes of the input and output of the layer, respectively.
+
+The goal of network binarization is to represent floating-point (FP) weights, denoted as $\mathbf{W}_F$ , and/or FP activations $\mathbf{a}_F$ as 1-bit (i.e., $., \pm 1$ ) values [Qin et al., 2020b]. Networks utilizing this representation are referred to as BNNs. BNNs diverge from FP neural networks in their forward operations and in the approximation of backward gradients. In the forward propagation, the sign function is used for binarizing FP values of weights:
+
+$$
+\text {F o r w a r d :} \operatorname {s i g n} (x) = \left\{ \begin{array}{l l} + 1 & x \geq 0 \\ - 1 & x < 0. \end{array} \right. \tag {1}
+$$
+
+Specifically, in the training process of binarized network, the BNN maintains FP latent weights $\mathbf{W}_F$ for gradient updates, and the updated weight matrix $\mathbf{W}_F$ is binarized into the binary weight matrix $\mathbf{W}_B$ via the binarize function $\mathrm{sign}(\cdot)$ , i.e. $\mathbf{W}_B = \mathrm{sign}(\mathbf{W}_F)$ . Then the intermediate activation map (full-precision) of this layer is produced by $\mathbf{A}_{F,o} = \mathbf{W}_B\mathbf{A}_{F,i}$ . For inference efficiency, BNNs with 1-bit weights significantly reduce the memory cost of inference. Theoretically, BNNs can binarize both weights and activations to 1-bit, providing a $32\mathrm{x}$ compression in memory cost and a $64\mathrm{x}$ acceleration in inference speed, by replacing FP multiplications in conventional floating-point networks with Xnor-Bitcount operations. However, recent studies highlight that the weights of LLMs as the main contributor to memory overhead [Kim et al., 2023], and thus we primarily aim to curtail memory costs. Therefore, in this pivotal exploration of binarized LLMs, our attention is specifically centered on weight binarization, foregoing the simultaneous binarization of weights and activations.
+
+In the backward propagation, the main challenge is that the pervasive sign functions are theoretically nondifferentiable, and thus extremely destroy the gradient chain in the backward propagation. To address this problem, researchers widely exploit the straight-through estimator (STE) [Bengio et al., 2013] to numerically approximate the derivative of the whole BNN [Qin et al., 2020b], i.e.,
+
+$$
+\text {B a c k w a r d :} \frac {\partial \mathcal {L}}{\partial x} = \left\{ \begin{array}{l l} \frac {\partial \mathcal {L}}{\partial \operatorname {s i g n} (x)} & | x | \leq 1 \\ 0 & | x | > 1, \end{array} \right. \tag {2}
+$$
+
+which makes the optimization of BNN accessible.
+
+We first investigate the possibility of implementing binarization to LLM quantization. Specifically, following the binarization benchmark in BiBench [Qin et al., 2023], we generalize some representative binarization methods into LLM quantization scenarios. BNN [Hubara et al., 2016], XNOR [Rastegari et al., 2016], Bi-Real [Liu et al., 2020b], ReCU [Xu et al., 2021a] and FDA [Xu et al., 2021b] are re-implemented to quantize LLMs, particularly to OPT [Zhang et al., 2022]. Training details are illustrated in the Sec. 4. The results evaluated on seven zero-shot
+
+common sense reasoning tasks are shown in Fig. 2. We can see that the LLMs binarized via the existing popular binarization algorithms perform worse than random guesses, showing that the existing binarization methods are not suitable for LLM binarization.
+
+
+Figure 2: We implement five renowned binarization methods on LLMs and assess the resultant binarized LLMs across seven zero-shot common sense reasoning tasks. Random represents the hypothetical worst baseline, indicating random guesses, while FP stands as the optimal baseline, representing full-precision OPT-1.3B. The exact values corresponding to this radar graph are detailed in the Appendix.
+
+# 3.2 PARTIALLY BINARIZED WEIGHT MATRIX
+
+In the low-bit quantization of Transformers, a significant challenge is managing the salient weights, as they can unnecessarily extend the quantization range [Kovaleva et al., 2021]. Several outlier-aware
+
+LLM compression methods have been explored to tackle this issue [Dettmers et al., 2022, Wei et al., 2022, Kim et al., 2023, Lin et al., 2023, Yuan et al., 2023b]. Notably, SqueezeLLM [Kim et al., 2023] provides a generalized methodology for handling outliers in weight values during 4-bit LLM post-training quantization. Concurrently, AWQ [Lin et al., 2023] demonstrates that preserving only $1\%$ of significant weights can benefit 4-bit LLM quantization. Motivated by existing research, this study also seeks to optimize the treatment of salient weights while binarizing most of weights. We present Partially-Binarized LLMs (PB-LLM), a method involving the selective binarization of the LLMs' weight matrix, wherein a minor fraction of weights is kept in high bits for enhanced language capacity.
+
+# 3.2.1 SALIENT WEIGHT: CRITERIA, GRANULARITY, AND COST
+
+Beyond the most straightforward method of choosing salient weights—selecting based on magnitude element-wise—we conduct a thorough investigation into salient weight detection from two perspectives: criteria and granularity. For criteria, we compare Magnitude- and Hessian-based methods, and for granularity, we explore both element-wise and column-wise approaches. In addition, we discuss the cost of storing matrix weights in a mixed-precision manner.
+
+Criteria: Magnitude vs. Hessian. Beyond the identification of salient weights through magnitude, alternative criteria have also been examined. The Hessian metric emerges as a crucial factor in LLM quantization, as elucidated in [Dong et al., 2019, Frantar et al., 2022, Frantar and Alistarh, 2023], particularly in relation to post-training quantization for LLMs (details regarding the Hessian criteria for PTQ can be found in Sec. 3.3). However, we observe that the selection of salient weights, whether by magnitude or Hessian, does not significantly impact the efficacy of LLM partial binarization, especially under the framework of QAT. Consequently, magnitude is elected as the preferred criterion for the identification of salient weights in both PTQ and QAT, primarily due to its simplicity and efficacy in distinguishing critical weight components.
+
+Granularity: Element-wise vs. Column-wise. Our investigations reveal that adopting a column-wise approach for selecting salient weights has the potential to impair the performance of binarization. Visualization of the salient weights' distribution within the matrix, as depicted in Fig. 3 (where the white dots represent the filtered salient weights), disclosed a random and uniform scattering of these weights. Given the absence of any discernable column-wise pattern in the distribution of salient weights, a column-wise filtration method is deemed unsuitable. This scattered and uniform distribution necessitates an element-wise approach for effective filtration in the binarization process.
+
+
+Figure 3: Distribution of $5\%$ salient weight.
+
+Salient Weight Storing Cost. The additional overhead for storing the salient weights is acceptable. The overall bit number, $N_{bit}$ must adhere to the following condition:
+
+$$
+N _ {b i t} \leq \overbrace {1 * r _ {\text {b i n a r y}}} ^ {\text {f o r b i n a r y w e i g h t s}} + \overbrace {N _ {\text {s a l i e n t - b i t}} * (1 - r _ {\text {b i n a r y}})} ^ {\text {f o r s a l i e n t w e i g h t s}} + \overbrace {1} ^ {\text {f o r i n d e x s t o r i n g , c o u p l e b e o p t i m i z e d}}, \tag {3}
+$$
+
+Here, $r_{binary}$ denotes the ratio of the binarized weights, $N_{salient-bit}$ represents the number of bits allocated for storing salient weights (e.g., 8 bits), and the additional 1 bit is allocated for using the bitmap mechanism [Chan and Ioannidis, 1998] for index saving. It's important to note that employing bitmap for index storage is not the most efficient method and can be optimized further using sparse matrix storage methods such as Compressed Sparse Row (CSR) or Compressed Sparse Column (CSC) [Boršnik et al., 2014]; hence the use of $\leq$ instead of $=$ in Eq. 3. The relationship between the ratio of salient weights and the overall bit number is illustrated in Fig. 4, depicting that a lower ratio corresponds to a reduced overall bit number. For example, retaining $10\%$ of weights in 8 bits and binarizing the remaining $90\%$ equates to, at most, a 2.7-bit quantization.
+
+
+Figure 4: Variation in overall bit number $N_{bit}$ with the ratio of the salient weights $r_{binary}$ , where salient weights are stored in 8-bit.
+
+Table 1: Perplexity of C4 on OPT-1.3B quantized with RTN (without GPTQ) and PB-GPTQ. Magnitude criteria or Hessian criteria is used for detecting salient weights.
+
+
Salient Fraction
50%
20%
10%
5%
RTN Magnitude
24.5675
5892.0898
4889.0385
8023.1132
RTN Hessian
20.2512
2109.8522
7508.7788
6173.1611
PB-GPTQ Magnitude
18.3674
46.4093
895.0322
2880.6157
PB-GPTQ Hessian
17.7567
42.1157
165.6767
528.4877
PB-GPTQ Magnitude g=128
18.0293
57.2164
1230.8537
2662.7114
PB-GPTQ Hessian g=128
17.6000
45.9811
157.8825
646.3616
+
+# 3.3 POST-TRAINING QUANTIZATION FOR PB-LLMS
+
+After defining the partially-binarized matrix format, the next step is to recover the performance (i.e., the reasoning capacity in the literature of LLMs) of the quantized PB-LLM. In this section, we explore the weight binarization with post-training quantization (PTQ) methods. PTQ methods hold a prominent position in the realm of quantization techniques for LLMs due to their ease of implementation. They enable direct quantization of pre-trained LLMs without the need for a training dataset and additional training overhead. Therefore, we first explore the weight binarization within the PTQ framework.
+
+GPTQ [Frantar et al., 2022] is the most efficient and effective method for weight quantization [Zhu et al., 2023], capable of quantizing LLMs to 4-bit or even 2-bit. Therefore, we generalize the idea of GPTQ to the partial-binarization setting. Specifically, GPTQ quantizes the weights in LLM layer-by-layer to minimize the layer-wise quantization error:
+
+$$
+\underset {\hat {\mathbf {W}}} {\arg \min } \| \mathbf {W} \mathbf {X} - \hat {\mathbf {W}} \mathbf {X} \| _ {2} ^ {2} \tag {4}
+$$
+
+GPTQ quantizes a weight $w_{q}$ to $\hat{w}_{q}$ , calculates the compensation $\delta_{-q}$ for remaining weights $w_{-q}$ , and then applies the compensation factor to the remaining weights:
+
+$$
+\delta_ {- q} = \frac {w _ {q} - \hat {w _ {q}}}{[ \mathbf {H} ^ {- 1} ] _ {q q}} \cdot (\mathbf {H} ^ {- 1}) _ {:, q}, \quad w _ {- q} := w _ {- q} + \delta_ {- q}, \tag {5}
+$$
+
+where the $\mathbf{H}$ is the Hessian matrix of the layer-wise quantization error with respect to the weights and $w_{q}$ is the $q$ -th value in flattened weight matrix $\mathbf{W}$ . In GPTQ, weights are quantized iteratively and the remaining weights are updated until all weights have been quantized.
+
+We propose to use GPTQ to iteratively binarize the un-salient weights and quantize the salient weights to higher bit, and then apply the compensation to the remaining weights. Specifically, we first detect the salient weights $\mathbf{W}^{sal}$ and un-salient (to-be-binarized) weights $\mathbf{W}^{unsal}$ in the weight matrix $\mathbf{W} = \mathbf{W}^{sal} + \mathbf{W}^{unsal}$ . Drawing inspiration from SparseGPT [Frantar and Alistarh, 2023], we calculate the saliency metric, represented as $v_{i} = w_{i}^{2} / [\mathbf{H}^{-1}]_{ii}^{2}$ , for the purpose of detecting salient weights using Hessian criterion. The un-salient weights will be binarized to $\hat{\mathbf{W}}^{unsal}$ , and the salient weights will be quantized to higher bit $\hat{\mathbf{W}}^{sal}$ . We use asymmetric per-channel quantization for both salient and un-salient weights. For un-salient weight, we use the per-channel mean as zero point and calculate the optimal scaling factor $\alpha$ for the un-salient weights using the method in Sec. 3.4.2. We use MinMax metric to calibrate the scaling factor and zero point for salient weights.
+
+In the quantization process, we iteratively quantize the columns in the weight matrix $\mathbf{W}$ . For each column, we binarize the un-salient weights and quantize the salient weights, and then calculate the compensation for remaining weights, and then apply the compensation factor to the remaining columns of weights. This process is repeated until all the weights are quantized. The proposed method is denoted as PB-GPTQ. We also explore the fine-grained PB-GPTQ, which quantizes the weights in a group-wise manner. Specifically, the weight matrix is split into several groups, each group contains $g$ columns. In each group, we detect the salient weights and un-salient weights, and then calibrate to set the scaling factor and zero point using the weights in this group.
+
+The results are listed in Tab. 1. PB-GPTQ is significantly better than RTN. We note that the Hessian-based PB-GPTQ exhibits a superior performance compared to the Magnitude criterion PB-GPTQ. The group-wise PB-GPTQ performs better or worse than the non-group-wise PB-GPTQ, but the difference is not significant. Our analysis suggests that the disparity in scaling factors is not the primary determinant of binarization performance; hence, the introduction of group-wise methodology does not yield an enhancement in binarization performance. Subsequently, our next endeavor will involve the application of QAT to reduce the error introduced by weight binarization.
+
+# 3.4 QUANTIZATION-AWARE TRAINING FOR PB-LLMS
+
+In order to further enhance the reasoning capacity of the Partially-Binarized Large Language Models (PB-LLM), we extend our exploration by employing Quantization-aware Training (QAT) to meticulously train the quantized models. Because LLM training is difficult, we desire that PB-LLM training could be as efficient as possible. To realize efficient training for PB-LLM, we propose the Salient Weights Frozen and Optimal Scaling Factor for Binary Weights, targeting the salient weights and binarized weights, respectively.
+
+# 3.4.1 SALIENT WEIGHTS FROZEN
+
+To leverage the value of pretrained weights, we propose freezing the salient weights, determined by weight magnitude, prior to the weight binarization process. As illustrated in Fig. 1a, we initially filter out a number of weights from a pre-trained weight matrix—e.g., $2\%$ by magnitude—at the beginning of quantization-aware training, maintaining their fixed state throughout the training process. Examination of training efficiency (refer to Fig.5) suggests that these salient weights play a crucial role in LLM capacity. Maintaining the high bit representation of certain weights, aids in the training of quantized LLMs and reduces their optimization difficulty.
+
+
+Figure 5: Training Loss Curves: When only $2\%$ of weights are retained in their un-binarized state, the training loss converges more swiftly.
+
+# 3.4.2 OPTIMAL SCALING FACTOR FOR BINARY WEIGHTS.
+
+AWQ [Lin et al., 2023] enhances the weight-only quantization method for LLMs by optimizing scaling factors to mitigate the quantization error of quantized weights. Specifically, AWQ demonstrates that searching for empirically optimal scaling factors proves to be an effective strategy for reducing quantization errors and recovering the performance of the quantized models. Fortunately, in the context of LLM binarization, we have a better choice for scaling the binarized weights. There's no need to search for optimal scaling factors as they can be analytically derived. Specifically, we apply a column-wise scaling factor to binarized weights to reduce the binarization error, i.e., enforcing $\mathbf{w}_F = \alpha \bar{\mathbf{w}}_B$ . The optimal values of scaling factor $\alpha$ for the $\bar{\mathbf{w}}_B \in \{-1,1\}$ can be calculated by minimizing the L2 error:
+
+$$
+\alpha^ {\star} = \arg \min _ {\alpha \in \mathbb {R} _ {+}} \mathcal {J} (\alpha), \text {i n w h i c h} \mathcal {J} (\alpha) = \| \mathbf {w} _ {F} - \alpha \bar {\mathbf {w}} _ {B} \| _ {2} ^ {2} \tag {6}
+$$
+
+Following XNOR-Net [Rastegari et al., 2016], by expanding the below equation, we have
+
+$$
+\mathcal {J} (\alpha) = \alpha^ {2} \bar {\mathbf {w}} _ {B} ^ {T} \bar {\mathbf {w}} _ {B} - 2 \alpha \mathbf {w} _ {F} ^ {T} \bar {\mathbf {w}} _ {B} + \mathbf {w} _ {F} ^ {T} \mathbf {w} _ {F} \tag {7}
+$$
+
+For the vector with $\mathbf{w}_F\in \mathbb{R}^n$ we follow the traditional methods of binarizing weights [Hubara et al., 2016] by taking the sign of real-valued weights:
+
+$$
+\bar {\mathbf {w}} _ {B} ^ {i} = \operatorname {s i g n} \left(\mathbf {w} _ {F} ^ {i}\right) = \left\{ \begin{array}{l l} + 1, & \quad \mathbf {w} _ {F} ^ {i} \geq 0; \\ - 1, & \quad \mathbf {w} _ {F} ^ {i} < 0. \end{array} \right. \tag {8}
+$$
+
+In that case, $\bar{\mathbf{w}}_B^T\bar{\mathbf{w}}_B = n_{\mathbf{w}_F}$ , where $n_{\mathbf{w}_F}$ is number of elements in $\mathbf{w}_F$ , and $\alpha^{*}$ can be solved as:
+
+$$
+\alpha^ {*} = \frac {\mathbf {w} _ {F} ^ {T} \bar {\mathbf {w}} _ {B}}{n _ {\mathbf {w} _ {F}}} = \frac {\left\| \mathbf {w} _ {F} \right\| _ {1}}{n _ {\mathbf {w} _ {F}}}. \tag {9}
+$$
+
+A counterintuitive outcome emerges from the incorporation of salient-frozen and optimal-scaling mechanisms: directly
+
+deploying those two mechanisms to pre-trained LLM even without any retraining or fine-tuning, still results in commendable performance. For instance, applying these techniques to OPT-1.3B with $50\%$ salient weights (see Fig. 6) reveals that the partially-binarized OPT-1.3B retains a small amount of language capacity, corroborating the importance of a small number of salient weights in LLM quantization. Consequently, implementing just these two techniques—Outlier Frozen and Optimal Scaling Factor for Binary Weights—on pre-trained LLMs serves as an efficient starting point for training PB-LLM.
+
+
+Figure 6: Perplexity (PPL) on C4: When $50\%$ of the weights are maintained in their un-binarized state (equivalent to around 5-bit quantization), the untrained PB-LLM does not experience a total loss of reasoning capabilities.
+
+
+(a) BoolQ [Clark et al., 2019]
+
+
+
+
+(c) HellaSwag [Zellers et al., 2019]
+
+
+
+
+
+
+(b) PIQA [Bisk et al., 2020]
+
+
+(d) WinoGrande [Sakaguchi et al., 2021]
+
+
+
+
+(e)ARC-E [Clark et al.,2018]
+
+
+(f)ARC-C [Clark et al.,2018]
+
+
+(g) OBQA [Mihaylov et al., 2018]
+
+
+(h) Average on Seven Tasks
+
+
+(i)BoolQ [Clark et al., 2019]
+(m)ARC-E [Clark et al.,2018]
+Figure 7: QAT training results with $30\%$ salient weights PB-LLM (upper two lines): As fine-tuning epochs increase, quantized models swiftly regain their reasoning capacities, demonstrating the resilience and adaptability of PB-LLM in sustaining cognitive functionalities within models, despite substantial quantization; QAT training results with $5\%$ salient weights PB-LLM (bottom two lines): Existing LLM QAT methods exhibit an absolute failure when subjected to extremely-low bit conditions. In contrast, PB-LLM triumphs in restoring the reasoning capacities of low-bit quantized LLMs. This underlines the efficacy of PB-LLM in balancing quantization and performance, preserving the essential reasoning abilities of LLMs even under rigorous bit reduction.
+
+
+(j) PIQA [Bisk et al., 2020]
+(n)ARC-C [Clark et al.,2018]
+
+
+(k) HellaSwag [Zellers et al., 2019]
+(o) OBQA [Mihaylov et al., 2018]
+
+
+(I) WinoGrande [Sakaguchi et al., 2021]
+(p) Average on Seven Tasks
+
+Both of the above-proposed mechanisms are very effective when used during quantization-aware training of PB-LLM. The consequential outcomes are delineated in Figs.7a-7p. Observations from the presented results elucidate that optimizing using the partially-binarized quantization format is notably more straightforward compared to single-bit quantization. This empirical evidence corroborates the discussion regarding the rapid convergence property found in Sec.3.4.1, highlighting the efficacy and adaptability of our proposed methodology in optimizing LLMs within the constraints of partial binarization. From the perspective of QAT, PB-LLM emerges as more efficient in training compared to existing LLM QAT methods. For instance, while models like LLM-QAT [Liu et al., 2023a] necessitate up to 100K iterations for adequate training, PB-LLM remarkably achieves recovery of the performance of quantized LLMs in merely around 1-10K iterations.
+
+# 4 EXPERIMENTS
+
+Besides the exploration with OPT-1.3B in Sec. 3, we assess the effectiveness of PB-LLM by conducting experiments on LLaMA-7B [Touvron et al., 2023] and presenting results on various tasks.
+
+# 4.1 EXPERIMENTAL SETUP
+
+Dataset. In this study, the PB-LLM is trained using the RedPajama-simple-1B dataset, as the dataset for LLaMA training is not openly accessible. This dataset, RedPajama-1T, is structured to closely resemble the LLaMa paper and serves as a transparent, open-source alternative to LLM training
+
+Table 2: Zero-shot performance on Common Sense Reasoning tasks within a 4-bit setting. Reported results of previous works are documented in their papers. PB-LLM $30\%$ denotes the preservation of $30\%$ salient weights, and PB-LLM $10\%$ implies the preservation of $10\%$ salient weights.
+
+
Method
BoolQ
PIQA
HellaSwag
WinoGrande
ARC-E
ARC-C
OBQA
Avg
FP LLaMA-7B
76.8
79.3
76.1
70.0
73.0
48.0
57.6
68.7
RTN
71.2
77.3
72.7
66.9
68.8
46.4
52.8
65.2
SmoothQuant
67.7
76.0
69.4
66.7
66.9
43.0
50.6
63.0
LLM-QAT
75.5
78.3
74.0
69.0
70.0
45.0
55.4
66.6
PB-GPTQ 10%
62.3
55.9
27.7
49.3
29.3
20.1
10.6
36.5
PB-GPTQ 30%
73.5
74.9
47.5
64.9
61.3
32.4
25.2
54.2
PB-LLM 10%
68.9
67.8
68.1
67.4
58.7
42.9
50.6
60.6
PB-LLM 30%
75.7
78.0
74.3
69.7
69.0
45.6
55.8
66.9
+
+dataset. It amalgamates data from diverse sources including Commoncrawl, C4, GitHub, Wikipedia, Gutenberg Books3, ArXiv, and Stackexchange. RedPajama-simple-1B, representing a $0.1\%$ subset of RedPajama-1T, is substantially smaller than the typical datasets used for training other LLMs, making it a convenient choice for our experiments.
+
+Training Details. In the training process of our quantized network, we commence with a pretrained model for initialization. The optimization of the model is facilitated through the AdamW optimizer [Loshchilov and Hutter, 2017], applied with zero weight decay. We assign a batch size of 1 to each GPU and implement a learning rate of 2e-5, adhering to a cosine learning rate decay strategy. We only fine-tune our PB-LLM for 10K iterations.
+
+Evaluated Tasks. To eliminate the variance of evaluated performance, we evaluate the binarized LLMs on seven zero-shot common sense reasoning tasks, i.e., BoolQ [Clark et al., 2019], PIQA [Bisk et al., 2020], HellaSwag [Zellers et al., 2019], WinoGrande [Sakaguchi et al., 2021], ARC-Easy, ARC-Challenge [Clark et al., 2018], OBQA [Mihaylov et al., 2018]. We also along evulated the quantized moelds' perplexity scores on WikiText2 [Merit et al., 2016] and C4 [Raffel et al., 2020].
+
+# 4.2 RESULTS ON LLAMA
+
+Experiments were conducted on LLaMA-7B. The results of employing PB-GPTQ and PB-LLM are illustrated in Tabs. 2 and 3. When employing PTQ, PB-GPTQ exhibited commendable performance, particularly when the salient weight exceeded $30\%$ . Nevertheless, a noteworthy decline in the performance of the quantized network was observed when the salient weight was reduced to $10\%$ . On the other hand, employing QAT resulted in a notable improve
+
+Table 3: Perplexity of C4, wikitext2 and PTB on LLaMA-7b quantized with PTQ methods.
+
+
C4
WIKI
PTB
FP
7.3435
5.6770
41.1509
GPTQ 4b
8.6977
8.1368
57.9951
SparseGPT 50%
15.5949
12.829483
505.1396
PB-GPTQ 50%
8.1466
6.3089
54.8674
PB-GPTQ 20%
20.6057
17.1929
280.4353
PB-GPTQ 10%
72.1115
85.7838
708.4120
PB-GPTQ 5%
401.6475
619.1054
1687.1815
+
+ment in the performance. A comparison within a 4-bit quantization setting between PB-LLM $30\%$ and LLM-QAT in Tab. 2 reveals superior performance by our method. It is notable that PB-LLM is only fine-tuned for 10K iterations, whereas LLM-QAT underwent 100K iterations of training, showing its fast convergence property (refer to Sec. 3.4). The results under PB-LLM $10\%$ represent the outcomes of PB-LLM where $10\%$ of salient weights are preserved. This demonstrates the potential for advancing LLM quantization towards a fully 1-bit state.
+
+# 5 CONCLUSION
+
+In conclusion, this work is the first to implement network binarization for LLM quantification, introducing the novel Partially-binarized LLM (PB-LLM) methodology. This approach is meticulously designed to maintain linguistic reasoning capabilities of LLMs, even under extreme low-bit quantization. The research unearthed the significant role of salient weights in achieving extreme quantization and proposed innovative strategies like optimal scaling for effective binarization. This framework is extended to recover the capacities of quantized LMMs, by analyzing from the perspective of post-training quantization (PTQ) and quantization-aware training (QAT). The methodology is a significant stride in the realm of network binarization for LLMs.
+
+# REFERENCES
+
+Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020.
+Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744, 2022.
+Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022.
+Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2022.
+Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
+Zhihang Yuan, Yuzhang Shang, Yang Zhou, Zhen Dong, Chenhao Xue, Bingzhe Wu, Zhikai Li, Qingyi Gu, Yong Jae Lee, Yan Yan, et al. Llm inference unveiled: Survey and roofline model insights. arXiv preprint arXiv:2402.16363, 2024.
+Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. LIm. int8(): 8-bit matrix multiplication for transformers at scale. arXiv preprint arXiv:2208.07339, 2022.
+Elias Frantar and Dan Alistarh. Sparsegpt: Massive language models can be accurately pruned in one-shot. ICML, 2023.
+Mingyang Zhang, Chunhua Shen, Zhen Yang, Linlin Ou, Xinyi Yu, Bohan Zhuang, et al. Pruning meets low-rank parameter-efficient fine-tuning. arXiv preprint arXiv:2305.18403, 2023.
+Xunyu Zhu, Jian Li, Yong Liu, Can Ma, and Weiping Wang. A survey on model compression for large language models. arXiv preprint arXiv:2308.07633, 2023.
+Zechun Liu, Barlas Oguz, Changsheng Zhao, Ernie Chang, Pierre Stock, Yashar Mehdad, Yangyang Shi, Raghuraman Krishnamoorthi, and Vikas Chandra. Llm-qat: Data-free quantization aware training for large language models. arXiv preprint arXiv:2305.17888, 2023a.
+Koen Helwegen, James Widdicombe, Lukas Geiger, Zechun Liu, Kwang-Ting Cheng, and Roeland Nusselder. Latent weights do not exist: Rethinking binarized neural network optimization. Advances in neural information processing systems, 2019.
+Manuele Rusci, Alessandro Capotondi, and Luca Benini. Memory-driven mixed low precision quantization for enabling deep network inference on microcontrollers. *MLSys*, 2020.
+Haotong Qin, Ruihao Gong, Xianglong Liu, Mingzhu Shen, Ziran Wei, Fengwei Yu, and Jingkuan Song. Forward and backward information retention for accurate binary neural networks. In CVPR, 2020a.
+Haotong Qin, Mingyuan Zhang, Yifu Ding, Aoyu Li, Zhongang Cai, Ziwei Liu, Fisher Yu, and Xianglong Liu. Bibench: Benchmarking and analyzing network binarization. ICML, 2023.
+Zechun Liu, Zhiqiang Shen, Marios Savvides, and Kwang-Ting Cheng. Reactnet: Towards precise binary neural network with generalized activation functions. In ECCV, 2020a.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
+Elias Frantar, Saleh Ashkboos, Torsten Hoefler, and Dan Alistarh. Gptq: Accurate post-training quantization for generative pre-trained transformers. arXiv preprint arXiv:2210.17323, 2022.
+Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv:1308.3432, 2013.
+Haotong Qin, Ruihao Gong, Xianglong Liu, Xiao Bai, Jingkuan Song, and Nicu Sebe. Binary neural networks: A survey. Pattern Recognition, 105:107281, 2020b.
+
+Chunyu Yuan and Sos S Agaian. A comprehensive review of binary neural network. Artificial Intelligence Review, pages 1-65, 2023.
+Zechun Liu, Wenhan Luo, Baoyuan Wu, Xin Yang, Wei Liu, and Kwang-Ting Cheng. Bi-real net: Binarizing deep network towards real-network performance. IJCV, 2020b.
+Brais Martinez, Jing Yang, Adrian Bulat, and Georgios Tzimiropoulos. Training binary neural networks with real-to-binary convolutions. arXiv preprint arXiv:2003.11535, 2020.
+Yuzhang Shang, Dan Xu, Ziliang Zong, Liqiang Nie, and Yan Yan. Network binarization via contrastive learning. In ECCV, 2022a.
+Yuzhang Shang, Dan Xu, Bin Duan, Ziliang Zong, Liqiang Nie, and Yan Yan. Lipschitz continuity retained binary neural network. In European conference on computer vision, pages 603-619. Springer, 2022b.
+Yuzhang Shang, Bin Duan, Ziliang Zong, Liqiang Nie, and Yan Yan. Lipschitz continuity guided knowledge distillation. In ICCV, 2021.
+Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In ECCV, 2016.
+Haoli Bai, Wei Zhang, Lu Hou, Lifeng Shang, Jing Jin, Xin Jiang, Qun Liu, Michael Lyu, and Irwin King.
+Binarybert: Pushing the limit of bert quantization. arXiv preprint arXiv:2012.15701, 2020.
+Haotong Qin, Yifu Ding, Mingyuan Zhang, Qinghua Yan, Aishan Liu, Qingqing Dang, Ziwei Liu, and Xianglong Liu. Bibert: Accurate fully binarized bert. arXiv preprint arXiv:2203.06390, 2022.
+Zechun Liu, Barlas Oguz, Aasish Pappu, Lin Xiao, Scott Yih, Meng Li, Raghuraman Krishnamoorthi, and Yashar Mehdad. Bit: Robustly binarized multi-distilled transformer. Advances in neural information processing systems, 35:14303-14316, 2022.
+Zechun Liu, Barlas Oguz, Aasish Pappu, Yangyang Shi, and Raghuraman Krishnamoorthi. Binary and ternary natural language generation. ACL, 2023b.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
+Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. Qlora: Efficient finetuning of quantized llms. arXiv preprint arXiv:2305.14314, 2023a.
+Jerry Chee, Yaohui Cai, Volodymyr Kuleshov, and Christopher De Sa. Quip: 2-bit quantization of large language models with guarantees. arXiv preprint arXiv:2307.13304, 2023.
+Sehoon Kim, Coleman Hooper, Amir Gholami, Zhen Dong, Xiuyu Li, Sheng Shen, Michael W Mahoney, and Kurt Keutzer. Squeezeellm: Dense-and-sparse quantization. arXiv preprint arXiv:2306.07629, 2023.
+Tim Dettmers, Ruslan Svirschevski, Vage Egiazarian, Denis Kuznedelev, Elias Frantar, Saleh Ashkboos, Alexander Borzunov, Torsten Hoefler, and Dan Alistarh. Spqr: A sparse-quantized representation for near-lossless llm weight compression. arXiv preprint arXiv:2306.03078, 2023b.
+Ji Lin, Jiaming Tang, Haotian Tang, Shang Yang, Xingyu Dang, and Song Han. Awq: Activation-aware weight quantization for lIm compression and acceleration. arXiv preprint arXiv:2306.00978, 2023.
+Changhun Lee, Jungyu Jin, Taesu Kim, Hyungjun Kim, and Eunhyeok Park. Owq: Lessons learned from activation outliers for weight quantization in large language models. arXiv preprint arXiv:2306.02272, 2023.
+Liang Li, Qingyuan Li, Bo Zhang, and Xiangxiang Chu. Norm tweaking: High-performance low-bit quantization of large language models. arXiv preprint arXiv:2309.02784, 2023.
+Zhewei Yao, Reza Yazdani Aminabadi, Minjia Zhang, Xiaoxia Wu, Conglong Li, and Yuxiong He. Zeroquant: Efficient and affordable post-training quantization for large-scale transformers. arXiv preprint arXiv:2206.01861, 2022.
+Guangxuan Xiao, Ji Lin, Mickael Seznec, Julien Demouth, and Song Han. Smoothquant: Accurate and efficient post-training quantization for large language models. arXiv preprint arXiv:2211.10438, 2022.
+Xiuying Wei, Yunchen Zhang, Xiangguo Zhang, Ruihao Gong, Shanghang Zhang, Qi Zhang, Fengwei Yu, and Xianglong Liu. Outlier suppression: Pushing the limit of low-bit transformer language models. NeurIPS, 2022.
+
+Xiuying Wei, Yunchen Zhang, Yuhang Li, Xiangguo Zhang, Ruihao Gong, Jinyang Guo, and Xianglong Liu. Outlier suppression+: Accurate quantization of large language models by equivalent and optimal shifting and scaling. arXiv preprint arXiv:2304.09145, 2023.
+Wenqi Shao, Mengzhao Chen, Zhaoyang Zhang, Peng Xu, Lirui Zhao, Zhiqian Li, Kaipeng Zhang, Peng Gao, Yu Qiao, and Ping Luo. Omnidirectionally calibrated quantization for large language models. CoRR, abs/2308.13137, 2023.
+Zhihang Yuan, Lin Niu, Jiawei Liu, Wenyu Liu, Xinggang Wang, Yuzhang Shang, Guangyu Sun, Qiang Wu, Jiaxiang Wu, and Bingzhe Wu. Rptq: Reorder-based post-training quantization for large language models. arXiv preprint arXiv:2304.01089, 2023a.
+Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In NeurIPS, 2016.
+Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In NeurIPS, 2016.
+Zihan Xu, Mingbao Lin, Jianzhuang Liu, Jie Chen, Ling Shao, Yue Gao, Yonghong Tian, and Rongrong Ji. Recu: Reviving the dead weights in binary neural networks. In ICCV, 2021a.
+Yixing Xu, Kai Han, Chang Xu, Yehui Tang, Chunjing Xu, and Yunhe Wang. Learning frequency domain approximation for binary neural networks. In NeurIPS, 2021b.
+Olga Kovaleva, Saurabh Kulshreshtha, Anna Rogers, and Anna Rumshisky. Bert busters: Outlier dimensions that disrupt transformers. arXiv preprint arXiv:2105.06990, 2021.
+Zhihang Yuan, Yuzhang Shang, Yue Song, Qiang Wu, Yan Yan, and Guangyu Sun. Asvd: Activation-aware singular value decomposition for compressing large language models. arXiv preprint arXiv:2312.05821, 2023b.
+Zhen Dong, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. Hawq: Hessian aware quantization of neural networks with mixed-precision. In ICCV, 2019.
+Chee-Yong Chan and Yannis E Ioannidis. Bitmap index design and evaluation. In SIGMOD, 1998.
+Urban Borštnik, Joost VandeVondele, Valéry Weber, and Jürg Hutter. Sparse matrix multiplication: The distributed block-compressed sparse row library. Parallel Computing, 2014.
+Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. *Boolq: Exploring the surprising difficulty of natural yes/no questions.* arXiv preprint arXiv:1905.10044, 2019.
+Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In AAAI, 2020.
+Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019.
+Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale. Communications of the ACM, 2021.
+Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
+Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018.
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
+Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 2020.
+
+
+
+
+Figure 8: Flowchart of PB-LLM.
+
+# A SUPPLEMENTAL MATERIALS
+
+# A.1 EXISITING BINARIZATION METHODS ON LLM QUANTIZATION
+
+
Method
BoolQ
PIQA
HellaSwag
WinoGrande
ARC-Easy
ARC-Challenge
OBQA
Mean
Random Performance
0.5
0.5
0.25
0.5
0.25
0.25
0.25
0.36
FP
0.595
0.63
0.415
0.595
0.54
0.22
0.25
0.46
BNN
0.38
0.545
0.235
0.46
0.195
0.165
0.15
0.30
XNOR
0.37
0.525
0.265
0.49
0.195
0.165
0.16
0.31
Bi-Real
0.395
0.5
0.25
0.505
0.235
0.185
0.165
0.32
ReCU
0.39
0.515
0.24
0.51
0.255
0.185
0.175
0.32
FDA
0.39
0.485
0.265
0.49
0.265
0.19
0.17
0.32
+
+Table 4: Table corresponds to Figure 2 in the main paper: We implement five renowned binarization methods on LLMs and assess the resultant binarized LLMs across seven zero-shot common sense reasoning tasks.
+
+We first investigate the possibility of implementing binarization to LLM quantization. Specifically, following the binarization benchmark in BiBench [Qin et al., 2023], we generalize some representative binarization methods into LLM quantization scenarios. BNN [Hubara et al., 2016], XNOR [Rastegari et al., 2016], Bi-Real [Liu et al., 2020b], ReCU [Xu et al., 2021a] and FDA [Xu et al., 2021b] are re-implemented to quantize LLMs, particularly to OPT [Zhang et al., 2022]. Training details are illustrated in the Sec. 4. The results evaluated on seven zero-shot common sense reasoning tasks are shown in the above table. We can see that the LLMs binarized via the existing popular binarization algorithms perform worse than random guesses, showing that the existing binarization methods are not suitable for LLM binarization.
+
+# A.2 CODES
+
+Codes can be found anomalously in PB-LLM.
+
+
Criteria
WIKI
PTB
C4
Hessian
37.07
47.07
38.76
Magnitude
37.50
44.42
38.64
+
+Table 5: Salient Weight Selection
+
+# A.3 FLOWCHART OF PB-LLM
+
+# A.4 MORE EXPERIMENTS ON SALIENT WEIGHT SELECTION
+
+In our experimental analysis, we employed the OPT-1.3b network and conducted PB-LLM (QAT) quantization under both Hessian and Magnitude criteria, targeting a $10\%$ salient weight. The performance results, measured in perplexity (PPL) are in Tbale 5. We observed that the PPL values were comparable between the two criteria. However, it's worth noting that the Hessian criteria involve an additional calibration step (collecting calibration data to compute the Hessian), adding complexity to the process. In contrast, the Magnitude criteria offer a simpler approach, eliminating the need for this extra calibration step. Given the similar PPL results and the desire to streamline the quantization process in QAT, we opted for the Magnitude Metric to identify salient weights during QAT. This decision was motivated by the goal of simplifying the process while maintaining comparable performance.
\ No newline at end of file
diff --git a/pbllmpartiallybinarizedlargelanguagemodels/images.zip b/pbllmpartiallybinarizedlargelanguagemodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..0b5cbdfa85b75708f948b3d2487027400d3c9ebf
--- /dev/null
+++ b/pbllmpartiallybinarizedlargelanguagemodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f13687cdeadb1414f5f4cec3fd39c72af24706a0b1de6a2603ad004f0ef248f
+size 551892
diff --git a/pbllmpartiallybinarizedlargelanguagemodels/layout.json b/pbllmpartiallybinarizedlargelanguagemodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..30f71a1779b2df1fb82b89666d236501191c3372
--- /dev/null
+++ b/pbllmpartiallybinarizedlargelanguagemodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7c5224d893ac402151f3194b452fe8788ff16e2d3b19d3e9b82e29e800771a88
+size 428008
diff --git a/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_content_list.json b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c4cbf00f879272a611062118aeb9552aef699f46
--- /dev/null
+++ b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:644235b1a0fb4eef9cbdb293052149cdf696a15363ab044dafc4640350a859d4
+size 204884
diff --git a/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_model.json b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..abda117910510b9bf0a838ba26eea2d2433d09ca
--- /dev/null
+++ b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:61dc3b931e93897136807abc354929c2d661dcf20c1f0bcaea7f51bd0dd00550
+size 243757
diff --git a/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_origin.pdf b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..51b9487dd4740e94b4bd35829e008d22754a0516
--- /dev/null
+++ b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/00e30e90-8475-4151-9d80-c3f87cc583ab_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7e181f035bd029a5cef8a29fb21cdb5c46ecbb114a2a48d5f2383e9d47701986
+size 791224
diff --git a/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/full.md b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..67e22cb3ddb6605caff77cff0854171e71d7a1fa
--- /dev/null
+++ b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/full.md
@@ -0,0 +1,959 @@
+# PEERING THROUGH PREFERENCES: UNRAVELING FEEDBACK ACQUISITION FOR ALIGNING LARGE LANGUAGE MODELS
+
+Hritik Bansal, John Dang, Aditya Grover
+
+Department of Computer Science, University of California Los Angeles
+
+{hbansal, john.dang, adityag}@cs.ucla.edu
+
+# ABSTRACT
+
+Aligning large language models (LLMs) with human values and intents critically involves the use of human or AI feedback. While dense feedback annotations are expensive to acquire and integrate, sparse feedback presents a structural design choice between ratings (e.g., score Response A on a scale of 1-7) and rankings (e.g., is Response A better than Response B?). In this work, we analyze the effect of this design choice for the alignment and evaluation of LLMs. We uncover an inconsistency problem wherein the preferences inferred from ratings and rankings significantly disagree $60\%$ for both human and AI annotators. Our subsequent analysis identifies various facets of annotator biases that explain this phenomena such as human annotators would rate denser responses higher while preferring accuracy during pairwise judgments, for a particular comparison instance. To our surprise, we observe that the choice of feedback protocol has a significant effect on the evaluation of aligned LLMs. In particular, we find that LLMs that leverage rankings data for alignment (say model X) are preferred over those that leverage ratings data (say model Y), with a rank-based evaluation protocol (is X/Y's response better than reference response?) but not with a rating-based evaluation protocol (score Rank X/Y's response on a scale of 1-7). Our findings thus shed light on critical gaps in methods for evaluating the real-world utility of language models and their strong dependence on the feedback protocol used for alignment. Our code and data are available at https://github.com/Hritikbansal/sparse_feedback.
+
+# 1 INTRODUCTION
+
+Recently, alignment has emerged as a critical step for next-generation text-based assistants [35]. Specifically, its goal is to align large language models (LLMs) with human values and intents, making their generated content accurate, coherent, and harmless when responding to human queries [26, 2, 4, 38]. The process of model alignment involves three main components: feedback acquisition, where humans (or AI) assess the quality of the base model's responses; alignment algorithms, which adjust the skills of the base model based on the feedback data; and model evaluation, which assesses the performance of the aligned model on a wide range of novel user instructions [18]. Prior work has primarily focused on designing alignment algorithms, such as PPO, DPO, and PRO [31, 23, 28, 33, 45, 19], under specific feedback protocols and evaluation setups. Additionally, previous research on feedback acquisition [6, 43, 30] has focused on developing fine-grained and dense feedback protocols for aligning LLMs; however, these protocols are challenging and expensive to acquire. Within the sparse feedback protocols that are easy to acquire, there is a structural design choice between ratings and rankings, and its impact on the alignment pipeline is still under-explored.
+
+To this end, we analyze the effect of the two feedback protocols: ratings and rankings on the LLM alignment and further evaluation. Specifically, the rating protocol is an absolute form of feedback in which the annotator assigns a rating to a response from the base LLM using a predefined scale (e.g., a 1-7 Likert scale [20]). In contrast, the ranking protocol is a relative form of feedback in which the annotator selects their preferred response from a pair of candidate responses generated by the base LLM. The ratings on the model responses quantify their goodness which enables model
+
+
+Figure 1: Overview of our pipeline to study the effect of the choice between sparse feedback protocols (ratings and rankings) for the alignment and evaluation of LLMs. First, we sample multiple responses from the LLM for the queries in the instructions dataset. Then, we acquire rankings and rating feedback data from the human and AI annotators, independently. Subsequently, the feedback data is used to train the reward models for the Best-of-n policy. Finally, we compute the win-rate against the reference model under ratings and rankings feedback protocol from humans and AI.
+
+builders to gauge their strengths and weaknesses, but are hard to determine for complex instructions (poem on 'Roses and Lake in Shakespearean style') [19, 32]. On the other hand, the rankings protocol is easy to acquire for complex instructions but does not quantify the gap between the pair of responses [35, 26]. Due to these unique behaviors, both the ratings and rankings feedback protocols are compelling subjects for our study.
+
+In our work, we first explore the interplay between these feedback protocols. To do so, we collect ratings for individual responses from annotators, both human and AI, and transform them into their ranking form by comparing the assigned ratings (e.g., if Response A is rated 5 and Response B is rated 4, this implies that Response A is ranked higher than Response B). Additionally, we gather pairwise ranking preferences for the same responses (e.g., comparing Response A vs. Response B) from annotators, independently of their ratings. Surprisingly, we uncover a feedback inconsistency problem and find that a significant portion of all preference comparisons between ratings and rankings disagree with each other for humans $58\%$ and AI annotator (GPT-3.5-Turbo) $59.4\%$ ( $\S 4$ ). We observe that responses receiving inconsistent feedback are actually perceived as closer to each other than those receiving consistent feedback. Qualitatively, we trace this problem back to the differences in how annotators assess various facets of response quality ( $\S J.1$ ). Our analysis provides insights for making decisions regarding feedback acquisition protocols for aligning LLMs.
+
+After receiving feedback, our objective is to investigate the impact of the protocols on training reward models for model alignment and subsequent model evaluation. To achieve this, we train reward models on the ratings and rankings data (§2.3). We employ the Best-of-n policy where the trained reward models are then employed to select the best response from a set of $n$ candidate responses generated by the base LLM. Subsequently, we assess the quality of the Best-of-n policies (both ratings and rankings) by evaluating their responses against a reference model [26]. To our surprise, we observe an evaluation inconsistency, a phenomenon where the choice of the feedback protocol (rankings) for model evaluation favors responses from the Best-of-n policy that utilizes the same feedback protocol (rankings), and vice versa. Additionally, we find that feedback inconsistency occurs for both human and AI as response evaluators. Specifically, we observe that the win-rate gap between the Best-of-n (rankings) policy and the base LLM is larger (by 11.2%) compared to the gap between the Best-of-n (ratings) policy and the base LLM (5.3%) when using human rankings for evaluation (see §5.2). However, the win-rate gap between the Best-of-n (ratings) policy and the base
+
+LLM (5%) is only slightly larger than the gap between the Best-of-n (rankings) policy and the base LLM (4%) using human ratings for evaluation. Figure 1 provides an illustration of our pipeline.
+
+Our contributions are as follows:
+
+1. We uncover a feedback inconsistency problem where the ratings on the pair of responses disagree with the ranking between them for $60\%$ of comparisons for both humans and AI.
+2. We further analyze various facets of perceived response quality by the annotators while providing different forms of feedback.
+3. Finally, we find that the choice of the feedback protocol has a sharp influence on the evaluation of the aligned LLMs in the form of evaluation inconsistency.
+
+# 2 BACKGROUND
+
+In this work, we focus on aligning an LLM to generate high-quality outputs, that are considered accurate, coherent and harmless by humans, for unseen instructions. The initial step in the alignment process is to equip the base LLM with the ability to understand human or machine-generated input queries or instructions. This is accomplished through supervised fine-tuning (SFT), where the base LLM is fine-tuned with pairs of human-written or machine-generated instructions and corresponding responses. Notably, there have been substantial advancements in constructing instruction fine-tuning datasets and models recently [36, 49, 42, 40, 27, 44, 13, 46, 10, 41]. Following SFT, the model generates candidate responses for new instructions ( $\S$ 2.1), and feedback data is acquired under a protocol (ratings or rankings) from the annotators ( $\S$ 2.2). Further, we employ an alignment algorithm (Best-of-n) that trains reward models on the ratings or rankings feedback data ( $\S$ 2.3).
+
+# 2.1 INSTRUCTION-RESPONSE DATA COLLECTION
+
+Consider a language model $p_{\theta}$ that can understand instructions and respond to them. We consider a set of instructions $\mathcal{X} = \{x_1, \ldots, x_n\}$ where $n$ is the number of instructions. Subsequently, we generate a set of $k$ candidate responses $\{y_i^{(1)}, \ldots, y_i^{(k)}\}$ for every instruction $x_i$ by sampling from the model's distribution $y_i^{(j)} \sim p_{\theta}(.|x_i)$ . Next, we collect the feedback data on the pre-defined instructions and the generated candidate responses $\mathcal{D} = \{(x_i, \{y_i^{(1)}, \ldots, y_i^{(k)}\})\}$ .
+
+# 2.2 FEEDBACK DATA
+
+Ratings Feedback Protocol With the given instruction and candidate response data $\mathcal{D}$ , the objective of ratings feedback acquisition is to assign an ordinal value to each individual response independently. In our study, we request the annotators to rate the responses on a Likert scale (1 - 7). We instruct the annotators to evaluate the responses based on the their quality considering factors such as accuracy, coherence, and harmlessness of the response in addition to their subjective judgment.
+
+Formally, the annotators assign an absolute score $a(x_i, y_i^{(j)}) \in \{1, 2, \dots, 7\}$ where $x_i$ and $y_i^{(j)}$ are instruction and a generated candidate response, respectively. The annotation process would thus create a feedback data $\mathcal{D}_A = \{(x_i, y_i^{(j)}, a(x_i, y_i^{(j)}))\}$ where $A$ represents the ratings protocol.
+
+Rankings Feedback Protocol Given the instruction and candidate response data $\mathcal{D}$ , the aim of rankings protocol is to assign a preferred response (or choose 'equal') for every pair of candidate responses to a given instruction. To that end, we first transform the instruction-response data into instruction-pairwise response data by creating pairwise combinations of the responses i.e., $\mathcal{D}' = \{(x_i, y_i^{(j)}, y_i^{(\ell)})\}$ where $i \neq \ell$ . Identical to the absolute feedback, the annotators are instructed to use the various quality axes and their subjective judgment for decision-making.
+
+Formally, the annotators assign a relative feedback $r(x_{i},y_{i}^{(j)},y_{i}^{(\ell)})\in \{\text{response 1}',\text{response 2}',$ equal} where 'response 1' indicates that $y_{i,j}$ is preferred over $y_{i}^{(\ell)}$ . The annotation process would thus create a feedback data $\mathcal{D}_R = \{(x_i,y_i^{(j)},y_i^{(\ell)},r(x_i,y_i^{(j)},y_i^{(\ell)}))\}$ where the subscript $R$ represents the rankings feedback protocol.
+
+# 2.3 REWARD MODELING
+
+We describe the training objectives for the reward models trained on ratings and rankings feedback.
+
+Regression Reward Model. Here, we first normalize the ratings (between 1-7) $a(x_i, y_i^{(j)})$ for a given instruction in the dataset $\mathcal{D}_A$ into score $a'(x_i, y_i^{(j)})$ between 0-1. Subsequently, we train a regression model $f_\theta(x_i, y_i^{(j)})$ where $(x_i, y_i^{(j)}) \in \mathcal{D}_A$ which outputs a scalar. The regression reward model is trained with the following objective:
+
+$$
+\mathcal {L} _ {A} \left(\mathcal {D} _ {A}\right) = \mathbb {E} _ {\left(x _ {i}, y _ {i} ^ {(j)}\right) \sim \mathcal {D} _ {A}} \left[ \left(\sigma \left(f _ {\theta} \left(x _ {i}, y _ {i} ^ {(j)}\right)\right) - a ^ {\prime} \left(x _ {i}, y _ {i} ^ {(j)}\right) \right] ^ {2} \right. \tag {1}
+$$
+
+where $\sigma(.)$ is the sigmoid function which projects any scalar value to a range between 0-1.
+
+Negative Log-Likelihood (NLL) Reward Model. To train a reward model from the pairwise feedback data $\mathcal{D}_R$ , prior works [26] train a reward model $g_{\theta}(x,y)$ which outputs a scalar value for a given response $y$ for the instruction $x$ . Firstly, we filter the instances that receive $r(x_i,y_i^{(j)},y_i^{(\ell)}) = \text{'equal'}$ from $\mathcal{D}_R$ to get a new subset of data $S_R$ since one cannot learn from such examples in the relative reward modeling objective. For the remaining instances, the negative log-likelihood objective might be applied as follows:
+
+$$
+\mathcal {L} _ {R} \left(\mathcal {S} _ {R}\right) = - \mathbb {E} _ {\left(x, y _ {a}, y _ {b}\right) \sim \mathcal {S} _ {R}} \left[ \log \sigma \left(g _ {\theta} \left(x _ {i}, y _ {a}\right) - g _ {\theta} \left(x _ {i}, y _ {b}\right) \right] \right. \tag {2}
+$$
+
+where $y_{a}$ and $y_{b}$ are the preferred and unpreferred responses respectively from the pair of candidate responses $(y_{i}^{(j)}, y_{i}^{(\ell)})$ as decided by the value of $r(x_{i}, y_{i}^{(j)}, y_{i}^{(\ell)})$ in the dataset $S_{R}$ . We provide more details on the choice of $f_{\theta}, g_{\theta}$ , and the training setup in Appendix §G.
+
+Best-of-n Policy. In our work, we use the Best-of-n policy (rejection sampling) $\mathcal{P}_n$ that leverages the trained reward model to boost the performance of the SFT model towards human preferences. In this method, we simply sample $n$ times from the SFT model from a given instruction, and utilize the reward models (regression or NLL) to score the set of $n$ responses. The final output of the policy is the response that achieves the highest score under the trained reward model. Formally the Best-of-n policy that leverages the ratings reward model $f_{\theta}$ ,
+
+$$
+\mathcal {P} _ {n} \left(f _ {\theta}, p _ {\theta}, x _ {i}, \left\{y _ {i} ^ {(1)}, \dots , y _ {i} ^ {(n)} \right\}\right) = y _ {i} ^ {(m)} \tag {3}
+$$
+
+where $m = \operatorname{argmax}_j f_\theta(x_i, y_i^{(j)})$ , $x_i$ is the input instructions, and $y_i^{(j)}$ is $j^{th}$ response from the $n$ candidate responses sampled from the SFT model $p_\theta$ . Here, our approach can use any other RL algorithm such as PPO used for model alignment [26] or a mix of rejection sampling and PPO [38]. We focus on rejection sampling due to its simplicity, and robust performance in comparison to other RL algorithms as noted by prior works [23, 48, 11].
+
+# 3 FEEDBACK DATA ACQUISITION
+
+Here, we describe the feedback data acquisition process. We start by collecting responses to a large set of instructions from the base LLM (§). Subsequently, we describe feedback acquisition from AI which is large-scale and thus used for training the reward models. Further, we describe feedback acquisition from humans in followed by feedback data analysis.
+
+Instruction Response Data. The instructions are designed to present a collection of queries that could potentially be posed to a text-based AI assistant in real-world scenarios. We collect 5.2K instructions from varied sources such as Dolly [10], User-orient [42], and SuperNI [42].
+
+In our work, we use Alpaca-7B [36], which is constructed by instruction-tuning the LLaMA-7B [37] on 52K instruction-response data, as the base LLM. Thus, we prompt Alpaca to generate five candidate responses for a range of diverse instructions. We set the max length for each generated response to 128. We provide more details on the dataset composition in Appendix §C.
+
+Feedback from AI. Prior works [12] demonstrate that the existing AI systems (LLMs) such as GPT-4 [25] can be leveraged for providing pairwise feedback data and improve over the base LLM. In addition, [49, 14] makes a case for LLM as a substitute for human preferences in a scalable and reliable way. In our work, we collect large-scale ratings and rankings feedback data consisting of 71K instances from an GPT-3.5-Turbo (ChatGPT). We chose ChatGPT since it is $20 \times$ cheaper than GPT-4 and was more easily accessible at the time of the project.
+
+To collect ratings feedback, we prompt GPT-3.5-Turbo to assign a score between 1-7 to the individual candidate responses for the instructions independent of each other. The model is specifically prompted to assign the ratings score after evaluating the response for its accuracy, coherence, and harmlessness, in addition to its subjective judgment. We further clarify that a rating of 1 implies a low quality response whereas a rating of 7 indicates a high quality response. In total, we collect 24.6K instances of ratings feedback and spend $150 in the acquisition.
+
+To collect the rankings feedback, we prompt the GPT-3.5-Turbo LLM with the instruction and a pair of candidate responses ('response 1', 'response 2'), and command it to provide its preference between the two responses. To mitigate any potential bias in 'response 1' and 'response 2' ordering [49], we run two queries for all instances covering both the possible orderings. If the model preferences flip by flipping the order of the responses, then we consider it as tie situation and assign an 'equal' feedback to the pair of responses, as done in [5]. In total, we collect 46.5K unique instances of rankings feedback, excluding the two possible orderings of the pair of candidate responses, and spend $600 in the acquisition. We will provide more analysis on the feedback data in §3.1.
+
+Feedback from Humans. We collect feedback data under the ratings and rankings protocols from the humans 6K instances of annotations. We provide the details on the human preference acquisition in Appendix §D. Such data serves a multitude of purposes, notably: (a) providing insights into the behavior of different forms of feedback collected from humans, (b) facilitating a comparative analysis of the similarities and dissimilarities between feedback patterns derived from AI systems and those obtained from human participants, and (c) enabling a comprehensive assessment of the agreement between the feedback data generated by AI systems and the feedback provided by human participants. In our work, we emphasize that the human feedback data is not used for training the reward models, and hence model alignment, due to its small scale which is costly to expand.
+
+
+Figure 2: We present the ratings (absolute) score distribution acquired from humans and AI.
+
+# 3.1 DATA ANALYSIS
+
+# Ratings Distribution. We present the score distribution
+
+for the 4K ratings data from the human annotations and their corresponding GPT-3.5-Turbo annotations in Figure 2. We find that the majority of the responses $(\sim 80\%)$ achieve better than average ratings $(>4)$ from the humans and AI. This indicates that the quality of responses from Alpaca-7B is good, attributed to its instruction-following capabilities. In addition, we find that the human annotators tend to give a perfect score of 7 to a large proportion of the responses, whereas GPT-3.5-Turbo assigns the perfect score to less than $< 5\%$ cases. We observe that the majority of responses achieve an ratings score of 5 or 6 from GPT-3.5, and the distribution flattens to either side of these scores (same as Fig. 2 in [27]).
+
+Feedback data is unbiased towards longer and unique responses. Prior works [49, 41] have shown that LLMs may favor longer and verbose responses, to varying degrees, despite being inaccurate and of lower quality. We assess whether the length or number of unique words in the candidate responses bias the ratings and rankings feedback judgments from humans and AI in our data (Appendix Table 5 and 6). In summary, we find that there is no discernible difference between the average length and average number of unique tokens of the preferred and unpreferred response in the rankings feedback collected from the humans and AI.
+
+Agreement Analysis. Here, we conduct an agreement analysis comparing the assessments provided by human-human and human-AI annotators for both ratings and rankings feedback. Specifically, we have collected 1000 instances with ratings feedback and 500 instances with rankings feedback from four human annotators and GPT-3.5-Turbo. To establish the ground truth for each instance, we consider the first three human annotations as the gold label, and we use the fourth annotation as the human prediction label. For instances with ratings feedback, we compute the average of the scores given by the three human annotators and round it off to the nearest integer and consider it as the gold label. For instance, with rankings feedback, we determine the final label based on the majority vote among the three human annotations. The possible choices for human feedback responses are {'response 1', 'response 2', 'equal'}). If an instance receives two votes for 'equal' and one vote for 'response 1', we assign it a gold label of 'equal'. In the event of a tie among the three choices, we randomly sample the gold label from the possible choices.
+
+We calculate the average ratings difference between the gold label feedback and human (and AI) feedback to quantify the ratings agreement. We calculate the percentage of instances (out of 500) where the gold label and human (and AI) feedback agrees with each other to quantify the rankings agreement. Specifically, we assign a score of 1 if the gold label matches the prediction, and a score of 0.5 if only one of the gold label or prediction assigns 'equal' to the pair of responses. In Table 1, we observe that the average ratings difference between human-human ratings (1.08) is close to the human-GPT-3.5-Turbo ratings (0.9). Additionally, we observe that the human-human agreement and human-GPT-3.5-Turbo agreement is $62.7\%$ and $60.5\%$ respectively in the rankings feedback. We observe
+
+
Feedback
H-H
H-AI
# Examples
Ratings
1.08
0.9
1000
Rankings
62.7%
60.5%
500
+
+Table 1: Agreement analysis between the gold human annotations and the held-out human (H-H) annotations for ratings and rankings feedback (Column 1). Similarly, we perform the agreement analysis for the gold human annotations and annotations from GPT-3.5-Turbo (abbreviated as H-AI).
+
+that our agreement rates are close to the $60\%$ human-human agreement rates reported in the prior works [18].
+
+# 4 FEEDBACK INCONSISTENCY PROBLEM
+
+# 4.1 CALCULATING CONSISTENCY
+
+Here, we use the observation that the rankings of a pair of responses for a given instruction can be compared to the ratings feedback data converted into its ranking form. Formally, we can convert the ratings data $\mathcal{D}_A$ to $\mathcal{D}_A^R = \{x_i, y_i^{(j)}, y_i^{(\ell)}, h(a(x_i, y_i^{(j)}), a(x_i, y_i^{(\ell)}))\}$ where $h(a(x_i, y_i^{(j)}), a(x_i, y_i^{(\ell)})) \in \{\text{'response 1', 'response 2', 'equal'}\}$ denotes the preferred response between $y_i^{(j)}$ (response 1) and $y_i^{(\ell)}$ (response 2). Here, we define the term `feedback consistency` as the agreement between the ratings (converted to its rankings form) and the rankings received by a pair of responses to a given instruction. Formally,
+
+$$
+C \left(x _ {i}, y _ {i} ^ {(j)}, y _ {i} ^ {(\ell)}\right) = \left\{ \begin{array}{l l} 1 & r \left(x _ {i}, y _ {i} ^ {(j)}, y _ {i} ^ {(\ell)}\right) = h \left(x _ {i}, y _ {i} ^ {(j)}, y _ {i} ^ {(\ell)}\right) \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {4}
+$$
+
+where $(x_{i},y_{i}^{(j)},y_{i}^{(\ell)})\in S$ and $S = \mathcal{D}_A^R\cap \mathcal{D}_R$
+
+# 4.2 RESULTS
+
+We present the results across 42K comparisons in the feedback data from GPT-3.5-Turbo (Table 2a) and 500 comparisons in the feedback data from the humans (Table 2b). In both tables, a particular cell (say row 1 and column 2) will indicate the percentage of total instances for which the ratings feedback considers the pair of candidate responses 'equal' while the rankings feedback prefers 'Response 1' for the same pair of candidate responses.
+
+We observe an inconsistency issue in both human and AI feedback data. That is, the consistency score falls within a similar range of $40\% - 42\%$ for both humans and AI, suggesting that a substantial
+
+
Rankings
Equal
Response 1
Response 2
Total
Ratings
Equal
27.7%
14.7%
15%
57.4%
Response 1
9.7%
7.4%
4.5%
21.6%
Response 2
9.7%
4.4%
6.9%
21.0%
Total
47.1%
26.5%
26.4%
42%
+
+(a) Results for the (dis-)agreements between feedback protocols (ratings and rankings) annotated by GPT-3.5-Turbo for 42K comparisons.
+
+
Rankings
Equal
Response 1
Response 2
Total
Ratings
Equal
13.3%
12.4%
15.1%
40.8%
Response 1
8.2%
13.1%
7.8%
29.1%
Response 2
9.3%
6.4%
14.2%
30.0%
Total
30.9%
32%
37.1%
40.6%
+
+(b) Results for the (dis-)agreements between feedback acquisition protocols (ratings and rankings) annotated by humans for 500 comparisons.
+
+Table 2: Inconsistency results for the feedback data acquired from (a) AI and (b) humans.
+
+portion $(60\%)$ of the feedback data can yield contradictory preferences depending on the feedback protocol employed. This consistency problem underscores several critical points: (a) it indicates variations in the perceived quality of responses based on the choice of the feedback acquisition protocols, (b) it underscores that the alignment pipeline can vary significantly depending on whether ratings or rankings are used as sparse forms of feedback, and (c) it emphasizes the necessity of meticulous data curation when working with multiple feedback protocols for aligning LLMs. In Appendix §E, we discuss the variation in the consistency scores with variation in the annotators.
+
+Hedging. We find that the GPT-3.5-Turbo tends to hedge its predictions significantly more than humans. Specifically, $47.1\%$ rankings feedback and $57.4\%$ ratings feedback are assigned an 'equal' preference by GPT-3.5-Turbo (sum of first row and column in Table 2a). However, $30.9\%$ rankings and $40.8\%$ ratings feedback is assigned an 'equal' preference by the humans. We observe that the hedging percentages are higher for the ratings feedback as compared to the rankings feedback for both humans and AI. This can be attributed to a large fraction of individual responses receiving a score of 5 or 6 from GPT-3.5-Turbo, as discussed in §3.1.
+
+Decisive rankings feedback. We observe that whenever the rankings feedback from humans and GPT-3.5-Turbo is decisive (i.e., the feedback prefers one of the responses from the pair instead of selecting 'equal'), the fraction of consistent assignments is higher than the inconsistent ones. In Table 2a, $7.4\%$ (Column 2 and Row 2) is higher than $4.4\%$ and $6.9\%$ is higher than $4.5\%$ . Similarly, in Table 2b, $13.1\%$ (Column 2 and Row 2) is higher than $6.4\%$ and $14.2\%$ is higher than $7.8\%$ .
+
+Decisive ratings feedback. We observe that whenever the ratings feedback converted to its rankings form is decisive, the fraction of consistent assignments is higher than the inconsistent ones. Specifically, we focus on Row 2 and Row 3 of the tables. In Table 2a, $7.4\%$ (Column 2 and Row 2) is higher than $4.5\%$ and $6.9\%$ is higher than $4.4\%$ . Similarly, in Table 2b, $13.1\%$ (Column 2 and Row 2) is higher than $7.8\%$ and $14.2\%$ is higher than $6.4\%$ .
+
+Quantitative Fine-grained Analysis. We perform fine-grained experiments to quantify the difference between consistent and inconsistent subsets of the feedback data from humans and AI in Appendix J.1. In summary, we find that the quantitative gap between the pair of responses belonging to the consistent instances is higher than the pair of responses belonging to the inconsistent instances. Due to the closeness in the perceived quality of the pair of responses belonging to the inconsistent instances, we posit that the human annotators prefer specific quality factors over the others (e.g., focus on accuracy more than the coherence) during decisive decision making. As a result, we observe that the inconsistent instances receive more variation in the rankings feedback from the humans (e.g., annotator 1,2 prefers Resp. A over B while annotator 3 prefers Resp. B over A for a given instruction) than the consistent instances (e.g., annotator 1,2,3 prefer Resp. A and Resp. B).
+
+Qualitative Analysis. We investigate the source of the inconsistency problem qualitatively by asking the human annotators for a few feedback instances. We include the ratings and rankings with human explanations in Appendix P, and find that the differences in the preferences of the humans while annotating for different feedback protocols played a significant role in their decision making. For instance, in Table 12, we observe that the annotators responsible for rankings favored 'response 2' due to its density, while perceiving 'response 1' as dull. At the same, despite these divergent preferences, the individual responses received conflicting rating scores: 'response 2' incurred a
+
+
+Figure 3: Win-rate against DaVinci-003 of Alpaca-7B LLM and Best-of-64 policy that leverages the reward models trained with the ratings and rankings feedback protocols, independently. The gap between base LLM and Best-of-64 (Rankings) is higher than base LLM and Best-of-64 (Ratings) using the rankings feedback protocol for model evaluation. However, the gap between base LLM and Best-of-64 (Ratings) is slightly higher than the gap between base LLM and Best-of-64 (Rankings) using the ratings feedback protocol for model evaluation. The trend holds for humans and GPT-3.5-Turbo as the evaluators. The error bars represent the $95\%$ CI.
+
+substantial penalty for its density and perceived non-compliance with task instructions, whereas 'response 1' garnered an average score for only a partial adherence to the guidelines.
+
+# 5 ALIGNMENT AND EVALUATION
+
+In the previous sections, we established that the feedback data obtained from both humans and AI suffer from an inconsistency problem. Nonetheless, it is crucial to examine the impact of these forms of feedback on aligning and evaluating language models.
+
+# 5.1 SETUP
+
+First, we train reward models on feedback data acquired under the ratings and rankings protocol. Then, we employ a Best-of-n ( $n = 64$ ) policy to evaluate the effect of various feedback data on model alignment. Here, we vary the choice of the feedback protocols as ratings and rankings during evaluation and the choice of the annotators as humans and ChatGPT-3.5-Turbo. Specifically, we choose low-rank adaptation [15] (LoRA) of Alpaca-7B as the reward model. Post-training, we evaluate the models on 553 unseen instructions, which includes 188 instructions from the Open Assistant (OASST), 129 from the helpful evaluation released by Anthropic [3], 80 from Vicuna [8], and 156 from Koala [13]. Within Best-of-n, we first generate $n$ candidate responses of length 200 from the base LLM (Alpaca-7B) with the unseen instructions. Subsequently, the output of Best-of-n would be the one that achieves the maximum score with the trained reward model. Finally, we compute the win-rate of the base LLM and the Best-of-n policies against DaVinci-003 (reference model) on these unseen instructions. Here, we use the DaVinci-003 responses collected in AlpacaEval [18]. Post-alignment, we evaluate the Best-of-n policies (ratings, rankings) against a reference model on a set of unseen user instructions $\mathcal{U}$ . We provide more details on the training setup in $\S G$ .
+
+# 5.2 RESULTS
+
+We train the reward models on the ratings and rankings feedback data collected from GPT-3.5-Turbo. We present the win-rates for the base LLM and the Best-of-n policies on the unseen instructions evaluated by humans and GPT-3.5-Turbo in Figure 3.
+
+Best-of-n policies outperforms SFT. We find that randomly sampling from the $n$ ( $= 64$ ) candidate responses from the SFT model (labeled as 'SFT' in the figure) achieves a win-rate of $33.9\%$ against DaVinci-003 using pairwise judgments from the humans. Further, we observe that the Best-of-64 achieves a win-rate of $39.2\%$ and $45.1\%$ against DaVinci-003 using the reward models trained with ratings and rankings feedback, respectively. We observe a similar trend for the reward models trained with the ratings feedback using humans and AI as the evaluators. This indicates that the feedback collected at scale from AI LLMs is useful for improving the alignment of the SFT.
+
+Evaluation Inconsistency. To our surprise, we observe a evaluation inconsistency phenomenon where the choice of the feedback protocol during evaluation favors the alignment algorithm that uses the same feedback protocol. Specifically, we find that the gap between the win-rate of the Best-of-n (rankings) policy and the SFT $(11.2\%)$ is larger than the gap between the Best-of-n (ratings) policy and SFT $(5.3\%)$ as judged by the human annotators under the rankings protocol. However, the gap between the win-rate of the Best-of-n (ratings) policy and SFT $(5\%)$ is slightly larger than the gap between the Best-of-n ( rankings) policy and SFT $(4.3\%)$ as judged by the human annotators under the ratings protocol. Interestingly, we observe a similar evaluation inconsistency when GPT-3.5-Turbo is used as the evaluation annotator. We present the task-specific performance results in Appendix §L. This indicates that the annotators perceive the quality of the policy responses differently depending on the feedback acquisition protocol. This highlights a challenge in designing robust evaluation protocols that mirror real-world performance.
+
+Ablations. Here, we aim to understand whether evaluation inconsistency phenomenon is observed in different setups. In Appendix §M, we find that evaluation inconsistency when the alignment policy is changed to rejection sampling finetuning. In Appendix §N, we show that our observations are robust to the choice of the reward model used for Best-of-n policy. In Appendix O, we find that converting the rating data into ranking format also leads to the evaluation inconsistency.
+
+# 6 RELATED WORK
+
+Learning from Human Feedback. [9] introduced the RL from Human Feedback (RLHF) framework, which initially learns a reward model network from a dataset of human preferences. This reward model is then used to replace a human-written reward function during RL optimization. [35] and [26] introduced an RLHF framework for aligning LMs with human preferences.
+
+Learning from AI Feedback. While RLHF has shown promising results, the collection of human preferences remains a significant cost for aligning language models. Prior work has demonstrated that LMs are capable of providing feedback [16, 49, 12] that can be used to improve their own capabilities [22, 1]. [4] introduced the Reinforcement Learning from AI Feedback (RLAIF) framework, which replaces the human feedback step of RLHF with an automatic AI feedback generation procedure. Our work compares human feedback with AI feedback in both rankings and ratings settings.
+
+Feedback Data Collection. Previous works have utilized both human and AI feedback in both ratings [19, 17] and rankings [35, 26, 37, 12] settings on machine-written responses [3] and human-written responses [24]. However, there has not been work that systematically compares the effects of collecting ratings versus rankings feedback.
+
+# 7 CONCLUSION
+
+In this study, we conducted an examination of feedback acquisition protocols aimed at aligning LLMs. Our investigation revealed a notable challenge: feedback inconsistency within sparse protocols (ratings and rankings). We found that feedback inconsistency was exhibited by both humans and AI systems as feedback providers. Additionally, we delved into the factors contributing to this inconsistency and shed light on its practical consequences in the context of model alignment and evaluation, notably highlighting the phenomenon of evaluation inconsistency. Specifically, we emphasize that the trends observed in evaluations are significantly influenced by the choice of feedback protocols. Future research endeavors may explore the cognitive underpinnings of the inconsistency problem, expand the array of feedback protocols to include denser feedback, and investigate the implications of these choices on the alignment algorithm and subsequent evaluation procedures.
+
+# 8 ACKNOWLEDGEMENT
+
+Hritik Bansal is supported in part by AFOSR MURI grant FA9550-22-1-0380. We thank Ashima Suvarna for her helpful comments on the draft. We also thank the reviewers for their insightful feedback.
+
+# REFERENCES
+
+[1] Afra Feyza Akyurek, Ekin Akyurek, Aman Madaan, Ashwin Kalyan, Peter Clark, Derry Wijaya, and Niket Tandon. Rl4f: Generating natural language feedback with reinforcement learning for repairing model outputs. arXiv preprint arXiv:2305.08844, 2023.
+[2] Amanda Askell, Yuntao Bai, Anna Chen, Dawn Drain, Deep Ganguli, Tom Henighan, Andy Jones, Nicholas Joseph, Ben Mann, Nova DasSarma, et al. A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861, 2021.
+[3] Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, et al. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022.
+[4] Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, et al. Constitutional ai: Harmlessness from ai feedback. arXiv preprint arXiv:2212.08073, 2022.
+[5] Yonatan Bitton, Hritik Bansal, Jack Hessel, Rulin Shao, Wanrong Zhu, Anas Awadalla, Josh Gardner, Rohan Taori, and Ludwig Schimdt. Visit-bench: A benchmark for vision-language instruction following inspired by real-world use, 2023.
+[6] Jon Ander Campos and Jun Shern. Training language models with language feedback. In ACL Workshop on Learning with Natural Language Supervision. 2022., 2022.
+[7] Stephen Casper, Xander Davies, Claudia Shi, Thomas Krendl Gilbert, Jérémy Scheurer, Javier Rando, Rachel Freedman, Tomasz Korbak, David Lindner, Pedro Freire, Tony Wang, Samuel Marks, Charbel-Raphaël Segerie, Micah Carroll, Andi Peng, Phillip Christoffersen, Mehul Damani, Stewart Slocum, Usman Anwar, Anand Siththaranjan, Max Nadeau, Eric J. Michaud, Jacob Pfau, Dmitrii Krasheninnikov, Xin Chen, Lauro Langosco, Peter Hase, Erdem Bıyük, Anca Dragan, David Krueger, Dorsa Sadigh, and Dylan Hadfield-Menell. Open problems and fundamental limitations of reinforcement learning from human feedback, 2023.
+[8] Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E Gonzalez, et al. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ * chatgpt quality. See https://vicuna.lmsys.org (accessed 14 April 2023), 2023.
+[9] Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30, 2017.
+[10] Mike Conover, Matt Hayes, Ankit Mathur, Jianwei Xie, Jun Wan, Sam Shah, Ali Ghodsi, Patrick Wendell, Matei Zaharia, and Reynold Xin. Free dolly: Introducing the world's first truly open instruction-tuned llm, 2023. URL https://www.databricks.com/blog/2023/04/12/dolly-first-open-commercially-viable-instruction-tuned-llm.
+[11] Hanze Dong, Wei Xiong, Deepanshu Goyal, Rui Pan, Shizhe Diao, Jipeng Zhang, Kashun Shum, and Tong Zhang. Raft: Reward ranked finetuning for generative foundation model alignment. arXiv preprint arXiv:2304.06767, 2023.
+[12] Yann Dubois, Xuechen Li, Rohan Taori, Tianyi Zhang, Ishaan Gulrajani, Jimmy Ba, Carlos Guestrin, Percy Liang, and Tatsunori B Hashimoto. Alpacafarm: A simulation framework for methods that learn from human feedback. arXiv preprint arXiv:2305.14387, 2023.
+
+[13] Xinyang Geng, Arnav Gudibandie, Hao Liu, Eric Wallace, Pieter Abbeel, Sergey Levine, and Dawn Song. Koala: A dialogue model for academic research. Blog post, April 2023. URL https://bair.berkeley.edu/blog/2023/04/03/koala/.
+[14] Fabrizio Gilardi, Meysam Alizadeh, and Maël Kubli. Chatgpt outperforms crowd-workers for text-annotation tasks. arXiv preprint arXiv:2303.15056, 2023.
+[15] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models, 2021.
+[16] Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield Dodds, Nova DasSarma, Eli Tran-Johnson, et al. Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221, 2022.
+[17] Kimin Lee, Hao Liu, Moonkyung Ryu, Olivia Watkins, Yuqing Du, Craig Boutilier, Pieter Abbeel, Mohammad Ghavamzadeh, and Shixiang Shane Gu. Aligning text-to-image models using human feedback. arXiv preprint arXiv:2302.12192, 2023.
+[18] Xuechen Li, Tianyi Zhang, Yann Dubois, Rohan Taori, Ishaan Gulrajani, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Alpacaeval: An automatic evaluator of instruction-following models. https://github.com/tatsu-lab/alpaca_eval, 2023.
+[19] Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let's verify step by step. arXiv preprint arXiv:2305.20050, 2023.
+[20] Rensis Likert. A technique for the measurement of attitudes. Archives of psychology, 1932.
+[21] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+[22] Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, et al. Self-refine: Iterative refinement with self-feedback. arXiv preprint arXiv:2303.17651, 2023.
+[23] Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, et al. Webgpt: Browser-assisted question-answering with human feedback. arXiv preprint arXiv:2112.09332, 2021.
+[24] Stanford NLP. Stanfordnlp/shp $\cdot$ datasets at hugging face. URL https://huggingface.co/datasets/stanfordnlp/SHP.
+[25] OpenAI. Gpt-4 technical report, 2023.
+[26] Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744, 2022.
+[27] Baolin Peng, Chunyuan Li, Pengcheng He, Michel Galley, and Jianfeng Gao. Instruction tuning with gpt-4. arXiv preprint arXiv:2304.03277, 2023.
+[28] Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D Manning, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. arXiv preprint arXiv:2305.18290, 2023.
+[29] Keita Saito, Akifumi Wachi, Koki Wataoka, and Youhei Akimoto. Verbosity bias in preference labeling by large language models. arXiv preprint arXiv:2310.10076, 2023.
+[30] Jérémy Scheurer, Jon Ander Campos, Tomasz Korbak, Jun Shern Chan, Angelica Chen, Kyunghyun Cho, and Ethan Perez. Training language models with language feedback at scale. arXiv preprint arXiv:2303.16755, 2023.
+[31] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017.
+
+[32] Weiyan Shi, Emily Dinan, Kurt Shuster, Jason Weston, and Jing Xu. When life gives you lemons, make cherryade: Converting feedback from bad responses into good labels. arXiv preprint arXiv:2210.15893, 2022.
+[33] Feifan Song, Bowen Yu, Minghao Li, Haiyang Yu, Fei Huang, Yongbin Li, and Houfeng Wang. Preference ranking optimization for human alignment. arXiv preprint arXiv:2306.17492, 2023.
+[34] Ziang Song, Tianle Cai, Jason D Lee, and Weijie J Su. Reward collapse in aligning large language models. arXiv preprint arXiv:2305.17608, 2023.
+[35] Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul F Christiano. Learning to summarize with human feedback. Advances in Neural Information Processing Systems, 33:3008-3021, 2020.
+[36] Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
+[37] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
+[38] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.
+[39] Amos Tversky. Intransitivity of preferences. Psychological review, 76(1):31, 1969.
+[40] Yizhong Wang, Swaroop Mishra, Pegah Alipoormolabashi, Yeganeh Kordi, Amirreza Mirzaei, Anjana Arunkumar, Arjun Ashok, Arut Selvan Dhanasekaran, Atharva Naik, David Stap, et al. Super-naturalinstructions: Generalization via declarative instructions on 1600+ nlp tasks. arXiv preprint arXiv:2204.07705, 2022.
+[41] Yizhong Wang, Hamish Ivison, Pradeep Dasigi, Jack Hessel, Tushar Khot, Khyathi Raghavi Chandu, David Wadden, Kelsey MacMillan, Noah A Smith, Iz Beltagy, et al. How far can camels go? exploring the state of instruction tuning on open resources. arXiv preprint arXiv:2306.04751, 2023.
+[42] Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, and Hannaneh Hajishirzi. Self-instruct: Aligning language models with self-generated instructions, 2023.
+[43] Zeqiu Wu, Yushi Hu, Weijia Shi, Nouha Dziri, Alane Suhr, Prithviraj Ammanabrolu, Noah A Smith, Mari Ostendorf, and Hannaneh Hajishirzi. Fine-grained human feedback gives better rewards for language model training. arXiv preprint arXiv:2306.01693, 2023.
+[44] Can Xu, Qingfeng Sun, Kai Zheng, Xiubo Geng, Pu Zhao, Jiazhan Feng, Chongyang Tao, and Daxin Jiang. Wizardlm: Empowering large language models to follow complex instructions. arXiv preprint arXiv:2304.12244, 2023.
+[45] Kevin Yang, Dan Klein, Asli Celikyilmaz, Nanyun Peng, and Yuandong Tian. Rlcd: Reinforcement learning from contrast distillation for language model alignment. arXiv preprint arXiv:2307.12950, 2023.
+[46] Da Yin, Xiao Liu, Fan Yin, Ming Zhong, Hritik Bansal, Jiawei Han, and Kai-Wei Chang. Dynosaur: A dynamic growth paradigm for instruction-tuning data curation, 2023.
+[47] Weizhe Yuan, Kyunghyun Cho, and Jason Weston. System-level natural language feedback, 2023.
+[48] Zheng Yuan, Hongyi Yuan, Chuanqi Tan, Wei Wang, Songfang Huang, and Fei Huang. Rrhf: Rank responses to align language models with human feedback without tears. arXiv preprint arXiv:2304.05302, 2023.
+
+[49] Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric Xing, et al. Judging llm-as-a-judge with mt-bench and chatbot arena. arXiv preprint arXiv:2306.05685, 2023.
+
+# APPENDIX
+
+# A LIMITATIONS
+
+While there are many different ways to collect feedback, our focus is on relative and absolute feedback. Future work should explore the impact of collecting richer forms of feedback. Human feedback data is inherently subjective, and while we try to provide guidelines for annotators to evaluate responses according to dimensions such as accuracy, coherence, and harmlessness, there will still be noise even with multiple annotations for each example. Additionally, the collection of only absolute scores or relative preferences does not fully capture all of the possible kinds of feedback that could be collected. More rich forms of feedback data should be explored in future work.
+
+Our analysis is primarily focused on the impact of different feedback collection methods on the downstream performance of LMs as evaluated by win-rate against DaVinci-003. Future work should investigate the impact of different feedback collection and conversion methods on helpfulness, harmfulness, and hallucinations. Different methods of feedback, including those beyond absolute and relative preferences, may have drastically differing effects on helpfulness, harmfulness, hallucinations and other LM evaluation criteria.
+
+Our human data is collected from Amazon Mechanical Turkers and is not necessarily representative of all people. Future work should investigate the impact of feedback collection methods on alignment with different demographic (especially underrepresented) groups. Some methods of feedback collection may amplify bias in the annotator demographics in the trained reward models more than others. Additionally, while we focus on open-ended response domains, our findings on the impact of different feedback collection methods may differ in more application specific domains such as mathematical reasoning or coding tasks. For instance, in a mathematical proof task, binary feedback may be more helpful since a step in a proof is always correct or incorrect.
+
+# B DETAILED RELATED WORK
+
+Learning from Human Feedback. In a typical Reinforcement Learning setting, a policy is optimized to maximize a reward function, which is explicitly defined by a human. [9] introduced the Reinforcement Learning from Human Feedback (RLHF) framework, which initially learns a reward model network from a dataset of human preferences. This reward model is then used to replace a human-written reward function during RL optimization. [35] and [26] introduced an RLHF framework for aligning LMs with human preferences. They first learn a reward model trained on rankings of human feedback sampled from LM outputs, which is then used to optimize an LM with an RL algorithm. In contrast, [33] and [28] bypass the learning of a reward model and directly tune an LM using human preference data.
+
+Learning from AI Feedback. While RLHF has shown promising results, the collection of human preferences remains a significant cost for aligning language models. Prior work has demonstrated that LMs are capable of providing feedback [16, 49, 12] that can be used to improve their own capabilities [22, 1]. [4] introduced the Reinforcement Learning from AI Feedback (RLAIF) framework, which replaces the human feedback step of RLHF with an automatic AI feedback generation procedure. Our work compares human feedback with AI feedback in both rankings and ratings settings.
+
+Feedback Data Collection. While RLHF and RLAIF have proven to be highly effective methods for aligning LLMs, additional challenges remain, including the optimization of feedback collection and reward modeling [7]. Previous works have utilized both human and AI feedback in both ratings [19, 17] and rankings [35, 26, 37, 12] settings on machine-written responses [3] and human-written responses [24]. However, there has not been work that systematically compares the effects of collecting ratings versus rankings feedback. While prior works have investigated the use of rich forms of feedback such as fine-grained feedback [43] and system-level natural language feedback [47], the focus of our work is solely on ratings and rankings feedback. Finally, inconsistency has been explored before in terms of intransitivity in human preferences [39] and (dis-)agreements arising among different annotators when providing feedback on a single entity. However, our work focuses on the (dis-)agreements between the different feedback protocols.
+
+# C COMPOSITION OF THE INSTRUCTIONS DATA
+
+We collect a diverse set of instructions from varied sources:
+
+1. Dolly [10]: We randomly select a subset of 4K out of 15K high-quality human-generated prompts and response pairs.
+2. Self-Instruct (User Oriented) [42]: It is a set of 252 expert-written instructions.
+3. Super-NI [40]: Originally, it contains $1600+$ NLP tasks with their expert-written task-descriptions. In our work, we select a subset of 100 dense NLP tasks such as 'question generation based on a given scenario' instead of the ones that require just 'yes/no' answer (Appendix §Q). Subsequently, we randomly select 10 instances for every task.
+
+The composition of the instruction data is presented in Table 3.
+
+
Instructions Composition
# of instructions from Dolly
4K
# of instructions from Self-Instruct (User Oriented)
252
# of instructions from Super-NI
1K
# of generations per instruction
5
Feedback Composition (GPT-3.5-Turbo)
# of instances w/ Ratings
24.6K
# of instances w/ Pairwise Rankings
46.5K
Feedback Composition (Humans)
# of instances w/ Ratings
4K
# of instances w/ Pairwise Rankings
2K
+
+Table 3: Feedback data statistics. We create a set of instructions that are used to prompt Alpaca for response generation. Subsequently, we acquire feedback on those responses from humans and AI.
+
+# D FEEDBACK ACQUISITION FROM HUMANS
+
+Firstly, we randomly select a subset of 500 from 46.5K from the GPT-3.5-Turbo rankings feedback data. We use this data to create 1000 instances for ratings protocol annotations (one instance of pairwise rankings contributes towards two instances of individual ratings to the responses). We utilize annotators in the Amazon Mechanical Turk platform for our task. Before the qualifications, the annotators are shown a few solved examples for both protocols. Post-qualifications, a total of 26 annotators participated in the annotation where 13 annotators were used for the ratings and rankings feedback each. The annotators were paid an hourly wage of $18/hour. The overall cost for human annotations was $1000. We assign each instance of the feedback data to four workers. In summary, we have 2000 rankings feedback (= 500 instances × 4 workers per instance) and 4000 ratings (= 1000 instances × 4 workers per instance) from human annotators.
+
+# E VARIATION IN CONSISTENCY SCORES WITH ANNOTATORS
+
+# E.1 HUMAN ANNOTATORS
+
+In Table 2b, the consistency analysis is performed by aggregating the preferences of three random annotators (out of four). To understand the effect of different batch of humans, we calculate the consistency scores for a different batch of randomly selected 3 annotators four times. We find that the standard deviation of the inconsistency analysis for four splits of the humans evaluators is $1.6\%$ . This indicates that the inconsistency analysis is robust to the batch of humans used for annotation.
+
+# E.2 AI ANNOTATOR
+
+In our main experiments, we use GPT-3.5-Turbo (temperature $= 0.0$ ) for the consistency analysis. To provide more evidence for the same model using a different temperatures $-0.0, 0.2$ and $0.5$ for 1000
+
+comparisons. We find that the standard deviation in the disagreements between these temperatures is $2.7\%$ . This indicates that the inconsistency analysis is also robust to the different model temperatures used for generating feedback data.
+
+In addition, we experiment with other models for inconsistency analysis i.e., GPT-3.5-Turbo-0613 and GPT-4 with 50. The inconsistency results for these models are presented in Table 4.
+
+
Model
Inconsistency
ChatGPT-3.5-Turbo-Temperature=0 (Default=Ours)
58%
ChatGPT-3.5-Turbo-Temperature=0.5
56%
ChatGPT-3.5-Turbo-0613
54%
GPT-4
50%
+
+Table 4: Inconsistency analysis with varying AI annotators.
+
+The standard error for the above numbers is $4\%$ with $95\%$ confidence. We find that all the model choices suffer from the inconsistency problem. This indicates that our results are not restricted by the choice of the AI annotator, and are indeed observable in different models too.
+
+# F PAIRWISE RATING
+
+We acquired feedback data using a third protocol i.e., pairwise rating. Given a pair of responses, provide a rating score [1-7] to both of them. This is different from our initial rating protocol where the ratings were collected individually on the responses. We convert this newly collected pairwise rating response to a ranking form by comparing the scores given the pair of responses. For example, if Response 1 got 7 and Response 2 got 5, we consider Response 1 $\dot{\iota}$ Response 2. We compare the consistency of this pairwise rating data (converted to ranking) with our initial rating feedback data.
+
+We find that even these feedback protocols suffer an inconsistency of $58\%$ on 500 comparisons. It also highlights that the rating collected in a pairwise manner (akin to ranking format) is not calibrated with the rating collected for the responses individually. This can be attributed to the fact that the annotators focus on the different response quality attributes when providing pairwise feedback and independent feedback.
+
+# G SETUP
+
+Reward Modeling. We choose low-rank adaptation [15] (LoRA) of Alpaca-7B as the reward model.2 We use the objective function defined in Eq. 2 to train the reward model on the rankings feedback data. Similar to [26], a single batch only contains all the pairs of candidate responses for a particular instruction. Further, $70\%$ of the feedback data is used for training and the rest is for validation. We provide more details on the training settings in Appendix $\S K$ . We train the reward models on the rankings and ratings feedback for 5 epochs with early stopping where the validation loss is the criteria. We train each reward model for three random seeds.
+
+Evaluation. Post-training, we evaluate the models on 553 unseen instructions, which includes 188 instructions from the Open Assistant (OASST) evaluation, 129 from the helpful evaluation released by Anthropic [3], 80 from Vicuna evaluation [8], and 156 from Koala evaluation [13]. We employ a Best-of-n ( $n = 64$ ) policy to evaluate the effect of various feedback data on model alignment. For this, we first generate $n$ candidate responses of length 200 from the SFT model (Alpaca-7B) with the unseen instructions. Subsequently, the output of Best-of-n would be the one that achieves the maximum score with the trained reward model. Finally, we compute the win-rate of the SFT model and the Best-of-n policies against DaVinci-003 (reference model) on these unseen instructions. Here, we use the DaVinci-003 responses collected in AlpacaEval [18]. Here, we vary the choice of the feedback protocols as ratings and rankings during evaluation and the choice of the annotators as humans and ChatGPT-3.5-Turbo. Each pairwise comparison or response rating is performed by a crowd-worker, where we paid $18 per hour for the annotations. We spent $1000 on collecting evaluation annotations from humans.
+
+Computing Win-rates. Post-alignment, we evaluate the Best-of-n policies (ratings, rankings) against a reference model on a set of unseen user instructions $\mathcal{U}$ . Since we aim to understand the effect of the choice of the feedback acquisition protocol on the complete alignment pipeline, we collect ratings and rankings for the responses from the alignment policy and the reference models from humans and AI as annotators. We compute the win-rate against the reference model as the fraction of instances for which the Best-of-n policy response is preferred over the reference model under a particular feedback protocol. In case of a 'tie' judgment by the annotators, both the policy and reference model get half a point. Formally, we define per-example score for rankings as
+
+$$
+\mathcal {E} (u, y _ {\mathcal {P}}, y _ {\mathcal {F}}) = \left\{ \begin{array}{l l} 1 & r (u, y _ {\mathcal {P}}, y _ {\mathcal {F}}) = y _ {\mathcal {P}} \\ 0. 5 & r (u, y _ {\mathcal {P}}, y _ {\mathcal {F}}) = t i e \\ 0 & r (u, y _ {\mathcal {P}}, y _ {\mathcal {F}}) = y _ {\mathcal {F}} \end{array} \right. \tag {5}
+$$
+
+and for ratings as
+
+$$
+\mathcal {E} (u, y _ {\mathcal {P}}, y _ {\mathcal {F}}) = \left\{ \begin{array}{l l} 1 & a (u, y _ {\mathcal {P}}) > a (u, y _ {\mathcal {F}}) \\ 0. 5 & a (u, y _ {\mathcal {P}}) = a (u, y _ {\mathcal {F}}) \\ 0 & a (u, y _ {\mathcal {P}}) < a (u, y _ {\mathcal {F}}) \end{array} \right. \tag {6}
+$$
+
+where $u \in \mathcal{U}$ is the unseen input instruction, $y_{\mathcal{P}} = \mathcal{P}_n(g_\theta, p_\theta, u, \{v_1, \ldots, v_n\})$ is output from the Best-of-n policy that leverages the rankings reward model, $y_{\mathcal{F}}$ is the response from the reference model, $r(u, y_{\mathcal{P}}, y_{\mathcal{F}})$ is the preference between the pair of responses decided by the annotator. Win-rate metric $w$ is computed as the average per-example score:
+
+$$
+w = \frac {1}{| \mathcal {U} |} \sum_ {u \in \mathcal {U}} \mathcal {E} (u, y _ {\mathcal {P}}, y _ {\mathcal {F}}) \tag {7}
+$$
+
+# H ANALYSIS OF THE RESPONSE LENGTH AND NUMBER OF UNIQUE WORDS
+
+We assess whether the length or number of unique words in the candidate responses bias the ratings and rankings feedback judgments from humans and AI in our data. We present the results for such assessment in the ratings and rankings feedback in Appendix Table 5 and 6 respectively. In summary, we find that there is no discernible difference between the average length and average number of unique tokens of the preferred and unpreferred response in the rankings feedback collected from the humans and AI.
+
+In Table 5, we find that the ratings scores assigned to the individual responses do not increase with the average length and the average number of unique words in the response for both humans and AI. Similarly in Table 6, we find that there is no discernible difference between the average length and average number of unique tokens of the preferred and unpreferred response in the rankings feedback collected from the humans and AI. This highlights that our feedback data is unbiased towards longer and unique responses, and the differences observed from the prior works might be attributed to differences in the experimental setups.
+
+We clarify that our setup is not biased towards the response lengths. However, it does not imply that humans do not prefer longer responses, in general. [49] mentioned morbidity bias examined morbidity bias when using LLMs to collect feedback data by constructing a repetitive list attack in which responses with a list were prepended with a paraphrased version of the list (generated by GPT-4) which contains no new information. For example, model A has two pointer responses and model B has the same two pointers + their paraphrased versions (which does not add any new information), the annotators prefer model B response. We believe that this setting largely differs from our setting since we consider two different responses with no further intervention such as a repetition attack. Similarly, [29] talks about morbidity bias in preference labeling from humans and AI for creative writing tasks. In our work, we consider a broad range of instructions sourced from 3 datasets as discussed in Table 3.
+
+
2
3
4
5
6
7
Humans
45.4
49.7
48.9
46.3
47.7
48.3
GPT-3.5-Turbo
32.4
45.2
41.5
47
48.7
46.7
+
+(a) Average response length
+
+
2
3
4
5
6
7
Humans
34.2
36.6
36.6
35.7
36.7
37.1
GPT-3.5-Turbo
25
34.4
31.4
35.8
37.5
36.5
+
+(b) Average number of unique words
+Table 5: Analysis to study the length or number of unique tokens bias for ratings feedback.
+
+
+
+(a) Difference in the ratings feedback scores when rankings feedback is decisive.
+
+
Rankings Variation Score (Human Feedback)
Consistent
0.50
Inconsistent
0.36
+
+(b) Variation in the rankings feedback for consistent and inconsistent examples.
+
+Table 7: Quantitative analysis of the differences between the consistent and inconsistent subsets of the feedback data acquired from humans and AI.
+
+Variation in the Rankings. Due to the closeness in the perceived quality of the pair of responses belonging to the inconsistent instances, we posit that the human annotators prefer specific quality factors over the others (e.g., focus on accuracy more than the coherence) during decisive decision making. Conversely, we expect the variation in human rankings to be lower when one of the responses is perceived to be qualitatively superior. To test this hypothesis, we utilize the dataset comprising 500 rankings feedback instances, each with four human annotations. In the dataset, annotations favoring 'response 1' are marked as $+1$ , those favoring 'response 2' are marked as $-1$ , and annotations indicating 'equal' preference are marked as $0$ . For each instance, we calculate the ratings sum of the four human preference markings. A low score on an instance suggests that the
+
+
+Figure 7: Screenshot for ranking feedback acquisition with explanations.
+
+pair of candidate responses are considered 'close' by the annotators, leading to an equal likelihood of selecting 'equal' or either of the two responses. Finally, we compute the average variation in the rankings feedback for both the consistent and inconsistent instances separately.
+
+The results of our analysis are presented in Table 7b. To quantify average variation in annotator feedback of a single example, we define a variation score metric. For each example, we take the sum of the score for each annotator's label. Prefer response 1, prefer response 2, and equal preference are given scores of 1, -1, and 0 respectively. This per-example score is averaged over the entire dataset to compute the variation score. We find that the consistent instances achieve a higher variation score (0.5) as compared to the inconsistent instances in the human feedback data (0.36). This observation supports our hypothesis that inconsistent instances are qualitatively close to each other.
+
+# K TRAINING SETTINGS
+
+We train the reward models on the rankings and ratings feedback data for 5 epochs with early stopping at the end of every epoch. We use the validation loss for early stopping. We train the reward models on a single Nvidia RTX A6000 GPU with 48GB VRAM.
+
+The reward models optimized using equation 2 are trained with an effective batch size $= 16$ where the batch size $= 4$ and the number of gradient accumulation steps $= 4$ . Here, each batch contains all the pairs of candidate responses for a given instruction. Since we have 5 candidate responses for a given instruction in the feedback data, we get 10 pairs of candidate responses (5 choose 2) in a batch. The reward models optimized using equation 1 are trained with an effective batch size $= 64$ where the batch size $= 16$ and the number of gradient accumulation steps $= 4$ .
+
+Both the reward models use the AdamW optimizer [21] with a linear warmup of 100 steps to a maximum learning rate followed by a cosine decay. We perform a hyperparameter search over $\{1e - 4, 1e - 5, 1e - 6\}$ for maximum learning rate. We find that $1e - 4$ for Alpaca-LoRA reward model architecture. We also apply a weight decay of 0.001 to all the reward models and train them at fp16 precision.
+
+
OASST
Best-of-64 (Rating)
Best-of-64 (Ranking)
Ranking Eval
46.7
52.6
Rating Eval
47.0
43.5
Vicuna
Best-of-64 (Rating)
Best-of-64 (Ranking)
Ranking Eval
48.6
54.3
Rating Eval
44.3
38.1
Helpful Base
Best-of-64 (Rating)
Best-of-64 (Ranking)
Ranking Eval
45.1
48.8
Rating Eval
47.0
46.8
+
+# L TASK-SPECIFIC RESULTS
+
+In §5.2, we presented the evaluation inconsistency on the 553 instructions from AlpacaEval. In Table 8, we aim to assess the evaluation inconsistency on specific tasks.
+
+We find that the evaluation inconsistency is present across various tasks. Specifically, the rating evaluation protocol favors the rating best-of-64 policy and vice-versa. This highlights that feedback acquisition protocol biases evaluation.
+
+# M REJECTION SAMPLING FINETUNING (RSFT)
+
+We performed an additional experiment with rejection sampling finetuning (RSFT) used in three highly cited LLM alignment papers, including LLaMA 2 [38, 4, 48] Specifically, our setup is as follows:
+
+1. We prompt Alpaca-7B with 5K instructions from Alpaca-52K data.
+2. We generate 64 responses for every instruction.
+3. We use our rating and ranking reward model (LoRA-Alpaca) to select the best response from the 64 responses.
+4. We finetune two Alpaca-7B models with the 5K instruction-responses data.
+
+(a) One where the responses are chosen from the rating reward model.
+(b) Second where the responses are chosen from the ranking reward model.
+
+5. Post finetuning, we sample a single response from the finetuned Alpaca-7B with 553 evaluation instructions.
+6. We calculate the win-rate against DaVinci003 using the rating and ranking protocol using ChatGPT.
+
+The results for this experiment where baseline is the base Alpaca-7B model are presented in Table 9.
+
+Table 8: Task-specific evaluation inconsistency results.
+
+
Baseline
RSFT (Rating)
RSFT (Ranking)
Ranking Evaluation
36.9
42.0
43.3
Rating Evaluation
41.9
44.0
43.0
+
+Table 9: Evaluation inconsistency in the RSFT setup. Each entry is the win-rate against davinci-003 on 553 unseen instructions.
+
+We find that the evaluation inconsistency persists under this alignment algorithm too. It indicates that the choice of feedback protocol for the evaluation favors the same feedback protocol used for training the reward models and subsequently finetuning the base LLM.
+
+# N USING ROBERTA-LARGE AS REWARD MODEL
+
+Prior works [26, 12] use decoder-only architecture for the reward model. These models are normally at a scale of 10-100 billion parameters and harder to train in the compute efficient manner without engineering tricks. Hence, we chose Alpaca-7B in our setup, and LoRA is just a method to finetune it in a parameter efficient manner. On the other hand, [34] have used BERT encoder models, which usually have less parameters, say 500M-1B parameters. Finetuning BERT models achieve very good performance on many NLP tasks. Hence, we repeat train reward models on the RoBERTA-Large architecture.
+
+Specifically, we finetune a RoBERTA-Large model on the ratings data using the regression loss. In addition, we train another RoBERTA-Large model on the rankings data using the negative log likelihood loss. We use these two finetuned models to perform Best-of-64 policy. Subsequently, we use GPT-3.5-Turbo to provide rating and ranking feedback for the rating/ranking Best-of-64 policy. We present the results in Table 10.
+
+
Best-of-64 (Rating)
Best-of-64 (Ranking)
Rating Evaluation
47.70%
42.00%
Ranking Evaluation
43.90%
47.30%
+
+We find that the evaluation inconsistency still persists if we change the choice of the reward model. Specifically, the rating evaluation protocol favors the rating best-of-64 policy and vice-versa. This highlights that feedback acquisition protocol biases evaluation. We will add these additional results in the revised paper.
+
+# O CONVERTING RATING FEEDBACK INTO RANKING FORMAT FOR REWARD TRAINING
+
+In our work, we established that the feedback data obtained from humans and AI suffers from inconsistency problems. We believe that our work is unique as it shows that this has a direct impact on the alignment and evaluation of LLMs through empirical evidence.
+
+The choice of reward models was naturally made to reflect the nature of the feedback protocol. Specifically, the rating protocol provides us with a scalar score hence the regression model makes sense, and the ranking protocol does not provide us with scalar scores hence we use a negative log likelihood (NLL) objective function.
+
+We observe that $57.4\%$ of the pairwise comparisons are considered "equal" when we convert the rating data into the ranking format (Row 1 of Table 2b). In practice, this means that we need to filter almost $60\%$ of the rating data if we want to train a ranking format reward model. This is not the most optimal way to use the rating data when we know that a better regression method exists that can utilize the complete data. Hence, we train a regression reward model in our original setup.
+
+We train two reward models, of RoBERTA-Large architecture, on (a) ranking data with NLL loss and (b) rating data converted to ranking with NLL loss. We perform Best-of-n sampling with $n = 64$ . We evaluate the model's win-rate against davinci-003 with a rating and ranking evaluation scheme. We present the results in Table 11.
+
+Table 10: Evaluation inconsistency when RoBERTA-Large models are used as reward models instead of Alpaca-7B model. Each entry is the win-rate against davinci-003 on 553 instructions.
+
+
Best-of-64 (Ranking)
Best-of-64 (Rating Data Ranking Format)
Ranking Evaluation
47.3%
45%
Rating Evaluation
42.0%
46%
+
+Table 11: Evaluation Inconsistency in pairwise rating feedback data collection. Each entry represents the win-rate against davinci-003.
+
+We highlight that the evaluation inconsistency is still evident when the data format used for training the reward models is kept identical. This indicates that our finding is not confounded by the reward model's data format but the nature of the feedback protocol data itself i.e., rating and ranking.
+
+# P QUALITATIVE EXAMPLES WITH HUMAN EXPLANATIONS
+
+We perform qualitative analysis with human annotators. The group of annotators that provide rating/ranking with explanations is mutually exclusive. In total, we consider a subset of 50 instructions and 100 responses (2 responses per instruction) from our dataset. In addition, we assign 3 annotators per rating/ranking instance. The humans are provided the same annotation guidelines as before but they are asked to provide an explanation for their annotation too. We provide them 2 solved examples of how the explanations could look like. We intended to keep the human explanations free from any biases from the authors, hence, we instructed the humans to provide their explanation based on their perception of the response quality.
+
+We present a few qualitative examples with explanations from the human annotators in Table 12, 13, 14, 15, 16, and 17.
+
+In Table 12, we observe that the annotators responsible for rankings favored 'response 2' due to its density, while perceiving 'response 1' as dull. At the same, despite these divergent preferences, the individual responses received conflicting rating scores: 'response 2' incurred a substantial penalty for its density and perceived non-compliance with task instructions, whereas 'response 1' garnered an average score for only a partial adherence to the guidelines.
+
+Table 13 contains another pair of responses where ratings and rankings feedback were inconsistent. Both responses provide decent answers to the instructions. Explanations of rankings feedback highlighted the differences between the responses, including that the rejected response was "a bit unnatural" compared to the chosen response. On the other hand, explanations of ratings feedback mainly provided insights into why each response was good and thus received a high score. These observations suggest that the inconsistency problem arises from systematic variations in the annotator preferences with the differences in the nature of the feedback protocol.
+
+Table 15 contains an example where rankings and ratings data are consistent with each other. The instruction asks for a question such that every item in a list of given inputs is a correct and reasonable answer to the question. The explanations for ratings feedback for the response 2 which contained a correct response were very simple, usually just indicating that the instruction was followed. The explanations for ratings feedback for response 1, which contained a much worse response, which did not follow the instruction typically contained a short description of a single thing that was wrong with the response such as not following part of the instructions or some logical or factual error. The explanations for rankings feedback contained more detailed analysis of the differences between the two responses and tended to be longer than explanations for ratings feedback. Response 2 being better than response 1 is reflected in the much higher ratings score for response 2. The size of this difference is not captured by rankings feedback.
+
+Table 16 contains another example where ratings and consistent feedback is consistent. The instruction asks for a factual answer to a simple question. Response 1 provides the correct answer and response 2 provides an incorrect answer. For very straightforward, short responses, both rankings and ratings feedback explanations are similar indicating that response 1 is correct while response 2 is incorrect. This straightforward difference is reflected in the very large ratings score gap between the two responses.
+
+# Q LIST OF TASKS FROM SUPERNI-V2
+
+The list of Super-Natural Instructions [40] tasks used in the feedback data are presented in Table 18.
+
+Example 1: Both responses do not complete the task fully.
+
+Instruction: You need to create a question containing a blank (_, based on the given context word. Your question must contain two persons -PersonX and PersonY. The expected answer to your question must be PersonX. PersonX and PersonY should not be equally likely to fill the blank. There should be an agreed upon answer to fill in the blank. Your question must contain at least 15 and at most 30 words. You must utilize the given context word while writing the question. Your question must contain only one blank. Make sure that Person X and Person Y have the same gender. In your question, PersonX and PersonY should be used only ONCE and PersonX should appear earlier than PersonY.
+
+Input: Context Word is 'peeling'
+
+Response 1: Person $X$ and Person $Y$ are peeling an orange together. Who is better at peeling oranges, person $X$ or person $Y$ ? (Person $X$ should be considered the expert in this scenario).
+
+Response 2: PersonX and PersonY are peeling an orange. PersonX has a knife with which he/she is peeling the orange. PersonY is talking to PersonX and is asking for a sip of juice from the orange. PersonX is saying no, and PersonY smiles sheepishly. PersonX eventually gives in and they both sip the juice from the orange. Who is peeling the orange? PersonX
+
+# Rankings Feedback: Response 2
+
+Explanations:
+
+Annotator 1 w/ preference for Response 1: "Neither question contains a blank, but I picked response A as response B explicitly answers the question within the question's own text."
+
+Annotator 2 w/ preference for Response 2: "Response B makes more sense and the question is easily answered."
+
+Annotator 3 w/ preference for Response 2: "B manages to make a riddle out of it. A is kind of boring in comparison."
+
+# Ratings Feedback for Response 1: Score 4
+
+Explanations:
+
+Annotator $1'$ w/ Score 4: "Response is relevant to the input, but only partially follows complicated instructions. no errors or harm."
+
+Annotator $2^{\prime}$ w/ Score 4: "It doesn't include a ( ), and though the answer to the question is Person X, it gave the answer away. Person X & Y are otherwise equally likely to be the correct answer."
+
+Annotator $3^{\prime}$ w/ Score 5: "There is 1 answer, but the structure of the response doesn't fit the instructions."
+
+# Ratings Feedback for Response 2: Score 2
+
+Explanations:
+
+Annotator $1''$ w/ Score 2: "This does not meet the task structure requirements, and both Person X and Person Y are peeling oranges."
+
+Annotator $2''$ w/ Score 1: "I gave it the lowest score because: (1) PersonX and PersonY was used more than once; (2) the expected answer is not just PersonX, but can also be PersonY; (3) word count is greater than 15 - 30 words."
+
+Annotator $3''$ w/ Score 2: "Everything is wrong with it... "Person X" and "Person Y" are used a lot more than once, either of them could be the answer, the question is not fill-inthe-blank or 15-30 words, etc."
+
+Table 12: Example explanation for samples with inconsistent feedback data
+
+# Example 2: Both responses provide decent answers to the instruction.
+
+Instruction: Provided the input sentence, you're expected to write a question that involves event "frequency", which refers to how often an event is likely to be repeated. For example, "taking showers" typically occurs 5 times a week, "going to Saturday market" usually happens every few weeks/months, etc. Don't create questions which have explicit mentions of answers in the text. Instead, it has to be implied from what is given. In other words, we want you to use "instinct" or "common sense". Also, the written questions are not required to have a single correct answer.
+
+Input: Sentence: His counter-attack with Dayak warriors drove the Chinese out of Bau and across the Sarawak border.
+
+Response 1: How often was his counter-attack with Dayak warriors likely to happen?
+
+Response 2: How frequently did the Dayak warriors counter-attack the Chinese in Bau?
+
+# Rankings Feedback: Response 1
+
+Explanations:
+
+Annotator 1 w/ preference for Response 1: "A does not contain the flagged word."
+
+Annotator 2 w/ preference for Response 2: "While both responses are a bit unnatural, B fits more closely with the input text in that it asks about this historical event, rather than asking for speculation about the future, as response A does."
+
+Annotator 3 w/ preference for Response 1: "response A fulfils all the instructions given which makes it better as option B made mention of answers in the text"
+
+# Ratings Feedback for Response 1: Score 6
+
+Explanations:
+
+Annotator $1^{\prime}$ w/ Score 6: "This question is relevant to the input and it follows the instruction of having to do with frequency."
+
+Annotator $2^{\prime}$ w/ Score 7: "This response follows the rules and is easy to understand."
+
+Annotator $3^{\prime}$ w/ Score 5: "It is a question that involves frequency, but I'm not sure it's one that can be answered based on instinct or common sense. Though, the input sentence doesn't leave many options."
+
+# Ratings Feedback for Response 2: Score 7
+
+Explanations:
+
+Annotator 1" w/ Score 7: "This response meets the task requirements."
+
+Annotator $2''$ w/ Score 6: "question is about frequency, followed directions"
+
+Annotator $3''$ w/ Score 7:"Question properly seeks frequency of the event."
+
+Table 13: Example explanation for samples with inconsistent feedback data
+
+# Example 3: Both responses are similar in quality
+
+Instruction: What is Age of Empires?
+
+Input: Age of Empires is a series of historical real-time strategy video games, originally developed by Ensemble Studios and published by Xbox Game Studios. The first game was Age of Empires, released in 1997. Nine total games within the series have been released so far as of October 28, 2021. Age of Empires focused on events in Europe, Africa and Asia, spanning from the Stone Age to the Iron Age; the expansion game explored the formation and expansion of the Roman Empire. The sequel, Age of Empires II: The Age of Kings, was set in the Middle Ages, while its expansion focused partially on the Spanish conquest of the Aztec Empire. The subsequent three games of Age of Empires III explored the early modern period, when Europe was colonizing the Americas and several Asian nations were on the decline. Another installment, Age of Empires Online, takes a different approach as a free-to-play online game utilizing Games for Windows Live. A spin-off game, Age of Mythology, was set in the same period as the original Age of Empires, but focused on mythological elements of Greek, Egyptian, and Norse mythology. The fourth main installment in the series, Age of Empires IV, was released on October 28, 2021. The Age of Empires series has been a commercial success, selling over 25 million copies. Critics have credited part of the success of the series to its historical theme and fair play; the artificial intelligence (AI) players have fewer advantages than in many of the series' competitors.
+
+Response 1: Age of Empires is a series of real-time strategy video games set in various time periods throughout history, originally developed by Ensemble Studios and published by Xbox Game Studios. The series has been critically successful, selling over 25 million copies. Each game in the series is set in a different time period, focusing on events in Europe, Africa, and Asia, and the expansion games explore the expansion of various civilizations. The AI players in the series were praised for having fewer advantages than in many of its competitors. Most recently, Age of Empires IV was released on October 28, 20
+
+Response 2: Age of Empires is a series of historical real-time strategy video games, originally developed by Ensemble Studios and published by Xbox Game Studios. The first game was Age of Empires, released in 1997. Nine total games within the series have been released so far as of October 28, 2021. Age of Empires focused on events in Europe, Africa and Asia, spanning from the Stone Age to the Iron Age; the expansion game explored the formation and expansion of the Roman Empire. The sequel, Age of Empires II: The Age of Kings, was set in the Middle Ages, while its expansion focused partially on the Spanish conquest of the Aztec Empire. The subsequent three games of Age of Empires III explored the early modern period, when Europe was colonizing the Americas and several Asian nations were on the decline. Another installment, Age of Empires Online, takes
+
+# Rankings Feedback: Response 2
+
+Explanations:
+
+Annotator 1 w/ preference for Response 2: "I feel response B gives a more complete answer, giving pertinent details on many of the titles from the franchise. Response A doesn't contain as much relevant/interesting info."
+
+Annotator 2 w/ preference for Response 2: “option b is more informative, its a summary that contains all the useful and informative details from the input.”
+
+Annotator 3 w/ preference for Response 2: "Response B has more in depth information from the input."
+
+# Ratings Feedback for Response 1: Score 5
+
+Explanations:
+
+Annotator $1^{\prime}$ w/ Score 4: "The response is on topic but isn't complete. It does not end on a complete sentence."
+
+Annotator $2^{\prime}$ w/ Score 6: "lots of detail but could be phrased a little better"
+
+Annotator $3^{\prime}$ w/ Score 5: "The response lacks some important details from the input, such as the total number of games in the series and specific settings for each installment. It also ends abruptly without completing the sentence."
+
+# Ratings Feedback for Response 2: Score 4
+
+Explanations:
+
+Annotator $1''$ w/ Score 2: "Response simply copies the input and is truncated."
+
+Annotator 2" w/ Score 6: "It ends abruptly after mentioning "Age of Empires Online, takes..." without providing a conclusion or continuation of the sentence."
+
+Annotator $3''$ w/ Score 4: "This answers the question, but doesn't demonstrate any interpretation or summarization of the original text."
+
+Table 14: Example explanation for samples with inconsistent feedback data
+
+# Example 1: One response is much better than the other
+
+Instruction: Construct a question that every answer in the list is correct and reasonable for it.
+
+Input: telephone, electricity, tv, car, computer, microwave
+
+Response 1: Which home appliances did you purchase in the past year?
+
+Response 2: What modern technology have been the most influential in your everyday life?
+
+# Rankings Feedback: Response 2
+
+# Explanations:
+
+Annotator 1 w/ preference for Response 2: "It's quite unlikely that someone had purchased all those items in the last year, and a car and electricity both don't qualify as a home appliance. Response B seems more fitting."
+
+Annotator 2 w/ preference for Response 2: "Response B makes more sense because people don't really think of cars or telephones as appliances."
+
+Annotator 3 w/ preference for Response 2: "The list given in the input is not confined to examples of appliances, so I would discard Response A since it is not a natural question to ask and expect this given list as an answer. Response B is a bit unnatural in its tone, but it at least fits with the expected answer from the input."
+
+# Ratings Feedback for Response 1: Score 3
+
+# Explanations:
+
+Annotator $1'$ w/ Score 2: "Electricity is not a home appliance, and it's unlikely that a consumer would purchase all of these things in the same year."
+
+Annotator $2^{\prime}$ w/ Score 3: "The response does not fully follow the instruction to construct a question. Not all items in the given list can be considered home appliances."
+
+Annotator $3^{\prime}$ w/ Score 4: "The answer to the Response's question would very from person to person."
+
+# Ratings Feedback for Response 2: Score 7
+
+# Explanations:
+
+Annotator $1''$ w/ Score 7: "All of the input items are modern technological inventions that are influential in human life. This is accurate and concise."
+
+Annotator $2^{\prime \prime}$ w/ Score 7:"This question fits all of the input values."
+
+Annotator $3''$ w/ Score 7:"perfectly lines up with all the answers in the input"
+
+Table 15: Example explanation for sample with consistent feedback data
+
+Example 2: One response contains a clear factual inaccuracy while the other does not
+
+Instruction: Who is the all time leading goal scorer for Manchester United?
+
+Input: N/A
+
+Response 1: The all time leading goal scorer for Manchester United is Wayne Rooney with 253 goals.
+
+Response 2: The all time leading goal scorer for Manchester United is Sir. Ralph Chapman with 414 goals
+
+# Rankings Feedback: Response 1
+
+Explanations:
+
+Annotator 1 w/ preference for Response 1: "Response A gives the correct answer according to google. B is wrong."
+
+Annotator 2 w/ preference for Response 1: "Response A is correct, while Response B is not."
+
+Annotator 3 w/ preference for Response 1: "A is the correct answer."
+
+# Ratings Feedback for Response 1: Score 7
+
+Explanations:
+
+Annotator $1^{\prime}$ w/ Score 7: "gives correct and precise info"
+
+Annotator $2^{\prime}$ w/ Score 7: "The answer is relevant to the instruction and seems factual. It is coherent and easy to understand. It does not have any grammatical errors and id harmless."
+
+Annotator $3^{\prime}$ w/ Score 7: "This is the perfect answer. It's accurate and written in a complete sentence."
+
+# Ratings Feedback for Response 2: Score 1
+
+Explanations:
+
+Annotator $1''$ w/ Score 1: "The answer very wrong..."
+
+Annotator $2''$ w/ Score 1: "This should be Wayne Rooney."
+
+Annotator $3''$ w/ Score 1:"Wayne Rooney tops the list of all-time goal-scorers for Manchester United."
+
+Table 16: Example explanation for sample with consistent feedback data
+
+# Example 3: One response completes the task clearly better than the other
+
+Instruction: In this task, we ask you convert a data table of restaurant descriptions into fluent natural-sounding English sentences. The input is a string of key-value pairs; the output should be a natural and grammatical English sentence containing all the information from the input.
+
+Input: name[The Golden Curry], food[English], priceRange[high], familyFriendly[no], near[The Bakers]
+
+Response 1: The Golden Curry is an English-style restaurant located near The Bakers and offers a high-price range. It is not family-friendly.
+
+Response 2: The Golden Curry is an English-speaking restaurant located near The Bakers which offers a range of prices. It is not family-friendly.
+
+# Rankings Feedback: Response 1
+
+Explanations:
+
+Annotator 1 w/ preference for Response 1: "Response A follows the instructions and creates a natural language answer to the query. It would have been better to say that the food is English rather than the vague Style, but B clearly misreads the input and says that the language is English."
+
+Annotator 2 w/ preference for Response 2: "Response B flows better to me."
+
+Annotator 3 w/ preference for Response 1: "response A is natural and completes the input without missing out any details like option B uses range of price instead of high price"
+
+# Ratings Feedback for Response 1: Score 6
+
+Explanations:
+
+Annotator $1'$ w/ Score 5: "consistent, mentions all the values from the input, could be one sentence instead of two, wording could be a little better"
+
+Annotator $2^{\prime}$ w/ Score 7: "The response accurately converts the data table of restaurant descriptions into fluent natural-sounding English sentences, containing all the information from the input."
+
+Annotator $3^{\prime}$ w/ Score 7: "I gave it the highest score as it met all requirements."
+
+# Ratings Feedback for Response 2: Score 4
+
+Explanations:
+
+Annotator 1" w/ Score 4: "I gave it a middle score since the AI's response had errors. $50\%$ correct, $50\%$ incorrect."
+
+Annotator 2" w/ Score 4: "The response should have specified English food instead of "English-speaking." The response does not include the information about the "high price range" as provided in the input.
+
+Annotator 3" w/ Score 3: "It's an English restaurant, not English-speaking. The response is not a single sentence."
+
+Table 17: Example explanation for samples with consistent feedback data
+
+
+
+Table 18: Subset of SuperNatural Instructions v2 used in experiments
\ No newline at end of file
diff --git a/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/images.zip b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c32dae4b31f71022419063494101ad04c99c1132
--- /dev/null
+++ b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8bb1356227d760022dd61c73a3b55cf4c31925d734fd1b090783006eec9952c0
+size 932275
diff --git a/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/layout.json b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..57f8c6c507da2e41bded23838abb3dad54297801
--- /dev/null
+++ b/peeringthroughpreferencesunravelingfeedbackacquisitionforaligninglargelanguagemodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:811e6cc7a20ab29d626d4d1bfaacea5618dae5606f99132d2d83bdd25bfeab68
+size 970031
diff --git a/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_content_list.json b/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..4f5ae2f309cb92c47d4c3d27e7fcce041baaba10
--- /dev/null
+++ b/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:35835c64e626ebb46dd7cbc3fbace80db8a1a16d634e2a3771d33602017f7eba
+size 199970
diff --git a/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_model.json b/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..640fe16fbce399ceef74b37f927a400f7ffd3701
--- /dev/null
+++ b/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3d7856373423ef16d28ecba885b548c71648913308fd7f0eeb916193bf85ba51
+size 232251
diff --git a/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_origin.pdf b/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..da4588801cec46dc6ae086acfb440e1d3531f956
--- /dev/null
+++ b/pefllpersonalizedfederatedlearningbylearningtolearn/9740e728-99e7-43f0-a3e4-3b3c3cac7bc5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a17b966110de68997d03fb86a4d0f99bb9ea0c6e0fbc957b94433d25f2282845
+size 1182959
diff --git a/pefllpersonalizedfederatedlearningbylearningtolearn/full.md b/pefllpersonalizedfederatedlearningbylearningtolearn/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..52fd2ed0df618a3b7d794a7f18c8fe86a50e0176
--- /dev/null
+++ b/pefllpersonalizedfederatedlearningbylearningtolearn/full.md
@@ -0,0 +1,790 @@
+# PEFLL: PERSONALIZED FEDERATED LEARNING BY LEARNING TO LEARN
+
+Jonathan Scott
+
+Institute of Science and Technology Austria (ISTA) jonathan.scott@ist.ac.at
+
+Hossein Zakerinia
+
+Institute of Science and Technology Austria (ISTA) hossein.zakerinia@ist.ac.at
+
+Christoph H. Lampert
+
+Institute of Science and Technology Austria (ISTA) chl@ist.ac.at
+
+# ABSTRACT
+
+We present PeFLL, a new personalized federated learning algorithm that improves over the state-of-the-art in three aspects: 1) it produces more accurate models, especially in the low-data regime, and not only for clients present during its training phase, but also for any that may emerge in the future; 2) it reduces the amount of on-client computation and client-server communication by providing future clients with ready-to-use personalized models that require no additional finetuning or optimization; 3) it comes with theoretical guarantees that establish generalization from the observed clients to future ones.
+
+At the core of PeFLL lies a learning-to-learn approach that jointly trains an embedding network and a hypernetwork. The embedding network is used to represent clients in a latent descriptor space in a way that reflects their similarity to each other. The hypernetwork takes as input such descriptors and outputs the parameters of fully personalized client models. In combination, both networks constitute a learning algorithm that achieves state-of-the-art performance in several personalized federated learning benchmarks.
+
+# 1 INTRODUCTION
+
+Federated learning (FL) (McMahan et al., 2017) has emerged as a de-facto standard for privacy-preserving machine learning in a distributed setting, where a multitude of clients, e.g., user devices, collaboratively learn prediction models without sharing their data directly with any other party. In practice, the clients' data distributions may differ significantly from each other, which makes learning a single global model sub-optimal (Li et al., 2020; Kairouz et al., 2021). Personalized federated learning (pFL) (Smith et al., 2017) is a means of dealing with such statistical heterogeneity, by allowing clients to learn individual models while still benefiting from each other.
+
+A key challenge of personalized federated learning lies in balancing the benefit of increased data that is available for joint training with the need to remain faithful to each client's own distribution. Most methods achieve this through a combination of global model training and some form of finetuning or training of a client-specific model. However, such an approach has a number of shortcomings. Consider, for instance, a federated learning system over millions of mobile devices, such as Gboard (Hard et al., 2018). Only a fraction of all possible devices are likely to be seen during training, devices can drop out or in at any time, and it should be possible to produce models also for devices that enter the system at a later time. Having to train or finetune a new model for each such new device incurs computational costs. This is particularly unfortunate when the computation happens on the client devices, which are typically of low computational power. Furthermore, high communication costs emerge when model parameters or updates have to be communicated repeatedly between the server and the client. The summary effect is a high latency before the personalized model is ready for use. Additionally, the quality of the personalized model is unreliable, as it depends on the amount of data available on the client, which in personalized federated learning tends to be small.
+
+In this work, we address all of the above challenges by introducing a new personalized federated learning algorithm. In PeFLL (for Personalized Federated Learning by Learning to Learn), it is the server that produces ready-to-use personalized models for any client by means of a single forward pass through a hypernetwork. The hypernetwork's input is a descriptor vector, which any client can produce by forward passing some of its data through an embedding network. The output of the hypernetwork is the parameters of a personalized model, which the client can use directly without the need for further training or finetuning. Thereby PeFLL overcomes the problems of high latency and client-side computation cost in model personalization from which previous approaches suffered when they required client-side optimization and/or multi-round client-server communication.
+
+The combined effect of evaluating first the embedding network and then the hypernetwork constitutes a learning method: it produces model parameters from input data. The process is parametrized by the networks' weights, which PeFLL trains end-to-end across a training set of clients. This learning-to-learn viewpoint allows for a number of advantageous design choices. For example, PeFLL benefits when many clients are available for training, where other approaches might suffer in prediction quality. The reason is that the client models are created by end-to-end trained networks, and the more clients participate in the training and the more diverse these are, the better the networks' generalization abilities to future clients. Also, PeFLL is able to handle clients with small datasets better than previous approaches. Because the descriptor evaluation is a feed-forward process, it is not susceptible to overfitting, as any form of on-client training or finetuning would be. At the same time, already during training the client descriptors are computed from mini-batches, thereby anticipating the setting of clients with little data. Once the training phase is concluded, PeFLL can even be used to create personalized models for clients with only unlabeled data.
+
+PeFLL's strong empirical results, on which we report in Section 4 are not a coincidence, but they can be explained by its roots in theory. Its training objective is derived from a new generalization bound, which we prove in Section 3.2 and which yields tighter bounds in the federated setting than previous ones. PeFLL's training procedure distributes the necessary computation between the server and the clients in a way that ensures that the computationally most expensive task happens on the server yet stays truthful to the federated paradigm. The optimization is stateless, meaning that clients can drop out of the training set or enter it at any time. Nevertheless, as we show in Section 3.1, it converges at a rate comparable to standard federated averaging.
+
+# 2 RELATED WORK
+
+Personalized federated learning (pFL) is currently one of the promising techniques for learning models that are adapted to individual clients' data distributions without jeopardizing their privacy. Existing approaches typically follow one of multiple blueprints: multi-task methods (Smith et al., 2017; Marfoq et al., 2021; Dinh et al., 2022; Li et al., 2021; Dinh et al., 2020; Hanzely et al., 2020; Hanzely and Richtárik, 2020; Ye et al., 2023; Zhang et al., 2023; Qin et al., 2023) learn individual per-client models, while sharing information between clients, e.g. through regularization towards a central model. Meta-learning methods learn a shared model, which the clients can quickly adapt or finetune to their individual data distributions, e.g. by a small number of gradient updates (Fallah et al., 2020; Jiang et al., 2019; Wu et al., 2023a). Decomposition-based methods (Arivazhagan et al., 2019; Collins et al., 2021; Bui et al., 2019; Liang et al., 2020; Chen et al., 2023; Wu et al., 2023b) split the learnable parameters into two groups: those that are meant to be shared between clients (e.g. a feature representation) and those that are learned on a per-client basis (e.g. classification heads). Clustering-based methods (Ghosh et al., 2020; Mansour et al., 2020) divide the clients into a fixed number of subgroups and learn individual models for each cluster.
+
+Hypernetworks (Ha et al., 2017) have only recently been employed in the context of pFL (Ma et al., 2022; Yi et al., 2023). Typically, the hypernetworks reside on the clients, which limits the methods' efficiency. Closest to our work are Shamsian et al. (2021) and Li et al. (2023), which also generate each clients' personalized model using server-side hypernetworks. These works adopt a non-parametric approach in which the server learns and stores individual descriptor vectors per client. However, such an approach has a number of downsides. First, it entails a stateful optimization problem, which is undesirable because it means the server has to know at any time in advance which client is participating in training to retrieve their descriptors. Second, the number of parameters stored at the server grows with the number of clients, which can cause scalability issues in large-scale applications. Finally, in such a setting the hypernetwork can only be evaluated for clients with which
+
+the server has interactive before. For new clients, descriptors must first to be inferred, and this requires an optimization procedure with multiple client-server communication rounds. In contrast, in PeFLL the server learns just the embedding network, and the client descriptors are computed on-the-fly using just forward-evaluations on the clients. As a consequence, clients can drop in or out at any time, any number of clients can be handled with a fixed memory budget, and even for previously unseen clients, no iterative optimization is required.
+
+Learning-to-Learn. Outside of federated learning, the idea that learning from several tasks should make it easier to learn future tasks has appeared under different names, such as continual learning (Ring, 1994; Mitchell et al., 2015), lifelong learning (Thrun and Mitchell, 1995; Chen and Liu, 2018; Parisi et al., 2019), learning to learn (Thrun and Pratt, 1998; Andrychowicz et al., 2016), inductive bias learning (Baxter, 2000), meta-learning (Vilalta and Drissi, 2002; Finn et al., 2017; Hospedales et al., 2021). In this work, we use the term learning-to-learn, because it best describes the aspect that the central object that PeFLL learns is a mechanism for predicting model parameters from training data, i.e. essentially it learns a learning algorithm.
+
+The central question of interest is if the learned learning algorithm generalizes, i.e., if it produces good models not only for the datasets used during its training phase, but also for future datasets. Corresponding results are typically generalization bounds in a PAC-Bayesian framework (Pentina and Lampert, 2014; Amit and Meir, 2018; Rothfuss et al., 2021; Guan and Lu, 2022; Rezazadeh, 2022), as we also provide in this work. Closest to our work in this regard is Rezazadeh (2022), which addresses the task of hyperparameter learning. However, their bound is not well adapted to the federated learning setting in which the number of clients is large and the amount of data per client might be small. For a more detailed comparison, see Section 3.2 and Appendix B.
+
+# 3 METHOD
+
+We now formally introduce the problem we address and introduce the proposed PeFLL algorithm. We assume a standard supervised federated learning setting with a (possibly very large) number, $n$ , of clients. Each of these has a data set, $S_{i} = \{(x_{1}^{i},y_{1}^{i}),\ldots ,(x_{m^{i}}^{i},y_{m^{i}}^{i})\} \subset \mathcal{X}\times \mathcal{Y}$ , for $i\in \{1,\dots ,n\}$ , sampled from a client-dependent data distribution $D_{i}$ . Throughout the paper, we adopt a non-i.i.d. setting, i.e., the data distributions can differ between clients, $D_{i}\neq D_{j}$ for $i\neq j$ . For any model, $\theta \in \mathbb{R}^d$ (we identify models with their parameter vectors), the client can compute its training loss, $\mathcal{L}(\theta ;S_i) = \frac{1}{m^i}\sum_{j = 1}^{m^i}\ell (x_j^i,y_j^i,\theta)$ , where $\ell :\mathcal{X}\times \mathcal{Y}\times \mathbb{R}^d\to \mathbb{R}_+$ is a loss function. The goal is to learn client-specific models, $\theta_{i}$ , in a way that exploits the benefit of sharing information between clients, while adhering to the principles of federated learning.
+
+PeFLL adopts a hypernetwork approach: for any client, a personalized model, $\theta \in \mathbb{R}^d$ , is produced as the output of a shared deep network, $h:\mathbb{R}^l\to \mathbb{R}^d$ , that takes as input a client descriptor $v\in \mathbb{R}^l$ . To compute client descriptors, we use an embedding network, $\phi :\mathcal{X}\times \mathcal{Y}\rightarrow \mathbb{R}^l$ , which takes individual data points as input and averages the resulting embeddings: $v(S) = \frac{1}{|S|}\sum_{(x,y)\in S}\phi (x,y)$ . We denote the hypernetwork's parameters as $\eta_h$ and the embedding network's parameters as $\eta_v$ . As shorthand, we write $\eta = (\eta_h,\eta_v)$ .
+
+Evaluating the embedding network followed by the hypernetwork can be seen as a learning algorithm: it transforms a set of training data points into model parameters. Consequently, learning $\eta$ can be seen as a form of learning-to-learn. Specifically, we propose the PeFLL (Personalized Federated Learning by Learning to Learn) algorithm, which consists of solving the following optimization problem, where $\| \cdot \|$ denotes the $L^2$ -norm,
+
+$$
+\min _ {\eta_ {h}, \eta_ {v}} \quad \lambda_ {h} \| \eta_ {h} \| ^ {2} + \lambda_ {v} \| \eta_ {v} \| ^ {2} + \sum_ {i = 1} ^ {n} \left[ \mathcal {L} \left(h (v \left(S _ {i}; \eta_ {v}\right); \eta_ {h}); S _ {i}\right) + \lambda_ {\theta} \| h (v \left(S _ {i}; \eta_ {v}\right); \eta_ {h}) \| ^ {2} \right]. \tag {1}
+$$
+
+PeFLL performs this optimization in a way that is compatible with the constraints imposed by the federated learning setup. Structurally, it splits the objective (1) into several parts: a server objective, which consists of the first two (regularization) terms, $f(\eta_h,\eta_v) = \lambda_h\| \eta_h\| ^2 +\lambda_v\| \eta_v\| ^2$ , and multiple per-client objectives, each of which consists of the terms inside the summation $f_{i}(\theta_{i};S_{i}) = \mathcal{L}(\theta_{i};S_{i}) + \lambda_{\theta}\| \theta_{i}\|^{2}$ . The terms are coupled through the identity $\theta_{i} = h(v(S_{i};\eta_{v});\eta_{h})$ . This split
+
+# Algorithm 1 PeFLL-predict
+
+input target client with private dataset $S$
+
+1: Server sends embedding network $\eta_v$ to client
+2: Client selects a data batch $B \subseteq S$
+3: Client computes $v = v(B; \eta_v)$
+4: Client sends descriptor $v$ to server
+5: Server computes $\theta = h(v;\eta_h)$
+6: Server sends personalized model $\theta$ to client
+
+
+Figure 1: Communication protocol of PeFLL-predict for generating personalized models.
+
+# Algorithm 2 PeFLL-train
+
+input number of training steps, $T$
+
+input number of clients to select per step, $c$
+
+1: for $t = 1, \dots, T$ do
+2: $P\gets$ Server randomly samples $c$ clients
+3: Server broadcasts embedding network $\eta_v$ to $P$
+4: for client $i \in P$ in parallel do
+5: Client selects a data batch $B \subseteq S_i$
+6: $v_{i}\gets v(B;\eta_{v})$ , client computes descriptor
+7: Client sends $v_{i}$ to server
+8: $\theta_{i}\gets h(v_{i};\eta_{h})$ server computes personalized model
+9: Server sends $\theta_{i}$ to client
+
+10: $\theta_{i}^{\mathrm{new}}\gets$ client runs $k$ steps of local SGD on $f_{i}(\theta_{i})$
+11: Client sends $\Delta \theta_{i} := \theta_{i}^{\mathrm{new}} - \theta_{i}$ to server
+12: $(\Delta \eta_h^{(i)},\Delta v_i)\gets$ server runs backprop with error vector $\Delta \theta_{i}$
+13: Server sends $\Delta v_{i}$ to client
+14: $\Delta \eta_v^{(i)}\gets$ client runs backprop with error vector $\Delta v_{i}$
+15: Client sends $\Delta \eta_v^{(i)}$ to server
+16: end for
+17: $\eta_h\gets (1 - 2\beta \lambda_h)\eta_h + \frac{1}{[P]}\sum_{i\in P}\Delta \eta_h^{(i)}$
+18: $\eta_v\gets (1 - 2\beta \lambda_v)\eta_v + \frac{1}{|P|}\sum_{i\in P}\Delta \eta_v^{(i)}$
+19: end for
+
+output network parameters $(\eta_h,\eta_v)$
+
+
+Figure 2: Data flow for PeFLL model generation (forward pass, left) and training (backward pass, right). The client descriptor, $v_{i}$ , and the client model $\theta_{i}$ are small. Transmitting them and their update vectors is efficient. The hypernetwork, $\eta_{h}$ , can be large, but it remains on the server.
+
+allows PeFLL to distribute the necessary computation efficiently, preserving the privacy of the client data, and minimizing the necessary communication overhead. Pseudocode of the specific steps is provided in Algorithms 1 and 2.
+
+We start by describing the PeFLL-predict routine (Algorithm 1), which can predict a personalized model for any target client. First, the server sends the current embedding network, $\eta_v$ , to the client (line 1), which evaluates it on all or a subset of its data to compute the client descriptor (line 3). Next, the client sends its descriptor to the server (line 4), who evaluates the hypernetwork on it (line 5). The resulting personalized model is sent back to the client (line 6), where it is ready for use. Overall, only two server-to-client and one client-to-server communication steps are required before the client has obtained a functioning personalized model (see Figure 1).
+
+The PeFLL-train routine (Algorithm 2) mostly adopts a standard stochastic optimization pattern in a federated setting, with the exception that certain parts of the forward (and backward) pass take place on the clients and others take place on the server. Thus PeFLL follows the Split Learning (Gupta and Raskar, 2018) paradigm in Federated Learning (Thapa et al., 2022). In each iteration the server selects a batch of available clients (line 2) and broadcasts the embedding model, $\eta_v$ , to all of them (line 3). Then, each client in parallel computes its descriptor, $v_i$ , (6), sends it to the server (line 7), and receives a personalized model from the server in return (line 8, 9). At this point the forward pass is over and backpropagation starts. To this end, each client performs local SGD for $k$ steps on its personalized model and personal data (line 10). It sends the resulting update, $\Delta \theta_i$ , to the server (line 11), where it acts as a proxy for $\frac{\partial f_i}{\partial \theta_i}$ . According to the chain rule, $\frac{\partial f_i}{\partial \eta_h} = \frac{\partial f_i}{\partial \theta_i} \frac{\partial \theta_i}{\partial \eta_h}$ and $\frac{\partial f_i}{\partial v_i} = \frac{\partial f_i}{\partial \theta_i} \frac{\partial \theta_i}{\partial v_i}$ . The server can evaluate both expressions using backpropagation (line 12), because all
+
+required expressions are available to it now. It obtains updates $\Delta \eta_h^{(i)}$ and $\Delta v_{i}$ , the latter of which it sends to the client (line 13) as a proxy for $\frac{\partial f_i}{\partial v_i}$ . Again based on the chain rule $(\frac{\partial f_i}{\partial\eta_v} = \frac{\partial f_i}{\partial v_i}\frac{\partial v_i}{\partial\eta_v})$ , the client computes an update vector for the embedding network, $\Delta \eta_v^{(i)}$ (line 14), and sends it back to the server (line 15). Finally, the server updates all network parameters from the average of per-client contributions as well as the contributions from the server objective (lines 17, 18) $^2$ .
+
+The above analysis shows that PeFLL has a number of desirable properties: 1) It distributes the necessary computation in a client-friendly way. The hypernetwork is stored on the server and evaluated only there. It is also never sent via the communication channel. This is important, because hypernetworks can be quite large, as already their output layer must have as many neurons as the total number of parameters of the client model. Therefore, they tend to have high memory and computational requirements, which client devices might not be able to provide.
+
+2) It has low latency and communication cost. Generating a model for any client requires communicating only few and small quantities: a) the parameters of the embedding network, which are typically small, b) the client descriptors, which are low dimensional vectors, and c) the personalized models, which typically also can be kept small, because they only have to solve client-specific rather than general-purpose tasks. For the backward pass in the training phase, three additional quantities need to be communicated: a) the clients' suggested parameter updates, which are of equal size as the model parameters, b) gradients with respect to the client descriptors, which are of equal size as the descriptors, and c) the embedding network's updates, which are of the same size as the embedding network. All of these quantities are rather small compared to, e.g., the size of the hypernetwork, which PeFLL avoids sending.
+
+3) It respects the federated paradigm. Clients are not required to share their training data but only their descriptors and—during training—the gradient of the loss with respect to the model parameters. Both of these are computed locally on the client devices. Note that we do not aim for formal privacy guarantees in this work. These could, in principle, be provided by incorporating multi-party computation (Evans et al., 2018) and/or differential privacy (Dwork and Roth, 2014). Since a descriptor is an average of a batch of embeddings, this step can be made differentially private with some added noise using standard DP techniques such as Gaussian or Laplace mechanisms. This, however, could add the need for additional trade-offs, so we leave the analysis to future work.
+
+# 3.1 CONVERGENCE GUARANTEES
+
+We now establish the convergence of PeFLL's training procedure. Specifically, we give guarantees in the form of bounding the expected average gradient norm, as is common for deep stochastic optimization algorithms. The proof and full formulation can be found in Appendix C.
+
+Theorem 3.1. Under standard smoothness and boundedness assumptions (see appendix), PeFLL's optimization after $T$ steps fulfills
+
+$$
+\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} \leq \frac {(F (\eta_ {0}) - F _ {*})}{\sqrt {c T}} + \frac {L (6 \sigma_ {1} ^ {2} + 4 k \gamma_ {G} ^ {2})}{k \sqrt {c T}} + \frac {2 2 4 c L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2}}{T} + \frac {8 b _ {1} ^ {2} \sigma_ {2} ^ {2}}{b} + \frac {1 4 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2}}{b}, \tag {2}
+$$
+
+where $F$ is the PeFLL objective (1) with lower bound $F_{*}$ . $\eta_0$ are the parameter values at initialization, $\eta_1,\ldots ,\eta_T$ are the intermediate parameter values. $L,L_{1}$ are smoothness parameters of $F$ and the local models. $b_{1},b_{2}$ are bounds on the norms of the gradients of the local model and the hypernetwork, respectively. $\sigma_{1}$ is a bound on the variance of stochastic gradients of local models, and $\sigma_{2},\sigma_{3}$ are bounds on the variance due to the clients generating models with data batches of size $b$ instead of their whole training set. $\gamma_G$ is a bound on the dissimilarity of clients, $c$ is the number of clients participating at each round, and $k$ is the number of local SGD steps performed by the clients.
+
+The proof resembles convergence proofs for FedAvg with non-i.i.d. clients, but differs in three aspects that we believe makes our result of independent interest: 1) due to the non-linearity of the hypernetwork, gradients computed from batches might not be unbiased; 2) the updates to the network parameters are not simple averages, but consist of multiple gradient steps on the clients, which the server processes further using the chain rule; 3) the objective includes regularization terms that only the server can compute.
+
+Discussion Theorem 3.1 characterizes the convergence rate of PeFLL's optimization step in terms of the number of iterations, $T$ , and some problem-specific constants. For illustration, we first discuss the case where the client descriptors are computed from the complete client dataset $(B = S_{i}$ in Algorithm 1, line 5). In that case, $\sigma_{2}$ and $\sigma_{3}$ vanish, such that only three terms remain in (2). The first two are of order $\frac{1}{\sqrt{T}}$ , while the third one is of order $\frac{1}{T}$ . For sufficiently large $T$ , the first two terms dominate, resulting in the same order of convergence as FedAvg (Karimireddy et al., 2020). If clients compute their descriptors from batches $(B \subsetneq S_{i})$ , two additional variance terms emerge in the bound, which depend on the size of the batches used by the clients to compute their descriptors. It is always possible to control these terms, though: for large $S_{i}$ , one can choose $B$ sufficiently large to make the additional terms as small as desired, and for small $S_{i}$ , setting $B = S_{i}$ is practical, which will make the additional terms disappear completely, see above.
+
+# 3.2 GENERALIZATION GUARANTEES
+
+In this section, we prove a generalization bound that justifies PeFLL's learning objective. Following prior work in learning-to-learn theory we adopt a PAC-Bayesian framework. For this, we assume that the embedding network, the hypernetwork and the personalized models are all learned stochastically. Specifically, the result of training the hypernetwork and embedding network are Gaussian probability distributions over their parameters, $\mathcal{Q}_h = \mathcal{N}(\eta_h;\alpha_h\mathrm{Id})$ , and $\mathcal{Q}_v = \mathcal{N}(\eta_v;\alpha_v\mathrm{Id})$ , for some fixed $\alpha_h, \alpha_v > 0$ . The mean vectors $\eta_h$ and $\eta_v$ are the learnable parameters, and $\mathrm{Id}$ is the identity matrix of the respective dimensions. The (stochastic) prediction model for a client with dataset $S$ is obtained by sampling from the Gaussian distribution $Q = \mathcal{N}(\theta; \alpha_\theta \mathrm{Id})$ for $\theta = h(v(S; \eta_v); \eta_h)$ and some $\alpha_\theta > 0$ .
+
+We formalize clients as tuples $(D_i, S_i)$ , where $D_i$ is their data distribution, and $S_i \stackrel{i.i.d.}{\sim} D_i$ is training data. For simplicity, we assume that all data sets are of identical size, $m$ . We assume that both observed clients and new clients are sampled from a client environment, $\mathcal{T}$ (Baxter, 2000), that is, a probability distribution over clients. Then, we can prove the following guarantee of generalization from observed to future clients. For the proof and a more general form of the result, see Appendix B.
+
+Theorem 3.2. For all $\delta >0$ the following statement holds with probability at least $1 - \delta$ over the randomness of the clients. For all parameter vectors, $\eta = (\eta_h,\eta_v)$ :
+
+$$
+\begin{array}{l} \underset {(D, S) \sim \mathcal {T}} {\mathbb {E}} \underset {(x, y) \sim D} {\mathbb {E}} \underset {\bar {\eta} _ {v} \sim \mathcal {Q} _ {v}} {\mathbb {E}} \ell \big (x, y, h (v (S; \bar {\eta} _ {v}); \bar {\eta} _ {h}) \big) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{m} \sum_ {(x, y) \in S _ {i}} \underset {\bar {\eta} _ {v} \sim \mathcal {Q} _ {v}} {\mathbb {E}} \ell \big (x, y, h (v (S _ {i}; \bar {\eta} _ {v}); \bar {\eta} _ {h}) \big) \\ + \sqrt {\frac {\frac {1}{2 \alpha_ {h}} \| \eta_ {h} \| ^ {2} + \frac {1}{2 \alpha_ {v}} \| \eta_ {v} \| ^ {2} + \log (\frac {4 \sqrt {n}}{\delta})}{2 n}} + \underset { \begin{array}{c} \bar {\eta} _ {h} \sim \mathcal {Q} _ {h} \\ \bar {\eta} _ {v} \sim \mathcal {Q} _ {v} \end{array} } {\mathbb {E}} \sqrt {\frac {\frac {1}{2 \alpha_ {\theta}} \sum_ {i = 1} ^ {n} \| h (v (S _ {i} ; \bar {\eta} _ {v}) ; \bar {\eta} _ {h}) \| ^ {2} + \log (\frac {8 m n}{\delta}) + 1}{2 m n}} \tag {3} \\ \end{array}
+$$
+
+Discussion Theorem 3.2 states that the expected loss of the learned models on future clients (which is the actual quantity of interest) can be controlled by the empirical loss on the observed clients' data (which we can compute) plus two terms that resemble regularizers. The first term penalizes extreme values in the parameters of the hypernetwork and the embedding network. Thereby, it prevents overfitting for the part of the learning process that accumulates information across clients. The second term penalizes extreme values in the output of the hypernetwork, which are the parameters of the per-client models. By this, it prevents overfitting on each client. Because the guarantee holds uniformly over all parameter vectors, we can optimize the right hand side with respect to $\eta$ and the guarantee will still be fulfilled for the minimizer. The PeFLL objective is modeled after the right hand side of (3) to mirror this optimization in simplified form: we drop constant terms and use just the mean vectors of the network parameters instead of sampling them stochastically. Also, we drop the square roots from the regularization terms to make them numerically better behaved.
+
+Relation to previous work A generalization bound of similar form as the one underlying Theorem 3.2 appeared in (Rezazadeh, 2022, Theorem 5.2). That bound, however, is not well suited to the federated setting. First, it contains a term of order $\frac{(n + m)\log m\sqrt{n}}{nm}$ , which is not necessarily small for large $n$ (number of clients) but small $m$ (samples per client). In contrast, the corresponding terms in our bound, $\frac{\log\sqrt{n}}{n}$ and $\frac{\log nm}{nm}$ , are both small in this regime. Second, when instantiating the bound from Rezazadeh (2022) an additional term of order $\frac{1}{m}\|\eta\|$ would appear, which can be large in the case where the dimensionality of the network parameters is large but $m$ is small.
+
+# 4 EXPERIMENTS
+
+In this section we report on our experimental evaluation3. The values reported in every table and plot are given as the mean together with the standard deviation across three random seeds.
+
+Datasets For our experiments, we use three datasets that are standard benchmarks for FL: CIFAR10/CIFAR100 (Krizhevsky, 2009) and FEMNIST (Caldas et al., 2018). Following prior pFL works, for CIFAR10 and CIFAR100 we form statistically heterogeneous clients by randomly assigning a fixed fraction of the total number of $C$ classes to each of $n$ clients, for $n \in \{100,500,1000\}$ . The clients then receive test and train samples from only these classes. For CIFAR10 each client has 2 of the $C = 10$ classes and for CIFAR100 each client has 10 of the $C = 100$ classes. FEMNIST is a federated dataset for handwritten character recognition, with $C = 62$ classes (digits and lower/upper case letters) and 817,851 samples. We keep its predefined partition into 3597 clients based on writer identity. We randomly partition the clients into $90\%$ seen and $10\%$ unseen. Seen clients are used for training while unseen clients do not contribute to the initial training and are only used to later assess each method's performance on new clients as described below. Additional experiments on the Shakespeare dataset (Caldas et al., 2018) are provided in Appendix A.
+
+Baselines We evaluate and report results for the following pFL methods, for which we build on the FL-Bench repository $^{4}$ : Per-FedAvg (Fallah et al., 2020), which optimizes the MAML (Finn et al., 2017) objective in a federated setting; FedRep (Collins et al., 2021), which trains a global feature extractor and per-client classifier heads; pFedMe (Dinh et al., 2020), which trains a personal model per client using a regularization term to penalize differences from a global model; kNN-Per (Marfoq et al., 2022), which trains a single global model which each client uses individually to extract features of their data for use in a $k$ -nearest-neighbor-based classifier; pFedHN (Shamsian et al., 2021) which jointly trains a hypernetwork and per client embedding vectors to output a personalized model for each client. For reference, we also include results of (non-personalized) FedAvg (McMahan et al., 2017) and of training a local model separately on each client.
+
+Constructing models for unseen clients We are interested in the performance of PeFLL not just on the training clients but also on clients not seen at training time. As described in Algorithm 1 inference on new clients is simple and efficient for unseen clients as it does not require any model training, by either the client or the server. With the exception of kNN-Per all other methods require some form of finetuning in order to obtain personalized models for new clients. Per-FedAvg and pFedMe obtain personal models by finetuning the global model locally at each client for some small number of gradient steps. FedRep freezes the global feature extractor and optimizes a randomly initialized head locally at each new client. pFedHN freezes the trained hypernetwork and optimizes a new embedding vector for each new client, which requires not just local training but also several communication rounds with the server. The most efficient baseline for inference on a new client is kNN-Per, which requires only a single forward pass through the trained global model and the evaluation of a $k$ -nearest-neighbor-based predictor.
+
+Models Following prior works in pFL the personalized model used by each client is a LeNet-style model (Lecun et al., 1998) with two convolutional layers and three fully connected layers. For fair comparison we use this model for PeFLL as well as all reported baselines. PeFLL uses an embedding network and a hypernetwork to generate this personalized client model. For our experiments the hypernetwork is a three layer fully connected network which takes as input a client descriptor vector, $v \in \mathbb{R}^l$ , and outputs the parameters of the client model, $\theta \in \mathbb{R}^d$ . For further details, see Appendix A. Note that the final layer of the client model predicts across all classes in the dataset. For the embedding network we tested two options, a single linear projection which takes as input a one-hot encoded label vector, and a LeNet-type ConvNet with the same architecture as the client models except that its input is extended by $C$ extra channels that encode the label in one-hot form. The choice of such small models for our embedding network is consistent with the fact that the embedding network must be transmitted to the client. We find that for CIFAR10 and FEMNIST the ConvNet embedding network produces the best results while for CIFAR100 the linear embedding is best, and these are the results we report.
+
+Training Details We train all methods, except Local, for 5000 rounds with partial client participation. For CIFAR10 and CIFAR100 client participation is set to $5\%$ per round. For FEMNIST
+
+
CIFAR10
CIFAR100
FEMNIST
#trn.client
n = 90
450
900
90
450
900
3237
Local
82.2 ± 0.6
70.9 ± 0.5
65.5 ± 0.7
39.4 ± 0.2
19.7 ± 0.2
11.3 ± 0.1
62.2 ± 0.1
FedAvg
47.5 ± 0.5
50.4 ± 0.6
51.9 ± 0.7
16.4 ± 0.4
20.2 ± 0.1
20.2 ± 0.2
82.1 ± 0.2
Per-FedAvg
79.1 ± 2.1
76.9 ± 0.9
76.6 ± 0.3
40.0 ± 0.3
31.5 ± 0.2
20.5 ± 0.1
82.7 ± 0.9
FedRep
84.6 ± 0.8
79.2 ± 0.6
77.3 ± 0.3
42.7 ± 0.8
35.5 ± 0.7
30.8 ± 0.5
83.6 ± 0.8
pFedMe
83.9 ± 1.2
79.0 ± 2.0
80.4 ± 0.9
39.6 ± 0.5
40.5 ± 0.4
34.6 ± 0.2
85.9 ± 0.8
kNN-Per
84.0 ± 0.3
82.0 ± 0.5
79.9 ± 0.7
42.2 ± 0.9
38.1 ± 0.4
34.5 ± 0.5
85.2 ± 0.3
pFedHN
87.8 ± 0.5
77.4 ± 1.3
66.0 ± 1.1
53.6 ± 0.2
25.5 ± 0.3
20.0 ± 1.2
83.8 ± 0.3
PeFLL
89.0 ± 0.8
88.9 ± 0.4
87.8 ± 0.4
56.0 ± 0.3
43.2 ± 0.8
40.9 ± 0.6
90.1 ± 0.1
+
+(a) Accuracy on clients observed at training time (best values per setup in bold)
+
+
CIFAR10
CIFAR100
FEMNIST
#trn.client
n = 90
450
900
90
450
900
3237
Local
81.6 ± 0.7
70.6 ± 1.8
65.5 ± 0.5
38.7 ± 0.9
19.9 ± 1.1
11.0 ± 0.5
62.1 ± 0.2
FedAvg
48.6 ± 0.3
49.6 ± 1.0
51.7 ± 0.7
17.1 ± 0.9
19.3 ± 2.0
20.5 ± 1.0
81.9 ± 0.4
Per-FedAvg
77.6 ± 1.9
69.0 ± 2.5
67.3 ± 0.8
35.6 ± 1.5
30.6 ± 0.4
20.5 ± 0.5
81.1 ± 1.5
FedRep
81.8 ± 1.0
77.4 ± 1.7
76.0 ± 0.3
38.6 ± 1.1
35.9 ± 1.5
31.8 ± 1.6
82.8 ± 0.7
pFedMe
78.4 ± 2.2
74.3 ± 1.4
72.3 ± 1.7
31.1 ± 1.4
32.3 ± 0.5
28.9 ± 0.2
86.1 ± 0.4
kNN-Per
82.4 ± 0.7
80.8 ± 1.5
78.4 ± 1.1
41.8 ± 1.2
37.2 ± 2.0
33.7 ± 0.7
84.6 ± 0.6
pFedHN
63.3 ± 3.7
60.9 ± 2.4
57.8 ± 2.0
24.1 ± 1.2
21.5 ± 1.4
20.8 ± 1.2
82.5 ± 0.1
PeFLL
89.3 ± 2.2
88.9 ± 0.6
88.5 ± 0.3
35.2 ± 1.4
38.1 ± 0.4
38.4 ± 0.9
90.7 ± 0.2
+
+(b) Accuracy on clients not observed at training time (best values per setup in bold)
+
+Table 1: Experimental results on standard pFL benchmarks. In all settings, except CIFAR100 with 100 clients, PeFLL achieves higher accuracy than previous methods, and the accuracy difference between training clients (top table) and unseen clients (bottom table) is small, if present at all.
+
+we fix the number of clients participating per round to 5. The Local baseline trains on each client independently for 200 epochs. The hyperparameters for all methods are tuned using validation data that was held out from the training set (10,000 samples for CIFAR10 and CIFAR100, spread across the clients, and $10\%$ of each client's data for FEMNIST). The optimizer used for training at the client is SGD with a batch size of 32, a learning rate chosen via grid search and momentum set to 0.9. The batch size used for computing the descriptor is also 32. More details of the hyperparameter selection for each method as well as ablation studies are provided in Appendix A.
+
+# 4.1 RESULTS
+
+Table 1 shows the results for PeFLL and the baseline methods. In all cases, we report the test set accuracy on the clients that were used for training (Table 1a) and on new clients that were not part of the training process (Table 1b). PeFLL achieves the best results in almost all cases, and often by a large margin. The improvements over previous methods are most prominent for previously unseen clients, for which PeFLL produces model of almost identical accuracy as for the clients used for training. This is especially remarkable in light of the fact that several of the other methods have computationally more expensive procedures for generating models in this setting than PeFLL, in particular requiring on-client or even federated training to produce the personalized models. We see this result as a strong evidence that PeFLL successful generalizes, as predicted by Theorem 3.2.
+
+Comparing PeFLL's results to the most similar baseline, pFedHN, one observes that the latter's performance decreases noticeably when the number of clients increases and the number of samples per client decrease accordingly. We attribute this to the fact that pFedHN learns independent client descriptors for each client, which can become unreliable if only few training examples are available for each client. Similarly, for Per-FedAvg, pFedMe and FedRep, which construct personalized models by local finetuning, the model accuracy drops when the amount of data per client decreases, especially in the more challenging CIFAR100 setup. kNN-Per maintains good generalization from train to unseen clients, but its performance worsens when the number of samples per client drops and the kNN predictors have less client data available. In contrast, PeFLL's performance remains stable, which we attribute to the fact that it learns the embedding and hypernetwork jointly from all available data. The new client does not have to use its data for training, but rather just to generate a client descriptor. As a pure feed-forward process, this does not suffer from overfitting in the low-data regime.
+
+
CIFAR10
CIFAR100
FEMNIST
#trn.client
n = 90
450
900
90
450
900
3237
FedAvg
48.6 ± 0.3
49.6 ± 1.0
51.7 ± 0.7
17.1 ± 0.9
19.3 ± 2.0
20.5 ± 1.0
81.9 ± 0.4
PeFLL
84.5 ± 0.6
83.6 ± 1.0
81.5 ± 0.7
26.3 ± 0.4
28.2 ± 0.6
30.3 ± 0.6
91.4 ± 0.1
+
+Table 2: Test accuracy on CIFAR10 and CIFAR100 for (test) clients that have only unlabeled data.
+
+Personalization for clients with only unlabeled data A scenario of particular interest is when some clients have only unlabeled data available. PeFLL can still provide personalized models for them in the following way. To train PeFLL, as before one uses only clients which do have labeled data. However, the embedding network is constructed to take only the unlabeled parts of the client data as input (i.e. it ignores the labels). Consequently, even clients that only have unlabeled data can evaluate the embedding network and obtain descriptors, so the hypernetwork can assign personalized models to them during the test phase. We report results for this in Table 2. Note that none of the personalized baseline methods from Section 4 are able to handle this setting, because they train or finetune on the test clients. Therefore, the only alternative would be to train a non-personalized model, e.g. from FedAvg, and use this for clients with only labeled data. One can see that PeFLL improves the accuracy over this baseline in all cases.
+
+Analysis of Client Descriptors Our work relies on the hypothesis that clients with similar data distributions should obtain similar descriptors, such that the hypernetwork then produces similar models for them. To study this hypothesis empirically, we create clients of different similarities to each other in the following way.
+
+Let $C$ denote the number of classes and $n$ the number of clients. Then, for each client $i$ we sample a vector of class proportions, $\pi_i\in \Delta^C$ , from a Dirichlet distribution $\mathrm{Dir}(\alpha)$ with parameter vector $\alpha = (0.1,\dots ,0.1)$ , where $\Delta^C$ is the unitary simplex of dimension $C$ . Each client then receives a dataset, $S_{i}$ , of samples from each of the $C$ classes
+
+
+Figure 3: Correlation between client descriptor similarity obtained from the embedding network and ground truth similarity over the course of training.
+
+according to its class proportion vector $\pi_{i}$ . We randomly split the clients into train and unseen clients, and we run PeFLL on the train clients. Throughout training we periodically use the embedding network to compute all client descriptors in order to track how they evolve.
+
+For any pair of such clients, we compute two similarity measures: $d_{ij}^{\pi} = \|\pi_i - \pi_j\|$ , which provides a ground truth notion of similarity between client distributions, and $d_{ij}^{v} = \| v(S_{i}) - v(S_{j})\|$ , which measures the similarity between client descriptors. To measure the extent to which $d^{v}$ reflects $d^{\pi}$ , we use their average rank correlation in the following way. For any unseen client $i$ we form vector of similarities $d_{i}^{v} = (d_{i1}^{v},\ldots ,d_{in}^{v})\in \mathbb{R}^{n}$ , and compute its Spearman's rank correlation coefficient (Spearman, 1904) to the corresponding ground truth vector $d_{i}^{\pi} = (d_{i1}^{\pi},\dots,d_{in}^{\pi})\in \mathbb{R}^{n}$ . Figure 3 shows the average of this value across the unseen clients after different numbers of training steps (CIFAR 10 dataset, 1000 clients in total). One can see that the rank correlation increases over the course of training, reaching very high correlation values of approximately 0.93. Results for other numbers of clients are comparable, see Appendix A. This indicates that the embedding network indeed learns to organize the descriptor space according to client distributional similarity, with similar clients being mapped to similar descriptors. Moreover, because these results are obtained from unseen clients, it is clear that the effect does not reflect potential overfitting of the embedding network to the training clients, but that the learned similarity indeed generalizes well.
+
+# 5 CONCLUSION
+
+In this work, we presented PeFLL, a new algorithm for personalized federated learning based on learning-to-learn. By means of an embedding network that creates inputs to a hypernetwork it efficiently generates personalized models, both for clients present during training and new clients that appear later. PeFLL has several desirable properties for real-world usability. It stands on solid theoretical foundation in terms of convergence and generalization. It is trained by stateless optimization and does not require additional training steps to obtain models for new clients. Overall, it has low latency and puts little computational burden on the clients, making it practical to use in large scale applications with many clients each possessing little data.
+
+Acknowledgements. This research was supported by the Scientific Service Units (SSU) of ISTA through resources provided by Scientific Computing (SciComp).
+
+# REFERENCES
+
+R. Amit and R. Meir. Meta-learning by adjusting priors based on extended PAC-Bayes theory. In International Conference on Machine Learning (ICML), 2018.
+M. Andrychowicz, M. Denil, S. Gomez, M. W. Hoffman, D. Pfau, T. Schaul, B. Shillingford, and N. De Freitas. Learning to learn by gradient descent by gradient descent. In Conference on Neural Information Processing Systems (NeurIPS), 2016.
+M. G. Arivazhagan, V. Aggarwal, A. K. Singh, and S. Choudhary. Federated learning with personalization layers. CoRR, abs/1912.00818, 2019. URL http://arxiv.org/abs/1912.00818.
+J. Baxter. A model of inductive bias learning. Journal of Artificial Intelligence Research (JAIR), 12: 149-198, 2000.
+D. Bui, K. Malik, J. Goetz, H. Liu, S. Moon, A. Kumar, and K. G. Shin. Federated user representation learning. CoRR, abs/1909.12535, 2019. URL http://arxiv.org/abs/1909.12535.
+S. Caldas, P. Wu, T. Li, J. Konečný, H. B. McMahan, V. Smith, and A. Talwalkar. LEAF: A benchmark for federated settings. CoRR, abs/1812.01097, 2018. URL http://arxiv.org/abs/1812.01097.
+D. Chen, L. Yao, D. Gao, B. Ding, and Y. Li. Efficient personalized federated learning via sparse model-adaptation. In International Conference on Machine Learning (ICML), 2023.
+Z. Chen and B. Liu. Lifelong machine learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 12(3), 2018.
+L. Collins, H. Hassani, A. Mokhtari, and S. Shakkottai. Exploiting shared representations for personalized federated learning. In International Conference on Machine Learning (ICML), 2021.
+C. T. Dinh, N. H. Tran, and T. D. Nguyen. Personalized federated learning with moreau envelopes. In Conference on Neural Information Processing Systems (NeurIPS), 2020.
+C. T. Dinh, T. T. Vu, N. H. Tran, M. N. Dao, and H. Zhang. A new look and convergence rate of federated multi-task learning with Laplacian regularization. IEEE Transactions on Neural Networks (TNN), 2022.
+C. Dwork and A. Roth. The algorithmic foundations of differential privacy. Foundations and Trends in Machine Learning, 9(3-4), 2014.
+D. Evans, V. Kolesnikov, and M. Rosulek. A pragmatic introduction to secure multi-party computation. Foundations and Trends in Privacy and Security, 2(2-3), 2018. ISSN 2474-1558.
+A. Fallah, A. Mokhtari, and A. E. Ozdaglar. Personalized federated learning with theoretical guarantees: A model-agnostic meta-learning approach. In Conference on Neural Information Processing Systems (NeurIPS), 2020.
+C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (ICML), Proceedings of Machine Learning Research, 2017.
+A. Ghosh, J. Chung, D. Yin, and K. Ramchandran. An efficient framework for clustered federated learning. In Conference on Neural Information Processing Systems (NeurIPS), 2020.
+J. Guan and Z. Lu. Fast-rate PAC-Bayesian generalization bounds for meta-learning. In International Conference on Machine Learning (ICML), 2022.
+O. Gupta and R. Raskar. Distributed learning of deep neural network over multiple agents. Journal of Network and Computer Applications, 116, 2018.
+D. Ha, A. M. Dai, and Q. V. Le. Hypernetworks. In International Conference on Learning Representations (ICLR), 2017.
+F. Hanzely and P. Richtárik. Federated learning of a mixture of global and local models. CoRR, abs/2002.05516, 2020. URL https://arxiv.org/abs/2002.05516.
+
+F. Hanzely, S. Hanzely, S. Horváth, and P. Richtárik. Lower bounds and optimal algorithms for personalized federated learning. In Conference on Neural Information Processing Systems (NeurIPS), 2020.
+A. Hard, K. Rao, R. Mathews, F. Beaufays, S. Augenstein, H. Eichner, C. Kiddon, and D. Ramage. Federated learning for mobile keyboard prediction. CoRR, abs/1811.03604, 2018. URL http://arxiv.org/abs/1811.03604.
+T. Hospedales, A. Antoniou, P. Micaelli, and A. Storkey. Meta-learning in neural networks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 44(9):5149-5169, 2021.
+Y. Jiang, J. Konečný, K. Rush, and S. Kannan. Improving federated learning personalization via model agnostic meta learning. CoRR, abs/1909.12488, 2019. URL http://arxiv.org/abs/1909.12488.
+P. Kairouz, H. B. McMahan, B. Avent, A. Bellet, M. Bennis, A. N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings, R. G. L. D'Oliveira, H. Eichner, S. E. Rouayheb, D. Evans, J. Gardner, Z. Garrett, A. Gascon, B. Ghazi, P. B. Gibbons, M. Gruteser, Z. Harchaoui, C. He, L. He, Z. Huo, B. Hutchinson, J. Hsu, M. Jaggi, T. Javidi, G. Joshi, M. Khodak, J. Konecny, A. Korolova, F. Koushanfar, S. Koyejo, T. Lepoint, Y. Liu, P. Mittal, M. Mohri, R. Nock, A. Ozgur, R. Pagh, H. Qi, D. Ramage, R. Raskar, M. Raykova, D. Song, W. Song, S. U. Stich, Z. Sun, A. T. Suresh, F. Tramér, P. Vepakomma, J. Wang, L. Xiong, Z. Xu, Q. Yang, F. X. Yu, H. Yu, and S. Zhao. Advances and open problems in federated learning. Foundations and Trends in Machine Learning, 14(1-2), 2021.
+S. P. Karimireddy, S. Kale, M. Mohri, S. Reddi, S. Stich, and A. T. Suresh. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning (ICML), 2020.
+A. Krizhevsky. Learning multiple layers of features from tiny images. Master's thesis, Department of Computer Science, University of Toronto, 2009.
+Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+H. Li, Z. Cai, J. Wang, J. Tang, W. Ding, C.-T. Lin, and Y. Shi. FedTP: Federated learning by transformer personalization. IEEE Transactions on Neural Networks and Learning Systems, 2023.
+T. Li, A. K. Sahu, A. Talwalkar, and V. Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50-60, 2020.
+T. Li, S. Hu, A. Beirami, and V. Smith. Ditto: Fair and robust federated learning through personalization. In International Conference on Machine Learning (ICML), 2021.
+P. P. Liang, T. Liu, Z. Liu, R. Salakhutdinov, and L. Morency. Think locally, act globally: Federated learning with local and global representations. CoRR, abs/2001.01523, 2020. URL http://arxiv.org/abs/2001.01523.
+X. Ma, J. Zhang, S. Guo, and W. Xu. Layer-wised model aggregation for personalized federated learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022.
+Y. Mansour, M. Mohri, J. Ro, and A. T. Suresh. Three approaches for personalization with applications to federated learning. CoRR, abs/2002.10619, 2020. URL https://arxiv.org/abs/2002.10619.
+O. Marfoq, G. Neglia, A. Bellet, L. Kameni, and R. Vidal. Federated multi-task learning under a mixture of distributions. In Conference on Neural Information Processing Systems (NeurIPS), 2021.
+O. Marfoq, G. Neglia, R. Vidal, and L. Kameni. Personalized federated learning through local memorization. In International Conference on Machine Learning (ICML), 2022.
+A. Maurer. A note on the PAC Bayesian theorem. CoRR, cs.LG/0411099, 2004. URL http://arxiv.org/abs/cs.LG/0411099.
+D. A. McAllester. Some PAC-Bayesian theorems. In Conference on Computational Learning Theory (COLT), 1998.
+
+B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas. Communication-efficient learning of deep networks from decentralized data. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2017.
+T. Mitchell, W. Cohen, E. Hruschka, P. Talukdar, J. Betteridge, A. Carlson, B. Dalvi, M. Gardner, B. Kisiel, J. Krishnamurthy, N. Lao, K. Mazaitis, T. Mohamed, N. Nakashole, E. Platanios, A. Ritter, M. Samadi, B. Settles, R. Wang, D. Wijaya, A. Gupta, X. Chen, A. Saparov, M. Greaves, and J. Welling. Never-ending learning. In Conference on Artificial Intelligence (AAAI), 2015.
+G. I. Parisi, R. Kemker, J. L. Part, C. Kanan, and S. Wermter. Continual lifelong learning with neural networks: A review. Neural networks, 113:54-71, 2019.
+A. Pentina and C. H. Lampert. A PAC-Bayesian bound for lifelong learning. In International Conference on Machine Learning (ICML), 2014.
+A. Pentina and C. H. Lampert. Lifelong learning with non-iid tasks. In Conference on Neural Information Processing Systems (NeurIPS), 2015.
+M. Pérez-Ortiz, O. Rivasplata, J. Shawe-Taylor, and C. Szepesvári. Tighter risk certificates for neural networks. The Journal of Machine Learning Research, 22(1):10326-10365, 2021.
+Z. Qin, L. Yang, Q. Wang, Y. Han, and Q. Hu. Reliable and interpretable personalized federated learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023.
+A. Rezazadeh. A unified view on PAC-Bayes bounds for meta-learning. In International Conference on Machine Learning (ICML), 2022.
+M. B. Ring. *Continual Learning in Reinforcement Environments*. PhD thesis, University of Texas at Austin, Computer Science Department, 1994.
+J. Rothfuss, V. Fortuin, M. Josifoski, and A. Krause. PACOH: Bayes-optimal meta-learning with PAC-guarantees. In International Conference on Machine Learning (ICML), 2021.
+Y. Seldin, F. Laviolette, N. Cesa-Bianchi, J. Shawe-Taylor, and P. Auer. PAC-Bayesian inequalities for martingales. IEEE Transactions on Information Theory, 58(12):7086-7093, 2012.
+A. Shamsian, A. Navon, E. Fetaya, and G. Chechik. Personalized federated learning using hypernetworks. In International Conference on Machine Learning (ICML), 2021.
+V. Smith, C. Chiang, M. Sanjabi, and A. Talwalkar. Federated multi-task learning. In Conference on Neural Information Processing Systems (NeurIPS), 2017.
+C. Spearman. The proof and measurement of association between two things. *The American Journal of Psychology*, 15(1):72-101, 1904.
+C. Thapa, M. A. P. Chamikara, S. Camtepe, and L. Sun. SplitFed: When federated learning meets split learning. In Conference on Artificial Intelligence (AAAI), 2022.
+S. Thrun and T. Mitchell. Lifelong robot learning. Robotics and Autonomous Systems, 15(1):25-46, 1995.
+S. Thrun and L. Pratt, editors. Learning to Learn. Kluwer Academic Press, 1998.
+R. Vilalta and Y. Drissi. A perspective view and survey of meta-learning. Artificial Intelligence Reviews, 18(2):77-95, 2002.
+J. Wu, W. Bao, E. Ainsworth, and J. He. Personalized federated learning with parameter propagation. In International Conference on Knowledge Discovery and Data Mining (KDD), 2023a.
+Y. Wu, S. Zhang, W. Yu, Y. Liu, Q. Gu, D. Zhou, H. Chen, and W. Cheng. Personalized federated learning under mixture of distributions. In International Conference on Machine Learning (ICML), 2023b.
+R. Ye, Z. Ni, F. Wu, S. Chen, and Y. Wang. Personalized federated learning with inferred collaboration graphs. In International Conference on Machine Learning (ICML), 2023.
+L. Yi, X. Shi, N. Wang, Z. Xu, G. Wang, and X. Liu. pFedLHNs: Personalized federated learning via local hypernetworks. In International Conference on Artificial Neural Networks (ICANN), 2023.
+M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. R. Salakhutdinov, and A. J. Smola. Deep sets. In Conference on Neural Information Processing Systems (NeurIPS), 2017.
+H. Zhang, C. Li, W. Dai, J. Zou, and H. Xiong. FedCR: Personalized federated learning based on across-client common representation with conditional mutual information regularization. In International Conference on Machine Learning (ICML), 2023.
+
+
Layer
Shape
Nonlinearity
Conv1
3 × 5 × 5 × 16
ReLU
MaxPool
2 × 2
-
Conv2
16 × 5 × 5 × 32
ReLU
MaxPool
2 × 2
flatten
FC1
800 × 120
ReLU
FC2
120 × 84
ReLU
FC3
84 × C
softmax
+
+
Layer
Shape
Nonlinearity
Conv1
3 × 5 × 5 × 16
ReLU
MaxPool
2 × 2
-
Conv2
16 × 5 × 5 × 32
ReLU
MaxPool
2 × 2
flatten
FC1
800 × 120
ReLU
FC2
120 × 84
ReLU
FC3
84 × l
none
+
+Table 3: LeNet-based ConvNet of personalized client models. Convolutions are without padding. $C$ is the number of classes.
+Table 4: LeNet-based embedding network. Convolutions are without padding. $l$ is the dimensionality of the client descriptor.
+
+
Layer
Shape
Nonlinearity
FC1
l × 100
ReLU
FC2
100 × 100
ReLU
FC3
100 × 100
ReLU
FC4
100 × 100
ReLU
FC5
100 × D
none
+
+Table 5: Fully connected hypernetwork. $D$ is the dimensionality of the model to be created. Note that because of FC5 alone the hypernetwork is at least 100 bigger than the client models.
+
+# A APPENDIX - EXPERIMENTS
+
+# A.1 MODEL ARCHITECTURES
+
+We used a LeNet-based architecture for the personalized model on each client. The exact architecture is shown in Table 3. After each convolutional and fully connected layer we apply a ReLU nonlinearity except for the final layer which uses a softmax for input into the cross-entropy loss. The embedding network uses the same architecture except that the final layer has dimension $84 \times l$ and we do not apply a non-linearity (Table 4). For the hypernetwork we use a fully connected network. The exact architecture is shown in Table 5. Again we apply a ReLU after each layer except the last one, which does not have a non-linearity and simply has output of size $D$ , where $D$ denotes the number of parameters in the client personalized model.
+
+# A.2 HYPERPARAMETER SETTINGS
+
+For PeFLL, each client uses a single batch of data (batch size 32) as input to the embedding network. For the hypernetwork parameter settings we use the recommended values given in (Shamsian et al., 2021) as we found these to work well in our setting as well. Specifically, the dimension of the embedding vectors is $l = \frac{n}{4}$ and the number of client SGD steps is $k = 50$ . The regularization parameters for the embedding network and hypernetwork are set to $\lambda_h = \lambda_v = 10^{-3}$ , while the output regularization is $\lambda_{\theta} = 0$ .
+
+For Per-FedAvg we used the first order (FO) approximation detailed in (Fallah et al., 2020), and following the recommendations we set the number of client local steps is set to be a single epoch. For FedRep we set the number of client updates to the head and body to 5 and 1 epochs respectively as recommended in (Collins et al., 2021). To infer on a new client we we randomly initialized a head and trained only the head locally for 20 epochs. For pFedMe we follow the recommendations in (Dinh et al., 2020) and set the regularization parameter to $\lambda = 15$ , the computation parameter to $K = 3$ and $\beta = 1$ . To infer for a new client we first initialize the clients personalized model to the global model and finetuned this for 20 epochs using the pFedMe loss function. For kNN-Per, for the scale parameter in the kNN classifier we searched over the values recommended in (Marfoq et al., 2022), namely $\{0.1, 1, 10, 100\}$ , we found that setting the scale parameter to 100 to worked best. The $k$ parameter for the kNN search and the weight parameter for how much to weight the client local vs global model were chosen individually on each client by cross-validation searching over $\{5, 10\}$ and $\{0.0, 0.1, 0.2, \dots, 1.0\}$ respectively. For pFedHN we set the hyperparameters following the recommendations in (Shamsian et al., 2021). For inferring on a new client we followed the
+
+procedure given in (Shamsian et al., 2021) and we randomly initialized a new embedding vector and optimized only this using 20 rounds of client server communication.
+
+# A.3 ADDITIONAL EXPERIMENTS
+
+Comparison of communication and computation cost with FedAvg We compare the performance of PeFLL to FedAvg with respect to communication costs of training. At each global round, the communication cost of PeFLL between the server and $c$ clients is $2c(\|\theta\| + \|\eta_v\| + \|v\|)$ while for FedAvg is $2c\|\theta\|$ . In our setting, the embedding network and client models are of comparable size and the size of client descriptors ( $v$ ) is negligibly small compared to them. Therefore, the per round communication cost of PeFLL is about twice that of FedAvg. In Figures 8-14 we plot the accuracies during training for a given communication cost (measured in GB of information transferred between server and clients) as well computational cost for the clients (measured in number of global rounds). As shown in the figures, for any given communication or computational budget PeFLL outperforms FedAvg on these datasets.
+
+Shakespeare dataset In order to test the effectiveness of PeFLL in non-image tasks, we also provide results for the Shakespeare dataset (Caldas et al., 2018), which is a next character prediction task. We use the LSTM model from Caldas et al. (2018) as the client model, and as the embedding network. The hypernetwork is the same as in all other experiments. We compare the performance in comparison to a number of baselines. Figure 5 shows the comparison of the accuracies for train and test clients during training with respect to the number of global rounds. PeFLL outperforms all baselines when comparing performance with respect to the number of global rounds. We additionally compare the performance of PeFLL with FedAvg with respect to accuracy for a given communication cost, see Figure 6. We observe similar performances for a fixed communication budget.
+
+ResNet Experiments In order to test the effectiveness of PeFLL for more modern architectures, we also performed experiments using a ResNet20 model5 for CIFAR10 dataset. We compared the performance of PeFLL with FedAvg, and the results are shown in Figure 7 for 100, 500, and 1000 clients, respectively. These figures show PeFLL outperforms FedAvg also for this model, and support the feasibility of generating modern models as part of our pipeline.
+
+Analysis of Client Extrapolation For all experiments so far, clients at training time and new clients were related in the sense that they come from the same client environment. In this section, we examine how well PeFLL is able to generalize beyond this, by studying its extrapolation performance, where the new clients come from a different client environment than the train clients. We follow the same procedure as in the previous section to simulate heterogeneous clients and use sampled Dirichlet class proportions to assign classes. For the train clients we again use $\alpha_{\mathrm{train}} = (0.1,\dots ,0.1)$ to generate each clients class proportion vector. However, for the new clients we use a different Dirichlet parameter $\alpha_{\mathrm{new}} = (\alpha ,\ldots ,\alpha)$ . For each $\alpha \in \{0.1,0.2,0.3,\dots ,1.0\}$ we generate a group of new clients using this parameter. We run PeFLL on the train clients then use the trained embedding and hypernetworks to generate a model for each of the new clients.
+
+
+Figure 4: Accuracy in client extrapolation. Larger values of $\alpha$ indicate new clients that are more dissimilar to the train clients.
+
+
+
+
+Figure 5: Test Accuracies for train clients (top row) and test clients (bottom row) during different steps of the training for PeFLL and baselines, for the Shakespeare dataset.
+
+
+Figure 6: Test Accuracies for train clients (left) and test clients (right) over the course of training measured with respect to total communication cost for PeFLL and FedAvg, for the Shakespeare dataset.
+
+
+
+Figure 4 shows the resulting accuracy values for PeFLL and the best performing baselines of Table 1, as well the baseline of purely local per-client training. Note that as $\alpha$ increases so does the difficulty of the client's problem, as illustrated by the fact that the accuracy of purely local training decreases. Despite this increased task difficulty and distributional difference PeFLL still obtains strong results. Even at $\alpha = 1$ , PeFLL produces models that are more accurate than those learned by the other methods for smaller values of $\alpha$ , and far superior to purely local training on the new clients.
+
+Integrating known client label sets In the vanilla setting of Section 4, only the client training data is used to create a model. By design, each model was a multi-class classifier across all possible classes, even if only a subset of those are relevant for the client. However, it is also reasonable to assume that clients might have prior knowledge which of the output classes they actually want to predict. This information can be included by label masking (LM), in which the client overwrites the output probabilities of classes that cannot occur for it by 0, such that they will never be predicted. We report results for this in Table 6. One can see that this has minor effects for CIFAR10, but the results for CIFAR100 are clear improved. We attribute this to the fact that the larger label set and the smaller number of examples per class increase the chances of spurious classes being predicted.
+
+
+
+
+
+
+
+
+
+
+Figure 7: Test Accuracies for train clients (left) and test clients (right) during different steps of the training for PeFLL and FedAvg for the CIFAR10 dataset with 100 clients (top row), 500 clients (middle row) and 1000 clients (bottom row). PeFLL consistently outperforms FedAvg.
+
+
+
+
+
+
+
+
+Figure 8: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the CIFAR10 dataset, 100 clients. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+
+
+
+
+
+Figure 9: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the CIFAR10 dataset, 500 clients. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+
+
+
+
+
+Figure 10: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the CIFAR10 dataset, 1000 clients. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+# A.4 ADDITIONAL FIGURES
+
+We include additional figures for the correlation between the distances between client descriptors and the true client distributional distances as described in Section 4. In Figures 15 - 17 we show the results of the experiment for different numbers of clients, 100, 500 and 1000. As we can see in all cases high correlation is achieved. With more clients we obtain higher levels of correlation and less variability in the results.
+
+# A.5 ABLATION STUDIES
+
+We include several ablation studies to explore how different design choices impact PeFLL's performance.
+
+
+
+
+
+
+Figure 11: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the CIFAR100 dataset, 100 clients. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+
+
+
+
+
+Figure 12: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the CIFAR100 dataset, 500 clients. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+Hypernetwork Size. We investigate how the size of the hypernetwork impacts performance. We keep the same hypernetwork architecture as described in Table 5 but vary the number of hidden layers. We have a small network (S) with only a single hidden layer, a medium network (M) with 3 hidden layers and a large network (L) with 5 hidden layers. We evaluate on CIFAR10 and CIFAR100 using the same experimental setup as for previous experiments, with 100, 500 and 1000 clients. The results are shown in Table 7. As we can see in the results, for CIFAR10 all 3 networks are reasonably similar with a slight drop in performance observed for the S network. For CIFAR100 it is more pronounced, with a modest increase in performance for the L network and a noticeable drop for the S network.
+
+Regularization Parameters. We examine the impact of varying the regularization parameters of the objective (1) on the performance of PeFLL. We consider different values for the regularization parameters and study the values in $\{0,5\times 10^{-5},5\times 10^{-3},5\times 10^{-1}\}$ for client regularization parameter,
+
+
+
+
+
+
+Figure 13: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the CIFAR100 dataset, 1000 clients. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+
+
+
+
+
+Figure 14: Test Accuracies for train clients (top) and test clients (bottom) during different steps of the training for PeFLL and FedAvg, for the FEMNIST dataset. PeFLL's accuracy is higher than FedAvg's with respect to the number of rounds (which roughly reflect the computational cost for the clients) as well as the communication cost.
+
+
+
+and values in $\{0,5\times 10^{-5},5\times 10^{-3}\}$ for embedding and hypernetwork regularization. The results are shown in Table 8. As one can see, PeFLL's performance is rather robust over the regularization strengthh. However, consistent with the theory, modest amounts of hypernetwork regularization parameter help preventing overfitting on training clients and improve client-level generalization. Similarly, modest amounts of client regularization improve sample-level generalization. As can be expected, very large values of this parameter leads to underfitting.
+
+**Embedding network architecture.** We also study the effect of different architecture choices for the embedding network. We compare the performance of a single-layer MLP network layer and a LeNet-style ConvNet for CIFAR10 and CIFAR100. As we can see in Table 9 the CNN embedding outperforms the MLP in all experiments.
+
+
CIFAR10
CIFAR100
#trn.client
n = 90
450
900
90
450
900
PeFLL
89.0 ± 0.8
88.9 ± 0.4
87.8 ± 0.4
56.0 ± 0.3
43.2 ± 0.8
40.9 ± 0.6
PeFLL + LM
88.9 ± 0.7
88.9 ± 0.3
88.4 ± 0.4
59.5 ± 0.7
53.2 ± 0.6
51.4 ± 0.3
CIFAR10
CIFAR100
#trn.client
n = 90
450
900
90
450
900
PeFLL
89.3 ± 2.2
88.9 ± 0.6
88.5 ± 0.3
35.2 ± 1.4
38.1 ± 0.4
38.4 ± 0.9
PeFLL + LM
88.9 ± 2.4
88.2 ± 0.9
87.4 ± 1.3
55.6 ± 1.6
53.4 ± 0.1
51.1 ± 0.2
+
+Table 6: Test accuracy on CIFAR10 and CIFAR100 for training clients (top) and test clients (bottom) without and with label masking (LM).
+
+
+Figure 15: Correlation between client descriptor similarity obtained from the embedding network and ground truth similarity over the course of training. CIFAR10, 100 Clients.
+
+
+Figure 16: Correlation between client descriptor similarity obtained from the embedding network and ground truth similarity over the course of training. CIFAR10, 500 clients.
+
+
+Figure 17: Correlation between client descriptor similarity obtained from the embedding network and ground truth similarity over the course of training. CIFAR10, 1000 clients.
+
+
CIFAR10
CIFAR100
#Clients
100
500
1000
100
500
1000
S
88.7 ± 0.3
88.2 ± 0.4
87.7 ± 0.4
57.9 ± 0.3
51.9 ± 0.6
47.4 ± 1.4
M
88.9 ± 0.7
88.9 ± 0.3
88.1 ± 0.3
59.4 ± 0.2
53.1 ± 0.4
50.8 ± 0.5
L
88.7 ± 0.8
88.8 ± 0.3
88.2 ± 0.6
59.8 ± 0.1
53.8 ± 0.2
52.6 ± 1.0
+
+Table 7: Test accuracy on CIFAR10 and CIFAR100 using different sizes of hypernetworks, small (S), medium (M) and large (L).
+
+
λh=λv
λθ
0
10-5
10-3
0
87.4 ± 1.1
87.4 ± 1.0
88.4 ± 0.6
5·10-5
88.7 ± 0.7
88.7 ± 0.6
88.8 ± 0.3
5·10-3
87.8 ± 0.8
87.6 ± 0.8
87.5 ± 0.5
5·10-1
82.5 ± 1.5
83.8 ± 1.1
86.2 ± 0.4
+
+Table 8: Test accuracy on CIFAR10 with 100 clients for different settings of the regularization parameters. On the left is the regularization of the client network, and along the top is the regularization of the hypernetwork and embedding network.
+
+
CIFAR10
CIFAR100
#Clients
100
500
1000
100
500
1000
MLP
88.5 ± 1.2
87.8 ± 1.1
87.5 ± 2.1
59.1 ± 0.2
53.4 ± 0.4
51.2 ± 0.5
CNN
88.9 ± 0.7
88.9 ± 0.3
88.4 ± 0.4
59.4 ± 0.2
54.4 ± 0.3
53.2 ± 0.3
+
+Table 9: Test accuracy on CIFAR10 and CIFAR100 using different embedding network architectures. MLP is a single hidden layer fully connected network and CNN is a LeNet-style ConvNet.
+
+# B APPENDIX - GENERALIZATION
+
+In this section we prove a new generalization bound for the generic learning-to-learn setting that, in particular, will imply Theorem 3.2 as a special case. Before formulating and proving our main results, we remind the reader of the PAC-Bayesian learning framework (McAllester, 1998) and its use for obtaining guarantees for learning-to-learn.
+
+PAC-Bayesian learning and learning-to-learn In standard PAC-Bayesian learning, we are given a set of possible models, $\mathcal{H}$ , and a prior distribution over these $P \in \mathcal{M}(\mathcal{H})$ , where $\mathcal{M}(\cdot)$ denotes the set of probability measures over a base set. Given a dataset, $S$ , learning a model means constructing a new (posterior) distribution, $Q \in \mathcal{M}(\mathcal{H})$ , which is meant to give high probability to models with small loss. The posterior distribution, $Q$ , induces a stochastic predictor: for any input, one samples a specific model, $f \sim Q$ , and outputs the result of this model applied to the input. Note that $Q$ can in principle be a Dirac delta distribution at a single model, resulting in a deterministic predictor. However, for large (uncountably infinite) model such a choice typically does not lead to strong generalization guarantees. For conciseness of notation, in the following we do not distinguish between the distributions over models and their stochastic predictors.
+
+The quality of a stochastic predictor, $Q$ , on a data point $(x,y)$ is quantified by its expected loss, $\ell_{(x,y)}(Q) = \mathbb{E}_{f\sim Q}\ell (x,y,f)$ . From this, we define the empirical error on a dataset, $S$ , as $\frac{1}{|S|}\sum_{(x,y)\in S}\ell_{(x,y)}(Q)$ , and its expected loss with respect to a data distribution, $D$ , as $\mathbb{E}_{(x,y)\sim D}\ell_{(x,y)}(Q)$ . Ordinary PAC-Bayesian generalization bounds provide high-probability upper bounds to the expected loss of a stochastic predictors by the corresponding empirical loss as well as some complexity terms, which typically include the Kullback-Leibler divergence between the chosen posterior distribution and the original (training-data independent) prior, $D_{\mathrm{KL}}(Q||P)$ (McAllester, 1998).
+
+Typically, the posterior distribution is not chosen arbitrarily, but it is the result of a learning algorithm, $A: (\mathcal{X} \times \mathcal{Y})^m \to \mathcal{M}(\mathcal{H})$ , which takes as input the training data and, potentially, the prior distribution. The idea of learning-to-learn (also called meta-learning or lifelong learning in the literature) is to learn the learning algorithm (Baxter, 2000; Pentina and Lampert, 2015).
+
+To study this theoretically, we adopt the setting where $n$ learning tasks is available, which we write as tuples, $(S_i, D_i)$ , for $i \in \{1, \dots, n\}$ , each with a data set $S_i \subset \mathcal{X} \times \mathcal{Y}$ that is sampled from a corresponding data distribution $D_i \in \mathcal{M}(\mathcal{X} \times \mathcal{Y})$ . For simplicity, we assume that all datasets are of the same size, $m$ . We assume tasks are sampled i.i.d. from a task environment, $\mathcal{T}$ , which is simply a data distribution over such tuples.
+
+Again adopting the PAC-Bayesian framework, we assume that a data-independent (meta-)prior distribution over learning algorithms is available, $\mathcal{P} \in \mathcal{M}(\mathcal{A})$ , where $\mathcal{A}$ is the set of possible algorithms, and the goal is to use the observed task data to construct a (meta-)posterior distribution, $\mathcal{Q} \in \mathcal{M}(\mathcal{A})$ . As before, the resulting procedure is stochastic: at every invocation, the system samples an algorithm $A \sim \mathcal{Q}$ . It applies this to the training data, obtaining a posterior distribution $A(S)$ , and it makes predictions by sampling models accordingly, $f \sim A(S)$ .
+
+Analogously to above situation, we define two measures of quality for such a stochastic algorithms. Its empirical loss on the data of the observed clients:
+
+$$
+\widehat {\operatorname {e r}} (\mathcal {Q}) := \frac {1}{n} \sum_ {i = 1} ^ {n} \underset {A \sim \mathcal {Q}} {\mathbb {E}} \frac {1}{m} \sum_ {j = 1} ^ {m} \ell \left(x _ {j} ^ {i}, y _ {j} ^ {i}, A \left(S _ {i}\right)\right), \tag {4}
+$$
+
+and its expected loss on future clients,
+
+$$
+\operatorname {e r} (\mathcal {Q}) := \underset {(D, S) \sim \mathcal {T}} {\mathbb {E}} \underset {A \sim \mathcal {Q}} {\mathbb {E}} \underset {(x, y) \sim D} {\mathbb {E}} \ell (x, y, A (S)). \tag {5}
+$$
+
+The following theorem provides a connection between both quantities.
+
+Theorem B.1. Let $\mathcal{P} \in \mathcal{M}(\mathcal{A})$ and $P \in \mathcal{M}(\mathcal{H})$ be a meta-prior and a prior distribution, respectively, which are chosen independently of the observed training data, $S_{1},\ldots,S_{n}$ . Assume that the loss function is bounded in $[0,M]$ . Then, for all $\delta \geq 0$ it holds with probability at least $1 - \delta$ over the
+
+sampling of the datasets, that for all distributions $\mathcal{Q} \in \mathcal{M}(\mathcal{A})$ over algorithms,
+
+$$
+e r (\mathcal {Q}) \leq \widehat {e} r (\mathcal {Q}) + M \sqrt {\frac {D _ {\mathrm {K L}} (\mathcal {Q} | | \mathcal {P}) + \log \left(\frac {4 \sqrt {n}}{\delta}\right)}{2 n}} + M _ {A \sim \mathcal {Q}} \mathbb {E} \sqrt {\frac {\sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} (A (S _ {i}) | | P) + \log \left(\frac {8 m n}{\delta}\right) + 1}{2 m n}} \tag {6}
+$$
+
+where $D_{\mathrm{KL}}$ denotes the Kullback-Leibler divergence.
+
+Proof. The proof resembles previous proofs for PAC-Bayesian learning-to-learn learning, but it differs in some relevant steps. We discuss this in a Discussion section after the proof itself.
+
+First, we observe that (6) depends linearly in $M$ . Therefore, if suffices to prove the case of $M = 1$ , and the general case follows by applying the theorem to $\ell / M$ with subsequent rescaling. Next, we define the expected loss for the $n$ training clients, $\widetilde{\operatorname{er}}(\mathcal{Q})$ , as an intermediate object:
+
+$$
+\tilde {\operatorname {e r}} (\mathcal {Q}) = \frac {1}{n} \sum_ {i = 1} ^ {n} \underset {A \sim \mathcal {Q}} {\mathbb {E}} _ {(x, y) \sim D _ {i}} \ell (x, y, A (S _ {i})). \tag {7}
+$$
+
+To bound $\operatorname{er}(\mathcal{Q}) - \widehat{\operatorname{er}}(\mathcal{Q})$ , we divide it in two parts: $\operatorname{er}(\mathcal{Q}) - \widetilde{\operatorname{er}}(\mathcal{Q})$ and $\widetilde{\operatorname{er}}(\mathcal{Q}) - \widehat{\operatorname{er}}(\mathcal{Q})$ . We then bound each part separately and combine the results.
+
+Part I For the former, for any $h \in \mathcal{H}$ let $\Delta_i(h) = \frac{1}{m}\sum_{j=1}^{m}\ell(x_j^i,y_j^i,h) - \mathbb{E}_{(x,y)\sim D_i}\ell(x,y,h)$ , and $\Delta_i(Q) = \mathbb{E}_{h \in Q}\Delta_i(h)$ , such that $\widetilde{\mathrm{er}}(\mathcal{Q}) - \widehat{\mathrm{er}}(\mathcal{Q}) = \mathbb{E}_{A\sim \mathcal{Q}}\frac{1}{n}\sum_{i=1}^{n}\Delta_i(A(S_i))$ . Then, for any $\lambda > 0$ ,
+
+$$
+\begin{array}{l} \widetilde {\operatorname {e r}} (\mathcal {Q}) - \widehat {\operatorname {e r}} (\mathcal {Q}) - \frac {1}{\lambda} \underset {A \sim \mathcal {Q}} {\mathbb {E}} D _ {\mathrm {K L}} (A (S _ {1}) \times \dots \times A (S _ {n}) | | P \times \dots \times P) (8) \\ \leq \sup _ {Q _ {1}, \dots , Q _ {n}} \frac {1}{n} \sum_ {i = 1} ^ {n} \Delta_ {i} \left(Q _ {i}\right) - \frac {1}{\lambda} D _ {\mathrm {K L}} \left(Q _ {1} \times \dots \times Q _ {n} \| P \times \dots \times P\right) (9) \\ \leq \frac {1}{\lambda} \log_ {h _ {1} \sim P} \mathbb {E} \dots \mathbb {E} _ {h _ {n} \sim P} \prod_ {i = 1} ^ {n} e ^ {\frac {\lambda}{n} \Delta_ {i} \left(h _ {i}\right)}, (10) \\ \end{array}
+$$
+
+where the second inequality is due to the change of measure inequality (Seldin et al., 2012).
+
+Because for each $i = 1,\dots ,n$ $P$ is independent of $S_{i},\ldots ,S_{n}$ , we have
+
+$$
+\underset {S _ {1}, \dots , S _ {n}} {\mathbb {E}} \underset {h _ {1} \sim P} {\mathbb {E}} \dots \underset {h _ {n} \sim P} {\mathbb {E}} \prod_ {i = 1} ^ {n} e ^ {\frac {\lambda}{n} \Delta_ {i} (h _ {i})} = \underset {S _ {1}} {\mathbb {E}} \underset {h _ {1} \sim P} {\mathbb {E}} e ^ {\frac {\lambda}{n} \Delta_ {1} (h _ {1})} \dots \underset {S _ {n}} {\mathbb {E}} \underset {h _ {n} \sim P} {\mathbb {E}} e ^ {\frac {\lambda}{n} \Delta_ {n} (h _ {n})} \tag {11}
+$$
+
+Each $\Delta_i(h_i)$ is a bounded random variable with support in an interval of size 1. By Hoeffding's lemma we have
+
+$$
+\mathbb {E} _ {S _ {i}} \mathbb {E} _ {h _ {i} \sim P} e ^ {\frac {\lambda}{n} \Delta_ {i} \left(h _ {i}\right)} \leq e ^ {\frac {\lambda^ {2}}{8 n ^ {2} m}}. \tag {12}
+$$
+
+Therefore,
+
+$$
+\underset {S _ {1}, \dots , S _ {n}} {\mathbb {E}} \underset {h _ {1} \sim P} {\mathbb {E}} \dots \underset {h _ {n} \sim P} {\mathbb {E}} \prod_ {i = 1} ^ {n} e ^ {\frac {\lambda}{n} \Delta_ {i} \left(h _ {i}\right)} \leq e ^ {\frac {\lambda^ {2}}{8 n m}}, \tag {13}
+$$
+
+and by Markov's inequality, for any $\epsilon \in \mathbb{R}$
+
+$$
+\mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\underset {h _ {1} \sim P} {\mathbb {E}} \dots \underset {h _ {n} \sim P} {\mathbb {E}} \prod_ {i = 1} ^ {n} e ^ {\frac {\lambda}{n} \Delta_ {i} \left(h _ {i}\right)} \geq e ^ {\epsilon}\right) \leq e ^ {\frac {\lambda^ {2}}{8 n m} - \epsilon} \tag {14}
+$$
+
+Hence
+
+$$
+\mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\exists Q _ {1}, \dots , Q _ {n}: \frac {1}{n} \sum_ {i = 1} ^ {n} \Delta_ {i} (Q _ {i}) - \frac {1}{\lambda} D _ {\mathrm {K L}} \left(Q _ {1} \times \dots \times Q _ {n} \mid \mid P \times \dots \times P\right) \geq \frac {1}{\lambda} \epsilon\right) \leq e ^ {\frac {\lambda^ {2}}{8 n m} - \epsilon}, \tag {15}
+$$
+
+or equivalently,
+
+$$
+\begin{array}{l} \mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall Q _ {1}, \dots , Q _ {n}: \frac {1}{n} \sum_ {i = 1} ^ {n} \Delta_ {i} \left(Q _ {i}\right) \right. (16) \\ \leq \frac {1}{\lambda} \sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} \left(Q _ {i} | | P\right) + \frac {1}{\lambda} \log \left(\frac {2}{\delta}\right) + \frac {\lambda}{8 n m}) \geq 1 - \frac {\delta}{2}. (17) \\ \end{array}
+$$
+
+By applying a union bound for all the values of $\lambda \in \Lambda$ with $\Lambda = \{1, \dots, 4mn\}$ we get that
+
+$$
+\begin{array}{l} \mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall Q _ {1}, \dots , Q _ {n}, \forall \lambda \in \Lambda : \frac {1}{n} \sum_ {i = 1} ^ {n} \Delta_ {i} \left(Q _ {i}\right) \right. (18) \\ \leq \frac {1}{\lambda} \sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} \left(Q _ {i} | | P\right) + \frac {1}{\lambda} \log \left(\frac {8 m n}{\delta}\right) + \frac {\lambda}{8 n m}) \geq 1 - \frac {\delta}{2} (19) \\ \end{array}
+$$
+
+Note that $\lfloor \lambda \rfloor \leq \lambda$ and $\frac{1}{[\lambda]} \leq \frac{1}{\lambda - 1}$ . Therefore, for all values of $\lambda \in (1,4mn)$ we have
+
+$$
+\begin{array}{l} \mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall Q _ {1}, \dots , Q _ {n}, \forall \lambda \in (1, 4 m n): \frac {1}{n} \sum_ {i = 1} ^ {n} \Delta_ {i} \left(Q _ {i}\right) \right. (20) \\ \leq \underbrace {\frac {1}{\lambda - 1} \left(\sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} \left(Q _ {i} \mid | P\right) + \log \left(\frac {8 m n}{\delta}\right)\right) + \frac {\lambda}{8 m n}} _ {=: \Gamma (\lambda)} \Bigg) \geq 1 - \frac {\delta}{2} (21) \\ \end{array}
+$$
+
+For any choice of $Q_{1},\ldots ,Q_{n}$ , let $\lambda^{*} = \sqrt{8mn(\sum_{i = 1}^{n}D_{\mathrm{KL}}(Q_{i}||P) + \log(\frac{8mn}{\delta})) + 1}$ . If $\lambda^{*}\geq 4mn$ , that implies $\sum_{i = 1}^{n}(D_{\mathrm{KL}}(Q_i||P) + \log (\frac{8mn}{\delta}) + 1)\geq 2mn$ and $\Gamma (\lambda^{*}) > 1$ , so Inequality (21) holds trivially. Otherwise, $\lambda^{*}\in (0,4mn)$ , so Inequality (21) also holds. Therefore, we
+
+$$
+\mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall Q _ {1}, \dots , Q _ {n}; \frac {1}{n} \sum_ {i = 1} ^ {n} \Delta_ {i} \left(Q _ {i}\right) \leq \sqrt {\frac {\sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} \left(Q _ {i} \mid \mid P\right) + \log \left(\frac {8 m n}{\delta}\right) + 1}{2 m n}}\right) \geq 1 - \frac {\delta}{2}. \tag {22}
+$$
+
+In combination with (10), we obtain:
+
+$$
+\mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall \mathcal {Q}: \widetilde {\operatorname {e r}} (\mathcal {Q}) - \widehat {\operatorname {e r}} (\mathcal {Q}) \leq \underset {A \sim \mathcal {Q}} {\mathbb {E}} \sqrt {\frac {\sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} \left(A \left(S _ {i}\right) \| P\right) + \log \left(\frac {8 m n}{\delta}\right) + 1}{2 m n}}\right) \geq 1 - \frac {\delta}{2}. \tag {23}
+$$
+
+Part II For upper bounding $\operatorname{er}(\mathcal{Q}) - \widetilde{\operatorname{er}}(\mathcal{Q})$ we have by a standard PAC-Bayesian bound (Maurer, 2004; Pérez-Ortiz et al., 2021),
+
+$$
+\mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall \mathcal {Q}: \operatorname {e r} (\mathcal {Q}) - \widetilde {\operatorname {e r}} (\mathcal {Q}) \leq \sqrt {\frac {D _ {\mathrm {K L}} (\mathcal {Q} | | \mathcal {P}) + \log \left(\frac {4 \sqrt {n}}{\delta}\right)}{2 n}}\right) \geq 1 - \frac {\delta}{2}. \tag {24}
+$$
+
+Combination We combine (23) and (24) by a union bound to obtain
+
+$$
+\begin{array}{l} \mathbb {P} _ {S _ {1}, \dots , S _ {n}} \left(\forall \mathcal {Q}: \operatorname {e r} (\mathcal {Q}) - \widehat {\operatorname {e r}} (\mathcal {Q}) \leq \sqrt {\frac {D _ {\mathrm {K L}} (\mathcal {Q} | | \mathcal {P}) + \log \left(\frac {4 \sqrt {n}}{\delta}\right)}{2 n}} \right. (25) \\ + \underset {A \sim \mathcal {Q}} {\mathbb {E}} \sqrt {\frac {\sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} (A (S _ {i}) | | P) + \log \left(\frac {8 m n}{\delta}\right) + 1}{2 m n}}) \geq 1 - \delta . (26) \\ \end{array}
+$$
+
+This concludes the proof of the theorem.
+
+□
+
+Discussion The difference in our proof and previous bounds in the similar settings (Pentina and Lampert, 2015; Rezazadeh, 2022) is in the upper bound for $\widetilde{\mathrm{er}} (\mathcal{Q}) - \widehat{\mathrm{er}} (\mathcal{Q})$ which is the average of
+
+the generalization gaps for the $n$ training tasks that we observe. In our case we prove a generalization bound for arbitrary posteriors to be used by the tasks, using the change-of-measure inequality (CMI) for the transition from $Q_{1} \times \dots \times Q_{n}$ to $P \times \dots \times P$ . Because our bound holds uniformly in $Q_{1}, \ldots, Q_{n}$ , it also holds for the posteriors produced by a deterministic learning algorithm (a fixed $A$ ) or any distributions of algorithms (a hyperposterior $\mathcal{Q}$ over algorithms). This way we do not have to include the transition from $\mathcal{Q}$ to $\mathcal{P}$ in the CMI, as all prior work did. Consequently, in part of the proof we avoid getting a $KL(\mathcal{Q}||\mathcal{P})$ term which otherwise would be divided only by a $\frac{1}{m}$ factor, which is undesirable in the federated setting. Additionally compared to (Rezazadeh, 2022) we have better logarithmic dependency. They have a term of order $\frac{\log m\sqrt{n}}{m}$ which is not negligible in the case that we have large number of tasks and small number of samples per task, which is usual in the federated setting. In contrast, our logarithmic terms are divided by $n$ .
+
+Proof of Theorem 3.2 We now instantiate the situation of Theorem 3.2 by specific choice of prior and posterior distributions. Let the learning algorithm be parameterized by the hypernetwork weights, $\eta_h$ , and the embedding networks weights, $\eta_v$ . As meta-posterior we use a Gaussian distribution, $\mathcal{Q} = \mathcal{Q}_h \times \mathcal{Q}_v$ for $\mathcal{Q}_h = \mathcal{N}(\eta_h; \alpha_h \mathrm{Id})$ , and $\mathcal{Q}_v = \mathcal{N}(\eta_v; \alpha_v \mathrm{Id})$ , where $\eta_h$ and $\eta_v$ are learnable and $\alpha_v$ and $\alpha_h$ are fixed. For any $(\bar{\eta}_h, \bar{\eta}_v) \sim \mathcal{Q}$ and training set $S$ , the learning algorithm produces a posterior distribution $Q = \mathcal{N}(\theta; \alpha_\theta \mathrm{Id})$ , where $\theta = h(v; \eta_h)$ with $v = \frac{1}{|S|} \sum_{(x,y)} \phi(x,y; \eta_v)$ . As prior, we use $\mathcal{N}(0; \alpha_\theta \mathrm{Id})$ . With these choices, we have $D_{\mathrm{KL}}(\mathcal{Q}, \mathcal{P}) = \alpha_h \| \eta_h \|^2 + \alpha_v | \eta_v |^2$ and $D_{\mathrm{KL}}(Q_i, P) = \alpha_\theta \| \theta \|^2$ . Inserting these into Theorem B.1, we recover Theorem 3.2.
+
+# C APPENDIX - OPTIMIZATION
+
+In this section, we formulate the technical assumptions for Theorem 3.1 and prove it. For the convenience of reading we repeat some notation from Section 3. For each client $i = 1,\dots ,n$ and parameter $\theta_{i}$ , we note the client objective as $f_{i}(\theta_{i})$ and $F_{i}(\eta) = f_{i}(h(S_{i},\eta))$ , where $h(S,\eta) = h(v(S,\eta_v),\eta_h)$ is a shorthand notation for the combination of hypernetwork and embedding network. The server objective we denote by $f(\eta)$ , which in our setting consists only of regularization terms. The overall objective is $F(\eta) = \frac{1}{n}\sum_{i = 1}^{n}F_{i}(\eta) + f(\eta)$ . For the rest of this section, by $\eta_t$ we mean the parameters at iteration $t$ , and $g_{t,i,j}$ is the stochastic gradient for client $i$ at global step $t$ , local step $l$ .
+
+# C.1 ANALYTICAL ASSUMPTIONS
+
+We make the following assumptions, which are common in the literature (Karimireddy et al., 2020; Fallah et al., 2020). Since our algorithm consists of multiple parts, we have to make the assumptions for different parts separately.
+
+- Bounded Gradients: there exist constants, $b_{1}, b_{2}$ , such that
+
+$$
+\left\| \nabla_ {\theta} f _ {i} (\theta) \right\| \leq b _ {1}, \quad \left\| \nabla_ {\eta} h (S, \eta) \right\| \leq b _ {2} \tag {27}
+$$
+
+which, in particular, implies
+
+$$
+\left\| h (S, \eta) - h \left(S, \eta^ {\prime}\right) \right\| \leq b _ {2} \| \eta - \eta^ {\prime} \| \tag {28}
+$$
+
+- Smoothness: there exist constants, $L_{1}, L_{2}, L_{3}$ , such that
+
+$$
+\left\| \nabla_ {\theta} f _ {i} (\theta) - \nabla_ {\theta} f _ {i} \left(\theta^ {\prime}\right) \right\| \leq L _ {1} \| \theta - \theta^ {\prime} \| \tag {29}
+$$
+
+$$
+\left\| \nabla_ {\eta} h (S, \eta) - \nabla_ {\eta} h \left(S, \eta^ {\prime}\right) \right\| \leq L _ {2} \| \eta - \eta^ {\prime} \| \tag {30}
+$$
+
+$$
+\left\| \nabla_ {\eta} f (\eta) - \nabla_ {\eta} f \left(\eta^ {\prime}\right) \right\| \leq L _ {3} \| \eta - \eta^ {\prime} \| \tag {31}
+$$
+
+- Bounded Dissimilarity: there exists a constant $\gamma_G$ with, such that with $\bar{F}(\eta) = \frac{1}{n}\sum_{i=1}^{n} F_i(\eta)$ :
+
+$$
+\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \left[ \| \nabla F _ {i} (\eta) - \nabla \bar {F} (\eta) \| ^ {2} \right] \leq \gamma_ {G} ^ {2} \tag {32}
+$$
+
+- Bounded Variance: there exists constants $\sigma_{1},\sigma_{2},\sigma_{3}$ , such that, for batches $B_{i}\subset S_{i}$ of size $b < |S_i|$ ..
+
+$$
+\mathbb {E} \| \nabla_ {\theta} (f _ {i} (\theta)) - \widetilde {\nabla} _ {\theta} (f _ {i} (\theta)) \| ^ {2} \leq \sigma_ {1} ^ {2} \tag {33}
+$$
+
+$$
+\mathbb {E} \| \nabla h (B _ {i}, \eta) - \nabla h (S _ {i}, \eta) \| ^ {2} \leq \frac {\sigma_ {2} ^ {2}}{b} \tag {34}
+$$
+
+$$
+\mathbb {E} \| h \left(B _ {i}, \eta\right) - h \left(S _ {i}, \eta\right) \| ^ {2} \leq \frac {\sigma_ {3} ^ {2}}{b} \tag {35}
+$$
+
+# C.2 CONVERGENCE
+
+Lemma C.1. There exists a constant $L$ which $\nabla F(\eta)$ is $L$ -smooth.
+
+Proof. For each $F_{i}$ we have
+
+$$
+\begin{array}{l} \left\| \nabla_ {\eta} F _ {i} (\eta) - \nabla_ {\eta} F _ {i} \left(\eta^ {\prime}\right) \right\| = \left\| \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta\right) ^ {T} - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta^ {\prime}\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} \right\| (36) \\ = \left\| \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta\right) ^ {T} - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} \right. (37) \\ + \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta^ {\prime}\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} \| (38) \\ \leq \left\| \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta\right) ^ {T} - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} \right\| (39) \\ + \left\| \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta^ {\prime}\right)\right) \nabla_ {\eta} h \left(S _ {i}, \eta^ {\prime}\right) ^ {T} \right\| (40) \\ \leq b _ {1} L _ {2} \| \eta - \eta^ {\prime} \| + b _ {2} L _ {1} b _ {2} \| \eta - \eta^ {\prime} \| = \left(b _ {1} L _ {2} + b _ {2} L _ {1} b _ {2}\right) \| \eta - \eta^ {\prime} \| = L ^ {\prime} \| \eta - \eta^ {\prime} \| (41) \\ \end{array}
+$$
+
+Therefore for $F$ we have
+
+$$
+\begin{array}{l} \left\| \nabla_ {\eta} F (\eta) - \nabla_ {\eta} F \left(\eta^ {\prime}\right) \right\| \leq \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \nabla_ {\eta} F _ {i} (\eta) + \nabla_ {\eta} f (\eta) - \frac {1}{n} \sum_ {i = 1} ^ {n} \nabla_ {\eta} F _ {i} \left(\eta^ {\prime}\right) - \nabla_ {\eta} f \left(\eta^ {\prime}\right) \right\| (42) \\ \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \| \nabla_ {\eta} F _ {i} (\eta) - \nabla_ {\eta} F _ {i} \left(\eta^ {\prime}\right) \| + \| \nabla_ {\eta} f (\eta) - \nabla_ {\eta} f \left(\eta^ {\prime}\right) \| \leq \left(L ^ {\prime} + L _ {3}\right) \| \eta - \eta^ {\prime} \| = L \| \eta - \eta^ {\prime} \| (43) \\ \end{array}
+$$
+
+Lemma C.2. For independent random vectors $a_1, \ldots, a_n$ we have
+
+$$
+\mathbb {E} [ \| \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] \leq \frac {c}{n} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] \tag {44}
+$$
+
+Also if $\mathbb{E}[a_i] \leq a$ for each $i$ , we have
+
+$$
+\mathbb {E} [ \| \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] \leq \frac {c}{n} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] + c ^ {2} a ^ {2} \tag {45}
+$$
+
+Proof. By expanding the power 2 we get
+
+$$
+\begin{array}{l} \mathbb {E} [ \| \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] = \mathbb {E} [ \sum_ {i \in C} \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] + \mathbb {E} [ \sum_ {i \neq j \in C} \langle a _ {i} - \mathbb {E} [ a _ {i} ], a _ {j} - \mathbb {E} [ a _ {j} ] \rangle ] (46) \\ \leq \frac {\binom {n - 1} {c - 1}}{\binom {n} {c}} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] + \frac {\binom {n - 2} {c - 2}}{\binom {n} {c}} \sum_ {i \neq j} \mathbb {E} [ \langle a _ {i} - \mathbb {E} [ a _ {i} ], a _ {j} - \mathbb {E} [ a _ {j} ] \rangle ] (47) \\ = \frac {\binom {n - 1} {c - 1}}{\binom {n} {c}} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] - \frac {2 \binom {n - 2} {c - 2}}{\binom {n} {c}} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] (48) \\ \leq \frac {c}{n} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] (49) \\ \end{array}
+$$
+
+For the second part we have
+
+$$
+\begin{array}{l} \mathbb {E} [ \| \sum_ {i \in C} a _ {i} \| ^ {2} ] = \mathbb {E} [ \| \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ] + \mathbb {E} [ a _ {i} ] \| ^ {2} ] (50) \\ = \mathbb {E} [ \| \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] + \mathbb {E} [ \| \sum_ {i \in C} \mathbb {E} [ a _ {i} ] \| ^ {2} ] + 2 \mathbb {E} [ \langle \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ], \sum_ {i \in C} \mathbb {E} [ a _ {i} ] \rangle ] (51) \\ = \mathbb {E} [ \| \sum_ {i \in C} a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] + \mathbb {E} [ \| \sum_ {i \in C} \mathbb {E} [ a _ {i} ] \| ^ {2} ] \leq \frac {c}{n} \sum_ {i} \mathbb {E} [ \| a _ {i} - \mathbb {E} [ a _ {i} ] \| ^ {2} ] + c ^ {2} a ^ {2} (52) \\ \end{array}
+$$
+
+
+
+Lemma C.3. For any step $t$ and client $i$ the following inequality holds:
+
+$$
+\begin{array}{l} \mathbb {E} \left\| \nabla F _ {i} \left(\eta_ {t}\right) - \nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} \right\| ^ {2} (53) \\ \leq 2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} l ^ {2} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (54) \\ \end{array}
+$$
+
+Proof. By adding and subtracting some immediate terms we get
+
+$$
+\begin{array}{l} \mathbb {E} \left\| \nabla F _ {i} \left(\eta_ {t}\right) - \nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} \right\| ^ {2} (55) \\ = \mathbb {E} \| \nabla F _ {i} (\eta_ {t}) - \nabla_ {\theta} f _ {i} (h (S _ {i}, \eta_ {t}) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (S _ {i}, \eta_ {t}))) \nabla h (S _ {i}, \eta_ {t}) ^ {T} (56) \\ + \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)\right) \left(\nabla h \left(S _ {i}, \eta_ {t}\right) ^ {T} - \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T}\right) (57) \\ + \left(\nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)\right) - \nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} \| ^ {2} (58) \\ \end{array}
+$$
+
+And by Cauchy-Schwarz inequality we get
+
+$$
+\begin{array}{l} \mathbb {E} \left\| \nabla F _ {i} \left(\eta_ {t}\right) - \nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} \right\| ^ {2} (59) \\ \leq 3 \mathbb {E} \| \nabla_ {\theta} f _ {i} (h \left(S _ {i}, \eta_ {t}\right)) \nabla h \left(S _ {i}, \eta_ {t}\right) ^ {T} - \nabla_ {\theta} f _ {i} (h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)) \nabla h \left(S _ {i}, \eta_ {t}\right) ^ {T} \| ^ {2} (60) \\ + 3 \mathbb {E} \| \nabla_ {\theta} f _ {i} (h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h \left(S _ {i}, \eta_ {t}\right))) (\nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} - \nabla h \left(S _ {i}, \eta_ {t}\right) ^ {T}) \| ^ {2} (61) \\ + 3 \mathbb {E} \| \left(\nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right) - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} \| ^ {2} (62) \\ \leq 3 \mathbb {E} \left(\| \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right)\right) - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)\right) \| ^ {2} \| \nabla h \left(S _ {i}, \eta_ {t}\right) \| ^ {2}\right) (63) \\ + 3 \mathbb {E} \left(\| \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)\right) \| ^ {2} \| \nabla h \left(B _ {i}, \eta_ {t}\right) - \nabla h \left(S _ {i}, \eta_ {t}\right) \| ^ {2}\right) (64) \\ + 3 \mathbb {E} \left(\| \nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right) - \nabla_ {\theta} f _ {i} \left(h \left(S _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right)\right) \| ^ {2} \| \nabla h \left(B _ {i}, \eta_ {t}\right) \| ^ {2}\right) (65) \\ \leq 3 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} \mathbb {E} \| \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(S _ {i}, \eta_ {t}\right)\right) \| ^ {2} + 3 b _ {1} ^ {2} \mathbb {E} \| \nabla h \left(B _ {i}, \eta_ {t}\right) - \nabla h \left(S _ {i}, \eta_ {t}\right) \| ^ {2} (66) \\ + 6 L _ {1} ^ {2} b _ {2} ^ {2} \mathbb {E} \| h (B _ {i}, \eta_ {t}) - h (S _ {i}, \eta_ {t}) \| ^ {2} + 6 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} \mathbb {E} \| \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (S _ {i}, \eta_ {t})) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (B _ {i}, \eta_ {t})) \| ^ {2} (67) \\ \leq 3 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} l ^ {2} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} + 2 4 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} l ^ {2} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) (68) \\ = 2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} l ^ {2} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (69) \\ \end{array}
+$$
+
+which we used the assumptions on the bounded gradients and bounded variance and Lemma C.2.
+
+Lemma C.4. For any step $t$ the following inequality holds:
+
+$$
+\mathbb {E} \left[ \left\langle \nabla F \left(\eta_ {t}\right), \eta_ {t + 1} - \eta_ {t} \right\rangle \right] \leq \frac {- 3 \beta k}{4} \| \nabla F (\eta_ {t}) \| ^ {2} + 2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 \beta k b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 \beta k L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} \tag {70}
+$$
+
+Proof.
+
+$$
+\begin{array}{l} \mathbb {E} _ {t} [ \langle \nabla F (\eta_ {t}), \eta_ {t + 1} - \eta_ {t} \rangle ] = \mathbb {E} _ {t} [ \langle \nabla F (\eta_ {t}), - \frac {\beta}{c} \sum_ {i \in C} \sum_ {l = 1} ^ {k} g _ {t, i, l} (h \left(B _ {i}, \eta_ {t}\right)) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} - \beta k \nabla f (\eta_ {t}) \rangle ] (71) \\ = \mathbb {E} _ {t} [ (\nabla F (\eta_ {t}), - \frac {\beta}{n} \sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {k} \nabla_ {\theta} f _ {i} (h \left(B _ {i}, \eta_ {t}\right) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h \left(B _ {i}, \eta_ {t}\right))) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T}) ] (72) \\ + \underset {t} {\mathbb {E}} [ \left\langle \nabla F \left(\eta_ {t}\right), - \beta k \nabla f \left(\eta_ {t}\right) \right\rangle ] (73) \\ = \frac {\beta}{n} \sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {k} \mathbb {E} _ {t} [ \langle \nabla F (\eta_ {t}), \nabla F _ {i} (\eta_ {t}) - \nabla_ {\theta} f _ {i} (h (B _ {i}, \eta_ {t}) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (B _ {i}, \eta_ {t}))) \nabla h (B _ {i}, \eta_ {t}) ^ {T} \rangle ] (74) \\ + \frac {\beta}{n} \sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {k} \mathbb {E} _ {t} [ \langle \nabla F (\eta_ {t}), - \nabla F _ {i} (\eta_ {t}) \rangle ] + \mathbb {E} _ {t} [ \langle \nabla F (\eta_ {t}), - \beta k \nabla f (\eta_ {t}) \rangle ] (75) \\ \end{array}
+$$
+
+By definition $F(\eta) = \frac{1}{n}\sum_{i=1}^{n}F_{i}(\eta) + f(\eta)$ , and by Young's inequality and lemma C.3 we have
+
+$$
+\begin{array}{l} \underset {t} {\mathbb {E}} [ \left\langle \nabla F \left(\eta_ {t}\right), \eta_ {t + 1} - \eta_ {t} \right\rangle ] (76) \\ \leq \frac {\beta k}{4} \| \nabla F (\eta_ {t}) \| ^ {2} + \frac {\beta}{n} \sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {k} \mathbb {E} _ {t} \| \nabla F _ {i} (\eta_ {t}) - \nabla_ {\theta} f _ {i} (h (B _ {i}, \eta_ {t}) - \beta \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (B _ {i}, \eta_ {t}))) \nabla h (B _ {i}, \eta_ {t}) ^ {T} \| ^ {2} (77) \\ - \beta k \| \nabla F (\eta_ {t}) \| ^ {2} (78) \\ \leq \frac {- 3 \beta k}{4} \| \nabla F (\eta_ {t}) \| ^ {2} + \frac {\beta}{n} \sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {k} \left(2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} l ^ {2} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2}\right) (79) \\ = \frac {- 3 \beta k}{4} \| \nabla F (\eta_ {t}) \| ^ {2} + 2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 \beta k b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 \beta k L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (80) \\ \end{array}
+$$
+
+Lemma C.5. For any step $t$ the following inequality holds:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| \eta_ {t + 1} - \eta_ {t} \| ^ {2} \right] \leq \frac {4 \beta^ {2} k}{c} \sigma_ {1} ^ {2} + \frac {4 \beta^ {2} k ^ {2}}{c} \gamma_ {G} ^ {2} + 4 \beta^ {2} k ^ {2} \mathbb {E} \left[ \| \nabla F (\eta_ {t}) \| ^ {2} \right] (81) \\ + 1 0 8 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {4} k ^ {4} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 1 2 b _ {1} ^ {2} k ^ {2} \beta^ {2} \sigma_ {2} ^ {2} + 2 4 L _ {1} ^ {2} b _ {2} ^ {2} k ^ {2} \beta^ {2} \sigma_ {3} ^ {2} (82) \\ \end{array}
+$$
+
+Proof. The change of $\eta$ in one step of optimization is the average of the change caused by selected clients plus function $f(\eta)$ at the server.
+
+$$
+\mathbb {E} \left[ \| \eta_ {t + 1} - \eta_ {t} \| ^ {2} \right] = \mathbb {E} [ \| - \frac {\beta}{c} \sum_ {i \in C} \sum_ {l = 1} ^ {k} g _ {t, i, l} \left(h \left(B _ {i}, \eta_ {t}\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} - \beta k \nabla f (\eta_ {t}) \| ^ {2} ] \tag {83}
+$$
+
+Which we can write as
+
+$$
+\begin{array}{l} \mathbb {E} [ \| \eta_ {t + 1} - \eta_ {t} \| ^ {2} ] = \frac {\beta^ {2}}{c ^ {2}} \mathbb {E} [ \| \sum_ {i \in C} \sum_ {l = 1} ^ {k} g _ {t, i, l} (h \left(B _ {i}, \eta_ {t}\right)) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} + c k \nabla f (\eta_ {t}) \| ^ {2} ] (84) \\ = \frac {\beta^ {2}}{c ^ {2}} \mathbb {E} [ \| \sum_ {i \in C} \sum_ {l = 1} ^ {k} g _ {t, i, l} (h \left(B _ {i}, \eta_ {t}\right)) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} - \nabla_ {\theta} f _ {i} (h \left(B _ {i}, \eta_ {t}\right) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h \left(B _ {i}, \eta_ {t}\right))) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} (85) \\ + \sum_ {i \in C} \sum_ {l = 1} ^ {k} \nabla_ {\theta} f _ {i} \left(h \left(B _ {i}, \eta_ {t}\right) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} \left(h \left(B _ {i}, \eta_ {t}\right)\right)\right) \nabla h \left(B _ {i}, \eta_ {t}\right) ^ {T} - \nabla F _ {i} (\eta_ {t}) (86) \\ + \sum_ {i \in C} \sum_ {l = 1} ^ {k} \left(\nabla F _ {i} \left(\eta_ {t}\right) + \nabla f \left(\eta_ {t}\right) - \nabla F \left(\eta_ {t}\right)\right) + \sum_ {i \in C} \sum_ {l = 1} ^ {k} \nabla F \left(\eta_ {t}\right) \| ^ {2} ] (87) \\ \end{array}
+$$
+
+And by Cauchy-Schwarz inequality we get
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| \eta_ {t + 1} - \eta_ {t} \right\| ^ {2} \right] (88) \\ \leq \frac {4 \beta^ {2}}{c ^ {2}} \mathbb {E} [ \| \sum_ {i \in C} \sum_ {l = 1} ^ {k} g _ {t, i, l} (h (B _ {i}, \eta_ {t})) \nabla h (B _ {i}, \eta_ {t}) ^ {T} - \nabla_ {\theta} f _ {i} (h (B _ {i}, \eta_ {t}) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (B _ {i}, \eta_ {t}))) \nabla h (B _ {i}, \eta_ {t}) ^ {T} \| ^ {2} ] (89) \\ + \frac {4 \beta^ {2}}{c ^ {2}} \mathbb {E} [ \| \sum_ {i \in C} \sum_ {l = 1} ^ {k} \nabla_ {\theta} f _ {i} (h (B _ {i}, \eta_ {t}) - \sum_ {j = 0} ^ {l - 1} g _ {t, i, j} (h (B _ {i}, \eta_ {t}))) \nabla h (B _ {i}, \eta_ {t}) ^ {T} - \nabla F _ {i} (\eta_ {t}) \| ^ {2} ] (90) \\ + \frac {4 \beta^ {2}}{c ^ {2}} \mathbb {E} [ \| \sum_ {i \in C} \sum_ {l = 1} ^ {k} \nabla F _ {i} (\eta_ {t}) + \nabla f (\eta_ {t}) - \nabla F (\eta_ {t}) \| ^ {2} ] + \frac {4 \beta^ {2}}{c ^ {2}} \mathbb {E} [ \| \sum_ {i \in C} \sum_ {l = 1} ^ {k} \nabla F (\eta_ {t}) \| ^ {2} ] (91) \\ \end{array}
+$$
+
+Note that $\nabla F(\eta) - \nabla f(\eta) = \frac{1}{n}\sum_{i=1}^{n}\nabla F_i(\eta)$ . By lemma C.2, C.3, the bounded dissimilarity assumption and simplifying terms we get
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| \eta_ {t + 1} - \eta_ {t} \right\| ^ {2} \right] (92) \\ \leq \frac {4 \beta^ {2} k}{c} \sigma_ {1} ^ {2} + \frac {4 \beta^ {2} k ^ {2}}{c n} \sum_ {i} \mathbb {E} [ \| \nabla F _ {i} (\eta_ {t}) - \left(\frac {1}{n} \sum_ {i = 1} ^ {n} \nabla F _ {i} (\eta_ {t})\right) \| ^ {2} ] + 4 \beta^ {2} k ^ {2} \mathbb {E} [ \| \nabla F (\eta_ {t}) \| ^ {2} ] (93) \\ + 1 0 8 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {4} k ^ {4} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 1 2 b _ {1} ^ {2} k ^ {2} \beta^ {2} \sigma_ {2} ^ {2} + 2 4 L _ {1} ^ {2} b _ {2} ^ {2} k ^ {2} \beta^ {2} \sigma_ {3} ^ {2} (94) \\ \leq \frac {4 \beta^ {2} k}{c} \sigma_ {1} ^ {2} + \frac {4 \beta^ {2} k ^ {2}}{c} \gamma_ {G} ^ {2} + 4 \beta^ {2} k ^ {2} \mathbb {E} [ \| \nabla F (\eta_ {t}) \| ^ {2} ] (95) \\ + 1 0 8 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {4} k ^ {4} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 1 2 b _ {1} ^ {2} k ^ {2} \beta^ {2} \sigma_ {2} ^ {2} + 2 4 L _ {1} ^ {2} b _ {2} ^ {2} k ^ {2} \beta^ {2} \sigma_ {3} ^ {2} (96) \\ \end{array}
+$$
+
+
+
+We are now ready to prove Theorem 3.1, which we restate for the convenience of the reader.
+
+Theorem 3.1. Under the assumptions C.1 PeFLL's optimization after $T$ steps fulfills
+
+$$
+\begin{array}{l} \frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} \leq \frac {\left(F \left(\eta_ {0}\right) - F _ {*}\right)}{\sqrt {c T}} + \frac {2 2 4 c L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2}}{T} + 8 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 1 4 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (97) \\ + \frac {4 L \left(2 \sigma_ {1} ^ {2} + k \gamma_ {G} ^ {2}\right)}{k \sqrt {c T}} (98) \\ \end{array}
+$$
+
+Proof. By smoothness of $F$ we have
+
+$$
+\mathbb {E} \left[ F \left(\eta_ {t + 1}\right) - F \left(\eta_ {t}\right) \right] \leq \mathbb {E} \left\langle \nabla F \left(\eta_ {t}\right), \eta_ {t + 1} - \eta_ {t} \right\rangle + \frac {L}{2} \mathbb {E} \| \eta_ {t + 1} - \eta_ {t} \| ^ {2} \tag {99}
+$$
+
+And by combining it with Lemma C.4 and C.5 and simplifying terms we get
+
+$$
+\begin{array}{l} \mathbb {E} \left[ F \left(\eta_ {t + 1}\right) - F \left(\eta_ {t}\right) \right] \leq \mathbb {E} \left\langle \nabla F \left(\eta_ {t}\right), \eta_ {t + 1} - \eta_ {t} \right\rangle + \frac {L}{2} \mathbb {E} \left\| \eta_ {t + 1} - \eta_ {t} \right\| ^ {2} (100) \\ \leq \frac {- 3 \beta k}{4} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} + 2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 3 \beta k b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 \beta k L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (101) \\ + \frac {2 L \beta^ {2} k}{c} \sigma_ {1} ^ {2} + \frac {2 L \beta^ {2} k ^ {2}}{c} \gamma_ {G} ^ {2} + 2 L \beta^ {2} k ^ {2} \mathbb {E} [ \| \nabla F (\eta_ {t}) \| ^ {2} ] (102) \\ + 5 6 L L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {4} k ^ {4} \left(b _ {1} ^ {2} + \sigma_ {1} ^ {2}\right) + 6 L b _ {1} ^ {2} k ^ {2} \beta^ {2} \sigma_ {2} ^ {2} + 1 2 L L _ {1} ^ {2} b _ {2} ^ {2} k ^ {2} \beta^ {2} \sigma_ {3} ^ {2} (103) \\ = \left(\frac {- 3 \beta k}{4} + 2 L \beta^ {2} k ^ {2}\right) \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} + \left(2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} + 5 6 L L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {4} k ^ {4}\right) b _ {1} ^ {2} (104) \\ + 3 \beta k b _ {1} ^ {2} \sigma_ {2} ^ {2} + 6 L b _ {1} ^ {2} k ^ {2} \beta^ {2} \sigma_ {2} ^ {2} + 6 \beta k L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} + 1 2 L L _ {1} ^ {2} b _ {2} ^ {2} k ^ {2} \beta^ {2} \sigma_ {3} ^ {2} (105) \\ + \left(\frac {L \beta^ {2} k}{c} + 2 7 L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} + 5 6 L L _ {1} ^ {2} b _ {2} ^ {2} \beta^ {4} k ^ {4}\right) \sigma_ {1} ^ {2} + \frac {L \beta^ {2} k ^ {2}}{c} \gamma_ {G} ^ {2} (106) \\ \leq \frac {- \beta k}{2} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} + 2 8 L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} + 4 \beta k b _ {1} ^ {2} \sigma_ {2} ^ {2} + 7 \beta k L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (107) \\ + \frac {3 L \beta^ {2} k}{c} \sigma_ {1} ^ {2} + \frac {2 L \beta^ {2} k ^ {2}}{c} \gamma_ {G} ^ {2} (108) \\ \end{array}
+$$
+
+Therefore
+
+$$
+\begin{array}{l} \mathbb {E} \left[ F \left(\eta_ {t + 1}\right) - F (\eta_ {t}) \right] \leq \frac {- \beta k}{2} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} + 2 8 L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2} \beta^ {3} k ^ {3} + 4 \beta k b _ {1} ^ {2} \sigma_ {2} ^ {2} + 7 \beta k L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (109) \\ + \frac {3 L \beta^ {2} k}{c} \sigma_ {1} ^ {2} + \frac {2 L \beta^ {2} k ^ {2}}{c} \gamma_ {G} ^ {2} (110) \\ \end{array}
+$$
+
+Hence
+
+$$
+\begin{array}{l} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} \leq \frac {2}{\beta k} \mathbb {E} [ F (\eta_ {t}) - F (\eta_ {t + 1}) ] + 5 6 L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} k ^ {2} + 8 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 1 4 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (111) \\ + \frac {6 L \beta}{c} \sigma_ {1} ^ {2} + \frac {4 L \beta k}{c} \gamma_ {G} ^ {2} (112) \\ \end{array}
+$$
+
+And
+
+$$
+\begin{array}{l} \frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} \leq \frac {2 (F (\eta_ {0}) - F _ {*})}{\beta k T} + 5 6 L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2} \beta^ {2} k ^ {2} + 8 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 1 4 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (113) \\ + \frac {6 L \beta}{c} \sigma_ {1} ^ {2} + \frac {4 L \beta k}{c} \gamma_ {G} ^ {2} (114) \\ \end{array}
+$$
+
+by setting $\beta = \frac{2\sqrt{c}}{k\sqrt{T}}$ we get
+
+$$
+\begin{array}{l} \frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \| \nabla F (\eta_ {t}) \| ^ {2} \leq \frac {\left(F \left(\eta_ {0}\right) - F _ {*}\right)}{\sqrt {c T}} + \frac {2 2 4 c L _ {1} ^ {2} b _ {1} ^ {2} b _ {2} ^ {2}}{T} + 8 b _ {1} ^ {2} \sigma_ {2} ^ {2} + 1 4 L _ {1} ^ {2} b _ {2} ^ {2} \sigma_ {3} ^ {2} (115) \\ + \frac {L \left(6 \sigma_ {1} ^ {2} + 4 k \gamma_ {G} ^ {2}\right)}{k \sqrt {c T}} (116) \\ \end{array}
+$$
+
+□
\ No newline at end of file
diff --git a/pefllpersonalizedfederatedlearningbylearningtolearn/images.zip b/pefllpersonalizedfederatedlearningbylearningtolearn/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2a5a1850104f58d9604cc67769ed452b4531701a
--- /dev/null
+++ b/pefllpersonalizedfederatedlearningbylearningtolearn/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:08e1d52ad7fcbb1f5ee1569dbd1f46f3f8a2dde43675f9d2e28b44cb393cae39
+size 2257845
diff --git a/pefllpersonalizedfederatedlearningbylearningtolearn/layout.json b/pefllpersonalizedfederatedlearningbylearningtolearn/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c84379d99a9f87d72731f3be498fc65306ac2269
--- /dev/null
+++ b/pefllpersonalizedfederatedlearningbylearningtolearn/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4dd371aaa37f7ae2ec297d86a7eee08cc0998570b3615b794cc210ab0faa3959
+size 1012741
diff --git a/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_content_list.json b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..68237dcb8054cd986eb3c84d6b939d77c8d046f8
--- /dev/null
+++ b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:03a0208e0adb2730149602e3ef03c6cd16b980e14a0fe035b1a268b9d1c494ef
+size 155038
diff --git a/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_model.json b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb01e8373dec1976592a0bdfc9a48744e363e64f
--- /dev/null
+++ b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5400869abc8476646139ffe86bc3853637ae24c00860375efbb7c51dffb5ec6f
+size 185275
diff --git a/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_origin.pdf b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..5c385279472f69c8c5e5c7b8ef36513ab3df6263
--- /dev/null
+++ b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/c7cf4679-38a1-4417-9f64-181eb75bfa3f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0ba52e8cec9b2bdc15cb1ec90668b5de1355f78e3a7340670e88a3d56c84b277
+size 10469755
diff --git a/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/full.md b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..5903aeb7d41dd06ff6642b09727c45dfa309a649
--- /dev/null
+++ b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/full.md
@@ -0,0 +1,561 @@
+# PERCEPTIONCLIP: VISUAL CLASSIFICATION BY INFERRING AND CONDITIONING ON CONTEXTS
+
+Bang An $^{1*}$
+
+Sicheng Zhu $^{1*}$
+
+Michael-Andrei Panaitescu-Liess
+
+Chaithanya Kumar Mummadi2
+
+Furong Huang
+
+1University of Maryland, College Park
+
+$^{2}$ Bosch Center for Artificial Intelligence
+
+# ABSTRACT
+
+Vision-language models like CLIP are widely used in zero-shot image classification due to their ability to understand various visual concepts and natural language descriptions. However, how to fully leverage CLIP's unprecedented human-like understanding capabilities to achieve better performance is still an open question. This paper draws inspiration from the human visual perception process: when classifying an object, humans first infer contextual attributes (e.g., background and orientation) which help separate the foreground object from the background, and then classify the object based on this information. Inspired by it, we observe that providing CLIP with contextual attributes improves zero-shot image classification and mitigates reliance on spurious features. We also observe that CLIP itself can reasonably infer the attributes from an image. With these observations, we propose a training-free, two-step zero-shot classification method PerceptionCLIP. Given an image, it first infers contextual attributes (e.g., background) and then performs object classification conditioning on them. Our experiments show that PerceptionCLIP achieves better generalization, group robustness, and interpretability. Our code is available at https://github.com/umd-huang-lab/perceptionCLIP.
+
+
+Figure 1: (Left): CLIP co-relates natural language descriptions of contextual attributes with visual cues (orientation: upside-down). (Center): Unlike CLIP's standard zero-shot inference that uses fixed template(s) for class name retrieval, our method first infers contextual attributes (background: on the grass) using CLIP and then let CLIP predicts the class conditioned on the inferred contextual attributes. Here, background and orientation are both examples of contextual attributes. (Right): Grad-CAM visualization illustrates that our method focuses more on core features (on the dog) and is less distracted by spurious features (grass background) when performing the object classification.
+
+# 1 INTRODUCTION
+
+CLIP (Contrastive Language-Image Pretraining by Radford et al. (2021)) is a foundational Vision-Language Model (VLM) that connects the fields of vision and natural language. By pretraining on 400 million image-caption pairs, CLIP can associate various visual concepts with their corresponding natural language descriptions, making it the foundation for numerous other vision-language models
+
+(Zhu et al., 2023; Liu et al., 2023; Dai et al., 2023; Li et al., 2023b), diffusion models (Ramesh et al., 2022; Rombach et al., 2022), and semantic segmentation models (Kirillov et al., 2023). This remarkable understanding capability of CLIP is significant for zero-shot classification (Larochelle et al., 2008), enabling open-ended image classification via natural language without training. This capability also addresses many challenging tasks with limited or no downstream data, such as model deployment in the wild (Li et al., 2023a), medical image classification (Wang et al., 2022) and satellite object recognition (Ramaswamy et al., 2023).
+
+Although CLIP shows strong potential in zero-shot classification, current methods treat image classification as a text retrieval task and lack systematic investigation into the text prompts used. This leads to sub-optimal generalization (Radford et al., 2021), reliance on spurious features (Yang et al., 2023), biased predictions (Agarwal et al., 2021; Chuang et al., 2023), and lack of interpretability (Zhou et al., 2022b; Menon & Vondrick, 2022). For example, Radford et al. (2021) uses a basic template "a photo of a {class name}" to identify the most relevant class for an image, much less informative than the image captions used during pretraining (see examples in Table 9). Another method, prompt ensembling (Radford et al., 2021), employs 80 crafted templates for better generalization. Nevertheless, it remains unclear whether these templates are optimal and why they are effective. By treating zero-shot classification simply as a class name retrieval problem, these methods potentially waste the capability of CLIP to understand both class-specific features and class-independent attributes such as background and orientation (referred to as contextual attributes in this paper).
+
+Given CLIP's unprecedented human-like vision and language understanding, a natural idea is to draw inspiration from human visual perception. Classic neuroscience (Kandel et al., 2013) describes human visual perception as a three-tiered, context-dependent process: first discerning basic visual attributes like color and orientation, then analyzing scene layout and distinguishing foreground from background, and finally recognizing objects (see details in Appendix C). For example, when humans classify objects in images, we unconsciously acquire contextual attributes like the background and orientation, and in the case of an upside-down image (Figure 1 left), we first infer that the image is rotated and then calibrate our classification accordingly. This hierarchical and context-dependent process contrasts with existing classification methods, which overlook contextual attributes.
+
+Building on this insight, we propose a zero-shot classification method called PerceptionCLIP, which emulates a crucial part of human visual perception — inferring and conditioning on the contextual attributes — resulting in improved generalization, reduced reliance on spurious features, better group robustness, and interpretability. Our contributions are as follows:
+
+(1) We prepare CLIP for perception by structuring CLIP-understandable text prompts with contextual attributes and introducing an attribute-aware CLIP score to approximate essential conditional probabilities for perception emulation.
+(2) Through two proof-of-concept investigations, we reveal that conditioning on ground-truth contextual attributes improves CLIP's zero-shot classification and mitigates reliance on spurious features. Moreover, CLIP has the ability to infer contextual attributes by itself.
+(3) Based on the observations, we propose PerceptionCLIP. Given an image, as shown in Figure 1, it first employs CLIP to infer contextual attributes. Then, it uses CLIP to infer the class conditioned on the attributes by incorporating the descriptions of the inferred attributes into the prompt. This two-step inference resembles the concept of chain-of-thoughts in language models.
+(4) We empirically demonstrate that PerceptionCLIP excels in both standard generalization and group robustness, exhibiting improved interpretability. For generalization, it consistently outperforms baselines that use simple templates and prompt ensembles on 11 datasets. For example, it provides a near $5\%$ accuracy gain on the EuroSAT dataset. For group robustness, it reduces the gap between average accuracy and worst group accuracy by $19\%$ on the Waterbirds dataset and $7\%$ on the CelebA dataset with ViT-L/14, showing less reliance on spurious features.
+
+# 2 RELATED WORK
+
+Due to CLIP's ability to understand finer-grained visual concepts beyond classes, some work also leverages external knowledge to augment prompts. For example, Menon & Vondrick (2022); Pratt et al. (2022); Mao et al. (2022); Feng et al. (2023) use large language models to generate class-specific descriptions, resulting in prompts like "a photo of a hen, which has two legs". Novack et al. (2023)
+
+use class hierarchies to generate sub-classes for each parent class and aggregate model predictions on all sub-classes to get a final prediction. Udandarao et al. (2023) use class names to retrieve and maintain some auxiliary data to help downstream classification. In contrast, our method addresses class-independent attributes (i.e., contextual attributes) such as background and orientation, whose comprehension by CLIP is not well-known. These attributes are also combinatorial, potentially covering more aspects of an image than class-specific attributes. Moreover, we can still leverage contextual attributes (e.g., gender, age) when class-specific attributes are hard to articulate, as in the hair-color classification tasks on CelebA. We defer more related work to Appendix A.
+
+# 3 PRELIMINARIES
+
+Notation. We use uppercase letters to denote random variables and lowercase letters to denote their realizations. For a random variable $Z$ , we use $p_Z(z)$ to denote its probability mass or density function, and omit the subscript $Z$ when the function's meaning can be inferred from the input notation $z$ .
+
+Pretraining of CLIP. CLIP is pretrained on web-scale image-caption pairs, using a contrastive loss to learn good image and text representations in a shared space, aiming to correctly associate images and their textual descriptions. The captions in the pretraining data (as shown in Table 9) typically describe not only the object's class but also contextual attributes like color, style, and background.
+
+Zero-shot classification. After pretraining, Radford et al. (2021) use a universal prompt template, represented by an annotation function $\alpha(y) = "a photo of a {class name of y}''$ , that takes the class index $y$ as the input and outputs a text that only describes the class. For any image $x$ in the image space $\mathcal{X}$ and $y$ in the class set $\mathcal{Y}$ , the CLIP model serves as a score function $\mathrm{CLIP}_1: \mathcal{Y} \times \mathcal{X} \to \mathbb{R}$ via
+
+$$
+\operatorname {C L I P} _ {1} (y; x) \triangleq \langle \phi_ {I} (x), \quad \phi_ {T} (\alpha (y)) \rangle , \tag {1}
+$$
+
+computing a similarity score (within $[-1, 1]$ ) between the image and text through inner products of their representations produced by image encoder $\phi_I$ and the text encoder $\phi_T$ . The subscript '1' in 'CLIP1' indicates that only one textual template is used. Then, given an image $x$ , the method predicts the class $\hat{y} \in \mathcal{V}$ as the one with the highest CLIP1 score, $\hat{y} = \arg \max_{y \in \mathcal{V}} \mathrm{CLIP}_1(y; x)$ .
+
+In addition, Radford et al. (2021) propose prompt ensembling, which ensembles 80 manually-designed templates \(\{\alpha_{i}\}_{i = 1}^{80}\), such as 'a bad photo of a {class name of \(y\})'\( and 'a sculpture of a {class name of \(y\))', and replace \(\mathrm{CLIP}_1\) with the following \(\mathrm{CLIP}_{80}\) score for inference. Prompt ensembling involves some contextual attributes in the templates, but it is ad-hoc and lacks a systematic analysis.
+
+$$
+\operatorname {C L I P} _ {8 0} (y; x) \triangleq \left\langle \phi_ {I} (x), \frac {\frac {1}{8 0} \sum_ {i = 1} ^ {8 0} \phi_ {T} (\alpha_ {i} (y))}{\left\| \frac {1}{8 0} \sum_ {i = 1} ^ {8 0} \phi_ {T} (\alpha_ {i} (y)) \right\|} \right\rangle . \tag {2}
+$$
+
+# 4 PREPARING CLIP FOR PERCEPTION
+
+# 4.1 STRUCTURING AND DESCRIBING CONTEXTUAL ATTRIBUTES
+
+Contextual attributes as generative factors. We consider contextual attributes as generative factors that contribute to the data generation process. Specifically, let $Y$ denote the underlying object class (e.g., $dog$ ) that takes values in the class set $\mathcal{V}$ . Let each $Z_{i}$ ( $1 \leq i \leq m$ ) denote a certain contextual attribute of the object (e.g., orientation) that takes values in the contextual attribute set $\mathcal{Z}_{i}$ (e.g., {upright, upside-down, rotated}) and is causally independent (Pearl, 2009) of the object class $Y$ . Then, we consider an image $X$ to be generated as $Y \to X \gets \{Z_{i}\}_{i=1}^{m}$ .
+
+
+Figure 2: Illustration of contextual attributes, their symbolic discrete values, and the possible textual descriptions mapped by the annotation function.
+
+Textual descriptions for contextual attributes. While CLIP requires semantic text, generative factors are often symbolized discrete values, thus creating a gap. It is negligible for the objects' classes since class names are descriptions with no ambiguities. However, the textual descriptions
+
+
+Figure 3: Evaluating CLIP scores on ImageNet with different transformations altering the contextual attributes. The attribute-aware CLIP score gives higher scores for correctly matched image-attribute pairs (green) while giving lower scores for mismatched pairs (grey) and random pairs (blue), confirming CLIP's understanding of our contextual attribute descriptions. CLIP score measures the similarity between images and contextual attributes, while the original CLIP score (orange) is attribute-agnostic.
+
+of the contextual attributes are vague. Taking upright images as an example, people may use terms like "upright," "upstanding," or no description since it is a common direction. To bridge this gap and translate discrete values into CLIP-readable text, we introduce a specific annotation function $\alpha : \mathcal{Z} \to \mathcal{P}(\text{text})$ , which maps a symbolic discrete value in $\mathcal{Z}$ to a distribution over natural language textual descriptions. Figure 2 illustrates some examples. An ideal annotation function models people's preferences when captioning images. We form the final image description using the concatenation operation $\oplus$ . This operation results in a new description distribution $\alpha(y) \oplus \alpha(z_1) \oplus \alpha(z_2) \oplus \ldots$ where attributes' descriptions are concatenated together and separated by commas. For example, when $y, z_1, z_2$ represent "dog," "upright," and "bright" respectively, the concatenation $\alpha(y) \oplus \alpha(z_1) \oplus \alpha(z_2)$ yields the description "a photo of a dog, upright, bright," or "a photo of a dog, sunny," etc.
+
+# 4.2 CONNECTING CONDITIONAL PROBABILITIES WITH CLIP SCORE
+
+Attribute-aware CLIP score. Existing CLIP score is agnostic of contextual attributes and thus cannot approximate conditional probabilities that are attribute-dependent. Therefore, we define a new score function $\mathrm{CLIP}:\mathcal{V}\times \mathcal{Z}_1\times \dots \times \mathcal{Z}_m\times \mathcal{X}\to \mathbb{R}$ ..
+
+$$
+\operatorname {C L I P} \left(y, z _ {1}, \dots , z _ {m}; x\right) \triangleq \left\langle \phi_ {I} (x), \frac {\mathbb {E} \phi_ {T} \left(\alpha (y) \oplus \alpha \left(z _ {1}\right) \oplus \cdots \oplus \alpha \left(z _ {m}\right)\right)}{\| \mathbb {E} \phi_ {T} \left(\alpha (y) \oplus \alpha \left(z _ {1}\right) \oplus \cdots \oplus \alpha \left(z _ {m}\right)\right) \|} \right\rangle . \tag {3}
+$$
+
+It takes contextual attributes $z_{i}$ s as additional inputs, describes them internally alongside the class through the annotation function $\alpha(z_{i})$ , and calculates the similarity with the image in the embedding space. The expectation is taken over the randomness of the descriptions of contextual attributes. The defined CLIP score captures the contextual attributes and behaves like an energy function (LeCun et al., 2006): it is high for correctly matched image-attribute pairs while low for mismatched ones. More formally, when $(y^{*}, z_{1}^{*}, \ldots, z_{m}^{*})$ are the ground-truth class and attributes that generate image $x^{*}$ whereas $(y, z_{1}, \ldots, z_{m})$ are some arbitrary class and attributes,
+
+$$
+\operatorname {C L I P} \left(y ^ {*}, z _ {1} ^ {*}, \dots , z _ {m} ^ {*}\right) \geq \operatorname {C L I P} \left(y, z _ {1}, \dots , z _ {m}\right), \quad \forall y \in \mathcal {Y}, \quad \forall z _ {i} \in \mathcal {Z} _ {i}, \quad \forall 1 \leq i \leq m. \tag {4}
+$$
+
+Figure 3 and 5 empirically verified this property (see Appendix E.1 for details). Given the pretraining process, this observation is not surprising since it encourages high scores for correctly matched image-caption pairs where the caption describes not only the class but also the contextual attributes.
+
+Approximating conditional probabilities. With the energy-function-like CLIP score, we approximate the conditional probabilities. Specifically (in Table 1 and Appendix D), we approximate (1) the joint conditional probability $p(y, z_1, \ldots, z_m|x)$ , which measures the likelihood of an object class and some contextual attributes occurring together given the image, requiring only exponentiation and normalization. Based on it, we derive the rest two using the law of total probability. (2) the conditional probability $p(y|z_1, \ldots, z_m, x)$ , which measures the probability of an object class given both the image and
+
+Table 1: Conditional probabilities. $x, y$ , and $z$ denote image, class, and contextual attributes. $z$ denotes $(z_{1}, \ldots, z_{m})$ for simplicity.
+
+
Probability
Approximation
p(y,z|x)
eCLIP(y,z|x)/∑y∑z eCLIP(y,z|x)
p(y|x,z)
eCLIP(y,z|x)/∑yeCLIP(y,z|x)
p(z|x)
∑y eCLIP(y,z|x)/∑z ∑y eCLIP(y,z|x) or eCLIP(z|x)/∑z eCLIP(z|x)
+
+Table 2: Classification accuracy (%) on ImageNet. We apply the left-side image transformations to alter the corresponding attributes. Different methods condition on different values of the contextual attributes. Conditioning on correct or self-inferred attribute values improves accuracy the most.
+
+
Contextual attribute
Accuracy
w/o z
w/ random z
w/ wrong z
w/ correct z
w/ self-infer z
vertical flip
51.17
52.02 (↑0.85)
52.19 (↑1.02)
52.48 (↑1.31)
52.54 (↑1.37)
\( 90^{\circ} \)rotation
57.02
58.38 (↑1.36)
58.23 (↑1.21)
58.75 (↑1.73)
58.30 (↑1.28)
elastic-transform
48.66
48.45 (↓0.21)
48.75 (↑0.09)
48.89 (↑0.23)
49.00 (↑0.34)
color-invert
35.29
36.12 (↑0.83)
35.89 (↑0.60)
36.72 (↑1.43)
36.80 (↑1.51)
solarize
49.79
49.74 (↓0.05)
50.20 (↑0.41)
50.49 (↑0.70)
50.54 (↑0.75)
blur
38.86
39.65 (↑0.79)
39.21 (↑0.35)
39.92 (↑1.06)
39.80 (↑0.94)
grayscale
59.51
59.67 (↑0.16)
59.48 (↓0.03)
59.98 (↑0.47)
60.04 (↑0.53)
bright
60.81
62.04 (↑1.23)
60.94 (↑0.13)
61.41 (↑0.60)
61.28 (↑0.47)
noise
14.16
14.88 (↑0.72)
14.75 (↑0.59)
15.66 (↑1.50)
15.68 (↑1.52)
snow
33.09
32.94 (↓0.15)
33.56 (↑0.47)
34.50 (↑1.41)
34.33 (↑1.24)
frost
31.08
31.91 (↑0.83)
31.76 (↑0.68)
32.63 (↑1.55)
32.81 (↑1.73)
fog
37.61
38.40 (↑0.79)
38.00 (↑0.39)
39.31 (↑1.70)
39.34 (↑1.73)
jpeg
33.67
34.80 (↑1.13)
35.11 (↑1.45)
35.39 (↑1.72)
35.47 (↑1.80)
average
-
↑0.64
↑0.57
↑1.16
↑1.17
+
+the contextual attributes, which is our main inference objective. (3) the conditional probability $p(z_1, \ldots, z_m|x)$ , measures the likelihood of some contextual attributes given the image and is used for inferring the contextual attributes. We provide two approximations, referred to as ClassAttr (left) and PureAttr (right). The textual description corresponding to CLIP(y, z; x) in ClassAttr is "a photo of a {class name of y}, {description of z}", while the description corresponding to CLIP(z; x) in PureAttr is "a photo of an object, {description of z}" with a word like "object" substituting all classes.
+
+# 5 CONTEXTUAL ATTRIBUTES ARE HELPFUL AND INFERABLE
+
+This section presents proof-of-concept experiments showing that emulating human perception through conditional inference on contextual attributes improves zero-shot classification. Additionally, such improvement does not require ground-truth attributes, as CLIP itself can infer attributes reasonably.
+
+# 5.1 CONDITIONING ON CONTEXTUAL ATTRIBUTES IS HELPFUL
+
+We first evaluate if conditioning on the ground-truth contextual attributes improves the zero-shot classification accuracy. Given an image $x$ , the most likely class is $\hat{y} = \arg \max_{y} p(y|x, z^{*})$ with:
+
+$$
+\underset {y} {\arg \max } p \left(y | x, z ^ {*}\right) = \underset {y} {\arg \max } \frac {e ^ {\operatorname {C L I P} \left(y , z ^ {*} ; x\right)}}{\sum_ {y} e ^ {\operatorname {C L I P} \left(y , z ^ {*} ; x\right)}} = \underset {y} {\arg \max } \operatorname {C L I P} \left(y, z ^ {*}; x\right), \tag {5}
+$$
+
+where the second equality holds because $\sum_{y}e^{\mathrm{CLIP}(y,z;x)}$ is a constant of $y$ and exponential function is monotonic. Intuitively, we classify an image by considering the combinations of all possible classes with the ground-truth contextual attributes and identify the class that yields the highest CLIP score.
+
+Conditioning on ground-truth contextual attributes improves classification accuracy. We compare the following four methods in zero-shot classification, where the last two are for ablation:
+
+
Conditioning on
Calculation
Prompt example
No contextual attributes
arg maxyCLIP1(y;x)
a photo of a {class name of y}.
Ground-truth attribute values
arg maxyCLIP(y,z*;x)
a photo of a {class name of y}, upside-down.
Wrong attribute values
arg maxyCLIP(y,zwrong;x)
a photo of a {class name of y}, upright.
Random attribute values
arg maxyCLIP(y,zrandom;x)
a photo of a {class name of y}, iaYo5n0Dli7.
+
+We evaluate these methods on ImageNet dataset. Similar to Figure 3, we alter easily observable and adjustable attributes such as orientation through image transformations (e.g., vertical flipping). These new attributes become part of the modified images' generation process, for which we have ground-truth annotations. Table 2 shows that compared to not using contextual attributes, conditioning
+
+
+Original
+
+
+Core-spurious segmentation
+
+
+M
+
+
+"next to a car"
+
+49.1 50.9
+"in between red leaves and trees"
+75.724.3
+
+core feature
+spurious feature
+
+
+Original
+
+
+Core-spurious segmentation
+
+
+${A}^{\prime }$
+46.4 53.6
+Figure 4: Images of a leopard and a waterbird, core and spurious features, and Grad-CAM heatmaps using no, incorrect, and ground-truth contextual attributes (with text below images). The bar shows core vs. spurious ratio in the heatmap. Visualization shows that classification conditioned on correct contextual attributes enforces CLIP's focus on core features.
+
+
+59.4 40.6
+"near a house"
+41 59
+
+
+"on the water"
+64.9
+
+on ground-truth contextual attributes improves classification accuracy notably. As an ablation study, conditioning on wrong or randomly generated contextual attributes does not yield similar benefits.
+
+Conditioning on ground-truth contextual attributes mitigates the reliance on spurious features. Contextual attributes like background (e.g., grass) may exhibit spurious correlations with the class (e.g., dog). Classifiers relying on these contextual attributes, also known as spurious features, usually perform poorly. We investigate whether classification conditioned on the known spurious features can enforce CLIP's focus on the object (i.e., core features). As shown in Figure 4, we isolate the background from the core region and employ Grad-CAM (Selvaraju et al., 2017) to identify which region the model focuses on during classification. Specifically, the gradients on pixels with respect to $p(y^{*}|x,z^{*})$ , the likelihood of the correct class conditioned on the known background given the image, yields the saliency heatmap. Figure 1 and 4 illustrate that CLIP may rely on spurious features, however, conditioning on correct contextual attributes reduces such reliance and enforces the model to focus on core features, resulting in a more interpretable and reasonable perception (see more results in Appendix E.3). Since image embedding captures both object and background, we suspect that specifying an image's background to CLIP minimizes background influence, potentially sharpening the focus on object features for a better image and text matching in the embedding space.
+
+# 5.2 CONTEXTUAL ATTRIBUTES ARE INFERABLE
+
+The above results highlight the advantages of leveraging CLIP's understanding of contextual attributes. However, manually annotating the attributes is impractical. We now investigate whether CLIP can infer contextual attributes. To infer $z$ , we calculate $\arg \max_{z} p(z|x)$ using one of the two approximations in Table 1, where the ClassAttr option yields $\arg \max_{z} p(z|x) = \arg \max_{z} \sum_{y} e^{\mathrm{CLIP}(y,z;x)}$ , and the PureAttr option yields $\arg \max_{z} p(z|x) = \arg \max_{z} \mathrm{CLIP}(z;x)$ .
+
+CLIP can infer contextual attributes. Different from the setting in Section 5.1, we randomly apply transformations to only half of the images in ImageNet. Therefore, inferring each attribute is a binary classification task with a random guessing accuracy of $50\%$ . Table 3 shows that the average accuracy is around $74\%$ for both methods, indicating that CLIP can reasonably infer contextual attributes, with some attributes being easier to infer than others. CLIP's understanding of contextual attributes may originate from the numerous captions during the pre-training stage. Moreover, inferring contextual attributes could be easier than determining the object class. Therefore, we may bootstrap CLIP's inference by conditioning on the contextual attributes inferred by itself which is verified in Table 2.
+
+Table 3: Inference accuracy (%) of two contextual attribute inference methods on ImageNet.
+
+
Attribute
vflip
rotation
elastic
invert
solarize
blur
gray
bright
noise
snow
frost
fog
jpeg
Avg
ClassAttr
76.30
68.65
72.03
78.67
74.67
62.91
84.67
56.98
66.00
86.56
82.39
89.11
66.66
74.28
PureAttr
77.31
66.01
60.00
80.61
88.79
59.26
74.26
58.94
67.16
86.56
78.23
93.95
68.71
73.83
+
+# 6 PerceptionCLIP: EMULATING HUMAN PERCEPTION
+
+Building on the above observations, we propose PerceptionCLIP, a two-step zero-shot classification method for CLIP. It emulates the human perception process by first inferring the contextual attributes and then inferring the class conditioning on the contextual attributes. The pseudocode of PerceptionCLIP is outlined in Algorithm 1.
+
+# Algorithm 1: PerceptionCLIP
+
+Require: class $Y$ , contextual attributes $\{Z_1, \ldots, Z_m\}$ , CLIP score (with annotation function $\alpha$ ), temperature hyperparameter $\tau$
+
+Input : image $x$
+
+Output : predicted class $\hat{y}$
+
+Step 1: infer the distribution of contextual attribute values
+
+$$
+\hat {p} (z _ {1}, \dots , z _ {m} | x) \leftarrow \frac {\sum_ {y} e ^ {\operatorname {C L I P} (y , z _ {1} , \dots , z _ {m} ; x) / \tau}}{\sum_ {y} \sum_ {z _ {1} , \dots , z _ {m}} e ^ {\operatorname {C L I P} (y , z _ {1} , \dots , z _ {m} ; x) / \tau}} \text {o r} \frac {e ^ {\operatorname {C L I P} (z _ {1} , \dots , z _ {m} ; x) / \tau}}{\sum_ {z _ {1} , \dots , z _ {m}} e ^ {\operatorname {C L I P} (z _ {1} , \dots , z _ {m} ; x) / \tau}}
+$$
+
+Step 2: infer the class
+
+$$
+p (y | x, z _ {1}, \dots , z _ {m}) \leftarrow \frac {e ^ {\operatorname {C L I P} (y , z _ {1} , \dots , z _ {m} ; x)}}{\sum_ {y} e ^ {\operatorname {C L I P} (y , z _ {1} , \dots , z _ {m} ; x)}}
+$$
+
+$$
+\hat {y} \leftarrow \arg \max _ {y} p (y | x) = \arg \max _ {y} \sum_ {z _ {1}, \dots , z _ {m}} p (y | x, z _ {1}, \dots , z _ {m}) \hat {p} (z _ {1}, \dots , z _ {m} | x).
+$$
+
+Step one: PerceptionCLIP estimates the distribution of contextual attributes given an image. Rather than selecting the most probable attribute value, we estimate the entire distribution to accommodate CLIP's inherent uncertainty. In addition, we introduce a temperature hyperparameter $\tau$ to intervene in the estimation. A temperature $\tau$ greater than 1 smoothens CLIP's estimation, implying less trust in its predictions. The two-step nature also allows for other interventions, such as truncating top $k$ predicted values (i.e., beam search), which we leave for future work.
+
+Step two: PerceptionCLIP first approximates the class distribution conditioning on each possible contextual attributes' value. Then, it uses the estimated distribution of contextual attributes to calculate the weighted sum of these class distributions, marginalizing out the contextual attributes. Finally, it selects the most probable class $y$ as the predicted output.
+
+Simplifying into a single step. It can be seen from Algorithm 1 that setting the temperature to 1 and ignoring constant terms yields $\hat{y} \gets \arg \max_y \sum_{z_1, \dots, z_m} e^{\mathrm{CLIP}(y, z_1, \dots, z_m; x)}$ , essentially simplifying the two-step algorithm into a single step. Intuitively, for each possible class, it sums the exponentiated CLIP scores calculated over each contextual attribute value, resulting in an aggregated score for the class. Then, it selects the class with the highest aggregated score.
+
+Single-step vs. prompt ensembling. This single-step approach, as a special case of our method, coincides with the prompt ensembling method if we aggregate over some randomly selected attributes (as in 80 templates) instead of all contextual attribute combinations. This coincidence explains the effectiveness of prompt ensembling - it undergoes an implicit perception process. Nevertheless, our experiments show that constructing diverse and systematic prompts using our contextual attribute combinations is superior to ad-hoc template selections in prompt ensembling.
+
+Two-step vs. single-step. The one-step method is simpler to implement but lacks two key features. It disallows human intervention when inferring contextual attributes. Our experiments indicate that CLIP does not always infer contextual attributes correctly, whereas human intervention can leverage our prior knowledge to adjust its estimation. Second, the one-step method prevents us from knowing the inferred contextual attributes, which could have improved the interpretability of the results.
+
+Constructing contextual attributes. The set of possible contextual attributes is at the core of PerceptionCLIP. We construct it with two approaches: 1) We manually construct essential attributes that may be generative factors in the image generation process, especially those causing spurious correlations. This is particularly effective when we know of the dataset. For instance, for the CelebA dataset, we consider gender, age, and race as the attributes. 2) We leverage the in-context learning of large language models for semi-automated construction (shown in Appendix F.4).
+
+Table 4: Zero-shot classification accuracy on five datasets using ViT-B/16. The best result in each column is highlighted in bold, while the next three highest values are underlined.
+
+
Attributes
ImageNet
ImageNetV2
ImageNet-R
ImageNet-A
ImageNet-Sketch
single attribute
single template
66.72
60.85
73.99
47.80
46.16
80 templates
68.32
61.93
77.71
49.95
48.26
background
67.98
61.65
75.87
49.85
47.08
illumination
67.47
61.48
75.37
48.90
46.67
orientation
67.28
61.11
74.51
48.47
46.87
quality
68.18
61.65
76.23
50.36
47.40
quantity
67.64
61.46
75.37
50.04
46.59
perspective
67.90
61.27
75.00
49.61
46.84
art
67.53
61.11
77.16
49.48
47.96
medium
67.58
61.31
76.67
49.62
47.37
condition
68.39
61.69
75.74
49.54
47.41
color-scheme
66.89
60.70
74.47
48.14
47.03
tool
67.42
61.02
76.72
48.88
48.19
composition of top 2 attributes
68.52
62.28
77.78
50.88
48.46
composition of top 3 attributes
68.80
62.22
78.14
51.15
48.92
composition of top 4 attributes
68.71
62.32
78.38
51.39
49.10
+
+Table 5: Classification accuracy of ViT-B/16 on different data domains with PerceptionCLIP.
+
+
CUB200
EuroSAT
Places365
Flowers102
Food101
Oxford Pets
simple template
56.07
51.44
38.93
67.73
88.24
88.25
domain template
56.32
54.94
38.93
70.99
88.72
89.04
+ Z
57.08
59.23
40.92
72.86
89.19
90.38
+
+# 7 EXPERIMENTS
+
+# 7.1 ZERO-SHOT GENERALIZATION
+
+Settings. We test PerceptionCLIP on ImageNet (Deng et al., 2009) and its out-of-distribution datasets, including ImageNetV2 (Recht et al., 2019), ImageNet-R (Hendrycks et al., 2021a), ImageNet-A (Hendrycks et al., 2021b), and ImageNet-Sketch (Wang et al., 2019). We also test on different data domains (e.g., satellite images), including CUB200 (Wah et al., 2011), EuroSAT (Helber et al., 2019), Places365 (Zhou et al., 2017), Flowers102 (Nilsback & Zisserman, 2008), Food101 (Bossard et al., 2014), and Oxford Pets (Parkhi et al., 2012). For natural images, we compile a set of possible contextual attributes. Each attribute has multiple possible values, and each value has multiple possible descriptions with uniform possibilities to simulate the unknown distribution (details in Appendix E.4). For the dataset in a specific domain, we use domain-specific contextual attributes, for example, image source for EuroSAT, cuisine for Food101, species for Oxford Pets. We use our two-step method (ClassAttr) with the temperature as a hyperparameter (details in Appendix E.4).
+
+Using a single attribute. Table 4 shows that compared to using the simple template "a photo of a {class name}", considering almost any single contextual attribute improves the accuracy, some even surpassing the use of 80 templates. We also observe that the most influential contextual attributes vary for different datasets, potentially attributable to different data generation processes. For example, all images in ImageNet-Sketch are sketches, making tool and art crucial contextual attributes for image generation. This also indicates that PerceptionCLIP works the best when the considered contextual attributes cover the generation process of the dataset.
+
+Using multiple attributes. Table 4 also presents the results considering multiple contextual attributes. PerceptionCLIP, using the two most effective attributes, can already outperform prompt ensembling using 80 templates across all datasets. As the number of attributes considered increases, the classification accuracy gradually improves. We also test our method on different domains of data in Table 5. The domain templates provided in Radford et al. (2021) already describe the domain in text prompt (e.g., "a centered satellite photo of {class name}") where the domain is a known contextual attribute. As expected, specifying it improves accuracy. PerceptionCLIP considers more contextual attributes and further improves zero-shot classification accuracy. For instance, by considering image source and condition for the EuroSAT dataset, PerceptionCLIP achieves a near $5\%$ gain in accuracy.
+
+Ablation studies in Appendix E.4 demonstrate that substituting contextual attributes with random strings markedly reduces performance, highlighting their critical role in our method's effectiveness.
+
+Intervening in attributes inference. In Table 6, we evaluate the effectiveness of the intervention. We set temperature $\tau = 3$ and consider the top four attributes. Results show that intervening in inferring contextual attributes achieves modest but consistent performance gains across datasets. In practice, we find that setting the temperature to 3 or 5 usually yields better performance, which also confirms that CLIP cannot perfectly infer contextual attributes.
+
+Table 6: Intervening in inferring contextual attributes improves zero-shot classification.
+
+
Without intervention
With intervention
ClassAtr
PureAttr
ImageNet
68.59%
68.70%
68.72%
ImageNetV2
62.10%
62.31%
62.32%
ImageNet-R
78.12%
78.38%
78.27%
ImageNet-A
51.17%
51.39%
51.22%
ImageNet-Sketch
49.03%
49.10%
49.10%
+
+One can also search for the best temperature with a validation set when applicable.
+
+# 7.2 GROUP ROBUSTNESS
+
+Group robustness is a critical measure of a model's bias. It measures the ability to perform consistently across different subgroups within a dataset (Liu et al., 2021). We evaluate the group robustness of PerceptionCLIP through bird type classification on the Waterbirds dataset (Sagawa et al., 2020) and hair color classification on the CelebA (Liu et al., 2015) dataset. In both datasets, each image has an underlying group attribute unknown to the model. These group attributes are background in Waterbirds and gender in CelebA. They both spuriously correlate with the class but do not causally determine the class. To evaluate the worst-group accuracy, we group images by their classes and attributes, then assess each group's accuracy following Sagawa et al. (2020). Table 7 and 8 show that when the text prompts only describe the class and ignore contextual attributes (first row), such as "a photo of a {landbird/waterbird}" and "a photo of a celebrity with {dark hair/blond hair}", CLIP exhibits biased accuracy, with a significant discrepancy between average accuracy and the worst-group accuracy. This bias arises because CLIP overly relies on spurious features, such as associating images with a water background to the waterbird class, instead of focusing on the bird. As shown in Figure 4, conditioning on group attributes such as background helps reduce CLIP's reliance on spurious features, making the model less biased. Results in Table 7 and 8 also confirm that by considering background (with values in {on land, on water}) for Waterbird dataset, and gender (with values in {female, male}) for CelebA dataset, PerceptionCLIP reduces the accuracy gap in most cases. By incorporating more values (e.g., in forest) into the attribute background $^+$ , or considering more contextual attributes like age and race, the group robustness can be further improved.
+
+Table 7: Average accuracy and worst group accuracy on the Waterbirds dataset.
+
+
RN50
ViT-B/32
ViT-B/16
ViT-L/14
Avg ↑
Worst ↑
Gap ↓
Avg ↑
Worst ↑
Gap ↓
Avg ↑
Worst ↑
Gap ↓
Avg ↑
Worst ↑
Gap ↓
without Z
90.47
16.07
74.40
87.34
47.28
40.06
87.34
26.79
60.56
90.55
44.64
45.91
Z{background}
88.78
16.07
72.71
89.80
66.07
23.73
82.98
16.07
66.91
86.44
44.94
41.51
Z{background+}
90.32
35.71
54.61
78.60
60.33
18.28
85.80
41.07
44.73
87.74
61.12
26.62
+
+Table 8: Average accuracy and worst group accuracy on the CelebA dataset.
+
+
RN50
ViT-B/32
ViT-B/16
ViT-L/14
Avg ↑
Worst ↑
Gap↓
Avg ↑
Worst ↑
Gap↓
Avg ↑
Worst ↑
Gap↓
Avg ↑
Worst ↑
Gap↓
without Z
81.05
73.87
7.19
80.73
75.82
4.91
75.16
62.01
13.16
86.98
77.36
9.61
Z={gender}
85.10
80.44
4.65
79.89
76.70
3.19
75.27
65.13
10.14
80.30
74.31
5.99
Z={gender, age}
87.71
84.98
2.74
82.82
78.06
4.76
75.81
65.52
10.29
82.26
79.06
3.21
Z={gender, age, race}
85.55
82.51
3.05
82.02
75.94
6.09
77.17
69.18
7.99
83.04
80.84
2.20
+
+# 8 CONCLUSION
+
+This paper proposes PerceptionCLIP, a zero-shot classification method for CLIP that emulates human visual perception. By doing classification conditioned on self-inferred contextual attributes, it achieves improved generalization, less reliance on spurious features, and improved group robustness. One limitation of our method is its sensitivity to text descriptions. Although using a distribution of descriptions alleviates this sensitivity, it is an intrinsic problem of CLIP itself. Future work may overcome this limitation by using advanced vision-language models. Another future direction is applying this technique to pre-training and fine-tuning stages (see more in Appendix G).
+
+# ACKNOWLEDGEMENT
+
+An, Zhu, Panaitescu-Liess and Huang are supported by National Science Foundation NSF-IIS-2147276 FAI, DOD-ONR-Office of Naval Research under award number N00014-22-1-2335, DOD-AFOSR-Air Force Office of Scientific Research under award number FA9550-23-1-0048, DOD-DARPA-Defense Advanced Research Projects Agency Guaranteeing AI Robustness against Deception (GARD) HR00112020007, Adobe, Capital One and JP Morgan faculty fellowships.
+
+# REFERENCES
+
+Sandhini Agarwal, Gretchen Krueger, Jack Clark, Alec Radford, Jong Wook Kim, and Miles Brundage. Evaluating clip: towards characterization of broader capabilities and downstream implications. arXiv preprint arXiv:2108.02818, 2021.
+Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101-mining discriminative components with random forests. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part VI 13, pp. 446-461. Springer, 2014.
+Ching-Yao Chuang, Varun Jampani, Yuanzhen Li, Antonio Torralba, and Stefanie Jegelka. Debiasing vision-language models via biased prompts. arXiv preprint arXiv:2302.00070, 2023.
+Wenliang Dai, Junnan Li, Dongxu Li, Anthony Meng Huat Tiong, Junqi Zhao, Weisheng Wang, Boyang Li, Pascale Fung, and Steven Hoi. Instructclip: Towards general-purpose vision-language models with instruction tuning. (arXiv:2305.06500), Jun 2023. URL http://arxiv.org/abs/2305.06500. arXiv:2305.06500 [cs].
+Timothée Darcet, Maxime Oquab, Julien Mairal, and Piotr Bojanowski. Vision transformers need registers. arXiv preprint arXiv:2309.16588, 2023.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Mohammad Mahdi Derakhshani, Enrique Sanchez, Adrian Bulat, Victor Guilherme Turrisi da Costa, Cees G. M. Snoek, Georgios Tzimiropoulos, and Brais Martinez. Bayesian prompt learning for image-language model generalization, 2023.
+Lijie Fan, Dilip Krishnan, Phillip Isola, Dina Katabi, and Yonglong Tian. Improving clip training with language rewrites. arXiv preprint arXiv:2305.20088, 2023.
+Zhili Feng, Anna Bair, and J. Zico Kolter. Leveraging multiple descriptive features for robust few-shot image learning. ArXiv, abs/2307.04317, 2023. URL https://api-semanticscholar.org/CorpusID:259501400.
+Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 12(7):2217-2226, 2019.
+Dan Hendrycks and Thomas G Dietterich. Benchmarking neural network robustness to common corruptions and surface variations. arXiv preprint arXiv:1807.01697, 2018.
+Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8340-8349, 2021a.
+Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15262-15271, 2021b.
+Tony Huang, Jack Chu, and Fangyun Wei. Unsupervised prompt learning for vision-language models. arXiv preprint arXiv:2204.03649, 2022.
+
+Neel Jain, Ping-yeh Chiang, Yuxin Wen, John Kirchenbauer, Hong-Min Chu, Gowthami Somepalli, Brian R Bartoldson, Bhavya Kailkhura, Avi Schwarzschild, Aniruddha Saha, et al. Neftune: Noisy embeddings improve instruction finetuning. arXiv preprint arXiv:2310.05914, 2023.
+Eric R Kandel, James H Schwartz, Thomas M Jessell, Steven Siegelbaum, A James Hudspeth, Sarah Mack, et al. Principles of neural science, Fifth Edition, volume 4. McGraw-hill New York, 2013.
+Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C. Berg, Wan-Yen Lo, Piotr Dólár, and Ross Girshick. Segment anything. (arXiv:2304.02643), Apr 2023. doi: 10.48550/arXiv.2304.02643. URL http://arxiv.org/abs/2304.02643.arXiv:2304.02643 [cs].
+Hugo Larochelle, Dumitru Erhan, and Yoshua Bengio. Zero-data learning of new tasks. In AAAI, volume 1, pp. 3, 2008.
+Yann LeCun, Sumit Chopra, Raia Hadsell, M Ranzato, and Fujie Huang. A tutorial on energy-based learning. Predicting structured data, 1(0), 2006.
+Hanting Li, Hongjing Niu, Zhaoqing Zhu, and Feng Zhao. Cliper: A unified vision-language framework for in-the-wild facial expression recognition. ArXiv, abs/2303.00193, 2023a.
+Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. (arXiv:2301.12597), Jun 2023b. URL http://arxiv.org/abs/2301.12597. arXiv:2301.12597 [cs].
+Lianian Harold Li, Zi-Yi Dou, Nanyun Peng, and Kai-Wei Chang. Desco: Learning object recognition with rich language descriptions. (arXiv:2306.14060), Jun 2023c. doi: 10.48550/arXiv.2306.14060. URL http://arxiv.org/abs/2306.14060.arXiv:2306.14060 [cs].
+Evan Z Liu, Behzad Haghloo, Annie S Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learning, pp. 6781-6792. PMLR, 2021.
+Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. (arXiv:2304.08485), Apr 2023. URL http://arxiv.org/abs/2304.08485.arXiv:2304.08485 [cs].
+Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
+Chengzhi Mao, Revant Teotia, Amrutha Sundar, Sachit Menon, Junfeng Yang, Xin Eric Wang, and Carl Vondrick. Doubly right object recognition: A why prompt for visual rationales. ArXiv, abs/2212.06202, 2022.
+Cristina Menghini, Andrew Delworth, and Stephen H. Bach. Enhancing clip with clip: Exploring pseudolabeling for limited-label prompt tuning. (arXiv:2306.01669), Jun 2023. doi: 10.48550/ arXiv.2306.01669. URL http://arxiv.org/abs/2306.01669.arXiv:2306.01669 [cs].
+Sachit Menon and Carl Vondrick. Visual classification via description from large language models. arXiv preprint arXiv:2210.07183, 2022.
+M. Jehanzeb Mirza, Leonid Karlinsky, Wei Lin, Mateusz Kozinski, Horst Possegger, Rogerio Feris, and Horst Bischof. Lafter: Label-free tuning of zero-shot classifier using language and unlabeled image collections. (arXiv:2305.18287), May 2023. URL http://arxiv.org/abs/2305.18287.arXiv:2305.18287 [cs].
+Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian conference on computer vision, graphics & image processing, pp. 722-729. IEEE, 2008.
+Zachary Novack, S. Garg, Julian McAuley, and Zachary Chase Lipton. Chils: Zero-shot image classification with hierarchical label sets. ArXiv, abs/2302.02551, 2023.
+
+OpenAI. Gpt-4 technical report, 2023.
+Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3498-3505. IEEE, 2012.
+Judea Pearl. Causal inference in statistics: An overview. 2009.
+Sarah Pratt, Rosanne Liu, and Ali Farhadi. What does a platypus look like? generating customized prompts for zero-shot image classification. arXiv preprint arXiv:2209.03320, 2022.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748-8763. PMLR, 2021.
+Vikram V. Ramaswamy, Sing Yu Lin, Dora Zhao, Aaron B. Adcock, Laurens van der Maaten, Deepti Ghadiyaram, and Olga Russakovsky. Geode: a geographically diverse evaluation dataset for object recognition. (arXiv:2301.02560), Apr 2023. doi: 10.48550/arXiv.2301.02560. URL http://arxiv.org/abs/2301.02560.arXiv:2301.02560 [cs].
+Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. (arXiv:2204.06125), Apr 2022. doi: 10.48550/arXiv.2204.06125. URL http://arxiv.org/abs/2204.06125.arXiv:2204.06125 [cs].
+Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. DoImagenet classifiers generalize toImagenet? In International conference on machine learning, pp. 5389-5400. PMLR, 2019.
+Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. pp. 10684-10695, 2022. URL https://openaccess.thecvf.com/content/CVPR2022/html/Rombach_High-Resolution/Image_Synthesis_With_Latent_Diffusion_CModels_CVPR_2022_paper.html.
+Karsten Roth, Jae Myung Kim, A. Sophia Koepke, Oriol Vinyals, Cordelia Schmid, and Zeynep Akata. Waffling around for performance: Visual classification with random words and broad concepts, 2023.
+Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=ryxGuJrFvS.
+Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
+Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pp. 618-626, 2017.
+Manli Shu, Weili Nie, De-An Huang, Zhiding Yu, Tom Goldstein, Anima Anandkumar, and Chaowei Xiao. Test-time prompt tuning for zero-shot generalization in vision-language models. arXiv preprint arXiv:2209.07511, 2022.
+Vishaal Udandarao, Ankush Gupta, and Samuel Albanie. Sus-x: Training-free name-only transfer of vision-language models. (arXiv:2211.16198), Jul 2023. doi: 10.48550/arXiv.2211.16198. URL http://arxiv.org/abs/2211.16198.arXiv:2211.16198 [cs].
+Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011.
+
+Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. Advances in Neural Information Processing Systems, 32, 2019.
+Zifeng Wang, Zhenbang Wu, Dinesh Agarwal, and Jimeng Sun. Medclip: Contrastive learning from unpaired medical images and text. ArXiv, abs/2210.10163, 2022.
+Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022.
+Yu Yang, Besmira Nushi, Hamid Palangi, and Baharan Mirzasoleiman. Mitigating spurious correlations in multi-modal models during fine-tuning. ArXiv, abs/2304.03916, 2023.
+Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Thomas L Griffiths, Yuan Cao, and Karthik Narasimhan. Tree of thoughts: Deliberate problem solving with large language models. arXiv preprint arXiv:2305.10601, 2023.
+Mert Yuksekgonul, Federico Bianchi, Pratyusha Kalluri, Dan Jurafsky, and James Zou. When and why vision-language models behave like bags-of-words, and what to do about it? In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=KRLUvxh8uaX.
+Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452-1464, 2017.
+Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16816-16825, 2022a.
+Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 130(9):2337-2348, 2022b.
+Beier Zhu, Yulei Niu, Yucheng Han, Yue Wu, and Hanwang Zhang. Prompt-aligned gradient for prompt tuning. arXiv preprint arXiv:2205.14865, 2022.
+Deyao Zhu, Jun Chen, Xiaqian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing vision-language understanding with advanced large language models. (arXiv:2304.10592), Apr 2023. URL http://arxiv.org/abs/2304.10592. arXiv:2304.10592 [cs].
+
+# APPENDIX
+
+# A EXTENDED RELATED WORK
+
+Descriptive prompts with external knowledge. Due to CLIP's ability to understand finer-grained visual concepts beyond classes (e.g., body parts and components), some work leverages external knowledge to augment prompts with additional visual concepts to improve CLIP's zero-shot classification. For example, Menon & Vondrick (2022); Pratt et al. (2022); Mao et al. (2022); Feng et al. (2023) use large language models (LLMs) like GPT-3 to generate class-specific descriptions for each class and incorporate them into prompts, resulting in prompts like "a photo of a hen, which has two legs". Novack et al. (2023) use class hierarchies (existing or by querying GPT-3) to generate sub-classes for each parent class and aggregate model predictions on all sub-classes to get a final prediction. Udandarao et al. (2023) use class names to retrieve and maintain some auxiliary data to help downstream classification. In contrast, our method addresses class-independent attributes (i.e., contextual attributes) such as background and orientation, whose comprehension by CLIP is not well-known. These attributes are also combinatorial, potentially covering more aspects of an image than class-specific attributes. Moreover, we can still leverage contextual attributes (e.g., gender, age) when class-specific attributes are hard to articulate, as in the hair-color classification tasks on CelebA. We also find that specifying spurious contextual attributes reduces distractions from their spurious correlations.
+
+Does CLIP truly understand descriptive prompts? Some work investigates a seemingly obvious question: do these descriptive prompts play a role in CLIP's prediction? Roth et al. (2023) show that replacing class-specific descriptions in prior work with random words or even meaningless characters can achieve similar performance, resembling the effect of noise augmentation or randomized smoothing. Li et al. (2023c) find that GLIP (a similar VLM as CLIP), often disregards contextual information in the prompts and relies heavily on class names in object detection. Addressing these findings, we ablate our method and show that random attributes or meaningless characters yield approximately half the benefit compared to using correct or self-inferred attributes, indicating that our method's effectiveness stems from the proper use of contextual attributes instead of noise augmentation. Roth et al. (2023) also show that appending high-level class-independent descriptions (e.g., "food" for Food101, "place" for Places365) to prompts helps classification, which aligns with our findings.
+
+Prompt tuning. Another line of work that modifies prompts to improve CLIP's classification is prompt tuning, which optimizes the prefix characters of the prompts. Typical prompt tuning methods require labeled (Zhou et al., 2022b;a; Zhu et al., 2022; Derakhshani et al., 2023) or unlabeled downstream data (Huang et al., 2022; Mirza et al., 2023; Menghini et al., 2023), making them fall outside our scope of zero-shot (data-free) classification. They are also prone to overfitting the training dataset, whereas our method relies on general image attributes (e.g., illumination) shared by common datasets. On the other hand, Shu et al. (2022) use test-time prompt tuning that applies to zero-shot classification. Specifically, they generate multiple views for each test image and optimize the prompt to minimize the entropy of the model's prediction on these views. This method introduces several hyperparameters that require tuning on a labeled proxy validation set. In contrast, our method, depending on implementation, introduces either no additional hyperparameters or only one (temperature). Furthermore, our method is training-free and can work in the black-box setting.
+
+Reasoning and chain-of-thoughts. The inference process of our method resembles the reasoning or chain-of-thoughts in prompting LLMs (Wei et al., 2022; Yao et al., 2023), where the model is prompted to give some intermediate step results and then conditioning on them to give final results. However, CLIP itself cannot do step-wise reasoning out of the box, so our method manually prompts it through the reasoning process.
+
+# B IMAGE CAPTION EXAMPLES
+
+In the pertaining stage, the human-written caption for each image typically describes the visual object, encompassing its class and a few contextual attributes. We show some caption examples in Table 9, chosen from a similar dataset LAION-400M (Schuhmann et al., 2021), since the original pretraining dataset of CLIP is not made public. We can see that those captions not only describe class but also contextual attributes like color, style, and background.
+
+Table 9: Image caption examples from LAION-400M (comparable to CLIP's pretraining dataset).
+
+
Caption #1
Men's Classics Round Bracelets Watch in Grey
Caption #2
stock photo of gremlins - 3 d cartoon cute green gremlin monster -.JPG
Caption #3
Medium Size of Chair: Fabulous Mid Century Modern Chair Adalyn Accent In Red:
+
+# C HUMAN VISUAL PERCEPTION
+
+The classic neuroscience textbook Kandel et al. (2013) offers a modern view of human visual perception, presenting a significant difference from current zero-shot classification methods:
+
+"The brain analyzes a visual scene at three levels: low, intermediate, and high. At the lowest level, visual attributes such as local contrast, orientation, color, and movement are discriminated. The intermediate level involves analysis of the layout of scenes and of surface properties, parsing the visual image into surfaces and global contours, and distinguishing foreground from background. The highest level involves object recognition."
+
+"... the perceptual interpretation we make of any visual object depends not just on the properties of the stimulus but also on its context, on other features in the visual field."
+
+This perception process is hierarchical, cascaded, and context-dependent, differing from current zero-shot classification methods, which overlook contextual attributes. In this paper, we propose PerceptionCLIP to mimic human perception process.
+
+# D APPROXIMATING CONDITIONAL PROBABILITIES
+
+With the energy-function-like CLIP score
+
+$$
+\operatorname {C L I P} \left(y, z _ {1}, \dots , z _ {m}; x\right) \triangleq \left\langle \phi_ {I} (x), \quad \frac {\mathbb {E} \phi_ {T} \left(\alpha (y) \oplus \alpha \left(z _ {1}\right) \oplus \cdots \oplus \alpha \left(z _ {m}\right)\right)}{\| \mathbb {E} \phi_ {T} \left(\alpha (y) \oplus \alpha \left(z _ {1}\right) \oplus \cdots \oplus \alpha \left(z _ {m}\right)\right) \|} \right\rangle , \tag {6}
+$$
+
+we first approximate the joint conditional probability $p(y, z_1, \ldots, z_m|x)$ . It measures the likelihood of an object class and some contextual attributes occurring together given the image as
+
+$$
+p \left(y, z _ {1}, \dots , z _ {m} \mid x\right) \triangleq \frac {e ^ {\operatorname {C L I P} \left(y , z _ {1} , \dots , z _ {m} ; x\right)}}{\sum_ {y} \sum_ {z} e ^ {\operatorname {C L I P} \left(y , z _ {1} , \dots , z _ {m} ; x\right)}} \tag {7}
+$$
+
+which is essentially the normalization of the exponential of the CLIP score. Then, we derive the conditional probability $p(y|z_1,\dots ,z_m,x)$ , which measures the probability of an object class given both the image and the contextual attributes as
+
+$$
+\begin{array}{l} p (y | x, z _ {1}, \dots , z _ {m}) = \frac {p (y , z _ {1} , \dots , z _ {m} | x)}{p (z _ {1} , \dots , z _ {m} | x)} (8) \\ = \frac {p \left(y , z _ {1} , \dots , z _ {m} \mid x\right)}{\sum_ {y} p \left(y , z _ {1} , \dots , z _ {m} \mid x\right)} (9) \\ = \frac {e ^ {\operatorname {C L I P} \left(y , z _ {1} , \dots , z _ {m} ; x\right)}}{\sum_ {y} e ^ {\operatorname {C L I P} \left(y , z _ {1} , \dots , z _ {m} ; x\right)}} (10) \\ \end{array}
+$$
+
+using the definition of joint probability and the rules of conditional probability. Next, we approximate the conditional probability $p(z_{1},\ldots ,z_{m}|x)$ , which measures the likelihood of some contextual attributes given the image as
+
+$$
+\begin{array}{l} p \left(z _ {1}, \dots , z _ {m} \mid x\right) = \sum_ {y} p \left(y, z _ {1}, \dots , z _ {m} \mid x\right) (11) \\ = \frac {\sum_ {y} e ^ {\operatorname {C L I P} \left(y , z _ {1} , \dots , z _ {m} ; x\right)}}{\sum_ {z} \sum_ {y} e ^ {\operatorname {C L I P} \left(y , z _ {1} , \dots , z _ {m} ; x\right)}}. (12) \\ \end{array}
+$$
+
+It sums up the probabilities of contextual attributes appearing in each class to give a total probability of them appearing in the image. We named this method ClassAttr. Another simplified way, named PureAttr, ignores the classes and use
+
+$$
+p \left(z _ {1}, \dots , z _ {m} \mid x\right) \approx \frac {e ^ {\operatorname {C L I P} \left(z _ {1} , \dots , z _ {m} ; x\right)}}{\sum_ {z} e ^ {\operatorname {C L I P} \left(z _ {1} , \dots , z _ {m} ; x\right)}} \tag {13}
+$$
+
+to do the estimation. Here, we only consider the contextual attributes in the CLIP score with descriptions like "a photo of an object, {description of z}" where we use a word like "object" instead of a particular class, making the CLIP score class-agnostic. In our experiments, the first version occasionally outperformed the second, although the performance of the two is generally similar.
+
+# EXPERIMENTAL DETAILS
+
+Table 10: Summary of descriptions for different attributes used in Figure 3, Table 2 and Table 3. $z^{*}$ denotes the correct value of the contextual attribute, and $z_{wrong}$ denotes the wrong value of the contextual attribute. Ideally, each attribute has a distribution of text descriptions. Here, we use three descriptions and use the averaged text embeddings of them to calculate the CLIP score.
+
+
Attribute
α(y) ⊕ α(z*)
α(y) ⊕ α(zwrong)
vertical flip
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, upside-down."
"a photo of a {y}, upright."
"a photo of a {y}, the photo is upside-down."
"a photo of a {y}, the photo is upright."
90° rotation
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, rotated."
"a photo of a {y}, upright."
"a photo of a {y}, the photo is rotated."
"a photo of a {y}, the photo is upright."
elastic-transform
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, with distortion."
"a photo of a {y}, normal."
"a photo of a {y}, the photo is distorted."
"a photo of a {y}, the photo is normal."
color-invert
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, color-inverted."
"a photo of a {y}, normal."
"a photo of a {y}, the photo is color-inverted."
"a photo of a {y}, the photo is normal."
solarize
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, solarized."
"a photo of a {y}, normal."
"a photo of a {y}, the photo is solarized."
"a photo of a {y}, the photo is normal."
blur
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, blurred."
"a photo of a {y}, clear."
"a photo of a {y}, the photo is blurred."
"a photo of a {y}, the photo is clear."
grayscale
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, grayscale."
"a photo of a {y}, colorful."
"a photo of a {y}, the photo is in black and white."
"a photo of a {y}, the photo is colorful."
bright
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, bright."
"a photo of a {y}, dark."
"a photo of a {y}, the photo is bright."
"a photo of a {y}, the photo is dark."
noise
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, with noise."
"a photo of a {y}, clear."
"a photo of a {y}, the photo has noise."
"a photo of a {y}, the photo is clear."
snow
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, in the snow."
"a photo of a {y}, clear."
"a photo of a {y}, the photo is in the snow."
"a photo of a {y}, the photo is clear."
frost
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, in the frost."
"a photo of a {y}, clear."
"a photo of a {y}, the photo is in the frost."
"a photo of a {y}, the photo is clear."
fog
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, in the fog."
"a photo of a {y}, clear."
"a photo of a {y}, the photo is in the fog."
"a photo of a {y}, the photo is clear."
jpeg
"a photo of a {y}"
"a photo of a {y}"
"a photo of a {y}, in jpeg format."
"a photo of a {y}, in high resolution."
"a photo of a {y}, the photo is in jpeg format."
"a photo of a {y}, the photo is in high resolution."
+
+# E.1 DETAILS ON THE EVALUATION IN FIGURE 3 AND TABLE 2
+
+We do evaluation on the ImageNet dataset. Due to the lack of annotated contextual attributes, we consider some easily observable and adjustable attributes, including image orientation, illumination, etc. We first examine and confirm that most ImageNet images share the same attribute values, including upright orientation, natural illumination, and standard image quality. However, these default values are too trivial, making their textual descriptions unlikely to appear in the captions of the
+
+Table 11: Similarity score and classification accuracy on ImageNet test set. We apply a composition of two transformation functions on images, and use the composition of attributes' descriptions for text.
+
+
Attributes
Similarity (CLIP score × 100)
w/o z
w/ random z
w/ wrong z
w/ correct z
vertical flip + color-invert
25.39
28.23 (↑2.84)
26.28 (↑0.88)
30.26 (↑4.86)
grayscale + elastic-transform
26.66
30.55 (↑3.89)
26.48 (↓0.19)
32.15 (↑5.49)
Attributes
Accuracy (%)
w/o z
w/ random z
w/ wrong z
w/ correct z
vertical flip + color-invert
19.44
20.88 (↑1.44)
20.01 (↑0.57)
21.32 (↑1.88)
grayscale + elastic-transform
29.79
30.49 (↑0.70)
30.14 (↑0.35)
30.59 (↑0.80)
+
+pretraining data. Therefore, we then alter these attribute values through certain image transformations (e.g., vertical flipping), thus making the new attribute values have non-trivial descriptions. These new attribute values become part of the modified images' data generation process, for which we have ground-truth annotations.
+
+Contextual attributes and their descriptions. We separately apply thirteen image transformation functions (e.g., vertical flip) to all the ImageNet test images. Note that the last five transformations (i.e., noise, snow, frost, fog,.jpeg) are tested directly on the ImageNet-C dataset (Hendrycks & Dietterich, 2018), which contains the same images as in the ImageNet test set while images are corrupted with certain transformations. We use relatively strong strengths in those transformations, ensuring nonnegligible generative factors. This is also why CLIP has degraded performance on these corrupted data. Table 10 shows the descriptions we used in this evaluation. When we ignore the contextual attribute, we use a simple template, "a photo of a {class name}". When considering the contextual attribute, we test the cases using the correct attribute value (e.g., upside-down) with "a photo of a {class name}, upside-down." and the wrong attribute value (e.g., upright) with "a photo of a {class name}, upright.", respectively. For each contextual value, we use three descriptions to simulate the distribution of descriptions and average their embeddings as the text embedding to calculate the CLIP score.
+
+Randomized descriptions. To validate the effectiveness of contextual attributes, we also compare with the cases where we use random descriptions as proposed in Roth et al. (2023). We replace every word in \(\alpha(z^{*})\) with random characters while keeping the word length unchanged. For example, \(\alpha(y) \oplus \alpha(z_{random})\) of vertical flip contains three descriptions: "a photo of a \(\{y\}.", "a photo of a \{y\}\", iaYo5n0Dli7.", "a photo of a \(\{y\}\), 8g2, Me5tx, q1, 6Ud2ole94Ir."
+
+Additional results on the composition of contextual attributes. We perform the same evaluation while considering more than one contextual attribute. Table 11 shows the results. We draw the same conclusion that correct contextual attribute values lead to better image-text alignment and higher classification accuracy.
+
+Ablation on the increased similarities. The CLIP score measures the similarity between the image and the text prompt. In Figure 3, we observe that correctly matched image and attribute pairs provide higher CLIP scores for the ground-truth class than mismatched pairs using wrong or random contextual attributes. It indicates that incorporating correct contextual attributes yields the greatest benefit for the ground-truth class. Additionally, we delve into the impact of including these correct attributes on both the correct and incorrect classes. We calculate the increase in CLIP scores for class $y$ with $\Delta \mathrm{CLIP}(y) \triangleq \mathrm{CLIP}(y, z^*; x) - \mathrm{CLIP}_1(y; x)$ , and the increase in prediction probabilities for class $y$ with $\Delta p(y) \triangleq p(y|x, z^*) - p(y|x)$ .
+
+In Figure 5 (left), we compare the $\Delta \mathrm{CLIP}(y^{*})$ and $\Delta \mathrm{CLIP}(y_{\text{wrong}})$ , where the latter one is the average increase of the Top-K wrong classes. As expected, incorporating ground-truth attributes into text prompts results in increased scores for both correct and incorrect classes, and the correct class benefits more from this enhancement, as the accurate description of the class and the attribute, achieves a better alignment with the corresponding image. Figure 3 and 5 together validate that the
+
+
+Figure 5: The increase in (left) CLIP scores and the (right) prediction probabilities by incorporating the descriptions of the correct contextual attribute into the text prompts. We compare the increased CLIP scores and prediction probabilities for the ground-truth class $y^{*}$ , the Top-5 and Top-10 wrong classes. (left) Incorporating ground-truth attributes into text prompts results in increased CLIP scores for both correct and incorrect classes. This improvement is attributed to the enhanced alignment of the text prompts with the images, addressing previously overlooked contextual attributes. Notably, the CLIP score of the correct class benefits more from this enhancement for all the attributes considered. This is because the accurate description of the class, combined with the contextual attributes, achieves a more precise alignment with the corresponding image. (right) Therefore, the model is more likely to predict the correct class after being provided with the correct context description in the prompt.
+
+
+
+CLIP model understands the contextual attributes, and describing correct class and attributes yields higher similarity scores as described in Equation 4.
+
+In Figure 5 (right), we further compare the increase in the prediction probabilities for $\Delta p(y)$ and $\Delta p(y_{wrong})$ where the probability is calculated by applying softmax on CLIP scores and is used for the final classification. By incorporating correct context, the prediction probability of the correct class increased significantly, while the wrong classes got unchanged or even decreased probabilities. The predicted probability for the correct class increases by an average of $1.5\%$ . The predicted probabilities for top-5 and top-10 wrong classes decrease by an average of $0.07\%$ and $0.05\%$ . Such findings also explain the increased accuracy in Table 2 when incorporating the correct contextual attributes.
+
+# E.2 DETAILS ON THE EVALUATION IN TABLE 3
+
+In Table 3, we test whether CLIP can infer underlying contextual attributes by itself. In this experiment, we only apply transformations to half of the images from the ImageNet test set and use descriptions shown in Table 10. The task is to predict the correct contextual attribute's value, which is a binary classification task. For example, half images are upright, and half images are upside-down, and the goal is to classify the orientation of the images by CLIP. We evaluate two methods with two approximations of $p(z|x)$ in Table 1. Note that we do not intervene in the inference in this experiment.
+
+# E.3 DETAILS ON THE VISUALIZATION
+
+We consider some spatially separable spurious attributes (also known as spurious features), such as backgrounds, and annotate core regions and spurious regions with the help of Segment Anything (Kirillov et al., 2023). Then, we use Grad-CAM to generate a heatmap for salient pixels. first, we use a function that computes CLIP's similarity score for each class $\mathrm{CLIP}(y,z^{*};x)$ and apply softmax on top of these values. Then, we only consider the scalar value corresponding to the ground-truth class which is essentially the conditional probability $p(y^{*}|x,z^{*})$ . We compute the gradients using the layer before the final attention block of ViT-L/14 as suggested in a popular explainability library. Intuitively, the regions where the salient pixels are located are the regions the model pays attention
+
+Table 13: Summary of contextual attributes and their value descriptions used in ImageNet-related datasets.
+
+
+
+to when making predictions, and we hope that the model focuses as much as possible on regions of core features (i.e., features with causal correlation to classes). Note that, adding a spurious attribute's description in this evaluation won't really make the model look at it when classifying because all the descriptions (for all classes) will contain that attribute.
+
+To compute the ratio between the usage of core and spurious regions in prediction, we: (1) run Segment Anything (Kirillov et al., 2023) and select a segmentation mask for the core region of each image (e.g., the bird or the leopard), then consider the rest (non-core) regions as spurious; (2) use the masks to identify the core and spurious pixel values from the Grad-CAMs and compute the mean pixel value for both of these regions; (3) normalize the numbers and show them as two percentages in a bar plot for each Grad-CAM.
+
+In Table 12, we quantitatively evaluate the model reliance on core feature and spurious feature. We use ViT-B/32 as the image encoder and evaluate it on the Waterbirds test set. The dataset contains images of land birds and water birds on land or on the water. We use the same method introduced above to calculate the ratio of core versus spurious through Grad-CAM. We use "on land" and "on water" to describe the context (e.g., background). We compare the correct context with no context, wrong context, and random context where the random context is
+
+Table 12: The average saliency $(\%)$ of the core feature and the spurious feature evaluated on the Waterbirds test set.
+
+
Core (↑)
Spurious (↓)
no context
62.8
37.2
wrong context
62.6
37.4
random context
62.3
37.7
correct context
66.3
33.7
+
+the random string that replaces the correct context while keeping the description length unchanged. Results in Table 12 also indicate that, by incorporating the correct context, the model relies more on the core feature when doing the classification.
+
+# E.4 DETAILS ON THE EXPERIMENTS IN SECTION 7
+
+In Table 4, we test PerceptionCLIP on ImageNet and its OOD datasets. We first use GPT-4 to summarize the contextual attributes involved in the 80 hand-crafted templates (Radford et al., 2021), then add three contextual attributes (orientation, background, tool) to the testing bed. Table 13 shows the values of every contextual attribute. We use multiple descriptions to describe every attribute value, and use their average text embedding of the full sentence in the implementation. When considering a single attribute, we use a main template, "a photo of a {class name}" and concatenate it with the description of each attribute value. When considering the composition of attributes, we generate combinations from the values across all attributes. Such simple concatenation of descriptions works well, probably because the pre-trained CLIP model behaves like a bag-of-words (Yuksekgonul et al., 2023). Future works could explore better ways of composing text prompts.
+
+Table 14 and 15 list the contextual attributes used in Table 5, 7 and 8. Attributes and their values are manually designed based on our priors of datasets. Experiments on Waterbirds and CelebA are conducted on their training set.
+
+Table 14: Datasets, domain templates and contextual attributes used in Table 5
+
+
Dataset
Domain Template
Attributes
CUB200
"a photo of a {y}, a type of bird"
size, background, condition
EuroSAT
"a centered satellite photo of {y}"
condition, source
Places365
"a photo of a {y}"
background, quality, condition
Flowers102
"a photo of a {y}", a type of flower"
background, illumination, quality, condition
Food101
"a photo of a {y}", a type of food"
cuisines, condition
Oxford Pets
"a photo of a {y}", a type of pet"
species, background, pose, interaction
+
+Table 15: Domain templates, contextual attributes and their descriptions used in Table 7 and Table 8
+
+
Dataset
Domain Template
Attributes
Values
Waterbirds
"a photo of a {y}"
background
on land, on water
\( background^+ \)
+ in forest, in sky, on street, on grass, on tree, with flowers, on beach, with human, on a branch
CelebA
"a photo of a celebrity with {y}"
gender
female, male
age
young, old
race
white skin, dark skin, asian
+
+All the above experiments use ClassAttr version of PerceptionCLIP and the intervention by setting a temperature $\tau$ in the first step (i.e., inferring contextual attributes). We found that mildly smoothing the estimation by setting $\tau$ to be 3 or 5 usually has the best performance. When we do not have a good prior of the temperature, just setting it to 1 can also have relatively good results. The reported numbers in our experiments use a temperature selected from $\{1,3,5,10\}$ that performs the best on the particular dataset.
+
+Ablation studies. In Table 4 and 5, by incorporating contextual attributes, PerceptionCLIP improves the zero-shot classification accuracy in all cases. Adding descriptions of contextual attributes to text prompts has two effects: 1) it introduces more tokens to the text prompt, 2) and the tokens describe the contextual attributes. To figure out which effect causes the improvement, we conduct ablation studies by replacing the descriptions of contextual attributes with the same-length random strings. In Table 16, we do ablation studies on the best attribute composition for all datasets. In Table 17, we keep the domain template but randomize other contextual attributes. For every dataset, we run 5 times with random seeds and report the mean and variance. Results show that adding more tokens can improve the accuracy marginally in most cases, but can also decrease the accuracy as in the case of EuroSAT and Oxford Pets. The improvement brought by adding random tokens might be a result of augmentation (Jain et al., 2023) or register (Darcet et al., 2023). More importantly, there is a significant performance gap between using the random strings and the descriptions of contextual attributes, suggesting that the improvement provided by our method primarily stems from the incorporation of contextual attributes.
+
+Table 16: Ablation study on ImageNet and related datasets.
+
+
Attributes
ImageNet
ImageNetV2
ImageNet-R
ImageNet-A
ImageNet-Sketch
CLIP
66.72
60.85
73.99
47.80
46.16
PerceptionCLIP
68.80
62.32
78.38
51.39
49.10
ablation w/ random
67.59 ± 0.27
61.27 ± 0.11
75.53 ± 0.28
49.74 ± 0.37
47.63 ± 0.23
+
+# F ADDITIONAL RESULTS AND ANALYSIS
+
+# F.1 COMPUTATIONAL COMPLEXITY.
+
+Similar to the implementation of prompt ensembling, we pre-compute the embeddings of all class and contextual attribute combinations, and then use these pre-computed embeddings in each inference process. Since we use the average of text embeddings when there are multiple descriptions for
+
+Table 17: Ablation study on different data domains.
+
+
CUB200
EuroSAT
Places365
Flowers102
Food101
Oxford Pets
domain template
56.32
54.94
38.93
70.99
88.72
89.04
+ Z
57.08
59.23
40.92
72.86
89.19
90.38
+ random
56.68 ± 0.17
53.58 ± 2.34
39.98 ± 0.37
71.41 ± 0.45
88.89 ± 0.08
88.35 ± 0.45
+
+Table 18: Performance of PerceptionCLIP using two order types in the attribute concatenation.
+
+
Order
ImageNet
ImageNetV2
ImageNet-R
ImageNet-A
ImageNet-Sketch
forward
68.71
62.32
78.25
51.39
48.97
backward
68.71
62.15
78.38
51.21
49.10
+
+one value, our method needs multiple forward passes to get the text embeddings, causing a longer preparation time. Since these computations are one-time, the time complexity during inference is unaffected by the number of contextual attributes. Compared to the basic method, which stores $O(|\mathcal{Y}|)$ embedding vectors, this implementation needs to store $O(|\mathcal{Y}|\times |\mathcal{Z}_1|\times \dots \times |\mathcal{Z}_m|)$ embedding vectors. The space complexity limits the number of contextual attributes considered in practice. We will consider using beam search to only reserve top-k attributes to reduce the space storage requirement in future work.
+
+# F.2 AN ANALYSIS OF THE ORDER IN ATTRIBUTE COMBINATION
+
+When considering multiple contextual attributes, we concatenate their textual descriptions. An interesting question is whether their order in the text affects the performance. In Table 18, we test two order types when combining the top four attributes in the ImageNet experiments. The forward direction ordering attributes from the most powerful to the last. The backward direction does the opposite ordering. Unfortunately, we do not observe a good way of ordering consistently outperforming others. We suspect that it is due to CLIP's sensitivity to the text, and the direct concatenation may not be the best way of combining attributes to approximate the distributions of captions in the pertaining stage.
+
+# F.3 MORE VISUALIZATIONS
+
+We show more visualizations in Figure 6 and 7. Figure 6 shows images from the ImageNet dataset with the ground-truth class leopard. Figure 7 shows images from the Waterbirds dataset with the ground-truth class waterbird. Grad-CAMs show that CLIP relies more on core features when conditioned on the correct contextual attributes (e.g., background) for classification. The reliance on core features also improves model interpretability.
+
+
+Figure 6: Leopard images from ImageNet dataset. Visualization of the original image, the regions of core and spurious features, and the Grad-CAMs obtained using no, incorrect, and ground-truth contextual attributes.
+
+
+Figure 7: Waterbird images from Waterbirds dataset. Visualization of the original image, the regions of core and spurious features, and the Grad-CAMs obtained using no, incorrect, and ground-truth contextual attributes.
+
+# F.4 DISCOVERING CONTEXTUAL ATTRIBUTES BY LLMS
+
+In this section, we provide an example of how to use GPT-4 (OpenAI, 2023) to generate contextual attributes and their descriptions automatically. We take EuroSAT dataset as an example. There are three steps:
+
+1. Given a dataset (e.g., EuroSAT) with a specific domain, we retrieve similar images (e.g., satellite images) from a large image+text dataset LAION-400M $^{2}$ .
+2. We crawl the captions and randomly sample a limited number of these captions (e.g., 200).
+3. We provide GPT-4 with the captions and the information of the dataset, and ask it to extract contextual attributes using Prompt 1.
+
+Table 19 shows the contextual attributes discovered by GPT from captions. Adding those attributes to the domain template, we improve the accuracy from $51.44\%$ to $59.20\%$ (with intervention $\tau = 5$ ), which is comparable to manually designed ones. However, we found that the attributes identified by GPT are not always appropriate, possibly because of the gap between the retrieved images and our dataset. Future work could involve using image-based searches to find more similar images rather than relying on language-based searches.
+
+Prompt 1: An example prompt for discovering contextual attributes and their descriptions from example captions for EuroSAT dataset. Here we use one description for every attribute value for simplicity.
+
+You are a helpful assistant who helps me summarize my text captions. I have a dataset of image-caption pairs, where each caption briefly describes the image. I need to extract some attributes from these textual descriptions that contribute to the data generation process of the image.
+
+For example, from the three descriptions ["A black dog on the green grass ", "A red car on the road in a bright environment", "A white refrigerator"], you can summarize the "background", "color", "illumination" as three attributes, with possible values ["grass field ", "road", ""]}, ["black", "green", "red", "white", ""]], ["bright", "dark", ""] respectively. Note that they each have an empty value because the human annotators may choose not to mention them in the captions.
+
+# Note:
+
+1. The number of potential values for each factor should not exceed 3, so you should extract the most representative values.
+2. You should summarize at most 5 attributes, covering the most representative attributes in the provided captions.
+3. I have a list of labels for these images, namely ['annual crop land', 'forest', 'brushland or shrubland', 'highway or road', 'industrial buildings or commercial buildings', 'pasture land', 'permanent crop land', 'residential buildings or homes or apartments', 'river', 'lake or sea'], The attributes you summarized should not overlap with the concepts of these labels, and the values you summarized should not include any of these labels. For example, since "river" is in my label set, your summarized values should not include "river" for any attributes.
+4. The set of all values for all attributes you summarized should not overlap.
+
+I need your summary to have the following format:
+
+```javascript
+summerized Factors $=$ {"background": ["grass",
+```
+
+```txt
+"road",
+],
+"color": [ "black", "green", "red", "white", ], "illumination": [ "bright", "dark", "" ]
+}
+Here are the captions:
+//200 captions
+```
+
+Table 19: Contextual attributes and their value descriptions for EuroSAT generated by GPT-4.
+
+
Attributes
Value Descriptions
source
", "Yandex satellite", "NASA", "Google Maps"
geographical feature
", "island", "ul.", "street"
image type
", "satellite", "aerial", "map"
natural phenomenon
", "hurricane", "earthquake", "deforestation"
structure type
", "residential", "commercial", "fortress"
+
+# G IMPACT, LIMITATION AND FUTURE WORK
+
+In this paper, we propose PerceptionCLIP, a zero-shot classification method for CLIP that emulates the human visual perception. By doing class inference conditioned on self-inferred contextual attributes, it achieves improved generalization, less reliance on spurious features, and improved interpretability. Along the path of proposing PerceptionCLIP, we show CLIP's understanding of object attributes beyond common category features. Our work indicates that CLIP, as a model capable of communicating with humans via natural language, can achieve things that traditional classifiers find challenging. Hence, it still has great potential in zero-shot classification and even broader tasks like image generation. Furthermore, this capability complements the study of neuroscience, enabling a better transition of the latter's research findings into practical use.
+
+Limitations. One limitation of PerceptionCLIP is its sensitivity to text description perturbations: using different synonyms to describe the same attribute sometimes has non-trivial effects on the results. Although using more descriptions to describe an attribute value (Figure 2) alleviates this sensitivity, this issue is more intrinsic to CLIP and still persists. Future work may overcome this limitation by replacing CLIP with other vision-language models or improving CLIP's sensitivity to textual perturbations (e.g., through training-time text augmentation (Fan et al., 2023)). Another limitation of PerceptionCLIP is the need to design a set of contextual attributes. While this process provides a way to integrate human prior knowledge, it also requires additional effort, especially when we aim to cover many attributes. Currently, we use caption retrieval from the LAION-400M dataset and the in-context learning ability of large language models to semi-automate the construction process. In the future, our goal is to automate this process fully. In our paper, we show that directly concatenating multiple attributes' descriptions is a simple and effective way to generate the image's description. Future work can explore more effective and efficient approaches for it.
+
+Ethical Statement. In this paper, we use the CelebA dataset, employing descriptors of gender and race to enhance classification accuracy. We acknowledge the sensitivity of these attributes in societal and ethical contexts. Our use of gender and race is strictly as example contextual attributes within our analytical framework, and not as endorsements of any form of racial or gender-based bias. The
+
+inclusion of these attributes is solely for the purpose of exploring and improving the performance of zero-shot classification, without attributing any significance beyond their technical utility. We are committed to maintaining ethical principles in our research and upholding respect and diversity in all aspects of our work.
\ No newline at end of file
diff --git a/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/images.zip b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..370994b6eb7dad4262ef7b84892af643f1ba1765
--- /dev/null
+++ b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37baef514e744f614eae38b70be8d9c4fc64c61777dd3ec015e3446a14b04145
+size 1391696
diff --git a/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/layout.json b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..4d65cd2d5de18aebf3b3446243d3a2398a7b3992
--- /dev/null
+++ b/perceptionclipvisualclassificationbyinferringandconditioningoncontexts/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77f892a6978c48b0fcf97468552b1171f82ca3ec081c0c44849a8451da53fe38
+size 669084
diff --git a/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_content_list.json b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..19de5a035cea37709ccef009a738fa075bf3f862
--- /dev/null
+++ b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:714b6fb8ea7e50e65533beaa0eface682014fa95b16fff4e9a235ff663de1bce
+size 100845
diff --git a/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_model.json b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..82db652d0a52377583790e3fd84c09b786a269b6
--- /dev/null
+++ b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e4d573129169a612516cf04ac9baf59a08a93f6f617e27cd3841cfbada8d8f6
+size 124202
diff --git a/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_origin.pdf b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..63b0abfc06480aeb974130635d9b50a3da20d5ec
--- /dev/null
+++ b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/7b79d71f-5fde-405c-8b36-ac7d88561dd4_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fbda6833e9612eb8a521cb1706392c686c5017f5be2ee9a2576a06bfdb65902b
+size 4430928
diff --git a/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/full.md b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7235339c9dc48918bc1285733fa45bc2ffc4dcdc
--- /dev/null
+++ b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/full.md
@@ -0,0 +1,409 @@
+# PERCEPTUAL GROUPTOKENIZER: BUILDING PERCEPTION WITH ITERATIVE GROUPING
+
+Zhiwei Deng, Ting Chen, and Yang Li
+
+Google Research and Deepmind
+
+# ABSTRACT
+
+Human visual recognition system shows astonishing capability of compressing visual information into a set of tokens containing rich representations without label supervision. One critical driving principle behind it is perceptual grouping (Palmer, 2002; Wagemans et al., 2012; Herzog, 2018). Despite being widely used in computer vision in the early 2010s, it remains a mystery whether perceptual grouping can be leveraged to derive a neural visual recognition backbone that generates as powerful representations. In this paper, we propose the Perceptual Group Tokenizer, a model that entirely relies on grouping operations to extract visual features and perform self-supervised representation learning, where a series of grouping operations are used to iteratively hypothesize the context for pixels or superpixels to refine feature representations. We show that the proposed model can achieve competitive performance compared to state-of-the-art vision architectures, and inherits desirable properties including adaptive computation without re-training, and interpretability. Specifically, Perceptual Group Tokenizer achieves $80.3\%$ on ImageNet-1K self-supervised learning benchmark with linear probe evaluation, establishing a new milestone for this paradigm.
+
+# 1 INTRODUCTION
+
+Visual recognition mechanisms matter. The pursuit of advanced vision algorithms that encode an image to meaningful representations dates back to late 80s, with two paradigms marking the progress over the past 40 years: feature detection (LeCun et al., 1998; Lowe, 2004; He et al., 2016; Liu et al., 2022b) and perceptual grouping (Shi & Malik, 2000; Uijlings et al., 2013; Arbeláez et al., 2014), where feature detection focuses on specific distinctive patterns, while perceptual grouping considers similarities among all pixels to produce a compact set of tokens as proxies for image representation. Ever since the surge of deep learning, feature detection has predominated the vision field and become the main principle behind representation learning backbone designs and made impressive progress (Simonyan & Zisserman, 2014; Szegedy et al., 2015; He et al., 2016; Chen et al., 2017; Tan & Le, 2019; Qi et al., 2020; Liu et al., 2022b). The success of the former paradigm is, although striking, raising the question of whether perceptual grouping can also be used as the driving principle to construct a visual recognition model.
+
+Different from detecting and selecting distinctive features, perceptual grouping emphasizes on learning feature space where similarity of all pixels can be effectively measured (Uijlings et al., 2013; Arbeláez et al., 2014). With such a feature space, semantically meaningful objects and regions can be easily discovered with a simple grouping algorithm and used as a compact set to represent an image (Uijlings et al., 2013; Arbeláez et al., 2014; Locatello et al., 2020). This indicates that image understanding is essentially "pixel space tokenization", and being able to produce generalizable feature representations is tightly connected to whether the correct contextual pixels are binned together (Hinton, 2022; Culp et al., 2022).
+
+The intriguing properties of perceptual grouping, including natural object discovery, deep connections with information theory and compression (Ma et al., 2007), and association with biological vision system (Herzog, 2018) or cognitive science explanations (Palmer, 2002), have led to a strong revival recently under deep learning frameworks (Locatello et al., 2020; Elsayed et al., 2022; Xu et al., 2022; Wu et al., 2022; Biza et al., 2023). However, these methods are either still focusing on small or toy datasets (Locatello et al., 2020; Chang et al., 2022; Biza et al., 2023), or used as an auxiliary component (Xu et al., 2022; Ke & Yu, 2022; Seitzer et al., 2022) to strengthen exist-
+
+
+Figure 1: Perceptual Group Tokenizer is entirely driven by grouping operations to perform representation learning. Group tokens (discovered objects) are shown above. See more in the appendix.
+
+ing vision architectures for increased interpretability. Whether perceptual grouping can be used to build models and learn representations that are as informative and expressive as those learned by state-of-the-art vision architectures remains an open question.
+
+In this paper, we propose Perceptual Group Tokenizer, a model trained under a self-supervised learning framework, which builds visual representation entirely based on perceptual grouping operations. Given an image, the core of our model is to understand each pixel or patch through hypothesizing its contexts with grouping operations. Starting from given input patches, the grouping operation performs an iterative binding process onto a set of randomly sampled group tokens to determine the affinity groups based on similarities. The group tokens are then used as hypothesized contexts to refine the feature representation for the image. We show that applying this simple principle can already produce expressive representations and works well with self-supervised pretraining on a large vision dataset.
+
+The grouping operation is also closely related to self-attention, a highly popular method commonly used in modern vision backbones. We build connection between the proposed grouping operation and self-attention and show that, if group tokens are treated as communication channels, self attention can potentially automatically emerge during learning processes as a special case, while the grouping operation can produce even richer interactions among tokens. Under this viewpoint, ViT (Dosovitskiy et al., 2020) can be considered as a grouping backbone, with a fixed number of grouping slots equal to the number of input tokens, and the binding is achieved through stacking more than one layer with non-shared weights. This provides one explanation on why grouping mechanism can be effective on visual representation learning and has the potential to be a promising competitive paradigm for vision architecture designs.
+
+The primary contribution of this work is proposing a new architecture derived purely by perceptual grouping that achieves competitive performance compared to other state-of-the-art architectures on self-supervised learning benchmarks, contributing to a new paradigm of developing vision architectures. The model has several key differences and advantages over ViT, including (1) explicit separating out the "group token" concept to allow for automatic image parsing and flexible customization on the number of groups without being bound to the number of patches; (2) much less peak memory usage during inference time given the same number of input tokens; (3) adaptive computation without re-training the model, leading to flexible usage according to domains and computes.
+
+# 2 RELATED WORKS
+
+Vision architectures. There are two main frameworks for vision backbones. The first framework is Convolutioinal neural networks, which rely on local filters, sliding windows and translational equivariance to perform representation learning. Since the introduction of ConvNets in 1980s, ConvNet was repopularized by AlexNet (Krizhevsky et al., 2012). The line of ConvNet is a classical inheritance from traditional feature detection methods (Lowe, 2004; Dalal & Triggs, 2005; Rosten et al., 2008), where instead of hand crafting features, an overcomplete set of filters are automatically learned to obtain high-response regions. The object understanding is built along the depth axis (Simonyan & Zisserman, 2014; Szegedy et al., 2015; He et al., 2016), with early layers capturing low-level parts and higher-level layers producing object structure representations (Zeiler & Fergus, 2014; Zhou et al., 2014; Yosinski et al., 2015; Bau et al., 2017). In the feature detection framework,
+
+not every pixel is worth being used depending on particular tasks, leading to difficulty in obtaining representation for each pixel.
+
+Recently, Vision Transformer (ViT) (Dosovitskiy et al., 2020), a second vision backbone framework, shows impressive performance and has surpassed ConvNet on visual recognition. The core of ViT is the iterative applying of self-attention operations (Vaswani et al., 2017; Dosovitskiy et al., 2020). A direct usage of ViT on small patches (thus a high-resolution grid) is extremely computationally expensive due to its associated quadratic cost. Therefore, a common practice is often partitioning the image into large non-overlapping patches (Dosovitskiy et al., 2020; Touvron et al., 2021), or constrain the operation to local regions (Liu et al., 2021).
+
+Self-supervised learning. The field of representation learning has seen significant interest in self-supervised learning during the past few years. The main evaluation results using linear probe on ImageNet benchmarks is approaching the results obtained by supervised learning (Oquab et al., 2023). Contrastive representation learning is the early method that shows promising results (Oord et al., 2018; Chen et al., 2020a; Tian et al., 2020). BYOL (Grill et al., 2020) and DINO (Caron et al., 2021) propose to use a moving average target of an online network to perform self representation matching. Masked image modeling also shows to be effective on representation learning, where the masking is either at the pixel level (He et al., 2022) or the learned codebook level (Bao et al., 2021).
+
+Object discovery. The perceptual grouping is essentially performing "object and stuff" discovery in the pixel space. It has broad connections with the early works in computer vision (Shi & Malik, 2000; Uijlings et al., 2013; Levinshtein et al., 2013; Arbeláez et al., 2014; Pont-Tuset et al., 2016), the recent progress on object-centric representation (Burgess et al., 2019; Locatello et al., 2020; Chang et al., 2022; Hinton, 2022; Henaff et al., 2022; Culp et al., 2022; Elsayed et al., 2022), and biological or neural mechanisms on perceptual grouping (Palmer, 2002; Wagemans et al., 2012; Herzog, 2018; Kim et al., 2019). Despite the early popularity of perceptual grouping methods on various computer vision tasks (Shi & Malik, 2000; Uijlings et al., 2013; Levinshtein et al., 2013; Krahenbuhl & Koltun, 2011), it has not attracted significant attention until several recent works that apply it as a side component on top of another main backbone (Seitzer et al., 2022; Liu et al., 2022a; Xu et al., 2022; Ke & Yu, 2022). Some relevant works demonstrate alternative possibilities in architecture design, but only uses cross attention without refining the patch feature space (Jaegle et al., 2021), or apply it on diffusion tasks (Jabri et al., 2022). Other methods also attempt to use ad-hoc sparsification methods on top of ViT (Rao et al., 2021; Yin et al., 2022; Bolya et al., 2023) for efficiency and are orthogonal to our work. A most related work (Ma et al., 2023) focuses on supervised learning and relies on fixed-center pooling and less standard operations. In our proposed model, we adopt a design as ViT except for self attention, and highlight several key technical contributions, including multi-grouping with multi-seeding, adaptive computation without re-training, and other design choices for self-supervised representation learning.
+
+# 3 MODELS
+
+In this section, we introduce Perceptual Group Tokenizer (PGT), a visual recognition architecture entirely driven by perceptual grouping principles. We discuss the core operations for grouping in section 3.1, the building blocks and network architectures in section 3.2, the loss function used for self-supervised learning in section 3.3, and the connections with other models in section 3.4.
+
+# 3.1 PERCEPTUAL GROUPING
+
+We start with introducing notations for our method. Given an image $\pmb{x} \in \mathbb{R}^{H \times W \times C}$ , we first reshape it as a sequence of small patches1. Each patch $\pmb{x}_p \in \mathbb{R}^{h \times w \times c}$ has spatial shape $h \times w$ , where $h \ll H$ and $w \ll W$ , leading to $N = \frac{HW}{hw}$ number of patches per image. To represent a patch, we embed it into a high-dimensional vector $\pmb{h} \in \mathbb{R}^d$ . The set of embedded tokens $\{h_i\}^N$ is referred to as input tokens in later parts, and used as inputs for the following grouping blocks.
+
+Feature refinement through hypothesizing contexts. Individual pixels do not have meanings without putting it into contexts. At a high level, image understanding or feature learning is equivalent to binding the correct contextual pixels at all locations. The core idea of our model is to generate many (e.g. over-complete w.r.t number of objects in the image) hypothesized contexts and use the
+
+
+Figure 2: Perceptual Group Tokenizer takes in a sequence of patches (or pixels), generates high-dimensional embedding vectors for all patches, then them passes through a series of grouping layers to refine the embedding vectors as feature representations. Each grouping layer performs $K$ rounds of binding from input tokens to group tokens. To consider various grouping possibilities, multiple grouping heads are adopted. Each group token provides a useful context for input tokens for feature refinement. The final output of the model contains refined input token, group tokens, and assignments between input tokens and groups tokens.
+
+hypothesized contexts as cues to refine the feature representation of each patch. This process is achieved through a grouping module. Given input tokens $\{h_i\}^N$ , the grouping module starts from a set of random samples (referred as group tokens) from a random distribution, then performs binding process to aggregate information from input tokens to the group tokens, and ends up with a set of group tokens $c^* = \{c_j^*\}_{j=1}^M$ representing hypothesized contexts among input tokens. The relation between $h_i$ and $c_j$ is soft assignment, indicating how likely an input token belongs to that context. Note that there are often various ways of generating groupings for an image, e.g. different semantics, colors, textures, etc., we propose the "multi-grouping operation" to hypothesize rich contexts for tokens. The overall model is shown in figure 2.
+
+Multi-grouping operation. The building block of our model is the multi-grouping operation $\mathcal{G}$ , which contains multiple heads to perform the binding process in parallel. This design encourages the model to consider multiple ways of generating groups under different projection spaces. Each head owns a separate Gaussian distribution with learnable means and variance, similar to (Kingma & Welling, 2013; Locatello et al., 2020). Starting from a set of randomly sampled initial group tokens $c_{\mathrm{HEAD}}^{(0)} \sim p_{\mathrm{INIT}}(\cdot)$ , the grouping operation uses doubly normalized attention weights to aggregate information from $h$ , and the produced group tokens $c_{\mathrm{HEAD}}^{(1)}$ are used for the next round binding. The attention normalization and feature projection are performed in all heads separately.
+
+$$
+\boldsymbol {c} _ {\text {H E A D}} ^ {(1)} = \mathcal {G} \left(\boldsymbol {c} _ {\text {H E A D}} ^ {(0)}, \boldsymbol {h}; \theta\right) \tag {1}
+$$
+
+··
+
+$$
+\boldsymbol {c} _ {\text {H E A D}} ^ {*} = \boldsymbol {c} _ {\text {H E A D}} ^ {(K)} = \mathcal {G} \left(\boldsymbol {c} _ {\text {H E A D}} ^ {(K - 1)}, \boldsymbol {h}; \theta\right) \tag {2}
+$$
+
+where after $\mathrm{K}$ steps the final group tokens $c^{*} = c^{(K)}$ is obtained, and $\theta$ is learnable parameters in $\mathcal{G}$ . The grouping operator is summarized in algorithm 1.
+
+The sampling distribution $p_{\mathrm{INIT}}(\cdot)$ for initializing group tokens $c_{\mathrm{HEAD}}^{(0)}$ needs to be lightweight. We explore two variations: (1) Gaussian distribution $p(\pmb{\mu}_{\mathrm{HEAD}}, \pmb{\sigma}_{\mathrm{HEAD}})$ with learnable means and variance, and a one-step normalizing flow module that transforms a unit Gaussian noise to a sample that follows more complex distributions. More details can be found in the appendix in section A.1
+
+Implicit differentiation. The iterative grouping process unrolls $K$ steps per operation and leads to heavy burden in the training computation graph. Instead of explicitly backpropagating through the unrolled graph, we follow (Chang et al., 2022) and treat the multi-grouping process as a fixed point iteration per head. The gradient in the backpropagation is approximated using first-order Neumann series, which can be simply achieved by detaching the output before the final iteration.
+
+# 3.2 NETWORK ARCHITECTURE
+
+Similar to standard ViT, our model refines the hidden representation $h$ using $L$ model layers. We use $h^l$ to denote the representation after each layer, and explain the design in this section.
+
+Algorithm 1 Multi-grouping operation using $\mathcal{G}$
+```python
+def multi_grouping(h_key, h_value, steps, num_tokens, num_heads):
+ ''' Input tensors:
+ h_key and h_value are projected multi-head tensors with shape [num_heads x N x d].
+ ''' # Initial M group tokens.
+group_tokens = sampling_distribution(ntsamples=num_tokens, choice='Gaussian') # or 'Flow'
+group_tokens = group_tokens.reshape(num_heads, num_tokens, d) # [num_heads x M x d]
+# Binding process.
+for step in range(steps):
+ # Implicit differentiation.
+if step == steps - 1:
+ group_tokens = stop_gradient(group_tokens)
+ ''' The following is a one-step grouping operation. ''' # Attention operation for group assignment.
+attn_matrix = attention(group_tokens, h_key) # [num_heads x N x M]
+attn_matrix /= attn_matrix.sum(-2, keep_dim=True)
+h Updates = einsum("hij,hid->hjd", attn_matrix, h_value) # [num_heads x M x d]
+group_tokens = gru_cell(h Updates, group_tokens)
+# Grouped mlp/layernorm performs independent mlp/layernorm for each head.
+group_tokens = grouped_mlp(grouped_layer_norm(group_tokens)) + group_tokens
+return group_tokens
+```
+
+Grouping layer. Each grouping layer takes in $h^{l-1}$ as input, and uses the grouping operation in equation 1 to generate group tokens $c_{\mathrm{HEAD}}^* = \{c_{j,\mathrm{HEAD}}^*\}_{j=1}^M$ . To use the group tokens to provide context for each $h_i^{l-1}$ , we perform another attention operation to obtain the attention matrix (only normalized over group token axis) $A \in \mathbb{R}^{N \times M}$ representing the assignment from input tokens to group tokens, and aggregate the feature back to the input token space:
+
+$$
+\boldsymbol {h} _ {\text {H E A D}} ^ {l} = \boldsymbol {A} \left[ \boldsymbol {c} _ {1, \text {H E A D}} ^ {*}; \boldsymbol {c} _ {2, \text {H E A D}} ^ {*}; \dots ; \boldsymbol {c} _ {M, \text {H E A D}} ^ {*} \right] \tag {3}
+$$
+
+$$
+\boldsymbol {h} ^ {l} = \operatorname {L i n e a r} \left(\left[ \boldsymbol {h} _ {\text {H E A D} _ {1}} ^ {l}; \dots \boldsymbol {h} _ {\text {H E A D} _ {H}} ^ {l} \right]\right) \tag {4}
+$$
+
+$$
+\boldsymbol {h} ^ {l} = \boldsymbol {h} ^ {l - 1} + \operatorname {M L P} (\operatorname {L N} (\boldsymbol {h} ^ {l})) \tag {5}
+$$
+
+This layer definition follows the standard ViT layer as close as possible, where features from each head are aggregated through concatenation and a linear layer transformation. Each token $h$ is further refined using a follow up multi-layer perceptron.
+
+Grouping blocks. Similar to previous architecture designs (He et al., 2016; Liu et al., 2021). we define blocks for the model. One block contains multiple grouping layers that share the same hyperparameters setups, i.e. the number of group tokens, and group token dimensions. The full model contains three grouping blocks. This increases the flexibility when exploring model design spaces.
+
+# 3.3 SELF-SUPERVISION LOSS
+
+We strictly follow the student-teacher self-supervision loss (Caron et al., 2021; Oquab et al., 2023), and use a moving average of online network (student model) as the teacher model to perform representation learning. To summarize group tokens output from the final layer, we use one multi-head attention layer with a learnable token to attend to all group tokens. The produced single vector is treated as the feature representation for the image and is input to the loss function.
+
+# 3.4 DISCUSSION
+
+Our proposed model, perceptual group tokenizer, does not contain self-attention operations and purely relies on grouping operations. In this section, we link the grouping process to several techniques and discuss the rationale on why this model can be effective on representation learning.
+
+Group tokens as "communication channels". The core of feature representation learning is how information is exchanged among pixels. In perceptual grouping backbones, we can consider the set of group tokens as communication
+
+
+Figure 3: Operation comparison.
+
+channels, where information from different input tokens are aggregated in various ways. Each group token represents a high-order channel that links input tokens with high affinity under certain projected space to exchange information among them. As a thought experiment, if each input token is
+
+solely assigned to a different group token (given enough group tokens), then the perceptual grouping layer is equivalent to one self attention layer (up to some engineering design difference). While self attention layers mainly rely on pairwise communications, grouping operation, hypothetically, can automatically learn and emerge both pairwise and higher-order information exchange through the group token communication channels. This can also be linked to traditional factor graphs in probabilistic graphical models. Through the lens of that, grouping is forming factor nodes automatically through the learning processes. With a properly designed loss and grouping operation, it has the potential to be more effective if adopting a per-layer comparison with self-attention operations.
+
+Efficiency. Due to the flexibility in customizing number of group tokens (controlled by initial number of samples), grouping operation does not require a strict $O(N^2)$ operation and is $O(NM)$ on complexity. Furthermore, we show that in inference time, number of group tokens can even be adaptively customized, given an already trained model.
+
+# 4 EXPERIMENTS
+
+We evaluate the representation learned by our model on standard benchmarks based on the ImageNet-1K dataset. We also explore and analyze the design space of perceptual group tokenizer in section 4.2, investigate its adaptive computation ability in section 4.3, demonstrate its generalization ability on semantic segmentation in section 4.4, and visualize learned attentions in section 4.5.
+
+# 4.1 MAIN RESULTS
+
+Setup. The widely-adopted standard benchmark for evaluating self-supervised learning methods is ImageNet ILSVRC-2012 (ImageNet-1K) (Russakovsky et al., 2015). Performance of models are measured by top-1 classification accuracy. The pre-trained backbones are frozen, with a linear classifier trained on top. For fair comparison, we follow the standard data augmentation used in (Caron et al., 2021), with the same number of global views and local views. The model is optimized using AdamW (Loshchilov & Hutter, 2018) with learning rate 0.0005 and 1024 batch size for 600 epochs, trained with TPUv5 for 21k core hrs (512 cores for 41 hrs). We use $4 \times 4$ patches as image tokens, which keeps as much details as possible while maintaining reasonable computation costs.
+
+
Method
Arch
Param.
Linear probe (top-1 acc)
(Other backbones with different losses within the same batch of DINO for reference)
SCLR (Chen et al., 2020a)
RN50W4
375
76.8
SwAV (Caron et al., 2020)
RN50W2
93
77.3
BYOL (Caron et al., 2020)
RN50W2
93
77.4
SwAV (Caron et al., 2020)
RN50W5
586
78.5
BYOL (Caron et al., 2020)
RN50W4
375
78.6
iBOT (Zhou et al., 2021)
ViT-B/16
85
79.5
BYOL (Caron et al., 2020)
RN200W2
250
79.6
SCLRv2 (Chen et al., 2020b)
RN152w3+SK
794
79.8
BEiTv2 (Peng et al., 2022)
ViT-B/16
85
80.1
(Fair comparison under the DINO loss and framework)
DINO (Caron et al., 2021)
ViT-S/8
21
79.7
Ours (PGTG-S-1024)
PGT-S
34
79.8
DINO (Caron et al., 2021)
ViT-B/16
85
78.2
DINO (Caron et al., 2021)
ViT-B/8
85
80.1
Ours (PGTG-B-256)
PGT-B
70
79.7
Ours (PGTG-B-512)
PGT-B
70
79.9
Ours (PGTG-B-1024)
PGT-B
70
80.1
Ours (PGTF-B-256)
PGT-B
115
80.0
Ours (PGTF-B-512)
PGT-B
115
80.1
Ours (PGTF-B-1024)
PGT-B
115
80.3
+
+Table 1: Comparison with strong baselines on ImageNet-1K under linear probe evaluation protocol. $\mathrm{PGT}_{\mathrm{DIST}}$ -B-X represents $X$ number of group tokens per grouping layer in inference (same trained model with 256 tokens is used). DIST: the distribution choice for group token initialization. G and F represent Gaussian and Flow, respectively. Our model achieves $80.3\%$ , competitive with state-of-the-art vision backbones.
+
+
Descend
Flat
Ascend
Token size
[576, 384, 192]
[384, 384, 384]
[192, 384, 576]
Accuracy
62.0
63.1
63.4
Token shape
[192, 128, 64]
[128, 128, 128]
[64, 128, 192]
Accuracy
63.6
63.7
63.1
+
+Table 2: Exploring the design choices for PGT. Token size: dimensions for group tokens in three grouping blocks. Token shape: number of tokens for group tokens in three grouping blocks. Accuracy measured on ImageNet-1K under linear probe protocol. Results indicate progressively large group token dimensions with flat or descend number of tokens arrangements work the best.
+
+Architecture details. In the experiments, we mainly evaluate two variants of PGT: the main model and a tiny version for exploring design choices. On the ImageNet-1K benchmark, we report the performance metrics of our main model. Three grouping blocks are used, with 10 grouping layers in each block. The dimension for input token is 384, with 256 group tokens per layer. The dimensions for group tokens are 98, 192, and 288 for the three blocks, respectively. There are 6 grouping heads used. For number of grouping iterations, we observe three rounds are sufficient to achieve good performance. The MLP hidden size for each layer is 384 as well, i.e., the MLP multiplication factor is 1. The final multihead attention layer uses a learnable token with 2048 dimensions to summarize all group tokens outputs from the model.
+
+The main results are summarized in table 1. We mainly compare with ResNet and ViT backbones, the two main stream vision architectures to show that perceptual grouping architecture can also achieve competitive results on the challenging ImageNet-1K benchmark. Although our model is trained with 256 group tokens, the model can use different numbers of group tokens in inference (more experiments in section 4.2). We evaluate PGT with 256, 512, and 1024 number of group tokens and observe that the model can achieve $80.3\%$ top-1 accuracy, showing the self-supervised learned feature of PGT is as good as the ones learned by ViT architectures.
+
+# 4.2 ABLATIONS
+
+To explore design choices of PGT, we use a tiny version of PGT with 3 blocks, 2 layer in each block (6 layers in total), 256 hidden size for input tokens, and 3 number of grouping iterations. The learnable token in MAP head has 512 dimensions. There are $\sim 10\mathrm{M}$ parameters in this PGT-tiny.
+
+Group token layouts. Given a fixed number of budget on group tokens, we explore three choices on how they should be arranged across grouping blocks and layers: descend, flat and ascend. Intuitively, more group tokens will have higher capacity of capturing smaller parts and detailed visual features, while less group tokens are more prone to carry global information. As shown in table 2 bottom row, flat or descend number of group tokens performs the best. In practice, we find that using flat (same number of group tokens in three grouping blocks) version achieves better training stability.
+
+Group token dimension shapes. Similar to token number arrangements, we explore how group token dimensions should be set. Under three choices, progressively increasing the dimension size in the later layers performs the best, shown in first row of table 2. This also aligns with the intuition that later layers contain more information and requires higher capacity to represent groups.
+
+Multi-grouping vs single grouping. We further test whether multi-head grouping helps improve performance. As a fair comparison, we use 6 heads and 128 group tokens per head for a multi-grouping model, and 1 head with $6 \times 128$ group tokens for a single grouping model. We find that adopting multi-head design can improve the performance from $62.2\%$ to $66.3\%$ , a $4.1\%$ accuracy boosts, showing that having multiple heads indeed helps with representation learning.
+
+Grouping distribution entropy. Will grouping process collapse to some specific group token during training? We visualize the entropy of marginal distribution over tokens $p(\pmb{c})$ and conditional distribution $p(\pmb{c}|\pmb{x})$ in figure 4. Interestingly, we observe that conditional probability, i.e. the assignment to group tokens, tends to become more certain during training, while the marginal distribution remains having descend entropy, indicating collapses not happening in training.
+
+Peak memory usage. As discussed in section 3.4, given the same number of tokens, the grouping operation uses less memory than the self-attention operation. We show the percentage of peak memory usage in $\mathrm{PGT_G - B}$ compared to ViT-B with the same patch size $(4\times 4)$ in table 3. The
+
+
+Epochs (600)
+
+
+Epochs (600)
+
+
+Epochs (600)
+Figure 4: The entropy curves of grouping distributions $p(c)$ and $p(c|x)$ across different layers.
+
+
+Epochs (600)
+
+usage is obtained from the forward inference graph, as in practice the underlying complex hardware optimizer is a less accurate measurement and varies across infrastructures.
+
+
#group tokens
16
32
64
128
256
384
512
768
1024
ViT-B
Peak memory(%)
4.6
4.6
4.6
4.6
4.6
6.1
8.2
12.2
16.3
100
+
+# 4.3 OUT-OF-DISTRIBUTION ADAPTIVE COMPUTATION
+
+One surprising and powerful ability of PGT is adaptive computation. For example, given a model trained using $M_{1}$ group tokens per layer, one can choose to use $M_{2}$ group tokens in inference, where $M_{2} \neq M_{1}$ . This is because that the initial seeding group tokens are drawn from a probabilistic distribution, and the number of samples can be customized. This property leads to a highly customizable inference without re-training the model. When $M_{1} \neq M_{2}$ , the model copes with an out-of-distribution (OOD) problem where test time setting is different from training. We observe surprisingly strong generalization with our model. Specifically, with more tokens $M_{2} > M_{1}$ in inference, the performance can actually outperform the setting $(M_{2} = M_{1})$ used in training, even if it is OOD for the model.
+
+The results for OOD adaptive computation are summarized in table 4. We mainly test $\mathrm{PGT_G}$ -Tiny with a grid evaluation that varies the number of group tokens in training $M$ and the number of group tokens in inference $N$ , and also show the main model's results in the last row. When using the main model $\mathrm{PGT_G}$ -B to perform adaptive inference, with only $12.5\%$ of the number of group tokens compared to training, the performance can still be maintained at $72.1\%$ with only a $\sim 8\%$ drop on top-1 accuracy. The adaptive computation ability is important for both general image understanding where images have varying number of objects and need different numbers of groups, and scenarios where test-time computational resource is constrained. This flexibility is an important advantage that grouping backbones hold.
+
+Table 3: Peak memory usage of PGT-B compared to the baseline model ViT-B with $4\times 4$ patch size.
+
+
tr/inf
16
32
64
128
256
384
\(PGT_G-Ti-16\)
\(57.4 (×1)\)
\(58.3 (×2)\)
\(58.5 (×4)\)
\(58.5 (×8)\)
\(58.5 (×16)\)
\(58.4 (×24)\)
\(PGT_G-Ti-32\)
\(57.3 (×\frac{1}{2})\)
\(59.9 (×1)\)
\(60.8 (×2)\)
\(61.0 (×4)\)
\(61.0 (×8)\)
\(60.9 (×12)\)
\(PGT_G-Ti-64\)
\(53.0 (×\frac{1}{4})\)
\(59.2 (×\frac{1}{2})\)
\(61.7 (×1)\)
\(62.6 (×2)\)
\(62.9 (×4)\)
\(62.9 (×6)\)
\(PGT_G-Ti-128\)
\(44.9 (×\frac{1}{8})\)
\(56.6 (×\frac{1}{4})\)
\(61.8 (×\frac{1}{2})\)
\(63.9 (×1)\)
\(64.7 (×2)\)
\(64.8 (×3)\)
\(PGT_G-Ti-256\)
\(27.2 (×\frac{1}{16})\)
\(47.4 (×\frac{1}{8})\)
\(58.8 (×\frac{1}{4})\)
\(63.3 (×\frac{1}{2})\)
\(65.1 (×1)\)
\(65.5 (×\frac{3}{2})\)
\(PGT_G-Ti-384\)
\(26.1 (×\frac{1}{24})\)
\(43.0 (×\frac{1}{12})\)
\(55.4 (×\frac{1}{6})\)
\(61.7 (×\frac{1}{3})\)
\(64.6 (×\frac{2}{3})\)
\(65.5 (×1)\)
\(PGT_G-B-256\)
\(60.4 (×\frac{1}{16})\)
\(72.1 (×\frac{1}{8})\)
\(77.1 (×\frac{1}{4})\)
\(78.9 (×\frac{1}{2})\)
\(79.7 (×1)\)
\(79.9 (×\frac{3}{2})\)
+
+Table 4: Out-of-distribution adaptive computation by selecting different numbers of initially sampled tokens. Row: number of tokens used for training. Column: number of tokens used for inference. Top-1 accuracy is reported under linear evaluation protocol using ImageNet-1K. The reported performance of first six rows is obtained using a tiny version of PGT, and last row is the main model. Number of group tokens is the same for underlined numbers in training and inference. Bold numbers are the best results.
+
+# 4.4 DOWNSSTREAM TASK TRANSFER: SEMANTIC SEGMENTATION ON ADE20K
+
+To evaluate the generalizability of pretrained feature produced by PGT, we test the transfer performance of semantic segmentation with ADE20k. Following the standard setup, we finetune our
+
+
+Figure 5: Visualization of attention maps of each group tokens across layers and grouping head. $L$ indicates layer indices. Five group tokens for each grouping head. Smaller images are for early layers, arranged as five group tokens per grouping head. Large images are for the last layer.
+
+model with the same data augmentation for 128 epoch. The baseline method uses DINO + ViT-B/16 (Zheng et al., 2021). For our model, we add one linear classification layer after the pre-trained $\mathrm{PGT_G - B}$ for fine-tuning. To adapt to more objects and complex scenes in the segmentation datasets, we use 1024 group tokens for inference, benefiting from the adaptive computation ability of our model. We find that our model can obtain $45.1\%$ on mean IoU while the baseline achieves $44.1\%$ (Bao et al., 2021), leading to a $1.0\%$ improvements.
+
+# 4.5 GROUPING VISUALIZATION
+
+We visualize the attention maps calculated between group tokens and input tokens in figure 4.5. We find that (1) using multiple grouping heads can capture different information within each head. For example, in layer 0, the first head captures light and color, second head focuses on only spatial locations, and the third head potentially relies on textures; (2) group tokens can capture different semantic parts, for example, in the first image, group tokens separate apple, jar, handle, and background. In the second image, camel, legs, camel hump, and human are separately grouped. Compared to standard ViT in DINO (Caron et al., 2021) where only a single foreground can be extracted using [CLS] token, our model can flexibly group different parts given an image, leading to a set of tokens that are potentially more meaningful and customizable. Note that the grouping results are still different from human's vision, and sometimes generates parts that seem to be "fragmented". This is possibly due to the "parts-to-whole with data augmentation" training loss. Human vision, in contrast, is sensitive to moving objects and trained within a 4D space. Nevertheless, we believe with a similar dataset, environment and loss design, our grouping model can potentially produce groupings more coherent and sensitive to boundaries and moving objects.
+
+# 5 CONCLUSION
+
+In this paper, we propose Perceptual Group Tokenizer (PGT), a new visual recognition architecture entirely built through perceptual grouping principles. The proposed model shows strong performance on self-supervised learning benchmark ImageNet-1K with linear probe evaluation, and has desirable properties such as adaptive computation and high model interpretability in each operation. This work can enable a new paradigm for designing visual recognition backbones, and we hope to inspire more research progress along this direction. One limitation of the proposed model is its relatively expensive computation cost due to the iterative grouping processes. This can be potentially addressed by other grouping operations, such as those grouping operations with closed-form solutions, which is a promising direction for the future work.
+
+# REFERENCES
+
+Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational information bottleneck. arXiv preprint arXiv:1612.00410, 2016.
+Pablo Arbeláez, Jordi Pont-Tuset, Jonathan T Barron, Ferran Marques, and Jitendra Malik. Multiscale combinatorial grouping. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 328-335, 2014.
+Hangbo Bao, Li Dong, Songhao Piao, and Furu Wei. Beit: Bert pre-training of image transformers. arXiv preprint arXiv:2106.08254, 2021.
+David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6541-6549, 2017.
+Ondrej Biza, Sjoerd van Steenkiste, Mehdi SM Sajjadi, Gamaleldin F Elsayed, Aravindh Mahendran, and Thomas Kipf. Invariant slot attention: Object discovery with slot-centric reference frames. arXiv preprint arXiv:2302.04973, 2023.
+Daniel Bolya, Cheng-Yang Fu, Xiaoliang Dai, Peizhao Zhang, Christoph Feichtenhofer, and Judy Hoffman. Token merging: Your vit but faster. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=JroZRaRw7Eu.
+Christopher P Burgess, Loic Matthew, Nicholas Watters, Rishabh Kabra, Irina Higgins, Matt Botvinick, and Alexander Lerchner. Monet: Unsupervised scene decomposition and representation. arXiv preprint arXiv:1901.11390, 2019.
+Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. Advances in neural information processing systems, 33:9912-9924, 2020.
+Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650-9660, 2021.
+Michael Chang, Tom Griffiths, and Sergey Levine. Object representations as fixed points: Training iterative refinement algorithms with implicit differentiation. Advances in Neural Information Processing Systems, 35:32694-32708, 2022.
+Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. DeepLab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4): 834-848, 2017.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020a.
+Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E Hinton. Big self-supervised models are strong semi-supervised learners. Advances in neural information processing systems, 33:22243-22255, 2020b.
+Laura Culp, Sara Sabour, and Geoffrey E Hinton. Testing glom's ability to infer wholes from ambiguous parts. arXiv preprint arXiv:2211.16564, 2022.
+Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In 2005 IEEE computer society conference on computer vision and pattern recognition (CVPR'05), volume 1, pp. 886-893. IEEE, 2005.
+Tri Dao, Dan Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. Flashattention: Fast and memory-efficient exact attention with io-awareness. Advances in Neural Information Processing Systems, 35:16344-16359, 2022.
+
+Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
+Gamaleldin Elsayed, Aravindh Mahendran, Sjoerd van Steenkiste, Klaus Greff, Michael C Mozer, and Thomas Kipf. Savi++: Towards end-to-end object-centric learning from real-world videos. Advances in Neural Information Processing Systems, 35:28940-28954, 2022.
+Jean-Bastien Grill, Florian Strub, Florent Alché, Coretin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervised learning. Advances in neural information processing systems, 33:21271-21284, 2020.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016.
+Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16000-16009, 2022.
+Olivier J Henaff, Skanda Koppula, Evan Shelhamer, Daniel Zoran, Andrew Jaegle, Andrew Zisserman, João Carreira, and Relja Arandjelović. Object discovery and representation networks. In European Conference on Computer Vision, pp. 123-143. Springer, 2022.
+Michael H Herzog. Perceptual grouping. Current Biology, 28(12):R687-R688, 2018.
+Geoffrey Hinton. How to represent part-whole hierarchies in a neural network. Neural Computation, pp. 1-40, 2022.
+Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840-6851, 2020.
+Allan Jabri, David Fleet, and Ting Chen. Scalable adaptive computation for iterative generation. arXiv preprint arXiv:2212.11972, 2022.
+Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, et al. Perceiver io: A general architecture for structured inputs & outputs. arXiv preprint arXiv:2107.14795, 2021.
+Tsung-Wei Ke and Stella X Yu. Cast: Concurrent recognition and segmentation with adaptive segment tokens. arXiv preprint arXiv:2210.00314, 2022.
+Junkyung Kim, Drew Linsley, Kalpit Thakkar, and Thomas Serre. Disentangling neural mechanisms for perceptual grouping. arXiv preprint arXiv:1906.01558, 2019.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes, 2022.
+Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. Advances in neural information processing systems, 31, 2018.
+Philipp Krahenbuhl and Vladlen Koltun. Efficient inference in fully connected crfs with gaussian edge potentials. Advances in neural information processing systems, 24, 2011.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25, 2012.
+
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Alex Levinshtein, Cristian Sminchisescu, and Sven Dickinson. Multiscale symmetric part detection and grouping. International journal of computer vision, 104:117-134, 2013.
+Kai Liu, Tianyi Wu, Cong Liu, and Guodong Guo. Dynamic group transformer: A general vision transformer backbone with dynamic group attention. arXiv preprint arXiv:2203.03937, 2022a.
+Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10012-10022, 2021.
+Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11976-11986, 2022b.
+Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-centric learning with slot attention. Advances in Neural Information Processing Systems, 33:11525-11538, 2020.
+Ilya Loshchilov and Frank Hutter. Fixing weight decay regularization in adam. 2018.
+David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60:91-110, 2004.
+Xu Ma, Yuqian Zhou, Huan Wang, Can Qin, Bin Sun, Chang Liu, and Yun Fu. Image as set of points. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=awnvqZja69.
+Yi Ma, Harm Derksen, Wei Hong, and John Wright. Segmentation of multivariate mixed data via lossy data coding and compression. IEEE transactions on pattern analysis and machine intelligence, 29(9):1546-1562, 2007.
+Joe Marino, Yisong Yue, and Stephan Mandt. Iterative amortized inference. In International Conference on Machine Learning, pp. 3403-3412. PMLR, 2018.
+Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
+Maxime Oquab, Timothee Darcet, Theo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023.
+Stephen E Palmer. Perceptual grouping: It's later than you think. Current Directions in Psychological Science, 11(3):101-106, 2002.
+Zhiliang Peng, Li Dong, Hangbo Bao, Qixiang Ye, and Furu Wei. Beit v2: Masked image modeling with vector-quantized visual tokenizers. arXiv preprint arXiv:2208.06366, 2022.
+Jordi Pont-Tuset, Pablo Arbelaez, Jonathan T Barron, Ferran Marques, and Jitendra Malik. Multiscale combinatorial grouping for image segmentation and object proposal generation. IEEE transactions on pattern analysis and machine intelligence, 39(1):128-140, 2016.
+Haozhi Qi, Chong You, Xiaolong Wang, Yi Ma, and Jitendra Malik. Deep isometric learning for visual recognition. In International conference on machine learning, pp. 7824-7835. PMLR, 2020.
+Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Dynamicvit: Efficient vision transformers with dynamic token sparsification. Advances in neural information processing systems, 34:13937-13949, 2021.
+Sid Reddy, Anca Dragan, and Sergey Levine. Pragmatic image compression for human-in-the-loop decision-making. Advances in Neural Information Processing Systems, 34:26499-26510, 2021.
+
+Edward Rosten, Reid Porter, and Tom Drummond. Faster and better: A machine learning approach to corner detection. IEEE transactions on pattern analysis and machine intelligence, 32(1):105-119, 2008.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115:211-252, 2015.
+Maximilian Seitzer, Max Horn, Andrii Zadaianchuk, Dominik Zietlow, Tianjun Xiao, Carl-Johann Simon-Gabriel, Tong He, Zheng Zhang, Bernhard Scholkopf, Thomas Brox, et al. Bridging the gap to real-world object-centric learning. In The Eleventh International Conference on Learning Representations, 2022.
+Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. IEEE Transactions on pattern analysis and machine intelligence, 22(8):888-905, 2000.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1-9, 2015.
+Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning, pp. 6105-6114. PMLR, 2019.
+Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XI 16, pp. 776-794. Springer, 2020.
+Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In International conference on machine learning, pp. 10347-10357. PMLR, 2021.
+Jasper RR Uijlings, Koen EA Van De Sande, Theo Gevers, and Arnold WM Smeulders. Selective search for object recognition. International journal of computer vision, 104:154-171, 2013.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
+Johan Wagemans, James H Elder, Michael Kubovy, Stephen E Palmer, Mary A Peterson, Manish Singh, and Rüdiger Von der Heydt. A century of gestalt psychology in visual perception: I. perceptual grouping and figure-ground organization. Psychological bulletin, 138(6):1172, 2012.
+Ziyi Wu, Nikita Dvornik, Klaus Greff, Thomas Kipf, and Animesh Garg. Slotformer: Unsupervised visual dynamics simulation with object-centric models. In The Eleventh International Conference on Learning Representations, 2022.
+Jiarui Xu, Shalini De Mello, Sifei Liu, Wonmin Byeon, Thomas Breuel, Jan Kautz, and Xiaolong Wang. Groupvit: Semantic segmentation emerges from text supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18134-18144, 2022.
+Hongxu Yin, Arash Vahdat, Jose M Alvarez, Arun Mallya, Jan Kautz, and Pavlo Molchanov. A-vit: Adaptive tokens for efficient vision transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10809-10818, 2022.
+Jason Yosinski, Jeff Clune, Anh Nguyen, Thomas Fuchs, and Hod Lipson. Understanding neural networks through deep visualization. arXiv preprint arXiv:1506.06579, 2015.
+Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part I 13, pp. 818-833. Springer, 2014.
+
+Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6881-6890, 2021.
+Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in deep scene cnns. arXiv preprint arXiv:1412.6856, 2014.
+Jinghao Zhou, Chen Wei, Huiyu Wang, Wei Shen, Cihang Xie, Alan Yuille, and Tao Kong. ibot: Image bert pre-training with online tokenizer. arXiv preprint arXiv:2111.07832, 2021.
+
+# A APPENDIX
+
+# A.1 LEARNABLE SAMPLING DISTRIBUTIONS
+
+Our proposed Perceptual Group Tokenizer (PGT) model initializes a set of group tokens through sampling from a distribution. This set of group tokens then serve as the initial "seeding" for the grouping process. We explore two methods to serve as the initial distribution: learnable Gaussian distribution and Normalizing Flows. We would like the extra cost of the grouping process to be minimal, therefore, use two light-weighted versions.
+
+# A.1.1 GAUSSIAN
+
+Similar to the standard usage of learnable Gaussians in generative model literature (Kingma & Welling, 2022; Ho et al., 2020), we use the reparameterization to perform a learnable sampling process: $\pmb{c} = \pmb{\mu} + \pmb{\sigma} * \pmb{\epsilon}$ , where $\pmb{\epsilon}$ is drawn from a unit Gaussian $\mathcal{N}(0, I)$
+
+# A.1.2 FLOW
+
+As Gaussian distribution might have limitations in covering complex distribution shapes, especially in the high-dimensional space, we also explore a version with one step of affine coupling flow transformation (Dinh et al., 2016). Since we only require the differentiable sampling procedure and do not need to compute the determinant of Jacobian matrix, we directly apply the transformation without splitting the dimensions by half:
+
+$$
+\boldsymbol {c} = \boldsymbol {a} * \epsilon + \boldsymbol {b} \tag {6}
+$$
+
+$$
+\left(\log \boldsymbol {s}, \boldsymbol {t}\right) = \operatorname {M L P} (\boldsymbol {c}) \tag {7}
+$$
+
+$$
+s = \exp (\log s) \tag {8}
+$$
+
+$$
+\boldsymbol {c} = \boldsymbol {s} * \boldsymbol {c} + \boldsymbol {t} \tag {9}
+$$
+
+where $\epsilon$ is drawn from a unit Gaussian $\mathcal{N}(0, I)$ . This transformation is simply a re-scaling and translation (similar to Gaussian) but conditioned on per sample $\epsilon$ . More details are in (Dinh et al., 2016; Kingma & Dhariwal, 2018). We only apply one step of this transformation, leading to minimal parameter increase and negligible inference time difference.
+
+# A.2 MODEL ANALYSIS
+
+In this section, we add more analysis on our model's performance and computational costs.
+
+# A.2.1 GROUPING ENTROPY
+
+Grouping distribution entropy. The main paper has discussed and shown the grouping distribution entropy curves on several layers. In the appendix, we demonstrate curves from more layers in figure 6 and figure 7, where the first one is marginal distribution and second one is conditional distribution.
+
+
+
+
+
+
+
+
+
+
+Figure 6: The entropy curves of marginal distribution $p(c)$ grouping across different layers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 7: The entropy curves of conditional distribution $p(\boldsymbol{c}|\boldsymbol{x})$ grouping across different layers.
+
+
+
+
+
+
+
+# A.2.2 GROUPING ITERATIONS
+
+In our backbone, we find that more grouping iterations will lead to a better performance. We explore the number of grouping iterations on the PGT-Tiny model and $\mathrm{PGT_G - B - 256}$ . On the tiny version, we find the model achieves 61.4, 63.8, and 65.1 on the linear probe evaluation with number of interations is 1, 2, and 3. For the main model, the performances are 79.3, 79.6, and 79.7 respectively. The model's increased depth potentially helps with the lack of grouping iterations in the deep model. But in general, having the grouping process is still important in obtaining higher performance.
+
+# A.2.3 INFERENCE TIME
+
+We also profile our model's inference time, compared with ViT-B with 4x4 patches (the same amount tokens) for ablation study on the grouping operation. Note that our model and framework are built upon a complex infrastructure that uses XLA and other hardware accelerator to optimize speed. We find varying number of group tokens only lead to small influence. PGT-B-256 has 640 im/sec/core and ViT-B/4 has 680 im/sec/core. Using smaller number of grouping iterations can speed up the inference to 710 im/sec/core (2 iter2) and 820 im/sec/core (1 iter).
+
+Note that this is only due to the specialty of the underlying infrastructure. In general, having less number of group tokens should still increase the inference speed, since the attention operation is a key computation bottleneck for vision models.
+
+# A.2.4 GFLOPS
+
+In table A.2.4, we show the gflops for our model under various inference budgets. Note that, as pointed in other works (Dao et al., 2022), gflops often do not fully reflect the model's computation performance. Due to that our model needs iterative grouping process, it'll increase the gflops count. But as shown in peak memory usage and inference time, the model's computation costs are either similar are much less.
+
+
#group tokens
16
32
64
128
256
384
512
768
1024
ViT-B
Gflops
99.2
131.1
194.9
322.6
577.8
833.1
1088.3
1599.0
2109.3
451.6
+
+Table 5: Gflops of PGT-B compared to the baseline model ViT-B with the same patch size.
+
+# A.2.5 PROBABILISTIC PERSPECTIVE OF GROUPING OPERATIONS
+
+Due to the probabilistic nature, our model is also quite compatible with a full "treatment" with the variational inference framework, which can provide certain backup for our grouping operations already in the current model. We can treat the group token embeddings $c$ as the latent variables, where the grouping process uses iterative amortized inference (Marino et al., 2018) to refine the latent variable. The grouping modules, including GRU, MLP, attention, and other layers are designed
+
+to better infer the embeddings (latent variables). The training signal is a pragmatic loss (instead of reconstruction loss), which has been demonstrated in (Reddy et al., 2021; Alemi et al., 2016). The key differences are: (1) there is no sampling in each inference step; (2) the regularization from unit Gaussian distribution is set to zero. We do believe a full probabilistic treatment of the perceptual grouping architecture can be a very interesting next step.
+
+# A.2.6 MORE VISUALIZATIONS
+
+In this section, we show more visualizations of the attention maps for generated group tokens by Perceptual Group Tokenizers in figure 8, 9 and 10.
+
+
+Figure 8: Visualization for attention maps of group token samples during the grouping process. PGT uses 256 group tokens in inference time.
+
+
+Figure 9: Grouping results from the 21st layer, using 8 group tokens in inference time.
+
+
+Figure 10: Grouping results from the last layer, using 256 group tokens in inference time.
\ No newline at end of file
diff --git a/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/images.zip b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..bdd888807471f0b91fac9c5061c3908bca765dcc
--- /dev/null
+++ b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c00dbafa1728cf723189c47f17b196fc0632bf3a01a6f51bd55f66a84c2dc40f
+size 1425549
diff --git a/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/layout.json b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..09cfabac3e482c4dc163cd9f68a5fd58d60a1e63
--- /dev/null
+++ b/perceptualgrouptokenizerbuildingperceptionwithiterativegrouping/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c60485eb24f127fc915024317e8487e4a090abeca76aaa6a9e8c52cb417bcacf
+size 490066
diff --git a/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_content_list.json b/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..42587fcd506194f7ac520fd5139a3cc7d12029bd
--- /dev/null
+++ b/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2fd6088dbdecc1ec6d0887fbed82e51a63a8be799f988452f3c8cb1331c933a4
+size 154330
diff --git a/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_model.json b/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..afc3944c2ee28908f1b9b76917d3254a34fe6f74
--- /dev/null
+++ b/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:999a211750625e20e80c11ebdd07df0dc5ab1d299321ca3831aa8237ee80de44
+size 166492
diff --git a/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_origin.pdf b/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4907262de63e77e9375e6b95ff9638dc3a227abe
--- /dev/null
+++ b/perceptualscalespredictedbyfisherinformationmetrics/9968c6be-b0d6-4ada-b85b-8c9dd03c6ccc_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e7714847ae45664fc2eadafe05d22dba1730775555d9aa859587a6173fe6860c
+size 21088126
diff --git a/perceptualscalespredictedbyfisherinformationmetrics/full.md b/perceptualscalespredictedbyfisherinformationmetrics/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c3d5dddf4a3d92684657275aad979dd5dd23adf9
--- /dev/null
+++ b/perceptualscalespredictedbyfisherinformationmetrics/full.md
@@ -0,0 +1,780 @@
+# PERCEPTUAL SCALES PREDICTED BY FISHER INFORMATION METRICS
+
+Jonathan Vacher*
+
+MAP5,
+
+Université Paris Cité, CNRS,
+
+F-75006, Paris, France
+
+jonathan.vacher@u-paris.fr
+
+Pascal Mamassian
+
+LSP, Département d'études cognitives,
+
+École normale supérieure, PSL University, CNRS,
+
+75005 Paris, France
+
+pascal.mamassian@ens.fr
+
+# ABSTRACT
+
+Perception is often viewed as a process that transforms physical variables, external to an observer, into internal psychological variables. Such a process can be modeled by a function coined perceptual scale. The perceptual scale can be deduced from psychophysical measurements that consist in comparing the relative differences between stimuli (i.e. difference scaling experiments). However, this approach is often overlooked by the modeling and experimentation communities. Here, we demonstrate the value of measuring the perceptual scale of classical (spatial frequency, orientation) and less classical physical variables (interpolation between textures) by embedding it in recent probabilistic modeling of perception. First, we show that the assumption that an observer has an internal representation of univariate parameters such as spatial frequency or orientation while stimuli are high-dimensional does not lead to contradictory predictions when following the theoretical framework. Second, we show that the measured perceptual scale corresponds to the transduction function hypothesized in this framework. In particular, we demonstrate that it is related to the Fisher information of the generative model that underlies perception and we test the predictions given by the generative model of different stimuli in a set a of difference scaling experiments. Our main conclusion is that the perceptual scale is mostly driven by the stimulus power spectrum. Finally, we propose that this measure of perceptual scale is a way to push further the notion of perceptual distances by estimating the perceptual geometry of images i.e. the path between images instead of simply the distance between those.
+
+# 1 INTRODUCTION
+
+Difference Scaling Difference scaling methods allow us to measure the relative perceptual differences of multiple stimuli in human observers. Such methods have been used as early as in the 1960s to measure the relative differences of perceived color, contrast or loudness (see Maloney & Yang (2003) and references therein). This is only at the beginning of our century that a fitting method, called Maximum Likelihood Difference Scaling (MLDS), was developed (Maloney & Yang, 2003; Knoblauch & Maloney, 2008) to infer the function that maps the physical to the perceptual space. This function is called perceptual scale. The critical assumption behind the fitting methods dates back to Thurstone's law of comparative judgment (see case V Thurstone (1927)): the difference between two values along a psychological dimension is corrupted by noise that has a constant variance. The perceptual scale informs us about how a stimulus is perceived when modified along a continuous physical scale (e.g. color, contrast, ...). When the slope of the perceptual scale is steep, perception changes rapidly with small physical changes i.e. the observer is highly sensitive to physical variations. When the slope is shallow, perception is stable even for large physical variations i.e. the observer is weakly sensitive to physical variations. Recently, the MLDS method has been used to measure the perceptual scales of surface texture (Emrith et al., 2010), watercolor effect (Devinck & Knoblauch, 2012), slant-from-texture (Aguilar et al., 2017), lightness (Aguilar & Maertens, 2020) or probabilities (Zhang et al., 2020). However, perceptual scales of more fundamental physical variables such as orientation and spatial frequency have not been measured nor related to existing probabilistic
+
+theory of perception. Additionally, while relations between standard Two-alternative Forced Choice (2AFC) measurements and perceptual scales have been studied (Aguilar et al., 2017), it was a theory of perception that was previously described (Wei & Stocker, 2017) that has been used to derive predictions.
+
+Probabilistic modeling of perception Thurstone's law of comparative judgment is a first brick in the history of probabilistic modeling of perception (Thurstone, 1927). Indeed, it introduced the incipient concept of random variable (Chebyshev, 1867; Kolmogoroff, 1933) in psychophysics. Then, the development of computer science and information theory had major impact in perception studies, bringing concepts such as redundancy reduction and information maximization (Attneave, 1954; Barlow et al., 1961). More specifically, when applied to texture perception, these concepts led to Julesz' hypothesis that perception of textures is statistical (Victor et al., 2017) i.e. textures with similar statistics are indistinguishable. Later on, together with advances in image processing, Julesz' hypothesis led to modern texture synthesis algorithms (Portilla & Simoncelli, 2000; Gatys et al., 2015). In parallel, a core theorem of probabilities, namely Bayes rule, was found to efficiently predicts human perceptual behaviors (Knill & Richards, 1996). Further works have been dedicated to solve the inverse problem of identifying observers' prior that best explain their perception (Stocker & Simoncelli, 2006; Girshick et al., 2011; Vacher et al., 2018; Manning et al., 2023). Inspired by neural population coding models, an optimal observer theory is now described in details by Wei & Stocker (2017). The main consequence of this theory is the existence of a simple relation between perceptual bias and sensitivity. Yet, the theory is limited to a hypothesized scalar perceptual variable while it is established that only part of the neurons of the primary visual cortex is tuned to scalar variables such as spatial and temporal frequencies or orientation (Olshausen & Field, 2005). In higher visual areas, it is more and more difficult to identify scalar variables that uniquely drive single neurons as they respond to increasingly complex patterns (Bashivan et al., 2019). In some previous work, Wainwright (Wainwright, 1999) have used higher dimensional natural image statistics (auto-correlation and power spectrum) to explain various psychophysical observations. Though, it is unclear how this approach relates to the univariate Bayesian framework.
+
+Fisher information in neural populations The theory behind the work of Wei & Stocker (2017) is largely inspired by previous work on neural population coding (Brunel & Nadal, 1998). In this and subsequent works (Yarrow et al., 2012; Kanitscheider et al., 2015; Bethge et al., 2002; Wei & Stocker, 2016), it is often ultimately assumed that neurons are Poisson firing neurons parameterized by the tuning curve of a scalar variable. Variants of this optimal coding framework have been explored to explain the response of single neurons Laughlin (1983); von der Twer & MacLeod (2001). As stated previously, it is a quite restrictive framework as all neurons are not tuned to a scalar variable (Olshausen & Field, 2005). By applying this framework to perception, Wei and Stocker remove these unnecessary assumptions. They derive the relation between perceptual bias and sensitivity which at its core comes from the relation between Fisher information and prior under the optimal coding assumption (Brunel & Nadal, 1998)
+
+$$
+\mathbb {P} _ {S} (s) \propto \sqrt {\mathcal {I} (s)} \tag {1}
+$$
+
+where $S$ is a stimulus variable. Fisher information is used to quantify the variance of a stimulus estimator from a neural population encoding (Cramer-Rao lower bound). In contrast, priors are introduced in observer models to explain perceptual biases. Therefore, Equation (1) links neural population models and perceptual models. However, less attention is dedicated to the underlying encoding model, where a stimulus variable $S$ is non-linearly related to an internal measurement $M$ through a function $\psi$ plus an additive Gaussian noise $N$ with constant variance,
+
+$$
+M = \psi (S) + N. \tag {2}
+$$
+
+Interestingly, such an encoding model is very similar to the assumptions behind the observer model underlying the MLDS method. However, the precise nature of these internal measurements has so far remained abstract.
+
+Perceptual distance A perceptual distance is a score of image quality used to quantify and to compare the performances of image restoration or generation methods. Perceptual distances have been introduced to overcome the limitation of the Signal-to-Noise Ratio (also known as SNR). Indeed, images with similar SNR could vary subjectively in quality when presented to human observers (Wang et al., 2004). The Structural SIMilarity index (SSIM) is a score that is popular to provide a better account of perceptual similarity as compared to SNR. Since then, variations of SSIM
+
+have been proposed to more specific purposes such as estimating photo retouching (Kee & Farid, 2011). However, these scores require to compare the image to be rated to a reference image. In recent years, the success of deep generative modeling have led to the emergence of new scores such as the Inception score (Salimans et al., 2016) or the Fréchet Inception Distance (FID) (Heusel et al., 2017). These scores have in common that they compare the generated image distribution to the true empirical image distribution instead of a generated image to a reference image. In addition, they are based on Deep Neural Network (DNN) features. Overall, it has been shown that such DNN features-based scores are better aligned with human perception than SSIM or SNR for example (Zhang et al., 2018). One possible explanation is that DNN are able to capture high-order image statistics and that as hypothesized in vision, our perception is deeply related to image statistics (see Hepburn et al. (2022) and references in previous paragraphs). Yet, these coined perceptual distances are not exempt of limitations as they could be subject to bias when classes specific features are present or not (Kynkänniemi et al., 2023). Overcoming these biases will likely require to move away from training by measuring higher-order statistics on the image directly without relying on some learned or random filters (Amir & Weiss, 2021). One other limitation of perceptual distances is that they do not provide any information about how well a model has captured the perceptual geometry of images. Providing a full account of perceptual geometry is more demanding, it requires to compare the path when moving from one image to another and not only their distance along this path.
+
+Contributions Our work brings several contributions to overcome the limitations introduced above. First, we explain that a convergence theorem of discrete spot noises is a way to resolve the tension between univariate Bayesian theories of perception (Wei & Stocker, 2017) and the high dimensionality of images (Wainwright, 1999). More precisely, the hypothesis that an observer has a univariate representation of the distribution of the parameter of interest (e.g. spatial frequency), is compatible with the assumption that an observer is measuring the spectral energy distribution of the image in that both assumptions leads to similar predictions. Second, we show that the function $\psi$ , introduced in Equation 2, can be interpreted as the perceptual scale as measured by a difference scaling experiment. Then, we demonstrate again that this function $\psi$ can be predicted from the Fisher information of the stimulus when using the true distribution of the noisy internal stimulus representation knowing the presented stimulus i.e. the distribution of the measurements $M$ that we give explicitly. Therefore, we provide a clear link between theory and experiment. Third, we propose to go further in exploring perceptual distances by estimating how well the geometry of natural images captured by models matches the perceptual geometry. For this purpose, we empirically test the prediction given by the Fisher information of Gaussian vectors and processes in a series of experiments (code and data1 texture interpolation code2) involving stochastic stimuli characterized by their power spectrum or their higher-order statistics captured by VGG-19 (Gatys et al., 2015). In particular, we collapse the high dimensionality of these statistics by interpolating between single textures (Vacher et al., 2020) and we measure the corresponding perceptual scale when going from one texture to another. Finally, we propose the Area Matching Score (AMS) score to quantify the mismatch between the predicted and the measured perceptual scales providing a clear method to evaluate the perceptual alignment between generative image models and human vision.
+
+Notations Unless stated differently, upper case letters (e.g. $X$ ) are random variables and lower case letters (e.g. $x$ ) are samples or realizations of those random variables. The probability density at $X = x$ is denoted $\mathbb{P}_X(x)$ . Similarly, the conditional probability density at $X = x$ knowing $Y = y$ is denoted $\mathbb{P}_{X|Y}(x,y)$ . The set $\mathbb{S} = [s_{\mathrm{init}}, s_{\mathrm{final}}]$ is the stimulus segment.
+
+# 2 METHODS
+
+# 2.1 STOCHASTIC VISUAL STIMULATION
+
+We recall some theoretical results about the artificial textures we use in the current work. Firstly, we use textures that are stationary Gaussian Random Fields (GRFs) fully characterized by their scalar mean and their auto-correlation function (or equivalently their power spectrum i.e. the autocorrelation Fourier transform). Interestingly, such GRFs can be seen as the limit of high intensity discrete spot noises. This result allows one to relate the densities of local image features such as orientation and scales to the power spectrum of the image (seen as a GRF). In summary, it provides a link between scalar densities and the high-dimensional Gaussian distribution of the image. We will
+
+see in later sections that this result leads both approach to similar predictions for perceptual scales. Secondly, we use naturalistic textures that are obtained by imposing high-order and high-dimensional statistics obtained using VGG-19. However, the result mentioned above and detailed below does not hold for naturalistic textures. It is unknown at this stage if similar results could be obtained with some feature under some (non-linear) transformation.
+
+Asymptotic Discrete Spot Noise Let $\xi_0 = (1,0)$ . Let $g_{\sigma}$ be a Gabor function defined for all $\sigma > 0$ and for all $x \in \mathbb{R}^2$ by $g_{\sigma}(x) = \frac{1}{2\pi} \cos(x \cdot \xi_0) e^{-\frac{\sigma^2}{2} \|x\|^2}$ . In addition, let $\varphi_{z,\theta}$ be a scaled rotation defined for all $(z,\theta) \in \mathbb{R}_+ \times [0,\pi]$ by $\varphi_{z,\theta}(x) = z R_{-\theta}(x)$ where $R_{\theta}$ is the rotation of angle $\theta$ . Now, let $F_{\lambda,\sigma}$ be a discrete spot noise of intensity $\lambda > 0$ defined as the following random field for all $x \in \mathbb{R}^2$ , $F_{\lambda,\sigma}(x) = \sqrt{\lambda} \sum_{k \in \mathbb{N}} g_{\sigma}(\varphi_{Z_k, \Theta_k}(x - X_k))$ where $(X_k, Z_k, \Theta_k)_{k \in \mathbb{N}}$ are iid random variables. Specifically $(X_k)_{k \in \mathbb{N}}$ is a 2-D Poisson process of intensity $\lambda > 0$ and $(Z_k, \Theta_k)_{k \in \mathbb{N}}$ have densities $(\mathbb{P}_Z, \mathbb{P}_{\Theta})$ .
+
+Proposition 1 (Convergence and Power Spectrum). In the limit of infinite intensity $(\lambda \longrightarrow +\infty)$ and pure wave $(\sigma \longrightarrow 0)$ , $F_{\lambda,\sigma}$ converges towards a Gaussian field $F$ with the following power spectrum for all $\xi \in \mathbb{R}^2$ ,
+
+$$
+\hat {\gamma} (\xi) = \frac {1}{\| \xi \| ^ {2}} \mathbb {P} _ {Z} (\| \xi \|) \mathbb {P} _ {\Theta} (\angle \xi)
+$$
+
+where $\xi = (\| \xi \| \cos (\angle \xi),\| \xi \| \sin (\angle \xi))$
+
+Proof. This is a special case of Proposition 2 in Vacher et al. (2018). The general result is Theorem 3.1 in Galerne (2010).
+
+In practice, the distribution $\mathbb{P}_Z$ and $\mathbb{P}_{\Theta}$ are parametrized by $(Z_0,\Sigma_Z)$ and $(\Theta_0,\Sigma_{\Theta})$ respectively.
+
+By providing a relation between local feature statistics (orientation and scale) and the image power spectrum, Proposition 1 will allow us to justify the common assumption made when modeling psychophysical data that is, the feature of interest is directly used by the observer instead of the image (Knill & Richards, 1996; Stocker & Simoncelli, 2006; Girshick et al., 2011). See Section 2.3.
+
+Interpolation of Naturalistic Textures Even though for experimental purposes the GRFs described above can be parameterized by just a few scalar variables (Vacher et al., 2018), naturalistic textures depend on the statistics of high-dimensional features extracted at different layers of VGG-19 (Gatys et al., 2015; Vacher et al., 2020). Previous algorithms widely used in vision studies (Portilla & Simoncelli, 2000; Vacher & Briand, 2021) were using fewer parameters, but the number was still too large to derive clear and interpretable results (Okazawa et al., 2015). One way to efficiently collapse the dimension parameterizing those textures is to use interpolation (Vacher et al., 2020). As a consequence the texture features of an interpolation of textures extracted at layers $k$ are interpreted as realizations of a random variable $A_{k}(s)$ with mean $\mu_W(s)$ and covariance $\Sigma_W(s)$ (see Appendix C). Assuming Gaussianity, it will become possible to derive predictions for the perceptual scale measured along the interpolation path.
+
+# 2.2 THURSTONE SCALE, FISHER INFORMATION AND MLDS
+
+First, we define more precisely the encoding model given in Equation 2 as follows
+
+$$
+M = R + N \quad \text {w h e r e} \quad R = \psi (S) \quad \text {w i t h} \quad \psi : \mathbb {S} \rightarrow \mathbb {S}. \tag {3}
+$$
+
+We use the above description to highlight the fact that $M$ , $R$ and $N$ are random variables that are internal to the observer while $S$ is external to them, it is an environment variable, an external stimulus. In practice, the noise $N$ is often assumed to be Gaussian with variance $\sigma^2$ . It corrupts the internal representation of the stimulus $R$ to give what we call the internal measurement $M$ . Then, we define Fisher information for two abstracts unidimensional random variables.
+
+Definition 1 (One-dimensional Fisher information). Let $X$ and $Y$ be two random variables defined respectively on two abstract spaces $\mathbb{X}$ and $\mathbb{Y}$ and let $\mathbb{P}_{X|Y}$ be the conditional density of $X$ knowing $Y$ . The Fisher information carried by $X$ about $Y$ is a function $\mathcal{I}: \mathbb{Y} \longrightarrow \mathbb{R}$ defined for all $y \in \mathbb{Y}$ by
+
+$$
+\mathcal {I} _ {Y} (y) = \mathbb {E} _ {X \mid Y} \left(\left(\frac {\partial \log (\mathbb {P} _ {X \mid Y})}{\partial y} (X, y)\right) ^ {2}\right). \tag {4}
+$$
+
+
+
+
+
+
+
+
+Figure 1: Texture samples and predicted perceptual scales for the spatial frequency mode $(z_0)$ , the spatial frequency bandwidth $(b_z)$ and the orientation bandwidth $(\sigma_{\theta})$ . Bottom-right: prediction obtained by combining Appendix A and Equation (5)
+
+In statistics, Fisher information is used as a upper bound of the precision of an estimation (see Cramér-Rao bound). This is also how we interpret it for an observer, namely the maximal precision of their estimation of a stimulus $S$ .
+
+The precise definition given above is helpful to realize that the Fisher information carried by $M$ about $S(\mathcal{I}_S)$ is different from the one carried by $M$ about $R(\mathcal{I}_R)$ . We can go one step further though, and establish the following relation between those two
+
+$$
+\mathcal {I} _ {S} (s) = \psi^ {\prime} (s) ^ {2} \mathcal {I} _ {R} (\psi (s)). \tag {5}
+$$
+
+A reformulation of Thurstone law of comparative judgment (Thurstone, 1927) is to assume that the Fisher information of an observer's internal representation $\mathcal{I}_R$ is constant. It is not so obvious to understand why this assumption is relevant. The idea is that an observer has only access to her internal states, she never observes any realization of an external stimulus $S$ . Every external variable is transformed to an internal one through the psychological function $\psi$ . Therefore, without any knowledge about the external world, a fair assumption is to allocate equal resources to every possible internal state in order to be equally precise in our estimates of different states (without knowing to what they correspond to in the external world). This assumption is also equivalent to assuming that internal observer's noise (a common notion used in psychophysics) is constant. If the internal Fisher information is constant we can now express the psychological function simply in terms of external Fisher information. This is summarized in the following proposition.
+
+Proposition 2. Assume Equation (3), the internal Fisher information $\mathcal{I}_R$ is constant if and only if for all $s\in \mathbb{S}$ the psychological function $\psi$ verifies
+
+$$
+\psi (s) \propto \int_ {s _ {\text {i n i t}}} ^ {s} \sqrt {\mathcal {I} _ {S} (t)} \mathrm {d} t. \tag {6}
+$$
+
+Proof. See Appendix D.
+
+
+
+Relation to the MLDS observer model. In the MLDS framework, an observer has to judge which pair of stimuli is more similar to another. Assuming three stimuli $(s_i,s_j,s_k)$ , those are transformed through the psychological scale $\psi$ and the observer responds by comparing the difference of differences between the pairs $d_{i,j,k} = |\psi (s_i) - \psi (s_j)| - |\psi (s_j) - \psi (s_k)|$ . This difference is assumed to be corrupted by an internal noise $N_{\mathrm{mlds}}$ of constant variance $\sigma_{\mathrm{mlds}}^2$ i.e. $\Delta_{i,j,k} = d_{i,j,k} + N_{\mathrm{mlds}}$ . Those assumptions are sufficient to recover an estimate of $\psi$ (Knblauch & Maloney, 2008). In addition, it is often assumed that there is no specific internal ordering of the variables so that the difference $d_{i,j,k}$ can be written without absolute value. In that case, assuming the encoding model (3) is enough to recover the MLDS observer model, we have the following relation between the noise variances $\sigma_{\mathrm{mlds}}^2 = 4\sigma^2$ .
+
+
+
+
+
+
+Figure 2: Texture samples and predicted perceptual scales for various interpolation between arbitrary textures. Red corresponds to the early sensitivity group (i.e. shallow-to-steep slope). Blue corresponds to the late sensitivity group (i.e. steep-to-shallow slope). Yellow corresponds to conflicting prediction across VGG-19 layers. Bottom-right: prediction obtained by combining Proposition 4 and Equation (5). For pixels, images and wavelet, we also assume Gaussianity as in Equation (8) (pixel and wavelet) and as in Equation (7) (images). See details in Appendix F.
+
+
+
+
+interpolation weight
+
+
+
+# 2.3 FISHER INFORMATION CARRIED BY THE IMAGE VS BY THE LOCAL FEATURES
+
+In the previous section, we have introduce an observer model based on an abstract random internal measurement $M$ . It is often unclear what those measurements are. Ideally inspired by neurophysiology, the measurements are responses of neurons to the image often modeled by Linear/Non-linear operations, even though those modeling stages are often dropped in perceptual studies. In the case of GRFs parameterized by spatial frequency (or scale) and orientation distributions, it is often accepted to assume that the measurements are samples of an appropriate distribution e.g. a Log-Normal distribution for the spatial frequency or a Von-Mises distribution for the orientation. Using the notation of the previous section, these cases correspond to measurement $M = Z$ with stimulus $S = Z_0$ and measurement $M = \Theta$ with stimuli $S = \Theta_0$ . We will see that in both cases this is equivalent to consider that measurements are the image itself $M = F$ with $S = Z_0$ or $S = \Theta_0$ . This is because Fisher information is given in closed-form and that perceptual scale can be predicted using Proposition 2. Similar results hold for $S = B_Z$ and $S = \Sigma_\theta$ (note that $(Z_0, B_Z)$ and $(\Theta_0, \Sigma_\Theta)$ are parameters of $\mathbb{P}_Z$ and $\mathbb{P}_\Theta$ introduced in Section 2.1). The predictions are given in Figure 1.
+
+Fisher Information of Log-Normal and Von-Mises Distributions We give the precise parametrization and the corresponding Fisher information of the Log-Normal and Von-Mises distributions in Appendix A.
+
+Fisher Information of Parametric GRFs Now, we consider a GRF texture $F$ with mean $\mu \in \mathbb{R}$ and autocorrelation function $\gamma$ (or equivalently power spectrum $\hat{\gamma}$ ) parameterized by $s \in \mathbb{S}$ . Mathematically, the texture can be expressed for all $x \in \mathbb{R}^2$ and $s \in \mathbb{S}$ , as
+
+$$
+F (x, s) = \mu + \int_ {\mathbb {R} ^ {2}} k (x - y, s) \mathrm {d} W (y) \tag {7}
+$$
+
+where $k(\cdot ,s) = \mathcal{F}^{-1}(\sqrt{\hat{\gamma}(\cdot,s)})$ and $W$ is a classical Wiener process.
+
+Proposition 3. The Fisher Information carried by $F$ about $S$ is
+
+$$
+\mathcal {I} (s) = \frac {1}{2} \int_ {\mathbb {R} ^ {2}} \frac {1}{| \hat {\gamma} (\xi , s) | ^ {2}} \left| \frac {\partial \hat {\gamma} (\xi , s)}{\partial s} \right| ^ {2} \mathrm {d} \xi = \frac {1}{2} \int_ {\mathbb {R} ^ {2}} \left| \frac {\partial \log (\hat {\gamma} (\xi , s))}{\partial s} \right| ^ {2} \mathrm {d} \xi .
+$$
+
+Proof. This is a specific case of Whittle formula (Whittle, 1953, Theorem 9).
+
+We combine Proposition 3 with Proposition 1 using the Log-normal and the Von-Mises distributions to express the power spectrum $\hat{\gamma}$ parameterized by $S = Z_0$ , $S = B_Z$ , $S = \Theta_0$ or $S = \Sigma_{\theta}$ . Therefore, the Fisher information carried by measurements $M = F$ comes down to the Fisher information carried by measurements $M = Z$ (spatial frequency) or $M = \Theta$ (orientation) as described above up to a multiplicative constant of $1/2$ . As a consequence both approaches lead to similar predictions about the perceptual scales measured for these parameters.
+
+Fisher Information of Parametric Gaussian Vectors In the case of interpolation between naturalistic textures, we do not have a direct generative model of the texture conditionally on the interpolation parameter $s$ . Instead, the texture is generated using a gradient descent to impose the statistics of VGG-19 features at multiples layers for which we have a generative model. Therefore, at layer $k$ and for $s \in \mathbb{S}$ the activation $A_{k}(s)$ of texture $F_{k}(s)$ is
+
+$$
+A _ {k} (s) = \mu_ {k} (s) + \Sigma_ {k} (s) N \quad \text {w i t h} \quad \mu_ {k} \in \mathcal {C} ^ {1} \left(\mathbb {S}, \mathbb {R} ^ {d _ {k}}\right) \quad \text {a n d} \quad \Sigma_ {k} \in \mathcal {C} ^ {1} \left(\mathbb {S}, \mathbb {R} ^ {d _ {k} \times d _ {k}}\right) \tag {8}
+$$
+
+where $N\sim \mathcal{N}(0,I_{d_k})$ is a standard normal random vector and $d_{k}$ is the feature dimension of layer $k$
+
+Proposition 4. The Fisher Information carried by $A_{k}$ about $S$ is
+
+$$
+\mathcal {I} (s) = \mu_ {k} ^ {\prime} (s) \Sigma_ {k} (s) ^ {- 1} \mu_ {k} ^ {\prime} (s) + \frac {1}{2} \operatorname {T r} \left(\Sigma_ {k} (s) ^ {- 1} \Sigma_ {k} ^ {\prime} (s) \Sigma_ {k} (s) ^ {- 1} \Sigma_ {k} ^ {\prime} (s)\right).
+$$
+
+Proof. See Appendix B.
+
+As stated earlier in the manuscript, no link can be made with interpretable feature distributions as it is the case for GRFs. Though, precise expressions for $\mu_{k}$ and $\Sigma_{k}$ are available in close forms in the Gaussian case as assumed here (see Appendix C). In practice, the feature activations are not Gaussian (Vacher et al., 2020).
+
+
+Figure 3: Measured and predicted perceptual scales for the spatial frequency mode (left), the spatial frequency bandwidth (middle) and the orientation bandwidth (right).
+
+
+
+
+
+# 2.4 PREDICTIONS AND EXPERIMENTAL METHODS
+
+The calculated Fisher informations together with Proposition 2 allows us to predict the perceptual scales corresponding to the parameters described in the previous section. These predictions hold under the assumed generative models for measurements.
+
+Predictions In the case of GRFs textures, we recall that assuming that spatial frequency or orientation are directly measured or that the image as a whole is measured makes no differences in the prediction (see bottom-right of Figure 1). In the case of naturalistic textures, the measurements are assumed to be the feature activations of the texture in VGG-19 at layer 2 to 5 (see bottom-right of Figure 2). For the naturalistic, we alternatively propose that measurements are the single pixel gray levels, the image itself (i.e. the power spectrum as for GRFs) or the wavelet activations.
+
+Experimental Methods The experiment consists of trials where participants have to make a similarity judgment. Participants are presented with 3 stimuli with parameters $s_1 < s_2 < s_3$ and are required to choose which of the two pairs with parameters $(s_1, s_2)$ and $(s_2, s_3)$ is the most similar. We used four sets of textures (see Figure 1 and 2): (i) the first set consists of parameterized artificial textures where we measured the perceptual scales of spatial frequency, spatial frequency bandwidth and orientation bandwidth (see Appendix E for details); (ii) the other three sets consist of interpolations between arbitrary textures. A set of textures for which the perceptual scale corresponds to an early sensitivity (i.e. steep-to-shallow slope, see top-left of Figure 2). Another one for which the perceptual scale corresponds to late sensitivity (i.e. shallow-to-steep slope, see top-right of Figure 2). And a last set for which the predictions are inconsistent from one layer of VGG-19 to another (bottom-left of Figure 2). All stimuli had an average luminance of 128 (range [0, 255]) and an RMS contrast of 39.7. For each texture pair, we use 13 equally spaced $(\delta_s = 0.083)$ interpolation weights. To ensure that stimulus comparisons are around the discrimination threshold we only use triplets such that $|s_{1,3} - s_2| \leq 3\delta_s$ . For each texture pair, a group of 5 naive participants performed the experiment. Participants were recruited through the platform prolific (https://www.prolific.com), performed the
+
+
+Figure 4: Measured and predicted (power spectrum) perceptual scales for the early (top row) and late (bottom row) sensitivity pairs. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+experiments online, and were paid $9£/hr$ . Monitor gamma was measured using a psychometric estimation and corrected to 1. The MLDS model is described at the end of Section 2.2. The protocol was approved by the CER U-Paris (IRB 00012020-54).
+
+# 3 RESULTS
+
+# 3.1 ORIENTATION AND SPATIAL FREQUENCY
+
+The perception of spatial frequencies is well-known in vision studies, its perceptual scale is expected to be logarithmic. Such a scale is also predicted by Fisher information as integrating the square-root (Proposition 2) of a squared inverse (Proposition 5) leads to a logarithm. The measured perceptual scale of the spatial frequency mode matches correctly this prediction (left of Figure 3). The spatial frequency and orientation bandwidths are less studied, the predictions are qualitatively the same as for the spatial frequency mode (Proposition 2 and Appendix Proposition 6). The Fisher information of the orientation bandwidth
+
+is more complex but leads to a similar curve. The measured perceptual scale is more variable for the orientation bandwidth (larger error bars) but is still in line with the prediction (predicted offset from linear behavior is exaggerated, see right of Figure 3). In contrast, the measured perceptual scales of spatial frequency bandwidth is approximately linear for low values while its gets supra-linear at intermediate values and even saturate for the highest values (center of Figure 3).
+
+
+Figure 5: Measured and predicted (auto-cor) perceptual scales for the conflicting prediction pairs. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+# 3.2 INTERPOLATION BETWEEN NATURALISTIC TEXTURES
+
+We present the perceptual scales measured for the different groups of natural textures in Figure 4 and 5. On these figures, the prediction given by the auto-correlation (i.e. when considering the textures as GRFs) is shown. Predictions assuming alternative measurements (pixel, wavelet, and VGG-19) are quantitatively compared in Figure 6 using the following Area Matching Score: AMS = $\int_0^1\mathrm{sign}(f_{\mathrm{m}}(x) - x)(f_{\mathrm{th}}(x) - x)\big / |f_{\mathrm{m}}(x) - x|\mathrm{d}x$ where $f_{\mathrm{m}}$ and $f_{\mathrm{th}}$ are respectively the measured and predicted scales. Intuition about score values is given in Figure 6a.
+
+Early and Late Sensitivity For the set of early sensitivity texture pairs, measured perceptual scales are inline with the predictions (Figure 4) in the sense that a linear (pair01, pair04-05) or a supra-linear (pair02-03) perceptual scale is measured in all texture pairs. The same hold for the set of late sensitivity texture pairs (Figure 4), but this time in the sense that a linear (pair06 and pair08) or a sub-linear (pair07 and pair09-10) perceptual scale is measured in all texture
+
+
+
+
+Figure 6: Prediction scores. (a) Intuition about score values when comparing two perceptual functions. (b) Left : scores for each pair and for different predictions. Right : averaged scores for different predictions with $99.5\%$ bootstrapped confidence intervals.
+
+pairs. Such a result is also valid for the predictions based on alternative measurement assumptions as shown in Figure 6 by the fact that all scores are positive for pair01-10.
+
+Conflicting predictions For the set of textures with conflicting predictions (Figure 5), for both texture pairs, we observe that the GRF measurement assumption predicts a late sensitivity while the measured perceptual scale corresponds to an early sensitivity with a late saturation. Other measurement assumptions are not providing better prediction as their score is either close to 0 or negative. However, there is one exception for pair11 under the wavelet measurement assumption which has a ideal score, close to 1 (up to score limitation, see Section 4).
+
+Measurement Assumption Scores As previously stated, all assumptions predict correctly whether the scale corresponds to late or early sensitivity (positive scores) except for the conflicting prediction texture pairs. Note that pair05 has also a score close to 0 under all assumptions (though this might be due to score limitation, see Section 4). On average, the GRF assumption is the best with an average score $(\pm 99.5\%)$ CI close to 1 $(0.92 \pm 0.69)$ . The single pixel distribution assumption only predicts a linear behavior and has therefore a score close to 0. In contrast, the wavelet and VGG-19 assumptions often overestimate the early or late sensitivity (average scores above 1). We conducted additional experiments in which we fixed the power spectrum of all textures along a path between a pair to be the average of the pair's. In this case the power spectrum cannot explain the measured perceptual scale the operation is indeed deteriorating discriminability (see Appendix H).
+
+# 4 DISCUSSION AND CONCLUSION
+
+In the case of GRFs, we have shown that the univariate assumption behind the Bayesian theories of perception and the absence of this assumption (i.e. the observer is using all the information in the image) lead to the same prediction for the perceptual scales of spatial frequencies, orientations and their bandwidths. Such a result is due to the fact that these local feature distributions directly appear in the power spectrum (the Fourier transform of the auto-correlation) of GRFs (Proposition 1) and to our second result that is the perceptual scale is related to the Fisher information of the feature distribution (Proposition 2). In the case of naturalistic textures, it is unknown if such a result relating a (non-linear) transform and some feature distribution holds. Therefore, it is necessary to make new hypotheses about the measurements in order to predict the perceptual scale of an observer. We tested this issue in a series of difference scaling experiments involving GRF and naturalistic textures. Our main result is that the perceptual scale is mainly driven by the auto-correlation (or the power spectrum). However, it does not perfectly explain the measured perceptual scales, and in particular, the perceptual scale of pair11 appears to be driven by the wavelet representation. A highly interesting future directions is to compare the perceptual scale to a neurometric scale, an equivalent scale but deduced from neurophysiological recordings as the equivalent exists for the psychometric function (Newsome et al., 1989; Berens et al., 2011). Other limitations lie in the MLDS method. Usually, running a difference scaling experiment requires to know ahead of time an approximation of the observer's sensitivity to the parameter that one would like to test. Here, we have not estimated the sensitivity of each participant and, therefore, have not adapted the stimuli accordingly. Yet, it seems that we were near the participants sensitivity (see Appendix G). In addition, the MLDS method is limited to the study of a single stimulus dimension while extensions can still be developed Knblauch et al. (2012) and compared to higher-dimensional theories Malo & Gutiérrez (2006); Laparra & Malo (2015). All these questions demonstrate the ambition of our approach and the work that remains to be done to understand, beyond perceptual distance, perceptual metrics.
+
+# REPRODUCIBILITY STATEMENT
+
+The reproducibility of our work will be ensured by the links provided to the data and code. Theoretical results are supported by proofs or references to proof.
+
+# REFERENCES
+
+Guillermo Aguilar and Marianne Maertens. Toward reliable measurements of perceptual scales in multiple contexts. Journal of Vision, 20(4):19-19, 2020.
+Guillermo Aguilar, Felix A Wichmann, and Marianne Maertens. Comparing sensitivity estimates from mlds and forced-choice methods in a slant-from-texture experiment. Journal of Vision, 17(1): 37-37, 2017.
+Dan Amir and Yair Weiss. Understanding and simplifying perceptual distances. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12226-12235, 2021.
+Fred Attneave. Some informational aspects of visual perception. Psychological review, 61(3):183, 1954.
+Horace B Barlow et al. Possible principles underlying the transformation of sensory messages. Sensory communication, 1(01):217-233, 1961.
+Pouya Bashivan, Kohitij Kar, and James J DiCarlo. Neural population control via deep image synthesis. Science, 364(6439):eaav9436, 2019.
+Philipp Berens, Alexander S Ecker, Sebastian Gerwinn, Andreas S Tolias, and Matthias Bethge. Reassessing optimal neural population codes with neurometric functions. Proceedings of the National Academy of Sciences, 108(11):4423-4428, 2011.
+Matthias Bethge, David Rotermund, and Klaus Pawelzik. Optimal short-term population coding: When fisher information fails. Neural computation, 14(10):2317-2351, 2002.
+Nicolas Brunel and Jean-Pierre Nadal. Mutual information, fisher information, and population coding. Neural computation, 10(7):1731-1757, 1998.
+PL Chebyshev. On mean values.[o srednik velichinakh]. Matem. Sbornik, pp. 1-9, 1867.
+Yongxin Chen, Tryphon T Georgiou, and Allen Tannenbaum. Optimal transport for gaussian mixture models. IEEE Access, 7:6269-6278, 2018.
+Frédéric Devinck and Kenneth Knoblauch. A common signal detection model accounts for both perception and discrimination of the watercolor effect. Journal of Vision, 12(3):19-19, 2012.
+Khemraj Emrith, MJ Chantler, PR Green, LT Maloney, and ADF Clarke. Measuring perceived differences in surface texture due to changes in higher order statistics. JOSA A, 27(5):1232-1244, 2010.
+Bruno Galerne. Stochastic image models and texture synthesis. PhD thesis, École normale supérieure de Cachan-ENS Cachan, 2010.
+Leon Gatys, Alexander S Ecker, and Matthias Bethge. Texture synthesis using convolutional neural networks. Advances in neural information processing systems, 28, 2015.
+Ahna R Girshick, Michael S Landy, and Eero P Simoncelli. Cardinal rules: visual orientation perception reflects knowledge of environmental statistics. Nature neuroscience, 14(7):926-932, 2011.
+Alexander Hepburn, Valero Laparra, Raul Santos-Rodriguez, Johannes Ballé, and Jesus Malo. On the relation between statistical learning and perceptual distances. In 10th International Conference on Learning Representations, ICLR 2022, 2022.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
+
+Ingmar Kanitscheider, Ruben Coen-Cagli, and Alexandre Pouget. Origin of information-limiting noise correlations. Proceedings of the National Academy of Sciences, 112(50):E6973-E6982, 2015.
+Eric Kee and Hany Farid. A perceptual metric for photo retouching. Proceedings of the National Academy of Sciences, 108(50):19907-19912, 2011.
+David C Knill and Whitman Richards. Perception as Bayesian inference. Cambridge University Press, 1996.
+Kenneth Knoblauch and Laurence T Maloney. Mlds: Maximum likelihood difference scaling in r. Journal of Statistical Software, 25:1-26, 2008.
+Kenneth Knoblauch, Laurence T Maloney, Kenneth Knoblauch, and Laurence T Maloney. Maximum likelihood conjoint measurement. Modeling psychophysical data in $R$ , pp. 229-256, 2012.
+Andrey Kolmogoroff. Grundbegriffe der wahrscheinlichkeitsrechnung. Springer-Verlag Berlin Heidelberg, 1933.
+Tuomas Kynkänniemi, Tero Karras, Miika Aittala, Timo Aila, and Jaakko Lehtinen. The role of imagenet classes in fréchet inception distance. In *The Eleventh International Conference on Learning Representations*, 2023.
+Valero Laparra and Jesús Malo. Visual aftereffects and sensory nonlinearities from a single statistical framework. Frontiers in human neuroscience, 9:557, 2015.
+S Laughlin. Matching coding to scenes to enhance efficiency. In Physical and Biological Processing of Images: Proceedings of an International Symposium Organised by the Rank Prize Funds, London, England, 27-29 September, 1982, pp. 42-52. Springer, 1983.
+Jan R Magnus. The moments of products of quadratic forms in normal variables. Statistica Neerlandica, 32(4):201-210, 1978. URL https://www.janmagnus.nl/papers/JRM003.pdf.
+Jesús Malo and Juan Gutiérrez. V1 non-linear properties emerge from local-to-global non-linear ica. Network: Computation in Neural Systems, 17(1):85-102, 2006.
+Laurence T Maloney and Joong Nam Yang. Maximum likelihood difference scaling. Journal of Vision, 3(8):5-5, 2003.
+Tyler S Manning, Benjamin N Naecker, Iona R McLean, Bas Rokers, Jonathan W Pillow, and Emily A Cooper. A general framework for inferring bayesian ideal observer models from psychophysical data. *eneuro*, 10(1), 2023.
+William T Newsome, Kenneth H Britten, and J Anthony Movshon. Neuronal correlates of a perceptual decision. Nature, 341(6237):52-54, 1989.
+Gouki Okazawa, Satohiro Tajima, and Hidehiko Komatsu. Image statistics underlying natural texture selectivity of neurons in macaque v4. Proceedings of the National Academy of Sciences, 112(4): E351-E360, 2015.
+Bruno A Olshausen and David J Field. How close are we to understanding v1? Neural computation, 17(8):1665-1699, 2005.
+Kaare Brandt Petersen, Michael Syskind Pedersen, et al. The matrix cookbook. Technical University of Denmark, 7(15):510, 2008.
+Javier Portilla and Eero P Simoncelli. A parametric texture model based on joint statistics of complex wavelet coefficients. International journal of computer vision, 40:49-70, 2000.
+Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in neural information processing systems, 29, 2016.
+
+Alan A Stocker and Eero P Simoncelli. Noise characteristics and prior expectations in human visual speed perception. Nature neuroscience, 9(4):578-585, 2006.
+Louis L Thurstone. A law of comparative judgment. Psychological review, 34(4):273, 1927.
+Jonathan Vacher and Thibaud Briand. The Portilla-Simoncelli Texture Model: towards Understanding the Early Visual Cortex. Image Processing On Line, 11:170-211, 2021. https://doi.org/10.5201/ipol.2021.324.
+Jonathan Vacher, Andrew Isaac Meso, Laurent U Perrinet, and Gabriel Peyre. Bayesian modeling of motion perception using dynamical stochastic textures. *Neural computation*, 30(12):3355-3392, 2018.
+Jonathan Vacher, Aida Davila, Adam Kohn, and Ruben Coen-Cagli. Texture interpolation for probing visual perception. Advances in neural information processing systems, 33:22146-22157, 2020.
+Jonathan D Victor, Mary M Conte, and Charles F Chubb. Textures as probes of visual processing. Annual review of vision science, 3:275-296, 2017.
+Tassilo von der Twer and Donald IA MacLeod. Optimal nonlinear codes for the perception of natural colours. Network: Computation in Neural Systems, 12(3):395, 2001.
+Martin J Wainwright. Visual adaptation as optimal information transmission. Vision research, 39(23): 3960-3974, 1999.
+Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600-612, 2004.
+Xue-Xin Wei and Alan A Stocker. Mutual information, fisher information, and efficient coding. Neural computation, 28(2):305-326, 2016.
+Xue-Xin Wei and Alan A Stocker. *Lawful relation between perceptual bias and discriminability.* Proceedings of the National Academy of Sciences, 114(38):10244-10249, 2017.
+Peter Whittle. The analysis of multiple stationary time series. Journal of the Royal Statistical Society: Series B (Methodological), 15(1):125-139, 1953.
+Stuart Yarrow, Edward Challis, and Peggy Series. Fisher and shannon information in finite neural populations. Neural computation, 24(7):1740-1780, 2012.
+Hang Zhang, Xiangjuan Ren, and Laurence T Maloney. The bounded rationality of probability distortion. Proceedings of the National Academy of Sciences, 117(36):22024-22034, 2020.
+Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 586-595, 2018.
+
+# A FISHER INFORMATION OF LOG-NORMAL AND VON-MISES RANDOM VARIABLES
+
+A random variable $Z$ follows a log-normal distribution $(Z \sim \mathcal{LN}(z_0, b_Z))$ if it has the following density defined for all $z > 0$ by
+
+$$
+\mathbb {P} _ {Z} (z; z _ {0}, b _ {Z}) = \frac {2}{z b _ {Z} \sqrt {\ln (2) \pi}} \exp \left(- \frac {4 \left(\ln \left(\frac {z}{z _ {0}}\right) - \frac {\ln (2)}{8} b _ {Z} ^ {2}\right) ^ {2}}{\ln (2) b _ {Z} ^ {2}}\right)
+$$
+
+where $z_0$ is the mode and $b_{Z}$ is the octave bandwidth of the density. A random variable $\Theta$ follows a Von-Mises distribution $(\Theta \sim \mathcal{V}\mathcal{M}(\theta_0,\sigma_\Theta))$ if it has the following density defined for all $\theta \in [0,\pi ]$ by
+
+$$
+\mathbb {P} _ {\Theta} (\theta ; \theta_ {0}, \sigma_ {\Theta}) = \frac {1}{\pi \mathcal {B} _ {0} (^ {1 / 4} \sigma_ {\Theta} ^ {2})} \exp \left(\frac {\cos (2 (\theta - \theta_ {0}))}{4 \sigma_ {\Theta} ^ {2}}\right).
+$$
+
+Proposition 5. Let $Z \sim \mathcal{LN}(z_0, b_Z)$ . The Fisher Informations carried by $Z$ about respectively $Z_0$ and $B_Z$ are
+
+$$
+\mathcal {I} (z _ {0}) = \frac {8}{z _ {0} ^ {2} b _ {Z} ^ {2} \ln (2)} a n d \mathcal {I} (b _ {Z}) = \frac {\ln (2)}{2} \left(1 + \frac {4}{b _ {z} ^ {2} \ln (2)}\right)
+$$
+
+Proposition 6. Let $\Theta \sim \mathcal{VM}(\theta_0, \sigma_\Theta)$ . The Fisher Informations carried by $\Theta$ about respectively $\Theta_0$ and $\Sigma_\Theta$ are
+
+$$
+\mathcal {I} (\theta_ {0}) = \frac {1}{\sigma_ {\Theta} ^ {2}} \frac {\mathcal {B} _ {1} (1 / 4 \sigma_ {\Theta} ^ {2})}{\mathcal {B} _ {0} (1 / 4 \sigma_ {\Theta} ^ {2})} \quad a n d \quad \mathcal {I} (\sigma_ {\Theta}) = \frac {1}{4 \sigma_ {\Theta} ^ {6}} \left(1 - \frac {\mathcal {B} _ {1} (1 / 4 \sigma_ {\Theta} ^ {2})}{\mathcal {B} _ {0} (1 / 4 \sigma_ {\Theta} ^ {2})} \left(4 \sigma_ {\Theta} ^ {2} + \frac {\mathcal {B} _ {1} (1 / 4 \sigma_ {\Theta} ^ {2})}{\mathcal {B} _ {0} (1 / 4 \sigma_ {\Theta} ^ {2})}\right)\right)
+$$
+
+# B FISHER INFORMATION OF PARAMETRIC GAUSSIAN VECTOR
+
+Proof of Proposition 4. We start by reminding the following calculus results (Petersen et al., 2008):
+
+(i) $\nabla \log (|A|) = \left(A^{-1}\right)^T$
+(ii) $\mathrm{d}A^{-1} = -A^{-1}\mathrm{d}AA^{-1}$
+
+The log of $\mathbb{P}_{X|S}$ is
+
+$$
+\log (\mathbb {P} _ {X | S} (x | s)) = - \frac {1}{2} \log (2 \pi) - \frac {1}{2} \log (| \Sigma (s) |) - \frac {1}{2} (x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} (x - \mu (s)).
+$$
+
+Then,
+
+$$
+\begin{array}{l} \frac {\partial \log (\mathbb {P} _ {X \mid S})}{\partial s} (x, s) = - \frac {1}{2} \operatorname {T r} (\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)) - \frac {1}{2} (x - \mu (s)) ^ {T} \left(\Sigma (s) ^ {- 1}\right) ^ {\prime} (x - \mu (s)) \\ + (x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s). \\ \end{array}
+$$
+
+Then,
+
+$$
+\left(\frac {\partial \log (\mathbb {P} _ {X | S})}{\partial s} (x, s)\right) ^ {2} = C _ {1} + C _ {2} + C _ {3} + C _ {4} + C _ {5} + C _ {6}
+$$
+
+where
+
+$$
+C _ {1} = \frac {1}{4} \operatorname {T r} (\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)) ^ {2},
+$$
+
+$$
+C _ {2} = \frac {1}{4} \left(\left(x - \mu (s)\right) ^ {T} \left(\Sigma (s) ^ {- 1}\right) ^ {\prime} \left(x - \mu (s)\right)\right) ^ {2},
+$$
+
+$$
+C _ {3} = \left(\left(x - \mu (s)\right) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s)\right) ^ {2},
+$$
+
+$$
+C _ {4} = \frac {1}{2} \operatorname {T r} \left(\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)\right) \left(x - \mu (s)\right) ^ {T} \left(\Sigma (s) ^ {- 1}\right) ^ {\prime} (x - \mu (s)),
+$$
+
+$$
+C _ {5} = - \operatorname {T r} \left(\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)\right) \left(x - \mu (s)\right) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s),
+$$
+
+$$
+C _ {6} = - (x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s) (x - \mu (s)) ^ {T} (\Sigma (s) ^ {- 1}) ^ {\prime} (x - \mu (s)).
+$$
+
+First, we observe that $\mathbb{E}(C_1) = C_1$ and that $\mathbb{E}(C_5) = \mathbb{E}(C_6) = 0$ (odd central moments).
+
+Then, following (ii), we have
+
+$$
+\left(\Sigma (s) ^ {- 1}\right) ^ {\prime} = - \Sigma (s) ^ {- 1} \Sigma^ {\prime} (s) \Sigma (s) ^ {- 1}.
+$$
+
+Hence,
+
+$$
+\begin{array}{l} \mathbb {E} \left(\left(x - \mu (s)\right) ^ {T} \left(\Sigma (s) ^ {- 1}\right) ^ {\prime} \left(x - \mu (s)\right)\right) = - \mathbb {E} \left(\left(x - \mu (s)\right) ^ {T} \Sigma (s) ^ {- 1} \Sigma^ {\prime} (s) \Sigma (s) ^ {- 1} \left(x - \mu (s)\right)\right) \\ = - \mathbb {E} \left(\left(\sqrt {\Sigma^ {\prime} (s)} \Sigma (s) ^ {- 1} (x - \mu (s))\right) ^ {T} \left(\sqrt {\Sigma^ {\prime} (s)} \Sigma (s) ^ {- 1} (x - \mu (s))\right)\right) \\ = - \operatorname {T r} (\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)). \\ \end{array}
+$$
+
+[Note: think about the covariance of $\sqrt{\Sigma'(s)}\Sigma(s)^{-1}(x - \mu(s))$ or see Magnus (1978).] Therefore, the expectation of $C_4$ is
+
+$$
+\mathbb {E} \left(C _ {4}\right) = - \frac {1}{2} \operatorname {T r} \left(\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)\right) ^ {2}.
+$$
+
+The expectation of $C_2$ is the second order moment of a quadratic form (see Magnus (1978)). Thus,
+
+$$
+\mathbb {E} \left(C _ {2}\right) = \frac {1}{4} \operatorname {T r} \left(\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)\right) ^ {2} + \frac {1}{2} \operatorname {T r} \left(\Sigma (s) ^ {- 1} \Sigma^ {\prime} (s) \Sigma (s) ^ {- 1} \Sigma^ {\prime} (s)\right).
+$$
+
+We can now deal with the expectation of the last term $C_3$ ,
+
+$$
+\begin{array}{l} \mathbb {E} (C _ {3}) = \mathbb {E} \left(\left((x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s)\right) ^ {2}\right) = \mathbb {E} \left((x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s) (x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s)\right) \\ = \mathbb {E} \left(\mu^ {\prime} (s) ^ {T} \Sigma (s) ^ {- 1} (x - \mu (s)) (x - \mu (s)) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s)\right) \\ = \mu^ {\prime} (s) ^ {T} \Sigma (s) ^ {- 1} \mathbb {E} \left((x - \mu (s)) (x - \mu (s)) ^ {T}\right) \Sigma (s) ^ {- 1} \mu^ {\prime} (s) = \mu^ {\prime} (s) ^ {T} \Sigma (s) ^ {- 1} \mu^ {\prime} (s). \\ \end{array}
+$$
+
+Summing all the expectations leads to the result.
+
+
+
+# C MEAN AND COVARIANCE OF A WASSERSTEIN BARYCENTER
+
+Proposition 7 (Wasserstein Barycenter of Gaussian Distributions). Let $X_0 \sim \mathcal{N}(\mu_0, \Sigma_0)$ and $X_1 \sim \mathcal{N}(\mu_1, \Sigma_1)$ be two Gaussian random variables. The Wasserstein interpolation between $\mathbb{P}_{X_0}$ and $\mathbb{P}_{X_1}$ is defined as
+
+$$
+\mathbb {P} _ {s} = \underset {\mathbb {P} \in \mathcal {P} (\mathbb {P} _ {X _ {0}}, \mathbb {P} _ {X _ {1}})} {\operatorname {a r g m i n}} (1 - s) W _ {2} (\mathbb {P} _ {X _ {0}}, \mathbb {P}) ^ {2} + s W _ {2} (\mathbb {P} _ {X _ {1}}, \mathbb {P}) ^ {2}
+$$
+
+where $\mathcal{P}(\mathbb{P}_{X_0},\mathbb{P}_{X_1})$ is the set of probability densities with marginals $\mathbb{P}_{X_0}$ and $\mathbb{P}_{X_1}$ and where
+
+$$
+W _ {2} (\mathbb {P} _ {X}, \mathbb {P} _ {Y}) ^ {2} = \inf _ {X \sim \mathbb {P} _ {X}, Y \sim \mathbb {P} _ {Y}} \mathbb {E} \left(\| X - Y \| ^ {2}\right)
+$$
+
+is the Wasserstein distance between $\mathbb{P}_X$ and $\mathbb{P}_Y$ . The probability distribution $\mathbb{P}_s$ is Gaussian with mean $\mu_W(s) = (1 - s)\mu_{X_0} + s\mu_{X_1}$ and covariance
+
+$$
+\Sigma_ {W} (s) = \Sigma_ {X _ {0}} ^ {- 1 / 2} \left((1 - s) \Sigma_ {X _ {0}} + s \left(\Sigma_ {X _ {0}} ^ {1 / 2} \Sigma_ {X _ {1}} \Sigma_ {X _ {0}} ^ {1 / 2}\right) ^ {1 / 2}\right) ^ {2} \Sigma_ {X _ {0}} ^ {- 1 / 2}.
+$$
+
+Proof. See (Chen et al., 2018).
+
+
+
+Corollary 1. Let $X_{s}\sim \mathcal{N}(\mu_{W}(s),\Sigma_{W}(s))$ where $((\mu_W(s),\Sigma_W(s)))$ are defined in Proposition 7, then the Fisher information is given by
+
+$$
+\begin{array}{l} \mathcal {I} (s) = (\mu_ {X _ {1}} - \mu_ {X _ {0}}) ^ {T} \Sigma_ {W B} (s) ^ {- 1} (\mu_ {X _ {1}} - \mu_ {X _ {0}}) \\ + \frac {1}{2} \operatorname {T r} \left(\Sigma_ {W B} (s) ^ {- 1} \Sigma_ {W B} ^ {\prime} (s) \Sigma_ {W B} (s) ^ {- 1} \Sigma_ {W B} ^ {\prime} (s)\right) \tag {9} \\ \end{array}
+$$
+
+where $\Sigma_{WB}^{\prime}(s) = 2s\bigl (\Sigma_{X_0} + \Sigma_{X_1} - Q_0 - Q_1\bigr) + Q_1 + Q_2 - 2\Sigma_{X_1}$ with
+
+$$
+Q _ {0} = \Sigma_ {X _ {0}} ^ {1 / 2} \left(\Sigma_ {X _ {0}} ^ {1 / 2} \Sigma_ {X _ {1}} \Sigma_ {X _ {0}} ^ {1 / 2}\right) \Sigma_ {X _ {0}} ^ {- 1 / 2} a n d Q _ {1} = \Sigma_ {X _ {0}} ^ {- 1 / 2} \left(\Sigma_ {X _ {0}} ^ {1 / 2} \Sigma_ {X _ {1}} \Sigma_ {X _ {0}} ^ {1 / 2}\right) \Sigma_ {X _ {1}} ^ {1 / 2}.
+$$
+
+Proof. Combine Proposition 4 and Proposition 7.
+
+# D PERCEPTUAL SCALE AND FISHER INFORMATION
+
+Proof of Proposition 2. One has $\mathbb{P}_{M|S}(m,s) = \mathbb{P}_{M|R}(m,\psi (s))$ which implies that
+
+$$
+\frac {\partial \log (\mathbb {P} _ {M | S})}{\partial s} (m, s) = \psi^ {\prime} (s) \frac {\partial \log (\mathbb {P} _ {M | R})}{\partial s} (m, \psi (s)).
+$$
+
+Therefore, by squaring this last equation and taking its expectation with respect to $M$ we obtain Equation (5). Then, taking the square root and integrating lead to the result.
+
+# EXPERIMENTAL DETAILS
+
+For the GRF textures we used the following parameters (see distributions in Appendix A):
+
+- Spatial freq. mode $(z_0)$ : [0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5],
+- Spatial freq. bandwidth $(b_{Z})$ : [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25],
+- Orientation bandwidth $(\sigma_{\Theta})$ : [1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5].
+
+The code to generate these stimuli is available here3.
+
+For the naturalistic interpolation of textures we use the natural textures available here. The interpolation parameters used are given in the main text (see Vacher et al. (2020) or Proposition 7 for the interpolation weight definition).
+
+# F FISHER INFORMATION CALCULATION
+
+Pixel assumption We consider that pixel are sample from a univariate Gaussian distribution. To compute the Fisher information, we estimate the mean and standard deviation and then use Proposition 4.
+
+Images assumption We consider the image to be a stationary GRF. To compute the Fisher information, we estimate the power spectrum and then use Proposition 3.
+
+Wavelet assumption We are using the steerable pyramid Portilla & Simoncelli (2000). Then, as in the case of VGG19 features, we consider that the vector of wavelet activations at each pixel location is a sample of multivariate Gaussian distribution. So we compute the empirical mean and covariance square root and use Proposition 4.
+
+# G INDIVIDUAL PERCEPTUAL SCALES
+
+In the figures below, we show the perceptual scale measured on each individual participant. Beware that the participants are not the same from one pair of textures to another despite being label as "Participant 0X".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 7: Gaussian textures. Measured perceptual scale for each participant. Top row: spatial frequency. Middle row: spatial frequency bandwidth. Bottom row: orientation bandwidth.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: Naturalistic textures, early sensitivity. Measured perceptual scale for each participant. Top-to-bottom row: pair01 to pair05. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 9: Naturalistic textures, late sensitivity. Measured perceptual scale for each participant. Top-to-bottom row: pair06 to pair10. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 10: Naturalistic textures, conflicting prediction. Measured perceptual scale for each participant. Top and bottom row: pair11 and pair12. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
+
+# H ADDITIONAL EXPERIMENTS: POWER SPECTRUM NORMALIZATION
+
+One conclusion of our first set of experiments on the set of texture pairs we have chosen is that the perceptual scale is mainly explained by the change in the power spectrum along the path from
+
+one texture to the other. We decided to normalize those textures by the average power spectrum between both textures of a pair and to run again a set of experiment. This manipulation deteriorates the perceptual discriminability between both textures as one can observe in Figure 11. In addition, the manipulation changes the activation of VGG19 for each texture and for that reason we were not able to derive new predictions of the perceptual scale using the new VGG19 features. Instead we show in the result Figures 12 and 13 the initial prediction (whatever that means) also shown in Figure 2 of the main text. Surprisingly, some of the empirical results somewhat align with the predictions (Figure 12 pair02 to pair04 and pair06 and pair08 to pair10. We have no clue whether this observation is totally spurious or if it underlies that the perceptual scale is explained by the higher-order statistics of the textures captured by VGG19. Indeed, how would it be possible if we have not even computed the prediction corresponding to the presented image? Well, VGG19 is trained on image-Net with some normalization, it is possible that the different layers of VGG19 are performing a normalization similar to the one we applied to the textures. Therefore, the predictions given by the original synthesized textures would be more correct that the one obtained with the power spectrum normalized textures. Unfortunately, the power spectrum manipulation also affects the level of noise estimated in the MLDS experiment (larger error bars in Figure 12/13 than in Figure 4/5) therefore the results are less reliable at the population level. Though, the individual results for the early and late sensitivity conditions shown in Figure 15, 14, tend to show that for some pair many participants have a similar perceptual scale (despite larger error bars) e.g. for pair01: participant 03/04; for pair02: participant 01 to 03 and participant 05, etc. This is not the case with the conflicting prediction condition (yellow, Figure 13).
+
+In conclusion, those preliminary results leave us with a lot of questions. A lot of work remain to be done to properly understand what features are able to explain the observed perceptual scale.
+
+
+
+
+
+
+Figure 11: Texture samples normalized by their average power spectrum. Red corresponds to the early sensitivity group. Blue corresponds to the late sensitivity group. Yellow corresponds to conflicting prediction across VGG-19 layers.
+
+
+Figure 12: Measured and predicted (VGG19 averaged) perceptual scales for the early (top row) and late (bottom row) sensitivity pairs. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+Figure 13: Measured and predicted (VGG19 averaged) perceptual scales for the conflicting prediction pairs. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 14: Naturalistic textures, early sensitivity. Measured perceptual scale for each participant. Top-to-bottom row: pair01 to pair05. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 15: Naturalistic textures, late sensitivity. Measured perceptual scale for each participant. Top-to-bottom row: pair06 to pair10. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 16: Naturalistic textures, conflicting prediction. Measured perceptual scale for each participant. Top and bottom row: pair11 and pair12. Error bars represent $99.5\%$ bootstrapped confidence intervals.
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/perceptualscalespredictedbyfisherinformationmetrics/images.zip b/perceptualscalespredictedbyfisherinformationmetrics/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c5ea82661a7b862562ccd5069f54d499fada90ef
--- /dev/null
+++ b/perceptualscalespredictedbyfisherinformationmetrics/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3acdfbd47982a8d7f3ae4e1935d5d23badc61b62b75ffaaa41c7abf7fb64cb36
+size 1780885
diff --git a/perceptualscalespredictedbyfisherinformationmetrics/layout.json b/perceptualscalespredictedbyfisherinformationmetrics/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..31820c4a535f79854e3b90e3b34241eb48e5a676
--- /dev/null
+++ b/perceptualscalespredictedbyfisherinformationmetrics/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:febff8abcc16533b5f7f4b13df1f8feeafedeec454e24bbb969d4aa05cccf3f4
+size 876277
diff --git a/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_content_list.json b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..464da6176e553ff642d1686d4d49e79b37611ee3
--- /dev/null
+++ b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae1449763b37cda4c4fe972a45ec6ab763b30bc6a867413ecdd81de46336806e
+size 222249
diff --git a/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_model.json b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..01eed94f75dca4a7706c71a31a4b508dab0b66f1
--- /dev/null
+++ b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5a3705dc9a7d1c335c69ec818b2cdd5e9efbd1785bf3a4bdb905963be50ca598
+size 247957
diff --git a/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_origin.pdf b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8efebcdd00e29bb8b183d7e6fda4609111b6242f
--- /dev/null
+++ b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/5eaf9f0a-e985-4a1d-a6a6-9efcc95571cd_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:60e45bb7b48fab1a0e5def48fa84113702cfe4ac40cd71be3486839491396e81
+size 686102
diff --git a/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/full.md b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..78824635265733bc9c9080ad7a558b6ef9b92e0f
--- /dev/null
+++ b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/full.md
@@ -0,0 +1,933 @@
+# PERFORMANCE GAPS IN MULTI-VIEW CLUSTERING UNDER THE NESTED MATRIX-TENSOR MODEL
+
+Hugo Lebeau1* Mohamed El Amine Seddik2 José Henrique de Morais Goulart3
+
+1Univ. Grenoble Alpes, CNRS, Inria, Grenoble INP, LIG 2Technology Innovation Institute
+
+3Univ. Toulouse, INP-ENSEEIHT, IRIT, CNRS
+
+*hugo.lebeau@univ-grenoble-alpes.fr
+
+# ABSTRACT
+
+We study the estimation of a planted signal hidden in a recently introduced nested matrix-tensor model, which is an extension of the classical spiked rank-one tensor model, motivated by multi-view clustering. Prior work has theoretically examined the performance of a tensor-based approach, which relies on finding a best rank-one approximation, a problem known to be computationally hard. A tractable alternative approach consists in computing instead the best rank-one (matrix) approximation of an unfolding of the observed tensor data, but its performance was hitherto unknown. We quantify here the performance gap between these two approaches, in particular by deriving the precise algorithmic threshold of the unfolding approach and demonstrating that it exhibits a BBP-type transition behavior (Baik et al., 2005). This work is therefore in line with recent contributions which deepen our understanding of why tensor-based methods surpass matrix-based methods in handling structured tensor data.
+
+# 1 INTRODUCTION
+
+In the age of artificial intelligence, handling vast amounts of data has become a fundamental aspect of machine learning tasks. Datasets are often high-dimensional and composed of multiple modes, such as various modalities, sensors, sources, types, or domains, naturally lending themselves to be represented as tensors. Tensors offer a richer structure compared to traditional one-dimensional vectors and two-dimensional matrices, making them increasingly relevant in various applications, including statistical learning and data analysis (Landsberg, 2012; Sun et al., 2014).
+
+Yet, in the existing literature, there is a notable scarcity of theoretical studies that specifically address the performance gaps between tensor-based methods and traditional (matrix) spectral methods in the context of high-dimensional data analysis. While tensor methods have shown promise in various applications, including multi-view clustering, co-clustering, community detection, and latent variable modeling (Wu et al., 2019; Anandkumar et al., 2014; Papalexakis et al., 2012; Wang et al., 2023), little attention has been devoted to rigorously quantifying the advantages and drawbacks of leveraging the hidden low-rank tensor structure. Filling this gap by conducting a thorough theoretical analysis is crucial for gaining a deeper understanding of the practical implications and potential performance gains associated with tensor-based techniques.
+
+In the specific case of multi-view clustering, Seddik et al. (2023a) recently proposed a spectral tensor method and carried out a precise analysis of its performance in the large-dimensional limit. Their method consists in computing a best rank-one (tensor) approximation of a nested matrix-tensor model, which, in particular, generalizes the classical rank-one spiked tensor model of Montanari & Richard (2014), and can be described as follows. Assume that we observe $m$ transformations of a $p \times n$ matrix $\mathbf{M} = \boldsymbol{\mu}\mathbf{y}^{\top} + \mathbf{Z}$ representing $n$ points in dimension $p$ split into two clusters centered around $\pm \mu$ , with $\mathbf{y} \in \{-1,1\}^{n}$ and $\mathbf{Z}$ a Gaussian matrix encoding the "inherent" dispersion of individuals (that is, regardless of measurement errors) around the center of their respective cluster. Mathematically, each view is thus expressed as
+
+$$
+\mathbf {X} _ {k} = f _ {k} \left(\boldsymbol {\mu} \boldsymbol {y} ^ {\top} + \mathbf {Z}\right) + \mathbf {W} _ {k}, \quad k = 1, \dots , m, \tag {1}
+$$
+
+where $f_{k}$ models the transformation applied to $\mathbf{M}$ on the $k$ -th view and $\mathbf{W}_k$ is an additive observation noise with i.i.d. entries drawn from $\mathcal{N}(0,1)$ . The nested-matrix tensor model then arises when
+
+we take $f_{k}(\mathbf{M}) = h_{k}\mathbf{M}$ , meaning the function $f_{k}$ simply rescales the matrix $\mathbf{M}$ by an unknown coefficient $h_k\in \mathbb{R}$ . With $\pmb {h} = (h_1\dots h_m)^\top \in \mathbb{R}^m$ and $\otimes$ denoting the outer product, this gives
+
+$$
+\mathbf {X} = \left(\boldsymbol {\mu} \mathbf {y} ^ {\top} + \mathbf {Z}\right) \otimes \mathbf {h} + \mathbf {W} \in \mathbb {R} ^ {p \times n \times m}. \quad \text {(N e s t e d M a t r i x - T e n s o r M o d e l)}
+$$
+
+By seeking a best rank-one approximation of $\mathbf{X}$ to estimate its latent clustering structure, Seddik et al. (2023a) showed empirically that it outperforms an unfolding approach based on applying an SVD to an unfolding of $\mathbf{X}$ (Ben Arous et al., 2021; Lebeau et al., 2024), which is a matrix obtained by rearranging the entries of a tensor (see Section 2.2). However, the tensor-based approach hinges upon solving a problem which is worst-case NP-hard, unlike the unfolding approach. A natural question is thus: what is the exact performance gap that exists between these two approaches, as a function of some measure of difficulty of the problem (typically, a measure of signal-to-noise ratio)?
+
+Here, in order to answer this question, we rigorously study the unfolding method by deploying tools from random matrix theory. Specifically, our main contributions are
+
+- within the framework of the general nested matrix-tensor model, we derive the limiting spectral distribution of the unfoldings of the tensor (Theorems 1 and 3) and precisely quantify how well the hidden low-rank (tensor) structure can be recovered from them in the high-dimensional regime (Theorems 2 and 7);
+- we perform a similar random matrix analysis of the model when the vector spanning the third mode is known (Theorems 3 and 4), providing an optimal upper bound on the recovery performance;
+- in the context of multi-view clustering, we compare the performance of the tensor and unfolding approaches to the optimal one and specify the gap between them thanks to our theoretical findings (Theorem 5), supported by empirical results1.
+
+Although the above described model arises from a rather particular choice of view transformations $f_{k}$ , it is amenable to a precise estimation performance analysis, either by means of a tensor spectral estimator as recently done by Seddik et al. (2023a), or via a matrix spectral estimator as we consider in the present paper. Moreover, from a broader perspective (that is, beyond the multi-view clustering problem considered here), this model can be viewed as a more flexible version of the rank-one spiked model, incorporating a nested structure that allows for versatile data modeling, deviating from a pure rank-one assumption. A common low-rank structure encoding the underlying latent clustering pattern is shared by all slices $\mathbf{X}_k$ , which represent distinct views of the data. In particular, when the variances of the elements in $\mathbf{Z}$ approach zero, the rank-one spiked model is retrieved. Hence, we believe that the nested tensor-matrix model (and extensions) can be a useful tool in other contexts in the broader area of statistical learning.
+
+Related work. In the machine learning literature, the notion of "view" is fairly general and models data whose form may differ but all represent the same object seen from different (and complementary) angles (for instance, multiple descriptors of an image, translations of a text or features of a webpage such as its hyperlinks, text and images). Various approaches have been considered to address multi-view clustering problems. For instance, Nie et al. (2016; 2017b;a) consider a graph-based model and construct a similarity matrix by integrating all views with a weighted sum before applying spectral clustering. Other approaches, relying upon a space-learning-based model (Wang et al., 2017; Zhang et al., 2017; Wang et al., 2019; Peng et al., 2019), reconstruct the data in an ideal space where clustering is easy. Zhang et al. (2019) suggest a method which is more suitable for large datasets by mixing binary coding and clustering. Tensor methods have also been considered: Wu et al. (2019) propose an essential tensor learning approach for Markov chain-based multi-view spectral clustering. Furthermore, Liu et al. (2021; 2023) design simple yet effective methods for multi-view clustering relying on multiple kernel $k$ -means. Our work differs from these previous contributions in that it is focused on a tensor model having the specific form of equation Nested Matrix-Tensor Model. Even though this model corresponds to a rather particular case of the general setting given in equation 1, our results represent a first step towards precisely understanding how tensor methods can contribute to addressing the latter.
+
+Regarding the analysis of performance gaps between tensor- and matrix-based methods, we can mention the recent work by Seddik et al. (2023b), where the authors proposed a data model that consists of a Gaussian mixture assuming a low-rank tensor structure on the population means and further characterized the theoretical performance gap between a simple tensor-based method and a flattening-based method that neglects the low-rank structure. Their study has demonstrated that the tensor approach yields provably better performance compared to treating the data as mere vectors.
+
+Proofs and simulations. All proofs are deferred to the appendix. Python codes to reproduce simulations are available in the following GitHub repository https://github.com/HugoLebeau/nested_matrix-tensor.
+
+# 2 TENSORS AND RANDOM MATRIX THEORY
+
+# 2.1 GENERAL NOTATIONS
+
+The symbols $a$ , $a$ and $\mathbf{A}$ respectively denote a scalar, a vector and a matrix. Their random counterparts are a, a and $\mathbf{A}$ , respectively. Tensors (be they random or not) are denoted $\mathbf{A}$ . The set of integers $\{1,\ldots ,n\}$ is denoted $[n]$ . The unit sphere in $\mathbb{R}^n$ is $\mathbb{S}^{n - 1} = \{\pmb {x}\in \mathbb{R}^n\mid \| \pmb {x}\| = 1\}$ . The set of eigenvalues of a matrix $\mathbf{A}$ is called its spectrum and denoted $\mathrm{sp}(\mathbf{A})$ . The support of a measure $\mu$ is denoted $\operatorname {supp}\mu$ . As usual, $\delta_{x}$ is the Dirac measure at point $x$ . Given two sequences of scalars $f_{n}$ and $g_{n}$ , the notation $f_{n} = \Theta (g_{n})$ means that there exist constants $C,C^{\prime} > 0$ and $n_0$ such that $n\geqslant n_0\Rightarrow C|g_n|\leqslant |f_n|\leqslant C'|g_n|$ . The convergence in distribution of a sequence of random variables $(\mathrm{x}_n)_{n\geqslant 0}$ is denoted $\mathrm{x}_n\xrightarrow[n\to+\infty]{\mathcal{D}}\mathcal{L}$ where $\mathcal{L}$ is the limiting distribution.
+
+# 2.2 TENSORS AND RELATED OPERATIONS
+
+For our purposes, we can think of tensors as multidimensional arrays. In this work, we will only consider tensors of order 3, i.e., elements of $\mathbb{R}^{n_1\times n_2\times n_3}$ . For such a tensor $\mathbf{T}$ and $(i,j,k)\in [n_1]\times$ $[n_2]\times [n_3]$ , $T_{i,j,k}$ denotes its $(i,j,k)$ -entry. $\mathbf{T}$ can be unfolded along one of its three modes to construct a "matricized version" of the tensor: the unfolding of $\mathbf{T}$ along mode 1 is the matrix $T^{(1)}\in$ $\mathbb{R}^{n_1\times n_2n_3}$ such that $T_{i,j,k} = T_{i,n_3(j - 1) + k}^{(1)}$ , and likewise for $T^{(2)}$ and $T^{(3)}$ — the unfoldings of $\mathbf{T}$ along modes 2 and 3. The inner product between two tensors $\mathbf{T},\mathbf{T}'\in \mathbb{R}^{n_1\times n_2\times n_3}$ is $\langle \mathbf{T},\mathbf{T}'\rangle =$ $\sum_{i,j,k = 1}^{n_1,n_2,n_3}T_{i,j,k}T_{i,j,k}'$ and the Frobenius norm of $\mathbf{T}$ is defined simply as $\| \mathbf{T}\|_{\mathrm{F}} = \sqrt{\langle\mathbf{T},\mathbf{T}\rangle}$ .
+
+The outer product $\otimes$ allows to construct an order-3 tensor from a matrix $A\in \mathbb{R}^{n_1\times n_2}$ and a vector $\pmb {w}\in \mathbb{R}^{n_3}$ , $[A\otimes w]_{i,j,k} = A_{i,j}w_k$ , or from three vectors $(\pmb {u},\pmb {v},\pmb {w})\in \mathbb{R}^{n_1}\times \mathbb{R}^{n_2}\times \mathbb{R}^{n_3}$ , $[u\otimes v\otimes w]_{i,j,k} = u_iv_jw_k$ . In the latter case, the tensor is said to be rank-one.
+
+Unfoldings of tensors defined with outer products are often expressed using Kronecker products $\boxtimes$ . Given two matrices (or vectors if the second dimension is set to 1) $A \in \mathbb{R}^{n_1 \times n_2}$ , $B \in \mathbb{R}^{p_1 \times p_2}$ , their Kronecker product $A \boxtimes B$ is the $n_1p_1 \times n_2p_2$ matrix such that $[A \boxtimes B]_{p_1(i-1) + r, p_2(j-1) + s} = A_{i,j}B_{r,s}$ . Among the numerous properties of the Kronecker product, we highlight the fact that it is bilinear, associative, $(A \boxtimes B)^\top = A^\top \boxtimes B^\top$ and $(A \boxtimes B)(C \boxtimes D) = AC \boxtimes BD$ .
+
+Example. With $\mathbf{a} = \left[\mathbf{A}_{1,:}\quad \dots \quad \mathbf{A}_{n_{1};}\right]^{\top}\in \mathbb{R}^{n_{1}n_{2}}$
+
+$$
+\begin{array}{l} [ \boldsymbol {A} \otimes \boldsymbol {w} ] ^ {(1)} = \boldsymbol {A} (\boldsymbol {I} _ {n _ {2}} \boxtimes \boldsymbol {w}) ^ {\top}, \quad [ \boldsymbol {u} \otimes \boldsymbol {v} \otimes \boldsymbol {w} ] ^ {(1)} = \boldsymbol {u} (\boldsymbol {v} \boxtimes \boldsymbol {w}) ^ {\top}, \\ \left[ \boldsymbol {A} \otimes \boldsymbol {w} \right] ^ {(2)} = \boldsymbol {A} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {w}\right) ^ {\top}, \quad \left[ \boldsymbol {u} \otimes \boldsymbol {v} \otimes \boldsymbol {w} \right] ^ {(2)} = \boldsymbol {v} \left(\boldsymbol {u} \boxtimes \boldsymbol {w}\right) ^ {\top}, \\ [ \boldsymbol {A} \otimes \boldsymbol {w} ] ^ {(3)} = \boldsymbol {w} \boldsymbol {a} ^ {\top}, \quad [ \boldsymbol {u} \otimes \boldsymbol {v} \otimes \boldsymbol {w} ] ^ {(3)} = \boldsymbol {w} (\boldsymbol {u} \boxtimes \boldsymbol {v}) ^ {\top}. \\ \end{array}
+$$
+
+# 2.3 RANDOM MATRIX TOOLS
+
+The results presented below are derived using tools from the theory of large random matrices (Bai & Silverstein, 2010; Pastur & Shcherbina, 2011; Couillet & Liao, 2022), the main tools of which are recalled here.
+
+Given a random symmetric matrix $\mathbf{S} \in \mathbb{R}^{n \times n}$ , we are interested in the behavior of its (real) eigenvalues and eigenvectors as $n \to +\infty^2$ . A first kind of result is the weak convergence of its empirical spectral distribution (ESD) $\frac{1}{n} \sum_{\lambda \in \mathrm{sp}(\mathbf{S})} \delta_{\lambda}$ towards a limiting spectral distribution (LSD) $\mu$ . The latter is often characterized by its Stieltjes transform $m_{\mu}: s \in \mathbb{C} \setminus \mathrm{sp}(\mathbf{S}) \mapsto \int_{\mathbb{R}} \frac{\mu(\mathrm{d}t)}{t - s}$ , from which $\mu$ can be recovered using the inverse formula $\mu(\mathrm{d}t) = \lim_{\eta \to 0} \frac{1}{\pi} \Im[m_{\mu}(t + i\eta)]$ . A second kind of result is the almost sure convergence of the alignment between a vector $\boldsymbol{x} \in \mathbb{R}^n$ and an eigenvector $\hat{\mathbf{x}}$ of $\mathbf{S}$ , i.e., the quantity $\left|\boldsymbol{x}^\top \hat{\mathbf{x}}\right|^2$ , towards a fixed value in $[0,1]$ .
+
+A central tool to derive such results is the resolvent $\mathbf{Q}_{\mathbf{S}}(s) = (\mathbf{S} - s\mathbf{I}_n)^{-1}$ , defined for all $s \in \mathbb{C} \setminus \operatorname{sp} \mathbf{S}$ . Indeed, $\frac{1}{n} \operatorname{Tr} \mathbf{Q}_{\mathbf{S}}(s)$ is the Stieltjes transform evaluated at $s$ of the ESD of $\mathbf{S}$ , so studying its asymptotic behavior shall give us insight into $m_{\mu}$ . The alignments can as well be studied through the resolvent thanks to the property $\left|\boldsymbol{x}^{\top} \hat{\mathbf{x}}\right|^2 = -\frac{1}{2i\pi} \oint_{\gamma} \boldsymbol{x}^{\top} \mathbf{Q}_{\mathbf{S}}(s) \boldsymbol{x} \, \mathrm{d}s$ where $\gamma$ is a positively-oriented complex contour circling around the eigenvalue associated to $\hat{\mathbf{x}}$ (assuming it has multiplicity one) and leaving all other eigenvalues outside.
+
+Because of the random nature of $\mathbf{Q}_{\mathbf{S}}$ , we will first seek a deterministic equivalent, i.e., a deterministic matrix $\bar{\mathbf{Q}}_{\mathbf{S}}$ such that both quantities $\frac{1}{n}\operatorname {Tr}A\left(\mathbf{Q}_{\mathbf{S}} - \bar{\mathbf{Q}}_{\mathbf{S}}\right)$ and $a^\top (\mathbf{Q}_{\mathbf{S}} - \bar{\mathbf{Q}}_{\mathbf{S}})b$ vanish almost surely as $n\to +\infty$ for any (sequences of) deterministic matrices $A$ and vectors $a,b$ of bounded norms (respectively, operator and Euclidean). This is denoted $\mathbf{Q}_{\mathbf{S}}\longleftrightarrow \bar{\mathbf{Q}}_{\mathbf{S}}$ . The following lemma will be extensively used to derive such equivalents.
+
+Lemma 1 (Stein (1981)). Let $\mathbf{z} \sim \mathcal{N}(0,1)$ and $f: \mathbb{R} \to \mathbb{R}$ be a continuously differentiable function. When the following expectations exist, $\mathbb{E}\left[\mathrm{zf}(\mathbf{z})\right] = \mathbb{E}\left[f^{\prime}(\mathbf{z})\right]$ .
+
+# 3 MAIN RESULTS
+
+Before presenting its practical applications in Section 4, we recall the definition of the nested matrix-tensor model in a general framework. Consider the following statistical model.
+
+$$
+\mathbf {T} = \beta_ {T} \mathbf {M} \otimes \boldsymbol {z} + \frac {1}{\sqrt {n _ {T}}} \mathbf {W} \in \mathbb {R} ^ {n _ {1} \times n _ {2} \times n _ {3}}, \quad \mathbf {M} = \beta_ {M} \boldsymbol {x} \boldsymbol {y} ^ {\top} + \frac {1}{\sqrt {n _ {M}}} \mathbf {Z} \in \mathbb {R} ^ {n _ {1} \times n _ {2}}, \tag {2}
+$$
+
+where $n_M = n_1 + n_2$ and $n_T = n_1 + n_2 + n_3$ , $\mathbf{x}$ , $\mathbf{y}$ and $\mathbf{z}$ are of unit norm and the entries of $\mathbf{W}$ and $\mathbf{Z}$ are independent Gaussian random variables3: $\mathcal{W}_{i,j,k} \stackrel{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0,1)$ , $\mathsf{Z}_{i,j} \stackrel{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0,1)$ . $\mathbf{M}$ is a rank-1 signal $\beta_M \mathbf{x} \mathbf{y}^\top$ corrupted by noise $\mathbf{Z}$ , modelling the data matrix, whereas $\mathbf{T}$ models its multiview observation $\beta_T \mathbf{M} \otimes \mathbf{z}$ corrupted by noise $\mathbf{W}$ . The positive parameters $\beta_M$ and $\beta_T$ control the signal-to-noise ratio (SNR). Our interest is the statistical recovery of $\mathbf{x}$ , $\mathbf{y}$ or $\mathbf{z}$ in the regime where $n_1, n_2, n_3 \to +\infty$ with $0 < c_\ell = \lim n_\ell / n_T < 1$ for all $\ell \in [3]$ . This models the fact that, in practice, we deal with large tensors whose dimensions have comparable sizes.
+
+Seddik et al. (2023a) have studied the spectral estimator of $x$ , $y$ and $z$ based on computing the best rank-one approximation of $\mathbf{T}$ , that is, by solving
+
+$$
+(\hat{\mathbf{x}},\hat{\mathbf{y}},\hat{\mathbf{z}}) = \operatorname *{arg max}_{(\boldsymbol {u},\boldsymbol {v},\boldsymbol {w})\in \mathbb{S}^{n_{1} - 1}\times \mathbb{S}^{n_{2} - 1}\times \mathbb{S}^{n_{3} - 1}}\langle \boldsymbol {\mathsf{T}},\boldsymbol {u}\otimes \boldsymbol {v}\otimes \boldsymbol {w}\rangle .
+$$
+
+Concretely, they used random matrix tools to assess its performance in the recovery of $x$ , $y$ and $z$ , by deploying a recent approach developed by Goulart et al. (2022); Seddik et al. (2022). In this work, we study instead the performance of a spectral approach based on computing the dominant singular vectors of the (matrix) unfoldings of $\mathbf{T}$ , aiming to precisely quantify the performance gap between these different approaches.
+
+Because $\mathbf{M}$ has the structure of a standard spiked matrix model (Benaych-Georges & Nadakuditi, 2011; Couillet & Liao, 2022) with a rank-one perturbation $\beta_{M} \pmb{x} \pmb{y}^{\top}$ of a random matrix $\frac{1}{\sqrt{n_m}} \mathbf{Z}$ , we shall assume $\beta_{M} = \Theta(1)$ since we know that it is in this "non-trivial regime" that the recovery of $\pmb{x}$
+
+or $\pmb{y}$ given $\mathbf{M}$ is neither too easy (too high SNR) nor too hard (too small SNR) and a phase-transition phenomenon (Baik et al., 2005) between impossible and possible recovery can be observed. However, we shall see that the algorithmic phase transition related to the unfolding approach takes place when $\beta_{T} = \Theta (n_{T}^{1 / 4})$ in lieu of $\beta_{T} = \Theta (1)$ . This is different from the tensor spectral approach for which both $\beta_{M}$ and $\beta_{T}$ are $\Theta (1)$ in the non-trivial regime, supposing a better performance of the latter method, although, practically, no known algorithm is able to compute it below $\beta_{T} = \Theta (n_{T}^{1 / 4})$ (Montanari & Richard, 2014).
+
+# 3.1 UNFOLDINGS ALONG THE FIRST TWO MODES
+
+We start by studying the recovery of $\mathbf{y}$ (resp. $\mathbf{x}$ ) from the unfolding $\mathbf{T}^{(2)}$ (resp. $\mathbf{T}^{(1)}$ ). In a multiview clustering perspective — which motivates our work and which will be developed in Section 4 — we are especially interested in the recovery of $\mathbf{y}$ since it carries the class labels. Therefore, we present our results for $\mathbf{T}^{(2)}$ only. As $\mathbf{x}$ and $\mathbf{y}$ play a symmetric role, it is easy to deduce the results for $\mathbf{T}^{(1)}$ from those presented below. The recovery of $\mathbf{z}$ from $\mathbf{T}^{(3)}$ is dealt with in Appendix A.
+
+Following the model presented in equation 2, the unfolding along the second mode of $\mathbf{T}$ develops as
+
+$$
+\mathbf {T} ^ {(2)} = \beta_ {T} \beta_ {M} \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} + \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbf {Z} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} + \frac {1}{\sqrt {n _ {T}}} \mathbf {W} ^ {(2)}. \tag {3}
+$$
+
+Hence, a natural estimator $\hat{\mathbf{y}}$ of $\pmb{y}$ is the dominant left singular vector of $\mathbf{T}^{(2)}$ or, equivalently, the dominant eigenvector of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ . The latter being symmetric, it is better suited to the tools presented in Section 2.3. Our first step is to characterize the limiting spectral distribution of this random matrix. However, one must be careful with the fact that the dimensions of $\mathbf{T}^{(2)}\in \mathbb{R}^{n_2\times n_1n_3}$ do not have sizes of the same order, causing the spectrum of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ to diverge as $n_1,n_2,n_3\to +\infty$ . In fact, its eigenvalues gather in a "bulk" centered around a $\Theta (n_T)$ value and spread on an interval of size $\Theta (\sqrt{n_T})$ — a phenomenon which was first characterized by Ben Arous et al. (2021). For this reason, in Theorem 1, we do not specify the LSD of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ per se but of a properly centered-and-scaled version of it, whose spectrum no longer diverges. Moreover, it is expected that the rank-one signal $\beta_{T}\beta_{M}\pmb {y}\left(\pmb {x}\boxtimes \pmb {z}\right)^{\top}$ causes the presence of an isolated eigenvalue in the spectrum of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ with corresponding eigenvector positively correlated with $\pmb{y}$ when it is detectable, i.e., when $\beta_{T}\beta_{M}$ is large enough.
+
+Our second step is thus to precisely specify what is meant by "large enough" and characterize the asymptotic position of this spike eigenvalue and the alignment with $\pmb{y}$ of its corresponding eigenvector. It turns out that the signal vanishes if $\beta_{T}$ does not scale with $n_T$ . Precisely, $\beta_T^2 n_T / \sqrt{n_1n_2n_3}$ must converge to a fixed positive quantity4, denoted $\rho_T$ , to reach the "non-trivial regime" — that is, one where the signal and the noise in the model have comparable strengths. However, because the noise in $\mathbf{Z}$ is also weighted by $\beta_{T}$ , this affects the shape of the bulk. Hence, the value of $\rho_T$ influences the limiting spectral distribution of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ and shall appear in its defining equation5. Having said all this, we are now ready to introduce the following theorem.
+
+Theorem 1 (Limiting Spectral Distribution). As $n_1, n_2, n_3 \to +\infty$ , the centered-and-scaled matrix $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - \frac{n_2 + n_1n_3}{\sqrt{n_1n_2n_3}}\mathbf{I}_{n_2}$ has a limiting spectral distribution $\tilde{\nu}$ whose Stieltjes transform $\tilde{m}(\tilde{s})$ is solution to
+
+$$
+\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {3} (\tilde {s}) + \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} ^ {2} (\tilde {s}) + \left(\tilde {s} + \frac {\rho_ {T} (c _ {2} - c _ {1})}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) + 1 = 0, \qquad \tilde {s} \in \mathbb {C} \backslash \operatorname {s u p p} \tilde {\nu}
+$$
+
+where $\rho_{T} = \lim \frac{\beta_{T}^{2}n_{T}}{\sqrt{n_{1}n_{2}n_{3}}}$ .
+
+# Proof. See Appendix B.
+
+
+
+
+Figure 1: Empirical Spectral Distribution (ESD) and Limiting Spectral Distribution (LSD) of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ (left) and $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ (right) with $n_1 = 600$ , $n_2 = 400$ and $n_3 = 200$ . Both spectra show an isolated eigenvalue close to its predicted asymptotic position, represented by the green dashed line. Left: $\rho_T = 2$ , $\beta_M = 1.5$ . The centered-and-scaled LSD $\tilde{\nu}$ and spike location $\xi$ are defined in Theorems 1 and 2. Right: $\varrho = 4$ , $\beta_M = 3$ . The LSD is a shifted-and-rescaled semi-circle distribution and the normalized spike location is $\varrho + \frac{1}{\varrho}$ as precised in Theorems 6 and 7.
+
+
+
+As mentioned in Section 2.3, the LSD $\tilde{\nu}$ is characterized by its Stieltjes transform, uniquely defined as the solution of a polynomial equation6. The influence of $\rho_T$ on the LSD of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ is made explicit in this equation and it is interesting to remark that, if $\rho_T = 0$ (i.e., in the absence of signal), this equality reduces to $\tilde{m}^2 (\tilde{s}) + \tilde{s}\tilde{m} (\tilde{s}) + 1 = 0$ , which is a well-known characterization of the Stieltjes transform of the semi-circle distribution (Pastur & Shcherbina, 2011, Corollary 2.2.8). Note also that the condition $\rho_T = \Theta (1)$ amounts to saying that $\beta_{T} = \Theta (n_{T}^{1 / 4})$ , which coincides with the conjectured "computational threshold" under which no known algorithm is able to detect a signal without prior information (Montanari & Richard, 2014; Ben Arous et al., 2021).
+
+The ESD and LSD of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ with parameters $(\rho_T,\beta_M) = (2,1.5)$ are represented in the left panel of Figure 1. We observe a good agreement between the actual and predicted shape of the bulk. As expected, we see an isolated eigenvalue on the right which only appears for sufficiently high values of $\rho_{T}$ and $\beta_{M}$ . The following theorem specifies this behavior and quantifies the alignment between the signal $\pmb{y}$ and the spike eigenvector $\hat{\mathbf{y}}$ .
+
+Theorem 2 (Spike Behavior).
+
+$$
+L e t \qquad \tilde {\xi} = \frac {\rho_ {T}}{\beta_ {M} ^ {2}} \left(\frac {c _ {1}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right) \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right) + \frac {1}{\rho_ {T} \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right)}
+$$
+
+$$
+a n d \zeta = 1 - \frac {1}{\beta_ {M} ^ {2} \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right)} \left[ \left(\frac {\beta_ {M} ^ {2}}{\rho_ {T} \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right)}\right) ^ {2} + \frac {c _ {2}}{1 - c _ {3}} \left(\frac {c _ {1}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right) \right].
+$$
+
+If $\zeta > 0$ , then the centered-and-scaled matrix $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - \frac{n_2 + n_1n_3}{\sqrt{n_1n_2n_3}}\mathbf{I}_{n_2}$ has an isolated eigenvalue asymptotically located in $\tilde{\xi}$ almost surely. Furthermore, in this case, the alignment between the corresponding eigenvector $\hat{\mathbf{y}}$ and the true signal $\mathbf{y}$ converges to $\zeta$ almost surely, i.e.,
+
+$$
+\left| \hat {\mathbf {y}} ^ {\top} \mathbf {y} \right| ^ {2} \xrightarrow [ n _ {1}, n _ {2}, n _ {3} \rightarrow + \infty ]{} \zeta \quad a l m o s t s u r e l y.
+$$
+
+Proof. See Appendix C.
+
+
+
+Naturally, we must assume $\rho_T, \beta_M > 0$ for $\tilde{\xi}$ and $\zeta$ to be well defined. The location of the isolated eigenvalue in the spectrum of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ predicted from the expression of $\tilde{\xi}$ is represented as the green dashed line in the left panel of Figure 1. In fact, Theorem 2 reveals a phase transition phenomenon between impossible and possible recovery of the signal with the estimator $\hat{y}$ . This is
+
+
+Figure 2: Asymptotic alignment $\zeta^{+} = \max (\zeta ,0)$ between the signal $\pmb{y}$ and the dominant eigenvector of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ , as defined in Theorem 2, with $c_{1} = \frac{1}{2}$ , $c_{2} = \frac{1}{3}$ and $c_{3} = \frac{1}{6}$ . The curve $\zeta = 0$ is the position of the phase transition between the impossible detectability of the signal (below) and the presence of an isolated eigenvalue in the spectrum of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ with corresponding eigenvector correlated with the signal (above). It has an asymptote $\beta_{M} = (\frac{c_{1}c_{2}}{1 - c_{3}})^{1 / 4}$ , represented by the red dashed line, as $\rho_T\to +\infty$ .
+
+precisely quantified by the value of $\zeta^{+} = \max (\zeta ,0)$ : the closer it is to 1, the better is the estimation of $\pmb{y}$ . The precise dependence of $\zeta$ on $\rho_T$ and $\beta_{M}$ is hard to interpret directly from its expression. Figure 2 displays $\zeta^{+}$ as a function of $\rho_T$ and $\beta_{M}$ . The expression of the curve $\zeta = 0$ marking the position of the transition from impossible to possible recovery is given by the following proposition.
+
+Proposition 1 (Phase Transition). If $\beta_{M}^{4} > \frac{c_{1}c_{2}}{1 - c_{3}}$ , then $\zeta = 0 \iff \rho_{T} = \frac{\beta_{M}^{2}}{\left(\frac{c_{2}}{1 - c_{3}} + \beta_{M}^{2}\right)\sqrt{\beta_{M}^{4} - \frac{c_{1}c_{2}}{1 - c_{3}}}}$ .
+
+We see that, if $\beta_{M}^{4}\leqslant \frac{c_{1}c_{2}}{1 - c_{3}}$ , it is impossible to find $\rho_T > 0$ such that $\zeta >0$ . This is due to the fact that $\beta_{M}^{4} = \frac{c_{1}c_{2}}{1 - c_{3}}$ corresponds to the position of the phase transition in the estimation of $\pmb{y}$ from M. If the signal is not detectable from M, there is obviously no chance to recover it from T. Moreover, as $\rho_T$ grows, the value of $\beta_{M}$ such that $\zeta = 0$ coincides with $(\frac{c_1c_2}{1 - c_3})^{1 / 4}$ but it goes to $+\infty$ as $\rho_T$ approaches 0. This shows the importance of having $\beta_{T} = \Theta (n_{T}^{1 / 4})$ (in which case it is more convenient to work with the rescaled version $\rho_T$ of $\beta_T$ ): if $\beta_{T}$ is an order below $(\rho_T\to 0)$ then we are stuck in the "Impossible recovery" zone while if $\beta_{T}$ is an order above $(\rho_T\rightarrow +\infty)$ then estimating from T is just like estimating from M. It is precisely in the regime $\beta_{T} = \Theta (n_{T}^{1 / 4})$ that this phase-transition phenomenon can be observed, thereby justifying its designation as "non-trivial".
+
+Remark. It should be noted that the aforementioned impossibility of (partially) recovering the sought signal in a given regime refers only to the case where such a recovery is carried out by the unfolding method. In other words, our discussion concerns algorithmic thresholds pertaining to such method, and not statistical ones.
+
+# 3.2 ESTIMATION WITH WEIGHTED MEAN
+
+Before diving into the application of the previous results to multi-view clustering (where we will be interested in the estimation of the class labels contained in $\pmb{y}$ ), we propose an analysis of a related matrix model corresponding to the optimal estimation of $\pmb{y}$ when $z$ is perfectly known. These results will give us an optimistic upper bound on the performance of the estimation of $\pmb{y}$ from $\mathbf{T}$ .
+
+In case $z$ is known, $y$ can be estimated with the following weighted mean of $\mathbf{T}$ along mode 3,
+
+$$
+\bar {\mathbf {T}} = \sum_ {k = 1} ^ {n _ {3}} z _ {k} \mathbf {T} _ {:,: k} = \beta_ {T} \beta_ {M} \boldsymbol {x} \boldsymbol {y} ^ {\top} + \frac {\varsigma}{\sqrt {n _ {M}}} \mathbf {N} \tag {4}
+$$
+
+where $\mathrm{N}_{i,j} \stackrel{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0,1)$ and $\varsigma^2 = \beta_T^2 + \frac{n_M}{n_T}$ . It is well known that the dominant right singular vector of $\bar{\mathbf{T}}$ is an optimal estimator of $\pmb{y}$ under this model (Onatski et al., 2013; Löffler et al., 2020). Hence, we study the spectrum of $\frac{1}{s^2} \bar{\mathbf{T}}^\top \bar{\mathbf{T}}$ , which is a sample covariance matrix — a standard model in random matrix theory (Pastur & Shcherbina, 2011; Bai & Silverstein, 2010). Its eigenvalue distribution converges to the Marchenko-Pastur distribution (Marčenko & Pastur, 1967), as expressed in the following theorem.
+
+Theorem 3 (Limiting Spectral Distribution). Let $E_{\pm} = \left(\sqrt{\frac{c_1}{1 - c_3}} \pm \sqrt{\frac{c_2}{1 - c_3}}\right)^2$ . As $n_1, n_2 \to +\infty$ , the matrix $\frac{1}{s^2}\bar{\mathbf{T}}^\top \bar{\mathbf{T}}$ has a limiting spectral distribution $\mu$ explicitly given by
+
+$$
+\mu_ {M P} (\mathrm {d} x) = \left[ 1 - \frac {c _ {1}}{c _ {2}} \right] ^ {+} \delta_ {x} (\mathrm {d} x) + \frac {1}{2 \pi \frac {c _ {2}}{1 - c _ {3}} x} \sqrt {[ x - E _ {-} ] ^ {+} [ E _ {+} - x ] ^ {+}} \mathrm {d} x.
+$$
+
+Similarly to the previous spiked models, the rank-one information $\beta_{T}\beta_{M}\pmb{x}\pmb{y}^{\top}$ induces the presence of an isolated eigenvalue in the spectrum of $\frac{1}{\varsigma^2}\bar{\mathbf{T}}^\top \bar{\mathbf{T}}$ . The following theorem characterizes its behavior and that of its corresponding eigenvector.
+
+Theorem 4 (Spike Behavior). If $\left(\frac{\beta_T\beta_M}{\varsigma}\right)^4 >\frac{c_1c_2}{(1 - c_3)^2}$ , then the spectrum of $\frac{1}{\varsigma^2}\bar{\mathbf{T}}^\top \bar{\mathbf{T}}$ exhibits an isolated eigenvalue asymptotically located in $\frac{\varsigma^2}{\beta_T^2\beta_M^2}\left(\frac{\beta_T^2\beta_M^2}{\varsigma^2} +\frac{c_1}{1 - c_3}\right)\left(\frac{\beta_T^2\beta_M^2}{\varsigma^2} +\frac{c_2}{1 - c_3}\right)$ almost surely. Moreover, in this case, the corresponding eigenvector $\hat{\mathbf{u}}$ is aligned with the signal $\mathbf{y}$ ,
+
+$$
+\left| \hat {\mathbf {u}} ^ {\top} \mathbf {y} \right| ^ {2} \xrightarrow [ n _ {1}, n _ {2}, n _ {3} \rightarrow + \infty ]{} 1 - \frac {\varsigma^ {2}}{\beta_ {T} ^ {2} \beta_ {M} ^ {2}} \frac {c _ {2}}{1 - c _ {3}} \frac {\frac {\beta_ {T} ^ {2} \beta_ {M} ^ {2}}{\varsigma^ {2}} + \frac {c _ {1}}{1 - c _ {3}}}{\frac {\beta_ {T} ^ {2} \beta_ {M} ^ {2}}{\varsigma^ {2}} + \frac {c _ {2}}{1 - c _ {3}}} \quad a l m o s t s u r e l y.
+$$
+
+For more details on standard spiked matrix models, see Couillet & Liao (2022, §2.5).
+
+# 4 PERFORMANCE GAPS IN MULTI-VIEW CLUSTERING
+
+We shall now illustrate our results in the context of multi-view clustering. As explained in the introduction, we consider the observation of a tensor $\mathbf{X} \in \mathbb{R}^{p \times n \times m}$ following the nested matrix-tensor model,
+
+$$
+\mathbf {X} = \left(\boldsymbol {\mu} \bar {\mathbf {y}} ^ {\top} + \mathbf {Z}\right) \otimes \mathbf {h} + \mathbf {W} \quad \text {w i t h} \quad \left\{ \begin{array}{c c c} Z _ {i, j} & \stackrel {{\mathrm {i . i . d .}}} {{\sim}} & \mathcal {N} \left(0, \frac {1}{p + n}\right) \\ W _ {i, j, k} & \stackrel {{\mathrm {i . i . d .}}} {{\sim}} & \mathcal {N} \left(0, \frac {1}{p + n + m}\right) \end{array} \right.. \tag {5}
+$$
+
+The two cluster centers are $\pm \mu$ and $\bar{y}_i = \pm \frac{1}{\sqrt{n}}$ depending on the class of the $i$ -th individual. The third vector $\pmb{h}$ encodes the variances along the different views of $\pmb{\mu} \bar{\pmb{y}}^{\top} + \mathbf{Z}$ . The clustering is performed by estimating the class labels with the dominant left singular vector $\hat{\mathbf{y}}$ of $\mathbf{X}^{(2)}$ . It is thus a direct application of the results of Section 3.1, where $(\|\pmb{\mu}\|, \| \pmb{h}\|)$ plays the role of $(\beta_{M}, \beta_{T})$ . In fact, the behavior of the alignment $\left|\hat{\mathbf{y}}^{\top} \mathbf{y}\right|^2$ given by Theorem 2 can be further precised with the following theorem.
+
+Theorem 5 (Performance of Multi-View Spectral Clustering). Let $(c_p, c_n, c_m) = \frac{(p,n,m)}{p+n+m}$ , $\rho = \|\pmb{h}\|^2 \frac{p+n+m}{\sqrt{pnm}}$ and
+
+$$
+\zeta = 1 - \frac {1}{\left\| \boldsymbol {\mu} \right\| ^ {2} \left(\frac {c _ {n}}{1 - c _ {m}} + \left\| \boldsymbol {\mu} \right\| ^ {2}\right)} \left[ \left(\frac {\left\| \boldsymbol {\mu} \right\| ^ {2}}{\rho \left(\frac {c _ {n}}{1 - c _ {m}} + \left\| \boldsymbol {\mu} \right\| ^ {2}\right)}\right) ^ {2} + \frac {c _ {n}}{1 - c _ {m}} \left(\frac {c _ {p}}{1 - c _ {m}} + \left\| \boldsymbol {\mu} \right\| ^ {2}\right) \right].
+$$
+
+Then, $\sqrt{\frac{n}{1 - \zeta}} (\hat{y}_j - \sqrt{\zeta}\bar{y}_j)\xrightarrow[n\to +\infty]{\mathcal{D}}\mathcal{N}(0,1)$ for all $j\in \{1,\ldots ,n\}$ , i.e., $\hat{y}_j$ approximately follows $\mathcal{N}\left(\sqrt{\zeta}\bar{y}_j,\frac{1 - \zeta}{n}\right)$ . Therefore, the clustering accuracy of the estimator $\hat{y}$ converges almost surely to $\Phi \left(\sqrt{\frac{\zeta}{1 - \zeta}}\right)$ where $\Phi :x\mapsto \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x}e^{-\frac{t^2}{2}} \mathrm{d}t$ is the standard Gaussian cumulative distribution function.
+
+
+Class separability $\| \pmb{\mu}\|$ (→ easier task)
+
+Proof. See Appendix D for a sketch.
+
+
+Figure 3: Empirical versus theoretical multi-view clustering performance with parameters $(p,n,m) = (150,300,60)$ , varying $\| \boldsymbol{\mu}\|$ and two values of $\| \boldsymbol{h}\| : 0.5$ in blue and 1.5 in orange. The solid curve (O) is an optimistic upper bound given by Theorem 4, as it can be reached when the variances along each view are perfectly known. The dash-dotted curve (T) is the performance achieved with a rank-one approximation of $\mathbf{X}$ (Seddik et al., 2023a). The dashed curve (U) is the performance predicted by Theorem 5 with the unfolding approach.
+
+Figure 3 compares the performances of the unfolding approach predicted by Theorem 5 with that of the "tensor approach" (Seddik et al., 2023a) which performs clustering with a rank-one approximation of $\mathbf{X}$ . Moreover, an optimistic upper bound on the best achievable performance, given by the solid curve, can be derived from Theorem 4. Empirical accuracies are computed for both approaches and show a good match between theory and simulation results. It appears that the unfolding approach has a later phase transition and a lower performance than the tensor approach. This was expected since they do not have the same non-trivial regime ( $\Theta(n_T^{1/4})$ against $\Theta(1)$ ). As $\|h\|$ increases, the performance gap between both approaches reduces. The performance of the tensor approach rapidly comes very close to the upper bound: the two curves almost coincide for $\|h\|=1.5$ .
+
+These results show the superiority of the tensor approach in terms of accuracy of the multi-view spectral clustering. In particular, by contrast with the unfolding-based estimator, the tensor approach has near-optimal performance, as quantified by Theorem 4. Nevertheless, when considering "not too hard" problems (i.e., for which $\| \pmb{\mu}\|$ and $\| h\|$ are not too close to the phase transition threshold), the performances of both methods are close and the unfolding approach may be more interesting given its ease of implementation and lower computational cost.
+
+# 5 CONCLUSION AND PERSPECTIVES
+
+Under the nested matrix-tensor model, we have precisely quantified the multi-view clustering performance achievable by the unfolding method and compared it with a previously studied tensor approach (Seddik et al., 2023a). This analysis has showed the theoretical superiority of the latter in terms of clustering accuracy. In particular, the tensor approach can, in principle, recover the signal at a $\Theta(1)$ signal-to-noise ratio, while the matrix approach needs this ratio to diverge as $n_T^{1/4}$ . However, the tensor approach is based on an NP-hard formulation, and no efficient algorithm capable of succeeding at a $\Theta(1)$ signal-to-noise ratio is currently known. In practice, for a sufficiently large ratio, one may combine these approaches by initializing a tensor rank-one approximation algorithm (such as power iteration) with the estimate given by the unfolding method. Overall, this work advances our understanding of tensor data processing through rigorous theoretical results. Finally, a natural question for future work is how to extend our results to more general view functions $f_k$ .
+
+# ACKNOWLEDGMENTS
+
+J. H. de M. Goulart was supported by the ANR LabEx CIMI (ANR-11-LABX-0040) within the French program "Investissements d'Avenir".
+
+# REFERENCES
+
+Animashree Anandkumar, Rong Ge, Daniel Hsu, Sham M Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models. Journal of Machine Learning Research, 15: 2773-2832, 2014.
+Zhidong Bai and Jack W. Silverstein. Spectral analysis of large dimensional random matrices, volume 20. Springer, 2010.
+Jinho Baik, Gérard Ben Arous, and Sandrine Péché. Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices. The Annals of Probability, 33(5):1643-1697, September 2005. ISSN 0091-1798, 2168-894X. doi: 10.1214/009117905000000233. URL https://projecteuclid.org/journals/annals-of-probability/volume-33/issue-5/Phase-transition-of-the-largest-eigenvalue-for-nonnull-complex-sample/10.1214/009117905000000233.full. Publisher: Institute of Mathematical Statistics.
+Gérard Ben Arous, Daniel Zhengyu Huang, and Jiaoyang Huang. Long Random Matrices and Tensor Unfolding. arXiv:2110.10210 [cs, math, stat], October 2021. URL http://arxiv.org/abs/2110.10210.arXiv:2110.10210.
+Florent Benaych-Georges and Raj Rao Nadakuditi. The eigenvalues and eigenvectors of finite, low rank perturbations of large random matrices. Advances in Mathematics, 227(1):494-521, May 2011. ISSN 0001-8708. doi: 10.1016/j AIM.2011.02.007. URL https://www.sciencedirect.com/science/article/pii/S0001870811000570.
+Patrick Billingsley. Probability and Measure. Wiley Series in Probability and Statistics. John Wiley & Sons, Inc., 2012.
+Louis H. Y. Chen. An inequality for the multivariate normal distribution. Journal of Multivariate Analysis, 12(2):306-315, June 1982. ISSN 0047-259X. doi: 10.1016/0047-259X(82)90022-7. URL https://www.sciencedirect.com/science/article/pii/0047259X82900227.
+Romain Couillet and Zhenyu Liao. Random Matrix Methods for Machine Learning. Cambridge University Press, Cambridge, 2022. ISBN 978-1-00-912323-5. doi: 10.1017/9781009128490. URL https://www.cambridge.org/core/books/random-matrix-methods-for-machine-learning/6B681EB69E58B5F888EDB689C160C682.
+Persi Diaconis and David Freedman. A dozen de Finetti-style results in search of a theory. Annales de l'I.H.P. Probabilités et statistiques, 23(S2):397-423, 1987. ISSN 1778-7017. URL http://www numdam.org/item/AIHPB_1987_23_S2_397_0/.
+Jose Henrique de M. Goulart, Romain Couillet, and Pierre Comon. A Random Matrix Perspective on Random Tensors. Journal of Machine Learning Research, 23(264):1-36, 2022. ISSN 1533-7928. URL http://jmlr.org/papers/v23/21-1038.html.
+Christopher Hillar and Lek-Heng Lim. Most tensor problems are NP-hard, June 2013. URL http://arxiv.org/abs/0911.1393.arXiv:0911.1393 [cs, math].
+Joseph M Landsberg. Tensors: Geometry and applications. Representation Theory, 381(402):3, 2012.
+Hugo Lebeau, Florent Chatelain, and Romain Couillet. A Random Matrix Approach to Low-Multilinear-Rank Tensor Approximation, February 2024. URL http://arxiv.org/abs/s/2402.03169. arXiv:2402.03169 [cs, math, stat].
+
+Michel Ledoux. The Concentration of Measure Phenomenon. Number 89 in Mathematical Surveys and Monographs. American Mathematical Society, 2001.
+Xinwang Liu, Miaomiao Li, Chang Tang, Jingyuan Xia, Jian Xiong, Li Liu, Marius Kloft, and En Zhu. Efficient and Effective Regularized Incomplete Multi-View Clustering. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(8):2634-2646, August 2021. ISSN 1939-3539. doi: 10.1109/TPAMI.2020.2974828. URL https://ieeexplore.ieee.org/document/9001210. Conference Name: IEEE Transactions on Pattern Analysis and Machine Intelligence.
+Xinwang Liu, En Zhu, Jiyuan Liu, Timothy Hospedales, Yang Wang, and Meng Wang. SimpleMKKM: Simple Multiple Kernel K-Means. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(4):5174-5186, April 2023. ISSN 1939-3539. doi: 10.1109/TPAM I.2022.3198638. URL https://ieeexplore.ieee.org/document/9857664. Conference Name: IEEE Transactions on Pattern Analysis and Machine Intelligence.
+Anna Lytova and Leonid Pastur. Central limit theorem for linear eigenvalue statistics of random matrices with independent entries. The Annals of Probability, 37(5):1778-1840, 2009. Publisher: Institute of Mathematical Statistics.
+Matthias Löffler, Anderson Y. Zhang, and Harrison H. Zhou. Optimality of Spectral Clustering in the Gaussian Mixture Model. arXiv:1911.00538 [cs, math, stat], August 2020. URL http://arxiv.org/abs/1911.00538.arXiv:1911.00538.
+Vladimir A. Marčenko and Leonid A. Pastur. Distribution of eigenvalues for some sets of random matrices. Mathematics of the USSR-Sbornik, 1(4):457, 1967. Publisher: IOP Publishing.
+Andrea Montanari and Emile Richard. A statistical model for tensor PCA, November 2014. URL http://arxiv.org/abs/1411.1076.arXiv:1411.1076 [cs, math, stat].
+Feiping Nie, Jing Li, and Xuelong Li. Parameter-free auto-weighted multiple graph learning: a framework for multiview clustering and semi-supervised classification. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI'16, pp. 1881-1887, New York, New York, USA, July 2016. AAAI Press. ISBN 978-1-57735-770-4.
+Feiping Nie, Guohao Cai, and Xuelong Li. Multi-View Clustering and Semi-Supervised Classification with Adaptive Neighbours. Proceedings of the AAAI Conference on Artificial Intelligence, 31(1), February 2017a. ISSN 2374-3468. doi: 10.1609/aaai.v31i1.10909. URL https://ojs.aaai.org/index.php/AAAI/article/view/10909.Number: 1.
+Feiping Nie, Jing Li, and Xuelong Li. Self-weighted multiview clustering with multiple graphs. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, IJCAI'17, pp. 2564-2570, Melbourne, Australia, August 2017b. AAAI Press. ISBN 978-0-9992411-0-3.
+Alexei Onatski, Marcelo J. Moreira, and Marc Hallin. Asymptotic power of sphericity tests for high-dimensional data. The Annals of Statistics, 41(3):1204-1231, June 2013. ISSN 0090-5364, 2168-8966. doi: 10.1214/13-AOS1100. URL https://projecteuclid.org/journals/annals-of-statistics/volume-41/issue-3/Asymptotic-power-of-sphericity-tests-for-high-dimensional-data/10.1214/13-AOS1100.full. Publisher: Institute of Mathematical Statistics.
+Evangelos E. Papalexakis, Nicholas D. Sidiropoulos, and Rasmus Bro. From k-means to higher-way co-clustering: Multilinear decomposition with sparse latent factors. IEEE Transactions on Signal Processing, 61(2):493-506, 2012.
+Leonid Andreevich Pastur and Mariya Shcherbina. Eigenvalue Distribution of Large Random Matrices. Number 171 in Mathematical Surveys and Monographs. American Mathematical Society, 2011.
+Xi Peng, Zhenyu Huang, Jiancheng Lv, Hongyuan Zhu, and Joey Tianyi Zhou. COMIC: Multi-view Clustering Without Parameter Selection. In Proceedings of the 36th International Conference on Machine Learning, pp. 5092-5101. PMLR, May 2019. URL https://proceedings.mlr. press/v97/peng19a.html. ISSN: 2640-3498.
+
+Mohamed El Amine Seddik, Maxime Guillaud, and Romain Couillet. When Random Tensors meet Random Matrices. arXiv:2112.12348 [math, stat], January 2022. URL http://arxiv.org/abs/2112.12348.arXiv:2112.12348.
+Mohamed El Amine Seddik, Mastane Achab, Henrique Goulart, and Merouane Debbah. A Nested Matrix-Tensor Model for Noisy Multi-view Clustering, May 2023a. URL http://arxiv.org/abs/2305.19992. arXiv:2305.19992 [cs, stat].
+Mohamed El Amine Seddik, Malik Tiomoko, Alexis Decurninge, Maxim Panov, and Maxime Gauillaud. Learning from low rank tensor data: A random tensor theory perspective. In Robin J. Evans and Ilya Shpitser (eds.), Proceedings of the Thirty-Ninth Conference on Uncertainty in Artificial Intelligence, volume 216 of Proceedings of Machine Learning Research, pp. 1858-1867. PMLR, 31 Jul-04 Aug 2023b. URL https://proceedings.mlr.press/v216/seddik23a.html.
+Charles M. Stein. Estimation of the Mean of a Multivariate Normal Distribution. The Annals of Statistics, 9(6):1135-1151, November 1981. ISSN 0090-5364, 2168-8966. doi: 10.1214/aos/1176345632. URL https://projecteuclid.org/journals/annals-of-statistics/volume-9/issue-6/Estimation-of-the-Mean-of-a-Multivariate-Normal-Distribution/10.1214/aos/1176345632.full. Publisher: Institute of Mathematical Statistics.
+Will Wei Sun, Botao Hao, and Lexin Li. Tensors in modern statistical learning. Wiley StatsRef: Statistics Reference Online, pp. 1-25, 2014.
+Terence Tao. Topics in random matrix theory, volume 132. American Mathematical Soc., 2012.
+Jinxin Wang, Yuen-Man Pun, Xiaolu Wang, Peng Wang, and Anthony Man-Cho So. Projected tensor power method for hypergraph community recovery. In Proceedings of the 40th annual International Conference on Machine Learning, pp. 129-136, 2023.
+Xiaobo Wang, Xiaojie Guo, Zhen Lei, Changqing Zhang, and Stan Z. Li. Exclusivity-Consistency Regularized Multi-View Subspace Clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 923-931, 2017. URL https://openaccess.thecvf.com/content_cvpr_2017/html/Wang_Exclusivity-Consistency-Regularized_Multi-View_CVPR_2017_paper.html.
+Xiaobo Wang, Zhen Lei, Xiaojie Guo, Changqing Zhang, Hailin Shi, and Stan Z. Li. Multi-view subspace clustering with intactness-aware similarity. Pattern Recognition, 88:50-63, April 2019. ISSN 0031-3203. doi: 10.1016/j.patcog.2018.09.009. URL https://www.sciencedirect.com/science/article/pii/S0031320318303285.
+Jianlong Wu, Zhouchen Lin, and Hongbin Zha. Essential Tensor Learning for Multi-View Spectral Clustering. IEEE Transactions on Image Processing, 28(12):5910-5922, December 2019. ISSN 1941-0042. doi: 10.1109/TIP.2019.2916740. Conference Name: IEEE Transactions on Image Processing.
+Changqing Zhang, Qinghua Hu, Huazhu Fu, Pengfei Zhu, and Xiaochun Cao. Latent Multi-View Subspace Clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4279-4287, 2017. URL https://openaccess.thecvf.com/content_caption_cvpr_2017/html/Zhang_Latent_Multi-View_Subspace_CVPR_2017_paper.html.
+Zheng Zhang, Li Liu, Fumin Shen, Heng Tao Shen, and Ling Shao. Binary Multi-View Clustering. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(7):1774-1782, July 2019. ISSN 1939-3539. doi: 10.1109/TPAMI.2018.2847335. Conference Name: IEEE Transactions on Pattern Analysis and Machine Intelligence.
+
+# A UNFOLDING ALONG THE THIRD MODE
+
+For the sake of completeness, we study in this section the recovery of $z$ from the third unfolding of $\mathbf{T}$ . Following the model in equation 2, the expression of $\mathbf{T}^{(3)}$ is
+
+$$
+\mathbf {T} ^ {(3)} = \beta_ {T} \boldsymbol {z} \boldsymbol {m} ^ {\top} + \frac {1}{\sqrt {n _ {T}}} \mathbf {W} ^ {(3)} \tag {6}
+$$
+
+where $\mathbf{m} = \left[\mathbf{M}_{1,:}\quad \dots \quad \mathbf{M}_{n_{1},:}\right]^{\top}\in \mathbb{R}^{n_{1}n_{2}}$
+
+This unfolding has the peculiarity that the rank-one perturbation $\beta_T\mathbf{z}\mathbf{m}^\top$ mixes signal (the vector $\mathbf{z}$ ) and noise (contained in $\mathbf{M}$ ). Still, as for the previous unfoldings, the dominant left singular vector of $\mathbf{T}^{(3)}$ remains a natural estimator of $\mathbf{z}$ and we study the asymptotic spectral properties of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ . Because of the long shape of $\mathbf{T}^{(3)}$ (one dimension grows faster than the other), the spectrum of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ diverges in the same way as that of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ . Therefore, we must proceed to a similar rescaling. The following theorem states that, after proper rescaling, the distribution of eigenvalues of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ approaches the semi-circle distribution.
+
+Theorem 6 (Limiting Spectral Distribution). As $n_1, n_2, n_3 \to +\infty$ , the limiting spectral distribution of the centered-and-scaled matrix $\frac{n_T}{\sqrt{n_1n_2n_3}} \mathbf{T}^{(3)} \mathbf{T}^{(3)\top} - \frac{n_3 + n_1n_2}{\sqrt{n_1n_2n_3}} \mathbf{I}_{n_3}$ converges weakly to a semi-circle distribution on $[-2, 2]$ ,
+
+$$
+\mu_ {S C} (\mathrm {d} x) = \frac {1}{2 \pi} \sqrt {[ 4 - x ^ {2} ] ^ {+}}.
+$$
+
+Proof. See Appendix E.
+
+
+
+The ESD and LSD of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ are plotted in the right panel of Figure 1. The result of Theorem 6 is not surprising: the "non-trivial" shape of the LSD of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ (Theorem 1) is due to the presence of a "signal-noise" $\frac{\beta_T}{\sqrt{n_M}}\mathbf{Z}^\top (\mathbf{I}_{n_1}\boxtimes \mathbf{z})^\top$ in the expression of $\mathbf{T}^{(2)}$ but, when $\beta_{T}$ is set to 0, we have observed that the LSD of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ is simply a semi-circle. This is coherent with the case that interest us here: in $\mathbf{T}^{(3)}$ , the "signal-noise" is restrained to the rank-one perturbation and therefore does not impact the LSD of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ , which is then a semi-circle.
+
+Because of the rank-one perturbation $\beta_T\pmb{z}\pmb{m}^\top$ , the spectrum of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ exhibits an isolated eigenvalue which can be observed in the right panel of Figure 1. Our next step is to characterize the behavior of this spike eigenvalue and the correlation with $\pmb{z}$ of its corresponding eigenvector. Before introducing the formal result in Theorem 7, let us have a close look at the expression of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ to understand, with hand-waving arguments, what should be the non-trivial regime in this case.
+
+$$
+\mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top} = \beta_ {T} ^ {2} \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} z z ^ {\top} + \frac {\beta_ {T}}{\sqrt {n _ {T}}} \left(z m ^ {\top} \mathbf {W} ^ {(3) \top} + \mathbf {W} ^ {(3)} m z ^ {\top}\right) + \frac {1}{n _ {T}} \mathbf {W} ^ {(3)} \mathbf {W} ^ {(3) \top}
+$$
+
+Starting from the right, the term $\frac{1}{n_T} \mathbf{W}^{(3)} \mathbf{W}^{(3)^\top}$ is already understood thanks to Theorem 6 and yields a semi-circle as limiting spectral distribution. The crossed-terms in the middle have zero mean and are expected to vanish. On the left, remains the rank-one term $zz^\top$ weighted by $\beta_T^2 \| \mathbf{M} \|_F^2$ , which is a random quantity because of the noise $\mathbf{Z}$ in $\mathbf{M}$ . However, the quantity $\| \mathbf{M} \|_F^2$ is expected to rapidly concentrate around its mean $\frac{n_1 n_2}{n_M} + \beta_M^2$ . Hence, guessing from the results on the previous unfoldings, we would need the quantity $\beta_T^2 \left( \frac{n_1 n_2}{n_M} + \beta_M^2 \right) \frac{n_T}{\sqrt{n_1 n_2 n_3}}$ to converge to a fixed positive value denoted $\varrho$ . Indeed, this is precisely what is found when this analysis is rigorously carried out (see Appendix E), meaning that $\beta_T = \Theta(n_T^{-1/4})$ . In other words, if $\beta_T$ is a constant ( $\beta_T = \Theta(1)$ ), we are above the non-trivial regime and therefore should expect (asymptotically) exact recovery. This is because the strength of the signal is "boosted" by $\| \mathbf{M} \|_F^2 = \Theta(n_T)$ .
+
+Remark. $\varrho$ is defined as the limit of $\beta_T^2\left(\frac{n_1n_2}{n_M} +\beta_M^2\right)\frac{n_T}{\sqrt{n_1n_2n_3}}$ which is the same as that of $\beta_T^2\frac{n_1n_2}{n_M}\frac{n_T}{\sqrt{n_1n_2n_3}}$ since $\beta_{M} = \Theta (1)$ . However, we keep the $\beta_M^2$ term in the definition of $\rho_T$ as it yields better predictions in our simulations.
+
+Theorem 7 (Spike Behavior). If $\varrho = \lim \frac{\beta_T^2n_T}{\sqrt{n_1n_2n_3}}\left(\frac{n_1n_2}{n_M} +\beta_M^2\right) > 1$ , then the centered-and-scaled matrix $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(3)}\mathbf{T}^{(3)\top} - \frac{n_3 + n_1n_2}{\sqrt{n_1n_2n_3}}\mathbf{I}_{n_3}$ has an isolated eigenvalue asymptotically located in $\varrho +\frac{1}{\varrho}$ almost surely. Furthermore, in this case, the alignment between the corresponding eigenvector $\hat{\mathbf{z}}$ and the true signal $z$ converges to $1 - \frac{1}{\varrho^2}$ almost surely, i.e.,
+
+$$
+\left| \hat {\mathbf {z}} ^ {\top} \mathbf {z} \right| ^ {2} \xrightarrow [ n _ {1}, n _ {2}, n _ {3} \to + \infty ]{} 1 - \frac {1}{\varrho^ {2}} \qquad a l m o s t s u r e l y.
+$$
+
+Proof. See Appendix F.
+
+
+
+Once the quantity $\varrho$ is defined, we recognize in Theorem 7 the same results as that of the spiked Wigner model (Benaych-Georges & Nadakuditi, 2011).
+
+Remark. In practice, we work with large but finite tensors. Hence, it makes no sense to say that $\beta_{T} = \Theta (n_{T}^{1 / 4})$ or $\beta_{T} = \Theta (n_{T}^{-1 / 4})$ . In fact, the characterization of the "non-trivial" regime is only important here to reveal the relevant quantities, i.e., $\rho_T$ and $\varrho$ , which we will use in practice without worrying whether $\beta_{T}$ is in the right regime or not.
+
+# B PROOF OF THEOREM 1
+
+Denote $\mathbf{Q}(s) = \left(\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - s\mathbf{I}_{n_2}\right)^{-1}$ the resolvent of $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$ defined for all $s\in \mathbb{C}\setminus$ $\mathrm{sp}\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}$
+
+# B.1 COMPUTATIONS WITH STEIN'S LEMMA
+
+Before delving into the analysis of $\mathbf{Q}$ , we will derive a few useful results thanks to Stein's lemma (Lemma 1). They are gathered in the following Proposition 2.
+
+Proposition 2.
+
+$$
+\mathbb {E} \left[ \mathbf {W} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] = \frac {n _ {1} n _ {3}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + s (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] \tag {7}
+$$
+
+$$
+\mathbb {E} \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \left(\mathbf {Q} + \frac {1}{n _ {T}} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right)\right) \right] = \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \mathbf {M} \mathbf {Q} \right] \tag {8}
+$$
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M} \mathbf {Q} \right] = \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ \left(n _ {1} - n _ {2} - 1\right) \mathbf {Q} - \left(s - \frac {n _ {1} n _ {3}}{n _ {T}}\right) \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right) \right] \tag {9} \\ - \frac {s}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ 4 \mathbf {Q} ^ {3} + 2 \mathbf {Q} ^ {2} \operatorname {T r} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} ^ {2} \mathbf {Q} \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 2) \mathbf {Q} \operatorname {T r} \mathbf {Q} + (n _ {2} + 4) \mathbf {Q} ^ {2} \right] \\ \end{array}
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {Z} \mathbf {Q} \right] = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right) \right] \tag {10}
+$$
+
+$$
+\beta_ {T} \mathbb {E} \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {M} \mathbf {Q} \right] = \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \left(\mathbf {Q} + \frac {1}{n _ {T}} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right)\right) \right] \tag {11}
+$$
+
+In order to prove these results, we will need the following expressions for the derivatives of $\mathbf{Q}$ .
+
+Proposition 3.
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {W} _ {c , d} ^ {(2)}} = - \frac {1}{\sqrt {n _ {T}}} \left(\mathbf {Q} _ {a, c} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {d, b} + \mathbf {Q} _ {c, b} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {d, a}\right) \tag {12}
+$$
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {Z} _ {c , d}} = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \left(\mathbf {Q} _ {a, d} \left[ \mathbf {Q T} ^ {(2)} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) \right] _ {b, c} + \mathbf {Q} _ {d, b} \left[ \mathbf {Q T} ^ {(2)} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) \right] _ {a, c}\right) \tag {13}
+$$
+
+Proof. Since $\partial \mathbf{Q} = -\mathbf{Q}\partial \left(\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}\right)\mathbf{Q},$
+
+$$
+\begin{array}{l} \frac {\partial \mathrm {Q} _ {a , b}}{\partial \mathrm {W} _ {i , j , k}} = - \sum_ {e = 1} ^ {n _ {2}} \sum_ {f = 1} ^ {n _ {1}} \sum_ {g = 1} ^ {n _ {3}} \sum_ {h = 1} ^ {n _ {2}} \mathrm {Q} _ {a, e} \left(\frac {\partial T _ {f , e , g}}{\partial \mathrm {W} _ {i , j , k}} T _ {f, h, g} + T _ {f, e, g} \frac {\partial T _ {f , h , g}}{\partial \mathrm {W} _ {i , j , k}}\right) \mathrm {Q} _ {h, b} \\ = - \frac {1}{\sqrt {n _ {T}}} \left(\sum_ {h = 1} ^ {n _ {2}} Q _ {a, j} T _ {i, h, k} Q _ {h, b} + \sum_ {e = 1} ^ {n _ {2}} Q _ {a, e} T _ {i, e, k} Q _ {j, b}\right) \\ \end{array}
+$$
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial W _ {i , j , k}} = - \frac {1}{\sqrt {n _ {T}}} \left(\mathbf {Q} _ {a, j} \left[ \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {[ i, k ], b} + \mathbf {Q} _ {j, b} \left[ \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {[ i, k ], a}\right).
+$$
+
+Likewise,
+
+$$
+\begin{array}{l} \frac {\partial \mathrm {Q} _ {a , b}}{\partial \mathrm {Z} _ {c , d}} = - \sum_ {e = 1} ^ {n _ {2}} \sum_ {f = 1} ^ {n _ {1}} \sum_ {g = 1} ^ {n _ {3}} \sum_ {h = 1} ^ {n _ {2}} \mathrm {Q} _ {a, e} \left(\frac {\partial T _ {f , e , g}}{\partial \mathrm {Z} _ {c , d}} T _ {f, h, g} + T _ {f, e, g} \frac {\partial T _ {f , h , g}}{\partial \mathrm {Z} _ {c , d}}\right) \mathrm {Q} _ {h, b} \\ = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \left(\sum_ {g = 1} ^ {n _ {3}} \sum_ {h = 1} ^ {n _ {2}} Q _ {a, d} z _ {g} T _ {c, h, g} Q _ {h, b} + \sum_ {e = 1} ^ {n _ {2}} \sum_ {g = 1} ^ {n _ {3}} Q _ {a, e} T _ {c, e, g} z _ {g} Q _ {d, b}\right) \\ \end{array}
+$$
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {Z} _ {c , d}} = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \left(\mathbf {Q} _ {a, d} \left[ \mathbf {Q T} ^ {(2)} (\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}) \right] _ {b, c} + \mathbf {Q} _ {d, b} \left[ \mathbf {Q T} ^ {(2)} (\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}) \right] _ {a, c}\right).
+$$
+
+
+
+Combining Stein's lemma (Lemma 1) and Proposition 3, we can prove each expression of Proposition 2.
+
+# Proof of equation 7
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {W} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {i, j} = \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathbf {W} _ {i, k} ^ {(2)} \mathbf {T} _ {l, k} ^ {(2)} \mathbf {Q} _ {l, j} \right] \\ = \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \frac {\partial \mathrm {T} _ {l , k} ^ {(2)}}{\partial \mathrm {W} _ {i , k} ^ {(2)}} \mathrm {Q} _ {l, j} + \mathrm {T} _ {l, k} ^ {(2)} \frac {\partial \mathrm {Q} _ {l , j}}{\partial \mathrm {W} _ {i , k} ^ {(2)}} \right] \\ = \frac {n _ {1} n _ {3}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathrm {T} _ {l, k} ^ {(2)} \left(\mathbf {Q} _ {l, i} [ \mathbf {T} ^ {(2) \top} \mathbf {Q} ] _ {k, j} + \mathbf {Q} _ {i, j} [ \mathbf {T} ^ {(2) \top} \mathbf {Q} ] _ {k, l}\right) \right] \\ = \frac {n _ {1} n _ {3}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ \mathbf {Q} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \left(\mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q}\right) \right] _ {i, j} \\ = \frac {n _ {1} n _ {3}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + s (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] _ {i, j} \\ \end{array}
+$$
+
+where the last equality comes from $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}\mathbf{Q} = I_{n_2} + s\mathbf{Q}$
+
+# Proof of equation 8
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {i, j} \\ = \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \mathbf {M Q} \right] _ {i, j} + \frac {1}{\sqrt {n _ {T}}} \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \right] _ {i, k} \mathbf {W} _ {l, k} ^ {(2)} \mathbf {Q} _ {l, j} \right] \\ = \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \mathbf {M Q} \right] _ {i, j} + \frac {1}{\sqrt {n _ {T}}} \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \right] _ {i, k} \frac {\partial \mathbf {Q} _ {l , j}}{\partial \mathbf {W} _ {l , k} ^ {(2)}} \right] \\ = \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \mathbf {M Q} \right] _ {i, j} - \frac {1}{n _ {T}} \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \right] _ {i, k} \mathbf {Q} _ {l, l} \left[ \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {k, j} \right] \\ - \frac {1}{n _ {T}} \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \right] _ {i, k} \mathbf {Q} _ {l, j} \left[ \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {k, l} \right] \\ = \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \mathbf {M Q} \right] _ {i, j} - \frac {1}{n _ {T}} \mathbb {E} \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right) \right] _ {i, j}. \\ \end{array}
+$$
+
+# Proof of equation 9
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M Q} \right] _ {i, j} = \sum_ {k = 1} ^ {n _ {1}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathbf {Z} _ {k, i} \mathbf {M} _ {k, l} \mathbf {Q} _ {l, j} \right] \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} + \sum_ {k = 1} ^ {n _ {1}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathbf {M} _ {k, l} \frac {\partial \mathbf {Q} _ {l , j}}{\partial \mathbf {Z} _ {k , i}} \right] \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {k = 1} ^ {n _ {1}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathbf {M} _ {k, l} \left(\mathbf {Q} _ {l, i} \left[ \mathbf {Q T} ^ {(2)} (\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}) \right] _ {j, k} + \mathbf {Q} _ {i, j} \left[ \mathbf {Q T} ^ {(2)} (\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}) \right] _ {l, k}\right) \right] \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \left(\mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \mathbf {Q}\right) \right] _ {i, j} \\ \end{array}
+$$
+
+and, since $\beta_T\mathbf{M}^\top (\boldsymbol{I}_{n_1}\boxtimes \boldsymbol {z})^\top = \mathbf{T}^{(2)} - \frac{1}{\sqrt{n_T}}\mathbf{W}^{(2)}$ , with the relation $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}\mathbf{Q} = s\mathbf{Q} + I_{n_2}$ we have,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M} \mathbf {Q} \right] _ {i, j} = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} \right] _ {i, j} - \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ s \mathbf {Q} ^ {2} + \mathbf {Q} + s \mathbf {Q} \operatorname {T r} \mathbf {Q} + n _ {2} \mathbf {Q} \right] _ {i, j} \\ + \frac {1}{\sqrt {n _ {M} n _ {T}}} \mathbb {E} \left[ \mathbf {Q} \mathbf {W} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \left(\mathbf {W} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q}\right) \right] _ {i, j} \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + s (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] _ {i, j} \\ + \frac {1}{\sqrt {n _ {M} n _ {T}}} \sum_ {u = 1} ^ {n _ {2}} \sum_ {v = 1} ^ {n _ {1} n _ {3}} \sum_ {w = 1} ^ {n _ {2}} \mathbb {E} \left[ \frac {\partial \mathrm {Q} _ {i , u}}{\partial \mathrm {W} _ {u , v} ^ {(2)}} \mathrm {T} _ {w, v} ^ {(2)} \mathrm {Q} _ {w, j} + \mathrm {Q} _ {i, u} \frac {\partial \mathrm {T} _ {w , v} ^ {(2)}}{\partial \mathrm {W} _ {u , v} ^ {(2)}} \mathrm {Q} _ {w, j} + \mathrm {Q} _ {i, u} \mathrm {T} _ {w, v} ^ {(2)} \frac {\partial \mathrm {Q} _ {w , j}}{\partial \mathrm {W} _ {u , v} ^ {(2)}} \right] \\ + \frac {1}{\sqrt {n _ {M} n _ {T}}} \sum_ {u = 1} ^ {n _ {2}} \sum_ {v = 1} ^ {n _ {1} n _ {3}} \sum_ {w = 1} ^ {n _ {2}} \mathbb {E} \left[ \frac {\partial \mathrm {Q} _ {i , j}}{\partial \mathrm {W} _ {u , v} ^ {(2)}} \mathrm {T} _ {w, v} ^ {(2)} \mathrm {Q} _ {w, u} + \mathrm {Q} _ {i, j} \frac {\partial \mathrm {T} _ {w , v} ^ {(2)}}{\partial \mathrm {W} _ {u , v} ^ {(2)}} \mathrm {Q} _ {w, u} + \mathrm {Q} _ {i, j} \mathrm {T} _ {w, v} ^ {(2)} \frac {\partial \mathrm {Q} _ {w , u}}{\partial \mathrm {W} _ {u , v} ^ {(2)}} \right] \\ \end{array}
+$$
+
+where we have used Stein's lemma (Lemma 1) again. Hence,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M Q} \right] _ {i, j} \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + s (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] _ {i, j} + \frac {n _ {1} n _ {3}}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q} ] _ {i, j} \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \sum_ {u = 1} ^ {n _ {2}} \sum_ {v = 1} ^ {n _ {1} n _ {3}} \sum_ {w = 1} ^ {n _ {2}} \mathbb {E} \left[ \left(\mathbf {Q} _ {i, u} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {v, u} + \mathbf {Q} _ {u, u} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {v, i}\right) \mathbf {T} _ {w, v} ^ {(2)} \mathbf {Q} _ {w, j} \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \sum_ {u = 1} ^ {n _ {2}} \sum_ {v = 1} ^ {n _ {1} n _ {3}} \sum_ {w = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathbf {Q} _ {i, u} \mathbf {T} _ {w, v} ^ {(2)} \left(\mathbf {Q} _ {w, u} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {v, j} + \mathbf {Q} _ {u, j} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {v, w}\right) \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \sum_ {u = 1} ^ {n _ {2}} \sum_ {v = 1} ^ {n _ {1} n _ {3}} \sum_ {w = 1} ^ {n _ {2}} \mathbb {E} \left[ \left(\mathrm {Q} _ {i, u} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {v, j} + \mathrm {Q} _ {u, j} \left[ \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] _ {v, i}\right) \mathrm {T} _ {w, v} ^ {(2)} \mathrm {Q} _ {w, u} \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \sum_ {u = 1} ^ {n _ {2}} \sum_ {v = 1} ^ {n _ {1} n _ {3}} \sum_ {w = 1} ^ {n _ {2}} \mathbb {E} \left[ \mathrm {Q} _ {i, j} \mathrm {T} _ {w, v} ^ {(2)} \left(\mathrm {Q} _ {w, u} \left[ \mathrm {T} ^ {(2) ^ {\top}} \mathrm {Q} \right] _ {v, u} + \mathrm {Q} _ {u, u} \left[ \mathrm {T} ^ {(2) ^ {\top}} \mathrm {Q} \right] _ {v, w}\right) \right] \\ \end{array}
+$$
+
+which bunches up into
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M Q} \right] _ {i, j} \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + \left(s - \frac {n _ {1} n _ {3}}{n _ {T}}\right) (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] _ {i, j} \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} ^ {2} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} + \mathbf {Q} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \operatorname {T r} \mathbf {Q} \right] _ {i, j} \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} ^ {2} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} + \mathbf {Q} ^ {2} \operatorname {T r} \left(\mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q}\right) \right] _ {i, j} \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} ^ {2} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q} + \mathbf {Q} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q} ^ {2} \right] _ {i, j} \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} \operatorname {T r} \left(\mathbf {Q} \mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q}\right) + \mathbf {Q} \operatorname {T r} \mathbf {Q} \operatorname {T r} \left(\mathbf {T} ^ {(2)} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q}\right) \right] _ {i, j} \\ \end{array}
+$$
+
+and, using again the relation $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}\mathbf{Q} = s\mathbf{Q} + I_{n_2}$ , we get,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M Q} \right] \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] - \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + \left(s - \frac {n _ {1} n _ {3}}{n _ {T}}\right) (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ s \mathbf {Q} ^ {3} + \mathbf {Q} ^ {2} + s \mathbf {Q} ^ {2} \operatorname {T r} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \mathbf {Q} + s \mathbf {Q} ^ {3} + \mathbf {Q} ^ {2} + s \mathbf {Q} ^ {2} \operatorname {T r} \mathbf {Q} + n _ {2} \mathbf {Q} ^ {2} \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ s \mathbf {Q} ^ {3} + \mathbf {Q} ^ {2} + s \mathbf {Q} ^ {3} + \mathbf {Q} ^ {2} + s \mathbf {Q} \operatorname {T r} \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q} + s \mathbf {Q} \operatorname {T r} ^ {2} \mathbf {Q} + n _ {2} \mathbf {Q} \operatorname {T r} \mathbf {Q} \right] \\ = \frac {n _ {1}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} ] - \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + \left(s - \frac {n _ {1} n _ {3}}{n _ {T}}\right) (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ s \left(4 \mathbf {Q} ^ {3} + 2 \mathbf {Q} ^ {2} \operatorname {T r} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} ^ {2} \mathbf {Q}\right) \right] \\ - \frac {1}{n _ {T} \sqrt {n _ {M}}} \mathbb {E} \left[ (n _ {2} + 4) \mathbf {Q} ^ {2} + (n _ {2} + 2) \mathbf {Q} \operatorname {T r} \mathbf {Q} \right]. \\ \end{array}
+$$
+
+# Proof of equation 10
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {Z} \mathbf {Q} \right] _ {i, j} = \sum_ {k = 1} ^ {n _ {1}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \right] _ {i, k} \mathbf {Z} _ {k, l} \mathbf {Q} _ {l, j} \right] \\ = \sum_ {k = 1} ^ {n _ {1}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \right] _ {i, k} \frac {\partial \mathrm {Q} _ {l , j}}{\partial \mathrm {Z} _ {k , l}} \right] \\ = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {k = 1} ^ {n _ {1}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \right] _ {i, k} \left(\mathrm {Q} _ {l, l} \left[ \mathbf {Q T} ^ {(2)} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) \right] _ {j, k} + \mathrm {Q} _ {l, j} \left[ \mathbf {Q T} ^ {(2)} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) \right] _ {l, k}\right) \right] \\ = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right) \right] _ {i, j}. \\ \end{array}
+$$
+
+# Proof of equation 11
+
+$$
+\begin{array}{l} \beta_ {T} \mathbb {E} \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {M Q} \right] = \beta_ {T} \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) \mathbf {M Q} \right] \\ = \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \left(\mathbf {T} ^ {(2)} - \frac {1}{\sqrt {n _ {T}}} \mathbf {W} ^ {(2)}\right) ^ {\top} \mathbf {Q} \right] \\ \end{array}
+$$
+
+and,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {W} ^ {(2) \top} \mathbf {Q} \right] _ {i, j} = \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \right] _ {i, k} \mathbf {W} _ {l, k} ^ {(2)} \mathbf {Q} _ {l, j} \right] \\ = \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \right] _ {i, k} \frac {\partial \mathrm {Q} _ {l , j}}{\partial \mathrm {W} _ {l , k} ^ {(2)}} \right] \\ = - \frac {1}{\sqrt {n _ {T}}} \sum_ {k = 1} ^ {n _ {1} n _ {3}} \sum_ {l = 1} ^ {n _ {2}} \mathbb {E} \left[ \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \right] _ {i, k} \left(\mathbf {Q} _ {l, l} \left[ \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {k, j} + \mathbf {Q} _ {l, j} \left[ \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] _ {k, l}\right) \right] \\ = - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right) \right] _ {i, j}. \\ \end{array}
+$$
+
+# B.2 DETERMINISTIC EQUIVALENT
+
+Since $\mathbf{Q}^{-1}\mathbf{Q} = I_{n_2}$ , we have $\mathbf{T}^{(2)}\mathbf{T}^{(2)\top}\mathbf{Q} - s\mathbf{Q} = I_{n_2}$ . Hence, using equation 3 and taking the expectation,
+
+$$
+\beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] + \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ \mathbf {W} ^ {(2)} \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] - s \mathbb {E} [ \mathbf {Q} ] = \boldsymbol {I} _ {n _ {2}}
+$$
+
+and, injecting equation 7, this yields
+
+$$
+\begin{array}{l} \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \mathbf {Q} \right] \\ + \frac {n _ {1} n _ {3}}{n _ {T}} \mathbb {E} [ \mathbf {Q} ] - \frac {1}{n _ {T}} \mathbb {E} \left[ (n _ {2} + 1) \mathbf {Q} + s (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] - s \mathbb {E} [ \mathbf {Q} ] = I _ {n _ {2}}. \\ \end{array}
+$$
+
+Here, we must be careful that, due to the $n_2 \times n_1 n_3$ rectangular shape of $\mathbf{T}^{(2)}$ , the spectrum of $\mathbf{T}^{(2)} \mathbf{T}^{(2)^\top}$ diverges in the limit $n_1, n_2, n_3 \to +\infty$ . In order to bypass this obstacle, we shall perform a change of variable $(s, \mathbf{Q}) \sim (\tilde{s}, \tilde{\mathbf{Q}})$ which will become clearer after rearranging the terms:
+
+$$
+\begin{array}{l} s \frac {n _ {2}}{n _ {T}} \mathbb {E} \left[ \frac {\operatorname {T r} \mathbf {Q}}{n _ {2}} \mathbf {Q} \right] + \left(s + \frac {n _ {2} - n _ {1} n _ {3}}{n _ {T}}\right) \mathbb {E} [ \mathbf {Q} ] + \boldsymbol {I} _ {n _ {2}} \\ = \beta_ {T} \mathbb {E} \left[ \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) ^ {\top}} \mathbf {Q} \right] - \frac {1}{n _ {T}} \mathbb {E} \left[ \mathbf {Q} + s \mathbf {Q} ^ {2} \right]. \\ \end{array}
+$$
+
+Let $\tilde{s} = \frac{n_Ts - (n_2 + n_1n_3)}{\sqrt{n_1n_2n_3}}$ and $\tilde{\mathbf{Q}} (\tilde{s}) = \left(\frac{n_T\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - (n_2 + n_1n_3)\mathbf{I}_{n_2}}{\sqrt{n_1n_2n_3}} -\tilde{s}\mathbf{I}_{n_2}\right)^{-1}$ . With this rescaling, note that we have $\mathbf{Q}(s) = \frac{n_T}{\sqrt{n_1n_2n_3}}\tilde{\mathbf{Q}} (\tilde{s})$ , and the previous equation becomes
+
+$$
+\begin{array}{l} \left(\frac {n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \tilde {s} + \frac {n _ {T}}{n _ {1} n _ {3}} + \frac {n _ {T}}{n _ {2}}\right) \frac {n _ {2}}{n _ {T}} \mathbb {E} \left[ \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}} \tilde {\mathbf {Q}} \right] + \left(\tilde {s} + \frac {2 n _ {2}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} \right] + \boldsymbol {I} _ {n _ {2}} \\ = \frac {\beta_ {T} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \mathbf {M} ^ {\top} (\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \tilde {\mathbf {Q}} \right] - \frac {1}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \tilde {\mathbf {Q}} + \left(\tilde {s} + \frac {n _ {2} + n _ {1} n _ {3}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \tilde {\mathbf {Q}} ^ {2} \right] \\ \end{array}
+$$
+
+and we no longer have any diverging terms. Keeping only the dominant terms, we can now proceed to a matrix-equivalent formula7
+
+$$
+\frac {\mathrm {T r} \tilde {\mathbf {Q}}}{n _ {2}} \tilde {\mathbf {Q}} + \tilde {s} \tilde {\mathbf {Q}} + \boldsymbol {I} _ {n _ {2}} \longleftrightarrow \frac {\beta_ {T} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbf {M} ^ {\top} (\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \tilde {\mathbf {Q}}.
+$$
+
+Remark. This previous step is justified by the use of standard concentration arguments such as Poincaré-Nash inequality (Chen, 1982; Ledoux, 2001) and Borel-Cantelli lemma (Billingsley, 2012), following, e.g., the lines of Couillet & Liao (2022, §2.2.2). This reasoning is applied in what follows whenever we move from an equality with expectations to an equality with matrix equivalents.
+
+Applying the same rescaling to equation 8 yields
+
+$$
+\frac {\beta_ {T} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbf {M} ^ {\top} \left(\boldsymbol {I} _ {n _ {1}} \boxtimes \boldsymbol {z}\right) ^ {\top} \mathbf {T} ^ {(2) \top} \tilde {\mathbf {Q}} \longleftrightarrow \frac {\beta_ {T} ^ {2} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbf {M} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}}.
+$$
+
+Remark. We see, here, that we must choose $\beta_{T} = \Theta (n_{T}^{1 / 4})$ in order to place ourselves in the nontrivial regime where both the noise and the signal are $\Theta (1)$ . This is different from the estimation of $\pmb{y}$ with a rank-one approximation of $\mathbf{T}$ , where $\beta_{T}$ could be kept $\Theta (1)$ (Seddik et al., 2023a) (but at the cost of an NP-hard computation (Hillar & Lim, 2013)).
+
+With this in mind, let us denote $\rho_{T} = \lim \frac{\beta_{T}^{2}n_{T}}{\sqrt{n_{1}n_{2}n_{3}}}$ and $\tilde{m} = \lim \frac{\mathrm{Tr}\tilde{\mathbf{Q}}}{n_2}$ the Stieltjes transform of the limiting spectral distribution of the centered-and-scaled matrix $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - \frac{n_2 + n_1n_3}{\sqrt{n_1n_2n_3}}\mathbf{I}_{n_2}$ . We have,
+
+$$
+\tilde {m} (\tilde {s}) \tilde {\mathbf {Q}} + \tilde {s} \tilde {\mathbf {Q}} + \boldsymbol {I} _ {n _ {2}} \longleftrightarrow \rho_ {T} \mathbf {M} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}}.
+$$
+
+In order to handle the term $\mathbf{M}^{\top}\mathbf{M}\tilde{\mathbf{Q}}$ , observe that
+
+$$
+\mathbb {E} \left[ \mathbf {M} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \right] = \beta_ {M} \mathbb {E} \left[ \boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \right] + \frac {1}{\sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Z} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \right]
+$$
+
+and, after rescaling, the only non-vanishing terms in equation 9 yield
+
+$$
+\frac {1}{\sqrt {n _ {M}}} \mathbf {Z} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \longleftrightarrow \left(\frac {n _ {1} - n _ {2}}{n _ {M}} - \tilde {s} \frac {n _ {2}}{n _ {M}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}} - \frac {n _ {2}}{n _ {M}} \left(\frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}}\right) ^ {2}\right) \tilde {\mathbf {Q}}
+$$
+
+Moreover, from equation 10, we have
+
+$$
+\beta_ {M} \pmb {y} \pmb {x} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \longleftrightarrow \beta_ {M} ^ {2} \pmb {y} \pmb {y} ^ {\top} \tilde {\mathbf {Q}} - \frac {\beta_ {T} \beta_ {M} n _ {T} n _ {2}}{n _ {M} \sqrt {n _ {1} n _ {2} n _ {3}}} \frac {\mathrm {T r} \tilde {\mathbf {Q}}}{n _ {2}} \pmb {y} (\pmb {x} \boxtimes \pmb {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \tilde {\mathbf {Q}}
+$$
+
+but, from equation 11, we also know that
+
+$$
+\boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \longleftrightarrow \frac {1}{\beta_ {T}} \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \tilde {\mathbf {Q}}.
+$$
+
+Hence,
+
+$$
+\frac {1}{\beta_ {T}} \left(\beta_ {M} + \frac {\beta_ {T} ^ {2} \beta_ {M} n _ {T} n _ {2}}{n _ {M} \sqrt {n _ {1} n _ {2} n _ {3}}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}}\right) \boldsymbol {y} (\boldsymbol {x} \boxtimes \boldsymbol {z}) ^ {\top} \mathbf {T} ^ {(2) \top} \tilde {\mathbf {Q}} \longleftrightarrow \beta_ {M} ^ {2} \boldsymbol {y} \boldsymbol {y} ^ {\top} \tilde {\mathbf {Q}}
+$$
+
+and
+
+$$
+\beta_ {M} \boldsymbol {y} \boldsymbol {x} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \longleftrightarrow \beta_ {M} ^ {2} \left(1 - \frac {\frac {\beta_ {T} ^ {2} \beta_ {M} n _ {T} n _ {2}}{n _ {M} \sqrt {n _ {1} n _ {2} n _ {3}}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}}}{\beta_ {M} + \frac {\beta_ {T} ^ {2} \beta_ {M} n _ {T} n _ {2}}{n _ {M} \sqrt {n _ {1} n _ {2} n _ {3}}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}}}\right) \boldsymbol {y} \boldsymbol {y} ^ {\top} \tilde {\mathbf {Q}}.
+$$
+
+Therefore, we have the following matrix equivalent for $\mathbf{M}^{\top}\mathbf{M}\hat{\mathbf{Q}}$
+
+$$
+\begin{array}{l} \mathbf {M} ^ {\top} \mathbf {M} \tilde {\mathbf {Q}} \longleftrightarrow \frac {\beta_ {M} ^ {2}}{1 + \frac {\beta_ {I} ^ {2} n _ {T} n _ {2}}{n _ {M} \sqrt {n _ {1} n _ {2} n _ {3}}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {2}}} \boldsymbol {y y} ^ {\top} \tilde {\mathbf {Q}} \\ \left. \right. + \left(\frac {n _ {1}}{n _ {M}} - \frac {n _ {2}}{n _ {M}} \left(1 + \tilde {s} \frac {\mathrm {T r} \tilde {\mathbf {Q}}}{n _ {2}} + \left(\frac {\mathrm {T r} \tilde {\mathbf {Q}}}{n _ {2}}\right) ^ {2}\right)\right) \tilde {\mathbf {Q}}. \\ \end{array}
+$$
+
+Ultimately, we can define $\bar{\mathbf{Q}}$ , the deterministic equivalent of $\bar{\mathbf{Q}}$ such that,
+
+$$
+\begin{array}{l} \tilde {m} (\tilde {s}) \bar {\mathbf {Q}} + \tilde {s} \bar {\mathbf {Q}} + \boldsymbol {I} _ {n _ {2}} \\ = \rho_ {T} \left[ \frac {\beta_ {M} ^ {2}}{1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s})} \pmb {y} \pmb {y} ^ {\top} + \left(\frac {c _ {1}}{1 - c _ {3}} - \frac {c _ {2}}{1 - c _ {3}} \left(1 + \tilde {s} \tilde {m} (\tilde {s}) + \tilde {m} ^ {2} (\tilde {s})\right)\right) \pmb {I} _ {n _ {2}} \right] \bar {\mathbf {Q}} \\ \end{array}
+$$
+
+or, equivalently,
+
+$$
+\left[ \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) + \tilde {s} + \frac {\rho_ {T} \left(c _ {2} - c _ {1}\right)}{1 - c _ {3}} \right] \bar {\mathbf {Q}} + \boldsymbol {I} _ {n _ {2}} = \frac {\rho_ {T} \beta_ {M} ^ {2}}{1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s})} \boldsymbol {y} \boldsymbol {y} ^ {\top} \bar {\mathbf {Q}}. \tag {14}
+$$
+
+# B.3 LIMITING SPECTRAL DISTRIBUTION
+
+According to the previous deterministic equivalent, the Stieltjes transform of the limiting spectral distribution of $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - \frac{n_2 + n_1n_3}{\sqrt{n_1n_2n_3}}\mathbf{I}_{n_2}$ is solution to
+
+$$
+\begin{array}{l} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {3} (\tilde {s}) + \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} ^ {2} (\tilde {s}) + \left(\tilde {s} + \frac {\rho_ {T} \left(c _ {2} - c _ {1}\right)}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) + 1 = 0 \\ \Longleftrightarrow \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s}) + 1\right) \left(\tilde {m} ^ {2} (\tilde {s}) + \tilde {s} \tilde {m} (\tilde {s}) + 1\right) - \frac {\rho_ {T} c _ {1}}{1 - c _ {3}} \tilde {m} (\tilde {s}) = 0. \tag {15} \\ \end{array}
+$$
+
+# C PROOF OF THEOREM 2
+
+# C.1 ISOLATED EIGENVALUE
+
+The asymptotic position $\tilde{\xi}$ of the isolated eigenvalue (when it exists) is a singular point of $\bar{\mathbf{Q}}$ . From equation 14, it is therefore solution to
+
+$$
+\begin{array}{l} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {\xi}) + \left(1 + \tilde {\xi} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} (\tilde {\xi}) + \tilde {\xi} + \frac {\rho_ {T} (c _ {2} - c _ {1})}{1 - c _ {3}} = \frac {\rho_ {T} \beta_ {M} ^ {2}}{1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi})} \\ \Longleftrightarrow \left(1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi})\right) \left[ \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \left(\tilde {m} ^ {2} (\tilde {\xi}) + \tilde {\xi} \tilde {m} (\tilde {\xi}) + 1\right) + \tilde {m} (\tilde {\xi}) + \tilde {\xi} - \frac {\rho_ {T} c _ {1}}{1 - c _ {3}} \right] = \rho_ {T} \beta_ {M} ^ {2}. \\ \end{array}
+$$
+
+Yet, $\left(\frac{\rho_T c_2}{1 - c_3} \tilde{m}(\tilde{s}) + 1\right)\left(\tilde{m}^2(\tilde{s}) + \tilde{s} \tilde{m}(\tilde{s}) + 1\right) = \frac{\rho_T c_1}{1 - c_3} \tilde{m}(\tilde{s})$ (from equation 15). Thus,
+
+$$
+\begin{array}{l} \tilde {m} (\tilde {\xi}) + \tilde {\xi} - \frac {\rho_ {T} c _ {1}}{1 - c _ {3}} + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi}) \left(\tilde {m} (\tilde {\xi}) + \tilde {\xi}\right) = \rho_ {T} \beta_ {M} ^ {2} \\ \Longleftrightarrow \underbrace {\left(1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi})\right) \left(\tilde {m} (\tilde {\xi}) + \tilde {\xi}\right)} _ {= \frac {\rho_ {T} c _ {1}}{1 - c _ {3}} - \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} - \frac {1}{\tilde {m} (\tilde {\xi})}} \text {f r o m e q u a t i o n 1 5 a g a i n} - \frac {\rho_ {T} c _ {1}}{1 - c _ {3}} = \rho_ {T} \beta_ {M} ^ {2} \\ \iff \tilde {m} (\tilde {\xi}) = \frac {- 1}{\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}}. \\ \end{array}
+$$
+
+Injecting this relation into equation 15 yields
+
+$$
+\tilde {\xi} = \frac {\rho_ {T}}{\beta_ {M} ^ {2}} \left(\frac {c _ {1}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right) \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right) + \frac {1}{\rho_ {T} \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right)}. \tag {16}
+$$
+
+# C.2 EIGENVECTOR ALIGNMENT
+
+The eigendecomposition of $\tilde{\mathbf{Q}} (\tilde{s})$ is given by $\sum_{i = 1}^{n}\frac{\mathbf{u}_i\mathbf{u}_i^\top}{\tilde{\lambda}_i - \tilde{s}}$ where $(\tilde{\lambda}_i,\mathbf{u}_i)_{1\leqslant i\leqslant n}$ are the eigenvalue-eigenvector pairs of $\frac{n_T\mathbf{T}^{(2)}\mathbf{T}^{(2)\top} - (n_2 + n_1n_3)\mathbf{I}_{n_2}}{\sqrt{n_1n_2n_3}}$ . Hence, thanks to Cauchy's integral formula, we have
+
+$$
+\left| \boldsymbol {y} ^ {\top} \hat {\boldsymbol {y}} \right| ^ {2} = - \frac {1}{2 i \pi} \oint_ {\tilde {\gamma}} \boldsymbol {y} ^ {\top} \tilde {\mathbf {Q}} (\tilde {s}) \boldsymbol {y} d \tilde {s}
+$$
+
+where $\tilde{\gamma}$ is a positively-oriented complex contour circling around the isolated eigenvalue only. The asymptotic value $\zeta$ of $|\pmb{y}^{\top}\hat{\pmb{y}}|^{2}$ can then be computed with the deterministic equivalent defined in equation 14,
+
+$$
+\zeta = - \frac {1}{2 i \pi} \oint_ {\tilde {\gamma}} \boldsymbol {y} ^ {\top} \bar {\mathbf {Q}} (\tilde {s}) \boldsymbol {y} d \tilde {s}.
+$$
+
+Using residue calculus, we shall compute,
+
+$$
+\zeta = \lim _ {\tilde {s} \to \tilde {\xi}} \frac {\tilde {s} - \tilde {\xi}}{\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) + \tilde {s} + \frac {\rho_ {T} (c _ {2} - c _ {1})}{1 - c _ {3}} - \frac {\rho_ {T} \beta_ {M} ^ {2}}{1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s})}}.
+$$
+
+The limit can be expressed using L'Hôpital's rule,
+
+$$
+\begin{array}{l} \zeta = \frac {1}{\frac {\mathrm {d}}{\mathrm {d} \tilde {s}} \left[ \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) + \tilde {s} + \frac {\rho_ {T} (c _ {2} - c _ {1})}{1 - c _ {3}} - \frac {\rho_ {T} \beta_ {M} ^ {2}}{1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s})} \right] _ {\tilde {s} = \tilde {\xi}}} \\ = \left[ \left(2 \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi}) + 1 + \tilde {\xi} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \frac {\rho_ {T} \beta_ {M} ^ {2} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}}{\left(1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi})\right) ^ {2}}\right) \tilde {m} ^ {\prime} (\tilde {\xi}) + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi}) + 1 \right] ^ {- 1} \\ \end{array}
+$$
+
+We already know that $\tilde{m} (\tilde{\xi}) = \frac{-1}{\frac{\rho_Tc_2}{1 - c_3} + \rho_T\beta_M^2}$ . Let us then differentiate equation 15,
+
+$$
+\begin{array}{l} \left(3 \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + 2 \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) + \tilde {s} + \frac {\rho_ {T} (c _ {2} - c _ {1})}{1 - c _ {3}}\right) \tilde {m} ^ {\prime} (\tilde {s}) \\ + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + \tilde {m} (\tilde {s}) = 0. \\ \end{array}
+$$
+
+Since $\left(\frac{\rho_Tc_2}{1 - c_3}\tilde{m}^2 (\tilde{s}) + \left(1 + \tilde{s}\frac{\rho_Tc_2}{1 - c_3}\right)\tilde{m} (\tilde{s}) + \tilde{s} +\frac{\rho_T(c_2 - c_1)}{1 - c_3}\right)\tilde{m} (\tilde{s}) + 1 = 0,$ we have,
+
+$$
+\begin{array}{l} \left(2 \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + \left(1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}\right) \tilde {m} (\tilde {s}) - \frac {1}{\tilde {m} (\tilde {s})}\right) \tilde {m} ^ {\prime} (\tilde {s}) + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} ^ {2} (\tilde {s}) + \tilde {m} (\tilde {s}) = 0 \\ \Longleftrightarrow \left(2 \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s}) + 1 + \tilde {s} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} - \frac {1}{\tilde {m} ^ {2} (\tilde {s})}\right) \tilde {m} ^ {\prime} (\tilde {s}) + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {s}) + 1 = 0. \\ \end{array}
+$$
+
+From this last equality, we see that
+
+$$
+\zeta = \left[ \left(\frac {1}{m ^ {2} (\tilde {\xi})} + \frac {\rho_ {T} \beta_ {M} ^ {2} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}}}{\left(1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi})\right) ^ {2}}\right) \tilde {m} ^ {\prime} (\tilde {\xi}) \right] ^ {- 1} = - \rho_ {T} \beta_ {M} ^ {2} \frac {\tilde {m} ^ {3} (\tilde {\xi})}{\tilde {m} ^ {\prime} (\tilde {\xi})}.
+$$
+
+Moreover,
+
+$$
+\begin{array}{l} \tilde {m} ^ {\prime} (\tilde {\xi}) = - \frac {1 + \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi})}{2 \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \tilde {m} (\tilde {\xi}) + 1 + \tilde {\xi} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} - \frac {1}{\tilde {m} ^ {2} (\tilde {\xi})}} \\ = \frac {- \frac {\rho_ {T} \beta_ {M} ^ {2}}{\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}}}{- 2 \frac {\frac {\rho_ {T} c _ {2}}{1 - c _ {3}}}{\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}} + 1 + \tilde {\xi} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} - \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {2}} \\ = \frac {\rho_ {T} \beta_ {M} ^ {2}}{\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} - \rho_ {T} \beta_ {M} ^ {2} - \tilde {\xi} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) + \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {3}} \\ \end{array}
+$$
+
+$$
+\tilde {m} ^ {\prime} (\tilde {\xi}) = \frac {\rho_ {T} \beta_ {M} ^ {2}}{- \rho_ {T} \beta_ {M} ^ {2} - \frac {1}{\rho_ {T} \beta_ {M} ^ {2}} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \left(\frac {\rho_ {T} c _ {1}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {2} + \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {3}}.
+$$
+
+Hence,
+
+$$
+\begin{array}{l} \zeta = \frac {- \rho_ {T} \beta_ {M} ^ {2} - \frac {1}{\rho_ {T} \beta_ {M} ^ {2}} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \left(\frac {\rho_ {T} c _ {1}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {2} + \left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {3}}{\left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {3}} \\ = 1 - \frac {\rho_ {T} \beta_ {M} ^ {2}}{\left(\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}\right) ^ {3}} - \frac {1}{\rho_ {T} \beta_ {M} ^ {2}} \frac {\rho_ {T} c _ {2}}{1 - c _ {3}} \frac {\frac {\rho_ {T} c _ {1}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}}{\frac {\rho_ {T} c _ {2}}{1 - c _ {3}} + \rho_ {T} \beta_ {M} ^ {2}} \\ \end{array}
+$$
+
+$$
+\zeta = 1 - \frac {1}{\beta_ {M} ^ {2} \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right)} \left[ \left(\frac {\beta_ {M} ^ {2}}{\rho_ {T} \left(\frac {c _ {2}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right)}\right) ^ {2} + \frac {c _ {2}}{1 - c _ {3}} \left(\frac {c _ {1}}{1 - c _ {3}} + \beta_ {M} ^ {2}\right) \right]. \tag {17}
+$$
+
+# D SKETCH OF PROOF OF THEOREM 5
+
+$\hat{\mathbf{y}}$ can be decomposed as $\alpha \bar{\mathbf{y}} + \beta \bar{\mathbf{y}}_{\perp}$ where $\bar{\mathbf{y}}_{\perp}$ is a unit norm vector orthogonal to $\bar{\mathbf{y}}$ and $\alpha^2 + \beta^2 = 1$ . From Theorem 2, we know that $\alpha^2 \to \zeta$ (and thus $\beta^2 \to 1 - \zeta$ ) almost surely as $n_1, n_2, n_3 \to +\infty$ .
+
+From the rotational invariance of the model, $\bar{y}_{\perp}$ is uniformly distributed on the unit sphere in the subspace orthogonal to $\bar{y}$ . Hence, any finite collection of its entries is asymptotically Gaussian (Diaconis & Freedman, 1987).
+
+# E PROOF OF THEOREM 6
+
+Let $\mathbf{Q}(s) = \left(\mathbf{T}^{(3)}\mathbf{T}^{(3)\top} - s\mathbf{I}_{n_3}\right)^{-1}$ defined for all $s\in \mathbb{C}\setminus \operatorname {sp}\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ .
+
+# E.1 PRELIMINARY RESULTS
+
+Let us derive a few useful results for the upcoming analysis.
+
+Lemma 2.
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {W} _ {c , d} ^ {(3)}} = - \frac {1}{\sqrt {n _ {T}}} \left(\mathbf {Q} _ {a, c} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {d, b} + \mathbf {Q} _ {c, b} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {d, a}\right).
+$$
+
+Proof. Since $\partial \mathbf{Q} = -\mathbf{Q}\partial \left(\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}\right)\mathbf{Q},$
+
+$$
+\begin{array}{l} \frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {W} _ {c , d} ^ {(3)}} = - \left[ \mathbf {Q} \frac {\partial \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top}}{\partial \mathbf {W} _ {c , d} ^ {(3)}} \mathbf {Q} \right] _ {a, b} \\ = - \sum_ {e, f, g = 1} ^ {n _ {3}, n _ {1} n _ {2}, n _ {3}} \mathrm {Q} _ {a, e} \left(\frac {\partial \mathrm {T} _ {e , f} ^ {(3)}}{\partial \mathrm {W} _ {c , d} ^ {(3)}} \mathrm {T} _ {g, f} ^ {(3)} + \mathrm {T} _ {e, f} ^ {(3)} \frac {\partial \mathrm {T} _ {g , f} ^ {(3)}}{\partial \mathrm {W} _ {c , d} ^ {(3)}}\right) \mathrm {Q} _ {g, b} \\ = - \frac {1}{\sqrt {n _ {T}}} \sum_ {e, f, g = 1} ^ {n _ {3}, n _ {1} n _ {2}, n _ {3}} \mathrm {Q} _ {a, e} \left(\delta_ {e, c} \delta_ {f, d} \mathrm {T} _ {g, f} ^ {(3)} + \mathrm {T} _ {e, f} ^ {(3)} \delta_ {g, c} \delta_ {f, d}\right) \mathrm {Q} _ {g, b} \\ \end{array}
+$$
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {W} _ {c , d} ^ {(3)}} = - \frac {1}{\sqrt {n _ {T}}} \left(\mathbf {Q} _ {a, c} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {d, b} + \mathbf {Q} _ {c, b} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {d, a}\right).
+$$
+
+
+
+Proposition 4.
+
+$$
+\mathbb {E} \left[ \mathbf {W} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] = \frac {n _ {1} n _ {2}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ (n _ {3} + 1) \mathbf {Q} + s (\mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q}) \right] \tag {18}
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \left(\mathbf {Q} + \frac {1}{n _ {T}} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right)\right) \right] = \beta_ {T} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} z z ^ {\top} \mathbf {Q} \right] \tag {19}
+$$
+
+Proof. We prove these two results with Stein's lemma (Lemma 1) and Lemma 2.
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathbf {W} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {i, j} = \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \mathbf {W} _ {i, k} ^ {(3)} \mathbf {T} _ {l, k} ^ {(3)} \mathbf {Q} _ {l, j} \right] \\ = \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \frac {\partial \mathrm {T} _ {l , k} ^ {(3)}}{\partial \mathrm {W} _ {i , k} ^ {(3)}} \mathrm {Q} _ {l, j} + \mathrm {T} _ {l, k} ^ {(3)} \frac {\partial \mathrm {Q} _ {l , j}}{\partial \mathrm {W} _ {i , k} ^ {(3)}} \right] \\ = \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \frac {\delta_ {l , i} \delta_ {k , k}}{\sqrt {n _ {T}}} \mathbf {Q} _ {l, j} \right] \\ - \frac {1}{\sqrt {n _ {T}}} \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \mathbf {T} _ {l, k} ^ {(3)} \left(\mathbf {Q} _ {l, i} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {k, j} + \mathbf {Q} _ {i, j} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {k, l}\right) \right] \\ = \frac {n _ {1} n _ {2}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ \mathbf {Q} \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} + \mathbf {Q} \operatorname {T r} \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {i, j} \\ = \frac {n _ {1} n _ {2}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ (n _ {3} + 1) \mathbf {Q} + s (\mathbf {Q} \operatorname {T r} \mathbf {Q} + \mathbf {Q} ^ {2}) \right] _ {i, j} \\ \end{array}
+$$
+
+where the last equality comes from $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}\mathbf{Q} = I_{n_3} + s\mathbf{Q}$
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {i, j} = \beta_ {T} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \boldsymbol {z} \boldsymbol {z} ^ {\top} \mathbf {Q} \right] _ {i, j} + \frac {1}{\sqrt {n _ {T}}} \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ z _ {i} m _ {k} \mathbf {W} _ {l, k} ^ {(3)} \mathbf {Q} _ {l, j} \right] \\ = \beta_ {T} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \boldsymbol {z} \boldsymbol {z} ^ {\top} \mathbf {Q} \right] _ {i, j} + \frac {1}{\sqrt {n _ {T}}} \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ z _ {i} m _ {k} \frac {\partial \mathbf {Q} _ {l , j}}{\partial \mathbf {W} _ {l , k} ^ {(3)}} \right] \\ = \beta_ {T} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \boldsymbol {z} \boldsymbol {z} ^ {\top} \mathbf {Q} \right] _ {i, j} \\ \left. - \frac {1}{n _ {T}} \sum_ {k, l = 1} ^ {n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ z _ {i} m _ {k} \left(\mathbf {Q} _ {l, l} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {k, j} + \mathbf {Q} _ {l, j} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {k, l}\right) \right] \right. \\ \end{array}
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {i, j} = \beta_ {T} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \boldsymbol {z} \boldsymbol {z} ^ {\top} \mathbf {Q} \right] _ {i, j} - \frac {1}{n _ {T}} \mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \left(\mathbf {Q T r} \mathbf {Q} + \mathbf {Q} ^ {2}\right) \right] _ {i, j}.
+$$
+
+
+
+# E.2 A FIRST MATRIX EQUIVALENT
+
+Since $\mathbf{Q}^{-1}\mathbf{Q} = \mathbf{I}_{n_3}$
+
+$$
+\beta_ {T} \pmb {z} \pmb {m} ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} + \frac {1}{\sqrt {n _ {T}}} \mathbf {W} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} - s \mathbf {Q} = \pmb {I} _ {n _ {3}}
+$$
+
+and, from equation 18, we have
+
+$$
+\beta_ {T} \mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] + \frac {n _ {1} n _ {2}}{n _ {T}} \mathbb {E} \left[ \mathbf {Q} \right] - \frac {1}{n _ {T}} \mathbb {E} \left[ (n _ {3} + 1) \mathbf {Q} + s \left(\mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q}\right) \right] - s \mathbb {E} \left[ \mathbf {Q} \right] = \boldsymbol {I} _ {n _ {3}}.
+$$
+
+Let us rearrange the terms
+
+$$
+s \frac {n _ {3}}{n _ {T}} \mathbb {E} \left[ \frac {\operatorname {T r} \mathbf {Q}}{n _ {3}} \mathbf {Q} \right] + \left(s + \frac {n _ {3} - n _ {1} n _ {2}}{n _ {T}}\right) \mathbb {E} [ \mathbf {Q} ] + I _ {n _ {3}} = \beta_ {T} \mathbb {E} \left[ z m ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] - \frac {1}{n _ {T}} \mathbb {E} [ \mathbf {Q} + s \mathbf {Q} ^ {2} ]
+$$
+
+in order to see that we need to following rescaling to counteract the divergence of the spectrum of $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}$ ,
+
+$$
+\tilde {s} = \frac {n _ {T} s - (n _ {3} + n _ {1} n _ {2})}{\sqrt {n _ {1} n _ {2} n _ {3}}}, \qquad \tilde {\mathbf {Q}} (\tilde {s}) = \left(\frac {n _ {T} \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top} - (n _ {3} + n _ {1} n _ {2}) \mathbf {I} _ {n _ {3}}}{\sqrt {n _ {1} n _ {2} n _ {3}}} - \tilde {s} \mathbf {I} _ {n _ {3}}\right) ^ {- 1}.
+$$
+
+Hence, our equation becomes,
+
+$$
+\begin{array}{l} \left(\frac {n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \tilde {s} + \frac {n _ {T}}{n _ {1} n _ {2}} + \frac {n _ {T}}{n _ {3}}\right) \frac {n _ {3}}{n _ {T}} \mathbb {E} \left[ \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {3}} \tilde {\mathbf {Q}} \right] + \left(\tilde {s} + \frac {2 n _ {3}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} \right] + \boldsymbol {I} _ {n _ {3}} \\ = \frac {\beta_ {T} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \tilde {\mathbf {Q}} \right] - \frac {1}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \tilde {\mathbf {Q}} + \left(\tilde {s} + \frac {n _ {3} + n _ {1} n _ {2}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \tilde {\mathbf {Q}} ^ {2} \right]. \tag {20} \\ \end{array}
+$$
+
+Moreover, equation 19 becomes,
+
+$$
+\mathbb {E} \left[ \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \left(\tilde {\mathbf {Q}} + \frac {1}{\sqrt {n _ {1} n _ {2} n _ {3}}} \left(\tilde {\mathbf {Q}} \operatorname {T r} \tilde {\mathbf {Q}} + \tilde {\mathbf {Q}} ^ {2}\right)\right) \right] = \beta_ {T} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \boldsymbol {z} \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}} \right]. \tag {21}
+$$
+
+Therefore, denoting $\tilde{m} (\tilde{s}) = \lim \frac{\mathrm{Tr}\mathbf{Q}(\tilde{s})}{n_3}$ the Stieltjes transform of the limiting spectral distribution of $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(3)}\mathbf{T}^{(3)\top} - \frac{n_3 + n_1n_2}{\sqrt{n_1n_2n_3}} I_{n_3}$ , the combination of equation 20 and equation 21 yield the following matrix equivalent,
+
+$$
+\tilde {m} (\tilde {s}) \tilde {\mathbf {Q}} + \tilde {s} \tilde {\mathbf {Q}} + \boldsymbol {I} _ {n _ {3}} \longleftrightarrow \frac {\beta_ {T} ^ {2} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} z z ^ {\top} \tilde {\mathbf {Q}}. \tag {22}
+$$
+
+At this point, we are still carrying the random term $\| \mathbf{M}\|_{\mathrm{F}}^{2}$ in the RHS. This quantity is expected to concentrate rapidly around its mean $\beta_{M}^{2} + \frac{n_{1}n_{2}}{n_{M}}$ . However, because $\mathbf{M}$ and $\tilde{\mathbf{Q}}$ are not independent, the RHS must be studied carefully.
+
+# E.3 ANALYSIS OF THE RHS
+
+Lemma 3.
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {Z} _ {c , d}} = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \left(\left[ \mathbf {Q} \boldsymbol {z} \right] _ {a} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ c, d ], b} + \left[ \mathbf {Q} \boldsymbol {z} \right] _ {b} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ c, d ], a}\right).
+$$
+
+Proof. Since $\partial \mathbf{Q} = -\mathbf{Q}\partial \left(\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}\right)\mathbf{Q}$
+
+$$
+\begin{array}{l} \frac {\partial \mathrm {Q} _ {a , b}}{\partial \mathrm {Z} _ {c , d}} = - \sum_ {e, f, g, h = 1} ^ {n _ {3}, n _ {1}, n _ {2}, n _ {3}} \mathrm {Q} _ {a, e} \left(\frac {\partial \bar {T} _ {f , g , e}}{\partial \mathrm {Z} _ {c , d}} \bar {T} _ {f, g, h} + \bar {T} _ {f, g, e} \frac {\partial \bar {T} _ {f , g , h}}{\partial \mathrm {Z} _ {c , d}}\right) \mathrm {Q} _ {h, b} \\ = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {e, h = 1} ^ {n _ {3}} \mathrm {Q} _ {a, e} \left(z _ {e} T _ {c, d, h} + T _ {c, d, e} z _ {h}\right) \mathrm {Q} _ {h, b} \\ \end{array}
+$$
+
+$$
+\frac {\partial \mathbf {Q} _ {a , b}}{\partial \mathbf {Z} _ {c , d}} = - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \left(\left[ \mathbf {Q} \boldsymbol {z} \right] _ {a} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ c, d ], b} + \left[ \mathbf {Q} \boldsymbol {z} \right] _ {b} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ c, d ], a}\right).
+$$
+
+
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \mathbf {Q} \right] = \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \left(\beta_ {M} x _ {u} y _ {v} + \frac {1}{\sqrt {n _ {M}}} Z _ {u, v}\right) ^ {2} \mathbf {Q} \right] \\ = \beta_ {M} ^ {2} \mathbb {E} \left[ \mathbf {Q} \right] + \frac {1}{\sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \left(\frac {\mathbf {Z} _ {u , v}}{\sqrt {n _ {M}}} + 2 \beta_ {M} x _ {u} y _ {v}\right) \mathbf {Z} _ {u, v} \mathbf {Q} \right] \\ \end{array}
+$$
+
+$$
+\mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \mathbf {Q} \right] = \left(\beta_ {M} ^ {2} + \frac {n _ {1} n _ {2}}{n _ {M}}\right) \mathbb {E} \left[ \mathbf {Q} \right] + \frac {1}{\sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \left(\frac {\mathbf {Z} _ {u , v}}{\sqrt {n _ {M}}} + 2 \beta_ {M} x _ {u} y _ {v}\right) \frac {\partial \mathbf {Q}}{\partial \mathbf {Z} _ {u , v}} \right]
+$$
+
+where we have used Stein's lemma (Lemma 1) to derive the last equality. Hence, using Lemma 3, it becomes
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left(\| \mathbf {M} \| _ {\mathrm {F}} ^ {2} - \left(\beta_ {M} ^ {2} + \frac {n _ {1} n _ {2}}{n _ {M}}\right)\right) \mathbf {Q} \right] _ {i, j} \\ = - \frac {\beta_ {T}}{n _ {M}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \left(\frac {\mathbf {Z} _ {u , v}}{\sqrt {n _ {M}}} + 2 \beta_ {M} x _ {u} y _ {v}\right) \left([ \mathbf {Q} \boldsymbol {z} ] _ {i} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], j} + [ \mathbf {Q} \boldsymbol {z} ] _ {j} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], i}\right) \right] \\ = - \frac {\beta_ {T}}{n _ {M}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \left(2 m _ {[ u, v ]} - \frac {\mathbf {Z} _ {u , v}}{\sqrt {n _ {M}}}\right) \left([ \mathbf {Q} \mathbf {z} ] _ {i} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], j} + [ \mathbf {Q} \mathbf {z} ] _ {j} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], i}\right) \right] \\ = - 2 \frac {\beta_ {T}}{n _ {M}} \mathbb {E} \left[ \mathbf {Q} z m ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} + \left(\mathbf {Q} z m ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q}\right) ^ {\top} \right] _ {i, j} \\ + \frac {\beta_ {T}}{n _ {M} \sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \mathbf {Z} _ {u, v} \left([ \mathbf {Q} \pmb {z} ] _ {i} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], j} + [ \mathbf {Q} \pmb {z} ] _ {j} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], i}\right) \right] \\ \end{array}
+$$
+
+and, since $\beta_T \mathbf{z} \mathbf{m}^\top = \mathbf{T}^{(3)} - \frac{1}{\sqrt{n_T}} \mathbf{W}^{(3)}$ and $\mathbf{T}^{(3)} \mathbf{T}^{(3)^\top} \mathbf{Q} = I_{n_3} + s \mathbf{Q}$ , we have,
+
+$$
+\beta_ {T} \boldsymbol {z} \boldsymbol {m} ^ {\top} \mathbf {T} ^ {(3) \top} \mathbf {Q} = I _ {n _ {3}} + s \mathbf {Q} - \frac {1}{\sqrt {n _ {T}}} \mathbf {W} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q}.
+$$
+
+Thus, our expression turns into
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left(\| \mathbf {M} \| _ {\mathrm {F}} ^ {2} - \left(\beta_ {M} ^ {2} + \frac {n _ {1} n _ {2}}{n _ {M}}\right)\right) \mathbf {Q} \right] _ {i, j} \\ = - \frac {4}{n _ {M}} \mathbb {E} \left[ \mathbf {Q} + s \mathbf {Q} ^ {2} \right] _ {i, j} + \frac {2}{n _ {M} \sqrt {n _ {T}}} \mathbb {E} \left[ \mathbf {Q} \left(\mathbf {W} ^ {(3)} \mathbf {T} ^ {(3) ^ {\top}} + \mathbf {T} ^ {(3)} \mathbf {W} ^ {(3) ^ {\top}}\right) \mathbf {Q} \right] _ {i, j} \\ + \frac {\beta_ {T}}{n _ {M} \sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \mathbf {Z} _ {u, v} \left(\left[ \mathbf {Q} \boldsymbol {z} \right] _ {i} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], j} + \left[ \mathbf {Q} \boldsymbol {z} \right] _ {j} \left[ \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {[ u, v ], i}\right) \right] \\ = - \frac {4}{n _ {M}} \mathbb {E} \left[ \mathbf {Q} + s \mathbf {Q} ^ {2} \right] _ {i, j} + \frac {2}{n _ {M} \sqrt {n _ {T}}} \left[ \boldsymbol {A} _ {1} + \boldsymbol {A} _ {1} ^ {\top} \right] _ {i, j} + \frac {\beta_ {T}}{n _ {M} \sqrt {n _ {M}}} \left[ \boldsymbol {A} _ {2} + \boldsymbol {A} _ {2} ^ {\top} \right] _ {i, j} \\ \end{array}
+$$
+
+with
+
+$$
+\boldsymbol {A} _ {1} = \mathbb {E} \left[ \mathbf {Q W} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right], \qquad [ \boldsymbol {A} _ {2} ] _ {i, j} = \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \mathbb {E} \left[ \mathbf {Z} _ {u, v} [ \mathbf {Q} \boldsymbol {z} ] _ {i} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {[ u, v ], j} \right].
+$$
+
+Let us develop $A_{1}$ with Stein's lemma (Lemma 1) on $\mathbf{W}^{(3)}$ .
+
+$$
+\begin{array}{l} [ \boldsymbol {A} _ {1} ] _ {i, j} = \sum_ {a, b, c = 1} ^ {n _ {3}, n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \frac {\partial \mathrm {Q} _ {i , a}}{\partial \mathrm {W} _ {a , b} ^ {(3)}} \mathrm {T} _ {c, b} ^ {(3)} \mathrm {Q} _ {c, j} + \mathrm {Q} _ {i, a} \frac {\partial \mathrm {T} _ {c , b} ^ {(3)}}{\partial \mathrm {W} _ {a , b} ^ {(3)}} \mathrm {Q} _ {c, j} + \mathrm {Q} _ {i, a} \mathrm {T} _ {c, b} ^ {(3)} \frac {\partial \mathrm {Q} _ {c , j}}{\partial \mathrm {W} _ {a , b} ^ {(3)}} \right] \\ = \frac {n _ {1} n _ {2}}{\sqrt {n _ {T}}} \mathbb {E} \left[ \mathbf {Q} ^ {2} \right] _ {i, j} \\ - \frac {1}{\sqrt {n _ {T}}} \sum_ {a, b, c = 1} ^ {n _ {3}, n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \left(\mathrm {Q} _ {i, a} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {b, a} + \mathrm {Q} _ {a, a} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {b, i}\right) \mathrm {T} _ {c, b} ^ {(3)} \mathrm {Q} _ {c, j} \right] \\ - \frac {1}{\sqrt {n _ {T}}} \sum_ {a, b, c = 1} ^ {n _ {3}, n _ {1} n _ {2}, n _ {3}} \mathbb {E} \left[ \mathbf {Q} _ {i, a} \mathbf {T} _ {c, b} ^ {(3)} \left(\mathbf {Q} _ {c, a} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {b, j} + \mathbf {Q} _ {a, j} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {b, c}\right) \right] \\ = \frac {n _ {1} n _ {2}}{\sqrt {n _ {T}}} \mathbb {E} \left[ \mathbf {Q} ^ {2} \right] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} \left[ \left(2 \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q}\right) \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} + \mathbf {Q} ^ {2} \operatorname {T r} \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) ^ {\top}} \mathbf {Q} \right] _ {i, j} \\ \end{array}
+$$
+
+$$
+[ \mathbf {A} _ {1} ] _ {i, j} = \frac {n _ {1} n _ {2}}{\sqrt {n _ {T}}} \mathbb {E} [ \mathbf {Q} ^ {2} ] _ {i, j} - \frac {1}{\sqrt {n _ {T}}} \mathbb {E} [ (n _ {3} + 2) \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q} + 2 s \mathbf {Q} (\mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q}) ] _ {i, j}
+$$
+
+since $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}\mathbf{Q} = \mathbf{I}_{n_3} + s\mathbf{Q}$
+
+Next, we develop $A_{2}$ with Stein's lemma (Lemma 1) on $\mathbf{Z}$ .
+
+$$
+\begin{array}{l} [ \mathbf {A} _ {2} ] _ {i, j} = \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \sum_ {a, b = 1} ^ {n _ {3}, n _ {3}} \mathbb {E} \left[ \frac {\partial \mathrm {Q} _ {i , a}}{\partial \mathrm {Z} _ {u , v}} z _ {a} \mathrm {T} _ {b, [ u, v ]} ^ {(3)} \mathrm {Q} _ {b, j} + \mathrm {Q} _ {i, a} z _ {a} \frac {\partial \mathrm {T} _ {b , [ u , v ]} ^ {(3)}}{\partial \mathrm {Z} _ {u , v}} \mathrm {Q} _ {b, j} + \mathrm {Q} _ {i, a} z _ {a} \mathrm {T} _ {b, [ u, v ]} ^ {(3)} \frac {\partial \mathrm {Q} _ {b , j}}{\partial \mathrm {Z} _ {u , v}} \right] \\ = \frac {\beta_ {T} n _ {1} n _ {2}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} z z ^ {\top} \mathbf {Q} \right] _ {i, j} \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \sum_ {a, b = 1} ^ {n _ {3}, n _ {3}} \mathbb {E} \left[ [ \mathbf {Q} z ] _ {i} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {[ u, v ], a} z _ {a} \mathrm {T} _ {b, [ u, v ]} ^ {(3)} \mathbf {Q} _ {b, j} \right] \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \sum_ {a, b = 1} ^ {n _ {3}, n _ {3}} \mathbb {E} \left[ [ \mathbf {Q} z ] _ {a} \left[ \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {[ u, v ], i} z _ {a} \mathrm {T} _ {b, [ u, v ]} ^ {(3)} \mathbf {Q} _ {b, j} \right] \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \sum_ {a, b = 1} ^ {n _ {3}, n _ {3}} \mathbb {E} \left[ \mathrm {Q} _ {i, a} z _ {a} \mathrm {T} _ {b, [ u, v ]} ^ {(3)} [ \mathrm {Q} z ] _ {b} \left[ \mathrm {T} ^ {(3) \top} \mathrm {Q} \right] _ {[ u, v ], j} \right] \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \sum_ {u, v = 1} ^ {n _ {1}, n _ {2}} \sum_ {a, b = 1} ^ {n _ {3}, n _ {3}} \mathbb {E} \left[ \mathrm {Q} _ {i, a} z _ {a} \mathrm {T} _ {b, [ u, v ]} ^ {(3)} [ \mathrm {Q} z ] _ {j} \left[ \mathrm {T} ^ {(3) ^ {\top}} \mathrm {Q} \right] _ {[ u, v ], b} \right] \\ = \frac {\beta_ {T} n _ {1} n _ {2}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} z z ^ {\top} \mathbf {Q} \right] _ {i, j} - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \left(\mathbf {Q} z z ^ {\top} \mathbf {Q} + \left[ z ^ {\top} \mathbf {Q} z \right] \mathbf {Q}\right) \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} \right] _ {i, j} \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbb {E} \left[ \mathbf {Q} z z ^ {\top} \left(\mathbf {Q T} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q} + \mathbf {Q T r} \mathbf {T} ^ {(3)} \mathbf {T} ^ {(3) \top} \mathbf {Q}\right) \right] _ {i, j} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} [ \mathbf {A} _ {2} ] _ {i, j} = \frac {\beta_ {T} n _ {1} n _ {2}}{\sqrt {n _ {M}}} \mathbb {E} [ \mathbf {Q} z z ^ {\top} \mathbf {Q} ] _ {i, j} - \frac {\beta_ {T}}{\sqrt {n _ {M}}} \mathbb {E} [ (n _ {3} + 2) \mathbf {Q} z z ^ {\top} \mathbf {Q} + [ z ^ {\top} \mathbf {Q} z ] \mathbf {Q} ] _ {i, j} \\ - \frac {\beta_ {T}}{\sqrt {n _ {M}}} s \mathbb {E} \left[ \mathbf {Q} z z ^ {\top} \left(\mathbf {Q} \operatorname {T r} \mathbf {Q} + 2 \mathbf {Q} ^ {2}\right) + \left[ z ^ {\top} \mathbf {Q} z \right] \mathbf {Q} ^ {2} \right] _ {i, j} \\ \end{array}
+$$
+
+since, again, $\mathbf{T}^{(3)}\mathbf{T}^{(3)\top}\mathbf{Q} = I_{n_3} + s\mathbf{Q}$
+
+Eventually, we have,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \mathbf {Q} \right] = \left(\beta_ {M} ^ {2} + \frac {n _ {1} n _ {2}}{n _ {M}}\right) \mathbb {E} \left[ \mathbf {Q} \right] - \frac {4}{n _ {M}} \mathbb {E} \left[ \mathbf {Q} + s \mathbf {Q} ^ {2} \right] \\ + \frac {4 n _ {1} n _ {2}}{n _ {M} n _ {T}} \mathbb {E} \left[ \mathbf {Q} ^ {2} \right] - \frac {4}{n _ {M} n _ {T}} \mathbb {E} \left[ (n _ {3} + 2) \mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q} + 2 s \mathbf {Q} \left(\mathbf {Q} ^ {2} + \mathbf {Q} \operatorname {T r} \mathbf {Q}\right) \right] \\ + \frac {2 \beta_ {T} ^ {2} n _ {1} n _ {2}}{n _ {M} ^ {2}} \mathbb {E} [ \mathbf {Q} z z ^ {\top} \mathbf {Q} ] - \frac {2 \beta_ {T} ^ {2}}{n _ {M} ^ {2}} \mathbb {E} [ (n _ {3} + 2) \mathbf {Q} z z ^ {\top} \mathbf {Q} + [ z ^ {\top} \mathbf {Q} z ] \mathbf {Q} ] \\ - \frac {2 \beta_ {T} ^ {2}}{n _ {M} ^ {2}} s \mathbb {E} \left[ \mathbf {Q} z z ^ {\top} \mathbf {Q} \operatorname {T r} \mathbf {Q} + \left[ z ^ {\top} \mathbf {Q} z \right] \mathbf {Q} ^ {2} \right] - \frac {2 \beta_ {T} ^ {2}}{n _ {M} ^ {2}} s \mathbb {E} \left[ \mathbf {Q} z z ^ {\top} \mathbf {Q} ^ {2} + \mathbf {Q} ^ {2} z z ^ {\top} \mathbf {Q} \right] \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \mathbf {Q} \right] = \left(\frac {n _ {1} n _ {2}}{n _ {M}} + \beta_ {M} ^ {2} - \frac {4}{n _ {M}}\right) \mathbb {E} \left[ \mathbf {Q} \right] - \frac {4}{n _ {M}} \left(s + \frac {n _ {3} - n _ {1} n _ {2}}{n _ {T}} + \frac {2}{n _ {T}}\right) \mathbb {E} \left[ \mathbf {Q} ^ {2} \right] \\ - \frac {4 n _ {3}}{n _ {M} n _ {T}} \mathbb {E} \left[ \mathbf {Q} \frac {\operatorname {T r} \mathbf {Q}}{n _ {3}} \right] - \frac {8}{n _ {M} n _ {T}} s \mathbb {E} \left[ \mathbf {Q} ^ {3} \right] - \frac {8 n _ {3}}{n _ {M} n _ {T}} s \mathbb {E} \left[ \mathbf {Q} ^ {2} \frac {\operatorname {T r} \mathbf {Q}}{n _ {3}} \right] \\ - \frac {2 \beta_ {T} ^ {2}}{n _ {M} ^ {2}} \mathbb {E} \left[ (n _ {3} - n _ {1} n _ {2} + 2) \mathbf {Q} z z ^ {\top} \mathbf {Q} + \left[ z ^ {\top} \mathbf {Q} z \right] \mathbf {Q} \right] \\ - \frac {2 \beta_ {T} ^ {2}}{n _ {M} ^ {2}} s \mathbb {E} \left[ n _ {3} \mathbf {Q} z z ^ {\top} \mathbf {Q} \frac {\operatorname {T r} \mathbf {Q}}{n _ {3}} + \left[ z ^ {\top} \mathbf {Q} z \right] \mathbf {Q} ^ {2} + \mathbf {Q} z z ^ {\top} \mathbf {Q} ^ {2} + \mathbf {Q} ^ {2} z z ^ {\top} \mathbf {Q} \right]. \\ \end{array}
+$$
+
+After rescaling, this becomes,
+
+$$
+\begin{array}{l} \frac {n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \| \mathbf {M} \| _ {\mathrm {F}} ^ {2} \tilde {\mathbf {Q}} \right] \\ = \left(\frac {n _ {1} n _ {2}}{n _ {M}} + \beta_ {M} ^ {2} - \frac {4}{n _ {M}}\right) \frac {n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \tilde {\mathbf {Q}} \right] - \frac {4}{n _ {M}} \left(\tilde {s} + \frac {2 (n _ {3} + 1)}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \frac {n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \mathbb {E} \left[ \tilde {\mathbf {Q}} ^ {2} \right] \\ - \frac {4 n _ {T}}{n _ {M} n _ {1} n _ {2}} \mathbb {E} \left[ \tilde {\mathbf {Q}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {3}} \right] - \frac {8 n _ {T}}{n _ {M} n _ {1} n _ {2}} \left(\tilde {s} + \frac {n _ {3} + n _ {1} n _ {2}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \mathbb {E} \left[ \frac {1}{n _ {3}} \tilde {\mathbf {Q}} ^ {3} + \tilde {\mathbf {Q}} ^ {2} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {3}} \right] \\ - \frac {2 \beta_ {T} ^ {2} n _ {T} ^ {2}}{n _ {M} ^ {2} n _ {1} n _ {2} n _ {3}} \mathbb {E} \left[ (n _ {3} - n _ {1} n _ {2} + 2) \tilde {\mathbf {Q}} z z ^ {\top} \tilde {\mathbf {Q}} + \left[ z ^ {\top} \tilde {\mathbf {Q}} z \right] \tilde {\mathbf {Q}} \right] \\ - \frac {2 \beta_ {T} ^ {2} n _ {T} ^ {2}}{n _ {M} ^ {2} n _ {1} n _ {2} n _ {3}} \left(\tilde {s} + \frac {n _ {3} + n _ {1} n _ {2}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \mathbb {E} \left[ n _ {3} \tilde {\mathbf {Q}} \boldsymbol {z} \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}} \frac {\mathrm {T r} \tilde {\mathbf {Q}}}{n _ {3}} \right] \\ - \frac {2 \beta_ {T} ^ {2} n _ {T} ^ {2}}{n _ {M} ^ {2} n _ {1} n _ {2} n _ {3}} \left(\tilde {s} + \frac {n _ {3} + n _ {1} n _ {2}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \mathbb {E} \left[ \left[ \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}} \boldsymbol {z} \right] \tilde {\mathbf {Q}} ^ {2} + \tilde {\mathbf {Q}} \boldsymbol {z} \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}} ^ {2} + \tilde {\mathbf {Q}} ^ {2} \boldsymbol {z} \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}} \right] \\ = \Theta \left(\sqrt {n _ {T}} + \frac {\beta_ {M} ^ {2}}{\sqrt {n _ {T}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} \right] - \Theta \left(\frac {1}{n _ {T} \sqrt {n _ {T}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} ^ {2} \right] \\ - \Theta \left(\frac {1}{n _ {T} ^ {2}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {3}} \right] - \Theta \left(\frac {1}{n _ {T} ^ {2} \sqrt {n _ {T}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} ^ {3} \right] - \Theta \left(\frac {1}{n _ {T} \sqrt {n _ {T}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} ^ {2} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {3}} \right] \\ - \Theta \left(\frac {\beta_ {T} ^ {2}}{n _ {T}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} z z ^ {\top} \tilde {\mathbf {Q}} \right] - \Theta \left(\frac {\beta_ {T} ^ {2}}{n _ {T} ^ {3}}\right) \mathbb {E} \left[ \left[ z ^ {\top} \tilde {\mathbf {Q}} z \right] \tilde {\mathbf {Q}} \right] \\ - \Theta \left(\frac {\beta_ {T} ^ {2}}{n _ {T} \sqrt {n _ {T}}}\right) \mathbb {E} \left[ \tilde {\mathbf {Q}} z z ^ {\top} \tilde {\mathbf {Q}} \frac {\operatorname {T r} \tilde {\mathbf {Q}}}{n _ {3}} \right] \\ - \Theta \left(\frac {\beta_ {T} ^ {2}}{n _ {T} ^ {2} \sqrt {n _ {T}}}\right) \mathbb {E} \left[ \left[ z ^ {\top} \tilde {\mathbf {Q}} z \right] \tilde {\mathbf {Q}} ^ {2} + \tilde {\mathbf {Q}} z z ^ {\top} \tilde {\mathbf {Q}} ^ {2} + \tilde {\mathbf {Q}} ^ {2} z z ^ {\top} \tilde {\mathbf {Q}} \right]. \\ \end{array}
+$$
+
+Hence, as long as $\beta_{T} = o(n_{T}^{3 / 4})$ , we have
+
+$$
+\frac {\beta_ {T} ^ {2} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}} \left\| \mathbf {M} \right\| _ {\mathrm {F}} ^ {2} \tilde {\mathbf {Q}} \longleftrightarrow \beta_ {T} ^ {2} \left(\frac {n _ {T}}{n _ {M}} \sqrt {\frac {n _ {1} n _ {2}}{n _ {3}}} + \frac {\beta_ {M} ^ {2} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \tilde {\mathbf {Q}}.
+$$
+
+# E.4 DETERMINISTIC EQUIVALENT
+
+Coming back to equation 22, we are now allowed to write,
+
+$$
+\tilde {m} (\tilde {s}) \tilde {\mathbf {Q}} + \tilde {s} \tilde {\mathbf {Q}} + \boldsymbol {I} _ {n _ {3}} \longleftrightarrow \beta_ {T} ^ {2} \left(\frac {n _ {T}}{n _ {M}} \sqrt {\frac {n _ {1} n _ {2}}{n _ {3}}} + \frac {\beta_ {M} ^ {2} n _ {T}}{\sqrt {n _ {1} n _ {2} n _ {3}}}\right) \boldsymbol {z} \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}}.
+$$
+
+Hence, in order to prevent the RHS from either vanishing or exploding, we see that $\beta_{T}$ must be $\Theta (n_T^{-1 / 4})$ . In this case, Let $\varrho = \lim \beta_T^2\left(\frac{n_T}{n_M}\sqrt{\frac{n_1n_2}{n_3}} +\frac{\beta_M^2n_T}{\sqrt{n_1n_2n_3}}\right)$ .
+
+Then, we can define $\bar{\mathbf{Q}}$ , the deterministic equivalent of $\tilde{\mathbf{Q}}$ such that,
+
+$$
+\tilde {m} (\tilde {s}) \bar {\mathbf {Q}} + \tilde {s} \bar {\mathbf {Q}} + \boldsymbol {I} _ {n _ {3}} = \varrho \boldsymbol {z} \boldsymbol {z} ^ {\top} \bar {\mathbf {Q}}. \tag {23}
+$$
+
+Remark. In fact, with the assumption $\beta_{M} = \Theta(1)$ , $\beta_{T}^{2}\left(\frac{n_{T}}{n_{M}}\sqrt{\frac{n_{1}n_{2}}{n_{3}}} + \frac{\beta_{M}^{2}n_{T}}{\sqrt{n_{1}n_{2}n_{3}}}\right) \sim \beta_{T}^{2}\frac{n_{T}}{n_{M}}\sqrt{\frac{n_{1}n_{2}}{n_{3}}}$ so we could have kept only this dominant term. However, for finite horizon considerations (as it is the case in practice), adding the $\Theta\left(\frac{\beta_{M}^{2}}{\sqrt{n_{T}}}\right)$ term leads to slightly more precise predictions. Indeed, with the dominant term only, we consider a "worst-case scenario" $\beta_{M} = 0$ .
+
+# E.5 LIMITING SPECTRAL DISTRIBUTION
+
+According to the previous deterministic equivalent, the Stieltjes transform of the limiting spectral distribution of $\frac{n_T}{\sqrt{n_1n_2n_3}}\mathbf{T}^{(3)}\mathbf{T}^{(3)\top} - \frac{n_3 + n_1n_2}{\sqrt{n_1n_2n_3}}\mathbf{I}_{n_3}$ is solution to
+
+$$
+\tilde {m} ^ {2} (\tilde {s}) + \tilde {s} \tilde {m} (\tilde {s}) + 1 = 0, \tag {24}
+$$
+
+i.e., it is the standard semi-circle law.
+
+# F PROOF OF THEOREM 7
+
+# F.1 ISOLATED EIGENVALUE
+
+The asymptotic position $\tilde{\xi}$ of the isolated eigenvalue (when it exists) is a singular point of $\bar{\mathbf{Q}}$ . From equation 23, it is therefore solution to
+
+$$
+\tilde {m} (\tilde {\xi}) + \tilde {\xi} = \varrho .
+$$
+
+Following equation 24, $\tilde{\xi} = -\tilde{m} (\tilde{\xi}) - \frac{1}{\tilde{m}(\tilde{\xi})}$ , thus, $\tilde{m} (\tilde{\xi}) = -\frac{1}{\varrho}$ . Injecting this in equation 24 yields
+
+$$
+\tilde {\xi} = \varrho + \frac {1}{\varrho}. \tag {25}
+$$
+
+# F.2 EIGENVECTOR ALIGNMENT
+
+Following Cauchy's integral formula,
+
+$$
+\left| \boldsymbol {z} ^ {\top} \hat {\mathbf {z}} \right| ^ {2} = - \frac {1}{2 i \pi} \oint_ {\tilde {\gamma}} \boldsymbol {z} ^ {\top} \tilde {\mathbf {Q}} (\tilde {s}) \boldsymbol {z} \mathrm {d} \tilde {s}
+$$
+
+where $\tilde{\gamma}$ is a positively-oriented complex contour circling around the isolated eigenvalue only. Hence, using the previously found deterministic equivalent $\mathbf{Q}$ , we can compute the asymptotic value $\zeta$ of $\left|\boldsymbol{z}^{\top}\hat{\boldsymbol{z}}\right|^{2}$ ,
+
+$$
+\zeta = - \frac {1}{2 i \pi} \oint_ {\tilde {\gamma}} \boldsymbol {z} ^ {\top} \bar {\mathbf {Q}} (\tilde {s}) \boldsymbol {z} \mathrm {d} \tilde {s}.
+$$
+
+This reduces to residue calculus,
+
+$$
+\zeta = \lim _ {\tilde {s} \to \tilde {\xi}} \left(\tilde {s} - \tilde {\xi}\right) [ \tilde {m} (\tilde {s}) + \tilde {s} - \varrho ] ^ {- 1} = \frac {1}{\frac {\mathrm {d}}{\mathrm {d} \tilde {s}} [ \tilde {m} (\tilde {s}) + \tilde {s} - \varrho ] _ {\tilde {s} = \tilde {\xi}}} = \frac {1}{\tilde {m} ^ {\prime} (\tilde {\xi}) + 1}.
+$$
+
+Differentiating equation 24, we have,
+
+$$
+\begin{array}{l} 2 \tilde {m} ^ {\prime} (\tilde {\xi}) m (\tilde {\xi}) + \tilde {m} (\tilde {\xi}) + \tilde {\xi} \tilde {m} ^ {\prime} (\tilde {\xi}) = 0 \iff \tilde {m} ^ {\prime} (\tilde {\xi}) = - \frac {\tilde {m} (\tilde {\xi})}{2 m (\tilde {\xi}) + \tilde {\xi}} \\ \iff \tilde {m} ^ {\prime} (\tilde {\xi}) = \frac {1}{\varrho \tilde {\xi} - 2} \\ \Longleftrightarrow \tilde {m} ^ {\prime} (\tilde {\xi}) = \frac {1}{\varrho^ {2} - 1}. \\ \end{array}
+$$
+
+Hence, we conclude,
+
+$$
+\zeta = 1 - \frac {1}{\varrho^ {2}}. \tag {26}
+$$
\ No newline at end of file
diff --git a/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/images.zip b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..89a188b96b223f7d373e802f047a2a191da763ff
--- /dev/null
+++ b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98cbdb09128040c96d42ae127bad953aac41a7e8025259576ff0775d0edbb6dd
+size 2082188
diff --git a/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/layout.json b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9afa72d5846590b2c7158a369370cf883c39ed0f
--- /dev/null
+++ b/performancegapsinmultiviewclusteringunderthenestedmatrixtensormodel/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:30407da87bcd03bd7526e40ababb403ded850d6822163139b3c1f2bf7c00c037
+size 1128021
diff --git a/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_content_list.json b/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..5d8022906ba5386b6915549c5a2bae46dd766bbc
--- /dev/null
+++ b/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8b09e0d5eac743b4b4b7f7cff802b0c1e43ec6b497dd04554f54e0834a739e3a
+size 82592
diff --git a/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_model.json b/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..32fa3af00978be993cb58d768fc03b0cca5a20c9
--- /dev/null
+++ b/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44eca43f019a5bf713b1baaba5bce6488e150667f0e8a40875267a7e30c39679
+size 98052
diff --git a/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_origin.pdf b/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f983aa8e8ed3e1810ae03a7b34f8cfa3b59e9b4f
--- /dev/null
+++ b/periodicitydecouplingframeworkforlongtermseriesforecasting/80e6d75d-f88d-43ca-bd51-77b69803d439_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:21b2fb30a97c2b4963816fc1591cad32634160a9e3c7706ee392e50634dc547d
+size 1302305
diff --git a/periodicitydecouplingframeworkforlongtermseriesforecasting/full.md b/periodicitydecouplingframeworkforlongtermseriesforecasting/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b02b48b8e39c756159af1860451edb488a639f72
--- /dev/null
+++ b/periodicitydecouplingframeworkforlongtermseriesforecasting/full.md
@@ -0,0 +1,255 @@
+# PERIODICITY DECOUPLING FRAMEWORK FOR LONG-TERM SERIES FORECASTING
+
+Tao Dai $^{1,2,4}$ , Beiliang Wu $^{1}$ , Peiyuan Liu $^{1,3,*}$ , Naiqi Li $^{3,*}$ , Jigang Bao $^{3}$ , Yong Jiang $^{3}$ , Shu-Tao Xia $^{3}$
+
+1College of Computer Science and Software Engineering, Shenzhen University, China
+$^{2}$ National Engineering Laboratory for Big Data System Computing Technology, Shenzhen University, China
+$^{3}$ Tsinghua Shenzhen International Graduate School, Tsinghua University, Shenzhen, China
+4WeBank Institute of Financial Technology, Shenzhen University, China {daitao.edu, peiyuanliu.edu, linaiqi.thu}@gmail.com; {jiangy, xiast} @sz.tsinghua.edu.cn
+
+# ABSTRACT
+
+Convolutional neural network (CNN)-based and Transformer-based methods have recently made significant strides in time series forecasting, which excel at modeling local temporal variations or capturing long-term dependencies. However, real-world time series usually contain intricate temporal patterns, thus making it challenging for existing methods that mainly focus on temporal variations modeling from the 1D time series directly. Based on the intrinsic periodicity of time series, we propose a novel Periodicity Decoupling Framework (PDF) to capture 2D temporal variations of decoupled series for long-term series forecasting. Our PDF mainly consists of three components: multi-periodic decoupling block (MDB), dual variations modeling block (DVMB), and variations aggregation block (VAB). Unlike the previous methods that model 1D temporal variations, our PDF mainly models 2D temporal variations, decoupled from 1D time series by MDB. After that, DVMB attempts to further capture short-term and long-term variations, followed by VAB to make final predictions. Extensive experimental results across seven real-world long-term time series datasets demonstrate the superiority of our method over other state-of-the-art methods, in terms of both forecasting performance and computational efficiency. Code is available at https://github.com/Hank0626/PDF.
+
+# 1 INTRODUCTION
+
+Time series forecasting plays an essential role in multiple applications, including weather prediction (Angryk et al., 2020), energy management (Zhou et al., 2021), financial investment (Patton, 2013), and traffic flow estimation (Chen et al., 2001). Recently, with the rapid development of deep learning, plenty of deep learning (DL)-based methods have been developed for time series forecasting (Lim & Zohren, 2021), which can be roughly divided into CNN-based (Wang et al., 2022; Liu et al., 2022a) and Transformer-based methods (Li et al., 2019; Zhou et al., 2021).
+
+Existing DL-based methods mainly focus on 1D temporal variation modeling directly, which plays a crucial role in time series forecasting. Among them, CNN-based methods (Bai et al., 2018; Wang et al., 2022; Wu et al., 2023) have shown the powerful ability to capture short-term variations. For example, TCN (Bai et al., 2018) incorporates the local information of time series along the temporal dimensions by utilizing convolution operations, and exhibits superior performance in short-term and medium-term predictions. However, this type of method usually fails to work well for long-term time series, due to the limited representation of long-term dependencies. By contrast, Transformer-based methods (Li et al., 2019; Zhou et al., 2021; Wu et al., 2021) excel at capturing long-term dependencies due to the use of self-attention mechanism. For example, Autoformer (Wu et al., 2021) attempts to exploit the series-wise temporal dependencies with auto-correlation mechanism. PatchTST (Nie et al., 2023) proposes a novel patching strategy to retain local semantic information within each patch. Although the Transformer-based methods have shown more competitive perfor
+
+
+(a)
+
+
+(b)
+Figure 1: (a) Illustration of periodicity-based decoupling into short- and long-term series. (b) Comparison of MSE and patch number of our PDF over other Transformer-based methods to predict future 96 time steps on Traffic dataset. Tranformer-based methods obtain worse MSE results with more patch numbers. By contrast, our PDF achieves the lowest MSE with only 24 patches on the look-back window of 960 length. The radius of the circle is the number of patches.
+
+mance than CNN-based methods, they often suffer from heavy computational costs, especially for long-term time series input, which thus limits their real applications.
+
+It is worth considering that the modeling of 1D temporal variations can be a complex task due to the intricate patterns involved. These variations can come in various types, including short-term fluctuations, falling, and rising, which can often overlap with each other (see Figure 1a). Despite the challenges, researchers have made significant progress in this area, and the most effective way to model temporal variation remains an open question. However, it is important to note that real-world time series often exhibit multi-periodicity, such as daily and weekly variations for traffic forecasting, which has been confirmed in recent work (Wu et al., 2023). Furthermore, long-term time series can be simplified or decoupled based on a predetermined period. For example, as shown in Figure 1a, the original time series can be decoupled into short-term series and long-term series, which contain short-term changes and long-term dependencies, respectively. By taking these observations into account, we can utilize period information to decouple long-term time series.
+
+Motivated by the above observations, we propose a novel Periodicity Decoupling Framework (PDF) for long-term series forecasting by capturing the intricate periodic information inside the time series. Based on the periodicity of the time series, the original 1D time series can be further decoupled into simpler short and long-term series, which respectively represent the local changes and global correlations of the 1D time series. Due to the diversity of short-term variations (e.g., fluctuation, rising, and falling), we employ "frequency slicing", corresponding to different periods, to divide the look-back window into several sub-sequences. For long-term variations, we utilize "period patching" to extract changes within corresponding time segments across all periods (see Figure 1a). The "period patching" ensures each patch contains rich long-term semantic information.
+
+Technically, we propose a novel Periodicity Decoupling Framework (PDF) for long-term time series forecasting. As illustrated in Fig. 2, our PDF contains three main components: multi-periodic decoupling block (MDB), dual variations modeling block (DVMB), and variations aggregation block (VAB). Unlike the previous methods that focus on 1D temporal variations modeling, our PDF models 2D temporal variations. Specifically, the multi-periodic decoupling block first decouples the 1D time series into different short- and long-term 1D series based on the period of input series in the frequency domain, followed by further reshaping into 2D tensors with rich short- and long-term variations. After that, the dual variations modeling block attempts to capture short-term and long-term variations from the decoupled 2D tensors, followed by a variations aggregation block to make final predictions. Extension experiments on our PDF confirm its state-of-the-art performance across various long-term time series datasets, in terms of both forecasting performance and computational efficiency. Notably, as seen in Figure 1b, our PDF handles the long-term series (with a look-back window length of 960) better while not sacrificing computational cost (with only 24 patches) than other Tranformer-based methods.
+
+Our main contributions are summarized as follows:
+
+- We propose a novel Periodicity Decoupling Framework (PDF) for long-term series forecasting, which fully captures 2D temporal short-term and long-term variations from the decoupled series in a parallel architecture.
+- We propose multi-periodic decoupling block to capture various periods of the input series in the frequency domain. Based on the periodicity of the time series, the 1D time series can be decoupled into simpler short- and long-term series formulated with 2D tensors. To fully capture the short- and long-term variations, we propose dual variations modeling block (DVMB) with short- and long-term variations extractor, which is able to preserve the high-frequency information of short-term changes while exploiting long-term dependencies.
+- Extensive experiments demonstrate the effectiveness of our PDF over other state-of-the-art methods across various long-term time series datasets, in terms of both forecasting performance and computational efficiency.
+
+# 2 RELATED WORK
+
+Traditional time series forecasting methods such as ARIMA (Anderson & Kendall, 1976) and Holt-Winter (Hyndman & Athanasopoulos, 2018) offer robust theoretical frameworks but suffer from limitations in handling data with intricate temporal dynamics. Recent years have witnessed milestone achievements of deep learning-based approaches in time series forecasting, which mainly include CNN-based (Wu et al., 2023), and Transformer-based methods (Lim & Zohren, 2021).
+
+Convolutional neural network (CNN) has gained widespread popularity due to its ability to capture localized features (Xia et al., 2017; Zhang et al., 2021; Woo et al., 2023). Many CNN-based time series forecasting methods employ Temporal Convolutional Networks (TCN) to extract local temporal dynamics (Bai et al., 2018; Liu et al., 2022a; Wang et al., 2022), where MICN (Wang et al., 2022) and TimesNet (Wu et al., 2023) are related to our method. Typically, MICN attempts to combine local features and global correlations to capture the overall view of time series with convolution kernels. TimesNet focuses on modeling 2D temporal variations in 2D spaces from the extraction of "intra-period" and "inter-period" variations. However, these methods rely heavily on convolution kernels to model series variations, resulting in limited representations of long-term dependencies. Instead, our method can capture both short- and long-term variations simultaneously with dual variations modeling block.
+
+Another type of Transformer-based method has shown more competitive performance in long-term time series forecasting. With the self-attention mechanism, Transformer and its variant are capable of capturing long-term dependencies and extracting global information (Dosovitskiy et al., 2021; Fan et al., 2021; Ryoo et al., 2021; Liu et al., 2022b). However, their scalability and efficiency are constrained by the quadratic complexity of the attention mechanism. To mitigate this, various techniques are proposed to reduce the complexity of the Transformer. For example, LogTrans (Li et al., 2019) utilizes convolution self-attention to reduce the space complexity. Informer (Zhou et al., 2021) applies distilling strategies to exploit the most crucial keys. Pyraformer (Liu et al., 2021) proposes a pyramid attention design with inter-scale and intra-scale connections. More recent work PatchTST (Nie et al., 2023) employs patch-based strategies to enhance the locality while improving long-term forecasting accuracy. However, existing Transformer-based methods still focus on 1D temporal variation modeling and suffer from heavy computational burden for long-term time series. Instead, we propose a more efficient Periodicity Decoupling Framework (PDF) for long-term series forecasting by fully capturing 2D temporal short-term and long-term variations in a parallel architecture.
+
+# 3 PERIODICITY DECOUPLING FRAMEWORK
+
+# 3.1 THE OVERALL ARCHITECTURE
+
+In time series forecasting, given a historical input series $\mathbf{X}_I = [\mathbf{x}_1,\mathbf{x}_2,\dots ,\mathbf{x}_t]^T\in \mathbb{R}^{t\times d}$ , it aims to predict future output series $\mathbf{X}_O = [\mathbf{x}_{t + 1},\mathbf{x}_{t + 2},\ldots ,\mathbf{x}_{t + T}]^T\in \mathbb{R}^{T\times d}$ , where $t,T$ is the number of time steps in the past and future, respectively, where $d > 1$ is the number of dimensions. The overall architecture of our method is shown in Figure 2. In our PDF, due to the complex temporal
+
+patterns, it is the first step to decouple the 1D time series for better variation modeling. To this end, we design a Multi-periodic Decoupling Block to learn the periods of input series in the frequency domain and convert the 1D time series into short- and long-term series, followed by reshaping into 2D tensors. Then, the obtained short-term and long-term 2D tensors are fed into several Dual Variations Modeling Blocks (DVMB) to model short- and long-term variations in a parallel way. Finally, we use a Variations Aggregation Block to merge the outputs from all DVMBs to yield the final prediction $\mathbf{X}_O$ . More details about our PDF are shown in the following sections.
+
+
+Figure 2: The architecture of our Periodicity Decoupling Framework, which mainly consists of multi-periodic decoupling block, dual variations modeling block, and variations aggregation block.
+
+# 3.2 MULTI-PERIODIC DECOUPLING BLOCK
+
+The Multi-periodic Decoupling block uses Periodicity Extractor and Period-based Reshaper to transform 1D time series into 2D spaces. Then it utilizes Temporal Variations Decoupler to decouple the long-term and short-term information through "period patching" and "frequency slicing".
+
+Periodicity Extractor. Previous work (Wu et al., 2023) emphasizes that the original 1D structure of time series inadequately represents only adjacent time point variations, and a 2D structure can effectively capture variations both within and between periods. Therefore, for a given 1D input $\mathbf{X}_I\in \mathbb{R}^{t\times d}$ of dimension $d$ , we employ the Fast Fourier Transform (FFT) (Chatfield, 1981) to analyze the time series in the frequency domain as follows:
+
+$$
+\mathbf {A} = \operatorname {A v g} (\operatorname {A m p} (\operatorname {F F T} (\mathbf {X} _ {I}))) \tag {1}
+$$
+
+Here, FFT and Amp denote the FFT and amplitude extraction, respectively. The channel-wise average operation Avg over $d$ channels yields $\mathbf{A} \in \mathbb{R}^t$ , representing the amplitudes of $t$ frequencies. Specifically, the $j$ -th value $\mathbf{A}_j$ represents the intensity of the periodic basis function for frequency $f$ . We use the univariate $X_I \in \mathbb{R}^t$ instead of $\mathbf{X}_I$ to denote the input time series in the following calculation, because the subsequent transformations and predictions are made in a channel-independent manner (Zheng et al., 2014; Nie et al., 2023).
+
+Different from Wu et al. (2023), we select frequencies not only focus on high amplitude but also incorporate those with significant values and amplitude. We assert that frequencies with high amplitude better represent the primary components, while those with larger values facilitate a more discernible distinction between long-term and short-term relationships. We summarize the $k$ frequencies selection by:
+
+$$
+\begin{array}{l} \mathbf {F} _ {u} = \arg \operatorname {t o p} - m (\mathbf {A}), \mathbf {F} _ {k _ {1}} = \arg \operatorname {t o p} - k _ {1} (\mathbf {A}), \left\{f _ {1}, \dots , f _ {k} \right\} = \mathbf {F} _ {k _ {1}} \cup \operatorname {t o p} - k _ {2} \left(\mathbf {F} _ {u} \setminus \mathbf {F} _ {k _ {1}}\right) \tag {2} \\ f _ {*} \in \{1, \dots , [ \frac {t}{2} ] \} \qquad f _ {*} \in \{1, \dots , [ \frac {t}{2} ] \} \\ \end{array}
+$$
+
+
+Figure 3: Multi-periodic Decoupling Block.
+
+where $\mathbf{F}_u$ and $\mathbf{F}_{k_1}$ represents the $u$ and $k_{1}$ frequencies with highest amplitudes from $\mathbf{A}$ , respectively. We ensure that $u$ is greater than or equal to $k_{1}$ . Due to the conjugate symmetry in the frequency domain, $f_{*}$ only focuses on the former $\left[\frac{t}{2}\right]$ frequencies. The final set of $k$ frequencies is composed of $\mathbf{F}_{k_1}$ and the top- $k_{2}$ frequencies with the greatest values from $\mathbf{F}_u\setminus \mathbf{F}_{k_1}$ .
+
+Period-based Reshaper. Based on the selected frequencies $\{f_1, \dots, f_k\}$ and corresponding period lengths $\{p_1, \dots, p_k\}$ ( $p_i = \lceil \frac{t}{f_i} \rceil$ ), we reshape the 1D input series $X_I \in \mathbb{R}^t$ into $k$ 2D tensors by:
+
+$$
+X _ {2 \mathrm {D}} ^ {i} = \operatorname {R e s h a p e} _ {f _ {i}, p _ {i}} \left(\operatorname {P a d d i n g} \left(X _ {I}\right)\right), \quad i \in \{1, \dots , k \} \tag {3}
+$$
+
+Here, $\mathrm{Padding}(\cdot)$ is employed to extend the length of $X_{I}$ to $p_i \times f_i$ by filling zeros for $\mathrm{Reshape}_{f_i,p_i}(\cdot)$ , where $f_{i}$ and $p_i$ denote the number of rows and columns of the 2D tensor, respectively. For the obtained 2D tensor $X_{\mathrm{2D}}^{i} \in \mathbb{R}^{f_{i} \times p_{i}}$ , each row represents the short-term variations and each column represents long-term variations. We then employ Temporal Variations Decoupler to decouple the long-term and short-term information through "period patching" and "frequency slicing".
+
+Period Patching: Denote the patch length as $p$ and the stride length as $s$ , we divide $X_{2\mathrm{D}}^{i} \in \mathbb{R}^{f_{i} \times p_{i}}$ along dimension $p_{i}$ and aggregate along dimension $f_{i}$ to form a patch. Specifically, $X_{2\mathrm{D}}^{i}$ is patched into multiple patches $x_{g}^{i,j} \in \mathbb{R}^{N \times P}$ , where $N = \left\lfloor \frac{(p_{i} - p)}{s} \right\rfloor + 1$ is the number of patches and each patch contains $P = f_{i} \times p$ time steps. $x_{g}^{i,j}$ denotes the $j$ -th patch. This patching strategy condenses complete long-term variations between all periods.
+
+Compared with former patching strategies (Nie et al., 2023; Zhang & Yan, 2023), our patches capture a broader scope and richer semantic information, enhancing the capacity of the Transformer for modeling long-term variations. Meanwhile, because the number of patches decreases from $t / s$ to $\max(p_i) / s$ , the computational cost is significantly reduced.
+
+Frequency Slicing: Along with $f_{i}$ dimensions, we split $X_{2\mathrm{D}}^{i}$ into several 1D short-term slices $x_{l}^{i,r} \in \mathbb{R}^{p_{i}}$ , where $r \in [1,f_i]$ denotes the $r$ -th row of $X_{2\mathrm{D}}^{i}$ . Each local slice represents the short-term variations within every period.
+
+# 3.3 DUAL VARIATIONS MODELING BLOCK
+
+As illustrated in Figure 4, the Dual Variations Modeling Block is composed of two parts: long-term variations extractor and short-term variations extractor. It adopts a dual-branch parallel architecture to model the long-term and short-term variations in the time series. This parallel structure not only better preserves the high-frequency information of short-term changes but also enhances computational efficiency (Wang et al., 2022; Si et al., 2022). The details of each component will be given as follows.
+
+Long-term Variations Extractor: Given the patches $x_{g}^{i,j} \in \mathbb{R}^{N \times P}$ with long-term information, we initially project them into the latent space via a linear projection: $x_{g}^{i,j} = \operatorname{Linear}(x_{g}^{i,j}) \in \mathbb{R}^{N \times D}$ , where $D$ is the dimension of latent space. Subsequently, $x_{g}^{i,j}$ will go through several Transformer encoder layers. The specific process of each layer can be described as follows:
+
+$$
+\hat {x} _ {g} ^ {i, j} = \operatorname {B a t c h N o r m} \left(x _ {g} ^ {i, j} + \operatorname {M S A} \left(x _ {g} ^ {i, j}, x _ {g} ^ {i, j}, x _ {g} ^ {i, j}\right)\right) \tag {4}
+$$
+
+$$
+\hat {x} _ {g} ^ {i, j} = \operatorname {B a t c h N o r m} \left(\hat {x} _ {g} ^ {i, j} + \operatorname {M L P} \left(\hat {x} _ {g} ^ {i, j}\right)\right)
+$$
+
+Here, BatchNorm(\cdot) denotes batch normalization (Ioffe & Szegedy, 2015). MLP(\cdot) is a multi-layered linear feedforward neural network. Multi-head self-attention MSA(\cdot) mechanism enhances the representation capacity by employing multiple independent self-attention heads. Each head captures different types of long-term dependencies among different patches. All these heads are combined to obtain more comprehensive dependencies by:
+
+$$
+X _ {g} ^ {i} = \operatorname {L i n e a r} \left(\operatorname {F l a t t e n} \left(\hat {x} _ {g} ^ {i, j}\right)\right) \in \mathbb {R} ^ {t} \tag {5}
+$$
+
+Short-term Variations Extractor: This module contains a sequence of convolution blocks, each consisting of a Conv1d layer and a non-linear activation function. These blocks are sequentially structured to gradually expand the receptive field, accommodating periods of various lengths. For each local slice $x_{l}^{i,r}$ , the process of each block is:
+
+$$
+\hat {x} _ {l} ^ {i, r} = \operatorname {S E L U} \left(\operatorname {C o n v 1 d} \left(x _ {l} ^ {i, r}\right)\right) \tag {6}
+$$
+
+
+Figure 4: Dual Variations Modeling Block.
+
+where SELU denotes scaled exponential linear units (Klambauer et al., 2017). To get the final prediction of the convolution part, we use the concatenate and truncate operations:
+
+$$
+X _ {l} ^ {i} = \operatorname {T r u n c a t e} \left(\operatorname {C o n c a t} \left(\hat {x} _ {l} ^ {i, r}\right)\right) \tag {7}
+$$
+
+The final output of the Dual Variations Modeling Block is the summation of $X_{g}^{i}$ and $X_{l}^{i}$ :
+
+$$
+\hat {X} ^ {i} = X _ {g} ^ {i} + X _ {l} ^ {i} \tag {8}
+$$
+
+# 3.4 VARIATIONS AGGREGATION BLOCK
+
+The Variations Aggregation Block consolidates the results from $k$ DVMBs. Specifically, we concatenate these $k$ results and then map them through a parameter-shared linear layer to produce univariate prediction $X_{O} \in \mathbb{R}^{T}$ :
+
+$$
+X _ {O} = \operatorname {L i n e a r} \left(\operatorname {C o n c a t} \left(\hat {X} ^ {i}\right)\right) \tag {9}
+$$
+
+The final multivariate prediction $\mathbf{X}_O\in \mathbb{R}^{T\times d}$ is obtained by stacking $d$ univariate prediction $X_O$ .
+
+# 4 EXPERIMENTS
+
+Datasets We conduct extensive experiments on seven popular real-world datasets (Zhou et al., 2021), including Electricity Transformer Temperature (ETT) with its four sub-datasets (ETTh1, ETTh2, ETTm1, ETTm2), Weather, Electricity, and Traffic. We adopt the same train/val/test splits ratio 0.6:0.2:0.2 as Zhou et al. (2021) for the ETT datasets and split the remaining three by the ratio of 0.7:0.1:0.2 following Wu et al. (2021).
+
+Baselines We select representative state-of-the-art methods from the recent LTSF landscape as baselines, including the following categories: 1) Transformer-based models: PatchTST (Nie et al., 2023) and FEDformer (Zhou et al., 2022); 2) CNN-based models: TimesNet (Wu et al., 2023) and MICN (Wang et al., 2022); 3) Linear-based models: TiDE (Das et al., 2023) and DLinear (Zeng et al., 2023). Considering varying look-back window size leads to different performances, we pick up their best performance as baselines, and corresponding results are reported from the original papers.
+
+**Setup** Following Zhou et al. (2021), we normalize the train/val/test sets to zero-mean using the mean and standard deviation from the training set. The Mean Square Error (MSE) and Mean Absolute Error (MAE) are selected as evaluation metrics, consistent with previous methods. All of the models adopt the same prediction length $T = \{96, 192, 336, 720\}$ . For the look-back window $t$ , we conduct experiments on PDF using $t = 336$ and $t = 720$ while TiDE, PatchTST, and DLinear employ $t = 720, 512, 336$ , and all other models use $t = 96$ .
+
+# 4.1 MAIN RESULTS
+
+We present multivariate long-term forecasting results in Table 1. Regarding the Count value, PDF(720) and PDF(336) achieve the best and second-best results, outperforming all other methods across different categories. Quantitatively, compared with Transformer-based models, PDF(720) yields an overall $14.59\%$ reduction in MSE and $10.77\%$ reduction in MAE. Compared with CNN-based models, PDF(720) yields an overall $24.61\%$ reduction in MSE and $19.91\%$ reduction in MAE.
+
+Table 1: Multivariate long-term forecasting results with different prediction lengths $T \in \{96, 192, 336, 720\}$ . The numbers in parentheses next to the method represent the look-back window $t$ . The best and the second best results are in bold and underlined. The last row Count indicates the number of times each method achieves the best or the second best results.
+
+
Categories
Ours
Transformers
CNNs
Lines
Models
PDF(720)
PDF(336)
PatchTST(512)
FEDformer(96)
TimesNet(96)
MICN(96)
TiDE(720)
DLinear(336)
Metric
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
96
0.356
0.391
0.357
0.388
0.370
0.400
0.376
0.419
0.384
0.402
0.421
0.431
0.375
0.398
0.375
0.399
192
0.390
0.413
0.397
0.412
0.413
0.429
0.420
0.448
0.436
0.429
0.474
0.487
0.412
0.422
0.405
0.416
336
0.402
0.421
0.409
0.422
0.422
0.440
0.459
0.465
0.491
0.469
0.569
0.551
0.435
0.433
0.439
0.443
720
0.462
0.477
0.432
0.455
0.447
0.468
0.506
0.507
0.521
0.500
0.770
0.672
0.454
0.465
0.472
0.490
ETTh2
96
0.270
0.332
0.272
0.333
0.274
0.337
0.358
0.397
0.340
0.374
0.299
0.364
0.270
0.336
0.289
0.353
192
0.334
0.375
0.335
0.375
0.341
0.382
0.429
0.439
0.402
0.414
0.441
0.454
0.332
0.380
0.383
0.418
336
0.324
0.379
0.325
0.377
0.329
0.384
0.496
0.487
0.452
0.452
0.654
0.567
0.360
0.407
0.448
0.465
720
0.378
0.422
0.375
0.417
0.379
0.422
0.463
0.474
0.462
0.468
0.956
0.716
0.419
0.451
0.605
0.551
ETTm1
96
0.277
0.337
0.280
0.335
0.293
0.346
0.379
0.419
0.338
0.375
0.316
0.362
0.306
0.349
0.299
0.343
192
0.316
0.364
0.317
0.359
0.333
0.370
0.426
0.441
0.374
0.387
0.363
0.390
0.335
0.366
0.335
0.365
336
0.346
0.381
0.354
0.382
0.369
0.392
0.445
0.459
0.410
0.411
0.408
0.426
0.364
0.384
0.369
0.386
720
0.402
0.409
0.405
0.413
0.416
0.420
0.543
0.490
0.478
0.450
0.481
0.476
0.413
0.413
0.425
0.421
ETTm2
96
0.159
0.251
0.162
0.253
0.166
0.256
0.203
0.287
0.187
0.267
0.179
0.275
0.161
0.251
0.167
0.260
192
0.217
0.292
0.219
0.291
0.223
0.296
0.269
0.328
0.249
0.309
0.307
0.376
0.215
0.289
0.224
0.303
336
0.266
0.325
0.270
0.326
0.274
0.329
0.325
0.366
0.321
0.351
0.325
0.388
0.267
0.326
0.281
0.342
720
0.345
0.375
0.358
0.380
0.362
0.385
0.421
0.415
0.408
0.403
0.502
0.490
0.352
0.383
0.397
0.421
Weather
96
0.143
0.193
0.147
0.194
0.149
0.198
0.217
0.296
0.172
0.220
0.161
0.229
0.166
0.222
0.176
0.237
192
0.188
0.236
0.192
0.239
0.194
0.241
0.276
0.336
0.219
0.261
0.220
0.281
0.209
0.263
0.220
0.282
336
0.240
0.279
0.244
0.279
0.245
0.282
0.339
0.380
0.280
0.306
0.278
0.331
0.254
0.301
0.265
0.319
720
0.308
0.328
0.318
0.330
0.314
0.334
0.403
0.428
0.365
0.359
0.311
0.356
0.313
0.340
0.323
0.362
Electricity
96
0.126
0.220
0.127
0.219
0.129
0.222
0.193
0.308
0.168
0.272
0.164
0.269
0.132
0.229
0.140
0.237
192
0.145
0.238
0.145
0.237
0.147
0.240
0.201
0.315
0.184
0.289
0.177
0.285
0.147
0.243
0.153
0.249
336
0.159
0.255
0.162
0.255
0.163
0.259
0.214
0.329
0.198
0.300
0.193
0.304
0.161
0.261
0.169
0.267
720
0.194
0.287
0.200
0.290
0.197
0.290
0.246
0.355
0.220
0.320
0.212
0.321
0.196
0.294
0.203
0.301
Traffic
96
0.350
0.239
0.351
0.238
0.360
0.249
0.587
0.366
0.593
0.321
0.519
0.309
0.336
0.253
0.410
0.282
192
0.363
0.247
0.374
0.248
0.379
0.256
0.604
0.373
0.617
0.336
0.537
0.315
0.346
0.257
0.423
0.287
336
0.376
0.258
0.386
0.253
0.392
0.264
0.621
0.383
0.629
0.336
0.534
0.313
0.355
0.260
0.436
0.296
720
0.419
0.279
0.421
0.278
0.432
0.286
0.626
0.382
0.640
0.350
0.577
0.325
0.386
0.273
0.466
0.315
Count
52
44
6
0
0
1
20
0
+
+Compared with Linear-based models, PDF(720) yields an overall $7.05\%$ reduction in MSE and $5.51\%$ reduction in MAE. These results affirm that PDF can effectively utilize a long historical look-back window. Furthermore, PDF(720) consistently outperforms all baselines, except for TiDE which exhibits a lower MSE on the traffic dataset. However, this superior performance of TiDE on the traffic dataset is largely attributed to the prior knowledge of static covariates (Das et al., 2023).
+
+# 4.2 EFFECTIVENESS OF PERIOD PATCHING
+
+Analysis of patch information. Recent works (Nie et al., 2023; Lin et al., 2023; Zhang et al., 2023) point out that enhancing the semantic information within patches can lead to improved predictions. To assess the performance of patches emphasizing more semantics information versus long-term information, we conduct the following comparative experiments: 1) PatchTST(336): Following the original PatchTST experimental setup, we set each patch length $p = 16$ and stride $s = 8$ , yielding a total of 42 patches; 2) PatchTST(336)*: We set $p = 64$ , $s = 14$ and obtain 24 patches. Compared with PatchTST(336), each patch is longer and encompasses more semantics information. 3) PDF(336): We employ single-period patching with a period length $p_1 = 24$ and choose $p = s = 1$ . Given that $f_1 = 336 / p_1 = 14$ , each patch has a length of $p \times f_1 = 14$ . This resulted in 24 patches, each rich in long-term information.
+
+The experimental results in Table 2 show that compared with PatchTST(336) and PatchTST(336)*, PDF(336) demonstrates noticeable performance improvements on most datasets. These findings emphasize the importance of long-term information contained within the patches. It is noteworthy that both PatchTST(336)* and PDF(336) have the same number of patches. Even though each patch in PatchTST(336)* is longer, theoretically suggesting potential for better prediction results, its performance does not improve and is even worse than PatchTST(336) in some cases. This further indicates that merely extending the semantics information within a patch is not sufficient for enhancing prediction. The key is to ensure each patch captures more long-term information and our period patching method can effectively address this concern.
+
+Analysis of efficiency. To further validate the computational efficiency of our period patching approach, we conduct experiments comparing the Multiply-Accumulate Operations (MACs) (Cao et al., 2022) of our PDF with two other patch-based methods across various look-back windows
+
+Table 2: Results of each patch with various semantic information. PatchTST(336)* denotes the variant of PatchTST with longer patches (e.g. more semantics information). The best results are in bold.
+
+
Datasets
ETTh1
Electricity
Traffic
Method
Metric
96
192
336
720
96
192
336
720
96
192
336
720
PatchTST(336)
MSE
0.370
0.413
0.422
0.447
0.129
0.147
0.163
0.197
0.360
0.379
0.392
0.432
MAE
0.400
0.429
0.440
0.468
0.222
0.240
0.259
0.290
0.249
0.256
0.264
0.286
PatchTST(336)*
MSE
0.389
0.425
0.435
0.451
0.130
0.148
0.164
0.202
0.367
0.376
0.393
0.428
MAE
0.411
0.429
0.440
0.468
0.223
0.241
0.257
0.291
0.253
0.260
0.263
0.283
PDF(336)
MSE
0.357
0.397
0.409
0.432
0.128
0.147
0.166
0.204
0.353
0.374
0.388
0.423
MAE
0.388
0.412
0.422
0.455
0.223
0.243
0.263
0.294
0.239
0.250
0.257
0.277
+
+$t \in \{336, 512, 720, 960\}$ and prediction length $T \in \{96, 192, 336, 720\}$ . The results are summarized in Table 3. Overall, the MACs for PDF reduced by $34.64\%$ compared to PatchTST and $74.38\%$ compared to Crossformer. For a fixed look-back window $t$ , the increase in MACs for PDF corresponding to the growth in prediction length $T$ typically resides in the magnitude of millions, whereas for PatchTST and Crossformer, it is in the magnitude of gillions. The same observation is noted when keeping the prediction length constant and increasing the size of the look-back window. In extreme cases, specifically for ETTh1 with $t = 960$ and $T = 720$ , PDF demonstrated superior lightweight performance, with reductions in MACs of $54.12\%$ and $99.71\%$ compared to PatchTST and Crossformer, respectively.
+
+Table 3: Comparison of Multiply-Accumulate Operations (MACs) among PDF and two other patch-based Transformer methods (PatchTST (Nie et al., 2023) and Crossformer (Zhang & Yan, 2023)) for different look-back window $t \in \{336,512,720,960\}$ and prediction lengths $T \in \{96,192,336,720\}$ . "M" and "G" stand for million and gillion operations. The lowest computational costs are in bold.
+
+
Look-back
336
512
720
960
Models
PDF
Patch.
Cross.
PDF
Patch.
Cross.
PDF
Patch.
Cross.
PDF
Patch.
Cross.
ETh1
96
3.97M
5.21M
0.81G
4.67M
7.94M
1.08G
5.49M
11.17M
1.37G
6.49M
14.89M
1.72G
192
4.19M
5.66M
1.13G
5.01M
8.63M
1.40G
5.98M
12.14M
1.69G
7.13M
16.18M
2.04G
336
4.53M
6.34M
1.61G
5.53M
9.66M
1.88G
6.70M
13.59M
2.17G
8.10M
18.12M
2.52G
720
5.44M
8.15M
2.89G
6.91M
12.42M
3.16G
8.64M
17.46M
3.45G
10.68M
23.28M
3.80G
Avg.
4.53M
6.34M
1.61G
5.53M
9.66M
1.88G
6.70M
13.59M
2.17G
8.10M
18.12M
2.52G
Electricity
96
3.41G
5.53G
2.17G
3.60G
8.42G
2.89G
3.82G
11.84G
3.66G
4.08G
15.79G
4.59G
192
3.42G
5.69G
3.02G
3.61G
8.67G
3.74G
3.84G
12.20G
4.52G
4.11G
16.26G
5.45G
336
3.43G
5.94G
4.31G
3.64G
9.05G
5.03G
3.88G
12.73G
5.81G
4.16G
16.97G
6.74G
720
3.48G
6.60G
7.74G
3.70G
10.06G
8.46G
3.97G
14.15G
9.24G
4.27G
18.86G
10.17G
Avg.
3.44G
5.94G
4.31G
3.64G
9.05G
5.03G
3.88G
12.73G
5.81G
4.16G
16.97G
6.74G
Traffic
96
9.15G
14.84G
5.81G
9.67G
22.61G
7.74G
10.27G
31.80G
9.82G
10.97G
42.40G
12.32G
192
9.18G
15.28G
8.11G
9.71G
23.29G
10.04G
10.33G
32.75G
12.12G
11.05G
43.67G
14.62G
336
9.22G
15.95G
11.56G
9.77G
24.31G
13.50G
10.42G
34.18G
15.57G
11.17G
45.57G
18.08G
720
9.33G
17.73G
20.77G
9.94G
27.02G
22.70G
10.66G
37.99G
24.78G
11.49G
50.66G
27.28G
Avg.
9.22G
15.95G
11.56G
9.77G
24.31G
13.50G
10.42G
34.18G
15.57G
11.17G
45.58G
18.08G
+
+# 4.3 ABLATION STUDIES
+
+Convolution Module. To investigate the impact of convolution in short-term variations modeling, we conduct a study comparing the following three cases: 1) Parallel Convolution; 2) Sequential Convolution; 3) Without Convolution. We perform these comparisons in four datasets. The results in Table 4 show that parallel convolution consistently outperforms its sequential counterpart, an advantage possibly stemming from the training challenges posed by deeper networks in serial architectures. Interestingly, models without convolution yield better results than those using sequential convolution, highlighting the drawbacks of overly deep serial networks. Furthermore, when compared to the model without convolution, the parallel approach achieves notable performance improvements on datasets with weaker periodicity, demonstrating its effectiveness in preserving short-term information without increasing network depth. The observed degradation in performance for datasets with strong periodicity, such as Traffic, underscores the necessity of placing emphasis on the long-term variations across periods.
+
+Variations Aggregation Method. We explore two methods for aggregating the outputs of multiple DVMBs within the variations aggregation block: 1) Concatate: Concatenate the outputs of all DVMBs
+
+Table 4: Ablation study of convolution module in PDF. "Par Conv", "Seq Conv", and "w/o Conv" denote parallel convolution, sequential convolution, and without convolution. The best results are in bold.
+
+
Datasets
ETTh2
Weather
Electricity
Traffic
Method
Metric
96
192
336
720
96
192
336
720
96
192
336
720
96
192
336
720
Par Conv
MSE
0.270
0.334
0.324
0.378
0.143
0.188
0.240
0.308
0.126
0.145
0.159
0.194
0.360
0.363
0.376
0.419
MAE
0.332
0.375
0.379
0.422
0.193
0.236
0.279
0.328
0.220
0.238
0.255
0.287
0.239
0.247
0.258
0.279
Seq Conv
MSE
0.279
0.342
0.336
0.418
0.146
0.192
0.244
0.316
0.128
0.145
0.161
0.196
0.366
0.376
0.386
0.426
MAE
0.339
0.381
0.391
0.452
0.197
0.241
0.283
0.336
0.225
0.241
0.257
0.289
0.255
0.260
0.267
0.287
w/o Conv
MSE
0.273
0.340
0.334
0.399
0.145
0.190
0.243
0.307
0.127
0.144
0.160
0.196
0.348
0.363
0.375
0.420
MAE
0.338
0.382
0.390
0.441
0.196
0.239
0.281
0.331
0.221
0.239
0.255
0.288
0.237
0.247
0.256
0.282
+
+and map them through linear projection; 2) Mean: Compute the average outputs of all DVMBs. The experimental results of these two aggregation strategies are presented in Table 5, which shows that the Concat operation generally has better performance than the Mean operation.
+
+Table 5: Ablation study of the variations aggregation method. The best results are in bold.
+
+
Datasets
ETTh2
ETTm2
Weather
Electricity
Method
Metric
96
192
336
720
96
192
336
720
96
192
336
720
96
192
336
720
Concat
MSE
0.270
0.334
0.324
0.378
0.159
0.217
0.266
0.345
0.143
0.188
0.240
0.308
0.126
0.145
0.159
0.194
MAE
0.332
0.375
0.379
0.422
0.251
0.292
0.325
0.375
0.193
0.236
0.279
0.328
0.220
0.238
0.255
0.287
Mean
MSE
0.274
0.340
0.328
0.396
0.163
0.219
0.270
0.344
0.144
0.191
0.244
0.308
0.127
0.144
0.161
0.194
MAE
0.337
0.381
0.384
0.437
0.254
0.295
0.329
0.377
0.194
0.240
0.282
0.330
0.221
0.240
0.257
0.287
+
+# 4.4 COMPUTATIONAL COMPLEXITY ANALYSIS
+
+Table 6 compares the theoretical complexity per layer across different Transformer-based models. The complexity of the encoder layer in the original Transformer is $O(t^2)$ . Subsequent works manage to reduce the complexity of the encoder layer to $O(t\log t)$ or even $O(t)$ . While the patch-based approaches retain quadratic complexity, the introduction of the patch length $p$ makes $O((\frac{t}{p})^2)$ favorable over $O(t)$ when $t$ is not excessively large. Notably, expect for PDF, all existing Transformer-based methods have the complexities of an encoder layer tied to the length of the look-back window $t$ . The computational complexity of PDF is only related to the maximum decoupled periodic length $p_i$ . This ensures that even when the $t$ is extremely large, computational costs remain low. For example, if we select the Electricity dataset with $t = 10^5$ and choose its most representative periodic $p_i = 24$ with the patch length $p = 24$ , our computational complexity will be significantly lower than all other methods.
+
+Table 6: Theoretical computational complexity per layer in Transformer-based models. $t$ and $T$ denote the length of the look-back window and prediction window, respectively. $d$ denotes the number of variates. $p$ denotes the length of each patch in the patch-based methods.
+
+
Method
Encoder layer
Decoder layer
Trans. (Vaswani et al., 2017)
O(t2)
O(T(t+T))
In. (Zhou et al., 2021)
O(t log t)
O(T(T+log t))
Auto. (Wu et al., 2021)
O(t log t)
O((t/2+T) log(t/2+T))
Pyra. (Liu et al., 2021)
O(t)
O(t(t+T))
FED. (Zhou et al., 2022)
O(t)
O(t/2+T)
ETS. (Woo et al., 2022)
O(t log t)
O(T log T)
Cross. (Zhang & Yan, 2023)
O(d/p2t2)
O(d/p2T(t+T))
MTP. (Zhang et al., 2023)
O((t/p)2)
O((t+T/p)2)
PET. (Lin et al., 2023)
O((t/p)2)
-
Patch. (Nie et al., 2023)
O((t/p)2)
-
PDF (Ours)
O((max(pi)/p)2)
-
+
+# 5 CONCLUSIONS
+
+This paper introduces an efficient Periodicity Decoupling Framework (PDF) for long-term series forecasting. The PDF captures both short- and long-term temporal variations in 2D spaces. The approach involves breaking down complex 1D time series using a multi-periodic decoupling block (MDB) based on periodicity. Additionally, a dual variations modeling block (DVMB) is proposed to learn short- and long-term variations from the decoupled 2D series in parallel. Compared to previous methods that only model 1D temporal variations, our PDF performs better by effectively extracting both short- and long-term variations. Experiments on real-world datasets demonstrate the superior forecasting performance and computational efficiency over other state-of-the-art methods.
+
+# ACKNOWLEDGMENTS
+
+This work is supported in part by the National Key Research and Development Program of China, under Grant 2022YFF1202104, National Natural Science Foundation of China, under Grant (62302309, 62171248), Shenzhen Science and Technology Program (Grant No. JCYJ20220818101014030, JCYJ20220818101012025, WDZC20231128114058001), Open Fund of National Engineering Laboratory for Big Data System Computing Technology (Grant No. SZUBDSC-OF2024-23), and Swift Fund Fintech Funding 2023.
+
+# REFERENCES
+
+Oliver D. Anderson and M. G. Kendall. Time-series. 2nd edn. The Statistician, 25:308, 1976.
+Rafal A Angryk, Petrus C Martens, Berkay Aydin, Dustin Kempton, Sushant S Mahajan, Sunitha Basodi, Azim Ahmadzadeh, Xumin Cai, Soukaina Filali Boubrahimi, Shah Muhammad Hamdi, et al. Multivariate time series dataset for space weather data analytics. *Scientific data*, 7(1):227, 2020.
+Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.
+Xuelin Cao, Bo Yang, Chongwen Huang, George C Alexandropoulos, Chau Yuen, Zhu Han, H Vincent Poor, and Lajos Hanzo. Massive access of static and mobile users via reconfigurable intelligent surfaces: Protocol design and performance analysis. IEEE Journal on Selected Areas in Communications, 40(4):1253-1269, 2022.
+Chris Chatfield. The analysis of time series: an introduction. 1981.
+Chao Chen, Karl Petty, Alexander Skabardonis, Pravin Varaiya, and Zhanfeng Jia. Freeway performance measurement system: mining loop detector data. Transportation Research Record, 1748: 96-102, 2001.
+Abhimanyu Das, Weihao Kong, Andrew Leach, Rajat Sen, and Rose Yu. Long-term forecasting with tide: Time-series dense encoder. arXiv preprint arXiv:2304.08424, 2023.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
+Haoqi Fan, Bo Xiong, Karttikeya Mangalam, Yanghao Li, Zhicheng Yan, Jitendra Malik, and Christoph Feichtenhofer. Multiscale vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6824-6835, 2021.
+Rob J Hyndman and George Athanasopoulos. Forecasting: principles and practice. OTexts, 2018.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448-456. pmlr, 2015.
+Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. Advances in Neural Information Processing Systems, 30, 2017.
+Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. Advances in Neural Information Processing Systems, 32, 2019.
+Bryan Lim and Stefan Zohren. Time-series forecasting with deep learning: a survey. Philosophical Transactions of the Royal Society A, 379(2194):20200209, 2021.
+Shengsheng Lin, Weiwei Lin, Wentai Wu, Songbo Wang, and Yongxiang Wang. PETformer: Long-term time series forecasting via placeholder-enhanced transformer. arXiv preprint arXiv:2308.04791, 2023.
+
+Minhao Liu, Ailing Zeng, Muxi Chen, Zhijian Xu, Qiuxia Lai, Lingna Ma, and Qiang Xu. SCInet: Time series modeling and forecasting with sample convolution and interaction. Advances in Neural Information Processing Systems, 35:5816-5828, 2022a.
+Shizhan Liu, Hang Yu, Cong Liao, Jianguo Li, Weiyao Lin, Alex X Liu, and Schahram Dustdar. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting. In International Conference on Learning Representations, 2021.
+Ze Liu, Jia Ning, Yue Cao, Yixuan Wei, Zheng Zhang, Stephen Lin, and Han Hu. Video swim transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3202-3211, 2022b.
+Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. A time series is worth 64 words: Long-term forecasting with transformers. In International Conference on Learning Representations, 2023.
+Andrew Patton. Copula methods for forecasting multivariate time series. Handbook of economic forecasting, 2:899-960, 2013.
+Michael S Ryoo, AJ Piergiovanni, Anurag Arnab, Mostafa Dehghani, and Anelia Angelova. Token-learner: What can 8 learned tokens do for images and videos? arXiv preprint arXiv:2106.11297, 2021.
+Chenyang Si, Weihao Yu, Pan Zhou, Yichen Zhou, Xinchao Wang, and Shuicheng Yan. Inception transformer. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems, volume 35, pp. 23495-23509. Curran Associates, Inc., 2022.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in Neural Information Processing Systems, 30, 2017.
+Huiqiang Wang, Jian Peng, Feihu Huang, Jince Wang, Junhui Chen, and Yifei Xiao. MICN: Multiscale local and global context modeling for long-term series forecasting. In International Conference on Learning Representations, 2022.
+Gerald Woo, Chenghao Liu, Doyen Sahoo, Akshit Kumar, and Steven Hoi. ETSformer: Exponential smoothing transformers for time-series forecasting. arXiv preprint arXiv:2202.01381, 2022.
+Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon, and Saining Xie. Convnext v2: Co-designing and scaling convnets with masked autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16133-16142, 2023.
+Haixu Wu, Jiehui Xu, Jianmin Wang, and Mingsheng Long. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. Advances in Neural Information Processing Systems, 34:22419-22430, 2021.
+Haixu Wu, Tengge Hu, Yong Liu, Hang Zhou, Jianmin Wang, and Mingsheng Long. TimesNet: Temporal 2d-variation modeling for general time series analysis. In International Conference on Learning Representations, 2023.
+Xiaoling Xia, Cui Xu, and Bing Nan. Inception-v3 for flower classification. In International Conference on Image, Vision and Computing, pp. 783-787. IEEE, 2017.
+Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? In Proceedings of the AAAI conference on artificial intelligence, volume 37, pp. 11121-11128, 2023.
+Chen Zhang, Yinghao Xu, and Yujun Shen. Compconv: A compact convolution module for efficient feature learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3012-3021, 2021.
+
+Yifan Zhang, Rui Wu, Sergiu M Dascalu, and Frederick C Harris Jr. Multi-scale transformer pyramid networks for multivariate time series forecasting. arXiv preprint arXiv:2308.11946, 2023.
+Yunhao Zhang and Junchi Yan. Crossformer: Transformer utilizing cross-dimension dependency for multivariate time series forecasting. In International Conference on Learning Representations, 2023.
+Yi Zheng, Qi Liu, Enhong Chen, Yong Ge, and J Leon Zhao. Time series classification using multi-channels deep convolutional neural networks. In International Conference on Web-age Information Management, pp. 298-310. Springer, 2014.
+Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pp. 11106-11115, 2021.
+Tian Zhou, Ziqing Ma, Qingsong Wen, Xue Wang, Liang Sun, and Rong Jin. FEDformer: Frequency enhanced decomposed transformer for long-term series forecasting. In International Conference on Machine Learning, pp. 27268-27286. PMLR, 2022.
\ No newline at end of file
diff --git a/periodicitydecouplingframeworkforlongtermseriesforecasting/images.zip b/periodicitydecouplingframeworkforlongtermseriesforecasting/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..a7f4dbb0157789a42486b6a368aa977cd22bf123
--- /dev/null
+++ b/periodicitydecouplingframeworkforlongtermseriesforecasting/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b67149bee9a6bbb9f19d37cad71d7057f04a4078680d76d8de0a7cad48809123
+size 711454
diff --git a/periodicitydecouplingframeworkforlongtermseriesforecasting/layout.json b/periodicitydecouplingframeworkforlongtermseriesforecasting/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..60d283d628acf0f013866532022b60efae503678
--- /dev/null
+++ b/periodicitydecouplingframeworkforlongtermseriesforecasting/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fe9003692d61c6250aad347241db1374a07d30cf71edd8e3a0be8c68a253b09e
+size 388889
diff --git a/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_content_list.json b/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..404ea4614f7a847124fe10b00ba7c33b451dda9f
--- /dev/null
+++ b/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b2a23bcd7b1eb1f87e1f6cfdf759183acec669fa5a1164c715b439d6d0ee0eb7
+size 167991
diff --git a/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_model.json b/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..be38fa3da7a2d02f86d72a5f020b346908422c96
--- /dev/null
+++ b/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:da3f69af9d7da4ec4cfe7a5b146cc1229d71e7ccce5c60c76b8d2e260e2f7fcc
+size 207274
diff --git a/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_origin.pdf b/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..aace93afa8e546f70d44117849c9b60e19b2b415
--- /dev/null
+++ b/personalizesegmentanythingmodelwithoneshot/efb5ac17-6d41-4008-9b4a-800549a1b646_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:39c0ef8146eee6eae331790015a353369d13fc8b2eccbc6d4c80329064a2388e
+size 8865972
diff --git a/personalizesegmentanythingmodelwithoneshot/full.md b/personalizesegmentanythingmodelwithoneshot/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..4ae4482d6f98402162f883dbc2dff2e7ef8f1c24
--- /dev/null
+++ b/personalizesegmentanythingmodelwithoneshot/full.md
@@ -0,0 +1,656 @@
+# PERSONALIZE SEGMENT ANYTHING MODEL WITH ONE SHOT
+
+Renrui Zhang $^{1,2}$ , Zhengkai Jiang $^{*3}$ , Ziyu Guo $^{*2}$ , Shilin Yan $^{2}$ , Junting Pan $^{1}$ Hao Dong $^{4}$ , Yu Qiao $^{2}$ , Peng Gao $^{2}$ , Hongsheng Li $^{\dagger 1,5}$
+
+$^{1}$ CUHK MMLab $^{2}$ Shanghai Artificial Intelligence Laboratory
+$^{3}$ Institute of Automation, Chinese Academy of Sciences
+$^{4}$ CFCS, School of CS, Peking University $^{5}$ CPII of InnoHK
+
+{renruizhang, ziyuguo}@link.cuhk.edu.hk hsli@ee.cuhk.edu.hk
+
+kaikaijiang.jzk@gmail.com {gaopeng, qiaoyu}@pjlab.org.cn
+
+# ABSTRACT
+
+Driven by large-data pre-training, Segment Anything Model (SAM) has been demonstrated as a powerful promptable framework, revolutionizing the segmentation field. Despite the generality, customizing SAM for specific visual concepts without man-powered prompting is under-explored, e.g., automatically segmenting your pet dog in numerous images. In this paper, we introduce a training-free Personalization approach for SAM, termed PerSAM. Given only one-shot data, i.e., a single image with a reference mask, we first obtain a positive-negative location prior for the target concept in new images. Then, aided by target visual semantics, we empower SAM for personalized object segmentation via two proposed techniques: target-guided attention and target-semantic prompting. In this way, we can effectively customize the general-purpose SAM for private use without any training. To further alleviate the ambiguity of segmentation scales, we present an efficient one-shot fine-tuning variant, PerSAM-F. Freezing the entire SAM, we introduce a scale-aware fine-tuning to aggregate multi-scale masks, which only tunes 2 parameters within 10 seconds for improved performance. To demonstrate our efficacy, we construct a new dataset, PerSeg, for the evaluation of personalized object segmentation, and also test our methods on various one-shot image and video segmentation benchmarks. Besides, we propose to leverage PerSAM to improve DreamBooth for personalized text-to-image synthesis. By mitigating the disturbance of training-set backgrounds, our approach showcases better target appearance generation and higher fidelity to the input text prompt. Code is released at https://github.com/ZrrSkywalker/Personalize-SAM.
+
+
+Figure 1: Personalization of Segment Anything Model. We customize Segment Anything Model (SAM) (Kirillov et al., 2023) for specific visual concepts, e.g., your pet dog. With only one-shot data, we introduce two efficient solutions: a training-free PerSAM, and a fine-tuning PerSAM-F.
+
+
+Figure 2: Personalized Segmentation Examples. Our PerSAM (Left) can segment personal objects in any context with favorable performance, and PerSAM-F (right) further alleviates the ambiguity issue by scale-aware fine-tuning.
+Figure 3: Improving DreamBooth (Ruiz et al., 2022) with PerSAM. By mitigating the disturbance of backgrounds during training, our approach can help to achieve higher-quality personalized text-to-image generation.
+
+# 1 INTRODUCTION
+
+Foundations models in vision (Li et al., 2022; Zou et al., 2023; Wang et al., 2022), language (Brown et al., 2020; Touvron et al., 2023; Radford et al., 2019), and multi-modality (Radford et al., 2021; Jia et al., 2021; Li et al., 2023) have gained unprecedented prevalence, attributed to the availability of large-scale datasets and computational resources. They demonstrate extraordinary generalization capacity in zero-shot scenarios, and display versatile interactivity incorporating human feedback. Inspired by this, Segment Anything (Kirillov et al., 2023) develops a delicate data engine for collecting 11M image-mask data, and subsequently trains a segmentation foundation model, known as SAM. It defines a novel promptable segmentation framework, i.e., taking as input a handcrafted prompt and returning the expected mask, which allows for segmenting any objects in visual contexts.
+
+However, SAM inherently loses the capability to segment specific visual concepts. Imagine intending to crop your lovely pet dog in a thick photo album, or find the missing clock from a picture of your bedroom. Utilizing the vanilla SAM would be highly labor-intensive and time-consuming. For each image, you must precisely find the target object within complicated contexts, and then activate SAM with a proper prompt for segmentation. Considering this, we ask: Can we personalize SAM to automatically segment user-designated visual concepts in a simple and efficient manner?
+
+To this end, we introduce PerSAM, a training-free personalization approach for Segment Anything Model. As shown in Figure 1, our method efficiently customizes SAM using only one-shot data, i.e., a user-provided reference image and a rough mask of the personal concept. Specifically, we first obtain a location confidence map for the target object in the test image by feature similarities, which considers the appearance of every foreground pixel. According to confidence scores, two points are selected as the positive-negative location prior, which are finally encoded as prompt tokens and fed into SAM's decoder for segmentation. Within the decoder, we propose to inject visual semantics of the target object to unleash SAM's personalized segmentation power with two techniques:
+
+- Target-guided Attention. We guide every token-to-image cross-attention layer in SAM's decoder by the location confidence map. This explicitly compels the prompt tokens to mainly concentrate on foreground target regions for intensive feature aggregation.
+- Target-semantic Prompting. To explicitly provide SAM with high-level target semantics, we fuse the original prompt tokens with the embedding of the target object, which provides the low-level positional prompt with additional visual cues for personalized segmentation.
+
+With the aforementioned designs, along with a cascaded post-refinement, PerSAM exhibits favorable personalized segmentation performance for unique subjects in a variety of poses or scenes. Notably, our approach can cope well with scenarios that require segmenting one object among multiple similar ones, simultaneously segmenting several identical objects in the same image, or tracking different objects along a video. Nevertheless, as shown in Figure 2, there might be occasional failure cases,
+
+where the object comprises visually distinct subparts or hierarchical structures to be segmented, e.g., the hat on top of a teddy bear, or the head of a robot toy. Such ambiguity casts a challenge for PerSAM in determining the appropriate scale of mask as output, since both the local part and the global shape can be regarded as valid masks by SAM.
+
+To alleviate this issue, we further propose a fine-tuning variant of our approach, PerSAM-F. We freeze the entire SAM to preserve its versatile pre-trained knowledge, and only fine-tune 2 parameters within 10 seconds on a single A100 GPU. In detail, we enable SAM to produce several potential segmentation results of different mask scales. To adaptively select the best scale for varying objects, we employ a learnable relative weight for each mask scale, and conduct a weighted summation as the final output. By such efficient scale-aware training, PerSAM-F avoids over-fitting on the one-shot data and exhibits better segmentation accuracy shown in Figure 2 (Right).
+
+Moreover, we observe that our approach can also assist DreamBooth (Ruiz et al., 2022) to better fine-tune diffusion models for personalized text-to-image generation, as shown in Figure 3. Given a few images containing a specific visual concept, e.g., your pet cat or backpack, DreamBooth learns to convert these images into an identifier [V] in the word embedding space, which, however, can simultaneously include the background information, e.g., stairs or the forest. This would override the newly prompted backgrounds, and disturb the target appearance generation. Therefore, we propose to leverage PerSAM to segment the target object within training images, and only supervise DreamBooth by the foreground area, enabling text-to-image synthesis with higher quality.
+
+We summarize the contributions of our paper as follows:
+
+- Personalized Object Segmentation. We first investigate how to customize a general-purpose segmentation model (SAM) into personalized scenarios with minimal expense. To this end, we introduce two efficient and effective methods, along with a new segmentation dataset, PerSeg, for the evaluation of personalized object segmentation.
+- PerSAM and PerSAM-F. In PerSAM, we propose three training-free techniques to guide SAM by the high-level semantics of target objects. In PerSAM-F, we design a scale-aware fine-tuning with 2 parameters in 10 seconds to well alleviate the mask ambiguity issue.
+- Our approach achieves competitive results on various tasks, including the PerSeg benchmark, one-shot part and semantic segmentation, and video object segmentation. In addition, PerSAM can enhance DreamBooth for better personalized text-to-image synthesis.
+
+# 2 METHOD
+
+In Section 2.1, we first briefly revisit Segment Anything Model (SAM) (Kirillov et al., 2023), and introduce the task definition for personalized object segmentation. Then, we illustrate the methodology of our PerSAM and PerSAM-F in Section 2.2 and 2.3, respectively. Finally, we utilize our approach to assist DreamBooth (Ruiz et al., 2022) for better text-to-image generation in Section 2.5, and specifically discuss some application scenarios in Section 2.4.
+
+# 2.1 PERSONALIZED OBJECT SEGMENTATION
+
+A Revisit of Segment Anything. SAM consists of three components, a prompt encoder, an image encoder, and a lightweight mask decoder, respectively denoted as $\mathrm{Enc}_P$ , $\mathrm{Enc}_I$ , and $\mathrm{Dec}_M$ . As a promptable framework, SAM takes as input an image $I$ , and a set of prompts $P$ , which can be a point, a box, or a coarse mask. Specifically, SAM first utilizes $\mathrm{Enc}_I$ to obtain the input image feature, and adopts $\mathrm{Enc}_P$ to encode the human-given prompts of a length $k$ into prompt tokens as
+
+$$
+F _ {I} = \operatorname {E n c} _ {I} (I), \quad T _ {P} = \operatorname {E n c} _ {P} (P), \tag {1}
+$$
+
+where $F_{I} \in \mathbb{R}^{h \times w \times c}$ and $T_{P} \in \mathbb{R}^{k \times c}$ , with $h, w$ denoting the resolution of the image feature map and $c$ denoting the feature dimension. After that, the encoded image and prompts are fed into the decoder $\mathrm{Dec}_{M}$ for attention-based feature interaction. SAM constructs the input tokens of the decoder by concatenating several learnable mask tokens $T_{M}$ as prefixes to the prompt tokens $T_{P}$ . These mask tokens are responsible for generating the mask output, formulated as
+
+$$
+M = \operatorname {D e c} _ {M} \left(F _ {I}, \operatorname {C o n c a t} \left(T _ {M}, T _ {P}\right)\right), \tag {2}
+$$
+
+where $M$ denotes the final segmentation mask predicted by SAM.
+
+
+Figure 4: Positive-negative Location Prior. We calculate a location confidence map for the target object in new test image by the appearance of all local parts. Then, we select the location prior as the point prompt for PerSAM.
+
+
+Figure 5: Target-guided Attention (Left) & Target-semantic Prompting (Right). To inject SAM with target semantics, we explicitly guide the cross-attention layers, and propose additional prompting with high-level cues.
+
+Task Definition. Although SAM is generalized enough for any object by prompting, it lacks the ability to automatically segment specific subject instances. Considering this, we define a new task for personalized object segmentation. The user provides only a single reference image, and a mask indicating the target visual concept. The given mask can either be an accurate segmentation, or a rough sketch drawn on-the-fly. Our goal is to customize SAM to segment the designated object within new images or videos, without additional human prompting. For evaluation, we annotate a new dataset for personalized segmentation, named PerSeg. The raw images are collected from the works for subject-driven diffusion models (Gal et al., 2022; Ruiz et al., 2022; Kumari et al., 2022), containing various categories of visual concepts in different poses or scenes. In this paper, we propose two efficient solutions for this task, which we specifically illustrate as follows.
+
+# 2.2 TRAINING-FREE PERSAM
+
+Location Confidence Map. Conditioned on the user-provided image $I_R$ and mask $M_R$ , PerSAM first obtains a confidence map that indicates the location of the target object in the new test image $I$ . As shown in Figure 4, we apply an image encoder to extract the visual features of both $I_R$ and $I$ . The encoder can be SAM's frozen backbone or other pre-trained vision models, for which we adopt SAM's image encoder $\mathrm{Enc}_I$ by default. We formulate the process as
+
+$$
+F _ {I} = \operatorname {E n c} _ {I} (I), \quad F _ {R} = \operatorname {E n c} _ {I} \left(I _ {R}\right), \tag {3}
+$$
+
+where $F_{I}, F_{R} \in \mathbb{R}^{h \times w \times c}$ . Then, we utilize the reference mask $M_{R} \in \mathbb{R}^{h \times w \times 1}$ to crop the features of foreground pixels within the visual concept from $F_{R}$ , resulting in a set of $n$ local features as
+
+$$
+\left\{T _ {R} ^ {i} \right\} _ {i = 1} ^ {n} = M _ {R} \circ F _ {R}, \tag {4}
+$$
+
+where $T_R^i \in \mathbb{R}^{1 \times c}$ and $\circ$ denotes spatial-wise multiplication. After this, we calculate $n$ confidence maps for each foreground pixel $i$ by the cosine similarity between $T_R^i$ and test image feature $F_I$ as
+
+$$
+\left\{S ^ {i} \right\} _ {i = 1} ^ {n} = \left\{F _ {I} T _ {R} ^ {i T} \right\} _ {i = 1} ^ {n}, \quad \text {w h e r e} S ^ {i} \in \mathbb {R} ^ {h \times w}. \tag {5}
+$$
+
+Note that $F_{I}$ and $T_{R}^{i}$ have been pixel-wisely L2-normalized. Each $S^{i}$ represents the distribution probability for a different local part of object in the test image, such as the head, the body, or the paws of a dog. On top of this, we adopt an average pooling to aggregate all $n$ local maps to obtain the overall confidence map of the target object as
+
+$$
+S = \frac {1}{n} \sum_ {i = 1} ^ {n} S ^ {i} \in \mathbb {R} ^ {h \times w}. \tag {6}
+$$
+
+By incorporating the confidence of every foreground pixel, $S$ can take the visual appearance of different object parts into consideration, and acquire a relatively comprehensive location estimation.
+
+Positive-negative Location Prior. To provide PerSAM with a location prior on the test image, we select two points with the highest and lowest confidence values in $S$ , denoted as $P_h$ and $P_l$ , respectively. The former represents the most likely center position of the target object, while the latter inversely indicates the background. Then, they are regarded as the positive and negative point prompts, and fed into the prompt encoder as
+
+$$
+T _ {P} = \operatorname {E n c} _ {P} \left(P _ {h}, P _ {l}\right) \in \mathbb {R} ^ {2 \times c}, \tag {7}
+$$
+
+which denote the prompt tokens for SAM's decoder. In this way, SAM would tend to segment the contiguous region surrounding the positive point, while discarding the negative one's on the image.
+
+Target-guided Attention. Although the positive-negative point prompt has been obtained, we further propose a more explicit semantic guidance to the cross-attention operation in SAM's decoder, which concentrates the feature aggregation within foreground target regions. As shown in Figure 5, the overall confidence map $S$ in Equation 6 can clearly indicate the rough region of the target visual concept in the test image (hotter colors indicate higher scores). Based on such a property, we utilize $S$ to guide the attention map in every token-to-image cross-attention layer of the decoder. Specifically, we denote every attention map after the softmax function as $A \in \mathbb{R}^{h \times w}$ , and then modulate its attention distribution by
+
+$$
+A ^ {g} = \operatorname {s o f t m a x} \left(A + \alpha \cdot \operatorname {s o f t m a x} (S)\right), \tag {8}
+$$
+
+where $\alpha$ denotes a balancing factor. With the attention bias, the mask and prompt tokens are compelled to capture more visual semantics associated with the target subject, other than the unimportant background area. This contributes to more effective feature aggregation in attention mechanisms, and enhances the final segmentation accuracy of PerSAM in a training-free manner.
+
+Target-semantic Prompting. The vanilla SAM only receives prompts with low-level positional information, such as the coordinate of a point or a box. To provide SAM's decoder with more high-level cues, we propose to utilize the visual feature of the target concept as an additional high-level semantic prompting. We first obtain the global embedding $T_{R}$ of the object in the reference image by both average pooling between different local features as
+
+$$
+T _ {R} = \frac {1}{n} \sum_ {i = 1} ^ {n} T _ {R} ^ {i} \in \mathbb {R} ^ {1 \times c}. \tag {9}
+$$
+
+Then, we element-wisely add $T_{R}$ to all the input tokens of the test image in Equation 2, before feeding them into the decoder block, which is shown in Figure 5 as
+
+$$
+T ^ {g} = \operatorname {R e p e a t} \left(T _ {R}\right) + \operatorname {C o n c a t} \left(T _ {M}, T _ {P}\right), \tag {10}
+$$
+
+where $T^g$ denotes the input token guided by target semantics for the decoder $\mathrm{Dec}_M$ , and the Repeat operation duplicates the target visual embedding. Aided by the simple token incorporation, PerSAM is not only prompted by low-level location points, but also high-level target visual cues.
+
+Cascaded Post-refinement. Via the above techniques, we obtain an initial segmentation mask on the test image from SAM's decoder, which however, might include rough edges and isolated background noises. For further refinement, we iteratively feed the mask back into the decoder $\mathrm{Dec}_M$ for a two-step post-processing. In the first step, we prompt the decoder by the currently predicted mask along with the previous positive-negative point prompt. For the second step, we acquire the bounding box enclosing the mask from the first step, and prompt the decoder additionally with this box for more accurate object localization. As we only iterate the lightweight decoder without the large-scale image encoder, the post-processing is efficient and only costs an extra $2\%$ latency.
+
+# 2.3 FINE-TUNING OF PERSAM-F
+
+Ambiguity of Segmentation Scales. The training-free PerSAM can tackle most cases with satisfactory segmentation accuracy. However, some target objects contain hierarchical structures, which leads
+
+
+Figure 6: The Scale-aware Fine-tuning in PerSAM-F. To alleviate the scale ambiguity, PerSAM-F adopts two learnable weights for adaptively aggregating three-scale masks.
+
+
+Figure 7: PerSAM-assisted DreamBooth. We utilize PerSAM to decouple the target objects from the background for improving the generation of DreamBooth.
+
+to the ambiguity of mask scales. As shown in Figure 6, the teapot on top of a platform is comprised of two parts: a lid and a body. If the positive point prompt (denoted by a green pentagram) is located at the body, while the negative prompt (denoted by a red pentagram) does not exclude the platform in a similar color, PerSAM would be misled for segmentation. Such an issue is also discussed in SAM, where it proposes an alternative to simultaneously generate multiple masks of three scales, i.e., the whole, part, and subpart of an object. Then, the user must manually select one mask out of three, which is effective but consumes extra manpower. In contrast, our personalized task aims to customize SAM for automatic object segmentation without the need for human prompting. This motivates us to further develop a scale-aware version of PerSAM by parameter-efficient fine-tuning.
+
+Scale-aware Fine-tuning. For adaptive segmentation with the appropriate scale, we introduce a fine-tuning variant, PerSAM-F. Unlike the training-free model only producing one mask, PerSAM-F first follows PerSAM to obtain the location prior, and refers to SAM's original solution to output three-scale masks, denoted as $M_1$ , $M_2$ , and $M_3$ , respectively. On top of this, we adopt two learnable mask weights, $w_1$ , $w_2$ , and calculate the final mask output by a weighted summation as
+
+$$
+M = w _ {1} \cdot M _ {1} + w _ {2} \cdot M _ {2} + (1 - w _ {1} - w _ {2}) \cdot M _ {3}, \tag {11}
+$$
+
+where $w_{1}, w_{2}$ are both initialized as $1/3$ . To learn the optimal weights, we conduct one-shot fine-tuning on the reference image, and regard the given mask as the ground truth. Note that, we freeze the entire SAM model to preserve its pre-trained knowledge, and only fine-tune the 2 parameters of $w_{1}, w_{2}$ within 10 seconds on a single A100 GPU. In this way, our PerSAM-F efficiently learns the scale-aware semantics of objects, and adaptively outputs the best segmentation scale for different concepts, improving the generalization capacity of PerSAM.
+
+# 2.4 PERSAM-ASSISTED DREAMBOOTH
+
+For personalized text-to-image synthesis, DreamBooth (Ruiz et al., 2022) fine-tunes a pre-trained diffusion model by the given $3\sim 5$ photos of a specific object, i.e., a pet cat. It learns to generate the cat referred to by a text prompt, "a [V] cat", and calculates the loss over the entire reconstructed images. This This would inject the redundant background information in the training images into the identifier [V]. Therefore, as shown in Figure 7, we introduce our strategy to alleviate the disturbance of backgrounds in DreamBooth. Given an object mask for any of the few-shot images, we leverage our PerSAM to segment all the foreground targets, and discard the gradient back-propagation for pixels belonging to the background area. Then, the Stable Diffusion is only fine-tuned to memorize the visual appearances of the target object. With no supervision imposed on the background, our PerSAM-assisted DreamBooth can not only synthesize the target object with better visual correspondence, but also increase the diversity of the new backgrounds guided by the input text prompt.
+
+Table 1: Personalized Object Segmentation on the PerSeg Dataset. We compare the overall mIoU, bIoU, and learnable parameters for different methods (Bar et al., 2022; Wang et al., 2022; Zou et al., 2023), along with the mIoU for 10 objects in PerSeg. \* denotes works concurrent to ours.
+
+
Method
mIoU
bIoU
Param.
Can
Barn
Clock
Cat
Back-pack
Teddy Bear
Duck Toy
Thin Bird
Red Cartoon
Robot Toy
Painter
56.4
42.0
354M
19.1
3.2
42.9
94.1
88.1
93.0
33.3
20.9
98.2
65.0
VP
65.9
25.5
383M
61.2
58.6
59.2
76.6
66.7
79.8
89.9
67.4
81.0
72.4
SEEM*
87.1
55.7
341M
65.4
82.5
72.4
91.1
94.1
95.2
98.0
71.3
97.0
95.8
SegGPT*
94.3
76.5
354M
96.6
63.8
92.6
94.1
94.4
93.7
97.2
92.6
97.3
96.2
PerSAM
89.3
71.7
0
96.2
38.9
96.2
90.70
95.39
94.6
97.3
93.7
97.0
60.6
PerSAM-F
95.3
77.9
2
96.7
97.5
96.1
92.3
95.5
95.2
97.3
94.0
97.1
96.7
+
+Table 2: Video Object Segmentation on DAVIS 2017 val (Pont-Tuset et al., 2017). We utilize gray color to denote the methods involving in-domain training.
+
+
Method
J&F
J
F
AGSS
67.4
64.9
69.9
AFB-URR
74.6
73.0
76.1
Painter
34.6
28.5
40.8
SEEM
58.9
55.0
62.8
SegGPT
75.6
72.5
78.6
PerSAM
66.9
63.4
70.4
PerSAM-F
76.1
73.2
78.9
+
+Table 3: One-shot Semantic and Part Segmentation on FSS-1000 (Li et al., 2020), LVIS-92 $^i$ (Gupta et al., 2019), PASCAL-Part (Morabia et al., 2020), and PACO-Part (Ramanathan et al., 2023). We report the mIoU scores and utilize gray color to denote the methods involving in-domain training.
+
+
Method
One-shot Semantic Seg.
One-shot Part Seg.
FSS-1000
LVIS-92i
PASCAL-Part
PACO-Part
HSNet
86.5
17.4
32.4
22.6
VAT
90.3
18.5
33.6
23.5
Painter
61.7
10.5
30.4
14.1
SegGPT
85.6
18.6
-
-
PerSAM
81.6
15.6
32.5
22.5
PerSAM-F
86.3
18.4
32.9
22.7
+
+# 2.5 DISCUSSION
+
+Can PerSAM segment multiple Different objects? Yes. If the user indicates three different objects in the reference image, we can also personalize SAM with these three objects, as visualized in Figure 9 for video object segmentation. For a new test image, we first adopt the image encoder to extract its visual feature only once. On top of this, we independently calculate the location confidence maps for the three objects, and then prompt the decoder three times to respectively segment them. As the decoder (50ms) is more lightweight than the encoder (2s), this brings a marginal time cost.
+
+Comparison with Concurrent Works. Some concurrent works, such as SegGPT (Wang et al., 2023) and SEEM (Zou et al., 2023), can also segment objects given one-shot data, i.e., a reference image and a mask. However, our goal is to customize an off-the-shelf generalist (SAM) into a specialist for private use with good efficiency (training-free or 10-second fine-tuning). In contrast, they target generalization capabilities requiring extensive training data optimizing large-scale parameters. Moreover, due to the efficient tuning characters, PerSAM can be regarded as a general extensible framework, acceptable for any image encoder and promptable segmentation models. Therefore, these excellent works and our approach are trying to solve different problems in segmentation fields.
+
+# 3 EXPERIMENT
+
+We first evaluate our approach for personalized segmentation on PerSeg in Section 3.1, along with various existing one-shot segmentation benchmarks in Section 3.2. Then, we illustrate the effectiveness of our PerSAM-assisted DreamBooth in Section 3.3. Finally, we conduct several ablation studies to investigate our designs on PerSeg in Section 3.4.
+
+# 3.1 PERSONALIZED EVALUATION
+
+PerSeg Dataset. To test the personalization capacity, we construct a new segmentation dataset, termed PerSeg. The raw images are collected from the training data of subject-driven diffusion works (Ruiz et al., 2022; Gal et al., 2022; Kumari et al., 2022). PerSeg contains 40 objects of various
+
+
+The ring on a clock
+
+
+The teapot on a tray
+
+
+The backpack carried by a woman
+
+
+The top part of a can
+
+
+Figure 8: Visualization of PerSAM-F's Improvement. Our scale-aware fine-tuning can well alleviate the scale ambiguity of PerSAM.
+
+
+
+
+
+
+Figure 9: Visualization of Video Object Segmentation. Our approach performs well for segmenting multiple objects in a video.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+categories in total, including daily necessities, animals, and buildings. In different poses or scenes, each object is associated with $5\sim 7$ images and masks, where we fix one image-mask pair as the user-provided one-shot data. The mIoU and bIoU (Cheng et al., 2021a) are adopted for evaluation.
+
+Performance. In Table 1, we observe the fine-tuned PerSAM-F achieves the best results, which effectively enhances PerSAM by $+2.7\%$ and $+5.9\%$ overall mIoU and bIoU. We show more visualization of PerSAM-F's improvement in Figure 8. Visual Prompting (VP) (Bar et al., 2022), Painter (Wang et al., 2022), SEEM (Zou et al., 2023), and SegGPT (Wang et al., 2023) are in-context learners that can also segment objects according to the given one-shot prompt data. As shown, the training-free PerSAM can already achieve better performance than Painter, VP, and SEEM with different margins. By the efficient 2-parameter fine-tuning, our PerSAM-F further surpasses the powerful SegGPT by $+2.4\%$ and $+4.1\%$ overall mIoU and bIoU. As analyzed in Section 2.5, different from their motivations, our method is specially designed for personalized object segmentation, and exhibits much more efficiency in both time and computational resources.
+
+# 3.2 EXISTING SEGMENTATION BENCHMARKS
+
+Video Object Segmentation. Given the first-frame image and object masks, our PerSAM and PerSAM-F achieve competitive object segmentation and tracking performance on the validation set of DAVIS 2017 (Pont-Tuset et al., 2017) As shown in Table 2, compared to methods without video training, the training-free PerSAM largely surpasses Painter by $+32.3\%$ $\mathcal{J}\& \mathcal{F}$ score, and our PerSAM-F can achieve $+0.5\%$ better performance than SegGPT. Notably, our one-shot fine-tuning approach can outperform methods (Lin et al., 2019; Liang et al., 2020) fully trained by extensive video data. The results fully illustrate our strong generalization ability for temporal video data and complex scenarios, which contain multiple similar or occluded objects, as visualized in Figure 9.
+
+One-shot Semantic and Part Segmentation. In Table 3, we evaluate our approach for one-shot image segmentation respectively on four datasets, FSS-1000 (Li et al., 2020), LVIS-92 $^i$ (Gupta et al., 2019), PASCAL-Part (Morabia et al., 2020), and PACO-Part (Ramanathan et al., 2023), where we follow (Liu et al., 2023b) for data pre-processing and evaluation. As shown, our PerSAM-F attains consistently better results than Painter, and performs comparably to SegGPT. For models (Min et al., 2021; Hong et al., 2022) with in-domain training, our approach can achieve higher scores than HSNet. The experiments well demonstrate that, our proposed approach is not limited to object-level segmentation, but also works for category-wise and part-wise personalization of SAM.
+
+# 3.3 PERSAM-ASSISTED DREAMBOOTH
+
+We follow all the hyperparameters in DreamBooth (Ruiz et al., 2022) to fine-tune a pre-trained Stable Diffusion (Rombach et al., 2022) for personalized image synthesis. In addition to Figure 3, we visualize more examples of PerSAM-assisted DreamBooth in Figure 10. For the dog lying on a grey sofa, the "jungle" and "snow" by DreamBooth are still the sofa with green and white decorations. Assisted by PerSAM-F, the newly-generated background is totally decoupled with the sofa and well
+
+
+Figure 10: Visualization of PerSAM-guided DreamBooth. The improved DreamBooth (Ruiz et al., 2022) can better preserve the diversity for synthesizing various contexts in new images.
+
+Table 4: Ablation of Main Components in our proposed method.
+
+
Variant
mIoU
Gain
Positive Prior
69.1
-
+ Negative Prior
72.5
+3.4
+ Post-refinement
83.9
+11.4
+ Guided Attention
85.8
+1.9
+ Semantic Prompt
89.3
+3.5
+ Scale Tuning
95.3
+6.0
+
+Table 5: Ablation of Different Fine-tuning Methods.
+
+
Method
Param.
mIoU
PerSAM
0
89.32
Prompt Tuning
12K
76.5
Adapter
196K
78.3
LoRA
293K
90.0
3 Mask Weights
3
92.9
PerSAM-F
2
95.3
+
+Table 6: Ablation of using Box-image as Reference.
+
+
Method
Mask
Box
Painter
56.4
42.0
VP
65.9
38.1
SEEM
87.1
64.9
SegGPT
94.3
36.0
PerSAM
89.3
88.1
PerSAM-F
95.3
94.9
+
+corresponds to the textual prompt. For the barn in front of the mountains, our approach also alleviates the background disturbance to correctly generate the "forest" and "blue sky".
+
+# 3.4 ABLATION STUDY
+
+Main Components. In Table 4, we investigate our different components by starting from a baseline that only adopts the positive location prior. Then, we add the negative point prompt and cascaded post-refinement, enhancing $+3.6\%$ and $+11.4\%$ mIoU, respectively. On top of that, we introduce the high-level target semantics into SAM's decoder for attention guidance and semantic prompting. The resulting $+1.9\%$ and $+3.5\%$ improvements fully indicate their significance. Finally, via the efficient scale-aware fine-tuning, PerSAM-F boosts the score by $+6.0\%$ , demonstrating superior accuracy.
+
+Different Fine-tuning Methods. In Table 5, we experiment with other parameter-efficient fine-tuning (PEFT) methods for PerSAM-F, i.e., prompt tuning (Liu et al., 2021), Adapter (Houlsby et al., 2019), and LoRA (Hu et al., 2021). We freeze the entire SAM, and only tune the PEFT modules injected into every transformer block in PerSAM's decoder. As shown, the prompt tuning and Adapter would over-fit the one-shot data and severely degrade the accuracy. Instead, our scale-aware fine-tuning can best improve the performance of PerSAM, while tuning the least learnable parameters.
+
+Using Box-image as Reference. Requiring an accurate mask as one-shot data might be too strict for some users. In Table 6, we relax the input restrictions to a bounding box designating the expected object. For our method, we can regard the box as a prompt and utilize off-the-shelf SAM to generate the one-shot mask. Therefore, the box reference only leads to a marginal performance drop in PerSAM and PerSAM-F, but severely influences other methods.
+
+# 4 CONCLUSION
+
+In this paper, we propose to personalize Segment Anything Model (SAM) for specific visual concepts with only one-shot data. Firstly, we introduce PerSAM, which injects high-level target semantics into SAM with training-free techniques. On top of this, we present a scale-aware fine-tuning variant, PerSAM-F. With only 2 learnable parameters, PerSAM-F effectively alleviates the ambiguity of mask scales and achieves leading performance on various benchmarks. Besides, we also verify the efficacy of our approach to assist DreamBooth in fine-tuning better text-to-image diffusion models. We hope our work may expand the applicability of SAM to a wider range of scenarios.
+
+# 5 ACKNOWLEDGEMENT
+
+This work is partially supported by the National Key R&D Program of China (NO.2022ZD0161100), the National Natural Science Foundation of China (No.62206272), the Centre for Perceptual and Interactive Intelligence (CPII) Ltd under the Innovation and Technology Commission (ITC)'s InnoHK, and General Research Fund of Hong Kong RGC Project 14204021. Hongsheng Li is a PI of CPII under the InnoHK.
+
+# REFERENCES
+
+Grounded-segment-anything. https://github.com/IDEA-Research/ Grounded-Segment-Anything, 2023.
+Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(12):2481-2495, 2017.
+Yanqi Bao, Kechen Song, Jie Wang, Liming Huang, Hongwen Dong, and Yunhui Yan. Visible and thermal images fusion architecture for few-shot semantic segmentation. Journal of Visual Communication and Image Representation, 80:103306, 2021.
+Amir Bar, Yossi Gandelsman, Trevor Darrell, Amir Globerson, and Alexei Efros. Visual prompting via image inpainting. Advances in Neural Information Processing Systems, 35:25005-25017, 2022.
+Mikołaj Binkowski, Danica J Sutherland, Michael Arbel, and Arthur Gretton. Demystifying mmd gans. arXiv preprint arXiv:1801.01401, 2018.
+Gary Bradski. The opencv library. Dr. Dobb's Journal: Software Tools for the Professional Programmer, 25(11):120-123, 2000.
+Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020.
+Jiazhong Cen, Zanwei Zhou, Jiemin Fang, Wei Shen, Lingxi Xie, Xiaopeng Zhang, and Qi Tian. Segment anything in 3d with nerfs. arXiv preprint arXiv:2304.12308, 2023.
+Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4):834-848, 2017.
+Xi Chen, Zhiyan Zhao, Feiwu Yu, Yilei Zhang, and Manni Duan. Conditional diffusion for interactive segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 7345-7354, 2021.
+Zhe Chen, Yuchen Duan, Wenhai Wang, Junjun He, Tong Lu, Jifeng Dai, and Yu Qiao. Vision transformer adapter for dense predictions. arXiv preprint arXiv:2205.08534, 2022.
+Bowen Cheng, Ross Girshick, Piotr Dálár, Alexander C Berg, and Alexander Kirillov. Boundary iou: Improving object-centric image segmentation evaluation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15334-15342, 2021a.
+Bowen Cheng, Alex Schwing, and Alexander Kirillov. Per-pixel classification is not all you need for semantic segmentation. Advances in Neural Information Processing Systems, 34:17864-17875, 2021b.
+Bowen Cheng, Ishan Misra, Alexander G Schwing, Alexander Kirillov, and Rohit Girdhar. Masked-attention mask transformer for universal image segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1290–1299, 2022.
+
+Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3213-3223, 2016.
+Pedro Cuenca and Sayak Paul. Using lora for efficient stable diffusion fine-tuning. https://huggingface.co/blog/lora, January 2023.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
+Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H Bermano, Gal Chechik, and Daniel Cohen-Or. An image is worth one word: Personalizing text-to-image generation using textual inversion. arXiv preprint arXiv:2208.01618, 2022.
+Peng Gao, Renrui Zhang, Chris Liu, Longtian Qiu, Siyuan Huang, Weifeng Lin, Shitian Zhao, Shijie Geng, Ziyi Lin, Peng Jin, et al. *Sphinx-x: Scaling data and parameters for a family of multi-modal large language models.* arXiv preprint arXiv:2402.05935, 2024.
+Ziyu Guo, Renrui Zhang, Xiangyang Zhu, Yiwen Tang, Xianzheng Ma, Jiaming Han, Kexin Chen, Peng Gao, Xianzhi Li, Hongsheng Li, et al. Point-bind & point-llm: Aligning point cloud with multi-modality for 3d understanding, generation, and instruction following. arXiv preprint arXiv:2309.00615, 2023.
+Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5356-5364, 2019.
+Qishen Ha, Kohei Watanabe, Takumi Karasawa, Yoshitaka Ushiku, and Tatsuya Harada. Mfnet: Towards real-time semantic segmentation for autonomous vehicles with multi-spectral scenes. In 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 5108-5115. IEEE, 2017.
+Jiaming Han, Renrui Zhang, Wenqi Shao, Peng Gao, Peng Xu, Han Xiao, Kaipeng Zhang, Chris Liu, Song Wen, Ziyu Guo, et al. Imagebind-llm: Multi-modality instruction tuning. arXiv preprint arXiv:2309.03905, 2023.
+Yuying Hao, Yi Liu, Zewu Wu, Lin Han, Yizhou Chen, Guowei Chen, Lutao Chu, Shiyu Tang, Zhiliang Yu, Zeyu Chen, et al. Edgeflow: Achieving practical interactive segmentation with edge-guided flow. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1551-1560, 2021.
+Adam W Harley, Zhaoyuan Fang, and Katerina Fragkiadaki. Particle video revisited: Tracking through occlusions using point trajectories. In European Conference on Computer Vision, pp. 59-75. Springer, 2022.
+Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Towards a unified view of parameter-efficient transfer learning. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=ORDcd5Axok.
+Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 2961-2969, 2017.
+Lukas Hedegaard, Aman Alok, Juby Jose, and Alexandros Iosifidis. Structured pruning adapters. arXiv preprint arXiv:2211.10155, 2022.
+Jack Hessel, Ari Holtzman, Maxwell Forbes, Ronan Le Bras, and Yejin Choi. Clipscore: A reference-free evaluation metric for image captioning. arXiv preprint arXiv:2104.08718, 2021.
+
+Sunghwan Hong, Seokju Cho, Jisu Nam, Stephen Lin, and Seungryong Kim. Cost aggregation with 4d convolutional swim transformer for few-shot segmentation. In European Conference on Computer Vision, pp. 108-126. Springer, 2022.
+Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pp. 2790-2799. PMLR, 2019.
+Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021.
+Yuhao Huang, Xin Yang, Lian Liu, Han Zhou, Ao Chang, Xinrui Zhou, Rusi Chen, Junxuan Yu, Jiongquan Chen, Chaoyu Chen, et al. Segment anything model for medical images? arXiv preprint arXiv:2304.14660, 2023.
+Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning, pp. 4904-4916. PMLR, 2021.
+Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In European Conference on Computer Vision, pp. 709-727. Springer, 2022.
+Zhengkai Jiang, Yuxi Li, Ceyuan Yang, Peng Gao, Yabiao Wang, Ying Tai, and Chengjie Wang. Prototypical contrast adaptation for domain adaptive semantic segmentation. In European Conference on Computer Vision, pp. 36-54. Springer, 2022.
+Zhengkai Jiang, Zhangxuan Gu, Jinlong Peng, Hang Zhou, Liang Liu, Yabiao Wang, Ying Tai, Chengjie Wang, and Liqing Zhang. Stc: spatio-temporal contrastive learning for video instance segmentation. In European Conference on Computer Vision Workshops, pp. 539-556. Springer, 2023.
+Lei Ke, Mingqiao Ye, Martin Danelljan, Yifan Liu, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu. Segment anything in high quality. arXiv preprint arXiv:2306.01567, 2023.
+Alexander Kirillov, Kaiming He, Ross Girshick, Carsten Rother, and Piotr Dólár. Panoptic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9404-9413, 2019.
+Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643, 2023.
+Nupur Kumari, Bingliang Zhang, Richard Zhang, Eli Shechtman, and Jun-Yan Zhu. Multi-concept customization of text-to-image diffusion. arXiv preprint arXiv:2212.04488, 2022.
+Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021.
+Hao Li, Jinguo Zhu, Xiaohu Jiang, Xizhou Zhu, Hongsheng Li, Chun Yuan, Xiaohua Wang, Yu Qiao, Xiaogang Wang, Wenhai Wang, et al. Uni-perceiver v2: A generalist model for large-scale vision and vision-language tasks. arXiv preprint arXiv:2211.09808, 2022.
+Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pretraining with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023.
+Xiang Li, Tianhan Wei, Yau Pun Chen, Yu-Wing Tai, and Chi-Keung Tang. Fss-1000: A 1000-class dataset for few-shot segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2869-2878, 2020.
+
+Yanwei Li, Xinze Chen, Zheng Zhu, Lingxi Xie, Guan Huang, Dalong Du, and Xingang Wang. Attention-guided unified network for panoptic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7026-7035, 2019.
+Feng Liang, Bichen Wu, Xiaoliang Dai, Kunpeng Li, Yinan Zhao, Hang Zhang, Peizhao Zhang, Peter Vajda, and Diana Marculescu. Open-vocabulary semantic segmentation with mask-adapted clip. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7061-7070, 2023.
+Yongqing Liang, Xin Li, Nvid Jafari, and Jim Chen. Video object segmentation with adaptive feature bank and uncertain-region refinement. Advances in Neural Information Processing Systems, 33: 3430-3441, 2020.
+Huaijia Lin, Xiaojuan Qi, and Jiaya Jia. Agss-vos: Attention guided single-shot video object segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3949-3957, 2019.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740-755. Springer, 2014.
+Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980-2988, 2017.
+Zhaojiang Lin, Andrea Madotto, and Pascale Fung. Exploring versatile generative language model via parameter-efficient transfer learning. arXiv preprint arXiv:2004.03829, 2020.
+Ziyi Lin, Shijie Geng, Renrui Zhang, Peng Gao, Gerard de Melo, Xiaogang Wang, Jifeng Dai, Yu Qiao, and Hongsheng Li. Frozen clip models are efficient video learners. In European Conference on Computer Vision, pp. 388-404. Springer, 2022.
+Ziyi Lin, Chris Liu, Renrui Zhang, Peng Gao, Longtian Qiu, Han Xiao, Han Qiu, Chen Lin, Wenqi Shao, Keqin Chen, et al. Sphinx: The joint mixing of weights, tasks, and visual embeddings for multi-modal large language models. arXiv preprint arXiv:2311.07575, 2023.
+Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Chunyuan Li, Jianwei Yang, Hang Su, Jun Zhu, et al. Grounding dino: Marrying dino with grounded pre-training for open-set object detection. arXiv preprint arXiv:2303.05499, 2023a.
+Xiao Liu, Kaixuan Ji, Yicheng Fu, Weng Lam Tam, Zhengxiao Du, Zhilin Yang, and Jie Tang. P-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. arXiv preprint arXiv:2110.07602, 2021.
+Yang Liu, Muzhi Zhu, Hengtao Li, Hao Chen, Xinlong Wang, and Chunhua Shen. Matcher: Segment anything with one shot using all-purpose feature matching. arXiv preprint arXiv:2305.13310, 2023b.
+Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3431-3440, 2015.
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
+Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in Neural Information Processing Systems (NeurIPS), pp. 13-23, 2019.
+Jun Ma and Bo Wang. Segment anything in medical images. arXiv preprint arXiv:2304.12306, 2023.
+
+Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. Communications of the ACM, 65(1):99-106, 2021.
+Fausto Miletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 2016 fourth international conference on 3D vision (3DV), pp. 565-571. IEEE, 2016.
+Juhong Min, Dahyun Kang, and Minsu Cho. Hypercorrelation squeeze for few-shot segmentation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 6941-6952, 2021.
+Keval Morabia, Jatin Arora, and Tara Vijaykumar. Attention-based joint detection of object and semantic part. arXiv preprint arXiv:2007.02419, 2020.
+Khoi Nguyen and Sinisa Todorovic. Feature weighting and boosting for few-shot segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 622-631, 2019.
+OpenAI. Gpt-4 technical report. ArXiv, abs/2303.08774, 2023.
+Maxime Aquab, Timothee Darcet, Théo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023.
+Bohao Peng, Zhuotao Tian, Xiaoyang Wu, Chengyao Wang, Shu Liu, Jingyong Su, and Jiaya Jia. Hierarchical dense correlation distillation for few-shot segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 23641-23651, 2023.
+Jonas Pfeiffer, Aishwarya Kamath, Andreas Rückle, Kyunghyun Cho, and Iryna Gurevych. Adapter-fusion: Non-destructive task composition for transfer learning. arXiv preprint arXiv:2005.00247, 2020.
+Jordi Pont-Tuset, Federico Perazzi, Sergi Caelles, Pablo Arbeláez, Alex Sorkine-Hornung, and Luc Van Gool. The 2017 davis challenge on video object segmentation. arXiv preprint arXiv:1704.00675, 2017.
+Guanghui Qin and Jason Eisner. Learning how to ask: Querying lms with mixtures of soft prompts. arXiv preprint arXiv:2104.06599, 2021.
+Alec Radford and Karthik Narasimhan. Improving language understanding by generative pre-training. 2018.
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748-8763. PMLR, 2021.
+Frano Rajic, Lei Ke, Yu-Wing Tai, Chi-Keung Tang, Martin Danelljan, and Fisher Yu. Segment anything meets point tracking. arXiv preprint arXiv:2307.01197, 2023.
+Vignesh Ramanathan, Anmol Kalia, Vladan Petrovic, Yi Wen, Baixue Zheng, Baishan Guo, Rui Wang, Aaron Marquez, Rama Kovvuri, Abhishek Kadian, et al. Paco: Parts and attributes of common objects. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7141-7151, 2023.
+Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. Advances in Neural information processing systems, 30, 2017.
+Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684-10695, 2022.
+
+Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. arXiv preprint arXiv:2208.12242, 2022.
+Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in Neural Information Processing Systems, 35:36479-36494, 2022.
+Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020a.
+Lin Song, Yanwei Li, Zhengkai Jiang, Zeming Li, Xiangyu Zhang, Hongbin Sun, Jian Sun, and Nanning Zheng. Rethinking learnable tree filter for generic feature transform. Advances in Neural Information Processing Systems, 33:3991-4002, 2020b.
+Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. Vl-adapter: Parameter-efficient transfer learning for vision-and-language tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5227-5237, 2022.
+Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In European Conference on Computer Vision, pp. 282-298. Springer, 2020a.
+Zhuotao Tian, Hengshuang Zhao, Michelle Shu, Zhicheng Yang, Ruiyu Li, and Jiaya Jia. Prior guided feature enrichment network for few-shot segmentation. IEEE transactions on pattern analysis and machine intelligence, 44(2):1050-1065, 2020b.
+Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
+Vishaal Udandarao, Ankush Gupta, and Samuel Albanie. Sus-x: Training-free name-only transfer of vision-language models. arXiv preprint arXiv:2211.16198, 2022.
+Xinlong Wang, Rufeng Zhang, Tao Kong, Lei Li, and Chunhua Shen. Solov2: Dynamic and fast instance segmentation. Advances in Neural information processing systems, 33:17721-17732, 2020.
+Xinlong Wang, Wen Wang, Yue Cao, Chunhua Shen, and Tiejun Huang. Images speak in images: A generalist painter for in-context visual learning. arXiv preprint arXiv:2212.02499, 2022.
+Xinlong Wang, Xiaosong Zhang, Yue Cao, Wen Wang, Chunhua Shen, and Tiejun Huang. Seggpt: Segmenting everything in context. arXiv preprint arXiv:2304.03284, 2023.
+Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. Advances in Neural Information Processing Systems, 34:12077-12090, 2021.
+Mutian Xu, Junhao Zhang, Zhipeng Zhou, Mingye Xu, Xiaojuan Qi, and Yu Qiao. Learning geometry-disentangled representation for complementary understanding of 3d object point cloud. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 3056-3064, 2021.
+Qianxiong Xu, Wenting Zhao, Guosheng Lin, and Cheng Long. Self-calibrated cross attention network for few-shot segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 655-665, 2023.
+Jianwei Yang, Chunyuan Li, Xiyang Dai, and Jianfeng Gao. Focal modulation networks. Advances in Neural Information Processing Systems, 35:4203-4217, 2022.
+Jinyu Yang, Mingqi Gao, Zhe Li, Shang Gao, Fangjing Wang, and Feng Zheng. Track anything: Segment anything meets videos. arXiv preprint arXiv:2304.11968, 2023.
+
+Chaoning Zhang, Dongshen Han, Yu Qiao, Jung Uk Kim, Sung-Ho Bae, Seungkyu Lee, and Choong Seon Hong. Faster segment anything: Towards lightweight sam for mobile applications. arXiv preprint arXiv:2306.14289, 2023a.
+Chi Zhang, Guosheng Lin, Fayao Liu, Jiushuang Guo, Qingyao Wu, and Rui Yao. Pyramid graph networks with connection attentions for region-based one-shot semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9587-9595, 2019.
+Jian-Wei Zhang, Yifan Sun, Yi Yang, and Wei Chen. Feature-proxy transformer for few-shot segmentation. Advances in Neural Information Processing Systems, 35:6575-6588, 2022.
+Qingru Zhang, Minshuo Chen, Alexander Bukharin, Pengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao. Adaptive budget allocation for parameter-efficient fine-tuning. arXiv preprint arXiv:2303.10512, 2023b.
+Renrui Zhang, Rongyao Fang, Peng Gao, Wei Zhang, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li. Tip-adapter: Training-free clip-adapter for better vision-language modeling. arXiv preprint arXiv:2111.03930, 2021.
+Renrui Zhang, Jiaming Han, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Peng Gao, and Yu Qiao. Llama-adapter: Efficient fine-tuning of language models with zero-init attention. arXiv preprint arXiv:2303.16199, 2023c.
+Renrui Zhang, Xiangfei Hu, Bohao Li, Siyuan Huang, Hanqiu Deng, Hongsheng Li, Yu Qiao, and Peng Gao. Prompt, generate, then cache: Cascade of foundation models makes strong few-shot learners. arXiv preprint arXiv:2303.02151, 2023d.
+Renrui Zhang, Dongzhi Jiang, Yichi Zhang, Haokun Lin, Ziyu Guo, Pengshuo Qiu, Aojun Zhou, Pan Lu, Kai-Wei Chang, Peng Gao, et al. Mathverse: Does your multi-modal llm truly see the diagrams in visual math problems? arXiv preprint arXiv:2403.14624, 2024.
+Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2881-2890, 2017.
+Xu Zhao, Wenchao Ding, Yongqi An, Yinglong Du, Tao Yu, Min Li, Ming Tang, and Jinqiao Wang. Fast segment anything. arXiv preprint arXiv:2306.12156, 2023.
+Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6881-6890, 2021.
+Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 130(9):2337-2348, 2022.
+Xueyan Zou, Jianwei Yang, Hao Zhang, Feng Li, Linjie Li, Jianfeng Gao, and Yong Jae Lee. Segment everything everywhere all at once. arXiv preprint arXiv:2304.06718, 2023.
+
+# A OVERVIEW
+
+Section B: Related work.
+- Section C: Experimental details and visualization.
+- Section D: Additional experiments and analysis.
+Section E: Additional discussion.
+
+# B RELATED WORK
+
+Foundation Models. With powerful generalization capacity, pre-trained foundation models can be adapted for various downstream scenarios and attain promising performance. In natural language processing, BERT (Devlin et al., 2018; Lu et al., 2019), GPT series (Brown et al., 2020; OpenAI, 2023; Radford & Narasimhan, 2018; Radford et al., 2019), and LLaMA (Touvron et al., 2023) have demonstrated remarkable in-context learning abilities, and can be extended to multi-modal scenarios (Zhang et al., 2023c; Gao et al., 2024; Lin et al., 2023; Han et al., 2023; Guo et al., 2023; Zhang et al., 2024). Similarly, CLIP (Radford et al., 2021) and ALIGN (Jia et al., 2021), which conduct contrastive learning on image-text pairs, exhibit exceptional accuracy in zero-shot visual recognition. Painter (Wang et al., 2022) introduces a vision model that unifies network architectures and in-context prompts to accomplish diverse vision tasks, without downstream fine-tuning. CaFo (Zhang et al., 2023d) cascades different foundation models and collaborates their pre-trained knowledge for robust low-data image classification. SAM (Kirillov et al., 2023) presents a foundation model for image segmentation, which is pre-trained by 1 billion masks and conducts prompt-based segmentation. There are some concurrent works extending SAM for high-quality segmentation (Ke et al., 2023), faster inference speed (Zhao et al., 2023; Zhang et al., 2023a), all-purpose matching (Liu et al., 2023b), 3D reconstruction (Cen et al., 2023), object tracking (Yang et al., 2023), medical (Ma & Wang, 2023; Huang et al., 2023) image processing. From another perspective, we propose to personalize the segmentation foundation model, i.e., SAM, for specific visual concepts, which adapts a generalist into a specialist with only one shot. Our method can also assist the personalization of text-to-image foundation models, i.e., Stable Diffusion (Rombach et al., 2022) and Imagen (Saharia et al., 2022), which improves the generation quality by segmenting the foreground target objects from the background disturbance.
+
+Large Models in Segmentation. As a fundamental task in computer vision, segmentation (Long et al., 2015; Jiang et al., 2022; Zhao et al., 2017; Xu et al., 2021; Jiang et al., 2023; Lin et al., 2022) requires a pixel-level comprehension of a image. Various segmentation-related tasks have been explored, such as semantic segmentation, classifying each pixel into a predefined set of classes (Badrinarayanan et al., 2017; Chen et al., 2017; Zheng et al., 2021; Cheng et al., 2022; Xie et al., 2021; Song et al., 2020b); instance segmentation, focusing on the identification of individual object instances (He et al., 2017; Wang et al., 2020; Tian et al., 2020a); panoptic segmentation, assigning both class labels and instance identification (Kirillov et al., 2019; Li et al., 2019); and interactive segmentation, involving human intervention for refinement (Hao et al., 2021; Chen et al., 2021). Recently, inspired by language foundation models (Zhang et al., 2023c; Brown et al., 2020), several concurrent works have proposed large-scale vision models for image segmentation. They are pre-trained by extensive mask data and exhibit strong generalization capabilities on numerous image distributions. Segment Anything Model (SAM) (Kirillov et al., 2023) utilizes a data engine with model-in-the-loop annotation to learn a promptable segmentation framework, which generalizes to downstream scenarios in a zero-shot manner. Painter (Wang et al., 2022) and SegGPT (Wang et al., 2023) introduce a robust in-context learning paradigm and can segment any images by a given image-mask prompt. SEEM (Zou et al., 2023) further presents a general segmentation model prompted by multi-modal references, e.g., language and audio, incorporating versatile semantic knowledge. In this study, we introduce a new task termed personalized object segmentation, and annotate a new dataset PerSeg for evaluation. Instead of developing large segmentation models, our goal is to personalize them to segment user-provided objects in any poses or scenes. We propose two approaches, PerSAM and PerSAM-F, which efficiently customize SAM for personalized segmentation.
+
+Parameter-efficient Fine-tuning. Directly tuning the entire foundation models on downstream tasks can be computationally expensive and memory-intensive, posing challenges for resource-
+
+Table 7: Personalized Object Segmentation on the PerSeg Dataset. We report the mIoU scores of 30 objects in addition to the 10 objects in Table 1. \* denotes works concurrent to ours.
+
+
Method
Dog
Dog2
Dog3
Dog4
Dog5
Dog6
Tortoise
+Plushy
Round
+Bird
Colorful
+Sneaker
Colorful
+Teapot
Painter (Wang et al., 2022)
80.41
73.77
46.98
22.39
82.03
76.16
55.31
39.83
0.00
13.69
VP (Bar et al., 2022)
6.80
12.26
23.84
20.61
21.44
32.05
24.42
34.09
30.32
34.89
SEEM* (Zou et al., 2023)
71.04
35.35
67.02
81.87
75.02
72.99
78.75
38.74
20.08
44.44
SegGPT* (Wang et al., 2023)
73.82
65.07
61.11
81.66
82.94
76.44
77.85
82.89
72.24
80.44
PerSAM
96.79
95.66
88.85
95.22
97.10
94.66
93.06
96.79
94.48
96.27
PerSAM-F
96.81
95.79
88.67
95.18
97.22
94.85
97.09
96.85
95.13
84.41
Method
Dog7
Dog8
Candle
Fancy Boot
Sloth Plushie
Poop Emoji
Rc Car
Shiny Sneaker
Wolf Plushie
Wooden Pot
Painter (Wang et al., 2022)
40.97
57.15
24.36
49.06
45.78
23.42
23.69
0.00
38.97
57.61
VP (Bar et al., 2022)
17.67
12.24
12.71
39.13
29.31
37.55
29.98
30.88
28.86
34.30
SEEM* (Zou et al., 2023)
63.77
70.34
26.99
34.90
81.46
45.55
34.94
82.30
76.27
74.81
SegGPT* (Wang et al., 2023)
66.20
82.21
81.60
76.06
80.54
81.32
79.26
85.26
72.48
78.00
PerSAM
93.69
95.34
74.16
95.87
96.37
96.01
39.30
97.00
94.34
97.42
PerSAM-F
93.77
95.61
96.75
95.96
96.64
96.43
96.12
96.87
94.32
97.43
Method
Table
Teapot
Chair
Elephant
Duck Toy
Monster Toy
Dog Pack
Bear Plushie
Berry Bowl
Cat Statue
Painter (Wang et al., 2022)
16.92
7.00
50.09
40.80
29.24
34.80
40.73
81.30
45.98
19.96
VP (Bar et al., 2022)
16.00
10.00
27.20
22.01
52.14
30.92
22.80
23.95
11.32
27.54
SEEM* (Zou et al., 2023)
30.15
12.30
66.15
46.64
89.92
41.49
66.83
61.27
38.29
24.27
SegGPT* (Wang et al., 2023)
81.95
89.89
78.97
80.38
84.48
83.33
77.53
75.54
73.00
76.54
PerSAM
94.68
40.02
92.22
96.05
97.31
93.75
95.85
89.28
91.81
95.42
PerSAM-F
94.66
96.93
92.14
96.07
97.31
94.21
95.76
95.32
91.27
95.46
+
+constrained applications. To address this issue, recent works have focused on developing parameter-efficient methods (Sung et al., 2022; He et al., 2022; Rebuffi et al., 2017; Qin & Eisner, 2021) to freeze the weights of foundation models and append small-scale modules for fine-tuning. Prompt tuning (Lester et al., 2021; Zhou et al., 2022; Jia et al., 2022; Liu et al., 2021) suggests using learnable soft prompts alongside frozen models to perform specific downstream tasks, achieving more competitive performance with scale and robust domain transfer compared to full model tuning. Low-Rank Adaption (LoRA) (Hu et al., 2021; Cuenca & Paul, 2023; Zhang et al., 2023b; Hedegaard et al., 2022) injects trainable rank decomposition matrices concurrently to each pre-trained weight, which significantly reduces the number of learnable parameters required for downstream tasks. Adapters (Houlsby et al., 2019; Pfeiffer et al., 2020; Lin et al., 2020; Chen et al., 2022) are designed to be inserted between layers of the original transformer, introducing lightweight MLPs for feature transformation. Different from existing works, we adopt a more efficient adaption method delicately designed for SAM, i.e., the scale-aware fine-tuning of PerSAM-F with only 2 parameters and 10 seconds. This effectively avoids the over-fitting issue on one-shot data, and alleviates the ambiguity of segmentation scale with superior performance.
+
+# C EXPERIMENTAL DETAILS AND VISUALIZATION
+
+# C.1 PERSONALIZED EVALUATION
+
+Implementation Details. We adopt a pre-trained SAM (Kirillov et al., 2023) with a ViT-H (Dosovitskiy et al., 2020) backbone as the foundation model, and utilize SAM's encoder to calculate the location confidence map. For PerSAM, we apply the target-guided attention and target-semantic prompting to all three blocks in the decoder. The balance factor $\alpha$ in Equation 8 is set as 1. For PerSAM-F, we conduct one-shot training for 1,000 epochs with a batch size 1, supervised by the dice loss (Milletari et al., 2016) and focal loss (Lin et al., 2017). We set the initial learning rate as $10^{-3}$ , and adopt an AdamW (Loshchilov & Hutter, 2017) optimizer with a cosine scheduler.
+
+Complete Results on the PerSeg Dataset. In Table 7, we report the mIoU scores of the other 30 objects in the PerSeg dataset, except for the 10 objects in Table (1) of the main paper. As compared, our PerSAM without any training can achieve superior segmentation results to Painter (Wang et al.,
+
+2022), Visual Prompting (VP) (Bar et al., 2022), and SEEM (Zou et al., 2023) on most objects. Note that, we here compare the results of SEEM with the Focal-L (Yang et al., 2022) vision backbone, its best-performing variant. Aided by the 2-parameter fine-tuning, PerSAM-F further performs comparably with SegGPT (Wang et al., 2023), a powerful in-context segmentation framework. Therefore, our approach exhibits a high performance-efficiency trade-off by efficiently customizing the off-the-shelf SAM (Kirillov et al., 2023) for personalized object segmentation.
+
+Visualization. In Figure 11, we visualize the location confidence maps, segmentation results of PerSAM with positive-negative location prior, and the bounding boxes from the cascaded post-refinement. As shown, the confidence map (hotter colors indicate higher scores) can clearly indicate the rough region of the target object in the image, which contributes to precise foreground (green pentagram) and background (red pentagram) point prompts selection. The bounding boxes in green also well enclose the targets and prompt SAM's decoder for accurate post-refinement.
+
+# C.2 EXISTING SEGMENTATION BENCHMARKS
+
+Implementation Details. For experiments in existing segmentation datasets, we utilize DINOv2 (Oquab et al., 2023) as the image encoder to calculate the location confidence map, which produces a more accurate location prior. Note that, the generality and extensibility of our approach enable us to apply any vision backbones for location confidence map calculation. For video object segmentation, different from PerSeg, where one image contains only one object, DAVIS 2017 dataset (Pont-Tuset et al., 2017) requires to personalize SAM to track and segment multiple different objects across the video frames. In PerSAM, we regard the top-2 highest-confidence points as the positive location prior, and additionally utilize the bounding boxes from the last frame to prompt the decoder. This provides more sufficient temporal cues for object tracking and segmentation. In PerSAM-F, we conduct one-shot fine-tuning on the first frame for 800 epochs with a learning rate $4^{-4}$ . As discussed in Section 2.5, for $N$ objects, we only need to run SAM's large-scale encoder (2s) once to encode the visual feature of the new frame, while running the lightweight decoder for $N$ times to segment different objects, which takes marginal $50Nms$ . For one-shot semantic segmentation, we evaluate our method on FSS-1000 (Li et al., 2020) following HSNet (Min et al., 2021) and LVIS-92 $^i$ (Gupta et al., 2019) pre-processed by (Liu et al., 2023b). The benchmark contains objects in a wide range of semantic categories within various backgrounds. For one-shot part segmentation, we utilize the part-level benchmarks of PASCAL VOC (Morabia et al., 2020) and PACO (Ramanathan et al., 2023) built by (Liu et al., 2023b), requiring to segment partial objects with challenging scenarios.
+
+Visualization. In Figure 12, we visualize more results of PerSAM-F for multi-object tracking and segmentation in consecutive frames of the DAVIS 2017 dataset. We utilize different colors to denote different objects, along with the additional prompts for SAM's decoder, including a bounding box from the last frame and its center point. Aided by our techniques and the last-frame temporal cues, PerSAM-F exhibits favorable video segmentation performance and tracking consistency, even for objects occluded by others or objects of the same category with similar appearances. In Figure 13, we also visualize the results of PerSAM-F for one-shot semantic and part segmentation on four datasets. The satisfactory performance illustrates that our approach is not limited to object-level personalization, but also part- and category-wise segmentation with good generalization capability.
+
+# C.3 PERSAM-ASSISTED DREAMBOOTH
+
+Implementation Details. We follow most model hyperparameters and training configurations in DreamBooth (Ruiz et al., 2022), including a $10^{-6}$ learning rate and a batch size 1. We generate a 200-image regularization dataset by the pre-trained Stable Diffusion (Rombach et al., 2022) using the textual prompt: "photo of a [CLASS]". We fine-tune DreamBooth and our approach both for 1,000 iterations on a single A100 GPU, and adopt 't@y' as the word identifier [V] for the personal visual concepts. We utilize DDIM (Song et al., 2020a) sampling with 100 steps and a 10-scale classifier-free guidance for generation.
+
+Quantitative Evaluation. Besides visualization, we also evaluate the PerSAM-assisted Dream-Booth by three quantitative metrics in Table 19. We leverage CLIP (Radford et al., 2021) to calculate
+
+
+Figure 11: Visualization of Location Confidence Maps and PerSAM's Segmentation Results. We represent the positive (foreground) and negative (background) location prior by green and red pentagrams. The green bounding boxes denote the box prompts in the cascaded post-refinement.
+
+the feature similarity of generated images with textual prompts ('Text-Align') and reference images ('Image-Align') (Kumari et al., 2022), along with KID (Bińkowski et al., 2018) (the smaller, the better). 'Text-Align' (Gal et al., 2022) and 'Image-Align' (Hessel et al., 2021) indicate the semantic correspondence of the synthesized images with the textual prompt and few-shot reference images, respectively. KID (Bińkowski et al., 2018) measures how much the fine-tuned models over-fit the specific visual concepts in few-shot images, for which we utilize Stable Diffusion to generate 500 images as the validation set. These quantitative results demonstrate our effectiveness in generating better visual correspondence with the target objects and input prompts.
+
+Visualization. In Figure 14, we visualize more examples that demonstrate our effectiveness to enhance DreamBooth for higher-fidelity personalized synthesis. We utilize PerSAM-F to decouple the table and plushy tortoise from their backgrounds in the few-shot images, i.e., the couch and
+
+
+Figure 12: Visualization of PerSAM-F for Video Object Segmentation on the DAVIS 2017 (Pont-Tuset et al., 2017) dataset. We represent different objects in different colors, and visualize the input prompts for SAM's decoder: a positive location prior (pentagram), an enclosing bounding box from the last frame, and its center point (dot).
+
+
+Figure 13: Visualization of PerSAM-F for One-shot Semantic and Part Segmentation on FSS-1000 (Li et al., 2020) and PASCAL-Part (Morabia et al., 2020) datasets. Our approach exhibits superior generalization capabilities for diverse segmentation scenarios.
+
+carpet. In this way, the PerSAM-assisted DreamBooth generates new backgrounds corresponding to the textual prompts of "in the garden", "and an orange sofa", "on the grass", and "swimming in a pool". In addition, our approach can boost the appearance generation of target objects with high text-image correspondence, while the vanilla DreamBooth might be interfered by textual prompts, e.g., the orange on the table and the blue on the turtle shell. The experiments fully verify our efficacy for better personalizing text-to-image models.
+
+
+Figure 14: Visualization of PerSAM-assisted DreamBooth. Our approach can alleviate the background disturbance, and boost DreamBooth (Ruiz et al., 2022) for better personalized synthesis.
+
+# D ADDITIONAL EXPERIMENTS AND ANALYSIS
+
+# D.1 EVALUATION ON ADDITIONAL BENCHMARKS
+
+COCO-20 $^i$ (Nguyen & Todorovic, 2019). Constructed from MSCOCO (Lin et al., 2014), COCO-20 $^i$ divides the diverse 80 classes evenly into 4 folds for one-shot semantic segmentation. We directly test our method on the validation set without specific in-domain training. As shown in Table 8, our PerSAM(-F) achieves favorable segmentation performance over a wide range of object categories, comparable to previous in-domain methods, i.e., FPTrans (Zhang et al., 2022), SCCAN (Xu et al., 2023), and HDMNet (Peng et al., 2023).
+
+Tokyo Multi-Spectral-4 $^i$ (Bao et al., 2021). Sampled from Tokyo Multi-Spectral (Ha et al., 2017), Tokyo Multi-Spectral-4 $^i$ contains 16 classes within outdoor city scenes, similar to CityScapes (Cordts
+
+Table 8: One-shot segmentation on COCO-20² (Nguyen & Todorovic, 2019).
+
+
Method
In-domain Train
mIoU
FPTrans
✓
47.0
SCCAN
✓
48.2
HDMNet
✓
50.0
PerSAM
-
47.9
PerSAM-F
-
50.6
+
+Table 9: One-shot segmentation on Tokyo Multi-Spectral-4 $^i$ (Bao et al., 2021).
+
+
Method
In-domain Train
mIoU
PFENet
✓
14.0
PGNet
✓
17.5
V-TFSS
✓
26.1
PerSAM
-
18.4
PerSAM-F
-
25.6
+
+Table 10: Comparison with two text-guided models: OVSeg (Liang et al., 2023) and Grounded-SAM (gro, 2023).
+
+
Method
Prompt
PerSeg
COCO-20i
OVSeg
Category Name
76.5
37.8
Grounded-SAM
Category Name
93.2
51.3
PerSAM
One-shot Data
89.3
47.9
PerSAM-F
One-shot Data
95.3
50.6
+
+Table 11: Running Efficiency compared to SAM (Kirillov et al., 2023).
+
+
Method
FPS↑
Memory (MB)↓
SAM
2.16
5731
PerSAM
2.08
5788
PerSAM-F
1.98
5832
+
+Table 12: Comparison with SAM-PT (Rajic et al., 2023) on DAVIS 2017 (Pont-Tuset et al., 2017).
+
+
Method
Propagation
J&F
SAM-PT
Point Tracking
76.6
PerSAM
Feature Matching
66.9
PerSAM
+Point Tracking
68.2
PerSAM-F
Feature Matching
76.1
PerSAM-F
+Point Tracking
77.2
+
+et al., 2016). Different from existing methods, we only take as input the RGB images without the paired thermal data, and do not conduct in-domain training. As shown in Table 9, our approach still exhibits good generalization capacity in street scenarios, compared to the specialist models: PFENet (Tian et al., 2020b), PGNet (Zhang et al., 2019), and V-TFSS (Bao et al., 2021).
+
+# D.2 COMPARISON TO ADDITIONAL METHODS
+
+Text-guided Segmenters. Recently, open-world segmentation models guided by text prompts have driven increasing attention. To compare our approach with them, we select two popular methods: OVSeg (Liang et al., 2023) and Grounded-SAM (gro, 2023). OVSeg leverages MaskFormer (Cheng et al., 2021b) to first generate class-agnostic mask proposals, and then adopts a fine-tuned CLIP for zero-shot classification. Grounded-SAM utilizes a powerful text-guided detector, Grounding DINO (Liu et al., 2023a), to generate object bounding boxes, and then utilize them to prompt SAM for segmentation. Instead of giving a one-shot reference, we directly prompt them by the category name of the target object for text-guided segmentation, e.g., "cat", "dog", or "chair". As shown in Table 10, our PerSAM-F consistently achieves competitive results on two different datasets: PerSeg and COCO- $20^{i}$ . This indicates that, utilizing PerSAM with a class-agnostic one-shot reference is on par with recognizing the category and then segmenting it with text-guided methods.
+
+SAM-PT (Rajic et al., 2023). Although both our PerSAM(-F) and the concurrent SAM-PT are developed based on SAM, our approach can be generalized to most one-shot segmentation tasks (personalized/video/semantic/part segmentation), while SAM-PT specifically aims at video object segmentation. One key difference between our approach and SAM-PT is how to locate and associate
+
+Table 13: Few-shot segmentation on the PerSeg dataset.
+
+
Method
Shot
mIoU
bIoU
SegGPT
1-shot
94.3
76.5
SegGPT
3-shot
96.7
78.4
PerSAM
1-shot
89.3
71.7
PerSAM
3-shot
90.2
73.6
PerSAM-F
1-shot
95.3
77.9
PerSAM-F
3-shot
97.4
79.1
+
+Table 14: Few-shot segmentation on FSS-1000 (Li et al., 2020) benchmark.
+
+
Method
Shot
mIoU
SegGPT
1-shot
85.6
SegGPT
5-shot
89.3
PerSAM
1-shot
81.6
PerSAM
5-shot
82.3
PerSAM-F
1-shot
86.3
PerSAM-F
5-shot
89.8
+
+Table 15: Different pre-trained encoders for obtaining the positive-negative location prior.
+
+
Method
Encoder
DAVIS 2017
FSS-1000
LVIS-92i
PASCAL-Part
PACO-Part
Painter
-
34.6
61.7
10.5
30.4
14.1
SegGPT
-
75.6
85.6
18.6
-
-
PerSAM
SAM
62.8
74.9
12.9
31.3
21.2
PerSAM
DINOv2
66.9
81.6
15.6
32.5
22.5
PerSAM-F
SAM
73.4
79.4
16.2
32.0
21.3
PerSAM-F
DINOv2
76.1
86.3
18.4
32.9
22.7
+
+objects from the previous to the current frame, i.e., propagating the location prompt for SAM across frames. In detail, our PerSAM(-F) simply calculates a location confidence map by feature matching, while SAM-PT relies on an external point tracking network, PIPS (Harley et al., 2022). As shown in Table 12, on DAVIS 2017 dataset (Pont-Tuset et al., 2017), SAM-PT performs slightly better than the original PerSAM-F. However, inspired by SAM-PT, we can also incorporate its point tracking strategy (the PIPS tracker) with PerSAM(-F) to propagate the positive-negative point prompt, which effectively enhances the segmentation performance. This demonstrates the flexible extensibility of our approach for applying more advanced trackers in a plug-and-play way.
+
+# D.3 FEW-SHOT SEGMENTATION BY PERSAM
+
+Our approach is not limited to one-shot segmentation, and can accept few-shot references for improved results. As an example, given 3-shot references, we independently calculate 3 location confidence maps for the test image, and adopt a pixel-wise max pooling to obtain the overall location estimation. For PerSAM-F, we regard all 3-shot data as the training set to conduct the scale-aware fine-tuning.
+
+We respectively conduct experiments for 3-shot segmentation on PerSeg dataset and 5-shot segmentation on FSS-1000 dataset (Li et al., 2020). The results are respectively shown in Tables 13 and 14. By providing more visual semantics in few-shot data, both our training-free PerSAM and the fine-tuned PerSAM-F can be further enhanced.
+
+# D.4 ABLATION STUDY
+
+Different Pre-trained Encoders. For video object segmentation in Table 2 and other one-shot segmentation in Table 3, we adopt the DINOv2 (Oquab et al., 2023) encoder to obtain the positive-negative location prior by default. In Table 15, we show the results by using SAM's original image encoder. As DINOv2 is particularly pre-trained by large-scale contrastive data, it produces more discriminative image features than SAM's encoder. This contributes to a more precise positive-negative location prior for better segmentation results, especially on the challenging FSS-1000 dataset (Li et al., 2020). Despite this, with SAM's original encoder, our PerSAM-F and the training-free PerSAM still obtain better segmentation accuracy than Painter (Wang et al., 2022) or SEEM (Zou et al., 2023) on different datasets, demonstrating the effectiveness of our approach.
+
+Table 16: Different Image Encoders of SAM for PerSAM and PerSAM-F.
+
+
Method
Encoder
mIoU
bIoU
PerSAM
ViT-B
63.98
49.30
ViT-L
86.61
69.86
ViT-H
89.32
71.67
PerSAM-F
ViT-B
87.24
69.36
ViT-L
92.24
75.36
ViT-H
95.33
77.92
+
+Table 17: Robustness to Mask Reference. We resize the reference mask by 'erode' and 'dilate' functions in OpenCV (Bradski, 2000).
+
+
Method
Shrink↑↑
Shrink↑
Enlarge↑
Enlarge↑↑
SegGPT
80.39
81.79
83.22
76.43
PerSAM
78.48
81.10
89.32
88.92
PerSAM-F
85.16
88.28
83.19
81.19
+
+Image Encoders of SAM. By default, we adopt a pre-trained ViT-H (Dosovitskiy et al., 2020) in SAM as the image encoder for PerSAM and PerSAM-F. In Table 16, we investigate the performance of other vision backbones for our models, i.e., ViT-B and ViT-L. As shown, stronger image encoders lead to higher segmentation mIoU and bIoU scores. When using ViT-B as the encoder, the accuracy of training-free PerSAM is largely harmed, due to weaker feature encoding ability, while the one-shot training of PerSAM-F can effectively mitigate the gap by $+23.26\%$ mIoU and $+20.06\%$ bIoU scores, which demonstrates the significance of our fine-tuning on top of a weak training-free baseline.
+
+Robustness to the Quality of Mask Reference. For more robust interactivity with humans, we explore how our approach performs if the given mask is of low quality. In Table 17, we respectively shrink and enlarge the area of the reference mask, and compare the results on PerSeg dataset. When the mask is smaller than the target object (shrink), PerSAM-F, aided by one-shot fine-tuning, exhibits the best robustness. In this case, the target embedding cannot incorporate complete visual appearances from the reference image, which largely harms the training-free techniques in PerSAM. When the mask becomes larger (enlarge), the oversize mask would mislead the scale-aware training of PerSAM-F. In contrast, despite some background noises, the target embedding can include all the visual semantics of objects, which, thereby, brings little influence to PerSAM.
+
+# E DISCUSSION
+
+E.1 WHAT'S THE ADDITIONAL RUNNING SPEED/MEMORY COMPARED TO SAM?
+
+We test the additional running consumption of PerSAM and PerSAM-F on a single NVIDIA A100 GPU with batch size 1. As shown in Table 11, our PerSAM and PerSAM-F bring marginal latency and GPU memory consumption over SAM, indicating superior running efficiency.
+
+E.2 HOW TO DIFFERENTIATE SIMILAR OBJECTS IN VIDEO OBJECT SEGMENTATION?
+
+For video object segmentation, our approach tries to accurately locate the target object among similar ones by the following three aspects.
+
+Discriminative Features from the Encoder. Due to large-scale pre-training, the SAM's image encoder, or the more powerful DINOv2, can already produce discriminative visual features for different similar objects, which is fundamental to the calculation of location confidence map.
+
+Comprehensive Location Confidence Map. We calculate a set of confidence maps for all foreground pixels within the target object, such as the head, the body, or the paws of a dog, and then aggregate them to obtain an overall location estimation. This strategy can comprehensively consider the slight differences in any local parts between similar objects.
+
+Temporal Cues between Adjacent Frames. To better leverage the temporal consistency along the video, we prompt SAM's decoder additionally with the object bounding box from the last frame. As different objects have different trajectories, such temporal constraints can better differentiate similar objects by spatial locations.
+
+# One-shot Segmentation in Outdoor Street Scenes
+
+
+One-shot Data
+
+
+
+
+Test Images
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 15: One-shot segmentation of PerSAM-F in outdoor street scenes.
+
+
+
+
+
+
+
+As visualized in Figures 12, our method can precisely segment the dancing man in front of a crowd (the $2^{nd}$ row) and differentiate different fishes within a group (the last row).
+
+# E.3 CAN PERSAM ALSO WORK ON SELF-DRIVING SCENARIOS?
+
+Yes. In most cases, our model can segment the designated cars with distinctive appearances in dense traffic. As visualized in Figure 15, for the user-provided target (e.g., a red car, a truck, and a bus), our PerSAM-F can well locate and segment them under severe occlusion or surrounded by similar cars.
+
+# E.4 FAILURE CASES OF PERSAM-F
+
+After solving the scale ambiguity issue, the three types of failure cases of PerSAM-F are shown in Figure 16: (a) different people with the same clothes, indicating our approach is not very sensitive to fine-grained human faces; (b) the key appearance of the target object is occluded by in test images (the red chest of the bird), indicating that we still need to improve our robustness when there is too large appearance change in test images; (c) discontinuous objects that SAM cannot tackle, for which we can replace SAM with stronger segmentation foundation model for assistance.
+
+# E.5 CAN PERSAM SEGMENT MULTIPLE IDENTICAL OBJECTS IN AN IMAGE?
+
+Yes. As shown in Figure 17, given the one-shot image of a reference cat, if the test image contains two similar cats that are expected to be both segmented, we propose two simple strategies for PerSAM:
+
+
+Failure Cases of PerSAM-F
+Figure 16: Three types of failure cases of PerSAM-F.
+
+
+Table 18: Statistic of Location Confidence Scores for Different Objects in the PerSeg dataset.
+
+Table 19: DreamBooth Assisted by PerSAM with quantitative results. We adopt CLIP (Radford et al., 2021) to calculate the image-text and -image similarity.
+
+
Method
Text-Align
Image-Align
KID (×103)
DreamBooth
0.812
0.793
29.7
+ PerSAM
0.830
0.814
29.2
+ PerSAM-F
0.834
0.818
28.9
+
+Iterative Masking. For two similar cats, we first calculate the location confidence map $S_{1}$ , and utilize PerSAM to segment one of the cats, denoting the obtained mask prediction as $M_{1}$ . Then, we reweigh the confidence map $S_{1}$ by assigning zeros to the area within $M_{1}$ . We denote the masked confidence map as $S_{2}$ . After this, we enable PerSAM's decoder to subsequently segment the second cat and acquire $M_{2}$ . In this way, our approach can iteratively mask the already segmented objects and segment all the expected similar objects, until there is no target in the image.
+
+Confidence Thresholding. How to stop the iteration when there is no other expected object in the image? We introduce a thresholding strategy for adaptive control. As shown by the statistics in Table 18, we count the confidence scores of the positive location prior (the maximum score on the confidence map) for two groups of objects in the PerSeg dataset: 'Same' and 'Different', where we utilize DINOv2 (Oquab et al., 2023) as the image encoder. 'Same' utilizes the same object for reference and test, just like the normal evaluation. 'Different' utilizes one object for reference, but tests on all other 39 objects. We observe the scores in 'Same' are almost all larger than 0.5, while those in 'Different' are lower than 0.4. Therefore, we adopt a simple thresholding strategy to stop the iterative segmentation based on the confidence map with a threshold of 0.45, which can well discriminate different objects or categories for most cases, e.g., segmenting all the cats or dogs in the image shown in Figure 18. In this way, for a test image, if the maximum score in the confidence map is lower than 0.45, there is no more target object in the image and we would stop the iteration.
+
+
+Figure 17: Segmenting Multiple Similar Objects in an Image. We adopt two strategies for PerSAM to simultaneously segment multiple similar objects: iterative masking and confidence thresholding. We denote the positive and negative location prior by green and red pentagrams, respectively.
+
+
+Figure 18: Segmenting Objects of the Same Category. Besides specific visual concepts, our approach can also be personalized by a category, cat or dog, with a confidence thresholding strategy.
+
+# E.6 Is PERSAM-F GENERALIZED ONLY TO A SPECIFIC OBJECT?
+
+Our PerSAM-F can not only be personalized by a specific object, but also generalize to a certain category with the same amount of parameters. As visualized in Figure 13, given a reference cone/armour/crocodile in FSS-1000 dataset (Li et al., 2020), our PerSAM-F can well segment other similar cones/armours/crocodiles in test images. This is because objects of the same category can contain similar hierarchical structures, so the learned scale weights of PerSAM-F by one sample can also be applicable to different objects within the same category. In contrast, for different categories, one needs to fine-tune two sets of scale weights to respectively fit their scale information.
+
+
+Figure 19: Visualization of the Enlarged PerSeg Dataset generated by a fine-tuned Dream-Booth (Ruiz et al., 2022). We show the examples of four objects with three different text prompts: 'A photo of an [OBJECT] in a swimming pool/in Times Square/in front of Eiffel Tower.'
+
+Table 20: Personalized Object Segmentation on the Enlarged PerSeg Dataset with 5x largaer in size. We compare the overall mIoU and bIoU for different methods (Bar et al., 2022; Wang et al., 2022; Zou et al., 2023).
+
+
Method
Painter
SEEM
SegGPT
PerSAM
PerSAM-F
mIoU
43.6
82.8
87.8
85.9
89.6
bIoU
37.5
51.3
69.7
66.2
72.4
+
+# E.7 WILL PERSAM BE CONSTRAINED BY SAM'S LIMITED SEMANTICS BY CLASS-AGNOSTIC TRAINING?
+
+Yes, due to SAM's inherent class-agnostic training, the visual features extracted by SAM's encoder contain limited category-level semantics. This might constrain the category-level discriminative capability for complex multi-object scenes. Observing this limitation, we locate the target object among other objects in test images entirely by feature matching, i.e., the location confidence map. Such a matching strategy only considers the appearance-based class-agnostic similarity, without category semantics. To this end, we can leverage other semantically rich image encoders, e.g., CLIP (Radford et al., 2021) and DINOv2 (Oquab et al., 2023), for PerSAM(-F) to improve the multi-object performance. We conduct an ablation study of different image encoders on DAVIS 2017 dataset (Pont-Tuset et al., 2017) for video object segmentation, which contains multiple similar objects within a video. As shown in Table 15, applying CLIP and DINOv2 with more sufficient semantic knowledge can improve the results of PerSAM-F for more challenging multi-object segmentation.
+
+# E.8 CAN PERSAM HELP DREAMBOOTH ACHIEVE BETTER MULTI-OBJECT CUSTOMIZATION?
+
+Yes. Similar to single-object personalization, we only calculate the loss within foreground regions for DreamBooth (Ruiz et al., 2022) with multi-object training samples. As visualized in Figure 20, we show the improvement for two-object customization assisted by our PerSAM. The backgrounds within images generated by DreamBooth are severely disturbed by those within few-shot training images, while the PerSAM-assisted DreamBooth can accurately synthesize new backgrounds according to the input language prompts.
+
+# E.9 SCALING PERSEG DATASET
+
+Although our newly constructed PerSeg dataset contains different objects in various contexts, it is relatively small in scale compared to existing segmentation benchmarks. For a more robust evaluation, we enlarge the PerSeg dataset (40 objects with $5\sim 7$ images per object) to 30 images per object, $5\mathbf{x}$ larger in scale. We leverage the existing few-shot images to fine-tune DreamBooth (Ruiz et al., 2022) respectively for each object, and then generate new images with diverse backgrounds or poses (swimming pool, Times Square, Eiffel Tower, etc. . .), including richer data examples as shown in Figure 19. We report the segmentation results in Table 20, the scale-aware fine-tuned PerSAM-F still achieves the best performance, and the training-free PerSAM can also surpass Painter and SEEM, demonstrating the superior robustness of our approach.
+
+
+Figure 20: Multi-object generation of PerSAM-assisted DreamBooth (Ruiz et al., 2022).
+
+# E.10 ANY OTHER APPLICATIONS FOR PERSAM?
+
+For CLIP-based (Radford et al., 2021) few-shot image classification, a series of works (Zhang et al., 2021; 2023d; Udandarao et al., 2022) extract the visual features of few-shot images by CLIP, and cache them as category prototypes for downstream adaption of CLIP. However, such prototypes contain the visual noises of the backgrounds that disturb the category semantics. Therefore, our PerSAM is helpful in segmenting the objects of the same category in few-shot images, and enables the CLIP-based methods to cache only foreground informative features. For 3D reconstruction by NeRF (Mildenhall et al., 2021), existing approaches can only lift the objects, which are annotated with multi-view masks, into 3D space. Considering that the multi-view annotation is labor-intensive, our approach provides a solution for NeRF to lift any object in a scene, simply by prompting SAM to segment the object in one view. On top of that, PerSAM can be personalized to generate the masks in all multi-view images, allowing for efficient and flexible 3D reconstruction. We leave these applications as future works.
\ No newline at end of file
diff --git a/personalizesegmentanythingmodelwithoneshot/images.zip b/personalizesegmentanythingmodelwithoneshot/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c9d9fe51d5e76482e875c2f610ae13d3075bf82c
--- /dev/null
+++ b/personalizesegmentanythingmodelwithoneshot/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a6600aff40bff0a87d34411cd4f9fb38b89ca58e62242746bab21e33f65d3203
+size 2165951
diff --git a/personalizesegmentanythingmodelwithoneshot/layout.json b/personalizesegmentanythingmodelwithoneshot/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..e22e1f23e4e0aeb0ea807f236668dff2a40a46b3
--- /dev/null
+++ b/personalizesegmentanythingmodelwithoneshot/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:889b6375191ce4b1840b25f3e24e2df39430d705c21916e95c5b61a2b091dffc
+size 811239
diff --git a/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_content_list.json b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..5f19de76b6232aa706887fff8a5c93aeb384a046
--- /dev/null
+++ b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e56317ef37227ddb001f64d7a714ea23b1a1afc1f1a21a75c914e56cf2d4874
+size 264091
diff --git a/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_model.json b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2d53f049765d7dfae997c294e68018fd37a79a0b
--- /dev/null
+++ b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bfd702e59c0ae10438e5ce7a97445a6c9f16b0bcc725f76a9003b659feed5183
+size 305102
diff --git a/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_origin.pdf b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..282c58ccba36515f9a3f8a968ef8074804e3542c
--- /dev/null
+++ b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/d50c181e-fd55-4da8-a4c8-75ec30f3148c_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:db93a288e3fd7f95f06c257fe8da4d12ebebcf59c55d29c17230017151ef11f3
+size 618640
diff --git a/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/full.md b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..66504d0fcfc1c4348499db45825fa221a6764982
--- /dev/null
+++ b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/full.md
@@ -0,0 +1,1351 @@
+# PESSIMISTIC NONLINEAR LEAST-SQUARES VALUE ITERATION FOR OFFLINE REINFORCEMENT LEARNING
+
+Qiwei Di $^{1}$ , Heyang Zhao $^{1}$ , Jiafan he $^{1}$ , Quanquan Gu $^{1}$
+
+$^{1}$ Department of Computer Science, University of California, Los Angeles
+
+{qiwei2000, hyzhao, jiafanhe19, qgu}@cs.ucla.edu,
+
+# ABSTRACT
+
+Offline reinforcement learning (RL), where the agent aims to learn the optimal policy based on the data collected by a behavior policy, has attracted increasing attention in recent years. While offline RL with linear function approximation has been extensively studied with optimal results achieved under certain assumptions, many works shift their interest to offline RL with non-linear function approximation. However, limited works on offline RL with non-linear function approximation have instance-dependent regret guarantees. In this paper, we propose an oracle-efficient algorithm, dubbed Pessimistic Nonlinear Least-Square Value Iteration (PNLSVI), for offline RL with non-linear function approximation. Our algorithmic design comprises three innovative components: (1) a variance-based weighted regression scheme that can be applied to a wide range of function classes, (2) a subroutine for variance estimation, and (3) a planning phase that utilizes a pessimistic value iteration approach. Our algorithm enjoys a regret bound that has a tight dependency on the function class complexity and achieves minimax optimal instance-dependent regret when specialized to linear function approximation. Our work extends the previous instance-dependent results within simpler function classes, such as linear and differentiable function to a more general framework.
+
+# 1 INTRODUCTION
+
+Offline reinforcement learning (RL), also known as batch RL, is a learning paradigm where an agent learns to make decisions based on a set of pre-collected data, instead of interacting with the environment in real-time like online RL. The goal of offline RL is to learn a policy that performs well in a given task, based on historical data that was collected from an unknown environment. Recent years have witnessed significant progress in developing offline RL algorithms that can leverage large amounts of data to learn effective policies. These algorithms often incorporate powerful function approximation techniques, such as deep neural networks, to generalize across large state-action spaces. They have achieved excellent performances in a wide range of domains, including the games of Go and chess (Silver et al., 2017; Schrittwieser et al., 2020), robotics (Gu et al., 2017; Levine et al., 2018), and control systems (Degrave et al., 2022).
+
+Several works have studied the theoretical guarantees of offline tabular RL and proved near-optimal sample complexities in this setting (Xie et al., 2021b; Shi et al., 2022; Li et al., 2022). However, these algorithms cannot handle real-world applications with large state and action spaces. Consequently, a significant body of research has devoted to offline RL with function approximation. For example, (Jin et al., 2021b) proposed the first efficient algorithm for offline RL with linear MDPs, employing the principle of pessimism. Subsequently, numerous works have presented a range of algorithms for offline RL with linear function approximation, as seen in Zanette et al. (2021); Min et al. (2021); Yin et al. (2022a); Xiong et al. (2023); Nguyen-Tang et al. (2023). Among them, some works have instance-dependent (a.k.a., problem-dependent) upper bound (Jin et al., 2021b; Yin et al., 2022a; Xiong et al., 2023; Nguyen-Tang et al., 2023), which matches the worst-case result when dealing with the "hard instance" and performs better in easy cases.
+
+To address the complexities of working with more complex function classes, recent research has shifted the focus towards offline reinforcement learning (RL) with general function approximation (Chen & Jiang, 2019; Xie et al., 2021a). Utilizing the principle of pessimism first used in Jin et al. (2021b), Xie et al. (2021a) enforced pessimism at the initial state over the set of functions consistent with the Bellman equations. Their algorithm requires solving an optimization problem over all the potential policies and corresponding version space, which includes all functions with lower Bellman-error. To overcome this limitation, Xie et al. (2021a) proposed a practical algorithm which
+
+has a poor dependency on the function class complexity. Later, Cheng et al. (2022) proposed an adversarially trained actor critic method based upon the concept of relative pessimism. Their result is not statistically optimal and was later improved by Zhu et al. (2023). Both algorithms' implementation relies on a no-regret policy optimization oracle. Another line of works, such as (Zhan et al., 2022; Ozdaglar et al., 2023; Rashidinejad et al., 2021), sought to solve the offline RL problem through a linear programming formulation, which requires some additional convexity assumptions on the policy class. However, most of these works only have worst-case regret guarantee. The only exception is Yin et al. (2022b), which studies the general differentiable function class and proposed an LSVI-type algorithm. For more general function classes, how to get instance-dependent characterizations is still an open problem. Therefore, a natural question arises:
+
+Can we design a computationally tractable algorithm that is statistically efficient with respect to the complexity of nonlinear function class and has an instance-dependent regret bound?
+
+We give an affirmative answer to the above question in this work. Our contributions are listed as follows:
+
+- We propose a pessimism-based algorithm Pessimistic Nonlinear Least-Square Value Iteration (PNLSVI) designed for nonlinear function approximation, which strictly generalizes the existing pessimism-based algorithms for both linear and differentiable function approximation (Xiong et al., 2023; Yin et al., 2022b). Our algorithm is oracle-efficient, i.e., it is computationally efficient when there exists an efficient regression oracle and bonus oracle for the function class (e.g., generalized linear function class). The bonus oracle can also be reduced to a finite number of calls to the regression oracle.
+- We introduce a new type of $D^2$ -divergence to quantify the uncertainty of an offline dataset, which naturally extends the role of the elliptical norm seen in the linear setting and the $D^2$ -divergence in Gentile et al. (2022); Agarwal et al. (2023); Ye et al. (2023) for online RL. We prove an instance-dependent regret bound characterized by this new $D^2$ -divergence. Our regret bound has a tight dependence on complexity of the function class, i.e., $\widetilde{O}(\sqrt{\log \mathcal{N}})$ with $\mathcal{N}$ being the cardinality of the underlying function class, which improves the $\widetilde{O}(\log \mathcal{N})$ dependence in (Yin et al., 2022b) and resolves the open problem raised in their paper.
+
+Notation: In this work, we use lowercase letters to denote scalars and use lower and uppercase boldface letters to denote vectors and matrices respectively. For a vector $\mathbf{x} \in \mathbb{R}^d$ and matrix $\boldsymbol{\Sigma} \in \mathbb{R}^{d \times d}$ , we denote by $\| \mathbf{x} \|_2$ the Euclidean norm and $\| \mathbf{x} \|_{\boldsymbol{\Sigma}} = \sqrt{\mathbf{x}^\top \boldsymbol{\Sigma} \mathbf{x}}$ . For two sequences $\{a_n\}$ and $\{b_n\}$ , we write $a_n = O(b_n)$ if there exists an absolute constant $C$ such that $a_n \leq C b_n$ , and we write $a_n = \Omega(b_n)$ if there exists an absolute constant $C$ such that $a_n \geq C b_n$ . We use $\widetilde{O}(\cdot)$ and $\widetilde{\Omega}(\cdot)$ to further hide the logarithmic factors. For any $a \leq b \in \mathbb{R}$ , $x \in \mathbb{R}$ , let $[x]_{[a,b]}$ denote the truncate function $a \cdot \mathbb{1}(x \leq a) + x \cdot \mathbb{1}(a \leq x \leq b) + b \cdot \mathbb{1}(b \leq x)$ , where $\mathbb{1}(\cdot)$ is the indicator function. For a positive integer $n$ , we use $[n] = \{1, 2,.., n\}$ to denote the set of integers from 1 to $n$ .
+
+# 2 RELATED WORK
+
+RL with function approximation. As one of the simplest function approximation classes, linear representation in RL has been extensively studied in recent years (Jiang et al., 2017; Dann et al., 2018; Yang & Wang, 2019; Jin et al., 2020; Wang et al., 2020c; Du et al., 2019; Sun et al., 2019; Zanette et al., 2020a,b; Weisz et al., 2021; Yang & Wang, 2020; Modi et al., 2020; Ayoub et al., 2020; Zhou et al., 2021; He et al., 2021; Zhong et al., 2022). Several assumptions on the linear structure of the underlying MDPs have been made in these works, ranging from the linear MDP assumption (Yang & Wang, 2019; Jin et al., 2020; Hu et al., 2022; He et al., 2022; Agarwal et al., 2023) to the low Bellman-rank assumption (Jiang et al., 2017) and the low inherent Bellman error assumption (Zanette et al., 2020b). Extending the previous theoretical guarantees to more general problem classes, RL with nonlinear function classes has garnered increased attention in recent years (Wang et al., 2020b; Jin et al., 2021a; Foster et al., 2021; Du et al., 2021; Agarwal & Zhang, 2022; Agarwal et al., 2023). Various complexity measures of function classes have been studied including Bellman rank (Jiang et al., 2017), Bellman-Eluder dimension (Jin et al., 2021a), Decision-Estimation Coefficient (Foster et al., 2021) and generalized Eluder dimension (Agarwal et al., 2023). Among these works, the setting in our paper is most related to Agarwal et al. (2023) where $D^2$ -divergence (Gentile et al., 2022) was introduced in RL to indicate the uncertainty of a sample with respect to a particular sample batch.
+
+Offline tabular RL. There is a line of works integrating the principle of pessimism to develop statistically efficient algorithms for offline tabular RL setting (Rashidinejad et al., 2021; Yin & Wang, 2021; Xie et al., 2021b; Shi et al., 2022; Li et al., 2022). More specifically, Xie et al. (2021b) utilized the variance of transition noise and proposed a nearly optimal algorithm based on pessimism and Bernstein-type bonus. Subsequently, Li et al. (2022) proposed a model-based approach that achieves minimax-optimal sample complexity without burn-in cost for tabular MDPs. Shi et al. (2022) also contributed by proposing the first nearly minimax-optimal model-free offline RL algorithm.
+
+Offline RL with linear function approximation. Jin et al. (2021b) presented the initial theoretical results on offline linear MDPs. They introduced a pessimism-principled algorithmic framework for offline RL and proposed an algorithm based on LSVI (Jin et al., 2020). Min et al. (2021) subsequently considered offline policy evaluation (OPE) in linear MDPs, assuming independence between data samples across time steps to obtain tighter confidence sets and proposed an algorithm with optimal $d$ dependence. Yin et al. (2022a) took one step further and considered the policy optimization in linear MDPs, which implicitly requires the same independence assumption. Zanette et al. (2021) proposed an actor-critic-based algorithm that establishes pessimism principle by directly perturbing the parameter vectors in a linear function approximation framework. Recently, Xiong et al. (2023) proposed a novel uncertainty decomposition technique via a reference function, and demonstrated their algorithm matches the performance lower bound up to logarithmic factors.
+
+Offline RL with general function approximation. Chen & Jiang (2019) examined the assumptions underlying value-function approximation methods and established an information-theoretic lower bound. Xie et al. (2021a) introduced the concept of Bellman-consistent pessimism, which enables sample-efficient guarantees by relying solely on the Bellman-completeness assumption. Uehara & Sun (2021) focused on model-based offline RL with function approximation under partial coverage, demonstrating that realizability in the function class and partial coverage are sufficient for policy learning. Zhan et al. (2022) proposed an algorithm that achieves polynomial sample complexity under the realizability and single-policy concentrability assumptions. Nguyen-Tang & Arora (2023) proposed a method of random perturbations and pessimism for neural function approximation. For differentiable function classes, Yin et al. (2022b) made advancements by improving the sample complexity with respect to the planing horizon $H$ . However, their result had an additional dependence on the dimension $d$ of the parameter space, whereas in linear function approximation, the dependence is typically on $\sqrt{d}$ . Recently, a sequence of works focus on proposing statistically optimal and practical algorithms under single concentrability assumption. Ozdaglar et al. (2023) provided a new reformulation of linear-programming. Rashidinejad et al. (2022) used the augmented Lagrangian method and proved augmented Lagrangian is enough for statistically optimal offline RL. Cheng et al. (2022) proposed an actor-critic algorithm by formulating the offline RL problem into a Stackelberg game. However, their result is not statistically optimal and Zhu et al. (2023) improved it by combining the marginalized importance sampling framework and achieved the optimal statistical rate. We leave a comparison of these works in Appendix A.
+
+# 3 PRELIMINARIES
+
+In our work, we consider the inhomogeneous episodic Markov Decision Processes (MDP), which can be denoted by a tuple of $\mathcal{M}\big(S,\mathcal{A},H,\{r_h\}_{h = 1}^H,\{\mathbb{P}_h\}_{h = 1}^H\big)$ . In specific, $\mathcal{S}$ is the state space, $\mathcal{A}$ is the finite action space, $H$ is the length of each episode. For each stage $h\in [H],r_h:S\times \mathcal{A}\to [0,1]$ is the reward function and $\mathbb{P}_h(s'|s,a)$ is the transition probability function, which denotes the probability for state $s$ to transfer to next state $s^\prime$ with current action $a$ . A policy $\pi \coloneqq \{\pi_h\}_{h = 1}^H$ is a collection of mappings $\pi_h$ from a state $s\in S$ to the simplex of action space $\mathcal{A}$ . For simplicity, we denote the state-action pair as $z\coloneqq (s,a)$ . For any policy $\pi$ and stage $h\in [H]$ , we define the value function $V_{h}^{\pi}(s)$ and the action-value function $Q_{h}^{\pi}(s,a)$ as the expected cumulative rewards starting at stage $h$ , which can be denoted as follows:
+
+$$
+Q _ {h} ^ {\pi} (s, a) = r _ {h} (s, a) + \mathbb {E} \left[ \sum_ {h ^ {\prime} = h + 1} ^ {H} r _ {h ^ {\prime}} \left(s _ {h ^ {\prime}}, \pi_ {h ^ {\prime}} \left(s _ {h ^ {\prime}}\right)\right) | s _ {h} = s, a _ {h} = a \right], V _ {h} ^ {\pi} (s) = Q _ {h} ^ {\pi} \left(s, \pi_ {h} (s)\right),
+$$
+
+where $s_{h' + 1} \sim \mathbb{P}_h(\cdot | s_{h'}, a_{h'})$ denotes the observed state at stage $h' + 1$ . By this definition, the value function $V_h^\pi(s)$ and action-value function $Q_h^\pi(s, a)$ are bounded in $[0, H]$ . In addition, we define the optimal value function $V_h^*$ and the optimal action-value function $Q_h^*$ as
+
+$V_{h}^{*}(s) = \max_{\pi} V_{h}^{\pi}(s)$ and $Q_{h}^{*}(s, a) = \max_{\pi} Q_{h}^{\pi}(s, a)$ . We denote the corresponding optimal policy by $\pi^{*}$ . For any function $V: \mathcal{S} \to \mathbb{R}$ , we denote $[\mathbb{P}_{h}V](s, a) = \mathbb{E}_{s' \sim \mathbb{P}_{h}(\cdot|s, a)} V(s')$ and $[\operatorname{Var}_{h}V](s, a) = [\mathbb{P}_{h}V^{2}](s, a) - ([\mathbb{P}_{h}V](s, a))^{2}$ for simplicity. For any function $f: \mathcal{S} \times \mathcal{A} \to \mathbb{R}$ , we define $f(s) = \max_{a} f(s, a)$ . For any function $f: \mathcal{S} \to \mathbb{R}^{3}$ , we define the Bellman operator $\mathcal{T}_{h}$ as $[\mathcal{T}_{h}f](s_{h}, a_{h}) = \mathbb{E}_{s_{h+1} \sim \mathbb{P}_{h}(\cdot|s_{h}, a_{h})} [r_{h}(s_{h}, a_{h}) + f(s_{h+1})]$ . Based on this definition, for every stage $h \in [H]$ and policy $\pi$ , we have the following Bellman equation for value functions $Q_{h}^{\pi}(s, a)$ and $V_{h}^{\pi}(s)$ , as well as the Bellman optimality equation for optimal value functions:
+
+$$
+Q _ {h} ^ {\pi} \left(s _ {h}, a _ {h}\right) = \left[ \mathcal {T} _ {h} V _ {h + 1} ^ {\pi} \right] \left(s _ {h}, a _ {h}\right), Q _ {h} ^ {*} \left(s _ {h}, a _ {h}\right) = \left[ \mathcal {T} _ {h} V _ {h + 1} ^ {*} \right] \left(s _ {h}, a _ {h}\right),
+$$
+
+where $V_{H + 1}^{\pi}(s) = V_{H + 1}^{*}(s) = 0$ . We also define the Bellman operator for second moment as $[\mathcal{T}_{2,h}f](s_h,a_h) = \mathbb{E}_{s_{h + 1}\sim \mathbb{P}_h(\cdot |s_h,a_h)}\left[\big(r_h(s_h,a_h) + f(s_{h + 1})\big)^2\right]$ . For simplicity, we omit the subscripts $h$ in the Bellman operator without causing confusion.
+
+Offline Reinforcement Learning: In offline RL, the agent only has access to a batch-dataset $D = \{s_h^k, a_h^k, r_h^k : h \in [H], k \in [K]\}$ , which is collected by a behavior policy $\mu$ , and the agent cannot interact with the environment. We also make the compliance assumption of the dataset:
+
+Assumption 3.1. For a dataset $\mathcal{D} = \{(s_h^k, a_h^k, r_h^k)\}_{k,h=1}^{K,H}$ , let $\mathbb{P}_{\mathcal{D}}$ be the joint distribution of the data collecting process. We say $\mathcal{D}$ is compliant with an underlying MDP $(S, A, H, \mathbb{P}, r)$ if
+
+$$
+\begin{array}{l} \mathbb {P} _ {\mathcal {D}} \left(r _ {h} ^ {k} = r ^ {\prime}, s _ {h + 1} ^ {k} = s ^ {\prime} \mid \left\{\left(s _ {h} ^ {j}, a _ {h} ^ {j}\right) \right\} _ {j = 1} ^ {k}, \left\{\left(r _ {h} ^ {j}, s _ {h + 1} ^ {j}\right) \right\} _ {j = 1} ^ {k - 1}\right) \\ = \mathbb {P} _ {h} \left(r _ {h} \left(s _ {h}, a _ {h}\right) = r ^ {\prime}, s _ {h + 1} = s ^ {\prime} \mid s _ {h} = s _ {h} ^ {k}, a _ {h} = a _ {h} ^ {k}\right) \\ \end{array}
+$$
+
+for all $r' \in [0,1]$ , $s' \in \mathcal{S}$ , $h \in [H]$ and $k \in [K]$ .
+
+This assumption is common in offline RL and has also been made in Jin et al. (2021b); Zhong et al. (2022). When the dataset originates from one behavior policy, this assumption naturally holds. In this paper, we assume our dataset is generated by a single behavior policy $\mu$ . In addition, for each stage $h$ , we denote the induced distribution of the state-action pair by $d_h^\mu$ .
+
+Given the batch dataset, the goal of offline RL is finding a near-optimal policy $\pi$ that minimizes the suboptimality $V_{1}^{*}(s) - V_{1}^{\pi}(s)$ . For simplicity, and when there's no risk of confusion, we will use the shorthand notation $z_{h}^{k} = (s_{h}^{k},a_{h}^{k})$ to denote the state-action pair in the dataset up to stage $h$ and episode $k$ .
+
+General Function Approximation: Given a general function class $\{\mathcal{F}_h\}_{h\in [H]}$ , where each function class $\mathcal{F}_h$ is composed of functions $f_{h}:\mathcal{S}\times \mathcal{A}\to [0,L]$ . For simplicity, we assume $L = O(H)$ throughout the paper. We make the following assumptions on the function class.
+
+Assumption 3.2 ( $\epsilon$ -realizability under general function approximation). For each stage $h \in [H]$ , there exists a function $f_h^* \in \mathcal{F}_h$ close to the optimal value function such that $\| f_h^* - Q_h^*\|_{\infty} \leq \epsilon$ .
+
+Assumption 3.3 ( $\epsilon$ -completeness under general function approximation, Agarwal et al. 2023). We assume for each stage $h \in [H]$ , and any function $V: S \to [0, H]$ , there exists functions $f_h, f_{2,h} \in \mathcal{F}_h$ such that
+
+$$
+\max _ {(s, a) \in \mathcal {S} \times \mathcal {A}} | f _ {h} (s, a) - [ \mathcal {T} _ {h} V ] (s, a) | \leq \epsilon , \text {a n d} \max _ {(s, a) \in \mathcal {S} \times \mathcal {A}} | f _ {2, h} (s, a) - [ \mathcal {T} _ {2, h} V ] (s, a) | \leq \epsilon .
+$$
+
+In this paper, for simplicity, we assume that the function class is finite and denote its cardinality by $\mathcal{N} = \max_{h\in [H]}|\mathcal{F}_h|$ . For infinite function classes, we can use the covering number to replace the cardinality. Note that the covering number will be reduced to the cardinality when the function class is finite.
+
+We introduce the following definition ( $D^2$ -divergence) to quantify the disparity of a given point $z = (s, a)$ from the historical dataset $\mathcal{D}_h$ . It is a reflection of the uncertainty of the dataset.
+
+Definition 3.4. For a function class $\mathcal{F}_h$ consisting of functions $f_h: S \times \mathcal{A} \to \mathbb{R}$ and $\mathcal{D}_h = \{(s_h^k, a_h^k, r_h^k)\}_{k \in [K]}$ as a dataset that corresponds to the observations collected up to stage $h$ in the MDP, we introduce the following $D^2$ -divergence:
+
+$$
+D _ {\mathcal {F} _ {h}} ^ {2} (z; \mathcal {D} _ {h}; \sigma_ {h} ^ {2}) = \sup _ {f _ {1}, f _ {2} \in \mathcal {F} _ {h}} \frac {(f _ {1} (z) - f _ {2} (z)) ^ {2}}{\sum_ {k \in [ K ]} \frac {1}{(\sigma_ {h} (z _ {h} ^ {k})) ^ {2}} (f _ {1} (z _ {h} ^ {k}) - f _ {2} (z _ {h} ^ {k})) ^ {2} + \lambda},
+$$
+
+where $\sigma_h^2 (\cdot ,\cdot):\mathcal{S}\times \mathcal{A}\to \mathbb{R}$ is a weight function.
+
+Remark 3.5. This definition signifies the extent to which the behavior of functions within the function class can deviate at the point $z = (s, a)$ , based on their difference in the historical dataset. It can be viewed as the generalization of the weighted elliptical norm $\| \phi(s, a) \|_{\Sigma_h^{-1}}$ in linear case, where $\phi$ is the feature map and $\Sigma_h$ is defined as $\sum_{k \in [K]} \sigma_h^{-2}(s_h^k, a_h^k) \phi(s_h^k, a_h^k) \phi(s_h^k, a_h^k)^{\top} + \lambda I$ . Similar ideas have been used to define the Generalized Eluder dimension for online RL (Gentile et al., 2022; Agarwal et al., 2023; Ye et al., 2023). In these works, the summation is over a sequence up to the $k$ -th episode rather than the entire historical dataset.
+
+Data Coverage Assumption: In offline RL, there exists a discrepancy between the state-action distribution generated by the behavior policy and the distribution from the learned policy. Under this situation, the distribution shift problem can cause the learned policy to perform poorly or even fail in offline RL. In this work, we consider the following data coverage assumption to control the distribution shift.
+
+Assumption 3.6 (Uniform Data Coverage). there exists a constant $\kappa >0$ , such that for any stage $h$ and functions $f_{1},f_{2}\in \mathcal{F}_{h}$ , the following inequality holds,
+
+$$
+\mathbb {E} _ {d _ {h} ^ {\mu}} \left[ \left(f _ {1} (s _ {h}, a _ {h}) - f _ {2} (s _ {h}, a _ {h})\right) ^ {2} \right] \geq \kappa \| f _ {1} - f _ {2} \| _ {\infty} ^ {2},
+$$
+
+where the state-action pair (at stage $h$ ) ( $s_h, a_h$ ) is stochastically generated from the induced distribution $d_h^\mu$ .
+
+Remark 3.7. Similar uniform coverage assumptions have also been considered in Wang et al. (2020a); Min et al. (2021); Yin et al. (2022a); Xiong et al. (2023); Yin et al. (2022b). Among these works, Yin et al. (2022b) is the most related to ours, proving an instance-dependent regret bound under general function approximation. Here we make a comparison with their assumption. In detail, Yin et al. (2022b) considered the differentiable function class, which is defined as follows
+
+$$
+\mathcal {F} := \left\{f \big (\boldsymbol {\theta}, \phi (\cdot , \cdot) \big): \mathcal {S} \times \mathcal {A} \to \mathbb {R}, \boldsymbol {\theta} \in \Theta \right\}.
+$$
+
+They introduced the following coverage assumption such that for all stage $h \in [H]$ , there exists a constant $\kappa$
+
+$$
+\begin{array}{l} \mathbb {E} _ {d _ {h} ^ {\mu}} \left[ \left(f (\boldsymbol {\theta} _ {1}, \phi (s, a)) - f (\boldsymbol {\theta} _ {2}, \phi (s, a))\right) ^ {2} \right] \geq \kappa \| \boldsymbol {\theta} _ {1} - \boldsymbol {\theta} _ {2} \| _ {2} ^ {2}, \forall \boldsymbol {\theta} _ {1}, \boldsymbol {\theta} _ {2} \in \Theta ; (*) \\ \mathbb {E} _ {d _ {h} ^ {\mu}} \left[ \nabla f (\boldsymbol {\theta}, \phi (s, a)) \nabla f (\boldsymbol {\theta}, \phi (s, a)) ^ {\top} \right] \succ \kappa I, \forall \boldsymbol {\theta} \in \Theta . \quad (* *) \\ \end{array}
+$$
+
+We can prove that our assumption is weaker than the first assumption $(^{*})$ , and we do not need the second assumption $(^{**})$ . This suggests that the differentiable function class studied in Yin et al. (2022b) is an example covered by our general function class.
+
+In addition, in the special case of linear function class, the coverage assumption in Yin et al. (2022b) will reduce to the following linear function coverage assumption (Wang et al., 2020a; Min et al., 2021; Yin et al., 2022a; Xiong et al., 2023).
+
+$$
+\lambda_ {\min } \left(\mathbb {E} _ {d _ {h} ^ {\mu}} [ \phi (s, a) \phi (s, a) ^ {\top} ]\right) = \kappa > 0, \forall h \in [ H ].
+$$
+
+Therefore, our assumption is also weaker than the linear function coverage assumption when dealing with the linear function class. Due to space limitations, we defer a detailed comparison to Appendix B.
+
+Remark 3.8. Many works such as Uehara & Sun (2021); Xie et al. (2021a); Cheng et al. (2022); Ozdaglar et al. (2023); Rashidinejad et al. (2022); Zhu et al. (2023) adopted a weaker partial coverage assumption than ours, where the $\ell_{\infty}$ norm on the right hand is replaced with the expectation over a distribution corresponding to a single policy, typically the optimal one. Their assumption, however, generally confines their results to worst-case scenarios. It is unclear if we can still prove the instance-dependent regret under their assumption. We will explore it in the future.
+
+# 4 ALGORITHM
+
+In this section, we provide a comprehensive and detailed description of our algorithm (PNLSVI), as displayed in Algorithm 1. In the sequel, we introduce the key ideas of the proposed algorithm.
+
+# 4.1 PESSIMISTIC VALUE ITERATION BASED PLANNING
+
+Our algorithm operates in two distinct phases, the Variance Estimate Phase and the Pessimistic Planning Phase. At the beginning of the algorithm, the dataset is divided into two independent disjoint subsets $\mathcal{D},\bar{\mathcal{D}}$ with equal size $K$ , and each is assigned to a specific phase.
+
+Algorithm 1 Pessimistic Nonlinear Least-Squares Value Iteration (PNLSVI)
+
+Require: Input confidence parameters $\bar{\beta}_h$ , $\beta_h$ and $\epsilon > 0$ .
+
+1: Initialize: Split the input dataset into $\mathcal{D} = \{s_h^k, a_h^k, r_h^k\}_{k,h=1}^{K,H}$ , $\bar{\mathcal{D}} = \{\bar{s}_h^k, \bar{a}_h^k, \bar{r}_h^k\}_{k,h=1}^{K,H}$ ; Set the value function $\widehat{f}_{H+1}(\cdot) = \check{f}_{H+1}(\cdot) = 0$ .
+2: //Constructing the variance estimator
+3: for stage $h = H, \dots, 1$ do
+4: $\bar{f}_h = \mathrm{argmin}_{f_h\in \mathcal{F}_h}\sum_{k\in [K]}\left(f_h(\bar{s}_h^k,\bar{a}_h^k) - \bar{r}_h^k -\check{f}_{h + 1}(\bar{s}_{h + 1}^k)\right)^2.$
+5: $\bar{g}_h = \operatorname*{argmin}_{g_h\in \mathcal{F}_h}\sum_{k\in [K]}\left(g_h(\bar{s}_h^k,\bar{a}_h^k) - \left(\bar{r}_h^k +\check{f}_{h + 1}(\bar{s}_{h + 1}^k)\right)^2\right)^2.$
+6: Calculate a bonus function $\bar{b}_h$ with confidence parameter $\bar{\beta}_h$ ,
+7: $\tilde{f}_h\gets \{\bar{f}_h - \bar{b}_h - \epsilon \}_{[0,H - h + 1]}$
+8: Construct the variance estimator
+
+$$
+\widehat {\sigma} _ {h} ^ {2} (s, a) = \max \left\{1, \bar {g} _ {h} (s, a) - (\bar {f} _ {h} (s, a)) ^ {2} - O \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right) \right\}.
+$$
+
+# 9: end for
+
+10: //Pessimistic value iteration based planning
+11: for stage $h = H, \dots, 1$ do
+12: $\widetilde{f}_h = \operatorname*{argmin}_{f_h\in \mathcal{F}_h}\sum_{k\in [K]}\frac{1}{\widehat{\sigma}_h^2(s_h^k,a_h^k)}\left(f_h(s_h^k,a_h^k) - r_h^k -\widehat{f}_{h + 1}(s_{h + 1}^k)\right)^2$
+13: Calculate a bonus function $b_{h}$ with bonus parameter $\beta_{h}$ ;
+14: $\widehat{f}_h\gets \{\tilde{f}_h - b_h - \epsilon \}_{[0,H - h + 1]}$
+15: $\widehat{\pi}_h(\cdot |s) = \mathrm{argmax}_a\widehat{f}_h(s,a)$
+16: end for
+17: Output: $\widehat{\pi} = \{\widehat{\pi}_h\}_{h=1}^H$ .
+
+The basic framework of our algorithm follows the pessimistic value iteration, which was initially introduced by Jin et al. (2021b). In details, for each stage $h \in [H]$ , we construct the estimator value function $\widetilde{f}_h$ by solving the following variance-weighted ridge regression (Line 13):
+
+$$
+\widetilde {f _ {h}} = \operatorname * {a r g m i n} _ {f _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \frac {1}{\widehat {\sigma} _ {h} ^ {2} \left(s _ {h} ^ {k} , a _ {h} ^ {k}\right)} \left(f _ {h} \left(s _ {h} ^ {k}, a _ {h} ^ {k}\right) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right)\right) ^ {2},
+$$
+
+where $\widehat{\sigma}_h^2$ is the estimated variance and will be discussed in Section 4.2. In Line 14, we subtract the confidence bonus function $b_{h}$ from the estimator value function $\widetilde{f}_h$ to construct the pessimistic value function $\widehat{f}_h$ . With the help of the confidence bonus function $b_{h}$ , the pessimistic value function $\widehat{f}_h$ is almost a lower bound for the optimal value function $f_h^*$ . The details of the bonus function will be discussed in Section 4.3.
+
+Based on the pessimistic value function $\widehat{f}_h$ for horizon $h$ , we recursively perform the value iteration for the horizon $h - 1$ . Finally, we use the pessimistic value function $\widehat{f}_h$ to do planning and output the greedy policy with respect to the pessimistic value function $\widehat{f}_h$ (Lines 15 - 17).
+
+# 4.2 VARIANCE ESTIMATOR
+
+In this phase, we provide an estimator for the variance $\widehat{\sigma}_h$ in the weighted ridge regression. We construct this variance estimator with $\bar{D}$ , thus independent of $\mathcal{D}$ . Using a larger bonus function $\bar{b}_h$ , we conduct a pessimistic value iteration process similar to that discussed in Section 4.1 and obtain a more crude estimated value function $\{\check{f}_h\}_{h\in [H]}$ . According to the definition of Bellman operators $\mathcal{T}$ and $\mathcal{T}_2$ , the variance of the function $\check{f}_{h + 1}$ for each state-action pair $(s,a)$ can be denoted by
+
+$$
+\left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) = \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] (s, a) - \left(\left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] (s, a)\right) ^ {2}.
+$$
+
+Therefore, we need to estimate the first-order and second-order moments for $\tilde{f}_{h + 1}$ . We perform nonlinear least-squares regression separately for each of these moments. Specifically, in Line 4, we conduct regression to estimate the first-order moment.
+
+$$
+\bar {f} _ {h} = \underset {f _ {h} \in \mathcal {F} _ {h}} {\mathrm {a r g m i n}} \sum_ {k \in [ K ]} \left(f _ {h} (\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2}.
+$$
+
+In Line 5, we perform regression for estimating the second-order moment.
+
+$$
+\bar {g} _ {h} = \operatorname * {a r g m i n} _ {g _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \left(g _ {h} (\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}) - \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2}\right) ^ {2}.
+$$
+
+In this phase, we set the variance function to 1 for each state-action pair $(s,a)$ . Combining these two regression results and subtracting some perturbing terms (We will discuss in Section 6.1), we create a pessimistic estimator for the variance function (Lines 7 to 8).
+
+# 4.3 NONLINEAR BONUS FUNCTION
+
+As we discuss in Sections 4.1 and 4.2, following Wang et al. (2020b); Kong et al. (2021); Agarwal et al. (2023), we introduce a bonus function. This function is designed to account for the functional uncertainty, enabling us to develop a pessimistic estimate of the value function. Ideally, we hope to choose $b_{h}(\cdot ,\cdot) = \beta_{h}D_{\mathcal{F}_{h}}(\cdot ,\cdot;\mathcal{D}_{h};\widehat{\sigma}_{h}^{2})$ , where $\beta_{h}$ is the confidence parameter and $D_{\mathcal{F}_h}(\cdot ,\cdot ;\mathcal{D}_h;\widehat{\sigma}_h^2)$ is defined in Definition 3.4. However, the $D^2$ -divergence composes a complex function class, and its calculation involves solving a complex optimization problem. To address this issue, following Agarwal et al. (2023), we assume there exists a function class $\mathcal{W}$ with cardinally $|\mathcal{W}| = \mathcal{N}_b$ and can approximate the $D^2$ -divergence well. For the parameters $\beta_h$ , $\lambda \geq 0$ , error parameter $\epsilon \geq 0$ , taking a variance function $\sigma_h(\cdot ,\cdot):S\times \mathcal{A}\to \mathbb{R}$ and $\widehat{f}_h\in \mathcal{F}_h$ as input, we can get a bonus function $b_{h}(\cdot ,\cdot)\in \mathcal{W}$ satisfying the following properties:
+
+- $b_{h}(z_{h}) \geq \max \left\{ |f_{h}(z_{h}) - \widehat{f}_{h}(z_{h})|, f_{h} \in \mathcal{F}_{h} : \sum_{k \in [K]} \frac{(f_{h}(z_{h}^{k}) - \widehat{f}_{h}(z_{h}^{k}))^{2}}{(\widehat{\sigma}_{h}(s_{h}^{k}, a_{h}^{k}))^{2}} \leq (\beta_{h})^{2} \right\}$ for any $z_{h} \in S \times \mathcal{A}$ .
+- $b_h(z_h) \leq C \cdot \left( D_{\mathcal{F}_h}(z_h; \mathcal{D}_h; \widehat{\sigma}_h^2) \cdot \sqrt{(\beta_h)^2 + \lambda} + \epsilon \beta_h \right)$ for all $z_h \in S \times \mathcal{A}$ with constant $0 < C < \infty$ .
+
+We can implement the function class $\mathcal{W}$ with bounded $\mathcal{N}_b$ by extending the online subsampling framework presented in Wang et al. (2020b); Kong et al. (2021) to an offline dataset. Additionally, using Algorithm 1 of Kong et al. (2021), we can calculate the bonus function with finite calls of the oracle for solving the variance-weighted ridge regression problem. We leave a detailed discussion to Appendix C.
+
+# 5 MAIN RESULTS
+
+In this section, we prove an instance-dependent regret bound of Algorithm 1.
+
+Theorem 5.1. Under Assumption 3.6, for $K \geq \widetilde{\Omega}\left(\frac{\log(\mathcal{N} \cdot \mathcal{N}_b)H^6}{\kappa^2}\right)$ , if we set the parameters $\beta_{1,h}', \beta_{2,h}' = \widetilde{O}(\sqrt{\log(\mathcal{N} \cdot \mathcal{N}_b)} H^2)$ and $\beta_h = \widetilde{O}(\sqrt{\log\mathcal{N}})$ in Algorithm 1, then with probability at least $1 - \delta$ , for any state $s \in S$ , we have
+
+$$
+V _ {1} ^ {*} (s) - V _ {1} ^ {\widehat {\pi}} (s) \leq \widetilde {O} (\sqrt {\log \mathcal {N}}) \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ D _ {\mathcal {F} _ {h}} \left(z _ {h}; \mathcal {D} _ {h}; [ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (\cdot , \cdot)\right) | s _ {1} = s \right],
+$$
+
+where $[\mathbb{V}_hV_{h + 1}^* ](s,a) = \max \{1,[\mathrm{Var}_hV_{h + 1}^* ](s,a)\}$ is the truncated conditional variance.
+
+This theorem establishes an upper bound for the suboptimality of our policy $\widehat{\pi}$ . The bound depends on the expected uncertainty, which is characterized by the weighted $D^2$ -divergence along the trajectory, marking itself as an instance-dependent result. It's noteworthy that both the trajectory and the weight function are based on the optimal policy and the optimal value function, respectively. This bound necessitates that the dataset size $K$ is sufficiently large. Furthermore, all parameters are determined solely by the complexity of the function class, the horizon length $H$ , and the data coverage assumption constant $\kappa$ , regardless of the dataset's composition.
+
+Remark 5.2. In Theorem 5.1, the dependence on the cardinality of the function class scales as $\widetilde{O} (\sqrt{\log\mathcal{N}})$ , which is better than that in Yin et al. (2022b), which scales as $\widetilde{O} (\log \mathcal{N})$ . This improved dependence is due to the reference-advantage decomposition (discussed in Section 6.2), which avoids the unnecessary covering argument. Thus we resolve the open problem raised by Yin et al. (2022b), i.e., how to achieve the $\widetilde{O} (\sqrt{\log\mathcal{N}})$ dependence.
+
+Remark 5.3. When specialized to linear MDPs (Jin et al., 2020), the following function class
+
+$$
+\mathcal {F} _ {h} ^ {\operatorname {l i n}} = \left\{\left\langle \phi (\cdot , \cdot), \boldsymbol {\theta} _ {h} \right\rangle : \boldsymbol {\theta} _ {h} \in \mathbb {R} ^ {d}, \| \boldsymbol {\theta} _ {h} \| _ {2} \leq B _ {h} \right\} \text {f o r a n y} h \in [ H ],
+$$
+
+suffices and satisfies the completeness assumption (Assumption 3.3). Let $\mathcal{F}_h^{\mathrm{lin}}(\epsilon)$ be an $\epsilon$ -net of the linear function class $\mathcal{F}_h^{\mathrm{lin}}$ , with $\log |\mathcal{F}_h^{\mathrm{lin}}(\epsilon)| = \widetilde{O}(d)$ . The dependency of the function class will reduce to $\widetilde{O}(\sqrt{\log\mathcal{N}}) = \widetilde{O}(\sqrt{d})$ . For linear function class, we can prove the following inequality:
+
+$$
+D _ {\mathcal {F} _ {h} ^ {\operatorname {t i n}} (\epsilon)} (z; \mathcal {D} _ {h}; [ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (\cdot , \cdot)) \leq \| \phi (z) \| _ {\Sigma_ {h} ^ {* - 1}},
+$$
+
+where $\Sigma_h^* = \sum_{k\in [K]}\phi (s_h^k,a_h^k)\phi (s_h^k,a_h^k)^\top /\left[\mathbb{V}_hV_{h + 1}^*\right](s_h^k,a_h^k) + \lambda \mathbf{I}$ . Therefore, our regret guarantee in Theorem 5.1 is reduced to
+
+$$
+V _ {1} ^ {*} (s) - V _ {1} ^ {\widehat {\pi}} (s) \leq \widetilde {O} (\sqrt {d}) \cdot \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ \| \phi \left(s _ {h}, a _ {h}\right) \| _ {\boldsymbol {\Sigma} _ {h} ^ {* - 1}} \mid s _ {1} = s \right],
+$$
+
+which matches the lower bound proved in Xiong et al. (2023). This suggests that our algorithm is optimal for linear MDPs.
+
+# 6 KEY TECHNIQUES
+
+In this section, we provide an overview of the key techniques in our algorithm design and analysis. 6.1 VARIANCE ESTIMATOR WITH NONLINEAR FUNCTION CLASS
+
+In our work, we extend the technique of variance-weighted ridge regression, first introduced in Zhou et al. (2021) for online RL, and later used by Min et al. (2021); Yin et al. (2022a;b); Xiong et al. (2023) for offline RL with linear MDPs, to general nonlinear function class $\mathcal{F}$ . We use the following nonlinear least-squares regression to estimate the underlying value function:
+
+$$
+\widetilde {f _ {h}} = \operatorname * {a r g m i n} _ {f _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \frac {1}{\widehat {\sigma} _ {h} ^ {2} \left(s _ {h} ^ {k} , a _ {h} ^ {k}\right)} \left(f _ {h} \left(s _ {h} ^ {k}, a _ {h} ^ {k}\right) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right)\right) ^ {2}.
+$$
+
+For this regression, it is crucial to obtain a reliable evaluation for the variance of the estimated cumulative reward $r_h^k + \widehat{f}_{h+1}(s_{h+1}^k)$ . As discussed in Section 4.2, we use $\bar{\mathcal{D}}$ to construct a variance estimator independent from $\mathcal{D}$ . According to the definition of Bellman operators $\mathcal{T}$ and $\mathcal{T}_2$ , the variance of the function $f_{h+1}$ for each state-action pair $(s, a)$ can be denoted by
+
+$$
+\left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) = \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] (s, a) - \left(\left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] (s, a)\right) ^ {2}.
+$$
+
+In our algorithm, we perform nonlinear least-squares regression on $\bar{\mathcal{D}}$ . For simplicity, we denote the empirical variance as $\mathbb{B}_h(s,a) = \bar{g}_h(s,a) - \left(\bar{f}_h(s,a)\right)^2$ , and the difference between empirical variance $\mathbb{B}_h(s,a)$ and actual variance $[\mathrm{Var}_h\check{f}_{h + 1}](s,a)$ is upper bound by
+
+$$
+\left| \mathbb {B} _ {h} (s, a) - \left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) \right| \leq \left| \bar {g} _ {h} (s, a) - \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] (s, a) \right| + \left| \left(\widetilde {f} _ {h} (s, a)\right) ^ {2} - \left(\left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] (s, a)\right) ^ {2} \right|.
+$$
+
+For these nonlinear function estimators, the following lemmas provide coarse concentration properties for the first and second order Bellman operators.
+
+Lemma 6.1. For any stage $h \in [H]$ , let $\check{f}_{h+1}(\cdot, \cdot) \leq H$ be the estimated value function constructed in Algorithm 1 Line 7. By utilizing Assumption 3.3, there exists a function $\bar{f}_h' \in \mathcal{F}_h$ , satisfying that $|\bar{f}_h'(z_h) - [\mathcal{T}_h\check{f}_{h+1}](z_h)| \leq \epsilon$ holds for all state-action pair $z_h = (s_h, a_h)$ . Then with probability at least $1 - \delta/(4H)$ , it holds that
+
+$$
+\sum_ {k \in [ K ]} \left(\bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \leq (\bar {\beta} _ {1, h}) ^ {2},
+$$
+
+where $\bar{\beta}_{1,h} = \widetilde{O}\left(\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_b)} H\right)$ , and $\bar{f}_h$ is the estimated function for first-moment Bellman operator (Line 4 in Algorithm 1).
+
+Lemma 6.2. For any stage $h \in [H]$ , let $\check{f}_{h+1}(\cdot, \cdot) \leq H$ be the estimated value function constructed in Algorithm 1 Line 7. By utilizing Assumption 3.3, there exists a function $\bar{g}_h' \in \mathcal{F}_h$ , satisfying that $|\bar{g}_h'(z_h) - [\mathcal{T}_{2,h}\check{f}_{h+1}](z_h)| \leq \epsilon$ holds for all state-action pair $z_h = (s_h, a_h)$ . Then with probability at least $1 - \delta/(4H)$ , it holds that
+
+$$
+\sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \leq (\bar {\beta} _ {2, h}) ^ {2},
+$$
+
+where $\bar{\beta}_{2,h} = \widetilde{O}\big(\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_b)} H^2\big)$ , and $\bar{g}_h$ is the estimated function for second-moment Bellman operator (Line 5 in Algorithm 1).
+
+Notice that all of the previous analysis focuses on the estimated function $\check{f}_{h+1}$ . By leveraging an induction procedure similar to existing works in the linear case (Jin et al., 2021b), we can control the distance between the estimated function $\check{f}_{h+1}$ and the optimal value function $f_{h+1}^{*}$ . In details, with high
+
+probability, for all stage $h \in [H]$ , the distance is upper bounded by $\widetilde{O}\left(\sqrt{\log(\mathcal{N} \cdot \mathcal{N}_b)} H^3 / \sqrt{K\kappa}\right)$ . This result allows us to further bound the difference between $[\mathrm{Var}_h f_{h+1}](s, a)$ and $[\mathrm{Var}_h f_{h+1}^*](s, a)$ . Therefore, the concentration properties in Lemmas 6.1 and 6.2 enable us to add some perturbation terms and construct a variance estimator, which satisfies the following property:
+
+$$
+\left[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} \right] (s, a) - \widetilde {O} \left(\frac {\sqrt {\log \left(\mathcal {N} \cdot \mathcal {N} _ {b}\right)} H ^ {3}}{\sqrt {K \kappa}}\right) \leq \widehat {\sigma} _ {h} ^ {2} (s, a) \leq \left[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} \right] (s, a). \tag {6.1}
+$$
+
+where $[\mathbb{V}_hV_{h + 1}^* ](s,a) = \max \{1,[\mathrm{Var}_hV_{h + 1}^* ](s,a)\}$ is the truncated conditional variance.
+
+# 6.2 REFERENCE-ADVANTAGE DECOMPOSITION
+
+To obtain the optimal dependency on the function class complexity, we need to tackle the challenge of additional error from uniform concentration over the whole function class $\mathcal{F}_h$ . To address this problem, we utilize the so-called reference-advantage decomposition technique, which was used by (Xiong et al., 2023) to achieve the optimal regret for offline RL with linear function approximation. We generalize this technique to nonlinear function approximation. We provide detailed insights into this approach as follows:
+
+$$
+\begin{array}{l} r _ {h} \left(s _ {h}, a _ {h}\right) + \widehat {f} _ {h + 1} \left(s _ {h + 1}\right) - \left[ \mathcal {T} _ {h} \widehat {f} _ {h + 1} \right] \left(s _ {h}, a _ {h}\right) = \underbrace {r _ {h} \left(s _ {h} , a _ {h}\right) + f _ {h + 1} ^ {*} \left(s _ {h + 1}\right) - \left[ \mathcal {T} _ {h} f _ {h + 1} ^ {*} \right] \left(s _ {h} , a _ {h}\right)} _ {\text {R e f e r e n c e u n c e r t a i n t y}} \\ + \underbrace {\widehat {f} _ {h + 1} (s _ {h + 1}) - f _ {h + 1} ^ {*} (s _ {h + 1}) - \left([ \mathbb {P} _ {h} \widehat {f} _ {h + 1} ] (s _ {h} , a _ {h}) - [ \mathbb {P} _ {h} f _ {h + 1} ^ {*} ] (s _ {h} , a _ {h})\right)} _ {\text {A d v a n t a g e u n c e r t a i n t y}}. \\ \end{array}
+$$
+
+We decompose the Bellman error into two parts: the Reference uncertainty and the Advantage uncertainty. For the first term, the optimal value function $f_{h+1}^{*}$ is fixed and not related to the pre-collected dataset, which circumvents additional uniform concentration over the whole function class and avoids any dependence on the function class complexity. For the second term, it is worth noticing that the distance between the estimated function $\widehat{f}_{h+1}$ and the optimal value function $f_{h}^{*}$ decreases with the speed of $O(1 / \sqrt{K\kappa})$ . Though, we still need to maintain the uniform convergence guarantee, the Advantage uncertainty is dominated by the Reference uncertainty when the number of episodes $K$ is large enough. Such an analysis approach has been first studied in the online RL setting (Azar et al., 2017; Zhang et al., 2021; Hu et al., 2022; He et al., 2022; Agarwal et al., 2023) and later in the offline environment by Xiong et al. (2023). Previous works, such as Yin et al. (2022b), didn't adapt the reference-advantage decomposition analysis to their nonlinear function class, resulting in a parameter space dependence that scales with $d$ , instead of the optimal $\sqrt{d}$ . By integrating these results, we can prove a variance-weighted concentration inequality for Bellman operators.
+
+Lemma 6.3. For each stage $h \in [H]$ , assuming the variance estimator $\widehat{\sigma}_h$ satisfies (6.1), let $\widehat{f}_{h+1}(\cdot, \cdot) \leq H$ be the estimated value function constructed in Algorithm 1 Line 14. Then with probability at least $1 - \delta/(4H)$ , it holds that $\sum_{k \in [K]} \frac{1}{(\widehat{\sigma}_h(z_h^k))^2} \left( [\mathcal{T}_h \widehat{f}_{h+1}] (z_h^k) - \widetilde{f}_h(z_h^k) \right)^2 \leq (\beta_h)^2$ , where $\beta_h = \widetilde{O}(\sqrt{\log \mathcal{N}})$ and $\widetilde{f}_h$ is the estimated function from the weighted ridge regression (Line 12 in Algorithm 1).
+
+After controlling the Bellman error, with a similar argument to Jin et al. (2021b), we obtain the following lemma, which provides an upper bound for the regret.
+
+Lemma 6.4 (Regret Decomposition Property). If $\left| [\mathcal{T}_h \widehat{f}_{h+1}(z) - \widetilde{f}_h(z)] \right| \leq b_h(z)$ holds for all stage $h \in [H]$ and state-action pair $z = (s, a) \in S \times \mathcal{A}$ , then the suboptimality of the output policy $\widehat{\pi}$ in Algorithm 1 can be bounded as
+
+$$
+V _ {1} ^ {*} (s) - V _ {1} ^ {\widehat {\pi}} (s) \leq 2 \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ b _ {h} \left(s _ {h}, a _ {h}\right) \mid s _ {1} = s \right].
+$$
+
+Here, the expectation $\mathbb{E}_{\pi^*}$ is with respect to the trajectory induced by $\pi^{*}$ in the underlying MDP.
+
+Combining the results in Lemmas 6.3 and 6.4, we have proved Theorem 5.1.
+
+# 7 CONCLUSION AND FUTURE WORK
+
+In this paper, we present Pessimistic Nonlinear Least-Square Value Iteration (PNLSVI), an oracle-efficient algorithm for offline RL with non-linear function approximation. Our result matches the lower bound proved in Xiong et al. (2023) when specialized to linear function approximation. We notice that our uniform coverage assumption can sometimes be strong in practice. In our future work, we plan to relax this assumption by devising algorithms for nonlinear function classes under a partial coverage assumption.
+
+# ACKNOWLEDGEMENTS
+
+We thank the anonymous reviewers and area chair for their helpful comments. QD, HZ, JH and QG are supported in part by the National Science Foundation CAREER Award 1906169, CPS-2312094, Amazon Research Award and the Sloan Research Fellowship. JH is also supported in part by Amazon PhD Fellowship. The views and conclusions contained in this paper are those of the authors and should not be interpreted as representing any funding agencies.
+
+# REFERENCES
+
+Alekh Agarwal and Tong Zhang. Model-based rl with optimistic posterior sampling: Structural conditions and sample complexity. arXiv preprint arXiv:2206.07659, 2022.
+Alekh Agarwal, Yujia Jin, and Tong Zhang. Vo q l: Towards optimal regret in model-free rl with nonlinear function approximation. In The Thirty Sixth Annual Conference on Learning Theory, pp. 987-1063. PMLR, 2023.
+Alex Ayoub, Zeyu Jia, Csaba Szepesvari, Mengdi Wang, and Lin Yang. Model-based reinforcement learning with value-targeted regression. In International Conference on Machine Learning, pp. 463-474. PMLR, 2020.
+Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax regret bounds for reinforcement learning. In International Conference on Machine Learning, pp. 263-272. PMLR, 2017.
+Nicolo Cesa-Bianchi and Gábor Lugosi. Prediction, learning, and games. Cambridge university press, 2006.
+Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. In International Conference on Machine Learning, pp. 1042-1051. PMLR, 2019.
+Ching-An Cheng, Tengyang Xie, Nan Jiang, and Alekh Agarwal. Adversarily trained actor critic for offline reinforcement learning. In International Conference on Machine Learning, pp. 3852-3878. PMLR, 2022.
+Christoph Dann, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. On oracle-efficient pacrl with rich observations. Advances in neural information processing systems, 31, 2018.
+Jonas Degrave, Federico Felici, Jonas Buchli, Michael Neunert, Brendan Tracey, Francesco Carpanese, Timo Ewalds, Roland Hafner, Abbas Abdelmaleki, Diego de Las Casas, et al. Magnetic control of tokamak plasmas through deep reinforcement learning. Nature, 602(7897):414-419, 2022.
+Simon Du, Sham Kakade, Jason Lee, Shachar Lovett, Gaurav Mahajan, Wen Sun, and Ruosong Wang. Bilinear classes: A structural framework for provable generalization in rl. In International Conference on Machine Learning, pp. 2826-2836. PMLR, 2021.
+Simon S Du, Sham M Kakade, Ruosong Wang, and Lin F Yang. Is a good representation sufficient for sample efficient reinforcement learning? arXiv preprint arXiv:1910.03016, 2019.
+Dylan Foster, Alekh Agarwal, Miroslav Dudík, Haipeng Luo, and Robert Schapire. Practical contextual bandits with regression oracles. In International Conference on Machine Learning, pp. 1539-1548. PMLR, 2018.
+Dylan J Foster, Sham M Kakade, Jian Qian, and Alexander Rakhlin. The statistical complexity of interactive decision making. arXiv preprint arXiv:2112.13487, 2021.
+Claudio Gentile, Zhilei Wang, and Tong Zhang. Achieving minimax rates in pool-based batch active learning. In International Conference on Machine Learning, pp. 7339-7367. PMLR, 2022.
+Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In 2017 IEEE international conference on robotics and automation (ICRA), pp. 3389-3396. IEEE, 2017.
+Jiafan He, Dongruo Zhou, and Quanquan Gu. Logarithmic regret for reinforcement learning with linear function approximation. In International Conference on Machine Learning, pp. 4171-4180. PMLR, 2021.
+
+Jiafan He, Heyang Zhao, Dongruo Zhou, and Quanquan Gu. Nearly minimax optimal reinforcement learning for linear markov decision processes. arXiv preprint arXiv:2212.06132, 2022.
+Pihe Hu, Yu Chen, and Longbo Huang. Nearly minimax optimal reinforcement learning with linear function approximation. In International Conference on Machine Learning, pp. 8971-9019. PMLR, 2022.
+Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning, pp. 1704–1713. PMLR, 2017.
+Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pp. 2137-2143. PMLR, 2020.
+Chi Jin, Qinghua Liu, and Sobhan Miryoosefi. Bellman eluder dimension: New rich classes of rl problems, and sample-efficient algorithms. Advances in neural information processing systems, 34:13406-13418, 2021a.
+Ying Jin, Zhuoran Yang, and Zhaoran Wang. Is pessimism provably efficient for offline rl? In International Conference on Machine Learning, pp. 5084-5096. PMLR, 2021b.
+Dingwen Kong, Ruslan Salakhutdinov, Ruosong Wang, and Lin F Yang. Online sub-sampling for reinforcement learning with general function approximation. arXiv preprint arXiv:2106.07203, 2021.
+Akshay Krishnamurthy, Alekh Agarwal, Tzu-Kuo Huang, Hal Daumé III, and John Langford. Active learning for cost-sensitive classification. In International Conference on Machine Learning, pp. 1915-1924. PMLR, 2017.
+Sergey Levine, Peter Pastor, Alex Krizhevsky, Julian Ibarz, and Deirdre Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. The International journal of robotics research, 37(4-5):421-436, 2018.
+Gen Li, Laixi Shi, Yuxin Chen, Yuejie Chi, and Yuting Wei. Settling the sample complexity of model-based offline reinforcement learning. arXiv preprint arXiv:2204.05275, 2022.
+Yifei Min, Tianhao Wang, Dongruo Zhou, and Quanquan Gu. Variance-aware off-policy evaluation with linear function approximation. Advances in neural information processing systems, 34: 7598-7610, 2021.
+Aditya Modi, Nan Jiang, Ambuj Tewari, and Satinder Singh. Sample complexity of reinforcement learning using linearly combined model ensembles. In International Conference on Artificial Intelligence and Statistics, pp. 2010-2020. PMLR, 2020.
+Thanh Nguyen-Tang and Raman Arora. Viper: Provably efficient algorithm for offline rl with neural function approximation. In The Eleventh International Conference on Learning Representations, 2023.
+Thanh Nguyen-Tang, Ming Yin, Sunil Gupta, Svetha Venkatesh, and Raman Arora. On instance-dependent bounds for offline reinforcement learning with linear function approximation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 9310-9318, 2023.
+Asuman E Ozdaglar, Sarath Pattathil, Jiawei Zhang, and Kaiqing Zhang. Revisiting the linear-programming framework for offline rl with general function approximation. In International Conference on Machine Learning, pp. 26769-26791. PMLR, 2023.
+Paria Rashidinejad, Banghua Zhu, Cong Ma, Jiantao Jiao, and Stuart Russell. Bridging offline reinforcement learning and imitation learning: A tale of pessimism. Advances in Neural Information Processing Systems, 34:11702-11716, 2021.
+Paria Rashidinejad, Hanlin Zhu, Kunhe Yang, Stuart Russell, and Jiantao Jiao. Optimal conservative offline rl with general function approximation via augmented lagrangian. In The Eleventh International Conference on Learning Representations, 2022.
+
+Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, et al. Mastering atari, go, chess and shogi by planning with a learned model. Nature, 588(7839):604-609, 2020.
+Laixi Shi, Gen Li, Yuting Wei, Yuxin Chen, and Yuejie Chi. Pessimistic q-learning for offline reinforcement learning: Towards optimal sample complexity. In International Conference on Machine Learning, pp. 1996-20025. PMLR, 2022.
+David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354-359, 2017.
+Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Model-based rl in contextual decision processes: Pac bounds and exponential improvements over model-free approaches. In Conference on learning theory, pp. 2898-2933. PMLR, 2019.
+Masatoshi Uehara and Wen Sun. Pessimistic model-based offline reinforcement learning under partial coverage. In International Conference on Learning Representations, 2021.
+Ruosong Wang, Dean P Foster, and Sham M Kakade. What are the statistical limits of offline rl with linear function approximation? arXiv preprint arXiv:2010.11895, 2020a.
+Ruosong Wang, Russ R Salakhutdinov, and Lin Yang. Reinforcement learning with general value function approximation: Provably efficient approach via bounded eluder dimension. Advances in Neural Information Processing Systems, 33:6123-6135, 2020b.
+Yining Wang, Ruosong Wang, Simon Shaolei Du, and Akshay Krishnamurthy. Optimism in reinforcement learning with generalized linear function approximation. In International Conference on Learning Representations, 2020c.
+Gellert Weisz, Philip Amortila, and Csaba Szepesvári. Exponential lower bounds for planning in mdps with linearly-realizable optimal action-value functions. In Algorithmic Learning Theory, pp. 1237-1264. PMLR, 2021.
+Tengyang Xie, Ching-An Cheng, Nan Jiang, Paul Mineiro, and Alekh Agarwal. Bellman-consistent pessimism for offline reinforcement learning. Advances in neural information processing systems, 34:6683-6694, 2021a.
+Tengyang Xie, Nan Jiang, Huan Wang, Caiming Xiong, and Yu Bai. Policy finetuning: Bridging sample-efficient offline and online reinforcement learning. Advances in neural information processing systems, 34:27395-27407, 2021b.
+Wei Xiong, Han Zhong, Chengshuai Shi, Cong Shen, Liwei Wang, and Tong Zhang. Nearly minimax optimal offline reinforcement learning with linear function approximation: Single-agent mdp and markov game. In International Conference on Learning Representations (ICLR), 2023.
+Lin Yang and Mengdi Wang. Sample-optimal parametric q-learning using linearly additive features. In International Conference on Machine Learning, pp. 6995-7004, 2019.
+Lin Yang and Mengdi Wang. Reinforcement learning in feature space: Matrix bandit, kernels, and regret bound. In International Conference on Machine Learning, pp. 10746-10756. PMLR, 2020.
+Chenlu Ye, Wei Xiong, Quanquan Gu, and Tong Zhang. Corruption-robust algorithms with uncertainty weighting for nonlinear contextual bandits and markov decision processes. In International Conference on Machine Learning, pp. 39834–39863. PMLR, 2023.
+Ming Yin and Yu-Xiang Wang. Towards instance-optimal offline reinforcement learning with pessimism. Advances in neural information processing systems, 34:4065-4078, 2021.
+Ming Yin, Yaqi Duan, Mengdi Wang, and Yu-Xiang Wang. Near-optimal offline reinforcement learning with linear representation: Leveraging variance information with pessimism. arXiv preprint arXiv:2203.05804, 2022a.
+
+Ming Yin, Mengdi Wang, and Yu-Xiang Wang. Offline reinforcement learning with differentiable function approximation is provably efficient. In The Eleventh International Conference on Learning Representations, 2022b.
+Andrea Zanette, David Brandfonbrener, Emma Brunskill, Matteo Pirotta, and Alessandro Lazaric. Frequentist regret bounds for randomized least-squares value iteration. In International Conference on Artificial Intelligence and Statistics, pp. 1954-1964. PMLR, 2020a.
+Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal policies with low inherent bellman error. In International Conference on Machine Learning, pp. 10978-10989. PMLR, 2020b.
+Andrea Zanette, Martin J Wainwright, and Emma Brunskill. Provable benefits of actor-critic methods for offline reinforcement learning. Advances in neural information processing systems, 34:13626-13640, 2021.
+Wenhao Zhan, Baihe Huang, Audrey Huang, Nan Jiang, and Jason Lee. Offline reinforcement learning with realizability and single-policy concentrability. In Conference on Learning Theory, pp. 2730-2775. PMLR, 2022.
+Zihan Zhang, Xiangyang Ji, and Simon Du. Is reinforcement learning more difficult than bandits? a near-optimal algorithm escaping the curse of horizon. In Conference on Learning Theory, pp. 4528-4531. PMLR, 2021.
+Han Zhong, Wei Xiong, Jiyuan Tan, Liwei Wang, Tong Zhang, Zhaoran Wang, and Zhuoran Yang. Pessimistic minimax value iteration: Provably efficient equilibrium learning from offline datasets. In International Conference on Machine Learning, pp. 27117-27142. PMLR, 2022.
+Dongruo Zhou, Quanquan Gu, and Csaba Szepesvari. Nearly minimax optimal reinforcement learning for linear mixture markov decision processes. In Conference on Learning Theory, pp. 4532-4576. PMLR, 2021.
+Hanlin Zhu, Paria Rashidinejad, and Jiantao Jiao. Importance weighted actor-critic for optimal conservative offline reinforcement learning. arXiv preprint arXiv:2301.12714, 2023.
+
+# A COMPARISON OF OFFLINE RL ALGORITHMS
+
+In this section, we make a comparison between different offline RL algorithms, concerning their algorithm type, function approximation class, data coverage assumption, used oracles, and regret type. In the upper part are the algorithms with worst-case regret, while in the lower part are those with instance-dependent regret.
+
+Table 1: Comparison of offline RL algorithms in terms of algorithm type, function classes, data coverage assumption, types of oracle and regret-type.
+
+
Algorithm
Algorithm Type
Function Classes
Data Coverage
Types of Oracle
Regret Type
Xie et al. (2021a)
Bellman-consistent Pessimism
General
Partial
Optimization on Policy and Function Class
Worst-case
CPPO-TV Uehara & Sun (2021)
MLE
General
Partial
Optimization on Policy and Hypothesis Class
Worst-case
CORAL Rashidinejad et al. (2022)
Augmented Lagrangian with MIS
General
Partial
Optimization on Policy and Function Class
Worst-case
Reformulated LP Ozdaglar et al. (2023)
Linear Program
General
Partial
Linear Programming
Worst-case
ATAC Cheng et al. (2022)
Actor Critic
General
Partial
No-regret Policy Optimization and Optimization on the Function Class
Worst-case
A-Crab Zhu et al. (2023)
Actor Critic
General
Partial
No-regret Policy Optimization and Optimization on the Function Class
Worst-case
LinPEVI-ADV+ Xiong et al. (2023)
LSVI-type
Linear
Uniform
/
Instance-dependent
PFQL Yin et al. (2022b)
LSVI-type
Differentiable
Uniform
Gradient Oracle and Optimization on the Function Class
Instance-dependent
PNLSVI (Our work)
LSVI-type
General
Uniform
Regression Oracle
Instance-dependent
+
+# B COMPARISON OF DATA COVERAGE ASSUMPTIONS
+
+In Yin et al. (2022b), they studied the general differentiable function class, where the function class can be denoted by
+
+$$
+\mathcal {F} := \left\{f \big (\boldsymbol {\theta}, \phi (\cdot , \cdot) \big): \mathcal {X} \times \mathcal {A} \to \mathbb {R}, \boldsymbol {\theta} \in \Theta \right\}.
+$$
+
+In this definition, $\Psi$ is a compact subset, and $\phi(\cdot, \cdot): \mathcal{X} \times \mathcal{A} \to \Psi \subseteq \mathbb{R}^m$ is a feature map. The parameter space $\Theta$ is a compact subset $\Theta \subseteq \mathbb{R}^d$ . The function $f: \mathbb{R}^d \times \mathbb{R}^m \to \mathbb{R}$ satisfies the following smoothness conditions:
+
+- For any vector $\phi \in \mathbb{R}^m$ , $f(\theta, \phi)$ is third-time differentiable with respect to the parameter $\theta$ .
+- Functions $f, \partial_{\theta}f, \partial_{\theta,\theta}^{2}f, \partial_{\theta,\theta,\theta}^{3}f$ are jointly continuous for $(\theta, \phi)$ .
+
+Under this definition, Yin et al. (2022b) introduce the following coverage assumption (Assumption 2.3) such that for all stage $h \in [H]$ , there exists a constant $\kappa$ ,
+
+$$
+\mathbb {E} _ {d _ {h} ^ {\mu}} \left[ \left(f (\boldsymbol {\theta} _ {1}, \phi (x, a)) - f (\boldsymbol {\theta} _ {2}, \phi (x, a))\right) ^ {2} \right] \geq \kappa \| \boldsymbol {\theta} _ {1} - \boldsymbol {\theta} _ {2} \| _ {2} ^ {2}, \forall \boldsymbol {\theta} _ {1}, \boldsymbol {\theta} _ {2} \in \Theta ; (*)
+$$
+
+$$
+\mathbb {E} _ {d _ {h} ^ {\mu}} \left[ \nabla f (\boldsymbol {\theta}, \phi (x, a)) \nabla f (\boldsymbol {\theta}, \phi (x, a)) ^ {\top} \right] \succ \kappa I, \forall \boldsymbol {\theta} \in \Theta . (*)
+$$
+
+It is worth noting that our assumption 3.6 is weaker than this assumption. For any compact sets $\Theta, \Psi$ and continuous function $f$ , there always exist a constant $\kappa_0 > 0$ such that $f$ is $\kappa_0$ -Lipschitz with respect to the parameter $\theta$ , i.e:
+
+$$
+\left| f \left(\boldsymbol {\theta} _ {1}, \phi\right) - f \left(\boldsymbol {\theta} _ {2}, \phi\right) \right| \leq \kappa_ {0} \| \boldsymbol {\theta} _ {1} - \boldsymbol {\theta} _ {2} \| _ {2}, \forall \boldsymbol {\theta} _ {1}, \boldsymbol {\theta} _ {2} \in \Theta , \phi \in \Psi .
+$$
+
+Therefore, the coverage assumption in Yin et al. (2022b) implies that
+
+$$
+\begin{array}{l} \mathbb {E} _ {d _ {h} ^ {\mu}} \left[ \left(f (\boldsymbol {\theta} _ {1}, \phi (\cdot , \cdot)) - f (\boldsymbol {\theta} _ {2}, \phi (\cdot , \cdot))\right) ^ {2} \right] \geq \kappa \| \boldsymbol {\theta} _ {1} - \boldsymbol {\theta} _ {2} \| _ {2} ^ {2} \\ \geq \frac {\kappa}{\kappa_ {0} ^ {2}} \sup _ {(x, a) \in \mathcal {X} \times \mathcal {A}} \left(f (\pmb {\theta} _ {1}, \pmb {\phi} (x, a)) - f (\pmb {\theta} _ {2}, \pmb {\phi} (x, a))\right) ^ {2}. \\ \end{array}
+$$
+
+Our assumption can be reduced to their first assumption $(^{*})$ . We do not need the second assumption $(^{**})$ .
+
+In addition, for the linear function class, the coverage assumption in Yin et al. (2022b) will reduce to the following linear function coverage assumption(Wang et al., 2020a; Min et al., 2021; Yin et al., 2022a; Xiong et al., 2023).
+
+$$
+\lambda_ {\min } (\mathbb {E} _ {\mu , h} [ \phi (x, a) \phi (x, a) ^ {\top} ]) = \kappa > 0, \forall h \in [ H ].
+$$
+
+Therefore, our assumption is also weaker than the linear function coverage assumption when dealing with the linear function class.
+
+# C DISCUSSION ON THE CALCULATION OF THE BONUS FUNCTION
+
+To obtain the bonus function satisfying the required properties, we need to consider the constraint optimization problem
+
+$$
+\left. \max \left\{\left| f _ {1} \left(z _ {h}\right) - f _ {2} \left(z _ {h}\right) \right|, f _ {1}, f _ {2} \in \mathcal {F} _ {h}: \sum_ {k \in [ K ]} \frac {\left(f _ {1} \left(z _ {h} ^ {k}\right) - f _ {2} \left(z _ {h} ^ {k}\right)\right) ^ {2}}{\left(\widehat {\sigma} _ {h} \left(s _ {h} ^ {k} , a _ {h} ^ {k}\right)\right) ^ {2}} \leq \left(\beta_ {h}\right) ^ {2} \right\}. \right. \tag {C.1}
+$$
+
+We utilize the online subsampling framework presented in Wang et al. (2020b); Kong et al. (2021) to an offline dataset. Additionally, we generalize the idea of Kong et al. (2021) to the weighted problem. Using the shorthand expression
+
+$$
+\| f \| _ {\widehat {\sigma} _ {h}, \mathcal {D} _ {h}} ^ {2} = \sum_ {k \in [ K ]} \frac {(f (z _ {h} ^ {k})) ^ {2}}{(\widehat {\sigma} _ {h} (s _ {h} ^ {k} , a _ {h} ^ {k})) ^ {2}},
+$$
+
+we aim to estimate the solution of the following constraint optimization problem.
+
+$$
+\min _ {f _ {1}, f _ {2}} \| f _ {1} - f _ {2} \| _ {\bar {\sigma} _ {h}, \mathcal {D} _ {h}} ^ {2} + \frac {w}{2} (f _ {1} (s, a) - f _ {2} (s, a) - 2 L) ^ {2}. \tag {C.2}
+$$
+
+# Algorithm 2 Binary Search
+
+1: Input: Dataset $\mathcal{D}_h = \{s_h^k, a_h^k, r_h^k\}_{k=1}^K$ , objective $z = (s, a)$ , $\beta_h$ , precision $\alpha$
+2: $\mathcal{G}\gets \mathcal{F}_h - \mathcal{F}_h$
+3: Define $R(g, w) \coloneqq \| g \|_{\hat{\sigma}_{h}, \mathcal{D}_{h}}^{2} + \frac{w}{2} (g(s, a) - 2(L + 1))^{2}, \forall g \in \mathcal{G}$
+4: $w_{L}\gets 0,w_{H}\gets \beta_{h} / (\alpha (L + 1))$
+5: $g_{L} \gets 0, z_{L} \gets 0$
+6: $g_{H}\gets \operatorname{argmin}_{g\in \mathcal{G}}R(g,w_{H}),z_{H}\gets g_{H}(s,a)$
+7: $\Delta \gets \alpha \beta /(8(\bar{L} +1)^3)$
+8: while $|z_{H} - z_{L}| > \alpha$ and $|w_{H} - w_{L}| > \Delta$ do
+9: $\widetilde{w} \gets (w_H + w_L) / 2$
+10: $\widetilde{g} \gets \operatorname{argmin}_{g \in \mathcal{G}} R(g, \widetilde{w}), \widetilde{z} \gets \widetilde{g}(s, a)$
+11: if $\| \widetilde{g} \|_{\hat{\sigma}_{h},\mathcal{D}_h}^2 >\beta_h$ then
+12: $w_{H}\gets \widetilde{w},z_{H}\gets \widetilde{z}$
+13: else
+14: $w_{L}\gets \widetilde{w},z_{L}\gets \widetilde{z}$
+15: end if
+16: end while
+17: Output: $z_{H}$
+
+The binary search algorithm is similar to Kong et al. (2021), which utilizes the oracle for variance-weighted ridge regression in Lines 6 and 10. It reduces the computational complexity of the constrained optimization problem given by (C.1), limiting it to a finite number of calls to the regression oracle. If the function class $\mathcal{F}_h$ is convex, the binary search algorithm can solve the optimization problem (C.1) up to a precision of $\alpha$ with $O(\log(1/\alpha))$ calls of the regression oracle. We summarize the result in the following theorem. If $\mathcal{F}_h$ is not convex, the method of Krishnamurthy et al. (2017) can solve the problem with $O(1/\alpha)$ calls of the regression oracle.
+
+Theorem C.1. Assume the optimal solution of the optimization problem (C.1) is $g^{*} = f_{1}^{*} - f_{2}^{*}$ and the function class $\mathcal{F}_h$ is convex and closed under pointwise convergence, then Algorithm 2 terminate after $O(\log(1/\alpha))$ calls of the regression oracle and the returned values satisfy
+
+$$
+\left| z _ {H} - g ^ {*} (s, a) \right| \leq \alpha .
+$$
+
+Proof of Theorem C.1. Easy to see $\mathcal{G} = \mathcal{F}_h - \mathcal{F}_h$ is also convex. We then follow the proof of Theorem 1 of Foster et al. (2018).
+
+
+
+To see the solution of optimization problem C.1 satisfies the condition of the bonus function, we recall the definition of the $D^2$ -divergence
+
+$$
+D _ {\mathcal {F} _ {h}} ^ {2} (z; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) = \sup _ {f _ {1}, f _ {2} \in \mathcal {F} _ {h}} \frac {(f _ {1} (z) - f _ {2} (z)) ^ {2}}{\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} (f _ {1} (z _ {h} ^ {k}) - f _ {2} (z _ {h} ^ {k})) ^ {2} + \lambda}.
+$$
+
+Therefore, for any $f_1, f_2 \in \mathcal{F}_h$ satisfying $\sum_{k \in [K]} \frac{1}{(\widehat{\sigma}_h(z_h^k))^2} (f_1(z_h^k) - f_2(z_h^k))^2 \leq (\beta_h^2)$ , we have
+
+$$
+\left| f _ {1} (z _ {h}) - f _ {2} (z _ {h}) \right| \leq D _ {\mathcal {F} _ {h}} (z; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) \sqrt {(\beta_ {h}) ^ {2} + \lambda}.
+$$
+
+# D ANALYSIS OF THE VARIANCE ESTIMATOR
+
+In this section, our main objective is to prove that our variance estimators are close to the truncated variance of the optimal value function $[\mathbb{V}_h V_{h+1}^*](s, a)$ . The following lemmas are helpful in the proof of Lemma D.4. To start with, we need an upper bound of the $D^2$ -divergence for a large dataset.
+
+Lemma D.1. Let $\mathcal{D}_h$ be the dataset satisfying Assumption 3.6. When the size of data set satisfies $K\geq \widetilde{\Omega}\left(\frac{\log\mathcal{N}}{\kappa^2}\right)$ , with probability at least $1 - \delta$ , for each state-action pair $z$ , we have
+
+$$
+D _ {\mathcal {F} _ {h}} (z, \mathcal {D} _ {h}, 1) = \widetilde {O} \left(\frac {1}{\sqrt {K \kappa}}\right).
+$$
+
+Lemma 6.1 and Lemma 6.2 show the confidence radius for the first and second-order Bellman error, which is essential in our proof. Here we restate them with more accurate parameter choices.
+
+Lemma D.2 (Restatement of Lemma 6.1). For any stage $h \in [H]$ , let $\check{f}_{h+1}(\cdot, \cdot) \leq H$ be the estimated value function constructed in Algorithm 1 Line 7. By utilizing Assumption 3.3, there exists a function $\bar{f}_h' \in \mathcal{F}_h$ , satisfying that $|\bar{f}_h'(z_h) - [\mathcal{T}_h\check{f}_{h+1}](z_h)| \leq \epsilon$ holds for all state-action pair $z_h = (s_h, a_h)$ . Then with probability at least $1 - \delta/(4H)$ , it holds that
+
+$$
+\sum_ {k \in [ K ]} \left(\bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \leq (\bar {\beta} _ {1, h}) ^ {2},
+$$
+
+where $\bar{\beta}_{1,h} = \widetilde{O}\left(\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_b)} H\right)$ , and $\bar{f}_h$ is the estimated function for first-moment Bellman operator (Line 4 in Algorithm 1).
+
+Lemma D.3 (Restatement of Lemma 6.1). For any stage $h \in [H]$ , let $\bar{f}_{h+1}(\cdot, \cdot) \leq H$ be the estimated value function constructed in Algorithm 1 Line 7. By utilizing Assumption 3.3, there exists a function $\bar{g}_h' \in \mathcal{F}_h$ , satisfying that $|\bar{g}_h'(z_h) - [\mathcal{T}_{2,h}\check{f}_{h+1}](z_h)| \leq \epsilon$ holds for all state-action pair $z_h = (s_h, a_h)$ . Then with probability at least $1 - \delta/(4H)$ , it holds that
+
+$$
+\sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \leq (\bar {\beta} _ {2, h}) ^ {2},
+$$
+
+where $\bar{\beta}_{2,h} = \widetilde{O}\big(\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_b)} H^2\big)$ , and $\bar{g}_h$ is the estimated function for second-moment Bellman operator (Line 5 in Algorithm 1).
+
+Recall the definition of the variance estimator.
+
+$$
+\begin{array}{l} \bar {f} _ {h} = \operatorname * {a r g m i n} _ {f _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \left(f _ {h} (\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2} \\ \bar {g} _ {h} = \underset {g _ {h} \in \mathcal {F} _ {h}} {\operatorname {a r g m i n}} \sum_ {k \in [ K ]} \left(g _ {h} (\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}) - \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2}\right) ^ {2}. \\ \end{array}
+$$
+
+The variance estimator is defined as:
+
+$$
+\widehat {\sigma} _ {h} ^ {2} (s, a) := \max \left\{1, \bar {g} _ {h} (s, a) - \left(\bar {f} _ {h} (s, a)\right) ^ {2} - \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right) \right\}.
+$$
+
+We can prove the following lemma:
+
+Lemma D.4. with probability at least $1 - \delta /2$ , for any $h\in [H]$ , the variance estimator designed above satisfies:
+
+$$
+[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (s, a) - \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right) \leq \widehat {\sigma} _ {h} ^ {2} (s, a) \leq [ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (s, a).
+$$
+
+Proof of Lemma D.4. We write $\mathbb{B}_h(s,a) = \bar{g}_h(s,a) - (\bar{f}_h(s,a))^2$ . We first bound the difference between $\mathbb{B}_h(s,a)$ and $[\mathrm{Var}_h\check{f}_{h + 1}](s,a)$ . By the definition of conditional variance, we have
+
+$$
+\left| \mathbb {B} _ {h} (s, a) - [ \operatorname {V a r} _ {h} \check {f} _ {h + 1} ] (s, a) \right| \leq \left| \bar {g} _ {h} (s, a) - [ \mathcal {T} _ {2, h} \check {f} _ {h + 1} ] (s, a) \right| + \left| (\bar {f} _ {h} (s, a)) ^ {2} - ([ \mathcal {T} _ {h} \check {f} _ {h + 1} ] (s, a)) ^ {2} \right|,
+$$
+
+where we use our definition of Bellman operators. By Assumption 3.3, there exists $\bar{f}_h^\prime \in \mathcal{F}_h$ , $\bar{g}_h^\prime \in \mathcal{F}_h$ such that for all $(s,a)$
+
+$$
+\left| \bar {f} _ {h} ^ {\prime} (s, a) - \left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] (s, a) \right| \leq \epsilon \tag {D.1}
+$$
+
+$$
+\left| \bar {g} _ {h} ^ {\prime} (s, a) - \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] (s, a) \right| \leq \epsilon . \tag {D.2}
+$$
+
+Then by Lemma D.2, with probability at least $1 - \delta /(4H^2)$ , the following inequality holds
+
+$$
+\sum_ {k \in [ K ]} \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2} \leq (\bar {\beta} _ {1, h}) ^ {2}. \tag {D.3}
+$$
+
+Similarly, for the second-order term, using Lemma D.3, with probability at least $1 - \delta /(4H^2)$ , the following inequality holds
+
+$$
+\sum_ {k \in [ K ]} \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2} \leq \left(\bar {\beta} _ {2, h}\right) ^ {2}. \tag {D.4}
+$$
+
+After taking a union bound, with probability at least $1 - \delta/(2H)$ , (D.3) and (D.4) hold for all $h \in [H]$ simultaneously. Consequently, we focus on this high probability event and prove that
+
+$$
+\begin{array}{l} \left| \bar {g} _ {h} (s, a) - \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] (s, a) \right| + \left| \left(\bar {f} _ {h} (s, a)\right) ^ {2} - \left([ \mathcal {T} _ {h} \check {f} _ {h + 1} ] (s, a)\right) ^ {2} \right| \\ \leq \epsilon + | \bar {g} _ {h} (s, a) - \bar {g} _ {h} ^ {\prime} (s, a) | + O (H) \cdot \left[ | \bar {f} _ {h} (s, a) - \bar {f} _ {h} ^ {\prime} (s, a) | + \epsilon \right] \\ = O (H) \cdot \epsilon + \frac {\left| \bar {g} _ {h} (s , a) - \bar {g} _ {h} ^ {\prime} (s , a) \right|}{\sqrt {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \lambda}} \cdot \sqrt {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \lambda}. \\ + O (H) \cdot \frac {\left| \bar {f} _ {h} (s , a) - \bar {f} _ {h} ^ {\prime} (s , a) \right|}{\sqrt {\sum_ {k \in [ K ]} \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \lambda}} \cdot \sqrt {\sum_ {k \in [ K ]} \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \lambda}. \\ \leq O (H) \cdot \epsilon + \frac {\left| \bar {g} _ {h} (s , a) - \bar {g} _ {h} ^ {\prime} (s , a) \right|}{\sqrt {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \lambda}} \cdot \sqrt {(\bar {\beta} _ {2 , h}) ^ {2} + \lambda} \\ + O (H) \cdot \frac {| \bar {f} _ {h} (s , a) - \bar {f} _ {h} ^ {\prime} (s , a) |}{\sqrt {\sum_ {k \in [ K ]} \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \lambda}} \cdot \sqrt {(\bar {\beta} _ {1 , h}) ^ {2} + \lambda} \\ \leq \widetilde {O} (\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {2}) \cdot D _ {\mathcal {F} _ {h}} (z, \mathcal {D} _ {h} ^ {\prime}, 1) \\ \leq \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {2}}{\sqrt {K \kappa}}\right), \\ \end{array}
+$$
+
+where the first inequality holds due to the completeness assumption. The second inequality holds due to (D.3) and (D.4). The third inequality holds due to Definition 3.4. The last inequality holds due to Lemma D.1. Therefore, we have
+
+$$
+\left| \mathbb {B} _ {h} (s, a) - \left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) \right| \leq \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {2}}{\sqrt {K \kappa}}\right). \tag {D.5}
+$$
+
+To further bound the difference between $\left[\operatorname{Var}_h\check{f}_{h+1}\right](s,a)$ and $\left[\operatorname{Var}_hV_{h+1}^*\right](s,a)$ , we prove $\left\| \check{f}_{h+1} - V_{h+1}^*\right\|_{\infty} \leq \widetilde{O}\left(\frac{\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_b)}H^3}{\sqrt{K\kappa}}\right)$ by induction.
+
+At horizon $H + 1$ , $\tilde{f}_{H + 1} = V_{H + 1}^{*} = 0$ , the inequality holds naturally. At horizon $H$ , we have
+
+$$
+\begin{array}{l} Q _ {H} ^ {*} (s, a) = \left[ \mathcal {T} _ {H} V _ {H + 1} ^ {*} \right] (s, a) \\ = \left[ T _ {H} \check {f} _ {H + 1} \right] (s, a) \\ \geq \bar {f} _ {H} (s, a) - | \left[ \mathcal {T} _ {H} \check {f} _ {H + 1} \right] (s, a) - \bar {f} _ {H} (s, a) | \\ \geq \bar {f} _ {H} (s, a) - (\epsilon + | \bar {f} _ {H} ^ {\prime} (s, a) - \bar {f} _ {H} (s, a) |) \\ \geq \bar {f} _ {H} (s, a) - \bar {b} _ {H} (s, a) - \epsilon \\ = \check {f} _ {H} (s, a), \\ \end{array}
+$$
+
+where the first inequality holds due to the triangle inequality. The second inequality holds due to (D.1). The third inequality holds due to the property of the bonus function $\bar{b}_H$ and (D.3). The last equality holds due to our definition of $\check{f}_H$ in Algorithm 1 Line 7. Therefore, $V_H^*(s) \geq \check{f}_H(s)$ for all $s \in S$ .
+
+We denote the policy derived from $\tilde{f}_H$ by $\check{\pi}_H$ , i.e. $\check{\pi}_H(s) = \operatorname{argmax}_a \tilde{f}_H(s, a)$ and then we have
+
+$$
+\begin{array}{l} V _ {H} ^ {*} (s) - \check {f} _ {H} (s) = \langle Q _ {H} ^ {*} (s, \cdot) - \check {f} _ {H} (s, \cdot), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} + \langle \check {f} _ {H} (s, \cdot), \pi_ {H} ^ {*} (\cdot | s) - \check {\pi} _ {H} (\cdot | s) \rangle_ {\mathcal {A}} \\ \leq \left\langle Q _ {H} ^ {*} (s, \cdot) - \check {J} _ {H} (s, \cdot), \pi^ {*} (\cdot | s) \right\rangle_ {\mathcal {A}} \\ = \left\langle \left[ \mathcal {T} _ {H} V _ {H + 1} ^ {*} \right] (s, \cdot) - \bar {f} _ {H} (s, \cdot) + \bar {b} _ {H} (s, \cdot), \pi^ {*} (\cdot | s) \right\rangle_ {A} \\ = \left\langle \left[ \mathcal {T} _ {H} \check {f} _ {H + 1} \right] (s, \cdot) - \bar {f} _ {H} (s, \cdot) + \bar {b} _ {H} (s, \cdot), \pi^ {*} (\cdot | s) \right\rangle_ {\mathcal {A}} \\ + \langle [ \mathcal {T} _ {H} V _ {H + 1} ^ {*} ] (s, \cdot) - [ \mathcal {T} _ {H} \check {f} _ {H + 1} ] (s, \cdot), \pi_ {H} ^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ \leq 2 \langle \bar {b} _ {H} (s, \cdot), \pi_ {H} ^ {*} (\cdot , s) \rangle_ {\mathcal {A}} + \epsilon \\ \leq \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H}{\sqrt {K \kappa}}\right), \\ \end{array}
+$$
+
+where the first inequality holds because the policy $\check{\pi}_H$ takes the action which maximizes $\check{f}_H$ . The second inequality holds due to (D.1) and (D.3). For the last inequality, we use the choice of $b_H$ such that for all $z \in S \times \mathcal{A}$ with constant $0 < C < \infty$
+
+$$
+\bar {b} _ {H} (z) \leq C \cdot \left(D _ {\mathcal {F} _ {H}} (z; \mathcal {D} _ {H}; 1) \cdot \sqrt {(\bar {\beta} _ {H}) ^ {2} + \lambda} + \epsilon \bar {\beta} _ {H}\right).
+$$
+
+Therefore, we have $\max_z\bar{b}_H(z)\leq \widetilde{O}\bigg(\frac{\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_b)}H}{\sqrt{K\kappa}}\bigg)$ , which uses Lemma D.1 and $\beta_{H} = \widetilde{O}\big(\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_{b})H}\big)$ .
+
+Next, we prove by induction. Let $R_{h} = \widetilde{O}\left(\frac{\sqrt{\log(\mathcal{N}\cdot\mathcal{N}_{b})}H}{\sqrt{K\kappa}}\right)\cdot (H - h + 1)$ . We define the induction assumption as follows: Suppose with the probability of $1 - \delta_{h + 1}$ , the event $\mathcal{E}_{h + 1} = \{0\leq V_{h + 1}^{*}(s) - \check{f}_{h + 1}(s)\leq R_{h + 1}\}$ holds. Then we want to prove that with the probability of $1 - \delta_{h}$ ( $\delta_{h}$ will be determined later), the event $\mathcal{E}_h = \{0\leq V_h^* (s) - \check{f}_h(s)\leq R_h\}$ holds.
+
+Conditioned on the event $\mathcal{E}_{h + 1}$ , using similar argument to stage $H$ , we have
+
+$$
+\begin{array}{l} Q _ {h} ^ {*} (s, a) = \left[ \mathcal {T} _ {h} V _ {h + 1} ^ {*} \right] (s, a) \\ \geq \left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] (s, a) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \geq \bar {f} _ {h} (s, a) - \left| \left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] (s, a) - \bar {f} _ {h} (s, a) \right| \\ \geq \bar {f} _ {h} (s, a) - \left(\epsilon + | \bar {f} _ {h} ^ {\prime} (s, a) - \bar {f} _ {h} (s, a) |\right) \\ \geq \bar {f} _ {h} (s, a) - \bar {b} _ {h} (s, a) - \epsilon \\ = \check {f} _ {h} (s, a). \\ \end{array}
+$$
+
+where the first inequality holds due to $\mathcal{E}_{h + 1}$ . The second inequality holds due to the triangle inequality. The third inequality holds due to (D.1). The fourth inequality holds due to the property of the bonus function $\bar{b}_h$ and (D.3). The last equality holds due to our definition of $\check{f}_h$ in Algorithm 1 Line 7. Therefore, $V_{h}^{*}(\cdot)\geq \check{f}_{h}(\cdot)$
+
+On the other hand, similar to the case at horizon $H$ , we denote the policy derived from $\check{f}_h$ by $\check{\pi}_h$ , i.e. $\check{\pi}_h(s) = \operatorname{argmax}_a \check{f}_h(s, a)$ . Taking a union bound over the event in Lemma D.1 and $\mathcal{E}_{h+1}$ , we have with probability at least $1 - \delta_{h+1} - \delta / (2H^2)$ ,
+
+$$
+\begin{array}{l} V _ {h} ^ {*} (s) - \check {f} _ {h} (s) = \langle Q _ {h} ^ {*} (s, \cdot) - \check {f} _ {h} (s, \cdot), \pi_ {h} ^ {*} (\cdot | s) \rangle_ {\mathcal {A}} + \langle \check {f} _ {h} (s, \cdot), \pi_ {h} ^ {*} (\cdot | s) - \check {\pi} _ {h} (\cdot | s) \rangle_ {\mathcal {A}} \\ \leq \langle Q _ {h} ^ {*} (s, \cdot) - \tilde {f} _ {h} (s, \cdot), \pi_ {h} ^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ = \left\langle \left[ \mathcal {T} _ {h} V _ {h + 1} ^ {*} \right] (s, \cdot) - \bar {f} _ {h} (s, \cdot) + \bar {b} _ {h} (s, a), \pi_ {h} ^ {*} (\cdot | s) \right\rangle_ {\mathcal {A}} + \epsilon \\ = \langle [ \mathcal {T} _ {h} \tilde {f} _ {h + 1} ] (s, \cdot) - \bar {f} _ {h} (s, \cdot) + \bar {b} _ {h} (s, a), \pi_ {h} ^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ + \left\langle \left[ \mathcal {T} _ {h} V _ {h + 1} ^ {*} \right] (s, \cdot) - \left[ \mathcal {T} _ {h} \tilde {f} _ {h + 1} \right] (s, \cdot), \pi_ {h} ^ {*} (\cdot | s) \right\rangle_ {\mathcal {A}} + \epsilon \\ \leq 2 \langle \bar {b} _ {h} (s, \cdot), \pi_ {h} ^ {*} (\cdot , s) \rangle_ {\mathcal {A}} + 2 \epsilon + R _ {h + 1} \\ \leq R _ {h + 1} + \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H}{\sqrt {K \kappa}}\right) \\ \leq \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H}{\sqrt {K \kappa}}\right) \cdot (H - h + 1) = R _ {h}, \\ \end{array}
+$$
+
+where the first inequality holds because the policy $\check{\pi}_H$ takes the action which maximizes $\check{f}_H$ . The second inequality holds due to (D.1) and (D.3). The third inequality holds due to Lemma D.1. The last inequality holds due to the induction assumption. Therefore, we can choose $\delta_h = (H - h + 1)\delta / (2H^2) \leq \delta / 2H$ . Taking a union bound over all $h \in [H]$ , we prove that with probability at least $1 - \delta / 2$ , the following inequality holds for all $h \in [H]$ simultaneously
+
+$$
+0 \leq V _ {h + 1} ^ {*} (\cdot) - \check {f} _ {h + 1} (\cdot) \leq \widetilde {O} \left(\frac {\sqrt {\log \left(\mathcal {N} \cdot \mathcal {N} _ {b}\right)} H ^ {2}}{\sqrt {K \kappa}}\right). \tag {D.6}
+$$
+
+Conditioned on this event, we can further bound the difference between $[\mathrm{Var}_h\check{f}_{h + 1}](s,a)$ and $[\mathrm{Var}_hV_{h + 1}^* ](s,a)$ .
+
+$$
+\begin{array}{l} \left| \left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) - \left[ \operatorname {V a r} _ {h} V _ {h + 1} ^ {*} \right] (s, a) \right| \\ \leq \left| \left[ \mathbb {P} _ {h} \check {f} _ {h + 1} ^ {2} \right] (s, a) - \left[ \mathbb {P} _ {h} V _ {h + 1} ^ {* 2} \right] (s, a) \right| + \left| \left(\left[ \mathbb {P} _ {h} \check {f} _ {h + 1} \right] (s, a)\right) ^ {2} - \left(\left[ \mathbb {P} _ {h} V _ {h + 1} ^ {*} \right] (s, a)\right) ^ {2} \right| \\ \leq O (H) \cdot \left\| V _ {h + 1} ^ {*} - \check {f} _ {h + 1} \right\| _ {\infty} \\ \leq \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right), \tag {D.7} \\ \end{array}
+$$
+
+where the first inequality holds due to the triangle inequality. The second inequality holds due to $V_{h + 1}^{*}, \check{f}_{h + 1} \leq H$ . The last inequality holds due to (D.6). Therefore, for any $(s, a) \in S \times \mathcal{A}$ , we have
+
+$$
+\begin{array}{l} \left| \mathbb {B} _ {h} (s, a) - \left[ \operatorname {V a r} _ {h} V _ {h + 1} ^ {*} \right] (s, a) \right| \leq \left| \mathbb {B} _ {h} (s, a) - \left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) \right| \\ + \left| \left[ \operatorname {V a r} _ {h} \check {f} _ {h + 1} \right] (s, a) - \left[ \operatorname {V a r} _ {h} V _ {h + 1} ^ {*} \right] (s, a) \right| \\ \end{array}
+$$
+
+$$
+\leq \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right).
+$$
+
+Thus, for any $(s,a)\in S\times \mathcal{A}$ , we have
+
+$$
+\mathbb {B} _ {h} (s, a) - \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right) \leq [ \operatorname {V a r} _ {h} V _ {h + 1} ^ {*} ] (s, a),
+$$
+
+where the first inequality holds due to the triangle inequality. The second inequality holds due to (D.5) and (D.7). Finally, using the fact that the function $\max \{1,\cdot \}$ is increasing and nonexpansive, we complete the proof of Lemma D.4, which is
+
+$$
+[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (s, a) - \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right) \leq \widehat {\sigma} _ {h} ^ {2} (s, a) \leq [ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (s, a).
+$$
+
+
+
+# E PROOF OF LEMMAS IN SECTION D
+
+# E.1 PROOF OF LEMMA D.1
+
+Proof of Lemma D.1. From the definition of $D^2$ divergence (Definition 3.4), we have
+
+$$
+D _ {\mathcal {F} _ {h}} ^ {2} (z; \mathcal {D} _ {h}; 1) = \sup _ {f _ {1}, f _ {2} \in \mathcal {F} _ {h}} \frac {\left(f _ {1} (z) - f _ {2} (z)\right) ^ {2}}{\sum_ {k \in [ K ]} \left(f _ {1} \left(z _ {h} ^ {k}\right) - f _ {2} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \lambda} \tag {E.1}
+$$
+
+By the Hoeffding's inequality (Lemma I.3), with probability at least $1 - \delta /(\mathcal{N}^2)$ , we have
+
+$$
+\sum_ {k \in [ K ]} \left(f _ {1} (z _ {h} ^ {k}) - f _ {2} (z _ {h} ^ {k})\right) ^ {2} - K \mathbb {E} _ {\mu , h} \left[ (f _ {1} (z _ {h}) - f _ {2} (z _ {h})) ^ {2} \right] \geq - 2 \sqrt {2 K \log (\mathcal {N} ^ {2} / \delta)} \cdot \| f _ {1} - f _ {2} \| _ {\infty} ^ {2}.
+$$
+
+Hence, after taking a union bound, we have with probability at least $1 - \delta$ , for all $f_{1}, f_{2} \in \mathcal{F}_{h}$
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \left(f _ {1} \left(z _ {h} ^ {k}\right) - f _ {2} \left(z _ {h} ^ {k}\right)\right) ^ {2} \geq K \mathbb {E} _ {\mu , h} \left[ \left(f _ {1} \left(z _ {h}\right) - f _ {2} \left(z _ {h}\right)\right) ^ {2} \right] - 2 \sqrt {2 K \log \left(\mathcal {N} ^ {2} / \delta\right)} \cdot \| f _ {1} - f _ {2} \| _ {\infty} ^ {2} \\ \geq K \cdot \kappa \| f _ {1} - f _ {2} \| _ {\infty} ^ {2} - 2 \sqrt {2 K \log \left(\mathcal {N} ^ {2} / \delta\right)} \cdot \| f _ {1} - f _ {2} \| _ {\infty} ^ {2}, \tag {E.2} \\ \end{array}
+$$
+
+where the second inequality holds due to Assumption 3.6. Substituting (E.2) into (E.1), when the size of dataset $K \geq \widetilde{\Omega}\left(\frac{\log\mathcal{N}}{\kappa^2}\right)$ , we have
+
+$$
+D _ {\mathcal {F} _ {h}} ^ {2} (z; \mathcal {D} _ {h}; 1) \leq \sup _ {f _ {1}, f _ {2} \in \mathcal {F} _ {h}} \frac {(f _ {1} (z) - f _ {2} (z)) ^ {2}}{\frac {1}{2} K \cdot \kappa \| f _ {1} - f _ {2} \| _ {\infty} ^ {2} + \lambda} = \widetilde {O} \left(\frac {1}{K \kappa}\right).
+$$
+
+# E.2 PROOF OF LEMMA D.2
+
+In the proof of Lemma D.2, we need to prove the following concentration inequality.
+
+Lemma E.1. Based on the dataset $\mathcal{D}' = \{\bar{s}_h^k,\bar{a}_h^k,\bar{r}_h^k\}_{k,h = 1}^{K,H}$ , we define the filtration
+
+$$
+\bar {\mathcal {H}} _ {h} ^ {k} = \sigma \left(\bar {s} _ {1} ^ {1}, \bar {a} _ {1} ^ {1}, \bar {r} _ {1} ^ {1}, \bar {s} _ {2} ^ {1}, \dots , \bar {r} _ {H} ^ {1}, \bar {s} _ {H + 1} ^ {1}; \bar {s} _ {1} ^ {2}, \bar {a} _ {1} ^ {2}, \bar {r} _ {1} ^ {2}, \bar {s} _ {2} ^ {2}, \dots , \bar {r} _ {H} ^ {2}, \bar {s} _ {H + 1} ^ {2}; \dots , \bar {s} _ {1} ^ {k}, \bar {a} _ {1} ^ {k}, \bar {r} _ {1} ^ {k}, \bar {s} _ {2} ^ {k}, \dots , \bar {r} _ {h} ^ {k}, \bar {s} _ {h + 1} ^ {k}\right).
+$$
+
+For any fixed functions $f, f': \mathcal{S} \to [0, H]$ , we make the following definitions:
+
+$$
+\bar {\eta} _ {h} ^ {k} \left[ f ^ {\prime} \right] := f ^ {\prime} \left(\bar {s} _ {h + 1} ^ {k}\right) - \left[ \mathbb {P} _ {h} f ^ {\prime} \right] \left(\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}\right)
+$$
+
+$$
+\bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] := 2 \bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ] \left(f (\bar {z} _ {h} ^ {k}) - [ \mathcal {T} _ {h} f ^ {\prime} ] (\bar {z} _ {h} ^ {k})\right).
+$$
+
+Then with probability at least $1 - \delta /(4H^{2}\mathcal{N}^{2}\mathcal{N}_{b}^{2})$ , the following inequality holds,
+
+$$
+\sum_ {k \in [ K ]} \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] \leq (2 4 H + 5) i ^ {2} (\delta) + \frac {\sum_ {k \in [ K ]} \left(f (\bar {z} _ {h} ^ {k}) - [ \mathcal {T} _ {h} f ^ {\prime} ] (\bar {z} _ {h} ^ {k})\right) ^ {2}}{2},
+$$
+
+where $i(\delta) = \sqrt{2\log\frac{(\mathcal{N}\cdot\mathcal{N}_b)H(2\log(4K) + 2)(\log(2L) + 2)}{\delta}}$ .
+
+Proof of Lemma D.2. Let $(\bar{\beta}_{1,h})^2 = (48H^2 + 10)i^2(\delta) + 16KH\epsilon$ . We define the event $\bar{\mathcal{E}}_{1,h} := \left\{\sum_{k \in [K]} \left(\bar{f}_h'(\bar{z}_h^k) - \bar{f}_h(\bar{z}_h^k)\right)^2 > (\bar{\beta}_{1,h})^2\right\}$ . We have the following inequality:
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \left(\bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ = \sum_ {k \in [ K ]} \left[ \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) + \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) \right] ^ {2} \\ = \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \sum_ {k \in [ K ]} \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2} \\ + 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) \\ \leq 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \breve {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ + 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) \\ = 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right), \tag {E.3} \\ \end{array}
+$$
+
+where the first inequality holds due to our choice of $\bar{f}_h$ , i.e.,
+
+$$
+\bar {f} _ {h} = \operatorname * {a r g m i n} _ {f _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \left(f _ {h} \left(\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}\right) - \bar {r} _ {h} ^ {k} - \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2}.
+$$
+
+Next, we will use Lemma E.1. For any fixed $h$ , let $f = \bar{f}_h \in \mathcal{F}_h$ , $f' = \check{f}_{h+1} = \{\bar{f} - \epsilon\}_{[0,H-h+1]}$ where $\bar{f} = \bar{f}_h - \bar{b}_h \in \mathcal{F}_h - \mathcal{W}$ . Following the construction in Lemma E.1, we define
+
+$$
+\bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ] = \bar {r} _ {h} ^ {s} + f ^ {\prime} (\bar {s} _ {h + 1} ^ {k}) - \mathbb {E} \left[ \bar {r} _ {h} ^ {k} + f ^ {\prime} (\bar {s} _ {h + 1} ^ {k}) | \bar {z} _ {h} ^ {k} \right],
+$$
+
+$$
+\text {a n d} \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] = 2 \bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ] \left(f (\bar {z} _ {h} ^ {k}) - \left[ \mathcal {T} _ {h} \bar {f} ^ {\prime} \right] (\bar {z} _ {h} ^ {k})\right).
+$$
+
+Due to the result of Lemma E.1, taking a union bound on the function class, with probability at least $1 - \delta / (4H^2)$ , the following inequality holds,
+
+$$
+\sum_ {k \in [ K ]} \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] \leq (2 4 H ^ {2} + 5) i ^ {2} (\delta) + \frac {\sum_ {k \in [ K ]} \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2}. \tag {E.4}
+$$
+
+Therefore, with probability at least $1 - \delta /(4H^2)$ , we have
+
+$$
+\begin{array}{l} 2 \sum_ {k \in [ K ]} \left(\vec {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\vec {s} _ {h + 1} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\vec {z} _ {h} ^ {k})\right) \left(\bar {f} _ {h} (\vec {z} _ {h} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\vec {z} _ {h} ^ {k})\right) \\ = 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \\ + 2 \sum_ {k \in [ K ]} \left(\left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) (E.5) \\ \leq 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {f} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) + 4 K H \epsilon \\ \leq (2 4 H ^ {2} + 5) i ^ {2} (\delta) + 4 K H \epsilon + \frac {\sum_ {k \in [ K ]} \left(\bar {f} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2} (E.6) \\ \leq (2 4 H ^ {2} + 5) i ^ {2} (\delta) + 8 K L \epsilon + \frac {\sum_ {k \in [ K ]} \left(\bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2}}{2} \\ \end{array}
+$$
+
+$$
+= \frac {(\bar {\beta} _ {1 , h}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \left(\tilde {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \tilde {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2}}{2}. \tag {E.7}
+$$
+
+where the first and third inequalities hold because of the completeness assumption. The second inequality holds due to (E.4). The last equality holds due to the choice of
+
+$$
+\bar {\beta} _ {1, h} = \sqrt {2 (2 4 L ^ {2} + 5) i ^ {2} (\delta) + 1 6 K L \epsilon} = \widetilde {O} \left(\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H\right).
+$$
+
+However, conditioned on the event $\bar{\mathcal{E}}_{1,h}$ , we have
+
+$$
+\begin{array}{l} 2 \sum_ {k \in [ K ]} \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) \left(\bar {f} _ {h} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) \\ \geq \sum_ {k \in [ K ]} \left(\bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ > \frac {(\bar {\beta} _ {1 , h}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \left(\bar {f} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {f} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2}}{2}. \\ \end{array}
+$$
+
+where the first inequality holds due to (E.3). The second inequality holds due to $\bar{\mathcal{E}}_{1,h}$ . This is contradictory with (E.7). Thus, we have $\mathbb{P}[\bar{\mathcal{E}}_{1,h}] \leq \delta/(4H^2)$ and complete the proof of Lemma D.2.
+
+# E.3 PROOF OF LEMMA D.3
+
+To prove this lemma, we need a lemma similar to Lemma E.1
+
+Lemma E.2. On dataset $\mathcal{D}' = \{\bar{s}_h^k,\bar{a}_h^k,\bar{r}_h^k\}_{k,h = 1}^{K,H}$ , we define the filtration
+
+$$
+\bar {\mathcal {H}} _ {h} ^ {k} = \sigma (\bar {s} _ {1} ^ {1}, \bar {a} _ {1} ^ {1}, \bar {r} _ {1} ^ {1}, \bar {s} _ {2} ^ {1}, \dots , \bar {r} _ {H} ^ {1}, \bar {s} _ {H + 1} ^ {1}; \bar {s} _ {1} ^ {2}, \bar {a} _ {1} ^ {2}, \bar {r} _ {1} ^ {2}, \bar {s} _ {2} ^ {2}, \dots , \bar {r} _ {H} ^ {2}, \bar {s} _ {H + 1} ^ {2}; \dots , \bar {s} _ {1} ^ {k}, \bar {a} _ {1} ^ {k}, \bar {r} _ {1} ^ {k}, \bar {s} _ {2} ^ {k}, \dots , \bar {r} _ {h} ^ {k}, \bar {s} _ {h + 1} ^ {k}).
+$$
+
+For any fixed function $f, f': S \to [0, H]$ , we make the following definitions:
+
+$$
+\bar {\eta} _ {h} ^ {k} \left[ f ^ {\prime} \right] := \left(\bar {r} _ {h} ^ {k} + f ^ {\prime} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \left[ \mathbb {P} _ {h} \left(\bar {r} _ {h} + f ^ {\prime}\right) ^ {2} \right] \left(\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}\right)
+$$
+
+$$
+\bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] := 2 \bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ] \left(f (\bar {z} _ {h} ^ {k}) - [ \mathcal {T} _ {2, h} f ^ {\prime} ] (\bar {z} _ {h} ^ {k})\right).
+$$
+
+Then with probability at least $1 - \delta /(4H^{2}\mathcal{N}^{2}\mathcal{N}_{b}^{2})$ , the following inequality holds,
+
+$$
+\sum_ {k \in [ K ]} \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] \leq (2 4 H + 5) i ^ {\prime 2} (\delta) + \frac {\sum_ {k \in [ K ]} \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {2 , h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2},
+$$
+
+where $i'(\delta) = \sqrt{4\log\frac{(\mathcal{N}\cdot\mathcal{N}_b)H(2\log(4LK) + 2)(\log(4L) + 2)}{\delta}}.$
+
+Proof of Lemma D.3. Let $(\bar{\beta}_{2,h})^2 = (40H^4 + 10)i'^2(\delta) + 16KL\epsilon$ . We define the event $\bar{\mathcal{E}}_{2,h} := \left\{\sum_{k \in [K]} (\bar{g}_h'(\bar{z}_h^k) - \bar{g}_h(\bar{z}_h^k))^2 > (\bar{\beta}_{2,h})^2\right\}$ . We can prove the following inequality:
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ = \sum_ {k \in [ K ]} \left[ \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2} - \bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) + \left(\bar {g} _ {h} (\bar {z} _ {h} ^ {k}) - \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2}\right) \right] ^ {2} \\ = \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2} - \bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} + \sum_ {k \in [ K ]} \left(\bar {g} _ {h} (\bar {z} _ {h} ^ {k}) - \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2}\right) ^ {2} \\ + 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2}\right) \\ \leq 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2} - \bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} + 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2}\right) \\ = 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right), \tag {E.8} \\ \end{array}
+$$
+
+where the first inequality holds due to our choice of $\bar{g}_h$ , i.e.
+
+$$
+\bar {g} _ {h} = \operatorname * {a r g m i n} _ {g _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \left(g _ {h} (\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}) - (\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} (\bar {s} _ {h + 1} ^ {k})) ^ {2}\right) ^ {2}.
+$$
+
+Next, we will use Lemma E.2. For any fixed $h$ , let $f = \bar{g}_h \in \mathcal{F}_h$ , $f' = \check{f}_{h+1} = \{\bar{f} - \epsilon\}_{[0,H-h+1]}$ where $\bar{f} = \bar{f}_h - \bar{b}_h \in \mathcal{F}_h - \mathcal{W}$ . Following the construction in Lemma E.2, we define
+
+$$
+\bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ] := \left(\bar {r} _ {h} ^ {k} + f ^ {\prime} (\bar {s} _ {h + 1} ^ {k})\right) ^ {2} - \left[ \mathbb {P} _ {h} (\bar {r} _ {h} + f ^ {\prime}) ^ {2} \right] \left(\bar {s} _ {h} ^ {k}, \bar {a} _ {h} ^ {k}\right)
+$$
+
+$$
+\text {a n d} \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] := 2 \bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ] \left(f (\bar {z} _ {h} ^ {k}) - [ \mathcal {T} _ {2, h} f ^ {\prime} ] (\bar {z} _ {h} ^ {k})\right).
+$$
+
+Due to the result of Lemma E.2, taking a union bound on the function, with probability at least $1 - \delta /(4H^2)$ , the following inequality holds,
+
+$$
+\sum_ {k \in [ K ]} \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] \leq (2 0 H ^ {4} + 5) i ^ {2} (\delta) + \frac {\sum_ {k \in [ K ]} \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {2 , h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2}. \tag {E.9}
+$$
+
+Therefore, with probability at least $1 - \delta /(4H^2)$ , we have
+
+$$
+\begin{array}{l} 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \\ = 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \\ + 2 \sum_ {k \in [ K ]} \left(\left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \\ \leq 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \left[ \mathcal {T} _ {2, h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) + 4 K L \epsilon \\ \leq (2 0 H ^ {4} + 5) i ^ {\prime 2} (\delta) + 4 K L \epsilon + \frac {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {2 , h} \check {f} _ {h + 1} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2} \\ \leq (2 0 H ^ {4} + 5) i ^ {\prime 2} (\delta) + 8 K L \epsilon + \frac {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2} \\ \leq \frac {(\bar {\beta} _ {2 , h}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2}, \tag {E.10} \\ \end{array}
+$$
+
+where the first and third inequalities hold due to the Bellman completeness assumption. The second inequality holds due to (E.9). The last inequality holds due to the choice of
+
+$$
+\bar {\beta} _ {2, h} = \sqrt {(4 0 H ^ {4} + 1 0) i ^ {\prime 2} (\delta) + 1 6 K L \epsilon} = \widetilde {O} (\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {2}).
+$$
+
+However, conditioned on the event $\bar{\mathcal{E}}_{2,h}$ , we have
+
+$$
+\begin{array}{l} 2 \sum_ {k \in [ K ]} \left(\left(\bar {r} _ {h} ^ {k} + \check {f} _ {h + 1} \left(\bar {s} _ {h + 1} ^ {k}\right)\right) ^ {2} - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \left(\bar {g} _ {h} \left(\bar {z} _ {h} ^ {k}\right) - \bar {g} _ {h} ^ {\prime} \left(\bar {z} _ {h} ^ {k}\right)\right) \\ \geq \sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ > \frac {(\bar {\beta} _ {2 , h}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \left(\bar {g} _ {h} ^ {\prime} (\bar {z} _ {h} ^ {k}) - \bar {g} _ {h} (\bar {z} _ {h} ^ {k})\right) ^ {2}}{2}, \\ \end{array}
+$$
+
+where the first inequality holds due to (E.8). The last inequality holds due to $\bar{\mathcal{E}}_{2,h}$ . It is contradictory with (E.10). Thus, we have $\mathbb{P}[\bar{\mathcal{E}}_{2,h}] \leq \delta / (4H^2)$ and complete the proof of Lemma D.3.
+
+# F PROOF OF THEOREM 5.1
+
+In this section, we prove Theorem 5.1. The proof idea is similar to that of Section D. To start with, we prove that our data coverage assumption (Assumption 3.6) can lead to an upper bound of the weighted $D^2$ -divergence for a large dataset.
+
+Lemma F.1. Let $\mathcal{D}_h$ be a dataset satisfying Assumption 3.6. When the size of data set satisfies $K\geq \widetilde{\Omega}\left(\frac{\log\mathcal{N}}{\kappa^2}\right)$ , $\widehat{\sigma}_h\leq H$ , with probability at least $1 - \delta$ , for each state-action pair $z$ , we have
+
+$$
+D _ {\mathcal {F} _ {h}} (z, \mathcal {D} _ {h}, \widehat {\sigma} _ {h} ^ {2}) = \widetilde {O} \left(\frac {H}{\sqrt {K \kappa}}\right).
+$$
+
+With Lemma D.4, we can prove a variance-weighted version of concentration inequality.
+
+Lemma F.2 (Restatement of Lemma 6.3). Suppose the variance function $\widehat{\sigma}_h$ satisfies the inequality in Lemma D.4. at stage $h\in [H]$ , the estimated value function $\widehat{f}_{h\pm 1}$ in Algorithm 1 is bounded by $H$ . According to Assumption 3.3, there exists some function $f_{h}\in \mathcal{F}_{h}$ , such that $|\bar{f}_h(z_h) - [\mathcal{T}_h\widehat{f}_{h + 1}](z)|\leq \epsilon$ for all $z_{h} = (s_{h},a_{h})$ . Then with probability at least $1 - \delta /2$ , the following inequality holds for all stage $h\in [H]$ simultaneously,
+
+$$
+\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} \leq (\beta_ {h}) ^ {2}.
+$$
+
+With these lemmas, we can start the proof of Theorem 5.1.
+
+Proof of Theorem 5.1. For any state-action pair $z = (s, a) \in S \times \mathcal{A}$ , we have
+
+$$
+\begin{array}{l} \left| \left[ \mathcal {T} _ {h} \widehat {f} _ {h + 1} \right] (z) - \widetilde {f} _ {h} (z) \right| \leq \underbrace {\left| \left[ \mathcal {T} _ {h} \widehat {f} _ {h + 1} \right] (z) - \bar {f} _ {h} (z) \right|} _ {I _ {1}} + \left| \bar {f} _ {h} (z) - \widetilde {f} _ {h} (z) \right| \\ \leq \epsilon + b _ {h} (z), \\ \end{array}
+$$
+
+where we bound $I_{1}$ with the Bellman completeness assumption. For the second term, we use the property of the bonus function and Lemma F.2. Using Lemma I.2, we have
+
+$$
+\begin{array}{l} V _ {1} ^ {*} (s) - V _ {1} ^ {\widehat {\pi}} (s) \leq 2 \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ b _ {h} \left(s _ {h}, a _ {h}\right) \mid s _ {1} = s \right] + 2 \epsilon H \\ \leq \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ D _ {\mathcal {F} _ {h}} (z _ {h}; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) \cdot \sqrt {(\beta_ {h}) ^ {2} + \lambda} \mid s _ {1} = s \right] + 2 \epsilon H \\ \leq \widetilde {O} \left(\sqrt {\log \mathcal {N}}\right) \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ D _ {\mathcal {F} _ {h}} \left(z _ {h}; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}\right) \mid s _ {1} = s \right] \\ \leq \widetilde {O} \left(\sqrt {\log \mathcal {N}}\right) \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ D _ {\mathcal {F} _ {h}} \left(z _ {h}; \mathcal {D} _ {h}; [ \mathbb {V} _ {h} V _ {h + 1} ^ {*} ] (\cdot , \cdot)\right) \mid s _ {1} = s \right], \\ \end{array}
+$$
+
+where the first inequality holds due to Lemma I.2. The second inequality holds due to the property of the bonus function
+
+$$
+b _ {h} (z) \leq C \cdot \left(D _ {\mathcal {F} _ {h}} (z; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) \cdot \sqrt {(\beta_ {h}) ^ {2} + \lambda} + \epsilon \beta_ {h}\right).
+$$
+
+The third inequality holds due to our choice of $\beta_h = \widetilde{O}\left(\sqrt{\log\mathcal{N}}\right)$ . The last inequality holds due to Lemma D.4 and the fact that $D^2$ -divergence is increasing with respect to the variance function. We complete the proof of Theorem 5.1.
+
+# G PROOF OF THE LEMMAS IN SECTION F
+
+# G.1 PROOF OF LEMMA F.1
+
+Proof of Lemma F.1. From the definition of $D^2$ divergence, we have
+
+$$
+D _ {\mathcal {F} _ {h}} ^ {2} (z; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) = \sup _ {f _ {1}, f _ {2} \in \mathcal {F} _ {h}} \frac {\left(f _ {1} (z) - f _ {2} (z)\right) ^ {2}}{\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f _ {1} \left(z _ {h} ^ {k}\right) - f _ {2} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \lambda} \tag {G.1}
+$$
+
+By the Hoeffding's inequality (Lemma I.3), with probability at least $1 - \delta /(\mathcal{N}^2)$
+
+$$
+\sum_ {k \in [ K ]} \left(f _ {1} \left(z _ {h} ^ {k}\right) - f _ {2} \left(z _ {h} ^ {k}\right)\right) ^ {2} - K \mathbb {E} _ {\mu , h} \left[ \left(f _ {1} \left(z _ {h}\right) - f _ {2} \left(z _ {h}\right)\right) ^ {2} \right] \geq - 2 \sqrt {2 K \log \left(\mathcal {N} ^ {2} / \delta\right)} \cdot \| f _ {1} - f _ {2} \| _ {\infty} ^ {2}.
+$$
+
+Hence, after taking a union bound, we have with probability at least $1 - \delta$ , for all $f_{1}, f_{2} \in \mathcal{F}_{h}$
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f _ {1} \left(z _ {h} ^ {k}\right) - f _ {2} \left(z _ {h} ^ {k}\right)\right) ^ {2} \\ \geq \frac {1}{H ^ {2}} \left(K \mathbb {E} _ {\mu , h} \left[ \left(f _ {1} \left(z _ {h}\right) - f _ {2} \left(z _ {h}\right)\right) ^ {2} \right] - 2 \sqrt {2 K \log \left(\mathcal {N} ^ {2} / \delta\right)} \cdot \| f _ {1} - f _ {2} \| _ {\infty} ^ {2}\right) \\ \geq \frac {1}{H ^ {2}} \left(K \cdot \kappa \| f _ {1} - f _ {2} \| _ {\infty} ^ {2} - 2 \sqrt {2 K \log (\mathcal {N} ^ {2} / \delta)} \cdot \| f _ {1} - f _ {2} \| _ {\infty} ^ {2}\right), \tag {G.2} \\ \end{array}
+$$
+
+where the last inequality holds due to Assumption 3.6. Substituting (G.2) into (G.1), when $K \geq \widetilde{\Omega}\left(\frac{\log\mathcal{N}}{\kappa}\right)$ , we have
+
+$$
+D _ {\mathcal {F} _ {h}} ^ {2} (z; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) \leq \sup _ {f _ {1}, f _ {2} \in \mathcal {F} _ {h}} \frac {H ^ {2} \left(f _ {1} (z) - f _ {2} (z)\right) ^ {2}}{\frac {1}{2} K \cdot \kappa \| f _ {1} - f _ {2} \| _ {\infty} ^ {2} + \lambda} = \widetilde {O} \left(\frac {H ^ {2}}{K \kappa^ {2}}\right).
+$$
+
+
+
+# G.2 PROOF OF LEMMA F.2
+
+In this section, we assume the high probability event in Lemma D.4 holds,i.e., the following inequality holds:
+
+$$
+\left[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} \right] (s, a) - \widetilde {O} \left(\frac {\sqrt {\log \left(\mathcal {N} \cdot \mathcal {N} _ {b}\right)} H ^ {3}}{\sqrt {K \kappa}}\right) \leq \widehat {\sigma} _ {h} ^ {2} (s, a) \leq \left[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} \right] (s, a). \tag {G.3}
+$$
+
+To prove Lemma F.2, we need the following lemmas.
+
+Lemma G.1. Based on the dataset $\mathcal{D} = \{s_h^k, a_h^k, r_h^k\}_{k,h=1}^{K,H}$ , we define the filtration $\mathcal{H}_h^k = \sigma(s_1^1, a_1^1, r_1^1, s_2^1, \ldots, r_H^1, s_{H+1}^1; x_1^2, a_1^2, r_1^2, s_2^2, \ldots, r_H^2, s_{H+1}^2; \cdots, s_1^k, a_1^k, r_1^k, s_2^k, \ldots, r_h^k, s_{h+1}^k)$ . For any fixed function $f, f': S \to \in [0,L]$ , we define the following random variables:
+
+$$
+\eta_ {h} ^ {k} := V _ {h + 1} ^ {*} (s _ {h + 1} ^ {k}) - [ \mathbb {P} _ {h} V _ {h + 1} ^ {*} ] (s _ {h} ^ {k}, a _ {h} ^ {k})
+$$
+
+$$
+D _ {h} ^ {s} [ f, f ^ {\prime} ] := 2 \frac {\eta_ {h} ^ {k}}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right),
+$$
+
+As the variance function $\widehat{\sigma}_h$ satisfies (G.3), with probability at least $1 - \delta /(4H^2\mathcal{N}^2)$ , the following inequality holds,
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} D _ {h} ^ {k} [ f, f ^ {\prime} ] \leq \frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta) \\ + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} (z _ {h} ^ {k})\right) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2}}{4}, \\ \end{array}
+$$
+
+where $v(\delta) = \sqrt{2\log\frac{HN(2\log(18LT) + 2)(\log(18L) + 2)}{\delta}}$ .
+
+Lemma G.2. Based on the dataset $\mathcal{D} = \{s_h^k, a_h^k, r_h^k\}_{k,h=1}^{K,H}$ , we define the following filtration $\mathcal{H}_h^k = \sigma(s_1^1, a_1^1, r_1^1, s_2^1, \ldots, r_H^1, s_{H+1}^1; x_1^2, a_1^2, r_1^2, s_2^2, \ldots, r_H^2, s_{H+1}^2; \cdots, s_1^k, a_1^k, r_1^k, s_2^k, \ldots, r_h^k, s_{h+1}^k)$ . For any fixed functions $f, f' : \mathcal{S} \to [0,L]$ and $f' : \mathcal{S} \to [0,H]$ , we define the following random variables
+
+$$
+\begin{array}{l} \xi_ {h} ^ {k} [ f ^ {\prime} ] := f ^ {\prime} (s _ {h + 1} ^ {k}) - V _ {h + 1} ^ {*} (s _ {h + 1} ^ {k}) - \left[ \mathbb {P} _ {h} (f ^ {\prime} - V _ {h + 1} ^ {*}) \right] (s _ {h} ^ {k}, a _ {h} ^ {k}), \\ \Delta_ {h} ^ {k} \left[ f, \widetilde {f}, f ^ {\prime} \right] := 2 \frac {\xi_ {h} ^ {k} [ f ^ {\prime} ]}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - \widetilde {f} (z _ {h} ^ {k})\right), \\ \end{array}
+$$
+
+As the variance function $\widehat{\sigma}_h$ satisfies (G.3), with probability at least $1 - \delta /(4H^2\mathcal{N}^3\mathcal{N}_b)$ , the following inequality holds,
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \Delta_ {h} ^ {k} [ f, \widetilde {f}, f ^ {\prime} ] \leq \left(\frac {4}{3} \iota (\delta) \sqrt {\lambda} + \sqrt {2} \iota (\delta)\right) \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} + \frac {2}{3} \iota^ {2} (\delta) / \log \mathcal {N} _ {b} \\ + 3 0 \iota^ {2} (\delta) \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} + \frac {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2}}{4}. \\ \end{array}
+$$
+
+where $\iota(\delta) = \sqrt{3\log\frac{H(\mathcal{N}\cdot\mathcal{N}_b)(2\log(18LT) + 2)(\log(18L) + 2)}{\delta}}$ .
+
+With these lemmas, we can start the proof of Lemma F.2.
+
+Proof of Lemma F.2. We define the event $\mathcal{E}_h\coloneqq \Bigg\{\sum_{k\in [K]}\frac{1}{(\widehat{\sigma} (z_h^k))^2}\left(\bar{f}_h(z_h^k) - \widetilde{f}_h(z_h^k)\right)^2 >(\beta_h)^2\Bigg\} .$
+
+We have the following inequality:
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} \\ = \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left[ \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) + \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k})\right) \right] ^ {2} \\ = \sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right) - \bar {f} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(\widetilde {f} _ {h} \left(z _ {h} ^ {k}\right) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right)\right) ^ {2} \\ + 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k})\right) \\ \leq 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right) - \bar {f} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2} \\ + 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k})\right) \\ = 2 \sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right) - \bar {f} _ {h} \left(z _ {h} ^ {k}\right)\right) \left(\widetilde {f} _ {h} \left(z _ {h} ^ {k}\right) - \bar {f} _ {h} \left(z _ {h} ^ {k}\right)\right). \tag {G.4} \\ \end{array}
+$$
+
+where the first inequality holds due to our choice of $\widetilde{f}_h$ in Algorithm 1 Line 12,
+
+$$
+\widetilde {f} _ {h} = \operatorname * {a r g m i n} _ {f _ {h} \in \mathcal {F} _ {h}} \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(f _ {h} (s _ {h} ^ {k}, a _ {h} ^ {k}) - r _ {h} ^ {k} - \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k})\right) ^ {2}.
+$$
+
+We prove this lemma by induction. At horizon $H$ , we first use Lemma G.1. Let $f = \widetilde{f}_H \in \mathcal{F}_H$ , $f' = \bar{f}_H \in \mathcal{F}_H$ . We define
+
+$$
+\eta_ {H} ^ {k} := V _ {H + 1} ^ {*} \left(s _ {H + 1} ^ {k}\right) - \left[ \mathbb {P} _ {H} V _ {H + 1} ^ {*} \right] \left(z _ {H} ^ {k}\right)
+$$
+
+$$
+D _ {H} ^ {k} [ f, f ^ {\prime} ] := 2 \frac {\eta_ {H} ^ {k}}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(f (z _ {H} ^ {k}) - f ^ {\prime} (z _ {H} ^ {k})\right).
+$$
+
+Taking a union bound over the function class, with probability at least $1 - \delta /(4H^2)$ , the following inequality holds,
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \frac {\eta_ {H} ^ {k}}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(\widetilde {f} (z _ {H} ^ {k}) - \bar {f} (z _ {H} ^ {k})\right) \leq \frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta) \\ + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\hat {\sigma} _ {H} \left(z _ {H} ^ {k}\right)\right) ^ {2}} \left(\widetilde {f} \left(z _ {H} ^ {k}\right) - \bar {f} \left(z _ {H} ^ {k}\right)\right) ^ {2}}{4}. \tag {G.5} \\ \end{array}
+$$
+
+Then we use Lemma G.2. Let $f = \tilde{f}_H \in \mathcal{F}_H$ , $\tilde{f} = \bar{f}_H \in \mathcal{F}_H$ , $f' = \widehat{f}_{H + 1} = 0$ . We define:
+
+$$
+\xi_ {H} ^ {k} \left[ f ^ {\prime} \right] := f ^ {\prime} \left(s _ {H + 1} ^ {k}\right) - V _ {H + 1} ^ {*} \left(s _ {H + 1} ^ {k}\right) - \left[ \mathbb {P} _ {H} \left(f ^ {\prime} - V _ {H + 1} ^ {*}\right) \right] \left(z _ {H} ^ {k}\right)
+$$
+
+$$
+\Delta_ {H} ^ {k} [ f, \widetilde {f}, f ^ {\prime} ] := 2 \frac {\xi_ {H} ^ {k} [ f ^ {\prime} ]}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(f (z _ {H} ^ {k}) - \widetilde {f} (z _ {H} ^ {k})\right).
+$$
+
+Taking a union bound over the function class, with probability at least $1 - \delta /(4H^2)$ , we have
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \frac {\xi_ {H} ^ {k} [ \widehat {f} _ {H + 1} ]}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(\widetilde {f} _ {H} (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \leq \left(\frac {4}{3} \iota (\delta) \sqrt {\lambda} + \sqrt {2} \iota (\delta)\right) \| f ^ {\prime} - V _ {H + 1} ^ {*} \| _ {\infty} ^ {2} \\ + \frac {2}{3} \iota^ {2} (\delta) / \sqrt {\log \mathcal {N} _ {b}} + 3 0 \iota^ {2} (\delta) \| \widehat {f} _ {H + 1} - V _ {H + 1} ^ {*} \| _ {\infty} ^ {2} + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {H} \left(z _ {H} ^ {k}\right)\right) ^ {2}} \left(\widetilde {f} _ {H} \left(z _ {H} ^ {k}\right) - \bar {f} _ {H} \left(z _ {H} ^ {k}\right)\right) ^ {2}}{4}. \tag {G.6} \\ \end{array}
+$$
+
+Combining (G.5) and (G.6), we have with probability at least $1 - \delta /(2H^2)$ , the following inequality holds:
+
+$$
+\begin{array}{l} 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(r _ {H} ^ {k} + \widehat {f} _ {H + 1} (s _ {H + 1} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \left(\widetilde {f} _ {H} (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \\ = 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(r _ {H} ^ {k} + \widehat {f} _ {H + 1} (s _ {H + 1} ^ {k}) - [ \mathcal {T} _ {H} \widehat {f} _ {H + 1} ] (z _ {H} ^ {k})\right) \left(\widetilde {f} _ {H} (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \\ + 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left([ \mathcal {T} _ {H} \widehat {f} _ {H + 1} ] (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \left(\widetilde {f} _ {H} (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \\ \leq 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(r _ {H} ^ {k} + \widehat {f} _ {H + 1} (s _ {H + 1} ^ {k}) - [ \mathcal {T} _ {H} \widehat {f} _ {H + 1} ] (z _ {H} ^ {k})\right) \left(\widetilde {f} _ {H} (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) + 4 K L \epsilon \\ \leq \frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta) + \left(\frac {4}{3} \iota (\delta) \sqrt {\lambda} + \sqrt {2} \iota (\delta)\right) \| f ^ {\prime} - V _ {H + 1} ^ {*} \| _ {\infty} ^ {2} + \frac {2}{3} \iota^ {2} (\delta) / \log \mathcal {N} _ {b} \\ + 3 0 \iota^ {2} (\delta) \| \widehat {f} _ {H + 1} - V _ {H + 1} ^ {*} \| _ {\infty} ^ {2} + 8 K L \epsilon + \frac {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(\bar {f} _ {H} (z _ {H} ^ {k}) - \widetilde {f} _ {H} (z _ {H} ^ {k})\right) ^ {2}}{2} \\ \leq \frac {\left(\beta_ {H}\right) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\bar {\sigma} _ {H} \left(z _ {H} ^ {k}\right)\right) ^ {2}} \left(\bar {f} _ {H} \left(z _ {H} ^ {k}\right) - \widetilde {f} _ {H} \left(z _ {H} ^ {k}\right)\right) ^ {2}}{2}, \tag {G.7} \\ \end{array}
+$$
+
+where the first inequality holds due to the complete assumption. The second inequality holds due to (G.5) and (G.6). The last inequality holds due to the fact $\widehat{f}_{H + 1} = V_{H + 1}^{*} = 0$ and our choice of $\beta_{H}$ , i.e.,
+
+$$
+\begin{array}{l} \beta_ {H} = \sqrt {2 \left(\frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta) + \frac {2}{3} \iota^ {2} (\delta) / \log \mathcal {N} _ {b} + 8 K L \epsilon\right)} \\ = \tilde {O} (\sqrt {\log \mathcal {N}}). \\ \end{array}
+$$
+
+However, conditioned on the event $\mathcal{E}_H$ , we have
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(r _ {H} ^ {k} + \widehat {f} _ {H + 1} (s _ {H + 1} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \left(\widetilde {f} _ {H} (z _ {H} ^ {k}) - \bar {f} _ {H} (z _ {H} ^ {k})\right) \\ \geq \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {H} (z _ {H} ^ {k})) ^ {2}} \left(\bar {f} _ {H} (z _ {H} ^ {k}) - \widetilde {f} _ {H} (z _ {H} ^ {k})\right) ^ {2} \\ > \frac {(\beta_ {H}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {H} ^ {k})) ^ {2}} \left(\bar {f} _ {H} (z _ {H} ^ {k}) - \widetilde {f} _ {H} (z _ {H} ^ {k})\right) ^ {2}}{2}, \\ \end{array}
+$$
+
+where the first inequality holds due to (G.4). The second inequality holds due to $\mathcal{E}_H$ . It contradicts with (G.7). Therefore, we prove that $\mathbb{P}[\mathcal{E}_H] \geq 1 - \delta / 2H^2$ .
+
+Suppose the event $\mathcal{E}_H$ holds, we can prove the following result.
+
+$$
+\begin{array}{l} Q _ {H} ^ {*} (s, a) = \left[ \mathcal {T} _ {H} V _ {H + 1} ^ {*} \right] (s, a) \\ = \left[ \mathcal {T} _ {H} \widehat {f} _ {H + 1} \right] (s, a) \\ \geq \widetilde {f} _ {H} (s, a) - \left| [ \mathcal {T} _ {H} \widehat {f} _ {H + 1} ] (s, a) - \widetilde {f} _ {H} (s, a) \right| \\ \geq \widetilde {f} _ {H} (s, a) - \left(\epsilon + | \bar {f} _ {H} (s, a) - \widetilde {f} _ {H} (s, a) |\right) \\ \geq \tilde {f} _ {H} (s, a) - b _ {H} (s, a) - \epsilon \\ = \widehat {f} _ {H} (s, a). \\ \end{array}
+$$
+
+where the first inequality holds due to the triangle inequality. The second inequality holds due to the completeness assumption. The third inequality holds due to the property of the bonus function and
+
+$$
+\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} \leq (\beta_ {h}) ^ {2}.
+$$
+
+by Lemma F.2. Therefore, $V_H^*(s) \geq \widehat{f}_H(s)$ for all $s \in S$ .
+
+We also have
+
+$$
+\begin{array}{l} V _ {H} ^ {*} (s) - \widehat {f} _ {H} (s) = \langle Q _ {H} ^ {*} (s, \cdot) - \widehat {f} _ {H} (s, \cdot), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} + \langle \widehat {f} _ {H} (s, \cdot), \pi_ {H} ^ {*} (\cdot | s) - \widehat {\pi} _ {H} (\cdot | s) \rangle_ {\mathcal {A}} \\ \leq \left\langle Q _ {H} ^ {*} (s, \cdot) - \widehat {f} _ {H} (s, \cdot), \pi^ {*} (\cdot | s) \right\rangle_ {\mathcal {A}} \\ = \langle [ T _ {H} V _ {H} ^ {*} ] (s, \cdot) - \tilde {f} _ {H} (s, \cdot) + b _ {H} (s, a), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ = \langle [ \mathcal {T} _ {H} \widehat {f} _ {H + 1} ] (s, \cdot) - \widetilde {f} _ {H} (s, \cdot) + b _ {H} (s, a), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ + \langle [ \mathcal {T} _ {H} V _ {H + 1} ^ {*} ] (s, \cdot) - [ \mathcal {T} _ {H} \widehat {f} _ {H + 1} ] (s, \cdot), \pi_ {H} ^ {*} (\cdot | s) \rangle_ {A} \\ \leq 2 \left\langle b _ {H} (s, \cdot), \pi_ {H} ^ {*} (\cdot | s) \right\rangle_ {A} + \epsilon \\ \leq \widetilde {O} \left(\frac {\sqrt {\log \mathcal {N}} H ^ {2}}{\sqrt {K \kappa}}\right), \\ \end{array}
+$$
+
+where the first inequality holds due to the policy $\widehat{\pi}_H$ takes the action which maximizes $\widehat{f}_H$ . The second inequality holds due to the Bellman completeness assumption. The last inequality holds due to the property of the bonus function
+
+$$
+b _ {H} (z) \leq C \cdot \left(D _ {\mathcal {F} _ {H}} (z; \mathcal {D} _ {H}; \widehat {\sigma} _ {H}) \cdot \sqrt {(\beta_ {H}) ^ {2} + \lambda} + \epsilon \beta_ {H}\right)
+$$
+
+and Lemma F.1.
+
+Then we do the induction step. Let $R_{h} = \widetilde{O}\left(\frac{\sqrt{\log\mathcal{N}}H^{2}}{\sqrt{K}\kappa}\right)\cdot (H - h + 1),\delta_{h} = (H - h + 1)\delta /(4H^{2}).$ We define another event $\mathcal{E}_h^{\mathrm{ind}}$ for induction.
+
+$$
+\mathcal {E} _ {h} ^ {\mathrm {i n d}} = \left\{0 \leq V _ {h} ^ {*} (s) - \widehat {f} _ {h} (s) \leq R _ {h}, \forall s \in \mathcal {S} \right\}.
+$$
+
+The above analysis shows that $\mathcal{E}_H\subseteq \mathcal{E}_H^{\mathrm{ind}}$ and $\mathbb{P}[\mathcal{E}_H]\geq 1 - 2\delta_H$ . Moreover, $\mathbb{P}[\mathcal{E}_H^{\mathrm{ind}}]\geq 1 - 2\delta_H$
+
+We conduct the induction in the following way. At stage $h$ , if $\mathbb{P}[\mathcal{E}_{h + 1}] \geq 1 - 2\delta_{h + 1}$ and $\mathbb{P}[\mathcal{E}_{h + 1}^{\mathrm{ind}}] \geq 1 - 2\delta_{h + 1}$ , we prove that $\mathbb{P}[\mathcal{E}_h] \geq 1 - 2\delta_h$ and $\mathbb{P}[\mathcal{E}_h^{\mathrm{ind}}] \geq 1 - 2\delta_h$ .
+
+Suppose at stage $h$ , $\mathbb{P}[\mathcal{E}_{h + 1}] \geq 1 - 2\delta_{h + 1}$ and $\mathbb{P}[\mathcal{E}_{h + 1}^{\mathrm{ind}}] \geq 1 - 2\delta_{h + 1}$ . We first use Lemma G.1. Let $f = \widetilde{f}_h \in \mathcal{F}_h$ , $f' = \bar{f}_h \in \mathcal{F}_h$ . We define
+
+$$
+\eta_ {h} ^ {k} := V _ {h + 1} ^ {*} \left(s _ {h + 1} ^ {k}\right) - \left[ \mathbb {P} _ {h} V _ {h + 1} ^ {*} \right] \left(z _ {h} ^ {k}\right)
+$$
+
+$$
+D _ {h} ^ {k} [ f, f ^ {\prime} ] := 2 \frac {\eta_ {h} ^ {k}}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right).
+$$
+
+After taking a union bound, we have with probability at least $1 - \delta /(4H^2)$ , the following inequality holds,
+
+$$
+\sum_ {k \in [ K ]} 2 \frac {\eta_ {h} ^ {k}}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\widetilde {f} (z _ {h} ^ {k}) - \bar {f} (z _ {h} ^ {k})\right) \leq \frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta)
+$$
+
+$$
++ \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(\widetilde {f} \left(z _ {h} ^ {k}\right) - \bar {f} \left(z _ {h} ^ {k}\right)\right) ^ {2}}{4}. \tag {G.8}
+$$
+
+Next, we use Lemma G.2 at stage $h$ . Let $f = \widetilde{f}_h \in \mathcal{F}_h$ , $\widetilde{f} = \bar{f}_h \in \mathcal{F}_h$ , $f' = \widehat{f}_{h+1} = \{\widetilde{b}\}_{[0,H-h+1]}$ where $\widetilde{b} = \widetilde{f}_h - b_h \in \mathcal{F}_h - \mathcal{W}$ . We define:
+
+$$
+\xi_ {h} ^ {k} [ f ^ {\prime} ] := f ^ {\prime} \left(s _ {h + 1} ^ {k}\right) - V _ {h + 1} ^ {*} \left(s _ {h + 1} ^ {k}\right) - \left[ \mathbb {P} _ {h} \left(f ^ {\prime} - V _ {h + 1} ^ {*}\right) \right] \left(z _ {h} ^ {k}\right)
+$$
+
+$$
+\Delta_ {h} ^ {k} [ f, \widetilde {f}, f ^ {\prime} ] := 2 \frac {\xi_ {h} ^ {k} [ f ^ {\prime} ]}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - \widetilde {f} (z _ {h} ^ {k})\right),
+$$
+
+After taking a union bound, we have with probability at least $1 - \delta /(4H^2)$ , we have
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \frac {\xi_ {h} ^ {k} [ \widehat {f} _ {h + 1} ]}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \leq \left(\frac {4}{3} \iota (\delta) \sqrt {\lambda} + \sqrt {2} \iota (\delta)\right) \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} \\ + \frac {2}{3} \iota^ {2} (\delta) / \sqrt {\log \mathcal {N} _ {b}} + 3 0 \iota^ {2} (\delta) \| \widehat {f} _ {h + 1} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(\widetilde {f} _ {h} \left(z _ {h} ^ {k}\right) - \bar {f} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}}{4}. \tag {G.9} \\ \end{array}
+$$
+
+Let $U_h$ be the event that (G.8) and (G.9) holds simultaneously. On the event $U_h \cap \mathcal{E}_{h+1}^{\mathrm{ind}}$ , which satisfies $\mathbb{P}[U_h \cap \mathcal{E}_{h+1}^{\mathrm{ind}}] \geq 1 - 2\delta_{h+1} - 2\delta / H^2 = 1 - 2\delta_h$ , we have
+
+$$
+2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right)
+$$
+
+$$
+\begin{array}{l} = 2 \sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} \left(s _ {h + 1} ^ {k}\right) - \left[ \mathcal {T} _ {h} \widehat {f} _ {h + 1} \right] \left(z _ {h} ^ {k}\right)\right) \left(\widetilde {f} _ {h} \left(z _ {h} ^ {k}\right) - \bar {f} _ {h} \left(z _ {h} ^ {k}\right)\right) \\ + 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left([ \mathcal {T} _ {h} \widehat {f} _ {h + 1} ] (z _ {h} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \leq 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k}) - [ \mathcal {T} _ {h} \widehat {f} _ {h + 1} ] (z _ {h} ^ {k})\right) \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) + 4 K L \epsilon \\ \leq \frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta) + \left(\frac {4}{3} \iota (\delta) \sqrt {\lambda} + \sqrt {2} \iota (\delta)\right) \| \widehat {f} _ {h + 1} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} \\ + \frac {2}{3} \iota^ {2} (\delta) / \log \mathcal {N} _ {b} + 3 0 \iota^ {2} (\delta) \| \widehat {f} _ {h + 1} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} + 8 K L \epsilon + \frac {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2}}{2} \\ \end{array}
+$$
+
+$$
+\leq \frac {(\beta_ {h}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} \left(z _ {h} ^ {k}\right)) ^ {2}} \left(\bar {f} _ {h} \left(z _ {h} ^ {k}\right) - \widetilde {f} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}}{2}, \tag {G.10}
+$$
+
+where the first inequality holds due to the completeness assumption. The second inequality holds due to (G.8) and (G.9). The last inequality holds due to the event $\mathcal{E}_{h + 1}^{\mathrm{ind}}$ and the choice of $K\geq \widetilde{\Omega}\left(\frac{\iota(\delta)^2H^6}{\kappa}\right)$ .
+
+However, on the event of $\mathcal{E}_h^{\mathrm{c}}$ , we have
+
+$$
+\begin{array}{l} 2 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(r _ {h} ^ {k} + \widehat {f} _ {h + 1} (s _ {h + 1} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \left(\widetilde {f} _ {h} (z _ {h} ^ {k}) - \bar {f} _ {h} (z _ {h} ^ {k})\right) \\ \geq \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} \\ > \frac {(\beta_ {h}) ^ {2}}{2} + \frac {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2}}{2}. \\ \end{array}
+$$
+
+where the first inequality holds due to (G.4). The second inequality holds due to event $\mathcal{E}_h^c$ . However, this contradicts with (G.10). We conclude that $U_h \cap \mathcal{E}_{h+1}^{\mathrm{ind}} \subseteq \mathcal{E}_h$ , thus $\mathbb{P}[\mathcal{E}_h] \geq 1 - 2\delta_h$ .
+
+Next we prove $\mathbb{P}[\mathcal{E}_h^{\mathrm{ind}}] \geq 1 - 2\delta_h$ . Suppose the event $U_h \cap \mathcal{E}_{h+1}^{\mathrm{ind}}$ holds, the above conclusion shows that
+
+$$
+\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} > (\beta_ {h}) ^ {2}.
+$$
+
+We can prove the following result.
+
+$$
+\begin{array}{l} Q _ {h} ^ {*} (s, a) = \left[ \mathcal {T} _ {h} V _ {h + 1} ^ {*} \right] (s, a) \\ \geq \left[ \mathcal {T} _ {h} \widehat {f} _ {h + 1} \right] (s, a) \\ \geq \widetilde {f} _ {h} (s, a) - | [ \mathcal {T} _ {h} \widehat {f} _ {h + 1} ] (s, a) - \widetilde {f} _ {h} (s, a) | \\ \geq \widetilde {f} _ {h} (s, a) - (\epsilon + | \bar {f} _ {h} (s, a) - \widetilde {f} _ {h} (s, a) |) \\ \geq \widetilde {f} _ {h} (s, a) - b _ {h} (s, a) \\ = \widehat {f} _ {h} (s, a), \\ \end{array}
+$$
+
+where the first inequality holds due to the event $\mathcal{E}_h^{\mathrm{ind}}$ . The second inequality holds due to the triangle inequality. The third inequality holds due to the completeness assumption. The last inequality holds due to the property of the bonus function and
+
+$$
+\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} \leq (\beta_ {h}) ^ {2}.
+$$
+
+Therefore, $V_{h}^{*}(s)\geq \widehat{f}_{h}(s)$ for all $s\in S$
+
+We also have
+
+$$
+\begin{array}{l} V _ {h} ^ {*} (s) - \widehat {f} _ {h} (s) = \langle Q _ {h} ^ {*} (s, \cdot) - \widehat {f} _ {h} (s, \cdot), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} + \langle \widehat {f} _ {h} (s, \cdot), \pi_ {h} ^ {*} (\cdot | s) - \widehat {\pi} _ {h} (\cdot | s) \rangle_ {\mathcal {A}} \\ \leq \langle Q _ {h} ^ {*} (s, \cdot) - \widehat {f} _ {h} (s, \cdot), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ = \langle [ T _ {h} V _ {h} ^ {*} ] (s, \cdot) - \widetilde {f} _ {h} (s, \cdot) + b _ {h} (s, a), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ = \langle [ \mathcal {T} _ {h} \widehat {f} _ {h + 1} ] (s, \cdot) - \widetilde {f} _ {h} (s, \cdot) + b _ {h} (s, a), \pi^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ + \langle [ \mathcal {T} _ {h} V _ {h + 1} ^ {*} ] (s, \cdot) - [ \mathcal {T} _ {h} \widehat {f} _ {h + 1} ] (s, \cdot), \pi_ {h} ^ {*} (\cdot | s) \rangle_ {\mathcal {A}} \\ \leq 2 \left\langle b _ {h} (s, \cdot), \pi_ {h} ^ {*} (\cdot , s) \right\rangle_ {\mathcal {A}} + \epsilon + R _ {h + 1} \\ \leq \widetilde {O} \left(\frac {\sqrt {\log \mathcal {N}} H ^ {2}}{\sqrt {K \kappa}}\right) \cdot (H - h + 1) = R _ {h}. \\ \end{array}
+$$
+
+where the first inequality holds due to the policy $\widehat{\pi}_h$ takes the action which maximizes $\widehat{f}_h$ . The second inequality holds due to the Bellman completeness assumption. The second inequality holds due to the property of the bonus function
+
+$$
+b _ {h} (z) \leq C \cdot \left(D _ {\mathcal {F} _ {h}} (z; \mathcal {D} _ {h}; \widehat {\sigma} _ {h} ^ {2}) \cdot \sqrt {(\beta_ {h}) ^ {2} + \lambda} + \epsilon \beta_ {h}\right)
+$$
+
+and Lemma F.1. The last inequality holds due to the induction assumption. Therefore, we have $U_{h} \cap \mathcal{E}_{h + 1}^{\mathrm{ind}} \subseteq \mathcal{E}_{h}^{\mathrm{ind}}$ and $\mathbb{P}[\mathcal{E}_h^{\mathrm{ind}}] \geq 1 - 2\delta_h$ . Thus we complete the proof of induction.
+
+Finally, taking the union bound of all the $\mathcal{E}_h$ , we get the result that with probability at least $1 - \delta / 2$ , the event $\cup_{h=1}^{H} \mathcal{E}_h$ holds, i.e. for any $h \in [H]$ simultaneously, we have
+
+$$
+\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(\bar {f} _ {h} (z _ {h} ^ {k}) - \widetilde {f} _ {h} (z _ {h} ^ {k})\right) ^ {2} \leq (\beta_ {h}) ^ {2}.
+$$
+
+Therefore, we complete the proof of Lemma F.2.
+
+# H PROOF OF LEMMAS IN SECTION E AND G
+
+# H.1 PROOF OF LEMMA E.1
+
+Proof of Lemma E.1. We use Lemma I.1, with the following conditions:
+
+$\bar{D}_h^k [f,f']$ is adapted to the filtration $\mathcal{\bar{H}}_h^k$ and $\mathbb{E}\left[\bar{D}_h^k [f,f']\mid \bar{\mathcal{H}}_h^{k - 1}\right] = 0.$
+
+$$
+\left| \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] \right| \leq 2 \left| \bar {\eta} _ {h} ^ {k} \right| \max _ {z} | f (z) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] (z) | \leq 4 H ^ {2} = M.
+$$
+
+$$
+\sum_ {k \in [ K ]} \mathbb {E} \left[ \left(\bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ]\right) ^ {2} \mid \bar {z} _ {h} ^ {k} \right] = \sum_ {k \in [ K ]} \mathbb {E} \left[ 4 \left(\bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ]\right) ^ {2} \mid \bar {z} _ {h} ^ {k} \right] \left(f (\bar {z} _ {h} ^ {k}) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] (\bar {z} _ {h} ^ {k})\right) ^ {2} \leq (4 H K) ^ {2} = V ^ {2}.
+$$
+
+On the other hand,
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \mathbb {E} \left[ \left(\bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ]\right) ^ {2} \mid \bar {z} _ {h} ^ {k} \right] = \sum_ {k \in [ K ]} \mathbb {E} \left[ 4 \left(\bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ]\right) ^ {2} \mid \bar {z} _ {h} ^ {k} \right] \left(f (\bar {z} _ {h} ^ {k}) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ \leq 8 H ^ {2} \sum_ {k \in [ K ]} \left(f (\bar {z} _ {h} ^ {k}) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] (\bar {z} _ {h} ^ {k})\right) ^ {2}. \\ \end{array}
+$$
+
+Then using Lemma I.1 with $v = 1$ , $m = 1$ , with at least $1 - \delta / (4H^{2}\mathcal{N}^{2}\mathcal{N}_{b}^{2})$
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \bar {\eta} _ {h} ^ {k} \left[ f ^ {\prime} \right] \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) \leq i (\delta) \sqrt {2 (2 \cdot 8 H ^ {2}) \sum_ {k \in [ K ]} \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}} \\ + \frac {2}{3} i ^ {2} (\delta) + \frac {4}{3} i ^ {2} (\delta) \cdot 4 H ^ {2} \\ \leq (2 4 H ^ {2} + 5) i ^ {2} (\delta) + \frac {\sum_ {k \in [ K ]} \left(f (\bar {z} _ {h} ^ {k}) - [ \mathcal {T} _ {h} f ^ {\prime} ] (\bar {z} _ {h} ^ {k})\right) ^ {2}}{2}. \\ \end{array}
+$$
+
+We complete the proof of Lemma E.1.
+
+
+
+# H.2 PROOF OF LEMMA E.2
+
+Proof of Lemma E.2. We use Lemma I.1, with the following conditions:
+
+$\bar{D}_h^k [f,f']$ is adapted to the filtration $\bar{\mathcal{H}}_h^k$ and $\mathbb{E}\left[\bar{D}_h^k [f,f']\mid \bar{\mathcal{H}}_h^{k - 1}\right] = 0$
+
+$$
+\left| \bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ] \right| \leq 2 | \bar {\eta} _ {h} ^ {k} | \max _ {z} | f (z) - [ \mathcal {T} _ {2, h} f ^ {\prime} ] (z) | \leq 4 L ^ {2} = M.
+$$
+
+$$
+\sum_ {k \in [ K ]} \mathbb {E} \left[ \left(\bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ]\right) ^ {2} \Big | \bar {z} _ {h} ^ {k} \right] = \sum_ {k \in [ K ]} \mathbb {E} \left[ 4 (\bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ]) ^ {2} | \bar {z} _ {h} ^ {k} \right] \left(f (\bar {z} _ {h} ^ {k}) - [ \mathcal {T} _ {2, h} f ^ {\prime} ] (\bar {z} _ {h} ^ {k})\right) ^ {2} \leq (4 L ^ {2} K) ^ {2} = V ^ {2}.
+$$
+
+On the other hand,
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \mathbb {E} \left[ \left(\bar {D} _ {h} ^ {k} [ f, f ^ {\prime} ]\right) ^ {2} \mid \bar {z} _ {h} ^ {k} \right] = \sum_ {k \in [ K ]} \mathbb {E} \left[ 4 \left(\bar {\eta} _ {h} ^ {k} [ f ^ {\prime} ]\right) ^ {2} \mid \bar {z} _ {h} ^ {k} \right] \left(f (\bar {z} _ {h} ^ {k}) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] (\bar {z} _ {h} ^ {k})\right) ^ {2} \\ \leq 8 L ^ {4} \sum_ {k \in [ K ]} \left(f (\bar {z} _ {h} ^ {k}) - \left[ \mathcal {T} _ {2, h} f ^ {\prime} \right] (\bar {z} _ {h} ^ {k})\right) ^ {2}. \\ \end{array}
+$$
+
+Then using Lemma I.1 with $v = 1$ , $m = 1$ , we have:
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \bar {\eta} _ {h} ^ {k} \left[ f ^ {\prime} \right] \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {2, h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) \leq i ^ {\prime} (\delta) \sqrt {2 (2 \cdot 8 L ^ {4}) \sum_ {k \in [ K ]} \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {2 , h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}} \\ + \frac {2}{3} i ^ {\prime 2} (\delta) + \frac {4}{3} i ^ {\prime 2} (\delta) \cdot 4 L ^ {2} \\ \leq (2 0 L ^ {4} + 5) i ^ {\prime 2} (\delta) + \frac {\sum_ {k \in [ K ]} \left(f \left(\bar {z} _ {h} ^ {k}\right) - \left[ \mathcal {T} _ {h} f ^ {\prime} \right] \left(\bar {z} _ {h} ^ {k}\right)\right) ^ {2}}{2} \\ \end{array}
+$$
+
+We complete the proof of Lemma E.2.
+
+
+
+# H.3 PROOF OF LEMMA G.1
+
+Proof of Lemma G.1. We use Lemma I.1, with the following conditions:
+
+$$
+D _ {h} ^ {k} [ f, f ^ {\prime} ] \text {i s a d a p t e d t o t h e f l i t r a t i o n} \mathcal {H} _ {h} ^ {k} \text {a n d} \mathbb {E} \left[ D _ {h} ^ {k} [ f, f ^ {\prime} ] \mid \mathcal {H} _ {h} ^ {k - 1} \right] = 0.
+$$
+
+$$
+\left| D _ {h} ^ {k} [ f, f ^ {\prime} ] \right| \leq 2 \left| \eta_ {h} ^ {k} \right| \max _ {z} | f (z) - f ^ {\prime} (z) | \leq 8 L H = M.
+$$
+
+$$
+\sum_ {k \in [ K ]} \mathbb {E} \left[ \left(D _ {h} ^ {k} [ f, f ^ {\prime} ]\right) ^ {2} \Big | z _ {h} ^ {k} \right] = 4 \sum_ {k \in [ K ]} \frac {\mathbb {E} \left[ (\eta_ {h} ^ {k}) ^ {2} \Big | z _ {h} ^ {k} \right]}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {4}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right).
+$$
+
+On the other hand,
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} \mathbb {E} \left[ \left(D _ {h} ^ {k} [ f, f ^ {\prime} ]\right) ^ {2} \mid z _ {h} ^ {k} \right] = 4 \sum_ {k \in [ K ]} \frac {\mathbb {E} \left[ \left(\eta_ {h} ^ {k}\right) ^ {2} \mid z _ {h} ^ {k} \right]}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {4}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2} \\ \leq 8 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2}, \\ \end{array}
+$$
+
+where the last inequality holds because of the inequality in Lemma D.4:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left(\eta_ {h} ^ {k}\right) ^ {2} | z _ {h} ^ {k} \right] = \left[ \operatorname {V a r} _ {h} V _ {h + 1} ^ {*} \right] \left(s _ {h} ^ {k}, a _ {h} ^ {k}\right) \\ \leq \left[ \mathbb {V} _ {h} V _ {h + 1} ^ {*} \right] \left(s _ {h} ^ {k}, a _ {h} ^ {k}\right) \\ \leq \left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \widetilde {O} \left(\frac {\sqrt {\log (\mathcal {N} \cdot \mathcal {N} _ {b})} H ^ {3}}{\sqrt {K \kappa}}\right) \\ \leq 2 \left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}, \\ \end{array}
+$$
+
+where we use the requirement that $K \geq \widetilde{\Omega}\left(\frac{\log(\mathcal{N} \cdot \mathcal{N}_b)H^6}{\kappa}\right)$ .
+
+Moreover, for any $k\in [K]$
+
+$$
+\begin{array}{l} \left| D _ {h} ^ {k} \left[ f, f ^ {\prime} \right] \right| \leq 2 \left| \frac {\eta_ {h} ^ {k}}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \right| \left| f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right) \right| \\ \leq 4 H \sqrt {D _ {\mathcal {F} _ {h}} ^ {2} \left(z _ {h} ^ {k} , \mathcal {D} _ {h} , \widehat {\sigma} _ {h} ^ {2}\right) \left(\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \lambda\right)} \\ \leq \widetilde {O} \left(\frac {4 H ^ {2}}{\sqrt {K \kappa}}\right) \sqrt {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2} + \lambda} \\ \leq \frac {1}{v (\delta)} \sqrt {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2} + \lambda}. \\ \end{array}
+$$
+
+The second inequality holds because of the definition of $D^2$ divergence (Definition 3.4). The third inequality holds due to Lemma F.1. The last inequality holds because of the choice of $K \geq \widetilde{\Omega}\left(\frac{v^2(\delta)H^4}{\kappa}\right)$ .
+
+Then using Lemma I.1 with $v = 1$ , $m = 1$ , we have
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \frac {\eta_ {h} ^ {k}}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) \leq v (\delta) \sqrt {1 6 \sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2} + 2} + \frac {2}{3} v ^ {2} (\delta) \\ + \frac {4}{3} v (\delta) \sqrt {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2} + \lambda} \\ \leq \frac {4}{3} v (\delta) \sqrt {\lambda} + \sqrt {2} v (\delta) + 3 0 v ^ {2} (\delta) \\ + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2}}{4}. \\ \end{array}
+$$
+
+We complete the proof of Lemma G.1.
+
+# H.4 PROOF OF LEMMA G.2
+
+Proof of Lemma G.2. $\Delta_h^k [f,\widetilde{f},f']$ is adapted to the filtration $\mathcal{H}_h^k$ and $\mathbb{E}\left[\Delta_h^k [f,\widetilde{f},f']\mid \mathcal{H}_h^{k - 1}\right] = 0$ . We also have
+
+$$
+\sum_ {k \in [ K ]} \mathbb {E} \left[ (\Delta_ {h} ^ {k} [ f, \widetilde {f}, f ^ {\prime} ]) ^ {2} \Big | z _ {h} ^ {k} \right] = 4 \sum_ {k \in [ K ]} \frac {\mathbb {E} \left[ (\xi_ {h} ^ {k} [ f ^ {\prime} ]) ^ {2} \Big | z _ {h} ^ {k} \right]}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {4}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2}
+$$
+
+$$
+\leq 8 \sum_ {k \in [ K ]} \frac {\left\| f ^ {\prime} - V _ {h + 1} ^ {*} \right\| _ {\infty} ^ {2}}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2}.
+$$
+
+Moreover, for any $k\in [K]$
+
+$$
+\begin{array}{l} \left| \Delta_ {h} ^ {k} [ f, \widetilde {f}, f ^ {\prime} ] \right| \leq 2 \left| \frac {\xi_ {h} ^ {k} [ f ^ {\prime} ]}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \right| \left| f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right) \right| \\ \leq 4 \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} \sqrt {D _ {\mathcal {F} _ {h}} ^ {2} \left(z _ {h} ^ {k} , \mathcal {D} _ {h} , \widehat {\sigma} _ {h} ^ {2}\right) \left(\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \lambda\right)} \\ \leq \widetilde {O} \left(\frac {H}{\sqrt {K \kappa}}\right) \cdot \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} \sqrt {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})\right) ^ {2} + \lambda} \\ \leq \frac {\left\| f ^ {\prime} - V _ {h + 1} ^ {*} \right\| _ {\infty}}{\iota (\delta)} \sqrt {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2} + \lambda} \\ \end{array}
+$$
+
+The second inequality holds because of the definition of $D^2$ divergence (Definition 3.4). The third inequality holds due to Lemma F.1. The last inequality holds because of the choice of $K \geq \widetilde{\Omega}\left(\frac{\iota^2(\delta)H^4}{\kappa}\right)$ .
+
+Then using Lemma I.1 with $v = 1$ , $m = 1 / \log \mathcal{N}_b$ , with probability at least $1 - \delta /(4H^2\mathcal{N}^3\mathcal{N}_b)$ , we have
+
+$$
+\begin{array}{l} \sum_ {k \in [ K ]} 2 \frac {\xi_ {h} ^ {k} \left[ f ^ {\prime} \right]}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - \widetilde {f} \left(z _ {h} ^ {k}\right)\right) \leq \iota (\delta) \sqrt {8 \sum_ {k \in [ K ]} \frac {\| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2}}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2} + 2} \\ + \frac {2}{3} \iota^ {2} (\delta) / \log \mathcal {N} _ {b} + \frac {4}{3} \iota (\delta) \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} \sqrt {\sum_ {k \in [ K ]} \frac {1}{(\widehat {\sigma} _ {h} (z _ {h} ^ {k})) ^ {2}} (f (z _ {h} ^ {k}) - f ^ {\prime} (z _ {h} ^ {k})) ^ {2} + \lambda} \\ \leq \left(\frac {4}{3} \iota (\delta) \sqrt {\lambda} + \sqrt {2} \iota (\delta)\right) \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} + \frac {2}{3} \iota^ {2} (\delta) / \log \mathcal {N} _ {b} + 3 0 \iota^ {2} (\delta) \| f ^ {\prime} - V _ {h + 1} ^ {*} \| _ {\infty} ^ {2} \\ + \frac {\sum_ {k \in [ K ]} \frac {1}{\left(\widehat {\sigma} _ {h} \left(z _ {h} ^ {k}\right)\right) ^ {2}} \left(f \left(z _ {h} ^ {k}\right) - f ^ {\prime} \left(z _ {h} ^ {k}\right)\right) ^ {2}}{4}. \\ \end{array}
+$$
+
+We complete the proof of Lemma G.2.
+
+# I AUXILIARY LEMMAS
+
+Lemma I.1 (Agarwal et al. 2023). Let $M > 0$ , $V > v > 0$ be constants, and $\{x_i\}_{i \in [t]}$ be a stochastic process adapted to a filtration $\{\mathcal{H}_i\}_{i \in [t]}$ . Suppose $\mathbb{E}[x_i | \mathcal{H}_{i-1}] = 0$ , $|x_i| \leq M$ and $\sum_{i \in [t]} \mathbb{E}[x_i^2 | \mathcal{H}_{i-1}] \leq V^2$ almost surely. Then for any $\delta, \epsilon > 0$ , let $\iota = \sqrt{\log \frac{(2 \log(V / v) + 2) \cdot (\log(M / m) + 2)}{\delta}}$ , we have
+
+$$
+\mathbb {P} \left(\sum_ {i \in [ t ]} x _ {i} > \iota \sqrt {2 \left(2 \sum_ {i \in [ t ]} \mathbb {E} \left[ x _ {i} ^ {2} \mid \mathcal {H} _ {i - 1} \right] + v ^ {2}\right)} + \frac {2}{3} \iota^ {2} \left(2 \max _ {i \in [ t ]} | x _ {i} | + m\right)\right) \leq \delta .
+$$
+
+Lemma I.2 (Regret Decomposition Property, Jin et al. 2021b). Suppose the following inequality holds,
+
+$$
+\left| \left[ \mathcal {T} _ {h} \widehat {f} _ {h + 1} \right] (z) - \widetilde {f} _ {h} (z) \right| \leq b _ {h} (z), \forall z = (s, a) \in \mathcal {S} \times \mathcal {A}, \forall h \in [ H ],
+$$
+
+the regret of Algorithm 1 can be bounded as
+
+$$
+V _ {1} ^ {*} (s) - V _ {1} ^ {\widehat {\pi}} (s) \leq 2 \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi^ {*}} \left[ b _ {h} \left(s _ {h}, a _ {h}\right) \mid s _ {1} = s \right].
+$$
+
+Here $\mathbb{E}_{\pi^*}$ is with respect to the trajectory induced by $\pi^*$ in the underlying MDP.
+
+Lemma I.3 (Azuma-Hoeffding inequality, Cesa-Bianchi & Lugosi 2006). Let $\{x_i\}_{i=1}^n$ be a martingale difference sequence with respect to a filtration $\{\mathcal{G}_i\}$ satisfying $|x_i| \leq M$ for some constant $M$ , $x_i$ is $\mathcal{G}_{i+1}$ -measurable, $\mathbb{E}[x_i|\mathcal{G}_i] = 0$ . Then for any $0 < \delta < 1$ , with probability at least $1 - \delta$ , we have
+
+$$
+\sum_ {i = 1} ^ {n} x _ {i} \leq M \sqrt {2 n \log (1 / \delta)}.
+$$
\ No newline at end of file
diff --git a/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/images.zip b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b12576f7ebf31a946b32145f4f304a8ed8c82493
--- /dev/null
+++ b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:de304de06fefe3dd5a4421511cc8785a25d4368ec866c95f282d42b4d8d40b7a
+size 2403785
diff --git a/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/layout.json b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..56e12fad1d6ffd1f5b1533380025d1f7c2913cfd
--- /dev/null
+++ b/pessimisticnonlinearleastsquaresvalueiterationforofflinereinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c781876fad04179ddb60bc64f04db598abdb87c7613099d29d4ad94c8df0c39f
+size 1420330
diff --git a/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_content_list.json b/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..d90cb599e56c81300a492dcc279144eeff7d3099
--- /dev/null
+++ b/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3457f758abd2cbd80d811d42b66fd194cedb9b7367b7f8f2db94231373fbe1ef
+size 183218
diff --git a/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_model.json b/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..1da04a34a1dd871b849bc8b7a9192498ae1df434
--- /dev/null
+++ b/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7c4da11ae5dcb56c7bc8f40576e5f8af432b6538118c0b63e3c74cb9c582e922
+size 214528
diff --git a/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_origin.pdf b/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..463bfded6d1cf3f408b017975d20736fc2847591
--- /dev/null
+++ b/phylogfnphylogeneticinferencewithgenerativeflownetworks/f8a297a6-fd3a-462f-aa7c-1485f9b81d72_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7494d205d32d51a73b21ecc5dc8b8da50c0720b5cb057f484f09334e2e0e920
+size 2334313
diff --git a/phylogfnphylogeneticinferencewithgenerativeflownetworks/full.md b/phylogfnphylogeneticinferencewithgenerativeflownetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..9db200b5891bb61e6951f7662b6007f5db6f086f
--- /dev/null
+++ b/phylogfnphylogeneticinferencewithgenerativeflownetworks/full.md
@@ -0,0 +1,842 @@
+# PHYLOGFN: PHYLOGENETIC INFERENCE WITH GENERATIVE FLOW NETWORKS
+
+Mingyang Zhou*
+
+McGill University
+
+Zichao Yan*
+
+McGill University
+
+Université de Montréal, Mila
+
+Elliot Layne
+
+McGill University, Mila
+
+Nikolay Malkin
+
+Université de Montréal, Mila
+
+Dinghuai Zhang
+
+Université de Montréal, Mila
+
+Moksh Jain
+
+Université de Montréal, Mila
+
+Mathieu Blanchette
+
+McGill University, Mila
+
+Yoshua Bengio†
+
+Université de Montréal, Mila
+
+{ming.zhou,zichao.yan,elliot.layne}@mail.mcgill.ca,blanchem@cs.mcgill.ca
+
+{nikolay.malkin,dinghuai.zhang,moksh.jain,yoshua.bengio}@mila.quebec
+
+# ABSTRACT
+
+Phylogenetics is a branch of computational biology that studies the evolutionary relationships among biological entities. Its long history and numerous applications notwithstanding, inference of phylogenetic trees from sequence data remains challenging: the extremely large tree space poses a significant obstacle for the current combinatorial and probabilistic techniques. In this paper, we adopt the framework of generative flow networks (GFlowNets) to tackle two core problems in phylogenetics: parsimony-based and Bayesian phylogenetic inference. Because GFlowNets are well-suited for sampling complex combinatorial structures, they are a natural choice for exploring and sampling from the multimodal posterior distribution over tree topologies and evolutionary distances. We demonstrate that our amortized posterior sampler, PhyloGFN, produces diverse and high-quality evolutionary hypotheses on real benchmark datasets. PhyloGFN is competitive with prior works in marginal likelihood estimation and achieves a closer fit to the target distribution than state-of-the-art variational inference methods.
+
+# 1 INTRODUCTION
+
+Phylogenetic inference has long been a central problem in the field of computational biology. Accurate phylogenetic inference is critical for a number of important biological analyses, such as understanding the development of antibiotic resistance (Aminov & Mackie, 2007; Ranjbar et al., 2020; Layne et al., 2020), assessing the risk of invasive species (Hamelin et al., 2022; Dort et al., 2023), and many others. Accurate phylogenetic trees can also be used to improve downstream computational analyses, such as multiple genome alignment (Blanchette et al., 2004), ancestral sequence reconstruction (Ma et al., 2006), protein structure and function annotation (Celniker et al., 2013).
+
+Despite its strong medical relevance and wide applications in life science, phylogenetic inference has remained a standing challenge, in part due to the high complexity of tree space — for $n$ species, $(2n - 5)!!$ unique unrooted bifurcating tree topologies exist. This poses a common obstacle to all branches of phylogenetic inference; both maximum-likelihood and maximum-parsimony tree reconstruction are NP-hard problems (Day, 1987; Chor & Tuller, 2005). Under the Bayesian formulation of phylogenetics, the inference problem is further compounded by the inclusion of continuous variables that capture the level of sequence divergence along each branch of the tree.
+
+One line of prior work considers Markov chain Monte Carlo (MCMC)-based approaches, such as MrBayes (Ronquist et al., 2012). These approaches have been successfully applied to Bayesian phylogenetic inference. However, a known limitation of MCMC is scalability to high-dimensional
+
+distributions with multiple separated modes (Tjelmeland & Hegstad, 2001), which arise in larger phylogenetic datasets. Recently, variational inference (VI)-based approaches have emerged. Among these methods, some model only a limited portion of the space of tree topologies, while others are weaker in marginal likelihood estimation due to simplifying assumptions. In parsimony analysis, state-of-the-art methods such as PAUP* (Swofford, 1998) have extensively relied on heuristic search algorithms that are efficient but lack theoretical foundations and guarantees.
+
+Coming from the intersection of variational inference and reinforcement learning is the class of models known as generative flow networks (GFlowNets; Bengio et al., 2021). The flexibility afforded by GFlowNets to learn sequential samplers for distributions over compositional objects makes them a promising candidate for performing inference over the posterior space of phylogenetic tree topologies and evolutionary distances.
+
+In this work, we propose PhyloGFN, the first adaptation of GFlowNets to the task of Bayesian and parsimony-based phylogenetic inference. Our contributions are as follows:
+
+(1) We design an acyclic Markov decision process (MDP) with fully customizable reward functions, by which our PhyloGFN can be trained to construct phylogenetic trees in a bottom-up fashion.
+(2) PhyloGFN leverages a novel tree representation inspired by Fitch and Felsenstein's algorithms to represent rooted trees without introducing additional learnable parameters to the model. PhyloGFN is also coupled with simple yet effective training techniques such as using mixed on-policy and dithered-policy rollouts, replay buffers and cascading temperature-annealing.
+(3) PhyloGFN has the capacity to explore and sample from the entire phylogenetic tree space, achieving a balance between exploration in this vast space and high-fidelity modeling of the modes. While PhyloGFN performs on par with the state-of-the-art MCMC- and VI-based methods in the summary metric of marginal log-likelihood, it substantially outperforms these approaches in terms of its ability to estimate the posterior probability of suboptimal trees.
+
+# 2 RELATED WORK
+
+Markov chain Monte Carlo (MCMC)-based algorithms are commonly employed for Bayesian phylogenetics, with notable examples including MrBayes and RevBayes (Ronquist et al., 2012; Hohna et al., 2016), which are considered state-of-the-art in the field. Amortized variational inference (VI) is an alternative approach that parametrically estimates the posterior distribution. VBPI-GNN (Zhang, 2023) employs subsplit Bayesian networks (SBN) (Zhang & Matsen IV, 2018a) to model tree topology distributions and uses graph neural networks to learn tree topological embeddings (Zhang, 2023). While VBPI-GNN has obtained marginal log likelihood competitive with MrBayes in real datasets, it requires a pre-generated set of high-quality tree topologies to constrain its action space for tree construction, which ultimately limits its ability to model the entire tree space.
+
+There exist other VI approaches that do not limit the space of trees. VaiPhy (Koptagel et al., 2022) approximates the posterior distribution in the augmented space of tree topologies, edge lengths, and ancestral sequences. Combined with combinatorial sequential Monte Carlo (CSMC; Moretti et al., 2021), the proposed method enables faster estimation of marginal likelihood. GeoPhy (Mimori & Hamada, 2023) models the tree topology distribution in continuous space by mapping continuous-valued coordinates to tree topologies, using the same technique as VBPI-GNN to model tree topological embeddings. While both methods model the entire tree topology space, their performance on marginal likelihood estimation underperforms the state of the art.
+
+For the optimization problem underpinning maximum parsimony inference, PAUP* is one of the most commonly used programs (Swofford, 1998); it features several fast, greedy, and heuristic algorithms based on local branch-swapping operations such as tree bisection and reconnection.
+
+GFlowNets are a family of methods for sampling discrete objects from multimodal distributions, such as molecules (Bengio et al., 2021) and biological sequences (Jain et al., 2022), and are used to solve discrete optimization tasks (Zhang et al., 2023a;b). With their theoretical foundations laid out in Bengio et al. (2023); Lahlou et al. (2023), and connections to variational inference established in Malkin et al. (2023), GFlowNets have been successfully applied to tackle complex Bayesian inference problems, such as inferring latent causal structures in gene regulatory networks (Deleu et al., 2022; 2023), and parse trees in hierarchical grammars (Hu et al., 2023).
+
+# 3 BACKGROUND
+
+# 3.1 PHYLOGENETIC INFERENCE
+
+Here we introduce the problems of Bayesian and parsimony-based phylogenetic inference. A weighted phylogenetic tree is denoted by $(z, b)$ , where $z$ represents the tree topology with its leaves labeled by observed sequences, and $b$ represents the branch lengths. The tree topology can be either a rooted binary tree or a bifurcating unrooted tree. For a tree topology $z$ , let $L(z)$ denote the labeled sequence set and $E(z)$ the set of edges. For an edge $e \in E(z)$ , let $b(e)$ denote its length. Let $\mathbf{Y} = \{\mathbf{y}_1, \mathbf{y}_2 \dots, \mathbf{y}_n\} \in \Sigma^{n \times m}$ be a set of $n$ observed sequences, each having $m$ characters from alphabet $\Sigma$ , e.g., $\{A, C, G, T\}$ for DNA sequences. We denote the $i^{\text{th}}$ site of all sequences by $\mathbf{Y}^i = \{\mathbf{y}_1[i], \mathbf{y}_2[i] \dots, \mathbf{y}_n[i]\}$ . In this work, we make two assumptions that are common in the phylogenetic inference literature: (i) sites evolve independently; (ii) evolution follows a time-reversible substitution model. The latter implies that an unrooted tree has the same parsimony score or likelihood as its rooted versions, and thus the algorithms we introduce below (Fitch and Felsenstein) apply to unrooted trees as well.
+
+# 3.1.1 BAYESIAN INFERENCE
+
+In Bayesian phylogenetic inference, we are interested in sampling from the posterior distribution over weighted phylogenetic trees $(z,b)$ , formulated as:
+
+$$
+P (z, b \mid Y) = \frac {P (z , b) P (Y \mid z , b)}{P (Y)}
+$$
+
+where $P(\mathbf{Y} \mid z, b)$ is the likelihood, $P(\mathbf{Y})$ is the intractable marginal, and $P(z, b)$ is the prior density over tree topology and branch lengths. Under the site independence assumption, the likelihood can be factorized as: $P(\mathbf{Y} \mid z, b) = \prod_{i} P(\mathbf{Y}^{i} \mid z, b)$ , and each factor is obtained by marginalizing over all internal nodes $a_{j}$ and their possible character assignment:
+
+$$
+P \left(\mathbf {y} _ {1} [ i ] \dots \mathbf {y} _ {n} [ i ] \mid z, b\right) = \sum_ {a _ {n + 1} ^ {i}, \dots a _ {2 n - 1} ^ {i}} P \left(a _ {2 n - 1}\right) \prod_ {j = n + 1} ^ {2 n - 2} P \left(a _ {j} ^ {i} \mid a _ {\alpha (j)} ^ {i}, b \left(e _ {j}\right)\right) \prod_ {k = 1} ^ {n} P \left(\mathbf {y} _ {k} [ i ] \mid a _ {\alpha (k)} ^ {i}, b _ {z} \left(e _ {k}\right)\right)
+$$
+
+where $a_{n+1}^i, \ldots, a_{2n-2}^i$ represent the internal node characters assigned to site $i$ and $\alpha(i)$ represent the parent of node $i$ . $P(a_{2n-1})$ is a distribution at the root node, which is usually assumed to be uniform over the vocabulary, while the conditional probability $P(a_j^i | a_{\alpha(j)}^i, b(e_j))$ is defined by the substitution model (where $e_j$ is the edge linking $a_j$ to $\alpha(a_j)$ ).
+
+Felsenstein's algorithm The likelihood of a given weighted phylogenetic tree can be calculated efficiently using Felsenstein's pruning algorithm (Felsenstein, 1973) in a bottom-up fashion through dynamic programming. Defining $L_{u}^{i}$ as the leaf sequence characters at site $i$ below the internal node $u$ , and given its two child nodes $v$ and $w$ , the conditional probability $P(L_{u}^{i}|a_{u}^{i})$ can be obtained from $P(L_{v}^{i}|a_{v}^{i})$ and $P(L_{w}^{i}|a_{w}^{i})$ :
+
+$$
+P \left(L _ {u} ^ {i} \mid a _ {u} ^ {i}\right) = \sum_ {a _ {v} ^ {i}, a _ {w} ^ {i} \in \Sigma} P \left(a _ {v} ^ {i} \mid a _ {u} ^ {i}, b \left(e _ {v}\right)\right) P \left(L _ {v} ^ {i} \mid a _ {v} ^ {i}\right) P \left(a _ {w} ^ {i} \mid a _ {u} ^ {i}, b \left(e _ {w}\right)\right) P \left(L _ {w} ^ {i} \mid a _ {w} ^ {i}\right). \tag {1}
+$$
+
+The dynamic programming, or recursion, is essentially a post-order traversal of the tree and $P(L_u^i \mid a_u^i)$ is calculated at every internal node $u$ , and we use one-hot encoding of the sequences to represent the conditional probabilities at the leaves. Finally, the conditional probability for each node $u$ at site $i$ is stored in a data structure $f_u^i \in [0,1]^{|\Sigma|}$ : $f_u^i[c] = P(L_u^i | a_u^i = c)$ , and we call it the Felsenstein feature for node $u$ . Note that the conditional probability at the root $P(\mathbf{Y}^i | a_{2n-1}^i)$ is used to calculate the likelihood of the tree: $P(\mathbf{Y}^i | z, b) = \sum_{a_{2n-1}^i \in \Sigma} P(a_{2n-1}^i) P(\mathbf{Y}^i | a_{2n-1}^i)$ .
+
+# 3.1.2 PARSIMONY ANALYSIS
+
+The problem of finding the optimal tree topology under the maximum parsimony principle is commonly referred as the Large Parsimony problem, which is NP-hard. For a given tree topology $z$ , the parsimony score is the minimum number of character changes between sequences across branches obtained by optimally assigning sequences to internal nodes. Let $M(z|Y)$ be the parsimony score of tree topology $z$ with leaf labels $Y$ . Due to site independence, $M(z|Y) = \sum_{i} M(z|Y^{i})$ . The trees with the lowest parsimony score, or most parsimonious trees, are solutions to the Large Parsimony problem. Note that the Large Parsimony problem is a limiting case of the maximum likelihood tree inference problem, where branch lengths are constrained to be equal and infinitesimally short.
+
+Fitch algorithm Given a rooted tree topology $z$ , the Fitch algorithm assigns optimal sequences to internal nodes and computes the parsimony score in linear time. At each node $u$ , the algorithm tracks the set of possible characters labeling for node $u$ that can yield a most parsimonious solution for the subtree rooted at $u$ . This character set can be represented by a binary vector $\pmb{f}_u^i \in \{0,1\}^{|\Sigma|}$ for site $i$ . We label this vector the Fitch feature. As in Felsenstein's algorithm, this vector is a one-hot encoding of the sequences at the leaves and is computed recursively for non-leaves. Specifically, given a rooted tree with root $u$ and two child trees with roots $v$ and $w$ , $\pmb{f}_u^i$ is calculated as:
+
+$$
+f _ {u} ^ {i} = \left\{ \begin{array}{l l} f _ {v} ^ {i} \wedge f _ {w} ^ {i} & \text {i f} f _ {v} ^ {i} \cdot f _ {w} ^ {i} \neq 0 \\ f _ {v} ^ {i} \vee f _ {w} ^ {i} & \text {o t h e r w i s e} \end{array} \right.,
+$$
+
+where $\land$ and $\lor$ are element-wise conjunctions and disjunctions. The algorithm traverses the tree two times, first in post-order (bottom-up) to calculate the character set at each node, then in pre-order (top-down) to assign optimal sequences. The total number of character changes between these optimal sequences along the tree's edges is counted as the parsimony score.
+
+# 3.2 GFLOWNETS
+
+Generative flow networks (GFlowNets) are algorithms for learning generative models of complex distributions given by unnormalized density functions over structured spaces. Here, we give a concise summary of the the GFlowNet framework.
+
+Setting A GFlowNet treats generation of objects $x$ lying in a sample space $\mathcal{X}$ as a sequential decision-making problem on an acyclic deterministic MDP with set of states $S \supset \mathcal{X}$ and set of actions $\mathcal{A} \subseteq S \times S$ . The MDP has a designated initial state $s_0$ , which has no incoming actions, and a set of terminal states (those with no outgoing actions) that coincides with $\mathcal{X}$ . Any $x \in \mathcal{X}$ can be reached from $s_0$ by a sequence of actions $s_0 \to s_1 \to \dots \to s_n = x$ (with each $(s_i, s_{i+1}) \in \mathcal{A}$ ). Such sequences are called complete trajectories, and the set of all complete trajectories is denoted $\mathcal{T}$ .
+
+A (forward) policy $P_F$ is a collection of distributions $P_F(s' \mid s)$ over the children of each nonterminal state $s \in S \setminus \mathcal{X}$ . A policy induces a distribution over $\mathcal{T}$ :
+
+$$
+P _ {F} (\tau = (s _ {0} \rightarrow s _ {1} \rightarrow \dots \rightarrow s _ {n})) = \prod_ {i = 0} ^ {n - 1} P _ {F} (s _ {i + 1} \mid s _ {i}).
+$$
+
+A policy gives a way to sample objects in $\mathcal{X}$ , by sampling a complete trajectory $\tau \sim P_F$ and returning its final state, inducing a marginal distribution $P_F^\top$ over $\mathcal{X}$ ; $P_F^\top(x)$ is the sum of $P_F(\tau)$ over all complete trajectories $\tau$ that end in $x$ (a possibly intractable sum).
+
+The goal of GFlowNet training is to estimate a parametric policy $P_F(\cdot \mid \cdot ;\theta)$ such that the induced $P_F^\top$ is proportional to a given reward function $R:X\to \mathbb{R}_{>0}$ , i.e.,
+
+$$
+P _ {F} ^ {\top} (x) = \frac {1}{Z} R (x) \quad \forall x \in \mathcal {X}, \tag {2}
+$$
+
+where $Z = \sum_{x\in \mathcal{X}}R(x)$ is the unknown normalization constant (partition function).
+
+Trajectory balance objective The direct optimization of $P_F$ 's parameters $\theta$ is impossible since it involves an intractable sum over all complete trajectories. Instead, we leverage the trajectory balance (TB) training objective (Malkin et al., 2022), which introduces two auxiliary objects: an estimate $Z_{\theta}$ of the partition function and a backward policy. In our experiments, we fix the backward policy to uniform, which results in a simplified objective:
+
+$$
+\mathcal {L} _ {\mathrm {T B}} (\tau) = \left(\log \frac {Z _ {\theta} \prod_ {i = 0} ^ {n - 1} P _ {F} \left(s _ {i + 1} \mid s _ {i} ; \theta\right)}{R (x) P _ {B} (\tau \mid x)}\right) ^ {2}, \quad P _ {B} (\tau \mid x) := \prod_ {i = 1} ^ {n} \frac {1}{| \operatorname {P a} \left(s _ {i}\right) |}, \tag {3}
+$$
+
+where $\mathrm{Pa}(s)$ denotes the set of parents of $s$ . By the results of Malkin et al. (2022), there exists a unique policy $P_F$ and scalar $Z_{\theta}$ that simultaneously make $\mathcal{L}_{\mathrm{TB}}(\tau) = 0$ for all $\tau \in \mathcal{T}$ , and at this optimum, the policy $P_F$ satisfies (2) and $Z_{\theta}$ equals the true partition function $Z$ . In practice, the policy $P_F(\cdot \mid s; \theta)$ is parameterized as a neural network that outputs the logits of actions $s \rightarrow s'$ given a representation of the state $s$ as input, while $Z_{\theta}$ is parameterized in the log domain.
+
+$\mathcal{L}_{\mathrm{TB}}(\tau)$ is minimized by gradient descent on trajectories $\tau$ chosen from a behaviour policy that can encourage exploration to accelerate mode discovery (see our behaviour policy choices in §4.3).
+
+
+Figure 1: Left: PhyloGFN's state space on a four-sequence dataset. Initial state $s_0$ comprises leaf nodes. Successive steps merge pairs of trees until a single unrooted tree remains. Right: Policy model for PhyloGFN-Bayesian. Transformer encoder processes tree-level features $s_i = ((z_1, b_1) \dots (z_l, b_l))$ . Pairwise features $e_{ij}$ are derived and used by MLPs to select tree pairs for merging and sample branch lengths.
+
+
+
+# 4 PHYLOGENETIC INFERENCE WITH GFLOWNETS
+
+# 4.1 GFLOWNETS FOR BAYESIAN PHYLOGENETIC INFERENCE
+
+This section introduces PhyloGFN-Bayesian, our GFlowNet-based method for Bayesian phylogenetic inference. Given a set of observed sequences $\mathbf{Y}$ , PhyloGFN-Bayesian learns a sampler over the joint space of tree topologies and edge lengths $X = \{(z,b) | L(z) = Y\}$ such that the sampling probability of $(z,b) \in X$ approximates its posterior $P_F^\top(z,b) = P(z,b|Y)$ .
+
+We follow the same setup as Koptagel et al. (2022); Zhang (2023); Mimori & Hamada (2023): (i) uniform prior over tree topologies; (ii) decomposed prior $P(z, b) = P(z)P(b)$ ; (iii) exponential $(\lambda = 10)$ prior over branch lengths; (iv) Jukes-Cantor substitution model.
+
+GFlowNet state and action space The sequential procedure of constructing phylogenetic trees is illustrated in Fig. 1. The initial state $s_0$ is a set of $n$ rooted trees, each containing a single leaf node labeled with an observed sequence. Each action chooses a pair of trees and joins their roots by a common parent node, thus creating a new tree. The number of rooted trees in the set is reduced by 1 at every step, so after $n - 1$ steps a single rooted tree with $n$ leaves is left. To obtain an unrooted tree, we simply remove the root node.
+
+Thus, a state $s$ consists of a set of disjoint rooted trees $s = ((z_1,b_1),\ldots ,(z_l,b_l))$ , $l\leq n$ and $\bigcup_{i}L(z_{i}) = Y$ . Given a nonterminal state with $l > 1$ trees, a transition action consists of two steps: (i) choosing a pair of trees to join out of the $\binom{l}{2}$ possible pairs; and (ii) generating branch lengths for the two introduced edges between the new root and its two children. The distribution over the pair of branch lengths is modeled jointly as a discrete distribution with fixed bin size. Following the initial submission of the paper, we conducted additional experiments by employing continuous distribution to model branch lengths. Further details can be found in §F of the appendix.
+
+Reward function We define the reward function as the product of the likelihood and the edge length prior: $R(z,b) = P(\mathbf{Y}|z,b)P(b)$ , implicitly imposing a uniform prior over tree topologies. By training with this reward, PhyloGFN learns to approximate the posterior, since $P(z,b|\mathbf{Y}) = R(z,b)\frac{P(z)}{P(\mathbf{Y})}$ and $P(z), P(\mathbf{Y})$ are both constant.
+
+It is worth emphasizing that in our bottom-up construction of trees, the set of possible actions at the steps that select two trees to join by a new common root is never larger than $n^2$ , even though the size of the space of all tree topologies – all of which can be reached by our sampler – is superexponential in $n$ . This stands in contrast to the modeling choices of VBPI-GNN (Zhang, 2023), which constructs trees in a top-down fashion and limits the action space using a pre-generated set of trees, therefore also limiting the set of trees it can sample.
+
+State representation To represent a rooted tree in a non-terminal state, we compute features for each site independently by taking advantage of the Felsenstein features (§3.1.1). Let $(z,b)$ be a weighted tree with root $u$ which has two children $\nu$ and $w$ . Let $f_u^i, f_\nu^i, f_w^i \in [0,1]^{|\Sigma|}$ be the Felsen-
+
+stein feature on nodes $u, v, w$ at site $i$ . The representation $\rho_u^i$ for site $i$ is computed as following:
+
+$$
+\rho_ {u} ^ {i} = f _ {u} ^ {i} \prod_ {e \in E (z)} P \left(b _ {z} (e)\right) ^ {\frac {1}{m}} \tag {4}
+$$
+
+where $P(b_{z}(e)) = \prod_{e\in b_{z}}P(b(e))$ is the edge length prior. The tree-level feature is the concatenation of site-level features $\rho = [\rho^{1}\ldots \rho^{m}]$ . A state $s = (z_{1}\dots z_{l})$ , which is a collection of rooted trees, is represented by the set $\{\rho_1,\ldots ,\rho_l\}$ .
+
+Representation power Although the proposed feature representation $\rho$ does not capture all the information of tree structure and leaf sequences, we show that $\rho$ indeed contains sufficient information to express the optimal policy. The proposition below shows that given an optimal GFlowNet with uniform $P_B$ , two states with identical features set share the same transition probabilities.
+
+Proposition 1. Let $s_1 = \{(z_1, b_1), (z_2, b_2) \ldots (z_l, b_l)\}$ and $s_2 = \{(z_1', b_1'), (z_2', b_2') \ldots (z_l', b_l')\}$ be two non-terminal states such that $s_1 \neq s_2$ but sharing the same features $\rho_i = \rho_l'$ . Let $\mathbf{a}$ be any sequence of actions, which applied to $s_1$ and $s_2$ , respectively, results in full weighted trees $x = (z, b_z), x' = (z', b')$ , with two partial trajectories $\tau = (s_1 \to \dots \to x)$ , $\tau' = (s_2 \to \dots \to x')$ . If $P_F$ is the policy of an optimal GFlowNet with uniform $P_B$ , then $P_F(\tau) = P_F(\tau')$ .
+
+All proofs are in Appendix A. The proposition shows that our proposed features have sufficient representation power for the PhyloGFN-Bayesian policy. Furthermore, Felsenstein features and edge length priors are used in calculating reward by Felsenstein's algorithm. Therefore, computing these features does not introduce any additional variables, and computation overhead is minimized.
+
+# 4.2 GFLOWNETS FOR PARSIMONY ANALYSIS
+
+This section introduces PhyloGFN-Parsimony, our GFlowNet-based method for parsimony analysis. We treat large parsimony analysis, a discrete optimization problem, as a sampling problem from the energy distribution $\exp\left(\frac{-M(z|Y)}{T}\right)$ defined over tree topologies. Here, $M(z|Y)$ is the parsimony score of $z$ and $T$ is a pre-defined temperature term to control the smoothness of distribution. With sufficiently small $T$ , the most parsimonious trees dominate the energy distribution. To state our goals formally, given observed sequences $Y$ , PhyloGFN-Parsimony learns a sampling policy $P_F$ over the space of tree topologies $\{z|L(z) = Y\}$ such that $P_F^\top(z) \propto e^{-\frac{M(z|Y)}{T}}$ . As $T \to 0$ , this target distribution approaches a uniform distribution over the set of tree topologies with minimum parsimony scores.
+
+PhyloGFN-Parsimony can be seen as a reduced version of PhyloGFN-Bayesian. The tree shape generation procedure is the same as before, but we no longer generate branch lengths. The reward is defined as $R(z) = \exp \left(\frac{C - M(z|Y)}{T}\right)$ , where $C$ is an extra hyperparameter introduced for stability to offset the typically large $M(z|Y)$ values. Note that $C$ can be absorbed into the partition function and has no influence on the reward distribution.
+
+Similar to PhyloGFN-Bayesian, a state (collection of rooted trees) is represented by the set of tree features, with each tree represented by concatenating its site-level features. With $z$ the rooted tree topology with root $u$ , we represent the tree at site $i$ by its root level Fitch feature $f_u^i$ defined in §3.1.2. The proposition below, analogous to Proposition 1, shows the representation power of the proposed feature.
+
+Proposition 2. Let $s_1 = \{z_1, z_2, \ldots, z_l\}$ and $s_2 = \{z_1', z_2', \ldots, z_l'\}$ be two non-terminal states such that $s_1 \neq s_2$ but sharing the same Fitch features $f_{zi} = f_{z_i'} \forall i$ . Let $\pmb{a}$ be any sequence of actions, which, applied to $s_1$ and $s_2$ , respectively, results in tree topologies $x, x' \in \mathcal{Z}$ , with two partial trajectories $\tau = (s_1 \to \dots \to x)$ , $\tau' = (s_2 \to \dots \to x')$ . If $P_F$ is the policy of an optimal GFlowNet with uniform $P_B$ , then $P_F(\tau) = P_F(\tau')$
+
+This shows that the Fitch features contain sufficient information for PhyloGFN-Parsimony. Furthermore, the Fitch features are used in the computation of the reward by Fitch's algorithm, so their use in the policy model does not introduce additional variables or extra computation.
+
+Temperature-conditioned PhyloGFN The temperature $T$ controls the trade-off between sample diversity and parsimony scores. Following Zhang et al. (2023a), we extend PhyloGFN-Parsimony by conditioning the policy on $T$ , with reward $R(z; T) = \exp \left(\frac{C - M(z|\mathbf{Y})}{T}\right)$ , and we learn a sampler such that $P^{\top}(z; T) \propto R(z; T)$ . See Appendix E for more details.
+
+Table 1: Marginal log-likelihood estimation with different methods on real datasets DS1-DS8. PhyloGFN outperforms $\phi$ -CSMC across all datasets and GeoPhy on most. *VBPI-GNN uses predefined tree topologies in training and is not directly comparable.
+
+
Dataset
MCMC
ML-based / amortized, full tree space
MrBayes SS
VBPI-GNN*
φ-CSMC
GeoPhy
PhyloGFN
DS1
-7108.42 ±0.18
-7108.41 ±0.14
-7290.36 ±7.23
-7111.55 ±0.07
-7108.95 ±0.06
DS2
-26367.57 ±0.48
-26367.73 ±0.07
-30568.49 ±31.34
-26368.44 ±0.13
-26368.90 ±0.28
DS3
-33735.44 ±0.5
-33735.12 ±0.09
-33798.06 ±6.62
-33735.85 ±0.12
-33735.6 ±0.35
DS4
-13330.06 ±0.54
-13329.94 ±0.19
-13582.24 ±35.08
-13337.42 ±1.32
-13331.83 ±0.19
DS5
-8214.51 ±0.28
-8214.64 ±0.38
-8367.51 ±8.87
-8233.89 ±6.63
-8215.15 ±0.2
DS6
-6724.07 ±0.86
-6724.37 ±0.4
-7013.83 ±16.99
-6733.91 ±0.57
-6730.68 ±0.54
DS7
-37332.76 ±2.42
-37332.04 ±0.12
-37350.77 ±11.74
-37359.96 ±1.14
DS8
-8649.88 ±1.75
-8650.65 ±0.45
-9209.18 ±18.03
-8660.48 ±0.78
-8654.76 ±0.19
+
+# 4.3 MODEL ARCHITECTURE AND TRAINING
+
+Parameterization of forward transitions We parameterize the forward transitions of tree topology construction using a Transformer-based neural network, whose architecture is shown in Fig. 1. We select Transformer because the input is a set and the model needs to be order-equivariant. For a state consisting of $n$ trees, after $n$ embeddings are generated from the Transformer encoder, $\binom{n}{2}$ pairwise features are created for all possible pairs of trees, and a common MLP generates probability logits for joining every tree pair. PhyloGFN-Bayesian additionally requires generating edge lengths. Once the pair of trees to join is selected, another MLP is applied to the corresponding pair feature to generate probability logits for sampling the edge lengths. See more details in D.
+
+Off-policy training The action model $P_F(\cdot \mid s; \theta)$ is trained with the trajectory balance objective. Training data are generated from two sources: (i) A set of trajectories constructed from the currently trained GFlowNet, with actions sampled from the policy with probability $1 - \epsilon$ and uniformly at random with probability $\epsilon$ . The $\epsilon$ rate drops from a pre-defined $\epsilon_{start}$ to near 0 during the course of training. (ii) Trajectories corresponding to the best trees seen to date (replay buffer). Trajectories are sampled backward from these high-reward trees with uniform backward policy.
+
+Temperature annealing For PhyloGFN-Parsimony, it is crucial to choose the appropriate temperature $T$ . Large $T$ defines a flat target distribution, while small $T$ makes the reward landscape less smooth and leads to training difficulties. We cannot predetermine the ideal choice of $T$ before training, as we do not know a priori the parsimony score for the dataset. Therefore, we initialize the training with large $T$ and reduce $T$ periodically during training. See Appendix E for details.
+
+# 4.4 MARGINAL LOG-LIKELIHOOD ESTIMATION
+
+To assess how well the GFlowNet sampler approximates the true posterior distribution, we use the following importance-weighted variational lower bound on the marginal log-likelihood (MLL):
+
+$$
+\log P (\mathbf {Y}) \geq \mathbb {E} _ {\tau_ {1}, \dots , \tau_ {k} \sim P _ {F}} \log \left( \right.P (z) \frac {1}{K} \sum_ {\substack {\tau_ {i}\\\tau_ {i}: s _ {0} \rightarrow \dots \rightarrow (z _ {i}, b _ {i})}} ^ {k} \frac {P _ {B} (\tau_ {i} | z _ {i} , b _ {i}) R (z _ {i} , b _ {i})}{P _ {F} (\tau_ {i})}\right). \tag{5}
+$$
+
+Our estimator is computed by sampling a batch of $K$ trajectories and averaging $\frac{P(z)P_B(\tau|z,b)R(z,b)}{P_F(\tau)}$ over the batch. This expectation of this estimate is guaranteed to be a lower bound on $\log P(\mathbf{Y})$ and its bias decreases as $K$ grows (Burda et al., 2016).
+
+PhyloGN-Bayesian models branch lengths with discrete multinomial distributions, while in reality these are continuous variables. To properly estimate the MLL and compare with other methods defined over continuous space, we augment our model to a continuous sampler by performing random perturbations over edges of trees sampled from PhyloGN-Bayesian. The perturbation follows the uniform distribution $\mathcal{U}_{[-0.5\omega ,0.5\omega ]}$ , where $\omega$ is the fixed bin size for edge modeling in PhyloGN-Bayesian. The resulting model over branch lengths is then a piecewise-constant continuous distribution. We discuss the computation details as well as the derivation of (5) in Appendix B.
+
+# 5 EXPERIMENTS
+
+We evaluate PhyloGFN on a suite of 8 real-world benchmark datasets (Table S1 in Appendix C) that is standard in the literature. These datasets feature pre-aligned sequences and vary in difficulty (27
+
+to 64 sequences; 378 to 2520 sites). In the following sections we present our results and analysis on Bayesian and parsimony-based phylogenetic inference.
+
+# 5.1 BAYESIAN PHYLOGENETIC INFERENCE
+
+PhyloGFN is compared with a variety of baselines in terms of sampling-based estimates of marginal log-likelihood (MLL; see details in §4.4). The baselines we compare to are MrBayes SS, Stepping-Stone sampling algorithm implemented in MrBayes (Ronquist et al., 2012), and three variational inference methods: VBPI-GNN (Zhang, 2023), $\phi$ -CSMC proposed in VaiPhy (Koptagel et al., 2022), and GeoPhy (Mimori & Hamada, 2023). The sampling setup for MrBayes follows Zhang & Matsen IV (2018b) and otherwise show the highest MLL reported in the respective papers. PhyloGFN MLL is estimated following the formulation in §4.4, with mean and standard deviation obtained from 10 repetitions, each using 1000 samples. See Sections E and G for additional training details, hardware specifications, and running time comparison. Additional results from two repeated experiments are in Table S5.
+
+The results are summarized in Table S4. Our PhyloGFN is markedly superior to $\phi$ -CSMC across all datasets and outperforms GeoPhy on most, with the exception of DS2 and DS3 where the two perform similarly, and DS7 where GeoPhy obtains a better result. VBPI-GNN, is the only machine learning-based method that performs on par against MrBayes, the current gold standard in Bayesian phylogenetic
+
+
+Figure 2: Model sampling log-density vs. unnormalized posterior log-density for high/medium/low-probability trees on DS1. We highlight that PhyloGFN-Bayesian performs significantly better on medium- and low-probability trees, highlighting its superiority in modeling the entire data space.
+
+Inference. However, it should be emphasized that VBPI-GNN requires a set of pre-defined tree topologies that are likely to achieve high likelihood, and as a consequence, its training and inference are both constrained to a small space of tree topologies. On the other hand, PhyloGFN operates on the full space of tree topologies and, in fact, achieves a closer fit to the true posterior distribution. To show this, for each dataset, we created three sets of phylogenetic trees with high/medium/low posterior probabilities and obtained the corresponding sampling probabilities from PhyloGFN and VBPI-GNN. The three classes of trees are generated from VBPI-GNN by randomly inserting uniformly sampled actions into its sequential tree topology construction process with $0\%$ , $30\%$ , or $50\%$ probability, respectively, which circumvents VBPI-GNN's limitation of being confined to a small tree topology space. Table 2 and Fig. 2 show that PhyloGFN achieves higher Pearson correlation between the sampling log-probability and the unnormalized ground truth posterior log-density for the majority of datasets and classes of trees. In particular, while VBPI-GNN performs better on high-probability trees, its correlation drops significantly on lower-probability trees. On the other hand, PhyloGFN maintains a high correlation for all three classes of trees across all datasets, the only exception being the high-probability trees in DS7. See Appendix K for details and extended results and Appendix I for a short explanation of the significance of modeling suboptimal trees.
+
+Continuous branch length modeling Following the initial submission, additional experiments involving continuous branch length modeling demonstrate PhyloGFN's ability to achieve state-of-the-art Bayesian inference performance. For more details, please see Appendix F.
+
+# 5.2 PARSIMONY-BASED PHYLOGENETIC INFERENCE
+
+As a special case of Bayesian phylogenetic inference, the parsimony problem is concerned with finding the most-parsimonious trees – a task which is also amenable to PhyloGFN. Here, we compare to the state-of-the-art parsimony analysis software PAUP* (Swofford, 1998). For all datasets, our PhyloGFN and PAUP* are able to identify the same set of optimal solutions to the Large Parsimony problem, ranging from a single optimal tree for DS1 to 21 optimal trees for DS8.
+
+Although the results are similar between PhyloGFN and PAUP*, once again we emphasize that PhyloGFN is based on a rigorous mathematical framework of fitting and sampling from well-defined
+
+Table 2: Pearson correlation of model sampling log-density and ground truth unnormalized posterior log-density for each dataset on high/medium/low posterior density trees generated by VBPI-GNN. PhyloGFN achieves a good fit on both high and low posterior density regions.
+
+
Dataset
No random
30% random
50% random
PhyloGFN
VBPI-GNN
PhyloGFN
VBPI-GNN
PhyloGFN
VBPI-GNN
DS1
0.994
0.955
0.961
0.589
0.955
0.512
DS2
0.930
0.952
0.948
0.580
0.919
0.538
DS3
0.917
0.968
0.963
0.543
0.950
0.499
DS4
0.942
0.960
0.945
0.770
0.966
0.76
DS5
0.969
0.965
0.937
0.786
0.939
0.773
DS6
0.993
0.887
0.973
0.816
0.934
0.702
DS7
0.624
0.955
0.787
0.682
0.764
0.678
DS8
0.978
0.955
0.913
0.604
0.901
0.463
+
+posterior distributions over tree topologies, whereas PAUP* relies on heuristic algorithms. To put it more concretely, we show in Fig. S2 that PhyloGFN is able to (i) learn a smooth echelon of sampling probabilities that distinguish the optimal trees from suboptimal ones; (ii) learn similar sampling probabilities for trees within each group of equally-parsimonious trees; and (iii) fit all $2n - 3$ rooted trees that belong to the same unrooted tree equally well.
+
+Finally, Fig. 3 shows that a single temperature-conditioned PhyloGFN can sample phylogenetic trees of varying ranges of parsimony scores by providing suitable temperatures $T$ as input to the model. Also, PhyloGFN is able to sample proportionately from the Boltzmann distribution defined at different temperatures and achieves high correlation between sampling log-probability and log-reward. Although the temperature-conditioned PhyloGFN has only been trained on a small range of temperatures between 4.0 and 1.0, Fig. 3 shows it can also approximate the distribution defined at temperature 8.0. Further results are presented in Appendix L.
+
+# 6 DISCUSSION AND FUTURE WORK
+
+In this paper, we propose PhyloGFN, a GFlowNet-based generative modeling algorithm, to solve parsimony-based and Bayesian phylogenetic inference. We design an intuitive yet effective tree construction procedure to efficiently model the entire tree topology space. We propose a novel tree representation based on Fitch's and Felsenstein's algorithms to represent rooted trees without introducing additional learnable parameters, and we show the sufficiency of our features for the purpose of phylogenetic tree generation. We apply our algorithm on eight real datasets, demonstrating that PhyloGFN is competitive with or superior to prior works in terms of marginal likelihood estimation, while achieving a closer fit to the target distribution compared to state-of-the-art variational inference methods. While our initial experiments with continuous branch length sampling have demonstrated notable performance enhancements, there remains a need for future research to address
+
+training efficiency. In addition, we plan to explore the use of conditional GFlowNets to amortize the dependence on the sequence dataset itself. This would allow a single trained GFlowNet to sample phylogenetic trees for sets of sequences that were not seen during training.
+
+
+
+
+
+
+Figure 3: A temperature-conditioned PhyloGFN is trained on DS1 using temperatures sampled between 4.0 and 1.0. (A) Parsimony score distribution with varying statistical temperature input (8.0 to 1.0) to PhyloGFN policy (10,000 trees sampled per temperature). (B) PhyloGFN achieves high Pearson correlation at each temperature.
+
+# REPRODUCIBILITY
+
+Code and data are available https://github.com/zmy1116/phylogfn. See Appendix J for a detailed description.
+
+# ACKNOWLEDGMENTS
+
+We thank Oskar Kviman and Jens Lagergren for the insightful discussions on GFlowNet and phylogenetic inference. We thank Tianyu Xie and Cheng Zhang for discussions on continuous branch lengths modeling. We acknowledge the support of Mingyang Zhou by the NSERC Discovery grant awarded to Mathieu Blanchette, and the funding from CIFAR, NSERC, IBM, Intel, Genentech and Samsung to Yoshua Bengio. Finally, we thank the Digital Alliance of Canada for providing the computational resources.
+
+# REFERENCES
+
+Rustam I Aminov and Roderick I Mackie. Evolution and ecology of antibiotic resistance genes. FEMS microbiology letters, 271(2):147-161, 2007.
+Emmanuel Bengio, Moksh Jain, Maksym Korablyov, Doina Precup, and Yoshua Bengio. Flow network based generative models for non-iterative diverse candidate generation. Neural Information Processing Systems (NeurIPS), 2021.
+Yoshua Bengio, Salem Lahlou, Tristan Deleu, Edward J Hu, Mo Tiwari, and Emmanuel Bengio. GFlowNet foundations. Journal of Machine Learning Research, (24):1-76, 2023.
+Mathieu Blanchette, W James Kent, Cathy Riemer, Laura Elnitski, Arian FA Smit, Krishna M Roskin, Robert Baertsch, Kate Rosenbloom, Hiram Clawson, Eric D Green, et al. Aligning multiple genomic sequences with the threaded blockset aligner. Genome research, 14(4):708-715, 2004.
+Patricia Buendia, Brice Cadwallader, and Victor DeGruttola. A phylogenetic and Markov model approach for the reconstruction of mutational pathways of drug resistance. Bioinformatics, 25 (19):2522-2529, 08 2009.
+Yuri Burda, Roger Baker Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. International Conference on Learning Representations (ICLR), 2016.
+Gershon Celniker, Guy Nimrod, Haim Ashkenazy, Fabian Glaser, Eric Martz, Itay Mayrose, Tal Pupko, and Nir Ben-Tal. Consurf: using evolutionary data to raise testable hypotheses about protein function. *Israel Journal of Chemistry*, 53(3-4):199–206, 2013.
+Benny Chor and Tamir Tuller. Maximum likelihood of evolutionary trees is hard. In Annual International Conference on Research in Computational Molecular Biology, pp. 296-310. Springer, 2005.
+William HE Day. Computational complexity of inferring phylogenies from dissimilarity matrices. Bulletin of mathematical biology, 49(4):461-467, 1987.
+Tristan Deleu, Antonio Góis, Chris Emezue, Mansi Rankawat, Simon Lacoste-Julien, Stefan Bauer, and Yoshua Bengio. Bayesian structure learning with generative flow networks. Uncertainty in Artificial Intelligence (UAI), 2022.
+Tristan Deleu, Mizu Nishikawa-Toomey, Jithendaraa Subramanian, Nikolay Malkin, Laurent Charlin, and Yoshua Bengio. Joint Bayesian inference of graphical structure and parameters with a single generative flow network. arXiv preprint arXiv:2305.19366, 2023.
+Erika Dort, Elliot Layne, Nicolas Feau, Alexander Butyaev, Bernard Henrissat, Francis Martin, Sajeet Haridas, Asaf Salamov, Igor Grigoriev, Mathieu Blanchette, and Hamelin Richard. Large-scale genomic analyses with machine learning uncover predictive patterns associated with fungal phytopathogenic lifestyles and traits. Scientific Reports, 13(1), 2023.
+Alexei J Drummond, Simon Y. W Ho, Matthew J Phillips, and Andrew Rambaut. Relaxed phylogenetics and dating with confidence. PLOS Biology, 4(5):null, 03 2006. doi: 10.1371/journal.pbio.0040088.
+
+Joseph Felsenstein. Maximum likelihood and minimum-steps methods for estimating evolutionary trees from data on discrete characters. Systematic Biology, 22(3):240-249, 1973.
+R. Fisher, L. Pusztai, and C. Swanton. Cancer heterogeneity: implications for targeted therapeutics. British Journal of Cancer, 108(3):479-485, Feb 2013.
+J R Garey, T J Near, M R Nonnemacher, and S A Nadler. Molecular evidence for acanthocephala as a subtaxon of rotifera. J Mol Evol, 43(3):287-292, September 1996.
+Richard C Hamelin, Guillaume J Bilodeau, Renate Heinzelmann, Kelly Hrywkiw, Arnaud Capron, Erika Dort, Angela L Dale, Emilie Giroux, Stacey Kus, Nick C Carleson, et al. Genomic bio-surveillance detects a sexual hybrid in the sudden oak death pathogen. Communications Biology, 5(1):477, 2022.
+S B Hedges, K D Moberg, and L R Maxson. Tetrapod phylogeny inferred from 18S and 28S ribosomal RNA sequences and a review of the evidence for amniote relationships. Molecular Biology and Evolution, 7(6):607-633, 11 1990.
+Daniel A Henk, Alex Weir, and Meredith Blackwell. Laboulbeniopsis termitarius, an ectoparasite of termites newly recognized as a member of the laboulbeniomycetes. *Mycologia*, 95(4):561-564, July 2003.
+Diep Thi Hoang, Olga Chernomor, Arndt Von Haeseler, Bui Quang Minh, and Le Sy Vinh. Ufboot2: improving the ultrafast bootstrap approximation. Molecular biology and evolution, 35(2):518-522, 2018.
+Edward J Hu, Nikolay Malkin, Moksh Jain, Katie Everett, Alexandros Graikos, and Yoshua Bengio. GFlowNet-EM for learning compositional latent variable models. International Conference on Machine Learning (ICML), 2023.
+Sebastian Höhna, Michael J. Landis, Tracy A. Heath, Bastien Boussau, Nicolas Lartillot, Brian R. Moore, John P. Huelsenbeck, and Fredrik Ronquist. RevBayes: Bayesian Phylogenetic Inference Using Graphical Models and an Interactive Model-Specification Language. Systematic Biology, 65(4):726-736, 05 2016. ISSN 1063-5157. doi: 10.1093/sysbio/syw021. URL https://doi.org/10.1093/sysbio/syw021.
+Moksh Jain, Emmanuel Bengio, Alex Hernandez-Garcia, Jarrid Rector-Brooks, Bonaventure F.P. Dossou, Chanakya Ekbote, Jie Fu, Tianyu Zhang, Micheal Kilgour, Dinghuai Zhang, Lena Simine, Payel Das, and Yoshua Bengio. Biological sequence design with GFlowNets. International Conference on Machine Learning (ICML), 2022.
+Hazal Koptagel, Oskar Kviman, Harald Melin, Negar Safinianaini, and Jens Lagergren. VaiPhy: a variational inference based algorithm for phylogeny. Neural Information Processing Systems (NeurIPS), 2022.
+Salem Lahlou, Tristan Deleu, Pablo Lemos, Dinghuai Zhang, Alexandra Volokhova, Alex Hernández-García, Léna Néhale Ezzine, Yoshua Bengio, and Nikolay Malkin. A theory of continuous generative flow networks. International Conference on Machine Learning (ICML), 2023.
+Clemens Lakner, Paul Van Der Mark, John P Huelsenbeck, Bret Larget, and Fredrik Ronquist. Efficiency of Markov chain Monte Carlo tree proposals in Bayesian phylogenetics. Systematic biology, 57(1):86-103, 2008.
+Elliot Layne, Erika N Dort, Richard Hamelin, Yue Li, and Mathieu Blanchette. Supervised learning on phylogenetically distributed data. Bioinformatics, 36(Supplement_2):i895-i902, 2020.
+Jian Ma, Louxin Zhang, Bernard B Suh, Brian J Raney, Richard C Burhans, W James Kent, Mathieu Blanchette, David Haussler, and Webb Miller. Reconstructing contiguous regions of an ancestral genome. Genome research, 16(12):1557-1565, 2006.
+Nikolay Malkin, Moksh Jain, Emmanuel Bengio, Chen Sun, and Yoshua Bengio. Trajectory balance: Improved credit assignment in GFlowNets. Neural Information Processing Systems (NeurIPS), 2022.
+
+Nikolay Malkin, Salem Lahlou, Tristan Deleu, Xu Ji, Edward Hu, Katie Everett, Dinghuai Zhang, and Yoshua Bengio. GFlowNets and variational inference. International Conference on Learning Representations (ICLR), 2023.
+Nicholas McGranahan, Francesco Favero, Elza C. de Bruin, Nicolai Juul Birkbak, Zoltan Szallasi, and Charles Swanton. Clonal status of actionable driver events and the timing of mutational processes in cancer evolution. Science Translational Medicine, 7(283):283ra54-283ra54, 2015.
+Takahiro Mimori and Michiaki Hamada. Geophy: Differentiable phylogenetic inference via geometric gradients of tree topologies. arXiv preprint arXiv:2307.03675, 2023.
+Bui Quang Minh, Minh Anh Thi Nguyen, and Arndt Von Haeseler. Ultrafast approximation for phylogenetic bootstrap. Molecular biology and evolution, 30(5):1188-1195, 2013.
+Bui Quang Minh, Heiko A Schmidt, Olga Chernomor, Dominik Schrempf, Michael D Woodhams, Arndt Von Haeseler, and Robert Lanfear. Iq-tree 2: new models and efficient methods for phylogenetic inference in the genomic era. Molecular biology and evolution, 37(5):1530-1534, 2020.
+Antonio Khalil Moretti, Liyi Zhang, Christian A. Naesseth, Hadiah Venner, David Blei, and Itsk Pe'er. Variational combinatorial sequential Monte Carlo methods for Bayesian phylogenetic inference. Uncertainty in Artificial Intelligence (UAI), 2021.
+Reza Ranjbar, Sedigheh Nazari, and Omid Farahani. Phylogenetic analysis and antimicrobial resistance profiles of escherichia coli strains isolated from uti-suspected patients. *Iranian Journal of Public Health*, 49(9):1743, 2020.
+Fredrik Ronquist, Maxim Teslenko, Paul Van Der Mark, Daniel L Ayres, Aaron Darling, Sebastian Höhma, Bret Larget, Liang Liu, Marc A Suchard, and John P Huelsenbeck. MrBayes 3.2: efficient Bayesian phylogenetic inference and model choice across a large model space. Systematic biology, 61(3):539-542, 2012.
+Amy Y. Rossman, John M. McKemy, Rebecca A. Pardo-Schultheiss, and Hans-Josef Schroers. Molecular studies of the bionectriaceae using large subunit rDNA sequences. *Mycologia*, 93(1): 100-110, 2001.
+David L Swofford. Phylogenetic analysis using parsimony. 1998.
+Hakon Tjelmeland and Bjorn Kare Hegstad. Mode jumping proposals in mcmc. Scandinavian journal of statistics, 28(1):205-223, 2001.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Neural Information Processing Systems (NIPS), 2017.
+Ziheng Yang and Anne D. Yoder. Comparison of Likelihood and Bayesian Methods for Estimating Divergence Times Using Multiple Gene Loci and Calibration Points, with Application to a Radiation of Sweet-Looking Mouse Lemur Species. Systematic Biology, 52(5):705-716, 10 2003.
+Anne D. Yoder and Ziheng Yang. Divergence dates for malagasy lemurs estimated from multiple gene loci: geological and evolutionary context. Molecular Ecology, 13(4):757-773, 2004.
+Cheng Zhang. Learnable topological features for phylogenetic inference via graph neural networks. arXiv preprint arXiv:2302.08840, 2023.
+Cheng Zhang and Frederick A Matsen IV. Generalizing tree probability estimation via bayesian networks. Neural Information Processing Systems (NIPS), 2018a.
+Cheng Zhang and Frederick A Matsen IV. Variational bayesian phylogenetic inference. International Conference on Learning Representations (ICLR), 2018b.
+David Zhang, Corrado Rainone, Markus Peschl, and Roberto Bondesan. Robust scheduling with GFlowNets. International Conference on Learning Representations (ICLR), 2023a.
+
+Dinghuai Zhang, Nikolay Malkin, Zhen Liu, Alexandra Volokhova, Aaron Courville, and Yoshua Bengio. Generative flow networks for discrete probabilistic modeling. International Conference on Machine Learning (ICML), 2022.
+Dinghuai Zhang, Hanjun Dai, Nikolay Malkin, Aaron Courville, Yoshua Bengio, and Ling Pan. Let the flows tell: Solving graph combinatorial problems with GFlowNets. arXiv preprint arXiv:2305.17010, 2023b.
+Ning Zhang and Meredith Blackwell. Molecular phylogeny of dogwood anthracnose fungus (discula destructiva) and the diaporthales. Mycologia, 93(2):355-365, 2001.
+
+# A PROOFS OF PROPOSITIONS 1 AND 2
+
+Before proving proposition 1, we first prove the following two lemmas. First, we show that for two states sharing the same tree features, applying the same action to the states results in two new states still sharing the same features.
+
+Lemma 1. Let $s_1 = \{(z_1, b_1), (z_2, b_2) \ldots (z_l, b_l)\}$ and $s_2 = \{(z_1', b_1'), (z_2', b_2') \ldots (z_l', b'_l)\}$ be two non-terminating states sharing the same features $\rho_i = \rho_i'$ . Let $a$ be the action that joins the trees with indices $(v, w)$ to form a new tree indexed $u$ with edge lengths $(b(e_{uv}), b(e_{uw}))$ . By applying $a$ on $s_1$ , we join $(z_v, b_v)$ and $(z_w, b_w)$ to form new tree $(z_u, b_u)$ . By applying $a$ on $s_2$ , we join $(z_v', b_v')$ and $(z_w', b_w')$ to form new tree $(z_u', b_u')$ . Then the new trees' features are equal: $\rho_u = \rho_u'$ .
+
+Proof. We show that $\rho_{u}$ can be calculated from $\rho_{v}$ and $\rho_w$ :
+
+$$
+\begin{array}{l} \rho_ {u} ^ {i} [ j ] = P (b (e _ {u v})) ^ {\frac {1}{m}} \times P (b (e _ {u w})) ^ {\frac {1}{m}} \times \sum_ {k \in \Sigma} P (a _ {u} ^ {i} = j | a _ {v} ^ {i} = k, b _ {z} (e _ {u v})) \rho_ {v} ^ {i} [ k ] \\ \times \sum_ {k} P \left(a _ {u} ^ {i} = j \mid a _ {w} ^ {i} = k, b \left(e _ {u w}\right)\right) \rho_ {w} ^ {i} [ k ] \\ \end{array}
+$$
+
+since $\rho_v = \rho_v'$ , $\rho_w = \rho_w'$ and $(b(e_{uv}), b(e_{uw}))$ are new branch lengths for both two trees. Therefore $\rho_u = \rho_u'$
+
+Next, we show that for two states sharing the same tree features, applying the same action sequences results in two phylogenetic trees with the same reward.
+
+Lemma 2. Let $s_1 = \{(z_1, b_1), (z_2, b_2) \ldots (z_l, b_l)\}$ and $s_2 = \{(z_1', b_1'), (z_2', b_2') \ldots (z_l', b_l')\}$ be two non-terminating states sharing the same features $\rho_i = \rho_i'$ . Let $\mathbf{a}$ be any sequence of actions to apply on $s_1$ and $s_2$ to form full trees $x = (z, b_z), x' = (z', b_z')$ , $R(z, b) = R(z', b')$ .
+
+Proof. Let $\rho_u$ denote the tree feature for $(z, b)$ , $\rho_u^i = f_u^i \prod_e P(b(e))$ . We first show that the reward can be directly calculated from the root feature $\rho_u$ :
+
+$$
+\begin{array}{l} \prod_ {i} P (a _ {2 n - 1}) \cdot \rho_ {u} = \prod_ {e} P (b (e)) \prod_ {i} P (a _ {2 n - 1}) \cdot f _ {u} ^ {i} \\ = P (b) P (\mathbf {Y} | z, b) \\ = R (z, b), \\ \end{array}
+$$
+
+where $P(a_{2n-1})$ is the constant root character assignment probability. As $\pmb{a}$ is applied to $s_1$ and $s_2$ in a sequential manner, at every step we obtain two state swith the same tree features (by Lemma 1), until, at the final state, $\rho_u = \rho_u'$ . It follows that $R(z, b) = R(z', b')$ .
+
+We are now ready to prove the propositions.
+
+Proposition 1. Let $s_1 = \{(z_1, b_1), (z_2, b_2) \dots (z_l, b_l)\}$ and $s_2 = \{(z_1', b_1'), (z_2', b_2') \dots (z_l', b_l')\}$ be two non-terminal states such that $s_1 \neq s_2$ but sharing the same features $\rho_i = \rho_l'$ . Let $\mathbf{a}$ be any sequence of actions, which applied to $s_1$ and $s_2$ , respectively, results in full weighted trees $x = (z, b_z), x' = (z', b')$ , with two partial trajectories $\tau = (s_1 \to \dots \to x), \tau' = (s_2 \to \dots \to x')$ . If $P_F$ is the policy of an optimal GFlowNet with uniform $P_B$ , then $P_F(\tau) = P_F(\tau')$ .
+
+Proof of Proposition 1. Let $\mathcal{G}_{s_1},\mathcal{G}_{s_2}$ be sub-graphs of the GFlowNet state graph $\mathcal{G} = (\mathcal{S},\mathcal{A})$ defined by reachable states from $s_1$ and $s_2$ in $\mathcal{G}$ . Since $s_1$ and $s_2$ have the same number of trees, $\mathcal{G}_{s_1}$ and $\mathcal{G}_{s_2}$ have the graph structure. Let $X_{1},X_{2}\subseteq X$ be the terminal states reachable from $s_1$ and $s_2$ . There is thus a bijective correspondence between $X_{1}$ and $X_{2}$ : for every action set $\pmb{a}$ applying on $s_1$ to obtain $x\in X_{1}$ , we obtain $x^{\prime}\in X_{2}$ by applying $\pmb{a}$ on $s_2$ . Let $\tau$ and $\tau^\prime$ be the partial trajectories created by applying $\pmb{a}$ on $s_1$ and $s_2$ , $P_B(\tau |x) = P_B(\tau '|x')$ . Moreover, $R(x) = R(x')$ since $s_1$ and $s_2$ share the same set of features. We have the following expressions for $P_F(\tau)$ and $P_F(\tau ')$ :
+
+$$
+P _ {F} (\tau) = \frac {R (x) P _ {B} (\tau | x)}{\sum_ {\tau_ {j} , x _ {j}} R (x _ {j}) P _ {B} (\tau_ {j} | x _ {j})}, \quad P _ {F} (\tau^ {\prime}) = \frac {R (x ^ {\prime}) P _ {B} (\tau^ {\prime} | x ^ {\prime})}{\sum_ {\tau_ {j} ^ {\prime} , x _ {j} ^ {\prime}} R (x _ {j} ^ {\prime}) P _ {B} (\tau_ {j} ^ {\prime} | x _ {j} ^ {\prime})}.
+$$
+
+Hence $P_F(\tau) = P_F(\tau')$ .
+
+Proposition 2. Let $s_1 = \{z_1, z_2, \ldots, z_l\}$ and $s_2 = \{z_1', z_2', \ldots, z_l'\}$ be two non-terminal states such that $s_1 \neq s_2$ but sharing the same Fitch features $f_{z_i} = f_{z_i'} \forall i$ . Let $\mathbf{a}$ be any sequence of actions, which, applied to $s_1$ and $s_2$ , respectively, results in tree topologies $x, x' \in \mathcal{Z}$ , with two partial trajectories $\tau = (s_1 \to \dots \to x), \tau' = (s_2 \to \dots \to x')$ . If $P_F$ is the policy of an optimal GFlowNet with uniform $P_B$ , then $P_F(\tau) = P_F(\tau')$
+
+Proof of Proposition 2. We use the same notation as in the proof of Proposition 1. Since $s_1$ and $s_2$ have the same number of trees, $\mathcal{G}_{s_1}$ and $\mathcal{G}_{s_2}$ have the same graph structure. Let $\chi_1, \chi_2 \subseteq \chi$ be the terminal states reachable from $s_1$ and $s_2$ . There is a bijective correspondence between $\chi_1$ and $\chi_2$ : for every action set $\pmb{a}$ applying on $s_1$ to obtain $x \in \chi_1$ , we obtain $x' \in \chi_2$ by applying $\pmb{a}$ on $s_2$ . Let $\tau$ and $\tau'$ be the partial trajectories created by applying $\pmb{a}$ on $s_1$ and $s_2$ , $P_B(\tau|x) = P_B(\tau'|x')$ .
+
+For simplicity, we denote $M(x) = M(x|L(x))$ . It is worth to note that for two tree topologies sharing the same Fitch feature, their parsimony scores do not necessarily equal. However, when applying $a$ on two states $s_1$ and $s_2$ sharing the Fitch feature, the additional parsimony scores introduced are the same:
+
+$$
+M (x) - \sum_ {i} M (z _ {i}) = M (x ^ {\prime}) - \sum_ {i} M (z _ {i} ^ {\prime})
+$$
+
+We have the following expressions for $P_F(\tau)$ and $P_F(\tau')$ :
+
+$$
+P _ {F} (\tau) = \frac {e ^ {\frac {- M (x)}{T}} P _ {B} (\tau | x)}{\sum_ {\tau_ {j} , x _ {j}} e ^ {\frac {- M (x _ {j})}{T}} P _ {B} (\tau_ {j} | x _ {j})}, \quad P _ {F} (\tau^ {\prime}) = \frac {e ^ {\frac {- M (x ^ {\prime})}{T}} P _ {B} (\tau | x ^ {\prime})}{\sum_ {\tau_ {j} ^ {\prime} , x _ {j} ^ {\prime}} e ^ {\frac {- M (x _ {j} ^ {\prime})}{T}} P _ {B} (\tau_ {j} ^ {\prime} | x _ {j} ^ {\prime})}
+$$
+
+We multiply $\frac{e^{\frac{\sum_{i}M(z_i)}{T}}}{e^{\frac{\sum_{i}M(z_i)}{T}}}$ by $P_F(\tau)$ and $\frac{e^{\frac{\sum_{i}M(z_i')}{T}}}{e^{\frac{\sum_{i}M(z_i')}{T}}}$ by $P_F(\tau')$ and obtain:
+
+$$
+P _ {F} (\tau) = \frac {e ^ {\frac {\sum_ {i} M (z _ {i}) - M (x)}{T}} P _ {B} (\tau | x)}{\sum_ {\tau_ {j} , x _ {j}} e ^ {\frac {\sum_ {i} M (z _ {i}) - M (x _ {j})}{T}} P _ {B} (\tau_ {j} | x _ {j})}, \quad P _ {F} (\tau^ {\prime}) = \frac {e ^ {\frac {\sum_ {i} M (z _ {i} ^ {\prime}) - M (x ^ {\prime})}{T}} P _ {B} (\tau | x ^ {\prime})}{\sum_ {\tau_ {j} ^ {\prime} , x _ {j} ^ {\prime}} e ^ {\frac {\sum_ {i} M (z _ {i} ^ {\prime}) - M (x _ {j} ^ {\prime})}{T}} P _ {B} (\tau_ {j} ^ {\prime} | x _ {j} ^ {\prime})}.
+$$
+
+Since $e^{\frac{\sum_i M(z_i') - M(x_j')}{T}} P_B(\tau_j'|x_j') = e^{\frac{\sum_i M(z_i) - M(x_j)}{T}} P_B(\tau_j|x_j)$ for all $j$ , $P_F(\tau) = P_F(\tau')$ .
+
+
+
+# B MARGINAL LOG-LIKELIHOOD ESTIMATION
+
+Estimating the sampling likelihood of a terminal state In the PhyloGFN state space (in both the Bayesian and parsimony-based settings), there exist multiple trajectories leading to the same terminal state $x$ , hence the sampling probability of $x$ is calculated as: $P^{\top}(x) = \sum_{\tau : s_0 \to \dots \to x} P_F(\tau)$ . This sum is intractable for large-scale problems. However, we can estimate the sum using importance sampling (Zhang et al., 2022):
+
+$$
+P _ {F} ^ {\top} (x) \approx \frac {1}{K} \sum_ {\tau_ {i}: s _ {0} \rightarrow \dots \rightarrow x} \frac {P _ {F} (\tau_ {i})}{P _ {B} (\tau_ {i} | x)}, \tag {S1}
+$$
+
+where the trajectories $\tau_{i}$ are sampled from $P_B(\tau_i\mid x)$ . The logarithm of the right side of (S1) is, in expectation, a lower bound on the logarithm of the true sampling likelihood on the left side of (S1).
+
+Estimating the MLL The lower bound on MLL can be evaluated using the importance-weighted bound $\log P(Y) \geq \mathbb{E}_{x_1 \ldots x_k \sim P_F} \log \frac{1}{K} \sum \frac{P(x, Y)}{P^T(x)}$ (Burda et al., 2016). However, we cannot use it for PhyloGFN since we cannot compute the exact $P^T(x)$ , only get a lower bound on it using (S1). Therefore, we propose the following variational lower bound:
+
+$$
+\log P (\boldsymbol {Y}) \geq \mathbb {E} _ {\tau_ {1}, \dots , \tau_ {k} \sim P _ {F}} \log \left(P (z) \frac {1}{K} \sum_ {\substack {\tau_ {i} : s _ {0} \rightarrow \dots \rightarrow (z _ {i}, b _ {i})}} ^ {k} \frac {P _ {B} (\tau_ {i} | z _ {i} , b _ {i}) R (z _ {i} , b _ {i})}{P _ {F} (\tau_ {i})}\right)
+$$
+
+We show the derivation of the estimator and thus prove its consistency:
+
+$$
+\begin{array}{l} P (\boldsymbol {Y}) = \int_ {z, b} P (\boldsymbol {Y} | z, b) P (b | z) P (z) \\ = \int_ {z, b} R (z, b) P (z) \\ = \int_ {z, b} R (z, b) P (z) \sum_ {\tau : s _ {0} \dots x = (z, b)} P _ {B} (\tau | z, b) \\ = \int_ {z, b} R (z, b) P (z) \sum_ {\tau : s _ {0} \dots x = (z, b)} P _ {B} (\tau | z, b) \frac {P _ {F} (\tau)}{P _ {F} (\tau)} \\ = \int_ {z, b} \sum_ {\tau : s _ {0} \dots x = (z, b)} P _ {F} (\tau) \frac {P _ {B} (\tau | z , b) R (z , b) P (z)}{P _ {F} (\tau)} \\ = \int_ {\tau : s _ {0} \dots x _ {\tau} = (z _ {\tau}, b _ {\tau})} P _ {F} (\tau) \frac {P _ {B} (\tau | z _ {\tau} , b _ {\tau}) R (z _ {\tau} , b _ {\tau}) P (z)}{P _ {F} (\tau)} \\ = P (z) \mathbb {E} _ {\tau \sim P _ {F}} \frac {P _ {B} (\tau | z _ {\tau} , b _ {\tau}) R (z _ {\tau} , b _ {\tau})}{P _ {F} (\tau)} \\ \approx P(z)\frac{1}{K}\sum_{\substack{\tau_{i}\sim P_{F}\\ \tau_{i}:s_{0}\ldots (z_{i},b_{i})}}^{k}\frac{P_{B}(\tau_{i}|z_{i},b_{i})R(z_{i},b_{i})}{P_{F}(\tau_{i})}. \\ \end{array}
+$$
+
+One can show, in a manner identical to the standard importance-weighted bound, that this estimate is a lower bound on $\log P(Y)$ .
+
+PhyloGFN-Bayesian models edge lengths using discrete distributions. To estimate our algorithm's MLL, we augment the sampler to a continuous sampler by modeling branch lengths with a piecewise-constant continuous distribution based on the fixed-bin multinomial distribution of PhyloGFN. We can still use the above formulation to estimate the lower bound. However, each trajectory now has one extra step: $\tau' = s_0 \to \dots \to (z, b) \to (z, b_i)$ where $(z, b_i)$ is obtained from $z, b$ by randomly perturbing each branch length by adding noise from $U[-0.5\omega, 0.5\omega]$ , where $\omega$ is the bin size used for PhyloGFN. Let $\tau = s_0 \to \dots \to (z, b)$ be the original trajectory in the discrete PhyloGFN, we can compute $P_F(\tau')$ , $P_B(\tau')$ from $P_F(\tau)$ , $P_B(\tau)$ :
+
+$$
+P _ {F} (\tau^ {\prime}) = P _ {F} (\tau) \frac {1}{\omega^ {| E (z) |}}, \quad P _ {B} (\tau^ {\prime}) = P _ {B} (\tau)
+$$
+
+The term $\frac{1}{\omega|E(z)|}$ is introduced in $P_F$ because we additionally sample over a uniform range $\omega$ for all $|E(z)|$ edges. The backward probability $P_B$ stays unchanged because given $(z,b)$ generated from the discrete GFN, for any $(z,b')$ resulting from perturbing edges, $(z,b)$ is the only possible ancestral state.
+
+# C DATASET INFORMATION
+
+Table S1: Statistics of the benchmark datasets from DS1 to DS8.
+
+
Dataset
# Species
# Sites
Reference
DS1
27
1949
Hedges et al. (1990)
DS2
29
2520
Garey et al. (1996)
DS3
36
1812
Yang & Yoder (2003)
DS4
41
1137
Henk et al. (2003)
DS5
50
378
Lakner et al. (2008)
DS6
50
1133
Zhang & Blackwell (2001)
DS7
59
1824
Yoder & Yang (2004)
DS8
64
1008
Rossman et al. (2001)
+
+# D MODELING
+
+Given the character set $\Sigma$ , we use one-hot encoding to represent each site in a sequence. To deal with wild characters in the dataset, for parsimony analysis we consider them as one special character in $\Sigma$ , while in Bayesian inference, we represent them by a vector of 1.
+
+For both PhyloGNParsimony and PhyloGNPBayesian, given a state with $l$ rooted trees, its representation feature is the set $\{\rho_1\ldots \rho_l\}$ , where $\rho$ is a vector of length $m|\Sigma|$ . For example, for DNA sequences of 1000 sites, each $\rho$ would have length 4000. Therefore, before passing these features to the Transformer encoder, we first use a linear transformation to obtain lower-dimensional embeddings of the input features.
+
+We use the Transformer architecture (Vaswani et al., 2017) to build the Transformer encoder. For a state with $l$ trees, the output is a set of $l + 1$ features $\{e_s, e_1, \dots, e_l\}$ where $e_s$ denotes the summary feature (i.e., the [CLS] token of the Transformer encoder input).
+
+To select pairs of trees to join, we evaluate tree-pair features for every pair of trees in the state and pass these tree-pair features as input to the tree MLP to generate probability logits for all pairs of trees. The tree-pair feature for a tree pair $(i,j)$ with representations $e_i$ , $s_j$ is the concatenation of $e_i + e_j$ with the summary embedding of the state, i.e., the feature is $[e_s; e_i + e_j]$ , where $[\cdot; \cdot]$ denotes vector direct sum (concatenation). For a state with $l$ trees, $\binom{l}{2} = \frac{l(l-1)}{2}$ such pairwise features are generated for all possible pairs.
+
+To generate edge lengths for the joined tree pair $(i,j)$ , we pass $[e_s; e_i; e_j]$ – the concatenation of the summary feature with the tree-level features of trees $i$ and $j$ – as input to the edge MLP. For unrooted tree topologies we need to distinguish two scenarios: (i) when only two rooted trees are left in the state (i.e., at the last step of PhyloGFN state transitions), we only need to generate a single edge; and (ii) when there are more than two rooted trees in the state, a pair of edges is required. Therefore, two separate edge MLPs are employed, as edge length is modeled by $k$ discrete bins, the edge MLP used at the last step has an output size of $k$ (to model a distribution over a single edge length) whereas the other edge MLP would have an output size of $k^2$ (to model a joint distribution over two edge lengths).
+
+For the temperature-conditioned PhyloGFN, as then temperature $T$ is passed to our PhyloGFN as an input, two major modifications are required: (i) the estimation of the partition $Z_{\theta}$ is now a function of $T$ : $Z_{\theta}(T)$ , which is modeled by a Z MLP; (ii) the summary token to the Transformer encoder also captures the temperature information by replacing the usual [CLS] token with a temp MLP that accepts $T$ as input.
+
+# E TRAINING DETAILS
+
+Here, we describe the training details for our PhyloGN. For PhyloGN-Bayesian, our models are trained with fixed 500 epochs. For PhyloGN-Parsimony, our models are trained until the probability of sampling the optimal trees, or the most parsimonious trees our PhyloGN has seen so far, is above 0.001. Each training epoch consists of 1000 gradient update steps using a batch of 64 trajectories. For $\epsilon$ -greedy exploration, the $\epsilon$ value is linearly annealed from 0.5 to 0.001 during the first 240 epochs. All common hyperparameters for PhyloGN-Bayesian and PhyloGN-Parsimony are shown in Table S3.
+
+Temperature annealing For PhyloGN-Bayesian, the initial temperature is set to 16 for all experiments. For PhyloGN-Parsimony, $T$ is initialized at 4. Under the cascading temperature annealing scheme, $T$ is reduced by half per every 80 epochs of training. For PhyloGN-Bayesian, $T$ is always reduced to and then fixed at 1, whereas for PhyloGN-Parsimony, $T$ is only reduced when the most parsimonious trees seen by our PhyloGN so far are sampled with a probability below 0.001.
+
+Hyperparameter $C$ selection For PhyloGFN-Parsimony, the reward is defined as $R(x) = \exp \left(\frac{C - M(x|Y)}{T}\right)$ , where $C$ is a hyperparameter introduced for training stability and it controls the magnitude of the partition function $Z = \sum_{x} R(x)$ . Given that we cannot determine the precise value of $C$ prior to training since we do know the value of $Z$ as a priori, we use the following heuristic to choose $C$ : 1000 random tree topologies are generated via stepwise-addition, and we set $C$ to the $10\%$ quantile of the lowest parsimony score.
+
+Similarly, $C$ is employed for PhyloGFN-Bayesian under the same goal of stabilizing the training and reducing the magnitude of the partition function. Recall the reward function $R(z,b)$ defined in §4.1, it can be rewritten as $R(z,b) = \exp \left(\frac{C - (-\log P(Y|z,b)P(b))}{T}\right)$ when $T = 1$ . Note that $\exp \left(\frac{C}{T}\right)$ can be absorbed into the partition function. For selecting the $C$ , once again we randomly sample 1000 weighted phylogenetic trees via stepwise-addition and with random edge length, followed by setting $C$ to the $10\%$ quantile of the lowest $-\log P(Y|z,b)P(b)$ .
+
+Temperature-conditioned PhyloGFN-Parsimony The temperature-conditioned PhyloGFN is introduced so that a single trained PhyloGFN can be used to sample from a series of reward distributions defined by different $T$ . We modify the fixed-temperature PhyloGFN-Parsimony by introducing $T$ as input in 3 places: (i) the reward function $R(x;T)$ ; (ii) the forward transition policy $P_F(x;T)$ ; and (iii) the learned partition function estimate $Z_{\theta}(T)$ . To train the temperature-conditioned PhyloGFN, the TB objective also needs to be updated accordingly:
+
+$$
+\mathcal {L} _ {\mathrm {T B}} (\tau ; T) = \left(\log \frac {Z _ {\theta} (T) \prod_ {i = 0} ^ {n - 1} P _ {F} \left(s _ {i + 1} \mid s _ {i} ; \theta , T\right)}{R (x , T) P _ {B} (\tau \mid x)}\right) ^ {2}, \quad P _ {B} (\tau \mid x) := \prod_ {i = 1} ^ {n} \frac {1}{| \operatorname {P a} (s _ {i}) |},
+$$
+
+Note that $P_B$ is unaffected.
+
+During training, values for $T$ are randomly selected from the range $[T_{\mathrm{min}}, T_{\mathrm{max}}]$ . When training with a state from the replay buffer, the temperature used for training is resampled and may be different than the one originally used when the state was added to the buffer.
+
+We also employ a scheme of gradually reducing the average of sampled $T$ values through the course of training: $T$ 's are sampled from a truncated normal distribution with a fixed pre-defined variance and a moving mean $T_{\mu}$ that linearly reduces from $T_{\mathrm{max}}$ to $T_{\mathrm{min}}$ .
+
+Modeling branch lengths with discrete multinomial distribution When a pair of trees are joined at the root, the branch lengths of the two newly formed edges are modeled jointly by a discrete multinomial distribution. The reason for using a joint distribution is because under the Jukes-Cantor evolution model, the likelihood at the root depends on the sum of the two branch lengths.
+
+We use a different set of maximum edge length, bin number and bin size depending on each dataset, and by testing various combinations we have selected the set with optimal performance. The maximum branch length is chosen among $\{0.05, 0.1, 0.2\}$ , and bin size $\omega$ is chosen among $\{0.001, 0.002, 0.004\}$ . Table S2 shows the our final selected bin size and bin number for each dataset.
+
+Table S2: Bin sizes and bin numbers used to model branch lengths for DS1 to DS8.
+
+
Dataset
Bin Size
# Bins
DS1
0.001
50
DS2
0.004
50
DS3
0.004
50
DS4
0.002
100
DS5
0.002
100
DS6
0.001
100
DS7
0.001
200
DS8
0.001
100
+
+Table S3: Common hyperparameters for PhyloGN-Bayesian and PhyloGN-Parsimony.
+
+
Transformer encoder
hidden size
128
number of layers
6
number of heads
4
learning rate (model)
5e-5
learning rate (Z)
5e-3
tree MLP
hidden size
256
number of layers
3
edge MLP
hidden size
256
number of layers
3
Z MLP (in temperature-conditioned PhyloGFN)
hidden size
128
number of layers
1
temp MLP (in temperature-conditioned PhyloGFN)
hidden size
256
number of layers
3
+
+# F CONTINUOUS BRANCH LENGTH MODELING WITH PHYLOGFN
+
+While the original PhyloGN-Bayesian only samples discrete branch lengths, we have experimented with a new version of PhyloGN that uses mixture of Gaussian to model and sample branch lengths — effectively treating them as continuous variables. We refer to this new version as PhyloGN-Continuous and we point out that the edge modeling is the only implementational detail that differs from the previous models.
+
+Specifically, the edge MLP of PhyloGFN-Continuous now outputs the parameters of the Gaussian mixture which models the logarithm of branch length. These include (1) logits for selecting the components of the Gaussian mixture, (2) mean of the log branch length in each mixture, and (3) log variance of the log branch length in each mixture.
+
+Although PhyloGN-Continuous continues to employ two separate edge MLP, one for the last step of state transition where only a single edge needs to be sampled and the other for sampling a pair of edges at the intermediate step, PhyloGN-Continuous now samples each edge independently as we have found this to benefit training stability.
+
+It is also worth pointing out that we no longer perform $\epsilon$ -greedy random exploration on branch lengths, again for the sake of training stability, and the mean of the log branch length is initialized at $-4.0$ instead of $0.0$ , which is a more reasonable value for log branch length. There are five components in each Gaussian mixture.
+
+Results are shown below. We are delighted to report that PhyloGN-Continuous has eliminated the quantization error introduced in the earlier discrete PhyloGN-Bayesian and therefore, our new model is effectively performing on par with the state of the art MrBayes and VBPI-GNN models. In particular, PhyloGN-Continuous has the smallest standard deviation for the MLL estimation across all datasets, with the only exception being DS7 where PhyloGN-Continuous closely matches the performance of VBPI-GNN.
+
+Note that PhyloGFN-Continuous has undergone the same training routine that is described in $\S E$ , as is PhyloGFN-Bayesian.
+
+Table S4: Marginal log-likelihood estimation with different methods on real datasets DS1-DS8. PhyloGFN-C(continuous) now outperforms $\phi$ -CSMC, GeoPhy and PhyloGFN-B(ayesian) across all datasets and it is effectively performing on par with the state of the art MrBayes and VBPI-GNN.
+
+
Dataset
MCMC
ML-based / amortized, full tree space
MrBayes SS
VBPI-GNN*
φ-CSMC
GeoPhy
PhyloGFN-B
PhyloGFN-C
DS1
-7108.42 ±0.18
-7108.41 ±0.14
-7290.36 ±7.23
-7111.55 ±0.07
-7108.95 ±0.06
-7108.40 ±0.04
DS2
-26367.57 ±0.48
-26367.73 ±0.07
-30568.49 ±31.34
-26368.44 ±0.13
-26368.90 ±0.28
-26367.70 ±0.04
DS3
-33735.44 ±0.5
-33735.12 ±0.09
-33798.06 ±6.62
-33735.85 ±0.12
-33735.6 ±0.35
-33735.11 ±0.02
DS4
-13330.06 ±0.54
-13329.94 ±0.19
-13582.24 ±35.08
-13337.42 ±1.32
-13331.83 ±0.19
-13329.91 ±0.02
DS5
-8214.51 ±0.28
-8214.64 ±0.38
-8367.51 ±8.87
-8233.89 ±6.63
-8215.15 ±0.2
-8214.38 ±0.16
DS6
-6724.07 ±0.86
-6724.37 ±0.4
-7013.83 ±16.99
-6733.91 ±0.57
-6730.68 ±0.54
-6724.17 ±0.10
DS7
-37332.76 ±2.42
-37332.04 ±0.12
-37350.77 ±11.74
-37359.96 ±1.14
-37331.89 ±0.14
DS8
-8649.88 ±1.75
-8650.65 ±0.45
-9209.18 ±18.03
-8660.48 ±0.78
-8654.76 ±0.19
-8650.46 ±0.05
+
+# G RUNNING TIME AND HARDWARE REQUIREMENTS
+
+PhyloGFN is trained on virtual machines equipped with 10 CPU cores and 10GB RAM for all datasets. We use one V100 GPU for datasets DS1-DS6 and one A100 GPU for DS7-DS8, although the choice of hardware is not essential for running our training algorithms.
+
+For Bayesian inference, the models used for the MLL estimation in Table S4 are trained on a total of 32 million examples, with a training wall time ranging from 3 to 8 days across the eight datasets. However, our algorithm demonstrates the capacity to achieve similar performance levels with significantly reduced training data. The table S5 below presents the performance of PhyloGFN with 32 million training examples (PhyloGFN Full) and with only $40\%$ of the training trajectories (PhyloGFN Short). Each type of experiment is repeated 3 times. Table S6 compares running time of the full experiment with the shorter experiment. The tables show that the shorter runs exhibit comparable performance to our full run experiments, and all conclude within 3 days.
+
+We compare the running time of PhyloGFN with VI baselines (VBPI-GNN, Vaiphy, and GeoPhy) using the DS1 dataset. VBPI-GNN and GeoPhy are trained using the same virtual machine configuration as PhyloGFN (10 cores, 10GB ram, 1xV100 GPU). The training setup for both algorithms mirrors the one that yielded the best performance as documented in their respective papers. As for VaiPhy, we employed the recorded running time from the paper on a machine with 16 CPU cores and 96GB RAM. For PhyloGFN, we calculate the running time of the full training process (PhyloGFN-Full) and four shorter experiments with $40\%$ , $24\%$ , $16\%$ and $8\%$ training examples. The table S7 documents both the running time and MLL estimation for each experiment. While our most comprehensive experiment, PhyloGFN Full, takes the longest time to train, our shorter runs – all of which conclude training within a day – show only a marginal degradation in performance. Remarkably, even our shortest run, PhyloGFN - $8\%$ , outperforms both GeoPhy and $\phi$ -CSMC, achieving this superior performance with approximately half the training time of GeoPhy.
+
+Table S5: PhyloGFN-Bayesian MLL estimation on 8 datasets. We repeat both full experiment and short experiment (with $40\%$ training examples) 3 times
+
+
Experiment
PhyloGFN Full
PhyloGFN Short (40% Training data)
Repeat
1
2
3
1
2
3
DS1
-7108.95 ±0.06
-7108.97 ±0.05
-7108.94 ±0.05
-7108.97 ±0.14
-7108.94 ±0.22
-7109.04 ±0.08
DS2
-26368.9 ±0.28
-26368.77 ±0.43
-26368.89 ±0.29
-26368.9 ±0.39
-26369.03 ±0.31
-26368.88 ±0.32
DS3
-33735.6 ±0.35
-33735.60 ±0.40
-33735.68 ±0.64
-33735.9 ±0.91
-33735.83 ±0.62
-33735.76 ±0.75
DS4
-13331.83 ±0.19
-13331.80 ±0.31
-13331.94 ±0.42
-13332.04 ±0.57
-13331.87 ±0.31
-13331.78 ±0.37
DS5
-8215.15 ±0.2
-8214.92 ±0.27
8214.85 ±0.28
-8215.38 ±0.27
-8215.37 ±0.26
-8215.38 ±0.25
DS6
-6730.68 ±0.54
-6730.72 ±0.26
-6730.89 ±0.22
-6731.35 ±0.31
-6731.2 ±0.4
-6731.1 ±0.38
DS7
-37359.96 ±1.14
-37360.59 ±1.62
-37361.51 ±2.89
-37362.03 ±5.2
-37363.43 ±2.2
-37362.37 ±2.65
DS8
-8654.76 ±0.19
-8654.67 ±0.39
-8654.86 ±0.15
-8655.8 ±0.95
-8655.65 ±0.37
-8654.96 ±0.46
+
+Table S6: PhyloGN-Bayesian training time
+
+
Dataset
PhyloGFN Full
PhyloGFN Short
DS1
62h40min
20h40min
DS2
69h16min
28h
DS3
80h20min
35h40min
DS4
103h54min
44h30min
DS5
127h50min
51h40min
DS6
135h10min
53h10min
DS7
174h3min
60h20min
DS8
190h25min
61h40min
+
+# H ABLATION STUDY
+
+# H.1 BRANCH LENGTHS MODEL HYPERPARAMETERS
+
+PhyloGFN models branch lengths using discrete multinomial distributions. When estimating MLL, the branch length model is transformed into a piecewise-constant continuous form, introducing a small quantization error. Two hyperparameters define the multinomial distribution: bin size and bin number. This analysis investigates the impact of bin size and bin number on MLL estimation.
+
+Table S7: Running time of PhyloGFN-Bayesian and VI baseline methods on DS1
+
+
Running Time
MLL
VBPI-GNN
16h10min
-7108.41 ±0.14
GeoPhy
12h50min
-7111.55 ±0.07
φ-CSMC**
~2h
-7290.36 ±7.23
PhyloGFN - Full
62h40min
-7108.97 ±0.05
PhyloGFN - 40%
20h40min
-7108.97 ±0.14
PhyloGFN - 24%
15h40min
-7109.01 ±0.15
PhyloGFN - 16%
10h50min
-7109.15 ±0.23
PhyloGFN - 8%
5h10min
-7110.65 ±0.39
+
+For the fixed bin size of 0.001, we assess four sets of bin numbers: 50, 100, 150, and 200, and for the fixed bin number of 50, we evaluate three sets of bin sizes: 0.001, 0.002, and 0.004. For each setup, we train a PhyloGN-Bayesian model on the dataset DS1 using 12.8 millions training examples.
+
+Table S8 displays the MLL obtained in each setup. A noticeable decline in MLL estimation occurs as the bin size increases, which is expected due to the increased quantization error. However, MLL estimation also significantly declines as the number of bins increases over 100 under the fixed bin size of 0.001. We conjecture this is because the size of the action pool for sampling the pair of branch lengths increases quadratically by the number of bins. For example at 200 bins, the MLP head that generates branch lengths has 40,000 possible outcomes, leading to increased optimization challenges.
+
+# H.2 EXPLORATION POLICIES
+
+PhyloGFN employs the following techniques to encourage exploration during training:
+
+- $\epsilon$ -greedy annealing: a set of trajectories are generated from the GFlowNet that is being trained, with actions sampled from the GFlowNet policy with probability $1 - \epsilon$ and uniformly at random with probability $\epsilon$ . The $\epsilon$ rate drops from a pre-defined $\epsilon_{start}$ to near 0 through the course of training.
+- Replay Buffer: a replay buffer is used to store the best trees seen to date, and to use them for training, random trajectories are constructed from these high-reward trees using the backward probability $P_B$ .
+- Temperature annealing: the training of GFlowNet begins at a large temperature $T$ and it is divided in half periodically during training.
+
+To assess the effectiveness of various exploration methods, we train PhyloGFN-Bayesian on DS1 with the following setups:
+
+1. All trajectories are generated strictly on-policy training without any exploration methods (On-policy).
+2. All trajectories are generated with epsilon-greedy annealing $(\epsilon)$ .
+3. Half of trajectories are generated with $\epsilon$ -greedy annealing, and the other half are constructed from the replay buffer $(\epsilon + \mathrm{RP})$ .
+4. The same setup as 3, with the addition of temperature annealing. $T$ is initialized at 16 and reduced by half per every 1.5 million training examples until reaching 1 ( $\epsilon + \mathrm{RP} + \mathrm{T}$ Cascading).
+5. The same setup as 4, except the temperature drops linearly from 16 to 1 $(\epsilon +\mathrm{RP} + \mathrm{T}$ Linear).
+
+For each setup, we train a model using 12.8 millions training examples. Table S9 displays the MLL estimation for each setup. On-policy training without any additional exploration strategies results in the poorest model performance. Epsilon-greedy annealing significantly enhances performance, and combining all three strategies yields the optimal results. There is no significant difference between cascading and linear temperature drops.
+
+# I SIGNIFICANCE OF MODELING SUBOPTIMAL TREES WELL
+
+Several downstream tasks that rely on phylogenetic inference require not only the identification of optimal (maximum likelihood or most parsimonious) trees, but also the proper sampling of suitably
+
+Table S8: MLL estimation of PhyloGFN-Bayesian on DS1 with different combinations of bin size and bin number to model edge lengths.
+
+
Bin Size
Bin Number
MLL
0.001
50
-7108.98 ±0.14
0.001
100
-7108.96 ±0.18
0.001
150
-7109.17 ±1.14
0.001
200
-7109.3 ±7.23
0.002
50
-7109.95 ±0.29
0.004
50
-7114.48 ±0.52
+
+Table S9: MLL estimation of PhyloGFN-Bayesian on DS1 with different exploration policies
+
+
Training Policies
MLL
On policy
-7307.99 ±0.26
ε
-7109.92 ±0.18
ε + RP
-7109.95 ±0.22
ε + RP + T Cascading
7108.98 ±0.14
ε + RP + T Linear
7108.96 ±0.15
+
+weighted suboptimal trees. In evolutionary studies, this includes the computation of branch length support (i.e., the probability that a given subtree is present in the true tree), as well as the estimation of confidence intervals for the timing of specific evolutionary events (Drummond et al., 2006). These are particularly important in the very common situations where the data only weakly define the posterior on tree topologies (e.g. small amount of data per species, or high degree of divergence between sequences). In such cases, because suboptimal trees vastly outnumber optimal trees, they can contribute to a non-negligible extent to the probability mass of specific marginal probabilities. Full modeling of posterior distributions on trees is also critical in studying tumor or virus evolution within a patient (McGranahan et al., 2015; Buendia et al., 2009), e.g., to properly assess the probability of the ordered sequence of driver or passenger mutations that may have led to metastasis or drug resistance (Fisher et al., 2013).
+
+# J REPRODUCIBILITY
+
+In this section, we describe the procedure to reproduce our results. Our most recent implementation involving continuous branch length modeling can be accessed through the following link: https://github.com/zmy1116/phylogfn/. For parsimony analysis and bayesian inference with discrete modeling, refer to code and data provided in the supplementary material.
+
+# J.1 MRBAYES
+
+To reproduce the exact MLL results from (Zhang & Matsen IV, 2018a), MrBayes needs to be installed with Anaconda.
+
+```txt
+conda install bioconda:::mrbayes
+```
+
+With MrBayes built from source, the resulted MLL scores differs slightly, as pointed out in (Mimori & Hamada, 2023). We use the following script to compute MLL for DS1-DS8.
+
+```txt
+execute INPUT_folder/dsl.nex
+lset rst=1
+prset statefreqpr=fixed(equal)
+prset brlenspr=unconstrained:exp(10.0)
+ss ngen=10000000 nruns=10 nchains=4 printfreq=1000\samplefreq=100 savebrlens=yes filename=OUTPUT_folder
+```
+
+# J.2 VBPI-GNN
+
+We use the script provided in the paper's GitHub page to generate models for DS1-DS8:
+
+```shell
+python main.py --dataset DS1 --brlen_model gnn --gnn_type edge \
+--hL 2 --hdim 100 --maxIter 400000 --empFreq --psp
+```
+
+VBPI-GNN requires pre-generation of trees. In the original work, the trees topologies are generated from the algorithm UFBoot (Minh et al., 2013; Hoang et al., 2018). We use the program iqtree (Minh et al., 2020) to run UFBoot on all datasets with following command:
+
+```batch
+iqtree -s DS1 -bb 10000 -wbt -m JC69 -redo
+```
+
+To generate randomly perturbed trees to compare log sampling density versus log posterior density. Run the following notebook in our supplementary data folder:
+
+```txt
+vbpi_gnn/generate_trees_data.ipynb
+```
+
+# J.3 GEOPHY
+
+We run the following script to run GeoPhy on data set DS1. The script is created based on the best configuration recorded in Mimori & Hamada (2023)
+
+```shell
+python ./scripts/run_gp.py -v -ip ds-data/ds1/DS1.nex \
+-op results/ds1/ds1_paper -c ./config/default.yaml -s 0 -ua \
+-es lorentz -edit full -ed 4 -eqs 1e-1 -ast 100_1000 -mcs 3 \
+-ci 1000 -ms 1000_000 -ul
+```
+
+# J.4 PHYLOGFN-BAYESIAN
+
+Training configuration files for DS1-DS8 are in the following folder in the supplementary data:
+
+```txt
+phylo_gfn/src/configs/benchmarkDatasets/bayesian
+```
+
+Run the following script to train the PhyloGN-Bayesian model:
+
+```txt
+cd phylo_gfn
+```
+
+```shell
+python run.py config/benchmarkDatasets/bayesian/ds1.yaml \ dataset/benchmarkDatasets/DS1.pickle $output_path --nb_device 2 \
+--acc_gen_sampleing --random_sampleing_batch_size 1000 --quiet
+```
+
+To compute log MLL, plot sampled log density versus log posterior density and compute the Pearson correlation, run the following notebook in supplementary data:
+
+phylo_gfn/phylogfn_bayesian_result.ipynb
+
+Models for repeated experiments of full training and short training are trained with a memory efficient PhloGFN implementation in folder phylo_gfn_bayesian_memoryefficient
+
+The full training scripts are in folder
+
+```txt
+src/configs/benchmark_datasets/common_script_normal
+```
+
+The short training scripts are in folder
+
+```txt
+src/configs/benchmark_datasets/common_script_short
+```
+
+Training scripts for ablation study are in folder
+
+```txt
+src/configs/benchmarkDatasets/dsl_ablation_study
+```
+
+# J.5 PHYLOGFN-PARSIMONY
+
+Training configuration files for DS1-DS8 are in the following folder in the supplementary data:
+
+```txt
+phylo_gfn/src/configs/benchmarkDatasets/parsimony
+```
+
+Run the following script to train the PhyloGFN-Parsimony model:
+
+```txt
+cd phylo_gfn
+```
+
+```shell
+python run.py src/configs/benchmarkDatasets/parsimony/ds1.yaml \ dataset/benchmarkDatasets/DS1.pickle $output_path --nb_device 2 \
+--acc_gen_sampleing --random_sampleing_batch_size 1000 --quiet
+```
+
+To generate the plots in Fig. S2, run the following script:
+
+```txt
+cd phylo_gfn
+```
+
+```xml
+python parsimony_eval.py
+```
+
+# J.6 TEMPERATURE-CONDITIONED PHYLOGFN
+
+To reproduce the result in Fig. 3, first run the following script to train the model:
+
+```txt
+cd phylo_gfn
+```
+
+```batch
+python run.py config/benchmarkDatasets/parsimony/dsl有条件的.yaml \ dataset/benchmarkDatasets/DS1.pickle $output_path --nb_device 2 \
+--acc_gen_sampleing --random_sampleing_batch_size 1000 --quiet
+```
+
+To generate the plots, run the following notebook in the supplementary data:
+
+```txt
+phylo_gfn/ds1_conditionsal.ipynb
+```
+
+# K ASSESSING SAMPLING DENSITY AGAINST UNNORMALIZED POSTERIOR DENSITY
+
+Here, we assess PhyloGFN-Bayesian's ability to model the entire phylogenetic tree space by comparing sampling density against unnormalized posterior density over high/medium/low-probability regions of the tree space. To generate trees from medium and low probability regions, we use a trained VBPI-GNN model, the state-of-the-art variational inference algorithm.
+
+We first provide a brief introduction to how VBPI-GNN generates a phylogenetic tree in two phases: (i) it first uses SBN to sample tree topology; (ii) followed by a GNN-based model to sample edge lengths over the tree topology. SBN constructs tree topologies in a sequential manner. Starting from the root node and a set of sequences $Y$ to be labeled at the leaves, the algorithm iteratively generates the child nodes by splitting and distributing the sequence set among the child nodes. The action at each step is thus to choose how to split a set of sequences into two subsets.
+
+To introduce random perturbations during tree construction, at every step, with probability $\epsilon$ , the action is uniformly sampled from the support choices. Given a well-trained VBPI-GNN model, we sample from high/medium/low-probability regions with $0\%$ , $30\%$ and $50\%$ probability. We apply PhyloGFN-Bayesian and VBPI-GNN on these sets to compute sampling density and compare with the ground truth unnormalized posterior density computed as $P(Y|z,b)P(z,b)$ . Note that VBPI-GNN models the log-edge length instead of the edge length. Hence we perform a change of variables when computing both the sampling probability and the unnormalized prior.
+
+Fig. S1 shows scatter plots of sampling density versus ground-truth unnormalized posterior density of datasets DS2 to DS8, complementing the result on DS1 shown in Fig. 2. We can see that while VBPI-GNN performs well on high-probability regions, our method is better at modeling the target distribution overall. Fig. S1f shows that our model performs poorly at modeling the high-probability region for DS7. The result aligns with our MLL estimation, shown in Table S4. Further work is required to investigate the cause of PhyloGFN's poor modeling on DS7.
+
+
+(a) DS2
+Figure S1: Sampling log density vs. ground truth unnormalized posterior log density for DS2-DS8
+
+
+(b) DS3
+
+
+(c) DS4
+
+
+(d) DS5
+Figure S1: (cont.)
+
+
+
+
+
+
+
+
+
+
+(e) DS6
+
+
+
+
+
+
+
+
+
+
+
+
+(f) DS7
+
+
+
+
+
+
+
+
+
+
+
+
+(g) DS8
+
+
+
+# L PARSIMONY ANALYSIS RESULTS
+
+
+
+
+(a) A single most-parsimonious tree with a score of 4026 has been identified for DS1.
+
+
+(b) A single most-parsimonious tree with a score of 6223 has been identified for DS2.
+(c) Two most-parsimonious trees with a score of 6659 have been identified for DS3.
+Figure S2: For each dataset, the sampling probabilities for the most-parsimonious as well as several suboptimal trees are estimated from our learned PhyloGFNs. Each boxplot represents a single unique unrooted tree and shows a distribution of the log-probabilities over all its $2n - 3$ rooted versions where $n$ denotes the number of species. The dashed bounding box groups the set of equally-parsimonious trees.
+
+
+
+
+(d) Four most-parsimonious trees with a score of 2424 have been identified for DS4.
+
+
+(e) Two most-parsimonious trees with a score of 1491 have been identified for DS5.
+(f) 12 most-parsimonious trees with a score of 879 have been identified for DS6.
+Figure S2: (cont.)
+
+
+(g) 15 most-parsimonious trees with a score of 7150 have been identified for DS7.
+
+
+(h) 21 most-parsimonious trees with a score of 1461 have been identified for DS8.
+Figure S2: (cont.)
+
+# M TRAINING CURVES
+
+The plot in Figure S3 illustrates the training curves for PhyloGFN-Bayesian across all eight datasets. In each dataset plot, the left side displays the training loss for every batch of 64 examples, while the right side shows the MLL computed for every 1.28 million training examples.
+
+
+(a) DS1
+
+
+
+
+(b) DS2
+
+
+
+
+(c) DS3
+
+
+Figure S3: Training curves for DS1-DS8
+
+
+(d) DS4
+
+
+
+
+(e) DS5
+
+
+
+
+(f) DS6
+
+
+
+
+(g) DS7
+
+
+
+
+(h) DS8
+
+
\ No newline at end of file
diff --git a/phylogfnphylogeneticinferencewithgenerativeflownetworks/images.zip b/phylogfnphylogeneticinferencewithgenerativeflownetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..33376046ed0385fd4c98ab7f36ab2c623a5a7273
--- /dev/null
+++ b/phylogfnphylogeneticinferencewithgenerativeflownetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e6c897989607f81d6461b4bd65454419b8242ccdd4168ba2910d1aa15cbe1004
+size 1937788
diff --git a/phylogfnphylogeneticinferencewithgenerativeflownetworks/layout.json b/phylogfnphylogeneticinferencewithgenerativeflownetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..4349f09ba09824e553ba9d0fcefddb4df0c20cf9
--- /dev/null
+++ b/phylogfnphylogeneticinferencewithgenerativeflownetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e4c5b5ad8a5fd7cf5c611e9a5e6d3663fc409144781a2176b737b3e06c2218cb
+size 1180757
diff --git a/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_content_list.json b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9d38e451afa5e035c1c0219ba5542ea6536fe54c
--- /dev/null
+++ b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:93c7cab0a0c8beadf67a5df8191cbeafba0be2d4402c4a42850f60ad8b2091f8
+size 186680
diff --git a/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_model.json b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..bb72cc1fde9815899c847f1b9df0cb450eb01535
--- /dev/null
+++ b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77ca79a403a5b0358cbe94a479ccf32016bb67298e3672b2615a1c01ed4535ee
+size 224157
diff --git a/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_origin.pdf b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8c8406a36a7528d6c244d1f695dbd06fb2080160
--- /dev/null
+++ b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/99b1ad53-3455-4df8-989e-0c834400a32f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f4ad61347529e9e3cdbec6fc962fd2067303832b1b2ef919eeffcc882c2e555
+size 3255391
diff --git a/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/full.md b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..10329b569b1b8077db9546c49788adf985b22791
--- /dev/null
+++ b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/full.md
@@ -0,0 +1,673 @@
+# PIECEWISE LINEAR PARAMETRIZATION OF POLICIES: TOWARDS INTERPRETABLE DEEP REINFORCEMENT LEARNING
+
+Maxime Wabartha*
+
+McGill University, Mila
+
+Joelle Pineau
+
+McGill University, Mila, FAIR at Meta
+
+# ABSTRACT
+
+Learning inherently interpretable policies is a central challenge in the path to developing autonomous agents that humans can trust. Linear policies can justify their decisions while interacting in a dynamic environment, but their reduced expressivity prevents them from solving hard tasks. Instead, we argue for the use of piecewise-linear policies. We carefully study to what extent they can retain the interpretable properties of linear policies while reaching competitive performance with neural baselines. In particular, we propose the HyperCombinator (HC), a piecewise-linear neural architecture expressing a policy with a controllably small number of sub-policies. Each sub-policy is linear with respect to interpretable features, shedding light on the decision process of the agent without requiring an additional explanation model. We evaluate HC policies in control and navigation experiments, visualize the improved interpretability of the agent and highlight its trade-off with performance. Moreover, we validate that the restricted model class that the HyperCombinator belongs to is compatible with the algorithmic constraints of various reinforcement learning algorithms.
+
+# 1 INTRODUCTION
+
+Artificial intelligence (AI) enables practitioners to automate processes by replacing human decisions and predictions with computational ones. The value potential is high, since the rules are learnt from data: predictions can be made more accurate (Silver et al., 2017; Nam et al., 2019) or quicker (LeCun et al., 1989; Lindsey et al., 2018) than their human counterparts. To achieve these feats, models have rapidly grown in complexity. This trend has come at the cost of interpretability: recent models are opaque decision makers. As a consequence, they are untrustworthy in many situations, either because their predictions are unstable (Goodfellow et al., 2014; Lu et al., 2020), fail to generalize (Wabartha et al., 2021), the actual sub-policies differ from the expected one (Amodei et al., 2016; Ibarz et al., 2018), or because one cannot easily extract the logic behind their decisions.
+
+Often overlooked, in our quest for ever improving performance, the transparency and explainability of AI models might soon become an indispensable component of their democratization, amid a growing oversight by regulatory bodies (European Union, 2016; United States of America, 2022; United Kingdom, 2023a;b). But interpretability is also a fascinating scientific topic in itself, giving us the opportunity to strengthen our understanding of our models and their effects. Therefore, it is important to systematically explore the methods that let us interpret machine learning models. Deep reinforcement learning (DRL) is a particularly interesting domain in which to study interpretability. In fact, a precise description of how policies interact with an environment can inform other algorithms designed to improve the fairness, accountability, or transparency of the deployed model (Doshi-Velez & Kim, 2017). Transparent policies could also help better diagnose the agent's interactions, which can be helpful if it appears to malfunction. Such functionally interpretable policies are especially of interest as they do not need a separate algorithm providing potentially approximate explanations for a policy's decisions (post-hoc interpretability) (Rudin, 2019)).
+
+In this work, we examine the viability of piecewise-linear policies as a beneficial compromise between interpretability and performance in DRL. Piecewise-linear policies such as multi layer perceptrons (MLPs) with ReLU activations directly extend linear policies, which hold favorable inter
+
+pretability properties (Molnar et al., 2021). However, the extremely large number of linear sub-policies usually learnt by MLPs (Hanin & Rolnick, 2019) hinders their interpretability, even if many of these linear sub-policies might in fact be superfluous for end performance Akrour et al. (2018). We focus on extending the analysis of piecewise-linear policies in the context of interpretability. To that end, we propose the HyperCombinator (HC), a neural architecture that parametrizes a piecewise-linear policy with a controllably small number of linear sub-policies. The HC agent selects a linear sub-policy at every interaction with the environment, an important property missing from previous works. The advantages of our piecewise-linear implementation of the policy are many: we can first guarantee that the agent, which can be thought of as a mixture of linear experts (Jacobs et al., 1991), interacts with the environment exclusively through one of the learnt sub-policies. Moreover, each sub-policy can be inspected individually. Finally, we can probe the policy at any given interaction to transparently analyze the computation leading to the decision.
+
+Our contributions are the following: (1) we characterize properties that an interpretable piecewise-linear policy should ideally satisfy, (2) we present the HyperCombinator, an actor architecture that implements a piecewise-linear policy with a specifiable number of linear sub-policies and compatible with most RL algorithms, (3) we characterize the interpretability properties inherited by HC, (4) we extensively evaluate the model on control and navigation tasks and observe a sustained performance of the model despite its greatly reduced expressivity. In addition, (5) we leverage the two levels of interpretability of HC to propose two visualizations. The first one lists the different ways the policy can react to an input by cataloging exhaustively each linear sub-policy and its coefficients into a table. The second condenses the sequence of decisions into the sequence of sub-policies used, surfacing the temporal abstractions emerging from the task.
+
+# 2 BACKGROUND
+
+# 2.1 DEEP REINFORCEMENT LEARNING AND INTERPRETABLE POLICIES
+
+In reinforcement learning, an agent learns to interact with its environment to maximize the accumulation of a learning signal, the reward (Sutton & Barto, 2018). The environment is modeled as a Markov Decision Process (MDP) defined as a tuple $(\mathcal{X},\mathcal{A},R,P,\gamma ,\rho_0)$ . At each timestep $t$ , the agent in state $x_{t}\in \mathcal{X}$ takes the action $a_{t}\sim \pi (x_{t})\in \mathcal{A}$ . The agent then transitions to $x_{t + 1}\sim P(\cdot |x_t,a_t)$ and receives reward $r_{t + 1} = R(x_t,a_t,x_{t + 1})$ . We denote with $\rho_0$ the starting state distribution and represent a trajectory $\tau$ as $(x_0,a_0,x_1,\ldots ,x_T)$ , where $T$ is the last timestep of the trajectory if the environment is episodic, and $T = \infty$ else. The discounted sum of rewards is $G(\tau) = \sum_{t = 0}^{T - 1}\gamma^t r_{t + 1}$ , and we denote its expectation $J^{\pi} = \mathbb{E}_{\tau}[G(\tau)]$ . Fundamental in reinforcement learning is the function $Q^{\pi}$ , for which for a given state and action, $Q^{\pi}(x,a) = \mathbb{E}_{\pi}\left[\sum_{t = 0}^{T - 1}\gamma^{t}R(x_{t},a_{t},x_{t + 1})|x_{0} = x,a_{0} = a\right]$ . Actor-critic algorithms solve an MDP by modelling explicitly both $\pi$ and $Q^{\pi}$ . They aim at finding a policy $\pi^{*}$ such that $\pi^{*} = \operatorname{argmax}_{\pi}J^{\pi}$ .
+
+Both $Q^{\pi}$ and $\pi$ can be parametrized by deep neural networks (NNs) to handle high-dimensional input spaces and increase the performance of the agent (Mnih et al., 2015). However, this modelisation limits our understanding of the action choice of an agent, due to the opacity of NNs.
+
+In this work, we tackle the task of making the policy interpretable at each timestep. Since we focus on functional interpretability, we constrain the class of functions that the policy belongs to. That is, we design a policy architecture that gives exact insights about the decision applied to state $x_{t}$ . The last layer of deep policies is often a non-linearity $\mu$ , such as the softmax function, to cast the prediction of the NN to the right action space. In a similar fashion to the interpretation of logistic regression, we focus on interpreting the pre non-linearity part of the policy, which we denote by $\tilde{\pi}$ . Finally, we remark that an interpretable model is of limited utility if the input features themselves are not interpretable. Therefore, we consider robotics environments with varying levels of difficulty and where the input to the policy is the proprioceptive state representation, each feature representing a physical variable describing the agent (Tassa et al., 2018).
+
+# 2.2 FROM LINEAR TO PIECEWISE-LINEAR POLICIES
+
+To achieve functional interpretability, one can reduce the size of the class that the policy belongs to (Rudin, 2019). Classes of functions that can be expressed through a small number of parame
+
+ters, such as linear functions, are often considered to be interpretable due to the reduced amount of information required to understand the function they realize (Molnar et al., 2021). We write linear policies as $\tilde{\pi}(x) = \langle \theta, x \rangle$ , where $\theta$ designates the linear coefficients, the input $x$ is assumed interpretable, and $\langle A, b \rangle$ is the dot product between $A$ and $b$ if both are vectors, and the matrix-vector product if $A$ is a matrix instead. Linear policies have several desirable properties related to interpretability, such as being summarizable by their coefficients, or having each coefficient explicitly quantify the influence of a given feature and expressing the same valid explanation for all inputs. However, despite showing strong performance in certain benchmarks (Rajeswaran et al., 2017), their flexibility is generally not sufficient to handle more complex tasks (Mnih et al., 2013).
+
+We therefore consider the larger class of piecewise-linear policies. They are a direct extension of linear policies, as they can be written as $\tilde{\pi}:\mathcal{X}\to \mathcal{A}$ with:
+
+$$
+\tilde {\pi} (x) = \left\{ \begin{array}{l l} \left\langle \theta_ {\omega_ {0}}, x \right\rangle & \text {i f} x \in \omega_ {0} \\ \left\langle \theta_ {\omega_ {1}}, x \right\rangle & \text {i f} x \in \omega_ {1} \\ \dots & , \\ \left\langle \theta_ {\omega_ {K - 1}}, x \right\rangle & \text {i f} x \in \omega_ {K - 1} \end{array} \right. \tag {1}
+$$
+
+where $K$ is the number of linear sub-functions, and where the partition of the input space $\Omega = \{\omega_0,\dots ,\omega_{K - 1}\}$ , the set of linear coefficients $\theta = \{\theta_{\omega},\omega \in \Omega \}$ and the function mapping an input to the corresponding subset $\omega$ , $a:\mathcal{X}\to \Omega$ describe $\tilde{\pi}$ . Therefore, $\tilde{\pi}$ is locally linear, and some interpretability properties of linear policies carry over. However, both the value of $K$ and the complexity of $\Omega$ and $a$ influence the interpretability of $\tilde{\pi}$ .
+
+MLPs using only linear layers (including linear, convolutional or layer normalization layers) and ReLU activations (Fukushima, 1975; Nair & Hinton, 2010) already offer a piecewise-linear parametrization of policies (Pascanu et al., 2014) learnable with gradient descent. The rightmost plot of Fig. 1 illustrates the induced partition, and Hanin & Rolnick (2019) analyse more precisely the nature of the partition. Growing the width and the depth of the network quickly increases the approximation power of MLPs by increasing the number of linear sub-functions that compose them (Pascanu et al., 2014) and the complexity of the partition, in turn penalizing the interpretability of $\tilde{\pi}$ . Conversely, it is only possible to loosely control an upper bound on the number of linear sub-policies through the architecture of the MLP (Hanin & Rolnick, 2019). Moreover, a policy with a large number of linear sub-policies implies that each sub-function only applies to a few inputs, limiting the generalization of the explanations provided by the linear coefficients. For instance, we show in Appendix C that even a baseline RL agent provided with a small neural policy uses a unique linear sub-function around 950 times in a 1000 step-long trajectory, meaning that a different set of coefficients is applied at almost every step. Restricting the number of linear sub-functions while maintaining a high level of performance and interpretability is therefore a major challenge, that we explore next.
+
+# 3 METHODS
+
+As noted in Sec. 2.2, piecewise-linearity is not a sufficient requirement to guarantee that we obtain an interpretable policy. Therefore, we begin by formulating properties that a deployed, interpretable policy should ideally satisfy.
+
+(P1) Sub-policy transparency: the input to output sub-policy computation is easy-to-understand.
+(P2) Assignation transparency: the input to sub-policy choice computation is easy to understand.
+(P3) Separation: the policy uses a single sub-policy at each interaction (training and evaluation).
+(P4) Counterfactual reasoning: we can compare the sub-policy taken to the other possible ones.
+(P5) Generalization: the sub-policies generalize to similar inputs.
+(P6) Causality: we want to justify the causal influence of each feature w.r.t. the task success.
+
+Given the subjective nature of interpretability, a single definition might not be sufficient (Doshi-Velez & Kim, 2017), and several desiderata relate to different notions of interpretability. To satisfy as many of these properties as possible, we design the Hypercombinator, a piecewise-linear neural architecture with a small, controllable number of linear sub-functions.
+
+
+Figure 1: (Left) Proposed actor architecture. Layers are colored in yellow, vectors in blue. (Right) Intuition of the partition of a 2D space into linear regions by different models. Each polygon corresponds to a distinct linear region, and each color to a set of unique linear coefficients.
+
+# 3.1 PROPOSED POLICY ARCHITECTURE
+
+Our starting policy class is expressed by an MLP, realizing a piecewise-linear function with respect to an input $x \in \mathbb{R}^n$ assumed interpretable. Following Sec. 2.2, the prediction can be decomposed as $\tilde{\pi}(x) = \langle \theta_{a(x)}, x \rangle$ , where $a : \mathbb{R}^n \to \Omega$ assigns an input $x$ to a subset of the partition induced by $\tilde{\pi}$ . For a general MLP, both $a$ and $\theta$ are implicitly defined by $\tilde{\pi}$ and have a complex dependency on its parameters. This intricate relationship illustrates two major hurdles in making neural networks interpretable, namely the complexity of the induced partition and the plurality of linear sub-functions. Both relate to the complexity of the policy class.
+
+Parametrization We focus on reducing the number of sub-policies while retaining the complexity of $\Omega$ . To do so, we make the functions $a$ and $\theta$ explicit in the output computation through a new parametrization of the NN. We first view $\theta$ as a linear function $\hat{\theta}:\Omega\to\mathbb{R}^n$ rather than a set of coefficients. Secondly, we model $a$ explicitly within $\tilde{\pi}$ by an MLP followed by a Gumbel-Softmax layer (Jang et al., 2016; Maddison et al., 2016), and refer to the composition of both as a Gumbel network $\hat{a}$ . The Gumbel-Softmax is a technique typically used to continuously learn a categorical variable. In this context, it predicts to which sub-policy should an input $x$ be mapped. Furthermore, we use the straight-through estimator (Bengio et al., 2013) to force $\hat{a}$ to produce strict assignations, i.e. one-hot encodings in the forward pass while being trainable with gradient descent. We note that because the output of the Gumbel network is always a one-hot encoding, we can use any activation function within the Gumbel network without breaking the piecewise-linear property of the policy. The resulting architecture is
+
+$$
+\tilde {\pi} (x) = \langle \hat {\theta} (\hat {a} (x)), x \rangle , \tag {2}
+$$
+
+$$
+\pi (x) = \mu (\tilde {\pi} (x)), \tag {3}
+$$
+
+which we refer to as the HyperCombinator, illustrated in Fig. 1 along with the partition it induces.
+
+This formulation is advantageous for several reasons. First, the MLP preceding the Gumbel-Softmax induces the partition of the input space which $\pi$ inherits, thus retaining some of the predictive flexibility of NNs. Second, we explicitly control the number of unique sub-policies of $\pi$ through the dimension $d_{G}$ of the Gumbel-Softmax layer. Moreover, the Gumbel network $\hat{a}$ is piecewise-constant thanks to the straight-through estimator. Therefore, $\pi$ interacts with the environment only through one of the $d_{G}$ sub-policies, on the contrary to previous work (Akrour et al., 2018).
+
+Policies modeled with the HyperCombinator differ from MLPs in that they are usually not continuous at the border between linear regions, which we do not find to be a problem for stability in practice (Appendix D.6). Moreover, reducing the width or the height of the NN is an alternative and more direct way to reduce the number of unique coefficients. Yet, the number of linear sub-functions grows very quickly with the size of the architecture, both theoretically and empirically. We refer to Appendix B for a more in-depth study of this approach.
+
+# 3.2 INTERPRETABILITY CHARACTERIZATION OF THE HYPERCOMBINATOR ARCHITECTURE
+
+The HyperCombinator policy class has the following structural properties:
+
+- $\tilde{\pi}$ is a linear function of the interpretable input $x$ (P1). A stakeholder can therefore access transparently the computation that led to the decision, given the sub-policy. The coefficients $\hat{\theta} (\hat{a} (x))$ are available as an output of our approach.
+- The policy is piecewise-linear during evaluation and training thanks to the use of the straight-through estimator. This ensures that HC stays interpretable for all environment interactions (P3).
+- The number of unique sub-policies of the policy is set by the hyperparameter $d_{G}$ (P4), which lets a stakeholder control the performance-interpretability trade-off.
+
+Subsequently, our architecture needs to re-use the few sub-policies of very low complexity in order to solve complex tasks. The sub-policies are thus in practice constrained to generalize across a wide range of states, which implies P5. This is not true for MLPs, due to their huge number of linear regions and unique coefficients. MLPs additionally do not satisfy P4.
+
+Our approach is locally interpretable, as it explains the sub-policy applied to any given example. Conversely, while the explanations generalize to the inputs that are mapped to the same sub-policy, the fact that the partition is induced by a neural network prevents us from having a globally interpretable model; our approach does not satisfy P2. As an important consequence, the HyperCombinator does not provide feature importance or any notion of causal explanations and does not satisfy P6. Indeed, just like MLPs, a feature $x_{i}$ of $x$ can be involved in the computation of all the coefficients $\hat{\theta} (\hat{a} (x))$ and simultaneously have the value of its linear coefficient $\hat{\theta} (\hat{a} (x))_i$ be 0. Instead, an HC policy provides a transparent justification of how it interacted with the environment for a given input, which is governed by the transparent sub-policy. In other words, our approach can be understood as interpretable conditioned on the choice of a sub-policy.
+
+Two levels of interpretability In summary, an HC policy can perhaps best be understood as two consecutive modules, each corresponding to a different level of interpretability. The first module selects a linear sub-policy given an input, while the second retrieves the linear coefficients of the selected sub-policy and applies them to the input. The second module provides the exact linear coefficients that are used by the policy to interact with the environment, quantifying the influence of each interpretable feature on the chosen action. We characterize this as the low-level interpretability of the HC policy. Simultaneously, one can observe the sequence of choices of sub-policies made by an agent in order to analyze its behavior, thanks to the first module of $\tilde{\pi}$ . The forced re-use of sub-policies leads to the emergence of cycles and temporal abstractions which let us analyze how the agent solves the task, that we call high-level interpretability. We illustrate the complementary existence of both levels of interpretabilities in Fig. 1 (left), using green and purple to respectively locate the high and low-level interpretability of $\tilde{\pi}$ . We will see in Sec. 4 that these two levels of interpretability enable insightful visualizations of the agent's policy, such as the identification of the behavior modelled by each linear subpolicy (Appendix. D.7) and the observation of the emergence of temporal abstractions (Sec 4.1 and 4.2).
+
+# 3.3 APPLICATION TO DEEP ACTOR-CRITIC ARCHITECTURES
+
+We can use the HyperCombinator as the actor of any actor-critic algorithms, provided that no competing assumption is made on the architecture of the policy. This means that the critic or the potential other parts of the RL algorithm can be modeled by complex neural networks without affecting the interpretability of the policy. We note that in practice, all the linear sub-policies share the same bias vector. This limits the flexibility of the sub-policies, but also increases their interpretability since they all reduce to the same default sub-policy at $x = 0$ . We adapt $\mu$ to the action space of interest. In addition, we note that the Gumbel-Softmax layer can destabilize training. For instance, its predictions may collapse to a single mode, making $\hat{\pi}$ equivalent to a linear policy. We alleviate this issue through different forms of regularization. First, we increase the temperature parameter and add weight decay to the last layer weights of the Gumbel network MLP. Both limit the magnitude of the input fed to the Gumbel-Softmax layer. Secondly, we maximize the entropy $H$ of the average sub-policy assignation over a batch of size $B$ , that is $H\left(\frac{1}{B}\sum_{i=1}^{B}\hat{a}(x_i)\right)$ . This encourages the Gumbel network to use the diversity of sub-policies at its disposal.
+
+
+Figure 2: HC actors match or approach the performance of SAC for most environments.
+
+# 4 EXPERIMENTS
+
+In this section, we evaluate if the structural constraints of the HyperCombinator offer a reasonable compromise on performance, and visualize the improved interpretability properties of our approach.
+
+# 4.1 CONTROL
+
+We evaluate how well HC policies can control proprioceptive variables such as the joints of a robot through the DeepMind Control Suite benchmark (Tassa et al., 2018). We aim to (1) ensure that the HC architecture can be trained to solve control tasks, (2) investigate the improved interpretability of the agent and (3) compare the performance of HC actors to their baseline algorithm using their usual neural policy. We replace the actor in the SAC algorithm by a HC actor with final nonlinearity $\mu$ which predicts, for state $x$ , the mean of the action distribution $\pi(x) = \mu(\tilde{\pi}(x))$ . In other terms, $\tilde{\pi}$ is linear w.r.t. the interpretable proprioceptive features (Sec. 2.1). The Gumbel network follows a [1024, 1024, 1024] architecture and uses a sub-policy assignation entropy coefficient of 0.001. The remaining hyperparameters are the defaults from Yarats & Kostrikov (2020), that we detail in Appendix D. We consider 2 variants of the HC actor, HC8 and HC64, with a maximum of respectively 8 and 64 sub-policies. The latter model is more expressive, at the cost of interpretability, since a practitioner now needs to factor in 64 different possible sub-policies instead of 8.
+
+Performance We perform an in-depth experimental analysis of the performance of piecewise-linear policies in DM Control, extending previous work (Akrour et al., 2018). Figure 2 presents the evolution of the evaluation return over training for a subset of 6 commonly used environments (Yarats et al., 2021), while we defer the results for all environments to Appendix D.2. HC policies approach or match the performance of SAC in most environments, with Inter-Quartile Mean (Agarwal et al., 2021) scores (95% CI) of .81 (.78-.83), .85 (.83-.87) and .87 (.86-.88) respectively for HC8, HC64 and SAC. We highlight in particular the limited drop in performance of HC8, which performs at most $3\%$ worse than SAC in $57\%$ of the tested environments (HC64: $78\%$ ). These results show that drastically reducing the expressivity of the actor is only penalized by a moderate drop in performance: HC8 achieves a comparable return to SAC in most environments despite having restricted the interaction capability of the actor to only 8 different linear functions. We can improve further these results by trading some of the interpretability of the agent, as illustrated by the results of HC64. We further analyze the performance-interpretability gap in Appendix D. In addition, the HC architecture requires the sub-policies to be reused for a large number of inputs, which can help sample efficiency. We observe this effect in the Cheetah run and Humanoid tasks after training for 5M time-steps. We find that HC8 and HC64 improve over SAC during early parts of the training in 3 of these tasks. In the Humanoid Stand environment in particular, HC8 and HC64 converge several million steps before SAC. We further illustrate these results in Appendix D. Conversely, the performance curves of HC policies suffer a higher variance than SAC's, which we presume is due to the presence of the Gumbel-Softmax layer in the network.
+
+Interpretability The low-level interpretability of HC actors, thanks to the linearity of the sub-policies, gives insights about the influence of the features in each decision. In the Cartpole swingup environment, we can for instance precisely analyze how some sub-policies swing the cartpole up while others stabilize the cartpole once in an approximately straight position. We defer the precise analysis of this result to Appendix D.7. The discrete bottleneck introduced by the Gumbel network also lets us visualize the high-level interpretability of HC through the sequence of chosen sub
+
+
+
+
+Figure 3: (Left) Sub-policy sequence of the first 200 timesteps of HC8 on Cheetah run. A temporal abstraction emerges as HC8 reuses the same sub-policy for several timesteps before switching to a new one in a cyclical fashion. (Right) All sub-policies coefficients, for one dimension of $\tilde{\pi}$ 's output space. This view exposes the similarities of sub-policies (2 and 3 have same-sign coefficients for features 1 to 5) or their disparities (2 and 3 have opposite sign (hence effect) w.r.t. feature 0.
+
+
+
+policies. For instance, HC8 learns to control the joints of a robot to maximize its speed in the Cheetah run environment. The learnt movement is cyclical by nature, which is adapted to the strong sub-policy re-use of HC. We find again this periodicity in the sequence of sub-policies taken by HC8, in the left part of Fig. 3. The successive diagonals in the sub-policies sequence illustrate the HC8 has learnt to chain its restricted sub-policies to learn a well-performing policy. We then combine this visualization with an exact description of which feature the chosen sub-policy used to interact with the environment, and with which magnitude (right part of Fig. 3, corresponding to the low-level interpretability of HC). In contrast, we emphasize that these visualizations do not bear any meaning for a regular actor. Indeed, SAC reuses the same linear coefficients in average 50 times over a 1000 timestep trajectory on Cheetah run, in spite of the cyclicity of the task. The information learnt by SAC is hidden by the interdependence of its sub-policies, preventing us from observing the emergent temporal abstraction phenomenon from Fig. 3 (see further details in Appendix C).
+
+# 4.2 NAVIGATION
+
+We now focus on maze navigation tasks (Nasiriany et al., 2019). We want to discover if (1) HC actors can solve hard exploration mazes by being combined with dedicated algorithms in spite of the restricted architecture and if (2) using HC actors in mazes can elicit temporal abstractions in the sub-policy sequence, similar to the control setting. The agent, a quadruped which state is described by proprioceptive features, is provided with a goal state to reach. The sparse reward signal makes the mazes hard to explore and require dedicated algorithms. In this context, we extend RIS (Chane-Sane et al., 2021), a goal-conditioned DRL algorithm. Given a state and goal, RIS encourages during training the policy to match the action predicted by a "prior" policy (an empirical moving average of the actor) to reach an intermediate goal. We replace the neural policy of RIS with HC actors with 8, 16 and 64 sub-policies, and otherwise follow the same training and evaluation protocol, which we detail in Appendix E. All HC actors use a [64, 64, 64] architecture and use several regularization techniques. Compared to RIS, HC actors are trained with a reduced batch size (to accommodate computing resources) and use a stronger prior regularization hyperparameter (denoted $\alpha$ ).
+
+Performance We observe in Fig. 4 that RIS as well as HC64 perform well in all the mazes: the constrained expressivity of HC actors does not prevent them from being trained on mazes using a dedicated navigation algorithm. While both RIS and HC64 get a stable performance for the U and S-shaped mazes, the wider confidence intervals for the other two mazes illustrate the difficulty of the tasks. Furthermore, HC8 and HC16 solve most of the time the U-shaped maze, and HC16 the S-shaped maze. All reach the goal in at least one of the seeds, showing that such architectures are not too constrained to express a goal-reaching policy. However, all HC actors require more interactions than RIS to solve the respective mazes, and the failure rate is overall higher. Compared to DM Control, the higher difficulty of the task (and of the assignation function needed to solve it) is one possible explanation to the reduced sample efficiency. Solving the maze requires high-level navigation in addition to low-level control, whereas only the latter was previously required.
+
+
+Figure 4: HC actors learn to solve the navigation tasks with a reduced sample efficiency.
+
+
+
+
+
+
+
+
+
+
+Figure 5: (Top left) The quadruped must go down the left corridor, and up the right corridor. (Bottom) HC8 sub-policy sequence after 2M steps. We note the appearance of motifs (repetitions of subsequences of sub-policies) that match the behavior observed on the agent: rotation, then straight movement, before a rotation to change corridor and a straight movement. (Top right) Trajectory of sub-policy choices superposed with the maze: each colored point refers to the sub-policy chosen at that location. The grouping of colors illustrate the empirical emergence of temporal abstractions.
+
+Interpretability We finally provide an example of a sequence of sub-policies followed by HC8 during one successful trajectory, in Fig. 5. This visualization emphasizes how a temporal abstraction emerges from the hierarchical nature of HC. HC learns to alternate between sub-policies 0 and 1 to move straight, and between 2 and 3 to rotate, illustrating how the high-level interpretability of HC lets us identify behaviors followed by the agent to solve the maze. For instance, the usage of sub-policies 2 and 3 for the first steps indicates that the agent first needed to turn. A comparison with a video of the agent highlights that it was initialized facing the wrong direction, justifying this first rotation. We analyze a wider set of sub-policy sequences in other mazes in Appendix E.
+
+# 5 RELATED WORKS
+
+Interpretability in (deep) reinforcement learning Closest to our work, (Akrour et al., 2018) explore a very similar piecewise-linear policy architecture in the control setting, though not in the scope of interpretability. In particular, the choice of sub-policy is determined by a softmax function, such that the partition of the state space induced by the sub-policy assignation function is soft. On the contrary, the HyperCombinator induces a hard partition which guarantees that only a single sub-policy
+
+is used at any interaction with the environment. Previous work also showed that linear (Rajeswaran et al., 2017) and discrete (Tang & Agrawal, 2020) policies performed surprisingly well in control environments, at the cost of a reduced flexibility and therefore a likely reduced ability to solve complex tasks. LMIT (Liu et al., 2019) generates functions that live in the same space as HC. However, LMIT is applied to the Q-function rather than the policy, is introduced in a distillation setting, and the partition it induces, while interpretable, is not learnt by gradient descent. Programmatically interpretable reinforcement learning algorithms (PiRL) train highly structured policies such as decision trees or finite state machines (Koul et al., 2018). Verma et al. (2018) and Bastani et al. (2018) distill an expert policy into an inherently interpretable one. Trivedi et al. (2021); Qiu & Zhu (2021); Liu et al. (2023) use policies defined over discrete actions (either from the environment or learnt) to solve high-level planning. On the contrary, HC aims to learn functionally interpretable policies that handle both to low-level continuous control and high-level planning. Contemporary to HC, Orfanos & Lelis (2023) learn an interpretable tree policy derived from a small actor. Other methods use non gradient-descent optimization methods to learn inherently interpretable policies (Hein et al., 2017; 2018). In high dimensional domains, the network can be intertwined with prototypes to justify inherently its decisions (Kenny et al., 2023). An attention module was added to the IMPALA algorithm, highlighting the parts of the image used for decision making (Mott et al., 2019). In our approach, we focus on proprioceptive states, and rather propose a policy with transparent interactions with the environment. Further from our work, there has been efforts to make the Q-function interpretable (Annasamy & Sycara, 2019; Juozapaitis et al., 2019). Tangentially, a recent work studied the evolution of the linear regions of a ReLU MLP in DRL (Cohan et al., 2022).
+
+Hierarchical methods Several navigation methods incorporate a hierarchical component in the policy training, which can inform the policy architecture (Nasiriany et al., 2019; Nachum et al., 2018; Faust et al., 2018) or guide it during training (Chane-Sane et al., 2021). We focus on making the policy more interpretable by building off the later method, restricting its expressivity. Options (Sutton et al., 1999; Bacon et al., 2017) are another type of temporal abstraction. In comparison, our method does not define an initiation or termination set, instead belonging to the usual RL formalism, with a simple policy architecture change. Close to our work, SENN (Alvarez Melis & Jaakkola, 2018) uses a similar architecture to HC, but focuses on supervised learning and adds a penalty to smooth the linear coefficients, while we structurally enforce the latter to be piecewise-constant and analyze the effects of the gained piecewise-linearity on the policy interpretability in RL. Finally, hierarchy can manifest directly in the network weights. Our architecture can be thought of as a hypernetwork (Ha et al., 2017) predicting the coefficients of a policy linear w.r.t. interpretable features.
+
+# 6 DISCUSSION
+
+In this article, we studied whether piecewise-linear policies can be a suitable compromise between performance and interpretability in DRL. To this end, we presented the HyperCombinator architecture, an implementation of a piecewise-linear actor that combines a controllably small set of inherently interpretable sub-policies to interact with the environment in a transparent manner. We showed that in several control and navigation environments, the performance loss due to the reduced expressivity of our policy class was limited. Moreover, we illustrated how new visualizations, possible thanks to the two levels of interpretability provided by HC policies, give us insights on the interactions of an agent with its environment. We also noticed the empirical emergence of temporal abstractions in the policy in both the control and select navigation settings.
+
+This work could be improved in several ways. Currently, the assignation function learnt by the policy is not interpretable, which prevents explaining why a sub-policy was chosen. Moreover, the HyperCombinator interacts transparently with the environment, but is not a causal architecture. And so our policy ultimately does not fully answer "why" an action was taken, instead giving an interpretable decision conditioned on the sub-policy choice. Nonetheless, this is a significant step compared to current DRL algorithms, which are far from meeting the most basic standards of explainability.
+
+The growing presence of AI models in our daily lives has raised the stakes about the abilities they should exhibit. In the face of an increasing need for interpretability, both by citizens (Vasconcelos et al., 2023) and by lawmakers, it is imperative to develop models that can accurately justify their decisions. Through the HC architecture, we showed that appropriately parametrized piecewise-linear policies can be an important first step towards meeting this expectation for DRL agents.
+
+# ACKNOWLEDGEMENTS
+
+This work was supported by the Fonds de Recherche du Québec - Nature et Technologies (FRQNT), the Natural Sciences and Engineering Research Council of Canada (NSERC) and the Canada CIFAR AI chairs program. The authors thank Pascal Vincent, Alessandro Sordoni, Harsh Satija, Clara Lacroce, Jonathan Lebensold, Samuel Lavoie and Emmanuel Bengio for fruitful discussions, as well as colleagues from FAIR Montréal and Mila and anonymous reviewers for insightful comments and suggestions on earlier drafts of this document. Finally, we thank the Python (Van Rossum & Drake Jr, 1995), numpy (Van Der Walt et al., 2011), matplotlib (Hunter, 2007) and PyTorch (Paszke et al., 2017) communities that developed the tools this work is built on.
+
+# REFERENCES
+
+Rishabh Agarwal, Max Schwarzer, Pablo Samuel Castro, Aaron C Courville, and Marc Bellemare. Deep reinforcement learning at the edge of the statistical precipice. Advances in neural information processing systems, 34:29304-29320, 2021.
+Riad Akrour, Filipe Veiga, Jan Peters, and Gerhard Neumann. Regularizing reinforcement learning with state abstraction. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 534-539. IEEE, 2018.
+David Alvarez Melis and Tommi Jaakkola. Towards robust interpretability with self-explaining neural networks. Advances in neural information processing systems, 31, 2018.
+David Alvarez-Melis and Tommi S Jaakkola. On the robustness of interpretability methods. arXiv preprint arXiv:1806.08049, 2018.
+Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mané. Concrete problems in ai safety. arXiv preprint arXiv:1606.06565, 2016.
+Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. Advances in neural information processing systems, 30, 2017.
+Raghuram Mandyam Annasamy and Katia Sycara. Towards better interpretability in deep q-networks. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pp. 4561-4569, 2019.
+Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Proceedings of the AAAI conference on artificial intelligence, volume 31, 2017.
+Osbert Bastani, Yewen Pu, and Armando Solar-Lezama. Verifiable reinforcement learning via policy extraction. Advances in neural information processing systems, 31, 2018.
+Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
+Elliot Chane-Sane, Cordelia Schmid, and Ivan Laptev. Goal-conditioned reinforcement learning with imagined subgoals. In International Conference on Machine Learning, pp. 1430-1440. PMLR, 2021.
+Setareh Cohan, Nam Hee Kim, David Rolnick, and Michiel van de Panne. Understanding the evolution of linear regions in deep reinforcement learning. Advances in Neural Information Processing Systems, 35:10891-10903, 2022.
+Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608, 2017.
+European Union. General data protection regulation, 2016.
+Aleksandra Faust, Kenneth Oslund, Oscar Ramirez, Anthony Francis, Lydia Tapia, Marek Fiser, and James Davidson. Prm-rl: Long-range robotic navigation tasks by combining reinforcement learning and sampling-based planning. In 2018 IEEE international conference on robotics and automation (ICRA), pp. 5113-5120. IEEE, 2018.
+
+Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International conference on machine learning, pp. 2052-2062. PMLR, 2019.
+Kunihiko Fukushima. Cognitron: A self-organizing multilayered neural network. Biological cybernetics, 20(3-4):121-136, 1975.
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
+David Ha, Andrew M Dai, and Quoc V Le. Hypernetworks. In International Conference on Learning Representations, 2017.
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International conference on machine learning, pp. 1861-1870. PMLR, 2018.
+Boris Hanin and David Rolnick. Deep relu networks have surprisingly few activation patterns. Advances in neural information processing systems, 32, 2019.
+Daniel Hein, Alexander Hentschel, Thomas Runkler, and Steffen Udluft. Particle swarm optimization for generating interpretable fuzzy reinforcement learning policies. Engineering Applications of Artificial Intelligence, 65:87-98, 2017.
+Daniel Hein, Steffen Udluft, and Thomas A Runkler. Interpretable policies for reinforcement learning by genetic programming. Engineering Applications of Artificial Intelligence, 76:158-169, 2018.
+Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+John D Hunter. Matplotlib: A 2d graphics environment. Computing in science & engineering, 9 (03):90-95, 2007.
+Borja Ibarz, Jan Leike, Tobias Pohlen, Geoffrey Irving, Shane Legg, and Dario Amodei. Reward learning from human preferences and demonstrations in atari. Advances in neural information processing systems, 31, 2018.
+Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. Adaptive mixtures of local experts. Neural computation, 3(1):79-87, 1991.
+Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
+Zoe Juozapaitis, Anurag Koul, Alan Fern, Martin Erwig, and Finale Doshi-Velez. Explainable reinforcement learning via reward decomposition. In *IJCAI/ECAI Workshop on explainable artificial intelligence*, 2019.
+Eoin M Kenny, Mycal Tucker, and Julie Shah. Towards interpretable deep reinforcement learning with human-friendly prototypes. In The Eleventh International Conference on Learning Representations, 2023.
+Been Kim, Rajiv Khanna, and Oluwasanmi O Koyejo. Examples are not enough, learn to criticize! criticism for interpretability. Advances in neural information processing systems, 29, 2016.
+Anurag Koul, Sam Greydanus, and Alan Fern. Learning finite state representations of recurrent policy networks. arXiv preprint arXiv:1811.12530, 2018.
+Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541-551, 1989.
+Robert Lindsey, Aaron Daluiski, Sumit Chopra, Alexander Lachapelle, Michael Mozer, Serge Singular, Douglas Hanel, Michael Gardner, Anurag Gupta, Robert Hotchkiss, et al. Deep neural network improves fracture detection by clinicians. Proceedings of the National Academy of Sciences, 115(45):11591-11596, 2018.
+
+Guan-Ting Liu, En-Pei Hu, Pu-Jen Cheng, Hung-Yi Lee, and Shao-Hua Sun. Hierarchical programmatic reinforcement learning via learning to compose programs. arXiv preprint arXiv:2301.12950, 2023.
+Guiliang Liu, Oliver Schulte, Wang Zhu, and Qingcan Li. Toward interpretable deep reinforcement learning with linear model u-trees. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2018, Dublin, Ireland, September 10-14, 2018, Proceedings, Part II 18, pp. 414-429. Springer, 2019.
+MingYu Lu, Zachary Shahn, Daby Sow, Finale Doshi-Velez, and H Lehman Li-wei. Is deep reinforcement learning ready for practical applications in healthcare? a sensitivity analysis of dueldqn for hemodynamic management in sepsis patients. In AMIA Annual Symposium Proceedings, volume 2020, pp. 773. American Medical Informatics Association, 2020.
+Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540):529-533, 2015.
+Christoph Molnar, Giuseppe Casalicchio, and Bernd Bischl. Interpretable machine learning-a brief history, state-of-the-art and challenges. In ECML PKDD 2020 Workshops: Workshops of the European Conference on Machine Learning and Knowledge Discovery in Databases (ECML PKDD 2020): SoGood 2020, PDFL 2020, MLCS 2020, NFMCP 2020, DINA 2020, EDML 2020, XKDD 2020 and INRA 2020, Ghent, Belgium, September 14-18, 2020, Proceedings, pp. 417-431. Springer, 2021.
+Guido F Montufar, Razvan Pascanu, Kyunghyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks. Advances in neural information processing systems, 27, 2014.
+Ramaravind K Mothilal, Amit Sharma, and Chenhao Tan. Explaining machine learning classifiers through diverse counterfactual explanations. In Proceedings of the 2020 conference on fairness, accountability, and transparency, pp. 607-617, 2020.
+Alexander Mott, Daniel Zoran, Mike Chrzanowski, Daan Wierstra, and Danilo Jimenez Rezende. Towards interpretable reinforcement learning using attention augmented agents. Advances in neural information processing systems, 32, 2019.
+Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. Advances in neural information processing systems, 31, 2018.
+Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807-814, 2010.
+Ju Gang Nam, Sunggyun Park, Eui Jin Hwang, Jong Hyuk Lee, Kwang-Nam Jin, Kun Young Lim, Thienkai Huy Vu, Jae Ho Sohn, Sangheum Hwang, Jin Mo Goo, et al. Development and validation of deep learning-based automatic detection algorithm for malignant pulmonary nodules on chest radiographs. Radiology, 290(1):218-228, 2019.
+Soroush Nasiriany, Vitchyr Pong, Steven Lin, and Sergey Levine. Planning with goal-conditioned policies. Advances in Neural Information Processing Systems, 32, 2019.
+Spyros Orfanos and Levi HS Lelis. Synthesizing programmatic policies with actor-critic algorithms and relu networks. arXiv preprint arXiv:2308.02729, 2023.
+Georg Ostrovski, Pablo Samuel Castro, and Will Dabney. The difficulty of passive learning in deep reinforcement learning. Advances in Neural Information Processing Systems, 34:23283-23295, 2021.
+
+Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. arXiv preprint arXiv:1511.06342, 2015.
+Razvan Pascanu, Guido Montufar, and Yoshua Bengio. On the number of response regions of deep feed forward networks with piece-wise linear activations. In 2nd International Conference on Learning Representations, ICLR 2014, 2014.
+Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
+Wenjie Qiu and He Zhu. Programmatic reinforcement learning without oracles. In International Conference on Learning Representations, 2021.
+Aravind Rajeswaran, Kendall Lowrey, Emanuel V Todorov, and Sham M Kakade. Towards generalization and simplicity in continuous control. Advances in Neural Information Processing Systems, 30, 2017.
+Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should i trust you?" explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 1135-1144, 2016.
+Cynthia Rudin. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature machine intelligence, 1(5):206-215, 2019.
+Simon Schmitt, Jonathan J Hudson, Augustin Zidek, Simon Osindero, Carl Doersch, Wojciech M Czarnecki, Joel Z Leibo, Heinrich Kuttler, Andrew Zisserman, Karen Simonyan, et al. Kickstarting deep reinforcement learning. arXiv preprint arXiv:1803.03835, 2018.
+John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889-1897. PMLR, 2015.
+David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354-359, 2017.
+Dylan Slack, Sophie Hilgard, Emily Jia, Sameer Singh, and Himabindu Lakkaraju. Fooling lime and shap: Adversarial attacks on post hoc explanation methods. In Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society, pp. 180-186, 2020.
+Dylan Slack, Anna Hilgard, Himabindu Lakkaraju, and Sameer Singh. Counterfactual explanations can be manipulated. Advances in neural information processing systems, 34:62-75, 2021.
+Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In International conference on machine learning, pp. 3319-3328. PMLR, 2017.
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
+Richard S Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181-211, 1999.
+Yunhao Tang and Shipra Agrawal. Discretizing continuous action space for on-policy optimization. In Proceedings of the aaai conference on artificial intelligence, volume 34, pp. 5981-5988, 2020.
+Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdelmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
+Dweep Trivedi, Jesse Zhang, Shao-Hua Sun, and Joseph J Lim. Learning to synthesize programs as interpretable and generalizable policies. Advances in neural information processing systems, 34: 25146-25163, 2021.
+
+United Kingdom. Establishing a pro-innovation approach to regulating ai, 2023a. URL https://www.gov.uk/government/publications/ establishing-a-pro-innovation-approach-to-regulating-ai/ establishing-a-pro-innovation-approach-to-regulating-ai-policy-statement.
+United Kingdom. A pro-innovation approach to ai regulation, 2023b. URL https://www.gov.uk/government/publications/ ai-regulation-a-pro-innovation-approach.
+United States of America. Blueprint for an ai bill of rights: Making automated systems work for the american people, 2022. URL https://www.whitehouse.gov/ostp/ai-bill-of-rights.
+Stefan Van Der Walt, S Chris Colbert, and Gael Varoquaux. The numpy array: a structure for efficient numerical computation. Computing in science & engineering, 13(2):22-30, 2011.
+Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q-learning. In Proceedings of the AAAI conference on artificial intelligence, volume 30, 2016.
+Guido Van Rossum and Fred L Drake Jr. Python tutorial, volume 620. Centrum voor Wiskunde en Informatica Amsterdam, The Netherlands, 1995.
+Helena Vasconcelos, Matthew Jörke, Madeleine Grunde-McLaughlin, Tobias Gerstenberg, Michael S Bernstein, and Ranjay Krishna. Explanations can reduce overreliance on ai systems during decision-making. Proceedings of the ACM on Human-Computer Interaction, 7(CSCW1): 1-38, 2023.
+Abhinav Verma, Vijayaraghavan Murali, Rishabh Singh, Pushmeet Kohli, and Swarat Chaudhuri. Programmatically interpretable reinforcement learning. In International Conference on Machine Learning, pp. 5045-5054. PMLR, 2018.
+Maxime Wabartha, Audrey Durand, Vincent Francois-Lavet, and Joelle Pineau. Handling black swan events in deep learning with diversely extrapolated neural networks. In Proceedings of the Twenty-Ninth International Conference on International Joint Conferences on Artificial Intelligence, pp. 2140-2147, 2021.
+Sandra Wachter, Brent Mittelstadt, and Chris Russell. Counterfactual explanations without opening the black box: Automated decisions and the gdpr. Harv. JL & Tech., 31:841, 2017.
+Denis Yarats and Ilya Kostrikov. Soft actor-critic (sac) implementation in pytorch. https://github.com/denisyarats/pytorch_sac, 2020.
+Denis Yarats, Amy Zhang, Ilya Kostrikov, Brandon Amos, Joelle Pineau, and Rob Fergus. Improving sample efficiency in model-free reinforcement learning from images. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 10674-10681, 2021.
+
+# A POST-HOC, DISTILLATION AND FUNCTIONAL INTERPRETABILITY
+
+We begin by setting the context of interpretability in machine learning. We wish to explain a deployed model and its predictions to users of varying expertise. There exists three main approaches to do so:
+
+- A post-hoc method is an auxiliary model that extracts explanations from a complex (potentially a black box), well-performing deployed model (Ribeiro et al., 2016; Kim et al., 2016; Wachter et al., 2017; Sundararajan et al., 2017; Mothilal et al., 2020). We can expect good performance from the deployed model. However, the explanations are provided by the auxiliary model, which raises questions about their reliability, their accuracy or their robustness (Alvarez-Melis & Jaakkola, 2018; Rudin, 2019; Slack et al., 2020; 2021).
+- Distillation methods first train a complex "teacher" model, and then fit and deploy a simpler "student" model on the predictions of the teacher (Hinton et al., 2015; Liu et al., 2019). The explanations come from the interpretable nature of the student (e.g. a shallow decision tree or a linear model). Yet, defining the data distribution to fit the student on can be challenging, especially in the DRL setting (Fujimoto et al., 2019; Ostrovski et al., 2021).
+- Functional methods (Doshi-Velez & Kim, 2017) directly train an interpretable model, which is deployed and explain its decisions (Rudin, 2019; Kenny et al., 2023). The end-to-end approach to interpretability often imposes limits on expressivity that can imply a performance trade-off.
+
+In this work, we focus on functional interpretability. To achieve it, one can reduce the size of the class that the model belongs to (Rudin, 2019). Classes of functions that can be expressed through a small number of parameters, such as linear functions or shallow decision trees, are often considered to be interpretable due to the reduced amount of information required to understand the function they realize (Molnar et al., 2021). Yet, designing such a model is challenging, since inherently interpretable models are at odds with the complexity and expressivity required to solve hard tasks. For instance, a linear policy might not be expressive enough to solve an intricate maze. Moreover, the inclusion of discrete components, while often involved in interpretable models (Doshi-Velez & Kim, 2017), can make training unstable.
+
+# B REDUCING THE SIZE OF THE NETWORK TO LIMIT ITS COMPLEXITY
+
+# B.1 THEORETICAL ANALYSIS
+
+Reducing the width or the height of an MLP is an alternative and more direct way than our proposed approach to reduce the number of unique coefficients. In fact, reducing the size of the MLP also reduces the size of the partition, i.e. the number of linear regions, on the contrary to our proposed solution. The main issue with this approach is that controlling the number of unique coefficients becomes impractical, since the maximum number of linear regions (which is the quantity we have control over) grows at least exponentially w.r.t. the depth and polynomially w.r.t. the width of the network (Montufar et al., 2014, Corollary 5). For instance, a relatively small MLP with a one-dimensional input and 2 layers of 64 neurons each can express a maximum of over 4000 linear regions (Montufar et al., 2014, Theorem 4). Finally, accessing the linear coefficient for a given feature $x_{i}$ requires a backward pass when using an MLP, while it can be directly outputted as part of our solution, since we compute this quantity explicitly in the forward pass.
+
+# B.2 EMPIRICAL ANALYSIS
+
+We complement the theoretical analysis of the upper bound by an empirical analysis of the actual number of unique linear regions used by small variants of the Soft Actor Critic algorithm (SAC). To do so, we train variants of SAC with an MLP actor architecture of depth 1, 2 and 3 and width of 2, 4, 8, 16, 32, 64, 128 and 256 units. We then roll out each variant in the Cheetah run environment (prone to sub-policy re-use due to the periodicity of the task) 10 times. We repeat the procedure for 10 seeds, which gives us, for each variant, 100 measures of the episode return (performance metric), and 100 number of unique sub-policies used (USPU) during the trajectory (complexity metric). We then produce a Pareto plot illustrating the trade-off between complexity and performance for small
+
+
+Figure 6: Pareto plot comparing the HyperCombinator actor and SAC with different small architectures on performance (y-axis, higher is better) and number of sub-policies used during a trajectory (x-axis, lower is better). Note the inversion of the x-axis, such that the best models are located in the top right part of the plot (with high return and low number of unique sub-policies used). We display error bars representing the $95\%$ bias corrected and accelerated bootstrap confidence intervals (9999 resamples).
+
+SAC architectures, in Fig. 6. We also compare the small variants of SAC with 2 variants of the HyperCombinator, respectively with 8 (HC8) and 64 (HC64) possible sub-policies.
+
+We observe that overall, the performance of SAC is correlated with the number of unique sub-policies used during a trajectory. As a consequence, models with a small USPU metric tend to perform significantly worse than the more complex variants. For instance, to reach an average return of 700, variants of SAC need at least 200 unique sub-policies. This means that in average, each sub-policy is used only 5 times during a trajectory. In addition, if we limit the complexity to 100 USPU, the average return of SAC variants barely surpasses 600, well below the average return of 800 reached by the more complex SAC variants. Conversely, our proposed approach offers a better tradeoff between complexity and performance SAC. Indeed, HC8 and HC64 are located further than the SAC Pareto front, as they manage to obtain significantly higher return for comparable complexity, or equivalently a comparable return with a much smaller number of unique sub-policies used. While in this particular example, HC8 outperforms even the SAC variants with the biggest architectures (see also Fig. 12), we insist specifically on the excellent performance of HC8 and HC64 w.r.t. SAC variants that use a comparable number of USPU.
+
+In conclusion, simply limiting the architecture of SAC is not an adapted solution to our problem, since one cannot exactly control the number of unique sub-policies that will be used, and since the performance decreases severely for low number of unique sub-policies used $(< 100)$ , even more so with very low number of unique sub-policies used $(< 10)$ .
+
+# B.3 L1 PENALTY
+
+We consider adding an L1 penalty on the parameters of the actor. The goal is to encourage sparse policies, that would hopefully use less linear sub-policies within a trajectory. We consider various L1 penalties, as well as a small (1 layer of 4 units), medium (one layer of 32 units) and big (two layers of 1024 units) architectures. We illustrate the results in Table B.3. We observe that for the combinations that were tried, the L1 penalty was not sufficient to reach a satisfying performance-interpretability trade-off.
+
+
architecture & penalty
episode reward (95% CI)
unique count (95% CI)
big, λ = 1e-4
0.8 (0.7, 0.9)
1.0 (1, 1)
big, λ = 1e-5
814.8 (804.0, 824.7)
917.4 (902.6, 928.9)
big, λ = 1e-6
760.7 (724.5, 789.1)
965.9 (948.5, 978.5)
big, λ = 1e-7
822.6 (782.2, 838.8)
962.1 (940.4, 978.8)
med, λ = 1e-1
0.1 (0.1, 0.1)
1.0 (1, 1)
med, λ = 1
0.1 (0.1, 0.1)
1.0 (1, 1)
med, λ = 2.5
0.1 (0.1, 0.1)
1.0 (1, 1)
med, λ = 10
0.1 (0.1, 0.1)
1.0 (1, 1)
small, λ = 1e-4
390.8 (368.1, 400.0)
4.4 (3.9, 4.9)
small, λ = 1e-5
428.7 (413.2, 445.4)
9.7 (8.8, 10.5)
small, λ = 1e-6
417.4 (393.7, 436.8)
5.6 (4.9, 6.3)
small, λ = 1e-7
384.7 (338.3, 425.5)
4.5 (4.2, 4.9)
+
+# B.4 DISTILLATION
+
+An alternative to learning a small policy with reinforcement learning is to first train a complex policy with reinforcement learning (a teacher) and then fit in a supervised learning fashion a small policy (a student) to imitate the actions predicted by the teacher. We now compare the HyperCombinator to such a strategy in the Cheetah run task.
+
+We first train to convergence a SAC agent with two hidden layers of 1024 units, following the baseline hyperparameters detailed in D.1. We repeat the experiment over 3 seeds, and select the seed with the highest episode return averaged over 10 rollouts. The corresponding agent is referred to as the (fully trained) teacher. We save the replay buffer, which contains the sequence of observations that the teacher encountered over training. We then label each observation with the action predicted by the fully trained teacher. This methodology yields a dataset of 1M observations and the corresponding ideal action.
+
+We now focus on training the student on this dataset. We minimize the mean squared error between the student predicted action and the teacher predicted action for each observation in the dataset. We detail the hyperparameters in Table 1. In addition, we compare results for different batch sizes (256 and 1024) and 11 penalty coefficients $(\lambda_{\mathrm{L1}} \in \{1e - 6, 1e - 5, 1e - 4, 1e - 3\})$ .
+
+
Hyperparameter name
Value
Student actor architecture
[32]
Optimizer
Adam
Learning rate
1e-3
+
+Table 1: List of hyperparameters in the distillation experiments.
+
+Performance is evaluated several times during training by rolling out the student in the Cheetah run task and recording the rollout return. We repeat this operation 10 times and compute the average rollout return. We repeat the experiment over 5 different seed and average the results, and compute $95\%$ bootstrap confidence intervals. We illustrate this curve in Fig. 7, where we also plot the return curve for HC8. We observe that all the different students failed at getting an acceptable performance in the task. We observe that no combination of hyperparameter led to a well-performing student in
+
+
+Figure 7: Students trained to imitate the teacher fail catastrophically.
+
+
+Figure 8: Training loss curves for each student combination.
+
+this task. Students that were distilled from the teacher did not manage to learn to solve the task. In addition, high L1 penalty coefficient degraded performance.
+
+We also plot in log scale the training curves in Fig. 8, to illustrate that the students do learn to minimize the error with the teacher predictions. The lower capacity of the students, which forces them to make prediction errors at potential key states in the trajectory, is a possible reason for their catastrophic performance.
+
+
+Figure 9: Input augmentation does not improve the performance of the agent.
+
+We also consider training periodically the student on inputs that it generates itself, which is referred to "input augmentation" in Verma et al. (2018). We evaluate the student every 80 student updates (corresponding to 20480 data points with a batch size of 256). The 10 evaluation rollouts generate each 1000 observations, leading to 10000 inputs that were generated by the student interacting with the environment. We train the student on these inputs at the end of the 10 evaluation rollouts, and then resume training on the teacher data. We show in Fig. 9 that input augmentation does not improve the performance of the student in our case.
+
+Finally, we presented one way to distill a teacher into a student network. We note that there are other ways we could implement distillation algorithms, for instance by mixing on-policy distillation and a reinforcement learning loss (Schmitt et al., 2018), or adding a feature regression objective to the reinforcement learning loss (Parisotto et al., 2015). All of these methods add an additional inductive bias compared to our algorithm. One could also modify the training data, for instance by using a more exploratory expert policy to gather a wider range of data points.
+
+
+Figure 10: Training loss curve with input augmentation. We hypothesize the spikes are due to training the low-capacity student on the data it generated, which differs significantly from the data generated by the teacher.
+
+
+Figure 11: During a trajectory, a SAC actor visits a new linear region (and uses a new locally linear sub-policy) at almost every timestep. On the contrary, our HC agent can only express one of the 8 or 64 sub-policies at his disposal, which forces it to learn sub-policies that are valid for a wide range of inputs.
+
+# C SUB-POLICIES REUSE
+
+Since SAC uses an MLP as the policy, the policy is also a piecewise-linear function. We study in this section how often does the policy re-use the same linear region in a trajectory.
+
+We perform the experiment using the trained models of Sec. 4.1, on the Cheetah run environment, which is particularly favorable to the reuse of sub-policies. We rollout the trained policies of SAC, HC8 and HC64 for an entire trajectory and record, for each timestep, the number of unique sub-policies used to interact with the environment until the current timestep. This yields a non-decreasing sequence of integers per algorithm. The lower the curve, and the less sub-policies are being used by the policy. We repeat the same procedure 10 times, and compute the mean curve as well as a $95\%$ confidence interval using the bias corrected and accelerated bootstrap (9999 resamples).
+
+We display the results in Fig. 11. The HyperCombinator cannot express more than $d_G$ sub-policies, which caps the corresponding plots for both HC8 and HC64. We observe that the curve corresponding to SAC linearly increases almost without failure. This indicates that SAC barely reuses past sub-policies, i.e. that a new locally linear function is applied at practically each timestep. Moreover, this sub-policy is shared by all seeds, given the thinness of the confidence interval.
+
+This does not mean that SAC strictly overfitted the trajectory or completely memorized the sequence of policies to apply during the trajectory: indeed, there is a great amount of parameter sharing between the linear coefficients in $\theta$ . Thus, there is generalization happening between sub-policies, even if a different linear region is used at each timestep. Yet, the precise generalization mechanism is obscure, and it is not clear to what extent updating a sub-policy will affect the other sub-policies. Perhaps more importantly to our use case, one still needs to enumerate all of the sub-policies when describing the possible interactions of the policy with the environment, given that even though they might share parameters, each sub-policy uses a different set of linear coefficients. As a consequence, this makes the SAC policy highly uninterpretable, on the contrary to the HyperCombinator where the size of the exhaustive list of sub-policies is capped by $d_{G}$ .
+
+# D CONTROL EXPERIMENTS
+
+# D.1 IMPLEMENTATION DETAILS
+
+We base ourselves on an open-source PyTorch implementation of SAC (Yarats & Kostrikov, 2020) with its default hyperparameters, listed in Table 3. We detail below the modifications needed to implement the HyperCombinator and replicate the experiments, and keep the rest of the existing code for training and evaluating SAC and HC.
+
+SAC algorithm We modify the actor of the Soft Actor Critic algorithm (SAC) (Haarnoja et al., 2018), a strong continuous control agent learning from proprioceptive observations. The original actor is modeled as an MLP that predicts a vector of size $2|\mathcal{A}|$ . The output vector is then split into two parts, the mean of the action predictive distribution, $\tilde{\pi}$ and its log standard deviation, $\log \sigma$ . We note that this implies that the mean $\tilde{\pi}$ and the log std $\log \sigma$ share some of their parameters through the shared structure of the actor. The log standard deviation is transformed to belong to the interval $[\log \sigma_{\min}, \log \sigma_{\max}]$ using the following formula:
+
+$$
+t (u) = \log \sigma_ {\min } + \left(\log \sigma_ {\max } - \log \sigma_ {\min }\right) \cdot \frac {u + 1}{2} \tag {4}
+$$
+
+Finally, the action predictive distribution for state $x$ is defined as a squashed normal:
+
+$$
+\mu \left(\mathcal {N} (\tilde {\pi} (x), \exp t (\log \sigma (x)))\right) \tag {5}
+$$
+
+where $\mu$ is the non-linear transformation ensuring that the action belongs to the environment action space. In practice for the DeepMind Control Suite, we use tanh as $\mu$ to force the predicted actions to belong to $[-1, 1]$ .
+
+The critic is learnt via double Q learning (Van Hasselt et al., 2016). Each critic network is a 2-layer MLP. The strength of SAC entropy regularization (represented by the hyperparameter $\alpha$ ) is automatically learnt during training. We use Adam to optimize all parameters. All weight matrices are initialized using orthogonal initialization. All bias vectors are initialized to 0.
+
+HyperCombinator modifications With the HyperCombinator, we model the mean $\tilde{\pi}$ and the log std $\log \sigma$ with independent networks. HC first models $\log \sigma$ as an MLP with the same architecture as in SAC, but that only outputs a vector of size $|\mathcal{A}|$ . Then, HC models $\tilde{\pi}$ as a Gumbel network, that is, the composition of an MLP, a Gumbel-Softmax layer (with the straight-through estimator) and a linear layer. The rest of the computation of the action predictive distribution is left unchanged. In particular, for $x$ , the mean of the squashed normal is in both cases $\mu(\tilde{\pi}(x))$ and does not depend on $\log \sigma(x)$ .
+
+We detail the modified SAC algorithm using Alg. 1. We indicate in blue the modifications due to using a HyperCombinator actor. We remark that the only major modification is in the architecture of the actor. Therefore, the majority of the structure of the SAC algorithm is left unchanged. We notice the use of stop_grad to detach a tensor from the computation graph.
+
+Training details Classically, Gumbel noise is used in the Gumbel-Softmax layer to stochastically select the sub-policy. After sufficient training, this (Gumbel) trick ensures that we ultimately sample from the likeliest sub-policy. We only activate Gumbel noise during the actor update, when computing the action predicted by the actor. When the agent interacts with the environment, we do not use Gumbel noise, both for training and for evaluation. Therefore, the Gumbel network selects the most likely sub-policy for all interactions with the environment. This ensures that the mean of the action predictive distribution is deterministic, like SAC. It also improves the consistency of the agent over an episode, since for state $x$ , a fixed policy leads to the same sub-policy. This is not to be confused with the action predicted by the HyperCombinator, which is sampled from the squashed normal defined in Eq. 5 during training.
+
+Model choice We experiment with different combination of hyperparameters values (Gumbel network architecture from [64,64] to [1024,1024,1024], and strength of regularization of the average assignation entropy $\lambda_{\mathrm{assig}}$ from 0 to 1) on Cheetah run, from where we selected the best set of hyperparameters according to the return curve. We then evaluate the HyperCombinator using the same fixed set of hyperparameters for all the environments.
+
+Evaluation details We evaluate the agent every 10000 timesteps by rolling it out for 10 episodes and taking the average return. During evaluation, all actors act deterministically using only the mean of the predicted action distribution $\mu (\tilde{\pi} (x))$ , without exploration noise (as opposed to sampling from the predictive action distribution during training). Hence, it is sufficient for $\mu (\tilde{\pi})$ to be piecewise-linear to get the desired form for the actor at evaluation time. We report all results and curves in Sec. 4.1 using 10 seeds for each agent. We draw the mean performance as a colored line, as well as a $95\%$ bias-corrected and accelerated bootstrap confidence interval in a lighter shade (9999 resamples).
+
+Compute We ran all the experiments on an internal cluster. All the GPUs were NVIDIA Tesla V100, with 16GB memory available. The CPUs were Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz Each seed was allocated 1 GPU, 10 CPUs, and 64GB of RAM. We detail the compute budget to reproduce the experiments in Table. 2.
+
+
Experiment
# models
# envs
# seeds
Avg. duration
Compute
Full results (Fig. 12)
3
23
10
6 hours
173 GPU days
Longer horizon (Fig. 16)
3
4
10
34 hours
170 GPU days
Perf.-interpret. gap (Fig. 17)
8
1
10
17 hours
57 GPU days
Small SAC (Fig. 6)
24 (*)
1
10
6 hours
60 GPU days
+
+Table 2: Compute budget for the control experiments. (*) the HyperCombinator plots were already computed in the full results.
+
+
Hyperparameter name
Value
Common (SAC defaults) (Yarats & Kostrikov, 2020)
Action repeat
1
Discount factor
0.99
Learnable α
True
Initial α
0.1
α learning rate λα
1e-4
α Adam momentum
[0.9, 0.999]
Actor learning rate λπ
1e-4
Actor Adam momentum
[0.9, 0.999]
Actor update frequency
1
Critic architecture
[1024, 1024]
Critic learning rate λQ
1e-4
Critic Adam momentum
[0.9, 0.999]
Critic exponential moving average ratio
0.005
Critic target update frequency
2
Batch size
1024
log σmin
-5
log σmax
2
SAC actor-specific
Actor architecture1
[1024,1024]
HyperCombinator-specific
Gumbel net architecture
[1024, 1024, 1024]
Sub-policy assignation entropy coefficient λassig
0.001
Gumbel temperature
1
+
+Table 3: Full list of hyperparameters in the control experiments.
+
+Algorithm 1 SAC (with HyperCombinator actor)
+Require: Replay Buffer $\mathcal{D}$
+Require: Actor parameters $\varphi$
+Require: Double critic parameters $\eta_1, \eta_2$
+Require: Double critic target parameters $\overline{\eta}_1, \overline{\eta}_2$
+Require: Hyperparameters from Table 3
+Require: $N$ ▷ Maximum number of timesteps
+Require: $s_0$ ▷ Initial state
+while $t < N$ do
+ $a_t \sim \mu(\tilde{\pi}(s_t))$ $s_{t+1} \sim P(\cdot | s_t, a_t)$ ▷ Sample the next state from the environment
+ $r_{t+1} = R(s_t, a_t, s_{t+1})$ $\mathcal{D} = \mathcal{D} \cup (s_t, a_t, r_{t+1}, s_{t+1}, d_{t+1})$ ▷ Update replay buffer; $d_{t+1}$ indicates a terminal transition
+ $(s, a, r, s', d) \sim \mathcal{D}$ ▷ Sample from replay buffer
+Launch routine UpdateCritic ▷ See paper (Haarnoja et al., 2018) and code²
+if $t\%$ actor update frequency == 0 then
+Launch routine UpdateActorAndAlpha (see Alg. 2)
+end if
+if $t\%$ critic target update frequency == 0 then
+ $\overline{\eta}_1 = (1 - \text{critic ema ratio}) * \overline{\eta}_1 + \text{critic ema ratio} * \eta_1$ $\overline{\eta}_2 = (1 - \text{critic ema ratio}) * \overline{\eta}_2 + \text{critic ema ratio} * \eta_2$
+end if
+end while
+
+# Algorithm 2 UpdateActorAndAlpha
+
+Require: $s$ $\triangleright$ Batch of states sampled from the replay buffer $a\sim \mu (\mathcal{N}(\tilde{\pi} (s),\exp (t(\log \sigma (s))))\triangleright \tilde{\pi}$ is a Gumbel network and log $\sigma$ an MLP instead of being jointly parametrized as an MLP in the base case.
+ $\mathcal{L}_{\mathrm{assig}} = H(\mathrm{mean}(\hat{a} (s)))$ $\triangleright$ Compute entropy of average sub-policy assignation
+ $Q = \min (Q_{\eta_1}(s,a),Q_{\eta_2}(s,a))$ $\mathcal{L}_{\pi} =$ mean (stop_grad $(\alpha)\log \pi (a|s) - Q) - \lambda_{\mathrm{assig}}\mathcal{L}_{\mathrm{assig}}\triangleright$ Do not backprop. gradients through $\alpha$ $\varphi = \varphi -\lambda_{\pi}\nabla_{\varphi}\mathcal{L}_{\pi}$
+if learn $\alpha$ then
+ $\mathcal{L}_{\alpha} = \mathrm{mean}(\alpha \mathrm{stop\_grad}(\log \pi (a|s) + |\mathcal{A}|))$ $\alpha = \alpha -\lambda_{\alpha}\nabla_{\alpha}\mathcal{L}_{\alpha}$
+end if
+
+# D.2 RESULTS FOR ALL DEEPMIND CONTROL ENVIRONMENTS
+
+
+Figure 12: Complete results for the DM control environments.
+
+# D.3 DETAILED QUANTITATIVE RESULTS
+
+To compute the results, we followed the methodology proposed in the rliable library (Agarwal et al., 2021). We used the final scores after 990000 frames for each run.
+
+We first investigate the scores produced by rliable in Fig. 13. This lets us quantify the trade-off in performance that follows the reduction in expressivity of HC8 and HC64 according to several metrics. In particular, the overlapping confidence intervals between SAC and HC64 indicate that overall, a very small amount of performance is foregone when one is willing to guarantee that the agent will interact with the environment in at most 64 different ways.
+
+Fig. 14 illustrates the close performance between SAC and HC64, especially in the environments where the normalized score is at least $80\%$ of the maximum (i.e., in the games where SAC excels to begin with). HC8 follows a similar curve, albeit sensibly lower.
+
+Finally, Fig. 15 shows the fraction of environments where the normalized score IQM of HC8 (respectively HC64) is at least a percentage of the baseline SAC score. This visualization is helpful
+
+to distinguish the relative performance of the HC actors, compared to SAC, on the different environments. We remark that both for HC8 and HC64, there is a sudden drop around the $0\%$ relative performance mark, which indicates that HC8 and HC64 have close IQM scores to SAC in several of the environments. Moreover, HC8 and HC64 perform worse than SAC on most environments by the end of training, as expected.
+
+
+Figure 13: Performance metrics computed using the rliable library.
+
+
+Figure 14: Performance profiles.
+
+
+Figure 15: Relative performance loss/gain of the HC actors compared to SAC.
+
+# D.4 LONGER HORIZON
+
+In this section, we train the different actors for 5M steps instead of 1M as in the rest of Sec. 4.1. We focus our study on 4 environments: the first is Cheetah run, to observe if the benefits brought to early training by the usage of the HyperCombinator are also transferred to later during the training. The other 3 other environments, Humanoid stand, walk and run, are chosen for their increased difficulty. We illustrate the results in Fig. 16. We remark that HC actors improve over SAC for the first 1M timesteps in the Cheetah run environment. After approximately 1M timesteps, the performance of the SAC actor exceeds the HyperCombinator's. For Humanoid run and stand, both Hypercombinator improve over SAC approximately between 1M and 3M timesteps, with a significant improvement noted for Humanoid stand. For Humanoid walk, only HC64 improves over SAC, here again approximately between 1M and 3M timesteps. The competitive performance of the HyperCombinator actors, added to their improved performance in these hard environments early during training, hints at the benefits of sub-policies re-use. Still, we note that given sufficiently many samples, the more complex neural policies of SAC outperform HC. This recalls the trade-off between interpretability and performance observed in the long run, induced by choosing a lower complexity policy when using HC.
+
+
+Figure 16: During early training, HC actors can demonstrate a better sample efficiency thanks to the re-use of the same sub-policy for several inputs. Over a longer timeframe, the higher expressivity of SAC leads to matching or better performance.
+
+# D.5 PERFORMANCE-INTERPRETABILITY GAP
+
+In this section, we evaluate how the HyperCombinator agent's performance evolves when increasing the number of sub-policies. We run a HyperCombinator actor with 4, 8, 16, 32, 64, 128 and 256 sub-policies on Walker walk for 2.5M timesteps, and observe the results in Fig. 17.
+
+We remark that HC4 reaches a relatively high return, in average higher than 900. This shows that even with a small number of sub-policies, the HyperCombinator can learn a well performing policy in certain environments. As we trade-off interpretability for performance by increasing the number of sub-policies, we see the performance curve increase as well and approach the performance curve of SAC. This trend culminates with 128 sub-policies. We notice that the return curve of HC256 decreases compared to HC128.
+
+A HC agent with a higher number of available sub-policies can produce a more finely grained policy, since each sub-policy can specialize to a smaller part of the state space. Conversely, learning how to chain a high number of sub-policies might not be straightforward. This last point is one possible explanation to the lower performance of HC256.
+
+
+Figure 17: Increasing the capacity tends to increase the performance, as the policy is now able to exhibit a wider variety of sub-policies. A sufficiently high capacity can help reach a comparable performance to the base algorithm, here SAC. We notice that too many sub-policies can however prove harmful: the performance of HC256 sub-policies decreases compared to HC128.
+
+# D.6 ROBUSTNESS TO PERTURBATIONS
+
+In this section, we evaluate the robustness of the HyperCombinator to perturbations. We start with a regularly trained agent on the Cheetah run task. At evaluation time, after 100 timesteps (out of a 1000 timesteps trajectory), we ignore the action predicted by the agent and instead interact with the environment through an action sampled uniformly at random from the action space. We do so for 100 consecutive timesteps. At timestep 200, we resume normal evaluation and follow the action predicted by the agent. This perturbation throws the agent off its trajectory.
+
+
+Figure 18: When perturbed with 100 consecutive random actions, HC actors perform overall no worse than SAC. The box plot summarizes the results of the experiment repeated 10 times for each seed.
+
+
+Figure 19: After being perturbed for 100 timesteps, the HC actor manages to resume the task. sub-policy choices between $t = 100$ and 200 (in turquoise) are ignored since a random action is used instead.
+
+We repeat this evaluation 10 times per seed, for each of the 10 seeds of an algorithm, for a total of 100 data points.
+
+We now compare how this perturbation affects HC8 and HC64, compared to the baseline, SAC. In Fig. 18, we compute for each model the distribution of performance losses, defined as the performance of the perturbed evaluation subtracted to the performance of the unperturbed evaluation. We then illustrate the distribution of these performance losses. We see that all models react similarly to the perturbations. This illustrates the fact that the HyperCombinator is no less robust to perturbations than the base neural policy, despite its non-continuity. A similar conclusion was already found when comparing linear models to neural baselines (Rajeswaran et al., 2017). Accordingly, diversifying the initialization distribution could improve the robustness of the model.
+
+We illustrate in Fig. 19 how the agent, after being perturbed for 100 timesteps, manages to resume the cyclical choice of sub-policies that lets it solve the task.
+
+# D.7 ANALYSIS OF THE LINEAR COEFFICIENTS INTERPRETABILITY IN CARTPOLE
+
+We now analyze the low-level interpretability benefits of our method when applied to the Cartpole environment.
+
+In this environment, the agent controls the translation of a cart on an axis in order to swing up and then stabilize a pole. We write the sub-policy $i$ as: $b + w_{x}^{i}x + w_{\sin \theta}^{i}\sin \theta +w_{\cos \theta}^{i}\cos \theta +w_{\dot{x}}^{i}\dot{x} +$ $w_{\dot{\theta}}^{i}\dot{\theta}$ , for an input $(x,\sin (\theta),\cos (\theta),\dot{x},\dot{\theta})$ and sub-policy coefficients $w_{i}^{i}$ . Note that there is a single action: for a given positive feature, the contribution tends to move the cart towards the right if the corresponding coefficient is positive and left if negative.
+
+We visualize the results in Fig. 20. The left plot is an alternative visualization of the sub-policy coefficients $w_{i}$ (to be compared with the heatmap in Fig. 3, right). This is an easy way to note similarities between sub-policies and to understand how they are combined. For instance, HC mainly uses sub-policy B0 (in orange) to stabilize the pole that has been swung up. This is translated by a negative coefficient in front of the cart velocity, such that if the agent moves towards the right (causing the pole to tilting to the left), the sub-policy will push the agent towards the left to balance the pole.
+
+We also see in Fig. 20 (right) that the agent sometimes oscillates between using B0 (orange) and sub-policy 1 (grey). We can observe in the left plot that they both give a large coefficient to $\cos \theta$ , which is around 0 when the pole is stabilized. The positive sign of the coefficient indicates that if the pole
+
+
+Figure 20: Evaluation of HC8 in cartpole swingup. (Left) alternative visualization of the sub-policies. (Right) sub-policy choice sequence.
+
+is tilting towards the right, the agent will tend to move the cart towards the right to balance the pole. Finally, Fig. 20 (left) shows that B2 (red) and B6 (purple) are extremely similar. Simultaneously, we see in Fig. 20 (right) that the only setting in which B6 is used is during an extended period of usage of B2.
+
+We think that this figure is an example of how using a HC actor (rather than a neural one) can improve the interpretability and our understanding of the task.
+
+# D.8 COMPARISON WITH PROGRAMMATIC POLICIES
+
+We compare in this section the HC architecture with the programmatic policy presented in Qiu & Zhu (2021), called $\pi$ -PRL. Their algorithm uses TRPO (Schulman et al., 2015) to learn a tree policy in two phases. In the first phase, the algorithm alternates between learning the probability distribution over the possible trees ("architecture iteration") and learning the parameters of each tree ("program iteration"). A training step is a sequence of (1) gathering data from rollouts, (2) an architecture iteration, (3) gathering data from rollouts, (4) a fine tuning iteration. At the end of this first "fusion" phase, the most probable tree is extracted, and its parameters are fine-tuned during a second "fine-tuning" phase. We refer to the original paper for more precise details about the training scheme of their method. The authors propose several controllers to apply in the leaves of the tree. We focus on affine controllers as they are the one that compare to our method, since each of HC's subpolicies are affine functions.
+
+We focus on the Cheetah run experiment from DM Control. We modify the code provided by the authors to be able to use affine policies in each leaf, similarly to HC. We parameterize the programmatic policy to consider the full state when choosing which branch to follow at an intersection (Eq. 1 of their paper). We repeat the experiments over 10 seeds.
+
+We use the original paper's hyperparameters when available, and we detail the full list in Table 4.
+
+We illustrate the results of the algorithm resulting in a soft tree and a hard (discrete) tree respectively in Fig. 21 and Fig. 22. In both cases, the algorithm does not manage to learn a strong policy in Cheetah run, despite having access to 15 times as many samples as HC and SAC (15M vs 1M, respectively). The algorithm converges in fact to a linear architecture, hence the same plots for the soft and hard trees.
+
+We also plot the performance of a neural policy with two hidden layers and 256 hidden units each trained with TRPO on Cheetah run to showcase a likely upper bound on the performance of $\pi$ -PRL, in Fig. 23. Note that we use 10 times more training samples for TRPO than for HC or SAC in order
+
+
+Figure 21: In Cheetah run, $\pi$ -PRL (affine) did not manage to learn a strong policy.
+
+$\pi$ -PRL (affine, fine-tuned discrete) performance over 10M + 5M training steps
+
+
+Figure 22: In Cheetah run, $\pi$ -PRL (affine and hard decision tree) did not manage to learn a strong policy.
+
+
Hyperparameter name
Value
Action repeat
1
Discount factor γ
0.99
Max graph depth
6
GAE λ
0.97
Num of consecutive architecture iterations
1
Num of consecutive program iterations
1
Total number of “fusion” training step
1000
Total number of “fine-tuning” steps
1000
Samples per data gathering rollout
5000
Baseline architecture
[64,64]
Baseline num epochs
2
Baseline learning rate
1e-3
Baseline batch size
64
+
+Table 4: List of hyperparameters in the programmatic policies comparison.
+
+
+Figure 23: In our setting, TRPO plateaus slightly below 400.
+
+to obtain a good performance with TRPO (10M vs 1M). TRPO and $\pi$ -PRL plateau below an episode return of 400 (lower than SAC or HC).
+
+Since the results of the algorithm are high variance (potentially because of the usage of policies of different capacity depending on the probability distribution over architectures that is learnt), we analyze in Fig. 24 the performance of the best performing seed in the affine, discrete case. We notice that the performance rises quickly to around 400, but stays stuck in this local optimum.
+
+Finally, we note that $\pi$ -PRL is restricted to small architectures (Orfanos & Lelis (2023)), while HC can use deep networks to partition the input space, and instead restricts the number of unique affine sub-policies that can be used.
+
+
+$\pi$ PRL (affine, fine-tuned discrete) performance over $10\mathrm{M} + 5\mathrm{M}$ training steps (seed 0)
+Figure 24: Performance of the best seed, which gets a maximum score of 450.
+
+# D.8.1 ADAPTING PI-PRL TO SAC
+
+We adapt $\pi$ -PRL to be trained with the SAC algorithm. We re-use the hyperparameters from Table 3 and repeat the experiment 8 times. We used half of the training samples budget for the first fusion phase, and half for the second fine-tuning phase. We note that we test $\pi$ -PRL (SAC version) unfairly compared to HC, since $\pi$ -PRL is in this experiment a soft decision tree, as mentioned in Eq. 1 of Qiu & Zhu (2021). As a consequence, the predicted actions from $\pi$ -PRL are a mixture of all the actions in each leaf, which impedes interpretability. On the other hand, HC uses a single linear sub-policy at each timestep.
+
+We show the results in Fig. 25. We note that, besides the first 200k timesteps, the SAC version of $\pi$ -PRL seems to perform below HC. The parameterization that we chose for HC is able to quickly improve the quality of the policy, comparatively to the other algorithms. We recall that even besides this control experiment, as mentioned before, the same architecture of HC is able to handle high level planning tasks, while $\pi$ -PRL does not. In addition, the end-user has the possibility with HC to change its performance interpretability trade-off by increasing the number of sub-policies to use for a marginal cost by simply increasing the size of the Gumbel layer, while the same operation comes at a great computational cost for $\pi$ -PRL (Qiu and Zhu, 2022, Section 3, Complexity; Orfanos et al, Section 2., paragraph 2).
+
+
+Figure 25: Comparison between the SAC version of $\pi$ -PRL and HC.
+
+# E NAVIGATION EXPERIMENTS
+
+# E.1 IMPLEMENTATION DETAILS
+
+We base our experiments on the open-source code provided by RIS (Chane-Sane et al., 2021) $^3$ , and use most of its default hyperparameters. We detail in Table 6 the common hyperparameters and the hyperparameters we change for the HyperCombinator.
+
+RIS algorithm RIS belongs to the family of goal-conditioned RL algorithms, that learn a policy $\pi(s, g)$ . RIS aims at guiding the policy, during training, to produce the same action to reach a goal as the action to reach an imaginary subgoal located halfway through the trajectory. In this case, the notion of distance implied in "halfway" means that as many steps are needed to go from the current state to the imaginary subgoal than from the imaginary subgoal to the goal (as opposed to an Euclidean notion of distance that would not be suitable in mazes).
+
+To do this guiding, a prior policy $\pi_{\mathrm{prior}}$ is defined as an empirical moving average of the online, interacting policy. A neural network (denoted a high-level policy in the original paper) learns online to generate likely subgoals $s_g$ given a state $s$ and a goal $g$ . Then, given state $s$ , the policy $\pi(s, g)$ is constrained to stay close to the prior policy to reach subgoal $s_g$ , i.e. $\pi_{\mathrm{prior}}(s, s_g)$ .
+
+Similarly to SAC, the RIS actor is composed of an MLP on top of which two heads predicting the mean of the action predictive distribution, $\tilde{\pi}(x)$ , and its log standard deviation $\log \sigma(x)$ . $t'$ clamps $\log \sigma(x)$ between $\log \sigma_{\min}$ and $\log \sigma_{\max}$ . The action is then sampled from a squashed normal, similarly to SAC. Two critics, each modeled by a MLP, are learnt with double Q learning. The hyperparameter $\alpha$ ((Chane-Sane et al., 2021, Eq. 9)) is fixed during training. The algorithm uses Hindsight Experience Replay (HER) (Andrychowicz et al., 2017) to facilitate training, and we refer to the RIS paper for further details on the specific implementation (Chane-Sane et al., 2021). All weight matrices are initialized using orthogonal initialization. All bias vectors are initialized to 0.
+
+HyperCombinator modifications We replace $\tilde{\pi}$ by a Gumbel network. Similarly to the control experiments, $\log \sigma$ is still defined by an MLP, but does not share parameters with $\tilde{\pi}$ . As a consequence of the modelisation of $\tilde{\pi}$ , the prior policy $\pi_{\mathrm{prior}}$ also takes the form of a HC policy. We do not modify the rest of the algorithm, including the high-level policy that learns to predict the intermediate goals used for training. Due to memory constraints, we use a batch size of 1024 to train the HyperCombinator, instead of the base 2048. We train RIS with batch sizes of both 1024 and 2048 and ensure that the performance of RIS with 2048 (the base value) improves over the performance with a batch size of 1024. We detail in Alg. 3 the RIS algorithm and add in blue the modifications that we apply.
+
+Training details The agents interact with the environment for a maximum of 600 timesteps, after which the episode is interrupted. We do not use Gumbel noise for any interaction with the environment, which guarantees that the most likely sub-policy is consistently selected. Therefore, sub-policies are stochastically chosen only during the update of the actor, in the UpdateActorAndAlpha routine. During training, the actions are sampled from the action predictive distribution $\mu (\mathcal{N}(\tilde{\pi} (s,g),\exp (t^{\prime}(\log \sigma (s,g))))$ to encourage exploration. We use three different types of regularization to prevent the Gumbel network from collapsing into the prediction of a single sub-policy:
+
+- We increase the temperature of the Gumbel-Softmax, controlled by the "Gumbel temperature" parameter in Table 6.
+- We regularize the entropy of the sub-policy assignations averaged over a batch, controlled by the $\lambda_{\mathrm{assig}}$ hyperparameter.
+- We penalize the magnitude of the last layer weights of the MLP preceding the Gumbel-Softmax, through the $\lambda_{\mathrm{weight~decay}}$ hyperparameter. This forces the input to the Gumbel-Softmax layer to have a smaller magnitude, and therefore encourages the selection of a more diverse set of sub-policies.
+
+Model choice We experiment with different combinations of the architecture of the Gumbel network (from [32,32] to [1024,1024,1024]), the sub-policy assignation entropy coefficient $\lambda_{\mathrm{assig}}$ (between 0 and 0.1), the Gumbel temperature (from .5 to 10), the weight decay coefficient (between 0 and 0.001) and the RIS hyperparameter $\alpha$ (between 0.05 and 0.4) on the U-shaped maze and the $\omega$ -shaped maze (we found that the relative simplicity of U-shaped maze compared to the other environments meant that design architectures useful to solve the U-shaped maze would not always generalize to the other tasks) and select the final set of hyperparameters based on the return curve. We then run the final experiment on all environments, keeping the same hyperparameters for all variants of the HyperCombinator (i.e. HC8, HC16 and HC64).
+
+A notable difference with the control experiments is that we found that smaller Gumbel network architectures worked best. Therefore, we selected a [64, 64, 64] architecture for the navigation experiments, as opposed to [1024, 1024, 1024] for the control experiments. We have overall observed in both control and navigation experiments that a wider and deeper Gumbel network architecture usually requires a stronger regularization to perform well on the task. It is possible that increasing even more the regularization could help the [1024, 1024, 1024]-architecture solve the maze tasks. The success of the smaller architecture and the failure of the bigger one, which such a high regularization of the Gumbel network, is another clue that the key to solving the maze might be to find a trainable and sufficiently regularized architecture that efficiently combines the different sub-policies.
+
+Evaluation details During evaluation, all actors act deterministically using only the mean of the predicted action distribution $\mu (\tilde{\pi} (s,g))$ , without exploration noise (as opposed to sampling from the predictive action distribution during training), which guarantees the piecewise-linearity of the policy. We remark that this departs from the base code, that evaluated stochastic agents.
+
+Every 10000 steps, we roll out 5 evaluation episodes and report the mean success score, i.e. 1 if the agent reached the goal and 0 else. We report all results and curves using 10 seeds for each agent. We draw the mean performance as a colored line, as well as a $95\%$ bias-corrected and accelerated bootstrap confidence interval in a lighter shade (9999 resamples).
+
+Compute We ran all the experiments on an internal cluster. All the GPUs were NVIDIA Tesla V100, with 16GB memory available. The CPUs were Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz. Each seed was allocated 1 GPU, 10 CPUs, and 64GB of RAM. We detail the compute budget to reproduce the experiments in Table. 5.
+
+
Experiment
# models
# envs
# seeds
Avg. duration
Compute
Full results (Fig. 4)
4
4
10
23 hours
153 GPU days
Temperature ablation (Fig. 30)
8
1
10
11 hours
37 GPU days
+
+Table 5: Compute budget for the navigation experiments.
+
+Algorithm 3 RIS (with HyperCombinator actor)
+Require: Replay Buffer $\mathcal{D}$
+Require: Actor parameters $\varphi$
+Require: Double critic parameters $\eta_1, \eta_2$
+Require: Double critic target parameters $\overline{\eta}_1, \overline{\eta}_2$
+Require: High-level policy parameters
+Require: Hyperparameters from Table 6
+Require: $N$
+Require: $s_0, g_0$
+while $t < N$ do
+ $a_t \sim \mu(\tilde{\pi}(s_t, g_t))$ $s_{t+1} \sim P(\cdot | s_t, a_t)$ $r_{t+1} = R(s_t, a_t, s_{t+1})$ $\mathcal{D} = \mathcal{D} \cup (s_t, a_t, r_{t+1}, s_{t+1}, d_{t+1})$
+Transition
+ $(s, a, r, s', d, g) \sim \mathcal{D}$
+Launch routine UpdateCritic
+ $\triangleright$ See paper (Chane-Sane et al., 2021) and code5
+Launch routine UpdateHighLevelPolicy
+ $\triangleright$ See paper (Chane-Sane et al., 2021) and code6
+Launch routine UpdateActorAndAlpha (see Alg. 4)
+ $\overline{\eta}_1 = (1 - \text{critic ema ratio}) * \overline{\eta}_1 + \text{critic ema ratio} * \eta_1$ $\overline{\eta}_2 = (1 - \text{critic ema ratio}) * \overline{\eta}_2 + \text{critic ema ratio} * \eta_2$
+end while
+
+# Algorithm 4 UpdateActorAndAlpha
+
+Require: $s, g$ $\triangleright$ Batch of states and goals sampled from the replay buffer $a \sim \mu(\mathcal{N}(\tilde{\pi}(s, g), \exp(t'(\log \sigma(s, g))))$ $\triangleright$ $\tilde{\pi}$ is a Gumbel network and $\log \sigma$ an independent MLP instead of being a jointly parametrized MLP in the base case. $\mathcal{L}_{\mathrm{assig}} = H(\mathrm{mean}(\hat{a}(s, g)))$ $\triangleright$ Compute entropy of average sub-policy assignation $\mathcal{L}_{\mathrm{weight\_decay}} = ||W||_2^2$ $\triangleright$ Magnitude of the Gumbel network MLP last layer weights $W$ $Q = \min(Q_{\eta_1}(s, a), Q_{\eta_2}(s, a))$ $\mathcal{L}_{\pi} = \mathrm{mean}(\alpha \log \pi(a|s, g) - Q) - \lambda_{\mathrm{assig}}\mathcal{L}_{\mathrm{assig}} + \lambda_{\mathrm{weight\_decay}}\mathcal{L}_{\mathrm{weight\_decay}}$ $\triangleright$ Minimize the magnitude of the Gumbel network last layer weights $\varphi = \varphi - \lambda_{\pi}\nabla_{\varphi}\mathcal{L}_{\pi}$
+
+# Hyperparameter name
+
+# Value
+
+Common (RIS defaults)
+
+
Discount factor γ
0.99
Success distance threshold
0.5
Burn in
1e4
Replay buffer size
1e6
Learning rate for the high-level policy λhigh-level
1e-4
Learning rate for the critics λQ
1e-3
Learning rate for the policy λπ
1e-3
Critic architecture
[256, 256]
Critic empirical moving average ratio
0.005
Critic target update frequency
1
High-level policy architecture
[256, 256]
sub-policy assignation entropy coefficient
1e-4
ε
1e-16
HER replay buffer goals ratio
0.5
λ
0.1
log σmin
-20
log σmax
2
+
+RIS actor-specific
+
+
Actor architecture4
[256, 256]
Batch size
2048
α
0.1
+
+HyperCombinator-specific
+
+
Gumbel net architecture
[64, 64, 64]
Batch size
1024
sub-policy assignation entropy coefficient λassig
0.01
Weight decay coefficient λweight decay
0.0001
Gumbel temperature
7
α
0.3
+
+Table 6: Full list of hyperparameters in the navigation experiments.
+
+# E.2 ADDITIONAL POLICY VISUALIZATIONS
+
+In Fig. 5 we illustrated a typical sequence of sub-policies followed by HC16 on the S-shaped maze. In this section, we propose a wider variety of sub-policy sequences, showing examples where the emergent temporal abstraction appears clearly, and some where this temporal abstraction is harder to spot, or, interestingly, is lost over training. For each situation, we show sub-policy sequences taken during evaluation after .5M, 1M, 1.5M and 2M training steps.
+
+HC8, U-shaped maze (Fig. 26) This figure shows a well-performing HC8 policy in U-shaped maze. We note the clear separation of three phases in the bottom plot, as the quadruped learns to go down the corridor in the first phase, using mostly sub-policy 0 and 1, then turns right and navigates the bottom corridor with sub-policies 2 and 3, before re-using sub-policies 0 and 1 to go up the right corridor and solving the maze.
+
+
+
+
+
+
+
+
+Figure 26: Example of a well-performing HC8 agent in the U-shaped maze.
+
+HC64, $\omega$ -shaped maze (Fig. 27) This figure illustrates the policies learnt by HC64 on the challenging $\omega$ -shaped maze. We particularly note the appearance of "diagonals", where the same sequence of sub-policy is repeated several times. These diagonals recall the sub-policy sequence obtained for Cheetah run in the control experiments, as the agent learnt to chain its sub-policies to move itself. After 100 timesteps in the bottom figure (final evaluation after 2M training steps), HC64 switches from one set of repeated diagonals to another, and barely re-uses the sub-policies forming the first set of repeated diagonals until the end of the trajectory. We conclude that the first set of repeated diagonals was specialized to the first phase of the trajectory.
+
+
+Actual sub-policy taken, 0.5M steps (goal not reached in 600 steps)
+
+
+Actual sub-policy taken, 1M steps (goal not reached in 600 steps)
+
+
+Actual sub-policy taken, 1.5M steps (goal reached in 481 steps)
+
+
+Actual sub-policy taken, 2M steps (goal reached in 354 steps)
+Figure 27: Example run of HC64 solving the $\omega$ -shaped maze. We note the appearance of "diagonals" that are reminiscent of the control experiments.
+
+HC64, U-shaped maze (Fig. 28) We have seen in the previous example that a structure emerged in the sub-policies, learning to repeat chains of sub-policies ("diagonals") to move itself. Fig. 28 illustrates the possible effects of long training on this structure. This structure is particularly present after .5M timesteps, and the sub-policies in the second part of the trajectory are not used during the first part of the trajectory. However, as training progresses, the structure is progressively forgotten, which makes the bottom sub-policy sequence plot harder to read. One possible explanation is that the agent learns to "overfit" the task, resulting in a lower re-use of sub-policies, but a better performance (as evidenced by the progressively lower number of timesteps required to solve the task). This might also be due to the high regularization that we enforced on the Gumbel network, forcing agents to use as many sub-policies as possible.
+
+
+
+
+
+
+
+
+Figure 28: The learnt structure (top plot) can get lost as the agent learns to solve efficiently the maze (bottom plot).
+
+HC16, II-shaped maze (Fig. 29) Fig. 29 finally provides an example of a policy where structure is difficult to observe. HC16 learns to solve the II-shaped maze after 1.5M timesteps, but no particular structure emerges. In addition, we see one example of HC16 forgetting how to solve the maze in the bottom plot. We note that despite this fact, the HyperCombinator architecture guarantees that we can bring transparency to the interaction of the agent with the environment, conditioned on the knowledge of the sub-policy chosen. Notably, we still have access to all the sub-policies that define how HC16 interacts with the environment.
+
+
+
+
+
+
+
+
+Figure 29: HC16 can learn to solve the maze without displaying obvious structure in its sequence of sub-policies (3rd plot).
+
+# E.3 EFFECT OF GUMBEL TEMPERATURE ON PERFORMANCE
+
+We run an ablation to see the effect of changing the temperature hyperparameter, all other hyperparameters being held the same as in the navigation part of Sec. 4. We evaluate the HyperCombinator variants for temperature values of .5, .66, 1, 2, 3, 5, 7 and 10 in the U-shaped maze. In general, a higher temperature value tends to increase the stochasticity of the Gumbel network, meaning that the Gumbel network will be more uncertain of which sub-policy to choose (and will also increase gradient sharing during the backward pass).
+
+We visualize the results of the ablation in Fig. 30. Overall, low temperature values impede learning, and the resulting agents do not succeed in the U-maze. Higher temperature values led to better performing agents, though the overall return curve remains noisy in all cases.
+
+
+Figure 30: Low temperature values lead to insufficient regularization and HC64 fails to solve the maze. Increasing the temperature overall leads to better performance, except for the highest temperature.
\ No newline at end of file
diff --git a/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/images.zip b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..46fa676b0a457d0a1138b8dfe9394f23bdf6d929
--- /dev/null
+++ b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:961b5585fc03f5f72093d9f1c5faf7af0b862bf7ea4a5a7b199c02930c3b15b7
+size 2240806
diff --git a/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/layout.json b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c5cdce967f7ccfbd1260102762fd8dc3083e2891
--- /dev/null
+++ b/piecewiselinearparametrizationofpoliciestowardsinterpretabledeepreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2a229dc1816121a23d1e8c6fe7e52097a3f16442df356b6ec6abb0f1cee0436e
+size 948784
diff --git a/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_content_list.json b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..15ca91292e78cbf6ad048b6688ca3ac301fb2c06
--- /dev/null
+++ b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5959826e7546542a49d470f4c818bc3364b7bddaede81dbd4da5672d085c2ea3
+size 115098
diff --git a/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_model.json b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..d924624c66875fbeb36cc851758ff100416d1667
--- /dev/null
+++ b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8d4646a90393cac79709978bb39fb43bc4b40b9bdc1ec86449b1000a5f18ffbd
+size 139564
diff --git a/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_origin.pdf b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..5ef785f7a65bd19a4596674ae332c682cbf02748
--- /dev/null
+++ b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/338c4a67-2dcc-4d86-9f31-5dfd64dd5ee3_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0407fdcb4bd4741779d20c0aed744c1518188094cb4c58632fd78877e66c9718
+size 2181692
diff --git a/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/full.md b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c9993fd3d94873b48db7882f10e48850b66c2162
--- /dev/null
+++ b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/full.md
@@ -0,0 +1,541 @@
+# PINNSFORMER: A TRANSFORMER-BASED FRAMEWORK FOR PHYSICS-INFORMED NEURAL NETWORKS
+
+Zhiyuan Zhao
+
+Georgia Institute of Technology
+
+Atlanta, GA 30332
+
+leozhao1997@gatech.edu
+
+Xueying Ding
+
+Carnegie Mellon University
+
+Pittsburgh, PA 15213
+
+xding2@andrew.cmu.edu
+
+B. Aditya Prakash
+
+Georgia Institute of Technology
+
+Atlanta, GA 30332
+
+badityap@cc.gatech.edu
+
+# ABSTRACT
+
+Physics-Informed Neural Networks (PINNs) have emerged as a promising deep learning framework for approximating numerical solutions to partial differential equations (PDEs). However, conventional PINNs, relying on multilayer perceptrons (MLP), neglect the crucial temporal dependencies inherent in practical physics systems and thus fail to propagate the initial condition constraints globally and accurately capture the true solutions under various scenarios. In this paper, we introduce a novel Transformer-based framework, termed PINNsFormer, designed to address this limitation. PINNsFormer can accurately approximate PDE solutions by utilizing multi-head attention mechanisms to capture temporal dependencies. PINNsFormer transforms point-wise inputs into pseudo sequences and replaces point-wise PINNs loss with a sequential loss. Additionally, it incorporates a novel activation function, Wavelet, which anticipates Fourier decomposition through deep neural networks. Empirical results demonstrate that PINNsFormer achieves superior generalization ability and accuracy across various scenarios, including PINNs failure modes and high-dimensional PDEs. Moreover, PINNsFormer offers flexibility in integrating existing learning schemes for PINNs, further enhancing its performance.
+
+# 1 INTRODUCTION
+
+Numerically solving partial differential equations (PDEs) has been widely studied in science and engineering. The conventional approaches, such as finite element method (Bathe, 2007) or pseudospectral method (Fornberg, 1998), suffer from high computational costs in constructing meshes for high-dimensional PDEs. With the development of scientific machine learning, Physics-informed neural networks (PINNs) (Lagaris et al., 1998; Raissi et al., 2019) have emerged as a promising novel approach. Conventional PINNs and most variants employ multilayer perceptrons (MLP) as end-to-end frameworks for point-wise predictions, achieving remarkable success in various scenarios.
+
+Nevertheless, recent works have shown that PINNs fail in scenarios when solutions exhibit high-frequency or multiscale features (Raissi, 2018; Fuks & Tchelepi, 2020; Krishnapriyan et al., 2021; Wang et al., 2022a), though the corresponding analytical solutions are simple. In such cases, PINNs tend to provide overly smooth or naive approximations, deviating from the true solution.
+
+Existing approaches to mitigate these failures typically involve two general strategies. The first strategy, known as data interpolation (Raissi et al., 2017; Zhu et al., 2019; Chen et al., 2021), employs data regularization observed from simulations, or real-world scenarios. These approaches face challenges in acquiring ground truth data. The second strategy employs different training schemes (Mao et al., 2020; Krishnapriyan et al., 2021; Wang et al., 2021; 2022a), which potentially impose a high computational cost in practice. For instance, Seq2Seq by Krishnapriyan et al. (2021) requires training multiple neural networks sequentially, while other networks suffer from convergence issues
+
+due to error accumulation. Another method, Neural Tangent Kernel (NTK) (Wang et al., 2022a), involves constructing kernels $K \in \mathbb{R}^{D \times P}$ , where $D$ is the sample size and $P$ is the model parameter, which suffers from scalability issues as the sample size or model parameter increases.
+
+While most efforts to improve the generalization ability and address failure modes in PINNs have focused on the aforementioned aspects, conventional PINNs, largely relying on MLP-based architecture, can overlook important temporal dependencies in real-world physical systems. Finite Element Methods, for instance, implicitly incorporate temporal dependencies by sequentially propagating the global solution. This propagation relies on the principle that the state at time $t + \Delta t$ depends on the state at time $t$ . In contrast, PINNs, being a point-to-point framework, do not explicitly model temporal dependencies within PDEs. Neglecting temporal dependencies poses challenges in globally propagating initial condition constraints in PINNs. Consequently, PINNs often exhibit failure modes where the approximations remain accurate near the initial condition but subsequently fail into overly smooth or naive approximations.
+
+To address this issue of neglecting temporal dependencies in PINNs, a natural idea is employing Transformer-based models, which are known for capturing long-term dependencies in sequential data through multi-head self-attention and encoder-decoder attentions (Vaswani et al., 2017). Variants of transformer-based models have shown substantial success across various domains. However, adapting the Transformer, which is inherently designed for sequential data, to the point-to-point framework of PINNs presents non-trivial challenges. These challenges span both the data representation and the regularization loss within the framework.
+
+Main Contributions. In this work, we introduce PINNsFormer, a novel sequence-to-sequence PDE solver built on the Transformer architecture. To the best of our knowledge, PINNsFormer is the first framework in the realm of PINNs that explicitly focuses on and learns temporal dependencies within PDEs. Our key contributions can be summarized as follows:
+
+- New Framework: We propose a novel yet intuitive Transformer-based framework named PINNsFormer. This framework equips PINNs with the capability to capture temporal dependencies through the generated pseudo sequences, thereby enhancing the generalization ability and approximation accuracy in effectively solving PDEs.
+- Novel Activation: We introduce a new non-linear activation function Wavelet. Wavelet is designed to anticipate the Fourier Transform for arbitrary target signals, making it a universal approximator for infinite-width neural networks. Wavelet can also be potentially beneficial to various deep learning tasks across different model architectures.
+- Extensive Experiments: We conduct comprehensive evaluations of PINNsFormer for various scenarios. We demonstrate its advantages in optimization and approximation accuracy when addressing failure modes or solving high-dimensional PDEs. We show the flexibility and benefits of PINNsFormer in incorporating different learning schemes of PINNs.
+
+# 2 RELATED WORK
+
+Physics-Informed Neural Networks (PINNs). Physics-Informed Neural Networks (PINNs) have emerged as a promising approach for tackling scientific and engineering problems. Raissi et al. (2019) introduced the framework that incorporates physical laws into the neural network training to solve PDEs. This work has led to applications across diverse domains, including fluid dynamics, solid mechanics, and quantum mechanics (Carleo et al., 2019; Yang et al., 2020). Researchers have investigated different learning schemes for PINNs (Mao et al., 2020; Wang et al., 2021; 2022a), which have yielded substantial improvements in convergence, generalization, and interpretability.
+
+Failure Modes of PINNs. Despite the promise exhibited by PINNs, recent works have indicated certain failure modes inherent to PINNs, particularly when confronted with PDEs featuring high-frequency or multiscale features (Fuks & Tchelepi, 2020; Raissi, 2018; McClenny & Braga-Neto, 2020; Krishnapriyan et al., 2021; Zhao et al., 2022; Wang et al., 2022a). This challenge has prompted investigations from various perspectives, including designing various model architectures, learning schemes, or using data interpolations (Han et al., 2018; Lou et al., 2021; Wang et al., 2021; 2022a;b). A comprehensive understanding of PINNs' limitations and the underlying failure modes is fundamental for applications in addressing complicated physical problems.
+
+
+Figure 1: Architecture of proposed PINNsFormer. PINNsFormer generates a pseudo sequence based on pointwise input features. It outputs the corresponding sequential approximated solution. The first approximation of the sequence is the desired solution $\hat{u}(\boldsymbol{x}, t)$ .
+
+Transformer-Based Models. The Transformer model (Vaswani et al., 2017) has achieved significant attention due to its ability to capture long-term dependencies, leading to major achievements in natural language processing tasks (Devlin et al., 2018; Radford et al., 2018). Transformers have also been extended to other domains, including computer vision, speech recognition, and time-series analysis (Liu et al., 2021; Dosovitskiy et al., 2020; Gulati et al., 2020; Zhou et al., 2021). Researchers have also developed techniques aimed at enhancing the efficiency of Transformers, such as sparse attention and model compression (Child et al., 2019; Sanh et al., 2019).
+
+# 3 METHODOLOGY
+
+Preliminaries: Let $\Omega$ be an open set in $\mathbb{R}^d$ , bounded by $\partial \Omega \in \mathbb{R}^{d - 1}$ . The PDEs with spatial input $\pmb{x}$ and temporal input $t$ generally fit the following abstraction:
+
+$$
+\begin{array}{l} \mathcal {D} [ u (\boldsymbol {x}, t) ] = f (\boldsymbol {x}, t), \forall \boldsymbol {x}, t \in \Omega \\ \boldsymbol {x} ^ {[ (t - 1) ]} = \left( \begin{array}{l l l l} (t - 1) & 0 & 0 & 0 \end{array} \right) \end{array} \tag {1}
+$$
+
+$$
+\mathcal {B} [ u (\boldsymbol {x}, t) ] = g (\boldsymbol {x}, t), \forall \boldsymbol {x}, t \in \partial \Omega
+$$
+
+where $u$ is the PDE's solution, $\mathcal{D}$ is the differential operator that regularizes the behavior of the system, and $\mathcal{B}$ describes the boundary or initial conditions in general. Specifically, $\{\pmb{x}, t\} \in \Omega$ are residual points, and $\{\pmb{x}, t\} \in \partial \Omega$ are boundary/initial points. Let $\hat{u}$ be neural network approximations, PINNs describe the framework where $\hat{u}$ is empirically regularized by the following constraints:
+
+$$
+\mathcal {L} _ {\text {P I N N S}} = \lambda_ {r} \sum_ {i = 1} ^ {N _ {r}} \| \mathcal {D} [ \hat {u} (\boldsymbol {x}, t) ] - f (\boldsymbol {x}, t) \| ^ {2} + \lambda_ {b} \sum_ {i = 1} ^ {N _ {b}} \| \mathcal {B} [ \hat {u} (\boldsymbol {x}, t) ] - g (\boldsymbol {x}, t) \| ^ {2} \tag {2}
+$$
+
+where $N_{b}, N_{r}$ refer to the residual and boundary/initial points separately, $\lambda_{r}, \lambda_{b}$ are the regularization parameters that balance the emphasis of the loss terms. The neural network $\hat{u}$ takes vectorized $\{\pmb{x}, t\}$ as input and outputs the approximated solution. The goal is then to use machine learning methodologies to train the neural network $\hat{u}$ that minimizes the loss in Equation 2.
+
+Methodology Overview: While PINNs focus on point-to-point predictions, the exploration of temporal dependencies in real-world physics systems has been merely neglected. Conventional PINNs methods employ a single pair of spatial information $\pmb{x}$ and temporal information $t$ to approximate the numerical solution $u(\pmb{x},t)$ , without accounting for temporal dependencies across previous or subsequent time steps. However, this simplification is only applicable to elliptic PDEs, where the relationships between unknown functions and their derivatives do not explicitly involve time. In contrast, hyperbolic and parabolic PDEs incorporate time derivatives, implying that the state at one time step can influence states at preceding or subsequent time steps. Consequently, considering temporal dependencies is crucial to effectively address these PDEs using PINNs.
+
+In this section, we introduce a novel framework featuring a Transformer-based model of PINNs, namely PINNsFormer. Unlike point-to-point predictions, PINNsFormer extends PINNs' capabilities to sequential predictions. PINNsFormer allows accurately approximating solutions at specific time steps while also learning and regularizing temporal dependencies among incoming states. The framework consists of four components: Pseudo Sequence Generator, Spatio-Temporal Mixer, Encoder-Decoder with multi-head attention, and an Output Layer. Additionally, we introduce a novel activation function, named Wavelet, which employs Real Fourier Transform techniques to anticipate solutions to PDEs. The framework diagram is exhibited in Figure 1. We provide detailed explanations of each framework component and learning schemes in the following subsections.
+
+# 3.1 PSEUDO SEQUENCE GENERATOR
+
+While Transformers and Transformer-based models are designed to capture long-term dependencies in sequential data, conventional PINNs utilize non-sequential data as inputs for neural networks. Consequently, to incorporate PINNs with Transformer-based models, it is essential to transform the pointwise spatiotemporal inputs into temporal sequences. Thus, for a given spatial input $\boldsymbol{x} \in \mathbb{R}^{d - 1}$ and temporal input $t \in \mathbb{R}$ , the Pseudo Sequence Generator performs the following operations:
+
+$$
+[ \boldsymbol {x}, t ] \stackrel {\text {G e n e r a t o r}} {\Longrightarrow} \left\{\left[ \boldsymbol {x}, t \right], [ \boldsymbol {x}, t + \Delta t ], \dots , [ \boldsymbol {x}, t + (k - 1) \Delta t ] \right\} \tag {3}
+$$
+
+where $[\cdot ]$ is the concatenation operation, such that $[x,t]\in \mathbb{R}^d$ is vectorized, and the generator outputs the pseudo sequence in the shape of $\mathbb{R}^{k\times d}$ . The Pseudo Sequence Generator extrapolates sequential time series by extending a single spatiotemporal input to multiple isometric discrete time steps. $k$ and $\Delta t$ are hyperparameters, which intuitively determine how many steps the pseudo sequence needs to 'look ahead' and how far' each step should be. In practice, both $k$ and $\Delta t$ should not be set to very large scales, as larger $k$ can cause heavy computational and memory overheads, while larger $\Delta t$ may undermine the time dependency relationships of neighboring discrete time steps.
+
+# 3.2 MODEL ARCHITECTURE
+
+In addition to the Pseudo Sequence Generator, PINNsFormer consists of three components of its architecture: Sptio-Temporal Mixer, Encoder-Decoder with multi-head attentions, and Output Layer. The Output Layer is straightforward to interpret as a fully-connected MLP appended to the end. We provide detailed insights into the first two components below. Notably, PINNsFormer relies only on linear layers and non-linear activations, avoiding complex operations such as convolutional or recurrent layers. This design preserves PINNsFormer's computational efficiency in practice.
+
+Spatio-Temporal Mixer. Most PDEs contain low-dimensional spatial or temporal information. Directly feeding low-dimensional data to encoders may fail to capture the complex relationships between each feature dimension. Hence, it is necessary to embed original sequential data in higher-dimensional spaces such that more information is encoded into each vector.
+
+Instead of embedding raw data in a high-dimensional space where the distance between vectors reflects the semantic similarity (Vaswani et al., 2017; Devlin et al., 2018), PINNsFormer constructs a linear projection that maps spatiotemporal inputs onto a higher-dimensional space using a fully-connected MLP. The embedded data enriches the capability of information by mixing all raw spatiotemporal features together, so-called the linear projection Spatio-Temporal Mixer.
+
+Encoder-Decoder Architecture. PINNsFormer employs an encoder-decoder architecture similar to Transformer. The encoder consists of a stack of identical layers, each of which contains an encoder self-attention layer and a feedforward layer. The decoder is slightly different from the vanilla Transformer, where each of the identical layers contains only an encoder-decoder self-attention layer and a feedforward layer. At the decoder level, PINNsFormer uses the same spatiotemporal embeddings as the encoder. Therefore, the decoder does not need to relearn dependencies for the same input embeddings. The diagram for the encoder-decoder architecture is shown in Figure 2
+
+
+Figure 2: The architecture of PINNs-Former's Encoder-Decoder Layers. The decoder is not equipped with self-attention.
+
+Intuitively, the encoder self-attention allows learning the dependency relationships of all spatiotemporal information. The decoder encoder-decoder attention allows selectively focusing on specific dependencies within the input sequence during the decoding process, enabling it to
+
+capture more information than conventional PINNs. We use the same embeddings for the encoder and decoder since PINNs focus on approximating the solution of the current state, in contrast to next state prediction in language tasks or time series forecastings.
+
+# 3.3 WAVELET ACTIVATION
+
+While Transformers typically employ LayerNorm and ReLU non-linear activation functions (Vaswani et al., 2017; Gehring et al., 2017; Devlin et al., 2018), these activation functions might not always be suitable in solving PINNs. In particular, employing ReLU activation in PINNs can result in poor performance, whose effectiveness relies heavily on the accurate evaluation of derivatives while ReLU has a discontinuous derivative (Haghighat et al., 2021; de Wolff et al., 2021). Recent studies utilize Sin activation for specific scenarios to mimic the periodic properties of PDEs' solutions (Li et al., 2020; Jagtap et al., 2020; Song et al., 2022). However, it requires strong prior knowledge of the solution's behavior and is limited in its applicability. Tackling this issue, we proposed a novel and simple activation function, namely Wavelet, defined as follows:
+
+$$
+\operatorname {W a v e l e t} (\boldsymbol {x}) = \omega_ {1} \sin (\boldsymbol {x}) + \omega_ {2} \cos (\boldsymbol {x}) \tag {4}
+$$
+
+Where $\omega_{1}$ and $\omega_{2}$ are registered learnable parameters. The intuition behind Wavelet activation simply follows Real Fourier Transform: While periodic signals can be decomposed into an integral of sines of multiple frequencies, all signals, whether periodic or aperiodic, can be decomposed into an integral of sines and cosines of varying frequencies. It is evident that Wavelet can approximate arbitrary functions giving sufficient approximation power, which leads to the following proposition:
+
+Proposition 1 Let $\mathcal{N}$ be a two-hidden-layer neural network with infinite width, equipped with Wavelet activation function, then $\mathcal{N}$ is a universal approximator for any real-valued target $f$ .
+
+Proof sketch: The proof follows the Real Fourier Transform (Fourier Integral Transform). For any given input $x$ and its corresponding real-valued target $f(x)$ , it has the Fourier Integral:
+
+$$
+f (x) = \int_ {- \infty} ^ {\infty} F _ {c} (\omega) \cos (\omega x) d \omega + \int_ {- \infty} ^ {\infty} F _ {s} (\omega) \sin (\omega x) d \omega
+$$
+
+where $F_{c}$ and $F_{s}$ are the coefficients of Sines and Cosines respectively. Second, by Riemann sum approximation, the integral can be approximated by the infinite sum such that:
+
+$$
+f (x) \approx \sum_ {n = 1} ^ {N} \left[ F _ {c} (\omega_ {n}) \cos (\omega_ {n} x) + F _ {s} (\omega_ {n}) \sin (\omega_ {n} x) \right] \equiv W _ {2} (\mathrm {W a v e l e t} (W _ {1} x))
+$$
+
+where $W_{1}$ and $W_{2}$ are the weights of $\mathcal{N}$ 's first and second hidden layer. As $W_{1}$ and $W_{2}$ are infinite-width, we can divide the piecewise summation into infinitely small intervals, making the approximation arbitrarily close to the true integral. Hence, $\mathcal{N}$ is a universal approximator for any given $f$ . In practice, most PDE solutions contain only a finite number of major frequencies. Using a neural network with finite parameters would also lead to proper approximations of the true solutions.
+
+Although Wavelet activation function is primarily employed by PINNsFormer to improve PINNs in our work, it may have potential applications in other deep-learning tasks. Similar to ReLU, $\sigma(\cdot)$ , and Tanh activations, which all turn infinite-width two-hidden-layer neural networks into universal approximators (Cybenko, 1989; Hornik, 1991; Glorot et al., 2011), we anticipate that Wavelet can demonstrate its effectiveness in other applications beyond the scope of this work.
+
+# 3.4 LEARNING SCHEME
+
+While conventional PINNs focus on point-to-point predictions, adapting PINNs to handle pseudosequential inputs has not been explored. In PINNsFormer, each generated point in the sequence, i.e., $[x_i, t_i + j\Delta t]$ , is mapped to the corresponding approximation, i.e., $\hat{u}(x_i, t_i + j\Delta t)$ for any $j \in \mathbb{N}$ , $j < k$ . This approach allows us to compute the $n$ th-order gradients with respect to $\pmb{x}$ or $t$ independently for any valid $n$ . For instance, for any given input pseudo sequence $\{[x_i, t_i], [x_i, t_i + \Delta t], \ldots, [x_i, t_i + (k - 1)\Delta t]\}$ , and the corresponding approximations $\{\hat{u}(\pmb{x}_i, t_i), \hat{u}(\pmb{x}_i, t_i + \Delta t), \ldots, \hat{u}(\pmb{x}_i, t_i + (k - 1)\Delta t)\}$ , we can compute the first-order derivatives w.r.t. $\pmb{x}$ and $t$ separately as follows:
+
+$$
+\begin{array}{l} \frac {\partial \left\{\hat {u} \left(\boldsymbol {x} _ {i} , t _ {i} + j \Delta t\right) \right\} _ {j = 0} ^ {k - 1}}{\partial \left\{t _ {i} + j \Delta t \right\} _ {j = 0} ^ {k - 1}} = \left\{\frac {\partial \hat {u} \left(\boldsymbol {x} _ {i} , t _ {i}\right)}{\partial t _ {i}}, \frac {\partial \hat {u} \left(\boldsymbol {x} _ {i} , t _ {i} + \Delta t\right)}{\partial \left(t _ {i} + \Delta t\right)}, \dots , \frac {\partial \hat {u} \left(\boldsymbol {x} _ {i} , t _ {i} + (k - 1) \Delta t\right)}{\partial \left(t _ {i} + (k - 1) \Delta t\right)} \right\} \tag {5} \\ \frac {\partial \{\hat {u} (\pmb {x} _ {i} , t _ {i} + j \Delta t) \} _ {j = 0} ^ {k - 1}}{\partial \pmb {x} _ {i}} = \{\frac {\partial \hat {u} (\pmb {x} _ {i} , t _ {i})}{\partial \pmb {x} _ {i}}, \frac {\partial \hat {u} (\pmb {x} _ {i} , t _ {i} + \Delta t)}{\partial \pmb {x} _ {i}}, \dots , \frac {\partial \hat {u} (\pmb {x} _ {i} , t _ {i} + (k - 1) \Delta t)}{\partial \pmb {x} _ {i}} \} \\ \end{array}
+$$
+
+This scheme for calculating the gradients of sequential approximations with respect to sequential inputs can be easily extended to higher-order derivatives and is applicable to residual, boundary, and initial points. However, unlike the general PINNs optimization objective in Equation 2, which combines initial and boundary condition objectives, PINNsFormer distinguishes between the two and applies different regularization schemes to initial and boundary conditions through its learning scheme. For residual and boundary points, all sequential outputs can be regularized using the PINNs loss. This is because all generated pseudo-timesteps are within the same domain as their original inputs. For example, if $[\pmb{x}_i,t_i]$ is sampled from the boundary, then $[x_i,t_i + j\Delta t]$ also lies on the boundary for any $j\in \mathbb{N}^{+}$ . In contrast, for initial points, only the $t = 0$ condition is regularized, corresponding to the first element of the sequential outputs. This is because only the first element of the pseudo-sequence exactly matches the initial condition at $t = 0$ . All other generated time steps have $t = j\Delta t$ for any $j\in \mathbb{N}^{+}$ , which fall outside the initial conditions.
+
+By these considerations, we adapt the PINNs loss to the sequential version, as described below:
+
+$$
+\mathcal {L} _ {r e s} = \frac {1}{k N _ {r e s}} \sum_ {i = 1} ^ {N _ {r e s}} \sum_ {j = 0} ^ {k - 1} \| \mathcal {D} [ \hat {u} (\boldsymbol {x} _ {i}, t _ {i} + j \Delta t) ] - f (\boldsymbol {x} _ {i}, t _ {i} + j \Delta t) \| ^ {2}
+$$
+
+$$
+\mathcal {L} _ {b c} = \frac {1}{k N _ {b c}} \sum_ {i = 1} ^ {N _ {b c}} \sum_ {j = 0} ^ {k - 1} \| \mathcal {B} [ \hat {u} (\boldsymbol {x} _ {i}, t _ {i} + j \Delta t) ] - g (\boldsymbol {x} _ {i}, t _ {i} + j \Delta t) \| ^ {2} \tag {6}
+$$
+
+$$
+\mathcal {L} _ {i c} = \frac {1}{N _ {i c}} \sum_ {i = 1} ^ {N _ {b c}} \| \mathcal {I} [ \hat {u} (\pmb {x} _ {i}, 0) ] - h (\pmb {x} _ {i}, 0) \| ^ {2}
+$$
+
+$$
+\mathcal {L} _ {\text {P I N N s F o r m e r}} = \lambda_ {r e s} \mathcal {L} _ {r e s} + \lambda_ {i c} \mathcal {L} _ {i c} + \lambda_ {b c} \mathcal {L} _ {b c}
+$$
+
+where $N_{res} = N_r$ refers to the residual points as in Equation 2, $N_{bc}, N_{ic}$ represent the number of boundary and initial points, respectively, with $N_{bc} + N_{ic} = N_b$ . $\lambda_{res}, \lambda_{bc}$ , and $\lambda_{ic}$ are regularization weights that balance the importance of the loss terms in PINNsFormer, similar to the PINNs loss.
+
+During training, PINNsFormer forwards all residual, boundary, and initial points to obtain their corresponding sequential approximations. It then optimizes the modified PINNs loss $\mathcal{L}_{\mathrm{PINNsFormer}}$ in Equation 6 using gradient-based optimization algorithms such as L-BFGS or Adam, updating the model parameters until convergence. In the testing phase, PINNsFormer forwards any arbitrary pair $[\pmb{x},t]$ to observe the sequential approximations, where the first element of the sequential approximation corresponds exactly to the desired value of $\hat{u} (\pmb {x},t)$ .
+
+# 3.5 LOSS LANDSCAPE ANALYSIS
+
+
+Figure 3: Visualization of the loss landscape for PINNs (left) and PINNsFormer (right) on a logarithmic scale. The loss landscape of PINNsFormer is significantly smoother than conventional PINNs.
+
+
+
+While achieving theoretical convergence or establishing generalization bounds for Transformer-based models can be challenging, an alternative approach to assess optimization trajectory is through visualization of the loss landscape. This approach has been employed in the analysis of both Transformers and PINNs (Krishnapriyan et al., 2021; Yao et al., 2020; Park & Kim, 2022). The loss landscape is constructed by perturbing the trained model along the directions of the first
+
+two dominant Hessian eigenvectors. This technique is more informative than random parameter perturbations. Generally, a smoother loss landscape with fewer local minima indicates an easier convergence to the global minimum. We visualize the loss landscape for both PINNs and PINNs-Former. The visualizations are presented in Figure 5.
+
+The visualizations clearly reveal that PINNs exhibit a more complicated loss landscape than PINNs-Former. To be specific, we estimate the Lipschitz constant for both loss landscapes. We find that $L_{\mathrm{PINNS}} = 776.16$ , which is significantly larger than $L_{\mathrm{PINNSFormer}} = 32.79$ . Furthermore, the loss
+
+landscape of PINNs exhibits several sharp cones near its optimal point, indicating the presence of multiple local minima in close proximity to the convergence point (zero perturbation). The rugged loss landscape and multiple local minima of conventional PINNs suggest that optimizing the objective described in Equation 6 for PINNsFormer offers an easier path to reach the global minimum. This implies that PINNsFormer has advantages in avoiding the failure modes associated with PINNs. The analysis is further validated by empirical experiments, as shown in the following section.
+
+# 4 EXPERIMENTS
+
+# 4.1 SETUP
+
+Goal. Our empirical evaluations aim to demonstrate three key advantages of PINNsFormer. First, we show that PINNsFormer improves generalization abilities and mitigates failure modes compared to PINNs and variant architectures. Second, we illustrate the flexibility of PINNsFormer in incorporating various learning schemes, resulting in superior performance. Third, we provide evidence of PINNsFormer's faster convergence and improved generalization capabilities in solving high-dimensional PDEs, which can be challenging for PINNs and their variants.
+
+Experiment Setup. Our empirical evaluations rely on four types of PDEs: convection, 1D-reaction, 1D-wave, and Navier-Stokes PDEs, which follow the established setups of preliminary studies for fair comparisons (Raissi et al., 2019; Krishnapriyan et al., 2021; Wang et al., 2022a). We include PINNs, QRes (Bu & Karpatne, 2021), and First-Layer Sine (FLS) (Wong et al., 2022) as baselines. For convection, 1D-reaction, and 1D-wave PDEs, we uniformly sampled $N_{ic} = N_{bc} = 101$ initial and boundary points, as well as a uniform grid of $101 \times 101$ mesh points for the residual domain, resulting in total $N_{res} = 10201$ points. In the case of training PINNsFormer, we reduce the collocation points, with $N_{ic} = N_{bc} = 51$ initial and boundary points and a $51 \times 51$ mesh for residual points. The reduction in fewer training samples serves two purposes: it enhances training efficiency and allows us to demonstrate the generalization capabilities of PINNsFormer with limited training data. For testing, we employed a $101 \times 101$ mesh within the residual domain. For the Navier-Stokes PDE, we sample 2500 points from the 3D mesh within the residual domain for training purposes. The evaluation was performed by testing the predicted pressure at the final time step $t = 20.0$ .
+
+Evaluation. For all baselines and PINNsformer, we maintain approximately close numbers of parameters across all models to highlight the advantages of PINNsFormer from its ability to capture temporal dependencies rather than relying solely on model overparameterization. We train all models using the L-BFGS optimizer with Strong Wolfe linear search for 1000 iterations. For simplicity, we set $\lambda_{res} = \lambda_{ic} = \lambda_{bc} = 1$ for the optimization objective in Equation 6. Detailed hyperparameters are provided in Appendix A. We also include an ablation study on activation functions and a hyperparameter sensitivity study on the choice of $\{k,\Delta t\}$ in Appendix C.
+
+In terms of evaluation metrics, we adopted commonly used metrics in related works (Krishnapriyan et al., 2021; Raissi et al., 2019; McClenny & Braga-Neto, 2020), including the relative Mean Absolute Error (rMAE or relative $\ell_1$ error) and the relative Root Mean Square Error (rRMSE or relative $\ell_2$ error). The detailed formulations of the metrics are provided in Appendix A.
+
+Reproducibility. All models are implemented in PyTorch (Paszke et al., 2019), and are trained separately on single NVIDIA Tesla V100 GPU. All code and demos are included and reproducible at: https://github.com/AdityaLab/pinnsformer.
+
+# 4.2 MITIGATING FAILURE MODES OF PINNS
+
+Our primary evaluation focuses on demonstrating the superior generalization ability of PINNs-Former in comparison to PINNs, particularly on PDEs that are known to challenge PINNs' generalization capabilities. We focus on solving two distinct types of PDEs: the convection equation and the 1D-reaction equation. These equations pose significant challenges for conventional MLP-based PINNs, often resulting in what is referred to as "PINNs failure modes" (Mojgani et al., 2022; Daw et al., 2022; Krishnapriyan et al., 2021). In these failure modes, optimization gets stuck in local minima, leading to overly smooth approximations that deviate from the true solutions.
+
+The objective of our evaluation is to showcase the enhanced generalization capabilities of PINNs-Former when compared to standard PINNs and their variations, specifically in addressing PINNs' failure modes. The evaluation results are summarized in Table 1, with detailed PDE formulations provided in Appendix B. We showcase the prediction and absolute error plots of PINNs and PINNs-Former on convection equation in Figure 4, all prediction plots available in Appendix C.
+
+
Model
Convection
1D-Reaction
Loss
rMAE
rRMSE
Loss
rMAE
rRMSE
PINNs
0.016
0.778
0.840
0.199
0.982
0.981
QRes
0.015
0.746
0.816
0.199
0.979
0.977
FLS
0.012
0.674
0.771
0.199
0.984
0.985
PINNsFormer
3.7e-5
0.023
0.027
3.0e-6
0.015
0.030
+
+The evaluation results demonstrate significant outperformance of PINNsFormer over all baselines for both scenarios. PINNsFormer achieves the lowest training loss and test errors, distinguishing PINNsFormer as the only approach capable of mitigating the failure modes. In contrast, all other baseline methods remain stuck at global minima and fail to optimize the objective loss effectively. These results show the clear advantages of PINNsFormer in terms of generalization ability and approximation accuracy when compared to conventional PINNs and existing variants.
+
+The additional concern for PINNsFormer is its computational and memory overheads relative to PINNs. While MLP-based PINNs are known for efficiency, PINNsFormer, with Transformer-based architecture in handling sequential data, naturally incurs higher computational and memory costs. Nonetheless, our empirical evaluation indicates that the overhead is tolerable, benefitting from the reliance on only linear layers, avoiding complicated operators such as convolution or recurrent layers. For instance, when setting the pseudo-sequence length $k = 5$ , we observe an approximate $2.92\mathrm{x}$ computational cost and a $2.15\mathrm{x}$ memory usage (detailed in Appendix A). These overheads are reasonable in exchange for the substantial performance improvements by PINNsFormer.
+
+
+
+
+
+
+Figure 4: Prediction (left) and absolute error (right) of PINNs (up) and PINNsFormer (bottom) on convection equation. PINNsFormer shows success in mitigating the failure mode than PINNs.
+
+
+
+# 4.3 FLEXIBILITY IN INCORPORATING VARIANT LEARNING SCHEMES
+
+While PINNs and their various architectural adaptations may encounter challenges for certain scenarios, prior research has explored sophisticated optimization schemes to mitigate these issues, including learning rate annealing (Wang et al., 2021), augmented Lagrangian methods (Lu et al., 2021), and neural tangent kernel approaches (Wang et al., 2022a). These modified PINNs have shown significant improvement of
+
+PINNs under certain scenarios. Notably, when these optimization strategies are applied to PINNs-Former, they can be easily incorporated to achieve further performance improvements. For instance, the Neural Tangent Kernel (NTK) method to PINNs has shown success in solving the 1D-wave equation. As such, we demonstrate that when combining NTK with PINNsFormer, we can achieve
+
+Table 1: Results for solving convection and 1D-reaction equations. PINNsFormer consistently outperforms all baseline methods in terms of training loss, rMAE, and rRMSE.
+
+
Model
1D-Wave
Loss
rMAE
rRMSE
PINNs
1.93e-2
0.326
0.335
PINNsFormer
1.38e-2
0.270
0.283
PINNs + NTK
6.34e-3
0.140
0.149
PINNsFormer + NTK
4.21e-3
0.054
0.058
+
+Table 2: Results for solving the 1D-wave equation, incorporating the NTK method. PINNsFormer combined with NTK outperforms all other methods on all metrics.
+
+further outperformance in approximation accuracy. Detailed results are presented in Table 2, and comprehensive PDE formulations are available in Appendix B with prediction plots in Appendix C.
+
+Our evaluation results show both the flexibility and effectiveness of incorporating PINNsFormer with the $NTK$ method. In particular, we observe a sequence of performance improvements, from standard PINNs to PINNsFormer and from PINNs $+NTK$ to PINNsFormer $+NTK$ . Essentially, PINNsFormer explores a variant architecture of PINNs, while many learning schemes are designed from an optimization perspective and are agnostic to neural network architectures. This inherent flexibility allows for versatile combinations of PINNsFormer with various learning schemes, offering practical and customizable solutions for accurate solutions in real-world applications.
+
+# 4.4 GENERALIZATION ON HIGH-DIMENSIONAL PDES
+
+In the previous sections, we demonstrated the clear benefits of PINNsFormer in generalizing the solutions for PINNs failure modes. However, those PDEs often have simple analytical solutions. In practical physics systems, higher-dimensional and more complex PDEs need to be solved. Therefore, it's important to evaluate the generalization ability of PINNsFormer on such high-dimensional PDEs, especially when PINNsFormer is equipped with advanced mechanisms like self-attention.
+
+We evaluate the performance of PINNsFormer compared to
+
+PINNs on Navier-Stokes PDE based on the established setups Raissi et al. (2019). The training loss is shown in Figure 5, and the results are shown in Table 3. The detailed formulations of the 2D Navier-Stokes equation can be found in Appendix B, and the predictions are plotted in Appendix C.
+
+
+Figure 5: Training loss vs. Iterations of PINNs and PINNsFormer on the Navier-Stokes equation.
+
+The evaluation results demonstrate clear advantages of PINNsFormer over PINNs on high-dimensional PDEs. Firstly, PINNsFormer outperforms PINNs and their MLP-variants in terms of both training loss and validation errors. Firstly, PINNsFormer exhibits significantly faster convergence during training, which compensates for the higher computational cost per iteration. Secondly, while PINNs and their MLP-variants predict the pressure with good shapes, they exhibit increasing mag
+
+
Model
Navier-Stokes
Loss
rMAE
rRMSE
PINNs
6.72e-5
13.08
9.08
QRes
2.24e-4
6.41
4.45
FLS
9.54e-6
3.98
2.77
PINNsFormer
6.66e-6
0.384
0.280
+
+Table 3: Results for solving Navier-Stokes equation, PINNsFormer outperforms all baselines on all metrics.
+
+nitude discrepancies as time increases. In contrast, PINNsFormer consistently aligns both the shape and magnitude of predicted pressures across various time intervals. This consistency is attributed to PINNsFormer's ability to learn temporal dependencies through Transformer-based model architecture and self-attention mechanism.
+
+# 5 CONCLUSION
+
+In this paper, we introduced PINNsFormer, a novel Transformer-based framework of PINNs, aimed at capturing temporal dependencies when approximating solutions to PDEs. We introduced the Pseudo Sequence Generator, a mechanism that translates vectorized inputs into pseudo time sequences and incorporated a modified Encoder-Decoder layer along with a novel Wavelet activation. Empirical evaluations demonstrate that PINNsFormer consistently outperforms conventional PINNs across various scenarios, including handling PINNs' failure modes, addressing high-dimensional PDEs, and integrating with different learning schemes for PINNs. Furthermore, PINNsFormer retains computational simplicity, making it a practical choice for real-world applications.
+
+Beyond PINNsFormer, Wavelet activation function can hold promises for the broader machine learning community. We provided a sketch proof demonstrating Wavelet's ability to approximate arbitrary target solutions using a two-hidden-layer infinite-width neural network, leveraging the Fourier decomposition of these solutions. We encourage further exploration, both theoretically and empirically, of the Wavelet activation function's potential. Its applicability extends beyond PINNs and can be leveraged in various architectures and applications.
+
+Acknowledgements: This paper was supported in part by the NSF (Expeditions CCF-1918770, CAREER IIS-2028586, Medium IIS-1955883, Medium IIS-2106961, PIPP CCF-2200269), CDC MInD program, Meta faculty gift, and funds/computing resources from Georgia Tech and GTRI.
+
+# REFERENCES
+
+Klaus-Jürgen Bathe. Finite element method. Wiley encyclopedia of computer science and engineering, pp. 1-12, 2007.
+Jie Bu and Anuj Karpatne. Quadratic residual networks: A new class of neural networks for solving forward and inverse problems in physics involving pdes. In Proceedings of the 2021 SIAM International Conference on Data Mining (SDM), pp. 675-683. SIAM, 2021.
+Giuseppe Carleo, Ignacio Cirac, Kyle Cranmer, Laurent Daudet, Maria Schuld, Naftali Tishby, Leslie Vogt-Maranto, and Lenka Zdeborova. Machine learning and the physical sciences. *Reviews of Modern Physics*, 91(4):045002, 2019.
+Zhao Chen, Yang Liu, and Hao Sun. Physics-informed learning of governing equations from scarce data. Nature communications, 12(1):6136, 2021.
+Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
+George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303-314, 1989.
+Arka Daw, Jie Bu, Sifan Wang, Paris Perdikaris, and Anuj Karpatne. Rethinking the importance of sampling in physics-informed neural networks. arXiv preprint arXiv:2207.02338, 2022.
+Taco de Wolff, Hugo Carrillo, Luis Martí, and Nayat Sanchez-Pi. Assessing physics informed neural networks in ocean modelling and climate change applications. In AI: Modeling Oceans and Climate Change Workshop at ICLR 2021, 2021.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
+Bengt Fornberg. A practical guide to pseudospectral methods. Number 1. Cambridge university press, 1998.
+Olga Fuks and Hamdi A Tchelepi. Limitations of physics informed machine learning for nonlinear two-phase transport in porous media. Journal of Machine Learning for Modeling and Computing, 1(1), 2020.
+Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In International conference on machine learning, pp. 1243-1252. PMLR, 2017.
+Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 315-323. JMLR Workshop and Conference Proceedings, 2011.
+Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, et al. Conformer: Convolution-augmented transformer for speech recognition. arXiv preprint arXiv:2005.08100, 2020.
+Ehsan Haghighat, Maziar Raissi, Adrian Moure, Hector Gomez, and Ruben Juanes. A physics-informed deep learning framework for inversion and surrogate modeling in solid mechanics. Computer Methods in Applied Mechanics and Engineering, 379:113741, 2021.
+
+Jiequn Han, Arnulf Jentzen, and Weinan E. Solving high-dimensional partial differential equations using deep learning. Proceedings of the National Academy of Sciences, 115(34):8505-8510, 2018.
+Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4 (2):251-257, 1991.
+Ameya D Jagtap, Kenji Kawaguchi, and George Em Karniadakis. Adaptive activation functions accelerate convergence in deep and physics-informed neural networks. Journal of Computational Physics, 404:109136, 2020.
+Aditi Krishnapriyan, Amir Gholami, Shandian Zhe, Robert Kirby, and Michael W Mahoney. Characterizing possible failure modes in physics-informed neural networks. Advances in Neural Information Processing Systems, 34:26548-26560, 2021.
+Isaac E Lagaris, Aristidis Likas, and Dimitrios I Fotiadis. Artificial neural networks for solving ordinary and partial differential equations. IEEE transactions on neural networks, 9(5):987-1000, 1998.
+Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. arXiv preprint arXiv:2010.08895, 2020.
+Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10012-10022, 2021.
+Qin Lou, Xuhui Meng, and George Em Karniadakis. Physics-informed neural networks for solving forward and inverse flow problems via the boltzmann-bgk formulation. Journal of Computational Physics, 447:110676, 2021.
+Lu Lu, Raphael Pestourie, Wenjie Yao, Zhicheng Wang, Francesc Verdugo, and Steven G Johnson. Physics-informed neural networks with hard constraints for inverse design. SIAM Journal on Scientific Computing, 43(6):B1105-B1132, 2021.
+Zhiping Mao, Ameya D Jagtap, and George Em Karniadakis. Physics-informed neural networks for high-speed flows. Computer Methods in Applied Mechanics and Engineering, 360:112789, 2020.
+Levi McClenny and Ulisses Braga-Neto. Self-adaptive physics-informed neural networks using a soft attention mechanism. arXiv preprint arXiv:2009.04544, 2020.
+Rambod Mojjani, Maciej Balajewicz, and Pedram Hassanzadeh. Lagrangian pinns: A causality-conforming solution to failure modes of physics-informed neural networks. arXiv preprint arXiv:2205.02902, 2022.
+Namuk Park and Songkuk Kim. How do vision transformers work? arXiv preprint arXiv:2202.06709, 2022.
+Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019.
+Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. Improving language understanding by generative pre-training. 2018.
+Maziar Raissi. Deep hidden physics models: Deep learning of nonlinear partial differential equations. The Journal of Machine Learning Research, 19(1):932-955, 2018.
+Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part i): Data-driven solutions of nonlinear partial differential equations. arXiv preprint arXiv:1711.10561, 2017.
+Maziar Raissi, Paris Perdikaris, and George E Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics, 378:686-707, 2019.
+
+Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
+Chao Song, Tariq Alkhalifah, and Umair Bin Waheed. A versatile framework to solve the helmholtz equation using physics-informed neural networks. Geophysical Journal International, 228(3): 1750-1762, 2022.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
+Sifan Wang, Yujun Teng, and Paris Perdikaris. Understanding and mitigating gradient flow pathologies in physics-informed neural networks. SIAM Journal on Scientific Computing, 43(5):A3055-A3081, 2021.
+Sifan Wang, Xinling Yu, and Paris Perdikaris. When and why pinns fail to train: A neural tangent kernel perspective. Journal of Computational Physics, 449:110768, 2022a.
+Yicheng Wang, Xiaotian Han, Chia-Yuan Chang, Daochen Zha, Ulisses Braga-Neto, and Xia Hu. Auto-pinn: Understanding and optimizing physics-informed neural architecture. arXiv preprint arXiv:2205.13748, 2022b.
+Jian Cheng Wong, Chinchun Ooi, Abhishek Gupta, and Yew-Soon Ong. Learning in sinusoidal spaces with physics-informed neural networks. IEEE Transactions on Artificial Intelligence, 2022.
+Liu Yang, Dongkun Zhang, and George Em Karniadakis. Physics-informed generative adversarial networks for stochastic differential equations. SIAM Journal on Scientific Computing, 42(1): A292-A317, 2020.
+Zhewei Yao, Amir Gholami, Kurt Keutzer, and Michael W Mahoney. Pyhessian: Neural networks through the lens of the hessian. In 2020 IEEE international conference on big data (Big data), pp. 581-590. IEEE, 2020.
+Zhiyuan Zhao, Xueying Ding, Gopaljee Atulya, Alex Davis, and Aarti Singh. Physics informed machine learning with misspecified priors: \ \an analysis of turning operation in lathe machines. In AAAI 2022 Workshop on AI for Design and Manufacturing (ADAM), 2022.
+Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pp. 11106-11115, 2021.
+Yinhao Zhu, Nicholas Zabaras, Phaedon-Stelios Koutsourelakis, and Paris Perdikaris. Physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data. Journal of Computational Physics, 394:56-81, 2019.
+
+# A APPENDIX A: MODEL HYPERPARAMETERS
+
+Model Hyperparameters. We provide a detailed set of hyperparameters used to obtain the experiment results, shown in Table 7.
+
+
Model
Hyperparameters
Value
Model Parameters
PINNs & FLS
hidden layer
4
527k
hidden size
512
QRes
hidden layer
4
397k
hidden size
256
PINNsFormer
k
5
Δt
1e-3, 1e-4
# of encoder
1
# of decoder
1
454k
embedding size
32
head
2
hidden size
512
+
+Training Overhead. We compare the training overhead of PINNsFormer over PINNs, as PINNs are known as an efficient framework while Transformer-based models are known for being computationally costly. The comparison relies on solving the Convection PDEs, which are detailed in Table 5. Here, we vary the hyperparameter of pseudo-sequence length $k$ for validation purposes. In practice, we set $k = 5$ for all the empirical experiments in this paper.
+
+Table 4: Hyperparameters for Main Results
+
+
Model
Training Time (sec/epoch)
Computational Overhead
GPU Memory (MiB)
Memory Overhead
PINNs
0.80
/
1311
/
PINsFormer
k=3
2.10
2.62x
2207
1.68x
k=5
2.34
2.92x
2827
2.15x
k=10
3.10
3.87x
4803
3.66x
+
+Table 5: Overhead of PINNsFormer than PINNs in varying pseudo-sequence length. Both computational and memory overhead are tolerable and grow approximately linearly as $k$ increases
+
+Evaluation Metrics. We present the detailed formula of rMAE and rRMSE as the following:
+
+$$
+\mathrm {r M A E} = \frac {\sum_ {n = 1} ^ {N} \left| \hat {u} (x _ {n} , t _ {n}) - u (x _ {n} , t _ {n}) \right|}{\sum_ {n = 1} ^ {N _ {r e s}} \left| u (x _ {n} , t _ {n}) \right|}
+$$
+
+$$
+r \text {R M S E} = \sqrt {\frac {\sum_ {n = 1} ^ {N} | \hat {u} \left(x _ {n} , t _ {n}\right) - u \left(x _ {n} , t _ {n}\right) | ^ {2}}{\sum_ {n = 1} ^ {N} | u \left(x _ {n} , t _ {n}\right) | ^ {2}}} \tag {7}
+$$
+
+where $N$ is the number of testing points, $\hat{u}$ is the neural network approximation, and $u$ is the ground truth.
+
+# B APPENDIX B: PDES SETUPS
+
+We provide detailed PDE setups for convection, reaction-diffusion, and 1D-reaction equations.
+
+Convection PDE. The one-dimensional convection problem is a hyperbolic PDE that is commonly used to model transport phenomena. The system has the formulation with periodic boundary conditions as follows:
+
+$$
+\frac {\partial u}{\partial t} + \beta \frac {\partial u}{\partial x} = 0, \forall x \in [ 0, 2 \pi ], t \in [ 0, 1 ] \tag {8}
+$$
+
+$$
+\mathbb {C}: u (x, 0) = \sin (x), \quad \mathbb {C}: u (0, t) = u (2 \pi , t)
+$$
+
+where $\beta$ is the convection coefficient. As $\beta$ increases, the frequency of its solution goes higher, and it becomes harder for PINNs to approximate. Here, we set $\beta = 50$ .
+
+1D-Reaction PDE. The one-dimensional reaction problem is a hyperbolic PDE that is commonly used to model chemical reactions. The system has the formulation with periodic boundary conditions as follows:
+
+$$
+\frac {\partial u}{\partial t} - \rho u (1 - u) = 0, \forall x \in [ 0, 2 \pi ], t \in [ 0, 1 ] \tag {9}
+$$
+
+$$
+\mathbb {I C}: u (x, 0) = \exp (- \frac {(x - \pi) ^ {2}}{2 (\pi / 4) ^ {2}}), \quad \mathbb {B C}: u (0, t) = u (2 \pi , t)
+$$
+
+where $\rho$ is the reaction coefficient. Here, we set $\rho = 5$ . The equation has a simple analytical solution:
+
+$$
+u _ {\text {a n a l y t i c a l}} = \frac {h (x) \exp (\rho t)}{h (x) \exp (\rho t) + 1 - h (x)} \tag {10}
+$$
+
+where $h(x)$ is the function of the initial condition.
+
+1D-Wave PDE. The 1D-Wave equation is a hyperbolic PDE that is used to describe the propagation of waves in one spatial dimension. It is often used in physics and engineering to model various wave phenomena, such as sound waves, seismic waves, and electromagnetic waves. The system has the formulation with periodic boundary conditions as follows:
+
+$$
+\frac {\partial^ {2} u}{\partial t ^ {2}} - \beta \frac {\partial^ {2} u}{\partial x ^ {2}} = 0 \forall x \in [ 0, 1 ], t \in [ 0, 1 ]
+$$
+
+$$
+\mathrm {I C}: u (x, 0) = \sin (\pi x) + \frac {1}{2} \sin (\beta \pi x), \quad \frac {\partial u (x , 0)}{\partial t} = 0 \tag {11}
+$$
+
+$$
+\mathrm {B C}: u (0, t) = u (1, t) = 0
+$$
+
+where $\beta$ is the wave speed. Here, we are specifying $\beta = 3$ . The equation has a simple analytical solution:
+
+$$
+u (x, t) = \sin (\pi x) \cos (2 \pi t) + \frac {1}{2} \sin (\beta \pi x) \cos (2 \beta \pi t) \tag {12}
+$$
+
+2D Navier-Stokes PDE. The 2D Navier-Stokes equation is a parabolic PDE that consists of a pair of partial differential equations that describe the behavior of incompressible fluid flow in two-dimensional space. They are widely used in fluid dynamics to model the motion of fluids, such as air and water, in various engineering and scientific applications. The system has the formulation as follows:
+
+$$
+\frac {\partial u}{\partial t} + \lambda_ {1} \left(u \frac {\partial u}{\partial x} + v \frac {\partial u}{\partial y}\right) = - \frac {\partial p}{\partial x} + \lambda_ {2} \left(\frac {\partial^ {2} u}{\partial x ^ {2}} + \frac {\partial^ {2} u}{\partial v ^ {2}}\right) \tag {13}
+$$
+
+$$
+\frac {\partial v}{\partial t} + \lambda_ {1} (u \frac {\partial v}{\partial x} + v \frac {\partial v}{\partial y}) = - \frac {\partial p}{\partial y} + \lambda_ {2} (\frac {\partial^ {2} u}{\partial x ^ {2}} + \frac {\partial^ {2} u}{\partial v ^ {2}})
+$$
+
+where $u(t,x,y)$ and $v(t,x,y)$ are the $x$ -component and $y$ -component of the velocity field separately, and $p(t,x,y)$ is the pressure. Here, we set $\lambda_{1} = 1$ and $\lambda_{2} = 0.01$ . The system does not have an explicit analytical solution, while the simulated solution is given by Raissi et al. (2019).
+
+# C APPENDIX C: ADDITIONAL RESULTS
+
+Ablation Study on Activation Functions. To investigate the effectiveness of the Wavelet activation function in PINNsFormer, we compare the performance differences using Wavelet than
+
+ReLU, Sigmoid, and Sin activation functions over convection and 1D-reaction problems. In particular, we study the effects of using the same activation function in both the feed-forward layer and encoder/decoder layer (marked as ReLU, etc.) and changing the activation function of the encoder/decoder layer to LayerNorm (as vanilla Transformer does, marked as $\mathrm{ReLU + LN}$ , etc.). The evaluation results are shown in Table 6.
+
+
Activation
Convection
1D-Reaction
Loss
rMAE
rRMSE
Loss
rMAE
rRMSE
ReLU
0.5256
1.001
1.001
0.2083
0.994
0.996
Sigmoid
0.1618
1.112
1.223
0.1998
0.991
0.993
Sin
0.3159
1.074
1.141
4.9e-6
0.017
0.032
ReLU+LN
0.7818
1.001
1.002
0.2028
0.992
0.993
Sigmoid+LN
0.0549
0.941
0.967
0.2063
0.992
0.990
Sin+LN
0.3219
1.083
1.156
4.7e-6
0.016
0.033
Wavelet
3.7e-5
0.023
0.027
3.0e-6
0.015
0.030
Wavelet+LN
NaN
NaN
NaN
3.9e-6
0.018
0.037
+
+The ablation study results show two major conclusions: First, using wavelet activation shows constantly better performance than ReLU, Sigmoid, and Sin activations. In particular, Sin activation may show effectiveness in only certain cases, while Wavelet can generalize all cases well. Second, Introducing LayerNorm activation to the encoder/decoder does not significantly contribute to performance improvement. In contrast, LayerNorm activation may cause convergence issues when coupling with the Wavelet activation function for certain situations.
+
+Hyperparameter Sensitivity Study. To investigate the possible difficulties in picking hyperparameters $k$ and $\Delta$ , we compared the performance differences with a mesh choice of these two hyperparameters over the 1d-reaction problem. The evaluation results (relative- $\ell_2$ error, with failure modes bolded) are shown in Table 7.
+
+Table 6: Results for solving convection and 1D-reaction equations using Transformer architecture with different activation functions. PINNsFormer (with Wavelet activation) consistently outperforms all other activation functions in terms of training loss, rMAE, and rRMSE
+
+
Δt
k=3
k=5
k=7
k=10
1e-1
0.044
0.514
0.743
0.731
1e-2
0.029
0.035
0.045
0.049
1e-3
0.037
0.037
0.024
0.035
1e-4
0.997
0.030
0.029
0.046
1e-5
0.977
0.026
0.977
0.021
+
+Table 7: Results for solving 1D-reaction equation with various combinations of $\Delta t$ and $k$ . PINNs-Former shows the flexibility of a wide choice of hyperparameters on certain problems.
+
+The study on hyperparameter sensitivity of $\Delta t$ and $k$ exhibits three intuitions: First, given a mesh choice of $k$ and $\Delta t$ , PINNsFormer is not sensitive to a wide range of the two hyperparameters. For instance, PINNsFormer successfully mitigates the failure modes for any combinations of $k \in [1e - 2, 1e - 3, 1e - 4]$ and $\Delta t \in [3,5,7]$ . Second, the choice of $\Delta t$ should not be either too large (i.e., 1e-1) or too small (i.e., 1e-5). Intuitively, either a too-large or a too-small $\Delta t$ degrades the temporal dependencies between discrete time steps. Third, increasing the pseudo-sequence length can help mitigate PINNs failure modes (i.e., $k = 3 \rightarrow 5$ when $\Delta t = 1e - 4$ ). However, once PINNs successfully mitigate the failure mode, the benefit of further increasing $k$ is marginal.
+
+Result Visualizations. We here present the plots of ground truth solutions, neural network predictions, and absolute errors for all evaluations included in the experimental section. The plots on convection, 1D-reaction, 1D-wave, and 2D Navier-Stokes equations are shown in Figure separately.
+
+
+(a) ground truth solution for convection equation
+
+
+(b) PINNs prediction
+
+
+(c) FLS prediction
+
+
+(d) QRes prediction
+
+
+(e) PINNsFormer prediction
+
+
+(f) PINNs error
+
+
+(g) FLS error
+
+
+(h) QRes error
+
+
+(i) PINNsFormer error
+
+
+Figure 6: Ground truth solution, predictions, and absolute errors (up to bottom) of PINNs, FLS, QRes, PINNsFormer (left to right) over convection equation.
+
+
+(b) PINNs prediction
+
+
+(a) ground truth solution for 1D-reaction equation
+(c) FLS prediction
+
+
+(d) QRes prediction
+
+
+(e) PINNsFormer prediction
+
+
+(f) PINNs error
+Figure 7: Ground truth solution, predictions, and absolute errors (up to bottom) of PINNs, FLS, QRes, PINNsFormer (left to right) over 1D-reaction equation.
+
+
+(g) FLS error
+
+
+(h) QRes error
+
+
+(i) PINNsFormer error
+
+
+(a) ground truth solution for 1D-wave equation
+
+
+(b) PINNs prediction
+
+
+(c) PINNsFormer prediction
+
+
+(d) PINNs+NTK prediction
+
+
+(e) PINNsFormer+NTK prediction
+
+
+(f) PINNs error
+
+
+(g) PINNsFormer error
+
+
+(h) PINNs+NTK error
+
+
+(i) PINNsFormer+NTK error
+
+
+Figure 8: Ground truth solution, predictions, and absolute errors (up to bottom) of PINNs, PINNs-Former, PINNs+NTK, PINNsFormer+NTK (left to right) over 1D-reaction equation.
+
+
+(b) PINNs prediction
+
+
+(a) true solution for 2D Navier-Stoke equation
+(c) QRes prediction
+
+
+(d) FLS prediction
+
+
+(e) PINNsFormer prediction
+
+
+(f) PINNs error
+
+
+(g) QRes error
+Figure 9: Ground truth solution, predictions, and absolute errors (up to bottom) of PINNs and PINNsFormer (left to right) over 2D Navier-Stokes equation.
+
+
+(h) FLS error
+
+
+(i) PINNsFormer error
\ No newline at end of file
diff --git a/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/images.zip b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..eb2136ea4c87e16d38165ae5f50c4068ce16961a
--- /dev/null
+++ b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a65da8e8b51fe9b9715a04d68539f74648084e2ad61116d8641f2ebae2ffd8c4
+size 780166
diff --git a/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/layout.json b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..66918e23b6448db10388e5c8286a562d51f77922
--- /dev/null
+++ b/pinnsformeratransformerbasedframeworkforphysicsinformedneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7966076430ac5abbcb0f1f2c330b85d98ee62af342fd5650b805f4db9bc9f0e
+size 621979
diff --git a/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_content_list.json b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9f7932fb8e6fa630d67c1e2835e914e796a54869
--- /dev/null
+++ b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:542959e1cec401a97f5f6f0dee16dfd4e24987fee8da70654b6f7b936f7a90de
+size 160332
diff --git a/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_model.json b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5945cf915b6bfa6c6b9c05f9c5e84ad7145e8dce
--- /dev/null
+++ b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dd16d1a0da1443db07f5f0095870551000b6a4332482cb5f286d71a5cb31114c
+size 193362
diff --git a/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_origin.pdf b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6d18e72944816a380cc2c61568e9ba5e605dd34c
--- /dev/null
+++ b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/c063585a-91c4-4cf8-b734-240ffd2539a7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67b65c5286b8ed6cd5e9abe2b0c96ad790975adfff2799ea6edbb8c51418f6f4
+size 31528252
diff --git a/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/full.md b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..6f631cce5a64e64c5f9fd1a79bab06dae7e947ca
--- /dev/null
+++ b/planseqlearnlanguagemodelguidedrlforsolvinglonghorizonroboticstasks/full.md
@@ -0,0 +1,716 @@
+# PLAN-SEQ-LEARN: LANGUAGE MODEL GUIDED RL FOR SOLVING LONG HORIZON ROBOTICS TASKS
+
+Murtaza Dalal1, Tarun Chiruvolu1, Devendra Singh Chaplot2, Ruslan Salakhutdinov1
+
+$^{1}$ Carnegie Mellon University, $^{2}$ Mistral AI
+
+# ABSTRACT
+
+Large Language Models (LLMs) have been shown to be capable of performing high-level planning for long-horizon robotics tasks, yet existing methods require access to a pre-defined skill library (e.g. picking, placing, pulling, pushing, navigating). However, LLM planning does not address how to design or learn those behaviors, which remains challenging particularly in long-horizon settings. Furthermore, for many tasks of interest, the robot needs to be able to adjust its behavior in a fine-grained manner, requiring the agent to be capable of modifying low-level control actions. Can we instead use the internet-scale knowledge from LLMs for high-level policies, guiding reinforcement learning (RL) policies to efficiently solve robotic control tasks online without requiring a pre-determined set of skills? In this paper, we propose Plan-Seq-Learn (PSL): a modular approach that uses motion planning to bridge the gap between abstract language and learned low-level control for solving long-horizon robotics tasks from scratch. We demonstrate that PSL achieves state-of-the-art results on over 25 challenging robotics tasks with up to 10 stages. PSL solves long-horizon tasks from raw visual input spanning four benchmarks at success rates of over $85\%$ , out-performing language-based, classical, and end-to-end approaches. Video results and code at https://planseqlearn.github.io/
+
+# 1 INTRODUCTION
+
+In recent years, the field of robot learning has witnessed a significant transformation with the emergence of Large Language Models (LLMs) as a mechanism for injecting internet-scale knowledge into robotics. One paradigm that has been particularly effective is LLM planning over a predefined set of skills (Ahn et al., 2022; Singh et al., 2023; Huang et al., 2022b; Wu et al., 2023), producing strong results across a wide range of robotics tasks. These works assume the availability of a pre-defined skill library that abstracts away the robotic control problem. They instead focus on designing methods to select the right sequence skills to solve a given task. However, for robotics tasks involving contact-rich robotic manipulation (Fig. 1), such skills are often not available, require significant engineering effort to design or train a-priori or are simply not expressive enough to address the task. How can we move beyond pre-built skill libraries and enable the application of language models to general purpose robotics tasks with as few assumptions as possible? Robotic systems need to be capable of online improvement over low-level control policies while being able to plan over long horizons.
+
+End-to-end reinforcement learning (RL) is one paradigm that can produce complex low-level control strategies on robots with minimal assumptions (Akkaya et al., 2019; Herzog* et al., 2023; Handa et al., 2022; Kalashnikov et al., 2018; 2021; Chen et al., 2022; Agarwal et al., 2023). Unlike hierarchical approaches which impose a specific structure on the agent which may not be applicable to all tasks, end-to-end learning methods can, in principle, learn a better representation directly from data. However, RL methods are traditionally limited to the short horizon regime due to the significant challenge of exploration in RL, especially in high-dimensional continuous action spaces characteristic of robotics tasks. RL methods struggle with longer-horizon tasks in which high-level reasoning and low-level control must be learned simultaneously; effectively decomposing tasks into sub-sequences and accurately achieving them is challenging in general (Sutton et al., 1999; Parr & Russell, 1997).
+
+Our key insight is that LLMs and RL have complementary strengths and weaknesses. Prior work (Ahn et al., 2022; Huang et al., 2022a; Wu et al., 2023; Singh et al., 2023; Song et al., 2023) has shown that when appropriately prompted, language models are capable of leveraging internet scale knowledge to break down long-horizon tasks into achievable sub-goals, but lack a mechanism to produce low-level robot control strategies Wang et al. (2023), while RL can discover complex control behaviors on
+
+
+Figure 1: Long horizon task visualization. We visualize PSL solving the NutAssembly task, in which the goal is to put both nuts on their respective pegs. After predicting the high-level plan using an LLM, PSL computes a target robot pose, achieves it using motion planning and then learns interaction via RL (third row).
+
+robots but struggles to simultaneously perform long-term reasoning (Nachum et al., 2018). However, directly combining the two paradigms, for example, via training a language conditioned policy to solve a new task, does not address the exploration problem. The RL agent must now simultaneously learn language semantics and low-level control. Ideally, the RL agent should be able to follow the guidance of the LLM, enabling it to learn to efficiently solve each predicted sub-task online. How can we connect the abstract language space of an LLM with the low-level control space of the RL agent in order to address the long-horizon robot control problem?
+
+In this work, we propose a learning method to solve long-horizon robotics tasks by tracking language model plans using motion planning and learned low-level control. Our approach, called Plan-Seq-Learn (PSL), is a modular framework in which a high-level language plan given by an LLM (Plan) is interpreted and executed using motion planning (Seq), enabling the RL policy (Learn) to rapidly learn short-horizon control strategies to solve the overall task. This decomposition enables us to effectively leverage the complementary strengths of each module: language models for abstract planning, vision-based motion planning for task plan tracking as well as achieving robot states and RL policies for learning low-level control. Furthermore, we improve learning speed and training stability by sharing the learned RL policy across all stages of the task, using local observations for efficient generalization, and introducing a simple, yet scalable curriculum learning strategy for tracking the language model plan. To our knowledge, ours is the first work enabling language guided RL agents to efficiently learn low-level control strategies for long-horizon robotics tasks.
+
+Our contributions are: 1) A novel method for long-horizon robot learning that tightly integrates large language models for high-level planning, motion planning for skill sequencing and RL for learning low-level robot control strategies; 2) Strategies for efficient policy learning from high-level plans, which include policy observation space design for locality, shared policy network and reward function structures, and curricula for stage-wise policy training; 3) An extensive experimental evaluation demonstrating that PSL can solve over 25 long-horizon robotics tasks with up to 10 stages, outperforming SOTA baselines across four benchmark suites at success rates of over $85\%$ purely from visual input. PSL produces agents that solve challenging long-horizon tasks such as NutAssembly at $96\%$ success rate.
+
+# 2 RELATED WORK
+
+Classical Approaches to Long Horizon Robotics: Historically, robotics tasks have been approached via the Sense-Plan-Act (SPA) pipeline (Paul, 1981; Whitney, 1972; Vukobratovic & Potkonjak, 1982; Kappler et al., 2018; Murphy, 2019), which requires comprehensive understanding of the environment (sense), a model of the world (plan), and a low-level controller (act). Traditional approaches range from manipulation planning (Lozano-Perez et al., 1984; Taylor et al., 1987), grasp analysis Miller & Allen (2004), and Task and Motion Planning (TAMP) Garrett et al. (2021), to modern variants incorporating learned vision (Mahler et al., 2016; Mousavian et al., 2019; Sundermeyer et al., 2021). Planning algorithms enable long horizon decision making over complex and high-dimensional action spaces. However, these approaches can struggle with contact-rich interactions (Mason, 2001; Whitney, 2004), experience cascading errors due to imperfect state estimation (Kaelbling & Lozano-Perez,
+
+
+Figure 2: Method overview. PSL decomposes tasks into a list of regions and stage termination conditions using an LLM (top), sequences the plan using motion planning (left) and learns control policies using RL (right).
+
+2013), and require significant manual engineering and systems effort to setup (Garrett et al., 2020b). Our method leverages learning at each component of the pipeline to sidestep these issues: it handles contact-rich interactions using RL, avoids cascading failures by learning online, and sidesteps manual engineering effort by leveraging pre-trained models for vision and language.
+
+Planning and Reinforcement Learning: Recent work has explored the integration of motion planning and RL to combine the advantages of both paradigms (Lee et al., 2020; Yamada et al., 2021; Cheng & Xu, 2022; Xia et al., 2020; James & Davison, 2022; James et al., 2022; Liu et al., 2022). GUAPO Lee et al. (2020) is similar to the Seq-Learn components of our method, yet their system considers the single-stage regime and is focused on keeping the RL agent in areas of low pose-estimator uncertainty. Our method instead considers long-horizon tasks by encouraging the RL agent to follow a high-level plan given by an LLM using vision-based motion planning. MoPA-RL Yamada et al. (2021) also bears resemblance to our method, yet it opts to learn when to use the motion planner via RL, requiring the RL agent to discover the right decomposition of planner vs. control actions on its own. Furthermore, roll-outs of trajectories using MoPA can result in the RL agent choosing to motion plan multiple times in sequence, which is inefficient - one motion planner action is sufficient to reach any position in space. In our method, we instead explicitly decompose tasks into sequences of contact-free reaching (motion planner) and contact-rich environment interaction (RL).
+
+Language Models for RL and Robotics LLMs have been applied to RL and robotics in a wide variety of ways, from planning Ahn et al. (2022); Singh et al. (2023); Huang et al. (2022a,b); Wu et al. (2023); Liu et al. (2023a); Rana et al. (2023); Lin et al. (2023), reward definition Kwon et al. (2023); Yu et al. (2023), generating quadrupedal contact-points Tang et al. (2023), producing tasks for policy learning Du et al. (2023); Colas et al. (2020) and controlling simulation-based trajectory generators to produce diverse tasks Ha et al. (2023). Our work instead focuses on the online learning setting and aims to leverage language model driven planning to guide RL agents to solve new robotics tasks in a sample efficient manner. BOSS Zhang et al. (2023) is closest to our overall method; this concurrent work also leverages LLM guidance to learn new skills via RL. Crucially, their method depends on the existence of a skill library and learns skills that are combination of high-level actions. Our method instead efficiently learns low-level robot control skills without depending on a pre-defined skill library, by taking advantage of motion planning to track an LLM plan.
+
+# 3 PLAN-SEQ-LEARN
+
+In this section, we describe our method for solving long-horizon robotics tasks, PSL, outlined in Fig. 2. Given a text description of the task, our method breaks up the task into meaningful sub-sequences (Plan), uses vision and motion planning to translate sub-sequences into initialization regions (Seq) from which we can efficiently train local control policies using RL (Learn).
+
+# 3.1 PROBLEM SETUP
+
+We consider Partially Observed Markov Decision Processes (POMDP) of the form $(\mathcal{S},\mathcal{A},\mathcal{T},\mathcal{R},p_0,\mathcal{O},p_O,\gamma)$ . $\mathcal{S}$ is the set of environment states, $\mathcal{A}$ is the set of actions, $\mathcal{T}(s^{\prime} \mid s,a)$ is the transition probability distribution, $\mathcal{R}(s,a,s^{\prime})$ is the reward function, $p_0$ is the distribution over the initial state $s_0 \sim p_0$ , $\mathcal{O}$ is the set of observations, $p_O$ is the distribution over observations conditioned on the state $O \sim p_O(O|s)$ and $\gamma$ is the discount factor. In our case, the observation space is the set of all RGB-D (RGB and depth) images. The reward function is defined by the environment. The agent's goal is to maximize the expected sum of rewards over the trajectory, $\mathbb{E}[\sum_t\gamma^t\mathcal{R}(s_t,a_t,s_{t + 1})]$ . In our work, we consider POMDPs that describe an embodied robot agent interacting with a scene. We assume that a text description of the task, $g_{l}$ , is provided to the agent in natural language.
+
+# 3.2 OVERVIEW
+
+To solve long-horizon robotics tasks, we need a module capable of bridging the gap between zero-shot language model planning and learned low-level control. Observe that many tasks of interest can be decomposed into alternating phases of contact-free motion and contact-rich interaction. One first approaches a target region and then performs interaction behavior, prior to moving to the next sub-task. Contact-free motion generation is exactly the motion planning problem. For estimating the position of the target region, we note that state-of-the-art vision models are capable of accurate language-conditioned state estimation (Kirillov et al., 2023; Zhou et al., 2022; Liu et al., 2023b; Bahl et al., 2023; Ye et al., 2023; Labbé et al., 2022). As a result, we propose a Sequencing Module which uses off-the-shelf vision models to estimate target robot states from the language plan and then achieves these states using a motion planner. From such states, we train interaction policies that optimize the task reward using RL. See Alg. 1 and Fig. 2 for an overview of our method.
+
+Algorithm 1 Plan-Seq-Learn Overview
+Require: LLM, Pose Estimator P, task description $g_{l}$ , Motion Planner MP, low-level horizon $H_{l}$ Planning Module
+High-level plan $\mathcal{P}\gets$ Prompt(LLM, $g_{l})$
+for $p\in \mathcal{P}$ do
+Sequencing Module target region $(t)$ termination condition $\leftarrow p$ Compute pose $q_{target} = P(O_{t}^{global},t)$ Achieve pose MP(qtarget, $O_{t}^{global}$
+Learning Module for $i = 1,\dots,H_{l}$ do Get action $a_{t}\sim \pi_{\theta}(O_{t}^{local})$ Get next state $O_{t + 1}^{local}\sim p(|s_t,a_t)$ Store $(O_{t}^{local},a_{t},O_{t + 1}^{local},r)$ into R update $\pi_{\theta}$ using RL if $f_{stage}(O^{global})$ then break end if end for end for
+
+# 3.3 PLANNING MODULE: ZERO-SHOT HIGH-LEVEL PLANNING
+
+Long-horizon tasks can be broken into a series of stages to execute. Rather than discovering these stages using interaction or using a task planner Fikes & Nilsson (1971) that may require privileged information about the environment, we use language models to produce natural language plans zero shot without access to the environment. Specifically, given a task description $g_{l}$ by a human, we prompt an LLM to produce a plan. Designing the plan granularity and scope are crucial; we need plans that can be interpreted by the Sequencing Module, a vision-based system that produces and achieves robot poses using motion planning. As a result, the LLM predicts a target region (a natural language label of an object/receptacle in the scene, e.g. "silver peg") which can be translated into a target pose to achieve at the beginning of each stage of the plan.
+
+When the RL policy is executing a step of the plan, we propose to add a stage termination condition (e.g. grasp, place, turn, open, push) to know the stage is complete and to move onto the next stage. This condition is defined as a function $f_{\text{stage}}(O^{\text{global}})$ that takes in the current observation of the environment and evaluates a binary success criteria as well as a natural language descriptor of the condition for prompting the LLM (e.g. 'grasp' or 'place'). These stage termination conditions are estimated using visual pose estimates. We describe the stage termination conditions in greater detail in Sec. 3.5 and Appendix D. The LLM prompt consists of the task description $g_l$ , the list of supported stage termination conditions (which we hold constant across all environments) and additional prompting strings for output formatting. We format the language plans as follows: ("Region 1", "Termination Condition 1"), ... ("Region N", "Termination Condition N"), assuming the LLM predicts N stages. Given the prompt, the LLM outputs a natural language plan in the format listed above. Below, we include an example prompt and plan for the Nut Assembly task.
+
+Prompt: Stage termination conditions: (grasp, place). Task description: The silver nut goes on the silver peg and the gold nut goes on the gold peg. Give me a simple plan to solve the task using only the stage termination conditions. Make sure the plan follows the formatting specified below and make sure to take into account object geometry. Formatting of output: a list in which each element looks like: (