Datasets:
Add files using upload-large-folder tool
Browse files- md/dev/0YXmOFLb1wQ/0YXmOFLb1wQ.md +323 -0
- md/dev/1sx0Drq4jfT/1sx0Drq4jfT.md +613 -0
- md/dev/2clwrA2tfik/2clwrA2tfik.md +298 -0
- md/dev/4WgqjmYacAf/4WgqjmYacAf.md +523 -0
- md/dev/5NTt8GFjUHkr/5NTt8GFjUHkr.md +0 -0
- md/dev/9Hrka5PA7LW/9Hrka5PA7LW.md +317 -0
- md/dev/FQOC5u-1egI/FQOC5u-1egI.md +0 -0
- md/dev/GQcB1D2bxSC/GQcB1D2bxSC.md +0 -0
- md/dev/GQjaI9mLet/GQjaI9mLet.md +493 -0
- md/dev/IfFZr1gl0b/IfFZr1gl0b.md +523 -0
- md/dev/Ix37FJYDkBp/Ix37FJYDkBp.md +265 -0
- md/dev/Jep2ykGUdS/Jep2ykGUdS.md +0 -0
- md/dev/KVljrqehulG/KVljrqehulG.md +494 -0
- md/dev/LI2bhrE_2A/LI2bhrE_2A.md +420 -0
- md/dev/LdVQGdXkkG/LdVQGdXkkG.md +287 -0
- md/dev/OJ4mMfGKLN/OJ4mMfGKLN.md +282 -0
- md/dev/Pu-QtT0h2E/Pu-QtT0h2E.md +270 -0
- md/dev/S7Evzt9uit3/S7Evzt9uit3.md +279 -0
- md/dev/T47mUw8pW4/T47mUw8pW4.md +465 -0
- md/dev/TBWA6PLJZQm/TBWA6PLJZQm.md +0 -0
- md/dev/UROBiQEOLP/UROBiQEOLP.md +457 -0
- md/dev/UjynxfqnGWG/UjynxfqnGWG.md +0 -0
- md/dev/V3C8p78sDa/V3C8p78sDa.md +0 -0
- md/dev/VD-AYtP0dve/VD-AYtP0dve.md +439 -0
- md/dev/Vota6rFhBQ/Vota6rFhBQ.md +0 -0
- md/dev/XA4ru9mfxTP/XA4ru9mfxTP.md +283 -0
- md/dev/XSRSWxyJIC/XSRSWxyJIC.md +329 -0
- md/dev/a0SRWViFYW/a0SRWViFYW.md +0 -0
- md/dev/aPXMGv7aeOn/aPXMGv7aeOn.md +272 -0
- md/dev/d00kbjbYv2/d00kbjbYv2.md +356 -0
- md/dev/eLgK35G3A5d/eLgK35G3A5d.md +596 -0
- md/dev/fCbTxKYJovs/fCbTxKYJovs.md +282 -0
- md/dev/flNZJ2eOet/flNZJ2eOet.md +307 -0
- md/dev/hGXij5rfiHw/hGXij5rfiHw.md +617 -0
- md/dev/hopfHdHZGYe/hopfHdHZGYe.md +302 -0
- md/dev/iedYJm92o0a/iedYJm92o0a.md +375 -0
- md/dev/lXuByUeHhd/lXuByUeHhd.md +412 -0
- md/dev/mRieQgMtNTQ/mRieQgMtNTQ.md +0 -0
- md/dev/mWVoBz4W0u/mWVoBz4W0u.md +0 -0
- md/dev/muFvu66v7u/muFvu66v7u.md +459 -0
- md/dev/pfI7u0eJAIr/pfI7u0eJAIr.md +325 -0
- md/dev/s_PJMEGIUfa/s_PJMEGIUfa.md +520 -0
- md/dev/uuUQraD4XX/uuUQraD4XX.md +461 -0
- md/dev/uxxFrDwrE7Y/uxxFrDwrE7Y.md +366 -0
- md/dev/vSVLM2j9eie/vSVLM2j9eie.md +443 -0
- md/dev/vaRCHVj0uGI/vaRCHVj0uGI.md +420 -0
- md/dev/vfsRB5MImo9/vfsRB5MImo9.md +0 -0
- md/dev/w0H2xGHlkw/w0H2xGHlkw.md +570 -0
- md/dev/x2WTG5bV977/x2WTG5bV977.md +404 -0
- md/dev/zXne1klXIQ/zXne1klXIQ.md +0 -0
md/dev/0YXmOFLb1wQ/0YXmOFLb1wQ.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MOTIFEXPLAINER: A MOTIF-BASED GRAPH NEURAL NETWORK EXPLAINER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We consider the explanation problem of Graph Neural Networks (GNNs). Most existing GNN explanation methods identify the most important edges or nodes but fail to consider substructures, which are more important for graph data. One method considering subgraphs tries to search all possible subgraphs and identifies the most significant ones. However, the subgraphs identified may not be recurrent or statistically important for interpretation. This work proposes a novel method, named MotifExplainer, to explain GNNs by identifying important motifs, which are recurrent and statistically significant patterns in graphs. Our proposed motif-based methods can provide better human-understandable explanations than methods based on nodes, edges, and regular subgraphs. Given an instance graph and a pre-trained GNN model, our method first extracts motifs in the graph using domain-specific motif extraction rules. Then, a motif embedding is encoded by feeding motifs into the pre-trained GNN. Finally, we employ an attention-based method to identify the most influential motifs as explanations for the prediction results. The empirical studies on both synthetic and real-world datasets demonstrate the effectiveness of our method.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph neural networks (GNNs) have shown capability in solving various challenging tasks in graph fields, such as node classification, graph classification, and link prediction. Although many GNNs models (Kipf & Welling, 2016; Gao et al., 2018; Xu et al., 2018; Gao & Ji, 2019; Liu et al., 2020) have achieved state-of-the-art performances in various tasks, they are still considered black boxes and lack sufficient knowledge to explain them. Inadequate interpretation of GNN decisions severely hinders the applicability of these models in critical decision-making contexts where both predictive performance and interpretability are critical. A good explainer allows us to debate GNN decisions and shows where algorithmic decisions may be biased or discriminated against. In addition, we can apply precise explanations to other scientific research like fragment generation. A fragment library is a key component in drug discovery, and accurate explanations may help its generation.
|
| 12 |
+
|
| 13 |
+
Several methods have been proposed to explain GNNs, divided into instance-level explainers and model-level explainers. Most existing instance-level explainers such as GNNExplainer (Ying et al., 2019), PGExplainer (Luo et al., 2020), Gem (Lin et al., 2021), and ReFine (Wang et al., 2021) produce an explanation to every graph instance. These methods explain pre-trained GNNs by identifying important edges or nodes but fail to consider substructures, which are more important for graph data. The only method that considers subgraphs is SubgraphX (Yuan et al., 2021), which searches all possible subgraphs and identifies the most significant one. However, the subgraphs identified may not be recurrent or statistically important, which raises an issue on the application of the produced explanations. For example, fragment-based drug discovery (FBDD)(Erlanson et al., 2004) has been proven to be powerful for developing potent small-molecule compounds. FBDD is based on fragment libraries, containing fragments or motifs identified as relevant to the target property by domain experts. Using a motif-based GNN explainer, we can directly identify relevant fragments or motifs that are ready to be used when generating drug-like lead compounds in FBDD.
|
| 14 |
+
|
| 15 |
+
In addition, searching and scoring all possible subgraphs is time-consuming and inefficient. We claim that using motifs, recurrent and statistically important subgraphs, to explain GNNs can provide a more intuitive explanation than methods based on nodes, edges, or subgraphs.
|
| 16 |
+
|
| 17 |
+
This work proposes a novel GNN explanation method named MotifExplainer, which can identify significant motifs to explain an instance graph. In particular, our method first extracts motifs from a given graph using domain-specific motif extraction rules based on domain knowledge. Then, motif embeddings of extracted motifs are generated by feeding motifs into the target GNN model. After that, an attention model is employed to select relevant motifs based on attention weights. These selected motifs are used as an explanation for the target GNN model on the instance graph. To our knowledge, the proposed method represents the first attempt to apply the attention mechanism to explain the GNN from the motif-level perspective. We evaluate our method using both qualitative and quantitative experiments. The experiments show that our MotifExplainer can generate a better explanation than previous GNN explainers. In addition, the efficiency studies demonstrate the efficiency advantage of our methods in terms of a much shorter training and inference time.
|
| 18 |
+
|
| 19 |
+
# 2 PROBLEM FORMULATION
|
| 20 |
+
|
| 21 |
+
This section formulates the problem of explanations on graph neural networks. Let $G _ { i } = \{ V , E \} \in$ $\mathcal { G } = \{ G _ { 1 } , G _ { 2 } , . . . , G _ { i } , . . . , \bar { G _ { N } } \}$ denotes a graph where $V = \{ v _ { 1 } , v _ { 2 } , . . . , v _ { i } , . . . v _ { n } \}$ is the node set of the graph and $E$ is the edge set. $G _ { i }$ is associated with a $d$ -dimensional set of node features $\pmb { X } = \{ \pmb { x } _ { 1 } , \pmb { x } _ { 2 } , . . . , \pmb { x } _ { i } , . . . , \pmb { x } _ { n } \}$ , where $\pmb { x } _ { i } \in \mathbb { R } ^ { d }$ is the feature vector of node $v _ { i }$ . Without loss of generality, we consider the problem of explaining a GNN-based downstream classification task. For a node classification task, we associate each node $v _ { i }$ of a graph $G$ with a label $y _ { i }$ , where $y _ { i } \in Y =$ $\{ l _ { 1 } , . . . , l _ { c } \}$ and $c$ is the number of classes. For a graph classification task, each graph $G _ { i }$ is assigned a corresponding label.
|
| 22 |
+
|
| 23 |
+
# 2.1 BACKGROUND ON GRAPH NEURAL NETWORKS
|
| 24 |
+
|
| 25 |
+
Most Graph Neural Networks (GNNs) follow a neighborhood aggregation learning scheme. In a layer $\ell$ , GNNs contain three steps. First, a GNN first calculates the messages that will be transferred between every node pair. A message for a node pair $( v _ { i } , v _ { j } )$ can be represented by a function $\theta ( \cdot ) : b _ { i j } ^ { \ell } = \theta ( { \pmb x } _ { i } ^ { \ell - 1 } , { \pmb x } _ { j } ^ { \ell - 1 } , { \pmb e } _ { i j } )$ , where $e _ { i j }$ is the edge feature vector, $\pmb { x } _ { i } ^ { \ell - 1 }$ and ${ \pmb x } _ { i } ^ { \ell - 1 }$ are the node features of $v _ { i }$ and $v _ { j }$ at the previous layer, respectively. Second, for each node $v _ { i }$ , GNN aggregates all messages from its neighborhood ${ \mathcal { N } } _ { i }$ using an aggregation function ${ \boldsymbol { \phi } } ( \cdot ) : { \mathbf { } } { \mathbf { } } { \mathbf { } } B _ { i } ^ { \ell } = \phi \left( \{ b _ { i j } ^ { \ell } | v _ { j } \in \mathcal { N } _ { i } \} \right)$ . Finally, the GNN combine the aggregated message $B _ { i } ^ { \ell }$ with node $v _ { i }$ ’s feature representation from previous layer ${ \pmb x } _ { i } ^ { \ell - 1 }$ , and use a non-linear activation function to obtain the representation for node $v _ { i }$ at layer $l : { \bf x } _ { i } ^ { \ell } = f ( { \bf x } _ { i } ^ { \ell - 1 } , B _ { i } ^ { \ell } )$ . Formally, a $\ell$ -th GNN layer can be represented by
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\begin{array} { r } { \pmb { x } _ { i } ^ { \ell } = f ( \pmb { x } _ { i } ^ { \ell - 1 } , \phi ( \{ \theta ( \pmb { x } _ { i } ^ { l - 1 } , \pmb { x } _ { j } ^ { l - 1 } , \pmb { e } _ { i j } ) \} \vert \ v _ { j } \in \mathcal { N } _ { i } \} ) ) . } \end{array}
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
# 2.2 GRAPH NEURAL NETWORK EXPLANATIONS
|
| 32 |
+
|
| 33 |
+
In a GNN explanation task, we are given a pre-trained GNN model, which can be represented by $\Psi ( \cdot )$ and its corresponding dataset $\mathcal { D }$ . The task is to obtain an explanation model $\bar { \Phi } ( \cdot )$ that can provide a fast and accurate explanation for the given GNN model. Most existing GNN explanation approaches can be categorized into two branches: instance-level methods and model-level methods. Instance-level methods can provide an explanation for each input graph, while model-level methods are input-independent and analyze graph patterns without input data. Following previous works (Luo et al., 2020; Yuan et al., 2021; Lin et al., 2021; Wang et al., 2021; Bajaj et al., 2021), we focus on instance-level methods with explanations using graph sub-structures. Also, our approach is modelagnostic. In particular, given an input graph, our explanation model can generate a subgraph that is the most important to the outcomes of a pre-trained GNN on any downstream graph-related task, such as graph classification tasks.
|
| 34 |
+
|
| 35 |
+
# 3 MOTIF-BASED GRAPH NEURAL NETWORK EXPLAINER
|
| 36 |
+
|
| 37 |
+
Most existing GNN explainers (Ying et al., 2019; Luo et al., 2020) identify the most important nodes or edges. SubgraphX (Yuan et al., 2021) is the first work that proposed a method to explain GNN models by generating the most significant subgraph for an input graph. However, the subgraphs
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: An illustration of the proposed MotifExplainer on graph classification tasks. Given a graph, we first extract motifs based on extraction rules. Then, motif embedding is generated for each motif by feeding it into the pre-trained GNN feature extractor. After that, we employ an attention layer that uses graph embedding as the query and motif embedding as keys and values, resulting in a new graph embedding. Finally, the loss is computed based on the new and the original predictions.
|
| 41 |
+
|
| 42 |
+
identified by SubgraphX may not be recurrent or statistically important. This section proposes a novel GNN explanation method, named MotifExplainer, to explain GNN models based on motifs.
|
| 43 |
+
|
| 44 |
+
# 3.1 FROM SUBGRAPH TO MOTIF EXPLANATION
|
| 45 |
+
|
| 46 |
+
Unlike explanation on models for text and image tasks, a graph has non-grid topology structure information, which needs to be considered in an explanation model. Given an input graph and a trained GNN model, most existing GNN explainers such as GNNExplainer (Ying et al., 2019) and PGExplainer (Luo et al., 2020) identify important edges and construct a subgraph containing all those edges as the explanation of the input graph. However, these models ignore the interactions between edges or nodes and implicitly measure the essence of substructures. To address this limitation, SubgraphX (Yuan et al., 2021) proposed to employ subgraphs for GNN explanation. It explicitly evaluates subgraphs and considers the interaction between different substructures. However, it does not use domain knowledge like motif information when generating the subgraphs.
|
| 47 |
+
|
| 48 |
+
A motif can be regarded as a simple subgraph of a complex graph, which repeatedly appears in graphs and is highly related to the function of the graph. Motifs have been extensively studied in many fields, like biochemistry, ecology, neurobiology, and engineering (Milo et al., 2002; ShenOrr et al., 2002; Alon, 2007; 2019) and are proved to be important. A subgraph identified without considering domain knowledge can be ineffective for downstream tasks like fragment library generation in FBDD. Thus, it is desirable to introduce statistically important motif information to a more human-understandable GNN explanation. In addition, subgraph-based explainers like SubgraphX need to handle a large searching space, which leads to efficiency issues when generating explanations for dense or large scale graphs. In contrast, the number of the extracted motifs can be constrained by well-designed motif extraction rules, which means that using motifs as explanations can significantly reduce the search space. Another limitation of SubgraphX is that it needs to pre-determine a maximum number of nodes for its searching space. As the number of nodes in graphs varies greatly, it is hard to set a proper number for searching subgraphs. A large number will tremendously increase the computational resources, while a small number can limit the power of the explainer. To address the limitations of subgraph-based explainers, we propose a novel method that explicitly select important motifs as an explanation for a given graph. Compared to explainers based on subgraphs, our method generates explanations with motifs, which are statistically important and more human-understandable.
|
| 49 |
+
|
| 50 |
+
# 3.2 MOTIF EXTRACTION
|
| 51 |
+
|
| 52 |
+
This section introduces domain-specific motif extraction rules.
|
| 53 |
+
|
| 54 |
+
<table><tr><td>Algorithm1MotifExplainerfor graphclassification tasks</td><td></td></tr><tr><td>Input: a set of graphs G, labels for graphs Y = {y1,.,yi,., yn}, a pre-trained GNN 亚(), a pre-trained classifier $(-), motif extraction rule R</td><td rowspan="3"></td></tr><tr><td>Initialization: initial a trainable weight matrix W for graph Gi in g do Graph embedding j = 亚(Gi)</td></tr><tr><td>Create motif list M = {m1,., mj,.,mt} based on extraction rule R Generate motif embedding for each motif mj = 亚(mj) Obtain an output score for each motif sj = mj · W . h Train an attention weight for each motif αj = exp(sj)</td></tr></table>
|
| 55 |
+
|
| 56 |
+
Domain knowledge. When working with data from different domains, motifs are extracted based on specific domain knowledge. For example, in biological networks, feed-forward loop, bifan, singleinput, and multi-input motifs are popular motifs, which have shown to have different properties and functions (Alon, 2007; Mangan & Alon, 2003; Gorochowski et al., 2018). For graphs or networks in the engineering domain, the three-node feedback loop (Leite & Wang, 2010) and four-node feedback loop motifs (Piraveenan et al., 2013) are important in addition to the feed-forward loop and bifan motifs. Motifs have also been shown to be important in computational Chemistry (Yu & Gao, 2022). The structures of these motifs are illustrated in Appendix C.
|
| 57 |
+
|
| 58 |
+
Extraction methods. For molecule datasets, we can use sophisticated decomposition methods like RECAP (Lewell et al., 1998) and BRICS (Degen et al., 2008) algorithms to extract motifs. For other datasets that do not have mature extraction methods like biological networks and social networks, inspired by related works on graph feature representation learning (Yu & Gao, 2022; Bouritsas et al., 2022), we propose a general extraction method in Appendix B that only considers cycles and edges as motifs, which can cover most popular network motifs. Our methods can be easily applied to other domains by changing the motif extraction rules accordingly.
|
| 59 |
+
|
| 60 |
+
Computational graph. We define the computational graph of a given graph based on different tasks. The computational graph includes all nodes and edges contributing to the prediction. Since most GNNs follow a neighborhood-aggregation scheme, the computational graph usually depends on the architecture of GNNs, such as the number of layers. In graph classification tasks, all nodes and edges contribute to the final prediction. Thus, a graph itself is its computational graph in graph classification tasks. For node classification tasks, a target node’s computational graph is the $L$ -hop subgraph centered on the target node, where $L$ is the number of GNN layers. Here, we only consider motifs in the computational graph since those outside it are irrelevant to the predictions.
|
| 61 |
+
|
| 62 |
+
Motif extraction. Given a graph $G$ , we extract all motifs based on the motif extraction method. If a motif has been extracted from the graph, it is added to a motif list $\mathcal { M }$ . After searching the whole graph, there may be edges not in any motif. We regard each of them as a one-edge motif and add them to the motif list to retain the integrity of the graph information. At last, we can obtain the motif list $\mathcal { M } = [ m _ { 1 } , m _ { 2 } , . . . , m _ { t } ]$ in $G$ .
|
| 63 |
+
|
| 64 |
+
# 3.3 MOTIF EMBEDDING
|
| 65 |
+
|
| 66 |
+
After extracting motifs $\mathcal { M }$ from a given graph, we encode the feature representations for each motif. Given a pre-trained GNN model, we split it into two parts: a feature extractor $\Psi ( \cdot )$ and a classifier $\xi ( \cdot )$ . The feature extractor $\Psi ( \cdot )$ generates an embedding for the prediction target. In particular, $\Psi ( \cdot )$ outputs graph embeddings in graph classification tasks, and outputs node embeddings in node classification tasks. The motif embedding is obtained in a graph classification task by feeding all motif node embeddings into a readout function. While in a node classification task, motif embedding encodes the influence of the motif on the node embedding of the target node. Thus, we feed the target node $k$ and a motif $m _ { j } \in { \mathcal { M } }$ as a subgraph into the GNN feature extractor $\Psi ( \cdot )$ and use the resulting target node embedding of $k$ as the embedding of the motif. To ensure the connectivity of the subgraph, we keep edges from the target node to the motif and mask features of irrelevant nodes.
|
| 67 |
+
|
| 68 |
+
# 3.4 GNN EXPLANATION FOR GRAPH CLASSIFICATION TASKS
|
| 69 |
+
|
| 70 |
+
This section introduces how to generate an explanation for a pre-trained GNN model in a graph classification task. We split the pre-trained GNN model into a feature extractor $\Psi ( \cdot )$ and a classifier $\xi ( \cdot )$ . Given a graph $G$ , its original graph embedding $^ { h }$ is computed as $h = \Psi ( G )$ . The prediction $y$ is computed by $y = \xi ( h )$ .
|
| 71 |
+
|
| 72 |
+
Based on the given graph, our method extracts a motif list from it and generates motif embedding $M = [ \pmb { m } _ { 1 } , \pmb { m } _ { 2 } , \dots , \pmb { m } _ { t } ]$ using the pre-trained feature extractor $\Psi ( \cdot )$ . Since the original graph embedding is directly related to the predictions, we identify the most important motifs by investigating relationships between the original graph embedding and motif embeddings. To this end, we employ an attention layer, which uses the original graph embedding $h = \Psi ( G )$ as query and motif embedding $M$ as keys and values. The output of the attention layer is considered as a new graph embedding $h ^ { \prime }$ . We interpret the attentions scores as the strengths of relationships between the prediction and motifs. Thus, highly relevant motifs will contribute more to the new graph embedding. By feeding the new graph embedding $\mathbf { { } } h ^ { \prime }$ into the pre-trained graph classifier $\xi ( \cdot )$ , a new prediction $y ^ { \prime } = \xi ( h ^ { \prime } )$ is obtained. The loss based on $y$ and $y ^ { \prime }$ evaluates the contribution of selected motifs to the final prediction, which trains the attention layer such that important motifs are selected to produce similar predictions to the original graph embedding. Formally, this explanation process can be represented as
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } & { \boldsymbol { h } = \boldsymbol { \Psi } ( G ) , \boldsymbol { y } = \boldsymbol { \xi } ( \boldsymbol { h } ) , } \\ & { \boldsymbol { M } = [ m _ { 1 } , m _ { 2 } , \ldots , m _ { t } ] = \mathop { \bf M o t i f E x t r a c t o r } ( G ) , } \\ & { \boldsymbol { M } = [ m _ { 1 } , m _ { 2 } , \ldots , m _ { t } ] = [ \boldsymbol { \Psi } ( m _ { i } ) ] _ { i = 1 } ^ { t } , } \\ & { \boldsymbol { h } ^ { \prime } = \mathrm { A t t n } ( \boldsymbol { h } , \boldsymbol { M } , \boldsymbol { M } ) , } \\ & { \boldsymbol { y } ^ { \prime } = \boldsymbol { \xi } ( \boldsymbol { h } ^ { \prime } ) , } \\ & { \mathrm { l o s s } = \boldsymbol { f } ( \boldsymbol { y } , \boldsymbol { y } ^ { \prime } ) , } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where Attn is an attention layer and $f$ is a loss function. After training, we use the attention scores to identify important motifs. To our knowledge, our work first attempts to use the attention mechanism for GNN explanation. We want to mention that attention mechanism is only a tool for selecting important motifs. Any other methods that can identify relevances between two feature vectors can be applied in our model. In addition, attention scores are only used in training, while we have other metrics for evaluation.
|
| 79 |
+
|
| 80 |
+
During testing, we use a threshold $\sigma / t$ to select important motifs, where $\sigma$ is a hyper-parameter and $t$ is the number of motifs extracted. The explanation includes the motifs whose attention scores are larger than the threshold. Algorithm 1 describes our GNN explanation method on graph classification tasks. In addition, we provide an illustration of the proposed MotifExplainer in Figure 1.
|
| 81 |
+
|
| 82 |
+
# 3.5 GNN EXPLANATION FOR NODE CLASSIFICATION TASKS
|
| 83 |
+
|
| 84 |
+
This section introduces how to generate an explanation for a node classification task. Given a graph $G$ and a target node $v _ { i }$ , we first construct a computational graph for $v _ { i }$ , which is an $L$ -hop subgraph as described in Section 3.2. Then we extract motifs from the computational graph and generate motif embedding for each motif using the feature extractor $\Psi ( \cdot )$ . To keep the connectivity between a target node and a motif, we keep the shortest path between each node in the motif and the target node in an explanation graph. To reduce the impact of nodes on the path, we set irrelevant nodes’ features to zero. After that, the proposed MotifExplainer employs an attention layer to identify important motifs. The attention layer for node classification tasks is similar to the one for graph classification tasks, except that the query is the embedding of the target node. A node embedding is generated by feeding the whole graph into the feature extractor $\Psi ( \cdot )$ . The target node’s output feature vector $\boldsymbol { h } _ { i }$ is used as the query vector in the attention layer, which outputs the new node embedding $ { \boldsymbol { h } } _ { i } ^ { \prime }$ . Similarly, the new prediction $y ^ { \prime } = \xi ( h _ { i } ^ { \prime } )$ is obtained by feeding $ { \boldsymbol { h } } _ { i } ^ { \prime }$ into the pre-trained classifier. We use a threshold $\sigma / t$ during testing to identify important motifs as an explanation. Algorithm 2 in the appendix describes the details of the MotifExplainer on node classification tasks. Formally, the different parts from Section 3.4 are represented as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r l } & { \pmb { h } = \Psi ( G ) _ { i } , y = \xi ( \pmb { h } ) , } \\ & { G _ { c } = \mathrm { C o m p u t a t i o n G r a p h } ( G , v _ { i } ) , } \\ & { M = [ m _ { 1 } , m _ { 2 } , \dotsc , m _ { t } ] = \mathrm { M o t i f E x t r a c t o r } ( G _ { c } ) . } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
Then, Eq. (3 - 6) are applied to compute loss for training the attention layer.
|
| 91 |
+
|
| 92 |
+
# 4 EXPERIMENTAL STUDIES
|
| 93 |
+
|
| 94 |
+
We conduct experiments to evaluate the proposed methods on both real-world and synthetic datasets.
|
| 95 |
+
|
| 96 |
+
# 4.1 DATASETS AND EXPERIMENTAL SETTINGS
|
| 97 |
+
|
| 98 |
+
We evaluate the proposed methods using different downstream tasks on seven datasets to demonstrate the effectiveness of our model. The statistic and properties of seven datasets are summarized in Appendix D. The details are introduced below.
|
| 99 |
+
|
| 100 |
+
Datasets. MUTAG (Kazius et al., 2005; Riesen & Bunke, 2008) is a chemical compound dataset containing 4,337 molecule graphs. Each graph can be categorized into mutagen and non-mutagen.
|
| 101 |
+
|
| 102 |
+
PTC (Kriege & Mutzel, 2012) is a collection of 344 chemical compounds reporting the carcinogenicity for rats.
|
| 103 |
+
|
| 104 |
+
NCI1 (Wale et al., 2008) is a balanced subset of datasets of chemical compounds screened for activity against non-small cell lung cancer and ovarian cancer cell lines respectively.
|
| 105 |
+
|
| 106 |
+
PROTEINS (Dobson & Doig, 2003) is a protein dataset classified as enzymatic or non-enzymatic.
|
| 107 |
+
|
| 108 |
+
IMDB-BINARY (Yanardag & Vishwanathan, 2015) is a movie collaboration dataset that consists of the ego-networks of 1,000 actors/actresses who played roles in movies in IMDB.
|
| 109 |
+
|
| 110 |
+
BA-2Motifs (Luo et al., 2020) is a synthetic graph classification dataset. It contains 800 graphs, and each graph is generated from a Barabasi-Albert (BA) base graph.
|
| 111 |
+
|
| 112 |
+
BA-Shapes (Ying et al., 2019) is a synthetic node classification dataset. It contains a single base BA graph with 300 nodes.
|
| 113 |
+
|
| 114 |
+
Experimental settings. Our experiments adopt a simple GNN model and focus on explanation results. More details of settings can be found in Appendix B. We compare our MotifExplainer model with several state-of-the-art baselines: GNNExplainer, SubgraphX, PGExplainer, and ReFine. We also build a model that uses the same attention layer as MotifExplainer but assigns weights to edges instead of motifs. Noted that all methods are compared in a fair setting. During prediction, we use $\sigma = 1$ to control the size of selected motifs. Unlike other methods, we do not explicitly set a fixed number for selected edges as explanations, enabling maximum flexibility and capability when selecting important motifs.
|
| 115 |
+
|
| 116 |
+
Evaluation metrics. A fundamental criterion for explanations is that they must be humanexplainable, which means the generated explanations should be easy to understand. Taking the BA-2Motif as an example, a graph label is determined by the house structure attached to a base BA graph. A good explanation of GNNs on this dataset should highlight the house structure. To this end, we perform qualitative analysis to evaluate the proposed method.
|
| 117 |
+
|
| 118 |
+
Even though qualitative analysis/visualizations can provide insight into whether an explanation is reasonable for human beings, this assessment is not entirely dependable due to the lack of ground truth in real-world datasets. Thus, we employ three quantitative evaluation metrics to evaluate our explanation methods. We use the Accuracy metric to evaluate models for synthesis datasets with ground truth. Here, we use the same settings as GNNExplainer and PGExplainer. In particular, we regard edges inside ground truth motifs as positive edges and edges outside motifs as negative.
|
| 119 |
+
|
| 120 |
+
An explainer aims to answer a question that when a trained GNN predicts an input, which part of the input makes the greatest contribution. To this end, the explanation selected by an explainer must be unique and discriminative. Intuitively, the explanation obtained by the explainer should obtain similar prediction results as the original graph. Also, the explanation is in a reasonable size. Thus, following (Yuan et al., 2020b), we use Fidelity and Sparsity metrics to evaluate the proposed method on real-world datasets. In particular, the Fidelity metric studies the prediction change by keeping important input features and removing unimportant features. The Sparsity metric measures the proportion of edges selected by explanation methods. Formally, they are computed by
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 2: Visualization of explanation results from different explanation models on three datasets. The generated explanations are highlighted by green and bold edges. Three rows are results on the MUTAG dataset, the BA-Shape dataset, and the BA-2Motif dataset, respectively. We only show the motif-related edges for two synthetic datasets to save space.
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r l } & { \mathrm { F i d e l i t y } = \displaystyle \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left( \Psi ( G _ { i } ) _ { y _ { i } } - \Psi ( G _ { i } ^ { p _ { i } } ) _ { y _ { i } } \right) , } \\ & { \mathrm { S p a r s i t y } = \displaystyle \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left( 1 - \frac { | p _ { i } | } { | G _ { i } | } \right) , } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $p _ { i }$ is an explanation for an input graph $G _ { i }$ . $| p _ { i } |$ and $| G _ { i } |$ denote the number of edges in the explanation, and the number in the original input graph, respectively.
|
| 130 |
+
|
| 131 |
+
# 4.2 QUALITATIVE RESULTS
|
| 132 |
+
|
| 133 |
+
In this section, we visually compare the explanations of our model with those of state-of-the-art explainers. Some results are illustrated in Figure 2, with generated explanations highlighted. We report the visualization results of the MUTAG dataset in the first row. Unlike BA-Shape and BA2Motif, MUTAG is a real-world dataset and does not have ground truth for explanations. We need to leverage domain knowledge to analyze the generated explanations. In particular, carbon rings with chemical groups $\mathrm { N H _ { 2 } }$ or $\mathrm { N O _ { 2 } }$ tend to be mutagenic. As mentioned by PGExplainer, carbon rings appear in both mutagen and non-mutagenic graphs. Thus, the chemical groups $\mathrm { N H _ { 2 } }$ and $\mathrm { N O _ { 2 } }$ are more important and considered as the ground truth for explanations. From the results, our MotifExplainer can accurately identify $\mathrm { N H _ { 2 } }$ and $\mathrm { N O _ { 2 } }$ in a graph while other models can not. PGExplainer identifies some extra unimportant edges. SubgraphX produces subgraphs as explanations that are neither motifs nor human-understandable. Our proposed GNN explainer can consider motif information and generate better explanations on molecular graphs. Note that neither $\mathrm { N H _ { 2 } }$ nor $\mathrm { N O _ { 2 } }$ is explicitly included in our motif extraction rules. The explanation is generated by identifying bonds in these groups, which means that our method can be used to find motifs.
|
| 134 |
+
|
| 135 |
+
We show the visualization results of the BA-Shape dataset in the second row of Figure 2. In this dataset, a node’s label depends on its location as described in Section 4.1. Thus, an explanation generated by an explainer for a target node should be the motif. We consider the selected edges on the motif to be positive and those not on the motif negative. From the results, our MotifExplainer can accurately mark the motif as the explanation. However, other models select a part of the motif or include extra non-motif edges. The third row of Figure 2 shows the visualization results on the BA-2Motif dataset, which is also a synthetic dataset. From Section 4.1, a graph’s label is determined by the motif attached to the base graph: the five nodes house-like motif or the five nodes cycle motif.
|
| 136 |
+
|
| 137 |
+
Table 1: Results on quantitative studies for different explanation methods. Note that since the Sparsity cannot be fully controlled, we report Fidelity scores under similar Sparsity levels. For two synthetic datasets BA-Shape and BA-2Motif, we report accuracy. $S$ is the sparsity value. $K$ is the maximum number of edges required by baseline models. Our MotifExplainer does not need this required hyper-parameter. The best performances on each dataset are shown in bold.
|
| 138 |
+
|
| 139 |
+
<table><tr><td></td><td>MUTAG S=0.7</td><td>PTC S=0.7</td><td>NCI1 S=0.7</td><td>PROTEINS IMDB S=0.7</td><td>S=0.7</td><td>BA-2Motif K=5</td><td>BA-Shape K=5</td></tr><tr><td>GNNExplainer</td><td>0.260</td><td>0.441</td><td>0.365</td><td>0.453</td><td>0.365</td><td>0.742</td><td>0.925</td></tr><tr><td>PGExplainer</td><td>0.241</td><td>0.388</td><td>0.402</td><td>0.521</td><td>0.225</td><td>0.926</td><td>0.963</td></tr><tr><td>SubgraphX</td><td>0.287</td><td>0.227</td><td>0.303</td><td>0.021</td><td>0.167</td><td>0.774</td><td>0.874</td></tr><tr><td>ReFine</td><td>0.221</td><td>0.349</td><td>0.409</td><td>0.435</td><td>0.127</td><td>0.932</td><td>0.954</td></tr><tr><td>MotifExplainer</td><td>0.031</td><td>0.129</td><td>0.115</td><td>-0.030</td><td>0.101</td><td>1.0</td><td>1.0</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Thus, we treat all edges in these two motifs to be positive and the rest of edges to be negative. From the results, we can see that our MotifExplainer can precisely identify both the house-like motif and the cycle motif in a graph without including non-motif edges. While other models select edges far from the motif. More qualitative analysis results are reported in Appendix F.
|
| 142 |
+
|
| 143 |
+
# 4.3 QUANTITATIVE RESULTS
|
| 144 |
+
|
| 145 |
+
This section shows evaluations of our methods using seven datasets. We report the Fidelity score under the same Sparsity value on five real-world dataset and accuracy on the other two synthetic datasets. More Fidelity scores on real-world dataset are shown in Appendix E. The results are summarized in Table 1. From the results, our MotifExplainer consistently outperforms previous state-of-the-art models on all seven datasets under Sparsity value equals to 0.7 . Note that our method achieves $100 \%$ accuracy on two synthetic datasets and at least $2 . 6 \%$ to $1 9 . 0 \%$ improvements on the real-world datasets, demonstrating our model’s effectiveness.
|
| 146 |
+
|
| 147 |
+
Our model can maintain good performances when Sparsity is high. In particular, in the case of high Sparsity, the explanation contains a very limited number of edges, which shows that our model can identify the most important structures for GNN explanations. Using motifs as basic explanation units, our model can preserve the characteristics of motifs and the connectivity of edges.
|
| 148 |
+
|
| 149 |
+
# 4.4 THRESHOLD STUDIES
|
| 150 |
+
|
| 151 |
+
Our MotifExplainer uses a threshold $\sigma$ to select important motifs as explanations during inference. Since $\sigma$ is an important hyper-parameter, we conduct experiments to study its impact using Sparsity and Fi
|
| 152 |
+
|
| 153 |
+
Table 2: The study of threshold.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Threshold σ</td><td>1.0</td><td>1.2</td><td>1.5</td><td>1.7</td><td>2.0</td></tr><tr><td>Sparsity</td><td>0.4</td><td>0.5</td><td>0.6</td><td>0.7</td><td>0.8</td></tr><tr><td>Fidelity</td><td>0.025</td><td>0.053</td><td>0.054</td><td>0.031</td><td>0.028</td></tr></table>
|
| 156 |
+
|
| 157 |
+
delity metrics. The performances of MotifExplainer using different $\sigma$ values on the MUTAG dataset are summarized in Table 2. Here, we vary the $\sigma$ value from 1.0 to 2.0 to cover a reasonable range. We can observe that when the threshold is larger, the Sparsity of explanations increases, and the performances in terms of Fidelity gradually decrease. This is expected since fewer motifs selected will be selected when the threshold becomes larger. Thus, the size of explanations becomes smaller, and the Sparsity value becomes larger. Note that even when the Sparsity reaches a high value of 0.8, our model can still perform well. This shows that our model can accurately select the most important motifs as explanations, demonstrating the advantage of using motifs as GNN explanations.
|
| 158 |
+
|
| 159 |
+
# 4.5 ABLATION STUDIES
|
| 160 |
+
|
| 161 |
+
Our MotifExplainer employs an attention model to score and select the most relevant motifs to explain a given graph. To demonstrate the effectiveness of using motifs as basic explanation units, we build a new model named AttnExplainer that uses
|
| 162 |
+
|
| 163 |
+
Table 3: Results for AttnExplainer and MotifExplainer on three datasets. $K { = } 5$ for two synthetic datasets.
|
| 164 |
+
|
| 165 |
+
<table><tr><td></td><td>MUTAG</td><td>BA-2Motif</td><td>BA-Shape</td></tr><tr><td>AttnExplainer</td><td>0.166</td><td>0.934</td><td>0.955</td></tr><tr><td>MotifExplainer</td><td>0.031</td><td>1.0</td><td>1.0</td></tr></table>
|
| 166 |
+
|
| 167 |
+
edges as basic explanation units and apply an attention model to select relevant edges as explana
|
| 168 |
+
|
| 169 |
+
tions. We compare our MotifExplainer with AttnExplainer on three datasets: BA-Shape, BA-2Motif, MUTAG. The results are summarized in Table 3, appendix E. From the results, our model can consistently outperform AttnExplainer. This is because motifs can better obtain structural information than edges by using motif as the basic unit for explanation.
|
| 170 |
+
|
| 171 |
+
# 4.6 EFFICIENCY STUDIES
|
| 172 |
+
|
| 173 |
+
We study the efficiency of our proposed model in terms of the training time and the inference time. For models that need to be trained, such as PGExplainer and ReFine, training and evaluation processes are separate. We report training and inference time separately. In our proposed method, the training time includes three parts: motif extraction, motif embedding construction, and the training of the attention model. For models that do not require training, their training time will be 0. For each model, we run it on the MUTAG dataset and show the averaging time consumed to obtain explanations for each graph. Table 4 shows the comparison results with four state-of-the-art GNN explanation models: MotifExplainer, SubgraphX, PGExplainer, GNNExplainer, and ReFine. From the results, our model has the shortest inference time among models. Compared to PGExplainer and ReFine, our model requires significantly less training time. From this point, the proposed method is efficient and feasible in real-world applications.
|
| 174 |
+
|
| 175 |
+
Table 4: Results on efficiency studies.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Method</td><td>Inference</td><td>Training</td></tr><tr><td>GNNExplainer</td><td>24.3s</td><td>0s</td></tr><tr><td>PGExplainer</td><td>0.03s</td><td>740s</td></tr><tr><td>SubgraphX</td><td>96.7s</td><td>0s</td></tr><tr><td>ReFine</td><td>0.83s</td><td>946s</td></tr><tr><td>MotifExplainer</td><td>0.02s</td><td>363s</td></tr></table>
|
| 178 |
+
|
| 179 |
+
# 5 RELATED WORK
|
| 180 |
+
|
| 181 |
+
The research on GNN explainability is mainly divided into two categories: instance-level explanation and model-level explanation. Instance-level GNN explanation can also be divided into four directions, namely gradients/features-based methods, surrogate methods, decomposition methods, and perturbation-based methods. Gradients/features-based methods use gradients or hidden feature map values as the approximations of an importance score of an input. Recently, several methods have been employed to explain GNNs like SA (Baldassarre & Azizpour, 2019), CAM (Pope et al., 2019), Grad-CAM (Pope et al., 2019). The basic idea of surrogate methods is using a simple and explainable surrogate model to approximate the predictions of GNNs. Several methods have been introduced recently, such as GraphLime (Huang et al., 2020) and PGM-Explainer (Vu & Thai, 2020). Decomposition methods like GNN-LRP (Schnake et al., 2020) and DEGREE (Feng et al., 2021) measure the importance of input features by decomposing original predictions into several terms. The last method is the perturbation-based method. Along this direction, GNNExplainer (Ying et al., 2019) learns soft masks for edges and node features to generate an explanation via mask optimization. PGExplainer (Luo et al., 2020) learns approximated discrete masks for edges by using domain knowledge. SubgraphX (Yuan et al., 2021) employs Monte Carlo Tree Search algorithm to search possible subgraphs and uses Shapley value to measure the importance of subgraphs and choose a subgraph as the explanation. ReFine (Wang et al., 2021) proposes an idea of generating multigrained explanations. There are also some reinforcement learning based explainers (Shan et al., 2021; Wang et al., 2022). Model-level explanation methods aim to find the general insights and high-level information. So far, there is only one model-level explainer: XGNN (Yuan et al., 2020a). XGNN trains a generator and generates a graph as explanation to maximize a target prediction.
|
| 182 |
+
|
| 183 |
+
# 6 CONCLUSION
|
| 184 |
+
|
| 185 |
+
This work proposes a novel model-agnostic motif-based GNN explainer to explain GNNs by identifying important motifs, which are recurrent and statistically significant patterns in graphs. Our proposed motif-based methods can provide better human-understandable explanations than methods based on nodes, edges, and regular subgraphs. Given a graph, We first extract motifs from a graph using motif extraction rules based on domain knowledge. Then, motif embedding for each motif is generated using the feature extractor from a pre-trained GNN. After that, we train an attention model to select the most relevant motifs based on attention weights and use these selected motifs as an explanation for the input graph. Experimental results show that our MotifExplainer can significantly improve explanation performances from quantitative and qualitative aspects.
|
| 186 |
+
|
| 187 |
+
# REFERENCES
|
| 188 |
+
|
| 189 |
+
Uri Alon. Network motifs: theory and experimental approaches. Nature Reviews Genetics, 8(6): 450–461, 2007.
|
| 190 |
+
|
| 191 |
+
Uri Alon. An introduction to systems biology: design principles of biological circuits. CRC press, 2019.
|
| 192 |
+
|
| 193 |
+
Mohit Bajaj, Lingyang Chu, Zi Yu Xue, Jian Pei, Lanjun Wang, Peter Cho-Ho Lam, and Yong Zhang. Robust counterfactual explanations on graph neural networks. Advances in Neural Information Processing Systems, 34, 2021.
|
| 194 |
+
|
| 195 |
+
Federico Baldassarre and Hossein Azizpour. Explainability techniques for graph convolutional networks. arXiv preprint arXiv:1905.13686, 2019.
|
| 196 |
+
|
| 197 |
+
Giorgos Bouritsas, Fabrizio Frasca, Stefanos P Zafeiriou, and Michael Bronstein. Improving graph neural network expressivity via subgraph isomorphism counting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
|
| 198 |
+
|
| 199 |
+
Jorg Degen, Christof Wegscheid-Gerlach, Andrea Zaliani, and Matthias Rarey. On the art of compil-¨ ing and using’drug-like’chemical fragment spaces. ChemMedChem: Chemistry Enabling Drug Discovery, 3(10):1503–1507, 2008.
|
| 200 |
+
|
| 201 |
+
Paul D Dobson and Andrew J Doig. Distinguishing enzyme structures from non-enzymes without alignments. Journal of molecular biology, 330(4):771–783, 2003.
|
| 202 |
+
|
| 203 |
+
Daniel A Erlanson, Robert S McDowell, and Tom O’Brien. Fragment-based drug discovery. Journal of medicinal chemistry, 47(14):3463–3482, 2004.
|
| 204 |
+
|
| 205 |
+
Qizhang Feng, Ninghao Liu, Fan Yang, Ruixiang Tang, Mengnan Du, and Xia Hu. Degree: Decomposition based explanation for graph neural networks. In International Conference on Learning Representations, 2021.
|
| 206 |
+
|
| 207 |
+
Hongyang Gao and Shuiwang Ji. Graph u-nets. In international conference on machine learning, pp. 2083–2092. PMLR, 2019.
|
| 208 |
+
|
| 209 |
+
Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1416–1424, 2018.
|
| 210 |
+
|
| 211 |
+
Thomas E Gorochowski, Claire S Grierson, and Mario Di Bernardo. Organization of feed-forward loop motifs reveals architectural principles in natural and engineered networks. Science advances, 4(3):eaap9751, 2018.
|
| 212 |
+
|
| 213 |
+
Qiang Huang, Makoto Yamada, Yuan Tian, Dinesh Singh, Dawei Yin, and Yi Chang. Graphlime: Local interpretable model explanations for graph neural networks. arXiv preprint arXiv:2001.06216, 2020.
|
| 214 |
+
|
| 215 |
+
Jeroen Kazius, Ross McGuire, and Roberta Bursi. Derivation and validation of toxicophores for mutagenicity prediction. Journal of medicinal chemistry, 48(1):312–320, 2005.
|
| 216 |
+
|
| 217 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 218 |
+
|
| 219 |
+
Nils Kriege and Petra Mutzel. Subgraph matching kernels for attributed graphs. arXiv preprint arXiv:1206.6483, 2012.
|
| 220 |
+
|
| 221 |
+
Maria Conceic¸ao A Leite and Yunjiao Wang. Multistability, oscillations and bifurcations in feedback ˜ loops. Mathematical Biosciences & Engineering, 7(1):83, 2010.
|
| 222 |
+
|
| 223 |
+
Xiao Qing Lewell, Duncan B Judd, Stephen P Watson, and Michael M Hann. Recap retrosynthetic combinatorial analysis procedure: a powerful new technique for identifying privileged molecular fragments with useful applications in combinatorial chemistry. Journal of chemical information and computer sciences, 38(3):511–522, 1998.
|
| 224 |
+
|
| 225 |
+
Wanyu Lin, Hao Lan, and Baochun Li. Generative causal explanations for graph neural networks. arXiv preprint arXiv:2104.06643, 2021.
|
| 226 |
+
|
| 227 |
+
Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 338–348, 2020.
|
| 228 |
+
|
| 229 |
+
Dongsheng Luo, Wei Cheng, Dongkuan Xu, Wenchao Yu, Bo Zong, Haifeng Chen, and Xiang Zhang. Parameterized explainer for graph neural network. arXiv preprint arXiv:2011.04573, 2020.
|
| 230 |
+
|
| 231 |
+
Shmoolik Mangan and Uri Alon. Structure and function of the feed-forward loop network motif. Proceedings of the National Academy of Sciences, 100(21):11980–11985, 2003.
|
| 232 |
+
|
| 233 |
+
Ron Milo, Shai Shen-Orr, Shalev Itzkovitz, Nadav Kashtan, Dmitri Chklovskii, and Uri Alon. Network motifs: simple building blocks of complex networks. Science, 298(5594):824–827, 2002.
|
| 234 |
+
|
| 235 |
+
Mahendra Piraveenan, Kishan Wimalawarne, and Dharshana Kasthurirathn. Centrality and composition of four-node motifs in metabolic networks. Procedia Computer Science, 18:409–418, 2013.
|
| 236 |
+
|
| 237 |
+
Phillip E Pope, Soheil Kolouri, Mohammad Rostami, Charles E Martin, and Heiko Hoffmann. Explainability methods for graph convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10772–10781, 2019.
|
| 238 |
+
|
| 239 |
+
Kaspar Riesen and Horst Bunke. Iam graph database repository for graph based pattern recognition and machine learning. In Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), pp. 287–297. Springer, 2008.
|
| 240 |
+
|
| 241 |
+
Thomas Schnake, Oliver Eberle, Jonas Lederer, Shinichi Nakajima, Kristof T Schutt, Klaus-Robert ¨ Muller, and Gr ¨ egoire Montavon. Higher-order explanations of graph neural networks via relevant ´ walks. arXiv preprint arXiv:2006.03589, 2020.
|
| 242 |
+
|
| 243 |
+
Caihua Shan, Yifei Shen, Yao Zhang, Xiang Li, and Dongsheng Li. Reinforcement learning enhanced explainer for graph neural networks. Advances in Neural Information Processing Systems, 34:22523–22533, 2021.
|
| 244 |
+
|
| 245 |
+
Shai S Shen-Orr, Ron Milo, Shmoolik Mangan, and Uri Alon. Network motifs in the transcriptional regulation network of escherichia coli. Nature genetics, 31(1):64–68, 2002.
|
| 246 |
+
|
| 247 |
+
Minh N Vu and My T Thai. Pgm-explainer: Probabilistic graphical model explanations for graph neural networks. arXiv preprint arXiv:2010.05788, 2020.
|
| 248 |
+
|
| 249 |
+
Nikil Wale, Ian A Watson, and George Karypis. Comparison of descriptor spaces for chemical compound retrieval and classification. Knowledge and Information Systems, 14(3):347–375, 2008.
|
| 250 |
+
|
| 251 |
+
Xiang Wang, Yingxin Wu, An Zhang, Xiangnan He, and Tat-Seng Chua. Towards multi-grained explainability for graph neural networks. Advances in Neural Information Processing Systems, 34, 2021.
|
| 252 |
+
|
| 253 |
+
Xiang Wang, Yingxin Wu, An Zhang, Fuli Feng, Xiangnan He, and Tat-Seng Chua. Reinforced causal explainer for graph neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
|
| 254 |
+
|
| 255 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 256 |
+
|
| 257 |
+
Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In Proceedings of the 21th ACM SIGKDD international conference on knowledge discovery and data mining, pp. 1365–1374, 2015.
|
| 258 |
+
|
| 259 |
+
Rex Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. Gnnexplainer: Generating explanations for graph neural networks. Advances in neural information processing systems, 32:9240, 2019.
|
| 260 |
+
|
| 261 |
+
Zhaoning Yu and Hongyang Gao. Molecular representation learning via heterogeneous motif graph neural networks. In International Conference on Machine Learning, pp. 25581–25594. PMLR, 2022.
|
| 262 |
+
|
| 263 |
+
Hao Yuan, Jiliang Tang, Xia Hu, and Shuiwang Ji. Xgnn: Towards model-level explanations of graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 430–438, 2020a.
|
| 264 |
+
|
| 265 |
+
Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. arXiv preprint arXiv:2012.15445, 2020b.
|
| 266 |
+
|
| 267 |
+
Hao Yuan, Haiyang Yu, Jie Wang, Kang Li, and Shuiwang Ji. On explainability of graph neural networks via subgraph explorations. arXiv preprint arXiv:2102.05152, 2021.
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Algorithm2 MotifExplainer for node classification tasks</td></tr><tr><td>Input: a graph G, labels for al nodes in the graph Y = {y1,.., yi,.,yn}, a pre-trained GNN 亚(·),a pre-trained classifier $(·),motif extraction rule R</td></tr><tr><td>Initialization: initial a trainable weight matrix W,calculate all node embedding H= {h1,..,hi,...,hn}</td></tr><tr><td>for node vi in the graph G do</td></tr><tr><td>Original node embedding hi ∈ H</td></tr><tr><td>Create motif list M = {m1,.., mj,.., mt} based on extraction rule R For each motif mj, we keep the motif, the target node vi and the edges between them. Then we</td></tr><tr><td>put this subgraph into the pre-trained GNN 亚(·) and get a new node embedding of target node</td></tr><tr><td>Ui as the motif embedding mj Obtain an output score for each motif sj = mj · W · hi</td></tr><tr><td>Train an attention weight for each motif α j = exp(sj)</td></tr><tr><td>exp(sk)</td></tr><tr><td>Acquire an alternative graph embedding h' = ∑=1. t αkmk</td></tr><tr><td>Output a prediction for the alternative graph embedding yi = ε(h') Calculate loss based on yi and yi Update weight W using back-propagation.</td></tr></table>
|
| 270 |
+
|
| 271 |
+
# B A GENERAL MOTIFS EXTRACTION RULE
|
| 272 |
+
|
| 273 |
+
According to section 3.2, we can easily design motif extraction rules based on some domain knowledge. However, if we don’t have relevant domain knowledge or the dataset type is unknown, we need a general way to obtain the motifs. Inspired by graph feature representation learning works on motifs (Bouritsas et al., 2022; Yu & Gao, 2022), we propose a general method to extract the simplest motifs: cycles and edges. In particular, given a graph, we first extract all cycles out of it. Then, all edges that are not inside the cycles are considered motifs. We consider combining cycles with more than two coincident nodes into a motif. Although this method cannot extract complex motifs like single-input and multi-input motifs, it can generate the most important motifs, such as ring structures in biochemical molecules and the feed-forward loop motif. By adopting this simple but general motif extraction method, we can explain a GNN model without any domain knowledge, making our explanation model more applicable. Need to be noted that, even though the motif extraction rule cannot extract single-input and multi-input motifs, these motifs can be implicitly identified by our attention layer. Experiments in the table 1 demonstrate it.
|
| 274 |
+
|
| 275 |
+
# C COMMON MOTIFS IN BIOLOGICAL AND ENGINEERING NETWORKS
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 3: Popular motifs in biological and engineering networks.
|
| 279 |
+
|
| 280 |
+
In this section, Figure 3 show some common motifs in biological and engineering networks introduced in section 3.2.
|
| 281 |
+
|
| 282 |
+
# D DATASETS AND GNN MODELS
|
| 283 |
+
|
| 284 |
+
# D.1 STATISTIC AND PROPERTIES OF DATASETS
|
| 285 |
+
|
| 286 |
+
Table 5: Statistics and properties of three datasets.
|
| 287 |
+
|
| 288 |
+
<table><tr><td></td><td>MUTAG PTC</td><td>NCI1</td><td></td><td>PROTEINS IMDB</td><td>BA-2Motif</td><td>BA-Shape</td></tr><tr><td>#Edges (avg)</td><td>30.77 14.69</td><td>32.30</td><td>72.82</td><td>96.53</td><td>25.48</td><td>4110</td></tr><tr><td># Nodes (avg)</td><td>30.32 14.29</td><td>29.87</td><td>39.06</td><td>19.77</td><td>25.0</td><td>700</td></tr><tr><td># Graphs</td><td>4337 344</td><td>4110</td><td>1113</td><td>1000</td><td>1000</td><td>1</td></tr><tr><td># Classes</td><td>2 2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>4</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# D.2 SETTINGS OF GNN MODELS
|
| 291 |
+
|
| 292 |
+
For the pre-trained GNN, we use a 3-layer GCN as a feature extractor and a 2-layer MLP as a classifier on all datasets. The GCN model is pre-trained to achieve reasonable performances on all datasets. We use Adam optimizer for training. We set the learning rate to 0.01.
|
| 293 |
+
|
| 294 |
+
Real World Datasets We employ a 3-layer GCNs to train all five real world datasets. The input feature dimension is 7 and the output dimensions of different GCN layers are set to 64, 64, 64, respectively. We employ mean-pooling as the readout function and ReLU as the activation function. The model is trained for 170 epochs with a learning rate of 0.01. We study the explanations for the graphs with correct predictions.
|
| 295 |
+
|
| 296 |
+
BA-Shape We use a 3-layer GCNs and an MLP as a classifier to train the BA-Shape dataset. The hidden dimensions of different GCN layers are set to 64, 64, 64, respectively. We employ ReLU as the activation function. The model is trained for 300 epochs with a learning rate of 0.01. The validation accuracy of the pre-trained model can achieve $1 0 0 \%$ . We study the explanations for the whole dataset.
|
| 297 |
+
|
| 298 |
+
BA-2Motif We use a 3-layer GCNs and an MLP as a classifier to train the BA-2Motif dataset. The hidden dimensions of different GCN layers are set to 64, 64, 64, respectively. We employ mean-pooling as the readout function and ReLU as the activation function. The model is trained for 300 epochs with a learning rate of 0.01. The validation accuracy of the pre-trained model can be $1 0 0 \%$ , which means the model can perfectly generate the distribution of the dataset. We study the explanations for the whole dataset.
|
| 299 |
+
|
| 300 |
+
# D.3 EXPERIMENT ENVIRONMENT SETTINGS
|
| 301 |
+
|
| 302 |
+
We conduct experiments using one Nvidia 2080Ti GPU on an AMD Ryzen 7 3800X 8-Core CPU. Our implementation environment is based on Python 3.9.7, Pytorch 1.10.1, CUDA 10.2, and Pytorch-geometric 2.0.3.
|
| 303 |
+
|
| 304 |
+
# E MORE QUANTITATIVE RESULTS
|
| 305 |
+
|
| 306 |
+
Table 6: Quantitative results on MUTAG dataset. $S$ is the sparsity value. $K$ is the maximum number of edges required by baseline models. The best performances on each dataset are shown in bold.
|
| 307 |
+
|
| 308 |
+
<table><tr><td rowspan="2"></td><td colspan="5">MUTAG (Fidelity)</td></tr><tr><td>S=0.4</td><td>S=0.5</td><td>S=0.6</td><td>S=0.7</td><td>S=0.8</td></tr><tr><td rowspan="4">GNNExplainer PGExplainer SubgraphX ReFine</td><td>0.153</td><td>0.184</td><td>0.219</td><td>0.260</td><td>0.307</td></tr><tr><td>0.133</td><td>0.154</td><td>0.194</td><td>0.241</td><td>0.297</td></tr><tr><td>0.214</td><td>0.233</td><td>0.254</td><td>0.287</td><td>0.376</td></tr><tr><td>0.075</td><td>0.124</td><td>0.180</td><td>0.221</td><td>0.311</td></tr><tr><td rowspan="2">AttnExplainer MotifExplainer</td><td>0.085</td><td>0.111</td><td>0.133</td><td>0.166</td><td>0.182</td></tr><tr><td>0.025</td><td>0.053</td><td>0.054</td><td>0.031</td><td>0.028</td></tr></table>
|
| 309 |
+
|
| 310 |
+
Table 7: Quantitative results on PTC and NCI1 dataset. $S$ is the sparsity value. $K$ is the maximum number of edges required by baseline models. The best performances on each dataset are shown in bold.
|
| 311 |
+
|
| 312 |
+
<table><tr><td rowspan="2"></td><td colspan="3">PTC (Fidelity)</td><td colspan="3">NCI (Fidelity)</td></tr><tr><td>S=0.6</td><td>S=0.7</td><td>S=0.8</td><td>S=0.6</td><td>S=0.7</td><td>S=0.8</td></tr><tr><td>GNNExplainer</td><td>0.3835</td><td>0.4406</td><td>0.4947</td><td>0.3612</td><td>0.3653</td><td>0.3648</td></tr><tr><td>PGExplainer</td><td>0.3653</td><td>0.3886</td><td>0.3917</td><td>0.4013</td><td>0.4029</td><td>0.4045</td></tr><tr><td>ReFine</td><td>0.3268</td><td>0.3499</td><td>0.3575</td><td>0.4028</td><td>0.4093</td><td>0.4115</td></tr><tr><td>SubgraphX</td><td>0.2062</td><td>0.2274</td><td>0.2643</td><td>0.1697</td><td>0.3036</td><td>0.4075</td></tr><tr><td>MotifExplainer</td><td>0.1162</td><td>0.1299</td><td>0.2256</td><td>0.1002</td><td>0.1154</td><td>0.1297</td></tr></table>
|
| 313 |
+
|
| 314 |
+
Table 8: Quantitative results on PROTEINS and IMDB-B dataset. $S$ is the sparsity value. $K$ is the maximum number of edges required by baseline models. The best performances on each dataset are shown in bold.
|
| 315 |
+
|
| 316 |
+
<table><tr><td rowspan="2"></td><td colspan="2">PROTEINS (Fidelity)</td><td colspan="3">IMDB-B (Fidelity)</td></tr><tr><td>S=0.6</td><td>S=0.7 S=0.8</td><td>S=0.6</td><td>S=0.7</td><td>S=0.8</td></tr><tr><td>GNNExplainer</td><td>0.4558</td><td>0.4535 0.4947</td><td>0.1577</td><td>0.3653</td><td>0.3098</td></tr><tr><td>PGExplainer</td><td>0.5215</td><td>0.5214 0.5207</td><td>0.1801</td><td>0.2253</td><td>0.2784</td></tr><tr><td>ReFine</td><td>0.3399</td><td>0.4354 0.4974</td><td>0.0952</td><td>0.1278</td><td>0.1829</td></tr><tr><td>SubgraphX</td><td>0.0138</td><td>0.0211 0.0398</td><td>0.1342</td><td>0.1671</td><td>0.1955</td></tr><tr><td>MotifExplainer</td><td>-0.0140</td><td>-0.0300 -0.0558</td><td>0.0757</td><td>0.1011</td><td>0.1125</td></tr></table>
|
| 317 |
+
|
| 318 |
+
# F VISUALIZATION OF EXPLANATION
|
| 319 |
+
|
| 320 |
+
In this section, we report more visualization of explanation on MUTAG dataset in Figure 4. MUTAG is a real-world dataset, and it is more complex than synthetic datasets. Thus, visualization of MUTAG can better represent how different explainer works.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 4: Popular motifs in biological and engineering networks.
|
md/dev/1sx0Drq4jfT/1sx0Drq4jfT.md
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING META-SURROGATE MODEL FOR TRANS-FERABLE ADVERSARIAL ATTACK.
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We consider adversarial attacks to a black-box model when no queries are allowed. In this setting, many methods directly attack surrogate models and transfer the obtained adversarial examples to fool the target model. Plenty of previous works investigated what kind of attacks to the surrogate model can generate more transferable adversarial examples, but their performances are still limited due to the mismatches between surrogate models and the target model. In this paper, we tackle this problem from a novel angle—instead of using the original surrogate models, can we obtain a Meta-Surrogate Model (MSM) such that attacks to this model can be easier transferred to other models? We show that this goal can be mathematically formulated as a well-posed (bi-level-like) optimization problem and design a differentiable attacker to make training feasible. Given one or a set of surrogate models, our method can thus obtain an MSM such that adversarial examples generated on MSM enjoy eximious transferability. Comprehensive experiments on Cifar-10 and ImageNet demonstrate that by attacking the MSM, we can obtain stronger transferable adversarial examples to fool black-box models including adversarially trained ones, with much higher success rates than existing methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The developments of Convolutional Neural Network (CNN) (LeCun et al., 1995; Krizhevsky et al., 2012) have greatly promoted the advancements in Computer Vision (Ren et al., 2016). However, previous works (Goodfellow et al., 2014; Carlini & Wagner, 2017; Croce & Hein, 2020a; Ganeshan et al., 2019) have shown a critical robustness issue that CNN models are vulnerable to humanimperceptible perturbations of input images, also known as adversarial examples (AEs). The design of AEs is useful for revealing the security threats on machine learning systems (Croce & Hein, 2020b) and for understanding the representations learned by CNN models (Ilyas et al., 2019).
|
| 12 |
+
|
| 13 |
+
In this paper, we consider the problem of black-box attack, where the target victim model is entirely hidden from the attacker. In this setting, standard white-box attacks (Moosavi-Dezfooli et al., 2016; Carlini & Wagner, 2017) or even query-based black-box attacks (Ilyas et al., 2018; Cheng et al., 2018; 2020; 2019) cannot be used, and the prevailing way to attack the victim is through transfer attack (Papernot et al., 2017; Wu et al., 2018). In transfer attack (Demontis et al., 2019; Dong et al., 2018), the attackers commonly generate AEs by attacking one or an ensemble of surrogate models and hope the obtained AEs can also successfully fool the victim black-box model.
|
| 14 |
+
|
| 15 |
+
Although great efforts have been made to improve the transferability of adversarial attacks (Tramer\` et al., 2017; Xie et al., 2019; Wu et al., 2020a), the transfer attack-based methods still encounter poor success rates, especially when attacking adversarially trained target models. This is caused by a fundamental limitation of current approaches—they all leverage the surrogate models trained by standard learning tasks (e.g., classification, object detection), while it is not always the case that attacks fooling such models can be easily transferred. We thus pose the following important question on transfer attack that has not been well studied in the literature: Instead of using standard (naturally trained) models as surrogate, can we artificially construct another Meta-Surrogate Model (MSM) such that attacks to this model can be easier transferred to other models?
|
| 16 |
+
|
| 17 |
+
We answer this question in the affirmative by developing a novel black-box attack pipeline called Meta-Transfer Attack (MTA). Assume a set of source models (standard surrogate models) are given, instead of directly attacking these source models, our algorithm aims to obtain a “meta-surrogate model (MSM)”, which is designed in the way that attacks to this model can be easier transferred to fool other models, and conduct attacks on the MSM to obtain transferable AEs. We show that this goal can be mathematically formulated as a well-posed (bi-level-like) training objective by unrolling the attacks on the MSM and defining a loss to measure the transferability of the resulting AEs. To avoid discrete operations in the white-box attack, we propose a Customized PGD attacker that enables back-propagation through the whole procedure. With this bi-level-like optimization (Finn et al., 2017; Qin et al., 2020), the source models supervise the MSM to improve the transferability of the AEs created on it. Through extensive experiments on various models and datasets, we show that the proposed MTA method leads to significantly improved transfer attacks, demonstrating the effectiveness of the MSM.
|
| 18 |
+
|
| 19 |
+
We summarize the main contributions of our work as follows. 1) We propose a novel MTA framework to train an MSM to improve the transferability of AEs. To the best of our knowledge, our work is the first attempt to explore a better surrogate model for producing stronger transferable AEs. 2) We compare MTA with state-of-the-art transfer attack methods (e.g., MI (Dong et al., 2018), DI (Xie et al., 2019), TI (Dong et al., 2019), SGM (Wu et al., 2020a), AEG (Bose et al., 2020), IR (Wang et al., 2021a), SI-NI (Lin et al., 2020)) on Cifar-10 (Krizhevsky et al., 2009) and Imagenet (Deng et al., 2009). The comparisons demonstrate the effectiveness of the proposed MTA—the AEs generated by attacking MSM significantly outperform previous methods, in attacking both naturally trained and adversarially trained black-box target models.
|
| 20 |
+
|
| 21 |
+
# 2 BACKGROUND
|
| 22 |
+
|
| 23 |
+
Adversarial attacks. Szegedy et al. (2014) reveals the interesting phenomenon that CNN models are vunerable to adversarial attacks. After that, many attacks have been developed (Gao et al., 2020; Zhou et al., 2018; Wu et al., 2020b; Li et al., 2020b; Kaidi et al., 2019; Sriramanan et al., 2020). Adversarial attacks can be mainly classified into white-box and black-box attacks (Maksym et al., 2020) according to how much information about the target model is exposed to the attacker. Whitebox attacks (Kurakin et al., 2016) are often more effective than than black-box attacks (Brendel et al., 2017; Cheng et al., 2018; 2020) as they can leverage full knowledge of the target model including the model weights and architecture. For example, Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) uses 1-step gradient ascent to produce adversarial examples that enlarge the model’s loss. Projected gradient descent (PGD) attack can be viewed as a multi-step FGSM attack (Madry et al., 2018). Many other white-box attacks have also been developed by leveraging full information of the target model (Moosavi-Dezfooli et al., 2016; Croce & Hein, 2020a). In the black-box setting, query-based black-box attacks (Huang & Zhang, 2020; Du et al., 2020) assume model information is hidden but attackers can query the model and observe the corresponding hard-label or soft-label predictions. Among them, (Chen et al., 2017; Ilyas et al., 2018) considered soft-label probability predictions and (Chen et al., 2020; Huang & Zhang, 2020; Cheng et al., 2018) considered hard-label decision-based predictions. Considering that using a large number of queries to attack an image is impractical, several works try to further reduce the query counts (Li et al., 2020a; Wang et al., 2020).
|
| 24 |
+
|
| 25 |
+
Transferability of adversarial examples. In this paper, we consider the black-box attack scenario when the attacker cannot make any query to the target model (Lin et al., 2020; Huang et al., 2019; Wang et al., 2021b). In this case, the common attack method is based on transfer attack—the attacker generates AEs by attacking one or few surrogate models and hopes the AEs can also fool the target model (Papernot et al., 2016; Liu et al., 2017; Yuan et al., 2021; Zhou et al., 2018). Compared with query-based attacks, crafting AEs from the surrogate model consumes less computational resources and is more realistic in practice. Along this direction, subsequent works have made attempts to improve the transferability of AEs (Guo et al., 2020; Wu et al., 2020c; Naseer et al., 2019; Li et al., $2 0 2 0 \mathrm { c }$ ; Wang & He, 2021). For instance, Dong et al. (2018) boosted the transferability by integrating the momentum term into the iterative process. Other techniques like data augmentations (Xie et al., 2019), exploiting gradients of skip-connection (Wu et al., 2020a), and negative interaction between pixels (Wang et al., 2021a) also contribute to stronger transferable attacks. In addition to using the original surrogate models, AEG (Bose et al., 2020) adversarially trains a robust classifier together with an encoder-decoder-based transferable perturbation generator. After the training, AEG uses the generator to generate transferable AEs to attack a set of classifiers. Compared to all the existing works, our method is the first that meta-trains a new meta-surrogate model (MSM) such that attacks on MSM can be easier transferred to other models. This not only differs from all the previous methods that attack standard surrogate models but also differs from the encoder-decoder based method such as AEG (Bose et al., 2020).
|
| 26 |
+
|
| 27 |
+
# 3 METHODOLOGY
|
| 28 |
+
|
| 29 |
+
We consider the black-box attack setting where the target model is hidden to the attacker and queries are not allowed. This setting is also known as the transfer attack setting (Dong et al., 2018; 2019; Xie et al., 2019; Wang et al., 2021a) and the attacker 1) cannot access the weight, the architecture, and the gradient of the target model; and 2) cannot querying the target model. The attacker can access 1) the dataset used by the target model; and 2) a single or a set of surrogate models (also known as source models) that may share the dataset with the target model. For example, it is common to assume that the attacker can access one or multiple well-performed (pretrained) image classification models. Existing transferable adversarial attack methods conduct various attacks to these models and hope to get transferable AEs that can fool an unknown target model. Instead of proposing another attack method on surrogate models, we propose a novel framework MTA to train a Meta-Surrogate Model (MSM) with the goal that attacking the MSM can generate stronger transferable AEs than directly attacking the original surrogate models. When evaluating, the transferable AEs are generated by attacking the MSM with standard white-box attack methods (e.g., PGD attack). In the following, we will first review exiting attacks and then show how to form a bi-level optimization objective to train the MSM model.
|
| 30 |
+
|
| 31 |
+
# 3.1 REVIEWS OF FGSM AND PGD
|
| 32 |
+
|
| 33 |
+
We follow the settings of existing works (Dong et al., 2018; Xie et al., 2019; Wu et al., 2020a; Wang et al., 2021a) to focus on untargeted attack, where the attack is considered successful as long as the perturbed image is wrongly predicted.
|
| 34 |
+
|
| 35 |
+
FGSM (Goodfellow et al., 2014) conducts one-step gradient ascent to generate AEs to enlarge the prediction loss. The formulation can be written as
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\begin{array} { r } { x _ { a d v } = \mathbf { C l i p } \big ( x + \epsilon \cdot \mathrm { s i g n } \big ( \nabla _ { x } L ( f ( x ) , y ) \big ) \big ) , } \end{array}
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $x$ is a clean image and $y$ is the corresponding label; $\epsilon$ is the attack step size that determines the maximum $L _ { \infty }$ perturbation of each pixel; $f$ is the victim model that is transparent to the FGSM attacker; Clip is the function that clipping the values of $x _ { a d v }$ to the legal range (e.g., clipping the RGB AEs to the range of $[ 0 , 2 5 5 ] ,$ ); $L$ is usually the cross-entropy loss.
|
| 42 |
+
|
| 43 |
+
PGD (Kurakin et al., 2016), also known as I-FGSM attack, is a multi-step extension of FGSM. The formulation of PGD is
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\boldsymbol { x } _ { a d v } ^ { k } = \mathrm { C l i p } \big ( \boldsymbol { x } _ { a d v } ^ { k - 1 } + \frac { \epsilon } { T } \cdot \mathrm { s i g n } \big ( \nabla _ { \boldsymbol { x } _ { a d v } ^ { k - 1 } } L \big ( f \big ( \boldsymbol { x } _ { a d v } ^ { k - 1 } \big ) , y \big ) \big ) \big ) .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
$x _ { a d v } ^ { k }$ is the AEs generated in the $k$ -th gradient ascent step. Note that $x _ { a d v } ^ { 0 }$ is the clean image equals to $x$ . Eq 2 will be run for iterations to obtain $x _ { a d v } ^ { T }$ with perturbation size $\epsilon$ .
|
| 50 |
+
|
| 51 |
+
# 3.2 META-TRANSFER ATTACK
|
| 52 |
+
|
| 53 |
+
How to train the MSM where attacks to this model can be easier transferred to other models? We show this can be formulated as a bi-level training objective. Let $\mathcal { A }$ denote an attack algorithm (e.g., FGSM or PGD) and $\mathcal { M } _ { \theta }$ denote the MSM parameterized by $\theta$ . For a given image $x$ , the AE generated by attacking $\mathcal { M } _ { \theta }$ can be denoted as $\bar { \boldsymbol { A } } ( \mathcal { M } _ { \theta } , x , y )$ . For example, if $\mathcal { A }$ is FGSM, then $\begin{array} { r } { \mathcal { A } ( \mathcal { M } _ { \theta } , x , y ) = x _ { a d v } = \mathbf { C } \mathrm { l i p } \big ( x + \epsilon \cdot \mathrm { s i g n } \big ( \nabla _ { x } L ( \mathcal { M } _ { \theta } ( x ) , y ) ) \big ) } \end{array}$ . Since in the attack time we only have access to a set of source models $\mathcal { F } _ { 1 } , \ldots , \mathcal { F } _ { N }$ , we can evaluate the transferability of the adversarial example $\mathcal { A } ( \mathcal { M } _ { \theta } , x , y )$ on the source models and optimize the MSM via maximizing the adversarial losses of those $N$ source models, leading to the following training objective:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\underset { \ b { \theta } } { \arg \operatorname* { m a x } } \mathbb { E } _ { ( \boldsymbol { x } , \boldsymbol { y } ) \sim D } \big [ \sum _ { i = 1 } ^ { N } L ( \underset { \mathcal { F } _ { i } ^ { \prime } s \mathrm { ~ p r e d i c t i o n ~ f o r ~ A E } } \overbrace { \mathcal { F } _ { i } ( \overbrace { A ( \mathcal { M } _ { \theta } , \boldsymbol { x } , \boldsymbol { y } ) } ) } , \boldsymbol { y } ) \big ] ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $D$ is the distribution of training data. The structure of this objective and the training procedure can be illustrated in Figure 1, where we can view it as a meta-learning or bi-level optimization method. At the lower level, the AE is generated by a white-box attack (usually gradient ascent) on MSM, while at the higher level, we feed the AE to the source models to compute the robust loss. Solving Eq 3 will find an MSM where attacking it leads to stronger transferable AEs. The optimization steps of $\operatorname { E q } 3$ are detailed below.
|
| 60 |
+
|
| 61 |
+
First, $\mathcal { A }$ should be some strong white-box attacks, such as FGSM or PGD. However, directly using those attacks will make the gradient of meta training objective Eq 3 ill-defined since the sign function in both FGSM and PGD introduce a discrete operation. This results in that the gradient back-propagating through sign be zero and further prohibits the training of the MSM.
|
| 62 |
+
|
| 63 |
+
To overcome this challenge, we design $\mathcal { A }$ as an approximation of PGD and denote it as Customized PGD. Section 3.3 will show more explanation about how the sign function in PGD prohibits backpropagation and how Customized PGD enables the back-propagation. The crucial difference between PGD and the Customized PGD is the operation to the gradient $\nabla _ { x _ { a d v } ^ { k - 1 } } L ( \mathcal { M } _ { \theta } ( x _ { a d v } ^ { \bar { k } - 1 } ) , y )$ , where $L$ is the cross entropy loss. For simplicity, we denote the vanilla gradient $\mathrm { \dot { \nabla } } _ { x _ { a d v } ^ { k } } \dot { L } ( \mathcal { M } _ { \theta } ( x _ { a d v } ^ { k } ) , y )$ at the $k$ -th step as $g ^ { k }$ , and generate another map $g _ { e n s } ^ { k }$ via Eq 4:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\left\{ \begin{array} { l l } { g _ { 1 } ^ { k } = \frac { g ^ { k } } { \mathrm { s u m } ( \mathrm { a b s } ( g ^ { k } ) ) } } \\ { g _ { t } ^ { k } = \frac { 2 } { \pi } \cdot \arctan ( \frac { g ^ { k } } { \mathrm { m e a n } ( \mathrm { a b s } ( g ^ { k } ) ) } ) } \\ { g _ { s } ^ { k } = \mathrm { s i g n } ( g ^ { k } ) } \\ { g _ { e n s } ^ { k } = g _ { 1 } ^ { k } + \gamma _ { 1 } \cdot g _ { t } ^ { k } + \gamma _ { 2 } \cdot g _ { s } ^ { k } } \end{array} \right.
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 1: The framework of the proposed MTA when T = 1 and A(Mθ(x)) = x1adv. The clean image $x$ is first feed into the MSM $\mathcal { M } _ { \theta }$ and obtain the loss $L ( \mathcal { M } _ { \theta } ( x ) , y )$ . Next we back-propagate the loss and use Eq 4 to obtain the noise g0ens. Then, via $\operatorname { E q } 5$ , we obtain the adversarial example x1adv which will be feed into the source models $\mathcal { F } _ { 1 }$ $\mathbf { \Phi } _ { 1 } , \mathcal { F } _ { 2 } , \mathbf { \Phi } .$ .., and $\mathcal { F } _ { N }$ . Finally, by maximizing the source models’ loss, we can optimize the MSM to learn a particular weight so that the adversarial example $x _ { a d v } ^ { 1 }$ attacking it can fool source models.
|
| 71 |
+
|
| 72 |
+
Note that we set $\gamma _ { 1 } = \gamma _ { 2 } = 0 . 0 1$ as default
|
| 73 |
+
|
| 74 |
+
for all the experiments. Both $g _ { 1 } ^ { k }$ and $g _ { t } ^ { k }$ ensure the objective in $\operatorname { E q } 3$ be differentiable with respect to the MSM’s weight $\theta$ ; arctan $( \cdot )$ is a smooth approximation of sign and mean(abs(gk)) prevents arctan from falling into the saturation or linear region. The item $\gamma _ { 2 } \cdot g _ { s } ^ { k }$ provides the lower-bound for each pixel’s perturbation in $g _ { e n s } ^ { k }$ . The experiments in Section 4.3 will demonstrate the importances of $\mathbf { \bar { { g } } } _ { t } ^ { k }$ and $\overset { \cdot } { g } _ { s } ^ { k }$ for Customized PGD. With Eq 4, the Customized PGD conducts the following update to generate AE:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
x _ { a d v } ^ { k } = \mathrm { C l i p } ( x _ { a d v } ^ { k - 1 } + \frac { \epsilon _ { c } } { T } \cdot g _ { e n s } ^ { k - 1 } ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Note that $\epsilon _ { c }$ differs from the perturbation $\epsilon$ in FGSM and PGD because $g _ { e n s } ^ { k - 1 }$ in our update is not a sign vector and its size will depend on the magnitude of the original gradient. Finally, we get $x _ { a d v } ^ { T }$ after $T$ iterations of $\operatorname { E q } 5$ .
|
| 81 |
+
|
| 82 |
+
Second, we feed $x _ { a d v } ^ { T }$ into $N$ source models and calculate the corresponding adversarial losses $L ( \mathcal { F } _ { i } ( x _ { a d v } ^ { T } ) , y )$ for all $i = 1 , \ldots , N$ . Larger losses of the $N$ source models indicate a higher advlikelihood that $x _ { a d v } ^ { T }$ fooling the MSM can transfer to other models.
|
| 83 |
+
|
| 84 |
+
Third, we optimize the MSM by maximizing the objective function defined in Eq 3. The update rule can be written as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r } { \boldsymbol { \theta } ^ { ' } = \boldsymbol { \theta } + \alpha \cdot \sum _ { i = 1 } ^ { N } \nabla _ { \boldsymbol { \theta } } L ( \mathcal { F } _ { i } ( x _ { a d v } ^ { T } ) , y ) , } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where xTadv can be written as a function of $\theta$ by unrolling the attack update rule $\mathrm { E q } 5 T$ times. We will show how to explicitly compute the gradient in Section 3.3. With this training procedure, the MSM is trained to learn a particular weight with which the white-box AEs fooling it can also fool other models. We summarize the training and testing of MTA in Algorithm 1 and Section A.1, respectively. Each capitalized notation represents a batch of the variable denoted with lower case. For example, $X$ denotes a batch of $x$ . Note that Customized PGD is just a continuous approximation of PGD used to train the MSM. In the inference phase, we use standard attacks such as PGD to craft AEs on the MSM.
|
| 91 |
+
|
| 92 |
+
# 3.3 GRADIENT CALCULATION
|
| 93 |
+
|
| 94 |
+
In the calculation we set both $N$ and $T$ in $\operatorname { E q } 6$ to 1, so the gradient in $\operatorname { E q } 6$ is $\nabla _ { \theta } L ( \mathcal { F } _ { 1 } ( x _ { a d v } ^ { 1 } ) , y )$ According to $\operatorname { E q } 5$ , we can replace $x _ { a d v } ^ { 1 }$ in Eq 6 with $\mathrm { C l i p } ( \bar { x } _ { a d v } ^ { 0 } + \epsilon _ { c } \cdot g _ { e n s } ^ { \bar { 0 } } )$ , where $x _ { a d v } ^ { 0 }$ equals to $x$ . For simplicity, we ignore the clip function in the analysis and simplify the derivation as $\nabla _ { \boldsymbol { \theta } } L ( \mathcal { F } _ { 1 } ( \boldsymbol { x } + \dot { \epsilon _ { c } } \cdot \boldsymbol { g } _ { e n s } ^ { 0 } ) , y )$ . By chain rule and since $x$ is independent to $\theta$ , we can further rewrite this
|
| 95 |
+
|
| 96 |
+
as
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\frac { \partial L ( \mathcal { F } _ { 1 } ( x + \epsilon _ { c } \cdot g _ { e n s } ^ { 0 } ) , y ) } { \partial g _ { e n s } ^ { 0 } } \cdot \frac { \partial g _ { e n s } ^ { 0 } } { \partial \theta } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
By replacing $g _ { e n s } ^ { 0 }$ with $\mathrm { E q } 4$ , the second term of $\operatorname { E q } 7$ can be expanded as
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\nabla _ { \boldsymbol { \theta } } g _ { e n s } ^ { 0 } = \nabla _ { \boldsymbol { \theta } } g _ { 1 } ^ { 0 } + \gamma _ { 1 } \cdot \nabla _ { \boldsymbol { \theta } } g _ { t } ^ { 0 } + \gamma _ { 2 } \cdot \nabla _ { \boldsymbol { \theta } } g _ { s } ^ { 0 } .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Note that $g _ { s } ^ { 0 }$ equals to $\mathrm { s i g n } ( g ^ { 0 } )$ and the sign function introduces discrete operation so that the gradient of $g _ { s } ^ { 0 }$ with respect to $\theta$ becomes 0 (unless $g ^ { 0 } = 0 \array$ ). Therefore, $\nabla _ { \theta } g _ { e n s } ^ { 0 }$ can be further written as
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r l r } { { \nabla _ { \theta } g _ { e n s } ^ { 0 } = \nabla _ { \theta } g _ { 1 } ^ { 0 } + \gamma _ { 1 } \cdot \nabla _ { \theta } g _ { t } ^ { 0 } } } \\ & { } & { = \nabla _ { \theta } ( \frac { \nabla _ { x } L ( M _ { \theta } ( x ) , y ) } { \operatorname { s u m } ( \mathrm { a b s } ( \nabla _ { x } L ( M _ { \theta } ( x ) , Y ) ) ) } ) + \gamma _ { 1 } \cdot \nabla _ { \theta } ( \arctan ( \frac { \nabla _ { x } L ( M _ { \theta } ( x ) , y ) } { \operatorname { m e a n } ( \mathrm { a b s } ( \nabla _ { x } L ( M _ { \theta } ( x ) , y ) ) ) } ) ) . } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
In this formulation, $\nabla _ { x } L ( \mathcal { M } _ { \theta } ( x ) , y )$ depends on $\theta$ and the second-order derivative of $\nabla _ { x } L ( \mathcal { M } _ { \theta } ( x ) , y )$ $w . r . t \theta$ can be obtained with lots of deep learning libraries (Abadi et al., 2016; Paszke et al., 2017). In summary, by integrating Eqs.6-9, the MSM can be optimized by an SGD-based optimizer.
|
| 115 |
+
|
| 116 |
+
# 4 EXPERIMENT
|
| 117 |
+
|
| 118 |
+
We conduct experiments to show that the proposed method, under the same set of source models, can generate stronger transferable AEs than existing transfer attack methods.
|
| 119 |
+
|
| 120 |
+
We first present our general experimental settings. 1) We conduct experiments on both Cifar10 (Krizhevsky et al., 2009) and ImageNet (Deng et al., 2009). 2) We compare the proposed MTA with seven state-of-the-art transferable adversarial attack methods, including MI (Dong et al., 2018), DI (Xie et al., 2019), TI (Dong et al., 2019), SGM (Wu et al., 2020a), SI-NI (Lin et al., 2020), AEG (Bose et al.,
|
| 121 |
+
|
| 122 |
+
# Algorithm 1 Training of Meta-Transfer Attack
|
| 123 |
+
|
| 124 |
+
input: $N$ source models $\mathcal { F } _ { 1 } , \ldots , \mathcal { F } _ { N }$ , Training set $\mathbb { D }$ , batch size $b$ , initialized MSM $\mathcal { M } _ { \theta }$ .
|
| 125 |
+
output: Optimized weight $\theta$ .
|
| 126 |
+
$\textbf { 1 : }$ while not done do
|
| 127 |
+
2 : sample data $( X = [ x _ { 1 } , \dots , x _ { b } ] , Y = [ y _ { 1 } , \dots , y _ { b } ] ) \in \mathbb { D }$ 3 : X0adv = X
|
| 128 |
+
4 : for $\mathrm { k }$ in [1, 2, ..., T]:
|
| 129 |
+
5 : 0 $G ^ { k } = \mathsf { \bar { V } } _ { X _ { a d v } ^ { k - 1 } } L ( \mathcal { M } _ { \theta } ( X _ { a d v } ^ { k - 1 } ) , Y )$
|
| 130 |
+
6 : advobtain Gkens v ia Eq 4
|
| 131 |
+
7 : obtain $X _ { a d v } ^ { k ^ { - } }$ via Eq 5
|
| 132 |
+
$\mathbf { 8 : }$ end for
|
| 133 |
+
9 : for each source model $\mathcal { F } _ { i } \in [ \mathcal { F } _ { 1 } , \mathcal { F } _ { 2 } , \ldots , \mathcal { F } _ { N } ]$ , do 10: evaluate XT on ${ \mathcal { F } } _ { i }$ and obtain $L ( \mathcal { F } _ { i } ( X _ { a d v } ^ { T } ) , Y )$ 11: end for
|
| 134 |
+
12: $\theta = \theta + \alpha \cdot \nabla _ { \theta } \sum _ { i } ^ { N } L ( \mathcal { F } _ { i } ( X _ { a d v } ^ { T } ) , Y )$
|
| 135 |
+
13: return θ
|
| 136 |
+
|
| 137 |
+
2020), IR (Wang et al., 2021a), and FIA (Wang et al., 2021b). Note that since SGM is based on enlarging the gradient of skip connections, we only include this method on ImageNet experiments when the source models have sufficient skip connections. AEG is compared only on Cifar-10 because the official AEG is evaluated only on small scale datasets (Mnist and Cifar-10), and it is computational costly to train the perturbation generator on large-scale datasets. FIA is implemented only on ImageNet using the same intermediate feature layers introduces in (Wang et al., 2021b). 3) Since the number of attack iterations $T$ is different between training and testing, we denote it as $T _ { t }$ in training and $T _ { v }$ in testing respectively to avoid confusion. 4) When training the MSM, we use the Customized PGD with $\gamma _ { 1 } = \gamma _ { 2 } = 0 . 0 1$ to attack the MSM. When evaluating, we use PGD with ${ \mathit { T } } _ { v } { = } 1 0$ and $\epsilon { = } 1 5$ to attack the MSM. 5) When using the baseline methods to generate AEs on multiple source models, we follow Dong et al. (2018) to ensemble the logits of the source models before loss calculation. 6) We use source and target models to train and to evaluate the MSM, respectively. 7) For fair comparisons between MTA and baselines, we implement baselines with the number of iterations $T { = } 1 0$ and $\epsilon { = } 1 5$ , and other hyper-parameters are tuned for their best possible performances (implementations are detailed in Section A.8). 8) More experiments (e.g., targeted transfer attack, attacks with smaller $\epsilon$ , more comparisons between MTA and baselines) will be shown in Section A.3.
|
| 138 |
+
|
| 139 |
+
# 4.1 EXPERIMENTS ON CIFAR-10
|
| 140 |
+
|
| 141 |
+
# 4.1.1 EXPERIMENTAL CONFIGURATIONS
|
| 142 |
+
|
| 143 |
+
On Cifar-10, we use 8 source models including ResNet-10, -18, -34 (He et al., 2016), SeResNet-14, -26, -50 (Hu et al., 2018), MobileNet-V1 (Howard et al., 2017), and -V2 (Sandler et al., 2018) to train the MSM. To ensure mismatches between the source and target models and to avoid saturated transfer attack performances (i.e., attack success rates close to $100 \%$ ), we select the 8 target models including MobileNet-V3 (Howard et al., 2019), ShuffleNet-V1, -V2 (Zhang et al., 2018), SqueezeNetA, -B (Iandola et al., 2016), and adversarially trained ResNet-18, -34, and SeResNet-50. The network architectures of all 16 models are defined on public GitHub repositories1,2,3. We train all the source and target models and describe the training details of these models in Section A.2. The trained models and the code will be released to the community for reproducibility.
|
| 144 |
+
|
| 145 |
+
Table 1: Transfer attack success rates on eight target networks on Cifar-10. The MSM is trained with eight source models. From left to right, the eight target models are MobileNet-V3 (MN-V3), ShuffleNet-V1 (SN-V1), -V2 (SN-V2), SqueezeNet-A (SN-A), -B (SN-B), and adversarially trained ResNet-18 $( \mathrm { R e s - } 1 8 _ { a d v } )$ ), ResNet-34 $( \mathsf { R e s } - 3 4 _ { a d v } )$ , and SeResNet-50 $( \mathrm { S e R e s } – \mathsf { I } 0 _ { a d v } )$ .
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Method</td><td>MN-V3</td><td>SN-V1</td><td>SN-V2</td><td>SN-A</td><td>SN-B</td><td>Res-18adu</td><td>Res-34adu</td><td>SE-50adu</td></tr><tr><td>PGD</td><td>51.8%</td><td>64.1%</td><td>49.4%</td><td>57.2%</td><td>56.3%</td><td>67.7%</td><td>63.9%</td><td>63.4%</td></tr><tr><td>DI</td><td>57.8%</td><td>72.5%</td><td>56.4%</td><td>65.7%</td><td>64.6%</td><td>80.7%</td><td>73.1%</td><td>71.0%</td></tr><tr><td>MI</td><td>70.2%</td><td>85.6%</td><td>72.6%</td><td>83.7%</td><td>83.0%</td><td>92.9%</td><td>90.9%</td><td>89.1%</td></tr><tr><td>A-PGD</td><td>74.1%</td><td>88.9%</td><td>75.8%</td><td>84.2%</td><td>83.6%</td><td>90.7%</td><td>89.3%</td><td>89.1%</td></tr><tr><td>TI</td><td>54.5%</td><td>59.9%</td><td>54.2%</td><td>71.8%</td><td>71.4%</td><td>57.6%</td><td>46.3%</td><td>46.6%</td></tr><tr><td>AEG</td><td>90.8%</td><td>92.5%</td><td>85.8%</td><td>91.3%</td><td>91.0%</td><td>96.1%</td><td>93.6%</td><td>93.1%</td></tr><tr><td>IR</td><td>59.3%</td><td>77.9%</td><td>62.5%</td><td>71.6%</td><td>69.1%</td><td>79.8%</td><td>73.7%</td><td>72.1%</td></tr><tr><td>MTA</td><td>91.8%</td><td>98.4%</td><td>90.9%</td><td>94.9%</td><td>93.8%</td><td>98.4%</td><td>96.5%</td><td>97.1%</td></tr><tr><td>MTAγ1=0</td><td>70.0%</td><td>80.9%</td><td>68.5%</td><td>58.5%</td><td>59.4%</td><td>67.7%</td><td>59.2%</td><td>68.9%</td></tr><tr><td>MTAγ2=0</td><td>90.0%</td><td>98.2%</td><td>90.5%</td><td>93.9%</td><td>93.1%</td><td>97.6%</td><td>96.0%</td><td>96.3%</td></tr><tr><td>MTAdense</td><td>86.9%</td><td>96.2%</td><td>87.1%</td><td>89.0%</td><td>87.6%</td><td>96.2%</td><td>91.3%</td><td>93.6%</td></tr></table>
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 2: (a) The structures of ResNet-13 and -19. ResNet-13 contains the top four blocks in the solid-line box and the classifier. ResNet-19 contains all the six blocks and the classifier. The parameter $M *$ of each block denotes the number of filters of its convolution layers. (b) The detailed structure of residual block. The orange cube is the convolution layer and the number on it denotes its number of filters. Pool in the sixth block is global-average pooling while all the other pool is max-pooling with both stride and kernel size of $2 \times 2$ . The convolution layer in the shortcut path uses $1 \times 1$ kernel size while all the other convolution layers use $3 \times 3$ .
|
| 151 |
+
|
| 152 |
+
Training the MSM. The default network architecture of the MSM is ResNet-13 shown in Figure 2, with $M 1$ , $M 2$ , $M 3$ , and $M 4$ set to 64, 128, 256, and 512, respectively. We use the 8 source models to train the MSM for 60 epochs with the number of attack steps $T _ { t }$ of 7. $\epsilon _ { c }$ of the Customized PGD is initialized to 1,600 and is exponentially decayed by $0 . 9 \times$ for every 4,000 iterations. The learning rate $\alpha$ and the batch size are set to 0.001 and 64, respectively.
|
| 153 |
+
|
| 154 |
+
Evaluating the MSM. On each target model, we only attack the correctly classified test images because attacking wrongly classified clean images is less meaningful.
|
| 155 |
+
|
| 156 |
+
# 4.1.2 EXPERIMENTAL RESULTS
|
| 157 |
+
|
| 158 |
+
Table 1 shows the experimental results. The recently proposed white-box attack method APGD (Croce & Hein, 2020b) is also treated as a compared method here. Apparently, MTA performs much better than all the previous methods with significantly increased transfer attack success rates. For example, compared with IR (Wang et al., 2021a), MTA improves the success rates by $5 4 . 8 \%$ , $2 6 . 3 \%$ , $4 5 . 4 \%$ , $3 2 . 5 \%$ , $3 5 . 7 \%$ , $2 3 . 3 \%$ , $3 0 . 9 \%$ , and $3 4 . 7 \%$ on the eight target models. The results of $\mathrm { M T A } _ { \gamma _ { 1 } = 0 }$ , $\mathrm { M T A } _ { \gamma _ { 2 } = 0 }$ , and $\mathbf { M T A } _ { d e n s e }$ will be discussed in ablation study (Section 4.3).
|
| 159 |
+
|
| 160 |
+
Table 2: Transfer attack results on seven black-box networks when using one source model.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Source</td><td>Method</td><td>Inc-V3</td><td>Inc-V4</td><td>IncRes-V2</td><td>Res-152</td><td>Inc-V3 ens3</td><td>Inc-V3 ens4</td><td>IncRes-V2 ens</td></tr><tr><td rowspan="8">Inc-V3</td><td>DI</td><td>/</td><td>35.2%</td><td>28.2%</td><td>22.3%</td><td>5.1%</td><td>4.3%</td><td>2.5%</td></tr><tr><td>MI</td><td>/</td><td>38.1%</td><td>35.8%</td><td>29.6%</td><td>9.1%</td><td>8.8%</td><td>4.5%</td></tr><tr><td>MI-DI</td><td>/</td><td>61.7%</td><td>57.3%</td><td>48.0%</td><td>13.6%</td><td>12.0%</td><td>6.5%</td></tr><tr><td>SI-NI</td><td>/</td><td>63.8%</td><td>62.0%</td><td>51.7%</td><td>25.5%</td><td>25.2%</td><td>12.4%</td></tr><tr><td>IR</td><td>/</td><td>33.6%</td><td>28.1%</td><td>15.9%</td><td>5.1%</td><td>5.5%</td><td>3.0%</td></tr><tr><td>FIA</td><td>/</td><td>69.0%</td><td>66.8%</td><td>52.5%</td><td>29.3%</td><td>27.7%</td><td>14.9%</td></tr><tr><td>MTA</td><td>99.9%</td><td>90.9%</td><td>87.3%</td><td>74.1%</td><td>67.7%</td><td>39.3%</td><td>26.1%</td></tr><tr><td>MTA-IR</td><td>/</td><td>95.5%</td><td>93.2%</td><td>85.0%</td><td>83.5%</td><td>56.9%</td><td>40.7%</td></tr><tr><td rowspan="7">Inc-V4</td><td>DI</td><td>44.9%</td><td>/</td><td>30.5%</td><td>26.7%</td><td>5.9%</td><td>5.5%</td><td>3.3%</td></tr><tr><td>MI</td><td>52.7%</td><td>/</td><td>41.8%</td><td>37.3%</td><td>12.4%</td><td>11.0%</td><td>5.8%</td></tr><tr><td>MI-DI</td><td>69.1%</td><td>/</td><td>58.7%</td><td>49.3%</td><td>16.6%</td><td>14.1%</td><td>8.2%</td></tr><tr><td>SI-NI</td><td>74.6%</td><td>/</td><td>67.3%</td><td>61.6%</td><td>39.2%</td><td>35.9%</td><td>22.0%</td></tr><tr><td>IR</td><td>46.5%</td><td>/</td><td>33.2%</td><td>18.9%</td><td>8.1%</td><td>8.8%</td><td>4.9%</td></tr><tr><td>FIA</td><td>63.6%</td><td>/</td><td>55.2%</td><td>45.9%</td><td>28.5%</td><td>26.1%</td><td>16.8%</td></tr><tr><td>MTA</td><td>87.3%</td><td>99.9%</td><td>84.7%</td><td>73.1%</td><td>61.7%</td><td>38.2%</td><td>29.0%</td></tr><tr><td rowspan="8">IncRes-V2</td><td>MTA-IR</td><td>93.3%</td><td>/</td><td>90.5%</td><td>82.0%</td><td>77.2%</td><td>57.7%</td><td>44.9%</td></tr><tr><td>DI</td><td>46.9%</td><td>42.0%</td><td>/</td><td>29.5%</td><td>8.6%</td><td>6.5%</td><td>5.5%</td></tr><tr><td>MI</td><td>53.2%</td><td>45.2%</td><td>/</td><td>38.8%</td><td>16.2%</td><td>13.3%</td><td>9.7%</td></tr><tr><td>MI-DI</td><td>64.7%</td><td>61.7%</td><td>/</td><td>50.6%</td><td>23.7%</td><td>18.6%</td><td>13.6%</td></tr><tr><td>SI-NI</td><td>78.2%</td><td>70.7%</td><td>/</td><td>63.8%</td><td>45.2%</td><td>38.8%</td><td>32.9%</td></tr><tr><td>IR</td><td>49.7%</td><td>44.9%</td><td>/</td><td>25.2%</td><td>13.6%</td><td>11.2%</td><td>10.9%</td></tr><tr><td>FIA</td><td>63.2%</td><td>57.8%</td><td>/</td><td>51.3%</td><td>35.1%</td><td>30.3%</td><td>25.0%</td></tr><tr><td>MTA</td><td>44.7%</td><td>41.7%</td><td>98.0%</td><td>57.9%</td><td>23.5%</td><td>19.4%</td><td>17.5%</td></tr><tr><td></td><td>MTAInc</td><td>64.3%</td><td>51.7%</td><td>/</td><td>76.0%</td><td>46.2%</td><td>39.3%</td><td>27.5%</td></tr><tr><td rowspan="11">Res-152</td><td>MTA-IRInc</td><td>66.2%</td><td>52.3%</td><td>/</td><td>78.3%</td><td>49.0%</td><td>42.2%</td><td>31.7%</td></tr><tr><td>DI</td><td>51.8%</td><td>48.1%</td><td>40.6%</td><td>/</td><td>9.7%</td><td>8.3%</td><td>6.2%</td></tr><tr><td>MI</td><td>50.2%</td><td>44.9%</td><td>39.4%</td><td>/</td><td>13.9%</td><td>12.0%</td><td>7.8%</td></tr><tr><td>MI-DI</td><td>76.2%</td><td>73.3%</td><td>69.5%</td><td>/</td><td>24.6%</td><td>21.1%</td><td>12.7%</td></tr><tr><td>SI-NI</td><td>59.6%</td><td>50.1%</td><td>51.3%</td><td>/</td><td>37.9%</td><td>34.0%</td><td>20.7%</td></tr><tr><td>IR</td><td>42.3%</td><td>33.8%</td><td>34.1%</td><td>/</td><td>22.0%</td><td>20.6%</td><td>16.2%</td></tr><tr><td>FIA</td><td>73.8%</td><td>67.2%</td><td>67.9%</td><td>/</td><td>48.0%</td><td>43.7%</td><td>30.4%</td></tr><tr><td>MTA</td><td>70.7%</td><td>77.5%</td><td>62.8%</td><td>99.1%</td><td>53.0%</td><td>59.2%</td><td>56.3%</td></tr><tr><td>MTA-IR</td><td>72.8%</td><td>78.0%</td><td>64.3%</td><td>/</td><td>54.9%</td><td>63.0%</td><td>59.3%</td></tr><tr><td>SGM=16</td><td>57.2%</td><td>48.6%</td><td>45.4%</td><td>/</td><td>31.6%</td><td>27.8%</td><td>20.0%</td></tr><tr><td>IR=16</td><td>53.6%</td><td>50.6%</td><td>46.0%</td><td>/</td><td>/</td><td>/</td><td>/</td></tr><tr><td></td><td>MTAe=16</td><td>76.0%</td><td>80.5%</td><td>67.6%</td><td>/</td><td>60.5%</td><td>68.4%</td><td>62.6%</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 4.2 EXPERIMENTS ON IMAGENET
|
| 165 |
+
|
| 166 |
+
# 4.2.1 EXPERIMENTAL CONFIGURATIONS
|
| 167 |
+
|
| 168 |
+
We directly use the public trained ImageNet models4,5,6 including ResNet-50, -101, -152 (He et al., 2016), DenseNet-121, -161 (Huang et al., 2017), Inception-V3 (Szegedy et al., 2016), -V4 (Szegedy et al., 2017), Inception-ResNet-V2, Inception- $\mathrm { V } 3 _ { e n s 3 }$ , Inception- $. \mathrm { V } 3 _ { e n s 4 }$ , and Inception-ResNet$\mathrm { V } 2 _ { e n s }$ . The former eight models are normally trained models while the latter three are secure models trained by ensemble adversarial training (Tramer et al., 2017). We shorten these models as Res-50,\` Res-101, Res-152, DN-121, DN-161, Inc-V3, Inc-V4, IncRes-V2, Inc- $\mathrm { V } 3 _ { e n s 3 }$ , Inc- $\mathbf { V } 3 _ { e n s 4 }$ , and IncRes- $. \mathrm { V } 3 _ { e n s }$ .
|
| 169 |
+
|
| 170 |
+
Training the MSM. The default network architecture of the MSM is ResNet-19 shown in Figure 2, with $M 1$ , $M 2$ , $M 3$ , and $M 4$ set to 32, 80, 200, and 500, respectively. We follow previous works (Dong et al., 2018; Wu et al., 2020a) to evaluate the transferability of AEs in two settings: using a single source model and using multiple source models. We set the input resolution of the MSM to $2 2 4 \times 2 2 4$ . Note that, when the resolution of the source model differs from that of the MSM, we resize the AE $x _ { a d v } ^ { T }$ to the resolution of the source model before feeding it into the source model. More details about training the MSM will be shown in Section A.4.
|
| 171 |
+
|
| 172 |
+
Evaluating the MSM. Following the official testing data settings in the papers of DI (Xie et al., 2019) and SGM (Wu et al., 2020a), we also randomly choose 5,000 validation images from ImageNet that are correctly classified by all models for evaluation. Note that, when the resolutions of the MSM and the target model are different, we resize the AE $x _ { a d v } ^ { T }$ to the resolution of the target model. For instance, when attacking Inc-V3 whose resolution is $2 9 9 \times 2 9 9$ , we first resize $x _ { a d v } ^ { T }$ from $2 2 4 \times 2 2 4$ to $2 9 9 \times 2 9 9$ and then use the resized $x _ { a d v } ^ { T }$ to attack Inc-V3.
|
| 173 |
+
|
| 174 |
+
Table 3: Transfer attack results on seven black-box models when using multiple source models.
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Source</td><td>Method</td><td>Inc-V3</td><td>Inc-V4</td><td>IncRes-V2</td><td>Res-101</td><td>Inc-V3ens3</td><td>Inc-V3ens4</td><td>IncRes-V2ens</td></tr><tr><td rowspan="6">Res-50 + Res-152 + DN-161</td><td>DI MI</td><td>86.9% 82.0%</td><td>84.3%</td><td>81.8%</td><td>96.7%</td><td>59.7%</td><td>55.1%</td><td>41.9%</td></tr><tr><td></td><td></td><td>76.1%</td><td>76.0%</td><td>98.0%</td><td>63.6%</td><td>60.3%</td><td>49.6%</td></tr><tr><td>TI-DI</td><td>60.6%</td><td>59.2%</td><td>50.2%</td><td>86.8%</td><td>54.9%</td><td>56.2%</td><td>46.9%</td></tr><tr><td>SGM</td><td>81.8%</td><td>74.7%</td><td>73.9%</td><td>98.7%</td><td>54.9%</td><td>50.1%</td><td>38.7%</td></tr><tr><td>SGM-DI</td><td>86.2%</td><td>83.9%</td><td>81.6%</td><td>98.3%</td><td>69.8%</td><td>64.9%</td><td>54.4%</td></tr><tr><td>SGM-MI</td><td>86.5%</td><td>84.3%</td><td>82.7%</td><td>98.2%</td><td>71.1%</td><td>67.4%</td><td>60.8%</td></tr><tr><td>IR</td><td>75.2%</td><td>70.3%</td><td>67.9%</td><td>90.6%</td><td>51.7%</td><td>49.1%</td><td>37.5%</td></tr><tr><td>MTA</td><td>90.4%</td><td>94.3%</td><td>87.6%</td><td>97.5%</td><td>75.5%</td><td>79.7%</td><td>79.0%</td></tr><tr><td>MTA-IR</td><td>93.1%</td><td>95.8%</td><td>90.5%</td><td>98.3%</td><td>83.6%</td><td>87.2%</td><td>85.0%</td></tr><tr><td>DI</td><td>84.1%</td><td>82.3%</td><td>79.4%</td><td>93.9%</td><td>56.3%</td><td>50.1%</td><td>35.2%</td></tr><tr><td rowspan="8">Res-50 + Inc-V1 + DN-121</td><td>MI</td><td>79.9%</td><td>73.6%</td><td>72.3%</td><td>93.7%</td><td>59.3%</td><td>56.0%</td><td>42.7%</td></tr><tr><td>TI-DI</td><td>61.9%</td><td>58.5%</td><td>49.0%</td><td>79.7%</td><td>53.1%</td><td>54.1%</td><td>41.9%</td></tr><tr><td>SGM</td><td>62.7%</td><td>53.5%</td><td>50.9%</td><td>89.1%</td><td>33.8%</td><td>30.4%</td><td>19.3%</td></tr><tr><td>SGM-DI</td><td>87.2%</td><td>83.6%</td><td>79.5%</td><td>95.1%</td><td>59.6%</td><td>54.9%</td><td>37.9%</td></tr><tr><td>SGM-MI</td><td>82.8%</td><td>76.0%</td><td>74.3%</td><td>95.9%</td><td>62.2%</td><td>59.7%</td><td>45.3%</td></tr><tr><td>IR</td><td>76.5%</td><td>70.9%</td><td>64.0%</td><td>92.1%</td><td>51.3%</td><td>44.9%</td><td>31.5%</td></tr><tr><td>MTA</td><td>91.7%</td><td>86.4%</td><td>76.0%</td><td>93.6%</td><td>81.7%</td><td>79.6%</td><td>61.6%</td></tr><tr><td>MTA-IR</td><td>92.8%</td><td>87.9%</td><td>77.2%</td><td>93.8%</td><td>82.6%</td><td>79.3%</td><td>61.5%</td></tr><tr><td rowspan="8">Res-50 + Inc-V1</td><td>DI</td><td>76.1%</td><td>69.3%</td><td>66.3%</td><td>90.0%</td><td>43.5%</td><td>39.2%</td><td>25.5%</td></tr><tr><td>MI</td><td>69.5%</td><td>60.1%</td><td>59.5%</td><td>91.5%</td><td>47.1%</td><td>44.7%</td><td>32.5%</td></tr><tr><td>TI-DI</td><td>51.6%</td><td>46.9%</td><td>38.4%</td><td>73.4%</td><td>43.4%</td><td>44.2%</td><td>32.8%</td></tr><tr><td>SGM</td><td>46.1%</td><td>35.6%</td><td>33.3%</td><td>82.0%</td><td>22.1%</td><td>19.5%</td><td>12.3%</td></tr><tr><td>SGM-DI</td><td>79.2%</td><td>70.6%</td><td>68.7%</td><td>91.9%</td><td>47.9%</td><td>42.0%</td><td>28.1%</td></tr><tr><td>SGM-MI</td><td>71.9%</td><td>62.0%</td><td>61.3%</td><td>94.3%</td><td>49.6%</td><td>47.2%</td><td>33.8%</td></tr><tr><td>IR</td><td>60.2%</td><td>49.0%</td><td>46.2%</td><td>93.0%</td><td>36.5%</td><td>30.6%</td><td>21.0%</td></tr><tr><td>MTA</td><td>84.1%</td><td>88.8%</td><td>78.4%</td><td>93.9%</td><td>60.6%</td><td>61.1%</td><td>55.1%</td></tr><tr><td>MTA-IR</td><td>87.6%</td><td>91.8%</td><td>83.9%</td><td>95.2%</td><td></td><td>71.5%</td><td>72.6%</td><td>63.7%</td></tr></table>
|
| 177 |
+
|
| 178 |
+
# 4.2.2 USING ONE SOURCE MODEL
|
| 179 |
+
|
| 180 |
+
Table 2 reports the experimental results of using one source model. Note that, in this work, we only focus on the transfer attack testing scene and neglect the white-box attack testing scene. So we left the results of the testing scenes where the target model is the source model itself to $/$ . MI-DI is a combination of MI and DI. IR is our re-implementation with $\epsilon { = } 1 5$ and the implementation details will be shown in Section A.8. Obviously, MTA outperforms the baselines on almost all testing scenes with great margins, especially when attacking adversarially trained models. For example, compared with FIA, MTA improves the transfer attack success rates by about $3 1 . 7 \%$ , $3 0 . 7 \%$ , $4 1 . 1 \%$ , $1 3 1 . 1 \%$ , $4 1 . 9 \%$ , and $7 5 . 2 \%$ when using the Inc-V3 source model and attacking the target models (Inc-V4, IncRes-152, Res-152, Inc- $. \mathrm { V } 3 _ { e n s 3 }$ , Inc- $. \mathrm { V } 3 _ { e n s 4 }$ , IncRes- $. \mathrm { V } 2 _ { e n s }$ ). MTA-IR combines MTA with IR. Instead of attacking the MSM using PGD, MTA-IR generates AEs by attacking the MSM using IR. Compared with MTA, MTA-IR improves the attack success rates by about $5 . 1 \%$ , $6 . 8 \%$ , $1 4 . 7 \%$ , $2 3 . 3 \%$ , $4 4 . 8 \%$ , and $5 5 . 9 \%$ when using the Inc-V3 source model and attacking the target models, indicating that existing transferable attack methods can further improve MTA.
|
| 181 |
+
|
| 182 |
+
Recall that SGM only works for source models with lots of skip connections (e.g., ResNet). And the original paper sets $\epsilon$ to 16, which differs from most of the other methods. The official IR also sets $\epsilon$ to 16. Therefore, we copy their results with $\epsilon = 1 6$ from their official paper to Table 2 and denote them as $\mathbf { S G M } _ { \epsilon = 1 6 } ^ { * }$ and $\mathrm { I R } _ { \epsilon = 1 6 } ^ { \ast }$ , respectively. To compare MTA with them, we further set $\epsilon$ to 16 for MTA and denote the new result as $\mathbf { M T A } _ { \epsilon = 1 6 }$ . The comparisons show that $\mathbf { M T A } _ { \epsilon = 1 6 }$ outperforms $\mathbf { S G M } _ { \epsilon = 1 6 } ^ { * }$ and $\mathrm { I R } _ { \epsilon = 1 6 } ^ { \ast }$ significantly.
|
| 183 |
+
|
| 184 |
+
When using IncRes-V2 source model, MTA sometimes performs slightly worse than MI-DI, possibly because the MSM with ResNet-19 backbone is not suitable to be trained to attack IncRes-V2. We then replace the backbone from ResNet-19 with another simplified Inception network (the architecture will be shown in Section A.6) and retrain the MSM. The newly trained MSM is denoted as $\mathbf { M T A } _ { I n c }$ Compared with ResNet-19, the simplified Inception backbone is more similar to IncRes-V2 so that $\mathbf { M T A } _ { I n c }$ turns to be easier to generate adversarial attacks to fool IncRes-V2 than MTA, leading to easier convergence of $\mathbf { M T A } _ { I n c }$ . The experimental results show that $\mathbf { M T A } _ { I n c }$ outperforms not only MTA but also the compared methods in most testing scenes, indicating 1) the advantage of the proposed MTA framework and 2) MTA can be further improved by using more suitable backbones.
|
| 185 |
+
|
| 186 |
+
# 4.2.3 USING MULTIPLE SOURCE MODELS
|
| 187 |
+
|
| 188 |
+
The experimental results of using multiple source models are reported in Table 3. We use three source model groups $( \mathrm { R e s } { - } 5 0 { + } \mathrm { R e s } { - } 1 5 2 { + } \mathrm { D N } 1 6 1$ , Res-50+Inc-V1+DN-121, Res-50+Inc-V1) to train the MSM, respectively, and use seven target models (Inc-V3, Inc-V4, InvRes-V2, Res-101, Inc- $\mathrm { V } 3 _ { e n s 3 }$
|
| 189 |
+
|
| 190 |
+
Inc- $\mathbf { V } 3 _ { e n s 4 }$ , IncRes- $\mathrm { V } 2 _ { e n s }$ ) to evaluate the transferability of the attacks to the MSM. SGM-X is the combination of SGM and X $\mathrm { X = D I }$ or MI). TI-DI is the combination of TI and DI, which is also known as TI-DIM (Dong et al., 2019). The results show that MTA outperforms the baselines in almost all testing scenes, especially when attacking defensive models. For instance, compared with SGM-DI, MTA improves the transfer attack success rates by $6 . 2 \%$ , $2 5 . 8 \%$ , $1 4 . 1 \%$ , $2 . 2 \%$ , $2 6 . 5 \%$ , $4 5 . 5 \%$ , and $9 6 . 1 \%$ on the seven target models when using Res-50 and Inc-V1 source models. Besides, MTA-IR outperforms MTA.
|
| 191 |
+
|
| 192 |
+
# 4.3 ABLATION STUDY
|
| 193 |
+
|
| 194 |
+
Network structure The comparison between MTA and $\mathbf { M T A } _ { I n c }$ shown in Table 2 has validated the effect of backbone on the MSM. Here we conduct another experiment on Cifar-10 to further verify the effect of backbone by replacing the backbone from ResNet-13 to DenseNet-22BC (the structure of DenseNet-22BC will be shown in Section A.6). We denote the MSM using DenseNet-22BC backbone as $\mathbf { M T A } _ { d e n s e }$ and report its experimental results in Table 1. The comparisons among MTA, $\mathbf { M T A } _ { d e n s e }$ , and the other compared methods indicate that 1) the backbone affects the performance of MTA; 2) MTA outperforms the compared methods with various backbones. This also inspires us to design more suitable backbones to improve MTA as future work.
|
| 195 |
+
|
| 196 |
+
Number of attack iterations We perform several experiments on Cifar-10 to validate how the number of attack iterations $T _ { t }$ affects the performance. $T _ { t }$ is set to 7 by default on Cifar-10. Here we set $T _ { t }$ to 1, 3, 5, 9, and 11 and keep all the other settings be consistent with the default settings. Figure 3 shows the corresponding performances of MTA. It is observed that when $T _ { t } < 7$ , the performances of MTA will be improved with the increase of $T _ { t }$ while when $T _ { t } > 7$ , the performance tends to drop. We think this is due to the difficulty of unrolling too many attack steps when training the MSM. We also verify how $T _ { v }$ affects the performance by changing $T _ { v }$ . $T _ { v }$ is default set to 10 in all our experiments. Figure 3 shows the experimental results using different numbers of $T _ { v }$ . When $T _ { v } = 1$ , the performances can be denoted as MTA-FGSM (one-step PGD). With the increase of $T _ { v }$ , the transfer attack success rates are clearly increased.
|
| 197 |
+
|
| 198 |
+
The effects of $\gamma _ { 1 }$ and $\gamma _ { 2 }$ We perform two experiments on Cifar-10 to verify how the parameters $\gamma _ { 1 }$ and $\gamma _ { 2 }$ in Eq 5 affect the transfer attack performance. In the two experiments, we set $\gamma _ { 1 }$ and $\gamma _ { 2 }$ to zero respectively, and amplify $\epsilon _ { c }$ appropriately to offset the decrease of the training perturbation size caused by zeroing $\gamma _ { 1 }$ or $\gamma _ { 2 }$ . We denote the two newly performed MTA as $\mathrm { M T A } _ { \gamma _ { 1 } = 0 }$ and $\mathrm { M T A } _ { \gamma _ { 2 } = 0 }$ . Table 1 shows the experimental results. The results show that by setting $\gamma _ { 1 }$
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 3: Transfer attack performances of MTA on the eight target models of Cifar-10. Left: Attack success rates with different $T _ { t }$ . Right: Attack success rates with different $T _ { v }$ . yaxis denotes the attack success rate.
|
| 202 |
+
|
| 203 |
+
to zero, the performances of MTA are greatly damaged on all target models, indicating the indispensability of the arctan component in the Customized PGD. Setting $\gamma _ { 2 }$ to zero also decreases MTA’s performances, but the effect is much smaller than that of $\gamma _ { 1 }$ . Overall, the two experiments demonstrate the indispensability of Customized PGD for the proposed MTA framework. Further, both the arctan and sign components in Customized PGD are important to train the MSM, especially arctan.
|
| 204 |
+
|
| 205 |
+
# 5 CONCLUSION
|
| 206 |
+
|
| 207 |
+
Existing query free black-box adversarial attack methods directly use image classification models as surrogate models to generate transferable adversarial attacks to attack black-box models neglecting the study of surrogate models. In this paper, we propose a novel framework called meta-transfer attack (MTA) to improve the transferability of adversarial attacks via training an MSM using these surrogate models. The MSM is a particular model trained to learn how to make the adversarial attacks to it can fool the surrogate models. To enable and improve the training of the MSM, a novel Customized PGD is also developed. Through extensive experiments, we validate that by attacking the trained MSM, we can get transferable adversarial attacks that are generalizable to attack black-box target models with much higher success rates than existing methods, demonstrating the effectiveness of the proposed MTA framework.
|
| 208 |
+
|
| 209 |
+
# 6 ETHICS STATEMENT
|
| 210 |
+
|
| 211 |
+
Our work is promising to evaluate and improve the security of deep models, and has no potential negative societal impacts.
|
| 212 |
+
|
| 213 |
+
# 7 REPRODUCIBILITY STATEMENT
|
| 214 |
+
|
| 215 |
+
We provide our code in supplemental material and describe all the experimental settings in Sections 4.1.1, 4.2.1, and Appendix. The hyperparameter settings and the network structure are clear. The training details of source and target models used on Cifar-10 are described in Section A.2, and the network architecture descriptions of these models can be found in Section 4.1.1 and our code. The source and target models used on ImageNet can be found in the repositories described in Section 4.2.1. We include a very simple code example of our method at the end of Appendix, which also helps readers to understand and to reproduce our results. Overall, our work is easy to reproduce and follow.
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th {USENIX} symposium on operating systems design and implementation ({OSDI} 16), pp. 265–283, 2016.
|
| 220 |
+
|
| 221 |
+
Avishek Joey Bose, Gauthier Gidel, Hugo Berrard, Andre Cianflone, Pascal Vincent, Simon LacosteJulien, and William L Hamilton. Adversarial example games. Advances in neural information processing systems, 2020.
|
| 222 |
+
|
| 223 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. arXiv preprint arXiv:1712.04248, 2017.
|
| 224 |
+
|
| 225 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 ieee symposium on security and privacy (sp), pp. 39–57. IEEE, 2017.
|
| 226 |
+
|
| 227 |
+
Jianbo Chen, Michael I Jordan, and Martin J Wainwright. HopSkipJumpAttack: a query-efficient decision-based adversarial attack. In 2020 IEEE Symposium on Security and Privacy (SP). IEEE, 2020.
|
| 228 |
+
|
| 229 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM workshop on artificial intelligence and security, pp. 15–26, 2017.
|
| 230 |
+
|
| 231 |
+
Minhao Cheng, Thong Le, Pin-Yu Chen, Jinfeng Yi, Huan Zhang, and Cho-Jui Hsieh. Query-efficient hard-label black-box attack: An optimization-based approach. arXiv preprint arXiv:1807.04457, 2018.
|
| 232 |
+
|
| 233 |
+
Minhao Cheng, Simranjit Singh, Patrick H. Chen, Pin-Yu Chen, Sijia Liu, and Cho-Jui Hsieh. Sign-opt: A query-efficient hard-label adversarial attack. In international conference on learning representations, 2020.
|
| 234 |
+
|
| 235 |
+
Shuyu Cheng, Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Improving black-box adversarial attacks with a transfer-based prior. pp. 10932–10942, 2019.
|
| 236 |
+
|
| 237 |
+
Francesco Croce and Matthias Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack. In International Conference on Machine Learning, pp. 2196–2205. PMLR, 2020a.
|
| 238 |
+
|
| 239 |
+
Francesco Croce and Matthias Hein. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. In International Conference on Machine Learning, pp. 2206–2216. PMLR, 2020b.
|
| 240 |
+
|
| 241 |
+
Ambra Demontis, Marco Melis, Maura Pintor, Matthew Jagielski, Battista Biggio, Alina Oprea, Cristina Nita-Rotaru, and Fabio Roli. Why do adversarial attacks transfer? explaining transferability of evasion and poisoning attacks. USENIX Security Symposium, pp. 321–338, 2019.
|
| 242 |
+
|
| 243 |
+
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.
|
| 244 |
+
|
| 245 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 9185–9193, 2018.
|
| 246 |
+
|
| 247 |
+
Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4312–4321, 2019.
|
| 248 |
+
|
| 249 |
+
Jiawei Du, Hu Zhang, Tianyi Joey Zhou, Yi Yang, and Jiashi Feng. Query-efficient meta attack to deep neural networks. International Conference on Learning Representations, 2020.
|
| 250 |
+
|
| 251 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126–1135. PMLR, 2017.
|
| 252 |
+
|
| 253 |
+
Aditya Ganeshan, Vivek BS, and R Venkatesh Babu. Fda: Feature disruptive attack. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8069–8079, 2019.
|
| 254 |
+
|
| 255 |
+
Lianli Gao, Qilong Zhang, Jingkuan Song, Xianglong Liu, and Heng Tao Shen. Patch-wise attack for fooling deep neural network. In European Conference on Computer Vision, pp. 307–322. Springer, 2020.
|
| 256 |
+
|
| 257 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. international conference on learning representations, 2014.
|
| 258 |
+
|
| 259 |
+
Yiwen Guo, Qizhang Li, and Hao Chen. Backpropagating linearly improves transferability of adversarial examples. In Advances in neural information processing systems 33 (NIPS 2020), 2020.
|
| 260 |
+
|
| 261 |
+
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.
|
| 262 |
+
|
| 263 |
+
Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. Searching for mobilenetv3. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1314–1324, 2019.
|
| 264 |
+
|
| 265 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 266 |
+
|
| 267 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132–7141, 2018.
|
| 268 |
+
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
Qian Huang, Isay Katsman, Horace He, Zeqi Gu, Serge Belongie, and Ser-Nam Lim. Enhancing adversarial example transferability with an intermediate level attack. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4733–4742, 2019.
|
| 272 |
+
|
| 273 |
+
Zhichao Huang and Tong Zhang. Black-box adversarial attack with transferable model-based embedding. International Conference on Learning Representations, 2020.
|
| 274 |
+
|
| 275 |
+
Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and¡ $0 . 5 \mathrm { m b }$ model size. arXiv preprint arXiv:1602.07360, 2016.
|
| 276 |
+
|
| 277 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In International Conference on Machine Learning, pp. 2137–2146. PMLR, 2018.
|
| 278 |
+
|
| 279 |
+
Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. arXiv preprint arXiv:1905.02175, 2019.
|
| 280 |
+
|
| 281 |
+
Xu Kaidi, Liu Sijia, Zhao Pu, Chen Pin-Yu, Zhang Huan, Fan Quanfu, Erdogmus Deniz, Wang Yanzhi, and Lin Xue. Structured adversarial attack: Towards general implementation and better interpretability. International Conference on Learning Representations, 2019.
|
| 282 |
+
|
| 283 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 284 |
+
|
| 285 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 286 |
+
|
| 287 |
+
Alexey Kurakin, Ian Goodfellow, Samy Bengio, et al. Adversarial examples in the physical world, 2016.
|
| 288 |
+
|
| 289 |
+
Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 290 |
+
|
| 291 |
+
Huichen Li, Xiaojun Xu, Xiaolu Zhang, Shuang Yang, and Bo Li. Qeba: Query-efficient boundarybased blackbox attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1221–1230, 2020a.
|
| 292 |
+
|
| 293 |
+
Qizhang Li, Yiwen Guo, and Hao Chen. Practical no-box adversarial attacks against dnns. Advances In Neural Information Processing Systems 2020, 2020b.
|
| 294 |
+
|
| 295 |
+
Yingwei Li, Song Bai, Yuyin Zhou, Cihang Xie, Zhishuai Zhang, and Alan Yuille. Learning transferable adversarial examples via ghost networks. AAAI, pp. 11458–11465, 2020c.
|
| 296 |
+
|
| 297 |
+
Jiadong Lin, Chuanbiao Song, Kun He, Liwei Wang, and John E Hopcroft. Nesterov accelerated gradient and scale invariance for adversarial attacks. International Conference on Learning Representations, 2020.
|
| 298 |
+
|
| 299 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. international conference on learning representations, 2017.
|
| 300 |
+
|
| 301 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. international conference on learning representations, 2018.
|
| 302 |
+
|
| 303 |
+
Andriushchenko Maksym, Croce Francesco, Flammarion Nicolas, and Hein Matthias. Square attack: a query-efficient black-box adversarial attack via random search. european conference on computer vision, pp. 484–501, 2020.
|
| 304 |
+
|
| 305 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2574–2582, 2016.
|
| 306 |
+
|
| 307 |
+
Muhammad Muzammal Naseer, Salman H Khan, Muhammad Haris Khan, Fahad Shahbaz Khan, and Fatih Porikli. Cross-domain transferability of adversarial perturbations. Advances in Neural Information Processing Systems, 32:12905–12915, 2019.
|
| 308 |
+
|
| 309 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016.
|
| 310 |
+
|
| 311 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pp. 506–519, 2017.
|
| 312 |
+
|
| 313 |
+
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.
|
| 314 |
+
|
| 315 |
+
Yunxiao Qin, Weiguo Zhang, Zezheng Wang, Chenxu Zhao, and Jingping Shi. Layer-wise adaptive updating for few-shot image classification. IEEE Signal Processing Letters, 27:2044–2048, 2020.
|
| 316 |
+
|
| 317 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: towards real-time object detection with region proposal networks. IEEE transactions on pattern analysis and machine intelligence, 39(6):1137–1149, 2016.
|
| 318 |
+
|
| 319 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4510–4520, 2018.
|
| 320 |
+
|
| 321 |
+
Gaurang Sriramanan, Sravanti Addepalli, Arya Baburaj, and Venkatesh R. Babu. Guided adversarial attack for evaluating and enhancing adversarial defenses. Advances In Neural Information Processing Systems, 2020.
|
| 322 |
+
|
| 323 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, J. Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. international conference on learning representations, 2014.
|
| 324 |
+
|
| 325 |
+
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.
|
| 326 |
+
|
| 327 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander Alemi. Inception-v4, inceptionresnet and the impact of residual connections on learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017.
|
| 328 |
+
|
| 329 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc- \` Daniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 330 |
+
|
| 331 |
+
Lu Wang, Huan Zhang, Jinfeng Yi, Cho-Jui Hsieh, and Yuan Jiang. Spanning attack: reinforce black-box attacks with unlabeled data. Machine Learning, 109(12):2349–2368, 2020.
|
| 332 |
+
|
| 333 |
+
Xiaosen Wang and Kun He. Enhancing the transferability of adversarial attacks through variance tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1924–1933, 2021.
|
| 334 |
+
|
| 335 |
+
Xin Wang, Jie Ren, Shuyun Lin, Xiangming Zhu, Yisen Wang, and Quanshi Zhang. A unified approach to interpreting and boosting adversarial transferability. International Conference on Learning Representations, 2021a.
|
| 336 |
+
|
| 337 |
+
Zhibo Wang, Hengchang Guo, Zhifei Zhang, Wenxin Liu, Zhan Qin, and Kui Ren. Feature importanceaware transferable adversarial attacks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021b.
|
| 338 |
+
|
| 339 |
+
Dongxian Wu, Yisen Wang, Shu-Tao Xia, James Bailey, and Xingjun Ma. Skip connections matter: On the transferability of adversarial examples generated with resnets. international conference on learning representations, 2020a.
|
| 340 |
+
|
| 341 |
+
Kaiwen Wu, Allen Wang, and Yaoliang Yu. Stronger and faster wasserstein adversarial attacks. International Conference on Machine Learning, pp. 10377–10387, 2020b.
|
| 342 |
+
|
| 343 |
+
Lei Wu, Zhanxing Zhu, Cheng Tai, et al. Understanding and enhancing the transferability of adversarial examples. arXiv preprint arXiv:1802.09707, 2018.
|
| 344 |
+
|
| 345 |
+
Weibin Wu, Yuxin Su, Xixian Chen, Shenglin Zhao, Irwin King, R. Michael Lyu, and Yu-Wing Tai. Boosting the transferability of adversarial samples via attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1158–1167, 2020c.
|
| 346 |
+
|
| 347 |
+
Cihang Xie, Zhishuai Zhang, Yuyin Zhou, Song Bai, Jianyu Wang, Zhou Ren, and Alan L Yuille. Improving transferability of adversarial examples with input diversity. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2730–2739, 2019.
|
| 348 |
+
|
| 349 |
+
Zheng Yuan, Jie Zhang, Yunpei Jia, Chuanqi Tan, Tao Xue, and Shiguang Shan. Meta gradient adversarial attack. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021.
|
| 350 |
+
|
| 351 |
+
Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. computer vision and pattern recognition, 2018.
|
| 352 |
+
|
| 353 |
+
Wen Zhou, Xin Hou, Yongjun Chen, Mengyun Tang, Xiangqi Huang, Xiang Gan, and Yong Yang. Transferable adversarial perturbations. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 452–467, 2018.
|
| 354 |
+
|
| 355 |
+
# A APPENDIX
|
| 356 |
+
|
| 357 |
+
# A.1 TESTING PSEUDO CODE OF MTA
|
| 358 |
+
|
| 359 |
+
We summarize the testing pseudo code of MTA in Algorithm.2, where $\hat { \mathcal { F } }$ is the target model and $\tilde { y }$ is the target model’s prediction for the adversarial example $x _ { a d v } ^ { T }$ . Note that all the clean examples in $\hat { \mathbb { D } }$ are correctly classified by the target model. Len $( \hat { \mathbb { D } } )$ denotes the number of examples in $\hat { \mathbb { D } }$ .
|
| 360 |
+
|
| 361 |
+
# A.2 TRAINING THE SOURCE AND TARGET MODELS ON CIFAR-10
|
| 362 |
+
|
| 363 |
+
On Cifar-10, we use 16 source and target models to train and test the metasurrogate model (MSM). The 8 source models are ResNet-10, -18, -34, SeResNet-14, -26, -50, MobileNetV1, and -V2. The 8 target models are MobileNet-V3, ShuffleNet-V1, -V2, SqueezeNet-A, -B, and adversarially trained ResNet-18, -34 and SeResNet50. It is not easy to collect the 16 trained Cifar-10 models on the internet. Therefore, before the experiments of MTA, we first use consistent hyperparameters to train the 16 models on Cifar-10 for 200 epochs. The learning rate, L2 weight decay, and batch size are set to 0.01, 1e-5, and 128, respectively. For each adversarially trained model, we first use FGSM and the normally trained model to generate one
|
| 364 |
+
|
| 365 |
+
# Algorithm 2 Testing of Meta-Transfer Attack
|
| 366 |
+
|
| 367 |
+
input: Black-box target model $\hat { \mathcal { F } }$ , Testing examples $\hat { \mathbb { D } }$ that are correctly classified by the target model, Optimized metasurrogate model $\mathcal { M } _ { \theta }$ .
|
| 368 |
+
output: Transfer attack success rate.
|
| 369 |
+
$\mathbf { 1 } : P = 0$
|
| 370 |
+
2 : for $( x , y ) \in { \hat { \mathbb { D } } }$ do
|
| 371 |
+
3 : $x _ { a d v } ^ { 0 } = x$
|
| 372 |
+
4 : for $\mathrm { k }$ in [1, 2, ..., T] do
|
| 373 |
+
5 : $g ^ { k } = \bar { \nabla } _ { x _ { a d v } ^ { k - 1 } } L ( \bar { \mathcal { M } } _ { \theta } ( x _ { a d v } ^ { k - 1 } ) , y )$
|
| 374 |
+
xadv
|
| 375 |
+
6 : $\scriptstyle x _ { a d v } ^ { k } = \mathrm { C l i p } \left( x _ { a d v } ^ { k - 1 } + { \frac { \epsilon } { T } } \cdot \mathrm { s i g n } ( g ^ { k } ) \right)$
|
| 376 |
+
7 :8 : end forevaluate $x _ { a d v } ^ { T }$ on $\hat { \mathcal { F } }$ and obtain $\tilde { y } = \hat { \mathcal { F } } ( x _ { a d v } ^ { T } )$
|
| 377 |
+
9 : if $y \ne \tilde { y }$ do
|
| 378 |
+
10: P+ = 1
|
| 379 |
+
11: end if
|
| 380 |
+
12: return Len(Dˆ) P
|
| 381 |
+
|
| 382 |
+
adversarial example for each training image with $\epsilon = 3$ , and then train the model on both clean and adversarial images. The 8 source models obtain $9 0 . 0 \%$ , $9 1 . 8 \%$ , $9 2 . 6 \%$ , $8 5 . 6 \%$ , $8 8 . 3 \%$ , $9 0 . 5 \%$ , $8 2 . 0 \%$ , and $8 1 . 8 \%$ accuracies on the test set, and the 8 target models obtain $8 0 . 0 \%$ , $8 2 . 5 \%$ , $7 6 . 4 \%$ , $8 6 . 4 \%$ , $8 6 . 9 \%$ , $8 8 . 9 \%$ , $9 0 . 5 \%$ , and $8 7 . 5 \%$ accuracies.
|
| 383 |
+
|
| 384 |
+
# A.3 MORE EXPERIMENTS ON CIFAR-10
|
| 385 |
+
|
| 386 |
+
Here we show more experiments on Cifar-10.
|
| 387 |
+
|
| 388 |
+
# A.3.1 TARGETED TRANSFER ATTACK
|
| 389 |
+
|
| 390 |
+
We conduct targeted transfer attack and show the experimental results in Table 4. MTA has a great advantage over the compared methods in the targeted transfer attack setting.
|
| 391 |
+
|
| 392 |
+
# A.3.2 TRANSFER ATTACK WITH SMALLER $\epsilon$
|
| 393 |
+
|
| 394 |
+
We set $\epsilon$ to 8 to evaluate how does MTA perform with smaller $\epsilon$ . The results shown in Table 5 indicate that MTA outperforms the compared methods no matter the value of $\epsilon$ .
|
| 395 |
+
|
| 396 |
+
# A.3.3 COMPARISON BETWEEN MTA AND METAATTACK
|
| 397 |
+
|
| 398 |
+
MetaAttack[14] is developed for query-based black-box adversarial attack but not for transfer attack. We implement MetaAttack in the transfer attack scene on Cifar-10 and compare it with MTA in Table 6. The comparison indicates that MTA greatly outperforms MetaAttack in transfer attack.
|
| 399 |
+
|
| 400 |
+
# A.3.4 MORE EXPERIMENTS ABOUT THE CUSTOMIZED PGD
|
| 401 |
+
|
| 402 |
+
As introduced in Section 3, the sign function in the vanilla PGD with $\mathrm { L } _ { \infty }$ constraint introduces a discrete operation. This results in that the gradient back-propagating through sign be zero and further prohibits the training of the MSM. We propose the Customized PGD to enable the training of the MSM. Here we conduct other four experiments to validate the indispensability and the effect of the Customized PGD on the proposed MTA framework.
|
| 403 |
+
|
| 404 |
+
Table 4: Targeted transfer attack results on Cifar-10.
|
| 405 |
+
|
| 406 |
+
<table><tr><td>Method</td><td>MN-V3</td><td>SN-V1</td><td>SN-V2</td><td>SN-A</td><td>SN-B</td></tr><tr><td>DI</td><td>16.3%</td><td>26.4%</td><td>17.2%</td><td>22.3%</td><td>21.6%</td></tr><tr><td>MI</td><td>29.6%</td><td>43.6%</td><td>29.8%</td><td>37.1%</td><td>35.4%</td></tr><tr><td>TI</td><td>17.6%</td><td>21.1%</td><td>16.5%</td><td>26.1%</td><td>25.8%</td></tr><tr><td>IR</td><td>10.8%</td><td>19.6%</td><td>9.5%</td><td>13.7%</td><td>12.5%</td></tr><tr><td>AEG</td><td>47.2%</td><td>53.8%</td><td>36.5%</td><td>42.6%</td><td>41.0%</td></tr><tr><td>MTA</td><td>49.0%</td><td>70.3%</td><td>47.7%</td><td>60.3%</td><td>58.5%</td></tr></table>
|
| 407 |
+
|
| 408 |
+
Table 5: Transfer attack results with $\epsilon = 8 / 2 5 5$ on Cifar-10.
|
| 409 |
+
|
| 410 |
+
<table><tr><td>Method</td><td>MN-V3</td><td>SN-V1</td><td>SN-V2</td><td>SN-A</td><td>SN-B</td></tr><tr><td>DI</td><td>31.5%</td><td>42.1%</td><td>30.0%</td><td>38.2%</td><td>36.9%</td></tr><tr><td>MI</td><td>44.2%</td><td>59.8%</td><td>43.2%</td><td>55.7%</td><td>54.9%</td></tr><tr><td>TI</td><td>29.5%</td><td>31.3%</td><td>29.6%</td><td>37.7%</td><td>36.8%</td></tr><tr><td>IR</td><td>29.2%</td><td>51.1%</td><td>35.3%</td><td>38.5%</td><td>37.4%</td></tr><tr><td>AEG</td><td>58.0%</td><td>66.5%</td><td>50.4%</td><td>61.9%</td><td>59.6%</td></tr><tr><td>MTA</td><td>62.5%</td><td>79.6%</td><td>58.2%</td><td>70.5%</td><td>69.3%</td></tr></table>
|
| 411 |
+
|
| 412 |
+
As PGD with L2 constraint contains no sign, in the first experiment, we use PGD with L2 constraint $( P G D _ { L 2 } )$ instead of the Customized PGD to attack the MSM in the training phase and denote the trained MSM as MTAP GDL2.
|
| 413 |
+
|
| 414 |
+
PGD with L1 constraint also contains no sign. In the second experiment, we use PGD with L1 constraint $( P G D _ { L 1 } )$ to attack the MSM in the training phase and denote the trained MSM as MTAP GDL1.
|
| 415 |
+
|
| 416 |
+
Both $\gamma _ { 1 }$ and $\gamma _ { 2 }$ of the Customized PGD are set to 0.01 by default. In the third experiment, we set $\gamma _ { 1 }$ to 0.05. Note that we decrease $\epsilon _ { c }$ appropriately to offset the increase of the training perturbation size caused by setting $\gamma _ { 1 }$ to 0.05. All the other experimental settings are consistent with the default settings. We denote the MSM trained in this experiment as $\mathrm { M T A } _ { \gamma _ { 1 } = 0 . 0 5 }$ .
|
| 417 |
+
|
| 418 |
+
In the fourth experiment, we set $\gamma _ { 2 }$ to 0.05 and denote the trained MSM as $\mathrm { M T A } _ { \gamma _ { 2 } = 0 . 0 5 }$
|
| 419 |
+
|
| 420 |
+
Table 6 reports all the four experimental results. We can get three conclusions. First, directly using $P G D _ { L 1 }$ or $P G D _ { L 2 }$ in MTA’s training stage is also effective to train the MSM but leads to limited performance. Second, the proposed Customized PGD is important for the proposed MTA framework to achieve superior performance. Third, larger $\gamma _ { 1 }$ or $\gamma _ { 2 }$ damages the performances of MTA.
|
| 421 |
+
|
| 422 |
+
# A.3.5 MORE EXPERIMENTS ABOUT SOURCE AND TARGET MODELS
|
| 423 |
+
|
| 424 |
+
Here we change the setting of source and target models, and evaluate MTA under this new setting. In this setting, the source models are MobileNet-V2, ShuffleNet-V1, ShuffleNet-V2, SqueezeNet-A, and SqueezeNet-B, and the target models are ResNet-10, ResNet-18, ResNet-34, SeResNet-14, SeResNet-26, SeResNet-50, MobileNet-V1, and MobileNet-V2. All the other experimental settings are consistent with those introduced before. The experimental results are summarized in Table 7, where MTA still shows its advantage in the transfer attack problem.
|
| 425 |
+
|
| 426 |
+
A.3.6 THE EXPERIMENT WHERE SOURCE MODELS DO NOT SHARE TRAINING SAMPLES WITHTARGET MODELS.
|
| 427 |
+
|
| 428 |
+
In our previous experiment, the source and target models are all trained on the same training set. Here we conduct a new experiment, where we train the source and target models on different training samples, and use the new trained models to perform transfer attack. This experiment is performed on Cifar-10, which contains 10 categories and each category in the training set contains 5000 images.
|
| 429 |
+
|
| 430 |
+
Table 6: More transfer attack experimental results on Cifar-10.
|
| 431 |
+
|
| 432 |
+
<table><tr><td>Method</td><td>MN-V3</td><td>SN-V1</td><td>SN-V2</td><td>SN-A</td><td>SN-B</td></tr><tr><td>MetaAttack</td><td>39.2%</td><td>43.9%</td><td>32.1%</td><td>38.6%</td><td>37.8%</td></tr><tr><td>MTAPGD L2</td><td>80.8%</td><td>92.7%</td><td>83.5%</td><td>89.0%</td><td>86.8%</td></tr><tr><td>MTAPGD L1</td><td>81.5%</td><td>91.3%</td><td>82.4%</td><td>85.3%</td><td>83.7%</td></tr><tr><td>MTAγ1=0.05</td><td>90.5%</td><td>98.0%</td><td>90.2%</td><td>94.5%</td><td>93.1%</td></tr><tr><td>MTAγ2=0.05</td><td>86.7%</td><td>95.3%</td><td>85.8%</td><td>89.5%</td><td>88.4%</td></tr><tr><td>MTA</td><td>91.8%</td><td>98.4%</td><td>90.9%</td><td>94.9%</td><td>93.8%</td></tr></table>
|
| 433 |
+
|
| 434 |
+
Table 7: The MSM is trained with source models MobileNet-V3, ShuffleNet-V1, ShuffleNet-V2, SqueezeNet-A, and SqueezeNet-B. From left to right, the target models are ResNet-10 (Res-10), ResNet-18 (Res-18), ResNet-34 (Res-34), SeResNet-14 (SE-14), SeResNet-26 (SE-26), SeResNet-50 (Res-18), MobileNet-V1 (MB-V1), and MobileNet-V2 (MB-V2).
|
| 435 |
+
|
| 436 |
+
<table><tr><td>Method</td><td>Res-10</td><td>Res-18</td><td>Res-34</td><td>SE-14</td><td>SE-26</td><td>SE-50</td><td>MB-V1</td><td>MB-V2</td></tr><tr><td>PGD</td><td>46.9%</td><td>42.5%</td><td>50.1%</td><td>49.6%</td><td>50.2%</td><td>45.9%</td><td>47.9%</td><td>54.5%</td></tr><tr><td>DI</td><td>65.2%</td><td>56.9%</td><td>69.6%</td><td>70.2%</td><td>71.5%</td><td>65.7%</td><td>69.5%</td><td>71.2%</td></tr><tr><td>MI</td><td>89.5%</td><td>86.1%</td><td>90.7%</td><td>88.3%</td><td>91.0%</td><td>89.1%</td><td>86.6%</td><td>88.8%</td></tr><tr><td>TI</td><td>48.1%</td><td>39.2%</td><td>49.9%</td><td>53.8%</td><td>55.6%</td><td>47.8%</td><td>63.9%</td><td>60.8%</td></tr><tr><td>MTA</td><td>96.7%</td><td>94.6%</td><td>98.3%</td><td>98.7%</td><td>98.8%</td><td>97.5%</td><td>96.7%</td><td>98.7%</td></tr></table>
|
| 437 |
+
|
| 438 |
+
In this experiment, we split the training set into two sub-training sets and each of the sub-training set contains all the 10 categories. Every category in the first sub-training set contains 2500 images and every category in the second sub-training set contains the remaining 2500 images. Therefore, there is no overlapping samples between the two sub-training sets, and the two sub-training sets share only the label set. We use the first sub-training set to train the source models and the meta-surrogate model, and use the second sub-training set to train the target models. Thus the source models and the meta-surrogate model does not use the training images of the target models. The source models are ResNet-10, ResNet-18, ResNet-34, SeResNet-14, SeResNet-26, SeResNet-50, MobileNet-V1, MobileNet-V2 with testing accuracies of $8 6 . 8 \%$ , $8 6 . 7 \%$ , $8 7 . 2 \%$ , $8 4 . 2 \%$ , $8 5 . 4 \%$ , $8 7 . 7 \%$ , $8 0 . 7 \%$ , and $8 0 . 9 \%$ , respectively. The target models are MobileNet-V3, ShuffleNet-V1, ShuffleNet-V2, SqueezeNet-A, and SqueezeNet-B with testing accuracies of $7 3 . 9 \%$ , $8 1 . 1 \%$ , $7 2 . 6 \%$ , $8 2 . 3 \%$ , and $8 3 . 0 \%$ , respectively. Then we use the source models and the trained meta-surrogate model to attack the target models. The experimental results are reported in Table 8. It is clear that when we know the label set but do not know the training images of the target models, MTA still outperforms the baselines with clear margins.
|
| 439 |
+
|
| 440 |
+
# A.4 THE SUPPLEMENTAL EXPERIMENTAL SETTINGS OF MTA ON IMAGENET.
|
| 441 |
+
|
| 442 |
+
In our experiment on ImageNet, we found that the MSM directly trained on the resolution of $2 2 4 \times 2 2 4$ often suffers from slow and unstable convergence due to the high dimensionality. Therefore, we develop a three-stage training strategy for gradually and stably training the MSM. The first training stage only trains the top 4 blocks and the classifier of the MSM. The input data $x _ { a d v } ^ { k - 1 }$ is down-sampled by $4 \times$ and is fed into the 3rd block skipping the 1st and 2nd blocks. The perturbation $g _ { e n s } ^ { k - 1 }$ is first up-sampled by $4 \times$ and is then added to $x _ { a d v } ^ { k - 1 }$ to obtain $x _ { a d v } ^ { k }$ . The second stage trains the top 5 blocks and the classifier. The input $x _ { a d v } ^ { k - 1 }$ is down-sampled by $2 \times$ and is fed into the 2nd block skipping the 1st block. The third stage trains all layers. Note that, except for the newly added block in the second or third stage and the layers directly connected with the newly added block, all the other layers inherit the weights trained in the previous stage. Due to memory limitation, we set $T _ { t }$ to a small number of 2.
|
| 443 |
+
|
| 444 |
+
The first, second, and third training stages take 100,000, 50,000, and 50,000 iterations, with the batch size of 50, 36, and 24, respectively. Both the second and the third stages train the newly added blocks and the layers directly connected with them in the first 20,000 iterations and fine-tune all the blocks in the later 30,000 iterations. The learning rate $\alpha$ and the number of iterations $T _ { t }$ are set to 0.001 and 2, respectively. In the first, second, and third training stages, $\epsilon _ { c }$ is initialized to 3, 000, 1, 200, and 1, 200 respectively, and is exponentially decayed by $0 . 9 \times$ for every $4 , 0 0 0 , 3 , 0 0 0$ , and 3, 000 iterations, respectively.
|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
Figure 4: (a) DenseNet-22-BC. Orange cube is convolution layer with $3 \times 3$ kernel size. Pink cube is convolution layer with $1 \times 1$ kernel size. ‘Bottle Neck $( M _ { 2 }$ ) $\ast 3 ^ { \ast }$ denotes three cascaded ‘Bottle Neck $( M _ { 2 } ) '$ . The number (e.g., $M _ { 1 }$ , $4 * M , M )$ on each convolution layer denotes its number of filters. ‘Pool’ in the Transition block is Max Pooling with both stride and kernel size of $2 \times 2$ , and the last ‘Pool’ before the classifier is Global Average Pooling. (b) The detailed structure of Bottle Neck. (c) The detailed structure of Transition.
|
| 448 |
+
|
| 449 |
+
We refer to the data pre-processing methods in the repository7 on GitHub to pre-process the data used in our experiments on ImageNet. When the resolution of the source model is $2 2 4 \times 2 2 4$ , we refer to ‘vgg preprocessing.py’ while when the resolution is $2 9 9 \times 2 9 9$ , we refer to ‘inception preprocessing.py’.
|
| 450 |
+
|
| 451 |
+
# A.5 ATTACKING TRANSFORMER
|
| 452 |
+
|
| 453 |
+
We also conduct an experiment on ImageNet to evaluate how the proposed MTA performs in attacking Vision Transformer (ViT). In this experiment, the source model is Inception-V3, and the target model is Vit base patch $1 6 . 2 2 4 ^ { 8 }$ . Experimental results are reported in Table 9. It is clear that MTA performs the best in attacking ViT.
|
| 454 |
+
|
| 455 |
+
# A.6 THE NETWORK ARCHITECTURE
|
| 456 |
+
|
| 457 |
+
Table 8: The transfer attack results on Cifar-10 when the source models do not share training images with target models. The source models are ResNet-10 (Res-10), ResNet-18 (Res-18), ResNet-34 (Res34), SeResNet-14 (SE-14), SeResNet-26 (SE-26), SeResNet-50 (Res-18), MobileNet-V1 (MB-V1), and MobileNet-V2 (MB-V2). The target models are MobileNet-V2, ShuffleNet-V1, ShuffleNet-V2, SqueezeNet-A, and SqueezeNet-B.
|
| 458 |
+
Table 9: Transfer attack performances of MTA on ViT.
|
| 459 |
+
|
| 460 |
+
<table><tr><td>Method</td><td>PGD</td><td>TI</td><td>DI</td><td>MI</td><td>MTA</td></tr><tr><td>Success Rate</td><td>5.5%</td><td>8.6%</td><td>7.0%</td><td>15.6%</td><td>21.3%</td></tr></table>
|
| 461 |
+
|
| 462 |
+
DenseNet-22BC is shown in Figure 4. $M _ { 1 }$ , $M _ { 2 }$ , $M _ { 3 }$ , and $M _ { 4 }$ are set to 80, 40, 100, and 110, respectively. We denote MTA with DenseNet-22BC backbone as $\mathbf { M T A } _ { d e n s e }$ and show its performances in Table 1 of the main-body.
|
| 463 |
+
|
| 464 |
+
The simplified Inception network is a much shallower and thinner version of the official InceptionResNet-V2. Figure 5 shows the structure of the simplified Inception. The official Inception-ResNet
|
| 465 |
+
|
| 466 |
+
Figure 5: The simplified Inception network. All the blocks have the same inner structures with those of Inception-ResNet-V2.
|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
Figure 6: Transfer attack success rates of MTA on the eight black-box Cifar-10 models, across the training process.
|
| 470 |
+
|
| 471 |
+
V2 repeats each Indeption-resnet1-A, -B, or -C block for several times while the simplified Inception does not repeat them. We denote MTA with this backbone as $\mathbf { M T A } _ { I n c }$ and show its performances in Table 2 of the main-body.
|
| 472 |
+
|
| 473 |
+
# A.7 DEFINITION OF ATTACK SUCCESS RATE.
|
| 474 |
+
|
| 475 |
+
The formulation of attack success rate is $\begin{array} { r } { R a t e \mathrm { ~ = ~ } \frac { C a r d ( \{ x \| x \in D _ { t } , M ( x ) = y \neq M ( x _ { a d v } ) \} ) } { C a r d ( \{ x \| x \in D _ { t } , M ( x ) = y \} ) } } \end{array}$ , where $D _ { t }$ is the test set, $x$ is a test image and $x _ { a d v }$ is the adversarial image generated for $x$ , $y$ is the groundtruth label for $x$ , $M$ is the target model and $M ( x )$ is the prediction of the target model for $x$ . $\{ x \| x \in D _ { t } , M ( x ) = y \}$ is the set containing all clean images that are correctly classified by model $M$ . $\{ x \| x \in D _ { t } , M ( x ) = y \neq M ( x _ { a d v } ) \}$ is the set containing all clean images that not only are correctly classified by model $M$ but also the corresponding adversarial images are misclassified by model $M$ . $C a r d ( \{ x \| x \in D _ { t } , M ( x ) = y \}$ ) denotes the number of elements in the set $\{ x \| x \in D _ { t } , M ( x ) = y \}$ .
|
| 476 |
+
|
| 477 |
+
# A.8 IMPLEMENTATIONS OF THE COMPARED METHODS.
|
| 478 |
+
|
| 479 |
+
For fair comparisons between MTA and the compared methods, we tune the compared methods for their best possible performances in our re-implementation. $\epsilon$ is set to 15 by default for all methods and $T _ { v }$ is set to 10 for all PGD-based methods.
|
| 480 |
+
|
| 481 |
+
MI utilizes gradient momentum to make the generated adversarial examples more transferable. The most important hyper-parameter of MI is $\mu$ . In our implementation, we found that setting $\mu$ to 1 can achieve the best transfer attack performance.
|
| 482 |
+
|
| 483 |
+
DI. We follow the available public code9 of DI to implement it in Tables 1, 2, and 3. As to the experiments on ImageNet, we set ’FLAGS.image width’ and ’FLAGS.image resize’ (two parameters of the input diversity function in the official code9) to 224 and 256 respectively. On Cifar-10, we set ’FLAGS.image width’ and ’FLAGS.image resize’ to 32 and 36, respectively. For all experiments, we set $p$ to 0.8.
|
| 484 |
+
|
| 485 |
+
TI. We directly utilize the public code10 to implement TI and TI-DI in Tables 1, and 3, respectively.
|
| 486 |
+
|
| 487 |
+
SGM uses a parameter $\gamma$ to reduce the gradient from all residual modules of ResNet or DenseNet. We utilize grid search to tune $\gamma$ for each ResNet and DenseNet source model shown in Table 3. We denote $\gamma$ for the source model of Res-50, Res-152, DN-161, and DN-121 as $\gamma _ { r e s 5 0 }$ , γres152, γdn161, and $\gamma _ { d n 1 2 1 }$ , respectively. The tuned best $\gamma _ { r e s 5 0 }$ , $\gamma _ { r e s 1 5 2 }$ , and $\gamma _ { d e n s e }$ for the source model group $\mathrm { R e s } { - } 5 0 { + } \mathrm { R e s } { - } 1 5 2 { + } \mathrm { D N } { - } 1 6 1$ are 0.20, 0.45, and 0.70, respectively. The tuned best $\gamma _ { r e s 5 0 }$ and $\gamma _ { d n 1 2 1 }$ for the source model group Res-50+Inc-V1+DN-121 are 0.60 and 0.85, respectively. The tuned best $\gamma _ { r e s 5 0 }$ for the source model group Res-50+Inc-V1 is 0.65.
|
| 488 |
+
|
| 489 |
+
A-PGD. We directly utilize the public public code11 of A-PGD to implement it in Table 1.
|
| 490 |
+
|
| 491 |
+
AEG. By referring to the AEG’s paper and code12, we re-implement AEG on Cifar-10 and train the generator and the critic for 500 epochs with the learning rate of 0.001. The architecture of the generator is the encoder-decoder defined in Tab.7 of AEG’s paper. We do not implement AEG on ImageNet because training the generator and critic is expensive on ImageNet.
|
| 492 |
+
|
| 493 |
+
IR. We directly utilize the public code13 of IR to implement it on ImageNet. When implementing IR on Cifar-10, we set the hyper-parameter ‘args.grid scale’ to 1.
|
| 494 |
+
|
| 495 |
+
# A.9 TRAINING CURVES
|
| 496 |
+
|
| 497 |
+
In the training process of the MSM, we evaluate MTA’s transfer attack performances on the target models for every 250 iterations. Figure 6 visualizes the performance curves on eight Cifar-10 target models. It is observed that with the training going on, the transfer attack success rates on the target models rise gradually. The periodic fluctuations of the performances are caused by the periodic decay of the hyper-parameter $\epsilon _ { c }$ described in Section 4.1.1.
|
| 498 |
+
|
| 499 |
+
# A.10 COMPUTATIONAL COST
|
| 500 |
+
|
| 501 |
+
We conduct all experiments on Tesla P40 GPU. The computational cost can be summarized into training cost and inference cost happened in the training and the inference phases, respectively. The training cost of the proposed MTA depends mainly on the backbone of MSM, the used source models, the dataset, the batch size, $T _ { t }$ , and etc.. On Cifar-10, the default backbone of the MSM is ResNet-13, the batch size is 64, $T _ { t } = 7$ , and we use 8 source models to train the MSM. The training costs one P40 GPU and approximately $2 . 5 \mathrm { T }$ FLOPs per iteration. On ImageNet, the default backbone of the MSM is ResNet-19, $T _ { t } = 2$ , the batch size is 24 in the third training stage. When using the Inc-V3 source model to train the MSM, the third training stage costs one P40 and approximately 3.2T FLOPs per iteration. When using the Res-152, Res-50, and DN-161 source models to train the MSM, the third training stage costs three P40 GPUs and approximately 6.5T FLOPs per iteration.
|
| 502 |
+
|
| 503 |
+
In the inference phase (generating adversarial examples and attack the target models), the cost of MTA depends mainly on the backbone of MSM and $T _ { v }$ . The inference cost of baselines depend on the source models and $T _ { v }$ . On ImageNet, when using the Res-152, Res-50, and DN-161 source models, the PGD-based baselines (DI, MI, TI, SGM) cost about 124.1 GFLOPs per gradient ascent step per image, and cost about 109.1M parameters. As a comparison, the inference cost of MTA is only 11.3 GFLOPs per gradient ascent step per image and the parameter the MTA needed is only 6.77M. Obviously, both the inference cost and the parameter the MTA used is much smaller than those of the PGD-based baselines, and this is another advantage of the proposed MTA over the PGD-based baselines.
|
| 504 |
+
|
| 505 |
+
# A.11 VISUALIZATION OF ADVERSARIAL EXAMPLES
|
| 506 |
+
|
| 507 |
+
Figure 7 visualizes the adversarial examples and the noises generated for the corresponding clean images via MI, DI, TI, SGM, IR, and MTA. All the clean images are sampled from the testing set of ImageNet.
|
| 508 |
+
|
| 509 |
+
# A.12 THE TENSORFLOW CODE
|
| 510 |
+
|
| 511 |
+
We show the simplified core code of MTA on the last two pages for a better understanding of our work. Note that the showed code is used for the experiments on Cifar-10 but not on ImageNet. The code used on ImageNet differs slightly from the showed code.
|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
Figure 7: The adversarial examples and the noises generated via MI, DI, TI, SGM, IR, and MTA. The corresponding clean images are shown in the left most column. The source model is Res-152.
|
| 515 |
+
|
| 516 |
+
1 import tensorflow as tf
|
| 517 |
+
2
|
| 518 |
+
3 class Meta_Transfer_Attack:
|
| 519 |
+
4 def _init__(self):
|
| 520 |
+
5 # Define some hyperparameters
|
| 521 |
+
6 self.lr $=$ tf.placeholder_with_default(0.001, ())
|
| 522 |
+
7 self.epsilon_c $=$ tf.placeholder_with_default(1, ())
|
| 523 |
+
8 # Define the meta-surrogate model
|
| 524 |
+
9 self.MSM $=$ ResNet13()
|
| 525 |
+
10 # Define the source models
|
| 526 |
+
11 self.source_models $=$ [ResNet(10), ..., MobileNet_V2()]
|
| 527 |
+
12 # Define the input data and the label
|
| 528 |
+
13 self.image $=$ tf.placeholder(tf.float32, shape $=$ [None, 32, 32, 3])
|
| 529 |
+
14 self.label $=$ tf.placeholder(tf.float32, shape $=$ [None, 10])
|
| 530 |
+
15
|
| 531 |
+
16 def build_training_graph(self, T):
|
| 532 |
+
17 # The initial adversarial examples are the clean images
|
| 533 |
+
18 attack $=$ self.image
|
| 534 |
+
19 with tf.variable_scope('surrogate', reuse $=$ tf.AUTO_REUSE):
|
| 535 |
+
20 for k in range(T):
|
| 536 |
+
21 # Predict the adversarial examples
|
| 537 |
+
22 surrogate_logits $=$ self.MSM.predict(attack)
|
| 538 |
+
23
|
| 539 |
+
24 # meta-surrogate models' loss on the adversarial examples.
|
| 540 |
+
25 surrogate_loss $=$ Cross_entropy(logits $=$ surrogate_logits,
|
| 541 |
+
26 labels $=$ self.label)
|
| 542 |
+
27
|
| 543 |
+
28 # calculate Gˆk
|
| 544 |
+
29 grad $=$ tf.gradients(surrogate_loss, attack)[0]
|
| 545 |
+
30
|
| 546 |
+
31 # calculate Gˆk_1
|
| 547 |
+
32 grad_1 $=$ grad / tf.reduce_sum(tf.abs(grad), axis $=$ [1,2,3],
|
| 548 |
+
33 keep_dims $=$ True)
|
| 549 |
+
34
|
| 550 |
+
35 # calculate Gˆk_t
|
| 551 |
+
36 mean_abs_grad $=$ tf.reduce_mean(tf.abs(grad), axis $=$ [1,2,3],
|
| 552 |
+
37 keep_dims $=$ True)
|
| 553 |
+
38 norm_one_grad $=$ grad / mean_abs_grad
|
| 554 |
+
39 grad_atan $=$ tf.atan(norm_one_grad) $\star$ (2 / 3.1415926)
|
| 555 |
+
40
|
| 556 |
+
41 # calculate Gˆk_s
|
| 557 |
+
42 grad_sign $=$ tf.sign(grad)
|
| 558 |
+
43
|
| 559 |
+
44 # calculate Gˆk_ens
|
| 560 |
+
45 grad_ens $=$ grad_1 $^ +$ 0.01 $\star$ grad_sign $^ +$ 0.01 $\star$ grad_atan
|
| 561 |
+
46
|
| 562 |
+
47 # Obtain the adversarial examples Xˆk_adv
|
| 563 |
+
48 attack_temp $=$ attack $^ +$ (self.epsilon_c / T) $\star$ grad_ens
|
| 564 |
+
49 attack $=$ tf.clip_by_value(attack, 0.0, 1.0)
|
| 565 |
+
50
|
| 566 |
+
51 # Evaluate the adversarial examples $X ^ { \wedge }$ T_adv on the source models
|
| 567 |
+
52 with tf.variable_scope('Source', reuse $: =$ tf.AUTO_REUSE):
|
| 568 |
+
53 for model in self.source_models:
|
| 569 |
+
54 logits $=$ model.predict(attack)
|
| 570 |
+
55 loss $=$ Cross_entropy(logits $=$ logits, labels $=$ self.label)
|
| 571 |
+
56 self.source_loss $+ =$ tf.reduce_mean(loss)/len(self.source_models)
|
| 572 |
+
57
|
| 573 |
+
58
|
| 574 |
+
59 def build_optimizing_graph(self):
|
| 575 |
+
60 opt $=$ tf.train.AdamOptimizer(self.lr)
|
| 576 |
+
61 $\#$ Optimize the MSM via maximizing the source models' loss.
|
| 577 |
+
62 gvs $=$ opt.compute_gradients(-self.source_loss, self.MSM.weight)
|
| 578 |
+
63 gvs $=$ [(tf.clip_by_value(grad, -15, 15), var) for grad, var in gvs]
|
| 579 |
+
64 self.train_op $=$ optimizer.apply_gradients(gvs)
|
| 580 |
+
65
|
| 581 |
+
66 def main():
|
| 582 |
+
67 # Initialize the settings.
|
| 583 |
+
68 Batch_size $=$ 64
|
| 584 |
+
69 Init_eps_c $=$ 1600 / 255
|
| 585 |
+
70
|
| 586 |
+
71 # Define the graph
|
| 587 |
+
72 MTA $=$ Meta_Transfer_Attack()
|
| 588 |
+
73 MTA.build_training_graph(7)
|
| 589 |
+
74 MTA.build_optimizing_graph()
|
| 590 |
+
75
|
| 591 |
+
76 # Define the data loader
|
| 592 |
+
77 Cifar10_dataloader $=$ DataSet('Cifar10')
|
| 593 |
+
78
|
| 594 |
+
79 sess $=$ tf.InteractiveSession()
|
| 595 |
+
80 tf.global_variables_initializer().run()
|
| 596 |
+
81
|
| 597 |
+
82 # Restore the weights of all source models
|
| 598 |
+
83 restore_source_weights(MTA.source_models, sess)
|
| 599 |
+
84
|
| 600 |
+
85 for iter in range(47000):
|
| 601 |
+
86 # Exponentially decay eps_c by 0. $9 \times$ for every 4000 iterations.
|
| 602 |
+
87 eps_c $=$ Init_eps_c $\star$ ( 0.9 \*\* int(iter / 4000) )
|
| 603 |
+
88
|
| 604 |
+
89 images, labels $=$ Cifar10_dataloader.get_data(Batch_size)
|
| 605 |
+
90
|
| 606 |
+
91 feed_dict $\begin{array} { r l } { = } & { } \left\{ \begin{array} { l } { \right\} } \end{array} \end{array}$
|
| 607 |
+
92 feed_dict[MTA.image] $=$ images
|
| 608 |
+
93 feed_dict[MTA.label] $=$ labels
|
| 609 |
+
94 feed_dict[MTA.lr] $=$ 0.001
|
| 610 |
+
95 feed_dict[MTA.epsilon_c] $=$ eps_c
|
| 611 |
+
96
|
| 612 |
+
97 # Train the MSM
|
| 613 |
+
98 sess.run(MTA.train_op, feed_dict)
|
md/dev/2clwrA2tfik/2clwrA2tfik.md
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dataset Distillation using Neural Feature Regression
|
| 2 |
+
|
| 3 |
+
Yongchao Zhou Department of Computer Science University of Toronto yongchao.zhou@mail.utoronto.ca
|
| 4 |
+
|
| 5 |
+
Ehsan Nezhadarya Toronto AI Lab LG Electronics Canada ehsan.nezhadarya@lge.com
|
| 6 |
+
|
| 7 |
+
Jimmy Ba Department of Computer Science University of Toronto jba@cs.toronto.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Dataset distillation aims to learn a small synthetic dataset that preserves most of the information from the original dataset. Dataset distillation can be formulated as a bi-level meta-learning problem where the outer loop optimizes the metadataset and the inner loop trains a model on the distilled data. Meta-gradient computation is one of the key challenges in this formulation, as differentiating through the inner loop learning procedure introduces significant computation and memory costs. In this paper, we address these challenges using neural Feature Regression with Pooling (FRePo), achieving the state-of-the-art performance with an order of magnitude less memory requirement and two orders of magnitude faster training than previous methods. The proposed algorithm is analogous to truncated backpropagation through time with a pool of models to alleviate various types of overfitting in dataset distillation. FRePo significantly outperforms the previous methods on CIFAR100, Tiny ImageNet, and ImageNet-1K. Furthermore, we show that high-quality distilled data can greatly improve various downstream applications, such as continual learning and membership inference defense. Please check out our webpage at https://sites.google.com/view/frepo.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Knowledge distillation [1] is a technique in deep learning to compress knowledge for easy deployment. Most previous works focus on model distillation [2, 3] where the knowledge acquired by a large teacher model is transferred to a small student model. In contrast, dataset distillation [4, 5] aims to learn a small set of synthetic examples preserving most of the information from a large dataset such that a model trained on it can achieve similar test performance as one trained on the original dataset. Distilled data can accelerate model training and reduce the cost of storing and sharing a dataset. Moreover, its highly condensed and synthetic nature can also benefit various applications, such as continual learning [5–8], neural architecture search [5, 7], and privacy-preserving tasks [9, 10].
|
| 16 |
+
|
| 17 |
+
Dataset distillation was first studied by Maclaurin et al. [11] in the context of gradient-based hyperparameter optimization and subsequently Wang et al. [4] formally proposed dataset distillation as a new task. Dataset distillation can be naturally formulated as a bi-level meta-learning problem. The inner loop optimizes the model parameters on the distilled data (meta-parameters), while the outer loop refines the distilled data with meta-gradient updates.
|
| 18 |
+
|
| 19 |
+
One key challenge in dataset distillation is computing the meta-gradient. Several methods [4, 11–13] compute it by back-propagating through the unrolled computation graph, but they often suffer from huge compute and memory requirement [14], training instability [15, 16], and truncation bias [17]. To avoid unrolled optimization, surrogate objectives are used to derive the meta-gradient, such as gradient matching [5, 7, 18], feature alignment [8, 19], and training trajectory matching [20]. Nevertheless, a surrogate objective may introduce its own bias [19], and thus, may not accurately reflect the true objective. An alternative is using kernel methods, such as Neural Tangent Kernel (NTK) [21], to approximate the inner optimization [22, 23]. However, computing analytical NTK for modern neural network can be extremely expensive [22, 23].
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Example distilled images from $3 2 \mathbf { x } 3 2$ CIFAR100, 64x64 Tiny ImageNet, and $1 2 8 \mathrm { x } 1 2 8$ ImageNet Subset. The images look real and transfer well to different architectures. They can be used for various downstream applications, such as continual learning and membership inference defense.
|
| 23 |
+
|
| 24 |
+
Even with an accurate meta-gradient, dataset distillation still suffers from various types of overfitting. For instance, the distilled data can easily overfit to a particular learning algorithm [4, 13, 20], a certain stage of optimization [13, 19], or a certain network architecture [5, 7, 20, 22, 23]. Meanwhile, the model can also overfit the distilled data during training, which is the most common cause of overfitting when we train on a small dataset. All these kinds of overfitting impose difficulties on the training and general-purpose use of the distilled data.
|
| 25 |
+
|
| 26 |
+
We propose an efficient meta-gradient computation method and a “model pool” to address the overfitting problems. The bottleneck in meta-gradient computation arises due to the complexity of inner optimization, as we need to know how the inner parameters vary with the outer parameters [24]. However, the inner optimization can be pretty simple if we only train the last layer of a neural network to convergence while keeping the feature extractor fixed. In this case, computing the prediction on the real data using the model trained on the distilled data can be expressed as a kernel ridge regression (KRR) with respect to the conjugate kernel [25]. Hence, computing the meta-gradient is simply back-propagating through the kernel and a fixed feature extractor. To alleviate overfitting, we propose to maintain a diverse pool of models instead of periodically training and resetting a single model as in prior work [7, 13, 18]. Intuitively, our algorithm targets the following question: what is the best data to train the linear classifier given the current feature extractor? Due to the diverse feature extractors we use, the distilled data generalize well to a wide range of model distributions.
|
| 27 |
+
|
| 28 |
+
# Summary of Contributions:
|
| 29 |
+
|
| 30 |
+
• We propose an effective method for dataset distillation. Our method, named neural Feature Regression with Pooling (FRePo), achieves state-of-the-art results on various benchmark datasets with a $1 0 0 \mathrm { x }$ reduction in training time and a $1 0 \mathrm { x }$ reduction in GPU memory requirement. Our distilled data looks real (Figure 1) and transfers well to different architectures. We show that FRePo scales well to datasets with high-resolution images or complex label space. We achieve $7 . 5 \%$ top1 accuracy on ImageNet-1K [26] using only one image per class. The same classifier obtains only $1 . 1 \%$ accuracy from a random subset of real images. The previous methods struggle in this task due to large memory and compute requirements. • We demonstrate that high-quality distilled data can significantly improve various downstream applications, such as continual learning and membership inference defense.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Comparison of FRePo and Unrolled Optimization. $S$ , $X _ { s }$ , $Y _ { s }$ are the distilled dataset, images and labels. $\mathcal { L }$ is the meta-training loss and $\dot { \theta } ^ { ( k ) }$ , $g ^ { ( k ) }$ are the model parameter and gradient at step $k$ . $f ( X )$ is the feature for input $X$ and $K _ { X _ { t } X _ { s } } ^ { \theta }$ is the Gram matrix of $X _ { t }$ and $X _ { s }$ . FRePo is analogous to 1-step TBPTT as it computes the meta-gradient at each step while performing the online model update. However, instead of backpropagating through the inner optimization, FRePo computes the meta-gradient through a kernel and feature extractor.
|
| 34 |
+
|
| 35 |
+
# 2 Method
|
| 36 |
+
|
| 37 |
+
# 2.1 Dataset Distillation as Bi-level Optimization
|
| 38 |
+
|
| 39 |
+
Suppose we have a large labeled dataset $\mathcal { T } = \left\{ \left( \mathbf { x } _ { 1 } , \mathbf { y } _ { 1 } \right) , \dotsc , \left( \mathbf { x } _ { | T | } , \mathbf { y } _ { | T | } \right) \right\}$ with $| \tau |$ image and label\` ˘( pairs. Dataset distillation aims to learn a small synthetic dataset $\mathcal { S } = \left\{ ( \mathbf { x } _ { 1 } , \mathbf { y } _ { 1 } ) , \dotsc , \left( \mathbf { x } _ { | S | } , \mathbf { y } _ { | S | } \right) \right\}$ that preserves most of the information in $\tau$ . We train several neural networks parameterized by $\theta$ on the dataset $s$ and then compute the validation loss $\mathcal { L } ( \mathcal { A } l g \left( \theta , \mathcal { S } \right) , \mathcal { T } )$ on the real dataset $\tau$ , where ${ \mathcal { A } } l g \left( \theta , S \right)$ is the neural network parameters optimized by a learning algorithm $\mathcal { A } g$ with the model initialization $\theta$ and distilled dataset $s$ as its inputs. The validation loss $\mathcal { L } ( \mathcal { A } l g \left( \theta , S \right) , \mathcal { T } )$ is a noisy objective with the stochasticity coming from random model initialization and inner learning algorithm. Thus, we are interested in minimizing the expected value of this loss, which we denote it as $F ( S )$ . We formulate the dataset distillation as the following bi-level optimization problem.
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\overbrace { \mathcal { S } ^ { * } : = \mathop { \mathrm { a r g m i n } } _ { \mathcal { S } } F ( \mathcal { S } ) } ^ { o u t e r - l e v e l } , \mathrm { w h e r e } F ( \mathcal { S } ) = \mathbb { E } _ { \theta \sim P _ { \theta } } \biggl [ \mathcal { L } \Bigl ( \overbrace { \mathcal { A } l g \left( \theta , \mathcal { S } \right) } ^ { i n n e r - l e v e l } , \ T \Bigr ) \biggr ] .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
In this bi-level setup, the outer loop optimizes the distilled data to minimize $F ( S )$ , while the inner loop trains a neural network using the learning algorithm, $\mathcal { A } g$ , to minimize the training loss on the distilled data $s$ . From the meta-learning perspective, the task is defined by the model initialization $\theta$ , and we want to learn a meta-parameter $s$ that generalizes well to different models sampled from the model distributions $P _ { \theta }$ . During learning, we optimize the meta-parameter $s$ by minimizing the meta-training loss $F ( S )$ . In contrast, at meta-test time, we train a new model from scratch on $s$ and evaluate the trained model on a held-out real dataset. This meta-test performance reflects the quality of the distilled data.
|
| 46 |
+
|
| 47 |
+
# 2.2 Dataset Distillation using Neural Feature Regression with Pooling $\mathbf { ( F R e P 0 ) }$
|
| 48 |
+
|
| 49 |
+
The outer-level problem can be solved using gradient-based methods of the form $\mathcal { S } \gets \mathcal { S } \ – \alpha \nabla _ { \mathcal { S } } F ( \mathcal { S } )$ , where $\alpha$ is the learning rate for the distilled data and $\nabla _ { S } F ( S )$ is the meta-gradient [27]. For a particular model $\theta$ , the meta-gradient can be expressed as $\nabla _ { \mathcal { S } } \hat { \mathcal { L } } \left( \mathcal { A } l g \left( \theta , \mathcal { S } \right) , \mathcal { T } \right)$ . Computing this meta-gradient requires differentiating through inner optimization. If $\mathcal { A } \boldsymbol { { l } } _ { g }$ is an iterative algorithm like gradient descent, then backpropagating through the unrolled computation graph [14] can be a solution. However, this type of unrolled optimization introduces significant computation and memory overhead, as the whole training trajectory needs to be stored in memory (Figure 2(b)).
|
| 50 |
+
|
| 51 |
+
Traditionally, these issues are alleviated with truncated backpropagation through time (TBPTT) [28–30]. Instead of backpropagating through an entire unrolled sequence, TBPTT performs backpropagation for each subsequence separately. It is efficient because its time and memory complexity scale linearly with respect to the truncation steps. However, truncation may yield highly biased gradients that severely impact training. To mitigate this truncation bias [14], we consider training only the top layer of a network to convergence. The key insight is that the data helpful for training the output layer can also help train the whole network. Thus, we decompose the neural network into a feature
|
| 52 |
+
|
| 53 |
+
Require: $\tau$ : a labeled dataset; $\alpha$ : the learning rate for the distilled data nitialization: Initialize a labeled distilled dataset $\boldsymbol { \mathcal { S } } = \left( \boldsymbol { X _ { s } } , \boldsymbol { Y _ { s } } \right)$ .
|
| 54 |
+
|
| 55 |
+
Initialization: Initialize a model pool $\mathcal { M }$ with $m$ models $\left\{ \boldsymbol { \theta } _ { i } \right\} _ { i = 1 } ^ { m }$ randomly initialized from $P _ { \theta }$
|
| 56 |
+
|
| 57 |
+
1: while not converged do
|
| 58 |
+
2: Ż Sample a model uniformly from the model pool: $\theta _ { i } \sim \mathcal { M }$ .
|
| 59 |
+
3: Ż Sample a target batch uniformly from the labeled dataset: $( X _ { t } , Y _ { t } ) \sim \tau$ .
|
| 60 |
+
4: $\triangleright$ Compute the meta-training loss $\mathcal { L }$ using Eq. 2
|
| 61 |
+
5: Ż Update the distilled data $s$ $\mathrm { : } ~ X _ { s } \gets X _ { s } - \alpha \nabla _ { X _ { s } } \mathcal { L }$ , and $Y _ { s } \gets Y _ { s } - \alpha \nabla _ { Y _ { s } } \mathcal { L }$
|
| 62 |
+
6: $\triangleright$ Train the model $\theta _ { i }$ on the current distilled data $s$ for one step.
|
| 63 |
+
7: $\triangleright$ Reinitialize the model $\theta _ { i } \sim P _ { \theta }$ if $\theta _ { i }$ has been updated more than $K$ steps.
|
| 64 |
+
|
| 65 |
+
8: end while
|
| 66 |
+
|
| 67 |
+
Output: Learned distilled dataset $\boldsymbol { \mathcal { S } } = \left( \boldsymbol { X _ { s } } , \boldsymbol { Y _ { s } } \right)$
|
| 68 |
+
|
| 69 |
+
extractor and a linear classifier. We fix the feature extractor at each meta-gradient computation and train the linear classifier to convergence before updating $s$ . After that, we adjust the feature extractor by training the whole network on the updated distilled data. We note that similar two-phase procedure has been studied in the context of representation learning [31].
|
| 70 |
+
|
| 71 |
+
Meta-Gradient Computation: If we consider the mean square error loss, then the optimal weights for the linear classifier have a closed-form solution. Moreover, since the feature dimension is typically larger than the number of distilled data, we can use kernel ridge regression (KRR) with a conjugate kernel [25] rather than solving the weights explicitly [12]. The resulting meta-training loss (Eq. 2) is similar to that used in KIP [22, 23], but we use a more flexible kernel rather than NTK.
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal { L } \left( \mathcal { A } l g \left( \theta , \mathcal { S } \right) , \mathcal { T } \right) = \frac { 1 } { 2 } | | Y _ { t } - K _ { X _ { t } X _ { s } } ^ { \theta } ( K _ { X _ { s } X _ { s } } ^ { \theta } + \lambda I ) ^ { - 1 } Y _ { s } | | _ { 2 } ^ { 2 } ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $( X _ { t } , Y _ { t } )$ and $( X _ { s } , Y _ { s } )$ are the inputs and labels of the real data $\tau$ and distilled data $s$ respectively. The Gram matrix between real inputs and distilled inputs is denoted as $K _ { X _ { t } X _ { s } } ^ { \theta } \in \mathbb { R } ^ { | T | \times | S | }$ while the Gram matrix between distilled inputs is denoted as $K _ { X _ { s } X _ { s } } ^ { \theta } \in \mathbb { R } ^ { | S | \times | S | }$ . $\lambda$ t scontrols the regularization strength for KRR. Let us denote the neural network feature for a given input $X$ and model parameter $\theta$ as $\mathbf { \bar { \chi } } _ { f ( X , \theta ) } \in \mathbb { R } ^ { N \times d }$ , where $N$ is the number of input and $d$ is the feature dimension 1. The conjugate kernel is defined by the inner product of the neural network features. Thus, the two Gram matrices are computed as follows:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
K _ { X _ { t } X _ { s } } ^ { \theta } = f ( X _ { t } , \theta ) f ( X _ { s } , \theta ) ^ { \top } , \quad K _ { X _ { s } X _ { s } } ^ { \theta } = f ( X _ { s } , \theta ) f ( X _ { s } , \theta ) ^ { \top } ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Now, computing the meta-gradient $\nabla _ { \mathcal { S } } \mathcal { L } \left( \mathcal { A } l g \left( \theta , \mathcal { S } \right) , \mathcal { T } \right)$ is just back-propagating through the conjugate kernel and a fixed feature extractor, which is very efficient and takes even fewer operations than computing the gradient for the network’s weights. Moreover, we decouple the meta-gradient computation from the model online update. Hence, we can train the online model using any optimizer, and the distilled data will be agnostic to the specific learning algorithm choice. Our proposed method is similar to 1-step TBPTT in that we compute the meta-gradient at each step while performing the online model update. Unlike the conventional 1-step TBPTT, we compute the meta-gradient using a KRR output layer to mitigate truncation bias, illustrated in Figure 2(a).
|
| 84 |
+
|
| 85 |
+
Model Pool: As discussed in Section 1, there are various types of overfitting in dataset distillation. Several techniques have been proposed to alleviate such problem, such as random initialization [4], periodic reset [13, 5, 7], and dynamic bi-level optimization [19]. These techniques share the same underlying principle: the model diversity matters. Thus, we propose to maintain a “model pool” filled with diverse set of parameters obtained from different number of training steps and different random initializations. Unlike the previous methods that periodically training and resetting a single model, FRePo randomly sample a model from the pool at each meta-gradient computation and update it using the current distilled data. However, if a model has been updated more than $K$ steps, we reinitialize it with a new random seed. From the meta-learning perspective, we maintain a diverse set of meta-tasks to sample from and avoid sampling very similar tasks at each consecutive gradient computation to avoid overfitting to a particular setup.
|
| 86 |
+
|
| 87 |
+
Pool Diversity: We can increase the regularization strength by increasing the diversity of the model pool by setting a larger $K$ , using data augmentation when training the model on the distilled data, or using models with different architectures. To keep our method simple, we use the same architecture for all models in the pool and do not use any data augmentation when training the model on the distilled data. Thus, our model pool only contains models with different initialization, at different optimization stages, and trained at different time-step of the distilled data.
|
| 88 |
+
|
| 89 |
+
# 3 Related Work
|
| 90 |
+
|
| 91 |
+
Unrolling in Bi-Level Optimization: One way to compute the meta-gradient is to differentiate through the unrolled inner optimization [4, 11–13]. However, this approach inherits several difficulties of the unrolled optimization, such as: 1) large computation and memory cost [14]; 2) truncation bias with short unrolls [17]; 3) exploding or vanishing gradients with long unrolls [15]; 4) chaotic and poorly conditioned loss landscapes with long unrolls [16]. In contrast, our method considers approximating the inner optimization with kernel ridge regression instead of unrolled optimization.
|
| 92 |
+
|
| 93 |
+
Surrogate Objective: To avoid unrolled optimization, several works turn to surrogate objectives. DC [5], DSA [7], and DCC [18] formulate the dataset distillation as a gradient matching problem between the gradients of neural network weights computed on the real and distilled data. In contrast, DM [8] and CAFE [19] consider the feature distribution alignment between the real and distilled data. Moreover, MTT [20] shows that knowledge from many expert training trajectories can be distilled to a dataset by using a training trajectory matching objective. Nevertheless, surrogate objectives may introduce new biases and thus, may not accurately reflect the true objective. For example, gradient matching approaches [5, 7, 18] only focus on short-range behavior and may easily overfit to a biased set of samples that produce dominant gradients [19, 20].
|
| 94 |
+
|
| 95 |
+
Closed-form Approximation: An alternative way to circumvent unrolled optimization is to find a closed-form approximation to the inner optimization. Based on the correspondence between infinitelywide neural networks and kernel methods, KIP [22, 23] approximates the inner optimization with NTK [21]. In this case, the meta-gradient can be computed by back-propagating through the NTK. However, computing NTK for modern neural networks is extremely expensive. Thus, using NTK for dataset distillation requires thousands of GPU hours and sophisticated implementation of the distributed kernel computation framework [23]. Similar to ours, Bohdal et al. [12] also decomposes the neural network as a feature extractor and a linear classifier. However, they only learn the label and explicitly solve for the optimal classifier weights rather than perform KRR.
|
| 96 |
+
|
| 97 |
+
# 4 Dataset Distillation
|
| 98 |
+
|
| 99 |
+
# 4.1 Implementation Details
|
| 100 |
+
|
| 101 |
+
We compare our method to four state-of-the-art dataset distillation methods [7, 8, 20, 23] on various benchmark datasets [26, 32–37]. We train the distilled data using Algorithm 1 with the same set of hyperparameters for all experiments except stated otherwise. Unlike prior work [7, 8, 20], we do not apply data augmentation during training. However, we apply the same data augmentation [7, 20] during evaluation for a fair comparison. We preprocess the data in a similar way as in previous works [20, 23] but use a wider architecture than previous works [7, 8, 20] because the KRR component does not behave well when the feature dimension is low, resulting in a significant performance drop for our method. Results on the original architecture are included in Appendix ??. We evaluate each distilled data using five random neural networks and report the mean and standard deviation. For the baseline method, we report the best of the reported value in the original paper and our reproducing results.
|
| 102 |
+
|
| 103 |
+
For the sake of brevity, we provide implementation details about data preprocessing, distilled data initialization, and hyperparameters in Appendix ?? and various ablation studies regarding the model pool, batch size, distilled data initialization, label learning, and model architectures in Appendix ??. More distilled image visualizations can be found in Appendix ??. Our code is available at https://github.com/yongchao97/FRePo.
|
| 104 |
+
|
| 105 |
+
Table 1: Test accuracies of models trained on the distilled data from scratch. : denotes performance better than the original reported performance. KRR preformance is shown in bracket. FRePo performs extremely well for one image per class setting on CIFAR100, Tiny ImageNet and CUB-200.
|
| 106 |
+
|
| 107 |
+
<table><tr><td></td><td>Img/Cls</td><td>DSA [7]</td><td>DM[8]</td><td>KIP [23]</td><td>MTT [20]</td><td>FRePo</td></tr><tr><td rowspan="3">MNIST</td><td>1</td><td>88.7±0.6</td><td>89.9 ± 0.8†</td><td>90.1± 0.1</td><td>91.4 ± 0.9†</td><td>93.0 ± 0.4 (92.6 ± 0.4)</td></tr><tr><td>10</td><td>97.9 ±0.1†</td><td>97.6 ± 0.1†</td><td>97.5 ± 0.0</td><td>97.3 ± 0.1+</td><td>98.6 ± 0.1 (98.6 ± 0.1)</td></tr><tr><td>50</td><td>99.2 ± 0.1</td><td>98.6 ± 0.1</td><td>98.3 ± 0.1</td><td>98.5±0.1+</td><td>99.2 ± 0.0 (99.2± 0.1)</td></tr><tr><td rowspan="3">F-MNIST</td><td>1</td><td>70.6 ± 0.6</td><td>71.5 ± 0.5†</td><td>73.5± 0.5</td><td>75.1 ± 0.9†</td><td>75.6 ± 0.3 (77.1 ± 0.2)</td></tr><tr><td>10</td><td>84.8±0.3t</td><td>83.6±0.2t</td><td>86.8±0.1</td><td>87.2± 0.3+</td><td>86.2 ± 0.2 (86.8 ± 0.1)</td></tr><tr><td>50</td><td>88.8±0.2t</td><td>88.2±0.1†</td><td>88.0±0.1</td><td>88.3± 0.1+</td><td>89.6 ± 0.1 (89.9 ± 0.1)</td></tr><tr><td rowspan="3">CIFAR10</td><td>1</td><td>36.7± 0.8†</td><td>31.0 ± 0.6†</td><td>49.9 ± 0.2</td><td>46.3 ± 0.8</td><td>46.8 ± 0.7 (47.9 ± 0.6)</td></tr><tr><td>10</td><td>53.2 ± 0.8†</td><td>49.2 ± 0.8†</td><td>62.7± 0.3</td><td>65.3 ± 0.7</td><td>65.5 ± 0.4 (68.0 ± 0.2)</td></tr><tr><td>50</td><td>66.8± 0.4†</td><td>63.7±0.5t</td><td>68.6± 0.2</td><td>71.6 ± 0.2</td><td>71.7 ± 0.2 (74.4 ± 0.1)</td></tr><tr><td rowspan="3">CIFAR100</td><td>1</td><td>16.8± 0.2†</td><td>12.2 ± 0.4†</td><td>15.7 ± 0.2</td><td>24.3 ± 0.3</td><td>28.7 ± 0.1 (32.3 ± 0.1)</td></tr><tr><td>10</td><td>32.3 ±0.3</td><td>29.7 ±0.3</td><td>28.3 ± 0.1</td><td>40.1 ± 0.4</td><td>42.5 ± 0.2 (44.9 ± 0.2)</td></tr><tr><td>50</td><td>42.8± 0.4</td><td>43.6 ± 0.4</td><td>1</td><td>47.7 ± 0.2</td><td>44.3 ± 0.2 (43.0 ± 0.3)</td></tr><tr><td rowspan="2">T-ImageNet</td><td>1</td><td>6.6± 0.2t</td><td>3.9± 0.2</td><td></td><td>8.8 ±0.3</td><td>15.4 ± 0.3 (19.1 ± 0.3)</td></tr><tr><td>10</td><td>一</td><td>12.9 ± 0.4</td><td></td><td>23.2 ± 0.2</td><td>25.4 ± 0.2 (26.5± 0.1)</td></tr><tr><td rowspan="2">CUB-200</td><td>1</td><td>1.3 ± 0.1†</td><td>1.6 ± 0.1†</td><td></td><td>2.2± 0.1†</td><td>12.4 ± 0.2 (13.7 ± 0.2)</td></tr><tr><td>10</td><td>4.5 ± 0.3†</td><td>4.4 ± 0.2†</td><td></td><td>1</td><td>16.8 ± 0.1 (16.1 ± 0.3)</td></tr></table>
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: (a,b) Training efficiency comparison when learning $1 \mathrm { I m g / C l s }$ on CIFAR100. (c,d) Time per iteration and peak memory usage as we increase the model size. FRePo is significantly more efficient than the previous methods, almost two orders of magnitude faster than the second-best method (i.e., MTT), with only 1/10 of the GPU memory requirement.
|
| 111 |
+
|
| 112 |
+
# 4.2 Standard Benchmarks
|
| 113 |
+
|
| 114 |
+
Distillation Performance: We first evaluate our method on six standard benchmark datasets. We learn 1, 10, and 50 images per class for datasets with only ten classes, while we learn 1 and 10 images per class for CIFAR100 [34] with 100 classes, Tiny ImageNet [35] with 200 classes, and CUB-200 [37] with 200 fine-grained classes. As shown in Table in 1, we achieve the state-of-the-art performance in most settings despite the hyperparameter may be suboptimal. Our method performs exceptionally well on datasets with a complex label space when learning few images per class. For example, we improve the CIFAR100, Tiny ImageNet, and CUB-200 in one image per class setting from $2 4 . 3 \%$ , $8 . 8 \%$ , and $2 . 2 \%$ to $2 8 . 7 \%$ , $1 5 . 4 \%$ , and $1 2 . 4 \%$ , respectively. Figure 4 shows that our distilled images look real and natural though we do not directly optimize for this objective. We observe a strong correlation between the test accuracy and image quality: the better the image quality, the higher the test accuracy. Our results suggest that a highly condensed dataset does not need to be very different from the real dataset as it may just reflect the most common pattern in a dataset. We also report the KRR predictor’s test accuracy using the feature extractor trained on the distilled data. When the dataset is as simple as MNIST [32], the KRR predictor achieves similar performance as the neural network predictor. In contrast, for more complex datasets, the KRR predictor consistently outperforms the neural network predictor, with the most significant gap being $3 . 7 \%$ for Tiny ImageNet in the one image per class setting.
|
| 115 |
+
|
| 116 |
+
Table 2: Cross-architecture transfer performance on CIFAR10 with $1 0 \mathrm { I m g / C l s }$ . Despite being trained for a specific architecture, our distilled data transfer well to various architectures unseen during training. Conv is the default evaluation model used for each method. NN, DN, IN, and BN stand for no normalization, default normalization, Instance Normalization, Batch Normalization respectively.
|
| 117 |
+
|
| 118 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Train Arch</td><td colspan="6">Evaluation Architecture</td></tr><tr><td>Conv</td><td>Conv-NN</td><td>ResNet-DN</td><td>ResNet-BN</td><td>VGG-BN</td><td>AlexNet</td></tr><tr><td>DSA [7]</td><td>Conv-IN</td><td>53.2 ± 0.8</td><td>36.4 ± 1.5</td><td>42.1 ± 0.7</td><td>34.1 ± 1.4</td><td>46.3 ± 1.3</td><td>34.0 ± 2.3</td></tr><tr><td>DM[8]</td><td>Conv-IN</td><td>49.2 ± 0.8</td><td>35.2 ± 0.5</td><td>36.8 ± 1.2</td><td>35.5 ± 1.3</td><td>41.2 ± 1.8</td><td>34.9 ± 1.1</td></tr><tr><td>MTT[20]</td><td>Conv-IN</td><td>64.4 ± 0.9</td><td>41.6 ± 1.3</td><td>49.2 ± 1.1</td><td>42.9 ± 1.5</td><td>46.6 ± 2.0</td><td>34.2 ± 2.6</td></tr><tr><td>KIP [23]</td><td>Conv-NTK</td><td>62.7 ± 0.3</td><td>58.2 ±0.4</td><td>49.0 ± 1.2</td><td>45.8 ± 1.4</td><td>30.1 ± 1.5</td><td>57.2 ± 0.4</td></tr><tr><td>FRePo</td><td>Conv-BN</td><td>65.5 ± 0.4</td><td>65.5 ± 0.4</td><td>58.1 ± 0.6</td><td>57.7 ± 0.7</td><td>59.4 ± 0.7</td><td>61.9 ± 0.7</td></tr></table>
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: (a,b,c) Distilled 1 img/cls from CIFAR100 using FRePo, MTT, and DSA. High quality images also produce high test accuracy. (d) Three categories of learned labels. (Top) High confidence, large margin; (Middle) High confidence, small margin; (Bottom) Low confidence, small margin.
|
| 122 |
+
|
| 123 |
+
Label Learning: A similar trend can also be observed for label learning. When the dataset is simple and has only a few classes, label learning may not be necessary. However, it becomes crucial for complex datasets with many labels, such as CIFAR100 and Tiny-ImageNet (See more details in Appendix ??). Similar to the teacher label in the knowledge distillation [1], we observe that the distilled label also encodes the class similarity. We identify three typical cases in Figure 4d. The first group consists of highly confident labels with a much higher value for one class than other classes (large margin), such as sunflower, bicycle, and chair. In contrast, the distilled labels in the second group are confident but may get confused with some closely-related classes (small margin). For instance, the learned label for "girl" has almost equally high values for the girl, woman, man, boy, and baby, suggesting that these classes are very similar and may be difficult for the model to distinguish them apart. The last group contains distilled labels with low values for all classes, such as bear, beaver, and squirrel. It is often hard for humans to recognize the distilled images in such a group, suggesting that they may be the challenging classes in a dataset.
|
| 124 |
+
|
| 125 |
+
Training Cost Analysis: Figure 3a, 3b shows that our method is significantly more time-efficient than the previous methods. When learning one image per class on CIFAR100, FRePo reaches a similar test accuracy $( 2 3 . 4 \% )$ to the second-best method $( 2 4 . 0 \% )$ in 38 seconds, compared to 3805 seconds for MTT, which is roughly two orders of magnitude faster. Moreover, FRePo achieves $92 \%$ of its final test accuracy ( $2 6 . 4 \%$ out of $2 8 . 7 \%$ ) in only 385 seconds. As shown in Figure 3c, our algorithm takes much less time to perform one gradient step on the distilled data. Thus, we can perform more gradient steps in a fixed time. Furthermore, Figure 3d suggests that our algorithm has much less GPU memory requirement. Therefore, we can potentially use a much larger and more complex model to take advantage of the advancement in neural network architecture.
|
| 126 |
+
|
| 127 |
+
Cross-Architecture Generalization: One desired property of our distilled data is that it generalizes well to architecture it has not seen during the training. Similar to previous works [5, 20], we evaluate the distilled data from CIFAR10 on a wide range of architectures which it has not seen during training, including AlexNet [38], VGG [39], and ResNet [40]. Table 2 shows that our method outperforms previous methods on all unseen architectures. Instance Normalization (IN) [41], as the vital ingredient in several methods (DSA, DM, MTT), seems to hurt the cross-architecture transfer. The performance degrades a lot when no normalization (NN) is applied (Conv-NN, AlexNet) or using a different normalization, like Batch Normalization (BN) [42]. It suggests that the distilled data generated by those methods encode the inductive bias of a particular training architecture. In contrast, our distilled data generalize well to various architectures, including those without normalization (Conv-NN, AlexNet). Note that Figure 1, 4 also indicate that our distilled data encode less architectural bias as the distilled images look natural and authentic. A simple idea to further alleviate the overfitting of a particular architecture is to include more architectures in the model pool. However, the training may not be stable as the meta-gradient computed by different architectures can be very different.
|
| 128 |
+
|
| 129 |
+
Table 3: Distillation performance on higher resolution (128x128) dataset (i.e. ImageNette, ImageWoof) and medium resolution (64x64) dataset with a complex label space (i.e. ImageNet-1K). FRePo scales to high-resolution images and learns the discriminate feature of complex datasets.
|
| 130 |
+
|
| 131 |
+
<table><tr><td></td><td colspan="2">ImageNette (128x128)</td><td colspan="2">ImageWoof (128x128)</td><td colspan="2">ImageNet (64x64)</td></tr><tr><td>Img/Cls</td><td>1</td><td>10</td><td>1</td><td>10</td><td>1</td><td>2</td></tr><tr><td>Random Subset</td><td>23.5± 4.8</td><td>47.7 ± 2.4</td><td>14.2 ± 0.9</td><td>27.0± 1.9</td><td>1.1 ± 0.1</td><td>1.4 ± 0.1</td></tr><tr><td>MTT[20]</td><td>47.7± 0.9</td><td>63.0 ± 1.3</td><td>28.6 ± 0.8</td><td>35.8 ± 1.8</td><td>1</td><td>1</td></tr><tr><td>FRePo</td><td>48.1 ± 0.7</td><td>66.5 ± 0.8</td><td>29.7 ± 0.6</td><td>42.2 ± 0.9</td><td>7.5 ± 0.3</td><td>9.7 ± 0.2</td></tr></table>
|
| 132 |
+
|
| 133 |
+
# 4.3 ImageNet
|
| 134 |
+
|
| 135 |
+
High Resolution ImageNet Subset To understand how well our method performs on high-resolution images, we evaluate it on ImageNette and ImageWoof datasets [36] with a resolution of 128x128. We learn 1 and 10 images per class on both datasets and report the performance in Table 3 and visualize some distilled images in Figure 1. As shown in Table 3, we outperform MTT on all settings and achieve much better performance when we distill ten images per class on a more difficult dataset ImageWoof. It suggests that our distilled data is better at capturing the discriminative features for each class. Figure 1 shows that our distilled images look real and capture the distinguishable feature of different classes. For the easy dataset (i.e., ImageNette), all images have clear different structures, while for ImageWoof, the texture of each dog seems to be crucial.
|
| 136 |
+
|
| 137 |
+
Resized ImageNet-1K: We also evaluate our method on a resized version of ILSVRC2012 [26] with a resolution of 64x64 to see how it performs on a complex label space. Surprisingly, we can achieve $7 . 5 \%$ and $9 . 7 \%$ Top1 accuracy using only 1k and $2 \mathrm { k }$ training examples, compared to $1 . 1 \%$ and $1 . 4 \%$ using an equally-sized real subset.
|
| 138 |
+
|
| 139 |
+
# 5 Application
|
| 140 |
+
|
| 141 |
+
# 5.1 Continual Learning
|
| 142 |
+
|
| 143 |
+
Continual learning (CL) [43] aims to address the catastrophic forgetting problem [43–45] when a model learns sequentially from a stream of tasks. A commonly used strategy to recall past knowledge is based on a replay buffer, which stores representative samples from previous tasks [46–49]. Since sample selection is an important component of constructing an effective buffer [48–51], we believe distilled data can be a key ingredient for a continual learning algorithm due to its highly condensed nature. Several works [6–8, 52] have successfully applied the dataset distillation to the continual learning scenario. Our work shows that we can achieve much better results by using a better dataset distillation technique.
|
| 144 |
+
|
| 145 |
+
We follow Zhao and Bilen [8] that sets up the baseline based on GDumb [49] which greedily stores class-balanced training examples in memory and train model from scratch on the latest memory only. In that case, the continual learning performance only depends on the quality of the replay buffer. We perform 5 and 10 step class-incremental learning [53] on CIFAR100 with an increasing buffer size of 20 images per class. Specifically, we distill 400 and 200 images at each step and put them into the replay buffer. We follow the same class split as Zhao and Bilen [8] and compare our method to random [49], herding [54, 55], DSA [7], and DM [8]. We use the default data preprocessing and default model for each method in this experiment as we find it gives the best performance for each method. We use the test accuracy on all observed classes as the performance measure [8, 48].
|
| 146 |
+
|
| 147 |
+
Table 4: AUC of five attackers on models trained on the real and distilled MNIST data. The model trained on the real data is vulnerable to MIAs, while the model trained on the distilled data is robust to MIAs. Training on distilled data allows privacy preservation while retaining model performance.
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Test Acc (%)</td><td colspan="5">Attack AUC</td></tr><tr><td>Threshold</td><td>LR</td><td>MLP</td><td>RF</td><td>KNN</td></tr><tr><td>Real</td><td>99.2 ± 0.1</td><td>0.99 ± 0.01</td><td>0.99 ± 0.00</td><td>1.00 ±0.00</td><td>1.00 ± 0.00</td><td>0.97 ±0.00</td></tr><tr><td>Subset</td><td>96.8± 0.2</td><td>0.52 ±0.00</td><td>0.50 ± 0.01</td><td>0.53 ± 0.01</td><td>0.55 ± 0.00</td><td>0.54 ±0.00</td></tr><tr><td>DSA</td><td>98.5 ± 0.1</td><td>0.50 ± 0.00</td><td>0.51 ± 0.00</td><td>0.54 ± 0.00</td><td>0.54 ± 0.01</td><td>0.54 ± 0.01</td></tr><tr><td>DM</td><td>98.3 ± 0.0</td><td>0.50 ± 0.00</td><td>0.51 ± 0.01</td><td>0.54 ± 0.01</td><td>0.54 ± 0.01</td><td>0.53 ± 0.01</td></tr><tr><td>FRePo</td><td>98.5± 0.1</td><td>0.52 ±0.00</td><td>0.51 ± 0.00</td><td>0.53 ± 0.01</td><td>0.52 ± 0.01</td><td>0.51 ± 0.01</td></tr></table>
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 5: (a,b) Multi-class accuracies across all classes observed up to a certain time point. We perform significantly better than other methods in both 5 and 10 step class-incremental continual learning. (c,d) Test accuracy and attack AUC as we increase the number of training steps. AUC keeps increasing when training a model on the real data for more steps. In contrast, AUC keeps low when training on distilled data.
|
| 153 |
+
|
| 154 |
+
Figure 5 shows that our method performs significantly better than all previous methods. The final test accuracy for all classes for our method (FRePo) and the second-best method (DM) are $4 1 . 6 \%$ , $3 3 . 9 \%$ in 5-step learning, and $3 8 . 0 \%$ , $3 4 . 0 \%$ in 10-step learning. However, we notice that for FRePo, distilling 2000 images in a continual learning setup achieves a similar test accuracy $( 4 1 . 6 \% )$ as distilling only 1000 images from the whole dataset $( 4 1 . 3 \%$ from Table 1). In addition, performance drops as we perform more steps. It suggests that FRePo considers all available classes to derive the most condensed dataset. Splitting the data into multiple groups and performing independent distillation may generate redundant information or fail to capture the distinguishable features.
|
| 155 |
+
|
| 156 |
+
# 5.2 Membership Inference Defense
|
| 157 |
+
|
| 158 |
+
Membership inference attacks (MIA) aim to infer whether a given data point has been used to train the model or not [56–58]. Ideally, we want a model to learn from the data but not memorize it to preserve privacy. However, deep neural networks are well-known for their ability to memorize all the training examples, even on large and randomly labeled datasets [59]. Several methods have been proposed to defend against such attacks by either modifying the training procedure [60] or changing the inference workflow [61]. This section shows that the distilled data contain little information regarding sample presence in the original dataset. Thus, instead of training on the original datasets, training on distilled data allows privacy preservation while retaining model performance.
|
| 159 |
+
|
| 160 |
+
We consider three distilled data generated by DSA [7], DM [8] and FRePo. We perform five popular "black box" MIA provided by Tensorflow Privacy [62] on models trained on the real data or the data distilled from it. The attack methods include a threshold attack and four model-based attacks using logistic regression (LR), multi-layer perceptron (MLP), random forest (RF) and K-nearest neighbor (KNN). The inputs to those attack methods are ground-truth labels, model predictions, and losses. To measure the privacy vulnerability of the trained model, we compute the area under the ROC curve (AUC) of an attack classifier. Following prior work, [56, 63], we keep a balanced set of training examples (member) and test examples (non-member) with 10K each to maximize the uncertainty of MIA. Thus, the random guessing strategy results in a $50 \%$ MIA accuracy. We conduct experiments on MNIST and FashionMNIST with a distillation size of 500. For space reasons, we provide more implementation details and results in appendix.
|
| 161 |
+
|
| 162 |
+
As shown in Table 4, all models trained on the distilled data preserve privacy as their attack AUCs are closed to random guessing. However, we observe a small drop in test accuracy compared to the model trained on the full dataset, which is expected as we only distill 500 examples instead of 10,000 examples. Compared to the model trained on an equally sized subset of the original data, the model trained on distilled data results in much better test performance. Figure 5c, 5d demonstrate the trade-off between test accuracy and attack effectiveness as measured by ROC AUC. It shows that early stopping can be an effective technique to preserve privacy. However, we will still be under high MIA risk if we perform early stopping by monitoring the validation loss. In contrast, training a model on the distilled data does not have this problem as the attack AUCs keep at a very low level regardless of training steps.
|
| 163 |
+
|
| 164 |
+
# 6 Conclusion
|
| 165 |
+
|
| 166 |
+
We propose neural Feature Regression with Pooling (FRePo) to overcome two challenges in dataset distillation: meta-gradient computation and various types of overfitting in dataset distillation. We obtain state-of-the-art performance on various datasets with a $1 0 0 \mathrm { x }$ reduction in training time and a 10x reduction in GPU memory requirement. The distilled data generated by FRePo looks real and natural and generalizes well to a wide range of architectures. Furthermore, we demonstrate two applications that take advantage of the high-quality distilled data, namely, continual learning and membership inference defense.
|
| 167 |
+
|
| 168 |
+
Broader Impact “Synthetic data”, in the broader sense of artificial data created by generative models, can help researchers understand how an otherwise opaque learning machine “sees” the world. There have been concerns regarding the risk of fake data. This paper explores a new research direction in generating synthetic data only for downstream classification tasks. We believe this work can provide additional interpretability and potentially address the common concerns in machine learning regarding training data privacy.
|
| 169 |
+
|
| 170 |
+
# Acknowledgments and Disclosure of Funding
|
| 171 |
+
|
| 172 |
+
We would like to thank Harris Chan, Andrew Jung, Michael Zhang, Philip Fradkin, Denny Wu, Chong Shao, Leo Lee, Alice Gao, Keiran Paster, and Lazar Atanackovic for their valuable feedback. Jimmy Ba was supported by NSERC Grant [2020-06904], CIFAR AI Chairs program, Google Research Scholar Program and Amazon Research Award. This project was supported by LG Electronics Canada. Resources used in preparing this research were provided, in part, by the Province of Ontario, the Government of Canada through CIFAR, and companies sponsoring the Vector Institute for Artificial Intelligence.
|
| 173 |
+
|
| 174 |
+
# References
|
| 175 |
+
|
| 176 |
+
[1] Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. CoRR, abs/1503.02531, 2015. URL http://arxiv.org/abs/1503.02531.
|
| 177 |
+
[2] Takashi Fukuda, Masayuki Suzuki, Gakuto Kurata, Samuel Thomas, Jia Cui, and Bhuvana Ramabhadran. Efficient knowledge distillation from an ensemble of teachers. In Francisco Lacerda, editor, Interspeech 2017, 18th Annual Conference of the International Speech Communication Association, Stockholm, Sweden, August 20-24, 2017, pages 3697–3701. ISCA, 2017. URL http://www.isca-speech.org/archive/Interspeech_2017/abstracts/0614.html.
|
| 178 |
+
[3] Antonio Polino, Razvan Pascanu, and Dan Alistarh. Model compression via distillation and quantization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id $\cdot ^ { = }$ S1XolQbRW.
|
| 179 |
+
[4] Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A. Efros. Dataset distillation. CoRR, abs/1811.10959, 2018. URL http://arxiv.org/abs/1811.10959.
|
| 180 |
+
[5] Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event,
|
| 181 |
+
|
| 182 |
+
Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum? id=mSAKhLYLSsl.
|
| 183 |
+
|
| 184 |
+
[6] Andrea Rosasco, Antonio Carta, Andrea Cossu, Vincenzo Lomonaco, and Davide Bacciu. Distilled replay: Overcoming forgetting through synthetic samples. CoRR, abs/2103.15851, 2021. URL https://arxiv.org/abs/2103.15851.
|
| 185 |
+
|
| 186 |
+
[7] Bo Zhao and Hakan Bilen. Dataset condensation with differentiable siamese augmentation. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 12674–12685. PMLR, 2021. URL http://proceedings. mlr.press/v139/zhao21a.html.
|
| 187 |
+
|
| 188 |
+
[8] Bo Zhao and Hakan Bilen. Dataset condensation with distribution matching. CoRR, abs/2110.04181, 2021. URL https://arxiv.org/abs/2110.04181.
|
| 189 |
+
|
| 190 |
+
[9] Guang Li, Ren Togo, Takahiro Ogawa, and Miki Haseyama. Soft-label anonymous gastric x-ray image distillation. CoRR, abs/2104.02857, 2021. URL https://arxiv.org/abs/2104. 02857.
|
| 191 |
+
|
| 192 |
+
[10] Jack Goetz and Ambuj Tewari. Federated learning via synthetic data. CoRR, abs/2008.04489, 2020. URL https://arxiv.org/abs/2008.04489.
|
| 193 |
+
|
| 194 |
+
[11] Dougal Maclaurin, David Duvenaud, and Ryan P. Adams. Gradient-based hyperparameter optimization through reversible learning. In Francis R. Bach and David M. Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pages 2113– 2122. JMLR.org, 2015. URL http://proceedings.mlr.press/v37/maclaurin15.html.
|
| 195 |
+
|
| 196 |
+
[12] Ondrej Bohdal, Yongxin Yang, and Timothy M. Hospedales. Flexible dataset distillation: Learn labels instead of images. CoRR, abs/2006.08572, 2020. URL https://arxiv.org/abs/ 2006.08572.
|
| 197 |
+
|
| 198 |
+
[13] Ilia Sucholutsky and Matthias Schonlau. Improving dataset distillation. CoRR, abs/1910.02551, 2019. URL http://arxiv.org/abs/1910.02551.
|
| 199 |
+
|
| 200 |
+
[14] Paul Vicol, Luke Metz, and Jascha Sohl-Dickstein. Unbiased gradient estimation in unrolled computation graphs with persistent evolution strategies. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 10553–10563. PMLR, 2021. URL http://proceedings.mlr.press/v139/ vicol21a.html.
|
| 201 |
+
|
| 202 |
+
[15] Razvan Pascanu, Tomás Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In Proceedings of the 30th International Conference on Machine Learning, ICML 2013, Atlanta, GA, USA, 16-21 June 2013, volume 28 of JMLR Workshop and Conference Proceedings, pages 1310–1318. JMLR.org, 2013. URL http://proceedings.mlr.press/ v28/pascanu13.html.
|
| 203 |
+
|
| 204 |
+
[16] Luke Metz, Niru Maheswaranathan, Jeremy Nixon, C. Daniel Freeman, and Jascha SohlDickstein. Understanding and correcting pathologies in the training of learned optimizers. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 4556–4565. PMLR, 2019. URL http://proceedings.mlr.press/v97/metz19a.html.
|
| 205 |
+
|
| 206 |
+
[17] Yuhuai Wu, Mengye Ren, Renjie Liao, and Roger B. Grosse. Understanding short-horizon bias in stochastic meta-optimization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=H1MczcgR-.
|
| 207 |
+
|
| 208 |
+
[18] Saehyung Lee, Sanghyuk Chun, Sangwon Jung, Sangdoo Yun, and Sungroh Yoon. Dataset condensation with contrastive signals. CoRR, abs/2202.02916, 2022. URL https://arxiv. org/abs/2202.02916.
|
| 209 |
+
|
| 210 |
+
[19] Kai Wang, Bo Zhao, Xiangyu Peng, Zheng Zhu, Shuo Yang, Shuo Wang, Guan Huang, Hakan Bilen, Xinchao Wang, and Yang You. CAFE: learning to condense dataset by aligning features. CoRR, abs/2203.01531, 2022. doi: 10.48550/arXiv.2203.01531. URL https: //doi.org/10.48550/arXiv.2203.01531.
|
| 211 |
+
|
| 212 |
+
[20] George Cazenavette, Tongzhou Wang, Antonio Torralba, Alexei A. Efros, and Jun-Yan Zhu. Dataset distillation by matching training trajectories. CoRR, abs/2203.11932, 2022. doi: 10.48550/arXiv.2203.11932. URL https://doi.org/10.48550/arXiv.2203.11932.
|
| 213 |
+
|
| 214 |
+
[21] Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 8570–8581, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 0d1a9651497a38d8b1c3871c84528bd4-Abstract.html.
|
| 215 |
+
|
| 216 |
+
[22] Timothy Nguyen, Zhourong Chen, and Jaehoon Lee. Dataset meta-learning from kernel ridgeregression. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/ forum?id $= 1$ -PrrQrK0QR.
|
| 217 |
+
|
| 218 |
+
[23] Timothy Nguyen, Roman Novak, Lechao Xiao, and Jaehoon Lee. Dataset distillation with infinitely wide convolutional networks. In Marc’Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan, editors, Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 5186–5198, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/ 299a23a2291e2126b91d54f3601ec162-Abstract.html.
|
| 219 |
+
|
| 220 |
+
[24] Jonathan Lorraine, Paul Vicol, and David Duvenaud. Optimizing millions of hyperparameters by implicit differentiation. In Silvia Chiappa and Roberto Calandra, editors, The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy], volume 108 of Proceedings of Machine Learning Research, pages 1540– 1552. PMLR, 2020. URL http://proceedings.mlr.press/v108/lorraine20a.html.
|
| 221 |
+
|
| 222 |
+
[25] Radford M. Neal. Bayesian learning for neural networks. 1995.
|
| 223 |
+
|
| 224 |
+
[26] 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.
|
| 225 |
+
|
| 226 |
+
[27] Aravind Rajeswaran, Chelsea Finn, Sham M. Kakade, and Sergey Levine. Meta-learning with implicit gradients. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 113–124, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ 072b030ba126b2f4b2374f342be9ed44-Abstract.html.
|
| 227 |
+
|
| 228 |
+
[28] P.J. Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990. doi: 10.1109/5.58337.
|
| 229 |
+
|
| 230 |
+
[29] Ilya Sutskever. Training recurrent neural networks. University of Toronto Toronto, ON, Canada, 2013.
|
| 231 |
+
|
| 232 |
+
[30] Corentin Tallec and Yann Ollivier. Unbiasing truncated backpropagation through time. CoRR, abs/1705.08209, 2017. URL http://arxiv.org/abs/1705.08209.
|
| 233 |
+
|
| 234 |
+
[31] Jimmy Ba, Murat A Erdogdu, Taiji Suzuki, Zhichao Wang, Denny Wu, and Greg Yang. Highdimensional asymptotics of feature learning: How one gradient step improves the representation. arXiv preprint arXiv:2205.01445, 2022.
|
| 235 |
+
|
| 236 |
+
[32] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proc. IEEE, 86(11):2278–2324, 1998. doi: 10.1109/5.726791. URL https://doi.org/10.1109/5.726791.
|
| 237 |
+
|
| 238 |
+
[33] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017. URL http:// arxiv.org/abs/1708.07747.
|
| 239 |
+
|
| 240 |
+
[34] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 241 |
+
|
| 242 |
+
[35] Ya Le and Xuan S. Yang. Tiny imagenet visual recognition challenge. 2015.
|
| 243 |
+
|
| 244 |
+
[36] Jeremy Howard. A smaller subset of 10 easily classified classes from imagenet, and a little more french. URL https://github.com/fastai/imagenette/.
|
| 245 |
+
|
| 246 |
+
[37] Technical report.
|
| 247 |
+
|
| 248 |
+
[38] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In Peter L. Bartlett, Fernando C. N. Pereira, Christopher J. C. Burges, Léon Bottou, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 25: 26th Annual Conference on Neural Information Processing Systems 2012. Proceedings of a meeting held December 3-6, 2012, Lake Tahoe, Nevada, United States, pages 1106–1114, 2012. URL https://proceedings.neurips.cc/paper/2012/hash/ c399862d3b9d6b76c8436e924a68c45b-Abstract.html.
|
| 249 |
+
|
| 250 |
+
[39] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1409.1556.
|
| 251 |
+
|
| 252 |
+
[40] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770–778. IEEE Computer Society, 2016. doi: 10.1109/CVPR.2016.90. URL https://doi.org/10.1109/CVPR.2016.90.
|
| 253 |
+
|
| 254 |
+
[41] Dmitry Ulyanov, Andrea Vedaldi, and Victor S. Lempitsky. Instance normalization: The missing ingredient for fast stylization. CoRR, abs/1607.08022, 2016. URL http://arxiv.org/abs/ 1607.08022.
|
| 255 |
+
|
| 256 |
+
[42] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis R. Bach and David M. Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pages 448–456. JMLR.org, 2015. URL http://proceedings.mlr.press/v37/ioffe15.html.
|
| 257 |
+
|
| 258 |
+
[43] James Kirkpatrick, Razvan Pascanu, Neil C. Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka GrabskaBarwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. CoRR, abs/1612.00796, 2016. URL http://arxiv.org/abs/1612.00796.
|
| 259 |
+
|
| 260 |
+
[44] Robert French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3:128–135, 05 1999. doi: 10.1016/S1364-6613(99)01294-2.
|
| 261 |
+
|
| 262 |
+
[45] Anthony V. Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connect. Sci., 7 (2):123–146, 1995. doi: 10.1080/09540099550039318. URL https://doi.org/10.1080/ 09540099550039318.
|
| 263 |
+
|
| 264 |
+
[46] Pietro Buzzega, Matteo Boschini, Angelo Porrello, and Simone Calderara. Rethinking experience replay: a bag of tricks for continual learning. In 25th International Conference on Pattern Recognition, ICPR 2020, Virtual Event / Milan, Italy, January 10-15, 2021, pages 2180–2187. IEEE, 2020. doi: 10.1109/ICPR48806.2021.9412614. URL https: //doi.org/10.1109/ICPR48806.2021.9412614.
|
| 265 |
+
|
| 266 |
+
[47] Yaoyao Liu, Bernt Schiele, and Qianru Sun. Adaptive aggregation networks for classincremental learning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, pages 2544–2553. Computer Vision Foundation / IEEE, 2021. URL https://openaccess.thecvf.com/content/CVPR2021/html/Liu_ Adaptive_Aggregation_Networks_for_Class-Incremental_Learning_CVPR_2021_ paper.html.
|
| 267 |
+
|
| 268 |
+
[48] Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, and Christoph H. Lampert. icarl: Incremental classifier and representation learning. CoRR, abs/1611.07725, 2016. URL http://arxiv. org/abs/1611.07725.
|
| 269 |
+
|
| 270 |
+
[49] Ameya Prabhu, Philip H. S. Torr, and Puneet K. Dokania. Gdumb: A simple approach that questions our progress in continual learning. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part II, volume 12347 of Lecture Notes in Computer Science, pages 524–540. Springer, 2020. doi: 10.1007/978-3-030-58536-5\_31. URL https://doi.org/10.1007/978-3-030-58536-5_31.
|
| 271 |
+
|
| 272 |
+
[50] Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 11816–11825, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/ e562cd9c0768d5464b64cf61da7fc6bb-Abstract.html.
|
| 273 |
+
|
| 274 |
+
[51] Rahaf Aljundi, Eugene Belilovsky, Tinne Tuytelaars, Laurent Charlin, Massimo Caccia, Min Lin, and Lucas Page-Caccia. Online continual learning with maximal interfered retrieval. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 11849–11860, 2019. URL https://proceedings.neurips.cc/paper/ 2019/hash/15825aee15eb335cc13f9b559f166ee8-Abstract.html.
|
| 275 |
+
|
| 276 |
+
[52] Yaoyao Liu, Yuting Su, An-An Liu, Bernt Schiele, and Qianru Sun. Mnemonics training: Multiclass incremental learning without forgetting. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 12242– 12251. Computer Vision Foundation / IEEE, 2020. doi: 10.1109/CVPR42600.2020.01226. URL https://openaccess.thecvf.com/content_CVPR_2020/html/Liu_Mnemonics_ Training_Multi-Class_Incremental_Learning_Without_Forgetting_CVPR_2020_ paper.html.
|
| 277 |
+
|
| 278 |
+
[53] Gido M. van de Ven and Andreas S. Tolias. Three scenarios for continual learning. CoRR, abs/1904.07734, 2019. URL http://arxiv.org/abs/1904.07734.
|
| 279 |
+
|
| 280 |
+
[54] Francisco M. Castro, Manuel J. Marín-Jiménez, Nicolás Guil, Cordelia Schmid, and Karteek Alahari. End-to-end incremental learning. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part XII, volume 11216 of Lecture Notes in Computer Science, pages 241–257. Springer, 2018. doi: 10.1007/978-3-030-01258-8\_15. URL https://doi.org/10.1007/978-3-030-01258-8_15.
|
| 281 |
+
|
| 282 |
+
[55] Yutian Chen, Max Welling, and Alexander J. Smola. Super-samples from kernel herding. In Peter Grünwald and Peter Spirtes, editors, UAI 2010, Proceedings of the Twenty-Sixth Conference on Uncertainty in Artificial Intelligence, Catalina Island, CA, USA, July 8-11, 2010, pages 109–116. AUAI Press, 2010. URL https://dslpitt.org/uai/displayArticleDetails. jsp?mmnu $\equiv$ 1&smnu $\underset { . } { = }$ 2&article_id $\equiv$ 2148&proceeding_id=26.
|
| 283 |
+
|
| 284 |
+
[56] Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy, SP 2017, San Jose, CA, USA, May 22-26, 2017, pages 3–18. IEEE Computer Society, 2017. doi: 10.1109/SP.2017.41. URL https://doi.org/10.1109/SP.2017.41.
|
| 285 |
+
|
| 286 |
+
[57] Yunhui Long, Vincent Bindschaedler, Lei Wang, Diyue Bu, Xiaofeng Wang, Haixu Tang, Carl A. Gunter, and Kai Chen. Understanding membership inferences on well-generalized learning models. CoRR, abs/1802.04889, 2018. URL http://arxiv.org/abs/1802.04889.
|
| 287 |
+
|
| 288 |
+
[58] Ahmed Salem, Yang Zhang, Mathias Humbert, Pascal Berrang, Mario Fritz, and Michael Backes. Ml-leaks: Model and data independent membership inference attacks and defenses on machine learning models. In 26th Annual Network and Distributed System Security Symposium, NDSS 2019, San Diego, California, USA, February 24-27, 2019. The Internet Society, 2019.
|
| 289 |
+
|
| 290 |
+
[59] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id $=$ Sy8gdB9xx.
|
| 291 |
+
|
| 292 |
+
[60] Milad Nasr, Reza Shokri, and Amir Houmansadr. Machine learning with membership privacy using adversarial regularization. In David Lie, Mohammad Mannan, Michael Backes, and XiaoFeng Wang, editors, Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, CCS 2018, Toronto, ON, Canada, October 15-19, 2018, pages 634–646. ACM, 2018. doi: 10.1145/3243734.3243855. URL https://doi.org/10.1145/ 3243734.3243855.
|
| 293 |
+
|
| 294 |
+
[61] Jinyuan Jia, Ahmed Salem, Michael Backes, Yang Zhang, and Neil Zhenqiang Gong. Memguard: Defending against black-box membership inference attacks via adversarial examples. In Lorenzo Cavallaro, Johannes Kinder, XiaoFeng Wang, and Jonathan Katz, editors, Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, CCS 2019, London, UK, November 11-15, 2019, pages 259–274. ACM, 2019. doi: 10.1145/3319535.3363201. URL https://doi.org/10.1145/3319535.3363201.
|
| 295 |
+
|
| 296 |
+
[62] tensorflow/privacy: library for training machine learning models with privacy for training data, 2022. URL https://github.com/tensorflow/privacy.
|
| 297 |
+
|
| 298 |
+
[63] Samuel Yeom, Irene Giacomelli, Matt Fredrikson, and Somesh Jha. Privacy risk in machine learning: Analyzing the connection to overfitting. In 31st IEEE Computer Security Foundations Symposium, CSF 2018, Oxford, United Kingdom, July 9-12, 2018, pages 268–282. IEEE Computer Society, 2018. doi: 10.1109/CSF.2018.00027. URL https://doi.org/10.1109/ CSF.2018.00027.
|
md/dev/4WgqjmYacAf/4WgqjmYacAf.md
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Seeing Differently, Acting Similarly: Heterogeneously Observable Imitation Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 In many real-world imitation learning tasks, the demonstrator and the learner have
|
| 11 |
+
2 to act under totally different observation spaces. This situation brings significant
|
| 12 |
+
3 obstacles to existing imitation learning approaches, since most of them learn poli
|
| 13 |
+
4 cies under homogeneous observation spaces. On the other hand, previous studies
|
| 14 |
+
5 under different observation spaces have strong assumptions that these two obser
|
| 15 |
+
6 vation spaces coexist during the entire learning process. However, in reality, the
|
| 16 |
+
7 observation coexistence will be limited due to the high cost of acquiring expert
|
| 17 |
+
8 observations. In this work, we study this challenging problem with limited observa
|
| 18 |
+
9 tion coexistence under heterogeneous observations: Heterogeneously Observable
|
| 19 |
+
10 Imitation Learning (HOIL). We identify two underlying issues in HOIL, i.e., the
|
| 20 |
+
11 dynamics mismatch and the support mismatch, and further propose the Impor
|
| 21 |
+
12 tance Weighting with REjection (IWRE) algorithm based on importance-weighting
|
| 22 |
+
13 and learning with rejection to solve HOIL problems. Experimental results show
|
| 23 |
+
14 that IWRE can successfully solve various HOIL tasks, including the challenging
|
| 24 |
+
15 tasks of transforming the vision-based demonstrations to random access memory
|
| 25 |
+
16 (RAM)-based policies in the Atari domain, even with limited visual observations.
|
| 26 |
+
|
| 27 |
+
# 17 1 Introduction
|
| 28 |
+
|
| 29 |
+
18 Imitation Learning (IL) studies how to learn a good policy by imitating the given expert demonstra
|
| 30 |
+
19 tions [16, 1], and has achieved great success in many domains such as autonomous driving [8], video
|
| 31 |
+
20 games [7], and continuous control [19]. In real-world IL applications, the expert and the learner
|
| 32 |
+
21 usually have their own observations of the same underlying states from the environment. For example,
|
| 33 |
+
22 in Figure 1, an autonomous agent is learning to drive by imitating a human expert. The expert takes
|
| 34 |
+
23 her actions mainly based on auditory and visual observations, which are familiar to human beings.
|
| 35 |
+
24 However, the learning agent does not necessarily use the same way to observe: it can utilize more
|
| 36 |
+
25 machine-capable sensors such as a LiDAR, radar, and bird-eye view (BEV) map to generate its
|
| 37 |
+
26 observations [20]. The key features behind this example are two-fold: First, both the expert and
|
| 38 |
+
27 the learner have their totally different observations of the same state of the environment. Thus they
|
| 39 |
+
28 essentially have to choose the same action if acting optimally. Second, the observation space of the
|
| 40 |
+
29 expert is often of high cost for the learner to utilize [6, 10]. We call this problem Heterogeneously
|
| 41 |
+
30 Observable Imitation Learning (HOIL).
|
| 42 |
+
31 There are two lines of research studying the related problems. The first line relates to domain
|
| 43 |
+
32 adaptation: the observation space of the expert and the learner are the homogeneous, while some
|
| 44 |
+
33 typical mismatches of distributions could exist: morphological mismatch, viewpoint mismatch, and
|
| 45 |
+
34 dynamics mismatch [30, 17, 26]. However, these approaches are invalid when the observation spaces
|
| 46 |
+
35 for experts and learners are completely different as in HOIL.
|
| 47 |
+
36 The second line studied IL under different observations similar to HOIL, and some representative
|
| 48 |
+
37 works include Partially Observable Imitation Learning (POIL) [14, 36] and Learning by Cheating
|
| 49 |
+
38 (LBC) [8], as depicted in Figure 2. Both POIL and LBC assume that the expert’s observations can
|
| 50 |
+
39 be easily accessed by the learner without any budget limit. However in practice, different from the
|
| 51 |
+
40 learner observations, the access to expert’s observations might be of high cost and invasive [6, 10],
|
| 52 |
+
41 hindering the wide application of these methods.
|
| 53 |
+
42 In this paper, we initialize the study of the HOIL problem. We propose a learning process across
|
| 54 |
+
43 observation spaces of experts and learners for solving this problem, and analyze the underlying issues
|
| 55 |
+
44 of HOIL, i.e., the dynamics mismatch and the support mismatch. To tackle both two issues, we resort
|
| 56 |
+
45 to the techniques of importance-weighting [12] and learning with rejection [9, 15] for active querying
|
| 57 |
+
46 to propose the Importance Weighting with REjection (IWRE) approach. We evaluate the effectiveness
|
| 58 |
+
47 of the IWRE algorithm in continuous control tasks of MuJoCo [33], and the challenging tasks of
|
| 59 |
+
48 learning random access memory (RAM)-based policies given vision-based expert demonstrations
|
| 60 |
+
49 in Atari [3] games. The results demonstrate that IWRE can significantly outperform existing IL
|
| 61 |
+
50 algorithms in HOIL tasks, with limited access to expert observations.
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 1: Autonomous driving: an example of the HOIL problem. Figures 1, 2 and 3 include some illustrations and pictures from the Internet (source: www.vecteezy.com).
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 2: Comparisons of different IL processes under different observation spaces. The targets are all to learn $\pi _ { 2 }$ based on the second observation space with an auxiliary policy $\pi _ { 1 }$ from corresponding roll-out data $\widetilde { \tau }$ and $\overline { { \mathcal { T } } }$ . (a) POIL mainly emphasized that the expert can view full observations, while the observations for the learner are partial. (b) LBC assumed that the expert’s observations contain more privileged information than the learner’s. Both POIL and LBC can observe expert’s observations all along. (c) HOIL limits the amount of expert’s observations.
|
| 68 |
+
|
| 69 |
+
# 51 2 Related Work
|
| 70 |
+
|
| 71 |
+
52 Domain-Shifted IL. For the standard IL process, where the learner and the expert share the same
|
| 72 |
+
53 observation space, current state-of-the-art methods tend to learn the policy in an adversarial style [7],
|
| 73 |
+
54 like GAIL [16]. When considering the domain mismatch problem, i.e., Domain-Shifted IL (DSIL),
|
| 74 |
+
55 the research aims at addressing the static distributional shift of the optimal policies resulted from
|
| 75 |
+
56 the environmental differences but still under homogeneous observation spaces. Stadie et al. [30],
|
| 76 |
+
57 Sermanet et al. [29], and Liu et al. [23] studied the situation where the demonstrations are in view
|
| 77 |
+
58 of a third person. Kim et al. [19] and Kim et al. [18] addressed the IL problem with morphological
|
| 78 |
+
59 mismatch between the expert’s and learner’s environment. Stadie et al. [30], Tirinzoni et al. [32], and
|
| 79 |
+
60 Desai et al. [11] focused on the calibration for the mismatch between simulators and the real world
|
| 80 |
+
61 through some transfer learning styles. There are two major differences between HOIL and DSIL:
|
| 81 |
+
62 One is that HOIL considers heterogeneous observation spaces instead of homogeneous ones; another
|
| 82 |
+
63 is that without observation heterogeneity, DSIL can directly align two fixed domains, which may
|
| 83 |
+
64 not be realistic for solving HOIL when two observation spaces are totally different. Thus HOIL is a
|
| 84 |
+
65 significantly more challenging problem than DSIL. Besides, Chen et al. [8] learned a vision-based
|
| 85 |
+
66 agent from a privileged expert. But it can obtain expert’s observations throughout the whole learning
|
| 86 |
+
67 process, so it cannot handle the problem of the support mismatch under HOIL.
|
| 87 |
+
68 POMDP. The problem of POMDPs, in which only partial observations are available for the agent(s),
|
| 88 |
+
69 has been studied in the context of multi-agent [25, 36] and imitation learning [14, 36] problems.
|
| 89 |
+
70 But distinct from HOIL, in a POMDP, the learner only have partial observations and share a same
|
| 90 |
+
71 underlying observation space with the expert, which would become an obstacle for them to make
|
| 91 |
+
72 decisions correctly. For example, Warrington et al. [36] assumed that the observation of the learner
|
| 92 |
+
73 is partial than that of the expert. Instead, in HOIL, expert’s and learner’s observations are totally
|
| 93 |
+
74 different from each other, while the learner’s observations are not belong to a part of the expert’s. For
|
| 94 |
+
75 HOIL, the main challenge is to deal with the mismatches between the observation spaces, especially
|
| 95 |
+
76 when the access to expert’s observations is strictly limited.
|
| 96 |
+
|
| 97 |
+
# 3 The HOIL Problem
|
| 98 |
+
|
| 99 |
+
In this section, we first give a formal definition of the HOIL setting, and then introduce the learning process for solving the HOIL problem.
|
| 100 |
+
|
| 101 |
+
# 3.1 Setting Definition
|
| 102 |
+
|
| 103 |
+
A HOIL problem is defined within a Markov decision process with mutiple observation spaces, i.e., $\langle \mathcal { S } , \{ \mathcal { O } \} , \mathcal { A } , \mathcal { P } , \gamma \rangle$ , where $s$ denotes the state space, $\{ \mathcal { O } \}$ denotes a set of observation spaces, $\mathcal { A }$ denotes the action space, $\mathcal { P } : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \mathbb { R }$ denotes the transition probability distribution of the state and action, and $\gamma \in ( 0 , 1 ]$ denotes the discount factor. Furthermore, a policy $\pi$ over an observation space $\mathcal { O }$ is defined as a function mapping from $\mathcal { O }$ to $\mathcal { A }$ , and we denote by $\Pi _ { \mathcal { O } }$ the set of all policies over $\mathcal { O }$ . In HOIL, both the expert and the learner have their own observation spaces, which are denoted as $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ respectively. Both $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ are assumed to be produced by two bijective mappings $f _ { \mathrm { E } } : S \mathcal { O } _ { \mathrm { E } }$ , $f _ { \mathrm { L } } : S \mathcal { O } _ { \mathrm { L } }$ , which are unknown functions mapping the underlying true states to the observations. It is obvious to see that by this assumption, any policy over $\mathcal { O } _ { \mathrm { E } }$ has a unique correspondence over $\mathcal { O } _ { \mathrm { L } }$ . This makes HOIL possible since the target of HOIL is to find the corresponding policy of the expert policy under $\mathcal { O } _ { \mathrm { L } }$ .
|
| 104 |
+
|
| 105 |
+
92 A state-action pair $( s , a )$ , denoted by $x$ , is called an instance. Also, a trajectory $\mathcal { T } = \{ x _ { i } \} , i \in [ m ]$
|
| 106 |
+
93 is a set of $m$ instances. For each observation space, $\boldsymbol { \widetilde { x } } \in \mathcal { \widetilde { T } } \subseteq \mathcal { O } _ { \mathrm { E } } \times \mathcal { A }$ and $\overline { { x } } \in \overline { { \mathcal { T } } } \subseteq \mathcal { O } _ { \mathrm { L } } \times \mathcal { A }$ ,
|
| 107 |
+
94 where $\mathcal { O } _ { \mathrm { E } } = f _ { \mathrm { E } } ( \boldsymbol { S } )$ and $\mathcal { O } _ { \mathrm { L } } = f _ { \mathrm { L } } ( \mathcal { S } )$ e. Furthermore, we define the occupancy measure of a policy $\pi$
|
| 108 |
+
95 under the state space $s$ as $\rho _ { \pi } : \mathcal { S } \times \mathcal { A } \mathbb { R }$ such that $\begin{array} { r } { \rho _ { \pi } ( x ) = \pi ( a | o ) \mathrm { P r } ( o | s ) \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathrm { P r } ( s _ { t } = s | \pi ) } \end{array}$ .
|
| 109 |
+
96 Under HOIL, the learner accesses the expert demonstrations $\widetilde { \mathcal { T } } _ { \pi _ { \mathrm { E } } }$ , a set of instances sampled from $\rho _ { \pi _ { \mathrm { E } } }$ .
|
| 110 |
+
97 The goal of HOIL is to learn a policy $\hat { \pi }$ as the corresponding policy of $\pi _ { \mathrm { E } }$ over $\mathcal { O } _ { \mathrm { L } }$ . If $\mathcal { O } _ { \mathrm { E } } = \mathcal { O } _ { \mathrm { L } }$ ,
|
| 111 |
+
98 HOIL degenerates to standard $\mathrm { I L }$ . GAIL [16] is one of the state-of-the-art $\mathrm { I L }$ approaches under this
|
| 112 |
+
99 situation, which tries to minimize the divergence between the learner’s and the expert’s occupancy
|
| 113 |
+
100 measures $d ( \rho _ { \hat { \pi } } , \rho _ { \pi _ { \mathrm { E } } } )$ . The objective of GAIL is
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\operatorname* { m i n } _ { \hat { \pi } } \operatorname* { m a x } _ { w } \mathbb { E } _ { { x } \sim { \rho } _ { \pi _ { \mathrm { E } } } } [ \log D _ { w } ( \widetilde { x } ) ] + \mathbb { E } _ { { x } \sim { \rho } _ { \hat { \pi } } } [ \log ( 1 - D _ { w } ( \widetilde { x } ) ) ] - \mathbb { H } ( \hat { \pi } ) ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
101 where $\mathbb { H } ( \hat { \pi } )$ is the causal entropy performed as a regularization term, and $D _ { w } : { \mathcal { O } } _ { \mathrm { E } } \times A \to [ 0 , 1 ]$ is
|
| 120 |
+
102 the discriminator of $\pi _ { \mathrm { E } }$ and $\hat { \pi }$ . GAIL solved Equation (1) by alternatively taking a gradient ascent
|
| 121 |
+
103 step to train the discriminator $D _ { w }$ , and a minimization step to learn policy $\hat { \pi }$ based on an off-the-shelf
|
| 122 |
+
104 RL algorithm with the pseudo reward $- \log D _ { w } ( \widetilde { x } )$ .
|
| 123 |
+
|
| 124 |
+
# 3.2 The Learning Process for Solving HOIL
|
| 125 |
+
|
| 126 |
+
106 In HOIL, we need to cope with the absence of the learner’s observations in demonstrations and the
|
| 127 |
+
107 high cost of collecting the expert’s observations while learning. So we introduce a learning process
|
| 128 |
+
108 with pretraining across two different observation spaces for solving HOIL, as abstracted in Figure 3.
|
| 129 |
+
109 Pretraining. Same to LBC [8], we assume that we can obtain an auxiliary policy $\pi _ { 1 }$ based on $\mathcal { O } _ { \mathrm { E } }$ at
|
| 130 |
+
110 the beginning. $\pi _ { 1 }$ can be directly provided by any sources, or trained by GAIL or behavior cloning
|
| 131 |
+
111 as did in LBC. Besides, we use this $\pi _ { 1 }$ to sample some data $\mathcal { T } _ { \pi _ { 1 } }$ , which contain both observation
|
| 132 |
+
112 under $\mathcal { O } _ { \mathrm { E } }$ (i.e., $\widetilde { \mathcal { T } } _ { \pi _ { 1 } } .$ ) and $\mathcal { O } _ { \mathrm { L } }$ (i.e., $\overline { { \mathcal { T } } } _ { \pi _ { 1 } }$ ), in order to connect these two different observation spaces.
|
| 133 |
+
113 We name ${ \mathcal { T } } _ { \pi _ { 1 } } = \{ { \widetilde { \mathcal { T } } _ { \pi _ { 1 } } , \overline { { { \mathcal { T } } } } _ { \pi _ { 1 } } } \}$ the initial data.
|
| 134 |
+
114 Training. Here we learn a policy $\pi _ { 2 }$ from the initial data $\overline { { \mathcal { T } } } _ { \pi _ { 1 } }$ and the collected data $\overline { { \mathcal { T } } } _ { \pi _ { 2 } }$ , under
|
| 135 |
+
115 $\mathcal { O } _ { \mathrm { L } }$ only. Besides, the learner is allowed for some operation of observation coexistence (OC): At
|
| 136 |
+
116 some steps of learning, besides the observations $\mathcal { O } _ { \mathrm { L } }$ , the learner could also request $\widetilde { \tau } _ { \pi _ { 2 } }$ from the
|
| 137 |
+
117 corresponding observations $\mathcal { O } _ { \mathrm { E } }$ (e.g., from the human-understandable sensors). The final objective of
|
| 138 |
+
118 HOIL is to learn a good policy $\pi _ { 2 }$ under $\mathcal { O } _ { \mathrm { L } }$ .
|
| 139 |
+
119 In practical applications, the auxiliary policy $\pi _ { 1 }$ can also come from simulation training or direct
|
| 140 |
+
120 imitation. But since $\pi _ { 1 }$ is additionally provided, it is more practical to consider $\pi _ { 1 }$ as a non-optimal
|
| 141 |
+
121 policy. During training, OC is an essential operation for solving HOIL, which helps the learner
|
| 142 |
+
122 address the issues of the dynamics mismatch and the support mismatch (especially the latter one).
|
| 143 |
+
123 Also, in reality, we do not need an oracle for actions, which still needs OC for obtaining expert
|
| 144 |
+
124 observations first, as in many active querying research [4, 8], so its cost will be relatively lower.
|
| 145 |
+
125 Besides, the related work [8] also required an initialized policy $\pi _ { 1 }$ to solve their problem, which act
|
| 146 |
+
126 as a teacher under privileged $\mathcal { O } _ { \mathrm { E } }$ in the pretraining and then learned a vision-based student from the
|
| 147 |
+
127 guidance of the teacher under both $\mathcal { O } _ { \mathrm { L } }$ and $\mathcal { O } _ { \mathrm { E } }$ . Their setting can be viewed as a variety of HOIL
|
| 148 |
+
128 with optimal $\pi _ { 1 }$ , unlimited $\mathcal { O } _ { \mathrm { E } }$ , and unlimited OC operations, so HOIL is actually a more practical
|
| 149 |
+
129 learning framework.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: Illustration of a learning process across two different observation spaces for solving HOIL. $\pi _ { 1 }$ is an auxiliary policy that additionally provided.
|
| 153 |
+
|
| 154 |
+
# 4 Imitation Learning with Importance-Weighting and Rejection
|
| 155 |
+
|
| 156 |
+
In HOIL, the access frequency to $\mathcal { O } _ { \mathrm { E } }$ is strictly limited, so it is unrealistic to learn $\pi _ { 2 }$ in a Dataset Aggregation (DAgger) style [27] as in LBC. Therefore, we resort to learning $\pi _ { 2 }$ with a learned reward function by inverse reinforcement learning [1] in an adversarial learning style [16, 13].
|
| 157 |
+
|
| 158 |
+
134 In addition, both $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ are assumed to share the same latent state space $s$ as introduced in
|
| 159 |
+
135 Section 3.1, so the following analysis will be based on $s$ , while the algorithm will handle the problem
|
| 160 |
+
136 based on $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ specifically.
|
| 161 |
+
|
| 162 |
+
# 4.1 Dynamics Mismatch and Importance-Weighting
|
| 163 |
+
|
| 164 |
+
138 To analyze the learning process, we let $\rho _ { \pi _ { \mathrm { E } } } , \rho _ { \pi _ { 1 } }$ , and $\rho _ { \pi _ { 2 } }$ be the occupancy measure distributions
|
| 165 |
+
139 of the expert demonstrations, the initial data, and the data during training respectively. Since we
|
| 166 |
+
140 need to consider the sub-optimality of $\pi _ { 1 } , \rho _ { \pi _ { 1 } }$ should be a mixture distribution of the expert $\rho _ { \pi _ { \mathrm { E } } }$ and
|
| 167 |
+
141 non-expert $\rho _ { \pi _ { \mathrm { N E } } }$ , i.e., there exists some $\delta \in ( 0 , 1 )$ such that
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\rho _ { \pi _ { 1 } } = \delta \rho _ { \pi _ { \mathrm { E } } } + ( 1 - \delta ) \rho _ { \pi _ { \mathrm { N E } } } ,
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
142 as depicted in Figure 4a. During training, the original objective of $\pi _ { 2 }$ is to imitate $\pi _ { \mathrm { E } }$ through demonstrations. To this end, the original objective of reward function 143 $D _ { w _ { 2 } }$ for $\pi _ { 2 }$ is to optimize
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\operatorname* { m a x } _ { w _ { 2 } } \mathbb { E } _ { { x } \sim \rho _ { \pi _ { 2 } } } [ \log D _ { w _ { 2 } } ( \overline { { x } } ) ] + \mathbb { E } _ { { x } \sim \rho _ { \pi _ { \mathrm { E } } } } [ \log ( 1 - D _ { w _ { 2 } } ( \overline { { x } } ) ) ] .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
144 But the expert demonstrations are only available under $\mathcal { O } _ { \mathrm { E } }$ . While during training, we can only utilize
|
| 180 |
+
145 the initial data $\overline { { \mathcal { T } } } _ { \pi _ { 1 } } \sim \rho _ { \pi _ { 1 } }$ to learn $\pi _ { 2 }$ and $D _ { w _ { 2 } }$ . Besides, as $\pi _ { 1 }$ is sub-optimal, directly imitating ${ \overline { { \mathcal T } } } _ { \pi _ { 1 } }$
|
| 181 |
+
146 could reduce the performance of the optimal $\pi _ { 2 }$ to that of $\pi _ { 1 }$ . So we use the importance-weighting to
|
| 182 |
+
147 calibrate this dynamics mismatch, i.e.,
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
\operatorname* { m a x } _ { w _ { 2 } } \mathcal { L } ( D _ { w _ { 2 } } ) = \mathbb { E } _ { x \sim \rho _ { \pi _ { 2 } } } [ \log D _ { w _ { 2 } } ( \overline { { x } } ) ] + \mathbb { E } _ { x \sim \rho _ { \pi _ { 1 } } } [ \alpha ( x ) \log ( 1 - D _ { w _ { 2 } } ( \overline { { x } } ) ) ] ,
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: The comparisons among the distributions of expert demonstrations $\rho _ { \pi _ { \mathrm { E } } }$ , initial data $\rho _ { \pi _ { 1 } }$ , and non-expert data $\rho _ { \pi _ { \mathrm { N E } } }$ . The red and blue regions denote the expert and non-expert parts of $\rho _ { \pi _ { 1 } }$ respectively. $H , O$ , and $N$ denote the latent demonstration, the observed demonstration, and the non-expert data respectively. (a) The ideal situation, where $\operatorname { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } ) \backslash \operatorname { s u p p } ( \rho _ { \pi _ { 1 } } ) = \emptyset$ ; (b) The real situation, where $\bar { H } : = \mathrm { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } ) \setminus \mathrm { s u p p } ( \rho _ { \pi _ { 1 } } ) \ne \emptyset$ in $\rho _ { \pi _ { \mathrm { E } } }$ . (c) The target output of the combined model $\mathbb { I } [ D _ { w } ^ { * } ] g ^ { * }$ . The output $+ 1$ , 0, and $- 1$ regions correspond to $H ,$ , and $N$ respectively.
|
| 190 |
+
|
| 191 |
+
148 where α(x) ≜ ρπE (x) is an importance-weighting factor [12]. So the current issue lies in how to
|
| 192 |
+
149 estimate $\frac { \rho _ { \pi _ { \mathrm { E } } } } { \rho _ { \pi _ { 1 } } }$ under $\mathcal { O } _ { \mathrm { E } }$ . To achieve this purpose, we need to bridge the expert demonstrations and
|
| 193 |
+
150 the initial data. Therefore, here we use these two data sets to train an adversarial model $D _ { w _ { 1 } }$ in the
|
| 194 |
+
151 same way as $D _ { w _ { 2 } }$ in the pretraining:
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
\operatorname* { m a x } _ { w _ { 1 } } \mathcal { L } ( D _ { w _ { 1 } } ) \triangleq \mathbb { E } _ { x \sim \rho _ { \pi _ { 1 } } } [ \log D _ { w _ { 1 } } ( \widetilde { x } ) ] + \mathbb { E } _ { x \sim \rho _ { \pi _ { \mathrm { E } } } } [ \log ( 1 - D _ { w _ { 1 } } ( \widetilde { x } ) ) ] .
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
152 If we write the training criterion (5) in the form of integral, i.e.,
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\operatorname* { m a x } _ { w _ { 1 } } \mathcal { L } ( D _ { w _ { 1 } } ) = \int _ { x } [ \rho _ { \pi _ { 1 } } \log D _ { w _ { 1 } } + \rho _ { \pi _ { \mathrm { E } } } \log ( 1 - D _ { w _ { 1 } } ) ] d x ,
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
$\begin{array} { r } { ( \frac { \partial \mathcal { L } } { \partial D _ { w _ { 1 } } } = 0 ) } \end{array}$ $D _ { w _ { 1 } }$
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
D _ { w _ { 1 } } ^ { * } = \frac { \rho _ { \pi _ { 1 } } } { \rho _ { \pi _ { 1 } } + \rho _ { \pi _ { \mathrm { E } } } } ,
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
154 in which the order of differentiation and integration was changed by the Leibniz rule. Besides, we
|
| 213 |
+
155 can sufficiently train $D _ { w _ { 1 } }$ using the initial data $\widetilde { \mathcal { T } } _ { \pi _ { 1 } }$ and the expert demonstrations $\widetilde { \mathcal { T } } _ { \pi _ { \mathrm { E } } }$ . Then $D _ { w _ { 1 } }$
|
| 214 |
+
156 will be good enough to estimate the importance-weighting factor, i.e.,
|
| 215 |
+
|
| 216 |
+
$$
|
| 217 |
+
\alpha ( x ) \triangleq \frac { \rho _ { \pi _ { \mathtt { E } } } } { \rho _ { \pi _ { 1 } } } = \frac { 1 - D _ { w _ { 1 } } ^ { * } ( \widetilde { x } ) } { D _ { w _ { 1 } } ^ { * } ( \widetilde { x } ) } \approx \frac { 1 - D _ { w _ { 1 } } ( \widetilde { x } ) } { D _ { w _ { 1 } } ( \widetilde { x } ) } .
|
| 218 |
+
$$
|
| 219 |
+
|
| 220 |
+
In this way, we can use 157 $D _ { w 1 }$ , which can connect demonstrations and initial data, to calibrate the learning process of 158 $D _ { w _ { 2 } }$ . The final optimization objective for $D _ { w _ { 2 } }$ is
|
| 221 |
+
|
| 222 |
+
$$
|
| 223 |
+
\operatorname* { m a x } _ { w _ { 2 } } \mathcal { L } ( D _ { w _ { 2 } } ) = \mathbb { E } _ { x \sim \rho _ { \pi _ { 2 } } } \log D _ { w _ { 2 } } ( \overline { { x } } ) + \mathbb { E } _ { x \sim \rho _ { \pi _ { 1 } } } \frac { 1 - D _ { w _ { 1 } } ( \overline { { x } } ) } { D _ { w _ { 1 } } ( \widetilde { x } ) } \log [ 1 - D _ { w _ { 2 } } ( \overline { { x } } ) ] .
|
| 224 |
+
$$
|
| 225 |
+
|
| 226 |
+
In this way, 159 $D _ { w _ { 2 } }$ can effectively dig out the expert part of $\rho _ { \pi _ { 1 } }$ and produce efficient rewards for $\pi _ { 2 }$
|
| 227 |
+
|
| 228 |
+
# 4.2 Support Mismatch
|
| 229 |
+
|
| 230 |
+
161 So far the challenges have still been similar to homogeneously observable imitation learning. However,
|
| 231 |
+
162 our preliminary experiments demonstrated that merely importance-weighting is not enough to fix
|
| 232 |
+
163 the problem that occurred by the absence of interactions under $\mathcal { O } _ { \mathrm { E } }$ . So there exist some other issues
|
| 233 |
+
164 between the expert demonstrations and the initial data. To find out the underlying issues, we plot
|
| 234 |
+
165 the t-Distributed Stochastic Neighbor Embedding (t-SNE) [34] visualizations of these two empirical
|
| 235 |
+
166 distributions under $\mathcal { O } _ { \mathrm { E } }$ on Hopper and Walker2d, as shown in Figure 5. Twenty trajectories were
|
| 236 |
+
167 collected for both the expert demonstrations and the initial data. We can observe that there exist some
|
| 237 |
+
168 high-density regions of demonstrations in which the initial data do not cover; that is, there exist some
|
| 238 |
+
169 regions of the demonstrations that $\pi _ { 1 }$ did not explore. Wang et al. [35] found a similar phenomenon in
|
| 239 |
+
170 the standard $\mathrm { I L }$ setting. On the other hand, the importance-weighting $\alpha$ cannot calibrate this situation
|
| 240 |
+
171 where $\frac { \rho _ { \pi _ { \mathrm { E } } } } { \rho _ { \pi _ { 1 } } } = \infty$
|
| 241 |
+
172 To formulate this problem, here we introduce the Support
|
| 242 |
+
173 Set of the occupancy measure:
|
| 243 |
+
174 Definition 1 (Support Set). The support set of a occu
|
| 244 |
+
175 pancy measure $\rho$ is the subset of the domain containing
|
| 245 |
+
176 the elements which are not mapped to zero:
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
\operatorname { s u p p } ( \rho ) : = \{ x \in { \mathcal { S } } \times { \mathcal { A } } | \rho ( x ) \neq 0 \} .
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
177 Due to the sub-optimality of $\pi _ { 1 }$ , $\operatorname { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } ) \backslash \operatorname { s u p p } ( \rho _ { \pi _ { 1 } } ) \neq$
|
| 252 |
+
178 $\mathcal { D }$ (see Figure 4b). We call this part the Latent Demonstra
|
| 253 |
+
179 tion, defined as:
|
| 254 |
+
180 Definition 2 (Latent Demonstration). The latent demon
|
| 255 |
+
181 stration $H$ is the set of those $x \in { \mathcal { S } } \times { \mathcal { A } }$ that belong to the
|
| 256 |
+
182 relative complement of supp $\left( \rho _ { \pi _ { 1 } } \right)$ in $\operatorname { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } )$ :
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 5: t-SNE visualizations of expert demonstrations and collected data of $\pi _ { 1 }$ under $\mathcal { O } _ { \mathrm { E } }$ .
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
H : = \{ x \in S \times A | \mathrm { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } ) \setminus \mathrm { s u p p } ( \rho _ { \pi _ { 1 } } ) \} .
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
Also, another part of the demonstration is named the Observed Demonstration, defined as:
|
| 266 |
+
|
| 267 |
+
184 Definition 3 (Observed Demonstration). The observed demonstration $O$ is the set of those $x \in { \mathcal { S } } \times { \mathcal { A } }$ that belong to the complement of 185 $H$ in $\operatorname { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } )$ :
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
O : = \{ x \in \mathcal { S } \times A \vert \mathrm { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } ) \cap \mathrm { s u p p } ( \rho _ { \pi _ { 1 } } ) \} .
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
186 Besides, the data outside of demonstrations should be non-expert data:
|
| 274 |
+
|
| 275 |
+
187 Definition 4 (Non-Expert Data). The non-expert data $N$ is the set of those $x \in { \mathcal { S } } \times { \mathcal { A } }$ that out of
|
| 276 |
+
188 $\operatorname { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } )$ :
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
N : = \{ x \in { \mathcal { S } } \times A | \rho _ { \pi _ { \mathrm { E } } } ( x ) = 0 \} .
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
189 In other words, the sub-optimality of $\pi _ { 1 }$ will cause not only the dynamics mismatch, but also the
|
| 283 |
+
190 appearance of the latent demonstration $H$ . We call the latter one the problem of Support Mismatch.
|
| 284 |
+
191 Intuitively, when $\pi _ { 2 } \pi _ { \mathrm { E } }$ , we have $H \emptyset$ , monotonously. So in order to fix the support mismatch
|
| 285 |
+
192 between $\rho _ { \pi _ { \mathrm { E } } }$ and $\rho _ { \pi _ { 1 } }$ , guiding $\pi _ { 2 }$ to find out $H$ is the key.
|
| 286 |
+
|
| 287 |
+
In addition, the support mismatch problem can be viewed as an inverse problem of the Out Of Distribution (OOD) problem that frequently occurred in offline RL setting [21], in which they tried to avoid $\operatorname { s u p p } ( \rho _ { \pi _ { 1 } } ) \setminus \operatorname { s u p p } ( \rho _ { \pi _ { \mathrm { E } } } )$ instead.
|
| 288 |
+
|
| 289 |
+
# 4.3 Imitation Learning with Rejection
|
| 290 |
+
|
| 291 |
+
We can observe that $H \cup O \cup N = S \times { \mathcal { A } }$ . So it is desirable to filter out $H$ from $O$ and $N$ . Meanwhile, $D _ { w _ { 1 } }$ and $D _ { w _ { 2 } }$ can only classify $O \cup H$ and $N$ , under $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ respectively. Therefore, here we design two models $g _ { 1 } : \mathcal { O } _ { \mathrm { E } } \times \mathcal { A } \{ 0 , 1 \}$ and $g _ { 2 } : { \mathcal { O } } _ { \mathrm { L } } \times { \mathcal { A } } \{ 0 , 1 \}$ (Output 0: $x \in O$ and output 1: otherwise), so that given $x \sim \tau$ (corresponding $\widetilde { x } \sim \widetilde { \tau }$ and $\overline { { x } } \sim \overline { { \mathcal { T } } }$ ) they can satisfy:
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
H = \{ x \in S \times \mathcal { A } | \mathbb { I } [ D _ { w _ { 1 } } ^ { * } ( \widetilde { x } ) ] g _ { 1 } ^ { * } ( \widetilde { x } ) = \mathbb { I } [ D _ { w _ { 2 } } ^ { * } ( \overline { { x } } ) ] g _ { 2 } ^ { * } ( \overline { { x } } ) = + 1 \} ,
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
201
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
O = \{ x \in \mathcal { S } \times \mathcal { A } | \mathbb { I } [ D _ { w _ { 1 } } ^ { * } ( \widetilde { x } ) ] g _ { 1 } ^ { * } ( \widetilde { x } ) = \mathbb { I } [ D _ { w _ { 2 } } ^ { * } ( \overline { { x } } ) ] g _ { 2 } ^ { * } ( \overline { { x } } ) = 0 \} ,
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
N = \{ x \in S \times \mathcal { A } | \mathbb { I } [ D _ { w _ { 1 } } ^ { * } ( \widetilde { x } ) ] g _ { 1 } ^ { * } ( \widetilde { x } ) = \mathbb { I } [ D _ { w _ { 2 } } ^ { * } ( \overline { { x } } ) ] g _ { 2 } ^ { * } ( \overline { { x } } ) = - 1 \} ,
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
respectively, where $\mathbb { I } [ \cdot ]$ takes $+ 1$ if $\cdot > 0 . 5$ , and $- 1$ otherwise. The target combined model $\mathbb { I } [ D _ { w } ^ { * } ( x ) ] g ^ { * } ( x )$ is depicted in Figure4c.
|
| 308 |
+
|
| 309 |
+
205 To this end, both $g _ { 1 }$ and $g _ { 2 }$ should be able to cover $O$ , meanwhile $g _ { 2 }$ can be adaptive to continuously change of 206 $\rho _ { \pi _ { 2 } }$ due to the update of $\pi _ { 2 }$ . Here we learn $g _ { 1 }$ and $g _ { 2 }$ in a rejection form, to reject $O$ from
|
| 310 |
+
|
| 311 |
+
207 $O \cup H$ (where $\mathbb { I } ( D _ { w } ) = + 1$ ). Concretely, the rejection setting is the same as that in Cortes et al. [9].
|
| 312 |
+
208 Also inspired by Geifman et al. [15], the optimization objective of the combination of $D _ { w }$ and $g$ is
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { r } { \mathcal { L } ( D _ { w } , g ) \triangleq \hat { l } ( D _ { w } , g ) + \lambda \operatorname* { m a x } ( 0 , c - \hat { \phi } ( g ) ) ^ { 2 } , } \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
209 where $c > 0$ denotes the target coverage, and $\lambda$ denotes the factor for controlling the relative importance of rejection. Besides, the empirical coverage 210 $\hat { \phi } ( g )$ is defined as
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\hat { \phi } ( g | X ) \triangleq \frac { 1 } { m } \sum _ { i = 1 } ^ { m } g ( x _ { i } ) ,
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
where a batch of data 211 $X = \{ x _ { i } \} , i \in [ m ]$ . The empirical rejection risk $\hat { l } ( D _ { w } , g )$ is the ratio between 212 the covered risk of the discriminator and the empirical coverage:
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\hat { l } ( D _ { w } , g ) \triangleq \frac { \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \langle \mathcal { L } ( D _ { w } ( x _ { i } ) ) , g ( x _ { i } ) \rangle } { \hat { \phi } ( g ) } .
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
Meanwhile, both $D _ { w _ { 1 } }$ and $g _ { 1 }$ can access $\rho _ { \pi _ { \mathrm { E } } }$ under $\mathcal { O } _ { \mathrm { E } }$ directly. So given $\overline { { x } } \sim \overline { { T } } _ { \pi _ { 2 } }$ under $\mathcal { O } _ { \mathrm { L } }$ , once $\langle \mathbb { I } ( D _ { w _ { 2 } } ( \overline { { x } } ) ) , g _ { 2 } ( \overline { { x } } ) \rangle = + 1$ , we can query the corresponding observations $\widetilde { x }$ of $\textstyle { \overline { { x } } }$ through OC 2operation and use $\langle \mathbb { I } ( D _ { w _ { 1 } } ( \widetilde { \boldsymbol { x } } ) ) , g _ { 1 } ( \widetilde { \boldsymbol { x } } ) \rangle$ to calibrate the output of $g _ { 2 }$ and $D _ { w _ { 2 } }$ e. In this way, $g _ { 2 }$ and $D _ { w _ { 2 } }$ e ecan be entangled together and adaptively guide $\pi _ { 2 }$ to find out the latent demonstrations $H$ under $\mathcal { O } _ { \mathrm { L } }$ .
|
| 331 |
+
|
| 332 |
+
# 4.4 IWRE
|
| 333 |
+
|
| 334 |
+
Here we combine the importance-weighting and rejection into a unified whole, to propose a novel algorithm named Importance Weighting with REjection (IWRE). Concretely, in a HOIL process:
|
| 335 |
+
|
| 336 |
+
Pretraining. We train a discriminator $D _ { w _ { 1 } }$ by Equation (5) and its corresponding rejection model $g _ { 1 }$ by Equation (17) using the initial data and the expert demonstrations.
|
| 337 |
+
|
| 338 |
+
Training. We train a discriminator $D _ { w _ { 2 } }$ by the combination of Equation (9) and Equation (17), as well as its corresponding rejection model $g _ { 2 }$ by Equation (17), using the initial data, the data collected by $\pi _ { 2 }$ , and the output of $D _ { w _ { 1 } }$ with $g _ { 1 }$ through OC operation. Also, $\pi _ { 2 }$ will be updated with $D _ { w _ { 2 } }$ and $g _ { 2 }$ asymmetrically as in GAIL.
|
| 339 |
+
|
| 340 |
+
The pseudo-code of our algorithm is provided in the supplementary material.
|
| 341 |
+
|
| 342 |
+
# 5 Experiment
|
| 343 |
+
|
| 344 |
+
In this section, we validate our algorithm in Atari 2600 [3] (GPL License) and MuJoCo [33] (Academic License) environments. The experiments were designed to investigate:
|
| 345 |
+
|
| 346 |
+
1) Can IWRE achieve significant performance under HOIL tasks?
|
| 347 |
+
2) Can IWRE deal with the support mismatch problem?
|
| 348 |
+
3) During training, is active querying for HOIL indeed necessary?
|
| 349 |
+
|
| 350 |
+
Below we first introduce the experimental setup and then investigate the above questions. More results and experimental details are included in the supplementary material.
|
| 351 |
+
|
| 352 |
+
# 5.1 Experimental Setup
|
| 353 |
+
|
| 354 |
+
Environments. We choose three pixel-memory based games in Atari and five continuous control objects in MuJoCo on OpenAI platform [5] (MIT License). Details as below:
|
| 355 |
+
|
| 356 |
+
1. Pixel-memory Atari games. $\mathcal { O } _ { \mathrm { E } }$ : $8 4 \times 8 4 \times 4$ raw pixels; $\mathcal { O } _ { \mathrm { L } }$ : 128-byte random access memories (RAM). Expert: converged DQN-based agents [24]. Atari games contain two totally isolated views: raw pixels and RAM, under the same state. Through these environments, we want to investigate whether the agent can learn an effective policy from demonstrations under completely different observation spaces. Moreover, IL with visual observations only is already very difficult [7], while learning a RAM-based policy can be even more challenging [3, 31], so few $\mathrm { I L }$ research reported desirable results on this task.
|
| 357 |
+
|
| 358 |
+
2. Continuous control MuJoCo objects. $\mathcal { O } _ { \mathrm { E } }$ : half of original observation features; $\mathcal { O } _ { \mathrm { L } }$ : another half of original observation features. Expert: converged DDPG-based agents [22]. The features of MuJoCo contain monotonous information like the direction, position, velocity, etc., of an object. Through these environments, we want to investigate whether the agent can learn from demonstrations with complementary signals under observations with missing information. Meanwhile, we make sure RL algorithms can obtain comparable performances under $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ . More details are reported in the supplementary material.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 6: The learning curves of each method, where the shaded region indicates the standard deviation.
|
| 362 |
+
|
| 363 |
+
252 Besides, twenty expert trajectories were collected for each environment. Each result contains five
|
| 364 |
+
253 trials with different random seeds. All experiments were conducted on server clusters with NVIDIA
|
| 365 |
+
254 Tesla V100 GPUs. The summary of the environments is gathered in the supplementary material.
|
| 366 |
+
255 Baselines. Six basic contenders were included in the experiments: Vanilla GAIL [16], GAIL
|
| 367 |
+
256 with importance-weighting [12] (IW), third-person IL [30] (TPIL), generative adversarial MDP
|
| 368 |
+
257 alignment [19] (GAMA), behavioral cloning [2] (BC), and learning by cheating [8] (LBC). For
|
| 369 |
+
258 IW, we utilized the discriminator $D _ { w _ { 1 } }$ trained in the pretraining to calculate the importance weight;
|
| 370 |
+
259 also the optimization objective for $D _ { w _ { 2 } }$ during training is the same as Equation (9); TPIL learns the
|
| 371 |
+
260 third-person demonstrations by leading the cross-entropy loss into the update of the feature extractor;
|
| 372 |
+
261 GAMA learns a mapping function $\psi$ in view of adversarial training to align the observation of the
|
| 373 |
+
262 target domain into the source domain, and thereby can utilize the policy in the source domain for
|
| 374 |
+
263 zero-shot imitation. For fairness, we allowed the interaction between the policy and the environment
|
| 375 |
+
264 for GAMA under HOIL; LBC uses $\pi _ { 1 }$ learned from privileged states as a teacher to train $\pi _ { 2 }$ in a
|
| 376 |
+
265 DAgger [27] style, so here we allowed LBC to access $\mathcal { O } _ { \mathrm { E } }$ during the whole IL process. In Atari, to
|
| 377 |
+
266 investigate whether our method could achieve good performance for RAM-based control, we further
|
| 378 |
+
267 included a contender PPO-RAM, which uses proximal policy optimization (PPO) [28] to perform
|
| 379 |
+
268 RL directly with environmental true rewards under the RAM-based observations. More detailed
|
| 380 |
+
269 setup including query strategies for TPIL and GAMA, network architecture, and hyper-parameters
|
| 381 |
+
270 are reported in the supplementary material.
|
| 382 |
+
|
| 383 |
+
Learning process. To simulate the situation that $\mathcal { O } _ { \mathrm { E } }$ is costly, the steps for training $\pi _ { 1 }$ was set as 1/4 of that for training $\pi _ { 2 }$ , using GAIL [16]/HashReward [7] under the $\mathcal { O } _ { \mathrm { E } }$ space for MuJoCo/Atari environments. The learning steps were $1 0 ^ { 7 }$ for MuJoCo and $5 \times 1 0 ^ { 6 }$ for Atari environments. In the pretraining, we sampled 20 trajectories from $\pi _ { 1 }$ , and the data from each trajectory had both $\mathcal { O } _ { \mathrm { E } }$ and $\mathcal { O } _ { \mathrm { L } }$ observations. In the training, each method learned $4 \times 1 0 ^ { 7 }$ steps for MuJoCo and $2 \times 1 0 ^ { 7 }$ steps for Atari under the $\mathcal { O } _ { \mathrm { L } }$ space to obtain $\pi _ { 2 }$ .
|
| 384 |
+
|
| 385 |
+
# 5.2 Results
|
| 386 |
+
|
| 387 |
+
Experimental results are reported in Figure 6. Since the mapping function is hard to learn when input is RAM and output is raw images, we omit the results of GAMA in Atari. We can observe that while IW is better than GAIL in most environments, both GAIL and IW can hardly outperform $\pi _ { 1 }$
|
| 388 |
+
|
| 389 |
+
Because they just imitated the performance of $\pi _ { 1 }$ instead of $\pi _ { \mathrm { E } }$ , even with importance-weighting for calibration. For TPIL, its learning process was extremely unstable on Hopper, Swimmer, and Walker2d due to the continuous distribution shift. Furthermore, the performance of GAMA was not satisfactory in Hopper and Walker2d because its mapping function is hard to learn well when the support mismatch appears. The results of TPIL and GAMA demonstrate that DSIL methods will be invalid under heterogeneous observations as in HOIL tasks. On Atari environments, $\mathcal { O } _ { \mathrm { E } }$ contains more privileged information than $\mathcal { O } _ { \mathrm { L } }$ , so LBC can achieve good performance. But when $\mathcal { O } _ { \mathrm { E } }$ is not more privileged than $\mathcal { O } _ { \mathrm { L } }$ , like in most environments of MuJoCo, its performance will decrease due to the support mismatch, which would make it even worse than BC. Finally, IWRE obtained the best performance on 6/8 environments, and comparable performance with LBC on Reacher, which shows the effectiveness of our method even with limited access to $\mathcal { O } _ { \mathrm { E } }$ (LBC can access to $\mathcal { O } _ { \mathrm { E } }$ all the time). Besides, we can see that the performance differences between the GAIL/IW and IWRE/TPIL/GAMA/LBC are huge (especially on Reacher) because of the absence of queries, which demonstrates that the query operation is indeed necessary for HOIL problems.
|
| 390 |
+
|
| 391 |
+
Moreover, even learned with true rewards, PPO-RAM surprisingly failed to achieve comparable performance to IWRE, which shows that IWRE could possibly learn more effective rewards than true environmental rewards in RAM-input tasks. The results verify that, IWRE provides a powerful approach for tackling HOIL problems, even under the situation that the demonstrations are gathered from such a different observation space, meanwhile $\mathcal { O } _ { \mathrm { E } }$ is strictly limited during training.
|
| 392 |
+
|
| 393 |
+
t-SNE visualization of $\rho _ { \pi _ { 2 } }$ and $\rho _ { \pi _ { \mathrm { E } } }$ under $\mathcal { O } _ { \mathrm { E } }$ . In Section 4.2, we point that the sub-optimality of $\pi _ { 1 }$ will cause the problem of support mismatch, which is embodied as the appearance of the latent demonstration $H$ during training. Also the empirical results in Figure 5 on Hopper and Walker2d verify the existence of this problem. So we want to investigate whether the superiority of IWRE indeed comes from successfully tackling the support mismatch problem. To this end, we plotted the t-SNE visualization of the same expert demonstrations as in Section 4.2 and the collected data of $\pi _ { 2 }$ by IWRE under $\mathcal { O } _ { \mathrm { E } }$ ( $\mathcal { O } _ { \mathrm { E } }$ is hidden to $\pi _ { 2 }$ ). All setups are the same as in Section 4.2. From the results shown in Figure 7, we can see that even under $\mathcal { O } _ { \mathrm { E } }$ which cannot be obtained by $\pi _ { 2 }$ , almost all high-density regions of the demonstrations were covered by the collected data. Meanwhile, the latent demonstration $H$ is dug out nearly. The results demonstrate that IWRE basically solves the problem of support mismatch and thereby performs well in these environments.
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 7: t-SNE visualizations of expert demonstrations and collected data of $\pi _ { 2 }$ under $\mathcal { O } _ { \mathrm { E } }$ . The high-density regions of the expert demonstrations were covered by the collected data of $\pi _ { 2 }$ of IWRE.
|
| 397 |
+
|
| 398 |
+
Besides, some collected data of $\pi _ { 2 }$ of IWRE were out of the distribution of the demonstrations, which means $\pi _ { 2 }$ slightly overly explored the environment. Since $\mathcal { O } _ { \mathrm { E } }$ is hidden to $\pi _ { 2 }$ , the reward function will encourage $\pi _ { 2 }$ to explore more areas to fix the support mismatch problem. Meanwhile, the out-of-distribution problem in HOIL is not as severe as in the offline RL settings [21], so this over-exploration phenomenon makes sense.
|
| 399 |
+
|
| 400 |
+
# 6 Conclusion
|
| 401 |
+
|
| 402 |
+
In this paper, we proposed a new learning framework named Heterogeneously Observable Imitation Learning (HOIL), to formulate the situations where the observation space of demonstrations is different from that of the imitator while learning. We formally modeled a learning process of HOIL, in which the access to the observations of an expert is limited due to the high cost. Furthermore, we analyzed underlying challenges during training, i.e., the dynamics mismatch and the support mismatch, on the occupancy distributions between the demonstrations and the policy. To tackle these challenges, we proposed a new algorithm named Importance Weighting with REjection (IWRE), using importance-weighting and learning with rejection. Experimental results showed that the direct imitation and domain adaptive methods could not solve this problem, while our approach obtained promising results. In the future, we hope to involve the theoretical guarantee for our algorithm IWRE and investigate how many $\mathcal { O } _ { \mathrm { E } }$ do we need to query to learn a promising $\pi _ { 2 }$ . Furthermore, we hope to use the learning framework of HOIL and IWRE to tackle more learning scenarios with demonstrations in different spaces.
|
| 403 |
+
|
| 404 |
+
337 References [1] Pieter Abbeel and Andrew Y. Ng. Inverse reinforcement learning. In Encyclopedia of Machine Learning, pages 554–558. 2010. [2] Michael Bain and Claude Sammut. A framework for behavioural cloning. In Machine Intelligence 15, pages 103–129, 1996. [3] Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res., 47:253–279, 2013. [4] Kianté Brantley, Hal Daumé III, and Amr Sharaf. Active imitation learning with noisy guidance. In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault, editors, Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 2093–2105. Association for Computational Linguistics, 2020. [5] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016. [6] Alberto Broggi, Michele Buzzoni, Stefano Debattisti, Paolo Grisleri, Maria Chiara Laghi, Paolo Medici, and Pietro Versari. Extensive tests of autonomous driving technologies. IEEE Trans. Intell. Transp. Syst., 14(3):1403–1415, 2013. [7] Xin-Qiang Cai, Yao-Xiang Ding, Yuan Jiang, and Zhi-Hua Zhou. Imitation learning from pixel-level demonstrations by hashreward. In Proceedings of the 20th International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), page 279–287, 2021. [8] Dian Chen, Brady Zhou, Vladlen Koltun, and Philipp Krähenbühl. Learning by cheating. In Leslie Pack Kaelbling, Danica Kragic, and Komei Sugiura, editors, 3rd Annual Conference on Robot Learning, CoRL 2019, Osaka, Japan, October 30 - November 1, 2019, Proceedings, volume 100 of Proceedings of Machine Learning Research, pages 66–75. PMLR, 2019. [9] Corinna Cortes, Giulia DeSalvo, and Mehryar Mohri. Learning with rejection. In Ronald Ortner, Hans Ulrich Simon, and Sandra Zilles, editors, Algorithmic Learning Theory - 27th International Conference, ALT 2016, Bari, Italy, October 19-21, 2016, Proceedings, volume 9925 of Lecture Notes in Computer Science, pages 67–82, 2016. [10] Mark Cutler, Thomas J. Walsh, and Jonathan P. How. Reinforcement learning with multi-fidelity simulators. In 2014 IEEE International Conference on Robotics and Automation, ICRA 2014, Hong Kong, China, May 31 - June 7, 2014, pages 3888–3895. IEEE, 2014. [11] Siddharth Desai, Ishan Durugkar, Haresh Karnan, Garrett Warnell, Josiah Hanna, and Peter Stone. An imitation from observation approach to transfer learning with dynamics mismatch. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. [12] Tongtong Fang, Nan Lu, Gang Niu, and Masashi Sugiyama. Rethinking importance weighting for deep learning under distribution shift. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. [13] Justin Fu, Katie Luo, and Sergey Levine. Learning robust rewards with adverserial inverse reinforcement learning. In International Conference on Learning Representations, 2018. [14] Tanmay Gangwani, Joel Lehman, Qiang Liu, and Jian Peng. Learning belief representations for imitation learning in pomdps. In Amir Globerson and Ricardo Silva, editors, Proceedings of the Thirty-Fifth Conference on Uncertainty in Artificial Intelligence, UAI 2019, Tel Aviv, Israel, July 22-25, 2019, volume 115 of Proceedings of Machine Learning Research, pages 1061–1071. AUAI Press, 2019.
|
| 405 |
+
|
| 406 |
+
385 [15] Yonatan Geifman and Ran El-Yaniv. Selectivenet: A deep neural network with an integrated
|
| 407 |
+
386 reject option. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the
|
| 408 |
+
387 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach,
|
| 409 |
+
388 California, USA, volume 97 of Proceedings of Machine Learning Research, pages 2151–2159.
|
| 410 |
+
389 PMLR, 2019.
|
| 411 |
+
390 [16] Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances
|
| 412 |
+
391 in Neural Information Processing Systems 29: Annual Conference on Neural Information
|
| 413 |
+
392 Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 4565–4573, 2016.
|
| 414 |
+
393 [17] Shengyi Jiang, Jing-Cheng Pang, and Yang Yu. Offline imitation learning with a misspecified
|
| 415 |
+
394 simulator. In Advances in Neural Information Processing Systems 33: Annual Conference on
|
| 416 |
+
395 Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual,
|
| 417 |
+
396 2020.
|
| 418 |
+
397 [18] Kun Ho Kim, Yihong Gu, Jiaming Song, Shengjia Zhao, and Stefano Ermon. Cross domain
|
| 419 |
+
398 imitation learning. CoRR, abs/1910.00105, 2019.
|
| 420 |
+
399 [19] Kuno Kim, Yihong Gu, Jiaming Song, Shengjia Zhao, and Stefano Ermon. Domain adaptive
|
| 421 |
+
400 imitation learning. In Proceedings of the 37th International Conference on Machine Learning,
|
| 422 |
+
401 ICML 2020, 13-18 July 2020, Virtual Event, pages 5286–5295, 2020.
|
| 423 |
+
402 [20] Bangalore Ravi Kiran, Ibrahim Sobh, Victor Talpaert, Patrick Mannion, Ahmad A. Al Sallab,
|
| 424 |
+
403 Senthil Kumar Yogamani, and Patrick Pérez. Deep reinforcement learning for autonomous
|
| 425 |
+
404 driving: A survey. CoRR, abs/2002.00444, 2020.
|
| 426 |
+
405 [21] Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning:
|
| 427 |
+
406 Tutorial, review, and perspectives on open problems. CoRR, abs/2005.01643, 2020.
|
| 428 |
+
407 [22] Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval
|
| 429 |
+
408 Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning.
|
| 430 |
+
409 In Yoshua Bengio and Yann LeCun, editors, 4th International Conference on Learning Repre
|
| 431 |
+
410 sentations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings,
|
| 432 |
+
411 2016.
|
| 433 |
+
412 [23] Yuxuan Liu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Imitation from observation:
|
| 434 |
+
13 Learning to imitate behaviors from raw video via context translation. In 2018 IEEE International
|
| 435 |
+
414 Conference on Robotics and Automation, ICRA 2018, Brisbane, Australia, May 21-25, 2018,
|
| 436 |
+
415 pages 1118–1125, 2018.
|
| 437 |
+
416 [24] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan
|
| 438 |
+
417 Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. CoRR,
|
| 439 |
+
18 abs/1312.5602, 2013.
|
| 440 |
+
419 [25] Shayegan Omidshafiei, Jason Pazis, Christopher Amato, Jonathan P. How, and John Vian. Deep
|
| 441 |
+
420 decentralized multi-task multi-agent reinforcement learning under partial observability. In
|
| 442 |
+
421 Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney,
|
| 443 |
+
422 NSW, Australia, 6-11 August 2017, pages 2681–2690, 2017.
|
| 444 |
+
423 [26] Dripta S. Raychaudhuri, Sujoy Paul, Jeroen van Baar, and Amit K. Roy-Chowdhury. Cross
|
| 445 |
+
424 domain imitation from observations. In Marina Meila and Tong Zhang, editors, Proceedings of
|
| 446 |
+
425 the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual
|
| 447 |
+
426 Event, volume 139 of Proceedings of Machine Learning Research, pages 8902–8912. PMLR,
|
| 448 |
+
427 2021.
|
| 449 |
+
428 [27] Stéphane Ross, Geoffrey J. Gordon, and Drew Bagnell. A reduction of imitation learning and
|
| 450 |
+
429 structured prediction to no-regret online learning. In Proceedings of the Fourteenth International
|
| 451 |
+
430 Conference on Artificial Intelligence and Statistics, AISTATS 2011, Fort Lauderdale, USA, April
|
| 452 |
+
431 11-13, 2011, pages 627–635, 2011.
|
| 453 |
+
432 [28] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal
|
| 454 |
+
433 policy optimization algorithms. CoRR, abs/1707.06347, 2017.
|
| 455 |
+
434 [29] Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, and
|
| 456 |
+
435 Sergey Levine. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE
|
| 457 |
+
436 International Conference on Robotics and Automation, ICRA 2018, Brisbane, Australia, May
|
| 458 |
+
437 21-25, 2018, pages 1134–1141, 2018.
|
| 459 |
+
438 [30] Bradly C. Stadie, Pieter Abbeel, and Ilya Sutskever. Third person imitation learning. In 5th
|
| 460 |
+
439 International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26,
|
| 461 |
+
440 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 462 |
+
441 [31] Jakub Sygnowski and Henryk Michalewski. Learning from the memory of atari 2600. In Tristan
|
| 463 |
+
442 Cazenave, Mark H. M. Winands, Stefan Edelkamp, Stephan Schiffel, Michael Thielscher, and
|
| 464 |
+
443 Julian Togelius, editors, Computer Games - 5th Workshop on Computer Games, CGW 2016,
|
| 465 |
+
444 and 5th Workshop on General Intelligence in Game-Playing Agents, GIGA 2016, Held in
|
| 466 |
+
445 Conjunction with the 25th International Conference on Artificial Intelligence, IJCAI 2016, New
|
| 467 |
+
446 York City, NY, USA, July 9-10, 2016, Revised Selected Papers, volume 705 of Communications
|
| 468 |
+
447 in Computer and Information Science, pages 71–85, 2016.
|
| 469 |
+
48 [32] Andrea Tirinzoni, Andrea Sessa, Matteo Pirotta, and Marcello Restelli. Importance weighted
|
| 470 |
+
449 transfer of samples in reinforcement learning. In Jennifer G. Dy and Andreas Krause, editors,
|
| 471 |
+
450 Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stock
|
| 472 |
+
451 holmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine
|
| 473 |
+
452 Learning Research, pages 4943–4952. PMLR, 2018.
|
| 474 |
+
53 [33] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based
|
| 475 |
+
454 control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS
|
| 476 |
+
455 2012, Vilamoura, Algarve, Portugal, October 7-12, 2012, pages 5026–5033, 2012.
|
| 477 |
+
456 [34] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine
|
| 478 |
+
457 Learning Research, 9:2579–2605, 2008.
|
| 479 |
+
58 [35] Ruohan Wang, Carlo Ciliberto, Pierluigi Vito Amadori, and Yiannis Demiris. Random expert
|
| 480 |
+
459 distillation: Imitation learning via expert policy support estimation. In Kamalika Chaudhuri and
|
| 481 |
+
460 Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine
|
| 482 |
+
461 Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings
|
| 483 |
+
462 of Machine Learning Research, pages 6536–6544. PMLR, 2019.
|
| 484 |
+
463 [36] Andrew Warrington, Jonathan Wilder Lavington, Adam Scibior, Mark Schmidt, and Frank ´
|
| 485 |
+
464 Wood. Robust asymmetric learning in pomdps. In Marina Meila and Tong Zhang, editors,
|
| 486 |
+
465 Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24
|
| 487 |
+
466 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages
|
| 488 |
+
467 11013–11023. PMLR, 2021.
|
| 489 |
+
|
| 490 |
+
# 468 Checklist
|
| 491 |
+
|
| 492 |
+
1. For all authors...
|
| 493 |
+
|
| 494 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 495 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 496 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See supplementary material.
|
| 497 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 498 |
+
|
| 499 |
+
2. If you are including theoretical results...
|
| 500 |
+
|
| 501 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 502 |
+
|
| 503 |
+
3. If you ran experiments...
|
| 504 |
+
|
| 505 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section 5.
|
| 506 |
+
|
| 507 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See supplementary material.
|
| 508 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 5.
|
| 509 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 5.
|
| 510 |
+
|
| 511 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 512 |
+
|
| 513 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 514 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 515 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 516 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 517 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 518 |
+
|
| 519 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 520 |
+
|
| 521 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 522 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 523 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/5NTt8GFjUHkr/5NTt8GFjUHkr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/9Hrka5PA7LW/9Hrka5PA7LW.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REPRESENTATIONAL CONTINUITY FOR UNSUPERVISED CONTINUAL LEARNING
|
| 2 |
+
|
| 3 |
+
Divyam Madaan1∗ Jaehong Yoon2,3 † Yuanchun $\mathbf { L i } ^ { 5 , 6 }$ Yunxin Liu5,6 Sung Ju Hwang2,4 New York University1 KAIST2 Microsoft Research3 AITRICS4 Institute for AI Industry Research (AIR)5 Tsinghua University6 divyam.madaan@nyu.edu, {jaehong.yoon,sjhwang82}@kaist.ac.kr liyuanchun@air.tsinghua.edu.cn, liuyunxin@air.tsinghua.edu.cn
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Continual learning (CL) aims to learn a sequence of tasks without forgetting the previously acquired knowledge. However, recent CL advances are restricted to supervised continual learning (SCL) scenarios. Consequently, they are not scalable to real-world applications where the data distribution is often biased and unannotated. In this work, we focus on unsupervised continual learning (UCL), where we learn the feature representations on an unlabelled sequence of tasks and show that reliance on annotated data is not necessary for continual learning. We conduct a systematic study analyzing the learned feature representations and show that unsupervised visual representations are surprisingly more robust to catastrophic forgetting, consistently achieve better performance, and generalize better to out-ofdistribution tasks than SCL. Furthermore, we find that UCL achieves a smoother loss landscape through qualitative analysis of the learned representations and learns meaningful feature representations. Additionally, we propose Lifelong Unsupervised Mixup (LUMP), a simple yet effective technique that interpolates between the current task and previous tasks’ instances to alleviate catastrophic forgetting for unsupervised representations. We release our code online.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recently continual learning (Thrun, 1995) has gained a lot of attention in the deep learning community due to its ability to continually learn on a sequence of non-stationary tasks (Kumar & Daume III, 2012; Li & Hoiem, 2016) and close proximity to the human learning process (Flesch et al., 2018). However, the inability of the learner to prevent forgetting of the knowledge learnt from the previous tasks has been a long-standing problem (McCloskey & Cohen, 1989; Goodfellow et al., 2013). To address this problem, a large body of methods (Rusu et al., 2016; Zenke et al., 2017; Yoon et al., 2018; Li et al., 2019; Aljundi et al., 2019; Buzzega et al., 2020) have been proposed; however, all these methods focus on the supervised learning paradigm, but obtaining high-quality labels is expensive and often impractical in real-world scenarios. In contrast, CL for unsupervised representation learning has received limited attention in the community. Although Rao et al. (2019) instantiated a continual unsupervised representation learning framework (CURL), it is not scalable for high-resolution tasks, as it is composed of MLP encoders/decoders and a simple MoG generative replay. This is evident in their limited empirical evaluation using digit-based gray-scale datasets.
|
| 12 |
+
|
| 13 |
+
Meanwhile, a set of directions have shown huge potential to tackle the representation learning problem without labels (He et al., 2020; Chen et al., 2020a; Grill et al., 2020; Chen et al., 2020b; Chen & He, 2021; Zbontar et al., 2021) by aligning contrastive pairs of training instances or maximizing the similarity between two augmented views of each image. However, a common assumption for existing methods is the availability of a large amount of unbiased and unlabelled datasets to learn the feature representations. We argue that this assumption is not realistic for most of the real-time applications, including self-driving cars (Bojarski et al., 2016), medical applications (Kelly et al., 2019) and conversational agents (Li et al., 2020). The collected datasets are often limited in size during the initial training phase (Finn et al., 2017), and datasets/tasks change continuously with time.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Illustration of supervised and unsupervised continual learning. The objective of SCL is to learn the ability to classify labeled images in the current task while preserving the past tasks’ knowledge, where the tasks are non-iid to each other. On the other hand, UCL aims to learn the representation of images without the presence of labels and the model learns general-purpose representations during sequential training.
|
| 17 |
+
|
| 18 |
+
To accommodate such continuous shifts in data distributions, representation learning models need to increment the knowledge without losing the representations learned in the past. With this motivation, we attempt to bridge the gap between unsupervised representation learning and continual learning to address the challenge of learning the representations on a sequence of tasks. Specifically, we focus on unsupervised continual learning (UCL), where the goal of the continual learner is to learn the representations from a stream of unlabelled data instances without forgetting (see Figure 1). To this end, we extend various existing SCL strategies to the unsupervised continual learning framework and analyze the performance of current state-of-the-art representation learning techniques: SimSiam (Chen & He, 2021) and BarlowTwins (Zbontar et al., 2021) for UCL. Surprisingly, we observe that the unsupervised representations are comparatively more robust to catastrophic forgetting across all datasets and simply finetuning on the sequence of tasks can outperform various state-of-the-art continual learning alternatives. Furthermore, we show that UCL generalize better to various out of distribution tasks and outperforms SCL for few-shot training scenarios (Section 5.2).
|
| 19 |
+
|
| 20 |
+
We demystify the robustness of unsupervised representations by investigating the feature similarity, measured by centered kernel alignment (CKA) (Kornblith et al., 2019) between two independent UCL and SCL models and between UCL and SCL models. We notice that two unsupervised model representations have a relatively high feature similarity compared to two supervised representations. Furthermore, in all cases, two models have high similarity in lower layers indicating that they learn similar low-level features. Further, we measure the $\ell _ { 2 }$ distance between model parameters (Neyshabur et al., 2020) and visually compare the feature representations learned by different SCL and UCL strategies. We observe that UCL obtains human perceptual feature patterns for previous tasks, demonstrating their effectiveness to alleviate catastrophic forgetting (Section 5.3). We conjecture that this is due to their characteristic ability to learn general-purpose features (Doersch et al., 2020), which makes them transfer better and comparatively more robust to catastrophic forgetting.
|
| 21 |
+
|
| 22 |
+
To gain further insights, we visualize the loss landscape (Li et al., 2018) of the UCL and SCL models and observe that UCL obtains a flatter and smoother loss landscape than SCL. Additionally, we propose a simple yet effective technique coined Lifelong Unsupervised Mixup (LUMP), which utilizes mixup (Zhang et al., 2018) for unlabelled training instances. In particular, LUMP interpolates between the current task examples and examples from previous instances to minimize catastrophic forgetting. We emphasize that LUMP is easy to implement, does not require additional hyperparameters, and simply trains on the interpolated instances. To this end, LUMP requires little, or no modification to existing rehearsal-based methods effectively minimizes catastrophic forgetting even with uniformly selecting the examples from replay buffer. We show that LUMP with UCL outperforms the state-ofthe-art supervised continual learning methods across multiple experimental settings with significantly lower catastrophic forgetting. In summary, our contributions are as follows:
|
| 23 |
+
|
| 24 |
+
• We attempt to bridge the gap between continual learning and representation learning and tackle the two crucial problems of continual learning with unlabelled data and representation learning on a sequence of tasks. • Systematic quantitative analysis shows that UCL achieves better performance over SCL with significantly lower catastrophic forgetting on Sequential CIFAR-10, CIFAR-100, and Tiny-ImageNet. Additionally, we evaluate out-of-distribution tasks and few-shot training demonstrating the expressive power of unsupervised representations. • We provide visualization of the representations and loss landscapes, which show that UCL learns discriminative, human perceptual patterns and achieves a flatter and smoother loss landscape. Furthermore, we propose Lifelong Unsupervised Mixup (LUMP) for UCL, which effectively alleviates catastrophic forgetting and provides better qualitative interpretations.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Continual learning. We can partition the existing continual learning methods into three categories. The regularization approaches (Li & Hoiem, 2016; Zenke et al., 2017; Schwarz et al., 2018; Ahn et al., 2019) impose a regularization constraint to the objective that mitigates catastrophic forgetting. The architectural approaches (Rusu et al., 2016; Yoon et al., 2018; Li et al., 2019) avoid this problem by including task-specific parameters and allowing the expansion of the network during continual learning. The rehearsal approaches (Rebuffi et al., 2017; Rolnick et al., 2019; Aljundi et al., 2019) allocate a small memory buffer to store and replay the examples from the previous task. However, all these methods are confined to supervised learning, which limits their application in real-life problems. Rao et al. (2019); Smith et al. (2021) tackled the problem of continual unsupervised representation learning; however, their methods are restricted to simple low-resolution tasks and not scalable to large-scale continual learning datasets.
|
| 29 |
+
|
| 30 |
+
Representational learning. A large number of works have addressed the unsupervised learning problem in the standard machine learning framework. Specifically, contrastive learning frameworks (He et al., 2020; Chen et al., 2020a; Grill et al., 2020; Chen et al., 2020b;c) that learn the representations by measuring the similarities of positive and negative pairs have gained a lot of attention in the community. However, all these methods require large batches and negative sample pairs, which restrict the scalability of these networks. Chen & He (2021) tackled these limitations and proposed SimSiam, that use standard Siamese networks (Bromley et al., 1994) with the stop-gradient operation to prevent the collapsing of Siamese networks to a constant. Recently, Zbontar et al. (2021) formulated an objective that pushes the cross-correlation matrix between the embeddings of distorted versions of a sample closer to the identity matrix. However, all these methods assume the presence of large datasets for pre-training, which is impractical in real-world applications. In contrast, we tackle the problem of incremental representational learning and learn the representations sequentially while maximizing task adaptation and minimizing catastrophic forgetting.
|
| 31 |
+
|
| 32 |
+
# 3 PRELIMINARIES
|
| 33 |
+
|
| 34 |
+
# 3.1 PROBLEM SETUP
|
| 35 |
+
|
| 36 |
+
We consider the continual learning setting, where we learn on a continuum of data consisting of $T$ $\mathcal { T } _ { 1 : T } = ( \mathcal { T } _ { 1 } \dots \mathcal { T } _ { T } )$ In superonding , where taskwithdistri nsists a task descriptorexamples. Each input-ion. Let us consider a $\tau \in \{ 1 \ldots T \}$ $\mathcal { D } _ { \tau } = \{ ( { \boldsymbol { x } } _ { i , \tau } , y _ { i , \tau } ) _ { i = 1 } ^ { n _ { \tau } } \}$ $n _ { \tau }$ $( { \bf x } _ { i , \tau } , \bar { y _ { i , \tau } } ) \in \mathcal { X } _ { \tau } \times \mathcal { Y } _ { \tau }$ $( \mathcal { X } _ { \tau } , \mathcal { Y } _ { \tau } )$ network $f _ { \Theta } : \mathcal { X } _ { \tau } \to \mathbb { R } ^ { D }$ parametrized by $\mathbf { \Theta } \Theta = \{ \pmb { w } _ { l } \} _ { l = 1 } ^ { l = L }$ , where $\mathbb { R } ^ { D }$ and $L$ denote $D$ -dimensional embedding space and number of layers respectively. The classifier is denoted by $h _ { \psi } : \mathbb { R } ^ { D } \mathcal { V } _ { \tau }$ . The network error using cross entropy loss (CE) for SCL with finetuning can be formally defined as:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathcal { L } _ { \mathrm { S C L } } ^ { \mathrm { F I N E T U N E } } = \mathrm { C E } \left( h _ { \psi } \left( f _ { \Theta } \left( \pmb { x } _ { i , \tau } \right) , \tau \right) , y _ { i , \tau } \right) .
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
In this work, we assume the absence of label supervision during training and focus on unsupervised continual learning. In particular, each task consists of $\mathcal { U } _ { \tau } \bar { = } \{ ( { \pmb x } _ { i , \tau } ) _ { i = 1 } ^ { n _ { \tau } } \}$ , $\mathbf { \boldsymbol { x } } _ { i , \tau } ~ \in ~ \mathcal { X } _ { \tau }$ with $n _ { \tau }$ examples. Our aim is to learn the representations $f _ { \Theta } : \mathcal { X } _ { \tau } \to \mathbb { R } ^ { D }$ on a sequence of tasks while preserving the knowledge of the previous tasks. We introduce the representation learning framework and propose LUMP in Section 4 to learn unsupervised representations while effectively mitigating catastrophic forgetting.
|
| 43 |
+
|
| 44 |
+
# 3.2 LEARNING PROTOCOL AND EVALUATION METRICS
|
| 45 |
+
|
| 46 |
+
Currently, the traditional continual learning strategies follow the standard training protocol, where we learn the network representations $f _ { \Theta } : \mathcal { X } _ { \tau } \to \mathcal { Y } _ { \tau }$ on a sequence of tasks. In contrast, our goal is to learn the feature representations $f _ { \Theta } : \mathcal { X } _ { \tau } \to \mathbb { R } ^ { D }$ , so we follow a two-step learning protocol to obtain the model predictions. First, we pre-train the representations on a sequence of tasks $T _ { 1 : T } = ( \tau _ { \cdot \cdot \cdot } \mathcal { T } _ { T } )$ to obtain the representations. Next, we evaluate the quality of our pre-trained representations using a $\mathbf { K }$ -nearest neighbor (KNN) classifier (Wu et al., 2018) following the setup in Chen et al. (2020a); Chen & He (2021); Zbontar et al. (2021).
|
| 47 |
+
|
| 48 |
+
To validate knowledge transfer of the learned representations, we adopt the metrics from the SCL literature (Chaudhry et al., 2019b; Mirzadeh et al., 2020). Let $\boldsymbol { a } _ { \tau , i }$ denote the test accuracy of task $i$ after learning task $\mathcal { T } _ { \tau }$ using a KNN on frozen pre-trained representations on task $\mathcal { T } _ { \tau }$ . More formally, we can define the metrics to evaluate the continually learned representations as follow:
|
| 49 |
+
|
| 50 |
+
1. Average accuracy is the average test accuracy of all the tasks completed until the continual learning of task τ : Aτ = 1τ Pτi=1 aτ,i 2. Average Forgetting is the average performance decrease of each task between its maximum accuracy and accuracy at the completion of training: $\begin{array} { r } { F = \frac { 1 } { T - 1 } \sum _ { i = 1 } ^ { T - 1 } \operatorname* { m a x } _ { \tau \in \{ 1 , \dots , T \} } \left( a _ { \tau , i } - a _ { T , i } \right) } \end{array}$
|
| 51 |
+
|
| 52 |
+
# 4 UNSUPERVISED CONTINUAL LEARNING
|
| 53 |
+
|
| 54 |
+
# 4.1 CONTINUOUS REPRESENTATION LEARNING WITH SEQUENTIAL TASKS
|
| 55 |
+
|
| 56 |
+
To learn feature representations, contrastive learning (Chen et al., 2020a;b; He et al., 2020) maximizes the similarity of representations between the images of the same views (positive pairs) and minimizes the similarity between images of different views (negative pairs). However, these methods require large batches, negative sample pairs (Chen et al., 2020a;b), or architectural modifications (He et al., 2020; Chen et al., 2020c), or non-differentiable operators (Caron et al., 2020), which makes their application difficult for continual learning scenarios. In this work, we focus on SimSiam (Chen & He, 2021) and BarlowTwins (Zbontar et al., 2021), which tackle these limitations and achieve state-of-the-art performance on standard representation learning benchmarks.
|
| 57 |
+
|
| 58 |
+
SimSiam (Chen & He, 2021) uses a variant of Siamese networks (Bromley et al., 1994) for learning input data representations. It consists of an encoder network $f _ { \Theta }$ , which is composed of a backbone network, and is shared across a projection MLP and prediction MLP head $h ( \cdot )$ . Specifically, SimSiam minimizes the cosine-similarity between the output vectors of the projector and the predictor MLP across two different augmentations for an image. Initially, we consider FINETUNE, which is a a naive CL baseline that minimizes the cosine-similarity between the projector output $( z _ { i , \tau } ^ { 1 } = f _ { \Theta } ( x _ { i , \tau } ^ { 1 } ) )$ and the predictor output $( p _ { i , \tau } ^ { 2 } = h ( f _ { \Theta } ( x _ { i , \tau } ^ { 2 } ) )$ on a sequence of tasks as follows:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { U C L } } ^ { \mathrm { F I N E T U N E } } = \displaystyle \frac { 1 } { 2 } D ( p _ { i , \tau } ^ { 1 } , \mathrm { s t o p g r a d } ( z _ { i , \tau } ^ { 2 } ) ) + \frac { 1 } { 2 } D ( p _ { i , \tau } ^ { 2 } , \mathrm { s t o p g r a d } ( z _ { i , \tau } ^ { 1 } ) ) , } \\ { \mathrm { w h e r e } D ( p _ { i , \tau } ^ { 1 } , z _ { i , \tau } ^ { 2 } ) = - \frac { p _ { i , \tau } ^ { 1 } } { \| p _ { i , \tau } ^ { 2 } \| _ { 2 } } \cdot \frac { z _ { i , \tau } ^ { 2 } } { \| z _ { i , \tau } ^ { 2 } \| _ { 2 } } , } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
$x _ { i , \tau } ^ { 1 }$ nd -n $x _ { i , \tau } ^ { 2 }$ are two randomly augmented views of an input example Note that, the stopgrad is a crucial component in Si $x _ { i , \tau } \in \mathcal { T } _ { \tau }$ and preve $\lVert \cdot \rVert _ { 2 }$ denotese trivial $\ell _ { 2 }$ solutions obtained by Siamese networks. Due to its simplicity and effectiveness, we chose Simsiam to analyze the performance of unsupervised representations for continual learning.
|
| 65 |
+
|
| 66 |
+
BarlowTwins (Zbontar et al., 2021) minimizes the redundancy between the embedding vector components of the distorted versions of an instance while conserving the maximum information inspired from Barlow (1961). In particular, the objective function eliminates the SimSiam stopgrad component and instead makes the cross-correlation matrix computed between the outputs of two identical networks closer to the identity matrix. Let $\mathcal { C }$ be the cross-correlation matrix between the outputs of two Siamese branches along the batch dimension and $Z _ { 1 }$ and $Z _ { 2 }$ denote the batch embeddings of the distorted views for all images of a batch from the current task $( x _ { \tau } \in \mathcal { U } _ { \tau }$ ). The objective function for UCL with finetuning and BarlowTwins can then be defined as:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathcal { L } _ { \mathrm { U C L } } ^ { \mathrm { F I N E T U N E } } = \sum _ { i } ( 1 - \mathcal { C } _ { i i } ) ^ { 2 } + \ \lambda \cdot \sum _ { i } \sum _ { j \neq i } \mathcal { C } _ { i j } ^ { 2 } , \mathrm { w h e r e } \ \mathcal { C } _ { i j } = \frac { \sum _ { B } z _ { B , i } ^ { 1 } z _ { B , j } ^ { 2 } } { \sqrt { \sum _ { B } { ( z _ { B , i } ^ { 1 } ) } ^ { 2 } } \sqrt { \sum _ { B } { ( z _ { B , j } ^ { 2 } ) } ^ { 2 } } } .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
$\lambda$ is a positive constant trading off the importance of the invariance and redundancy reduction terms of the loss, $i$ and $j$ denote the network’s output vector dimensions. Similar to SimSiam, BarlowTwins is simple, easy to implement, and can be applied to existing continual learning strategies with little or no modification.
|
| 73 |
+
|
| 74 |
+
Learning feature representations from labelled instances on a sequence of tasks has been long studied in continual learning. However, the majority of these learning strategies are not directly applicable to UCL. To compare with the regularization-based strategies, we extend Synaptic Intelligence (SI) (Zenke et al., 2017) to UCL and consider the online per-synapse consolidation during the entire training trajectory of the unsupervised representations. For architectural-based strategies, we investigate Progressive Neural Networks (PNN) (Rusu et al., 2016) and learn the feature representations progressively using the representations learning frameworks proposed in Section 4.1.
|
| 75 |
+
|
| 76 |
+
We also formulate Dark Experience Replay (DER) (Buzzega et al., 2020) for UCL. DER for SCL alleviates catastrophic forgetting by matching the network logits across a sequence of tasks during the optimization trajectory. Notably, the loss for SCL-DER can be defined as follow:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mathcal { L } _ { \mathrm { S C L } } ^ { \mathrm { D E R } } = \mathcal { L } _ { \mathrm { S C L } } ^ { \mathrm { F I N E T U N E } } + ~ \alpha \cdot \mathbb { E } _ { ( \boldsymbol { x } , \boldsymbol { p } ) \sim \mathcal { M } } \big [ \| \mathrm { s o f t m a x } ( \boldsymbol { p } ) - \mathrm { s o f t m a x } ( h _ { \psi } ( \boldsymbol { x } _ { i , \tau } ) ) \| _ { 2 } ^ { 2 } \big ] ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where p = hψτ (x), LFINETSCL $\mathcal { L } _ { \mathrm { S C L } } ^ { \mathrm { F I N E T U N E } }$ denotes the cross-entropy loss on the current task (see Equation (1)) and random examples are selected using reservoir sampling from the replay-buffer $\mathcal { M }$ . Since, we do not have access to the labels for UCL, we cannot minimize the aforementioned objective.
|
| 83 |
+
|
| 84 |
+
Instead, we utilize the output of the projected output by the backbone network to preserve the knowledge of the past tasks over the entire training trajectory. In particular, DER for UCL consists of a combination of two terms. The first term learns the representations using SimSiam from Equation (2) or BarlowTwins from Equation (3) and the second term minimizes the Euclidean distance between the projected outputs to minimize catastrophic forgetting. More formally, UCL-DER minimizes the following loss:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal { L } _ { \mathrm { U C L } } ^ { \mathrm { D E R } } = \mathcal { L } _ { \mathrm { U C L } } ^ { \mathrm { F I N E T U N E } } + \ \alpha \cdot \mathbb { E } _ { ( x ) \sim \mathcal { M } } \big [ \| f _ { \Theta _ { \tau } } ( x ) - f _ { \Theta } ( x _ { i , \tau } ) \| _ { 2 } ^ { 2 } \big ]
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
However, the performance of the rehearsal-based methods is sensitive to the choice of $\alpha$ and often requires supervised training setup, task identities, and boundaries. To tackle this issue, we propose Lifelong Unsupervised Mixup in the subsequent subsection, which interpolates between the current and past task instances to mitigate catastrophic forgetting effectively.
|
| 91 |
+
|
| 92 |
+
# 4.3 LIFELONG UNSUPERVISED MIXUP
|
| 93 |
+
|
| 94 |
+
The standard Mixup (Zhang et al., 2018) training constructs virtual training examples based on the principle of Vicinal Risk Minimization . In particular, let $( x _ { i } , y _ { i } )$ and $( x _ { j } , y _ { j } )$ denote two random feature-target pairs sampled from the training data distribution and let $( \tilde { x } , \tilde { y } )$ denote the interpolated feature-target pair in the vicinity of these examples; mixup then minimizes the following objective:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r l } & { \mathcal { L } ^ { \mathrm { M x U P } } ( \tilde { x } , \tilde { y } ) = \mathrm { C E } \left( h _ { \psi } \left( f _ { \Theta } \left( \tilde { x } \right) \right) , \tilde { y } \right) , } \\ & { \quad \quad \mathrm { w h e r e } \tilde { x } = \lambda \cdot x _ { i } + \left( 1 - \lambda \right) \cdot x _ { j } \mathrm { a n d } \tilde { y } = \lambda \cdot y _ { i } + \left( 1 - \lambda \right) \cdot y _ { j } . } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
$\lambda \sim \operatorname { B e t a } ( \alpha , \alpha )$ , for $\alpha \in ( 0 , \infty )$ . In this work, we focus on lifelong self-supervised learning and propose Lifelong Unsupervised Mixup (LUMP) that utilizes mixup for UCL by incorporating the instances stored in the replay-buffer from the previous tasks into the vicinal distribution. In particular, LUMP interpolates between the examples of the current task $( x _ { i , \tau } ) \in \mathcal { U } _ { \tau }$ and random examples selected using uniform sampling from the replay buffer, which encourages the model to behave linearly across a sequence of tasks. More formally, LUMP minimizes the objective in Equation (2) and Equation (3) on the following interpolated instances $\tilde { x } _ { i , \tau }$ for the current task $\tau$ :
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\boldsymbol { \tilde { x } } _ { i , \tau } = \lambda \cdot \boldsymbol { x } _ { i , \tau } + ( 1 - \lambda ) \cdot \boldsymbol { x } _ { j , \boldsymbol { M } } ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $x _ { j , \mathcal { M } } \sim \mathcal { M }$ denotes the example selected using uniform sampling from replay buffer $\mathcal { M }$ . The interpolated examples not only augments the past tasks’ instances in the replay buffer but also approximates a regularized loss minimization (Zhang et al., 2021). During UCL, LUMP enhances the robustness of learned representation by revisiting the attributes of the past task that are similar to the current task. Recently, Kim et al. (2020); Lee et al. (2021); Verma et al. (2021); Shen et al. (2022) also employed mixup for contrastive learning. Our work is different from these existing works in that our objective is different, and we focus on unsupervised continual learning. To this end, LUMP successively mitigates catastrophic forgetting and learns discriminative & human-perceptual features over the current state-of-the-art SCL strategies (see Table 1 and Figure 4).
|
| 107 |
+
|
| 108 |
+
# 5 EXPERIMENTS
|
| 109 |
+
|
| 110 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 111 |
+
|
| 112 |
+
Baselines. We compare with multiple supervised and unsupervised continual learning baselines across different categories of continual learning methods.
|
| 113 |
+
|
| 114 |
+
1. Supervised continual learning. FINETUNE is a vanilla supervised learning method trained on a sequence of tasks without regularization or episodic memory and MULTITASK optimizes the model on complete data. For regularization-based CL methods, we compare against SI (Zenke et al., 2017) and AGEM (Chaudhry et al., 2019a). We include PNN (Rusu et al., 2016) for architecture-based methods. Lastly, we consider GSS (Aljundi et al., 2019) that populates the replay-buffer using solid-angle minimization and DER (Buzzega et al., 2020) matches the network logits sampled through the optimization trajectory for rehearsal during continual learning.
|
| 115 |
+
|
| 116 |
+
2. Unsupervised continual learning. We consider the unsupervised variants of various SCL baselines to show the utility of the unsupervised representations for sequential learning. Specifically, we use SIMSIAM (Chen & He, 2021) and BARLOWTWINS (Zbontar et al., 2021), which are the state-of-the-art representational learning techniques for learning the unsupervised continual representations. We compare with FINETUNE and MULTITASK following the supervised learning baselines, and SI (Zenke et al., 2017), PNN (Rusu et al., 2016) for unsupervised regularization and architecture CL methods respectively. For rehearsal-based method, we compare with the UCL variant of DER (Buzzega et al., 2020) described in Section 4.2
|
| 117 |
+
|
| 118 |
+
Datasets. We compare the performance of SCL and UCL on various continual learning benchmarks using single-head ResNet-18 (He et al., 2016) architecture. Split CIFAR-10 (Krizhevsky, 2012) consists of two random classes out of the ten classes for each task. Split CIFAR-100 (Krizhevsky, 2012) consists of five random classes out of the 100 classes for each task. Split Tiny-ImageNet is a variant of the ImageNet dataset (Deng et al., 2009) containing five random classes out of the 100 classes for each task with the images sized $6 4 \times 6 4$ pixels.
|
| 119 |
+
|
| 120 |
+
Training and evaluation setup. We follow the hyperparameter setup of Buzzega et al. (2020) for all the SCL strategies and tune them for the UCL representation learning strategies. All the learned representations are evaluated with KNN classifier (Wu et al., 2018) across three independent runs. Further, we use the hyper-parameters obtained by SimSiam for training UCL strategies with BarlowTwins to analyze the sensitivity of UCL to hyper-parameters and for a fair comparison between different methods. We train all the UCL methods for 200 epochs and evaluate with the KNN classifier (Wu et al., 2018). We provide the hyper-parameters in detail in Table A.5.
|
| 121 |
+
|
| 122 |
+
# 5.2 QUANTITATIVE RESULTS
|
| 123 |
+
|
| 124 |
+
Evaluation on SimSiam. Table 1 shows the evaluation results for supervised and unsupervised representations learnt by SimSiam (Chen & He, 2021) across various continual learning strategies. In all cases, continual learning with unsupervised representations achieves significantly better performance than supervised representations with substantially lower forgetting. For instance, SI with UCL obtains better performance and $6 8 \%$ , $5 4 \%$ , and $4 4 \%$ lower forgetting relative to the best-performing SCL strategy on Split CIFAR-10, Split CIFAR-100, and Split Tiny-ImageNet, respectively. Surprisingly, FINETUNE with UCL achieves higher performance and significantly lower forgetting in comparison to all SCL strategies except DER. Furthermore, LUMP improves upon the UCL strategies: $2 . 8 \%$ and $5 . 9 \%$ relative increase in accuracy and $1 5 \%$ and $5 7 . 1 \%$ relative decrease in forgetting on Split CIFAR-100 and Split Tiny-ImageNet, respectively.
|
| 125 |
+
|
| 126 |
+
Evaluation on BarlowTwins. To verify that unsupervised representations are indeed more robust to catastrophic forgetting, we train BarlowTwins (Zbontar et al., 2021) on a sequence of tasks. We notice that the representations learned with BarlowTwins substantially improve the accuracy and forgetting over SCL: $7 1 . 4 \%$ , $6 9 . 7 \%$ and $7 3 . 2 \%$ decrease in forgetting with FINETUNE on Split CIFAR-10, Split CIFAR-100 and Split Tiny-ImageNet respectively. Similarly, we observe that SI, and DER are more robust to catastrophic forgetting; however, PNN underperforms on complicated tasks since feature accumulation using adaptor modules is insufficient to construct useful representations for current task adaptation. Interestingly, representations learnt with BarlowTwins achieve lower forgetting for FINETUNE, DER and LUMP than SimSiam with comparable accuracy across all the datasets.
|
| 127 |
+
|
| 128 |
+
Table 1: Accuracy and forgetting of the learnt representations on Split CIFAR-10, Split CIFAR-100 and Split Tiny-ImageNet on Resnet-18 architecture with KNN classifier (Wu et al., 2018). All the values are measured by computing mean and standard deviation across three trials. The best and second-best results are highlighted in bold and underline respectively.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>METHOD</td><td colspan="2">SPLIT CIFAR-10</td><td colspan="2">SPLIT CIFAR-100</td><td colspan="2">SPLIT TINY-IMAGENET</td></tr><tr><td colspan="7">ACCURACY FORGETTING ACCURACY FORGETTING ACCURACY FORGETTING</td></tr><tr><td colspan="7">SUPERVISED CONTINUAL LEARNING</td></tr><tr><td>FINETUNE</td><td>82.87 (± 0.47)</td><td>14.26 (± 0.52)</td><td>61.08 (± 0.04)</td><td>31.23 (± 0.41)</td><td>53.10 (± 1.37)</td><td>33.15 (± 1.22)</td></tr><tr><td>PNN (Rusu et al., 2016)</td><td>82.74 (± 2.12)</td><td></td><td>66.05 (±0.86)</td><td></td><td>64.38 (± 0.92)</td><td></td></tr><tr><td>SI (Zenke et al., 2017)</td><td>85.18 (± 0.65)</td><td>11.39 (± 0.77)</td><td>63.58 (± 0.37)</td><td>27.98 (± 0.34)</td><td>44.96 (± 2.41)</td><td>26.29 (± 1.40)</td></tr><tr><td>A-GEM (Chaudhry et al., 2019a)</td><td>82.41 (± 1.24)</td><td>13.82 (± 1.27)</td><td>59.81 (± 1.07)</td><td>30.08 (± 0.91)</td><td>60.45 (± 0.24)</td><td>24.94 (± 1.24)</td></tr><tr><td>Gss (Aljundi et al.,2019)</td><td>89.49 (± 1.75)</td><td>7.50 (± 1.52)</td><td>70.78 (± 1.67)</td><td>21.28 (± 1.52)</td><td>70.96 (± 0.72)</td><td>14.76 (± 1.22)</td></tr><tr><td>DER (Buzzega et al., 2020)</td><td>91.35 (± 0.46)</td><td>5.65 (± 0.35)</td><td>79.52 (± 1.88)</td><td>12.80 (± 1.47)</td><td>68.03 (±0.85)</td><td>17.74 (± 0.65)</td></tr><tr><td>MULTITASK</td><td>97.77 (± 0.15)</td><td></td><td>93.89 (±0.78)</td><td></td><td>91.79 (± 0.46)</td><td></td></tr><tr><td colspan="7">UNSUPERVISED CONTINUAL LEARNING</td></tr><tr><td colspan="7">FINETUNE PNN (Rusu et al., 2016)</td></tr><tr><td></td><td>90.11 (±0.12) 90.93 (± 0.22)</td><td>5.42 (±0.08)</td><td>75.42 (± 0.78)</td><td>10.19 (± 0.37)</td><td>71.07 (± 0.20)</td><td>9.48 (±0.56)</td></tr><tr><td>SIISIIN SI (Zenke et al., 2017)</td><td>92.75 (± 0.06)</td><td></td><td>66.58 (± 1.00)</td><td>5.54 (± 1.30)</td><td>62.15 (± 1.35) 72.34 (±0.42)</td><td></td></tr><tr><td>DER (Buzzega et al.,2020)</td><td>91.22 (± 0.30)</td><td>1.81 (± 0.21)</td><td>80.08 (± 1.30)</td><td></td><td>71.90 (± 1.44)</td><td>8.26 (± 0.64)</td></tr><tr><td>LUMP</td><td>91.00 (± 0.40)</td><td>4.63 (±0.26) 2.92 (± 0.53)</td><td>77.27 (± 0.30)</td><td>9.31 (± 0.09)</td><td></td><td>8.36 (± 2.06)</td></tr><tr><td></td><td></td><td></td><td>82.30 (± 1.35)</td><td>4.71 (± 1.52)</td><td>76.66 (± 2.39)</td><td>3.54 (± 1.04)</td></tr><tr><td>MULTITASK</td><td>95.76 (± 0.08)</td><td></td><td>86.31 (±0.38)</td><td></td><td>82.89 (± 0.49)</td><td></td></tr><tr><td colspan="7">FINETUNE</td></tr><tr><td>PNN (Rusu et al., 2016)</td><td>87.72 (± 0.32)</td><td>4.08 (± 0.56)</td><td>71.97 (± 0.54)</td><td>9.45 (± 1.01)</td><td>66.28 (± 1.23)</td><td>8.89 (±0.66)</td></tr><tr><td>SI (Zenke et al., 2017)</td><td>87.52 (± 0.33)</td><td></td><td>57.93 (± 2.98)</td><td></td><td>48.70 (± 2.59)</td><td></td></tr><tr><td>DER (Buzzega et al., 2020)</td><td>90.21 (± 0.08) 88.67 (± 0.24)</td><td>2.03 (±0.22)</td><td>75.04 (± 0.63)</td><td>7.43 (± 0.67)</td><td>56.96 (± 1.48)</td><td>17.04 (± 0.89)</td></tr><tr><td>LUMP</td><td></td><td>2.41 (± 0.26)</td><td>73.48 (± 0.53)</td><td>7.98 (± 0.29)</td><td>68.56 (± 1.47)</td><td>7.87 (± 0.44)</td></tr><tr><td>PPITSIITTIS</td><td>90.31 (± 0.30)</td><td>1.13 (± 0.18)</td><td>80.24 (± 1.04)</td><td>3.53 (± 0.83)</td><td>72.17 (± 0.89)</td><td>2.43 (± 1.00)</td></tr><tr><td>MULTITASK</td><td>95.48 (± 0.14)</td><td></td><td>87.16 (± 0.52)</td><td></td><td>82.42 (± 0.74)</td><td></td></tr><tr><td colspan="7">accuracy overdata size (h hrieteigreeere forgetting overdata size SCL-FT UCL-FT SCL-DER SCL-SI UCL-SI UCL-FT SCL-DER LUMP 10 UCL-SI LUMP 0.5</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Figure 2: Evaluation on Few-shot training for Split CIFAR-100 across different number of training instances per task. The results are measured across three independent trials.
|
| 133 |
+
Figure 3: CKA Feature similarity between two independent UCL models (red), two independent SCL models (blue), and UCL and SCL model (green) for different strategies on Split CIFAR-100 test distribution.
|
| 134 |
+
|
| 135 |
+
Evaluation on Few-shot training. Figure 2 compares the effect of few-shot training on UCL and SCL, where each task has a limited number of training instances. Specifically, we conduct the experimental evaluation using 100, 200, 500, and 2500 training instances for each task in split CIFAR-100 dataset. Surprisingly, we observe that the gap in average accuracy between SCL and UCL methods widens with a decrease in the number of training instances. Note that UCL decreases the accuracy by $1 5 . 7 8 \% p$ on average with lower forgetting when the number of training instances decreases from 2500 to 100; whereas, SCL obtains a severe $3 2 . 2 1 \% p$ deterioration in accuracy. We conjecture that this is an outcome of the discriminative feature embeddings learned by UCL, which discriminates all the images in the dataset and captures more than class-specific information as also observed in Doersch et al. (2020). Furthermore, LUMP improves the performance over all the baselines with a significant margin across all few-shot experiments.
|
| 136 |
+
|
| 137 |
+
Evaluation on OOD datasets. We evaluate the learnt representations on various out-of-distribution (OOD) datasets in Table 2 to measure their generalization to unseen data distributions. In particular, we conduct the OOD evaluation on MNIST (LeCun, 1998), Fashion-MNIST (FMNIST) (Xiao et al., 2017), SVHN (Netzer et al., 2011), CIFAR-10 and CIFAR-100 (Krizhevsky, 2012) using a KNN classifier (Wu et al., 2018). We observe that unsupervised representations outperform the supervised representations in all cases across all the datasets. In particular, the UCL representations learned with Simsiam, and SI on Split-CIFAR-10 improves the absolute performance over the best-performing SCL strategy by $4 . 5 8 \%$ , $6 . 0 9 \%$ , $1 5 . 2 6 \%$ , and $1 7 . 0 7 \%$ on MNIST, FMNIST, SVHN, and CIFAR-100 respectively. Further, LUMP trained on Split-CIFAR-100 outperforms SI across all datasets and obtains comparable performance with Split CIFAR-10 dataset.
|
| 138 |
+
|
| 139 |
+
Table 2: Comparison of accuracy on out of distribution datasets using a KNN classifier (Wu et al., 2018) on pretrained SCL and UCL representations. We consider MNIST (LeCun, 1998), Fashion-MNIST (FMNIST) (Xiao et al., 2017), SVHN (Netzer et al., 2011) as out of distribution for Split CIFAR-100 and Split CIFAR-10. All the values are measured by computing mean and standard deviation across three trials. The best and second-best results are highlighted in bold and underline respectively.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>IN-CLASS</td><td colspan="4">SPLIT CIFAR-10</td><td colspan="4">SPLIT CIFAR-100</td></tr><tr><td>OUT-OF-CLASS</td><td>MNIST</td><td>FMNIST</td><td>SVHN</td><td>CIFAR-100</td><td>MNIST</td><td>FMNIST</td><td>SVHN</td><td>CIFAR-10</td></tr><tr><td colspan="9">SUPERVISED CONTINUAL LEARNING</td></tr><tr><td>FINETUNE</td><td>86.42 (± 1.11)</td><td>74.47 (±0.84)4</td><td>41.00 (±0.85)</td><td>17.42 (± 0.96)</td><td>75.02 (±3.97)</td><td>62.37 (± 3.20)</td><td>38.05 (±0.73)</td><td>39.18 (± 0.83)</td></tr><tr><td>SI (Zenke et al., 2017)</td><td>87.08 (± 0.79)</td><td>76.41 (± 0.81)</td><td>42.62 (± 1.31)</td><td>19.14 (± 0.91)</td><td>79.96 (± 2.63)</td><td>63.71 (± 1.36)</td><td>40.92 (± 1.64)</td><td>40.41 (± 1.71)</td></tr><tr><td>A-GEM (Chaudhry et al., 2019a)</td><td>86.07 (± 1.94)</td><td>74.74(± 3.21)</td><td>37.77 (± 3.49)</td><td>16.11 (± 0.38)</td><td>77.56 (± 3.21)</td><td>64.16 (± 2.29)</td><td>37.48 (± 1.73)</td><td>37.91 (± 1.33)</td></tr><tr><td>Gss (Aljundi et al., 2019)</td><td>70.36 (± 3.54)</td><td>69.20 (± 2.51)</td><td>33.11 (± 2.26)</td><td>18.21 (± 0.39)</td><td>76.54 (± 0.46)</td><td>65.31 (± 1.72)</td><td>35.72 (± 2.37)</td><td>49.41 (± 1.81)</td></tr><tr><td>DER (Buzzega et al., 2020)</td><td>80.32 (± 1.91)</td><td>70.49 (± 1.54)</td><td>41.48 (± 2.76)</td><td>17.72 (± 0.25)</td><td>87.71 (± 2.23)</td><td>75.97 (± 1.29)</td><td>50.26 (± 0.95)</td><td>59.07 (± 1.06)</td></tr><tr><td>MULTITASK</td><td></td><td>88.79 (± 1.13) 79.50 (±0.52)41.26(± 1.95)</td><td></td><td>27.68 (±0.66)</td><td>92.29 (± 3.37)</td><td>86.12 (± 1.87)</td><td>54.94 (± 1.77)</td><td>54.04 (± 3.68)</td></tr><tr><td colspan="9">UNSUPERVISED CONTINUAL LEARNING</td></tr><tr><td>FINETUNE</td><td>89.23 (± 0.99)</td><td>80.05 (±0.34)</td><td>49.66 (±0.81)</td><td>34.52 (± 0.12)</td><td>85.99 (±0.86)</td><td>76.90 (± 0.11)</td><td>50.09 (± 1.41)</td><td>57.15 (± 0.96)</td></tr><tr><td>SI (Zenke et al., 2017)</td><td>93.72 (± 0.58)</td><td>82.50 (± 0.51)</td><td>57.88 (±0.16)</td><td>36.21 (±0.69)</td><td>91.50 (± 1.26)</td><td>80.57 (±0.93)</td><td>54.07 (± 2.73)</td><td>60.55 (± 2.54)</td></tr><tr><td>DER (Buzzega et al., 2020)</td><td>88.35 (±0.82)</td><td>79.33 (± 0.62)</td><td>48.83 (± 0.55))</td><td>30.68 (± 0.36)</td><td>87.96 (± 2.04)</td><td>76.21 (± 0.63)</td><td>47.70 (± 0.94)</td><td>56.26 (± 0.16)</td></tr><tr><td>WAISNIS LUMP</td><td>91.03 (± 0.22)</td><td>80.78 (±0.88)</td><td>45.18 (± 1.57)</td><td>31.17 (± 1.83)</td><td>91.76 (± 1.17)</td><td>81.61 (± 0.45)</td><td>50.13 (±0.71)</td><td>63.00 (±0.53)</td></tr><tr><td>MULTITASK</td><td>90.69 (± 0.13)</td><td>80.65 (±0.42)</td><td>47.67 (± 0.45)</td><td>39.55 (± 0.18)</td><td>90.35 (±0.24)</td><td>81.11 (± 1.86)</td><td>52.20 (± 0.61)</td><td>70.19 (± 0.15)</td></tr><tr><td>FINETUNE</td><td>86.86 (± 1.62)</td><td>78.37 (± 0.74)</td><td>44.64 (± 2.39)</td><td>28.03 (±0.52)</td><td>76.08 (± 2.86)</td><td>76.82 (±0.83)</td><td>42.95 (±0.90)</td><td>53.12 (± 0.13)</td></tr><tr><td>SI (Zenke et al., 2017)</td><td>90.31 (± 0.69)</td><td>80.58 (± 0.68)</td><td>49.18 (± 0.51)</td><td>31.80 (± 0.4)</td><td>85.24 (± 0.99)</td><td>78.82 (± 0.67)</td><td>45.18 (± 1.37)</td><td>53.99 (± 0.56)</td></tr><tr><td>DER (Buzzega et al.,2020)</td><td>85.15 (± 2.19)</td><td>77.96 (± 0.59)</td><td>45.68 (± 0.93)</td><td>27.83 (± 0.86)</td><td>78.08 (± 1.95)</td><td>76.67 (±0.68)</td><td>44.58 (± 1.01)</td><td>53.24 (±0.82)</td></tr><tr><td>LUMP</td><td>88.73 (± 0.54)</td><td>81.69 (± 0.45)</td><td>51.53(± 0.41)</td><td>31.53 (± 0.36)</td><td>90.22 (± 1.39)</td><td>81.28 (± 0.91)</td><td>50.24 (± 0.95)</td><td>60.76 (± 0.87)</td></tr><tr><td>PBPIIIITTIS MULTITASK</td><td>88.63 (± 1.38)</td><td>79.49 (± 0.29)</td><td>49.24 (± 2.44)</td><td>36.33 (±0.29)</td><td>86.98 (± 1.70)</td><td>79.40 (± 1.10)</td><td>50.19 (±0.81)</td><td>49.50 (± 0.38)</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 5.3 QUALITATIVE ANALYSIS
|
| 144 |
+
|
| 145 |
+
Similarity in feature and parameter space. We analyze the similarity between the representations learnt between (i) Two independent UCL models, (ii) Two independent SCL models (iii) SCL and UCL models using centered kernel alignment (CKA) (Kornblith et al., 2019) in Figure 3, which provides a score between 0 and 1 measuring the similarity between a pair of hidden representations. For two representations Θ1 : X → Rd1 and Θ2 : X → Rd1 , CKA(Θ1, Θ2) = ||Cov(Θ1(x),Θ2(x))||2F||Cov(Θ1(x))||F ·||Cov(Θ2(x))||F , where covariances are with respect to the test distribution. Additionally, we measure the $\ell _ { 2 }$ distance (Neyshabur et al., 2020) between the parameters of two independent UCL models (see Table 3) and two independent SCL models (see Table 4). First, we observe that the representations learned by two independent UCL methods have a high feature similarity and lower $\ell _ { 2 }$ distance compared to the two independent SCL methods, demonstrating UCL representations’ robustness. Second, we note that the representations between any two independent models are highly similar in the lower layers indicating that they learn similar high-level features, including edges and shapes; however, the features are dissimilar for the higher modules. Lastly, we see that the representations between a UCL and SCL model are similar in the lower layers but diverge in the higher layers across all CL strategies.
|
| 146 |
+
|
| 147 |
+
Visualization of feature space. Next, we visualize the learned features to dissect further the representations learned by UCL and SCL strategies. Figure 4 shows the visualization of the latent feature maps for tasks $\mathcal { T } _ { 0 }$ and $\mathcal { T } _ { 1 3 }$ after the completion of continual learning. For $\mathcal { T } _ { 0 }$ , we observe that the SCL methods are prone to catastrophic forgetting, as the features appear noisy and do not have coherent patterns. In contrast, the features learned by UCL strategies are perceptually relevant and robust to catastrophic forgetting, with LUMP learning the most distinctive features. Similar to $\mathcal { T } _ { 0 }$ , we observe that the UCL features are more relevant and distinguishable than SCL for $\mathcal { T } _ { 1 3 }$ . Note that we randomly selected the examples and feature maps for all visualizations.
|
| 148 |
+
|
| 149 |
+
Loss landscape visualization. To gain further insights, we visualize the loss landscape of task $\mathcal { T } _ { 0 }$ after the completion of training on task $\mathcal { T } _ { 0 }$ and $\mathcal { T } _ { 1 9 }$ for various UCL and SCL strategies in Figure 5. We measure the cross-entropy loss for all methods with a randomly initialized linear classifier for a fair evaluation of two different directions. We use the visualization tool from Li et al. (2018) that searches the task loss surface by repeatedly adding random perturbations to model weights. We observe that the loss landscape after $\mathcal { T } _ { 0 }$ looks quite similar across all the strategies since the forgetting does not exist yet. However, after training $\mathcal { T } _ { 1 9 }$ , there is a clear difference with the UCL strategies obtaining a flatter and smoother loss landscape because UCL methods are more stable and robust to the forgetting, which hurts the loss landscapes of past tasks for SCL. It is important to observe that LUMP obtains a smoother landscape than other UCL strategies, demonstrating its effectiveness. We defer further analyses for feature and loss landscape visualization to Appendix A.2.
|
| 150 |
+
|
| 151 |
+
Table 3: $\ell _ { 2 }$ distance between UCL parameters after completion of training.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>MODEL</td><td>FINETUNE</td><td>S1</td><td>DER</td><td>MULTITASK</td></tr><tr><td>FINETUNE</td><td>60.00 (± 1.70)</td><td></td><td></td><td></td></tr><tr><td>SI</td><td>76.46 (± 0.48)</td><td>92.35 (± 0.61)</td><td></td><td></td></tr><tr><td>DER</td><td>55.60 (± 1.42)</td><td>75.54 (± 0.97)</td><td>48.76 (± 1.54)</td><td></td></tr><tr><td>MULTITASK</td><td>61.32 (± 0.59)</td><td>79.95 (± 0.40)</td><td>57.90 (± 0.86)</td><td>61.42 (± 0.78)</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 4: $\ell _ { 2 }$ distance between SCL paraneters after completion of training.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>MODEL</td><td>FINETUNE</td><td>SI</td><td>DER</td><td>MULTITASK</td></tr><tr><td>FINETUNE</td><td>183.31 (± 0.10)</td><td></td><td></td><td></td></tr><tr><td>SI</td><td>206.16 (± 0.28)</td><td>226.05 (± 0.13)</td><td></td><td></td></tr><tr><td>DER</td><td>202.61 (± 0.46)</td><td>224.78 (± 0.75)</td><td>219.06 (± 0.27)</td><td></td></tr><tr><td>MULTITASK</td><td>258.12 (± 0.26)</td><td>277.30 (± 0.69)</td><td>271.48 (± 0.45)</td><td>314.84 (± 0.92)</td></tr></table>
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 4: Visualization of feature maps for the second block representations learnt by SCL and UCL strategies (with Simsiam) for ResNet-18 architecture after the completion of CL for Split CIFAR-100 dataset $( n = 2 0 )$ ).
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 5: Loss landscape visualization of $\mathcal { T } _ { 0 }$ after the completion of training on task $\mathcal { T } _ { 0 }$ (top) and $\mathcal { T } _ { 1 9 }$ (bottom) for Split CIFAR-100 dataset on ResNet-18 architecture. We use Simsiam for UCL methods.
|
| 164 |
+
|
| 165 |
+
# 6 DISCUSSION AND CONCLUSION
|
| 166 |
+
|
| 167 |
+
This work attempts to bridge the gap between unsupervised representation learning and continual learning. In particular, we establish the following findings for unsupervised continual learning.
|
| 168 |
+
|
| 169 |
+
Surpassing supervised continual learning. Our empirical evaluation across various CL strategies and datasets shows that UCL representations are more robust to catastrophic forgetting than SCL representations. Furthermore, we notice that UCL generalizes better to OOD tasks and achieves stronger performance on few-shot learning tasks. We propose Lifelong unsupervised mixup (LUMP), which interpolates the unsupervised instances between the current task and past task and obtains higher performance with lower catastrophic forgetting across a wide range of tasks.
|
| 170 |
+
|
| 171 |
+
Dissecting the learned representations. We conduct a systematic analysis to understand the differences between the representations learned by UCL and SCL strategies. By investigating the similarity between the representations, we observe that UCL and SCL strategies have high similarities in the lower layers but are dissimilar in the higher layers. We also show that UCL representations learn coherent and discriminative patterns and smoother loss landscape than SCL.
|
| 172 |
+
|
| 173 |
+
Limitations and future work. In this work, we do not consider the high-resolution tasks for CL. We intend to evaluate the forgetting of the learnt representations on ImageNet (Deng et al., 2009) in future work, since UCL shows lower catastrophic forgetting and representation learning has made significant progress on ImageNet over the past years. In follow-up work, we intend to conduct further analysis to understand the behavior of UCL and develop sophisticated methods to continually learn unsupervised representations under various setups, such as class-incremental or task-agnostic CL.
|
| 174 |
+
|
| 175 |
+
# ACKNOWLEDGEMENTS
|
| 176 |
+
|
| 177 |
+
We thank the anonymous reviewers for their insightful comments and suggestions. This work was supported by Microsoft Research Asia, the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF2018R1A5A1059921), Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019-0-00075, Artificial Intelligence Graduate School Program (KAIST) and 2021-0-01696). 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 funding agencies.
|
| 178 |
+
|
| 179 |
+
# AUTHOR CONTRIBUTIONS
|
| 180 |
+
|
| 181 |
+
Divyam Madaan conceived of the presented idea, developed the experimental framework, carried out OOD evaluation, CKA visualization and took the lead in writing the manuscript. Jaehong Yoon performed the hyperparameter search, carried out the visualization of loss landscape and feature maps and performed the few-shot training analysis. Yuanchun Li, Yunxin Liu, and Sung Ju Hwang supervised the project.
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Hongjoon Ahn, Sungmin Cha, Donggyu Lee, and Taesup Moon. Uncertainty-based continual learning with adaptive regularization. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 186 |
+
|
| 187 |
+
Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 188 |
+
|
| 189 |
+
Horace Barlow. Possible principles underlying the transformations of sensory messages. 1961.
|
| 190 |
+
|
| 191 |
+
Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D. Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, Xin Zhang, Jake Zhao, and Karol Zieba. End to end learning for self-driving cars. arXiv preprint arXiv:1604.07316, 2016.
|
| 192 |
+
|
| 193 |
+
Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a "siamese" time delay neural network. 1994.
|
| 194 |
+
|
| 195 |
+
Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 196 |
+
|
| 197 |
+
Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 198 |
+
|
| 199 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. In Proceedings of the International Conference on Learning Representations (ICLR), 2019a.
|
| 200 |
+
|
| 201 |
+
Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K Dokania, Philip HS Torr, and M Ranzato. Continual learning with tiny episodic memories. arXiv preprint arXiv:1902.10486, 2019b.
|
| 202 |
+
|
| 203 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Proceedings of the International Conference on Machine Learning (ICML), 2020a.
|
| 204 |
+
|
| 205 |
+
Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. In Advances in Neural Information Processing Systems (NeurIPS), 2020b.
|
| 206 |
+
|
| 207 |
+
Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 208 |
+
|
| 209 |
+
Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020c.
|
| 210 |
+
|
| 211 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition (CVPR), 2009.
|
| 212 |
+
|
| 213 |
+
Carl Doersch, Ankush Gupta, and Andrew Zisserman. Crosstransformers: spatially-aware few-shot transfer. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 214 |
+
|
| 215 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the International Conference on Machine Learning (ICML), 2017.
|
| 216 |
+
|
| 217 |
+
Timo Flesch, Jan Balaguer, Ronald Dekker, Hamed Nili, and Christopher Summerfield. Comparing continual task learning in minds and machines. Proceedings of the National Academy of Sciences, 2018.
|
| 218 |
+
|
| 219 |
+
Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013.
|
| 220 |
+
|
| 221 |
+
Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, koray kavukcuoglu, Remi Munos, and Michal Valko. Bootstrap your own latent - a new approach to self-supervised learning. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 222 |
+
|
| 223 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 224 |
+
|
| 225 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 226 |
+
|
| 227 |
+
Christopher J Kelly, Alan Karthikesalingam, Mustafa Suleyman, Greg Corrado, and Dominic King. Key challenges for delivering clinical impact with artificial intelligence. BMC medicine, 2019.
|
| 228 |
+
|
| 229 |
+
Sungnyun Kim, Gihun Lee, Sangmin Bae, and Se-Young Yun. Mixco: Mix-up contrastive learning for visual representation. arXiv preprint arXiv:2010.06300, 2020.
|
| 230 |
+
|
| 231 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In Proceedings of the International Conference on Machine Learning (ICML). PMLR, 2019.
|
| 232 |
+
|
| 233 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. University of Toronto, 05 2012.
|
| 234 |
+
|
| 235 |
+
Abhishek Kumar and Hal Daume III. Learning task grouping and overlap in multi-task learning. In Proceedings of the International Conference on Machine Learning (ICML), 2012.
|
| 236 |
+
|
| 237 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 238 |
+
|
| 239 |
+
Kibok Lee, Yian Zhu, Kihyuk Sohn, Chun-Liang Li, Jinwoo Shin, and Honglak Lee. i-mix: A domain-agnostic strategy for contrastive representation learning. In ICLR, 2021.
|
| 240 |
+
|
| 241 |
+
Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 242 |
+
|
| 243 |
+
Xilai Li, Yingbo Zhou, Tianfu Wu, Richard Socher, and Caiming Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. In Proceedings of the International Conference on Machine Learning (ICML), 2019.
|
| 244 |
+
|
| 245 |
+
Yuanpeng Li, Liang Zhao, Kenneth Church, and Mohamed Elhoseiny. Compositional language continual learning. In Proceedings of the International Conference on Learning Representations (ICLR), 2020.
|
| 246 |
+
|
| 247 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. In Proceedings of the European Conference on Computer Vision (ECCV), 2016.
|
| 248 |
+
|
| 249 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation. 1989.
|
| 250 |
+
|
| 251 |
+
Seyed Iman Mirzadeh, Mehrdad Farajtabar, Razvan Pascanu, and Hassan Ghasemzadeh. Understanding the role of training regimes in continual learning. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 252 |
+
|
| 253 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 254 |
+
|
| 255 |
+
Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning? In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 256 |
+
|
| 257 |
+
Dushyant Rao, Francesco Visin, Andrei Rusu, Razvan Pascanu, Yee Whye Teh, and Raia Hadsell. Continual unsupervised representation learning. In Advances in Neural Information Processing Systems, 2019.
|
| 258 |
+
|
| 259 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 260 |
+
|
| 261 |
+
David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy Lillicrap, and Gregory Wayne. Experience replay for continual learning. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 262 |
+
|
| 263 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
|
| 264 |
+
|
| 265 |
+
Jonathan Schwarz, Jelena Luketina, Wojciech M Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In Proceedings of the International Conference on Machine Learning (ICML), 2018.
|
| 266 |
+
|
| 267 |
+
Zhiqiang Shen, Zechun Liu, Zhuang Liu, Marios Savvides, Trevor Darrell, and Eric Xing. Un-mix: Rethinking image mixtures for unsupervised visual representation learning. In Proceedings of the AAAI National Conference on Artificial Intelligence (AAAI), 2022.
|
| 268 |
+
|
| 269 |
+
James Smith, Cameron Taylor, Seth Baer, and Constantine Dovrolis. Unsupervised progressive learning and the stam architecture. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), 2021.
|
| 270 |
+
|
| 271 |
+
Sebastian Thrun. A Lifelong Learning Perspective for Mobile Robot Control. Elsevier, 1995.
|
| 272 |
+
|
| 273 |
+
Vikas Verma, Thang Luong, Kenji Kawaguchi, Hieu Pham, and Quoc Le. Towards domain-agnostic contrastive learning. In Proceedings of the International Conference on Machine Learning (ICML), 2021.
|
| 274 |
+
|
| 275 |
+
Zhirong Wu, Yuanjun Xiong, Stella X. Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 276 |
+
|
| 277 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 278 |
+
|
| 279 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 280 |
+
|
| 281 |
+
Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. In Proceedings of the International Conference on Machine Learning (ICML), 2021.
|
| 282 |
+
|
| 283 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of the International Conference on Machine Learning (ICML), 2017.
|
| 284 |
+
|
| 285 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 286 |
+
|
| 287 |
+
Linjun Zhang, Zhun Deng, Kenji Kawaguchi, Amirata Ghorbani, and James Zou. How does mixup help with robustness and generalization? In Proceedings of the International Conference on Learning Representations (ICLR), 2021.
|
| 288 |
+
|
| 289 |
+
# A SUPPLEMENTARY MATERIAL
|
| 290 |
+
|
| 291 |
+
Organization. In the supplementary material, we provide the implementation details followed by the hyper-parameter configurations in Appendix A.1. Further, we show the other experiments we conducted and additional visualizations and results in Appendix A.2.
|
| 292 |
+
|
| 293 |
+
# A.1 EXPERIMENTAL DETAILS
|
| 294 |
+
|
| 295 |
+
Implementations. We use the DER (Buzzega et al., 2020) open-source codebase1 for all the experiments. In particular, we reproduce all their experimental results for supervised continual learning and use various models with their set of hyper-parameters as our baselines. We follow the original representations for $\mathrm { S i m } \mathrm { S i a m } ^ { 2 }$ and BarlowTwins3 for unsupervised continual learning. We verify our implementation by reproducing the reported results on CIFAR-10 in the original paper, where we train the representations on the complete CIFAR-10 dataset and evaluate on the test-set using KNN classifier (Wu et al., 2018). In particular, (Wu et al., 2018) stores the features for each instance in the task-level training set in a discrete memory bank. The optimal feature-level embeddings are then learned by instance-level discrimination, which maximally scatters the features of the training samples. Following prior works in representation learning, we use the task-level training set without any augmentation in the task-incremental setup for the supervised and unsupervised KNN evaluation.
|
| 296 |
+
|
| 297 |
+
Hyperparameter configurations. We use the tuned hyper-parameters reported by Buzzega et al. (2020) for all the SCL experiments. On the other hand, we tune the hyper-parameters for continual learning strategies for UCL. We provide the hyper-parameters setup for UCL for different datasets in Table A.5. We train all the UCL methods with a batch size of 256 for 200 epochs, while training the SCL methods with a batch size of 32 for 50 epochs following Buzzega et al. (2020). We observed that training the SCL methods further lead to a degredation in performance for all the methods. We use the same set of augmentations for both SCL and UCL except that we use RandomResizedCrop with scale in [0.2, 1.0] for UCL (Wu et al., 2018; Chen & He, 2021) and RandomCrop for SCL. For rehearsal-based methods, we use the buffer size 200 for Split CIFAR-10, Split CIFAR-100 and 256 for Split Tiny-ImageNet dataset. We use a learning rate of 0.03 for SGD optimizer with weight decay 5e-4 and momentum 0.9.
|
| 298 |
+
|
| 299 |
+
Table A.5: Hyperparameter configurations for all the datasets on ResNet-18 architecture.
|
| 300 |
+
|
| 301 |
+
<table><tr><td>METHOD</td><td>SPLIT CIFAR-10</td><td>SPLIT CIFAR-100</td><td>SEQ.TINY-IMAGENET</td></tr><tr><td>S1</td><td>c : 100 m:1</td><td>c : 0.1 m:1</td><td>c : 0.01 m:1</td></tr><tr><td>PNN</td><td>wd : 64</td><td>wd : 12</td><td>wd : 8</td></tr><tr><td>DER</td><td>α : 0.1</td><td>α : 0.1</td><td>α : 0.01</td></tr><tr><td>LUMP</td><td>入: 0.1</td><td>入: 0.1</td><td>入: 0.4</td></tr></table>
|
| 302 |
+
|
| 303 |
+
# A.2 ADDITIONAL EXPERIMENTS
|
| 304 |
+
|
| 305 |
+
We provide additional loss landscape on Split CIFAR-100 in Figure A.6 and Figure A.7, Figure A.8 show the second and third block feature visualizations on Split CIFAR-100 respectively. Figure A.9 shows the feature visualizations for Split Tiny-ImageNet on ResNet-18 architecture.
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure A.6: Loss landscape visualization of $\mathcal { T } _ { 0 }$ after the completion of training on task $\mathcal { T } _ { 0 } , \mathcal { T } _ { 1 7 } , \mathcal { T } _ { 1 8 }$ , and $\mathcal { T } _ { 1 9 }$ for Split CIFAR-100 dataset on ResNet-18 architecture. We use Simsiam for UCL methods.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure A.7: Visualization of feature maps for the second block representations learnt by SCL and UCL strategies (with Simsiam) for Resnet-18 architecture after the completion of continual learning for Split CIFAR-100 dataset $n = 2 0$ ). The accuracy is the mean across three runs for the corresponding task.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure A.8: Visualization of feature maps for the third block representations learnt by SCL and UCL strategies (with Simsiam) for Resnet-18 architecture after the completion of continual learning for Split CIFAR-100 dataset $n = 2 0$ ). The accuracy is the mean across three runs for the corresponding task.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure A.9: Visualization of feature maps for the second block representations learnt by SCL and UCL strategies (with Simsiam) for Resnet-18 architecture after the completion of continual learning for Split Tiny-ImageNet dataset $n = 2 0$ ). The accuracy is the mean across three runs for the corresponding task.
|
md/dev/FQOC5u-1egI/FQOC5u-1egI.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/GQcB1D2bxSC/GQcB1D2bxSC.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/GQjaI9mLet/GQjaI9mLet.md
ADDED
|
@@ -0,0 +1,493 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INDEPENDENT SE(3)-EQUIVARIANT MODELS FOREND-TO-END RIGID PROTEIN DOCKING
|
| 2 |
+
|
| 3 |
+
Octavian-Eugen Ganea†∗ MIT
|
| 4 |
+
|
| 5 |
+
Xinyuan Huang§∗ ETH Zurich
|
| 6 |
+
|
| 7 |
+
Charlotte Bunne ETH Zurich
|
| 8 |
+
|
| 9 |
+
Yatao Bian† Tencent AI Lab
|
| 10 |
+
|
| 11 |
+
Regina Barzilay MIT
|
| 12 |
+
|
| 13 |
+
Tommi Jaakkola MIT
|
| 14 |
+
|
| 15 |
+
Andreas Krause ETH Zurich
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
Protein complex formation is a central problem in biology, being involved in most of the cell’s processes, and essential for applications, e.g. drug design or protein engineering. We tackle rigid body protein-protein docking, i.e., computationally predicting the 3D structure of a protein-protein complex from the individual unbound structures, assuming no conformational change within the proteins happens during binding. We design a novel pairwise-independent SE(3)-equivariant graph matching network to predict the rotation and translation to place one of the proteins at the right docked position relative to the second protein. We mathematically guarantee a basic principle: the predicted complex is always identical regardless of the initial locations and orientations of the two structures. Our model, named EQUIDOCK, approximates the binding pockets and predicts the docking poses using keypoint matching and alignment, achieved through optimal transport and a differentiable Kabsch algorithm. Empirically, we achieve significant running time improvements and often outperform existing docking software despite not relying on heavy candidate sampling, structure refinement, or templates.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
In a recent breakthrough, ALPHAFOLD 2 (Jumper et al., 2021; Senior et al., 2020) provides a solution to a grand challenge in biology—inferring a protein’s three-dimensional structure from its amino acid sequence (Baek et al., 2021), following the dogma sequence determines structure.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Different views of the 3D structure of a protein complex. a. Surface and b. cartoon view of protein Z and its inhibitor.
|
| 27 |
+
|
| 28 |
+
Besides their complex three-dimensional nature, proteins dynamically alter their function and structure in response to cellular signals, changes in the environment, or upon molecular docking. In par
|
| 29 |
+
|
| 30 |
+
ticular, protein interactions are involved in various biological processes including signal transduction, protein synthesis, DNA replication and repair. Molecular docking is key to understanding protein interactions’ mechanisms and effects, and, subsequently, to developing therapeutic interventions.
|
| 31 |
+
|
| 32 |
+
We here address the problem of rigid body protein-protein docking which refers to computationally predicting the 3D structure of a protein-protein complex given the 3D structures of the two proteins in unbound state. Rigid body means no deformations occur within any protein during binding, which is a realistic assumption in many biological settings.
|
| 33 |
+
|
| 34 |
+
Popular docking software (Chen et al., 2003; Venkatraman et al., 2009; De Vries et al., 2010; Torchala et al., 2013; Schindler et al., 2017; Sunny and Jayaraj, 2021) are typically computationally expensive, taking between minutes and hours to solve a single example pair, while not being guaranteed to find accurate complex structures. These methods largely follow the steps: i.) randomly sample a large number (e.g., millions) of candidate initial complex structures, ii.) employ a scoring function to rank the candidates, iii.) adjust and refine the top complex structures based on an energy model (e.g., force field). We here take a first step towards tackling these issues by using deep learning models for direct prediction of protein complex structures.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: Same output guarantee of EQUIDOCK. We predict a rigid transformation to place the ligand in the binding location w.r.t the receptor. We mathematically guarantee to output the same complex structure — up to an SE(3) transformation — independently of the initial unbound positions, rotations, or roles of both constituents. (RMSD $=$ Root-mean-square deviation of atomic positions)
|
| 38 |
+
|
| 39 |
+
Contributions. We design EQUIDOCK, a fast, end-to-end method for rigid body docking that directly predicts the SE(3) transformation to place one of the proteins (ligand) at the right location and orientation with respect to the second protein (receptor). Our method is based on the principle that the exact same complex structure should be predicted irrespectively of the initial 3D placements and roles of both constituents (see Fig. 2). We achieve this desideratum by incorporating the inductive biases of pairwise SE(3)–equivariance and commutativity, and deriving novel theoretical results for necessary and sufficient model constraints (see Section 3). Next, we create EQUIDOCK to satisfy these properties by design, being a combination of: i) a novel type of pairwise independent SE(3)-equivariant graph matching networks, ii) an attention-based keypoint selection algorithm that discovers representative points and aligns them with the binding pocket residues using optimal transport, and iii) a differentiable superimposition model to recover the optimal global rigid transformation. Unlike prior work, our method does not use heavy candidate sampling or ranking, templates, task-specific geometric or chemical hand-crafted features, or pre-computed meshes. This enables us to achieve plausible structures with a speed-up of $8 0 - 5 0 0 \mathrm { x }$ compared to popular docking software, offering a promising competitive alternative to current solutions for this problem.
|
| 40 |
+
|
| 41 |
+
# 2 RELATED WORK
|
| 42 |
+
|
| 43 |
+
Geometric Deep Learning. Graph Neural Networks (GNNs) are becoming the de facto choice for learning with graph data (Bruna et al., 2013; Defferrard et al., 2016; Kipf and Welling, 2016; Gilmer et al., 2017; Xu et al., 2018; Li et al., 2019). Motivated by symmetries naturally occurring in different data types, architectures are tailored to explicitly incorporate such properties (Cohen and Welling, 2016a;b; Thomas et al., 2018; Fuchs et al., 2020; Finzi et al., 2020; Eismann et al., 2020; Satorras et al., 2021). GNNs are validated in a variety of tasks such as particle system dynamics or conformation-based energy estimation (Weiler and Cesa, 2019; Rezende et al., 2019).
|
| 44 |
+
|
| 45 |
+
Euclidean Neural Networks (E(3)-NNs). However, plain GNNs and other deep learning methods do not understand data naturally lying in the 3D Euclidean space. For example, how should the output deterministically change with the input, e.g. when it is rotated ? The recent Euclidean neural networks address this problem, being designed from geometric first-principles. They make use of SE(3)- equivariant and invariant neural layers, thus avoiding expensive data augmentation strategies. Such constrained models ease optimization and have shown important improvements in biology or chemistry – e.g. for molecular structures (Fuchs et al., 2020; Hutchinson et al., 2020; Wu et al., 2021;
|
| 46 |
+
|
| 47 |
+
Jumper et al., 2021; Ganea et al., 2021) and different types of 3D point clouds (Thomas et al., 2018). Different from prior work, we here derive constraints for pairs of 3D objects via pairwise independent SE(3)-equivariances, and design a principled approach for modeling rigid body docking.
|
| 48 |
+
|
| 49 |
+
Protein Folding. Deep neural networks have been used to predict inter-residue contacts, distance and/or orientations (Adhikari and Cheng, 2018; Yang et al., 2020; Senior et al., 2020; Ju et al., 2021), that are subsequently transformed into additional constraints or differentiable energy terms for protein structure optimization. ALPHAFOLD 2 (Jumper et al., 2021) and Rosetta Fold (Baek et al., 2021) are state-of-the-art approaches, and directly predict protein structures from co-evolution information embedded in homologous sequences, using geometric deep learning and E(3)-NNs.
|
| 50 |
+
|
| 51 |
+
Protein-Protein Docking and Interaction. Experimentally determining structures of protein complexes is often expensive and time-consuming, rendering a premium on computational methods (Vakser, 2014). Protein docking methods (Chen et al., 2003; Venkatraman et al., 2009; De Vries et al., 2010; Biesiada et al., 2011; Torchala et al., 2013; Schindler et al., 2017; Weng et al., 2019; Sunny and Jayaraj, 2021; Christoffer et al., 2021; Yan et al., 2020) typically run several steps: first, they sample thousands or millions of complex candidates; second, they use a scoring function for ranking (Moal et al., 2013; Basu and Wallner, 2016; Launay et al., 2020; Eismann et al., 2020); finally, top-ranked candidates undergo a structure refinement process using energy or geometric models (Verburgt and Kihara, 2021). Relevant to protein-protein interaction (PPI) is the task of protein interface prediction where GNNs have showed promise (Fout et al., 2017; Townshend et al., 2019; Liu et al., 2020; Xie and Xu, 2021; Dai and Bailey-Kellogg, 2021). Recently, ALPHAFOLD 2 and ROSETTAFOLD have been utilized as subroutines to improve PPIs from different aspects (Humphreys et al., 2021; Pei et al., 2021; Jovine), e.g., combining physics-based docking method CLUSPRO (Kozakov et al., 2017; Ghani et al., 2021), or using extended multiple-sequence alignments to predict the structure of heterodimeric protein complexes from the sequence information (Bryant et al., 2021). Concurrently to our work, Evans et al. (2021) extend ALPHAFOLD 2 to multiple chains during both training and inference.
|
| 52 |
+
|
| 53 |
+
Drug-Target Interaction (DTI). DTI aims to compute drug-target binding poses and affinity, playing an essential role in understanding drugs’ mechanism of action. Prior methods (Wallach et al., 2015; Li et al., 2021) predict binding affinity from protein-ligand co-crystal structures, but such data is expensive to obtain experimentally. These models are typically based on heavy candidate sampling and ranking (Trott and Olson, 2010; Koes et al., 2013; McNutt et al., 2021; Bao et al., 2021), being tailored for small drug-like ligands and often assuming known binding pocket. Thus, they are not immediately applicable to our use case. In contrast, our rigid docking approach is generic and could be extended to accelerate DTI research as part of future work.
|
| 54 |
+
|
| 55 |
+
# 3 MATHEMATICAL CONSTRAINTS FOR RIGID BODY DOCKING
|
| 56 |
+
|
| 57 |
+
We start by introducing the rigid body docking problem and derive the geometric constraints for enforcing same output complex prediction regardless of the initial unbound positions or roles (Fig. 2).
|
| 58 |
+
|
| 59 |
+
Rigid Protein-Protein Docking – Problem Setup. We are given as input a pair of proteins forming a complex. They are (arbitrarily) denoted as the ligand and receptor, consisting of $n$ and $m$ residues, respectively. These proteins are represented in their bound (docked) state as 3D point clouds $\mathbf { X } _ { 1 } ^ { * } \in \mathbb { R } ^ { 3 \times n }$ , $\mathbf { X } _ { 2 } ^ { \ast } \in \mathbb { R } ^ { 3 \times m }$ , where each residue’s location is given by the coordinates of its corresponding $\alpha$ -carbon atom. In the unbound state, the docked ligand is randomly rotated and translated in space, resulting in a modified point cloud $\mathbf { X } _ { 1 } \in \mathbb { R } ^ { 3 \times n }$ . For simplicity and w.l.o.g., the receptor remains in its bound location ${ \bf X } _ { 2 } = { \bf X } _ { 2 } ^ { * }$ .
|
| 60 |
+
|
| 61 |
+
The task is to predict a rotation $\mathbf { R } \in S O ( 3 )$ and a translation $\mathbf { t } \in \mathbb { R } ^ { 3 }$ such that $\mathbf { R } \mathbf { X } _ { 1 } + \mathbf { t } = \mathbf { X } _ { 1 } ^ { * }$ using as input the proteins and their unbound positions $\mathbf { X } _ { 1 }$ and $\mathbf { X } _ { 2 }$ .
|
| 62 |
+
|
| 63 |
+
Here, $\mathbf { R } = \mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ and $\mathbf { t } = \mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ are functions of the two proteins, where we omit residue identity or other protein information in this notation, for brevity.
|
| 64 |
+
|
| 65 |
+
Note that we assume rigid backbone and side-chains for both proteins. We therefore do not tackle the more challenging problem of flexible docking, but our approach offers an important step towards it.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: Details on EQUIDOCK’s Architecture and Losses. a. The message passing operations in KÉÏIEGMN guarantee pairwise independent SE(3)-equivariance as in Eq. (4), b. We predict keypoints for HÉeach protein that are aligned with the binding pocket location using an additional optimal transport ËÏÊï PIRtb ÉLÉÏ r.tt ï ÉLÉÏITE ï(OT) loss, c. After predicting the docked position, we compute an MSE loss on the ligand, as well as a loss to discourage body intersections.
|
| 69 |
+
|
| 70 |
+
We desire that the predicted complex structure is independent of the initial locations and orientations of the two proteins, as well as of their roles – see Fig. 2. Formally, we wish to guarantee that:
|
| 71 |
+
|
| 72 |
+
$\begin{array} { r l r } & { } & { \left( { \bf R } ( { \bf Z } _ { 1 } | { \bf Z } _ { 2 } ) { \bf Z } _ { 1 } + { \bf t } ( { \bf Z } _ { 1 } | { \bf Z } _ { 2 } ) \right) \oplus { \bf Z } _ { 2 } \equiv \left( { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf X } _ { 1 } + { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) \right) \oplus { \bf X } _ { 2 } , \quad ( { \bf t } ( { \bf X } _ { 2 } ) \mid { \bf X } _ { 2 } ) = { \bf 0 } , } \\ & { } & { \left( { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf X } _ { 1 } + { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) \right) \oplus { \bf X } _ { 2 } \equiv { \bf X } _ { 1 } \oplus \left( { \bf R } ( { \bf X } _ { 2 } | { \bf X } _ { 1 } ) { \bf X } _ { 2 } + { \bf t } ( { \bf X } _ { 2 } | { \bf X } _ { 1 } ) \right) , } \\ & { } & { \forall { \bf Q } _ { 1 } , { \bf Q } _ { 2 } \in S O ( 3 ) , \forall { \bf g } _ { 1 } , { \bf g } _ { 2 } \in { \mathbb R } ^ { 3 } , \forall { \bf X } _ { 1 } \in { \mathbb R } ^ { 3 \times n } , { \bf X } _ { 2 } \in { \mathbb R } ^ { 3 \times m } , \ \mathrm { a n d } { \bf Z } _ { l } = { \bf G } _ { 3 } . } \end{array}$ (SE(3)-invariance) (commutativity) ${ \bf Z } _ { l } = { \bf Q } _ { l } { \bf X } _ { l } + { \bf g } _ { l } , l \in \{ 1 , 2 \}$ for any rotations $\mathbf { Q } _ { 1 } , \mathbf { Q } _ { 2 }$ and translations $\mathbf { g } _ { 1 } , \mathbf { g } _ { 2 }$ , where $\oplus$ is concatenation along columns, and $\equiv$ denotes identity after superimposition, i.e. zero Root-Mean-Square Deviation (RMSD) between the two 3D point sets after applying the Kabsch algorithm (Kabsch, 1976). An immediate question arises:
|
| 73 |
+
|
| 74 |
+
How do the constraints in Eq. (1) translate into constraints for $\mathbf { R } ( \cdot | \cdot )$ and $\mathbf { t } ( \cdot | \cdot )$ ?
|
| 75 |
+
|
| 76 |
+
The rotation $\mathbf { R }$ and translation t change in a systematic way when we apply $S E ( 3 )$ transformations or swap proteins’ roles. These properties restrict our class of functions as derived below.
|
| 77 |
+
|
| 78 |
+
SE(3)-equivariance Constraints. If we apply any distinct $S E ( 3 )$ transformations on the unbound ligand $\mathbf { X } _ { 1 }$ and receptor $\mathbf { X } _ { 2 }$ , i.e. we dock $\mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 }$ onto $\mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 }$ , then the rotation matrix $\mathbf { R } ( \mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 } | \mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 } )$ and translation vector $\mathbf { t } ( \mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 } | \mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 } )$ can be derived from the original $\mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ and $\mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ assuming that we always do rotations first. In this case, $\mathbf { R } ( \mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 } | \mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 } )$ can be decomposed into three rotations: i.) apply $\mathbf { Q } _ { 1 } ^ { \top }$ to undo the rotation $\mathbf { Q } _ { 1 }$ applied on $\mathbf { X } _ { 1 }$ , ii.) apply ${ \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } )$ , iii.) apply $\mathbf { Q } _ { 2 }$ to rotate the docked ligand together with the receptor. This gives ${ \bf R } ( { \bf Q } _ { 1 } { \bf X } _ { 1 } + { \bf g } _ { 1 } | { \bf Q } _ { 2 } { \bf X } _ { 2 } + { \bf g } _ { 2 } ) = { \bf Q } _ { 2 } { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf Q } _ { 1 } ^ { \top }$ , which in turn constraints the translation vector. We provide a formal statement and prove it in Appendix B.1:
|
| 79 |
+
|
| 80 |
+
Proposition 1. For any $\mathbf { Q } _ { 1 } , \mathbf { Q } _ { 2 } \in S O ( 3 ) , \mathbf { g } _ { 1 } , \mathbf { g } _ { 2 } \in \mathbb { R } ^ { 3 }$ , $S E ( 3 )$ -invariance of the predicted docked complex defined by Eq. (1) is guaranteed iff
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r l } & { { \bf R } ( { \bf Q } _ { 1 } { \bf X } _ { 1 } + { \bf g } _ { 1 } | { \bf Q } _ { 2 } { \bf X } _ { 2 } + { \bf g } _ { 2 } ) = { \bf Q } _ { 2 } { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf Q } _ { 1 } ^ { \top } } \\ & { { \bf t } ( { \bf Q } _ { 1 } { \bf X } _ { 1 } + { \bf g } _ { 1 } | { \bf Q } _ { 2 } { \bf X } _ { 2 } + { \bf g } _ { 2 } ) = { \bf Q } _ { 2 } { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) - { \bf Q } _ { 2 } { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf Q } _ { 1 } ^ { \top } { \bf g } _ { 1 } + { \bf g } _ { 2 } . } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
As a direct consequence of this proposition, we have the following statement.
|
| 87 |
+
|
| 88 |
+
Proposition 2. Any model satisfying Proposition $I$ guarantees invariance of the predicted complex w.r.t. any $S E ( 3 )$ transformation on $\mathbf { X } _ { 1 }$ , and equivariance w.r.t. any $S E ( 3 )$ transformation on $\mathbf { X } _ { 2 }$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } & { { \bf R } ( { \bf Z } _ { 1 } | { \bf X } _ { 2 } ) { \bf Z } _ { 1 } + { \bf t } ( { \bf Z } _ { 1 } | { \bf X } _ { 2 } ) = { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf X } _ { 1 } + { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) , \quad w h e r e { \bf Z } _ { 1 } = { \bf Q } _ { 1 } { \bf X } _ { 1 } + { \bf g } _ { 1 } } \\ & { { \bf R } ( { \bf X } _ { 1 } | { \bf Z } _ { 2 } ) { \bf X } _ { 1 } + { \bf t } ( { \bf X } _ { 1 } | { \bf Z } _ { 2 } ) = { \bf Q } _ { 2 } \left[ { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf X } _ { 1 } + { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) \right] + { \bf g } _ { 2 } , \quad w h e r e { \bf Z } _ { 2 } = { \bf Q } _ { 2 } { \bf X } _ { 2 } + { \bf g } _ { 2 } } \\ & { \quad \forall { \bf Q } _ { 1 } , { \bf Q } _ { 2 } \in S O ( 3 ) , \forall { \bf g } _ { 1 } , { \bf g } _ { 2 } \in { \mathbb { R } } ^ { 3 } , \forall { \bf X } _ { 1 } \in { \mathbb { R } } ^ { 3 \times n } , \forall { \bf X } _ { 2 } \in { \mathbb { R } } ^ { 3 \times m } . \quad } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Commutativity. Instead of docking $\mathbf { X } _ { 1 }$ with respect to $\mathbf { X } _ { 2 }$ , we can also dock $\mathbf { X } _ { 2 }$ with respect to $\mathbf { X } _ { 1 }$ . In this case, we require the final complex structures to be identical after superimposition, i.e., zero RMSD. This property is named commutativity and it is satisfied as follows (proof in Appendix B.2).
|
| 95 |
+
|
| 96 |
+
Proposition 3. Commutativity as defined by Eq. (1) is guaranteed iff
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathbf { R } ( \mathbf { X } _ { 2 } | \mathbf { X } _ { 1 } ) = \mathbf { R } ^ { \top } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) ; \quad \mathbf { t } ( \mathbf { X } _ { 2 } | \mathbf { X } _ { 1 } ) = - \mathbf { R } ^ { \top } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) \mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Point Permutation Invariance. We also enforce residue permutation invariance. Formally, both $\mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ and $\mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ should not depend on the order or columns of $\mathbf { X } _ { 1 }$ and, resp., of $\mathbf { X } _ { 2 }$ .
|
| 103 |
+
|
| 104 |
+
# 4 EQUIDOCK MODEL
|
| 105 |
+
|
| 106 |
+
Protein Representation. A protein is a sequence of amino acid residues that folds in a 3D structure. Each residue has a general structure with a side-chain specifying its type, allowing us to define a local frame and derive SE(3)-invariant features for any pair of residues —see Appendix A.
|
| 107 |
+
|
| 108 |
+
We represent a protein as a graph $\mathcal { G } = ( \nu , \mathcal { E } )$ , similar to Fout et al. (2017); Townshend et al. (2019); Liu et al. (2020). Each node $i \in \mathcal V$ represents one residue and has 3D coordinates $\mathbf { x } _ { i } \in \mathbb { R } ^ { 3 }$ corresponding to the $\alpha$ -carbon atom’s location. Edges are given by a $\mathbf { k }$ -nearest-neighbor (k-NN) graph using Euclidean distance of the original 3D node coordinates.
|
| 109 |
+
|
| 110 |
+
Overview of Our Approach. Our model is depicted in Fig. 3. We first build $\mathbf { k }$ -NN protein graphs $\mathcal { G } _ { 1 _ { - } } = ( \nu _ { 1 } , \mathcal { E } _ { 1 } )$ and $\bar { \mathcal { G } _ { 2 } } ^ { - } \bar { = } \left( \mathcal { V } _ { 2 } , \mathcal { E } _ { 2 } \right)$ . We then design SE(3)-invariant node features $\mathbf { F } _ { 1 } \dot { \in } \mathbb { R } ^ { d \times n } , \mathbf { F } _ { 2 } \in$ $\mathbb { R } ^ { d \times m }$ and edge features $\{ \mathbf { f } _ { j i } : \forall ( i , j ) \in \mathcal { E } _ { 1 } \cup \mathcal { E } _ { 2 } \}$ (see Appendix A).
|
| 111 |
+
|
| 112 |
+
Next, we apply several layers consisting of functions $\Phi$ that jointly transform node coordinates and features. Crucially, we guarantee, by design, pairwise independent $S E ( 3 )$ -equivariance for coordinate embeddings, and invariance for feature embeddings. This double constraint is formally defined:
|
| 113 |
+
|
| 114 |
+
Given $\mathbf { Z } _ { 1 } , \mathbf { H } _ { 1 } , \mathbf { Z } _ { 2 } , \mathbf { H } _ { 2 } = \Phi ( \mathbf { X } _ { 1 } , \mathbf { F } _ { 1 } , \mathbf { X } _ { 2 } , \mathbf { F } _ { 2 } )$
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r l } & { \mathrm { 1 , } \mathbf { 1 } _ { 1 } \mathrm { , } \mathbf { 1 } _ { 2 } \mathrm { , } \mathbf { , n } _ { 2 } = \Psi \mathrm { ( A _ { 1 } , } \mathbf { r } _ { 1 } \mathrm { , } \mathbf { r } _ { 2 } \mathrm { , } \mathbf { r } _ { 2 } \mathrm { ) } } \\ & { \mathbf { Q } _ { 1 } \mathbf { Z } _ { 1 } + \mathbf { g } _ { 1 } \mathrm { , } \mathbf { H } _ { 1 } \mathrm { , } \mathbf { Q } _ { 2 } \mathbf { Z } _ { 2 } + \mathbf { g } _ { 2 } \mathrm { , } \mathbf { H } _ { 2 } = \Phi \big ( \mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 } \mathrm { , } \mathbf { F } _ { 1 } \mathrm { , } \mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 } \mathrm { , } \mathbf { F } _ { 2 } \big ) , } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\forall \mathbf { Q } _ { 1 } , \mathbf { Q } _ { 2 } \in S O ( 3 ) , \forall \mathbf { g } _ { 1 } , \mathbf { g } _ { 2 } \in \mathbb { R } ^ { 3 } .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
We implement $\Phi$ as a novel type of message-passing neural network (MPNN). We then use the output node coordinate and feature embeddings to compute ${ \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } )$ and $\mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ . These functions depend on pairwise interactions between the two proteins modeled as cross-messages, but also incorporate the 3D structure in a pairwise-independent SE(3)-equivariant way to satisfy Eq. (1), Proposition 1 and Proposition 3. We discover keypoints from each protein based on a neural attention mechanism and softly guide them to represent the respective binding pocket locations via an optimal transport based auxiliary loss. Finally, we obtain the SE(3) transformation by superimposing the two keypoint sets via a differentiable version of the Kabsch algorithm. An additional soft-constraint discourages point cloud intersections. We now detail each of these model components.
|
| 125 |
+
|
| 126 |
+
Independent E(3)-Equivariant Graph Matching Networks (IEGMNs). Our architecture for $\Phi$ satisfying Eq. (4) is called Independent $E ( 3 )$ -Equivariant Graph Matching Network (IEGMN) – see Fig. 3. It extends both Graph Matching Networks (GMN) (Li et al., 2019) and E(3)-Equivariant Graph Neural Networks (E(3)-GNN) (Satorras et al., 2021). IEGMNs perform node coordinate and feature embedding updates for an input pair of graphs $\mathcal { G } _ { 1 } = ( \nu _ { 1 } , \mathcal { E } _ { 1 } )$ , $\mathcal { G } _ { 2 } = ( \nu _ { 2 } , \mathcal { E } _ { 2 } )$ , and use inter- and intranode messages, as well as E(3)-equivariant coordinate updates. The $l .$ -th layer of IEGMNs transforms node latent/feature embeddings $\{ \mathbf { h } _ { i } ^ { ( l ) } \} _ { i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } }$ and node coordinate embeddings $\{ \mathbf { x } _ { i } ^ { ( l ) } \} _ { i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } }$ as
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { r l } & { \mathbf { m } _ { j i } = \varphi ^ { c } ( \mathbf { h } _ { i } ^ { ( l ) } , \mathbf { h } _ { j } ^ { ( l ) } , \exp ( - \vert \mathbf { x } _ { i } ^ { ( l ) } - \mathbf { x } _ { j } ^ { ( l ) } \vert ^ { 2 } / \sigma ) , \mathbf { f } _ { j i } ) , \forall e _ { j i } \in \mathcal { E } _ { 1 } \cup \mathcal { E } _ { 2 } } \\ & { \mu _ { j i } = a _ { j i } \} \mathbf { W } \mathbf { h } _ { j } ^ { ( l ) } , \forall i \in \mathcal { V } _ { 1 } , j \in \mathcal { V } _ { 2 } \mathrm { o r } i \in \mathcal { V } _ { 2 , j } \mathrm { ~ } \forall \mathcal { E } _ { 1 } } \\ & { \mathbf { m } _ { i } = \displaystyle \frac { 1 } { \vert \mathbf { W } ( i ) \vert } \displaystyle \sum _ { j \in \mathcal { N } ( i ) } \mathbf { m } _ { j i } , \forall i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } } \\ & { \mu _ { i } = \displaystyle \sum _ { j \in \mathcal { V } _ { 2 } } \mu _ { j i , \forall i } \in \mathcal { V } _ { 1 } , \quad \mathrm { a n d } \quad \mu _ { i } = \displaystyle \sum _ { j \in \mathcal { V } _ { 1 } } \mu _ { j i , \forall i } , \forall i \in \mathcal { V } _ { 2 } } \\ & { \mathbf { x } _ { i } ^ { ( l + 1 ) } = \eta \mathbf { x } _ { i } ^ { ( 0 ) } + ( 1 - \eta ) \mathbf { x } _ { i } ^ { ( l ) } + \displaystyle \sum _ { j \in \mathcal { N } ( i ) } \big ( \mathbf { x } _ { i } ^ { ( l ) } - \mathbf { x } _ { j } ^ { ( l ) } \big ) \varphi ^ { x } ( \mathbf { m } _ { j i } ) , \forall i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } } \\ & { \mathbf { h } _ { i } ^ { ( l + 1 ) } = ( 1 - \beta ) \cdot \mathbf { h } _ { i } ^ { ( l ) } + \beta \cdot \nabla ^ { h } \big ( \mathbf { h } _ { i } ^ { ( l ) } , \mathbf { m } _ { i } , \mu _ { i } \big ) , \forall i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } , } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
where $\mathcal { N } ( i )$ are the neighbors of node $i$ ; $\varphi ^ { x }$ is a real-valued (scalar) parametric function; W is a learnable matrix; $\varphi ^ { h } , \varphi ^ { e }$ are parametric functions (MLPs) outputting a vector $\mathbb { R } ^ { d }$ ; $\mathbf { f } _ { j i }$ and $\mathbf { f } _ { i }$ are the original edge and node features (extracted SE(3)-invariantly from the residues). $a _ { j \to i }$ is an attention based coefficient with trainable shallow neural networks $\psi ^ { q }$ and $\psi ^ { k }$ :
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
a _ { j i } = \frac { \exp ( \langle \psi ^ { q } ( \mathbf { h } _ { i } ^ { ( l ) } ) , \psi ^ { k } ( \mathbf { h } _ { j } ^ { ( l ) } ) \rangle ) } { \sum _ { j ^ { \prime } } \exp ( \langle \psi ^ { q } ( \mathbf { h } _ { i } ^ { ( l ) } ) , \psi ^ { k } ( \mathbf { h } _ { j ^ { \prime } } ^ { ( l ) } ) \rangle ) } ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Note that all parameters of $\mathbf { W } , \varphi ^ { x } , \varphi ^ { h } , \varphi ^ { e } , \psi ^ { q } , \psi ^ { k }$ can be shared or different for different IEGMN layers . The output of several IEGMN layers is then denoted as:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\mathbf { Z } _ { 1 } \in \mathbb { R } ^ { 3 \times n } , \mathbf { H } _ { 1 } \in \mathbb { R } ^ { d \times n } , \mathbf { Z } _ { 2 } \in \mathbb { R } ^ { 3 \times m } , \mathbf { H } _ { 2 } \in \mathbb { R } ^ { d \times m } = I E G M N ( \mathbf { X } _ { 1 } , \mathbf { F } _ { 1 } , \mathbf { X } _ { 2 } , \mathbf { F } _ { 2 } ) .
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
It is then straightforward to prove the following (see Appendix B.3):
|
| 145 |
+
|
| 146 |
+
Proposition 4. IEGMNs satisfy the pairwise independent $S E ( 3 )$ -equivariance property in Eq. (4).
|
| 147 |
+
|
| 148 |
+
Keypoints for Differentiable Protein Superimposition. Next, we use multi-head attention to obtain $K$ points for each protein, $\mathbf { Y } _ { 1 } , \mathbf { Y } _ { 2 } \mathbf { \bar { \Pi } } \in \mathbb { R } ^ { 3 \times K }$ , which we name keypoints. We train them to become representative points for the binding pocket of the respective protein pair (softly-enforced by an additional loss described later). If this would holds perfectly, then the superimposition of $\mathbf { Y } _ { 1 }$ and $\mathbf { Y } _ { 2 }$ would give the corresponding ground truth superimposition of $\mathbf { X } _ { 1 }$ and $\mathbf { X } _ { 2 }$ . Our model is :
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\mathbf { y } _ { 1 k } : = \sum _ { i = 1 } ^ { n } \alpha _ { i } ^ { k } \mathbf { z } _ { 1 i } ; \quad \mathbf { y } _ { 2 k } : = \sum _ { j = 1 } ^ { m } \beta _ { j } ^ { k } \mathbf { z } _ { 2 j } ,
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $\mathbf { z } _ { 1 i }$ denotes the i-th column of matrix $\mathbf { Z } _ { 1 }$ , and $\alpha _ { i } ^ { k } = s o f t m a x _ { i } ( \textstyle \frac { 1 } { \sqrt { d } } \mathbf { h } _ { 1 i } ^ { \top } \mathbf { W } _ { k } ^ { \prime } \mu ( \varphi ( \mathbf { H } _ { 2 } ) ) )$ are attention scores (similarly defined for $\beta _ { j } ^ { k \cdot }$ ), with $\mathbf { W } _ { k } ^ { \prime } \in \mathbb { R } ^ { d \times d }$ a parametric matrix (different for each attention head), $\varphi$ a linear layer plus a LeakyReLU non-linearity, and $\mu ( \cdot )$ is the mean vector.
|
| 155 |
+
|
| 156 |
+
Differentiable Kabsch Model. We design the rotation and translation that docks protein 1 into protein 2 to be the same transformation used to superimpose ${ \bf Y } _ { 1 }$ and $\mathbf { Y } _ { 2 }$ — see Fig. 3. For this, we compute a differentiable version of the Kabsch algorithm (Kabsch, 1976) as follows. Let $\mathbf { A } = \overline { { \mathbf { Y } } } _ { 2 } \overline { { \mathbf { Y } } } _ { 1 } ^ { \top } \in \mathbb { R } ^ { 3 \times 3 } .$ computed using zero-mean keypoints. The singular value decomposition (SVD) is $\mathbf { A } { \dot { \mathbf { \eta } } } = \mathbf { U } _ { 2 } \mathbf { S } \mathbf { U } _ { 1 } ^ { \top }$ , where $\mathbf { U } _ { 2 } , \mathbf { U } _ { 1 } ^ { - } \in O ( 3 )$ . Finally, we define the differentiable functions
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\begin{array} { r l } & { \mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ; \theta ) = \mathbf { U } _ { 2 } \left( \begingroup _ { 0 } ^ { 1 } \ \right. \left( \begin{array} { l l l } { 0 } & { 0 } \\ { 0 } & { 1 } & { 0 } \\ { 0 } & { 0 } & { d } \end{array} \right) \mathbf { U } _ { 1 } ^ { \top } , \quad \mathrm { w h e r e \ } d = \mathrm { s i g n } ( \operatorname* { d e t } ( \mathbf { U } _ { 2 } \mathbf { U } _ { 1 } ^ { \top } ) ) } \\ & { \left. \mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ; \theta ) = \mu ( \mathbf { Y } _ { 2 } ) - \mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ; \theta ) \mu ( \mathbf { Y } _ { 1 } ) , \right. } \end{array}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where $\mu ( \cdot )$ is the mean vector of a point cloud. It is straightforward to prove that this model satisfies all the equivariance properties in Eqs. (1) to (3). From a practical perspective, the gradient and backpropagation through the SVD operation was analyzed by (Ionescu et al., 2015; Papadopoulo and Lourakis, 2000) and implemented in the automatic differentiation frameworks such as PyTorch.
|
| 163 |
+
|
| 164 |
+
MSE Loss. During training, we randomly decide which protein is the receptor (say protein 2), keep it in the docked position (i.e., ${ \bf X } _ { 2 } = { \bf X } _ { 2 } ^ { * }$ ), predict the SE(3) transformation using Eq. (13) and use it to compute the final position of the ligand as $\tilde { \mathbf { X } } _ { 1 } = \mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) \mathbf { X } _ { 1 } + \mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } )$ . The mean squared error (MSE) loss is then $\begin{array} { r } { \mathcal { L } _ { \mathrm { M S E } } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \| \mathbf { x } _ { i } ^ { * } - \tilde { \mathbf { x } } _ { i } \| ^ { 2 } } \end{array}$ .
|
| 165 |
+
|
| 166 |
+
Optimal Transport and Binding Pocket Keypoint Alignment. As stated before, we desire that $\mathbf { Y } _ { 1 }$ and $\mathbf { Y } _ { 2 }$ are representative points for the binding pocket location of the respective protein pair. However, this needs to be encouraged explicitly, which we achieve using an additional loss.
|
| 167 |
+
|
| 168 |
+
We first define the binding pocket point sets, inspiring from previous PPI work (Section 2). Given the residues’ $\alpha$ -carbon locations of the bound (docked) structures, $\mathbf { X } _ { 1 } ^ { * }$ and $\mathbf { X } _ { 2 } ^ { * }$ , we select all pairs of residues at less than $\tau$ Euclidean distance $( \tau = 8 \mathring \mathbf { A }$ in our experiments). We assume these are all interacting residues. Denote these pairs as $\{ ( \mathbf { x } _ { 1 s } ^ { * } , \mathbf { x } _ { 2 s } ^ { * } ) , s \in { 1 , . . . , S } \}$ , where $S$ is variable across data pairs. We compute midpoints of these segments, denoted as $\mathbf { P } _ { 1 } ^ { \ast } , \mathbf { P } _ { 2 } ^ { \ast } \in \mathbb { R } ^ { 3 \times S }$ , where $\mathbf { p } _ { 1 s } ^ { * } = \mathbf { p } _ { 2 s } ^ { * } = 0 . 5 \cdot ( \mathbf { x } _ { 1 s } ^ { * } + \mathbf { x } _ { 2 s } ^ { * } )$ . We view $\mathbf { P } _ { 1 } ^ { * }$ and $\mathbf { P } _ { 2 } ^ { * }$ as binding pocket points. In the unbound state, these sets are randomly moved in space together with the respective protein residue coordinates $\mathbf { X } _ { 1 }$ and $\mathbf { X } _ { 2 }$ . We denote them as $\mathbf { P } _ { 1 } , \mathbf { P } _ { 2 } ^ { \bullet } \in \mathbb { R } ^ { 3 \times S }$ . For clarity, if $\mathbf { X } _ { 1 } = \mathbf { Q } \mathbf { X } _ { 1 } ^ { * } + \mathbf { g }$ , then $\mathbf { P } _ { 1 } = \mathbf { Q } \mathbf { P } _ { 1 } ^ { * } + \mathbf { g }$ .
|
| 169 |
+
|
| 170 |
+
We desire that $\mathbf { Y } _ { 1 }$ is a representative set for the 3D set ${ \bf P } _ { 1 }$ (and, similarly, $\mathbf { Y } _ { 2 }$ for $\mathbf { P } _ { 2 }$ ). However, while at training time we know that every point $\mathbf { p } _ { 1 s }$ corresponds to the point $\mathbf { p } _ { 2 s }$ (and, similarly, $\mathbf { y } _ { 1 k }$ aligns with $\mathbf { y } _ { 2 k }$ , by assumption), we unfortunately do not know the actual alignment between points in $\mathbf { Y } _ { l }$ and $\mathbf { P } _ { l }$ , for every $l \in \{ 1 , 2 \}$ . This can be recovered using an additional optimal transport loss:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
{ \mathcal { L } } _ { \mathrm { O T } } = \operatorname* { m i n } _ { \mathbf { T } \in \mathcal { U } ( S , K ) } \langle \mathbf { T } , \mathbf { C } \rangle , \quad \mathrm { w h e r e ~ } \mathbf { C } _ { s , k } = \| \mathbf { y } _ { 1 k } - \mathbf { p } _ { 1 s } \| ^ { 2 } + \| \mathbf { y } _ { 2 k } - \mathbf { p } _ { 2 s } \| ^ { 2 } ,
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
where $\mathcal { U } ( S , K )$ is the set of $S \times K$ transport plans with uniform marginals. The optimal transport plan is computed using an Earth Mover’s Distance and the POT library (Flamary et al., 2021), while being kept fixed during back-propagation and optimization when only the cost matrix is trained.
|
| 177 |
+
|
| 178 |
+
Note that our approach assumes that $\mathbf { y } _ { 1 k }$ corresponds to $\mathbf { y } _ { 2 k }$ , for every $k \in \{ 1 , \ldots , K \}$ . Intuitively, each attention head $k$ will identify a specific geometric/chemical local surface feature of protein 1 by $\mathbf { y } _ { 1 k }$ , and match its complementary feature of protein 2 by $\mathbf { y } _ { 2 k }$ .
|
| 179 |
+
|
| 180 |
+
Avoiding Point Cloud Intersection. In practice, our model does not enforce a useful inductive bias, namely that proteins forming complexes are never "intersecting" with each other. To address this issue, we first state a notion of the "interior" of a protein point cloud. Following previous work cloud $\mathbf { X } \in \mathbb { R } ^ { 3 \times n }$ et as $\{ \mathbf { x } \in \mathbb { R } ^ { 3 } : G ( \mathbf { x } ) = \gamma \}$ et al., 2, where $\begin{array} { r } { G ( \mathbf { x } ) = - \sigma \ln ( \sum _ { i = 1 } ^ { n } \exp ( - | | \mathbf { \hat { x } } - \mathbf { x } _ { i } | | ^ { 2 } / \sigma ) ) } \end{array}$ The parameters $\sigma$ and $\gamma$ are chosen such that there exist no "holes" inside a protein (we found $\gamma = 1 0 , \sigma = 2 5$ to work well, see Appendix E). As a consequence, the interior of the protein is given by $\{ \mathbf { x } \in \mathbb { R } ^ { 3 } : G ( \mathbf { x } ) < \gamma \}$ . Then, the condition for non-intersecting ligand and receptor can be written as $G _ { 1 } ( \mathbf { x } _ { 2 j } ) > \gamma , \forall j \in { 1 , \ldots , m }$ and $G _ { 2 } ( \mathbf { x } _ { 1 i } ) > \gamma , \forall i \in { 1 , . . . , n }$ . As a loss function, this becomes
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\mathcal { L } _ { \mathrm { { N I } } } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( 0 , \gamma - G _ { 2 } ( \mathbf { x } _ { 1 i } ) ) + \frac { 1 } { m } \sum _ { j = 1 } ^ { m } \operatorname* { m a x } ( 0 , \gamma - G _ { 1 } ( \mathbf { x } _ { 2 j } ) ) .
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
Surface Aware Node Features. Surface contact modeling is important for protein docking. We here design a novel surface feature type that differentiates residues closer to the surface of the protein from those in the interior. Similar to Sverrisson et al. (2021), we prioritize efficiency and avoid pre-computing meshes, but show that our new feature is a good proxy for residue’s depth (i.e. distance to the protein surface). Intuitively, residues in the core of the protein are locally surrounded in all directions by other residues. This is not true for residues on the surface, e.g., neighbors are in a half-space if the surface is locally flat. Building on this intuition, for each node (residue) $i$ in the $k$ -NN protein graph, we compute the norm of the weighted average of its neighbor forces, which can be interpreted as the normalized gradient of the $G ( \mathbf { x } )$ surface function. This SE(3)-invariant feature is
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\rho _ { i } ( \mathbf { x } _ { i } ; \lambda ) = \frac { \big \| \sum _ { i ^ { \prime } \in \mathcal { N } _ { i } } w _ { i , i ^ { \prime } , \lambda } ( \mathbf { x } _ { i } - \mathbf { x } _ { i ^ { \prime } } ) \big \| } { \sum _ { i ^ { \prime } \in \mathcal { N } _ { i } } w _ { i , i ^ { \prime } , \lambda } \| \mathbf { x } _ { i } - \mathbf { x } _ { i ^ { \prime } } \| } , \quad \mathrm { ~ w h e r e ~ } w _ { i , i ^ { \prime } , \lambda } = \frac { \exp ( - | | \mathbf { x } _ { i } - \mathbf { x } _ { i ^ { \prime } } | | ^ { 2 } / \lambda ) } { \sum _ { j \in \mathcal { N } _ { i } } \exp ( - | | \mathbf { x } _ { i } - \mathbf { x } _ { j } | | ^ { 2 } / \lambda ) } .
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
Intuitively, as depicted in Fig. 8, residues in the interior of the protein have values close to 0 since they are surrounded by vectors from all directions that cancel out, while residues near the surface have neighbors only in a narrower cone, with aperture depending on the local curvature of the surface. We show in Appendix C that this feature correlates well with more expensive residue depth estimation methods, e.g. based on MSMS, thus offering a computationally appealing alternative. We also compute an estimation of this feature for large dense point clouds based on the local surface angle.
|
| 193 |
+
|
| 194 |
+
# 5 EXPERIMENTS
|
| 195 |
+
|
| 196 |
+
Datasets. We leverage the following datasets: Docking Benchmark 5.5 (DB5.5) (Vreven et al., 2015) and Database of Interacting Protein Structures (DIPS) (Townshend et al., 2019). DB5.5 is a gold standard dataset in terms of data quality, but contains only 253 structures. DIPS is a larger protein complex structures dataset mined from the Protein Data Bank (Berman et al., 2000) and tailored for rigid body docking. Datasets information is given in Appendix D. We filter DIPS to only keep proteins with at most 10K atoms. Datasets are then randomly partitioned in train/val/test splits of sizes 203/25/25 (DB5.5) and 39,937/974/965 (DIPS). For DIPS, the split is based on protein family to separate similar proteins. For the final evaluation in Table 1, we use the full DB5.5 test set, and randomly sample 100 pairs from different protein families from the DIPS test set.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 4: a. Complex-RMSD distributions (DIPS test set); b. Interface-RMSD distributions (DIPS test set); c. scatter plot for C-RMSD vs I-RMSD (DIPS test set).
|
| 200 |
+
|
| 201 |
+
Baselines. We compare our EQUIDOCK method with popular state-of-the-art docking software 2 CLUSPRO (PIPER) (Desta et al., 2020; Kozakov et al., 2017),ATTRACT (Schindler et al., 2017; de Vries et al., 2015), PATCHDOCK (Mashiach et al., 2010; SchneidmanDuhovny et al., 2005), and HDOCK (Yan et al., 2020; 2017b;a; Huang and Zou, 2014; 2008). These baselines provide user-friendly local packages suitable for automatic experiments or webservers for manual submissions.
|
| 202 |
+
|
| 203 |
+
Evaluation Metrics. To measure prediction’s quality, we report Complex Root Mean Square Deviation (CRMSD) and Interface Root Mean Square Deviation (IRMSD), defined below. Given the ground truth and predicted complex structures, $\mathbf { Z ^ { * } } \in \mathbb { R } ^ { 3 \times ( n + m ) }$ and $\mathbf { Z } \in \mathbb { R } ^ { 3 \times ( n + m ) }$ , we first superimpose them using the Kabsch algorithm (Kabsch, 1976), and then compute $\begin{array} { r } { \mathrm { C - R M S D } = \sqrt { \frac { 1 } { n + m } \| { \bf Z } ^ { * } - { \bf Z } \| _ { F } ^ { 2 } } } \end{array}$ . We compute I-RMSD similarly, but using only the coordinates of the interface residues with distance less than $8 \mathring \mathrm { A }$ to the other protein’s residues. For a fair comparison among baselines, we use only the $\alpha$ -carbon coordinates to compute both metrics.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 5: Inference running time distributions (log10 scale).
|
| 207 |
+
|
| 208 |
+
Training Details. We train our models on the train part of DIPS first, using Adam (Kingma and Ba, 2014) with learning rate 2e-4 and early stopping with patience of 30 epochs. We update the best validation model only when it achieves a score of less than $98 \%$ of the previous best validation score, where the score is the median of Ligand RMSD on the full DIPS validation set. The best DIPS validated model is then tested on the DIPS test set. For DB5.5, we fine tune the DIPS pre-trained model on the DB5.5 training set using learning rate 1e-4 and early stopping with 150 epochs patience. The best DB5.5 validated model is finally tested on DB5.5 test set. During training, we randomly assign the roles of ligand and receptor. Also, during both training and testing, we randomly rotate and translate the ligand in space (even though our model is invariant to this operation) for all baselines.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 6: Visualization of a protein complex successfully predicted by EQUIDOCK. Note that all other methods find the binding interface on the wrong side of the black protein.
|
| 212 |
+
|
| 213 |
+
Complex Prediction Results. Results are shown in Table 1, Fig. 4 and Appendix E. We note that our method is competitive and often outperforms the baselines. However, we do not use heavy candidate sampling and re-ranking, we do not rely on task-specific hand-crafted features, and we currently do not perform structure fine-tuning, aiming to predict the SE(3) ligand transformation in a direct shot. Moreover, we note that some of the baselines might have used part of our test set in validating their models, for example to learn surface templates, thus, their reported scores might be optimistic. Notably, HDOCK score function was validated on DB4 which overlaps with DB5.5. A more appropriate comparison would require us to re-build these baselines without information from our test sets, a task that is currently not possible without open-source implementations.
|
| 214 |
+
|
| 215 |
+
Computational Efficiency. We show inference times in Fig. 5 and Table 4. Note that EQUIDOCK is between 80-500 times faster than the baselines. This is especially important for intensive screening applications that aim to scan over vast search spaces, e.g. for drug discovery. In addition, it is also relevant for de novo design of binding proteins (e.g. antibodies (Jin et al., 2021)) or for use cases when protein docking models are just a component of significantly larger end-to-end architectures targeting more involved biological scenarios, e.g., representing a drug’s mechanism of action or modeling cellular processes with a single model as opposed to a multi-pipeline architecture.
|
| 216 |
+
|
| 217 |
+
Visualization. We show in Fig. 6 a successful example of a test DIPS protein pair for which our model significantly outperforms all baselines.
|
| 218 |
+
|
| 219 |
+
# 6 CONCLUSION
|
| 220 |
+
|
| 221 |
+
We have presented an extremely fast, end-to-end rigid protein docking approach that does not rely on candidate sampling, templates, task-specific features or pre-computed meshes. Our method smartly incorporates useful rigid protein docking priors including commutativity and pairwise independent SE(3)-equivariances, thus avoiding the computational burden of data augmentation.
|
| 222 |
+
|
| 223 |
+
We look forward to incorporating more domain knowledge in EQUIDOCK and extend it for flexible docking and docking molecular dynamics, as well as adapt it to other related tasks such as drug binding prediction. On the long term, we envision that fast and accurate deep learning models would allow us to tackle more complex and involved biological scenarios, for example to model the mechanism of action of various drugs or to design de novo binding proteins and drugs to specific targets (e.g. for antibody generation). Last, we hope that our architecture can inspire the design of other types of biological 3D interactions.
|
| 224 |
+
|
| 225 |
+
Limitations. First, our presented model does not incorporate protein flexibility which is necessary for various protein families, e.g., antibodies. Unfortunately, both DB5 and DIPS datasets are biased towards rigid body docking . Second, we only prevent steric clashes using a soft constraint (Eq. (15)) which has limitations (see Table 6). Future extensions would hard-constrain the model to prevent such artifacts.
|
| 226 |
+
|
| 227 |
+
# ACKNOWLEDGEMENTS
|
| 228 |
+
|
| 229 |
+
The authors thank Hannes Stärk, Gabriele Corso, Patrick Walters, Tian Xie, Xiang Fu, Jacob Stern, Jason Yim, Lewis Martin, Jeremy Wohlwend, Jiaxiang Wu, Wei Liu, and Ding Xue for insightful and helpful discussions. OEG is funded by 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, and the DARPA Accelerated Molecular Discovery program. This publication was created as part of NCCR Catalysis (grant number 180544), a National Centres of Competence in Research funded by the Swiss National Science Foundation. RB and TJ also acknowledge support from NSF Expeditions grant (award 1918839): Collaborative Research: Understanding the World Through Code.
|
| 230 |
+
|
| 231 |
+
# REFERENCES
|
| 232 |
+
|
| 233 |
+
B. Adhikari and J. Cheng. Confold2: Improved contact-driven ab initio protein structure modeling. BMC bioinformatics, 19(1):1–5, 2018. 3
|
| 234 |
+
M. Baek, F. DiMaio, I. Anishchenko, J. Dauparas, S. Ovchinnikov, G. R. Lee, J. Wang, Q. Cong, L. N. Kinch, R. D. Schaeffer, et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science, 373(6557):871–876, 2021. 1, 3
|
| 235 |
+
J. Bao, X. He, and J. Z. Zhang. Deepbsp—a machine learning method for accurate prediction of protein–ligand docking structures. Journal of Chemical Information and Modeling, 2021. 3
|
| 236 |
+
S. Basu and B. Wallner. Dockq: a quality measure for protein-protein docking models. PloS one, 11 (8):e0161879, 2016. 3
|
| 237 |
+
H. M. Berman, J. Westbrook, Z. Feng, G. Gilliland, T. N. Bhat, H. Weissig, I. N. Shindyalov, and P. E. Bourne. The protein data bank. Nucleic acids research, 28(1):235–242, 2000. 7
|
| 238 |
+
J. Biesiada, A. Porollo, P. Velayutham, M. Kouril, and J. Meller. Survey of public domain software for docking simulations and virtual screening. Human genomics, 5(5):1–9, 2011. 3
|
| 239 |
+
J. Bruna, W. Zaremba, A. Szlam, and Y. LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. 2
|
| 240 |
+
P. Bryant, G. Pozzati, and A. Elofsson. Improved prediction of protein-protein interactions using alphafold2 and extended multiple-sequence alignments. bioRxiv, 2021. 3
|
| 241 |
+
R. Chen, L. Li, and Z. Weng. Zdock: an initial-stage protein-docking algorithm. Proteins: Structure, Function, and Bioinformatics, 52(1):80–87, 2003. 1, 3
|
| 242 |
+
C. Christoffer, S. Chen, V. Bharadwaj, T. Aderinwale, V. Kumar, M. Hormati, and D. Kihara. Lzerd webserver for pairwise and multiple protein–protein docking. Nucleic Acids Research, 2021. 3
|
| 243 |
+
T. Cohen and M. Welling. Group equivariant convolutional networks. In International conference on machine learning, pages 2990–2999. PMLR, 2016a. 2
|
| 244 |
+
T. S. Cohen and M. Welling. Steerable cnns. arXiv preprint arXiv:1612.08498, 2016b. 2
|
| 245 |
+
B. Dai and C. Bailey-Kellogg. Protein interaction interface region prediction by geometric deep learning. Bioinformatics, 2021. 3
|
| 246 |
+
S. J. De Vries, M. Van Dijk, and A. M. Bonvin. The haddock web server for data-driven biomolecular docking. Nature protocols, 5(5):883–897, 2010. 1, 3
|
| 247 |
+
S. J. de Vries, C. E. Schindler, I. C. de Beauchêne, and M. Zacharias. A web interface for easy flexible protein-protein docking with attract. Biophysical journal, 108(3):462–465, 2015. 8
|
| 248 |
+
M. Defferrard, X. Bresson, and P. Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. arXiv preprint arXiv:1606.09375, 2016. 2
|
| 249 |
+
|
| 250 |
+
I. T. Desta, K. A. Porter, B. Xia, D. Kozakov, and S. Vajda. Performance and its limits in rigid body protein-protein docking. Structure, 28(9):1071–1081, 2020. 8
|
| 251 |
+
|
| 252 |
+
S. Eismann, R. J. Townshend, N. Thomas, M. Jagota, B. Jing, and R. O. Dror. Hierarchical, rotationequivariant neural networks to select structural models of protein complexes. Proteins: Structure, Function, and Bioinformatics, 2020. 2, 3
|
| 253 |
+
|
| 254 |
+
R. Evans, M. O’Neill, A. Pritzel, N. Antropova, A. W. Senior, T. Green, A. Žídek, R. Bates, S. Blackwell, J. Yim, O. Ronneberger, S. Bodenstein, M. Zielinski, A. Bridgland, A. Potapenko, A. Cowie, K. Tunyasuvunakool, R. Jain, E. Clancy, P. Kohli, J. Jumper, and D. Hassabis. Protein complex prediction with alphafold-multimer. bioRxiv, 2021. doi: 10.1101/2021.10.04.463034. 3
|
| 255 |
+
|
| 256 |
+
M. Finzi, S. Stanton, P. Izmailov, and A. G. Wilson. Generalizing convolutional neural networks for equivariance to lie groups on arbitrary continuous data. In International Conference on Machine Learning, pages 3165–3176. PMLR, 2020. 2
|
| 257 |
+
|
| 258 |
+
R. Flamary, N. Courty, A. Gramfort, M. Z. Alaya, A. Boisbunon, S. Chambon, L. Chapel, A. Corenflos, K. Fatras, N. Fournier, L. Gautheron, N. T. Gayraud, H. Janati, A. Rakotomamonjy, I. Redko, A. Rolet, A. Schutz, V. Seguy, D. J. Sutherland, R. Tavenard, A. Tong, and T. Vayer. Pot: Python optimal transport. Journal of Machine Learning Research, 22(78):1–8, 2021. URL http://jmlr.org/papers/v22/20-451.html. 7
|
| 259 |
+
|
| 260 |
+
A. Fout, J. Byrd, B. Shariat, and A. Ben-Hur. Protein interface prediction using graph convolutional networks. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6533–6542, 2017. 3, 5
|
| 261 |
+
|
| 262 |
+
F. B. Fuchs, D. E. Worrall, V. Fischer, and M. Welling. Se (3)-transformers: 3d roto-translation equivariant attention networks. arXiv preprint arXiv:2006.10503, 2020. 2
|
| 263 |
+
|
| 264 |
+
O.-E. Ganea, L. Pattanaik, C. W. Coley, R. Barzilay, K. F. Jensen, W. H. Green, and T. S. Jaakkola. Geomol: Torsional geometric generation of molecular 3d conformer ensembles. arXiv preprint arXiv:2106.07802, 2021. 3
|
| 265 |
+
|
| 266 |
+
U. Ghani, I. Desta, A. Jindal, O. Khan, G. Jones, S. Kotelnikov, D. Padhorny, S. Vajda, and D. Kozakov. Improved docking of protein models by a combination of alphafold2 and cluspro. bioRxiv, 2021. 3
|
| 267 |
+
|
| 268 |
+
J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pages 1263–1272. PMLR, 2017. 2
|
| 269 |
+
|
| 270 |
+
S.-Y. Huang and X. Zou. An iterative knowledge-based scoring function for protein–protein recognition. Proteins: Structure, Function, and Bioinformatics, 72(2):557–579, 2008. 8
|
| 271 |
+
|
| 272 |
+
S.-Y. Huang and X. Zou. A knowledge-based scoring function for protein-rna interactions derived from a statistical mechanics-based iterative method. Nucleic acids research, 42(7):e55–e55, 2014. 8
|
| 273 |
+
|
| 274 |
+
I. R. Humphreys, J. Pei, M. Baek, A. Krishnakumar, I. Anishchenko, S. R. Ovchinnikov, J. Zheng, T. Ness, S. Banjade, S. R. Bagde, V. Stancheva, X. Li, K. Liu, Z. Zheng, D. Barerro, U. Roy, I. S. Fernandez, B. Szakal, D. Branzei, E. C. Greene, S. Biggins, S. Keeney, E. A. Miller, J. C. Fromme, T. Hendrickson, Q. Cong, and D. Baker. Structures of core eukaryotic protein complexes. 2021. doi: 10.1101/2021.09.30.462231. 3
|
| 275 |
+
|
| 276 |
+
M. Hutchinson, C. L. Lan, S. Zaidi, E. Dupont, Y. W. Teh, and H. Kim. Lietransformer: Equivariant self-attention for lie groups. arXiv Preprint, 2012.10885, 2020. 2
|
| 277 |
+
|
| 278 |
+
J. Ingraham, V. K. Garg, R. Barzilay, and T. Jaakkola. Generative models for graph-based protein design. 2019. 15
|
| 279 |
+
|
| 280 |
+
C. Ionescu, O. Vantzos, and C. Sminchisescu. Matrix backpropagation for deep networks with structured layers. In Proceedings of the IEEE International Conference on Computer Vision, pages 2965–2973, 2015. 6
|
| 281 |
+
|
| 282 |
+
W. Jin, J. Wohlwend, R. Barzilay, and T. Jaakkola. Iterative refinement graph neural network for antibody sequence-structure co-design. arXiv preprint arXiv:2110.04624, 2021. 9
|
| 283 |
+
L. Jovine. Using machine learning to study protein–protein interactions: From the uromodulin polymer to egg zona pellucida filaments. Molecular Reproduction and Development, $\mathrm { { n } ( \mathrm { { n } ( \mathrm { { n } / \mathrm { { a } ) } } } }$ . doi: https://doi.org/10.1002/mrd.23538. URL https://onlinelibrary.wiley.com/doi/ abs/10.1002/mrd.23538. 3
|
| 284 |
+
F. Ju, J. Zhu, B. Shao, L. Kong, T.-Y. Liu, W.-M. Zheng, and D. Bu. Copulanet: Learning residue co-evolution directly from multiple sequence alignment for protein structure prediction. Nature Communications, 12(1):2535, May 2021. 3
|
| 285 |
+
J. Jumper, R. Evans, A. Pritzel, T. Green, M. Figurnov, O. Ronneberger, K. Tunyasuvunakool, R. Bates, A. Žídek, A. Potapenko, et al. Highly accurate protein structure prediction with alphafold. Nature, 596(7873):583–589, 2021. 1, 3, 15
|
| 286 |
+
W. Kabsch. A solution for the best rotation to relate two sets of vectors. Acta Crystallographica Section A: Crystal Physics, Diffraction, Theoretical and General Crystallography, 32(5):922–923, 1976. 4, 6, 8
|
| 287 |
+
D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 8
|
| 288 |
+
T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. 2
|
| 289 |
+
D. R. Koes, M. P. Baumgartner, and C. J. Camacho. Lessons learned in empirical scoring with smina from the csar 2011 benchmarking exercise. Journal of chemical information and modeling, 53(8): 1893–1904, 2013. 3
|
| 290 |
+
D. Kozakov, D. R. Hall, B. Xia, K. A. Porter, D. Padhorny, C. Yueh, D. Beglov, and S. Vajda. The cluspro web server for protein–protein docking. Nature protocols, 12(2):255–278, 2017. 3, 8
|
| 291 |
+
G. Launay, M. Ohue, J. Prieto Santero, Y. Matsuzaki, C. Hilpert, N. Uchikoga, T. Hayashi, and J. Martin. Evaluation of consrank-like scoring functions for rescoring ensembles of protein–protein docking poses. Frontiers in molecular biosciences, 7:308, 2020. 3
|
| 292 |
+
S. Li, J. Zhou, T. Xu, L. Huang, F. Wang, H. Xiong, W. Huang, D. Dou, and H. Xiong. Structureaware interactive graph neural networks for the prediction of protein-ligand binding affinity. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 975–985, 2021. 3
|
| 293 |
+
Y. Li, C. Gu, T. Dullien, O. Vinyals, and P. Kohli. Graph matching networks for learning the similarity of graph structured objects. In International Conference on Machine Learning, pages 3835–3845. PMLR, 2019. 2, 5
|
| 294 |
+
Y. Liu, H. Yuan, L. Cai, and S. Ji. Deep learning of high-order interactions for protein interface prediction. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 679–687, 2020. 3, 5
|
| 295 |
+
E. Mashiach, D. Schneidman-Duhovny, A. Peri, Y. Shavit, R. Nussinov, and H. J. Wolfson. An integrated suite of fast docking algorithms. Proteins: Structure, Function, and Bioinformatics, 78 (15):3197–3204, 2010. 8
|
| 296 |
+
A. T. McNutt, P. Francoeur, R. Aggarwal, T. Masuda, R. Meli, M. Ragoza, J. Sunseri, and D. R. Koes. Gnina 1.0: molecular docking with deep learning. Journal of cheminformatics, 13(1):1–20, 2021. 3
|
| 297 |
+
I. H. Moal, M. Torchala, P. A. Bates, and J. Fernández-Recio. The scoring of poses in protein-protein docking: current capabilities and future directions. BMC bioinformatics, 14(1):1–15, 2013. 3
|
| 298 |
+
T. Papadopoulo and M. I. Lourakis. Estimating the jacobian of the singular value decomposition: Theory and applications. In European Conference on Computer Vision, pages 554–570. Springer, 2000. 6
|
| 299 |
+
J. Pei, J. Zhang, and Q. Cong. Human mitochondrial protein complexes revealed by large-scale coevolution analysis and deep learning-based structure modeling. bioRxiv, 2021. 3
|
| 300 |
+
D. J. Rezende, S. Racanière, I. Higgins, and P. Toth. Equivariant hamiltonian flows. arXiv preprint arXiv:1909.13739, 2019. 2
|
| 301 |
+
M. F. Sanner, A. J. Olson, and J.-C. Spehner. Reduced surface: an efficient way to compute molecular surfaces. Biopolymers, 38(3):305–320, 1996. 17
|
| 302 |
+
V. G. Satorras, E. Hoogeboom, and M. Welling. E(n)-equivariant graph neural networks. arXiv preprint arXiv:2102.09844, 2021. 2, 5
|
| 303 |
+
C. E. Schindler, I. Chauvot de Beauchêne, S. J. de Vries, and M. Zacharias. Protein-protein and peptide-protein docking and refinement using attract in capri. Proteins: Structure, Function, and Bioinformatics, 85(3):391–398, 2017. 1, 3, 8
|
| 304 |
+
D. Schneidman-Duhovny, Y. Inbar, R. Nussinov, and H. J. Wolfson. Patchdock and symmdock: servers for rigid and symmetric docking. Nucleic acids research, 33(suppl_2):W363–W367, 2005. 8
|
| 305 |
+
A. W. Senior, R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. Green, C. Qin, A. Žídek, A. W. Nelson, A. Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706–710, 2020. 1, 3
|
| 306 |
+
S. Sunny and P. Jayaraj. Fpdock: Protein–protein docking using flower pollination algorithm. Computational Biology and Chemistry, 93:107518, 2021. 1, 3
|
| 307 |
+
F. Sverrisson, J. Feydy, B. E. Correia, and M. M. Bronstein. Fast end-to-end learning on protein surfaces. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15272–15281, 2021. 7
|
| 308 |
+
N. Thomas, T. Smidt, S. Kearnes, L. Yang, L. Li, K. Kohlhoff, and P. Riley. Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. arXiv preprint arXiv:1802.08219, 2018. 2, 3
|
| 309 |
+
M. Torchala, I. H. Moal, R. A. Chaleil, J. Fernandez-Recio, and P. A. Bates. Swarmdock: a server for flexible protein–protein docking. Bioinformatics, 29(6):807–809, 2013. 1, 3
|
| 310 |
+
R. Townshend, R. Bedi, P. Suriana, and R. Dror. End-to-end learning on 3d protein structure for interface prediction. Advances in Neural Information Processing Systems, 32:15642–15651, 2019. 3, 5, 7
|
| 311 |
+
O. Trott and A. J. Olson. Autodock vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading. Journal of computational chemistry, 31(2):455–461, 2010. 3
|
| 312 |
+
I. A. Vakser. Protein-protein docking: From interaction to interactome. Biophysical journal, 107(8): 1785–1793, 2014. 3
|
| 313 |
+
V. Venkatraman, Y. D. Yang, L. Sael, and D. Kihara. Protein-protein docking using region-based 3d zernike descriptors. BMC bioinformatics, 10(1):1–21, 2009. 1, 3, 7
|
| 314 |
+
J. Verburgt and D. Kihara. Benchmarking of structure refinement methods for protein complex models. Proteins: Structure, Function, and Bioinformatics, 2021. 3
|
| 315 |
+
T. Vreven, I. H. Moal, A. Vangone, B. G. Pierce, P. L. Kastritis, M. Torchala, R. Chaleil, B. JiménezGarcía, P. A. Bates, J. Fernandez-Recio, et al. Updates to the integrated protein–protein interaction benchmarks: docking benchmark version 5 and affinity benchmark version 2. Journal of molecular biology, 427(19):3031–3041, 2015. 7
|
| 316 |
+
I. Wallach, M. Dzamba, and A. Heifets. Atomnet: a deep convolutional neural network for bioactivity prediction in structure-based drug discovery. arXiv preprint arXiv:1510.02855, 2015. 3
|
| 317 |
+
M. Weiler and G. Cesa. General $e ( 2 )$ -equivariant steerable cnns. arXiv preprint arXiv:1911.08251, 2019. 2
|
| 318 |
+
|
| 319 |
+
G. Weng, E. Wang, Z. Wang, H. Liu, F. Zhu, D. Li, and T. Hou. Hawkdock: a web server to predict and analyze the protein–protein complex based on computational docking and mm/gbsa. Nucleic acids research, 47(W1):W322–W330, 2019. 3
|
| 320 |
+
|
| 321 |
+
J. Wu, T. Shen, H. Lan, Y. Bian, and J. Huang. Se (3)-equivariant energy-based models for end-to-end protein folding. bioRxiv, 2021. 2
|
| 322 |
+
|
| 323 |
+
Z. Xie and J. Xu. Deep graph learning of inter-protein contacts. bioRxiv, 2021. 3
|
| 324 |
+
|
| 325 |
+
K. Xu, W. Hu, J. Leskovec, and S. Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2018. 2
|
| 326 |
+
|
| 327 |
+
Y. Yan, Z. Wen, X. Wang, and S.-Y. Huang. Addressing recent docking challenges: A hybrid strategy to integrate template-based and free protein-protein docking. Proteins: Structure, Function, and Bioinformatics, 85(3):497–512, 2017a. 8
|
| 328 |
+
|
| 329 |
+
Y. Yan, D. Zhang, P. Zhou, B. Li, and S.-Y. Huang. Hdock: a web server for protein–protein and protein–dna/rna docking based on a hybrid strategy. Nucleic acids research, 45(W1):W365–W373, 2017b. 8
|
| 330 |
+
|
| 331 |
+
Y. Yan, H. Tao, J. He, and S.-Y. Huang. The hdock server for integrated protein–protein docking. Nature protocols, 15(5):1829–1852, 2020. 3, 8
|
| 332 |
+
|
| 333 |
+
J. Yang, I. Anishchenko, H. Park, Z. Peng, S. Ovchinnikov, and D. Baker. Improved protein structure prediction using predicted interresidue orientations. Proceedings of the National Academy of Sciences, 117(3):1496–1503, 2020. 3
|
| 334 |
+
|
| 335 |
+
# Appendix
|
| 336 |
+
|
| 337 |
+
# CONTENTS
|
| 338 |
+
|
| 339 |
+
A Representing Proteins as Graphs 15
|
| 340 |
+
B Proofs of the Main Propositions 16
|
| 341 |
+
B.1 Proof of Proposition 1. 16
|
| 342 |
+
B.2 Proof of Proposition 3. 17
|
| 343 |
+
B.3 Proof of Proposition 4. 17
|
| 344 |
+
C Surface Features 17
|
| 345 |
+
D Datasets 18
|
| 346 |
+
E More Experimental Details and Results 20
|
| 347 |
+
|
| 348 |
+
# A REPRESENTING PROTEINS AS GRAPHS
|
| 349 |
+
|
| 350 |
+
A protein is comprised of amino acid residues. The structure of an amino acid residue is shown in Figure Fig. 7. Generally, an amino acid residue contains amino (-NH-), $\alpha$ -carbon atom and carboxyl (-CO-), along with a side chain (R) connected with the $\alpha$ -carbon atom. The side chain (R) is specific to each type of amino acid residues.
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 7: Representation of an amino acid residue and its local coordinate system.
|
| 354 |
+
|
| 355 |
+
We work on residue level (our approaches can be extended to atom level as well). A protein is represented by a set of nodes where each node is an amino acid residue in the protein. Each node $i$ has a 3D coordinate $\mathbf { x } _ { i } \in \mathbb { R } ^ { 3 }$ which is the 3D coordinate of $\alpha$ -carbon atom of the residue.
|
| 356 |
+
|
| 357 |
+
The neighborhood of a node is the set of $k$ ( $k = 1 0$ in our experiments) nearest nodes where the distance is the Euclidean distance between 3D coordinates.
|
| 358 |
+
|
| 359 |
+
Node feature is a one dimension indicator (one-hot encoding) of the type of amino acid residue. This one dimension indicator will be passed into an embedding layer.
|
| 360 |
+
|
| 361 |
+
Local Coordinate System. Similar to Ingraham et al. (2019) and Jumper et al. (2021), we introduce a local coordinate system for each residue which denotes the orientation of a residue. Based on this, we can further design SE(3)-invariant edge features. As shown in Figure 7, for a residue $i$ , we denote the unit vector pointing from $\alpha$ -carbon atom to nitrogen atom as $\mathbf { u } _ { i }$ . We denote the unit vector pointing from $\alpha$ -carbon atom to carbon atom of the carboxyl (-CO-) as $\mathbf { t } _ { i }$ . $\mathbf { u } _ { i }$ and $\mathbf { t } _ { i }$ together define a plane, and the normal of this plane is $\begin{array} { r } { \mathbf { n } _ { i } = \frac { \mathbf { u } _ { i } \times \mathbf { t } _ { i } } { \left\| \mathbf { u } _ { i } \times \mathbf { t } _ { i } \right\| } } \end{array}$ . Finally, we define $\mathbf { v } _ { i } = \mathbf { n } _ { i } \times \mathbf { u } _ { i }$ . Then ${ \bf n } _ { i }$ $\mathbf { u } _ { i }$ and $\mathbf { v } _ { i }$ together form the basis of residue $i$ ’s local coordinate system. They together encode the orientation of residue $i$ .
|
| 362 |
+
|
| 363 |
+
Then we introduce the edge features of an edge $j \to i \in \mathcal { E }$ . These features describe the relative position of $j$ with respect to $i$ , the relative orientation of $j$ with respect to $i$ and the distance between $j$ and $i$ .
|
| 364 |
+
|
| 365 |
+
Relative Position Edge Features First we introduce the edge features $\mathbf { p } _ { j i }$ which describe relative position of $j$ with respect to $i$ :
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\mathbf { p } _ { j i } = [ \mathbf { \overline { { u } } } _ { i } ^ { \top } ] [ \mathbf { x } _ { j } - \mathbf { x } _ { i } ]
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Relative Orientation Edge Features As we mention above, each residue has orientation which carries information. Here we introduce the edge features $\mathbf { q } _ { j i } , \mathbf { k } _ { j i }$ and $\mathbf { t } _ { j i }$ which describe relative orientation of $j$ with respect to $i$ :
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
{ \bf q } _ { j i } = [ \bf { u } _ { i } ^ { \top } ] [ { \bf n } _ { j } ] , \quad { \bf k } _ { { j } i } = [ \bf { u } _ { i } ^ { \top } ] [ { \bf { u } } _ { j } ] , \quad { \bf t } _ { { j } i } = [ \bf { u } _ { i } ^ { \top } ] [ { \bf { v } } _ { j } ]
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Distance-Based Edge Features Distance also carries information. Here we use radial basis function of distance as edge features:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\mathbf { f } _ { j i , r } = e ^ { - \frac { ( \| \mathbf { x } _ { j } - \mathbf { x } _ { i } \| ) ^ { 2 } } { 2 \sigma _ { r } ^ { 2 } } } , r = 1 , 2 , . . . , R
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
Where $R$ and scale parameters $\{ \sigma _ { r } \} _ { 1 \le r \le R }$ are hyperparameters. In experiments, the set of scale parameters we used is $\{ 1 . 5 ^ { x } | x = 0 , 1 , \bar { 2 } , \bar { . . . } , 1 4 \}$ . So for each edge, there are 15 distance-based edge features.
|
| 384 |
+
|
| 385 |
+
Surface Aware Node Features We additionally compute 5 surface aware node features defined in Eq. (16) using $\lambda \in \{ 1 . , 2 . , 5 . , 1 0 . , 3 0 . \}$ .
|
| 386 |
+
|
| 387 |
+
# B PROOFS OF THE MAIN PROPOSITIONS
|
| 388 |
+
|
| 389 |
+
B.1 PROOF OF PROPOSITION 1.
|
| 390 |
+
|
| 391 |
+
Proof. Denote the predicted ligand position by $\mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) \mathbf { X } _ { 1 } + \mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) = \tilde { \mathbf { X } } _ { 1 } .$
|
| 392 |
+
|
| 393 |
+
Assume first that SE(3)-invariance of the predicted docked complex defined by Eq. (1) is satisfied. Then the transformation to dock $\mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 }$ with respect to $\mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 }$ is the same as the transformation to change $\mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 }$ into $\mathbf { Q } _ { 2 } \tilde { \mathbf { X } } _ { 1 } + \mathbf { g } _ { 2 }$ . We use the notation: $\mathbf { R } ^ { \top } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) = ( \mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) ) ^ { \top }$ . Then, we have the following derivation steps:
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { r l } & { \mathbf { R } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { X } _ { 1 } + \mathbf { t } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) = \tilde { \mathbf { X } } _ { 1 } } \\ & { \mathbf { X } _ { 1 } + \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { t } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) = \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \tilde { \mathbf { X } } _ { 1 } } \\ & { \mathbf { X } _ { 1 } + \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { t } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) = \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { Q } _ { 2 } ^ { \top } ( \mathbf { Q } _ { 2 } \tilde { \mathbf { X } } _ { 1 } + \mathbf { g } _ { 2 } - \mathbf { g } _ { 2 } ) } \\ & { \mathbf { X } _ { 1 } + \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { t } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) = \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { Q } _ { 2 } ^ { \top } ( \mathbf { Q } _ { 2 } \tilde { \mathbf { X } } _ { 1 } + \mathbf { g } _ { 2 } ) - \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { Q } _ { 2 } ^ { \top } \mathbf { g } _ { 2 } } \\ & \mathbf { X } _ { 1 } + \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { t } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) + \mathbf { R } ^ { \top } ( { \mathbf { X } } _ { 1 } | { \mathbf { X } } _ { 2 } ) \mathbf { Q } _ { 2 } ^ { \top } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
From the last equation above, one derives the transformation of $\mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 }$ into $\mathbf { Q } _ { 2 } \tilde { \mathbf { X } } _ { 1 } + \mathbf { g } _ { 2 }$ , which is, by definition of the functions $\mathbf { R }$ and $\mathbf { t }$ , the same as the transformation to dock $\mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 }$ with respect to $\mathbf { Q } _ { 2 } \mathbf { X } _ { 2 } + \mathbf { g } _ { 2 }$ . This transformation is
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } & { { \bf R } ( { \bf Q } _ { 1 } { \bf X } _ { 1 } + { \bf g } _ { 1 } | { \bf Q } _ { 2 } { \bf X } _ { 2 } + { \bf g } _ { 2 } ) = { \bf Q } _ { 2 } { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf Q } _ { 1 } ^ { \top } } \\ & { { \bf t } ( { \bf Q } _ { 1 } { \bf X } _ { 1 } + { \bf g } _ { 1 } | { \bf Q } _ { 2 } { \bf X } _ { 2 } + { \bf g } _ { 2 } ) = { \bf Q } _ { 2 } { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) - { \bf Q } _ { 2 } { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf Q } _ { 1 } ^ { \top } { \bf g } _ { 1 } + { \bf g } _ { 2 } } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
which concludes the proof.
|
| 406 |
+
|
| 407 |
+
Conversely, assuming constraints in Eq. (2) hold, we derive that $\mathbf { Q } _ { 1 } \mathbf { X } _ { 1 } + \mathbf { g } _ { 1 }$ is transformed into $\mathbf { Q } _ { 2 } \tilde { \mathbf { X } } _ { 1 } + \dot { \mathbf { g } } _ { 2 }$ , which then is trivial to check that it satisfies SE(3)-invariance of the predicted docked complex defined by Eq. (1).
|
| 408 |
+
|
| 409 |
+
# B.2 PROOF OF PROPOSITION 3.
|
| 410 |
+
|
| 411 |
+
Proof. We use the notation $\mathbf { R } ^ { \top } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) : = \mathbf { \Gamma } ( \mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) ) ^ { \top }$ . As in Appendix B.1, we denote $\mathbf { R } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) \mathbf { X } _ { 1 } + \mathbf { t } ( \mathbf { X } _ { 1 } | \mathbf { X } _ { 2 } ) = \tilde { \mathbf { X } } _ { 1 }$ . Then the transformation to dock $\mathbf { X } _ { 2 }$ with respect to $\mathbf { X } _ { 1 }$ is the same as the transformation to change $\tilde { \mathbf { X } } _ { 1 }$ back to $\mathbf { X } _ { 1 }$ , which is
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\begin{array} { r l } & { { \bf R } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf X } _ { 1 } + { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) = \tilde { \bf X } _ { 1 } } \\ & { { \bf X } _ { 1 } + { \bf R } ^ { \top } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) = { \bf R } ^ { \top } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) \tilde { \bf X } _ { 1 } } \\ & { { \bf X } _ { 1 } = { \bf R } ^ { \top } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) \tilde { \bf X } _ { 1 } - { \bf R } ^ { \top } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) { \bf t } ( { \bf X } _ { 1 } | { \bf X } _ { 2 } ) } \end{array}
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
From the last equation above, we derive the transformation to change $\tilde { \mathbf { X } } _ { 1 }$ back to $\mathbf { X } _ { 1 }$ , which is the same as the transformation to dock $\mathbf { X } _ { 2 }$ with respect to $\mathbf { X } _ { 1 }$ . □
|
| 418 |
+
|
| 419 |
+
# B.3 PROOF OF PROPOSITION 4.
|
| 420 |
+
|
| 421 |
+
Proof. Let IEGMN la $\mathbf { X } _ { 1 } ^ { ( l + 1 ) } , \mathbf { H } _ { 1 } ^ { ( l + 1 ) } , \mathbf { X } _ { 2 } ^ { ( l + 1 ) } , \mathbf { H } _ { 2 } ^ { ( l + 1 ) } = \operatorname { I E G M N } ( \mathbf { X } _ { 1 } ^ { ( l ) } , \mathbf { H } _ { 1 } ^ { ( l ) } , \mathbf { X } _ { 2 } ^ { ( l ) } , \mathbf { H } _ { 2 } ^ { ( l ) } )$ betors f an , we $\bar { \mathbf { Q } } _ { 1 } , \mathbf { Q } _ { 2 } \in S O ( 3 )$ $\mathbf { g } _ { 1 } , \mathbf { g } _ { 2 } \bar { \in } \mathbb { R } ^ { 3 }$ want to prove that IEGMN satisfy the pairwise independent SE(3)-equivariance property:
|
| 422 |
+
|
| 423 |
+
${ \bf 2 } _ { 1 } { \bf X } _ { 1 } ^ { ( l + 1 ) } + { \bf g } _ { 1 } , { \bf H } _ { 1 } ^ { ( l + 1 ) } , { \bf Q } _ { 2 } { \bf X } _ { 2 } ^ { ( l + 1 ) } + { \bf g } _ { 2 } , { \bf H } _ { 2 } ^ { ( l + 1 ) } = \mathrm { I E G M N } ( { \bf Q } _ { 1 } { \bf X } _ { 1 } ^ { ( l ) } + { \bf g } _ { 1 } , { \bf H } _ { 1 } ^ { ( l ) } , { \bf Q } _ { 2 } { \bf X } _ { 2 } ^ { ( l ) } + { \bf g } _ { 2 } , { \bf H } _ { 2 } ^ { ( l ) } )$ where each column of $\mathbf { X } _ { 1 } ^ { ( l ) } \in \mathbb { R } ^ { 3 \times n } , \mathbf { H } _ { 1 } ^ { ( l ) } \in \mathbb { R } ^ { d \times n } , \mathbf { X } _ { 2 } ^ { ( l ) } \in \mathbb { R } ^ { 3 \times m }$ and $\mathbf { H } _ { 2 } ^ { ( l ) } \in \mathbb { R } ^ { d \times m }$ represent an individual node’s coordinate embedding or feature embedding.
|
| 424 |
+
|
| 425 |
+
We first note that the equations of our proposed IEGMN layer that compute messages $\mathbf { m } _ { j i }$ , $\mu _ { j \to i }$ , $\mathbf { m } _ { i }$ and $\mu _ { i }$ are SE(3)-invariant. Indeed, they depend on the initial features which are SE(3)-invariant by design, the current latent node embeddings $\mathbf { \bar { \{ h } } _ { i } ^ { ( l ) } \} _ { i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } }$ , as well as the Euclidean distances on the current node coordinates $\{ \mathbf { x } _ { i } ^ { ( l ) } \} _ { i \in \mathcal { V } _ { 1 } \cup \mathcal { V } _ { 2 } }$ . Thus, we also derive that the equation that computes the new latent node embeddings $\mathbf { h } _ { i } ^ { ( l + 1 ) }$ is SE(3)-invariant. Last, the equation that updates the coordinates x(l+1)i is SE(3)-equivariant with respect to the 3D coordinates of nodes from the same graph as i, but SE(3)-invariant with respect to the 3D coordinates of nodes from the other graph since it only uses invariant transformations of the latter.
|
| 426 |
+
|
| 427 |
+
# C SURFACE FEATURES
|
| 428 |
+
|
| 429 |
+
Visualization. We further discuss our new surface features introduced in Eq. (16). We first visualize their design intuition in Fig. 8. A synthetic experiment is shown in Fig. 9.
|
| 430 |
+
|
| 431 |
+
Correlation with MSMS features. Next, we analyze how accurate are these features compared to established residue depth estimation methods, e.g. based on the MSMS software (Sanner et al., 1996). We plot the Spearman rank-order correlation of the two methods in Fig. 10. We observe a concentrated distribution with a mean of 0.68 and a median of 0.70, suggesting a strong correlation with the MSMS depth estimation.
|
| 432 |
+
|
| 433 |
+
Closed form expression. Finally, we prove that for points close to the protein surface and surrounded by (infinitely) many equally-distanced and equally-spaced points, one can derive a closed form expression of the surface features defined in Eq. (16). See Fig. 11. We work in 2 dimensions, but extensions to 3 dimensions are straightforward. Assume that the local surface at point $\mathbf { x } _ { i }$ has angle $\alpha$ . Further, assume that $\mathbf { x } _ { i }$ is surrounded by $N$ equally-distanced and equally-spaced points denoted by $\mathbf { x } _ { i } ^ { \prime }$ . Then, all $w _ { i , i ^ { \prime } , \lambda }$ will be identical. Then, the summation vector in the numerator of Eq. (16) will only have non-zero components on the direction that bisects the surface angle, as the other components will cancel-out. Then, under the limit $N \infty$ , we derive the closed form expression:
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\rho _ { i } ( \mathbf { x } _ { i } ; \lambda ) = { \frac { 1 } { N } } \left\| \sum _ { i ^ { \prime } \in N _ { i } } { \frac { \mathbf { x } _ { i } - \mathbf { x } _ { i ^ { \prime } } } { \| \mathbf { x } _ { i } - \mathbf { x } _ { i ^ { \prime } } \| } } \right\| = { \frac { 2 } { N } } \sum _ { j = 0 } ^ { \frac { N } { 2 } } \cos ( { \frac { j \alpha } { N } } ) \approx _ { N \to \infty } { \frac { 2 } { \alpha } } \int _ { 0 } ^ { \alpha / 2 } \cos ( \theta ) d \theta = 2 { \frac { \sin ( \alpha / 2 ) } { \alpha } }
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Figure 8: Intuition behind surface features defined in Eq. (16). a. Residues in the core (interior) of a protein are likely to have a small weighted average of directionally spread neighboring forces, while b. residues close to the surface receive vector contributions from a narrower space subset and, thus, have larger $\rho$ feature values.
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Figure 9: Distribution of our surface feature values defined in Eq. (16) for 500 points uniformly distributed in the unit circle. One can notice a strong correlation with the depth (i.e. distance to surface) which is further quantified in Fig. 10. Note that the scale for $\lambda$ in this synthetic experiment differs from that of real proteins.
|
| 444 |
+
|
| 445 |
+
# D DATASETS
|
| 446 |
+
|
| 447 |
+
The overview of datasets is in Table 2. DB5.5 is obtained from https://zlab.umassmed.edu/ benchmark/, while DIPS is downloaded from https://github.com/drorlab/DIPS. While DIPS contains only the bound structures, thus currently being only suitable for rigid docking, DB5.5 also includes unbound protein structures, however, mostly showing rigid structures - see Fig. 12.
|
| 448 |
+
|
| 449 |
+

|
| 450 |
+
Figure 10: Distribution of the Spearman rank-order coefficient computed per each protein as the correlation between MSMS residues’ depths and our surface features defined in Eq. (16) (for $\lambda = 3 0$ ). Histogram computed over the ligands in the DIPS test set (100 proteins).
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
Figure 11: For points close to the protein surface where the local surface angle is $\alpha$ we can derive a closed form expression for the surface feature defined in Eq. (16) under the assumption of being surrounded by infinitely many points at approximately equal distances and equally-spaced . A similar derivation is possible in 3D.
|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
Figure 12: Distance (RMSD) between unbound and bound structures of the DB5.5 dataset reveals that most of the proteins are relatively rigid. Thus, better datasets are needed to tackle the docking conformational change problem.
|
| 457 |
+
|
| 458 |
+
Table 2: Overview of Datasets. For DIPS, the statistics of number of residues and atoms per protein is based on a subset consisting of 200 proteins.
|
| 459 |
+
|
| 460 |
+
<table><tr><td colspan="4">Dataset # Pairs of Proteins # Residues per Protein # Atoms per Protein</td></tr><tr><td>DIPS</td><td>41876</td><td>276 (±189)</td><td>2159 (±1495)</td></tr><tr><td>DB5.5</td><td>253</td><td>268 (±215)</td><td>2089 (±1694)</td></tr></table>
|
| 461 |
+
|
| 462 |
+
# E MORE EXPERIMENTAL DETAILS AND RESULTS
|
| 463 |
+
|
| 464 |
+
Baseline Failures. On the test sets, ATTRACT fails for ’1N2C’ in DB5.5, ’oi_4oip.pdb1_8’, ’oi_4oip.pdb1 $_ { - 3 } ,$ and $\mathrm { ^ { , } p 7 } _ { - } 4 \mathrm { p 7 s . p d b 1 } _ { - } 2 \mathrm { ^ { , } }$ in DIPS. For such failure cases, we use the unbound input structure as the prediction for metrics calculation.
|
| 465 |
+
|
| 466 |
+
Hyperparameters. We perform hyperparameter search over the choices listed in Table 3 and select the best hyperparameters for DB5.5 and DIPS respectively based on their corresponding validation sets.
|
| 467 |
+
|
| 468 |
+
Table 3: Hyperparameter choices. LN stands for layer normalization, BN stands for batch normalization.
|
| 469 |
+
|
| 470 |
+
<table><tr><td>Hyperparameter</td><td>Choice</td></tr><tr><td>Node degree (for k-NN)</td><td>10</td></tr><tr><td>Weight of the intersection loss</td><td>0.0, 1.0</td></tr><tr><td>Normalization for hi of IEGMN layers</td><td>No,LN</td></tr><tr><td>Normalization for others</td><td>No, BN, LN</td></tr><tr><td>Number of attention heads (K)</td><td>25,50,100</td></tr><tr><td>Slope of leaky relu</td><td>0.1, 0.01</td></tr><tr><td>Dimension of hi of IEGMN layers</td><td>32,64</td></tr><tr><td>Dimension of residue type embedding</td><td>32,64</td></tr><tr><td>Number of IEGMN layers</td><td>5,8</td></tr><tr><td>If IEGMN layers except the first one share parameters T</td><td>True,False</td></tr><tr><td>η of coordinates skip connection</td><td>0.0, 0.25</td></tr><tr><td>Weight decay</td><td>0, 1e-5, 1e-4, 1e-3</td></tr></table>
|
| 471 |
+
|
| 472 |
+
Detailed Running Times. In addition to the main text, we show in Table 4 detailed running times of all methods. Hardware specifications are as follows: ATTRACT was run on a 6-Core Intel Core i7 $2 . 2 \operatorname { G H z }$ CPU; HDOCK was run on a single Intel Xeon Gold 6230 2.1 GHz CPU; EQUIDOCK was run on a single Intel Core i9-9880H 2.3 GHz CPU. CLUSPRO and PATCHDOCK have been manually run using their respective web servers.
|
| 473 |
+
|
| 474 |
+
Plots for DB5.5. We show the corresponding plots for DB5.5 results in Fig. 13.
|
| 475 |
+
|
| 476 |
+
Table 4: Inference time comparison (in seconds). Note: ClusPro and PatchDock were run manually using the respective public webservers, thus their runtimes are influenced by their cluster load.
|
| 477 |
+
|
| 478 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="5">Runtime on DIPS Test Set</td><td colspan="5">Runtime on DB5.5 Test Set</td></tr><tr><td>Mean</td><td>Median</td><td>Min</td><td>Max</td><td>Std</td><td>Mean</td><td>Median</td><td>Min</td><td>Max</td><td>Std</td></tr><tr><td>ATTRACT (LOCAL)</td><td>1285</td><td>793</td><td>62</td><td>8192</td><td>793</td><td>570</td><td>524</td><td>180</td><td>1708</td><td>373</td></tr><tr><td>HDOCK (LOCAL)</td><td>778</td><td>635</td><td>145</td><td>3177</td><td>570</td><td>615</td><td>461</td><td>210</td><td>2593</td><td>459</td></tr><tr><td>CLUSPRO (WEB)</td><td>10475</td><td>9831</td><td>2632</td><td>22654</td><td>4512</td><td>15507</td><td>14393</td><td>9207</td><td>28528</td><td>4126</td></tr><tr><td>PATCHDOCK(WEB)</td><td>7378</td><td>6900</td><td>600</td><td>16560</td><td>3979</td><td>3290</td><td>2820</td><td>1080</td><td>14520</td><td>2459</td></tr><tr><td>EQUIDOCK (LOCAL)</td><td>5</td><td>3</td><td>1</td><td>22</td><td>5</td><td>5</td><td>3</td><td>1</td><td>53</td><td>10</td></tr></table>
|
| 479 |
+
|
| 480 |
+
Ablation Studies. To highlight contributions of different model components, we provide ablation studies in Table 5. One can note that, as expected, removing the pocket loss results in lower interface RMSD scores compared to removing other components.
|
| 481 |
+
|
| 482 |
+
Analysis of the Intersection Loss. We further analyze the intersection loss introduced in Eq. (15) with parameters $\gamma = 1 0$ and $\sigma = 2 5$ (chosen on DB5 validation set). We show in Table 6 that this loss achieves almost perfect values for the ground truth structures, being important to softly constrain non-intersecting predicted proteins.
|
| 483 |
+
|
| 484 |
+

|
| 485 |
+
Figure 13: DB5.5 test results: a. Complex-RMSD distributions; b. Interface-RMSD distributions; c. scatter plot for C-RMSD vs I-RMSD.
|
| 486 |
+
|
| 487 |
+
Table 5: Ablation studies. We show DIPS test median C-RMSD and I-RMSD values for the corresponding best validation models. Abbreviations: “intersection $\mathbf { l o s s ^ { \prime \prime } = }$ intersection loss in Eq. (15), “pocket loss” $=$ pocket loss in Eq. (14), “surface feas” $=$ surface features in Eq. (16).
|
| 488 |
+
|
| 489 |
+
<table><tr><td>Model</td><td>C-RMSD I-RMSD</td></tr><tr><td>Full model</td><td>13.29</td><td>10.18</td></tr><tr><td>without pocket loss</td><td>15.91</td><td>12.01</td></tr><tr><td>without pocket loss,intersection loss</td><td>16.43</td><td>12.92</td></tr><tr><td>without pocket loss,surface feas</td><td>14.80</td><td>13.10</td></tr><tr><td>without pocket loss,intersection loss,surface feas</td><td>15.19</td><td>11.38</td></tr><tr><td>without surface feas</td><td>13.73</td><td>10.65</td></tr><tr><td>without intersection loss</td><td>15.49</td><td>11.09</td></tr><tr><td>without intersection loss, surface feas</td><td>15.04</td><td>10.94</td></tr></table>
|
| 490 |
+
|
| 491 |
+
Table 6: Values of the intersection loss defined in Eq. (15) and evaluated on the DIPS validation set in different scenarios. “Centered structures” means that both ground truth ligand and receptor point clouds have been centered (0-mean), without any other modifications.
|
| 492 |
+
|
| 493 |
+
<table><tr><td rowspan=1 colspan=1>Centeredstructures</td><td rowspan=1 colspan=1>EquiDock trainedwith intersection loss</td><td rowspan=1 colspan=1>EquiDock trainedwithout intersection loss</td><td rowspan=1 colspan=1>Ground truthcomplexes</td></tr><tr><td rowspan=1 colspan=1>56.42</td><td rowspan=1 colspan=1>12.68</td><td rowspan=1 colspan=1>21.03</td><td rowspan=1 colspan=1>1.16</td></tr></table>
|
md/dev/IfFZr1gl0b/IfFZr1gl0b.md
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Uni-Mol: A Universal 3D Molecular Representation Learning Framework
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Molecular representation learning (MRL) has gained tremendous attention due to its critical role in learning from limited supervised data for applications like drug design. In most MRL methods, molecules are treated as 1D sequential tokens or 2D topology graphs, limiting their ability to incorporate 3D information for downstream tasks and, in particular, making it almost impossible for 3D geometry prediction or generation. Herein, we propose Uni-Mol, a universal MRL framework that significantly enlarges the representation ability and application scope of MRL schemes. Uni-Mol is composed of two models with the same SE(3)-equivariant transformer architecture: a molecular pretraining model trained by 209M molecular conformations; a pocket pretraining model trained by 3M candidate protein pocket data. The two models are used independently for separate tasks, and are combined when used in protein-ligand binding tasks. By properly incorporating 3D information, Uni-Mol outperforms SOTA in 14/15 molecular property prediction tasks. Moreover, Uni-Mol achieves superior performance in 3D spatial tasks, including protein-ligand binding pose prediction, molecular conformation generation, etc. Finally, we show that Uni-Mol can be successfully applied to the tasks with few-shot data like pocket druggability prediction. The model and data will be made publicly available at https://github.com/dptech-corp/Uni-Mol.
|
| 11 |
+
|
| 12 |
+
# 19 1 Introduction
|
| 13 |
+
|
| 14 |
+
20 Recently, representation learning (or pretraining, self-supervised learning) [1, 2, 3] has been prevailing
|
| 15 |
+
21 in many applications, such as BERT [4] and GPT [5, 6, 7] in Natural Language Processing (NLP),
|
| 16 |
+
22 ViT [8] in Computer Vision (CV), etc. These applications have a common characteristic: unlabeled
|
| 17 |
+
23 data is abundant, while labeled data is limited. As a solution, in a typical representation learning
|
| 18 |
+
24 method, one first adopts a pretraining procedure to learn a good representation from large-scale
|
| 19 |
+
25 unlabeled data, and then a finetuning scheme is followed to extract more information from limited
|
| 20 |
+
26 supervised data.
|
| 21 |
+
27 Applications in the field of drug design share the characteristic that calls for representation learning
|
| 22 |
+
28 schemes. The chemical space that a drug candidate lies in is vast, while drug-related labeled data is
|
| 23 |
+
29 limited. Not surprisingly, compared with traditional molecular fingerprint based models [9, 10], recent
|
| 24 |
+
30 molecular representation learning (MRL) models perform much better in most property prediction
|
| 25 |
+
31 tasks [11, 12, 13]. However, to further improve the performance and extend the application scope
|
| 26 |
+
32 of existing MRL models, one is faced with a critical issue. From the perspective of life science, the
|
| 27 |
+
33 properties of molecules and the effects of drugs are mostly determined by their 3D structures [14,
|
| 28 |
+
34 15]. In most current MRL methods, one starts with representing molecules as 1D sequential strings,
|
| 29 |
+
35 such as SMILES [16, 17, 18] and InChI [19, 20, 21], or 2D graphs [22, 11, 23, 12, 24]. This may
|
| 30 |
+
36 limit their ability to incorporate 3D information for downstream tasks. In particular, this makes it
|
| 31 |
+
37 almost impossible for 3D geometry prediction or generation, such as, e.g., the prediction of protein
|
| 32 |
+
38 ligand binding pose [25]. Even though there have been some recent attempts trying to leverage 3D
|
| 33 |
+
39 information in MRL [26, 27], the performance is less than optimal, possibly due to the small size of
|
| 34 |
+
40 3D datasets, and 3D positions can not be used as inputs/outputs during finetuning, since they only
|
| 35 |
+
41 serve as auxiliary information.
|
| 36 |
+
42 In this work, we propose Uni-Mol, to our best knowledge, the first universal 3D molecular pretraining
|
| 37 |
+
43 framework, which is derived from large-scale unlabeled data and is able to directly take 3D positions
|
| 38 |
+
44 as both inputs and outputs. Uni-Mol consists of 3 parts. 1) Backbone. Based on Transformer, the
|
| 39 |
+
45 invariant spatial positional encoding and pair level representation are added to better capture the 3D
|
| 40 |
+
46 information. Moreover, an equivariant head is used to directly predict 3D positions. 2) Pretraining.
|
| 41 |
+
47 We create two large-scale datasets, a 209M molecular conformation dataset and a 3M candidate
|
| 42 |
+
48 protein pocket dataset, for pretraining 2 models on molecules and protein pockets, respectively.
|
| 43 |
+
49 For the pretraining tasks, besides masked atom prediction, a 3D position denoising task is used
|
| 44 |
+
50 for learning 3D spatial representation. 3) Finetuning. According to specific downstream tasks, the
|
| 45 |
+
51 used pretraining models are different. For example, in molecular property prediction tasks, only the
|
| 46 |
+
52 molecular pretraining model is used; in protein-ligand binding pose prediction, both two pretraining
|
| 47 |
+
53 models are used. We refer to Fig. 1 for an overall schematic illustration of the Uni-Mol framework.
|
| 48 |
+
54 To demonstrate the effectiveness of Uni-Mol, we conduct experiments on a series of downstream
|
| 49 |
+
55 tasks. In the molecular property prediction tasks, Uni-Mol outperforms SOTA on 14/15 datasets on
|
| 50 |
+
56 the MoleculeNet benchmark. In 3D geometric tasks, Uni-Mol also achieves superior performance.
|
| 51 |
+
57 For the pose prediction of protein-ligand complexes, Uni-Mol predicts $8 8 . 0 7 \%$ binding poses with
|
| 52 |
+
58 $\mathrm { R M S D } < = 2 \bar { \mathring { \mathrm { A } } } .$ , $2 2 . 8 1 \%$ more than popular docking methods, and ranks 1st in the docking power test
|
| 53 |
+
59 on CASF-2016 [28] benchmark. Regarding molecular conformation generation, Uni-Mol achieves
|
| 54 |
+
60 SOTA for both Coverage and Matching metrics on GEOM-QM9 and GEOM-Drugs [29]. Moreover,
|
| 55 |
+
61 Uni-Mol can be successfully applied to tasks with very limited data like pocket druggability prediction.
|
| 56 |
+
62
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 1: Schematic illustration of the Uni-Mol framework. Uni-Mol is composed of two models: a molecular pretraining model trained by 209M molecular 3D conformations; a pocket pretraining model trained by 3M candidate protein pocket data. The two models are used independently for separate tasks, and are combined when used in protein-ligand binding tasks.
|
| 60 |
+
|
| 61 |
+
# 63 2 Uni-Mol Framework
|
| 62 |
+
|
| 63 |
+
64 In this section, we introduce the Uni-Mol framework by showing the details of the backbone, the
|
| 64 |
+
65 pretraining scheme, and the finetuning scheme. We refer to Fig. 2 for a schematic illustration of the
|
| 65 |
+
66 model architecture.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 2: Left: the overall pretraining architecture. Middle: the model inputs, including atoms and spatial positional encoding created by pair Euclidean distance. Right: pair representation and its update process.
|
| 69 |
+
|
| 70 |
+
# 67 2.1 Backbone
|
| 71 |
+
|
| 72 |
+
68 Transformer [30] is widely used as a backbone model in representation learning. However, Trans
|
| 73 |
+
69 former was originally designed for NLP tasks and cannot handle 3D spatial data directly. To tackle
|
| 74 |
+
70 this, based on the standard Transformer with Pre-LayerNorm [31] backbone, we introduce several
|
| 75 |
+
71 modifications.
|
| 76 |
+
72 Invariant spatial positional encoding Due to its permutationally invariant property, Transformer
|
| 77 |
+
73 cannot distinguish the positions of inputs without positional encoding. Different with the discrete
|
| 78 |
+
74 (ordinal) positions used in NLP/CV [32, 33], the positions in 3D space, i.e. coordinates, are continuous
|
| 79 |
+
75 values. Besides, the positional encoding procedure needs to be invariant under global rotation and
|
| 80 |
+
76 translation. To achieve that, similar to the relative positional encoding, we simply use Euclidean
|
| 81 |
+
77 distances of all atom pairs, as well as pair-type aware Gaussian kernels [34]. Formally, the $D$ -channel
|
| 82 |
+
78 positional encoding of atom pair $i j$ is denoted as
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\pmb { p } _ { i j } = \{ \mathcal { G } ( A ( d _ { i j } , t _ { i j } ; \pmb { a } , \pmb { b } ) , \mu ^ { k } , \sigma ^ { k } ) | k \in [ 1 , D ] \} , \quad \pmb { \mathcal { A } } ( d , r ; \pmb { a } , \pmb { b } ) = a _ { r } d + b _ { r } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
79 where $\begin{array} { r } { \mathcal { G } ( d , \mu , \sigma ) = \frac { 1 } { \sigma \sqrt { 2 \pi } } e ^ { - \frac { ( d - \mu ) ^ { 2 } } { 2 \sigma ^ { 2 } } } } \end{array}$ is a Gaussian density function with parameters $\mu$ and $\sigma , d _ { i j }$ is the
|
| 89 |
+
80 Euclidean distance of atom pair $i j$ , and $t _ { i j }$ is the pair-type of atom pair $i j$ . Please note the pair-type
|
| 90 |
+
81 here is not the chemical bond, and it is determined by the atom types of pair $i j$ . $\mathcal { A } ( d _ { i j } , t _ { i j } ; \pmb { a } , \pmb { b } )$ is
|
| 91 |
+
82 the affine transformation with parameters $\textbf { \em a }$ and $^ { b }$ , it affines $d _ { i j }$ corresponding to its pair-type $t _ { i j }$
|
| 92 |
+
83 Except $d _ { i j }$ and $t _ { i j }$ , all remaining parameters are trainable and randomly initialized.
|
| 93 |
+
84 Pair representation By default, Transformer maintains the token(atom) level representation, which
|
| 94 |
+
85 is later used in finetuning downstream tasks. Nevertheless, as the spatial positions are encoded at
|
| 95 |
+
86 pair-level, we also maintain the pair-level representation, to better learn the 3D spatial representation.
|
| 96 |
+
87 Specifically, the pair representation is initialized as the aforementioned spatial positional encoding.
|
| 97 |
+
88 Then, to update pair representation, we use the atom-to-pair communication via the multi-head Query
|
| 98 |
+
89 Key product results in self-attention. Formally, the update of $i j$ pair representation is denoted as
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\pmb { q } _ { i j } ^ { 0 } = { \pmb { p } } _ { i j } M , \quad \pmb { q } _ { i j } ^ { l + 1 } = \pmb { q } _ { i j } ^ { l } + \{ \frac { { \pmb { Q } } _ { i } ^ { l , h } ( \pmb { K } _ { j } ^ { l , h } ) ^ { T } } { \sqrt { d } } | h \in [ 1 , H ] \} ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where 90 $\pmb { q } _ { i j } ^ { l }$ is the pair representation of atom pair $i j$ in $l$ -th layer, $H$ is the number of attention heads, 91 $d$ is the dimension of hidden representations, $Q _ { i } ^ { l , h } ( K _ { j } ^ { l , h } )$ is the Query (Key) of the $i$ -th ( $j$ -th) atom 92 in the $l$ -th layer $h$ -th head, and $M \in \mathbb { R } ^ { D \times H }$ is the projection matrix to make the representation the 93 same shape as multi-head Query-Key product results.
|
| 105 |
+
|
| 106 |
+
94 Besides, to leverage 3D information in the atom representation, we also introduce the pair-to-atom
|
| 107 |
+
95 communication, by using the pair representation as the bias term in self-attention. Formally, the
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathrm { A t t e n t i o n } ( Q _ { i } ^ { l , h } , { \bf K } _ { j } ^ { l , h } , { \bf V } _ { j } ^ { l , h } ) = \mathrm { s o f t m a x } ( \frac { Q _ { i } ^ { l , h } ( { \bf K } _ { j } ^ { l , h } ) ^ { T } } { \sqrt { d } } + { \bf q } _ { i j } ^ { l - 1 , h } ) { \bf V } _ { j } ^ { l , h } ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
97 where $V _ { . j } ^ { l , h }$ is the Value of the $j$ -th atom in the $l$ -th layer $h$ -th head. The pair representation and
|
| 114 |
+
98 atom-pair communication are firstly proposed in the Evoformer in AlphaFold [35], but the cost of
|
| 115 |
+
99 Evoformer is extremely large. In Uni-Mol, as we keep them as simple as possible, the extra cost of
|
| 116 |
+
100 maintaining pair representation is negligible.
|
| 117 |
+
101 SE(3)-Equivariance coordinate head With 3D spatial positional encoding and pair representation,
|
| 118 |
+
102 the model can learn a good 3D representation. However, it still lacks the ability to directly output co
|
| 119 |
+
103 ordinates, which is essential in 3D spatial tasks. To this end, we add a simple SE(3)-equivariance head
|
| 120 |
+
104 to Uni-Mol. Following the idea of EGNN [36], the design of SE(3)-equivariance head is denoted as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\hat { \pmb x } _ { i } = { \pmb x } _ { i } + \sum _ { j = 1 } ^ { n } \frac { ( { \pmb x } _ { i } - { \pmb x } _ { j } ) c _ { i j } } { n } , \quad c _ { i j } = \mathrm { R e L U } ( ( { \pmb q } _ { i j } ^ { L } - { \pmb q } _ { i j } ^ { 0 } ) U ) W ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
105 where $n$ is the number of total atoms, $L$ is the number of layers in model, $\pmb { x } _ { i } \in \mathbb { R } ^ { 3 }$ is the input
|
| 127 |
+
106 coordinate of $i$ -th atom, and $\hat { \pmb { x } } _ { i } \in \mathbb { R } ^ { 3 }$ is the output coordinate of $i$ -th atom, $\mathrm { R e L U } ( y ) = \operatorname* { m a x } ( 0 , y )$
|
| 128 |
+
107 is Rectified Linear Unit [37], $U \in \mathbb { R } ^ { H \times H }$ and $\dot { \boldsymbol { W } } \in \mathbb { R } ^ { H \times 1 }$ are the projection matrices to convert
|
| 129 |
+
108 pair representation to scalar.
|
| 130 |
+
|
| 131 |
+
# 09 2.2 Pretraining
|
| 132 |
+
|
| 133 |
+
110 For the purpose of pretraining, we generate two large-scale datasets, one composed of 3D structures
|
| 134 |
+
111 of organic molecules, and another composed of 3D structures of candidate protein pockets. Then,
|
| 135 |
+
112 two models are pretrained using these two datasets, respectively. As pockets are directly involved
|
| 136 |
+
113 in many drug design tasks, intuitively, the pretraining on candidate protein pockets can boost the
|
| 137 |
+
114 performance of tasks related to protein-ligand structures and interactions.
|
| 138 |
+
115 The molecular pretraining dataset is based on multiple public datasets (See Appendix ?? for more
|
| 139 |
+
116 information). After normalizing and deduplicating, it contains about 19M molecules. To generate
|
| 140 |
+
117 3D conformations, we use ETKGD [38] with Merck Molecular Force Field [39] optimization
|
| 141 |
+
118 in RDKit [40] to randomly generate 10 conformations for each molecule. We also generate an
|
| 142 |
+
119 additional 2D conformation (based on the molecular graph), to avoid some rare cases that fail to
|
| 143 |
+
120 generate 3D conformations.
|
| 144 |
+
121 The protein pocket pretraining dataset is derived from the Protein Data Bank (RCSB PDB 1) [41], a
|
| 145 |
+
122 collection of 180K 3D structures of proteins. To extract candidate pockets, we first clean the data
|
| 146 |
+
123 by adding the missing side chains and hydrogen atoms; then we use Fpocket [42] to detect possible
|
| 147 |
+
124 binding pockets of the proteins; and finally, we filter pockets by the number of residues in contact
|
| 148 |
+
125 with and retains water molecules in the pocket. In this way, We collect a dataset composed of 3.2M
|
| 149 |
+
126 candidate pockets for pretraining.
|
| 150 |
+
127 Self-supervised task is vitally important for effective learning from large-scale unlabeled data.
|
| 151 |
+
128 For example, the masked token prediction task in BERT [4] encourages the model to learn the
|
| 152 |
+
129 contextual information. Similar to BERT, the masked atom prediction task is used in Uni-Mol.
|
| 153 |
+
130 For each molecule/pocket, we add a special atom [CLS], whose coordinate is the center of all
|
| 154 |
+
131 atoms, to represent the whole molecule/pocket. However, as 3D spatial positional encoding leaks
|
| 155 |
+
132 chemical bonds, atom types could be inferred easily, and therefore, the masked atom prediction
|
| 156 |
+
133 cannot encourage the model to learn useful information. To tackle this, as well as learning from 3D
|
| 157 |
+
134 information, we design a 3D position denoising task. Particularly, uniform noises of $[ - 1 \bar { \mathrm { \bf A } } , 1 \bar { \mathrm { \bf A } } ]$ are
|
| 158 |
+
135 added to the random $15 \%$ atom coordinates, then the spatial positional encoding is calculated based
|
| 159 |
+
136 on corrupted coordinates. In this way, the masked atom prediction task becomes non-trivial. Besides,
|
| 160 |
+
137 two additional heads are used to recover the correct spatial positions. 1) Pair-distance prediction.
|
| 161 |
+
138 Based on pair-representation, the model needs to predict the correct Euclidean distances of the atoms
|
| 162 |
+
139 pairs with corrupted coordinates. 2) Coordinate prediction. Based on SE(3)-Equivariance coordinate
|
| 163 |
+
140 head, the model needs to predict the correct coordinates for the atoms with corrupted coordinates.
|
| 164 |
+
141 Both 2 pretraining models use the same self-supervised tasks described above, and Figure 2 is the
|
| 165 |
+
142 illustration of the overall pretraining framework. For the detailed configurations of pretraining, please
|
| 166 |
+
143 refer to Appendix ??.
|
| 167 |
+
|
| 168 |
+
# 2.3 Finetuning
|
| 169 |
+
|
| 170 |
+
145 To be consistent with pretraining, we use the same data prepossessing pipeline during finetuning.
|
| 171 |
+
146 For molecules, as multiple random conformations can be generated in a short time, we can use them
|
| 172 |
+
147 as data augmentation in finetuning to improve performance and robustness. Some molecules may fail
|
| 173 |
+
148 to generate 3D conformations, and we use their molecular graph as 2D conformation. For tasks that
|
| 174 |
+
149 provide atom coordinates, we use them directly and skip the 3D conformation generation process.
|
| 175 |
+
150 As there are 2 pretraining models and several types of downstream tasks, we should properly use
|
| 176 |
+
151 them in the finetuning stage. According to the task types, and the involvement of protein or ligand,
|
| 177 |
+
152 we can categorize them as follow.
|
| 178 |
+
153 Non-3D prediction tasks These tasks do not need to output 3D conformations. Examples include
|
| 179 |
+
154 molecular property prediction, molecule similarity, pocket druggability prediction, protein-ligand
|
| 180 |
+
155 binding affinity prediction, etc. Similar to NLP/CV, we can simply use the representation of [CLS]
|
| 181 |
+
156 which represents the whole molecule/pocket, or the mean representation of all atoms, with a linear
|
| 182 |
+
157 head to finetune on downstream tasks. In the tasks with pocket-molecule pair, we can concatenate
|
| 183 |
+
158 their [CLS] representations, and then finetune with linear head.
|
| 184 |
+
|
| 185 |
+
3D prediction tasks of molecules or pockets These tasks need to predict a 3D conformation of the input, such as molecular conformation generation. Different with the fast conformation generation method used in Uni-Mol, molecular conformation generation task usually requires running advanced sampling and semi-empirical density functional theory (DFT) to account for the ensemble of 3D conformers that are accessible to a molecule, and this is very time-consuming. Therefore, there are many recent works that train the model to fast generate conformations from molecular graph [43, 44, 45, 46]. While in Uni-Mol, this task straightforwardly becomes a conformation optimization task: generate a new conformation based on a different input conformation. Specifically, in finetuning, the model supervised learns the mapping from Uni-Mol generated conformations to the labeled conformations. Moreover, the optimized conformations can be generated end-to-end by SE(3)-Equivariance coordinate head.
|
| 186 |
+
|
| 187 |
+
170 3D prediction tasks of protein-ligand pairs This is one of the most important tasks in structure
|
| 188 |
+
171 based drug design. The task is to predict the complex structure of a protein binding site and a
|
| 189 |
+
172 molecular ligand. Besides the conformation changes of the pocket and the molecule themselves, we
|
| 190 |
+
173 also need to consider how the molecule lays in the pocket, that is, the additional 6 degrees (3 rotations
|
| 191 |
+
174 and 3 translations) of freedom of a rigid movement. In principle, with Uni-Mol, we can predict the
|
| 192 |
+
175 complex conformation by the SE(3)-Equivariant coordinate head in an end-to-end fashion. However,
|
| 193 |
+
176 this is unstable as it is very sensitive to the initial docking positions of molecular ligand. Herein, to
|
| 194 |
+
177 get rid of the initial positions, we use a scoring function based optimization method in this paper. In
|
| 195 |
+
178 particular, the molecular representation and pocket representation are firstly obtained from their own
|
| 196 |
+
179 pretraining models by their own conformations; then, their representations are concatenated as the
|
| 197 |
+
180 input of an additional 4-layer Uni-Mol decoder, which is finetuned to learn the pair distances of all
|
| 198 |
+
181 atoms in molecule and pocket. With the predicted pair-distance matrix as the scoring function, we
|
| 199 |
+
182 use a simple differential evolution algorithm [47] to sample and optimize the complex conformations.
|
| 200 |
+
183 More details can be found in Appendix ??.
|
| 201 |
+
|
| 202 |
+
# 184 3 Experiments
|
| 203 |
+
|
| 204 |
+
To verify the effectiveness of our proposed Uni-Mol model, we conduct extensive experiments on multiple downstream tasks, including molecular property prediction, molecular conformation generation, pocket property prediction, and protein-ligand binding pose prediction. Besides, we also conduct several ablation studies. Due to space restrictions, we leave the detailed experimental settings and ablation studies to Appendix ??.
|
| 205 |
+
|
| 206 |
+
# 3.1 Molecular property prediction
|
| 207 |
+
|
| 208 |
+
191 Datasets and setup MoleculeNet [48] is a widely used benchmark for molecular property
|
| 209 |
+
192 prediction, including datasets focusing on different levels of properties of molecules, from quantum
|
| 210 |
+
193 mechanics and physical chemistry to biophysics and physiology. Following previous work GEM [13],
|
| 211 |
+
194 we use scaffold splitting for the dataset and report the mean and standard deviation of the results
|
| 212 |
+
195 for three random seeds.
|
| 213 |
+
196 Baselines We compare Uni-Mol with multiple baselines, including supervised and pretraining
|
| 214 |
+
197 baselines. D-MPNN [49] and AttentiveFP [50] are supervised GNNs methods. N-gram [51],
|
| 215 |
+
198 PretrainGNN [22], GROVER [11], GraphMVP [26], MolCLR [12], and GEM [13] are pretraining
|
| 216 |
+
199 methods. N-gram embeds the nodes in the graph and assembles them in short walks as the graph
|
| 217 |
+
200 representation. Random Forest and XGBoost [52] are used as the predictor for downstream tasks.
|
| 218 |
+
|
| 219 |
+
Table 1: Uni-Mol performance on molecular property prediction classification tasks
|
| 220 |
+
|
| 221 |
+
<table><tr><td colspan="11">Classification (ROC-AUC %,higher is better ↑)</td></tr><tr><td>Datasets #Molecules # Tasks</td><td>BBBP 2039 1</td><td>BACE 1513 1</td><td>ClinTox 1478 2</td><td>Tox21 7831 12</td><td>ToxCast 8575 617</td><td>SIDER 1427 27</td><td>HIV 41127 1</td><td>PCBA 437929 128</td><td>MUV 93087 17</td></tr><tr><td>D-MPNN</td><td>71.0(0.3)</td><td>80.9(0.6)</td><td>90.6(0.6)</td><td>75.9(0.7)</td><td>65.5(0.3)</td><td>57.0(0.7)</td><td>77.1(0.5)</td><td>86.2(0.1)</td><td>78.6(1.4)</td></tr><tr><td>Attentive FP</td><td>64.3(1.8)</td><td>78.4(0.022)</td><td>84.7(0.3)</td><td>76.1(0.5)</td><td>63.7(0.2)</td><td>60.6(3.2)</td><td>75.7(1.4)</td><td>80.1(1.4)</td><td>76.6(1.5)</td></tr><tr><td>N-GramRF</td><td>69.7(0.6)</td><td>77.9(1.5)</td><td>77.5(4.0)</td><td>74.3(0.4)</td><td></td><td>66.8(0.7)</td><td>77.2(0.1)</td><td></td><td>76.9(0.7)</td></tr><tr><td>N-GramxGB</td><td>69.1(0.8)</td><td>79.1(1.3)</td><td>87.5(2.7)</td><td>75.8(0.9)</td><td></td><td>65.5(0.7)</td><td>78.7(0.4)</td><td></td><td>74.8(0.2)</td></tr><tr><td>PretrainGNN</td><td>68.7(1.3)</td><td>84.5(0.7)</td><td>72.6(1.5)</td><td>78.1(0.6)</td><td>65.7(0.6)</td><td>62.7(0.8)</td><td>79.9(0.7)</td><td>86.0(0.1)</td><td>81.3(2.1)</td></tr><tr><td>GROVERbase</td><td>70.0(0.1)</td><td>82.6(0.7)</td><td>81.2(3.0)</td><td>74.3(0.1)</td><td>65.4(0.4)</td><td>64.8(0.6) 65.4(0.1)</td><td>62.5(0.9) 68.2(1.1)</td><td>76.5(2.1)</td><td>67.3(1.8)</td></tr><tr><td>GROVERlarge</td><td>69.5(0.1) 72.4(1.6)</td><td>81.0(1.4)</td><td>76.2(3.7)</td><td>73.5(0.1)</td><td>65.3(0.5) 63.1(0.4)</td><td></td><td></td><td>83.0(0.4)</td><td>67.3(1.8)</td></tr><tr><td>GraphMVP</td><td>72.2(2.1)</td><td>81.2(0.9) 82.4(0.9)</td><td>79.1(2.8) 91.2(3.5)</td><td>75.9(0.5) 75.0(0.2)</td><td></td><td>63.9(1.2) 58.9(1.4)</td><td>77.0(1.2) 78.1(0.5)</td><td></td><td>77.7(0.6)</td></tr><tr><td>MolCLR GEM</td><td>72.4(0.4)</td><td>85.6(1.1)</td><td>90.1(1.3)</td><td>78.1(0.1)</td><td>69.2(0.4)</td><td>67.2(0.4)</td><td>80.6(0.9)</td><td>86.6(0.1)</td><td>79.6(1.9) 81.7(0.5)</td></tr><tr><td>Uni-Mol</td><td>72.9(0.6)</td><td>85.7(0.2)</td><td>91.9(1.8)</td><td>79.6(0.5)</td><td>69.6(0.1)</td><td>65.9(1.3)</td><td>80.8(0.3)</td><td>88.5(0.1)</td><td>82.1(1.3)</td></tr></table>
|
| 222 |
+
|
| 223 |
+
Table 2: Uni-Mol performance on molecular property prediction regression tasks
|
| 224 |
+
|
| 225 |
+
<table><tr><td colspan="6">Regression (lower is better ↓)</td></tr><tr><td colspan="3">RMSE</td><td colspan="3">MAE</td></tr><tr><td>Datasets # Molecules</td><td>ESOL 1128</td><td>FreeSolv 642</td><td>Lipo 4200</td><td>QM7 6830</td><td>QM8 21786</td><td>QM9 133885</td></tr><tr><td>#Tasks D-MPNN</td><td>1</td><td>1</td><td>1</td><td>1</td><td>12</td><td>3</td></tr><tr><td></td><td>1.050(0.008)</td><td>2.082(0.082)</td><td>0.683(0.016)</td><td>103.5(8.6)</td><td>0.0190(0.0001)</td><td>0.00814(0.00001)</td></tr><tr><td>Attentive FP</td><td>0.877(0.029)</td><td>2.073(0.183)</td><td>0.721(0.001)</td><td>72.0(2.7)</td><td>0.0179(0.001)</td><td>0.00812(0.00001)</td></tr><tr><td>N-GramRF</td><td>1.074(0.107)</td><td>2.688(0.085)</td><td>0.812(0.028)</td><td>92.8(4.0)</td><td>0.0236(0.0006)</td><td>0.01037(0.00016)</td></tr><tr><td>N-GramxGB</td><td>1.083(0.082)</td><td>5.061(0.744)</td><td>2.072(0.030)</td><td>81.9(1.9)</td><td>0.0215(0.0005)</td><td>0.00964(0.00031)</td></tr><tr><td>PretrainGNN</td><td>1.100(0.006)</td><td>2.764(0.002)</td><td>0.739(0.003)</td><td>113.2(0.6)</td><td>0.0200(0.0001)</td><td>0.00922(0.00004)</td></tr><tr><td>GROVERbase</td><td>0.983(0.090)</td><td>2.176(0.052)</td><td>0.817(0.008)</td><td>94.5(3.8)</td><td>0.0218(0.0004)</td><td>0.00984(0.00055)</td></tr><tr><td>GROVERlarge</td><td>0.895(0.017)</td><td>2.272(0.051)</td><td>0.823(0.010)</td><td>92.0(0.9)</td><td>0.0224(0.0003)</td><td>0.00986(0.00025)</td></tr><tr><td>GraphMVP</td><td>1.029(0.033)</td><td></td><td>0.681(0.010)</td><td></td><td></td><td></td></tr><tr><td>MoiCLR</td><td>1.271(0.040)</td><td>2.594(0.249)</td><td>0.691(0.004)</td><td>66.8(2.3)</td><td>0.0178(0.0003)</td><td></td></tr><tr><td>GEM</td><td>0.798(0.029)</td><td>1.877(0.094)</td><td>0.660(0.008)</td><td>58.9(0.8)</td><td>0.0171(0.0001)</td><td>0.00746(0.00001)</td></tr><tr><td>Uni-Mol</td><td>0.788(0.029)</td><td>1.620(0.035)</td><td>0.603(0.010)</td><td>41.8(0.2)</td><td>0.0156(0.0001)</td><td>0.00467(0.00004)</td></tr></table>
|
| 226 |
+
|
| 227 |
+
Results Table 1 and Table 2 show the experiment results of Uni-Mol and competitive baselines, where the best results are marked in bold. Most baseline results are from the paper of GEM, except for the recent works GraphMVP and MolCLR. The results of GraphMVP are from its paper. As MolCLR uses a different data split setting (without considering chirality), we rerun it with the same data split setting as other baselines. From the results, we can summarize them as follows: 1) overall, Uni-Mol outperforms baselines on almost all downstream datasets. 2) In solubility (ESOL, Lipo), free energy (FreeSolv), and quantum mechanical (QM7, QM8, QM9) properties prediction tasks, Uni-Mol is significantly better than baselines. As 3D information is critical in these properties, it indicates that Uni-Mol can learn a better 3D representation than other baselines. 3) Uni-Mol fails to beat SOTA on the SIDER dataset. After investigation, we find Uni-Mol fails to generate 3D conformations (and rollbacks to 2D graphs) for many molecules (like natural products and peptides) in SIDER. Therefore, due to the missing 3D information, it is reasonable that Uni-Mol cannot outperform others.
|
| 228 |
+
|
| 229 |
+
213 In summary, by better utilizing 3D information in pretraining, Uni-Mol outperforms all previous
|
| 230 |
+
214 MRL models in almost all property prediction tasks.
|
| 231 |
+
|
| 232 |
+
Table 3: Uni-Mol performance on molecular conformation generation
|
| 233 |
+
|
| 234 |
+
<table><tr><td rowspan="3">Dataset Methods</td><td colspan="4">QM9</td><td colspan="4">Drugs</td></tr><tr><td colspan="2">COV(↑, %)</td><td colspan="2">MAT(↓, A)</td><td colspan="2">COV(↑,%)</td><td colspan="2">MAT(↓,A)</td></tr><tr><td>Mean</td><td>Median</td><td>Mean</td><td>Median</td><td>Mean</td><td>Median</td><td>Mean</td><td>Median</td></tr><tr><td>RDKit</td><td>83.26</td><td>90.78</td><td>0.3447</td><td>0.2935</td><td>60.91</td><td>65.70</td><td>1.2026</td><td>1.1252</td></tr><tr><td>CVGAE</td><td>0.09</td><td>0.00</td><td>1.6713</td><td>1.6088</td><td>0.00</td><td>0.00</td><td>3.0702</td><td>2.9937</td></tr><tr><td>GraphDG</td><td>73.33</td><td>84.21</td><td>0.4245</td><td>0.3973</td><td>8.27</td><td>0.00</td><td>1.9722</td><td>1.9845</td></tr><tr><td>CGCF</td><td>78.05</td><td>82.48</td><td>0.4219</td><td>0.3900</td><td>53.96</td><td>57.06</td><td>1.2487</td><td>1.2247</td></tr><tr><td>ConfVAE</td><td>80.42</td><td>85.31</td><td>0.4066</td><td>0.3891</td><td>53.14</td><td>53.98</td><td>1.2392</td><td>1.2447</td></tr><tr><td>ConfGF</td><td>88.49</td><td>94.13</td><td>0.2673</td><td>0.2685</td><td>62.15</td><td>70.93</td><td>1.1629</td><td>1.1596</td></tr><tr><td>GeoMol</td><td>71.26</td><td>72.00</td><td>0.3731</td><td>0.3731</td><td>67.16</td><td>71.71</td><td>1.0875</td><td>1.0586</td></tr><tr><td>DGSM</td><td>91.49</td><td>95.92</td><td>0.2139</td><td>0.2137</td><td>78.73</td><td>94.39</td><td>1.0154</td><td>0.9980</td></tr><tr><td>DMCG</td><td>96.34</td><td>99.53</td><td>0.2065</td><td>0.2003</td><td>96.69</td><td>100.00</td><td>0.7223</td><td>0.7236</td></tr><tr><td>GeoDiff</td><td>90.07</td><td>93.39</td><td>0.2090</td><td>0.1988</td><td>89.13</td><td>97.88</td><td>0.8629</td><td>0.8529</td></tr><tr><td>Uni-Mol</td><td>98.68</td><td>100.00</td><td>0.1806</td><td>0.1510</td><td>92.69</td><td>100.00</td><td>0.6596</td><td>0.6215</td></tr></table>
|
| 235 |
+
|
| 236 |
+
# 15 3.2 Molecular conformation generation
|
| 237 |
+
|
| 238 |
+
Datasets and setup Following the settings in previous works [44, 53], we use GEOM-QM9 and GEOM-Drugs [54] dataset to perform conformation generation experiments. As described in Sec. 2.3, in this task, Uni-Mol optimizes its generative conformations to the labeled ones. To construct the finetuning data, we first randomly generate 10 conformations. Then, for each of them, we calculate the RMSD between it and labeled conformations, and choose the one with minimal RMSD as its optimizing target. For the inference in the test set, we generate the same number of conformations (twice the number of labeled conformations) as previous works do. And we use the same metrics, Coverage (COV) and Matching (MAT). Higher COV means better diversity, while lower MAT means higher accuracy.
|
| 239 |
+
|
| 240 |
+
Baselines We compare Uni-Mol with 10 competitive baselines. RDKit [38] is a traditional conformation generation method based on distance geometry. The rest baseline can be categorized into two classes. GraphDG [43], CGCF[44], ConfVAE [55], ConfGF [53], and DGSM [56] combine generative models with distance geometry, which first generates interatomic distance matrices and then iteratively generates atomic coordinates. CVGAE [45], GeoMol [46], DMCG [57], and GeoDiff [58] directly generate atomic coordinates.
|
| 241 |
+
|
| 242 |
+
Results The results are shown in Table 3. We report the mean and median of COV and MAT on GEOM-QM9 and GEOM-Drugs datasets. ConfVAE [55], GeoMol[46], DGSM [56], DMCG [57], GeoDiff’s [58] results are from their papers, respectively. Other baseline results are from ConfGF’s paper. As shown in Table 3, Uni-Mol exceeds existing baselines in both COV and MAT metrics on both datasets. Although Uni-Mol outperforms SOTA, we suspect that the above benchmark cannot satisfy the real-world demand of conformation generation tasks in the field of drug design. Since the ensemble of molecular conformations in biological systems is different from that in a vacuum or general solution environment, the ensemble of bioactive conformation must be considered in order to apply the conformation generation model in the context of drug design, while the GEOM dataset just ignores this. Establishing a reasonable benchmark will be crucial in this research direction.
|
| 243 |
+
|
| 244 |
+
# 3.3 Pocket property prediction
|
| 245 |
+
|
| 246 |
+
Datasets and setup Druggability, the ability of a candidate protein pocket to produce stable binding to a specific molecular ligand, is one of the most critical properties of a candidate protein pocket. However, this task is very challenging due to the very limited supervised data. For example, NRDLD [59], a commonly used dataset, only contains 113 data samples. Therefore, besides NRDLD, we construct a regression dataset for benchmarking pocket property prediction performance. Specifically, based on Fpocket tool, we calculate Fpocket Score, Druggability Score, Total SASA, and Hydrophobicity Score for the selected 164,586 candidate pockets. Model is trained to predict these scores. To avoid leaking, the selected pockets are not overlapped with the candidate protein pocket dataset used in Uni-Mol pretraining.
|
| 247 |
+
|
| 248 |
+
251 Baselines On the NRDLD dataset, we compare Uni-Mol with 6 previous methods evaluated in [60].
|
| 249 |
+
252 Accuracy, recall, precision, and F1-score are used as metrics for this classification task. On our
|
| 250 |
+
253 created benchmark dataset, as there are no appropriate baselines, we use an additional Uni-Mol model
|
| 251 |
+
|
| 252 |
+
Table 4: Uni-Mol performance on pocket property prediction
|
| 253 |
+
|
| 254 |
+
<table><tr><td colspan="8">Classification (higher is better ↑)</td><td colspan="2">Regression (lower is better ↓) Fpocket Scores</td></tr><tr><td></td><td>Methods |Cavity-DrugScore</td><td>Volsite DrugPred PockDrug</td><td></td><td></td><td></td><td></td><td>TRAPP-CNN Uni-Mol|Methods</td><td>Uni-Molrandom</td><td>Uni-Mol</td></tr><tr><td>Accuracy</td><td>0.82</td><td>0.89</td><td>0.89</td><td>0.865</td><td>0.946</td><td>0.946</td><td>|MSEFpocket</td><td>[0.621(0.004)</td><td>0.551(0.008)</td></tr><tr><td>Recall</td><td></td><td></td><td></td><td>0.957</td><td>0.913</td><td>1.000</td><td>MSEDrggability</td><td>0.601(0.02)</td><td>0.499(0.007)</td></tr><tr><td>Precision</td><td></td><td>=</td><td></td><td>0.846</td><td>1.000</td><td>0.920</td><td>MSETotal SASA</td><td>0.197(0.008)</td><td>0.129(0.005)</td></tr><tr><td>F1-score</td><td></td><td></td><td></td><td>0.898</td><td>0.955</td><td>0.958</td><td>MSEHydrophobicity</td><td>0.0357(0.017)</td><td>0.0127(0.0005)</td></tr></table>
|
| 255 |
+
|
| 256 |
+
without pretraining, denoted as $\mathrm { U n i - M o l _ { r a n d o m } }$ , to check the performance brought by pretraining on pocket property prediction. MSE (mean square error) is used as the metric.
|
| 257 |
+
|
| 258 |
+
Results As shown in Table 4, Uni-Mol shows the best accuracy, recall, and F1-score on NRDLD, the few-show dataset. In our created benchmark dataset, the pretraining Uni-Mol model largely outperforms the non-pretraining one on all four scores. This indicates that pretraining on candidate protein pockets indeed brings improvement in pocket property prediction tasks.
|
| 259 |
+
|
| 260 |
+
Unlike Molecular property prediction, due to the very limited supervised data, pocket property prediction gained much less attention. Therefore, we also plan to release our created benchmark dataset, and hopefully, it can help future research.
|
| 261 |
+
|
| 262 |
+
# 3.4 Protein-ligand binding pose prediction
|
| 263 |
+
|
| 264 |
+
Datasets and setup As mentioned above, protein-ligand binding pose prediction is one of the most important tasks in drug design. And Uni-Mol combines both the molecular and pocket pretraining models to learn a distance matrix based scoring function, and then sample and optimize the complex conformations. For the benchmark dataset, referring to the previous works [28, 61], we use CASF2016 as the test set. For the training data used in finetuning, we use PDBbind General set v.2020 [62] (19,443 protein-ligand complexes), excluding complexes that already exist in the CASF-2016.
|
| 265 |
+
|
| 266 |
+
Two benchmarks are conducted: 1) Docking power, the default metric to benchmark the ability of a scoring function in CASF-2016. Specifically, it tests whether a scoring function can distinguish the ground truth binding pose from a set of decoys or not. For each ground truth, CASF-2016 provides 50 100 decoy conformations of the same ligand. Scoring functions are applied to rank them, and the ground truth binding pose is expected to be the top 1. 2) Binding pose accuracy. Specifically, we use the semi-flexible docking setting: keep the pocket conformation fixed, while the conformation of the ligand is fully flexible. We evaluate the RMSD between the predicted binding pose and the ground truth. Following previous works, we use the percentage of results that are below predefined RMSD thresholds as metrics.
|
| 267 |
+
|
| 268 |
+
Baselines For docking power benchmark, the baselines are DeepDock [61] and the top 10 scoring functions reported in [28], including both conventional scoring functions and machine learningbased ones. For the binding pose accuracy, the baselines are Autodock Vina [63, 64], Vinardo [65], Smina [66], and AutoDock4 [67].
|
| 269 |
+
|
| 270 |
+
Results From the docking power benchmark results shown in Figure 3, Uni-Mol ranks the 1st, with the top 1 success rate of $9 1 . 6 \%$ . For comparison, the previous top scoring function AutoDock Vina [63, 64] achieves $9 0 . 2 \%$ of the top 1 success rate in this benchmark. From the binding pose accuracy results shown in Table 5, Uni-Mol also surpasses all other baselines. Notably, Uni-Mol outperforms the second best method by $2 2 . 8 1 \%$ under the threshold of $2 \mathring \mathrm { A }$ . This result indicates that Uni-Mol can effectively learn the 3D information from both molecules and pockets, as well as the interaction in 3D space of them. Even without pretraining, Uni-Mol (denoted as Uni-Mol random) is also better than other baselines. This demonstrates the effectiveness of Uni-Mol backbone, as it effectively learns the 3D information by limited data.
|
| 271 |
+
|
| 272 |
+
In summary, by combining molecular and pocket pretraining models, Uni-Mol significantly outperforms the widely used docking tools in the protein-ligand binding tasks.
|
| 273 |
+
|
| 274 |
+
# 4 Related work
|
| 275 |
+
|
| 276 |
+
Molecular representation learning Representation learning on large-scale unlabeled molecules attracts much attention recently. SMILES-BERT [18] is pretrained on SMILES strings of molecules using BERT [4]. Subsequent works are mostly pretraining on 2D molecular topological graphs [23, 11]. MolCLR [12] applies data augmentation to molecular graphs at both node and graph levels, using
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 3: Docking power evaluation on CASF-2016 (Top 10 methods)
|
| 280 |
+
|
| 281 |
+
<table><tr><td colspan="3">Ligand RMSD % Below Threshold 个</td></tr><tr><td>Methods</td><td>0.5A 1.0A 1.5A 2.0A 3.0A 5.0A</td></tr><tr><td>Autodock Vina</td><td>23.86 44.21 57.54 64.56 73.68 84.56</td></tr><tr><td>Vinardo 23.51</td><td>41.75 57.54 62.81 69.82 76.84</td></tr><tr><td>Smina 23.51</td><td>47.37 59.65 65.26 74.39 82.11</td></tr><tr><td>Autodock4 7.02</td><td>21.75 31.58 35.44 47.02 64.56</td></tr><tr><td>Uni-Molrandom 14.04 Uni-Mol 24.91</td><td>49.47 65.26 75.44 87.02 98.60 70.53 84.21 88.07 94.74 98.95</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 5: Uni-Mol performance on binding pose prediction
|
| 284 |
+
|
| 285 |
+
299 a self-supervised contrastive learning strategy to learn molecular representations. Further, several
|
| 286 |
+
300 recent works try to leverage the 3D spatial information of molecules, and focus on contrastive or
|
| 287 |
+
301 transfer learning between 2D topology and 3D geometry of molecules. For example, GraphMVP [26]
|
| 288 |
+
302 proposes a contrastive learning GNN-based framework between 2D topology and 3D geometry.
|
| 289 |
+
303 GEM [13] uses bond angles and bond length as additional edge attributes to enhance 3D information.
|
| 290 |
+
304 As aforementioned, due to the inability of handling 3D information, most previous representation
|
| 291 |
+
305 learning models cannot be used in the important 3D prediction tasks.
|
| 292 |
+
306 SE(3)-Equivariant models In many-body scenarios such as potential energy surface fitting, SE-(3)
|
| 293 |
+
307 equivariance is usually required. A series of SE(3) models are proposed, such as SchNet [68], tensor
|
| 294 |
+
308 field networks [69], SE(3) Transformer [70], DimmNet [71], equivariant graph neural networks
|
| 295 |
+
309 (EGNN) [36], GemNet [72] and SphereNet [73]. Most of these models are used in supervised
|
| 296 |
+
310 learning with energy and force. In Uni-Mol, based on the standard Transformer, we introduce several
|
| 297 |
+
311 minor changes to make the model SE(3)-Equivariant.
|
| 298 |
+
|
| 299 |
+
Pocket druggability prediction Druggability prediction of protein binding pockets is crucial for drug discovery as druggable pockets need to be identified at the beginning. Since proteins undergo conformation changes that might alter the druggability of pockets, it is necessary to utilize 3D spatial data beyond sequential information. Early methods, such as Volsite [74], DrugPred [59], and PockDrug [75], predict druggability based on the predefined descriptors of pockets’ static structures. Later, TRAPP-CNN [60], based on 3D-CNN, proposes the analysis of proteins’ conformation changes and the use of such information for druggability prediction.
|
| 300 |
+
|
| 301 |
+
Protein-ligand binding pose prediction In structure-based drug design, it is crucial to understand the interactions between protein targets and ligands. The in vitro estimation of the binding pose and affinity, such as docking, allows for lead identification and guides molecular optimization. In particular, docking is one of the most important approaches in structure-based drug design and has been developed for the past decades. Tools such as AutoDock4 [67], AutoDock Vina [63, 64], and Smina [66] are among the most used docking programs. Also, machine learning-based docking methods, such as $\Delta _ { V i n a } \mathrm { R F _ { 2 0 } }$ [76], DeepDock [61] and Equibind [77], have also been developed to predict protein-ligand binding poses and assess protein-ligand binding affinity.
|
| 302 |
+
|
| 303 |
+
# 5 Conclusion
|
| 304 |
+
|
| 305 |
+
In this paper, to enlarge the application scope and representation ability of molecular representation learning (MRL), we propose Uni-Mol, the first universal large-scale 3D MRL framework. Uni-Mol consists of 3 parts: a Transformer based backbone to handle 3D data; two large-scale pretraining models to learn molecular and pocket representations respectively; finetuning strategies for all kinds of downstream tasks. Experiments demonstrate that Uni-Mol can outperform existing SOTA in various downstream tasks, especially in 3D spatial tasks.
|
| 306 |
+
|
| 307 |
+
334 There are 3 potential future directions. 1) Better interaction mechanisms for finetuning two pretraining
|
| 308 |
+
335 models together. As the interaction between the pretraining pocket model and the pretraining
|
| 309 |
+
336 molecular model is simple in the current version of Uni-Mol, we believe there is a large room for
|
| 310 |
+
337 further improvement. 2) Large Uni-Mol models. As larger pretraining models often perform better, it
|
| 311 |
+
338 is worthy of training a large Uni-Mol model on a bigger dataset. 3) More high-quality benchmarks.
|
| 312 |
+
339 Although there have been many applications in the field of drug design, high-quality public datasets
|
| 313 |
+
340 have been lacking. Many public datasets cannot satisfy real-world demand due to the low data quality.
|
| 314 |
+
341 We believe the high-quality benchmarks will be the lighthouse of the entire field, and will significantly
|
| 315 |
+
342 accelerate the development of drug design.
|
| 316 |
+
|
| 317 |
+
# 343 References
|
| 318 |
+
|
| 319 |
+
344 [1] Yoshua Bengio, Aaron Courville, and Pascal Vincent. “Representation learning: A review and new
|
| 320 |
+
345 perspectives”. In: IEEE transactions on pattern analysis and machine intelligence 35.8 (2013), pp. 1798–
|
| 321 |
+
346 1828.
|
| 322 |
+
347 [2] William L. Hamilton, Rex Ying, and Jure Leskovec. “Representation Learning on Graphs: Methods and
|
| 323 |
+
348 Applications”. In: IEEE Data Eng. Bull. 40.3 (2017), pp. 52–74. URL: http://sites.computer.org/
|
| 324 |
+
349 debull/A17sept/p52.pdf.
|
| 325 |
+
350 [3] Daokun Zhang et al. “Network representation learning: A survey”. In: IEEE transactions on Big Data
|
| 326 |
+
351 6.1 (2018), pp. 3–28.
|
| 327 |
+
352 [4] Jacob Devlin et al. “BERT: Pre-training of Deep Bidirectional Transformers for Language Under
|
| 328 |
+
353 standing”. In: Proceedings of the 2019 Conference of the North American Chapter of the Association
|
| 329 |
+
354 for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers).
|
| 330 |
+
355 Minneapolis, Minnesota: Association for Computational Linguistics, June 2019, pp. 4171–4186. DOI:
|
| 331 |
+
356 10.18653/v1/N19-1423. URL: https://aclanthology.org/N19-1423.
|
| 332 |
+
357 [5] Alec Radford et al. “Improving language understanding by generative pre-training”. In: (2018).
|
| 333 |
+
358 [6] Alec Radford et al. “Language models are unsupervised multitask learners”. In: OpenAI blog 1.8 (2019),
|
| 334 |
+
359 p. 9.
|
| 335 |
+
360 [7] Tom Brown et al. “Language models are few-shot learners”. In: Advances in neural information process
|
| 336 |
+
361 ing systems 33 (2020), pp. 1877–1901.
|
| 337 |
+
362 [8] Alexey Dosovitskiy et al. “An Image is Worth 16x16 Words: Transformers for Image Recognition at
|
| 338 |
+
363 Scale”. In: International Conference on Learning Representations. 2021. URL: https://openreview.
|
| 339 |
+
364 net/forum?id=YicbFdNTTy.
|
| 340 |
+
365 [9] Qingda Zang et al. “In silico prediction of physicochemical properties of environmental chemicals using
|
| 341 |
+
366 molecular fingerprints and machine learning”. In: Journal of chemical information and modeling 57.1
|
| 342 |
+
367 (2017), pp. 36–49.
|
| 343 |
+
368 [10] Minjian Yang et al. “Machine learning models based on molecular fingerprints and an extreme gradient
|
| 344 |
+
369 boosting method lead to the discovery of JAK2 inhibitors”. In: Journal of Chemical Information and
|
| 345 |
+
370 Modeling 59.12 (2019), pp. 5002–5012.
|
| 346 |
+
371 [11] Yu Rong et al. “Self-Supervised Graph Transformer on Large-Scale Molecular Data”. In: Advances in
|
| 347 |
+
372 Neural Information Processing Systems 33 (2020).
|
| 348 |
+
373 [12] Yuyang Wang et al. “Molecular contrastive learning of representations via graph neural networks”. In:
|
| 349 |
+
374 Nature Machine Intelligence (2022), pp. 1–9. DOI: 10.1038/s42256-022-00447-x.
|
| 350 |
+
375 [13] Xiaomin Fang et al. “Geometry-enhanced molecular representation learning for property prediction”. In:
|
| 351 |
+
376 Nature Machine Intelligence (2022), pp. 1–8. DOI: 10.1038/s42256-021-00438-4.
|
| 352 |
+
377 [14] A Crum-Brown and TR Fraser. “The connection of chemical constitution and physiological action”. In:
|
| 353 |
+
378 Trans R Soc Edinb 25.1968-1969 (1865), p. 257.
|
| 354 |
+
379 [15] Corwin Hansch and Toshio Fujita. “p-σ-π Analysis. A Method for the Correlation of Biological Activity
|
| 355 |
+
380 and Chemical Structure”. In: Journal of the American Chemical Society 86.8 (1964), pp. 1616–1626.
|
| 356 |
+
381 [16] David Weininger. “SMILES, a chemical language and information system. 1. Introduction to methodology
|
| 357 |
+
382 and encoding rules”. In: Journal of chemical information and computer sciences 28.1 (1988), pp. 31–36.
|
| 358 |
+
383 [17] Zheng Xu et al. “Seq2seq fingerprint: An unsupervised deep molecular embedding for drug discovery”.
|
| 359 |
+
384 In: Proceedings of the 8th ACM international conference on bioinformatics, computational biology, and
|
| 360 |
+
385 health informatics. 2017, pp. 285–294.
|
| 361 |
+
386 [18] Sheng Wang et al. “Smiles-bert: large scale unsupervised pre-training for molecular property prediction”.
|
| 362 |
+
387 In: Proceedings of the 10th ACM international conference on bioinformatics, computational biology and
|
| 363 |
+
388 health informatics. 2019, pp. 429–436.
|
| 364 |
+
389 [19] Stephen R Heller et al. “InChI, the IUPAC international chemical identifier”. In: Journal of cheminfor
|
| 365 |
+
390 matics 7.1 (2015), pp. 1–34.
|
| 366 |
+
391 [20] Robin Winter et al. “Learning continuous and data-driven molecular descriptors by translating equivalent
|
| 367 |
+
392 chemical representations”. In: Chemical science 10.6 (2019), pp. 1692–1701.
|
| 368 |
+
393 [21] Jennifer Handsel et al. “Translating the InChI: adapting neural machine translation to predict IUPAC
|
| 369 |
+
394 names from a chemical identifier”. In: Journal of cheminformatics 13.1 (2021), pp. 1–11.
|
| 370 |
+
395 [22] Weihua $\mathrm { H u ^ { * } }$ et al. “Strategies for Pre-training Graph Neural Networks”. In: International Conference on
|
| 371 |
+
396 Learning Representations. 2020. URL: https://openreview.net/forum?id=HJlWWJSFDH.
|
| 372 |
+
397 [23] Pengyong Li et al. “An effective self-supervised framework for learning expressive molecular global
|
| 373 |
+
398 representations to drug discovery”. In: Briefings in Bioinformatics 22.6 (2021), bbab109.
|
| 374 |
+
399 [24] Chengxuan Ying et al. “Do Transformers Really Perform Badly for Graph Representation?” In: Advances
|
| 375 |
+
400 in Neural Information Processing Systems 34 (2021).
|
| 376 |
+
401 [25] Panagiotis I Koukos, Li C Xue, and Alexandre MJJ Bonvin. “Protein–ligand pose and affinity prediction:
|
| 377 |
+
402 Lessons from D3R Grand Challenge 3”. In: Journal of computer-aided molecular design 33.1 (2019),
|
| 378 |
+
403 pp. 83–91.
|
| 379 |
+
404 [26] Shengchao Liu et al. “Pre-training Molecular Graph Representation with 3D Geometry”. In: International
|
| 380 |
+
405 Conference on Learning Representations. 2022. URL: https : / / openreview . net / forum ? id $=$
|
| 381 |
+
406 xQUe1pOKPam.
|
| 382 |
+
407 [27] Hannes Stärk et al. “3D Infomax improves GNNs for Molecular Property Prediction”. In: arXiv preprint
|
| 383 |
+
408 arXiv:2110.04126 (2021).
|
| 384 |
+
409 [28] Minyi Su et al. “Comparative assessment of scoring functions: the CASF-2016 update”. In: Journal of
|
| 385 |
+
410 chemical information and modeling 59.2 (2018), pp. 895–913.
|
| 386 |
+
411 [29] Andrew L Hopkins, Colin R Groom, and Alexander Alex. “Ligand efficiency: a useful metric for lead
|
| 387 |
+
412 selection.” In: Drug discovery today 9.10 (2004), pp. 430–431.
|
| 388 |
+
413 [30] Ashish Vaswani et al. “Attention is all you need”. In: Advances in neural information processing systems
|
| 389 |
+
414 30 (2017).
|
| 390 |
+
415 [31] Ruibin Xiong et al. “On Layer Normalization in the Transformer Architecture”. In: Proceedings of the
|
| 391 |
+
416 37th International Conference on Machine Learning. Ed. by Hal Daumé III and Aarti Singh. Vol. 119.
|
| 392 |
+
417 Proceedings of Machine Learning Research. PMLR, July 2020, pp. 10524–10533.
|
| 393 |
+
418 [32] Guolin Ke, Di He, and Tie-Yan Liu. “Rethinking Positional Encoding in Language Pre-training”. In:
|
| 394 |
+
419 International Conference on Learning Representations. 2020.
|
| 395 |
+
420 [33] Philipp Dufter, Martin Schmitt, and Hinrich Schütze. “Position information in transformers: An overview”.
|
| 396 |
+
421 In: arXiv preprint arXiv:2102.11090 (2021).
|
| 397 |
+
422 [34] Muhammed Shuaibi et al. “Rotation invariant graph neural networks using spin convolutions”. In: arXiv
|
| 398 |
+
423 preprint arXiv:2106.09575 (2021).
|
| 399 |
+
424 [35] John Jumper et al. “Highly accurate protein structure prediction with AlphaFold”. In: Nature 596.7873
|
| 400 |
+
425 (2021), pp. 583–589.
|
| 401 |
+
426 [36] Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. “E (n) equivariant graph neural networks”.
|
| 402 |
+
427 In: International Conference on Machine Learning. PMLR. 2021, pp. 9323–9332.
|
| 403 |
+
428 [37] Abien Fred Agarap. “Deep learning using rectified linear units (relu)”. In: arXiv preprint
|
| 404 |
+
429 arXiv:1803.08375 (2018).
|
| 405 |
+
430 [38] Sereina Riniker and Gregory A Landrum. “Better informed distance geometry: using what we know
|
| 406 |
+
431 to improve conformation generation”. In: Journal of chemical information and modeling 55.12 (2015),
|
| 407 |
+
432 pp. 2562–2574.
|
| 408 |
+
433 [39] Thomas A Halgren. “Merck molecular force field. I. Basis, form, scope, parameterization, and perfor
|
| 409 |
+
434 mance of MMFF94”. In: Journal of computational chemistry 17.5-6 (1996), pp. 490–519.
|
| 410 |
+
435 [40] Greg Landrum et al. RDKit: A software suite for cheminformatics, computational chemistry, and predictive
|
| 411 |
+
436 modeling. 2013.
|
| 412 |
+
437 [41] Helen M Berman et al. “The protein data bank”. In: Nucleic acids research 28.1 (2000), pp. 235–242.
|
| 413 |
+
438 [42] Vincent Le Guilloux, Peter Schmidtke, and Pierre Tuffery. “Fpocket: an open source platform for ligand
|
| 414 |
+
439 pocket detection”. In: BMC bioinformatics 10.1 (2009), pp. 1–11.
|
| 415 |
+
440 [43] Gregor Simm and Jose Miguel Hernandez-Lobato. “A Generative Model for Molecular Distance Geome
|
| 416 |
+
441 try”. In: International Conference on Machine Learning. PMLR. 2020, pp. 8949–8958.
|
| 417 |
+
442 [44] Minkai Xu et al. “Learning Neural Generative Dynamics for Molecular Conformation Generation”. In:
|
| 418 |
+
443 International Conference on Learning Representations. 2020.
|
| 419 |
+
444 [45] Elman Mansimov et al. “Molecular geometry prediction using a deep generative graph neural network”.
|
| 420 |
+
445 In: Scientific reports 9.1 (2019), pp. 1–13.
|
| 421 |
+
446 [46] Octavian Ganea et al. “Geomol: Torsional geometric generation of molecular 3d conformer ensembles”.
|
| 422 |
+
447 In: Advances in Neural Information Processing Systems 34 (2021).
|
| 423 |
+
448 [47] Rainer Storn and Kenneth Price. “Differential evolution–a simple and efficient heuristic for global
|
| 424 |
+
449 optimization over continuous spaces”. In: Journal of global optimization 11.4 (1997), pp. 341–359.
|
| 425 |
+
450 [48] Zhenqin Wu et al. “MoleculeNet: a benchmark for molecular machine learning”. In: Chemical science
|
| 426 |
+
451 9.2 (2018), pp. 513–530.
|
| 427 |
+
452 [49] Kevin Yang et al. “Analyzing learned molecular representations for property prediction”. In: Journal of
|
| 428 |
+
453 chemical information and modeling 59.8 (2019), pp. 3370–3388.
|
| 429 |
+
454 [50] Zhaoping Xiong et al. “Pushing the boundaries of molecular representation for drug discovery with the
|
| 430 |
+
455 graph attention mechanism”. In: Journal of medicinal chemistry 63.16 (2019), pp. 8749–8760.
|
| 431 |
+
456 [51] Shengchao Liu, Mehmet F Demirel, and Yingyu Liang. “N-gram graph: Simple unsupervised representa
|
| 432 |
+
457 tion for graphs, with applications to molecules”. In: Advances in neural information processing systems
|
| 433 |
+
458 32 (2019).
|
| 434 |
+
459 [52] Tianqi Chen and Carlos Guestrin. “Xgboost: A scalable tree boosting system”. In: Proceedings of the
|
| 435 |
+
460 22nd acm sigkdd international conference on knowledge discovery and data mining. 2016, pp. 785–794.
|
| 436 |
+
[53] g
|
| 437 |
+
462 Conference on Machine Learning. PMLR. 2021, pp. 9558–9568.
|
| 438 |
+
463 [54] Simon Axelrod and Rafael Gomez-Bombarelli. “GEOM, energy-annotated molecular conformations for
|
| 439 |
+
464 property prediction and molecular generation”. In: Scientific Data 9.1 (2022), pp. 1–14.
|
| 440 |
+
465 [55] Minkai Xu et al. “An end-to-end framework for molecular conformation generation via bilevel program
|
| 441 |
+
466 ming”. In: International Conference on Machine Learning. PMLR. 2021, pp. 11537–11547.
|
| 442 |
+
467 [56] Shitong Luo et al. “Predicting Molecular Conformation via Dynamic Graph Score Matching”. In:
|
| 443 |
+
468 Advances in Neural Information Processing Systems 34 (2021).
|
| 444 |
+
469 [57] Jinhua Zhu et al. “Direct molecular conformation generation”. In: arXiv preprint arXiv:2202.01356
|
| 445 |
+
470 (2022).
|
| 446 |
+
471 [58] Minkai Xu et al. “GeoDiff: A Geometric Diffusion Model for Molecular Conformation Generation”. In:
|
| 447 |
+
472 International Conference on Learning Representations. 2022.
|
| 448 |
+
473 [59] Agata Krasowski et al. “DrugPred: a structure-based approach to predict protein druggability developed
|
| 449 |
+
474 using an extensive nonredundant data set”. In: Journal of chemical information and modeling 51.11
|
| 450 |
+
475 (2011), pp. 2829–2842.
|
| 451 |
+
476 [60] Jui-Hung Yuan et al. “Druggability assessment in TRAPP using machine learning approaches”. In:
|
| 452 |
+
477 Journal of Chemical Information and Modeling 60.3 (2020), pp. 1685–1699.
|
| 453 |
+
478 [61] Oscar Méndez-Lucio et al. “A geometric deep learning approach to predict binding conformations of
|
| 454 |
+
479 bioactive molecules”. In: Nature Machine Intelligence 3.12 (2021), pp. 1033–1039.
|
| 455 |
+
480 [62] Zhihai Liu et al. “PDB-wide collection of binding data: current status of the PDBbind database”. In:
|
| 456 |
+
481 Bioinformatics 31.3 (2015), pp. 405–412.
|
| 457 |
+
482 [63] Oleg Trott and Arthur J Olson. “AutoDock Vina: improving the speed and accuracy of docking with a
|
| 458 |
+
483 new scoring function, efficient optimization, and multithreading”. In: Journal of computational chemistry
|
| 459 |
+
484 31.2 (2010), pp. 455–461.
|
| 460 |
+
485 [64] Jerome Eberhardt et al. “AutoDock Vina 1.2. 0: New docking methods, expanded force field, and python
|
| 461 |
+
486 bindings”. In: Journal of Chemical Information and Modeling 61.8 (2021), pp. 3891–3898.
|
| 462 |
+
487 [65] Rodrigo Quiroga and Marcos A Villarreal. “Vinardo: A scoring function based on autodock vina improves
|
| 463 |
+
488 scoring, docking, and virtual screening”. In: PloS one 11.5 (2016), e0155183.
|
| 464 |
+
489 [66] David Ryan Koes, Matthew P Baumgartner, and Carlos J Camacho. “Lessons learned in empirical scoring
|
| 465 |
+
490 with smina from the CSAR 2011 benchmarking exercise”. In: Journal of chemical information and
|
| 466 |
+
491 modeling 53.8 (2013), pp. 1893–1904.
|
| 467 |
+
492 [67] Garrett M Morris et al. “AutoDock4 and AutoDockTools4: Automated docking with selective receptor
|
| 468 |
+
493 flexibility”. In: Journal of computational chemistry 30.16 (2009), pp. 2785–2791.
|
| 469 |
+
494 [68] Kristof Schütt et al. “Schnet: A continuous-filter convolutional neural network for modeling quantum
|
| 470 |
+
495 interactions”. In: Advances in neural information processing systems 30 (2017).
|
| 471 |
+
496 [69] Nathaniel Thomas et al. “Tensor field networks: Rotation-and translation-equivariant neural networks for
|
| 472 |
+
497 3d point clouds”. In: arXiv preprint arXiv:1802.08219 (2018).
|
| 473 |
+
498 [70] Fabian Fuchs et al. “Se (3)-transformers: 3d roto-translation equivariant attention networks”. In: Advances
|
| 474 |
+
499 in Neural Information Processing Systems 33 (2020), pp. 1970–1981.
|
| 475 |
+
500 [71] Johannes Gasteiger, Janek Groß, and Stephan Günnemann. “Directional Message Passing for Molecular
|
| 476 |
+
501 Graphs”. In: International Conference on Learning Representations (ICLR). 2020.
|
| 477 |
+
502 [72] Johannes Klicpera, Florian Becker, and Stephan Günnemann. “GemNet: Universal Directional Graph
|
| 478 |
+
503 Neural Networks for Molecules”. In: Advances in Neural Information Processing Systems. 2021.
|
| 479 |
+
504 [73] Yi Liu et al. “Spherical Message Passing for 3D Molecular Graphs”. In: International Conference on
|
| 480 |
+
505 Learning Representations. 2022. URL: https://openreview.net/forum?id=givsRXsOt9r.
|
| 481 |
+
506 [74] Jérémy Desaphy et al. Comparison and druggability prediction of protein–ligand binding sites from
|
| 482 |
+
507 pharmacophore-annotated cavity shapes. 2012.
|
| 483 |
+
508 [75] Alexandre Borrel et al. “PockDrug: A model for predicting pocket druggability that overcomes pocket
|
| 484 |
+
509 estimation uncertainties”. In: Journal of chemical information and modeling 55.4 (2015), pp. 882–895.
|
| 485 |
+
510 [76] Cheng Wang and Yingkai Zhang. “Improving scoring-docking-screening powers of protein–ligand
|
| 486 |
+
511 scoring functions using random forest”. In: Journal of computational chemistry 38.3 (2017), pp. 169–
|
| 487 |
+
512 177.
|
| 488 |
+
513 [77] Hannes Stärk et al. EquiBind: Geometric Deep Learning for Drug Binding Structure Prediction. 2022.
|
| 489 |
+
|
| 490 |
+
# 514 Checklist
|
| 491 |
+
|
| 492 |
+
1. For all authors...
|
| 493 |
+
|
| 494 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 495 |
+
|
| 496 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 497 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 498 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 499 |
+
|
| 500 |
+
2. If you are including theoretical results...
|
| 501 |
+
|
| 502 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 503 |
+
|
| 504 |
+
3. If you ran experiments...
|
| 505 |
+
|
| 506 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The data we used are all from public databases and details in data processing are explained in Appendix. The data, code, and instructions will be made public upon the acceptance of the paper.
|
| 507 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We report all the training details for the experiemnt in Appendix.
|
| 508 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We report the mean and std for different runs of experiments in Table 1, Table 2 and Table 4.
|
| 509 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We report the detailed computing resources used for the experiment in Appendix.
|
| 510 |
+
|
| 511 |
+
38 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 512 |
+
|
| 513 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We discuss all the used datasets in the experiment section 3, datasets and setup part.
|
| 514 |
+
(b) Did you mention the license of the assets? [Yes] We mention the license for the datasets used in Appendix.
|
| 515 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 516 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 517 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 518 |
+
|
| 519 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 520 |
+
|
| 521 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 522 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 523 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/Ix37FJYDkBp/Ix37FJYDkBp.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SemMAE: Semantic-Guided Masking for Learning Masked Autoencoders
|
| 2 |
+
|
| 3 |
+
Gang $\mathbf { L i } ^ { 1 , 2 }$ ∗, Heliang Zheng3, Daqing $\mathbf { L i u ^ { 3 } }$ , Chaoyue Wang3, Bing $\mathbf { S u ^ { 4 } }$ , Changwen Zheng1†
|
| 4 |
+
|
| 5 |
+
Institute of Software, Chinese Academy of Sciences1, University of Chinese Academy of Sciences2, JD Explore Academy3, Renmin University of China4 ucasligang@gmail.com, {zhengheliang,liudaqing1,wangchaoyue9}@jd.com, bingsu@ruc.edu.cn, changwen@iscas.ac.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Recently, significant progress has been made in masked image modeling to catch up to masked language modeling. However, unlike words in NLP, the lack of semantic decomposition of images still makes masked autoencoding (MAE) different between vision and language. In this paper, we explore a potential visual analogue of words, i.e., semantic parts, and we integrate semantic information into the training process of MAE by proposing a Semantic-Guided Masking strategy. Compared to widely adopted random masking, our masking strategy can gradually guide the network to learn various information, i.e., from intra-part patterns to inter-part relations. In particular, we achieve this in two steps. 1) Semantic part learning: we design a self-supervised part learning method to obtain semantic parts by leveraging and refining the multi-head attention of a ViT-based encoder. 2) Semantic-guided MAE (SemMAE) training: we design a masking strategy that varies from masking a portion of patches in each part to masking a portion of (whole) parts in an image. Extensive experiments on various vision tasks show that SemMAE can learn better image representation by integrating semantic information. In particular, SemMAE achieves $8 4 . 5 \%$ fine-tuning accuracy on ImageNet-1k, which outperforms the vanilla MAE by $1 . 4 \%$ . In the semantic segmentation and fine-grained recognition tasks, SemMAE also brings significant improvements and yields the state-of-the-art performance. Our code is available at https://github.com/ucasligang/SemMAE.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Together with transformers, masked language modeling (MLM) has revolutionized the field of self-supervised learning (SSL) in natural language processing (NLP), which enables training of generalizable NLP models containing over one hundred billion parameters [5]. The concept of MLM is quite intuitive, i.e., a portion of the data is removed and a model is trained to predict the removed content. Recently, significant progress has been made in masked image modeling to catch up to masked language modeling, where the masking mechanism is a key factor. Context encoder [28], an inpainting-based masked image modeling (MIM) pioneer, proposes to use a random and fix-shaped mask; SiT [2] and BEiT [3] use random “blockwise” masks, where patches in the local neighbourhood are masked together (also called GMML: group mask model learning); MAE [19] randomly masks out $7 5 \%$ patches of an image. Actually, masking mechanisms define the specific pretext task, i.e., what kind of information is to be exploited and what kind of information is to be predicted. Thus
|
| 14 |
+
|
| 15 |
+
AttMask [21] studies the problem of which tokens to mask and proposes an attention-guided mask strategy to make informed decisions. ADIOS [30] takes one step further to “learn to mask” by adversarial training.
|
| 16 |
+
|
| 17 |
+
Although promising performance has been achieved, there is still a large gap for masked autoencoding (MAE) between vision and language due to different signal natures. A sentence can be semantically decomposed into words, while the semantic decomposition of an image is not trivial to be obtained. To find a visual analogue of words, we investigate part-based image representation. Specifically, the real world is composed of objects, which consist of different parts. Therefore, part-based image representation is a fundamental image representation method that fits the inherent properties of objects [8, 15, 16, 18, 20]. For example, part-based Pictorial Stracture [16] dominated the image representation field for several years in the early days of computer vision, and Deformable Part Model (DPM) [15] was also a milestone in image recognition and detection. Moreover, GLOM [20] argues that the hierarchical representation with five levels (i.e., the lowest level, sub-part level, part level, object level, and scene level) would be a powerful image representation method in the future. To this end, we argue that semantic parts would be a potential visual analogue of words. With such visual analogue, more controllable hints can be built up to guide the learning of MAE, thus high-level visual representations can be well learned.
|
| 18 |
+
|
| 19 |
+
In this paper, we first propose a self-supervised semantic part learning method to obtain semantic parts for each image. Our insight is that the spatial information to reconstruct an image is highly correlated to the position of semantic parts. In particular, our part learning model consists of a ViT-based encoder together with an attention module that generates a class token and multiple attention maps, and a StyleGAN-based decoder that reconstructs the original image. The attention maps are optimized to provide spatial information, and the class token is integrated into the decoder via AdaIN to provide texture information. We find that the optimized attention maps can indicate part positions, and we conduct an argmax operation to obtain part segmentation maps. After that, we study how semantic parts can facilitate the learning of MAE. We design a masking strategy that varies from masking a portion of patches in each part to masking a portion of (whole) parts in an image. Such a design can gradually guide the network to learn various information, i.e., from intra-part patterns to inter-part relations. Extensive experiments on various vision tasks (e.g., linear probing, fine-tuning, semantic segmentation, and fine-grained recognition) show that SemMAE can learn better image representation by integrating semantics.
|
| 20 |
+
|
| 21 |
+
Our contributions include 1) designing a self-supervised semantic part learning method that can generate promising semantic parts on multi-class datasets, i.e., ImageNet, and 2) verifying that semantic parts can facilitate the learning of MAE by proposing a semantic-guided masking strategy. While more importantly, we hope our attempts can provide insights for the community to study the visual analogue of words and unified vision and language modeling.
|
| 22 |
+
|
| 23 |
+
# 2 Related work
|
| 24 |
+
|
| 25 |
+
Semantic part learning. Part-based image representation is a fundamental image representation method that fits the inherent properties of objects [8, 15, 16, 18, 20]. However, due to the tremendous cost of labeling parts, there are still no large-scale datasets containing part labels. Thus previous works are mainly two-fold, i.e., unsupervised/weakly-supervised part learning and few-shot part segmentation. Unsupervised/weakly-supervised part learning methods [10, 22, 39] propose to mine part information by leveraging spatial priors, the semantics of convolutional channels, or designing contrastive proxy tasks. Few-shot part segmentation methods [4, 29, 38] mainly learn an additional classifier over pre-trained features that are trained by GAN, self-supervised contrastive learning, or denoising diffusion probabilistic modeling. Although promising results have been obtained, these models are designed to deal with fine-grained datasets, where all images belong to a single super-class (e.g., birds, cars, or human faces). It is much more challenging to solve the problem of unsupervised part learning on multi-class datasets such as ImageNet. With the development of ViT and self-supervised learning (SSL), some recent works show a potential solution. In particular, DINO [6] and iBOT [42] have observed intuitive semantics in the ViT trained by their SSL methods, where the multi-head attention maps can somehow indicate different semantic parts of an object. Inspired by these works, we design a reconstruction-based method to further refine the attention maps learned by iBOT to obtain semantic parts on the ImageNet dataset.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Comparison of different masking strategies. Detailed information for each compared model can be found in Section 2 Masked Image Modeling.
|
| 29 |
+
|
| 30 |
+
Masked image modeling. Inspired by the success of Masked Language Modeling (MLM) [5, 12] in pre-training of the NLP field, Masked Image Modeling (MIM) has been proposed recently and exhibits promising potential for visual pre-training [3, 7, 19, 30]. Existing works mainly study the problem of MIM from two directions, i.e., regression targets and masking strategies. In terms of regression targets, BeiT [3], mc-BEiT [24], and PeCo [13] adopt tokens produced by VQ-VAE [32] or its variants. MaskFeat [35] studies a broad spectrum of feature types and proposes to regress Histograms of Oriented Gradients (HOG) features of the masked content. MAE [19] and SimMIM [37] argue that predicting RGB values of raw pixels by direct regression performs no worse than the patch classification approaches with complex designs. In this paper, we follow MAE [19] to adopt the most simple and intuitive raw pixels regression. In terms of masking strategies, SiT [2], MC-SSL0.0 [1] and BeiT [3] use a block-wise masking strategy, where a block of neighbouring tokens arranged spatially are masked. MAE [19] and SimMIM [37] use random masking with a large masked patch size or a large proportion of masked patches. MST [25] and AttMask [21] propose to use attention maps to guide the masking strategy, where the former proposes to mask the nonessential regions to preserve crucial patches while the latter proposes to learn image representations with challenging tasks by masking the most attended tokens. Moreover, ADIOS [30] proposes to learn an optimal mask by adversarial training. Compared to these works, our SemMAE takes one step further and explicitly learn semantic parts to build reasonable hints for masked image modeling. Figure 1 is an illustration of different masking strategies.
|
| 31 |
+
|
| 32 |
+
# 3 Semantic-guided masked autoencoders
|
| 33 |
+
|
| 34 |
+
We propose a Semantic-guided Masked Autoencoder (SemMAE) for self-supervised image representation learning with mask image modeling. The framework of SemMAE is shown in Figure 2, which consists of two key components, i.e., Semantic Part Learning (A) and SemanticGuided Masking (B). First, given an image in Figure 2 (a), we extract the class token in Figure 2 (b) and patch tokens in Figure 2 (c) by an iBOT-pretrained ViT. After that, we learn an embedding over the class token to obtain part tokens in Figure 2 (d). We calculate the correlation of each part token to patch tokens to obtain attention maps in Figure 2 (e), whose texture information is further removed by a large-kernel blur operation. The attention maps are optimized by a diversity constraint and a reconstruction task where the attention maps and the class token are fed into a StyleGAN-based decoder to control the spatial and texture information of the reconstructed image, respectively. Finally, we conduct argmax over the attention maps to obtain part segmentation maps in Figure 2 (f) and used them to guide the mask generation for MAE. Specifically, we design a masking strategy that varies from masking a portion of patches in each part to masking a portion of (whole) parts in an image. Such a design can gradually guide the network to learn various information, i.e., from intra-part patterns to inter-part relations.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: An illustration of the proposed SemMAE. (A) Semantic Part Learning. A ViT-based encoder takes as input an image in (a) and produces a class token in (b) and patch tokens in (c). Our attention module first learns to embed the class token into part tokens in (d) and then generates an attention map for each part token by calculating the correlation between the part token and patch tokens. As an objective function of the attention maps, our StyleGAN-based decoder learns to reconstruct the original image from attention maps with texture information from the class token. (B) Semantic-Guided Masking. We conduct argmax over the attention maps to obtain part segmentations in (f), which are used to guide the mask generation. During the training of the MAE, the masks vary from a portion of patches in each part to a portion of (whole) parts in an image.
|
| 38 |
+
|
| 39 |
+
# 3.1 Semantic part learning
|
| 40 |
+
|
| 41 |
+
In this subsection, we introduce our self-supervised semantic part learning method. Previous unsupervised/weakly-supervised part learning methods are mainly designed to deal with singleclass datasets (i.e., fine-grained datasets where images belong to the same superclass). Few methods are able to solve this problem under a multi-class scenario (e.g., ImageNet). While some recent works (i.e., DINO [6] and iBOT [42]) on ViT-based self-supervised learning show that the multi-head attention maps in their model can somehow indicate different semantic parts of an object. In this work, we take advantage of semantics learned in iBOT and design a reconstruction task together with a diversity constraint to refine and obtain semantic parts.
|
| 42 |
+
|
| 43 |
+
In particular, given an image I, we first use an iBOT-pretrained ViT to extract its features, i.e., a class token $\mathbf { F } _ { \mathrm { c } } ^ { - } \in \mathbb { R } ^ { C \times 1 }$ and patch tokens $\mathbf { F } \in \mathbb { R } ^ { C \times H \mathbf { \bar { W } } }$ . Then, we embed the class token into $N$ part tokens $\mathbf { F } _ { \mathrm { p } } \in \mathbb { R } ^ { C \times N }$ . The main idea of such embedding is to re-weight feature channels of the class token. As shown in previous methods [39], feature channels may be corresponding to specific semantics and channel re-weighting can group channels with similar semantics together to obtain semantic part features. Thus we can obtain part tokens by:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\mathbf { F } _ { \mathrm { p } } ^ { ( i ) } = \mathbf { F } _ { \mathrm { c } } \circ \mathrm { s i g m o i d } ( \mathbf { W } _ { \mathrm { c 2 } } ^ { ( i ) } \operatorname { t a n h } ( \mathbf { W } _ { \mathrm { c 1 } } ^ { ( i ) } \mathbf { F } _ { \mathrm { c } } ) ) ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $i \in [ 1 , 2 , . . . , N ]$ , $\mathbf { F } _ { \mathrm { p } } ^ { ( i ) } \in \mathbb { R } ^ { C \times 1 }$ is the $i ^ { t h }$ column vector of $\mathbf { F } _ { \mathrm { p } } \in \mathbb { R } ^ { C \times N }$ , $\circ$ indicates hadamard product, $\mathbf { W } _ { \mathrm { c 1 } } ^ { ( i ) }$ and $\mathbf { W } _ { \mathrm { c 2 } } ^ { ( i ) }$ are embedding weights, $\operatorname { t a n h } ( { \cdot } )$ and sigmoid $( \cdot )$ are activation functions.
|
| 50 |
+
|
| 51 |
+
After that, we calculate the correlation of each part token to the patch token in each position, thus we can obtain attention maps, i.e., the possibility of a semantic part to appear in each position:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathbf { M } = \mathbf { F } _ { \mathrm { p } } \otimes \mathbf { F } : = \mathrm { s o f t m a x } ( \mathbf { F } _ { \mathrm { p } } ^ { T } \mathbf { W } _ { \mathrm { p } } ^ { T } \mathbf { W } \mathbf { F } ) ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\textbf { M } \in \ \mathbb { R } ^ { N \times H W }$ denotes $N$ attention maps, $\otimes$ indicates correlation function, which is implemented by softmax $( \mathbf { F } _ { \mathrm { p } } ^ { T } \mathbf { W } _ { \mathrm { p } } ^ { T } \mathbf { W } \mathbf { F } )$ in our work. $\mathbf { W } _ { \mathrm { p } }$ and $\mathbf { W }$ are embedding matrixes.
|
| 58 |
+
|
| 59 |
+
To learn such multi-attention maps (i.e., to optimize the parameters in Equation 1 and Equation 2), we propose a reconstruction task. Our insight is that the spatial information to reconstruct an image is highly correlated to the position of semantic parts. Thus, we adopt a StyleGAN-based decoder to reconstruct the original image based on the spatial information from the attention maps and the texture information from the class token. To ensure the attention maps learn spatial information, we 1) remove texture information from the attention maps by conducting a large-kernel blur operation and 2) further feed the blurred attention maps to stacked convolutional layers. To integrate the texture information from the class token into the decoder, we use Adaptive Instance Normalization (AdaIN) operation, which is widely used to integrate texture/style information:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
[ \mathbf { F } _ { \mathrm { d } } ] _ { i } = \mathrm { A d a l N } ( [ \mathrm { c o n v } ( \mathbf { M } ) ] _ { i } , \mathbf { F } _ { \mathrm { c } } ) : = [ \mathbf { W } _ { \mathrm { s } } \mathbf { F } _ { \mathrm { c } } ] _ { i } \frac { [ \mathrm { c o n v } ( \mathbf { M } ) ] _ { i } - \mu ( [ \mathrm { c o n v } ( \mathbf { M } ) ] _ { i } ) } { \sigma ( [ \mathrm { c o n v } ( \mathbf { M } ) ] _ { i } ) } + [ \mathbf { W } _ { \mathrm { b } } \mathbf { F } _ { \mathrm { c } } ] _ { i } ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where each feature channel $[ \mathrm { c o n v } ( \mathbf { M } ) ] _ { i }$ is normalized separately, and then scaled and biased using the corresponding scalar components from the embedded class token $\mathbf { F } _ { \mathrm { c } }$ . $\mathbf { F } _ { \mathrm { d } }$ denotes the convolutional feature in the decoder, ${ \bf W _ { s } }$ and $\mathbf { W } _ { \mathrm { b } }$ are embedding weights, $[ \cdot ] _ { i }$ denotes the $i ^ { t h }$ feature channel, $\mathrm { c o n v } ( \cdot )$ denotes convolutional layers, $\mu ( \cdot )$ and $\sigma ( \cdot )$ calculate the mean and variance values, respectively. The reconstructed image $\hat { \bf I }$ can be obtained by stacking convolutional and AdaIN layers:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\hat { \bf I } = \mathrm { c o n v } ( \mathrm { A d a I N } ( \mathrm { c o n v } ( { \bf F } _ { \mathrm { d } } ) , { \bf F } _ { \mathrm { c } } ) ) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
We use the Mean squared error (MSE) loss function to optimize such reconstruction task:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal { L } _ { r e c } ( \mathbf { I } , \hat { \mathbf { I } } ) = \frac { 1 } { H W } \sum _ { i , j } ^ { H W } ( \mathbf { I } ( i , j ) - \hat { \mathbf { I } } ( i , j ) ) ^ { 2 } .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Moreover, to obtain diverse multiple attention maps, we follow previous work [40] and add a diversity constraint over attention maps:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } _ { d i v } ( \mathbf { M } ) = \frac { 1 } { N ^ { 2 } } ( \sum _ { i \neq j } ( 0 - \frac { \mathbf { m } _ { i } \mathbf { m } _ { j } ^ { T } } { \| \mathbf { m } _ { i } \| _ { 2 } \| \mathbf { m } _ { j } \| _ { 2 } } ) ^ { 2 } + \sum _ { i = j } ( 1 - \frac { \mathbf { m } _ { i } \mathbf { m } _ { j } ^ { T } } { \| \mathbf { m } _ { i } \| _ { 2 } \| \mathbf { m } _ { j } \| _ { 2 } } ) ^ { 2 } ) ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where attention maps are optimized to be different from each other, $\mathbf { m } _ { i }$ and $\mathbf { m } _ { j }$ denotes the $i ^ { t h }$ and $j ^ { t h }$ attention map, respectively. The overall objective function can be denoted by:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { L } = \mathcal { L } _ { r e c } ( \mathbf { I } , \hat { \mathbf { I } } ) + \lambda \mathcal { L } _ { d i v } ( \mathbf { M } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\lambda$ is the loss weight.
|
| 90 |
+
|
| 91 |
+
# 3.2 Semantic-guided masking
|
| 92 |
+
|
| 93 |
+
After finished semantic part learning, we move to the next stage, i.e., semantic-guided MAE training. Our informed masking strategy is based on the part information learned in Subsection 3.1. Specifically, we can obtain multiple attention maps by Equation 2, where each attention map $\mathbf { m } \in \mathbb { R } ^ { H \times \hat { W } }$ indicates the possibility of the corresponding semantic part appearing in $H \times W$ positions. Thus we conduct argmax $( \cdot )$ operation over attention maps to obtain part segmentation, where each patch is classified into a particular semantic part. The patches in the same semantic part compose a visual analogue of words, which are semantically meaningful. To leverage such visual analogue of words for MAE training, a most intuitive way is to mask a portion of semantic parts and learn to predict the masked semantic parts by other parts. However, due to the learned semantic parts being coarse-grained (e.g., 6 parts for each image), we experimentally find that such a masking strategy makes the task too hard to effectively learn image representations.
|
| 94 |
+
|
| 95 |
+
To this end, we propose an easy-to-hard reconstruction task, which can provide reasonable hints (i.e., visible patches) for the model to predict the masked patches during the training process of the MAE. Specifically, at the beginning of the training process, we mask a portion of patches in each part, thus the masked patches can be predicted based on the visual patches that belong to the same semantic part. Such a design can facilitate the models to learn intra-part patterns. After that, we gradually mask all patches belonging to some parts and a portion of patches belong to the remaining parts. Finally, we mask all patches belonging to a portion of parts and predict the remaining patches belong to the other parts, where inter-part relations or visual reasoning ability can be learned.
|
| 96 |
+
|
| 97 |
+
Algorithm 1 shows the details to obtain the number of masked patches for each semantic part. First, we define two masking settings, i.e., 1) mask a portion of patches in each part and 2) random select some parts to mask (the whole part). The number of masked patches for each semantic part can be calculated for these two settings. After that, we introduce an interpolation hyper-parameter $\alpha$ . A small $\alpha$ means the first setting dominates the masking strategy, and vice versa. $\alpha$ is adjusted based on training iterations and keeps increasing during the training process. Finally, we random mask a certain number of patches based on the calculated masking number.
|
| 98 |
+
|
| 99 |
+
# Algorithm 1 Algorithm of Semantic-Guided Masking in a PyTorch-like style.
|
| 100 |
+
|
| 101 |
+
Input: $L$ , $x$ , num_patches, mask_ratio, total_epoches, epoch # $L$ : the number of patches per image. # $x \in \mathbb { R } ^ { L \times C }$ : the token embeddings of image patches. # num_patches $\mathbf { \Psi } \in \mathbb { R } ^ { N \times 1 }$ : the patch number of each part, where $N$ is the number of parts. # mask_ratio: the ratio of masked patches. # total_epoches: the number of pre-training epochs. # epoch: current epoch number. # mask a portion of patches in each part
|
| 102 |
+
1: num_mask1 = mask_ratio \* num_patches # randomly select some parts to mask (with tricks to ensure a fixed mask ratio)
|
| 103 |
+
2: shuffle_num_patches $=$ shuffle_parts(num_patches)
|
| 104 |
+
3: marks $\ v { U } = \mathbf { L } \ v { \Sigma } ^ { * }$ mask_ratio-cumsum(shuffle_num_patches)+shuffle_num_patches
|
| 105 |
+
4: marks_remains $=$ where(marks $< 0$ , 0, marks)
|
| 106 |
+
5: num_mask2 $=$ where(marks_remains $<$ shuffle_num_patches, marks_remains, shuffle_num_patches)
|
| 107 |
+
6: num_mask2 $=$ unshuffle_parts(num_mask2) # adaptive masking by interpolating between num_mask1 and num_mask2
|
| 108 |
+
7: α = ( epochtotal_epoches )
|
| 109 |
+
8: $\ n u m \_ m a s k = ( 1 - \alpha ) * n u m \_ m a s k 1 + \alpha * n u m \_ m a s k 2$
|
| 110 |
+
9: return num_mask # $n u m \_ m a s k \in \mathbb { R } ^ { N \times 1 } ;$ : the number of patches to be masked in each part.
|
| 111 |
+
|
| 112 |
+
# 4 Experiments
|
| 113 |
+
|
| 114 |
+
# 4.1 Experiment setup
|
| 115 |
+
|
| 116 |
+
Semantic part learning. As introduced in Section 3.1, we use ViT-small [14] as our part learning encoder, which is pre-trained by a self-supervised method iBOT [42]. We follow iBOT [42] to learn 6 semantic parts for each image, as the head number of the multi-head attention in ViT-Small is 6. The size of the blur kernel is experimentally set to be 7, and the loss weight $\lambda$ in Equation 7 is set to be 0.03. The experiment is performed on ImageNet-1k [11] dataset. The parameters of the ViT-based encoder are fixed, and we only optimize the attention module and the StyleGAN-based decoder. Our model converges fast, which only takes 2 hours on one A100 GPU card.
|
| 117 |
+
|
| 118 |
+
Semantic-guided MAE training. We follow MAE [19] and adopt an encoder-decoder structure to perform MIM. Our method is general for ViT backbones, while most experiments are conducted with a relatively small version, i.e., the original ViT-Base [14], due to the limitation of computation resources. We follow the most comment setting to optimize our model by AdamW [27] with a learning rate of $2 . 4 \mathrm { e } { - 3 }$ . The batch size is set to be 4096, and the weight decay is set to be 0.05. We use a cosine learning rate strategy [26] with warmup [17]. The warmup number is set to be 40 epochs, and we pre-train our model for 800 epochs. For data augmentation, we only employ random horizontal flipping in our pre-training stage. The hyper-parameter $\gamma$ in Algorithm 1 is experimentally set to be 2. Our model is trained on 16 A-100 GPUs for 3 days, and more details can be found in our code, which is in the supplemental material and will be made publicly released.
|
| 119 |
+
|
| 120 |
+
Table 1: Quantitative evaluation of the effectiveness of integrating semantic information for MAE.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan=2 colspan=1>Setting</td><td rowspan=1 colspan=2>16×16 patch size</td><td rowspan=1 colspan=2>8×8 patch size</td></tr><tr><td rowspan=1 colspan=1>MAE [19]</td><td rowspan=1 colspan=1>SemMAE</td><td rowspan=1 colspan=1>MAE [19]</td><td rowspan=1 colspan=1>SemMAE</td></tr><tr><td rowspan=1 colspan=1>Linear probing</td><td rowspan=1 colspan=1>63.7</td><td rowspan=1 colspan=1>65.0</td><td rowspan=1 colspan=1>66.8</td><td rowspan=1 colspan=1>68.7</td></tr></table>
|
| 123 |
+
|
| 124 |
+
# 4.2 Semantic-guided MAE
|
| 125 |
+
|
| 126 |
+
The effectiveness of integrating semantic information. We conduct experiments under two different settings (i.e., with a patch size of $1 6 \times 1 6$ and $8 \times 8$ ) to verify the effectiveness of integrating semantic information for training MAE. The results in Table 1 show that integrating semantic information can bring $1 . 3 \%$ and $1 . 9 \%$ accuracy gains for linear probing, respectively. As we use $8 \times 8$ patch size to learn semantic parts, the coarse-grained patch (i.e., large patch size) in the pre-training stage would cause imprecise part segment and suppresses the benefits of semantic parts. To further study the impact of patch size for masked image modeling, we conduct fine-tuning experiments in Table 2. It can be observed that in SimMIM and original MAE, a larger patch size performs better; while in our SemMAE, more precise semantic parts with $8 \times 8$ patch size can significantly improve the performance. Thus in the following experiments, we adopt $8 \times 8$ patch size for SemMAE. It is notable that although using a smaller patch size, our parameters and computational cost do not increase during pre-training and linear probing as only 1/4 patches in each image are used. Specifically, we leverage the learned attentions maps to remove $3 / 4$ patches that are most likely to be the background.
|
| 127 |
+
|
| 128 |
+
Table 2: The optimal patch size for different models.
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Patch size</td><td rowspan=1 colspan=1>Fine-tuning Acc.(%)</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Patch size</td><td rowspan=1 colspan=1>Fine-tuning Acc.(%)</td></tr><tr><td rowspan=4 colspan=1>SimMIM [37]</td><td rowspan=1 colspan=1>32x32</td><td rowspan=1 colspan=1>82.8</td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1>MAE [19]</td><td rowspan=1 colspan=1>16x16</td><td rowspan=1 colspan=1>83.26</td></tr><tr><td rowspan=1 colspan=1>16x16</td><td rowspan=1 colspan=1>82.7</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>8x8</td><td rowspan=1 colspan=1>83.10</td></tr><tr><td rowspan=1 colspan=1>8x8</td><td rowspan=1 colspan=1>82.1</td><td rowspan=2 colspan=2>SemMAE</td><td rowspan=1 colspan=1>16x16</td><td rowspan=1 colspan=1>83.34</td></tr><tr><td rowspan=1 colspan=1>4x4</td><td rowspan=1 colspan=1>82.0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>8x8</td><td rowspan=1 colspan=1>84.50</td></tr></table>
|
| 131 |
+
|
| 132 |
+
A detailed study on masking strategies. Once obtained semantic parts, a most intuitive way to leverage such visual analogue of words for MAE training is to mask a portion of semantic parts and make the model to predict the removed content. However, due to the learned semantic parts being coarse-grained (e.g., 6 parts for each image), we experimentally find that such a masking strategy makes the task too hard to effectively learn image representations. The results can be found in Table 3, where masking $7 5 \%$ parts cause $1 3 . 9 \%$ performance drops compared to random masking. Moreover, it can be observed that masking $7 5 \%$ patches per part achieves comparable results with random masking. The self-supervised learning task of masking $7 5 \%$ patches per part would encourage the model to learn local contexts/intra-part patterns, and masking $7 5 \%$ parts would encourage the model to learn inter-part relations. Interestingly, we find that the former task can enable the model to further learn better image representation in the latter task. The results in Table 3 show that our proposed adaptive masking strategy (i.e., varying from masking $7 5 \%$ patches per part to masking $7 5 \%$ parts gradually) with $\gamma = 2$ yields the best performance.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: The curves of $\alpha$ and $\gamma$
|
| 136 |
+
|
| 137 |
+
Table 3: Quantitative evaluation of different masking strategies.
|
| 138 |
+
|
| 139 |
+
<table><tr><td rowspan=1 colspan=1>Mask strategy</td><td rowspan=1 colspan=1>a</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>Linear probing</td></tr><tr><td rowspan=1 colspan=1>Random masking</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>66.8</td></tr><tr><td rowspan=1 colspan=1>Mask 75% patches</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>66.5</td></tr><tr><td rowspan=1 colspan=1>Mask 75% parts</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>52.9</td></tr><tr><td rowspan=6 colspan=1>Adaptive masking</td><td rowspan=1 colspan=1>1→0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>63.3</td></tr><tr><td rowspan=5 colspan=1>0→1</td><td rowspan=1 colspan=1>1/3</td><td rowspan=1 colspan=1>66.2</td></tr><tr><td rowspan=1 colspan=1>1/2</td><td rowspan=1 colspan=1>67.3</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>67.9</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>68.7</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>68.6</td></tr></table>
|
| 140 |
+
|
| 141 |
+
# 4.3 Semantic part learning
|
| 142 |
+
|
| 143 |
+
We first evaluate the effectiveness of our proposed semantic part learning method. Both qualitative and quantitative experiments are conducted. Note that most of the previous part learning models are designed for single-class datasets and cannot be effectively applied to ImageNet. iBOT [42] is not proposed for part learning, while the multi-head attention in their model achieves the state-of-the-art part learning performance on ImageNet. Figure 4 shows the qualitative comparison of our model and iBOT [42], and it can be observed that our model can generate more complete semantic part segmentation maps where different parts and the background are better separated with less noise. Moreover, as there is no part segmentation ground truth, we conduct quantitatively evaluation in an indirect way by training SemMAE and analyzing ImageNet classification performance. The results in Table 4 show that the semantic parts obtained by iBOT are not able to benefit the learning of MAE, while our semantic part learning methods can generate more precise part segmentation maps, which are vital to learning a better image representation.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 4: Qualitative comparison of semantic part learning. Different color indicates different semantic parts, and it can be observed that our model can better separate different parts and the background with less noise.
|
| 147 |
+
|
| 148 |
+
Table 4: Quantitative evaluation of semantic part learning in terms of classification accuracy $( \% )$ .
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Semantic parts for masking Baseline (w/o parts) iBOT-initialized partsOur learned parts</td><td></td><td></td><td></td></tr><tr><td>Linear probing Acc. (%)</td><td>63.7</td><td>63.6</td><td>65.0</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 5: System-level comparison on ImageNet-1k in terms of classification accuracy using ViT-Base as the encoder. Note that we list the best performance in previous papers with $2 2 4 \times 2 2 4$ inputs, and some experiment settings (e.g., training epochs and patch size) may be different.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Method</td><td></td><td>Pre-train dataset Pre-train epoches Linear probing</td><td></td><td>gFintuning</td></tr><tr><td colspan="5">Traning from scratch</td></tr><tr><td colspan="2">ViT384 [14]</td><td></td><td></td><td>77.9</td></tr><tr><td colspan="2">DeiT[31]</td><td></td><td></td><td>81.8</td></tr><tr><td colspan="2">ViT[19]</td><td>=</td><td></td><td>82.3</td></tr><tr><td colspan="5">Contrastive-based SSL Pre-Training</td></tr><tr><td>AttMask [42]</td><td>ImageNet-1K</td><td>100</td><td>75.7</td><td>1</td></tr><tr><td>DINO [6]</td><td>ImageNet-1K</td><td>300</td><td>78.2</td><td>82.8</td></tr><tr><td>MoCo v3 [9]</td><td>ImageNet-1K</td><td>300</td><td>76.5</td><td>83.2</td></tr><tr><td>iBOT[42]</td><td>ImageNet-1K</td><td>1600</td><td>79.5</td><td>84.0</td></tr><tr><td colspan="5">MIM-based SSL Pre-Training</td></tr><tr><td>BeiT[3]</td><td>ImageNet-1K</td><td>800</td><td>56.7</td><td>83.2</td></tr><tr><td>MAE [19]</td><td>ImageNet-1K</td><td>1600</td><td>68.0</td><td>83.6</td></tr><tr><td>SimMIM [37]</td><td>ImageNet-1K</td><td>800</td><td>56.7</td><td>83.8</td></tr><tr><td> SemMAE</td><td>ImageNet-1K</td><td>800</td><td>68.7</td><td>84.5</td></tr></table>
|
| 155 |
+
|
| 156 |
+
# 4.4 Compared with other methods on ImageNet
|
| 157 |
+
|
| 158 |
+
Linear probing and fine-tuning on ImageNet-1K classification dataset is the most common setting to evaluate SSL methods. We collect all competitive methods that report their results on ImageNet-1K dataset. For example, we do not include the related work MST [25] and ADIOS [30] as they evaluate their model on other benchmarks. Table 5 shows the comparison of our model and previous models in terms of linear probing and fine-tuning. For a fair comparison, all experiments adopt the same input size, i.e., $2 2 4 \times 2 2 4$ unless specified otherwise. Compared with “training from scratch”, our SemMAE can significantly improve the performance for both linear probing and fine-tuning. For linear probing, our SemMAE outperforms the most competitive MIM-based methods by $0 . 8 \%$ even with fewer training epochs. For fine-tuning, our SemMAE achieves $8 4 . 5 \%$ top-1 classification accuracy, outperforming SimMIM[37] and MAE[19] by $0 . 9 \%$ and $0 . 7 \%$ respectively. Moreover, our SemMAE can also surpass previous contrastive learning-based methods[6, 9] for fine-tuning.
|
| 159 |
+
|
| 160 |
+
# 4.5 Downstream tasks
|
| 161 |
+
|
| 162 |
+
Fine-grained image classification. Table 6 shows our results of transfer learning on fine-grained datasets. Our model can surpass the most competitive MAE [19] with a clear margin, i.e., $0 . 3 \%$ , $0 . 6 \%$ , and $0 . 2 \%$ on the iNaturalists[33], CUB-Bird[34], and Stanford-Cars[23] dataset, respectively. These results show the promising transfer ability of our SemMAE for downstream classification tasks.
|
| 163 |
+
|
| 164 |
+
Table 6: Fine-tuning results on fine-grained datasets.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Method</td><td>iNa19</td><td>CUB</td><td>Cars</td></tr><tr><td>BeiT[3]</td><td>79.2</td><td>-</td><td>94.2</td></tr><tr><td>DINO [3]</td><td>78.6</td><td></td><td>93.0</td></tr><tr><td>iBoT[19]</td><td>79.6</td><td>1</td><td>94.3</td></tr><tr><td>MAE [19]</td><td>81.8</td><td>86.5</td><td>94.2</td></tr><tr><td> SemMAE</td><td>82.1</td><td>87.1</td><td>94.4</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Semantic segmentation. Semantic segmentation aims to assign a label to each pixel of the input image. We evaluate our SemMAE on the widely used semantic segmentation dataset ADE20K [41], which contains 25K images and 150 semantic categories. We follow the most common setting to use the task layer in UPerNet [36] and fine-tune the pre-trained ViT-Base model. We use the standard setting that pre-train a ViT-Base model with a patch size of $1 6 \times 1 6$ and fine-tunes 160K iterations with a batch size of 16. Such an experiment can validate the transfer ability of our SemMAE for semantic segmentation. As shown in Table 7, SeMAE surpasses MAE by 0.2 (46.3 vs. 46.1) mIoU and outperforms the supervised pre-train model by 1.0 mIoU. These results show the promising transfer ability of our SemMAE for dense prediction visual tasks.
|
| 169 |
+
|
| 170 |
+
Table 7: Semantic segmentation results on ADE-20K.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Method</td><td>mIoU</td></tr><tr><td>Supervised Pre-Training</td><td>45.3</td></tr><tr><td>Self-Supervised Pre-Training</td><td></td></tr><tr><td>BeiT</td><td>45.8</td></tr><tr><td>MAE(800 epochs)</td><td>46.1</td></tr><tr><td>SemMAE (Ours)</td><td>46.3</td></tr></table>
|
| 173 |
+
|
| 174 |
+
# 5 Conclusion
|
| 175 |
+
|
| 176 |
+
In this paper, we study the visual analogue of words and propose a semantic-guided masked autoencoder model to reduce the gap between masked language modeling and masked image modeling. Our proposed self-supervised semantic part learning method can generate promising semantic parts on ImageNet and we show that the learned semantic parts can facilitate the learning of MAE. Unlike the main-stream random masking strategy, our semantic-guided mask strategy can effectively integrate semantic information in the pre-training process. Extensive experiments with superior results show the effectiveness of our SemMAE.
|
| 177 |
+
|
| 178 |
+
Limitations: due to the lack of part segmentation labels, the semantic part in our work is kind of coarse (e.g., 6 parts per image), making it not an ideal visual analogue of words yet. Moreover, using a small patch size increases the computational cost in the fine-tuning stage. In the future, we will 1) investigate finer-grained semantic parts (e.g., 20-30 parts per image) by few-shot part segmentation and 2) replace the widely obtained patch-based tokenization with part-based tokenization to further reduce the gap between vision and language modeling.
|
| 179 |
+
|
| 180 |
+
# References
|
| 181 |
+
|
| 182 |
+
[1] Atito, S., Awais, M., Farooq, A., Feng, Z., Kittler, J.: Mc-ssl0. 0: Towards multi-concept self-supervised learning. arXiv preprint arXiv:2111.15340 (2021)
|
| 183 |
+
[2] Atito, S., Awais, M., Kittler, J.: Sit: Self-supervised vision transformer. arXiv preprint arXiv:2104.03602 (2021)
|
| 184 |
+
[3] Bao, H., Dong, L., Piao, S., Wei, F.: BEit: BERT pre-training of image transformers. In: ICLR (2022)
|
| 185 |
+
[4] Baranchuk, D., Rubachev, I., Voynov, A., Khrulkov, V., Babenko, A.: Label-efficient semantic segmentation with diffusion models. In: ICLR (2022)
|
| 186 |
+
[5] Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J.D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al.: Language models are few-shot learners. NeurIPS 33, 1877–1901 (2020)
|
| 187 |
+
[6] Caron, M., Touvron, H., Misra, I., Jégou, H., Mairal, J., Bojanowski, P., Joulin, A.: Emerging properties in self-supervised vision transformers. In: ICCV. pp. 9650–9660 (2021)
|
| 188 |
+
[7] Chen, M., Radford, A., Child, R., Wu, J., Jun, H., Luan, D., Sutskever, I.: Generative pretraining from pixels. In: ICML. pp. 1691–1703 (2020)
|
| 189 |
+
[8] Chen, X., Mottaghi, R., Liu, X., Fidler, S., Urtasun, R., Yuille, A.L.: Detect what you can: Detecting and representing objects using holistic models and body parts. In: CVPR. pp. 1979– 1986 (2014)
|
| 190 |
+
[9] Chen, X., Xie, S., He, K.: An empirical study of training self-supervised vision transformers. In: ICCV. pp. 9640–9649 (2021)
|
| 191 |
+
[10] Choudhury, S., Laina, I., Rupprecht, C., Vedaldi, A.: Unsupervised part discovery from contrastive reconstruction. NeurIPS 34 (2021)
|
| 192 |
+
[11] Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR. pp. 248–255 (2009)
|
| 193 |
+
[12] Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018)
|
| 194 |
+
[13] Dong, X., Bao, J., Zhang, T., Chen, D., Zhang, W., Yuan, L., Chen, D., Wen, F., Yu, N.: Peco: Perceptual codebook for bert pre-training of vision transformers. arXiv preprint arXiv:2111.12710 (2021)
|
| 195 |
+
[14] Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., Houlsby, N.: An image is worth 16x16 words: Transformers for image recognition at scale. In: ICLR (2021)
|
| 196 |
+
[15] Felzenszwalb, P.F., Girshick, R.B., McAllester, D., Ramanan, D.: Object detection with discriminatively trained part-based models. TPAMI 32(9), 1627–1645 (2009)
|
| 197 |
+
[16] Fischler, M.A., Elschlager, R.A.: The representation and matching of pictorial structures. TC 100(1), 67–92 (1973)
|
| 198 |
+
[17] Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., He, K.: Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677 (2017)
|
| 199 |
+
[18] He, J., Yang, S., Yang, S., Kortylewski, A., Yuan, X., Chen, J.N., Liu, S., Yang, C., Yuille, A.: Partimagenet: A large, high-quality dataset of parts. arXiv preprint arXiv:2112.00933 (2021)
|
| 200 |
+
[19] He, K., Chen, X., Xie, S., Li, Y., Dollár, P., Girshick, R.: Masked autoencoders are scalable vision learners. arXiv preprint arXiv:2111.06377 (2021)
|
| 201 |
+
[20] Hinton, G.: How to represent part-whole hierarchies in a neural network. arXiv preprint arXiv:2102.12627 (2021)
|
| 202 |
+
[21] Kakogeorgiou, I., Gidaris, S., Psomas, B., Avrithis, Y., Bursuc, A., Karantzalos, K., Komodakis, N.: What to hide from your students: Attention-guided masked image modeling. arXiv preprint arXiv:2203.12719 (2022)
|
| 203 |
+
[22] Krause, J., Jin, H., Yang, J., Fei-Fei, L.: Fine-grained recognition without part annotations. In: CVPR. pp. 5546–5555 (2015)
|
| 204 |
+
[23] Krause, J., Stark, M., Deng, J., Fei-Fei, L.: 3d object representations for fine-grained categorization. In: Proceedings of the IEEE international conference on computer vision workshops. pp. 554–561 (2013)
|
| 205 |
+
[24] Li, X., Ge, Y., Yi, K., Hu, Z., Shan, Y., Duan, L.Y.: mc-beit: Multi-choice discretization for image bert pre-training. arXiv preprint arXiv:2203.15371 (2022)
|
| 206 |
+
[25] Li, Z., Chen, Z., Yang, F., Li, W., Zhu, Y., Zhao, C., Deng, R., Wu, L., Zhao, R., Tang, M., et al.: Mst: Masked self-supervised transformer for visual representation. NeurIPS 34 (2021)
|
| 207 |
+
[26] Loshchilov, I., Hutter, F.: Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983 (2016)
|
| 208 |
+
[27] Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 (2017)
|
| 209 |
+
[28] Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., Efros, A.A.: Context encoders: Feature learning by inpainting. In: CVPR. pp. 2536–2544 (2016)
|
| 210 |
+
[29] Saha, O., Cheng, Z., Maji, S.: Ganorcon: Are generative models useful for few-shot segmentation? arXiv preprint arXiv:2112.00854 (2021)
|
| 211 |
+
[30] Shi, Y., Siddharth, N., Torr, P.H., Kosiorek, A.R.: Adversarial masking for self-supervised learning. arXiv preprint arXiv:2201.13100 (2022)
|
| 212 |
+
[31] Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., Jégou, H.: Training data-efficient image transformers & distillation through attention. In: ICML. pp. 10347–10357 (2021)
|
| 213 |
+
[32] Van Den Oord, A., Vinyals, O., et al.: Neural discrete representation learning. NeurIPS 30 (2017)
|
| 214 |
+
[33] Van Horn, G., Mac Aodha, O., Song, Y., Cui, Y., Sun, C., Shepard, A., Adam, H., Perona, P., Belongie, S.: The inaturalist species classification and detection dataset. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 8769–8778 (2018)
|
| 215 |
+
[34] Wah, C., Branson, S., Welinder, P., Perona, P., Belongie, S.: The caltech-ucsd birds-200-2011 dataset (2011)
|
| 216 |
+
[35] Wei, C., Fan, H., Xie, S., Wu, C.Y., Yuille, A., Feichtenhofer, C.: Masked feature prediction for self-supervised visual pre-training. arXiv preprint arXiv:2112.09133 (2021)
|
| 217 |
+
[36] Xiao, T., Liu, Y., Zhou, B., Jiang, Y., Sun, J.: Unified perceptual parsing for scene understanding. In: ECCV. pp. 418–434 (2018)
|
| 218 |
+
[37] Xie, Z., Zhang, Z., Cao, Y., Lin, Y., Bao, J., Yao, Z., Dai, Q., Hu, H.: Simmim: A simple framework for masked image modeling. arXiv preprint arXiv:2111.09886 (2021)
|
| 219 |
+
[38] Zhang, Y., Ling, H., Gao, J., Yin, K., Lafleche, J.F., Barriuso, A., Torralba, A., Fidler, S.: Datasetgan: Efficient labeled data factory with minimal human effort. In: CVPR. pp. 10145– 10155 (2021)
|
| 220 |
+
[39] Zheng, H., Fu, J., Mei, T., Luo, J.: Learning multi-attention convolutional neural network for fine-grained image recognition. In: CVPR. pp. 5209–5217 (2017)
|
| 221 |
+
[40] Zheng, H., Fu, J., Zha, Z.J., Luo, J.: Learning deep bilinear transformation for fine-grained image representation. NeurIPS 32 (2019)
|
| 222 |
+
[41] Zhou, B., Zhao, H., Puig, X., Fidler, S., Barriuso, A., Torralba, A.: Scene parsing through ade20k dataset. In: CVPR. pp. 633–641 (2017)
|
| 223 |
+
[42] Zhou, J., Wei, C., Wang, H., Shen, W., Xie, C., Yuille, A., Kong, T.: ibot: Image bert pre-training with online tokenizer. arXiv preprint arXiv:2111.07832 (2021)
|
| 224 |
+
|
| 225 |
+
# Checklist
|
| 226 |
+
|
| 227 |
+
The checklist follows the references. Please read the checklist guidelines carefully for information on how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description. For example:
|
| 228 |
+
|
| 229 |
+
• Did you include the license to the code and datasets? [Yes] See Section ??.
|
| 230 |
+
• Did you include the license to the code and datasets? [No] The code and the data are proprietary.
|
| 231 |
+
• Did you include the license to the code and datasets? [N/A]
|
| 232 |
+
|
| 233 |
+
Please do not modify the questions and only use the provided macros for your answers. Note that the Checklist section does not count towards the page limit. In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
|
| 234 |
+
|
| 235 |
+
1. For all authors...
|
| 236 |
+
|
| 237 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 238 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 5
|
| 239 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 240 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 241 |
+
|
| 242 |
+
2. If you are including theoretical results...
|
| 243 |
+
|
| 244 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] No theoretical results. (b) Did you include complete proofs of all theoretical results? [N/A] No theoretical results.
|
| 245 |
+
|
| 246 |
+
3. If you ran experiments...
|
| 247 |
+
|
| 248 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] In the supplemental material
|
| 249 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4 Experiment Setup.
|
| 250 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 251 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4 Experiment Setup.
|
| 252 |
+
|
| 253 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 254 |
+
|
| 255 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 256 |
+
(b) Did you mention the license of the assets? [Yes] In our code.
|
| 257 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 258 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes]
|
| 259 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes]
|
| 260 |
+
|
| 261 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 262 |
+
|
| 263 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 264 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 265 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/Jep2ykGUdS/Jep2ykGUdS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/KVljrqehulG/KVljrqehulG.md
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EFFICIENT AUTOMATIC GRAPH LEARNING VIA DESIGN RELATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Despite the success of automated machine learning (AutoML), which aims to find the best design, including the architecture of neural networks and hyper-parameters, conventional AutoML methods are computationally expensive and hardly provide insights into the relations of different model design choices. This work focus on the scope of AutoML on graph tasks. To tackle the challenges, we propose FALCON, an efficient sample-based method to search for the optimal model design on graph tasks. Our key insight is to model the design space of possible model designs as a design graph, where the nodes represent design choices, and the edges denote design similarities. FALCON features 1) a task-agnostic module, which performs message passing on the design graph via a Graph Neural Network (GNN), and 2) a task-specific module, which conducts label propagation of the known model performance information on the design graph. Both modules are combined to predict the design performances in the design space, navigating the search direction. We conduct extensive experiments on 27 node and graph classification tasks from various application domains. We empirically show that FALCON can efficiently obtain the well-performing designs for each task using only 30 explored nodes. Specifically, FALCON has a comparable time cost with the one-shot approaches while achieving an average improvement of $3 . 3 \%$ compared with the best baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Automated machine learning (AutoML) (Liu et al., 2019; Pham et al., 2018; Bender et al., 2018; Real et al., 2019; Zoph & Le, 2017; Cai et al., 2019; 2021; Gao et al., 2019; You et al., 2020b; Zhang et al., 2021) has demonstrated great success in various domains including computer vision (Chu et al., 2020; Ghiasi et al., 2019; Chen et al., 2019), language modeling (Zoph & Le, 2017; So et al., 2019), and recommender systems (Chen et al., 2022). It is an essential component for the state-of-the-art deep learning models (Liu et al., 2018; Baker et al., 2017; Xu et al., 2020; Chen et al., 2021).
|
| 12 |
+
|
| 13 |
+
Given a graph learning task, e.g., a node/graph classification task on graphs, our goal of AutoML is to search for a model architecture and hyper-parameter setting from a design space that results in the best test performance on the task. Following previous works (You et al., 2020b), we define design as a set of architecture and hyper-parameter choices (e.g., 3 layer, 64 embedding dimensions, batch normalization, skip connection between consecutive layers), and define design space as the space of all possible designs for a given task.
|
| 14 |
+
|
| 15 |
+
However, AutoML is very computationally intensive. The design space of interest often involves millions of possible designs (Elsken et al.; You et al., 2020a). Sample-based AutoML (Zoph & Le, 2017; Gao et al., 2019; Bergstra et al., 2011; Liu et al., 2017; Luo et al., 2018) has been used to perform search via sampling candidate designs from the design space to explore. One central challenge of existing sample-based AutoML solutions is its sample efficiency: it needs to train as few models as possible to identify the best-performing model in the vast design space. To improve the efficiency, existing research focuses on developing good search algorithms to navigate in the design space (White et al., 2021; Shi et al., 2020; Ma et al., 2019).
|
| 16 |
+
|
| 17 |
+
However, these methods do not consider modeling the effect of model design choices, which provides strong inductive biases in searching for the best-performing model. By “inductive bias”, we refer to the patterns of multiple variables interacting together, which can happen in multiple parts of the design space. Thus, an efficient search strategy should rapidly rule out a large subset of the design space with potentially bad performance leveraging such learned inductive bias.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Overview of FALCON. (a) Design graph example. We present a small design graph on TU-COX2 graph classification dataset. The design choices are shown in the table, #pre, #mp, #post denotes the numbers of pre-processing, message passing, and post-processing layers, respectively. The better design performance, the darker node colors. (b) FALCON search strategy. Red: Explored nodes. Green: Candidate nodes to be sampled from. Blue: The best node. Gray: Other nodes. Locally, FALCON extends the design subgraph via a search strategy detailed in Section 3.3. Globally, FALCON approaches the optimal design navigated by the inductive bias of the design relations.
|
| 21 |
+
|
| 22 |
+
Proposed approach. To overcome the limitations, we propose FALCON, an AutoML framework on graph tasks that achieves state-of-the-art sample efficiency and performance by leveraging model design insights. Our key insight is to build a design graph over the design space of architecture and hyper-parameter choices. FALCON extracts model design insights by learning a meta-model that captures the relation between the design graph and model performance and uses it to inform a sample-efficient search strategy. FALCON consists of the following two novel components.
|
| 23 |
+
|
| 24 |
+
Design space as a graph. Previous works view the model design space as a high-dimensional space with isolated design choices (You et al., 2020b), which offer few insights regarding the relations between different design choices. For example, through trial runs if we find the models with more than 3 layers do not work well without batch normalization, this knowledge can help us reduce the search space by excluding all model designs of more than 3 layers with batch normalization set to false. While such insights are hardly obtained with existing AutoML algorithms (Liu et al., 2019; Pham et al., 2018; Gao et al., 2019; Zoph & Le, 2017; Cai et al., 2019), FALCON achieves it via constructing a graph representation, design graph, among all the design choices. Figure 1(a) shows a visualization of a design graph, where each node represents a candidate design, and edges denote the similarity between the designs. See Section 3.1 for details on the similarity and graph construction.
|
| 25 |
+
|
| 26 |
+
Search by navigating on the design graph. Given the design graph, FALCON deploys a Graph Neural Network predictor, short for meta-GNN, which is supervised by the explored nodes’ performances and learns to predict the performance of a specific design given the corresponding node in the design graph. The meta-GNN is designed with 1) a task-agnostic module, which performs message passing on the design graph, and 2) a task-specific module, which conducts label propagation of the known model performance information on the design graph. Furthermore, we propose a search strategy that uses meta-GNN predictions to navigate the search in the design graph efficiently.
|
| 27 |
+
|
| 28 |
+
Experiments. We conduct extensive experiments on 27 graph datasets, covering node- and graphlevel tasks with distinct distributions. Moreover, we demonstrate FALCON’ potential applicability on image datasets by conducting experiments on the CIFAR-10 image dataset. Our code is available at https://anonymous.4open.science/r/Falcon.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Automatic Machine Learning (AutoML) is the cornerstone of discovering state-of-the-art model designs without costing massive human efforts. We introduce four types of related works below.
|
| 33 |
+
|
| 34 |
+
Sample-based AutoML methods. Existing sample-based approaches explore the search space via sampling candidate designs, which includes heuristic search algorithms, e.g., Simulated Annealing, Bayesian Optimization approaches (Bergstra et al., 2011; White et al., 2021; Ma et al., 2019), evolutionary- (Xie & Yuille, 2017; Real et al., 2017) and reinforcement-based methods (Zoph & Le, 2017; Zhou et al., 2019; Gao et al., 2019). However, they tend to train thousands of models from scratch, which results in the low sample efficiency. For example, (Zoph & Le, 2017; Gao et al., 2019) usually involve training hundreds of GPUs for several days, hindering the development of AutoML in real-world applications (Bender et al., 2018). Some hyper-parameter search methods aim to reduce the computational cost. For example, Successive Halving (Karnin et al., 2013) allocates the training resources to more potentially valuable models based on the early-stage training information. Li et al. (2017) further extend it using different budgets to find the best configurations to avoid the trade-off between selecting the configuration number and allocating the budget. Jaderberg et al. (2017) combine parallel search and sequential optimisation methods to conduct fast search. However, their selective mechanisms are only based on the model performance and lack of deep knowledge, which draws less insight into the relation of design variables and limits the sample efficiency.
|
| 35 |
+
|
| 36 |
+
One-shot AutoML methods. The one-shot approaches (Liu et al., 2019; Pham et al., 2018; Xie et al., 2019; Bender et al., 2018; Qin et al., 2021) have been popular for the high search efficiency. Specifically, they involve training a super-net representing the design space, i.e., containing every candidate design, and shares the weights for the same computational cell. Nevertheless, weight sharing degrades the reliability of design ranking, as it fails to reflect the true performance of the candidate designs (Yu et al., 2020).
|
| 37 |
+
|
| 38 |
+
Graph-based AutoML methods. The key insight of our work is to construct the design space as a design graph, where nodes are candidate designs and edges denote design similarities, and deploy a Graph Neural Network, i.e., meta-GNN, to predict the design performance. Graph HyperNetwork (Zhang et al., 2019a) directly generates weights for each node in a computation graph representation. You et al. (2020a) study network generators that output relational graphs and analyze the link between their predictive performance and the graph structure. Recently, Zhao et al. (2020) considers both the micro- (i.e., a single block) and macro-architecture (i.e., block connections) of each design in graph domain. AutoGML (Park et al., 2022) designs a meta-graph to capture the relations among models and graphs and take a meta-learning approach to estimate the relevance of models to different graphs. Notably, none of these works model the search space as a design graph.
|
| 39 |
+
|
| 40 |
+
Design performance predictor. Previous works predict the performance of a design using the learning curves (Baker et al., 2018), layer-wise features (Deng et al., 2017), computational graph structure (Zhang et al., 2019a; White et al., 2021; Shi et al., 2019; Ma et al., 2019; Zhang et al., 2019b; Lee et al., 2021a), or combining dataset information (Lee et al., 2021a) via a dataset encoder. To highlight, FALCON explicitly models the relations among model designs. Moreover, it leverages the performance information on training instances to provide task-specific information besides the design features, which is differently motivated compared with Lee et al. (2021b) that employs meta-learning techniques and incorporate hardware features to rapidly adapt to unseen devices. Besides, meta-GNN is applicable for both images and graphs, compared with Lee et al. (2021a).
|
| 41 |
+
|
| 42 |
+
# 3 PROPOSED METHOD
|
| 43 |
+
|
| 44 |
+
This section introduces our proposed approach FALCON for sample-based AutoML. In Section 3.1, we introduce the construction of design graph, and formulate the AutoML goal as a search on the design graph for the node with the best task performance. In Section 3.2, we introduce our novel neural predictor consisting of a task-agnostic module and a task-specific module, which predicts the performances of unknown designs. Finally, we detail our search strategy in Section 3.3. We refer the reader to Figure 1 (b) for a high-level overview of FALCON.
|
| 45 |
+
|
| 46 |
+
# 3.1 DESIGN SPACE AS A GRAPH
|
| 47 |
+
|
| 48 |
+
Motivation. Previous works generally consider each design choice as isolated from other designs. However, it is often observed that some designs that share the same design features, e.g., graph neural networks (GNNs) that are more than 3 layers and have batch normalization layers, may have similar performances. Moreover, the inductive bias of the relations between design choices can provide valuable information for navigating the design space for the best design. For example, suppose we find that setting batch normalization of a 3-layer GCN (Kipf & Welling, 2017) and a 4-layer GIN (Xu et al., 2019) to false both degrade the performance. Then we can reasonably infer that a 3-layer GraphSAGE (Hamilton et al., 2017) with batch normalization outperforms the one without. We could leverage such knowledge and only search for the designs that are more likely to improve the task performance. To the best of our knowledge, FALCON is the first method to explicitly consider such relational information among model designs.
|
| 49 |
+
|
| 50 |
+
Design graph. We denote the design graph as $\mathcal { G } ( \mathcal { N } , \mathcal { E } )$ , where the nodes $\mathcal { N }$ include the candidate designs, and edges $\mathcal { E }$ denote the similarities between the candidate designs. Specifically, we use the notion of design distance to decide the graph connectivity, and we elaborate on them below.
|
| 51 |
+
|
| 52 |
+
Design distance. For each numerical design dimension, two design choices have a distance 1 if they are adjacent in the ordered list of design choices. For example, if the hidden dimension size can take values [16, 32, 64, 128], then the distance between 16 and 32 is 1, and the distance between 32 and 128 is 2. For each categorical design dimension, any two distinct design choices have a distance 1. We then define the connectivity of the design graph in terms of the design distance:
|
| 53 |
+
|
| 54 |
+
Definition 1 (Design Graph Connectivity) The design graph can be expressed as $\mathscr { G } ( \mathcal { N } , \mathcal { E } )$ , where the nodes $\mathcal { N } = \{ d _ { 1 } , \ldots , d _ { n } \}$ are model designs, and $( d _ { i } , d _ { j } ) \in \mathcal { E }$ iff the design distance between $d _ { i }$ and $d _ { j }$ is 1.
|
| 55 |
+
|
| 56 |
+
Structure of the design graph. The definition of edges implies that the design graph is highly structured, with the following properties: (1) All designs that are the same except for one categorical design dimension form a clique subgraph. (2) All designs that are the same except $k$ numerical design dimensions form a grid graph structure. Moreover, we use a special calculation for the design distance with a combination of design dimensions that have dependencies. For example, the design dimensions of pooling operations, pooling layers, and the number of layers can depend on each other, thus the design graph structure becomes more complex. See the details in Appendix A.2.
|
| 57 |
+
|
| 58 |
+
Design subgraph. The design graph may contain millions of nodes. Therefore, directly applying the meta-model to the design graph is computationally intensive. Moreover, a reliable performance estimation for an unknown node depends on its similarity between the nodes already explored by the search algorithm. Therefore, we focus on using a meta-model to predict performance for a dynamic subgraph, i.e., design subgraph, containing the explored nodes in the current search stage and the candidate nodes to be sampled in the next step. The candidate set can be constructed by selecting the multi-hop neighbors of explored nodes on the design graph. The design subgraph is defined as:
|
| 59 |
+
|
| 60 |
+
Definition 2 (Design Subgraph) During a search, suppose the explored node set is $\mathcal { N } _ { e }$ and the candidate set is $\mathcal { N } _ { c }$ . The design subgraph is formulated as $\mathcal { G } _ { s } ( \mathcal { N } _ { s } , \mathcal { E } _ { s } )$ , where $\mathcal { N } _ { s } = \mathcal { N } _ { e } \cup \mathcal { N } _ { c }$ are the nodes and $\mathcal { E } _ { s } = \{ ( u , v ) | u \in \mathrm { \bar { \mathcal { N } } } _ { s } , v \in \bar { \mathcal { N } } _ { s } , ( \bar { u } , v ) \in \mathcal { N } \}$ are the edges.
|
| 61 |
+
|
| 62 |
+
Given the design subgraph, we formulate the AutoML problem as searching for the node, i.e., design choice, with the best task performance.
|
| 63 |
+
|
| 64 |
+
# 3.2 META-GNN FOR PERFORMANCE PREDICTION
|
| 65 |
+
|
| 66 |
+
Here we introduce a meta-model, named meta-GNN, to predict the performance of model designs, i.e., nodes of the design subgraph. The goal of meta-GNN is learning the inductive bias of design relations, which is used to navigate the search path on the design graph. As is illustrated in Figure 2, the meta-GNN comprises a task-agnostic module and a task-specific module, used to capture the knowledge of model design and task performance, respectively.
|
| 67 |
+
|
| 68 |
+
Task-agnostic module. The task-agnostic module uses a design encoder to encode the design features on nodes of the design subgraph, and a relation encoder to capture the design similarities and differences on edges of the design subgraph. After that, it performs message passing on the design subgraph. We introduce each component below:
|
| 69 |
+
|
| 70 |
+
• Design encoder: it computes the node features of design subgraph by the concatenation of the feature encoding of each design dimension. For numerical design dimensions,we conduct min-max normalization on their values as the node features. For categorical design dimensions such as aggregation operator which takes one of (SUM, MAX, MEAN), we encode it as a one-hot feature. • Relation encoder: it captures the similarity relationships between the connecting designs. For each $( d _ { i } , d _ { j } ) \in \mathcal { E }$ , we encode the design dimension where $d _ { i }$ and $d _ { j }$ differ by a one-hot encoding.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Meta-GNN Framework: Task-agnostic module generates the embedding given the design variables and their graphical structures. Task-specific module leverages performance information and conducts label propagation to generate the task-specific embeddings. The two embeddings are concatenated and input into an MLP for predicting the design performance.
|
| 74 |
+
|
| 75 |
+
• Message passing module: a GNN model is used to take the design subgraph and the processed features to perform message passing and output node representations. This information will be combined with the task-specific module to predict the design’s performance.
|
| 76 |
+
|
| 77 |
+
Task-specific module. The task-specific module takes into account the information of design performance on selected training instances and thus is specific for one dataset.
|
| 78 |
+
|
| 79 |
+
The challenge of including such task-specific performance is that it is only available on a very limited set of explored nodes. To overcome the challenge, we use label propagation to propagate the performance information of explored nodes to the unexplored nodes. This is based on our observation that models trained with similar designs typically make similar predictions on instances. We provide an example in Figure 2 to illustrate the task-specific module.
|
| 80 |
+
|
| 81 |
+
• Identifying critical instances: The first step is to identify critical training instances that result in different performances across different designs. Here we use a set of explored designs (anchors) to provide the instance-wise performances. Specifically, the $( i , j )$ element of the top left matrix of Figure 2 represents whether the $i$ -th design can correctly predict the label of $j$ -th instance. Then, we compute the entropy of each training instance’s performance over the anchors. Then we obtain the instance-wise probability via Softmax on the entropy vector, from which we sample instances that result in high variation across designs. The high variation implies that these instances can distinguish good designs from bad ones in the design subgraph, which are informative.
|
| 82 |
+
|
| 83 |
+
• Label propagation and linear projection: Based on the inductive bias of smoothness, we perform label propagation to make the task-specific information available to all candidate designs. Concretely, label propagation can be written as
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathbf { Y } ^ { ( k + 1 ) } = \alpha \cdot D ^ { - 1 / 2 } A D ^ { - 1 / 2 } \mathbf { Y } ^ { ( k ) } + ( 1 - \alpha ) \mathbf { Y } ^ { ( k ) }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where each row of $\mathbf { Y }$ is the performance vector of design $i$ (if explored) or a zero vector (for the unexplored designs). $D \in \bar { \mathbb { R } } ^ { | \mathcal { N } _ { s } | \times | \mathcal { N } _ { s } | }$ is the diagonal matrix of node degree, $A \in \mathbb { R } ^ { | \mathcal { N } _ { s } | \times | \mathcal { N } _ { s } | }$ is the adjacent matrix of the design subgraph, and $\alpha$ is a hyper-parameter. After label propagation, we use a linear layer to project the performance information to another high-dimensional space.
|
| 90 |
+
|
| 91 |
+
Finally, as shown in Figure 2, we concatenate the output embeddings of the task-specific and taskagnostic modules and use an MLP to produce the performance predictions.
|
| 92 |
+
|
| 93 |
+
Objective for Meta-GNN. The training of neural performance predictor is commonly formulated as a regression using mean square error (MSE), in order to predict how good the candidate designs are for the current task. However, the number of explored designs is usually small for sample-efficient AutoML, especially during the early stage of the search process. Thus, the deep predictor tends to overfit, degrading the reliability of performance prediction. To solve this problem, we incorporate a pair-wise rank loss (Burges et al., 2005; Hu et al., 2021) with the MSE objective, resulting in
|
| 94 |
+
|
| 95 |
+
Require: $S$ : Design space. $K$ : Exploration size. $h _ { \theta }$ : Meta-GNN. $V / V ^ { \prime }$ : Warm-up / Full epoch. η:
|
| 96 |
+
Learning rate. $C$ : Number of start nodes.
|
| 97 |
+
1: $\Omega \boldsymbol { \mathrm { S } }$ AMPLE-NODES $( S , C )$ // Initialize the exploration set
|
| 98 |
+
2: $\Gamma $ MULTI-HOP-NEIGHBORS $( \Omega )$ // Construct candidate set from multi-hop neighbors
|
| 99 |
+
3: $Y _ { \Omega } = \mathbf { G } \mathbf { E } \mathbf { T } \mathbf { \cdot }$ -VALIDATION-PERFORMANCE $( \Omega , V )$ // Explore the initial nodes (for $V$ epochs)
|
| 100 |
+
4: while $t = | \Omega | < K$ do
|
| 101 |
+
5: $\mathcal { G } _ { s } ^ { ( t ) } \gets ( \mathcal { N } _ { v } = \Omega \cup \Gamma , \mathcal { E } = \mathrm { S I M I L A R I T Y } ( \mathcal { N } _ { v } )$ // (1) Update the design subgraph
|
| 102 |
+
6: while not converge do
|
| 103 |
+
7: $\theta \gets \theta - \eta \cdot \partial \bar { \mathcal { L } } ( \hat { Y } _ { \Omega } , h _ { \theta } ( \mathcal { G } _ { s } ^ { ( t ) } ) _ { \Omega } ) / \partial \theta$ // (2) Compute Eq. 2 and conduct optimization
|
| 104 |
+
8: end while
|
| 105 |
+
9: // (3) Sample a candidate node with probability proportional to the meta-GNN’s prediction
|
| 106 |
+
10: $d ^ { ( t ) } = s$ AMPLE-WITH-PROBABILITY $( \Gamma , \mathrm { S o f t m a x } ( h _ { \theta } ( \mathcal { G } _ { s } ^ { ( t ) } ) _ { \Gamma } ) )$
|
| 107 |
+
11: $Y _ { t } = \mathbf { G } \mathbf { E } \mathbf { T } \mathbf { - }$ VALIDATION-PERFORMANCE $( d ^ { ( t ) } , V )$ // (2) Explore the current selected node
|
| 108 |
+
12: $\Omega \Omega \cup \{ d ^ { ( t ) } \}$ , $\Gamma \Gamma \cup$ MULTI-HOP-NEIGHBORS $( \{ d ^ { ( t ) } \} )$ )
|
| 109 |
+
13: end while
|
| 110 |
+
14: $D = \mathbf { S }$ ELECT-TOPK $\{ \Omega _ { i } : Y _ { i } \} _ { i = 1 } ^ { K }$ , $\mathrm { s i z e } = \mathbf { M I N } \big ( \big \lceil 1 0 \% \cdot K \big \rceil , 5 \big ) ,$ ) // Models to be fully trained
|
| 111 |
+
15: $Y ^ { \prime } = \mathbf { G } \mathbf { E } \mathbf { T } \mathbf { - }$ VALIDATION-PERFORMANCE $( D , V ^ { \prime } )$ // Obtain the final performance
|
| 112 |
+
16: $I = \mathrm { A R G M A X } ( Y ^ { \prime } )$ // Obtain best model
|
| 113 |
+
17: return $D _ { I } , Y _ { I } ^ { \prime }$
|
| 114 |
+
|
| 115 |
+
a quadratic number of training pairs, thus reducing overfitting. Furthermore, predicting relative performance is more robust across datasets than predicting absolute performance. Overall, the objective is formulated as follows:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\begin{array} { l } { { \displaystyle { \mathcal { L } } ( \hat { Y } , Y ) = \sum _ { i = 1 } ^ { N } ( \hat { Y } _ { i } - Y _ { i } ) ^ { 2 } + \lambda { \mathcal { L } } _ { r a n k } ( \hat { Y } , Y ) , \mathrm { ~ w h e r e ~ } } } \\ { ~ } \\ { { \displaystyle { \mathcal { L } } _ { r a n k } ( \hat { Y } , Y ) = \sum _ { i = 1 } ^ { N } \sum _ { j = i } ^ { N } ( - 1 ) ^ { \mathbb { I } ( Y _ { i } > Y _ { j } ) } \cdot \sigma \left( \frac { \hat { Y } _ { i } - \hat { Y } _ { j } } { \tau } \right) } } \end{array}
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\lambda$ is the trade-off hyper-parameter, $\tau$ is the temperature controlling the minimal performance gap that will be highly penalized, and $\sigma$ is the Sigmoid function. Thus, the meta-GNN is trained to predict the node performance on the design subgraph supervised by the explored node performance.
|
| 122 |
+
|
| 123 |
+
# 3.3 SEARCH STRATEGY
|
| 124 |
+
|
| 125 |
+
Equipped with the meta-GNN, we propose a sequential search strategy to search for the best design in the design graph. The core idea is to leverage meta-GNN to perform fast inference on the dynamic design subgraph, and decide what would be the next node to explore, thus navigating the search. We summarize our search strategy in Algorithm 1. Concretely, our search strategy consists of the following three steps:
|
| 126 |
+
|
| 127 |
+
• Initialization: As shown in Figure 1 (b), FALCON randomly samples multiple nodes on the design graph. The motivation of sampling multiple nodes in the initial step is to enlarge the receptive field on the design graph to avoid the local optima and bad performance, which is empirically verified in Appendix D. Then, FALCON explore the initialized nodes by training designs on the tasks and construct the instance mask for the task-specific module. • Meta-GNN training: Following Figure 2, meta-GNN predicts the performance of the explored nodes. The loss is computed via Equation 2 and back-propagated to optimize the meta-GNN. • Exploration via inference: Meta-GNN is then used to make predictions for the performances of all candidate nodes. Then we apply Softmax on the predictions as the probability distribution of candidate designs, from which FALCON samples a new node and updates the design subgraph.
|
| 128 |
+
|
| 129 |
+
At every iteration, FALCON extends the design subgraph through the last two steps. After several iterations, it selects and retrains a few designs in the search trajectory with top performances. Overall,
|
| 130 |
+
|
| 131 |
+
FALCON approaches the optimal design navigated by the relational inductive bias learned by metaGNN, as shown in Figure 1 (b).
|
| 132 |
+
|
| 133 |
+
# 4 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
We conduct extensive experiments on 27 graph datasets and an image dataset. The goal is twofold: (1) to show FALCON’s sample efficiency over the existing AutoML methods (cf. Section 4.2) and (2) to provide insights into how the inductive bias of design relartions navigate the search on design graph (cf. Section 4.3).
|
| 136 |
+
|
| 137 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 138 |
+
|
| 139 |
+
We consider the following tasks in our evaluation and we leave the details including dataset split, evaluation metrics, and hyper-parameters in Appendix A.
|
| 140 |
+
|
| 141 |
+
Node classification. We use 6 benchmarks ranging from citation networks to product or social networks: Cora, CiteSeer, PubMed (Sen et al., 2008), ogbn-arxiv (Hu et al., 2020), AmazonComputers (Shchur et al., 2018), and Reddit (Zeng et al., 2020).
|
| 142 |
+
|
| 143 |
+
Graph classification. We use 21 benchmark binary classification tasks in TUDataset (Morris et al., 2020), which are to predict certain properties for molecule datasets with various distribution.
|
| 144 |
+
|
| 145 |
+
Image classification. We use CIFAR-10 (Krizhevsky, 2009). See details in Appendix C.
|
| 146 |
+
|
| 147 |
+
Baselines. We compare FALCON with three types of baselines:
|
| 148 |
+
|
| 149 |
+
• Simple search strategies: Random, Simulated Annealing (SA), Bayesian Optimization (BO) (Bergstra et al., 2011).
|
| 150 |
+
• AutoML approaches: DARTS (Liu et al., 2019), ENAS (Pham et al., 2018), GraphNAS (Gao et al., 2019), AutoAttend (Guan et al., 2021), GASSO (Qin et al., 2021), where the last three methods are specifically designed for graph tasks.
|
| 151 |
+
• Ablation models: FALCON-G and FALCON-LP, where FALCON-G discards the design graph and predicts the design performance using an MLP, and FALCON-LP removes the task-specific module and predicts design performance using only the task-agnostic module.
|
| 152 |
+
|
| 153 |
+
We also include a naive method, BRUTEFORCE, which trains $5 \%$ designs from scratch and returns the best design among them. The result of BRUTEFORCE is regarded as the approximated ground truth performance. We compare FALCON and the simple search baselines under sample size controlled search, where we limit the number of explored designs. We set the exploration size as 30 by default.
|
| 154 |
+
|
| 155 |
+
Design Space. We use different design spaces on node- and graph-level tasks. Specifically, The design variables include common hyper-parameters, e.g., dropout ratio, and architecture choices, e.g., layer connectivity and batch normalization. Moreover, we consider node pooling choices for the graph classification datasets, which is less studied in the previous works (Cai et al., 2021; Gao et al., 2019; Zhou et al., 2019). Besides, we follow You et al. (2020b) and control the number of parameters for all the candidate designs to ensure a fair comparison. See Appendix A.2 for the details.
|
| 156 |
+
|
| 157 |
+
# 4.2 MAIN RESULTS
|
| 158 |
+
|
| 159 |
+
Node classification tasks. Table 1 summarizes the performance of FALCON and the baselines.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 3: Accuracy v.s. the number of explored nodes on ogbn-arxiv.
|
| 163 |
+
|
| 164 |
+
Notably, FALCON takes comparable search cost as the oneshot methods and is $1 5 \mathrm { x }$ less expensive than GraphNAS. Moreover, FALCON achieves the best performances over the baselines with sufficient margins in the most datasets, using only 30 explored designs. For example, FALCON outperforms ENAS by $1 . 8 \%$ in CiteSeer and GASSO by $1 . 6 \%$ in AmazonComputers. Also, the removal of the design graph and task-specific module decreases the performance constantly, which validates their effectiveness. It is worth mentioning that FALCON is competitive with BRUTEFORCE, demonstrating the excellence of FALCON in searching for globally bestperforming designs.
|
| 165 |
+
|
| 166 |
+
Table 1: Search results on five node classification tasks, where Time stands for the search cost (GPU·hours). We conduct t-test to compute p-value on our method with the best AutoML baselines.
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Cora</td><td colspan="2">CiteSeer</td><td colspan="2">Pubmed</td><td colspan="2">AmazonComputers</td><td colspan="2">Reddit</td></tr><tr><td>ACC</td><td>Time</td><td>ACC</td><td>Time</td><td>ACC</td><td>Time</td><td>ACC</td><td>Time</td><td>F1</td><td>Time</td></tr><tr><td>Random</td><td>80.8±1.7</td><td>0.20</td><td>71.2±0.8</td><td>0.22</td><td>86.0±3.5</td><td>0.24</td><td>81.6±3.0</td><td>0.16</td><td>94.3±0.1</td><td>0.97</td></tr><tr><td>BO</td><td>85.1±0.3</td><td>0.28</td><td>72.6±0.9</td><td>0.30</td><td>88.5±0.3</td><td>0.31</td><td>82.3±6.3</td><td>0.16</td><td>94.2±0.2</td><td>0.94</td></tr><tr><td>SA</td><td>81.1±0.8</td><td>0.24</td><td>74.7±0.2</td><td>0.25</td><td>88.9±0.1</td><td>0.29</td><td>81.2±6.9</td><td>0.23</td><td>94.3±0.5</td><td>0.97</td></tr><tr><td>ENAS</td><td>85.8±0.4</td><td>0.27</td><td>74.9±0.2</td><td>0.39</td><td>88.6±0.8</td><td>2.06</td><td>74.5±1.2</td><td>0.83</td><td>92.3±1.0</td><td>1.98</td></tr><tr><td>DARTS</td><td>85.8±0.2</td><td>0.25</td><td>75.2±0.3</td><td>0.25</td><td>89.1±0.1</td><td>0.35</td><td>84.1±1.9</td><td>0.35</td><td>[OoM]</td><td>-</td></tr><tr><td>GraphNAS</td><td>82.2±3.6</td><td>3.12</td><td>74.9±0.6</td><td>3.99</td><td>89.2±0.3</td><td>5.37</td><td>88.5±2.4</td><td>2.53</td><td>89.1±2.9</td><td>3.03</td></tr><tr><td>AutoAttend</td><td>84.6±0.2</td><td>1.23</td><td>73.9±0.2</td><td>1.25</td><td>84.4±0.7</td><td>1.55</td><td>87.3±1.1</td><td>2.62</td><td>[OoM]</td><td>-</td></tr><tr><td>GASSO</td><td>86.8±1.1</td><td>0.38</td><td>75.3±0.7</td><td>0.33</td><td>86.3±0.4</td><td>0.41</td><td>89.8±0.1</td><td>0.73</td><td>[OoM]</td><td>-</td></tr><tr><td>FALCON-G</td><td>84.5±0.8</td><td>0.23</td><td>74.3±1.7</td><td>0.24</td><td>89.2±0.1</td><td>0.26</td><td>87.6±0.9</td><td>0.27</td><td>93.7±0.4</td><td>1.11</td></tr><tr><td>FALCON-LP</td><td>85.5±1.0</td><td>0.26</td><td>74.6±0.1</td><td>0.26</td><td>89.0±0.2</td><td>0.29</td><td>90.7±0.6</td><td>0.30</td><td>94.9±0.2</td><td>1.00</td></tr><tr><td>FALCON</td><td>86.4±0.5</td><td>0.26</td><td>76.2±0.4</td><td>0.28</td><td>89.3±0.5</td><td>0.32</td><td>91.2±0.5</td><td>0.30</td><td>95.2±0.2</td><td>1.15</td></tr><tr><td>BRUTEFORCE</td><td>87.0</td><td>52.5</td><td>76.0</td><td>59.7</td><td>90.0</td><td>63.0</td><td>91.4</td><td>81.5</td><td>95.5</td><td>>200</td></tr><tr><td>p-value</td><td></td><td>-</td><td>0.051</td><td>-</td><td>0.145</td><td>-</td><td>0.017</td><td>-</td><td>0002</td><td>-</td></tr></table>
|
| 169 |
+
|
| 170 |
+
We further investigate the speed-performance trade-off of FALCON and other sample-based approaches in ogbn-arxiv. We run several search trials under different sample sizes. As shown in Figure 3, FALCON reaches the approximated ground truth result with very few explored nodes. In contrast, SA and Random require more samples to converge, while BO performs bad even with a large number of explored nodes, potentially due to its inability in dealing with high-dimensional design features.
|
| 171 |
+
|
| 172 |
+
Graph classification tasks. The graph classification datasets cover a wide range of graph distributions. In Table 2, we report the selected performance results for graph classification tasks and leave other results including the search costs in Appendix B. We highlight three observations:
|
| 173 |
+
|
| 174 |
+
• On average, the state-of-the-art AutoML baselines algorithms perform close to the simple search methods, indicating the potentially unreliable search, as similarly concluded by Yu et al. (2020). • FALCON surpasses the best AutoML baselines with an average improvement of $3 . 3 \%$ . The sufficient and consistent improvement greatly validates our sample efficiency under a controlled sample size. where FALCON can explore the designs that are more likely to perform well through the relational inference based on the relations of previously explored designs and their performances. • In the second block, we attribute the high sample efficiency of FALCON to the exhibition of design relations and the performance information from the training instances. Specifically, FALCON outperforms FALCON-LP by $4 . 8 7 \%$ on average, indicating that the task-specific module provides more task information that aids the representation learning of model designs, enabling a fast adaption on a certain task. Moreover, FALCON gains an average improvement of $6 . 4 3 \%$ compared to FALCON-G, which justifies our motivation that the design relations promote the learning of relational inductive bias and guide the search on the design graph.
|
| 175 |
+
|
| 176 |
+
We also conduct experiments similar to Figure 3 to investigate how FALCON converges with the increasing sample size ( $\mathrm { { } } ^ { c f . }$ Appendix B.1) and report the best designs found by FALCON for each dataset (cf. Appendix B.2). Besides, we provide sensitivity analysis on FALCON’s hyper-parameters, e.g., number of random start nodes $C$ (cf. Appendix D).
|
| 177 |
+
|
| 178 |
+
Image classification task. We demonstrate the potential of FALCON in image domain. Due to space limitation, we leave the results of CIFAR-10 to Appendix C. We found FALCON can search for designs that are best-performing, compared with the baselines. Specifically, it gains average improvements of $1 . 4 \%$ over the simple search baselines and $0 . 3 \%$ over the one-shot baselines on the architecture design space, with search cost comparable to the one-shot based baselines.
|
| 179 |
+
|
| 180 |
+
# 4.3 CASE STUDIES OF FALCON
|
| 181 |
+
|
| 182 |
+
We study FALCON in two dimensions: (1) Search process: we probe FALCON’s inference process through the explanations of meta-GNN on a design graph, and (2) Design representations: we visualize the node representations output by the meta-GNN to examine the effect of design choices.
|
| 183 |
+
|
| 184 |
+
Search process. We use GNNExplainer (Ying et al., 2019) to explain the node prediction of metaGNN and shed light on the working mechanism of FALCON. Here we consider the importance of each design dimension for each node’s prediction. We demonstrate on a real case when searching on CIFAR-10 (cf. Table 12 for the design space). For conciseness, we focus on two design dimensions: (Weight Decay, Batch Size). Then, given a node of interest $n ^ { \prime } = ( 0 . 9 , 1 2 8 )$ , we observe the change in its predictions and dimension importance during the search process.
|
| 185 |
+
|
| 186 |
+
Table 2: Selected results for the graph classification tasks. The average task performance (ROC-AUC) of the architectures searched by FALCON is $3 . 3 \%$ over the best AutoML baselines.
|
| 187 |
+
|
| 188 |
+
<table><tr><td></td><td>ER-MD</td><td>AIDS</td><td>OVCAR-8</td><td>MCF-7</td><td>SN12C</td><td>NCI109</td><td>Tox21-AhR</td><td>Avg.</td></tr><tr><td>Random</td><td>77.5±1.6</td><td>97.0±1.4</td><td>56.2±0.0</td><td>58.2±0.3</td><td>57.4±1.0</td><td>73.4±0.9</td><td>75.7±2.0</td><td>70.8</td></tr><tr><td>BO</td><td>77.6±3.5</td><td>96.1±1.0</td><td>63.6±0.7</td><td>60.7±0.0</td><td>54.8±1.1</td><td>73.6±1.2</td><td>75.5±1.1</td><td>71.7</td></tr><tr><td>SA</td><td>75.9±4.2</td><td>95.4±0.9</td><td>59.5±3.2</td><td>56.7±0.8</td><td>60.4±1.7</td><td>76.6±5.6</td><td>76.5±3.0</td><td>71.6</td></tr><tr><td>ENAS</td><td>76.0±2.2</td><td>97.1±0.4</td><td>56.0±1.3</td><td>59.7±0.8</td><td>66.4±0.6</td><td>71.2±1.0</td><td>73.6±0.9</td><td>71.4</td></tr><tr><td>DARTS</td><td>75.0±0.7</td><td>98.0±0.0</td><td>56.8±0.3</td><td>60.2±0.7</td><td>66.0±0.4</td><td>73.5±0.2</td><td>76.0±1.1</td><td>72.2</td></tr><tr><td>GraphNAS</td><td>76.9±3.6</td><td>95.9±0.8</td><td>58.7±0.8</td><td>61.3±5.2</td><td>60.7±1.5</td><td>73.6±2.9</td><td>70.6±4.3</td><td>71.1</td></tr><tr><td>AutoAttend</td><td>73.1±0.8</td><td>97.4±0.3</td><td>59.8±0.8</td><td>64.4±0.2</td><td>71.8±0.3</td><td>75.9±1.8</td><td>74.1±0.9</td><td>73.8</td></tr><tr><td>GASSO</td><td>73.2±0.4</td><td>95.2±0.7</td><td>62.3±0.3</td><td>62.5±0.4</td><td>70.9±2.3</td><td>73.9±0.4</td><td>70.2±3.5</td><td>72.6</td></tr><tr><td>FALCON-G</td><td>78.3±3.0</td><td>96.3±1.4</td><td>56.4±1.1</td><td>62.3±4.5</td><td>69.8±2.2</td><td>70.3±6.4</td><td>72.5±2.8</td><td>72.3</td></tr><tr><td>FALCON-LP</td><td>76.7±2.4</td><td>96.0±0.2</td><td>61.5±4.9</td><td>59.5±5.7</td><td>70.3±3.8</td><td>73.1±0.3</td><td>76.5±2.5</td><td>73.3</td></tr><tr><td>FALCON</td><td>78.4±0.2</td><td>97.5±1.1</td><td>66.7±3.4</td><td>65.5±2.5</td><td>73.3±0.0</td><td>78.4±2.3</td><td>78.5±1.1</td><td>76.9</td></tr><tr><td>BRUTEFORCE</td><td>83.3</td><td>96.0</td><td>67.4</td><td>70.6</td><td>73.7</td><td>81.8</td><td>82.0</td><td>79.3</td></tr><tr><td>p-value</td><td>0.155</td><td>1</td><td>0.008</td><td>0.035</td><td><0.001</td><td>0.096</td><td>0.018</td><td>-</td></tr></table>
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Explored node nt:</td><td>·</td><td>(0.99, 64)</td><td>(0.9, 64)</td><td>(0.99, 128)</td><td></td></tr><tr><td>Performance of nt:</td><td>…</td><td>++</td><td>:</td><td>+</td><td>:</td></tr><tr><td>Prediction on n':</td><td>:</td><td>0.90</td><td>0.77 …</td><td>0.89</td><td>:</td></tr><tr><td>Dimension importance:</td><td>:</td><td>[0.5, 0.5]</td><td>[0.8, 0.2] …</td><td>[0.6, 0.4]</td><td>…</td></tr></table>
|
| 191 |
+
|
| 192 |
+
Where $^ +$ and − indicate the relative performance of the explored nodes, $t$ is the current search step. Interestingly, we see that the prediction on $n ^ { \prime }$ and the dimension importance evolve with the explored designs and their relations. For example, when weight decay changes from 0.99 to 0.9, there is a huge drop in the node performance, which affects the prediction of $n ^ { \prime }$ and increases the importance of Weight Decay as design performance seems to be sensitive to this dimension.
|
| 193 |
+
|
| 194 |
+
Design representations. In Figure 4, we visualize the high-dimensional design representations via T-SNE (van der Maaten & Hinton, 2008) after training the meta-GNN on the Cora dataset.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 4: T-SNE visualization for the design representations on Cora dataset.
|
| 198 |
+
|
| 199 |
+
In the left figure, the better the design performance, the darker the color. Generally, the points with small distance have similar colors or performances, indicating that meta-GNN can distinguish “good” nodes from “bad” nodes. For the right figure, different colors represent different dropout ratios. The high discrimination indicates that the dropout ratio is an influential variable for learning the design representation, which further affects design performance. This evidence validates the meta-GNN’s expressiveness and capacity to learn the relational inductive bias between the design choices.
|
| 200 |
+
|
| 201 |
+
# 5 CONCLUSION, LIMITATION, AND FUTURE WORK
|
| 202 |
+
|
| 203 |
+
This work introduces FALCON, an efficient sample-based AutoML framework. We propose the concept of design graph that explicitly models and encodes relational information among model designs. On top of the design graph, we develop a sample-efficient strategy to navigate the search on the design graph with a novel meta-model. One future direction is to better tackle the high average node degree on the design graphwhich could cause over-smoothing, especially when the design variables include many categorical variables. And a simple solution is to use edge dropout to randomly remove a portion of edges at each training epoch. Another future direction is to better adapt FALCON on continuous design variables via developing a dynamic design graph that enable a more fine-grained search between the discretized values.
|
| 204 |
+
|
| 205 |
+
# REPRODUCIBILITY STATEMENT
|
| 206 |
+
|
| 207 |
+
All of the datasets used in this work are public. For experimental setup, we state the detailed settings in Appendix A and Appendix C, including the graph pre-processing, dataset splits, hyper-parameters. Moreover, we include our code in an anonymous link for public access. For the results, we report the best models found by our algorithm as well as their corresponding performances. Overall, we believe we have made great efforts to ensure reproducibility in this paper.
|
| 208 |
+
|
| 209 |
+
# ETHICS STATEMENT
|
| 210 |
+
|
| 211 |
+
In this work, we propose a novel algorithm to search for the best model designs where no human subject is related. This work could promote the discovery of more powerful and expressive models and provide insights into design relations. However, while best-performing models may be “experts” in fulfilling given tasks, they are not necessarily fair towards different user or entity groups. We believe this is a general issue in the AutoML area and should be well addressed to ensure the ethics of models in real-world applications.
|
| 212 |
+
|
| 213 |
+
# REFERENCES
|
| 214 |
+
|
| 215 |
+
Bowen Baker, Otkrist Gupta, Nikhil Naik, and Ramesh Raskar. Designing neural network architectures using reinforcement learning. In ICLR, 2017.
|
| 216 |
+
|
| 217 |
+
Bowen Baker, Otkrist Gupta, Ramesh Raskar, and Nikhil Naik. Accelerating neural architecture search using performance prediction. In ICLR, 2018.
|
| 218 |
+
|
| 219 |
+
Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc V. Le. Understand ing and simplifying one-shot architecture search. In ICML, 2018.
|
| 220 |
+
|
| 221 |
+
James Bergstra, Remi Bardenet, Yoshua Bengio, and Bal ´ azs K ´ egl. Algorithms for hyper-parameter ´ optimization. In NeurIPS, 2011.
|
| 222 |
+
|
| 223 |
+
Filippo Maria Bianchi, Daniele Grattarola, Lorenzo Livi, and Cesare Alippi. Graph neural networks with convolutional ARMA filters. arXiv, 2019.
|
| 224 |
+
|
| 225 |
+
Christopher J. C. Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Gregory N. Hullender. Learning to rank using gradient descent. In ICML, 2005.
|
| 226 |
+
|
| 227 |
+
Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. In ICLR, 2019.
|
| 228 |
+
|
| 229 |
+
Shaofei Cai, Liang Li, Jincan Deng, Beichen Zhang, Zheng-Jun Zha, Li Su, and Qingming Huang. Rethinking graph neural architecture search from message-passing. In CVPR, 2021.
|
| 230 |
+
|
| 231 |
+
Bo Chen, Xiangyu Zhao, Yejing Wang, Wenqi Fan, Huifeng Guo, and Ruiming Tang. Automated machine learning for deep recommender systems: A survey. 2022.
|
| 232 |
+
|
| 233 |
+
Xiangning Chen, Ruochen Wang, Minhao Cheng, Xiaocheng Tang, and Cho-Jui Hsieh. Drnas: Dirichlet neural architecture search. In ICLR, 2021.
|
| 234 |
+
|
| 235 |
+
Yukang Chen, Tong Yang, Xiangyu Zhang, Gaofeng Meng, Chunhong Pan, and Jian Sun. Detnas: Neural architecture search on object detection. 2019.
|
| 236 |
+
|
| 237 |
+
Xiangxiang Chu, Bo Zhang, Hailong Ma, Ruijun Xu, and Qingyuan Li. Fast, accurate and lightweight super-resolution with neural architecture search. In ICPR. IEEE, 2020.
|
| 238 |
+
|
| 239 |
+
Boyang Deng, Junjie Yan, and Dahua Lin. Peephole: Predicting network performance before training. Arxiv, 2017.
|
| 240 |
+
|
| 241 |
+
Frederik Diehl. Edge contraction pooling for graph neural networks. CoRR, abs/1905.10990, 2019.
|
| 242 |
+
|
| 243 |
+
Jian Du, Shanghang Zhang, Guanhang Wu, Jose M. F. Moura, and Soummya Kar. Topology adaptive ´ graph convolutional networks.
|
| 244 |
+
|
| 245 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. J. Mach. Learn. Res.
|
| 246 |
+
|
| 247 |
+
Hongyang Gao and Shuiwang Ji. Graph u-nets. In ICML, volume 97, pp. 2083–2092, 2019.
|
| 248 |
+
|
| 249 |
+
Yang Gao, Hong Yang, Peng Zhang, Chuan Zhou, and Yue Hu. Graphnas: Graph neural architecture search with reinforcement learning. arXiv, 1904.09981, 2019.
|
| 250 |
+
|
| 251 |
+
Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V. Le. NAS-FPN: learning scalable feature pyramid architecture for object detection. In CVPR, 2019.
|
| 252 |
+
|
| 253 |
+
Chaoyu Guan, Xin Wang, and Wenwu Zhu. Autoattend: Automated attention representation search. In ICML, 2021.
|
| 254 |
+
|
| 255 |
+
William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pp. 1024–1034, 2017.
|
| 256 |
+
|
| 257 |
+
Chi Hu, Chenglong Wang, Xiangnan Ma, Xia Meng, Yinqiao Li, Tong Xiao, Jingbo Zhu, and Changliang Li. Ranknas: Efficient neural architecture search by pairwise ranking. In EMNLP, 2021.
|
| 258 |
+
|
| 259 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 260 |
+
|
| 261 |
+
Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M. Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, Chrisantha Fernando, and Koray Kavukcuoglu. Population based training of neural networks. CoRR, 2017.
|
| 262 |
+
|
| 263 |
+
Zohar Shay Karnin, Tomer Koren, and Oren Somekh. Almost optimal exploration in multi-armed bandits. In ICML, 2013.
|
| 264 |
+
|
| 265 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 266 |
+
|
| 267 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. In Technical report, 2009.
|
| 268 |
+
|
| 269 |
+
Hayeon Lee, Eunyoung Hyung, and Sung Ju Hwang. Rapid neural architecture search by learning to generate graphs from datasets. In ICLR, 2021a.
|
| 270 |
+
|
| 271 |
+
Hayeon Lee, Sewoong Lee, Song Chong, and Sung Ju Hwang. Hardware-adaptive efficient latency prediction for NAS via meta-learning. In NeurIPS, 2021b.
|
| 272 |
+
|
| 273 |
+
Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In ICML, 2019.
|
| 274 |
+
|
| 275 |
+
Lisha Li, Kevin G. Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. J. Mach. Learn. Res., 2017.
|
| 276 |
+
|
| 277 |
+
Chenxi Liu, Barret Zoph, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan L. Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. 1712.00559, 2017.
|
| 278 |
+
|
| 279 |
+
Hanxiao Liu, Karen Simonyan, Oriol Vinyals, Chrisantha Fernando, and Koray Kavukcuoglu. Hierarchical representations for efficient architecture search. In ICLR, 2018.
|
| 280 |
+
|
| 281 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: differentiable architecture search. In ICLR, 2019.
|
| 282 |
+
|
| 283 |
+
Renqian Luo, Fei Tian, Tao Qin, Enhong Chen, and Tie-Yan Liu. Neural architecture optimization. In NeurIPS, 2018.
|
| 284 |
+
|
| 285 |
+
Lizheng Ma, Jiaxu Cui, and Bo Yang. Deep neural architecture search with deep graph bayesian optimization. In WI. ACM, 2019.
|
| 286 |
+
|
| 287 |
+
Zheng Ma, Junyu Xuan, Yu Guang Wang, Ming Li, and Pietro Lio. Path integral based convolution \` and pooling for graph neural networks. 2020.
|
| 288 |
+
|
| 289 |
+
Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In AAAI, pp. 4602–4609, 2019.
|
| 290 |
+
|
| 291 |
+
Christopher Morris, Nils M. Kriege, Franka Bause, Kristian Kersting, Petra Mutzel, and Marion Neumann. Tudataset: A collection of benchmark datasets for learning with graphs. 2020.
|
| 292 |
+
|
| 293 |
+
Namyong Park, Ryan A. Rossi, Nesreen K. Ahmed, and Christos Faloutsos. Autogml: Fast automatic model selection for graph machine learning. CoRR, 2022.
|
| 294 |
+
|
| 295 |
+
Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In ICML, 2018.
|
| 296 |
+
|
| 297 |
+
Yijian Qin, Xin Wang, Zeyang Zhang, and Wenwu Zhu. Graph differentiable architecture search with structure learning. In NeurIPS, 2021.
|
| 298 |
+
|
| 299 |
+
Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc V. Le, and Alexey Kurakin. Large-scale evolution of image classifiers. In ICML, 2017.
|
| 300 |
+
|
| 301 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Regularized evolution for image classifier architecture search. AAAI Press, 2019.
|
| 302 |
+
|
| 303 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Gallagher, and Tina Eliassi-Rad. Collective classification in network data. AI Mag., 2008.
|
| 304 |
+
|
| 305 |
+
Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. 2018.
|
| 306 |
+
|
| 307 |
+
Han Shi, Renjie Pi, Hang Xu, Zhenguo Li, James T. Kwok, and Tong Zhang. Multi-objective neural architecture search via predictive network performance optimization. 1911.09336, 2019.
|
| 308 |
+
|
| 309 |
+
Han Shi, Renjie Pi, Hang Xu, Zhenguo Li, James T. Kwok, and Tong Zhang. Bridging the gap between sample-based and one-shot neural architecture search with BONAS. In NeurIPS, 2020.
|
| 310 |
+
|
| 311 |
+
David R. So, Quoc V. Le, and Chen Liang. The evolved transformer. In ICML, 2019.
|
| 312 |
+
|
| 313 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing high-dimensional data using t-sne. Journal of Machine Learning Research, 2008.
|
| 314 |
+
|
| 315 |
+
Colin White, Willie Neiswanger, and Yash Savani. BANANAS: bayesian optimization with neural architectures for neural architecture search. In AAAI, 2021.
|
| 316 |
+
|
| 317 |
+
Lingxi Xie and Alan L. Yuille. Genetic CNN. In IEEE, 2017.
|
| 318 |
+
|
| 319 |
+
Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: stochastic neural architecture search. In ICLR, 2019.
|
| 320 |
+
|
| 321 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 322 |
+
|
| 323 |
+
Yuhui Xu, Lingxi Xie, Xiaopeng Zhang, Xin Chen, Guo-Jun Qi, Qi Tian, and Hongkai Xiong. PC-DARTS: partial channel connections for memory-efficient architecture search. In ICLR, 2020.
|
| 324 |
+
|
| 325 |
+
Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. Gnnexplainer: Generating explanations for graph neural networks. In NeurIPS, pp. 9240–9251, 2019.
|
| 326 |
+
|
| 327 |
+
Jiaxuan You, Jure Leskovec, Kaiming He, and Saining Xie. Graph structure of neural networks. In ICML, 2020a.
|
| 328 |
+
|
| 329 |
+
Jiaxuan You, Zhitao Ying, and Jure Leskovec. Design space for graph neural networks. In NeurIPS, 2020b.
|
| 330 |
+
|
| 331 |
+
Kaicheng Yu, Christian Sciuto, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. In ICLR, 2020.
|
| 332 |
+
|
| 333 |
+
Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor K. Prasanna. Graphsaint: Graph sampling based inductive learning method. In ICLR, 2020.
|
| 334 |
+
|
| 335 |
+
Chris Zhang, Mengye Ren, and Raquel Urtasun. Graph hypernetworks for neural architecture search. In ICLR, 2019a.
|
| 336 |
+
|
| 337 |
+
Muhan Zhang, Shali Jiang, Zhicheng Cui, Roman Garnett, and Yixin Chen. D-VAE: A variational autoencoder for directed acyclic graphs. In NeurIPS, 2019b.
|
| 338 |
+
|
| 339 |
+
Ziwei Zhang, Xin Wang, and Wenwu Zhu. Automated machine learning on graphs: A survey. In IJCAI, 2021.
|
| 340 |
+
|
| 341 |
+
Yiren Zhao, Duo Wang, Xitong Gao, Robert D. Mullins, Pietro Lio, and Mateja Jamnik. Probabilistic \` dual network architecture search on graphs. 2020.
|
| 342 |
+
|
| 343 |
+
Kaixiong Zhou, Qingquan Song, Xiao Huang, and Xia Hu. Auto-gnn: Neural architecture search of graph neural networks. 2019.
|
| 344 |
+
|
| 345 |
+
Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In ICLR, 2017.
|
| 346 |
+
|
| 347 |
+
# A EXPERIMENT DETAILS
|
| 348 |
+
|
| 349 |
+
A.1 SETTINGS
|
| 350 |
+
|
| 351 |
+
Graph classification datasets. The graph classification datasets used in this work are summarized in Table 3. And the detailed dataset statics can be referred from https://chrsmrrs.github. io/datasets/docs/datasets/.
|
| 352 |
+
|
| 353 |
+
Table 3: List of the graph classification datasets used in this work.
|
| 354 |
+
|
| 355 |
+
<table><tr><td>Small Scale</td><td>AIDS,BZR-MD,COX2-MD,DHFR-MD, Mutagenicity, NCI1, NCI109,PTC-MM, PTC-MR</td></tr><tr><td>Medium/Large Scale</td><td>Tox21-AhR,MCF-7, MOLT-4, UACC257, Yeast, NCI-H23, OVCAR-8, P388, PC-3, SF-295, SN12C, SW-620</td></tr></table>
|
| 356 |
+
|
| 357 |
+
Specifically, all datasets are binary classification tasks that predict certain properties for small molecules. For example, the labels in Tox21-AhR represent toxicity/non-toxicity, while the graphs in Mutagenicity are classified into two classes based on their mutagenic effect on a bacterium (Morris et al., 2020). Consequently, we use atom types as the node features and bond types as edge features.
|
| 358 |
+
|
| 359 |
+
Evaluation metrics. For Reddit, we use F1 score (micro) as the evaluation metric following the previous work (Zeng et al., 2020). For other node classification tasks and image dataset, we use classification accuracy as the evaluation metric. For the graph classification tasks, we use ROC-AUC as the evaluation metric.
|
| 360 |
+
|
| 361 |
+
Dataset splits. For ogbn-arxiv and Reddit, we use the standardized dataset split. For other node classification datasets, we split the nodes in each graph into $70 \%$ , $10 \%$ , $20 \%$ in training, validation, and test sets, respectively. For graph classification tasks, we split the graphs into $80 \%$ , $10 \%$ , $10 \%$ for training, validation, and test sets, respectively.
|
| 362 |
+
|
| 363 |
+
Hyper-Parameters. We tuned the hyper-parameters of the baselines based on the default setting in their public codes. For FALCON, we construct the candidate set as the 3-hop neighbors of the explored nodes and set the number of start nodes as $\operatorname* { m i n } ( \lceil 1 0 \% \cdot K \rceil , 1 0 )$ , where $K$ denotes the exploration size. The meta-GNN is constitute of 3 message-passing layers and 3 label propagation layers. All the experiments are repeated at least 3 times.
|
| 364 |
+
|
| 365 |
+
# A.2 DESIGN SPACES
|
| 366 |
+
|
| 367 |
+
# A.2.1 DESIGN SPACES FOR THE SAMPLE-BASED METHODS
|
| 368 |
+
|
| 369 |
+
In this work, we use different design spaces for the datasets depending on the task types, i.e., node or graph level. We summarize the design variables and choices in Table 4 and Table 5. For the design space of Reddit, we replace ”Aggregation” in Table 4 with ”Convolutional layer type”, which takes values from {GCNConv (Kipf & Welling, 2017), SAGEConv (Hamilton et al., 2017), GraphConv (Morris et al., 2019), GINConv (Xu et al., 2019), ARMAConv (Bianchi et al., 2019), TAGConv (Du et al.)}.
|
| 370 |
+
|
| 371 |
+
Table 4: Design Space for the node-level tasks (except for Reddit). 5,832 candidates in total.
|
| 372 |
+
|
| 373 |
+
<table><tr><td>Type</td><td>Variable</td><td>Candidate Values</td></tr><tr><td>Hyper-parameters</td><td>Dropout ratio</td><td>[0.0, 0.3, 0.6]</td></tr><tr><td rowspan="6">Architecture</td><td># Pre-process layers</td><td>[1,2, 3]</td></tr><tr><td># Message passing layers</td><td>[2,4,6, 8]</td></tr><tr><td>#Post-precess layers</td><td>[1,2,3]</td></tr><tr><td>Layer connectivity</td><td>STACK, SUM, CAT</td></tr><tr><td>Activation</td><td>ReLU, Swish,Prelu</td></tr><tr><td>Batch norm Aggregation</td><td>True,False Mean,Max, SUM</td></tr></table>
|
| 374 |
+
|
| 375 |
+
Table 5: Design Space for the graph-level tasks. 58,320 candidates in total.
|
| 376 |
+
|
| 377 |
+
<table><tr><td>Type</td><td>Variable</td><td>Candidate Values</td></tr><tr><td>Hyper-parameters</td><td>Dropout ratio</td><td>[0.0, 0.3, 0.6]</td></tr><tr><td rowspan="10"></td><td># Pre-process layers</td><td>[1,2,3]</td></tr><tr><td># Message passing layers</td><td>[2,4,6,8]</td></tr><tr><td># Post-precess layers</td><td>[1,2,3]</td></tr><tr><td>Layer connectivity</td><td>STACK,SUM,CAT</td></tr><tr><td>Activation</td><td>ReLU, Swish,Prelu</td></tr><tr><td>Batch norm</td><td>True,False</td></tr><tr><td>Aggregation</td><td>Mean,Max,SUM</td></tr><tr><td>Node pooling flag (Use node pooling)</td><td>True,False</td></tr><tr><td>Node pooling type (if applicable)</td><td>TopkPool (Gao & Ji,2019), SAGPool (Lee et al.,2019), PANPool (Ma et al.,202O),EdgePool (Diehl,2019)</td></tr><tr><td>Node pooling loop</td><td>[2,4,6]</td></tr></table>
|
| 378 |
+
|
| 379 |
+
Specifically, The STACK design choice means directly stacking multiple GNN layers, i.e., without skip-connections. We also support node pooling operations for graph classification tasks, where the pooling loop stands for the number of message passing layers between each pooling operation. If the number of message passing layers is $m$ and the node pooling loop is $l$ , there will be a node pooling layer after the ith message passing layer in the design model (hierarchical pooling), where $i \in \{ 1 ^ { \cdot } + \dot { k } \cdot l \ | \ k = 0 , \ldots , \lceil ( m ^ { - } \bar { 1 } ) / l \rceil ^ { \cdot } - 1 \}$ . Moreover, to avoid duplicated and invalid designs, some design variables are required to satisfy specific dependency rules, and we take two examples to elaborate on this point.
|
| 380 |
+
|
| 381 |
+
• If the node pooling flag of a design is False, then the design does not have any value on node pooling type and node pooling loop, and vice versa.
|
| 382 |
+
|
| 383 |
+
For example, we denote node pooling flag as $f$ , node pooling type as $t$ , and $^ *$ as any design choice, then( $f { = } ]$ False, $\scriptstyle t = *$ ) or ( $f { = } ]$ False, $l { = } ^ { * }$ ) will both be invalid.
|
| 384 |
+
|
| 385 |
+
• The node pooling loop should not exceed the number of message passing layers.
|
| 386 |
+
|
| 387 |
+
For example, design $A ( m { = } 4 , l { = } 4 )$ and design $B$ $\because ( m { = } 4 , l { = } 6 )$ that take the same values on other design variables are duplicated.
|
| 388 |
+
|
| 389 |
+
Thus, the design graph constructed under dependency rules is more complex. Without loss of generality, we define that the distance of $f { = } ]$ False) and $f =$ True, $l { = } \mathbf { M I N } ( \{ i \in \mathbb { L } \} ) )$ as 1, where $\mathbb { L }$ represents the design choice of node pooling loop. Thus, the design graph is a connected graph that enables the exploration of any node with random initialization. It is also worth mentioning that the search strategy of FALCON is modularized given the design graph. In contrast, the dependency rules constrain the action space of reinforcement learning methods, e.g., $( f { = } \mathrm { T u r e } \mathrm { F a l s e } )$ is inapplicable, which requires special operation inside the controller.
|
| 390 |
+
|
| 391 |
+
Table 7: Design space for the one-shot baselines on node and graph classification tasks.
|
| 392 |
+
|
| 393 |
+
<table><tr><td>Variable</td><td>Candidate Values</td></tr><tr><td>Dropout ratio</td><td>[0.0, 0.3, 0.6]</td></tr><tr><td>Layer connectivity</td><td>STACK, SUM</td></tr><tr><td># Pre-process layers</td><td>[1, 2, 3]</td></tr><tr><td>#Message passing layers</td><td>[2,4,6, 8]</td></tr><tr><td># Post-precess layers</td><td>[1,2,3]</td></tr><tr><td>Activation</td><td>ReLU,Swish,Prelu</td></tr><tr><td>Batch norm</td><td>True, False</td></tr><tr><td>Aggregation</td><td>Mean, Max, SUM</td></tr></table>
|
| 394 |
+
|
| 395 |
+
Table 6: Statistics and the construction time of the design graphs.
|
| 396 |
+
|
| 397 |
+
<table><tr><td></td><td>#Nodes</td><td>#Edges (Undirected)</td><td> Ave. Degree</td><td>Diameter</td><td>construction time (s)</td></tr><tr><td>DG-1</td><td>5,832</td><td>78.732</td><td>13.5</td><td>13</td><td>13</td></tr><tr><td>DG-2</td><td>58,320</td><td>1,070,172</td><td>18.4</td><td>17</td><td>147</td></tr></table>
|
| 398 |
+
|
| 399 |
+
We further summarize the statistics and construction time of the design graphs in Table 6, where DG-1 and DG-2 denote the design graphs for node-level and graph-level tasks, respectively. We use multi-processing programing on 50 CPUs (Intel Xeon Gold 5118 CPU $ @ ~ 2 . 3 0 \mathrm { G H z } \mathrm { \Omega }$ ) to conduct the graph construction. Note that we don’t have to construct the entire design graph in the pre-processing step, since we only extend the small portion of the design graph, i.e., , the design subgraph, during the search process. Thus, the total time cost of constructing the design subgraph will be $O ( E ^ { \prime } )$ where $E ^ { \prime }$ is the number of edges in the design subgraph, which largely lowers the time costs.
|
| 400 |
+
|
| 401 |
+
# A.2.2 DESIGN SPACES FOR THE ONE-SHOT BASELINES
|
| 402 |
+
|
| 403 |
+
The one-shot models (Liu et al., 2019; Pham et al., 2018) is built upon a super-model that is required to contain all of the architecture choices. We build the macro search space over entire models for both node classification and graph classification datasets with constraints. Firstly, we do not consider CAT (skip-concatenate) a layer connectivity choice, and we also remove design variables for node pooling. The reason is that CAT and node pooling operations change the input shape and make the output embeddings inapplicable for the subsequent weight-sharing modules in our settings. Secondly, the layer connectivity is customized for each layer following the previous works (Liu et al., 2019; Pham et al., 2018), instead of setting as a global value for every layer. Overall, we summarize the design space in Table 7.
|
| 404 |
+
|
| 405 |
+
To enable a fair comparison, we fine-tune the hyper-parameters and report the best results of the architectures found by the one-shot methods according to their performance in the validation sets.
|
| 406 |
+
|
| 407 |
+
# B MORE EXPERIMENTAL RESULTS ON GRAPH TASKS
|
| 408 |
+
|
| 409 |
+
# B.1 GRAPH CLASSIFICATION TASKS
|
| 410 |
+
|
| 411 |
+
Task performance. Here we provide more results of task performance on the graph classification dataset. We repeat each experiment at least 3 times and report the average performances and the standard errors. The results are summarized in Table 8. The results well demonstrate the preeminence of FALCON in searching for good designs under different data distributions.
|
| 412 |
+
|
| 413 |
+
Search cost. As shown in Figure 5, we report the search cost of Random, DARTS, ENAS, GraphNAS, and FALCON on the selected datasets. The time measurements are conducted on a single NVIDIA GeForce 3070 GPU (24G). We see FALCON has a comparable time cost with Random and DARTS, which empirically proves the efficiency of FALCON.
|
| 414 |
+
|
| 415 |
+
However, as FALCON still needs to sample designs and train them from scratch (i.e., the search cost of FALCON is bounded by the search cost of Random), the computational cost is relatively high in large datasets, e.g., OVCAR-8 and MCF-7. We can potentially alleviate this limitation via integrating dataset sampling to reduce time costs.
|
| 416 |
+
|
| 417 |
+
Table 8: Test performance (ROC-AUC) on the graph classification datasets.
|
| 418 |
+
|
| 419 |
+
<table><tr><td></td><td>DHFR-MD</td><td>COX2-MD</td><td>Mutagenicity</td><td>MOLT-4</td><td>NCI-H23</td><td>PTC-MR</td><td>P388</td></tr><tr><td>Random</td><td>59.0±5.2</td><td>63.2±1.9</td><td>77.1±1.9</td><td>58.6±0.7</td><td>58.4±2.1</td><td>59.9±5.7</td><td>63.9±0.7</td></tr><tr><td>BO</td><td>55.1±0.0</td><td>71.6±5.5</td><td>78.3±0.7</td><td>58.1±2.0</td><td>63.6±0.0</td><td>58.8±7.7</td><td>68.9±0.0</td></tr><tr><td>SA</td><td>56.0±7.1</td><td>67.4±3.1</td><td>81.1±0.3</td><td>54.8±1.1</td><td>56.7±3.2</td><td>59.4±6.2</td><td>74.4±1.0</td></tr><tr><td>ENAS</td><td>53.5±3.7</td><td>57.9±1.7</td><td>75.0±1.6</td><td>61.5±0.1</td><td>61.2±1.1</td><td>59.8±1.6</td><td>68.3±1.2</td></tr><tr><td>DARTS</td><td>55.8±6.3</td><td>70.4±3.2</td><td>74.4±0.7</td><td>61.4±0.7</td><td>63.5±1.9</td><td>59.3±0.5</td><td>70.8±0.7</td></tr><tr><td>GraphNAS</td><td>61.6±4.3</td><td>63.9±2.5</td><td>80.2±1.5</td><td>62.1±1.0</td><td>62.4±3.9</td><td>58.6±6.7</td><td>68.2±2.5</td></tr><tr><td>AutoAttend</td><td>63.3±0.9</td><td>68.8±0.7</td><td>79.6±0.1</td><td>59.5±0.2</td><td>61.8±0.2</td><td>57.8±0.6</td><td>74.9±0.5</td></tr><tr><td>GASSO</td><td>60.9±2.3</td><td>68.5±2.0</td><td>75.1±0.5</td><td>57.4±0.9</td><td>64.7±1.5</td><td>51.9±5.2</td><td>71.3±1.4</td></tr><tr><td>FALCON-G</td><td>58.5±8.8</td><td>67.3±3.6</td><td>79.8±1.7</td><td>62.8±3.3</td><td>62.2±1.2</td><td>55.6±6.9</td><td>74.2±3.7</td></tr><tr><td>FALCON-LP</td><td>61.4±1.5</td><td>66.8 ±3.6</td><td>80.2±0.8</td><td>58.5 ±8.8</td><td>63.7±4.1</td><td>55.6±2.0</td><td>75.1±1.1</td></tr><tr><td>FALCON</td><td>63.6±7.9</td><td>67.3±3.2</td><td>81.1±0.5</td><td>64.4±4.0</td><td>66.6±3.3</td><td>60.0±1.4</td><td>77.0±1.4</td></tr><tr><td>(cont.) PTC-MM</td><td>PC-3</td><td>SF-295</td><td>NCI1</td><td>SW-620</td><td>UACC257</td><td>Yeast</td><td>Avg.</td></tr><tr><td>52.5±5.6</td><td>60.4±0.0</td><td>55.3±0.5</td><td>77.5±0.3</td><td>57.5±2.7</td><td>61.1±0.5</td><td>53.3±0.0</td><td>61.3</td></tr><tr><td>60.1±1.5</td><td>59.7±0.1</td><td>60.6±0.3</td><td>77.3±0.0</td><td>63.8±0.9</td><td>60.8±0.0</td><td>55.0±0.0</td><td>63.7</td></tr><tr><td>58.1±4.6</td><td>69.0±2.0</td><td>55.3±0.6</td><td>79.6±5.3</td><td>58.2±2.1</td><td>64.2±0.1</td><td>53.8±1.2</td><td>63.4</td></tr><tr><td>52.4±2.9</td><td>62.2±1.1</td><td>60.9±2.2</td><td>77.2±1.2</td><td>64.8±2.2</td><td>64.7±0.5</td><td>63.0±1.1</td><td>63.0</td></tr><tr><td>52.6±4.1</td><td>61.6±0.5</td><td>62.2±1.1</td><td>66.3±3.0</td><td>66.0±0.3</td><td>65.7±0.2</td><td>61.4±1.4</td><td>63.7</td></tr><tr><td>54.8±3.9</td><td>68.6±2.6</td><td>65.0±3.1</td><td>78.1±3.6</td><td>61.8±4.4</td><td>61.5±5.1</td><td>57.2±1.1</td><td>64.6</td></tr><tr><td>64.7±1.2</td><td>66.2±0.3</td><td>64.2±0.9</td><td>79.3±1.6</td><td>65.5±0.4</td><td>57.1±0.5</td><td>59.6±0.8</td><td>65.9</td></tr><tr><td>63.2±0.7</td><td>66.0±1.8</td><td>65.8±0.4</td><td>76.6±0.6</td><td>64.7±1.1</td><td>62.7±0.2</td><td>60.1±0.4</td><td>64.9</td></tr><tr><td>55.2±2.4</td><td>65.1±2.8</td><td>64.3±2.1</td><td>80.6±0.8</td><td>62.0±3.0</td><td>61.0±3.8</td><td>57.5±1.5</td><td>64.7</td></tr><tr><td>56.8±6.1</td><td>68.1±0.3</td><td>63.5±3.4</td><td>80.4±0.5</td><td>65.2±1.7</td><td>54.5±1.1</td><td>56.6±1.7</td><td>64.7</td></tr><tr><td>57.1±0.1</td><td>71.0±1.7</td><td>64.4±0.4</td><td>80.9±0.8</td><td>66.6±2.1</td><td>66.7±2.1</td><td>58.1±1.7</td><td>67.5*</td></tr></table>
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 5: Search cost on the selected datasets.
|
| 423 |
+
|
| 424 |
+
ROC-AUC v.s. exploration size. Here we report the change in task performance on graph classification datasets with the number of explored nodes. In Figure 6, we visualize the results on two graph classification datasets. We see that FALCON can approach the best-performing designs quickly as the explored size grows.
|
| 425 |
+
|
| 426 |
+
# B.2 BEST DESIGNS
|
| 427 |
+
|
| 428 |
+
In Table 9 and Table 10, we summarize the best designs found by FALCON and BRUTEFORCE in each dataset, where the average number of parameters is $1 3 7 . 5 \mathrm { k }$ for all the graph classification datasets. Note that we select the best designs according to their performance on validation sets; thus, there are cases where FALCON surpasses BRUTEFORCE. We highlight the design variables that are different between FALCON and BRUTEFORCE for comparison.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 6: Accuracy v.s. the number of explored nodes on two graph classification datasets.
|
| 432 |
+
|
| 433 |
+
Table 9: Average parameters & Best designs in the node classification datasets.
|
| 434 |
+
|
| 435 |
+
<table><tr><td>Dataset</td><td>Average Param (k)</td><td>Best design</td><td></td><td>Test perfor- mance (%)</td></tr><tr><td rowspan="2">ogbn-arxiv</td><td rowspan="2">44.5</td><td>FALCON</td><td>(0.0,1,4,2, STACK, Swish, True, Mean)</td><td>70.36</td></tr><tr><td>BRUTEFORCE</td><td>(0.3,1,4,2, SUM, Relu, True,Mean)</td><td>70.51</td></tr><tr><td>Cora</td><td>77.8</td><td>FALCON BRUTEFORCE</td><td>(0.0, 1, 6,1, SUM, Swish,False,Mean) (0.0,1,4,1, STACK, Swish,False,Mean)</td><td>87.18 86.99</td></tr><tr><td>Citeseer</td><td>289.0</td><td>FALCON BRUTEFORCE</td><td>(0.3,1,2,1,SUM, Prelu, True, Mean) (0.3,1,2,2, SUM, Prelu, False, Mean)</td><td>76.19 75.99</td></tr><tr><td>Pubmed</td><td>57.8</td><td>FALCON BRUTEFORCE</td><td>(0.3,1,8,1,SUM, Relu, True,Add) (0.3,1,8,1,SUM, Relu, True,Add)</td><td>90.04 90.04</td></tr><tr><td>AmazonComputers</td><td>46.2</td><td>FALCON BRUTEFORCE</td><td>(0.0,1,4,1,STACK,Swish,True,Mean) (0.0,3,4,2,STACK,Prelu,True,Mean)</td><td>91.64 91.35</td></tr><tr><td>Reddit</td><td>47.2</td><td>FALCON BRUTEFORCE</td><td>(0.0,3,4,2, STACK,Prelu, True,ARMAConv) (0.0,3,4,2, STACK,Prelu,True,ARMAConv)</td><td>95.46 95.46</td></tr></table>
|
| 436 |
+
|
| 437 |
+
# B.3 BRUTEFORCE’S CONFIDENCE INTERVAL AND VARIANT
|
| 438 |
+
|
| 439 |
+
To estimate the uncertainty of Bruteforce, we compute the $9 5 \%$ confidence interval of Bruteforce using bootstrapping. Moreover, we consider a variant of Bruteforce baseline to compare with Bruteforce. Specifically, we train all the designs in the design space for 30 epochs, select the top $10 \%$ design, and resume the training until 50 epochs. After that, we choose the top $50 \%$ designs to be fully trained and return the best fully trained design based on the validation performance. We run Bruteforce-bootstrap on four datasets as demonstrations. We summarize the results in Table 11.
|
| 440 |
+
|
| 441 |
+
Table 11: Test performances of Bruteforce and its variant.
|
| 442 |
+
|
| 443 |
+
<table><tr><td></td><td>Cora</td><td>CiteSeer</td><td>ER-MD</td><td>AIDS</td></tr><tr><td>Bruteforce (max)</td><td>87.0</td><td>76.0</td><td>83.3</td><td>96.0</td></tr><tr><td>Confidence interval length</td><td>0.2</td><td>0.1</td><td>0.6</td><td>0.0</td></tr><tr><td>Bruteforce-bootstrap</td><td>87.0</td><td>76.4</td><td>83.8</td><td>95.7</td></tr></table>
|
| 444 |
+
|
| 445 |
+
Surprisingly, we found that the performance of Bruteforce and Bruteforce-bootstrap are very close. This indicates that Bruteforce (fully trained $5 \%$ design) is a good surrogate of Bruteforcebootstrapping (fully trained $5 \%$ design, but using bootstrapping selection), and could also well approximate the ground truth performance of the best design.
|
| 446 |
+
|
| 447 |
+
Table 10: Best designs in the graph classification datasets.
|
| 448 |
+
|
| 449 |
+
<table><tr><td>Dataset</td><td></td><td>Best design</td><td>Test perfor- mance (%)</td></tr><tr><td rowspan="2">AIDS</td><td>FALCON</td><td>(0.3,1,4,2, SUM,Prelu, True,Add, NoPool)</td><td>99.02</td></tr><tr><td>BRUTEFORCE</td><td>(0.0,3,8,2, STACK,Relu, True,Add, SAGPool, 2)</td><td>95.97</td></tr><tr><td rowspan="2">COX2-MD</td><td>FALCON</td><td>(0.0,2,6,1,SUM,Swish,True,Add,EdgePool,2)</td><td>69.87</td></tr><tr><td>BRUTEFORCE</td><td>(0.0,1, 4, 3, STACK,Prelu, True,Max, TopkPool, 2)</td><td>65.39</td></tr><tr><td>DHFR-MD</td><td>FALCON</td><td>(0.3,2,4,2,SUM,Swish,True,Mean,PANPool,2)</td><td>71.33</td></tr><tr><td rowspan="2">ER-MD</td><td>BRUTEFORCE</td><td>(0.0,1,4,3, CAT, Prelu, True, Mean, SAGPool,4)</td><td>56.22</td></tr><tr><td>FALCON</td><td>(0.3,3,4,2, CAT, Relu, True,Add,PANPool,2)</td><td>81.67</td></tr><tr><td rowspan="2">MCF-7</td><td>BRUTEFORCE</td><td>(0.0,3,5,3, CAT, Prelu, True,Max,PANPool,6)</td><td>83.33</td></tr><tr><td>FALCON BRUTEFORCE</td><td>(0.6,1,8, 2, CAT, Swish, True, Add, NoPool) (0.0,1,2, 6, SUM,Prelu, True,Add, NoPool)</td><td>67.85 70.61</td></tr><tr><td rowspan="2">MOLT-4</td><td></td><td></td><td></td></tr><tr><td>FALCON BRUTEFORCE</td><td>(0.0,3,6,2, SUM,Prelu,True,Max,NoPool) (0.0,1,6,1, SUM,Prelu,True,Add,NoPool)</td><td>69.03 70.30</td></tr><tr><td rowspan="2">Mutagenicity</td><td></td><td></td><td></td></tr><tr><td>FALCON BRUTEFORCE</td><td>(0.0,2, 6,1, CAT,Relu, True,Add, NoPool) (0.0,2,4,2, CAT, Relu, True,Add, PANPool, 2)</td><td>81.73</td></tr><tr><td rowspan="2">NCI1</td><td></td><td></td><td>81.17</td></tr><tr><td>FALCON BRUTEFORCE</td><td>(0.0,2,4,2, SUM, Swish, True, Max, EdgePool,2) (0.0,1,4,2,STACK,Prelu,True,Add,EdgePool,4)</td><td>80.13</td></tr><tr><td rowspan="2">NCI109</td><td></td><td></td><td>82.81</td></tr><tr><td>FALCON BRUTEFORCE</td><td>(0.0,2,8,2, STACK,Prelu, True,Max,NoPool) (0.0,3, 6,2, STACK,Prelu, True,Add,EdgePool, 6)</td><td>79.98 81.77</td></tr><tr><td rowspan="2">NCI-H23</td><td>FALCON</td><td></td><td></td></tr><tr><td>BRUTEFORCE</td><td>(0.0,2,6,1,CAT,Swish,True,Add,NoPool) (0.0,2,6,1,CAT,Swish,True,Add,NoPool)</td><td>71.14 71.14</td></tr><tr><td rowspan="2">OVCAR-8</td><td>FALCON</td><td></td><td></td></tr><tr><td>BRUTEFORCE</td><td>(0.6,2,6,2, CAT, Swish, True,Add, NoPool) (0.6,1,2,3,CAT,Swish,True,Add,NoPool)</td><td>68.21 67.40</td></tr><tr><td rowspan="2">P388</td><td>FALCON</td><td></td><td></td></tr><tr><td>BRUTEFORCE</td><td>(0.0,2,6,2,CAT,Prelu,True,Add,NoPool)</td><td>78.75</td></tr><tr><td rowspan="2">PC-3</td><td>FALCON</td><td>(0.0,2,6,2, CAT,Prelu,True,Add,NoPool)</td><td>78.75</td></tr><tr><td>BRUTEFORCE</td><td>(0.0,2,6,1, SUM,Relu,True,Max,NoPool)</td><td>73.28</td></tr><tr><td rowspan="2">PTC-MM</td><td></td><td>(0.0,2,6,1, SUM,Relu,True,Max,NoPool)</td><td>73.28</td></tr><tr><td>FALCON</td><td>(0.0,2,4,2,STACK,Swish,True,Max,EdgePool,2)</td><td>56.96</td></tr><tr><td rowspan="2">PTC-MR</td><td>BRUTEFORCE</td><td>(0.0,3,6,1, SUM,Swish, True,Mean,EdgePool,2)</td><td>52.93</td></tr><tr><td>FALCON</td><td>(0.0,2, 4, 2, SUM, Swish, True, Mean, TopkPool, 2)</td><td>60.56</td></tr><tr><td rowspan="2">SF-295</td><td>BRUTEFORCE</td><td>(0.3,1,6,2, SUM,Relu,True,Add,NoPool)</td><td>63.06</td></tr><tr><td>FALCON</td><td>(0.6,2, 6, 2, CAT, Swish, True,Add, NoPool)</td><td>64.75</td></tr><tr><td rowspan="2"></td><td>BRUTEFORCE</td><td>(0.0, 3, 8,3, SUM, Prelu, True, Max, PANPool, 4)</td><td>66.47</td></tr><tr><td>FALCON</td><td>(0.0,1, 8,1, CAT, Swish, True,Add, NoPool)</td><td>73.34</td></tr><tr><td rowspan="2">SN12C SW-620</td><td>BRUTEFORCE</td><td>(0.0,1,8,3, CAT,Prelu, True,Add,EdgePool, 6)</td><td>73.73</td></tr><tr><td>FALCON</td><td>(0.0,2,4,2,STACK,Prelu,True,Max,NoPool)</td><td>69.26</td></tr><tr><td rowspan="2"></td><td>BRUTEFORCE</td><td>(0.0,2,4,2, STACK,Prelu,True,Max,NoPool)</td><td>69.26</td></tr><tr><td>FALCON</td><td>(0.0,2,4,2, SUM,Prelu, True,Add,EdgePool,2)</td><td>79.10</td></tr><tr><td rowspan="2">Tox21-AhR</td><td>BRUTEFORCE</td><td>(0.0,3,6,2, SUM,Prelu, True,Add, NoPool)</td><td>82.02</td></tr><tr><td>FALCON</td><td>(0.3,2,6,2, CAT,Swish,True,Max,NoPool)</td><td>67.94</td></tr><tr><td rowspan="2">UACC257</td><td>BRUTEFORCE</td><td>(0.0,3,6,1,SUM,Prelu,True,Max,NoPool)</td><td>70.24</td></tr><tr><td>FALCON</td><td>(0.6,1,8,1, CAT, Prelu, True,Add, NoPool)</td><td>59.60</td></tr><tr><td rowspan="2">Yeast</td><td>BRUTEFORCE</td><td></td><td></td></tr><tr><td></td><td>(0.0,1,2,3, SUM, Swish, True,Add, EdgePool, 2)</td><td>60.41</td></tr></table>
|
| 450 |
+
|
| 451 |
+
# C EXPERIMENTAL RESULTS ON THE IMAGE TASK
|
| 452 |
+
|
| 453 |
+
# C.1 DATASET PRE-PROCESSING
|
| 454 |
+
|
| 455 |
+
We use the CIFAR-10 (Krizhevsky, 2009) image dataset to show FALCON can work well on other machine learning domains. This dataset consists of 50,000 training images and 10,000 test images. We randomly crop them to size $3 2 \times 3 2$ , and conduct random flipping and normalization.
|
| 456 |
+
|
| 457 |
+
# C.2 DESIGN SPACES
|
| 458 |
+
|
| 459 |
+
Here we use two different design spaces to demonstrate FALCON’s ability in searching for both hyper-parameters and architectures on image dataset.
|
| 460 |
+
|
| 461 |
+
Hyper-parameter Design Space. We consider a broad space of hyper-parameter search, including common hyper-parameters like Batch Size. We train each design using a SGD optimizer, which requires weight decay and momentum as hyper-parameters. We also use a learning rate (LR) scheduler, which reduces the learning rate when validation performance has stopped improving. Specifically, the scheduler will reduce the learning rate by a factor if no improvement is seen for a ‘patience’ number of epochs. It is also worth mentioning that FALCON is flexible for other sets of hyper-parameter choices determined by the user end.
|
| 462 |
+
|
| 463 |
+
Table 12: Hyper-parameter design space for image tasks.
|
| 464 |
+
|
| 465 |
+
<table><tr><td>Variable</td><td>Candidate Values</td></tr><tr><td>Momentum (SGD)</td><td>[0.5, 0.9, 0.99]</td></tr><tr><td>Weight decay</td><td>[le-4, 5e-4,1e-3, 5e-3]</td></tr><tr><td>Batch size</td><td>[32, 64, 128,256]</td></tr><tr><td>LR decay factor</td><td>[0.1, 0.2, 0.5, 0.8]</td></tr><tr><td>LR decay patience</td><td>[3,5,10]</td></tr></table>
|
| 466 |
+
|
| 467 |
+
Architecture Design Space. We construct micro design space for the computational cells. Each cell constitutes of two branches, where we enable five selections: separable convolution with kernel size 3 $\times 3$ and $5 \times 5$ , average pooling and max pooling with kernel size $3 { \times } 3$ , and identity. In each branch, we have one dropout layer, where the dropout ratio is one of $\{ 0 . 0 , 0 . 3 , 0 . 6 \}$ , and one batch normalization layer. We also use one of identity and skip-sum as skip-connection within each branch. After the input data is separately computed in each branch, the outputs are added as the final cell output, which is different with the original ENAS paper that searches the computational DAG on the defined nodes.
|
| 468 |
+
|
| 469 |
+
# C.3 EXPERIMENTAL RESULTS
|
| 470 |
+
|
| 471 |
+
Here we set the exploration size as 20 for all the sample-based methods. For hyper-parameter design space, we compare FALCON with the baselines that are available for hyper-parameter tuning. Moreover, to accelerate the search process, FALCON explores an unknown design by fine-tuning a pretrained model for several epochs based on the selected hyper-parameters, instead of training each candidate design from scratch. The results are summarized in Table 13.
|
| 472 |
+
|
| 473 |
+
Table 13: Search results on the hyper-parameter design space for CIFAR-10 dataset.
|
| 474 |
+
|
| 475 |
+
<table><tr><td>Average Error (%)</td></tr><tr><td>Random 4.13</td></tr><tr><td>BO 4.95</td></tr><tr><td>SA 4.04</td></tr><tr><td>FALCON 3.80</td></tr></table>
|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
Figure 7: Sensitivity of FALCON’s hyper-parameters.
|
| 479 |
+
|
| 480 |
+
For the architecture design space. For ENAS and DARTS, the learning rate is 0.01, and the maximum training epoch is 300. We repeat each experiment three times and summarize the results in Table 14.
|
| 481 |
+
|
| 482 |
+
Table 14: Search results on the architecture design space for CIFAR-10 dataset.
|
| 483 |
+
|
| 484 |
+
<table><tr><td></td><td>Average Error (%)</td><td>Search Cost (GPU days)</td></tr><tr><td>Random</td><td>10.43</td><td>0.64</td></tr><tr><td>BO</td><td>9.83</td><td>0.67</td></tr><tr><td>SA</td><td>10.16</td><td>0.62</td></tr><tr><td>ENAS-micro</td><td>9.20</td><td>0.77</td></tr><tr><td>DARTS-micro</td><td>8.97</td><td>0.89</td></tr><tr><td>FALCON</td><td>8.87</td><td>0.81</td></tr></table>
|
| 485 |
+
|
| 486 |
+
# D SENSITIVITY ANALYSIS
|
| 487 |
+
|
| 488 |
+
We analyze the sensitivity of the hyper-parameters in the search strategy of FALCON, using a node classification task, CiteSeer, and a graph classification task, Tox21-AhR. Specifically, we study the influence of the number of random starting nodes and the candidate scale resulting from an explored node (i.e., how many hop neighbors of an explored node are to be included in the candidate set).
|
| 489 |
+
|
| 490 |
+
As shown in Figure 7, we find that FALCON outperforms the best AutoML baselines with a large range of hyper-parameters. Specifically, $7 3 \%$ and $9 7 \%$ hyper-parameter combinations of FALCON rank best among the baselines in CiteSeer and Tox21-AhR, respectively.
|
| 491 |
+
|
| 492 |
+
Moreover, we discover an interesting insight about the size of receptive field, i.e., the number of design candidates, during the search process of FALCON. According to the construction of design subgraph, the receptive field size is $\dot { O } ( r h ^ { d } )$ , where $r$ is the number of random start nodes, $h$ is the number of neighbor hops, and $d$ is the average node degree. We find that the performance of design searched by FALCON increases with the receptive field’s size until it reaches a certain scale.
|
| 493 |
+
|
| 494 |
+
Such patterns have been widely observed in multiple datasets. While the receptive field on the design subgraph should contain sufficient candidates for sampling good ones, it should also prune inferior design space, which doesn’t provide insights on navigating the best-performing designs. Thus, the size of the receptive field may be a crucial factor influencing the search quality of FALCON.
|
md/dev/LI2bhrE_2A/LI2bhrE_2A.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ITERATIVE REFINEMENT GRAPH NEURAL NETWORK FOR ANTIBODY SEQUENCE-STRUCTURE CO-DESIGN
|
| 2 |
+
|
| 3 |
+
Wengong $\mathbf { J i n } ^ { \dagger }$ , Jeremy Wohlwend\*, Regina Barzilay\*, Tommi Jaakkola\*
|
| 4 |
+
|
| 5 |
+
† Eric and Wendy Schmidt Center, Broad Institute of MIT and Harvard \* CSAIL, Massachusetts Institute of Technology {wengong,jwohlwend,regina,tommi}@csail.mit.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Antibodies are versatile proteins that bind to pathogens like viruses and stimulate the adaptive immune system. The specificity of antibody binding is determined by complementarity-determining regions (CDRs) at the tips of these Y-shaped proteins. In this paper, we propose a generative model to automatically design the CDRs of antibodies with enhanced binding specificity or neutralization capabilities. Previous generative approaches formulate protein design as a structureconditioned sequence generation task, assuming the desired 3D structure is given a priori. In contrast, we propose to co-design the sequence and 3D structure of CDRs as graphs. Our model unravels a sequence autoregressively while iteratively refining its predicted global structure. The inferred structure in turn guides subsequent residue choices. For efficiency, we model the conditional dependence between residues inside and outside of a CDR in a coarse-grained manner. Our method achieves superior log-likelihood on the test set and outperforms previous baselines in designing antibodies capable of neutralizing the SARS-CoV-2 virus1.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Monoclonal antibodies are increasingly adopted as therapeutics targeting a wide range of pathogens such as SARS-CoV-2 (Pinto et al., 2020). Since the binding specificity of these Y-shaped proteins is largely determined by their complementarity-determining regions (CDRs), the main goal of computational antibody design is to automate the creation of CDR subsequences with desired properties. This problem is particularly challenging due to the combinatorial search space of over $\dot { 2 0 } ^ { 6 0 }$ possible CDR sequences and the small solution space which satisfies the desired constraints of binding affinity, stability, and synthesizability (Raybould et al., 2019).
|
| 14 |
+
|
| 15 |
+
There are three key modeling questions in CDR generation. The first is how to model the relation between a sequence and its underlying 3D structure. Generating sequences without the corresponding structure (Alley et al., 2019; Shin et al., 2021) can lead to sub-optimal performance (Ingraham et al., 2019), while generating from a predefined 3D structure (Ingraham et al., 2019) is not suitable for antibodies since the desired structure is rarely known a priori (Fischman & Ofran, 2018). Therefore, it is crucial to develop models that co-design the sequence and structure. The second question is how to model the conditional distribution of CDRs given the remainder of a sequence (context). Attention-based methods only model the conditional dependence at the sequence level, but the structural interaction between the CDR and its context is crucial for generation. The last question relates to the model’s ability to optimize for various properties. Traditional physics-based methods (Lapidoth et al., 2015; Adolf-Bryfogle et al., 2018) focus on binding energy minimization, but in practice, our objective can be much more involved than binding energies (Liu et al., 2020).
|
| 16 |
+
|
| 17 |
+
In this paper, we represent a sequence-structure pair as a graph and formulate the co-design task as a graph generation problem. The graph representation allows us to model the conditional dependence between a CDR and its context at both the sequence and structure levels. Antibody graph generation poses unique challenges because the global structure is expected to change when new nodes are inserted. Previous autoregressive models (You et al., 2018; Gebauer et al., 2019) cannot modify a generated structure because they are trained under teacher forcing. Thus errors made in the previous steps can lead to a cascade of errors in subsequent generation steps. To address these problems, we propose a novel architecture which interleaves the generation of amino acid nodes with the prediction of 3D structures. The structure generation is based on an iterative refinement of a global graph rather than a sequential expansion of a partial graph with teacher forcing. Since the context sequence is long, we further introduce a coarsened graph representation by grouping nodes into blocks. We apply graph convolution at a coarser level to efficiently propagate the contextual information to the CDR residues. After pretraining our model on antibodies with known structures, we finetune it using a predefined property predictor to generate antibodies with specific properties.
|
| 18 |
+
|
| 19 |
+
We evaluate our method on three generation tasks, ranging from language modeling to SARS-CoV-2 neutralization optimization and antigen-binding antibody design. Our method is compared with a standard sequence model (Saka et al., 2021; Akbar et al., 2021) and a state-of-the-art graph generation method (You et al., 2018) tailored to antibodies. Our method not only achieves lower perplexity on test sequences but also outperforms previous baselines in property-guided antibody design tasks.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Antibody/protein design. Current methods for computational antibody design roughly fall into two categories. The first class is based on energy function optimization (Pantazes & Maranas, 2010; Li et al., 2014; Lapidoth et al., 2015; Adolf-Bryfogle et al., 2018), which use Monte Carlo simulation to iteratively modify a sequence and its structure until reaching a local energy minimum. Similar approaches are used in protein design (Leaver-Fay et al., 2011; Tischer et al., 2020). Nevertheless, these physics-based methods are computationally expensive (Ingraham et al., 2019) and our desired objective can be much more complicated than low binding energy (Liu et al., 2020).
|
| 24 |
+
|
| 25 |
+
The second class is based on generative models. For antibodies, they are mostly sequence-based (Alley et al., 2019; Shin et al., 2021; Saka et al., 2021; Akbar et al., 2021). For proteins, O’Connell et al. (2018); Ingraham et al. (2019); Strokach et al. (2020); Karimi et al. (2020); Cao et al. (2021) further developed models conditioned on a backbone structure or protein fold. Our model also seeks to incorporate 3D structure information for antibody generation. Since the best CDR structures are often unknown for new pathogens, we co-design sequences and structures for specific properties.
|
| 26 |
+
|
| 27 |
+
Generative models for graphs. Our work is related to autoregressive models for graph generation (You et al., 2018; Li et al., 2018; Liu et al., 2018; Liao et al., 2019; Jin et al., 2020a). In particular, Gebauer et al. (2019) developed G-SchNet for molecular graph and conformation co-design. Unlike our method, they generate edges sequentially and cannot modify a previously generated subgraph when new nodes arrive. While Graphite (Grover et al., 2019) also uses iterative refinement to predict the adjacency matrix of a graph, it assumes all the node labels are given and predicts edges only. In contrast, our work combines autoregressive models with iterative refinement to generate a full graph with node and edge labels, including node labels and coordinates.
|
| 28 |
+
|
| 29 |
+
3D structure prediction. Our approach is closely related to protein folding (Ingraham et al., 2018; Yang et al., 2020a; Baek et al., 2021; Jumper et al., 2021). Inputs to the state-of-the-art models like AlphaFold require a complete protein sequence, its multi-sequence alignment (MSA), and its template features. These models are not directly applicable because we need to predict the structure of an incomplete sequence and the MSA is not specified in advance.
|
| 30 |
+
|
| 31 |
+
Our iterative refinement model is also related to score matching methods for molecular conformation prediction (Shi et al., 2021) and diffusion-based methods for point clouds (Luo & Hu, 2021). These algorithms also iteratively refine a predicted 3D structure, but only for a complete molecule or point cloud. In contrast, our approach learns to predict the 3D structure for incomplete graphs and interleaves 3D structure refinement with graph generation.
|
| 32 |
+
|
| 33 |
+
# 3 ANTIBODY SEQUENCE AND STRUCTURE CO-DESIGN
|
| 34 |
+
|
| 35 |
+
Overview. The role of an antibody is to bind to an antigen (e.g. a virus), present it to the immune system, and stimulate an immune response. A subset of antibodies known as neutralizing antibodies not only bind to an antigen but can also suppress its activity. An antibody consists of a heavy chain and a light chain, each composed of one variable domain (VH/VL) and some constant domains. The variable domain is further divided into a framework region and three complementarity determining regions (CDRs). The three CDRs on the heavy chain are labeled as CDR-H1, CDR-H2, CDR-H3, each occupying a contiguous subsequence (Figure 1). As the most variable part of an antibody, CDRs are the main determinants of binding and neutralization (Abbas et al., 2014).
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Schematic structure of an antibody (figure modified from Wikipedia).
|
| 39 |
+
|
| 40 |
+
Following Shin et al. (2021); Akbar et al. (2021), we formulate antibody design as a CDR generation task, conditioned on the framework region. Specifically, we represent an antibody as a graph, which encodes both its sequence and 3D structure. We propose a new graph generation approach called RefineGNN and extend it to handle conditional generation given a fixed framework region. Lastly, we describe how to apply RefineGNN to property-guided optimization to design new antibodies with better neutralization properties. For simplicity, we focus on the generation of heavy chain CDRs, though our method can be easily extended to model light chains CDRs.
|
| 41 |
+
|
| 42 |
+
Notations. An antibody VH domain is represented as a sequence of amino acids $\pmb { s } = \pmb { s } _ { 1 } \pmb { s } _ { 2 } \cdot \cdot \cdot \pmb { s } _ { n }$ . Each token $s _ { i }$ in the sequence is called a residue, whose value can be either one of the 20 amino acids or a special token $\langle \mathtt { M A S K } \rangle$ , meaning that its amino acid type is unknown and needs to be predicted. The VH sequence folds into a 3D structure and each residue $\mathbf { \boldsymbol { s } } _ { i }$ is labeled with three backbone coordinates: $\mathbf { \Delta } _ { \mathbf { x } _ { i , \alpha } }$ for its alpha carbon atom, $\scriptstyle { \pmb x } _ { i , c }$ for its carbon atom, and $\mathbf { \Delta } _ { \mathbf { x } _ { i , n } }$ for its nitrogen atom.
|
| 43 |
+
|
| 44 |
+
# 3.1 GRAPH REPRESENTATION
|
| 45 |
+
|
| 46 |
+
We represent an antibody (VH) as a graph $\mathcal { G } ( \pmb { s } ) = ( \gamma , \mathcal { E } )$ with node features $\mathcal { V } = \{ \pmb { v } _ { 1 } , \cdots , \pmb { v } _ { n } \}$ and edge features $\mathcal { E } = \{ e _ { i j } \} _ { i \neq j }$ . Each node feature ${ \mathbf { } } v _ { i }$ encodes three dihedral angles $\left( \phi _ { i } , \psi _ { i } , \omega _ { i } \right)$ related to three backbone coordinates of residue $i$ . For each residue $i$ , we compute an orientation matrix $O _ { i }$ representing its local coordinate frame (Ingraham et al., 2019) (defined in the appendix). This allows us to compute edge features describing the spatial relationship between two residues $i$ and $j$ :
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { e _ { i j } = \big ( E _ { \mathrm { p o s } } ( i - j ) , \quad \mathrm { R B F } ( \lVert x _ { i , \alpha } - x _ { j , \alpha } \rVert ) , \quad O _ { i } ^ { \top } \frac { x _ { j , \alpha } - x _ { i , \alpha } } { \lVert x _ { i , \alpha } - x _ { j , \alpha } \rVert } , \quad q ( O _ { i } ^ { \top } O _ { j } ) \big ) . } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
The edge feature $e _ { i j }$ contains four parts. The positional encoding $E _ { \mathrm { p o s } } ( i - j )$ encodes the relative distance between two residues in an antibody sequence. The second term $\mathrm { R B F } ( \cdot )$ is a distance encoding lifted into radial basis. The third term in $e _ { i j }$ is a direction encoding that corresponds to the relative direction of $\boldsymbol { \mathscr { x } } _ { j }$ in the local frame of residue $i$ . The last term $\pmb { q } ( \pmb { O } _ { i } ^ { \top } \pmb { O } _ { j } )$ is the orientation encoding of the quaternion representation $\pmb q ( \cdot )$ of the spatial rotation matrix $O _ { i } ^ { \top } O _ { j }$ . We only include edges in the $K$ -nearest neighbors graph of $\dot { \mathcal G } ( s )$ with $K = 8$ . For notation convenience, we use $\mathcal { G }$ as a shorthand for $\mathcal G ( s )$ when there is no ambiguity.
|
| 53 |
+
|
| 54 |
+
# 3.2 ITERATIVE REFINEMENT GRAPH NEURAL NETWORK (REFINEGNN)
|
| 55 |
+
|
| 56 |
+
We propose to generate an antibody graph via an iterative refinement process. Let ${ \mathcal { G } } ^ { ( 0 ) }$ be the initial guess of the true antibody graph. Each residue is initialized as a special token $\langle \mathtt { M A S K } \rangle$ and each edge $( i , j )$ is initialized to be of distance $3 | i - j |$ since the average distance between consecutive residues is around three. The direction and orientation features are set to zero. In each generation step $t$ , the model learns to revise a current antibody graph $\mathcal { G } ^ { ( t ) }$ and predict the label of the next residue $t + 1$ . Specifically, it first encodes $\mathcal { G } ^ { ( t ) }$ with a message passing network (MPN) with parameter $\theta$
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\{ \pmb { h } _ { 1 } ^ { ( t ) } , \cdot \cdot \cdot , \pmb { h } _ { n } ^ { ( t ) } \} = \mathrm { M P N } _ { \theta } ( \pmb { \mathcal { G } } ^ { ( t ) } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where ${ h } _ { i } ^ { ( t ) }$ is a learned representation of residue $i$ under the current graph $\mathcal { G } ^ { ( t ) }$ . Our MPN consists of $L$ message passing layers with the following architecture
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
{ h } _ { i } ^ { ( t , l + 1 ) } = \mathrm { L a y e r N o r m } \bigg ( \sum _ { j } \mathrm { F F N } \big ( { h } _ { i } ^ { ( t , l ) } , { h } _ { j } ^ { ( t , l ) } , E ( s _ { j } ) , e _ { i , j } \big ) \bigg ) , \quad 0 \le l \le L - 1 ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $h _ { i } ^ { ( t , 0 ) } = v _ { i }$ and $h _ { i } ^ { ( t ) } = h _ { i } ^ { ( t , L ) }$ . FFN is a two-layer feed-forward network (FFN) with ReLU activation function. $E ( s _ { j } )$ is a learned embedding of amino acid type $s _ { j }$ . Based on the learned residue representations, we predict the amino acid type of the next residue $t + 1$ (Figure 2A).
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
p _ { t + 1 } = \mathrm { s o f t m a x } ( W _ { a } h _ { t + 1 } ^ { ( t ) } )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
This prediction gives us a new graph $\mathcal { G } ^ { ( t + 0 . 5 ) }$ with the same edges as $\mathcal { G } ^ { ( t ) }$ but the node label of $t + 1$ is changed (Figure 2B). Next, we need to update the structure to accommodate the new residue $t + 1$ . To this end, we encode graph $\mathcal { G } ^ { ( t + 0 . 5 ) }$ by another MPN with a different parameter $\tilde { \theta }$ and predict the coordinate of all residues.
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r c l } { \{ h _ { 1 } ^ { ( t + 0 . 5 ) } , \cdots , h _ { n } ^ { ( t + 0 . 5 ) } \} } & { = } & { \mathrm { M P N } _ { \tilde { \theta } } ( \mathcal { G } ^ { ( t + 0 . 5 ) } ) } \\ { x _ { i , e } ^ { ( t + 1 ) } } & { = } & { W _ { x } ^ { e } h _ { i } ^ { ( t + 0 . 5 ) } , \qquad 1 \leq i \leq n , e \in \{ \alpha , c , n \} . } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
The new coordinates $\pmb { x } _ { i } ^ { ( t + 1 ) }$ define a new antibody graph $\mathcal { G } ^ { ( t + 1 ) }$ for the next iteration (Figure 2C). We explicitly realize the coordinates of each residue because we need to calculate the spatial edge features for $\dot { \boldsymbol g } ^ { ( t + 1 ) }$ . The structure prediction (coordinates $\mathbf { \boldsymbol { x } } _ { i }$ ) and sequence prediction (amino acid types $\pmb { p } _ { t + 1 } ,$ ) are carried out by two different MPNs, namely the structure network $\tilde { \theta }$ and sequence network $\theta$ . This disentanglement allows the two networks to focus on two distinct tasks.
|
| 81 |
+
|
| 82 |
+
Training. During training, we only apply teacher forcing to the discrete amino acid type prediction. Specifically, in each generation step $t$ , residues 1 to $t$ are set to their ground truth amino acid types $s _ { 1 } , \cdots , s _ { t }$ , while all future residues $t + 1 , \cdots , n$ are set to a padding token. In contrast, the continuous structure prediction is carried out without teacher forcing. In each iteration, the model refines the entire structure predicted in the previous step and constructs a new $K$ -nearest neighbors graph G(t+1) of all residues based on the predicted coordinates {x(t+i,e $\{ \pmb { x } _ { i , e } ^ { ( t + 1 ) } \mid 1 \leq i \leq n , e \in \{ \alpha , c , n \} \}$ .
|
| 83 |
+
|
| 84 |
+
Loss function. Our model remains rotation and translation invariant because the loss function is computed over pairwise distance and angles rather than coordinates. The loss function for antibody structure prediction consists of three parts.
|
| 85 |
+
|
| 86 |
+
• Distance loss: For each residue pair $i , j$ , we compute its pairwise distance between the predicted alpha carbons x(t)i,α, x(t)j,α. We define the distance loss as the Huber loss between the predicted and true pairwise distances
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { \mathcal { L } _ { d } ^ { ( t ) } = \sum _ { i , j } \ell _ { \mathrm { h u b e r } } ( \Vert \pmb { x } _ { i , \alpha } ^ { ( t ) } - \pmb { x } _ { j , \alpha } ^ { ( t ) } \Vert ^ { 2 } , \Vert \pmb { x } _ { i , \alpha } - \pmb { x } _ { j , \alpha } \Vert ^ { 2 } ) , } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where distance is squared to avoid the square root operation which causes numerical instability.
|
| 93 |
+
|
| 94 |
+
• Dihedral angle loss: For each residue, we calculate its dihedral angle $( \phi _ { i } ^ { ( t ) } , \psi _ { i } ^ { ( t ) } , \omega _ { i } ^ { ( t ) } )$ based on the predicted atom coordinates $\pmb { x } _ { i , \alpha } ^ { ( t ) } , \pmb { x } _ { i , c } ^ { ( t ) } , \pmb { x } _ { i , n } ^ { ( t ) }$ and $\mathbf { \Delta } \mathbf { x } _ { i + 1 , \alpha } ^ { ( t ) } , \mathbf { x } _ { i + 1 , c } ^ { ( t ) } , \mathbf { x } _ { i + 1 , n } ^ { ( t ) }$ . We define the dihedral angle loss as the mean square error between the predicted and true dihedral angles
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } _ { a } ^ { ( t ) } = \sum _ { i } \sum _ { \substack { a \in \{ \phi , \psi , \omega \} } } ( \cos a _ { i } ^ { ( t ) } - \cos a _ { i } ) ^ { 2 } + ( \sin a _ { i } ^ { ( t ) } - \sin a _ { i } ) ^ { 2 }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
$C _ { \alpha }$ angle loss: We calcll as dihedral angles e angles betwee $\gamma _ { i } ^ { ( t ) }$ between two vectoo planes defined by $\pmb { x } _ { i - 1 , \alpha } ^ { ( t ) } - \pmb { x } _ { i , \alpha } ^ { ( t ) }$ and x(t)i,α $\pmb { x } _ { i , \alpha } ^ { ( t ) } - \pmb { x } _ { i + 1 , \alpha } ^ { ( t ) }$ $\beta _ { i } ^ { ( t ) }$ $\pmb { x } _ { i - 2 , \alpha } ^ { ( t ) } , \pmb { x } _ { i - 1 , \alpha } ^ { ( t ) } , \pmb { x } _ { i , \alpha } ^ { ( t ) } , \pmb { x } _ { i + 1 , \alpha } ^ { ( t ) }$
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathcal { L } _ { c } ^ { ( t ) } = \sum _ { i } ( \cos \gamma _ { i } ^ { ( t ) } - \cos \gamma _ { i } ) ^ { 2 } + ( \cos \beta _ { i } ^ { ( t ) } - \cos \beta _ { i } ) ^ { 2 }
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
In summary, the overall graph generation loss is defined as $\mathcal { L } = \mathcal { L } _ { \mathrm { s e q } } + \mathcal { L } _ { \mathrm { s t r u c t } }$ , where
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathcal { L } _ { \mathrm { s t r u c t } } = \sum _ { t } \mathcal { L } _ { d } ^ { ( t ) } + \mathcal { L } _ { a } ^ { ( t ) } + \mathcal { L } _ { c } ^ { ( t ) } \qquad \mathcal { L } _ { \mathrm { s e q } } = \sum _ { t } \mathcal { L } _ { c e } ( p _ { t } , s _ { t } ) .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
The sequence prediction loss $\mathcal { L } _ { \mathrm { s e q } }$ is the cross entropy $\mathcal { L } _ { c e }$ between predicted and true residue types.
|
| 113 |
+
|
| 114 |
+
# 3.3 CONDITIONAL GENERATION GIVEN THE FRAMEWORK REGION
|
| 115 |
+
|
| 116 |
+
The model architecture described so far is designed for unconditional generation — it generates an entire antibody graph without any constraints. In practice, we usually fix the framework region of an antibody and design the CDR sequence only. Therefore, we need to extend the model architecture to learn the conditional distribution $P ( \pmb { s } ^ { \prime } | \pmb { s } _ { < l } , \pmb { s } _ { > r } )$ , where $\pmb { s } _ { < l } = \pmb { s } _ { 1 } \cdots \pmb { s } _ { l - 1 }$ and $\pmb { s } _ { > r } = \pmb { s } _ { r + 1 } \cdot \cdot \cdot \pmb { s } _ { n }$ are residues outside of the CDR $s _ { l } \cdots s _ { r }$ .
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 2: (A-C) One generation step of RefineGNN. Each circle represents a CDR residue and each square represents a residue block in a coarsened context sequence. (D) Sequence coarsening.
|
| 120 |
+
|
| 121 |
+
Conditioning via attention. A simple extension of RefineGNN is to encode the non-CDR sequence using a recurrent neural network and propagate information to the CDR through an attention layer. To be specific, we first concatenate $\mathbf { \delta } _ { \pmb { s } _ { < l } }$ and $\pmb { s } _ { > r }$ into a context sequence $\begin{array} { r l } { \tilde { s } } & { { } = } \end{array}$ $\pmb { s } _ { < l } \oplus \left. \tt N A S K \right. \cdot \cdot \cdot \left. \tt N A S K \right. \oplus \pmb { s } _ { > r }$ , where $\oplus$ means string concatenation and $\langle \mathtt { M A S K } \rangle$ is repeated $n$ times. We then encode this context sequence by a Gated Recurrent Unit (GRU) (Cho et al., 2014) and modify the structure and sequence prediction step (Equation 4 and 6) as
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r c l } { \{ c _ { 1 } , \cdots , c _ { n } \} } & { = } & { c _ { 1 : n } = \mathrm { G R U } ( \tilde { s } ) } \\ { p _ { t + 1 } } & { = } & { \mathrm { s o f t m a x } \big ( W _ { a } h _ { t + 1 } ^ { ( t ) } + U _ { a } ^ { \top } \mathrm { a t t e n t i o n } ( c _ { 1 : n } , h _ { t + 1 } ^ { ( t ) } ) \big ) } \\ { x _ { i , e } ^ { ( t + 1 ) } } & { = } & { W _ { x } ^ { e } h _ { i } ^ { ( t + 0 . 5 ) } + U _ { x } ^ { e \top } \mathrm { a t t e n t i o n } ( c _ { 1 : n } , h _ { i } ^ { ( t + 0 . 5 ) } ) } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Multi-resolution modeling. The attention-based approach alone is not sufficient because it does not model the structure of the context sequence, thus ignoring how its residues structurally interact with the CDR’s. While this information is not available for new antibodies at test time, we can learn to predict this interaction using antibodies in the training set with known structures.
|
| 128 |
+
|
| 129 |
+
A naive solution is to iteratively refine the entire antibody structure (more than 100 residues) while generating CDR residues. This approach is computationally expensive because we need to recompute the MPN encoding for all residues in each generation step. Importantly, we cannot predict the context residue coordinates at the outset and fix them because they need to be adjusted accordingly when the coordinates of CDR residues are updated in each generation step.
|
| 130 |
+
|
| 131 |
+
For computational efficiency, we propose a coarse-grained model that reduces the context sequence length by clustering it into residue blocks. Specifically, we construct a coarsened context sequence $\mathbf { \ } _ { b _ { l , r } ( s ) }$ by clustering every $b$ context residues into a block (Figure 2D). The new sequence $\mathbf { \ } _ { b _ { l , r } ( s ) }$ defines a coarsened graph $\mathcal { G } ( b _ { l , r } ( s ) )$ over the residue blocks, whose edges are defined based on block coordinates. The coordinate of each block ${ \boldsymbol { x } } _ { b _ { i } , e }$ is defined as the mean coordinate of residues within the block. The embedding of each block $E ( b _ { i } )$ is the mean of its residue embeddings.
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
E ( \boldsymbol { b } _ { i } ) = \sum _ { \boldsymbol { s } _ { j } \in \boldsymbol { b } _ { i } } E ( \boldsymbol { s } _ { j } ) / b , \qquad \boldsymbol { x } _ { \boldsymbol { b } _ { i } , \boldsymbol { e } } = \sum _ { \boldsymbol { s } _ { j } \in \boldsymbol { b } _ { i } } \boldsymbol { x } _ { j , \boldsymbol { e } } / b , \qquad \boldsymbol { e } \in \{ \alpha , c , n \} .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Now we can apply RefineGNN to generate the CDR residues while iteratively refining the global graph $\mathcal { G } ( b _ { l , r } ( s ) )$ by predicting the coordinates of all blocks. The only change is that the structure prediction loss is defined over block coordinates ${ \boldsymbol { x } } _ { b _ { i } , e }$ . Lastly, we combine both the attention mechanism and coarse-grained modeling to keep both fine-grained and coarse-grained information. The decoding process of this conditional RefineGNN is illustrated in Algorithm 1.
|
| 138 |
+
|
| 139 |
+
# Algorithm 1 RefineGNN decoding
|
| 140 |
+
|
| 141 |
+
# Require: Context sequence $\pmb { S } _ { < l } , \pmb { S } _ { > r }$
|
| 142 |
+
|
| 143 |
+
1: Predict the CDR length $n$
|
| 144 |
+
2: Coarsen the context sequence into $\mathbf { \ } _ { b _ { l , r } ( s ) }$
|
| 145 |
+
3: Construct the initial graph ${ \mathcal { G } } ^ { ( 0 ) }$
|
| 146 |
+
4: for $t = 0$ to $n - 1$ do
|
| 147 |
+
5: Encode $\mathcal { G } ^ { ( t ) }$ using the sequence MPN
|
| 148 |
+
6: Predict distribution of the next residue
|
| 149 |
+
$p _ { t + 1 }$
|
| 150 |
+
7: Sample $s _ { t + 1 } \sim$ categorical $\left( { \pmb { p } } _ { t + 1 } \right)$
|
| 151 |
+
8: Encode $\mathcal { G } ^ { ( t + 0 . 5 ) }$ with the structure MPN
|
| 152 |
+
9: Predict all residue coordinates x(t+i,e
|
| 153 |
+
10: Update $\mathcal { G } ^ { ( t + 1 ) }$ using the new coordinates
|
| 154 |
+
|
| 155 |
+
Algorithm 2 ITA-based sequence optimization
|
| 156 |
+
|
| 157 |
+
Require: A set of antibodies $\mathcal { D }$ to be optimized Require: A neutralization predictor $f$ .
|
| 158 |
+
Require: A set of neutralizing antibodies $Q$
|
| 159 |
+
1: for each iteration do
|
| 160 |
+
2: Sample an antibody $\pmb { s }$ from $\mathcal { D }$ , remove its CDR and get a context sequence $\mathbf { \ } _ { b _ { l , r } ( s ) }$ 3: for $i = 1$ to $M$ do
|
| 161 |
+
4: Sample $\pmb { s } _ { i } ^ { \prime } \sim P _ { \Theta } ( \pmb { s } ^ { \prime } | \pmb { b } _ { l , r } ( \pmb { s } ) )$
|
| 162 |
+
5: if $f ( \pmb { s } _ { i } ^ { \prime } ) > \operatorname* { m a x } ( f ( \pmb { s } ) , 0 . 5 )$ then
|
| 163 |
+
6: $Q Q \cup \{ s _ { i } ^ { \prime } \}$
|
| 164 |
+
7: Sample a batch of new antibodies from $Q$ 8: Update model parameter $\Theta$ by minimizing the sequence prediction loss $\mathcal { L } _ { \mathrm { s e q } }$ .
|
| 165 |
+
|
| 166 |
+
# 3.4 PROPERTY-GUIDED SEQUENCE OPTIMIZATION
|
| 167 |
+
|
| 168 |
+
Our ultimate goal is to generate new antibodies with desired properties such as neutralizing a particular virus. This task can be formulated as an optimization problem. Let $Y$ be a binary indicator variable for neutralization. Our goal is to learn a conditional generative model $P _ { \Theta } ( s ^ { \prime } | b _ { l , r } ^ { - } ( s ) )$ that maximizes the probability of neutralization for a training set of antibodies $\mathcal { D }$ , i.e.
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\sum _ { s \in \mathcal { D } } \log P ( Y = 1 | b _ { l , r } ( s ) ) = \sum _ { s \in \mathcal { D } } \log \sum _ { s ^ { \prime } } f ( s ^ { \prime } ) P _ { \Theta } ( s ^ { \prime } | b _ { l , r } ( s ) )
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
where $f ( s ^ { \prime } )$ is a predictor for $P ( \boldsymbol { Y } = 1 | s ^ { \prime } )$ . Assuming $f$ is given, this problem can be solved by iterative target augmentation (ITA) (Yang et al., 2020b). Before ITA optimization starts, we first pretrain our model on a set of real antibody structures to learn a prior distribution over CDR sequences and structures. In each ITA finetuning step, we first randomly sample a sequence $\pmb { s }$ from $\mathcal { D }$ , a set of antibodies whose CDRs need to be redesigned. Next, we generate $M$ new sequences given its context $\mathbf { \ } _ { b _ { l , r } ( s ) }$ . A generated sequence $\mathbf { \boldsymbol { s } } _ { i } ^ { \prime }$ is added to our training set $Q$ if it is predicted as neutralizing. Initially, the training set $Q$ contains antibodies that are known to be neutralizing $Y =$ 1). Lastly, we sample a batch of neutralizing antibodies from $Q$ and update the model parameter by minimizing their sequence prediction loss $\mathcal { L } _ { \mathrm { s e q } }$ (Eq.(10)). The structure prediction loss $\mathcal { L } _ { \mathrm { s t r u c t } }$ is excluded in ITA finetuning phase because the structure of a generated sequence is unknown.
|
| 175 |
+
|
| 176 |
+
# 4 EXPERIMENTS
|
| 177 |
+
|
| 178 |
+
Setup. We construct three evaluation setups to quantify the performance of our approach. Following standard practice in generative model evaluation, we first measure the perplexity of different models on new antibodies in a test set created based on sequence similarity split. We also measure structure prediction error by comparing generated and ground truth CDR structures recorded in the Structural Antibody Database (Dunbar et al., 2014). Results for this task are shown in section 4.1.
|
| 179 |
+
|
| 180 |
+
Second, we evaluate our method on an existing antibody design benchmark of 60 antibody-antigen complexes from Adolf-Bryfogle et al. (2018). The goal is to design the CDR-H3 of an antibody so that it binds to a given antigen. Results for this task are shown in section 4.2.
|
| 181 |
+
|
| 182 |
+
Lastly, we propose an antibody optimization task which aims to redesign CDR-H3 of antibodies in the Coronavirus Antibody Database (Raybould et al., 2021) to improve their neutralization against SARS-CoV-2. CDR-H3 design with a fixed framework is a common practice in the antibody engineering community (Adolf-Bryfogle et al., 2018; Liu et al., 2020). Following works in molecular design (Jin et al., 2020b), we use a predictor to evaluate the neutralization of generated antibodies since we cannot experimentally test them in wet labs. Results for this task are reported in section 4.3.
|
| 183 |
+
|
| 184 |
+
Baselines. We consider three baselines for comparison (details in the appendix). The first baseline is a sequence-based LSTM model used in Saka et al. (2021); Akbar et al. (2021). This model does not utilize any 3D structure information. It consists of an encoder that learns to encode a context sequence $\tilde { s }$ , a decoder that decodes a CDR sequence, and an attention layer connecting the two.
|
| 185 |
+
|
| 186 |
+
Table 1: Left: Language modeling results. We report perplexity (PPL) and root mean square deviation (RMSD) for each CDR in the heavy chain. Right: Results on the antigen-binding antibody design task. We report the amino acid recovery (AAR) for all methods.
|
| 187 |
+
|
| 188 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">CDR-H1</td><td colspan="2">CDR-H2</td><td colspan="2">CDR-H3</td><td>Model</td><td>AAR</td></tr><tr><td>PPL</td><td>RMSD</td><td>PPL</td><td>RMSD</td><td>PPL</td><td>RMSD</td><td>RAbD</td><td>28.53%</td></tr><tr><td>LSTM</td><td>6.79</td><td>-</td><td>7.21</td><td>1</td><td>9.70</td><td>-</td><td>LSTM</td><td>22.53%</td></tr><tr><td>AR-GNN</td><td>6.44</td><td>2.97</td><td>6.86</td><td>2.27</td><td>9.44</td><td>3.63</td><td>AR-GNN</td><td>23.86%</td></tr><tr><td>RefineGNN</td><td>6.09</td><td>1.18</td><td>6.58</td><td>0.87</td><td>8.54</td><td>2.50</td><td>RefineGNN</td><td>34.14%</td></tr></table>
|
| 189 |
+
|
| 190 |
+
The second baseline is an autoregressive graph generation model (AR-GNN) whose architecture is similar to You et al. (2018); Jin et al. (2020b) but tailored for antibodies. AR-GNN generates an antibody graph residue by residue. In each step $t$ , it first predicts the amino acid type of residue $t$ and then generates edges between $t$ and previous residues. Importantly, AR-GNN cannot modify a partially generated 3D structure of residues $s _ { 1 } \cdots s _ { t - 1 }$ because it is trained by teacher forcing.
|
| 191 |
+
|
| 192 |
+
On the antigen-binding task, we include an additional physics-based baseline called RosettaAntibodyDesign (RAbD) (Adolf-Bryfogle et al., 2018). We apply their de novo design protocol composed of graft design followed by 250 iterations of sequence design and energy minimization. We cannot afford to run more iterations because it takes more than 10 hours per antibody. We also could not apply RAbD to the SARS-CoV-2 task because it requires 3D structures to be given. This information is unavailable for antibodies in CoVAbDab.
|
| 193 |
+
|
| 194 |
+
Hyperparameters. We performed hyperparameter tuning to find the best setting for each method. For RefineGNN, both its structure and sequence MPN have four message passing layers, with a hidden dimension of 256 and block size $b = 4$ . All models are trained by the Adam optimizer with a learning rate of 0.001. More details are provided in the appendix.
|
| 195 |
+
|
| 196 |
+
# 4.1 LANGUAGE MODELING AND 3D STRUCTURE PREDICTION
|
| 197 |
+
|
| 198 |
+
Data. The Structural Antibody Database (SAbDab) consists of 4994 antibody structures renumbered according to the IMGT numbering scheme (Lefranc et al., 2003). To measure a model’s ability to generalize to novel CDR sequences, we divide the heavy chains into training, validation, and test sets based on CDR cluster split. We illustrate our cluster split process using CDR-H3 as an example. First, we use MMseqs2 (Steinegger & Soding, 2017) to cluster all the CDR-H3 sequences. The ¨ sequence identity is calculated under the BLOSUM62 substitution matrix (Henikoff & Henikoff, 1992). Two antibodies are put into the same cluster if their CDR-H3 sequence identity is above $40 \%$ . We then randomly split the clusters into training, validation, and test set with 8:1:1 ratio. We repeat the same procedure for creating CDR-H1 and CDR-H2 splits. In total, there are 1266, 1564, and 2325 clusters for CDR-H1, H2, and H3. The size of training, validation, and test sets for each CDR is shown in the appendix.
|
| 199 |
+
|
| 200 |
+
Metrics. For each method, we report the perplexity (PPL) of test sequences and the root mean square deviation (RMSD) between a predicted structure and its ground truth structure reported in SAbDab. RMSD is calculated by the Kabsch algorithm (Kabsch, 1976) based on $C _ { \alpha }$ coordinate of CDR residues. Since the mapping between sequences and structures is deterministic in RefineGNN, we can calculate perplexity in the same way as standard sequence models.
|
| 201 |
+
|
| 202 |
+
Results. Since the LSTM baseline does not involve structure prediction, we report RMSD for graphbased methods only. As shown in Table 1, RefineGNN significantly outperforms all baselines in both metrics. For CDR-H3, our model gives $13 \%$ PPL reduction (8.54 v.s. 9.70) over sequence only model and $10 \%$ PPL reduction over AR-GNN (8.54 v.s. 9.44). RefineGNN also predicts the structure more accurately, with $30 \%$ relative RMSD reduction over AR-GNN. In Figure 3, we provide examples of predicted 3D structures of CDR-H3 loops.
|
| 203 |
+
|
| 204 |
+
Ablation studies. We further conduct ablation experiments on the CDR-H3 generation task to study the importance of different modeling choices. First, when we remove the attention mechanism and context coarsening step in section 3.3, the PPL increases from 8.54 to 8.86 (Figure 3C, row 2) and 9.01 (Figure 3C, row 3) respectively. We also tried to remove both the attention and coarsening modules and trained the model without conditioning on the context sequence. The PPL of this unconditional variant is much worse than our conditional model (Figure 3C, row 4). Lastly, we train a structure-conditioned model by feeding the ground truth structure to RefineGNN at every generation step (Figure 3C, row 5). While this structure-conditioned model gives a lower PPL as expected (7.39 v.s. 8.54), it is not too far away from the sequence only model $( \mathrm { P P L } = 9 . 7 0 )$ ). This suggests that RefineGNN is able to extract a decent amount of information from the partial structure co-evolving with the sequence.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 3: (A) CDR-H3 structure predicted by RefineGNN (PDB: 4bkl, $\mathrm { R M S D } = 0 . 5 7 )$ . The predicted structure (cyan) is aligned to the true structure (green) using the Kabsch algorithm. (B) CDRH3 structure predicted by AR-GNN (PDB: 4bkl, $\mathrm { R M S D } = 2 . 1 6 $ ). (C) Ablation studies of different modeling choices in RefineGNN in the CDR-H3 perplexity evaluation task.
|
| 208 |
+
|
| 209 |
+
# 4.2 ANTIGEN-BINDING ANTIBODY DESIGN
|
| 210 |
+
|
| 211 |
+
Data. Adolf-Bryfogle et al. (2018) selected 60 antibody-antigen complexes as an antibody design benchmark. Given the framework of an antibody, the goal is to design its CDR-H3 that binds to its corresponding antigen. For simplicity, none of the methods is conditioned on the antigen structure during CDR-H3 generation. We leave antigen-conditioned CDR generation for future work.
|
| 212 |
+
|
| 213 |
+
Metric. Following Adolf-Bryfogle et al. (2018), we use amino acid recovery (AAR) as the evaluation metric. For any generated sequence, we define its AAR as the percentage of residues having the same amino acid as the corresponding residue in the original antibody.
|
| 214 |
+
|
| 215 |
+
Results. For LSTM, AR-GNN, and RefineGNN, the training set in this setup is the entire SAbDab except antibodies in the same cluster as any of the test antibodies. At test time, we generate 10000 fiCDR-H3 sequences for each antibody and select the top 100 candidates with the lowest perplexity. For simplicity, all methods are configured to generate CDRs of the same length as the original CDR. As shown in Table 1, our model achieves the highest AAR score, with around $7 \%$ absolute improvement over the best baseline. In Figure 4A, we show an example of a generated CDRH3 sequence and highlight residues that are different from the original antibody. We also found that sequences with lower perplexity tend to have a lower AA recovery error (Pearson $\mathrm { R } = 0 . 4 2 7$ , Figure 4B). This suggests that we can use perplexity as the ranking criterion for antibody design.
|
| 216 |
+
|
| 217 |
+
# 4.3 SARS-COV-2 NEUTRALIZATION OPTIMIZATION
|
| 218 |
+
|
| 219 |
+
Data. The Coronavirus Antibody Database (CoVAbDab) contains 2411 antibodies, each associated with multiple binary labels indicating whether it neutralizes a coronavirus (SARS-CoV-1 or SARS-CoV-2) at a certain epitope. Similar to the previous experiment, we divide the antibodies into training, validation, and test sets based on CDR-H3 cluster split with 8:1:1 ratio.
|
| 220 |
+
|
| 221 |
+
Neutralization predictor. The predictor takes as input the VH sequence of an antibody and outputs a neutralization probability for the SARS-CoV-1 and SARS-CoV-2 viruses. Each residue is embedded into a 64 dimensional vector, which is fed to a SRU encoder (Lei, 2021) followed by average-pooling and a two-layer feed forward network. The final outputs are the probabilities $p _ { 1 }$ and $p _ { 2 }$ of neutralizing SARS-CoV-1 and SARS-CoV-2 and our scoring function is $f ( s ) = p _ { 2 }$ . The predictor achieved 0.81 test AUROC for SARS-CoV-2 neutralization prediction.
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 4: (A) Visualization of a generated CDR-H3 sequence and its structure in complex with an antigen (PDB: 4cmh). The predicted structure is aligned and grafted onto the original antibody using the Kabsch algorithm. Residues different from the original antibody are highlighted in red. (B) The correlation between the perplexity of a generated sequence and AA recovery error.
|
| 225 |
+
|
| 226 |
+
Table 2: SARS-CoV-2 neutralization optimization results. For each method, we report the PPL on CoVAbDab after pretraining on SAbDab and then report the average neutralization score after ITA finetuning. The average neutralization probability of original CoVAbDab antibodies is $6 9 . 3 \%$ .
|
| 227 |
+
|
| 228 |
+
<table><tr><td></td><td>Original</td><td>LSTM</td><td>AR-GNN</td><td>RefineGNN</td></tr><tr><td>CoVAbDab PPL(↓)</td><td></td><td>9.40</td><td>8.67</td><td>7.86</td></tr><tr><td>Neutralization (↑)</td><td>69.3%</td><td>72.0%</td><td>70.4%</td><td>75.2%</td></tr></table>
|
| 229 |
+
|
| 230 |
+
CDR sequence constraints. Therapeutic antibodies must be free from developability issues such as glycosylation and high charges (Raybould et al., 2019). Thus, we include four constraints on a CDR-H3 sequence s: 1) Its net charge must be between -2.0 and 2.0 (Raybould et al., 2019). The definition of net charge is given in the appendix. 2) It must not contain the N-X-S/T motif which is prone to glycosylation. 3) Any amino acid should not repeat more than five times (e.g. SSSSS). 4) Perplexity of a generated sequence given by LSTM, AR-GNN, and RefineGNN should be all less than 10. The last two constraints force generated sequences to be realistic. We use all three models in the perplexity constraint to ensure a fair comparison for all methods.
|
| 231 |
+
|
| 232 |
+
Metric. For each antibody in the test set, we generate 100 new CDR-H3 sequences, concatenate them with its context sequence to form 100 full VH sequences, and feed them into the neutralization predictor $f$ . We report the average neutralization score of antibodies in the test set. Neutralization score of a generated sequence $s ^ { \prime }$ equals $f ( s ^ { \prime } )$ if it satisfies all the CDR sequence constraints. Otherwise the score is the same as the original sequence. In addition, we pretrain each model on the SAbDab CDR-H3 sequences and evaluate its PPL on the CoVAbDab CDR-H3 sequences.
|
| 233 |
+
|
| 234 |
+
Results. All methods are pretrained on SAbDab antibodies and finetuned on CoVAbDab using the ITA algorithm to generate neutralizing antibodies. Our model outperforms the best baseline by a $3 \%$ increase in terms of average neutralization score (Table 2). Our pretrained RefineGNN also achieves a much lower perplexity on CoVAbDab antibodies (7.86 v.s. 8.67). Examples of generated CDR-H3 sequences and their predicted neutralization scores are shown in the appendix.
|
| 235 |
+
|
| 236 |
+
# 5 CONCLUSION
|
| 237 |
+
|
| 238 |
+
In this paper, we developed a RefineGNN model for antibody sequence and structure co-design. The advantage of our model over previous graph generation methods is its ability to revise a generated subgraph to accommodate addition of new residues. Our approach significantly outperforms sequence-based and graph-based approaches on three antibody generation tasks.
|
| 239 |
+
|
| 240 |
+
# ACKNOWLEDGEMENT
|
| 241 |
+
|
| 242 |
+
We would like to thank Rachel Wu, Xiang Fu, Jason Yim, and Peter Mikhael for their valuable feedback on the manuscript. We also want to thank Nitan Shalon, Nicholas Webb, Jae Hyeon Lee, Qiu Yu, and Galit Alter for their suggestions on method development. We are grateful for the generous support of Mark and Lisa Schwartz, funding in a form of research grant from Sanofi, Defense Threat Reduction Agency (DTRA), C3.ai Digital Transformation Institute, Eric and Wendy Schmidt Center at the Broad Institute, Abdul Latif Jameel Clinic for Machine Learning in Health, DTRA Discovery of Medical Countermeasures Against New and Emerging (DOMANE) threats program, and DARPA Accelerated Molecular Discovery program.
|
| 243 |
+
|
| 244 |
+
# REFERENCES
|
| 245 |
+
|
| 246 |
+
Abul K Abbas, Andrew H Lichtman, and Shiv Pillai. Cellular and molecular immunology E-book. Elsevier Health Sciences, 2014.
|
| 247 |
+
|
| 248 |
+
Jared Adolf-Bryfogle, Oleks Kalyuzhniy, Michael Kubitz, Brian D Weitzner, Xiaozhen Hu, Yumiko Adachi, William R Schief, and Roland L Dunbrack Jr. Rosettaantibodydesign (rabd): A general framework for computational antibody design. PLoS computational biology, 14(4):e1006112, 2018.
|
| 249 |
+
|
| 250 |
+
Rahmad Akbar, Philippe A Robert, Cedric R Weber, Michael Widrich, Robert Frank, Milena ´ Pavlovic, Lonneke Scheffer, Maria Chernigovskaya, Igor Snapkov, Andrei Slabodkin, et al. In sil- ´ ico proof of principle of machine learning-based antibody design at unconstrained scale. BioRxiv, 2021.
|
| 251 |
+
|
| 252 |
+
Mohammed M Al Qaraghuli, Karina Kubiak-Ossowska, Valerie A Ferro, and Paul A Mulheran. Antibody-protein binding and conformational changes: identifying allosteric signalling pathways to engineer a better effector response. Scientific reports, 10(1):1–10, 2020.
|
| 253 |
+
|
| 254 |
+
Ethan C Alley, Grigory Khimulya, Surojit Biswas, Mohammed AlQuraishi, and George M Church. Unified rational protein engineering with sequence-based deep representation learning. Nature methods, 16(12):1315–1322, 2019.
|
| 255 |
+
|
| 256 |
+
Minkyung Baek, Frank DiMaio, Ivan Anishchenko, Justas Dauparas, Sergey Ovchinnikov, Gyu Rie Lee, Jue Wang, Qian Cong, Lisa N Kinch, R Dustin Schaeffer, et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science, 373(6557):871– 876, 2021.
|
| 257 |
+
|
| 258 |
+
Yue Cao, Payel Das, Vijil Chenthamarakshan, Pin-Yu Chen, Igor Melnyk, and Yang Shen. Fold2seq: A joint sequence (1d)-fold (3d) embedding-based generative model for protein design. In International Conference on Machine Learning, pp. 1261–1271. PMLR, 2021.
|
| 259 |
+
|
| 260 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
|
| 261 |
+
|
| 262 |
+
James Dunbar, Konrad Krawczyk, Jinwoo Leem, Terry Baker, Angelika Fuchs, Guy Georges, Jiye Shi, and Charlotte M Deane. Sabdab: the structural antibody database. Nucleic acids research, 42(D1):D1140–D1146, 2014.
|
| 263 |
+
|
| 264 |
+
Sharon Fischman and Yanay Ofran. Computational design of antibodies. Current opinion in structural biology, 51:156–162, 2018.
|
| 265 |
+
|
| 266 |
+
Niklas WA Gebauer, Michael Gastegger, and Kristof T Schutt. Symmetry-adapted generation of ¨ 3d point sets for the targeted discovery of molecules. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pp. 7566–7578, 2019.
|
| 267 |
+
|
| 268 |
+
Aditya Grover, Aaron Zweig, and Stefano Ermon. Graphite: Iterative generative modeling of graphs. In International conference on machine learning, pp. 2434–2444. PMLR, 2019.
|
| 269 |
+
|
| 270 |
+
Steven Henikoff and Jorja G Henikoff. Amino acid substitution matrices from protein blocks. Proceedings of the National Academy of Sciences, 89(22):10915–10919, 1992.
|
| 271 |
+
|
| 272 |
+
John Ingraham, Adam Riesselman, Chris Sander, and Debora Marks. Learning protein structure with a differentiable simulator. In International Conference on Learning Representations, 2018.
|
| 273 |
+
|
| 274 |
+
John Ingraham, Vikas K Garg, Regina Barzilay, and Tommi Jaakkola. Generative models for graphbased protein design. Neural Information Processing Systems, 2019.
|
| 275 |
+
|
| 276 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Hierarchical generation of molecular graphs using structural motifs. In Proceedings of the 37th International Conference on Machine Learning, volume 119, pp. 4839–4848. PMLR, 2020a.
|
| 277 |
+
|
| 278 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Multi-objective molecule generation using interpretable substructures. In Proceedings of the 37th International Conference on Machine Learning, volume 119, pp. 4849–4859. PMLR, 2020b.
|
| 279 |
+
|
| 280 |
+
John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Zˇ ´ıdek, Anna Potapenko, et al. Highly accurate protein structure prediction with alphafold. Nature, 596(7873):583–589, 2021.
|
| 281 |
+
|
| 282 |
+
Wolfgang Kabsch. A solution for the best rotation to relate two sets of vectors. Acta Crystallographica Section A: Crystal Physics, Diffraction, Theoretical and General Crystallography, 32 (5):922–923, 1976.
|
| 283 |
+
|
| 284 |
+
Mostafa Karimi, Shaowen Zhu, Yue Cao, and Yang Shen. De novo protein design for novel folds using guided conditional wasserstein generative adversarial networks. Journal of Chemical Information and Modeling, 60(12):5667–5681, 2020.
|
| 285 |
+
|
| 286 |
+
Gideon D Lapidoth, Dror Baran, Gabriele M Pszolla, Christoffer Norn, Assaf Alon, Michael D Tyka, and Sarel J Fleishman. Abdesign: A n algorithm for combinatorial backbone design guided by natural conformations and sequences. Proteins: Structure, Function, and Bioinformatics, 83 (8):1385–1406, 2015.
|
| 287 |
+
|
| 288 |
+
Andrew Leaver-Fay, Michael Tyka, Steven M Lewis, Oliver F Lange, James Thompson, Ron Jacak, Kristian W Kaufman, P Douglas Renfrew, Colin A Smith, Will Sheffler, et al. Rosetta3: an objectoriented software suite for the simulation and design of macromolecules. Methods in enzymology, 487:545–574, 2011.
|
| 289 |
+
|
| 290 |
+
Marie-Paule Lefranc, Christelle Pommie, Manuel Ruiz, V ´ eronique Giudicelli, Elodie Foulquier, ´ Lisa Truong, Valerie Thouvenin-Contet, and G ´ erard Lefranc. Imgt unique numbering for im- ´ munoglobulin and t cell receptor variable domains and ig superfamily v-like domains. Developmental & Comparative Immunology, 27(1):55–77, 2003.
|
| 291 |
+
|
| 292 |
+
Tao Lei. When attention meets fast recurrence: Training language models with reduced compute. arXiv preprint arXiv:2102.12459, 2021.
|
| 293 |
+
|
| 294 |
+
Tong Li, Robert J Pantazes, and Costas D Maranas. Optmaven–a new framework for the de novo design of antibody variable region models targeting specific antigen epitopes. PloS one, 9(8): e105954, 2014.
|
| 295 |
+
|
| 296 |
+
Yujia Li, Oriol Vinyals, Chris Dyer, Razvan Pascanu, and Peter Battaglia. Learning deep generative models of graphs. arXiv preprint arXiv:1803.03324, 2018.
|
| 297 |
+
|
| 298 |
+
Renjie Liao, Yujia Li, Yang Song, Shenlong Wang, Will Hamilton, David K Duvenaud, Raquel Urtasun, and Richard Zemel. Efficient graph generation with graph recurrent attention networks. Advances in Neural Information Processing Systems, 32:4255–4265, 2019.
|
| 299 |
+
|
| 300 |
+
Ge Liu, Haoyang Zeng, Jonas Mueller, Brandon Carter, Ziheng Wang, Jonas Schilz, Geraldine Horny, Michael E Birnbaum, Stefan Ewert, and David K Gifford. Antibody complementarity determining region design using high-capacity machine learning. Bioinformatics, 36(7):2126– 2133, 2020.
|
| 301 |
+
|
| 302 |
+
Qi Liu, Miltiadis Allamanis, Marc Brockschmidt, and Alexander L Gaunt. Constrained graph variational autoencoders for molecule design. Neural Information Processing Systems, 2018.
|
| 303 |
+
|
| 304 |
+
Shitong Luo and Wei Hu. Diffusion probabilistic models for 3d point cloud generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2837–2845, 2021.
|
| 305 |
+
|
| 306 |
+
James O’Connell, Zhixiu Li, Jack Hanson, Rhys Heffernan, James Lyons, Kuldip Paliwal, Abdollah Dehzangi, Yuedong Yang, and Yaoqi Zhou. Spin2: Predicting sequence profiles from protein structures using deep neural networks. Proteins: Structure, Function, and Bioinformatics, 86(6): 629–633, 2018.
|
| 307 |
+
|
| 308 |
+
RJ Pantazes and Costas D Maranas. Optcdr: a general computational method for the design of antibody complementarity determining regions for targeted epitope binding. Protein Engineering, Design & Selection, 23(11):849–858, 2010.
|
| 309 |
+
|
| 310 |
+
Dora Pinto, Young-Jun Park, Martina Beltramello, Alexandra C Walls, M Alejandra Tortorici, Siro Bianchi, Stefano Jaconi, Katja Culap, Fabrizia Zatta, Anna De Marco, et al. Cross-neutralization of sars-cov-2 by a human monoclonal sars-cov antibody. Nature, 583(7815):290–295, 2020.
|
| 311 |
+
|
| 312 |
+
Matthew IJ Raybould, Claire Marks, Konrad Krawczyk, Bruck Taddese, Jaroslaw Nowak, Alan P Lewis, Alexander Bujotzek, Jiye Shi, and Charlotte M Deane. Five computational developability guidelines for therapeutic antibody profiling. Proceedings of the National Academy of Sciences, 116(10):4025–4030, 2019.
|
| 313 |
+
|
| 314 |
+
Matthew IJ Raybould, Aleksandr Kovaltsuk, Claire Marks, and Charlotte M Deane. Cov-abdab: the coronavirus antibody database. Bioinformatics, 37(5):734–735, 2021.
|
| 315 |
+
|
| 316 |
+
Koichiro Saka, Taro Kakuzaki, Shoichi Metsugi, Daiki Kashiwagi, Kenji Yoshida, Manabu Wada, Hiroyuki Tsunoda, and Reiji Teramoto. Antibody design using lstm based deep generative model from phage display library for affinity maturation. Scientific reports, 11(1):1–13, 2021.
|
| 317 |
+
|
| 318 |
+
Chence Shi, Shitong Luo, Minkai Xu, and Jian Tang. Learning gradient fields for molecular conformation generation. International Conference on Machine Learning, 2021.
|
| 319 |
+
|
| 320 |
+
Jung-Eun Shin, Adam J Riesselman, Aaron W Kollasch, Conor McMahon, Elana Simon, Chris Sander, Aashish Manglik, Andrew C Kruse, and Debora S Marks. Protein design and variant prediction using autoregressive generative models. Nature communications, 12(1):1–11, 2021.
|
| 321 |
+
|
| 322 |
+
Martin Steinegger and Johannes Soding. Mmseqs2 enables sensitive protein sequence searching for ¨ the analysis of massive data sets. Nature biotechnology, 35(11):1026–1028, 2017.
|
| 323 |
+
|
| 324 |
+
Alexey Strokach, David Becerra, Carles Corbi-Verge, Albert Perez-Riba, and Philip M Kim. Fast and flexible design of novel proteins using graph neural networks. BioRxiv, pp. 868935, 2020.
|
| 325 |
+
|
| 326 |
+
Doug Tischer, Sidney Lisanza, Jue Wang, Runze Dong, Ivan Anishchenko, Lukas F Milles, Sergey Ovchinnikov, and David Baker. Design of proteins presenting discontinuous functional sites using deep learning. bioRxiv, 2020.
|
| 327 |
+
|
| 328 |
+
Jianyi Yang, Ivan Anishchenko, Hahnbeom Park, Zhenling Peng, Sergey Ovchinnikov, and David Baker. Improved protein structure prediction using predicted interresidue orientations. Proceedings of the National Academy of Sciences, 117(3):1496–1503, 2020a.
|
| 329 |
+
|
| 330 |
+
Kevin Yang, Wengong Jin, Kyle Swanson, Regina Barzilay, and Tommi Jaakkola. Improving molecular design by stochastic iterative target augmentation. In International Conference on Machine Learning, pp. 10716–10726. PMLR, 2020b.
|
| 331 |
+
|
| 332 |
+
Jiaxuan You, Rex Ying, Xiang Ren, William L Hamilton, and Jure Leskovec. Graphrnn: A deep generative model for graphs. International Conference on Machine Learning, 2018.
|
| 333 |
+
|
| 334 |
+
# A MODEL ARCHITECTURE DETAILS
|
| 335 |
+
|
| 336 |
+
# A.1 REFINEGNN
|
| 337 |
+
|
| 338 |
+
Node features. Each node feature ${ \mathbf { } } v _ { i }$ encodes three dihedral angles as follows.
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\pmb { v _ { i } } = ( \cos \phi _ { i } , \cos \psi _ { i } , \cos \omega _ { i } , \sin \phi _ { i } , \sin \psi _ { i } , \sin \omega _ { i } )
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Edge features. The orientation matrix $O _ { i } = [ b _ { i } , n _ { i } , b _ { i } \times { \pmb n } _ { i } ]$ defines a local coordinate system for each residue $i$ (Ingraham et al., 2019), which is calculated as
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
u _ { i } = { \frac { \displaystyle { \boldsymbol { x } } _ { i } - { \boldsymbol { x } } _ { i - 1 } } { \| { \boldsymbol { x } } _ { i } - { \boldsymbol { x } } _ { i - 1 } \| } } , \quad { \boldsymbol { b } } _ { i } = { \frac { \displaystyle { \boldsymbol { u } } _ { i } - { \boldsymbol { u } } _ { i + 1 } } { \| { \boldsymbol { u } } _ { i } - { \boldsymbol { u } } _ { i + 1 } \| } } , \quad n _ { i } = { \frac { \displaystyle { \boldsymbol { u } } _ { i } \times { \boldsymbol { u } } _ { i + 1 } } { \| { \boldsymbol { u } } _ { i } \times { \boldsymbol { u } } _ { i + 1 } \| } }
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Attention mechanism. The attention layer used in Eq.(13) is a standard bilinear attention:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\operatorname { a t t e n t i o n } ( c _ { 1 : n } , h _ { t } ) = \sum _ { i } \alpha _ { i , t } c _ { i } , \qquad \alpha _ { i , t } = \frac { \exp ( c _ { i } ^ { \top } W h _ { t } ) } { \sum _ { j } \exp ( c _ { j } ^ { \top } W h _ { t } ) }
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
# A.2 AR-GNN
|
| 357 |
+
|
| 358 |
+
AR-GNN generates an antibody graph autoregressively. In each generation step $t$ , AR-GNN learns to encode the current subgraph $\mathcal { G } _ { 1 : t }$ induced from residues $\{ s _ { 1 } , \cdots , s _ { t } \}$ into a list of vectors
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\{ h _ { 1 } , \cdot \cdot \cdot , h _ { t } \} = \mathrm { M P N } _ { \theta } ( \mathcal { G } _ { 1 : t } ) .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
For fair comparison, we use the same MPN architecture for both RefineGNN and AR-GNN. In terms of structure prediction, AR-GNN first predicts the node feature $\hat { \pmb { v } } _ { t + 1 }$ of the next residue $t + 1$ , namely the dihedral angle between its three atoms $C _ { \alpha } , C , N$ .
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
\hat { \pmb { v } } _ { t + 1 } = \pmb { W } _ { v } \pmb { h } _ { t }
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
In addition, AR-GNN predicts the pairwise distance between $\mathbf { } s _ { t + 1 }$ and previous residues $s _ { 1 } , \cdots , s _ { t }$
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\hat { d } _ { i , t + 1 } = \mathrm { F F N } ( W _ { d } h _ { i } + U _ { d } h _ { t } + V _ { d } E _ { p o s } ( t + 1 - i ) ) ,
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
where FFN is a feed-forward network with one hidden layer and $E _ { p o s }$ is the positional encoding of $t + 1 - i$ , the gap between residue $s _ { t + 1 }$ and $\mathbf { \boldsymbol { s } } _ { i }$ in the sequence. Lastly, AR-GNN predicts the amino acid type of residue $s _ { t + 1 }$ by
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\hat { p } _ { t + 1 } = \mathrm { s o f t m a x } ( W _ { a } g _ { t + 1 } ) , \qquad \{ g _ { 1 } , \cdot \cdot \cdot , g _ { t + 1 } \} = \mathrm { M P N } _ { \theta ^ { \prime } } ( \mathcal { G } _ { 1 : t + 1 } )
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
Note that AR-GNN also uses two separate MPNs for structure and sequence prediction. However, unlike RefineGNN, AR-GNN is trained under teacher forcing — we need to feed it the ground truth structure and sequence in each generation step. In particular, we find data augmentation to be crucial for AR-GNN performance. Data augmentation is essential because of the discrepancy between training and testing. The model is trained under teacher forcing, but it needs to decode a graph without teacher forcing at test time. We find mistakes made in previous steps have a great impact on subsequent predictions during decoding.
|
| 383 |
+
|
| 384 |
+
Specifically, for every antibody $\pmb { s }$ , we create a corrupted graph $\widetilde { \mathcal G }$ by adding independent random Gaussian noise to every coordinate: $\tilde { \mathbf { \boldsymbol { x } } } _ { i } = \mathbf { \boldsymbol { x } } _ { i } + 3 \epsilon , \epsilon \sim \mathcal { N } ( 0 , I )$ . In each generation step, we apply MPN over the corrupted graph instead.
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\{ \widetilde { h } _ { 1 } , \cdot \cdot \cdot , \widetilde { h } _ { t } \} = \mathrm { M P N } _ { \theta } ( \widetilde { \mathcal { G } } _ { 1 : t } ) , \qquad \{ \widetilde { g } _ { 1 } , \cdot \cdot \cdot , \widetilde { g } _ { t + 1 } \} = \mathrm { M P N } _ { \theta ^ { \prime } } ( \widetilde { \mathcal { G } } _ { 1 : t + 1 } )
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
The node and edge labels are still defined by the ground truth structure. Specifically, let ${ \mathbf { } } v _ { t }$ and $d _ { i , j }$ be the ground truth dihedral angle and pairwise distance calculated from the original, uncorrupted graph $\mathcal { G }$ . AR-GNN loss function is defined as the following.
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\mathcal { L } _ { A R } = \sum _ { i , j } \| \hat { d } _ { i , j } - d _ { i , j } \| ^ { 2 } + \sum _ { t } \| \hat { \pmb { v } } _ { t } - \pmb { v } _ { t } \| ^ { 2 } + \mathcal { L } _ { c e } ( \hat { p } _ { t } , \pmb { s } _ { t } )
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
Similar to RefineGNN, AR-GNN also uses attention mechanism for conditional generation. Specifically, we concatenate the residue representations $\widetilde { h } _ { t } , \widetilde { g } _ { t }$ from MPN with context vectors learned from an attention layer.
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\widetilde { h } _ { t } \gets \widetilde { h } _ { t } \oplus \mathrm { a t t e n t i o n } ( c _ { 1 : n } , \widetilde { h } _ { t } ) \qquad \widetilde { g } _ { t } \gets \widetilde { g } _ { t } \oplus \mathrm { a t t e n t i o n } ( c _ { 1 : n } , \widetilde { g } _ { t } )
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
Table 3: SARS-CoV-2 neutralization optimization results. Here we show examples of new CDRH3 sequences generated by our model and their predicted neutralization improvement over original antibodies S1D7 and C694 in the CoVAbDab database.
|
| 403 |
+
|
| 404 |
+
<table><tr><td>Antibody:</td><td>S1D7</td><td>C694</td></tr><tr><td>Old CDR-H3</td><td>TRGHSDY</td><td>ARDRGYDSSGPDAFDI</td></tr><tr><td>New CDR-H3</td><td>ARWWMDV</td><td>ARERIIIVSISAWMDV</td></tr><tr><td>Improvement</td><td>63% → 73%</td><td>82% →91%</td></tr></table>
|
| 405 |
+
|
| 406 |
+
# B EXPERIMENTAL DETAILS
|
| 407 |
+
|
| 408 |
+
Hyperparameters. For AR-GNN and RefineGNN, we tried hidden dimension $d _ { h } \in \{ 1 2 8 , 2 5 6 \}$ and number of message passing layers $L \in \{ 1 , 2 , 3 , 4 , 5 \}$ . We found $d _ { h } = 2 5 6 , L = 4$ worked the best for RefineGNN and $d _ { h } = 2 5 6 , L = 3$ worked the best for AR-GNN. For LSTM, we tried $d _ { h } \in \{ 1 2 8 , 2 5 6 , 5 1 2 , 1 0 2 4 \}$ . We found $d _ { h } = 2 5 6$ worked the best. All models are trained by an Adam optimizer with a dropout of 0.1 and a learning rate of 0.001.
|
| 409 |
+
|
| 410 |
+
SAbDab data. The dataset statistics of SAbDab is the following (after deduplication). For CDRH1, the train/validation/test size is 4050, 359, and 326. For CDR-H2, the train/validation/test size is 3876, 483, and 376. For CDR-H3, the train/validation/test size is 3896, 403, and 437.
|
| 411 |
+
|
| 412 |
+
Since SAbDab includes both bound and unbound structures, we removed all antigens and used the bound antibody structure for training. Specifically, $65 \%$ of our training data came from bound state structures. We included all data in our training set because the mismatch between bound and unbound structures is relatively small. In fact, Al Qaraghuli et al. (2020) studied eight antibodies and found that the RMSD between bound and unbound structures over VH domains is less than 0.7 on average.
|
| 413 |
+
|
| 414 |
+
RAbD configuration. We provided details of the de novo design setup of RosettaAntibodyDesign (RAbD) here. For each antibody in the test set, RAbD starts by randomly selecting a CDR from RAbD’s internal database of known CDR structures. The chosen CDR-H3 sequence is required to have same length as the original sequence, but it cannot be exactly the same as the original CDR-H3 sequence. After the initial CDR structure is chosen, RAbD grafts it onto the antibody and performs energy minimization to stabilize its structure. Next, RAbD runs 100 iterations of sequence design to modify the grafted CDR-H3 structure by randomly substituting amino acids. In each sequence design iteration, it performs energy minimization to adjust the structure according to the changed amino acid. Lastly, the model returns the generated CDR-H3 sequence with the lowest energy.
|
| 415 |
+
|
| 416 |
+
SARS-CoV-2 neutralization. Each generative model is pretrained on the SAbDab data to learn a prior distribution over CDR-H3 structures. Given a fixed predictor $f$ , we use the ITA algorithm to finetune our pretrained models to generate neutralizing antibodies. Each model is trained for 3000 ITA steps with $M = 1 0 0$ . Generated CDR-H3 sequences from our model are visualized in Table 3.
|
| 417 |
+
|
| 418 |
+
Our neutralization predictor $f$ is trained on the CoVAbDab database. For simplicity, we only consider two viruses, SARS-CoV-1 and SARS-CoV-2 since other coronavirus have very little training data. For the same reason, we only consider the spike protein receptor binding domain as our target epitope. The predictor is trained in a multi-task fashion to predict both SARS-CoV-1 and SARSCoV-2 neutralization labels. The SRU encoder has a hidden dimension of 256. The model was trained with a dropout of 0.2, a learning rate of 0.0005, and batch size of 16.
|
| 419 |
+
|
| 420 |
+
The charge of a residue is defined as $C ( \pmb { s } _ { i } ) = \mathbb { I } [ \pmb { s } _ { i } \in \{ R , K \} ] + 0 . 1 \cdot \mathbb { I } [ \pmb { s } _ { i } = H ] - \mathbb { I } [ \pmb { s } _ { i } \in \{ D , E \} ]$ (Raybould et al., 2019). The net charge of a sequence $s _ { 1 } \cdots s _ { n }$ is defined as $\textstyle \sum _ { i } C ( s _ { i } )$ .
|
md/dev/LdVQGdXkkG/LdVQGdXkkG.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MODULAR ACTION CONCEPT GROUNDINGIN SEMANTIC VIDEO PREDICTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent works in video prediction have mainly focused on passive forecasting and low-level action-conditional prediction, which sidesteps the learning of interaction between agents and objects. We introduce the task of semantic actionconditional video prediction, which uses semantic action labels to describe those interactions and can be regarded as an inverse problem of action recognition. The challenge of this new task primarily lies in how to effectively inform the model of semantic action information. Inspired by the idea of Mixture of Experts, we embody each abstract label by a structured combination of various visual concept learners and propose a novel video prediction model, Modular Action Concept Network (MAC). Our method is evaluated on two newly designed synthetic datasets, CLEVR-Building-Blocks and Sapien-Kitchen, and one real-world dataset called Tower-Creation. Extensive experiments demonstrate that MAC can correctly condition on given instructions and generate corresponding future frames without need of bounding boxes. We further show that the trained model can make out-of-distribution generalization, be quickly adapted to new object categories and exploit its learnt features for object detection, showing the progression towards higher-level cognitive abilities. More visualizations can be found at https://iclr-mac.github.io/MAC/.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recently, video prediction has drawn a lot of attention due to its ability to capture meaningful representations through self-supervision (Wang et al. (2018b); Yu et al. (2019)). Although modern video prediction methods have made significant progress in improving predictive accuracy, most of their applications are limited in the scenarios of passive forecasting (Villegas et al. (2017); Wang et al. (2018a); Byeon et al. (2018); Jin et al. (2020)), meaning models can only passively observe a short period of dynamics and accordingly make a short-term extrapolation. Such settings neglect the fact that the observer can also become an active participant in the environment.
|
| 12 |
+
|
| 13 |
+
To model the movements of active manipulators, several low-level action-conditional video prediction models have been proposed in the community (Oh et al. (2015); Mathieu et al. (2015); Babaeizadeh et al. (2017); Ebert et al. (2017)). In this work, we go one step further by introducing the task of semantic action-conditional video prediction which emphasizes the modeling of interactions between agents and environment. Instead of using low-level single-entity actions such as action vectors of robot arms as done in prior works (Finn et al. (2016); Kurutach et al. (2018)), our new task provides semantic descriptions of interactive actions, e.g. "Open the door", and asks the model to imagine "What if I open the door" in the form of future frames. This task requires the model to recognize the object identity, assign correct affordances to objects and envision the long-term expectation by planning a reasonable trajectory toward the goal, which resembles how humans might imagine conditional futures. The ability to predict correct and semantically consistent future perceptual information is indicative of conceptual grounding of actions, in a manner similar to object grounding in image-based detection and generation tasks.
|
| 14 |
+
|
| 15 |
+
The challenge of action-conditional video prediction primarily lies in how to correctly inform the model of more abstract semantic action information. Existing low-level counterparts usually achieve this by employing a naive concatenation (Finn et al. (2016); Babaeizadeh et al. (2017)) with action vector of each timestep. While this implementation might enable model to move the desired objects, it fails to produce consistent long-term predictions toward target locations in the multi-entity settings because it was originally designed to only encode the motion information of a single entity. If we take "put A on $B "$ as an example, it turns out to be difficult to make the model learn what and where $B$ is, because the main self-supervisory signals in the framework of video prediction are pixel changes and $B$ is not moving in this case. In order to distinguish and locate instances in the scene, other related works heavily rely on pre-trained object detectors or ground-truth bounding boxes (Bar et al. (2020); Ji et al. (2020); Huang et al. (2018); Wu et al. (2020)). However, we argue that utilizing a pre-trained detector actually simplifies the task since such a detector already solves the major difficulty by mapping high-dimension inputs to low-dimension groundings. Furthermore, bounding boxes cannot effectively describe complex visual changes including rotations and occlusions. Thus, a more flexible way of representing objects and actions is required.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Concept Grounding in Semantic Video Prediction. After observing the scene, an agent predicts future frames conditioned on a series of semantic actions describing agent-object interactions. Neither bounding boxes nor key points are provided. Conditioning on different action labels leads to Counterfactual generations.
|
| 19 |
+
|
| 20 |
+
We present a new video prediction model, MAC, short for Modular Action Concept Network. Inspired by the idea of Mixture of Experts, MAC embodies each semantic label by a structured combination of various concept slots, each of which encodes the spatial representation of a specific concept. Such design allows MAC to reuse and integrate the knowledge learnt from different scenarios so that it can perceive the locations of motionless objects and extrapolate to unseen cases, showing the progression towards higher-level cognitive abilities. The contributions of this work are summarized as follows:
|
| 21 |
+
|
| 22 |
+
1. We introduce a new task, semantic action-conditional video prediction as illustrated in Fig 1, which can be viewed as an inverse problem of action recognition.
|
| 23 |
+
2. We create two new synthetic video datasets, CLEVR-Building-blocks and Sapien-Kitchen, and label one real-world dataset called Tower-Creation for evaluation.
|
| 24 |
+
3. We propose a novel video prediction model, Modular Action Concept Network, in which routing of visual concept slots is directly controlled by action labels. We show that MAC can successfully depict the long-term counterfactual evolution without need of bounding boxes.
|
| 25 |
+
4. We demonstrate that the trained MAC can make out-of-distribution generalization, be adapted for new object categories with a small number of samples and exploit its learnt features for detection.
|
| 26 |
+
|
| 27 |
+
# 2 APPROACH
|
| 28 |
+
|
| 29 |
+
We begin with defining the task of semantic action-conditional video prediction. Given an initial frame $x _ { 0 }$ and a sequence of action labels $a _ { 1 : T }$ , the model is required to predict the corresponding future frames $x _ { 1 : T }$ . Each action label is a pre-defined semantic description of a spatiotemporal movement that involves multiple objects in a scene and spans over multiple frames such as "take the yellow cup on the table" from $t = 0$ to $t = 1 0$ . So technically, one can regard this task as an inverse problem of action recognition. It should also be pointed out that our semantic task is different from common dense video prediction and generation tasks in the sense that it focuses on predicting time-agnostic events. Hence, we design the corresponding datasets as videos capturing sufficient key frames of entire actions. In future practices, we can further apply video interpolation methods in CV or motion planner algorithms in RL to make up the intermediate process if needed.
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 2: The pipeline of MAC in which the computation of concept slot module is elaborated (Better viewed in color). Feature maps extracted by encoder are mapped into the concept slot tensors. Concept slot module receives an action label that controls the collection of concept slot tensors and outputs representations encapsulating this action. A recurrent predictor updates representations before sending them to decoder to predict the next frame.
|
| 33 |
+
|
| 34 |
+
# 2.1 MOTIVATION
|
| 35 |
+
|
| 36 |
+
The design of our new task is necessary for studying compositional generalization as it detaches the definition of object from its specific location. However, it also requires a successful model to figure out where the desired object is through leveraging abstract labels. Our main idea is that we create a large number of small specialized learners called concept slots for each word in the dictionary of action labels to capture their corresponding spatial representations from observations. During training, action labels will be translated as constituency trees to control the activations of all related concept slots and to assemble the representations of given actions for next-frame prediction. As a result, this language-guided gating mechanism embeds the syntactic structures into the learning system and enables the proposed model to dynamically recombine its learnt concepts so that it can understand the combinatorial complexity of the world. In this paper, we demonstrate that our method possesses many key characteristics of system-2 learning (Goyal et al. (2019); Goyal & Bengio (2020)), including concept grounding, sample efficiency, counterfactual generations, out-of-distribution generalization and fast transfer.
|
| 37 |
+
|
| 38 |
+
# 2.2 MODULAR ACTION CONCEPT NETWORK
|
| 39 |
+
|
| 40 |
+
The MAC model is composed of 4 modules including encoder $\mathcal { E }$ , decoder $\mathcal { D }$ , concept slot module $\mathcal { C }$ and recurrent predictor $\mathcal { P }$ . The goal of our model is to learn the following mapping:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\hat { x } _ { t } = \mathcal { D } ( \mathcal { P } ( \mathcal { C } ( \mathcal { E } _ { t - 1 } ) | a _ { t } ) | h _ { t - 1 } ) )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $x _ { t } , a _ { t }$ and $h _ { t }$ are video frame, action labels and hidden states at time $t$ . The overall architecture of our method is illustrated in Fig 2. In the case of stochastic video generation, another two modules, prior $p ( z )$ and posterior $q ( z )$ , will be added to help estimate the latent distribution of trajectories.
|
| 47 |
+
|
| 48 |
+
Encoder and Decoder: At each timestep $t - 1$ , the encoder $\mathcal { E }$ receives visual input $x _ { t - 1 }$ and extracts a set of multi-scale feature maps. In the deterministic setting, we employ a convolutional neural network with an architecture similar to VGG16 (Simonyan $\&$ Zisserman (2014)). The matching decoder $\mathcal { D }$ is a mirrored version of the encoder with down-sampling operations replaced with spatial up-sampling and additional sigmoid output layer. It aggregates the updated latent representations produced by predictor and multi-scale feature maps from encoder to predict the next frame $\hat { x } _ { t }$ .
|
| 49 |
+
|
| 50 |
+
In the stochastic setting, we use invertible autoencoder introduced in CrevNet (Yu et al. (2019)) instead as we find this information-preserving architecture can better preserve the attributes of randomly moving objects. The corresponding decoder is the backward pass, i.e. inverse computation, of the same network of the encoder. Readers can find more details about invertible autoencoder and coupling layer in Appendix B.
|
| 51 |
+
|
| 52 |
+
Concept Slot Module: The concept slot module $\mathcal { C }$ is the core module of MAC. It resembles the mixture of experts as each slot focuses on only one concept in the space of action labels and will be activated and assembled to represent the given actions through the language-guided gating functions.
|
| 53 |
+
|
| 54 |
+
Each action label will first be decomposed into several constituents of sentence. A constituent is a verb or object phrase, like “pick” or "large red bowl". Since we are mostly dealing with manipulation videos, actions are usually divided into 3 constituents, verb, object1, object2. Each constituent will have its own dictionary recording all pre-defined words or concepts and gating functions can be derived based on these dictionaries to establish bottom-up connections from concept slots. The computation of concept slot module is given as follows:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\mathbf { w } ^ { i } = \Psi ^ { i } ( \mathbf { f } ) , \qquad \mathbf { c } ^ { j } = \Phi ^ { j } ( \mathrm { C o n c a t } ( \{ \mathbf { w } ^ { i } | \forall i , \delta ^ { j } ( i ) = 1 \} ) )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where w and c are concept and constituent representations and $\delta ^ { j }$ is the indicator function for gating function of $j _ { \mathrm { t h } }$ constituent. More specifically, after the feature maps f are extracted from the input image, they are fed into $\kappa$ convolutional units $\Psi ^ { i }$ , i.e. the concept slot layer, to create $\kappa$ concept slot tensors of dimension $N _ { d }$ . Here, $\kappa$ is the total number of possible concepts we pre-defined in the dictionary of action labels. Since verbs can be interpreted as spatiotemporal changes of relationships between objects, not only slots for objects but also slots for verbs, like ’take’ or ’put on’, are computed from the extracted feature maps.
|
| 61 |
+
|
| 62 |
+
Next, a gating function will collect all involved concept slot tensors and create an ensemble as input for each constituent. This assembly process simulates the formation of simplified constituency parse trees. Constituent slot layer $\Phi ^ { j }$ can either be resolution-preserving or upsampling operators as spatial information is important for our new task. Finally, outputs of all constituent slots are concatenated pixel-wisely to obtain the representation of actions before sending them to predictor. It is worth noticing that MAC is allowed to have multiple concurrent actions in a scene at inference time. In this case, we copy additional groups of trained constituent slots to represent other actions.
|
| 63 |
+
|
| 64 |
+
Learned Prior: We leverage a technique called learned prior from SVG (Denton & Fergus (2018)) to model the stochastic movements in videos. In particular, we build two additional recurrent inference networks, prior and posterior respectively, to capture the randomness of motions. During training, the posterior inference network $q ( z )$ can access to the representations of target frames to estimate a true distribution of trajectory that we expect its prior counterpart $p ( z )$ to mimic at test time. Codes of motions $z _ { t }$ estimated by posterior during training (or by prior during testing) will then be concatenated with latent representations before sent to predictor.
|
| 65 |
+
|
| 66 |
+
Predictor: The recurrent predictor $\mathcal { P }$ , implemented as a stack of residual ConvLSTM layers (Shi et al. (2015)), calculates the spatiotemporal evolution for each action label respectively. The memory mechanism of ConvLSTM is essential for MAC to remember its previous actions and to recover the occluded objects. To prevent interference between concurrent actions, hidden states are not shared between actions. The outputs of predictor for all action labels are added point-wisely.
|
| 67 |
+
|
| 68 |
+
Training: In the deterministic setting, we train our model by minimizing the mean squared error the between the target frames and the predictions. In the stochastic setting, we optimize the following variational lower bound (ELBO) using re-parameterization trick (Kingma & Welling (2013)):
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathcal { L } _ { \theta , \phi , \psi } ( x _ { 1 : T } ) = \sum _ { t = 1 } ^ { T } [ \mathbb { E } _ { q _ { \phi } ( z _ { 1 : t } | x _ { 1 : t } ) } \log p _ { \theta } ( x _ { t } | z _ { 1 : t } , x _ { 1 : t - 1 } ) - \beta D _ { K L } ( q _ { \phi } ( z _ { t } | x _ { 1 : t } ) | | p _ { \psi } ( z _ { t } | x _ { 1 : t - 1 } ) ]
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $p _ { \theta }$ is the future frame generator, $z _ { t }$ represents the latent codes of motion, $p _ { \psi } \big ( z _ { t } | x _ { 1 : t - 1 } \big )$ is the prior distribution, $q _ { \phi } \big ( { z } _ { t } | { x } _ { 1 : t } \big )$ is the posterior distribution and $D _ { K L }$ denotes the Kullback–Leibler (KL) divergence which forces the posterior to approximate the prior distribution. Since $p _ { \theta }$ is modeled by conditional Gaussian, the likelihood term reduces to MSE measure between the ground truth frames and the predictions. The full derivation of ELBO is provided in the Appendix A.
|
| 75 |
+
|
| 76 |
+
At the inference phase, the model will use its previous predictions as visual inputs instead except for the first pass. Hence, a training strategy called scheduled sampling (Bengio et al. (2015)) is adopted to alleviate the discrepancy between training and inference.
|
| 77 |
+
|
| 78 |
+
# 3 DATASETS
|
| 79 |
+
|
| 80 |
+
In this study, we create two new synthetic datesets, CLEVR-Building-blocks and Sapien-Kitchen, and label one real-world dataset called Tower-Creation from Roboturk (Mandlekar et al. (2018))
|
| 81 |
+
|
| 82 |
+
for evaluation. This is because most existing video datasets either don’t come with semantic action labels (Babaeizadeh et al. (2017)) or fail to provide necessary visual information in their first frames due to egomotions and occlusions (Hundt et al. (2018)). Although there are several candidate datasets like Penn Action (Zhang et al. (2013)), BAIR (Finn et al. (2016)) and KTH (Schuldt et al. (2004)) for multi-modal learning, they all adopt the same single-entity setting which actually indicates they can be solved by a much simpler model. To tackle the above issues, we design each video in our datatsets as a depiction of certain atomic action performed by an agent with objects which are observable in the starting frame. Furthermore, we add functions to generate bounding boxes of all objects for both synthetic datasets in order to train AG2Vid. It is worth noting that all three of these domains exhibit a key property named combinatorial explosion, resulting in factorial complexity growth in both spatial and temporal dimensions even with a small object set. For instance, a sequence with 6 (out of 32) objects and 6 actions can have 333,396,000 possibilities without considering any continuous factor. Hence, our model only sees a small fraction of these potential scenarios during training.
|
| 83 |
+
|
| 84 |
+
# 3.1 CLEVR-BUILDING-BLOCKS DATASET
|
| 85 |
+
|
| 86 |
+
CLEVR-Building-blocks dataset is built upon CLEVR environment (Johnson et al. (2017)). For each video, the data generator initializes the scene with 4 - 6 randomly positioned and visually different objects. There are totally 32 combinations of shapes, colors and materials of objects and at most one instance of each combination is allowed to appear in a video sequence. The agent can perform one of the following 8 actions on objects ${ \mathcal { O } } _ { A }$ and $\mathcal { O } _ { B }$ : Pick ${ \mathcal { O } } _ { A }$ , Pick and Rotate ${ \mathcal { O } } _ { A }$ transversely / longitudinally, Put ${ \mathcal { O } } _ { A }$ on $\mathcal { O } _ { B }$ , Put ${ \mathcal { O } } _ { A }$ on the left / right side of $\mathcal { O } _ { B }$ , Put ${ \mathcal { O } } _ { A }$ in the front of / behind $\mathcal { O } _ { B }$ . Each training sample contains a video of three consecutive Pick- and $P u t -$ action pairs and a sequence of semantic action labels of every frame.
|
| 87 |
+
|
| 88 |
+
# 3.2 SAPIEN-KITCHEN DATASET
|
| 89 |
+
|
| 90 |
+
Sapien-Kitchen Dataset describes a more complicated environment in the sense that: (a). It contains deformable actions like "open" and "close"; (b). The structures of different objects in the same category are highly diverse; (c). Objects can be initialized with randomly assigned relative positions like "along the wall" and "on the dishwasher". We collect totally 21 types of small movable objects in 3 categories, bottle, kettle and kitchen pot, and 19 types of large openable appliances in another 3 categories, oven, refrigerator and dishwasher, from Sapien engine (Xiang et al. (2020)). The agent can perform one of the following 6 atomic actions on small object $\mathcal { O } _ { s }$ and large appliance $\mathcal { O } _ { l }$ : Take $\mathcal { O } _ { s }$ on $\mathcal { O } _ { l }$ , Take $\mathcal { O } _ { s }$ in $\mathcal { O } _ { l }$ , Put $\mathcal { O } _ { s }$ on $\mathcal { O } _ { l }$ , Put $\mathcal { O } _ { s }$ in $\mathcal { O } _ { l }$ , Open $\mathcal { O } _ { l }$ and Close $\mathcal { O } _ { l }$ . Composite action sequences are defined as follows: "Take_on–Put_on", "Take_on–Open–Put_in–Close", "Open–Take_in–Close".
|
| 91 |
+
|
| 92 |
+
# 3.3 TOWER-CREATION DATASET
|
| 93 |
+
|
| 94 |
+
Each video in Tower-Creation Dataset depicts a robotic arm building a tower with flatware present on the table. We have labeled 524 videos in total since semantic descriptions are not provided and prodce 1867 samples consists of two actions: Pick ${ \mathcal { O } } _ { A }$ and Put ${ \mathcal { O } } _ { A }$ on $\mathcal { O } _ { B }$ . We use 1536 video clips for training and 331 for evaluation. It should be pointed out that the size of Tower-Creation dataset is small compared with commonly used datasets such as BAIR (Finn et al. (2016)) which has $5 9 \mathrm { k }$ videos in total. Thus, our experiments can also tell whether evaluated methods are data efficient.
|
| 95 |
+
|
| 96 |
+
# 4 EXPERIMENTAL EVALUATION
|
| 97 |
+
|
| 98 |
+
# 4.1 ACTION-CONDITONAL VIDEO PREDICTION
|
| 99 |
+
|
| 100 |
+
Baselines and setup: We evaluate the proposed model on CLEVR-Building-blocks and SapienKitchen Datasets. AG2Vid (Bar et al. (2020)) is re-implemented as the baseline model because it is the most related work. Unlike our method which only needs visual input and action sequence, AG2Vid also requires bounding boxes of all objects and progress meters of actions, i.e. clock edge, for training and testing. Furthermore, we conduct an ablation study by replacing concept slot module with the concatenation of features and tiled action vector, which is commonly used in low-level action-conditional video prediction (Finn et al. (2016)), to show the effectiveness of our module.
|
| 101 |
+
|
| 102 |
+
Metrics: To estimate the fidelity of action-conditional video prediction, MSE, SSIM (Wang et al. (2004)), PSNR and LPIPS (Zhang et al. (2018)) are calculated between the predictions and groundtruths. However, these metrics may not effectively tell if actions are successfully completed due to the small sizes of the moving objects. Hence, we also perform a human study to assess the accuracy of performing the correct action in generated videos for each model. The human judges annotate whether the model can identify the desired objects, perform actions specified by action labels and maintain the consistent visual appearances of all objects in its generations and only videos meeting all three criterions are scored as correct.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 3: The qualitative comparison on CLEVR-Building-blocks and Sapien-Kitchen. The first row of each figure is the groundtruth sequence. The red, blue and green boxes highlight the quality of predictions by each method. In contrast to the success of MAC, concatenation-based method fails to find the correct destinations or to preserve attributes of moving objects. Also, bounding boxes used in AG2Vid cannot portray visual changes like rotations correctly.
|
| 106 |
+
|
| 107 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">CLEVR-Building-blocks</td><td colspan="4">Sapien-Kitchen</td></tr><tr><td>SSIM↑</td><td>MSE↓</td><td>LPIPS↓</td><td>Accuracy↑</td><td>SSIM↑</td><td>MSE↓</td><td>LPIPS↓</td><td>Accuracy↑</td></tr><tr><td>Copy-First-Frame</td><td>0.962</td><td>251.38</td><td>0.1320</td><td>-</td><td>0.951</td><td>152.87</td><td>0.0393</td><td>1</td></tr><tr><td>Concatenation Baseline</td><td>0.961</td><td>226.53</td><td>0.1301</td><td>50.8%</td><td>0.962</td><td>23.13</td><td>0.0232</td><td>52.4%</td></tr><tr><td>AG2Vid</td><td>0.956</td><td>58.67</td><td>0.0399</td><td>78.8%</td><td>0.947</td><td>270.87</td><td>0.0684</td><td>5.2%</td></tr><tr><td>MAC</td><td>0.983</td><td>43.52</td><td>0.0303</td><td>95.2%</td><td>0.971</td><td>11.16</td><td>0.0178</td><td>86.4%</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Table 1: Quantitative evaluation on CLEVR-Building-blocks and Sapien-Kitchen. All metrics are averaged frame-wisely except for accuracy.
|
| 110 |
+
|
| 111 |
+
Results: The quantitative comparisons of all methods are summarized in Table 1. The MAC achieves the best scores on all metrics without access to additional information like bounding boxes, showing the superior performance of our concept slot module. The qualitative analysis in Fig 3 further reveals the drawbacks of other baselines. For CLEVR-Building-blocks, the concatenation-based variant fails to recognize the right objects due to its limited inductive bias. Although AG2Vid has no difficulty in identifying the desired objects, assumptions made by flow warping are too strong to handle rotation and occlusion. Consequently, the adversarial loss enforces AG2Vid to fix these errors by converting them to wrong poses or colors. These limitations of AG2Vid will be further amplified in a more complicated environment, i.e. Sapien-Kitchen. The same architecture used for CLEVR can only learn to remove the moving objects from their starting positions in Sapien-Kitchen because rotation and occlusion occur more often. The concatenation baseline performs better by showing correct generation of open and close actions on large appliance. Yet, it still fails to produce long-term consistent predictions as the visual appearances of moving objects are altered. On the contrary, MAC can authentically depict the correct actions specified by action labels on both datasets.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 4: Counterfactual video generation: Conditioning on the same initial frame and different action labels, MAC can produce high-quality imaginations of counterfactual futures. Various visual outcomes present in the final frames are highlighted with red boxes and enlarged in the final column. Top: Generative results on CLEVR-Building-blocks. 34 frames are generated. Bottom: Generative results on Sapien-Kitchen dataset. 35 frames are generated.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 5: Left: Visual comparison between sMAC and SVG-LP on Tower-Creation. The supposed completions of Pick and Put in the final frames are highlighted by red and yellow boxes while incorrect completions in SVG-LP generations are labelled by grey boxes. The last two rows are counterfactual generations in which models are given different action labels. Right: Quantitative comparison per-frame. Higher SSIM and PSNR indicate better performance.
|
| 118 |
+
|
| 119 |
+
# 4.2 COUNTERFACTUAL GENERATION
|
| 120 |
+
|
| 121 |
+
Counterfactual generation: The most intriguing application of MAC is counterfactual generation. More specifically, counterfactual generation means that our model will observe the same starting frame but receive different valid action labels to produce the corresponding future frames.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 6: Compositional generalization and feature reuse.Top: Unobserved scenarios. All red cubes are removed from the tranining data, but the trained model can still manipulate red cube at test time. Middle: Concurrent actions. Inputting two action sequences at the same time. Both actions are depicted correctly. Bottom Left: New-object adaptation. Even with a few training samples, MAC can be fast adapted for generation of new objects. Red arrows point to new objects present in images. Bottom Right: Object detection.
|
| 125 |
+
|
| 126 |
+
Results: The visual results of counterfactual generations on each dataset are displayed in Fig 4. As we can see, our model successfully identifies the desired objects, plans correct trajectories toward the target places and generates high-quality imaginations of counterfactual futures. It is also worth noticing that all displayed generations are long-term generations , i.e. more than 30 frames are predicted for each sequence. Our recurrent predictor plays an very important role in sustaining the spatiotemporal consistency and in reconstructing the fully-occluded objects.
|
| 127 |
+
|
| 128 |
+
# 4.3 STOCHASTIC VIDEO GENERATION
|
| 129 |
+
|
| 130 |
+
Baselines and setup: We continue to evaluate the stochastic version of MAC (sMAC) on TowerCreation dataset. SVG-LP was extended to action-conditional version in (Villegas et al. (2019)) so that we can adopt it as the baseline model to demonstrate the effectiveness of concept slot module.
|
| 131 |
+
|
| 132 |
+
Results: The qualitative and quantitative comparison between sMAC and action-conditional SVG-LP is provided in Fig 5. Although SVG-LP can partially understand the given action labels, it often fails to locate and manipulate the desired objects. Consequently, it will generate the moving object out of nowhere and often place it on a wrong target object. In contrast, sMAC can successfully simulate the trajectory of robotic arms and correctly animate the "Pick" and "Put" actions thanks to the concept slot module. Row 3 and 5 in Fig 5 show that sMAC is also capable of producing diverse future frames and predicting counterfactual results following different action instructions.
|
| 133 |
+
|
| 134 |
+
# 4.4 COMPOSITIONAL GENERALIZATION
|
| 135 |
+
|
| 136 |
+
We further explore other interesting features of our MAC. We first demonstrate that MAC is capable of making out-of-distribution generalization by designing two experiments. We evaluate how quickly our model can be adapted to new objects. It turns out for each new object, the trained MAC only requires a few training video examples to generate decent results. Finally, to verify that our model encodes the spatial information, we add SSD (Liu et al. (2016)) head after the frozen encoder and concept slot layer to conduct object detection.
|
| 137 |
+
|
| 138 |
+
Unobserved scenarios: We design an interesting experiment where only a subset of CLEVRBuilding-blocks data are used for training and check what will happen if we input the unobserved action labels to the trained model. More precisely, we exclude all videos manipulating red cubes in the training sets and send the instructions involving red cubes at test time. The visualization of this experiment can be found in Fig 6. As we can see, MAC can still identify and manipulate red cubes correctly, showing its ability to recombine the learnt concept to comprehend new objects.
|
| 139 |
+
|
| 140 |
+
Concurrent actions: Concurrent actions means multiple action inputs at the same time. It can be considered as out-of-distribution generalization because our model only observes single-action videos during training. Generating concurrent-action videos needs to employ copied constituent slots and parallel hidden states. As illustrated in Fig 6, MAC can linearly integrate the action information in the latent space and correctly portray 2 concurrent actions in the same scene.
|
| 141 |
+
|
| 142 |
+
Adaptation: We add a new openable category "safe" and a new movable category "dispenser" into Sapien-Kitchen and generate 100 video sequences for each new object showing its interaction with other objects. Approximately, there are about 5 new sequences created for each new action pair between 2 objects. Blank concept slots for new categories are attached to trained MAC and we finetune it on this small new training set. Visualization in Fig 6 shows that even with a few training samples, MAC is accurately adapted for video generation of new objects. This is because, with the help of concept slots, MAC can disentangle actions into relatively independent grounded concepts. When it learns new concepts, MAC reuses and integrates prior knowledge learnt from different cases.
|
| 143 |
+
|
| 144 |
+
Object detection: The quantitative results of object detection and more visualizations can be found in Appendix D. We observe that the features learnt by MAC can be easily transferred for detection as our video prediction task is highly location-dependent. This result indicates that utilizing bounding boxes might be a little redundant for some video tasks because videos already provide rich motion information that can be used for salient object detection.
|
| 145 |
+
|
| 146 |
+
# 5 RELATED WORK
|
| 147 |
+
|
| 148 |
+
Video prediction: ConvLSTM (Shi et al. (2015)) was the first deep learning model that employed a hybrid of convolutional and recurrent units for passive video prediction. This architectural design was soon followed by studies looking at a similar problem (Kalchbrenner et al. (2017); Mathieu et al. (2015); Wang et al. (2017); Yu et al. (2019); Wang et al. (2018b)). However, the capability of passive video prediction framework is very limited as models usually don’t have sufficient information to predict the long-term future due to partial observation, egomotion and randomness. More importantly, this setting prevents models from interacting with environment. On the other hand, the low-level action-conditional video prediction task provides an action vector at each timestep as additional input to guide the prediction (Oh et al. (2015); Chiappa et al. (2017); Babaeizadeh et al. (2017); Wu et al. (2021)). CDNA (Finn et al. (2016)) is a representative of such models. In CDNA, the states and action vectors of the robotic manipulator are first spatially tiled and integrated into the model through concatenation. SVG (Denton & Fergus (2018)) was initially proposed for stochastic video generation but later was extended to action-conditional version in (Villegas et al. (2019)). It is worth noticing that SVG also used concatenation to incorporate action information. Such implementations are prevalent in low-level action-conditional video prediction because the action vector only encodes the spatial information of a single entity, usually a robotic manipulator (Finn et al. (2016)) or a human hand. A common failure case for such models is the presence of multiple affordable entities (Kim et al. (2019)), a scenario that our task definition and datasets focus on.
|
| 149 |
+
|
| 150 |
+
Modularity: Mixture of Experts refers to a classical machine learning technique where various learners are employed, each of which specializes in one particular function, and their output are aggregated through a gating function. This modular design makes each submodule relatively independent and thus leads to better generalization and robustness to compositional changes, which has been studied in several works (Goyal et al. (2019); Afshar et al. (2021); Sabour et al. (2017); Henaff et al. (2016)). In this work, we hypothesis that the underlying syntactic structures of semantic labels can tell how to aggregate the representations of individual concept learners. By translating labels into constituency trees, action graphs are embedded into the learning system to get the entire perspective of ongoing activities while each concept learner can focus on its specific subtask.
|
| 151 |
+
|
| 152 |
+
# 6 CONCLUSION
|
| 153 |
+
|
| 154 |
+
In this work, we propose the new task of semantic action-conditional video prediction and introduce 3 new datasets that are meant to bridge the gap towards a robust solution to this task in complex interactive scenarios. MAC, a novel video prediction model, was also designed by utilizing the idea of Mixture of Experts to ground action concept for video generation. Our proposed model can generate alternative futures without requiring additional auxiliary data such as bounding boxes, and is shown to be both quickly extendible and adaptable to novel scenarios and entities. It is our hope that our contributions will advance progress and understanding within this new task space, and that a model robust enough for real-world applications (i.e. in robotic systems) in perception and control will be eventually proposed as a descendant of this work.
|
| 155 |
+
|
| 156 |
+
# REFERENCES
|
| 157 |
+
|
| 158 |
+
Parnian Afshar, Farnoosh Naderkhani, Anastasia Oikonomou, Moezedin Javad Rafiee, Arash Mohammadi, and Konstantinos N Plataniotis. Mixcaps: A capsule network-based mixture of experts for lung nodule malignancy prediction. Pattern Recognition, 116:107942, 2021.
|
| 159 |
+
|
| 160 |
+
Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv preprint arXiv:1710.11252, 2017.
|
| 161 |
+
|
| 162 |
+
Amir Bar, Roei Herzig, Xiaolong Wang, Gal Chechik, Trevor Darrell, and Amir Globerson. Compositional video synthesis with action graphs. arXiv preprint arXiv:2006.15327, 2020.
|
| 163 |
+
|
| 164 |
+
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 1171–1179, 2015.
|
| 165 |
+
|
| 166 |
+
Wonmin Byeon, Qin Wang, Rupesh Kumar Srivastava, and Petros Koumoutsakos. Contextvp: Fully contextaware video prediction. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 753–769, 2018.
|
| 167 |
+
|
| 168 |
+
Silvia Chiappa, Sébastien Racaniere, Daan Wierstra, and Shakir Mohamed. Recurrent environment simulators. arXiv preprint arXiv:1704.02254, 2017.
|
| 169 |
+
|
| 170 |
+
Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. arXiv preprint arXiv:1802.07687, 2018.
|
| 171 |
+
|
| 172 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 173 |
+
|
| 174 |
+
Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. arXiv preprint arXiv:1710.05268, 2017.
|
| 175 |
+
|
| 176 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, pp. 64–72, 2016.
|
| 177 |
+
|
| 178 |
+
Anirudh Goyal and Yoshua Bengio. Inductive biases for deep learning of higher-level cognition. arXiv preprint arXiv:2011.15091, 2020.
|
| 179 |
+
|
| 180 |
+
Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent independent mechanisms. arXiv preprint arXiv:1909.10893, 2019.
|
| 181 |
+
|
| 182 |
+
Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. Tracking the world state with recurrent entity networks. arXiv preprint arXiv:1612.03969, 2016.
|
| 183 |
+
|
| 184 |
+
De-An Huang, Shyamal Buch, Lucio Dery, Animesh Garg, Li Fei-Fei, and Juan Carlos Niebles. Finding" it": Weakly-supervised reference-aware visual grounding in instructional videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5948–5957, 2018.
|
| 185 |
+
|
| 186 |
+
Andrew Hundt, Varun Jain, Chia-Hung Lin, Chris Paxton, and Gregory D Hager. The costar block stacking dataset: Learning with workspace constraints. arXiv preprint arXiv:1810.11714, 2018.
|
| 187 |
+
|
| 188 |
+
Jingwei Ji, Ranjay Krishna, Li Fei-Fei, and Juan Carlos Niebles. Action genome: Actions as compositions of spatio-temporal scene graphs. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10236–10247, 2020.
|
| 189 |
+
|
| 190 |
+
Beibei Jin, Yu Hu, Qiankun Tang, Jingyu Niu, Zhiping Shi, Yinhe Han, and Xiaowei Li. Exploring spatialtemporal multi-frequency analysis for high-fidelity and temporal-consistency video prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4554–4563, 2020.
|
| 191 |
+
|
| 192 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2901–2910, 2017.
|
| 193 |
+
|
| 194 |
+
Nal Kalchbrenner, Aäron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. Proceedings of Machine Learning Research, 2017. URL http://proceedings.mlr.press/v70/kalchbrenner17a.html.
|
| 195 |
+
|
| 196 |
+
Yunji Kim, Seonghyeon Nam, In Cho, and Seon Joo Kim. Unsupervised keypoint learning for guiding classconditional video prediction. In Advances in Neural Information Processing Systems, pp. 3814–3824, 2019.
|
| 197 |
+
|
| 198 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 199 |
+
|
| 200 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 201 |
+
|
| 202 |
+
Thanard Kurutach, Aviv Tamar, Ge Yang, Stuart J Russell, and Pieter Abbeel. Learning plannable representations with causal infogan. In Advances in Neural Information Processing Systems, pp. 8733–8744, 2018.
|
| 203 |
+
|
| 204 |
+
Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pp. 21–37. Springer, 2016.
|
| 205 |
+
|
| 206 |
+
Ajay Mandlekar, Yuke Zhu, Animesh Garg, Jonathan Booher, Max Spero, Albert Tung, Julian Gao, John Emmons, Anchit Gupta, Emre Orbay, et al. Roboturk: A crowdsourcing platform for robotic skill learning through imitation. In Conference on Robot Learning, pp. 879–893. PMLR, 2018.
|
| 207 |
+
|
| 208 |
+
Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv preprint arXiv:1511.05440, 2015.
|
| 209 |
+
|
| 210 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pp. 2863–2871, 2015.
|
| 211 |
+
|
| 212 |
+
Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in neural information processing systems, pp. 3856–3866, 2017.
|
| 213 |
+
|
| 214 |
+
Christian Schuldt, Ivan Laptev, and Barbara Caputo. Recognizing human actions: a local svm approach. In Pattern Recognition, 2004. ICPR 2004. Proceedings of the 17th International Conference on, volume 3, pp. 32–36. IEEE, 2004.
|
| 215 |
+
|
| 216 |
+
Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1874–1883, 2016.
|
| 217 |
+
|
| 218 |
+
Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems, pp. 802–810, 2015.
|
| 219 |
+
|
| 220 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 221 |
+
|
| 222 |
+
Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. arXiv preprint arXiv:1706.08033, 2017.
|
| 223 |
+
|
| 224 |
+
Ruben Villegas, Arkanath Pathak, Harini Kannan, Dumitru Erhan, Quoc V Le, and Honglak Lee. High fidelity video prediction with large stochastic recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 81–91, 2019.
|
| 225 |
+
|
| 226 |
+
Yunbo Wang, Mingsheng Long, Jianmin Wang, Zhifeng Gao, and S Yu Philip. Predrnn: Recurrent neural networks for predictive learning using spatiotemporal lstms. In Advances in Neural Information Processing Systems, pp. 879–888, 2017.
|
| 227 |
+
|
| 228 |
+
Yunbo Wang, Zhifeng Gao, Mingsheng Long, Jianmin Wang, and Philip S Yu. Predrnn $^ { + + }$ : Towards a resolution of the deep-in-time dilemma in spatiotemporal predictive learning. arXiv preprint arXiv:1804.06300, 2018a.
|
| 229 |
+
|
| 230 |
+
Yunbo Wang, Lu Jiang, Ming-Hsuan Yang, Li-Jia Li, Mingsheng Long, and Li Fei-Fei. Eidetic 3d lstm: A model for video prediction and beyond. In International Conference on Learning Representations, 2018b.
|
| 231 |
+
|
| 232 |
+
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.
|
| 233 |
+
|
| 234 |
+
Bohan Wu, Suraj Nair, Roberto Martin-Martin, Li Fei-Fei, and Chelsea Finn. Greedy hierarchical variational autoencoders for large-scale video prediction. arXiv preprint arXiv:2103.04174, 2021.
|
| 235 |
+
|
| 236 |
+
Yue Wu, Rongrong Gao, Jaesik Park, and Qifeng Chen. Future video synthesis with object motion prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5539–5548, 2020.
|
| 237 |
+
|
| 238 |
+
Fanbo Xiang, Yuzhe Qin, Kaichun Mo, Yikuan Xia, Hao Zhu, Fangchen Liu, Minghua Liu, Hanxiao Jiang, Yifu Yuan, He Wang, et al. Sapien: A simulated part-based interactive environment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11097–11107, 2020.
|
| 239 |
+
|
| 240 |
+
Wei Yu, Yichao Lu, Steve Easterbrook, and Sanja Fidler. Efficient and information-preserving future frame prediction and beyond. In International Conference on Learning Representations, 2019.
|
| 241 |
+
|
| 242 |
+
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.
|
| 243 |
+
|
| 244 |
+
Weiyu Zhang, Menglong Zhu, and Konstantinos G Derpanis. From actemes to action: A strongly-supervised representation for detailed action understanding. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2248–2255, 2013.
|
| 245 |
+
|
| 246 |
+
# A VARIATIONAL LOWER BOUND DERIVATION
|
| 247 |
+
|
| 248 |
+
The original variational lower bound was derived in (Kingma & Welling (2013)).
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\begin{array} { r l } & { \quad \log \gamma _ { \mathbb { P } } ( \mathbf { x } ) = \log \int _ { \mathcal { R } } \log \left( \mathbf { x } \mid \mathbf { x } _ { \mathcal { P } } \rho ( \mathbf { x } ) \mid \mathbf { x } _ { \mathcal { P } } \rho ( \mathbf { x } ) \right. } \\ & { = \log \int _ { \mathcal { R } } p ( \mathbf { x } ) \mid p ( \mathbf { x } ) \mid p ( \mathbf { x } ) \mid \frac { \log ( \mathbf { x } ) \mid \exp ( \mathbf { x } ) } { \exp ( \mathbf { x } ) } } \\ & { = \log \mathbb { E } _ { \rho _ { \xi } \in \{ \mathbf { x } , \mathbf { x } \} } \frac { p ( \mathbf { x } ) \exp ( \mathbf { x } ) \mid \exp ( \mathbf { x } ) } { \exp ( \mathbf { x } ) } } \\ & { \geq \mathbb { E } _ { \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } ) = \mathbf { b } } \frac { p ( \mathbf { x } ) \mid p ( \mathbf { x } ) \mid p ( \mathbf { x } ) } { \exp ( \mathbf { x } ) } } \\ & { = \mathbb { E } _ { \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } ) = \mathbf { b } } \frac { \log ( \mathbf { x } ) \mid \exp ( \mathbf { x } ) } { \exp ( \mathbf { x } ) } } \\ & { = \mathbb { E } _ { \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } ) = \mathbf { b } } \frac { \log ( \mathbf { x } ) \mid \exp ( \mathbf { x } ) - \mathbf { E } _ { \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } ) } \mid \log \frac { \log ( \mathbf { x } \mid \mathbf { x } ) } { p ( \mathbf { x } ) } } { \exp ( \mathbf { x } ) } } \\ & = \mathbb { E } _ { \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } ) \mid \mathbf { x } _ { \mathcal { P } } \rho ( \mathbf { x } ) \mid \exp ( \mathbf { x } ) - \mathcal { P } _ { \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } _ { \mathbb { P } } ( \mathbf { x } ) \mid \rho ( \mathbf { x } ) \mid \exp ( \mathbf { x } ) } { \exp ( \mathbf { x } ) \mid \exp ( \mathbf { x } \mid \mathbf { x } _ { \mathbb { P } } \rho ( \mathbf { x } ) \mid \mathbf { x } ) } } \\ & = \sum _ \mathbf { x } \in \{ \mathbf { x } , \mathbf { x } \mid \mathbf { x } _ { \mathbb { P } } \rho ( \mathbf x \end{array}
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
The final step (Denton & Fergus (2018)) is obtained through the factorization of reconstruction and KL-Divergence term into individual time steps due to the independence across time.
|
| 255 |
+
|
| 256 |
+
# B INVERTIBLE ARCHITECTURE AND COUPLING LAYER
|
| 257 |
+
|
| 258 |
+
The additive coupling layer was first introduced in (Dinh et al. (2014)). Following (Yu et al. (2019)), we use it as the building block to construct the invertible autoencoder. More specifically, the reshaped input $x$ is divided into two groups, denoted as $x ^ { 1 }$ and $x ^ { 2 }$ , channel-wisely. In its forward pass, one group, e.g. $x ^ { 1 }$ , passes through several convolutional layers and updates the other group, $x ^ { 2 }$ , through addition.
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { r } { \hat { x } ^ { 2 } = x ^ { 2 } + \mathcal { F } _ { 1 } ( x ^ { 1 } ) } \\ { \hat { x } ^ { 1 } = x ^ { 1 } + \mathcal { F } _ { 2 } ( \hat { x } ^ { 2 } ) } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
where $\mathcal { F }$ is a composite non-linear transformation consisting of convolutions and activations, and ${ \hat { x } } ^ { 1 }$ and ${ \hat { x } } ^ { 2 }$ are the updated $x ^ { 1 }$ and $x ^ { 2 }$ . In its backward pass, we can retrieve $x ^ { 1 }$ and $x ^ { 2 }$ from ${ \hat { x } } ^ { 2 }$ and ${ \hat { x } } ^ { 1 }$ by the following inverse computation:
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\begin{array} { r } { x ^ { 1 } = \hat { x } ^ { 1 } - \mathcal { F } _ { 2 } ( \hat { x } ^ { 2 } ) } \\ { x ^ { 2 } = \hat { x } ^ { 2 } - \mathcal { F } _ { 1 } ( x ^ { 1 } ) } \end{array}
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
Pixel shuffle layer (Shi et al. (2016)), a bijective downsampling, is also employed to change the shape of feature from $( w , h , c )$ to $( w / n , h / \bar { n } , c \times n ^ { 2 } )$ to enable the invertibility of the entire network. Stacking these building blocks and downsampling in an alternating fashion between two groups, we will obtain a two-way autoencoder. The property of invertibility ensures no information loss during feature extraction, which is better at preserving the attributes of moving objects. The same network can serve as both the encoder and the decoder by using its forward and backward pass respectively.
|
| 271 |
+
|
| 272 |
+
# C TRAINING SETUP
|
| 273 |
+
|
| 274 |
+
In the deterministic setting, MAC adopts VGG16 (Simonyan & Zisserman (2014)) and a mirrored network as encoder and decoder and 2 layers of residual ConvLSTM as predictor. In the stochastic setting, sMAC replaces its encoder with 24-layer invertible autoencoder and use its backward pass as decoder. Additionally, it also deploys two inference networks composed of 2 layers of ConvLSTM, named prior and posterior, to model conditionally Gaussian distribution of trajectories .
|
| 275 |
+
|
| 276 |
+
We use the Adam optimizer (Kingma & Ba (2014)) with a starting learning rate of $2 \times 1 0 ^ { - 4 }$ to optimize the MAC and sMAC. The training process is stopped after $2 0 0 , 0 0 0$ iterations with the batch size of 4. 20,000 video clips of CLEVR-Building-Blocks and 30,000 of Sapien-Kitchen are generated for model training and additionally 5,000 videos are generated for each dataset for evaluation. Considering the size of Tower-Creation dataset, various traditional data augmentation methods are used and we also implement a new trick in which the neighbouring frames of key frames are sampled from Gaussian distributions to serve as small temporal variations. This trick can significantly improve the visual quality and diversity of stochastic generation for both sMAC and SVG-LP.
|
| 277 |
+
|
| 278 |
+
Table 2: Quantitative measures of object detection on Sapien-Kitchen in terms of average precision.
|
| 279 |
+
|
| 280 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Oven</td><td rowspan=1 colspan=1>Fridge</td><td rowspan=1 colspan=2>DishwashetBottle</td><td rowspan=1 colspan=1>Kettle</td><td rowspan=1 colspan=1>Kitchenpot</td><td rowspan=1 colspan=1>mAP</td></tr><tr><td rowspan=1 colspan=1>MACencoder+SSD</td><td rowspan=1 colspan=1>92.75</td><td rowspan=1 colspan=1>94.56</td><td rowspan=1 colspan=1>90.89</td><td rowspan=1 colspan=1>83.25</td><td rowspan=1 colspan=1>77.18</td><td rowspan=1 colspan=1>81.32</td><td rowspan=1 colspan=1>86.66</td></tr></table>
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 7: Visualization of 2D Object Detection on Sapien-Kitchen.
|
| 284 |
+
|
| 285 |
+
# D OBJECT DETECTION
|
| 286 |
+
|
| 287 |
+
The quantitative results and visualization of object detection is provided in the Table 2 and Fig 7. SSD head was optimized following its protocol while the MAC encoder was frozen to demonstrate that features learnt through self-supervision can be directly transferred for detection because our video prediction task is highly location-dependent.
|
md/dev/OJ4mMfGKLN/OJ4mMfGKLN.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Self-Supervised Contrastive Pre-Training for Time Series via Time-Frequency Consistency
|
| 2 |
+
|
| 3 |
+
Xiang Zhang† ∗ Harvard University xiang_zhang@hms.harvard.edu
|
| 4 |
+
|
| 5 |
+
Ziyuan Zhao∗ Harvard University ziyuanzhao@college.harvard.edu
|
| 6 |
+
|
| 7 |
+
Theodoros Tsiligkaridis MIT Lincoln Laboratory ttsili@ll.mit.edu
|
| 8 |
+
|
| 9 |
+
Marinka Zitnik Harvard University marinka@hms.harvard.edu
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Pre-training on time series poses a unique challenge due to the potential mismatch between pre-training and target domains, such as shifts in temporal dynamics, fast-evolving trends, and long-range and short-cyclic effects, which can lead to poor downstream performance. While domain adaptation methods can mitigate these shifts, most methods need examples directly from the target domain, making them suboptimal for pre-training. To address this challenge, methods need to accommodate target domains with different temporal dynamics and be capable of doing so without seeing any target examples during pre-training. Relative to other modalities, in time series, we expect that time-based and frequencybased representations of the same example are located close together in the timefrequency space. To this end, we posit that time-frequency consistency (TF-C) — embedding a time-based neighborhood of an example close to its frequency-based neighborhood — is desirable for pre-training. Motivated by TF-C, we define a decomposable pre-training model, where the self-supervised signal is provided by the distance between time and frequency components, each individually trained by contrastive estimation. We evaluate the new method on eight datasets, including electrodiagnostic testing, human activity recognition, mechanical fault detection, and physical status monitoring. Experiments against eight state-of-the-art methods show that TF-C outperforms baselines by $1 5 . 4 \%$ (F1 score) on average in one-toone settings (e.g., fine-tuning an EEG-pretrained model on EMG data) and by $8 . 4 \%$ (precision) in challenging one-to-many settings (e.g., fine-tuning an EEG-pretrained model for either hand-gesture recognition or mechanical fault prediction), reflecting the breadth of scenarios that arise in real-world applications. The source code and datasets are available at https://github.com/mims-harvard/TFC-pretraining.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Time series plays important roles in many areas, including clinical diagnosis, traffic analysis, and climate science [1, 2, 3, 4, 5, 6]. While representation learning has considerably advanced analysis of time series [7, 8, 9] more broadly [10], learning generalizable representations for temporal data remains a fundamentally challenging problem [8, 11]. There are numerous immediate benefits from generating such representations, of which pre-training capability is particularly desirable and of great practical importance [12, 13]. Central to pre-training is a question of how to process time series in a diverse dataset to greatly improve generalization on new time series coming from different datasets [14, 15, 10]. By training a neural network model on a dataset and transferring it to a new target dataset for fine-tuning, i.e., without explicit retraining on that target data, we expect the resulting performance to be at least as good as that of state-of-the-art models tailored to the target dataset.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: a. Illustration of Time-Frequency Consistency (TF-C). Time-based embedding $\boldsymbol { z } _ { i } ^ { \mathrm { T } }$ and frequencybased embedding $\boldsymbol { z } _ { i } ^ { \mathrm { F } }$ of time series sample $\pmb { x } _ { i } ^ { \mathrm { T } }$ , along with $\widetilde { z } _ { i } ^ { \mathrm { T } }$ and $\widetilde { z } _ { i } ^ { \mathrm { F } }$ learned from augmentations of $\mathbf { \boldsymbol { x } } _ { i } ^ { \mathrm { { T } } }$ , should e ebe close to each other in the latent time-frequency space. b. Leveraging TF-C property in time series to optimize a pre-training model $\mathcal { F }$ with parameters $\Theta$ that get fine-tuned to $\Phi$ on a small scenario-specific dataset.
|
| 21 |
+
|
| 22 |
+
However, unfortunately, the expected performance gains are often not realized for a variety of reasons (e.g., distribution shifts, properties of the target dataset unknown during pre-training) [16, 17] that get compounded by the complexity of time series: large variations of temporal dynamics across datasets, varying semantic meaning, irregular sampling, system factors (e.g., different devices or subjects), etc. [18, 17]. This complexity of time series limits the utility of knowledge transfer for pre-training [19, 20]. For example, pre-training a model on a diverse time series dataset with mostly low-frequency components (smooth trends) may not lead to positive transfer on downstream tasks with high-frequency components (transient events) [17]. Examining these challenges can provide clues to what kind of inductive biases could facilitate generalizable representations of time series – this paper offers a strategy for that through a novel time-frequency consistency principle.
|
| 23 |
+
|
| 24 |
+
In addition, target datasets are not available during pre-training (different from domain adaption [21]; Appendix A), requiring that the pre-training model captures a latent property that holds true for previously unseen target datasets. At the center of this desideratum is the idea of a property that would be shared between pre-training and target datasets and would enable knowledge transfer from pre-training to fine-tuning. In computer vision (CV), pre-training is driven by findings that initial neural layers capture universal visual elements, such as edges and shapes, that are relevant regardless of image style and tasks [22]. In natural language processing (NLP), the foundation for pre-training is given by linguistic principles of semantics and grammar shared across different languages [23]. However, due to the aforementioned temporal complexity, such a principle for pre-training on time series has not yet been established. Moreover, supervised pre-training requires access to large annotated datasets, which limits its use in domains where richly labeled datasets are scarce [24, 25]. For example, in medical applications, labeling data at scale is often infeasible or can be expensive and noisy (experts can disagree on ground-truth labeling [26, 27], e.g., whether an ECG signal indicates a normal vs. abnormal rhythm) [28, 29]. To mitigate these issues, self-supervised learning emerged as a promising strategy to sidestep the lack of labeled datasets [30].
|
| 25 |
+
|
| 26 |
+
Present work. We introduce a strategy for self-supervised pre-training in time series by modeling Time-Frequency Consistency (TF-C). TF-C specifies that time-based and frequency-based representations, learned from the same time series sample, should be closer to each other in the time-frequency space than representations of different time series samples. Specifically, we adopt contrastive learning in time-space to generate a time-based representation. In parallel, we propose a set of novel augmentations based on the characteristic of the frequency spectrum and produce a frequency-based embedding through contrastive instance discrimination. This is the first work to develop frequencybased contrastive augmentation to leverage rich spectral information and explore time-frequency consistency in time series. The pre-training objective is to minimize the distance between time-based and frequency-based embeddings using a novel consistency loss (Figure 1 (a)). The self-supervised loss is used to optimize the pre-training model and enforce consistency between time and frequency domains in the latent space. The learned relationship encoded in model parameters are transferred to initialize the fine-tuning model and improve performance in datasets of interest (Figure 1 (b)).
|
| 27 |
+
|
| 28 |
+
We evaluate the TF-C model on eight time series datasets under two evaluation settings (i.e., oneto-one and one-to-many). The eight datasets cover a large set of variations: different numbers of channels (from univariate to 9-channel multivariate), varying time series lengths (from 128 to 5,120), different sampling rates (from $1 6 \ \mathrm { H z }$ to $4 { , } 0 0 0 ~ \mathrm { H z }$ ), different scenarios (neurological healthcare, human activity recognition, mechanical fault detection, physical status monitoring, etc.) and diverse types of signals (EEG, EMG, ECG, acceleration, and vibration). We compare TF-C approach to eight state-of-the-art baselines. Results show that TF-C achieves positive transfer, outperforming all baselines by a large margin of $1 5 . 4 \%$ (F1 score) on average. Further, the approach outperforms the strongest baselines with an improvement of up to $7 . 2 \%$ in the F1 score. Finally, the TF-C approach improves prior work by $8 . 4 \%$ in precision (when pre-training the model on sleep EEG signals and fine-tuning it on hand-gesture recognition) in challenging one-to-many setups that apply the same pre-trained model to multiple independent fine-tuning datasets.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Pre-training for time series. Although there are studies on self-supervised representation learning for time series [7, 8, 31, 32] and self-supervised pre-training for images [33, 34, 35, 24], the intersection of these two areas, i.e., self-supervised pre-training for time series, remains underexplored. In time series, it’s not obvious what reasonable assumptions can bridge pre-training and target datasets. Hence, pre-training models in CV [36, 37, 14] and NLP [10, 15, 38] are not directly applicable due to data modality mismatch, and the existing results leave room for improvement [31, 39, 40]. Shi et al. [12] developed the only model to date that is explicitly designed for self-supervised time series pre-training. The model captures the local and global temporal pattern, but it is not convincing why the designed pretext task can capture generalizable representations. Although several studies applied transfer learning in the context of time series [7, 8, 18, 41], there is no foundation yet of which conceptual properties are most suitable for pre-training on time series and why. Addressing this gap, we show that TF-C, designed to be invariant to different time-series datasets, can produce generalizable pre-training models.
|
| 33 |
+
|
| 34 |
+
Unlike domain adaptation [21, 42] that requires access to target datasets during training, pre-training models do not have access to fine-tuning datasets. As a result, one needs to identify a generalizable time-series property to benefit from pre-training. Further, self-supervised domain adaptation does not need labels in the target dataset but still requires labels for model training [43, 44]. In contrast, TF-C does not need any labels during pre-training.
|
| 35 |
+
|
| 36 |
+
Contrastive learning with time series. Contrastive learning, a popular type of self-supervised learning, aims to learn an encoder that maps inputs into an embedding space such that positive sample pairs (original augmentation and another alternative augmentation/view of the same input sample) are pulled closer and negative sample pairs (original augmentation and an alternative input sample augmentation) are pushed apart [30, 45]. Contrastive learning in time series is less investigated in comparison, partly due to the challenge of identifying augmentations that capture key invariance properties in time series data. For example, CLOCS defines adjacent time segments as positive pairs [41], and TNC assumes overlapping temporal neighborhoods have similar representations [46]. These methods leverage temporal invariance to define positive pairs which are used to calculate contrastive loss, but other invariances, such as transformation invariance (e.g., SimCLR [40]), contextual invariance (e.g., TS2vec [47] and TS-TCC [48]) and augmentations are possible. In this work, we propose an augmentation bank that exploits multiple invariances to generate diverse augmentations (Sec. 4.1), which adds richness to the pre-training model [48]. Importantly, we propose frequencybased augmentations by perturbing the frequency spectrum of time series (e.g., adding or removing the frequency components and manipulating their amplitude; more details in Sec. 4.2) to learn better representations by exposing the model to a local range of frequency variations. In previous work, CoST processes sequential signals through the frequency domain, but the augmentations are still implemented in time space [49]. Similarly, although BTSF [50] involves frequency domain, its data transformation is solely implemented in the time domain using instance-level dropout. Additional commentary on differences between CoST and BTSF is in Appendix B. To the best of our knowledge, this is the first work that directly perturbs the frequency spectrum to leverage frequency-invariance for contrastive learning. Further, we develop a pre-training model that subjects to TF-C upon two individual contrastive encoders.
|
| 37 |
+
|
| 38 |
+
# 3 Problem Formulation
|
| 39 |
+
|
| 40 |
+
We are given a pre-training dataset $\mathcal { D } ^ { \mathrm { p r e t } } = \{ { \pmb x } _ { i } ^ { \mathrm { p r e t } } \ | \ i = 1 , \ldots , N \}$ of unlabeled time series samples where sample $\pmb { x } _ { i } ^ { \mathrm { p r e t } }$ has $K ^ { \mathrm { p r e t } }$ channels and $L ^ { \mathrm { p r e t } }$ timestamps. Let ${ \mathcal { D } } ^ { \mathrm { u n e } } = \{ ( { \pmb x } _ { i } ^ { \mathrm { t u n e } } , y _ { i } ) \ | \ i = 1 , \ldots , M \}$ be a fine-tuning (i.e., target; target and fine-tuning are used interchangeably) dataset of labeled time series samples, each having $K ^ { \mathrm { t u n e } }$ channels and $L ^ { \mathrm { t u n e } }$ timestamps. Furthermore, every sample ${ \pmb x } _ { i } ^ { \mathrm { t u n e } }$ is associated with a label $y _ { i } \in \{ 1 , \ldots , C \}$ , where $C$ is the number of classes. Without loss of generality, in the following descriptions, we focus on univariate (single-channel) time series, while noting that our approach can accommodate multivariate time series of varying lengths across datasets (shown in experiments in Sec. 5.2). We use superscript symbol to denote contrastive augmentations. We note that ${ \pmb x } _ { i } ^ { \mathrm { T } } \equiv { \pmb x } _ { i }$ edenotes an input time series sample, and $\pmb { x } _ { i } ^ { \mathrm { F } }$ denotes discrete frequency spectrum of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$
|
| 41 |
+
|
| 42 |
+
Problem (Self-Supervised Contrastive Pre-Training For Time Series). Given are an unlabeled pre-training dataset $\mathcal { D } ^ { p r e t }$ with $N$ samples and a target dataset $\mathcal { D } ^ { t u n e }$ with $M$ samples $( M \ll N ,$ ). The goal is to use $\mathcal { D } ^ { p r e t }$ to pre-train a model $\mathcal { F }$ so that by fine-tuning model parameters on $\mathcal { D } ^ { t u n e }$ , the fine-tuned model produces generalizable representations $z _ { i } ^ { t u n e } = \mathcal { F } ( \mathbf { x } _ { i } ^ { t u n e } )$ for every $\pmb { x } _ { i } ^ { t u n e }$ .
|
| 43 |
+
|
| 44 |
+
We follow an established setup, e.g., [41]: for pre-training, only the unlabeled dataset $\mathcal { D } ^ { \mathrm { p r e t } }$ is available while, for fine-tuning, a small labeled dataset $\mathcal { D } ^ { \mathrm { t u n e } }$ can be used. In short, a model $\mathcal { F }$ is pre-trained on the unlabeled time series dataset $\mathcal { D } ^ { \mathrm { p r e t } }$ and its optimized model parameters $\Theta$ are fine-tuned to go from $\mathcal { F } ( \cdot , \Theta )$ to $\mathcal { F } ( \cdot , \Phi )$ using the dataset $\mathcal { D } ^ { \mathrm { t u n e } }$ . The $\Phi$ denotes fine-tuned model parameters. Note that this problem (i.e., $\mathcal { D } ^ { \mathrm { p r e t } }$ is independent of the target dataset) is distinct from domain adaptation as fine-tuning dataset $\mathcal { D } ^ { \mathrm { t u n e } }$ is not accessed during pre-training. As a result, the pre-trained model can be used with many different fine-tuning datasets without re-training.
|
| 45 |
+
|
| 46 |
+
Rationale for Time-Frequency Consistency (TF-C). The central idea is to identify a general property that is preserved across time series datasets and use it to induce transfer learning for effective pre-training. The time domain shows how sensor readouts change with time, whereas the frequency domain shows how much of the signal lies within each frequency component over the entire spectrum [51]. Explicitly considering the frequency domain can provide an understanding of time series behavior that cannot be directly captured solely in the time domain [52]. However, existing contrastive methods (e.g., [47, 48]) focus exclusively on modeling the time domain and ignore the frequency domain altogether. One can argue that approach is sufficient in the case of high-capacity methods as time and frequency domains are different views of the same data [53], which can be cross-translated using transformation, such as Fourier and inverse Fourier [54, 52]. The relationship between the two domains, grounded in signal processing theory, provides an invariance that is valid regardless of the time series distribution [55, 56] and thus can serve as an inductive bias for pretraining. Appendix C provides a commentary with analogies for images. Approaching this invariance through the lens of representation learning, we next formulate Time-Frequency Consistency (TF-C). The TF-C property postulates there exists a latent time-frequency space such that for every sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , time-based representation $z _ { i } ^ { \mathrm { T } }$ and frequency-based representation $z _ { i } ^ { \mathrm { F } }$ of the same sample, together with their local augmentations (defined later), are close to each other in the latent space.
|
| 47 |
+
|
| 48 |
+
Representational Time-Frequency Consistency (TF-C). Let $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ be a time series and $\mathcal { F }$ be a model satisfying TF-C. Then, time-based representation $z _ { i } ^ { \mathrm { T } }$ and frequency-based representation $z _ { i } ^ { \mathrm { F } }$ as well as representations of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ ’s local augmentations are proximal in the latent time-frequency space.
|
| 49 |
+
|
| 50 |
+
Our strategy is to use dataset $\mathcal { D } ^ { \mathrm { p r e t } }$ to induce TF-C in $\mathcal { F }$ ’s model parameters $\Theta$ , which, in turn, are used to initialize the target model on $\mathcal { D } ^ { \mathrm { t u n e } }$ and produce generalizable representations for downstream prediction. The invariant nature of TF-C means that the approach can bridge $\mathcal { D } ^ { \mathrm { p r e t } }$ and $\mathcal { D } ^ { \mathrm { t u n e } }$ even when large discrepancies exist between them (in terms of temporal dynamics, semantic meaning, etc.), providing a vehicle for a general pre-training on time series.
|
| 51 |
+
|
| 52 |
+
To realize TF-C, our model $\mathcal { F }$ has four components (Figure 2): a time encoder $G _ { \mathrm { T } }$ , a frequency encoder $G _ { \mathrm { F } }$ , and two cross-space projectors $R _ { \mathrm { T } }$ and $R _ { \mathrm { F } }$ that map time-based and frequency-based representations, respectively, to the same time-frequency space. Together, the four components provide a way to embed $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ to the latent time-frequency space such that the time-based embedding $\mathsf { \bar { z } } _ { i } ^ { \mathrm { T } } = R _ { \mathrm { T } } ( G _ { \mathrm { T } } ( \pmb { x } _ { i } ^ { \mathrm { T } } ) )$ and the frequency-based embedding $\pmb { z } _ { i } ^ { \tilde { \mathrm { F } } } = R _ { \mathrm { F } } ( G _ { \mathrm { F } } ( \pmb { x } _ { i } ^ { \mathrm { F } } ) )$ are close together.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Overview of TF-C approach. Our TF-C pre-training model $\mathcal { F }$ has four components: a time encoder $G _ { \mathrm { T } }$ , a frequency encoder $G _ { \mathrm { { F } } }$ , and two cross-space projectors $R _ { \mathrm { T } }$ and $R _ { \mathrm { F } }$ . For an input time series ${ \bf { x } } _ { i }$ , the model produces time-based representations (i.e., $\boldsymbol { z } _ { i } ^ { \intercal }$ and $\widetilde { z } _ { i } ^ { \mathrm { T } }$ of input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and its augmented version, respectively) and frequency-based representations (i.e., $\boldsymbol { z } _ { i } ^ { \mathrm { F } }$ and $\widetilde { z } _ { i } ^ { \mathrm { F } }$ eof input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and its augmented version, respectively). The TF-C eproperty is realized by promoting the alignment of time- and frequency-based representations in the latent time-frequency space, providing a vehicle for transferring $\mathcal { F }$ to a target dataset not seen before.
|
| 56 |
+
|
| 57 |
+
# 4 Our Approach
|
| 58 |
+
|
| 59 |
+
Next, we present the architecture of the developed self-supervised contrastive pre-training model $\mathcal { F }$ . Unless specified otherwise, the data mentioned in this section are from pre-training dataset and the superscript $\mathrm { p r e t }$ is omitted for simplification. Here we describe the model using univariate time series as an example, but our model can be straightforwardly applied to multivariate time series (Sec 5).
|
| 60 |
+
|
| 61 |
+
# 4.1 Time-based Contrastive Encoder
|
| 62 |
+
|
| 63 |
+
For a given input time series sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , we generate an augmentation set $\mathcal { X } _ { i } ^ { \mathrm { { T } } }$ through a time-based augmentation bank $B ^ { \mathrm { { r } } } : { \pmb x } _ { i } ^ { \mathrm { { r } } } \mathcal { X } _ { i } ^ { \mathrm { { r } } }$ . Each element $\widetilde { \pmb x } _ { i } ^ { \mathrm { T } } \ \in \ \mathcal { X } _ { i } ^ { \mathrm { T } }$ is augmented from $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ based on ethe temporal characteristics. Here, the time-based augmentation bank includes jittering, scaling, time-shifts, and neighborhood segments, all well-established in contrastive learning [40, 48, 41]. We develop an augmentation bank to produce diverse augmentations (rather than a single type of augmentation) and expose the model to complex temporal dynamics, which produces more robust time-based embeddings [48].
|
| 64 |
+
|
| 65 |
+
For the input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , we randomly select an augmented sample $\widetilde { \pmb x } _ { i } ^ { \mathrm { T } } \in \mathcal { X } _ { i } ^ { \mathrm { T } }$ and feed into a contrastive time encoder $G _ { \mathrm { T } }$ that maps samples to embeddings. We have ${ h } _ { i } ^ { \mathrm { T } } = { G } _ { \mathrm { T } } ( { \pmb x } _ { i } ^ { \mathrm { T } } )$ and $\widetilde { \pmb { h } } _ { i } ^ { \mathrm { T } } = \pmb { G } _ { \mathrm { T } } ( \widetilde { \pmb { x } } _ { i } ^ { \mathrm { T } } )$ . As $\widetilde { \pmb { x } } _ { i } ^ { \mathrm { T } }$ is generated based on $\pmb { x } _ { i } ^ { \mathrm { T } }$ , after passing through $G _ { \mathrm { r } }$ , we assume the embedding of $\pmb { x } _ { i } ^ { \mathrm { T } }$ eis close to ethe embedding of $\widetilde { \pmb { x } } _ { i } ^ { \mathrm { T } }$ but far away from the embedding of $\pmb { x } _ { j } ^ { \mathrm { T } }$ and $\widetilde { \pmb { x } } _ { j } ^ { \mathrm { T } }$ that are derived from another sample $\pmb { x } _ { j } ^ { \mathrm { { T } } } \in \mathcal { D } ^ { \mathrm { p r e t } }$ e e[34, 47, 41]. In specific, we select the positive pair as $( \pmb { x } _ { i } ^ { \mathrm { T } } , \widetilde { \pmb { x } } _ { i } ^ { \mathrm { T } } )$ and negative pairs as $( \pmb { x } _ { i } ^ { \mathrm { scriptscriptstyle T } } , \pmb { x } _ { j } ^ { \mathrm { \scriptscriptstyle T } } )$ and $( \pmb { x } _ { i } ^ { \mathrm { scriptscriptstyle T } } , \widetilde { \pmb { x } } _ { j } ^ { \mathrm { \scriptscriptstyle T } } )$ [34].
|
| 66 |
+
|
| 67 |
+
Contrastive time loss. To maximize the similarity within a positive pair and minimize the similarity within a negative pair, we adopt the NT-Xent (the normalized temperature-scaled cross entropy loss) as distance function $d$ which is widely used in contrastive learning [34, 40]. In specific, we define the loss function of the time-based contrastive encoder in terms of sample $\pmb { x } _ { i } ^ { \mathrm { T } }$ as:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal { L } _ { \mathrm { T } , i } = d ( h _ { i } ^ { \mathrm { T } } , \widetilde { h } _ { i } ^ { \mathrm { r } } , \mathcal { D } ^ { \mathrm { p r e t } } ) = - \log \frac { \exp ( \sin ( h _ { i } ^ { \mathrm { T } } , \widetilde { h } _ { i } ^ { \mathrm { T } } ) / \tau ) } { \sum _ { x _ { j } \in \mathcal { D } ^ { \mathrm { p r e t } } } \mathbb { 1 } _ { i \neq j } \exp ( \sin ( h _ { i } ^ { \mathrm { T } } , G _ { \mathrm { T } } ( x _ { j } ) ) / \tau ) } ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\sin ( \pmb { u } , \pmb { v } ) = \pmb { u } ^ { T } \pmb { v } / \left\| \pmb { u } \right\| \left\| \pmb { v } \right\|$ denotes the cosine similarity, the $\mathbb { 1 } _ { i \neq j }$ is an indicator function that equals to 0 when $i = j$ and 1 otherwise, and $\tau$ is a temporal parameter to adjust scale. The $\pmb { x } _ { j } \in \mathcal { D } ^ { \mathrm { p r e t } }$ refers to a different time series sample or its augmented sample. This loss function
|
| 74 |
+
|
| 75 |
+
urges the time encoder $G _ { \mathrm { T } }$ to generate closer time-based embeddings for positive pairs and push the embeddings for negative pairs apart from each other.
|
| 76 |
+
|
| 77 |
+
# 4.2 Frequency-based Contrastive Encoder
|
| 78 |
+
|
| 79 |
+
We generate the frequency spectrum $\pmb { x } _ { i } ^ { \mathrm { F } }$ from a time series sample $\mathbf { \boldsymbol { x } } _ { i } ^ { \mathrm { { T } } }$ through a transform operator (e.g., Fourier Transformation [54]). The frequency information in time series is universal and plays a key role in classic signal processing [57, 53, 55], but it is rarely investigated in self-supervised contrastive representation learning for time series [58]. In this section, we develop augmentation method to perturb $\pmb { x } _ { i } ^ { \mathrm { F } }$ based on characteristics of frequency spectra and show how to generate frequency-based representations.
|
| 80 |
+
|
| 81 |
+
As every frequency component in the frequency spectrum denotes a basis function (e.g., sinusoidal function for Fourier transformation) with the corresponding frequency and amplitude, we perturb the frequency spectrum by adding or removing frequency components. A small perturbation in the frequency domain may cause large changes to the temporal patterns in the time domain [55]. To make sure the perturbed time series is still similar to the original sample (not only in frequency domain but also in time domain; Figure 6), we use a small budget $E$ in the perturbations where $E$ denotes the number of frequency components we manipulate. While removing frequency components, we randomly select $E$ frequency components and set their amplitudes to 0. While adding frequency components, we randomly choose $E$ frequency components from the ones have smaller amplitude than $\alpha \cdot A _ { m }$ , and increase their amplitude to $\alpha \cdot A _ { m }$ . The $A _ { m }$ is the maximum amplitude in the frequency spectrum and $\alpha$ is a pre-defined coefficient to adjust the scale of the perturbed frequency component $\mathrm { \Delta } ( \alpha = 0 . 5$ in this work). We produce an augmentation set $\mathcal { X } _ { i } ^ { \mathrm { F } }$ for $\pmb { x } _ { i } ^ { \mathrm { F } }$ through frequencyaugmentation bank $B ^ { \mathrm { F } } : { \pmb x } _ { i } ^ { \mathrm { F } } \mathcal { X } _ { i } ^ { \mathrm { F } }$ . As described above, we have two augmentation methods (i.e., removing or adding frequency components) in $B ^ { \mathrm { F } }$ , $| \mathcal { X } _ { i } ^ { \mathrm { F } } | = 2$ . Details on the exploration of frequency augmentation strategies are covered in Appendix J.
|
| 82 |
+
|
| 83 |
+
We utilize a frequency encoder $G _ { \mathrm { F } }$ to map the frequency spectrum $( e . g . , \pmb { x } _ { i } ^ { \mathrm { F } } ,$ to a frequency-based embedding (e.g., $\pmb { h } _ { i } ^ { \mathrm { F } } \overset { \cdot } { = } G _ { \mathrm { F } } ( \pmb { x } _ { i } ^ { \mathrm { F } } ) )$ . We assume the frequency encoder $G _ { \mathrm { F } }$ can learn similar embedding for the original frequency spectrum $\pmb { x } _ { i } ^ { \mathrm { F } }$ and a slightly perturbed frequency spectrum $ { \widetilde { \mathbf { x } } } _ { i } ^ { \mathrm { F } } \in { \mathcal { X } } _ { i } ^ { \mathrm { F } }$ . Thus, we set the positive pair as $( \pmb { x } _ { i } ^ { \mathrm { F } } , \widetilde { \pmb { x } } _ { i } ^ { \mathrm { F } } )$ and the negative pairs as $( \pmb { x } _ { i } ^ { \mathrm { F } } , \pmb { x } _ { j } ^ { \mathrm { F } } )$ and $( \pmb { x } _ { i } ^ { \mathrm { F } } , \widetilde { \pmb { x } } _ { j } ^ { \mathrm { F } } )$ .
|
| 84 |
+
|
| 85 |
+
Contrastive frequency loss. We calculate frequency-based contrastive loss for sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ as:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathcal { L } _ { \mathrm { F } , i } = d ( h _ { i } ^ { \mathrm { F } } , \widetilde { h } _ { i } ^ { \mathrm { F } } , \mathcal { D } ^ { \mathrm { p r e t } } ) = - \log \frac { \exp ( \sin ( h _ { i } ^ { \mathrm { F } } , \widetilde { h } _ { i } ^ { \mathrm { F } } ) / \tau ) } { \sum _ { x _ { j } \in \mathcal { D } ^ { \mathrm { p r e t } } } \mathbb { 1 } _ { i \neq j } \exp ( \sin ( h _ { i } ^ { \mathrm { F } } , G _ { \mathrm { F } } ( x _ { j } ) ) / \tau ) } .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
In preliminary experiments, we find that the value of $\tau$ has little effect on performance and use the same $\tau$ throughout all experiments. The $\mathcal { L } _ { \mathrm { F } , i }$ yield a frequency encoder $G _ { \mathrm { F } }$ producing embeddings invariant to frequency spectrum perturbations.
|
| 92 |
+
|
| 93 |
+
# 4.3 Time-Frequency Consistency
|
| 94 |
+
|
| 95 |
+
We develop a consistency loss item $\mathcal { L } _ { \mathrm { C } , i }$ to urge the learned embeddings to satisfy TF-C: for a given sample, its time-based and frequency-based embeddings (and their local neighborhoods) are supposed to be close to each other (see Sec. 3 for justification). To make sure the distance between embeddings is measurable, we map ${ \mathbf { } } h _ { i } ^ { \mathrm { { T } } }$ from time space and $\boldsymbol { h } _ { i } ^ { \mathrm { F } }$ from frequency space to a joint time-frequency space through projectors $R _ { \mathrm { T } }$ and $R _ { \mathrm { F } }$ , respectively. In specific, for every input sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , we have four embeddings, which are $z _ { i } ^ { \mathrm { T } } = R _ { \mathrm { T } } ( h _ { i } ^ { \mathrm { T } } )$ , $\widetilde z _ { i } ^ { \mathrm { T } } = \dot { R } _ { \mathrm { T } } ( \widetilde h _ { i } ^ { \mathrm { T } } )$ , $z _ { i } ^ { \mathrm { F } } = R _ { \mathrm { F } } ( h _ { i } ^ { \mathrm { F } } )$ , and $\widetilde { z } _ { i } ^ { \mathrm { F } } = R _ { \mathrm { F } } ( \widetilde { h } _ { i } ^ { \mathrm { F } } )$ . The first e etwo embeddings are generated based on temporal characteristics and the latter two embeddings are produced based on the properties of frequency spectrum.
|
| 96 |
+
|
| 97 |
+
To enforce the embeddings in the time-frequency space subject to TF-C, we design a consistency loss $\mathcal { L } _ { \mathrm { C } , i }$ that measures the distance between a time-based embedding and a frequency-based embedding. We use $S _ { i } ^ { \mathrm { T F } } = d ( z _ { i } ^ { \mathrm { T } } , z _ { i } ^ { \mathrm { F } } , \mathcal { D } ^ { \mathrm { p r e t } } )$ to denote the distance between $z _ { i } ^ { \mathrm { T } }$ and $z _ { i } ^ { \mathrm { F } }$ ). Similarly, we define $S _ { i } ^ { \mathrm { T F } }$ $S _ { i } ^ { \mathrm { { \widetilde T F } } }$ , and $\widetilde { S _ { i } ^ { \mathrm { T F } } }$ . Note, in this time-frequency space, we don’t consider the distance between $z _ { i } ^ { \mathrm { T } }$ and $\widetilde { z } _ { i } ^ { \mathrm { T } }$ ewhere the two embeddings are from the same domain (i.e., time domain). The same applies to pair the distance between $z _ { i } ^ { \mathrm { F } }$ and $\widetilde { z } _ { i } ^ { \mathrm { F } }$ . We have already considered information of above two pairs in the calculation of $\mathcal { L } _ { \mathrm { T } , i }$ and $\mathcal { L } _ { \mathrm { F } , i }$ .
|
| 98 |
+
|
| 99 |
+
Next, let’s closely observe $S _ { i } ^ { \mathrm { T F } }$ and $S _ { i } ^ { \mathrm { T F } }$ that involve three embeddings: $z _ { i } ^ { \mathrm { T } }$ , $z _ { i } ^ { \mathrm { F } }$ , and $\widetilde { z } _ { i } ^ { \mathrm { F } }$ . Here, $z _ { i } ^ { \mathrm { T } }$ and $z _ { i } ^ { \mathrm { F } }$ are learned from the original sample $( \pmb { x } _ { i } ^ { \mathrm { T } }$ and $\pmb { x } _ { i } ^ { \mathrm { F } }$ ) while $\widetilde { z } _ { i } ^ { \mathrm { F } }$ eis learned from the augmented $\widetilde { \pmb { x } } _ { i } ^ { \mathrm { F } }$ . Thus, intuitively, $z _ { i } ^ { \mathrm { T } }$ should be closer to $z _ { i } ^ { \mathrm { F } }$ in comparison to $\widetilde { z } _ { i } ^ { \mathrm { F } }$ e e. Motivated by the relative relationship, we encourage the proposed model to learn a $S _ { i } ^ { \mathrm { T F } }$ ethat is smaller than $S _ { i } ^ { \mathrm { T F } }$ . Inspired by the triplet loss [59], we design $( S _ { i } ^ { \mathrm { T F } } - S _ { i } ^ { \mathrm { T F } } + \delta )$ as a term of consistency loss $\mathcal { L } _ { \mathrm { c } , i }$ where $\delta$ is a given constant margin to keep negative samples far apart [60]. This term optimizes the model towards a smaller $S _ { i } ^ { \mathrm { T F } }$ and relatively larger $S _ { i } ^ { \mathrm { T F } }$ . Similarly, $S _ { i } ^ { \mathrm { T F } }$ is supposed to be smaller than $S _ { i } ^ { \mathrm { { \widetilde T F } } }$ and $\widetilde { S _ { i } ^ { \mathrm { T F } } }$ . In summary, we calculate the consistency loss $\mathcal { L } _ { \mathrm { c } , i }$ for sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ by:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathcal { L } _ { \mathrm { c } , i } = \sum _ { S ^ { \mathrm { p a i r } } } ( S _ { i } ^ { \mathrm { T F } } - S _ { i } ^ { \mathrm { p a i r } } + \delta ) , \quad S ^ { \mathrm { p a i r } } \in \{ S _ { i } ^ { \mathrm { T F } } , S _ { i } ^ { \mathrm { T F } } , S _ { i } ^ { \mathrm { \widetilde { T F } } } \} ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $S _ { i } ^ { \mathrm { p a i r } }$ denotes the distance between a time-based embedding (e.g., $z _ { i } ^ { \mathrm { T } }$ or $\widetilde { z } _ { i } ^ { \mathrm { T } }$ ) and a frequencybased embedding (e.g., $z _ { i } ^ { \mathrm { F } }$ or $\widetilde { z } _ { i } ^ { \mathrm { F } }$ e). In each pair, there is at least one embedding that is derived from eaugmented sample instead of the original sample. The $\delta$ is a pre-defined constant. By combining all the triplet loss items, ${ \mathcal { L } } _ { \mathrm { c } }$ encourages the pre-training model to capture the consistency between time-based and frequency-based embeddings in model optimization. Note, although the Eq. 3 does not explicitly measure the loss across different time series samples (e.g., $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { j } }$ ), the cross-sample relationships are implicitly covered in the calculation of $S _ { i } ^ { \mathrm { T F } }$ and $S _ { i } ^ { \mathrm { p a i r } }$ .
|
| 106 |
+
|
| 107 |
+
# 4.4 Implementation and Technical Details
|
| 108 |
+
|
| 109 |
+
The overall loss function in pre-training has three terms. First, the time-based contrastive loss ${ \mathcal { L } } _ { \mathrm { T } }$ urges the model to learn embeddings invariant to temporal augmentations. Second, the frequencybased contrastive loss $\mathcal { L } _ { \mathrm { F } }$ promotes learning of embeddings invariant to frequency spectrum-based augmentations. Third, the consistency loss ${ \mathcal { L } } _ { \mathrm { c } }$ guides the model to retain the consistency between time-based and frequency-based embeddings. In summary, the pre-training loss is defined as:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
{ \mathcal { L } } _ { \mathrm { T F } - \mathbb { C } , i } = \lambda ( { \mathcal { L } } _ { \mathrm { T } , i } + { \mathcal { L } } _ { \mathrm { F } , i } ) + ( 1 - \lambda ) { \mathcal { L } } _ { \mathrm { c } , i }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $\lambda$ controls the relative importance of the contrastive and consistency losses. We calculate the total loss by summing $\mathcal { L } _ { \mathrm { T F - C } , i }$ across all pre-training samples. In implementation, the contrastive losses are calculated within the batch. From our problem definition, the model $\mathcal { F }$ we want to learn is the combination of neural networks $G _ { \mathrm { T } } , R _ { \mathrm { T } } , G _ { \mathrm { F } }$ , and $R _ { \mathrm { F } }$ . When pre-training is completed, we store parameters of entire model, and denote it as $\mathcal { F } ( \cdot , \Theta )$ where $\Theta$ represents all trainable parameters. When a sample ${ \pmb x } _ { i } ^ { \mathrm { t u n e } }$ is presented, fine-tuned model $\mathcal { F }$ generates an embedding $z _ { i } ^ { \mathrm { t u n e } }$ via concatenation as: $z _ { i } ^ { \mathrm { t u n e } } = \mathcal { F } ( \pmb { x } _ { i } ^ { \mathrm { t u n e } } , \Phi ) = [ z _ { i } ^ { \mathrm { t u n e , T } } ; z _ { i } ^ { \mathrm { t u n e , F } } ]$ where $\Phi$ are fine-tuned model’s parameters.
|
| 116 |
+
|
| 117 |
+
# 5 Experiments
|
| 118 |
+
|
| 119 |
+
We compare the developed TF-C model with 10 baselines on 8 diverse datasets. We investigate the time series classification tasks in the context of one-to-one and one-to-many transfer learning setups (the many-to-one setting is fundamentally different as discussed in Appendix K). We also assess TF-C in extensive downstream tasks including clustering and anomaly detection.
|
| 120 |
+
|
| 121 |
+
Datasets. (1) SLEEPEEG [61] has 371,055 univariate brainwaves (EEG; $1 0 0 \mathrm { H z } ,$ ) collected from 197 individuals. Each sample is associated with one of five sleeping stages. (2) EPILEPSY [62] monitors the brain activities of 500 subjects with single-channel EEG sensor $\boldsymbol { 1 7 4 } \ : \mathrm { H z } )$ . A sample is labeled in binary based on whether the subject has epilepsy or not. (3) FD-A [63] gathers the vibration signals from rolling bearing from a mechanical system aiming at fault detection. Every sample has 5,120 timestamps and an indicator for one out of three mechanical device states. (4) FD-B [63] has the same setting as the FD-A but the rolling bearings are performed in different working conditions (e.g., varying rotational speed). (5) HAR [64] has 10,299 9-dimension samples from 6 daily activities. (6) GESTURE [65] includes 440 samples that are collected from 8 hand gestures recorded by an accelerometer. (7) ECG [26] contains 8,528 single-sensor ECG recordings with sorted into four classes based on human physiology. (8) EMG [66] consists of 163 EMG samples with 3-class labels implying muscular diseases. Dataset labels are not used in pre-training. Further dataset statistics are in Appendix $\mathrm { D }$ and Table 3.
|
| 122 |
+
|
| 123 |
+
Baselines. We consider 10 baseline methods. This includes 8 state-of-the-art methods: TS-SD [12], TS2vec [47], CLOCS [41], Mixing-up [18], TS-TCC [48], SimCLR [40], TNC [46], and CPC [30].
|
| 124 |
+
|
| 125 |
+
Table 1: One-to-one pre-training evaluation (Scenario 3). Pre-training is performed on HAR, followed by fine-tuning on GESTURE. Results for other three scenarios are shown in Tables 4-6.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Models</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 score</td><td>AUROC</td><td>AUPRC</td></tr><tr><td>Non-DL (KNN)</td><td>0.6766±0.0000</td><td>0.6500±0.0000</td><td>0.6821±0.0000</td><td>0.6442±0.0000</td><td>0.8190±0.0000</td><td>0.5231±0.0000</td></tr><tr><td>Random Init.</td><td>0.4219±0.0865</td><td>0.4751±0.0925</td><td>0.4963±0.1026</td><td>0.4886±0.0967</td><td>0.7129±0.1206</td><td>0.3358±0.1194</td></tr><tr><td>TS-SD</td><td>0.6937±0.0533</td><td>0.6806±0.0496</td><td>0.6883±0.0525</td><td>0.6785±0.0495</td><td>0.8708±0.0305</td><td>0.6261±0.0790</td></tr><tr><td>TS2vec</td><td>0.6453±0.0260</td><td>0.6287±0.0339</td><td>0.6451±0.0218</td><td>0.6261±0.0294</td><td>0.8890±0.0054</td><td>0.6670±0.0118</td></tr><tr><td>CLOCS</td><td>0.4731±0.0229</td><td>0.4639±0.0432</td><td>0.4766±0.0266</td><td>0.4392±0.0198</td><td>0.8161±0.0068</td><td>0.4916±0.0103</td></tr><tr><td>Mixing-up</td><td>0.7183±0.0123</td><td>0.7001±0.0166</td><td>0.7183±0.0123</td><td>0.6991±0.0145</td><td>0.9127±0.0018</td><td>0.7654±0.0071</td></tr><tr><td>TS-TCC</td><td>0.7593±0.0242</td><td>0.7668±0.0257</td><td>0.7566±0.0231</td><td>0.7457±0.0210</td><td>0.8866±0.0040</td><td>0.7217±0.0121</td></tr><tr><td>SimCLR</td><td>0.4383±0.0652</td><td>0.4255±0.1072</td><td>0.4383±0.0652</td><td>0.3713±0.0919</td><td>0.7721±0.0559</td><td>0.4116±0.0971</td></tr><tr><td>TF-C (Ours)</td><td>0.7824±0.0237</td><td>0.7982±0.0496</td><td>0.8011±0.0322</td><td>0.7991±0.0296</td><td>0.9052±0.0136</td><td>0.7861±0.0149</td></tr></table>
|
| 128 |
+
|
| 129 |
+
The TS2Vec, TS-TCC, SimCLR, TNC, and CPC are designed for representation learning on a single dataset rather than for transfer learning, so we apply them to fit our settings and make the results comparable. As the training of TNC and CPC are very time-consuming and relatively less competitive (Table 4), we only compare them in the one-to-one setting (scenario 1) while not in other experiments. To examine the utility of pre-training, we consider two additional approaches that are applied directly to fine-tuning datasets without any pre-training: Non-DL (a non-deep learning KNN model) and Random Init. (randomly initializes the fine-tuning model). The evaluation metrics are accuracy, precision (macro-averaged), recall, F1 score, AUROC, and AUPRC.
|
| 130 |
+
|
| 131 |
+
Implementation. We use two 3-layer 1-D ResNets [67] as backbones for encoders $G _ { \mathrm { T } }$ and $G _ { \mathrm { F } }$ Our datasets contain long time series (samples in FD-A and FD-B have 5,120 observations), and preliminary experiments identified ResNet as a better option than a Transformer variant [68]. We use 2 fully-connected layers for $R _ { \mathrm { T } }$ and $R _ { \mathrm { F } }$ , with no sharing of parameters. We set $E = 1$ and $\alpha = 0 . 5$ in frequency augmentations and $\tau = 0 . 2$ , $\delta = 1$ , $\lambda = 0 . 5$ in loss functions. Reported are mean and standard deviation values across 5 independent runs (both pre-training and fine-tuning) on the same data split. Results for KNN $( \mathrm { K } { = } 2 )$ do not change so the standard deviation is zero. Method details and hyper-parameter selection are in Appendix E.
|
| 132 |
+
|
| 133 |
+
# 5.1 Results: One-to-One Pre-Training Evaluation
|
| 134 |
+
|
| 135 |
+
Setup. In one-to-one evaluation, we pre-train a model on one pre-training dataset and use it for fine-tuning on one target dataset only. Scenario 1 (SLEEPEEG EPILEPSY): Pre-training is done on SLEEPEEG and fine-tuning on EPILEPSY. While both datasets describe a single-channel EEG, the signals are from different channels/positions on scalps, track different physiology (sleep vs. epilepsy), and are collected from different patients. Scenario 2 $\mathrm { F D - A } \longrightarrow \mathrm { F D - B }$ ): Datasets describe mechanical devices that operate in different working conditions, including rotational speed, load torque, and radial force. Scenario 3 (HAR GESTURE): Datasets record different activities (6 types of human daily activities vs. 8 hand gestures). While both datasets contain acceleration signals, HAR has 9 channels while GESTURE has 1 channel. Scenario 4 ( $\operatorname { E C G } \to \operatorname { E M G }$ ): While both are physiological datasets, the ECG records the electrical signal from the heart whereas EMG measures muscle response in response to a nerve’s stimulation of the muscle. We note that the discrepancies between pre-training and fine-tuning datasets in the above four scenarios are substantial, and they cover a diverse range of variation in time series datasets: varying semantic meaning, sampling frequency, time series length, number of classes, and system factors (e.g., number of devices or subjects). The setup is further challenged by the relatively small number of samples available for fine-tuning (EPILEPSY: 60; FD-B: 60; GESTURE: 480; EMG: 122). Further details are in Appendix F.
|
| 136 |
+
|
| 137 |
+
Results. The results for the four scenarios are shown in Table 1 and Tables 4-6. Overall, our TF-C model has won 16 out of 24 tests (6 metrics in 4 scenarios) and is the second-best performer in only 8 other tests. We report all metrics but discuss the F1 score in the following. On average, our TF-C model claims a large margin of $1 5 . 4 \%$ over all baselines. Although the strongest baseline is varying (such as TS-TCC in Scenario 2; Mixing-up in Scenario 3), our model outperforms the strongest baselines by $1 . 5 \%$ across all scenarios. Specifically, as shown in Table 1 $\mathrm { \Delta \mathrm { \cdot } G A R G E S T U R E }$ ; Scenario 3), TF-C achieves the highest performance of $7 9 . 9 1 \%$ in F1 score, which yields a margin of $7 . 2 \%$ over the best baseline TS-TCC $( 7 4 . 5 7 \% )$ . One potential explanation is that Scenario 3 involves a complex dataset (HAR has 6 classes while GESTURE has 8 classes) that can be difficult to model. The complexity of Scenario 3 is further verified by poor performance of all models $( \pm 8 0 \% )$ relative to performance on other Scenarios $( \pm 9 0 \% )$ : TF-C shows strong robustness by learning more generalizable representations. Additionally, we visualize the learned representations in time-frequency space (Appendix I), and the analyses provide further support for the TF-C property.
|
| 138 |
+
|
| 139 |
+
Table 2: One-to-many pre-training evaluation. Pre-training is performed on SLEEPEEG, followed by an independent fine-tuning on EPILEPSY, FD-B, GESTURE, and EMG.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Scenarios</td><td>Models</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 score</td><td>AUROC</td><td>AUPRC</td></tr><tr><td rowspan="10">SLEEPEEG √ EPILEPSY</td><td>Non-DL (KNN)</td><td>0.8525±0.0000</td><td>0.8639±0.0000</td><td>0.6431±0.0000</td><td>0.6791±0.0000</td><td>0.6434±0.0000</td><td>0.6279±0.0000</td></tr><tr><td>Random Init.</td><td>0.8983±0.0656</td><td>0.9213±0.1369</td><td>0.7447±0.1135</td><td>0.7959±0.1208</td><td>0.8578±0.2153</td><td>0.6489±0.1926</td></tr><tr><td>TS-SD</td><td>0.8952±0.0522</td><td>0.8018±0.2244</td><td>0.7647±0.1485</td><td>0.7767±0.1855</td><td>0.7677±0.2452</td><td>0.7940±0.1825</td></tr><tr><td>TS2vec</td><td>0.9395±0.0044</td><td>0.9059±0.0116</td><td>0.9039±0.0118</td><td>0.9045±0.0067</td><td>0.9587±0.0086</td><td>0.9430±0.0103</td></tr><tr><td>CLOCS</td><td>0.9507±0.0027</td><td>0.9301±0.0067</td><td>0.9127±0.0165</td><td>0.9206±0.0066</td><td>0.9803±0.0023</td><td>0.9609±0.0116</td></tr><tr><td>Mixing-up</td><td>0.8021±0.0000</td><td>0.4011±0.0000</td><td>0.5000±0.0000</td><td>0.4451±0.0000</td><td>0.9743±0.0081</td><td>0.9618±0.0104</td></tr><tr><td>TS-TCC</td><td>0.9253±0.0098</td><td>0.9451±0.0049</td><td>0.8181±0.0257</td><td>0.8633±0.0215</td><td>0.9842±0.0034</td><td>0.9744±0.0043</td></tr><tr><td>SimCLR</td><td>0.9071±0.0344</td><td>0.9221±0.0166</td><td>0.7864±0.1071</td><td>0.8178±0.0998</td><td>0.9045±0.0539</td><td>0.9128±0.0205</td></tr><tr><td>TF-C (Ours)</td><td>0.9495±0.0249</td><td>0.9456±0.0108</td><td>0.8908±0.0216</td><td>0.9149±0.0534</td><td>0.9811±0.0237</td><td>0.9703±0.0199</td></tr><tr><td>Non-DL (KNN)</td><td>0.4473±0.0000</td><td>0.2847±0.0000</td><td>0.3275±0.0000</td><td>0.2284±0.0000</td><td>0.4946±0.0000</td><td>0.3308±0.0000</td></tr><tr><td rowspan="8">SLEEPEEG √ FD-B</td><td>Random Init.</td><td>0.4736±0.0623</td><td>0.4829±0.0529</td><td>0.5235±0.1023</td><td>0.4911±0.0590</td><td>0.7864±0.0349</td><td>0.7528±0.0254</td></tr><tr><td>TS-SD</td><td>0.5566±0.0210</td><td>0.5710±0.0535</td><td>0.6054±0.0272</td><td>0.5703±0.0328</td><td>0.7196±0.0113</td><td>0.5693±0.0532</td></tr><tr><td>TS2vec</td><td>0.4790±0.0113</td><td>0.4339±0.0092</td><td>0.4842±0.0197</td><td>0.4389±0.0107</td><td>0.6463±0.0130</td><td>0.4442±0.0162</td></tr><tr><td>CLOCS</td><td>0.4927±0.0310</td><td>0.4824±0.0316</td><td>0.5873±0.0387</td><td>0.4746±0.0485</td><td>0.6992±0.0099</td><td>0.5501±0.0365</td></tr><tr><td>Mixing-up</td><td>0.6789±0.0246</td><td>0.7146±0.0343</td><td>0.7613±0.0198</td><td>0.7273±0.0228</td><td>0.8209±0.0035</td><td>0.7707±0.0042</td></tr><tr><td>TS-TCC</td><td>0.5499±0.0220</td><td>0.5279±0.0293</td><td>0.6396±0.0178</td><td>0.5418±0.0338</td><td>0.7329±0.0203</td><td>0.5824±0.0468</td></tr><tr><td>SimCLR</td><td>0.4917±0.0437</td><td>0.5446±0.1024</td><td>0.4760±0.0885</td><td>0.4224±0.1138</td><td>0.6619±0.0219</td><td>0.5009±0.0477</td></tr><tr><td>TF-C (Ours)</td><td>0.6938±0.0231</td><td>0.7559±0.0349</td><td>0.7202±0.0257</td><td>0.7487±0.0268</td><td>0.8965±0.0135</td><td>0.7871±0.0267</td></tr><tr><td rowspan="10">SLEEPEEG √ GESTURE</td><td>Non-DL (KNN)</td><td>0.6833±0.0000</td><td>0.6501±0.0000</td><td>0.6833±0.0000</td><td>0.6443±0.0000</td><td>0.8190±0.0000</td><td>0.5232±0.0000</td></tr><tr><td>Random Init.</td><td>0.4219±0.0629</td><td>0.4751±0.0175</td><td>0.4963±0.0679</td><td>0.4886±0.0459</td><td>0.7129±0.0166</td><td>0.3358±0.1439</td></tr><tr><td>TS-SD</td><td>0.6922±0.0444</td><td>0.6698±0.0472</td><td>0.6867±0.0488</td><td>0.6656±0.0443</td><td>0.8725±0.0324</td><td>0.6185±0.0966</td></tr><tr><td>TS2vec</td><td>0.6917±0.0333</td><td>0.6545±0.0358</td><td>0.6854±0.0349</td><td>0.6570±0.0392</td><td>0.8968±0.0123</td><td>0.6989±0.0346</td></tr><tr><td>CLOCS</td><td>0.4433±0.0518</td><td>0.4237±0.0794</td><td>0.4433±0.0518</td><td>0.4014±0.0602</td><td>0.8073±0.0109</td><td>0.4460±0.0384</td></tr><tr><td>Mixing-up</td><td>0.6933±0.0231</td><td>0.6719±0.0232</td><td>0.6933±0.0231</td><td>0.6497±0.0306</td><td>0.8915±0.0261</td><td>0.7279±0.0558</td></tr><tr><td>TS-TCC</td><td>0.7188±0.0349</td><td>0.7135±0.0352</td><td>0.7167±0.0373</td><td>0.6984±0.0360</td><td>0.9099±0.0085</td><td>0.7675±0.0201</td></tr><tr><td>SimCLR</td><td>0.4804±0.0594</td><td>0.5946±0.1623</td><td>0.5411±0.1946</td><td>0.4955±0.1870</td><td>0.8131±0.0521</td><td>0.5076±0.1588</td></tr><tr><td>TF-C (Ours)</td><td>0.7642±0.0196</td><td>0.7731±0.0355</td><td>0.7429±0.0268</td><td>0.7572±0.0311</td><td>0.9238±0.0159</td><td>0.7961±0.0109</td></tr><tr><td>Non-DL (KNN)</td><td>0.4390±0.0000</td><td>0.3772±0.0000</td><td>0.5143±0.0000</td><td>0.3979±0.0000</td><td>0.6025±0.0000</td><td>0.4084±0.0000</td></tr><tr><td rowspan="8">SLEEPEEG √ EMG</td><td>Random Init.</td><td>0.7780±0.0729</td><td>0.5909±0.0625</td><td>0.6667±0.0135</td><td>0.6238±0.0267</td><td>0.9109±0.1239</td><td>0.7771±0.1427</td></tr><tr><td>TS-SD</td><td>0.4606±0.0000</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>TS2vec</td><td>0.7854±0.0318</td><td>0.1545±0.0000 0.8040±0.0750</td><td>0.3333±0.0000 0.6785±0.0396</td><td>0.2111±0.0000 0.6766±0.0501</td><td>0.5005±0.0126 0.9331±0.0164</td><td>0.3775±0.0110</td></tr><tr><td>CLOCS</td><td>0.6985±0.0323</td><td>0.5306±0.0750</td><td>0.5354±0.0291</td><td>0.5139±0.0409</td><td>0.7923±0.0573</td><td>0.8436±0.0372 0.6484±0.0680</td></tr><tr><td>Mixing-up</td><td>0.3024±0.0534</td><td>0.1099±0.0126</td><td>0.2583±0.0456</td><td>0.1541±0.0204</td><td>0.4506±0.1718</td><td>0.3660±0.1635</td></tr><tr><td>TS-TCC</td><td>0.7889±0.0192</td><td>0.5851±0.0974</td><td>0.6310±0.0991</td><td>0.5904±0.0952</td><td>0.8851±0.0113</td><td>0.7939±0.0386</td></tr><tr><td>SimCLR</td><td>0.6146±0.0582</td><td>0.5361±0.1724</td><td>0.4990±0.1214</td><td>0.4708±0.1486</td><td>0.7799±0.1344</td><td>0.6392±0.1596</td></tr><tr><td>TF-C (Ours)</td><td>0.8171±0.0287</td><td>0.7265±0.0353</td><td>0.8159±0.0289</td><td>0.7683±0.0311</td><td>0.9152±0.0211</td><td>0.8329±0.0137</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 5.2 Results: One-to-Many Pre-Training Evaluation
|
| 144 |
+
|
| 145 |
+
Setup. In one-to-many evaluation, pre-training is done using one dataset followed by fine-tuning on multiple target datasets independently without starting pre-training from scratch. Out of eight datasets, SLEEPEEG has most complex temporal dynamics [69] and is the largest (371,055 samples). For that reason, we pre-train a model on SLEEPEEG and separately fine-tune a well-pre-trained model on EPILEPSY, FD-B, GESTURE, and EMG.
|
| 146 |
+
|
| 147 |
+
Results. Results are shown in Table 2. As there are fewer commonalities between EEG signals vs. vibration, and acceleration vs. EMG, we expect that transfer learning will be less effective for them than one-to-one evaluations. The pre-training and fine-tuning datasets are largely different in the bottom three blocks (SLEEPEEG $ \{ \mathrm { F D - B }$ , GESTURE, EMG}). The large gap reasonably leads to a deterioration in baseline performances, however, our model has a noticeably higher tolerance to knowledge transfer across datasets with large gaps. Notably, We find that the proposed model with TF-C earned the best performance in 14 out of 18 settings in the three challenging settings: indicating our TF-C assumption is universal in time series. For example, our approach outperforms the strongest baseline by $8 . 4 \%$ (in precision) when fine-tuning on GESTURE. Our model has great potential to serve as a universal model when there is no large pre-training dataset that is similar to the small fine-tuning dataset. Furthermore, the TF-C consistently outperforms KNN and Random Init. (which are not pre-trained) by a large margin of $4 2 . 8 \%$ and $2 5 . 1 \%$ (both in F1 score) on average.
|
| 148 |
+
|
| 149 |
+
Ablation study. We evaluate how relevant the model components are for effective pre-training. As shown in Table 9 (SLEEPEEG GESTURE; Appendix H), removing $\mathcal { L } _ { \mathrm { C } } , \mathcal { L } _ { \mathrm { T } }$ , and $\mathcal { L } _ { \mathrm { F } }$ result in performance degradation (precision) of $6 . 1 \%$ , $7 . 2 \%$ , and $6 . 7 \%$ , respectively. To validate that the performance increment is not solely brought by a third loss term no matter what consistency it measures, we replaced consistency loss $\mathcal { L } _ { \mathrm { C } }$ with a loss term measuring the consistency within time space (named $\mathcal { L } _ { \mathrm { T T - C } } )$ or within frequency space (named $\mathcal { L } _ { \mathrm { F F - C , } }$ ). Results show our consistency loss outperforms $\mathcal { L } _ { \mathrm { T T - C } }$ and $\mathcal { L } _ { \mathrm { F F - C } }$ by $5 . 3 \%$ and $7 . 2 \%$ (accuracy), respectively.
|
| 150 |
+
|
| 151 |
+
# 5.3 Additional Downstream Tasks: Clustering and Anomaly Detection
|
| 152 |
+
|
| 153 |
+
Clustering Task. We evaluate the clustering performance of TF-C taking SLEEPEEG EPILEPSY as an example. Specifically, we added a K-means $( \mathrm { K } { = } 2 )$ , as Epilepsy has 2 classes, on top of $z _ { i } ^ { \mathrm { t u n e } }$ in fine-tuning. We adopt commonly used evaluation metrics: Silhouette score, Adjusted Rand Index (ARI), and Normalized Mutual Information (NMI). Table 7 shows our TF-C obtains the best clustering surpassing the strongest baseline (TS-TCC) by a large margin ( $5 . 4 \%$ in Silhouette score). It conveys that TF-C can capture more distinctive representations with the knowledge transferred from pre-training, which is consistent with the superiority of TF-C in the above classification tasks.
|
| 154 |
+
|
| 155 |
+
Anomaly Detection Task. We assess how TF-C performs on a sample-level anomaly detection task. Note we work on the sample-level rather than the observation-level anomaly detection. Based on global patterns, the former aims to detect abnormal time series samples instead of outlier observations in a sample (as in BTSF [50] and USAD [70]) which emphasizes local context. Specifically, In the scenario of $\mathrm { F D - A } \mathrm { F D - B }$ , we built a small subset of FD-B with 1,000 samples, of which 900 are from undamaged bearings, and the remaining 100 are from bearings with inner or outer damage. Undamaged samples are considered “normal,” and inner/outer damaged samples are “outliers.” In fine-tuning, we used one-class SVM on top of learned representations $z _ { i } ^ { \mathrm { t u n e } }$ . The experimental results (Table 8) show that our TF-C outperforms five competitive baselines with $4 . 5 \%$ in F-1 Score. Results show that the proposed TF-C is more sensitive to anomalous samples and can effectively detect the abnormal status in mechanical devices.
|
| 156 |
+
|
| 157 |
+
# 6 Conclusion
|
| 158 |
+
|
| 159 |
+
We develop a pre-training approach that introduces time-frequency consistency (TF-C) as a mechanism to support knowledge transfer between time-series datasets. The approach uses self-supervised contrastive estimation and injects TF-C into pre-training, bringing time-based and frequency-based representations and their local neighborhoods close together in the latent space.
|
| 160 |
+
|
| 161 |
+
Limitations and future directions. TF-C property can serve as a universal property for pre-training on diverse time series datasets. Additional generalizable properties, such as temporal autoregressive processes, could also be helpful for pre-training on time series. Further, while our method expects as input a regularly sampled time series, it can handle irregularly sampled time series by using an encoder (such as Raindrop [71] and SeFT [72]) that can embed irregular time series. For frequency encoder inputs $\pmb { x } _ { i } ^ { \mathrm { F } }$ , alternatives include resampling or interpolation to obtain regularly sampled signals and using regular or non-uniform FFT operations. Furthermore, TF-C’s current embedding strategy and loss functions are favorable for classification, leveraging global information over tasks that use local context (e.g., forecasting). Results show that the TF-C approach performs well across broad downstream tasks, including classification, clustering, and anomaly detection (Sec. 5.3).
|
| 162 |
+
|
| 163 |
+
# Acknowledgments and Disclosure of Funding
|
| 164 |
+
|
| 165 |
+
We gratefully acknowledge support by US Air Force Contract No. FA8702-15-D-0001, Harvard Data Science Initiative, and awards from Amazon Research, Bayer Early Excellence in Science, AstraZeneca Research, and Roche Alliance with Distinguished Scientists. T.T. is supported by the Under Secretary of Defense for Research and Engineering under US Air Force Contract No. FA8702- 15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the funders.
|
| 166 |
+
|
| 167 |
+
# References
|
| 168 |
+
|
| 169 |
+
[1] Hrayr Harutyunyan, Hrant Khachatrian, David C Kale, Greg Ver Steeg, and Aram Galstyan. Multitask learning and benchmarking with clinical time series data. Scientific data, 6(1):1–18, 2019.
|
| 170 |
+
[2] Shahbaz Rezaei and Xin Liu. Deep learning for encrypted traffic classification: An overview. IEEE communications magazine, 57(5):76–81, 2019.
|
| 171 |
+
[3] Suman Ravuri, Karel Lenc, Matthew Willson, Dmitry Kangin, Remi Lam, Piotr Mirowski, Megan Fitzsimons, Maria Athanassiadou, Sheleem Kashem, Sam Madge, et al. Skilful precipitation nowcasting using deep generative models of radar. Nature, 597(7878):672–677, 2021.
|
| 172 |
+
[4] Omer Berat Sezer, Mehmet Ugur Gudelek, and Ahmet Murat Ozbayoglu. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Applied soft computing, 90:106181, 2020.
|
| 173 |
+
[5] Bing Su and Ji-Rong Wen. Temporal alignment prediction for supervised representation learning and few-shot sequence classification. In ICLR, 2022.
|
| 174 |
+
[6] Yixiang Deng, Lu Lu, Laura Aponte, Angeliki M Angelidi, Vera Novak, George Em Karniadakis, and Christos S Mantzoros. Deep transfer learning and data augmentation improve glucose levels prediction in type 2 diabetes patients. NPJ Digital Medicine, 4(1):1–13, 2021.
|
| 175 |
+
[7] Quentin Rebjock, Baris Kurt, Tim Januschowski, and Laurent Callot. Online false discovery rate control for anomaly detection in time series. NeurIPS, 34:26487–26498, 2021.
|
| 176 |
+
[8] Fan-Keng Sun, Chris Lang, and Duane Boning. Adjusting for autocorrelated errors in neural networks for time series. NeurIPS, 34:29806–29819, 2021.
|
| 177 |
+
[9] Angus Dempster, François Petitjean, and Geoffrey I Webb. Rocket: exceptionally fast and accurate time series classification using random convolutional kernels. Data Mining and Knowledge Discovery, 34(5):1454–1495, 2020.
|
| 178 |
+
[10] Wenyong Huang, Zhenhe Zhang, Yu Ting Yeung, Xin Jiang, and Qun Liu. Spiral: Selfsupervised perturbation-invariant representation learning for speech pre-training. ICLR, 2022.
|
| 179 |
+
[11] Hassan Ismail Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and PierreAlain Muller. Deep learning for time series classification: a review. Data mining and knowledge discovery, 33(4):917–963, 2019.
|
| 180 |
+
[12] Pengxiang Shi, Wenwen Ye, and Zheng Qin. Self-supervised pre-training for time series classification. In IJCNN, pages 1–8, 2021.
|
| 181 |
+
[13] Weixia Dang, Biyu Zhou, Lingwei Wei, Weigang Zhang, Ziang Yang, and Songlin Hu. Tsbert: Time series anomaly detection via pre-training model bert. In International Conference on Computational Science, pages 209–223. Springer, 2021.
|
| 182 |
+
[14] Soravit Changpinyo, Piyush Sharma, Nan Ding, and Radu Soricut. Conceptual $1 2 \mathrm { m }$ : Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In CVPR, pages 3558– 3568, 2021.
|
| 183 |
+
[15] Kailai Sun, Zuchao Li, and Hai Zhao. Multilingual pre-training with universal dependency learning. NeurIPS, 34:8444–8456, 2021.
|
| 184 |
+
[16] Rui Ye and Qun Dai. Implementing transfer learning across different datasets for time series forecasting. Pattern Recognition, 109:107617, 2021.
|
| 185 |
+
[17] Hassan Ismail Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and PierreAlain Muller. Transfer learning for time series classification. In 2018 IEEE international conference on big data (Big Data), pages 1367–1376. IEEE, 2018.
|
| 186 |
+
[18] Kristoffer Wickstrøm, Michael Kampffmeyer, Karl Øyvind Mikalsen, and Robert Jenssen. Mixing up contrastive learning: Self-supervised representation learning for time series. PRL, 155:54–61, 2022.
|
| 187 |
+
[19] Priyanka Gupta, Pankaj Malhotra, Jyoti Narwariya, Lovekesh Vig, and Gautam Shroff. Transfer learning for clinical time series analysis using deep neural networks. Journal of Healthcare Informatics Research, 4(2):112–137, 2020.
|
| 188 |
+
[20] Amiel Meiseles and Lior Rokach. Source model selection for deep learning in the time series domain. IEEE Access, 8:6190–6200, 2020.
|
| 189 |
+
[21] Ankit Singh. Clda: Contrastive learning for semi-supervised domain adaptation. NeurIPS, 34:5089–5101, 2021.
|
| 190 |
+
[22] 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. In ICLR, 2019.
|
| 191 |
+
[23] Alec Radford and Karthik Narasimhan. Improving language understanding by generative pre-training. OpenAI, 2018.
|
| 192 |
+
[24] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. In NeurIPS, volume 33, pages 22243–22255, 2020.
|
| 193 |
+
[25] Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, and Michael Auli. wav2vec 2.0: A framework for self-supervised learning of speech representations. In NeurIPS, volume 33, pages 12449–12460, 2020.
|
| 194 |
+
[26] Gari D Clifford, Chengyu Liu, Benjamin Moody, H Lehman Li-wei, Ikaro Silva, Qiao Li, AE Johnson, and Roger G Mark. Af classification from a short single lead ecg recording: The physionet/computing in cardiology challenge 2017. In 2017 Computing in Cardiology (CinC), pages 1–4. IEEE, 2017.
|
| 195 |
+
[27] Mitchell L Gordon, Kaitlyn Zhou, Kayur Patel, Tatsunori Hashimoto, and Michael S Bernstein. The disagreement deconvolution: Bringing machine learning performance metrics in line with reality. In CHI, pages 1–14, 2021.
|
| 196 |
+
[28] Simon Rogers, Derek Sleeman, and John Kinsella. Investigating the disagreement between clinicians’ ratings of patients in icus. IEEE Journal of Biomedical and Health Informatics, 17(4):843–852, 2013.
|
| 197 |
+
[29] Leonard M Horowitz, Rita de Sales French, Kirk D Wallis, David L Post, and Ellen Y Siegelman. The prototype as a construct in abnormal psychology: Ii. clarifying disagreement in psychiatric judgments. Journal of Abnormal Psychology, 90(6):575, 1981.
|
| 198 |
+
[30] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. In arXiv:1807.03748, 2019.
|
| 199 |
+
[31] Pritam Sarkar and Ali Etemad. Self-supervised learning for ecg-based emotion recognition. In ICASSP, pages 3217–3221, 2020.
|
| 200 |
+
[32] Joseph Y Cheng, Hanlin Goh, Kaan Dogrusoz, Oncel Tuzel, and Erdrin Azemi. Subject-aware contrastive learning for biosignals. arXiv preprint arXiv:2007.04871, 2020.
|
| 201 |
+
[33] Sriram Ravula, Georgios Smyrnis, Matt Jordan, and Alexandros G Dimakis. Inverse problems leveraging pre-trained contrastive representations. NeurIPS, 34:8753–8765, 2021.
|
| 202 |
+
[34] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, pages 1597–1607, 2020.
|
| 203 |
+
[35] Zhigang Dai, Bolun Cai, Yugeng Lin, and Junying Chen. Up-detr: Unsupervised pre-training for object detection with transformers. In CVPR, pages 1601–1610, 2021.
|
| 204 |
+
[36] Hsin-Ying Lee, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Unsupervised representation learning by sorting sequences. In Proceedings of the IEEE international conference on computer vision, pages 667–676, 2017.
|
| 205 |
+
[37] Mathilde Caron, Piotr Bojanowski, Julien Mairal, and Armand Joulin. Unsupervised pre-training of image features on non-curated data. In ICCV, pages 2959–2968, 2019.
|
| 206 |
+
[38] 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.
|
| 207 |
+
[39] Neo Wu, Bradley Green, Xue Ben, and Shawn O’Banion. Deep transformer models for time series forecasting: The influenza prevalence case. In arXiv:2001.08317, 2020.
|
| 208 |
+
[40] Chi Ian Tang, Ignacio Perez-Pozuelo, Dimitris Spathis, and Cecilia Mascolo. Exploring contrastive learning in human activity recognition for healthcare. arXiv preprint arXiv:2011.11542, 2020.
|
| 209 |
+
[41] Dani Kiyasseh, Tingting Zhu, and David A Clifton. Clocs: Contrastive learning of cardiac signals across space, time, and patients. In ICML, pages 5606–5615, 2021.
|
| 210 |
+
[42] David Berthelot, Rebecca Roelofs, Kihyuk Sohn, Nicholas Carlini, and Alex Kurakin. Adamatch: A unified approach to semi-supervised learning and domain adaptation. ICLR, 2022.
|
| 211 |
+
[43] Guoqiang Wei, Cuiling Lan, Wenjun Zeng, Zhizheng Zhang, and Zhibo Chen. Toalign: Taskoriented alignment for unsupervised domain adaptation. NeurIPS, 34:13834–13846, 2021.
|
| 212 |
+
[44] Tongkun Xu, Weihua Chen, Pichao Wang, Fan Wang, Hao Li, and Rong Jin. Cdtrans: Crossdomain transformer for unsupervised domain adaptation. ICLR, 2022.
|
| 213 |
+
[45] Bernd Illing, Jean Ventura, Guillaume Bellec, and Wulfram Gerstner. Local plasticity rules can learn deep representations using self-supervised contrastive predictions. NeurIPS, 34:30365– 30379, 2021.
|
| 214 |
+
[46] Sana Tonekaboni, Danny Eytan, and Anna Goldenberg. Unsupervised representation learning for time series with temporal neighborhood coding. In ICLR, 2021.
|
| 215 |
+
[47] Zhihan Yue, Yujing Wang, Juanyong Duan, Tianmeng Yang, Congrui Huang, Yunhai Tong, and Bixiong Xu. Ts2vec: Towards universal representation of time series. In AAAI, volume 36, pages 8980–8987, 2022.
|
| 216 |
+
[48] 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 IJCAI, pages 2352–2359, 2021.
|
| 217 |
+
[49] Gerald Woo, Chenghao Liu, Doyen Sahoo, Akshat Kumar, and Steven Hoi. CoST: Contrastive learning of disentangled seasonal-trend representations for time series forecasting. In ICLR, 2022.
|
| 218 |
+
[50] Ling Yang and Shenda Hong. Unsupervised time-series representation learning with iterative bilinear temporal-spectral fusion. In ICML, pages 25038–25054. PMLR, 2022.
|
| 219 |
+
[51] Rob J Hyndman and George Athanasopoulos. Forecasting: principles and practice. OTexts, 2018.
|
| 220 |
+
[52] Ronald Newbold Bracewell and Ronald N Bracewell. The Fourier transform and its applications, volume 31999. McGraw-hill New York, 1986.
|
| 221 |
+
[53] Leon Cohen. Time-frequency analysis, volume 778. Prentice hall New Jersey, 1995.
|
| 222 |
+
[54] Henri J Nussbaumer. The fast fourier transform. In Fast Fourier Transform and Convolution Algorithms, pages 80–111. Springer, 1981.
|
| 223 |
+
[55] Patrick Flandrin. Time-frequency/time-scale analysis. Academic press, 1998.
|
| 224 |
+
[56] Antonia Papandreou-Suppappola. Applications in time-frequency signal processing. CRC press, 2018.
|
| 225 |
+
[57] Ryan Soklaski, Michael Yee, and Theodoros Tsiligkaridis. Fourier-based augmentations for improved robustness and uncertainty calibration. NeurIPS’W, 2021.
|
| 226 |
+
[58] Ashish Jaiswal, Ashwin Ramesh Babu, Mohammad Zaki Zadeh, Debapriya Banerjee, and Fillia Makedon. A survey on contrastive self-supervised learning. Technologies, 9(1):2, 2020.
|
| 227 |
+
[59] Elad Hoffer and Nir Ailon. Deep metric learning using triplet network. In International workshop on similarity-based pattern recognition, pages 84–92. Springer, 2015.
|
| 228 |
+
[60] Vassileios Balntas, Edgar Riba, Daniel Ponsa, and Krystian Mikolajczyk. Learning local feature descriptors with triplets and shallow convolutional neural networks. In Bmvc, volume 1, page 3, 2016.
|
| 229 |
+
[61] Bob Kemp, Aeilko H Zwinderman, Bert Tuk, Hilbert AC Kamphuisen, and Josefien JL Oberye. Analysis of a sleep-dependent neuronal feedback loop: the slow-wave microcontinuity of the eeg. IEEE Transactions on Biomedical Engineering, 47(9):1185–1194, 2000.
|
| 230 |
+
[62] Ralph G Andrzejak, Klaus Lehnertz, Florian Mormann, Christoph Rieke, Peter David, and Christian E Elger. Indications of nonlinear deterministic and finite-dimensional structures in time series of brain electrical activity: Dependence on recording region and brain state. Physical Review E, 64(6):061907, 2001.
|
| 231 |
+
[63] Christian Lessmeier, James Kuria Kimotho, Detmar Zimmer, and Walter Sextro. Condition monitoring of bearing damage in electromechanical drive systems by using motor current signals of electric motors: A benchmark data set for data-driven classification. In PHM Society European Conference, volume 3, 2016.
|
| 232 |
+
[64] Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra Perez, and Jorge Luis Reyes Ortiz. A public domain dataset for human activity recognition using smartphones. In ESANN, pages 437–442, 2013.
|
| 233 |
+
[65] Jiayang Liu, Lin Zhong, Jehan Wickramasuriya, and Venu Vasudevan. uwave: Accelerometerbased personalized gesture recognition and its applications. Pervasive and Mobile Computing, 5(6):657–675, 2009.
|
| 234 |
+
[66] Ary L Goldberger, Luis AN Amaral, Leon Glass, Jeffrey M Hausdorff, Plamen Ch Ivanov, Roger G Mark, Joseph E Mietus, George B Moody, Chung-Kang Peng, and H Eugene Stanley. Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. circulation, 101(23):e215–e220, 2000.
|
| 235 |
+
[67] Amrutha Ramanathan and James McDermott. Fall detection with accelerometer data using residual networks adapted to multi-variate time series classification. In IJCNN, pages 1–8, 2021.
|
| 236 |
+
[68] George Zerveas, Srideepika Jayaraman, Dhaval Patel, Anuradha Bhamidipaty, and Carsten Eickhoff. A transformer-based framework for multivariate time series representation learning. In KDD, pages 2114–2124, 2021.
|
| 237 |
+
[69] Xiang Zhang and Lina Yao. Deep Learning for EEG-Based Brain–Computer Interfaces: Representations, Algorithms and Applications. World Scientific, 2021.
|
| 238 |
+
[70] Julien Audibert, Pietro Michiardi, Frédéric Guyard, Sébastien Marti, and Maria A Zuluaga. Usad: Unsupervised anomaly detection on multivariate time series. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 3395–3404, 2020.
|
| 239 |
+
[71] Xiang Zhang, Marko Zeman, Theodoros Tsiligkaridis, and Marinka Zitnik. Graph-guided network for irregularly sampled multivariate time series. In ICLR, 2022.
|
| 240 |
+
[72] Max Horn, Michael Moor, Christian Bock, Bastian Rieck, and Karsten Borgwardt. Set functions for time series. In ICML, pages 4353–4363, 2020.
|
| 241 |
+
|
| 242 |
+
# Broader Impacts
|
| 243 |
+
|
| 244 |
+
Our approach for self-supervised pre-training improves classification performance on target datasets in different application scenarios. The recognition of time-frequency consistency as a universal property specific to time series data is a weak assumption that enables effective, task- and domainagnostic transfer learning. We believe our work will inspire the research community to uncover other universal properties for transfer learning. We also hope our work will also attract more researchers to the more general problem of time series representation learning which is still underappreciated relative to problems from CV and NLP fields.
|
| 245 |
+
|
| 246 |
+
On the society level, our work, along the line of transfer learning, can facilitate more efficient use of time series data in various settings. For example, in medical settings, some diseases of clinical interest may have very small labelled dataset. In this case, unlabelled data from patients of different diseases but with similar underlying physiological conditions can be used to pre-train the model. However, practitioners need to be aware of the limitations of the model, including that it may make biased predictions. Specifically, bias may exist in the source dataset used for pre-training due to an imbalance of samples from subjects of different demographic attributes. Also, the standardized medical protocols for collecting these datasets might be unsuitable for subjects with certain physiological attributes, creating unforeseen bias that may be transferred to fine-tuning.
|
| 247 |
+
|
| 248 |
+
All datasets in this paper are publicly available and are not associated with any privacy or security concern. Furthermore, we have followed guidelines on responsible use specified by primary authors of the datasets used in the current work.
|
| 249 |
+
|
| 250 |
+
# Checklist
|
| 251 |
+
|
| 252 |
+
1. For all authors...
|
| 253 |
+
|
| 254 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] In abstract and introduction, we claim that TF-C is a generalizable property of time series that can support pre-training, which is welljustified in Sec. 3 and experimentally demonstrated in Sec. 5 (our model consistently performs comparatively to or above baseline methods).
|
| 255 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 256 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Broader Impact on Page 10.
|
| 257 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 258 |
+
|
| 259 |
+
2. If you are including theoretical results...
|
| 260 |
+
|
| 261 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 262 |
+
|
| 263 |
+
3. If you ran experiments...
|
| 264 |
+
|
| 265 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Yes, we include an anonymous link (see Abstract) that provides the source codes with all implementation details, implementation of baselines, and eight datasets. The link will be updated to an non-anonymous link after acceptance.
|
| 266 |
+
(b) Did you specify all the training details (e.g., data splits, hyper-parameters, how they were chosen)? [Yes] See implementation details in Sec. 5. See Appendix $\mathrm { E }$ for baseline architectures and hyper-parameter settings. More details can be found in the included URL.
|
| 267 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We run experiments for 5 times and report the average value with standard deviation. See Table 1, Tables 4-6, and Table 2.
|
| 268 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix E.
|
| 269 |
+
|
| 270 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 271 |
+
|
| 272 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We used eight existing datasets and 6 state-of-the-art baselines in contrastive learning and pre-training for time series. We cited the creators for every exist asset we used. See Sec. 5.
|
| 273 |
+
(b) Did you mention the license of the assets? [Yes] All dataset licenses are mentioned in the Appendix D.
|
| 274 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See the anonymous link in Abstract.
|
| 275 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] All data we use is freely available for download, without any requirement to re-contact the data curator.
|
| 276 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] Our datasets are public, well-established, and do not contain PII or offensive content
|
| 277 |
+
|
| 278 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 279 |
+
|
| 280 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 281 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 282 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/Pu-QtT0h2E/Pu-QtT0h2E.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DeVRF: Fast Deformable Voxel Radiance Fields for Dynamic Scenes
|
| 2 |
+
|
| 3 |
+
Jia-Wei Liu1∗, Yan-Pei $\mathbf { C a o } ^ { 2 }$ , Weijia Mao1, Wenqiao Zhang4, David Junhao Zhang1, Jussi Keppo5,6, Ying Shan2, Xiaohu $\mathbf { Q i e } ^ { 3 }$ , Mike Zheng Shou1†
|
| 4 |
+
|
| 5 |
+
1 Show Lab, National University of Singapore 2 ARC Lab, 3 Tencent PCG 4 National University of Singapore 5 Business School, National University of Singapore 6 Institute of Operations Research and Analytics, National University of Singapore
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Modeling dynamic scenes is important for many applications such as virtual reality and telepresence. Despite achieving unprecedented fidelity for novel view synthesis in dynamic scenes, existing methods based on Neural Radiance Fields (NeRF) suffer from slow convergence (i.e., model training time measured in days). In this paper, we present DeVRF, a novel representation to accelerate learning dynamic radiance fields. The core of DeVRF is to model both the 3D canonical space and 4D deformation field of a dynamic, non-rigid scene with explicit and discrete voxelbased representations. However, it is quite challenging to train such a representation which has a large number of model parameters, often resulting in overfitting issues. To overcome this challenge, we devise a novel static dynamic learning paradigm together with a new data capture setup that is convenient to deploy in practice. This paradigm unlocks efficient learning of deformable radiance fields via utilizing the 3D volumetric canonical space learnt from multi-view static images to ease the learning of 4D voxel deformation field with only few-view dynamic sequences. To further improve the efficiency of our $_ \mathrm { D e V R F }$ and its synthesized novel view’s quality, we conduct thorough explorations and identify a set of strategies. We evaluate DeVRF on both synthetic and real-world dynamic scenes with different types of deformation. Experiments demonstrate that DeVRF achieves two orders of magnitude speedup $\underline { { \mathbf { 1 0 0 } } } \times$ faster) with on-par high-fidelity results compared to the previous state-of-the-art approaches. The code and dataset are released in https://github.com/showlab/DeVRF.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Free-viewpoint photorealistic view synthesis techniques from a set of captured images unleash new opportunities for immersive applications such as virtual reality, telepresence, and 3D animation production. Recent advances in this domain mainly focus on static scenes, e.g., Neural Radiance Fields (NeRF) [20], which implicitly represent rigid static scenes using 5D (spatial locations $( x , y , z )$ and view directions $( \theta , \varphi ) )$ neural radiance fields. Although achieving unprecedented fidelity for novel view synthesis, NeRF were mainly exploited under static scenes. To unlock dynamic view synthesis, existing NeRF-based approaches either learn an additional MLP-based deformation field that maps coordinates in dynamic fields to NeRF-based canonical spaces [27, 24, 25, 38] or model dynamic scenes as 4D spatio-temporal radiance fields with relatively large MLPs [16, 7].
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: The 3D canonical space (a) and the 4D deformation field (b) of DeVRF for neural modeling of a non-rigid scene (c). (d): The comparison between DeVRF and SOTA approaches.
|
| 17 |
+
|
| 18 |
+
Despite being promising, NeRF is notoriously known for suffering from lengthy optimization time. This issue becomes particularly prominent for non-rigid, dynamic scenes because the aforementioned NeRF-based approaches require extra computation for the deformation MLPs [27, 24, 25, 38] or time-varying texture/density querying [16, 7], resulting in quite long training time (in “days”).
|
| 19 |
+
|
| 20 |
+
This motivates us to improve the learning efficiency of dynamic radiance fields. Recent advances in static NeRF [35, 45] show that employing voxel grids, such a volumetric representation, can achieve fast convergence. To adapt for dynamic scenes, one straightforward approach is to incorporate such a volumetric representation into the dynamic radiance field for fast neural modeling. In this paper, we present a novel deformable voxel radiance field (DeVRF) that models both the 3D canonical space and 4D deformation field of a non-rigid, dynamic scene with explicit and discrete voxel-based representations, as illustrated in Fig. 1 (a-c). However, we empirically observe that recklessly learning such a representation in dynamic radiance fields tends to plunge into the local optimum, i.e., the overfitting issue, due to the large number of parameters in DeVRF.
|
| 21 |
+
|
| 22 |
+
To overcome this overfitting issue, we power our DeVRF with two novel designs: (1) We devise an efficient and practical learning paradigm, i.e., static dynamic, for learning deformable radiance fields. The key idea behind this is that the 3D volumetric canonical space learned from multi-view static images can introduce inductive bias [3] to unlock efficient learning of deformable radiance fields. Further, with such 3D priors, a dynamic scene can be effectively modeled with only a few fixed cameras. We argue that such a few-fixed-cameras setup for dynamic scene data capture is more convenient than the moving camera (such as the setup used in D-NeRF [27]) in practice. (2) Based on the static dynamic paradigm, we conduct extensive explorations and identify a set of strategies customised for DeVRF to improve its efficiency and effectiveness. These include a coarse-to-fine training strategy for the 4D deformation field to further improve efficiency, and three objectives to encourage our DeVRF to reconstruct dynamic radiance fields with high fidelity: deformation cycle consistency, optical flow supervisions, and total variation regularization.
|
| 23 |
+
|
| 24 |
+
Fig. 1 (d) shows that on five inward-facing synthetic scenes, two forward-facing real-world scenes and one inward-facing real-world scene, our approach enables fast dynamic radiance field modeling in about 10 minutes on a single NVIDIA GeForce RTX3090 GPU. This is $\underline { { \mathbf { 1 0 0 } \times } }$ faster than SOTA approaches with comparable novel view synthesis quality.
|
| 25 |
+
|
| 26 |
+
To summarize, the major contributions of our paper are:
|
| 27 |
+
|
| 28 |
+
• A novel perspective of DeVRF is presented that enables fast non-rigid neural scene reconstruction, which achieves an impressive $1 0 0 \times$ speedup compared to SOTA approaches with on-par high-fidelity.
|
| 29 |
+
• To the best of our knowledge, we are the first to incorporate the 4D voxel deformation field into dynamic radiance fields.
|
| 30 |
+
• We devise a static dynamic learning paradigm that can boost performances with a low-cost yet effective capture setup.
|
| 31 |
+
|
| 32 |
+
# 2 Related Work
|
| 33 |
+
|
| 34 |
+
Novel View Synthesis for Static Scenes. Earlier approaches [14, 31, 4, 6, 9, 21] tackle novel view synthesis by first building an explicit 3D reconstruction of a static scene, such as voxels and meshes, and then rendering novel views based on the reconstructed model. On the other hand, multi-plane images [48, 19] represent a scene with multiple images at different depths and can reconstruct scenes with complex structures. Recently, NeRF [20] achieves unprecedented fidelity for novel view synthesis by modeling static scenes with neural radiance fields. Subsequent works have extended NeRF to different scenarios, such as few-view novel view synthesis [12], multi-scale representation [2], and larger scenes [36, 43, 29]. However, these methods mainly focus on static scenes while the dynamic radiance fields reconstruction is more practical.
|
| 35 |
+
|
| 36 |
+
Novel View Synthesis for Dynamic Scenes. In order to capture dynamic scenes with non-rigidly deforming objects, traditional non-rigid reconstruction approaches require depth information as additional input or only reconstruct sparse geometry [23, 11, 44, 5, 34]. VolumeDeform [11] introduces a unified volumetric representation to encode both the scene’s geometry and its motion but requires RGB-D sequences as input. Neural Volumes [18] represents dynamic objects with a 3D voxel grid plus an implicit warp field, but requires an expensive multi-view capture rig and days to train. Recent studies have built upon NeRF [20] and extended it to dynamic neural radiance field reconstruction by learning a mapping from dynamic to canonical field [27, 24, 25, 38] or building a 4D spatio-temporal radiance field [42, 16, 7, 15]. D-NeRF [27] learns a deformation field that maps coordinates in a dynamic field to a NeRF-based canonical space. Nerfies [24] further associates latent codes in the deformation MLP and the canonical NeRF to tackle more challenging scenes such as moving humans. HyperNeRF [25] proposes to model the motion in a higher dimension space, representing the time-dependent radiance field by slicing through the hyperspace. In contrast, Video-NeRF [42] models the dynamic scene as 4D spatio-temporal radiance fields and addresses motion ambiguity using scene depth. Sharing a similar idea on the 4D spatio-temporal field, NSFF [16] represents a dynamic scene as a time-variant function of geometry and appearance, and warps dynamic scene with 3D scene motion. Lastly, several NeRF-based approaches have been proposed for modeling dynamic humans [8, 41, 17, 26, 32] but can not directly generalize to other scenes. Although achieving promising results, existing methods require days of GPU training time, which is undesirable in real-world applications.
|
| 37 |
+
|
| 38 |
+
NeRF Acceleration. In the light of NeRF’s substantial computational requirements for training and rendering, recent papers have proposed methods to improve its efficiency. A line of work [46, 28, 10] focuses on NeRF rendering acceleration and has achieved encouraging results. As for training acceleration, DVGO [35] models the radiance field with explicit and discretized volume representations, reducing training time to minutes. Plenoxels [45] employs sparse voxel grids as the scene representation and uses spherical harmonics to model view-dependent appearance, reaching a similar training speedup. Finally, Instant-ngp [22] proposes multiresolution hash encoding; together with a highly optimized GPU implementation, it can produce competitive results after seconds of training. However, existing acceleration methods only focus on static scenes, while hardly any research, to our best knowledge, has studied NeRF acceleration for dynamic scenes. Very recently, Fourier PlenOctrees [39] extends PlenOctrees [46] to dynamic scenes by processing time-varying density and color in the frequency domain; however, the data capturing setup is expensive, and it still requires hours of training. Instead, our proposed algorithm, DeVRF, offers a superior training speed while only requires a few cameras for data capture.
|
| 39 |
+
|
| 40 |
+
# 3 Method
|
| 41 |
+
|
| 42 |
+
# 3.1 Capture Setup
|
| 43 |
+
|
| 44 |
+
Deformable scenes undergo various types of deformations and motions, which can result in different scene properties such as object poses, shapes, and occlusions. Therefore, capturing and modeling deformable scenes is nontrivial even for professional photographic studios. Existing approaches [39, 13, 49, 1] attempt to capture $3 6 0 ^ { \circ }$ inward-facing dynamic scenes with multi-view sequences and thus require dozens of high-quality cameras. On the other hand, D-NeRF [27] reconstructs deformable radiance fields from a sparse set of synthetic images rendered from a moving monocular camera. However, in practice, it is particularly challenging to capture real-world $3 6 0 ^ { \circ }$ inward-facing dynamic scenes with a single moving camera due to various types of deformations and resulting occlusions in dynamic scenes, especially for scenes undergoing fast deformations. As a result, subsequent studies [24, 25, 16, 7] only capture forward-facing videos of real-world dynamic scenes with a monocular camera.
|
| 45 |
+
|
| 46 |
+
Table 1: Comparisons of capture setups for dynamic scenes.
|
| 47 |
+
|
| 48 |
+
<table><tr><td>Approach</td><td>No.of cameras Cost</td><td>Supported real-world use cases</td><td></td></tr><tr><td>D-NeRF[27],Nerfies[24] Neural Volumes[18]</td><td>Monocular Multiple (34)</td><td>Low</td><td>Forward-facing scenes, slow reconstruction in days.</td></tr><tr><td>Fourier PlenOctrees[39]</td><td>Multiple (60)</td><td></td><td>High 36O° inward-facing scenes,slow reconstruction in days. High 36O° inward-facing scenes,fast reconstruction in 2hrs.</td></tr><tr><td>Ours</td><td></td><td></td><td>360° inward-facing and forward-facing scenes,</td></tr><tr><td></td><td>Few (4)</td><td>Low</td><td>super-fast reconstruction in 1Omins.</td></tr></table>
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Overview of our method. In the first stage, DeVRF learns a 3D volumetric canonical prior $\mathbf { ( b ) }$ from multi-view static images (a). In the second stage, a 4D deformation field (d) is jointly optimized from taking few-view dynamic sequences (c) and the 3D canonical prior (b). For ray points sampled from a deformed frame, their deformation to canonical space can be efficiently queried from the 4D backward deformation field (d). Therefore, the scene properties (i.e., density, color) of these deformed points can be obtained through linear interpolation in the 3D volumetric canonical space, and novel views (f) can be accordingly synthesized by volume rendering (e) using these deformed sample points.
|
| 52 |
+
|
| 53 |
+
Compared to dynamic scenes, it is much easier in practice to do multi-view capture for real-world static scenes with a monocular moving camera. Therefore, we propose to separate the capture process of a dynamic scene into two stages: the first stage captures a static state using a moving monocular camera, and the second stage captures the scene in motion using a few fixed cameras. In this capture setup, the multi-view static images provide complete 3D geometry and appearance information of the scene, while few-view dynamic sequences show how the scene deforms in 3D space over time; the entire capture process only requires a few cameras. Tab. 1 compares our capture process with existing approaches in terms of the number of required cameras, cost, and supported real-world use cases.
|
| 54 |
+
|
| 55 |
+
# 3.2 Deformable Voxel Radiance Fields
|
| 56 |
+
|
| 57 |
+
As illustrated in Fig. 2, we present DeVRF to model both the 3D canonical space and 4D deformation field of a non-rigid scene with explicit and discrete voxel-based representations. This volumetric representation allows us to efficiently query the deformation, density, and color of any 3D point at any time step in a deformable scene, thus largely improving the training and rendering efficiency. In addition, we devise a static dynamic learning paradigm that first learns a 3D volumetric canonical prior from multi-view static images (Fig. 2(a-b)) and transfers such prior to dynamic radiance fields reconstruction (Fig. 2(c-f)).
|
| 58 |
+
|
| 59 |
+
3D Volumetric Canonical Space. We take inspiration from the volumetric representation of DVGO [35] and model the scene properties such as density and color of our 3D canonical space into voxel grids. Such representation enables us to efficiently query the scene property of any 3D point via trilinear interpolation of its neighboring voxels,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathrm { T r i - I n t e r p } \left( \left[ x , y , z \right] , \mathbf { V } _ { p } \right) : \left( \mathbb { R } ^ { 3 } , \mathbb { R } ^ { C \times N _ { x } \times N _ { y } \times N _ { z } } \right) \to \mathbb { R } ^ { C } , \forall p \in \{ \mathrm { d e n s i t y } , \mathrm { c o l o r } \}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $C$ is the dimension of scene property $\mathbf { V } _ { p } . \ N _ { x } , N _ { y }$ , and $N _ { z }$ are the voxel resolutions of $\mathbf { V } _ { p }$ in $x$ -, $y \cdot$ -, $z \cdot$ - dimension.
|
| 66 |
+
|
| 67 |
+
As shown in Fig. 2(a-b), we learn the 3D volumetric canonical prior, i.e., density grid $\mathbf { V } _ { \mathrm { d e n s i t y } }$ and color grid $\mathbf { V } _ { \mathrm { c o l o r } }$ , with multi-view static images $\{ \mathbf { I } _ { \mathrm { S } } \}$ via volumetric rendering. Following DVGO [35], we employ softplus and post-activation after the trilinear interpolation of a 3D point in $\mathbf { V } _ { \mathrm { d e n s i t y } }$ as they are critical for sharp boundary and high-frequency geometry reconstruction. We also apply a shallow MLP after the trilinear interpolation of a 3D point in $\mathbf { V } _ { \mathrm { c o l o r } }$ to enable view-dependent color effects [35]. In our static dynamic learning paradigm, the learned 3D volumetric canonical prior provides critical knowledge of the 3D geometry and appearance of the target dynamic scene, as few-view dynamic sequences alone struggle to reconstruct a complete deformable radiance field with high fidelity (as shown in Section 4).
|
| 68 |
+
|
| 69 |
+
4D Voxel Deformation Field. We employ a 4D voxel deformation field $\mathbf { V } _ { \mathrm { m o t i o n } }$ to efficiently represent the motion of a deformable scene. As shown in Fig. 2(d), the arrow directions represent the motions of voxels, the color denotes the motion direction, and the arrow magnitude denotes the motion scale. To synthesize a novel view at time step $t$ , we shoot rays through image pixels and sample ray points ${ \mathcal { X } } _ { t } = \{ { \bf X } _ { i } ^ { t } \}$ in 3D space. The 3D motion $\Delta \mathcal { X } _ { t 0 } = \{ \Delta \mathbf { X } _ { i } ^ { t 0 } \}$ from $\mathcal { X } _ { t }$ to their corresponding 3D points in the canonical space $\mathscr { X } _ { 0 } = \{ \mathbf { X } _ { i } ^ { 0 } \ | \ \mathbf { X } _ { i } ^ { 0 } = \mathbf { X } _ { i } ^ { t } + \mathbf { \bar { \Delta } } \mathbf { X } _ { i } ^ { t 0 } \}$ can be efficiently queried through quadruple interpolation of their neighboring voxels at neighboring time steps in the 4D backward deformation field,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathrm { Q u a d - I n t e r p } \left( \left[ x , y , z , t \right] , \mathbf { V } _ { \mathrm { m o t i o n } } \right) : \left( \mathbb { R } ^ { 4 } , \mathbb { R } ^ { N _ { t } \times C \times N _ { x } \times N _ { y } \times N _ { z } } \right) \to \mathbb { R } ^ { C } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $C$ is the degrees of freedom (DoFs) of the sample point motion. We use $C = 3$ in this paper, i.e., assign a displacement vector to each sample point. $N _ { t }$ is the number of key time steps that can be user-defined based on the scene motion properties.
|
| 76 |
+
|
| 77 |
+
Therefore, scene properties of $\mathcal { X } _ { t }$ can then be obtained by querying the scene properties of their corresponding canonical points $\mathcal { X } _ { 0 }$ through trilinear interpolation in the volumetric canonical space. Finally, pixel colors can be calculated through volume rendering with the sampled scene properties along each ray, as illustrated in Fig. 2(e-f).
|
| 78 |
+
|
| 79 |
+
# 3.3 Optimization
|
| 80 |
+
|
| 81 |
+
Training the DeVRF is quite challenging, mainly because a large number of model parameters may lead to overfitting or suboptimal solutions. This section describes the training strategy and optimization losses that we design to facilitate fast optimization of the DeVRF.
|
| 82 |
+
|
| 83 |
+
Coarse-to-Fine Optimization. For a dense 4D voxel deformation field with $N _ { t } \times C \times N _ { x } \times N _ { y } \times N _ { z }$ resolution, there could be millions of free parameters, which are prone to overfitting and suboptimal solutions. To solve this problem, we employ a coarse-to-fine training strategy. Specifically, in our experiments, we progressively up-scale the $x$ -y- $z$ resolution of the 4D voxel deformation field from $1 0 \times 1 0 \times 1 0$ to $1 6 0 \times 1 6 0 \times 1 6 0$ . With this strategy, the 4D voxel deformation field first learns a rough motion at the coarse stage, which is thereafter progressively refined in finer stages. Our experiments demonstrate that the coarse-to-fine strategy can effectively smoothen the optimization landscape of the 4D voxel deformation field and remove most suboptimal solutions, thus largely improving the training efficiency and accuracy.
|
| 84 |
+
|
| 85 |
+
Re-rendering Loss. With sampled properties at $\mathcal { X } _ { t }$ , the color of a pixel can be calculated through volume rendering, i.e., by integrating the density and color of $\mathcal { X } _ { t }$ along a ray $\mathbf { r }$ [20]:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\hat { C } \left( { \bf { r } } \right) = \sum _ { i = 1 } ^ { N _ { r } } { T _ { i } \left( { 1 - \exp \left( { - \sigma _ { i } { \delta _ { i } } } \right) } \right) { c _ { i } } + { T _ { N _ { r } + 1 } } { \bf { c } } _ { \mathrm { { b g } } } } , { T _ { i } } = \exp \left( { - \sum _ { j = 1 } ^ { i - 1 } { \sigma _ { j } { \delta _ { j } } } } \right) \mathrm { ~ , ~ }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $N _ { r }$ is the number of sampled deformed points along the ray, $T _ { i }$ represents the probability of light transmitting through ray $\mathbf { r }$ to the $i$ -th sampled point, and $1 - \exp \left( - \sigma _ { i } \delta _ { i } \right)$ is the probability
|
| 92 |
+
|
| 93 |
+
that light terminates at the $i$ -th point. $\delta _ { i }$ is the distance between adjacent sampled points, and $\sigma _ { i } , \ : c _ { i }$ denote the density and color of deformed point $i$ , respectively. $\mathbf { c } _ { \mathrm { b g } }$ is the pre-defined background color.
|
| 94 |
+
|
| 95 |
+
Given the few-view training dynamic sequences with calibrated poses $\{ \mathbf { I } _ { \mathrm { D } } \}$ , DeVRF is optimized by minimizing the photometric MSE loss between the observed pixels color $C \left( \mathbf { r } \right)$ and the rendered pixels color $\hat { C } \left( \mathbf { r } \right)$ :
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\mathcal { L } _ { \mathrm { R e n d e r } } = \frac { 1 } { \left| \mathcal { R } \right| } \sum _ { \mathbf { r } \in \mathcal { R } } \left\| \hat { C } \left( \mathbf { r } \right) - C \left( \mathbf { r } \right) \right\| _ { 2 } ^ { 2 } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\mathcal { R }$ is the set of rays in a mini-batch.
|
| 102 |
+
|
| 103 |
+
4D Deformation Cycle Consistency. As illustrated in Fig. 2(d), the forward deformation is modeled as 4D forward deformation voxels with the same resolution as the 4D backward deformation voxels, and we enforce 4D deformation cycle consistency between backward and forward motion, which regularizes the learned deformation field. In the 4D deformation cycle, backward motion vectors $\Delta \mathcal { X } _ { t 0 }$ models the motion from $\mathcal { X } _ { t }$ to $\mathcal { X } _ { 0 }$ ; in contrast, forward motion vectors $\Delta \mathcal { X } _ { 0 t }$ models the motion from $\mathcal { X } _ { 0 }$ to their corresponding 3D points in the dynamic space $\tilde { \mathcal { X } } _ { t } = \{ \tilde { \mathbf { X } } _ { i } ^ { t } \mid \tilde { \mathbf { X } } _ { i } ^ { t } =$ $\mathbf { X } _ { i } ^ { 0 } + \Delta \mathbf { X } _ { i } ^ { 0 t } \}$ . The 4D motion cycle consistency can now be realized by minimizing the following cycle consistency loss $\mathcal { L } _ { \mathrm { C y c l e } } \left( t \right)$ ,
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathcal { L } _ { \mathrm { C y c l e } } \left( t \right) = \frac { 1 } { 2 N _ { s } } \sum _ { i = 1 } ^ { N _ { s } } { \left\| \mathbf { X } _ { i } ^ { t } - \tilde { \mathbf { X } } _ { i } ^ { t } \right\| _ { 2 } ^ { 2 } } ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $N _ { s }$ is the number of sampled 3D points in a mini-batch.
|
| 110 |
+
|
| 111 |
+
Optical Flow Supervision. The DeVRF is indirectly supervised by 2D optical flows estimated from consecutive frames of each dynamic sequence using a pre-trained RAFT model [37]. For $\mathcal { X } _ { t }$ and their corresponding $\mathcal { X } _ { 0 }$ , we first compute the corresponding 3D points of $\mathcal { X } _ { 0 }$ at $t - 1$ time step via forward motion $\tilde { \mathcal { X } } _ { t - 1 } = \{ \tilde { \mathbf { X } } _ { i } ^ { t - 1 } \mid \tilde { \mathbf { X } } _ { i } ^ { t - 1 } = \mathbf { X } _ { i } ^ { 0 } + \Delta \mathbf { X } _ { i } ^ { 0 t - 1 } \}$ . After that, we project $\tilde { \mathcal { X } } _ { t - 1 }$ onto the reference camera and get their pixel locations P˜t−1 = {P˜ t−1i }, and compute the induced optical flow with respect to the pixel location ${ \mathcal { P } } _ { t } = \{ { \bf P } _ { i } ^ { t } \}$ from which the rays of $\mathcal { X } _ { t }$ are cast. We enforce the induced flow to be the same as the estimated flow by minimizing $\mathcal { L } _ { \mathrm { F l o w } } \left( t \right)$ ,
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathcal { L } _ { \mathrm { F l o w } } \left( t \right) = \frac { 1 } { \vert \mathcal { R } \vert } \sum _ { \mathbf { r } \in \mathcal { R } } \sum _ { i = 1 } ^ { N _ { r } } w _ { \mathbf { r } , i } \left. \left( \tilde { \mathbf { P } } _ { \mathbf { r } , i } ^ { t - 1 } - \mathbf { P } _ { \mathbf { r } , i } ^ { t } \right) - \mathbf { f } _ { \mathbf { P } _ { \mathbf { r } , i } ^ { t } } \right. ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
estimated 2D backward optical flow at pixel where $w _ { \mathbf { r } , i } = T _ { i } \left( 1 - \exp \left( - \sigma _ { i } \delta _ { i } \right) \right)$ is the ray termination weights from Eq. (3), and $\mathbf { P } _ { \mathbf { r } , i } ^ { t }$ . $\mathbf { f } _ { \mathbf { P } _ { \mathbf { r } , i } ^ { t } }$ is the
|
| 118 |
+
|
| 119 |
+
Total Variation Regularization. We additionally employ a total variation prior [30] when training the 4D voxel deformation field to enforce the motion smoothness between neighboring voxels. At time step $t$ ,
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\mathcal { L } _ { \mathrm { T V } } \left( t \right) = \frac { 1 } { 2 \bar { N } } \sum _ { i = 1 } ^ { \bar { N } } \sum _ { d \in C } \left( \Delta _ { x } ^ { 2 } \left( \mathbf { v } _ { i } \left( t \right) , d \right) + \Delta _ { y } ^ { 2 } \left( \mathbf { v } _ { i } \left( t \right) , d \right) + \Delta _ { z } ^ { 2 } \left( \mathbf { v } _ { i } \left( t \right) , d \right) \right) ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $\Delta _ { x , y , z } ^ { 2 }$ is the squared difference of motion vectors between voxel $\mathbf { v } _ { i }$ and its neighbors along $x , y , z$ axes. $\bar { N } = N _ { x } \times N _ { y } \times N _ { z }$ denotes the number of voxels.
|
| 126 |
+
|
| 127 |
+
Training Objective. The overall training objective of DeVRF is the combination of per-pixel rerendering loss $\mathcal { L } _ { \mathrm { R e n d e r } }$ , cycle consistency loss $\mathcal { L } _ { \mathrm { C y c l e } }$ , optical flow loss $\mathcal { L } _ { \mathrm { F l o w } }$ , and total variation regularization ${ \mathcal { L } } _ { \mathrm { T V } }$ :
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\mathcal { L } = \omega _ { \mathrm { R e n d e r } } \cdot \mathcal { L } _ { \mathrm { R e n d e r } } + \omega _ { \mathrm { C y c l e } } \cdot \mathcal { L } _ { \mathrm { C y c l e } } + \omega _ { \mathrm { F l o w } } \cdot \mathcal { L } _ { \mathrm { F l o w } } + \omega _ { \mathrm { T V } } \mathcal { L } _ { \mathrm { T V } } ,
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $\omega _ { \mathrm { R e n d e r } }$ , $\omega _ { \mathrm { C y c l e } }$ , $\omega _ { \mathrm { F l o w } }$ , $\omega _ { \mathrm { T V } }$ are weights for corresponding losses.
|
| 134 |
+
|
| 135 |
+
Table 2: Averaged quantitative evaluation on inward-facing synthetic and real-world scenes against baselines and ablations of our method. We color code each cell as best , second best , and third best .
|
| 136 |
+
|
| 137 |
+
<table><tr><td></td><td colspan="4">SYNTHETIC INWARD-FACING</td><td colspan="4">REAL-WORLD INWARD-FACING</td></tr><tr><td></td><td>PSNR↑ SSIM↑LPIPS↓GPU(GB)↓</td><td></td><td>Time↓</td><td></td><td>PSNR↑SSIM↑LPIPS↓GPU(GB)↓Time↓</td><td></td><td></td><td></td></tr><tr><td>Neural Volumes [18]</td><td>9.620 0.532</td><td>0.5520 19.4</td><td></td><td>22.4hrs</td><td>17.29</td><td>0.6080.3440</td><td>19.2</td><td>22.0hrs</td></tr><tr><td>D-NeRF[27]</td><td>31.83 0.960 0.0355</td><td>10.0</td><td></td><td>18.4hrs</td><td>29.15</td><td>0.946 0.0643</td><td>12.4</td><td>22.1hrs</td></tr><tr><td>D-NeRF [27]-2 stage</td><td>28.29 0.945 0.0528</td><td>9.7</td><td></td><td>18.4hrs</td><td>27.21</td><td>0.936 0.0706</td><td>13.2</td><td>22.2hrs</td></tr><tr><td>D-NeRF [27]-dynamic</td><td>17.59 0.839 0.2058</td><td>9.8</td><td></td><td>21.9hrs</td><td></td><td>21.74 0.911 0.0906</td><td>13.5</td><td>22.3hrs</td></tr><tr><td>Nerfies [24]</td><td>33.09 0.989</td><td>0.0432 21.8</td><td></td><td>18.7hrs</td><td>29.58</td><td>0.980 0.0576</td><td>22.5</td><td>19.1hrs</td></tr><tr><td>Nerfies [24]-2 stage</td><td>32.37 0.991</td><td>0.0322 22.0</td><td></td><td>15.8hrs</td><td>23.93</td><td>0.920 0.0878</td><td>22.0</td><td>19.7hrs</td></tr><tr><td>Nerfies [24]-dynamic</td><td>19.45 0.794</td><td>0.1674 22.0</td><td></td><td>21.3hrs</td><td>20.70</td><td>0.910 0.1080</td><td>22.0</td><td>19.6hrs</td></tr><tr><td>HyperNeRF[25]</td><td>33.73 0.965</td><td>0.0335 22.5</td><td></td><td>20.5hrs</td><td>28.50</td><td>0.944 0.0692</td><td>22.0</td><td>20.5hrs</td></tr><tr><td>HyperNeRF[25]-2 stage</td><td>29.16 0.953</td><td>0.0555 22.5</td><td></td><td>19.2hrs</td><td>26.53</td><td>0.935 0.0802</td><td>22.0</td><td>19.3hrs</td></tr><tr><td>HyperNeRF [25]-dynamic</td><td>18.00 0.786 0.2173</td><td>22.4</td><td></td><td>20.6hrs</td><td>10.39</td><td>0.734 0.3990</td><td>22.0</td><td>20.5hrs</td></tr><tr><td>NSFF[16]</td><td>27.06 0.936</td><td>0.0800 21.4</td><td></td><td>12.8hrs</td><td>28.44</td><td>0.939 0.0714</td><td>22.7</td><td>15.3hrs</td></tr><tr><td>NSFF [16]-dynamic</td><td>18.18 0.858</td><td>30.1929 15.0</td><td></td><td>15.5hrs</td><td>19.90</td><td>0.909 0.0944</td><td>22.7</td><td>16.2hrs</td></tr><tr><td>Ours (base)</td><td>22.44 0.887</td><td>0.1173 4.4</td><td></td><td>8mins</td><td>24.56</td><td>0.917 0.0844</td><td>6.6</td><td>10mins</td></tr><tr><td>Ours w/ c2f</td><td>31.97 0.975</td><td>50.0185 4.4</td><td></td><td>7mins</td><td>27.83</td><td>0.956 0.0465</td><td>6.6</td><td>10mins</td></tr><tr><td>Ours w/ c2f, tv</td><td>32.73 0.963</td><td>0.0172 4.4</td><td></td><td>7mins</td><td>29.35</td><td>0.959 0.0434</td><td>6.6</td><td>10mins</td></tr><tr><td>Ours w/ c2f,tv,cycle</td><td>33.97 0.981</td><td>0.0142 4.4</td><td></td><td>8mins</td><td>31.56</td><td>0.971 0.0292</td><td>6.6</td><td>11mins</td></tr><tr><td>Ours w/c2f,tv,cycle,flow</td><td>34.29 0.982</td><td>0.0137 4.4</td><td></td><td>8mins</td><td>31.68</td><td>0.972 0.0289</td><td>6.6</td><td>11mins</td></tr></table>
|
| 138 |
+
|
| 139 |
+
# 4 Experiments
|
| 140 |
+
|
| 141 |
+
We extensively evaluate the DeVRF on various types of datasets, including five synthetic3 $3 6 0 ^ { \circ }$ inward-facing dynamic scenes, two real-world forward-facing dynamic scenes, and one real-world $3 6 0 ^ { \circ }$ inward-facing dynamic scene. We run all experiments on a single NVIDIA GeForce RTX3090 GPU. During training, we set $\omega _ { \mathrm { R e n d e r } } = 1$ , $\omega _ { \mathrm { C y c l e } } = 1 0 0$ , $\omega _ { \mathrm { F l o w } } = 0 . 0 0 5$ , and $\omega _ { \mathrm { T V } } = 1$ for all scenes.
|
| 142 |
+
|
| 143 |
+
# 4.1 Comparisons with SOTA Approaches
|
| 144 |
+
|
| 145 |
+
To demonstrate the performance of DeVRF, we compare DeVRF to various types of SOTA approaches, including a volumetric method Neural Volumes [18], NeRF-based methods D-NeRF [27], Nerfies [24], HyperNeRF [25], and a time-modulated method NSFF [16]. For a fair comparison, since DeVRF follows a static dynamic learning paradigm, we additionally implement 2-stage versions of D-NeRF, Nerfies, and HyperNeRF to learn a canonical space prior in the first stage and then optimize a deformation network in the second stage. To show the effectiveness of our low-cost capture strategy for dynamic scenes, we also train these baselines using only a few-view dynamic sequences and observe a significant performance drop compared to those trained with both static and dynamic data. For quantitative comparison, peak signal-to-noise ratio (PSNR), structural similarity index (SSIM) [40], and Learned Perceptual Image Patch Similarity (LPIPS) [47] with VGG [33] are employed as evaluation metrics 4.
|
| 146 |
+
|
| 147 |
+
Evaluation on inward-facing synthetic and real-world deformable scenes. We selected five synthetic dynamic scenes with various types of deformations and motions, and rendered synthetic images in $4 0 0 \times 4 0 0$ pixels under the $3 6 0 ^ { \circ }$ inward-facing setup. For each scene, we use 100-view static images and 4-view dynamic sequences with 50 frames (i.e., time steps) as training data for all approaches, and randomly select another 2 views at each time step for test. In addition, we collected one $3 6 0 ^ { \circ }$ inward-facing real-world deformable scene in $5 4 0 \times 9 6 0$ pixels. With our data capture setup, only 4 cameras are required to capture dynamic scenes, and we choose 3 views of them as training data and the other view as test data.
|
| 148 |
+
|
| 149 |
+
We report the metrics of the real-world scene as well as the average metrics of five synthetic scenes for all approaches in Tab. 2 and leave the per-scene metrics to supplementary material. As shown in Tab. 2, for synthetic and real-world scenes, DeVRF achieves the best performance in terms of PSNR and LPIPS, and the second- or third-best in terms of SSIM among all approaches. Most importantly, our per-scene optimization only takes less than 10mins with 4.4GB to 6.6GB GPU memory on a
|
| 150 |
+
|
| 151 |
+
For the red box region of each scene, we show its zoom-in at the bottom-right of each picture single NVIDIA GeForce RTX3090 GPU, which is about two orders of magnitude faster than other approaches. The above quantitative comparison demonstrates the efficiency and effectiveness of DeVRF. Besides, the qualitative results of DeVRF and baselines on synthetic and real-world scenes are illustrated in Fig. 3, where DeVRF achieves on-par high-fidelity in comparison to SOTA methods. Please see the supplementary video for more results.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Qualitative comparisons of baselines and DeVRF on synthetic and real-world scenes.
|
| 155 |
+
|
| 156 |
+
For a fair comparison, we additionally report the results of the 2-stage versions for D-NeRF [27], Nerfies [24], and HyperNeRF [25] in Tab. 2. Since these approaches are not designed to separately learn a canonical space and a deformation field, there is no significant difference in the results between their 2-stage versions and 1-stage versions using the training dataset. Furthermore, we also report the results of these baselines trained with dynamic data only (baseline-dynamic) in Tab. 2. Their performances drop significantly compared to the results trained with both static and dynamic data. In addition, since Neural Volumes [18] requires dozens of dynamic sequences as input, its performance is poor with our few-view dynamic sequences. The experimental results not only show the effectiveness of our low-cost data capture process and the proposed DeVRF model; but also validate our observation that few-view dynamic sequences alone fail to provide complete information about the dynamic scene, while static multi-view data can favorably serve as a supplement.
|
| 157 |
+
|
| 158 |
+
Table 3: Quantitative evaluation on forward-facing real-world scenes against baselines and ablations of our system. We color code each cell as best , second best , and third best .
|
| 159 |
+
|
| 160 |
+
<table><tr><td></td><td colspan="3">PLANT</td><td colspan="3">RABBIT</td></tr><tr><td></td><td>PSNR↑ SSIM↑LPIPS↓GPU(GB)↓</td><td></td><td>Time↓</td><td>PSNR↑ SSIM↑LPIPS↓GPU(GB)↓</td><td></td><td>Time↓</td></tr><tr><td>D-NeRF[27]</td><td>31.94 0.979 0.0251</td><td>11.4</td><td>21.5hrs</td><td>33.51( 0.974 0.0384</td><td>11.4</td><td>21.7hrs</td></tr><tr><td>Nerfies [24]</td><td>31.36 0.991 0.0309</td><td>21.9</td><td>18.3hrs</td><td>24.83 0.952 0.0795</td><td>21.9</td><td>19.8hrs</td></tr><tr><td>HyperNeRF [25]</td><td>32.08 0.978 0.0331</td><td>22.0</td><td>20.0hrs</td><td>24.97 0.942 0.0849</td><td>22.0</td><td>20.7hrs</td></tr><tr><td>NSFF[16]</td><td>29.45 0.966 0.0526</td><td>20.2</td><td>14.5hrs</td><td>27.68 0.945 0.0854</td><td>20.2</td><td>14.5hrs</td></tr><tr><td>Ours (base)</td><td>26.13 0.946 0.0722</td><td>8.1</td><td>8mins</td><td>25.58 0.910 0.1300</td><td>8.9</td><td>6mins</td></tr><tr><td>Ours w/ c2f</td><td>31.85 0.980 0.0275</td><td>8.1</td><td>8mins</td><td>26.79 0.938 0.0946</td><td>8.9</td><td>6mins</td></tr><tr><td>Ours w/ c2f, tv</td><td>31.89 0.980 0.0263</td><td>8.1</td><td>8mins</td><td>29.28 0.951 0.0655</td><td>8.9</td><td>6mins</td></tr><tr><td>Ours w/ c2f,tv, cycle</td><td>31.99 0.981 0.0235</td><td>8.1</td><td>9mins</td><td>31.05 0.963 30.0543</td><td>8.9</td><td>7mins</td></tr><tr><td>Ours w/c2f,tv,cycle,flow</td><td>32.01 0.981 0.0236</td><td>8.1</td><td>10mins</td><td>32.05 0.966 0.0492</td><td>8.9</td><td>7mins</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Evaluation on forward-facing real-world deformable scenes. We collected two forward-facing real-world deformable scenes in $5 4 0 \times 9 6 0$ pixels using 4 cameras, and we chose 3 views of them as training data and the other view as test data. To handle forward-facing scenes, we adapt $_ \mathrm { D e V R F }$ to use normalized device coordinates (NDC) and multi-plane images (MPI) as in DVGO [35]. As shown in Tab. 3, DeVRF achieves the best result in the plant scene in terms of LPIPS metric and the second-best result in the rabbit scene in terms of all metrics. Fig. 3 also demonstrates qualitative comparisons on these two scenes.
|
| 163 |
+
|
| 164 |
+
# 4.2 Ablation Study
|
| 165 |
+
|
| 166 |
+
Ablation study of DeVRF components. We carry out ablation studies on both synthetic and realworld scenes to evaluate the effectiveness of each proposed component in DeVRF. We progressively ablate each component from optical flow, cycle consistency, total variation, to coarse-to-fine strategy. As shown in Tab. 2 and 3, the performance of DeVRF progressively drops with the disabling of each component, where disabling the coarse-to-fine training strategy causes the most significant performance drop. This is as expected since the coarse-to-fine training strategy is critical to reducing local minimums during optimization.
|
| 167 |
+
|
| 168 |
+
For the red box region of each scene, we show its zoom-in at the bottom-right of each picture
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Qualitative results of DeVRF with different numbers of dynamic training views.
|
| 172 |
+
|
| 173 |
+
Ablation study of dynamic training views on synthetic dataset. Our static dynamic learning paradigm is based on a low-cost yet effective capture setup: the multi-view static images provide complete 3D geometry and appearance information of the scene, while few-view dynamic sequences show how the scene deforms in 3D space over time. The entire capture process only requires a few cameras that are convenient to deploy in practice. To evaluate the influence of the number of dynamic views, we conduct additional ablations for DeVRF on five inward-facing synthetic dynamic scenes and report the per-scene metrics as well as the average metrics with respect to the number of dynamic training views. As shown in Fig. 5, given the same multi-view static images, the performance of DeVRF largely improves with the increment of dynamic training views and almost saturates at six dynamic views, and the four dynamic training views used in our paper can yield comparable results compared to six dynamic views. We additionally visualize the qualitative results of $_ \mathrm { D e V R F }$ with different numbers of dynamic training views in Fig. 4. Therefore, in our static dynamic learning paradigm, with static multi-view data as a supplement, only a few (e.g., four) dynamic views are required to significantly boost the performance of dynamic neural radiance fields reconstruction. This further demonstrates the effectiveness of our low-cost data capture process and the DeVRF model.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 5: Ablation evaluation on the number of dynamic training views: (a) PSNR, (b) LPIPS.
|
| 177 |
+
|
| 178 |
+
# 5 Conclusion
|
| 179 |
+
|
| 180 |
+
We introduced DeVRF, a novel approach to tackle the challenging task of fast non-rigid radiance field reconstruction by modeling both the 3D canonical space and 4D deformation field of a dynamic scene with voxel-based representations. The DeVRF can be efficiently optimized in two major steps. We first proposed a static dynamic learning paradigm to pinpoint that the 3D volumetric canonical prior can be effectively transferred into the 4D voxel deformation field. Second, based on this learning paradigm, we developed a series of optimization strategies, including coarse-to-fine learning, deformation cycle consistency, optical flow supervisions, and total variation priors. Such DeVRF finally produced a $1 0 0 \times$ faster training efficiency with on-par high-fidelity results in comparison to SOTA approaches. We believe our DeVRF can provide a complement to existing literature and new insights into the view synthesis community.
|
| 181 |
+
|
| 182 |
+
Limitations and Future Work. Although DeVRF achieves fast deformable radiance field reconstruction, the model size is large due to its large number of parameters. In addition, DeVRF currently does not synchronously optimize the 3D canonical space prior during the second stage, and thus may not be able to model drastic deformations. We consider these limitations as faithful future directions.
|
| 183 |
+
|
| 184 |
+
# 6 Acknowledgements
|
| 185 |
+
|
| 186 |
+
This project is supported by the National Research Foundation, Singapore under its NRFF Award NRF-NRFF13-2021-0008, Mike Zheng Shou’s Start-Up Grant from NUS, and National Research Foundation, Singapore and A\*STAR, under its RIE2020 Industry Alignment Fund – Industry Collaboration Projects (IAF-ICP) grant call (Grant No. I2001E0059). The computational work for this article was partially performed on resources of the National Supercomputing Centre, Singapore. Jia-Wei Liu is supported by NUS IDS-ISEP scholarship.
|
| 187 |
+
|
| 188 |
+
References
|
| 189 |
+
[1] Aayush Bansal, Minh Vo, Yaser Sheikh, Deva Ramanan, and Srinivasa Narasimhan. 4d visualization of dynamic events from unconstrained multi-view videos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5366–5375, 2020.
|
| 190 |
+
[2] Jonathan T Barron, Ben Mildenhall, Matthew Tancik, Peter Hedman, Ricardo Martin-Brualla, and Pratul P Srinivasan. Mip-nerf: A multiscale representation for anti-aliasing neural radiance fields. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5855–5864, 2021.
|
| 191 |
+
[3] Jonathan Baxter. A model of inductive bias learning. Journal of artificial intelligence research, 12:149–198, 2000.
|
| 192 |
+
[4] Chris Buehler, Michael Bosse, Leonard McMillan, Steven Gortler, and Michael Cohen. Unstructured lumigraph rendering. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pages 425–432, 2001.
|
| 193 |
+
[5] Alvaro Collet, Ming Chuang, Pat Sweeney, Don Gillett, Dennis Evseev, David Calabrese, Hugues Hoppe, Adam Kirk, and Steve Sullivan. High-quality streamable free-viewpoint video. ACM Transactions on Graphics (ToG), 34(4):1–13, 2015.
|
| 194 |
+
[6] Paul E Debevec, Camillo J Taylor, and Jitendra Malik. Modeling and rendering architecture from photographs: A hybrid geometry-and image-based approach. In Proceedings of the $2 3 r d$ annual conference on Computer graphics and interactive techniques, pages 11–20, 1996.
|
| 195 |
+
[7] Chen Gao, Ayush Saraf, Johannes Kopf, and Jia-Bin Huang. Dynamic view synthesis from dynamic monocular video. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5712–5721, 2021.
|
| 196 |
+
[8] Philip-William Grassal, Malte Prinzler, Titus Leistner, Carsten Rother, Matthias Nießner, and Justus Thies. Neural head avatars from monocular rgb videos. arXiv preprint arXiv:2112.01554, 2021.
|
| 197 |
+
[9] Peter Hedman, Tobias Ritschel, George Drettakis, and Gabriel Brostow. Scalable inside-out image-based rendering. ACM Trans. Graph., 35(6), nov 2016.
|
| 198 |
+
[10] Peter Hedman, Pratul P Srinivasan, Ben Mildenhall, Jonathan T Barron, and Paul Debevec. Baking neural radiance fields for real-time view synthesis. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5875–5884, 2021.
|
| 199 |
+
[11] Matthias Innmann, Michael Zollhöfer, Matthias Nießner, Christian Theobalt, and Marc Stamminger. Volumedeform: Real-time volumetric non-rigid reconstruction. In European Conference on Computer Vision, pages 362–379. Springer, 2016.
|
| 200 |
+
[12] Ajay Jain, Matthew Tancik, and Pieter Abbeel. Putting nerf on a diet: Semantically consistent few-shot view synthesis. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5885–5894, 2021.
|
| 201 |
+
[13] Hanqing Jiang, Haomin Liu, Ping Tan, Guofeng Zhang, and Hujun Bao. 3d reconstruction of dynamic scenes with multiple handheld cameras. In European Conference on Computer Vision, pages 601–615. Springer, 2012.
|
| 202 |
+
[14] Kiriakos N Kutulakos and Steven M Seitz. A theory of shape by space carving. International journal of computer vision, 38(3):199–218, 2000.
|
| 203 |
+
[15] Tianye Li, Mira Slavcheva, Michael Zollhoefer, Simon Green, Christoph Lassner, Changil Kim, Tanner Schmidt, Steven Lovegrove, Michael Goesele, Richard Newcombe, and Zhaoyang Lv. Neural 3d video synthesis from multi-view video. arXiv preprint arXiv:2103.02597, 2022.
|
| 204 |
+
[16] Zhengqi Li, Simon Niklaus, Noah Snavely, and Oliver Wang. Neural scene flow fields for space-time view synthesis of dynamic scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6498–6508, 2021.
|
| 205 |
+
|
| 206 |
+
[17] Lingjie Liu, Marc Habermann, Viktor Rudnev, Kripasindhu Sarkar, Jiatao Gu, and Christian Theobalt. Neural actor: Neural free-view synthesis of human actors with pose control. ACM Transactions on Graphics (TOG), 40(6):1–16, 2021.
|
| 207 |
+
|
| 208 |
+
[18] Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural volumes: Learning dynamic renderable volumes from images. arXiv preprint arXiv:1906.07751, 2019.
|
| 209 |
+
|
| 210 |
+
[19] Ben Mildenhall, Pratul P Srinivasan, Rodrigo Ortiz-Cayon, Nima Khademi Kalantari, Ravi Ramamoorthi, Ren $\mathrm { N g }$ , and Abhishek Kar. Local light field fusion: Practical view synthesis with prescriptive sampling guidelines. ACM Transactions on Graphics (TOG), 38(4):1–14, 2019.
|
| 211 |
+
|
| 212 |
+
[20] 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. In European conference on computer vision, pages 405–421. Springer, 2020.
|
| 213 |
+
|
| 214 |
+
[21] Xin Min, Wenqiao Zhang, Shouqian Sun, Nan Zhao, Siliang Tang, and Yueting Zhuang. Vpmodel: High-fidelity product simulation in a virtual-physical environment. IEEE transactions on visualization and computer graphics, 25(11):3083–3093, 2019.
|
| 215 |
+
|
| 216 |
+
[22] Thomas Müller, Alex Evans, Christoph Schied, and Alexander Keller. Instant neural graphics primitives with a multiresolution hash encoding. ACM Trans. Graph., 41(4):102:1–102:15, July 2022.
|
| 217 |
+
|
| 218 |
+
[23] Richard A Newcombe, Dieter Fox, and Steven M Seitz. Dynamicfusion: Reconstruction and tracking of non-rigid scenes in real-time. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 343–352, 2015.
|
| 219 |
+
|
| 220 |
+
[24] Keunhong Park, Utkarsh Sinha, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Steven M Seitz, and Ricardo Martin-Brualla. Nerfies: Deformable neural radiance fields. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5865–5874, 2021.
|
| 221 |
+
|
| 222 |
+
[25] Keunhong Park, Utkarsh Sinha, Peter Hedman, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Ricardo Martin-Brualla, and Steven M Seitz. Hypernerf: A higher-dimensional representation for topologically varying neural radiance fields. arXiv preprint arXiv:2106.13228, 2021.
|
| 223 |
+
|
| 224 |
+
[26] Sida Peng, Junting Dong, Qianqian Wang, Shangzhan Zhang, Qing Shuai, Xiaowei Zhou, and Hujun Bao. Animatable neural radiance fields for modeling dynamic human bodies. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14314– 14323, 2021.
|
| 225 |
+
|
| 226 |
+
[27] Albert Pumarola, Enric Corona, Gerard Pons-Moll, and Francesc Moreno-Noguer. D-nerf: Neural radiance fields for dynamic scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10318–10327, 2021.
|
| 227 |
+
|
| 228 |
+
[28] Christian Reiser, Songyou Peng, Yiyi Liao, and Andreas Geiger. Kilonerf: Speeding up neural radiance fields with thousands of tiny mlps. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14335–14345, 2021.
|
| 229 |
+
|
| 230 |
+
[29] Konstantinos Rematas, Andrew Liu, Pratul P Srinivasan, Jonathan T Barron, Andrea Tagliasacchi, Thomas Funkhouser, and Vittorio Ferrari. Urban radiance fields. arXiv preprint arXiv:2111.14643, 2021.
|
| 231 |
+
|
| 232 |
+
[30] Leonid I Rudin and Stanley Osher. Total variation based image restoration with free local constraints. In Proceedings of 1st international conference on image processing, volume 1, pages 31–35. IEEE, 1994.
|
| 233 |
+
|
| 234 |
+
[31] Steven M Seitz and Charles R Dyer. Photorealistic scene reconstruction by voxel coloring. International Journal of Computer Vision, 35(2):151–173, 1999.
|
| 235 |
+
|
| 236 |
+
[32] Ruizhi Shao, Hongwen Zhang, He Zhang, Mingjia Chen, Yanpei Cao, Tao Yu, and Yebin Liu. Doublefield: Bridging the neural surface and radiance fields for high-fidelity human reconstruction and rendering. In CVPR, 2022.
|
| 237 |
+
|
| 238 |
+
[33] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 239 |
+
|
| 240 |
+
[34] Haoxuan Song, Jiahui Huang, Yan-Pei Cao, and Tai-Jiang Mu. Hdr-net-fusion: Real-time 3d dynamic scene reconstruction with a hierarchical deep reinforcement network. Computational Visual Media, 7(4):419–435, 2021.
|
| 241 |
+
|
| 242 |
+
[35] Cheng Sun, Min Sun, and Hwann-Tzong Chen. Direct voxel grid optimization: Super-fast convergence for radiance fields reconstruction. arXiv preprint arXiv:2111.11215, 2021.
|
| 243 |
+
|
| 244 |
+
[36] Matthew Tancik, Vincent Casser, Xinchen Yan, Sabeek Pradhan, Ben Mildenhall, Pratul P Srinivasan, Jonathan T Barron, and Henrik Kretzschmar. Block-nerf: Scalable large scene neural view synthesis. arXiv preprint arXiv:2202.05263, 2022.
|
| 245 |
+
|
| 246 |
+
[37] Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In European conference on computer vision, pages 402–419. Springer, 2020.
|
| 247 |
+
|
| 248 |
+
[38] Edgar Tretschk, Ayush Tewari, Vladislav Golyanik, Michael Zollhöfer, Christoph Lassner, and Christian Theobalt. Non-rigid neural radiance fields: Reconstruction and novel view synthesis of a dynamic scene from monocular video. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 12959–12970, 2021.
|
| 249 |
+
|
| 250 |
+
[39] Liao Wang, Jiakai Zhang, Xinhang Liu, Fuqiang Zhao, Yanshun Zhang, Yingliang Zhang, Minye Wu, Lan Xu, and Jingyi Yu. Fourier plenoctrees for dynamic radiance field rendering in real-time. arXiv preprint arXiv:2202.08614, 2022.
|
| 251 |
+
|
| 252 |
+
[40] 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.
|
| 253 |
+
|
| 254 |
+
[41] Chung-Yi Weng, Brian Curless, Pratul P Srinivasan, Jonathan T Barron, and Ira KemelmacherShlizerman. Humannerf: Free-viewpoint rendering of moving people from monocular video. arXiv preprint arXiv:2201.04127, 2022.
|
| 255 |
+
|
| 256 |
+
[42] Wenqi Xian, Jia-Bin Huang, Johannes Kopf, and Changil Kim. Space-time neural irradiance fields for free-viewpoint video. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9421–9431, 2021.
|
| 257 |
+
|
| 258 |
+
[43] Yuanbo Xiangli, Linning Xu, Xingang Pan, Nanxuan Zhao, Anyi Rao, Christian Theobalt, Bo Dai, and Dahua Lin. Citynerf: Building nerf at city scale. arXiv preprint arXiv:2112.05504, 2021.
|
| 259 |
+
|
| 260 |
+
[44] Jae Shin Yoon, Kihwan Kim, Orazio Gallo, Hyun Soo Park, and Jan Kautz. Novel view synthesis of dynamic scenes with globally coherent depths from a monocular camera. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5336–5345, 2020.
|
| 261 |
+
|
| 262 |
+
[45] Alex Yu, Sara Fridovich-Keil, Matthew Tancik, Qinhong Chen, Benjamin Recht, and Angjoo Kanazawa. Plenoxels: Radiance fields without neural networks. arXiv preprint arXiv:2112.05131, 2021.
|
| 263 |
+
|
| 264 |
+
[46] Alex Yu, Ruilong Li, Matthew Tancik, Hao Li, Ren Ng, and Angjoo Kanazawa. Plenoctrees for real-time rendering of neural radiance fields. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5752–5761, 2021.
|
| 265 |
+
|
| 266 |
+
[47] 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, pages 586–595, 2018.
|
| 267 |
+
|
| 268 |
+
[48] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. arXiv preprint arXiv:1805.09817, 2018.
|
| 269 |
+
|
| 270 |
+
[49] C Lawrence Zitnick, Sing Bing Kang, Matthew Uyttendaele, Simon Winder, and Richard Szeliski. High-quality video view interpolation using a layered representation. ACM transactions on graphics (TOG), 23(3):600–608, 2004.
|
md/dev/S7Evzt9uit3/S7Evzt9uit3.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learning
|
| 2 |
+
|
| 3 |
+
Weixin Liang⇤ Stanford University wxliang@stanford.edu
|
| 4 |
+
|
| 5 |
+
Yuhui Zhang ⇤ Stanford University yuhuiz@stanford.edu
|
| 6 |
+
|
| 7 |
+
Yongchan Kwon ⇤ Columbia University yk3012@columbia.edu
|
| 8 |
+
|
| 9 |
+
Serena Yeung Stanford University syyeung@stanford.edu
|
| 10 |
+
|
| 11 |
+
James Zou Stanford University jamesz@stanford.edu
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
We present modality gap, an intriguing geometric phenomenon of the representation space of multi-modal models. Specifically, we show that different data modalities (e.g. images and text) are embedded at arm’s length in their shared representation in multi-modal models such as CLIP. Our systematic analysis demonstrates that this gap is caused by a combination of model initialization and contrastive learning optimization. In model initialization, we show empirically and theoretically that the representation of a common deep neural network is restricted to a narrow cone. As a consequence, in a multi-modal model with two encoders, the representations of the two modalities are clearly apart when the model is initialized. During optimization, contrastive learning keeps the different modalities separated by a certain distance, which is influenced by the temperature parameter in the loss function. Our experiments further demonstrate that varying the modality gap distance has a significant impact in improving the model’s downstream zeroshot classification performance and fairness. Our code and data are available at https://modalitygap.readthedocs.io/
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Multi-modal models map inputs from different data modalities (e.g. image and text) into a shared representation space (Figure 1 (a)). It has garnered tremendous interest and excitement as a framework for data integration. As a prominent example pre-trained on a web-scale collection of images and natural language, OpenAI’s CLIP model [39], has learned diverse visual concepts that can readily be transferred to downstream tasks through prompting: one can perform “zero-shot” visual classification by simply providing the names of the visual categories to be recognized.
|
| 20 |
+
|
| 21 |
+
In this work, we present the modality gap phenomenon: As shown in Figure 1 (b), CLIP’s image embeddings and text embeddings are located in two completely separate regions of the embedding space. We find this phenomenon consistently across various multi-modal models, covering texts, natural images [39], videos [50], medical images [53], and amino-acid sequences [11]. Interestingly, this phenomenon still holds even when we embed using multi-modal models with random weights (Figure 1 (c)). While it might seem reasonable to attribute the gap to differences in data distributions or to the different encoder architectures, we showed that these factors are not the fundamental cause.
|
| 22 |
+
|
| 23 |
+
This paper provides a three-part explanation for the modality gap phenomenon. (1) The general inductive bias of deep neural architecture creates a cone effect: The effective embedding space is restricted to a narrow cone for pre-trained models or models with random weights. (2) Different random initializations create different embedding cones. Since a multi-modal model consists of two encoders, which create different cones at random initialization, this explains how the modality gap is present at initialization. (3) The contrastive learning objective commonly used by multi-modal models preserves the gap. We support our explanations with theory and experiments. Our theoretical analysis shows that under mild assumptions, each neural network layer shrinks the angle between any pair of embedding vectors with high probability, thereby creating more narrow cones in deeper architectures. We further prove that different random initializations of model weights result in different cones. Interestingly, increasing the modality gap in models like CLIP can improve its downstream performance on several zero-shot learning and fairness tasks. The main objective of our paper is to i) empirically demonstrate the modality gap phenomenon across different data modalities and NN architectures; ii) explain how the gap arises and iii) show that the size of the gap can affect downstream applications. It is not our goal to propose a method to close the gap, since it’s not clear that it’s desirable to have no modality gap. Together, this paper makes the following contributions:
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: The pervasive modality gap in multi-modal contrastive representation learning. (a) Overview of multi-modal contrastive learning. Paired inputs from two modalities (e.g., image-caption) are sampled from the dataset and embedded into the hypersphere using two different encoders. The loss function is to maximize the cosine similarity between matched pairs given all the pairs within the same batch. (b) UMAP visualization of generated embeddings from pre-trained models. Paired inputs are fed into the pre-trained models and the embeddings are visualized in 2D using UMAP (lines indicate pairs). We observe a clear modality gap for various models trained on different modalities. (c) UMAP visualization of generated embeddings from same architectures with random weights. Modality gap exists in the initialization stage without any training.
|
| 27 |
+
|
| 28 |
+
1. To the best of our knowledge, we demonstrate a general modality gap phenomenon for the first time. We show that this phenomenon holds across a wide spectrum of multi-modal models, covering texts, natural images, videos, medical images, and amino-acid sequences. 2. We demonstrate the significant implications of modifying the gap in downstream applications. By simply modifying the gap’s distance, we can improve CLIP’s zero-shot performance and fairness. 3. To explain modality gap, we provide a three-part explanation supported by extensive theoretical and empirical analyses. Our analyses also provide new insights on the cone effect, which we show is a general phenomenon for deep neural networks. Existing work focuses on trained language models and attributes the cone effect to the optimization under unbalanced word frequencies distribution. We demonstrate that this effect holds not only across various modalities and network architectures, but also on random noise inputs and random weights, which is not captured in previous work.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
(c) UMAP visualization of embeddings of 25 randomly initialized models on real data (color indicates random seed)
|
| 32 |
+
Figure 2: The cone effect phenomenon. (a) Histograms of the cosine similarity between all pairs of embeddings across various settings. The average cosine similarity is substantially larger than 0, indicating that the embedding space is a narrow cone. The cone effect also holds on randomly initialized models, and on random noise inputs. (b) Effects of nonlinear activation and depth. Inputs are 512-dim standard normal random vector. All MLP linear layers are $5 1 2 \times 5 1 2$ , with both weight and bias randomly initialized from $\textstyle { \mathcal { N } } ( 0 , { \frac { 1 } { 5 1 2 } } )$ . Y axis is the average cosine similarity between pairs of embeddings. (c) UMAP visualization of embeddings of 25 randomly initialized models (without training) on real data. Each random initialization forms a distinctively different cone. Real Data: 5,000 image-caption pairs from the validation set of MSCOCO Caption. Random Noise: Gaussian noise from the standard normal distribution as images, uniformly random integer sequences as texts.
|
| 33 |
+
|
| 34 |
+
4. We mathematically characterize the contraction mapping induced by linear layers with ReLU non-linearities to explain the cone effect. Our theory matches well with experiments and provides insights for understanding the general inductive biases of deep neural networks.
|
| 35 |
+
|
| 36 |
+
# 2 The Cone Effect Induces A Modality Gap
|
| 37 |
+
|
| 38 |
+
# 2.1 The Narrow Cone of Embeddings
|
| 39 |
+
|
| 40 |
+
In order for modality gap to exist, the embeddings from a encoder should be concentrated around a subregion of the full embedding space—otherwise, the embeddings from different encoders would overlap. Motivated by this, we begin our investigation by showing that the modality gap already arises at random model initialization due to the cone effect: The effective embedding space is restricted to a narrow cone for trained models and models with random weights. To demonstrate this, we extract 5,000 embeddings from the final layer of 3 pre-trained models respectively (ResNet, Vision Transformer, Text Transformer)2 on MSCOCO Caption [8]. We then compute the cosine similarity between all possible pairs of the 5,000 embeddings within each model (Figure 2 (a)). We found that both the average cosine similarity (0.56, 0.47, 0.51 respectively for the 3 models) and the minimum cosine similarity (0.23, 0.05, 0.01) are positive. These results indicate that the embedding space is a narrow cone.
|
| 41 |
+
|
| 42 |
+
In the literature, the cone effect has been observed in the language representations from language models (e.g., BERT) [12]. A common explanation is that the unbalanced distribution of word frequencies biased the optimization [15, 33]. However, we found that the cone effect still exists in models with random weights (Figure 2 (c)). In fact, the average cosine similarity there is even higher than in trained models. For example, any two embeddings from a randomly initialized ResNet have on average an almost perfect (0.99) cosine similarity. Interestingly, the cone effect still holds when the input data is random noise3, indicating that unbalanced data distribution suggested in previous works is not necessary for the cone effect. Together these experiments suggest that the cone effect reflects a more general inductive bias of deep networks than might be previously appreciated.
|
| 43 |
+
|
| 44 |
+
How narrow is the cone in 512-dim representation space? We clarify that a cosine similarity with 0.56 already indicates that the embedding space is actually an extremely narrow cone in the 512-dimensional feature space. Consider the fraction of surface area in a unit hypersphere: In 2D, arccos $( 0 . 5 6 ) { = } 5 5 . 9 4 ^ { \circ }$ , indicating that a cosine similarity of 0.56 can “occupy” $5 5 . 9 4 ^ { \circ } / 3 6 0 ^ { \circ } = 1 5 . 5 3 \%$ of the 2D unit circle. In 3D, a cosine similarity of 0.56 can “occupy” 2⇡r2(1 cos 55.94°2 )4⇡r2 of the 3D unit sphere. In 512D, a cosine similarity of 0.56 can “occupy” less than $\frac { 1 } { 2 ^ { 5 1 2 } }$ fraction of the surface area in a unit 512D hypersphere. These evidences show that the effective embedding space is restricted to an extremely narrow cone.
|
| 45 |
+
|
| 46 |
+
# 2.2 The effects of non-linear activation on cone effect
|
| 47 |
+
|
| 48 |
+
Design To study the effects of non-linear activation functions on the cone effect, we randomly initialized various MLPs with different non-linearities or without non-linearities. The inputs of the MLPs are 512-dim standard normal random vectors. All MLP linear layers are $5 1 2 \times 5 1 2$ , with both weight and bias randomly initialized from $\begin{array} { r } { \mathcal { N } ( 0 , \frac { 1 } { 5 1 2 } ) } \end{array}$ , here we denote a Gaussian distribution with mean $\mu$ and variance $\sigma ^ { 2 }$ by ${ \mathcal { N } } ( \mu , \sigma ^ { 2 } )$ .
|
| 49 |
+
|
| 50 |
+
Results As shown in Figure 2 (b), MLPs without non-linear activation shows little cone effect. However, with non-linearity, the average cosine similarity increases rapidly as the number of layers increases. For example, the average cosine similarity reaches 0.99 for a 2-layer MLP with Sigmoid. These results indicate that the non-linear activation functions play a crucial role in the cone effect.
|
| 51 |
+
|
| 52 |
+
Although it is easy to see that ReLU makes every coordinate non-negative, and thus cosine similarity after ReLU is guaranteed to be non-negative, we highlight that none of the 3 models in Figure 2 (a) has ReLU as the final layer before embedding extraction4. In addition, although all 3 models incorporate normalization layers such as batch norm [23] and layer norm [4] in their architectures, we still observe the cone effect. Further analyzing the connection between normalization and the cone effect is an interesting direction of future work.
|
| 53 |
+
|
| 54 |
+
# 2.3 Different random initializations create different cones
|
| 55 |
+
|
| 56 |
+
Next, we study the effect of different random initialization on the cone effect. In Figure 2 (c), we randomly initialized a model 25 times, and plotted its extracted embeddings on the same real data (i.e., MSCOCO Caption) via UMAP visualization [41]. We found that each random initialization forms a distinctively different cone. This phenomenon holds across various neural network architectures and input modalities (ResNet, Vision Transformer or Text Transformer), on ImageNet-pretrained models (Supp. Figure 13), on PCA visualization (Supp. Figure 7), or with random noise inputs (Supp. Figure 5). Since a multi-modal model consists of two encoders, which creates different cones at random initialization, this explains how the modality gap is present at initialization. While it might seem reasonable to attribute the modality gap to differences in data modalities [21], Figure 2 (c) shows the gap still exists even if the two encoders operate on the exact same data in the exact same modality. Therefore, the gap can exist without different modalities, and we emphasize that the modality gap phenomenon is non-trivial to understand.
|
| 57 |
+
|
| 58 |
+
# 3 Theoretical analysis
|
| 59 |
+
|
| 60 |
+
Here, we theoretically investigate the cone effect phenomenon. We show that (i) the cosine similarity increases as the layer gets deeper and (ii) the variance of an intermediate output mostly come from the model’s random initialization.
|
| 61 |
+
|
| 62 |
+
We first define some notations. We denote the ReLU activation by $\phi ( x ) \ : = \ \operatorname* { m a x } ( x , 0 )$ for $x \in \mathbb { R }$ , and we extend it by considering element-wise operation $\phi ( \mathbf { x } ) : = ( \phi ( x _ { 1 } ) , \ldots , \phi ( x _ { k } ) ) ^ { T } =$ $( \operatorname* { m a x } ( x _ { 1 } , 0 ) , \dots , \operatorname* { m a x } ( x _ { k } , 0 ) ) ^ { T }$ for a multivariate input $\mathbf { x } \ = \ ( x _ { 1 } , \ldots , x _ { k } ) ^ { T } \ \in \ \mathbb { R } ^ { k }$ and $k \in \mathbb N$ . The cosine similarity between two vectors $u , v \in \mathbb { R } ^ { k }$ is defined as $\begin{array} { r } { \cos ( u , v ) : = \frac { u ^ { T } v } { \| u \| \| v \| } } \end{array}$ where $\lVert \boldsymbol { u } \rVert = ( u ^ { T } u ) ^ { 1 / 2 }$ . Lastly, we set $[ k ] : = \{ 1 , \ldots , k \}$ for $k \in \mathbb N$ .
|
| 63 |
+
|
| 64 |
+
Each network layer increases cosine similarity. We study how the cosine similarity between two intermediate layer outputs changes when weight and bias terms in an MLP are fixed. The following theorem shows that with a high probability cosine similarity increases after one feedforward computation when the number of nodes in the output layer is large.
|
| 65 |
+
|
| 66 |
+
Theorem 1 (Monotonicity of cosine similarity). Suppose $u , v \in \mathbb { R } ^ { d _ { \mathrm { i n } } }$ are any two fixed vectors such that $\| u \| = r \| v \|$ for some $r > 0$ , $\mathbf { W } \in \mathbb { R } ^ { d _ { \mathrm { o u t } } \bar { \times } d _ { \mathrm { i n } } }$ is a random weight matrix where each element $\mathbf { W } _ { k , l } \sim \mathcal { N } ( 0 , d _ { \mathrm { o u t } } ^ { - 1 } ) f o r \ k \in [ d _ { \mathrm { o u t } } ]$ , $l \in [ d _ { \mathrm { i n } } ]$ , and $\mathbf { b } \in \mathbb { R } ^ { d _ { \mathrm { o u t } } }$ is a random bias vector such that ${ \bf b } _ { k } \sim \mathcal N ( 0 , d _ { \mathrm { o u t } } ^ { - 1 } )$ for $k \in [ d _ { \mathrm { o u t } } ]$ . $\begin{array} { r } { I f \cos ( u , v ) < \left( \frac { 1 } { 2 } \left( r + \frac { 1 } { r } \right) \right) ^ { - 1 } } \end{array}$ , then the following holds with probability at least $1 - O ( 1 / d _ { \mathrm { o u t } } )$ .
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathrm { c o s } ( \phi ( \mathbf { W } u + \mathbf { b } ) , \phi ( \mathbf { W } v + \mathbf { b } ) ) > \mathrm { c o s } ( u , v ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Theorem 1 shows that the cosine similarity between two vectors increases with a high probability after one feedforward computation consisting of a linear transformation and ReLU computation. This matches well with the result in Figure 2 (b) where the cosine similarity between samples increases as the intermediate layer gets farther from the input.
|
| 73 |
+
|
| 74 |
+
The bound condition on $\cos ( u , v )$ in Theorem 1 asks that the two vectors before the layer computation are not too close to each other in terms of the direction. This is because the random bias addition can slightly change the angle between the two vectors, leading to a small decrease in cosine similarity when the previous layer’s cosine similarity is too high. This condition is plausible in practice because the $\ell ^ { 2 }$ -norm of intermediate layer outputs is close to one with a high probability when the $\ell ^ { 2 }$ -norm of input data is one [1, Lemma 7.1]. Given that the norm ratio $r$ is close to one, the upper bound condition for $\cos ( u , v )$ is likely to hold because $\begin{array} { r } { ( \frac { 1 } { 2 } ( r + \frac { 1 } { r } ) ) ^ { - 1 } } \end{array}$ is close to 1.
|
| 75 |
+
|
| 76 |
+
Effect of random initialization We now examine the variance of an intermediate output and explain that the variance is mainly due to random initializations as in Figure 2 (c). To be more specific, we denote an intermediate layer output by $h _ { \Theta } ( U ) \in \mathbb { R }$ for some input datum $U$ . Here, $\Theta$ denotes all the random weights and biases that are used in $h _ { \Theta } ( U )$ . The variance of $h _ { \Theta } ( U )$ can be decomposed as
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mathrm { { V a r } } [ h _ { \Theta } ( U ) ] = \underbrace { { \mathbb { E } } [ \mathrm { { V a r } } [ h _ { \Theta } ( U ) \mid \Theta ] ] } _ { \mathrm { { D u e ~ t o ~ t h e ~ r a n d o m n e s s ~ o f ~ d a t a } } } + \underbrace { \mathrm { { V a r } } [ { \mathbb { E } } [ h _ { \Theta } ( U ) \mid \Theta ] ] . } _ { \mathrm { { D u e ~ t o ~ r a n d o m ~ i n i t i a l i z a t i o n s } } }
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Here, the inner and outer expectations are over the data $U$ and the random weights $\Theta$ , respectively. The first term on the right hand side explains the within variance after fixing one random initialization, quantifying the randomness of data. In contrast, the second term explains the variance due to different random initializations. The following theorem considers the ratio of the second term to the total variance and shows that the ratio can be very close to one when a deep neural network model is used.
|
| 83 |
+
|
| 84 |
+
Theorem 2 (Informal; Variance due to different random initializations). Let $h _ { \Theta } ( U )$ be an intermediate layer output with an input data $U$ with $\| U \| = 1$ . Under mild assumptions on $\Theta$ , the set of all the random weights and biases, the following inequality holds.
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\frac { \mathrm { V a r } [ \mathbb { E } [ h _ { \Theta } ( U ) \mid \Theta ] ] } { \mathrm { V a r } [ h _ { \Theta } ( U ) ] } \ge \beta ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\beta$ is a constant that captures the average cosine similarity of previous layer outputs.
|
| 91 |
+
|
| 92 |
+
Theorem 2 shows that the ratio of the variance due to different random initializations to the total variance is bounded below by the average cosine similarity of previous layer outputs. As Figure 2 (b) illustrated, the average cosine similarity of an intermediate layer output often approaches to one as the layer gets deeper. Accordingly, the lower bound $\beta$ , which captures the average cosine similarity, is close to one when a neural network is deep enough. In Appendix D, we elaborate on the relationship between $\beta$ and the cosine similarity, and provide a detailed statement of the Theorem.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 3: Contrastive learning preserves modality gap. (a) Embedding shift experiment. To probe the loss landscape of CLIP, we manually shift the image embeddings and text embeddings towards closing the gap. (b-d) The loss landscapes under different temperatures. Y axis indicates the contrastive loss. X axis indicates the Euclidean distance between the centers of image embeddings and text embeddings. The vertical dash line $x = 0 . 8 2$ indicates CLIP’s original distance between image and text embeddings (i.e., without any shifting). Note that in CLIP, the image embeddings and text embeddings are L2-normalized (Supplementary Figure 12). In other words, the image and text embeddings of CLIP are always on the unit sphere. (e-g) Simulation analysis for the loss landscape. Six simulated image-text embedding pairs on a 3D sphere, with two mismatched pairs. Text embeddings are shifted towards closing the modality gap (i.e., modifying $\theta$ ).
|
| 96 |
+
|
| 97 |
+
# 4 Contrastive learning preserves modality gap
|
| 98 |
+
|
| 99 |
+
# 4.1 Background: Contrastive Loss
|
| 100 |
+
|
| 101 |
+
Given that the modality gap is present at initialization, we investigate why our optimization procedure fails to close the gap. We begin by reviewing contrastive learning, which is a commonly used training strategy for multi-modal models [53, 50, 34]. We illustrate with CLIP due to its wide usage.
|
| 102 |
+
|
| 103 |
+
Given a batch of $N$ (image, text) pairs, CLIP learns to predict which of the $N \times N$ possible (image, text) pairs are aligned. In other words, CLIP learns to maximize the cosine similarity of the image and text embeddings of the $N$ real pairs in the batch while minimizing the cosine similarity of the embeddings of the $N ^ { 2 } - N$ incorrect pairs. Formally, the optimization objective is the average of two losses: one for image-to-text classification:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathcal { L } _ { \mathbb { Z } \mathcal { T } } = - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \frac { \exp ( \mathbf { x } _ { i } \cdot \mathbf { y } _ { i } / \tau ) } { \sum _ { j = 1 } ^ { N } \exp ( \mathbf { x } _ { i } \cdot \mathbf { y } _ { j } / \tau ) }
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
and the other for text-to-image classification:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathcal { L } _ { \mathcal { T } \mathcal { T } } = - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \frac { \exp ( \mathbf { x } _ { i } \cdot \mathbf { y } _ { i } / \tau ) } { \sum _ { j = 1 } ^ { N } \exp ( \mathbf { x } _ { j } \cdot \mathbf { y } _ { i } / \tau ) }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Here, $\mathbf { x } _ { i }$ and $\mathbf { y } _ { j }$ are the L2-normalized embedding of image in the $i$ -th pair and that of text in the $j$ -th pair, respectively. $\tau$ is a learned temperature parameter to scale the logits. The final learned temperature is $\begin{array} { r } { \tau = \frac { \textbf { \check { 1 } } } { 1 0 0 } } \end{array}$ in CLIP. See additional illustration in Figure 1(a) and Supp. Figure 12.
|
| 116 |
+
|
| 117 |
+
# 4.2 Embedding Shift Experiment
|
| 118 |
+
|
| 119 |
+
Design We hypothesize that the contrastive learning objective encourages the existence of the modality gap. To testify this hypothesis, we design a loss landscape probing experiment on $n = 5 , 0 0 0$ image-caption pairs5 from the validation set of MSCOCO Caption dataset. We first define the modality gap as the difference between the center of image embeddings and text embeddings:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
{ \vec { \Delta } } _ { \mathrm { g a p } } = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { \breve { n } } \mathbf { x } _ { i } - { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n ^ { \breve { } } } \mathbf { y } _ { i }
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $\mathbf { x } _ { i }$ and ${ \bf y } _ { i }$ are the L2-normalized image embedding and text embedding. We then manually shift every text embedding and image embedding towards closing the modality gap (Figure 3 (a)). After shifting, we re-normalize each embedding to the unit hypersphere:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathbf { x } _ { i } ^ { \mathrm { s h i f t } } = \mathrm { N o r m a l i z e } ( \mathbf { x } _ { i } - \lambda \vec { \Delta } _ { \mathrm { g a p } } ) , \quad \mathbf { y } _ { i } ^ { \mathrm { s h i f t } } = \mathrm { N o r m a l i z e } ( \mathbf { y } _ { i } + \lambda \vec { \Delta } _ { \mathrm { g a p } } ) .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
We vary the scalar $\lambda$ to produce different amounts of shifts. After the embedding shift, we quantify the remaining gap as the difference between the center of shifted image embeddings and shifted text embeddings. The gap distance before shifting is $\| \vec { \Delta } _ { \mathrm { g a p } } \| = 0 . 8 2$ . Here Euclidean distance is a intuitive metric because in CLIP, the image embeddings and text embeddings are L2-normalized (Supplementary Figure 12). In other words, the image and text embeddings of CLIP are always on the unit sphere. Specifically, for any $n$ -dimensional vectors $x$ and $y$ , the cosine similarity is given as $\cos ( x , y ) { \dot { = } } x ^ { T } y$ , and the Euclidean distance is given as $( x - y ) ^ { T } ( x - y ) = 2 ( 1 - x ^ { T } y )$ . Therefore, they have a functional relationship as Euclideandistance $\langle x , y \rangle = 2 ( 1 - \cos ( x , y ) )$ . When the angle between $x$ and $y$ is less than $\pi / 2$ , which is the case as embeddings are in a narrow cone, the small Euclidean distance directly means a high cosine similarity.
|
| 132 |
+
|
| 133 |
+
Results Figure 3(b) shows the contrastive loss landscape on different amount of modality gap under temperature ⌧ = 1100 (i.e., CLIP’s learned final temperature). We found that the default gap distance $\| \vec { \Delta } _ { \mathrm { g a p } } \| = 0 . 8 \bar { 2 }$ actually achieves the global minimum, and shifting toward closing the gap increases the contrastive loss. Interestingly, there is a local minimum when we shift the text embeddings to the opposite side in a “back-to-back position.” Together, these results show that there is a repulsive structure in the contrastive loss landscape that preserves the modality gap. However, when the temperature increases (Figure 3(c,d)), the repulsive structure and the local minimum gradually disappear, and closing the gap becomes more optimal. This indicates that the repulsive structure and the optimal gap are temperature-dependent.
|
| 134 |
+
|
| 135 |
+
Additional Evidence from Fine-tuning To further investigate the impact of temperature on modality gap, we fine-tune CLIP under 6 different temperatures $\begin{array} { r } { \overline { { \tau } } \in \{ \frac { 1 } { 1 0 0 } , \frac { \overline { { 1 } } } { 5 0 } , \frac { 1 } { 3 0 } , \frac { 1 } { 2 0 } , \frac { \overline { { 1 } } } { 1 0 } , 1 \} } \end{array}$ respectively, on MSCOCO Caption training set with batch size 64. We found that a high temperature $( \tau \in \{ \frac { 1 } { 1 0 } , 1 \} )$ ) in fine-tuning significantly reduces or closes the gap, while a low temperature does not. The gap distance $\| \vec { \Delta } _ { \mathrm { g a p } } \|$ decreases monotonically with increasing temperature (Supp. Figure 8).
|
| 136 |
+
|
| 137 |
+
# 4.3 Simulating mismatched data
|
| 138 |
+
|
| 139 |
+
Design We designed a simple simulation to distill the empirical phenomena in the embedding shift experiment. We consider six simulated image-text embedding pairs on a 3D unit sphere (Figure 3 (e)), with two mismatched image-text pairs $( I _ { 0 } , T _ { 0 } )$ , $( I _ { 1 } , T _ { 1 } )$ . Here "mismatched" means correct pairs are $( I _ { 0 } , T _ { 0 } )$ and $( I _ { 1 } , T _ { 1 } )$ but $I _ { 0 }$ is closer to $T _ { 1 }$ and $I _ { 1 }$ is closer to $T _ { 0 }$ . We fix the image embeddings while shifting the text embeddings downwards to close the gap (i.e., modifying $\theta$ , see more details in Appendix A).
|
| 140 |
+
|
| 141 |
+
Results With mismatched data, our simulation model successfully reproduces the temperaturedependent repulsive structure in the optimization landscape. When we remove the mismatch, the repulsive structure disappears (Supp. Figure 9). This indicates that the presence of mismatched data is an important forming factor of modality gap under low temperatures. Although the mismatch here is simulated, in practice mismatched data are common (e.g., hard-to-differentiate images/captions or annotation errors). Investigating how and to what extent the multimodal data misalignment could affect the contrastive loss landscape and thereby the modality gap is an interesting direction for future research.
|
| 142 |
+
|
| 143 |
+
Table 1: Modifying the modality gap can improve zero-shot performances for downstream tasks. Number indicates top-1 accuracy. Direction indicates that whether increasing (") or decreasing (#) the gap leads to optimal performance.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Dataset</td><td>Original gap</td><td>Modified gap</td><td>Direction</td></tr><tr><td colspan="4">Coarse-grained Classification</td></tr><tr><td>CIFAR10</td><td>0.9013</td><td>0.9081</td><td>→</td></tr><tr><td>CIFAR100</td><td>0.6658</td><td>0.6737</td><td>↓</td></tr><tr><td colspan="4">Fine-grained Classification</td></tr><tr><td>EuroSAT</td><td>0.5410</td><td>0.5645</td><td>←</td></tr><tr><td colspan="4">Optical Character Recognition</td></tr><tr><td>SVHN</td><td>0.5389</td><td>0.5396</td><td>→</td></tr><tr><td>HatefulMemes</td><td>0.5800</td><td>0.5811</td><td>个</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 2: Modifying the modality gap reduces biases for all races. Number indicates the fraction FairFace images whose top-1 prediction is offensive. Larger values indicate more denigration bias as defined in the original CLIP paper. Increasing the gap from 0.82 to 0.97 reduces denigration harms consistently for all races.
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan="2">Denigration Biases</td><td colspan="3">Original gap</td><td colspan="2">Modified gap</td></tr><tr><td>Crime related human</td><td>Non</td><td>Sum</td><td>Crime Non related human</td><td>Sum</td></tr><tr><td rowspan="5"></td><td>Black 1.0% 0.1%</td><td></td><td> 1.1%</td><td>0.8% 0.1%</td><td>1.0%</td></tr><tr><td>White 15.5%</td><td>0.2%</td><td>15.7%</td><td>13.2% 0.4%</td><td>13.7%</td></tr><tr><td>Indian 1.2%</td><td>0.0%</td><td>1.2%</td><td>1.1% 0.0%</td><td>1.1%</td></tr><tr><td>Latino 2.8%</td><td>0.1%</td><td>2.8%</td><td>1.9% 0.1%</td><td>2.0%</td></tr><tr><td>Middle Eastern 6.3%</td><td>0.0%</td><td>6.3%</td><td>5.2% 0.0%</td><td>5.2%</td></tr><tr><td>Southeast Asian 0.5%</td><td>0.0%</td><td>0.5%</td><td>0.3%</td><td>0.0%</td><td>0.3%</td></tr><tr><td>East Asian 0.7%</td><td>0.0%</td><td>0.7%</td><td>0.6%</td><td>0.0%</td><td>0.6%</td></tr></table>
|
| 150 |
+
|
| 151 |
+
# 4.4 Initialization vs Optimization
|
| 152 |
+
|
| 153 |
+
Design So far, we have shown that (1) modality gap is born at random initialization, and (2) contrastive learning objective encourages the gap. To explore how the final modality gap is affected by a combination of both factors, we train two CLIP models from scratch: one model uses random initialization, where the gap is large $\| \vec { \Delta } _ { \mathrm { g a p } } \| = 1 . 1 8 9 1 \pm 0 . 0 0 1 7$ because of the cone effect discuss in Sec. 2; another model amends the gap at the initialization by transforming text embeddings to be close to the image embeddings, where the gap is almost zero $\| \vec { \Delta } _ { \mathrm { g a p } } \| = 0 . 0 3 8 8 \pm 0 . 0 3 5 1$ Numbers are mean and $9 5 \%$ confidence interval over three runs with different random seeds. The transformation we applied is a common method to align multilingual word embeddings [31]. More specifically, given image embedding $\mathbf { X }$ and text embedding y, we apply an orthogonal matrix to text embedding $\mathbf { y } ^ { \prime } = W \mathbf { y }$ and compute the multi-modal contrastive loss on $\mathbf { X }$ and $\mathbf { y } ^ { \prime }$ . The orthogonal matrix minimizes the distance between image embeddings and transformed text embeddings: $W =$ arg $\mathrm { m i n } _ { W \in O _ { D } } \| X - Y W \|$ where $X , Y \ \in \ \mathbb { R } ^ { N \times D }$ are image embeddings and text embeddings generated from $N$ image-caption pairs, and $O _ { D }$ is the set of $D$ -dimensional orthogonal matrix.
|
| 154 |
+
|
| 155 |
+
Results We train both models on the MSCOCO Caption training set with batch size 64 and temperature ⌧ = 1100 (i.e., CLIP’s learned temperature). After training, the original model gap changes from $1 . 1 8 \mathrm { \dot { 9 } 1 } \pm 0 . 0 0 1 7$ to $1 . 2 9 9 1 \pm 0 . 0 3 8 9$ , while the amended model gap changes from $0 . 0 3 8 8 \pm 0 . 0 3 5 1$ to $0 . 7 4 5 7 \pm 0 . 0 6 3 3$ . Numbers are $9 5 \%$ confidence interval over three runs with different random seeds. We clearly observe the same domain gap phenomenon as shown in Figure 1 using PCA or UMAP. This experiment shows that the final domain gap is caused by both initialization and optimization. When we ablate the domain gap at the initialization, the loss will still encourage the gap, but the gap distance is only $57 \%$ compared to the model without amending the gap.
|
| 156 |
+
|
| 157 |
+
# 5 Modality Gap Implications
|
| 158 |
+
|
| 159 |
+
# 5.1 Zero-shot performance
|
| 160 |
+
|
| 161 |
+
Design One of the most interesting capabilities for CLIP is its strong zero-shot transferability to a variety of downstream tasks without any supervision. We study whether changing the gap will affect CLIP (ViT-B/16)’s performances on various downstream tasks, including coarse-grained classification (CIFAR10 and CIFAR100), fine-grained classification (EuroSAT [22]), and optical character recognition (SVHN, HatefulMemes [28]). Metric and prompt for each task are shown in Supp. Table 3. Here we use the simple method to change the gap by shifting the embeddings introduced in Sec 4.2. The main objective of our paper is to understand the modality gap phenomenon, a general inductive bias that holds across various data modalities and NN architectures. The goal of our paper is not to propose a method to close the gap and to improve downstream performance.
|
| 162 |
+
|
| 163 |
+
Results Modifying the gap by shifting the embeddings can improve different downstream tasks compared to the original gap without shifting embeddings (Table 1). Details of performance vs gap distance curves are shown in Supp. Figure 10. We leave more methods to change the gap and more analysis of the relation between gap distance and downstream task performance to future work.
|
| 164 |
+
|
| 165 |
+
# 5.2 Fairness
|
| 166 |
+
|
| 167 |
+
Design We follow the bias evaluation setup in the CLIP paper to evaluate denigration harms [39, Sec. 7.1]. We performed zero-shot evaluations on CLIP (ViT-B/32) on the evaluation set of the FairFace dataset [26], which has 10,954 images. In addition to the 14 FairFace classes (e.g., ‘white male’, ‘black female’), we added 4 non-human classes (‘animal’, ‘gorilla’, ‘chimpanzee’ and ‘orangutan’) and 3 crime-related classes (‘thief’, ‘criminal’ and ‘suspicious person’). The text prompts are attached in Appendix (Supp. Figure 11). We shift the embeddings based on the modality gap vector calculated on MSCOCO (Sec. 4.2). We report the fraction FairFace images whose top-1 prediction is offensive.
|
| 168 |
+
|
| 169 |
+
Results We found that increasing the gap from 0.82 to 0.97 reduces denigration harms consistently for all races (Table 5). Meanwhile, we only observe a minor 0.0008 top-1 accuracy drop (Appendix B.2). It is encouraging that a simple gap offsetting approach can lead to a consistent bias reduction across all races on such a complex model (i.e., CLIP)6. Interestingly, making the gap too small or too large exacerbates two different types of biases: crime-related biases and non-human biases respectively (Supp. Table 4).
|
| 170 |
+
|
| 171 |
+
# 6 Related Work
|
| 172 |
+
|
| 173 |
+
Contrastive Representation Learning Contrastive representation learning learns an embedding space where similar objects are closer than dissimilar ones, and has achieved great success in vision [7, 20, 6, 9], language [40, 16], and graph [51, 38]. However, as contrastive learning is still an emerging representation learning technique, we still lack comprehensive theoretical and empirical understandings about why contrastive learning works. [48] proposed two ideal objectives for contrastive representation space: alignment (similar samples have similar features) and uniformity (features are uniformly distributed on the hypersphere), and demonstrated these two objectives are highly correlated with downstream task performances. [46] show that low temperatures increase the model’s penalty on hard negative examples, and thus increase uniformity and decrease tolerance (the closeness of semantically similar samples). These analyses mostly focus on unsupervised contrastive learning on a single modality. Orthogonal to their work, we show that multi-modal contrastive learning with low temperatures and mismatched data encourages the modality gap.
|
| 174 |
+
|
| 175 |
+
Multi-modal Contrastive Representation Learning Multi-modal models map inputs from different data modalities (e.g. image and text) into a shared representation space [53, 50, 34, 24, 11]. It has garnered tremendous interest and excitement as a framework for data integration. These models are often pre-trained with contrastive loss [45], as [39] showed that the contrastive learning is $1 2 \times$ more efficient than the generative approaches. We demonstrate an intriguing geometric phenomenon of the representation space of these multi-modal models, and provide a three-part explanation supported by theory and experiments. The idea of mapping images and text into a shared embedding space has been explored in earlier works [42, 49]. There have been recent efforts in formulating images and text embeddings as metric learning [14], multilabel classification [25], n-gram language learning [32], and captioning [10]. Recently there has there has also been work in using a unified encoder to fuse different data modalities [19]. Research into how the modality gap phenomenon generalizes to the multi-modal representations obtained by these alternative methods, or even uni-modal settings with teacher and student model [44, 5] would be a promising direction for future work.
|
| 176 |
+
|
| 177 |
+
Cone Effect Our analyses also provide new insights on the cone effect, which we show is a general phenomenon for deep neural networks. Existing work focuses on the language representations of trained language models such as BERT and GPT-2 [12, 15, 33]. Given that isotropy has both theoretical and empirical benefits for static embeddings [35], the extent of anisotropy in contextualized representations is surprising [12]. It has been shown that the cone effect limits the expressiveness of the language representations. Post-processing methods [33, 43, 2, 35] or modified training objective [15, 47, 16] alleviate the cone effect and improve downstream performance. Existing work attributes the cone effect to the optimization under unbalanced word frequencies distribution [15, 33]. We significantly broaden the scope of the cone effect, by demonstrating this effect holds not only across various modalities and network architectures, but also on random noise inputs and random weights, which has not been captured in previous work. We mathematically characterize the contraction mapping induced by linear layers with ReLU non-linearities to explain the cone effect. Our theory matches well with experiments and provides insights for understanding the general inductive biases of deep neural networks.
|
| 178 |
+
|
| 179 |
+
# 7 Discussion
|
| 180 |
+
|
| 181 |
+
In this work, we investigated an interesting phenomenon in multi-modal contrastive learning — modality gap. We analyzed why the gap exists, i.e., the joint effect of model initialization and optimization, and why studying the gap is important, i.e., it can affect the downstream task performance and fairness. Our work raises several basic questions about representation learning, contrastive learning, and multi-modal contrastive representation learning. For representation learning, prior research in NLP has shown that alleviating the cone effect improves downstream performance. As our work significantly broadens the scope of the cone effect, methods for alleviating the cone effect in other modalities to improve ML performance is an interesting direction of future research.
|
| 182 |
+
|
| 183 |
+
For contrastive learning, our embedding shifting, simulation, and fine-tuning experiments all show that the contrast loss landscape is heavily influenced by temperature. Recent work has found that temperature directly controls the uniformity and affinity of the uni-modal representation space [46]. Our study provides a complementary understanding of the multi-modal representation space. Development of geometric methods for evaluation of representations [37, 30] to further capture the geometric landscape of the modality gap is an interesting direction of future work.
|
| 184 |
+
|
| 185 |
+
For multi-modal contrastive representational learning, we find that changing the modal gap can affect performance and fairness on downstream tasks. Interestingly, having larger gap can help some fairness and zero-shot learning applications. The main objective of our paper is to demonstrate the modality gap phenomenon and explain contraction mapping contribute to this. Systematic analysis of the impact of the gap on applications is an important direction of future work.
|
| 186 |
+
|
| 187 |
+
# Reproducibility Statement
|
| 188 |
+
|
| 189 |
+
We provide open-source implementation of our work at https://github.com/Weixin-Liang/ Modality-Gap. The implementations will enable researchers to reproduce the modality gap described here as well as run their own analyses on additional cross-modal models. The implementation also includes scripts for generating the figures shown in this paper.
|
| 190 |
+
|
| 191 |
+
# References
|
| 192 |
+
|
| 193 |
+
[1] Z. Allen-Zhu, Y. Li, and Z. Song. A convergence theory for deep learning via overparameterization. In ICML, 2019.
|
| 194 |
+
[2] S. Arora, Y. Liang, and T. Ma. A simple but tough-to-beat baseline for sentence embeddings. In ICLR, 2017.
|
| 195 |
+
[3] D. Arpit, S. Jastrzebski, N. Ballas, D. Krueger, E. Bengio, M. S. Kanwal, T. Maharaj, A. Fischer, A. C. Courville, Y. Bengio, and S. Lacoste-Julien. A closer look at memorization in deep networks. In ICML, volume 70 of Proceedings of Machine Learning Research, pages 233–242. PMLR, 2017.
|
| 196 |
+
[4] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016.
|
| 197 |
+
[5] L. Beyer, X. Zhai, A. Royer, L. Markeeva, R. Anil, and A. Kolesnikov. Knowledge distillation: A good teacher is patient and consistent. In CVPR, 2022.
|
| 198 |
+
[6] M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020.
|
| 199 |
+
[7] T. Chen, S. Kornblith, M. Norouzi, and G. E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020.
|
| 200 |
+
[8] X. Chen, H. Fang, T. Lin, R. Vedantam, S. Gupta, P. Dollár, and C. L. Zitnick. Microsoft COCO captions: Data collection and evaluation server. CoRR, abs/1504.00325, 2015.
|
| 201 |
+
[9] X. Chen and K. He. Exploring simple siamese representation learning. In CVPR, 2021.
|
| 202 |
+
[10] K. Desai and J. Johnson. Virtex: Learning visual representations from textual annotations. In CVPR, 2021.
|
| 203 |
+
[11] CLASP: Contrastive Language Aminoacid Sequence Pretraining, 2021.
|
| 204 |
+
[12] K. Ethayarajh. How contextual are contextualized word representations? comparing the geometry of bert, elmo, and GPT-2 embeddings. In EMNLP, 2019.
|
| 205 |
+
[13] J. Frankle and M. Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR. OpenReview.net, 2019.
|
| 206 |
+
[14] A. Frome, G. S. Corrado, J. Shlens, S. Bengio, J. Dean, M. Ranzato, and T. Mikolov. Devise: A deep visual-semantic embedding model. In NIPS, 2013.
|
| 207 |
+
[15] J. Gao, D. He, X. Tan, T. Qin, L. Wang, and T. Liu. Representation degeneration problem in training natural language generation models. In ICLR, 2019.
|
| 208 |
+
[16] T. Gao, X. Yao, and D. Chen. Simcse: Simple contrastive learning of sentence embeddings. In EMNLP, 2021.
|
| 209 |
+
[17] R. Geirhos, J. Jacobsen, C. Michaelis, R. S. Zemel, W. Brendel, M. Bethge, and F. A. Wichmann. Shortcut learning in deep neural networks. Nat. Mach. Intell., 2(11):665–673, 2020.
|
| 210 |
+
[18] R. Geirhos, P. Rubisch, C. Michaelis, M. Bethge, F. A. Wichmann, and W. Brendel. Imagenettrained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In ICLR. OpenReview.net, 2019.
|
| 211 |
+
[19] R. Girdhar, M. Singh, N. Ravi, L. van der Maaten, A. Joulin, and I. Misra. Omnivore: A single model for many visual modalities. CoRR, abs/2201.08377, 2022.
|
| 212 |
+
[20] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. Richemond, E. Buchatskaya, C. Doersch, B. Avila Pires, Z. Guo, M. Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervised learning. In NeurIPS, 2020.
|
| 213 |
+
[21] W. Guo, J. Wang, and S. Wang. Deep multimodal representation learning: A survey. IEEE Access, 7:63373–63394, 2019.
|
| 214 |
+
[22] P. Helber, B. Bischke, A. Dengel, and D. 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, 2019.
|
| 215 |
+
[23] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 216 |
+
[24] C. Jia, Y. Yang, Y. Xia, Y. Chen, Z. Parekh, H. Pham, Q. V. Le, Y. Sung, Z. Li, and T. Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021.
|
| 217 |
+
[25] A. Joulin, L. van der Maaten, A. Jabri, and N. Vasilache. Learning visual features from large weakly supervised data. In ECCV, 2016.
|
| 218 |
+
[26] K. Kärkkäinen and J. Joo. Fairface: Face attribute dataset for balanced race, gender, and age for bias measurement and mitigation. In WACV, 2021.
|
| 219 |
+
[27] N. S. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. T. P. Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In ICLR. OpenReview.net, 2017.
|
| 220 |
+
[28] D. Kiela, H. Firooz, A. Mohan, V. Goswami, A. Singh, P. Ringshia, and D. Testuggine. The hateful memes challenge: Detecting hate speech in multimodal memes. In NeurIPS, 2020.
|
| 221 |
+
[29] B. Kim, E. Reif, M. Wattenberg, S. Bengio, and M. C. Mozer. Neural networks trained on natural scenes exhibit gestalt closure. Computational Brain & Behavior, 4(3):251–263, 2021.
|
| 222 |
+
[30] T. Kynkäänniemi, T. Karras, S. Laine, J. Lehtinen, and T. Aila. Improved precision and recall metric for assessing generative models. In NeurIPS, 2019.
|
| 223 |
+
[31] G. Lample, A. Conneau, M. Ranzato, L. Denoyer, and H. Jégou. Word translation without parallel data. In ICLR, 2018.
|
| 224 |
+
[32] A. Li, A. Jabri, A. Joulin, and L. van der Maaten. Learning visual n-grams from web data. In ICCV, 2017.
|
| 225 |
+
[33] B. Li, H. Zhou, J. He, M. Wang, Y. Yang, and L. Li. On the sentence embeddings from pre-trained language models. In EMNLP, 2020.
|
| 226 |
+
[34] J. Li, R. R. Selvaraju, A. D. Gotmare, S. R. Joty, C. Xiong, and S. C. H. Hoi. Align before fuse: Vision and language representation learning with momentum distillation. CoRR, abs/2107.07651, 2021.
|
| 227 |
+
[35] J. Mu and P. Viswanath. All-but-the-top: Simple and effective postprocessing for word representations. In ICLR, 2018.
|
| 228 |
+
[36] B. Neyshabur, Z. Li, S. Bhojanapalli, Y. LeCun, and N. Srebro. The role of over-parametrization in generalization of neural networks. In ICLR, 2019.
|
| 229 |
+
[37] P. Poklukar, V. Polianskii, A. Varava, F. T. Pokorny, and D. K. Jensfelt. Delaunay component analysis for evaluation of data representations. In ICLR, 2022.
|
| 230 |
+
[38] J. Qiu, Q. Chen, Y. Dong, J. Zhang, H. Yang, M. Ding, K. Wang, and J. Tang. Gcc: Graph contrastive coding for graph neural network pre-training. In KDD, 2020.
|
| 231 |
+
[39] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, G. Krueger, and I. Sutskever. Learning transferable visual models from natural language supervision. In ICML, 2021.
|
| 232 |
+
[40] N. Reimers, I. Gurevych, N. Reimers, I. Gurevych, N. Thakur, N. Reimers, J. Daxenberger, I. Gurevych, N. Reimers, I. Gurevych, et al. Sentence-bert: Sentence embeddings using siamese bert-networks. In EMNLP, 2019.
|
| 233 |
+
[41] T. Sainburg, L. McInnes, and T. Q. Gentner. Parametric umap embeddings for representation and semisupervised learning. Neural Computation, 2021.
|
| 234 |
+
[42] R. Socher and L. Fei-Fei. Connecting modalities: Semi-supervised segmentation and annotation of images using unaligned text corpora. In CVPR, 2010.
|
| 235 |
+
[43] J. Su, J. Cao, W. Liu, and Y. Ou. Whitening sentence representations for better semantics and faster retrieval. CoRR, abs/2103.15316, 2021.
|
| 236 |
+
[44] A. Tarvainen and H. Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In NIPS, 2017.
|
| 237 |
+
[45] A. van den Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. CoRR, abs/1807.03748, 2018.
|
| 238 |
+
[46] F. Wang and H. Liu. Understanding the behaviour of contrastive loss. In CVPR, 2021.
|
| 239 |
+
[47] L. Wang, J. Huang, K. Huang, Z. Hu, G. Wang, and Q. Gu. Improving neural language generation with spectrum control. In ICLR, 2020.
|
| 240 |
+
[48] T. Wang and P. Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, 2020.
|
| 241 |
+
[49] J. Weston, S. Bengio, and N. Usunier. Large scale image annotation: learning to rank with joint word-image embeddings. Machine learning, 2010.
|
| 242 |
+
[50] H. Xu, G. Ghosh, P. Huang, D. Okhonko, A. Aghajanyan, F. Metze, L. Zettlemoyer, and C. Feichtenhofer. Videoclip: Contrastive pre-training for zero-shot video-text understanding. In EMNLP, 2021.
|
| 243 |
+
[51] Y. You, T. Chen, Y. Sui, T. Chen, Z. Wang, and Y. Shen. Graph contrastive learning with augmentations. In NeurIPS, 2020.
|
| 244 |
+
[52] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning (still) requires rethinking generalization. Commun. ACM, 64(3):107–115, 2021.
|
| 245 |
+
[53] Y. Zhang, H. Jiang, Y. Miura, C. D. Manning, and C. P. Langlotz. Contrastive learning of medical visual representations from paired images and text. CoRR, abs/2010.00747, 2020.
|
| 246 |
+
|
| 247 |
+
# Checklist
|
| 248 |
+
|
| 249 |
+
1. For all authors...
|
| 250 |
+
|
| 251 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 252 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 253 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes]
|
| 254 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 255 |
+
|
| 256 |
+
2. If you are including theoretical results...
|
| 257 |
+
|
| 258 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes]
|
| 259 |
+
|
| 260 |
+
3. If you ran experiments...
|
| 261 |
+
|
| 262 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
|
| 263 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 264 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 265 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
|
| 266 |
+
|
| 267 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 268 |
+
|
| 269 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 270 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 271 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 272 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes]
|
| 273 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes]
|
| 274 |
+
|
| 275 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 276 |
+
|
| 277 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 278 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 279 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/T47mUw8pW4/T47mUw8pW4.md
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The medial axis of closed bounded sets is Lipschitz stable with respect to the Hausdorff distance under ambient diffeomorphisms
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 We prove that the medial axis of closed sets is Hausdorff stable in the following
|
| 11 |
+
2 sense: Let $S \subseteq \mathbb { R } ^ { d }$ be a fixed closed set that contains a bounding sphere. Consider
|
| 12 |
+
3 the space of $C ^ { 1 , 1 }$ diffeomorphisms of $\mathbb { R } ^ { d }$ to itself, which keep the bounding
|
| 13 |
+
4 sphere invariant. The map from this space of diffeomorphisms (endowed with a
|
| 14 |
+
5 Banach norm) to the space of closed subsets of $\mathbb { R } ^ { d }$ (endowed with the Hausdorff
|
| 15 |
+
6 distance), mapping a diffeomorphism $F$ to the closure of the medial axis of $F ( S )$ ,
|
| 16 |
+
7 is Lipschitz.
|
| 17 |
+
|
| 18 |
+
This extends a previous stability result of Chazal and Soufflet on the stability of the medial axis of $C ^ { 2 }$ manifolds under $C ^ { 2 }$ ambient diffeomorphisms.
|
| 19 |
+
|
| 20 |
+
# 10 1 Introduction
|
| 21 |
+
|
| 22 |
+
11 In [19], Federer introduced the reach of a (closed) set $S \subset \mathbb { R } ^ { d }$ as the infimum over all points in $s$ of
|
| 23 |
+
12 the distance from these points to the medial axis $\operatorname { a x } ( S )$ , the set of points in $\mathbb { R } ^ { d }$ for which the closest
|
| 24 |
+
13 point in $s$ is not unique. Federer also introduced the reach at a point $p \in S$ to be the distance from $p$
|
| 25 |
+
14 to the medial axis of $s$ . We now call this quantity the local feature size [3] and denote it by $\operatorname { l f s } ( p )$ .
|
| 26 |
+
15 Federer proved that the reach is stable under $C ^ { 1 , 1 }$ diffeomorphisms of the ambient space. Here, a
|
| 27 |
+
16 $C ^ { 1 , 1 }$ map is a $C ^ { 1 }$ map whose derivative is Lipschitz, and a $C ^ { \hat { 1 } , 1 }$ diffeomorphism is a $\mathbf { \bar { \it C } } ^ { 1 , 1 }$ bijective
|
| 28 |
+
17 map whose inverse is also $C ^ { 1 , 1 }$ . Chazal and Soufflet [13] proved that the medial axis is stable with
|
| 29 |
+
18 respect to the Hausdorff distance under ambient diffeomorphisms, but under stronger assumptions
|
| 30 |
+
19 than the work of Federer, namely assuming that $s$ is a $C ^ { 2 }$ manifold and the distortion is a $C ^ { 2 }$ diffeo
|
| 31 |
+
20 morphism of the ambient space. Chazal and Soufflet based their work on earlier results by Blaschke
|
| 32 |
+
21 [9], which were not as strong as Federer’s.
|
| 33 |
+
22 In this paper we extend the stability result of the medial axis. More concretely, we generalize the
|
| 34 |
+
23 result of Chazal and Soufflet [13] to arbitrary closed sets and $C ^ { 1 , 1 }$ diffeomorphisms of the ambient
|
| 35 |
+
24 space; we show that the Hausdorff distance between the medial axes of the closed set and its image is
|
| 36 |
+
25 bounded in terms of Lipschitz constants stemming from the diffeomorphism of the ambient space.
|
| 37 |
+
26 Our result follows from the work of Federer [19] and in fact shortens the proof in [13] significantly.
|
| 38 |
+
|
| 39 |
+
Our bounds on the Hausdorff distance say nothing about the topology of the medial axis, which is known to be highly unstable (see e.g. [5]), although it preserves the homotopy type (see [28]).
|
| 40 |
+
|
| 41 |
+
Contribution and related work Our work differs from the majority of the literature in three essential ways:
|
| 42 |
+
|
| 43 |
+
Firstly, we make no assumptions on the set we consider apart from that it is closed. The stability of the medial axis of (piecewise) smooth manifolds has been the object of intense study, see for example
|
| 44 |
+
|
| 45 |
+
33 [13, 15–17, 24, 30, 37–40]. However, the manifold assumption is impossible to achieve in many
|
| 46 |
+
34 applications — such as in the context of astrophysics, one of the main motivations of this paper.
|
| 47 |
+
35 Secondly, we achieve stability without pruning the medial axis. This contrasts with a large body of
|
| 48 |
+
36 work, such as [6, 12, 16, 29]. Not having to prune the medial axis is a significant advantage. On the
|
| 49 |
+
37 downside, we limit the changes of the considered set to those induced by ambient diffeomorphisms.
|
| 50 |
+
38 Nevertheless, given the standard examples of the instability of the medial axis — see for example [5]
|
| 51 |
+
39 — we believe these limitations are near to the weakest assumptions necessary for Hausdorff stability.
|
| 52 |
+
40 Within the context of ambient homeomorphisms, the results we obtain are close to optimal, as we
|
| 53 |
+
41 specify in Remark 4.2.
|
| 54 |
+
|
| 55 |
+
Thirdly, our results hold for sets in arbitrary dimensions and are not sensitive to the dimension of the set itself. A large part of the related work only investigates sets of low dimensions or codimension one manifolds, although there are some notable exceptions such as [39], see also [17], and [12, 29].
|
| 56 |
+
|
| 57 |
+
45 Motivation The medial axis has many real world applications — among others, in robot motion
|
| 58 |
+
46 planning [27], triangulation algorithms [4], graphics [35], and shape recognition, segmentation, and
|
| 59 |
+
47 learning [10, 18, 25, 33, 41]. See also the overviews [32, 35]. The reach — the distance between a
|
| 60 |
+
48 set and its medial axis — is a central concept in manifold learning [1, 2, 20–22, 34].
|
| 61 |
+
49 The motivation of this paper is twofold: Firstly, we tackle the following challenge from the processing
|
| 62 |
+
50 of images collected with optical devices which use lenses — such as cameras or telescopes. A shape
|
| 63 |
+
51 extracted from such an image may be imprecise due to the imperfection of the lenses. Our result
|
| 64 |
+
52 implies that the medial axis of such a shape is stable under these imperfections. As a consequence,
|
| 65 |
+
53 the outcome of any shape recognition or shape segmentation algorithm based on the medial axis will
|
| 66 |
+
54 be stable.
|
| 67 |
+
55 In addition to the disciplines listed above, such stability is sought after in astrophysics, in particular
|
| 68 |
+
56 for shape analysis and automated shape identification in observational astronomy. Observational
|
| 69 |
+
57 astronomers are interested in reconstructing objects like stars or galaxies, and their place in the
|
| 70 |
+
58 universe from data gathered by telescopes. They can deduce the distance from the object to the
|
| 71 |
+
59 observer thanks to so-called standard candles or red shift [14, 23, 31]. However, the image gets
|
| 72 |
+
60 distorted due to optical effects — either through gravitational lensing ([7]) or lensing inside the
|
| 73 |
+
61 telescope itself ([36]).
|
| 74 |
+
62 Such a distortion can be modeled as a diffeomorphism of the ambient space. At the same time, this
|
| 75 |
+
63 problem cannot be tackled using the result by Chazal and Soufflet [13], since the observed objects
|
| 76 |
+
64 might not be smooth — for example due to interactions with shock waves or jets. In addition, with
|
| 77 |
+
65 our method astrophysicists can not only reconstruct objects in space (3D), but also in spacetime (4D).
|
| 78 |
+
66 The second motivation is more formal in nature: The stability of the medial axis is instrumental in
|
| 79 |
+
67 establishing its computability. Indeed, when proving properties of algorithms based on the medial
|
| 80 |
+
68 axis, authors generally assume the real RAM model.1 However, as was recently argued in [29], the
|
| 81 |
+
69 medial axis needs to be stable in order to be computable in more realistic models of computation.
|
| 82 |
+
70 There is a more practical component to this formal question: It is not a priori clear if using possibly
|
| 83 |
+
71 noisy real world data or the output of other computer programs as input for these algorithms yields
|
| 84 |
+
72 answers that are close to the ground truth. To be able to prove that the output is correct, we need
|
| 85 |
+
73 (numerical) stability of the medial axis.
|
| 86 |
+
74 Outline After revisiting preliminaries and known results in Section 2, we state the main stability
|
| 87 |
+
75 result in Section 3. In Section 4 we reformulate this result in terms of norms on Banach spaces. This
|
| 88 |
+
76 also exhibits the fact that the stability of the medial axis is Lipschitz in the following sense: We think
|
| 89 |
+
77 of the set $s$ as fixed and consider the map from the space of diffeomorphisms (endowed with a norm
|
| 90 |
+
78 which makes it a Banach space) to the space of closed subsets of $\mathbb { R } ^ { d }$ (endowed with the Hausdorff
|
| 91 |
+
79 distance), mapping each diffeomorphism $F : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ to the closure of the medial axis of $F ( S )$
|
| 92 |
+
80 The Lipschitz constant then only depends on the diameter of the bounding sphere of the set $s$ .
|
| 93 |
+
81 We only include proof sketches of the two main theorems in this article. The full proofs of the
|
| 94 |
+
82 theorems and of the supporting lemmas, can be found in the supplementary material.
|
| 95 |
+
|
| 96 |
+
# 83 2 Preliminaries: Sets of positive reach and the closest point projection
|
| 97 |
+
|
| 98 |
+
84 In this section we recall some definitions and results concerning the medial axis and sets of positive
|
| 99 |
+
85 reach. Essentially, we need three ingredients from the literature to prove our main theorem: the
|
| 100 |
+
86 notions related to the closest point projection, the properties of the generalized normal and tangent
|
| 101 |
+
87 spaces, and Federer’s result on the stability of the reach under ambient diffeomorphisms.
|
| 102 |
+
88 We write $d ( \cdot , \cdot )$ for the Euclidean distance between two points, and the distance between a point and
|
| 103 |
+
89 a set. That is, for any closed set $s$ and point $p$ ,
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
d ( p , S ) = \operatorname* { i n f } _ { q \in S } d ( p , q ) .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
We denote the Hausdorff distance between two sets 90 $A , B \subseteq \mathbb { R } ^ { d }$ by $d _ { H } ( A , B )$ :
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
d _ { H } ( A , B ) = \operatorname* { m a x } \left\{ \operatorname* { s u p } _ { a \in A } d ( a , B ) , \operatorname* { s u p } _ { b \in B } d ( b , A ) \right\} .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
91 We write $B ( c , r )$ , resp. $S ( c , r )$ , to denote balls, resp. spheres, with centre $c$ and radius $r$ . Lastly, $\left. \cdot \right.$
|
| 116 |
+
92 denotes the Euclidean norm, and $\lVert \cdot \rVert$ an operator norm.
|
| 117 |
+
93 The closest point projection and related notions The projection of points in the ambient space
|
| 118 |
+
94 $\mathbb { R } ^ { d }$ to the (set of) closest point(s) of the set $S \subseteq \mathbb { R } ^ { d }$ is denoted by $\pi _ { \boldsymbol { S } }$ , and illustrated in Figure 1.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 1: The closest point projection to the set $s$ of four points in $\mathbb { R } ^ { 2 }$ . When a point lies on the medial axis $\operatorname { a x } ( S )$ , the closest point projection consists of more points.
|
| 122 |
+
|
| 123 |
+
The medial axis of 95 $s$ is the set of all points $p \in \mathbb { R } ^ { d }$ where the set $\pi _ { S } ( p )$ consists of more than one 96 point:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\operatorname { a x } ( \mathcal { S } ) = \left\{ p \in \mathbb { R } ^ { d } \mid \# \pi _ { \mathcal { S } } ( p ) > 1 \right\} .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
97 Here, $\# \pi _ { S } ( p )$ denotes the cardinality of the set $\pi _ { S } ( p )$ .
|
| 130 |
+
|
| 131 |
+
For a point $p \in { \mathcal { S } }$ , the local feature size of $p$ is the distance from $p$ to the medial axis of the set $s$
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r } { \mathrm { l f s } ( p ) = d ( p , \mathrm { a x } ( S ) ) . } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
99 Finally, the reach of the set $s$ is the infimum of the local feature size over all its points:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\operatorname { r c h } ( S ) = \operatorname* { i n f } _ { p \in S } \operatorname { l f s } ( p ) = \operatorname* { i n f } _ { p \in S } d ( p , \operatorname { a x } ( S ) ) .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
100 Throughout this paper we assume that $S \subseteq \mathbb { R } ^ { d }$ is a closed set. We shall further assume that the set
|
| 144 |
+
101 $s$ as well as its medial axis are bounded, and that the bounding sphere of $s$ is contained in $s$ itself.
|
| 145 |
+
102 More specifically, we assume that there exists a closed ball $B$ of positive radius such that ${ \mathcal { S } } \subseteq B$ ,
|
| 146 |
+
103 and $\partial B \subseteq S$ . We call $\partial B$ the bounding sphere of $s$ .
|
| 147 |
+
104 The addition of the bounding sphere $\partial B$ to the set $s$ is necessary to obtain the desired bound on
|
| 148 |
+
105 the Hausdorff distance between the two medial axes of the set $s$ and its image under the ambient
|
| 149 |
+
106 diffeomorphism. Indeed, consider the following example, illustrated in Figure 2.
|
| 150 |
+
107 Let the set $s$ consist of two points in the plane, $S = \{ p , q \} \subseteq \mathbb { R } ^ { 2 }$ . The medial axis of $s$ is then the
|
| 151 |
+
108 bisector line of $p$ and $q$ . After a generic perturbation $F$ of $p$ and $q$ — that is, not a translation and not a
|
| 152 |
+
109 perturbation in the direction $\pm ( p - q )$ — the bisector line $\operatorname { a x } ( F ( S ) )$ of the perturbed points intersects
|
| 153 |
+
110 the bisector $\operatorname { a x } ( S )$ of the original pair. The Hausdorff distance between these two non-parallel lines
|
| 154 |
+
111 is infinite, and thus unboundable.
|
| 155 |
+
112 At the same time, the addition of the bounding sphere $\partial B$ to the considered set $s$ is not a restriction.
|
| 156 |
+
113 Indeed,
|
| 157 |
+
14 Remark 2.1 The medial axes of $s$ and $s \backslash \partial B$ coincide in the interior of the ball $B$ sufficiently far
|
| 158 |
+
15 away from its boundary $\partial B$ . More precisely:
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: In black the set $s$ and its medial axis, in light blue the perturbed set and its medial axis. The Hausdorff distance between $\operatorname { a x } ( S )$ and $\operatorname { a x } ( F ( S ) )$ is infinite.
|
| 162 |
+
|
| 163 |
+
• Any point $x \in \operatorname { a x } ( S )$ , such that $\pi _ { S } ( x ) \cap \partial B = \emptyset .$ , lies on the medial axis $\operatorname { a x } ( S \setminus \partial B )$ . • Conversely, if a point $x$ lies on the medial axis $\operatorname { a x } ( S \setminus \partial B )$ , and any (and thus every) point $q \in \pi _ { S \setminus { \partial B } } ( x )$ satisfies $d ( x , q ) < d ( x , \partial B )$ , then $x \in \operatorname { a x } ( S )$ .
|
| 164 |
+
|
| 165 |
+
Thus, the medial axis is locally stable if the ambient diffeomorphism is close to the identity.219
|
| 166 |
+
|
| 167 |
+
20 A recurring strategy in this article is to start at a point $p$ on the set $s$ , move away from this point in a
|
| 168 |
+
21 ‘normal’ direction, and see if by projecting using the closest point projection $\pi _ { \boldsymbol { S } }$ we get back to $p$ . To
|
| 169 |
+
22 this end, we define the projection range.
|
| 170 |
+
|
| 171 |
+
Definition 2.2 (Projection range) Let $p \in S$ be a point and $v \in \mathbb { R } ^ { d } a$ vector. The projection range $d ( p , v , \pi _ { S } )$ in direction v is the maximal distance one can travel from $p$ along $v$ such that the closest point projection yields only the point $p$ :
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
d ( p , v , \pi _ { \mathcal { S } } ) = \operatorname* { s u p } \{ \lambda \in \mathbb { R } \mid \pi _ { \mathcal { S } } ( p + \lambda v ) = \{ p \} \} .
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
Since $\pi _ { S } ( p ) = \{ p \}$ , the projection range is canonically non-negative. Furthermore, the directions for which the range is positive are key to our study, because of the following property:
|
| 178 |
+
|
| 179 |
+
Lemma 2.3 (Theorem 4.8 (6) of [19]) Consider a point $p \in S$ and a vector $v \in \mathbb { R } ^ { d }$ . I f
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
0 < d ( p , v , \pi _ { S } ) < \infty ,
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
then $p + d ( p , v , \pi _ { S } ) \cdot v \in \overline { { \operatorname { a x } ( S ) } }$ .
|
| 186 |
+
|
| 187 |
+
We call these special directions $v$ back projection vectors:
|
| 188 |
+
|
| 189 |
+
Definition 2.4 (Unit back projection vectors) For a point $p \in { \mathcal { S } }$ , $\mathrm { U B P } ( p , S )$ is the set of unit vectors with a positive projection range:
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\mathrm { U B P } ( p , S ) = \left\{ u \in \mathbb { R } ^ { d } \mid | u | = 1 a n d 0 < d ( p , u , \pi _ { S } ) < \infty \right\} .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
133 We further define
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\begin{array} { r l } & { \mathrm { U B P } ( S ) = \left\{ ( p , u ) \in S \times \mathbb { R } ^ { d } \ : \middle | \ : u \in \mathrm { U B P } ( p , S ) \right\} , } \\ & { \quad \mathrm { B P } ( S ) = \left\{ ( p , \lambda u ) \in S \times \mathbb { R } ^ { d } \ : \middle | \ : ( p , u ) \in \mathrm { U B P } ( S ) , \lambda \geq 0 \right\} . } \end{array}
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
2The bounding sphere does allow one to give a relatively clean mathematical statement, see Section 4.
|
| 202 |
+
|
| 203 |
+
134 Thanks to Lemma 2.3, the following map is well-defined:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
\pi _ { \mathrm { a x } , { \mathcal { S } } } : \operatorname { U B P } ( { \mathcal { S } } ) \to \operatorname { \overline { { a x } } } ( { \mathcal { S } } ) , \qquad ( p , u ) \mapsto p + d ( p , u , \pi _ { \mathcal { S } } ) u .
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
135 The generalized tangent and normal space Back projection vectors are intricately related to the
|
| 210 |
+
136 generalized tangent and normal spaces.
|
| 211 |
+
137 Definition 2.5 (Definitions 4.3 and 4.4 of [19]) Let $\boldsymbol { p } \in \textit { s }$ . The generalized tangent space
|
| 212 |
+
138 $\mathrm { T a n } ( p , S )$ is the set of vectors $u \in \mathbb { R } ^ { d }$ , such that either $u = 0$ or, for every $\varepsilon > 0$ there exists
|
| 213 |
+
139 a point $q \in S$ with
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
0 < | q - p | < \varepsilon \qquad \mathit { a n d } \qquad \left| \frac { q - p } { | q - p | } - \frac { u } { | u | } \right| < \varepsilon .
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
140 The generalized normal space $\operatorname { N o r } ( p , S )$ consists of vectors $v \in \mathbb { R } ^ { d }$ such that $\langle v , u \rangle \leq 0$ for all
|
| 220 |
+
141 $u \in { \mathrm { T a n } } ( p , S )$ . Vectors contained in the generalized tangent, resp. normal, space are called tangent,
|
| 221 |
+
142 resp. normal, to $s$ at $p$ .
|
| 222 |
+
|
| 223 |
+
143 The generalized tangent and normal spaces are illustrated in Figure 3.
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 3: The (affine) generalized tangent and normal spaces of four points in the set $\mathcal { S } \subset \mathbb { R } ^ { 2 }$ , in light blue and violet, respectively.
|
| 227 |
+
|
| 228 |
+
144 Stability of the reach under ambient diffeomorphisms Our last ingredient is the following result
|
| 229 |
+
145 by Federer.
|
| 230 |
+
146 Theorem 2.6 (Stability of the reach under ambient diffeomorphisms, Theorem 4.19 of [19])
|
| 231 |
+
147 Pick two constants $0 < t < \operatorname { r c h } ( S )$ and $s > 0$ . If the map
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
F : \{ x \in \mathbb { R } ^ { d } \mid d ( x , S ) < s \} \mathbb { R } ^ { n }
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
is injective and continuously differentiable, and the maps 148 $F$ , $F ^ { - 1 }$ , and $D F$ are Lipschitz continuous 149 with Lipschitz constants $\operatorname { L i p } ( F ) , \operatorname { L i p } ( F ^ { - 1 } ) , \operatorname { L i p } ( D F )$ , respectively, then the reach $\operatorname { r c h } ( F ( S ) )$ of the 150 image of the set $s$ under the map $F$ is lower-bounded by
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\operatorname { r c h } ( F ( S ) ) \geq \operatorname* { m i n } \left\{ { \frac { s } { \mathrm { L i p } ( F ^ { - 1 } ) } } , { \frac { 1 } { \left( { \frac { \mathrm { L i p } ( F ) } { t } } + \mathrm { L i p } ( D F ) \right) \left( \mathrm { L i p } ( F ^ { - 1 } ) \right) ^ { 2 } } } \right\} .
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
# 151 3 Stability of the medial axis under ambient diffeomorphisms
|
| 244 |
+
|
| 245 |
+
152 In this section we present the main result of this paper, Theorem 3.9. This theorem extends earlier
|
| 246 |
+
153 work by Chazal and Soufflet [13]. Its proof relies on Federer’s result on the stability of the reach,
|
| 247 |
+
154 Theorem 2.6. To give a more geometrical interpretation we introduce the concept of a weakly tangent
|
| 248 |
+
155 sphere and ball, and a maximal empty weakly tangent ball.
|
| 249 |
+
156 Definition 3.1 (Weakly tangent sphere and ball) Let $p \in S$ . A sphere is called weakly tangent
|
| 250 |
+
157 to $s$ at $p$ if it contains the point $p$ and its centre lies in the (translated) generalized normal space
|
| 251 |
+
158 $\mathrm { N o r } ( p , S ) + p$ . In other words, spheres weakly tangent to $s$ at $p$ are spheres with centres $p + v$ and
|
| 252 |
+
159 radii $| v |$ , for a vector $v \in \operatorname { N o r } ( p , S )$ .
|
| 253 |
+
|
| 254 |
+
A ball is called weakly tangent to $s$ at $p$ if its boundary sphere is weakly tangent to $s$ at $p .$
|
| 255 |
+
|
| 256 |
+
161 Remark 3.2 Using the definition of $\operatorname { N o r } ( p , S )$ , a weakly tangent ball can also be defined as follows:
|
| 257 |
+
162 A ball $B ( c , r )$ is weakly tangent at $p$ if and only if its centre c and radius $r$ satisfy
|
| 258 |
+
|
| 259 |
+
$$
|
| 260 |
+
( p + \operatorname { T a n } ( S , p ) ) \cap B ( c , r ) = \{ p \} .
|
| 261 |
+
$$
|
| 262 |
+
|
| 263 |
+
163 We remark:
|
| 264 |
+
|
| 265 |
+
164 Lemma 3.3 Let $p \in S$ and $v \in \mathbb { R } ^ { d }$ , and suppose that for some $\lambda > 0$ we have $\pi _ { S } ( p + \lambda v ) \neq \{ p \}$ .
|
| 266 |
+
Then, for all 165 $\lambda ^ { \prime } \geq \lambda$ , we have $\pi s ( p + \lambda ^ { \prime } v ) \neq \{ p \}$ and for all $\lambda ^ { \prime } > \lambda$ , that $p \notin \pi s ( p + \lambda ^ { \prime } v )$ .
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 4: Two families of balls weakly tangent to the set $\mathcal { S } \subset \mathbb { R } ^ { 2 }$ (in blue). Each family contains a unique maximal empty ball (in purple). Notice that the centre of the maximal empty ball weakly tangent at the point $p _ { 1 }$ lies at the medial axis $\operatorname { a x } ( S )$ , while the centre of the maximal empty ball weakly tangent at the point $p _ { 2 }$ only lies at its closure, $\overline { { \operatorname { a x } ( \mathcal { S } ) } }$ .
|
| 270 |
+
|
| 271 |
+
Lemma 3.3 essentially tells us that a family of weakly tangent balls 166 $\{ B ( p + \lambda v , \lambda | v | ) \} _ { \lambda \geq 0 }$ contains 167 at most one which is maximal with respect to inclusion among those whose interior is disjoint from 168 the set $s$ . Two such families are illustrated in Figure 4.
|
| 272 |
+
|
| 273 |
+
169 We call such balls maximal empty. For the purpose of this article, we define maximal empty balls in
|
| 274 |
+
170 terms of unit back projection vectors (Definition 2.4). To see that each maximal empty ball is indeed
|
| 275 |
+
171 weakly tangent, we emphasise:
|
| 276 |
+
72 Lemma 3.4 If $( p , v ) \in \operatorname { B P } ( S )$ , then $( p , v ) \in \operatorname { N o r } ( S )$ . That is, $\mathrm { B P } ( S ) \subseteq \mathrm { N o r } ( S )$ . In particular, for
|
| 277 |
+
3 any pair $( p , u ) \in \operatorname { U B P } ( S )$ and radius $\lambda \geq 0$ , the ball $B ( p + \lambda u , \lambda )$ is weakly tangent to $s$ .
|
| 278 |
+
174 Remark 3.5 For general closed sets, the converse of Lemma 3.4, that is, $\mathrm { N o r } ( S ) \subseteq \mathrm { B P } ( S )$ , is not
|
| 279 |
+
175 true. One counter-example is the graph of the function $x \mapsto | x | ^ { 3 / 2 }$ at the origin. However, the
|
| 280 |
+
176 inclusion $\operatorname { N o r } ( S ) \subseteq \operatorname { B P } ( S )$ holds for sets of positive reach, thanks to Theorem 4.8 (12) of [19]
|
| 281 |
+
177 (recalled in the supplementary material).
|
| 282 |
+
178 Definition 3.6 (Maximal empty weakly tangent ball) Let $( p , u ) \in \operatorname { U B P } ( S )$ . A weakly tangent
|
| 283 |
+
179 ball $B ( p + \lambda u , \lambda )$ is called maximal empty to $\begin{array} { r } { S i f \lambda = d ( p , u , \pi _ { S } ) } \end{array}$ , or, equivalently, if $\pi _ { \mathrm { a x } , S } ( p , u ) =$
|
| 284 |
+
180 $p + \lambda u$ .
|
| 285 |
+
|
| 286 |
+
181 (Maximal empty) weakly tangent balls satisfy the following properties. Let $( p , u ) \in \operatorname { U B P } ( S )$
|
| 287 |
+
|
| 288 |
+
• For any radius $0 < \lambda \leq d ( p , u , \pi _ { S } )$ , the interior of the ball $B ( p + \lambda u , \lambda )$ is disjoint from the set $s$ . This follows directly from Definition 3.6 and Lemma 3.3.
|
| 289 |
+
|
| 290 |
+
• The centres of maximal empty weakly tangent balls lie on the closure of the medial axis of $s$ . This is due to Lemma 2.3 and the definition of the map $\pi _ { \mathrm { a x } , S }$ (equation (1)).
|
| 291 |
+
|
| 292 |
+
186 The following lemma moreover tells us, that each point on the medial axis is a centre of a maximal
|
| 293 |
+
187 empty weakly tangent ball.
|
| 294 |
+
188 Lemma 3.7 (Surjectivity on $\mathrm { a x } ( S ) )$ ) For any point $x \in \operatorname { a x } ( S )$ and $p \in \pi _ { S } ( x )$ , there exists a vector
|
| 295 |
+
189 $u \in \mathrm { U B P } ( p , S )$ such that $\pi _ { \mathrm { a x } , S } ( p , u ) = x$ . In other words, $B ( x , | x - p | )$ is a maximally empty
|
| 296 |
+
190 weakly tangent ball. Moreover, we have that
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\operatorname { a x } ( S ) \subseteq \pi _ { \mathrm { a x } , S } \left( \operatorname { U B P } ( S ) \right) \subseteq { \overline { { \operatorname { a x } ( S ) } } } .
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
191 We are now almost ready to state our main theorem. Before phrasing the result, we walk the reader through the assumptions and fix the notation on the way. The assumptions are illustrated in Figure 5.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 5: The setting of Theorem 3.9.
|
| 306 |
+
|
| 307 |
+
# 193 Assumption 3.8
|
| 308 |
+
|
| 309 |
+
• We assume that the set $s$ has a bounding sphere of radius $r$ , which we denote by $S ( r )$ .
|
| 310 |
+
• We consider a $C ^ { 1 }$ diffeomorphism $F : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ such that the Lipschitz constants of $F$ and $F ^ { - 1 }$ are bounded by $L _ { F }$ , and the Lipschitz constants of the differentials $D F$ and $D F ^ { - 1 }$ are bounded by $L _ { D F }$ . We call such a diffeomorphism a $\dot { C } ^ { 1 , 1 }$ diffeomorphism.
|
| 311 |
+
• We further assume that the map $F$ leaves the bounding sphere $S ( r )$ invariant, that is, $F ( \overbar { S } ( r ) ) = S ( r )$ .
|
| 312 |
+
• We pick a point $c \in \operatorname { a x } ( S )$ , a point $p \in \pi _ { S } ( c )$ , and write $\rho = | c - p |$ . Observe that since $S \cap \operatorname { a x } ( S ) = \emptyset$ , $\rho$ is positive. By Lemma 3.7, the ball $B ( c , \rho )$ is a maximal empty weakly tangent ball to $s$ at $p$ . Moreover, we define $\begin{array} { r } { u = \frac { c - p } { | c - p | } } \end{array}$ and note that $u \in \mathrm { U B P } ( p , S )$ .
|
| 313 |
+
• We denote the tangent hyperplane to the boundary sphere of $B ( c , \rho )$ at $p$ by $p + T$ . The hyperplane $T$ is the orthocomplement of the vector $u$ : $T = u ^ { \perp }$ .
|
| 314 |
+
• We work with the unit vector at $F ( p )$ that points inside the image of the ball $B ( c , \rho )$ and is orthogonal to the hyperplane $D _ { p } F ( T )$ . We denote this vector by $u ^ { \prime }$ .
|
| 315 |
+
|
| 316 |
+
207 Theorem 3.9 Under the above assumptions, there exists a maximal empty weakly tangent ball
|
| 317 |
+
208 $B ( c ^ { \prime } , \rho ^ { \prime } )$ to the set $F ( S )$ , whose boundary sphere has an internal normal $u ^ { \prime }$ . In particular, the
|
| 318 |
+
209 ball $B ( c ^ { \prime } , \rho ^ { \prime } )$ is tangent to the affine hyperplane $F ( p ) + D _ { p } F ( T )$ . Its radius $\rho ^ { \prime }$ is bounded by
|
| 319 |
+
210 $\begin{array} { r } { \rho ^ { \prime } \in \bigg [ \frac { \rho } { ( L _ { F } ) ^ { 3 } + \rho L _ { D F } ( L _ { F } ) ^ { 2 } } , \frac { ( L _ { F } ) ^ { 3 } \rho } { 1 - \rho L _ { D F } ( L _ { F } ) ^ { 2 } } } \end{array}$ . Assume, moreover, that the distortions of both $F$ and $D F$
|
| 320 |
+
211 are bounded, that is, for all $x \in \mathbb { R } ^ { d }$ ,
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
| F ( x ) - x | \leq \varepsilon _ { 1 } , \qquad \| D F _ { x } - \mathrm { I d } \| \leq \varepsilon _ { 2 } < 1 ,
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
and 212 $r \cdot L _ { D F } ( L _ { F } ) ^ { 2 } \leq 1 / 2$ . Define
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { l } { { C _ { L } ( r , L _ { F } , L _ { D F } , \varepsilon _ { 1 } , \varepsilon _ { 2 } ) = } } \\ { { 2 r \sqrt { 1 + ( L _ { F } ) ^ { 6 } \left( 1 + 4 r L _ { D F } ( L _ { F } ) ^ { 2 } \right) ^ { 2 } - 2 ( L _ { F } ) ^ { 3 } \left( 1 + 4 r L _ { D F } ( L _ { F } ) ^ { 2 } \right) \sqrt { 1 - ( \varepsilon _ { 2 } ) ^ { 2 } } } + \varepsilon _ { 1 } } } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
213 then the map $\pi _ { \mathrm { a x } , S }$ satisfies
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
| \pi _ { \mathrm { a x } , \mathcal { S } } ( p , u ) - \pi _ { \mathrm { a x } , F ( \mathcal { S } ) } ( F ( p ) , u ^ { \prime } ) | \leq C _ { L } ( r , L _ { F } , L _ { D F } , \varepsilon _ { 1 } , \varepsilon _ { 2 } ) .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
d _ { H } ( \mathrm { a x } ( S ) , \mathrm { a x } ( F ( S ) ) ) \leq C _ { L } ( r , L _ { F } , L _ { D F } , \varepsilon _ { 1 } , \varepsilon _ { 2 } ) .
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
215 The bound $| F ( x ) - x | \leq \varepsilon _ { 1 }$ is really necessary, because we want our theorem to accommodate for
|
| 343 |
+
216 rotations and translations, which rotate and translate the medial axis without changing distances
|
| 344 |
+
217 and hence have Lipschitz constant 1. We further stress that if the diffeomorphism $F$ is close to the
|
| 345 |
+
218 identity, its Lipschitz constant satisfies $L _ { F } \geq 1$ , because by assumption $F$ leaves the bounding sphere
|
| 346 |
+
219 $S ( r )$ invariant, and $L _ { D F }$ is close to zero.
|
| 347 |
+
220 Sketch of the proof of Theorem 3.9 The idea of the proof is depicted in Figure 5. Thanks to Federer’s
|
| 348 |
+
221 result (Theorem 2.6), we know that the reach of the maximal empty weakly tangent ball $B ( c , \rho )$
|
| 349 |
+
222 does not change too much under the ambient diffeomorphism $F$ . This gives a lower bound on the
|
| 350 |
+
223 radius of every maximal empty weakly tangent ball of the image of this ball — the set $F ( B ( c , \rho ) )$ .
|
| 351 |
+
224 We show that in the interior of $F ( B ( { \dot { c } } , \rho ) )$ , the radii of the maximal empty weakly tangent balls
|
| 352 |
+
225 of $F ( B ( c , \rho ) )$ are close to $\rho$ . One of these balls is also empty weakly tangent to $F ( S )$ at $F ( p )$ ,
|
| 353 |
+
226 though not necessarily maximal. We denote its centre by $c ^ { \prime }$ . Since we can apply the same argument
|
| 354 |
+
227 for the map $F ^ { - 1 }$ , we find an upper and lower bound on the radius of the maximal weakly tangent
|
| 355 |
+
228 ball $B ( c ^ { \prime } , \rho ^ { \prime } )$ of $F ( S )$ at $F ( p )$ that is also weakly tangent to $F ( B ( c , \rho ) )$ , or equivalently tangent to
|
| 356 |
+
229 $D _ { p } F ( T )$ .
|
| 357 |
+
230 While this bound on the difference of the radii is essentially a bound on the distance $\left| \left| c - p \right| - \left| c ^ { \prime } - \right| \right|$
|
| 358 |
+
231 $F ( p ) | |$ between the points $c - p$ and $c ^ { \prime } - F ( p )$ , the bound $\varepsilon _ { 2 }$ on $\| D F - 1 \|$ allows one to bound the
|
| 359 |
+
232 angle between the vectors $c - p$ and $c ^ { \prime } - F ( p )$ . With the assumption (2) we can then derive a bound
|
| 360 |
+
233 the distance between the points $c$ and $c ^ { \prime }$ . Finally, thanks to [19, Theorem 4.8 (6)] (Lemma 2.3) this
|
| 361 |
+
234 induces a bound on the Hausdorff distance between the (closure of the) two medial axes $\operatorname { a x } ( S )$ and
|
| 362 |
+
235 $\operatorname { a x } ( F ( S ) )$ . □
|
| 363 |
+
|
| 364 |
+
It was a surprise to the authors that no assumption on the set (apart from closedness) needed to be made, and that the techniques used were that simple and well established; they go back to Federer [19]. In fact, the authors at first envisioned a far more elaborate argument assuming the set had positive $\mu$ -reach [11].
|
| 365 |
+
|
| 366 |
+
# 4 Quantifying 240 $C ^ { 1 , 1 }$ diffeomorphisms as deviations from identity
|
| 367 |
+
|
| 368 |
+
241 In this section we reformulate the main result in terms of norms on Banach spaces. This reformulation
|
| 369 |
+
242 offers a more theoretical insight, and we believe the reformulated bounds are easier to work with in
|
| 370 |
+
243 certain applications. Indeed, in the context of practical numerical computations, a bound on the
|
| 371 |
+
244 Lipschitz constant of an operator — or, at least, a modulus of continuity — allows to control the
|
| 372 |
+
245 condition number. This control is particularly useful when we calculate with objects such as the
|
| 373 |
+
246 medial axis,whose (numerical) stability is often problematic in practice.
|
| 374 |
+
|
| 375 |
+
As we will see below, for this reformulation we somewhat strengthen our assumptions.
|
| 376 |
+
|
| 377 |
+
248 We decompose a diffeomorphism $F$ into the identity map $\mathbb { 1 } _ { \mathbb { R } ^ { d } }$ on $\mathbb { R } ^ { d }$ , and a displacement field $\varphi$
|
| 378 |
+
249 $F = \mathbb { 1 } _ { \mathbb { R } ^ { d } } + \varphi$ . For the choice of the displacement field, we restrict ourselves to the vector space $\mathcal { U }$ of
|
| 379 |
+
250 all $C ^ { 1 , 1 }$ maps $\varphi$ from $\mathbb { R } ^ { d }$ to $\mathbb { R } ^ { d }$ whose restriction to the exterior $\mathbb { R } ^ { d } \backslash B ( r )$ of a certain bounding ball
|
| 380 |
+
251 $B ( r )$ equals 0.3
|
| 381 |
+
|
| 382 |
+
52 A natural norm associated to $\mathcal { U }$ is one that makes it a Banach space. A typical choice, inherited from general Banach spaces of 53 $C ^ { 1 , 1 }$ functions, would be for example, for $\varphi \in { \mathcal { U } }$ ,
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\| \varphi \| _ { C ^ { 1 , 1 } } = \operatorname* { m a x } \left( \| \varphi \| _ { \infty } , \| D \varphi \| _ { \infty } , \operatorname { L i p } ( D \varphi ) \right) .
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
54 Here we used the following notation:
|
| 389 |
+
|
| 390 |
+
• $\begin{array} { r } { \| \varphi \| _ { \infty } = \operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } | \varphi ( x ) | } \end{array}$ denotes the sup norm on $x \mapsto | \varphi ( x ) |$ , where $| \cdot |$ is the Euclidean norm in $\mathbb { R } ^ { d }$ ,
|
| 391 |
+
• $\| D \varphi \| _ { \infty } = \operatorname* { s u p } _ { x \in \mathbb { R } ^ { d } } \| D \varphi ( x ) \|$ denotes the sup norm on $x \mapsto \| D \varphi ( x ) \|$ , where $\| D \varphi ( x ) \|$ is the operator norm induced by the Euclidean norm on $\mathbb { R } ^ { d }$ .
|
| 392 |
+
|
| 393 |
+
• We write $\mathrm { L i p } ( D \varphi )$ for the Lipschitz semi-norm of $D \varphi$ . The Lipschitz semi-norms of $\varphi$ and $D \varphi$ are defined as
|
| 394 |
+
|
| 395 |
+
and
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\begin{array} { c } { \displaystyle \mathrm { L i p } ( \varphi ) = \displaystyle \operatorname* { s u p } _ { \substack { x , y \in \mathbb { R } ^ { d } , x \neq y } } \frac { \vert \varphi ( y ) - \varphi ( x ) \vert } { \vert y - x \vert } , } \\ { \displaystyle \mathrm { L i p } ( D \varphi ) = \displaystyle \operatorname* { s u p } _ { \substack { x , y \in \mathbb { R } ^ { d } , x \neq y } } \frac { \Vert D \varphi ( y ) - D \varphi ( x ) \Vert } { \vert y - x \vert } . } \end{array}
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
262 The norm defined in (4) makes $\mathcal { U }$ into a Banach space, since every Cauchy sequence in $\mathcal { U }$ has a limit
|
| 402 |
+
263 in $\mathcal { U }$ . In addition, any function $\varphi \in { \mathcal { U } }$ satisfies:
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l } & { \mathrm { L i p } ( \varphi ) = \| D \varphi \| _ { \infty } , } \\ & { \| D \varphi \| _ { \infty } \leq r \mathrm { L i p } ( D \varphi ) , } \\ & { \| \varphi \| _ { \infty } \leq r \mathrm { L i p } ( \varphi ) \leq r ^ { 2 } \mathrm { L i p } ( D \varphi ) , } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
since the restriction of $\varphi$ to $\mathbb { R } ^ { d } \setminus B ( r )$ is 0. This in turn yields that $\mathrm { L i p } ( D \varphi ) \ \leq \ \| \varphi \| _ { C ^ { 1 , 1 } } \ \leq$ $\operatorname* { m a x } ( 1 , r , r ^ { 2 } ) \operatorname { L i p } ( D \varphi )$ . Thus, in $\mathcal { U }$ , the norm $\varphi \mapsto \operatorname { L i p } ( D \varphi )$ is equivalent to the norm $\varphi \mapsto \| \varphi \| _ { C ^ { 1 , 1 } }$ .
|
| 409 |
+
|
| 410 |
+
We can now state slightly less general version of Theorem 3.9 in terms of the Banach space $( \mathcal { U } , \varphi \mapsto$ $\mathrm { L i p } ( D \varphi )$ ) .
|
| 411 |
+
|
| 412 |
+
Theorem 4.1 Let $S \subseteq \mathbb { R } ^ { d }$ be bounded by the ball $B ( r )$ of radius $r > 0$ , such that $S ( \boldsymbol { r } ) = \partial B ( \boldsymbol { r } ) \subseteq$ $\mathcal { S } _ { \mathbf { \Omega } }$ . Let further $F$ be a $C ^ { 1 , 1 }$ diffeomorphism from $\mathbb { R } ^ { d }$ to itself that leaves the set $\mathbb { R } ^ { d } \backslash B ( r )$ invariant, and define two displacement fields $\varphi , \tilde { \varphi } \in \mathcal { U }$ such that $F = \mathbb { 1 } _ { \mathbb { R } ^ { d } } + \varphi$ and
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\left( \mathbb { 1 } _ { \mathbb { R } ^ { d } } + \tilde { \varphi } \right) \circ \left( \mathbb { 1 } _ { \mathbb { R } ^ { d } } + \varphi \right) = \mathbb { 1 } _ { \mathbb { R } ^ { d } } .
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
271 Define $\varepsilon = \operatorname* { m a x } \left( \mathrm { L i p } ( D \varphi ) , \mathrm { L i p } ( D \tilde { \varphi } ) \right)$ .
|
| 419 |
+
|
| 420 |
+
272 If $r \varepsilon ~ \leq ~ 1 / 4$ , the Hausdorff distance between the medial axes of the set √ $s$ and its image 273 $F ( S )$ is bounded by $d _ { H } ( \operatorname { a x } ( S ) , \operatorname { a x } ( F ( S ) ) ) ~ \leq ~ \left( 1 + { \sqrt { 5 0 } } \right) r ^ { 2 } \varepsilon + { \mathcal { O } } \left( r ^ { 3 } \varepsilon ^ { 2 } \right)$ . In particular, 274 $d _ { H } ( \operatorname { a x } ( S ) , \operatorname { a x } ( F ( S ) ) ) = { \mathcal { O } } \left( r ^ { 2 } \varepsilon \right)$ .
|
| 421 |
+
|
| 422 |
+
275 Sketch of the proof Essentially, the proof consists of rewriting Theorem 3.9 in terms of the language
|
| 423 |
+
76 developed in this section. □
|
| 424 |
+
277 Remark 4.2 Observe that the bound $\mathcal { O } \left( r ^ { 2 } \varepsilon \right)$ is consistent with a scaling by factor $\lambda \colon S \mapsto \lambda S$
|
| 425 |
+
278 $F ( \cdot ) \mapsto \lambda F ( \cdot / \lambda )$ . Under such a scaling, the radius $r$ is multiplied by $\lambda$ , while the Lipschitz
|
| 426 |
+
279 constant $\mathrm { L i p } ( D \varphi )$ — and therefore $\varepsilon$ — is divided by $\lambda$ . Furthermore, the Hausdorff distance
|
| 427 |
+
280 $d _ { H } ( \operatorname { a x } ( S ) , \operatorname { a x } ( F ( S ) ) )$ increases by a factor $\lambda .$ . By considering a diffeomorphism that translates the
|
| 428 |
+
281 set $ { \boldsymbol { S } } \setminus { \boldsymbol { S } } ( { \boldsymbol { r } } )$ while keeping the bounding sphere $S ( r )$ fixed, we see that this bound is asymptotically
|
| 429 |
+
282 optimal.
|
| 430 |
+
|
| 431 |
+
# 5 Conclusion and future work
|
| 432 |
+
|
| 433 |
+
We proved the Hausdorff stability of the medial axis of a closed set without any further assumption on it (as explained in Remark 2.1, the existence of the bounding sphere serves to formulate the main result in a clean way).
|
| 434 |
+
|
| 435 |
+
With regard to applications, our result is the first step towards providing a provably correct image recognition in particular in the context of astrophysics. The next step is to produce physics-informed models for the medial axis as occurring in astronomical data.
|
| 436 |
+
|
| 437 |
+
On the mathematical side, we conclude with a conjecture generalizing our result. We believe that our result generalizes to compact Riemannian manifolds with bounded curvature.
|
| 438 |
+
|
| 439 |
+
Conjecture 5.1 Let $\mathcal { M }$ be a compact Riemannian manifold with bounded sectional curvature4 and S a closed subset of M. Then the medial axis (also called cut locus [26]) of $s$ in $\mathcal { M }$ is Lipschitz stable under diffeomorphisms of $\mathcal { M }$ .
|
| 440 |
+
|
| 441 |
+
References [1] Eddie Aamari and Alexander Knop. Statistical query complexity of manifold estimation. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2021, pages 116–122, New York, NY, USA, 2021. Association for Computing Machinery. [2] Eddie Aamari and Clément Levrard. Stability and minimax optimality of tangential Delaunay complexes for manifold reconstruction. Discrete & Computational Geometry, 59:923–971, 2018. [3] N. Amenta and M. Bern. Surface reconstruction by Voronoi filtering. Discrete & Computational Geometry, 22(4):481–504, Dec 1999. [4] Nina Amenta, Sunghee Choi, and Ravi Krishna Kolluri. The power crust. In Proceedings of the sixth ACM symposium on Solid modeling and applications, pages 249–266, 2001. [5] Dominique Attali, Jean-Daniel Boissonnat, and Herbert Edelsbrunner. Stability and computation of medial axes - a state-of-the-art report. In Torsten Möller, Bernd Hamann, and Robert D. Russell, editors, Mathematical Foundations of Scientific Visualization, Computer Graphics, and Massive Data Exploration, pages 109–125, Berlin, Heidelberg, 2009. Springer Berlin Heidelberg. [6] Dominique Attali and Annick Montanvert. Computing and simplifying 2d and 3d continuous skeletons. Computer vision and image understanding, 67(3):261–273, 1997. [7] Matthias Bartelmann. Gravitational lensing. Classical and Quantum Gravity, 27(23):233001, nov 2010. [8] M. Berger. A Panoramic View of Riemannian Geometry. Springer-Verlag, 2003. [9] W. Blaschke. Kreis und Kugel. Verlag von Veit und Comp., 1916. [10] Erin Chambers, Ellen Gasparovic, and Kathryn Leonard. Medial fragments for segmentation of articulating objects in images. Research in Shape Analysis: WiSH2, Sirince, Turkey, June 2016, pages 1–15, 2018.
|
| 442 |
+
320 [11] F. Chazal, D. Cohen-Steiner, and A. Lieutier. A sampling theory for compact sets in Euclidean space. Discrete and Computational Geometry, 41(3):461–479, 2009.
|
| 443 |
+
322 [12] F. Chazal and A. Lieutier. The $\lambda$ -medial axis. Graphical Models, 67(4):304–331, 2005.
|
| 444 |
+
323 [13] F. Chazal and R. Soufflet. Stability and finiteness properties of medial axis and skeleton. Journal of Dynamical and Control Systems, 10(2):149–170, 2004.
|
| 445 |
+
325 [14] Kim Coble, Kevin McLin, and Lynn Cominsky. Big Ideas in Cosmology. Libretexts Physics, 2020.
|
| 446 |
+
327 [15] James Damon. Geometry and Medial Structure, pages 69–123. Springer Netherlands, Dordrecht, 2008.
|
| 447 |
+
329 [16] James Damon. Rigidity properties of the blum medial axis. Journal of Mathematical Imaging and Vision, 63(1):120–129, 2021.
|
| 448 |
+
331 [17] James Damon and Ellen Gasparovic. Medial/skeletal linking structures for multi-region configurations, volume 250. American Mathematical Society, 2017. [18] Ilke Demir, Camilla Hahn, Kathryn Leonard, Geraldine Morin, Dana Rahbani, Athina Panotopoulou, Amelie Fondevilla, Elena Balashova, Bastien Durix, and Adam Kortylewski. SkelNetOn 2019: Dataset and challenge on deep learning for geometric shape understanding. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 1143–1151, 2019. [19] H. Federer. Curvature measures. Transactions of the America mathematical Society, 93:418–491, 1959.
|
| 449 |
+
40 [20] Charles Fefferman, Sergei Ivanov, Yaroslav Kurylev, Matti Lassas, and Hariharan Narayanan. Fitting a putative manifold to noisy data. In Conference On Learning Theory, pages 688–720. PMLR, 2018.
|
| 450 |
+
43 [21] Charles Fefferman, Sergei Ivanov, Matti Lassas, and Hariharan Narayanan. Fitting a manifold of large reach to noisy data. arXiv preprint arXiv:1910.05084, 2019.
|
| 451 |
+
45 [22] Charles Fefferman, Sergei Ivanov, Matti Lassas, and Hariharan Narayanan. Reconstruction of a Riemannian manifold from noisy intrinsic distances. SIAM Journal on Mathematics of Data Science, 2(3):770–808, 2020.
|
| 452 |
+
48 [23] J. D. Fernie. The period-luminosity relation: A historical review. Publications of the Astronomical Society of the Pacific, 81(483):707, dec 1969. [24] Ellen Gasparovic. The Blum medial linking structure for multi-region analysis. PhD thesis, The University of North Carolina at Chapel Hill, 2012. [25] Seng-Beng Ho and Charles R Dyer. Shape smoothing using medial axis properties. IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-8(4):512–520, 1986. [26] Vitali Kapovitch and Alexander Lytchak. Remarks on manifolds with two-sided curvature bounds. Analysis and Geometry in Metric Spaces, 9(1):53–64, 2021. [27] Jean-Claude Latombe. Robot motion planning, volume 124. Springer Science & Business Media, 2012.
|
| 453 |
+
[28] André Lieutier. Any open bounded subset of 58 $\mathbb { R } ^ { n }$ has the same homotopy type as its medial axis. Computer-Aided Design, 36(11):1029 – 1046, 2004. Solid Modeling Theory and Applications. [29] André Lieutier and Mathijs Wintraecken. Hausdorff and gromov-hausdorff stable subsets of the medial axis. Proceedings of the 55th ACM Symposium on Theory of Computing (STOC 2023), 2023. [30] John N Mather. Distance from a submanifold in euclidean-space. In Proceedings of symposia in pure mathematics, volume 40, pages 199–216. AMER MATHEMATICAL SOC 201 CHARLES ST, PROVIDENCE, RI 02940-2213, 1983.
|
| 454 |
+
66 [31] Phillip James Edwin Peebles. Principles of physical cosmology, volume 27. Princeton university press, 1993. [32] Punam K Saha, Gunilla Borgefors, and Gabriella Sanniti di Baja. A survey on skeletonization algorithms and their applications. Pattern recognition letters, 76:3–12, 2016.
|
| 455 |
+
70 [33] Doron Shaked and Alfred M. Bruckstein. Pruning medial axes. Computer Vision and Image Understanding, 69(2):156 – 169, 1998. [34] Barak Sober and David Levin. Manifold approximation by moving least-squares projection (MMLS). Constructive Approximation, 52(3):433–478, 2020. [35] Andrea Tagliasacchi, Thomas Delame, Michela Spagnuolo, Nina Amenta, and Alexandru Telea. 3d skeletons: A state-of-the-art report. In Computer Graphics Forum, volume 35, pages 573–597. Wiley Online Library, 2016. [36] Zhongwei Tang, Rafael Grompone Von Gioi, Pascal Monasse, and Jean-Michel Morel. A precision analysis of camera distortion models. IEEE Transactions on Image Processing, 26(6):2694–2704, 2017.
|
| 456 |
+
80 [37] R. Thom. Sur le cut-locus d’une variété plongée. Journal of Differential Geometry, 6(4):577– 586, 1972.
|
| 457 |
+
82 [38] Martijn van Manen. Maxwell strata and caustics. In Singularities In Geometry And Topology, pages 787–824. World Scientific, 2007.
|
| 458 |
+
|
| 459 |
+
384 [39] C. T. C. Wall. Geometric properties of generic differentiable manifolds. In Jacob Palis and
|
| 460 |
+
385 Manfredo do Carmo, editors, Geometry and Topology, pages 707–774, Berlin, Heidelberg, 1977.
|
| 461 |
+
386 Springer Berlin Heidelberg.
|
| 462 |
+
387 [40] Franz-Erich Wolter. Cut locus and medial axis in global shape interrogation and representation.
|
| 463 |
+
388 1993.
|
| 464 |
+
389 [41] Yajie Yan, Kyle Sykes, Erin Chambers, David Letscher, and Tao Ju. Erosion thickness on
|
| 465 |
+
390 medial axes of 3d shapes. ACM Transactions on Graphics, 35(4):38:1–38:12, July 2016.
|
md/dev/TBWA6PLJZQm/TBWA6PLJZQm.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/UROBiQEOLP/UROBiQEOLP.md
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# E-FORCING: IMPROVING AUTOREGRESSIVE MODELS BY TREATING IT AS AN ENERGY-BASED ONE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Autoregressive generative models are commonly used to solve tasks involving sequential data. They have, however, been plagued by a slew of inherent flaws due to the intrinsic characteristics of chain-style conditional modeling (e.g., exposure bias or lack of long-range coherence), severely limiting their ability to model distributions properly. In this paper, we propose a unique method termed EForcing for training autoregressive generative models that takes advantage of a well-designed energy-based learning objective. By leveraging the extra degree of freedom of the softmax operation, we are allowed to make the autoregressive model itself an energy-based model for measuring the likelihood of input without introducing any extra parameters. Furthermore, we show that with the help of E-Forcing, we can alleviate the above flaws for autoregressive models. Extensive empirical results, covering numerous benchmarks demonstrate the effectiveness of the proposed approach.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
By factorizing the joint distribution into the product of a series of conditional distributions, autoregressive generative models (abbr. ARGMs) (Vaswani et al., 2017; Dai et al., 2019; van den Oord et al., 2016a;b; Salimans et al., 2017; Chen et al., 2018) simplify the difficult challenge of modeling high-dimensional joint distributions. They can be trained efficiently via maximum likelihood and generate samples of exceptional quality, making this technique popular for modeling distributions, especially for sequential data. Nonetheless, despite their potency and flexibility, and huge success, ARGMs still have inherent weaknesses due to the intrinsic characteristics of chain-style conditional modeling, especially when the training data is less diverse 1. For example, ARGMs usually suffer from a discrepancy in distributions of input contexts between the training and inference stages, which causes a consequent performance drop, i.e., Exposure Bias (Ranzato et al., 2016; Bengio et al., 2015). Besides, due to the nature of the greedy selection of beam search approximations, the decoded results from ARGMs may also lack long-range coherence (Deng et al., 2020).
|
| 12 |
+
|
| 13 |
+
Earlier work, both heuristic and theoretical, has been proposed to address these concerns. For instance, the exposure bias problem of ARGMs can be alleviated to some extent with scheduled sampling (Bengio et al., 2015; Mihaylova & Martins, 2019), by mixing input contexts from both real data and autoregressive generation, during the training stage. However, this scheme introduces some new problems like the over-correcting (Zhang et al., 2019) issue. In addition, at the inference stage, sampling methods such as beam search is employed to generate diverse candidates with high likelihoods, improving the quality of generated sequences. Nevertheless, these approaches result in only marginal improvements in temporal coherence.
|
| 14 |
+
|
| 15 |
+
In this paper, we propose an elegant solution, i.e., E-Forcing, for the above problems of ARGMs by leveraging a deep connection between ARGMs and Energy-based models (EBMs). EBMs are a popular class of generative models that have demonstrated their effectiveness in modeling high-dimensional distributions in a variety of machine learning applications, without requiring the transformation of the target distribution into a product of conditional distributions (Zhao et al., 2017;
|
| 16 |
+
|
| 17 |
+
Arbel et al., 2021; Gao et al., 2021). As a result, several studies (Deng et al., 2020; Bakhtin et al., 2021; Durkan & Nash, 2019) have made their attempts to benefit ARGMs from the advantages of EBMs. However, though some positive results were obtained, the existing works preferred a two-stage optimization, which first obtained a well-trained ARGM and then trained an additional EBM based on it. Such an optimization strategy not only introduced a heavy training process for EBM but also did not enable ARGMs themselves to benefit from the properties of EBM in modeling the joint distribution in a temporally more coherent way, and required more training parameters to estimate energy scores, burdening the intricacy of the learning task.
|
| 18 |
+
|
| 19 |
+
Our method of combing ARGMs and EBMs takes a different approach, which seamlessly integrates energy-based models into autoregressive models by utilizing the extra degree of freedom within the final softmax layer of the model. We show that in this way the ARGM can be trained using an energy-based learning objective, which allows the ARGM to avoid those intrinsic concerns, such as exposure bias, with the help of energy-based models as former work did (Deng et al., 2020; Bakhtin et al., 2021) whilst being free of increasing the learning model’s complexity. This property makes our E-Forcing rather easy to be applied in the training process of any ARGM for any specific task, as no structural changes are required.
|
| 20 |
+
|
| 21 |
+
Besides, we follow the predominant approach for training explicit density generative models to minimize the KL divergence between the (empirical) data distribution and model distribution, which gives rise to the gradient-based contrastive divergence (CD) methods (Hinton, 2002; Kim & Bengio, 2016) for energy-based models. Typically, these methods require a Markov Chain Monte Carlo (MCMC) process to sample data from the EBM for the “negative phase” gradient estimation, which is extremely time-consuming and, meanwhile, inapplicable for discrete data, such as text. To solve this, we present a way to estimate those “negative phase” gradients through those samples generated with the network’s autoregressive view instead of the EBM view, making the training feasible. Since our method combines the EBM and ARGM seamlessly as a whole, i.e., the ARGM is also an EBM itself, the exposure bias problem can be mitigated due to the fact that autoregressively sampled data is involved in the “negative phase” of CD methods. On top of it, unlike ARGMs, which factor the joint distribution into a product of conditional distributions, EBMs are able to model the joint distribution directly and score each input at the sequence level instead of at the token level, which makes them capable of modeling long-range coherence.
|
| 22 |
+
|
| 23 |
+
In summary, the following contributions are made to this paper: i) We introduce a novel scheme by integrating the EBM view into autoregressive generative models seamlessly; ii) We proposed a novel method, named E-Forcing, for efficiently optimizing the energy-based autoregressive model via contrastive divergence based on importance sampling but not MCMC; iii) We successfully decrease the inherent flaws of autoregressive models — exposure bias and weak temporal coherence — by leveraging E-Forcing’s two-phase optimization, which makes use of both real and generated data; iv) We demonstrate clear improvements of the proposed methods on various tasks such as language modeling, machine translation, and image generation.
|
| 24 |
+
|
| 25 |
+
# 2 BACKGROUND AND RELATED WORKS
|
| 26 |
+
|
| 27 |
+
# 2.1 ENERGY-BASED MODELS
|
| 28 |
+
|
| 29 |
+
Let $p _ { d }$ denote the data distribution. Energy-based models (LeCun et al., 2006) are interested in learning an unnormalized energy function $\mathbf { E } _ { \theta } ( \mathbf { x } )$ that defines the density(mass) function $\pi _ { \boldsymbol { \theta } } ( \mathbf { x } )$ as
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\pi _ { \boldsymbol { \theta } } ( \mathbf { x } ) = \frac { \exp ( - \mathbf { E } _ { \boldsymbol { \theta } } ( \mathbf { x } ) ) } { \mathbf { Z } _ { \boldsymbol { \theta } } } ,
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
where $E _ { \theta } : \mathcal { X } \mathbb { R }$ denotes an energy function which aims to map a data sample from data space $\mathcal { X }$ to an energy scalar, and $\begin{array} { r } { \mathbf { Z } ( \theta ) = \sum _ { \mathbf { x } } \exp ( - \mathbf { E } _ { \theta } ( \mathbf { x } ) ) } \end{array}$ denotes the normalizing constant, also known as the partition function, which can be barely estimated. Any function can be used as an energy function to represent an EBM as long as it can generate a single scalar given some input $\mathbf { x }$ and the normalizing constant is finite2. Contrastive divergence algorithms are commonly used to optimize EBMs via maximum log-likelihood (Hinton, 2002; Kim & Bengio, 2016; Grathwohl et al., 2020).
|
| 36 |
+
|
| 37 |
+
Correspondingly, the gradient of the log-likelihood, which needs to be maximized, with respect to $\theta$ can be expressed as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { p _ { d } ( \mathbf { x } ) } \Big [ \log \pi _ { \boldsymbol { \theta } } ( \mathbf { x } ) \Big ] = \mathbb { E } _ { \pi _ { \boldsymbol { \theta } } ( \mathbf { x } ) } \Big [ \nabla _ { \boldsymbol { \theta } } \mathbf { E } _ { \boldsymbol { \theta } } ( \mathbf { x } ) \Big ] - \mathbb { E } _ { p _ { d } ( \mathbf { x } ) } \Big [ \nabla _ { \boldsymbol { \theta } } \mathbf { E } _ { \boldsymbol { \theta } } ( \mathbf { x } ) \Big ] .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
The first term on the right-hand side of Eq.2 is usually called the “negative phase” term while the second term is called the “positive phase” term.
|
| 44 |
+
|
| 45 |
+
In general, due to the challenge of sampling from EBMs, training EBMs by contrastive divergence methods (Hinton, 2002; Kim & Bengio, 2016; Grathwohl et al., 2021) is difficult, especially on high-dimensional data. MCMC methods (Nijkamp et al., 2019; Du & Mordatch, 2019; Grathwohl et al., 2020) are usually adopted for data sampling. However, these methods require enormous extra computing overheads and are not applicable when the input is discrete such as text sequences (Deng et al., 2020). As a result, a variety of recent works attempt to explore the strategy of training an EBM without MCMC. In particular, Bakhtin et al. (2021); Xu et al. (2021); Gao et al. (2020) optimize the EBMs by using noise contrastive estimation (NCE) (Gutmann & Hyvarinen, 2010; Ma & Collins, ¨ 2018). Durkan & Nash (2019) estimate the intractable normalization component by utilizing ARGMs and importance sampling. Bengio et al.; Che et al. (2020); Wang et al. (2021) skirt the challenge of collecting data in the high-dimensional data space by performing sampling using a carefully crafted latent space, which improves sampling efficiency.
|
| 46 |
+
|
| 47 |
+
# 2.2 MODELING DISTRIBUTIONS AUTOREGRESSIVELY
|
| 48 |
+
|
| 49 |
+
Modeling high-dimensional data distributions directly is usually a rather challenging task due to “the curse of dimensionality” (Bellman, 1954). One alternative method is to sequential the random variables and then factorize the joint probability distribution into the product of conditionals based on the sequence structure, which is the core idea of autoregressive generative models (ARGMs). ARGMs have been very successful, in particular for sequential data. For example, ARGMs have been widely used in language modeling (Vaswani et al., 2017; Dai et al., 2019; Radford et al., 2019), audio synthesis (van den Oord et al., 2016a), and even image generation (van den Oord et al., 2016c;b; Salimans et al., 2017).
|
| 50 |
+
|
| 51 |
+
However, the advantages of ARGMs are balanced to some extent by issues of (1) exposure bias (Ranzato et al., 2016; Bengio et al., 2015; Song et al., 2020), due to the discrepancy in input context distributions between the training and inference stages, and (2) weak long-range coherence (Deng et al., 2020), due to the inherent greedy selection of one token at a time without look-ahead.
|
| 52 |
+
|
| 53 |
+
# 2.3 THE MIXTURE OF EBMS AND GENERATIVE MODELS
|
| 54 |
+
|
| 55 |
+
The seminal idea of combing a generative model and an energy-based model has been explored by a plethora of great works (Pang et al., 2020; Durkan & Nash, 2019; Xie et al., 2019; 2020; Xiao et al., 2021; Bakhtin et al., 2021; Che et al., 2020; Arbel et al., 2021; Deng et al., 2020; Bakhtin et al., 2021; Durkan & Nash, 2019). In particular, Pang et al. (2020) aimed to learn an energy-based model (EBM) in the latent space of a generator model, so that the EBM can act as a prior model on the generator model’s top-down network. VAEBM, a symbiotic composition of a variational auto-encoder and an EBM, was proposed by (Xiao et al., 2021). Arbel et al. (2021) proposed a novel training method for a GAN/EBM combined model by leveraging the Donsker-Varadham representation of KL-divergence.
|
| 56 |
+
|
| 57 |
+
Among these works, Residual EBM (Deng et al., 2020; Bakhtin et al., 2021; Durkan & Nash, 2019) and EBR (Naskar et al., 2020) may be the most related works to our paper. Authors of these works have made their attempt to benefit ARGMs from the advantages of EBMs. However, different from our work, these works utilize a two-stage optimization scheme, which first obtained a well-trained generative model and then trained an additional EBM on top of it. Such an optimization strategy does not enable ARGMs themselves to benefit from the properties of EBM in modeling the joint distribution. Besides, in order to benefit from the EBM, complicated re-sampling or re-ranking schemes are needed during inference time. It also increases parameters since it uses independent networks to represent the ARGM and the EBM, burdening the intricacy of the learning task. In contrast, we introduce the EBM inside the ARGM, treating the ARGM directly as an EBM itself.
|
| 58 |
+
|
| 59 |
+
# 3 TREATING THE ARGM AS AN EBM
|
| 60 |
+
|
| 61 |
+
In this section, we present the overall framework of our E-Forcing method for training better autoregressive models. Let $\left( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { K } \right)$ be a random sequence of length $K$ drawn from the real data distribution $p _ { d } , \mathbf { x } _ { k }$ denote the random variable at time step $k$ , and $\mathbf { x } _ { < k }$ represent the random subsequence before time step $k$ , i.e. $\mathbf { x } _ { < k } = ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { k - 1 } )$ . The general spirit of our design is to model the joint distribution $p _ { d } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ by integrating an EBM inside the autoregressive model $q _ { \theta }$ .
|
| 62 |
+
|
| 63 |
+
Formally, given an autoregressive model $\begin{array} { r } { q _ { \theta } ( \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { K } ) = \prod _ { k = 1 } ^ { K } q _ { \theta } ( \mathbf { x } _ { k } | \mathbf { x } _ { < k } ) } \end{array}$ parameterized by $\theta$ we introduce $K$ independent energy-based models $p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ for each time step $k \leq K$ , with the formulation following
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) = q _ { \theta } ( \mathbf { x } _ { < k } ) \cdot \frac { e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \mathbf { Z } _ { \theta } } ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathbf { Z } _ { \theta }$ is equal to $\begin{array} { r } { \mathbb { E } _ { q _ { \theta } } [ \sum _ { { \bf x } _ { k } } e ^ { - \phi _ { \theta } ( { \bf x } _ { k } , { \bf x } _ { < k } ) } ] } \end{array}$ , indicating the normalization constant, $\phi _ { \theta } ( \cdot )$ represents the energy function. Essentially, $p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ is a product EBM, defined as the product of $q _ { \theta }$ and another EBM $\phi _ { \theta }$ .
|
| 70 |
+
|
| 71 |
+
# 3.1 DEFINITION OF THE ENERGY FUNCTION
|
| 72 |
+
|
| 73 |
+
We define the energy function $\phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ using $\mathbf { x } _ { k }$ ’s corresponding component of network’s output logits given the input context $\mathbf { x } _ { < k }$ (e.g., given a sequence “This is Friday.” and assuming the corresponding index of the token “Friday” in the vocabulary is $i$ , then the value of $- \phi _ { \theta }$ (“Friday”, “This is”) is the $i$ -th component of the output logit, namely, the input tensor of the final softmax layer).
|
| 74 |
+
|
| 75 |
+
The rationale behind such a design of energy function is out of the extra degree of freedom concealed inside the softmax transformation $\boldsymbol { \mathcal { S } } : \mathbb { R } ^ { \boldsymbol { \breve { M } ^ { \bullet } } } \to ( 0 , 1 ) ^ { M }$ , which can convert an unnormalized vector with size $M$ into a probability distribution consisting of $M$ probabilities
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
S ( [ z _ { 1 } , \ldots , z _ { M } ] ) = [ \frac { e ^ { z _ { 1 } } } { \sum _ { i = 1 } ^ { M } e ^ { z _ { i } } } , \ldots , \frac { e ^ { z _ { M } } } { \sum _ { i = 1 } ^ { M } e ^ { z _ { i } } } ] .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
It’s easy to observe that the softmax operation is unaffected by the input vector’s overall magnitude, that is, $S ( [ z _ { 1 } , \dots , z _ { M } ] ) = S ( [ z _ { 1 } , \dots , z _ { M } ] + C ) , \forall C \in \mathbb { R }$ . Such a property allows us to model the energy function by using the ARGM itself instead of introducing a new network.
|
| 82 |
+
|
| 83 |
+
# 3.2 ENERGY-BASED LEARNING OBJECTIVE
|
| 84 |
+
|
| 85 |
+
Other than making the $q _ { \theta }$ to match $p _ { d }$ , E-forcing has an additional training objective to make the $K$ parametric distributions $p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ to match the real data distribution $p _ { d } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ at any time step $k \leq K$ . This can be achieved by minimizing the Kullback-Leibler (KL) divergence between the distributions for each time step of a sequence,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r } { \mathbf { D } _ { K L } \Big ( p _ { d } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) | | p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) \Big ) , \forall k \in [ 1 , K ] , } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
We attempt to use contrastive divergence methods (Hinton et al., 1995; Kim & Bengio, 2016) to minimize the objective 5 by descending the gradient w.r.t. $\theta$ according to Eq. 2 for each time step. Specifically, given an arbitrary time step $k$ , we have the corresponding gradient of objective 5 with respect to $\theta$
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\nabla _ { \theta } \mathcal { L } _ { E B M - C D } = \mathbb { E } _ { p _ { d } } \Big [ \nabla _ { \theta } \mathbf { E } _ { \theta } \big ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } \big ) \Big ] - \underbrace { \mathbb { E } _ { p _ { \theta } } \Big [ \nabla _ { \theta } \mathbf { E } _ { \theta } \big ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } \big ) \Big ] } _ { \displaystyle } .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\begin{array} { r } { \mathbf { E } _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) = \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) - \log q _ { \theta } ( \mathbf { x } _ { < k } ) . } \end{array}$
|
| 98 |
+
|
| 99 |
+
Optimization via Eq. 6 involves sampling data from the model distribution $p _ { \theta }$ and can thus lead to the discovery of non-data-like samples, whose likelihood is then explicitly reduced as the corresponding energy increases during the training. E-Forcing is therefore not plagued by the exposure bias problem naturally. Besides, because we model the joint distribution at each time step, E-Forcing can assess the sequence up to the current time step as a whole and generate more coherent data using energy sampling (Deng et al., 2020). However, the negative phase gradient is frustrating to compute, especially for discrete data (e.g. text) where common MCMC methods (Welling & Teh, 2011) can not even be applied. Therefore, we propose a novel variant of contrastive divergence methods for E-Forcing’s optimization in Section 4.
|
| 100 |
+
|
| 101 |
+
# 4 OPTIMIZATION
|
| 102 |
+
|
| 103 |
+
The key obstacle of optimizing the objective 5 via contrastive divergence methods (Hinton, 2002)(i.e. descends the gradient of Eq. 6) is sampling data from the model distribution $p _ { \theta }$ for estimating the negative phase gradient. The common MCMC algorithms are not desirable for generating “negative” samples because they are rather time-consuming, and not applicable to discrete data. In order to make the optimization process both efficient and feasible, we modified the original CD methods by means of the importance sampling technique (Horvitz & Thompson, 1952), which holds two parts of gradient estimation.
|
| 104 |
+
|
| 105 |
+
# 4.1 POSITIVE PHASE GRADIENTS
|
| 106 |
+
|
| 107 |
+
Since the training set consists of i.i.d. samples sampled from the real distribution $p _ { d }$ , the computing of positive phase gradients is not difficult. To be specific, by replacing ${ \bf E } _ { \theta } ( { \bf x } _ { k } , { \bf x } _ { < k } )$ with the form $\phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) - \log q _ { \theta } ( \mathbf { x } _ { < k } )$ in Eq.6, the positive phase gradient ${ \mathcal G } _ { + } ^ { ( k ) } ( \theta )$ with respect to parameter $\theta$ can be written into
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathcal { G } _ { + } ^ { ( k ) } ( \theta ) = \mathbb { E } _ { p _ { d } } \Big [ \nabla _ { \theta } \phi _ { \theta } \big ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } \big ) - \nabla _ { \theta } \log q _ { \theta } \big ( \mathbf { x } _ { < k } \big ) \Big ] .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Since carrying out sample estimation of the expectation over the data distribution $p _ { d }$ is viable, and the score $\phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ can be acquired by simply accessing the output logit of ARGM (according to the definition of $\phi _ { \theta }$ in Sec. 3), the first term of the positive phase gradient $\mathcal { G } _ { + } ^ { ( k ) }$ can likewise be readily computed. Besides, we can observe that the second term $\mathbb { E } _ { p _ { d } } [ - \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) ]$ of ${ \mathcal { G } } _ { + } ^ { ( k ) } ( \theta )$ is the negative gradient of likelihood ’s logarithm, which is exactly the objective of maximizing the autoregressive generative model $q _ { \theta }$ ’s log-likelihood.
|
| 114 |
+
|
| 115 |
+
# 4.2 NEGATIVE PHASE GRADIENTS
|
| 116 |
+
|
| 117 |
+
The estimation of negative phase gradients $\mathcal { G } _ { - } ^ { ( k ) } ( \theta ) = \mathbb { E } _ { p _ { \theta } } [ \nabla _ { \theta } \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) - \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) ]$ , on the other hand, is more involved. Sampling data from $p _ { \theta }$ θ is required for estimating the expectation $\mathbb { E } _ { p _ { \theta } }$ , whereas $p _ { \theta }$ is the introduced energy-based autoregressive model, which is an explicit autoregressive generative model and we can only access its modeled density(mass) function $p _ { \theta }$ .
|
| 118 |
+
|
| 119 |
+
Inspired by the idea of importance sampling, we substitute the troublesome estimation of the expectation over distribution $p _ { \theta }$ with the expectation over distribution $q _ { \theta }$ , which is the underlying autoregressive model that can generate samples considerably easier. Accordingly, the negative phase gradient $\mathbb { E } _ { \mathbf { x } _ { k } , \mathbf { x } _ { < k } \sim p _ { \theta } } \left[ \nabla _ { \theta } \mathbf { E } _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) \right]$ has the following form (See the detailed derivation in Appendix B),
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r l r } { { \mathcal { G } _ { - } ^ { ( k ) } ( \theta ) = \mathbb { E } _ { q _ { \theta } } \Big [ { \mathbf { w } } \big ( \mathbf { x } _ { < k } \big ) \big [ \nabla _ { \theta } \phi _ { \theta } \big ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } \big ) - \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) \big ] \Big ] , } } \\ & { } & { \quad \mathrm { w h e r e ~ } { \mathbf { w } } \big ( \mathbf { x } _ { < k } \big ) = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } \big ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } \big ) } } { \mathbb { E } _ { q _ { \theta } ( \mathbf { x } _ { < k } ^ { \prime } ) } \big [ \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } \big ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ^ { \prime } \big ) } \big ] } . } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
According to Eq.8, all the estimated expectations only need sampling from the autoregressive model $q _ { \theta }$ rather than the distribution $p _ { \theta }$ , and the reweighing weight $\mathbf { w }$ in Eq. 9 does not involve expectation computation over distribution $p _ { \theta }$ either. Generally speaking, producing data from an autoregressive model is a simple ancestral sampling process and naturally suitable for discrete data, as compared with sampling straight from an explicit generative density estimator, which needs MCMC approaches (Durkan & Nash, 2019). Besides, the term $\mathbb { E } _ { { \mathbf { x } } < k \sim q _ { \theta } ( { \mathbf { x } } < k ) } [ { \mathbf { w } } ( { \mathbf { x } } < k ) \nabla _ { \theta } \log q _ { \theta } ( { \mathbf { x } } _ { < k } ) ]$ in Eq. 8 can be regarded as a re-weighted gradient of $q _ { \theta }$ ’s information entropy with respect to $\theta$ . This term can be optimized similarly to the teacher-forcing training of the autoregressive model with the “teacher” sequence generated autoregressively by the model itself. The scheduled sampling methods (Bengio et al., 2015; Ranzato et al., 2016; Mihaylova & Martins, 2019) are similar to this term but without the re-weighting factor.
|
| 126 |
+
|
| 127 |
+
Moreover, the reweighing weight w of Eq. 9 can be further refined (see the derivation in Appendix B.3) and we can observe that $\mathbf { w } ( \mathbf { \bar { x } } _ { < k } ) = \mu ( \mathbf { x } _ { < k } ) / \mathbb { E } _ { \mathbf { x } _ { < k } ^ { \prime } } \mu ( \mathbf { x } _ { < k } )$ , where $\mu ( \mathbf { x } _ { < k } ) = p _ { \theta } ( \mathbf { x } _ { < k } ) / q _ { \theta } ( \mathbf { x } _ { < k } )$ , indicating the possibility of which distribution $\scriptstyle \mathbf { \hat { \phi } } _ { p _ { \theta } }$ or $q _ { \theta . }$ ) the input context $\mathbf { x } _ { < k }$ is most likely to come from. Correspondingly, $\mathbf { w } ( \mathbf { x } _ { < k } )$ reflects the context $\mathbf { x } _ { < k }$ ’s relative magnitude of $\mu ( \mathbf { x } _ { < k } )$ compared with the average among all potential contexts—the larger the value of $\mathbf { w } ( \mathbf { x } _ { < k } )$ , the more likely the context $\mathbf { x } _ { < k }$ in the data space coming from $p _ { \theta }$ , which is modeled by the product of autoregressive models and EBMs. During training, those input sequences with contexts more likely from $p _ { \theta }$ than $q _ { \theta }$ will be assigned larger weights w while others will be assigned smaller weights $\mathbf { w }$ .
|
| 128 |
+
|
| 129 |
+
# 4.3 FINAL OPTIMIZATION OF E-FORCING
|
| 130 |
+
|
| 131 |
+
# Algorithm 1 Optimizing ARGMs with E-Forcing
|
| 132 |
+
|
| 133 |
+
<table><tr><td>generation length</td><td>Given: a training dataset ε ~ Pd ,random-initialized autoregressive model qo,K ∈ N is the</td></tr><tr><td>for iteration i= 1;i ≤max iterations;i+1 do Sample minibatch B = {(Ci, Si)}²=1 ~ ε</td><td>√ si is of length K,ci is the context of Si</td></tr><tr><td>if i≤Nthen</td><td>After N iterations,we start applying E-Forcing</td></tr><tr><td>VLtotal ←∑1 VθCAR(B)</td><td></td></tr><tr><td>else</td><td></td></tr><tr><td></td><td>Autoregressively generate |B| samples from qe conditioned on Ci, denoted as B</td></tr><tr><td>K</td><td></td></tr><tr><td>end if</td><td></td></tr><tr><td>Updateθ←θ-nVθLtotal</td><td></td></tr><tr><td></td><td>η denotes learning rate</td></tr><tr><td></td><td></td></tr><tr><td>end for</td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 134 |
+
|
| 135 |
+
Finally, with the help of the above estimation of gradients regarding two phases of Eq. 6, we are able to optimize the product EBM $p _ { \theta }$ via descending the estimated gradient of contrastive divergence loss $\nabla _ { \boldsymbol { \theta } } \mathcal { L } _ { E B M - C D }$ for any time step $k$
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\nabla _ { \boldsymbol { \theta } } \mathcal { L } _ { E B M - C D } ^ { ( k ) } ( \boldsymbol { \theta } ) = \mathcal { G } _ { + } ^ { ( k ) } ( \boldsymbol { \theta } ) - \mathcal { G } _ { - } ^ { ( k ) } ( \boldsymbol { \theta } ) .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Eq. 10 can be easily estimated by using “positive” samples from the given training dataset and autoregressively generated “negative” samples from $q _ { \theta }$ .
|
| 142 |
+
|
| 143 |
+
Nevertheless, training the model from scratch with the energy-based learning objective alone can not work well in practice. The reason is simple: at the initial stage of the training process, what we have is just a randomly initialized network that can barely generate anything meaningful. This fact indicates disjoint supports between the real distribution $p _ { d }$ and modeled distribution $p _ { \theta }$ . Importance sampling fails in this case. Hence, to make the optimization more feasible, we pre-train the entire model with an autoregressive loss $\mathcal { L } _ { A R }$ by teacher-forcing for a few epochs before introducing the energy-based learning objective. In sum, the final gradient concerning parameter $\theta$ at each update iteration is
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\nabla _ { \theta } \mathcal { L } _ { t o t a l } ( \theta ) = \sum _ { k = 1 } ^ { K } \nabla _ { \theta } \mathcal { L } _ { A R } ^ { ( k ) } ( \theta ) + \lambda _ { k } \nabla _ { \theta } \mathcal { L } _ { E B M - C D } ^ { ( k ) } ( \theta ) ,
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $\lambda _ { k }$ adjusts the ratio between the two objectives for the time step $k$ . The intact optimization procedure is shown in Algorithm $1 ^ { 3 }$ . We found that an exponentially descending configuration of coefficients $\lambda _ { k }$ according to the order of time steps works well. One possible reason is that such a set of coefficients can remedy the imbalanced training signal by negative phase gradients in Eq. 8 among time steps.
|
| 150 |
+
|
| 151 |
+
# 5 EXPERIMENTS
|
| 152 |
+
|
| 153 |
+
To empirically corroborate the effectiveness of E-Forcing and show its broad applicability, we have conducted extensive experiments on applications, such as language modeling and machine translation. In this section, we will first introduce these experimental setups and analyze the obtained results. Besides, we also carried out a series of experiments to further show our E-Forcing method’s ability to resolve ARGMs’ inherent flaws(i.e. exposure bias and incoherence generation). More experimental settings as well as analytical experiments are shown in Appendix A and C.
|
| 154 |
+
|
| 155 |
+
# 5.1 APPLICATION TO LANGUAGE MODELING
|
| 156 |
+
|
| 157 |
+
For the language modeling task, three different datasets, WikiText-103 (Merity et al., 2017), Toronto Book Corpus (Zhu et al., 2015; Kiros et al., 2015), and CC-news (Mackenzie et al., 2020), are chosen as testbeds; two autoregressive network structures are used to evaluate the effectiveness: vanilla Transformer (Vaswani et al., 2017) (“Tr-Base” for short) and Transformer-XL (Dai et al., 2019) (“Tr-XL” for short). We regard the vanilla training with the teacher forcing technique as the baseline method. Besides, we also compared our E-Forcing with the residual EBM Deng et al. (2020) method, which is a typical method to improve the performance of language models by utilizing EBMs. In order to benefit from the EBM, the residual EBM method requires a new network to estimate the energy scores and imposes a Top-K energy resampling scheme during inference4.
|
| 158 |
+
|
| 159 |
+
The final results are reported in Table 1. We can see from the results that E-Forcing outperforms two pure autoregressive models with clear margins over all three benchmarks. Specifically, on the Wikitext-103 benchmark, our E-Forcing improves the performance of the Transformer-Base model and Transformer-XL model by $0 . 6 2 \ : \mathrm { P P L }$ points (from 30.56 to 29.94) and $0 . 3 0 \mathrm { P P L }$ points (from 24.20 to 23.90) respectively; on CC-news and Toronto Book Corpus benchmarks, our method obtains $0 . 5 1 \ \mathrm { p p l }$ and $0 . 4 7 ~ \mathrm { p p l }$ performance gain respectively and gets further improvement once energy resampling technique was applied. Besides, though residual EBM’s learning parameters are twice as ours and their method is unable to directly benefit autoregressive models without Top-K energy resampling, our E-Forcing achieves comparable results to them, even slightly better on Toronto Book Corpus and Wikitext-103 benchmarks.
|
| 160 |
+
|
| 161 |
+
Table 1: Language modeling performance of different models on three benchmarks. Evaluation is conducted using perplexity (PPL). E.R. is the abbreviation of Energy Resampling technique (Bakhtin et al., 2021), which serves as a necessary module of Residual EBM.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">PPL↓</td></tr><tr><td>CC-News</td><td>Toronto Book Corpus</td><td>WikiText103</td></tr><tr><td>Baseline (Tr-Base)</td><td>18.29</td><td>17.57</td><td>30.56</td></tr><tr><td>Baseline (Tr-XL)</td><td>-</td><td>1</td><td>24.20</td></tr><tr><td>Residual EBM(Tr-Base)</td><td>15.57-15.58</td><td>16.98-17.00</td><td>29.88-29.93</td></tr><tr><td>Residual EBM(Tr-XL)</td><td>-</td><td>1</td><td>23.85-23.87</td></tr><tr><td>E-Forcing (Tr-Base)</td><td>15.78</td><td>17.10</td><td>29.94</td></tr><tr><td>E-Forcing(Tr-XL)</td><td>1</td><td>-</td><td>23.90</td></tr><tr><td>E-Forcing+E.R.(Tr-Base)</td><td>15.63-15.67</td><td>16.89-16.93</td><td>29.81-29.84</td></tr><tr><td>E-Forcing + E.R.(Tr-XL)</td><td>=</td><td>=</td><td>23.79-23.82</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 5.2 APPLICATION TO NEURAL MACHINE TRANSLATION
|
| 166 |
+
|
| 167 |
+
We further evaluate E-Forcing’s effectiveness on neural machine translation (NMT), which can be regarded as a conditional generation task. We mainly analyze E-Forcing on the IWSLT14 dataset, which includes six different language pairs ({German, Spanish, Italian} English and English {German, Spanish, Italian}) (Hereafter we abbreviate English, German, Spanish, Italian as “EN”, “DE”, “ES”, “IT”). In addition, we also reported the result of E-Forcing over the WMT16 (English German) benchmark, which is a relatively larger dataset, in Table 3.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Label Smoothing</td><td rowspan="2">Scheduled Sampling</td><td rowspan="2">Beam Searching</td><td colspan="6">BLEU个</td><td rowspan="2">Avg.</td></tr><tr><td>DE→EN</td><td>EN→DE</td><td>EN→IT</td><td>IT→EN</td><td>ES→EN</td><td>EN→ES</td></tr><tr><td rowspan="6">Base</td><td>=</td><td>·</td><td>-</td><td>32.44±0.06</td><td>26.64±0.10</td><td>27.92±0.03</td><td>30.48±0.08</td><td>38.61±0.11</td><td>35.42±0.09</td><td>31.92</td></tr><tr><td></td><td></td><td>5B</td><td>33.62±0.07</td><td>27.41±0.08</td><td>28.72±0.04</td><td>31.39±0.05</td><td>39.55±0.12</td><td>36.38±0.07</td><td>32.85</td></tr><tr><td>v</td><td>·</td><td>-</td><td>33.68±0.03</td><td>27.62±0.04</td><td>28.81±0.07</td><td>31.42±0.07</td><td>39.85±0.13</td><td>36.71±0.09</td><td>33.02</td></tr><tr><td></td><td></td><td>5B</td><td>34.61±0.08</td><td>28.46±0.06</td><td>29.72±0.10</td><td>32.29±0.03</td><td>40.64±0.07</td><td>37.48±0.05</td><td>33.87</td></tr><tr><td>√</td><td><</td><td>-</td><td>34.23±0.06</td><td>27.96±0.03</td><td>29.26±0.11</td><td>31.93±0.08</td><td>40.16±0.03</td><td>37.21±0.04</td><td>33.46</td></tr><tr><td></td><td></td><td>5B</td><td>35.10±0.04</td><td>28.73±0.04</td><td>29.97±0.07</td><td>32.64±0.12</td><td>40.91±0.06</td><td>37.93±0.10</td><td>34.21</td></tr><tr><td rowspan="6">E-Forcing</td><td>-</td><td>·</td><td>-</td><td>32.99±0.10</td><td>27.15±0.03</td><td>28.33±0.12</td><td>31.13±0.04</td><td>39.56±0.01</td><td>36.07±0.02</td><td>32.54</td></tr><tr><td></td><td></td><td>5B</td><td>34.06±0.06</td><td>27.97±0.08</td><td>29.26±0.09</td><td>31.90 ±0.13</td><td>40.30 ±0.03</td><td>36.92 ±0.09</td><td>33.40</td></tr><tr><td>√</td><td>·</td><td>-</td><td>33.97 ±0.08</td><td>28.03 ±0.04</td><td>29.13 ±0.02</td><td>31.84 ±0.11</td><td>40.32 ±0.03</td><td>36.96 ±0.07</td><td>33.38</td></tr><tr><td></td><td></td><td>5B</td><td>34.93 ±0.05</td><td>28.91 ±0.12</td><td>30.04 ±0.11</td><td>32.56 ±0.04</td><td>41.01 ±0.06</td><td>37.73 ±0.12</td><td>34.20</td></tr><tr><td>√</td><td>√</td><td>-</td><td>34.58 ±0.09</td><td>28.38 ±0.12</td><td>29.56 ±0.10</td><td>32.11 ±0.03</td><td>40.93 ±0.03</td><td>37.56 ±0.07</td><td>33.85</td></tr><tr><td></td><td></td><td>5B</td><td>35.36±0.05</td><td>29.11 ±0.04</td><td>30.25 ±0.09</td><td>32.82 ±0.11</td><td>41.58 ±0.07</td><td>38.19 ±0.03</td><td>34.55</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 2: Comparison of BLEU scores between our approach E-Forcing and the base ARGM trained just with cross-entropy loss on six translation pairs of IWSLT14 datasets. We use “-” to denote that the training trick is not used while $" \big .$ indicates we use it. “5 B” represents we use beam searching with 5 beams.
|
| 172 |
+
|
| 173 |
+
Results concerning IWSLT14 are shown in Table 2, where we use a six-layer vanilla transformer as the base autoregressive model. We test not only the pure performance of E-Forcing but also the compatibility with other techniques. In detail, we can observe that (1) without any particular engineering, E-Forcing outperforms the vanilla training with cross-entropy singly(teacherforcing) by 0.62 ( $3 1 . 9 2 3 2 . 5 4 _ { . }$ ) BLEU points on average, especially on three translation pairs— $3 8 . 6 1 3 9 . 5 6 $ on Spanish-to-English, $3 0 . 4 8 3 1 . 1 3$ on Italian-to-English, $3 5 . 4 2 3 6 . 0 7$ on English-to-Spanish. (2) E-Forcing is compatible with other techniques like scheduled sampling, which can help alleviate the exposure bias problem to some extent. They are not mutually exclusive and can work together to further improve the performance of the base ARGM. (3) However, since scheduled sampling can reduce exposure bias and beam search can somewhat alleviate the flaws caused by greedy selection at each time step, the performance gain of E-Forcing when all these tactics are combined is only 0.34 $3 4 . 2 1 3 4 . 5 5 )$ ), which is lower than the 0.62 $3 1 . 9 2 3 2 . 5 4 )$ obtained when the model is purely trained without these other techniques.
|
| 174 |
+
|
| 175 |
+
Additionally, Table 3 shows the performance of E-Forcing on the WMT16 English German task. For two different model sizes, enabling label smoothing (L.S.) improves model performance by 0.52 and 0.35, respectively. The performance of the base transformer model further increases to 28.36 BLEU points when scheduled sampling (S.S.) is used, while the larger model improves to 29.23 points. E-Forcing paired with label smoothing and scheduled sampling yields the highest scores of 28.62 and 29.44, respectively. Overall, our training strategy outperforms ARGM’s vanilla teacher-forcing training and can have uniformly favorable impacts across different models and dataset sizes.
|
| 176 |
+
|
| 177 |
+
Table 3: Translation performance of proposed EForcing on WMT16 English German, evaluated with BLEU. We uniformly use 5 beams when applying beam search. “L.S.” denotes Label Smoothing and “S.S.” denotes Scheduled Sampling.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Model</td><td>L.S.</td><td>S.S.</td><td>E-Forcing</td><td>BLEU↑</td></tr><tr><td rowspan="4">Tr-Base</td><td>1</td><td>-</td><td></td><td>27.56</td></tr><tr><td>v</td><td>1</td><td></td><td>28.04</td></tr><tr><td></td><td>v</td><td></td><td>28.36</td></tr><tr><td>:</td><td>v</td><td>√</td><td>28.62</td></tr><tr><td rowspan="4">Tr-Large</td><td>1</td><td>-</td><td></td><td>28.70</td></tr><tr><td>v</td><td>-</td><td></td><td>29.05</td></tr><tr><td><</td><td><</td><td></td><td>29.23</td></tr><tr><td>1</td><td><</td><td></td><td>29.44</td></tr></table>
|
| 180 |
+
|
| 181 |
+
# 5.3 EFFECT ON THE EXPOSURE BIAS
|
| 182 |
+
|
| 183 |
+
We follow the analytic experiments in the work (Zhang et al., 2019) to show that our E-Forcing is capable of alleviating the exposure bias problem. To be concrete, we randomly select 1K pairs from the training data for each translation pair and use the trained autoregressive model which applied E-Forcing to decode the source sentences, and then count the ground truth words whose probabilities in the predicted distributions produced by our E-Forcing are greater than those produced by the baseline and denote the number as $\mathcal { N }$ . The ratio of $\mathcal { N }$ to the total number of words tested is calculated. The detailed results are shown in Table 4. We find that the results on all different tasks are greater
|
| 184 |
+
|
| 185 |
+
than $50 \%$ , which demonstrates the ability of our E-Forcing in alleviating the exposure bias problem to some extent.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Trans. Pairs</td><td>DE→EN</td><td>EN→DE</td><td>EN→IT</td><td>IT→EN</td><td>ES→EN</td><td>EN→ES</td></tr><tr><td>N</td><td>14203</td><td>14554</td><td>14976</td><td>13952</td><td>16021</td><td>15359</td></tr><tr><td>Total</td><td>22148</td><td>23057</td><td>23654</td><td>23744</td><td>23860</td><td>22775</td></tr><tr><td>Ratio</td><td>64.12%</td><td>63.12%</td><td>63.31%</td><td>59.76%</td><td>68.33%</td><td>67.43%</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 4: The effect of E-Forcing on the exposure bias problem. Each test set of translation tasks contains 1K sentences selected randomly. $\mathcal { N }$ denotes the ground truth words whose probabilities in the predicted distributions produced by E-Forcing are greater than those produced by the baseline.
|
| 190 |
+
|
| 191 |
+
5.4 EFFECT ON THE INCOHERENCE OF GENERATION
|
| 192 |
+
Table 5: Performance comparison on the IWSLT14 test set for the different lengths of sentences on three translation tasks (German to English, Italian to English, and Spanish to English). Performance is evaluated by the BLEU score.
|
| 193 |
+
|
| 194 |
+
<table><tr><td rowspan="2">Translation Task</td><td rowspan="2">Scheduled Sampling</td><td rowspan="2">E-Forcing Training</td><td colspan="3">Target Sentence Length</td><td rowspan="2">All Test</td></tr><tr><td>[0, 25)</td><td>[25, 49)</td><td>[50,00)</td></tr><tr><td rowspan="3">De→En</td><td>-</td><td>1</td><td>37.72 ±0.04</td><td>33.24 ±0.06</td><td>30.86 ±0.07</td><td>34.61 ±0.08</td></tr><tr><td>v</td><td>1</td><td>38.20 ±0.07</td><td>33.76 ±0.03</td><td>31.08 ±0.06</td><td>35.10 ±0.04</td></tr><tr><td>V</td><td>v</td><td>38.37 ±0.06</td><td>33.92 ±0.09</td><td>31.43 ±0.04</td><td>35.36 ±0.05</td></tr><tr><td rowspan="3">It-→En</td><td>1</td><td>-</td><td>35.20 ±0.03</td><td>32.73 ±0.02</td><td>26.86 ±0.05</td><td>32.29 ±0.03</td></tr><tr><td>v</td><td></td><td>35.52 ±0.09</td><td>33.25 ±0.08</td><td>26.95 ±0.14</td><td>32.64 ±0.12</td></tr><tr><td>v</td><td><</td><td>35.56 ±0.10</td><td>33.33 ±0.13</td><td>27.21 ±0.07</td><td>32.82 ±0.11</td></tr><tr><td rowspan="3">Es→En</td><td>1</td><td>1</td><td>43.37 ±0.05</td><td>39.67 ±0.08</td><td>37.14 ±0.06</td><td>40.64 ±0.07</td></tr><tr><td>v</td><td>=</td><td>43.61 ±0.09</td><td>40.00 ±0.04</td><td>37.38 ±0.06</td><td>40.91 ±0.06</td></tr><tr><td>v</td><td><</td><td>43.84 ±0.10</td><td>40.35 ±0.05</td><td>38.07 ±0.04</td><td>41.58 ±0.07</td></tr></table>
|
| 195 |
+
|
| 196 |
+
We also attempted to quantitatively validate that our E-Forcing can benefit ARGMs by improving the coherence of generation. Table 5 shows the BLEU scores of generated translations on the IWSLT14 test set with respect to different lengths of the source sentences. Intuitively, due to the cumulative effect of greedy selection at each time step, the collection of samples with longer sentences ought to be more plagued by the incoherence of generations problem. Our approach can outperform the vanilla training in all three length intervals, especially in the lengthy sentence interval $[ 5 0 , \infty ]$ , indicating that our E-Forcing can resolve the incoherence problem to a degree.
|
| 197 |
+
|
| 198 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 199 |
+
|
| 200 |
+
In this paper, we propose a novel training method dubbed E-Forcing for ARGMs by treating them as EBMs. This is achieved by defining the energy function using the softmax operation’s extra degree of freedom within an autoregressive network. We further design a unique way to improve the training of E-Forcing using importance sampling. Experimental results demonstrate the effectiveness of E-Forcing to alleviate exposure bias and incoherence problems of ARGMs. In the future, we expect to extend E-Forcing on other sequential generation tasks (e.g. text summarization, audio generation) and incorporate the proposed methodology into other advanced autoregressive architectures.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Michael Arbel, Liang Zhou, and Arthur Gretton. Generalized energy based models. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021.
|
| 205 |
+
|
| 206 |
+
Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. Deep equilibrium models. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
|
| 207 |
+
|
| 208 |
+
Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019b.
|
| 209 |
+
|
| 210 |
+
Anton Bakhtin, Yuntian Deng, Sam Gross, Myle Ott, Marc’Aurelio Ranzato, and Arthur Szlam. Residual energy-based models for text. J. Mach. Learn. Res., 22:40:1–40:41, 2021.
|
| 211 |
+
|
| 212 |
+
Satanjeev Banerjee and Alon Lavie. METEOR: An automatic metric for MT evaluation with improved correlation with human judgments. In Proceedings of the ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization, pp. 65–72, Ann Arbor, Michigan, jun 2005.
|
| 213 |
+
|
| 214 |
+
Richard Ernest Bellman. The Theory of Dynamic Programming. Santa Monica, CA, 1954.
|
| 215 |
+
|
| 216 |
+
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 1171–1179, 2015.
|
| 217 |
+
|
| 218 |
+
Yoshua Bengio, Gregoire Mesnil, Yann N. Dauphin, and Salah Rifai. Better mixing via deep ´ representations. In Proceedings of the 30th International Conference on Machine Learning, ICML 2013, Atlanta, GA, USA, 16-21 June 2013, volume 28, pp. 552–560.
|
| 219 |
+
|
| 220 |
+
Tong Che, Ruixiang Zhang, Jascha Sohl-Dickstein, Hugo Larochelle, Liam Paull, Yuan Cao, and Yoshua Bengio. Your GAN is secretly an energy-based model and you should use discriminator driven latent sampling. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 221 |
+
|
| 222 |
+
Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , volume 80 of Proceedings of Machine Learning Research, pp. 863–871, 2018.
|
| 223 |
+
|
| 224 |
+
Junyoung Chung, C¸ aglar Gul¨ c¸ehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. CoRR, abs/1412.3555, 2014.
|
| 225 |
+
|
| 226 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime G. Carbonell, Quoc Viet Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pp. 2978–2988, 2019.
|
| 227 |
+
|
| 228 |
+
Yuntian Deng, Anton Bakhtin, Myle Ott, Arthur Szlam, and Marc’Aurelio Ranzato. Residual energybased models for text generation. In 8th International Conference on Learning Representations, ICLR 2020, 2020.
|
| 229 |
+
|
| 230 |
+
Yilun Du and Igor Mordatch. Implicit generation and modeling with energy based models. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 3603–3613, 2019.
|
| 231 |
+
|
| 232 |
+
Conor Durkan and Charlie Nash. Autoregressive energy machines. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, volume 97, pp. 1735–1744, 2019.
|
| 233 |
+
|
| 234 |
+
Ruiqi Gao, Erik Nijkamp, Diederik P. Kingma, Zhen Xu, Andrew M. Dai, and Ying Nian Wu. Flow contrastive estimation of energy-based models. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 7515–7525, 2020.
|
| 235 |
+
|
| 236 |
+
Ruiqi Gao, Yang Song, Ben Poole, Ying Nian Wu, and Diederik P. Kingma. Learning energybased models by diffusion recovery likelihood. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021.
|
| 237 |
+
|
| 238 |
+
Will Grathwohl, Kuan-Chieh Wang, Jorn-Henrik Jacobsen, David Duvenaud, Mohammad Norouzi, ¨ and Kevin Swersky. Your classifier is secretly an energy based model and you should treat it like one. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, 2020.
|
| 239 |
+
|
| 240 |
+
Will Sussman Grathwohl, Jacob Jin Kelly, Milad Hashemi, Mohammad Norouzi, Kevin Swersky, and David Duvenaud. No MCMC for me: Amortized sampling for fast and stable training of energy-based models. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021.
|
| 241 |
+
|
| 242 |
+
Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2010, Chia Laguna Resort, Sardinia, Italy, May 13-15, 2010, volume 9 of JMLR Proceedings, pp. 297–304, 2010.
|
| 243 |
+
|
| 244 |
+
G. Hinton, P. Dayan, B. Frey, and R. Neal. The “wake-sleep” algorithm for unsupervised neural networks. Science, 268 5214:1158–61, 1995.
|
| 245 |
+
|
| 246 |
+
Geoffrey E. Hinton. Training products of experts by minimizing contrastive divergence. Neural Comput., 14(8):1771–1800, 2002.
|
| 247 |
+
|
| 248 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 249 |
+
|
| 250 |
+
Daniel G Horvitz and Donovan J Thompson. A generalization of sampling without replacement from a finite universe. Journal of the American statistical Association, 47(260):663–685, 1952.
|
| 251 |
+
|
| 252 |
+
Taesup Kim and Yoshua Bengio. Deep directed generative models with energy-based probability estimation. CoRR, abs/1606.03439, 2016.
|
| 253 |
+
|
| 254 |
+
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 3294–3302, 2015.
|
| 255 |
+
|
| 256 |
+
Yann LeCun, Sumit Chopra, Raia Hadsell, M Ranzato, and F Huang. A tutorial on energy-based learning. Predicting structured data, 1(0), 2006.
|
| 257 |
+
|
| 258 |
+
Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pp. 74–81, Barcelona, Spain, jul 2004.
|
| 259 |
+
|
| 260 |
+
Zhuang Ma and Michael Collins. Noise contrastive estimation and negative sampling for conditional models: Consistency and statistical efficiency. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pp. 3698–3707, 2018.
|
| 261 |
+
|
| 262 |
+
Joel M. Mackenzie, Rodger Benham, Matthias Petri, Johanne R. Trippas, J. Shane Culpepper, and Alistair Moffat. Cc-news-en: A large english news corpus. In CIKM ’20: The 29th ACM International Conference on Information and Knowledge Management, Virtual Event, Ireland, October 19-23, 2020, pp. 3077–3084, 2020.
|
| 263 |
+
|
| 264 |
+
Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus of English: The Penn treebank. Computational Linguistics, 19(2):313–330, June 1993.
|
| 265 |
+
|
| 266 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
|
| 267 |
+
|
| 268 |
+
Tsvetomila Mihaylova and Andre F. T. Martins. Scheduled sampling for transformers. In Fer- ´ nando Emilio Alva-Manchego, Eunsol Choi, and Daniel Khashabi (eds.), Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28 - August 2, 2019, Volume 2, pp. 351–356, 2019.
|
| 269 |
+
|
| 270 |
+
Subhajit Naskar, Amirmohammad Rooshenas, Simeng Sun, Mohit Iyyer, and Andrew McCallum. Energy-based reranking: Improving neural machine translation using energy-based models. CoRR, abs/2009.13267, 2020.
|
| 271 |
+
|
| 272 |
+
Erik Nijkamp, Mitch Hill, Song-Chun Zhu, and Ying Nian Wu. Learning non-convergent nonpersistent short-run MCMC toward energy-based model. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 5233–5243, 2019.
|
| 273 |
+
|
| 274 |
+
Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders. arXiv preprint arXiv:1606.05328, 2016.
|
| 275 |
+
|
| 276 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
|
| 277 |
+
|
| 278 |
+
Bo Pang, Tian Han, Erik Nijkamp, Song-Chun Zhu, and Ying Nian Wu. Learning latent space energy-based prior model. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 279 |
+
|
| 280 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameters sharing. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4095–4104, 10–15 Jul 2018.
|
| 281 |
+
|
| 282 |
+
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.
|
| 283 |
+
|
| 284 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016.
|
| 285 |
+
|
| 286 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
|
| 287 |
+
|
| 288 |
+
Kaitao Song, Xu Tan, and Jianfeng Lu. Neural machine translation with error correction. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pp. 3891–3897, 2020.
|
| 289 |
+
|
| 290 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, ¨ Nal Kalchbrenner, Andrew W. Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. In The 9th ISCA Speech Synthesis Workshop, Sunnyvale, CA, USA, 13-15 September 2016, pp. 125, 2016a.
|
| 291 |
+
|
| 292 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Koray Kavukcuoglu, Oriol Vinyals, and Alex ¨ Graves. Conditional image generation with pixelcnn decoders. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 4790–4798, 2016b.
|
| 293 |
+
|
| 294 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. ¨ In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 1747–1756, 2016c.
|
| 295 |
+
|
| 296 |
+
Aaron Van Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In International Conference on Machine Learning, pp. 1747–1756. PMLR, 2016.
|
| 297 |
+
|
| 298 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017.
|
| 299 |
+
|
| 300 |
+
Yezhen Wang, Bo Li, Tong Che, Kaiyang Zhou, Ziwei Liu, and Dongsheng Li. Energy-based open-world uncertainty modeling for confidence calibration. CoRR, abs/2107.12628, 2021.
|
| 301 |
+
|
| 302 |
+
Max Welling and Yee Whye Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning, ICML 2011, Bellevue, Washington, USA, June 28 - July 2, 2011, pp. 681–688, 2011.
|
| 303 |
+
|
| 304 |
+
Zhisheng Xiao, Karsten Kreis, Jan Kautz, and Arash Vahdat. VAEBM: A symbiosis between variational autoencoders and energy-based models. In 9th International Conference on Learning Representations, ICLR 2021, 2021.
|
| 305 |
+
|
| 306 |
+
J. Xie, Z. Zheng, X. Fang, S. Zhu, and Y. Wu. Cooperative training of fast thinking initializer and slow thinking solver for conditional learning. IEEE Transactions on Pattern Analysis & Machine Intelligence, (01):1–1, mar 2019. ISSN 1939-3539.
|
| 307 |
+
|
| 308 |
+
Jianwen Xie, Yang Lu, Ruiqi Gao, Song-Chun Zhu, and Ying Nian Wu. Cooperative training of descriptor and generator networks. IEEE Trans. Pattern Anal. Mach. Intell., 42(1):27–45, 2020.
|
| 309 |
+
|
| 310 |
+
Minkai Xu, Shitong Luo, Yoshua Bengio, Jian Peng, and Jian Tang. Learning neural generative dynamics for molecular conformation generation. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021.
|
| 311 |
+
|
| 312 |
+
Wen Zhang, Yang Feng, Fandong Meng, Di You, and Qun Liu. Bridging the gap between training and inference for neural machine translation. In Anna Korhonen, David R. Traum, and Llu´ıs Marquez \` (eds.), Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1, pp. 4334–4343, 2019.
|
| 313 |
+
|
| 314 |
+
Junbo Jake Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial networks. ¨ In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
|
| 315 |
+
|
| 316 |
+
Yukun Zhu, Ryan Kiros, Richard S. Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pp. 19–27, 2015.
|
| 317 |
+
|
| 318 |
+
# A EXPERIMENTAL SETTINGS
|
| 319 |
+
|
| 320 |
+
In this section, we introduce detailed setups of different benchmarks as well as the information of corresponding datasets.
|
| 321 |
+
|
| 322 |
+
# A.1 DATASETS
|
| 323 |
+
|
| 324 |
+
We conducted our experiments based on 7 datasets over different learning tasks:
|
| 325 |
+
|
| 326 |
+
1. WikiText-103 comprises 103 million training tokens from 28 thousand articles, with an average length of 3.6 thousand tokens per article.
|
| 327 |
+
2. Toronto Book Corpus consists of fiction books in 16 different genres, totaling about half a billion words.
|
| 328 |
+
3. CC-news is a de-duplicated subset of the English portion of the CommonCrawl news dataset, which totals around 16 Billion words.
|
| 329 |
+
4. IWSLT14 contains about $1 7 0 \mathrm { k }$ training sentence pairs, 7k valid pairs, and $\mathrm { 7 k }$ test pairs. It has six different domains of language, and each two of them can consist of a translation pair.
|
| 330 |
+
5. WMT16 contains 103M training tokens from 28K articles, with an average length of 3.6K tokens per article, which allows testing the ability of long-term dependency modeling.
|
| 331 |
+
6. MNIST is a large collection of handwritten digits. It has a training set of 60,000 examples and a test set of 10,000 examples.
|
| 332 |
+
7. CIFAR-10 is a subset of the Tiny Images dataset and consists of $6 0 0 0 0 \ 3 2 { \mathrm { x } } 3 2$ color images. The images are labeled with one of 10 mutually exclusive classes.
|
| 333 |
+
|
| 334 |
+
# A.2 IMPLEMENTING SETUPS
|
| 335 |
+
|
| 336 |
+
Table 6: Hyperparameters of different model structures and datasets. “Tr-Base”, “Tr-Large”, and “Tr-XL” indicate Transformer-Base, Transformer-Large, and Transformer-XL respectively
|
| 337 |
+
|
| 338 |
+
<table><tr><td rowspan="2">Hyper-Parameters</td><td>Translation-IWSLT14</td><td colspan="2">Translation-WMT16</td><td colspan="2">Language Modeling</td></tr><tr><td>Tr-Base</td><td>Tr-Base</td><td>Tr-Large</td><td>Tr-Base</td><td>Tr-XL</td></tr><tr><td>Number of Layers</td><td>12</td><td>12</td><td>12</td><td>6</td><td>16</td></tr><tr><td>Hidden Embed Size</td><td>512</td><td>512</td><td>1024</td><td>512</td><td>410</td></tr><tr><td>FC-Layer Embed Size</td><td>1024</td><td>2048</td><td>4096</td><td>2048</td><td>2100</td></tr><tr><td>Attention Heads</td><td>4</td><td>8</td><td>16</td><td>8</td><td>10</td></tr><tr><td>Dropout</td><td>0.3</td><td>0.3</td><td>0.3</td><td>0.1</td><td>0.1</td></tr><tr><td>Learning Rate</td><td>5e-4</td><td>1e-3</td><td>1e-3</td><td>5e-4</td><td>2.5e-4</td></tr><tr><td>lr scheduler</td><td>inverse_sqrt</td><td>inverse_sqrt</td><td>inverse_sqrt</td><td>inverse_sqrt</td><td>cosine</td></tr><tr><td>Warm up Updates</td><td>4000</td><td>4000</td><td>4000</td><td>4000</td><td>10000</td></tr><tr><td>Weigth Decay</td><td>1e-4</td><td>0.0</td><td>0.0</td><td>1e-2</td><td>0.0</td></tr><tr><td>E-Forcing Start Epoch</td><td>15</td><td>15</td><td>10</td><td>15</td><td>10</td></tr></table>
|
| 339 |
+
|
| 340 |
+
We uniformly use the Adam optimizer. The training will be stopped once the model has not obtained better performance for 20 epochs on the validation set. For translation tasks, the length of generated fake sentences, which is used for the computing of the negative phase in Eq. 10, is dependent on the source sequence whilst for language modeling tasks, we fix the length of generated fake sentences as 50 during training. The model structures for language modeling and machine translation tasks are shown in Table 6. As for the model structures of the image generation task, we use the official structure reported by PixelCNN (van den Oord et al., 2016c) and Gated PixelCNN (van den Oord et al., 2016b) without modification. The source code will be released once upon acceptance. We use the same batch of samples generated autoregressively to approximate both the expectations in Eq.10 and weight w (i.e., shared), which does not need to sample twice. The number of samples in a batch is dynamic while the maximum number of the total tokens in a batch is fixed (4096 in our experiments). If the length of sequences in a batch is 32, then it includes $4 0 9 6 / 3 2 = 1 2 8$ samples in total. It is a common strategy in language generation tasks and has been used in many frameworks(e.g.
|
| 341 |
+
|
| 342 |
+
Fairseq (Ott et al., 2019)). We generate samples autoregressively as many as the number of sequences in the current batch at each update iteration.
|
| 343 |
+
|
| 344 |
+
# B DERIVATION OF THE NEGATIVE PHASE GRADIENT
|
| 345 |
+
|
| 346 |
+
In this section, we show the detailed derivation of Eq. 8. Formally, as shown in Sec. 3, given an autoregressive model $\begin{array} { r } { q _ { \theta } \big ( \mathbf { x } _ { < k } \big ) = \prod _ { l = 1 } ^ { k - 1 } q _ { \theta } \big ( \mathbf { x } _ { l } | \mathbf { x } _ { < l } \big ) } \end{array}$ ( $k$ denotes the time step) with parameters $\theta$ , we define a product of the autoregressive model and an EBM as follows
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) = q _ { \theta } ( \mathbf { x } _ { < k } ) \cdot \frac { e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \mathbf { Z } _ { \theta } } ,
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
where $\begin{array} { r l r } { q _ { \theta } ( \mathbf { x } _ { < k } ) } & { { } = } & { \prod _ { l = 1 } ^ { k - 1 } q _ { \theta } ( \mathbf { x } _ { l } \vert \mathbf { x } _ { < l } ) } \end{array}$ , $\mathbf { Z } _ { \theta }$ is the normalization term and equal to $\begin{array} { r } { \mathbb { E } _ { \mathbf { x } _ { < k } ^ { \prime } \sim q _ { \theta } } [ \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ^ { \prime } ) } ] } \end{array}$ . The optimization of $p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } )$ includes two phases, and the gradient w.r.t $\theta$ of “negative phase” is
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
- \mathbb { E } _ { \mathbf { x } _ { < k } \sim p _ { \theta } } [ \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) ] + \mathbb { E } _ { \mathbf { x } _ { k } , \mathbf { x } _ { < k } \sim p _ { \theta } } [ \nabla _ { \theta } \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) ] .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Next, we will show the specific derivation about how to transform Eq. 13 into Eq. 8.
|
| 359 |
+
|
| 360 |
+
# B.1 DERIVATION OF THE FIRST TERM
|
| 361 |
+
|
| 362 |
+
The first term $\mathbb { E } _ { \mathbf { x } _ { < k } \sim p _ { \theta } } [ \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) ]$ can be processed as follows
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\begin{array} { r l } { \mathbb { E } _ { \mathbf { x } _ { < k } \sim p _ { \theta } } \big [ \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) \big ] = \displaystyle \sum _ { \mathbf { x } _ { < k } } p _ { \theta } ( \mathbf { x } _ { < k } ) \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) } & { } \\ & { = \displaystyle \sum _ { \mathbf { x } _ { < k } } \displaystyle \sum _ { \mathbf { x } _ { k } } p _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) } \\ & { = \displaystyle \sum _ { \mathbf { x } _ { < k } } q _ { \theta } ( \mathbf { x } _ { < k } ) \frac { \displaystyle \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \displaystyle \mathbf { Z } _ { \theta } } \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) } \\ & { = \mathbb { E } _ { \mathbf { x } _ { < k } \sim q _ { \theta } ( \mathbf { x } _ { < k } ) } \big [ \mathbf { w } ( \mathbf { x } _ { < k } ) \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) \big ] , } \end{array}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
where we have $\begin{array} { r } { \mathbf { w } \big ( \mathbf { x } _ { < k } \big ) = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \mathbb { E } _ { \mathbf { x } _ { < k } ^ { \prime } \sim q _ { \theta } ( \mathbf { x } _ { < k } ) } [ \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ^ { \prime } ) } ] } } \end{array}$ because
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\begin{array} { r l } { \mathbf { w } ( \mathbf { x } _ { < k } ) = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \mathbf { Z } _ { \theta } } = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \sum _ { \mathbf { x } _ { < k } } \sum _ { \mathbf { x } _ { k } } q _ { \theta } ( \mathbf { x } _ { < k } ) e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } } \\ & { = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \sum _ { \mathbf { x } _ { < k } } q _ { \theta } ( \mathbf { x } _ { < k } ) \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } } \\ & { = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \mathbb { E } _ { \mathbf { x } _ { < k } \sim q _ { \theta } ( \mathbf { x } _ { < k } ) } [ \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } ] } . } \end{array}
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
# B.2 DERIVATION OF THE SECOND TERM
|
| 375 |
+
|
| 376 |
+
Then, we tackle the second term $\mathbb { E } _ { \mathbf { x } _ { k } , \mathbf { x } _ { < k } \sim p _ { \theta } } \left[ \nabla _ { \theta } \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) \right]$ as follows
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r l } { \left| \nabla _ { x } \sqrt { \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \right| } \\ { = } & { \sum _ { q \in \mathcal { X } _ { \neq } } \sqrt { \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } } \\ & { = \sum _ { q \in \mathcal { X } _ { \neq } } \sqrt { \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } } \\ & { = \sum _ { q \in \mathcal { X } _ { \neq } } \sqrt { \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } } \\ & { = \sum _ { q \in \mathcal { X } _ { \neq } } \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \sum _ { q \in \mathcal { X } _ { \neq } } \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \sum _ { q \in \mathcal { X } _ { \neq } } \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \sum _ { q \in \mathcal { X } _ { \neq } } \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log } \\ & { = \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \operatorname* { m a x } \log } \\ & { = \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \log \operatorname* { m a x } \log \log \operatorname* { m a x } \log \log } \\ & = \log \log \log \log \log \log \log \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
where $\mathbf { w } ( \mathbf { x } _ { < k } )$ is also equal to Pxk e−ϕ(xk,x<k) . Combining Eq. 14 and Eq. 16, we can obtain an Zθ equivalent form of the gradient of the negative phase without any expectation over $p _ { \theta }$ as
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\begin{array} { r l } { - \mathbb { E } _ { \mathbf { x } _ { < k } \sim q _ { \theta } ( \mathbf { x } _ { < k } ) } \big [ \mathbf { w } ( \mathbf { x } _ { < k } ) \nabla _ { \theta } \log q _ { \theta } ( \mathbf { x } _ { < k } ) \big ] + \mathbb { E } _ { \mathbf { x } _ { k } , \mathbf { x } _ { < k } \sim q _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } \big [ \mathbf { w } ( \mathbf { x } _ { < k } ) \nabla _ { \theta } \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) \big ] , } & { } \\ { \mathbf { w h e r e } \quad \mathbf { w } ( \mathbf { x } _ { < k } ) = \frac { \sum _ { \mathbf { x } _ { k } } e ^ { - \phi ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ) } } { \mathbb { E } _ { \mathbf { x } _ { < k } ^ { \prime } \sim q _ { \theta } ( \mathbf { x } _ { < k } ) } \big [ \sum _ { \mathbf { x } _ { k } } e ^ { - \phi _ { \theta } ( \mathbf { x } _ { k } , \mathbf { x } _ { < k } ^ { \prime } ) } \big ] } . } & { } \end{array}
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
# B.3 FURTHER REFINEMENT OF w
|
| 389 |
+
|
| 390 |
+
The reweighing weight w can be further deduced as
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { r l } & { \mathbf w ( \mathbf x _ { < k } ) = \frac { \sum _ { \mathbf x _ { k } } e ^ { - \phi ( \mathbf x _ { k } , \mathbf x _ { < k } ) } } { \mathbb E _ { \mathbf x _ { < k } ^ { \prime } \sim q \theta ( \mathbf x _ { < k } ) } [ \sum _ { \mathbf x _ { k } } e ^ { - \phi _ { \theta } ( \mathbf x _ { k } , \mathbf x _ { < k } ^ { \prime } ) } ] } = \frac { \sum _ { \mathbf x _ { k } } \frac { p _ { \theta } ( \mathbf x _ { k } , \mathbf x _ { < k } ) } { q _ { \theta } ( \mathbf x _ { < k } ) } } { \mathbb E _ { \mathbf x _ { < k } ^ { \prime } \sim q \theta ( \mathbf x _ { < k } ) } [ \sum _ { \mathbf x _ { k } } \frac { p _ { \theta } ( \mathbf x _ { k } , \mathbf x _ { < k } ) } { q _ { \theta } ( \mathbf x _ { < k } ) } ] } } \\ & { \quad \quad \quad = \frac { \frac { p _ { \theta } ( \mathbf x _ { < k } ) } { q _ { \theta } ( \mathbf x _ { < k } ) } } { \mathbb E _ { \mathbf x _ { < k } ^ { \prime } \sim q _ { \theta } ( \mathbf x _ { < k } ) } [ \frac { p _ { \theta } ( \mathbf x _ { < k } ) } { q _ { \theta } ( \mathbf x _ { < k } ) } ] } = \frac { \mu ( \mathbf x _ { < k } ) } { \mathbb E _ { \mathbf x _ { < k } ^ { \prime } } \mu ( \mathbf x _ { < k } ) } , } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
where $\mu ( \mathbf { x } _ { < k } )$ is defined as $\frac { p _ { \theta } \left( \mathbf { x } _ { < k } \right) } { \tilde { q } _ { \theta } \left( \mathbf { x } _ { < k } \right) }$ .
|
| 397 |
+
|
| 398 |
+
# C MORE EXPERIMENTAL ANALYSIS
|
| 399 |
+
|
| 400 |
+
# C.1 ANALYSIS TO TOP-K ENERGY RE-SAMPLING
|
| 401 |
+
|
| 402 |
+
Top-K energy re-sampling in the inference stage is introduced by Bakhtin et al. (2021), which collects many candidate sequences generated autoregressively in the inference stage and then re-samples from them depending on their energy scores estimated by the network. To measure the effectiveness of the Top-K energy re-sampling towards our method, we conduct an ablation study on neural machine translation task by selecting different $\mathsf { K } = \{ 0 , 5 , 1 0 \}$ . The results are shown in Table 7 and performances are evaluated by using the BLEU score. From Table 7, we observe that the benefits brought by Top-K sampling is minor $( \mathsf { K } { = } \{ 5 , 1 0 \} )$ ), when compared with the model without Top-K sampling $\scriptstyle ( \mathrm { K = 0 } )$ . This together with the results shown in Table 1 shows that our E-Forcing can considerably benefit the base autoregressive model even without the energy resampling technique.
|
| 403 |
+
|
| 404 |
+
<table><tr><td colspan="2">Trans. Pairs</td><td>DE→EN</td><td>EN→DE</td><td>EN→IT</td><td>IT→EN</td><td>ES→EN</td><td>EN→ES</td></tr><tr><td rowspan="3">k</td><td>0</td><td>34.93</td><td>28.91</td><td>30.04</td><td>32.56</td><td>41.01</td><td>37.73</td></tr><tr><td>5</td><td>34.97</td><td>28.92</td><td>30.08</td><td>32.60</td><td>41.07</td><td>37.71</td></tr><tr><td>10</td><td>34.95</td><td>28.95</td><td>30.07</td><td>32.59</td><td>41.03</td><td>37.75</td></tr></table>
|
| 405 |
+
|
| 406 |
+
Table 7: The effect of Top-K correction in the inference stage. We tested BLEU scores of using different $k$ on different translation pairs of IWSLT14 dataset.
|
| 407 |
+
|
| 408 |
+
# C.2 APPLICATION TO IMAGE GENERATION
|
| 409 |
+
|
| 410 |
+
In order to illustrate the effectiveness and generality of our method in processing different modality tasks, we further show the results of applying E-Forcing to image generation in this section. We apply E-Forcing to Pixel-CNN (Van Oord et al., 2016) and its variant Gated Pixel-CNN (Oord et al., 2016). Experiments are carried out on the MNIST and CIFAR-10 datasets.
|
| 411 |
+
|
| 412 |
+
Table 8 summarizes the quantitative results measured by per-pixel negative log-likelihood (NLL). We can see that with the help of our E-Forcing, both the Pixel-CNN and the Gated Pixel-CNN can obtain improvements in all datasets $( 0 . 1 7 0 . 1 5 $ and 3.14 $ 3 . 0 7$ for Pixel-CNN on MNIST and CIFAR10 respectively and 0.14 $ 0 . 1 2$ and $3 . 0 3 2 . 9 7$ for Gated Pixel-CNN on MNIST and CIFAR10 respectively). This is further evidence in favor of the energy-based learning
|
| 413 |
+
|
| 414 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Test (Train) NLL↓</td></tr><tr><td>MNIST</td><td>CIFAR-10</td></tr><tr><td>Pixel-CNN</td><td>0.17 (0.13)</td><td>3.14 (3.08)</td></tr><tr><td>Pixel-CNN (w/E-Forcing)</td><td>0.15 (0.12)</td><td>3.07 (2.98)</td></tr><tr><td>Gated Pixel-CNN</td><td>0.14 (0.11)</td><td>3.03 (2.90)</td></tr><tr><td>Gated Pixel-CNN (w/E-Forcing)</td><td>0.12 (0.10)</td><td>2.97 (2.87)</td></tr></table>
|
| 415 |
+
|
| 416 |
+
Table 8: Performance of E-Forcing with different base networks on MNIST and CIFAR-10 in bits/dim (lower is better), training performance in brackets.
|
| 417 |
+
|
| 418 |
+
objective for improving autoregressive models.
|
| 419 |
+
|
| 420 |
+
# C.3 THE EFFECT OF DIFFERENT START EPOCHS OF E-FORCING
|
| 421 |
+
|
| 422 |
+
In addition, we have studied the effect of different start epochs of E-Forcing on the performance of language modeling, which can be seen in Table 9. From this, we may deduce that starting E-Forcing training at the 15th and 10th epoch yields the best results for Transformer-Base and TransformerXL respectively, whereas starting earlier or later yields a performance decline. It is reasonable because, if E
|
| 423 |
+
|
| 424 |
+
Table 9: Exploring the effect of different start epochs of E-Forcing on Wikitext103 benchmark. Performances are evaluated by perplexity (PPL).
|
| 425 |
+
|
| 426 |
+
<table><tr><td rowspan="2">Model Structure</td><td colspan="5">Start Epoch of E-Forcing</td></tr><tr><td>5</td><td>10</td><td>15</td><td>20</td><td>25</td></tr><tr><td>Tr-Base</td><td>30.38</td><td>30.12</td><td>29.94</td><td>30.05</td><td>30.29</td></tr><tr><td>Tr-XL</td><td>24.12</td><td>23.90</td><td>23.96</td><td>24.05</td><td>24.16</td></tr></table>
|
| 427 |
+
|
| 428 |
+
Forcing was introduced too early, the autoregressive model may not have been optimized well at that moment. As a result, the quality of generation for the “negative phase” would be terrible, making energy-based training unstable. On the other hand, the underlying autoregressive model can be modified only marginally if E-Forcing was introduced when the ARGM training is virtually complete.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 1: (a) Cross entropy loss curves on IWSLT14 Spanish to English translation task on training set. The blue and orange colors represent base model and E-Forcing respectively; (b) Cross entropy loss curves on IWSLT14 Spanish English translation task on test set.
|
| 432 |
+
|
| 433 |
+
# C.4 ANALYSIS TO MODEL’S CONVERGENCE
|
| 434 |
+
|
| 435 |
+
In this section, we will investigate the convergence of our E-Forcing. To begin, we first train a base Transformer model (“Tr-Base” architecture shown in Table 6) on the IWSLT14 Spanish to English training set for baseline and E-Forcing method respectively, and then record the training loss and test loss (in cross-entropy) at the end of each epoch. The loss curves are plotted in Figure 1. From Figure 1, we can see that (1) at the start of the training, our E-Forcing converges slightly faster than the baseline. (2) As the training process progresses, the cross entropy of the baseline on the training set will gradually decrease, at a faster rate than E-Forcing. On the other hand, the test loss curve of the baseline will fall initially and then slowly rise after 50 epochs while E-Forcing always remains stable convergence. This phenomenon also shows that our E-Forcing method can effectively prevent over-fitting so that obtaining better generalization.
|
| 436 |
+
|
| 437 |
+
C.5 ABLATION STUDY WITH DIFFERENT ARCHITECTURE CHOICES
|
| 438 |
+
Table 10: The ablation study of E-forcing over different choices of the architecture of AR models with the comparison of vanilla teacher-forcing training. We tested PPL scores using different AR models on the Penn Treebank dataset
|
| 439 |
+
|
| 440 |
+
<table><tr><td>Training Methods</td><td>GRU</td><td>LSTM</td><td>ENAS</td><td>DEQ</td><td>Tr-XL</td><td>TNet</td></tr><tr><td>Teacher-Forcing</td><td>92.48</td><td>78.93</td><td>58.60</td><td>57.10</td><td>54.55</td><td>54.19</td></tr><tr><td>E-Forcing</td><td>90.12</td><td>76.97</td><td>56.89</td><td>55.55</td><td>53.49</td><td>53.24</td></tr></table>
|
| 441 |
+
|
| 442 |
+
In this section, we conducted an ablation study to investigate our E-Forcing model’s generalization ability over different sequential models. We tested over 6 different sequential models, which are GRU (Chung et al., 2014), LSTM (Hochreiter & Schmidhuber, 1997), ENAS (Pham et al., 2018), TrelisNet(TNET for short) (Bai et al., 2019b), DEQ (Bai et al., 2019a) and Transformer-XL (Dai et al., 2019) on Penn Treebank (Marcus et al., 1993) dataset, which is a relatively small dataset and widely used in machine learning for NLP (Natural Language Processing) research. In general, we can observe that our E-Forcing can achieve improvement over all base AR models applied, which indicates it is a universally applicable training method for AR models.
|
| 443 |
+
|
| 444 |
+
# C.6 CASES STUDIES
|
| 445 |
+
|
| 446 |
+
To better understand the advantages of our method in correcting error tokens, we also prepare some translation cases in IWSLT14 German English, as shown in Table 11.
|
| 447 |
+
|
| 448 |
+
Table 11: Translation cases on IWSLT14 $_ \mathrm { D e \to E n }$ test set, generated by the baseline method, baseline with scheduled sampling and our E-Forcing. The italic font means the mismatch translation
|
| 449 |
+
|
| 450 |
+
<table><tr><td>Source Sentence(German)</td><td>Predicted Target Sentence(English)</td></tr><tr><td>ihnen 400 zeitschriften zeige,und diese in 2O kategorien aufteile,dann glauben sie,dass ich ihnen mehr auswahl und eine bessere auswahlerfahrung gegeben habe,als ich ihnen die 4OO gegeben hätte gegenuber dem, wenn ich ihnen die 600 gegeben hätte.</td><td>GroundTruth:if i show you 6Oo magazines and i divide them up into 10 categories,versus i show you 4Oo magazines and divide them up into 20 categories,you believe thati have given you more choice and a better choosing experience if i gave you the 4Oo than if i gave you the 600. Baseline: if i show you 6OO magazines and i split them in 1O categories,or i’m showing them 4OO magazines,and i'm going to split them up into 2O categories, you think i've given them more choices and better choice than i would have</td></tr><tr><td></td><td>given them the 4OO over the time that i gave them the 600. Baseline + S.S.: if i show you 6OO magazines andi give you 4OO magazines in 10 categories,and i give you 4Oo magazines,and ican split them up in 20 categories,then you think i've given you more choice and a better selection than i would have given you the 4OO of which if i gave you the 600. Ours: if i show you 6Oo magazines and i divide them into 10 categories,or i show you 4O0 magazines,and i divide them into 20 categories,you think i've given you more choices and beter selection experience than i gave you the 400 of whom if i gave you the 600.</td></tr><tr><td>und ich weiB definitiv, dass es flir mich-in meiner situation-sehr gefahrlich wäre,anzufangen, diesen dunklen pfad der vermutung sozusagen herunterzu- sickern-besonders in dem umstand, in dem ich mich in meiner karriere gerade befinde.</td><td>GroundTruth:andi definitely know that, in my case-in my situation-it would be very dangerous for me to start sort of leaking down that dark path of assumption, particularly given the circumstance that i'm in right now in my career. Baseline: and i know definitely,for me,it would be very dangerous to begin to do this dark path of suspect-especially in the circumstance that i'm in my</td></tr><tr><td></td><td>career right now. Baseline + S.S.: and i know definitely it would be-in my situation- very dangerous to start, to kind of settle down this dark path of presumption -</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>especially in the circumstance in which i'm in my career right now.</td></tr><tr><td></td><td>Ours:and i definitely know that it's for me-in my situation-very danger-</td></tr><tr><td></td><td>ous to start to sickle down this dark path of suspection,in particular, in the</td></tr><tr><td>wirhaben das licht ausgeschaltet, legten es in ein vakuumund saugten die</td><td>circumstance of where i'm in my career right now.</td></tr><tr><td>ganze luft aus und kihlten es bis fast zum jetzt,ganz alleine im aufzug, war das stiick metall frei, sich zu verhalten wie immer es wollte.</td><td>GroundTruth:we turned off the lights,and thenwe put it ina vacuumand sucked out all the air, and then we cooled it down now,all alone in the elevator,</td></tr><tr><td></td><td>the little chunk of metal is free to act however it wanted.</td></tr><tr><td></td><td>Baseline: we turned the light off, put it in a vacuum and sucked it out all the air and cooled it up until almost now,all the way alone,the piece of metal was</td></tr><tr><td></td><td>open to behave as it was. Baseline + S.S.: we turned the lights off, we put it into a vacuum,and we</td></tr><tr><td></td><td>sucked allte air,and we cooled it all the wayup to now,all over the place,the</td></tr><tr><td></td><td>piece of metal was free to behave whatever it wanted. Ours: we turned off the lights,we put it into a vacuum and we sucked all the</td></tr><tr><td>und im grunde konnen sie das betrachten,wissen sie,als eine tyrannei des erin-</td><td>air out,and we cooled it up until almost now,all alone in the elevator,the piece of metal was free to behave whatever it wanted.</td></tr><tr><td>nernden selbst,und sie konnen sich das erinnernde selbst denken als eins, das sozusagen das erlebende selbst schleppt durch erfahrungen,die das erlebende</td><td>GroundTruth: and basically you can look at this,you know,asa tyranny of the remembering self,and you can think of the remembering self sort of dragging</td></tr><tr><td>selbst nicht braucht.</td><td>the experiencing self through experiences that the experiencing self doesn't need.</td></tr><tr><td></td><td>Baseline: and basically,you can think of this,you know,as a tyranny of self,</td></tr><tr><td></td><td>and you can think of the memorable self as one that kind of weaves the living self through experiences that don't need the life itself.</td></tr><tr><td></td><td>Baseline +S.S.: and basically,you can look at this,you know,as a tyrannei of memorial self,and you can think of the memorial self as one that kind of sucks</td></tr><tr><td></td><td>the living self through experiences that don't need the living self.</td></tr><tr><td></td><td>Ours:and basically,you can look at that,you know,as a tyranny of the</td></tr><tr><td>wir sind an der schwelle zu erstaunlichen, erstaunlichen ereignissen auf vielen</td><td>remembering self,and you can think of the memory itself as one,which is sort of dragging the living self through experiences that the living self doesn't need.</td></tr><tr><td>gebieten.und doch denke ich wirklich,dass wir hunderte,3OO jahre vor die</td><td>GroundTruth:we're on the verge of amazing,amazing eventsin many fields,</td></tr><tr><td>aufklärung zuruck gehen müssten,um eine zeit zu finden,in der wir fortschritt bekämpft haben,in der wir über diese dinge heftiger getritten haben,an mehr</td><td>and yeti actually think we'd have to go back hundreds,3OO years, before the</td></tr><tr><td>fronten als jetzt.</td><td>enlightenment,to find a time when we battled progress, when we fought about these things more vigorously, on more fronts,than we do now.</td></tr><tr><td></td><td></td></tr><tr><td></td><td>Baseline:we are at the threshold of amazing,amazing events in many areas, and yetireally think that we have to go back hundreds and 3OO years before</td></tr><tr><td></td><td>the enlightenment to find a time when we have fought progress in which we</td></tr><tr><td></td><td>have driven more of these things than now.</td></tr><tr><td></td><td>Baseline + S.S.: we're at the threshold of amazing,amazing events in many areas.and yet,i really think that we have to go back hundreds and hundreds</td></tr><tr><td></td><td></td></tr><tr><td></td><td>of years before the enlightenment to find a time when we have struggled with</td></tr><tr><td></td><td>progress in which we have driven on these things more powerful, more fronts</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>than now.</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>Ours: we're at the threshold to amazing,amazing events in many areas,and</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>yet i really think that we have to go back hundreds and 3OO years before the enlightenment to find a time when we fought progress,where we've been</td><td></td></tr></table>
|
| 451 |
+
|
| 452 |
+
C.7 EVALUATION WITH OTHER METRICS
|
| 453 |
+
Table 12: Comparison of ROUGE-1, ROUGE-2, ROUGE-L, METEOR, and BLEU scores between our approach E-Forcing and the base ARGM trained just with cross-entropy loss on three translation pairs of IWSLT14 datasets. The value is expressed in percentage. We use “Tr-Base” as the network architecture.
|
| 454 |
+
|
| 455 |
+
<table><tr><td rowspan="2">Trans.Pairs</td><td rowspan="2">Scheduled Sampling</td><td rowspan="2">E-Forcing Training</td><td colspan="5">Metrics</td></tr><tr><td>ROUGE-1↑</td><td>ROUGE-2个</td><td>ROUGE-L↑</td><td>METEOR↑</td><td>BLEU个</td></tr><tr><td rowspan="3">De→En</td><td>-</td><td>-</td><td>66.51</td><td>43.69</td><td>63.69</td><td>64.35</td><td>34.61</td></tr><tr><td>√</td><td>-</td><td>66.83</td><td>44.08</td><td>64.02</td><td>64.61</td><td>35.10</td></tr><tr><td>V</td><td>√</td><td>67.46</td><td>44.77</td><td>64.78</td><td>65.13</td><td>35.36</td></tr><tr><td rowspan="3">It→En</td><td>1</td><td>-</td><td>64.50</td><td>40.65</td><td>61.69</td><td>62.18</td><td>32.29</td></tr><tr><td>v</td><td>-</td><td>64.73</td><td>40.97</td><td>61.94</td><td>62.51</td><td>32.64</td></tr><tr><td><</td><td>√</td><td>65.27</td><td>41.51</td><td>62.49</td><td>62.80</td><td>32.82</td></tr><tr><td rowspan="3">Es→En</td><td>-</td><td>-</td><td>71.10</td><td>49.47</td><td>68.78</td><td>68.94</td><td>40.64</td></tr><tr><td><</td><td>-</td><td>71.36</td><td>49.53</td><td>68.96</td><td>69.28</td><td>40.91</td></tr><tr><td><</td><td>√</td><td>71.91</td><td>50.17</td><td>69.65</td><td>69.63</td><td>41.58</td></tr></table>
|
| 456 |
+
|
| 457 |
+
To further evaluate the effectiveness of our proposed E-Forcing, we also evaluate our method by using other metrics, such as ROUGE Lin (2004) and METEOR Banerjee & Lavie (2005) for neural machine translation. The results are shown in Table 12. In Table 12, the improvements of E-Forcing in different metrics is consistent with the conclusion of Table 2, which further prove the effectiveness of our E-Forcing method.
|
md/dev/UjynxfqnGWG/UjynxfqnGWG.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/V3C8p78sDa/V3C8p78sDa.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/VD-AYtP0dve/VD-AYtP0dve.md
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SEMANTIC UNCERTAINTY: LINGUISTIC INVARIANCES FOR UNCERTAINTY ESTIMATION IN NATURAL LANGUAGE GENERATION
|
| 2 |
+
|
| 3 |
+
Lorenz Kuhn, Yarin Gal, Sebastian Farquhar OATML Group, Department of Computer Science, University of Oxford lorenz.kuhn@cs.ox.ac.uk
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce a method to measure uncertainty in large language models. For tasks like question answering, it is essential to know when we can trust the natural language outputs of foundation models. We show that measuring uncertainty in natural language is challenging because of ‘semantic equivalence’—different sentences can mean the same thing. To overcome these challenges we introduce semantic entropy—an entropy which incorporates linguistic invariances created by shared meanings. Our method is unsupervised, uses only a single model, and requires no modifications to ‘off-the-shelf’ language models. In comprehensive ablation studies we show that the semantic entropy is more predictive of model accuracy on question answering data sets than comparable baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Despite progress in natural language generation (NLG) tasks like question answering or abstractive summarisation (Brown et al., 2020; Hoffmann et al., 2022; Chowdhery et al., 2022), there is little understanding of uncertainty in foundation models. Without measures of uncertainty in transformerbased systems it is hard to use generated language as a reliable source of information. Reliable measures of uncertainty have been identified as a key problem in building safer AI systems (Amodei et al., 2016; Hendrycks et al., 2022).
|
| 12 |
+
|
| 13 |
+
Unfortunately, uncertainty in free-form NLG faces unique challenges. This limits how much we can learn from uncertainty estimation techniques in other applications of deep learning (Gal et al., 2016; Lakshminarayanan et al., 2017; Ovadia et al., 2019) which focuses especially on image classification (Kendall & Gal, 2017) or regression in low-dimensional data spaces (Kuleshov et al., 2018).
|
| 14 |
+
|
| 15 |
+
The key challenges come from the importance in language of meanings and form. This corresponds to what linguists and philosophers call the semantic content of a sentence and its syntactic or lexical form. Foundation models output token-likelihoods—representing lexical confidence. But for almost all applications we care about meanings! For example, a model which is uncertain about whether to generate “France’s capital is Paris” or “Paris is France’s capital” is not uncertain in any important sense. Yet, at a token-level the model is uncertain between two forms of the same meaning. Existing unsupervised methods (e.g., Malinin & Gales (2020)) ignore this distinction.
|
| 16 |
+
|
| 17 |
+
To address semantic equivalence, we estimate semantic likelihoods—probabilities attached to meanings of text rather than standard sequence-likelihoods. We introduce an algorithm for clustering sequences that mean the same thing based on the principle that two sentences mean the same thing if you can infer each from the other. We then use these semantic-likelihoods to estimate semantic uncertainty—uncertainty over different meanings. In particular, we compute the entropy of the probability distribution over meanings. Adjusting for semantic equivalence in this way offers better uncertainty estimation than standard entropy and also greatly improves over methods for model self-evaluation (Kadavath et al., 2022). In addition, semantic entropy scales better with model size and makes better use of increasing numbers of samples than baselines.
|
| 18 |
+
|
| 19 |
+
We further analyse major challenges for measuring uncertainty in NLG. We show empirically how sampling a set of model answers to estimate entropies in NLG must balance sample accuracy and diversity, which significantly strengthens the baselines we compare against relative to prior implementations. We also examine the situational heuristic of length-normalising predictive entropies. Our main contributions are thus as follows:
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: (a) Our semantic entropy (blue) predicts model accuracy better than baselines on the free-form question answering data set TriviaQA (30B parameter OPT model). Normalised entropy reimplements single-model variant of Malinin & Gales (2020), lexical similarity measures the average Rouge-L in a sampled set of answers for a given question analogously to Fomicheva et al. (2020), entropy and $p ( \mathrm { T r u e } )$ reimplement Kadavath et al. (2022). (b) Our method’s outperformance increases with model size while also doing well for smaller models.
|
| 23 |
+
|
| 24 |
+
• We explain why uncertainty in free-form NLG is different from other settings (Section 3). • We introduce semantic entropy—a novel entropy-based uncertainty measure which uses our algorithm for marginalising over semantically-equivalent samples (Section 4) and show that it outperforms comparable baselines in extensive ablations with both open- and closedbook free-form question answering using TriviaQA and CoQA (Section 6). • Through hyperparameter ablations we suggest how to balance the trade-off between sampling diverse and accurate generations for our method as well as baselines (Section 6.2) and show that far fewer samples are needed for effective uncertainty than prior work presumes.
|
| 25 |
+
|
| 26 |
+
We focus on free-form question answering (QA) because it is a difficult and important use of NLG with high-stakes applications. At the same time, it is easier to establish a ground truth without expensive human evaluation than more nebulous tasks like summarisation.
|
| 27 |
+
|
| 28 |
+
Ultimately, we show that semantic entropy is an effective unsupervised way to estimate uncertainty in NLG. As an unsupervised method, it requires no further training or data-gathering, unlike supervised methods including Lin et al. (2022a); Kadavath et al. (2022). Semantic entropy is designed to work with existing foundation and large language models with no modifications ‘out-of-the-box’. Our experiments use OPT (Zhang et al., 2022) but semantic entropy works with any similar model.
|
| 29 |
+
|
| 30 |
+
# 2 BACKGROUND ON UNCERTAINTY ESTIMATION
|
| 31 |
+
|
| 32 |
+
Our method draws inspiration from probabilistic tools for uncertainty estimation, which have been extensively employed in settings like deep image classification (Gal et al., 2016). Although these methods are often used in Bayesian models, we emphasise that our method does not require any special training or architectural modifications and is not limited to Bayesian settings.
|
| 33 |
+
|
| 34 |
+
The total uncertainty of a prediction can be understood as the predictive entropy of the output distribution. This measures the information one has about the output given the input. This entropy is highest when the output is minimally informative—predicting the same probability for all possible outcomes. The predictive entropy for a point $x$ is the conditional entropy of the output random variable $Y$ with realisation $y$ given $x$
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
P E ( x ) = H ( Y \mid x ) = - \int p ( y \mid x ) \ln p ( y \mid x ) d y
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
One can further distinguish aleatoric uncertainty—uncertainty in the underlying data distribution— and epistemic uncertainty—resulting from missing information (Kendall $\&$ Gal, 2017). Epistemic uncertainty, measured using a mutual information, can be useful but is hard to estimate, especially for very large models, requiring special methods and computational expense. Instead of estimating the epistemic uncertainty based on the model variance, the epistemic uncertainty can also be predicted directly using a second model (see e.g. Jain et al. (2021)). We do not use mutual information in this work, because our focus is on existing foundation models ‘off-the-shelf’. Similarly, while, e.g., Malinin & Gales (2020) use ensembles of models to estimate the integral in Eq. (1) we use samples from a single model’s output distribution. Prior networks (Malinin & Gales, 2018; Malinin et al., 2020) estimate model uncertainty by emulating an ensemble with a single model. This could be important for NLG because of large model sizes.
|
| 41 |
+
|
| 42 |
+
For sequence-prediction tasks like NLG, the probability of the entire sequence, s, is the product of the conditional probabilities of new tokens given past tokens, whose resulting log-probability is $\begin{array} { r } { \log p ( \mathbf { s } \mid x ) = \bar { \sum _ { i } \log p ( s _ { i } \mid \mathbf { s } _ { < i } ) } } \end{array}$ , where $s _ { i }$ is the $i ^ { \because }$ ’th output token and $\mathbf { s } _ { < i }$ denotes the set of previous tokens. Sometimes, instead of the entropy of these probabilities, the geometric mean token$\begin{array} { r } { \dot { \mathbf { \Xi } } _ { N } ^ { 1 } \sum _ { i } ^ { N } \log p ( s _ { i } \mid \mathbf { s } _ { < i } ) } \end{array}$ tead (Malinin & Gales, 2020) becoming an arithmetic mean log-probability. Despite empirical success Murray & Chiang (2018), so far this has little theoretical justification.
|
| 43 |
+
|
| 44 |
+
Direct application of language models to uncertainty. In contrast to our approach using probabilistic methods, recent work has sought to use the generating language model itself to estimate its own uncertainty. For example, Lin et al. (2022a) finetune language models to verbally describe their confidence. Meanwhile, Kadavath et al. (2022) sample multiple generations and return the completion to an NLG prompt asking if a proposed answer is true (further detail in Appendix B.5). Both Lin et al. (2022a) and Kadavath et al. (2022) also propose ways to finetune predictors on the embeddings of generating models to predict models uncertainty. While promising, these approaches need task-specific labels, additional training, and seem to be unreliable out-of-distribution (as shown in Figures 13 and 14 in Kadavath et al. (2022)).
|
| 45 |
+
|
| 46 |
+
# 3 CHALLENGES IN UNCERTAINTY ESTIMATION FOR NLG
|
| 47 |
+
|
| 48 |
+
Approaches to NLG uncertainty might treat the language model as a black-box (e.g., asking it if its answer is correct) or alternatively focus on the probabilistic model without accounting for the special characteristics of language (e.g., measuring predictive entropy).
|
| 49 |
+
|
| 50 |
+
Our unsupervised approach instead uses the powerful tools of probabilistic modelling, but also recognises the unique challenges posed by free-form NLG. In this section, we critically analyse the probabilistic interpretation of language models in order to ground both our method and future exploration of the field.
|
| 51 |
+
|
| 52 |
+
# 3.1 SEMANTIC EQUIVALENCE IN LANGUAGE OUTPUTS
|
| 53 |
+
|
| 54 |
+
Most machine learning problems have mutually exclusive outputs. An image in class 17 is not class 29 as well; a regression output of 23.1 is not anything else; an RL agent going left does not go right. In contrast, for free-form text generation an output usually means the same thing as many other outputs. For example, “The capital of France is Paris” means the same thing as “France’s capital is Paris”. Linguists and philosophers distinguish text’s meaning—its semantic content—from its syntactic and lexical form. The syntax is the grammatical structure while its lexical form is the specific words used. Lexical equivalence entails the other two, but not the reverse.
|
| 55 |
+
|
| 56 |
+
We almost always care about the semantic content of a sentence. For decision-problems relying on NLG, meaning is usually an invariance in output-space which is not present in the model specification. This is true for question answering, summarisation, artificial assistants. Meanings are especially important for trustworthiness: a system can be reliable even with many different ways to say the same thing but answering with inconsistent meanings shows poor reliability.
|
| 57 |
+
|
| 58 |
+
We can formalize semantic equivalence mathematically. Let the space of tokens in a language be $\tau$ . The space of all possible sequences of tokens of length $N$ is then ${ \cal S } _ { N } \equiv { \cal T } ^ { N }$ . For some sentence $\mathbf { s } \in { \mathcal { S } } _ { N }$ , a sequence of tokens $s _ { i } \in \mathcal T$ there is an associated meaning.1
|
| 59 |
+
|
| 60 |
+
Let us introduce a placeholder semantic equivalence relation, $E ( \cdot , \cdot )$ , which holds of any two sentences that mean the same thing—we operationalise this in Section 4. Recall that an equivalence
|
| 61 |
+
|
| 62 |
+
Table 1: Answers to the question “What is the capital of France?” (a) When all generations from the model mean different things, semantic clustering has no effect—the entropy and semantic entropy are identical. (b) When some of the answers are semantically equivalent (“Paris” and “It’s Paris”) the semantic entropy does a better job of capturing the actually low uncertainty.
|
| 63 |
+
|
| 64 |
+
(a) Scenario 1: No semantic equivalence
|
| 65 |
+
|
| 66 |
+
<table><tr><td>Answer S</td><td>Likelihood p(s|x)</td><td>Semantic likelihood ∑secp(s|x)</td></tr><tr><td>Paris</td><td>0.5</td><td>0.5</td></tr><tr><td>Rome</td><td>0.4</td><td>0.4</td></tr><tr><td>London</td><td>0.1</td><td>0.1</td></tr><tr><td>Entropy</td><td>0.31</td><td>0.31</td></tr></table>
|
| 67 |
+
|
| 68 |
+
(b) Scenario 2: Some semantic equivalence
|
| 69 |
+
|
| 70 |
+
<table><tr><td>Answer S</td><td>Likelihood p(s|x)</td><td>Semantic likelihood ∑secp(s|x)</td></tr><tr><td>Paris</td><td>0.5 1</td><td>0.9</td></tr><tr><td>It's Paris London</td><td>0.4</td><td></td></tr><tr><td></td><td>0.1</td><td>0.1</td></tr><tr><td>Entropy</td><td>0.31</td><td>0.16</td></tr></table>
|
| 71 |
+
|
| 72 |
+
relation is any reflexive, symmetric, and transitive relation, and that any equivalence relation on a set corresponds to a set of equivalence classes. Each semantic equivalence class corresponds to one possible meaning that our text can have. That is, for the space of semantic equivalence classes $\mathcal { C }$ the sentences in the set $c \in { \mathcal { C } }$ all share a meaning such that $\forall s , s ^ { \prime } \in c : E ( s , s ^ { \prime } )$ .
|
| 73 |
+
|
| 74 |
+
Ordinarily, large language models produce conditional distributions over tokens and their resulting sequences. That is, the probability of the sequence conditioned on the context comes from conditional token probabilities $\begin{array} { r } { p ( \mathbf { s } \mid x ) { \dot { } } = \prod _ { i } p ( s _ { i } \mid s _ { < i } , x ) } \end{array}$ . Instead, we focus on the probability of the model generating any sequence that shares some meaning. This can be written as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
p ( c \mid x ) = \sum _ { \mathbf { s } \in c } p ( \mathbf { s } \mid x ) = \sum _ { \mathbf { s } \in c } \prod _ { i } p ( s _ { i } \mid s _ { < i } , x ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Formally, this treats the output random variable whose event-space is $\mathcal { C }$ , a sub- $\sigma$ -algebra of the standard event-space $s$ .
|
| 81 |
+
|
| 82 |
+
# 3.2 SAMPLING THE EXTREMELY HIGH-DIMENSIONAL LANGUAGE-SPACE
|
| 83 |
+
|
| 84 |
+
Recall from Eq. (1) that estimating predictive entropy requires taking an expectation in output-space. However, the output-space of natural language has $\mathrm { \dot { \mathcal { O } } } ( | \dot { \mathcal { T } } | ^ { N } )$ dimensions. Moreover, while we can sample from our autoregressive token-model, we lack a normalized probability density function over sentences. The expectation must be approximated by Monte Carlo integration—sampling a finite set of sentences from the output distribution and averaging their likelihoods to compute the entropy. For entropies the average is dominated by low-probability sentences (whose logs are large and negative) making Monte Carlo integration difficult (Mackay, 2003).
|
| 85 |
+
|
| 86 |
+
# 3.3 VARIABLE LENGTH GENERATIONS
|
| 87 |
+
|
| 88 |
+
Sentences of natural language have different lengths. As is widely noted (Murray & Chiang, 2018) and especially in the context of NLG uncertainty by Malinin & Gales (2020), in expectation longer sequences have lower joint likelihoods because of the conditional independence of the token probabilities. The joint likelihood of a sequence of length $N$ shrinks exponentially in $N$ . Its negative log-probability therefore grows linearly in $N$ , so longer sentences tend to contribute more to entropy.
|
| 89 |
+
|
| 90 |
+
We therefore interpret length-normalising the log-probabilities when estimating the entropy as asserting that the expected uncertainty of generations is independent of sentence length. Sometimes, this is approximately valid. Other times, longer sentences may well be usually more uncertain (e.g., when the goal is to exactly match a typically short reference answer, such as for TriviaQA). In these cases, the advantages of length-normalisation become less clear-cut, as we show empirically in Section 6.1. This offers some guidance a priori on cases when length-normalisation is appropriate.
|
| 91 |
+
|
| 92 |
+
# 4 SEMANTIC UNCERTAINTY
|
| 93 |
+
|
| 94 |
+
We have introduced the idea that uncertainty over meanings is more important for most situations than uncertainty over the exact tokens used to express those meanings. Our method examines uncertainty in meaning-space—the entropy of the random variable representing the output distribution in the semantic event-space. This is in contrast to entropy in the usual token event-space. To do this we introduce a novel algorithm for estimating the semantic equivalence relation as well as a novel uncertainty estimation algorithm for semantic entropy. At a high level this involves three steps:
|
| 95 |
+
|
| 96 |
+
1. Generation: Sample $M$ sequences $\{ s ^ { ( 1 ) } , \ldots , s ^ { ( M ) } \}$ from the predictive distribution of a large language model given a context $x$ .
|
| 97 |
+
|
| 98 |
+
2. Clustering: Cluster the sequences which mean the same thing using our bi-directional entailment algorithm.
|
| 99 |
+
|
| 100 |
+
3. Entropy estimation: Approximate semantic entropy by summing probabilities that share a meaning following Eq. (2) and compute resulting entropy. This is illustrated in Table 1.
|
| 101 |
+
|
| 102 |
+
# Step 1: Generating a set of answers from the model
|
| 103 |
+
|
| 104 |
+
First we sample $M$ sequences $\{ s ^ { ( 1 ) } , \ldots , s ^ { ( M ) } \}$ which we will use later to estimate the uncertainty. These sequences must be sampled according to the distribution $p ( \mathbf { s } \mid x )$ . In this paper, we sample these sequences only from a single model using either multinomial sampling or multinomial beam sampling. We show in Section 6.2, that the choice of sampling temperature and sampling method can have a significant impact on the performance of both our method and the baselines. Unlike Malinin & Gales (2020), we do not use an ensemble of models. Ensembling would probably improve performance, but the cost of training multiple independent foundation models is often prohibitive.
|
| 105 |
+
|
| 106 |
+
# Step 2: Clustering by semantic equivalence
|
| 107 |
+
|
| 108 |
+
In Section 3.1, we formalised semantic equivalence by introducing the semantic equivalence relation, $E ( \cdot , \cdot )$ , which induces semantic equivalence classes which are sets of sequences that share a meaning. Recall that the equivalence class $c$ is a set of sequences s such that $\forall s , s ^ { \prime } \in c : E ( s , s ^ { \prime } )$ . We operationalise $E ( \cdot , \cdot )$ using the idea of bi-directional entailment. A sequence, s, means the same thing as a second sequence, $\mathbf { s } ^ { \prime }$ , if and only if they entail (i.e. logically imply) each other. E.g., “The capital of France is Paris.” entails “Paris is the capital of France.” because they mean the same thing.
|
| 109 |
+
|
| 110 |
+
Importantly, we require that the sequences mean the same thing with respect to the context—key meaning is sometimes contained within the context. For example, “Paris.” does not entail “The capital of France is Paris.” because “Paris.” is not a declarative sentence without context. But within the context of the question, the one-word answer does entail the fuller answer.
|
| 111 |
+
|
| 112 |
+
In general, any natural language inference classification system (NLI) can be used for our bidirectional entailment clustering algorithm. In our case, we use a Deberta-large model (He et al., 2020a) that is fine-tuned on the NLI data set MNLI (Williams et al., 2017). For each pair of sequences in our set of samples, s and $\mathbf { s } ^ { \prime }$ , we detect whether it is possible to infer the concatenation of the context and s from the concatenation of the context and $\mathbf { s } ^ { \prime }$ and vice versa. To do this we concatenate each of the two question/answer pairs, and then concatenate them both together separated by a special token. The Deberta model then classifies this sequence into one of: entailment, neutral, contradiction. We compute both directions, and the algorithm returns equivalent if and only if both directions were entailment. Algorithm pseudocode is provided in Appendix A.2.
|
| 113 |
+
|
| 114 |
+
Because this component is novel, we confirm in Appendix B.2 that the bidirectional entailment classifier works by manually labelling 300 generations for semantic equivalence, finding an accuracy of $9 2 . 7 \%$ on TriviaQA and $9 5 . 5 \%$ on CoQA.
|
| 115 |
+
|
| 116 |
+
Computational cost. The bidirectional equivalence algorithm is combinatorially complex in $M$ , it requires $\binom { M } { 2 }$ -many comparisons in the worst-case. In practice, however, the computational cost is small compared to the cost of generating sequences. First, as we show in Section 6.2, $M < 2 0$ is often sufficient for good uncertainty. Second, because the Deberta-large model is so much smaller than the main language model (1.5B parameters), each pair comparison is much faster than generating even one token from the main model. Third, because semantic equivalence is transitive we only need to compare one member of each equivalence class to remaining sequences (see Algorithm 1). Additionally, the number of semantic clusters in our tasks is empirically quite low, see Table 2.
|
| 117 |
+
|
| 118 |
+
# Step 3: Computing the semantic entropy
|
| 119 |
+
|
| 120 |
+
Having determined the clusters of generated sequences that mean the same thing, we add their likelihoods following Eq. (2) as a way of determining the likelihood of each meaning, rather than each sequence. We then compute the semantic entropy (SE) as the entropy over the meaning-distribution
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
S E ( x ) = - \sum _ { c } p ( c \mid x ) \log p ( c \mid x ) = - \sum _ { c } { \Bigg ( } { \Big ( } \sum _ { \mathbf { s } \in c } p ( \mathbf { s } \mid x ) { \Big ) } \log { \Big [ } \sum _ { \mathbf { s } \in c } p ( \mathbf { s } \mid x ) { \Big ] } { \Bigg ) } .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
We do not have access to every possible meaning-class $c$ . Instead, we can only sample $c$ from the sequence-generating distribution induced by the model. To handle this, we estimate the expectation in Eq. (3) using Monte Carlo integration over the semantic equivalence classes $C$ from Algorithm 1
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
S E ( x ) \approx - | C | ^ { - 1 } \sum _ { i = 1 } ^ { | C | } \log p ( C _ { i } \mid x ) .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
This is an unbiased estimator of the entropy in Eq. (3). In addition, in some cases we use lengthnormalisation as described in Section 3.3.
|
| 133 |
+
|
| 134 |
+
# 4.1 HOW THE SEMANTIC ENTROPY ADDRESSES THE CHALLENGES OF NLG
|
| 135 |
+
|
| 136 |
+
The main inspiration of semantic entropy is to address the semantic invariance of natural language head-on by converting the problem of uncertainty estimation into meaning-space. In addition, semantic entropy goes some way towards addressing unequal token importance. Generations whose meanings are the same but differ on unimportant tokens will be added together, which we expect will reduce the effect of the likelihoods of unimportant tokens although we do not demonstrate this empirically. However, this challenge is only partially addressed: semantic entropy will still pay too much attention to non-keyword likelihoods. This is one area where supervised language-modelbased uncertainty tools (Lin et al., 2022a; Kadavath et al., 2022) might enable future improvements that handle this challenge better. We address the challenges of sampling and variable-length generation using specific details of our sampling procedure in Section 4.
|
| 137 |
+
|
| 138 |
+
# 5 RELATED WORK
|
| 139 |
+
|
| 140 |
+
Prior work on uncertainty in foundation models for NLP has largely focused on the calibration of classifiers (Jiang et al., 2021; Desai & Durrett, 2020) and text regressors (Glushkova et al., 2021; Wang et al., 2022). These settings, are analogous to classification or regression settings in other modalities like vision, and conventional uncertainty measures like MC dropout or Deep Ensembles can be applied without modification (see Section 2 for a discussion of uncertainty in deep learning in general). As we argue in Section 3, generative natural language poses important further challenges. Jiang et al. (2021) do examine calibration in generative question answering and find only a weak correlation between the log-likelihood models assign to their answer and the answer’s correctness. In Section 6 we explain however why semantic equivalence in natural language makes calibration a problematic evaluation for generative language models. Reliable uncertainty can be useful on downstream tasks such as graph semantic parsing (Lin et al., 2022b).
|
| 141 |
+
|
| 142 |
+
Some research has addressed uncertainty or calibration in NLG either by prompting the models to evaluate their own generations or by fine-tuning the generating model to predict its uncertainty (Mielke et al., 2020; Lin et al., 2022a; Kadavath et al., 2022). These methods need further training and supervision. Because they need additional training and supervision, they are hard to reproduce, expensive to create, and have been shown to be sensitive to distribution shift. For example, we were unable to implement one proposal by Kadavath et al. (2022) to train a language model to directly predict confidence due to hardware limitations. Our unsupervised method which uses models ‘offthe-shelf’ avoids these limitations.
|
| 143 |
+
|
| 144 |
+
Many of the issues that make probabilistic uncertainty estimation in NLG difficult also make automatic evaluation of NLG difficult. Ott et al. (2018), for instance, study how the performance of machine translation models suffers because one sentence can be translated in multiple ways. Similarly, Sai et al. (2022) discuss how paraphrase detection can be used to evaluate NLG and other related methods might transfer to uncertainty estimation.
|
| 145 |
+
|
| 146 |
+
Automatic paraphrase identification can be based on comparing lexical features of two given sequences (Fernando & Stevenson, 2008; Issa et al., 2018) or on measuring the similarity between the embeddings of the two sequences (Yu et al., 2014; Socher et al., 2011). Recently, however, SotA paraphrase identification approaches have primarily used BERT-based models to classify pairs of sequences into the classes paraphrases and not paraphrases (He et al., 2020b; Tay et al., 2021). The idea of formalising semantic equivalence via textual entailment has a long history in linguistics (Culicover, 1968) and NLP (Pado et al., 2009; Androutsopoulos & Malakasiotis, 2010). ´ Transformer-based paraphrase detection models such as EFL (Wang et al., 2021) achieve SotA performance on paraphrase detection benchmarks such as Quora Question Pairs Wang et al. (2017).
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 2: (a) On CoQA open-book question answering semantic entropy demonstrates better uncertainty than ordinary predictive entropy with and without normalisation at larger model sizes. It also performs significantly better than $p ( \mathrm { T r u e } )$ . (b) TriviaQA shows similar results. Identical to Fig. 1b with the addition of $p ( \mathrm { T r u e } )$ , which was previously omitted to avoid stretching the scale.
|
| 150 |
+
|
| 151 |
+
# 6 EMPIRICAL EVALUATION
|
| 152 |
+
|
| 153 |
+
We demonstrate that semantic entropy is an effective way to quantify the uncertainty of NLG on free-form QA tasks. Effective uncertainty measures should offer information about how reliable the model’s answers are—that is, very uncertain generations should be less likely to be correct.
|
| 154 |
+
|
| 155 |
+
Performance evaluation. Following prior work (e.g. Filos et al. (2019)), we evaluate uncertainty by treating uncertainty estimation as the problem of predicting whether to rely on a model generation for a given context—whether to trust an answer to a question. The area under the receiver operator characteristic curve (AUROC) metric is equivalent to the probability that a randomly chosen correct answer has a higher uncertainty score than a randomly chosen incorrect answer. Higher scores are better, with perfect uncertainty scoring 1 while a random uncertainty measure would score 0.5.
|
| 156 |
+
|
| 157 |
+
The AUROC is a better measure of uncertainty for free-form question answering and NLG than calibration measures like the Brier score, which are often used in classification or for multiple choice QA. This is because the language model outputs a likelihood for a given token-sequence, but not for an entire meaning. In order to estimate the Brier score, we would need to estimate the entire probability mass assigned to any possible way of saying the correct answer. This is intractable for free form text where we do not have access to probabilities about meanings. In contrast, we can estimate the entropy because it is structured as an expected information, which makes Monte Carlo integration suitable.
|
| 158 |
+
|
| 159 |
+
Model. We use the GPT-like OPT models (Zhang et al., 2022). We vary the size of the model between 2.7B, 6.7B, 13B and 30B parameters, while our headline results are all reported using the largest computationally feasible model, with 30B parameters. In all cases we use only a single unmodified model. There is no ensembling and no stochastic or Bayesian modification. We chose this because in most cases cutting-edge foundation models are not available as ensembles and are too large to efficiently perform approximate Bayesian inference with. We do not fine-tune these models on TriviaQA or CoQA but use them in their pre-trained form.
|
| 160 |
+
|
| 161 |
+
Datasets. We use CoQA Reddy et al. (2019) as an open-book conversational question answering problem (in which the model answers a question using a supporting paragraph). We use the development split $\mathord { \sim } 8 0 0 0$ questions). We also use TriviaQA (Joshi et al., 2017) as a closed-book QA problem (in which the model must answer a question without access to a supporting paragraph). We use a subset of 8000 questions of the training split to match the size of CoQA.
|
| 162 |
+
|
| 163 |
+
We evaluate correctness of our model’s generations on the underlying dataset using the a fuzzy matching criterion: $\mathcal { L } ( \mathbf { s } , \mathbf { s } ^ { \prime } ) = \mathbf { 1 } _ { R o u g e L ( \mathbf { s } , \mathbf { s } ^ { \prime } ) > 0 . 3 }$ . That is, we consider an answer s to be correct if its Rouge-L (Lin & Och, 2004) — a measure of the longest common subsequence — with regards to the reference answer is larger than 0.3. In Appendix B.3 we study other objective functions such as exact matching and Rouge-1 and find our method to be robust to these choices.
|
| 164 |
+
|
| 165 |
+
Baselines. We compare our method against predictive entropy, length-normalised predictive entropy (Malinin & Gales, 2020), $p ( \mathrm { T r u e } )$ (Kadavath et al., 2022), and lexical similarity (similar to (Fomicheva et al., 2020)). Predictive entropy is a widely used measure of uncertainty in other domains, and has been used as a baseline without length-normalisation in, e.g., Kadavath et al. (2022). Here, the score is just the predictive entropy of the output distribution as described in Eq. (1). Length-normalised predictive entropy divides the joint log-probability of each sequence by the length of the sequence, as proposed by Malinin & Gales (2020) in the case of NLG uncertainty and further discussed in Section 3.3. Note that unlike Malinin & Gales (2020), we use only a single model, not an ensemble, and use multinomial sampling as we do for all other methods. $p ( \mathbf { T r u e } )$ proposed by (Kadavath et al., 2022) as a way to estimate the probability that a model’s generation is correct by ‘asking’ the model if its answer is correct. They propose sampling $M$ answers and constructing a new natural language question using these possible answers as context before asking whether the proposed answer is correct and measuring the probability of the completion being True. An example of the format is provided in Appendix B. Note that our implementation of this uses OPT models with up to 30B parameters, while Kadavath et al. (2022) use a proprietary 52B parameter model. We are also limited computationally to 10-shot prompting while the original paper uses 20-shot prompting. Lexical similarity uses the average similarity of the answers in the answer set A: C P i=1 P j =1 $\begin{array} { r } { \frac { 1 } { C } \sum _ { i = 1 } ^ { | \bar { \mathbb { A } } | } \sum _ { j = 1 } ^ { \lceil \bar { \mathbb { A } } \rceil } \bar { \sin } \left( s _ { i } , s _ { j } \right) } \end{array}$ , where $C = \left| \mathbb { A } \right| * ( \left| \mathbb { A } \right| - 1 ) / 2$ , and sim is Rouge-L. Additionally, we evaluate a margin-probability baseline (Lin et al., 2022b) in Appendix B.6, and study why it is not very predictive of model accuracy in this setting. All code and data used in our experiments are available at https://github.com/lorenzkuhn/semantic_uncertainty.
|
| 166 |
+
|
| 167 |
+
Table 2: Incorrectly answered questions have more semantically distinct answers than correct ones. On its own, this count is a reasonable uncertainty measure, though semantic entropy is better.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="3">Dataset</td><td colspan="2">Average # of semantically distinct answers</td><td colspan="2">AUROC</td></tr><tr><td>Correctly answered</td><td>Incorrectly answered</td><td>Semantic entropy</td><td># distinct answers</td></tr><tr><td>CoQA</td><td>1.27</td><td>1.77</td><td>0.77</td><td>0.66</td></tr><tr><td>TriviaQA</td><td>1.89</td><td>3.89</td><td>0.83</td><td>0.79</td></tr></table>
|
| 170 |
+
|
| 171 |
+
# 6.1 SEMANTIC ENTROPY UNCERTAINTY
|
| 172 |
+
|
| 173 |
+
For both TriviaQA and $\mathrm { C o Q A }$ , semantic entropy improves over baselines in predicting whether a model’s answer to a question is correct. For TriviaQA, using the largest model we show in Fig. 1a we show that semantic entropy has a significantly higher AUROC than entropy in sequence-probabilityspace with and without length-normalisation, as well as the lexical similarity baseline. At the same time, it performs dramatically better than $p ( \mathrm { T r u e } )$ . Similarly, we find in Fig. 1b that our method outperforms more for larger model sizes and continues to steadily improve as the model size increases, with the performance of the $p ( \mathrm { T r u e } )$ baseline added in Fig. 2b (not shown in the opening figure for visual clarity). For CoQA, in Fig. 2a we show that semantic entropy predicts model correctness significantly better than the baselines at larger model sizes.
|
| 174 |
+
|
| 175 |
+
The ground truth answers for TriviaQA are generally single words or very short phrases, while CoQA contains both longer and shorter ground truth answers. This is why performing lengthnormalisation has a large effect for CoQA but no effect for TriviaQA (compare Fig. 2a and Fig. 2b). TriviaQA is also a more challenging dataset: accuracy of $5 0 . 6 \%$ against $8 2 . 3 \%$ for CoQA.
|
| 176 |
+
|
| 177 |
+
We can better understand the mechanism of action for semantic entropy by examining the difference between incorrect and correct answers generated by the model. In Table 2 we show that the average number of semantically distinct clusters of answers $( | C | )$ from the 30B parameter model is significantly greater for incorrectly answered questions than correctly answered ones. This fits our predictions, which is that the model is more likely to generate incorrect answers when it is uncertain about the most likely generation. There are 10 answers generated per question, so there is substantial overlap in meaning. We also show that simply using the number of semantically distinct answers as an uncertainty measure on its own performs reasonably well. Semantic entropy has a higher AUROC than the number of distinct answers, especially for CoQA whose difficulty causes greater spread in predicted probabilities between possible answers.
|
| 178 |
+
|
| 179 |
+
Finally, we can see that much of the performance gain comes from making better use of more samples. In Fig. 3a we show that for both CoQA (top) and TriviaQA (bottom) the gap between semantic entropy and length-normalised entropy widens as the number of samples increases.
|
| 180 |
+
|
| 181 |
+
# 6.2 HYPERPARAMETERS FOR EFFECTIVE SAMPLING
|
| 182 |
+
|
| 183 |
+
Adjusting the temperature used for multinomial sampling has two competing effects on the generated sequences produced by the model. Increasing the temperature increases the diversity of samples (Fig. 3b, bottom figure, solid line). One would expect more diverse generations to cover the space of possible meanings more fully. Here we measure the diversity using the average overlap of the longest sub-sequence among sampled answers $( 1 - \binom { M } { 2 } ^ { - 1 } \sum _ { { \bf s } \neq { \bf s } ^ { \prime } \in C }$ Rouge- $\mathbf { \cdot L } ( \mathbf { s } , \mathbf { \bar { s } } ^ { \prime } ) ,$ ). At the same time, reducing the temperature improves the average correctness of the answer (Fig. 3b, bottom figure, dashed line). Typically, more accurate models are also better at estimating uncertainty.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 3: (a) Semantic entropy makes better use of additional samples because it handles duplication better, the performance gap therefore continues to improve. (b) (bottom) Higher temperatures result in more diversity but less accurate generations. (top) The best performing uncertainty comes from an intermediate temperature that balances these two forces. Results on TriviaQA.
|
| 187 |
+
|
| 188 |
+
In fact, we find that these two effects compete and the highest AUROC for semantic entropy and length-normalised entropy is optimised by an intermediate temperature of 0.5 (Fig. 3b, top figure). A lower temperature would improve accuracy, while a higher temperature would improve diversity. A similar figure for CoQA can be found in Appendix B. Note that prior work using predictive entropy as a baseline uses a temperature of 1.0 (Kadavath et al., 2022), which our evaluation suggests would significantly weaken the baseline relative to our implementation.
|
| 189 |
+
|
| 190 |
+
# 7 DISCUSSION
|
| 191 |
+
|
| 192 |
+
Many natural language problems display a crucial invariance: sequences of distinct tokens mean the same thing. Addressing this directly, we introduce semantic entropy—the entropy of the distribution over meanings rather than sequences—and show that this is more predictive of model accuracy on QA than strong baselines. Our unsupervised approach using ‘out-of-the-box’ models improves reproducibility and is easier to deploy. Unsupervised uncertainty may also help address the observation raised in prior work that supervised uncertainty measures struggle with distribution shift.
|
| 193 |
+
|
| 194 |
+
For semantic entropy, we introduce a novel bidirectional entailment clustering algorithm which uses a smaller natural language inference model. Our method therefore represents a middle ground between fully probabilistic methods and methods that use language models to exploit aspects of natural language that are not transparently present in the model activations. We believe that this sort of joint approach is more promising than relying on either perspective on its own, especially as language models continue to improve. This will become more important in cases where language models are capable of deception, something which our method does not protect against, rather than merely being uncertain between many possible meaningful options. By combining model internals with model prediction one can hope to stay a step ahead of model capabilities.
|
| 195 |
+
|
| 196 |
+
We focus on question answering because this is a particularly important free-form NLG problem with relatively clear ground truths. In the future, however, we hope our work on semantic equivalence can pave the way towards progress in settings like summarisation where correctness requires more human evaluation although additional progress on paraphrase identification in these settings is likely required first. Semantic likelihoods could also be extended to other tools for probabilistic uncertainty like mutual information, potentially offering new strategies for NLG uncertainty.
|
| 197 |
+
|
| 198 |
+
# ACKNOWLEDGMENTS
|
| 199 |
+
|
| 200 |
+
We are grateful to Geoffrey Irving, Kuba Perlin, Laura Rimell, and Miles Turpin for their advice and feedback on earlier drafts of this paper. We are also grateful to the members of the OATML group for helpful discussions about this project.
|
| 201 |
+
|
| 202 |
+
# ETHICS STATEMENT
|
| 203 |
+
|
| 204 |
+
Our aim is to work towards safer AI systems by enabling users to understand the confidence and reliability of language model generations. In principle, this could help mitigate many of the potential harms of NLG from foundation models such as generating false and harmful information in response to genuine questions about important topics like medical questions. However, this potential benefit comes with the risk that systematic mistakes in the assessment of uncertainty or its communication could cause unfounded and misplaced confidence. While this paper represents research progress in identifying new considerations and methods for uncertainty quantification in NLG, before deployment we advise that practitioners conduct extensive evaluations specific to the deployment context to make sure that uncertainty is communicated in a way that empowers users and is not misleading or confusing.
|
| 205 |
+
|
| 206 |
+
# REPRODUCIBILITY STATEMENT
|
| 207 |
+
|
| 208 |
+
Because of the computational cost of experimentation with foundation models, most of the relatively small amount of existing research into NLG uncertainty relies on proprietary models, finetuning of expensive models, and human evaluation. These factors put this kind of research out of reach for many academic groups. Our work takes advantage of the recently released, publicly available OPT models, and builds on this to provide an uncertainty quantification pipeline for NLG that uses entirely open source tools. Meanwhile our method requires no finetuning or training of foundation models and can work with ‘off-the-shelf’ existing models. We hope that this can facilitate more research on these important topics in the academic community as well as making our methods easier to replicate. We make all of our code, as well as the hand-labelled semantic equivalence dataset drawn from TriviaQA and CoQA, available under an MIT license.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mane. Con- ´ crete Problems in AI Safety. arXiv, 2016. 1
|
| 213 |
+
Ion Androutsopoulos and Prodromos Malakasiotis. A survey of paraphrasing and textual entailment methods. Journal of Artificial Intelligence Research, 38:135–187, 2010. 6
|
| 214 |
+
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. 1
|
| 215 |
+
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. 1
|
| 216 |
+
Peter W Culicover. Paraphrase generation and information retrieval from stored text. Mech. Transl. Comput. Linguistics, 11(3-4):78–88, 1968. 6
|
| 217 |
+
Shrey Desai and Greg Durrett. Calibration of pre-trained transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 295– 302, 2020. 6
|
| 218 |
+
Samuel Fernando and Mark Stevenson. A semantic similarity approach to paraphrase detection. In Proceedings of the 11th annual research colloquium of the UK special interest group for computational linguistics, pp. 45–52. Citeseer, 2008. 6
|
| 219 |
+
Angelos Filos, Sebastian Farquhar, Aidan N Gomez, Tim G J Rudner, Zachary Kenton, Lewis Smith, Milad Alizadeh, Arnoud de Kroon, and Yarin Gal. Benchmarking Bayesian Deep Learning with Diabetic Retinopathy Diagnosis. Bayesian Deep Learning Workshop at NeurIPS, 2019. 7
|
| 220 |
+
|
| 221 |
+
Marina Fomicheva, Shuo Sun, Lisa Yankovskaya, Fred´ eric Blain, Francisco Guzm ´ an, Mark Fishel, ´ Nikolaos Aletras, Vishrav Chaudhary, and Lucia Specia. Unsupervised quality estimation for neural machine translation. Transactions of the Association for Computational Linguistics, 8: 539–555, 2020. 2, 7
|
| 222 |
+
|
| 223 |
+
Yarin Gal et al. Uncertainty in deep learning. PhD thesis, 2016. 1, 2
|
| 224 |
+
|
| 225 |
+
Taisiya Glushkova, Chrysoula Zerva, Ricardo Rei, and Andre FT Martins. Uncertainty-aware ma- ´ chine translation evaluation. arXiv preprint arXiv:2109.06352, 2021. 6
|
| 226 |
+
|
| 227 |
+
Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654, 2020a. 5
|
| 228 |
+
|
| 229 |
+
Ruining He, Anirudh Ravula, Bhargav Kanagal, and Joshua Ainslie. Realformer: Transformer likes residual attention. arXiv preprint arXiv:2012.11747, 2020b. 6
|
| 230 |
+
|
| 231 |
+
Dan Hendrycks, Nicholas Carlini, John Schulman, and Jacob Steinhardt. Unsolved Problems in ML Safety. arXiv, 2022. 1
|
| 232 |
+
|
| 233 |
+
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. 1
|
| 234 |
+
|
| 235 |
+
Fuad Issa, Marco Damonte, Shay B Cohen, Xiaohui Yan, and Yi Chang. Abstract meaning representation for paraphrase detection. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 442–452, 2018. 6
|
| 236 |
+
|
| 237 |
+
Moksh Jain, Salem Lahlou, Hadi Nekoei, Victor Butoi, Paul Bertin, Jarrid Rector-Brooks, Maksym Korablyov, and Yoshua Bengio. Deup: Direct epistemic uncertainty prediction. arXiv preprint arXiv:2102.08501, 2021. 3
|
| 238 |
+
|
| 239 |
+
Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. How can we know when language models know? on the calibration of language models for question answering. Transactions of the Association for Computational Linguistics, 9:962–977, 2021. 6
|
| 240 |
+
|
| 241 |
+
Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. arXiv preprint arXiv:1705.03551, 2017. 7
|
| 242 |
+
|
| 243 |
+
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. 1, 2, 3, 6, 7, 8, 9, 18
|
| 244 |
+
|
| 245 |
+
Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? Advances in neural information processing systems, 30, 2017. 1, 2
|
| 246 |
+
|
| 247 |
+
Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. In International conference on machine learning, pp. 2796–2804. PMLR, 2018. 1
|
| 248 |
+
|
| 249 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems, 30, 2017. 1
|
| 250 |
+
|
| 251 |
+
Chin-Yew Lin and Franz Josef Och. Automatic evaluation of machine translation quality using longest common subsequence and skip-bigram statistics. In Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics (ACL-04), pp. 605–612, 2004. 7
|
| 252 |
+
|
| 253 |
+
Stephanie Lin, Jacob Hilton, and Owain Evans. Teaching models to express their uncertainty in words. arXiv preprint arXiv:2205.14334, 2022a. 2, 3, 6
|
| 254 |
+
|
| 255 |
+
Zi Lin, Jeremiah Zhe Liu, and Jingbo Shang. Towards collaborative neural-symbolic graph semantic parsing via uncertainty. In Findings of the Association for Computational Linguistics: ACL 2022, pp. 4160–4173, 2022b. 6, 8, 19
|
| 256 |
+
|
| 257 |
+
David Mackay. Information Theory, Inference and Learning Algorithms. Cambridge University Press, 2003. 4
|
| 258 |
+
|
| 259 |
+
Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. Advances in neural information processing systems, 31, 2018. 3
|
| 260 |
+
|
| 261 |
+
Andrey Malinin and Mark Gales. Uncertainty estimation in autoregressive structured prediction. arXiv preprint arXiv:2002.07650, 2020. 1, 2, 3, 4, 5, 7, 8
|
| 262 |
+
|
| 263 |
+
Andrey Malinin, Sergey Chervontsev, Ivan Provilkov, and Mark Gales. Regression prior networks. arXiv preprint arXiv:2006.11590, 2020. 3
|
| 264 |
+
|
| 265 |
+
Sabrina J Mielke, Arthur Szlam, Y-Lan Boureau, and Emily Dinan. Linguistic calibration through metacognition: aligning dialogue agent responses with expected correctness. arXiv preprint arXiv:2012.14983, 2020. 6
|
| 266 |
+
|
| 267 |
+
Kenton Murray and David Chiang. Correcting length bias in neural machine translation. arXiv preprint arXiv:1808.10006, 2018. 3, 4
|
| 268 |
+
|
| 269 |
+
Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Analyzing uncertainty in neural machine translation. In International Conference on Machine Learning, pp. 3956–3965. PMLR, 2018. 6
|
| 270 |
+
|
| 271 |
+
Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model’s uncertainty? evaluating predictive uncertainty under dataset shift. Advances in neural information processing systems, 32, 2019. 1
|
| 272 |
+
|
| 273 |
+
Sebastian Pado, Daniel Cer, Michel Galley, Dan Jurafsky, and Christopher D Manning. Measur- ´ ing machine translation quality as semantic equivalence: A metric based on entailment features. Machine Translation, 23(2):181–193, 2009. 6
|
| 274 |
+
|
| 275 |
+
Siva Reddy, Danqi Chen, and Christopher D Manning. Coqa: A conversational question answering challenge. Transactions of the Association for Computational Linguistics, 7:249–266, 2019. 7
|
| 276 |
+
|
| 277 |
+
Ananya B Sai, Akash Kumar Mohankumar, and Mitesh M Khapra. A survey of evaluation metrics used for nlg systems. ACM Computing Surveys (CSUR), 55(2):1–39, 2022. 6
|
| 278 |
+
|
| 279 |
+
Richard Socher, Eric Huang, Jeffrey Pennin, Christopher D Manning, and Andrew Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. Advances in neural information processing systems, 24, 2011. 6
|
| 280 |
+
|
| 281 |
+
Jeff Speaks. Theories of Meaning. In Edward N. Zalta (ed.), The Stanford Encyclopedia of Philosophy. Metaphysics Research Lab, Stanford University, 2021. 3
|
| 282 |
+
|
| 283 |
+
Yi Tay, Vinh Q Tran, Sebastian Ruder, Jai Gupta, Hyung Won Chung, Dara Bahri, Zhen Qin, Simon Baumgartner, Cong Yu, and Donald Metzler. Charformer: Fast character transformers via gradient-based subword tokenization. arXiv preprint arXiv:2106.12672, 2021. 6
|
| 284 |
+
|
| 285 |
+
Sinong Wang, Han Fang, Madian Khabsa, Hanzi Mao, and Hao Ma. Entailment as few-shot learner. arXiv preprint arXiv:2104.14690, 2021. 6
|
| 286 |
+
|
| 287 |
+
Yuxia Wang, Daniel Beck, Timothy Baldwin, and Karin Verspoor. Uncertainty estimation and reduction of pre-trained models for text regression. Transactions of the Association for Computational Linguistics, 10:680–696, 2022. 6
|
| 288 |
+
|
| 289 |
+
Zhiguo Wang, Wael Hamza, and Radu Florian. Bilateral multi-perspective matching for natural language sentences. arXiv preprint arXiv:1702.03814, 2017. 6
|
| 290 |
+
|
| 291 |
+
Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426, 2017. 5
|
| 292 |
+
|
| 293 |
+
Lei Yu, Karl Moritz Hermann, Phil Blunsom, and Stephen Pulman. Deep learning for answer sentence selection. arXiv preprint arXiv:1412.1632, 2014. 6
|
| 294 |
+
|
| 295 |
+
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. 2, 7
|
| 296 |
+
|
| 297 |
+
Table 3: Illustration of semantic, syntactic, and lexical equivalence. Work with foundation models implicitly focuses on lexical equivalence, which entails the others, but we usually care about semantic equivalence.
|
| 298 |
+
|
| 299 |
+
<table><tr><td rowspan="2">Sentence A</td><td rowspan="2">Sentence B</td><td colspan="3">Equivalence</td></tr><tr><td>Lexical</td><td>Syntactic</td><td>Semantic</td></tr><tr><td rowspan="2">Paris is the capital of France.</td><td>Paris is the capital of France.</td><td>√</td><td>V</td><td>√</td></tr><tr><td>Berlin is the capital of France. France's capital is Paris.</td><td></td><td></td><td>√</td></tr></table>
|
| 300 |
+
|
| 301 |
+
# A FURTHER DETAILS ON SEMANTIC ENTROPY
|
| 302 |
+
|
| 303 |
+
# A.1 FURTHER DISCUSSION OF SEMANTIC EQUIVALENCE
|
| 304 |
+
|
| 305 |
+
We illustrate the distinction between different kinds of equivalence in Table 3. Lexically equivalent sequences use exactly the same symbols. They are always also semantically and syntactically equivalent (in a given context). Syntactically equivalent sentences have the same grammatical form. But they can have different meanings (not semantically equivalent) and can use different symbols (not lexically equivalent). Semantically equivalent sentences mean the same thing, but they might have different grammatical form (not syntactically equivalent) or symbols (not lexically equivalent). Two sentences can also be both syntactically and semantically equivalent but not lexically equivalent if they match up to a synonym.
|
| 306 |
+
|
| 307 |
+
Soft equivalence and transitivity. Formally, semantic equivalence is transitive. That is, if $E ( \mathbf { s } , \mathbf { s } ^ { \prime } )$ and $E ( \mathbf { s } ^ { \prime } , \mathbf { s } ^ { \prime \prime } )$ then it follows that $E ( \mathbf { s } , \mathbf { s } ^ { \prime \prime } )$ . However, the implementation of our bidirectional equivalence algorithm permits some classification errors and it is slightly ‘soft’—it will sometimes return equivalent for pairs that are not quite equivalent. As a result, it is not strictly true that our equivalence relation is transitive, and therefore not strictly true that there is a unique set of equivalence classes. For example, the clusters might depend on the order in which the comparisons are made. In practice, however, we find that this does not pose a noticeable problem—usually, inspecting the outputs shows that the equivalence appears clear cut. However, we acknowledge this potential issue as an area for improvement in future clustering algorithms.
|
| 308 |
+
|
| 309 |
+
Unequal token importance. From the perspective of meaning, some tokens can matter more than others—key words. Naive methods like predictive entropy do distinguish between key words or unimportant tokens. Supervised uncertainty methods that make use of language models in the uncertainty evaluation can potentially take this into account better. In addition, our semantic entropy approach partly adjusts for this, as discussed in Section 4.1.
|
| 310 |
+
|
| 311 |
+
# A.2 FURTHER ALGORITHMIC DETAILS
|
| 312 |
+
|
| 313 |
+
In addition to the description of the method provided in the main body, in Algorithm 1 we provide the pseudocode for our bi-directional entailment algorithm.
|
| 314 |
+
|
| 315 |
+
# .3 IMPACT OF SAMPLING METHOD ON QUALITY OF UNCERTAINTY ESTIMATE
|
| 316 |
+
|
| 317 |
+
In Section 4, we study the impact of the temperature hyper-parameter on the performance of the uncertainty measures. Here, we show a variant of Fig. 3b for the CoQA dataset showing an almost identical pattern. Like TriviaQA, the optimal temperature is 0.5 despite a significantly harder problem with lower accuracy, suggesting that this choice hyperparameter may generalize well. Unlike TriviaQA, normalised entropy outperforms semantic entropy at high temperatures.
|
| 318 |
+
|
| 319 |
+
Beyond the temperature, there are a number of other design choices to be made when sampling: the sampling method and hyper-parameters such as $\tt t o p { - p }$ and $\tt t o p \mathrm { - k }$ . Our contribution in this paper is to show the importance of these choices for uncertainty estimation which has been overlooked previously, and study the temperature in particular. While we leave the detailed study of these hyperparameters to future work, we do compare our default multinomial sampling method, to multinomial beam search sampling which focuses more on high-likelihood regions of the output space.
|
| 320 |
+
|
| 321 |
+
# Algorithm 1 Bidirectional Entailment Clustering
|
| 322 |
+
|
| 323 |
+
Require: context $x$ , set of seqs. $\{ \mathbf { s } ^ { ( 2 ) } , \ldots , \mathbf { s } ^ { ( M ) } \}$ , NLI classifier $\mathcal { M }$ , set of meanings $C = \{ \{ \mathbf { s } ^ { ( 1 ) } \} \}$ for $2 \leq m \leq M$ do for $c \in C$ do $\triangleright$ Compare to already-processed meanings. $\mathbf { s } ^ { ( c ) } c _ { 0 }$ $\triangleright$ Use first sequence for each semantic-class. $\cdot \mathbf { e f t } \gets \mathcal { M } ( \mathrm { c a t } ( x , \mathbf { s } ^ { ( c ) } , \mathbf { \tilde { \phi } } ^ { * } \mathbf { < g / > } ^ { , } , x , \mathbf { s } ^ { ( m ) } ) )$ . Does old sequence entail new one? $\mathbf { r i g h t } \mathcal { M } ( \mathrm { c a t } ( x , \mathbf { s } ^ { ( m ) } , \mathbf { \allowbreak \mathbf { \mu } } ^ { * * } \mathbf { < g } / \mathrm { > } ^ { , , } , x , \mathbf { s } ^ { ( c ) } ) )$ $\triangleright$ Vice versa? if left is entailment and right is entailment then c ← c S s ( m ) . Put into existing class. end if end for C ← C S{s(m)} . Semantically distinct, gets own class. end for return $C$
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
Figure 4: CoQA temperature ablation. (bottom) Similar to TriviaQA, higher temperatures mean higher diversity and lower accuracy. (top) The best performance for both methods comes at a temperature of 0.5. Unlike TriviaQA, normalised entropy outperforms semantic entropy at high temperatures.
|
| 327 |
+
|
| 328 |
+
In Table 4 we show that multinomial beam search sampling yields uncertainty measures that are less predictive of model accuracy than multinomial sampling. Beam search also generates much less diverse samples. We conjecture that multinomial beam search sampling focuses too much on the most likely sequences. The diversity of this beam search corresponds to the lowest temperature result in Fig. 4. As in the main body of the paper, we measure diversity as the average lexical overlap of the answers in the answer set. Additionally, we investigate, why the semantic entropy underperforms the length-normalised entropy at high temperatures. To that end, we manually inspect and label 100 classifications of our semantic equivalence method at $\mathrm { T } { = } 1 . 5$ , and we find that at these temperatures, many of the generated model answers are nonsensical combinations of words from the context that is provided for the question. While the likelihood of these sequences still seems somewhat predictive of the model’s accuracy, semantic clustering becomes very difficult and an unreliable signal for uncertainty estimation. At this temperature, the accuracy of the semantic equivalence methods is only $61 \%$ , whereas it is over $92 \%$ at lower temperatures (see Appendix B.2)
|
| 329 |
+
|
| 330 |
+
Note, that at low-temperatures, where one does gets plausible and well-formed model generations, semantic entropy does clearly outperform the baselines. This finding further underlines the importance of choosing appropriate sampling hyper-parameters when using entropy-based uncertainty measures in NLG.
|
| 331 |
+
|
| 332 |
+
Table 4: Multinomial beam search sampling produces sampled answers that are less diverse and thus less useful for uncertainty estimation than multinomial sampling.
|
| 333 |
+
|
| 334 |
+
<table><tr><td>Sampling method</td><td>Semantic Entropy AUROCDiversity of answers</td><td></td></tr><tr><td>Multinomial sampling</td><td>0.758</td><td>0.490</td></tr><tr><td>Multinomial beam search sampling</td><td>0.735</td><td>0.258</td></tr></table>
|
| 335 |
+
|
| 336 |
+
# B EXPERIMENTAL DETAILS AND ABLATIONS
|
| 337 |
+
|
| 338 |
+
We use both the OPT models2 and the Deberta-large model3 via the HuggingFace transformers library which can be easily adopted for reproducibility. All of our code is open-source and relies on no proprietary models.
|
| 339 |
+
|
| 340 |
+
We use the following functions of the HuggingFace API to sample the most likely answers, and the set of answers:
|
| 341 |
+
|
| 342 |
+
• To obtain the answer which is compared to the reference answer, which determines whether the question is correctly answered, we use beam search using the generate() function with num beams $\ c = ~ 5$ and do $- s \mathsf { a m p l e \Lambda } = \mathsf { \Lambda } \mathtt { T r u e }$ .
|
| 343 |
+
• To obtain the answer set for uncertainty estimation, by default we use multinomial sampling, that is generate() using do sample $=$ True and num beams $\ c = \ 1$ . If indicated explicitly, we use beam multinomial sampling, that is generate() using num beams $\ c = ~ 5$ and do sample $=$ True.
|
| 344 |
+
|
| 345 |
+
We run all of our experiments on 80GB NVIDIA A100s.
|
| 346 |
+
|
| 347 |
+
Testing up to 20 samples per answer on the 2.7B, 6.7B and 13B CoQA experiments, we conclude that using more than 10 samples does not significantly improve the performance of the uncertainty measure, we use 10 sampled answers per question in the remaining experiments on TriviaQA. Note, that in Table 2 we compare the 30B model on CoQA and TriviaQA where in both settings we use answer sets of size 10.
|
| 348 |
+
|
| 349 |
+
We use the following prompts on CoQA and TriviaQA. We find that on CoQA, we obtain accurate model results with zero-shot prompting. While we have to use few-shot prompting to obtain accurate answers on closed-book TriviaQA. We use the following prompts for each of the settings:
|
| 350 |
+
|
| 351 |
+
# CoQA:
|
| 352 |
+
|
| 353 |
+
[The provided context paragraph] [additional question-answer pairs] Q: [Provided question] A:
|
| 354 |
+
|
| 355 |
+
where additional question-answer pairs are preceding turns of the conversation about the paragraph consisting of questions and reference answers.
|
| 356 |
+
|
| 357 |
+
# TriviaQA:
|
| 358 |
+
|
| 359 |
+
For TriviaQA, we use a 10-shot prompt of the format:
|
| 360 |
+
|
| 361 |
+
Q: Which Oscar-nominated film had You Sexy Thing as its theme song? A: The Full Monty Q: Which Joan’s career revived in Whatever Happened to Baby Jane? A: Crawford Q: Which much-loved actor won the Best Actor Oscar for The Philadelphia Story? A: James Stewart (...) Q: In which river is the Boulder Dam? A:
|
| 362 |
+
|
| 363 |
+
To account for generations where the model continues the Q:...A:... pattern after providing an answer to the given question, we trim all generations by pattern matching for a selection of stopwords that we observe in the generations: Q:, Question:, QUESTION: and questions:.
|
| 364 |
+
|
| 365 |
+
Table 5: Automatic evaluation of question answering is highly accurate as compared to human evaluation. We evaluate how accurate the automatic evaluation metric. The predictions, in this settings are the automatically determined accuracy labels on our question answering task, and the ground truth are human labels for the accuracy of the provided model generation given the reference answer
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Data set</td><td> Accuracy of automatic evaluation</td></tr><tr><td>CoQA</td><td>0.89</td></tr><tr><td>TriviaQA</td><td>0.96</td></tr></table>
|
| 368 |
+
|
| 369 |
+
Table 6: TriviaQA: the exact choice of accuracy metric for the free-form QA task has little effect on the assessment of the quality of the uncertainty measure.
|
| 370 |
+
|
| 371 |
+
<table><tr><td rowspan="2">Metric</td><td colspan="2">AUROC</td><td rowspan="2">Accuracy</td></tr><tr><td>Semantic entropy</td><td>Normalised entropy</td></tr><tr><td>Rouge-L(y,y') > 0.3</td><td>0.828</td><td>0.802</td><td>0.506</td></tr><tr><td>Rouge-L(y,y) > 0.5</td><td>0.835</td><td>0.810</td><td>0.456</td></tr><tr><td>Rouge-1(y,y') > 0.5</td><td>0.835</td><td>0.810</td><td>0.457</td></tr><tr><td>Exact matching</td><td>0.828</td><td>0.808</td><td>0.394</td></tr></table>
|
| 372 |
+
|
| 373 |
+
# B.1 RELIABILITY OF ACCURACY METRIC AS COMPARED TO HUMAN EVALUATION
|
| 374 |
+
|
| 375 |
+
In our experiments, we evaluate how well our uncertainty measures predict the model’s accuracy when answering a given question. The choice of accuracy metric is thus a crucial component of our experimental setup. Generally, it has been shown to be difficult to develop automatic metrics for free-form generation that correlate well with human evaluations. We thus verify our choice of accuracy criterion: Rouge- $\mathbf { \cdot L } ( y , y ^ { \prime } ) > 0 . 3$ , for a given reference answer $y$ and a model generation $y ^ { \prime }$ . We manually evaluate the accuracy of 200 answers of the 30B parameter model on both COQA and on TriviaQA, and evaluate how closely the human evaluation matches the automatic evaluation. We find that on both data sets, the accuracy of the automatic labels as compared to the human labels as the ground truth is high, see Table 5.
|
| 376 |
+
|
| 377 |
+
# B.2 TESTING THE BI-DIRECTIONAL ENTAILMENT CLASSIFIER
|
| 378 |
+
|
| 379 |
+
To the best of our knowledge, this paper is the first application of the bi-directional entailment approach to identifying answers with the same meaning in question answering. Since this is a core component of our approach, we verify how accurately this approach identifies model answers with the same meaning. To this end, we manually label 300 samples for each of TriviaQA and CoQA produced by the 13B parameter model to provide a ground truth as to whether or not they mean the same thing. We find that the model achieves an accuracy of $9 2 . 7 \%$ and $9 5 . 3 \%$ respectively.
|
| 380 |
+
|
| 381 |
+
# B.3 SENSITIVITY OF RESULTS TO ACCURACY METRIC
|
| 382 |
+
|
| 383 |
+
In principle, the choice of metric to decide whether or not an answer is ‘correct’ might have a large effect on the assessment of our method and baselines. However, we find empirically that our results are relatively insensitive to the choice of accuracy metric.
|
| 384 |
+
|
| 385 |
+
In Table 6 we show that for TriviaQA the choice of accuracy metric for the question answering has almost no effect on the measured AUROC of the uncertainty estimation, despite making the measured accuracy of the model’s generation significantly different. In particular, the exact matching requirement reduces the accuracy significantly but has little effect on the AUROCs.
|
| 386 |
+
|
| 387 |
+
For CoQA, which is an open-book QA task with greater answer variability and longer answers the results are broadly similar (see Table 7) except for the exact matching accuracy criterion which is too demanding because of the much larger variety of possible answers for this task.
|
| 388 |
+
|
| 389 |
+
Table 7: CoQA: the exact choice of the accuracy metric for the free-form open-book QA task has little effect on the assessment of the quality of the uncertainty measure except for the use of exact matching. For CoQA, getting an exact match is significantly harder.
|
| 390 |
+
|
| 391 |
+
<table><tr><td rowspan="2">Metric</td><td colspan="2">AUROC</td><td rowspan="2">Accuracy</td></tr><tr><td>Semantic entropy</td><td>Normalised entropy</td></tr><tr><td>Rouge-L(y,y') > 0.3</td><td>0.7672</td><td>0.7533</td><td>0.8239</td></tr><tr><td>Rouge-L(y, y) > 0.5</td><td>0.7379</td><td>0.7290</td><td>0.7657</td></tr><tr><td>Rouge-1(y,y) > 0.3</td><td>0.7672</td><td>0.7533</td><td>0.8239</td></tr><tr><td>Rouge-1(y,y) > 0.5</td><td>0.7397</td><td>0.7309</td><td>0.7677</td></tr><tr><td>Exact matching</td><td>0.6749</td><td>0.6727</td><td>0.6459</td></tr></table>
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 5: Accuracy improves with model size, as does semantic entropy’s uncertainty performance. At the smallest model size, both accuracy and uncertainty diminish.
|
| 395 |
+
|
| 396 |
+
# B.4 ACCURACY ABLATIONS WITH MODEL SIZE
|
| 397 |
+
|
| 398 |
+
We confirm that increasing the model size improves the accuracy of the generations on both QA datasets (see Fig. 5a and Fig. 5b). Semantic entropy’s uncertainty performance is also shown for context.
|
| 399 |
+
|
| 400 |
+
# B.5 EXAMPLE P(TRUE) FORMAT
|
| 401 |
+
|
| 402 |
+
The format of the prompt, reproduced here for convenient reference from the original source Kadavath et al. (2022), is:
|
| 403 |
+
|
| 404 |
+
Question: Who was the third president of the United States?
|
| 405 |
+
Here are some brainstormed ideas: James Monroe
|
| 406 |
+
Thomas Jefferson
|
| 407 |
+
John Adams
|
| 408 |
+
Thomas Jefferson
|
| 409 |
+
George Washington
|
| 410 |
+
Possible Answer: James Monroe
|
| 411 |
+
Is the possible answer:
|
| 412 |
+
(A) True
|
| 413 |
+
(B) False
|
| 414 |
+
The possible answer is:
|
| 415 |
+
|
| 416 |
+
where the “brainstormed answers” are from the set of sampled answers A and P(True), i.e. the likelihood of the next token being True is taken as the uncertainty measure. The authors note that doing the above needs to be done in a few-shot manner and does not work well as in a zero-shot format. In our experiments, we use a few-shot prompt with 10 examples.
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 6: The margin probability, i.e. the difference between the likelihood of the most likely answer and the likelihood of the second most likely answer, is not very predictive of models’ accuracy on CoQA open-book question answering (a) nor on TriviaQA (b). Identical to Fig. 2 with the addition of Margin probability which was previously omitted to avoid stretching the scale.
|
| 420 |
+
|
| 421 |
+
# B.6 MARGIN-PROBABILITY BASELINE
|
| 422 |
+
|
| 423 |
+
We additionally compare our method to the margin probability method used for neural-symbolic parsing in Lin et al. (2022b):
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
{ \mathcal { H } } _ { \operatorname* { m a r g i n } } ( p ( { \pmb y } \mid { \pmb x } , { \mathcal { D } } ) ) = p \left( { \pmb y } ^ { ( 1 ) } \mid { \pmb x } , { \mathcal { D } } \right) - p \left( { \pmb y } ^ { ( 2 ) } \mid { \pmb x } , { \mathcal { D } } \right) ,
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
where $\mathbf { y } ^ { ( 1 ) }$ is the top-1 beam search result and $\mathbf { y } ^ { ( 2 ) }$ is the top-2 beam search result.
|
| 430 |
+
|
| 431 |
+
Initially, running the method as proposed in Lin et al. (2022b) using a 13B parameter model on CoQA, we find that $\mathcal { H } _ { \mathrm { m a r g i n } }$ is not very predictive of the model’s accuracy on answering questions in CoQA achieving an AUROC of 0.54.
|
| 432 |
+
|
| 433 |
+
We hypothesise that two factors contribute to this poor performance. First, since this measure only looks at the difference of likelihoods, the information about the magnitude of the likelihood of a given answer is lost. Second—analogously to the predictive entropy—it would be important to take semantic uncertainty into account when computing $\mathcal { H } _ { \mathrm { m a r g i n } }$ . Manually inspecting model answers on CoQA, and the corresponding $\mathcal { H } _ { \mathrm { m a r g i n } }$ , we see that the margin between two semantically equivalent answers and two semantically distinct answers is often similar. That is, this measure does not distinguish between uncertainty between paraphrases of the same meaning (in which case the model might actually be confident about meaning of the answer), and the model’s uncertainty about which semantically distinct meaning is correct.
|
| 434 |
+
|
| 435 |
+
We find that if instead of obtaining $\mathbf { y } ^ { ( 1 ) }$ and $\mathbf { y } ^ { ( 2 ) }$ by multinomial sampling (as in our other experiments) instead of by beam search, this second problem becomes less pronounced and $\mathcal { H } _ { \mathrm { m a r g i n } }$ performs better while still being clearly outperformed by the other methods we study. We report our full results in Fig. 6.
|
| 436 |
+
|
| 437 |
+
Table 8: Example of challenges for $\mathcal { H } _ { \mathrm { m a r g i n } }$ . $\mathcal { H } _ { \mathrm { m a r g i n } }$ does not distinguish between lexical and semantic uncertainty and thus can not distinguish cases where the model is certain about the correct answer (but uncertain about the precise formulation) as in row 1, and cases where the model is uncertain about the correct answer as in row 2. The semantic entropy correctly indicates low uncertainty in the first case and high uncertainty in the second case.
|
| 438 |
+
|
| 439 |
+
<table><tr><td>y(1)</td><td>y(2)</td><td>Hmargin</td><td>Semantic entropy</td></tr><tr><td>Thomas Edison.</td><td>Edison.</td><td>0.90</td><td>0.10</td></tr><tr><td>Thomas.</td><td>George.</td><td>0.36</td><td>0.87</td></tr></table>
|
md/dev/Vota6rFhBQ/Vota6rFhBQ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/XA4ru9mfxTP/XA4ru9mfxTP.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Unifying Voxel-based Representation with Transformer for 3D Object Detection
|
| 2 |
+
|
| 3 |
+
Yanwei Li1 Yilun Chen1 Xiaojuan Qi2 Zeming Li3 Jian Sun3 Jiaya Jia1,4
|
| 4 |
+
|
| 5 |
+
The Chinese University of Hong Kong1 The University of Hong Kong2 MEGVII Technology3 SmartMore4
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
In this work, we present a unified framework for multi-modality 3D object detection, named UVTR. The proposed method aims to unify multi-modality representations in the voxel space for accurate and robust single- or cross-modality 3D detection. To this end, the modality-specific space is first designed to represent different inputs in the voxel feature space. Different from previous work, our approach preserves the voxel space without height compression to alleviate semantic ambiguity and enable spatial connections. To make full use of the inputs from different sensors, the cross-modality interaction is then proposed, including knowledge transfer and modality fusion. In this way, geometry-aware expressions in point clouds and context-rich features in images are well utilized for better performance and robustness. The transformer decoder is applied to efficiently sample features from the unified space with learnable positions, which facilitates object-level interactions. In general, UVTR presents an early attempt to represent different modalities in a unified framework. It surpasses previous work in single- or multi-modality entries. The proposed method achieves leading performance in the nuScenes test set for both object detection and the following object tracking task. Code is made publicly available at https://github.com/dvlab-research/UVTR.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Detecting 3D objects with multi-modality sensors (i.e., LiDAR and camera) is regarded as a fundamental task in real-world scenes. For accurate object detection, data from different modalities are utilized to provide complementary knowledge, like accurate positions from point clouds and rich context from images. Toward this purpose, a unified representation is essential to facilitate knowledge transfer and feature fusion across modalities. However, due to the lack of accurate depth from cameras, images can not be naturally represented in voxel space like that of point clouds.
|
| 14 |
+
|
| 15 |
+
In the unified progress, several representations have been studied that can be roughly separated into input- and feature-level streams. For the first one, multi-modality data is aligned at the beginning of network. In particular, pseudo point clouds in Figure 1a are transformed from image aided by predicted depth [1, 2], while the range-view image in Figure 1b is projected from point clouds [3, 4]. Because of inaccurate depth in pseudo point clouds and collapsed 3D geometry in range-view images, the spatial structure of data is damaged, which brings inferior results. For feature-level method, a typical approach is to transform image features as frustum and then compress to BEV space [5, 6], like that in Figure 1c. However, due to ray-like trajectories in the frustum [7], height compression at each position aggregates features from various objects and thus introduces semantic ambiguity. Meanwhile, other implicit manners in contemporary work [8, 9, 10] can hardly support explicit feature interactions in 3D space and restrict further knowledge transfer. Therefore, a more unified representation is desired to bridge modality gap and facilitate interactions from multiple aspects.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Toy example of methods for unified representation. Compared with others, the proposed manner in 1d constructs the voxel space by sampling features from the image plane and represents multi-modalities uniformly without height-level compression in 1c that brings semantic ambiguity.
|
| 19 |
+
|
| 20 |
+
In this paper, we present a simple yet effective framework to unify the voxel-based representation with transformer, called UVTR. In particular, features from images and point clouds are represented and interacted in the explicit voxel-based space. For images, we construct the voxel space by sampling features from the image plane according to predicted depth scores and geometric constraints, as briefly depicted in Figure 1d. For point clouds, the accurate position naturally allows us to associate features with voxels. Then, voxel encoder is introduced for spatial interaction that establishes the relationship among adjacent features. In this way, cross-modality interaction is naturally conducted with features in each voxel space. For object-level interaction, deformable transformer [11] is adopted as the decoder that samples specific feature for each object query with position $( x , y , z )$ in the unified voxel space, as illustrated in Figure 1d. Meanwhile, the introduction of 3D query position efficiently alleviates the semantic ambiguity brought by height compression in BEV space as analysed before.
|
| 21 |
+
|
| 22 |
+
Compared with previous and even concurrent studies [8, 9], more key advances can be achieved with the proposed framework. First, the explicit voxel-based representation supports spatial interaction in 3D space and multi-frame scenes that bring significant improvements. Second, the proposed unified manner facilitates cross-modality learning and can be naturally applied for knowledge transfer and feature fusion, which further boosts the performance. Finally, data augmentation for both modalities can be directly synchronized in the voxel space without the complex aligning process [12, 7].
|
| 23 |
+
|
| 24 |
+
The overall framework, called UVTR, can be easily instantiated and improved with various imageor voxel-based backbones for single- and multi-modality 3D object detection. Extensive empirical studies are conducted in Section 4 to reveal the effect of each component. The proposed UVTR attains leading performance in various settings. For detection, it achieves $6 9 . 7 \%$ , $5 5 . 1 \%$ , and $7 1 . 1 \%$ NDS on nuScenes test set with point clouds, images, and multi-modality inputs, respectively. Given naive association strategy, UVTR also achieves strong tracking results with $6 7 . 0 \%$ , ${ \mathfrak { s } } 1 . 9 \%$ , and $7 0 . 1 \%$ AMOTA on LiDAR-based, camera-based, and multi-modality setting, respectively.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
LiDAR-based 3D Detection. With point clouds captured from LiDAR, traditional methods process the irregular input and generate 3D boxes with different representations, e.g., point, voxel, and range view. Point-based detectors usually aggregate features from raw point clouds with set abstraction [13] and then predict box proposals [14, 15, 16]. For voxel-based methods, point clouds are transformed into regular grids and processed with 3D sparse convolutions [17, 18] or 2D convolutions [19, 20, 21] directly. Final predictions are usually generated on top of the bird-eye view (BEV) space with the flatted height axis [22, 23, 24]. There are also studies [3, 4] that project point clouds to range view and process them like images. However, due to the collapsed 3D geometry in range-view images, the relationship in point clouds cannot be fully explored. In this work, we follow the voxel-based pipeline but keep the fine-grained voxel space without height compression, as shown in Figure 2.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: The framework of UVTR with multi-modality input. Given single- or multi-frame images and point clouds, we first process them in individual backbone and convert to modality-specific space $\mathbf { V } _ { I }$ and $\mathbf { V } _ { P }$ , where view transform is utilized for that of image. In voxel encoder, features are spatially interacted, and knowledge transfer is easily supported during training. Single- or multi-modality features are selected via modality switch according to different settings. Finally, transformer decoder is utilized for prediction by sampling features from the unified space $\mathbf { V } _ { U }$ with learnable positions.
|
| 32 |
+
|
| 33 |
+
Camera-based 3D Detection. Camera-based methods perform 3D detection on single- or multi-view images. With monocular image, previous approaches try to predict 3D boxes based on image features directly [25, 26, 27] or utilize the middle representation [1, 2, 5]. For multi-view input, image features are usually optimized in the constructed 3D geometry volume [28, 29]. Most recently, multi-view features are projected and merged in the frustum feature space with the aid of predicted depth [6]. Following the LiDAR-based paradigm, the frustum feature is collapsed to the BEV space, as briefly introduced in Figure 1c. However, the accuracy of the predicted depth map is much inferior to that of LiDAR, which brings semantic ambiguity to BEV space. Other recent studies try to capture geometry clues from multi-view images in an implicit manner [8, 10], which losses the chance for direct spatial interactions. In this paper, we represent image features in an explicit voxel space to alleviate the semantic ambiguity and facilitate further feature interactions, as depicted in Figure 1d.
|
| 34 |
+
|
| 35 |
+
Cross-modality Interaction. With input data from various sensors, cross-modality interaction is conducted to benefit from different inputs, e.g., modality fusion and knowledge transfer. For modality fusion, the model takes data from different sensors and conducts fusion at point- and instance-level. Specifically, point-level fusion [30, 31, 32, 7] combines features from different modalities at the early stage of the network, which enables sufficient interaction. And instance-level fusion [33, 34, 35] is usually applied at the later stage to combine object-level features. Cross-modality knowledge transfer aims to distill specific knowledge [36] across modalities in the training phase. Compared with cross-modality fusion, knowledge transfer is seldom studied for 3D object detection. A prior work is LIGA-Stereo [37] that transfers geometry-aware representations from LiDAR to stereo images via distillation. Different from [37], UVTR represents each modality in a unified manner and supports cross-modality fusion and knowledge transfer simultaneously, which further enables distillation from multi-modality or consecutive frames to the single input.
|
| 36 |
+
|
| 37 |
+
# 3 UVTR Framework
|
| 38 |
+
|
| 39 |
+
The overall framework of UVTR is relatively simple: modality-specific space is constructed to unify the representation of inputs; cross-modality interaction is designed for feature learning across spaces; and transformer decoder is introduced for object-level interaction and final prediction.
|
| 40 |
+
|
| 41 |
+
# 3.1 Modality-specific Space
|
| 42 |
+
|
| 43 |
+
Given images $\mathbf { X } _ { I }$ captured from cameras and point cloud $\mathbf { X } _ { P }$ from LiDAR, different branches are utilized to respectively generate and enhance voxel space for each modality, as presented in Figure 2.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 3: Details in the view transform.
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 4: Details in the knowledge transfer.
|
| 50 |
+
|
| 51 |
+
Image Voxel Space. For image voxel space, a shared backbone is adopted to extract features from multi-view or multi-frame images. In this process, FPN [38] is utilized for multi-scale context aggregation that is summed to formulate the feature $\mathbf { F } _ { I } \in \mathbb { R } ^ { \bar { H } \times W \times C }$ , where $H$ and $W$ vary with FPN stages. To construct the voxel feature for images, we then transform the image feature of each view to the predefined space with the designed view transform in Figure 3. Motivated by [39, 5], we first generate the depth distribution $\mathbf { D } _ { I } \in \mathbf { \mathbb { R } } ^ { D \times H \times W }$ of each image with a single convolution as
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathbf D _ { I } ( u , v ) = \mathrm { S o f t m a x } ( \mathrm { C o n v } ( \mathbf F _ { I } ) ( u , v ) ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Here, $( u , v )$ indicates coordinate in the image plane, and $D$ is set to 64 to represent the perception limit $6 4 m$ . It is noted that $\mathbf { D } _ { I }$ is predicted without supervision. With the predicted $\mathbf { D } _ { I }$ in $D$ depth bins, we can easily get the depth distribution of each pixel in ${ \bf F } _ { I }$ . Let $( x , y , z )$ indicates a sampling point that is generated at the center of each bin from the voxel space $\mathbf { V } _ { I }$ . The point $( u , v , d )$ in the image plane is calculated from $( x , y , z )$ with the calibration matrix $\mathbf { P }$ , where $d$ denotes the reference depth along axis $D$ of $\mathbf { D } _ { I }$ . Thus, the corresponding feature in voxel space $\mathbf { V } _ { I }$ is easily captured by
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
{ \bf V } _ { I } ( x , y , z ) = { \bf D } _ { I } ( u , v , d ) \times { \bf F } _ { I } ( u , v ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $ { \mathbf Ḋ I Ḍ } ( u , v , d )$ represents the occupancy probability of feature ${ \mathbf { F } } _ { I } ( u , v )$ in voxel $( x , y , z )$ . For the multi-frame setting with $n$ sweeps, we use the shared network for all of them and formulate $n$ voxel spaces in total. In this process, each calibration matrix $\mathbf { P }$ is aligned to the ego vehicle in the initial frame. To gather temporal cues in each voxel space, relative time offsets from the initial frame are attached along the channel axis and merged using a single convolution. Then, $n$ voxel spaces are concatenated together, and the space-level fusion is conducted with a convolutional layer. In this way, features along the temporal dimension are integrated into a unified space $\mathbf { V } _ { I }$ , which is proved to bring significant gain in Table 3. Different from methods [5, 6] for BEV space, we preserve the 3D voxel space without collapsing in $Z$ axis to avoid the aforementioned semantic ambiguity and enable further interactions. The effectiveness of the 3D voxel space is empirically studied in Table 1.
|
| 64 |
+
|
| 65 |
+
Point Voxel Space. With the accurate position, we naturally split point cloud $\mathbf { X } _ { P }$ into several regular voxels. Then, the voxel backbone in Figure 2 is utilized to process input voxels with sparse convolution [17]. To enhance multi-scale features in the generated voxel space, parallel heads with various strides are designed to extract feature $\mathbf { F } _ { P }$ from the output. In particular, several 2D convolutions are applied in each head to aggregate the spatial cues at each height. Then, multi-scale features are upsampled to a same resolution and summed together to formulate the voxel space $\mathbf { V } _ { P } \in \mathbb { R } ^ { X \times Y \times Z \times C ^ { \bullet } }$ . For multi-frame setting with $n$ sweeps, we follow previous work [24] and attach all point clouds together with relative time offsets to formulate the input $\mathbf { X } _ { P }$ .
|
| 66 |
+
|
| 67 |
+
Due to the accurate position of point cloud, the semantic ambiguity in $Z$ axis is much reduced compared with that of images. But we still preserve the 3D space $\mathbf { V } _ { P }$ without height compression for convenient cross-modality interaction in Section 3.2 and fine-grained object interaction in Section 3.3. This is also proved to bring superior experimental results in Table 1.
|
| 68 |
+
|
| 69 |
+
Voxel Encoder. In the above-generated space $\mathbf { V } _ { I }$ , features of adjacent voxels projected from different views have no connection with each other. To solve this issue and facilitate local feature interaction, the voxel encoder is proposed in each voxel space, as presented in Figure 2. Specifically, we keep the simplicity of UVTR, and only three basic convolutional blocks are applied in each voxel encoder of Figure 4. In this process, features in each space $\mathbf { V } _ { I }$ or $\mathbf { V } _ { P }$ are aggregated in both coplanar and vertical dimensions. The spatial interaction in voxel space establishes connections among adjacent features, which is proved to be essential in Table 2, especially for $\mathbf { V } _ { I }$ .
|
| 70 |
+
|
| 71 |
+
# 3.2 Cross-modality Interaction
|
| 72 |
+
|
| 73 |
+
With the unified representation in space $\mathbf { V } _ { I }$ and $\mathbf { V } _ { P }$ , interactions across modalities can be easily conducted. Given the prior that LiDAR is advanced in localization and cameras provide context for classification, the cross-modality interaction is proposed from two separate aspects, i.e., transferring geometry-aware knowledge to images in a single-modality setting and fusing context-aware features with point clouds in a multi-modality setting. In particular, knowledge transfer aims to optimize the features of the student with guidance from the teacher in the single-modality setting. Meanwhile, modality fusion is designed to better utilize all modalities in both training and inference stages.
|
| 74 |
+
|
| 75 |
+
Knowledge Transfer. Considering single modality input in the inference stage, knowledge transfer is first designed to optimize features of the student with guidance from the teacher during training, which is important in an environment that lacks multi-modality data. Due to inherent properties, the geometry structure contained in images can be further exploited with the aid of point clouds, while the rich context in images can hardly be transferred to sparse point clouds. Therefore, we mainly focus on transferring knowledge from the geometry-rich modality to the poor one in this work. Benefiting from unified feature spaces, the cross-modality transfer can be easily supported, as illustrated in Figure 4. In particular, we take features before the last ReLU layer in the voxel encoder of $\mathbf { V } _ { P }$ as the geometry-rich teacher, marked as $\mathbf { T } _ { P }$ . Meanwhile, the feature in the same position of $\mathbf { V } _ { I }$ is taken as the geometry-poor student, denoted as $\mathbf { S } _ { I }$ . If we take one object query position $( x , y , z )$ from Section 3.3, the feature distance for knowledge transfer is formulated as
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
d _ { K T } = P L _ { 2 } ( { \bf T } _ { P } ( x , y , z ) , { \bf S } _ { I } ( x , y , z ) ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $P L _ { 2 }$ represents the partial $L _ { 2 }$ distance [40]. Without bells-and-whistles, the optimization objective for knowledge transfer is averaged from $N$ object queries of transformer decoder in Section 3.3, namely $\begin{array} { r } { \mathcal { L } _ { K T } = \frac { 1 } { N } \sum _ { i } ( d _ { K T } ) } \end{array}$ . It should be noted that the whole network is optimized in an end-to-end manner, with no need for extra procedures. Given the object position in each query, we can directly minimize the object-level distance with no need to exclude background features like [37]. In a similar pipeline, the knowledge transfer is further extended to support more input streams, like multi-frame images. The proposed cross-modality knowledge transfer is flexible with input modalities and brings consistent gains over various baselines in Tables 5 and 7.
|
| 82 |
+
|
| 83 |
+
Modality Fusion. Different from the knowledge transfer, modality fusion aims to better utilize all modalities in both training and inference stages, which utilizes the complementary knowledge of point cloud and images to improve the performance and robustness. Thanks to the unified representation of each modality, feature fusion can be naturally applied. To be specific, given the processed feature space $\mathbf { V } _ { I } ^ { \prime }$ and $\mathbf { V } _ { P } ^ { \prime }$ , we first select candidate modality for final prediction via modality switch, as depicted in Figure 2. That means we support single- or multi-modality input for prediction according to different settings. If both modalities are taken, $\mathbf { V } _ { I } ^ { \prime }$ and $\mathbf { V } _ { P } ^ { \prime }$ are added together to formulate the unified voxel space $\mathbf { V } _ { U } \in \mathbb { R } ^ { X \times Y \times Z \times C }$ . In this way, both modalities are well expressed in a unified manner, which can be further fused with a single convolution. The space $\mathbf { V } _ { U }$ unifies modalities with the explicit representation, which provides an expressive space for object interactions in Section 3.3.
|
| 84 |
+
|
| 85 |
+
# 3.3 Transformer Decoder
|
| 86 |
+
|
| 87 |
+
To obtain accurate and robust predictions, the transformer decoder is utilized for further object-level interaction in the unified voxel space $\mathbf { V } _ { U }$ . We draw inspirations from deformable DETR [11] and apply reference positions to efficiently sample representative features, regardless of the spatial size of 3D voxel spaces. In particular, we first initialize $N$ object queries $\mathbf { \bar { Q } } \in \mathbb { R } ^ { N \times C }$ and generate $N$ reference points from object query embedding. Then, object queries are interacted with each other in the self-attention module and summed via skip-connection, as shown in Figure 2. Let $q$ represents a specific query in $\mathbf { Q }$ with corresponding reference point $p = ( x , y , z )$ . The process of the cross-attention module in Figure 2 is modeled as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathrm { C r o s s A t t n } ( q , { \mathbf { V } } _ { U } ( p ) ) = \mathrm { D e f o r m A t t n } ( q , p , { \mathbf { V } } _ { U } ) ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where ${ \bf V } _ { U } ( p )$ denotes the sampled feature at $( x , y , z )$ of $\mathbf { V } _ { U }$ , and DeformAttn indicates the deformable attention in [11]. With the feed-forward network and normalization, each object query can easily interact with unified features from $\mathbf { V } _ { U }$ inside each block. There are total $M$ blocks in the transformer decoder, where $M$ is respectively set to 3 and 6 for LiDAR-based and camera-based settings. Finally, a shared MLP head is utilized for prediction according to the output of each block. And iterative box refinement [11, 8] is applied to refine 3D bounding boxes based on the predictions.
|
| 94 |
+
|
| 95 |
+
# 3.4 Optimization Objectives
|
| 96 |
+
|
| 97 |
+
Following a general paradigm in recent transformers [41, 11], Hungarian algorithm [42] is adopted for one-to-one target assignment in the training phase. Thus, a set-to-set loss $\mathcal { L } _ { D e t }$ is computed to optimize detection results, including box regression loss and classification loss. If knowledge transfer is applied, the loss $\mathcal { L } _ { K T }$ is contained to reduce cross-modality feature distance with a weight 0.01.
|
| 98 |
+
|
| 99 |
+
# 4 Experiments
|
| 100 |
+
|
| 101 |
+
In this section, we first introduce our detailed experimental setup. Then, analyses of each component are conducted on different modalities. Comparisons with several leading benchmarks on the nuScenes [43] dataset are presented in the end. More results are attached in supplementary material.
|
| 102 |
+
|
| 103 |
+
# 4.1 Experimental Setup
|
| 104 |
+
|
| 105 |
+
Dataset. nuScenes [43] dataset is a large-scale benchmark for autonomous driving, which is widely adopted for single- or multi-modality 3D object detection. It contains 700, 150, 150 scenes in the train, val, and test set, respectively. We use the synced data with 10 object categories that are captured from a 32-beam LiDAR at $2 0 \mathrm { H z }$ and six cameras in a 360-degree field of view at $1 2 \mathrm { H z }$ . Only annotations of keyframes are given at $2 \mathrm { H z }$ . Here, ablation studies are optimized on a mini 1/4 train split by default, and final models are optimized on the whole train set.
|
| 106 |
+
|
| 107 |
+
Implementation Details. In this work, we conduct experiments on different modalities with 900 object queries $\mathbf { Q }$ . Constructed voxel spaces $\mathbf { V } _ { I }$ , $\mathbf { V } _ { P }$ , and $\mathbf { V } _ { U }$ share the same shape $1 2 8 \times 1 2 8 \times Z$ , where $Z$ indicates the height of voxel space and is further investigated in Table 1. The channel number $C$ in voxel spaces and transformer decoder is set to 256. And the amount of block $M$ in the decoder is set to 3, 6, and 6 for LiDAR-based, camera-based, and fusion settings, respectively. In particular, for the LiDAR-based setting, only the branch with voxel space $\mathbf { V } _ { P }$ is kept. With grid size $0 . 1 m$ , the input point clouds are filtered in range $[ - 5 1 . 2 m , 5 1 . 2 m ]$ for $X$ and $Y$ axis with $[ - 5 . 0 m , 3 . 0 m ]$ for $Z$ axis. While for grid size $0 . 0 7 5 m$ , the range in $X$ and $Y$ axis is modified to $[ - 5 4 . 0 m , 5 4 . 0 m ]$ . The framework is trained with AdamW optimizer with an initial learning rate $2 e ^ { - 5 }$ for 20 epochs. For a camera-based setting, the network is optimized with an initial learning rate $1 e ^ { - 4 }$ for 24 epochs. As for fusion, we initialize two modality-specific branches with corresponding pretrained models and optimize the model with an initial learning rate $4 e ^ { - 5 }$ for 20 epochs. The whole framework is trained in an end-to-end manner with different modalities. More details are given in supplementary material.
|
| 108 |
+
|
| 109 |
+
# 4.2 Component-wise Analysis
|
| 110 |
+
|
| 111 |
+
In this subsection, we use a randomly sampled 1/4 split of nuScenes train set for efficient validation.
|
| 112 |
+
|
| 113 |
+
Effect of Height in Voxel Space. As elaborated in Section 3.1, the height axis $Z$ plays a vital role in voxel space, especially for camera-based $\mathbf { V } _ { I }$ . In Table 1, we validate this with different heights on both modalities. Compared with the BEV space with height 1, the increase in height contributes significantly for camera-based $\mathbf { V } _ { I }$ , which respectively improves $3 . 1 \%$ and $4 . 2 \%$ NDS with height 5 and 11. Consistent with our analysis, the gain brought by increase of height contributes less to that of LiDAR because of the accurate position, which is up to $1 \%$ NDS and $1 . 9 \%$ mAP.
|
| 114 |
+
|
| 115 |
+
Operations in Voxel Encoder. The voxel encoder in Section 3.1 aims to facilitate spatial feature interactions that are essential, especially in the camera-based manner. As presented in Table 2, camera-based network cannot converge if given no spatial interaction. For LiDAR-based network, it performs satisfactorily without the voxel encoder, which can be attributed to the established relations at the early stage. Overall, for both of them, 3D spatial interaction still plays a vital role and improves $2 . 6 \%$ and $0 . 6 \%$ NDS over 2D convolution for the camera- and LiDAR-based methods, respectively.
|
| 116 |
+
|
| 117 |
+
Effect of Multi-frame Input. To further release the potential of the designed paradigm, we input multi-frame sweeps and represent them in each voxel space, as shown in Table 3. With more input frames, networks for both modalities achieve consistent gains. The performance gap reaches $5 \%$ and $1 8 . 1 \%$ NDS for the camera- and LiDAR-based manner with 5 and 10 sweeps, respectively.
|
| 118 |
+
|
| 119 |
+
Networks for Voxel Space. In Table 4, we exploit the network for voxel space generation. It is clear that the deeper network with larger voxel space contributes more to the final result. With ResNet-101 and height 11 for space $\mathbf { V } _ { I }$ , the camera-based method attains nearly $5 \%$ gains over the baseline in both NDS and mAP. For LiDAR-based manner, the model performs slightly better with finer grid size that brings higher resolution to voxel space. It means the image-based voxel space requires strong backbones to extract expressive features, while the LiDAR-based one is less dependent on that.
|
| 120 |
+
|
| 121 |
+
Table 1: Effect of different heights $Z$ in voxel space on nuScenes val set.
|
| 122 |
+
|
| 123 |
+
<table><tr><td>modality</td><td>height</td><td>NDS(%)</td><td>mAP(%)</td></tr><tr><td rowspan="4">Camera</td><td>1</td><td>31.4</td><td>24.9</td></tr><tr><td>5</td><td>34.5</td><td>27.0</td></tr><tr><td>11</td><td>35.6</td><td>28.7</td></tr><tr><td>1</td><td>62.8</td><td>54.4</td></tr><tr><td rowspan="2">LiDAR</td><td>5</td><td>63.8</td><td>55.5</td></tr><tr><td>11</td><td>63.8</td><td>56.3</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Table 2: Effect of different operations in voxel encoder on nuScenes val set.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>modality</td><td>type</td><td>NDS(%)</td><td>mAP(%)</td></tr><tr><td rowspan="3">Camera</td><td>None</td><td>12.0</td><td>2.5</td></tr><tr><td>Conv2D</td><td>31.9</td><td>24.8</td></tr><tr><td>Conv3D</td><td>34.5</td><td>27.0</td></tr><tr><td rowspan="3">LiDAR</td><td>None</td><td>63.1</td><td>54.3</td></tr><tr><td>Conv2D</td><td>63.2</td><td>54.6</td></tr><tr><td>Conv3D</td><td>63.8</td><td>55.5</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Table 3: Effect of different number of frames on nuScenes val set. sweep denotes the sweep number of multi-frame input.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>modality</td><td>sweep</td><td>NDS(%)</td><td>mAP(%)</td></tr><tr><td rowspan="3">Camera</td><td>1</td><td>34.5</td><td>27.0</td></tr><tr><td>3</td><td>38.0</td><td>28.7</td></tr><tr><td>5</td><td>39.5</td><td>29.4</td></tr><tr><td rowspan="2">LiDAR</td><td>1</td><td>45.7</td><td>42.8</td></tr><tr><td>10</td><td>63.8</td><td>55.5</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 4: Effect of different models for voxel space construction on nuScenes val set. H and V denote space height and grid size.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>modality</td><td>voxel net</td><td>NDS(%)</td><td>mAP(%)</td></tr><tr><td rowspan="3">Camera</td><td>R50-H5</td><td>34.5</td><td>27.0</td></tr><tr><td>R50-H11</td><td>35.6</td><td>28.7</td></tr><tr><td>R101-H11</td><td>39.4</td><td>32.0</td></tr><tr><td rowspan="2">LiDAR</td><td>v0.1</td><td>63.8</td><td>55.5</td></tr><tr><td>V0.075</td><td>64.3</td><td>56.3</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 5: Effect of different knowledge transfer settings on nuScenes val set. CS denotes multiframe camera sweeps.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>student</td><td>teacher</td><td>NDS(%)</td><td>mAP(%)</td></tr><tr><td rowspan="5">Camera</td><td>1</td><td>34.5</td><td>27.0</td></tr><tr><td>CS</td><td>36.3</td><td>28.1</td></tr><tr><td>LiDAR</td><td>36.4</td><td>28.2</td></tr><tr><td>Multi-mod</td><td>37.1</td><td>28.8</td></tr><tr><td></td><td>63.8</td><td>55.5</td></tr><tr><td rowspan="2">LiDAR</td><td></td><td></td><td></td></tr><tr><td>Multi-mod</td><td>64.4</td><td>56.1</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 6: Effect of different network settings for cross-modality fusion on nuScenes val set. V denotes the split voxel grid size.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>camera</td><td>lidar</td><td>NDS(%)</td><td>mAP(%)</td></tr><tr><td>R50</td><td>一</td><td>34.5</td><td>27.0</td></tr><tr><td>1</td><td>V0.1</td><td>63.8</td><td>55.5</td></tr><tr><td rowspan="2">R50</td><td>V0.1</td><td>65.1</td><td>59.0</td></tr><tr><td>V0.075</td><td>65.6</td><td>60.1</td></tr><tr><td rowspan="2">R101</td><td>V0.1</td><td>65.4</td><td>59.4</td></tr><tr><td>V0.075</td><td>66.3</td><td>61.0</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Knowledge Transfer. Benefiting from the unified representation, knowledge can be easily transferred across modalities. In Table 5, we compare combinations with different students and teachers. In particular, the camera-based student captures geometry-aware cues from camera sweeps or the LiDAR-based teacher, which brings up to $1 . 9 \%$ NDS gain. If coupled with context features in the multi-modality setting, the gap is enlarged to $2 . 6 \%$ NDS and $1 . 8 \%$ mAP. For the LiDAR-based student, the increase brought by knowledge transfer saturated with $0 . 6 \%$ NDS. This can be attributed to that rich context in images can not be well expressed only with sparse points during inference. Therefore, images are required as input if rich context is supplemented, like the following fusion part.
|
| 146 |
+
|
| 147 |
+
Cross-modality Fusion. In Table 6, we validate capability of UVTR with cross-modality fusion. As presented in the table, feature fusion brings significant gains over a single modality. And the LiDARbased representation dominates the final results, while the camera-based one provides supplementary context. It is reasonable because point clouds are more accurate in position and more representative in geometry expression. Cameras still provide sufficient context for better classification, which yields up to $1 . 6 \%$ NDS and $3 . 9 \%$ mAP gain compared with the LiDAR-based baseline. With finer voxel grids, the performance gap is enlarged to $2 . 5 \%$ NDS and $5 . 5 \%$ mAP.
|
| 148 |
+
|
| 149 |
+
Table 7: Comparisons of different methods with a single model on the nuScenes val set. We compare with classic methods on different modalities without test-time augmentation. † denotes the implementation from MMDetection3D [44]. L, C, CS, and M indicate the LiDAR, Camera, Camera Sweep, and Multi-modality input, respectively. L2 represents knowledge transfer from LiDAR.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Method</td><td>Backbone</td><td>NDS(%)</td><td>mAP(%)</td><td>mATE↓</td><td>mASE↓</td><td>mAOE↓</td><td>mAVE↓</td><td>mAAE↓</td></tr><tr><td colspan="9">LiDAR-based</td></tr><tr><td>CenterPoint [24] V0.1</td><td></td><td>64.9</td><td>56.6</td><td>0.291</td><td>0.252</td><td>0.324</td><td>0.284</td><td>0.189</td></tr><tr><td>UVTR-L</td><td>V0.1</td><td>66.4</td><td>59.3</td><td>0.345</td><td>0.259</td><td>0.313</td><td>0.218</td><td>0.185</td></tr><tr><td> UVTR-L</td><td>V0.075</td><td>67.7</td><td>60.9</td><td>0.334</td><td>0.257</td><td>0.300</td><td>0.204</td><td>0.182</td></tr><tr><td colspan="9">Camera-based</td></tr><tr><td>DETR3D [8]</td><td>R101</td><td>42.5</td><td>34.6</td><td>0.773</td><td>0.268</td><td>0.383</td><td>0.842</td><td>0.216</td></tr><tr><td>UVTR-C</td><td>R50</td><td>41.9</td><td>33.3</td><td>0.793</td><td>0.276</td><td>0.454</td><td>0.760</td><td>0.196</td></tr><tr><td>UVTR-C</td><td>R101</td><td>44.1</td><td>36.2</td><td>0.758</td><td>0.272</td><td>0.410</td><td>0.758</td><td>0.203</td></tr><tr><td>UVTR-CS</td><td>R50</td><td>47.2</td><td>36.2</td><td>0.756</td><td>0.276</td><td>0.399</td><td>0.467</td><td>0.189</td></tr><tr><td> UVTR-CS</td><td>R101</td><td>48.3</td><td>37.9</td><td>0.731</td><td>0.267</td><td>0.350</td><td>0.510</td><td>0.200</td></tr><tr><td>UVTR-L2C</td><td>R101</td><td>45.0</td><td>37.2</td><td>0.735</td><td>0.269</td><td>0.397</td><td>0.761</td><td>0.193</td></tr><tr><td>UVTR-L2CS</td><td>R101</td><td>48.8</td><td>39.2</td><td>0.720</td><td>0.268</td><td>0.354</td><td>0.534</td><td>0.206</td></tr><tr><td colspan="9">LiDAR+Camera</td></tr><tr><td>FUTR3D [9]</td><td>V0.075-R101</td><td>68.3</td><td>64.5</td><td>1</td><td>-</td><td>-</td><td>-</td><td>1</td></tr><tr><td>UVTR-M</td><td>V0.075-R101</td><td>70.2</td><td>65.4</td><td>0.332</td><td>0.258</td><td>0.268</td><td>0.212</td><td>0.177</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 8: Comparisons of different distances, weather, and lighting conditions on nuScenes val set.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Modality</td><td colspan="3">Distance: NDS(%)</td><td colspan="2">Weather: NDS(%)</td><td colspan="2">Lighting: NDS(%)</td></tr><tr><td><20m</td><td>20-30m</td><td>>30m</td><td>Sunny</td><td>Rainy</td><td>Day</td><td>Night</td></tr><tr><td>CenterPoint[ t[24]</td><td>LiDAR</td><td>74.1</td><td>62.1</td><td>34.6</td><td>64.6</td><td>64.4</td><td>65.1</td><td>40.1</td></tr><tr><td>UVTR-L</td><td>LiDAR</td><td>75.9</td><td>64.9</td><td>37.3</td><td>67.4</td><td>67.9</td><td>67.8</td><td>41.4</td></tr><tr><td>UVTR-C</td><td>Camera</td><td>52.8</td><td>39.7</td><td>20.4</td><td>43.1</td><td>48.3</td><td>44.5</td><td>23.5</td></tr><tr><td>UVTR-M</td><td>Multi-mod</td><td>77.2</td><td>68.2</td><td>38.9</td><td>69.7</td><td>72.0</td><td>70.3</td><td>42.6</td></tr></table>
|
| 156 |
+
|
| 157 |
+
# 4.3 Main Results
|
| 158 |
+
|
| 159 |
+
In this section, we first report results with various modalities that are optimized on the whole train set. Then, we give analyses of the framework robustness, including camera view drop and translational noise. Comparisons with leading methods on the nuScenes test set are presented in the end.
|
| 160 |
+
|
| 161 |
+
Results with Different Modalities. In Table 7, we carry out experiments with different modalities on the nuScenes val set. Compared with classic methods, UVTR achieves significant improvement. In particular, for LiDAR-based method, it attains $1 . 5 \%$ NDS and $2 . 7 \%$ mAP gain over CenterPoint [24]. And a finer resolution contributes better results with $6 7 . 7 \%$ NDS. For camera-based manner, UVTR-C performs better in single frame setting with $1 . 6 \%$ NDS gain over DETR3D [8]. If applied knowledge transfer in UVTR-L2C, the gap is enlarged to $2 . 5 \%$ NDS. The performance improves with more frames and attains up to $4 8 . 8 \%$ NDS. For multi-modality input, UVTR-M achieves $4 . 5 \%$ mAP gain over UVTR-L and outperforms the contemporary FUTR3D [9] with $1 . 9 \%$ NDS in a same setting.
|
| 162 |
+
|
| 163 |
+
Results in Different Conditions. In Table 8, we report the performance with different distances, weather conditions, and light situations. (1) Distance: For LiDAR-based approaches, the proposed UVTR-L achieves better performance in all situations compared with CenterPoint [24]. Equipped with both LiDAR and camera inputs in UVTR-M, the framework attains significant gains, especially in a relatively far distance $3 . 3 \%$ NDS gain in $2 0 { - } 3 0 m$ ). If the object is too far $( > 3 0 m )$ , the performance gain decreases to $1 . 6 \%$ NDS, but still much better than CenterPoint and UVTR-L. (2) Weather condition: It is clear that the proposed UVTR-L achieves significant gain compared with CenterPoint in both conditions. And additional camera input brings much better results, especially in rainy weather $4 . 1 \%$ NDS gain). (3) Light situation: Compared with that in the daylight situation, both LiDAR-based and camera-based approaches perform inferior in the dark night. Compared with
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 5: We validate the robustness of UVTR by adding two typical errors during inference. For dropped view in 5a, we randomly drop a fixed number of camera views to simulate the camera failure. For sensor noise in 5b, we randomly add translational noises in LiDAR to camera calibration matrix.
|
| 167 |
+
|
| 168 |
+
Table 9: Comparisons of leading methods with a single model on the nuScenes test set. L, C, CS, and M indicate the LiDAR, Camera, Camera Sweep, and Multi-modality input, respectively. L2 represents knowledge transfer from LiDAR. Flipping augmentation is adopted for LiDAR. It should be noted that the performance of UVTR-L2CS3 can be further improved with more than 3 sweeps.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Method</td><td>Backbone</td><td>NDS(%) 1</td><td>mAP(%)</td><td>mATE↓</td><td>mASE↓</td><td>mAOE↓</td><td></td><td>mAVE↓mAAE↓</td></tr><tr><td colspan="9">LiDAR-based</td></tr><tr><td>3DSSD [45]</td><td>Point-based</td><td>56.4</td><td>42.6</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CenterPoint [24]</td><td>V0.075</td><td>65.5</td><td>58.0</td><td>1</td><td>=</td><td>-</td><td></td><td>1</td></tr><tr><td>HotSpotNet [46]</td><td>V0.1</td><td>66.0</td><td>59.3</td><td>0.274</td><td>0.239</td><td>0.384</td><td>0.333</td><td>0.133</td></tr><tr><td>AFDetV2 [47]</td><td>V0.075</td><td>68.5</td><td>62.4</td><td>0.257</td><td>0.234</td><td>0.341</td><td>0.299</td><td>0.137</td></tr><tr><td>UVTR-L</td><td>V0.075</td><td>69.7</td><td>63.9</td><td>0.302</td><td>0.246</td><td>0.350</td><td>0.207</td><td>0.123</td></tr><tr><td colspan="9">Camera-based</td></tr><tr><td>FCOS3D [27]</td><td>R101</td><td>42.8</td><td>35.8</td><td>0.690</td><td>0.249</td><td>0.452</td><td>1.434</td><td>0.124</td></tr><tr><td>DD3D [48]</td><td>V2-99</td><td>47.7</td><td>41.8</td><td>0.572</td><td>0.249</td><td>0.368</td><td>1.014</td><td>0.124</td></tr><tr><td>DETR3D [8]</td><td>V2-99</td><td>47.9</td><td>41.2</td><td>0.641</td><td>0.255</td><td>0.394</td><td>0.845</td><td>0.133</td></tr><tr><td>BEVDet [6]</td><td>V2-99</td><td>48.8</td><td>42.4</td><td>0.524</td><td>0.242</td><td>0.373</td><td>0.950</td><td>0.148</td></tr><tr><td>PETR[10]</td><td>V2-99</td><td>50.4</td><td>44.1</td><td>0.593</td><td>0.249</td><td>0.383</td><td>0.808</td><td>0.132</td></tr><tr><td>UVTR-L2C</td><td>V2-99</td><td>52.2</td><td>45.2</td><td>0.612</td><td>0.256</td><td>0.385</td><td>0.664</td><td>0.125</td></tr><tr><td>UVTR-L2CS3</td><td>V2-99</td><td>55.1</td><td>47.2</td><td>0.577</td><td>0.253</td><td>0.391</td><td>0.508</td><td>0.123</td></tr><tr><td colspan="9">LiDAR+Camera</td></tr><tr><td>FusionPainting [49]</td><td>V0.075-R50</td><td>70.4</td><td>66.3</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MVP [32]</td><td>V0.075-DLA34</td><td>70.5</td><td>66.4</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PointAugmenting [50]</td><td>V0.075-DLA34</td><td>71.0</td><td>66.8</td><td>1</td><td>=</td><td></td><td></td><td>=</td></tr><tr><td>UVTR-M</td><td>V0.075-R101</td><td>71.1</td><td>67.1</td><td>0.306</td><td>0.245</td><td>0.351</td><td>0.225</td><td>0.124</td></tr></table>
|
| 171 |
+
|
| 172 |
+
CenterPoint, the proposed UVTR-L still performs better. And the camera inputs still bring significant gains in both situations, especially in a daylight environment ( $2 . 5 \%$ NDS gain).
|
| 173 |
+
|
| 174 |
+
Robustness of the Framework. To validate the robustness of UVTR, we simulate two typical sensor errors during inference in Figure 5. For loss of view, the multi-modality manner achieves well robustness in Figure 5a. Because LiDAR can still capture surrounding scenes if cameras are offline. As for the camera-based manner, the model losses inputs from dropped scenes, but the network still works well and outputs predictions within the field of view. For sensor jitter in Figure 5b, the model performs stable especially in the multi-modality setting because of the accurate perception from LiDAR. Meanwhile, knowledge transfer consistently improves performance in both settings.
|
| 175 |
+
|
| 176 |
+
Comparison with Leading Methods. In Table 9, we present comparisons with leading methods on the nuScenes test set. For LiDAR-based method, UVTR-L surpasses AFDetV2 [47] with $1 . 2 \%$ NDS and attains $6 9 . 7 \%$ NDS. For camera-based manner, with single frame, UVTR-L2C outperforms
|
| 177 |
+
|
| 178 |
+
Table 10: Comparisons of different leading tracking methods on nuScenes test set. \* indicates the method at the leaderboard with no released publication.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Method</td><td>Tracker</td><td>AMOTA(%)</td><td>AMOTP</td><td>Recall</td></tr><tr><td colspan="5">LiDAR-based</td></tr><tr><td>CenterPoint [24]</td><td>Greedy</td><td>63.8</td><td>0.555</td><td>0.675</td></tr><tr><td>UVTR-L</td><td>Greedy</td><td>67.0</td><td>0.656</td><td>0.703</td></tr><tr><td colspan="5">Camera-based</td></tr><tr><td>PolarDETR [51]</td><td>Transformer</td><td>27.3</td><td>1.185</td><td>0.404</td></tr><tr><td>BEVTrack*</td><td>Private</td><td>34.1</td><td>1.107</td><td>0.463</td></tr><tr><td>UVTR-L2CS3</td><td>Greedy</td><td>51.9</td><td>1.125</td><td>0.599</td></tr><tr><td colspan="5">LiDAR+Camera</td></tr><tr><td>EagerMOT [52]</td><td>Two-stage</td><td>67.7</td><td>0.550</td><td>0.727</td></tr><tr><td>AlphaTrack [53]</td><td>Position+Appearance</td><td>69.3</td><td>0.585</td><td>0.723</td></tr><tr><td>UVTR-M</td><td>Greedy</td><td>70.1</td><td>0.686</td><td>0.750</td></tr></table>
|
| 181 |
+
|
| 182 |
+
PETR [10] with $1 . 8 \%$ NDS and $1 . 1 \%$ mAP. With 3 camera sweeps, UVTR-L2CS3 obtains significant gain and attains $5 5 . 1 \%$ NDS, which can be further improved with more frames. For the multi-modality setting, we directly adopt pretrained models from LiDAR- and camera-based manner with simple fine-tuning without bells-and-whistles. Compared with similar approaches without special module, UVTR-M achieves $7 1 . 1 \%$ NDS and $6 7 . 1 \%$ mAP, which is on par with leading approaches.
|
| 183 |
+
|
| 184 |
+
Tracking Extension. To better illustrate the capability and generality of the proposed UVTR, we further conduct experiments on the downstream tracking task. In particular, we follow the classic tracking-by-detection paradigm and apply the simple greedy tracker in CenterPoint. The only difference lies in that we adopt threshold 0.2 and NMS to remove low quality results. As presented in Table 10, the proposed UVTR achieves leading tracking performance with the greedy tracker in different settings. Specifically, in a camera-based setting, the proposed UVTR-L2CS3 surpasses previous SOTA at the leaderboard (BEVTrack) with $1 7 . 8 \%$ AMOTA. It further proves the effectiveness and generality of the proposed cross-modality interaction in UVTR.
|
| 185 |
+
|
| 186 |
+
# 5 Discussion and Conclusion
|
| 187 |
+
|
| 188 |
+
We presented the UVTR, a conceptually simple yet effective framework for multi-modality 3D object detection. The key innovation lies in that it unifies the voxel-based representation for different modalities and facilitates multi-level interactions. In particular, it uniformly encodes inputs from different sensors in the modality-specific space to reduce the semantic ambiguity and enable spatial interaction. With the unified representation, the cross-modality interaction can be easily conducted for knowledge transfer and modality fusion. Moreover, object-level interactions in the unified space are further supported by the transformer decoder for accurate and robust detection. Experiments on the nuScenes dataset prove the effectiveness of UVTR, which attains consistent improvements over various benchmarks and surpasses previous methods with leading performance.
|
| 189 |
+
|
| 190 |
+
There still exist certain limitations in the current method. First, to construct voxel space for multi-view images, we need to process all of them in the shared image backbone, which brings computational cost, especially for multi-frame setting. In the future, we plan to explore a new manner for voxel space construction at the early stage of the network, like that of point clouds. Moreover, we construct the voxel space with a spatial resolution $1 2 8 \times 1 2 8$ . We believe a higher resolution and more image frames could bring stronger voxel space with better results, which remains to be explored.
|
| 191 |
+
|
| 192 |
+
Societal Impacts. The proposed method focuses on 3D object detection that can be used in autonomous driving. Theoretically, a better 3D detector leads to safer autonomous vehicles. However, in the short term, the current technique could not solve all the corner cases and extreme situations. It may bring potential risks to the decision process in real-world autonomous systems.
|
| 193 |
+
|
| 194 |
+
Acknowledgement. This work is supported by Shenzhen Science and Technology Program KQTD20210811090149095.
|
| 195 |
+
|
| 196 |
+
References
|
| 197 |
+
[1] Yan Wang, Wei-Lun Chao, Divyansh Garg, Bharath Hariharan, Mark Campbell, and Kilian Q Weinberger. Pseudo-lidar from visual depth estimation: Bridging the gap in 3d object detection for autonomous driving. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 198 |
+
[2] Yurong You, Yan Wang, Wei-Lun Chao, Divyansh Garg, Geoff Pleiss, Bharath Hariharan, Mark Campbell, and Kilian Q Weinberger. Pseudo-lidar $^ { + + }$ : Accurate depth for 3d object detection in autonomous driving. In International Conference on Learning Representations, 2020.
|
| 199 |
+
[3] Bo Li, Tianlei Zhang, and Tian Xia. Vehicle detection from 3d lidar using fully convolutional network. arXiv:1608.07916, 2016.
|
| 200 |
+
[4] Lue Fan, Xuan Xiong, Feng Wang, Naiyan Wang, and Zhaoxiang Zhang. Rangedet: In defense of range view for lidar-based 3d object detection. In IEEE/CVF International Conference on Computer Vision, 2021.
|
| 201 |
+
[5] Cody Reading, Ali Harakeh, Julia Chae, and Steven L Waslander. Categorical depth distribution network for monocular 3d object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 202 |
+
[6] Junjie Huang, Guan Huang, Zheng Zhu, and Dalong Du. Bevdet: High-performance multi-camera 3d object detection in bird-eye-view. arXiv:2112.11790, 2021.
|
| 203 |
+
[7] Yanwei Li, Xiaojuan Qi, Yukang Chen, Liwei Wang, Zeming Li, Jian Sun, and Jiaya Jia. Voxel field fusion for 3d object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2022.
|
| 204 |
+
[8] Yue Wang, Vitor Campagnolo Guizilini, Tianyuan Zhang, Yilun Wang, Hang Zhao, and Justin Solomon. Detr3d: 3d object detection from multi-view images via 3d-to-2d queries. In Conference on Robot Learning, 2022.
|
| 205 |
+
[9] Xuanyao Chen, Tianyuan Zhang, Yue Wang, Yilun Wang, and Hang Zhao. Futr3d: A unified sensor fusion framework for 3d detection. arXiv:2203.10642, 2022.
|
| 206 |
+
[10] Yingfei Liu, Tiancai Wang, Xiangyu Zhang, and Jian Sun. Petr: Position embedding transformation for multi-view 3d object detection. arXiv:2203.05625, 2022.
|
| 207 |
+
[11] 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, 2021.
|
| 208 |
+
[12] Wenwei Zhang, Zhe Wang, and Chen Change Loy. Exploring data augmentation for multi-modality 3d object detection. arXiv:2012.12741, 2020.
|
| 209 |
+
[13] Charles R Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in Neural Information Processing Systems, 2017.
|
| 210 |
+
[14] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Std: Sparse-to-dense 3d object detector for point cloud. In IEEE/CVF International Conference on Computer Vision, 2019.
|
| 211 |
+
[15] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointrcnn: 3d object proposal generation and detection from point cloud. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 212 |
+
[16] Charles R Qi, Or Litany, Kaiming He, and Leonidas J Guibas. Deep hough voting for 3d object detection in point clouds. In IEEE/CVF International Conference on Computer Vision, 2019.
|
| 213 |
+
[17] Benjamin Graham and Laurens van der Maaten. Submanifold sparse convolutional networks. arXiv:1706.01307, 2017.
|
| 214 |
+
[18] Yukang Chen, Yanwei Li, Xiangyu Zhang, Jian Sun, and Jiaya Jia. Focal sparse convolutional networks for 3d object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2022.
|
| 215 |
+
[19] Bin Yang, Wenjie Luo, and Raquel Urtasun. Pixor: Real-time 3d object detection from point clouds. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 216 |
+
[20] Bin Yang, Ming Liang, and Raquel Urtasun. Hdnet: Exploiting hd maps for 3d object detection. In Conference on Robot Learning, 2018.
|
| 217 |
+
[21] Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 218 |
+
[22] Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 2018.
|
| 219 |
+
[23] Jiajun Deng, Shaoshuai Shi, Peiwei Li, Wengang Zhou, Yanyong Zhang, and Houqiang Li. Voxel r-cnn: Towards high performance voxel-based 3d object detection. In AAAI Conference on Artificial Intelligence, 2021.
|
| 220 |
+
[24] Tianwei Yin, Xingyi Zhou, and Philipp Krahenbuhl. Center-based 3d object detection and tracking. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 221 |
+
[25] Garrick Brazil and Xiaoming Liu. M3d-rpn: Monocular 3d region proposal network for object detection. In IEEE/CVF International Conference on Computer Vision, 2019.
|
| 222 |
+
[26] Andrea Simonelli, Samuel Rota Bulo, Lorenzo Porzi, Manuel López-Antequera, and Peter Kontschieder. Disentangling monocular 3d object detection. In IEEE/CVF International Conference on Computer Vision, 2019.
|
| 223 |
+
[27] Tai Wang, Xinge Zhu, Jiangmiao Pang, and Dahua Lin. Fcos3d: Fully convolutional one-stage monocular 3d object detection. In IEEE/CVF International Conference on Computer Vision, 2021.
|
| 224 |
+
[28] Rui Chen, Songfang Han, Jing Xu, and Hao Su. Point-based multi-view stereo network. In IEEE/CVF International Conference on Computer Vision, 2019.
|
| 225 |
+
[29] Yilun Chen, Shu Liu, Xiaoyong Shen, and Jiaya Jia. Dsgn: Deep stereo geometry network for 3d object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2020.
|
| 226 |
+
[30] Ming Liang, Bin Yang, Shenlong Wang, and Raquel Urtasun. Deep continuous fusion for multi-sensor 3d object detection. In European Conference on Computer Vision, 2018.
|
| 227 |
+
[31] Tengteng Huang, Zhe Liu, Xiwu Chen, and Xiang Bai. Epnet: Enhancing point features with image semantics for 3d object detection. In European Conference on Computer Vision, 2020.
|
| 228 |
+
[32] Tianwei Yin, Xingyi Zhou, and Philipp Krähenbühl. Multimodal virtual point 3d detection. Advances in Neural Information Processing Systems, 2021.
|
| 229 |
+
[33] Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia. Multi-view 3d object detection network for autonomous driving. In IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 230 |
+
[34] Jason Ku, Melissa Mozifian, Jungwook Lee, Ali Harakeh, and Steven L Waslander. Joint 3d proposal generation and object detection from view aggregation. In IEEE/RSJ International Conference on Intelligent Robots and Systems, 2018.
|
| 231 |
+
[35] Jin Hyeok Yoo, Yecheol Kim, Jisong Kim, and Jun Won Choi. 3d-cvf: Generating joint camera and lidar features using cross-view spatial feature fusion for 3d object detection. In European Conference on Computer Vision, 2020.
|
| 232 |
+
[36] Geoffrey Hinton, Oriol Vinyals, Jeff Dean, et al. Distilling the knowledge in a neural network. arXiv:1503.02531, 2015.
|
| 233 |
+
[37] Xiaoyang Guo, Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Liga-stereo: Learning lidar geometry aware representations for stereo-based 3d detector. In IEEE/CVF International Conference on Computer Vision, 2021.
|
| 234 |
+
[38] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 235 |
+
[39] Jonah Philion and Sanja Fidler. Lift, splat, shoot: Encoding images from arbitrary camera rigs by implicitly unprojecting to 3d. In European Conference on Computer Vision, 2020.
|
| 236 |
+
[40] Byeongho Heo, Jeesoo Kim, Sangdoo Yun, Hyojin Park, Nojun Kwak, and Jin Young Choi. A comprehensive overhaul of feature distillation. In IEEE/CVF International Conference on Computer Vision, 2019.
|
| 237 |
+
[41] 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, 2020.
|
| 238 |
+
[42] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 1955.
|
| 239 |
+
[43] Holger Caesar, Varun Bankiti, Alex H Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuscenes: A multimodal dataset for autonomous driving. In IEEE Conference on Computer Vision and Pattern Recognition, 2020.
|
| 240 |
+
[44] MMDetection3D Contributors. MMDetection3D: OpenMMLab next-generation platform for general 3D object detection. https://github.com/open-mmlab/mmdetection3d, 2020.
|
| 241 |
+
[45] Zetong Yang, Yanan Sun, Shu Liu, and Jiaya Jia. 3dssd: Point-based 3d single stage object detector. In IEEE Conference on Computer Vision and Pattern Recognition, 2020.
|
| 242 |
+
[46] Qi Chen, Lin Sun, Zhixin Wang, Kui Jia, and Alan Yuille. Object as hotspots: An anchor-free 3d object detection approach via firing of hotspots. In European Conference on Computer Vision, 2020.
|
| 243 |
+
[47] Yihan Hu, Zhuangzhuang Ding, Runzhou Ge, Wenxin Shao, Li Huang, Kun Li, and Qiang Liu. Afdetv2: Rethinking the necessity of the second stage for object detection from point clouds. AAAI Conference on Artificial Intelligence, 2022.
|
| 244 |
+
[48] Dennis Park, Rares Ambrus, Vitor Guizilini, Jie Li, and Adrien Gaidon. Is pseudo-lidar needed for monocular 3d object detection? In IEEE/CVF International Conference on Computer Vision, 2021.
|
| 245 |
+
[49] Shaoqing Xu, Dingfu Zhou, Jin Fang, Junbo Yin, Zhou Bin, and Liangjun Zhang. Fusionpainting: Multimodal fusion with adaptive attention for 3d object detection. In IEEE International Conference on Intelligent Transportation Systems, 2021.
|
| 246 |
+
[50] Chunwei Wang, Chao Ma, Ming Zhu, and Xiaokang Yang. Pointaugmenting: Cross-modal augmentation for 3d object detection. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 247 |
+
[51] Shaoyu Chen, Xinggang Wang, Tianheng Cheng, Qian Zhang, Chang Huang, and Wenyu Liu. Polar parametrization for vision-based surround-view 3d detection. arXiv:2206.10965, 2022.
|
| 248 |
+
[52] Aleksandr Kim, Aljoša Ošep, and Laura Leal-Taixé. Eagermot: 3d multi-object tracking via sensor fusion. In IEEE International Conference on Robotics and Automation, 2021.
|
| 249 |
+
[53] Yihan Zeng, Chao Ma, Ming Zhu, Zhiming Fan, and Xiaokang Yang. Cross-modal 3d object detection and tracking for auto-driving. In IEEE/RSJ International Conference on Intelligent Robots and Systems, 2021.
|
| 250 |
+
|
| 251 |
+
# Checklist
|
| 252 |
+
|
| 253 |
+
1. For all authors...
|
| 254 |
+
|
| 255 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 256 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 5.
|
| 257 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5.
|
| 258 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 259 |
+
|
| 260 |
+
2. If you are including theoretical results...
|
| 261 |
+
|
| 262 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 263 |
+
|
| 264 |
+
3. If you ran experiments...
|
| 265 |
+
|
| 266 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We give detailed experimental setup in Section 4.1 and publicly release the code.
|
| 267 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1 and supplementary material.
|
| 268 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 269 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We report them in the supplementary material. Our experiments in this paper require about 8 NVIDIA Tesla V100 GPUs.
|
| 270 |
+
|
| 271 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 272 |
+
|
| 273 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4.1.
|
| 274 |
+
(b) Did you mention the license of the assets? [Yes] We conduct experiments on nuScenes [43] dataset with custom non-commercial license.
|
| 275 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 276 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 277 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] We conduct experiments only on public datasets.
|
| 278 |
+
|
| 279 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 280 |
+
|
| 281 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 282 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 283 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/XSRSWxyJIC/XSRSWxyJIC.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PARAMETER-EFFICIENT FINE-TUNING DESIGN SPACES
|
| 2 |
+
|
| 3 |
+
Jiaao Chen†∗, Aston Zhang‡, Xingjian $\mathbf { S h i } ^ { \dagger }$ , $\mathbf { M } \mathbf { u } \mathbf { L i } ^ { \ddagger }$ , Alex $\mathbf { S m o l a } ^ { \dagger }$ , Diyi Yang⋄ †Georgia Institute of Technology, $^ \ddag$ Amazon Web Services, ⋄Stanford University
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The aim of parameter-efficient fine-tuning is to achieve performance that is comparable to fine-tuning, but with fewer trainable parameters. Several hand-crafted strategies, such as Adapters, Prefix Tuning, BitFit, and LoRA, have been proposed, but it remains unclear whether there are underlying design patterns. Thus, we present a parameter-efficient design paradigm and identify design patterns that are applicable to various experimental settings. Instead of developing another individual tuning strategy, we introduce design spaces that parameterize tuning structures and strategies. These design spaces consist of four components: layer grouping, trainable parameter allocation, tunable groups, and strategy assignment. Our experiments reveal the following design patterns: (i) group layers in a spindle pattern, (ii) allocate trainable parameters evenly among layers, (iii) tune all groups, and (iv) assign appropriate tuning strategies to each group. These patterns lead to new methods for parameter-efficient fine-tuning, which we show experimentally outperform existing strategies across various backbone models and NLP tasks1.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Large pre-trained models have shown to achieve state-of-the-art results in many downstream natural language processing tasks, by fine-tuning on task-specific labeled data (Devlin et al., 2019; Liu et al., 2019; Yang et al., 2019; Joshi et al., 2019; Sun et al., 2019; Clark et al., 2019; Lewis et al., 2020a; Bao et al., 2020; He et al., 2020; Raffel et al., 2020; Ziems et al., 2022). However, the cost of finetuning all parameters and storing them separately for each task is high in terms of computational and storage resources, e.g., 355 million parameters for RoBERTa (Liu et al., 2019) and 175 billion parameters for GPT-3 (Brown et al., 2020). This makes it challenging to deploy in real-world natural language processing (NLP) systems that handle multiple tasks.
|
| 12 |
+
|
| 13 |
+
To make pretrained models more efficient for specific downstream tasks, various strategies have been proposed that only learn a small number of extra parameters while keeping the rest frozen (Houlsby et al., 2019b; Pfeiffer et al., 2021; Li & Liang, 2021; Brown et al., 2020; Lester et al., 2021b; Schick & Schutze, 2021; Ziems et al., 2022). One such strategy is adapter tuning (Houlsby ¨ et al., 2019b), which adds small neural modules (adapters) to each layer of the pretrained network, and only trains the adapters during fine-tuning. Other methods, such as prefix tuning (Li & Liang, 2021) and prompt tuning (Lester et al., 2021a), have been inspired by the success of controlling pretrained models through textual prompts (Brown et al., 2020). These methods prepend tunable tokens to the input or hidden layers, and only train these tokens during fine-tuning. BitFit (Zaken et al., 2021) updates the bias terms of pretrained models while freezing the rest, while LoRA (Hu et al., 2021) decomposes attention weight gradients into low-rank matrices to reduce the number of trainable parameters. He et al. (2022) proposed a unified view of these strategies, illustrating their differences and connections, but like its predecessors, the method is still equally applied to different layers of the pretrained network.
|
| 14 |
+
|
| 15 |
+
Most current fine-tuning strategies to adapt pretrained models to specific tasks are effective, but they are often developed through manual design processes without considering potential design patterns across these strategies, different backbone models, and downstream tasks. The effectiveness of different strategies is also unclear as they are usually applied separately, and it’s unknown how they reinforce or complement each other (Mao et al., 2022). Our aim is to gain a comprehensive understanding of the fine-tuning design and uncover interpretable and widely applicable design patterns.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: The design space is characterized by: (i) Grouping of consecutive layers, (ii) The allocation of the number of trainable parameters to each layer, (iii) The selection of groups that will be finetuned, and (iv) The assignment of appropriate strategies, such as Adapter (A), Prefix (P), BitFit (B), or LoRA $\left( \mathrm { L } \right)$ , to each group.
|
| 19 |
+
|
| 20 |
+
Instead of creating yet another strategy to be applied uniformly to various pretrained layers, we present parameter-efficient fine-tuning design spaces that allow customization of both tuning structures and strategies. These design spaces are comprised of four main components, as illustrated in Figure 1: layer grouping, trainable parameter allocation, tunable groups, and strategy assignment.
|
| 21 |
+
|
| 22 |
+
We start our journey towards parameter-efficient fine-tuning design using a relatively unconstrained design space. We then narrow this space through successive rounds of comparison, using random sampling and while enforcing constraints such as equal layer grouping. Through this process, we discover several key design patterns, including layer grouping in a spindle pattern, uniform allocation of trainable parameters, tuning all groups, and appropriate strategy assignments. Our new methods outperform existing parameter-efficient fine-tuning strategies. We demonstrate the effectiveness of our approach using T5 (Raffel et al., 2020) and classification tasks, but find that the discovered design patterns are applicable to other backbones (such as RoBERTa (Liu et al., 2019), BART (Lewis et al., 2020b) and XLNet (Yang et al., 2019)), and NLP tasks (e.g., summarization, machine translation, and eight SuperGLUE datasets).
|
| 23 |
+
|
| 24 |
+
Our contributions are: (i) The introduction of parameter-efficient fine-tuning design spaces. (ii) The discovery of several design patterns in parameter-efficient fine-tuning through comprehensive experiments. (iii) The creation of parameter-efficient fine-tuning methods based on the discovered design patterns, which outperform existing strategies on various backbone models and NLP tasks.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Our work is closely related to and builds on work about network design spaces and parameterefficient fine-tuning. We discuss the connections and differences below.
|
| 29 |
+
|
| 30 |
+
Network Design Spaces. Many works designed neural network models via an ad-hoc discovery of new design choices that improve performance (Radosavovic et al., 2019), such as the use of deeper architectures or residual connections. Recent work (Radosavovic et al., 2020; You et al., 2020; Radosavovic et al., 2019) focuses on the design space to discover new design principles for convolutional neural networks (Radosavovic et al., 2020) and graph neural networks (You et al., 2020). Inspired by this work we focus on the design spaces to rethink parameter-efficient finetuning, with the goal of discovering design patterns that are applicable to different settings.
|
| 31 |
+
|
| 32 |
+
Parameter-Efficient Fine-Tuning for NLP. As pretrained models increase in size, storing and finetuning them becomes increasingly expensive and unfeasible for those without ample computational resources. A growing body of research is aimed at finding alternatives to fine-tuning large-scale models that reduce memory and storage costs. Some researchers have proposed using bottleneck layers with skip-connections to adapt large models, as seen in works such as Houlsby et al. (2019a), (Stickland & Murray, 2019), (Pfeiffer et al., 2020), and (Rebuffi et al., 2017). Other works focus on identifying and training only a subset of all model parameters, such as (Zhao et al., 2020) and (Guo et al., 2020). More recent research explores low-rank decomposition (Zhang et al., 2021) and the injection of trainable low-rank decomposition matrices into each layer (Hu et al., 2021; Karimi Mahabadi et al., 2021).
|
| 33 |
+
|
| 34 |
+
Li & Liang (2021) introduced prefix-tuning, where a set of prefixes is added to autoregressive language models or both encoders and decoders, while Lester et al. (2021b) proposed adding virtual tokens to the embedding layer. Another approach, side-tuning, was introduced in (Sung et al., 2022). He et al. (2022) and Ding et al. (2022). They proposed a unified view of existing parameter-efficient fine-tuning strategies. In yet another approach, Mao et al. (2022) introduced a unified framework to combine various methods through mixture-of-experts.
|
| 35 |
+
|
| 36 |
+
Our research focuses on the general design spaces of parameter-efficient fine-tuning, providing a more comprehensive view of this method. By experimenting and refining design spaces, we aim to discover design patterns for parameter-efficient fine-tuning.
|
| 37 |
+
|
| 38 |
+
# 3 COMPONENTS OF DESIGN SPACES
|
| 39 |
+
|
| 40 |
+
Our goal is not to list all possible design choices, but to show how design spaces can guide parameter-efficient fine-tuning research. As such, we pick a representative subset for each of the following four components: (i) layer grouping, (ii) trainable parameter allocation, (iii) tunable groups, and (iv) strategy assignment. Figure 1 provides an example.
|
| 41 |
+
|
| 42 |
+
Given these choices, we sample from a distribution over them, then pick a subset that performs the best, narrowing down the set of choices. Given that more restrictive set, we repeat the procedure by sampling and picking a now even more restrictive subset until we arrive at a concise description of the design space. Quite understandably, this is very costly when dealing with Large Language Models. Taking a leaf out of (Radosavovic et al., 2020) we perform our experiments using a sufficiently cheap model, in this case T5-base and T5-3b, unless stated otherwise. Further details will be discussed in the next section. For now let’s review the set of choices available.
|
| 43 |
+
|
| 44 |
+
Layer Grouping. Different layers in pre-trained models capture varying information and behave differently. For example, the authors of (Jawahar et al., 2019) found that the $\ 3 , 4 , 5 , 6 , 7 , 9 , 1 2 \mathrm { t h }$ 1 layers have the most representation power in BERT and each layer captures a different type of information, ranging from surface to syntactic to semantic level representation of text. For instance, the 9th layer performs well in semantic tasks such as checking random swaps of coordinated clauses, while the 3rd layer is best suited for surface tasks like predicting sentence length.
|
| 45 |
+
|
| 46 |
+
When adapting these pre-trained models for downstream tasks, it’s crucial to group layers with similar behaviors together. This is critical to the design and proper implementation of parameter-efficient fine-tuning strategies. In this design component, we study patterns of how to group consecutive layers in pre-trained models (e.g., transformer layers in T5) during the fine-tuning process.
|
| 47 |
+
|
| 48 |
+
Trainable Parameter Allocation. In parameter-efficient fine-tuning, the total number of trainable parameters is usually set to a small portion of the total parameters in the pretrained model. Our study will explore different ways to allocate the predefined number of trainable parameters to the layers.
|
| 49 |
+
|
| 50 |
+
Tunable Groups. Not all the parameters of a pretrained model need to be updated during fine-tuning for downstream tasks. For example, BitFit (Zaken et al., 2021) only updates the bias parameters while freezing the rest. As a result, we explore which groups of parameters need to be learned during parameter-efficient fine-tuning to achieve better performance.
|
| 51 |
+
|
| 52 |
+
Strategy Assignment. In order to improve the parameter efficiency, different sets of strategies (Li & Liang, 2021; Lester et al., 2021b; Houlsby et al., 2019b; Hu et al., 2021) were proposed, where only a small number of (extra) parameters are tuned and the remaining parameters in these pretrained models are frozen to adapt their general knowledge to specific down-stream tasks. We hypothesize that different groups might benefit from different proper strategies (or combinations) for capturing different types of information. More formally, given a set of individual strategies $\mathcal { A }$ for assignment, for any group $G _ { i }$ , assign a subset $\mathcal { U } _ { i } \subset \mathcal { A }$ to each layer in $G _ { i }$ .
|
| 53 |
+
|
| 54 |
+
# 4 DISCOVERING DESIGN PATTERNS
|
| 55 |
+
|
| 56 |
+
Each design space, denoted as $s _ { i }$ , consists of a set of models $S _ { i }$ -models) that satisfy the constraints characterizing the space with respect to layer grouping, trainable parameter allocation, tunable groups, and strategy assignment. To discover design patterns, we start from a relatively unconstrained parameter-efficient fine-tuning design space $ { \boldsymbol { S } } _ { 0 }$ . We progressively refine it via $\mathcal { S } _ { 1 } , \ldots . . . \mathcal { S } _ { 4 }$ by comparing the overall quality of models in design spaces enforced with different constraints (e.g., each group has the same number of layers). To quantify the overall quality of models in any design space $s _ { i }$ with a low-compute, low-epoch regime (Radosavovic et al., 2020), we randomly sample 100 models from $S _ { i }$ , fine-tune with only 3 epochs 2, and compute the average of the GLUE average performance. Using such a low number of epochs is sufficient to obtain a sufficiently representative score to draw consistent conclusions (see Table 7 in the Appendix) that extend to a full training run.
|
| 57 |
+
|
| 58 |
+
We emphasize that our goal is to demonstrate how the perspective of design spaces can help inform parameter-efficient fine-tuning research, rather than to find out the “best” design space or method. For computational efficiency, it is beyond the scope of this work to enumerate all possible constraints with respect to the design space components (Section 3). For efficiency, we use T5-base (pretrained backbone model) as it’s both representative and also sufficiently small to make experimentation with many options computationally affordable.
|
| 59 |
+
|
| 60 |
+
In this work, we follow the discovery sequence of “grouping patterns – trainable parameter allocation – tunable groups – strategy assignment”: (1) To explore and understand the design patterns in all the layers in large pre-trained models in scale, it is necessary and more efficient to study the layers in the unit of groups. So we start with the grouping patterns. (2) Once figuring out the optimal grouping patterns, it is then important to explore how to allocate the trainable parameters to these different groups in order to study more subtle designs with fair comparisons (e.g., this would allow comparing different patterns of strategy assignments without the impact from different trainable parameters.). (3) Next, it becomes influential to examine which groups need to be learned during fine-tuning before we dig into the strategy assignment patterns. Because it is only meaningful to study assigning strategies to different groups after we figure out which groups need to be learned. (4) Finally, we study the tuning strategy assignment, which is the most subtle design.
|
| 61 |
+
|
| 62 |
+
# 4.1 $S _ { 0 }$ — THE INITIAL DESIGN SPACE
|
| 63 |
+
|
| 64 |
+
The initial relatively unconstrained design space $ { \boldsymbol { S } } _ { 0 }$ consists of all models without constraints on the design space components. Individual parameter-efficient fine-tuning strategies consist of Adapter, Prefix, BitFit, and LoRA. Specifically, without grouping constraints, each layer of the pretrained layer has a probability of 0.5 to be tuned. If tuned, a random strategy, or combinations thereof, with a random amount of trainable parameters are assigned to that layer.
|
| 65 |
+
|
| 66 |
+
Before comparing more subtle design patterns such as to which tuning strategy among Adapter, Prefix, BitFit, and LoRA to pick, we begin by exploring how to group layers and how to allocate the total number of trainable parameters to layers.
|
| 67 |
+
|
| 68 |
+
# 4.2 $S _ { 1 }$ — APPLYING GROUPING CONSTRAINTS
|
| 69 |
+
|
| 70 |
+
Transformers are quite deep by now. This makes it impractical to pick a different tuning strategy for each layer. As such, the first question to ask is how to assemble the layers into groups that will be tuned using the same strategy. Inspired by Radosavovic et al. (2020), we consider 4 groups, $G _ { 1 } , \ldots , G _ { 4 }$ , in the order of forward pass, in the experiments 3 Denote by $N _ { i }$ the number of layers in $G _ { i }$ . As illustrated in Figure 2, we compare the following layer grouping patterns:
|
| 71 |
+
|
| 72 |
+
Increasing $\left( N _ { i + 1 } > N _ { i } \right)$ : the number of layers in groups gradually increases;
|
| 73 |
+
|
| 74 |
+
Table 1: Average performance (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone. We compare adding different layer grouping constraints to the $ { \boldsymbol { S } } _ { 0 }$ design space.
|
| 75 |
+
|
| 76 |
+
<table><tr><td>Layer Grouping</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>So-models</td><td>76.9</td><td>70.1</td><td>72.5</td><td>73.3</td><td>63.6</td><td>71.7</td><td>73.8</td><td>24.3</td><td>65.7</td></tr><tr><td>Increasing</td><td>85.3</td><td>74.9</td><td>77.2</td><td>77.5</td><td>66.8</td><td>76.2</td><td>76.0</td><td>33.0</td><td>70.8</td></tr><tr><td>Uniform</td><td>84.8</td><td>73.7</td><td>78.1</td><td>78.6</td><td>68.5</td><td>77.8</td><td>79.2</td><td>36.1</td><td>72.1</td></tr><tr><td>Decreasing</td><td>81.9</td><td>72.1</td><td>78.3</td><td>76.7</td><td>67.3</td><td>75.9</td><td>78.6</td><td>28.7</td><td>70.0</td></tr><tr><td>Spindle</td><td>86.9</td><td>75.5</td><td>79.8</td><td>79.4</td><td>69.8</td><td>78.3</td><td>80.1</td><td>37.3</td><td>73.3</td></tr><tr><td>Bottleneck</td><td>84.5</td><td>74.6</td><td>76.9</td><td>78.1</td><td>69.2</td><td>76.2</td><td>78.6</td><td>32.1</td><td>71.3</td></tr></table>
|
| 77 |
+
|
| 78 |
+
Table 2: Average performance (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different parameter allocation constraints to the $S _ { 1 }$ design space.
|
| 79 |
+
|
| 80 |
+
<table><tr><td>Param Allocation</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>Increasing</td><td>87.2</td><td>77.9</td><td>79.4</td><td>78.7</td><td>71.6</td><td>77.6</td><td>81.4</td><td>32.0</td><td>73.2</td></tr><tr><td>Uniform</td><td>87.8</td><td>77.4</td><td>80.1</td><td>80.5</td><td>73.9</td><td>78.1</td><td>80.4</td><td>34.3</td><td>74.0</td></tr><tr><td>Decreasing</td><td>86.4</td><td>75.8</td><td>78.4</td><td>77.0</td><td>70.4</td><td>77.1</td><td>78.7</td><td>35.8</td><td>72.4</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Uniform $\boldsymbol { N } _ { i + 1 } = \boldsymbol { N } _ { i } )$ ): the number of layers in groups is the same;
|
| 83 |
+
Decreasing $( N _ { i + 1 } < N _ { i } )$ : the number of layers in groups gradually decreases;
|
| 84 |
+
Spindle $( N _ { 1 } < N _ { 2 } = N _ { 3 } > N _ { 4 } )$ : the numbers of layers in groups at both ends are smaller;
|
| 85 |
+
Bottleneck $( N _ { 1 } > N _ { 2 } = N _ { 3 } < N _ { 4 } )$ ): the numbers of layers in groups at both ends are bigger.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 2: Layer grouping patterns: group ID $( G _ { 1 } , \ldots G _ { 4 } )$ vs. number of layers per group.
|
| 89 |
+
|
| 90 |
+
These layer grouping patterns lead to 5 possible design choices. They consist of all models in the $ { \boldsymbol { S } } _ { 0 }$ design space that satisfy one of these grouping pattern constraints. To compare the overall model qualities of different design spaces, we (i) randomly sample 100 models from the $ { \boldsymbol { S } } _ { 0 }$ design space that satisfy each grouping pattern constraint (Figure 2); (ii) fine-tune with 3 epochs; and (iii) compute the average performance for each design space. We will follow this procedure as we progressively add new constraints later.
|
| 91 |
+
|
| 92 |
+
The average performance is shown in Table $1 ^ { \ 4 }$ . We find that models from the design space with the spindle grouping pattern (Figure 2) consistently outperform those from the other design spaces across all the 8 GLUE tasks. In other words, we find that fine-tuning works better if we treat a small number of layers close to the input and close to the output as special, and furthermore, if we divide up the bulk of the network into two blocks, each with their own design choices.
|
| 93 |
+
|
| 94 |
+
Applying the spindle grouping partitioning to $ { \boldsymbol { S } } _ { 0 }$ yields the new design space $S _ { 1 }$
|
| 95 |
+
|
| 96 |
+
# 4.3 $S _ { 2 }$ — VARYING THE NUMBER OF TRAINABLE PARAMETERS PER LAYER
|
| 97 |
+
|
| 98 |
+
Now that we know how to group the layers we need to establish how to allocate the parameters $n _ { i }$ within the layers $i$ of each group. In particular, we consider the following options:
|
| 99 |
+
|
| 100 |
+
Increasing $( n _ { i + 1 } \geq n _ { i } )$ ): number of trainable parameters per layer increases or remains the same.
|
| 101 |
+
|
| 102 |
+
Table 3: Average performance (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different tunable group constraints to the $S _ { 2 }$ design space.
|
| 103 |
+
|
| 104 |
+
<table><tr><td>Tunable Groups</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G1</td><td>82.6</td><td>72.1</td><td>77.6</td><td>70.6</td><td>65.3</td><td>71.9</td><td>77.6</td><td>27.6</td><td>68.2</td></tr><tr><td>G2</td><td>83.3</td><td>72.8</td><td>77.5</td><td>72.8</td><td>63.6</td><td>72.8</td><td>77.5</td><td>27.5</td><td>68.4</td></tr><tr><td>G3</td><td>83.6</td><td>73.3</td><td>78.2</td><td>73.3</td><td>66.4</td><td>71.3</td><td>77.9</td><td>22.9</td><td>68.4</td></tr><tr><td>G4</td><td>83.2</td><td>73.0</td><td>77.9</td><td>73.7</td><td>63.9</td><td>72.0</td><td>77.9</td><td>27.9</td><td>68.7</td></tr><tr><td>G1,G2</td><td>83.5</td><td>73.2</td><td>78.0</td><td>75.4</td><td>67.7</td><td>73.2</td><td>78.0</td><td>28.0</td><td>69.6</td></tr><tr><td>G3,G4</td><td>87.8</td><td>74.6</td><td>78.3</td><td>76.9</td><td>68.6</td><td>74.3</td><td>78.3</td><td>28.3</td><td>70.7</td></tr><tr><td>G1,G2,G3</td><td>86.0</td><td>75.8</td><td>79.0</td><td>77.8</td><td>71.8</td><td>78.8</td><td>79.0</td><td>33.0</td><td>72.6</td></tr><tr><td>G2,G3,G4</td><td>85.2</td><td>76.6</td><td>79.1</td><td>78.6</td><td>70.1</td><td>77.6</td><td>79.1</td><td>31.9</td><td>72.2</td></tr><tr><td>G1,G2,G3,G4</td><td>88.3</td><td>77.4</td><td>82.1</td><td>81.5</td><td>74.9</td><td>79.4</td><td>81.4</td><td>34.3</td><td>74.9</td></tr></table>
|
| 105 |
+
|
| 106 |
+
Uniform $\mathbf { \bar { \rho } } _ { n _ { i + 1 } } = n _ { i } .$ ): number of trainable parameters in every layer is constant; Decreasing $( n _ { i + 1 } \leq n _ { i } )$ : number of trainable parameters per layer decreases or remains the sam
|
| 107 |
+
|
| 108 |
+
As above, we obtain 100 models for each of these 3 new design spaces. Table 2 reports the average performance of these 3 design spaces. The uniform allocation design pattern obtains the highest GLUE average performance, making this relatively simple, interpretable design pattern favorable.
|
| 109 |
+
|
| 110 |
+
Allocating the number of trainable parameters to layers uniformly yields the new design space $S _ { 2 }$ .
|
| 111 |
+
|
| 112 |
+
# 4.4 $S _ { 3 }$ — SELECTING THE GROUPS
|
| 113 |
+
|
| 114 |
+
Given that we established how to partition layers into groups, and how to allocate parameters per group, the next step is to assess whether all groups actually need tuning. Rather than exploring the $\bar { 2 } ^ { 4 } - 1 = 1 5$ combinatorial choices we limit ourselves to the $4 ( 4 + 1 ) / 2 = 1 0$ options with the exception of $( G _ { 2 } , G _ { 3 } )$ , since focusing on interior groups only does not yield good results (this is consistent with our findings in Table 3).
|
| 115 |
+
|
| 116 |
+
Based on the GLUE average performance, we find that all the groups need to be tuned to obtain the best results. This suggests that all the groups of pretrained layers have captured useful information that should be adapted to the downstream tasks.
|
| 117 |
+
|
| 118 |
+
Tuning all the groups yields the new design space $S _ { 3 }$ .
|
| 119 |
+
|
| 120 |
+
# 4.5 $S _ { 4 }$ — SELECTING STRATEGIES PER GROUP
|
| 121 |
+
|
| 122 |
+
So far the structure we’ve been exploring is fairly trivial: $S _ { 4 }$ amounts to a uniform distribution of parameters over the layers of the groups and to tuning all groups. This belies the fact that we still have significant freedom of design in picking specific fine-tuning approaches. Specifically, each design space consists of models that assign a subset of $\{$ Adapter (A), Prefix (P), BitFit (B), and LoRA $\left( \mathrm { L } \right) \}$ to the layers of each group $G _ { i }$ for $i \in \{ 1 \dots \overset { } { 4 } \}$ . This is quite a large space of options. To make some headway, we determine the ideal choice progressively by first reviewing strategies for $G _ { 1 }$ , then $G _ { 2 }$ up to $G _ { 4 }$ . Due to space constraints the details of this procedure are relegated to the appendix $G _ { 1 }$ in Table 8, $G _ { 2 }$ Table 9, $G _ { 3 }$ in Table 10, and $G _ { 4 }$ in Table 11). We arrive at the following strategy assignment for the T5-base pretrained backbone:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
G _ { 1 } \colon ( \mathrm { A } , \mathrm { L } ) - G _ { 2 } \colon ( \mathrm { A } , \mathrm { P } ) { \longrightarrow } G _ { 3 } \colon ( \mathrm { A } , \mathrm { P } , \mathrm { B } ) { \longrightarrow } G _ { 4 } \colon ( \mathrm { P } , \mathrm { B } , \mathrm { L } )
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
For example, Adapter is more recommended in groups closer to input, while BitFit is more recommended in groups closer to the output. The resulting design space will be referred to as $S _ { 4 }$ .
|
| 129 |
+
|
| 130 |
+
# 4.6 VERIFICATION OF THE DESIGN CHOICES ON T5-3B
|
| 131 |
+
|
| 132 |
+
So far our results have led to a competent fine-tuning strategy for T5-base. To assess whether we actually discovered some useful strategies that have validity beyond T5-base, we need to apply it to other models, too. For convenience we pick T5-3b. As before, the detailed results are relegated to the appendix (Tables 12, 13, 14 and 15). We observe that the following design patterns still apply:
|
| 133 |
+
|
| 134 |
+
1. grouping layers in a spindle pattern (Table 12)
|
| 135 |
+
2. uniformly allocating the number of trainable parameters to layers (Table 13)
|
| 136 |
+
3. tuning all the groups (Table 14)
|
| 137 |
+
4. tuning different groups with proper strategies (Table 15)
|
| 138 |
+
|
| 139 |
+
Note that for T5-3b (with final design space $S _ { 4 } – 3 6$ ), the discovered proper strategy assignment is slightly different
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
G _ { 1 } \colon ( { \mathrm { P } } , { \mathrm { L } } ) { \longrightarrow } G _ { 2 } \colon ( { \mathrm { A } } , { \mathrm { L } } ) { \longrightarrow } G _ { 3 } \colon ( { \mathrm { P } } , { \mathrm { B } } , { \mathrm { L } } ) { \longrightarrow } G _ { 4 } \colon ( { \mathrm { A } } , { \mathrm { P } } , { \mathrm { B } } ) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
# 4.7 EXPERIMENTAL SETUP
|
| 146 |
+
|
| 147 |
+
Datasets. Our process is based on the average performance on the widely-used GLUE benchmark (Wang et al., 2018). It covers a wide range of natural language understanding tasks. First, single-sentence tasks include (i) Stanford Sentiment Treebank (SST-2) and (ii) Corpus of Linguistic Acceptability (CoLA). Second, similarity and paraphrase tasks include (i) Quora Question Pairs (QQP), (ii) Semantic Textual Similarity Benchmark (STS-B), and (iii) Microsoft Research Paraphrase Corpus (MRPC). Third, inference tasks include (i) Multi-Genre Natural Language Inference (MNLI), (ii) Question Natural Language Inference (QNLI), and (iii) Recognizing Textual Entailment (RTE). To compare performance, the Matthews correlation is measured for CoLA; the Spearman correlation is used for STS-B, and accuracy is measured for the remaining GLUE tasks.
|
| 148 |
+
|
| 149 |
+
Pretrained Backbone Models and Model Settings We use T5-base/3b (Raffel et al., 2020) as the main pretrained backbone models for discovering design patterns via our parameter-efficient finetuning design spaces. We use HuggingFace Transformers for our implementations and follow the default settings. During the exploration, we fix the total number of trainable parameters (in the percentage of that in the backbone model) by following He et al. (2022).
|
| 150 |
+
|
| 151 |
+
By limiting ourselves to a rather concise parameter space and a small number of parameters within that parameter space that we allow to be fine-tuned we ensure that exploration remains computationally feasible. Obviously, this exploration would be pointless $i f$ the discovered insights were not portable. Hence, we need to evaluate how well the strategies perform on new models and new architectures.
|
| 152 |
+
|
| 153 |
+
# 5 EVALUATION
|
| 154 |
+
|
| 155 |
+
The $S _ { 4 }$ model (Section 4.5) and $\boldsymbol { S } _ { 4 } – 3 \boldsymbol { \mathrm { b } }$ model (Section 4.6) adopt the design patterns discovered from T5-base and T5-3b, respectively. We will evaluate their effectiveness when applied to different pretrained backbones and different NLP tasks.
|
| 156 |
+
|
| 157 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 158 |
+
|
| 159 |
+
Dataset. Besides the GLUE datasets (Wang et al., 2018) (Section 4.7), we evaluate our methods on two generation tasks used by He et al. (2022): Abstractive Summarization using XSum (Narayan et al., 2018), and Machine Translation using the WMT 2016 en-ro dataset (Bojar et al., 2016). We report ROUGE scores (Lin, 2004) on the XSum test set, and BLEU scores (Papineni et al., 2002) on the en-ro test set.
|
| 160 |
+
|
| 161 |
+
Models and Model Settings. We mainly compare our methods with the following baselines: (i) Full Fine-tuning (full): it fine-tunes all the model parameters in the pretrained models; (ii) Adapter (Houlsby et al., 2019b): it adds adapter modules to each transformer layer; (iii) Prefix (Li & Liang, 2021): it optimizes a set of small continuous vectors prepended to transformer layers; (iv) BitFit (Zaken et al., 2021): it only updates the bias terms in pretrained models; (v) LoRA (Hu et al., 2021): it decomposes the attention weight into low-rank matrices to reduce the number of trainable parameters. Besides T5 (Raffel et al., 2020), we additionally apply our methods to other backbone models including RoBERTa-base/large (Liu et al., 2019) and BART-base/large (Lewis et al., 2020a). We use the default settings. We set the total number of trainable parameters (in the percentage of that in the backbone model) by following He et al. (2022). Specifically, this value is set to $0 . 5 \%$ for Adapter, Prefix, LoRA, and our methods, and $0 . 1 \%$ for BitFit.
|
| 162 |
+
|
| 163 |
+
Table 4: Performances of different tuning methods on the GLUE datasets using the T5-base (upper part) and T5-3b (lower part) pretrained backbone models, respectively. The results are averaged over 20 random runs (with standard deviations as subscripts). The $S _ { 4 }$ -model and the $S _ { 4 }$ -3b-model perform significantly better than the second-best PEFT methods in all the eight datasets at the significance level $p < 0 . 0 5 ( * )$ or even $p < 0 . 0 1 ( * * )$ .
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Method</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Average</td></tr><tr><td>full</td><td>95.2</td><td>87.1</td><td>93.7</td><td>89.4</td><td>80.1</td><td>89.4</td><td>90.7</td><td>51.1</td><td>84.5</td></tr><tr><td>Adapter</td><td>94.6</td><td>85.5</td><td>89.8</td><td>86.7</td><td>75.3</td><td>86.7</td><td>89.1</td><td>59.2</td><td>83.3</td></tr><tr><td>Prefix</td><td>94.0</td><td>81.6</td><td>87.8</td><td>83.4</td><td>64.3</td><td>83.1</td><td>84.8</td><td>34.0</td><td>76.6</td></tr><tr><td>BitFit</td><td>94.4</td><td>84.5</td><td>90.6</td><td>88.3</td><td>74.3</td><td>86.6</td><td>90.1</td><td>57.7</td><td>83.3</td></tr><tr><td>LoRA</td><td>94.8</td><td>84.7</td><td>91.6</td><td>88.5</td><td>75.8</td><td>86.3</td><td>88.7</td><td>51.5</td><td>82.7</td></tr><tr><td>S4-model</td><td>95.57</td><td>87.610</td><td>92.7</td><td>88.80</td><td>80.4.3</td><td>87.42.0</td><td>91.224</td><td>62.2.2</td><td>85.7</td></tr><tr><td>full</td><td>97.4</td><td>91.4</td><td>96.3</td><td>89.7</td><td>91.1</td><td>90.6</td><td>92.5</td><td>67.1</td><td>89.5</td></tr><tr><td>Adapter</td><td>96.3</td><td>89.9</td><td>94.7</td><td>87.8</td><td>83.4</td><td>90</td><td>89.7</td><td>65.2</td><td>87.1</td></tr><tr><td>Prefix</td><td>96.3</td><td>82.8</td><td>88.9</td><td>85.5</td><td>78.3</td><td>83.5</td><td>85.4</td><td>42.7</td><td>80.4</td></tr><tr><td>BitFit</td><td>95.8</td><td>89.5</td><td>93.5</td><td>88.5</td><td>86.2</td><td>90.7</td><td>88.6</td><td>64.2</td><td>87.1</td></tr><tr><td>LoRA</td><td>96.2</td><td>90.6</td><td>94.9</td><td>89.1</td><td>91.2</td><td>91.1</td><td>91.1</td><td>67.4</td><td>88.9</td></tr><tr><td>S4-3b-model</td><td>97.28</td><td>91.6</td><td>96.6</td><td>89.515</td><td>91.5.8</td><td>91.5.5</td><td>91.9.0</td><td>69.74</td><td>89.9</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 5: Performances of different tuning methods on GLUE datasets using the RoBERTa-base (upper part) and RoBERTa-large (lower part) pretrained backbone models. The results are averaged over 20 random runs (with standard deviations as subscripts). Here we also include two baselines: (i) $ { \boldsymbol { S } } _ { 0 }$ -model, where all the designs are randomly selected for RoBERTa as in the $S _ { 0 }$ design space; (ii) $S _ { 3 }$ -model, where strategies are randomly assigned to different RoBERTa layer groups as in the $S _ { 3 }$ design space. The $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model perform significantly better than the second-best PEFT methods in all the eight datasets at the significance level $p < 0 . 0 5 ( * )$ or even $p < 0 . 0 1 ( * * )$ .
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Method</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Average</td></tr><tr><td>full</td><td>94.8</td><td>87.6</td><td>92.8</td><td>91.9</td><td>80.8</td><td>90.3</td><td>90.2</td><td>63.6</td><td>86.5</td></tr><tr><td>Adapter</td><td>94.2</td><td>87.1</td><td>93.1</td><td>90.2</td><td>71.5</td><td>89.7</td><td>88.5</td><td>60.8</td><td>84.4</td></tr><tr><td>Prefix</td><td>94.0</td><td>86.8</td><td>91.3</td><td>90.5</td><td>74.5</td><td>90.3</td><td>88.2</td><td>61.5</td><td>84.6</td></tr><tr><td>BitFit</td><td>93.7</td><td>84.8</td><td>91.3</td><td>84.5</td><td>77.8</td><td>90.8</td><td>90.0</td><td>61.8</td><td>84.3</td></tr><tr><td>LoRA</td><td>94.9</td><td>87.5</td><td>93.1</td><td>90.8</td><td>83.1</td><td>90.0</td><td>89.6</td><td>62.6</td><td>86.4</td></tr><tr><td>So-model</td><td>94.2</td><td>95.3</td><td>90.4</td><td>90.6</td><td>75.6</td><td>89.6</td><td>88.0</td><td>60.9</td><td>85.6</td></tr><tr><td>S3-model</td><td>94.3</td><td>87.2</td><td>92.8</td><td>91.0</td><td>81.8</td><td>90.3</td><td>89.2</td><td>63.2</td><td>86.2</td></tr><tr><td>S4-model</td><td>94.81.6</td><td>87.88</td><td>93.413</td><td>91.61.2</td><td>85.8</td><td>90.42.0</td><td>90.0</td><td>63.23.5</td><td>87.1</td></tr><tr><td>full</td><td>96.4</td><td>90.2</td><td>94.7</td><td>92.2</td><td>86.6</td><td>92.4</td><td>90.9</td><td>68.0</td><td>88.9</td></tr><tr><td>Adapter</td><td>96.6</td><td>90.5</td><td>94.8</td><td>91.7</td><td>80.1</td><td>92.1</td><td>90.9</td><td>67.8</td><td>88.1</td></tr><tr><td>Prefix</td><td>95.7</td><td>87.6</td><td>92.1</td><td>88.7</td><td>82.3</td><td>89.6</td><td>87.4</td><td>62.8</td><td>85.7</td></tr><tr><td>BitFit</td><td>96.1</td><td>88.0</td><td>93.4</td><td>90.2</td><td>86.2</td><td>90.9</td><td>92.7</td><td>64.2</td><td>87.7</td></tr><tr><td>LoRA</td><td>96.2</td><td>90.6</td><td>94.7</td><td>91.6</td><td>87.4</td><td>92.0</td><td>89.7</td><td>68.2</td><td>88.8</td></tr><tr><td>So-model</td><td>95.5</td><td>86.5</td><td>92.3</td><td>89.8</td><td>84.6</td><td>89.2</td><td>86.3</td><td>61.2</td><td>85.6</td></tr><tr><td>S3-model</td><td>96.3</td><td>89.4</td><td>93.8</td><td>90.2</td><td>85.9</td><td>90.8</td><td>90.9</td><td>63.4</td><td>87.6</td></tr><tr><td>S4-3b-model</td><td>96.61</td><td>90.8.1</td><td>95.18</td><td>92.02</td><td>87.22.8</td><td>92.32</td><td>91.8</td><td>68.42</td><td>89.3</td></tr></table>
|
| 170 |
+
|
| 171 |
+
For all the experiments, we followed Liu et al. (2019) to set the linear decay scheduler with a warmup ratio of 0.06 for training. The batch size was 128 for base models and 64 for large models. The maximum learning rate was $5 e - 5$ and the maximum number of training epochs was set to be either 5 or 10. All the experiments were performed using 8 A100 GPUs.
|
| 172 |
+
|
| 173 |
+
# 5.2 EFFECTIVENESS ON DIFFERENT BACKBONES
|
| 174 |
+
|
| 175 |
+
GLUE with T5 Backbone. With our discovered design patterns, we fine-tune T5-base $S _ { 4 }$ -model) and T5-3b $S _ { 4 }$ -3b-model) on GLUE and compare them with all the baseline methods. The results are shown in Table 4, where the key measure is the GLUE average performance (last column). We find that our $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model consistently outperform the investigated methods in the key measure. By tuning only $0 . 5 \%$ parameters, our methods even outperform the full fine-tuning baseline where all the parameters are tuned, indicating the effectiveness of our discovered parameterefficient fine-tuning design patterns.
|
| 176 |
+
|
| 177 |
+
Table 6: Performance of different tuning methods on generation tasks (XSUM and en-ro) using the BART-base (left) and BART-large (right) pretrained backbone models.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>BART-base</td><td>XSUM(R-1/2/L)</td><td>en-ro (BLEU)</td><td>BART-large</td><td>XSUM(R-1/2/L)</td><td>en-ro (BLEU)</td></tr><tr><td>full</td><td>40.5/19.2/34.8</td><td>34.5</td><td>full</td><td>45.1/22.3/37.2</td><td>37.9</td></tr><tr><td>Adapter</td><td>37.7/17.9/33.1</td><td>33.3</td><td>Adapter</td><td>43.8/20.8/35.7</td><td>35.3</td></tr><tr><td>Prefix</td><td>38.2/18.4/32.4</td><td>33.8</td><td>Prefix</td><td>43.4/20.4/35.5</td><td>35.6</td></tr><tr><td>BitFit</td><td>37.2/17.5/31.4</td><td>33.2</td><td>BitFit</td><td>42.8/18.7/33.2</td><td>35.2</td></tr><tr><td>LoRA</td><td>38.9/18.6/33.5</td><td>33.6</td><td>LoRA</td><td>42.9/19.4/34.8</td><td>35.8</td></tr><tr><td>PA</td><td>39.3/18.7/33.8</td><td>33.8</td><td>PA</td><td>43.9/20.6/35.6</td><td>36.4</td></tr><tr><td> S4-model</td><td>40.2/19.3/34.2</td><td>34.1</td><td> S4-3b-model</td><td>44.3/21.7/36.8</td><td>37.2</td></tr></table>
|
| 180 |
+
|
| 181 |
+
GLUE with RoBERTa Backbone. We directly apply the $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model (adopting design patterns discovered using T5-base and T5-3b) to fine-tune the RoBERTa-base and RoBERTalarge pretrained backbone models, respectively. We keep all the other settings the same and evaluate them on GLUE datasets. We also compare with variant methods randomly sampled from two design spaces: (i) $ { \boldsymbol { S } } _ { 0 }$ -model, where all the designs are randomly selected for RoBERTa as in $ { \boldsymbol { S } } _ { 0 }$ ; (ii) $S _ { 3 }$ - model, where strategies are randomly assigned to different RoBERTa layer groups as in $S _ { 3 }$ . Table 5 shows that (i) the design patterns (adopted by $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model) discovered using T5 models are applicable to the RoBERTa backbone models and outperform the investigated methods in GLUE average performance with no extra discovery process5; (ii) improved performance from $ { \boldsymbol { S } } _ { 0 }$ -models, $S _ { 3 }$ -models, to $S _ { 4 }$ -(3b)-models support adding more constraints in the pattern discovery process (Section 4).
|
| 182 |
+
|
| 183 |
+
SuperGLUE with XLNet Backbone. We also directly use the $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model (adopting design patterns discovered using T5-base and T5-3b) to fine-tune the XLNet-base and XLNetlarge pretrained backbone models without any extra discovery process. We keep all the other settings the same and evaluate them on SuperGLUE datasets. Table 17 (In the Appendix) reiterates the fact that our PEFT design patterns discovered from T5 models are generelizable to the XLNet backbone models and outperform the investigated methods in other tasks (SuperGLUE) with no additional discovery process.
|
| 184 |
+
|
| 185 |
+
Generation Tasks with BART Backbone. We further apply the $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model (adopting design patterns discovered using T5-base and T5-3b) to fine-tune the BART-base and BARTlarge pretrained backbone models, respectively. We evaluate the models on two generation tasks: summarization (XSUM) and machine translation (en-ro) following He et al. (2022). We also compare with PA (parallel adapter) using the same number of trainable parameters (He et al., 2022). Table 6 shows that our methods, although adopting design patterns discovered from classification tasks using T5, still outperform investigated parameter-efficient fine-tuning strategies on generation tasks with different BART backbones.
|
| 186 |
+
|
| 187 |
+
# 6 CONCLUSION
|
| 188 |
+
|
| 189 |
+
Parameter-efficient fine-tuning adapts knowledge in pretrained models to down-stream tasks in a more parameter-efficient fashion. Instead of focusing on designing another strategy in the first place, we introduced parameter-efficient fine-tuning design spaces. We empirically discovered several design patterns in parameter-efficient fine-tuning. These design patterns led to new parameter-efficient fine-tuning methods. Experiments showed that these methods consistently outperform investigated parameter-efficient fine-tuning strategies across different backbone models and different tasks in natural language processing.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Songhao Piao, Jianfeng Gao, Ming Zhou, et al. Unilmv2: Pseudo-masked language models for unified language model pre-training. arXiv preprint arXiv:2002.12804, 2020.
|
| 194 |
+
|
| 195 |
+
Ondˇrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aurelie N ´ ev´ eol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lu- ´ cia Specia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. Findings of the 2016 conference on machine translation. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 131–198, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/W16-2301. URL https://aclanthology.org/ W16-2301.
|
| 196 |
+
|
| 197 |
+
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, 2020.
|
| 198 |
+
|
| 199 |
+
Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. Electra: Pre-training text encoders as discriminators rather than generators. In International Conference on Learning Representations, 2019.
|
| 200 |
+
|
| 201 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019.
|
| 202 |
+
|
| 203 |
+
Ning Ding, Yujia Qin, Guang Yang, Fuchao Wei, Zonghan Yang, Yusheng Su, Shengding Hu, Yulin Chen, Chi-Min Chan, Weize Chen, Jing Yi, Weilin Zhao, Xiaozhi Wang, Zhiyuan Liu, HaiTao Zheng, Jianfei Chen, Yang Liu, Jie Tang, Juanzi Li, and Maosong Sun. Delta tuning: A comprehensive study of parameter efficient methods for pre-trained language models, 2022. URL https://arxiv.org/abs/2203.06904.
|
| 204 |
+
|
| 205 |
+
Demi Guo, Alexander M Rush, and Yoon Kim. Parameter-efficient transfer learning with diff pruning. arXiv preprint arXiv:2012.07463, 2020.
|
| 206 |
+
|
| 207 |
+
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.
|
| 208 |
+
|
| 209 |
+
Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654, 2020.
|
| 210 |
+
|
| 211 |
+
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, 2019a.
|
| 212 |
+
|
| 213 |
+
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 Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2790–2799. PMLR, 09–15 Jun 2019b. URL http://proceedings.mlr. press/v97/houlsby19a.html.
|
| 214 |
+
|
| 215 |
+
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. URL https: //arxiv.org/abs/2106.09685.
|
| 216 |
+
|
| 217 |
+
Ganesh Jawahar, Benoˆıt Sagot, and Djame Seddah. What does BERT learn about the structure of ´ language? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3651–3657, Florence, Italy, July 2019. Association for Computational Linguistics.
|
| 218 |
+
|
| 219 |
+
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64–77, 2019.
|
| 220 |
+
|
| 221 |
+
Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. Compacter: Efficient low-rank hypercomplex adapter layers. Advances in Neural Information Processing Systems, 34:1022– 1035, 2021.
|
| 222 |
+
|
| 223 |
+
Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 3045–3059, Online and Punta Cana, Dominican Republic, November 2021a. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.243. URL https://aclanthology.org/2021.emnlp-main.243.
|
| 224 |
+
|
| 225 |
+
Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning, 2021b.
|
| 226 |
+
|
| 227 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. SCL, 2020a.
|
| 228 |
+
|
| 229 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871–7880, Online, July 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https://www.aclweb.org/anthology/2020.acl-main.703.
|
| 230 |
+
|
| 231 |
+
Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation, 2021.
|
| 232 |
+
|
| 233 |
+
Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pp. 74–81, Barcelona, Spain, July 2004. Association for Computational Linguistics. URL https://aclanthology.org/W04-1013.
|
| 234 |
+
|
| 235 |
+
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. arXiv preprint arXiv:1907.11692, 2019.
|
| 236 |
+
|
| 237 |
+
Yuning Mao, Lambert Mathias, Rui Hou, Amjad Almahairi, Hao Ma, Jiawei Han, Scott Yih, and Madian Khabsa. UniPELT: A unified framework for parameter-efficient language model tuning. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 6253–6264, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.433. URL https://aclanthology. org/2022.acl-long.433.
|
| 238 |
+
|
| 239 |
+
Shashi Narayan, Shay B. Cohen, and Mirella Lapata. Don’t give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1797–1807, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1206. URL https://aclanthology.org/D18-1206.
|
| 240 |
+
|
| 241 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In ACL, 2002.
|
| 242 |
+
|
| 243 |
+
Jonas Pfeiffer, Aishwarya Kamath, Andreas Ruckl ¨ e, Kyunghyun Cho, and Iryna Gurevych. Adapter- ´ fusion: Non-destructive task composition for transfer learning. arXiv preprint arXiv:2005.00247, 2020.
|
| 244 |
+
|
| 245 |
+
Jonas Pfeiffer, Aishwarya Kamath, Andreas Ruckl ¨ e, Kyunghyun Cho, and Iryna Gurevych. Adapter- ´ Fusion: Non-destructive task composition for transfer learning. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 487–503, Online, April 2021. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2021.eacl-main.39.
|
| 246 |
+
|
| 247 |
+
Ilija Radosavovic, Justin Johnson, Saining Xie, Wan-Yen Lo, and Piotr Dollar. On network design ´ spaces for visual recognition, 2019. URL https://arxiv.org/abs/1905.13214.
|
| 248 |
+
|
| 249 |
+
Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollar. Designing ´ network design spaces, 2020. URL https://arxiv.org/abs/2003.13678.
|
| 250 |
+
|
| 251 |
+
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, 2020.
|
| 252 |
+
|
| 253 |
+
Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. arXiv preprint arXiv:1705.08045, 2017.
|
| 254 |
+
|
| 255 |
+
Timo Schick and Hinrich Schutze. Exploiting cloze-questions for few-shot text classification and ¨ natural language inference. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 255–269, Online, April 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.eacl-main.20. URL https: //aclanthology.org/2021.eacl-main.20.
|
| 256 |
+
|
| 257 |
+
Asa Cooper Stickland and Iain Murray. Bert and pals: Projected attention layers for efficient adaptation in multi-task learning. In International Conference on Machine Learning, pp. 5986–5995. PMLR, 2019.
|
| 258 |
+
|
| 259 |
+
Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. Ernie: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223, 2019.
|
| 260 |
+
|
| 261 |
+
Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. Lst: Ladder side-tuning for parameter and memory efficient transfer learning, 2022. URL https://arxiv.org/abs/2206.06522.
|
| 262 |
+
|
| 263 |
+
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 BlackboxNLP@EMNLP, 2018.
|
| 264 |
+
|
| 265 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in neural information processing systems, pp. 5754–5764, 2019.
|
| 266 |
+
|
| 267 |
+
Jiaxuan You, Rex Ying, and Jure Leskovec. Design space for graph neural networks, 2020. URL https://arxiv.org/abs/2011.08843.
|
| 268 |
+
|
| 269 |
+
Elad Ben Zaken, Shauli Ravfogel, and Yoav Goldberg. Bitfit: Simple parameter-efficient finetuning for transformer-based masked language-models, 2021. URL https://arxiv.org/ abs/2106.10199.
|
| 270 |
+
|
| 271 |
+
Aston Zhang, Yi Tay, Shuai Zhang, Alvin Chan, Anh Tuan Luu, Siu Hui, and Jie Fu. Beyond fullyconnected layers with quaternions: Parameterization of hypercomplex multiplications with $1 / n$ parameters. In International Conference on Learning Representations, 2021.
|
| 272 |
+
|
| 273 |
+
Mengjie Zhao, Tao Lin, Fei Mi, Martin Jaggi, and Hinrich Schutze. Masking as an efficient alterna-¨ tive to finetuning for pretrained language models. arXiv preprint arXiv:2004.12406, 2020.
|
| 274 |
+
|
| 275 |
+
Caleb Ziems, Jiaao Chen, Camille Harris, Jessica Anderson, and Diyi Yang. VALUE: Understanding dialect disparity in NLU. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3701–3720, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.258. URL https: //aclanthology.org/2022.acl-long.258.
|
| 276 |
+
|
| 277 |
+
# A MORE EXPERIMENTAL RESULTS
|
| 278 |
+
|
| 279 |
+
Table 7: Average performances (low-compute, low-epoch regime: 100 random models, tuning epochs $= 1 , 2 , 3 , 4 , 2 0$ for five different blocks) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different grouping constraints to the $S _ { 0 }$ design space.
|
| 280 |
+
|
| 281 |
+
<table><tr><td>Grouping Patterns</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td colspan="10">1 epochs</td></tr><tr><td>Increasing</td><td>73.2</td><td>63.3</td><td>67.8</td><td>68.8</td><td>63.8</td><td>67.2</td><td>64.1</td><td>11.0</td><td>59.9</td></tr><tr><td>Uniform</td><td>72.8</td><td>64.1</td><td>63.4</td><td>63.4</td><td>62.5</td><td>69.8</td><td>65.8</td><td>12.1</td><td>59.2</td></tr><tr><td>Decreasing</td><td>72.4</td><td>63.2</td><td>65.1</td><td>69.8</td><td>59.3</td><td>62.7</td><td>63.6</td><td>18.7</td><td>59.4</td></tr><tr><td>Spindle</td><td>72.6</td><td>64.8</td><td>66.8</td><td>71.1</td><td>62.1</td><td>62.3</td><td>64.8</td><td>12.3</td><td>59.6</td></tr><tr><td>Bottleneck</td><td>72.2</td><td>63.7</td><td>65.3</td><td>68.3</td><td>61.2</td><td>63.2</td><td>66.6</td><td>12.1</td><td>59.0</td></tr><tr><td colspan="10">2 epochs</td></tr><tr><td>Increasing</td><td>76.2</td><td>69.3</td><td>73.2</td><td>76.5</td><td>65.8</td><td>72.2</td><td>74.0</td><td>21.0</td><td>66.0</td></tr><tr><td>Uniform</td><td>74.8</td><td>70.9</td><td>74.1</td><td>75.6</td><td>66.5</td><td>73.4</td><td>71.2</td><td>22.1</td><td>66.1</td></tr><tr><td>Decreasing</td><td>71.4</td><td>70.1</td><td>72.1</td><td>76.8</td><td>64.3</td><td>71.7</td><td>73.6</td><td>18.7</td><td>64.8</td></tr><tr><td>Spindle</td><td>76.6</td><td>71.9</td><td>71.8</td><td>74.4</td><td>67.5</td><td>73.5</td><td>71.8</td><td>22.3</td><td>66.2</td></tr><tr><td>Bottleneck</td><td>74.2</td><td>71.1</td><td>69.6</td><td>73.3</td><td>65.2</td><td>73.3</td><td>73.6</td><td>24.1</td><td>65.5</td></tr><tr><td colspan="10">3 epochs</td></tr><tr><td>Increasing</td><td>85.3</td><td>74.9</td><td>77.2</td><td>77.5</td><td>66.8</td><td>76.2</td><td>76.0</td><td>33.0</td><td>70.8</td></tr><tr><td>Uniform</td><td>84.8</td><td>73.7</td><td>78.1</td><td>78.6</td><td>68.5</td><td>77.8</td><td>79.2</td><td>36.1</td><td>72.1</td></tr><tr><td>Decreasing</td><td>81.9</td><td>72.1</td><td>78.3</td><td>76.7</td><td>67.3</td><td>75.9</td><td>78.6</td><td>28.7</td><td>69.9</td></tr><tr><td>Spindle</td><td>86.9</td><td>75.5</td><td>79.8</td><td>79.4</td><td>69.8</td><td>78.3</td><td>80.1</td><td>47.3</td><td>74.6</td></tr><tr><td>Bottleneck</td><td>84.5</td><td>74.6</td><td>76.9</td><td>78.1</td><td>69.2</td><td>76.2</td><td>78.6</td><td>32.1</td><td>71.3</td></tr><tr><td colspan="10">4 epochs</td></tr><tr><td>Increasing</td><td>88.3</td><td>78.5</td><td>80.2</td><td>80.5</td><td>70.8</td><td>80.2</td><td>80.0</td><td>37.0</td><td>74.4</td></tr><tr><td>Uniform</td><td>88.8</td><td>78.9</td><td>81.9</td><td>81.5</td><td>71.5</td><td>80.8</td><td>81.4</td><td>39.1</td><td>75.4</td></tr><tr><td>Decreasing</td><td>87.6 89.6</td><td>74.1 79.8</td><td>80.8</td><td>81.7</td><td>79.3</td><td>78.9 81.3</td><td>79.6 82.1</td><td>38.7</td><td>75.1</td></tr><tr><td>Spindle Bottleneck</td><td>86.5</td><td>77.6</td><td>83.6</td><td>82.8</td><td>71.8</td><td></td><td></td><td>39.3</td><td>76.3</td></tr><tr><td></td><td></td><td></td><td>82.7</td><td>81.1</td><td>70.2</td><td>70.9</td><td>81.6</td><td>36.1</td><td>73.3</td></tr><tr><td colspan="10">20 epochs</td></tr><tr><td>Increasing</td><td>92.3</td><td>83.3</td><td>86.2</td><td>82.5</td><td>71.8</td><td>82.2</td><td>84.0</td><td>51.0</td><td>79.1</td></tr><tr><td>Uniform</td><td>92.8</td><td>83.9</td><td>86.1</td><td>83.6</td><td>72.5</td><td>83.8</td><td>84.2</td><td>52.1</td><td>79.9</td></tr><tr><td>Decreasing</td><td>91.4</td><td>82.1</td><td>85.1</td><td>83.1</td><td>69.3</td><td>81.7</td><td>83.6</td><td>48.7</td><td>78.1</td></tr><tr><td>Spindle</td><td>93.6</td><td>84.8</td><td>87.8</td><td>84.4</td><td>73.5</td><td>84.3</td><td>85.8</td><td>52.3</td><td>80.8</td></tr><tr><td>Bottleneck</td><td>92.1</td><td>82.6</td><td>85.6</td><td>83.3</td><td>71.2</td><td>83.2</td><td>84.6</td><td>52.1</td><td>79.3</td></tr></table>
|
| 282 |
+
|
| 283 |
+
# B GENERAL EFFECTIVENESS ON SUPERGLUE WITH XLNET BACKBONES
|
| 284 |
+
|
| 285 |
+
We also directly use the $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model (adopting design patterns discovered using T5- base and T5-3b) to fine-tune the XLNet-base and XLNet-large pretrained backbone models without any extra discovery process. We keep all the other settings the same and evaluate them on SuperGLUE datasets. Table 17 reiterates the fact that our PEFT design patterns discovered from T5 models are generelizable to the XLNet backbone models and outperform the investigated methods in other tasks (SuperGLUE) with no additional discovery process.
|
| 286 |
+
|
| 287 |
+
Table 8: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different $G _ { 1 }$ strategy assignment constraints to the $S _ { 3 }$ design space.
|
| 288 |
+
|
| 289 |
+
<table><tr><td>Strategy Assignment</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G1-Adapter (A)</td><td>89.8</td><td>83.5</td><td>84.9</td><td>80.8</td><td>72.5</td><td>80.8</td><td>78.5</td><td>37.7</td><td>76.1</td></tr><tr><td>G1-Prefix (P)</td><td>89.3</td><td>83.1</td><td>84.4</td><td>80.1</td><td>70.1</td><td>80.0</td><td>77.6</td><td>33.0</td><td>74.7</td></tr><tr><td>G1-BitFit (B)</td><td>89.0</td><td>82.9</td><td>84.1</td><td>81.4</td><td>72.0</td><td>81.1</td><td>77.0</td><td>30.8</td><td>74.8</td></tr><tr><td>G1-LoRA (L)</td><td>89.9</td><td>83.6</td><td>85.0</td><td>81.1</td><td>71.8</td><td>81.0</td><td>78.8</td><td>35.3</td><td>75.8</td></tr><tr><td>G1-(P,L)</td><td>89.1</td><td>82.8</td><td>85.1</td><td>81.2</td><td>71.9</td><td>81.5</td><td>79.1</td><td>35.0</td><td>75.7</td></tr><tr><td>G1-(A,P)</td><td>89.8</td><td>82.8</td><td>84.8</td><td>81.1</td><td>72.2</td><td>81.3</td><td>79.2</td><td>36.4</td><td>75.9</td></tr><tr><td>G1-(A,L)</td><td>89.6</td><td>83.8</td><td>85.6</td><td>81.3</td><td>72.9</td><td>81.7</td><td>79.5</td><td>36.8</td><td>76.4</td></tr><tr><td>G1-(A, P,L)</td><td>89.6</td><td>83.5</td><td>85.2</td><td>81.5</td><td>72.2</td><td>81.4</td><td>79.2</td><td>35.2</td><td>75.9</td></tr><tr><td>G1-(P, B,L)</td><td>89.3</td><td>83.6</td><td>85.5</td><td>81.6</td><td>72.3</td><td>81.0</td><td>78.8</td><td>35.7</td><td>76.0</td></tr><tr><td>G1-(A,P,B)</td><td>89.2</td><td>83.3</td><td>84.8</td><td>81.8</td><td>72.5</td><td>81.1</td><td>78.6</td><td>35.6</td><td>75.8</td></tr><tr><td>G1-(A,B,L)</td><td>89.8</td><td>83.4</td><td>84.8</td><td>81.1</td><td>72.6</td><td>81.6</td><td>79.4</td><td>34.8</td><td>75.9</td></tr><tr><td>G1-(A,P,B,L)</td><td>90.0</td><td>83.1</td><td>85.3</td><td>81.6</td><td>72.6</td><td>81.4</td><td>79.2</td><td>36.5</td><td>76.1</td></tr></table>
|
| 290 |
+
|
| 291 |
+
Table 9: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different $G _ { 2 }$ strategy assignment constraints with $G _ { 1 }$ -(L, A) to the $S _ { 3 }$ design space.
|
| 292 |
+
|
| 293 |
+
<table><tr><td>Strategy Assignment</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G2-Adapter (A)</td><td>91.6</td><td>84.3</td><td>85.5</td><td>82.3</td><td>73.5</td><td>82.8</td><td>81.3</td><td>38.8</td><td>77.5</td></tr><tr><td>G2-Prefix (P)</td><td>89.6</td><td>84.0</td><td>86.5</td><td>81.5</td><td>73.3</td><td>82.5</td><td>80.5</td><td>36.2</td><td>76.7</td></tr><tr><td>G2-BitFit (B)</td><td>91.2</td><td>83.6</td><td>85.7</td><td>82.9</td><td>72.6</td><td>82.6</td><td>80.8</td><td>33.1</td><td>76.5</td></tr><tr><td>G2-LoRA (L)</td><td>91.4</td><td>84.4</td><td>86.1</td><td>82.0</td><td>72.8</td><td>81.8</td><td>81.6</td><td>39.8</td><td>77.4</td></tr><tr><td>G2-(P, L)</td><td>91.6</td><td>84.6</td><td>86.8</td><td>81.8</td><td>73.8</td><td>82.8</td><td>82.0</td><td>38.5</td><td>77.7</td></tr><tr><td>G2-(A,P)</td><td>92.2</td><td>84.2</td><td>87.1</td><td>82.2</td><td>74.4</td><td>83.0</td><td>82.5</td><td>40.8</td><td>78.3</td></tr><tr><td>G2-(A,L)</td><td>92.0</td><td>84.4</td><td>86.5</td><td>81.8</td><td>73.6</td><td>82.6</td><td>82.2</td><td>40.1</td><td>77.9</td></tr><tr><td>G2-(A,P,L)</td><td>91.8</td><td>84.8</td><td>86.8</td><td>81.8</td><td>74.1</td><td>83.0</td><td>82.1</td><td>37.9</td><td>77.7</td></tr><tr><td>G2-(P,B,L)</td><td>91.6</td><td>84.1</td><td>87.1</td><td>82.0</td><td>74.0</td><td>82.9</td><td>82.4</td><td>35.8</td><td>77.4</td></tr><tr><td>G2-(A,P,B)</td><td>91.8</td><td>84.2</td><td>86.8</td><td>82.1</td><td>73.7</td><td>83.3</td><td>82.2</td><td>41.2</td><td>78.1</td></tr><tr><td>G2-(A,B,L)</td><td>92.2</td><td>84.3</td><td>86.1</td><td>82.0</td><td>74.1</td><td>83.2</td><td>82.0</td><td>37.6</td><td>77.6</td></tr><tr><td>G2-(A,P,B,L)</td><td>92.0</td><td>84.1</td><td>87.0</td><td>81.9</td><td>74.2</td><td>83.1</td><td>81.3</td><td>42.4</td><td>78.1</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Table 10: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different $G _ { 3 }$ strategy assignment constraints with $G _ { 1 }$ $\mathrm { _ { 1 } } – ( \mathrm { L } , \mathrm { A } ) - G _ { 2 }$ -(P, A) to the $S _ { 3 }$ design space.
|
| 296 |
+
|
| 297 |
+
<table><tr><td>Strategy Assignment</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G3-Adapter (A)</td><td>92.5</td><td>85.3</td><td>87.5</td><td>83.3</td><td>73.9</td><td>84.0</td><td>83.8</td><td>44.9</td><td>79.4</td></tr><tr><td>G3-Prefix (P)</td><td>91.5</td><td>84.7</td><td>86.7</td><td>82.6</td><td>74.2</td><td>83.8</td><td>82.9</td><td>40.5</td><td>78.4</td></tr><tr><td>G3-BitFit (B)</td><td>91.9</td><td>84.3</td><td>87.0</td><td>82.0</td><td>73.6</td><td>84.1</td><td>83.3</td><td>36.1</td><td>77.8</td></tr><tr><td>G3-LoRA (L)</td><td>92.8</td><td>85.4</td><td>87.8</td><td>83.5</td><td>74.7</td><td>82.4</td><td>84.0</td><td>44.0</td><td>79.3</td></tr><tr><td>G3-(P,L)</td><td>93.0</td><td>85.2</td><td>88.3</td><td>83.8</td><td>75.2</td><td>84.4</td><td>84.2</td><td>37.9</td><td>79.0</td></tr><tr><td>G3-(A,P)</td><td>92.4</td><td>85.6</td><td>88.1</td><td>83.6</td><td>75.0</td><td>84.2</td><td>84.0</td><td>41.8</td><td>79.3</td></tr><tr><td>G3-(A,L)</td><td>92.0</td><td>85.9</td><td>88.2</td><td>83.1</td><td>75.3</td><td>84.3</td><td>83.9</td><td>42.2</td><td>79.4</td></tr><tr><td>G3-(A,P,L)</td><td>92.6</td><td>86.0</td><td>87.5</td><td>83.4</td><td>75.6</td><td>84.6</td><td>83.5</td><td>43.9</td><td>79.6</td></tr><tr><td>G3-(P,B,L)</td><td>92.7</td><td>85.8</td><td>87.2</td><td>83.7</td><td>75.2</td><td>84.5</td><td>83.8</td><td>40.8</td><td>79.2</td></tr><tr><td>G3-(A,P,B)</td><td>93.3</td><td>85.8</td><td>88.6</td><td>84.0</td><td>75.5</td><td>84.9</td><td>84.1</td><td>42.1</td><td>79.8</td></tr><tr><td>G3-(A,B,L)</td><td>93.7</td><td>86.5</td><td>88.0</td><td>83.2</td><td>75.8</td><td>84.2</td><td>84.2</td><td>39.7</td><td>79.4</td></tr><tr><td>G3-(A,P, B,L)</td><td>93.3</td><td>85.6</td><td>87.7</td><td>83.8</td><td>75.2</td><td>84.3</td><td>84.4</td><td>41.6</td><td>79.4</td></tr></table>
|
| 298 |
+
|
| 299 |
+
Table 11: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different $G _ { 4 }$ strategy assignment constraints with ${ \cal G } _ { 1 ^ { - } } ( \mathrm { A } , \mathrm { L } ) - { \cal G } _ { 2 ^ { - } } ( \mathrm { A } , \mathrm { P } ) - { \cal G } _ { 3 } .$ -(A, P, B) to the $S _ { 3 }$ design space.
|
| 300 |
+
|
| 301 |
+
<table><tr><td>Strategy Assignment</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G4-Adapter (A)</td><td>93.8</td><td>85.8</td><td>88.6</td><td>84.8</td><td>76.3</td><td>85.8</td><td>86.0</td><td>48.5</td><td>81.2</td></tr><tr><td>G4-Prefix (P)</td><td>93.5</td><td>85.2</td><td>88.3</td><td>83.6</td><td>76.8</td><td>85.3</td><td>85.6</td><td>44.8</td><td>80.3</td></tr><tr><td>G4-BitFit (B)</td><td>94.1</td><td>85.3</td><td>88.9</td><td>84.4</td><td>77.1</td><td>85.4</td><td>86.2</td><td>46.1</td><td>80.9</td></tr><tr><td>G4-LoRA (L)</td><td>94.0</td><td>86.0</td><td>89.2</td><td>85.0</td><td>77.2</td><td>85.5</td><td>85.8</td><td>47.7</td><td>81.3</td></tr><tr><td>G4-(P,L)</td><td>94.3</td><td>86.2</td><td>89.3</td><td>85.8</td><td>78.0</td><td>86.0</td><td>88.2</td><td>47.2</td><td>81.8</td></tr><tr><td>G4-(A,P)</td><td>94.1</td><td>86.2</td><td>89.6</td><td>85.4</td><td>77.9</td><td>86.2</td><td>86.9</td><td>45.3</td><td>81.4</td></tr><tr><td>G4-(A,L)</td><td>94.2</td><td>85.9</td><td>89.2</td><td>85.5</td><td>77.8</td><td>86.2</td><td>88.0</td><td>46.8</td><td>81.7</td></tr><tr><td>G4-(A,P,L)</td><td>94.1</td><td>85.8</td><td>88.8</td><td>85.7</td><td>77.4</td><td>86.5</td><td>87.9</td><td>44.8</td><td>81.3</td></tr><tr><td>G4-(P,B,L)</td><td>94.6</td><td>86.4</td><td>90.4</td><td>86.1</td><td>78.2</td><td>86.8</td><td>88.5</td><td>47.2</td><td>82.3</td></tr><tr><td>G4-(A,P, B)</td><td>94.5</td><td>86.0</td><td>89.6</td><td>86.0</td><td>78.0</td><td>86.2</td><td>88.1</td><td>44.8</td><td>81.6</td></tr><tr><td>G4-(A,B,L)</td><td>94.3</td><td>86.4</td><td>89.2</td><td>85.6</td><td>78.2</td><td>86.4</td><td>88.3</td><td>46.6</td><td>81.9</td></tr><tr><td>G4-(A,P, B,L)</td><td>94.2</td><td>86.2</td><td>89.2</td><td>85.9</td><td>78.5</td><td>86.1</td><td>88.0</td><td>45.3</td><td>81.6</td></tr></table>
|
| 302 |
+
|
| 303 |
+
Table 12: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-3b pretrained backbone model. We compare adding different layer grouping constraints to the $ { \boldsymbol { S } } _ { 0 }$ design space.
|
| 304 |
+
|
| 305 |
+
<table><tr><td>Grouping Patterns</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>So-models</td><td>80.3</td><td>72.1</td><td>74.7</td><td>72.8</td><td>76.9</td><td>75.2</td><td>71.0</td><td>32.2</td><td>69.4</td></tr><tr><td>Increasing</td><td>84.4</td><td>75.7</td><td>83.0</td><td>78.3</td><td>82.7</td><td>80.3</td><td>76.3</td><td>42.1</td><td>75.3</td></tr><tr><td>Uniform</td><td>86.8</td><td>77.1</td><td>82.6</td><td>76.2</td><td>83.8</td><td>81.6</td><td>77.3</td><td>48.9</td><td>76.8</td></tr><tr><td>Decreasing</td><td>83.2</td><td>74.3</td><td>81.8</td><td>77.3</td><td>82.8</td><td>79.9</td><td>76.5</td><td>40.8</td><td>74.5</td></tr><tr><td>Spindle</td><td>88.6</td><td>78.8</td><td>83.7</td><td>77.7</td><td>84.2</td><td>80.9</td><td>78.3</td><td>44.6</td><td>77.1</td></tr><tr><td>Bottleneck</td><td>86.3</td><td>77.0</td><td>82.2</td><td>75.6</td><td>83.3</td><td>80.2</td><td>77.1</td><td>41.5</td><td>75.4</td></tr></table>
|
| 306 |
+
|
| 307 |
+
Table 13: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-3b pretrained backbone model. We compare adding different layer parameter constraints to the $S _ { 1 }$ design space.
|
| 308 |
+
|
| 309 |
+
<table><tr><td>Parameter Allocation</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>Increasing</td><td>90.3</td><td>79.3</td><td>84.9</td><td>79.3</td><td>85.2</td><td>82.8</td><td>79.2</td><td>50.1</td><td>78.9</td></tr><tr><td>Uniform</td><td>90.6</td><td>80.8</td><td>84.6</td><td>79.7</td><td>85.5</td><td>82.4</td><td>78.9</td><td>50.8</td><td>79.1</td></tr><tr><td>Decreasing</td><td>88.6</td><td>78.2</td><td>83.5</td><td>78.1</td><td>84.4</td><td>81.5</td><td>78.1</td><td>49.6</td><td>77.7</td></tr></table>
|
| 310 |
+
|
| 311 |
+
Table 14: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-3b pretrained backbone model. We compare adding different tuning groups constraints to the $S _ { 2 }$ design space.
|
| 312 |
+
|
| 313 |
+
<table><tr><td>Tunable Groups</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G1</td><td>88.3</td><td>78.3</td><td>82.2</td><td>77.4</td><td>82.1</td><td>80.7</td><td>76.1</td><td>49.4</td><td>76.8</td></tr><tr><td>G2</td><td>89.1</td><td>78.8</td><td>82.1</td><td>77.2</td><td>82.3</td><td>81.2</td><td>76.4</td><td>49.6</td><td>77.1</td></tr><tr><td>G3</td><td>89.6</td><td>78.5</td><td>82.6</td><td>78.1</td><td>83.8</td><td>81.9</td><td>77.4</td><td>48.7</td><td>77.5</td></tr><tr><td>G4</td><td>89.8</td><td>79.3</td><td>82.7</td><td>77.9</td><td>83.5</td><td>81.9</td><td>77.9</td><td>48.5</td><td>77.1</td></tr><tr><td>G1,G2</td><td>90.1</td><td>80.2</td><td>83.4</td><td>78.5</td><td>84.3</td><td>82.4</td><td>78.5</td><td>51.1</td><td>78.5</td></tr><tr><td>G3,G4</td><td>90.5</td><td>80.6</td><td>83.8</td><td>78.7</td><td>84.2</td><td>83</td><td>78.2</td><td>50.3</td><td>78.6</td></tr><tr><td>G1,G2,G3</td><td>90.6</td><td>80.3</td><td>84.9</td><td>79.3</td><td>84.7</td><td>82.9</td><td>79.3</td><td>50.2</td><td>79.0</td></tr><tr><td>G2,G3,G4</td><td>90.8</td><td>80.9</td><td>84.6</td><td>79.1</td><td>85.1</td><td>83.1</td><td>79.1</td><td>49.2</td><td>78.9</td></tr><tr><td>G1,G2,G3,G4</td><td>91.1</td><td>81.4</td><td>85.2</td><td>80.4</td><td>85.9</td><td>83.5</td><td>80.0</td><td>51.6</td><td>79.9</td></tr></table>
|
| 314 |
+
|
| 315 |
+
Table 15: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-3b pretrained backbone model. We compare adding different strategy assignment constraints following the process in Section 4.5.
|
| 316 |
+
|
| 317 |
+
<table><tr><td>Strategy Assignment</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>G1-Adapter (A)</td><td>91.1</td><td>81.4</td><td>86.1</td><td>80.5</td><td>86.7</td><td>83.3</td><td>80.1</td><td>50.8</td><td>80.0</td></tr><tr><td>G1-Prefix (P)</td><td>90.8</td><td>81.1</td><td>85.5</td><td>80.2</td><td>86.2</td><td>83.1</td><td>79.8</td><td>50.2</td><td>79.6</td></tr><tr><td>G1-BitFit (B)</td><td>90.2</td><td>81.3</td><td>85.1</td><td>79.6</td><td>85.8</td><td>82.8</td><td>79.6</td><td>49.5</td><td>79.2</td></tr><tr><td>G1-LoRA (L)</td><td>91.4</td><td>81.9</td><td>86.2</td><td>80.8</td><td>86.4</td><td>83.9</td><td>80.8</td><td>49.6</td><td>80.0</td></tr><tr><td>G1-(P,L)</td><td>91.8</td><td>82.9</td><td>86.8</td><td>81.3</td><td>87.1</td><td>84.2</td><td>81.6</td><td>52.3</td><td>81.0</td></tr><tr><td>G1-(A,P)</td><td>91.3</td><td>81.9</td><td>86.4</td><td>81.1</td><td>85.6</td><td>83.7</td><td>80.7</td><td>52.8</td><td>80.1</td></tr><tr><td>G1-(A,L)</td><td>91.6</td><td>82.3</td><td>86.1</td><td>81.5</td><td>85.8</td><td>84.9</td><td>81.5</td><td>51.8</td><td>80.6</td></tr><tr><td>G1-(A, P, L)</td><td>91.1</td><td>81.7</td><td>85.8</td><td>81.2</td><td>86.4</td><td>84.2</td><td>80.9</td><td>52.3</td><td>80.4</td></tr><tr><td>G1-(P,B,L)</td><td>91.5</td><td>82.8</td><td>86.3</td><td>81.4</td><td>86.1</td><td>83.6</td><td>81.2</td><td>51.5</td><td>80.5</td></tr><tr><td>G1-(A,P,B)</td><td>91.3</td><td>82.3</td><td>86.7</td><td>80.8</td><td>86.8</td><td>84.3</td><td>80.7</td><td>51.8</td><td>80.5</td></tr><tr><td>G1-(A,B,L)</td><td>91.7</td><td>82.5</td><td>86.2</td><td>81.3</td><td>86.3</td><td>84.6</td><td>81.3</td><td>51.7</td><td>80.7</td></tr><tr><td>G1-(A,P, B,L)</td><td>91.6</td><td>82.3</td><td>86.2</td><td>81.1</td><td>86.6</td><td>84.2</td><td>81.1</td><td>51.1</td><td>80.5</td></tr><tr><td>G2-Adapter (A)</td><td>92.1</td><td>82.5</td><td>86.4</td><td>81.8</td><td>87.2</td><td>84.8</td><td>81.8</td><td>53.8</td><td>81.3</td></tr><tr><td>G2-Prefix (P)</td><td>91.8</td><td>83.1</td><td>87.2</td><td>81.6</td><td>86.2</td><td>84.4</td><td>81.1</td><td>52.8</td><td>81.0</td></tr><tr><td>G2-BitFit (B)</td><td>91.2</td><td>82.1</td><td>86.4</td><td>81.1</td><td>86.3</td><td>84.6</td><td>80.3</td><td>53.1</td><td>80.6</td></tr><tr><td>G2-LoRA (L)</td><td>92.6</td><td>82.9</td><td>87.5</td><td>81.3</td><td>87.4</td><td>85.1</td><td>81.9</td><td>52.2</td><td>81.4</td></tr><tr><td>G2-(P,L)</td><td>91.6</td><td>82.7</td><td>87.6</td><td>81.6</td><td>87.8</td><td>85.3</td><td>82.1</td><td>52.8</td><td>81.4</td></tr><tr><td>G2-(A,P)</td><td>92.1</td><td>83.3</td><td>87.5</td><td>81.9</td><td>87.4</td><td>85.5</td><td>81.8</td><td>53.1</td><td>81.5</td></tr><tr><td>G2-(A,L)</td><td>92.5</td><td>83.7</td><td>88.1</td><td>82.2</td><td>87.4</td><td>85.7</td><td>82.9</td><td>53.6</td><td>82.1</td></tr><tr><td>G2-(A,P, L)</td><td>92.3</td><td>83.4</td><td>87.4</td><td>81.6</td><td>87.1</td><td>85.3</td><td>81.4</td><td>53.2</td><td>81.4</td></tr><tr><td>G2-(P,B,L)</td><td>91.8</td><td>83.1</td><td>87.4</td><td>81.5</td><td>87.2</td><td>85.1</td><td>82.7</td><td>53.8</td><td>81.5</td></tr><tr><td>G2-(A,P,B)</td><td>91.5</td><td>82.6</td><td>87.8</td><td>81.3</td><td>86.5</td><td>85.2</td><td>82.1</td><td>54.2</td><td>81.4</td></tr><tr><td>G2-(A,B,L)</td><td>92.6</td><td>83.5</td><td>87.2</td><td>82</td><td>87.3</td><td>86.5</td><td>82.5</td><td>52.8</td><td>81.8</td></tr><tr><td>G2-(A,P,B,L)</td><td>92.8</td><td>83.2</td><td>87.6</td><td>81.6</td><td>87.5</td><td>85.5</td><td>82.4</td><td>51.2</td><td>81.5</td></tr><tr><td>G3-Adapter (A)</td><td>92.6</td><td>84.1</td><td>88.3</td><td>81.8</td><td>87.8</td><td>85.4</td><td>82.8</td><td>55.2</td><td>82.2</td></tr><tr><td>G3-Prefix (P)</td><td>92.1</td><td>83.3</td><td>87.6</td><td>81.4</td><td>87.1</td><td>85.4</td><td>82.6</td><td>53.5</td><td>81.6</td></tr><tr><td>G3-BitFit (B)</td><td>92.4</td><td>83.9</td><td>88.4</td><td>82.1</td><td>87.2</td><td>85.8</td><td>82.4</td><td>53.3</td><td>81.9</td></tr><tr><td>G3-LoRA (L)</td><td>93.1</td><td>84.3</td><td>87.7</td><td>82.4</td><td>87.8</td><td>86.2</td><td>83.1</td><td>54.3</td><td>82.3</td></tr><tr><td>G3-(P,L)</td><td>92.8</td><td>84.1</td><td>88.7</td><td>82.6</td><td>88.2</td><td>86.2</td><td>83.3</td><td>54.7</td><td>82.6</td></tr><tr><td>G3-(A,P)</td><td>93.1</td><td>83.8</td><td>89.1</td><td>82.3</td><td>88.1</td><td>85.8</td><td>82.6</td><td>55.1</td><td>82.5</td></tr><tr><td>G3-(A,L)</td><td>92.7</td><td>84.5</td><td>88.4</td><td>82.8</td><td>88.2</td><td>86.1</td><td>83.5</td><td>54.6</td><td>82.6</td></tr><tr><td>G3-(A, P, L)</td><td>92.8</td><td>84.6</td><td>88.1</td><td>82.5</td><td>87.7</td><td>85.5</td><td>83.2</td><td>53.8</td><td>82.3</td></tr><tr><td>G3-(P,B,L)</td><td>93.6</td><td>84.9</td><td>89.3</td><td>83.1</td><td>88.2</td><td>86.5</td><td>83.9</td><td>55.8</td><td>83.2</td></tr><tr><td>G3-(A,P,B)</td><td>93.3</td><td>83.9</td><td>88.5</td><td>82.2</td><td>88.4</td><td>86.2</td><td>83.5</td><td>55.3</td><td>82.6</td></tr><tr><td>G3-(A,B,L)</td><td>93.4</td><td>84.2</td><td>88.9</td><td>82.6</td><td>87.8</td><td>85.8</td><td>84.2</td><td>54.9</td><td>82.7</td></tr><tr><td>G3-(A,P, B,L)</td><td>92.2</td><td>84.4</td><td>88.7</td><td>82.3</td><td>88.5</td><td>86.2</td><td>84.2</td><td>54.2</td><td>82.5</td></tr><tr><td>G4-Adapter (A)</td><td>92.8</td><td>85.2</td><td>89.1</td><td>83.5</td><td>87.8</td><td>86.5</td><td>84.2</td><td>56.3</td><td>83.2</td></tr><tr><td>G4-Prefix (P)</td><td>92.8</td><td>84.6</td><td>89.5</td><td>82.6</td><td>87.4</td><td>86.5</td><td>83.8</td><td>55.8</td><td>82.8</td></tr><tr><td>G4-BitFit (B)</td><td>93.8</td><td>84.9</td><td>89.5</td><td>83.3</td><td>88.7</td><td>86.8</td><td>84.4</td><td>55.2</td><td>83.3</td></tr><tr><td>G4-LoRA (L)</td><td>93.3</td><td>84.7</td><td>89.3</td><td>82.7</td><td>88.3</td><td>86.2</td><td>82.7</td><td>54.7 56.3</td><td>82.7 83.5</td></tr><tr><td>G4-(P,L)</td><td>93.8 93.8</td><td>85.3</td><td>89.6</td><td>83.6 84.3</td><td>88.6</td><td>86.8</td><td>84.6</td></table>
|
| 318 |
+
|
| 319 |
+
Table 16: Average performances (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model. We compare adding different layer grouping constraints to the $ { \boldsymbol { S } } _ { 0 }$ design space. Layer grouping is based on 8 groups.
|
| 320 |
+
|
| 321 |
+
<table><tr><td>Layer Grouping</td><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td><td>Avg</td></tr><tr><td>So-models</td><td>76.9</td><td>70.1</td><td>72.5</td><td>73.3</td><td>63.6</td><td>71.7</td><td>73.8</td><td>24.3</td><td>65.7</td></tr><tr><td>Increasing</td><td>83.2</td><td>74.1</td><td>76.6</td><td>77.1</td><td>67.7</td><td>76.8</td><td>74.7</td><td>30.0</td><td>70.0</td></tr><tr><td>Uniform</td><td>83.6</td><td>73.4</td><td>78.0</td><td>77.9</td><td>68.2</td><td>76.4</td><td>78.6</td><td>34.2</td><td>71.3</td></tr><tr><td>Decreasing</td><td>80.3</td><td>71.6</td><td>77.4</td><td>75.5</td><td>67.0</td><td>75.3</td><td>77.2</td><td>26.4</td><td>68.9</td></tr><tr><td>Spindle</td><td>86.2</td><td>74.3</td><td>79.1</td><td>78.6</td><td>68.5</td><td>77.4</td><td>79.5</td><td>35.1</td><td>72.3</td></tr><tr><td>Bottleneck</td><td>83.2</td><td>73.1</td><td>75.8</td><td>77.6</td><td>67.9</td><td>75.3</td><td>78.2</td><td>31.4</td><td>70.3</td></tr></table>
|
| 322 |
+
|
| 323 |
+
Table 17: Performances of different tuning methods on the SuperGLUE datasets using the XLNetbase (upper part) and XLNet-large (lower part) pretrained backbone models, respectively. The results are averaged over 10 random runs. The $S _ { 4 }$ -model and $S _ { 4 }$ -3b-model perform significantly better than the second-best PEFT methods in all the eight datasets at the significance level $p < 0 . 0 5$ $( ^ { \ast } )$ or even $p < 0 . 0 1 ( ^ { * * } )$ .
|
| 324 |
+
|
| 325 |
+
<table><tr><td>Method</td><td>BoolQ</td><td>CB</td><td>COPA</td><td>MultiRC</td><td>ReCoRD</td><td>RTE</td><td>WiC</td><td>WSC</td><td>Average</td></tr><tr><td>Adapter</td><td>72.8</td><td>71.3/78.0</td><td>64.0</td><td>67.0/24.5</td><td>71.0/71.8</td><td>76.2</td><td>65.0</td><td>60.8</td><td>66.2</td></tr><tr><td>Prefix</td><td>72.0</td><td>70.5/77.0</td><td>63.3</td><td>66.4/23.8</td><td>69.9/71.0</td><td>75.5</td><td>64.4</td><td>60.8</td><td>65.9</td></tr><tr><td>BitFit</td><td>71.8</td><td>70.0/76.2</td><td>62.8</td><td>65.8/22.6</td><td>69.4/70.6</td><td>74.5</td><td>64.8</td><td>60.6</td><td>65.2</td></tr><tr><td>LoRA</td><td>72.2</td><td>71.1/77.8</td><td>64.7</td><td>67.4/24.8</td><td>70.8/71.3</td><td>76.8</td><td>65.1</td><td>61.1</td><td>66.4</td></tr><tr><td>S4-model</td><td>73.8**</td><td>71.7/78.4*</td><td>65.9**</td><td>68.2/25.5**</td><td>71.1/72.0*</td><td>78.4**</td><td>65.8*</td><td>62.6*</td><td>67.5</td></tr><tr><td>Adapter</td><td>74.4</td><td>71.4/81.1</td><td>67.4</td><td>68.8/26.4</td><td>71.7/72.4</td><td>80.8</td><td>68.0</td><td>64.6</td><td>68.8</td></tr><tr><td>Prefix</td><td>72.4</td><td>70.0/78.3</td><td>66.9</td><td>68.8/25.8</td><td>70.9/71.2</td><td>78.8</td><td>66.9</td><td>64.0</td><td>67.7</td></tr><tr><td>BitFit</td><td>71.1</td><td>70.7/79.8</td><td>68.0</td><td>68.6/25.4</td><td>71.1/71.6</td><td>80.4</td><td>67.2</td><td>64.3</td><td>68.1</td></tr><tr><td>LoRA</td><td>74.1</td><td>72.1/80.9</td><td>67.9</td><td>69.1/26.8</td><td>72.0/72.8</td><td>81.0</td><td>67.8</td><td>64.4</td><td>69.0</td></tr><tr><td>S4-3b-model</td><td>76.8**</td><td>74.6/81.9**</td><td>68.6**</td><td>69.5/27.1*</td><td>72.4/73.3*</td><td>81.2*</td><td>68.2**</td><td>64.8*</td><td>69.7</td></tr></table>
|
| 326 |
+
|
| 327 |
+
Table 18: Total training time (low-compute, low-epoch regime: 100 random models, 3 tuning epochs) on the GLUE datasets using the T5-base pretrained backbone model with 8 A100 GPUs from $ { \boldsymbol { S } } _ { 0 }$ to $S _ { 1 }$ .
|
| 328 |
+
|
| 329 |
+
<table><tr><td>SST-2</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>STS-B</td><td>MRPC</td><td>CoLA</td></tr><tr><td>18 mins</td><td>22 mins</td><td>20 mins</td><td>40 mins</td><td>8 mins</td><td>12 mins</td><td>8 mins</td><td>6 mins</td></tr></table>
|
md/dev/a0SRWViFYW/a0SRWViFYW.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/aPXMGv7aeOn/aPXMGv7aeOn.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Compressible-composable NeRF via Rank-residual Decomposition
|
| 2 |
+
|
| 3 |
+
Jiaxiang Tang1, Xiaokang Chen1, Jingbo Wang2, Gang Zeng1,3
|
| 4 |
+
|
| 5 |
+
1School of Intelligence Science and Technology, Peking University 2Chinese University of Hong Kong 3Intelligent Terminal Key Laboratory of SiChuan Province {tjx, pkucxk}@pku.edu.cn, wj020@ie.cuhk.edu.hk, zeng@pku.edu.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Neural Radiance Field (NeRF) has emerged as a compelling method to represent 3D objects and scenes for photo-realistic rendering. However, its implicit representation causes difficulty in manipulating the models like the explicit mesh representation. Several recent advances in NeRF manipulation are usually restricted by a shared renderer network, or suffer from large model size. To circumvent the hurdle, in this paper, we present a neural field representation that enables efficient and convenient manipulation of models. To achieve this goal, we learn a hybrid tensor rank decomposition of the scene without neural networks. Motivated by the low-rank approximation property of the SVD algorithm, we propose a rank-residual learning strategy to encourage the preservation of primary information in lower ranks. The model size can then be dynamically adjusted by rank truncation to control the levels of detail, achieving near-optimal compression without extra optimization. Furthermore, different models can be arbitrarily transformed and composed into one scene by concatenating along the rank dimension. The growth of storage cost can also be mitigated by compressing the unimportant objects in the composed scene. We demonstrate that our method is able to achieve comparable rendering quality to state-of-the-art methods, while enabling extra capability of compression and composition. Code is available at https://github.com/ashawkey/CCNeRF.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Photo-realistic rendering and manipulation of 3D scenes have been long standing problems with numerous real-world applications, such as VR/AR, computer games, and video creation. Recently, the volumetric Neural Radiance Field (NeRF) representations [26, 1, 8, 27] show impressive progress in rendering photo-realistic images with rich details. However, due to this implicit representation of geometry and appearance, manipulating the underlying scenes encoded by NeRF still remains a challenging problem. To solve this problem, some works [21, 45, 19] introduce scene-specific features and scene agnostic rendering network, so that scenes trained with a shared rendering network can be composed together. However, the constrained and biased capability of these rendering networks causes difficulty in extending to various objects or scenes. New objects have to be trained with a fixed rendering network to be compatible with the old objects. Other works [36] discard the rendering network and adopt an no-neural-network NeRF representation, which is more convenient to manipulate the reconstructed scenes and is still able to render high-quality images. Nevertheless, the large storage requirement for each single model is detrimental to composing complex scenes with lots of objects.
|
| 14 |
+
|
| 15 |
+
We present a novel approach that allows efficient and convenient manipulation of scenes represented with our model. Two aspects should be fulfilled to achieve this goal. The first is that we can dynamically adjust the model size to support different levels of detail (LOD) in different scenarios.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Compressibility and Composability of our method. We present a tensor rank decomposition based neural field representation, which supports model compression through rank truncation, and arbitrary composition between different models through rank concatenation. Both of these operations require no extra optimization, or any constraints in training (e.g., a shared renderer).
|
| 19 |
+
|
| 20 |
+
This functions similar to mipmaps in graphics and requires no extra optimization step. The second is that all models can be transformed and composed arbitrarily for manipulation with no constraints in training. This promises that our models are always reusable, and support the most basic operations in a 3D editor like blender [9]. We name these two properties as compressibility and composability.
|
| 21 |
+
|
| 22 |
+
For the compressibility, we are motivated by the properties of Singular Value Decomposition (SVD) and High-order SVD (HOSVD) [10]. Our aim is to learn the decomposition of a 3D scene from only 2D observations like TensoRF [8], and further preserve the near-optimal low-rank approximation property. We propose a simple and flexible tensor rank decomposition based neural radiance field, and a rank-residual learning strategy. Each 3D scene is modeled by a 4D feature volume, which can be described with a set of rank components and a matrix storing the weights for each feature channel. The rank components are either vector- or matrix-based, corresponding to the CANDECOMP/PARAFAC (CP) decomposition [14, 4] and a less compact triple plane variant. We introduce a rank-residual learning strategy to encourage the lower ranks to preserve more important information of the whole scene. Combined with an empirical sort-and-truncate strategy, the proposed method achieves nearoptimal low-rank approximation at any targeted rank. Different LODs are represented with different low-rank truncations of the model, allowing dynamic trade-off between model size and rendering quality without retraining. Besides, our model contains no neural networks and thus naturally supports composability. Since there are no MLP renderers in our model, we can compose different objects by simply concatenating their rank components. A transformation matrix is recorded for each object to control its position and orientation in the scene.
|
| 23 |
+
|
| 24 |
+
As demonstrated in Figure 1, we are able to control each model’s LOD and size in a flexible range, and perform arbitrary transformation and composition of different models. Furthermore, these two properties are connected together through the underlying concept of rank, and can be combined in practical use. For example, we can mitigate the growth of model size of a complex scene composed of multiple objects, by compressing the less important objects. Our contributions can be summarized as follows: (1) We propose a simple radiance field representation based on two types of tensor rank decomposition, which allows flexible control of model size and naturally supports transformation and composition of different models. (2) We design a rank-residual learning strategy to enable near-optimal low-rank approximation. After training, our model can be dynamically adjusted to trade off between performance and model size without retraining. (3) The proposed method reaches comparable rendering quality with state-of-the-arts, while additionally enabling both compressibility and composability.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
# 2.1 Scene Representation with NeRF
|
| 29 |
+
|
| 30 |
+
3D scenes can be represented with various forms, including volumes, point clouds, meshes, and implicit representations [33, 34, 7, 30, 38, 25, 23, 28]. NeRF [26] proposes to use a 5D function to represent the scene and applies volumetric rendering for novel view synthesis, achieving photorealistic results and detailed geometry reconstruction. This powerful representation quickly receives attention and is extensively studied and applied in various fields [50, 24], such as generative settings [6, 37, 29, 5], dynamic scenes [20, 31], and texture mapping [44]. In particular, we categorize recent progress by the design of the underlying functions into three classes: neural network-based, hybrid and no-neural-network. neural network-based representations typically apply an MLP, as the implicit function to encode 3D scenes. The original NeRF [26] and most following works [1, 2, 51, 43, 46, 35] choose this representation for its simplicity. However, the training and inference speed of such a network is generally slow due to the relatively expensive MLP computation. Therefore, hybrid representations try to reduce the size of the MLP, by storing the 3D features in an explicit data structure. Since a dense 3D representation is unaffordable, different methods are explored. For example, NSVF [21] adopts sparse voxel grids, PlenOctrees [49] adopts octrees, instant-ngp [27] adopts a multi-scale hashmap, and TensoRF [8] factorizes the scene into lower-rank components. Querying such hybrid representation is much faster, thus reducing training and inference time and even reaching interactive FPS. Lastly, no-neural-network representations attempt to model the 3D scene without neural networks. Plenoxels [36] shows that only the explicit sparse voxels representation is enough to model complex 3D scenes. Our method also belongs to this representation, sharing the similar tensor rank decomposition idea to TensoRF [8], but we focus on two additional capabilities, i.e., compressibility and composability, which are important yet usually absent in previous work.
|
| 31 |
+
|
| 32 |
+
# 2.2 Tensor Decomposition and Low-rank Approximation
|
| 33 |
+
|
| 34 |
+
Decomposition of high-order tensors [18] can be considered as the generalizations of matrix singular value decomposition. The Tucker decomposition [40] decomposes a tensor into a core tensor multiplied by a matrix along each mode. The CANDECOMP/PARAFAC (CP) decomposition [14, 4] factorizes a tensor into a sum of component rank-one tensors, and can be viewed as a special case of Tucker where the core tensor is superdiagonal. The high-order singular value decomposition [10] provides a method to compute a specific Tucker decomposition with an all-orthogonal core tensor. Low-rank approximation is a common problem that applies tensor decomposition, and has found various applications such as image compression. Although the truncated HOSVD does not hold the optimal property contrary to the truncated SVD, it still results in a quasi-optimal solution [10, 41, 12], which is enough to yield a sufficiently good solution in practical uses. Tensor rank decomposition and its variants [10, 11] has been used in various vision and learning tasks [47, 8, 48]. Specifically, TensoRF [8] first leverages the CP decomposition and a Vertex-Matrix (VM) decomposition to factorize neural radiance fields, but its other designs (e.g., use of MLP) disturbs the property of tensor rank decomposition and prevents it from achieving compression or composition. Instead, we focus on modeling neural radiance fields only with tensor rank decomposition, and aim to preserve the low-rank approximation property, enabling the compression of a learned neural radiance field similar to the SVD compression of an image.
|
| 35 |
+
|
| 36 |
+
# 2.3 Manipulation and Composition of NeRF
|
| 37 |
+
|
| 38 |
+
Manipulation and Composition are important for a 3D representation’s practical usage. Explicit 3D representations, e.g., meshes, are natively editable and composable. However, neural network-based implicit representations like a vanilla NeRF is difficult to perform such operations. NSVF [21] can composite separate objects together, but these objects have to be trained together using a shared MLP, which limits its flexibility and potential usage. Later works [45, 29, 13, 19] learn object-compositional NeRF, but are usually scene-specific and do not allow cross-scene composition without retraining. Geometry and appearance editing [22, 42] of neural fields also requires an extra optimization step to modify the neural network-based representation. With the explicit sparse voxel representation, Plenoxels [36] naturally supports direct composition of different objects, but suffers from the large storage on the dense index matrix. Our method also supports arbitrary affine transformations and compositions without extra optimization. Further, we can efficiently mitigate the model size growth due to the compact tensor rank decomposition and the compressibility.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: Model structure. Our model is composed of a matrix storing rank weights for different feature channels, and a set of decomposed rank components. Each rank component can be either vectoror matrix-based, and the ratio can be controlled to trade off between model size and performance. To query any 3D coordinate, we first project it to the decomposed vectors or matrices as denoted by the black lines, and then perform weighted interpolation. $| |$ denotes concatenation along the rank dimension.
|
| 42 |
+
|
| 43 |
+
# 3 Methodology
|
| 44 |
+
|
| 45 |
+
# 3.1 Preliminaries on Neural Radiance Fields
|
| 46 |
+
|
| 47 |
+
Neural Radiance Fields (NeRF) [26] represents a 3D volumetric scene with a 5D function $f _ { \Theta }$ that maps a 3D coordinate $\mathbf { x } = ( x , y , z )$ and a 2D viewing direction $\mathbf { d } = ( \theta , \phi )$ into a volume density $\sigma$ and an emitted color $\mathbf { c } = ( r , g , b )$ . Given a ray $\mathbf { r }$ originating at $\mathbf { o }$ with direction $\mathbf { d }$ , we query $f _ { \Theta }$ at points $\mathbf x _ { i } = \mathbf o + t _ { i } \mathbf d$ sequentially sampled along the ray to get densities $\{ \sigma _ { i } \}$ and colors $\{ \mathbf { c } _ { i } \}$ . The color of the pixel corresponding to the ray is then estimated by numerical quadrature:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\hat { \mathbf { C } } ( \mathbf { r } ) = \sum _ { i } T _ { i } \alpha _ { i } \mathbf { c } _ { i } , T _ { i } = \prod _ { j < i } ( 1 - \alpha _ { j } ) , \alpha _ { i } = 1 - \exp ( - \sigma _ { i } \delta _ { i } ) , \delta _ { i } = t _ { i + 1 } - t _ { i }
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\delta _ { i }$ is the step size, $\alpha _ { i }$ is the opacity, and $T _ { i }$ is the transmittance. Since this volume rendering process is differentiable, NeRF can be optimized only from 2D image supervision by minimizing the L2 difference between each pixel’s predicted color $\hat { \mathbf { C } } ( \mathbf { r } )$ and the ground truth color $\mathbf { C } ( \mathbf { r } )$ from the image:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathcal { L } _ { \mathrm { N e R F } } = \sum _ { \mathbf { r } } | | \mathbf { C } ( \mathbf { r } ) - \hat { \mathbf { C } } ( \mathbf { r } ) | | _ { 2 } ^ { 2 }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
# 3.2 Preliminaries on Tensor Decomposition
|
| 60 |
+
|
| 61 |
+
For a 3D tensor $\mathcal { T } \in \mathbb { R } ^ { H \times W \times D }$ , each element $\mathcal { T } _ { i , j , k } \ \in \ \mathbb { R }$ can be represented via the Tucker decomposition [40] by:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathcal { T } _ { i , j , k } = \sum _ { p = 1 } ^ { P } \sum _ { q = 1 } ^ { Q } \sum _ { r = 1 } ^ { R } S _ { p , q , r } \mathbf { U } _ { i , p } ^ { x } \mathbf { U } _ { j , q } ^ { y } \mathbf { U } _ { k , r } ^ { z }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\pmb { S } \in \mathbb { R } ^ { P \times Q \times R }$ is the core tensor, $P , Q , R$ are the number of components along each axis, and ${ \bf U } ^ { x } \in \mathbb { R } ^ { H \times P } , { \bf U } ^ { y } \in \mathbb { R } ^ { W \times Q } , { \bf U } ^ { z } \in \bar { \mathbb { R } } ^ { \bar { D } \times R }$ are the factor matrices. The CP decomposition can be viewed as a special case of Tucker when $P = Q = R$ and $s$ is superdiagonal [18] (i.e., $S _ { i , j , k } \neq 0 \Longleftrightarrow i = j = k )$ ):
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal { T } _ { i , j , k } = \sum _ { r = 1 } ^ { R } \mathbf { s } _ { r } \mathbf { U } _ { i , r } ^ { x } \mathbf { U } _ { j , r } ^ { y } \mathbf { U } _ { k , r } ^ { z }
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\mathbf { s } = \mathrm { d i a g } ( \mathcal { S } ) \in \mathbb { R } ^ { R }$ is the reduced core tensor (or rank weights). Although s is usually absorbed into the factor matrices, we write it out for the convenience of later discussion.
|
| 74 |
+
|
| 75 |
+
# 3.3 Decompose NeRF without MLP
|
| 76 |
+
|
| 77 |
+
Hybrid Feature Volume Decomposition. We are interested in multi-feature volumetric encoded as a 4D tensor $\mathcal { T } \in \mathbb { R } ^ { C \times H \times W \times D }$ , where $C$ is the feature dimension (e.g., density, RGB values, or other features), and $( H , W , D )$ is the spatial resolution (usually $C \ll \operatorname* { m i n } ( H , W , D ) )$ . A straightforward way is to perform $C$ independent decompositions for each channel. However, different feature channels such as the RGB values are highly correlated in real 3D scenes. A more compact way is to share the factorized matrices like TensoRF [8], and only use different rank weights s for different channels. Therefore, we propose to represent $\tau$ through the CP decomposition by:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { T } _ { i , j , k } = \mathbf { S } \cdot ( \mathbf { U } _ { i } ^ { x } * \mathbf { U } _ { j } ^ { y } * \mathbf { U } _ { k } ^ { z } )
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\mathbf { S } \in \mathbb { R } ^ { C \times R }$ is the matrix of rank weights for $C$ channels, and $^ *$ denotes the Hadamard product. Since the above decomposition relies on rank-one vectors (1D tensors), it may require very high ranks to represent complex 3D scenes, which leads to expensive computation at each location. A less compact but more computation-friendly alternative is to adopt matrices (2D tensors) to factorize the 3D scene. This variant in the form of CP decomposition is given by:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { T } _ { i , j , k } = \mathbf { S } \cdot ( \mathcal { U } _ { i , j } ^ { x , y } * \mathcal { U } _ { j , k } ^ { y , z } * \mathcal { U } _ { i , k } ^ { x , z } )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\mathcal { U } ^ { x , y } \in \mathbb { R } ^ { H \times W \times R } , \mathcal { U } ^ { y , z } \in \mathbb { R } ^ { W \times D \times R } , \mathcal { U } ^ { x , z } \in \mathbb { R } ^ { H \times D \times R }$ are the factorized matrices along three planes, each containing $R$ components. This variant can be comprehended by first slicing and tiling the original 3D space along each axis, and then learning a CP decomposition on $\mathbb { R } ^ { H W \times W D \times H D }$ Although this representation is less compact and takes more storage, recent works [8, 5] have shown that it is able to represent scenes with smaller $R$ and better quality. We denote this variant as the Triple Plane (TP) decomposition. Further, we notice that for each individual rank, the underlying vector- or matrix-based decomposition can be selected independently. Therefore, a hybrid variant (HY) that combines the above CP and TP decomposition is proposed. We can flexibly adjust the ratio of two decompositions by $R = R _ { \mathrm { v e c } } + R _ { \mathrm { m a t } }$ to trade off between model size and performance. The model structure is illustrated in Figure 2.
|
| 90 |
+
|
| 91 |
+
Learning the Decomposition via Differentiable Rendering. For simplicity, we take the CP decomposition as an example. Our model only consists of four tensors to optimize, i.e., S $, \mathbf { U } ^ { x } , \mathbf { U } ^ { y } , \mathbf { U } ^ { z }$ . To represent scenes through neural radiance fields, we need to learn the volume density $\sigma$ and color c at ach location. As the volu with one feature channel only dependent on the 3D coordinate . However, the color is dependent on $\mathbf { x }$ , we can representth the 3D location $\mathcal { T } _ { i , j , k } ^ { \mathrm { d e n s i t y } } \in \mathbb { R }$ $\mathbf { x }$ and the 2D viewing direction $\mathbf { d }$ , which is a 5D function in total. To represent it within the 3D feature volumes, we adopt the spherical harmonics (SH) functions to approximate the additional 2D viewing directions dependency [49, 36]. In particular, for spherical harmonics of maximum degree $\ell _ { \mathrm { m a x } }$ , it takes $( \ell _ { \mathrm { m a x } } + 1 ) ^ { 2 }$ SH coefficients to model the view-dependent color per channel. We use $\mathcal { T } _ { i , j , k } ^ { \kappa } \in \mathbb { R } ^ { ( \ell _ { \operatorname* { m a x } } + 1 ) ^ { 2 } } , \kappa \in \{ r , g , b \}$ to represent these coefficients. The density and color at each location (coordinate indices are omitted for simplicity) can then be represented with:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\sigma = \phi ( \mathcal { T } ^ { \mathrm { d e n s i t y } } ) ; c ^ { \kappa } = \psi ( \sum _ { \ell = 0 } ^ { \ell _ { \mathrm { m a x } } } \sum _ { m = - \ell } ^ { \ell } \mathcal { T } _ { \ell , m } ^ { \kappa } Y _ { \ell } ^ { m } ( \mathbf { d } ) ) , \kappa \in \{ r , g , b \}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\phi ( \cdot )$ is the density activation, $\psi ( \cdot )$ is the color activation, $\mathbf { d }$ is the viewing direction, and $Y _ { \ell } ^ { m }$ are the SH functions. Our model can then be optimized through the standard RGB loss in Equation 2.
|
| 98 |
+
|
| 99 |
+
# 3.4 Rank-residual Learning for Compressibility
|
| 100 |
+
|
| 101 |
+
The idea of low-rank approximation is to only keep the most important rank components, where the importance of each rank component can be represented by the singular values in the SVD algorithm. Similarly, we can define the importance of each rank component in our decomposition by the rank weights $\mathbf { S }$ averaged on all feature channels, and multiplied with the magnitude of three factor matrices along the rank dimension. However, the CP decomposition doesn’t hold this low-rank approximation property [18]. If we directly sort the rank components by the rank importance and truncate the model for compression, the rendering quality drops sharply compared to the optimal model (i.e., model retrained with the same parameters), as illustrated by the baseline method in Figure 3.
|
| 102 |
+
|
| 103 |
+
We propose a rank-residual learning strategy to close this performance gap and achieve near-optimal compression results. This strategy aims to simulate SVD’s low-rank approximation property, where the lower rank components contain more information and contribute more to the approximation. Since the rank components in our method can be flexibly adjusted, a direct solution is to train in a progressive way. Suppose the total number of ranks is $R$ , and the number of training stages is $M$ . The total $R$ rank components can be sequentially divided into $M$ non-empty groups, and we denote the accumulated number of ranks for each group by $R _ { m }$ where $m \in \{ 1 , 2 , \cdots , M \}$ . We start from training the first $R _ { 1 }$ rank components, and after its convergence, we fix them and append the next $R _ { 2 } - R _ { 1 }$ rank components to train in a new stage. In the last stage, all $R$ ranks are involved. However, this is inefficient since we need to make sure each stage is fully converged before increasing the number of ranks. A more efficient way is to train all stages in parallel. In particular, we simultaneously supervise the sequentially accumulated outputs from all $M$ groups. This can be viewed as supervising the outputs from $M$ truncations of the decomposition with a rank-residual loss:
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Compression at any rank. Combined with the empirical sort-and-truncate strategy, the proposed model achieves nearoptimal compression at any rank. We use the HY-S model on the LEGO dataset as an example, and the dashed lines indicate where we apply rank-residual supervision.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: Visualization of rank importance. Ranks are sorted column-wisely based on the averaged rank importance. The rank importance is more concentrated in the proposed method (right) compared to the baseline (left), which is crucial for truncationbased compression. We use the HY model on the LEGO dataset as an example, and the dashed lines indicate where we apply rank-residual supervision.
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathcal { L } _ { \mathrm { r e s i d u a l } } = \sum _ { \mathbf { r } \in \mathcal { R } } \sum _ { m = 1 } ^ { M } | | \mathbf { C } ( \mathbf { r } ) - \hat { \mathbf { C } } _ { m } ( \mathbf { r } ) | | _ { 2 } ^ { 2 }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $\hat { \mathbf { C } } _ { m } ( \mathbf { r } )$ is RGB values calculated from the truncated decomposition ${ \bf S } _ { m } , { \bf U } _ { m } ^ { x } , { \bf U } _ { m } ^ { y } , { \bf U } _ { m } ^ { z }$ which only keeps the first $R _ { m }$ rank components (taking the CP decomposition as an example). During training, each group is able to learn the residual error from previous groups, and eventually leads to the desired low-rank approximation property. Ideally, choosing $M = R$ groups assures this low-rank approximation property to hold at any targeted rank, but usually computationally unaffordable with a large $R$ . In practice we choose $M \ll R$ , so the property only holds at those dividing ranks $\{ R _ { m } \}$ . For any other rank $R ^ { \prime }$ , assuming $R _ { m } < R ^ { \prime } < R _ { m + 1 }$ , we first keep the fully covered $R _ { m }$ rank components, and then use the empirical sort-and-truncate strategy to select the remaining $R ^ { \prime } - R _ { m }$ ranks in the last group $\{ R _ { m } + 1 , \bar { R } _ { m } + 2 \cdots , R _ { m + 1 } \}$ . By selecting the top rank components with the largest average importance, it is enough to keep the near-optimal low-rank approximation property at any targeted ranks, as shown by the proposed method in Figure 3.
|
| 116 |
+
|
| 117 |
+
The decomposition model trained with our rank-residual learning allows dynamic adjustment of model size and rendering quality with no extra optimization. In practice, we usually need different LODs to adapt to different cases, such as the texture mipmaps. While the other NeRF representations need to retrain for different LODs and store every model separately, we just train once and get a unified model for all LODs. Given a targeted storage upper bound or performance lower bound, we only need to select the targeted rank and truncate the decomposition with the simple slicing operation.
|
| 118 |
+
|
| 119 |
+
# 3.5 Composability without Constraints
|
| 120 |
+
|
| 121 |
+
As illustrated in Figure 5, any 3D object or scene represented by our model can be composed without the constraints in previous work [21, 45]. Since our model describes each 3D scene with a set of rank components, composability is naturally accomplished by concatenating along the rank dimension and summing up the number of ranks $\begin{array} { r } { R = \sum _ { n = 1 } ^ { N } R _ { n } } \end{array}$ , where $n$ denotes the object index. In practice, this is implemented by appending new rank components to a parameter list, so that models with different resolution and decomposition forms can be composed together. For each object, we record its number of ranks so we can still distinguish it from the whole scene. Arbitrary affine transformations of individual objects are supported by recording a transformation matrix $\dot { \mathbf { T } } _ { n } \in \mathbb { R } ^ { 4 \times 4 }$ for each object, which includes the translation $\mathbf { t } _ { n } \in \mathbb { R } ^ { 3 }$ , rotation ${ \bf R } _ { n } \in \mathrm { S O } ( 3 )$ and scale $\mathbf { s } _ { n } \in \mathbb { R } ^ { 3 }$ . We warp the ray into each object’s coordinate system before querying the density $\{ \sigma _ { i , n } \}$ and color $\{ \mathbf { c } _ { i , n } \}$ at the sampled points:
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5: Compressing a scene composed of multiple objects. For a scene composed of lots of different objects, we can compress the less important objects to achieve better efficiency and less storage with a little sacrifice of rendering quality.
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\sigma _ { i , n } , \mathbf { c } _ { i , n } = f _ { \boldsymbol \Theta } ( \mathbf { T } _ { n } \mathbf { x } _ { i } , \mathbf { R } _ { n } \mathbf { d } )
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Here we assume the coordinate $\mathbf { x } _ { i }$ is homogeneous, and the viewing direction $\mathbf { d }$ is represented by a unit vector. To correctly handle the occlusion between different objects, we still sample one ray per pixel, and perform the composition at each sample point by:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\left\{ \begin{array} { l l } { \alpha _ { i } = 1 - \exp ( - \delta _ { i } \sum _ { n = 1 } ^ { N } \sigma _ { i , n } ) } \\ { \mathbf { c } _ { i } = \sum _ { n = 1 } ^ { N } \varphi _ { N } ( \sigma _ { i , n } ) \mathbf { c } _ { i , n } } \end{array} \right.
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
We sum up the density from all objects to calculate opacity, and weight the color by the density after the softmax function $\varphi _ { N }$ . The rendering formula in Equation 1 can then be applied to calculate the pixel color. Although the model size and rendering time grows linearly with the total number of ranks (complexity of the scene), we show in experiments that the compression property can be applied to mitigate the growth and improve efficiency.
|
| 137 |
+
|
| 138 |
+
# 4 Experiments
|
| 139 |
+
|
| 140 |
+
# 4.1 Implementation Details
|
| 141 |
+
|
| 142 |
+
The model is implemented with the PyTorch framework [32]. The degree for SH coefficients is 3, which equals 48 channels for the color feature. We use the Adam optimizer [16] with an initial learning rate of 0.02 for the factorized matrices, and 0.001 for the singular values. All the experiments are performed on one NVIDIA V100 GPU. The resolution of the feature grid is determined by the total number of voxels $N$ and the bounding box, where $N$ is increased from $1 2 8 ^ { 3 }$ to $3 0 0 ^ { 3 }$ for HY models and $5 0 0 ^ { 3 }$ for CP models in early training steps. To accelerate rendering, we adopt the binary occupancy mask pruning technique as in [8, 27], and use separate rank components for density and color to avoid unnecessary querying in empty space. This occupancy mask is also used to shrink the initial bounding box for more precise modeling. We mainly carry out experiments on the NeRF-synthetic dataset [26] (CC BY 3.0 license) and the Tanks and Temples dataset [17] (CC BY-NC-SA 3.0 license). Please check the supplementary materials for more details.
|
| 143 |
+
|
| 144 |
+
# 4.2 Compression Results
|
| 145 |
+
|
| 146 |
+
Firstly, We evaluate the compressibility of our model. Since the color components cost most of the total storage, we mainly focus on compressing the color components, and keep the density components fixed. Given the number of ranks $R$ , we first train two models with the original loss
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 6: Visualization of compression. The baseline method deteriorates significantly, while our proposed method remains high rendering quality.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 7: Visualization of composition. We show composition between different models with our method. Our method can successfully handle occlusion and remain high-quality rendering.
|
| 153 |
+
|
| 154 |
+
Table 1: Compression Results. We report the PSNR for different compression strategies. CP, $R _ { \mathrm { v e c } } ^ { \mathrm { d e n s i t y } } / R _ { \mathrm { m a t } } ^ { \mathrm { d e n s i t y } } { - } R _ { \mathrm { v e c } } ^ { \mathrm { c o l o r } } / R _ { \mathrm { m a t } } ^ { \mathrm { c o l o r } }$ model settings with different range of ranks. Ranks are denoted by. We emphasize how the proposed method improves over the truncate baseline, especially at highly compressed conditions.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Model</td><td>Ranks</td><td>Resolution</td><td>Size (MB)</td><td>Optimal</td><td>Baseline</td><td>Proposed</td></tr><tr><td rowspan="4">CP</td><td>96/0-384/0</td><td>500</td><td>4.4</td><td>30.78</td><td>30.78</td><td>30.55 (-0.23)</td></tr><tr><td>96/0-288/0</td><td>500</td><td>3.8</td><td>30.68</td><td>28.78</td><td>30.46 (+1.68)</td></tr><tr><td>96/0-192/0</td><td>500</td><td>3.2</td><td>30.38</td><td>26.95</td><td>30.15 (+3.20)</td></tr><tr><td>96/0-96/0</td><td>500</td><td>2.7</td><td>29.78</td><td>24.97</td><td>29.53 (+4.56)</td></tr><tr><td rowspan="5">HY-S</td><td>96/0-96/64</td><td>300</td><td>68.9</td><td>31.54</td><td>31.54</td><td>31.22 (-0.32)</td></tr><tr><td>96/0-96/32</td><td>300</td><td>35.2</td><td>31.36</td><td>27.57</td><td>31.09 (+3.52)</td></tr><tr><td>96/0-96/16</td><td>300</td><td>18.4</td><td>31.04</td><td>25.66</td><td>30.83 (+5.17)</td></tr><tr><td>96/0-96/4</td><td>300</td><td>5.7</td><td>30.40</td><td>24.24</td><td>30.13 (+5.89)</td></tr><tr><td>96/0-96/0</td><td>300</td><td>1.5</td><td>29.49</td><td>23.54</td><td>29.30 (+5.76)</td></tr><tr><td rowspan="4">HY</td><td>64/16-256/64</td><td>300</td><td>88.0</td><td>32.43</td><td>32.43</td><td>32.36(-0.07)</td></tr><tr><td>64/16-192/48</td><td>300</td><td>70.8</td><td>32.42</td><td>30.63</td><td>32.35 (+1.72)</td></tr><tr><td>64/16-128/32</td><td>300</td><td>53.7</td><td>32.31</td><td>28.50</td><td>32.29 (+4.09)</td></tr><tr><td>64/16-64/16</td><td>300</td><td>36.5</td><td>31.96</td><td>26.30</td><td>31.94 (+5.64)</td></tr></table>
|
| 157 |
+
|
| 158 |
+
$\mathcal { L } _ { \mathrm { N e R F } }$ in Equation 2 and our rank-residual loss $\mathcal { L } _ { \mathrm { r e s i d u a l } }$ in Equation 8. We denote them as $\mathcal { M } _ { R }$ and ${ \mathcal { M } } _ { R } ^ { \mathrm { o u r s } }$ , respectively. At any targeted rank $r \leq R$ to compress, we design three strategies to verify whether the proposed compression is near-optimal: (1) Retrain a model $\mathcal { M } _ { r }$ with $\mathcal { L } _ { \mathrm { N e R F } }$ at the given rank. This requires a retraining from scratch, and can be viewed as the optimal compression result at the given rank. (2) Sort and truncate the rank of the original model $\mathcal { M } _ { R }$ to ${ \mathcal { M } } _ { r } ^ { \mathrm { b a s e } }$ , which can be viewed as the baseline compression result. (3) Sort and truncate the rank of the proposed model ${ \mathcal { M } } _ { R } ^ { \mathrm { o u r s } }$ to $\mathcal { M } _ { r } ^ { \mathrm { o u r s } }$ . We denote these three settings as ‘Optimal’, ‘Baseline’, and ‘Proposed’ respectively.
|
| 159 |
+
|
| 160 |
+
The quantitative results are listed in Table 1. We find that the performance of the baseline method degrades significantly compared to the optimal method, whereas our proposed method is comparable to the optimal method at all targeted ranks. The visualization in Figure 6 demonstrates how the baseline model gradually deteriorates compared to the proposed model. Note that at the the right-most column where the baseline model is not compressed and the same as the optimal model, the rendering quality of the proposed model is hard to discern from the optimal model. In Figure 3, we show that even though our model is only supervised at 5 discrete ranks, it can remain good compression quality at any other ranks. Figure 3 provides an explanation for the compressibility of our model. With the rank-residual learning, the rank importance is more concentrated to the lower ranks, which benefits the low-rank approximation.
|
| 161 |
+
|
| 162 |
+
Table 2: Comparison with recent methods. Our method achieves comparable results while enabling both capability of compression and composition.
|
| 163 |
+
|
| 164 |
+
<table><tr><td></td><td></td><td colspan="2">Capability</td><td colspan="2">Synthetic-NeRF</td><td colspan="2">TanksTemples</td></tr><tr><td>Method</td><td>Size (MB)</td><td>Composable</td><td>Compressible</td><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>SRN [38]</td><td>-</td><td>X</td><td>X</td><td>22.26</td><td>0.846</td><td>24.10</td><td>0.847</td></tr><tr><td>NeRF[26]</td><td>5.0</td><td>×</td><td>X</td><td>31.01</td><td>0.947</td><td>25.78</td><td>0.864</td></tr><tr><td>NSVF [21]</td><td>1</td><td>√</td><td>X</td><td>31.75</td><td>0.953</td><td>28.48</td><td>0.901</td></tr><tr><td>SNeRG[15]</td><td>1771.5</td><td>X</td><td>X</td><td>30.38</td><td>0.950</td><td>1</td><td>-</td></tr><tr><td>PlenOctrees [49]</td><td>1976.3</td><td>√</td><td>X</td><td>31.71</td><td>1</td><td>27.99</td><td>0.917</td></tr><tr><td>Plenoxels [36]</td><td>778.1</td><td>√</td><td>X</td><td>31.71</td><td>-</td><td>27.43</td><td>0.906</td></tr><tr><td>DVGO [39]</td><td>612.1</td><td>X</td><td>X</td><td>31.95</td><td>0.975</td><td>28.41</td><td>0.911</td></tr><tr><td>TensoRF-CP-384 [8]</td><td>3.9</td><td>X</td><td>X</td><td>31.56</td><td>0.949</td><td>27.59</td><td>0.897</td></tr><tr><td>TensoRF-VM-192 [8]</td><td>71.8</td><td>X</td><td>X</td><td>33.14</td><td>0.963</td><td>28.56</td><td>0.920</td></tr><tr><td>Instant-NGP [27]</td><td>63.3</td><td>X</td><td>X</td><td>33.18</td><td>1</td><td>-</td><td>-</td></tr><tr><td>Ours-CP</td><td>4.4</td><td>√</td><td>√</td><td>30.55</td><td>0.935</td><td>27.01</td><td>0.878</td></tr><tr><td>Ours-HY-S</td><td>68.9</td><td>√</td><td>√</td><td>31.22</td><td>0.947</td><td>27.52</td><td>0.900</td></tr><tr><td>Ours-HY</td><td>88.0</td><td>√</td><td>√</td><td>32.37</td><td>0.955</td><td>28.08</td><td>0.913</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 4.3 Composition Results
|
| 167 |
+
|
| 168 |
+
In Figure 7, we demonstrate the composability of our method. Without extra optimization, we are able to perform affine transformation and composition of different models like composing meshes in a 3D editor. Note that our model can correctly handle the occlusion and collision between different objects. In Figure 5, we combine the compression capability of our model in scene composition. In a complex scene composed of lots of objects, we can compress the less important objects to make a trade-off between the model size and rendering quality.
|
| 169 |
+
|
| 170 |
+
# 4.4 Comparisons and Discussion
|
| 171 |
+
|
| 172 |
+
Rendering Quality. We compare our method with some recent works in Table 2. We focus on the extra capabilities to facilitate practical applications, but not boosting the rendering quality over the previous state-of-the-arts, since the vanilla NeRF [26] already reaches photo-realistic rendering in most cases. Although the performance of the proposed method is not the best, the simple model design with the extra compressibility and composability is unique and enables various applications.
|
| 173 |
+
|
| 174 |
+
MLP Renderers. As discussed in [8, 27], the absence of a small MLP renderer network generally leads to worse performance, especially for the specular details. However, these renderers are trained separately and cannot be shared across scenes unless explicitly restricted, which causes inconvenience or limits the potency of composition. We therefore discard the MLP at the cost of a slightly worse rendering quality, but facilitates the composition and compression.
|
| 175 |
+
|
| 176 |
+
Limitations. Although our method can correctly compose the geometry of multiple objects, we don’t consider the lighting conditions. Our model bakes lighting conditions into the color like the vanilla NeRF, and cannot perform re-lighting to achieve consistent lighting effect after composition. A future direction is to integrate the reflectance models [3, 52]. Besides, we only support modeling bounded objects for now. A background model [51] can be combined to simulate unbounded scenes.
|
| 177 |
+
|
| 178 |
+
# 5 Conclusion
|
| 179 |
+
|
| 180 |
+
In this work, we present a novel compressible and composable neural radiance field representation. Our model is designed to be simple and flexible, yet still being effective enough to render photorealistic images. A rank-residual learning strategy is proposed to enable near-optimal low-rank approximation, which allows dynamic adjustment of the model size to support different LODs in different scenarios. All models represented with our method can be arbitrarily transformed and composed together like in a 3D editor. Powered by these properties, we are able to efficiently and conveniently manipulate complex scenes with multiple objects. We believe our method will further facilitate the NeRF-based scene representation in real-world applications.
|
| 181 |
+
|
| 182 |
+
Acknowledgements. This work is supported by the National Key Research and Development Program of China (2020YFB1708002), National Natural Science Foundation of China (61632003, 61375022, 61403005), Grant SCITLAB-20017 of Intelligent Terminal Key Laboratory of SiChuan Province, Beijing Advanced Innovation Center for Intelligent Robots and Systems (2018IRS11), and PEK-SenseTime Joint Laboratory of Machine Vision.
|
| 183 |
+
|
| 184 |
+
# References
|
| 185 |
+
|
| 186 |
+
[1] Jonathan T. Barron, Ben Mildenhall, Matthew Tancik, Peter Hedman, Ricardo Martin-Brualla, and Pratul P. Srinivasan. Mip-nerf: A multiscale representation for anti-aliasing neural radiance fields, 2021.
|
| 187 |
+
[2] Jonathan T Barron, Ben Mildenhall, Dor Verbin, Pratul P Srinivasan, and Peter Hedman. Mip-nerf 360: Unbounded anti-aliased neural radiance fields. arXiv preprint arXiv:2111.12077, 2021.
|
| 188 |
+
[3] Mark Boss, Raphael Braun, Varun Jampani, Jonathan T. Barron, Ce Liu, and Hendrik P.A. Lensch. Nerd: Neural reflectance decomposition from image collections. In ICCV, 2021.
|
| 189 |
+
[4] J Douglas Carroll and Jih-Jie Chang. Analysis of individual differences in multidimensional scaling via an n-way generalization of “eckart-young” decomposition. Psychometrika, 35(3):283– 319, 1970.
|
| 190 |
+
[5] Eric R Chan, Connor Z Lin, Matthew A Chan, Koki Nagano, Boxiao Pan, Shalini De Mello, Orazio Gallo, Leonidas Guibas, Jonathan Tremblay, Sameh Khamis, et al. Efficient geometryaware 3d generative adversarial networks. arXiv preprint arXiv:2112.07945, 2021.
|
| 191 |
+
[6] Eric R Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis. In CVPR, pages 5799–5809, 2021.
|
| 192 |
+
[7] Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. In CVPR, pages 5939–5948, 2019.
|
| 193 |
+
[8] Anpei Chen, Zexiang Xu, Andreas Geiger, Jingyi Yu, and Hao Su. Tensorf: Tensorial radiance fields. arXiv preprint arXiv:2203.09517, 2022.
|
| 194 |
+
[9] Blender Online Community. Blender - a 3D modelling and rendering package. Blender Foundation, Stichting Blender Foundation, Amsterdam, 2018.
|
| 195 |
+
[10] Lieven De Lathauwer, Bart De Moor, and Joos Vandewalle. A multilinear singular value decomposition. SIAM journal on Matrix Analysis and Applications, 21(4):1253–1278, 2000.
|
| 196 |
+
[11] Lieven De Lathauwer. Decompositions of a higher-order tensor in block terms—part ii: Definitions and uniqueness. SIAM Journal on Matrix Analysis and Applications, 30(3):1033–1066, 2008.
|
| 197 |
+
[12] Lars Grasedyck. Hierarchical singular value decomposition of tensors. SIAM journal on matrix analysis and applications, 31(4):2029–2054, 2010.
|
| 198 |
+
[13] Michelle Guo, Alireza Fathi, Jiajun Wu, and Thomas Funkhouser. Object-centric neural scene rendering. arXiv preprint arXiv:2012.08503, 2020.
|
| 199 |
+
[14] Richard A Harshman et al. Foundations of the parafac procedure: Models and conditions for an" explanatory" multimodal factor analysis. 1970.
|
| 200 |
+
[15] Peter Hedman, Pratul P Srinivasan, Ben Mildenhall, Jonathan T Barron, and Paul Debevec. Baking neural radiance fields for real-time view synthesis. In ICCV, pages 5875–5884, 2021.
|
| 201 |
+
[16] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 202 |
+
[17] Arno Knapitsch, Jaesik Park, Qian-Yi Zhou, and Vladlen Koltun. Tanks and temples: Benchmarking large-scale scene reconstruction. ACM Transactions on Graphics (ToG), 36(4):1–13, 2017.
|
| 203 |
+
|
| 204 |
+
[18] Tamara G. Kolda and Brett W. Bader. Tensor decompositions and applications. SIAM Rev., 51:455–500, 2009.
|
| 205 |
+
|
| 206 |
+
[19] Verica Lazova, Vladimir Guzov, Kyle Olszewski, Sergey Tulyakov, and Gerard Pons-Moll. Control-nerf: Editable feature volumes for scene rendering and manipulation. arXiv preprint arXiv:2204.10850, 2022.
|
| 207 |
+
|
| 208 |
+
[20] Zhengqi Li, Simon Niklaus, Noah Snavely, and Oliver Wang. Neural scene flow fields for space-time view synthesis of dynamic scenes. In CVPR, pages 6498–6508, 2021.
|
| 209 |
+
|
| 210 |
+
[21] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. NeurIPS, 2020.
|
| 211 |
+
|
| 212 |
+
[22] Steven Liu, Xiuming Zhang, Zhoutong Zhang, Richard Zhang, Jun-Yan Zhu, and Bryan Russell. Editing conditional radiance fields. In ICCV, pages 5773–5783, 2021.
|
| 213 |
+
|
| 214 |
+
[23] Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural volumes: Learning dynamic renderable volumes from images. arXiv preprint arXiv:1906.07751, 2019.
|
| 215 |
+
|
| 216 |
+
[24] Ricardo Martin-Brualla, Noha Radwan, Mehdi SM Sajjadi, Jonathan T Barron, Alexey Dosovitskiy, and Daniel Duckworth. Nerf in the wild: Neural radiance fields for unconstrained photo collections. In CVPR, pages 7210–7219, 2021.
|
| 217 |
+
|
| 218 |
+
[25] Ben Mildenhall, Pratul P Srinivasan, Rodrigo Ortiz-Cayon, Nima Khademi Kalantari, Ravi Ramamoorthi, Ren Ng, and Abhishek Kar. Local light field fusion: Practical view synthesis with prescriptive sampling guidelines. ACM Transactions on Graphics (TOG), 38(4):1–14, 2019.
|
| 219 |
+
|
| 220 |
+
[26] 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. In ECCV, 2020.
|
| 221 |
+
|
| 222 |
+
[27] Thomas Müller, Alex Evans, Christoph Schied, and Alexander Keller. Instant neural graphics primitives with a multiresolution hash encoding. arXiv:2201.05989, January 2022.
|
| 223 |
+
|
| 224 |
+
[28] Jacob Munkberg, Jon Hasselgren, Tianchang Shen, Jun Gao, Wenzheng Chen, Alex Evans, Thomas Müller, and Sanja Fidler. Extracting triangular 3d models, materials, and lighting from images. arXiv preprint arXiv:2111.12503, 2021.
|
| 225 |
+
|
| 226 |
+
[29] Michael Niemeyer and Andreas Geiger. Giraffe: Representing scenes as compositional generative neural feature fields. In CVPR, pages 11453–11464, 2021.
|
| 227 |
+
|
| 228 |
+
[30] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In CVPR, pages 165–174, 2019.
|
| 229 |
+
|
| 230 |
+
[31] Keunhong Park, Utkarsh Sinha, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Steven M Seitz, and Ricardo Martin-Brualla. Nerfies: Deformable neural radiance fields. In ICCV, pages 5865–5874, 2021.
|
| 231 |
+
|
| 232 |
+
[32] 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.
|
| 233 |
+
|
| 234 |
+
[33] Charles R Qi, Hao Su, Matthias Nießner, Angela Dai, Mengyuan Yan, and Leonidas J Guibas. Volumetric and multi-view cnns for object classification on 3d data. In CVPR, pages 5648–5656, 2016.
|
| 235 |
+
|
| 236 |
+
[34] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, pages 652–660, 2017.
|
| 237 |
+
|
| 238 |
+
[35] Christian Reiser, Songyou Peng, Yiyi Liao, and Andreas Geiger. Kilonerf: Speeding up neural radiance fields with thousands of tiny mlps. In ICCV, pages 14335–14345, 2021.
|
| 239 |
+
|
| 240 |
+
[36] Sara Fridovich-Keil and Alex Yu, Matthew Tancik, Qinhong Chen, Benjamin Recht, and Angjoo Kanazawa. Plenoxels: Radiance fields without neural networks. In CVPR, 2022.
|
| 241 |
+
|
| 242 |
+
[37] Katja Schwarz, Yiyi Liao, Michael Niemeyer, and Andreas Geiger. Graf: Generative radiance fields for 3d-aware image synthesis. NeurIPS, 33:20154–20166, 2020.
|
| 243 |
+
|
| 244 |
+
[38] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. In NeurIPS, 2019.
|
| 245 |
+
|
| 246 |
+
[39] Cheng Sun, Min Sun, and Hwann-Tzong Chen. Direct voxel grid optimization: Super-fast convergence for radiance fields reconstruction. arXiv preprint arXiv:2111.11215, 2021.
|
| 247 |
+
|
| 248 |
+
[40] Ledyard R Tucker. Some mathematical notes on three-mode factor analysis. Psychometrika, 31(3):279–311, 1966.
|
| 249 |
+
|
| 250 |
+
[41] Nick Vannieuwenhoven, Raf Vandebril, and Karl Meerbergen. A new truncation strategy for the higher-order singular value decomposition. SIAM Journal on Scientific Computing, 34(2):A1027– A1052, 2012.
|
| 251 |
+
|
| 252 |
+
[42] Can Wang, Menglei Chai, Mingming He, Dongdong Chen, and Jing Liao. Clip-nerf: Text-andimage driven manipulation of neural radiance fields. arXiv preprint arXiv:2112.05139, 2021.
|
| 253 |
+
|
| 254 |
+
[43] Peng Wang, Lingjie Liu, Yuan Liu, Christian Theobalt, Taku Komura, and Wenping Wang. Neus: Learning neural implicit surfaces by volume rendering for multi-view reconstruction. arXiv preprint arXiv:2106.10689, 2021.
|
| 255 |
+
|
| 256 |
+
[44] Fanbo Xiang, Zexiang Xu, Milos Hasan, Yannick Hold-Geoffroy, Kalyan Sunkavalli, and Hao Su. Neutex: Neural texture mapping for volumetric neural rendering. In CVPR, pages 7119–7128, 2021.
|
| 257 |
+
|
| 258 |
+
[45] Bangbang Yang, Yinda Zhang, Yinghao Xu, Yijin Li, Han Zhou, Hujun Bao, Guofeng Zhang, and Zhaopeng Cui. Learning object-compositional neural radiance field for editable scene rendering. In ICCV, October 2021.
|
| 259 |
+
|
| 260 |
+
[46] Lior Yariv, Jiatao Gu, Yoni Kasten, and Yaron Lipman. Volume rendering of neural implicit surfaces. NeurIPS, 34, 2021.
|
| 261 |
+
|
| 262 |
+
[47] Jinmian Ye, Linnan Wang, Guangxi Li, Di Chen, Shandian Zhe, Xinqi Chu, and Zenglin Xu. Learning compact recurrent neural networks with block-term tensor decomposition. In CVPR, pages 9378–9387, 2018.
|
| 263 |
+
|
| 264 |
+
[48] Miao Yin, Yang Sui, Siyu Liao, and Bo Yuan. Towards efficient tensor decomposition-based dnn model compression with optimization framework. In CVPR, pages 10674–10683, 2021.
|
| 265 |
+
|
| 266 |
+
[49] Alex Yu, Ruilong Li, Matthew Tancik, Hao Li, Ren $\mathrm { N g }$ , and Angjoo Kanazawa. PlenOctrees for real-time rendering of neural radiance fields. In ICCV, 2021.
|
| 267 |
+
|
| 268 |
+
[50] Alex Yu, Vickie Ye, Matthew Tancik, and Angjoo Kanazawa. pixelnerf: Neural radiance fields from one or few images. In CVPR, pages 4578–4587, 2021.
|
| 269 |
+
|
| 270 |
+
[51] Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. Nerf $^ { + + }$ : Analyzing and improving neural radiance fields. arXiv preprint arXiv:2010.07492, 2020.
|
| 271 |
+
|
| 272 |
+
[52] Xiuming Zhang, Pratul P Srinivasan, Boyang Deng, Paul Debevec, William T Freeman, and Jonathan T Barron. Nerfactor: Neural factorization of shape and reflectance under an unknown illumination. ACM Transactions on Graphics (TOG), 40(6):1–18, 2021.
|
md/dev/d00kbjbYv2/d00kbjbYv2.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# How to Train Your DRAGON: Diverse Augmentation Towards Generalizable Dense Retrieval
|
| 2 |
+
|
| 3 |
+
Sheng-Chieh $\mathbf { L i n ^ { 1 * } }$ , Akari Asai2, Minghan $\mathbf { L i } ^ { 1 }$ , Barlas $\mathbf { O g u z } ^ { 3 }$ , Jimmy $\mathbf { L i n } ^ { 1 }$ , Yashar Mehdad3, Wen-tau ${ \bf Y i h ^ { 3 } }$ , and Xilun Chen3†
|
| 4 |
+
|
| 5 |
+
University of Waterloo1, University of Washington2, Meta $\mathrm { A I ^ { 3 } }$
|
| 6 |
+
|
| 7 |
+
{s269lin,m692li,jimmylin}@uwaterloo.ca, akari@cs.washington.edu {barlaso,mehdad,scottyih,xilun}@meta.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Various techniques have been developed in recent years to improve dense retrieval (DR), such as unsupervised contrastive learning and pseudo-query generation. Existing DRs, however, often suffer from effectiveness tradeoffs between supervised and zero-shot retrieval, which some argue was due to the limited model capacity. We contradict this hypothesis and show that a generalizable DR can be trained to achieve high accuracy in both supervised and zero-shot retrieval without increasing model size. In particular, we systematically examine the contrastive learning of DRs, under the framework of Data Augmentation (DA). Our study shows that common DA practices such as query augmentation with generative models and pseudo-relevance label creation using a cross-encoder, are often inefficient and suboptimal. We hence propose a new DA approach with diverse queries and sources of supervision to progressively train a generalizable DR. As a result, DRAGON,1 our Dense Retriever trained with diverse AuGmentatiON, is the first BERTbase-sized DR to achieve state-of-the-art effectiveness in both supervised and zero-shot evaluations and even competes with models using more complex late interaction.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Bi-encoder based neural retrievers allow documents to be pre-computed independently of queries and stored, enabling end-to-end retrieval among huge corpus for downstream knowledgeintensive tasks (Karpukhin et al., 2020; Reimers and Gurevych, 2019). Recently, Thakur et al. (2021b) show that bi-encoder retrievers still underperform BM25 in real-world scenarios, where training data is scarce. One potential solution is to design more expressive representations to capture more fine-grained token-level information; e.g., SPLADE $^ { + + }$ (Formal et al., 2022) and ColBERTv2 (Santhanam et al., 2022b) in Figure 1. However, these designs add complexity and latency to retrieval systems (Mackenzie et al., 2021).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Supervised versus zero-shot effectiveness comparison among existing state-of-the-art retrievers. All models use a BERT-base-sized (110M parameters) backbone except for GTR-XXL (4.8B parameters).
|
| 19 |
+
|
| 20 |
+
By contrast, dense retrieval (DR) is a simpler biencoder retriever that maps queries and documents into low-dimensional vectors and computes text similarity through a simple dot product. Top- $k$ retrieval can be performed directly using ANN search libraries (Johnson et al., 2021; Guo et al., 2020). Recently, various methods have been proposed to improve DR effectiveness while keeping its simple architecture, such as pre-training (Lee et al., 2019; Chang et al., 2020), query augmentation (Oguz et al., 2022), and distillation (Ren et al., 2021; Zeng et al., 2022). For example, pre-training on MS MARCO corpus improves accuracy in the fully supervised setting while leveraging other corpora can improve transfer in the zero-shot setting. However, improvement in one setting is only achieved at the expense of the other. Figure 1 plots existing state-of-the-art DR models with respect to their effectiveness on these two axes, which presents a clear tradeoff between supervised and zero-shot effectiveness (the blue line). The only exception, GTR-XXL (Ni et al., 2022), breaks the effectiveness tradeoff at the expense of efficiency (i.e., query encoding), which leverages very large pre-trained models with 40 times more parameters. This effectiveness tradeoff prompts some to hypothesize that we have fully exploited the capacity of BERT-basesized DR model (Ni et al., 2022) and explore how to cleverly increase model parameters without sacrificing retrieval efficiency. For example, the recent work (Wang et al., 2022; Dai et al., 2022) proposes to train one expert dense retriever for each specific scenario, resulting in slow adaptation to real-world applications (Asai et al., 2023).
|
| 21 |
+
|
| 22 |
+
In this work, we contradict this hypothesis and show that a generalizable DR can indeed be trained to achieve state-of-the-art effectiveness in both supervised and zero-shot evaluations without increasing model size. To this end, we first investigate the important factors contributing to the recent progress of DR. For example, DR seems to gain zero-shot transfer capability from pre-training on large-scale and diverse training queries (Izacard et al., 2021; Yu et al., 2022) while knowledge distillation can improve the supervision quality by automatically identifying relevant passages which are not labeled by humans (Ren et al., 2021; Zeng et al., 2022). To better understand these approaches, we devise a unified framework of data augmentation (DA) for contrastive learning. Under the framework, the previous work can be viewed as DA with different recipes of query augmentation and relevance label augmentation shown in Table 1. The DA framework also helps us design comprehensive studies for better DR training.
|
| 23 |
+
|
| 24 |
+
Guided by a detailed empirical exploration along the space of our DA framework, we find the following: (1) for relevance label augmentation, we identify that the key to training a generalizable dense retriever is to create diverse relevance labels for each query, for which we use multiple retrievers instead of a strong cross encoder; (2) with such diverse relevance labels, dense retrievers can be trained effectively using cheap and large-scale augmented queries (e.g., cropped sentences from a corpus) instead of the more expensive neural generative queries. This finding opens the door to further building cheap but useful training data in scale for DR in the future. Finally, we find that it is suboptimal for a dense retriever to learn the diverse relevance labels from multiple retrievers directly. Thus, we propose a simple strategy to progressively augment relevance labels which guides dense retrievers to learn diverse relevance signals more effectively.
|
| 25 |
+
|
| 26 |
+
Table 1: Categorization of existing DR models by their approaches to data augmentation.
|
| 27 |
+
|
| 28 |
+
<table><tr><td colspan="3">Model Qry Aug.</td><td>Label Aug. Corpus</td></tr><tr><td>RocketQAv2 (Ren et al., 2021) CL-DRD (Zeng et al., 2022)</td><td>×</td><td>CE</td><td>MARCO</td></tr><tr><td>coCondenser (Gao and Callan,2022) Contriever (Izacard etal.,2021) COCO-DR(Yu et al.,2022)</td><td>cropping</td><td>X</td><td>MARCO Wiki+ CCnet</td></tr><tr><td>GPL (Wang et al.,2022) PTR (Dai et al., 2022)</td><td>GenQ</td><td>X</td><td>BEIR BEIR</td></tr><tr><td>DRAGON</td><td>cropping+GenQ</td><td>retrievers</td><td>MARCO</td></tr></table>
|
| 29 |
+
|
| 30 |
+
Our final model is trained on 28 million augmented queries consisting of two types (cropped sentences and synthetic queries), as well as progressive relevance label augmentation using diverse (sparse, dense, and multi-vector) retrievers. As shown in Figure 1, DRAGON, a Dense Retriever trained with diverse AuGmentatiON, is the first dense retriever to break the supervised and zero-shot effectiveness tradeoff without increasing model size or retrieval complexity; e.g., GTR-XXL, SPLADE $^ { + + }$ and ColBERTv2.
|
| 31 |
+
|
| 32 |
+
We summarize our contributions as follows: (1) We conduct a systematic study of DR training under the lens of data augmentation, which provides some surprising but key insights into training a generalizable dense retriever; (2) We propose a progressive label augmentation strategy to guide a dense retriever to learn the diverse but complex relevance labels; (3) DRAGON, our BERT-base-sized DR, reaches state-of-the-art retrieval effectiveness in both supervised and zero-shot evaluations.
|
| 33 |
+
|
| 34 |
+
# 2 Background
|
| 35 |
+
|
| 36 |
+
In this section, we first introduce the retrieval task and contrastive learning for dense retrieval. We then provide a unified framework for understanding recent approaches to improve dense retrieval training as instances of data augmentation.
|
| 37 |
+
|
| 38 |
+
# 2.1 Training Dense Retrieval Models
|
| 39 |
+
|
| 40 |
+
Given a query $q$ , our task is to retrieve a list of documents to maximize some ranking metrics such as nDCG or MRR. Dense retrieval (DR) based on pre-trained transformers (Devlin et al., 2018; Raffel et al., 2020) encodes queries and documents as low dimensional vectors with a bi-encoder architecture and uses the dot product between the encoded vectors as the similarity score:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathbf { \sigma } _ { \mathbf { S } } ( q , d ) \triangleq \mathbf { e } _ { q _ { [ \mathbb { C } \mathrm { L S } ] } } \cdot \mathbf { e } _ { d _ { [ \mathbb { C } \mathrm { L S } ] } } ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\mathbf { e } _ { q _ { [ \mathrm { C L S ] } } }$ and $\mathbf { e } _ { d _ { [ \mathrm { C L S ] } } }$ are the [CLS] vectors at the last layer of BERT (Devlin et al., 2018).
|
| 47 |
+
|
| 48 |
+
Contrastive Learning is a commonly used method for training DR models by contrasting positive pairs against negatives. Specifically, given a query $q$ and its relevant document $d ^ { + }$ , we minimize the InfoNCE loss:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
- \log \frac { \exp ( \mathrm { s } ( q , d ^ { + } ) ) } { \exp ( \mathrm { s } ( q , d ^ { + } ) ) + \displaystyle \sum _ { j = 1 } ^ { k } \exp ( \mathrm { s } ( q , d _ { j } ^ { - } ) ) } .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
# 2.2 A Unified Framework of Improved Dense Retrieval Training: Data Augmentation
|
| 55 |
+
|
| 56 |
+
Data augmentation (DA) for contrastive learning has been widely used in many machine learning tasks (Chen et al., 2020; Thakur et al., 2021a). In fact, many recent approaches to train better DR, such as knowledge distillation, contrastive pretraining and pseudo query generation (GenQ), can be considered DA with different recipes respectively listed in the first three main rows of Table 1. We compare the DA recipes from the perspectives of query and relevance label augmentation. We refer readers to Appendix A.9 for more related work of advanced DR training strategies.
|
| 57 |
+
|
| 58 |
+
Query Augmentation. There are two common automatic approaches to increase the size of training queries from a given corpus, sentence cropping and pseudo query generation. The former can easily scale up query size without any expensive computation, which is used by the models for contrastive pre-training (the second section of Table 1; Gao and Callan, 2022; Izacard et al., 2021; Wu et al., 2022). The latter generates quality but more expensive human-like queries using large language models for DR pre-training (Oguz et al., 2022) or domain adaptation (the third section of Table 1; Wang et al., 2022; Dai et al., 2022). Concurrently to our work, Meng et al. (2023) explore various approaches to query augmentation, such as span selection and document summarization.
|
| 59 |
+
|
| 60 |
+
Relevance Label Augmentation. The aforementioned approaches to query augmentation often assume that the (or part of the) original document is relevant to the augmented queries, which may not be true and only provides a single view of relevance labeling. The recent work (the first section of Table 1; Ren et al., 2021; Zeng et al., 2022) improve
|
| 61 |
+
|
| 62 |
+
DR training with the positive passages predicted by cross encoders. These knowledge distillation approaches further improve training data quality through label augmentation, inspiring us to conduct relevance label augmentation on the augmented queries (i.e., cropped sentences and GenQ).
|
| 63 |
+
|
| 64 |
+
# 2.3 Settings for Empirical Studies
|
| 65 |
+
|
| 66 |
+
We introduce some basic experimental settings to facilitate the presentation of our empirical studies on data augmentation in Section 3. More detailed settings can be found in Section 4. Following previous work (Izacard et al., 2021; Xiao et al., 2022; Yu et al., 2022; Formal et al., 2022; Santhanam et al., 2022b), we consider MS MARCO (Bajaj et al., 2016) as supervised data and BEIR datasets for zero-shot evaluations. Thus, we use the 8.8 million MS MARCO passage corpus to conduct data augmentation and evaluate our trained models on MS MARCO Dev, consisting of 6980 queries from the development set with one relevant passage per query on average. We report MRR $@ 1 0$ (abbreviated as $\mathrm { R R } @ 1 0 )$ and Recall $@$ 1000 $( \mathbb { R } ^ { \mathbb { Q } 1 \mathbb { K } ) }$ as the evaluation metrics. For zero-shot evaluations, we use BEIR (Thakur et al., 2021b), consisting of $1 8 \mathrm { I R }$ datasets spanning diverse domains and tasks including retrieval, question answering, fact checking, question paraphrasing, and citation prediction. We report the averaged $\mathrm { n D C G } @ 1 0$ over 13 public BEIR datasets, named BEIR-13, making the numbers comparable to most existing approaches (Formal et al., 2021; Santhanam et al., 2022b).2
|
| 67 |
+
|
| 68 |
+
# 3 Pilot Studies on Data Augmentation
|
| 69 |
+
|
| 70 |
+
In this section, we first discuss the exploration space of data augmentation (DA) based on the framework in Section 2.2 and then conduct empirical studies on how to better train a dense retriever. Based on the empirical studies, we propose our DA recipe to train DRAGON, a Dense Retriever with diverse AuGmentatiON.
|
| 71 |
+
|
| 72 |
+
# 3.1 An Exploration of Data Augmentation
|
| 73 |
+
|
| 74 |
+
Query Augmentation. Following the discussion in Section 2.2, we consider the two common approaches to automatic query augmentation. Specifically, for sentence cropping, following Chen et al. (2022), we use the collection of 28 million sentences from the MS MARCO corpus consisting of 8.8 million passages. As for pseudo query generation, we use the 28 million synthetic queries sampled from the query pool generated by doct5query (Nogueira and Lin, 2019). In addition, we also consider augmenting the type of queries by mixing cropped sentences and synthetic queries.
|
| 75 |
+
|
| 76 |
+
Label Augmentation with Diverse Supervisions. Although cross encoder (CE) is known to create relevance labels with strong supervision, we hypothesize that CE still cannot capture diverse matching signals between text pairs. A query is often relevant to many documents from different perspectives (e.g., semantic or lexical matching), which cannot capture by a single labeling scheme (a strong model or even human). In this work, we seek multiple sources of supervisions from existing sparse, dense and multi-vector retrievers, which are more efficient than CE and suitable for labeling a large number of queries (see discussion in Section 5).
|
| 77 |
+
|
| 78 |
+
# 3.2 Training with Diverse Supervisions
|
| 79 |
+
|
| 80 |
+
We have introduced our searching space for query and label augmentation (with diverse supervisions); however, training a dense retriever on such augmented data is not trivial. First, how can we create training data using a teacher from any augmented queries (i.e., cropped sentences or pseudo generative queries)? Second, with the training data sets created from multiple teachers, how can we train a dense retriever to digest the multiple supervisions?
|
| 81 |
+
|
| 82 |
+
Formally speaking, given $N$ teachers, for each augmented query $q$ , we retrieve $N$ ranked lists (i.e., $\mathcal { P } _ { q } ^ { 1 } , \mathcal { P } _ { q } ^ { 2 } , \cdots , \mathcal { P } _ { q } ^ { N }$ with each list has $K$ passages) from the corpus with the respective teachers. We consider the ranked list $\mathcal { P } _ { q } ^ { n }$ from the $n$ -th teacher a source of supervision since the top- $k$ and last- $k ^ { \prime }$ passages in $\mathcal { P } _ { q } ^ { n }$ contain the teacher’s view on what is relevant and less relevant for the given query. We then discuss possible strategies to train a dense retriever with diverse supervisions.
|
| 83 |
+
|
| 84 |
+
Fused Supervision. An intuitive strategy is to fuse the multiple sources into a single high-quality supervision, which dense retrievers can learn from. For the augmented query $q$ , we conduct linear score fusion (Ma et al., 2021) on the $N$ ranked lists to form a new ranked list $\mathcal { F } _ { q }$ as a fused supervision.
|
| 85 |
+
|
| 86 |
+
Uniform Supervision. Another simple strategy is to provide a dense retriever with equal exposures to multiple sources of supervisions. Specifically, given a query, we uniformly sample a source of supervision; i.e., a ranked list $\mathcal { P } _ { q } ^ { n }$ , where $n \sim$ $\mathcal { U } ( 1 , N )$ . This approach naturally encourages the positive samples appearing in more ranked lists to be sampled and vice versa. The advantage is that fusion weight tuning is not required. Furthermore, models can see diverse supervisions from different teachers in contrast to fused supervision, which may be dominated by a single strong teacher.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: Illustration of progressive label augmentation. For each iteration of training, additional relevance labels from a teacher are augmented in the training data. By contrast, uniform supervision directly exposes models to all the supervisions (as in iteration 3) in the beginning.
|
| 90 |
+
|
| 91 |
+
Progressive Supervision. The previous two approaches directly give models supervisions from multiple teachers at once; however, learning directly from the mixture of supervision is challenging, especially for DR models which compute text matching with simple dot product. Inspired by the success of curriculum learning (Zeng et al., 2022), we propose an approach to progressive label augmentation to guide DR training with progressively more challenging supervision. Specifically, we train our models with uniform supervision for $N$ iterations and at each iteration, we augment relevance label using additional teacher, as illustrated in Figure 2; i.e., at iteration $T \leq N$ we uniformly sample a source of supervision, $\mathcal { P } _ { q } ^ { n }$ where $n \sim \mathcal { U } ( 1 , T )$ (see Appendix A.6 for more study and explanation). A key factor of this approach is how to arrange the order for easy-to-hard supervisions; namely, the trajectory of progressive supervision.
|
| 92 |
+
|
| 93 |
+
With any aforementioned strategy to obtain diverse supervisions, we train our dense retrievers using contrastive loss in Eq. (2). Specifically, given a query $q$ , we first obtain a source of supervision either from sampling $( \mathcal P _ { q } ^ { n } )$ or fusion $( \mathcal { F } _ { q } )$ ; then, we randomly sample a positive and hard negative from the top 10 passages and top 46–50 passages, respectively to form a triplet. The sampling scheme has been empirically proved to well preserve the supervised signal from a single teacher (Chen et al., 2022) (also see our study in Appendix A.5). In this work, we further extend the sampling scheme to obtain diverse supervisions from multiple teachers.
|
| 94 |
+
|
| 95 |
+
Table 2: Strategies to obtain multiple supervisions using cropped sentences as queries.
|
| 96 |
+
|
| 97 |
+
<table><tr><td></td><td>0 1</td><td>2</td><td>3</td><td>4</td><td>5*</td></tr><tr><td rowspan="2">Teacher</td><td rowspan="2">Contriever uniCOIL</td><td rowspan="2">ColBERTv2</td><td colspan="2">three teachers</td><td rowspan="2"></td></tr><tr><td>fused</td><td>unif.</td></tr><tr><td></td><td colspan="4">effectiveness of student</td><td>prog.</td></tr><tr><td>MARCO Dev</td><td>34.9 33.9 46.7 47.0</td><td>36.4 46.3</td><td>36.7 46.6</td><td>36.9 47.7</td><td>36.6</td></tr><tr><td>BEIR-13</td><td colspan="4">effectiveness of teacher</td><td>49.3</td></tr><tr><td>MARCO Dev</td><td>35.1 34.1</td><td>39.7</td><td>40.0</td><td>-</td><td></td></tr><tr><td>BEIR-13</td><td>△ 47.5</td><td>49.9</td><td>A</td><td>1</td><td>=</td></tr></table>
|
| 98 |
+
|
| 99 |
+
∗ The condition of column 5 corresponds to row 0 in Table 3. △ We do not evaluate uniCOIL on BEIR due to its requirement of expensive document expansion from corpus.
|
| 100 |
+
|
| 101 |
+
# 3.3 Empirical Studies
|
| 102 |
+
|
| 103 |
+
Strategies to Obtain Diverse Supervisions. We first conduct empirical studies on how to better train a dense retriever in a simplified setting by using the MS MARCO cropped sentences as augmented queries and obtain supervised labels using three teachers with diverse relevance score computation: uniCOIL (sparse), Contriever (dense) and ColBERTv2 (multi-vector). To compare the different strategies discussed in Section 3.2, We report the models trained with single (columns 0–2) and multiple (columns 3–5) sources of supervisions for 20 epochs and 60 epochs, respectively. For progressive supervision, we follow the supervision trajectory: uniCOIL Contriever $ \mathbf { C o l } .$ BERTv2 with 20 epochs for each of the three iterations $N = 3$ ). Note that for fused supervision, we use MS MARCO Dev queries to tune and obtain the best hyperparameters to create fusion list.
|
| 104 |
+
|
| 105 |
+
The results are tabulated in Table 2. We observe that when learning from a single supervision (columns 0–2), there is a tradeoff between supervised and zero-shot retrieval effectiveness. Learning from the fusion list only sees a slight improvement over supervised evaluation while no improvement observes in zero-shot evaluations (columns 0–2 vs 3). By contrast, the model sees notable improvements in zero-shot evaluations when trained with uniform supervision (columns 0–3 vs 4), indicating that learning from the diverse relevance labels from multiple retrievers separately rather than single strong supervision (ColBERTv2 or fused supervision) is key to gain generalization capability. Finally, we observe that progressive supervision can further guide a dense retriever to gain generalization capability over uniform supervision (column 4 vs 5). Thus, we use progressive supervision in the following experiments.
|
| 106 |
+
|
| 107 |
+
Table 3: Study on trajectory of progressive supervision using cropped sentences as queries.
|
| 108 |
+
|
| 109 |
+
<table><tr><td>Progressive supervision</td><td>MARCOdev</td><td>BEIR-13</td></tr><tr><td>trajectories</td><td>RR@10</td><td>nDCG@10</td></tr><tr><td>(0) uniCOIL→Contriever →ColBERTv2</td><td>36.6</td><td>49.3</td></tr><tr><td>(1) Contriever→uniCOIL→ColBERTv2</td><td>36.7</td><td>48.4</td></tr><tr><td>(2) ColBERTv2→ Contriever-→uniCOIL</td><td>36.4</td><td>47.7</td></tr><tr><td>(3) uniCOIL→Contriever →ColBERTv2*</td><td>36.8</td><td>47.4</td></tr></table>
|
| 110 |
+
|
| 111 |
+
∗ ColBERTv2 is the only teacher at the last (3rd) iteration.
|
| 112 |
+
|
| 113 |
+
Trajectory of Progressive Supervision. We then study how to better arrange the trajectories of progressive supervision in Table 3. We observe that different trajectories have much impact on models’ zero-shot retrieval effectiveness while a minor impact on supervised evaluation can be seen. For example, switching the sampling order between uniCOIL and Contriever results in a degrade of 1 point on the averaged $\mathrm { n D C G } @ 1 0$ over BEIR-13 (row 0 vs 1) while reversing the whole trajectory leads to a degrade with more than 1.5 points (row 0 vs 3). This observation reflects an intuition that the retrievers with better generalization capability may capture more complex matching signal between text pairs (ColBERTv2 shows better generalization capability than the other two teachers); thus, their relevance labels should be augmented at a later stage of model training. Finally, in row 3, we follow the trajectory in row 0 but only use ColBERTv2 as the only source of supervision instead of obtaining uniform supervision from the three teachers at the last iteration. This change results in worse zero-shot retrieval effectiveness, indicating that learning from diverse supervisions is key to training a generalizable dense retriever.
|
| 114 |
+
|
| 115 |
+
Query Augmentation. We study the impacts of query augmentation on models’ effectiveness under the scenario where supervision is given, which has not been studied so far in the field of dense retrieval. With the best trajectory of progressive supervision, we compare models trained using cropped sentences (rectangles), generative queries (GenQ; circles), their mixture (triangles) and human queries (cross) in Figure 3. We observe that query size is the key to successful training. Although training with limited (0.8M) cropped sentences cannot perform well in MS MARCO dataset, scaling up the size (28M) sees significant improvement over the model trained on 0.8M human queries. Similarly, in Figure 3 (b), model’s generalization capability shows a huge jump when scaling up query size. While surprisingly, cropped sentences can help dense retrievers to gain more generalization capability than human-like GenQ, a mixture of cropped sentences and GenQ yields strong retrieval effectiveness in supervised and zero-shot evaluations, when the query size is not large enough (0.8–8M).
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Impacts of query augmentation.
|
| 119 |
+
|
| 120 |
+
# 3.4 Training our DRAGONs
|
| 121 |
+
|
| 122 |
+
With the empirical studies on DR training, we then propose the final recipe to train our DRAGON. We train DRAGON for 20 epochs (around 130K steps) at each iteration, with the trajectory of progressive supervision: uniCOIL Contriever $ \mathrm { G T R } .$ - $\mathrm { X X L } \to \mathrm { C o l B E R T v 2 } \to \mathrm { S P L A D E } + + .$ . We list all the teacher model checkpoints for label augmentation in Appendix A.2. This trajectory is based on models’ retrieval effectiveness on BEIR with the intuition gained from Section 3.3 that a more generalizable model creates relevance labels with more complex matching signals. For query augmentation, we mix half of cropped sentences and synthetic queries as training queries. Note that we do not further fine-tune our models on the MS MARCO training queries. In addition, we train other three DRAGON variants. DRAGON-S and DRAGON-Q only use cropped sentences and synthetic queries, respectively. As for DRAGON+, we follow the same training procedure of DRAGON but switch the initialization from BERT to the masked auto-encoding pre-trained model, RetroMAE.3 We will discuss the impacts of initialization in Section 5. The implementation of DRAGONs and the fully augmented training data are detailed in Appendix A.3 and A.4, respectively.
|
| 123 |
+
|
| 124 |
+
# 4 Comparison with the State of the Art
|
| 125 |
+
|
| 126 |
+
# 4.1 Datasets and Baseline Models
|
| 127 |
+
|
| 128 |
+
In addition to MS MARCO development queries, we evaluate model supervised effectiveness on the TREC DL (Craswell et al., 2019, 2020) queries, created by the organizers of the 2019 (2020) Deep Learning Tracks at the Text REtrieval Conferences (TRECs), where 43 (53) queries with on average 95 (68) graded relevance labels per query (in contrast to 6980 queries with on average 1 non-graded relevance label per query in MS MARCO Dev) are released. We report $\mathrm { n D C G } @ 1 0$ , used by the organizers as the main metric. For zero-shot evaluations, we report models’ effectiveness on all the 18 datasets in BEIR (Thakur et al., 2021b). In addition, we use LoTTE (Santhanam et al., 2022b) consisting of questions and answers posted on StackExchange with five topics including writing, recreation, science, technology, and lifestyle. We evaluate models’ retrieval effectiveness in the pooled setting, where the passages and queries from the five topics are aggregated. Following Santhanam et al. (2022b), the retrieval effectiveness of Success $\textcircled { \omega } 5$ on search and forum queries are reported. The detailed evaluation on LoTTE is listed in Appendix A.8.
|
| 129 |
+
|
| 130 |
+
We compare DRAGONs with dense retrievers using the backbone of bert-base-uncased trained with advanced techniques, such as knowledge distillation (Ren et al., 2021; Zeng et al., 2022), contrastive pre-training (Gao and Callan, 2022; Izacard et al., 2021; Yu et al., 2022), masked auto-encoding pretraining (Wu et al., 2022; Xiao et al., 2022) and domain adaptation (Wang et al., 2022; Dai et al., 2022). We refer readers to more detailed baseline model descriptions in Appendix A.1.
|
| 131 |
+
|
| 132 |
+
# 4.2 Results
|
| 133 |
+
|
| 134 |
+
Supervised Evaluations. The first main row in Table 4 reports models’ retrieval effectiveness on MS MARCO passage ranking dataset. We first observe that some baseline dense retrievers which perform well in MS MARCO Dev set are either pre-trained on MS MARCO corpus (coCondenser and COTMAE) or well fine-tuned on MS MARCO training queries with cross-encoder distillation (CL-DRD and RocketQAv2). However, their retrieval effectiveness on MS MARCO Dev set is not well correlated to TREC DL queries, which have fine-grained human labels with different degrees of relevance. We hypothesize that these models are able to retrieve the most relevant passage from the corpus but cannot retrieve diverse passages with different degrees of relevance. By contrast, all the variants of DRAGON trained with diverse augmented relevance labels show consistently strong effectiveness in MS MARCO Dev and TREC DL queries.
|
| 135 |
+
|
| 136 |
+
Table 4: Comparison with existing state-of-the-art dense retrievers. Bold (underline) denotes the best (second best) effectiveness for each row among baseline dense models.
|
| 137 |
+
|
| 138 |
+
<table><tr><td></td><td>sparse mul-vec dense</td><td></td><td></td><td></td><td></td><td>baseline dense</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">ourdense</td></tr><tr><td>Rep type</td><td>0</td><td>2</td><td>3 4</td><td></td><td>5 6</td><td></td><td>7</td><td>8 9</td><td>A</td><td></td><td>B</td><td>C D</td><td></td><td>E</td><td>F</td></tr><tr><td></td><td></td><td>1 ColBERTv2</td><td>GTR-XXL CL-DRD</td><td></td><td>RocketQAv2/</td><td>COT-MAE</td><td>RetroMAE</td><td>/coCondenser/</td><td>Contriever</td><td>COCO-DR</td><td>0</td><td>美</td><td>DRAGON-S</td><td>DRAGON-Q</td><td>DRAGON+</td></tr><tr><td>Pre-training</td><td>SPLADE++</td><td>X</td><td>√</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DRAGON</td><td></td></tr><tr><td>Distillation</td><td>√ √</td><td>√</td><td>√</td><td>√</td><td>X √</td><td>√ √ X X</td><td>√ X</td><td>√ X</td><td>√ X</td><td>X √</td><td>√ X</td><td>X √</td><td>X √</td><td>X √</td><td>√ √</td></tr><tr><td>Target Corpust</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X X</td><td>X</td><td>X</td><td>√</td><td>√</td><td>√</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>MS MARCO (Supervised)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dev (RR@10)</td><td></td><td>39.7 38.8</td><td>38.1</td><td></td><td>38.8*</td><td>39.9* 35.4</td><td>38.6*</td><td>34.1</td><td>35.8</td><td></td><td>-</td><td>38.1</td><td>39.1</td><td>39.3</td><td>39.0</td></tr><tr><td>Dev (R@1K)</td><td>38.9 98.2</td><td>98.4</td><td>99.0</td><td>97.9</td><td>98.1*</td><td>98.5* 97.5</td><td></td><td>98.4* 97.9</td><td>97.9</td><td>=</td><td></td><td>98.3</td><td>98.8</td><td>98.5</td><td>98.6</td></tr><tr><td>DL2019 (nDCG@ 10)</td><td>74.3</td><td>74.6</td><td>-</td><td>72.5</td><td>=</td><td>70.0*68.8</td><td></td><td>71.5* 67.8</td><td>74.1</td><td></td><td></td><td>73.6</td><td>74.0</td><td>74.1</td><td>74.4</td></tr><tr><td>DL2020 (nDCG@ 10)</td><td>71.8</td><td>75.2</td><td></td><td>68.3</td><td>=</td><td>67.8*71.4</td><td></td><td></td><td>69.7</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>-</td><td></td><td></td><td></td><td></td><td>BEIR (Zero-shot)</td><td>68.1*</td><td>66.1</td><td>=</td><td>-</td><td>70.0</td><td>72.6</td><td>72.9</td><td>72.3</td></tr><tr><td>nDCG@10</td><td></td><td></td><td>50.1</td><td>58.4</td><td>67.5</td><td>56.1 77.2</td><td>71.2</td><td></td><td>59.6 78.9</td><td>70.0</td><td>72.7</td><td>73.9</td><td>73.2</td><td>74.0</td><td>75.9</td></tr><tr><td>TREC-COVID NFCorpus</td><td>71.1 34.5</td><td>73.8 33.8</td><td>34.2</td><td>31.5</td><td>29.3</td><td>32.1</td><td>30.8</td><td>32.5 32.8</td><td>35.5</td><td>34.5</td><td>33.4</td><td>32.2</td><td>33.0</td><td>32.9</td><td>33.9</td></tr><tr><td>FiQA-2018</td><td>35.1</td><td>35.6</td><td>46.7</td><td>30.8</td><td>30.2</td><td>28.3</td><td>31.6</td><td>27.6</td><td>32.9 31.7</td><td>34.4</td><td>40.4</td><td>35.6</td><td>35.3</td><td>35.0</td><td>35.6</td></tr><tr><td>ArguAna</td><td>52.1</td><td>46.3</td><td>54.0</td><td>41.3</td><td>45.1</td><td>27.8</td><td>43.3</td><td>29.9</td><td>44.6 49.3</td><td>55.7</td><td>53.8</td><td>51.5</td><td>45.5</td><td>48.9</td><td>46.9</td></tr><tr><td>T6uche-2020</td><td>24.4</td><td>26.3</td><td>25.6</td><td>20.3</td><td>24.7</td><td>21.9</td><td>23.7</td><td>19.1 23.0</td><td>23.8</td><td>25.5</td><td>26.6</td><td>26.5</td><td>26.0</td><td>24.9</td><td>26.3</td></tr><tr><td>Quora</td><td>81.4</td><td>85.2</td><td>89.2</td><td>82.6</td><td>74.9</td><td>75.6</td><td>84.7</td><td>85.6 86.5</td><td>86.7</td><td>83.6</td><td>-</td><td>86.4</td><td>87.1</td><td>86.9</td><td>87.5</td></tr><tr><td>SCIDOCS</td><td>15.9</td><td>15.4</td><td>16.1</td><td>14.6</td><td>13.1</td><td>13.2</td><td>15.0</td><td>13.7 16.5</td><td>16.0</td><td>16.9</td><td>16.3</td><td>15.9</td><td>15.0</td><td>15.4</td><td>15.9</td></tr><tr><td>SciFact</td><td>69.9</td><td>69.3</td><td>66.2</td><td>62.1</td><td>56.8</td><td>60.1</td><td>65.3</td><td>61.5</td><td>67.7 70.9</td><td></td><td>67.462.3</td><td>67.8</td><td>67.2</td><td>67.5</td><td>67.9</td></tr><tr><td>NQ</td><td>54.4</td><td>56.2</td><td>56.8</td><td>50.0</td><td>50.5</td><td>48.3</td><td>51.8</td><td>48.7</td><td>49.5 50.5</td><td>48.3</td><td>-</td><td>53.3</td><td>52.3</td><td>53.1</td><td>53.7</td></tr><tr><td>HotpotQA</td><td>68.6</td><td>66.7</td><td>59.9</td><td>58.9</td><td>53.3</td><td>53.6</td><td>63.5</td><td>56.3</td><td>63.8 61.6</td><td>58.2</td><td>60.4</td><td>65.6</td><td>62.7</td><td>64.8</td><td>66.2</td></tr><tr><td>DBPedia</td><td>44.2</td><td>44.6</td><td>40.8</td><td>38.1</td><td>35.6</td><td>35.7</td><td>39.0</td><td>36.3</td><td>41.3 39.1</td><td>38.4</td><td>36.4</td><td>40.6</td><td>41.4</td><td>41.4</td><td>41.7</td></tr><tr><td>FEVER</td><td>79.6</td><td>78.5</td><td>74.0</td><td>73.4</td><td>67.6</td><td>50.6</td><td>77.4</td><td>49.5</td><td>75.8 75.1</td><td>75.9</td><td>76.2</td><td>76.4</td><td>75.1</td><td>75.8</td><td>78.1</td></tr><tr><td>Climate-FEVER</td><td></td><td>17.6</td><td>26.7</td><td>20.4</td><td>18.0</td><td>14.0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>22.8</td><td></td><td></td><td></td><td></td><td></td><td>23.2</td><td>14.4</td><td>23.7 21.1</td><td></td><td>23.5 21.4</td><td>21.8</td><td>20.3</td><td>22.2</td><td>22.7</td></tr><tr><td>CQADupStack</td><td>34.1</td><td>-</td><td>39.9</td><td>32.5</td><td>-</td><td>29.7</td><td>34.7</td><td>32.0</td><td>34.5 37.0</td><td>35.7</td><td></td><td>35.9 -</td><td>34.4 45.3</td><td>35.2 47.2</td><td>35.4 47.9</td></tr><tr><td>Robust04 Signal-1M</td><td>45.8 29.6</td><td>-</td><td>50.6 27.3</td><td>37.7 28.2</td><td>-</td><td>30.8 21.1</td><td>44.7 26.5</td><td>35.4 28.1</td><td>47.6 44.3 19.9</td><td>27.1</td><td>43.7 - 27.6</td><td>46.3 29.3</td></table>
|
| 139 |
+
|
| 140 |
+
† The approach assumes the target corpus (e.g., BEIR) is available while training. ∗ These numbers are not comparable due to the use of non-standard MS MARCO corpus augmented with title (Lassance and Clinchant, 2023).
|
| 141 |
+
|
| 142 |
+
Zero-Shot Evaluations. The second main row in Table 4 reports models’ zero-shot retrieval effectiveness on the BEIR datasets. We observe a reverse trend that those dense retrievers performing relatively poorly in MS MARCO Dev queries have better zero-shot retrieval effectiveness (e.g., Contriever, COCO-DR and RetroMAE). These models are pre-trained (with data augmentation) on a corpus other than MS MARCO to combat domain shift issue in dense retrieval (Xin et al., 2022; Yu et al., 2022). On the other hand, DRAGONs trained on augmented data from MS MARCO corpus only transfer well to BEIR datasets. Furthermore, DRAGON+ reaches state-of-the-art retrieval effectiveness on BEIR as the sparse retriever, SPLADE $^ { + + }$ .4 In addition, all the DRAGON variants outperform other dense retrievers by a large margin and compete $\mathrm { S P L A D E { + + } }$ and ColBERTv2 in the LoTTE dataset. It is worth mentioning that the models trained with domain adaptation (columns
|
| 143 |
+
|
| 144 |
+
Table 5: Label augmentation with cross encoder (CE) using cropped sentences as queries.
|
| 145 |
+
|
| 146 |
+
<table><tr><td></td><td>0t 1</td><td></td><td>2</td><td>3</td></tr><tr><td>DRAGON-S initialization Source of supervision</td><td></td><td>√ all*+ CE</td><td>√ CE only</td><td>CE only</td></tr><tr><td>MARCO Dev (RR @ 10)</td><td>38.1</td><td>38.1</td><td>37.5</td><td>36.8</td></tr><tr><td>BEIR-13 (nDCG@10)</td><td>49.8</td><td>49.7</td><td>48.7</td><td>47.7</td></tr></table>
|
| 147 |
+
|
| 148 |
+
† Column 0 corresponds to DRAGON-S. ∗ “all” denotes the five teachers used for training DRAGON-S.
|
| 149 |
+
|
| 150 |
+
9–B) perform better than the others (columns 3–8) but still underperform DRAGON in zero-shot evaluations. Using DRAGON as the base model for domain adaptation is possible to gain DR zero-shot effectiveness, which we leave to our future work.
|
| 151 |
+
|
| 152 |
+
A comparison between DRAGON-S and DRAGON-Q (columns C and D) shows that augmented query type has an impact on retrieval effectiveness in different datasets. DRAGON-S trained on cropped sentences surprisingly sees the highest retrieval effectiveness on BEIR but only sacrifices a bit on MS MARCO datasets. This means that cropped sentences, the cheap query type (compared to neural generative queries), are sufficiently helpful for models to learn domain-invariant retrieval capability. By contrast, we observe that DRAGON-Q trained with human-like queries performs poorly compared to DRAGON-S on the datasets where queries are far different from human-like queries, such as ArguAna (45.5 vs 51.5) and CQADupStack (34.4 vs 35.9), while mixing different types of queries (DRAGON) can mitigate the issue. Finally, DRAGON+, combined with masking auto-encoding (MAE) pre-training and our approach, sees further improvement on zero-shot evaluations without sacrificing in-domain ones, indicating that MAE pre-training may be orthogonal to our approach based on contrastive learning.
|
| 153 |
+
|
| 154 |
+
To sum up, DRAGONs advance state-of-the-art zero-shot effectiveness while keeping strong effectiveness in supervised evaluation. The experimental results demonstrate that our data augmentation approaches enable dense retrievers to learn domaininvariant matching signal between text pairs as the other models with fine-grained late interaction (SPLADE $^ { + + }$ and ColBERTv2) or 40 times larger model size (GTR-XXL).
|
| 155 |
+
|
| 156 |
+
Table 6: Ablation on initialized checkpoint using the mixture of cropped sentences and GenQ as queries.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="2">Initialized checkpoint</td><td>MARCO dev</td><td>BEIR-13</td></tr><tr><td>RR@10</td><td>nDCG@10</td></tr><tr><td>(0)BERT base (DRAGON)</td><td>39.3</td><td>49.4</td></tr><tr><td>(1) Contriever</td><td>38.7</td><td>49.3</td></tr><tr><td>(2)RoBERTa base</td><td>39.4</td><td>49.9</td></tr><tr><td>(3) RetroMAE (DRAGON+)</td><td>39.0</td><td>50.2</td></tr></table>
|
| 159 |
+
|
| 160 |
+
# 5 Discussions
|
| 161 |
+
|
| 162 |
+
Is it necessary to augment relevance labels with a cross encoder? To answer this question, we further train DRAGON-S with the augmented relevance labels from a cross encoder (CE). Specifically, we create a ranked list of CE by first retrieving top 1000 passages with DRAGON-S and re-ranking them with the CE for each cropped sentence as a query. With the CE ranked list, we conduct another iteration (20 epochs) of training for DRAGON-S; however, we do not see retrieval effectiveness improvement in Table 5 (column 0 vs 1). In addition, the retrieval effectiveness becomes even worse when we further train DRAGON-S by only sampling CE ranked list instead of uniformly sampling all the six ranked lists (column 1 vs 2). Finally, we initialize from bert-base-uncased and re-train the model for three iterations (60 epochs) only with the CE ranked list.5 We observe that its effectiveness (column 3) is even worse than the models trained with the ranked lists from three retrievers (see columns 4 and 5 in Table 2). This result contradicts the general belief that CE provides the strongest supervision to a dense retriever (Hofstätter et al., 2020). Moreover, it demonstrates the effectiveness of using diverse supervisions to train a generalizable dense retriever, rather than relying on a single strong supervision. Furthermore, leveraging all the retrievers to augment labels is still more efficient than a cross encoder (see Appendix A.7).
|
| 163 |
+
|
| 164 |
+
Does DRAGON benefit from unsupervised pretraining? Table 6 compares the models trained from different checkpoint initialization. Note that for Contriever and RetroMAE, we initialize from the checkpoint with only unsupervised pre-training (without fine-tuning on MS MARCO). We observe that our approach benefits from further masked auto-encoding rather than contrastive pre-training (rows 2,3 vs 1). The result is sensible since our approach can be considered an improved version of contrastive pre-training, which appears to be orthogonal to masked auto-encoding pre-training. We leave the investigation of improving DR with generative and contrastive pre-training combined for future research.
|
| 165 |
+
|
| 166 |
+
Figure 4: Examples of augmented queries and relevance labels from a passage. Augmented rel (#) denotes the number of unique relevant passages labeled by all our five teachers.
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan=1 colspan=5>Passage:TeManatanrojectandismcombpdbingaedWorlWallsgacyfpeaceusftomiceneontitaean impact on historyand science.</td></tr><tr><td rowspan=1 colspan=3>Query Augmentation</td><td rowspan=1 colspan=1>Augmented rel (#)</td><td rowspan=1 colspan=1>Example of augmented rel</td></tr><tr><td rowspan=2 colspan=1>Cropping</td><td rowspan=1 colspan=1>Q1</td><td rowspan=1 colspan=1>The Manhattan Project and itsatomic bomb helped bring an endto World War Il</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>The Manhattan project was a secret research and development project of theU.S to develop the atomic bomb.Its success granted the U.S the bombs thatended the war with Japan as well as ushering the country into the atomic era.</td></tr><tr><td rowspan=1 colspan=1>Q2</td><td rowspan=1 colspan=1>Its legacy of peaceful uses ofatomic energy continues to havean impact on history and science.</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>Anearly nuclear power plant that used atomic energy to generate electricity.TheAtomicAge,alsoknownastheAtomic Era,is theperiodof historyfollowing the detonation of the first nuclear (atomic) bomb,.</td></tr><tr><td rowspan=2 colspan=1>GenQ</td><td rowspan=1 colspan=1>Q1</td><td rowspan=1 colspan=1>what were a major contributions tothe manhattan effort</td><td rowspan=1 colspan=1>26</td><td rowspan=1 colspan=1>The Manhattan Project was an efort during World War Ilin the United Statesto develop the first nuclear weapon.</td></tr><tr><td rowspan=1 colspan=1>Q2</td><td rowspan=1 colspan=1>what impact did the manhattanproject have on history</td><td rowspan=1 colspan=1>26</td><td rowspan=1 colspan=1>The Manhattan Project,which included some of history's greatest scientificminds,lead to theend of the war against the Japanese.But was it worth theenvironmental and financial costs?Thismassive site provides loads of .</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Can we use the soft labels from multiple teachers? In the literature, using the relevance scores from a teacher as soft labels is a standard of knowledge distillation (Lin et al., 2021b; Hofstätter et al., 2021). However, in our study, even when training with uniform supervision from a sparse and dense retriever (i.e., uniCOIL and Contriever), it is challenging to normalize their relevance scores and create universal soft labels, yielding significant supervised and zero-shot effectiveness drops. We suspect that dense and sparse retrievers have many different views on relevance score computation; thus, it is even harder for a dense retriever to learn the score distributions from the different teachers.
|
| 171 |
+
|
| 172 |
+
Why sentence cropping yields a generalizable dense retriever? Figure 4 showcases the augmented queries by sentence cropping and neural generation and their respectively augmented relevant passages other than the original passages. We observe two main differences between the cropped sentences and generative queries. Cropped sentences provide diverse queries from a passage; i.e., the two cropped sentences in Figure 4 include slightly different topics (Manhattan Project and atomic energy). By contrast, all generative queries surround the same main topic, Manhattan Project, about the original passages. Second, the cropped sentences have more unique augmented relevant passages than generative queries. This is maybe because a cropped sentence, containing more information (keywords), is more challenging than a generative human-like query. Thus, teachers show more disagreement between each other on cropped sentences. We hypothesize that a dense retriever trained on cropped sentences can capture more diverse supervised signals from multiple teachers than generative queries. This explains the reason why DRAGON-S shows better generalization capability than DRAGON-Q.
|
| 173 |
+
|
| 174 |
+
# 6 Conclusion
|
| 175 |
+
|
| 176 |
+
We present DRAGON, a Dense Retriever trained with diverse AuGmentatiON and a unified framework of data augmentation (DA) to understand the recent progress of training dense retrievers. Based on the framework, we extensively study how to improve dense retrieval training through query and relevance label augmentation. Our experiments uncover some insights into training a dense retriever, which contradicts common wisdom that cross encoder is the most effective teacher and human-like queries are the most suitable training data for dense retrieval. Then, we propose a diverse data augmentation recipe, query augmentation with the mixture of sentence cropping and generative queries, and progressive relevance label augmentation with multiple teachers.
|
| 177 |
+
|
| 178 |
+
With our proposed recipe of DA, DRAGON is the first to demonstrate that a single BERT-basesized dense retriever can achieve state-of-the-art effectiveness in both supervised and zero-shot retrieval tasks. We believe that DRAGON can serve as a strong foundation retrieval model for domain adaptation retrieval tasks (Wang et al., 2022; Dai et al., 2022) or the existing retrieval augmented language models (Izacard et al., 2022; Shi et al., 2023; Mallen et al., 2023).
|
| 179 |
+
|
| 180 |
+
# Limitations
|
| 181 |
+
|
| 182 |
+
Despite of the easy usage of single-vector dense retrieval compared to the models with more finegrained late interactions (e.g., SPLADE $^ { + + }$ and ColBERTv2), the limitations of DRAGONs are mainly from the cost of training. First, to conduct diverse relevance label augmentation, well trained dense, sparse and multi-vector retrievers are required. Second, to optimize DRAGONs’ effectiveness, we scale up training queries to the size of 28 millions (compared to 0.8 millions in MS MARCO training queries) and leverage the progressive training strategy, which costs five days of training time with 32 A100 (40 GB) GPUs. The training cost can be reduced by removing repetitive or meaningless queries, which we leave for future work.
|
| 183 |
+
|
| 184 |
+
# References
|
| 185 |
+
|
| 186 |
+
Akari Asai, Timo Schick, Patrick Lewis, Xilun Chen, Gautier Izacard, Sebastian Riedel, Hannaneh Hajishirzi, and Wen-tau Yih. 2023. Task-aware retrieval with instructions. In Proc. Findings of ACL, pages 3650–3675.
|
| 187 |
+
|
| 188 |
+
Payal Bajaj, Daniel Campos, Nick Craswell, Li Deng, Jianfeng Gao, Xiaodong Liu, Rangan Majumder, Andrew McNamara, Bhaskar Mitra, Tri Nguyen, et al. 2016. MS MARCO: A human generated machine reading comprehension dataset. arXiv:1611.09268.
|
| 189 |
+
|
| 190 |
+
Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. 2009. Curriculum learning. In Proc. ICML, page 41–48.
|
| 191 |
+
|
| 192 |
+
Wei-Cheng Chang, Felix X. Yu, Yin-Wen Chang, Yiming Yang, and Sanjiv Kumar. 2020. Pre-training tasks for embedding-based large-scale retrieval. In Proc. ICLR.
|
| 193 |
+
|
| 194 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. 2020. A simple framework for contrastive learning of visual representations. In Proc. ICML.
|
| 195 |
+
|
| 196 |
+
Xilun Chen, Kushal Lakhotia, Barlas Oguz, Anchit Gupta, Patrick Lewis, Stan Peshterliev, Yashar Mehdad, Sonal Gupta, and Wen-tau Yih. 2022. Salient phrase aware dense retrieval: Can a dense retriever imitate a sparse one? In Proc. Findings of EMNLP, pages 250–262.
|
| 197 |
+
|
| 198 |
+
Nick Craswell, Bhaskar Mitra, and Daniel Campos. 2019. Overview of the TREC 2019 deep learning track. In Proc. TREC.
|
| 199 |
+
|
| 200 |
+
Nick Craswell, Bhaskar Mitra, Emine Yilmaz, and Daniel Campos. 2020. Overview of the TREC 2020 deep learning track. In Proc. TREC.
|
| 201 |
+
|
| 202 |
+
Zhuyun Dai, Vincent Y. Zhao, Ji Ma, Yi Luan, Jianmo Ni, Jing Lu, Anton Bakalov, Kelvin Guu, Keith B. Hall, and Ming-Wei Chang. 2022. Promptagator: Few-shot dense retrieval from 8 examples. arXiv:2209.11755.
|
| 203 |
+
|
| 204 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv:1810.04805.
|
| 205 |
+
|
| 206 |
+
Thibault Formal, Carlos Lassance, Benjamin Piwowarski, and Stéphane Clinchant. 2022. From distillation to hard negative sampling: Making sparse neural IR models more effective. In Proc. SIGIR, page 2353–2359.
|
| 207 |
+
|
| 208 |
+
Thibault Formal, Carlos Lassance, Benjamin Piwowarski, and Stéphane Clinchant. 2021. SPLADE v2: Sparse lexical and expansion model for information retrieval. arXiv:2109.10086.
|
| 209 |
+
|
| 210 |
+
Luyu Gao and Jamie Callan. 2021. Condenser: a pretraining architecture for dense retrieval. In Proc. EMNLP, pages 981–993.
|
| 211 |
+
|
| 212 |
+
Luyu Gao and Jamie Callan. 2022. Unsupervised corpus aware language model pre-training for dense passage retrieval. In Proc. ACL, pages 2843–2853.
|
| 213 |
+
|
| 214 |
+
Ruiqi Guo, Philip Sun, Erik Lindgren, Quan Geng, David Simcha, Felix Chern, and Sanjiv Kumar. 2020. Accelerating large-scale inference with anisotropic vector quantization. In Proc. ICML.
|
| 215 |
+
|
| 216 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. 2015. Distilling the knowledge in a neural network. In Proc. NIPS.
|
| 217 |
+
|
| 218 |
+
Sebastian Hofstätter, Sheng-Chieh Lin, Jheng-Hong Yang, Jimmy Lin, and Allan Hanbury. 2021. Efficiently teaching an effective dense retriever with balanced topic aware sampling. In Proc. SIGIR, page 113–122.
|
| 219 |
+
|
| 220 |
+
Sebastian Hofstätter, Sophia Althammer, Michael Schröder, Mete Sertkan, and Allan Hanbury. 2020. Improving efficient neural ranking models with cross-architecture knowledge distillation. arXiv:2010.02666.
|
| 221 |
+
|
| 222 |
+
Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave. 2021. Unsupervised dense information retrieval with contrastive learning. arXiv:2112.09118.
|
| 223 |
+
|
| 224 |
+
Gautier Izacard, Patrick Lewis, Maria Lomeli, Lucas Hosseini, Fabio Petroni, Timo Schick, Jane DwivediYu, Armand Joulin, Sebastian Riedel, and Edouard Grave. 2022. Few-shot Learning with Retrieval Augmented Language Models. arXiv:2208.03299.
|
| 225 |
+
|
| 226 |
+
Jeff Johnson, Matthijs Douze, and Hervé Jégou. 2021. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, pages 535–547.
|
| 227 |
+
|
| 228 |
+
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for opendomain question answering. In Proc. EMNLP, pages 6769–6781.
|
| 229 |
+
|
| 230 |
+
Carlos Lassance and Stephane Clinchant. 2023. The tale of two MSMARCO - and their unfair comparisons. In Proc. SIGIR, page 2431–2435.
|
| 231 |
+
|
| 232 |
+
Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proc. ACL, pages 6086–6096.
|
| 233 |
+
|
| 234 |
+
Jimmy Lin, Xueguang Ma, Sheng-Chieh Lin, JhengHong Yang, Ronak Pradeep, and Rodrigo Nogueira. 2021a. Pyserini: A python toolkit for reproducible information retrieval research with sparse and dense representations. In Proc. SIGIR, page 2356–2362.
|
| 235 |
+
|
| 236 |
+
Sheng-Chieh Lin, Jheng-Hong Yang, and Jimmy Lin. 2021b. In-batch negatives for knowledge distillation with tightly-coupled teachers for dense retrieval. In Proc. RepL4NLP, pages 163–173.
|
| 237 |
+
|
| 238 |
+
Zhenghao Lin, Yeyun Gong, Xiao Liu, Hang Zhang, Chen Lin, Anlei Dong, Jian Jiao, Jingwen Lu, Daxin Jiang, Rangan Majumder, and Nan Duan. 2022. Prod: Progressive distillation for dense retrieval. arXiv:2209.13335.
|
| 239 |
+
|
| 240 |
+
Shuqi Lu, Di He, Chenyan Xiong, Guolin Ke, Waleed Malik, Zhicheng Dou, Paul Bennett, Tie-Yan Liu, and Arnold Overwijk. 2021. Less is more: Pretrain a strong Siamese encoder for dense text retrieval using a weak decoder. In Proc. EMNLP, pages 2780–2791.
|
| 241 |
+
|
| 242 |
+
Xueguang Ma, Kai Sun, Ronak Pradeep, and Jimmy Lin. 2021. A replication study of dense passage retriever. arXiv:2104.05740.
|
| 243 |
+
|
| 244 |
+
Joel Mackenzie, Andrew Trotman, and Jimmy Lin. 2021. Wacky weights in learned sparse representations and the revenge of score-at-a-time query evaluation. arXiv:2110.11540.
|
| 245 |
+
|
| 246 |
+
Alex Mallen, Akari Asai, Victor Zhong, Rajarshi Das, Daniel Khashabi, and Hannaneh Hajishirzi. 2023. When not to trust language models: Investigating effectiveness of parametric and non-parametric memories. In Proc. ACL, pages 9802–9822.
|
| 247 |
+
|
| 248 |
+
Rui Meng, Ye Liu, Semih Yavuz, Divyansh Agarwal, Lifu Tu, Ning Yu, Jianguo Zhang, Meghana Bhat, and Yingbo Zhou. 2023. AugTriever: Unsupervised dense retrieval by scalable data augmentation. arXiv:2212.08841.
|
| 249 |
+
|
| 250 |
+
Jianmo Ni, Chen Qu, Jing Lu, Zhuyun Dai, Gustavo Hernandez Abrego, Ji Ma, Vincent Zhao, Yi Luan, Keith Hall, Ming-Wei Chang, and Yinfei Yang. 2022. Large dual encoders are generalizable retrievers. In Proc. EMNLP, pages 9844–9855.
|
| 251 |
+
|
| 252 |
+
Rodrigo Nogueira and Jimmy Lin. 2019. From doc2query to docTTTTTquery.
|
| 253 |
+
|
| 254 |
+
Barlas Oguz, Kushal Lakhotia, Anchit Gupta, Patrick Lewis, Vladimir Karpukhin, Aleksandra Piktus, Xilun Chen, Sebastian Riedel, Scott Yih, Sonal Gupta, and Yashar Mehdad. 2022. Domain-matched pre-training tasks for dense retrieval. In Proc. NAACL, pages 1524–1534.
|
| 255 |
+
|
| 256 |
+
Yingqi Qu, Yuchen Ding, Jing Liu, Kai Liu, Ruiyang Ren, Wayne Xin Zhao, Daxiang Dong, Hua Wu, and Haifeng Wang. 2021. RocketQA: An optimized training approach to dense passage retrieval for opendomain question answering. In Proc. NAACL, pages 5835–5847.
|
| 257 |
+
|
| 258 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67.
|
| 259 |
+
|
| 260 |
+
Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERTnetworks. In Proc. EMNLP, pages 3982–3992.
|
| 261 |
+
|
| 262 |
+
Ruiyang Ren, Yingqi Qu, Jing Liu, Wayne Xin Zhao, QiaoQiao She, Hua Wu, Haifeng Wang, and Ji-Rong Wen. 2021. RocketQAv2: A joint training method for dense passage retrieval and passage re-ranking. In Proc. EMNLP, pages 2825–2835.
|
| 263 |
+
|
| 264 |
+
Keshav Santhanam, Omar Khattab, Christopher Potts, and Matei Zaharia. 2022a. Plaid: An efficient engine for late interaction retrieval. arXiv:2205.09707.
|
| 265 |
+
|
| 266 |
+
Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia. 2022b. ColBERTv2: Effective and efficient retrieval via lightweight late interaction. In Proc. NAACL, pages 3715–3734.
|
| 267 |
+
|
| 268 |
+
Weijia Shi, Sewon Min, Michihiro Yasunaga, Minjoon Seo, Rich James, Mike Lewis, Luke Zettlemoyer, and Wen-tau Yih. 2023. Replug: Retrieval-augmented black-box language models. arXiv:2301.12652.
|
| 269 |
+
|
| 270 |
+
Nandan Thakur, Nils Reimers, Johannes Daxenberger, and Iryna Gurevych. 2021a. Augmented SBERT: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks. In Proc. NAACL, pages 296–310.
|
| 271 |
+
|
| 272 |
+
Nandan Thakur, Nils Reimers, Andreas Rücklé, Abhishek Srivastava, and Iryna Gurevych. 2021b. BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Proc. NIPS.
|
| 273 |
+
|
| 274 |
+
Kexin Wang, Nandan Thakur, Nils Reimers, and Iryna Gurevych. 2022. GPL: Generative pseudo labeling for unsupervised domain adaptation of dense retrieval. In Proc. NAACL, pages 2345–2360.
|
| 275 |
+
|
| 276 |
+
Xing Wu, Guangyuan Ma, Meng Lin, Zijia Lin, Zhongyuan Wang, and Songlin Hu. 2022. Contextual masked auto-encoder for dense passage retrieval. arXiv:2208.07670.
|
| 277 |
+
|
| 278 |
+
Shitao Xiao, Zheng Liu, Yingxia Shao, and Zhao Cao. 2022. RetroMAE: Pre-training retrieval-oriented language models via masked auto-encoder. In Proc. EMNLP, pages 538–548.
|
| 279 |
+
|
| 280 |
+
Ji Xin, Chenyan Xiong, Ashwin Srinivasan, Ankita Sharma, Damien Jose, and Paul Bennett. 2022. Zeroshot dense retrieval with momentum adversarial domain invariant representations. In Proc. ACL, pages 4008–4020.
|
| 281 |
+
|
| 282 |
+
Yue Yu, Chenyan Xiong, Si Sun, Chao Zhang, and Arnold Overwijk. 2022. COCO-DR: Combating distribution shift in zero-shot dense retrieval with contrastive and distributionally robust learning. In Proc. EMNLP, pages 1462–1479.
|
| 283 |
+
|
| 284 |
+
Hansi Zeng, Hamed Zamani, and Vishwa Vinay. 2022. Curriculum learning for dense retrieval distillation. In Proc. SIGIR, page 1979–1983.
|
| 285 |
+
|
| 286 |
+
# A Appendices
|
| 287 |
+
|
| 288 |
+
# A.1 Baseline Models
|
| 289 |
+
|
| 290 |
+
We compare DRAGON with dense retrievers using the backbone of bert-base-uncased trained with advanced techniques. (1) Knowledge Distillation: RocketQAv2 (Ren et al., 2021) distills knowledge from a cross encoder while CL-DRD (Ren et al., 2021) combines curriculum learning and crossencoder distillation. They all use cross encoders’ knowledge to augment positive relevance labels as our approach. (2) Contrastive Pre-training: coCondenser (Gao and Callan, 2022), Contriever (Izacard et al., 2021) and COCO-DR (Yu et al., 2022) are first pre-trained on different corpus listed in Table 1, and then fine-tuned on MS MARCO training queries. (3) Masked Auto-Encoding Pre-Training: COT-MAE (Wu et al., 2022) and RetroMAE (Xiao et al., 2022) are first pre-trained to recover polluted sentences and then fine-tuned on MS MARCO training queries. For RetroMAE, we use the variant with the best BEIR retrieval effectiveness for comparison. (4) Domain adaptation: We consider GPL (Wang et al., 2022) and Promptagator (PTR; Dai et al., 2022), which use generative models to create pseudo relevance data for each corpus in BEIR and train one expert dense retriever for each corpus. This approach requires the target corpus while training. Note that COCO-DR can also be considered domain adaptation on BEIR although it uses one model for all tasks.
|
| 291 |
+
|
| 292 |
+
Note that coCondenser and COT-MAE are finetuned on the “non-standard” MS MARCO passage corpus that has been augmented with title. Thus, we also conduct inference on the corpus with title for them; otherwise, we use the official MS MARCO passage corpus. In addition, we also report the retrieval effectiveness of GTR-XXL (Ni et al., 2022) and ColBERTv2 (Santhanam et al., 2022b) from their original papers and conduct retrieval for $\mathrm { S P L A D E { + + } }$ using Pyserini (Lin et al., 2021a) for reference. We list all the other model checkpoints used for evaluations in Appendix A.2.
|
| 293 |
+
|
| 294 |
+
# A.2 Model Checkpoints
|
| 295 |
+
|
| 296 |
+
Teacher Models: (1) uniCOIL: https://hu ggingface.co/castorini/unicoil-m smarco-passage; (2) Contriever: https: //huggingface.co/facebook/contri ever-msmarco; (3) GTR-XXL: https://hu ggingface.co/sentence-transformer s/gtr-t5-xxl; (4) ColBERTv2: https:// github.com/stanford-futuredata/Co lBERT; (5) SPLADE $^ { + + }$ : http://download -de.europe.naverlabs.com/Splade_ Release_Jan22/splade_distil_CoCo denser_medium.tar.gz; (6) Cross encoder: https://huggingface.co/cross-enc oder/ms-marco-MiniLM-L-12-v2.
|
| 297 |
+
|
| 298 |
+
Baseline Models: (1) CL-DRD: https://gi thub.com/HansiZeng/CL-DRD; (2) RocketQAv2: we directly copy the numbers from Santhanam et al. (2022b); (3) COT-MAE: https: //huggingface.co/caskcsg/cotma e_base_msmarco_retriever; (4) RetroMAE: https://huggingface.co/Shita o/RetroMAE_BEIR; (5) coCondenser: https: //huggingface.co/Luyu/co-conde nser-marco-retriever; (6) Contriever: https://huggingface.co/faceboo k/contriever-msmarco; (7) COCODR: https://huggingface.co/OpenMatch /cocodr-base-msmarco; (8) Promptagator (PTR) and GPL: we directly copy the numbers from their original papers (Dai et al., 2022; Wang et al., 2022).
|
| 299 |
+
|
| 300 |
+
# A.3 Implementation Details
|
| 301 |
+
|
| 302 |
+
We train our dense retrievers initialized from bertbase-uncased on 32 A100 GPUs (40GB) with a per-GPU batch size of 64 and a learning rate of $3 e - 5$ . Each batch includes an augmented query with its positives and hard negatives. Following Karpukhin et al. (2020), we use asymmetric dual encoder with two distinctly parameterized encoders and leverage in-batch negative mining. Note that symmetric dual encoder shows poor generalization capability in our initial experiments. We set the maximum query and passage lengths to 32 and 128 for MS MARCO training and evaluation. For BEIR evaluation, we set maximum input lengths to 512.
|
| 303 |
+
|
| 304 |
+
Table 7: MS MARCO and our augmented training queries statistics.
|
| 305 |
+
|
| 306 |
+
<table><tr><td colspan="2">number</td><td>Avg.# tokens</td><td>Avg.#rel</td></tr><tr><td>passages in corpus</td><td>8,841,823</td><td>78.8</td><td>na</td></tr><tr><td>training queries</td><td>532,761</td><td>8.2</td><td>1.0</td></tr><tr><td colspan="4">augmented training queries</td></tr><tr><td>cropped sentences</td><td>28,545,938</td><td>24.4</td><td>23.1</td></tr><tr><td>generative queries</td><td>28,545,938</td><td>8.0</td><td>24.7</td></tr><tr><td colspan="4">test queries</td></tr><tr><td>Dev</td><td>6,980</td><td>7.8</td><td>1.1</td></tr><tr><td>DL2019</td><td>43</td><td>7.6</td><td>95.4</td></tr><tr><td>DL2020</td><td>54</td><td>7.5</td><td>68.0</td></tr></table>
|
| 307 |
+
|
| 308 |
+
# A.4 MS MARCO Dataset Statistics
|
| 309 |
+
|
| 310 |
+
Table 7 lists the data statistics of MS MARCO dataset, including the original training queries and test queries (i.e., Dev, DL19 and DL20). In addition, we also list the augmented queries used to train DRAGONs with full relevance label augmentation by five teachers.
|
| 311 |
+
|
| 312 |
+
# A.5 Impacts of Top- $k$ Positive Sampling
|
| 313 |
+
|
| 314 |
+
Table 8: Ablation on progressive label augmentation from top- $k$ passages using cropped sentences as queries.
|
| 315 |
+
|
| 316 |
+
<table><tr><td> top-k positives</td><td>1</td><td>5</td><td>10</td></tr><tr><td>MARCO Dev (RR @10)</td><td>33.1</td><td>36.4</td><td>36.6</td></tr><tr><td>BEIR-13 (nDCG@10)</td><td>42.4</td><td>48.0</td><td>49.3</td></tr></table>
|
| 317 |
+
|
| 318 |
+
∗ Trajectory: uniCOIL Contriever ColBERTv2.
|
| 319 |
+
|
| 320 |
+
In Section 3.2, we mention that our sampling scheme treats top 10 passages from each teacher ranked list as positives and top 45–50 as negatives. We further conduct experiment to study the impact of the positive sampling scheme. Following the experiment setups in Section 3.3, we use the sentences cropped from MS MARCO corpus as augmented queries and we conduct progressive label augmentation using top- $k$ passages as positive. The results are tabulated in Table 8. We observe that treating top-10 passages from each teacher as positives yields the best supervised and zero-shot effectiveness. On the other hand, using only the top passage as positive results in significant effectiveness drop. This result indicates that the top passage labeled by a teacher cannot transfer its knowledge well to a student. This result is similar to the observation from Chen et al. (2022).
|
| 321 |
+
|
| 322 |
+
# A.6 An Intuition Behind Uniform and Progressive Supervisions
|
| 323 |
+
|
| 324 |
+
As shown in Section 3.2, uniform supervision provides good supervision without fusion weight tuning as fused supervision. Intuitively, a positive retrieved by more teachers has a higher probability to be sampled and may be more relevant to a query. To provide a sense of why uniform supervision works, we estimate the accuracy of supervision by computing the probability of each positive sampled under uniform supervision, and rank the positives according to the simulated probability. For example, at the 3rd iteration of progressive training, given a query, a positive passage is labeled positive by all the three teachers, the probability of the passages being sampled is $\begin{array} { r } { \frac { 1 } { 3 } \cdot ( \frac { 1 } { k } + \frac { 1 } { k } + \frac { 1 } { k } ) = \frac { 1 } { k } } \end{array}$ . In our experiments, each teacher labels the top 10 $k = 1 0$ ) retrieved passages as positives in our labeling scheme. Note that, in the case where multiple positives have equal probability, we further rank them according to their sum of reciprocal rank. For instance, if the two passages (e.g., $p _ { 1 }$ and $p _ { 2 }$ ) are retrieved by all the three teachers; then, we further rank them according to their scores $\begin{array} { r } { \frac { 1 } { r _ { 1 1 } } + \frac { 1 } { r _ { 1 2 } } + \frac { 1 } { r _ { 1 3 } } } \end{array}$ and $\begin{array} { r } { \frac { 1 } { r _ { 2 1 } } + \frac { 1 } { r _ { 2 2 } } + \frac { 1 } { r _ { 2 3 } } } \end{array}$ where $r _ { m n }$ denotes the rank of the passage $p _ { m }$ by the $n$ -th teacher. In addition, we also estimate the diversity of supervision by computing the number of positive passages in union sets from the sources of supervisions.
|
| 325 |
+
|
| 326 |
+
Table 9: Uniform and progressive supervision effectiveness comparison at each training iteration. The models are trained using cropped sentences as queries.
|
| 327 |
+
|
| 328 |
+
<table><tr><td rowspan="2">Teacher / iteration</td><td colspan="3">uniform</td><td colspan="3">progressive</td></tr><tr><td></td><td>1→2→3</td><td></td><td>1→2→3</td><td></td><td></td></tr><tr><td>uniCOIL Contriever ColBERTv2</td><td>√ √ <</td><td>√ √ √</td><td>√ < √</td><td>√ X X</td><td>√ √ ×</td><td>√ √ √</td></tr><tr><td>MARCO Dev BEIR-13</td><td>36.2 46.6</td><td>37.0 47.4</td><td>36.9 47.6</td><td>34.9 46.7</td><td>35.8 48.6</td><td>36.6 49.3</td></tr><tr><td></td><td colspan="4">effectiveness of teacher</td><td></td><td></td></tr><tr><td>MARCO Dev</td><td colspan="4">39.1 39.1 39.1 35.1</td><td>36.5</td><td>39.1</td></tr><tr><td></td><td colspan="4">diversity of teacher</td><td></td><td></td></tr><tr><td>Avg. #rel</td><td>17.5</td><td>17.5</td><td>17.5</td><td>10.0</td><td>14.9</td><td>17.5</td></tr></table>
|
| 329 |
+
|
| 330 |
+
Table 9 reports the detailed effectiveness and supervision quality (accuracy and diversity) comparison at each training iteration between uniform and progressive supervision as discussed in our pilot study. We observe that uniform supervision provides accurate and diverse supervision in the beginning of training; however, the generalization improvement over iteration is less than progressive supervision.
|
| 331 |
+
|
| 332 |
+
# A.7 Latency Measurement for Relevance Label Augmentation
|
| 333 |
+
|
| 334 |
+
We measure the latency of label augmentation using batch retrieval on a single NVIDIA A100 40GB GPU for GPU search and 60 Intel(R) Xeon(R) Platinum 8275CL CPUs $\textcircled { a } 3 . 0 0 \mathrm { G H z }$ for CPU search. For cross encoder, we conduct label augmentation by re-ranking text pairs with a batch size of 100. For dense retrieval (Contriever and GTR-XXL) and sparse retrieval, we use Faiss-GPU index and Lucene index from Pyserini (Lin et al., 2021a) with 60 threads, respectively, and search with a batch size of 100. Note that we use a batch size of 25 to encode queries using GTR-XXL due to GPU memory constraint, which is also the main bottleneck for GTR-XXL batch retrieval. For ColBERTv2, we use the improved version of multi-vector retrieval, PLAID (Santhanam et al., 2022a), and search with a batch size of 1, which is the only option.
|
| 335 |
+
|
| 336 |
+
Table 10: The latency comparison of relevance label augmentation with batch inference using different teachers on MS MARCO.
|
| 337 |
+
|
| 338 |
+
<table><tr><td colspan="2"></td><td>candidates</td><td colspan="2">latency (ms/q)</td></tr><tr><td>Type</td><td>Model</td><td>(#)</td><td>GPU</td><td>CPU</td></tr><tr><td>cross-encoder</td><td>miniLML6v2</td><td>1K</td><td>600</td><td>=</td></tr><tr><td>dense</td><td>Contriever</td><td>8.8M</td><td><1</td><td>=</td></tr><tr><td>dense</td><td>GTR-XXL</td><td>8.8M</td><td>10</td><td>-</td></tr><tr><td>sparse</td><td>uniCOIL</td><td>8.8M</td><td>1</td><td>84</td></tr><tr><td>sparse</td><td>SPLADE++</td><td>8.8M</td><td>-</td><td>144</td></tr><tr><td>multi-vec</td><td>ColBERTv2</td><td>8.8M</td><td>55</td><td>-</td></tr></table>
|
| 339 |
+
|
| 340 |
+
Table 11: Detailed effectiveness (Success5) on LoTTE.
|
| 341 |
+
|
| 342 |
+
<table><tr><td colspan="2">sparse</td><td>multi-vec</td><td colspan="4">dense</td></tr><tr><td colspan="2">0</td><td>1</td><td>C</td><td>D</td><td>E</td><td>F</td></tr><tr><td colspan="2"></td><td>/SPLADE++</td><td>ColBERTv2/</td><td>DRAGON-S</td><td>DRAGON-Q</td><td>DRAGON</td><td>DRAGON+</td></tr><tr><td rowspan="5">Saeeet</td><td>writing</td><td>78.7</td><td>80.1</td><td>78.8</td><td>78.2</td><td>79.2</td><td>81.5</td></tr><tr><td>recreating</td><td>71.9</td><td>72.3</td><td>73.4</td><td>74.6</td><td>76.0</td><td>73.9</td></tr><tr><td>science</td><td>56.6</td><td>56.7</td><td>55.3</td><td>56.9</td><td>56.9</td><td>57.9</td></tr><tr><td>technology</td><td>65.9</td><td>66.1</td><td>64.9</td><td>68.8</td><td>65.4</td><td>67.6</td></tr><tr><td>lifestyle</td><td>83.7</td><td>84.7</td><td>84.9</td><td>84.7</td><td>85.6</td><td>85.9</td></tr><tr><td rowspan="5">n.ion</td><td>pooled</td><td>70.9</td><td>71.6</td><td>71.4</td><td>72.4</td><td>72.6</td><td>73.5</td></tr><tr><td>writing recreating</td><td>75.2</td><td>76.3 70.8</td><td>76.2</td><td>75.2</td><td>75.6</td><td>77.5</td></tr><tr><td>science</td><td>69.2</td><td></td><td>69.9</td><td>69.3</td><td>70.3</td><td>69.1</td></tr><tr><td></td><td>44.9</td><td>46.1</td><td>40.1</td><td>40.1</td><td>40.7</td><td>41.4</td></tr><tr><td>technology lifestyle</td><td>53.1 76.9</td><td>53.6</td><td>50.5 77.0</td><td>51.2</td><td>50.5</td><td>51.4</td></tr><tr><td colspan="2">pooled</td><td>62.3</td><td>76.9 63.4</td><td>61.1</td><td>77.4 61.2</td><td>76.9 61.4</td><td>77.7 62.1</td></tr></table>
|
| 343 |
+
|
| 344 |
+
Table 10 compares the latency cost per query for relevance label augmentation with different neural rankers and demonstrates that leveraging all the retrievers to augment relevance labels are still more efficient than a cross encoder.
|
| 345 |
+
|
| 346 |
+
# A.8 Detailed evaluation on LoTTE
|
| 347 |
+
|
| 348 |
+
Table 11 lists DRAGON’s effectiveness on five topics without aggregation. Although all the variants of DRAGON show strong effectiveness on LoTTE, we find that DRAGONs perform poorly on the Forum queries about topics of science and technology compared to $\mathrm { S P L A D E { + + } }$ and ColBERTv2. Combining science corpus pre-training with DRAGON training strategy is a possible solution.
|
| 349 |
+
|
| 350 |
+
# A.9 More Related Work
|
| 351 |
+
|
| 352 |
+
Knowledge Distillation. Our work is closely related to the previous work exploring knowledge distillation (KD; Hinton et al., 2015) from ColBERT, cross encoder or their ensemble (Hofstätter et al., 2021; Hofstätter et al., 2020) to improve the effectiveness of DR (Lin et al., 2021b; Qu et al., 2021). However, they only take the advantage of soft labels from KD and use the relevant passages labeled by humans. The recent work (Ren et al., 2021; Zeng et al., 2022) mines more positive samples using cross encoder to further augment the limited relevance labels by humans. Nevertheless, it is challenging for cross encoders to augment relevance labels for queries in scale due to its low efficiency. Chen et al. (2022) first explore label augmentation using singe sparse retrieval model on large-scale queries and demonstrate that a dense retriever can mimic a teacher of a sparse retriever (e.g., BM25). Different from the previous work, we explore label augmentation using multiple supervisions on large-scale augmented queries.
|
| 353 |
+
|
| 354 |
+
Curriculum Learning. Easy-to-hard training strategies (Bengio et al., 2009) have been applied to improve many machine learning tasks, including dense retrieval (Zeng et al., 2022; Lin et al., 2022). The previous work focuses on distilling complex knowledge from cross encoders to a dense retriever with a curriculum training strategy and demonstrates improved effectiveness in supervised retrieval tasks. In our work, we explore to progressively train a dense retriever with the diverse supervisions from dense, sparse and multi-vector retrievers to improve both supervised and zero-shot effectiveness.
|
| 355 |
+
|
| 356 |
+
Pre-Training. There are two popular approaches to pre-training a dense retriever. The first one is contrastive pre-training, aiming to increase the size of training data by creating artificial text pairs (Lee et al., 2019; Chang et al., 2020; Izacard et al., 2021) from a corpus or collecting question–answer pairs (Oguz et al., 2022; Ni et al., 2022) from websites. The second one is masked auto encoding pre-training, where models are trained to recover the corrupted texts (Gao and Callan, 2021; Lu et al., 2021; Xiao et al., 2022; Wu et al., 2022). Our work is similar to contrastive pre-training but instead of creating large-scale training data in an unsupervised or weakly supervised manner, we investigate how to conduct supervised contrastive learning on artificially created text pairs. We demonstrate that combining masked auto encoding pre-training and our supervised contrastive learning can further improve models’ generalization capability.
|
md/dev/eLgK35G3A5d/eLgK35G3A5d.md
ADDED
|
@@ -0,0 +1,596 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ANNEALED FISHER IMPLICIT SAMPLER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Sampling from an un-normalized target distribution is an important problem in many scientific fields. An implicit sampler uses a parametric transform $x = G _ { \theta } ( z )$ to push forward an easy-to-sample latent code $z$ to obtain a sample $x$ . Such samplers are favored for fast inference speed and flexible architecture. Thus it is appealing to train an implicit sampler for sampling from the un-normalized target. In this paper, we propose a novel approach to training an implicit sampler by minimizing the Fisher Divergence between sampler and target distribution. We find that the trained sampler works well for relatively simple targets but may fail for more complicated multi-modal targets. To improve the training for multi-modal targets, we propose another adaptive training approach that trains the sampler to gradually learn a sequence of annealed distributions. We construct the annealed distribution path to bridge a simple distribution and the complicated target. With the annealed approach, the sampler is capable of handling challenging multi-modal targets. In addition, we also introduce a few MCMC correction steps after the sampler to better spread the samples. We call our proposed sampler the Annealed Fisher Implicit Sampler (AFIS). We test AFIS on several sampling benchmarks. The experiments show that our AFIS outperforms baseline methods in many aspects. We also show in theory that the added MC correction steps get faster mixing by using the learned sampler as MCMC’s initialization.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Sampling from an un-normalized distribution is an important problem in many scientific fields such as Bayesian statistics (Green, 1995), biology (Schutte et al., 1999), physics simulations (Olsson, ¨ 1995), machine learning (Andrieu et al., 2003), and so on. Typically, the problem is formulated as: given a known differentiable un-normalized target potential function $\log p ( x )$ , one wants to sample from the target distribution. Due to the success of deep neural networks, there is increasing popularity to train a deep generative model to learn to sample(Hu et al., 2018; Wu et al., 2020; Matthews et al., 2022; Corenflos et al., 2021). Such learned models which can approximately sample from target distribution are called samplers.
|
| 12 |
+
|
| 13 |
+
Training a neural network (i.e., a parameterized transform) $x = G _ { \theta } ( z )$ to push forward an easyto-sample latent code $z \sim p _ { Z } ( z )$ to obtain a sample is an appealing approach. Such approaches are favored for fast sampling because they only need a single-time forward pass of neural network transform. Let $G _ { \theta } ( . )$ denote the parametric transform and $q ( x )$ the un-normalized target distribution with unknown normalizing constant $\begin{array} { r } { Z = \int q ( x ) d x } \end{array}$ . Let $p _ { \theta } ( x )$ denote the sampler-induced distribution. Some previous work takes a normalizing flow model as sampler, and then minimizes the KL divergence between sampler-induced and target distributions regardless of normalizing constant: $\mathcal { D } _ { K L } \big ( \bar { p } _ { \theta } , q \big ) = \mathbb { E } _ { x \sim p _ { \theta } } \big [ \log ^ { \big ( } p _ { \theta } ( x ) - \log q ( x ) \dot { + } \log Z \big ]$ . Note that $Z$ is parameter-free and can be ignored during training. However, minimizing KL divergence relies on explicit log-likelihood of sampler-induced distribution, which can not be computed in a general transform. Such transform with no explicit likelihood is referred to as an implicit sampler.
|
| 14 |
+
|
| 15 |
+
In this paper, we will focus on implicit samplers. Note that the annoying normalizing constant vanishes when considering the score function of a distribution, $s ( x ) = \nabla _ { x } \log p ( x )$ . Thus, we can take the score-based divergence to constructively get rid of the unknown normalizing constant for implicit samplers. Fisher divergence (FD), which is a popular score-based probability divergence, and its variants have obtained much success in recent years, especially in training deep generative models such as energy-based models (Kingma & Cun, 2010; Martens et al., 2012; Song et al., 2019), score based diffusion models (Song et al., 2020; Kingma et al., 2021; Vahdat et al., 2021; Song & Ermon, 2019; Ho et al., 2020), etc. Assume $p ( x ) , q ( x )$ are two probability densities. The Fisher Divergence between $p$ and $q$ is defined as
|
| 16 |
+
|
| 17 |
+
$$
|
| 18 |
+
\mathcal { D } _ { F D } ( \boldsymbol { p } , \boldsymbol { q } ) = \frac { 1 } { 2 } \mathbb { E } _ { \boldsymbol { x } \sim \boldsymbol { p } ( \boldsymbol { x } ) } \lVert \nabla _ { \boldsymbol { x } } \log \boldsymbol { p } ( \boldsymbol { x } ) - \nabla _ { \boldsymbol { x } } \log \boldsymbol { q } ( \boldsymbol { x } ) \rVert _ { 2 } ^ { 2 } .
|
| 19 |
+
$$
|
| 20 |
+
|
| 21 |
+
It is always no less than 0 and equals to 0 if and only if $p ( x ) = q ( x )$ a.s. under probability measure $p$ . Fisher Divergence is suitable for measuring the dissimilarity between sampler and un-normalized target distribution. So as to be used for training the implicit sampler.
|
| 22 |
+
|
| 23 |
+
In this paper, we firstly propose a novel approach to learning a sampler by minimizing the Fisher Divergence between sampler and un-normalized target distributions. We call such a sampler the Fisher Implicit Sampler. We then show that the proposed sampler is capable of handling relatively simple target distribution, but would fail for more challenging multi-modal targets.
|
| 24 |
+
|
| 25 |
+
To remedy this issue and unlock the full potential of the Fisher Implicit Sampler, we additionally propose a novel adaptive training approach that trains the implicit sampler gradually using a sequence of annealed distributions instead of the target distribution. We anneal the target distribution to bridge the hard-to-sample target and an easy-to-sample prior. More precisely, we extend the target distribution $q ( x )$ to a sequence of annealed distributions $\{ q _ { k } ( x ) \} _ { k }$ for $k = 0 , \ldots , K$ , where $q _ { K } ( x )$ is the target density and $q _ { 0 } ( x )$ is an easy-to-sample prior distribution, typically a normal distribution. The design of such an annealed path gradually reduces the learning difficulty for the sampler.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Illustration of proposed Annealed Fisher Implicit Sampler.
|
| 29 |
+
|
| 30 |
+
Moreover, we find that a few steps of MC correction after the sampler help the samples spread better with little cost, as also used in some previous work (Wu et al., 2020; Arbel et al., 2021; Matthews et al., 2022). Combining all together, we call our proposed sampler the Annealed Fisher Implicit Sampler (AFIS), as illustrated in Figure 1. We validate our AFIS on sampling benchmarks, showing improvements over baseline approaches.
|
| 31 |
+
|
| 32 |
+
The main contributions of our work are summarized as follows:
|
| 33 |
+
|
| 34 |
+
• We propose a novel loss function to minimize the Fisher Divergence. We show that minimizing the proposed loss is equivalent to minimizing the Fisher Divergence between sampler and target distribution. Note that our objective is largely different from other ones in previous work.
|
| 35 |
+
• We provide an insightful understanding of the difficulty in learning multi-modal targets by minimizing Fisher Divergence. We facilitate the annealing technique on training samplers based on our understanding.
|
| 36 |
+
• We bring in a novel annealing technique and MC correction steps with our sampler, leading to improved sampling performance with little additional cost.
|
| 37 |
+
|
| 38 |
+
# 2 BACKGROUND
|
| 39 |
+
|
| 40 |
+
# 2.1 TRAIN IMPLICIT SAMPLERS WITH SCORE-BASED DIVERGENCE
|
| 41 |
+
|
| 42 |
+
The learning-to-sample problem arises in many application fields of machine learning. Assume we only have access to an un-normalized target distribution $q ( x )$ (or its logarithm $\log q ( x ) )$ , and the goal is to approximately sample from the target. In recent years, training a neural networkbased transform to approximately sample from target distribution is an appealing method. Such a transform is called a neural sampler. Let $G _ { \theta }$ denote a neural network which transforms a relatively simple latent code $z \sim p _ { 0 } ( z )$ to a sample $x = G _ { \theta } ( z )$ . Here, $p _ { Z } ( z )$ is an easy-to-sample latent distribution, usually the standard Normal distribution. A general neural sampler does not have an explicit expression of the log-likelihood function, which we name them implicit samplers. Because of the un-normalized target distribution and unavailable log-likelihood, training implicit samplers by minimizing KL or related divergence always fails. An alternative way is to consider score-based divergence.
|
| 43 |
+
|
| 44 |
+
The Stein Neural Sampler of Hu et al. (2018) is trained by minimizing Stein’s Discrepancy between sampler and target distributions. The Stein Discrepancy (SD) (Gorham & Mackey, 2015) is defined as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\mathcal { D } _ { S D } ( p , q ) = \operatorname* { s u p } _ { \mathbf { f } \in \mathcal { F } } \biggl \{ \mathbb { E } _ { x \sim p } \langle \nabla _ { x } \log q ( x ) , \mathbf { f } ( x ) \rangle + \langle \nabla _ { x } , \mathbf { f } ( x ) \rangle \biggr \} ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
The calculation of Stein’s discrepancy relies on solving a maximization problem w.r.t. test function f . When the function class $\mathcal { F }$ is carefully chosen, the optimal f may have an explicit solution or easier formulation. For instance, $\mathrm { H u }$ et al. (2018) found that if $\mathcal { F }$ is taken to be $\mathcal { F } \overset { \cdot } { = } \{ \mathbf { f } : \mathbb { E } _ { p } \| \mathbf { f } \| _ { 2 } ^ { 2 } \leq$ $\delta \}$ , the SD is equivalent to a regularized representation
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { D } _ { S D } ( p , q ) = \operatorname* { m a x } _ { f } \biggl \{ \mathbb { E } _ { x \sim p } \langle \nabla _ { x } \log q ( x ) , \mathbf { f } ( x ) \rangle + \langle \nabla _ { x } , \mathbf { f } ( x ) \rangle - \lambda \bigl [ \mathbf { f } ^ { T } \mathbf { f } \bigr ] \biggr \} .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
They used two neural networks: $G _ { \theta }$ to parametrize an implicit sampler and $\mathbf { f } _ { \eta }$ to parametrize the test function. Let $p _ { \theta } ( x )$ denote the implicit sampler distribution induced by $x = G _ { \theta } ( z )$ with $z \sim p _ { Z } ( z )$ . Stein Neural Sampler solves a minimax problem on parameter pair $( \theta , \eta )$ to obtain a sampler that minimizes the SD between sampler and target by
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\operatorname* { m i n } _ { \theta } \operatorname* { m a x } _ { \eta } L ( \theta , \eta ) = \operatorname* { m i n } _ { \theta } \operatorname* { m a x } _ { \eta } \Biggl \{ \mathbb { E } _ { x \sim p _ { \theta } } \langle \nabla _ { x } \log q ( x ) , \mathbf { f } _ { \eta } ( x ) \rangle + \langle \nabla _ { x } , \mathbf { f } _ { \eta } ( x ) \rangle - \lambda \big [ \mathbf { f } _ { \eta } ^ { T } \mathbf { f } _ { \eta } \big ] \Biggr \} .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Here the notion $x \sim p _ { \theta }$ means $x = G _ { \theta } ( z )$ with $z \sim p _ { Z } ( z )$ . They called the above SD the Fisher Stein Discrepancy and the corresponding sampler FSD Neural Sampler.
|
| 63 |
+
|
| 64 |
+
The Stein Neural Sampler opens the door to training implicit samplers by minimizing score-based Divergence. In fact, the FSD Neural Sampler calculates a surrogate of Fisher Divergence. The FSD’s test function f provides an approximation of Fisher Divergence. However, as we show in Section 3.1, their calculation of Fisher Divergence only provides partial gradient updates of the sampler’s parameters, thus leading to training failure even for simple target.
|
| 65 |
+
|
| 66 |
+
# 2.2 SCORE FUNCTION ESTIMATION
|
| 67 |
+
|
| 68 |
+
Since the implicit sampler does not have an explicit log-likelihood function or score function, training it with score-based divergence requires inevitably estimating the score function (or equivalent component). Score matching (Hyvarinen & Dayan, 2005) and its variants provided powerful ap- ¨ proaches to estimating score function through samples. Assume one only has available samples $x \sim p$ , and wants to use a parametric approximated distribution $q _ { \phi } ( x )$ to approximate $p$ . Such an approximation can be made by minimizing the Fisher Divergence between $p$ and $q _ { \phi }$ . We can rewrite the Fisher Divergence as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r } { \mathcal { D } _ { F D } ( p , q _ { \phi } ) = \mathbb { E } _ { x \sim p } \bigg \{ \| \nabla _ { x } \log p ( x ) \| _ { 2 } ^ { 2 } + \| \nabla _ { x } \log q _ { \phi } ( x ) \| _ { 2 } ^ { 2 } - 2 \langle \nabla _ { x } \log p ( x ) , \nabla _ { x } \log q _ { \phi } ( x ) \rangle \bigg \} . } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Under certain conditions, the equality $\begin{array} { r } { { \mathbb { E } } _ { x \sim p } \langle \nabla _ { x } \log p ( x ) , \nabla _ { x } \log q _ { \phi } ( x ) \rangle \ = \ - { \mathbb { E } } _ { x \sim p } \Delta \log q _ { \phi } ( x ) } \end{array}$ ∆ log qϕ(x) = Pi ∂2∂x2 l holds (usually referred to as Stein’s Identity(Stein, 1981; Gorham denotes the Laplacian operator applied on $\&$ Mackey, 2017)) . Here $\log q _ { \phi } ( x )$ . Combining this equality and noting that the first term of FD $\mathbb { E } _ { x \sim p } \| \nabla _ { x } \log p ( x ) \| _ { 2 } ^ { 2 }$ does not rely on parameter $\phi$ , we have that minimizing $\mathcal { D } _ { F D } ( p , q _ { \phi } )$ is equivalent to minimizing the following objective
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathcal { L } ( \phi ) = \mathbb { E } _ { x \sim p } \bigg \{ \| \nabla _ { x } \log q _ { \phi } ( x ) \| _ { 2 } ^ { 2 } + 2 \Delta \log q _ { \phi } ( x ) \bigg \} .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
This objective can be estimated only through samples from $p$ , thus is tractable when $q _ { \phi }$ is welldefined. More specifically, one only needs to define a score network $s _ { \phi } ( x ) \colon \mathbb { R } ^ { D } \to \mathbb { R } ^ { D }$ instead of a density to estimate the score function of $p$ in some cases. This technique was proposed in Hyvarinen ¨ & Dayan (2005) named after Score Matching. Other variants of score matching were also studied (Song et al., 2019; Vincent, 2011; Pang et al., 2020; Meng et al., 2020; Lu et al., 2022; Bao et al., 2020). Score Matching related techniques have been widely used in training energy-based models and score-based diffusion models in recent years. In this paper, we use score matching related techniques to estimate the score function of the sampler’s distribution.
|
| 81 |
+
|
| 82 |
+
# 3 ANNEALED FISHER IMPLICIT SAMPLER
|
| 83 |
+
|
| 84 |
+
3.1 MINIMIZING THE FISHER DIVERGENCE: S2D LOSS
|
| 85 |
+
|
| 86 |
+
Let $G _ { \theta } ( . ) \colon \mathbb { R } ^ { D _ { Z } } \to \mathbb { R } ^ { D _ { X } }$ be an implicit sampler (i.e., a neural transform), $p _ { Z }$ latent distribution, $p _ { \theta }$ sampler induced distribution $x = \overset { } { G } _ { \theta } ( z )$ , and $q ( x )$ un-normalized target. Our goal is to pull close the FD between $p _ { \theta }$ and $q$ in order to train the sampler. Recall the definition of Fisher Divergence between $p _ { \theta } , q$ is
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { D } _ { F D } ( p _ { \theta } , q ) = \mathbb { E } _ { x \sim p _ { \theta } } \| \nabla _ { x } \log p _ { \theta } ( x ) - \nabla _ { x } \log q ( x ) \| _ { 2 } ^ { 2 } .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
For our learning-to-sample setting, the target score function $\nabla _ { x } \log { q ( x ) }$ is known. A direct solution seems work if one uses an additional score network $s _ { \phi } ( . ) \colon \mathbb { R } ^ { D _ { X } } \to \bar { \mathbb { R } } ^ { D _ { X } }$ to approximate sampler’s score function. Samples from implicit sampler is cheap to obtain, so estimating sampler’s score function is not hard with score matching related techniques. We call this step the Score Estimation Step. With a good approximated $s _ { \phi } ( x )$ of sampler’s score function, one may wish to minimize the approximated Fisher Divergence to update the sampler
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\theta ^ { * } = \arg \operatorname* { m i n } _ { \theta } \mathbb { E } _ { x = G _ { \theta } ( z ) , z \sim p _ { Z } ( z ) } \| s _ { \phi } ( x ) - \nabla _ { x } \log q ( x ) \| _ { 2 } ^ { 2 } .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
We call this step the Score Difference Minimization Step. By alternating the above two steps, one may wish the Fisher divergence will be minimized, thus the training of sampler is done. We name the resulting approach the Direct Method. Interestingly, the Direct Method coincides with FSD Neural Sampler as we state in Proposition 1. We put detailed proof in Appendix A due to limited pages.
|
| 99 |
+
|
| 100 |
+
Proposition 1. Estimating the sampler’s score function $s _ { \phi } ( . )$ with score matching is equivalent to maximizing the Fisher Stein Discrepancy objective to obtain $F S D$ ’s optimal test function. More specially, the optimal score estimation $s ^ { * }$ and FSD optimal test function $\mathbf { f } ^ { * }$ satisfy
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathbf { f } ^ { * } ( x ) = \frac { 1 } { 2 \lambda } \big [ \nabla _ { x } \log q ( x ) - s ^ { * } ( x ) \big ] .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Moreover, the Direct method is equivalent to FSD when training implicit Sampler.
|
| 107 |
+
|
| 108 |
+
Although the direct method seems reasonable, it fails as we show in the experiment on a simple Banana target in Figure 2. We find that even if sampler’s score function is estimated perfectly at each iteration, the direct method still gives only partial parameter gradient for minimizing the Fisher Divergence. We start by analyzing Fisher Divergence’s gradient w.r.t. sampler’s parameter. The Fisher Divergence is
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 2: Direct method fails for simple Banana distribution while S2D loss succeeds.
|
| 112 |
+
|
| 113 |
+
One wants to adjust $\theta$ to minimize $\mathcal { L } _ { F D } ( \boldsymbol { \theta } )$ . The $\theta$ gradient of the above objective writes
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } } \| s _ { d } ( x ) - s _ { \theta } ( x ) \| ^ { 2 } = \mathbb { E } _ { p _ { \theta } } \| s _ { d } ( x ) - s _ { \theta } ( x ) \| ^ { 2 } \frac { \partial } { \partial \theta } \log p _ { \theta } ( x ) + \mathbb { E } _ { p _ { \theta } } 2 \big ( s _ { \theta } ( x ) - s _ { d } ( x ) \big ) ^ { T } \frac { \partial } { \partial \theta } s _ { \theta } ( x ) .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
The first gradient term coincides with the direct approach if we asynchronously estimate the sampler’s score function perfectly. More precisely, with perfect score estimation $\boldsymbol { s } _ { \phi } ( \boldsymbol { \hat { x } } ) = \nabla _ { \boldsymbol { x } } \log p _ { \theta } ( \boldsymbol { x } )$ we have
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r l } & { \displaystyle \frac { \partial } { \partial \theta } \mathbb { E } _ { x \sim p _ { \theta } } \| \nabla _ { x } \log q ( x ) - s _ { \phi } ( x ) \| _ { 2 } ^ { 2 } } \\ & { \displaystyle = \frac { \partial } { \partial \theta } \int \| \nabla _ { x } \log q ( x ) - s _ { \phi } ( x ) \| _ { 2 } ^ { 2 } p _ { \theta } ( x ) d x = \int \| \nabla _ { x } \log q ( x ) - s _ { \phi } ( x ) \| _ { 2 } ^ { 2 } \frac { \partial } { \partial \theta } p _ { \theta } ( x ) d x } \\ & { \displaystyle = \int \| \nabla _ { x } \log q ( x ) - s _ { \phi } ( x ) \| _ { 2 } ^ { 2 } p _ { \theta } ( x ) \frac { \partial } { \partial \theta } \log p _ { \theta } ( x ) d x = \mathbb { E } _ { x \sim p _ { \theta } } \| \nabla _ { x } \log q ( x ) - s _ { \phi } ( x ) \| _ { 2 } ^ { 2 } \frac { \partial } { \partial \theta } \log p _ { \theta } ( x ) . } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
The above equation reveals that the direct method only takes partial gradient to minimize the FD between sampler and target. In many cases, this partial gradient leads to training failure as we observe in Figure 2. In (Hu et al., 2018), FSD Neural Sampler used Kernelized Stein Discrepancy trained implicit sampler as initialization before training with FSD. However, such initialization limits the usage of FSD because the optimization might start from a local minima which is close to KSD’s local minima and can potentially be mislead the sampler.
|
| 126 |
+
|
| 127 |
+
In order to minimize the Fisher Divergence correctly, we propose a novel training objective called Score Square Difference loss (S2D) which accounts for the full parameter gradient to minimize the Fisher Divergence. The S2D loss is defined as the difference of target and sampler’s square score norm, where the sampler’s score function is estimated asynchronously with a score network $s _ { \phi } ( x )$ . More precisely, our S2D loss is defined as
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r } { \mathcal { L } _ { S 2 D } ( \theta ) : = \mathbb { E } _ { x \sim p _ { \theta } } \bigg \{ \| \nabla _ { x } \log q ( x ) \| _ { 2 } ^ { 2 } - \| s _ { \phi } ( x ) \| _ { 2 } ^ { 2 } \bigg \} , } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $s _ { \phi } ( . )$ is the estimated score function of sampler distribution. The score function is usually estimated by score matching related techniques. The notation $x \sim p _ { \theta }$ means $x = G _ { \theta } ( z ) , z \sim p _ { Z } ( z )$ . The following proposition 2 shows that, if the sampler score function is estimated perfectly, the parameter gradient of S2D loss is the same as the gradient of Fisher Divergence.
|
| 134 |
+
|
| 135 |
+
Proposition 2. Assume $\boldsymbol { s } _ { \phi } ( \boldsymbol { x } ) = \nabla _ { \boldsymbol { x } } \log p _ { \theta } ( \boldsymbol { x } )$ . Then the following equality holds:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\frac { \partial } { \partial \theta } \mathcal { L } _ { S 2 D } ( \theta ) = \frac { \partial } { \partial \theta } \mathcal { L } _ { F D } ( \theta ) .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
We give the detailed proof in Appendix B. This proposition says that, if we alternate between score estimation of sampler’s score function, and minimization of the S2D loss, we are actually minimizing the Fisher Divergence between sampler and target. The S2D loss is a surrogate of Fisher Divergence which can provide the same parameter gradient as Fisher Divergence. So minimizing the S2D loss gives the same results as minimizing the intractable Fisher Divergence. Figure 3 gives an illustration of the relation between S2D loss and Fisher Divergence. The black curve stands for the intractable Fisher Divergence. Green curve represents the S2D loss. The S2D loss shares the same gradient parameter as Fisher Divergence. We refer to a sampler trained with such approach the Fisher Implicit Sampler (FIS). We give an algorithm for FIS in Algorithm 1. We take standard score matching as an illustration of score estimation step, but other score estimation techniques such as denoising score matching and sliced score matching also works.
|
| 142 |
+
|
| 143 |
+
# Algorithm 1: Fisher Implicit Sampler training
|
| 144 |
+
|
| 145 |
+
Input: un-normalized target $\log q ( x )$ , latent distribution $p _ { Z } ( z )$ , implicit sampler $G _ { \theta }$ , score network $s _ { \phi }$ , mini-batch size $\mathbf { B }$ , max iteration $\mathbf { M }$ .
|
| 146 |
+
Randomly initialize $( \theta ^ { ( 0 ) } , \phi ^ { ( 0 ) } )$ .
|
| 147 |
+
for $t$ in $\it 0 . M$ do # update score network parameter Get mini-batch $x _ { i } = \bar { G _ { \theta ^ { ( t ) } } } ( z _ { i } ) , z _ { i } \sim p _ { Z } ( z ) , i = 1 , . . , B$ . Calculate score matching objective: $\begin{array} { r } { \mathcal { L } _ { S M } ( \boldsymbol { \phi } ) = \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \biggl [ \| s _ { \boldsymbol { \phi } } ( x _ { i } ) \| _ { 2 } ^ { 2 } + 2 \langle \nabla _ { \boldsymbol { x } } , s _ { \boldsymbol { \phi } } ( x _ { i } ) \rangle \biggr ] . } \end{array}$ Minimize ${ \mathcal { L } } _ { S M } ( \phi )$ to get $\phi ^ { ( t + 1 ) }$ . # update sampler parameter Get mini-batch latent code $z _ { i } \sim p _ { Z } ( z ) , i = 1 , . . . , B$ . Use re-parametrization trick to calculate S2D loss for sampler $\begin{array} { r } { \dot { \mathcal { L } } _ { S 2 D } ( \dot { \theta } ) = \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \left[ \| \nabla _ { x } \log q ( G _ { \theta } ( z _ { i } ) ) \| _ { 2 } ^ { 2 } - \| s _ { \phi ^ { ( t + 1 ) } } ( \dot { G _ { \theta } } ( z _ { i } ) ) \| _ { 2 } ^ { 2 } \right] . } \end{array}$ Minimize $\mathcal { L } _ { S 2 D } ( \theta )$ to get $\theta ^ { ( t + 1 ) }$ .
|
| 148 |
+
|
| 149 |
+
end return $( \theta , \phi )$ .
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: S2D loss and Fisher Divergence. The S2D loss shares the same parameter gradient as Fisher Divergence if sampler’s score is estimated perfectly asynchronously. Thus minimizing the S2D loss to update the sampler is equivalent to minimizing the Fisher Divergence between sampler and target.
|
| 153 |
+
Figure 2 shows that our proposed FIT (S2D loss) can successfully train an implicit sampler from scratch to sample from the famous banana shape distribution. While the Direct method fails to train the correct sampler.
|
| 154 |
+
|
| 155 |
+
Although FIT is capable of handling benchmark targets, we find that FIT fails on more challenging multi-modal targets with very separated modes. To remedy the multi-modal failure issues and fully unlock the potential of the S2D loss, we propose to combine the annealing techniques with FIT for multi-modal targets. The idea of annealing is widely used in sampling and stochastic optimization literature (Neal, 2001; Salimans et al., 2015; Chen et al., 2016; Doucet et al., 2001; Van Laarhoven & Aarts, 1987). The technique constructs a distribution bridge between a relatively simple prior distribution and a complicated target. The learning (or other operations such as sampling or optimization) are gradually operated on each middle distribution from prior to the tar
|
| 156 |
+
|
| 157 |
+
get. Typically, the annealing technique can lower the barrier of operation of the target by dispersing the difficulty to all middle distributions.
|
| 158 |
+
|
| 159 |
+
# 3.2 ANNEALED FISHER IMPLICIT TRAINING
|
| 160 |
+
|
| 161 |
+
By executing FIT steps repeatedly, the sampler is trained to minimize the Fisher divergence between $p _ { \theta }$ and target $q$ . However, directly minimizing the Fisher divergence is problematic in practice. If the sampler’s distribution is too dissimilar to the target, the Fisher divergence could be hard to estimate accurately as mentioned in (Wenliang & Kanagawa, 2020). The Fisher divergence can be small under any tolerance even if two distribution are largely different in terms of KL divergence. More precisely, the Fisher Divergence is likely inaccurate if two distributions are too dissimilar. Due to this issue, the sampler might not be able to estimated the Fisher divergence accurately, making the training fail. In fact, above issue occurs a lot in real applications. Sampler is often initialized to concentrate around the origin, while the target distribution rarely concentrates around the origin.
|
| 162 |
+
|
| 163 |
+
To remedy the inaccurate Score Estimation issue, we need to guide the sampler to start from learning a relatively simple target, and then the more challenging one. Based on such intuition, we introduce a gradual relaxation of target distribution. More precisely, we construct a sequence of annealed distributions $\{ q _ { k } \} , k \in \{ 0 , . . , K \}$ which gradually transform a relatively simple distribution $q _ { 0 }$ to target distribution $q _ { K } = q$ . Typically, $q _ { 0 }$ is chosen as $\mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ for simplicity. We let the sampler gradually learn to sample from each $q _ { k }$ with $k$ increasing from $k = 0$ to $k = K$ . Since when $k$ is small $q _ { k }$ is simpler than $q _ { K }$ , the estimation of Fisher divergence is easier. Thus the sampler can learn to approximate $q _ { k }$ . When one gradually turns $k$ to $k = K$ , the sampler will gradually learn to sample from our final target $q _ { K } = q$ .
|
| 164 |
+
|
| 165 |
+
Such easy-to-hard technique is commonly known as annealing techniques. Marinari & Parisi (1992); Geyer & Thompson (1995) proved faster mixing time with temperature annealed target. Wenzel et al. (2020) utilized anneal path to connect model and posterior in Bayesian inference regime. Mandt et al. (2016); Huang et al. (2018); Fu et al. (2019) annealed the KL regularization in variational inference. D’Angelo & Fortuin (2021) proposed to anneal the target when running Stein Variational Gradient Descent algorithm for better mixing speed. Perhaps the most similar annealing approach to ours is Neal (2001); Wu et al. (2020) which construct a geometric distribution path $p _ { k } ( x )$ between a Gaussian prior and target density. We utilize a similar anneal path as in Wu et al. (2020).
|
| 166 |
+
|
| 167 |
+
In this paper, we anneal the target distribution $q$ with a geometric interpolation starting with a standard Gaussian distribution as prior
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\begin{array} { r } { \log q _ { k } ( x ) = \lambda _ { k } \log q _ { K } ( x ) + ( 1 - \lambda _ { k } ) \log q _ { 0 } ( x ) } \end{array}
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
with $q _ { 0 } = \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ and $0 \leq \lambda _ { k } \leq 1$ a pre-defined annealing schedule function with $\lambda _ { 0 } = 0 , \lambda _ { K } = 1$ The score function is then linearly interpolated with
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\begin{array} { r } { \nabla _ { x } \log q _ { k } ( x ) = \lambda _ { k } \nabla _ { x } \log q _ { K } ( x ) + ( 1 - \lambda _ { k } ) \nabla _ { x } \log q _ { 0 } ( x ) , } \end{array}
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
where $\nabla _ { x } \log q _ { K } ( x ) = \nabla _ { x } \log q ( x )$ is the target score function and $\nabla _ { x } \log { q _ { 0 } ( x ) }$ the prior score. For standard Normal prior, we have $\nabla _ { x } \log q _ { 0 } ( x ) = - x$ . We name our FIS sampler combined with annealing technique the Annealed Fisher Implicit Training. Because of the pages limitation, we put the full AFIS algorithm in Appendix F. By annealing the target distribution to a sequence of easier-to-learn targets, we divide the difficulty of sampler to learn one final distribution to learn sequentially from less difficult targets. Thus the sampler will not be bothered by inaccurate Fisher divergence estimation and training failure. Figure 1 gives a brief summary of how AFIS works. The Annealed Fisher Implicit Sampler is trained along annealed distributions progressively.
|
| 180 |
+
|
| 181 |
+
# 3.3 MONTE CARLO CORRECTION
|
| 182 |
+
|
| 183 |
+
Deterministic sampler suffers from mode-connection issue. The issue says that a deterministic transform can not fully disconnect two modes as studied in Wu et al. (2020). Such issue limit the use of a pure deterministic sampler. Recent works show that combining stochastic corrections with deterministic transforms could improve the sampling performance (Wu et al., 2020; Song et al., 2020; Song & Ermon, 2019). MCMC(Hastings, 1970; Roberts & Rosenthal, 1998; Xifara et al., 2014; Neal, 2011) is a commonly used stochastic transform family. By running MCMC, one can approximated sample from some un-normalized target distribution. Thus a few steps MCMC is a nice way to serve as stochastic corrections.
|
| 184 |
+
|
| 185 |
+
In particular, after training the sampler, we take the generated samples $x = G _ { \theta } ( z ) , z \sim p _ { 0 } ( z )$ as initialization and run several MCMC as correction steps to spread samples for better diversity. Both energy-based and score-based MCMC can be used. We take the Langevin MC as an illustration and put more details of MC corrections in Appendix C. Note that our method is not limited to these MC corrections.
|
| 186 |
+
|
| 187 |
+
Langevin Dynamic Correction A set of particles is assumed to reach $q ( x )$ as a stationary distribution if it is driven by a Langevin Dynamic with local updates
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
d X _ { t } = \nabla _ { X _ { t } } \log q ( X _ { t } ) / 2 + d W _ { t } ,
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
where $W _ { t }$ is standard Brownian motion. The discrete scheme of Langevin Correction is given by
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
X ^ { ( t + 1 ) } = X ^ { ( t ) } + \frac { \epsilon } { 2 } \nabla \log q ( X ^ { ( t ) } ) + \sqrt { \epsilon } Z ^ { ( t ) } ,
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
where $Z ^ { ( t ) } \sim \mathcal { N } ( 0 ; I )$ . The Fokker-Planck equation tells that under certain conditions, $q ( x )$ is the only stationary distribution of above diffusion dynamic. About 20 updates of steps is sufficient to have good enough correction effects in practice.
|
| 200 |
+
|
| 201 |
+
The combination of deterministic sampler and stochastic correction in fact gives faster mixing for MCMC. The deterministic sampler sample particles coarsely near target’s high density modes. After that, the MCMC helps the particle spread better around each modes. In particular, we show that Langevin mixing time can be controlled by Fisher divergence between sampler distribution and target. Taking advantage of flexible neural network architecture, AFIS can be trained to match target score at any precision. The Theorem 1 shows that Langevin Correction’s mixing time can be reduced by well trained sampler.
|
| 202 |
+
|
| 203 |
+
Theorem 1. Assume the target potential $\log q ( x )$ is smooth and satisfies
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
\operatorname* { l i m } _ { \| x \| _ { 2 } \to + \infty } \left( \frac { \| \nabla \log q ( x ) \| _ { 2 } ^ { 2 } } { 2 } - \Delta \log q ( x ) \right) = + \infty .
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 4: Sample comparison on Double Well targets. (a) real samples; (b) samples from trained AFIS with 5 steps of HMC correction; (c) samples from trained AFIS; (d) samples from trained FIS without annealing; (e) samples from trained FSD-NS. All samplers and score networks use the same architecture.
|
| 211 |
+
|
| 212 |
+
Assume generated distribution $p$ induced by AFIS $x = G ( z )$ is trained to match Fisher divergence under $\delta$ precision $\mathcal { D } _ { F } ( p , q ) \leq \delta$ . Then there exists a positive constant $\lambda$ and a dimension-free positive constant $C$ which only depend on target distribution $q ( x )$ , such that under Langevin diffusion with initial distribution $p _ { 0 } = p$ ,
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
d X _ { t } = \nabla \log q ( x ) / 2 d t + d W _ { t } ,
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
the diffusion time
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
T ^ { * } = \operatorname* { m a x } \biggl \{ 0 , \frac { 1 } { 2 \lambda } \bigl [ C + \log ( \frac { \delta } { \epsilon } ) \bigr ] \biggr \}
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
is enough to control the KL divergence between corrected distribution $p _ { T }$ and target $q$ under tolerance ϵ.
|
| 225 |
+
|
| 226 |
+
In practice, the AFIS can be trained to achieve any precision to match target under Fisher Divergence. The above theorem says, the better AFIS is trained, the shorter time for MC correction is needed to achieve same tolerance in terms of KL divergence. We provide the detailed proof in Appendix D.
|
| 227 |
+
|
| 228 |
+
# 3.4 COMBINING ALL: THE ANNEALED FISHER IMPLICIT SAMPLER
|
| 229 |
+
|
| 230 |
+
Combining the S2D loss, the annealed technique, and MC corrections, we obtain our final sampler: the Annealed Fisher Implicit Sampler (AFIS) with MC corrections. Figure 4 shows a comparison of trained sampler’s samples on Double Well distribution. Double Well is a usually used bi-variate testing target with two separated modes. The figure shows that the AFIS with a few steps of MC correction gives the best samples. The AFIS with no MCMC correction can not fully separate two disjoint modes. The FIS (without annealing) fails to learn the two modes. The FSD-NS (or the Direct Method) also fails for training. To be concluded, the experiments show that S2D loss, annealed technique, and MC correction all contribute to successful learning.
|
| 231 |
+
|
| 232 |
+
# 4 EXPERIMENTS
|
| 233 |
+
|
| 234 |
+
# 4.1 AFIS FOR SYNTHETIC TARGET
|
| 235 |
+
|
| 236 |
+
For sanity check, we apply AFIS on some toy target distributions as used in Hu et al. (2018); Rezende & Mohamed (2015). The anneal path $p _ { \lambda } ( x ) \propto \bar { \exp } ( \lambda \log p _ { t a r g e t } ( x ) + ( 1 - \lambda ) \log p _ { p r i o r } ( x ) )$ starts from a Normal distribution when $\lambda = 0$ and ends with the target when $\lambda = 1$ . Let $M$ be the number of max iterations, and $t$ be the current training iteration. We set $\lambda _ { i }$ to grow linearly from 0 to 1 when $i < 9 M / 1 0$ . We train the sampler with real target $\log q ( x )$ for rest $M / 1 0$ iterations. The annealed path reduces the bar of learning to sample, resulting relatively accurate updating direction for the current sampler. The sampler is guided along the annealed path towards the target. We defer the detailed experiment settings and more results to Appendix E.1.
|
| 237 |
+
|
| 238 |
+
Specifically, we visualize the sample results on three distributions with hard-to-sample characteristics such as multi-modality and periodicity, as shown in Figure 5. It shows that samples from our AFIS+MC method perfectly match all target distributions. For quantitative comparison, we calculate the Maximum Mean Discrepancy between the pure HMC samples and all samplers’ samples. The FSD-NS does not converge when training, so we omit the result of FSD-NS in comparison. Since the task focuses on training implicit samplers, we do not compare other explicit samplers. Table 1 summarizes the results of the MMD evaluation of all samplers. In all datasets, our AFIS consistently performs better than FIS. With additional MC correction steps, we always get lower MMD compared to the pure AFIS method.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 5: Target and AFIS+MC samples.
|
| 242 |
+
|
| 243 |
+
Table 1: MMD (with rbf kernel) evaluation for synthetic targets. Additional 10 Langevin MC correction steps are used in AFIS+MC sampler. The lower the metric, the better the sampler.
|
| 244 |
+
|
| 245 |
+
<table><tr><td>Target</td><td>banana</td><td>double well</td><td>t1</td><td>t2</td><td>t3</td></tr><tr><td>FIS(ours)</td><td>1.12e-2±1.07e-3</td><td>3.51e-1±3.06e-3</td><td>4.54e-2±4.10e-3</td><td>7.48e-2±1.81e-3</td><td>5.18e-2±2.68e-3</td></tr><tr><td>AFIS(ours)</td><td>7.07e-4±1.72e-4</td><td>1.07e-2±1.37e-3</td><td>3.31e-3±1.13e-3</td><td>4.64e-2±2.53e-3</td><td>2.65e-2±1.91e-3</td></tr><tr><td>AFIS+MC(ours)</td><td>2.45e-4±1.20e-4</td><td>5.99e-3±1.33e-3</td><td>2.15e-3±8.37e-4</td><td>3.61e-2±2.67e-3</td><td>2.20e-2±1.97e-3</td></tr></table>
|
| 246 |
+
|
| 247 |
+
# 4.2 BAYESIAN REGRESSION
|
| 248 |
+
|
| 249 |
+
We also test our Implicit Sampler on Bayesian regression tasks as in Song et al. (2017). HMC is a good baseline for such tasks, as pointed out in Neklyudov et al. (2020); Neklyudov & Welling (2022). The inference of the Bayesian logistic regression model aims to sample from the posterior distribution. We compare FIS (no anneal), AFIS, and $\mathbf { A F I S + M C }$ on Australian, German, and Heart datasets. To evaluate samples’ quality, we run HMC as a baseline to obtain approximated samples from target distributions and calculate Maximum Mean Discrepancy between samples from implicit samplers and HMC baseline. Table 2 shows the results of the Bayesian inference experiments. Other than FSD-NS, which always fails during training, our generators can generate high-quality samples. Moreover, annealed technique and MC correction steps further improve sample quality. Experimental details can be found in Appendix E.2.
|
| 250 |
+
|
| 251 |
+
Table 2: MMD (with rbf kernel) evaluation for posterior sampling. Additional 10 Langevin MC correction steps are used in AFIS+MC sampler. The lower the metric, the better the sampler.
|
| 252 |
+
|
| 253 |
+
<table><tr><td>Posterior</td><td>Australian</td><td>German</td><td>Heart</td></tr><tr><td>FIS(ours)</td><td>7.99e-3±2.81e-4</td><td>1.91e-4±6.48e-6</td><td>9.84e-5±1.08e-5</td></tr><tr><td>AFIS(ours)</td><td>6.30e-3±2.50e-4</td><td>2.42e-6±4.02e-7</td><td>3.66e-5±1.08e-5</td></tr><tr><td>AFIS+MC(ours)</td><td>2.16e-3±1.08e-4</td><td>2.46e-6±3.97e-7</td><td>3.64e-5±1.07e-5</td></tr></table>
|
| 254 |
+
|
| 255 |
+
# 5 CONCLUSION
|
| 256 |
+
|
| 257 |
+
We have presented a novel approach for training an implicit sampler to sample from un-normalized density. Our approach minimizes the Fisher Divergence with the aid of an asynchronous score network. We show theoretically that our method can accurately minimize the Fisher Divergence for the implicit sampler, which is the first one as far as we know. Besides, our approach uses both the annealing technique and stochastic corrections for improved sampling performance. We also prove the faster mixing for MC correction. We test our approach on commonly used synthetic target generation and Bayesian regression benchmarks and observe ideal performance.
|
| 258 |
+
|
| 259 |
+
# ETHICS STATEMENT
|
| 260 |
+
|
| 261 |
+
Our work proposes an approach to train an implicit sampler by minimizing Fisher Divergence between sampler and target distribution. Since the research is a fundamental methodology in machine learning, the negative consequences of the methodology seem not obvious.
|
| 262 |
+
|
| 263 |
+
# REPRODUCIBILITY STATEMENT
|
| 264 |
+
|
| 265 |
+
We provide details of our approach and sampler in Appendix. We provide complete proofs of all theoretical results also in Appendix. We also propose the python code for implementation. We state that our research is reproducible.
|
| 266 |
+
|
| 267 |
+
# REFERENCES
|
| 268 |
+
|
| 269 |
+
Christophe Andrieu, Nando De Freitas, Arnaud Doucet, and Michael I Jordan. An introduction to mcmc for machine learning. Machine learning, 50(1):5–43, 2003.
|
| 270 |
+
|
| 271 |
+
Michael Arbel, Alex Matthews, and Arnaud Doucet. Annealed flow transport monte carlo. In International Conference on Machine Learning, pp. 318–330. PMLR, 2021.
|
| 272 |
+
|
| 273 |
+
Fan Bao, Chongxuan Li, Kun Xu, Hang Su, Jun Zhu, and Bo Zhang. Bi-level score matching for learning energy-based latent variable models. Advances in Neural Information Processing Systems, 33:18110–18122, 2020.
|
| 274 |
+
|
| 275 |
+
MS Bartlett. Approximate confidence intervals. Biometrika, 40(1/2):12–19, 1953.
|
| 276 |
+
|
| 277 |
+
Changyou Chen, David Carlson, Zhe Gan, Chunyuan Li, and Lawrence Carin. Bridging the gap between stochastic gradient mcmc and stochastic optimization. In Artificial Intelligence and Statistics, pp. 1051–1060. PMLR, 2016.
|
| 278 |
+
|
| 279 |
+
Adrien Corenflos, James Thornton, George Deligiannidis, and Arnaud Doucet. Differentiable particle filtering via entropy-regularized optimal transport. In International Conference on Machine Learning, pp. 2100–2111. PMLR, 2021.
|
| 280 |
+
|
| 281 |
+
Francesco D’Angelo and Vincent Fortuin. Annealed stein variational gradient descent. In Third Symposium on Advances in Approximate Bayesian Inference, 2021.
|
| 282 |
+
|
| 283 |
+
Arnaud Doucet, Nando de Freitas, and Neil Gordon. An introduction to sequential monte carlo methods. In Sequential Monte Carlo methods in practice, pp. 3–14. Springer, 2001.
|
| 284 |
+
|
| 285 |
+
Hao Fu, Chunyuan Li, Xiaodong Liu, Jianfeng Gao, Asli C¸ elikyilmaz, and Lawrence Carin. Cyclical annealing schedule: A simple approach to mitigating kl vanishing. In NAACL-HLT (1), 2019.
|
| 286 |
+
|
| 287 |
+
Charles J Geyer and Elizabeth A Thompson. Annealing markov chain monte carlo with applications to ancestral inference. Journal of the American Statistical Association, 90(431):909–920, 1995.
|
| 288 |
+
|
| 289 |
+
Jackson Gorham and Lester Mackey. Measuring sample quality with stein’s method. Advances in Neural Information Processing Systems, 28, 2015.
|
| 290 |
+
|
| 291 |
+
Jackson Gorham and Lester Mackey. Measuring sample quality with kernels. In International Conference on Machine Learning, pp. 1292–1301. PMLR, 2017.
|
| 292 |
+
|
| 293 |
+
Peter J Green. Reversible jump markov chain monte carlo computation and bayesian model determination. Biometrika, 82(4):711–732, 1995.
|
| 294 |
+
|
| 295 |
+
Leonard Gross. Logarithmic sobolev inequalities. American Journal of Mathematics, 97(4):1061– 1083, 1975.
|
| 296 |
+
|
| 297 |
+
WK Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97–109, 1970.
|
| 298 |
+
|
| 299 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020.
|
| 300 |
+
|
| 301 |
+
Tianyang Hu, Zixiang Chen, Hanxi Sun, Jincheng Bai, Mao Ye, and Guang Cheng. Stein neural sampler. arXiv preprint arXiv:1810.03545, 2018.
|
| 302 |
+
|
| 303 |
+
Chin-Wei Huang, Shawn Tan, Alexandre Lacoste, and Aaron C Courville. Improving explorability in variational inference with annealed variational objectives. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
|
| 304 |
+
|
| 305 |
+
Aapo Hyvarinen and Peter Dayan. Estimation of non-normalized statistical models by score match-¨ ing. Journal of Machine Learning Research, 6(4), 2005.
|
| 306 |
+
|
| 307 |
+
Diederik Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. Advances in neural information processing systems, 34:21696–21707, 2021.
|
| 308 |
+
|
| 309 |
+
Durk P Kingma and Yann Cun. Regularized estimation of image statistics by score matching. Advances in neural information processing systems, 23, 2010.
|
| 310 |
+
|
| 311 |
+
Cheng Lu, Kaiwen Zheng, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Maximum likelihood training for score-based diffusion odes by high order denoising score matching. In International Conference on Machine Learning, pp. 14429–14460. PMLR, 2022.
|
| 312 |
+
|
| 313 |
+
Stephan Mandt, James McInerney, Farhan Abrol, Rajesh Ranganath, and David Blei. Variational tempering. In Arthur Gretton and Christian C. Robert (eds.), Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, volume 51 of Proceedings of Machine Learning Research, pp. 704–712, Cadiz, Spain, 09–11 May 2016. PMLR.
|
| 314 |
+
|
| 315 |
+
Enzo Marinari and Giorgio Parisi. Simulated tempering: a new monte carlo scheme. EPL (Europhysics Letters), 19(6):451, 1992.
|
| 316 |
+
|
| 317 |
+
James Martens, Ilya Sutskever, and Kevin Swersky. Estimating the hessian by back-propagating curvature. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pp. 963–970, 2012.
|
| 318 |
+
|
| 319 |
+
Agdg Matthews, M. Arbel, D. J. Rezende, and A. Doucet. Continual repeated annealed flow transport monte carlo. 2022.
|
| 320 |
+
|
| 321 |
+
Chenlin Meng, Lantao Yu, Yang Song, Jiaming Song, and Stefano Ermon. Autoregressive score matching. Advances in Neural Information Processing Systems, 33:6673–6683, 2020.
|
| 322 |
+
|
| 323 |
+
Radford M Neal. Annealed importance sampling. Statistics and computing, 11(2):125–139, 2001.
|
| 324 |
+
|
| 325 |
+
Radford M Neal. Mcmc using hamiltonian dynamics. In Handbook of Markov Chain Monte Carlo, pp. 139–188. Chapman and Hall/CRC, 2011.
|
| 326 |
+
|
| 327 |
+
Kirill Neklyudov and Max Welling. Orbital mcmc. In International Conference on Artificial Intelligence and Statistics, pp. 5790–5814. PMLR, 2022.
|
| 328 |
+
|
| 329 |
+
Kirill Neklyudov, Max Welling, Evgenii Egorov, and Dmitry Vetrov. Involutive mcmc: a unifying framework. In International Conference on Machine Learning, pp. 7273–7282. PMLR, 2020.
|
| 330 |
+
|
| 331 |
+
Peter Olsson. Two phase transitions in the fully frustrated xy model. Physical review letters, 75(14): 2758, 1995.
|
| 332 |
+
|
| 333 |
+
Tianyu Pang, Kun Xu, Chongxuan Li, Yang Song, Stefano Ermon, and Jun Zhu. Efficient learning of generative models via finite-difference score matching. Advances in Neural Information Processing Systems, 33:19175–19188, 2020.
|
| 334 |
+
|
| 335 |
+
Grigorios A Pavliotis. Stochastic processes and applications: diffusion processes, the Fokker-Planck and Langevin equations, volume 60. Springer, 2014.
|
| 336 |
+
|
| 337 |
+
Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International conference on machine learning, pp. 1530–1538. PMLR, 2015.
|
| 338 |
+
|
| 339 |
+
Gareth O Roberts and Jeffrey S Rosenthal. Optimal scaling of discrete approximations to langevin diffusions. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 60(1): 255–268, 1998.
|
| 340 |
+
|
| 341 |
+
Tim Salimans, Diederik Kingma, and Max Welling. Markov chain monte carlo and variational inference: Bridging the gap. In International conference on machine learning, pp. 1218–1226. PMLR, 2015.
|
| 342 |
+
|
| 343 |
+
Ch Schutte, Alexander Fischer, Wilhelm Huisinga, and Peter Deuflhard. A direct approach to con- ¨ formational dynamics based on hybrid monte carlo. Journal of Computational Physics, 151(1): 146–168, 1999.
|
| 344 |
+
|
| 345 |
+
Jiaming Song, Shengjia Zhao, and Stefano Ermon. A-nice-mc: Adversarial training for mcmc. Advances in Neural Information Processing Systems, 30, 2017.
|
| 346 |
+
|
| 347 |
+
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019.
|
| 348 |
+
|
| 349 |
+
Yang Song, Sahaj Garg, Jiaxin Shi, and Stefano Ermon. Sliced score matching: A scalable approach to density and score estimation. In Proceedings of the Thirty-Fifth Conference on Uncertainty in Artificial Intelligence, UAI 2019, Tel Aviv, Israel, July 22-25, 2019, pp. 204, 2019.
|
| 350 |
+
|
| 351 |
+
Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020.
|
| 352 |
+
|
| 353 |
+
Charles M Stein. Estimation of the mean of a multivariate normal distribution. The annals of Statistics, pp. 1135–1151, 1981.
|
| 354 |
+
|
| 355 |
+
Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space. Advances in Neural Information Processing Systems, 34:11287–11302, 2021.
|
| 356 |
+
|
| 357 |
+
Peter JM Van Laarhoven and Emile HL Aarts. Simulated annealing. In Simulated annealing: Theory and applications, pp. 7–15. Springer, 1987.
|
| 358 |
+
|
| 359 |
+
Pascal Vincent. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661–1674, 2011.
|
| 360 |
+
|
| 361 |
+
Li K Wenliang and Heishiro Kanagawa. Blindness of score-based methods to isolated components and mixing proportions. arXiv e-prints, pp. arXiv–2008, 2020.
|
| 362 |
+
|
| 363 |
+
Florian Wenzel, Kevin Roth, Bastiaan Veeling, Jakub Swiatkowski, Linh Tran, Stephan Mandt, Jasper Snoek, Tim Salimans, Rodolphe Jenatton, and Sebastian Nowozin. How good is the Bayes posterior in deep neural networks really? In Hal Daume III and Aarti Singh (eds.), ´ Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 10248–10259. PMLR, 13–18 Jul 2020.
|
| 364 |
+
|
| 365 |
+
Hao Wu, Jonas Kohler, and Frank No ¨ e. Stochastic normalizing flows. ´ Advances in Neural Information Processing Systems, 33:5933–5944, 2020.
|
| 366 |
+
|
| 367 |
+
Tatiana Xifara, Chris Sherlock, Samuel Livingstone, Simon Byrne, and Mark Girolami. Langevin diffusions and the metropolis-adjusted langevin algorithm. Statistics & Probability Letters, 91: 14–19, 2014.
|
| 368 |
+
|
| 369 |
+
Takuya Yamano. Skewed jensen—fisher divergence and its bounds. Foundations, 1(2):256–264, 2021.
|
| 370 |
+
|
| 371 |
+
# A PROOF OF PROPOSITION 1
|
| 372 |
+
|
| 373 |
+
We provide the proof of Proposition 1 here.
|
| 374 |
+
|
| 375 |
+
Proof. With fixed $p$ and known target $q$ , the optimal test function $\mathbf { f } ^ { * }$ has representation
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\mathbf { f } ^ { * } = \arg \operatorname* { m i n } _ { \mathbf { f } } \mathcal { L } ( \mathbf { f } )
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
Where functional $\mathcal { L } ( \mathbf { f } )$ has integral representation
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( f ) = \mathbb { E } _ { x \sim p } \bigg \{ \langle \nabla _ { x } \log q ( x ) , \mathbf { f } ( x ) \rangle + \langle \nabla _ { x } , \mathbf { f } ( x ) \rangle - \lambda [ \mathbf { f } ^ { T } ( x ) \mathbf { f } ( x ) ] \bigg \} } \\ { \displaystyle \qquad = \int p ( x ) \langle \nabla _ { x } \log q ( x ) , \mathbf { f } ( x ) \rangle + p ( x ) \langle \nabla _ { x } , \mathbf { f } ( x ) \rangle - \lambda p ( x ) [ \mathbf { f } ^ { T } ( x ) \mathbf { f } ( x ) ] d x } \\ { \displaystyle \qquad = \int l ( x , \mathbf { f } , \nabla \mathbf { f } ) d x . } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Here $\begin{array} { r } { l ( x , \mathbf { f } , \nabla \mathbf { f } ) = \int p ( x ) \langle \nabla _ { x } \log q ( x ) , \mathbf { f } ( x ) \rangle + p ( x ) \langle \nabla _ { x } , \mathbf { f } ( x ) \rangle - \lambda p ( x ) [ \mathbf { f } ^ { T } ( x ) \mathbf { f } ( x ) ] . } \end{array}$ . By EulerLagrange equation, the optimal function f satisfies
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\frac { \partial l } { \partial { \bf f } } - \frac { d } { d x } ( \frac { \partial l } { \partial { \bf f ^ { \prime } } } ) + \frac { \partial ^ { 2 } } { \partial x ^ { 2 } } ( \frac { \partial l } { \partial { \bf f ^ { \prime \prime } } } ) = 0 .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
By calculation, we have
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { l } { \displaystyle \frac { \partial l } { \partial { \bf f } } ( { \boldsymbol x } ) = p ( { \boldsymbol x } ) \nabla \log q ( { \boldsymbol x } ) - 2 \lambda p ( { \boldsymbol x } ) { \bf f } ( { \boldsymbol x } ) } \\ { \displaystyle \frac { d } { d x } ( \frac { \partial l } { \partial { \bf f ^ { \prime } } } ) ( { \boldsymbol x } ) = \nabla _ { { \boldsymbol x } } p ( { \boldsymbol x } ) } \\ { \displaystyle \frac { \partial l } { \partial { \bf f ^ { \prime \prime } } } ( { \boldsymbol x } ) = 0 . } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
So the optimal $\mathbf { f } ^ { * }$ satisfies the Euler-Lagrange equation as
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
p ( x ) \nabla _ { x } \log q ( x ) - 2 \lambda p ( x ) \mathbf { f } ( x ) - \nabla _ { x } p ( x ) = 0 .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Divide the both side with $p ( x )$ and note that $\nabla _ { x } p ( x ) / p ( x ) = \nabla _ { x } \log p ( x )$ , the equation turns to
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\mathbf { f } ^ { * } ( x ) = \frac { 1 } { 2 \lambda } \big [ \nabla _ { x } \log q ( x ) - \nabla _ { x } \log p ( x ) \big ] .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Next consider optimal $s ^ { * }$ . The $s ^ { * }$ is obtained by minimizing the Score Matching objective, which is equivalent to minimizing the Fisher divergence between $p$ and $s$ induced family, thus the optimal $\boldsymbol { s } ^ { * } ( \bar { \boldsymbol { x } } ) = \nabla _ { \boldsymbol { x } } \log \boldsymbol { p } ( \boldsymbol { x } )$ . Substitute $\nabla _ { x } \log p ( \bar { x ) }$ with $s ^ { * }$ into $f ^ { * }$ formula, we have
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\mathbf { f } ^ { * } ( x ) = \frac { 1 } { 2 \lambda } \big [ \nabla _ { x } \log q ( x ) - s ^ { * } ( x ) \big ] .
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
# B PROOF OF PROPOSITION 2
|
| 418 |
+
|
| 419 |
+
In this section, we prove that the S2D loss and Fisher Divergence shares exactly the same parameter gradient.
|
| 420 |
+
|
| 421 |
+
Proof. Let $p _ { \theta }$ denote sampler’s distribution. $s _ { \theta }$ denote the true but unknown sampler’s score function. $q$ denotes the known un-normalized target. For rest of the proof, the notion $\| x \|$ represents the $L ^ { 2 }$ norm of a vector in $D _ { X }$ dimensional Euclidean space $x ~ \in \mathbb { R } ^ { D _ { X } }$ . Recall that the Fisher Divergence is defined as
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\begin{array} { r } { \mathcal { L } _ { F D } ( \theta ) = \mathbb { E } _ { x \sim p _ { \theta } } \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| _ { 2 } ^ { 2 } . } \end{array}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
Thus the sampler parameter gradient of Fisher Divergence writes
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { l } { \displaystyle \frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } } \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } = \frac { \partial } { \partial \theta } \int \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| _ { 2 } ^ { 2 } p _ { \theta } ( x ) d x } \\ { = \displaystyle \int \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| _ { 2 } ^ { 2 } \frac { \partial } { \partial \theta } p _ { \theta } ( x ) d x + \displaystyle \int p _ { \theta } ( x ) \frac { \partial } { \partial \theta } \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| _ { 2 } ^ { 2 } d x } \\ { = \mathbb { E } _ { p _ { \theta } } \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } \frac { \partial } { \partial \theta } \log p _ { \theta } ( x ) + \mathbb { E } _ { p _ { \theta } } 2 ( s _ { \theta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \frac { \partial } { \partial \theta } s _ { \theta } ( x ) } \\ { = ( 1 ) + ( 2 ) . } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
The first term can be estimated with
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\begin{array} { l } { \displaystyle ( 1 ) = \int \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } \frac { \partial } { \partial \theta } p _ { \theta } ( x ) d x } \\ { \displaystyle = \frac { \partial } { \partial \theta } \int \mathbf { s g } \big [ \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } \big ] p _ { \theta } ( x ) } \\ { \displaystyle = \frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } } \mathbf { s g } \bigg [ \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } \bigg ] . } \end{array}
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Here the operator sg denotes stop gradient operator with respect to parameter $\theta$ . $\mathbf { s g } [ f _ { \theta } ]$ stop the parameter dependence of $\theta$ for function $f$ , meaning that one can only evaluate $f _ { \theta } ( x )$ point-wise but can not obtain the $\theta$ gradient of $f _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ . Here we stop the gradient of function $\| \nabla \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 }$ , so we can use another score network $s _ { \phi }$ to approximate $s _ { \theta }$ point-wise, regardless of the $\theta$ parameter dependence. Next we consider the second term. The second term turns to
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\begin{array} { r l } & { 2 ) = \mathbb { E } _ { p \rho ^ { 2 } } ( s _ { \vartheta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \frac { \partial } { \partial \theta } s _ { \vartheta } ( x ) } \\ & { = \mathbb { E } _ { p _ { \vartheta } ^ { 2 } } ( s _ { \vartheta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \frac { \partial } { \partial \theta } \nabla _ { x } \log p _ { \vartheta } ( x ) } \\ & { = 2 \displaystyle \int p _ { \vartheta } ( x ) ( s _ { \vartheta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \frac { \partial } { \partial \theta } \frac { \partial } { \partial x } \log p _ { \vartheta } ( x ) d x } \\ & { = 2 \displaystyle \int p _ { \vartheta } ( x ) ( s _ { \vartheta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \frac { \partial } { \partial \theta } \left[ \frac { 1 } { p _ { \vartheta } ( x ) } \frac { \partial p _ { \vartheta } ( x ) } { \partial x } \right] d x } \\ & { = 2 \displaystyle \int ( s _ { \vartheta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \left[ \frac { \partial } { \partial \theta } \frac { \partial } { \partial x } p _ { \vartheta } ( x ) \right] d x - 2 \displaystyle \int p _ { \vartheta } ( x ) ( s _ { \vartheta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \left[ \frac { \partial \log p _ { \vartheta } ( x ) } { \partial x } \frac { \partial } { \partial x } \right. } \\ & { \left. - { \langle \Phi \rangle _ { * } } _ { * } ( x ) \right] ( \vartheta ) } \end{array}
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
Looking at (3), we have
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\begin{array} { r l } & { ( 3 ) = 2 \displaystyle \int ( s _ { \theta } ( x ) - \nabla _ { x } \log q ( x ) ) ^ { T } \Big [ \frac { \partial } { \partial \theta } \frac { \partial } { \partial x ^ { p _ { \theta } ( x ) } } \Big ] d x } \\ & { = 2 \displaystyle \int \frac { \partial } { \partial \theta } \Big \{ \bf s g \Big [ ( \delta _ { \theta } ( x ) - \nabla _ { x } \log q ( x ) ) \Big ] ^ { T } \frac { \partial } { \partial x ^ { p _ { \theta } ( x ) } } \Big \} d x } \\ & { = 2 \displaystyle \frac { \partial } { \partial \theta } \int \frac { \partial } { \partial c } p _ { \theta } ( x + \epsilon \nu ) d x , \quad \boldsymbol { v } = \bf s g \Big [ ( \delta _ { \theta } ( x ) - \nabla _ { x } \log q ( x ) ) \Big ] , \boldsymbol { \epsilon } = 0 } \\ & { = 2 \displaystyle \frac { \partial } { \partial \theta } \frac { \partial } { \partial \epsilon } \int p _ { \theta } ( x + \epsilon \nu ) d x } \\ & { = 2 \displaystyle \frac { \partial } { \partial \theta } \frac { \partial } { \partial \epsilon } 1 } \\ & { = 0 . } \end{array}
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Above equality holds because of $\textstyle \int p _ { \theta } ( x + \epsilon v ) d x = 1$ holds for all $v , \theta , \epsilon$ . If we view $\epsilon$ as a shift strength parameter, the above equality recovers the first order Bartlett identity (Bartlett, 1953).
|
| 452 |
+
|
| 453 |
+
Next we turns to term (4). Note that
|
| 454 |
+
|
| 455 |
+
$$
|
| 456 |
+
\begin{array} { r l } & { ( 4 ) _ { \perp } - - 2 \int m ( | x | ^ { \prime } ( s _ { \perp } \langle x \rangle - \nabla _ { x } \cdot | \mathbf { g } _ { \mathbf { Q } } | \langle x \rangle ) ^ { 2 } | \begin{array} { l } { \mathrm { R e } _ { \perp } \langle x \rangle x \mathrm { R e } _ { \perp } \langle x \rangle } \\ { \mathrm { a s } } \end{array} | \mathrm { d } x \equiv \mathrm { i } ( \mathrm { R e } _ { \perp } \langle x \rangle ) } \\ & { = \ \int \int m ( \frac { 1 } { s _ { \perp } } x x x x ) ^ { 2 } \mathrm { R e } _ { \perp } x x x x x } \\ & { = - 2 \int ( | x _ { \perp } \langle x \rangle - \nabla _ { x } | \mathbf { g } _ { \mathbf { Q } } \langle x \rangle ) ^ { 2 } \mathrm { R e } _ { \perp } x x x x } \\ & { \qquad \mathrm { a s } } \\ & { - 2 \frac { B } { \omega } \int \mathrm { d } s \{ | \omega _ { \perp } \langle x \rangle - \nabla _ { x } | \mathbf { g } _ { \mathbf { Q } } \langle x \rangle \} ^ { 2 } \frac { \partial } { \partial x } \mathrm { d } x \mathrm { d } s x x x } \\ & { = - \frac { \partial } { \partial t } \int \mathrm { d } s \{ x \langle x \rangle - \nabla _ { x } \cdot | \mathbf { g } _ { \mathbf { Q } } \langle x \rangle x x \mathrm { d } x \overline { { \mathbf { Q } } _ { \mathbf { Q } } \langle x \rangle } \} | \mathbf { g } _ { \mathbf { Q } } x x } \\ & = - \frac { \partial } { \partial t } \int \mathrm { d } s \{ x x - \nabla _ { x } \cdot | \mathbf { g } _ { \mathbf { Q } } \langle x x x \mathrm { d } x \overline { { \mathbf { Q } _ { \mathbf { Q } } \langle x \rangle } } | \mathbf { g } _ { \mathbf { Q } } x \} \\ & - \frac { \partial } { \partial t } \overline { { w } } _ \end{array}
|
| 457 |
+
$$
|
| 458 |
+
|
| 459 |
+
Combining all above, we calculate the parameter derivative as
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\begin{array} { r l } & { \displaystyle \frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } } \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } } \\ & { = ( 1 ) + ( 2 ) = ( 1 ) + ( 3 ) + ( 4 ) } \\ & { \displaystyle = \frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } } \mathbf { s g } \bigg [ \| \nabla _ { x } \log q ( x ) - s _ { \theta } ( x ) \| ^ { 2 } \bigg ] + 0 - 2 \frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } ( x ) } \bigg \{ \mathbf { s g } \bigg [ \big ( s _ { \theta } ( x ) - \nabla _ { x } \log q ( x ) \big ) \bigg ] ^ { T } \mathbf { s g } \bigg [ s _ { \theta } ( x ) \bigg ] \bigg \} } \\ & { = \displaystyle \frac { \partial } { \partial \theta } \mathbb { E } _ { p _ { \theta } } \bigg \{ \mathbf { s g } \bigg [ \| \nabla _ { x } \log q ( x ) \| ^ { 2 } \bigg ] - \mathbf { s g } \bigg [ \| s _ { \theta } ( x ) \| ^ { 2 } \bigg ] \bigg \} . } \end{array}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
Thus the equivalent loss function
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\mathcal { L } _ { S 2 D } ( \theta ) = \mathbb { E } _ { p _ { \theta } } \bigg \{ \mathbf { s g } \bigg [ \| \nabla _ { x } \log q ( x ) \| ^ { 2 } \bigg ] - \mathbf { s g } \bigg [ \| s _ { \theta } ( x ) \| ^ { 2 } \bigg ] \bigg \} .
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
Share the same parameter gradients as the Fisher divergence which is intractable. Since we only need the $x$ gradient of sampler score function $s _ { \theta }$ (because the stop gradient operator), so we can estimate $s _ { \theta } ( x )$ through another score network $s _ { \phi } ( x )$ with samples consistently obtained from sampler. With above objective function, we could minimize the Fisher divergence between $p _ { \theta }$ and $q$ . □
|
| 472 |
+
|
| 473 |
+
# C INTRODUCTION TO METROPOLIS-HASTINGS AND HAMILTONIAN CORRECTION
|
| 474 |
+
|
| 475 |
+
Assume the target distribution is $p ( x )$ , the MH MCMC requires a proposal distribution $p ( \tilde { x } | x )$ to propose candidate samples $\tilde { x } \sim q ( \tilde { x } | x )$ . The Markov chain then accept the candidate sample with probability r = min{ p(˜x)q(x|x˜)p(x)q(˜x|x) , . Under some conditions, the chain will eventually reach $p ( x )$ as stationary distribution. The proposal distribution can be symmetric or non-symmetric. Conditional gaussian $q ( \tilde { x } | x ) = \mathcal { N } ( x ; \sigma ^ { 2 } )$ is a usual choice. Proposals based on score function $q ( \tilde { x } | x ) = \mathcal { N } ( x +$ $\begin{array} { r } { \frac { \epsilon } { 2 } \nabla _ { x } \log p ( x ) , \sigma ^ { 2 } ) } \end{array}$ is also popular (Xifara et al., 2014). If one consider an auxiliary state space of $( x , v )$ and execute the proposal in such space, the MC schedule is called Hamiltonian Monte Carlo. The Hamiltonian Monte Carlo execute a Monte Carlo dynamic in auxiliary space. With current sample $X ^ { ( t ) }$ . The HMC sample a momentum vector from an auxiliary distribution $V ^ { ( t ) } \sim$ $\exp ( - v ^ { T } M ^ { - 1 } v / 2 )$ . The joint sample $( X ^ { ( t ) } , V ^ { ( t ) } )$ updated by running a Hamiltonian Dynamics in joint space via
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
{ \frac { d X _ { t } } { d t } } = { \frac { \partial H } { \partial V } } , { \frac { d V _ { t } } { d t } } = - { \frac { \partial H } { \partial X } } .
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
Here $\begin{array} { r } { H ( x , v ) = - \log p ( x ) + \frac { 1 } { 2 } v ^ { T } M ^ { - 1 } v } \end{array}$ is the Hamiltonian of such mechanical system. HMC has many advantage that it mixes well for high-dimensional targets, and travels in joints space thus not easy to be trapped in local minima. Leap frog integrator is usually a practical choice for numerical updates (Neal, 2011). To make Markov Chain detail balanced, additional Metropolis correction is also needed for a Hamiltonian proposal. In short words, HMC iteratively accepts new position and momentum pair $( \tilde { x } , \tilde { v } )$ with rate $\operatorname* { m i n } 1$ , $\frac { H ( \tilde { x } , \tilde { v } ) } { H ( x , v ) }$ where $( \tilde { x } , \tilde { v } ) = L e a p F r o g ( x , v )$ as approximated Hamiltonian proposal.
|
| 482 |
+
|
| 483 |
+
# D PROOF OF THEOREM 1
|
| 484 |
+
|
| 485 |
+
We give the proof of Theorem 1 here. To begin with, we give a lemma to bound KL divergence with Fisher divergence as shown in Yamano (2021)
|
| 486 |
+
|
| 487 |
+
Lemma 2. For fixed $q$ , there exists a dimension-free positive constant c such that for every distribution $p$ which is both integral and log-integral with respect to $q$ , and $p$ has same support as $q$ , we have
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\mathcal { D } _ { K L } \leq \frac { c } { 2 } \mathcal { D } _ { F } ( p , q ) .
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
proof of lemma. For every 1st order smooth function $f$ , assume both $| f | ^ { 2 }$ and $\| \nabla f \| _ { 2 } ^ { 2 }$ are integrable with respect to $q$ , the log-Sobolev’s inequality (Gross, 1975) shows that there exist a dimension-free positive constant $c$ , such that
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\int | f | ^ { 2 } \log | f | q ( x ) d x \leq c \int \| \nabla f \| ^ { 2 } q ( x ) d x + \| f \| _ { 2 } ^ { 2 } \log \| f \| _ { 2 } ^ { 2 } .
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
Here $\begin{array} { r } { \| f \| _ { 2 } ^ { 2 } = \int | f | ^ { 2 } q ( x ) d x } \end{array}$ . Replace $f = { \sqrt { p / q } }$ , we have
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
L H S = { \frac { 1 } { 2 } } \int ( p / q ) \log ( p / q ) q = { \frac { 1 } { 2 } } \mathbb { E } _ { p } \log ( p / q ) = { \mathcal { D } } _ { K L } ( p , q ) .
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
So we have
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\nabla { \frac { \sqrt { p } } { \sqrt { q } } } = { \frac { 1 } { 2 } } \left[ { \frac { { \frac { \nabla p } { \sqrt { p } } } { \sqrt { q } } - { \frac { \nabla q } { \sqrt { q } } } { \sqrt { p } } } { q } } \right] = { \frac { 1 } { 2 } } \left[ { \sqrt { { \frac { p } { q } } } } { \frac { \nabla p } { p } } - { \sqrt { { \frac { p } { q } } } } { \frac { \nabla q } { q } } \right] = { \frac { 1 } { 2 } } { \sqrt { { \frac { p } { q } } } } \left[ \nabla \log p - \nabla \log q \right] .
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
Thus the first term in RHS is
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
\begin{array} { l } { { \displaystyle c \int \| \nabla f \| ^ { 2 } q ( x ) d x } = { \displaystyle c \int \| \nabla \sqrt { \frac { p } { q } } \| ^ { 2 } q ( x ) p = \frac { c } { 2 } \int \| \nabla \log p - \nabla \log q \| ^ { 2 } p } } \\ { ~ } \\ { { \displaystyle ~ = \mathbb { E } _ { p } \| \nabla \log p - \nabla \log q \| ^ { 2 } = \mathcal { D } _ { F } ( p , q ) } . } \end{array}
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
Note that $\begin{array} { r } { \| f \| _ { 2 } ^ { 2 } = \int | f | ^ { 2 } q ( x ) d x = \int ( p / q ) q = \int p = 1 } \end{array}$ . We combine both sides to conclude
|
| 518 |
+
|
| 519 |
+
$$
|
| 520 |
+
\frac { c } { 2 } { \cal D } _ { K L } ( p , q ) \leq \frac { 1 } { 2 } { \cal D } _ { F } ( p , q ) + 0 .
|
| 521 |
+
$$
|
| 522 |
+
|
| 523 |
+
So we have
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\mathcal { D } _ { K L } ( p , q ) \leq \frac { c } { 2 } \mathcal { D } _ { F } ( p , q ) ,
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
where $c$ be another positive constant.
|
| 530 |
+
|
| 531 |
+
The above lemma shows that KL divergence is upper bounded with Fisher divergence, which we are using to train the sampler. With above lemma, we can calculate mixing time for Langevin correction in proof below
|
| 532 |
+
|
| 533 |
+
Proof. Assume target satisfies
|
| 534 |
+
|
| 535 |
+
$$
|
| 536 |
+
\operatorname* { l i m } _ { \| x \| _ { 2 } \to + \infty } ( \frac { | \nabla \log q ( x ) | _ { 2 } ^ { 2 } } { 2 } - \Delta \log q ( x ) ) = + \infty .
|
| 537 |
+
$$
|
| 538 |
+
|
| 539 |
+
then their exits a constant $\lambda > 0$ , such that Poincare inequality holds for each $f \in C ^ { 1 } ( \mathbb { R } ^ { d } ) \cap L ^ { 2 } ( q )$ with $\mathbb { E } _ { q } f = 0$ Theorem 4.3 in Pavliotis (2014)
|
| 540 |
+
|
| 541 |
+
$$
|
| 542 |
+
\lambda \| f \| _ { L ^ { 2 } ( q ) } ^ { 2 } \leq \| \nabla f \| _ { L ^ { 2 } ( q ) } ^ { 2 } .
|
| 543 |
+
$$
|
| 544 |
+
|
| 545 |
+
Let $p _ { 0 }$ denotes the ASS distribution, which is trained to be bounded with $\mathcal { D } _ { F } ( p _ { 0 } , q ) ~ \leq ~ \delta$ . By lemma, the KL between initial distribution $p _ { 0 }$ and target $q$ is bounded by Fisher divergence with a dimension-free constant $c$
|
| 546 |
+
|
| 547 |
+
$$
|
| 548 |
+
\mathcal { D } _ { K L } ( p _ { 0 } , q ) \leq \frac { c } { 2 } \mathcal { D } _ { F } ( p _ { 0 } , q ) \leq \delta \leq + \infty
|
| 549 |
+
$$
|
| 550 |
+
|
| 551 |
+
With Poincare’s inequality holds, the $\mathrm { K L }$ along Langevin diffusion $d X _ { t } = \nabla \log q ( X _ { t } ) / 2 + d W _ { t }$ decays exponentially fast as in Theorem 4.6 in Pavliotis (2014)
|
| 552 |
+
|
| 553 |
+
$$
|
| 554 |
+
\begin{array} { r l } & { \mathcal { D } _ { K L } ( p _ { t } , q ) \leq \exp ( - 2 \lambda t ) \mathcal { D } _ { K L } ( p _ { 0 } , q ) } \\ & { \quad \quad \quad \quad \quad \leq \exp ( - 2 \lambda t ) \frac { c } { 2 } \mathcal { D } _ { F } ( p _ { 0 } , q ) } \\ & { \quad \quad \quad \quad \leq \exp ( - 2 \lambda t ) \frac { c } { 2 } \delta . } \end{array}
|
| 555 |
+
$$
|
| 556 |
+
|
| 557 |
+
Thus if we want $\mathcal { D } _ { K L } ( p _ { t } , q )$ to be controlled under tolerance $\epsilon$ , we only need diffused time $t$ to satisfies
|
| 558 |
+
|
| 559 |
+
$$
|
| 560 |
+
t \geq \frac { 1 } { 2 \lambda } \bigg [ \log ( \frac { c } { 2 } ) + \log ( \frac { \delta } { \epsilon } ) \bigg ] = \frac { 1 } { 2 \lambda } \bigg [ C + \log ( \frac { \delta } { \epsilon } ) \bigg ] .
|
| 561 |
+
$$
|
| 562 |
+
|
| 563 |
+
where we place $\begin{array} { r } { C = \log \left( \frac { c } { 2 } \right) } \end{array}$ to be another constant. The diffusion time must be positive, thus we take
|
| 564 |
+
|
| 565 |
+
$$
|
| 566 |
+
T ^ { * } = \operatorname* { m a x } \{ 0 , \frac { 1 } { 2 \lambda } \left[ C + \log ( \frac { \delta } { \epsilon } ) \right] \} ,
|
| 567 |
+
$$
|
| 568 |
+
|
| 569 |
+
and finish the proof.
|
| 570 |
+
|
| 571 |
+
# E EXPERIMENTAL DETAILS AND MORE RESULTS
|
| 572 |
+
|
| 573 |
+
# E.1 SYNTHETIC TARGET
|
| 574 |
+
|
| 575 |
+
For toy 2-dimensional data experiments, we use a 3-layer MLP neural network with 200 hidden units in each layer as the sampler. The activation of the sampler is chosen as LeakyReLU non-linearity with a 0.2 coefficient. The score network is a 3-layer MLP with 200 hidden units in each layer. The activation of the score network is GELU non-linearity.
|
| 576 |
+
|
| 577 |
+
When reporting the numbers in Tab 1, we compute MMD metrics based on a total of 2000 samples. We run 20 independent experiments for each target and algorithm to calculate the mean and standard deviation.
|
| 578 |
+
|
| 579 |
+
Figure 6 visualizes the model capabilities of FIS, AFIS, and AFIS $^ +$ MC samplers for matching three 2-dimensional target energy functions.
|
| 580 |
+
|
| 581 |
+

|
| 582 |
+
Figure 6: Comparison between samples generated by FIS, AFIS and AFIS $+ \mathbf { M } \mathbf { C }$ on three 2D energy functions.
|
| 583 |
+
|
| 584 |
+
# E.2 BAYESIAN REGRESSION
|
| 585 |
+
|
| 586 |
+
For high-dimensional data experiments, we also use 3-layer MLP neural networks as the sampler and score network, respectively. The activation of the sampler is chosen as LeakyReLU non-linearity with a 0.2 coefficient. The activation of the score network is GELU non-linearity. For Australian and Heart distributions, we use 400 hidden units in each layer and 600 hidden units for German distribution.
|
| 587 |
+
|
| 588 |
+
When reporting the numbers in Tab 2, we compute the MMD metric based on a total of 2000 samples. We run 20 independent experiments for each target and algorithm to calculate the mean and standard deviation. For the basic settings of Bayesian Regression problems, readers could refer to Song et al. (2017) for more details.
|
| 589 |
+
|
| 590 |
+
# F FULL AFIS ALGORITHM
|
| 591 |
+
|
| 592 |
+
This section gives the full Annealed Fisher Implicit Sampler training algorithm.
|
| 593 |
+
|
| 594 |
+
# Algorithm 2: Annealed Fisher Implicit Sampler training algorithm
|
| 595 |
+
|
| 596 |
+
<table><tr><td>gorimnZ.AmcaiedTTsnerhnpnenSanpilertranngaigorim log qprior(x) ; latent distribution pz(z), implicit sampler Gθ, score network s𝜙, mini-batch size B,max iteration M. Randomly initialize (0(o),(0)). forkin1:Kdo</td></tr><tr><td># anneal the target set logqk(x) = λk log q(x)+ (1-λk)logqprior(x) for tin 1:M do</td></tr><tr><td>#update score network parameter Get mini-batch from sampler xi = Gθ(t)(zi), zi ~ pz(z),i=1,.,B. Calculate score matching objective</td></tr><tr><td>B 1 s(x)2+2(Vx,s(xi))]. Lsm(Φ)= B ?</td></tr><tr><td>i=1 Minimize Lsm(Φ) to get (t+1).</td></tr><tr><td>#update samplerparameter Get mini-batch latent code zi ~ pz(z),i = 1,...,B. Use re-parametrization trick to calculate S2D loss for sampler</td></tr><tr><td>B Ls2D(0) = Vxlogqk(Gθ(zi)-(t+1)(G(zi))2</td></tr></table>
|
md/dev/fCbTxKYJovs/fCbTxKYJovs.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEDEED: EFFICIENT FEDERATED DISTILLATION WITH ENSEMBLE OF AGGREGATED MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we study the key components of distillation-based model aggregation in federated learning (FL). For that purpose, we first propose a generalized distillation framework which divides the training and model aggregation process into three key stages and includes existing methods as special cases. By investigating the contribution of each stage, we propose a novel distillation-based FL scheme, named Federated Efficient Ensemble Distillation (FedEED). Different from existing approaches, the ensemble teacher of FedEED is constructed by aggregated models, instead of the client models, to achieve improved scalability in large-scale systems. Due to the use of aggregated models, FedEED also achieves higher level of privacy protection, because the access to client models is no longer required. Furthermore, the knowledge distillation in FedEED only happens from the ensemble teacher to a designated model such that the diversity among different aggregated models is maintained to improve the performance of the ensemble teacher. Experiment results show that FedEED outperforms the state-of-the-art FL schemes, including FedAvg and FedDF, on the benchmark datasets. Besides the performance advantage, the designated distillation also allows for parallelism between server-side distillation and clients-side local training, which could speed up the training of real world systems.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Federated learning (FL) (McMahan et al., 2017) allows users to jointly train a deep learning model without sharing their own data. Recent works (Lin et al., 2020; Zhang et al., 2022; Huang et al., 2022; Cho et al., 2022) adopted knowledge distillation (Hinton et al., 2015) for model aggregation to tackle data and device heterogeneity issues. These distillation-based aggregation methods have been shown to outperform weight averaging methods like FedAvg (McMahan et al., 2017). However, existing works utilized all client models to build the ensemble for knowledge distillation, leading to poor scalability in real world applications with a large number, e.g., thousands, of clients. Furthermore, existing methods built the ensemble teacher by similar client models, where the low diversity among the compositing models will limit the performance of the ensemble teacher.
|
| 12 |
+
|
| 13 |
+
To tackle the above issues, we will study the key components of distillation-based FL and propose an efficient and scalable distillation method. For that purpose, we first introduce a generalized framework for distillation-based model aggregation, which consists of three major components, namely the local trainers, the ensemble trainer, and the global trainer. The local trainers perform local training on the clients-side, where each local trainer handles a sub-group of participating clients. After that, each local trainer collects and aggregates the updated client models, and constructs one global model. Note that this is the global model for all participating clients in a sub-group. Existing FL algorithms like FedAvg (McMahan et al., 2017) can be used in-place as a local trainer. Then, the ensemble trainers combine the updated global models and local models into an ensemble, providing a higher capacity than the stand-alone global models. Finally, the global trainer will utilize the ensemble to further enhance the global models via knowledge distillation.
|
| 14 |
+
|
| 15 |
+
With the generalized framework, we investigate the contributions of each key component. In particular, we compare the performance of the distillation-based FL with different local, ensemble, and global trainers and try to tackle the limitations of the existing methods in a bottom-up manner. We focus on several aspects of the distillation framework including: 1.) Improving scalability and privacy of distillation-based aggregation by building the ensemble teacher from a set of aggregated models, i.e., client models are no longer required to construct the ensemble teacher; 2.) Maximizing the capacity of the ensemble and global models by maintaining the diversity among models utilized to create the ensemble; 3.) Reducing the computation overhead by exploiting the parallelism between server-side and client-side training. By integrating the above ideas together, we propose a new algorithm named Federated Efficient Ensemble Distillation (FedEED). FedEED is a highly scalable, distillation-based FL algorithm that does not require direct access to the client models, which provides further protection to the user privacy. The proposed FedEED achieved state-ofthe-art results in CIFAR10/100 (Krizhevsky et al., 2009) with the non-independent and identically distributed (Non-IID) data.
|
| 16 |
+
|
| 17 |
+
The contributions of this paper include:
|
| 18 |
+
|
| 19 |
+
1) We propose a generalized framework for distillaion-based model aggregation, which can be viewed as a generalization of the existing distillation-based FL algorithms. With the proposed framework, the contribution of each key component can be investigated to build up more efficient algorithms.
|
| 20 |
+
|
| 21 |
+
2) By investigating the contribution of each component in the generalized framework, we propose FedEED, a highly efficient and scalable, distillation-based FL algorithm with improved privacy and model diversity. Experiment results demonstrate that FedEED can achieve the state-of-the-art performance with lower complexity and latency than existing federated distillation algorithms.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORKS
|
| 24 |
+
|
| 25 |
+
Federated learning. Deep learning has obtained great successes in the last decade. However, in practice, large amount of user data can not be shared to the central server due to privacy regulations and communication constraints. To tackle the above issues, federated learning (McMahan et al., 2017) was proposed to train a global model based on data belonging to different users, without data sharing. The simplest approach is FedAvg (McMahan et al., 2017), which performs multiple local epochs of training on the client-side, and then aggregates the updated client models with weight averaging. Other approaches, such as FedProx (Li et al., 2020), also utilize weight averaging to perform model aggregation, but with added regularization to tackle data heterogeneity issues. In this paper, we focus on distillation-based model aggregation for FL. For both the generalized framework and the newly proposed FedEED, averaging based methods such as FedAvg and FedProx can be directly applied as the local trainers. This makes the proposed framework and FedEED compatible with different weight averaging methods.
|
| 26 |
+
|
| 27 |
+
Knowledge distillation. Knowledge distillation (Hinton et al., 2015) has been proposed in deep learning to compress deep neural networks. Student models, which typically have a smaller size, are forced to mimic the output of the teacher model. In some recent works, knowledge distillation has been applied in FL. There are two types of approaches to apply knowledge distillation in FL. The first type utilizes distillation to perform model aggregation. For example, FedDF (Lin et al., 2020) and FedBE (Chen & Chao, 2021) utilized client models as a teacher to update the global model on the server, and the purpose is to improve the model aggregation performance with heterogeneous data. Some other works, including FedFTG (Zhang et al., 2022) and Fed-ET (Cho et al., 2022), utilized distillation for the same purpose, but in a different setting, i.e. in a data-free or model heterogeneous environment. The second type shares model predictions between clients and the server for training purposes. For example, in FD (Jeong et al., 2018), model predictions are shared between clients to regularize the local training. In FedAD (Gong et al., 2021), model outputs on the client-side are used to train a global model on the server through distillation.
|
| 28 |
+
|
| 29 |
+
The proposed generalized framework and FedEED in this paper can be classified into the first type. In fact, the framework is a generalization of the available works in the first type. However, the mechanisms FedEED utilizes to improve its scalability, privacy and performance are orthogonal to those of the existing works, and can be combined with existing methods to further improve the performance.
|
| 30 |
+
|
| 31 |
+
# Algorithm 1 Generalized Framework for Model Aggregation
|
| 32 |
+
|
| 33 |
+
function LOCALTRAINER(wl0, ..., wlN−1) // Update local models wl∗0 , ..., wl∗N −1 $/ /$ Update global model wg return $w ^ { g }$ , wl∗0 , ..., wl∗N −1
|
| 34 |
+
end functionfunction ENSEMBLETR $\mathrm { A I N E R } ( w _ { 0 } ^ { g } , . . . , w _ { K - 1 } ^ { g } , w _ { 0 , 0 } ^ { l } , . . . , w _ { K - 1 , N _ { K - 1 } - 1 } ^ { l } )$ // Update ensemble $w ^ { e * }$ return we∗
|
| 35 |
+
end function
|
| 36 |
+
function GLOBALTRAINER $( w ^ { e * }$ , $w _ { 0 } ^ { g } , . . . , w _ { K - 1 } ^ { g } )$ return Update global models $w _ { 0 } ^ { g * } , . . . , w _ { K - 1 } ^ { g * }$ $w _ { 0 } ^ { g * } , . . . , w _ { K - 1 } ^ { g * }$
|
| 37 |
+
$/ /$ nd I $K$ dels $w _ { - 1 , 0 } ^ { g * } , \ldots , w _ { - 1 , K - 1 } ^ { g * }$ $t \in \{ 0 , . . . , T - 1 \}$ $/ /$ Split clients into sets $S _ { t , 0 } , . . . , S _ { t , K - 1 }$ with sizes $N _ { t , 0 } , . . . , N _ { t , K - 1 }$ for $k \in \{ 0 , . . . , K - 1 \}$ do in parallel r $\begin{array} { r l } & { w _ { t , k , 0 } ^ { l } , . . . , w _ { t , k , N _ { t , k } - 1 } ^ { l } w _ { t - 1 , k } ^ { g * } } \\ & { w _ { t , k } ^ { g } , w _ { t , k , 0 } ^ { l * } , . . . , w _ { t , k , N _ { t , k } - 1 } ^ { l * } L o c a l T r a i n e r ( w _ { t , k , 0 } ^ { l } , . . . , w _ { t , k , N _ { t , k } - 1 } ^ { l } ) } \end{array}$ end forwe∗t ← EnsembleTrainer(wgt,0, ..., wgt,K−1, wl∗t,0,0, ..., wl∗t,K−1,Nt,K−1−1)
|
| 38 |
+
wg∗t,0, ..., wg∗t,K−1 ← GlobalTrainer(we∗t , wgt,0, ..., wgt,K−1)
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 1: (a) Overview of the generalized framework for model aggregation. The number of local trainer, the implementation of local training, ensembling, etc., are subject to the implementation. (b) The Ensemble trainer and global trainer of FedEED. There are two key differences. First, the ensemble trainer in FedEED only utilizes the $K$ global models to build the ensemble. Second, the global trainer only update one of the global models by distillation.
|
| 42 |
+
|
| 43 |
+
# 3 THE GENERALIZED FRAMEWORK FOR MODEL AGGREGATION
|
| 44 |
+
|
| 45 |
+
To investigate the potential of utilizing distillation for model aggregation in $\mathrm { F L }$ , we propose the generalized framework, which includes $K$ local trainers, an ensemble trainer, and a global trainer, as shown in Fig. 1a. Each trainer can be replaced by different implementations to form different algorithms. Note that the generalized framework keeps and updates $K$ global models simultaneously, which includes the existing methods as a special case when $K = 1$ . In every training round, each local trainer will distribute one of the global models to a subset of clients, perform local training, and aggregate the trained client models into a updated global model. Then, the ensemble trainer will aggregate the trained client models and/or the updated global models into an ensemble model. Finally, the global trainer will compress the knowledge of the ensemble and further enhance the global models.
|
| 46 |
+
|
| 47 |
+
Many existing algorithms can be viewed as a special case of the generalized framework. For example, by utilizing FedAvg (McMahan et al., 2017) as the local trainer, combining all client models as the ensemble, and implementing the conventional knowledge distillation (Hinton et al., 2015), FedDF (Lin et al., 2020) can be realized. By applying multiple local trainers, each of which maintains a global model with different architectures or hyper-parameters, the heterogeneous learning setting (Huang et al., 2022) can be implemented.
|
| 48 |
+
|
| 49 |
+
By generalizing existing algorithms, the framework makes the design and implementation of FL systems easier, where different components can be updated according to different design objectives. Furthermore, knowledge distillation (Hinton et al., 2015) is still an active research topic, and the generalized framework allows easier integration of different distillation methods into FL. In the following, we introduce the components of the generalized framework, i.e. the local trainers, the ensemble trainer and the global trainer. The overall workflow of the framework is illustrated in Algo. 1 and Fig. 1a.
|
| 50 |
+
|
| 51 |
+
# 3.1 LOCAL TRAINER
|
| 52 |
+
|
| 53 |
+
In each communication round, all available clients will be partitioned into $K$ groups, where each group of clients will be handled by one local trainer. For example, in the $t$ -th round, the task of the $k$ -th local trainer is to update the $k$ -th global model by performing local training and model aggregation over the $k \mathrm { . }$ -th group of clients. In particular, the local trainer first distributes the weight of the global model in the previous round, i.e., $w _ { t - 1 , k } ^ { g * }$ , to its clients to initialize the client model weights $w _ { t , k , 0 } ^ { l } , . . . , w _ { t , k , N _ { t , k } - 1 } ^ { l }$ , where $w _ { t , k , n } ^ { l }$ denotes the local model of the $n$ -th client in the group with $0 < = n < N _ { t , k }$ , $N _ { t , k }$ denotes the number of clients associated with the $k$ -th local trainer in the $t$ -th round. Then, the local trainer performs training on the client-side with the clients’ private dataset, and updates the model of the n-th client as wl∗t,k,n. Lastly, the local trainer collects and aggregates model weights from its clients to the new global model $w _ { t , k } ^ { g }$ . Note that different local trainers can be associated with models with different architectures, which allows the framework to learn heterogeneous models. In this paper, we only consider the scheme which we randomly and evenly map the clients to the local trainers in each training round, such that there are $\frac { C } { K }$ clients per group, where is the number of active clients.
|
| 54 |
+
|
| 55 |
+
Many existing FL algorithms can be directly utilized as a local trainer, e.g. FedAvg (McMahan et al., 2017), and each local trainer can be a different learning algorithm. Moreover, learning algorithms with local regularization can be used in-place to tackle the Non-IID issue, e.g. FedProx (Li et al., 2020) and SCCAFOLD (Karimireddy et al., 2020). In this work, we consider three options for the local trainer, including FedAvg, FedProx and SCCAFOLD. We expect the local trainer to have relatively simple relation with the higher level trainers, such that faster local training can speed up the training of the ensemble and hence, the global model. We will evaluate the compatibility of these trainers with different higher level trainers.
|
| 56 |
+
|
| 57 |
+
# 3.2 ENSEMBLE TRAINER
|
| 58 |
+
|
| 59 |
+
After updating the global models by the local trainers, the ensemble trainer constructs the ensemble teacher model (Hinton et al., 2015) with weight $\boldsymbol { w } _ { t } ^ { e }$ by the the client models and/or global models obtained by the local trainers. The ensemble trainer may also fine-tune the ensemble weight to $w _ { t } ^ { e * }$ with a server dataset. Composed by multiple models, the ensemble typically has better performance than the individual models. It can serve as the teacher model for knowledge distillation in the later stage, and also be directly utilized for inference on the server or some high power devices.
|
| 60 |
+
|
| 61 |
+
There are multiple ways to build an ensemble. For example, FedDF (Lin et al., 2020) utilized all client models in a round to construct the ensemble; FedBE (Chen & Chao, 2021) sampled new models from the distribution built from client models and utilized both the sampled models and client models to construct the ensemble for a higher capacity. Unlike the above works which utilized knowledge distillation to compress a single and compact model, Fed-ensemble (Shi et al., 2021) learned multiple global models and utilized them to build the ensemble for inference.
|
| 62 |
+
|
| 63 |
+
# 3.3 GLOBAL TRAINER
|
| 64 |
+
|
| 65 |
+
At the last stage of each communication round, the ensemble obtained from the ensemble trainer is utilized as the teacher model for knowledge distillation to enhance the global models. We update the weights of the global models from $w _ { t , 0 } ^ { g } , \bar { . . . } , w _ { t , K - 1 } ^ { g }$ to $w _ { t , 0 } ^ { g * } , . . . , w _ { t , K - 1 } ^ { g * }$ , by mimicking the ensemble teacher’s outputs with some sample inputs. For example, we can minimize the KL-divergence to enhance the global models for a classification task (Hinton et al., 2015). Existing works have shown that distillation can be utilized to perform model aggregation in FL. For instances, FedDF (Lin et al., 2020) utilized a basic knowledge distillation scheme in each round of training. On the other hand, FedBE (Chen & Chao, 2021) applied SWA (Izmailov et al., 2018) to prevent the global model from being over-fitted with the noisy teacher output.
|
| 66 |
+
|
| 67 |
+
# 4 EXPERIMENTS: THE GENERALIZED FRAMEWORK
|
| 68 |
+
|
| 69 |
+
In this section, we study the effect of the ensemble trainer and the global trainer.
|
| 70 |
+
|
| 71 |
+
# 4.1 EXPERIMENTS: ENSEMBLE TRAINER
|
| 72 |
+
|
| 73 |
+
There are three critical issues in constructing the ensemble trainers, namely privacy, scalability, and model diversity. Existing distillation-based aggregation methods (Lin et al., 2020; Zhang et al., 2022; Huang et al., 2022; Cho et al., 2022) require all client models to build the ensemble, which cause privacy concerns since the models can leak client’s information. See section A.6 in the appendix for more details. Furthermore, their scalability is limited, because the cost of inference with the ensemble is proportional to the number of compositing models and the server may not be able to efficiently perform the training if the number client models is too large. Existing methods didn’t address this issue or assume that the computation cost to the server is insignificant comparing to the communication time Chen & Chao (2021). With FedDF (Lin et al., 2020) and FedBE (Chen & Chao, 2021), the diversity between the models in the ensemble is determined by the local training of a single round and may be limited, reducing the capacity of the ensemble.
|
| 74 |
+
|
| 75 |
+
Fed-ensemble (Shi et al., 2021) trains multiple global models and builds the ensemble from these global models for inference. The ensemble does not scale with the number of clients, but scales with the number of global models $K$ , which is a hyper-parameter. Moreover, the diversity of the models constructing the ensemble is maintained across the whole training, because different global models experience different training sequences. The idea can be utilized to build the ensemble for distillation purposes, which allows for different ensemble complexity, determined by the number of global models $K$ . However, increasing the capacity of the ensemble by increasing $K$ will also reduce the number of clients per global model, and thus slows down the convergence. We thus propose to utilize the last $R$ checkpoints of each of the global models to build the ensemble, which increases the capacity of the ensemble without slowing down the training of the individual global models.
|
| 76 |
+
|
| 77 |
+
In this paper, we consider five ways to build the ensemble:
|
| 78 |
+
|
| 79 |
+
1) Vanilla Ensemble. Similar to FedDF (Lin et al., 2020), we utilize all client models to build the ensemble and only train one global model (i.e. $K = 1$ ). For an input $x$ , we denote the ensemble function by that are $F$ , where eighted $F ( x | w _ { 0 } , . . . , w _ { N - 1 } )$ is the class probabilite compute the output s wby orks. $w _ { 0 } , . . . , w _ { N - 1 }$ $y$ $y = F ( \bar { x _ { \vert } } w _ { t , 0 , 0 } ^ { l * } , . . . , w _ { t , 0 , N _ { 0 } - 1 } ^ { l * } )$
|
| 80 |
+
|
| 81 |
+
2) Bayesian Ensemble. Following FedBE (Chen & Chao, 2021), we train a global model and build ensemble by combining the client models, the averaged model, and $M$ sampled models $w _ { t , m } ^ { s }$ with $0 < = m < M$ , either from the Gaussian distribution or the Dirichlet distribution. The ensemble can be expressed as $y = F ( x | w _ { t , 0 , 0 } ^ { l * } , . . . , w _ { t , 0 , N _ { 0 } - 1 } ^ { l * } , w _ { t , 0 } ^ { g } , w _ { t , 0 } ^ { s } , . . . , w _ { t , M - 1 } ^ { s } )$ .
|
| 82 |
+
|
| 83 |
+
3) Ensemble from multiple global models. Like Fed-ensemble (Shi et al., 2021), we train $K$ global models, each with different initialization seeds and local training sequences, and combine them into an ensemble with $y = F ( x | w _ { t , 0 } ^ { g } , . . . , w _ { t , K - 1 } ^ { g } )$ .
|
| 84 |
+
|
| 85 |
+
4) Ensemble from client models, which are initialized from different global models (Lin et al., 2020; Shi et al., 2021). This scheme is similar to 3), except that we utilize the client models to build the ensemble with $y = F ( x | w _ { t , 0 } ^ { l * } , . . . , w _ { t , K - 1 , { N _ { K - 1 } - 1 } } ^ { l * } )$ .
|
| 86 |
+
|
| 87 |
+
Table 1: CIFAR10 results of the generalized framework with different ensemble trainers.
|
| 88 |
+
|
| 89 |
+
<table><tr><td></td><td></td><td colspan="2">CIFAR10</td></tr><tr><td>Model</td><td>Method</td><td>α=1.0</td><td>α=0.1</td></tr><tr><td>ResNet20</td><td>Global model(K = 1)</td><td>88.53±0.31</td><td>78.72 ± 2.31</td></tr><tr><td></td><td>Ensemble(K =1,Clients)</td><td>88.82±0.21</td><td>80.22±0.88</td></tr><tr><td></td><td>Ensemble (K=1,Clients,Weighted)</td><td>88.79±0.16</td><td>80.11 ± 0.95</td></tr><tr><td></td><td>Ensemble (K =1,Bayesian,Gaussian)</td><td>88.72±0.14</td><td>79.60 ±1.26</td></tr><tr><td></td><td>Ensemble (K =1,Bayesian,Dirichlet)</td><td>88.70±0.11</td><td>80.25 ±1.43</td></tr><tr><td></td><td>Global model(K = 4)</td><td>86.69±0.54</td><td>70.74 ± 5.11</td></tr><tr><td></td><td>Ensemble (K=4,Aggregated)</td><td>90.58 ± 0.31</td><td>81.76 ± 2.40</td></tr><tr><td></td><td>Ensemble (K= 4,Clients)</td><td>90.49 ± 0.17</td><td>82.12 ±1.65</td></tr><tr><td></td><td>Ensemble(K=4,R=2,Aggregated)</td><td>90.75 ±0.24</td><td>83.50 ±1.56</td></tr><tr><td></td><td>Ensemble(K=4,R=4,Aggregated)</td><td>90.69±0.19</td><td>83.99±0.88</td></tr></table>
|
| 90 |
+
|
| 91 |
+
5) Ensemble from multiple aggregated global models in multiple rounds. In addition to scheme 3), we use the global models from the last $R$ checkpoints to build the ensemble with $y =$ $F ( x | w _ { t , 0 } ^ { g } , . . . , w _ { t , K - 1 } ^ { g } , . . . , w _ { t - R + 1 , 0 } ^ { g } , . . . , w _ { t - R + 1 , K - 1 } ^ { g } )$ .
|
| 92 |
+
|
| 93 |
+
We compare the performance of the above ensemble strategies on CIFAR10 dataset with Non-IID settings. We performed two runs, where we trained one $K = 1$ ) and four $K = 4 ,$ ) global models with the generalized framework, respectively. We used FedAvg (McMahan et al., 2017) as the local trainer, and to better illustrate the effect of the ensemble trainer, we skipped the global trainer, i.e. we did not perform distillation. For the run with $K = 1$ , we built 1) vanilla ensembles, including a variant which is weighted by the number of training samples held by the client, and 2) Bayesian ensembles (both Gaussian and Dirichlet). We also performed similar evaluation for the runs with $K = 4$ , where we built 3) ensembles from global models of one round (i.e. $R = 1$ ), 4) ensembles form client models, and 5) ensembles from multiple checkpoints of the global models (with $R = 2$ or $R = 4$ ). For the details of the experiment setting, see Sec. 6.
|
| 94 |
+
|
| 95 |
+
The results are shown in Table 1, and also Fig. 2 in the appendix. With low degree of Non-IID $\alpha =$ 1.0), despite slowing down the convergence of the individual global model, increasing the number of global models provides the best results. All ensembles with $K = 4$ perform closely, where the ensembles built by global models from multiple checkpoints provide slightly higher accuracy. With $K = 1$ , all methods do not show clear performance advantage over the global model, which agrees with our understanding about the diversity among the compositing models.
|
| 96 |
+
|
| 97 |
+
With highly Non-IID data, all ensemble strategies showed significant improvement over the global model with $K = 1$ . However, with only global models of a single round, the ensemble with $K = 4$ outperformed the strategies with $K = 1$ , which requires access to the client models. By increasing $R$ from 1 to 2 or 4, we observed substantial performance improvements by the ensemble with $K = 4$ , outperforming all methods with $K = 1$ by a large margin. Moreover, with $K = 4$ and $R = 1$ , the ensembles built from global models and client models perform closely. It indicates that accessing client models is not necessary to build a high performance ensemble.
|
| 98 |
+
|
| 99 |
+
In the experiment, ensembles built by following option 5) achieved the best performance, with better privacy protection and higher scalability. Thus, we consider option 5) the candidate ensemble trainer.
|
| 100 |
+
|
| 101 |
+
# 4.2 EXPERIMENTS: GLOBAL TRAINER
|
| 102 |
+
|
| 103 |
+
In Sec. 4.1, it was shown that the best performance can be achieved by learning multiple global models and using multiple check-points of these models. However, if we are interested in a single and compact model for inference, we need to compress the ensemble into a global model. In the cases with multiple global models in the generalized framework, there is no clear rule for distillation, and we consider multiple distillation schemes here.
|
| 104 |
+
|
| 105 |
+
Firstly, we consider a basic knowledge distillation scheme, i.e. we utilize the ensemble as the teacher and all global models are trained by mimicking the output of the ensemble. Note that we fix the weight of the ensemble during the distillation process. This is similar to the heterogeneous version of FedDF (Lin et al., 2020), where all global models will be improved by knowledge distillation.
|
| 106 |
+
|
| 107 |
+
Table 2: CIFAR10 results of the generalized framework with different global trainers.
|
| 108 |
+
|
| 109 |
+
<table><tr><td></td><td></td><td colspan="2">CIFAR10</td></tr><tr><td>Model</td><td>Method</td><td>α=1.0</td><td>α=0.1</td></tr><tr><td>ResNet20</td><td>w/o distillation</td><td>86.69 ± 0.54</td><td>70.74 ± 5.11</td></tr><tr><td></td><td>Basic distillation</td><td>88.63±0.34</td><td>79.98 ± 2.42</td></tr><tr><td></td><td>Basic distillation w/ warm-up (20 rounds)</td><td>88.66±0.22</td><td>80.20 ±1.81</td></tr><tr><td></td><td>Basic distillation w/ warm-up (40 rounds)</td><td>88.47 ±0.04</td><td>79.27 ± 2.14</td></tr><tr><td></td><td>Designated distillation</td><td>89.06 ±0.19</td><td>80.18 ±2.38</td></tr><tr><td>ResNet20 (Ensemble)</td><td>w/o distillation</td><td>90.58±0.31</td><td>81.76 ± 2.40</td></tr><tr><td></td><td>Basic distillation</td><td>89.23±0.36</td><td>80.57 ± 2.24</td></tr><tr><td></td><td>Basic distillation w/ warm-up (20 rounds)</td><td>89.38±0.42</td><td>80.80 ±1.95</td></tr><tr><td></td><td>Basic distillation w/ warm-up (4O rounds)</td><td>89.19 ±0.24</td><td>80.32±2.55</td></tr><tr><td></td><td>Designated distillation</td><td>90.31±0.20</td><td>81.39 ± 2.54</td></tr></table>
|
| 110 |
+
|
| 111 |
+
Table 3: Comparison between methods. The ratios are relative to FedAvg.
|
| 112 |
+
|
| 113 |
+
<table><tr><td>Method</td><td>Communication cost</td><td>Ensemble size</td><td>No access to client models</td><td>Parallelism for server training</td></tr><tr><td>FedAvg</td><td>1.0x</td><td>=</td><td>、</td><td>=</td></tr><tr><td>FedProx</td><td>1.5x</td><td></td><td></td><td></td></tr><tr><td>SCAFFOLD</td><td>1.5x</td><td>=</td><td>√</td><td>=</td></tr><tr><td>FedDF</td><td>1.0x</td><td>C</td><td>X</td><td>X</td></tr><tr><td>FedBE</td><td>1.0x</td><td>C+S+1</td><td>X</td><td>X</td></tr><tr><td>FedEED (w/FedAvg)</td><td>1.0x</td><td>KR</td><td>√</td><td>√</td></tr></table>
|
| 114 |
+
|
| 115 |
+
K: Number of global models R: Number of rounds of time ensemble C: Number of active clients S: Number of sampled models
|
| 116 |
+
|
| 117 |
+
One possible drawback of the basic scheme is that it may reduce the diversity among the global models and thus hurts the performance of the ensemble, since the global models are forced to produce similar outputs. Thus, we consider another scheme following Codistillation (Anil et al., 2018), where we skip the distillation in the early rounds of training, such that the models will not learn from each other at the beginning to maintain potentially higher diversity.
|
| 118 |
+
|
| 119 |
+
Lastly, we consider an asymmetric scheme, where only one designated global model will serve as the student and be enhanced by the global trainer. Although there is only one global model being enhanced by distillation in each round of training, the scheme can fit most of the scenarios where only one global model is required for inference, and reduce the cost of distillation. We note that prior work in knowledge distillation (Chen et al., 2020) has applied a similar scheme where a model is chosen to be the main student during distillation, but they did not completely remove the update of the other student models. Compare to their scheme, the all-to-one scheme here is simpler and able to reduce the computation complexity.
|
| 120 |
+
|
| 121 |
+
In the experiments, we compared the performance of different distillation settings discussed above, including: 1) Simple distillation, where we treat all global model as the student model; 2) Simple distillation with warm-up rounds, which skips the distillation in the early rounds of training; 3) Designated distillation, where we only transfer the knowledge from the ensemble to one designated global model. We use 20 and 40 warm-up rounds for 2).
|
| 122 |
+
|
| 123 |
+
Results in Table 2 show that, the global model trained by the designated scheme outperformed its counterparts with low degree of Non-IID, and performed as to the others with high degree of NonIID. On the other hand, the ensembles trained by the designated scheme obtained the best results in all the cases, which is close to the ensemble without distillation. The performance of other ensembles by distillation is much worse than that without distillation. These results support our expectation that asymmetric scheme can help keep the model diversity, and thus improve the performance of both the ensemble and the distilled global model.
|
| 124 |
+
|
| 125 |
+
# 5 FEDEED
|
| 126 |
+
|
| 127 |
+
In the Sec 4, we showed that two simple schemes: 1) building ensemble from the aggregated global models and 2) designated distillation from the ensemble to the one global model, lead to a competitive instance of the generalized framework, with improved privacy and scalability. We refer the above instance as Federated Efficient Ensemble Distillation (FedEED) and the diagrams of the ensemble trainer and global trainer are shown in Fig. 1b. FedEED tackled two limitations of the existing distillation-based aggregation methods by utilizing multiple aggregated global models to build the ensemble. Firstly, FedEED does not require direct access to the client models or the model outputs, which is compatible to the mechanism that ensures the users privacy, including secure aggregation (Bonawitz et al., 2017). Secondly, the number of global models is a hyper-parameter, which makes FedEED applicable to large scale FL system with potentially thousands of clients, representing an improved scalability.
|
| 128 |
+
|
| 129 |
+
Another key advantage of FedEED is the designated distillation scheme. In FedEED, the knowledge of the ensemble will only be transferred to one picked global model with weights $w _ { t , 0 } ^ { g * }$ , such that the diversity between wg∗t,1, ..., $w _ { t , 1 } ^ { g * } , . . . , w _ { t , K - 1 } ^ { g * }$ won’t be lost after multiple rounds of training. During inference, either the main global model or the ensemble model can be utilized, depending on the device capacity. Besides maintaining the diversity between the models in the ensemble, the designated scheme also allows for computation of $w _ { t , 0 } ^ { g * }$ lelism between, other weights $w _ { t , 1 } ^ { g * } , . . . , w _ { t , K - 1 } ^ { g * }$ erver-side computation. In particular, during theare ready to be distributed to the clients for the $t + 1$ -th round of training, because they will not be enhanced by distillation. This can improve the system throughput by a large factor, especially if the server side training time is not negligible and the clients are not always available. An example of the training pipeline is shown in section A.7 in the appendix.
|
| 130 |
+
|
| 131 |
+
In summary, the key idea of FedEED is to ensure privacy and scalability, and maintain the diversity between models throughout the whole training process. See Table. 3 for the comparison between FedEED and other methods (McMahan et al., 2017; Li et al., 2020; Karimireddy et al., 2020; Lin et al., 2020; Chen & Chao, 2021).
|
| 132 |
+
|
| 133 |
+
# 6 EXPERIMENTS: FEDEED
|
| 134 |
+
|
| 135 |
+
# 6.1 IMAGE CLASSIFICATION WITH CIFAR10/100.
|
| 136 |
+
|
| 137 |
+
Table 4: CIFAR10/100 results.
|
| 138 |
+
|
| 139 |
+
<table><tr><td></td><td></td><td colspan="2">CIFAR10</td><td colspan="2">CIFAR100</td></tr><tr><td>Model</td><td>Method</td><td>α= 1.0</td><td>α=0.1</td><td>α= 1.0</td><td>α=0.1</td></tr><tr><td>ResNet20</td><td>FedAvg</td><td>88.53 ± 0.31</td><td>78.72 ± 2.31</td><td>58.84±0.42</td><td>52.98 ±1.41</td></tr><tr><td></td><td>FedProx</td><td>88.36 ±0.18</td><td>79.44 ± 2.17</td><td>58.76 ±0.93</td><td>53.57 ± 0.37</td></tr><tr><td></td><td>SCAFFOLD</td><td>89.85±0.50</td><td>80.08 ±1.53</td><td>61.09 ± 0.46</td><td>54.74 ± 1.26</td></tr><tr><td></td><td>FedDF</td><td>87.98 ± 0.16</td><td>80.04 ±1.87</td><td>59.74±0.38</td><td>51.83 ± 0.83</td></tr><tr><td></td><td>FedEED</td><td>89.06 ±0.19</td><td>80.18 ±2.38</td><td>61.90 ±0.83</td><td>54.72 ± 0.87</td></tr><tr><td></td><td>FedEED(R= 2)</td><td>89.01 ±0.18</td><td>81.27 ± 2.16</td><td>62.42 ±0.57</td><td>56.39 ±1.10</td></tr><tr><td></td><td>FedEED (R= 4)</td><td>89.01±0.07</td><td>82.21 ± 1.10</td><td>62.84± 0.45</td><td>56.90± 0.77</td></tr><tr><td>ResNet56</td><td>FedAvg</td><td>89.25 ± 0.11</td><td>80.05 ± 2.65</td><td>59.47 ±1.23</td><td>54.37 ± 1.24</td></tr><tr><td></td><td>FedProx</td><td>89.65 ±0.23</td><td>80.84±1.32</td><td>61.01 ± 1.02</td><td>57.18 ± 0.92</td></tr><tr><td></td><td>SCAFFOLD</td><td>90.73±0.27</td><td>82.22 ±0.92</td><td>62.94 ± 0.91</td><td>56.36 ±0.31</td></tr><tr><td></td><td>FedDF</td><td>88.87±0.29</td><td>81.10 ± 2.31</td><td>60.71 ±0.68</td><td>52.52 ±1.37</td></tr><tr><td></td><td>FedEED</td><td>89.86 ±0.14</td><td>81.30 ± 2.17</td><td>62.95 ± 2.43</td><td>57.48 ± 2.03</td></tr><tr><td></td><td>FedEED(R= 2)</td><td>90.23±0.23</td><td>82.77 ±1.67</td><td>65.28 ±0.64</td><td>59.37 ± 0.64</td></tr><tr><td></td><td>FedEED (R= 4)</td><td>90.00 ±0.26</td><td>83.20 ±0.99</td><td>65.63±0.89</td><td>59.56 ± 0.43</td></tr><tr><td>WRN16-2</td><td>FedAvg</td><td>90.26 ±0.33</td><td>81.52 ± 2.66</td><td>63.57 ±1.06</td><td>58.77 ± 0.55</td></tr><tr><td></td><td>FedProx</td><td>90.38 ±0.29</td><td>81.78± 2.58</td><td>63.75±0.84</td><td>59.24 ±1.00</td></tr><tr><td></td><td>SCAFFOLD</td><td>91.32 ± 0.11</td><td>82.90 ±2.19</td><td>65.33 ±0.48</td><td>60.66 ±0.85</td></tr><tr><td></td><td>FedDF</td><td>89.52±0.10</td><td>81.32 ± 2.91</td><td>63.54 ± 0.53</td><td>56.89 ±1.28</td></tr><tr><td></td><td>FedEED</td><td>90.69 ±0.41</td><td>82.62 ±2.46</td><td>66.46±0.30</td><td>61.16 ± 1.20</td></tr><tr><td></td><td>FedEED (R= 2)</td><td>90.77 ±0.16</td><td>83.39 ±2.17</td><td>67.11 ± 0.41</td><td>62.37 ±0.84</td></tr><tr><td></td><td>FedEED (R= 4)</td><td>90.70 ±0.31</td><td>84.02 ±1.75</td><td>67.48 ±0.22</td><td>63.05±0.80</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Our experiments of image classification task followed Lin et al. (2020). We trained the models on CIFAR10/100 dataset (Krizhevsky et al., 2009), and utilized CIFAR100 and ImageNet (resized to $3 2 \times 3 2$ ) (Deng et al., 2009) as the unlabelled datasets for the CIFAR10/100 experiments, respectively. There are 100 rounds of training with 20 clients, where $40 \%$ of them are active in each round. We sampled data for each of the clients with the Dirichlet distribution (Hsu et al., 2019), with $\alpha = \{ 1 . 0 , 0 . 1 \}$ for different levels of data heterogeneity. For each setting, we reported the average top-1 accuracy of three runs with different seeds, where the seeds are shared across different methods to generate the same data partition and sequence of client’s for a fair comparison. We trained
|
| 142 |
+
|
| 143 |
+
Table 5: CIFAR10 results of FedEED with different local trainers.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td>Method</td><td colspan="2">CIFAR10 (8 clients per round)</td><td colspan="2">CIFAR10 (20 clients per round)</td></tr><tr><td></td><td></td><td>α=1.0</td><td>α=0.1</td><td>α=1.0</td><td>α=0.1</td></tr><tr><td>ResNet20</td><td>FedAvg</td><td>88.53 ±0.31</td><td>78.72 ± 2.31</td><td>88.59 ±0.28</td><td>79.84 ± 1.50</td></tr><tr><td></td><td>FedProx</td><td>88.36±0.18</td><td>79.44 ± 2.17</td><td>88.52±0.07</td><td>79.63 ± 2.48</td></tr><tr><td></td><td>SCAFFOLD</td><td>89.85 ± 0.50</td><td>80.08 ±1.53</td><td>90.10±0.07</td><td>82.83±2.40</td></tr><tr><td></td><td>FedEED w/FedAvg</td><td>89.06 ±0.19</td><td>80.18 ±2.38</td><td>89.04 ± 0.11</td><td>82.89 ± 1.30</td></tr><tr><td></td><td>FedEED w/FedProx</td><td>88.98±0.22</td><td>81.21 ± 1.30</td><td>89.28 ±0.17</td><td>82.12 ± 2.26</td></tr><tr><td></td><td>FedEED w/SCAFFOLD</td><td>88.80±0.16</td><td>76.51 ± 3.74</td><td>90.66 ±0.04</td><td>84.30 ±1.88</td></tr></table>
|
| 146 |
+
|
| 147 |
+
ResNet20/56 (He et al., 2016) and WRN16-2 (Zagoruyko & Komodakis, 2016), which are proven capable to achieve high accuracy on CIFAR10/100. For the optimizer, we used SGD with learning rate of 0.8 and 0.1 and batch size of 64 and 256, for the client-side and the server-side training, respectively. We did not apply weight decay or learning rate scheduling in our experiments.
|
| 148 |
+
|
| 149 |
+
We compared FedEED with FedAvg (McMahan et al., 2017), FedProx(Li et al., 2020), SCAFFOLD(Karimireddy et al., 2020) and FedDF(Lin et al., 2020). We set the number of local training epoch to be 40, and the regularizer parameter $\mu$ of FedProx to be 0.001. For FedEED, we set the number of global models $K$ to be 4 and used one round of models to build the ensemble, i.e., $R = 1$ , unless otherwise specified. For both FedDF and FedEED, we performed distillation with 5000 steps in each training round, with the temperature $\tau$ to be 4.
|
| 150 |
+
|
| 151 |
+
The results are shown in Table 4. It can be observed that FedEED outperformed all other methods on the harder dataset, CIFAR100, and all settings with high degree of Non-IID. It suggests that FedEED is a good candidate for tackling the Non-IID issue. We also found that the value of $R$ does not affect the performance of FedEED significantly in the CIFAR10 experiments with low degree of Non-IID, but a higher value of $R$ improved the performance of FedEED significantly in the CIFAR10 runs with high degree of Non-IID, and on CIFAR100 datasets with both high and low degree of Non-IID.
|
| 152 |
+
|
| 153 |
+
# 6.2 COMPATIBILITY OF FEDEED WITH DIFFERENT LOCAL TRAINERS
|
| 154 |
+
|
| 155 |
+
To evaluate the compatibility of FedEED with different local trainers, we performed experiments by combining FedEED with FedAvg (McMahan et al., 2017) (default option in this paper), FedProx (Li et al., 2020), SCAFFOLD (Karimireddy et al., 2020). The results in Table 5 show that FedEED is compatible with FedProx and the combination achieves better performance with high degree of Non-IID. However, the combination of FedEED and SCAFFOLD did not improve the performance. We expect this is due to the fact that the number of clients per global model is only 2 in FedEED which is too small for SCAFFOLD. We thus performed additional experiments by increasing the ratio of active clients from 0.4 to 1.0, which increases the clients per global model to 5. In these experiments, the combination of FedEED and SCCAFOLD achieved much higher accuracy than the stand-alone FedEED and SCCAFFOLD.
|
| 156 |
+
|
| 157 |
+
# 6.3 ABLATION STUDY
|
| 158 |
+
|
| 159 |
+
Ablation study will be provided in the appendix.
|
| 160 |
+
|
| 161 |
+
# 7 CONCLUSION
|
| 162 |
+
|
| 163 |
+
In this paper, we studied the key components of distillation-based model aggregation in federated learning. By generalizing the existing methods to a universal framework, we investigated the contribution of different components. It was shown that constructing the ensemble teacher by aggregated models improves the privacy and scalability of the distillation-based federated learning system. Furthermore, the designated distillation, which transfers the knowledge of the ensemble to one global model, helps maintain the diversity among different models used to build the ensemble. Based on these observations, we propose a novel, efficient ensemble distillation method called FedEED, whose performance advantage over existing methods was validated by extensive experiments over the benchmark datasets. The proposed FedEED scheme provides an efficient and scalable way for model aggregation in large-scale learning systems, with improved privacy protection.
|
| 164 |
+
|
| 165 |
+
# REFERENCES
|
| 166 |
+
|
| 167 |
+
Rohan Anil, Gabriel Pereyra, Alexandre Passos, Robert Ormandi, George E Dahl, and Geoffrey E Hinton. Large scale distributed neural network training through online distillation. arXiv preprint arXiv:1804.03235, 2018.
|
| 168 |
+
|
| 169 |
+
Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for privacypreserving machine learning. In proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 1175–1191, 2017.
|
| 170 |
+
|
| 171 |
+
Defang Chen, Jian-Ping Mei, Can Wang, Yan Feng, and Chun Chen. Online knowledge distillation with diverse peers. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 3430–3437, 2020.
|
| 172 |
+
|
| 173 |
+
Hong-You Chen and Wei-Lun Chao. Fedbe: Making bayesian model ensemble applicable to federated learning. In ICLR, 2021.
|
| 174 |
+
|
| 175 |
+
Yae Jee Cho, Andre Manoel, Gauri Joshi, Robert Sim, and Dimitrios Dimitriadis. Heterogeneous ensemble knowledge transfer for training large models in federated learning. arXiv preprint arXiv:2204.12703, 2022.
|
| 176 |
+
|
| 177 |
+
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.
|
| 178 |
+
|
| 179 |
+
Xuan Gong, Abhishek Sharma, Srikrishna Karanam, Ziyan Wu, Terrence Chen, David Doermann, and Arun Innanje. Ensemble attention distillation for privacy-preserving federated learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 15076–15086, 2021.
|
| 180 |
+
|
| 181 |
+
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.
|
| 182 |
+
|
| 183 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015. URL http://arxiv. org/abs/1503.02531.
|
| 184 |
+
|
| 185 |
+
Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019.
|
| 186 |
+
|
| 187 |
+
Wenke Huang, Mang Ye, and Bo Du. Learn from others and be yourself in heterogeneous federated learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10143–10153, 2022.
|
| 188 |
+
|
| 189 |
+
Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018.
|
| 190 |
+
|
| 191 |
+
Eunjeong Jeong, Seungeun Oh, Hyesung Kim, Jihong Park, Mehdi Bennis, and Seong-Lyun Kim. Communication-efficient on-device machine learning: Federated distillation and augmentation under non-iid private data. arXiv preprint arXiv:1811.11479, 2018.
|
| 192 |
+
|
| 193 |
+
Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning, pp. 5132–5143. PMLR, 2020.
|
| 194 |
+
|
| 195 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 196 |
+
|
| 197 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 198 |
+
|
| 199 |
+
Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. Proceedings of Machine Learning and Systems, 2:429–450, 2020.
|
| 200 |
+
|
| 201 |
+
Tao Lin, Lingjing Kong, Sebastian U Stich, and Martin Jaggi. Ensemble distillation for robust model fusion in federated learning. Advances in Neural Information Processing Systems, 33:2351–2363, 2020.
|
| 202 |
+
|
| 203 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics, pp. 1273–1282. PMLR, 2017.
|
| 204 |
+
|
| 205 |
+
Naichen Shi, Fan Lai, Raed Al Kontar, and Mosharaf Chowdhury. Fed-ensemble: Improving generalization through model ensembling in federated learning. arXiv preprint arXiv:2107.10663, 2021.
|
| 206 |
+
|
| 207 |
+
Jianyu Wang, Zachary Charles, Zheng Xu, Gauri Joshi, H Brendan McMahan, Maruan Al-Shedivat, Galen Andrew, Salman Avestimehr, Katharine Daly, Deepesh Data, et al. A field guide to federated optimization. arXiv preprint arXiv:2107.06917, 2021.
|
| 208 |
+
|
| 209 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 210 |
+
|
| 211 |
+
Lin Zhang, Li Shen, Liang Ding, Dacheng Tao, and Ling-Yu Duan. Fine-tuning global model via data-free knowledge distillation for non-iid federated learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10174–10183, 2022.
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 2: Comparison between different ensemble strategies with CIFAR-10. Note that we applied smoothing to the curves to improve the visibility.
|
| 215 |
+
|
| 216 |
+
# A APPENDIX
|
| 217 |
+
|
| 218 |
+
# A.1 ADDITIONAL FIGURES FOR COMPARING DIFFERENT ENSEMBLE STRATEGIES
|
| 219 |
+
|
| 220 |
+
In this section, we provide the plots of the experiment in section 4.1, as shown in Fig. 2. The settings with 4 global models (i.e. $K = 4$ ) consistently outperform the others, where the scheme utilizing global models as an ensemble performs closely as that utilizing client models. Utilizing multiple checkpoints of global models as the ensemble obtained the best result in the experiment.
|
| 221 |
+
|
| 222 |
+
# A.2 FEDEED WITH DIFFERENT COMMUNICATION INTERVALS
|
| 223 |
+
|
| 224 |
+
Table 6: CIFAR10 results with different communication intervals
|
| 225 |
+
|
| 226 |
+
<table><tr><td></td><td></td><td></td><td colspan="2">CIFAR10</td></tr><tr><td># rounds /# local epochs</td><td>Model</td><td>Method</td><td>α=1.0</td><td>α=0.1</td></tr><tr><td>25/160</td><td>ResNet20</td><td>FedAvg</td><td>85.81 ±0.12</td><td>73.17 ± 3.66</td></tr><tr><td></td><td></td><td>FedDF</td><td>86.78±0.12</td><td>77.79 ±1.73</td></tr><tr><td></td><td></td><td>FedEED</td><td>86.27±0.68</td><td>73.99± 2.15</td></tr><tr><td>100/40</td><td>ResNet20</td><td>FedAvg</td><td>88.53 ± 0.31</td><td>78.72 ± 2.37</td></tr><tr><td></td><td></td><td>FedDF</td><td>87.98 ± 0.16</td><td>80.04 ± 1.87</td></tr><tr><td></td><td></td><td>FedEED</td><td>89.06±0.19</td><td>80.18± 2.38</td></tr><tr><td>400/10</td><td>ResNet20</td><td>FedAvg</td><td>89.69±0.27</td><td>79.19 ± 0.42</td></tr><tr><td></td><td></td><td>FedDF</td><td>88.90 ±0.19</td><td>78.92 ±0.59</td></tr><tr><td></td><td></td><td>FedEED</td><td>90.37±0.08</td><td>81.34± 0.81</td></tr></table>
|
| 227 |
+
|
| 228 |
+
We compared the performance of FedEED with FedAvg (McMahan et al., 2017) and FedDF (Lin et al., 2020), with difference communication intervals. We fixed the total amount of computation, where we set the number of rounds and the number of local epochs to be 25/100/400 and 160/40/10, respectively. We also scaled the number of distillation steps to 20000/5000/1250. From Table 6, we can observe that FedEED always performed better than FedAvg. But with 25 communication rounds, FedDF outperformed FedEED. We expect this is due to the extremely small number of clients per global models in FedEED, i.e. there are only two clients per global models, which slowed down the convergence in the case with extreme high communication intervals.
|
| 229 |
+
|
| 230 |
+
# A.3 FEDEED WITH DIFFERENT NUMBER OF GLOBAL MODELS
|
| 231 |
+
|
| 232 |
+
In the main paper, we used $K = 4$ as our default options of FedEED. Here, we provide results with $K = 2$ to $K = 4$ . Note that there are only 8 clients per round in the default configuration, and with $K = 4$ there are only two clients per global model. For $K = 3$ , we allocated one more client to the main global model in FedEED. The results in Table 7 show that $K = 4$ is the best configuration of FedEED in the experiment. However, as we mentioned above, there is a trade-off between the speed of convergence and the performance of the ensemble teacher, so the optimal value of $K$ may vary with the different tasks.
|
| 233 |
+
|
| 234 |
+
Table 7: CIFAR10 results of FedEED with different number of global models.
|
| 235 |
+
|
| 236 |
+
<table><tr><td></td><td></td><td></td><td colspan="2">CIFAR10</td></tr><tr><td>Model</td><td>Method</td><td>K</td><td>α=1.0</td><td>α=0.1</td></tr><tr><td>ResNet20</td><td>FedEED</td><td>2</td><td>88.34± 0.32</td><td>79.38± 2.54</td></tr><tr><td></td><td></td><td>3</td><td>88.89±0.22</td><td>79.63 ± 6.15</td></tr><tr><td></td><td></td><td>4</td><td>89.06± 0.19</td><td>80.18±2.38</td></tr></table>
|
| 237 |
+
|
| 238 |
+
Table 8: CIFAR10 results of FedEED with different scaling schemes.
|
| 239 |
+
|
| 240 |
+
<table><tr><td></td><td></td><td></td><td></td><td colspan="2">CIFAR10</td></tr><tr><td># Clients</td><td>Model</td><td>Method</td><td>K</td><td>α= 1.0</td><td>α=0.1</td></tr><tr><td>8</td><td>ResNet20</td><td>FedAvg</td><td>1</td><td>88.53 ± 0.31</td><td>78.72 ±2.37</td></tr><tr><td></td><td></td><td>FedDF</td><td>1</td><td>87.98 ± 0.16</td><td>80.04 ±1.87</td></tr><tr><td></td><td></td><td>FedEED</td><td>4</td><td>89.06 ±0.19</td><td>80.18 ± 2.38</td></tr><tr><td>14</td><td>ResNet20</td><td>FedAvg</td><td>一</td><td>88.67 ±0.22</td><td>80.25 ± 1.64</td></tr><tr><td></td><td></td><td>FedDF</td><td>二</td><td>88.38 ±0.16</td><td>81.61 ± 1.94</td></tr><tr><td></td><td></td><td>FedEED</td><td>4</td><td>89.14± 0.09</td><td>81.26 ± 1.99</td></tr><tr><td></td><td></td><td></td><td>7</td><td>89.31±0.06</td><td>81.90 ± 1.80</td></tr><tr><td>20</td><td>ResNet20</td><td>FedAvg</td><td></td><td>88.59 ±0.28</td><td>79.84 ± 1.50</td></tr><tr><td></td><td></td><td>FedDF</td><td>一</td><td>88.12 ± 0.25</td><td>81.55 ± 2.02</td></tr><tr><td></td><td></td><td>FedEED</td><td>4</td><td>89.04 ± 0.11</td><td>82.89 ±1.30</td></tr><tr><td></td><td></td><td></td><td>10</td><td>89.14 ± 0.11</td><td>81.97 ± 1.54</td></tr></table>
|
| 241 |
+
|
| 242 |
+
In Table 8, we further provided the results to show how the performance of FedEED scales with the number of clients, and compared it with FedAvg (McMahan et al., 2017) and FedDF (Lin et al., 2020). As the number of clients increases, we consider two options: 1.) scaling the number of clients per global model, i.e. fixing the value of $K$ , 2.) scaling the number of global models, i.e. varying the value of $K$ $K = 7$ and 10 in Table 8). We found that FedEED outperformed FedAvg and FedDF with both scaling schemes, and obtained the best result when scaling with the number of global models, except the case with high Non-IID with 20 clients. However, in practice, the scaling scheme may be subject to the server capacity, as increasing the number will also increase the cost of distillation.
|
| 243 |
+
|
| 244 |
+
# A.4 IMPROVEMENT FROM FEDDF
|
| 245 |
+
|
| 246 |
+
Table 9: The difference between FedDF and FedEED. The method in the last row is identical to the FedEED with $R = 1$ .
|
| 247 |
+
|
| 248 |
+
<table><tr><td></td><td></td><td colspan="2">CIFAR10</td></tr><tr><td>Model</td><td>Method</td><td>α=1.0</td><td>α=0.1</td></tr><tr><td>ResNet20</td><td>FedDF</td><td>82.53±0.24</td><td>68.72 ±4.23</td></tr><tr><td></td><td>+ Improved configuration</td><td>87.93 ±0.47</td><td>79.01 ± 2.15</td></tr><tr><td></td><td>+ Removal of drop-worst & early-stopping</td><td>87.42 ± 0.19</td><td>78.55 ±3.00</td></tr><tr><td colspan="2">+ Aggregated ensemble +K= 4+Designated distillation</td><td>88.35 ±0.18</td><td>79.59± 2.93</td></tr></table>
|
| 249 |
+
|
| 250 |
+
FedEED is similar to FedDF (Lin et al., 2020), because both of them utilize knowledge distillation for model fusion with an unlabelled dataset. In this section, we progressively modify FedDF into FedEED, and show the effect of each of the individual changes. Note that we keep $10 \%$ of the training data from CIFAR10 as the validation set of the server in this experiment, following Lin et al. (2020).
|
| 251 |
+
|
| 252 |
+
The original FedDF utilized Adam optimizer (Kingma & Ba, 2014) for server training, and applied the ‘drop-worst’ mechanism and the early-stopping. We perform the following modification: 1) adapt the configuration from the main paper (including the use of SGD optimizer), 2) remove the use of ‘drop-worst’ and early-stopping, and 3) utilize four aggregated global models to build the ensemble with the designated distillation scheme. By introducing these three modifications, FedDF achieved the same perforamnce as FedEED with $R = 1$ .
|
| 253 |
+
|
| 254 |
+
Table 9 shows the results of different modifications and we have three observations. First, the configuration we used in this paper improved FedDF. Second, the removal of the ‘drop-worst’ and the early-stopping led to a worse result, but it saved the need of a server validation set. Third, the main mechanisms we used in FedEED, i.e. the ensemble from aggregated model and the designated distillation scheme, provided significant performance improvement.
|
| 255 |
+
|
| 256 |
+
# A.5 POSSIBLE EXTENSIONS OF FEDEED
|
| 257 |
+
|
| 258 |
+
To perform distillation, a server dataset or generator is mandatory. In this paper, we consider the use of FedEED with unlabelled server dataset, following Lin et al. (2020); Chen & Chao (2021). Since the dataset is not labelled and can be independent of the client datasets, it is cheap to collect. Note that extending FedEED to labelled dataset or generator is straightforward. We can also extend FedEED to the model heterogeneous setting (Lin et al., 2020; Cho et al., 2022), in which we can pick one global model from each model type as the student models. As long as the number of the picked global models is only a small portion of all models, the diversity among them can be preserved.
|
| 259 |
+
|
| 260 |
+
# A.6 PRIVACY CONCERN OF FEDEED
|
| 261 |
+
|
| 262 |
+
Existing distillation based model aggregation methods utilize client models as the teacher for enhancing a global model. For example, FedDF (Lin et al., 2020) is built upon weight averaging based methods like FedAvg (McMahan et al., 2017).
|
| 263 |
+
|
| 264 |
+
Weight average based methods can benefit from techniques like secure aggregation (Bonawitz et al., 2017), where individual client updates are never disclose to the server and the server can still obtain their weighted sum. However, the above mentioned distillation based methods are not compatible to technique like secure aggregation (Wang et al., 2021). Because the clients are required to send their models or updates to server, and the server will store the individual client models during the process of server-side training, which introduces extra risk as the communication can be intercepted or the server can be attacked.
|
| 265 |
+
|
| 266 |
+
On the other hand, FedEED does not require access to the raw client models since it utilizes multiple aggregated models as the teacher, which is compatible to the techniques like secure aggregation, where the individual client model updates or weights are never disclosed to the server. This reduces the chance of being attacked during communication or server storage, and achieve the same privacy level as weight average based methods. To summarise, FedEED is able to achieve a higher level of privacy protection than existing distillation based methods.
|
| 267 |
+
|
| 268 |
+
# A.7 PARALLEL SERVER-SIDE AND CLIENT-SIDE TRAINING OF FEDEED
|
| 269 |
+
|
| 270 |
+
As mentioned in the main paper, FedEED can introduce parallelism between server-side and clientside training. In this section, we provide an illustration of the training processes for FedEED and other methods (e.g. FedDF (Lin et al., 2020)).
|
| 271 |
+
|
| 272 |
+
The round time in federated learning depends on the clients’ availability. We consider two cases for the clients’ availability: 1.) All active clients in a round are able to start local training immediately; 2.) The clients are not always available for training, where we assume that their availability is roughly uniform. The diagram of two training rounds for case 1.) and 2.) are demonstrated in Fig. 3 and Fig. 4, respectively. In these examples, the training time of the clients and the server is assumed constant. We assume a simplified case where there are only 4 clients. For other methods, there are maps the only one global model being updated in each round, where FedEED trains 4 models and always $i$ -th model to the $i$ -th client. In FedEED, the training of weight $w _ { t , k , n } ^ { l * }$ can be started as soon as all $w _ { t - 1 , k , 0 } ^ { l * } , . . . , w _ { t - 1 , k , n - 1 } ^ { l * }$ are ready and aggregated, for all non-designated models (i.e. $k \neq 0$ ). However, for simplicity we only consider starting the training of $w _ { t , k , 0 } ^ { l * } , . . . , w _ { t , k , n - 1 } ^ { l * }$ after all local weight updates in -round have been completed.
|
| 273 |
+
|
| 274 |
+
In Fig. 3, we demonstrated the parallelism in case 1.). Since FedEED can start some training earlier, the computation of different rounds in FedEED are overlapped, which leads to a longer round time.
|
| 275 |
+
|
| 276 |
+
However, the average run time of FedEED is the same as the others, which can be defined as the total run time of the training divided the total number of rounds, or the time difference between the completion time of two consecutive rounds. In a more realistic setting, where clients are not always available to start the training, i.e., case 2.), FedEED has much shorter average round time due to the high degree of parallelism, as illustrated in Fig. 4. In FedEED, clients can start their training as long as they are available, where in other methods, clients can not start training before the server-side training is completed.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 3: Parallelism comparison between FedEED and other methods, where clients are always available.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 4: Parallelism comparison between FedEED and other methods, where clients are not always available.
|
md/dev/flNZJ2eOet/flNZJ2eOet.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
|
| 2 |
+
|
| 3 |
+
Shivam Garg∗ Dimitris Tsipras∗ Percy Liang Gregory Valiant
|
| 4 |
+
|
| 5 |
+
Stanford University {shivamg, tsipras, pliang, gvaliant}@cs.stanford.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
In-context learning refers to the ability of a model to condition on a prompt sequence consisting of in-context examples (input-output pairs from some task) along with a new query input, and generate the corresponding output. Crucially, in-context learning happens only at inference time without any parameter updates to the model. While large language models such as GPT-3 exhibit some ability to perform in-context learning, it is unclear what the relationship is between tasks on which this succeeds and what is present in the training data. To make progress towards understanding in-context learning, we consider the well-defined problem of training a model to in-context learn a function class (e.g., linear functions): given data derived from some functions in the class, can we train a model to incontext learn “most” functions from this class? We show empirically that standard Transformers can be trained from scratch to perform in-context learning of linear functions—that is, the trained model is able to learn unseen linear functions from in-context examples with performance comparable to the optimal least squares estimator. In fact, in-context learning is possible even under two forms of distribution shift: (i) between the training data of the model and inference-time prompts; (ii) between the in-context examples and the query input during inference. We also show that we can train Transformers to in-context learn more complex function classes— i.e., sparse linear functions, two-layer neural networks, and decision trees—with performance that matches or exceeds task-specific learning algorithms.1
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Large language models such as GPT-3 [10] are able to perform in-context learning: given a prompt containing examples from a task (input-output pairs) and a new query input, the language model can generate the corresponding output. For example, these models are able to produce English translations of French words after being prompted on a few such translations, e.g.:
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
|
| 17 |
+
This capability is quite intriguing as it allows models to adapt to a wide range of downstream tasks on-the-fly—without the need to update the model after training [10, 35, 55, 8]. However, it is unclear to what extent these models are able to learn new tasks from in-context examples alone as opposed to indexing into a vast set of known tasks from the training data (e.g., see Min et al. [41]). 2
|
| 18 |
+
|
| 19 |
+
To make progress towards understanding in-context learning, we consider the well-defined problem of learning a function class from in-context examples. That is, we say that a model can in-context learn a function class $\mathcal { F }$ if, for “most” functions $f \in { \mathcal { F } }$ , the model can approximate $f ( x _ { \mathrm { q u e r y } } )$ for a new query input $x _ { \mathrm { q u e r y } }$ by conditioning on a prompt sequence $( x _ { 1 } , f ( x _ { 1 } ) , \ldots , x _ { k } , f ( x _ { k } ) , { \dot { x } } _ { \mathrm { q u e r y } } )$ containing in-context examples and the query input.
|
| 20 |
+
|
| 21 |
+
Formally, let $D _ { \mathcal { X } }$ be a distribution over inputs and $D _ { \mathcal { F } }$ be a distribution over functions in $\mathcal { F }$ . A prompt $P$ is a sequence $( x _ { 1 } , f ( x _ { 1 } ) , \ldots , x _ { k } , f ( x _ { k } ) , x _ { \mathrm { q u e r y } } )$ where inputs (i.e., $x _ { i }$ and $x _ { \mathrm { q u e r y , } }$ ) are drawn i.i.d. from $D _ { \mathcal { X } }$ and $f$ is drawn from $D _ { \mathcal { F } }$ . We say that a model $M$ can in-context learn the function class $\mathcal { F }$ up to $\epsilon$ , with respect to $( D _ { \mathcal { F } } , D _ { \mathcal { X } } )$ , if it can predict $f ( x _ { \mathrm { q u e r y } } )$ with an average error
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
{ \mathbb E } _ { P } \left[ \ell \left( M \left( P \right) , f \left( x _ { \mathrm { q u e r y } } \right) \right) \right] \leq \epsilon ,
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
where $\ell ( \cdot , \cdot )$ is some appropriate loss function, such as the squared error.
|
| 28 |
+
|
| 29 |
+
Within this framework, we can now concretely ask:
|
| 30 |
+
|
| 31 |
+
Can we train a model to in-context learn a certain function class?
|
| 32 |
+
|
| 33 |
+
Note that, here, being able to in-context learn a function class is a property of model $M$ alone, independent of how it was trained. Training such a model can be viewed as an instance of metalearning [62, 45, 67], a general paradigm for learning a model or method that can learn from data.
|
| 34 |
+
|
| 35 |
+
We empirically study this question, focusing on Transformer models [69, 53]—the architecture behind recent large language models—trained from scratch to in-context learn simple, well-defined function classes (e.g. linear functions). Specifically, we sample prompts containing in-context examples (input-output pairs) generated using functions in a given class and train models to predict the function value at the corresponding query inputs. (see illustration in Figure 1). Our findings are as follows.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Can we train a model that in-context learns a function class (here linear functions)? We train Transformers by repeatedly sampling a random function $f$ from that class, as well as random inputs $x _ { 1 } , \ldots , x _ { k }$ and training the model to predict each $f ( x _ { i } )$ given the prompt $x _ { 1 } , f ( x _ { 1 } ) , \ldots , x _ { i - 1 } , f ( x _ { i - 1 } ) , x _ { i }$ (wrt squared loss). Then, during inference, we evaluate the model’s ability to predict accurately on new, unseen functions.
|
| 39 |
+
|
| 40 |
+
Transformers can in-context learn linear functions. We show empirically that we can train a standard Transformer from scratch to in-context learn the class of linear functions, with respect to the input distribution $D _ { \mathcal { X } }$ being an isotropic Gaussian in 20 dimensions, and $D _ { \mathcal { F } }$ being the distribution over linear functions with weight vectors drawn from an isotropic Gaussian (the model was trained on prompts generated from the same distributions $D _ { \mathcal { X } }$ and $D _ { \mathcal { F } }$ ). Specifically, the trained model achieves error comparable to the optimal least squares estimator, suggesting that it encodes an effective learning algorithm, at least for the distribution used to generate the training prompts.
|
| 41 |
+
|
| 42 |
+
Generalization to out-of-distribution prompts. To understand the extent to which the trained model encodes an algorithm that works beyond the training distribution, we consider in-context learning under two types of distribution shifts: (a) a shift between the prompts encountered during training and inference (e.g., training on prompts without any noise in the in-context example outputs but testing with noisy outputs), (b) a shift between the in-context examples and the query input during inference (e.g., in-context examples lie in one orthant and the query input lies in another). We find that the performance of our model is quite robust to such shifts, indicating that it has learned to perform linear regression with some generality.
|
| 43 |
+
|
| 44 |
+
More complex function classes. We also consider the function classes of 3-sparse linear functions, two-layer ReLU neural networks with 100 hidden units, and decision trees of depth 4, all with 20 dimensional inputs. We show that we can train Transformer models that can in-context learn these classes (with respect to isotropic Gaussian inputs and appropriately defined distributions over functions). For sparse linear functions, the trained model exploits sparsity, obtaining performance better than least squares and comparable to Lasso. For neural networks, the trained model performs comparably to neural networks of the same architecture trained using gradient descent on in-context examples. Moreover, it is also able to in-context learn linear functions. For decision trees, the trained model learns unseen trees with as few as 100 in-context examples, whereas greedy learning and tree boosting algorithms are unable to achieve competitive performance. Note that learning these function classes requires involved algorithms (e.g., gradient descent with the Lasso objective), and our results show that Transformers can encode algorithms with similar performance in a single forward pass.
|
| 45 |
+
|
| 46 |
+
Model capacity and problem dimension. Finally, we explore how the ability of Transformers to in-context learn linear functions scales with model capacity and problem dimensionality. We find that increasing model capacity improves performance significantly, and allows the model to in-context learn higher-dimensional functions. Also, increasing the capacity often improves performance under distribution shifts significantly, even when the absolute improvement in the standard error is small.
|
| 47 |
+
|
| 48 |
+
# 2 Training models for in-context learning
|
| 49 |
+
|
| 50 |
+
We now describe a general methodology for training a model that can in-context learn a function class $\mathcal { F }$ with respect to a distribution $D _ { \mathcal { F } }$ over functions, and $D _ { \mathcal { X } }$ over inputs. We start by constructing random training prompts as follows. We sample a random function $f$ from the class according to $D _ { \mathcal { F } }$ , then create a set of random inputs $x _ { 1 } , \ldots , x _ { k + 1 }$ drawn independently from $D _ { \mathcal { X } }$ , and evaluate $f$ on these inputs to produce the prompt $P = ( x _ { 1 } , f ( x _ { 1 } ) , \ldots , x _ { k + 1 } , f ( x _ { k + 1 } ) )$ . For example, in the case of linear functions, inputs could be drawn from the isotropic Gaussian distribution $N ( 0 , I _ { d } )$ , and a random function chosen by sampling weight vector $w$ from $N ( 0 , I _ { d } )$ and setting $f ( x ) = w ^ { \top } x$ .
|
| 51 |
+
|
| 52 |
+
Now, given such prompts, we train a model to predict $f ( x _ { i } )$ for a given $x _ { i }$ based on a set of in-context examples. Concretely, let $P ^ { i }$ denote the prompt prefix containing $i$ in-context examples (the first $i$ input-output pairs) and the $( i + 1 ) ^ { \mathrm { t h } }$ input: $\bar { P ^ { i } } \bar { = ( x _ { 1 } , f ( x _ { 1 } ) , x _ { 2 } , f ( x _ { 2 } ) , \ldots , x _ { i } , f ( x _ { i } ) , x _ { i + 1 } ) }$ . Then, we train a model $M _ { \theta }$ parameterized by $\theta$ to minimize the expected loss over all the prompt prefixes:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\underset { \theta } { \operatorname* { m i n } } \ \mathbb { E } _ { P } \left[ \frac { 1 } { k + 1 } \sum _ { i = 0 } ^ { k } \ell \left( M _ { \theta } \left( P ^ { i } \right) , f \left( x _ { i + 1 } \right) \right) \right] ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\ell ( \cdot , \cdot )$ is an appropriately chosen loss function. Below, we describe how this general methodology can be implemented for a concrete model family (see Appendix A for additional details).
|
| 59 |
+
|
| 60 |
+
Model structure. We use a decoder-only Transformer architecture [69] from the GPT-2 family [54], with 12 layers, 8 attention heads, and a 256-dimensional embedding space (22.4M parameters). The model takes as input a sequence of vectors in its embedding space and predicts the next vector in the sequence within the same space (in language modeling, these vectors correspond to input tokens). We apply this model to our prompts $( x _ { 1 } , \bar { f } ( \bar { x _ { 1 } } ) , \dots , x _ { k + 1 } , f ( x _ { k + 1 } ) )$ as follows. We map each prompt output $f ( x _ { i } )$ to the same dimension as prompt inputs $x _ { i }$ by appending zeros, and map the prompt inputs and outputs into the latent embedding space of the Transformer through a (learnable) linear transformation. We then use another (learnable) linear transformation to map the vector predicted by the model to a scalar. Note that the Transformer architecture allows us to compute the prediction $( \dot { M } _ { \theta } ( P ^ { i } ) )$ for all prompt prefixes in a single forward pass.
|
| 61 |
+
|
| 62 |
+
Training. We train the model according to the training objective in (2) using squared error as the loss function. We sample a batch of random prompts at each training step and update the model through a gradient update. We use a batch size of 64 and train for $5 0 0 \mathrm { k }$ steps. This training is done from scratch, that is, we do not fine-tune a pre-trained language model, nor do we train on actual text.
|
| 63 |
+
|
| 64 |
+
Curriculum learning. Many function classes contain functions of varying complexity. We exploit this by training our model using a curriculum [5, 20, 60, 73], where we train on a simpler distribution of functions in the beginning (e.g., linear functions with weight vectors restricted to a low-dimensional subspace) and gradually increase the function complexity. This speeds up training drastically, often allowing us to train models that would be significantly more expensive to train without a curriculum (see Section 6 for details).
|
| 65 |
+
|
| 66 |
+
# 3 In-context learning of linear functions
|
| 67 |
+
|
| 68 |
+
In the previous section, we describe a general methodology for training Transformer models to in-context learn a class of functions. Here, we focus on a simple function class—namely linear functions—and study how well models trained using our methodology can in-context learn this class.
|
| 69 |
+
|
| 70 |
+
Prompt distribution. We consider the class of linear functions $\mathcal F = \{ f \mid f ( x ) = w ^ { \top } x , w \in \mathbb { R } ^ { d } \}$ , in $d$ dimensions where $d = 2 0$ . We sample $x _ { 1 } , \ldots , x _ { k }$ , $x _ { \mathrm { q u e r y } }$ , and $w$ independently from the isotropic Gaussian distribution $N ( 0 , I _ { d } )$ . We then compute each $\dot { y _ { i } } = w ^ { \top } x _ { i }$ and construct the prompt as $P = ( x _ { 1 } , y _ { 1 } , x _ { 2 } , y _ { 2 } , . . . , x _ { k } , y _ { k } , x _ { \mathrm { q u e r y } } ) .$
|
| 71 |
+
|
| 72 |
+
Baselines. To contextualize the performance of our trained model, we compare it to other learning algorithms: (a) the least squares estimator, computing the minimum-norm linear fit to the in-context examples $( x _ { i } , y _ { i } )$ , (b) $n$ -Nearest Neighbors, averaging the $y _ { i }$ values for the $n$ nearest neighbors of $x _ { \mathrm { q u e r y } }$ , (c) averaging the values $y _ { i } x _ { i }$ to estimate $w$ and compute the inner product of this estimate with $x _ { \mathrm { q u e r y } }$ . Least squares is the optimal estimator for this problem and thus serves as a lower bound. The other baselines are consistent (but sub-optimal) estimators that are easier to compute and thus provide an estimate of the performance achieved by simple approaches. See Appendix A.3 for more details.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 2: Evaluating the trained Transformer on in-context learning linear functions. We plot the normalized squared error of the Transformer $( M ( P ) - w ^ { \top } x _ { \mathrm { q u e r y } } ) ^ { 2 } / \breve { d } )$ and the relevant baselines, as we vary the number of in-context examples. Transformer’s error decreases at a rate comparable to least squares. When the number of in-context examples reaches the problem dimension $d$ (here 20), least squares achieves 0 error while the Transformer achieves an error of 0.02, improving to 0.0006 at $2 d$ examples. The simple baselines perform better than the zero estimator (dashed), but still rather poorly. (Error averaged over 1280 prompts. $90 \%$ confidence intervals, 1000 bootstrap trials.)
|
| 76 |
+
|
| 77 |
+
# 3.1 Transformers can in-context learn linear functions
|
| 78 |
+
|
| 79 |
+
We show the in-context learning ability of the resulting model along with the relevant baselines in Figure 2. The trained Transformer is able to in-context learn the class of linear functions with respect to the prompt distribution specified above, performing comparably to the optimal least squares estimator for any number of in-context examples considered. While the simpler baselines achieve non-trivial error, they are far from optimal, indicating that the trained model encodes a more complex algorithm. Moreover, in Appendix B.7, we show that the model cannot be relying on memorization of training prompts or weight vectors, and thus encodes an algorithm capable of in-context learning linear functions that are very different from those seen during training.
|
| 80 |
+
|
| 81 |
+
# 3.2 What functions is the model learning in-context?
|
| 82 |
+
|
| 83 |
+
Recall that the goal of our model is: given the prompt $P = ( x _ { 1 } , \ w ^ { \top } x _ { 1 } , \ldots , x _ { k } , \ w ^ { \top } x _ { k } , \ x _ { \mathrm { q u e r y } } ) ,$ output $w ^ { \top } x _ { \mathrm { q u e r y } }$ . Thus, if we fix the prefix given by the $k$ in-context examples, we can view the output of the model as a function $\hat { f } _ { w , x _ { 1 : k } } ( x _ { \mathrm { q u e r y } } )$ , that approximates $w ^ { \top } x _ { \mathrm { q u e r y } }$ . When $k < d$ (fewer in-context examples than dimensions), the ground truth cannot be recovered perfectly and the ideal model should approximate $( \mathrm { p r o j } _ { \underline { { x } } _ { \underline { { 1 } } \underline { { : } } k } } ( w ) ) ^ { \top } \bar { \underline { { x } } } _ { \mathrm { q u e r y } }$ , where $\mathrm { p r o j } _ { x _ { 1 : k } } ( w )$ is the projection of $w$ onto the subspace spanned by $x _ { 1 } , \ldots , x _ { k }$ . Here, we will evaluate how accurately the model approximates this.
|
| 84 |
+
|
| 85 |
+
Visualizing along a random direction. For a randomly sampled fixed prefix, we visualize $\hat { f } _ { w , x _ { 1 : k } } \left( x _ { \mathrm { q u e r y } } \right)$ as we vary the query input along a random direction $x$ (Figure 3a). That is, we pick a random unit vector $x$ , and evaluate $\hat { f } _ { w , x _ { 1 : k } } ( \lambda x )$ as we vary $\lambda$ , the distance of the query input from origin. We observe that $\hat { f } _ { w , x _ { 1 : d } } ( \lambda x )$ and $\hat { f } _ { w , x _ { 1 : 2 d } } ( \lambda x )$ closely match the ground truth and $\hat { f } _ { w , x _ { 1 : d / 2 } } ( \lambda x )$ matches the projected ground truth, when the distance from origin is not too large compared to the norm of a typical randomly sampled input. In fact, in Appendix B.1, we show that the model is quite robust to scaling the query input: the error doesn’t increase much as we scale up the query input by a factor of up to 2, or scale down by a factor of up to 16, and degrades slowly after.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 3: Understanding the prefix-conditioned function. (a) Model prediction as we fix the in-context examples and vary the query input along a random direction (three random prompts). The shaded regions denotes where the norm of a randomly training input lies with probability 0.99. When the scale of the query input is close to this range, the model prediction is close to the true linear function (or its projection to the space of in-context inputs when $k < d$ ). (b) We compute the gradient of the model prediction with respect to the query input, and plot its (normalized) inner product with the true and projected $w$ , averaged over 1280 prompts. The gradient aligns almost perfectly with $w$ when $k \geq d$ , and with projected $w$ for all $k$ , indicating that the model locally aligns with the ground truth.
|
| 89 |
+
|
| 90 |
+
Local correctness. So far, we have seen that the model is able to make predictions close to the ground truth for randomly drawn query inputs and in-context examples. We will now turn our attention to the local change of $\hat { f }$ around $x _ { \mathrm { q u e r y } }$ by considering the gradient of the function $\hat { f } _ { w , x _ { 1 : k } } ( x _ { \mathrm { q u e r y } } )$ with respect to $x _ { \mathrm { q u e r y } }$ (our model is fully differentiable so we can compute it directly). Since $\hat { f }$ computed by the model should ideally approximate $\mathrm { p r o j } _ { x _ { 1 : k } } ( w ) ^ { \top } x$ , this gradient should lie in the direction of the projected ground truth $\mathrm { p r o j } _ { x _ { 1 : k } } ( w )$ . In Figure 3b, we show the inner product between the gradient and $\mathrm { p r o j } _ { x _ { 1 : k } } ( w )$ (both normalized), averaged over 1280 random prompts, and observe that they align almost perfectly. Since $\operatorname { p r o j } _ { _ { X _ { 1 : k } } } ( w ) = { w }$ almost surely when $k \geq d$ , we observe that the gradient also aligns with $w$ perfectly in this regime. Thus the model is locally correct around the query input.
|
| 91 |
+
|
| 92 |
+
# 4 Extrapolating beyond the training distribution
|
| 93 |
+
|
| 94 |
+
In the previous section, we demonstrated that we can train a model to in-context learn linear functions with respect to the distribution of prompts encountered during training. That is, we evaluate the in-context learning ability of the model with respect to distributions $D _ { \mathcal { X } }$ and $D _ { \mathcal { F } }$ that were also used to train the model. Here, we evaluate the in-context learning performance of our model on prompt distributions different from the one used for training. Our overarching goal is to better understand the learning algorithm encoded by our model by analysing how it performs on such prompts.
|
| 95 |
+
|
| 96 |
+
Formally, we refer to the distribution of functions used during training as $D _ { \mathcal { F } } ^ { \mathrm { t r a i n } }$ and the corresponding distribution of prompt inputs as $D _ { \mathcal { X } } ^ { \mathrm { t r a i n } }$ . During inference, functions are sampled from a (potentially different) distribution $D _ { \mathcal { F } } ^ { \mathrm { t e s t } }$ , while prompt inputs from a distribution $D _ { \mathcal { X } } ^ { \mathrm { t e s t } }$ . Moreover, deviating again F from our analysis so far, we also consider a separate distribution $D _ { \mathrm { q u e r y } } ^ { \mathrm { t e s t } }$ X , from which the query input is sampled, potentially dependent on the rest of the in-context inputs $x _ { 1 } , \ldots , x _ { k }$ (sampled from $D _ { \mathcal { X } } ^ { \mathrm { t e s t } }$ ).
|
| 97 |
+
|
| 98 |
+
Within this framework, we consider the same model as last section, and evaluate its performance on prompts that deviate from those encountered during training, either by
|
| 99 |
+
|
| 100 |
+
1. sampling prompt inputs or functions from a different distribution, that is $D _ { \mathcal { X } / \mathcal { F } } ^ { \mathrm { t r a i n } } \neq D _ { \mathcal { X } / \mathcal { F } } ^ { \mathrm { t e s t } }$ or
|
| 101 |
+
2. introducing a mismatch between in-context examples and query input, i.e., $D _ { \mathrm { q u e r y } } ^ { \mathrm { t e s t } } \neq D _ { \chi } ^ { \mathrm { t e s t } }$ .
|
| 102 |
+
|
| 103 |
+
We describe three such prompt distributions below, along with the corresponding results in Figure 4, and provide the full results in Appendix B.2. Overall, the model performs reasonably accurate in-context learning with respect to these prompt distributions, indicating that it has indeed learnt to perform linear regression to some generality.
|
| 104 |
+
|
| 105 |
+
Recall that we generate a training prompt $P = ( x _ { 1 } , w ^ { T } x _ { 1 } , \dots , x _ { k } , w ^ { T } x _ { k } , x _ { \mathrm { q u e r y } } )$ by drawing the prompt inputs $x _ { i }$ and $x _ { \mathrm { q u e r y . } }$ ), and the weight vector $( w )$ i.i.d. from $N ( 0 , I _ { d } )$ , with $d = 2 0$ .
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 4: In-context learning on out-of-distribution prompts. We evaluate the model on prompts that deviate from those seen during training by: (a) sampling prompt inputs from a non-isotropic Gaussian, (b) adding label noise to in-context examples, (c) restricting in-context examples to a single (random) orthant. Model error degrades gracefully and remains close to that of the least squares estimator, indicating that its in-context learning ability extrapolates beyond the training distribution.
|
| 109 |
+
|
| 110 |
+
Skewed covariance. We sample prompt inputs from $N ( 0 , \Sigma )$ where $\Sigma$ is a skewed covariance matrix with eigenbasis chosen uniformly at random and $i ^ { \mathrm { { t h } } }$ eigenvalue proportional to $1 / i ^ { 2 }$ . We normalize the inputs so that their expected squared norm is equal to that of inputs encountered during training, and study the effect of input scale separately in Appendix B.2. The model matches the performance of least squares until $k = 1 0$ , mimicking the sharp drop in the error in this regime, but its error plateaus afterwards (see Figure 4a). Thus, it is not perfectly robust to this distribution mismatch but still does relatively well, achieving less than half the error of the nearest neighbor baseline in most cases.
|
| 111 |
+
|
| 112 |
+
Noisy linear regression. We add noise to each prompt output: the $i ^ { \mathrm { { t h } } }$ output is equal to $w ^ { T } x _ { i } + \epsilon _ { i }$ where $\epsilon _ { i } \sim N ( 0 , 1 )$ . The trained model closely tracks the performance of least squares for most prompt sizes (see Figure 4b). Interestingly, the model also exhibits the double descent error curve [2] that is known to manifest for the least squares estimator [46]. Note that in this noisy setting, the optimal estimator corresponds to least squares with appropriate $\ell _ { 2 }$ -regularization, which we cannot expect the model to learn since it was trained on noiseless data.
|
| 113 |
+
|
| 114 |
+
Different orthants for in-context and query inputs. We fix the sign of each coordinate to be positive or negative for all in-context inputs $x _ { i }$ (at random). As a result, all in-context inputs lie in the same orthant, while the query input lies in another orthant with high probability. The model is not affected by the mismatch between in-context and query inputs and closely match the performance of least squares. In this case, the model achieves errors 0.062 and 0.004 for 20 and 40 in-context examples respectively (see Figure $_ { 4 \mathrm { c } }$ ), whereas recall that it achieves errors 0.02 and 0.0006 on standard prompts. This indicates that the model is not relying on some variant of nearest neighbor search as in that case, its error would have been higher (see the 3-nearest neighbor baseline).
|
| 115 |
+
|
| 116 |
+
# 5 More complex function classes
|
| 117 |
+
|
| 118 |
+
We now consider in-context learning for more complex function classes, namely sparse linear functions, decision trees, and two-layer ReLU neural networks. We are back in the setting where the prompt distribution during inference is same as that during training. The overall methodology remains the same: we sample random functions from these families and train a Transformer to approximate these functions given in-context examples. (See Appendix A.3 for details and baselines.) Note that, here, we are training a new Transformer model (from scratch) for each function class, independently of the model studied in the previous sections (which was trained to in-context learn linear functions).
|
| 119 |
+
|
| 120 |
+
Sparse linear functions. First, we consider functions of the form $f ( x ) = w ^ { \top } x$ where $w \in \mathbb { R } ^ { d }$ and has exactly $s$ non-zero coordinates. To sample a prompt $P = ( x _ { 1 } , f ( x _ { 1 } ) , \dots , x _ { k } , f ( x _ { k } ) , x _ { \mathrm { q u e r y } } )$ , we draw prompt inputs $x _ { i }$ and $x _ { \mathrm { q u e r y } }$ , and a weight vector $w$ from $N ( 0 , I _ { d } )$ , and then zero out all but $s$ coordinates of $w$ uniformly at random. In this setting, the least squares estimator is no longer optimal. One can perform better by leveraging sparsity, e.g., using Lasso [68], which involves solving the least squares objective with an $\ell _ { 1 }$ -norm weight regularizer. We plot the performance of our model trained for $d = 2 0$ and $s = 3$ in Figure 5a, and observe that it is also able to leverage sparsity, nearly matching the performance of Lasso. Note that, unlike least squares, Lasso does not have a closed form expression and involves iterative minimization of the regularized objective, yet the Transformer is able to achieve comparable performance in a single forward pass.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 5: Training a Transformer to in-context learn more complex function classes. (a) A Transformer trained on prompts generated using sparse linear functions can in-context learn this class, with error decreasing at a rate similar to Lasso, and significantly better than minimum norm least squares. (b) A Transformer trained on prompts generated using random decision trees can in-context learn this class, with much better performance than greedy tree learning or tree boosting. (c) A Transformer trained on prompts generated using random 2-layer ReLU neural networks can in-context learn this class. The error decreases at a rate similar to the baseline which involves training a neural network using a variant of gradient descent with in-context examples as the training data. (d) The same model (from (c)) can in-context learn the class of linear functions. The error decreases at a rate slower than least squares, but comparable to a neural network trained using a variant of gradient descent. All errors are normalized so that the zero estimator achieves an error of 1 (dashed).
|
| 124 |
+
|
| 125 |
+
Decision trees. Next, we consider the class of depth 4 decision trees with 20 dimensional inputs. A function $f$ in this class is represented by a full binary tree (16 leaves) where each non-leaf node is associated with a coordinate, and each leaf is associated with a value. To evaluate $f$ on an input $x$ , we traverse the tree starting from the root node, going to the right if the coordinate associated with that node is positive and to the left otherwise. $f ( x )$ is given by the value associated with the leaf node reached. To sample a random prompt $P = ( x _ { 1 } , \bar { f ( x _ { 1 } ) } , \ldots , x _ { k } , f ( x _ { k } ) , x _ { \mathrm { q u e r y } } )$ , we draw inputs $x _ { i } \mathbf { s }$ and $x _ { \mathrm { q u e r y } }$ from $N ( 0 , I _ { d } )$ , and $f$ corresponds to a tree where the coordinates associated with non-leaf nodes are drawn uniformly at random from $\{ 1 , \ldots , d \}$ and the values associated with the leaves are drawn from $N ( 0 , 1 )$ . In Figure 5b, we show that Transformers can be trained to in-context learn this class much better than greedy tree learning and boosting (via XGBoost [13]). Since the decision trees in our class of functions predict solely based on the sign pattern of $x _ { i } \mathbf { s }$ , we also consider a baseline where we provide the greedy learning and XGBoost algorithms with the signs of each $x _ { i }$ instead. This significantly improves their performance, but they still perform much worse than the Transformer (error 0.31 vs. 0.12 at 100 in-context examples).
|
| 126 |
+
|
| 127 |
+
Twowork works. Finally,ions of the form $\begin{array} { r } { f ( x ) ~ = ~ \sum _ { i = 1 } ^ { r } \alpha _ { i } ~ \sigma ( w _ { i } ^ { \top } x ) } \end{array}$ wo laye, where $\alpha _ { i } ~ \in ~ \mathbb { R }$ , $w _ { i } ~ \in ~ \mathbb { R } ^ { d }$ $\sigma ( \cdot ) ~ = ~ \operatorname* { m a x } ( 0 , \cdot )$ $P =$ $( x _ { 1 } , f ( x _ { 1 } ) , \ldots , x _ { k } , f ( x _ { k } ) , x _ { \mathrm { q u e r y } } )$ , we sample inputs $x _ { i } \mathbf { s }$ and $x _ { \mathrm { q u e r y } }$ from $N ( 0 , I _ { d } )$ , along with network parameters $a _ { i } \mathbf { s }$ and $w _ { i } \mathbf { s }$ from $N ( 0 , 2 / \bar { r } )$ and $N ( 0 , I _ { d } )$ respectively. We set the input dimension $d$ to 20 and the number of the hidden nodes $r$ to 100. In Figure 5c, we show that Transformers can be trained to in-context learn this class of functions. In fact, the Transformer performs comparably to the baseline which trains a two-layer neural network of the same architecture on in-context examples using Adam [31], a variant of gradient descent (see Appendix A.3 for details). Moreover, the model trained to in-context learn two-layer neural networks is also able to in-context learn linear functions (for which it is not explicitly trained), albeit at a rate slower than least squares, but comparable to a neural network trained on in-context examples generated using a linear function. (see Figure 5d).
|
| 128 |
+
|
| 129 |
+
# 6 Investigating what matters for in-context learning
|
| 130 |
+
|
| 131 |
+
We now return to the setting of training models to in-context learn linear functions and explore different factors that lead to successful in-context learning.
|
| 132 |
+
|
| 133 |
+
Problem Dimension and Capacity. In Section 3 and 4, we saw that Transformer models can be trained to in-context learn 20-dimensional linear functions accurately and relatively robustly. To explore the interplay between problem dimensionality and capacity, we also consider models with fewer parameters (see Appendix A.1) and train each architecture on {10, 30, 40, 50}-dimensional problems. In Figure 6, we plot the model error with $2 d$ in-context examples as we vary the problem dimension $d$ and the model capacity. In the standard setting, i.e., when the training and inference time prompt distributions are the same, we observe that the error decreases as we increase the capacity or reduce the problem dimensionality (see Figure 6a)—i.e., model capacity helps. For out-of-distribution prompts, the settings with skewed covariance or with in-context example and query inputs lying in different orthants are challenging, especially for higher dimensional problems. However, the error decreases considerably (in most cases) as we increase the model capacity, even when absolute decrease in the standard error is small (see Figure 6b and 6c). See Appendix B.3 for additional plots.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 6: Understanding the effect of model capacity and problem dimension on in-context learning performance for in-distribution (a) and out-of-distribution $( b , c )$ prompts. We train Transformers to in-context learn linear functions and plot the error with $2 d$ in-context examples as we vary problem dimension $d$ and model capacity. Capacity helps in most cases, especially on out-of-distribution prompts, even when the absolute gains in the in-distribution setting are small. We train 3 models in each case with different random seeds, and show the median error (solid lines), and the minimum and maximum errors (shaded region). (See Appendix B.4 for training variance analysis.)
|
| 137 |
+
|
| 138 |
+
Curriculum learning. When training our models, we initially draw the prompt inputs from a fixed 5 dimensional subspace (by setting some of the coordinates to 0) with prompt length 11 (number of input-output pairs), and increase the subspace dimension by 1 and prompt length by 2 every 2, 000 training steps, until the subspace dimension reaches the ambient dimension $d$ and prompt length reaches $2 d + 1$ (see Appendix A.2 for details). This speeds up training drastically, especially for higher dimensional problems: for dimension 50, the loss barely decreases through the $5 0 0 \mathrm { k }$ training steps without curriculum but reaches close to the optimum with curriculum. For the 20 dimensional problem where we were able to train the model without curriculum within the training (step count) budget, we did not observe any qualitative difference in accuracy or robustness compared to the model trained with curriculum. We compare training with and without curriculum in Appendix B.5.
|
| 139 |
+
|
| 140 |
+
Notably, when training Transformers without curriculum, there is an initial—relatively long—period in training where the loss does not decrease, followed by a period of sharp decrease. The length of this period varies with training randomness and seems to increase on average with problem dimension. Interestingly, Olsson et al. [48] observe a similar jump in the in-context learning ability of a language model which they attribute to the formation of “induction heads”.
|
| 141 |
+
|
| 142 |
+
Number of distinct prompts or functions seen during training. To estimate the amount of training data required for in-context learning, we perform two ablation studies. In the first study, we limit the number of distinct prompts seen during training. That is, we create a set of $n _ { p }$ randomly generated prompts (as described in Section 2), and sample prompts from this set during training (here, we train without curriculum, as it would introduce additional prompts during the warmup phase). In the second study, we only limit the number of distinct functions used for training. That is we create a set of $n _ { w }$ randomly chosen vectors (corresponding to $n _ { w }$ linear functions) and sample weight vectors uniformly from that set to generate the training prompts (the inputs are still sampled from $N ( 0 , I _ { d } )$ for each training prompt). We find that the amount of training data required is relatively small: non-trivial in-context learning is possible with $n _ { p } = 1 0 0 { \bf k }$ or $n _ { w } = 1 { \mathrm k }$ , and the error drops close to that of the unrestricted model (discussed in Section 3) with $n _ { p } = 1 \mathrm { M }$ or $n _ { w } = 1 0 { \bf k }$ (details in Appendix B.6). For context, in Section 3, the model is trained on fresh prompts at each step and thus encounters 32M distinct linear functions and prompts $5 0 0 \mathrm { k }$ training steps with a batch size of 64).
|
| 143 |
+
|
| 144 |
+
# 7 Related work
|
| 145 |
+
|
| 146 |
+
In-context learning. Since Brown et al. [10] demonstrated the in-context learning ability of GPT-3, there has been a significant interest in improving and understanding this capability [36, 39, 79, 38, 59, 40, 14, 43, 33]. The works most relevant to ours are as follows. Xie et al. [74] propose a Bayesian inference framework explaining how in-context learning works despite formatting differences between training and inference distributions. Razeghi et al. [57] show that in-context learning for numerical reasoning tasks is better for instances whose terms are more prevalent in training data. Min et al. [39] demonstrate tasks where in-context learning works even when the prompt outputs are chosen randomly, questioning to what extent these models are truly learning new tasks on-the-fly, while Rong [58] gives examples of novel tasks on which these models demonstrate on-the-fly learning ability. Chan et al. [12] demonstrate that distributional properties such as long-tailedness are crucial for in-context learning on an image-based few-shot dataset. Olsson et al. [48] and Elhage et al. [19] consider a different framing of in-context learning, referring to any model behavior that utilizes information in a prompt to make predictions that improve with prompt size. They hypothesize the existence of special circuits inside Transformer models responsible for in-context learning, that copy similar patterns from the prompt sequence. Pesut [52] and Dinh et al. [16, Table 16] consider in-context learning for small tabular datasets and learning problems in one and two dimensions, and show that GPT-3 can obtain non-trivial accuracy. Our work contributes to this line of work, by posing in-context learning as a well-defined problem of learning function classes at inference time, and empirically investigating if we can train models that in-context learn simple function classes.
|
| 147 |
+
|
| 148 |
+
Transformers. There is a long line of work investigating the capabilities [69, 15, 77, 51, 76, 7, 78], limitations [25, 6], applications [37, 17, 49], and internal workings [19, 65, 71, 18, 48] of Transformer models. Most similar to our work, Müller et al. [44] and Nguyen and Grover [47] demonstrate the ability of Transformer models to solve prediction tasks using the input context, albeit in different settings. Müller et al. [44] introduce a “Prior-data fitted transformer network” that is trained to approximate Bayesian inference with priors such as Gaussian processes and Bayesian neural networks, and use it to perform downstream tasks such as tabular dataset classification and few-shot image classification. Nguyen and Grover [47] introduce Transformer neural processes, building on prior work on neural processes [24, 23, 30], and show that they achieve state-of-the art performance on tasks such as image completion and contextual multi-armed bandits. Our work complements these works, focusing on understanding the in-context learning ability of Transformers for various simple function classes and the extent to which this ability extrapolates beyond the training distribution.
|
| 149 |
+
|
| 150 |
+
Meta-learning. Training a model to perform in-context learning can be viewed as an instance of the more general learning-to-learn or meta-learning paradigm [62, 45, 67]. Typical approaches from this extensive line of work (see [28] for a survey) include: training a meta-learner to update the parameters of a downstream learner [4, 34], learning parameter initializations which allow to quickly train for downstream tasks [21, 56], learning latent embeddings for effective similarity search [66]. Most relevant to our setting are approaches that directly take as input examples from a downstream task and a query input and produce the corresponding output [26, 42, 61, 24, 23, 32]. Our work contributes to this line of work, by investigating the learning-to-learn abilities of Transformer models.
|
| 151 |
+
|
| 152 |
+
Data-driven algorithm design. Another line of work aims to discover algorithms that perform well on a distribution of inputs [27, 75, 70, 3, 29, 64, 63] (as opposed to algorithms with guarantees on their worst-case performance). See Balcan [1] for a survey on advancements on the theoretical foundations of such algorithms. Our work can be viewed as part of this line of work, as we train Transformer models to discover algorithms for different learning problems.
|
| 153 |
+
|
| 154 |
+
# 8 Discussion
|
| 155 |
+
|
| 156 |
+
In this work, we formalize and study the question: can we train models that learn different classes of functions in-context? We show that Transformer models trained from scratch can in-context learn the class of linear functions, with performance comparable to the optimal least squares estimator, even under distribution shifts. Moreover, we show that in-context learning is also possible for sparse linear functions, decision trees, and two-layer neural networks; learning problems which are solved in practice with involved iterative algorithms such as gradient descent.
|
| 157 |
+
|
| 158 |
+
At the same time, understanding the implications of our results for language models requires further investigation. A pertinent question regarding the in-context learning capabilities of language models is how they leverage in-context examples [41]. Our results demonstrate that Transformers can encode complex learning algorithms that utilize in-context examples in a far-from-trivial manner. In fact, this is the case for standard Transformer architectures trained with standard optimization procedures. The extent to which such non-trivial in-context learning behavior exists in large language models is still open, but we believe that our work takes a step towards formalizing and understanding this question.
|
| 159 |
+
|
| 160 |
+
Our work lays the groundwork for several future directions.
|
| 161 |
+
|
| 162 |
+
Complexity of in-context learning. We empirically show that model capacity helps in performing in-context learning accurately and robustly. How does the in-context learning loss (1) depend on the complexity of the function class $\mathcal { F }$ , the capacity of model $M$ , and data used to train $M$ . Understanding this question for models explicitly trained to perform in-context learning may suggest an upper bound for the in-context learning performance of models such as GPT-3 that are not explicitly trained for it.
|
| 163 |
+
|
| 164 |
+
Curriculum learning. Within our framework, there is natural notion of curriculum learning where, during training, we gradually increase the complexity of the function class learned in-context. This leads to drastic training speed-ups. What is the reason behind such a speedup? Are similar speedups also possible for training large language models (thus significantly reducing training time and energy)?
|
| 165 |
+
|
| 166 |
+
Inductive bias of model families. Our framework presents an opportunity to understand and compare the inductive biases of different model families (e.g., Transformers vs. LSTMs) in a well-defined setting. For instance, a concrete question is: Are there function classes that are easier to in-context learn using Transformers but harder for LSTMs and vice-versa?
|
| 167 |
+
|
| 168 |
+
Understanding the learning algorithms encoded in Transformers. The models we train can perform in-context learning, and are thus themselves encoding learning algorithms. However, we do not really understand the encoded algorithms. It would thus be worth investigating the internal workings of these models to get a better understanding of these algorithms. Moreover, for settings such as decision trees, we do not have a good understanding of what the optimal learning algorithms are or when known heuristics work [9, 11]. Nevertheless, in Section 5 we found that Transformers are able to discover sample efficient algorithms, thus suggesting an intriguing possibility where we might be able to discover better learning algorithms by reverse engineering these models.
|
| 169 |
+
|
| 170 |
+
# Acknowledgements
|
| 171 |
+
|
| 172 |
+
We thank Niladri Chatterji, Micah Goldblum, Rohith Kuditipudi, Shibani Santurkar, Carmen Strassle, Mirac Sugzun, Li-Yang Tan, and anonymous reviewers for helpful comments.
|
| 173 |
+
|
| 174 |
+
SG was funded by a Stanford Interdisciplinary Graduate Fellowship. DT was funded by Open Philanthropy, and partially supported by NSF Award CCF-1813049. GV was supported by NSF Awards CCF-1704417, CCF-1813049, Frontier Award 1804222 and DOE award DE-SC0019205. We performed our experiments on the Stanford NLP cluster.
|
| 175 |
+
|
| 176 |
+
References
|
| 177 |
+
[1] Maria-Florina Balcan. Data-driven algorithm design. In Tim Roughgarden, editor, Beyond Worst Case Analysis of Algorithms. Cambridge University Press, 2020.
|
| 178 |
+
[2] Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machinelearning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences, 2019.
|
| 179 |
+
[3] Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016.
|
| 180 |
+
[4] Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, 1995.
|
| 181 |
+
[5] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In International Conference on Machine Learning (ICML), pages 41–48, 2009.
|
| 182 |
+
[6] Satwik Bhattamishra, Kabir Ahuja, and Navin Goyal. On the ability and limitations of transformers to recognize formal languages. arXiv preprint arXiv:2009.11264, 2020.
|
| 183 |
+
[7] Satwik Bhattamishra, Arkil Patel, and Navin Goyal. On the computational power of transformers and its implications in sequence modeling. arXiv preprint arXiv:2006.09286, 2020.
|
| 184 |
+
[8] Sid Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, et al. Gpt-neox-20b: An open-source autoregressive language model. arXiv preprint arXiv:2204.06745, 2022.
|
| 185 |
+
[9] Guy Blanc, Jane Lange, Mingda Qiao, and Li-Yang Tan. Decision tree heuristics can fail, even in the smoothed setting. arXiv preprint arXiv:2107.00819, 2021.
|
| 186 |
+
[10] 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. Neural Information Processing Systems (NeurIPS), 2020.
|
| 187 |
+
[11] Alon Brutzkus, Amit Daniely, and Eran Malach. Id3 learns juntas for smoothed product distributions. In Conference on Learning Theory, pages 902–915. PMLR, 2020.
|
| 188 |
+
[12] Stephanie CY Chan, Adam Santoro, Andrew K Lampinen, Jane X Wang, Aaditya Singh, Pierre H Richemond, Jay McClelland, and Felix Hill. Data distributional properties drive emergent few-shot learning in transformers. arXiv preprint arXiv:2205.05055, 2022.
|
| 189 |
+
[13] Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In conference on knowledge discovery and data mining (KDD), 2016.
|
| 190 |
+
[14] Yanda Chen, Ruiqi Zhong, Sheng Zha, George Karypis, and He He. Meta-learning via language model in-context tuning. arXiv preprint arXiv:2110.07814, 2021.
|
| 191 |
+
[15] Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser. Universal transformers. arXiv preprint arXiv:1807.03819, 2018.
|
| 192 |
+
[16] Tuan Dinh, Yuchen Zeng, Ruisu Zhang, Ziqian Lin, Shashank Rajput, Michael Gira, Jy-yong Sohn, Dimitris Papailiopoulos, and Kangwook Lee. Lift: Language-interfaced fine-tuning for non-language machine learning tasks. arXiv preprint arXiv:2206.06565, 2022.
|
| 193 |
+
[17] 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.
|
| 194 |
+
[18] Benjamin L Edelman, Surbhi Goel, Sham Kakade, and Cyril Zhang. Inductive biases and variable creation in self-attention mechanisms. In International Conference on Machine Learning (ICML), 2022.
|
| 195 |
+
[19] Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html.
|
| 196 |
+
[20] Jeffrey L Elman. Learning and development in neural networks: The importance of starting small. Cognition, 1993.
|
| 197 |
+
[21] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning (ICML), 2017.
|
| 198 |
+
[22] Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, 2001.
|
| 199 |
+
[23] Marta Garnelo, Dan Rosenbaum, Christopher Maddison, Tiago Ramalho, David Saxton, Murray Shanahan, Yee Whye Teh, Danilo Rezende, and SM Ali Eslami. Conditional neural processes. In International Conference on Machine Learning, pages 1704–1713. PMLR, 2018.
|
| 200 |
+
[24] Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J Rezende, SM Eslami, and Yee Whye Teh. Neural processes. arXiv preprint arXiv:1807.01622, 2018.
|
| 201 |
+
[25] Michael Hahn. Theoretical limitations of self-attention in neural sequence models. Transactions of the Association for Computational Linguistics, 2020.
|
| 202 |
+
[26] Sepp Hochreiter, A Steven Younger, and Peter R Conwell. Learning to learn using gradient descent. In International conference on artificial neural networks (ICANN), 2001.
|
| 203 |
+
[27] Eric Horvitz, Yongshao Ruan, Carla Gomes, Henry Kautz, Bart Selman, and Max Chickering. A bayesian approach to tackling hard computational problems (preliminary report). Electronic Notes in Discrete Mathematics, 2001.
|
| 204 |
+
[28] Timothy Hospedales, Antreas Antoniou, Paul Micaelli, and Amos Storkey. Meta-learning in neural networks: A survey. arXiv preprint arXiv:2004.05439, 2020.
|
| 205 |
+
[29] Elias Khalil, Hanjun Dai, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. Neural Information Processing Systems (NeurIPS), 2017.
|
| 206 |
+
[30] Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019.
|
| 207 |
+
[31] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 208 |
+
[32] Louis Kirsch and Jürgen Schmidhuber. Meta learning backpropagation and improving it. Neural Information Processing Systems (NeurIPS), 2021.
|
| 209 |
+
[33] Andrew K Lampinen, Ishita Dasgupta, Stephanie CY Chan, Kory Matthewson, Michael Henry Tessler, Antonia Creswell, James L McClelland, Jane X Wang, and Felix Hill. Can language models learn from explanations in context? arXiv preprint arXiv:2204.02329, 2022.
|
| 210 |
+
[34] Ke Li and Jitendra Malik. Learning to optimize. arXiv preprint arXiv:1606.01885, 2016.
|
| 211 |
+
[35] Opher Lieber, Or Sharir, Barak Lenz, and Yoav Shoham. Jurassic-1: Technical details and evaluation. White Paper. AI21 Labs, 2021.
|
| 212 |
+
[36] Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804, 2021.
|
| 213 |
+
[37] Kevin Lu, Aditya Grover, Pieter Abbeel, and Igor Mordatch. Pretrained transformers as universal computation engines. arXiv preprint arXiv:2103.05247, 2021.
|
| 214 |
+
|
| 215 |
+
[38] Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. arXiv preprint arXiv:2104.08786, 2021.
|
| 216 |
+
|
| 217 |
+
[39] Sewon Min, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. Noisy channel language model prompting for few-shot text classification. arXiv preprint arXiv:2108.04106, 2021.
|
| 218 |
+
|
| 219 |
+
[40] Sewon Min, Mike Lewis, Luke Zettlemoyer, and Hannaneh Hajishirzi. Metaicl: Learning to learn in context. arXiv preprint arXiv:2110.15943, 2021.
|
| 220 |
+
|
| 221 |
+
[41] Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. Rethinking the role of demonstrations: What makes in-context learning work? arXiv preprint arXiv:2202.12837, 2022.
|
| 222 |
+
|
| 223 |
+
[42] Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta-learner. In International Conference on Learning Representations (ICLR), 2018.
|
| 224 |
+
|
| 225 |
+
[43] Swaroop Mishra, Daniel Khashabi, Chitta Baral, Yejin Choi, and Hannaneh Hajishirzi. Reframing instructional prompts to gptk’s language. arXiv preprint arXiv:2109.07830, 2021.
|
| 226 |
+
|
| 227 |
+
[44] Samuel Müller, Noah Hollmann, Sebastian Pineda Arango, Josif Grabocka, and Frank Hutter. Transformers can do bayesian inference. arXiv preprint arXiv:2112.10510, 2021.
|
| 228 |
+
|
| 229 |
+
[45] Devang K Naik and Richard J Mammone. Meta-neural networks that learn by learning. In International Joint Conference on Neural Networks (IJCNN), 1992.
|
| 230 |
+
|
| 231 |
+
[46] Preetum Nakkiran. More data can hurt for linear regression: Sample-wise double descent. arXiv preprint arXiv:1912.07242, 2019.
|
| 232 |
+
|
| 233 |
+
[47] Tung Nguyen and Aditya Grover. Transformer neural processes: Uncertainty-aware meta learning via sequence modeling. arXiv preprint arXiv:2207.04179, 2022.
|
| 234 |
+
|
| 235 |
+
[48] Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. In-context learning and induction heads. Transformer Circuits Thread, 2022. https://transformer-circuits.pub/2022/in-context-learning-and-inductionheads/index.html.
|
| 236 |
+
|
| 237 |
+
[49] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning (ICML), 2018.
|
| 238 |
+
|
| 239 |
+
[50] 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, 2011.
|
| 240 |
+
|
| 241 |
+
[51] Jorge Pérez, Javier Marinkovic, and Pablo Barceló. On the turing completeness of modern ´ neural network architectures. arXiv preprint arXiv:1901.03429, 2019.
|
| 242 |
+
|
| 243 |
+
[52] Lovre Pesut. Who models the models that model models? an exploration of gpt-3’s in-context model fitting ability, 2022. URL https://www.alignmentforum.org/posts/c2RzFadrxkzyRAFXa/ who-models-the-models-that-model-models-an-exploration-of.
|
| 244 |
+
|
| 245 |
+
[53] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. OpenAI blog, 2018.
|
| 246 |
+
|
| 247 |
+
[54] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 2019.
|
| 248 |
+
|
| 249 |
+
[55] Jack W Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, et al. Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446, 2021.
|
| 250 |
+
[56] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. International Conference for Learning Representations (ICLR), 2017.
|
| 251 |
+
[57] Yasaman Razeghi, Robert L Logan IV, Matt Gardner, and Sameer Singh. Impact of pretraining term frequencies on few-shot reasoning. arXiv preprint arXiv:2202.07206, 2022.
|
| 252 |
+
[58] Frieda Rong. Extrapolating to unnatural language processing with gpt-3’s in-context learning: The good, the bad, and the mysterious), 2021. URL http://ai.stanford.edu/blog/ in-context-learning/.
|
| 253 |
+
[59] Ohad Rubin, Jonathan Herzig, and Jonathan Berant. Learning to retrieve prompts for in-context learning. arXiv preprint arXiv:2112.08633, 2021.
|
| 254 |
+
[60] Terence D Sanger. Neural network learning control of robot manipulators using gradually increasing task difficulty. IEEE transactions on Robotics and Automation, 1994.
|
| 255 |
+
[61] Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-learning with memory-augmented neural networks. In International conference on machine learning (ICML), 2016.
|
| 256 |
+
[62] Jürgen Schmidhuber. Evolutionary principles in self-referential learning, or on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universität München, 1987.
|
| 257 |
+
[63] Avi Schwarzschild, Eitan Borgnia, Arjun Gupta, Furong Huang, Uzi Vishkin, Micah Goldblum, and Tom Goldstein. Can you learn an algorithm? generalizing from easy to hard problems with recurrent networks. Neural Information Processing Systems (NeurIPS), 2021.
|
| 258 |
+
[64] Daniel Selsam, Matthew Lamm, B Benedikt, Percy Liang, Leonardo de Moura, David L Dill, et al. Learning a sat solver from single-bit supervision. In International Conference on Learning Representations (ICLR), 2018.
|
| 259 |
+
[65] Charlie Snell, Ruiqi Zhong, Dan Klein, and Jacob Steinhardt. Approximating how single head attention learns. arXiv preprint arXiv:2103.07601, 2021.
|
| 260 |
+
[66] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. Neural Information Processing Systems (NeurIPS), 2017.
|
| 261 |
+
[67] Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 2012.
|
| 262 |
+
[68] Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 1996.
|
| 263 |
+
[69] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Neural Information Processing Systems (NeurIPS), 2017.
|
| 264 |
+
[70] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Neural Information Processing Systems (NeurIPS), 2015.
|
| 265 |
+
[71] Gail Weiss, Yoav Goldberg, and Eran Yahav. Thinking like transformers. In International Conference on Machine Learning, 2021.
|
| 266 |
+
[72] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-theart natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations. Association for Computational Linguistics (ACL), 2020.
|
| 267 |
+
[73] Xiaoxia Wu, Ethan Dyer, and Behnam Neyshabur. When do curricula work? arXiv preprint arXiv:2012.03107, 2020.
|
| 268 |
+
[74] Sang Michael Xie, Aditi Raghunathan, Percy Liang, and Tengyu Ma. An explanation of in-context learning as implicit bayesian inference. In International Conference on Learning Representations (ICLR), 2022.
|
| 269 |
+
[75] Lin Xu, Frank Hutter, Holger H Hoos, and Kevin Leyton-Brown. Satzilla: portfolio-based algorithm selection for sat. Journal of artificial intelligence research, 2008.
|
| 270 |
+
[76] Shunyu Yao, Binghui Peng, Christos Papadimitriou, and Karthik Narasimhan. Self-attention networks can process bounded hierarchical languages. arXiv preprint arXiv:2105.11115, 2021.
|
| 271 |
+
[77] Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J Reddi, and Sanjiv Kumar. Are transformers universal approximators of sequence-to-sequence functions? arXiv preprint arXiv:1912.10077, 2019.
|
| 272 |
+
[78] Yi Zhang, Arturs Backurs, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, and Tal Wagner. Unveiling transformers with lego: a synthetic reasoning task. arXiv preprint arXiv:2206.04301, 2022.
|
| 273 |
+
[79] Zihao Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. Calibrate before use: Improving few-shot performance of language models. In International Conference on Machine Learning (ICML), 2021.
|
| 274 |
+
|
| 275 |
+
# Checklist
|
| 276 |
+
|
| 277 |
+
1. For all authors...
|
| 278 |
+
|
| 279 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 280 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 281 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] We don’t perceive any negative impacts beyond those of building large-scale models in general.
|
| 282 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 283 |
+
|
| 284 |
+
2. If you are including theoretical results...
|
| 285 |
+
|
| 286 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 287 |
+
|
| 288 |
+
3. If you ran experiments...
|
| 289 |
+
|
| 290 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Appendix A.
|
| 291 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Appendix A.
|
| 292 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 293 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Appendix A.
|
| 294 |
+
|
| 295 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 296 |
+
|
| 297 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 298 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 299 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 300 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 301 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 302 |
+
|
| 303 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 304 |
+
|
| 305 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 306 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 307 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/hGXij5rfiHw/hGXij5rfiHw.md
ADDED
|
@@ -0,0 +1,617 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DISCOVERING INVARIANT RATIONALES FOR GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Ying-Xin $\mathbf { W } \mathbf { u } ^ { \dagger }$ , Xiang Wang∗ †, An Zhang§, Xiangnan He†, Tat-Seng Chua§
|
| 4 |
+
|
| 5 |
+
† University of Science and Technology of China
|
| 6 |
+
§ National University of Singapore
|
| 7 |
+
{wuyxinsh, xiangwang1223}@gmail.com,
|
| 8 |
+
an zhang@nus.edu.sg, xiangnanhe@gmail.com, dcscts@nus.edu.sg
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Intrinsic interpretability of graph neural networks (GNNs) is to find a small subset of the input graph’s features — rationale — which guides the model prediction. Unfortunately, the leading rationalization models often rely on data biases, especially shortcut features, to compose rationales and make predictions without probing the critical and causal patterns. Moreover, such data biases easily change outside the training distribution. As a result, these models suffer from a huge drop in interpretability and predictive performance on out-of-distribution data. In this work, we propose a new strategy of discovering invariant rationale (DIR) to construct intrinsically interpretable GNNs. It conducts interventions on the training distribution to create multiple interventional distributions. Then it approaches the causal rationales that are invariant across different distributions while filtering out the spurious patterns that are unstable. Experiments on both synthetic and realworld datasets validate the superiority of our DIR in terms of interpretability and generalization ability on graph classification over the leading baselines. Code and datasets are available at https://github.com/Wuyxin/DIR-GNN.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
The eye-catching success in graph neural networks (GNNs) (Hamilton et al., 2017; Kipf & Welling, 2017; Dwivedi et al., 2020) provokes the rationalization task, answering “What knowledge drives the model to make certain predictions?”. The goal of selective rationalization (aka. feature attribution) (Chang et al., 2020; Ying et al., 2019; Luo et al., 2020; Wang et al., 2021c) is to find a small subset of the input’s graph features — rationale — which best guides or explains the model prediction. Discovering the rationale in a model helps audit its inner workings and justify its predictions. Moreover, it has tremendous impacts on real-world applications, such as finding functional groups to shed light on protein structure prediction (Senior et al., 2020).
|
| 17 |
+
|
| 18 |
+
Two research lines of rationalization have recently emerged in GNNs. Post-hoc explainability (Ying et al., 2019; Luo et al., 2020; Yuan et al., 2021; Wang et al., 2021c) attributes a model’s prediction to the input graph with a separate explanation method, while intrinsic interpretability (Velickovi ˇ c et al. ´ , 2018; Gao & Ji, 2019) incorporates a rationalization module into the model to make transparent predictions. Here we focus on intrinsically interpretable GNNs. Among them, graph attention (Velickovi ˇ c et al. ´ , 2018) and pooling (Lee et al., 2019; Knyazev et al., 2019; Gao & Ji, 2019; Ranjan et al., 2020) operators prevail, which work as a computational block of a GNN to generate soft or hard masks on the input graph. They cast the learning paradigm of GNN as minimizing the empirical risk with the masked subgraphs, which are regarded as rationales to guide the model predictions.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: Base Distribution of House Motif.
|
| 22 |
+
|
| 23 |
+
Despite the appealing nature, recent studies (Chang et al., 2020; Knyazev et al., 2019) show that the current rationalization methods are prone to exploit data biases as shortcuts to make predictions and compose rationales. Typically, shortcuts result from confounding factors, sampling biases, and artifacts in the training data. Considering Figure 1, when the most bases of House-motif graphs are Tree, a GNN does not need to learn the correct function to reach high accuracy for the motif type. Instead, it is much easier to learn from the statistical shortcuts linking the bases Tree with the most occurring motifs House. Unfortunately, when facing with out-of-distribution (OOD) data, such methods generalize poorly since the shortcuts are changed. Hence, such shortcut-involved rationales hardly reveal the truly critical subgraphs for the predicted labels, being at odds with the true reasoning process that underlies the task of interest (Teney et al., 2020) and human cognition (Alvarez-Melis & Jaakkola, 2017).
|
| 24 |
+
|
| 25 |
+
Here we ascribe the failure on OOD data to the inability to identify causal patterns, which are stable to distribution shift. Motivated by recent studies on invariant learning (IL) (Arjovsky et al., 2019; Krueger et al., 2021; Chang et al., 2020; Buhlmann ¨ , 2018), we premise different distributions elicit different environments of data generating process. We argue that the causal patterns to the labels remain stable across environments, while the relations between the shortcut patterns and the labels vary. Such environment-invariant patterns are more plausible and qualified as rationales.
|
| 26 |
+
|
| 27 |
+
Aiming to identify rationales that capture the environment-invariant causal patterns, we formalize a learning strategy, Discovering Invariant Rationales (DIR), for intrinsically interpretable GNNs. One major problem is how to get multiple environments from a standard training set. Differing from the heterogeneous setting (Buhlmann ¨ , 2018) of existing IL methods, where environments are observable and attainable, DIR does not assume prophets about environments. It instead generates distribution perturbations by causal intervention — interventional distributions (Tian et al., 2006; Pearl et al., 2016) — to instantiate environments and further distinguish the causal and non-causal parts.
|
| 28 |
+
|
| 29 |
+
Guided by this idea, our DIR strategy consists of four modules: a rationale generator, a distribution intervener, a feature encoder, two classifiers. Specifically, the rationale generator learns to split the input graph into causal and non-causal subgraphs, which are respectively encoded by the encoder into representations. Then, the distribution intervener conducts the causal interventions on the non-causal representations to create perturbed distributions, with which we can infer the invariant causal parts. Then, the two classifiers are respectively built upon the causal and non-causal parts to generate the joint prediction, whose invariant risk is minimized across different distributions. On one synthetic and three real datasets, extensive experiments demonstrate the generalization ability of DIR to surpass current state-of-the-art IL methods (Arjovsky et al., 2019; Krueger et al., 2021; Sagawa et al., 2019), and the interpretability of DIR to outperform the attention- and pooling-based rationalization methods (Velickovi ˇ c et al. ´ , 2018; Gao & Ji, 2019). Our main contributions are:
|
| 30 |
+
|
| 31 |
+
• We propose a novel invariant learning algorithm, DIR, for inherent interpretable models, improving the generalization ability and is suitable for any deep models. • We offer causality theoretic analysis to guarantee the preeminence of DIR. • We provide the implementation of DIR for graph classification tasks, which consistently achieves excellent performance on three datasets with various generalization types.
|
| 32 |
+
|
| 33 |
+
# 2 INVARIANT RATIONALE DISCOVERY
|
| 34 |
+
|
| 35 |
+
With a causal look at the data-generating process, we formalize the principle of discovering invariant rationales, which guides our discovery strategy. Throughout the paper, upper-cased letters like $G$ denote random variables, while lower-case letters like $g$ denote deterministic value of variables.
|
| 36 |
+
|
| 37 |
+
# 2.1 CAUSAL VIEW OF DATA-GENERATING PROCESS
|
| 38 |
+
|
| 39 |
+
Generating rationales for transparent predictions requires understanding the actual mechanisms of the task of interest. Without loss of generality, we focus on the graph classification task and present a causal view of the data-generating process behind this task. Here we formalize the causal view as a Structure Causal Model (SCM) (Pearl et al., 2016; Pearl, 2000) by inspecting on the causalities among four variables: input graph $G$ , ground-truth label $Y$ , causal part $C$ , non-causal part $S$ . Figure 2a illustrates the SCM, where each link denotes a causal relationship between two variables.
|
| 40 |
+
|
| 41 |
+
• $C \right. G \left. S$ . The input graph $G$ consists of two disjoint parts: the causal part $C$ and the non-causal part $S$ , such as the House motif and the Tree base in Figure 1.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2: (a) Causal view of data-generating process; (b) Illustration of interventional distributions.
|
| 45 |
+
|
| 46 |
+
• $C Y$ . By “causal part”, we mean $C$ is the only endogenous parent to determine the groundtruth label $Y$ . Taking the motif-base example in Figure 1 again, $C$ is the oracle rationale, which perfectly explains why the graph is labeled as $Y$ .
|
| 47 |
+
|
| 48 |
+
• $C \ \ \ S$ . This dashed arrow indicates additional probabilistic dependencies (Pearl, 2000; Pearl et al., 2016) between $C$ and $S$ . We consider three typical relationships here: (1) $C$ is independent of $S$ , i.e., $C \perp \perp S$ ; (2) $C$ is the direct cause of $S$ , i.e., $C S$ ; and (3) There exists a common cause $E$ , i.e., $C \left. E \right. S$ . See Appendix B for the corresponding examples.
|
| 49 |
+
|
| 50 |
+
$C \ \mathrm { ~ \_ ~ } M \ C$ can create spurious correlations between the non-causal part $S$ and the ground-truth label $Y$ . Assuming $C S$ , $C$ is a confounder between $S$ and $Y$ , which opens a backdoor path $S \left. C \right. Y$ , thus making $S$ and $Y$ spuriously correlated (Pearl et al., 2016). We systematize such spurious correlations as $Y \not \vdash S$ . Wherein, we make feature induction assumption on $S$ to avoid the confusion of the induced subset of $S$ between $C$ . See Appendix C for the formal assumption. Furthermore, data collected from different environments exhibit various spurious correlations (Teney et al., 2020; Arjovsky et al., 2019), e.g., one mostly picks House motifs with Tree bases as the training data, while another selects House motifs with Wheel bases as the testing data. Hence, such spurious correlations are unstable and variant across different distributions.
|
| 51 |
+
|
| 52 |
+
# 2.2 TASK FORMALIZATION OF INVARIANT RATIONALIZATION
|
| 53 |
+
|
| 54 |
+
Oracle Rationale. With the causal theory (Pearl et al., 2016; Pearl, 2000), for each variable $X$ in a SCM, there exists a directed link from each of its parent variables $P A ( X )$ to $X$ , if and only if the causal mechanism $X = f _ { X } ( P A ( X ) , \epsilon _ { X } )$ persists, where $\epsilon _ { X }$ |= $P A ( X )$ is the exogenous noise of $X$ . For simplicity, we omit the exogenous noise and simplify it as $X = f _ { X } ( P A ( X ) )$ . Hence, there exist a function $f _ { Y } : C \to Y$ in our SCM, where the “oracle rationale” $C$ satisfies:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
Y = f _ { Y } ( C ) , \quad Y \bot S \mid C ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $Y \bot \bot S \mid C$ indicates that $C$ shields $Y$ from the influence of $S$ , making the causal relationship $C Y$ invariant across different $S$ .
|
| 61 |
+
|
| 62 |
+
Rationalization. In general, only the pairs of input $G$ and label $Y$ are observed during training, while neither oracle rationale $C$ nor oracle structural equation model $f _ { Y }$ is available. The absence of oracles calls for the study on intrinsic interpretability. We systematize an intrinsically-interpretable GNN as a combination of two modules, i.e., $h = h _ { \hat { Y } } \circ h _ { \tilde { C } }$ , where $h _ { \tilde { C } } : G \to \tilde { C }$ discovers rationale $\tilde { C }$ from the observed $G$ , and $h _ { \hat { Y } } : \tilde { C } \to \hat { Y }$ outputs the prediction $\hat { Y }$ to approach $Y$ . Distinct from $C$ and $Y$ which are the variables in the causal mechanisms, $\tilde { C }$ and $\hat { Y }$ represent the variables in the modeling process to approximate $C$ and $Y$ . To optimize these modules, most of current intrinsicallyinterpretable GNNs (Velickovi ˇ c et al. ´ , 2018; Lee et al., 2019; Knyazev et al., 2019; Gao & Ji, 2019; Ranjan et al., 2020) adopt the learning strategy of minimizing the empirical risk:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\operatorname* { m i n } _ { h _ { \tilde { C } } , h _ { \hat { Y } } } \mathcal { R } ( h _ { \hat { Y } } \circ h _ { \tilde { C } } ( G ) , Y ) ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\mathcal { R } ( \cdot , \cdot )$ is the risk function, which can be the cross-entropy loss. Nevertheless, this learning strategy relies heavily on the statistical associations between the input features and labels, and can potentially exhibit non-causal rationales.
|
| 69 |
+
|
| 70 |
+
Invariant Rationalization. We ascribe the limitation to ignoring $Y \bot \bot S \mid C$ in Equation 1, which is crucial to refine the causal relationship $C Y$ that is invariant across different $S$ . By introducing this independence, we formalize the task of invariant rationalization as:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname* { m i n } _ { h _ { \tilde { C } } , h _ { \hat { Y } } } \mathcal { R } ( h _ { \hat { Y } } \circ h _ { \tilde { C } } ( G ) , Y ) , \quad \mathrm { s . t . ~ } Y \bot \tilde { S } \mid \tilde { C } ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where ${ \tilde { S } } = G \backslash { \tilde { C } }$ is the complement of $\tilde { C }$ . This formulation encourages the rationale $\tilde { C }$ seeking the patterns that are stable across different distributions, while discarding the unstable patterns.
|
| 77 |
+
|
| 78 |
+
# 2.3 PRINCIPLE & LEARNING STRATEGY OF DIR
|
| 79 |
+
|
| 80 |
+
Interventional Distribution. However, it is difficult to recover the oracle rationale from the joint distribution over the inputs and labels — that is, the causal and non-causal relations are hardly distinguished from each other. We get inspirations from invariant learning (Arjovsky et al., 2019; Krueger et al., 2021; Chang et al., 2020), which constructs different environments to infer the invariant features or predictors. To obtain the environments, previous studies mostly partition the training set by prior knowledge (Teney et al., 2020) or adversarial environment inference (Creager et al., 2021; Wang et al., 2021b). Different from partitioning the training data, we do not assume prophets about environments but introduce the interventional distribution (Tian et al., 2006; Pearl et al., 2016) instead to model the DIR task. Specifically, on the top of our SCM, we generate $s$ -interventional distribution by doing intervention $d o ( S = s )$ on $S$ , which removes every link from the parents $P A ( S )$ to the variable $S$ and fixes $S$ to the specific value $s$ . By stratifying different values $\mathbb { S } = \{ s \}$ , we can obtain multiple $s$ -interventional distributions.
|
| 81 |
+
|
| 82 |
+
With interventional distributions, we propose the principle of discovering invariant rationale (DIR) to identify a rationale $\tilde { C }$ whose relationship with the label $Y$ is stable across different distributions.
|
| 83 |
+
|
| 84 |
+
Definition 1 (DIR Principle) An intrinsically-interpretable model $h$ satisfies the DIR principle if it
|
| 85 |
+
|
| 86 |
+
1. minimizes all $s$ -interventional risks: $\mathbb { E } _ { s } [ \mathcal { R } ( h ( G ) , Y | d o ( S = s ) ) ]$ , and simultaneously
|
| 87 |
+
|
| 88 |
+
2. minimizes the variance of various $s$ -interventional risks: $V a r _ { s } ( \{ \mathcal { R } ( h ( G ) , Y | d o ( S = s ) ) \} )$ , where the $s$ -interventional risk is defined over the $s$ -interventional distribution for specific $s \in \mathbb { S } .$ .
|
| 89 |
+
|
| 90 |
+
Guided by the proposed principle, we design the learning strategy of DIR as:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r } { \operatorname* { m i n } \mathcal { R } _ { \mathrm { D I R } } = \mathbb { E } _ { s } [ \mathcal { R } ( h ( G ) , Y | d o ( S = s ) ) ] + \lambda \mathsf { V a r } _ { s } ( \{ \mathcal { R } ( h ( G ) , Y | d o ( S = s ) ) \} ) , } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $\mathcal { R } \left( h ( G ) , Y \mid d o ( S = s ) \right)$ computes the risk under the $s$ -interventional distribution, which we will elaborate in Section 2.4. $\mathrm { V a r } ( \cdot )$ calculates the variance of risks over different $s$ -interventional distributions; $\lambda$ is a hyper-parameter to control the strength of invariant learning.
|
| 97 |
+
|
| 98 |
+
Justification. We theoretically justify the DIR principle’s ability to discover invariant rationales. Specifically, Theorem 1 shows that the oracle model $f _ { Y }$ respects the DIR principle. Moreover, we suggest that $C$ can be inferred by making the intrinsically interpretable model $h$ conform to the DIR principle under the uniqueness condition $\cdot e f .$ Corollary 1). We leave the detailed proofs in Appendix C due to the limited space. By making the distribution-relevant risks indifferent while pursuing low risks, the DIR principle is able to discover the invariant rationales $\tilde { C }$ as the approximation of the oracle rationales $C$ , while encouraging $h _ { \hat { Y } }$ approaching the oracle model $f _ { Y }$ .
|
| 99 |
+
|
| 100 |
+
# 2.4 DIR-GUIDED IMPLEMENTATION OF INTRINSICALLY-INTERPRETABLE GNNS
|
| 101 |
+
|
| 102 |
+
With the DIR principle and objective, we present how to implement the intrinsically-interpretable GNNs. We summarize the key notations of this section in Appendix A for clarity. Following Equation 2, a model $h$ with intrinsic interpretability consists of two modules: $h = h _ { \hat { Y } } \circ h _ { \tilde { C } }$ , where $h _ { \tilde { C } }$ is to extract a possible rationale, and $h _ { \hat { Y } }$ is to make prediction based on the rationale. Moreover, to establish the $s$ -interventional distributions, we design an additional module to do the interventions. In a nutshell, our framework consists of four components, as Figure 3 shows.
|
| 103 |
+
|
| 104 |
+
Rationale Generator. It aims to split the input graph instance $g$ into two subgraphs: causal part $\tilde { c }$ and non-causal part s˜. Specifically, given an input graph instance $\boldsymbol { g } = ( \boldsymbol { \nu } , \mathcal { E } )$ with the node set $\nu$ and the edge set $\mathcal { E }$ , its adjacency matrix is $\mathbf { A } \in \{ 0 , 1 \} ^ { | \mathcal { V } | \times | \mathcal { V } | }$ , where ${ \bf A } _ { i j } = 1$ denotes the edge from node $i$ to node $j$ , and ${ \bf A } _ { i j } = 0$ otherwise. The rationale generator first adopts a GNN to generate the mask matrix $\mathbf { M } \in \mathbb { R } ^ { | \nu | \times | \nu | }$ on A, where mask $\mathbf { M } _ { i j }$ indicates the importance of edge $\mathbf { A } _ { i j }$ :
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 3: DIR Implementation on GNNs, which includes a rationale generator, a distribution intervener, an encoder and two classifiers. For the inference, we only use $\hat { y } _ { \tilde { c } }$ as the prediction.
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathbf { Z } = \mathbf { G } \mathbf { N } \mathbf { N } _ { 1 } ( g ) , \quad \mathbf { M } _ { i j } = \sigma ( \mathbf { Z } _ { i } ^ { \top } \mathbf { Z } _ { j } ) ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\sigma ( \cdot )$ is the sigmoid function and $\mathbf { Z } \in \mathbb { R } ^ { | \nu | \times d }$ summarizes the $d$ -dimensional representations of all nodes. The generator then selects the edges with the highest masks to construct the rationale $\tilde { c }$ and collects $\tilde { c }$ ’s complement as $\tilde { s }$ , as follows:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\begin{array} { r } { \mathcal { E } _ { \tilde { c } } = \mathrm { T o p } _ { r } ( \mathbf { M \odot A } ) , \quad \mathcal { E } _ { \tilde { s } } = \mathrm { T o p } _ { 1 - r } ( ( 1 - \mathbf { M } ) \odot \mathbf { A } ) , } \end{array}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\mathcal { E } _ { \tilde { c } }$ and $\mathcal { E } _ { \tilde { s } }$ are the edge sets of $\tilde { c }$ and $\tilde { s }$ , respectively; $\mathrm { T o p } _ { r } ( \cdot )$ selects the top- $K$ edges with $K = r \times | { \mathcal { E } } |$ , and $r$ is the hyper-parameter (e.g., $4 0 \%$ ); $\odot$ is the element-wise product. Having obtained the edge sets, we can distill the nodes appearing in the edges to establish $\tilde { c }$ and $\tilde { s }$ .
|
| 120 |
+
|
| 121 |
+
Distribution Intervener. It targets at creating interventional distributions. Formally, it first collects the non-causal part of all the instances into a memory bank as $\tilde { \mathbb { S } }$ . It next samples a memory $\tilde { s } _ { i } \in \tilde { \mathbb { S } }$ to conduct the intervention $d o ( S = \tilde { s } _ { i } )$ , replacing the complement of the critical subgraph $\tilde { c } _ { j }$ at hand and constructing an intervened pair $( \tilde { c } _ { j } , \tilde { s } _ { i } )$ , where $i , j$ are indices.
|
| 122 |
+
|
| 123 |
+
Graph Encoder & Classifiers . Here we represent $h _ { \hat { Y } }$ as a combination of a graph encoder and two classifiers. Specifically, it employs another GNN encoder on $\tilde { c }$ to generate node representations $\mathbf { Z } _ { \tilde { c } } ~ \in ~ \mathbb { R } ^ { | \mathcal { V } | \times d }$ , and then combines them as graph representation $\mathbf { H } _ { \tilde { c } } \in \mathbb { R } ^ { D }$ via a global pooling operator, e.g., average pooling. Then it uses a classifier $\Phi _ { c }$ to project the graph representation into a probability distribution over class labels $\hat { y } _ { \tilde { c } }$ . More formally, the process is as follows:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathbf { Z } _ { \widetilde { c } } = \mathbf { G } \mathbf { N } \mathbf { N } _ { 2 } ( \widetilde { c } ) , \quad \mathbf { H } _ { \widetilde { c } } = \mathbf { P o o l i n g } ( \mathbf { Z } _ { \widetilde { c } } ) , \quad \widehat { y } _ { \widetilde { c } } = \Phi _ { c } ( \mathbf { H } _ { \widetilde { c } } ) .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Analogously, we can obtain $\hat { y } _ { \tilde { s } }$ for $\tilde { s }$ via the shared encoder and another classifier $\Phi _ { s }$ . $\hat { y } _ { \tilde { c } }$ is the prediction based merely on the causal part $\tilde { c }$ , while $\hat { y } _ { \tilde { s } }$ measures the predictive power of the intervened part s˜. Inspired by Cadene et al. \` (2019), we formulate the joint prediction $\hat { y }$ under the intervention $d o ( S = \tilde { s } )$ as $\hat { y } _ { \tilde { c } }$ masked by $\hat { y } _ { \tilde { s } }$ :
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\hat { y } = \hat { y } _ { \tilde { c } } \odot \sigma ( \hat { y } _ { \tilde { s } } ) ,
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where the sigmoid function adjusts the output logits of $\tilde { c }$ to compensate for the spurious biases. In Appendix E, we present examples of how this operation helps discover the causal part.
|
| 136 |
+
|
| 137 |
+
Optimization. Having established the prediction $\hat { y }$ of an instance $g$ under the intervention $d o ( S =$ $\tilde { s }$ ), we are capable of getting the $\tilde { s }$ -interventional risk similar as Equation 4 as follows:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\mathcal { R } ( h ( G ) , Y | d o ( S = \tilde { s } ) ) = \mathbb { E } _ { ( g , y ) \in \mathcal { O } , S = \tilde { s } , C = h _ { \tilde { C } } ( g ) } l ( \hat { y } , y ) ,
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
where $( g , y ) \in \mathcal { O }$ is a pair of graph instance $g$ and its ground-truth label $y$ from the training set $\mathcal { O }$ ; $l ( \cdot )$ denotes the loss function on a single instance. Moreover, we define the loss for $\Phi _ { s }$ module as:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\mathcal { R } _ { { \tilde { S } } } = \mathbb { E } _ { ( g , y ) \in \mathcal { O } , { \tilde { s } } = g / h _ { \tilde { C } } ( g ) } l ( \hat { y } _ { \tilde { s } } , y )
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
Specifically, $\mathcal { R } _ { \tilde { S } }$ is only backpropagated to the classifier $\Phi _ { s }$ and we set apart the other components from its backpropagation to avoid interference with representation learning. Thus, this loss promotes the $\tilde { S }$ -only branch to learn spurious biases given the non-causal features only. Overall, we can jointly optimize these components via the DIR objective and shortcut loss, i.e.,
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r } { \operatorname* { m i n } _ { \phi _ { s } } \mathcal { R } _ { { \tilde { S } } } + \operatorname* { m i n } _ { \gamma , \theta , \phi _ { c } } \mathcal { R } _ { \mathrm { D I R } } . } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where $\gamma , \theta$ and $\left( \phi _ { c } , \phi _ { s } \right)$ are the parameters of the generator, encoder and two classifiers. While in the inference phase, we yield $\tilde { c }$ and $\hat { y } _ { \tilde { c } }$ as the causal rationale and the causal prediction of a testing graph $g$ , which exclude the influence of the non-causal part $\tilde { s }$ .
|
| 156 |
+
|
| 157 |
+
# 3 EXPERIMENTS
|
| 158 |
+
|
| 159 |
+
In this section, we conduct extensive experiments to answer the research questions:
|
| 160 |
+
|
| 161 |
+
• RQ1: How effective is DIR in discovering causal features and improving model generalization? • RQ2: What are the learning patterns and insights of DIR training? Especially, how does invariant rationalization help to improve generalization?
|
| 162 |
+
|
| 163 |
+
# 3.1 SETTINGS
|
| 164 |
+
|
| 165 |
+
Datasets. We use one synthetic dataset and three real datasets of graph classification tasks. Different GNNs are used in different datasets to achieve DIR and early stopping is exploited during training. Here we briefly introduce the datasets, while the details of dataset statistics, deployed GNNs, and training process are summarized in Appendix D.
|
| 166 |
+
|
| 167 |
+
• Spurious-Motif is a synthetic dataset created by following Ying et al. (2019), which involves 18, 000 graphs. Each graph is composed of one base (Tree, Ladder, Wheel denoted by $S = 0 , 1 , 2$ respectively) and one motif (Cycle, House, Crane denoted by $C = 0 , 1 , 2$ , respectively). The ground-truth label $Y$ is determined by $C$ solely. Moreover, we manually construct false relations of different degrees between $S$ and label $Y$ in the training set. Specifically, in the training set, we sample each motif from a uniform distribution, while the distribution of its base is determined by $\begin{array} { r } { P ( \hat { S } ) = b \times \mathbb { I } ( S = C ) + \frac { 1 - b } { 2 } \times \mathbb { I } ( S \neq C ) } \end{array}$ . We manipulate $b$ to create Spurious-Motif datasets of distinct biases. In the testing set, the motifs and bases are randomly attached to each other. Besides, we include graphs with large bases to further magnify the distribution gaps. • MNIST-75sp (Knyazev et al., 2019) converts the MNIST images into 70, 000 superpixel graphs with at most 75 nodes each graph. The nodes in the graphs are superpixels, while edges are the spatial distance between the nodes. Every graph is labeled as one of 10 classes. Random noises are added to nodes’ features in the testing set. • Graph-SST2 (Yuan et al., 2020; Socher et al., 2013) Each graph is labeled by its sentence sentiment and consists of nodes representing tokens and edges indicating node relations. Graphs are split into different sets according to their average node degree to create dataset shifts. • Molhiv (OGBG-Molhiv) (Hu et al., 2020; 2021; Wu et al., 2017) is a molecular property prediction dataset consisting of molecule graphs, where nodes are atoms, and edges are chemical bonds. Each graph is labeled according to whether a molecule inhibits HIV replication or not.
|
| 168 |
+
|
| 169 |
+
Baselines. We thoroughly compare DIR with Empirical Risk Minimization (ERM) and two classes of baselines:
|
| 170 |
+
|
| 171 |
+
• Interpretable Baselines: Graph Attention (Velickovi ˇ c et al. ´ , 2018) and graph pooling operations including ASAP (Ranjan et al., 2020), Top- $k$ Pool (Gao & Ji, 2019) and SAG Pool (Lee et al., 2019). We use their generated masks on graph structures as rationales. We also include GSN (Bouritsas et al., 2020), a topologically-aware message passing scheme which enriches GNNs with interpretable structural features. • Robust/Invariant Learning Baselines: Group DRO (Sagawa et al., 2019), IRM (Arjovsky et al., 2019), V-REx (Krueger et al., 2021). This class of algorithms improves the robustness and generalization for GNNs, which helps the models better generalize in unseen groups or out-ofdistribution datasets. We use random groups or partitions during the model training.
|
| 172 |
+
|
| 173 |
+
We also include an ablation model of DIR, DIR-Var, which sets $\lambda = 0$ , i.e., discards the variance term in $\mathcal { R } _ { \mathrm { D I R } }$ , to show the effectiveness of the variance regularization in the DIR objective.
|
| 174 |
+
|
| 175 |
+
Metrics. We use ROC-AUC for Molhiv and ACC for the other three datasets. Moreover, for Spurious-Motif dataset, we use the precision metric to evaluate the coincidence between model rationales and the ground-truth rationales, and validate the interpretability ability quantitatively.
|
| 176 |
+
|
| 177 |
+
Table 1: Performance on the Synthetic Dataset and Real Datasets. In Spurious-Motif dataset, we color brown for the results lower than ERM, where $b$ is the indicator of the confounding effect.
|
| 178 |
+
|
| 179 |
+
<table><tr><td colspan="5">Spurious-Motif</td><td rowspan="2">MNIST-75sp</td><td rowspan="2">Graph-SST2</td><td rowspan="2">Molhiv</td></tr><tr><td></td><td>Balance</td><td>b=0.5</td><td>b=0.7</td><td>b=0.9</td></tr><tr><td>ERM</td><td>42.99±1.93</td><td>39.69±1.73</td><td>38.93±1.74</td><td>33.61±1.02</td><td>12.71±1.43</td><td>81.44±0.59</td><td>76.20±1.14</td></tr><tr><td>Attention</td><td>43.07±2.55</td><td>39.42±1.50</td><td>37.41±0.86</td><td>33.46±0.43</td><td>15.19±2.62</td><td>81.57±0.71</td><td>75.84±1.33</td></tr><tr><td>ASAP</td><td>44.44±8.19</td><td>44.25±6.87</td><td>39.19±4.39</td><td>31.76±2.89</td><td>15.54±1.87</td><td>81.57±0.84</td><td>73.81±1.17</td></tr><tr><td>Top-k Pool</td><td>43.43±8.79</td><td>41.21±7.05</td><td>40.27±7.12</td><td>33.60±0.91</td><td>14.91±3.25</td><td>79.78±1.35</td><td>73.01±1.65</td></tr><tr><td>SAG Pool</td><td>45.23±6.76</td><td>43.82±6.32</td><td>40.45±7.50</td><td>33.60±1.18</td><td>14.31±2.44</td><td>80.24±1.72</td><td>73.26±0.84</td></tr><tr><td>GSN</td><td>43.18±5.65</td><td>34.67±1.21</td><td>34.03±1.69</td><td>32.60±1.75</td><td>19.03±2.39</td><td>82.54±1.16</td><td>74.53±1.90</td></tr><tr><td>Group DRO</td><td>41.51±1.11</td><td>39.38±0.93</td><td>39.32±2.23</td><td>33.90±0.52</td><td>15.13±2.83</td><td>81.29±1.44</td><td>75.44±2.70</td></tr><tr><td>V-REx</td><td>42.83±1.59</td><td>39.43±2.69</td><td>39.08±1.56</td><td>34.81±2.04</td><td>18.92±1.41</td><td>81.76±0.08</td><td>75.62±0.79</td></tr><tr><td>IRM</td><td>42.26±2.69</td><td>41.30±1.28</td><td>40.16±1.74</td><td>35.12±2.71</td><td>18.62±1.22</td><td>81.01±1.13</td><td>74.46±2.74</td></tr><tr><td>DIR-Var</td><td>45.87±2.61</td><td>43.81±1.93</td><td>42.69±1.77</td><td>37.12±1.56</td><td>17.74±4.17</td><td>81.74±0.89</td><td>76.05±0.86</td></tr><tr><td>DIR</td><td>47.03±2.46</td><td>45.50±2.15</td><td>43.36±1.64</td><td>39.87±0.56</td><td>20.36±1.78</td><td>83.29±0.53</td><td>77.05±0.57</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 2: Precision@5 on Spurious-Motif.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Model</td><td>Balance</td><td>b=0.5</td><td>b=0.7</td><td>b=0.9</td></tr><tr><td>Attention</td><td>0.183±0.018</td><td>0.183±0.130</td><td>0.182±0.014</td><td>0.134±0.013</td></tr><tr><td>ASAP</td><td>0.187±0.030</td><td>0.188±0.023</td><td>0.186±0.027</td><td>0.121±0.021</td></tr><tr><td>Topk Pool</td><td>0.215±0.061</td><td>0.207±0.057</td><td>0.212±0.056</td><td>0.148±0.018</td></tr><tr><td>SAG Pool</td><td>0.212±0.033</td><td>0.198±0.062</td><td>0.201±0.064</td><td>0.136±0.014</td></tr><tr><td>DIR</td><td>0.257±0.014</td><td>0.255±0.016</td><td>0.247±0.012</td><td>0.192±0.044</td></tr></table>
|
| 184 |
+
|
| 185 |
+
# 3.2 MAIN RESULTS (RQ1)
|
| 186 |
+
|
| 187 |
+
To fairly compare the methods, we train each model under the same training settings as described in Appendix D. The overall results are summarized Table 1, and we have the following observations:
|
| 188 |
+
|
| 189 |
+
1. DIR has better generalization ability than the baselines. DIR outperforms the baselines consistently by a large margin. Specifically, for MNIST-75sp dataset, DIR surpasses ERM by $7 . 6 5 \%$ and ASAP by $4 . 8 2 \%$ . Although structure features are shown to be helpful in mitigating feature distribution shift, DIR still performs better than GSN. For Graph-SST2 and Molhiv, DIR achieves the highest performance with low variance. For Spurious-Motif, DIR outstrips IRM averagely by $4 . 2 3 \%$ and SAG by $3 . 1 6 \%$ across different degrees of spurious bias. Such improvements strongly validate that DIR can generalize better in various environments.
|
| 190 |
+
|
| 191 |
+
2. DIR is consistently effective under different bias degrees, while the baselines easily fail. For interpretable baselines, Attention fails to make salient improvements when bias exists, and pooling methods also fall through under severe bias. This is empirically in line with our presumption that GNNs are easily biased to latch on spurious relations or non-causal features and thus generalize poorly in OOD data. For robust/invariant learning baselines, IRM underperforms ERM when $b$ is small. This evidence is accordant with the conclusion in Ahuja et al. (2021) that IRM is guaranteed to be close to the desired OOD solutions when confounders exist, while it has no obvious advantage to ERM under covariate shift. Moreover, Group DRO and V-REx follow a similar pattern. In contrast, DIR works well in various scenarios. We credit such reliability to the rationales discovery from which the causal features $C$ are potentially extracted, and the relation $C Y$ learned by the GNNs is invariant across the distribution changes in the testing set.
|
| 192 |
+
|
| 193 |
+
3. Data augmentation by intervention is beneficial while the variance regularization further boosts model performance. Interestingly, the ablation model DIR-Var has already exceeded some of the baselines. We attribute such improvement to data augmentation via interventional distributions. On top of DIR-Var, DIR improves the model performance by averagely $1 . 5 7 \%$ in Spurious-Motif and $2 . 6 2 \%$ in MNIST-75sp. This suggests that the variance regularization demands a stronger invariance condition and is instructive for searching causal features.
|
| 194 |
+
|
| 195 |
+
4. DIR has better intrinsic interpretability than the baselines. In Table 2, we report intrinsic interpretable models’ performance $w . r . t .$ Precision $\textcircled { \alpha } 5$ . From the consistent improvements over the baselines, we find DIR has an advantage in discovering causal features. And the performance gap between DIR and the baselines becomes more significant when the bias increases.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
|
| 201 |
+
(a) Training rationale: Positive sentiment.
|
| 202 |
+
|
| 203 |
+
(b) Training rationale: Negative sentiment.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
(d) Testing rationale: Negative sentiment.
|
| 209 |
+
|
| 210 |
+
(c) Testing rationale: Positive sentiment.
|
| 211 |
+
|
| 212 |
+
Figure 4: Visualization of DIR Rationales. Each graph shows a comment, e.g., “a majestic achievement, an epic of astonishing grandeur” in (a), where rationales are highlighted by deep colors.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
|
| 216 |
+
(a) The first two subfigures show the training curves w.r.t. variance penalty and precision, on Spurious-Motif. ① ② ③ The last three subfigures present the rationale distributions of the inspection points, which are visualized by t-SNE (van der Maaten, 2008).
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
Figure 5: Two-stage Training Dynamics of DIR.
|
| 220 |
+
|
| 221 |
+
(b) The first three subfigures present the training curves w.r.t. variance penalty and ACC on MNIST-75sp, while the last three illustrate the curves w.r.t. variance penalty and AUC-ROC on Molhiv.
|
| 222 |
+
|
| 223 |
+
# 3.3 IN-DEPTH STUDY (RQ2)
|
| 224 |
+
|
| 225 |
+
We empirically analyze the DIR’s properties which hopefully give insights into its mechanisms and can be instructive for the existing training paradigms of deep models.
|
| 226 |
+
|
| 227 |
+
Rationale Visualization. Towards an intuitive understanding of DIR, we first present some cases of the discovered rationale for Graph-SST2 in Figure 4. DIR is able to emphasize the tokens that directly result in the sentences’ positive or negative sentiments, which are reliable and faithful rationales. Specifically, DIR highlights the positive words “majestic achievement” and “astonishing grandeur” in Figure 4a and underscores the negative words “worst dialogue” in Figure $\cdot$ as the rationales, which are clearly salient for the positive and negative sentiments, respectively. Furthermore, DIR can focus persistently on the causal features for OOD testing data. For example, it selects surprisingly engrossing and “admittedly middling” in Figures $_ \mathrm { 4 c }$ and 4d, respectively. This again validates the effectiveness of DIR: (1) $h _ { \tilde { C } }$ is well-learned to distinguish causal and non-causal features under various interventional distributions; and (2) $h _ { \tilde { Y } }$ conducts message-passing on the highlighted rationales, extracts the graph representations, and finally outputs the predictions with high accuracy. See Appendix F.1 for more examples in Graph-SST2 and Spurious-Motif datasets.
|
| 228 |
+
|
| 229 |
+
Two-stage Training Dynamics. As Figure 5a displays, we find a pattern from the Var-Time curve — during training DIR, the variance penalty (i.e., $\mathrm { V a r } _ { s }$ in Equation 4) first increases and then decreases to almost zero. Moreover, there exists an interesting correlation between the variance penalty and the precision metrics — that is, the precision rises dramatically as the penalty increases while growing slowly as the penalty decreases. To probe this learning pattern, we further visualize the rationale distribution in three turning points: (1) the start, (2) the middle, and (3) the end of training. Interestingly, the rationale distribution at the middle point is highly similar to that at the ending point. This illustrates two stages, adaption and fitting, in the patterns. By “adaption”, we mean that the exhibition of $h _ { \tilde { C } }$ , i.e., learning to select salient feature $\tilde { C }$ , is mainly conducted during the initial training stage. Since the penalty value can be seen as the magnitude to violate the invariance condition, this stage explores the rationales that satisfy the DIR principle. Correspondingly, $h _ { \tilde { Y } }$ adapts quickly with the input of varying rationales generated by $h _ { \tilde { C } }$ . By “fitting”, we mean that, in the later training process, $h _ { \tilde { C } }$ only makes small changes, resulting in the substantially unchanged rationales compared to the initial training process, which is learned from the rationale generator to conform to the DIR principle. This could also imply that based on the well-learned rationales, DIR mainly optimizes $h _ { \tilde { Y } }$ to consolidate the functional relation $\tilde { C } Y$ until model convergence.
|
| 230 |
+
|
| 231 |
+
Moreover, we compare the learning patterns of IRM and DIR in Figure 5b, where the penalty term of IRM (the gradient norm penalty in IRMv1 (Arjovsky et al., 2019)) follows a similar pattern to the DIR penalty. Notably, in MNIST-75sp, while IRM consistently outperforms DIR $w . r . t .$ . Training ACC, it does not improve and even degrades the performance in the testing dataset due to overfitting. However, DIR shows the solid resistance for over-fitting, partly thanks to the valid rationales exhibited in the adaption stage. For Molhiv, DIR outperforms IRM as the rationales filter out irrelevant or spurious structures bootless for classification tasks and are beneficial for generalization.
|
| 232 |
+
|
| 233 |
+
Sensitivity Analysis. We conduct a sensitivity analysis of model performance w.r.t. $\lambda$ in Appendix F.2, which shows that DIR surpasses the best baselines under a relatively large range of $\lambda$ .
|
| 234 |
+
|
| 235 |
+
# 4 RELATED WORKS
|
| 236 |
+
|
| 237 |
+
Inherent Interpretability of GNNs. We summarize two classes of the existing methods to build deep interpretable GNNs, (i) Attention (Vaswani et al., 2017; Velickovi ˇ c et al. ´ , 2018), which can be broadly interpreted as importance weights on representations.(ii) Pooling (Lee et al., 2019; Knyazev et al., 2019; Gao & Ji, 2019), which selectively performs down-sampling on representations. We include it in this category when it involves selection importance. However, the mechanisms to generate the rationales could be epistemic, as they only reflect the probabilistic relations between data and predicted labels (Pearl, 2000), which may not hold true in all data distributions. Thus, the rationales could fail to align with causal features and even degrade model performance due to being “fooled” by spurious features (Chang et al., 2020).
|
| 238 |
+
|
| 239 |
+
Invariant Learning. Backed by causal theory, invariant learning assumes the causal relation from the causal factors $C$ to the response variable $Y$ remains invariant unless we intervene on $Y$ . As the most prevailing formulation, IRM (Arjovsky et al., 2019) extends the invariance assumption from feature level to representation level and finds a data representation $\Phi$ such that $\Omega \circ \Phi$ matches for all environments, where $\Omega$ is the classifier. However, concerns about its feasibility (Rosenfeld et al., 2021; Ahuja et al., 2021) and optimality (Kamath et al., 2021) have been discussed recently. Besides IRM, variance penalization across environments is shown to be effective for recovering invariance (Krueger et al., 2021; Xie et al., 2020; Teney et al., 2020). Notably, the existing methods generally require accessing different environments, thus additionally involving environment inference (Creager et al., 2021; Wang et al., 2021b). Similarly motivated as ours, Chang et al. (2020) discover rationales $Z$ by minimizing the performance gap between environment-agnostic predictor $f ( Z )$ and environment-aware predictor $f ( Z , E )$ . In graph domain, Bevilacqua et al. (2021) construct graph representations from subgraph densities and use attribute symmetry regularization to mitigate the shift of graph size and vertex attribute distributions.
|
| 240 |
+
|
| 241 |
+
# 5 CONCLUSION & FUTURE WORK
|
| 242 |
+
|
| 243 |
+
In this work, we rigorously study the intrinsic interpretability of Graph Neural Networks from a causal perspective. Our concerns are towards the exhibition of shortcut features when generating the rationales. And we proposed an invariant learning algorithm, DIR, to discover the causal features for rationalization. The core of DIR lies in the construction of environments (i.e., interventional distributions) and thus distilling the salient features as rationales that are consistently informative and uniform across these environments. Such rationales serve as the probing towards model mechanisms and are demonstrated to be effective in generalization. In the experiments, we highlight an adaption-fitting training dynamics for DIR to reveal its learning pattern. In the future, we will build more reliable and expressive interpretable models that are feasible under various assumptions, which potentially calls for high-level interpretability. We recommend interested readers go to the open discussion in Appendix G for the detailed description.
|
| 244 |
+
|
| 245 |
+
# ACKNOWLEDGMENT
|
| 246 |
+
|
| 247 |
+
This work was supported by the National Key Research and Development Program of China (2020AAA0106000), the National Natural Science Foundation of China (U19A2079), the SeaNExT Joint Lab, and Singapore MOE AcRF T2.
|
| 248 |
+
|
| 249 |
+
# ETHICS STATEMENT
|
| 250 |
+
|
| 251 |
+
In this work, we propose a novel algorithm for intrinsic interpretable models, where no human subject is related. This synthetic dataset is made available in the anonymous link (cf. Section 3.1). We believe the exhibition of rationales is beneficial for inspecting and eliminating potential discrimination and fairness issues in deep models for real applications.
|
| 252 |
+
|
| 253 |
+
# REPRODUCIBILITY STATEMENT
|
| 254 |
+
|
| 255 |
+
We summarize the efforts made to ensure reproducibility in this work. (1) Datasets: We use one synthetic dataset which is made available (cf. the anonymous link in Section 3.1), and three public datasets where the processing details are included in Appendix D. (2) Model Training: We provide the procedure of training in Algorithm A and the training details (including hyper-parameter settings) in Appendix D which are consistent with our implementation in the code (cf. the anonymous link in Section 3.1). (3) Theoretical Results: All assumptions and proofs can be referred to Appendix C.
|
| 256 |
+
|
| 257 |
+
# REFERENCES
|
| 258 |
+
|
| 259 |
+
Kartik Ahuja, Jun Wang, Amit Dhurandhar, Karthikeyan Shanmugam, and Kush R. Varshney. Empirical or invariant risk minimization? A sample complexity perspective. In ICLR, 2021.
|
| 260 |
+
|
| 261 |
+
David Alvarez-Melis and Tommi S. Jaakkola. A causal framework for explaining the predictions of black-box sequence-to-sequence models. In EMNLP, pp. 412–421, 2017.
|
| 262 |
+
|
| 263 |
+
Mart´ın Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ CoRR, abs/1907.02893, 2019.
|
| 264 |
+
|
| 265 |
+
Yoshua Bengio, Aaron C. Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Trans. Pattern Anal. Mach. Intell., 2013.
|
| 266 |
+
|
| 267 |
+
Beatrice Bevilacqua, Yangze Zhou, and Bruno Ribeiro. Size-invariant graph representations for graph classification extrapolations. In ICML, 2021.
|
| 268 |
+
|
| 269 |
+
Filippo Maria Bianchi, Daniele Grattarola, Lorenzo Livi, and Cesare Alippi. Graph neural networks with convolutional ARMA filters. CoRR, abs/1901.01343, 2019.
|
| 270 |
+
|
| 271 |
+
Giorgos Bouritsas, Fabrizio Frasca, Stefanos Zafeiriou, and Michael M. Bronstein. Improving graph neural network expressivity via subgraph isomorphism counting. arXiv, 2006.09252, 2020.
|
| 272 |
+
|
| 273 |
+
Peter Buhlmann. Invariance, causality and robustness. ¨ arXiv, 1812.08233, 2018.
|
| 274 |
+
|
| 275 |
+
Remi Cad ´ ene, Corentin Dancette, Hedi Ben-younes, Matthieu Cord, and Devi Parikh. Rubi: Re-\` ducing unimodal biases for visual question answering. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman Garnett (eds.), ´ NeurIPS, 2019.
|
| 276 |
+
|
| 277 |
+
Kwan Ho Ryan Chan, Yaodong Yu, Chong You, Haozhi Qi, John Wright, and Yi Ma. Redunet: A white-box deep network from the principle of maximizing rate reduction. arXiv, 2105.10446, 2021.
|
| 278 |
+
|
| 279 |
+
Shiyu Chang, Yang Zhang, Mo Yu, and Tommi S. Jaakkola. Invariant rationalization. In ICML, 2020.
|
| 280 |
+
|
| 281 |
+
Zhengdao Chen, Soledad Villar, Lei Chen, and Joan Bruna. On the equivalence between graph isomorphism testing and function approximation with gnns. In NeurIPS, 2019.
|
| 282 |
+
|
| 283 |
+
Elliot Creager, Jorn-Henrik Jacobsen, and Richard S. Zemel. Environment inference for invariant ¨ learning. In Marina Meila and Tong Zhang (eds.), ICML, 2021.
|
| 284 |
+
|
| 285 |
+
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.
|
| 286 |
+
|
| 287 |
+
Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. CoRR, abs/2003.00982, 2020.
|
| 288 |
+
|
| 289 |
+
Hongyang Gao and Shuiwang Ji. Graph u-nets. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), ICML, pp. 2083–2092, 2019.
|
| 290 |
+
|
| 291 |
+
William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pp. 1024–1034, 2017.
|
| 292 |
+
|
| 293 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 294 |
+
|
| 295 |
+
Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. Ogb-lsc: A large-scale challenge for machine learning on graphs. arXiv preprint arXiv:2103.09430, 2021.
|
| 296 |
+
|
| 297 |
+
Pritish Kamath, Akilesh Tangella, Danica J. Sutherland, and Nathan Srebro. Does invariant risk minimization capture invariance? In Arindam Banerjee and Kenji Fukumizu (eds.), AISTATS, 2021.
|
| 298 |
+
|
| 299 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 300 |
+
|
| 301 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 302 |
+
|
| 303 |
+
Boris Knyazev, Graham W. Taylor, and Mohamed R. Amer. Understanding attention and generalization in graph neural networks. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman Garnett (eds.), ´ NeurIPS, pp. 4204–4214, 2019.
|
| 304 |
+
|
| 305 |
+
David Krueger, Ethan Caballero, Jorn-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai ¨ Zhang, Remi Le Priol, and Aaron C. Courville. Out-of-distribution generalization via risk extrap- ´ olation (rex). In Marina Meila and Tong Zhang (eds.), ICML, pp. 5815–5826, 2021.
|
| 306 |
+
|
| 307 |
+
Solomon Kullback. Information theory and statistics. Courier Corporation, 1997.
|
| 308 |
+
|
| 309 |
+
Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), ICML, pp. 3734–3743, 2019.
|
| 310 |
+
|
| 311 |
+
Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding: Design provably more powerful neural networks for graph representation learning. In NeurIPS, 2020.
|
| 312 |
+
|
| 313 |
+
Dongsheng Luo, Wei Cheng, Dongkuan Xu, Wenchao Yu, Bo Zong, Haifeng Chen, and Xiang Zhang. Parameterized explainer for graph neural network. In NeurIPS, 2020.
|
| 314 |
+
|
| 315 |
+
Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. In NeurIPS, 2019.
|
| 316 |
+
|
| 317 |
+
Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In AAAI, pp. 4602–4609, 2019.
|
| 318 |
+
|
| 319 |
+
Judea Pearl. Causality: Models, Reasoning, and Inference. 2000.
|
| 320 |
+
|
| 321 |
+
Judea Pearl, Madelyn Glymour, and Nicholas P Jewell. Causal inference in statistics: A primer. John Wiley & Sons, 2016.
|
| 322 |
+
|
| 323 |
+
Ekagra Ranjan, Soumya Sanyal, and Partha P. Talukdar. ASAP: adaptive structure aware pooling for learning hierarchical graph representations. In AAAI, pp. 5470–5477, 2020.
|
| 324 |
+
|
| 325 |
+
Elan Rosenfeld, Pradeep Kumar Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. In ICLR, 2021.
|
| 326 |
+
|
| 327 |
+
Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. CoRR, abs/1911.08731, 2019.
|
| 328 |
+
|
| 329 |
+
Andrew W. Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Z´ıdek, Alexander W. R. Nelson, Alex Bridgland, Hugo Penedones, Stig Petersen, Karen Simonyan, Steve Crossan, Pushmeet Kohli, David T. Jones, David Silver, Koray Kavukcuoglu, and Demis Hassabis. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706–710, 2020.
|
| 330 |
+
|
| 331 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, pp. 1631–1642, 2013.
|
| 332 |
+
|
| 333 |
+
Damien Teney, Ehsan Abbasnejad, and Anton van den Hengel. Unshuffling data for improved generalization. arXiv, 2002.11894, 2020.
|
| 334 |
+
|
| 335 |
+
Jin Tian, Changsung Kang, and Judea Pearl. A characterization of interventional distributions in semi-markovian causal models. In AAAI, pp. 1239–1244, 2006.
|
| 336 |
+
|
| 337 |
+
G.E. van der Maaten, L.J.P.; Hinton. Visualizing high-dimensional data using t-sne. Journal of Machine Learning Research 9:2579-2605, 2008.
|
| 338 |
+
|
| 339 |
+
Tyler J VanderWeele. A three-way decomposition of a total effect into direct, indirect, and interactive effects. Epidemiology (Cambridge, Mass.), 24(2):224, 2013.
|
| 340 |
+
|
| 341 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), NeurIPS, 2017.
|
| 342 |
+
|
| 343 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph attention networks. ICLR, 2018. accepted as poster.
|
| 344 |
+
|
| 345 |
+
Tan Wang, Zhongqi Yue, Jianqiang Huang, Qianru Sun, and Hanwang Zhang. Self-supervised learning disentangled group representation as feature. arXiv, 2110.15255, 2021a.
|
| 346 |
+
|
| 347 |
+
Tan Wang, Chang Zhou, Qianru Sun, and Hanwang Zhang. Causal attention for unbiased visual recognition. arXiv, 2108.08782, 2021b.
|
| 348 |
+
|
| 349 |
+
Xiang Wang, Yingxin Wu, An Zhang, Xiangnan He, and Tat seng Chua. Towards multi-grained explainability for graph neural networks. In NeurIPS, 2021c.
|
| 350 |
+
|
| 351 |
+
Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay S. Pande. Moleculenet: A benchmark for molecular machine learning. arXiv, abs/1703.00564, 2017.
|
| 352 |
+
|
| 353 |
+
Chuanlong Xie, Fei Chen, Yue Liu, and Zhenguo Li. Risk variance penalization: From distributional robustness to causality. arXiv, 2006.07544, 2020.
|
| 354 |
+
|
| 355 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR. OpenReview.net, 2019.
|
| 356 |
+
|
| 357 |
+
Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. Gnnexplainer: Generating explanations for graph neural networks. In NeurIPS, pp. 9240–9251, 2019.
|
| 358 |
+
|
| 359 |
+
Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. CoRR, 2020.
|
| 360 |
+
|
| 361 |
+
Hao Yuan, Haiyang Yu, Jie Wang, Kang Li, and Shuiwang Ji. On explainability of graph neural networks via subgraph explorations. ArXiv, 2021.
|
| 362 |
+
|
| 363 |
+
# A NOTATIONS & ALGORITHM
|
| 364 |
+
|
| 365 |
+
Key Notations in the Main Paper.
|
| 366 |
+
|
| 367 |
+
Algorithm 1 Pseudocode for DIR in training interpretable Graph Neural Networks (Batch Version)
|
| 368 |
+
|
| 369 |
+
<table><tr><td>Symbol</td><td>Definition</td></tr><tr><td>g</td><td>graph instance</td></tr><tr><td>c/s</td><td> ground truth causal or confounding subgraph</td></tr><tr><td>c/s</td><td>generated rationale or complement of rationale instance</td></tr><tr><td>CIS</td><td>variables in the causal graph</td></tr><tr><td>s/s</td><td>space of the ground truth or identified spurious features</td></tr><tr><td>yelgs y</td><td>causal or spurious prediction</td></tr><tr><td>hc</td><td>joint prediction rationale generator</td></tr><tr><td>Φ/2</td><td></td></tr><tr><td></td><td>causal or spurious classifier</td></tr></table>
|
| 370 |
+
|
| 371 |
+
Require: Training data distribution $\mathcal { P } _ { t r } ( G )$ ; number of classes $Q$ ; Stepsize $\alpha$ ; hyper-parameter 1: Randomly initialize the parameters of generator $h _ { \tilde { C } }$ , encoder $h _ { \theta }$ (includes $\mathrm { G N N _ { 2 } }$ and Pool layer), two classifiers $\Phi _ { 1 }$ and $\Phi _ { 2 }$ , which are denoted as $\gamma , \theta , \phi _ { 1 } , \phi _ { 2 }$ , respectively.
|
| 372 |
+
2: while not converge do
|
| 373 |
+
3: Sample graphs $\{ ( g ^ { i } , y ^ { i } ) \} _ { i = 1 } ^ { B }$ from $\mathcal { P } _ { t r } ( G )$
|
| 374 |
+
4: Generate each rationale and its complement: $( \tilde { c } ^ { i } , \tilde { s } ^ { i } ) h _ { \tilde { C } } ( g ^ { i } )$ , for $i = 1 , \ldots , B$ . 5: for each $\tilde { s } ^ { i }$ do
|
| 375 |
+
6: 7: Intervener Model for $h _ { I }$ oprd: $\hat { y } _ { \tilde { s } } = \Phi _ { 2 } \bigl ( h _ { \theta } \bigl ( \tilde { s } ^ { i } \bigr ) \bigr ) \in \mathbb { R } ^ { 1 \times Q }$ $d o ( S = \tilde { s } ^ { i } )$ , $\{ \hat { y } _ { \tilde { c } } \} _ { i = 1 } ^ { B } = \Phi _ { 1 } \big ( h _ { \theta } \big ( \{ \tilde { c } ^ { i } \} _ { i = 1 } ^ { B } \big ) \big ) \in \mathbb { R } ^ { B \times Q }$ 8: # block BP of DIR risk to shortcut branch
|
| 376 |
+
Obtain joint prediction $\hat { y } = [ \hat { y } ^ { 1 } , \dots , \hat { y } ^ { B } ]$ , where $\hat { y } ^ { j } = \hat { y } _ { \tilde { c } } \odot \sigma ( \hat { y } _ { \tilde { s } } ^ { j } )$ .detach()
|
| 377 |
+
9: Compute and record risk $\mathcal { R } ( \hat { y } _ { \tilde { s } } , y ^ { i } )$
|
| 378 |
+
10: Compute and record $\tilde { s } ^ { i }$ -interventional risk.
|
| 379 |
+
11: end for
|
| 380 |
+
12: Compute $\mathcal { R } _ { \mathrm { D I R } }$ via Eq. 4 and $\mathcal { R } _ { \tilde { S } }$ via Eq. 11
|
| 381 |
+
13: Update parameters: $\phi _ { 2 } = \phi _ { 2 } - \tilde { \alpha } \nabla _ { \phi _ { 2 } } \mathcal { R } _ { \tilde { S } }$ ; $\phi _ { 1 } = \phi _ { 1 } - \alpha \nabla _ { \phi _ { 1 } } \mathcal { R } _ { \mathrm { D I R } }$ ;
|
| 382 |
+
$\gamma = \gamma - \alpha \nabla _ { \gamma } \mathcal { R } _ { \mathrm { D I R } } ;$ $\dot { \theta } = \theta - \alpha \nabla _ { \theta } \mathcal { R } _ { \mathrm { D I R } }$
|
| 383 |
+
|
| 384 |
+
14: end while
|
| 385 |
+
|
| 386 |
+
# B INSTANTIATED CAUSAL GRAPHS
|
| 387 |
+
|
| 388 |
+
We instantiate possible causal graphs in Figure 2a. Specifically, we use the example of Base-Motif graphs, whose labels are determined by the motif types. We use $C = 0 , 1 , 2$ to denote cycle, house, crane, respectively; And use $S = 0 , 1 , 2$ to denote ladder, tree, wheels, respectively.
|
| 389 |
+
|
| 390 |
+
• $C \perp \perp S$ : Base graphs and motif graphs are independently sampled and attached to each other. • $C S$ : Type of each motif respects to a given (static) probability distribution. According to the value of $C$ , the probability distribution of its base graph is given by
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
P ( S ) = { \left\{ \begin{array} { l l } { 0 . 6 } & { { \mathrm { i f ~ } } S = C } \\ { 0 . 2 } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
• $S C$ : Similar to the example for $C S$ .
|
| 397 |
+
|
| 398 |
+
• $S \left. E \right. C$ : Suppose there is a latent variable $E$ takes continuous value from 0 to 1. Then the probability distribution of $S$ and $C$ s.t.
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
S \sim \mathcal { B } ( 3 , E ) ~ C \sim \mathcal { B } ( 3 , 1 - E )
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
where $\boldsymbol { B }$ stands for binomial distribution, i.e., for variable $X$ , if $X \sim B ( n , p )$ , then we have
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
P ( X = k \mid p , n ) = \left( { \begin{array} { l } { n } \\ { k } \end{array} } \right) p ^ { k } ( 1 - p ) ^ { n - k }
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
# C THEORY
|
| 411 |
+
|
| 412 |
+
# C.1 ASSUMPTION
|
| 413 |
+
|
| 414 |
+
We phrase the SCM in Figure 2a as the following assumption:
|
| 415 |
+
|
| 416 |
+
Assumption 1 (Invariant Rationalization (IR)) There exists a rationale $C \subseteq G$ , such that the structural equation model
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
Y \gets f _ { Y } \left( C , \epsilon _ { Y } \right) , \epsilon _ { Y \bot } \underline { { | } } \_ C
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
and the probability relation
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
S \bot Y \mid C
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
hold for every distribution $\tilde { \mathcal P }$ over ${ \mathcal { P } } ( G , Y )$ , where $S$ denotes the complement of $C$ . Also, we denote $f _ { Y }$ as the oracle structural equation model.
|
| 429 |
+
|
| 430 |
+
By “oracle”, we mean that $f _ { Y }$ is the perfect structure equation model, which, when $C$ is available, predicts the response variable with the minimum expected loss over any distribution $\tilde { \mathcal P }$ . Or formally,
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
f _ { Y } : = \underset { f } { \arg \operatorname* { m i n } } \ : \mathcal { R } ( f ) = \underset { f } { \arg \operatorname* { m i n } } \ : \mathbb { E } _ { ( G , Y ) \sim \tilde { \mathcal { P } } , \epsilon _ { Y } } [ l ( f ( C , Y ) , \epsilon _ { Y } ) , Y ) ] .
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
where $l$ is the task-specific loss function and we ignore the exogenous noise $\epsilon _ { Y }$ in $f _ { Y }$ ’s input except as otherwise noted.
|
| 437 |
+
|
| 438 |
+
Next, we argue that the assumption is commonly satisfied. For example, for sentences labeled by sentiment, $C$ can represent the positive/negative words that cause the sentiment, while $S$ includes the prepositions and linking words. For molecule graphs labeled by specific properties, $C$ and $S$ can represent the functional groups and carbon structures, respectively. Note that IR assumption enables and calls the introduction of interpretability, highlighting salient features and exhibiting human accessible checks. More importantly, it guarantees the model performance under possible feature reduction, i.e., $C \subset G$ .
|
| 439 |
+
|
| 440 |
+
We also see cases going beyond the IR Assumption. For example, $G$ could be a generic function of $S$ and $C$ , instead of a simple joint. We use a toy example to elaborate this point. Following the Spurious-Motif dataset, we assume each graph has multiple motifs (house, cycle, crane) with only one type and is labeled by the motif type. Thus, the causal feature $C$ will be the motifs. Let the spurious feature $S$ be ”the way we connect the motifs”. For example, we can place the house motifs in a queue sequence and connect the adjacent motifs, thus forming the graph in a ”line” shape. Or we can place the houses in a cycle order and connect them into a ring. We further make such graph structures strongly correlated with the motif types. Thus, individual $S$ and $C$ may be intractable individually in the feature level. For example, if we separate the cycle-shaped houses into two lines, the spurious pattern could be broken while the part of the causal feature would be lost. In other words, $S$ and $C$ are dependent variables. Thus, they can’t be extracted and modeled separately, which goes out of the scope of our work.
|
| 441 |
+
|
| 442 |
+
Given that $S$ and $C$ are separable, we further make the following assumption to avoid the confusion of $S$ and $C$ :
|
| 443 |
+
|
| 444 |
+
Assumption 2 (Feature Induction) Define power set operation as $\mathcal { P } ^ { * } ( \cdot )$ . For data $G = S \cup C$ and label $Y$ , if $S \bot Y \mid ($ holds for any distribution $\tilde { \mathcal P }$ over ${ \mathcal { P } } ( G , Y )$ , then it implies that for any induced feature $S ^ { \prime } \in { \mathcal { P } } ^ { * } ( S )$ , we have $S ^ { \prime } \bot Y \mid C$ holds for the distribution $\tilde { \mathcal P }$
|
| 445 |
+
|
| 446 |
+
This assumption also implies that $C$ could not be induced by $S$ when $| C | \leq | S |$ . Thus, any feature subset $C ^ { \prime }$ except for $C$ would violate the conditional independence condition. For images, this assumption is natural for the splicing of $S$ doesn’t typically change its semantics. For example, the splicing of land background would still be divided land. While for graphs, here we assume the causal subgraph’s uniqueness among the induced complement graphs.
|
| 447 |
+
|
| 448 |
+
# C.2 PROOFS
|
| 449 |
+
|
| 450 |
+
Theorem 1 (Necessity) Suppose $S C$ does not exist, then the oracle function $f _ { Y }$ satisfies the DIR Principle (where $C$ is given) over every distribution $\tilde { \mathcal { P } } \in \mathcal { P } ( G , Y )$ .
|
| 451 |
+
|
| 452 |
+
Proof: We first prove the fact that $P ( Y = y ~ \vert ~ d o ( S = s ) ) = P ( Y = y )$ for distribution $\tilde { \mathcal P }$ .
|
| 453 |
+
Specifically, we use ${ P } _ { I } ^ { ( s ) }$ to denote the s-interventional distribution.
|
| 454 |
+
|
| 455 |
+
• If $C S$
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { l } { P ( Y = y \mid d o ( S = s ) ) \xrightarrow { \mathrm { b y ~ d e m i t i o n } } P _ { I } ^ { ( s ) } ( Y = y \mid S = s ) } \\ { = \displaystyle \sum _ { c } P _ { I } ^ { ( s ) } ( Y = y \mid S = s , C = c ) P _ { I } ^ { ( s ) } ( C = c \mid S = s ) } \\ { \xrightarrow { \mathrm { g i v e n } \mathscr { C } \to S } P _ { I } ^ { ( s ) } ( Y = y \mid S = s , C = c ) P _ { I } ^ { ( s ) } ( C = c ) } \\ { \xrightarrow { \mathrm { g i v e n } ( Y , \| S \| C ) _ { \mathcal { P } } } \displaystyle \sum _ { c } P _ { I } ^ { ( s ) } ( Y = y \mid C = c ) P _ { I } ^ { ( s ) } ( C = c ) } \\ { \xrightarrow { \mathrm { g i v e n ~ i n v a i a n c ~ c o n d i t i o n } } \displaystyle \sum _ { c } P ( Y = y \mid C = c ) P ( C = c ) } \\ { = P ( Y = y ) } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
• If $C \bot \bot S$ ,
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { r l } { P ( Y = y \mid d o ( S = s ) ) \xrightarrow { \mathrm { b y d e n i t i o n } } P _ { I } ^ { ( s ) } ( Y = y \mid S = s ) } \\ & { \xrightarrow { \mathrm { g i v e n ~ S i a s o n d e g a t o r s p a c e n t } } P ( Y = y \mid S = s ) } \\ & { \xrightarrow { \mathrm { g i v e n C . } \bigsqcup S } \displaystyle \sum _ { c } P ( Y = y \mid C = c , S = s ) P ( C = c ) } \\ & { = \displaystyle \sum _ { c } P ( Y = y \mid C = c , S = s ) P ( C = c \mid S = s ) } \\ & { \xrightarrow { \mathrm { g i v e n } ( Y \mid L \mid S ) _ { \bar { p } } } \displaystyle \sum _ { c } P ( Y = y \mid C = c ) P ( C = c ) } \\ & { = P ( Y = y ) } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
• If $C \left. E \right. S$ ,
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\begin{array} { r l } & { P ( Y \to p | \mid \alpha ( S = s ) ) } \\ & { \xrightarrow { \mathrm { b g ~ t a i r e s s ~ } } P _ { i } ^ { ( s ) } ( Y - y | S - y ) } \\ & { \xrightarrow { \mathrm { b g ~ t a i r e s s ~ } } \displaystyle \sum _ { \epsilon } P _ { i } ^ { ( s ) } ( Y - y | S - s , E - \epsilon ) P _ { i } ^ { ( s ) } ( E = \epsilon ) } \\ & { = \sum _ { \epsilon } \sum _ { \epsilon } P _ { i } ^ { ( s ) } ( Y - \boldsymbol { { s } } _ { \epsilon } ) S - \boldsymbol { { s } } _ { \epsilon } - \boldsymbol { { e } } _ { \epsilon } \mathcal { L } = \epsilon ) P _ { i } ^ { ( s ) } ( C = \epsilon | S = s , E - \epsilon ) P _ { i } ^ { ( s ) } ( E = \epsilon ) } \\ & { \xrightarrow { \mathrm { b g ~ t a i r e s ~ } ( P _ { i } ^ { ( s ) } , \| S , \boldsymbol { \epsilon } \| \mathcal { S } ) m \| S \| } \sum _ { \epsilon } \sum _ { \epsilon } P _ { i } ^ { ( s ) } ( Y - \boldsymbol { { s } } _ { \epsilon } ) C - \epsilon ) P _ { i } ^ { ( s ) } ( C = \epsilon | E - \epsilon | \mathcal { P } _ { i } ^ { ( s ) } ( E = \epsilon ) } \\ & { = \sum _ { \epsilon } \sum _ { \epsilon } P ( Y - \boldsymbol { { s } } _ { \epsilon } ) C - \epsilon P ( C - \epsilon | E - \epsilon | \mathcal { P } ( E - \epsilon ) } \\ & { = \sum _ { \epsilon } \sum _ { \epsilon } P ( Y - \boldsymbol { { s } } _ { \epsilon } ) C - \epsilon , E - \epsilon ) P ( C = \epsilon | E - \epsilon | \mathcal { P } ( E - \epsilon ) } \\ & { = P ( Y \mid \mathcal { V } = \epsilon ) } \end{array}
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
As $P ( Y = y ~ \vert ~ d o ( S = s ) ) = P ( Y = y )$ holds true for every distribution $\tilde { \mathcal P }$ , which is invariant w.r.t. iterative variable $S$ . Moreover, we have $P ( C = c \mid d o ( S = s ) ) = P _ { I } ^ { ( s ) } ( C = c ) = P ( C = c ) .$ . This
|
| 474 |
+
|
| 475 |
+
indicates that the intervention on $S$ leave the causal structure $C Y$ untouched. Thus, we have
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { r l } & { \mathrm { V a r } \left( \left\{ \mathcal { R } ( f _ { Y } \mid d o ( s ) ) ~ \mid s \in \mathbb { S } \right\} \right) = \mathrm { V a r } \left( \left\{ \mathbb { E } _ { ( G , Y ) \sim P _ { I } ^ { ( s ) } ( G , Y ) , C \subset G } [ l ( f _ { Y } ( C ) , Y ) ] ~ \mid s \in \mathbb { S } \right\} \right) } \\ & { \qquad = \mathrm { V a r } \left( \left\{ \mathbb { E } _ { ( C , Y ) } [ l ( f _ { Y } ( C ) , Y ) ] ~ \mid s \in \mathbb { S } \right\} \right) } \\ & { \qquad = 0 } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
Finally, taking the definition of $f$ , we have
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { r l } & { f _ { Y } = \underset { f } { \arg \operatorname* { m i n } } \mathbb { E } _ { s \in \mathbb { S } } \left[ \mathbb { E } _ { ( G , Y ) \sim P _ { I } ^ { ( s ) } ( G , Y ) , C \subset G } [ l ( f ( C ) , Y ) ] \right] } \\ & { \quad = \underset { f } { \arg \operatorname* { m i n } } \mathbb { E } _ { s \in \mathbb { S } } \left[ \mathbb { E } _ { ( C , Y ) } [ l ( f ( C ) , Y ) ] \right] } \\ & { \quad = \underset { f } { \arg \operatorname* { m i n } } \mathbb { E } _ { s \in \mathbb { S } } [ \mathcal { R } ( f \mid d o ( s ) ) ] } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Hence, $f _ { Y }$ takes the minimum penalty and satisfies the DIR Principle.
|
| 488 |
+
|
| 489 |
+
Notably, if $S ~ ~ C$ , then $\mathrm { V a r } \left( \{ \mathcal { R } ( f _ { Y } \mid d o ( s ) ) \mid s \in \mathbb { S } \} \right)$ may not equal to zero since $c \sim$ ${ \cal P } _ { I } ^ { ( s ) } ( C | S ~ = ~ s )$ . In such case, $f _ { Y }$ is not necessarily satisfied to DIR Principle. That is, although $f _ { Y }$ still minimizes $\textstyle { \mathcal { R } } ( f \mid d o ( S ) )$ , we can’t be sure whether it reaches the lower bound of $\mathrm { V a r } \left( \{ \mathcal { R } ( f _ { Y } \mid d o ( s ) ) \mid s \in \tilde { \mathbb { S } } \} \right)$ ) without knowledge about the specific data distribution. Thus, we only consider the cases of $C S$ , $C \perp \perp S$ and $C \left. E \right. S$ in the following discussion.
|
| 490 |
+
|
| 491 |
+
Theorem 2 (Uniqueness) Suppose $l$ is a strict loss function and there exists one and only one nontrivial subset $C$ , then there exists a unique structure equation model $f _ { Y }$ s.t. it satisfies the DIR Principle.
|
| 492 |
+
|
| 493 |
+
Proof: Since $f _ { Y }$ exists and satisfies the DIR Principle, we only need to prove its uniqueness under the given conditions. Otherwise, suppose we have another structure equation $f _ { Y } ^ { \prime } \neq f _ { Y }$ satifies the DIR Principle. Specifically, there exists a datum $( g , y )$ s.t. $f _ { Y } ^ { \prime } ( c ) \ne f _ { Y } ( c )$ . Thus, we have $l ( f _ { Y } ^ { \prime } ( c ) , \bar { y } ) > \bar { l } ( f _ { Y } ( c ) , \bar { y } )$ . Given that $\mathrm { V a r } \left( \{ \mathcal { R } ( f _ { Y } ^ { \prime } \mid d o ( s ) ) \mid \bar { s } \in \mathbb { S } \} \right) \ \geq \ 0 \ =$ $\mathrm { V a r } \left( \{ \mathcal { R } ( f _ { Y } \mid d o ( s ) ) \mid s \in \mathbb { S } \} \right)$ ), we have $\mathcal { R } _ { \mathrm { D I R } } ( f _ { Y } ^ { \prime } ) > \mathcal { R } _ { \mathrm { D I R } } ( f _ { Y } )$ .
|
| 494 |
+
|
| 495 |
+
In reality, there could be multiple candidates of $C$ , e.g., $C _ { i } , C _ { j }$ s.t. $\mathcal { R } _ { \mathrm { D I R } } ( f _ { Y } ^ { ( C _ { i } ) } ) = \mathcal { R } _ { \mathrm { D I R } } ( f _ { Y } ^ { ( C _ { j } ) } )$ , where $f _ { Y } ^ { ( C _ { i } ) }$ is the structure equation corresponds to $C _ { i }$ . Thus, it calls for the selection of $C$ to avoid the learning of suboptimal $f _ { Y }$ . Inspired by Occam’s Razor, we define
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
C ^ { * } = \arg \operatorname* { m i n } | C |
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
as the preferred rationale, or rationale of parsimony. We argue that rationales are not to be extended beyond necessity, which poses simpler hypotheses about causality. As the search of $C ^ { * }$ is NPhard (the worst time complexity is exponential), we use fixed size for the learned rationales in our experiments and leave a better optimization to future work.
|
| 502 |
+
|
| 503 |
+
Corollary 1 (Necessity and Sufficiency) Suppose $l$ is a strict loss function and there exists one and only one non-trival subset $C$ , then any structure causal model $f _ { Y } ^ { \prime }$ s.t. it satisfies the DIR Principle iff. $f _ { Y } ^ { \prime } = f _ { Y }$ .
|
| 504 |
+
|
| 505 |
+
This is directly obtained from Theorem 2. Thus, under the unique constraint of $C$ , we can approach the oracle $f _ { Y }$ by optimizing the DIR objective, which maintains the invariant causal relation between the causal feature and the response variable $Y$ . In another way, based on the uniqueness of the feasible rationale, the optimization of the DIR Principle on the intrinsic interpretable model $h$ (where $C$ is exhibited inside of $h$ ) pushes the approach to $C$ with rationales $\tilde { C }$ . Then, $f _ { Y }$ can also be approached as an invariant predictor based on the learning from $\tilde { C }$ .
|
| 506 |
+
|
| 507 |
+
# D SETTING DETAILS
|
| 508 |
+
|
| 509 |
+
Table 3: Statistics of Graph Classification Datasets.
|
| 510 |
+
|
| 511 |
+
<table><tr><td></td><td colspan="3">Spurious-Motif</td><td colspan="3">MNIST-75sp (reduced)</td><td colspan="3">Graph-SST2</td><td colspan="3">OGBG-Molhiv</td></tr><tr><td></td><td>Train</td><td>Val</td><td>Test</td><td>Train</td><td>Val</td><td>Test</td><td>Train</td><td>Val</td><td>Test</td><td>Train Val</td><td></td><td>Test</td></tr><tr><td>Classes#</td><td></td><td>3</td><td></td><td></td><td>10</td><td></td><td></td><td>2</td><td></td><td></td><td>2</td><td></td></tr><tr><td>Graphs#</td><td>9.000</td><td>3,000</td><td>6.000</td><td>20.000</td><td>5,000</td><td>10.000</td><td>28,327</td><td>3,147</td><td>12.305</td><td>32,901</td><td>4,113</td><td>4,113</td></tr><tr><td>Avg.N#</td><td>25.4</td><td>26.1</td><td>88.7</td><td>66.8</td><td>67.3</td><td>67.0</td><td>17.7</td><td>17.3</td><td>3.45</td><td>25.3</td><td>27.79</td><td>25.3</td></tr><tr><td>Avg.E#</td><td>35.4</td><td>36.2</td><td>131.1</td><td>539.3</td><td>545.9</td><td>540.4</td><td>33.3</td><td>33.5</td><td>4.89</td><td>54.1</td><td>61.1</td><td>55.6</td></tr><tr><td>Backbone</td><td>Local Extremum GNN</td><td></td><td></td><td></td><td>k-GNNs</td><td></td><td></td><td>ARMA</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan="4">(Ranjan et al., 2020)</td><td colspan="2">(Morris et al., 2019)</td><td colspan="3"></td><td colspan="3">GIN + Virtual nodes</td></tr><tr><td>Neuron#</td><td colspan="3">[4,32,32,32]</td><td colspan="3">[5,32,32,32]</td><td colspan="3">(Bianchi et al., 2019)</td><td colspan="3">(Xu et al.,2019; Hu et al.,2021)</td></tr><tr><td>Global Pool</td><td colspan="3"></td><td colspan="3"></td><td colspan="3">[768,128,128,2]</td><td colspan="3">[9,300,300,300,1]</td></tr><tr><td></td><td colspan="3">global mean pool</td><td colspan="3">global max pool</td><td colspan="3">global mean pool</td><td colspan="3">global add pool</td></tr><tr><td>Gen. Type</td><td colspan="3">Scale &Correlation Shift</td><td colspan="3">Noise</td><td colspan="3">Degree & Scale Shift</td><td colspan="3">/</td></tr></table>
|
| 512 |
+
|
| 513 |
+
Datasets We summarize dataset statistics in Table 3, and introduce the node/edge features and the preprocessing in each datasets:
|
| 514 |
+
|
| 515 |
+
• Spurious-Motif. We use random node features and constant edge weights in this dataset.
|
| 516 |
+
|
| 517 |
+
• MNIST-75sp. The nodes in the graphs are superpixels, and node features are the concatenation of pixel intensities (RGB channels) and coordinates of their mass centers. Edges are the spatial distance between the superpixel centers, while we filter the edges with a distance less than 0.1 to make the graphs sparser.
|
| 518 |
+
|
| 519 |
+
• Graph-SST2. We use constant edge weight and filter the graphs with edges less than three. We initialize the node features by the pre-trained BERT (Devlin et al., 2018) word embedding.
|
| 520 |
+
|
| 521 |
+
• OGBG-Molhiv. We use the official released dataset in our experiment.
|
| 522 |
+
|
| 523 |
+
GNNs. We summarize the backbone GNNs for each dataset in Table 3. The number of neurons in the sequent layers (in forwarding order) is reported. We use ReLU as activation layers and different global pooling layers. In OGBG-Molhiv, we adopt one fully connected layer for the prediction layers while using two fully connected layers for the models in other datasets. For baselines with node pooling/node attention, we add one node pooling/attention layer in the second convolution layer.
|
| 524 |
+
|
| 525 |
+
Training Optimization & Early Stopping. All experiments are done on a single Tesla V100 SXM2 GPU (32 GB). During training, we use Adam (Kingma & Ba, 2015) optimizer. The maximum number of epochs is 400 for all datasets. We use Stochastic Gradient Descent (SGD) for the optimization on Graph-SST2 and OGBG-Molhiv and Gradient Descent (GD) for the other two datasets. Also, we exhibit early stopping to avoid overfitting of the training dataset. Specifically, in MNIST-75sp, Graph-SST2 and OGBG-Molhiv, each model is evaluated on a holdout in-distribution validation dataset after each epoch. While for Spurious-Motif, we use an unbiased validation dataset (i.e., without spurious relations compared to the training dataset). If the model’s performance on the validation dataset is without improvement (i.e., validation accuracy begins to decrease) for five epochs, we stop the training process to prevent increased generalization error.
|
| 526 |
+
|
| 527 |
+
Hyper-Parameter Settings. We set the causal feature ratio and $\lambda$ as $( r = 0 . 8 , \lambda = 1 0 ^ { - 4 } )$ ), $( r =$ $0 . { \overset { \cdot } { 2 5 } } , \lambda = 1 0 ^ { - 2 } \rangle$ , $( r = 0 . 6 , \lambda = 1 0 ^ { 2 } )$ ), $( r = 0 . 8 , \lambda = 1 0 ^ { - 3 } )$ for MNIST-75sp, Spurious-Motif, Graph-SST2 and OGBG-Molhiv respectively. For other baselines, we adopt grid search for the best parameters using the validation datasets.
|
| 528 |
+
|
| 529 |
+
Model Selection. We select each model based on its performance on the corresponding validation dataset. We repeat each experiment at least five times and report the average values and the standard errors in the paper.
|
| 530 |
+
|
| 531 |
+
# E UNIMODAL ADJUSTMENT
|
| 532 |
+
|
| 533 |
+
We follow Cadene et al. \` (2019) to demonstrate how the shortcut prediction can help to remove model bias. For clarity, we refer to the model parameters except for $\Phi _ { 2 }$ as the main branch, i.e., except for the $S$ -only branch.
|
| 534 |
+
|
| 535 |
+
Given a house-tree graph as the input graph, we suppose the shortcut prediction $\hat { y } _ { \tilde { s } }$ of the tree subgraph leans towards the house class. Then after reweighting $\sigma ( \hat { y } _ { \tilde { s } } )$ on $\hat { y } _ { \tilde { c } }$ , the softmax readout on the house class in the joint prediction $\hat { y }$ will be magnified, which results in a smaller loss backpropagated to the main branch and prevents $\hat { y } _ { \tilde { c } }$ from inductive bias.
|
| 536 |
+
|
| 537 |
+
In another situation where a house-wheel graph is given as the input, we similarly suppose the shortcut prediction $\hat { y } _ { \tilde { s } }$ of the wheel subgraph leans towards other classes except the house, say, the circle class. Then after reweighting $\sigma ( \hat { y } _ { \tilde { s } } )$ on $\hat { y } _ { \tilde { c } }$ , the softmax readout on the house class in the joint prediction $\hat { y }$ will be reduced, which results in a larger loss back-propagated to the main branch and encourages the model to learn from these examples.
|
| 538 |
+
|
| 539 |
+
Furthermore, we offer the causal- and information-theoretical justifications: (1) From the perspective of causal theory (Pearl, 2000; Pearl et al., 2016), the element-wise multiplication enforces the spurious prediction to estimate the pure indirect effect (PIE) of the shortcut features, while the causal prediction captures the natural direct effect (NDE) of the causal patterns (VanderWeele, 2013); (2) From the perspective of information theory (Kullback, 1997), the element-wise multiplication makes the causal prediction reflect the conditional mutual information between the causal patterns and ground-truths, conditioning on the complement patterns.
|
| 540 |
+
|
| 541 |
+
# F MORE EXPERIMENTAL RESULTS
|
| 542 |
+
|
| 543 |
+
# F.1 VISUALIZATION
|
| 544 |
+
|
| 545 |
+
We provide more visualization cases in Graph-SST2 dataset as shown in Figure 6 and Figure 7. The rationales are highlighted in deep colors.
|
| 546 |
+
|
| 547 |
+

|
| 548 |
+
Figure 6: Visualization of Training Rationales. Each graph represents a comment, e.g., , ”determined to uncover the truth and hopefully inspire action” in (a).
|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
Figure 7: Visualization of Testing Rationales. Each graph represents a comment, e.g., , ”whimsical and relevant today” in (a).
|
| 552 |
+
|
| 553 |
+
Table 4: Confidence of the Spurious Predictions. Uniform is the reference indicates the uniform distributions across the classes.
|
| 554 |
+
|
| 555 |
+
<table><tr><td></td><td>Spurious-Motif (b=0.9)</td><td>MNIST-75sp</td><td>GraphSST2</td><td>Molhiv</td></tr><tr><td>Uniform</td><td>1.10</td><td>2.30</td><td>0.693</td><td>0.693</td></tr><tr><td>Spurious Predictions</td><td>0.529</td><td>1.93</td><td>0.265</td><td>0.187</td></tr></table>
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
Figure 8: Visualization of Training Rationales in Spurious-Motif Dataset. Structures with deeper colors mean higher importance. Nodes of ground truth rationales are colored by green.
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
Figure 9: Visualization of Testing Rationales in Spurious-Motif Dataset. Structures with deeper colors mean higher importance. Nodes of ground truth rationales are colored by green.
|
| 562 |
+
|
| 563 |
+
# F.2 SENSITIVITY ANALYSIS
|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
Figure 10: Sensitivity of Hyper-Parameter $\lambda ,$ . In each chart, dash line represents the performance of the best baseline in the corresponding dataset, and the area between ACC±std are colored.
|
| 567 |
+
|
| 568 |
+
We analyze the performance of DIR w.r.t. the hyper-parameter $\lambda$ . As shown in Figure 10, with $\lambda $ 0, DIR degrades to optimize the performance in each environment only, without explicitly penalizing the shortcuts’ influence on the model predictions. We also see that all testing performances drop sharply if $\lambda$ is too large. Since a large weight on the variance term emphasis on the invariance condition while leading to the overlook on the performance loss, it could fail to exhibit $f _ { \tilde { Y } }$ correctly. Notably, such a trade-off in the DIR objective is commonly shared among all the datasets.
|
| 569 |
+
|
| 570 |
+
# F.3 STUDY OF THE SPURIOUS CLASSIFIERS
|
| 571 |
+
|
| 572 |
+
Here we provide more observations about the predictions of the learned spurious classifier, which sheds light on the designed model mechanism. We first look into the confidence of predictions and define
|
| 573 |
+
|
| 574 |
+
$$
|
| 575 |
+
\nu = \mathbb { E } _ { ( g , y ) \in \mathcal { O } , \tilde { s } = g / h _ { \tilde { C } } ( g ) } H \left( \operatorname { S o f t m a x } ( \hat { y } _ { \tilde { s } } ) \right)
|
| 576 |
+
$$
|
| 577 |
+
|
| 578 |
+
Table 5: Performance of the Spurious Classifiers. $\Delta \downarrow$ indicates the performance gap of the spurious classifiers and the corresponding causal classifiers.
|
| 579 |
+
|
| 580 |
+
<table><tr><td></td><td>Spurious-Motif (b=0.9)</td><td>MNIST-75sp</td><td>GraphSST2</td><td>Molhiv</td></tr><tr><td>Spurious Classifiers</td><td>33.43±0.22</td><td>17.09±0.44</td><td>81.14±1.35</td><td>51.13±1.29</td></tr><tr><td></td><td>6.44</td><td>3.27</td><td>2.15</td><td>25.92</td></tr></table>
|
| 581 |
+
|
| 582 |
+
where $H$ is the entropy function, and a lower $\nu$ indicates higher confidence. We report the results for the trained spurious classifiers in Table 4. Thus, the results demonstrate the marked tendency of the spurious predictions and validate the design of the $S -$ only branch.
|
| 583 |
+
|
| 584 |
+
However, we show that spurious classifiers are over-confident and potentially overfit to spurious features, which fails to generalize out-of-distribution. In Table 5, we evaluate the spurious classifiers (taking non-causal features as inputs) on the testing sets. We argue that the performance degradation is caused by (i) feature-level problem: it could be theoretically inadequate to infer the label given the non-causal features, and (ii) paradigm-level problem: minimizing the empirical risk only can hardly exhibit stable relations between the features and labels.
|
| 585 |
+
|
| 586 |
+
F.4 COMPARISON OF POST-HOC EXPLANATIONS AND INTRINSIC RATIONALES.
|
| 587 |
+
|
| 588 |
+
Here we aim to compare the explanations generated by GNNExplainer (Ying et al., 2019) and the rationales exhibited by DIR. Specifically, we generate post-hoc explanations from GNNExplainer for Spurious-Motif, where we use the models trained under ERM as the models to explain. We compute the precision of the explanations in Table 6.
|
| 589 |
+
|
| 590 |
+
Table 6: Explanation/Rationale Accuracy in Spurious-Motif dataset. The results of DIR is consistent with Table 1 and we repeat them here for better view.
|
| 591 |
+
|
| 592 |
+
<table><tr><td></td><td>Balance</td><td>b=0.5</td><td>b=0.7</td><td>b=0.9</td></tr><tr><td>GNNExplainer</td><td>0.249±0.011</td><td>0.203±0.019</td><td>0.167±0.039</td><td>0.066±0.007</td></tr><tr><td>DIR</td><td>0.257±0.014</td><td>0.255±0.016</td><td>0.247±0.012</td><td>0.192±0.044</td></tr></table>
|
| 593 |
+
|
| 594 |
+
The explanations generated by GNNExplainer reflect the models’ inner mechanism, which backs that deep models easily learn from data bias (especially when $b$ is large), being at odds with the true reasoning process that underlies the task. Moreover, even when spurious correlations do not exist, the precisions of rationales generated by DIR still outperform the precisions of the post-hoc explanations, showing the effectiveness of DIR when identifying causal features.
|
| 595 |
+
|
| 596 |
+
# G OPEN DISCUSSIONS
|
| 597 |
+
|
| 598 |
+
Based on this work, we provide open discussions and future directions for the research community, which are inspired by the insightful comments of the ICLR reviewers.
|
| 599 |
+
|
| 600 |
+
# G.1 EXPRESSIVENESS OF RATIONALE GENERATORS
|
| 601 |
+
|
| 602 |
+
High expressiveness of the rationale generators could be beneficial for the identification of causal features. Therefore, we have offered additional techniques in our implementation to improve the expressiveness of the graph encoder. Specifically, we incorporate distance encoding measures (Li et al., 2020) like shortest-path distances as the extra node features for better structural representation learning. Also, more powerful graph encoders like RingGNN (Chen et al., 2019) and 3WLGNN (Maron et al., 2019) can be used as the graph encoders to distinguish different substructures better.
|
| 603 |
+
|
| 604 |
+
# G.2 GENERALIZATION TO UNSEEN SPURIOUS PATTERNS
|
| 605 |
+
|
| 606 |
+
In our implementation, the memory bank only contains the spurious patterns seen in the training set, while it could possibly fail to unseen spurious patterns. And we provide discussions and solutions to solve this limitation:
|
| 607 |
+
|
| 608 |
+
• Attribute level perturbation. When the spurious patterns in the testing are different from those in training set only on the attribute level, we can perturb the node/edge attributes of the subgraphs before intervention. And such perturbation is expected to improve the model’s robustness during inference. External knowledge base. When the spurious patterns also change on the structure level, for example, a star-shaped unseen base graph appears in the testing set of the Spurious-Motif, one potential solution is to resort to prior knowledge. We can enrich the memory bank with possible spurious patterns, e.g., tree (seen) and star (unseen) base graphs. With the external knowledge base, the model can be trained to recognize these possible spurious patterns and be well generalized to the testing dataset.
|
| 609 |
+
• Subgraph matching. In a more tricky scenario when the external knowledge base is not available, we can integrate our model with subgraph matching algorithms in the inference. For example, we can extract the training rationales into another bank $\tilde { \mathbb { C } }$ and use them to query the testing graphs, i.e., checking if similar patterns exist in the testing graphs. The match results may assist the rationale generator in highlighting the causal features and avoiding unseen spurious features.
|
| 610 |
+
|
| 611 |
+
# G.3 HIGHER LEVEL INTERPRETABILITY
|
| 612 |
+
|
| 613 |
+
The interpretability of GNNs in the feature level implicitly demands the separability of a graph into causal and non-causal features. At the same time, we see cases going beyond such assumption (cf. Appendix C.1). We believe we could resort to higher level interpretability. For example,
|
| 614 |
+
|
| 615 |
+
• Interpretability of representations (Wang et al., 2021a; Chan et al., 2021). Instead of highlighting important features for the model decisions, the general goal of representation interpretability answers “What’s the information encoded by the $i$ -th element of the embedding in the $j$ -th layer?”. • Interpretations on top of disentangled variables. Each disentangled latent variable reveals one independent generative factor in the data (Bengio et al., 2013). By generating importance score on these variables, we could possibly obtain more semantically rich interpretations than featurelevel interpretability.
|
| 616 |
+
|
| 617 |
+
Wherein, we believe there are fewer constraints on the separability of features. Thus, the models equipped with higher level interpretability could be applied to a broader range of data-generating assumptions.
|
md/dev/hopfHdHZGYe/hopfHdHZGYe.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TACE: TIME-AWARE CONVOLUTIONAL EMBEDDINGLEARNING FOR TEMPORAL KNOWLEDGE REASONING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Temporal knowledge graph completion (TKGC) is a challenging task to infer the missing component for quadruples. The key challenge lies at how to integrate time information into the embeddings of entities and relations. Recent TKGC methods tend to capture temporal patterns via linear or multilinear models, which are fast but not expressive enough. In this study, we propose a novel time-aware convolutional embedding model (TaCE) to represent the time-dependent facts in the task of TKGC. It highlights its novelty to feasibly convert timestamps as temporal convolutional filters to fully interact with entities and relations and learn temporal patterns in knowledge graphs (KGs). An extensive comparison proves that our model outperforms the state-of-the-art models on three public benchmark datasets of ICEWS14, ICEWS05-15 and GDELT. Results also demonstrate good temporal expressiveness and computation efficiency performed by our TaCE.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Knowledge graphs (KGs), storing facts in tuples, are often faced with incompletion. To solve this problem, knowledge graph embedding (KGE), mapping the entities and relations into a continuous vector space, has been developed to capture the semantic meanings for the task of KG reasoning (KGR) or KG completion (KGC) (Bordes et al., 2013; Trouillon et al., 2016; Sun et al., 2019). Both KGR and KGC aim at inferring the missing facts for a given knowledge graph (Chen et al., 2020). Traditional KGE or KGC approaches usually treat KGs to be static, which means that the nodes and edges of a KG would not evolve with the time (Kazemi et al., 2020; Ji et al., 2021). However, in reality, most facts or events are only valid at a specific point or over a certain period. For example, in “Franklin D.Roosevelt was in office during 1933-1945 and died on April 12th, 1945”, it indicates two facts (‘in office’ and ‘death’) related to the target person following different time orders and spans. In that case, KGC should be implemented at the temporal scale, and KGE models are supposed to have temporal awareness.
|
| 12 |
+
|
| 13 |
+
To better capture the knowledge evolution, recent temporal KG reasoning (TKGR) or temporal KG completion (TKGC) researches try to integrate the temporal information into the KGE procedure. Methods can be roughly divided into two categories: the structure-based methods and the sequencebased methods. Acting as an extension of static KGE modelling, the former type aims to project the entities and relations into a time-dependent vector space with the inherent KG structure preserved (Jiang et al., 2016; Dasgupta et al., 2018; Xu et al., 2020; Lacroix et al., 2020); they behave to be time-efficient on account of linear or multi-linear transformations but face with the shallow representation problem. The sequence-based methods (Jin et al., 2020; Wu et al., 2020; Li et al., 2021), splitting the entire KG into a sequence of graph snapshots along the time, rely on the sequence models such as the recurrent neural network (RNN) (Jin et al., 2020; Trivedi et al., 2017; Seo et al., 2018), long and short-term memory (LSTM) (Wu et al., 2020) or gated recurrent unit (GRU) (Li et al., 2021) to inherently encode temporal features. Although the performances based on the sequence models are reasonably good, they are computationally expensive when running over a large-scale KG. Moreover, their prediction results would be undermined by temporal sparsity to some extent due to the reason that only a small fraction of nodes and edges are activated at each time (Wu et al., 2020).
|
| 14 |
+
|
| 15 |
+
In this paper, we are inclined to apply the structure-based method to manage TKGR or TKGC. Inspired by the successful applications of convolutional networks on static KGE (Dettmers et al., 2018;
|
| 16 |
+
|
| 17 |
+
Jiang et al., 2019; Balazevi ˇ c et al., 2019a), we hereby build a novel time-aware convolutional embed- ´ ding (TaCE) model to infer the missing facts for a temporal knowledge graph (TKG). It highlights its advantage in generating the convolution filters constructed from timestamps and convolving the time information into the embeddings of entities and relations. Such a convolutional design enables the model to deeply, comprehensively and efficiently extract the temporal features and the static ones and achieves a better link prediction for the TKGC task. Results demonstrate that TaCE has the superiority in learning temporal information as well as its interactions with the entities and the relations. It balances the tradeoff between expressiveness and training speed. The key contributions of this article can be summarized as follows:
|
| 18 |
+
|
| 19 |
+
• We creatively propose time-aware convolution method to integrate the time information into the embeddings of entities and relations for a better link prediction.
|
| 20 |
+
• An extensive comparison has been conducted between TaCE and the state-of-the-art models to verify their performances on different public datasets.
|
| 21 |
+
• Further analyses have been done to prove that our model, TaCE, is able to capture the semantic meanings for the timestamps and learn facts with proper time order and consistency.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Static KG representation learning To discover the unknown facts in KGs, substantial static KGE methods have been proposed in the last decade. These methods commonly convert entities and relations into continuous vector spaces, and employ a scoring function to measure the plausibility of each candidate for KGC. TransE (Bordes et al., 2013), is one of the most widely-used transitional distance models, to embed entities and relations. Motivated by TransE, a series of similar models including TransH (Wang et al., 2014), TransR (Lin et al., 2015), and TransD (Ji et al., 2015) are developed to achieve better link predictions. RESCAL (Nickel et al., 2011) and its extensions (DistMult (Yang et al., 2014), ComplEx (Trouillon et al., 2016), and TuckER (Balazevi ˇ c et al., 2019b)) ´ represent typical semantic matching models using tensor/matric factorization. Apart from them, ConvE (Dettmers et al., 2018), ConvR (Jiang et al., 2019) and HypER (Balazevi ˇ c et al., 2019a) ´ recently ignite the passions of using convolution networks for KGE; they successfully prove their feature expressiveness better than those linear ones in link prediction. However, there is no study by far introducing convolution modelling into TKGC.
|
| 26 |
+
|
| 27 |
+
Temporal KG representation learning As forementioned, representation learning for TKG can be roughly categorized into two classes: structure-based models and sequence-based models. The former represent the quadruples in TKG by building time-sensitive embedding models. TTransE (Jiang et al., 2016) and DE-SimplE (Goel et al., 2020) integrate timestamp information into the corresponding the embeddings of relations and entities to infer the missing knowledge. HyTE (Dasgupta et al., 2018) projects the entities and relations to the temporal hyperplanes. ChronoR (Sadeghian et al., 2021) and TeRo (Xu et al., 2020), the most recent works, treat the timestamped relations as a temporal rotation from the head entity to the tail entity. Sequence-based models, including KnowEvolve (Trivedi et al., 2017), GCRN (Seo et al., 2018), RE-NET (Jin et al., 2020) and RE-GCN (Li et al., 2021), attempt to use the sequential networks such as RNN, LSTM and GRU to learn timedependent facts. However, they are designed for the task of graph extrapolation and “not compatible with TKGC settings (Wu et al., 2020). TeMP (Wu et al., 2020) is one of the sequence-based models, designed for TKGC tasks using graph neural network (GNN) and LSTM to capture the intra-graph patterns and inter-graph relationships, respectively. Therefore, we group TeMP, as the representative for the sequence-based model, into our baselines.
|
| 28 |
+
|
| 29 |
+
# 3 PROBLEM FORMULATION
|
| 30 |
+
|
| 31 |
+
Before going to the details of our TaCE model, we formally define the key notations and TKGC task.
|
| 32 |
+
|
| 33 |
+
Temporal Knowledge Graph (TKG) A TKG $G$ is composed by a set of real-world facts $\mathcal { G } =$ $\{ ( s , r , o , t ) \mid s , r \in \mathcal { E } , r \in \mathcal { R } , t \in \mathcal { T } \}$ , where, in each quadruple, $s$ denotes the head entity, $r$ is the relation, $o$ is the tail entity, $t$ is a discretized timestamp; $\mathcal { E } , \mathcal { R }$ and $\tau$ stand for the all the entities, relations and timestamps belong to the TKG.
|
| 34 |
+
|
| 35 |
+
Temporal Knowledge Graph Completion (TKGC) The task of TKGC or TKGR is to infer the missing component, $( ? , r , o , t )$ , $\left( s , r , ? , t \right)$ or $( s , ? , o , t )$ , given that the other three elements of the quadruple are known. It is supposed that the missing part exists in $\mathcal { E } , \mathcal { R }$ . In this article, our job focuses on predicting the missing head or tail entity, but we only take $\left( s , r , ? , t \right)$ as the example for modelling expression in later section.
|
| 36 |
+
|
| 37 |
+
4 METHOD: TACE
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: A framework of the proposed TaCE model for TKGC tasks.
|
| 41 |
+
|
| 42 |
+
# 4.1 FRAMEWORK OF TACE
|
| 43 |
+
|
| 44 |
+
The model of TaCE is mainly composed of four components: the temporal convolution module aims to construct temporal convolution filters to go through the input entities and relations to obtain the time-aware representations for all the input; the static convolution module, as the name suggests, is to facilitate the convolution across all the entities and relations again to learn the context information changed without the time; the deep learning module, made up of several hidden layers, is responsible for comprehensively and deeply drawing the representations carried both from the temporal and static modules; after that, the prediction layer delivers the probability for each tail entity candidate to suggest the most likely answer for the incomplete $\mathcal { G }$ . Figure 1 displays the architecture of TaCE.
|
| 45 |
+
|
| 46 |
+
# 4.2 TEMPORAL CONVOLUTION MODULE
|
| 47 |
+
|
| 48 |
+
In this module, the temporal information formed by the timestamp $t \in \mathcal T$ is fully integrated into the subject entity $s \in { \mathcal { E } }$ and the relation $r \in \mathcal { R }$ via the convolution filters adaptively constructed from the timestamp $t$ .
|
| 49 |
+
|
| 50 |
+
• Firstly, to integrate the time information into the entity $s$ and the relation $r$ , the temporal convolution filters are developed. They are constructed from the timestamp embedding $\mathbf { e } _ { t } \in \mathbb { R } ^ { d _ { t } }$ , where $d _ { t }$ is the embedding size of the timestamps. Originally derived from the timestamp $t$ , $\mathbf { e } _ { t }$ is the input into a fully connected layer $f _ { c }$ to get a vector $\mathbf { v } _ { t }$ with a proper length for further processing; then $\mathbf { e } _ { t }$ is further split into a set of 1D convolution filters $\mathbf F _ { t } = \left\{ \mathbf k _ { t } ^ { ( 1 ) } , \mathbf k _ { t } ^ { ( 2 ) } , \ldots , \mathbf k _ { t } ^ { ( c ) } \right\}$ sharing the same size, where $\mathbf { k } _ { t } ^ { ( l ) } \in \mathbb { R } ^ { w }$ represents the lth convolution filter, $w$ denotes the embedding size of the filters and $c$ denotes the number of the filters. The procedure of constructing temporal convolution filters is illustrated in Figure 2.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Construction of temporal convolution filters.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 3: Convolution with temporal convolution filters.
|
| 57 |
+
|
| 58 |
+
• Secondly, before filtered by temporal convolutional filters $\mathbf { F } _ { t }$ , the subject entity embedding $\mathbf { e } _ { s } ~ \in ~ \mathbb { R } ^ { d _ { e } }$ and the relational embedding $\mathbf { e } _ { r } ~ \in ~ \mathbb { R } ^ { d _ { r } }$ are stacked up like an ‘image’ with multi channels, with $d _ { e } ~ = ~ d _ { r }$ arepresenting the embedding size of entities and relations respectively. Such a stacking operation enables both the entity information and relation information to feasibly act with $\mathbf { F } _ { t }$ . After convolved by $\mathbf { F } _ { t }$ , the corresponding temporal feature maps ${ \bf M } _ { t e m p } = \left\{ \bar { \bf m } _ { t } ^ { ( 1 ) } , \bar { \bf m } _ { t } ^ { ( 2 ) } , \dots , \bar { \bf m } _ { t } ^ { ( c ) } \right\}$ , where $\mathbf { m } _ { t } ^ { ( l ) } \in \mathbb { R } ^ { d _ { e } - w + 1 }$ is the lth feature map convolved from the subject entity embedding $\mathbf { e } _ { s }$ and the relational embedding $\mathbf { e } _ { r }$ , and $c$ is equal to the number of filters. The convolution with temporal convolution filters is illustrated in Figure 3. $\mathbf { h } _ { s }$ and $\mathbf { h } _ { r }$ denote the convolved $\mathbf { e } _ { s }$ and $\mathbf { e } _ { r }$ respectively in Figure 3.
|
| 59 |
+
|
| 60 |
+
• Finally, the matrix $\mathbf { M } _ { t e m p }$ feed into a fully connected layer $f _ { t e m p }$ to obtain the flatten knowledge feature of $\mathbf { a } _ { t e m p } \in \mathbb { R } ^ { d _ { e } }$ .
|
| 61 |
+
|
| 62 |
+
The equation of the temporal block is formulated as follow:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbf { a } _ { t e m p } = f _ { t e m p } \left( \left[ \mathbf { e } _ { s } ; \mathbf { e } _ { r } \right] _ { 3 } * v e c ^ { - 1 } \left( f _ { c } ( \mathbf { e } _ { t } ) \right) \right)
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where, $v e c ^ { - 1 }$ is a splitting operator to reshape the embedding $\mathbf { e } _ { t }$ of the timestamp $t$ into a set of filters, $^ *$ represents the convolutional operations, and $[ \mathbf { e } _ { s } ; \mathbf { e } _ { r } ] _ { 3 }$ represents the stacked tensor made up of the embedding $\mathbf { e } _ { s }$ and the embedding $\mathbf { e } _ { r }$ .
|
| 69 |
+
|
| 70 |
+
# 4.3 STATIC CONVOLUTION MODULE
|
| 71 |
+
|
| 72 |
+
To capture the potential static information from a TKG, all the nodes and edges to form a TKG will go through the same set of the time-independent convolutional filters $\mathbf { F } = \left\{ \mathbf { k } ^ { ( 1 ) } , \mathbf { k } ^ { ( 2 ) } , \ldots , \mathbf { k } ^ { ( c ) } \right\}$ with timestamps omitted. Each filter $\mathbf { k } ^ { ( l ) } \in \mathbb { R } ^ { w }$ in $\mathbf { F }$ is randomly initialized rather than constructed
|
| 73 |
+
|
| 74 |
+
from timestamps, as so to make filters time-irrelevant. The procedure of static embedding is described as:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathbf { a } _ { s t a t } = f _ { s t a t } \left( [ \mathbf { e } _ { s } ^ { \prime } ; \mathbf { e } _ { r } ^ { \prime } ] _ { 3 } * \mathbf { F } \right)
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where, $\mathbf { e } _ { s } ^ { \prime } \in \mathbb { R } ^ { \prime ^ { d _ { e } } }$ and ${ \bf e } _ { r } ^ { \prime } \in \mathbb { R } ^ { \prime ^ { d _ { r } } }$ represent the static embeddings for the subject $s$ and the relation $r$ , respectively. $f _ { s t a t }$ is a fully connected layer; $\mathbf { a } _ { s t a t }$ presents the final extracted static KGs patterns.
|
| 81 |
+
|
| 82 |
+
# 4.4 DEEP LEARNING MODULE
|
| 83 |
+
|
| 84 |
+
Deep learning module brings the temporal feature $\mathbf { a } _ { t e m p }$ (derived from the temporal block) and the static feature $\mathbf { a } _ { s t a t }$ (derived from the static block) into the multiple hidden layers to extract a better representation of $\mathbf { a } \in \mathbb { R } ^ { d _ { e } }$ for all knowledge. The hidden layers are defined as follows:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\left\{ \begin{array} { l l } { \mathbf { u } _ { 1 } } & { = \sigma _ { 1 } ( f _ { 1 } ( [ \mathbf { a } _ { t e m p } ; \mathbf { a } _ { s t a t } ] ) ) } \\ { \mathbf { u } _ { 2 } } & { = \sigma _ { 2 } ( f _ { 2 } ( \mathbf { u } _ { 1 } ) ) } \\ & { \cdot \cdot \cdot } \\ { \mathbf { u } _ { n } } & { = \sigma _ { n } ( f _ { n } ( \mathbf { u } _ { n - 1 } ) ) } \end{array} \right.
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where, $n$ is the number of hidden layers, $f _ { n }$ denotes the linear operation for the hidden layer $n$ , $\sigma _ { n }$ is the activation function of the hidden layer $n$ , $\mathbf { u } _ { i }$ is the result of the $i$ th hidden layer, and we use LeakyReLU as the activation function for hidden layers.
|
| 91 |
+
|
| 92 |
+
# 4.5 LINK PREDICTION MODULE
|
| 93 |
+
|
| 94 |
+
The sigmoid is chosen as the scoring function $\varphi$ to predict the missing object entity $o$ for the quadtuple $\left( s , r , ? , t \right)$ :
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\varphi ( s , r , o , t ) = f ( \mathbf { e } _ { o } \mathbf { u } _ { n } )
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $f$ is the sigmoid function; $\mathbf { u } _ { n }$ is the hidden representation from the deep learning module. The complete formulation of $\varphi$ for the task of TKGC is defined as:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r l } & { \varphi ( s , r , o , t ) = } \\ & { \qquad f ( \mathbf { e } _ { o } \sigma _ { n } ( f _ { n } ( \dots ( \sigma _ { 1 } ( f _ { 1 } ( [ f _ { t e m p } ( [ \mathbf { e } _ { s } ; \mathbf { e } _ { r } ] _ { 3 } * v e c ^ { - 1 } f _ { c } ( \mathbf { e } _ { t } ) ; f _ { s t a t } ( [ \mathbf { e } _ { s } ^ { \prime } ; \mathbf { e } _ { r } ^ { \prime } ] _ { 3 } * \mathbf { F } ) ) ) ] ) ) ) ) } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
TaCE is capable of providing scores for all candidate object entities contained by $\mathcal { E }$ , by employing an 1-N strategy. Such the 1-N strategy can speed up the entire scoring procedure which can be referenced to Dettmers et al. (2018) and Balazevi ˇ c et al. (2019a). We apply the binary cross entropy ´ (BCE) loss function $\mathcal { L }$ to train the model:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathcal { L } = - \frac { 1 } { n } \sum _ { i = 1 } ^ { n } y _ { i } l o g ( p _ { i } ) + ( 1 - y _ { i } ) l o g ( 1 - p _ { i } )
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where n presents the number of candidate entities; $y _ { i }$ labels the true $y _ { i } = 1 \AA ,$ ) or false $( y _ { i } = 0 )$ ) prediction for the $i ^ { t h }$ candidate tail entity; $p _ { i }$ denotes the probability of the $i ^ { t h }$ candidate object entity upon the score function $\varphi$ .
|
| 113 |
+
|
| 114 |
+
# 5 EXPERIMENTS
|
| 115 |
+
|
| 116 |
+
# 5.1 EXPERIMENTAL SETTINGS
|
| 117 |
+
|
| 118 |
+
Datasets We test TaCE on six public benchmarks, namely, ICEWS14, ICEWS05-15, GDELT, YAGO11k, WIKIDATA12k and YAGO15k. Among them ICEWS14 and ICEWS05-15 are collected from the Integrated Crisis Early Warning System (ICEWS) with different time spans (Ward et al., 2013); the GDELT dataset is obtained from the Global Database of Events, Language, and Tone (GDELT) (Leetaru & Schrodt, 2013), spanning from April 1st, 2015 to March 31st, 2016; YAGO11k and WIKIDATA12k are extracted from YAGO3 (Mahdisoltani et al., 2014) and Wikidata (Erxleben et al., 2014) with time intervals (Xu et al., 2020); YAGO15k is the only one among the six that has incomplete time information, with $7 3 . 4 \%$ of the total number having no timestamps (Lacroix et al., 2020). Data details can be referred to Table 1.
|
| 119 |
+
|
| 120 |
+
Table 1: Statistics of the datasets. $( \| \mathcal { E } \| , \| \mathcal { R } \|$ and $\| T \|$ are the total number of entities, relations and timestamps, respectively. $\| t r a i n \|$ , kvalidation $\parallel$ and $\| t e s t \|$ are the number of quadruples in training, validation and test sets. $\| \mathcal G \|$ is the sum of $\| t r a i n \|$ , $\| v a l i d a t i o n \|$ and $\| t e s t \|$ )
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Dataset</td><td>1|</td><td>|R|</td><td>T</td><td>|train|l</td><td>|l validation|l</td><td>|test|l</td><td>|9|</td></tr><tr><td>ICEWS14</td><td>7,128</td><td>230</td><td>365</td><td>72,826</td><td>8,941</td><td>8,963</td><td>90,730</td></tr><tr><td>ICEWS05-15</td><td>10,488</td><td>251</td><td>4017</td><td>368,962</td><td>46,275</td><td>46,092</td><td>461,329</td></tr><tr><td>GDELT</td><td>500</td><td>20</td><td>366</td><td>2,735,685</td><td>341,961</td><td>341,961</td><td>3,419,607</td></tr><tr><td>YAGO11k</td><td>10,622</td><td>10</td><td>398</td><td>16,408</td><td>2.050</td><td>2.051</td><td>20,509</td></tr><tr><td>WIKIDATA12k</td><td>12,554</td><td>24</td><td>614</td><td>32,497</td><td>4,062</td><td>4,062</td><td>40,621</td></tr><tr><td>YAGO15k</td><td>15,403</td><td>34</td><td>170</td><td>110,441</td><td>13,815</td><td>13,800</td><td>138,056</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Evaluation Metrics Metrics including Hits $@ 1$ , Hits $@ 3$ , Hits $@ 1 0$ , and Mean Reciprocal Rank (MRR) are involved to measure the performances of TaCE against the baseline models. Metric formulations can be found in Appendix A.2.
|
| 125 |
+
|
| 126 |
+
Baselines For a broad comparison, we collect as many KGE models as we can find. These baseline models are grouped into two: 1) the static ones, including TransE (Bordes et al., 2013), DistMult (Yang et al., 2014), ComplEx Trouillon et al. (2016), ConvE (Dettmers et al., 2018) and HypER (Balazevi ˇ c et al., 2019a); 2) the temporal ones, covering TTransE (Jiang et al., 2016), HyTE (Das- ´ gupta et al., 2018), TA-DistMult (Garc´ıa-Duran et al., 2018), DE-SimplE (Goel et al., 2020), TIME- ´ PLEX (Jain et al., 2020), TNTComplEx (Lacroix et al., 2020), TeRo (Xu et al., 2020), TeMP (Wu et al., 2020), and ChronoR (Sadeghian et al., 2021). The latter three, TNTComplEx, TeMP and ChronoR, to the best of our knowledge, are most recent models.
|
| 127 |
+
|
| 128 |
+
Parameter Settings For training and evaluation, the embedding size for entity, for relation and for timestamp are set equally the same, $d _ { e } = d _ { r } = d _ { t } = 2 0 0$ ; the batch size is set to 512. We adopt Adam Optimizer (Kingma & Ba, 2015) for parameter training. More details about the parameter settings can be found in Appendix A.3.
|
| 129 |
+
|
| 130 |
+
# 5.2 RESULTS AND COMPARISON
|
| 131 |
+
|
| 132 |
+
The experimental results associated with each model are summarized: the results on ICEWS14, ICEWS05-15 and GDELT are shown in Table 2; the results on YAGO11k, WIKIDATA12k and $\mathrm { Y A G O 1 5 k }$ are shown in Table 5 in Appendix A.1 due to the page limitation. In general, our TaCE achieves the better performances on the datasets. When driving five traditional static models over the six TKG datasets, it is not surprising that none of them can provide satisfactory link predictions due to incapability of considering temporal information. Impressively, TaCE generally achieves better performances against its temporal opponents. On ICEWS14 and ICEWS05-15, TaCE delivers the upmost improvement of $4 . 9 \%$ on MRR and $6 . 5 \%$ on Hits $@ 1$ against the latest competitor, ChronoR. Although TaCE does not outperform TeMP on Hits $@ 1 0$ , the rest marks on ICEWS14 and ICEWS05- 15 indicate the superiority of TaCE. On GDELT dataset, TaCE leverages the rates of four metrics by at least $7 \%$ against its temporal opponents. Compared with our compellers, TaCE achieves the best on YAGO11k and WIKIDATA12k in terms of MRR, Hits $@ 1$ and Hits $\textcircled { a } 3$ ; results on YAGO15k are also acceptable, with Hits $@ 1$ reaching the highest and MRR and Hits $@ 3$ slightly lower than the SOTA (ChronoR). Overall, TaCE presents its effectiveness on link prediction by employing temporal convolutional filters to represent its interactions with entities and with relations.
|
| 133 |
+
|
| 134 |
+
# 5.3 EMBEDDING VISUALIZATION
|
| 135 |
+
|
| 136 |
+
To demonstrate the temporal expressiveness learned by TaCE, we use T-SNE to project the trained embeddings of $\mathbf { e } _ { t }$ (for timestamps) and $\mathbf { a } _ { t e m p }$ (for entity+relation) onto a 2D plane. Results are displayed in Figure 4&5.
|
| 137 |
+
|
| 138 |
+
Visualization of $\mathbf { e } _ { t }$ According to Figure 4, the dimension-reduced $\mathbf { e } _ { t }$ representing for the timestamps shows a good clustering pattern at different time scales: (a) and (b) demonstrate that the $\mathbf { e } _ { t }$ points for ICEWS05-15 within the same year are clustered well together, transitioning from one year to another; interestingly, the $\mathbf { e } _ { t }$ for GDELT in (c) and (d) within the same months consecutively form a curving chain. In summary, the time embedding $\mathbf { e } _ { t }$ , trained by the convolution networks in TaCE, can automatically learn good sematic meanings for temporal order by itself.
|
| 139 |
+
|
| 140 |
+
Table 2: Link prediction results on ICEWS14, ICEWS05-15 and GDELT datasets. The best results for each metric are marked in bold. All numbers of results are multiplied by $100 \%$ . Missing scores not reported are denoted by “–”. Due to limited space, we use $\mathrm { H @ 1 }$ , $\mathrm { H @ 3 }$ and $\mathrm { H @ 1 0 }$ to represent Hits $@ 1$ , Hits $\textcircled { \omega } 3$ and Hits $@ 1 0$ , respectively.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">ICEWS14</td><td colspan="4">ICEWS05-15</td><td colspan="4">GDELT</td></tr><tr><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td></tr><tr><td>TransE(2013)</td><td>32.6</td><td>15.4</td><td>43.0</td><td>64.4</td><td>33.0</td><td>15.2</td><td>44.0</td><td>66.0</td><td>15.5</td><td>6.0</td><td>17.8</td><td>33.5</td></tr><tr><td>DistMult(2014)</td><td>44.1</td><td>32.5</td><td>49.8</td><td>66.8</td><td>45.7</td><td>33.8</td><td>51.5</td><td>69.1</td><td>21.0</td><td>13.3</td><td>22.4</td><td>36.5</td></tr><tr><td>ComplEx(2016)</td><td>44.2</td><td>40.0</td><td>43.0</td><td>66.4</td><td>46.4</td><td>34.7</td><td>52.4</td><td>69.6</td><td>21.3</td><td>13.3</td><td>22.5</td><td>36.6</td></tr><tr><td>ConvE(2018)</td><td>46.2</td><td>34.2</td><td>52.5</td><td>70.0</td><td>46.7</td><td>34.4</td><td>53.1</td><td>70.5</td><td>18.1</td><td>9.9</td><td>19.3</td><td>33.9</td></tr><tr><td>HypER(2019)</td><td>47.0</td><td>35.1</td><td>53.3</td><td>70.6</td><td>48.2</td><td>35.8</td><td>54.9</td><td>72.0</td><td>19.7</td><td>11.2</td><td>21.2</td><td>36.4</td></tr><tr><td>TTransE(2016)</td><td>25.5</td><td>7.4</td><td>1</td><td>60.1</td><td>27.1</td><td>8.4</td><td>1</td><td>61.6</td><td>11.5</td><td>0.0</td><td>16.0</td><td>31.8</td></tr><tr><td>HyTE(2018)</td><td>29.7</td><td>10.8</td><td>41.6</td><td>65.5</td><td>31.6</td><td>11.6</td><td>44.5</td><td>68.1</td><td>11.8</td><td>0.0</td><td>16.5</td><td>32.6</td></tr><tr><td>TA-DistMult(2018)</td><td>47.7</td><td>1</td><td>36.3</td><td>68.6</td><td>47.4</td><td>34.6</td><td>-</td><td>72.8</td><td>20.6</td><td>12.4</td><td>21.9</td><td>36.5</td></tr><tr><td>DE-SimplE(2020)</td><td>52.6</td><td>41.8</td><td>59.2</td><td>72.5</td><td>51.3</td><td>39.2</td><td>57.8</td><td>74.8</td><td>23.0</td><td>14.1</td><td>24.8</td><td>40.3</td></tr><tr><td>TIMEPLEX(2020)</td><td>60.4</td><td>51.5</td><td>1</td><td>77.1</td><td>64.0</td><td>54.5</td><td>1</td><td>81.8</td><td>1</td><td>-</td><td>1</td><td>1</td></tr><tr><td>TNTComplEx(2020)</td><td>60.7</td><td>51.9</td><td>65.9</td><td>77.2</td><td>66.6</td><td>58.3</td><td>71.8</td><td>81.7</td><td>1</td><td>-</td><td>1</td><td>1</td></tr><tr><td>TeRo(2020)</td><td>56.2</td><td>46.8</td><td>62.1</td><td>73.2</td><td>58.6</td><td>46.9</td><td>66.8</td><td>79.5</td><td>-</td><td>1</td><td>-</td><td>-</td></tr><tr><td>TeMP(2020)</td><td>60.7</td><td>48.4</td><td>68.4</td><td>84.0</td><td>68.0</td><td>55.3</td><td>76.9</td><td>91.3</td><td>23.2</td><td>15.2</td><td>24.5</td><td>37.7</td></tr><tr><td>ChronoR(2021)</td><td>62.5</td><td>54.7</td><td>66.9</td><td>77.3</td><td>67.5</td><td>59.6</td><td>72.3</td><td>82.0</td><td>1</td><td>-</td><td>-</td><td>-</td></tr><tr><td>TaCE(ours)</td><td>67.4</td><td>61.2</td><td>71.0</td><td>78.8</td><td>68.3</td><td>61.2</td><td>72.6</td><td>81.1</td><td>31.4</td><td>22.6</td><td>34.0</td><td>48.6</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Visualization of $\mathbf { a } _ { t e m p }$ In Figure 5, $\mathbf { a } _ { t e m p }$ stands for the mapping representations of facts (s: boko haram, $r :$ use conventional military force) in different years. It can be observed that this sampled temporal fact based on ICEW05-15 is evolving with time in 2011, 2013 and 2015; points sharing close distances are usually those falling in the same year. Hence, it convinces that our model has the capability of capturing evolving facts with semantic meanings.
|
| 145 |
+
|
| 146 |
+
# 5.4 THE AWARENESS OF TIME
|
| 147 |
+
|
| 148 |
+
To further demonstrate the time awareness of TaCE in factual prediction, we further plot the probabilities provided by TaCE for the fact who (Umaru Musa Yar’Adua or Muhammadu Buhari) potentially made a “statement” for the “Government (Nigeria)” during 2005-2015 as shown in Figure 6. Upon the knowledge shown in Appendix A.4, Umaru Musa Yar’Adua and Muhammadu Buhari hold their president tenure in different years. Our TaCE infers that Umaru Musa Yar’Adua has the highest scores for the fact (s: ?, r: make statement, o: Government (Nigeria), 2007-2011), but Muhammadu Buhari for (s: ?, r: make statement, o: Government (Nigeria), 2015). The reasoning results match the grounding truth, implying that our model has good time awareness to distinguish fact rankings along the time. A list of Nigerian presidents and their tenure during 2005-2015 can be found in Appendix A.4.
|
| 149 |
+
|
| 150 |
+
# 5.5 ABLATION STUDY
|
| 151 |
+
|
| 152 |
+
We conduct ablation studies on ICEWS14 to explore to what extent the temporal and static components may impact on the model prediction. The testing results are reported in Table 3.
|
| 153 |
+
|
| 154 |
+
Impact of temporal embedding module When we remove the temporal embedding module from TaCE, the model only performs as a static KGE model. The prediction results for MRR, Hits $@ 1$ , Hits $@ 3$ and Hits $@ 1 0$ all bear significant drops compared to the states under the full condition. It highlights that the model closely relies on the temporal module to capture the evolving knowledge to enhance its prediction accuracy.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: Visualization of $\mathbf { e } _ { t }$ . (a)&(b) map out all the trained temporal embeddings based on ICEWS05-15, with the ones in the same year marked by the same color; (c) maps out all the timestamps contained in GDELT with the ones in the same month marked by the same color; (d) is the zoom-in region highlighted by the red circle in subgraph (c).
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 5: Visualization of $\mathbf { a } _ { t e m p }$ representing the incomplete fact of $s$ : boko haram, r: use conventional military force in different years, based on the training of ICEWS05-15.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 6: Probabilities for the fact (s:?, $r \div$ make statement, o: Government (Nigeria)) druing 2005-2015, based on the training of ICEWS05- 15.
|
| 164 |
+
|
| 165 |
+
Impact of static embedding module The static embedding module is responsible for learning the context knowledge of a KG. It can be observed that the performance of TaCE is slightly undermined when removing the static component off the model. This is due to the reason that ICEWS are highly dynamic data. If a KG contains more static facts, i.e., (Beijing, located in, China) or (Barack Obama, spouse of, Michelle Obama), the KGE model is necessary to incorporate the static embedding module to represent the context knowledge properly.
|
| 166 |
+
|
| 167 |
+
Table 3: Ablation studies of TKGC tasks on ICEWS14. MRR, Hits $@ 1$ , Hits $\textcircled { \alpha } 3$ and Hits $@ 1 0$ are calculated with all numbers are multiplied by $100 \%$ .
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Configuration</td><td>MRR</td><td>Hits@1</td><td>Hits@3</td><td>Hits@10</td></tr><tr><td>TaCE</td><td>67.4</td><td>61.2</td><td>71.0</td><td>78.8</td></tr><tr><td> TaCE without temporal embedding module</td><td>48.9</td><td>37.3</td><td>54.7</td><td>72.0</td></tr><tr><td>TaCE without static embedding module</td><td>66.2</td><td>59.6</td><td>70.0</td><td>78.4</td></tr></table>
|
| 170 |
+
|
| 171 |
+
# 5.6 TRAINING EFFICIENCY
|
| 172 |
+
|
| 173 |
+
To test the training efficiency of TaCE for the TKGC task, we conduct a comparison of our model against its two competitors, TNTComplEx (a structure-based model) and TeMP (a sequence-based model). The tests are implemented on training 72,826 quadruples for ICEWS14 under the same computing environment. The results are shown in Table 4. Among the three tested models, TNTComplEx performs as the fastest one due to owning the tensor factorization method in its algorithm. TaCE, running convolution networks over a KG, can achieve a satisfying efficiency. TeMP costs two orders of magnitude of time to complete the whole train task, as it applies a complex GRU model to learn temporal patterns. The runtime will soar up to a high level when running over billions or trillions of facts.
|
| 174 |
+
|
| 175 |
+
Table 4: Training efficiency (in seconds) on ICEWS14.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Model</td><td>Runtime (one epoch)</td></tr><tr><td>TNTComplEx</td><td>2.5</td></tr><tr><td>TeMP</td><td>316.8</td></tr><tr><td>TaCE(our model)</td><td>4.9</td></tr></table>
|
| 178 |
+
|
| 179 |
+
# 6 CONCLUSION
|
| 180 |
+
|
| 181 |
+
In this paper, a convolution-based model called TaCE is proposed to manage the task of TKGC. The key idea is to generate the timestamp-based convolution filters based on timestamps to convolve the time-dependent entities and relations contained in a knowledge graph. Such a design allows the model to have a good expressiveness for the evolving knowledge and enables it to distinguish the facts with the time order and consistency. Furthermore, it can easily combine the static knowledge features together to achieve a better link prediction. The model has good efficiency in training procedure which allows it to run over those large-scale KGs. Additional properties such as spatial information or the description of an entity are expected to add in easily, however, this would refer to another paper in the future.
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Ivana Balazevi ˇ c, Carl Allen, and Timothy M Hospedales. Hypernetwork knowledge graph embed-´ dings. In International Conference on Artificial Neural Networks, pp. 553–565. Springer, 2019a.
|
| 186 |
+
|
| 187 |
+
Ivana Balazeviˇ c, Carl Allen, and Timothy M Hospedales. Tucker: Tensor factorization for knowl-´ edge graph completion. Proceedings of the 2019 Conference on Empirical Methods in Natural
|
| 188 |
+
|
| 189 |
+
Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 2019b.
|
| 190 |
+
|
| 191 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. Advances in neural information processing systems, 26, 2013.
|
| 192 |
+
|
| 193 |
+
Xiaojun Chen, Shengbin Jia, and Yang Xiang. A review: Knowledge reasoning over knowledge graph. Expert Systems with Applications, 141:112948, 2020.
|
| 194 |
+
|
| 195 |
+
Shib Sankar Dasgupta, Swayambhu Nath Ray, and Partha Talukdar. Hyte: Hyperplane-based temporally aware knowledge graph embedding. In Proceedings of the 2018 conference on empirical methods in natural language processing, pp. 2001–2011, 2018.
|
| 196 |
+
|
| 197 |
+
Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2d knowledge graph embeddings. In Thirty-second AAAI conference on artificial intelligence, 2018.
|
| 198 |
+
|
| 199 |
+
Fredo Erxleben, Michael Gunther, Markus Kr ¨ otzsch, Julian Mendez, and Denny Vrande ¨ ciˇ c. Intro-´ ducing wikidata to the linked data web. In International semantic web conference, pp. 50–65. Springer, 2014.
|
| 200 |
+
|
| 201 |
+
Alberto Garc´ıa-Duran, Sebastijan Duman ´ ciˇ c, and Mathias Niepert. Learning sequence encoders ´ for temporal knowledge graph completion. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, 2018.
|
| 202 |
+
|
| 203 |
+
Rishab Goel, Seyed Mehran Kazemi, Marcus Brubaker, and Pascal Poupart. Diachronic embedding for temporal knowledge graph completion. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 3988–3995, 2020.
|
| 204 |
+
|
| 205 |
+
Prachi Jain, Sushant Rathi, Soumen Chakrabarti, et al. Temporal knowledge base completion: New algorithms and evaluation protocols. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, 2020.
|
| 206 |
+
|
| 207 |
+
Guoliang Ji, Shizhu He, Liheng Xu, Kang Liu, and Jun Zhao. Knowledge graph embedding via dynamic mapping matrix. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 687–696, 2015.
|
| 208 |
+
|
| 209 |
+
Shaoxiong Ji, Shirui Pan, Erik Cambria, Pekka Marttinen, and S Yu Philip. A survey on knowledge graphs: Representation, acquisition, and applications. IEEE Transactions on Neural Networks and Learning Systems, 2021.
|
| 210 |
+
|
| 211 |
+
Tingsong Jiang, Tianyu Liu, Tao Ge, Lei Sha, Baobao Chang, Sujian Li, and Zhifang Sui. Towards time-aware knowledge graph completion. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pp. 1715–1724, 2016.
|
| 212 |
+
|
| 213 |
+
Xiaotian Jiang, Quan Wang, and Bin Wang. Adaptive convolution for multi-relational learning. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 978–987, 2019.
|
| 214 |
+
|
| 215 |
+
Woojeong Jin, He Jiang, Meng Qu, Tong Chen, Changlin Zhang, Pedro Szekely, and Xiang Ren. Recurrent event network: Autoregressive structure inference over temporal knowledge graphs. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, 2020.
|
| 216 |
+
|
| 217 |
+
Seyed Mehran Kazemi, Rishab Goel, Kshitij Jain, Ivan Kobyzev, Akshay Sethi, Peter Forsyth, and Pascal Poupart. Representation learning for dynamic graphs: A survey. J. Mach. Learn. Res., 21 (70):1–73, 2020.
|
| 218 |
+
|
| 219 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. ICLR(Poster), 2015.
|
| 220 |
+
|
| 221 |
+
Timothee Lacroix, Guillaume Obozinski, and Nicolas Usunier. Tensor decompositions for temporal ´ knowledge base completion. International Conference on Learning Representations, 2020.
|
| 222 |
+
|
| 223 |
+
Kalev Leetaru and Philip A Schrodt. Gdelt: Global data on events, location, and tone, 1979–2012. In ISA annual convention, volume 2, pp. 1–49. Citeseer, 2013.
|
| 224 |
+
|
| 225 |
+
Zixuan Li, Xiaolong Jin, Wei Li, Saiping Guan, Jiafeng Guo, Huawei Shen, Yuanzhuo Wang, and Xueqi Cheng. Temporal knowledge graph reasoning based on evolutional representation learning. arXiv preprint arXiv:2104.10353, 2021.
|
| 226 |
+
|
| 227 |
+
Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In Twenty-ninth AAAI conference on artificial intelligence, 2015.
|
| 228 |
+
|
| 229 |
+
Farzaneh Mahdisoltani, Joanna Biega, and Fabian Suchanek. Yago3: A knowledge base from multilingual wikipedias. In 7th biennial conference on innovative data systems research. CIDR Conference, 2014.
|
| 230 |
+
|
| 231 |
+
Maximilian Nickel, Volker Tresp, and Hans-Peter Kriegel. A three-way model for collective learning on multi-relational data. In Icml, 2011.
|
| 232 |
+
|
| 233 |
+
Ali Sadeghian, Mohammadreza Armandpour, Anthony Colas, and Daisy Zhe Wang. Chronor: Rotation based temporal knowledge graph embedding. Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
|
| 234 |
+
|
| 235 |
+
Youngjoo Seo, Michael Defferrard, Pierre Vandergheynst, and Xavier Bresson. Structured sequence ¨ modeling with graph convolutional recurrent networks. In International Conference on Neural Information Processing, pp. 362–373. Springer, 2018.
|
| 236 |
+
|
| 237 |
+
Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. International Conference on Learning Representations, 2019.
|
| 238 |
+
|
| 239 |
+
Rakshit Trivedi, Mehrdad Farajtabar, Yichen Wang, Hanjun Dai, Hongyuan Zha, and Le Song. Know-evolve: Deep reasoning in temporal knowledge graphs. arXiv preprint arXiv:1705.05742, 2017.
|
| 240 |
+
|
| 241 |
+
Theo Trouillon, Johannes Welbl, Sebastian Riedel, ´ Eric Gaussier, and Guillaume Bouchard. Com- ´ plex embeddings for simple link prediction. In International conference on machine learning, pp. 2071–2080. PMLR, 2016.
|
| 242 |
+
|
| 243 |
+
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28, 2014.
|
| 244 |
+
|
| 245 |
+
Michael D Ward, Andreas Beger, Josh Cutler, Matthew Dickenson, Cassy Dorff, and Ben Radford. Comparing gdelt and icews event data. Analysis, 21(1):267–297, 2013.
|
| 246 |
+
|
| 247 |
+
Jiapeng Wu, Meng Cao, Jackie Chi Kit Cheung, and William L Hamilton. Temp: temporal message passing for temporal knowledge graph completion. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, 2020.
|
| 248 |
+
|
| 249 |
+
Chengjin Xu, Mojtaba Nayyeri, Fouad Alkhoury, Hamed Shariat Yazdi, and Jens Lehmann. Tero: A time-aware knowledge graph embedding via temporal rotation. Proceedings of the 28th International Conference on Computational Linguistics, 2020.
|
| 250 |
+
|
| 251 |
+
Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. arXiv preprint arXiv:1412.6575, 2014.
|
| 252 |
+
|
| 253 |
+
# A APPENDIX
|
| 254 |
+
|
| 255 |
+
A.1 EXPERIMENTS ON YAGO11K, WIKIDATA12K AND YAGO15K
|
| 256 |
+
|
| 257 |
+
The experimental results on YAGO11k, WIKIDATA12k and YAGO15k are shown in Table 5.
|
| 258 |
+
|
| 259 |
+
Table 5: Link prediction results on YAGO11k, WIKIDATA12k and YAGO15k datasets. The best results for each metric are marked in bold. All numbers of results are multiplied by $100 \%$ . Missing scores not reported are denoted by “–”. Due to limited space, we use $\mathrm { H @ 1 }$ , $\mathrm { H @ 3 }$ and $\mathrm { H @ 1 0 }$ to represent Hits $@ 1$ , Hits $\textcircled { a } 3$ and Hits $@ 1 0$ , respectively.
|
| 260 |
+
|
| 261 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">YAG011k</td><td colspan="4">WIKIDATA12k</td><td colspan="4">YAG015k</td></tr><tr><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td><td>MRR</td><td>H@1</td><td></td><td>H@3 H@10</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td></tr><tr><td>TransE(2013)</td><td>10.0</td><td>1.5</td><td>13.8</td><td>24.4</td><td>17.8</td><td>10.0</td><td>19.2</td><td>33.9</td><td>29.6</td><td>22.8</td><td>=</td><td>46.8</td></tr><tr><td>DistMult(2014)</td><td>15.8</td><td>10.7</td><td>16.1</td><td>26.8</td><td>22.2</td><td>11.9</td><td>23.8</td><td>46.0</td><td>27.5</td><td>21.5</td><td>-</td><td>43.8</td></tr><tr><td>ComplEx(2016)</td><td>16.7</td><td>10.6</td><td>15.4</td><td>28.2</td><td>23.3</td><td>12.3</td><td>25.3</td><td>43.6</td><td>36.0</td><td>29.0</td><td>36.0</td><td>54.0</td></tr><tr><td>ConvE(2018)</td><td>13.9</td><td>8.8</td><td>13.3</td><td>25.4</td><td>21.5</td><td>12.2</td><td>23.3</td><td>41.4</td><td>10.8</td><td>3.7</td><td>9.4</td><td>31.2</td></tr><tr><td>HypER(2019)</td><td>14.8</td><td>9.4</td><td>14.8</td><td>25.4</td><td>21.1</td><td>11.8</td><td>22.3</td><td>42.5</td><td>10.4</td><td>3.3</td><td>8.7</td><td>32.8</td></tr><tr><td>TTransE(2016)</td><td>10.8</td><td>2.0</td><td>15.0</td><td>25.1</td><td>17.2</td><td>9.6</td><td>18.4</td><td>32.9</td><td>32.1</td><td>23.0</td><td>1</td><td>51.0</td></tr><tr><td>HyTE(2018)</td><td>10.5</td><td>1.5</td><td>14.3</td><td>27.2</td><td>18.0</td><td>9.8</td><td>19.7</td><td>33.3</td><td>1</td><td>=</td><td>-</td><td>=</td></tr><tr><td>TA-DistMult(2018)</td><td>16.1</td><td>10.3</td><td>17.1</td><td>29.2</td><td>21.8</td><td>12.2</td><td>23.2</td><td>44.7</td><td>29.1</td><td>21.6</td><td>1</td><td>47.6</td></tr><tr><td>DE-SimplE(2020)</td><td>15.1</td><td>8.8</td><td>-</td><td>26.7</td><td>25.3</td><td>14.7</td><td>-</td><td>49.1</td><td>-</td><td>-</td><td></td><td>1</td></tr><tr><td>TIMEPLEX(2020)</td><td>23.6</td><td>16.9</td><td>1</td><td>36.7</td><td>33.4</td><td>22.8</td><td>-</td><td>53.2</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>TNTComplEx(2020)</td><td>18.0</td><td>11.0</td><td>1</td><td>31.9</td><td>30.1</td><td>19.7</td><td>=</td><td>50.7</td><td>35.9</td><td>28.5</td><td>36.8</td><td>53.8</td></tr><tr><td>TeRo(2020)</td><td>18.7</td><td>12.1</td><td>19.7</td><td>31.9</td><td>29.9</td><td>19.8</td><td>32.9</td><td>50.7</td><td>1</td><td>-</td><td>1</td><td>1</td></tr><tr><td>TeMP(2020)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>-</td><td>1</td><td>-</td><td>1</td><td>=</td><td>=</td><td>-</td></tr><tr><td>ChronoR(2021)</td><td>-</td><td>1</td><td>-</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td><td>36.6</td><td>29.2</td><td>37.9</td><td>53.8</td></tr><tr><td>TaCE(ours)</td><td>23.8</td><td>17.1</td><td>25.3</td><td>36.4</td><td>33.6</td><td>23.436.1</td><td></td><td>52.7</td><td>36.2</td><td>30.4</td><td>37.0</td><td>47.5</td></tr></table>
|
| 262 |
+
|
| 263 |
+
# A.2 THE DETAILS OF DEFINITIONS ON EVALUATION METRICS
|
| 264 |
+
|
| 265 |
+
MRR, Hits $@ 1$ , Hits $\textcircled { \alpha } 3$ and Hits $@ 1 0$ are employed to score measure the model performance. MRR is defined as follow:
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
M R R = \frac { 1 } { 2 \| t e s t \| } \sum _ { ( s , r , o , t ) \in t e s t } ( \frac { 1 } { r a n k _ { o } } + \frac { 1 } { r a n k _ { s } } )
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
where $r a n k _ { o }$ and $r a n k _ { s }$ denote the ranking of tail entity o and head entity s for tail and head queries, respectively. Hits ${ @ K } ,$ , $K = I , 2 , 3 \ldots$ , is defined as follow:
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
H i t s @ K = \frac { 1 } { 2 \lVert t e s t \rVert } \sum _ { ( s , r , o , t ) \in t e s t } \left( I ( r a n k _ { o } \le k ) + I ( r a n k _ { s } \le k ) \right)
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
where $k = 1 , 2 , 3 \ldots , I$ denotes the indicator function.
|
| 278 |
+
|
| 279 |
+
# A.3 PARAMETER SETTINGS
|
| 280 |
+
|
| 281 |
+
The parameter settings for TaCE is listed in Table 6.
|
| 282 |
+
|
| 283 |
+
A.4 NIGERIAN PRESIDENTS AND THEIR TENURE FROM 2005 TO 2015
|
| 284 |
+
|
| 285 |
+
There mainly refer to four presidents of Nigeria from 2005 to 2015 by checking on the Wikipedia.
|
| 286 |
+
Their tenure information is listed in Table 7.
|
| 287 |
+
|
| 288 |
+
A.5 THE NUMBER OF PARAMETERS (SPACE COMPLEXITY) OF TKGC MODELS
|
| 289 |
+
|
| 290 |
+
The number of parameters or the space complexity of TKGC models are shown in Table 8.
|
| 291 |
+
|
| 292 |
+
Table 6: Parameter settings in TaCE.
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Dataset</td><td>ICEWS14</td><td>ICEWS05-15</td><td>GDELT</td><td>YAGO11kI</td><td>WIKIDATA12k</td><td>YAGO15k</td></tr><tr><td>Embedding size</td><td>200</td><td>200</td><td>200</td><td>200</td><td>200</td><td>200</td></tr><tr><td>Batch size</td><td>512</td><td>512</td><td>512</td><td>512</td><td>512</td><td>512</td></tr><tr><td>Embedding dropout rate</td><td>0.2</td><td>0.2</td><td>0.2</td><td>0.2</td><td>0.2</td><td>0.2</td></tr><tr><td>Feature map dropout rate</td><td>0.2</td><td>0.1</td><td>0.1</td><td>0.2</td><td>0.2</td><td>0.2</td></tr><tr><td>Projection dropout rate</td><td>0.3</td><td>0.2</td><td>0.2</td><td>0.3</td><td>0.3</td><td>0.3</td></tr><tr><td>Label smoothing</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.1</td><td>0.1</td><td>0.1</td></tr><tr><td>Number of feature maps</td><td>32</td><td>32</td><td>32</td><td>32</td><td>32</td><td>32</td></tr><tr><td>Convolutional filer size</td><td>1x9</td><td>1x9</td><td>1x9</td><td>1x9</td><td>1x9</td><td>1x9</td></tr><tr><td>Number of deep layers</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Learning rate (Adam)</td><td>0.0005</td><td>0.0001</td><td>0.0001</td><td>0.001</td><td>0.001</td><td>0.001</td></tr><tr><td>Exponential learning rate decay</td><td>0.995</td><td>0.995</td><td>0.995</td><td>0.99</td><td>0.99</td><td>0.99</td></tr></table>
|
| 295 |
+
|
| 296 |
+
Table 7: The list of Nigerian presidents and their tenure from 2005 to 2015.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Name</td><td>Start date of tenure</td><td>End date of tenure</td></tr><tr><td>Olusegun Obasanjo</td><td>May 29th, 1999</td><td>May 29th,2007</td></tr><tr><td>Umaru Musa Yar'Adua</td><td>May 29th, 2007</td><td>May 5th,2010</td></tr><tr><td>Goodluck Ebele Jonathan</td><td>May 29th,2010</td><td>May 29th,2015</td></tr><tr><td>MuhammaduBuhari</td><td>May 29th, 2015</td><td>Till date</td></tr></table>
|
| 299 |
+
|
| 300 |
+
Table 8: The number of parameters (Space Complexity) of TKGC models. $n _ { e }$ , $n _ { r }$ and $n _ { t }$ denote the number of entities, relations and timestamps respectively. $d _ { e }$ , $d _ { r }$ and $d _ { t }$ denote the dimension of entity, relation and timestamp embedding respectively. $n _ { t o k e n }$ represents the token of time, which is defined in (Garc´ıa-Duran et al., 2018)´ .
|
| 301 |
+
|
| 302 |
+
<table><tr><td>Model</td><td>The Number of Paramters (Space Complexity)</td></tr><tr><td>TransE(2013)</td><td>O(nede +nrdr)</td></tr><tr><td>DistMult(2014)</td><td>O(nede +nrdr)</td></tr><tr><td>ComplEx(2016)</td><td>O(2nede + 2nrdr)</td></tr><tr><td>ConvE(2018)</td><td>O(nede+nrdr)</td></tr><tr><td>HypER(2019)</td><td>O(nede+nrdr)</td></tr><tr><td>TTransE(2016)</td><td>O(nede +nrdr+ntdt)</td></tr><tr><td>HyTE(2018)</td><td>O(nede +nrdr+ntdt)</td></tr><tr><td>TA-DistMult(2018)</td><td>O(nede +nrdr+ ntokendt)</td></tr><tr><td>DE-SimplE(2020)</td><td>O(nede+nrdr)</td></tr><tr><td>TIMEPLEX(2020)</td><td>O(2nede+6nrdr+2ntdt)</td></tr><tr><td>TNTComplEx(2020)</td><td>O(2nede+2nrdr+2ntdt)</td></tr><tr><td>TeRo(2020)</td><td>O(nede+nrdr+ntdt)</td></tr><tr><td>TeMP(2020)</td><td>O(nede+nrdr)</td></tr><tr><td>ChronoR(2021)</td><td>O(2nede+ 2nrdr+2ntdt)</td></tr><tr><td>TaCE(ours)</td><td>O(2nede+ 2nrdr + ntdt)</td></tr></table>
|
md/dev/iedYJm92o0a/iedYJm92o0a.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SHOW YOUR WORK: SCRATCHPADS FOR INTERMEDIATE COMPUTATION WITH LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Large pre-trained language models perform remarkably well on tasks that can be done “in one pass”, such as generating realistic text (Brown et al., 2020) or synthesizing computer programs (Chen et al., 2021; Austin et al., 2021). However, they struggle with tasks that require unbounded multi-step computation, such as adding integers (Brown et al., 2020) or executing programs (Austin et al., 2021). Surprisingly, we find that these same models are able to perform complex multistep computations—even in the few-shot regime—when asked to perform the operation “step by step”, showing the results of intermediate computations. In particular, we train Transformers to perform multi-step computations by asking them to emit intermediate computation steps into a “scratchpad”. On a series of increasingly complex tasks ranging from long addition to the execution of arbitrary programs, we show that scratchpads dramatically improve the ability of language models to perform multi-step computations.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Large Transformer-based language models exhibit surprisingly impressive capabilities (Devlin et al., 2019; Brown et al., 2020), including the ability to generate code that solves simple programming problems (Chen et al., 2021; Austin et al., 2021). However, these models struggle to perform multistep algorithmic calculations, especially those that require precise reasoning and unbounded computation. For example, GPT-3 struggles to perform few-shot addition on numbers with greater than three digits (Brown et al., 2020). Similarly, large-scale language models struggle to predict the result of executing Python code, even code which is a solution to a programming task the model is able to solve (Austin et al., 2021). Likewise, standard recurrent and graph neural networks fail to systematically generalize when predicting the output of simple programs with loops (Bieber et al., 2020). So language models can to some extent write code, but do not seem to accurately represent the semantics of the code they write, because they cannot predict its execution. This has motivated research on networks that can perform algorithmic reasoning (Graves et al., 2014; Zaremba & Sutskever, 2014; Bieber et al., 2020). Neural networks that accurately represent the semantics of programs could enable a variety of downstream tasks, including program synthesis (Devlin et al., 2017), program analysis (Allamanis et al., 2018), and other algorithmic reasoning tasks (Velickovic & Blundell, 2021).
|
| 12 |
+
|
| 13 |
+
Why do large language models struggle with algorithmic reasoning tasks? We suggest that this is at least partly due to a limitation of the way the Transformer architecture is applied to these tasks: the model is asked to perform these tasks in one forward pass. Given a fixed number of layers and a fixed amount of computation time, the model cannot adapt the amount of compute spent on a problem to its difficulty before producing an output.1 Prior work (Graves, 2016; Banino et al., 2021) has explored neural architectures that explicitly allow for dynamically chosen amounts of computation time to be dedicated to different sub-tasks. In this work, we propose a different approach—one that
|
| 14 |
+
|
| 15 |
+
# DIRECT EXECUTION PREDICTION
|
| 16 |
+
|
| 17 |
+
Consider the following Python function:
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Overview of our scratchpad approach applied to predicting code execution and comparison to direct execution prediction. Top: Previous work has shown that large pre-trained models achieve poor performance when asked to directly predict the result of executing given computer code (Austin et al., 2021). Bottom: In this work, we show that training models to use a scratchpad and predict the program execution trace line-by-line can lead to large improvements in execution prediction performance. N.B. Although the example above only has one loop iteration for each loop, all loops are unrolled across time.
|
| 21 |
+
|
| 22 |
+
can exploit existing Transformer architectures and large few-shot-capable language models—we modify the task design rather than the model or training procedure.
|
| 23 |
+
|
| 24 |
+
Our proposal is simple: Allow the model to produce an arbitrary sequence of intermediate tokens, which we call a scratchpad, before producing the final answer. For example, on addition problems, the scratchpad contains the intermediate results from a standard long addition algorithm (see Figure 2). To train the model, we encode the intermediate steps of the algorithm as text and use standard supervised training.
|
| 25 |
+
|
| 26 |
+
This paper makes the following contributions:
|
| 27 |
+
|
| 28 |
+
• We introduce (Section 2) the notion of a “scratchpad” for Transformers, in order to make them better at performing complex discrete computations without modifying the underlying architecture.
|
| 29 |
+
• We show (Section 3) that scratchpads help Transformers learn to perform long addition in the fine-tuning regime, and in particular that they improve out-of-distribution generalization to larger problem instances.
|
| 30 |
+
• We also find (Section 4) that scratchpads help Transformers perform a somewhat higher level task: polynomial evaluation. This is true in both the few-shot and fine-tuning regimes.
|
| 31 |
+
• Finally, we move to a much more general context and show (Section 5) that training Transformers to emit full program traces line by line annotated with local variables dramatically improves their ability to predict the result of executing a given computer program on a particular input. This application in some sense subsumes the others.
|
| 32 |
+
|
| 33 |
+
# 2 METHOD
|
| 34 |
+
|
| 35 |
+
In this work we consider two related problems: algorithm induction (Graves et al., 2014; 2016; Kurach et al., 2016; Kaiser & Sutskever, 2016) and learning to execute (Zaremba & Sutskever, 2014; Bieber et al., 2020). The goal of both problems is for the neural network to learn to emulate a function $f$ , which is “algorithmic” in the sense that it can be represented by a short program, such as addition or polynomial evaluation, from input-output behavior. In neural algorithm induction, the goal is to learn a single algorithm, and each training example gives a single input and desired output represented as strings. Therefore, the training data is $D \stackrel { . } { = } \{ x _ { i } , f ( x _ { i } ) \} _ { i = 1 } ^ { \cal N }$ . For learning to execute, we want the model to produce the result of a program, represented as source code, on some input. If each $\pi _ { i }$ is the source code of a program $f _ { i }$ , then the training data is $D = \{ ( \pi _ { i } , x _ { i } , f _ { i } ( x _ { i } ) ) \} _ { i = 1 } ^ { N ^ { \ast } }$ (it is common for each $f _ { i }$ to have multiple input-output examples, but we omit this to lighten notation).
|
| 36 |
+
|
| 37 |
+
The main idea of this paper is that to solve a given algorithmic task, we simply encode the intermediate steps of the algorithm as text and train the model to emit them to a buffer that we call a “scratchpad.” For example, let us consider the algorithmic induction task of learning long addition. To teach a model to add 29 to 57, a training example may look like the text in Figure 2, where the steps of the grade-school long addition algorithm are written out explicitly.
|
| 38 |
+
|
| 39 |
+
Learning to execute tasks can be encoded in a similar way, except now we add the source code $\pi _ { i }$ before the input, scratchpad, and desired output. An example of a training example for a learning to execute task is shown in Figure 1.
|
| 40 |
+
|
| 41 |
+
At training time, the model will be given the input plus target for standard likelihood-based training. At test time, the model will be given only the input and will be required to predict the target, e.g., by beam search or temperature sampling. In principle, any sequence model could be used for this. In this work, we choose to use decoder-only Transformer language models, but other sequence models could be effective, such as encoder-decoder models (Raffel et al., 2019), or recurrent networks.
|
| 42 |
+
|
| 43 |
+
Adding a scratchpad has several potential advantages: First, the model has adaptive compu
|
| 44 |
+
|
| 45 |
+
Input: $2 \ 9 \ + \ 5 \ 7$
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 2: Example of input and target for addition with a scratchpad. The carry is recorded in the digit following “C:”. Comments (marked by #) are added for clarity and are not part of the target.
|
| 49 |
+
|
| 50 |
+
tation time, that is, it can now process the information for as long as needed, depending on the complexity of the task given the input. Second, the model can store the intermediate state of its computation in the scratch buffer and refer back to it by attending to its context. This removes the need to store all intermediate state in activations. Third, by forcing the model to output concrete intermediate states by sampling from the generative model, we aim to reduce the propagation and compounding of small errors, because states are quantized to token embeddings. Compounded errors can show up in methods—like Neural Turing Machines (Graves et al., 2014)—that use recurrence to support extended computations. Finally, examining a model’s scratchpad output can help us identify common errors and correct them by revising the scratchpad format. We found this ability to interpret errors to be useful in this work.
|
| 51 |
+
|
| 52 |
+
For all experiments, we used pre-trained dense decoder-only Transformer language models, ranging in size from 2 million to around 100 billion parameters (with the largest denoted $1 0 0 \mathrm { B } +$ ). These models were pre-trained on web documents and dialog data. We omit some details here—including exact model sizes—for double-blind review, but will include specific details in the published version.
|
| 53 |
+
|
| 54 |
+
# 3 ADDITION
|
| 55 |
+
|
| 56 |
+
As a first task, we consider integer addition. The baseline addition task presents two numbers as the input, and the target is their sum. For example:2
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 3: Using a scratchpad significantly improves the performance of pre-trained Transformerbased models on addition, including their ability to generalize out of the training distribution to numbers with more digits. Models were trained on 1-8 digit addition. The baseline models were trained without intermediate scratchpad steps.
|
| 60 |
+
|
| 61 |
+
Input: $2 \ 9 \ + \ 5 \ 7$ Target: 8 6
|
| 62 |
+
|
| 63 |
+
We implement the scratchpad by including the intermediate steps of the long addition algorithm in the target, as in Figure 2. We train several models on integer addition problems with inputs that have 1-8 digits. We then test performance on in-distribution addition problems (with up to 8 digit inputs), and on out-of-distribution problems with 9 and 10 digit inputs. The models were fine-tuned on 100k examples for $5 \mathrm { k }$ steps with batch size 32. There are 10k in-distribution test examples, and 1k test examples for each out-of-distribution task. We examine the performance as a function of model size, ranging from 2M to 1B parameters. We compare performance to a baseline which includes the input and target numbers, but no intermediate scratchpad steps.
|
| 64 |
+
|
| 65 |
+
Results Figure 3 compares the performance of the scratchpad algorithm with the baseline. We see that beyond a critical model size, models are able to solve the addition task using the scratchpad, while models trained without a scratchpad fail to do so even at the largest tested scale. On the out-ofdistribution tasks (9-10 digit addition), we find that models trained without scratchpad completely fail, while models trained with scratchpad show consistent improvement as a function of model size.
|
| 66 |
+
|
| 67 |
+
# 4 POLYNOMIAL EVALUATION
|
| 68 |
+
|
| 69 |
+
Next we focus on a slightly higher-level task: evaluating polynomials. Inspired by the “polynomial evaluation” subproblem in Saxton et al. (2019), we generate a dataset of polynomials of degree less than or equal to three, with integer coefficients and inputs constrained to the range $[ - 1 0 , 1 0 ]$ . We also restrict outputs to the range $[ - 1 0 0 0 , 1 0 0 0 ]$ . We generate a training dataset of 10,000 polynomials and a test dataset of size 2,000. An example scratchpad target for this task is shown in Figure 4, with each term of the polynomial evaluated separately. As in the previous section, we compare the results of direct execution with the results of using the scratchpad. In this experiment, we evaluate in the few-shot regime using a $1 0 0 \mathrm { B } +$ parameter pre-trained decoder-only model, as previous work indicates that very large models may be able to perform additions and multiplications with 3 or fewer digits few-shot (Brown et al., 2020). We use $n = 4$ example problems in the few-shot prompt. We also evaluate in the fine-tuning regime with an 8B parameter model fine-tuned for 2000 steps on the training set. The results of both evaluations are shown in Table 1. We find that scratchpad execution outperforms direct execution significantly in both the few-shot and fine-tuning regimes.
|
| 70 |
+
|
| 71 |
+
# 5 EXECUTING PYTHON PROGRAMS
|
| 72 |
+
|
| 73 |
+
We have shown that scratchpads can help algorithm induction, that is, they can help models learn to implement a particular algorithm with direct algorithm-specific supervision. But needing to handdesign the intermediate states for every new task is sub-optimal. In this section, we evaluate whether a model can learn to implement a new algorithm by executing arbitrary code. To test this capability, we follow the problem setup from Austin et al. (2021), in which language models are asked to predict the result of executing a given Python program on a particular input. Language models performed poorly at this task, even on programs which are solutions to a programming tasks the model is able to solve. Here we show that the scratchpad technique can dramatically improve the ability of language models to execute programs.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 4: Example of polynomial evaluation with a scratchpad. Each term in the polynomial is computed separately and then added.
|
| 77 |
+
|
| 78 |
+
Table 1: Results for polynomial evaluation task. Scratchpad outperforms direct prediction whether using fine-tuning or few-shot.
|
| 79 |
+
|
| 80 |
+
<table><tr><td></td><td>Few-shot</td><td>Fine-tuning</td></tr><tr><td>Direct prediction</td><td>8.8%</td><td>31.8%</td></tr><tr><td>Scratchpad</td><td>20.1%</td><td>50.7%</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Direct execution prediction Our main baseline is the direct execution prediction procedure explored in Austin et al. (2021). Models are shown the source code for a function, and asked to predict the output of running the function on specific inputs. For example, the function in Figure 1 takes as input a string s and a character ch, and removes the first and last instances of the character ch from the string s. The direct execution prompt and target for this task are shown in the “Direct Execution Prediction” box in Figure 1. A task is considered solved under this regime if the model correctly outputs the target string.
|
| 83 |
+
|
| 84 |
+
Execution prediction via scratchpad tracing As discussed above, direct execution prediction requires the model to correctly output the result of executing the entire function in a single pass. Direct execution prediction has been shown to perform poorly on Python programs in Austin et al. (2021). We therefore design a scratchpad formulation of the execution task, in which models predict the output of a program by first predicting the sequence of intermediate states computed during the program’s execution. Formally, we train models to predict an alternating sequence of 1) the ordered sequence of source code lines executed, and 2) the state of the local variables after each line is executed. We call this object the program’s trace, and it allows us to track both the control flow— the sequence of operations executed—and how the state changes as a result of each operation. We represent the trace as a string, with the line of code reproduced directly, and the state information represented as a JSON dictionary.3 For example, the “Scratchpad Tracing” box in Figure 1 contains the tracing prompt and trace target for the function discussed above.
|
| 85 |
+
|
| 86 |
+
Concretely, for each function to be traced, the prompt is formed by printing the function definition, followed by a line which calls the function on a particular input: output $=$ fn name(input value), where fn name and input value are replaced with the corresponding function name and input value. In Figure 1, note how the correct output of remove Occ("PHP","P") is shown in the last line of the trace, assigned to the variable "output". A tracing example is considered to have the correct execution output if the encoding of the value assigned to the variable output in the last line is a semantic match with the target output value (here, "output": "P"). We consider a task to be executed correctly if all given input-output examples are correctly executed. We can also test whether there is a “trace exact match” between the model prediction and the ground truth trace, by a) semantically comparing each state in the trace to the corresponding state in the ground truth trace, and b) comparing the sequence of source code lines predicted with the ground truth sequence.
|
| 87 |
+
|
| 88 |
+
Experimental setup As a proof-of-concept, we first show that scratchpad tracing greatly improves execution performance on synthetic Python data. Then, we compare scratchpad tracing and execution on the human-written Python problems from Austin et al. (2021). We find that a novel data augmentation technique that uses programs generated by the model as additional training data can significantly increase tracing performance on real data, whereas this augmentation technique hurts performance for direct execution. Finally, we show that incorporating tracing data from additional sources further improves tracing performance, indicating that the scratchpad tracing technique explored here may scale well with more data.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 5: Example synthetic Python program.
|
| 92 |
+
|
| 93 |
+
Table 2: Synthetic tracing and execution results. Scratchpad outperforms direct prediction both for few-shot and fine-tuned. \*The accuracy criterion for the few-shot scratchpad condition was slightly modified, see the text of Section 5.1 for more details.
|
| 94 |
+
|
| 95 |
+
<table><tr><td></td><td>Few-shot</td><td>Fine-tuned</td></tr><tr><td>Direct prediction</td><td>11%</td><td>20%</td></tr><tr><td>Scratchpad</td><td>26.5%*</td><td>41.5%</td></tr></table>
|
| 96 |
+
|
| 97 |
+
For all experiments on Python code, we use a Transformer model with around 100 billion parameters $( 1 0 0 \mathrm { B } + )$ , a context window of 1024 tokens and a limit of 512 generation tokens. Unless otherwise stated, all fine-tuning runs used a batch size of 8192 tokens and a learning rate of 3e-5, and model inference was performed with decoding temperature set to $T = 0$ , equivalent to greedy decoding.
|
| 98 |
+
|
| 99 |
+
5.1 SCRATCHPAD BEATS DIRECT EXECUTION FOR SYNTHETIC PYTHON PROGRAMS
|
| 100 |
+
|
| 101 |
+
In our first experiment, we test the few-shot and fine-tuned execution capabilities of our models on simple synthetic Python programs. This provides a proof-of-concept for our tracing technique.
|
| 102 |
+
|
| 103 |
+
We use a dataset of synthetic Python programs modified from Bieber et al. (2020). These programs include small integers (0, 1, and 2), simple while loops, and if statements. We construct a corpus of synthetic programs to mimic the size of the MBPP dataset in Austin et al. (2021), with 400 training programs, 100 validation programs, and 200 test programs. For each program, three random integer inputs are sampled from the range 0 to 9.
|
| 104 |
+
|
| 105 |
+
We test execution and scratchpad tracing under both few-shot and fine-tuning conditions. For fewshot experiments, the prompt contains three examples of previous tracing problems, as shown in Appendix C. For fine-tuned experiments, we fine-tune models to convergence on the training split, as judged by validation perplexity.
|
| 106 |
+
|
| 107 |
+
For the few-shot scratchpad experiment, we noticed that models would not assign the variable name output to the final value in the trace, and would instead continue using $\boldsymbol { \mathsf { v } } \boldsymbol { \mathsf { 0 } }$ (the name of the variable returned in the function f) as the variable name for the final output line. We therefore modified the accuracy criterion from checking whether the value of output in the last line of the trace is correct, to checking whether the value of $\boldsymbol { \mathsf { v } } \boldsymbol { \mathsf { 0 } }$ is correct. (Under naive scoring, the few-shot tracing accuracy is roughly zero.) An example of this behavior is shown in Appendix D.
|
| 108 |
+
|
| 109 |
+
Results Table 2 shows our results on synthetic Python problems. In both few-shot and fine-tuned settings, the scratchpad tracing technique leads to higher overall execution accuracy on the 200 test problems. Fine-tuning also improves performance more for the scratchpad tracing technique than it does for direct execution.
|
| 110 |
+
|
| 111 |
+
# 5.2 SCRATCHPAD BEATS DIRECT EXECUTION FOR REAL PROGRAMS
|
| 112 |
+
|
| 113 |
+
In our second set of experiments, we explore how well the scratchpad performs compared to execution on real data. Our main evaluation dataset is the MBPP dataset, introduced in Austin et al. (2021). MBPP consists of 1000 programming problems, each of which contains a natural language specification, a ground-truth Python program, and three input-output test cases. These programs involve computation using a large variety of types, including ints, strings, floats, dictionaries, tuples, and more, and include many language features and control-flow structures, such as loops, comprehensions, library imports, API calls and recursion. The evaluation split of the MBPP dataset contains 500 tasks. In order to separate out effects of the generation window size, we report all evaluation metrics on the subset of these tasks for which the ground-truth trace fits within the generation window of the model for all three of the input-output examples. This leaves a subset of 212 test
|
| 114 |
+
|
| 115 |
+
Table 3: Comparison of models fine-tuned on different data sets and evaluated on MBPP programs. We report “per-task” execution and tracing accuracies, which require all examples to be correctly executed/traced. We additionally report “per-example” accuracies, which correspond to the total fraction of test examples which are executed/traced correctly across the dataset. We find that training scratchpad models on an dataset augmented with samples from the model significantly improves performance for the scratchpad model, while it harms the direct execution model. Combining tracing training data from several sources further improves scratchpad model performance.
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Direct execution MBPP MBPP-aug</td><td rowspan="2">MBPP MBPP-aug MBPP-aug</td><td colspan="4">Scratchpad MBPP-aug MBPP-aug</td></tr><tr><td></td><td></td><td></td><td>+CodeNet +single line</td><td></td><td>+CodeNet +single line</td></tr><tr><td>per-task execution acc:</td><td>(85.2.1) 10.3</td><td>($5.2.2) 5.1</td><td>($5.2.1) 5.1</td><td>($5.2.2) 17.3</td><td>(85.3) 26.6</td><td>($5.3) 25.2</td><td>($5.3) 23.4</td></tr><tr><td>per-task trace acc:</td><td>n/a</td><td>n/a</td><td>0.9</td><td>13.1</td><td>24.6</td><td>22.0</td><td>21.5</td></tr><tr><td>per-example execution acc:</td><td>22.0</td><td>12.3</td><td>24.6</td><td>35.5</td><td>46.0</td><td>45.3</td><td>43.5</td></tr><tr><td>per-example trace acc:</td><td>n/a</td><td>n/a</td><td>6.7</td><td>26.8</td><td>41.9</td><td>42.1</td><td>40.2</td></tr></table>
|
| 118 |
+
|
| 119 |
+
tasks. Increasing generation and context window length is an important issue for Transformer-based models, but we view it as orthogonal and leave it for future work.
|
| 120 |
+
|
| 121 |
+
# 5.2.1 PERFORMANCE IS POOR IN THE VERY-LOW-DATA REGIME
|
| 122 |
+
|
| 123 |
+
In our first experiment with the MBPP data, we train a scratchpad tracing model on the 374 training tasks (3 examples per task, so 1122 overall examples). We discard all training examples which exceed the context window. We compare overall execution results against a model trained on the same 374 training tasks to perform direct execution. The columns labeled “MBPP” for Direct Execution and Scratchpad in Table 3 show the results of this experiment. Neither the scratchpad model or the direct execution model achieve good performance ( $5 \%$ and $10 \%$ output accuracy, respectively), and direct execution outperforms the scratchpad model.
|
| 124 |
+
|
| 125 |
+
# 5.2.2 SAMPLED PROGRAMS MAKE GOOD SCRATCHPAD TRAINING DATA
|
| 126 |
+
|
| 127 |
+
Next, we employ a data augmentation technique to increase the size of the training dataset: We first run few-shot synthesis on the 374 MBPP training tasks using the pre-trained $1 0 0 \mathrm { B } +$ model, as described in Austin et al. (2021). For each task, we sample and record 80 candidate programs $\{ P _ { s } \}$ from the model at temperature $T \ = \ 0 . 5$ . We can then create a new execution datapoint using the candidate program $P _ { s }$ , the original three inputs for the task $\{ x _ { i } \} _ { i = 1 , 2 , 3 }$ , and the three new outputs which result from running the candidate program on the original three inputs: $\{ y _ { i _ { \mathrm { n e w } } } \} _ { i = 1 , 2 , 3 }$ , where $y _ { i _ { \mathrm { n e w } } } = P _ { s } ( x _ { i } )$ . We discard any candidate programs for which execution results in an error. Note that the outputs of $y _ { i _ { \mathrm { n e w } } }$ may or may not be equal to the original outputs, depending on the computation performed by the generated program $P _ { s }$ . Therefore, this augmented direct execution dataset has both additional new programs and new outputs compared to the original dataset. We can analogously create a tracing dataset for our scratchpad model by tracing the execution of each candidate program $P _ { s }$ on each $x _ { i }$ . This process produces much larger tracing and execution datasets with $1 7 \mathrm { k }$ new programs, which we refer to as MBPP-aug.
|
| 128 |
+
|
| 129 |
+
Conceptually, we have augmented the dataset using a combination of tools already available to us, namely a) the neural model, and b) program execution via a Python interpreter. We fine-tune direct execution and scratchpad models on this new augmented dataset MBPP-aug, using the same process as above.
|
| 130 |
+
|
| 131 |
+
The “MBPP-aug” columns in Table 3 show the results of this experiment. While the direct execution approach suffers a decrease in accuracy when trained on this additional data, the performance of the scratchpad model is greatly improved; the model trained on the augmented data solves more than three times the number of tasks as the model trained on only the original MBPP programs. We also note that if we measure the raw correctness across samples, the model already achieves $2 6 . 8 \%$ exact trace match, which is surprisingly high.
|
| 132 |
+
|
| 133 |
+
# 5.3 SCRATCHPAD TRAINING MAKES GOOD USE OF LARGE DATASETS
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 6: Top: examples of single line data. Bottom: example CodeNet submission.
|
| 137 |
+
|
| 138 |
+
In this section, we examine whether collecting additional tracing data from human-written programs further improves tracing performance. This will allow us to understand whether the tracing procedure here is likely to scale well when slightly out-of-distribution tracing data is added to the fine-tuning set. We experiment using two datasets:
|
| 139 |
+
|
| 140 |
+
Single-line programs This dataset consists of roughly 9 million examples of single-line Python transformations. Figure 6 (Top) shows examples of these transformations. Each transformation consists of an initial set of variables and corresponding values, a single line of Python (together these form the input), and the new set of variables and values which results from running the line (the target). When training on single-line data, we do not introduce intermediate scratchpad steps. While this dataset does not provide examples of the high-level, multi-line control flow of a trace, the data provides good supervision for modeling the execution of individual lines of code, which is a key component of tracing. This data was collected by Fraser Greenlee, and can be accessed here.
|
| 141 |
+
|
| 142 |
+
CodeNet The Project CodeNet dataset (Puri et al., 2021) consists of millions of user submissions to approximately 4,000 coding problems. These submission include both correct and incorrect solutions to programming problems. However, from the experiment with MBPP-aug above, we know that incorrect or broken programs can still provide a useful training signal. We additionally improved our tracing technique to allow tracing programs with errors; when an error is reached, the error message is added to the end of the trace text and tracing is stopped. We extracted a total of 670,904 traces from the CodeNet data. For each dataset, we first fine-tune the model on these datasets, and then perform a second fine-tuning on MBPP-aug until convergence.
|
| 143 |
+
|
| 144 |
+
Results Results are shown in Table 3. As above, we report execution accuracy across tasks. We additionally report trace accuracy across tasks, to understand the extent to which the entire trace is accurately predicted. We also report the raw execution and trace accuracy across all test examples, as an additional metric to compare models.
|
| 145 |
+
|
| 146 |
+
Training on either the single-line dataset or the CodeNet dataset alone seem to both provide gains over MBPP-aug $2 3 . 4 \%$ and $2 5 . 2 \%$ tasks executed correctly, respectively). However, combining both CodeNet and the single-line dataset seems lead to the highest performance; tracing produces the correct final output for $2 6 . 6 \%$ of the tasks, and nearly a quarter of the tasks $( 2 4 . 6 \% )$ are traced perfectly for all three examples. These results seem promising: the neural network can often exactly trace programs. In particular, greedily decoding from the best model produces the exact correct trace for almost $42 \%$ of all traces.
|
| 147 |
+
|
| 148 |
+
# 6 RELATED WORK
|
| 149 |
+
|
| 150 |
+
The tasks in this paper can be viewed as exploring one criticism of large language models, namely, to what extent do they simply rely on surface-level statistical correlations on text, without learning semantics or world knowledge (Bender & Koller, 2020)? In response, Li et al. (2021) provide evidence that pre-trained language models do indeed construct approximate representations of the semantics of the situations they describe in text. In the context of programs, Austin et al. (2021) approach this question by exploring the learning to execute task on MBPP, which we consider in Section 5.2. The idea behind this task was to explore whether neural models for synthesis that generate code could also execute it. While that work finds existing models perform poorly at predicting execution, we show that adding a scratchpad allows these models to perform better.
|
| 151 |
+
|
| 152 |
+
Work in learning to execute has considered whether off-the-shelf recurrent neural networks (Zaremba & Sutskever, 2014) or more specialized architectures (Dehghani et al., 2018; Bieber et al., 2020; Wang et al., 2020) have an inductive bias that is sufficiently well suited for executing and reasoning about arbitrary code. The related problem of neural algorithm induction has attracted considerable interest (Graves et al., 2014; Kurach et al., 2016; Kaiser & Sutskever, 2016; Graves et al., 2016; Reed & de Freitas, 2016; Velickovi ˇ c et al., 2020a;b). This work proposes new neural ´ architectures, inspired by theoretical models of computation, whose inductive bias allows them to more easily learn algorithm induction tasks. Several methods for algorithm induction specifically add adaptive computation time to sequence models (Graves, 2016; Dehghani et al., 2018; Banino et al., 2021). In particular, universal transformers include adaptive computation time, and are evaluated both on algorithm induction and on learning to execute tasks (Dehghani et al., 2018). In contrast, a scratchpad is a simple way both to provide a transformer model with adaptive computation time, and also to provide supervision about how to use that additional computation, without requiring modification to the underlying architecture.
|
| 153 |
+
|
| 154 |
+
Algorithm induction has also been connected to pre-trained models. Lu et al. (2021) show that Transformers can be used to some extent as universal computation engines, by pre-training on natural language, and fine-tuning a small fraction of the weights on non-language tasks, including simple algorithm induction tasks. Finally, supervised approaches to semantic parsing (Zelle & Mooney, 1996; Zettlemoyer & Collins, 2005; Kwiatkowksi et al., 2010; Wong & Mooney, 2006) predict the text of a database query, which can then be executed to answer a natural language question.
|
| 155 |
+
|
| 156 |
+
# 7 LIMITATIONS AND FUTURE WORK
|
| 157 |
+
|
| 158 |
+
Context window size In this work, we limit our experiments to problems where the scratchpad text fits within the model generation window (512 tokens). However, many problems require very long scratchpad generations. Therefore, fully realizing the potential of the scratchpad technique may require further improvements in transformer generation window size. This is an active area of research in NLP (Tay et al., 2020), and improvements would be beneficial for the scratchpad technique.
|
| 159 |
+
|
| 160 |
+
Learning to use the scratchpad without supervision A clear next step is to try to learn to use the scratchpad without direct supervision. A simple method would be to use reinforcement learning (RL) techniques: models would be rewarded for correctly answering questions, with reward inversely proportional to the number of scratchpad tokens used. We would hope that learning to use the scratchpad would be a transferable skill; for example, a model could potentially use the algorithm it learned to perform long addition to succeed at polynomial evaluation.
|
| 161 |
+
|
| 162 |
+
# 8 CONCLUSION
|
| 163 |
+
|
| 164 |
+
In this work we showed—through experiments on long addition, polynomial evaluation, and Python code execution—that allowing models to read from and write to a simple scratchpad can improve their performance on algorithmic tasks. Such models may be a first step toward combining the knowledge-compression capabilities of large language models with reasoning capabilities, in order to build models that understand code as well as write it. This could be useful for a variety of applications that require both working with natural language and reasoning about program semantics, such as program synthesis, neural-guided program analysis, and interactive programming assistants. The scratchpad technique presented here might not take us all the way toward that goal, but we hope it is an important step.
|
| 165 |
+
|
| 166 |
+
# REPRODUCIBILITY
|
| 167 |
+
|
| 168 |
+
All fine-tuning and evaluation datasets used in this work are either open source or synthetic and easily reproducible (this excludes MBPP-Aug, which depends on generations from the pre-trained transformer model used in this work). Examples of exact prompts are shown in the Appendix, so that they can be exactly reproduced. Although the pre-training details are not open-source, they correspond to the details in Austin et al. (2021).
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In International Conference on Learning Representations (ICLR), February 2018.
|
| 173 |
+
|
| 174 |
+
Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
|
| 175 |
+
|
| 176 |
+
Andrea Banino, Jan Balaguer, and Charles Blundell. Pondernet: Learning to ponder. In 8th ICML Workshop on Automated Machine Learning (AutoML), 2021.
|
| 177 |
+
|
| 178 |
+
Emily M. Bender and Alexander Koller. Climbing towards NLU: On meaning, form, and understanding in the age of data. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 5185–5198, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.463. URL https://aclanthology.org/2020. acl-main.463.
|
| 179 |
+
|
| 180 |
+
David Bieber, Charles Sutton, Hugo Larochelle, and Daniel Tarlow. Learning to execute programs with instruction pointer attention graph neural networks. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 8626–8637. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/62326dc7c4f7b849d6f013ba46489d6c-Paper.pdf.
|
| 181 |
+
|
| 182 |
+
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. CoRR, abs/2005.14165, 2020. URL https://arxiv.org/abs/2005.14165.
|
| 183 |
+
|
| 184 |
+
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde, Jared Kaplan, Harri Edwards, Yura Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, Will Guss, Alex Nichol, Igor Babuschkin, Suchir Balaji, Shantanu Jain, Andrew Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code, July 2021. URL http://arxiv.org/abs/2107.03374.
|
| 185 |
+
|
| 186 |
+
Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser. Universal transformers. July 2018.
|
| 187 |
+
|
| 188 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy I/O. CoRR, abs/1703.07469, 2017. URL http://arxiv.org/abs/1703.07469.
|
| 189 |
+
|
| 190 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), 2019.
|
| 191 |
+
|
| 192 |
+
Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016.
|
| 193 |
+
|
| 194 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014.
|
| 195 |
+
|
| 196 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio Gomez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adria Puigdom \` enech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, \` Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626): 471–476, 2016.
|
| 197 |
+
|
| 198 |
+
Lukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016.
|
| 199 |
+
|
| 200 |
+
Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural random-access machines. In International Conference on Learning Representations, (ICLR), 2016.
|
| 201 |
+
|
| 202 |
+
Tom Kwiatkowksi, Luke Zettlemoyer, Sharon Goldwater, and Mark Steedman. Inducing probabilistic CCG grammars from logical form with higher-order unification. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pp. 1223–1233, October 2010.
|
| 203 |
+
|
| 204 |
+
Belinda Z. Li, Maxwell Nye, and Jacob Andreas. Implicit representations of meaning in neural language models. ArXiv, abs/2106.00737, 2021.
|
| 205 |
+
|
| 206 |
+
Kevin Lu, Aditya Grover, Pieter Abbeel, and Igor Mordatch. Pretrained transformers as universal computation engines. March 2021.
|
| 207 |
+
|
| 208 |
+
Ruchir Puri, David S Kung, Geert Janssen, Wei Zhang, Giacomo Domeniconi, Vladmir Zolotov, Julian Dolby, Jie Chen, Mihir Choudhury, Lindsey Decker, Veronika Thost, Luca Buratti, Saurabh Pujar, and Ulrich Finkler. Project CodeNet: A Large-Scale AI for code dataset for learning a diversity of coding tasks. May 2021. URL http://arxiv.org/abs/2105.12655.
|
| 209 |
+
|
| 210 |
+
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. CoRR, abs/1910.10683, 2019. URL http://arxiv.org/abs/1910.10683.
|
| 211 |
+
|
| 212 |
+
Scott Reed and Nando de Freitas. Neural programmer-interpreters. In International Conference on Learning Representations (ICLR), 2016. URL http://arxiv.org/pdf/1511.06279v3.
|
| 213 |
+
|
| 214 |
+
David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. CoRR, abs/1904.01557, 2019. URL http://arxiv.org/abs/ 1904.01557.
|
| 215 |
+
|
| 216 |
+
Yi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen, Dara Bahri, Philip Pham, Jinfeng Rao, Liu Yang, Sebastian Ruder, and Donald Metzler. Long range arena: A benchmark for efficient transformers. CoRR, abs/2011.04006, 2020. URL https://arxiv.org/abs/2011.04006.
|
| 217 |
+
|
| 218 |
+
Petar Velickovic and Charles Blundell. Neural algorithmic reasoning. CoRR, abs/2105.02761, 2021. URL https://arxiv.org/abs/2105.02761.
|
| 219 |
+
|
| 220 |
+
Petar Velickovi ˇ c, Lars Buesing, Matthew C. Overlan, Razvan Pascanu, Oriol Vinyals, and Charles ´ Blundell. Pointer graph networks, 2020a.
|
| 221 |
+
|
| 222 |
+
Petar Velickovi ˇ c, Rex Ying, Matilde Padovano, Raia Hadsell, and Charles Blundell. Neural execu-´ tion of graph algorithms, 2020b.
|
| 223 |
+
|
| 224 |
+
Yu Wang, Fengjuan Gao, Linzhang Wang, and Ke Wang. Learning semantic program embeddings with graph interval neural network, 2020.
|
| 225 |
+
|
| 226 |
+
Yuk Wah Wong and Raymond J Mooney. Learning for semantic parsing with statistical machine translation. In Proceedings of the main conference on Human Language Technology Conference of the North American Chapter of the Association of Computational Linguistics -, Morristown, NJ, USA, 2006. Association for Computational Linguistics.
|
| 227 |
+
|
| 228 |
+
Wojciech Zaremba and Ilya Sutskever. Learning to execute. ArXiv, abs/1410.4615, 2014.
|
| 229 |
+
|
| 230 |
+
J Zelle and R Mooney. Learning to parse database queries using inductive logic programming. In National Conference on Artificial Intelligence (AAAI), 1996.
|
| 231 |
+
|
| 232 |
+
Luke S Zettlemoyer and Michael Collins. Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Uncertainty in Artificial Intelligence, July 2005.
|
| 233 |
+
|
| 234 |
+
# A EFFECTS OF SCRATCHPAD EXECUTION TRAINING ON SYNTHESIS PERFORMANCE
|
| 235 |
+
|
| 236 |
+
To measure the extent to which fine-tuning on the tracing task described above affects the model’s ability to perform program synthesis, we ran a few-shot synthesis experiment using the “MBPP$\mathrm { a u g + C o d e N e t + }$ single line” model. Specifically, we performed few-shot synthesis on the MBPP dataset, as described in Austin et al. (2021). For each MBPP synthesis task, 80 candidate programs are sampled from the model $T = 0 . 5$ ), and the task is considered solved if any of the candidate programs satisfy all three test cases. For more details, see Austin et al. (2021). The “MBPP-aug $^ +$ CodeNet $^ +$ single line” model achieved an overall synthesis accuracy of $54 \%$ , compared to the $62 \%$ accuracy of the original few-shot model in Austin et al. (2021). This indicates that the scratchpad execution training does not completely disrup the model’s ability to perform other few-shot tasks.
|
| 237 |
+
|
| 238 |
+
# B LONG ADDITION ABLATION STUDY
|
| 239 |
+
|
| 240 |
+
In our long addition experiments in Section 3, we compared a model that was trained to perform “direct execution” (the baseline) vs a model trained to use a scratchpad. Since the model trained to use the scratchpad gets an additional signal from all the intermediate steps shown, we also study what happens if the scratchpad model is subsequently trained to perform direct execution (i.e., directly output the target without using the scratchpad). The result is shown in Figure 7 where we followed the same training procedure as for the original direct execution baseline and scratchpad models. We see no significant benefits from doing any intermediate training using a scratchpad. This indicates that the extra training-time information seen by the scratchpad model does not seem solely responsible for the scratchpad model’s improved performance.
|
| 241 |
+
|
| 242 |
+
# C EXAMPLE FEW-SHOT PROMPT FOR SYNTHETIC PYTHON EXPERIMENTS
|
| 243 |
+
|
| 244 |
+
Below is an example of a prompt for few-shot synthetic Python synthesis problems:
|
| 245 |
+
|
| 246 |
+
Consider the following Python function:
|
| 247 |
+
|
| 248 |
+
def f(v0): $\lor \emptyset ~ + = ~ \emptyset$ $\mathsf { v } 4 \ = \ 2$ while $\mathsf { v } 4 ~ > ~ \mathsf { 0 }$ : $\vee 4 ~ -- = ~ 1$ $\mathsf { v } \theta \star = \mathsf { 2 }$ return v0
|
| 249 |
+
|
| 250 |
+
What is the execution trace?
|
| 251 |
+
|
| 252 |
+
[BEGIN]
|
| 253 |
+
|
| 254 |
+
state: $\{ \}$
|
| 255 |
+
line: def $\mathsf { f } ( \mathsf { v } \theta )$ :
|
| 256 |
+
state: $\{ ^ { n } \ell ^ { n }$ : "<callable_object $f > " \}$
|
| 257 |
+
line: output $= \ \mathsf { f } ( 6 )$
|
| 258 |
+
state: $\{ \mathrm { ~ } " \lor { \sf { Q } } ^ { \prime \prime } \colon \mathrm { ~ } 6 \}$
|
| 259 |
+
line: $\lor \emptyset ~ + = ~ \emptyset$
|
| 260 |
+
state: $\{ \mathrm { ~ } " \lor { \sf { Q } } ^ { \prime \prime } \colon \mathrm { ~ } 6 \}$
|
| 261 |
+
line: $\mathsf { v } 4 \ = \ 2$
|
| 262 |
+
state: $\{ \mathit { \Omega } ^ { \prime \prime } \mathtt { v } \mathtt { \partial } \mathtt { u } ^ { \prime \prime } : \ \mathtt { \Omega } 6$ , "v4": 2}
|
| 263 |
+
line: while $\mathsf { v } 4 ~ > ~ 0$ :
|
| 264 |
+
state: {"v0": 6, "v4": 2}
|
| 265 |
+
line: $\vee 4 ~ -- = ~ 1$
|
| 266 |
+
state: $\{ ^ { \prime \prime } \mathsf { v } \theta ^ { \prime \prime } \colon 6 , ^ { \prime \prime } \mathsf { v } 4 ^ { \prime \prime } \colon 1 \}$
|
| 267 |
+
line: $\mathsf { v } \theta \star = \mathsf { 2 }$
|
| 268 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 12, "v4": 1}
|
| 269 |
+
line: while v4 $> ~ 0$ :
|
| 270 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 12, "v4": 1}
|
| 271 |
+
line: $\vee 4 ~ -- = ~ 1$
|
| 272 |
+
state: {"v0": 12, "v4": 0}
|
| 273 |
+
line: $\mathsf { v } \theta \star = \mathsf { 2 }$
|
| 274 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 24, "v4": 0}
|
| 275 |
+
line: while v4 $> ~ 0$ :
|
| 276 |
+
state: $\begin{array} { r } { \left\{ \begin{array} { l l } { \ " \lor \emptyset ^ { \prime \prime } : } & { 2 4 } \end{array} \right. } \end{array}$ , "v4": 0}
|
| 277 |
+
line: return v0
|
| 278 |
+
state: $\{ ^ { n } \ell ^ { n }$ : "<callable_object $f > ^ { n }$ , "output": 24}
|
| 279 |
+
|
| 280 |
+
[DONE]
|
| 281 |
+
|
| 282 |
+
Consider the following Python function:
|
| 283 |
+
|
| 284 |
+
def $\mathsf { f } ( \mathsf { v } \theta )$ : $\mathsf { v } \boldsymbol { \theta } \ \mathsf { \Sigma } - \mathsf { = } \ \boldsymbol { \theta }$ $\mathsf { v } \mathsf { 0 } \ + \mathsf { = } \ 2$ $\mathsf { v } \boldsymbol { \theta } \ \mathsf { \Sigma } - \mathsf { = } \ \boldsymbol { \theta }$ return v0 output $= \ f ( 4 )$
|
| 285 |
+
|
| 286 |
+
What is the execution trace?
|
| 287 |
+
|
| 288 |
+
[BEGIN]
|
| 289 |
+
|
| 290 |
+
state: {}
|
| 291 |
+
line: def $\mathsf { f } ( \mathsf { v } \theta )$ :
|
| 292 |
+
state: {"f": "<callable_object f>"}
|
| 293 |
+
line: output $= \ f ( 4 )$
|
| 294 |
+
state: $\{ \mathrm { ~ } " \lor { } \emptyset ^ { n } \colon \mathrm { ~ } 4 \}$
|
| 295 |
+
line: $\mathsf { v } \boldsymbol { \theta } \ \mathsf { \Sigma } - \mathsf { = } \ \boldsymbol { \theta }$
|
| 296 |
+
state: $\{ \mathrm { ~ } " \lor { } \emptyset ^ { n } \colon \mathrm { ~ } 4 \}$
|
| 297 |
+
line: $\mathsf { v } \mathsf { 0 } \ + \mathsf { = } \ 2$
|
| 298 |
+
state: $\{ \mathrm { ~ } " \lor { \sf { Q } } ^ { \prime \prime } \colon \mathrm { ~ } 6 \}$
|
| 299 |
+
line: $\mathsf { v } \boldsymbol { \theta } \ \mathsf { \Sigma } - \mathsf { = } \ \boldsymbol { \theta }$
|
| 300 |
+
state: $\{ \mathrm { ~ } " \lor { \sf { Q } } ^ { \prime \prime } \colon \mathrm { ~ } 6 \}$
|
| 301 |
+
line: return v0
|
| 302 |
+
state: $\{ ^ { n } \ell ^ { n }$ : "<callable_object $f > ^ { n }$ , "output": 6}
|
| 303 |
+
|
| 304 |
+
[DONE]
|
| 305 |
+
|
| 306 |
+
Consider the following Python function:
|
| 307 |
+
|
| 308 |
+
def f(v0): $\mathsf { v } \boldsymbol { \theta } \ \mathsf { \Sigma } - \mathsf { = } \ \boldsymbol { \theta }$ $\mathsf { v } 8 \ = \ 2$ while $\mathsf { v } 8 \ > \ 0$ : $\vee 8 ~ \ -- = ~ 1$ $\mathsf { v } \theta \star = \mathsfit ~ 1$ return v0
|
| 309 |
+
|
| 310 |
+
What is the execution trace?
|
| 311 |
+
|
| 312 |
+
[BEGIN]
|
| 313 |
+
|
| 314 |
+
state: {}
|
| 315 |
+
line: def $\mathsf { f } ( \mathsf { v } \theta )$ :
|
| 316 |
+
state: {"f": "<callable_object $f > " \}$
|
| 317 |
+
line: output $= \ f ( 4 )$
|
| 318 |
+
state: $\{ \mathrm { ~ } " \lor { } \emptyset ^ { n } \colon \mathrm { ~ } 4 \}$
|
| 319 |
+
line: $\mathsf { v } \boldsymbol { \theta } \ \mathsf { \Sigma } - \mathsf { = } \ \boldsymbol { \theta }$
|
| 320 |
+
state: $\{ \mathrm { ~ } " \lor { } \emptyset ^ { n } \colon \mathrm { ~ } 4 \}$
|
| 321 |
+
line: $\mathsf { v } 8 \ = \ 2$
|
| 322 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 4, $" \boldsymbol { \mathsf { v } } 8 \boldsymbol { \mathit { \Omega } } ^ { n }$ : 2}
|
| 323 |
+
line: while $\mathsf { v } 8 \ > \ 0$ :
|
| 324 |
+
state: {"v0": 4, "v8": 2}
|
| 325 |
+
line: $\vee 8 ~ \ -- = ~ 1$
|
| 326 |
+
state: {"v0": 4, "v8": 1}
|
| 327 |
+
line: $\mathsf { v } \theta \star = \mathsfit ~ 1$
|
| 328 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 4, "v8": 1}
|
| 329 |
+
line: while $\mathsf { v } 8 \ > \ 0$ :
|
| 330 |
+
state: $\{ \ " \lor \emptyset ^ { \prime \prime } \colon 4$ , "v8": 1}
|
| 331 |
+
line: $\vee 8 ~ \ -- = ~ 1$
|
| 332 |
+
state: {"v0": 4, "v8": 0}
|
| 333 |
+
line: v0 $\star = ~ 1$
|
| 334 |
+
state: {"v0": 4, "v8": 0}
|
| 335 |
+
line: while $\mathsf { v } 8 \ > \ 0$ :
|
| 336 |
+
state: {"v0": 4, "v8": 0}
|
| 337 |
+
line: return v0
|
| 338 |
+
state: {"f": "<callable_object $f > ^ { n }$ , "output": 4}
|
| 339 |
+
|
| 340 |
+
[DONE]
|
| 341 |
+
|
| 342 |
+
Consider the following Python function:
|
| 343 |
+
|
| 344 |
+
def f(v0): $\mathsf { v } \mathsf { 0 } \ + \mathsf { = } \ 2$ $\mathsf { v } \mathsf { 0 } \star \mathsf { = } \mathsf { \ 2 }$ $\mathsf { v } \boldsymbol { \emptyset } \star \mathbf { = } \ 1$ return v0 output $= \textsf { f } ( 8 )$
|
| 345 |
+
|
| 346 |
+
What is the execution trace?
|
| 347 |
+
|
| 348 |
+
# D INCORRECT OUTPUT FOR SYNTHETIC PYTHON PROBLEMS
|
| 349 |
+
|
| 350 |
+
Below is an example of the failure of the few-shot synthetic experiments discussed in Section 5.1. Given a problem such as:
|
| 351 |
+
|
| 352 |
+
Consider the following Python function:
|
| 353 |
+
|
| 354 |
+
def f(v0): $\mathsf { v } \mathsf { 0 } \ + \mathsf { = } \ 2$ $\mathsf { v } \mathsf { 0 } \star \mathsf { = } \mathsf { \ 2 }$ $\mathsf { v } \boldsymbol { \emptyset } \star \mathbf { = } \ 1$ return v0 output $= \textsf { f } ( 8 )$
|
| 355 |
+
|
| 356 |
+
What is the execution trace?
|
| 357 |
+
|
| 358 |
+
The model produces the following trace:
|
| 359 |
+
|
| 360 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \pmb { \theta } ^ { n } \colon \mathbf { \Omega } 8 \}$
|
| 361 |
+
line: def f(v0):
|
| 362 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 8, "f": "<function f at 0x00BFC1C0>"}
|
| 363 |
+
line: $\mathsf { v } \boldsymbol { \theta } \ + = \ 2$
|
| 364 |
+
state: $\{ \mathbf { \Omega } ^ { n } \mathbf { v } \boldsymbol { \theta } ^ { n }$ : 10}
|
| 365 |
+
line: $\mathsf { v } \boldsymbol { \theta } \star = \mathsf { \Omega } 2$
|
| 366 |
+
state: $\lbrace \mathrm { ~ } " \mathrm { v } \boldsymbol { \emptyset } " : \ 2 \boldsymbol { \emptyset } \rbrace$
|
| 367 |
+
line: $\mathsf { v } \theta \star = \mathsf { \Omega } 1$
|
| 368 |
+
state: $\{ \mathrm { ~ } " \lor { \emptyset } " : \ 2 { \emptyset } \}$
|
| 369 |
+
line: return v0
|
| 370 |
+
state: $\{ ^ { n } \ell ^ { n }$ : "<function f at 0x00BFC1C0>", "v0": 20}
|
| 371 |
+
|
| 372 |
+
Note that this trace is exactly correct, except for the last line: where the model predicted $" \lor 8 " : 2 0$ , the correct output is "output": 20. Because this type of error consistently occurs in the few-shot synthetic Python experiments, we modified the evaluation script slightly to consider this output to be correct.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 7: Long addition ablation results. Here, we comparing the baseline and scratchpad results to a model that is first fine-tuned on the scratchpad and then subsequently fine-tuned to perform direct execution (the baseline). The intermediate scratchpad training seem to not have any significant effect on the overall performance, indicating that the extra training-time information seen by the scratchpad model does not seem solely responsible for the scratchpad model’s performance.
|
md/dev/lXuByUeHhd/lXuByUeHhd.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DoReMi: Optimizing Data Mixtures Speeds Up Language Model Pretraining
|
| 2 |
+
|
| 3 |
+
Sang Michael Xie1,2, Hieu Pham1, Xuanyi $\mathbf { D o n g } ^ { 1 }$ , $\mathbf { N a n D u } ^ { 1 }$ , Hanxiao Liu1, Yifeng ${ { \bf { L } } { \bf { u } } ^ { 1 } }$ , Percy Liang2, Quoc V. Le1, Tengyu $\mathbf { M } \mathbf { a } ^ { 2 }$ , and Adams Wei ${ { \bf { Y } } { \bf { u } } ^ { 1 } }$
|
| 4 |
+
|
| 5 |
+
1Google DeepMind
|
| 6 |
+
2Stanford University
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
The mixture proportions of pretraining data domains (e.g., Wikipedia, books, web text) greatly affect language model (LM) performance. In this paper, we propose Domain Reweighting with Minimax Optimization (DoReMi), which first trains a small proxy model using group distributionally robust optimization (Group DRO) over domains to produce domain weights (mixture proportions) without knowledge of downstream tasks. We then resample a dataset with these domain weights and train a larger, full-sized model. In our experiments, we use DoReMi on a 280Mparameter proxy model to set the domain weights for training an 8B-parameter model $3 0 \mathrm { x }$ larger) more efficiently. On The Pile, DoReMi improves perplexity across all domains, even when it downweights a domain. DoReMi improves average few-shot downstream accuracy by $6 . 5 \%$ points over a baseline model trained using The Pile’s default domain weights and reaches the baseline accuracy with $2 . 6 \mathbf { x }$ fewer training steps. On the GLaM dataset, DoReMi, which has no knowledge of downstream tasks, even matches the performance of using domain weights tuned on downstream tasks.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Datasets for training language models (LMs) are typically sampled from a mixture of many domains [17; 13; 10; 9]. For example, The Pile [17], a large publicly available dataset, is composed of $24 \%$ web data, $9 \%$ Wikipedia, $4 \%$ GitHub, etc.1 The composition of the pretraining data greatly affects the effectiveness of an LM [13; 20; 55]. However, it is unclear how much of each domain to include to produce a model that performs well for a wide variety of downstream tasks.
|
| 15 |
+
|
| 16 |
+
Existing works determine domain weights (the sampling probabilities for each domain) by using intuition or a set of downstream tasks. For example, The Pile uses heuristically-chosen domain weights, which could be suboptimal. On the other hand, existing LMs such as PaLM [10] and GLaM [13] tune the domain weights based on a set of downstream tasks, but requires training potentially thousands of LMs on different domain weights and risks overfitting to the particular set of downstream tasks.
|
| 17 |
+
|
| 18 |
+
Instead of optimizing domain weights based on a set of downstream tasks, our approach aims to find domain weights which lead to models that perform well on all domains by minimizing the worst-case excess loss over domains, following Oren et al. [35]; Mindermann et al. [30]. The excess loss is the loss gap between the model being evaluated and a pretrained reference model.
|
| 19 |
+
|
| 20 |
+
This motivates our algorithm, Domain Reweighting with Minimax Optimization (DoReMi), which leverages distributionally robust optimization (DRO) to tune the domain weights without knowledge of downstream tasks (Figure 1). First, DoReMi trains a small reference model (e.g., 280M parameters)
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Given a dataset with a set of domains, Domain Reweighting with Minimax Optimization (DoReMi) optimizes the domain weights to improve language models trained on the dataset. First, DoReMi uses some initial reference domain weights to train a reference model (Step 1). The reference model is used to guide the training of a small proxy model using group distributionally robust optimization (Group DRO) over domains [35; 43; 34], which we adapt to output domain weights instead of a robust model (Step 2). We then use the tuned domain weights to train a large model (Step 3).
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 2: DoReMi optimizes domain weights with a small model (280M params) and uses these domain weights to train a much larger model (8B params, $3 0 \mathrm { x }$ larger). Here, optimizing the domain weights (training a small model twice) takes $8 \%$ of the compute of training the large model. DoReMi improves average one-shot downstream accuracy by $6 . 5 \%$ points and reaches the baseline accuracy $2 . 6 \mathbf { x }$ faster when pretraining on The Pile.
|
| 27 |
+
|
| 28 |
+
in a standard way. Second, DoReMi trains a small distributionally robust language model (DRO-LM) [35], which minimizes the worst-case excess loss (relative to the reference’s model’s loss) across all domains. Notably, rather than using the robust LM, we take the domain weights produced by DRO training. Finally, we train a large (8B) LM on a new dataset defined by these domain weights.
|
| 29 |
+
|
| 30 |
+
Our approach adapts the DRO-LM framework [35] to optimize domain weights instead of producing a robust model. To do this, DoReMi uses the online learning-based optimizer from Group DRO [43; 34], which dynamically updates domain weights according to the loss on each domain for rescaling the training objective, instead of sub-selecting examples from a minibatch as in Oren et al. [35]; Mindermann et al. [30]. Finally, DoReMi takes the averaged domain weights over DRO training steps.
|
| 31 |
+
|
| 32 |
+
In Section 3, we run DoReMi on 280M proxy and reference models to optimize domain weights on The Pile [17] and the GLaM dataset [13] (used in PaLM [10]). The DoReMi domain weights are used to train an 8B parameter LM (over $3 0 \mathrm { x }$ larger). On The Pile, DoReMi reduces perplexity on all domains over baseline domain weights, even when it downweights a domain. DoReMi improves average downstream accuracy over a baseline model trained on The Pile’s default domain weights by $6 . 5 \%$ points on generative few-shot tasks and achieves the baseline downstream accuracy $2 . 6 \mathbf { x }$ faster (Figure 2). In Section 4, we find that DoReMi consistently improves LM training when varying the sizes of the proxy model and the main model trained with optimized domain weights. On the
|
| 33 |
+
|
| 34 |
+
GLaM dataset where domain weights tuned on downstream tasks are available, DoReMi even performs comparably to tuning domain weights on downstream task performance.2
|
| 35 |
+
|
| 36 |
+
# 2 Domain Reweighting with Minimax Optimization (DoReMi)
|
| 37 |
+
|
| 38 |
+
In this section we define DoReMi, an algorithm for using a small proxy model to optimize the domain weights of a language modeling dataset, which then improves the training of a large model.
|
| 39 |
+
|
| 40 |
+
Setup. Suppose that we have $k$ domains (e.g., Wikipedia, GitHub), where for each domain $i$ , we have a set of examples $D _ { i }$ . Domain weights $\alpha \in \bar { \Delta } ^ { k }$ specify a probability distribution over the $k$ domains, and consequently a distribution over the training data: $\begin{array} { r } { P _ { \alpha } = \sum _ { i = 1 } ^ { k } \alpha _ { i } \cdot \mathbf { u n i f } ( D _ { i } ) } \end{array}$ where $\mathrm { u n i f } ( D ) =$ $\textstyle { \frac { 1 } { | D | } } \sum _ { x \in D } \delta _ { x }$ is the uniform distribution over the examples in $D$ and $\delta _ { x } ( x ^ { \prime } )$ is 1 if $x ^ { \prime } = x$ and 0 otherwise.
|
| 41 |
+
|
| 42 |
+
DoReMi. The inputs of DoReMi are the data $D _ { 1 } , \ldots , D _ { k }$ , reference domain weights $\alpha _ { \mathrm { r e f } }$ (e.g., uniform or based on raw token count of each domain), and training hyperparameters for the large, full-size model (number of training steps $T$ and batch size $b$ ). DoReMi returns optimized domain weights $\bar { \alpha }$ and ultimately, a large model trained on $P _ { \bar { \alpha } }$ .
|
| 43 |
+
|
| 44 |
+
Step 1: Obtain a small reference model. We first train a model $p _ { \mathrm { r e f } }$ on some reference domain weights $\alpha _ { \mathrm { r e f } }$ (e.g., based on raw token count as a default) for $T$ steps, batch size $b$ . This model serves as the reference model for step 2 and captures a baseline level of difficulty of each example/domain. The reference model can be a relatively small model (280M parameters in our experiments).
|
| 45 |
+
|
| 46 |
+
Step 2: Train proxy model with Group DRO to obtain domain weights. To obtain domain weights, we train a small proxy model $p _ { \theta }$ in the distributionally robust language modeling (DROLM) [35] framework with the Group DRO optimizer [43], where $\theta$ are the weights of the proxy model. This framework trains a robust model by optimizing the worst-case loss over domains, which is equivalent to the following minimax objective:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname* { m i n } _ { \theta } \operatorname* { m a x } _ { \alpha \in \Delta ^ { k } } L ( \theta , \alpha ) : = \sum _ { i = 1 } ^ { k } \alpha _ { i } \cdot \left[ \frac { 1 } { \sum _ { \boldsymbol { x } \in D _ { i } } \left| \boldsymbol { x } \right| } \sum _ { \boldsymbol { x } \in D _ { i } } \ell _ { \theta } ( \boldsymbol { x } ) - \ell _ { \mathrm { r e f } } ( \boldsymbol { x } ) \right]
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where the losses $\ell _ { \theta } ( x ) = - \log \ p _ { \theta } ( x )$ and $\ell _ { \mathrm { { r e f } } } ( x ) = - \log \ p _ { \mathrm { { r e f } } } ( x )$ are the negative log-likelihoods of the proxy and reference models respectively in this paper, and $| x |$ is the number of tokens in an example $x$ . The objective aims to minimize the worst-case excess loss across domains because the inner maximization over $\alpha$ puts all the weight on the domain with the highest excess loss.
|
| 53 |
+
|
| 54 |
+
Intuitively, the excess loss $( \ell _ { \theta } ( x ) - \ell _ { \mathrm { r e f } } ( x ) )$ measures the headroom for the proxy model to improve, with respect to the reference model, on example $x$ . Examples with higher excess loss are those where the reference model achieves low loss (such that the example is “learnable”) but the proxy model still has high loss. Examples with low excess loss may be very high entropy (i.e. optimal loss is high, and thus the reference loss is high) or very low entropy (i.e., easy to learn, and thus the proxy loss is low). The Group DRO optimizer works by interleaving exponentiated gradient ascent updates on domain weights $\alpha _ { t }$ with gradient updates on the proxy model weights $\theta _ { t }$ over training steps $t$ . The optimizer updates $\alpha _ { t }$ to upweight domains with high excess loss, which scales up the proxy model’s gradient update on examples from these domains. Following Nemirovski et al. [34], we return the average weights over the training trajectory $\begin{array} { r } { \bar { \alpha } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \alpha _ { t } } \end{array}$ as the optimized domain weights to use in step 3.
|
| 55 |
+
|
| 56 |
+
Step 3: Train large model with new domain weights. The tuned domain weights $\bar { \alpha }$ define a new training distribution $P _ { \bar { \alpha } }$ . We resample the data from this new distribution to train a main model (larger than the reference/proxy models), using a standard training procedure.
|
| 57 |
+
|
| 58 |
+
Details for Step 2. Algorithm 1 provides the pseudocode for Step 2. The main structure of Algorithm 1 is a training loop which updates the proxy model over $T$ steps. At each step, we follow Sagawa et al. [43] and sample a minibatch with uniform domain weights (regardless of the reference domain weights $\alpha _ { \mathrm { r e f } }$ , which only affects the reference model). We then compute the per-domain excess losses, normalized by the total number of tokens in each domain, and use them to update the domain weights $\alpha _ { t }$ at each step. We first compute the per-domain excess loss at a per-token level and then aggregate, where the token-level losses at index $j$ are $\ell _ { \theta _ { t - 1 } , j } ( \boldsymbol { x } ) = - \mathrm { l o g } p _ { \theta _ { t - 1 } } \bar { ( x _ { j } | x _ { 1 } , \ldots , x _ { j - 1 } ) }$ and $\bar { \ell _ { \mathrm { r e f } , j } } ( \bar { x } ) = - \log p _ { \mathrm { r e f } } ( x _ { j } | x _ { 1 } , . . . , x _ { j - 1 } )$ . Since the Group DRO optimizer [43] requires a non-negative loss, we clip the per-token excess loss at 0. Finally, we update the proxy model for the objective $L ( \theta _ { t - 1 } , \alpha _ { t } )$ using a standard optimizer such as Adam [26] or Adafactor [46]. All experiments in this paper use Adafactor. We set the domain weight update step size to $\eta = 1$ and the smoothing parameter to $c { = } 1 \mathrm { e } { - } 3$ in all our experiments and did not extensively tune these hyperparameters.
|
| 59 |
+
|
| 60 |
+
Algorithm 1 DoReMi domain reweighting (Step 2)
|
| 61 |
+
|
| 62 |
+
<table><tr><td>Require: Domain data D1,.,Dk,number of training steps T, batch size b,step size n, smoothing parameterc∈ [0,1] (e.g.,c=1e-3 in our implementation).</td><td></td></tr><tr><td>Initialize proxy weights 0o</td><td></td></tr><tr><td>Initialize domain weights αo = 11</td><td></td></tr><tr><td>for t from 1 to T do</td><td>Sample minibatch B={xi1,,xj} of size b from Pu, where u= 1</td></tr><tr><td>Let |x| be the token length of example x (|x|≤ L)</td><td></td></tr><tr><td></td><td>Compute per-domain excess losses for each domain i∈ {1,2,.,k} (le.,j(x) is j-th token-level</td></tr><tr><td>loss): 1 1|x</td><td>max{lθt-1,j(x)-lref,j(x),0}</td></tr><tr><td>入t[i]←Ω∈BnD ∑xEBnDi∑j=11 |x</td><td>Update domain weights (exp is entrywise): αt ← αt-1exp(n入t)</td></tr><tr><td>Renormalize and smooth domain weights: αt ← (1-c)</td><td>a +cu</td></tr><tr><td></td><td></td></tr><tr><td>end for</td><td>Update proxy model weights 0t for the objective L(0t-1,αt) (using Adam, Adafactor, etc.)</td></tr></table>
|
| 63 |
+
|
| 64 |
+
Iterated DoReMi. We extend DoReMi by running it for multiple rounds, setting the reference domain weights $\alpha _ { \mathrm { r e f } }$ for the next round to be $\bar { \alpha }$ from the previous round. We call this iterated DoReMi. The entire iterated process still only uses small models for tuning domain weights. We stop iterating when the domain weights converge, which we define as when maximum change in any domain weight $\left\| \bar { \alpha } - \alpha _ { \mathrm { r e f } } \right\| _ { \infty }$ is less than 1e-3. Empirically, this takes only 3 rounds on the GLaM dataset (Section 3.2).
|
| 65 |
+
|
| 66 |
+
# 3 DoReMi Improves LM Training Efficiency and Performance
|
| 67 |
+
|
| 68 |
+
In this section, we use DoReMi domain weights optimized with a 280M-parameter proxy model to train a 8B-parameter main model $3 0 \mathrm { x }$ larger). We consider two datasets, The Pile [17] and the GLaM dataset [13]. On The Pile, DoReMi reduces perplexity significantly on every domain, improves average downstream accuracy on generative one-shot tasks by $6 . 5 \%$ , and achieves the baseline accuracy $2 . 6 \mathbf { x }$ faster. On the GLaM dataset where domain weights tuned on downstream datasets are available, DoReMi finds domain weights with comparable performance to downstream-tuned domain weights.
|
| 69 |
+
|
| 70 |
+
# 3.1 Experimental setup
|
| 71 |
+
|
| 72 |
+
The Pile dataset. The Pile [17] is a 800GB text dataset with 22 domains (Table 1). The default domain weights were determined heuristically. We use the default domain weights from The Pile dataset to train the baseline and as the reference domain weights $\alpha _ { \mathrm { r e f } }$ in DoReMi (see Appendix C).
|
| 73 |
+
|
| 74 |
+
GLaM dataset. The GLaM dataset [13] (also used in training PaLM [10]) includes text from 8 domains (Table 2). For comparison, the GLaM domain weights (downstream-tuned) were tuned according to the downstream performance of models trained on each domain and the size of each domain [13]. We consider this an oracle comparison, since these domain weights are tuned on downstream tasks that are in our evaluation set. We use uniform domain weights both for training the baseline and the reference domain weights $\alpha _ { \mathrm { r e f } }$ for DoReMi.
|
| 75 |
+
|
| 76 |
+
Training setup. We train Transformer [51] decoder-only LMs with the standard next-token language modeling loss. We conduct a controlled comparison by equalizing the amount of compute, measured by the number of tokens processed during training. For The Pile, we train each model for $2 0 0 \mathrm { k }$ steps; for the GLaM dataset, we train each model for 300k steps. All models use a batch size of 512 and maximum token length of 1024. The proxy and reference models have 280M parameters. All models are trained from scratch (other hyperparameters are in Appendix C).
|
| 77 |
+
|
| 78 |
+
Evaluation. We use held-out validation data to measure the perplexity on each domain. For downstream evaluation, we use the generative one-shot tasks from the GPT-3 paper [9]: TriviaQA [21], NaturalQuestions [27], WebQuestions [5], SQuADv2 [41], and LAMBADA [36]. We use the standard exact-match accuracy metric for the these datasets. The performance on these datasets (particularly TriviaQA) has been shown to correlate well with model scale even at the 100M–1B range [9].
|
| 79 |
+
|
| 80 |
+
Compute used for optimizing domain weights. We train two 280M models (the reference and proxy models) to optimize the domain weights. This is $8 \%$ of the FLOPs required to train the main 8B model. All FLOPs come from standard forward and backward passes.
|
| 81 |
+
|
| 82 |
+
Notation for model sizes in DoReMi. We denote the size of the reference/proxy models (which are always the same size in our experiments) and the size of the main model trained with DoReMi domain weights as “DoReMi (size of reference/proxy size of main model)”: for example, DoReMi $( 2 8 0 \mathbf { M } \partial \mathbf { B }$ ). When we are discussing the optimized domain weights independently of the main model, we only include one number (e.g., DoReMi (280M)) which refers to the reference/proxy model size.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 3: Average one-shot downstream accuracy (exact match) on 5 tasks, with 8B parameter models trained on The Pile (left) and the GLaM dataset (right). On The Pile, DoReMi improves downstream accuracy by $6 . 5 \%$ points and achieves the baseline accuracy $2 . 6 \mathbf { x }$ faster (same plot as Figure 2). On the GLaM dataset, iterated DoReMi (round 2) attains comparable performance to oracle domain weights tuned with downstream tasks that are in our evaluation set.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 4: Per-domain log-perplexity of 8B models on The Pile. Despite downweighting some domains, DoReMi improves log-perplexity on all domains.
|
| 89 |
+
|
| 90 |
+
Table 1: Domain weights on The Pile. Baseline domain weights are computed from the default Pile dataset. DoReMi (280M) uses a 280M proxy model to optimize the domain weights.
|
| 91 |
+
|
| 92 |
+
<table><tr><td>Domain</td><td>Baseline</td><td>DoReMi (280M)</td><td>Difference</td><td>Domain</td><td>Baseline</td><td>DoReMi(280M)</td><td>Difference</td></tr><tr><td>Pile-CC</td><td>0.1121</td><td>0.6057</td><td>+0.4936</td><td>DMMathematics</td><td>0.0198</td><td>0.0018</td><td>-0.0180</td></tr><tr><td>YoutubeSubtitles</td><td>0.0042</td><td>0.0502</td><td>+0.0460</td><td>Wikipedia (en)</td><td>0.0919</td><td>0.0699</td><td>-0.0220</td></tr><tr><td>PhilPapers</td><td>0.0027</td><td>0.0274</td><td>+0.0247</td><td>OpenWebText2</td><td>0.1247</td><td>0.1019</td><td>-0.0228</td></tr><tr><td>HackerNews</td><td>0.0075</td><td>0.0134</td><td>+0.0059</td><td>Github</td><td>0.0427</td><td>0.0179</td><td>-0.0248</td></tr><tr><td>Enron Emails</td><td>0.0030</td><td>0.0070</td><td>+0.0040</td><td>FreeLaw</td><td>0.0386</td><td>0.0043</td><td>-0.0343</td></tr><tr><td>EuroParl</td><td>0.0043</td><td>0.0062</td><td>+0.0019</td><td>USPTO Backgrounds</td><td>0.0420</td><td>0.0036</td><td>-0.0384</td></tr><tr><td>Ubuntu IRC</td><td>0.0074</td><td>0.0093</td><td>+0.0019</td><td>Books3</td><td>0.0676</td><td>0.0224</td><td>-0.0452</td></tr><tr><td>BookCorpus2</td><td>0.0044</td><td>0.0061</td><td>+0.0017</td><td>PubMed Abstracts</td><td>0.0845</td><td>0.0113</td><td>-0.0732</td></tr><tr><td>NIH ExPorter</td><td>0.0052</td><td>0.0063</td><td>+0.0011</td><td>StackExchange</td><td>0.0929</td><td>0.0153</td><td>-0.0776</td></tr><tr><td>OpenSubtitles</td><td>0.0124</td><td>0.0047</td><td>-0.0077</td><td>ArXiv</td><td>0.1052</td><td>0.0036</td><td>-0.1016</td></tr><tr><td>Gutenberg (PG-19)</td><td>0.0199</td><td>0.0072</td><td>-0.0127</td><td>PubMed Central</td><td>0.1071</td><td>0.0046</td><td>-0.1025</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Table 2: Domain weights in the GLaM dataset. Iterated DoReMi (280M) converges within 3 rounds, with a similar overall pattern to domain weights tuned on downstream tasks.
|
| 95 |
+
|
| 96 |
+
<table><tr><td></td><td>Round 1</td><td>Round 2</td><td>Round 3</td><td>Downstream-tuned</td></tr><tr><td>Wikipedia</td><td>0.09</td><td>0.05</td><td>0.05</td><td>0.06</td></tr><tr><td>Filtered webpages</td><td>0.44</td><td>0.51</td><td>0.51</td><td>0.42</td></tr><tr><td>Conversations</td><td>0.10</td><td>0.22</td><td>0.22</td><td>0.27</td></tr><tr><td>Forums</td><td>0.16</td><td>0.04</td><td>0.04</td><td>0.02</td></tr><tr><td>Books</td><td>0.11</td><td>0.17</td><td>0.17</td><td>0.20</td></tr><tr><td>News</td><td>0.10</td><td>0.02</td><td>0.02</td><td>0.02</td></tr></table>
|
| 97 |
+
|
| 98 |
+
# 3.2 DoReMi improves perplexity and downstream accuracy
|
| 99 |
+
|
| 100 |
+
We show that DoReMi significantly improves both the perplexity and downstream accuracy of 8B models trained on The Pile and the GLaM dataset over their respective baseline domain weights.
|
| 101 |
+
|
| 102 |
+
Downstream accuracy improves on The Pile. Figure 3 (left) shows the average downstream performance for baseline and DoReMi $2 8 0 { \mathbf { M } } { } 8 { \mathbf { B } }$ ) models on The Pile. DoReMi improves the downstream accuracy by $6 . 5 \%$ points and achieves the baseline accuracy within $7 5 \mathrm { k }$ steps — $2 . 6 \mathbf { x }$ faster than the baseline (200k steps). Thus, DoReMi can dramatically speed up training and improve downstream performance.
|
| 103 |
+
|
| 104 |
+
DoReMi can reduce perplexity across all domains without a tradeoff. Figure 4 shows the per-domain log-perplexity of the 8B models on The Pile. DoReMi significantly reduces the perplexity over the baseline across all domains, despite allocating lower weight to some domains. How can this occur? One hypothesis is that the domains with the lowest and highest entropy can be downweighted without impacting the perplexity much. The lowest entropy domains statistically require few samples to learn. The highest entropy domains have token distributions that are close to common uniform priors — for example, models at random initialization tend to output a uniform next token distribution. Thus, we need less samples to fit these domains. Positive transfer from allocating more samples to medium entropy domains can then improve perplexity on all domains. In Appendix D, we provide a simple example where reweighting domains can improve perplexity on all domains and DoReMi finds such domain weights in simulations.
|
| 105 |
+
|
| 106 |
+
Iterated DoReMi achieves performance of downstream-tuned weights on the GLaM dataset. We employ iterated DoReMi on the GLaM dataset over 3 rounds. We find that the second and third round domain weights are almost identical (Table 2). Figure 3 (right) shows one-shot results for the first two rounds of iterated DoReMi. After the first round, the DoReMi main model has comparable downstream accuracy to the baseline (uniform domain weights). After the second round, the DoReMi main model achieves comparable downstream accuracy to oracle domain weights tuned on downstream tasks in our evaluation set. Overall, domain reweighting has a smaller effect on GLaM, possibly because there are only 8 domains compared to 22 in The Pile.
|
| 107 |
+
|
| 108 |
+
Inspecting the DoReMi domain weights. Tables 1 and 2 present the DoReMi domain weights for The Pile and the GLaM dataset. When running DoReMi on a 280M proxy model (DoReMi (280M)), most weight is put on the diverse Pile-CC web text domain. Note that Wikipedia is downweighted in comparison to the baseline, but DoReMi still improves the downstream accuracy on tasks derived from Wikipedia (e.g., TriviaQA, Appendix Table 5). Domain weights for a 1B proxy model (Appendix 8)
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 5: Average one-shot downstream accuracy across 4 model scales (280M, 510M, 760M, 1B) where the reference/proxy models for DoReMi are the same size as the main model trained with DoReMi domain weights. DoReMi consistently improves downstream accuracy across scales, with a similar $3 \%$ accuracy gap at $2 0 0 \mathrm { k }$ steps at most scales (except for 510M). DoReMi achieves the baseline accuracy 4x faster on average across scales.
|
| 112 |
+
|
| 113 |
+
shows a different trend, where OpenWebText is the mostly upweighted instead of Pile-CC. This suggests that there may be multiple possible local minima in the domain weight space. On the GLaM dataset, the DoReMi weights have the same general pattern as the downstream-tuned domain weights. DoReMi is able to recover a similar set of domain weights by starting from uniform initial reference domain weights, without any use of downstream data.
|
| 114 |
+
|
| 115 |
+
# 4 Ablations and Analysis Across Scales
|
| 116 |
+
|
| 117 |
+
Previously in Section 3, we showed that DoReMi finds domain weights using 280M models that can improve training of 8B models. In this section, we conduct an analysis of DoReMi where we vary the scale of the proxy model in relation to the main model and ablate the components of the excess loss objective.
|
| 118 |
+
|
| 119 |
+
DoReMi improves LMs consistently across scales. We consider using proxy and main models of the same size to analyze DoReMi’s behavior in a simple setting, without the need for the domain weights to generalize across scales. Note that this is just for scientific purposes since this does not save compute in practice. In particular, we run DoReMi $( \mathrm { X } { \to } \mathrm { X } )$ where X is 280M, 510M, 760M, or 1B on The Pile. Figure 5 shows that DoReMi consistently improves downstream accuracy over the baseline by $2 \%$ and achieves the baseline accuracy $4 \mathbf { x }$ faster on average across scales, and this improvement does not shrink with larger model size. DoReMi improves the worst-case perplexity on all scales and improves 18 of 22 individual domain perplexities on average across scales (Appendix Table 6). These experiments give a rough picture of how much is lost when using a smaller proxy model; our DoReMi $( 2 8 0 \mathbf { M } \partial \mathbf { B }$ ) model achieves the baseline accuracy $2 . 6 \mathbf { x }$ faster, while matching the proxy and main model sizes results in a $4 \mathbf { x }$ average speedup.
|
| 120 |
+
|
| 121 |
+
Proxy model underperforms main model, especially at larger sizes. Recall that DoReMi uses Group DRO to train a proxy model, which reweights the objective with the domain weights. In contrast, the main model is trained by resampling on the domain weights from DoReMi. When the proxy model and the main model are the same size, which one is the better model? Table 3b shows that the proxy
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 6: Average downstream accuracy for models trained on The Pile. (Left) Increasing the size of the reference/proxy models from 70M to 280M in DoReMi improves downstream accuracy for a 8B main model, but the trend does not continue for the 1B proxy model. We hypothesize that the Group DRO optimizer is worse for larger proxy models. Right) Optimizing for the hardest or easiest domains rather than excess loss (which combines both) do not achieve the same average downstream accuracy as DoReMi (280M models).
|
| 125 |
+
|
| 126 |
+
Table 3: Summary of per-domain log-perplexities on The Pile (22 total domains). Average log-perplexity is an unweighted average of the per-domain log-perplexities.
|
| 127 |
+
|
| 128 |
+
(a) Varying the size of the proxy/reference model and training at 8B.
|
| 129 |
+
|
| 130 |
+
<table><tr><td></td><td>Worst-case log-ppl</td><td>Avg log-ppl</td><td>#domains beating baseline</td></tr><tr><td>Baseline (8B)</td><td>1.71</td><td>1.64</td><td>0/22</td></tr><tr><td>DoReMi(70M->8B)</td><td>1.63</td><td>1.53</td><td>22/22</td></tr><tr><td>DoReMi(150M->8B)</td><td>1.56</td><td>1.52</td><td>22/22</td></tr><tr><td>DoReMi(280M->8B)</td><td>1.46</td><td>1.40</td><td>22/22</td></tr><tr><td>DoReMi(1B->8B)</td><td>1.58</td><td>1.54</td><td>22/22</td></tr></table>
|
| 131 |
+
|
| 132 |
+
(b) Perplexity of the DoReMi main model and proxy model of the same size. Although the 1B proxy model is relatively poor quality, the resulting domain weights still improve the main model.
|
| 133 |
+
|
| 134 |
+
<table><tr><td></td><td>Worst-case log-ppl</td><td>Avg log-ppl</td><td>#domains beating baseline</td></tr><tr><td>Baseline (280M)</td><td>2.39</td><td>2.32</td><td>0/22</td></tr><tr><td>DoReMi(280M->280M)</td><td>2.19</td><td>2.13</td><td>22/22</td></tr><tr><td>Proxy (280M)</td><td>2.33</td><td>2.27</td><td>19/22</td></tr><tr><td>Baseline (1B)</td><td>1.94</td><td>1.87</td><td>0/22</td></tr><tr><td>DoReMi(1B->1B)</td><td>1.92</td><td>1.83</td><td>19/22</td></tr><tr><td>Proxy (1B)</td><td>2.11</td><td>2.02</td><td>0/22</td></tr></table>
|
| 135 |
+
|
| 136 |
+
model typically underperforms the main model in this case. The gap between the proxy and main model increases with scale, as the 1B proxy model not only underperforms the 1B main model but also the 1B baseline model, while the 280M proxy model achieves better perplexity than the 280M baseline model on 19/22 domains. Despite the relatively poor quality of the 1B proxy model, the domain weights still allow the 1B main model to achieve the baseline performance over $2 \mathbf { x }$ faster. This suggests that DoReMi can succeed even if the proxy model is not trained well. However, we hypothesize that the mismatch between the proxy and main model training (loss reweighting vs. resampling) explains their performance difference and therefore a resampling-based Group DRO optimizer may improve DoReMi for larger proxy models.
|
| 137 |
+
|
| 138 |
+
Effect of proxy model scale on larger main model’s performance. We consider 70M, 150M, 280M, and 1B scales for the DoReMi proxy model while fixing the main model size at 8B (DoReMi $( \mathrm { X } \to 8 \mathrm { B } )$ ). From 70M to 280M, increasing the proxy model size improves downstream accuracy at 8B (Figure 6 left). We hypothesize that this trend does not continue for the 1B proxy model because the Group DRO optimizer is worse at larger scales (Table 3b). While DoReMi $2 8 0 { \mathbf { M } } { } 8 { \mathbf { B } }$ ) results in the most improvement at 8B, DoReMi ( $1 5 0 { \mathbf { M } } { } 8 { \mathbf { B } }$ ) and DoReMi ( $1 \mathrm { B } \to 8 \mathrm { B }$ ) still achieve the baseline accuracy almost $2 \mathbf { x }$ faster. This suggests that DoReMi is robust to the proxy model scale. In practice, we suggest choosing a relatively small proxy model size (280M) to save compute.
|
| 139 |
+
|
| 140 |
+
Choosing the easiest or hardest domains do not suffice. We ablate the components of the excess loss metric $\ell _ { \theta } ( x ) - \ell _ { \mathrm { r e f } } ( x )$ by running DoReMi using only the loss of the proxy model $p _ { \theta }$ on example $x$ , i.e. $\ell _ { \theta } ( x )$ (prefer hardest domains for the proxy model) or only the negative loss of the reference $- \ell _ { \mathrm { r e f } } ( x )$ (prefer easiest domains for the reference model). Figure 6 (right) shows that neither of the components of the excess loss alone are sufficient to achieve the gains of DoReMi.
|
| 141 |
+
|
| 142 |
+
# 5 Related Work
|
| 143 |
+
|
| 144 |
+
Curating pretraining data for LMs. Most closely related is the GLaM dataset [13] (also used for training PaLM [10]), which has domain weights that are tuned using downstream data. Optimizing domain weights for downstream tasks can be expensive and could require search/zero-order optimization [48], RL [56], or heuristic assumptions on how positive/negative transfer between domains work. Example-level filtering also brings benefits for LM training. The C4 dataset [39] shows gains over CommonCrawl via heuristic data cleaning methods. Du et al. [13]; Xie et al. [55] show that filtering the data at an example level for high-quality text that look like Wikipedia and books can significantly improve downstream performance for LMs. In contrast to these works, DoReMi sets domain weights automatically with only two small LM training runs and does not make assumptions about the type of data to prefer (Wikipedia-like, etc.).
|
| 145 |
+
|
| 146 |
+
General data selection methods. Moore-Lewis selection [32; 3; 15] selects examples with high cross-entropy difference (similar to excess log-perplexity) between language models trained on target and raw data. In contrast, DoReMi reweights the data without a target distribution. Coleman et al. [11] select examples based on the uncertainty of a small proxy model for active learning, while DoReMi uses DRO on the excess loss with respect to a reference model, and focuses on data mixture reweighting. Mindermann et al. [30] select examples in an online fashion by taking the top $k$ examples in a minibatch according to excess loss. DoReMi optimizes the data mixture before training, allowing the larger main model to train in a standard way. Many other works on data selection are in vision [49; 22; 24; 23; 25; 53; 54; 38; 31; 45] and mainly focus on example-level subset selection with metrics such as gradient matching. Overall, these methods do not address data selection for pretraining, where the downstream data distribution may be very different from the pretraining distribution. DoReMi aims to address the pretraining/downstream distribution shift with a robust optimization approach. To the best of our knowledge, we are the first to show that reweighting the data according to losses of a small proxy LM can improve the training efficiency of much larger LM.
|
| 147 |
+
|
| 148 |
+
Distributionally robust optimization. Within DRO methods for deep learning [4; 47; 35; 43], we target a restricted form of shift called group shifts [14; 35; 43], where the test distribution can be an unknown mixture of groups (domains). We follow DRO-LM [35], which employs DRO for LMs in the group shift setting. DRO-LM also uses a baselined loss, but with a simple bigram reference model. DoReMi uses a reference model of the same size and architecture as the proxy model to ensure that the losses are on a similar scale. During optimization, DRO-LM takes a worst-case subset of each minibatch to update the model on, while we use the Group DRO optimizer [43] which doesn’t require online subselection. If we equalize the number of examples in each minibatch used for gradient updates, online subselelction is more expensive than Group DRO since it requires running forward passes on a larger minibatch (e.g., double the minibatch size) before selecting a subset to update the model with. In comparison, the Group DRO optimizer updates the model on all examples in a weighted fashion. Overall, in contrast to these DRO methods which aim to produce robust models, we use DRO to optimize the data for training larger models more efficiently.
|
| 149 |
+
|
| 150 |
+
Data-centric AI. Large-scale datasets and benchmarks have driven much of the recent progress in AI, including vision, NLP, and multimodal models [12; 42; 52; 40; 39; 17; 44; 16]. However, most datasets are still painstakingly created with human-generated data, manual work, and heuristics [12; 39; 17; 44; 16]. DoReMi is a principled data-centric method that aims to improve language model training efficiency. We hope that DoReMi can provide a starting point for a general data-centric framework for language modeling via robust optimization.
|
| 151 |
+
|
| 152 |
+
# 6 Discussion and Limitations
|
| 153 |
+
|
| 154 |
+
Saving compute in DoReMi with extrapolation. In Section 2, we run DoReMi for the number of training steps that will be used to train the final model, which could be unnecessarily expensive. A future direction for saving compute would be to stop running DoReMi at an early step and extrapolate the domain weights for the desired number of steps, since we found that most of the variation in the domain weights during a DoReMi run seems to occur in the beginning of training (Appendix Figure 8).
|
| 155 |
+
|
| 156 |
+
Choice of reference model. The choice of reference model can affect the domain weights found by DoReMi. For example, iterated DoReMi (Section 3) improves performance by using a reference model trained on the tuned domain weights from a previous round of DoReMi. Further directions include varying the reference model size and using specialized reference models to optimize domain weights for a specific application area.
|
| 157 |
+
|
| 158 |
+
What is a domain? We define a domain by data provenance in our experiments, but this only enables coarse-grained control. Using fine-grained domains could improve the gains from DoReMi. For example, DoReMi is more effective on The Pile (22 domains) than the GLaM dataset (8 domains). Open directions include automatically finding fine-grained domains (e.g., via clustering as in DRO-LM [35]) and reweighting the data at an example level. When domains are very fine-grained, it will be important to control the pessimism of DRO (e.g., DRO can put all the weight on a small set of worst-case examples).
|
| 159 |
+
|
| 160 |
+
Transferability of domain weights across scales. We optimized the domain weights with a small proxy model (280M) and directly used these domain weights to improve training at a larger scale (8B). Understanding why the domain weights can be transferred across scales and the limits of how far these domain weights transfer are important questions to answer in future work.
|
| 161 |
+
|
| 162 |
+
Broader impacts. Large language models are We hope to improve training efficiency and reduce the environmental impact of training large LMs [50; 28; 37; 29]. In particular, by reducing the training time by $2 \mathbf { x }$ , we can halve the cost and energy consumption of training large language models. Since such efficiency improvements may be used to develop even larger models, there may be no absolute improvement in energy consumption. Ultimately, we hope to improve the training efficiency and cost of developing future language models relative to existing methods.
|
| 163 |
+
|
| 164 |
+
Large LMs have also been well-documented to have risks and biases [1; 33; 7; 6; 18]. For example, GPT-3 tends to have an anti-Muslim bias, where Muslims are frequently related to violence or terrorism in analogy and completion tasks [1]. As large language models are increasingly relied upon in applications, the magnitude of the risks increases [8]. Distributionally robust optimization (DRO), which is used in DoReMi to optimize the data mixture, can have a favorable impact on fairness [19]. While the standard approach of minimizing the average loss can lead to disparate performance on minority subgroups that do not contribute heavily to the loss [2], DRO promotes good performance on all groups via a worst-case loss. In this way, DRO-style data-centric methods such as DoReMi can improve the representation disparity between majority and minority subgroups in a dataset.
|
| 165 |
+
|
| 166 |
+
# 7 Conclusion
|
| 167 |
+
|
| 168 |
+
We introduced DoReMi, an algorithm reweighting data domains for training language models. DoReMi is able to run on small models and transfer the benefits to $3 0 \mathrm { x }$ larger models, resulting in a $2 . 6 \mathrm { x }$ speedup in training on the Pile just by changing the sampling probabilities on domains. We hope to instigate more research on data-centric approaches for improving language model training efficiency.
|
| 169 |
+
|
| 170 |
+
# Acknowledgments
|
| 171 |
+
|
| 172 |
+
We thank Xiangning Chen, Andrew Dai, Zoubin Ghahramani, Balaji Lakshminarayanan, Paul Michel, Yonghui Wu, Steven Zheng, Chen Zhu, anonymous reviewers, and the broader Google Bard team members for insightful discussions and pointers.
|
| 173 |
+
|
| 174 |
+
# References
|
| 175 |
+
|
| 176 |
+
[1] Abubakar Abid, Maheen Farooqi, and James Zou. Persistent anti-muslim bias in large language models. arXiv preprint arXiv:2101.05783, 2021.
|
| 177 |
+
[2] Dario Amodei et al. Deep speech 2 end to end speech recognition in English and mandarin. In International Conference on Machine Learning (ICML), pages 173–182, 2016.
|
| 178 |
+
[3] Amittai Axelrod. Cynical selection of language model training data. CoRR, abs/1709.02279, 2017. URL http://arxiv.org/abs/1709.02279.
|
| 179 |
+
|
| 180 |
+
[4] Aharon Ben-Tal, Dick den Hertog, Anja De Waegenaere, Bertrand Melenberg, and Gijs Rennen. Robust solutions of optimization problems affected by uncertain probabilities. Management Science, 59:341–357, 2013.
|
| 181 |
+
|
| 182 |
+
[5] Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on Freebase from question-answer pairs. In Empirical Methods in Natural Language Processing (EMNLP), 2013.
|
| 183 |
+
|
| 184 |
+
[6] Su Lin Blodgett and Brendan OConnor. Racial disparity in natural language processing: A case study of social media African-American English. arXiv preprint arXiv:1707.00061, 2017.
|
| 185 |
+
|
| 186 |
+
[7] Rishi Bommasani, Drew A. Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S. Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, Erik Brynjolfsson, Shyamal Buch, Dallas Card, Rodrigo Castellon, Niladri Chatterji, Annie Chen, Kathleen Creel, Jared Quincy Davis, Dorottya Demszky, Chris Donahue, Moussa Doumbouya, Esin Durmus, Stefano Ermon, John Etchemendy, Kawin Ethayarajh, Li Fei-Fei, Chelsea Finn, Trevor Gale, Lauren Gillespie, Karan Goel, Noah Goodman, Shelby Grossman, Neel Guha, Tatsunori Hashimoto, Peter Henderson, John Hewitt, Daniel E. Ho, Jenny Hong, Kyle Hsu, Jing Huang, Thomas Icard, Saahil Jain, Dan Jurafsky, Pratyusha Kalluri, Siddharth Karamcheti, Geoff Keeling, Fereshte Khani, Omar Khattab, Pang Wei Koh, Mark Krass, Ranjay Krishna, Rohith Kuditipudi, Ananya Kumar, Faisal Ladhak, Mina Lee, Tony Lee, Jure Leskovec, Isabelle Levent, Xiang Lisa Li, Xuechen Li, Tengyu Ma, Ali Malik, Christopher D. Manning, Suvir Mirchandani, Eric Mitchell, Zanele Munyikwa, Suraj Nair, Avanika Narayan, Deepak Narayanan, Ben Newman, Allen Nie, Juan Carlos Niebles, Hamed Nilforoshan, Julian Nyarko, Giray Ogut, Laurel Orr, Isabel Papadimitriou, Joon Sung Park, Chris Piech, Eva Portelance, Christopher Potts, Aditi Raghunathan, Rob Reich, Hongyu Ren, Frieda Rong, Yusuf Roohani, Camilo Ruiz, Jack Ryan, Christopher Ré, Dorsa Sadigh, Shiori Sagawa, Keshav Santhanam, Andy Shih, Krishnan Srinivasan, Alex Tamkin, Rohan Taori, Armin W. Thomas, Florian Tramèr, Rose E. Wang, William Wang, Bohan Wu, Jiajun Wu, Yuhuai Wu, Sang Michael Xie, Michihiro Yasunaga, Jiaxuan You, Matei Zaharia, Michael Zhang, Tianyi Zhang, Xikun Zhang, Yuhui Zhang, Lucia Zheng, Kaitlyn Zhou, and Percy Liang. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021.
|
| 187 |
+
|
| 188 |
+
[8] Rishi Bommasani, Kathleen A. Creel, Ananya Kumar, Dan Jurafsky, and Percy Liang. Picking on the same person: Does algorithmic monoculture lead to outcome homogenization? In Advances in Neural Information Processing Systems (NeurIPS), 2022.
|
| 189 |
+
|
| 190 |
+
[9] 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. arXiv preprint arXiv:2005.14165, 2020.
|
| 191 |
+
|
| 192 |
+
[10] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, A. Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, B. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, M. Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, S. Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier García, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, D. Luan, Hyeontaek Lim, Barret Zoph, A. Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, T. S. Pillai, Marie Pellat, Aitor Lewkowycz, E. Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, K. Meier-Hellstern, D. Eck, J. Dean, Slav Petrov, and Noah Fiedel. PaLM: Scaling language modeling with pathways. arXiv, 2022.
|
| 193 |
+
|
| 194 |
+
[11] Cody Coleman, Christopher Yeh, Stephen Mussmann, Baharan Mirzasoleiman, Peter Bailis, Percy Liang, Jure Leskovec, and Matei Zaharia. Selection via proxy: Efficient data selection for deep learning. In International Conference on Learning Representations (ICLR), 2020.
|
| 195 |
+
|
| 196 |
+
[12] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition (CVPR), pages 248–255, 2009.
|
| 197 |
+
[13] Nan Du, Yanping Huang, Andrew M. Dai, Simon Tong, Dmitry Lepikhin, Yuanzhong Xu, M. Krikun, Yanqi Zhou, Adams Wei Yu, Orhan Firat, Barret Zoph, Liam Fedus, Maarten Bosma, Zongwei Zhou, Tao Wang, Yu Emma Wang, Kellie Webster, Marie Pellat, Kevin Robinson, K. Meier-Hellstern, Toju Duke, Lucas Dixon, Kun Zhang, Quoc V. Le, Yonghui Wu, Zhifeng Chen, and Claire Cui. GLaM: Efficient scaling of language models with mixture-of-experts. arXiv, 2021.
|
| 198 |
+
[14] John Duchi, Tatsunori Hashimoto, and Hongseok Namkoong. Distributionally robust losses against mixture covariate shifts. https://cs.stanford.edu/\~thashim/assets/ publications/condrisk.pdf, 2019.
|
| 199 |
+
[15] Yukun Feng, Patrick Xia, Benjamin Van Durme, and João Sedoc. Automatic document selection for efficient encoder pretraining, 2022. URL https://arxiv.org/abs/2210.10951.
|
| 200 |
+
[16] Samir Yitzhak Gadre, Gabriel Ilharco, Alex Fang, Jonathan Hayase, Georgios Smyrnis, Thao Nguyen, Ryan Marten, Mitchell Wortsman, Dhruba Ghosh, Jieyu Zhang, Eyal Orgad, Rahim Entezari, Giannis Daras, Sarah Pratt, Vivek Ramanujan, Yonatan Bitton, Kalyani Marathe, Stephen Mussmann, Richard Vencu, Mehdi Cherti, Ranjay Krishna, Pang Wei Koh, Olga Saukh, Alexander Ratner, Shuran Song, Hannaneh Hajishirzi, Ali Farhadi, Romain Beaumont, Sewoong Oh, Alex Dimakis, Jenia Jitsev, Yair Carmon, Vaishaal Shankar, and Ludwig Schmidt. Datacomp: In search of the next generation of multimodal datasets. arXiv preprint arXiv:2304.14108, 2023.
|
| 201 |
+
[17] Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, and Connor Leahy. The pile: An 800gb dataset of diverse text for language modeling. arXiv, 2020.
|
| 202 |
+
[18] Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A Smith. Realtoxicityprompts: Evaluating neural toxic degeneration in language models. arXiv preprint arXiv:2009.11462, 2020.
|
| 203 |
+
[19] Tatsunori B. Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness without demographics in repeated loss minimization. In International Conference on Machine Learning (ICML), 2018.
|
| 204 |
+
[20] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, and Laurent Sifre. An empirical analysis of compute-optimal large language model training. In Advances in Neural Information Processing Systems (NeurIPS), 2022.
|
| 205 |
+
[21] Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Association for Computational Linguistics (ACL), 2017.
|
| 206 |
+
[22] Vishal Kaushal, Rishabh Iyer, Suraj Kothawade, Rohan Mahadev, Khoshrav Doctor, and Ganesh Ramakrishnan. Learning from less data: A unified data subset selection and active learning framework for computer vision. IEEE/CVF Winter Conference on Applicatios of Computer Vision (WACV), 2019.
|
| 207 |
+
[23] Krishnateja Killamsetty, Durga S, Ganesh Ramakrishnan, Abir De, and Rishabh Iyer. GRADMATCH: Gradient matching based data subset selection for efficient deep model training. In International Conference on Machine Learning (ICML), 2021.
|
| 208 |
+
[24] Krishnateja Killamsetty, Durga Sivasubramanian, Ganesh Ramakrishnan, and Rishabh Iyer. Glister: Generalization based data subset selection for efficient and robust learning. In Association for the Advancement of Artificial Intelligence (AAAI), 2021.
|
| 209 |
+
[25] Krishnateja Killamsetty, Xujiang Zhao, Feng Chen, and Rishabh Iyer. Retrieve: Coreset selection for efficient and robust semi-supervised learning. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 210 |
+
[26] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 211 |
+
[27] Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Matthew Kelcey, Jacob Devlin, Kenton Lee, Kristina N. Toutanova, Llion Jones, Ming-Wei Chang, Andrew Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. Natural questions: A benchmark for question answering research. In Association for Computational Linguistics (ACL), 2019.
|
| 212 |
+
[28] Alexandre Lacoste, Alexandra Luccioni, Victor Schmidt, and Thomas Dandres. Quantifying the carbon emissions of machine learning. arXiv preprint arXiv:1910.09700, 2019.
|
| 213 |
+
[29] Anne-Laure Ligozat, Julien Lefèvre, Aurélie Bugeau, and Jacques Combaz. Unraveling the hidden environmental impacts of AI solutions for environment. CoRR, abs/2110.11822, 2021. URL https://arxiv.org/abs/2110.11822.
|
| 214 |
+
[30] Sören Mindermann, Jan Brauner, Muhammed Razzak, Mrinank Sharma, Andreas Kirsch, Winnie Xu, Benedikt Höltgen, Aidan N. Gomez, Adrien Morisot, Sebastian Farquhar, and Yarin Gal. Prioritized training on points that are learnable, worth learning, and not yet learnt. In International Conference on Machine Learning (ICML), 2022.
|
| 215 |
+
[31] Baharan Mirzasoleiman, Jeff Bilmes, and Jure Leskovec. Coresets for data-efficient training of machine learning models. In International Conference on Machine Learning (ICML), 2020.
|
| 216 |
+
[32] Robert C. Moore and William Lewis. Intelligent selection of language model training data. In Proceedings of the ACL 2010 Conference Short Papers, pages 220–224, Uppsala, Sweden, July 2010. Association for Computational Linguistics. URL https://aclanthology.org/P10-2041.
|
| 217 |
+
[33] Moin Nadeem, Anna Bethke, and Siva Reddy. Stereoset: Measuring stereotypical bias in pretrained language models. arXiv preprint arXiv:2004.09456, 2020.
|
| 218 |
+
[34] Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on optimization, 19(4): 1574–1609, 2009.
|
| 219 |
+
[35] Yonatan Oren, Shiori Sagawa, Tatsunori Hashimoto, and Percy Liang. Distributionally robust language modeling. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 220 |
+
[36] Denis Paperno, German Kruszewski, Angeliki Lazaridou, Quan Ngoc Pham, Raffaella Bernardi, Sandro Pezzelle, Marco Baroni, Gemma Boleda, and Raquel Fernandez. The LAMBADA dataset: Word prediction requiring a broad discourse context. In Association for Computational Linguistics (ACL), 2016.
|
| 221 |
+
[37] David A. Patterson, Joseph Gonzalez, Quoc V. Le, Chen Liang, Lluis-Miquel Munguia, Daniel Rothchild, David R. So, Maud Texier, and Jeff Dean. Carbon emissions and large neural network training. CoRR, abs/2104.10350, 2021. URL https://arxiv.org/abs/2104.10350.
|
| 222 |
+
[38] Mansheej Paul, Surya Ganguli, and Gintare Karolina Dziugaite. Deep learning on a data diet: Finding important examples early in training. In Association for the Advancement of Artificial Intelligence (AAAI), 2021.
|
| 223 |
+
[39] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
|
| 224 |
+
[40] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Empirical Methods in Natural Language Processing (EMNLP), 2016.
|
| 225 |
+
[41] Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for SQuAD. In Association for Computational Linguistics (ACL), 2018.
|
| 226 |
+
[42] 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(3):211–252, 2015.
|
| 227 |
+
|
| 228 |
+
[43] Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations (ICLR), 2020.
|
| 229 |
+
|
| 230 |
+
[44] 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. In Advances in Neural Information Processing Systems (NeurIPS), 2022.
|
| 231 |
+
|
| 232 |
+
[45] Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. In International Conference on Learning Representations (ICLR), 2018.
|
| 233 |
+
|
| 234 |
+
[46] Noam Shazeer and Mitchell Stern. 2018.
|
| 235 |
+
|
| 236 |
+
[47] Aman Sinha, Hongseok Namkoong, and John Duchi. Certifiable distributional robustness with principled adversarial training. In International Conference on Learning Representations (ICLR), 2018.
|
| 237 |
+
|
| 238 |
+
[48] Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical Bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems (NeurIPS), 2012.
|
| 239 |
+
|
| 240 |
+
[49] Ben Sorscher, Robert Geirhos, Shashank Shekhar, Surya Ganguli, and Ari S. Morcos. Beyond neural scaling laws: beating power law scaling via data pruning. arXiv, 2022.
|
| 241 |
+
|
| 242 |
+
[50] Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in NLP. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3645–3650, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1355. URL https://aclanthology.org/P19-1355.
|
| 243 |
+
|
| 244 |
+
[51] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 245 |
+
|
| 246 |
+
[52] Alex Wang, Amapreet 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 (ICLR), 2019.
|
| 247 |
+
|
| 248 |
+
[53] Xinyi Wang, Hieu Pham, Paul Michel, Antonios Anastasopoulos, Jaime Carbonell, and Graham Neubig. Optimizing data usage via differentiable rewards. In International Conference on Machine Learning (ICML), 2020.
|
| 249 |
+
|
| 250 |
+
[54] Kai Wei, Rishabh Iyer, and Jeff Bilmes. Submodularity in data subset selection and active learning. In International Conference on Machine Learning (ICML), 2015.
|
| 251 |
+
|
| 252 |
+
[55] Sang Michael Xie, Shibani Santurkar, Tengyu Ma, and Percy Liang. Data selection for language models via importance resampling. arXiv preprint arXiv:2302.03169, 2023.
|
| 253 |
+
|
| 254 |
+
[56] Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure 7: Average one-shot downstream accuracy across 4 model scales, where the reference/proxy models for DoReMi are the same size as the final model trained with DoReMi domain weights. All models in this figure are trained on the GLaM dataset. DoReMi consistently improves downstream accuracy across scales.
|
| 258 |
+
|
| 259 |
+
# A Results Across Scales on the GLaM dataset
|
| 260 |
+
|
| 261 |
+
Figure 7 presents results across different scales (280M, 510M, 760M, 1B) on the GLaM dataset, where the proxy/reference models are the same size as the main model trained with DoReMi domain weights. Across all scales, DoReMi is comparable or better than both the baseline (uniform) domain weights and downstream-tuned domain weights. Interestingly, for iterated DoReMi at the 280M scale, the second round weights achieve slightly worse downstream accuracy than the round 1 weights when used to train 280M models, but transfer better to training 8B models.
|
| 262 |
+
|
| 263 |
+
# B Detailed Results for The Pile
|
| 264 |
+
|
| 265 |
+
Per-domain perplexities for 8B models. Table 4 shows per-domain perplexities for 8B models trained on the Pile. The reference/proxy models in this case are 70M, 150M, 280M, and 1B. DoReMi improves the perplexity on each domain compared to the baseline domain weights.
|
| 266 |
+
|
| 267 |
+
Per-task accuracies for 8B models. Table 5 shows the accuracies on one-shot generative tasks for various reference/proxy model sizes from 70M to 1B. All DoReMi models improve downstream performance significantly over the baseline.
|
| 268 |
+
|
| 269 |
+
Summary of perplexity results across scales. Table 6 shows a summary of per-domain perplexities for DoReMi across 4 scales (280M, 510M, 760M, 1B). Here, the reference/proxy models are the same size as the main model trained with DoReMi domain weights. On average, DoReMi improves perplexity on 18.25 out of 22 domains from The Pile. The worst-case perplexity is always reduced (or comparable in the 510M case) with respect to the baseline domain weights.
|
| 270 |
+
|
| 271 |
+
Table 4: Per-domain log-perplexities for 8B models trained on The Pile where the reference/proxy models are or smaller sizes (70M, 150M, 280M, 1B). Models trained with DoReMi domain weights have lower perplexity on all domains than the baseline weights.
|
| 272 |
+
|
| 273 |
+
<table><tr><td></td><td>Baseline (8B)</td><td>DoReMi(70M->8B)</td><td>DoReMi(150M->8B)</td><td>DoReMi(280M->8B)</td><td>DoReMi(1B->8B)</td></tr><tr><td>Pile-CC</td><td>1.64</td><td>1.51</td><td>1.48</td><td>1.41</td><td>1.55</td></tr><tr><td>PubMed Central</td><td>1.60</td><td>1.58</td><td>1.54</td><td>1.46</td><td>1.56</td></tr><tr><td>Books3</td><td>1.65</td><td>1.52</td><td>1.50</td><td>1.42</td><td>1.57</td></tr><tr><td>OpenWebText2</td><td>1.66</td><td>1.48</td><td>1.54</td><td>1.36</td><td>1.58</td></tr><tr><td>ArXiv</td><td>1.64</td><td>1.56</td><td>1.53</td><td>1.38</td><td>1.51</td></tr><tr><td>Github</td><td>1.65</td><td>1.55</td><td>1.54</td><td>1.42</td><td>1.53</td></tr><tr><td>FreeLaw</td><td>1.64</td><td>1.55</td><td>1.54</td><td>1.45</td><td>1.55</td></tr><tr><td>StackExchange</td><td>1.61</td><td>1.52</td><td>1.54</td><td>1.39</td><td>1.55</td></tr><tr><td>USPTO Backgrounds</td><td>1.70</td><td>1.53</td><td>1.50</td><td>1.41</td><td>1.56</td></tr><tr><td>PubMed Abstracts</td><td>1.61</td><td>1.56</td><td>1.51</td><td>1.44</td><td>1.55</td></tr><tr><td>Gutenberg (PG-19)</td><td>1.70</td><td>1.56</td><td>1.54</td><td>1.35</td><td>1.52</td></tr><tr><td>OpenSubtitles</td><td>1.58</td><td>1.56</td><td>1.52</td><td>1.40</td><td>1.55</td></tr><tr><td>Wikipedia (en)</td><td>1.66</td><td>1.49</td><td>1.53</td><td>1.35</td><td>1.56</td></tr><tr><td>DMMathematics</td><td>1.63</td><td>1.50</td><td>1.56</td><td>1.38</td><td>1.48</td></tr><tr><td>Ubuntu IRC</td><td>1.71</td><td>1.53</td><td>1.49</td><td>1.42</td><td>1.48</td></tr><tr><td>BookCorpus2</td><td>1.64</td><td>1.57</td><td>1.54</td><td>1.43</td><td>1.57</td></tr><tr><td>EuroParl</td><td>1.59</td><td>1.52</td><td>1.51</td><td>1.37</td><td>1.53</td></tr><tr><td>HackerNews</td><td>1.66</td><td>1.50</td><td>1.55</td><td>1.45</td><td>1.55</td></tr><tr><td>YoutubeSubtitles</td><td>1.67</td><td>1.63</td><td>1.55</td><td>1.42</td><td>1.53</td></tr><tr><td>PhilPapers</td><td>1.67</td><td>1.55</td><td>1.49</td><td>1.39</td><td>1.53</td></tr><tr><td>NIHExPorter</td><td>1.63</td><td>1.51</td><td>1.48</td><td>1.36</td><td>1.52</td></tr><tr><td>Enron Emails</td><td>1.62</td><td>1.48</td><td>1.52</td><td>1.44</td><td>1.56</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 5: Per-task exact-match accuracies for generative one-shot tasks. All DoReMi models improve downstream performance significantly over the baseline domain weights.
|
| 276 |
+
|
| 277 |
+
<table><tr><td></td><td>Baseline</td><td>DoReMi(1B->8B)</td><td>DoReMi(280M->8B)</td><td>DoReMi(150M->8B)</td><td>DoReMi(70M->8B)</td></tr><tr><td>LAMBADA</td><td>20.10</td><td>22.55</td><td>29.19</td><td>20.59</td><td>26.20</td></tr><tr><td>NaturalQuestions</td><td>4.35</td><td>6.01</td><td>7.73</td><td>6.26</td><td>5.10</td></tr><tr><td>SQuADv2</td><td>44.43</td><td>42.22</td><td>51.89</td><td>46.53</td><td>40.99</td></tr><tr><td>TriviaQA</td><td>24.55</td><td>32.25</td><td>34.86</td><td>30.01</td><td>26.30</td></tr><tr><td>WebQuestions</td><td>6.74</td><td>8.71</td><td>9.15</td><td>9.15</td><td>6.99</td></tr><tr><td>Average</td><td>20.03</td><td>22.35</td><td>26.56</td><td>22.51</td><td>21.11</td></tr></table>
|
| 278 |
+
|
| 279 |
+
Table 6: Summary of per-domain log-perplexities for 280M, 510M, 760M, and 1B models trained on The Pile, where the reference/proxy models are the same size. DoReMi improves the worst-case and average perplexity of the baseline domain weights in all cases. On average, DoReMi improves perplexity on 18 out of 22 domains.
|
| 280 |
+
|
| 281 |
+
<table><tr><td>Worst-case log-ppl</td><td>Avg log-ppl</td><td># domains beating baseline</td></tr><tr><td>Baseline (280M)</td><td>2.39</td><td>2.32 0/22</td></tr><tr><td>DoReMi(280M->280M)</td><td>2.19</td><td>2.13 22/22</td></tr><tr><td>Proxy (280M)</td><td>2.33 2.27</td><td>19/22</td></tr><tr><td>Baseline (510M)</td><td>2.14</td><td>2.08 0/22</td></tr><tr><td>DoReMi(510M->510M)</td><td>2.14</td><td>2.06 15/22</td></tr><tr><td>Proxy (510M)</td><td>2.23</td><td>2.18 0/22</td></tr><tr><td>Baseline (760M)</td><td>2.05</td><td>1.97 0/22</td></tr><tr><td>DoReMi(760M->760M)</td><td>2.00</td><td>1.94 17/22</td></tr><tr><td>Proxy (760M)</td><td>2.15 2.10</td><td>0/22</td></tr><tr><td>Baseline (1B)</td><td>1.94</td><td>1.87 0/22</td></tr><tr><td>DoReMi(1B->1B)</td><td>1.92</td><td>1.83 19/22</td></tr><tr><td>Proxy (1B)</td><td>2.11 2.02</td><td>0/22</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 7: Summary of perplexity results for ablations on the DRO objective (excess loss). The individual components (which prefer hardest and easiest domains respectively) do not reduce perplexity over the baseline.
|
| 284 |
+
|
| 285 |
+
<table><tr><td></td><td>Worst-case log-ppl</td><td>Avg log-ppl</td><td>#domains beating baseline</td></tr><tr><td>Baseline (280M)</td><td>2.39</td><td>2.32</td><td>0</td></tr><tr><td>DoReMi(280M->280M)</td><td>2.19</td><td>2.13</td><td>22/22</td></tr><tr><td>Hardest (280M->280M)</td><td>2.66</td><td>2.62</td><td>0/22</td></tr><tr><td>Easiest (280M->280M)</td><td>4.27</td><td>4.18</td><td>0/22</td></tr></table>
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 8: Exponential moving average of domain weights throughout a DoReMi run for 280M and 1B reference/proxy models. In the beginning of the run, the domain weights change quickly and then become more stable after $5 0 \mathrm { k }$ steps. This suggests that 1) smaller compute budgets may require drastically different domain weights, and 2) we may be able to save compute by extrapolating the domain weights after 50k steps.
|
| 289 |
+
|
| 290 |
+
Perplexity results for ablations. Table 7 shows the perplexities for ablations on the DRO objective. We change the DRO objective and use these to tune domain weights on 280M reference/proxy models. These tuned domain weights are then used to train a main 280M model. Hardest refers to optimizing the domain-level log-perplexity without baselining with a reference model. Easiest refers to optimizing for the domains with lowest log-perplexity under the reference model. Both ablations do not improve perplexity on any domain over the baseline. Optimizing for the “hardest” domain does not actually result in improving worst-case perplexity, supporting the results of Oren et al. [35], which also employs DRO for language modeling with a baselined loss.
|
| 291 |
+
|
| 292 |
+
Trajectory of domain weights. Figure 8 shows the exponential moving average (smoothing parameter 0.99) of domain weights during a run of DoReMi. In both cases, there are domains with very high weight initially and decrease in weight very quickly (within 50k steps). Since we compute the final domain weights by integrating these curves over steps and normalizing, this suggests that if we have a smaller compute budget, these domains could become more important — this highlights the dependence of the mixture weights on the compute budget. At the same time, the domain weights tend to quickly stabilize after 50k steps, suggesting that the optimal domain weights should be similar for larger compute budgets. We may also be able to take advantage of this stability after $5 0 \mathrm { k }$ steps to run DoReMi for a smaller number of steps and extrapolate the domain weights to save compute.
|
| 293 |
+
|
| 294 |
+
Comparison of domain weights for 280M and 1B. Table 8 presents the DoReMi domain weights for The Pile at 280M and 1B proxy models. Different proxy model sizes can result in different domain weights, which suggests that there may be multiple local minima in domain weight space. With a 280M proxy model, most of the weight is put on the Pile-CC web text domain, while DoReMi with a
|
| 295 |
+
|
| 296 |
+
Table 8: Domain weights on The Pile. Baseline domain weights are computed from the default Pile dataset. With different proxy model sizes, DoReMi (280M) and DoReMi (1B) result in different domain weights. Despite the differences, the qualitative patterns are similar other than the which web domain has the most weight.
|
| 297 |
+
|
| 298 |
+
<table><tr><td></td><td>Baseline</td><td>DoReMi(280M)</td><td>DoReMi(1B)</td></tr><tr><td>Pile-CC</td><td>0.1121</td><td>0.6057</td><td>0.1199</td></tr><tr><td>PubMed Central</td><td>0.1071</td><td>0.0046</td><td>0.0149</td></tr><tr><td>Books3</td><td>0.0676</td><td>0.0224</td><td>0.0739</td></tr><tr><td>OpenWebText2</td><td>0.1247</td><td>0.1019</td><td>0.3289</td></tr><tr><td>ArXiv</td><td>0.1052</td><td>0.0036</td><td>0.0384</td></tr><tr><td>Github</td><td>0.0427</td><td>0.0179</td><td>0.0129</td></tr><tr><td>FreeLaw</td><td>0.0386</td><td>0.0043</td><td>0.0148</td></tr><tr><td>StackExchange</td><td>0.0929</td><td>0.0153</td><td>0.0452</td></tr><tr><td>USPTO Backgrounds</td><td>0.0420</td><td>0.0036</td><td>0.0260</td></tr><tr><td>PubMed Abstracts</td><td>0.0845</td><td>0.0113</td><td>0.1461</td></tr><tr><td>Gutenberg (PG-19)</td><td>0.0199</td><td>0.0072</td><td>0.0250</td></tr><tr><td>OpenSubtitles</td><td>0.0124</td><td>0.0047</td><td>0.0017</td></tr><tr><td>Wikipedia (en)</td><td>0.0919</td><td>0.0699</td><td>0.0962</td></tr><tr><td>DMMathematics</td><td>0.0198</td><td>0.0018</td><td>0.0004</td></tr><tr><td>Ubuntu IRC</td><td>0.0074</td><td>0.0093</td><td>0.0044</td></tr><tr><td>BookCorpus2</td><td>0.0044</td><td>0.0061</td><td>0.0029</td></tr><tr><td>EuroParl</td><td>0.0043</td><td>0.0062</td><td>0.0078</td></tr><tr><td>HackerNews</td><td>0.0075</td><td>0.0134</td><td>0.0058</td></tr><tr><td>YoutubeSubtitles</td><td>0.0042</td><td>0.0502</td><td>0.0159</td></tr><tr><td>PhilPapers</td><td>0.0027</td><td>0.0274</td><td>0.0063</td></tr><tr><td>NIHExPorter</td><td>0.0052</td><td>0.0063</td><td>0.0094</td></tr><tr><td>Enron Emails</td><td>0.0030</td><td>0.0070</td><td>0.0033</td></tr></table>
|
| 299 |
+
|
| 300 |
+
1B proxy model puts most of the weight on OpenWebText2. The overall pattern of the domain weights for the rest of the domains are similar.
|
| 301 |
+
|
| 302 |
+
# C Training Details
|
| 303 |
+
|
| 304 |
+
Data preprocessing. For all datasets, we preprocessed the data by chunking into length 1024 examples with respect to a SentencePiece tokenizer with $2 5 6 \mathrm { k }$ vocabulary size. The examples are separated by domain to facilitate hierarchical sampling (first sample a domain according to some domain weights, then sample an example from that domain at random). To reduce the amount of padding tokens, we made an effort to pack examples (possibly from different domains) together into the same sequence. When doing such a packing, we compute the domain perplexities on a per-token level in DoReMi.
|
| 305 |
+
|
| 306 |
+
Baseline domain weights for The Pile. The baseline domain weights for The Pile were computed from The Pile dataset and the number of epochs for each domain given in Gao et al. [17]. After chunking into length 1024 examples, we counted the number of examples in each domain and multiplied by the number of epochs that domain specified in Gao et al. [17]. We then normalized these counts to obtain the baseline domain weights.
|
| 307 |
+
|
| 308 |
+
Training setup. For all training runs (including DRO runs), we train with a batch size of 512, initial learning rate of 1e-3, weight decay of 1e-2, and gradient clipping to norm 1. We decay the learning rate exponentially until it reaches a minimum of 1e-4 at the end of training, with a linear warmup of $6 \%$ of the total training steps. We train for 200k steps on The Pile and 300k steps on the GLaM dataset. Models under 1B parameters were trained with TPUv3 accelerators, while 1B and 8B models were trained with TPUv4.
|
| 309 |
+
|
| 310 |
+
Model architectures. Table 9 shows the architecture hyperparameters for the model sizes used in the paper. All the models we use are vanilla Transformer decoder-only models with a 256k vocab size.
|
| 311 |
+
|
| 312 |
+
# D Simple Example Where Data Reweighting Has No Tradeoff
|
| 313 |
+
|
| 314 |
+
Motivated by the findings in Section 3.2, we present a simple language modeling example where reweighting the training data from different domains improves perplexity on all domains. The example shows that DoReMi downweights domains that are extremely high or low entropy.
|
| 315 |
+
|
| 316 |
+
Setup. Suppose the ground-truth distribution of text $p ^ { * }$ is a mixture over $k$ domains, where each domain $z \in \left\{ 1 , . . . , k \right\}$ is defined by a different unigram distribution $p ^ { * } ( x | z )$ over $m$ tokens. Given a budget of $n$ training samples, the goal is choose domain weights $p ( z )$ $k$ scalars that add to 1) to sample training data with such that we learn the parameters of the unigram distributions $p ^ { * } ( \cdot | z )$ well for all $z$ from 1 to $k$ . Notably, we do not aim to estimate the ground truth mixture proportions across domains.
|
| 317 |
+
|
| 318 |
+
Table 9: Architecture hyperparameters for various model scales used in the paper. All models are vanilla Transformer decoder-only models and use vocabulary size 256k.
|
| 319 |
+
|
| 320 |
+
<table><tr><td></td><td>Layers</td><td>Attention heads</td><td>Attention head dim</td><td>Model dim</td><td>Hidden dim</td></tr><tr><td>70M</td><td>3</td><td>4</td><td>64</td><td>256</td><td>1024</td></tr><tr><td>150M</td><td>6</td><td>8</td><td>64</td><td>512</td><td>2048</td></tr><tr><td>280M</td><td>12</td><td>12</td><td>64</td><td>768</td><td>3072</td></tr><tr><td>510M</td><td>12</td><td>16</td><td>64</td><td>1024</td><td>8192</td></tr><tr><td>760M</td><td>12</td><td>20</td><td>64</td><td>1280</td><td>8192</td></tr><tr><td>1B</td><td>16</td><td>32</td><td>64</td><td>2048</td><td>8192</td></tr><tr><td>8B</td><td>32</td><td>32</td><td>128</td><td>4096</td><td>24576</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Data. Given some domain weights $p ( z )$ , we sample training data hierarchically: first we determine the number of samples $n _ { z }$ per domain $z$ by drawing from a multinomial distribution over $k$ possibilities with probabilities defined by $p ( z )$ and $n$ total trials. Then, for each domain $z$ , we sample $n _ { z }$ tokens from $p ^ { * } ( \cdot | z )$ , forming a vector of tokens $X _ { z }$ with length $n _ { z }$ .
|
| 323 |
+
|
| 324 |
+
Model. For each domain $z$ , we consider a Bayesian model of the unigram distribution $p ( x | z ; \theta )$ with a Dirichlet prior $p ( \boldsymbol { \theta } | \boldsymbol { z } ; \beta )$ over the unigram distribution parameters $\theta \in \Delta ^ { m }$ . The Dirichlet prior has hyperparameters $\beta \in \mathbb { R } ^ { m }$ , which can be viewed as a “pseudo-count” for each token. For each domain $z$ , we estimate the parameters $\hat { \theta } _ { z }$ by computing the mean of the posterior distribution conditioned on the data:
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\hat { \theta } _ { z } ( x ) = \frac { 1 } { n _ { z } + s _ { z } } \left[ \lambda _ { z } ( x ) + \sum _ { i = 1 } ^ { n _ { z } } \mathbf { 1 } [ X _ { z } [ i ] = x ] \right] \mathrm { ~ f o r ~ a l l ~ } x \in \{ 1 , . . . , m \}
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
where $s _ { z } = \sum _ { x } \lambda _ { z } ( x )$ is the sum of pseudocounts.
|
| 331 |
+
|
| 332 |
+
For a domain $z$ , we can write the parameter error of this estimator as a function of the “difficulty” $H _ { z }$ of predicting the next token and the “quality” of the prior $\Delta _ { z }$ , defined below.
|
| 333 |
+
|
| 334 |
+
Lemma D.1. For domain index $z$ with $n _ { z }$ samples, the parameter error is
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\sum _ { x } \mathbb { E } [ ( \hat { \theta } _ { z } ( x ) - p ^ { * } ( x \mid z ) ) ^ { 2 } ] = \frac { n _ { z } H _ { z } + s _ { z } ^ { 2 } \Delta _ { z } } { ( n _ { z } + s _ { z } ) ^ { 2 } }
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
where
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { l } { \displaystyle { H _ { z } = \sum _ { x } p ^ { * } ( x \mid z ) ( 1 - p ^ { * } ( x \mid z ) ) } } \\ { \displaystyle { \Delta _ { z } = \sum _ { x } \biggl ( p ^ { * } ( x \mid z ) - \frac { \lambda _ { z } ( x ) } { s _ { z } } \biggr ) ^ { 2 } . } } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Proof. The parameter error is
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\sum _ { x } \mathbb { E } [ ( \hat { \theta } _ { z } ( x ) - p ^ { * } ( x | z ) ) ^ { 2 } ] = \sum _ { x } \mathbb { E } [ \hat { \theta } _ { z } ( x ) ^ { 2 } ] - 2 \mathbb { E } [ \hat { \theta } _ { z } ( x ) ] p ^ { * } ( x | z ) + p ^ { * } ( x | z ) ^ { 2 } .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Evaluating the terms separately,
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { l } { \displaystyle \mathbb { E } [ \hat { \theta } _ { z } ( x ) ] = \frac { 1 } { n _ { z } + s _ { z } } \Bigg [ \lambda _ { z } ( x ) + \sum _ { i = 1 } ^ { n _ { z } } \mathbf { 1 } [ X _ { z } [ i ] = x ] \Bigg ] } \\ { \displaystyle \quad = \frac { 1 } { n _ { z } + s _ { z } } ( \lambda _ { z } ( x ) + n _ { z } p ^ { * } ( x | z ) ) } \\ { \displaystyle \mathbb { E } [ \hat { \theta } _ { z } ( x ) ^ { 2 } ] = \frac { 1 } { ( n _ { z } + s _ { z } ) ^ { 2 } } \mathbb { E } [ ( \lambda _ { z } ( x ) + \sum _ { i = 1 } ^ { n _ { z } } \mathbf { 1 } [ X _ { z } [ i ] = x ] ) ^ { 2 } ] } \\ { \displaystyle \quad = \frac { 1 } { ( n _ { z } + s _ { z } ) ^ { 2 } } [ \lambda _ { z } ( x ) ^ { 2 } + 2 \lambda _ { z } ( x ) n _ { z } p ^ { * } ( x | z ) + n _ { z } p ^ { * } ( x | z ) + ( n _ { z } ^ { 2 } - n _ { z } ) p ^ { * } ( x | z ) ^ { 2 } ] } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Putting it all together, the parameter error can be written as
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { c l } { { \displaystyle \sum _ { x } \mathbb { E } [ ( \hat { \theta } _ { z } ( x ) - p ^ { * } ( x \mid z ) ) ^ { 2 } ] = \sum _ { x } \frac { ( s _ { z } ^ { 2 } - n _ { z } ) p ^ { * } ( x \mid z ) ^ { 2 } + \lambda _ { z } ( x ) ^ { 2 } + ( n _ { z } - 2 s _ { z } \lambda _ { z } ( x ) ) p ^ { * } ( x \mid z ) } { ( n _ { z } + s _ { z } ) ^ { 2 } } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \end{array} = \sum _ { x } \frac { n _ { z } p ^ { * } ( x \mid z ) ( 1 - p ^ { * } ( x \mid z ) ) + s _ { z } ^ { 2 } \Big ( p ^ { * } ( x \mid z ) - \frac { \lambda _ { z } ( x ) } { s _ { z } } \Big ) ^ { 2 } } { ( n _ { z } + s _ { z } ) ^ { 2 } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { { { } } } \\ { } \\ { { { { } } } } \\ { } \\
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
No-tradeoff example. Suppose there are 3 domains $z \in \{ 1 , 2 , 3 \}$ and $m = 3$ vocabulary tokens $x \in \{ 1 , 2 , 3 \}$ . We use a symmetric Dirichlet prior (preferring a uniform token distribution) where $\lambda _ { z } ( x ) = 1 / 3$ for all tokens $x$ and domains $z$ . Here, $\begin{array} { r } { \bar { s _ { z } } = \sum _ { x } \bar { \lambda _ { z } } ( x ) = 1 } \end{array}$ . In this setting, we show that there is a set of domain weights that has strictly lower parameter error than the baseline where we sample the same number of tokens from each domain: $n _ { z }$ are equal for all domains $z$ .
|
| 365 |
+
|
| 366 |
+
Suppose the ground truth paramaters for the unigram distributions are
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\begin{array} { r } { \left[ \begin{array} { c c c } { 1 } & { 0 } & { 0 } \\ { 0 . 7 } & { 0 . 2 } & { 0 . 1 } \\ { 1 / 3 } & { 1 / 3 } & { 1 / 3 } \end{array} \right] , } \end{array}
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
where row $z$ contains the parameters for domain $z$ . For example, token 1 has probability 1 under domain 1’s unigram distribution.
|
| 373 |
+
|
| 374 |
+
For domain $z = 1$ (non-noisy domain), we have $H _ { 1 } = 0$ so the parameter error (according to Lemma D.1) is
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\frac { s _ { 1 } ^ { 2 } \Delta _ { 1 } } { ( n _ { 1 } + s _ { 1 } ) ^ { 2 } }
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
which is strictly decreasing in the number of samples $n _ { 1 }$
|
| 381 |
+
|
| 382 |
+
For domain $z = 3$ (noisy domain), we have $\Delta _ { 3 } = 0$ so the parameter error is
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\frac { n _ { 3 } H _ { 3 } } { ( n _ { 3 } + s _ { 3 } ) ^ { 2 } } ,
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
by Lemma D.1. This error is minimized to zero at $n _ { 3 } = 0$ (no samples). This means that we can allocate samples elsewhere while still reducing error.
|
| 389 |
+
|
| 390 |
+
For $z = 2$ (intermediate entropy domain), we have $\Delta _ { 2 } = 0 . 2 0 7$ and $H _ { 2 } = 0 . 4 6$ . The derivative of the parameter error with respect to the number of samples $n _ { 2 }$ is
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\frac { \partial } { \partial n _ { 2 } } \frac { n _ { 2 } H _ { 2 } + s _ { 2 } ^ { 2 } \Delta _ { 2 } } { ( n _ { 2 } + s _ { 2 } ) ^ { 2 } } = \frac { H _ { 2 } ( s _ { 2 } - n _ { 2 } ) - 2 s _ { 2 } ^ { 2 } \Delta _ { 2 } } { ( n _ { 2 } + s _ { 2 } ) ^ { 3 } }
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
which is negative when
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
n _ { 2 } > s _ { 2 } - \frac { 2 s _ { 2 } ^ { 2 } \Delta _ { 2 } } { H _ { 2 } } .
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
This inequality holds in this case since $\begin{array} { r } { \frac { 2 \Delta _ { 2 } } { H _ { 2 } } < 1 } \end{array}$ and $s _ { 2 } = 1$ . Therefore the parameter error is decreasing in the number of samples $n _ { 2 }$ .
|
| 403 |
+
|
| 404 |
+
Thus, any domain weights that reallocate the examples from domain 3 to domains 1 and 2 reduces the parameter error for all domains.
|
| 405 |
+
|
| 406 |
+
What kind of domains are downweighted? Intuitively, we can downweight the very noisy (high entropy/difficulty) domain 3 because the initialization perfectly matches the ground truth. This allows us to reallocate samples to the other domains 1 and 2. Between these, domain 1 requires less additional samples since the parameter error decreases very quickly with the number of samples $n _ { 1 }$ (the difficulty $H _ { 1 }$ is zero). Thus, the easiest domains should also receive relatively less weight. In practice, positive transfer between domains (which is not captured here) can also contribute to scenarios where reweighting results in no tradeoff across domains.
|
| 407 |
+
|
| 408 |
+
Simulation with DoReMi. We consider running DoReMi on the above no-tradeoff instance of the simple example with the ground truth unigram distributions in Equation 14. Note that DoReMi’s domain reweighting step (Step 2, Algorithm 1) involves a loop over $T$ iterative model updates, while the estimator from Equation 2 is computed in closed form. To adapt the estimator for DoReMi, we consider an iterative version where the average is computed in an online fashion. We run DoReMi for $T = 5 0 0$ steps using minibatch size 1 over the $n { = } 5 0 0$ training examples with domain weight update rate $\eta { = } 0 . 5$ . For the model update at step $t$ on an example $x$ from domain $z$ , we increase the pseudo-count $\widehat { \theta } _ { z } ( x )$ by the current domain weight $\alpha _ { t }$ corresponding to domain $z$ . Instead of using the examples in the minibatch (which is only size 1 and doesn’t represent all domains), we compute the per-domain excess log-perplexities in Algorithm 1 using a fixed, independent evaluation set of 30 examples.
|
| 409 |
+
|
| 410 |
+
We compare DoReMi against a model trained with baseline domain weights, which are uniform over the 3 domains. All models are trained on $n { = } 5 0 0$ training examples. We evaluate the log-perplexity of a model on each domain in closed form using the ground truth unigram distribution parameters.
|
| 411 |
+
|
| 412 |
+
On this simple example, DoReMi returns domain weights [0.39,0.61,0.0] after rounding to 2 decimal places. These weights correspond to our intuitions — the first domain (non-noisy) is increased by a small amount, the third domain (noisy) is decreased to 0 weight, and most of the weight is allocated to the second domain. We use these domain weights to generate a new dataset of 500 examples. The model trained with this new dataset improves over the baseline model in perplexity on all domains.
|
md/dev/mRieQgMtNTQ/mRieQgMtNTQ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/mWVoBz4W0u/mWVoBz4W0u.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/muFvu66v7u/muFvu66v7u.md
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DP-SGD Without Clipping: The Lipschitz Neural Network Way
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
State-of-the-art approaches for training Differentially Private (DP) Deep Neural Networks (DNN) faces difficulties to estimate tight bounds on the sensitivity of the network’s layers, and instead rely on a process of per-sample gradient clipping. This clipping process not only biases the direction of gradients but also proves costly both in memory consumption and in computation. To provide sensitivity bounds and bypass the drawbacks of the clipping process, our theoretical analysis of Lipschitz constrained networks reveals an unexplored link between the Lipschitz constant with respect to their input and the one with respect to their parameters. By bounding the Lipschitz constant of each layer with respect to its parameters we guarantee DP training of these networks. This analysis not only allows the computation of the aforementioned sensitivities at scale but also provides leads on to how maximize the gradient-to-noise ratio for fixed privacy guarantees. To facilitate the application of Lipschitz networks and foster robust and certifiable learning under privacy guarantees, we provide a Python package that implements building blocks allowing the construction and private training of such networks.
|
| 11 |
+
|
| 12 |
+
# 16 1 Introduction
|
| 13 |
+
|
| 14 |
+
17 Machine learning relies more than ever on foundational models, and such practices raise questions
|
| 15 |
+
18 about privacy. Differential privacy allows to develop methods for training models that preserve
|
| 16 |
+
19 the privacy of individual data points in the training set. The field seeks to enable deep learning on
|
| 17 |
+
20 sensitive data, while ensuring that models do not inadvertently memorize or reveal specific details
|
| 18 |
+
21 about individual samples in their weights. This involves incorporating privacy-preserving mechanisms
|
| 19 |
+
22 into the design of deep learning architectures and training algorithms, whose most popular example
|
| 20 |
+
23 is Differentially Private Stochastic Gradient Descent (DP-SGD) [1]. One main drawback of classical
|
| 21 |
+
24 DP-SGD methods is that they require costly per-sample backward processing and gradient clipping.
|
| 22 |
+
25 In this paper, we offer a new method that unlocks fast differentially private training through the use
|
| 23 |
+
26 of Lipschitz constrained neural networks. Additionally, this method offers new opportunities for
|
| 24 |
+
27 practitioners that wish to easily "DP-fy" [2] the training procedure of a deep neural network.
|
| 25 |
+
28 Differential privacy fundamentals. Informally, differential privacy is a definition that quantifies how
|
| 26 |
+
29 much the change of a single sample in a dataset affects the range of a stochastic function (here the DP
|
| 27 |
+
30 training), called mechanism in this context. This quantity can be bounded in an inequality involving
|
| 28 |
+
31 two parameters $\epsilon$ and $\delta$ . A mechanism fulfilling such inequality is said $( \epsilon , \delta )$ -DP (see Definition 1).
|
| 29 |
+
32 This definition is universally accepted as a strong guarantee against privacy leakages under various
|
| 30 |
+
33 scenarii, including data aggregation or post-processing [3]. A popular rule of thumb suggests using
|
| 31 |
+
34 $\epsilon \leq 1 0$ and $\textstyle { \delta < { \frac { \mathtt { j } } { N } } }$ with $N$ the number of records [2] for mild guarantees. In practice, most classic
|
| 32 |
+
35 algorithmic procedures (called queries in this context) do not readily fulfill the definition for useful
|
| 33 |
+
36 values of $( \epsilon , \delta )$ , in particular the deterministic ones: randomization is mandatory. This randomization
|
| 34 |
+
|
| 35 |
+
model $=$ DP_Sequential ( # step 1: use DP_Sequential to build a model [ # step 2: add Lipschitz layers of known sensitivity DP_BoundedInput ( input_shape $=$ (28 , 28 , 1) , upper_bound $\scriptstyle 2 0$ .) , DP_SpectralConv2D ( filters $= 1 6$ , kernel_size $^ { = 3 }$ , use_bias $=$ False ) , DP_GroupSort (2) , DP_Flatten () , DP_SpectralDense (10) , ] , noise_multiplier $=$ 1.2 , # step 3: choose DP parameters sampling_probability $=$ batch_size / dataset_size ,
|
| 36 |
+
) # step 4: compile the model , and choose any first order optimizer
|
| 37 |
+
model . compile ( loss $=$ DP_Crossentropy () , optimizer $=$ Adam (1 e -3) )
|
| 38 |
+
model .fit ( # step 5: train the model and measure the DP guarantees train_dataset , validation_dat ${ \mathfrak { a } } =$ val_dataset , epochs $=$ num_epochs , callbacks $=$ [ DP_Accountant () ]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
37 comes at the expense of “utility”, i.e the usefulness of the output for downstream tasks [4]. The goal
|
| 42 |
+
38 is then to strike a balance between privacy and utility, ensuring that the released information remains
|
| 43 |
+
39 useful and informative for the intended purpose while minimizing the risk of privacy breaches. The
|
| 44 |
+
40 privacy/utility trade-off yields a Pareto front, materialized by plotting $\epsilon$ against a measurement of
|
| 45 |
+
41 utility, such as validation accuracy for a classification task.
|
| 46 |
+
42 Private gradient descent. The SGD algorithm consists of a sequence of queries that (i) take the
|
| 47 |
+
43 dataset in input, sample a minibatch from it, and return the gradient of the loss evaluated on the
|
| 48 |
+
44 minibatch, before (ii) performing a descent step following the gradient direction. The sensitivity (see
|
| 49 |
+
45 Definition 2) of SGD queries is proportional to the norm of the per-sample gradients. DP-SGD turns
|
| 50 |
+
46 each query into a Gaussian mechanism by perturbing the gradients with a noise $\zeta$ . The upper bound
|
| 51 |
+
47 on gradient norms is generally unknown in advance, which leads practitioners to clip it to $C > 0$ , in
|
| 52 |
+
48 order to bound the sensitivity manually. This is problematic for several reasons: 1. Hyper-parameter
|
| 53 |
+
49 search on the broad-range clipping value $C$ is required to train models with good privacy/utility trade
|
| 54 |
+
50 offs [5], 2. The computation of per-sample gradients is expensive: DP-SGD is usually slower and
|
| 55 |
+
51 consumes more memory than vanilla SGD, in particular for the large batch sizes often used in private
|
| 56 |
+
52 training [6], 3. Clipping the per-sample gradients biases their average [7]. This is problematic as the
|
| 57 |
+
53 average direction is mainly driven by misclassified examples, that carry the most useful information
|
| 58 |
+
54 for future progress.
|
| 59 |
+
55 An unexplored approach: Lipschitz constrained networks. We propose to train neural networks
|
| 60 |
+
56 for which the parameter-wise gradients are provably and analytically bounded during the whole
|
| 61 |
+
57 training procedure, in order to get rid of the clipping process. This allows for rapid training of models
|
| 62 |
+
58 without a need for tedious hyper-parameter optimization.
|
| 63 |
+
59 The main reason why this approach has not been experimented much in the past is that upper bounding
|
| 64 |
+
60 the gradient of neural networks is often intractable. However, by leveraging the literature of Lipschitz
|
| 65 |
+
61 constrained networks [8], we show that these networks allows to estimate their gradient bound.
|
| 66 |
+
62 This yields tight bounds on the sensitivity of SGD steps, making their transformation into Gaussian
|
| 67 |
+
63 mechanisms inexpensive - hence the name Clipless DP-SGD.
|
| 68 |
+
64 Informally, the Lipschitz constant quantifies the rate at which the function’s output varies with respect
|
| 69 |
+
65 to changes in its input. A Lipschitz constrained network is one in which its weights and activations
|
| 70 |
+
66 are constrained such that it can only represent $l$ -Lipschitz functions. In this work, we will focus our
|
| 71 |
+
67 attention on feed-forward networks (refer to Definition 3). Note that the most common architectures,
|
| 72 |
+
68 such as Convolutional Neural Networks (CNNs), Fully Connected Networks (FCNs), Residual
|
| 73 |
+
69 Networks (ResNets), or patch-based classifiers (like MLP-Mixers), all fall under the category of
|
| 74 |
+
70 feed-forward networks. We will also tackle the particular case of Gradient Norm Preserving (GNP)
|
| 75 |
+
71 networks, a subset of Lipschitz networks that enjoy tighter bounds (see appendix).
|
| 76 |
+
|
| 77 |
+
# 72 Contributions
|
| 78 |
+
|
| 79 |
+
73 While the properties of Lipschitz constrained networks regarding their inputs are well explored, the
|
| 80 |
+
74 properties with respect to its parameters remain non-trivial. This work provides a first step to fill this
|
| 81 |
+
75 gap: our analysis shows that under appropriate architectural constraints, a $l$ -Lipschitz network has a
|
| 82 |
+
76 tractable, finite Lipschitz constant with respect to its parameters. We prove that this Lipschitz constant
|
| 83 |
+
77 allows for easy estimation of the sensitivity of the gradient computation queries. The prerequisite and
|
| 84 |
+
78 details of the method to compute the sensitivities are explained in Section 2.
|
| 85 |
+
|
| 86 |
+
79 Our contributions are the following:
|
| 87 |
+
|
| 88 |
+
1. We extend the field of applications of Lipschitz constrained neural networks. So far the literature focused on Lipschitzness with respect to the inputs: we extend the framework to compute the Lipschitzness with respect to the parameters. This is exposed in Section 2.
|
| 89 |
+
2. We propose a general framework to handle layer gradient steps as Gaussian mechanisms that depends on the loss and the model structure. Our framework covers widely used architectures, including VGG and ResNets.
|
| 90 |
+
3. We show that SGD training of deep neural networks can be achieved without gradient clipping using Lipschitz layers. This allows the use of larger networks and larger batch sizes, as illustrated by our experiments in Section 4.
|
| 91 |
+
4. We establish connections between Gradient Norm Preserving (GNP) networks and improved privacy/utility trade-offs (Section 3.1).
|
| 92 |
+
5. Finally, a Python package1 companions the project, with pre-computed Lipschitz constant and noise for each layer type, ready to be forked on any problem of interest (Section 3.2).
|
| 93 |
+
|
| 94 |
+
# 93 1.1 Differential Privacy and Lipschitz Networks
|
| 95 |
+
|
| 96 |
+
The definition of DP relies on the notion of neighboring datasets, i.e datasets that vary by at most one example. We highlight below the central tools related to the field, inspired from [9].
|
| 97 |
+
|
| 98 |
+
96 Definition 1 $( ( \epsilon , \delta )$ -Differential Privacy). A labeled dataset $\mathcal { D }$ is a finite collection of input/label
|
| 99 |
+
97 pairs $\mathcal { D } = \{ ( x _ { 1 } , y _ { 1 } ) , ( x _ { 2 } , y _ { 2 } ) , . . . . . ( x _ { N } , y _ { N } ) \}$ . Two datasets $\mathcal { D }$ and $\mathcal { D } ^ { \prime }$ are said to be neighboring
|
| 100 |
+
98 for the “replace-one” relation if they differ by at most one sample: $\mathcal { D } ^ { \prime } = \mathcal { D } \cup \{ ( x _ { i } ^ { \prime } , y _ { i } ^ { \prime } ) \} \setminus \{ \bar { ( } x _ { i } , y _ { i } ) \}$ .
|
| 101 |
+
99 Let ϵ and $\delta$ be two non-negative scalars. A mechanism $\mathcal { A }$ is $( \epsilon , \delta )$ -DP if for any two neighboring
|
| 102 |
+
100 datasets $\mathcal { D }$ and $\mathcal { D } ^ { \prime }$ , and for any $S \subseteq r a n g e ( { \mathcal { A } } )$ :
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathbb { P } [ A ( { \mathcal { D } } ) \in S ] \leq e ^ { \epsilon } \times \mathbb { P } [ A ( { \mathcal { D } } ^ { \prime } ) \in S ] + \delta .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
101 A cookbook to create a $( \epsilon , \delta )$ -DP mechanism from a query is to compute its sensitivity $\Delta$ (see
|
| 109 |
+
102 Definition 2), and to perturb its output by adding a Gaussian noise of predefined variance $\zeta ^ { 2 } = \Delta ^ { 2 } \sigma ^ { 2 }$ ,
|
| 110 |
+
103 where the $( \epsilon , \delta )$ -DP guarantees depends on $\sigma$ . This yields what is called a Gaussian mechanism [3].
|
| 111 |
+
|
| 112 |
+
Definition 2 (104 $l _ { 2 }$ -sensitivity). Let $\mathcal { M }$ be a query mapping from the space of the datasets to $\mathbb { R } ^ { p }$ . Let $\mathcal { N }$ be the set of all possible pairs of neighboring datasets 105 $\mathcal { D } , \mathcal { D } ^ { \prime }$ . The $l _ { 2 }$ sensitivity of $\mathcal { M }$ is defined by:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\Delta ( \mathcal { M } ) = \operatorname* { m a x } _ { \mathcal { D } , \mathcal { D ^ { \prime } } \in \mathcal { N } } \lVert \mathcal { M } ( D ) - \mathcal { M } ( D ^ { \prime } ) \rVert _ { 2 } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
106 Differentially Private SGD. The classical algorithm keeps track of $( \epsilon , \delta )$ -DP values with a moments
|
| 119 |
+
107 accountant [1] which allows to keep track of privacy guarantees at each epoch, by composing
|
| 120 |
+
108 different sub-mechanisms. For a dataset with $N$ records and a batch size $b$ , it relies on two parameters:
|
| 121 |
+
109 the sampling ratio $\begin{array} { r } { p = \frac { b } { N } } \end{array}$ and the “noise multiplier” $\sigma$ defined as the ratio between effective noise
|
| 122 |
+
110 strength $\zeta$ and sensitivity $\Delta$ . Bounds on gradient norm can be turned into bounds on sensitivity
|
| 123 |
+
111 of SGD queries. In “replace-one” policy for $( \epsilon , \delta )$ -DP accounting, if the gradients are bounded by
|
| 124 |
+
112 $K > 0$ , the sensitivity of the gradients averaged on a minibatch of size $b$ is $\Delta = 2 K / b$ ..
|
| 125 |
+
113 Crucially, the algorithm requires a bound on $\| \nabla _ { \theta } \mathcal { L } ( \hat { y } , y ) \| _ { 2 } \le K$ . The whole difficulty lies in
|
| 126 |
+
114 bounding tightly this value in advance for neural networks. Currently, gradient clipping serves as a
|
| 127 |
+
115 patch to circumvent the issue [1]. Unfortunately, clipping individual gradients in the batch is costly
|
| 128 |
+
116 and will bias the direction of their average, which may induce underfitting [7].
|
| 129 |
+
117 Lipschitz constrained networks. Our proposed solution comes from the observation that the norm
|
| 130 |
+
118 of the gradient and the Lipschitz constant are two sides of the same coin. The function $f : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$
|
| 131 |
+
119 is said $l$ -Lipschitz for $l _ { 2 }$ norm if for every $x , y \in \mathbb { R } ^ { m }$ we have $\| f ( x ) - f ( y ) \| _ { 2 } \leq l \| x - y \| _ { 2 }$ . Per
|
| 132 |
+
120 Rademacher’s theorem [10], its gradient is bounded: $\| \nabla _ { x } f \| \leq l$ . Reciprocally, continuous functions
|
| 133 |
+
121 gradient bounded by $l$ are $l$ -Lipschitz.
|
| 134 |
+
122 In Lipschitz networks, the literature has predominantly concentrated on investigating the control
|
| 135 |
+
123 of Lipschitzness with respect to the inputs (i.e bounding $\nabla _ { x } f$ ), primarily motivated by concerns
|
| 136 |
+
124 of robustness [11]. However, in this work, we will demonstrate that it is also possible to control
|
| 137 |
+
125 Lipschitzness with respect to parameters (i.e bounding $\nabla _ { \boldsymbol { \theta } } f$ ), which is essential for ensuring privacy.
|
| 138 |
+
126 Our first contribution will point out the tight link that exists between those two quantities.
|
| 139 |
+
27 Definition 3 (Lipschitz feed-forward neural network). A feedforward neural network of depth $D$ ,
|
| 140 |
+
28 with input space $\mathcal { X } \subset \mathbb { R } ^ { n }$ , output space $\mathcal { V } \subset \mathbb { R } ^ { K }$ (e.g logits), and parameter space $\Theta \subset \mathbb { R } ^ { p }$ , is $a$
|
| 141 |
+
129 parameterized function $f : \Theta \times \mathcal { X } \mathcal { Y }$ defined by the sequential composition of layers $f _ { d }$ :
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
f ( \theta , x ) : = ( f _ { D } ( \theta _ { d } ) \circ \dotsb \circ f _ { 2 } ( \theta _ { 2 } ) \circ f _ { 1 } ( \theta _ { 1 } ) ) ( x ) .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
130 The parameters of the layers are denoted by $\theta = ( \theta _ { d } ) _ { 1 \leq d \leq D } \in \Theta$ . For affine layers, it corresponds
|
| 148 |
+
131 to bias and weight matrix $\theta _ { d } = ( W _ { d } , b _ { d } )$ . For activation functions, there is no parameters: $\theta _ { d } = \mathcal { D }$ .
|
| 149 |
+
132 Lipschitz networks are feed-forward networks, with the additionnal constraint that each
|
| 150 |
+
133 layer $x _ { d } \mapsto f _ { d } ( \theta _ { d } , x _ { d } ) : = y _ { d }$ is $l _ { d }$ -Lipschitz for all $\theta _ { d }$ . Consequently, the function $x \mapsto f ( \theta , x )$
|
| 151 |
+
134 is $l$ -Lipschitz with $l = l _ { 1 } \times \ldots \times l _ { d }$ for all $\theta \in \Theta$ .
|
| 152 |
+
135 In practice, this is enforced by using activations with Lipschitz constant $l _ { d }$ , and by applying a con
|
| 153 |
+
136 straint $\Pi : \mathbb { R } ^ { p } \Theta$ on the weights of affine layers. This corresponds to spectrally normalized matri
|
| 154 |
+
137 ces [12, 13], since for affine layers we have $l _ { d } \dot { = } \| \boldsymbol { W } _ { d } \| _ { 2 } : = \operatorname* { m a x } _ { \| \boldsymbol { x } \| \leq 1 } \| \boldsymbol { W } _ { d } \boldsymbol { x } \| _ { 2 } ^ { - }$ hence $\mathsf { \bar { \Theta } } = \{ \| W _ { d } \| \le l _ { q } \}$ .
|
| 155 |
+
138 The seminal work of [8] proved that universal approximation in the set of $l$ -Lipschitz functions was
|
| 156 |
+
139 achievable by this family of architectures. Concurrent approaches are based on regularization (like
|
| 157 |
+
140 in [14, 15, 16]) but they fail to produce formal guarantees. While they have primarily been studied in
|
| 158 |
+
141 the context of adversarial robustness [11, 17], recent works have revealed additional properties of
|
| 159 |
+
142 these networks, such as improved generalization [13, 18]. However, the properties of their parameter
|
| 160 |
+
143 gradient $\nabla _ { \boldsymbol { \theta } } f ( \boldsymbol { \theta } , \boldsymbol { x } )$ remain largely unexplored.
|
| 161 |
+
|
| 162 |
+
# 144 2 Clipless DP-SGD with $l$ -Lipschitz networks
|
| 163 |
+
|
| 164 |
+
145 Our framework consists of 1. a method that computes the maximum gradient norm of a network with
|
| 165 |
+
146 respect to its parameters to obtain a per-layer sensitivity $\Delta _ { d }$ , 2. a moments accountant that relies on
|
| 166 |
+
147 the per-layer sensitivities to compute $( \epsilon , \delta )$ -DP guarantees. The method 1. is based on the recursive
|
| 167 |
+
148 formulation of the chain rule involved in backpropagation, while 2. keeps track of $( \epsilon , \delta )$ -DP values
|
| 168 |
+
149 with RDP accounting. It requires some natural assumptions that we highlight below.
|
| 169 |
+
|
| 170 |
+
Requirement 1 (Lipschitz loss.). The loss function $\hat { y } \mapsto \mathcal { L } ( \hat { y } , y )$ must be $L$ -Lipschitz with respect to the logits yˆ for all ground truths $y \in \mathcal { V }$ . This is notably the case of Categorical Softmax-Crossentropy.
|
| 171 |
+
|
| 172 |
+
The Lipschitz constants of common classification losses can be found in the appendix.
|
| 173 |
+
|
| 174 |
+
53 Requirement 2 (Bounded input). There exists $X _ { 0 } > 0$ such that for all $x \in \mathcal { X }$ we have $\| x \| \leq X _ { 0 }$
|
| 175 |
+
|
| 176 |
+
While there exist numerous approaches for the parametrization of Lipschitz networks (e.g differentiable re-parametrization [19, 8], optimization over matrix manifolds [20] or projections [21]), our framework only provides sensitivity bounds for projection-based algorithms (see appendix).
|
| 177 |
+
|
| 178 |
+
157 Requirement 3 (Lipschitz projection). The Lipschitz constraints must be enforced with a projection
|
| 179 |
+
158 operator $\Pi : \mathbb { R } ^ { p } \Theta$ . This corresponds to Tensorflow $I 2 2 J$ constraints and Pytorch [23] hooks.
|
| 180 |
+
159 Projection is a post-processing of private gradients: it induces no privacy leakage $I 3 J$ .
|
| 181 |
+
160 To compute the per-layer sensitivities, our framework mimics the backpropagation algorithm, where
|
| 182 |
+
161 Vector-Jacobian products (VJP) are replaced by Scalar-Scalar products of element-wise bounds. For
|
| 183 |
+
162 an arbitrary layer $x _ { d } \mapsto f _ { d } ( \theta _ { d } , x _ { d } ) : = \bar { y _ { d } }$ the operation is sketched below:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\begin{array} { r l r } { \nabla _ { x _ { d } } \mathcal { L } : = ( \nabla _ { y _ { d } } \mathcal { L } ) \frac { \partial f _ { d } } { \partial x _ { d } } } & { } & { \implies \| \nabla _ { x _ { d } } \mathcal { L } \| _ { 2 } \leq \| \nabla _ { y _ { d } } \mathcal { L } \| _ { 2 } \times \bigg \| \frac { \partial f _ { d } } { \partial x _ { d } } \bigg \| _ { 2 } . } \end{array}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
| {z }Vector-Jacobian product: backpropagate gradients {zScalar-Scalar product: backpropagate bounds
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 2: Backpropagation for bounds, Algorithm 1. Compute the per-layer sensitivity $\Delta _ { d }$ .
|
| 193 |
+
|
| 194 |
+
163 The notation $\| \cdot \| _ { 2 }$ must be understood as the spectral norm for Jacobian matrices, and the Euclidean
|
| 195 |
+
164 norm for gradient vectors. The scalar-scalar product is inexpensive. For Lipschitz layers the spectral
|
| 196 |
+
165 norm of the Jacobian $\| \frac { \partial f } { \partial x } \|$ is kept constant during training with projection operator $\Pi$ . The bound of
|
| 197 |
+
166 the gradient with respect to the parameters then takes a simple form:
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\| \nabla _ { \theta _ { d } } \mathcal { L } \| _ { 2 } = \| \nabla _ { y _ { d } } \mathcal { L } \| _ { 2 } \times \left\| \frac { \partial f _ { d } } { \partial \theta _ { d } } \right\| _ { 2 } .
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
Once again the operation is inexpensive. The upper bound167 $\left\| \frac { \partial f } { \partial \theta } \right\| _ { 2 }$ typically depends on the supremum 168 of $\| x _ { d } \| _ { 2 }$ , that can also be analytically bounded, as exposed in the following section.
|
| 204 |
+
|
| 205 |
+
# 2.1 Backpropagation for bounds
|
| 206 |
+
|
| 207 |
+
170 The pseudo-code of Clipless DP-SGD is sketched in Algorithm 2. The algorithm avoids clipping by
|
| 208 |
+
171 computing a per-layer bound on the element-wise gradient norm. The computation of this per-layer
|
| 209 |
+
172 bound is described by Algorithm 1 (graphically explained in Figure 2). Crucially, it requires to
|
| 210 |
+
173 compute the spectral norm of the Jacobian of each layer with respect to input and parameters.
|
| 211 |
+
174 Input bound propagation (line 2). We compute $X _ { d } = \operatorname* { m a x } _ { \| x \| \leq X _ { d - 1 } } \| f _ { d } ( x ) \| _ { 2 }$ . For activation
|
| 212 |
+
175 functions it depends on their range. For linear layers, it depends on the spectral norm of the operator
|
| 213 |
+
176 itself. This quantity can be computed with SVD or Power Iteration [24, 19], and constrained during
|
| 214 |
+
177 training using projection operator Π. In particular, it covers the case of convolutions, for which tight
|
| 215 |
+
178 bounds are known [25]. For affine layers, it additionally depends on the amplitude of the bias $\| b _ { d } \|$ .
|
| 216 |
+
|
| 217 |
+
Remark 1 (Tighter bounds in literature.). Although libraries such as Decomon $I 2 6 J$ or auto-LiRPA [27] provide tighter bounds $X _ { d }$ via linear relaxations [28, 29], our approach is capable of delivering practically tighter bounds than worst-case scenarios thanks to the projection operator Π, while also being significantly less computationally expensive. Moreover, hybridizing our method with scalable certification methods can be a path for future extensions.
|
| 218 |
+
|
| 219 |
+
184 Computing maximum gradient norm (line 6). We bound the Jacobian ∂fd(θd,x) . In neural networks,
|
| 220 |
+
185 the parameterized layers $f ( \theta , x )$ (fully connected, convolutions) are bilinear operators. Hence we
|
| 221 |
+
186 typically obtain bounds of the form:
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
\bigg \vert \bigg \vert \frac { \partial f _ { d } ( \theta _ { d } , x ) } { \partial \theta _ { d } } \bigg \vert \bigg \vert _ { 2 } \leq K ( f _ { d } , \theta _ { d } ) \| x \| _ { 2 } \leq K ( f _ { d } , \theta _ { d } ) X _ { d - 1 } ,
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
7 where $K ( f _ { d } , \Theta _ { d } )$ is a constant that depends on the nature of the operator. $X _ { d - 1 }$ is obtained in line 2
|
| 228 |
+
88 with input bound propagation. Values of $K ( f _ { d } , \theta _ { d } )$ for popular layers are pre-computed in the library.
|
| 229 |
+
|
| 230 |
+
Backpropagate cotangeant vector bounds (line 7). We bound the Jacobian $\frac { \partial f _ { d } ( \theta _ { d } , x ) } { \partial x }$ . For activation functions this value can be hard-coded, while for affine layers it is the spectral norm of the linear operator. Like before, this value is constrained with projection operator $\mathrm { I I }$ .
|
| 231 |
+
|
| 232 |
+
# 2.2 Privacy accounting for Clipless DP-SGD
|
| 233 |
+
|
| 234 |
+
93 Two strategies are available to keep track of $( \epsilon , \delta )$ values as the training progresses, based on
|
| 235 |
+
94 accounting either a per-layer “local” sensitivity, either by aggregating them into a “global” sensitivity.
|
| 236 |
+
|
| 237 |
+
# Algorithm 1 Backpropagation for $\mathbf { B o u n d s } ( f , X )$
|
| 238 |
+
|
| 239 |
+
Input: Feed-forward architecture $f ( \theta , \cdot ) = f _ { D } ( \theta _ { D } , \cdot ) \circ \dots \circ f _ { 1 } ( \theta _ { 1 } , \cdot )$ Input: Weights $\theta = ( \theta _ { 1 } , \theta _ { 2 } , \dots \theta _ { D } )$ , input bound $X _ { 0 }$
|
| 240 |
+
|
| 241 |
+
▷ Input bounds propagation
|
| 242 |
+
|
| 243 |
+
1: for all layers $1 \leq d \leq D$ do
|
| 244 |
+
2: $X _ { d } \gets \operatorname* { m a x } _ { \| \boldsymbol { x } \| \leq X _ { d - 1 } } \| f _ { d } ( \theta _ { d } , \boldsymbol { x } ) \| _ { 2 } .$ .
|
| 245 |
+
3: end for
|
| 246 |
+
4: $G \gets L / b$ .
|
| 247 |
+
5: for all layers $D \geq d \geq 1$ do
|
| 248 |
+
6: $\Delta _ { d } G _ { \frac { \operatorname* { m a x } } { \| x \| \leq X _ { d - 1 } } } \| \frac { \partial f _ { d } ( \theta _ { d } , x ) } { \partial \theta _ { d } } \| _ { 2 } .$ .
|
| 249 |
+
7: $G G \operatorname* { m a x } _ { \| x \| \leq X _ { d - 1 } } \| \frac { \partial f _ { d } ( \theta _ { d } , x ) } { \partial x } \| _ { 2 } = G l _ { d }$
|
| 250 |
+
8: end for
|
| 251 |
+
9: return sensitivities $\Delta _ { 1 } , \Delta _ { 2 } \dots , \Delta _ { D }$
|
| 252 |
+
|
| 253 |
+
# Algorithm 2 Clipless DP-SGD with local sensitivity accounting
|
| 254 |
+
|
| 255 |
+
Input: Feed-forward architecture $f ( \theta , \cdot ) = f _ { D } ( \theta _ { D } , \cdot ) \circ \dots \circ f _ { 1 } ( \theta _ { 1 } , \cdot )$
|
| 256 |
+
|
| 257 |
+
Input: Initial weights $\theta = ( \theta _ { 1 } , \theta _ { 1 } , \dots \theta _ { D } )$ , learning rate $\eta$ , noise multiplier $\sigma$
|
| 258 |
+
|
| 259 |
+
1: repeat
|
| 260 |
+
2: $\Delta _ { 1 } , \Delta _ { 2 } \dots \Delta _ { D } \mathbf { I }$ ackpropagation for Bounds $( f , X )$ .
|
| 261 |
+
3: Update Moment Accountant state with local sensitivities $\Delta _ { 1 } , \Delta _ { 2 } , . . . \Delta _ { d }$ .
|
| 262 |
+
4: Sample a batch $B = \{ ( x _ { 1 } , y _ { 1 } ) , ( x _ { 2 } , y _ { 2 } ) , \ldots , ( x _ { b } , y _ { b } ) \}$ .
|
| 263 |
+
5: Compute per-layer averaged gradient: $\begin{array} { r } { g _ { d } : = \frac { 1 } { b } \sum _ { i = 1 } ^ { b } \nabla _ { \theta _ { d } } \mathcal { L } ( f ( \theta , x _ { i } ) , y _ { i } ) ) } \end{array}$
|
| 264 |
+
6: Sample local noise: $\zeta _ { d } \sim \mathcal { N } ( \bar { 0 } , \sigma \Delta _ { d } )$ .
|
| 265 |
+
7: Perform noisified gradient step: $\theta _ { d } \gets \theta _ { d } - \eta ( g _ { d } + \zeta _ { d } )$ .
|
| 266 |
+
8: Enforce Lipschitz constraint with projection: $\theta _ { d } \gets \Pi ( \theta _ { d } )$ .
|
| 267 |
+
|
| 268 |
+
9: until privacy budget $( \epsilon , \delta )$ -DP budget has been reached.
|
| 269 |
+
|
| 270 |
+
195 The “global” strategy. Illustrated in the appendix,this strategy simply aggregates the individual
|
| 271 |
+
196 sensitivities $\Delta _ { d }$ of each layer to obtain the global sensitivity of the whole gradient vector $\Delta =$
|
| 272 |
+
197 $\sqrt { \sum d ^ { 2 } } d ^ { 2 }$ . The origin of the clipping-based version of this strategy can be traced back to [30]. With
|
| 273 |
+
198 noise variance $\sigma ^ { 2 } { \Delta } ^ { 2 }$ we recover the accountant that comes with DP-SGD. It tends to overestimate
|
| 274 |
+
199 the true sensitivity (in particular for deep networks), but its implementation is straightforward with
|
| 275 |
+
200 existing tools.
|
| 276 |
+
|
| 277 |
+
The “local” strategy. Recall that we are able to characterize the sensitivity $\Delta _ { d }$ of every layer of the network. Hence, we can apply a different noise to each of the gradients. We dissect the whole training procedure in Figure 3. At same noise multiplier $\sigma$ , it tends to produce a higher value of $\epsilon$ per epoch than “global” strategy, but has the advantage over the latter to add smaller effective noise $\zeta$ to each weight.
|
| 278 |
+
|
| 279 |
+
We rely on the autodp26 library [32, 33, 34] as it uses the Renyi Differential Privacy (RDP) adaptive composition theorem [35, 36], that ensures tighter bounds than naive DP composition.
|
| 280 |
+
|
| 281 |
+
# 208 3 From theory to practice
|
| 282 |
+
|
| 283 |
+
Beyond the application of Algorithms 1 and 2, our framework provides numerous opportunities to enhance our understanding of prevalent techniques identified in the literature. An in-depth exploration of these is beyond the scope of this work, so we focus on giving insights on promising tracks based on our theoretical analysis. In particular, we discuss how the tightness of the bound provided by Algorithm 1 can be influenced by working on the architecture, the input pre-processing and the loss post-processing.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 3: Accountant for locally enforced differential privacy. (i) The gradient query for each layer is turned into a Gaussian mechanism [9], (ii) their composition at the scale of the whole network is a non isotropic Gaussian mechanism, (iii) that benefits from amplification via sub-sampling [31], (iv) the train steps are composed over the course of training.
|
| 287 |
+
|
| 288 |
+
# 215 3.1 Gradient Norm Preserving networks
|
| 289 |
+
|
| 290 |
+
16 We can manually derive the bounds obtained from Algorithm 2 across diverse configurations. Below,
|
| 291 |
+
17 we conduct a sensitivity analysis on $l$ -Lipschitz networks.
|
| 292 |
+
|
| 293 |
+
Theorem (informal) 1. Gradient Norm of Lipschitz Networks. Assume that every layer $f _ { d }$ is $K$ -Lipschitz, i.e $l _ { 1 } = \cdot \cdot \cdot = l _ { D } = K$ . Assume that every bias is bounded by $B$ . We further assume that each activation is centered in zero (e.g ReLU, tanh, GroupSort). We recall that $\theta = [ \theta _ { 1 } , \theta _ { 2 } , \dots \theta _ { D } ]$ . Then the global upper bound of Algorithm 2 can be expanded analytically.
|
| 294 |
+
|
| 295 |
+
1. If $K < 1$ we have: $\begin{array} { r } { \| \nabla _ { \theta } \mathcal { L } ( f ( \theta , x ) , y ) \| _ { 2 } = \mathcal { O } \left( L \left( K ^ { D } ( X _ { 0 } + B ) + 1 \right) \right) . } \end{array}$
|
| 296 |
+
|
| 297 |
+
Due to the $K ^ { D } \ll 1$ term this corresponds to a vanishing gradient phenomenon [37]. The output of the network is essentially independent of its input, and the training is nearly impossible.
|
| 298 |
+
|
| 299 |
+
2. If $K > 1$ we have: $\begin{array} { r } { \| \nabla _ { \theta } \mathcal { L } ( f ( \theta , x ) , y ) \| _ { 2 } = \mathcal { O } \left( L K ^ { D } \left( X _ { 0 } + B \right) \right) . } \end{array}$
|
| 300 |
+
|
| 301 |
+
Due to the $K ^ { D } \gg 1$ term this corresponds to an exploding gradient phenomenon [38]. The upper bound becomes vacuous for deep networks: the added noise $\zeta$ is at risk of being too high.
|
| 302 |
+
|
| 303 |
+
3. If $K = 1$ we have: $\| \nabla _ { \theta } \mathcal { L } ( f ( \theta , x ) , y ) \| _ { 2 } = \mathcal { O } \left( L \left( X _ { 0 } + \sqrt { D } + \sqrt { B X _ { 0 } } D + B D ^ { 3 / 2 } \right) \right) ,$ which for linear layers without biases further simplify to $\mathcal { O } ( L ( X _ { 0 } + \sqrt { D } ) )$ .
|
| 304 |
+
|
| 305 |
+
The formal statement can be found in appendix. From Theorem 1 we see that most favorable bounds are achieved by 1-Lipschitz neural networks with 1-Lipschitz layers. In classification tasks, they are not less expressive than conventional networks [18]. Hence, this choice of architecture is not at the expense of utility. Moreover an accuracy/robustness trade-off exists, determined by the choice of loss function [18]. However, setting $K = 1$ merely ensures that $\| \nabla _ { x } f \| \leq 1$ , and in the worst-case scenario we have $\| \nabla _ { x } f \| < 1$ almost everywhere. This could result in a situation where the bound of case 3 in Theorem 1 is not tight, leading to an underfitting regime as in case $K < 1$ . With Gradient Norm Preserving (GNP) networks [17], we expect to mitigate this issue.
|
| 306 |
+
|
| 307 |
+
238 Controlling $K$ with Gradient Norm Preserving (GNP) networks. GNP networks are 1-Lipschitz
|
| 308 |
+
239 neural networks with the additional constraint that the Jacobian of layers consists of orthogonal
|
| 309 |
+
240 matrices. They fulfill the Eikonal equation $\left. \frac { \partial f _ { d } ( \theta _ { d } , x _ { d } ) } { \partial x _ { d } } \right. _ { 2 } = 1$ for any intermediate activation
|
| 310 |
+
241 $f _ { d } ( \theta _ { d } , x _ { d } )$ . Without biases these networks are also norm preserving: $\| f ( \theta , x ) \| = \| x \|$ .
|
| 311 |
+
|
| 312 |
+
242 As a consequence, the gradient of the loss with respect to the parameters is easily bounded by
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\| \nabla _ { \theta _ { d } } \mathcal { L } \| = \| \nabla _ { y _ { D } } \mathcal { L } \| \times \left\| \frac { \partial f _ { d } ( \theta _ { d } , x _ { d } ) } { \partial \theta _ { d } } \right\| ,
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
243 which for weight matrices $W _ { d }$ further simplifies to $\| \nabla _ { W _ { d } } \mathcal { L } \| \le \| \nabla _ { y _ { D } } \mathcal { L } \| \times \| f _ { d - 1 } ( \theta _ { d - 1 } , x _ { d - 1 } ) \|$ . We
|
| 319 |
+
244 see that this upper bound crucially depends on two terms than can be analyzed separately. On one
|
| 320 |
+
245 hand, $\| f _ { d - 1 } ( \theta _ { d - 1 } , x _ { d - 1 } ) \|$ depends on the scale of the input. On the other, $| | \nabla _ { y _ { D } } \mathcal { L } | |$ depends on the
|
| 321 |
+
246 loss, the predictions and the training stage. We show below how to intervene on these two quantities.
|
| 322 |
+
|
| 323 |
+
Remark 2 (Implementation of GNP Networks). In practice, GNP are parametrized with GroupSort activation [8, 39], Householder activation [40], and orthogonal weight matrices [17, 41]. Strict orthogonality is challenging to enforce, especially for convolutions for which it is still an active research area (see [42, 43, 44, 45, 46] and references therein). Our line of work traces an additional motivation for the development of GNP and the bounds will strengthen as the field progresses.
|
| 324 |
+
|
| 325 |
+
Controlling $X _ { 0 }$ with input pre-processing. The weight gradient norm $\| \nabla _ { \theta _ { d } } \mathcal { L } \|$ indirectly depends on the norm of the inputs. This observation implies that the pre-processing of input data significantly influences the bounding of sensitivity. Multiple strategies are available to keep the input’s norm under control: projection onto the ball (“norm clipping”), or projection onto the sphere (“normalization”). In the domain of natural images for instance, this result sheds light on the importance of color space such as RGB, HSV, YIQ, YUV or Grayscale. These strategies are natively handled by our library.
|
| 326 |
+
|
| 327 |
+
Controlling $L$ with the hybrid approach, loss gradient clipping. As training progresses, the magnitude of $| | \nabla _ { f } \mathcal { L } | |$ tends to diminish when approaching a local minima, quickly falling below the upper bound and diminishing the gradient norm to noise ratio. To circumvent the issue, the gradient clipping strategy is still available in our framework. Crucially, instead of clipping the parameter gradient $\nabla _ { \boldsymbol { \theta } } \mathcal { L }$ , any intermediate gradient $\nabla _ { f _ { d } } \mathcal { L }$ can be clipped during backpropagation. This can be achieved with a special “clipping layer” that behaves like the identity function at the forward pass, and clips the gradient during the backward pass. The resulting cotangeant vector is not a true gradient anymore, but rather a descent direction [47]. In vanilla DP-SGD the clipping is applied on the batched gradient $\nabla _ { \boldsymbol { W } _ { d } } \mathcal { L }$ of size $b \times h ^ { 2 }$ for matrix weight $W _ { d } \in \mathbb { R } ^ { h \times h }$ and clipping this vector can cause memory issues or slowdowns [6]. In our case, $\nabla _ { y _ { D } } \mathcal { L }$ is of size $b \times h$ which reduces overhead.
|
| 328 |
+
|
| 329 |
+
# 3.2 Lip-dp library
|
| 330 |
+
|
| 331 |
+
To foster and spread accessibility, we provide an opensource tensorflow library for Clipless DP-SGD training, named lip-dp. It provides an exposed Keras API for seamless usability. It is implemented as a wrapper over the Lipschitz layers of deel-lip3 library [48]. Its usage is illustrated in Figure 1.
|
| 332 |
+
|
| 333 |
+
# 4 Experimental results
|
| 334 |
+
|
| 335 |
+
We validate our implementation with a speed benchmark against competing approaches, and we present the privacy/utility Pareto front that can be obtained with GNP networks.
|
| 336 |
+
|
| 337 |
+
Speed and memory consumption. We benchmarked the median runtime per epoch of vanilla DP-SGD against the one of Clipless DP-SGD, on a CNN architecture and its Lipschitz equivalent respectively. The experiment was run on a GPU with 48GB video memory. We compare against the implementation of tf_privacy, opacus and optax. In order to allow a fair comparison, when evaluating Opacus, we reported the runtime with respect to the logical batch size, while capping the physical batch size to avoid Out Of Memory error (OOM). Although our library does not implement logical batching yet, it is fully compatible with this feature.
|
| 338 |
+
|
| 339 |
+
An advantage of projection Π over per-sample gradient clipping is that the projection cost is
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 4: Our approach outperforms concurrent frameworks in terms of runtime and memory: we trained CNNs (ranging from 130K to 2M parameters) on CIFAR-10, and report the median batch processing time (including noise, and constraints application $\Pi$ or gradient clipping).
|
| 343 |
+
|
| 344 |
+
independent of the batch size. Fig 4 validates that our method scales much better than vanilla DP-SGD, and is compatible with large batch sizes. It offers several advantages: firstly, a larger batch size contributes to a decrease of the sensitivity $\Delta \propto 1 / b$ , which diminishes the ratio between noise and gradient norm. Secondly, as the batch size √ $b$ increases, the variance decreases at the parametric rate $\mathcal { O } ( \sqrt { b } )$ (as demonstrated in appendix), aligning with expectations. This observation does not apply to DP-SGD: gradient clipping biases the direction of the average gradient, as noticed by [7].
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 5: Our framework paints a clearer picture of the privacy/utility trade-off. We trained models in an "out of the box setting" (no pre-training, no data augmentation and no handcrafted features) on multiple tasks. While our results align with the baselines presented in other frameworks, we recognize the importance of domain-specific engineering. In this regard, we find the innovations introduced in [49, 50, 51] and references therein highly relevant. These advancements demonstrate compatibility with our framework and hold potential for future integration.
|
| 348 |
+
|
| 349 |
+
297
|
| 350 |
+
298
|
| 351 |
+
299
|
| 352 |
+
300
|
| 353 |
+
301
|
| 354 |
+
302
|
| 355 |
+
303
|
| 356 |
+
304
|
| 357 |
+
305
|
| 358 |
+
306
|
| 359 |
+
307
|
| 360 |
+
308
|
| 361 |
+
|
| 362 |
+
Pareto front of privacy/utility trade-off. We performed a search over a broad range of hyperparameters values to cover the Pareto front between utility and privacy. Results are reported in Figure 5. We emphasize that our experiments did not use the elements behind the success of most recent papers (pre-training, data preparation, or handcrafted feature are examples). Hence our results are more representative of the typical performance that can be obtained in an “out of the box” setting. Future endeavors or domain-specific engineering can enhance the performance even further, but such improvements currently lie beyond the scope of our work. We also benchmarked architectures inspired from VGG [52], Resnet [53] and MLP_Mixers [54] see appendix for more details. Following standard practices of the community [2], we used sampling without replacement at each epoch (by shuffling examples), but we reported $\epsilon$ assuming Poisson sampling to benefit from privacy amplification [31]. We also ignore the privacy loss that may be induced by hyper-parameter search, which is a limitation per recent studies [5], but is common practice.
|
| 363 |
+
|
| 364 |
+
# 309 5 Limitations and future work
|
| 365 |
+
|
| 366 |
+
Although this framework offers a novel approach to address differentially private training, it introduces new challenges. We primary rely on GNP networks, where high performing architectures are quite different from the usual CNN architectures. As emphasized in Remark 2, we anticipate that progress in these areas would greatly enhance the effectiveness of our approach. Additionally, to meet requirement 3, we rely on projections, necessitating additional efforts to incorporate recent advancements associated with differentiable reparametrizations [42, 43]. It is worth noting that our methodology is applicable to most layers. Another limitation of our approach is the accurate computation of sensitivity $\Delta$ , which is challenging due to the non-associativity of floating-point arithmetic and its impact on numerical stability [55]. This challenge is exacerbated on GPUs, where operations are inherently non-deterministic [56]. Finally, as mentioned in Remark 1, our propagation bound method can be refined.
|
| 367 |
+
|
| 368 |
+
# 6 Concluding remarks and broader impact
|
| 369 |
+
|
| 370 |
+
Besides its main focus on differential privacy, our work provides (1) a motivation to further develop Gradient Norm Preserving architectures. Furthermore, the development of networks with known Lipschitz constant with respect to parameters is a question of independent interest, (2) a useful tool for the study of the optimization dynamics in neural networks. Finally, Lipschitz networks are known to enjoy certificates against adversarial attacks [17, 57], and from generalization guarantees [13], without cost in accuracy [18]. We advocate for the spreading of their use in the context of robust and certifiable learning.
|
| 371 |
+
|
| 372 |
+
329 References
|
| 373 |
+
330 [1] Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar,
|
| 374 |
+
331 and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC
|
| 375 |
+
332 conference on computer and communications security, pages 308–318, 2016.
|
| 376 |
+
333 [2] Natalia Ponomareva, Hussein Hazimeh, Alex Kurakin, Zheng Xu, Carson Denison, H Brendan
|
| 377 |
+
334 McMahan, Sergei Vassilvitskii, Steve Chien, and Abhradeep Thakurta. How to dp-fy ml: A
|
| 378 |
+
335 practical guide to machine learning with differential privacy. arXiv preprint arXiv:2303.00654,
|
| 379 |
+
336 2023.
|
| 380 |
+
337 [3] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to
|
| 381 |
+
338 sensitivity in private data analysis. In Theory of Cryptography: Third Theory of Cryptography
|
| 382 |
+
339 Conference, TCC 2006, New York, NY, USA, March 4-7, 2006. Proceedings 3, pages 265–284.
|
| 383 |
+
340 Springer, 2006.
|
| 384 |
+
341 [4] Mário S Alvim, Miguel E Andrés, Konstantinos Chatzikokolakis, Pierpaolo Degano, and
|
| 385 |
+
342 Catuscia Palamidessi. Differential privacy: on the trade-off between utility and information
|
| 386 |
+
343 leakage. In Formal Aspects of Security and Trust: 8th International Workshop, FAST 2011,
|
| 387 |
+
344 Leuven, Belgium, September 12-14, 2011. Revised Selected Papers 8, pages 39–54. Springer,
|
| 388 |
+
345 2012.
|
| 389 |
+
346 [5] Nicolas Papernot and Thomas Steinke. Hyperparameter tuning with renyi differential privacy.
|
| 390 |
+
347 In International Conference on Learning Representations, 2022.
|
| 391 |
+
348 [6] Jaewoo Lee and Daniel Kifer. Scaling up differentially private deep learning with fast per
|
| 392 |
+
349 example gradient clipping. Proceedings on Privacy Enhancing Technologies, 2021(1), 2021.
|
| 393 |
+
350 [7] Xiangyi Chen, Steven Z Wu, and Mingyi Hong. Understanding gradient clipping in private sgd:
|
| 394 |
+
351 A geometric perspective. Advances in Neural Information Processing Systems, 33:13773–13782,
|
| 395 |
+
352 2020.
|
| 396 |
+
353 [8] Cem Anil, James Lucas, and Roger Grosse. Sorting out lipschitz function approximation. In
|
| 397 |
+
354 International Conference on Machine Learning, pages 291–301. PMLR, 2019.
|
| 398 |
+
355 [9] Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Founda
|
| 399 |
+
356 tions and Trends® in Theoretical Computer Science, 9(3–4):211–407, 2014.
|
| 400 |
+
357 [10] Leon Simon et al. Lectures on geometric measure theory. The Australian National University,
|
| 401 |
+
358 Mathematical Sciences Institute, Centre . . . , 1983.
|
| 402 |
+
359 [11] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Good
|
| 403 |
+
360 fellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference
|
| 404 |
+
361 on Learning Representations, 2014.
|
| 405 |
+
362 [12] Yuichi Yoshida and Takeru Miyato. Spectral norm regularization for improving the generaliz
|
| 406 |
+
363 ability of deep learning. arXiv preprint arXiv:1705.10941, 2017.
|
| 407 |
+
364 [13] Peter L Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for
|
| 408 |
+
365 neural networks. In Proceedings of the 31st International Conference on Neural Information
|
| 409 |
+
366 Processing Systems, pages 6241–6250, 2017.
|
| 410 |
+
367 [14] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville.
|
| 411 |
+
368 Improved training of wasserstein gans. In Advances in Neural Information Processing Systems,
|
| 412 |
+
369 volume 30, pages 5767–5777. Curran Associates, Inc., 2017.
|
| 413 |
+
370 [15] Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier.
|
| 414 |
+
371 Parseval networks: Improving robustness to adversarial examples. In International Conference
|
| 415 |
+
372 on Machine Learning, pages 854–863. PMLR, 2017.
|
| 416 |
+
373 [16] Henry Gouk, Eibe Frank, Bernhard Pfahringer, and Michael J Cree. Regularisation of neural
|
| 417 |
+
374 networks by enforcing lipschitz continuity. Machine Learning, 110:393–416, 2021.
|
| 418 |
+
|
| 419 |
+
[17] Qiyang Li, Saminul Haque, Cem Anil, James Lucas, Roger B Grosse, and Jörn-Henrik Jacobsen. Preventing gradient attenuation in lipschitz constrained convolutional networks. In Advances in Neural Information Processing Systems (NeurIPS), volume 32, Cambridge, MA, 2019. MIT Press.
|
| 420 |
+
[18] Louis Béthune, Thibaut Boissin, Mathieu Serrurier, Franck Mamalet, Corentin Friedrich, and Alberto Gonzalez Sanz. Pay attention to your loss : understanding misconceptions about lipschitz neural networks. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022.
|
| 421 |
+
[19] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957, 2018.
|
| 422 |
+
[20] P-A Absil, Robert Mahony, and Rodolphe Sepulchre. Optimization algorithms on matrix manifolds. Princeton University Press, 2008.
|
| 423 |
+
[21] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International conference on machine learning, pages 214–223. PMLR, 2017.
|
| 424 |
+
[22] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: Large-scale machine learning on heterogeneous distributed systems, 2015.
|
| 425 |
+
[23] 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.
|
| 426 |
+
[24] Lloyd N Trefethen and David Bau. Numerical linear algebra, volume 181. Siam, 2022.
|
| 427 |
+
[25] S Singla and S Feizi. Fantastic four: Differentiable bounds on singular values of convolution layers. In International Conference on Learning Representations (ICLR), 2021.
|
| 428 |
+
[26] Airbus. Decomon. https://github.com/airbus/decomon, 2023.
|
| 429 |
+
[27] Kaidi Xu, Zhouxing Shi, Huan Zhang, Yihan Wang, Kai-Wei Chang, Minlie Huang, Bhavya Kailkhura, Xue Lin, and Cho-Jui Hsieh. Automatic perturbation analysis for scalable certified robustness and beyond. Advances in Neural Information Processing Systems, 33:1129–1141, 2020.
|
| 430 |
+
[28] Gagandeep Singh, Timon Gehr, Markus Püschel, and Martin Vechev. An abstract domain for certifying neural networks. Proceedings of the ACM on Programming Languages, 3(POPL):1– 30, 2019.
|
| 431 |
+
[29] Huan Zhang, Tsui-Wei Weng, Pin-Yu Chen, Cho-Jui Hsieh, and Luca Daniel. Efficient neural network robustness certification with general activation functions. Advances in neural information processing systems, 31, 2018.
|
| 432 |
+
[30] H Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations, 2018.
|
| 433 |
+
[31] Borja Balle, Gilles Barthe, and Marco Gaboardi. Privacy amplification by subsampling: Tight analyses via couplings and divergences. Advances in Neural Information Processing Systems, 31, 2018.
|
| 434 |
+
[32] Yu-Xiang Wang, Borja Balle, and Shiva Prasad Kasiviswanathan. Subsampled rényi differential privacy and analytical moments accountant. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1226–1235. PMLR, 2019.
|
| 435 |
+
[33] Yuqing Zhu and Yu-Xiang Wang. Possion subsampled rényi differential privacy. In International Conference on Machine Learning, pages 7634–7642. PMLR, 2019.
|
| 436 |
+
[34] Yuqing Zhu and Yu-Xiang Wang. Improving sparse vector technique with renyi differential privacy. Advances in Neural Information Processing Systems, 33:20249–20258, 2020.
|
| 437 |
+
[35] Ilya Mironov. Rényi differential privacy. In 2017 IEEE 30th computer security foundations symposium (CSF), pages 263–275. IEEE, 2017.
|
| 438 |
+
[36] Ilya Mironov, Kunal Talwar, and Li Zhang. R\’enyi differential privacy of the sampled gaussian mechanism. arXiv preprint arXiv:1908.10530, 2019.
|
| 439 |
+
[37] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International conference on machine learning, pages 1310–1318. Pmlr, 2013.
|
| 440 |
+
[38] Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks, 5(2):157–166, 1994.
|
| 441 |
+
[39] Ugo Tanielian and Gerard Biau. Approximating lipschitz continuous functions with groupsort neural networks. In International Conference on Artificial Intelligence and Statistics, pages 442–450. PMLR, 2021.
|
| 442 |
+
[40] Zakaria Mhammedi, Andrew Hellicar, Ashfaqur Rahman, and James Bailey. Efficient orthogonal parametrisation of recurrent neural networks using householder reflections. In International Conference on Machine Learning, pages 2401–2409. PMLR, 2017.
|
| 443 |
+
[41] Shuai Li, Kui Jia, Yuxin Wen, Tongliang Liu, and Dacheng Tao. Orthogonal deep neural networks. IEEE transactions on pattern analysis and machine intelligence, 43(4):1352–1368, 2019.
|
| 444 |
+
[42] Asher Trockman and J Zico Kolter. Orthogonalizing convolutional layers with the cayley transform. In International Conference on Learning Representations, 2021.
|
| 445 |
+
[43] Sahil Singla and Soheil Feizi. Skew orthogonal convolutions. In International Conference on Machine Learning, pages 9756–9766. PMLR, 2021.
|
| 446 |
+
[44] El Mehdi Achour, François Malgouyres, and Franck Mamalet. Existence, stability and scalability of orthogonal convolutional neural networks. The Journal of Machine Learning Research, 23(1):15743–15798, 2022.
|
| 447 |
+
[45] Sahil Singla and Soheil Feizi. Improved techniques for deterministic l2 robustness. arXiv preprint arXiv:2211.08453, 2022.
|
| 448 |
+
[46] Xiaojun Xu, Linyi Li, and Bo Li. Lot: Layer-wise orthogonal training on improving l2 certified robustness. arXiv preprint arXiv:2210.11620, 2022.
|
| 449 |
+
[47] Stephen P Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 450 |
+
[48] Mathieu Serrurier, Franck Mamalet, Alberto González-Sanz, Thibaut Boissin, Jean-Michel Loubes, and Eustasio Del Barrio. Achieving robustness in classification using optimal transport with hinge regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 505–514, 2021.
|
| 451 |
+
[49] Nicolas Papernot, Abhradeep Thakurta, Shuang Song, Steve Chien, and Úlfar Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 9312–9321, 2021.
|
| 452 |
+
[50] Florian Tramèr and Dan Boneh. Differentially private learning needs better features (or much more data), 2021.
|
| 453 |
+
[51] Soham De, Leonard Berrada, Jamie Hayes, Samuel L Smith, and Borja Balle. Unlocking high-accuracy differentially private image classification through scale. arXiv preprint arXiv:2204.13650, 2022.
|
| 454 |
+
[52] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 455 |
+
[53] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 456 |
+
[54] Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al. Mlpmixer: An all-mlp architecture for vision. Advances in neural information processing systems, 34:24261–24272, 2021.
|
| 457 |
+
[55] David Goldberg. What every computer scientist should know about floating-point arithmetic. ACM computing surveys (CSUR), 23(1):5–48, 1991.
|
| 458 |
+
[56] Hadi Jooybar, Wilson WL Fung, Mike O’Connor, Joseph Devietti, and Tor M Aamodt. Gpudet: a deterministic gpu architecture. In Proceedings of the eighteenth international conference on Architectural support for programming languages and operating systems, pages 1–12, 2013.
|
| 459 |
+
[57] Mahyar Fazlyab, Alexander Robey, Hamed Hassani, Manfred Morari, and George Pappas. Efficient and accurate estimation of lipschitz constants for deep neural networks. Advances in Neural Information Processing Systems, 32, 2019.
|
md/dev/pfI7u0eJAIr/pfI7u0eJAIr.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On Embeddings for Numerical Features in Tabular Deep Learning
|
| 2 |
+
|
| 3 |
+
Yury Gorishniy∗ Yandex
|
| 4 |
+
|
| 5 |
+
Ivan Rubachev HSE, Yandex
|
| 6 |
+
|
| 7 |
+
Artem Babenko Yandex
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Recently, Transformer-like deep architectures have shown strong performance on tabular data problems. Unlike traditional models, e.g., MLP, these architectures map scalar values of numerical features to high-dimensional embeddings before mixing them in the main backbone. In this work, we argue that embeddings for numerical features are an underexplored degree of freedom in tabular DL, which allows constructing more powerful DL models and competing with gradient boosted decision trees (GBDT) on some GBDT-friendly benchmarks (that is, where GBDT outperforms conventional DL models). We start by describing two conceptually different approaches to building embedding modules: the first one is based on a piecewise linear encoding of scalar values, and the second one utilizes periodic activations. Then, we empirically demonstrate that these two approaches can lead to significant performance boosts compared to the embeddings based on conventional blocks such as linear layers and ReLU activations. Importantly, we also show that embedding numerical features is beneficial for many backbones, not only for Transformers. Specifically, after proper embeddings, simple MLP-like models can perform on par with the attention-based architectures. Overall, we highlight embeddings for numerical features as an important design aspect with good potential for further improvements in tabular DL. The source code is available at https://github.com/Yura52/tabular-dl-num-embeddings.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Tabular data problems are currently a final frontier for deep learning (DL) research. While the most recent breakthroughs in NLP, vision, and speech are achieved by deep models [12], their success in the tabular domain is not convincing yet. Despite a large number of proposed architectures for tabular DL [2, 3, 13, 17, 21, 24, 31, 39, 40], the performance gap between them and the “shallow” ensembles of decision trees, like GBDT, often remains significant [13, 36].
|
| 16 |
+
|
| 17 |
+
The recent line of works [13, 24, 39] reduce this performance gap by successfully adapting the Transformer architecture [45] for the tabular domain. Compared to traditional models, like MLP or ResNet, the proposed Transformer-like architectures have a specific way to handle numerical features of the data. Namely, they map scalar values of numerical features to high-dimensional embedding vectors, which are then mixed by the self-attention modules. Beyond transformers, mapping numerical features to vectors was also employed in different forms in the click-through rate (CTR) prediction problems [8, 14, 40]. Nevertheless, the literature is mostly focused on developing more powerful backbones while keeping the design of embedding modules relatively simple. In particular, the existing architectures [13, 14, 24, 39, 40] construct embeddings for numerical features using quite restrictive parametric mappings, e.g., linear functions, which can lead to suboptimal performance. In this work, we demonstrate that the embedding step has a substantial impact on the model effectiveness, and its proper design can significantly improve tabular DL models.
|
| 18 |
+
|
| 19 |
+
Specifically, we describe two different building blocks suitable for constructing embeddings for numerical features. The first one is a piecewise linear encoding that produces alternative initial representations for the original scalar values and is based on feature binning, a long-existing preprocessing technique [11]. The second one relies on periodic activation functions, which is inspired by their usage in implicit neural representations [28, 38, 42], NLP [41, 45] and CV tasks [25]. The first approach is simple, interpretable and non-differentiable, while the second demonstrates better results on average. We observe that DL models equipped with our embedding schemes successfully compete with GBDT on GBDT-friendly benchmarks and achieve the new state-of-the-art on tabular DL.
|
| 20 |
+
|
| 21 |
+
As another important finding, we demonstrate that the step of embedding the numerical features is universally beneficial for different deep architectures, not only for Transformer-like ones. In particular, we show, that after proper embeddings, simple MLP-like architectures often provide the performance comparable to the state-of-the-art attention-based models. Overall, our work demonstrates the large impact of the embeddings of numerical features on the tabular DL performance and shows the potential of investigating more advanced embedding schemes in future research.
|
| 22 |
+
|
| 23 |
+
To sum up, our contributions are as follows:
|
| 24 |
+
|
| 25 |
+
1. We demonstrate that embedding schemes for numerical features are an underexplored research question in tabular DL. Namely, we show that more expressive embedding schemes can provide substantial performance improvements over prior models.
|
| 26 |
+
2. We show that the profit from embedding numerical features is not specific for Transformerlike architectures, and proper embedding schemes benefit traditional models as well.
|
| 27 |
+
3. On a number of public benchmarks, we achieve the new state-of-the-art on tabular DL.
|
| 28 |
+
|
| 29 |
+
# 2 Related work
|
| 30 |
+
|
| 31 |
+
Tabular deep learning. During several recent years, the community has proposed a large number of deep models for tabular data [2, 3, 13, 15, 17, 21, 24, 31, 39, 40, 46]. However, when systematically evaluated, these models do not consistently outperform the ensembles of decision trees, such as GBDT (Gradient Boosting Decision Tree) [7, 19, 32], which are typically the top-choice in various ML competitions [13, 36]. Moreover, several recent works have shown that the proposed sophisticated architectures are not superior to properly tuned simple models, like MLP and ResNet [13, 18]. In this work, unlike the prior literature, we do not aim to propose a new backbone architecture. Instead, we focus on more accurate ways to handle numerical features, and our developments can be potentially combined with any model, including traditional MLPs and more recent Transformer-like ones.
|
| 32 |
+
|
| 33 |
+
Transformers in tabular DL. Due to the tremendous success of Transformers for different domains [10, 45], several recent works adapt their self-attention design for tabular DL as well [13, 17, 24, 39]. Compared to existing alternatives, applying self-attention modules to the numerical features of tabular data requires mapping the scalar values of these features to high-dimensional embedding vectors. So far, the existing architectures perform this “scalar” “vector” mapping by relatively simple computational blocks, which, in practice, can limit the model expressiveness. For instance, the recent FT-Transformer architecture [13] employs only a single linear layer. In our experiments, we demonstrate that such embedding schemes can provide suboptimal performance, and more advanced schemes often lead to substantial profit.
|
| 34 |
+
|
| 35 |
+
CTR Prediction. In CTR prediction problems, objects are represented by numerical and categorical features, which makes this field highly relevant to tabular data problems. In several works, numerical features are handled in some non-trivial way while not being the central part of the research [8, 40]. Recently, however, a more advanced scheme has been proposed in Guo et al. [14]. Nevertheless, it is still based on linear layers and conventional activation functions, which we found to be suboptimal in our evaluation.
|
| 36 |
+
|
| 37 |
+
Feature binning. Binning is a discretization technique that converts numerical features to categorical features. Namely, for a given feature, its value range is split into bins (intervals), after which the original feature values are replaced with discrete descriptors (e.g. bin indices or one-hot vectors) of the corresponding bins. We point to the work by Dougherty et al. [11], which performs an overview of some classic approaches to binning and can serve as an entry point to the relevant literature on the topic. In our work, however, we utilize bins in a different way. Specifically, we use their edges to construct lossless piecewise linear representations of the original scalar values. It turns out that this simple and interpretable representations can provide substantial benefit to deep models on several tabular problems.
|
| 38 |
+
|
| 39 |
+
Periodic activations. Recently, periodic activation functions have become a key component in processing coordinates-like inputs, which is required in many applications. Examples include NLP [45], CV [25], implicit neural representations [28, 38, 42]. In our work, we show that periodic activations can be used to construct powerful embedding modules for numerical features in tabular data problems. Contrary to some of the aforementioned papers, where components of the multidimensional coordinates are mixed (e.g. with linear layers) before passing them to periodic functions [38, 42], we find it crucial to embed each feature separately before mixing them in the main backbone.
|
| 40 |
+
|
| 41 |
+
# 3 Embeddings for numerical features
|
| 42 |
+
|
| 43 |
+
In this section, we describe the general framework for what we call "embeddings for numerical features" and the main building blocks used in the experimental comparison in section 4.
|
| 44 |
+
|
| 45 |
+
Notation. For a given supervised learning problem on tabular data, we denote the dataset as $\left\{ \left( x ^ { j } , \ y ^ { j } \right) \right\} _ { j = 1 } ^ { n }$ where $y ^ { j } \in \mathbb { Y }$ represents the object’s label and $x ^ { j } = \left( x ^ { j \left( n u m \right) } , x ^ { j \left( c a t \right) } \right) \in \mathbb { X }$ represents the object’s features (numerical and categorical). xj(num)i , in turn, denotes the i-th numerical feature of the -th object. Depending on the context, the index can be omitted. The dataset is split into three disjoint parts: $\overline { { 1 , n } } \overline { { = J _ { t r a i n } } } \cup J _ { v a l } \cup J _ { t e s t }$ , where the “train” part is used for training, the “validation” part is used for early stopping and hyperparameter tuning, and the “test” part is used for the final evaluation.
|
| 46 |
+
|
| 47 |
+
# 3.1 General framework
|
| 48 |
+
|
| 49 |
+
We formalize the notion of "embeddings for numerical features" as $z _ { i } = f _ { i } ( ( x _ { i } ^ { ( n u m ) } ) \in \mathbb { R } ^ { d _ { i } }$ where $f _ { i } ( x )$ is the embedding function for the $i$ -th numerical feature, $z _ { i }$ is the embedding of the $i$ -th numerical feature and $d _ { i }$ is the dimensionality of the embedding. Importantly, the proposed framework implies that embeddings for all features are computed independently of each other. Note that the function $f _ { i }$ can depend on parameters that are trained as a part of the whole model or in some other fashion (e.g. before the main optimization). In this work, we consider only embedding schemes where the embedding functions for all features are of the same functional form. We never share parameters of embedding functions of different features.
|
| 50 |
+
|
| 51 |
+
The subsequent use of the embeddings depends on the model backbone. For MLP-like architectures, they are concatenated into one flat vector (see Appendix A for illustrations). For Transformer-based architectures, no extra step is performed and the embeddings are passed as is, so the usage is defined by the original architectures.
|
| 52 |
+
|
| 53 |
+
# 3.2 Piecewise linear encoding
|
| 54 |
+
|
| 55 |
+
While vanilla MLP is known to be a universal approximator [9, 16], in practice, due to optimization peculiarities, it has limitations in its learning capabilities [34]. However, the recent work by Tancik et al. [42] uncovers the case where changing the input space alleviates the above issue. This observation motivates us to check if changing the representations of the original scalar values of numerical features can improve the learning capabilities of tabular DL models.
|
| 56 |
+
|
| 57 |
+
At this point, we try to start simple and turn to "classical" machine learning techniques. Namely, we take inspiration from the one-hot encoding algorithm that is widely and successfully used for representing discrete entities such as categorical features in tabular data problems or tokens in NLP. We note that the one-hot representation can be seen as an opposite solution to the scalar representation in terms of the trade-off between parameter efficiency and expressivity. To check whether the onehot-like approach can be beneficial for tabular DL models, we design a continuous alternative to the one-hot encoding (since the vanilla one-hot encoding is barely applicable to numerical features).
|
| 58 |
+
|
| 59 |
+
Formally, for the $i \cdot$ -th numerical feature, we split its value range into the disjoint set of $T ^ { i }$ intervals $B _ { 1 } ^ { i }$ , . . . , $B _ { T } ^ { i }$ , which we call bins: $B _ { t } ^ { i } = [ b _ { t - 1 } ^ { i } , b _ { t } ^ { i } )$ . The splitting algorithm is an important implementation detail that we discuss later. From now on, we omit the feature index $i$ for simplicity. Once the bins are determined, we define the encoding scheme as in Equation 1:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathsf { P L E } ( x ) = [ e _ { 1 } , ~ . ~ . ~ . , ~ e _ { T } ] \in \mathbb { R } ^ { T }
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
e _ { t } = \left\{ \begin{array} { l l } { 0 , } & { x < b _ { t - 1 } \mathrm { ~ A N D ~ } t > 1 } \\ { 1 , } & { x \geq b _ { t } \mathrm { ~ A N D ~ } t < T } \\ { \frac { x - b _ { t - 1 } } { b _ { t } - b _ { t - 1 } } , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where PLE stands for “peicewise linear encoding”. We provide the visualization in Figure 1.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: The piecewise linear encoding (PLE) in action for $T = 4$ (see Equation 1).
|
| 73 |
+
|
| 74 |
+
Note that:
|
| 75 |
+
|
| 76 |
+
• PLE produces alternative initial representations for the numerical features and can be viewed as a preprocessing strategy. These representations are computed once and then used instead of the original scalar values during the main optimization.
|
| 77 |
+
• For $T = 1$ , the PLE-representation is effectively equivalent to the scalar representation.
|
| 78 |
+
• Contrary to categorical features, numerical features are ordered; we express that by setting to 1 the components corresponding to bins with the right boundaries lower than the given feature value (this approach resembles how labels are encoded in ordinal regression problems).
|
| 79 |
+
• The cases $( x < b _ { 0 } )$ ) and $( x \geq b _ { T } )$ ) are also covered by Equation 1 (which leads to $( e _ { 1 } \leq 0 )$ ) and $( e _ { T } \ge 1 )$ respectively).
|
| 80 |
+
• The choice to make the representation piecewise linear is itself a subject for discussion. We analyze some alternatives in subsection 5.2.
|
| 81 |
+
• PLE can be viewed as feature preprocessing, which is additionally discussed in subsection 5.3.
|
| 82 |
+
|
| 83 |
+
A note on attention-based models. While the described PLE-representations can be passed to MLPlike models as is, attention-based models are inherently invariant to the order of input embeddings, so one additional step is required to add the information about feature indices to the obtained encodings. Technically, we observe that it is enough to place one linear layer after PLE(without sharing weights between features). Conceptually, however, this solution has a clear semantic interpretation. Namely, it is equivalent to allocating one trainable embedding $v _ { t } \in \mathbb { R } ^ { d }$ for each bin $B _ { t }$ and obtaining the final feature embedding by aggregating the embeddings of its bins with $e _ { t }$ as weights, plus bias $v _ { 0 }$ . Formally: $\begin{array} { r } { f _ { i } \left( x \right) = v _ { 0 } + \sum _ { t = 1 } ^ { T } e _ { t } \cdot v _ { t } = \mathrm { L i n e a r } \left( \mathrm { P L E } \left( x \right) \right) } \end{array}$ .
|
| 84 |
+
|
| 85 |
+
In the following two sections, we describe two simple algorithms for building bins suitable for PLE. Namely, we rely on the classic binning algorithms [11] and one of the two algorithms is unsupervised, while another one utilizes labels for constructing bins.
|
| 86 |
+
|
| 87 |
+
# 3.2.1 Obtaining bins from quantiles
|
| 88 |
+
|
| 89 |
+
A natural baseline way to construct the bins for PLE is by splitting value ranges according to the uniformly chosen empirical quantiles of the corresponding individual feature distributions. Formally, for the $i$ -th feature: $b _ { t } = \mathbb { Q } _ { \frac { t } { T } } \left( \{ x _ { i } ^ { j \left( n u m \right) } \} _ { j \in J _ { t r a i n } } \right)$ , where $\mathsf { Q }$ is the empirical quantile function. Trivial bins of zero size are removed. In subsection D.1, we demonstrate the usefulness of the proposed scheme on the synthetic GBDT-friendly dataset described in section 5.1 in Gorishniy et al. [13].
|
| 90 |
+
|
| 91 |
+
# 3.2.2 Building target-aware bins
|
| 92 |
+
|
| 93 |
+
In fact, there are also supervised approaches that employ training labels for constructing bins [11]. Intuitively, such target-aware algorithms aim to produce bins that correspond to relatively narrow ranges of possible target values. The supervised approach used in our work is identical in its spirit to the $" \mathrm { C } 4 . 5$ Discretization" algorithm from Kohavi and Sahami [23]. In a nutshell, for each feature, we recursively split its value range in a greedy manner using target as guidance, which is equivalent to building a decision tree (which uses for growing only this one feature and the target) and treating the regions corresponding to its leaves as the bins for PLE (see the illustration in Figure 4). Additionally, we define $\begin{array} { r } { b _ { 0 } ^ { i } = \operatorname* { m i n } _ { j \in J _ { t r a i n } } x _ { i } ^ { j } } \end{array}$ and $b _ { T } ^ { i } = \operatorname* { m a x } _ { j \in J _ { t r a i n } } x _ { i } ^ { j }$ .
|
| 94 |
+
|
| 95 |
+
# 3.3 Periodic activation functions
|
| 96 |
+
|
| 97 |
+
Recall that in subsection 3.2 the work by Tancik et al. [42] was used as a starting point of our motivation for developing PLE. Thus, we also try to adapt the original work itself for tabular data problems. Our variation differs in two aspects. First, we take into account the fact the embedding framework described in subsection 3.1 forbids mixing features during the embedding process (see subsection D.2 for additional discussion). Second, we train the pre-activation coefficients instead of keeping them fixed. As a result, our approach is rather close to Li et al. [25] with the number of “groups” equal to the number of numerical features. We formalize the described scheme in Equation 2,
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
f _ { i } ( x ) = { \mathsf { P e r i o d i c } } ( x ) = { \mathsf { c o n c a t } } [ { \mathsf { s i n } } ( v ) , { \mathsf { c o s } } ( v ) ] , \qquad v = [ 2 \pi c _ { 1 } x , \ldots , 2 \pi c _ { k } x ]
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $c _ { i }$ are trainable parameters initialized from $\mathcal { N } ( 0 , \sigma )$ . We observe that $\sigma$ is an important hyperparameter. Both $\sigma$ and $k$ are tuned using validation sets.
|
| 104 |
+
|
| 105 |
+
# 3.4 Simple differentiable layers
|
| 106 |
+
|
| 107 |
+
In the context of Deep Learning, embedding numerical features with conventional differentiable layers (e.g. linear layers, ReLU activation, etc.) is a natural approach. In fact, this technique is already used on its own in the recently proposed attention-based architectures [13, 24, 39] and in some models for CTR prediction problems [14, 40]. However, we also note that such conventional modules can be used on top of the components described in subsection 3.2 and subsection 3.3. In section 4, we find that such combinations often lead to better results.
|
| 108 |
+
|
| 109 |
+
# 4 Experiments
|
| 110 |
+
|
| 111 |
+
In this section, we empirically evaluate the techniques discussed in section 3 and compare them with Gradient Boosted Decision Trees to check the status quo of the “DL vs GBDT” competition.
|
| 112 |
+
|
| 113 |
+
# 4.1 Datasets
|
| 114 |
+
|
| 115 |
+
Table 1: Dataset properties. “RMSE” denotes root-mean-square error, “Acc.” denotes accuracy.
|
| 116 |
+
|
| 117 |
+
<table><tr><td></td><td>GE</td><td>CH</td><td>CA</td><td>HO</td><td>AD</td><td>OT</td><td>HI</td><td>FB</td><td>SA</td><td>CO</td><td>MI</td></tr><tr><td>#objects</td><td>9873</td><td>10000</td><td>20640</td><td>22784</td><td>48842</td><td>61878</td><td>98049</td><td>197080</td><td>200000</td><td>581012</td><td>1200192</td></tr><tr><td>#num.features</td><td>32</td><td>10</td><td>8</td><td>16</td><td>6</td><td>93</td><td>28</td><td>50</td><td>200</td><td>54</td><td>136</td></tr><tr><td>#cat.features metric</td><td>0 Acc.</td><td>1 Acc.</td><td>0</td><td>0</td><td>8</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td></tr><tr><td>#classes</td><td>5</td><td></td><td>RMSE</td><td>RMSE</td><td>Acc.</td><td>Acc.</td><td>Acc.</td><td>RMSE</td><td>Acc.</td><td>Acc.</td><td>RMSE</td></tr><tr><td></td><td></td><td>2</td><td>1</td><td></td><td>2</td><td>9</td><td>2</td><td></td><td>2</td><td>7</td><td>1</td></tr><tr><td>majority class</td><td>29%</td><td>79%</td><td>1</td><td>1</td><td>76%</td><td>26%</td><td>52%</td><td>1</td><td>89%</td><td>48%</td><td>1</td></tr></table>
|
| 118 |
+
|
| 119 |
+
We use eleven public datasets mostly from the previous works on tabular DL and Kaggle competitions. Importantly, we focus on the middle and large scale tasks, and our benchmark is biased towards GBDT-friendly problems, since, as of now, closing the gap with GBDT models on such tasks is one of the main challenges for tabular DL. The main dataset properties are summarized in Table 1 and the used sources and additional details are provided in Appendix C.
|
| 120 |
+
|
| 121 |
+
# 4.2 Implementation details
|
| 122 |
+
|
| 123 |
+
We mostly follow Gorishniy et al. [13] in terms of the hyperparameter tuning, training and evaluation protocols. Nevertheless, for completeness, we list all the details in Appendix E. In the next paragraph, we describe the implementation details specific to embeddings for numerical features.
|
| 124 |
+
|
| 125 |
+
Embeddings for numerical features. If linear layers are used, we tune their output dimensions. The PLE hyperparameters are the same for all features. For quantile-based PLE, we tune the number of quantiles. For target-aware PLE, we tune the following parameters for decision trees: the maximum number of leaves, the minimum number of items per leaf, and the minimum information gain required for making a split when growing the tree. For the Periodic module (see Equation 2), we tune $\sigma$ and $k$ (these hyperparameters are the same for all features).
|
| 126 |
+
|
| 127 |
+
# 4.3 Model names
|
| 128 |
+
|
| 129 |
+
In the experiments, we consider different combinations of backbones and embeddings. For convenience, we use the “Backbone-Embedding” pattern to name the models, where “Backbone” denotes the backbone (e.g. MLP, ResNet, Transformer) and “Embedding” denotes the embedding type. See Table 2 for all considered embedding modules. Note that:
|
| 130 |
+
|
| 131 |
+
• Periodic is defined in Equation 2. • $\mathrm { P L E _ { q } }$ denotes the quantile-based PLE. $\mathrm { P L E } _ { \mathrm { t } }$ denotes the target-aware PLE. • Linear− denotes bias-free linear layer. LReLU denotes leaky ReLU. AutoDis was proposed in Guo et al. [14] • “Transformer-L” is equivalent to FTTransformer [13].
|
| 132 |
+
|
| 133 |
+
Table 2: Embedding names. See subsection 4.3
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Name</td><td>Embedding function(fi)</td></tr><tr><td>L</td><td>Linear</td></tr><tr><td>LR</td><td>ReLUoLinear</td></tr><tr><td>LRLR</td><td>ReLUoLinearoReLUoLinear</td></tr><tr><td>Q</td><td>PLEq</td></tr><tr><td>Q-L</td><td>Linear o PLEq</td></tr><tr><td>Q-LR</td><td>ReLUo Linear o PLEq</td></tr><tr><td>Q-LRLR</td><td>ReLUoLinear o ReLUo Linear o PLEq</td></tr><tr><td>T</td><td>PLEt</td></tr><tr><td>T-L</td><td>Linear o PLEt</td></tr><tr><td>T-LR</td><td>ReLUo Linear o PLEt</td></tr><tr><td>T-LRLR</td><td>ReLUoLinearoReLUoLinearoPLEt</td></tr><tr><td>P</td><td>Periodic</td></tr><tr><td>PL</td><td>LinearoPeriodic</td></tr><tr><td>PLR</td><td>ReLUoLinearoPeriodic</td></tr><tr><td>PLRLR</td><td>ReLUoLinearoReLUoLinearoPeriodic</td></tr><tr><td>AutoDis</td><td>Linear oSoftMaxo Linear_oLReLUoLinear_</td></tr></table>
|
| 136 |
+
|
| 137 |
+
# 4.4 Simple differentiable embedding modules
|
| 138 |
+
|
| 139 |
+
Table 3: Results for MLP equipped with simple embedding modules (see subsection 4.3). The metric values averaged over 15 random seeds are reported. The standard deviations are provided in Appendix F. We consider one result to be better than another if its mean score is better and its standard deviation is less than the difference. For each dataset, top results are in bold. Notation: ↓ corresponds to RMSE, $\uparrow$ corresponds to accuracy
|
| 140 |
+
|
| 141 |
+
<table><tr><td></td><td>GE↑(</td><td></td><td></td><td>CH↑ CA↓ HO↓ AD↑ OT↑ HI↑ FB↓ SA↑ CO↑MI↓</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MLP</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.6320.856 0.495 3.204 0.854 0.818 0.720 5.686 0.912 0.964 0.747</td><td></td></tr><tr><td>MLP-L(</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.639 0.861 0.4753.123 0.856 0.820 0.723 5.684 0.916 0.963 0.748</td><td></td></tr><tr><td>MLP-LR 0.642 0.860 0.471 3.084 0.857 0.819 0.726 5.625 0.923 0.963 0.746</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 142 |
+
|
| 143 |
+
We start by evaluating embedding modules consisting of “conventional” differentiable layers (linear layers, ReLU activations, etc.). The results are summarized in Table 3.
|
| 144 |
+
|
| 145 |
+
# The main takeaways:
|
| 146 |
+
|
| 147 |
+
• first and foremost, the results indicate that MLP can benefit from embedding modules. Thus, we conclude that this backbone is worth attention when it comes to evaluating embedding modules. • the simple LR module leads to modest, but consistent improvements when applied to MLP.
|
| 148 |
+
|
| 149 |
+
Interestingly, the “redundant” MLP-L configuration also tends to outperform the vanilla MLP. Although the improvements are not dramatic, the special property of this architecture is that the linear embedding module can be fused together with the first linear layer of MLP after training, which completely removes the overhead. As for LRLR and AutoDis, we observe that these heavy modules do not justify the extra costs (see the results in Appendix F).
|
| 150 |
+
|
| 151 |
+
# 4.5 Piecewise linear encoding
|
| 152 |
+
|
| 153 |
+
In this section, we evaluate the encoding scheme described in subsection 3.2. The results are summarized in Table 4.
|
| 154 |
+
|
| 155 |
+
# The main takeaways:
|
| 156 |
+
|
| 157 |
+
• The piecewise linear encoding is often beneficial for both types of architectures (MLP and Transformer) and the profit can be significant (for example, see the CA and AD datasets). • Adding differentiable components on top of the PLE can improve the performance. Though, the most expensive modifications such as $\mathsf { Q }$ -LRLR and T-LRLR are not worth it (see Appendix F).
|
| 158 |
+
|
| 159 |
+
Note that the benchmark is biased towards GBDT-friendly problems, so the typical superiority of tree-based bins over quantile-based bins, which can be observed in Table 4, may not generalize to more DL-friendly datasets. Thus, we do not make any general claims about the relative advantages of the two schemes here.
|
| 160 |
+
|
| 161 |
+
Table 4: Results for MLP and Transformer with embedding modules based on the piecewise linear encoding (subsection 3.2). Notation follows Table 3 and Table 2. The best results are defined separately for the MLP and Transformer backbones.
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td>GE↑</td><td>CH↑</td><td>CA↓</td><td>HO↓</td><td>AD个</td><td>OT↑</td><td>HI↑</td><td>FB↓</td><td>SA↑</td><td>CO →</td><td>MI↓</td></tr><tr><td>MLP</td><td>0.632</td><td>0.856</td><td>0.495</td><td>3.204</td><td>0.854</td><td>0.818</td><td>0.720</td><td>5.686</td><td>0.912</td><td>0.964</td><td>0.747</td></tr><tr><td>MLP-Q</td><td>0.653</td><td>0.854</td><td>0.464</td><td>3.163</td><td>0.859</td><td>0.816</td><td>0.721</td><td>5.766</td><td>0.922</td><td>0.968</td><td>0.750</td></tr><tr><td>MLP-T</td><td>0.647</td><td>0.861</td><td>0.447</td><td>3.149</td><td>0.864</td><td>0.821</td><td>0.720</td><td>5.577</td><td>0.923</td><td>0.967</td><td>0.749</td></tr><tr><td>MLP-Q-LR</td><td>0.646</td><td>0.857</td><td>0.455</td><td>3.184</td><td>0.863</td><td>0.811</td><td>0.720</td><td>5.394</td><td>0.923</td><td>0.969</td><td>0.747</td></tr><tr><td>MLP-T-LR</td><td>0.640</td><td>0.861</td><td>0.439</td><td>3.207</td><td>0.868</td><td>0.818</td><td>0.724</td><td>5.508</td><td>0.924</td><td>0.968</td><td>0.747</td></tr><tr><td>Transformer-L</td><td>0.632</td><td>0.860</td><td>0.465</td><td>3.239</td><td>0.858</td><td>0.817</td><td>0.725</td><td>5.602</td><td>0.924</td><td>0.971</td><td>0.746</td></tr><tr><td>Transformer-Q-L</td><td>0.659</td><td>0.856</td><td>0.451</td><td>3.319</td><td>0.867</td><td>0.812</td><td>0.729</td><td>5.741</td><td>0.924</td><td>0.973</td><td>0.747</td></tr><tr><td>Transformer-T-L</td><td>0.663</td><td>0.861</td><td>0.454</td><td>3.197</td><td>0.871</td><td>0.817</td><td>0.726</td><td>5.803</td><td>0.924</td><td>0.974</td><td>0.747</td></tr><tr><td>Transformer-Q-LR</td><td>0.659</td><td>0.857</td><td>0.448</td><td>3.270</td><td>0.867</td><td>0.812</td><td>0.723</td><td>5.683</td><td>0.923</td><td>0.972</td><td>0.748</td></tr><tr><td>Transformer-T-LR</td><td>0.665(</td><td>0.860</td><td>0.442</td><td>3.219</td><td>0.870</td><td>0.818</td><td>0.729</td><td>5.699</td><td>0.924</td><td>0.973</td><td>0.747</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 4.6 Periodic activation functions
|
| 166 |
+
|
| 167 |
+
Table 5: Results for MLP and Transformer with embedding modules based on periodic activations (subsection 3.3). Notation follows Table 3 and Table 2. The best results are defined separately for the MLP and Transformer backbones.
|
| 168 |
+
|
| 169 |
+
<table><tr><td></td><td>GE个</td><td>CH↑</td><td>CA↓</td><td>HO↓</td><td>AD↑</td><td>OT↑</td><td>HI↑</td><td>FB←</td><td>SA↑</td><td>co↑</td><td>MI↓</td></tr><tr><td>MLP</td><td>0.632</td><td>0.856</td><td>0.495</td><td>3.204</td><td>0.854</td><td>0.818</td><td>0.720</td><td>5.686</td><td>0.912</td><td>0.964</td><td>0.747</td></tr><tr><td>MLP-P</td><td>0.631</td><td>0.860</td><td>0.489</td><td>3.129</td><td>0.869</td><td>0.807</td><td>0.723</td><td>5.845</td><td>0.923</td><td>0.968</td><td>0.747</td></tr><tr><td>MLP-PL</td><td>0.641</td><td>0.859</td><td>0.467</td><td>3.113</td><td>0.868</td><td>0.819</td><td>0.727</td><td>5.530</td><td>0.924</td><td>0.969</td><td>0.746</td></tr><tr><td>MLP-PLR</td><td>0.674</td><td>0.857</td><td>0.467</td><td>3.050</td><td>0.870</td><td>0.819</td><td>0.728</td><td>5.525</td><td>0.924</td><td>0.970</td><td>0.746</td></tr><tr><td>Transformer-L</td><td>0.632</td><td>0.860</td><td>0.465</td><td>3.239</td><td>0.858</td><td>0.817</td><td>0.725</td><td>5.602</td><td>0.924</td><td>0.971</td><td>0.746</td></tr><tr><td>Transformer-PLR</td><td>0.646</td><td>0.863</td><td>0.464</td><td>3.162</td><td>0.870</td><td>0.814</td><td>0.730</td><td>5.760</td><td>0.924</td><td>0.972</td><td>0.746</td></tr></table>
|
| 170 |
+
|
| 171 |
+
In this section, we evaluate embedding modules based on periodic activation functions as described in subsection 3.3. The results are reported in Table 5.
|
| 172 |
+
|
| 173 |
+
The main takeaway: on average, MLP-P is superior to the vanilla MLP. However, adding a differentiable component on top of the Periodic module should be the default strategy (which is in line with Li et al. [25]). Indeed, MLP-PLR and MLP-PL provide meaningful improvements over MLP-P (e.g. see GE, CA, HO) and even “fix” MLP-P where it is inferior to MLP (OT, FB).
|
| 174 |
+
|
| 175 |
+
Although MLP-PLR is usually superior to MLP-PL, we note that in the latter case the last linear layer of the embedding module is “redundant” in terms of expressivity and can be fused with the first linear layer of the backbone after training, which, in theory, can lead to a more lightweight model. Finally, we observe that MLP-PLRLR and MLP-PLR do not differ significantly enough to justify the extra cost of the PLRLR module (see Appendix F).
|
| 176 |
+
|
| 177 |
+
# 4.7 Comparing DL models and GBDT
|
| 178 |
+
|
| 179 |
+
In this section, we perform a big comparison of different approaches to identify the best embedding modules and backbones, as well as to check if embeddings for numerical features allow DL models to compete with GBDT on more tasks than before. Importantly, we compare ensembles of DL models against ensembles of GBDT, since Gradient Boosting is essentially an ensembling technique, so such comparison will be fairer. Note that we focus only on the best metric values without taking efficiency into account, so we only check if DL models are conceptually ready to compete with GBDT.
|
| 180 |
+
|
| 181 |
+
We consider three backbones: MLP, ResNet, and Transformer, since they are reported to be representative of what baseline DL backbones are currently capable of [13, 18, 24, 39]. Note that we do not include the attention-based models that also apply attention on the level of objects [24, 35, 39], since this non-parametric component is orthogonal to the central topic of our work. The results are summarized in Table 6.
|
| 182 |
+
|
| 183 |
+
Table 6: Results for ensembles of GBDT, the baseline DL models and their modifications using different types of embeddings for numerical features. Notation follows Table 3 and Table 2. Due to the limited precision, some different values are represented with the same figures.
|
| 184 |
+
|
| 185 |
+
<table><tr><td></td><td>GE↑</td><td>CH↑</td><td>CA↓</td><td>HO↓</td><td>AD↑</td><td>OT↑</td><td>HI↑</td><td>FB↓</td><td>SA↑</td><td>CO→</td><td>MI↓</td><td></td><td>Avg.Rank</td></tr><tr><td>CatBoost</td><td>0.692</td><td>0.861</td><td>0.430</td><td>3.093</td><td>0.873</td><td>0.825</td><td>0.727</td><td></td><td>5.226</td><td>0.924</td><td>0.967</td><td>0.741</td><td>3.6±2.9</td></tr><tr><td>XGBoost</td><td>0.683</td><td>0.859</td><td>0.434</td><td>3.152</td><td>0.875</td><td>0.827</td><td>0.726</td><td>5.338</td><td>0.919</td><td>0.969</td><td></td><td>0.742</td><td>4.6±2.7</td></tr><tr><td>MLP</td><td>0.665</td><td>0.856</td><td>0.486</td><td>3.109</td><td>0.856</td><td>0.822</td><td>0.727</td><td>5.616</td><td>0.913</td><td>0.968</td><td></td><td>0.746</td><td>8.5±2.6</td></tr><tr><td>MLP-LR</td><td>0.679</td><td>0.861</td><td>0.463</td><td>3.012</td><td>0.859</td><td>0.826</td><td>0.731</td><td>5.477</td><td>0.924</td><td>0.972</td><td></td><td>0.744</td><td>5.5 ± 2.7</td></tr><tr><td>MLP-Q-LR</td><td>0.682</td><td>0.859</td><td>0.433</td><td>3.080</td><td>0.867</td><td>0.818</td><td>0.724</td><td>5.144</td><td>0.924</td><td></td><td>0.974</td><td>0.745</td><td>5.1 ± 1.9</td></tr><tr><td>MLP-T-LR</td><td>0.673</td><td>0.861</td><td>0.435</td><td>3.099</td><td>0.870</td><td>0.821</td><td>0.727</td><td>5.409</td><td>0.924</td><td></td><td>0.973</td><td>0.746</td><td>5.1 ± 1.7</td></tr><tr><td>MLP-PLR</td><td>0.700</td><td>0.858</td><td>0.453</td><td>2.975</td><td>0.874</td><td>0.830</td><td>0.734</td><td>5.388</td><td>0.924</td><td></td><td>0.975</td><td>0.743</td><td>3.0±2.4</td></tr><tr><td>ResNet</td><td>0.690</td><td>0.861</td><td>0.483</td><td>3.081</td><td>0.856</td><td>0.821</td><td>0.734</td><td>5.482</td><td>0.918</td><td></td><td>0.968</td><td>0.745</td><td>6.7±3.3</td></tr><tr><td>ResNet-LR</td><td>0.672</td><td>0.862</td><td>0.450</td><td>2.992</td><td>0.859</td><td>0.822</td><td>0.733</td><td>5.415</td><td>0.923</td><td></td><td>0.971</td><td>0.743</td><td>5.6±2.7</td></tr><tr><td>ResNet-Q-LR</td><td>0.674</td><td>0.859</td><td>0.427</td><td>3.066</td><td>0.868</td><td>0.815</td><td>0.729</td><td>5.309</td><td></td><td>0.923</td><td>0.976</td><td>0.746</td><td>4.7 ± 2.0</td></tr><tr><td>ResNet-T-LR</td><td>0.683</td><td>0.862</td><td>0.425</td><td>3.030</td><td>0.872</td><td>0.822</td><td>0.731</td><td>5.471</td><td></td><td>0.923</td><td>0.975</td><td>0.744</td><td>4.1 ± 1.9</td></tr><tr><td>ResNet-PLR</td><td>0.691</td><td>0.861</td><td>0.443</td><td>3.040</td><td>0.874</td><td>0.825</td><td>0.734</td><td>5.400</td><td></td><td>0.924</td><td>0.975</td><td>0.743</td><td>3.2 ±1.3</td></tr><tr><td>Transformer-L</td><td>0.668</td><td>0.861</td><td>0.455</td><td>3.188</td><td>0.860</td><td>0.824</td><td>0.727</td><td></td><td>5.434</td><td>0.924</td><td>0.973</td><td>0.743</td><td>5.9±2.2</td></tr><tr><td>Transformer-LR</td><td>0.666</td><td>0.861</td><td>0.446</td><td>3.193</td><td>0.861</td><td>0.824</td><td>0.733</td><td></td><td>5.430</td><td>0.924</td><td>0.973</td><td>0.743</td><td>5.2 ±2.2</td></tr><tr><td>Transformer-Q-LR</td><td>0.690</td><td>0.857</td><td>0.425</td><td>3.143</td><td>0.868</td><td>0.818</td><td>0.726</td><td></td><td>5.471</td><td>0.924</td><td>0.975</td><td>0.744</td><td>4.4 ± 2.2</td></tr><tr><td>Transformer-T-LR</td><td>0.686</td><td>0.862</td><td>0.423</td><td>3.149</td><td>0.871</td><td>0.823</td><td>0.733</td><td></td><td>5.515</td><td>0.924</td><td>0.976</td><td>0.744</td><td>3.7±2.2</td></tr><tr><td>Transformer-PLR</td><td>0.686</td><td>0.864</td><td>0.449</td><td>3.091</td><td>0.873</td><td>0.823</td><td>0.734</td><td></td><td>5.581</td><td>0.924</td><td>0.975</td><td>0.743</td><td>3.9 ±2.5</td></tr></table>
|
| 186 |
+
|
| 187 |
+
# The main takeaways for DL models:
|
| 188 |
+
|
| 189 |
+
• For most datasets, embeddings for numerical features can provide noticeable improvements for three different backbones. Although the average rank is not a good metric for making subtle conclusions, we highlight the impressive difference in average ranks between the MLP and MLP-PLR models.
|
| 190 |
+
|
| 191 |
+
• The simplest LR embedding is a good baseline solution: although the performance gains are not dramatic, its main advantage is consistency (e.g. see MLP vs MLP-LR).
|
| 192 |
+
|
| 193 |
+
• The PLR module provides the best average performance. Empirically, we observe $\sigma$ (see Equation 2) to be an important hyperparameter that should be tuned.
|
| 194 |
+
|
| 195 |
+
• Piecewise linear encoding (PLE) allows building well performing embeddings (e.g. T-LR, Q-LR). In addition to that, PLE itself is worth attention because of its simplicity, interpretability and efficiency (no computationally expensive periodic functions).
|
| 196 |
+
|
| 197 |
+
• Importantly, after the MLP-like architectures are coupled with embeddings for numerical features, they perform on par with the Transformer-based models.
|
| 198 |
+
|
| 199 |
+
The main takeaway for the “DL vs GBDT” competition: embeddings for numerical features is a significant design aspect that has a great potential for improving DL models and closing the gap with GBDT on GBDT-friendly tasks. Let us illustrate this claim with several observations:
|
| 200 |
+
|
| 201 |
+
• The benchmark is initially biased to GBDT-friendly problems, which can be observed by comparing GBDT solutions with the vanilla DL models (MLP, ResNet, Transformer-L). • However, for the vast majority of the “backbone & dataset” pairs, proper embeddings are the only thing needed to close the gap with GBDT. Exceptions (rather formal) include the MI dataset and the following pairs: “ResNet & GE”, “Transformer & FB”, “Transformer & GE”, “Transformer & OT”. • Additionally, to the best of our knowledge, it is the first time when DL models perform on par with GBDT on the well-known California Housing and Adult datasets.
|
| 202 |
+
|
| 203 |
+
That said, compared to GBDT models, efficiency can still be an issue for the considered DL architectures. In any case, the trade-off completely depends on the specific use case and requirements.
|
| 204 |
+
|
| 205 |
+
# 5 Analysis
|
| 206 |
+
|
| 207 |
+
# 5.1 Comparing model sizes
|
| 208 |
+
|
| 209 |
+
To quantify the effect of embeddings for numerical features on model sizes, we report the parameter counts in Table 7. Overall, introducing embeddings for numerical features can cause non-negligible overhead in terms of model size. Importantly, the overhead in terms of size does not translate to the same overhead in terms of training times and throughput. For example, the almost 2000-fold increase in the parameter count for MLP-LR on the CH dataset results in only 1.5-fold increase in training times. Finally, in practice, we observe that coupling MLP and ResNet with embedding modules leads to architectures that are still faster than Transformer-based models.
|
| 210 |
+
|
| 211 |
+
Table 7: Parameter counts for MLP with different embedding modules. All the models are tuned and the corresponding backbones are not identical in their sizes, so we take into account the fact that different approaches require a different number of parameters to realize their full potential.
|
| 212 |
+
|
| 213 |
+
<table><tr><td></td><td>GE</td><td>CH</td><td>CA</td><td>HO</td><td>AD</td><td>OT</td><td>HI</td><td>FB</td><td>SA</td><td>CO</td><td>MI</td></tr><tr><td>MLP</td><td>2.0M</td><td>1.5K</td><td>43.5K</td><td>3.6M</td><td>5.3M</td><td>479.9K</td><td>25.8K</td><td>937.3K</td><td>5.8M</td><td>3.2M</td><td>276.5K</td></tr><tr><td>MLP-LR</td><td>×2.52</td><td>×1931.03</td><td>×25.05</td><td>×1.28</td><td>×0.35</td><td>×12.53</td><td>×68.16</td><td>×4.76</td><td>×1.58</td><td>×0.72</td><td>×15.79</td></tr><tr><td>MLP-T</td><td>×1.58</td><td>×14.13</td><td>×7.97</td><td>×0.43</td><td>×0.04</td><td>×2.27</td><td>×5.85</td><td>×0.47</td><td>×0.59</td><td>×0.74</td><td>×3.85</td></tr><tr><td>MLP-T-LR</td><td>×1.61</td><td>×463.55</td><td>×6.80</td><td>×0.23</td><td>×0.16</td><td>×2.52</td><td>×113.22</td><td>×3.43</td><td>×0.41</td><td>×0.35</td><td>×8.47</td></tr><tr><td>MLP-PLR</td><td>×1.73</td><td>×250.24</td><td>×12.94</td><td>×1.07</td><td>×0.66</td><td>×8.05</td><td>×110.57</td><td>×4.93</td><td>×0.64</td><td>×0.44</td><td>×9.57</td></tr></table>
|
| 214 |
+
|
| 215 |
+
# 5.2 Ablation study
|
| 216 |
+
|
| 217 |
+
Table 8: Comparing piecewise linear encoding (PLE) with the two variations described in subsection 5.2. Notation follows Table 3 and Table 2.
|
| 218 |
+
|
| 219 |
+
<table><tr><td></td><td>GE↑</td><td>CH↑</td><td>CA↓1</td><td>HO←</td><td>AD↑</td><td>OT↑</td><td>HI↑</td><td>FB←</td></tr><tr><td>MLP-Q(piecewise linear) 0.653 0.854</td><td></td><td></td><td>0.464</td><td></td><td></td><td>3.163 0.859 0.816 0.721</td><td></td><td>5.766</td></tr><tr><td>MLP-Q (binary)</td><td>0.652</td><td>0.815</td><td>0.462</td><td>3.200</td><td>0.860</td><td>)0.810</td><td>0.720</td><td>5.748</td></tr><tr><td>MLP-Q (one-blob)</td><td>0.613 0.851(</td><td></td><td></td><td></td><td></td><td>0.461 3.187 0.857 0.808</td><td>30.719</td><td>5.645</td></tr><tr><td>MLP-T (piecewise linear)</td><td>0.647 0.861</td><td></td><td>0.447 3.149</td><td></td><td></td><td>90.8640.821(</td><td>0.720</td><td>5.577</td></tr><tr><td>MLP-T (binary)</td><td>0.639</td><td>90.855</td><td></td><td></td><td></td><td>0.4643.163 0.869 0.813</td><td>0.718</td><td>5.572</td></tr><tr><td>MLP-T (one-blob)</td><td>0.622</td><td>0.858</td><td>0.464</td><td>3.158</td><td>0.870</td><td>0.809</td><td>0.724</td><td>5.475</td></tr></table>
|
| 220 |
+
|
| 221 |
+
In this section, we compare two alternative binning-based encoding schemes with PLE (see subsection 3.2). The first one ("thermometer" [6]) sets the value 1 instead of the piecewise linear term (see Equation 1). The second one is a generalized version of the one-blob encoding [29] (see subsection E.1 for details). The tuning and evaluation protocols are the same as in subsection 4.2. The results in table Table 8 indicate that making the binning-based encoding piecewise linear is a good default strategy.
|
| 222 |
+
|
| 223 |
+
# 5.3 Piecewise linear encoding as a feature preprocessing technique
|
| 224 |
+
|
| 225 |
+
It is known that data preprocessing, such as standardization or quantile transformation, is often crucial for DL models for achieving competitive performance. Moreover, the performance can significantly vary between different types of preprocessing. At the same time, PLE-representations contain only values from [0, 1] and they are invariant to shifting and scaling, which makes PLE itself a general feature preprocessing technique potentially suitable for DL models without the need to use traditional preprocessing first.
|
| 226 |
+
|
| 227 |
+
To illustrate that, for datasets where the quantile transformation was used in section 4, we reevaluate the tuned configurations of MLP, MLP-Q, and MLP-T with different preprocessing policies and report the results in Table 9 (note that standardization is equivalent to no preprocessing for models with PLE).
|
| 228 |
+
|
| 229 |
+
Table 9: Results for MLP and MLP with PLE for different types of data preprocessing. Solutions using PLE are significantly less sensitive to data preprocessing. Notation follows Table 3 and Table 2.
|
| 230 |
+
|
| 231 |
+
<table><tr><td></td><td>GE↑</td><td>CH↑</td><td>CA↓HO↓AD↑]</td><td></td><td>HI↑</td><td>FB↓</td><td>SA↑</td><td>CO↑1</td><td>MI↓</td></tr><tr><td>MLP (none)</td><td>0.565</td><td></td><td>0.796 1.118 5.328 0.808 0.707</td><td></td><td></td><td>13.125</td><td>0.911</td><td></td><td>0.948 0.844</td></tr><tr><td>MLP (standard)</td><td>0.629</td><td></td><td>0.855 0.509 3.3030.855(</td><td></td><td>0.721</td><td>5.919</td><td>0.912</td><td></td><td>0.9630.754</td></tr><tr><td>MLP (quantile)</td><td>0.632</td><td></td><td>0.8560.495 3.204 0.8540.720</td><td></td><td></td><td>5.686</td><td>0.912</td><td></td><td>0.9640.747</td></tr><tr><td>MLP-Q (none)</td><td></td><td></td><td>0.654 0.851 0.463 3.162 0.860 0.721</td><td></td><td></td><td>5.889</td><td></td><td></td><td>0.922 0.968 0.754</td></tr><tr><td>MLP-Q(quantile) 0.653 0.854 0.464 3.163 0.859 0.721</td><td></td><td></td><td></td><td></td><td></td><td>5.766</td><td></td><td></td><td>0.922 0.968 0.750</td></tr><tr><td>MLP-T (none)</td><td></td><td></td><td>0.644 0.860 0.447 3.175 0.865 0.721</td><td></td><td></td><td>5.598</td><td></td><td></td><td>0.9230.968 0.749</td></tr><tr><td>MLP-T (quantile)</td><td></td><td></td><td>0.647 0.861 0.447 3.149 0.864 0.720</td><td></td><td></td><td>5.577</td><td>0.923</td><td></td><td>0.9670.749</td></tr></table>
|
| 232 |
+
|
| 233 |
+
First, the vanilla MLP often becomes unusable without preprocessing. Second, for the vanilla MLP, it can be important to choose one specific type of preprocessing (CA, HO, FB, MI), which is less pronounced for MLP-Q and not the case for MLP-T (though, this specific observation can be the property of the benchmarks, not of MLP-T). Overall, the results indicate that models using PLE are less sensitive to the initial preprocessing compared to the vanilla MLP. This is an additional benefit of PLE-representations for practitioners since the aspect of preprocessing becomes less critical with PLE.
|
| 234 |
+
|
| 235 |
+
# 5.4 The “feature engineering” perspective
|
| 236 |
+
|
| 237 |
+
Table 10: The comparison of the effects of Periodic-based modules for XGBoost and MLP
|
| 238 |
+
|
| 239 |
+
<table><tr><td>CA↓HO↓HI↑</td></tr><tr><td>XGBoost 0.436 3.160 0.724 XGBoost with Periodic 0.441 3.184 0.724</td></tr><tr><td>MLP 0.4953.204 0.720</td></tr><tr><td>MLP-PL</td></tr><tr><td>0.467 3.113 0.727</td></tr></table>
|
| 240 |
+
|
| 241 |
+
At first sight, feature embeddings may resemble feature engineering and should be suitable for all kinds of models. However, the proposed embedding schemes are motivated by DL-specific aspects of training (see the motivational parts of subsection 3.2 and subsection 3.3). While our methods are likely to transfer well to models with similar training properties (e.g. to linear models since those are a special case of deep models), it is not the case in general. To illustrate that, we try adopting the Periodic module for XGBoost by fixing the random coefficients from Equation 2. We also keep the original features instead of dropping them. The tuning and evaluation protocols are the same as in subsection 4.2. The results in Table 10 show that this technique, while being useful for DL models, does not provide any benefits for XGBoost.
|
| 242 |
+
|
| 243 |
+
# 6 Conclusion & Future work
|
| 244 |
+
|
| 245 |
+
In this work, we have demonstrated that embeddings for numerical features are an important design aspect of tabular DL architectures. Namely, it allows existing DL backbones to achieve noticeably better results and significantly reduce the gap with Gradient Boosted Decision Trees. We have described two approaches illustrating this phenomenon, one using the piecewise linear encoding of original scalar values, and another using periodic functions. We have also shown that traditional MLP-like models coupled with embeddings can perform on par with attention-based models.
|
| 246 |
+
|
| 247 |
+
Nevertheless, we have only scratched the surface of the new direction. For example, it is still to be explained how exactly the discussed embedding modules help optimization on the fundamental level. Additionally, we have considered only schemes where the same functional transformation was applied to all features, which may be a suboptimal choice.
|
| 248 |
+
|
| 249 |
+
# References
|
| 250 |
+
|
| 251 |
+
[1] T. Akiba, . Koyama. Optuna: A next-generation hyperparameter optimization framework. In KDD, 2019. [2] S. O. Arik and T. Pfister. Tabnet: Attentive interpretable tabular learning. arXiv, 1908.07442v5, 2020. [3] S. Badirli, X. Liu, Z. Xing, A. Bhowmik, K. Doan, and S. S. Keerthi. Gradient boosting neural networks: Grownet. arXiv, 2002.07971v2, 2020. [4] P. Baldi, P. Sadowski, and D. Whiteson. Searching for exotic particles in high-energy physics with deep learning. Nature Communications, 5, 2014. [5] J. A. Blackard and D. J. Dean. Comparative accuracies of artificial neural networks and discriminant analysis in predicting forest cover types from cartographic variables. Computers and Electronics in Agriculture, 24(3):131–151, 2000. [6] J. Buckman, A. Roy, C. Raffel, and I. J. Goodfellow. Thermometer encoding: One hot way to resist adversarial examples. In International Conference on Learning Representations, 2018.
|
| 252 |
+
[7] T. Chen and C. Guestrin. Xgboost: A scalable tree boosting system. In SIGKDD, 2016. [8] P. Covington, J. Adams, and E. Sargin. Deep neural networks for youtube recommendations. In RecSys, 2016. [9] G. Cybenko. Approximation by superpositions of a sigmoidal function. Math. Control. Signals Syst., 2(4), 1989.
|
| 253 |
+
[10] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
|
| 254 |
+
[11] J. Dougherty, R. Kohavi, and M. Sahami. Supervised and unsupervised discretization of continuous features. In ICML, 1995.
|
| 255 |
+
[12] I. Goodfellow, Y. Bengio, and A. Courville. Deep learning. MIT press, 2016.
|
| 256 |
+
[13] Y. Gorishniy, I. Rubachev, V. Khrulkov, and A. Babenko. Revisiting deep learning models for tabular data. In NeurIPS, 2021.
|
| 257 |
+
[14] H. Guo, B. Chen, R. Tang, W. Zhang, Z. Li, and X. He. An embedding learning framework for numerical features in CTR prediction. In KDD, 2021.
|
| 258 |
+
[15] H. Hazimeh, N. Ponomareva, P. Mol, Z. Tan, and R. Mazumder. The tree ensemble layer: Differentiability meets conditional computation. In ICML, 2020.
|
| 259 |
+
[16] K. Hornik. Approximation capabilities of multilayer feedforward networks. Neural Networks, 4(2), 1991.
|
| 260 |
+
[17] X. Huang, A. Khetan, M. Cvitkovic, and Z. Karnin. Tabtransformer: Tabular data modeling using contextual embeddings. arXiv, 2012.06678v1, 2020.
|
| 261 |
+
[18] A. Kadra, M. Lindauer, F. Hutter, and J. Grabocka. Well-tuned simple nets excel on tabular datasets. In NeurIPS, 2021.
|
| 262 |
+
[19] G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T.-Y. Liu. Lightgbm: A highly efficient gradient boosting decision tree. Advances in neural information processing systems, 30:3146–3154, 2017.
|
| 263 |
+
[20] R. Kelley Pace and R. Barry. Sparse spatial autoregressions. Statistics & Probability Letters, 33 (3):291–297, 1997.
|
| 264 |
+
[21] G. Klambauer, T. Unterthiner, A. Mayr, and S. Hochreiter. Self-normalizing neural networks. In NIPS, 2017.
|
| 265 |
+
[22] R. Kohavi. Scaling up the accuracy of naive-bayes classifiers: a decision-tree hybrid. In KDD, 1996.
|
| 266 |
+
[23] R. Kohavi and M. Sahami. Error-based and entropy-based discretization of continuous features. In KDD, pages 114–119. AAAI Press, 1996.
|
| 267 |
+
[24] J. Kossen, N. Band, C. Lyle, A. N. Gomez, T. Rainforth, and Y. Gal. Self-attention between datapoints: Going beyond individual input-output pairs in deep learning. In NeurIPS, 2021.
|
| 268 |
+
[25] Y. Li, S. Si, G. Li, C. Hsieh, and S. Bengio. Learnable fourier features for multi-dimensional spatial positional encoding. In NeurIPS, 2021.
|
| 269 |
+
[26] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In ICLR, 2019.
|
| 270 |
+
[27] R. C. B. Madeo, C. A. M. Lima, and S. M. Peres. Gesture unit segmentation using support vector machines: segmenting gestures from rest positions. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, SAC, 2013.
|
| 271 |
+
[28] B. Mildenhall, P. P. Srinivasan, M. Tancik, J. T. Barron, R. Ramamoorthi, and R. Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020.
|
| 272 |
+
[29] T. Müller, B. McWilliams, F. Rousselle, M. Gross, and J. Novák. Neural importance sampling. ACM Trans. Graph., 38(5), 2019.
|
| 273 |
+
[30] 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.
|
| 274 |
+
[31] S. Popov, S. Morozov, and A. Babenko. Neural oblivious decision ensembles for deep learning on tabular data. In ICLR, 2020.
|
| 275 |
+
[32] L. Prokhorenkova, G. Gusev, A. Vorobev, A. V. Dorogush, and A. Gulin. Catboost: unbiased boosting with categorical features. In NeurIPS, 2018.
|
| 276 |
+
[33] T. Qin and T. Liu. Introducing LETOR 4.0 datasets. arXiv, 1306.2597v1, 2013.
|
| 277 |
+
[34] N. Rahaman, A. Baratin, D. Arpit, F. Draxler, M. Lin, F. A. Hamprecht, Y. Bengio, and A. C. Courville. On the spectral bias of neural networks. In ICML, 2019.
|
| 278 |
+
[35] H. Ramsauer, B. Schäfl, J. Lehner, P. Seidl, M. Widrich, L. Gruber, M. Holzleitner, T. Adler, D. P. Kreil, M. K. Kopp, G. Klambauer, J. Brandstetter, and S. Hochreiter. Hopfield networks is all you need. In ICLR, 2021.
|
| 279 |
+
[36] R. Shwartz-Ziv and A. Armon. Tabular data: Deep learning is not all you need. arXiv, 2106.03253v1, 2021.
|
| 280 |
+
[37] K. Singh, R. K. Sandhu, and D. Kumar. Comment volume prediction using neural networks and decision trees. In IEEE UKSim-AMSS 17th International Conference on Computer Modelling and Simulation, UKSim, 2015.
|
| 281 |
+
[38] V. Sitzmann, J. N. P. Martel, A. W. Bergman, D. B. Lindell, and G. Wetzstein. Implicit neural representations with periodic activation functions. In NeurIPS, 2020.
|
| 282 |
+
[39] G. Somepalli, M. Goldblum, A. Schwarzschild, C. B. Bruss, and T. Goldstein. SAINT: improved neural networks for tabular data via row attention and contrastive pre-training. arXiv, 2106.01342v1, 2021.
|
| 283 |
+
[40] W. Song, C. Shi, Z. Xiao, Z. Duan, Y. Xu, M. Zhang, and J. Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. In CIKM, 2019.
|
| 284 |
+
[41] D. Sundararaman, S. Si, V. Subramanian, G. Wang, D. Hazarika, and L. Carin. Methods for numeracy-preserving word embeddings. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, 2020.
|
| 285 |
+
[42] M. Tancik, P. P. Srinivasan, B. Mildenhall, S. Fridovich-Keil, N. Raghavan, U. Singhal, R. Ramamoorthi, J. T. Barron, and R. Ng. Fourier features let networks learn high frequency functions in low dimensional domains. In NeurIPS, 2020.
|
| 286 |
+
[43] R. Turner, D. Eriksson, M. McCourt, J. Kiili, E. Laaksonen, Z. Xu, and I. Guyon. Bayesian optimization is superior to random search for machine learning hyperparameter tuning: Analysis of the black-box optimization challenge 2020. arXiv, https://arxiv.org/abs/2104.10201v1, 2021.
|
| 287 |
+
[44] J. Vanschoren, J. N. van Rijn, B. Bischl, and L. Torgo. Openml: networked science in machine learning. arXiv, 1407.7722v1, 2014.
|
| 288 |
+
[45] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In NIPS, 2017.
|
| 289 |
+
[46] R. Wang, B. Fu, G. Fu, and M. Wang. Deep & cross network for ad click predictions. In ADKDD, 2017.
|
| 290 |
+
|
| 291 |
+
# Checklist
|
| 292 |
+
|
| 293 |
+
1. For all authors...
|
| 294 |
+
|
| 295 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 296 |
+
(b) Did you describe the limitations of your work? [Yes] See the analysis in subsection 5.1.
|
| 297 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] The work focuses on a generic aspect of deep learning models.
|
| 298 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 299 |
+
|
| 300 |
+
2. If you are including theoretical results...
|
| 301 |
+
|
| 302 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] We do not include theoretical results.
|
| 303 |
+
(b) Did you include complete proofs of all theoretical results? [N/A] We do not include theoretical results.
|
| 304 |
+
|
| 305 |
+
3. If you ran experiments...
|
| 306 |
+
|
| 307 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See the supplementary material.
|
| 308 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] The supplementary material includes the script used to create data splits. The hyperparameters are either explicitly described in subsection 4.2 and supplementary material, or tuned as described in subsection 4.2.
|
| 309 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We provide standard deviations in the supplementary material, see Table 18 and see Table 19
|
| 310 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] The experiment reports included in the supplementary material provide the information about the used hardware and execution times.
|
| 311 |
+
|
| 312 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 313 |
+
|
| 314 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Appendix C.
|
| 315 |
+
(b) Did you mention the license of the assets? [Yes] In the README.md file in the supplementary material, we refer to the original licenses of the used datasets.
|
| 316 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] We do not provide new datasets.
|
| 317 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We use publicly available datasets.
|
| 318 |
+
|
| 319 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We use publicly available datasets.
|
| 320 |
+
|
| 321 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 322 |
+
|
| 323 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] We did not use crowdsourcing. We did not conduct research with human subjects.
|
| 324 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] We did not use crowdsourcing. We did not conduct research with human subjects.
|
| 325 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] We did not use crowdsourcing. We did not conduct research with human subjects.
|
md/dev/s_PJMEGIUfa/s_PJMEGIUfa.md
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LIFT: Language-Interfaced Fine-Tuning for Non-Language Machine Learning Tasks
|
| 2 |
+
|
| 3 |
+
Tuan Dinh⇤, Yuchen Zeng⇤, Ruisu Zhang, Ziqian Lin, Michael Gira, Shashank Rajput, Jy-yong Sohn, Dimitris Papailiopoulos, Kangwook Lee
|
| 4 |
+
|
| 5 |
+
University of Wisconsin-Madison, USA
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Fine-tuning pretrained language models (LMs) without making any architectural changes has become a norm for learning various language downstream tasks. However, for non-language downstream tasks, a common practice is to employ task-specific designs for input, output layers, and loss functions. For instance, it is possible to fine-tune an LM into an MNIST classifier by replacing the word embedding layer with an image patch embedding layer, the word token output layer with a 10-way output layer, and the word prediction loss with a 10-way classification loss, respectively. A natural question arises: Can LM fine-tuning solve non-language downstream tasks without changing the model architecture or loss function? To answer this, we propose Language-Interfaced Fine-Tuning (LIFT) and study its efficacy and limitations by conducting an extensive empirical study on a suite of non-language classification and regression tasks. LIFT does not make any changes to the model architecture or loss function, and it solely relies on the natural language interface, enabling “no-code machine learning with LMs.” We find that LIFT performs comparably well across a wide range of low-dimensional classification and regression tasks, matching the performances of the best baselines in many cases, especially for the classification tasks. We also report experimental results on the fundamental properties of LIFT, including inductive bias, robustness, and sample complexity. We also analyze the effect of pretraining on LIFT and a few properties/techniques specific to LIFT, e.g., context-aware learning via appropriate prompting, calibrated predictions, data generation, and two-stage finetuning. Our code is available at https://github.com/UW-Madison-Lee-Lab/ LanguageInterfacedFineTuning.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Deep neural networks have been highly successful across a multitude of domains, from computer vision $\mathbb { \left[ 1 \right] } , \mathbb { \left[ 2 \right] }$ and natural language processing [3, 4], to game playing [5, 6]. Most advances in deep learning have come with a variety of domain-specific designs for network architectures, such as convolutional filters [7, 8, 9] for vision tasks, or recurrent modules [10, 11] and attention mechanisms $\mathbb { L 2 } \mathbb { L 3 }$ in the context of natural language processing. A domain-and-modality agnostic model that can be adapted to solve tasks across different modalities and domains has become a desideratum $\textcircled { | | 4 | }$ , motivating great efforts in transfer learning $\mathbb { \left. \overline { { 1 5 } } \right. }$ and multi-modal learning $\mathbb { \lVert \boldsymbol { 1 6 } \rVert }$ . Recently, transformer-based language models (LMs) [13, 17, 18, 19] exhibited impressive versatility across different domains and modalities. They have shown great performances for various language-based tasks $\pmb { \left. 2 0 \right. }$ such as question answering $| \overline { { | 2 1 | } } | \overline { { 2 2 | } }$ , or commonsense reasoning $\pmb { \mathbb { Z } 3 } \|$ . They have also been applied to non-language modalities [18]. For instance, GPT-2 [17] pretrained on language data can be efficiently fine-tuned to perform image classification and numerical computation $\bar { \mathbb { B } }$ .
|
| 14 |
+
|
| 15 |
+
When downstream tasks are language-based tasks, adapting pretrained LMs can be achieved without modifying the models’ architecture. Typically, this adaptation is enabled via simple fine-tuning $\pmb { \Vert 2 4 }$
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: A high-level illustration of the Language-Interfaced Fine-Tuning (LIFT) framework. LIFT has a two-phase procedure: (1) converting the dataset into sentences and (2) fine-tuning the pretrained language model (e.g., GPT) on the obtained sentences. This figure visualizes how LIFT can be applied to the Iris classification task. We first convert the Iris dataset into plain English sentences (left). Since feature names and the task description are available for this task, one could incorporate them as part of the prompt (as option 1 in the figure). ( $\mathrm { I n } { \mathrm { S e c . } } \boxed { 4 . 1 } ,$ we show that adding such contextual information to prompts helps LIFT achieve higher predictive accuracy.) One may also choose to use a simpler prompt with a generic naming convention $( x _ { 1 } , x _ { 2 } , \ldots , x _ { d } )$ for $p$ features (as option 2 in the figure). After the sentence conversion step, LIFT fine-tunes a pretrained LM with the sentence set without making any changes to model architecture or loss. At inference time, we convert the test samples to a sentence form using the same prompt, excluding the label part. LIFT performs surprisingly well in various non-language regression/classification tasks, and we summarize our main findings in Table 3. Note that to obtain a model for a given task, all we need here is to design proper sentence templates for LIFT and no changes to architecture or loss functions are needed.
|
| 19 |
+
|
| 20 |
+
25, 26, 27] or in-context few-shot learning methods $\mathbb { R 8 } \mathbb { R 9 }$ . However, not altering the architecture may pose a limitation for transferring to non-language tasks. As their input and output formats are not in some language form, adapting LMs to these domains may seem to require architectural changes. Indeed, it has been a common practice to re-design the input/output layers and loss functions to accommodate a different predictive task. For instance, to adapt GPT-2 $\dot { \mathbb { R } } \dot { \mathbb { I } }$ to other modalities, the frozen pretrained transformer $[ \overline { { 1 8 } } ]$ adds new input/output layers to handle different types of input/output. To make such changes, one must have a good understanding of the underlying principles of LMs and an ability to make proper modifications at the code level.
|
| 21 |
+
|
| 22 |
+
A natural question that arises is whether such changes are necessary. In other words,
|
| 23 |
+
|
| 24 |
+
<table><tr><td>Does language model fine-tuning work for non-language tasks without changing the architecture or loss function at all?</td></tr></table>
|
| 25 |
+
|
| 26 |
+
To answer this, we consider a simple fine-tuning procedure for LMs, referred to as LanguageInterfaced Fine-Tuning (LIFT). This procedure can be used to learn predictors for any classification or regression task. LIFT runs in two phases: (1) converting labeled samples into sentences, and (2) fine-tuning pretrained LMs on the sentence dataset without altering the architecture or loss function.
|
| 27 |
+
|
| 28 |
+
Fig. 1 illustrates how we fine-tune GPT with LIFT to solve the Iris classification task $\pmb { \mathbb { B } } 0 \|$ . LIFT first converts each labeled sample into a sentence with two options. The first option is to incorporate feature names and the task description into the sentence template. In this example, we could convert a training sample r into “An Iris plant with sepal length r.sepal_length, sepal width r.sepal_width, petal length r.petal_length, and petal width r.petal_width is r.class.” Here, we use the dot notation, i.e., $\mathbf { r } { \star }$ denotes the string conversion of the corresponding attribute of sample r. One may also adopt a simpler (and more generic) sentence template, such as “If $\mathbf { x } 1 { = } \mathbf { r } { . } \mathbf { x } 1$ , $\mathbf { X } { \boldsymbol { 2 } } { = } \mathbf { r } { . } \mathbf { X } { \boldsymbol { 2 } }$ , . . . , $\mathbf { \boldsymbol { x } } \mathbf { p } { = } \mathbf { r } { . } \mathbf { x } \mathbf { p }$ , then $\mathrm { y } { = } \mathrm { r } . \mathrm { y }$ ,” if there are $p$ features. We then fine-tune LMs without changing either architecture or loss function. Then, we perform inference as follows. LIFT first converts test samples into sentences using the same template while leaving the prediction part empty. It then feeds the converted sentences as prompts to the fine-tuned model. The output tokens are parsed to provide the final predictions.
|
| 29 |
+
|
| 30 |
+
Our work empirically shows that LIFT can provide high-accuracy solutions for a variety of nonlanguage tasks. Fig. $\boxed { 2 }$ shows examples of real functions learned by GPT-J models $\textcircled { \scriptsize { 1 3 1 } }$ fine-tuned using LIFT given 1000 samples. Recall that LIFT does not require any changes in the architecture or loss function, Thus, our findings show that such changes to architecture/loss function might not be necessary, even when the target predictive task is not a language task. Thus, LIFT can be almost perceived as a “no-code machine learning” framework as the data-to-sentence conversion is extremely straightforward even without extensive programming skills and machine learning backgrounds.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Approximating various functions with LIFT using GPT-J. We visualize the target functions (first row) and the predictor functions learned by LIFT on GPT-J (second row). Blue dots show the 1000 training samples. One can observe that LIFT well approximates the target functions.
|
| 34 |
+
|
| 35 |
+
Motivated by these intriguing properties, we investigate the efficacy and limitations of LIFT on non-language tasks by conducting an extensive empirical study on a suite of classification and regression tasks. First, we observe that LIFT performs well across a wide range of low-dimensional classification and regression tasks. In most cases, it nearly matches (or slightly outperforms) the best baselines’ performance. To further understand LIFT, we conduct experiments testing the fundamental learning properties, e.g., its inductive bias, sample efficiency, ability to extrapolate, worst- and average-case noise robustness, and how the pretraining of LMs affects LIFT. Third, we study a few unique properties specific to LIFT, e.g., context-aware learning with task-specific prompting, prediction calibration, and the additional use of LIFT for data generation. Lastly, to improve upon the basic fine-tuning, we employ a few techniques: two-stage fine-tuning with synthetic pretext tasks and data augmentation. Both techniques improve the performance of LIFT. We finally provide discussions on limitations and future investigations of LIFT.
|
| 36 |
+
|
| 37 |
+
Scope of the study. Our work proposes the use of natural language interface for learning with LMs via LIFT. We emphasize that our goal is not to achieve the state-of-the-art performance, but to investigate thoroughly: (i) what LIFT can and cannot do, (ii) properties of models fine-tuned via LIFT, and (iii) whether we can improve LIFT with advanced techniques.
|
| 38 |
+
|
| 39 |
+
# 2 Methodology and Experimental Setup
|
| 40 |
+
|
| 41 |
+
LIFT training. To fine-tune a pretrained LM with LIFT on a target supervised learning task, we apply two steps: (1) convert each sample into a sentence with a fixed template, and (2) fine-tune LMs with sentence datasets. We use the default cross-entropy loss for token prediction in LMs. Our generic template (without feature names and task description) for sample r is
|
| 42 |
+
|
| 43 |
+
if r has $p$ attributes. Here, we use the separator convention recommended by OpenAI [32] – “###” for question/answer separation, and $" \ @ \ @ \odot "$ for end of generation. When attributes names and task descriptions are available, one can use a more informative prompt (shown in Fig. $^ { 1 ) }$ with all actual prompts are provided in Sec. 4.1. We report learning curves of LIFT on several tasks in Appendix E.5.
|
| 44 |
+
|
| 45 |
+
LIFT inference. For inference, we use the same prompt template except for the answer and end-of-answer parts. Once the fine-tuned LM completes the test prompt, we simply parse the output tokens. For classification, we simply compare the generated text with the string representation of the class names. For regression, we convert the generated string into a number. For instance, with the output being $\scriptstyle \cdots y = 1 0 . 3 5 \ @ \ @ \ @$ extratokens”, we split the output sentence by the stop separator $" \ @ \ @ \odot "$ into two parts. Taking the first part $\cdot y { = } 1 0 . 3 5 '$ , we parse the value $" 1 0 . 3 5 "$ as our final prediction.
|
| 46 |
+
|
| 47 |
+
The generated output might be invalid. For classification tasks, the output string may not match any actual class, which we declare as misclassification. Note that one may obtain better accuracy by returning its closest class using string metrics. For regression tasks, we consider output invalid if the string-to-number parsing fails. In these cases, we adjust the generation randomness by increasing the decoding temperature [33, 34, 35] from 0 (deterministic mode) to 0.75 (random mode). We repeat the inference up to five times, then return the average value of the training set if all attempts fail. Note that invalid output occurs very rarely (less than or around $1 \%$ in most tested cases).
|
| 48 |
+
|
| 49 |
+
For evaluation metrics, we use accuracy for classification tasks, and RMSE, RAE errors for regression tasks, where $\begin{array} { r } { \mathrm { R A E } = \sum _ { i = 1 } ^ { n } | \hat { y } _ { i } - y _ { i } | / \sum _ { i = 1 } ^ { n } | \frac { 1 } { n } \sum _ { j = 1 } ^ { n } y _ { j } - y _ { i } | } \end{array}$ and $\mathrm { R M S E } = \sqrt { \textstyle \sum _ { i = 1 } ^ { n } ( \hat { y } _ { i } - { y } _ { i } ) ^ { 2 } / n }$ on each dataset $\mathcal { D } = \{ ( \boldsymbol { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ with $n$ =1 n j=1 samples, features $\pmb { x } \in \mathcal { X } \subset \mathbb { R } ^ { p }$ i=1, and outcome $y$ .
|
| 50 |
+
|
| 51 |
+
Pretrained LMs. We apply LIFT on two pretrained LMs: GPT-J $\textcircled { \scriptsize { 1 3 1 } }$ and GPT-3 [19]. To fine-tune GPT-J, we use LoRA $\pmb { \bigtriangledown }$ , a parameter-efficient method that constrains weight matrix updates to be low-rank. For experiments on GPT-J, we used $\mathtt { p 3 . 8 x 1 }$ arge and $\mathtt { p 3 . 2 x 1 }$ arge instances from AWS and RTX3090 GPUs in the local server. Since GPT-3 is not fully publicly available, we use the API provided by OpenAI to perform black-box GPT-3 fine-tuning. More details are in Appendix C.2.1.
|
| 52 |
+
|
| 53 |
+
Datasets. We design and select a wide range of datasets to better understand the behavior of LIFT. For classification, we use three types of non-language data: low-dimensional synthetic datasets, real tabular datasets in OpenML $\dot { \left\| 3 6 \right\| }$ , and vision datasets (MNIST $\pmb { \Vert 3 7 } \Vert$ , Fashion-MNIST $\left[ \left[ 3 8 \right] \right]$ and their permuted variants $\mathbb { B } 9 \mathbb { I } ,$ ). For regression, we use both synthetic and real datasets. For synthetic datasets, we defined samples $( { \pmb x } _ { i } , y _ { i } )$ of input-output pair as $\mathbf { y } \sim f ( \mathbf { x } ) + \mathcal { N } ( 0 , \sigma ^ { 2 } )$ , where $\sigma ^ { \mathrm { 2 } } \geq 0$ is the noise level. Unless otherwise stated, we sample the feature x uniformly from a hypercube $[ L , U ] ^ { p }$ , where $L$ and $U$ are minimum/maximum feature values, and $p$ is the number of features. Following the suggestion by $\mathbb { H O }$ , we consider various functions $f$ for regression tasks: (i) linear function, (ii) quadratic function, (iii) exponential function, (iv) cosine function, (v) $\ell { 1 }$ -norm function, and (vi) piece-wise linear function. Their 2D visualizations are provided in the first row of Fig. 2. We also use four real datasets: Medical Insurance (Insurance) $\pmb { \| } \mathbf { \varPsi }$ , Combined Cycle Power Plant (CCPP) [42], Servo $\mathbb { \lVert \underline { { 4 3 } } \rVert }$ , and Student Performance (Student) $[ \textcircled { 4 4 } ]$ . More details are included in Appendix C.1.
|
| 54 |
+
|
| 55 |
+
Baselines. We consider standard learning algorithms [45, 46]. For classification, we use logistic regression $( L o g R e g )$ , decision tree $( D T )$ , $\mathbf { k }$ -nearest neighbor (KNN), support vector machine with Gaussian kernel (SVM), a four-layer ReLU neural network $( M L P )$ with 200 neurons per hidden layer, random forest $( R F )$ , and XGBoost $( X G )$ . We also use the majority class classifier (MCC) that outputs the most dominant class. For regression, we use polynomial regression $( P R )$ , kernel ridge regression $( K R )$ with radial basis function kernel, $k$ -nearest neighbors (KNN), a three-layer ReLU neural network $( M L P )$ with 50 hidden neurons per each layer, Gradient Boosting Trees $( G B T )$ , random forest $( R F )$ , and Gaussian process $( G P )$ . For hyperparameter selection, we apply the grid search on a set of parameters’ values and use cross-validation on the training set (see details in Appendix $\mathbf { C } . 2 )$ .
|
| 56 |
+
|
| 57 |
+
# 3 Basic Findings of LIFT
|
| 58 |
+
|
| 59 |
+
Table $3$ summarizes our main findings. We also study sample complexity $( { \mathrm { S e c . ~ } } 3 . 2 )$ , comparison with in-context learning $( \mathrm { S e c } . 3 . 3 )$ , models’ decision boundaries (Sec. 3.4), and the effect of LMs’ pretraining on LIFT (Sec. 3.6). Appendix $\mathrm { ~ E ~ }$ provides additional results, including the effect of input and output layers $\underline { { ( \mathbb { E . 1 } ) } }$ , model size $\left. \overline { { \mathbb { E } . 2 } } \right.$ , and LIFT for Ridge regression (E.4)
|
| 60 |
+
|
| 61 |
+
# 3.1 How Well Does LIFT Perform on Standard ML Tasks?
|
| 62 |
+
|
| 63 |
+
Classification. Table 4 compares classification accuracies between algorithms on a wide range of tasks. We observe that LIFT achieves comparable performance to most baselines. In most cases, LIFT/GPT ranks highly in the top three best-performing methods. We find that LIFT can learn non-linear relationships between features and the responses: LIFT/GPT-3 achieves $8 1 . 1 7 \%$ accuracy on the circle dataset, while logistic regression failed to perform better than the MCC $( 5 0 \% )$ . As the difficulty of tasks varies, which can be estimated by the average performance of baselines, LIFT also suffers from performance degradation. LIFT can perform comparably well even when the number of features is as large as hundreds, though the limited number of tokens as inputs to LMs restricts the number of features LIFT can input. However, when the number of classes is large (say 100s), both LIFT/GPT models have lower accuracies than many baselines, though they manage to be better than MCC. For instance, on the 100-class Margin dataset, the accuracy gap between LIFT/GPT-J and the best algorithm (RBF-SVM) is nearly $30 \%$ . Note that LIFT can directly use raw data while most baselines require feature scaling and normalization for good performance. More results are provided in Appendix D.1.1, including comparisons with methods leveraging larger models.
|
| 64 |
+
|
| 65 |
+
Regression. Tables 19 and $\bigstar$ present our function approximation comparison. For the lowdimensional cases, LIFT is comparable to baselines. Still, it fails to beat the strongest baselines, such as GP, as GPT models measure the error by comparing tokens instead of measuring how close the prediction values are to true values. We conjecture that we can improve our performance by level encoding, i.e., representing numerical values as binary values. We also investigate the interpolation and extrapolation of LIFT and defer the details to Sec. D.1.1. All methods fail to extrapolate and interpolate well for all functions, and the interpolation performance of LIFT is only good in the linear regression case. Interestingly, LIFT tends to output seen values (from training data) for extrapolation.
|
| 66 |
+
|
| 67 |
+
Table 3: Summary of the main findings.
|
| 68 |
+
|
| 69 |
+
<table><tr><td>Topic</td><td>Findings</td></tr><tr><td>Overall performance</td><td>On various classification tasks,LIFT achieves accuracies comparable to strong baselines (Table4).For regression, LIFT well approximates different types of low-dimensional functions (Fig.2 but does not perform well for high-dimensional cases (Table 四</td></tr><tr><td>Robustness</td><td>For regression,LIFT is robust to outliers in training data (Fig. .28). For classification, LIFT is comparable to baselines under label corruption on training data (Fig.29) but more vulnerable to feature corruption on test data (Table. 3</td></tr><tr><td>Context-aware learning</td><td>We can improve LIFT on classification tasks by designing prompts to specify feature names and the target task.The improvement is significant when the description of the feature names and the target task can be interpreted with common knowledge (Table9).</td></tr><tr><td>Two-stage training</td><td>Warming up LIFT with pretext tasks using synthetic data improves the prediction performance, especially in the low-data regime (Fig. 四</td></tr><tr><td>Data augmentation</td><td>For classification tasks,training with augmented data significantly improves the tolerance ofLIFT against perturbed test data (Table 12</td></tr></table>
|
| 70 |
+
|
| 71 |
+
Table 4: Accuracies (") on classification datasets. We evaluate LIFT/GPTs on 2D synthetic data, tabular data in OpenML $\pmb { \Vert 3 6 \Vert }$ , and image data, varying number of features $( p )$ and data classes (c). Overall, LIFT/GPTs perform comparably well across tasks, adapting to non-linear datasets (circles, two circles) beyond the capacity of logistic regression. For OpenML datasets, they achieve competitive performances with the best methods, e.g., XGBoost). The performance degrades when more classes are given, e.g., $c { = } 1 0 0$ . They achieve competitive accuracies on both MNIST and Fashion MNIST. Note that MNIST’s classes are not fully balanced; thus, MCC achieves $1 1 . 3 5 \%$ instead of $10 \%$ . Table 17 provides the full comparison with all baselines (KNN, MLP, Random Forest).
|
| 72 |
+
|
| 73 |
+
<table><tr><td>Dataset (ID)</td><td>p/c</td><td>MCC</td><td>LogReg</td><td>DT</td><td>RBF-SVM</td><td>XG</td><td>LIFT/GPT-J</td><td>LIFT/GPT-3</td></tr><tr><td colspan="9">Synthetic Data</td></tr><tr><td>circles (3)</td><td>2/2</td><td>50.00</td><td>48.58±1.94</td><td>77.42±0.24</td><td>83.08±0.59</td><td>81.42±0.31</td><td>79.95±1.53</td><td>81.17±0.42</td></tr><tr><td>two circles (6)</td><td>2/2</td><td>50.00</td><td>49.83±4.18</td><td>75.50±0.20</td><td>80.00±0.54</td><td>79.25±0.35</td><td>75.92±1.65</td><td>81.42±0.82</td></tr><tr><td>blobs (2)</td><td>2/4</td><td>25.00</td><td>96.75±0.00</td><td>96.08±0.82</td><td>96.75±0.00</td><td>96.17±0.12</td><td>96.17±0.59</td><td>96.67±0.24</td></tr><tr><td>moons (4)</td><td>2/4</td><td>50.00</td><td>88.58±0.12</td><td>99.25±0.41</td><td>100.00±0.00</td><td>99.83±0.12</td><td>99.58±0.42</td><td>100.00±0.00</td></tr><tr><td>9Clusters (1)</td><td>2/9</td><td>11.25</td><td>100.00±0.00</td><td>100.00±0.00</td><td>100.00±0.00</td><td>100.00±0.00</td><td>99.75±0.00</td><td>100.00±0.00</td></tr><tr><td colspan="9">Tabular Data (OpenML)</td></tr><tr><td>Customers (1511)</td><td>8/2</td><td>68.18</td><td>87.12±0.54</td><td>85.98±0.53</td><td>86.36±0.00</td><td>85.23±0.00</td><td>85.23±1.61</td><td>84.85±1.42</td></tr><tr><td>Pollution (882)</td><td>15/2</td><td>50.00</td><td>58.33±11.79</td><td>77.78±3.93</td><td>58.33±6.81</td><td>63.89±7.86</td><td>63.89±3.93</td><td>63.89±7.86</td></tr><tr><td>Spambase (44)</td><td>57/2</td><td>60.59</td><td>93.27±0.00</td><td>90.7±0.14</td><td>93.70±0.00</td><td>95.87±0.00</td><td>94.03±0.54</td><td>94.90±0.36</td></tr><tr><td>Hill- Valley (1479)</td><td>100/2</td><td>49.79</td><td>77.78±0.00</td><td>56.38±0.89</td><td>68.72±0.00</td><td>59.26±0.00</td><td>100.00±0.20</td><td>99.73±0.19</td></tr><tr><td>IRIS (61)</td><td>4/3</td><td>33.33</td><td>96.67±0.00</td><td>97.77±3.85</td><td>100.00±0.00</td><td>100.00±0.00</td><td>96.67±0.00</td><td>97.0±0.00</td></tr><tr><td>TAE(48)</td><td>5/3</td><td>35.48</td><td>45.16±4.56</td><td>65.59±5.49</td><td>53.76±6.63</td><td>66.67±8.05</td><td>61.29±6.97</td><td>65.59±6.63</td></tr><tr><td>CMC (23)</td><td>9/3</td><td>42.71</td><td>49.49±0.83</td><td>56.72±0.32</td><td>56.50±0.97</td><td>52.43±0.42</td><td>49.83±0.28</td><td>57.74±0.89</td></tr><tr><td>Wine (187)</td><td>13/3</td><td>38.89</td><td>100.00±0.00</td><td>93.52±2.62</td><td>100.00±0.00</td><td>97.22±0.00</td><td>93.52±1.31</td><td>92.59±1.31</td></tr><tr><td>Vehicle (54)</td><td>18/4</td><td>25.88</td><td>80.39±1.00</td><td>63.92±2.37</td><td>81.18±0.48</td><td>73.14±0.28</td><td>64.31±2.37</td><td>70.20±2.73</td></tr><tr><td>LED (40496)</td><td>7/10</td><td>11.00</td><td>68.67±0.94</td><td>66.33±2.87</td><td>68.00±0.82</td><td>66.00±0.82</td><td>65.33±0.47</td><td>69.33±2.05</td></tr><tr><td>OPT(28)</td><td>64/10 216/10</td><td>10.14</td><td>96.53±0.22 97.67±0.12</td><td>89.8±1.09</td><td>97.95±0.00</td><td>97.48±0.17</td><td>98.22±0.11</td><td>98.99±0.30</td></tr><tr><td>Mfeat (12)</td><td></td><td>10.00</td><td></td><td>87.67±1.05</td><td>98.83±0.24</td><td>96.75±0.00</td><td>94.17±1.75</td><td>93.08±0.24</td></tr><tr><td>Margin (1491) Texture (1493)</td><td>64/100</td><td>0.94 0.94</td><td>81.35±0.15 81.67±0.97</td><td>43.86±1.21 46.88±1.93</td><td>81.98±0.30 83.44±0.89</td><td>70.21±0.29</td><td>50.23±1.33</td><td>59.37±0.92</td></tr><tr><td></td><td>64/100</td><td></td><td></td><td></td><td></td><td>70.73±1.41</td><td>50.32±2.18</td><td>67.50±1.42</td></tr><tr><td colspan="9">Image Data</td></tr><tr><td>MNIST</td><td></td><td>11.35</td><td>91.95±0.69</td><td>87.42±0.64</td><td>97.70±0.97</td><td>97.69±0.04</td><td>97.01±1.15</td><td>98.15±0.67</td></tr><tr><td>Permuted MNIST</td><td>784/10</td><td>11.35</td><td>92.58±0.04</td><td>87.87±0.69</td><td>98.06±0.31</td><td>97.62±0.09</td><td>95.80± 0.07</td><td>96.25±0.35</td></tr><tr><td>Fashion MNIST</td><td></td><td>10.00</td><td>85.59±0.09</td><td>80.52±0.40</td><td>90.59±0.02</td><td>90.19±0.04</td><td>85.10 ± 0.19</td><td>90.18 ±0.12</td></tr><tr><td>Permuted F-MNIST</td><td></td><td>10.00</td><td>84.95±0.84</td><td>79.91±0.93</td><td>88.04±1.69</td><td>89.93±0.14</td><td>82.25±0.27</td><td>88.92±0.71</td></tr></table>
|
| 74 |
+
|
| 75 |
+
# 3.2 How Many Samples Does LIFT Need?
|
| 76 |
+
|
| 77 |
+
We investigate whether LIFT is sample efficient. Fig. 25 in Appendix shows the sample complexity evaluation on classification and regression tasks. We find that GPT models can be quickly fine-tuned to learn new tasks with LIFT. For classification, as the number of classes increases (left to right columns in Fig. $2 5 \mathrm { a } )$ , LIFT does need more samples for adaptation, probably because the data input and output spaces are more complex to learn. For regression tasks, we find that 1000 samples are sufficient for LIFT to have a small RMSE, similar to other baselines. There exist some functions (e.g., cosine and piecewise) where LIFT has lower sample complexity than popular baselines.
|
| 78 |
+
|
| 79 |
+
Table 5: Comparison of accuracies (") between ICL and fine-tuning with LIFT on OpenML datasets. “LIFT/Full-Data” and “LIFT/Subset” represent LIFT on the full dataset and and its subset used correspondingly in the ICL setting (number of prompts). Here, the size of subset is chosen to satisfy the LMs’ context length. Overall, LIFT/GPTs on full data achieve the best performances. However, when using the same number of samples, LIFT and ICL are more comparable in most cases. Note that both methods may be worse than MCC due to the limited training data in some cases.
|
| 80 |
+
|
| 81 |
+
<table><tr><td rowspan="2">Dataset (ID)</td><td rowspan="2">#Prompts</td><td rowspan="2">MCC</td><td colspan="3">GPT-J</td><td colspan="3">GPT-3</td></tr><tr><td>In-Context</td><td>LIFT/Subset</td><td>LIFT/Full-data</td><td>In-Context</td><td>LIFT/Subset</td><td>LIFT/Full-ata</td></tr><tr><td>Breast (13)</td><td>35</td><td>70.69</td><td>56.90±19.51</td><td>58.62±2.44</td><td>64.94±11.97</td><td>62.07±1.41</td><td>70.69±0.00</td><td>71.26±1.62</td></tr><tr><td>TAE(48)</td><td>50</td><td>35.48</td><td>34.33±1.47</td><td>32.26±9.50</td><td>61.29±4.56</td><td>37.64±4.02</td><td>33.33±1.52</td><td>65.59±6.63</td></tr><tr><td>Vehicle (54)</td><td>14</td><td>25.88</td><td>25.49±0.55</td><td>26.04±1.69</td><td>64.31±2.37</td><td>28.82±2.10</td><td>23.73±2.27</td><td>70.20±2.73</td></tr><tr><td>Hamster (893)</td><td>43</td><td>53.33</td><td>48.89±3.14</td><td>60.00±10.88</td><td>55.55±16.63</td><td>57.78±6.29</td><td>53.33±0.00</td><td>53.33±0.00</td></tr><tr><td>Customers (1511)</td><td>29</td><td>68.18</td><td>56.06±17.14</td><td>59.85±2.84</td><td>85.23±1.61</td><td>60.61±1.42</td><td>63.26±6.96</td><td>84.85±1.42</td></tr><tr><td>LED (40496)</td><td>33</td><td>68.67</td><td>10.00±0.82</td><td>13.04±3.27</td><td>65.33±0.47</td><td>8.00±1.63</td><td>11.33±2.62</td><td>69.33±2.05</td></tr></table>
|
| 82 |
+
|
| 83 |
+
# 3.3 Language-Interfaced Learning: LIFT versus In-Context Learning (ICL)
|
| 84 |
+
|
| 85 |
+
Beyond fine-tuning (with LIFT), our language-interfaced learning framework can be used for other learning methods for LMs, including in-context learning (ICL) [47, 48, 19] that performs inference on new tasks without fine-tuning by conditioning on a few training examples. Table $5$ compares the classification performances between (a) ICL, (b) LIFT trained on a subset with $n$ samples, and (c) LIFT trained on the full dataset. Note that the number of training samples $( n )$ used for ICL depends on the context length of given LMs. As we can see, LIFT using the full dataset always achieves the best performances. However, LIFT/Subset and ICL are more comparable in most cases when they use the same number of training samples, which are sufficiently small for ICL methods to fit in LMs.
|
| 86 |
+
|
| 87 |
+
Remark. One can replace fine-tuning with ICL in our language-interfaced procedure when the target tasks require fewer training samples.
|
| 88 |
+
|
| 89 |
+
# 3.4 Can We Understand the Inductive Biases of Language Models via LIFT?
|
| 90 |
+
|
| 91 |
+
To better understand LIFT/GPTs’ inductive biases, we investigate their classification decision boundaries varying the boundaries’ complexity, as shown in Fig. 6. We first train a binary-class neural network and use its snapshots at different training epochs to construct datasets having decision boundaries at different complexity levels (first column in Fig. 6) We observe that LIFT/GPT models adapt well to three boundaries and capture their rough shapes. Furthermore, their boundary shapes are axis-parallel, similar to the boundary of tree-based classifiers. They also show a lot of fractals similar to the observations on some convolution neural networks [49]. See Appendix D.1.3 for results of 3-class and 5- class datasets and quantitative measurements.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 6: Decision boundary visualization. We use three snapshots of a trained network to construct datasets having labels as their predictions (the first column). Top to bottom: snapshots with more training epochs, corresponding to more complex boundaries. LIFT/GPTs adapt well on different boundaries.
|
| 95 |
+
|
| 96 |
+
# 3.5 How Robust is LIFT?
|
| 97 |
+
|
| 98 |
+
We investigate the robustness of LIFT against the outlier samples in training data and the feature corruption on test data. Appendix $\underline { { \mathbb { D . 1 . 4 } } }$ provides additional experimental results, including the robustness for the case of label corruption on training data and class-imbalanced data.
|
| 99 |
+
|
| 100 |
+
Robustness to outliers in training data. We consider regression tasks where we have outliers whose outcome $y$ is not consistent with the majority of samples in terms of fitting $( { \pmb x } , y )$ . Fig. $2 8 \mathrm { a }$ compares RAE values of methods with and without outliers $2 \%$ outliers in the training set). LIFT/GPT models are among the most robust ones: their performances are almost unaffected, while baselines suffer huge performance drops. Furthermore, we evaluate models under various percentages of outliers $1 \%$ , $2 \%$ , $5 \%$ , $10 \%$ , $20 \%$ ), as shown in Fig. $2 8 \mathsf { b }$ . Compared to the robust baselines (median-3NN and median-5NN) [50], LIFT/GPT-3 is comparably robust, while LIFT/GPT-J is more vulnerable when more outliers are present.
|
| 101 |
+
|
| 102 |
+
Table 8: Accuracies (") of LIFT with different LMs. We compare variants of LIFT with different LMs: LIFT/GPTs using GPTs pretrained on natural language data (our models), LIFT/Rand-GPT-J using a randomly initialized GPT-J, LIFT/CodeGen and LIFT/CodeParrot using LMs pretrained on programming language data, and LIFT/Gibberish using GPT-J fine-tuned on gibberish data.
|
| 103 |
+
|
| 104 |
+
<table><tr><td>Dataset (ID)</td><td>MCC</td><td>LIFT/GPT-3</td><td>LIFT/GPT-J</td><td>LIFT/Rand-GPT-J</td><td>LIFT/Gibberish</td><td>LIFT/CodeGen</td><td>LIFT/CodeParrot</td></tr><tr><td>Blobs (2)</td><td>25.00</td><td>96.67± 0.24</td><td>96.17± 0.59</td><td>25.65± 1.58</td><td>96.42± 0.24</td><td>93.67± 0.72</td><td>93.39± 1.82</td></tr><tr><td>Two Circles (6)</td><td>50.00</td><td>81.42± 0.82</td><td>75.92± 1.65</td><td>49.88± 5.01</td><td>68.67± 1.50</td><td>53.02± 0.66</td><td>50.08± 2.47</td></tr><tr><td>Iris (61)</td><td>33.33</td><td>97.0± 0.00</td><td>96.67±0.00</td><td>27.78± 20.79</td><td>94.44± 1.57</td><td>43.31±6.67</td><td>60.00± 8.82</td></tr><tr><td>Customers (1511)</td><td>68.18</td><td>84.85± 1.42</td><td>85.23± 1.61</td><td>52.47± 7.15</td><td>67.43± 1.42</td><td>45.96± 8.96</td><td>43.11± 3.34</td></tr><tr><td>Wine (187)</td><td>38.89</td><td>92.59± 1.31</td><td>93.52± 1.31</td><td>22.22± 15.71</td><td>84.26± 3.46</td><td>77.78± 0.00</td><td>33.88±3.87</td></tr><tr><td>LED (40496)</td><td>11.0</td><td>69.33± 2.05</td><td>65.33± 0.47</td><td>11.68± 4.44</td><td>72.67± 1.25</td><td>11.00± 4.00</td><td>23.46± 13.85</td></tr></table>
|
| 105 |
+
|
| 106 |
+
Robustness to feature corruption on test data. Given a clean test data $( { \pmb x } , y )$ having feature $_ { \textbf { \em x } }$ and label $y$ , we explore whether adding small perturbation $\delta$ on the feature changes the performance; we measure the accuracy of LIFT on perturbed data $( \pmb { x } + \pmb { \delta } , y )$ . We apply transfer attack $\mathbb { \left[ \left. 5 1 \right] \right. }$ since we do not have full access to the GPT-3 model, and finding adversarial examples in the discrete input space is complex [52]. Table 7 reports robustness results on MNIST classification under PGD attacks transferred from LeNet-5. The perturbation radius is set to $\varepsilon \in [ 0 , 0 . 0 1 , 0 . 1 , 0 . 3 ]$ where MNIST pixel value is within [0,1]. We compare three networks: LeNet-5, MLP (2 hidden layers with 300 and 100 neurons), and LIFT/GPT-3. When $\epsilon \overset { \cdot } { \in } \lbrace 0 . 0 1 , 0 . 1 \rbrace$ , LIFT/GPT-3 tolerates random noise (as in Table $\textcircled { 3 3 }$ but cannot tolerate transferred adversarial attack, implying that the adversarial attack on LeNet-5 is transferred to LIFT/GPT-3.
|
| 107 |
+
|
| 108 |
+
Table 7: Accuracies (") under the perturbation on the input feature of MNIST data. See the full results in Table 33 in Appendix D.1.4.
|
| 109 |
+
|
| 110 |
+
<table><tr><td>Source</td><td colspan="2"> PGD attack on LeNet-5</td></tr><tr><td>Target</td><td>LeNet-5 MLP</td><td>LIFT/GPT-3</td></tr><tr><td>m=0</td><td>99.22 98.09</td><td>98.15</td></tr><tr><td>ε= 0.01</td><td>97.27 97.77 26.80 93.99</td><td>44.88 33.66</td></tr><tr><td>ε=0.1</td><td>0.00</td><td>20.31</td></tr><tr><td>ε=0.3</td><td>36.62</td><td></td></tr></table>
|
| 111 |
+
|
| 112 |
+
# 3.6 Does LIFT Need Large-Scale Models Pretrained on Natural Language Data?
|
| 113 |
+
|
| 114 |
+
We investigate the requirement of pretrained LMs for which LIFT performs well. We compare variants of LIFT under different types of LMs: GPTs pretrained on natural language data (our models), a large LM without pretraining (Rand-GPT-J), and LMs pre-trained on non-human language data, including CodeParrot $\pmb { \Vert 5 3 \Vert }$ and CodeGen-2B-mono [54] trained mainly on programming language data, and a GPT-J fine-tuned on Gibberish data [55]. See Appendix D.1.5 for the detailed setting.
|
| 115 |
+
|
| 116 |
+
Does LIFT only need a large pretrained model? To answer this question, we compare performances of LIFT when GPTs are pretrained (LIFT/GPTs) and when GPT-J have weights being randomly initialized (LIFT/Rand-GPT-J). More specifically, for LIFT/Rand-GPT-J, we randomly initialized a GPT-J model and fine-tuned the whole model (instead of LoRA). As shown in Table $\bigstar \bigstar$ accuracies of LIFT/Rand-GPT-J are much lower than those of our models (LIFT/GPTs), across all datasets. These results indicate that LIFT benefits from pretraining, not just from the large-scale design of LMs.
|
| 117 |
+
|
| 118 |
+
Does LIFT need a model trained on natural language data? As shown in Table $\mathbb { B } ,$ LIFT/GPTs perform much better than LIFT/CodeGen and LIFT/CodeParrot for all datasets. This implies that LIFT may perform better with LMs pretrained on natural language data. When the pretrained GPT-J is fine-tuned on gibberish data $\pmb { \mathbb { E 5 } } \|$ , the accuracies drop for a few tasks and are lower than LIFT/GPTs overall. However, LIFT/Gibberish still achieves comparably good performance and its small performance gaps to LIFT/GPT-J can be attributed to the relatively light impact of fine-tuning on large pretrained LMs. Thus pretraining on natural language data is necessary for LIFT.
|
| 119 |
+
|
| 120 |
+
# 4 Evaluation of LIFT-Specific Learning Properties
|
| 121 |
+
|
| 122 |
+
In this section, we study the behavior of LIFT in a more fine-grained manner.
|
| 123 |
+
|
| 124 |
+
# 4.1 Does LIFT Benefit from Incorporating Feature Names?
|
| 125 |
+
|
| 126 |
+
Unlike standard machine learning algorithms, LIFT can be provided context information by incorporating the feature names and task descriptions in the prompts. Intuitively, this incorporation may improve the sample complexity of LIFT as the prior knowledge already learned in the pretraining
|
| 127 |
+
|
| 128 |
+
Table 9: The effect of using feature names on LIFT. We compare classification accuracy $( \uparrow )$ of LIFT/GPT-3 when feature names provided in the target dataset are and are not incorporated into the prompts. We provide four versions of LIFT when feature names are correctly incorporated (Correct-Names columns) and when feature names are randomly shuffled (Shuffled-Names columns). We evaluate models on three OpenML datasets, including CMC (23), TAE (48), Vehicle (54), and German. We also compare our models with two baselines: the majority class classifier (MCC) and XGBoost. As a result, all LIFT models achieve better performance than MCC. Among the evaluated models, LIFTs with correct feature names achieve the best accuracies on both TAE, Vehicle, and German datasets while achieving the comparable accuracies to the best model on the CMC dataset. \*Two designs of the prompt format result in the same template for the Vehicle dataset.
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan="2">Dataset (ID)</td><td rowspan="2">MCC</td><td colspan="6">LIFT</td></tr><tr><td>W/o Names I</td><td>W/o Names II</td><td>Shuffled-Names I</td><td>Shuffled-Names II</td><td>Correct-Names I</td><td>Correct-Names II</td></tr><tr><td>CMC (23)</td><td>42.71</td><td>57.74±0.89</td><td>57.40±1.37</td><td>56.27±2.06</td><td>57.06±4.24</td><td>57.40±1.09</td><td>56.27±2.22</td></tr><tr><td>TAE(48)</td><td>35.48</td><td>65.59±6.63</td><td>66.67±5.48</td><td>60.22±6.72</td><td>64.52±8.53</td><td>69.89±9.31</td><td>69.89±6.72</td></tr><tr><td>Vehicle (54)</td><td>25.88</td><td>70.20±2.73</td><td>71.96±3.09</td><td>70.20±5.34</td><td>69.22±2.72</td><td>75.29±2.04*</td><td></td></tr><tr><td>German</td><td>70.00</td><td>71.33 ±5.20</td><td>67.83 ± 2.72</td><td>73.00 ±1.87</td><td>71.67± 0.94</td><td>72.33 ± 1.70</td><td>74.17± 1.25</td></tr></table>
|
| 131 |
+
|
| 132 |
+
phase may help LIFT predict better. We design seven prompt templates to assess how incorporating feature names affects the performance of LIFT (see more details in Appendix $\underline { { \mathbb { D } . 2 . 1 ) } }$ . We empirically verify this intuition and show our results in Table 9 for several classification tasks using pretrained GPT-3 models. We first observe that all LIFT models outperform MCC with significant accuracy gaps, indicating that they are all properly trained. Second, we observe that correctly incorporating feature names helps boost the performances of LIFT for datasets except for CMC. Third, if we use similar prompts with shuffled feature names (Shuffled-Names I, II), then the performance of LIFT drops by a significant margin. These results imply that the aforementioned performance improvements are indeed due to proper prompting with correct feature/value association.
|
| 133 |
+
|
| 134 |
+
# 4.2 Is LIFT Well Calibrated?
|
| 135 |
+
|
| 136 |
+
We investigate whether LIFT is calibrated, i.e., the prediction reflects the confidence, by exploring how LIFT performs under various noise levels, as shown in Fig. $\textcircled { 3 6 }$ in Appendix. We conduct experiments on six synthetic regression datasets, each consisting of 1,000 noisy training samples shown as blue markers in the first row. To be specific, we generate (1) the input $x$ following the guideline in $\mathrm { S e c . } \mathbf { \overline { { C . 1 } } }$ for regression tasks and (2) the noisy outcome $y$ where the standard deviation of noise $\sigma ( x ) = ( x + 1 0 ) \bar { / } 1 0$ increases along the $x$ -axis (from $x = - 1 0$ to $x = 1 0$ ), and study how different noise level affects the predictive behavior of LIFT. In the inference phase, we set the decoding temperature $T = 1$ for LIFT to make random predictions. For visualization purposes, we generate an additional 103 samples uniformly in $[ - 1 0 , 1 0 ]$ for each task and plot the standard deviation of 20 LIFT/GPT-J predictions on each sample in the bottom row of Fig. $3 6 .$ Note that the bottom row of Fig. $3 6$ shows that the standard deviation of LIFT/GPT-J’s prediction nearly matches that of noisy training samples (observations) across different tasks. These results imply that LIFT/GPT-J is calibrated. Similarly, Fig. $\boxed { 3 7 }$ of Sec. D.2.2 shows that LIFT/GPT-3 is calibrated.
|
| 137 |
+
|
| 138 |
+
# 4.3 Can We Use LIFT for Data Generation?
|
| 139 |
+
|
| 140 |
+
Generative models have been widely used in computer vision [56, 57, 58]. Beyond classification and regression tasks, we study whether LIFT can be used for generative tasks, i.e., learning the underlying data distribution and generating realistic data samples. In particular, we consider two image generation tasks on MNIST dataset: (a) generating an image given a digit number, and (b) completing an image given a digit number and its pixels on the top half of the image. Fig. 10a and Fig. 10b show our generated images for the two tasks respectively. We observe that the generated images have the correct digit shape and reasonably high quality in most cases, especially for the image completion (Fig. 10b). See Appendix D.2.3 for more details (b) Given the digit number and a half of image pixels. Figure 10: Generating MNIST images using LIFT/GPT-J. We observe that LIFT/GPT-J can generate images of comparably high quality. The temperature is set to 1.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
|
| 144 |
+
# 5 Improving LIFT with Existing Techniques
|
| 145 |
+
|
| 146 |
+
We improve LIFT with advanced techniques: two-stage fine-tuning and data augmentation.
|
| 147 |
+
|
| 148 |
+
# 5.1 Two-Stage Fine-Tuning for LIFT with Synthetic Pretext Tasks
|
| 149 |
+
|
| 150 |
+
In Sec. 3.2, we observe that LMs need a sufficient number of samples to start adapting. We suspect that LMs’ adaptation to non-language tasks contains two phases: (1) learn the task description, i.e., input space, label space, and sentence templates [47, 59], and (2) learn the target task. Thus, we consider utilizing synthetic data to describe the task for LMs in the first phase, thus reducing the sample complexity. This results in a new two-stage training procedure for LIFT $\cdot ^ { 1 } \ln$ particular, for any given dataset, we first generate two pretext tasks with simple syn
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 11: Two-stage fine-tuning. The two-stage method (blue) applies LIFT first on synthetic pretext data before the real datasets, outperforming fine-tuning (green) when training data is small. The full experiment results are presented in Fig. 40.
|
| 154 |
+
|
| 155 |
+
thetic Gaussian datasets (discussed in $\check { \boxdot { C . 1 } }$ sharing the same number of features and the label space (for classification tasks) or the range of responses’ values (for the regression tasks) to the actual data. We apply LIFT on pretext tasks for a few (2 or 3) epochs, then continue LIFT with the target (given) dataset. For GPT-3, it is unclear how to keep the order of samples not shuffled with the current black-box API during the fine-tuning stage. Hence, we only provide the experimental results of GPT-J. Fig. $\boxed { 1 1 }$ shows that two-stage fine-tuning improves LIFT over the original fine-tuning when the number of training samples is small on both classification and regression tasks.
|
| 156 |
+
|
| 157 |
+
# 5.2 Data Augmentation
|
| 158 |
+
|
| 159 |
+
Data augmentation $\mathbb { \left[ 6 1 \right] }$ is a simple tool for improving the generalization performance for various classification problems. Here, we investigate whether data augmentation benefits LIFT. Table $1 \bar { 2 }$ shows the effect of adding random noise in the training data on the performance of LIFT/GPT-J for the MNIST classification problem. Here, we test each model on three settings: (1) clean data, (2) Gaussian noise, and (3) signed constant noise. We allow each noise can perturb up to the magnitude of $\epsilon \in [ 0 , 1 ]$ at each dimension (i.e., each pixel) when the black/white pixel of MNIST is represented in the [0, 1]
|
| 160 |
+
|
| 161 |
+
Table 12: Accuracies $\left( \uparrow \right)$ of LIFT with/without data augmentation (DA), as well as baselines (LeNet-5, MLP) on MNIST. Each row represents different ways of training, and each column means different test data. Data augmentation (DA) means that we are using a noisy version of MNIST training data by adding Gaussian noise. Given an MNIST image having range [0,1], the noise is added in the $L _ { \infty }$ ball with radius ✏. One can confirm that the data augmentation significantly improves the tolerance of LIFT/GPT-J against perturbed test data in both Gaussian and signed constant noise. For each column, we boldfaced the highest value among baselines and the highest value among LIFT/GPT-J.
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td>Clean e=0</td><td colspan="2">Gaussian noise e=0.01 ∈=0.1</td><td colspan="2">Signed const. noise =0.01 ∈=0.1</td></tr><tr><td>LeNet-5</td><td>99.22</td><td>99.25</td><td>99.20</td><td>99.26</td><td>99.06</td></tr><tr><td>MLP</td><td>98.09</td><td>98.05</td><td>97.70</td><td>98.08</td><td>97.39</td></tr><tr><td>LIFT/GPT-J</td><td>96.88</td><td>95.27</td><td>56.14</td><td>55.83</td><td>27.73</td></tr><tr><td>LIFT/GPT-J, DA (Gaussian, ε = 0.05)</td><td>93.80</td><td>94.39</td><td>93.40</td><td>93.46</td><td>61.24</td></tr><tr><td>LIFT/GPT-J,DA (Gaussian,ε= 0.1)</td><td>93.78</td><td>94.31</td><td>94.98</td><td>94.12</td><td>75.25</td></tr></table>
|
| 164 |
+
|
| 165 |
+
range. We defer the generation procedure of random Gaussian noise to Sec. D.1.4 in Appendix.
|
| 166 |
+
|
| 167 |
+
One can observe that LIFT/GPT-J without any data augmentation (DA) is vulnerable to random noise, unlike existing baselines (LeNet-5 and MLP). However, when we apply data augmentation, i.e., train LIFT/GPT-J with noisy training data, the accuracy improves significantly for the perturbed (either adding Gaussian noise or Signed constant noise) test data. This shows the effectiveness of simple data augmentation in LIFT. Exploring the effect of other data augmentation schemes, e.g., mixup $\pmb { \mathbb { I } }$ and its variants $\mathbb { \left[ 6 3 \right] } \mathbb { \left[ 6 4 \right] } \mathbb { \left[ 6 5 \right] }$ , is remained an interesting future work.
|
| 168 |
+
|
| 169 |
+
# 6 Related Works
|
| 170 |
+
|
| 171 |
+
Fine-tuning for adapting LMs to non-language tasks. Fine-tuning $[ [ 6 6 ] ]$ pretrained LMs is the standard practice for learning downstream tasks, which may involve simple architecture modifications, such as adding linear layers $ { \mathbb { B } } 7 { \mathbb { I } } 6 8 { \mathbb { I } }$ or freezing layers $\pm \sqrt { 1 8 } , \boxed { 6 9 } , \boxed { 7 0 } $ . The recent progress focuses on parameter-efficient techniques for reducing trainable parameters, including adapter-based fine-tuning [25, 26, 27] that trains additional small residual blocks between layers, freezing-based fine-tuning [71, 18, $\boxed { 7 2 } \parallel$ that freezes most of the pretrained parameters, and distillation-based finetuning $\pmb { \mathbb { Z } 3 } \|$ . Our LIFT/GPT-J is fine-tuned with LoRA $\pmb { \Vert 2 4 \Vert }$ , a parameter-efficient method approximating the weight updates using low-rank matrices.
|
| 172 |
+
|
| 173 |
+
To directly adopt existing fine-tuning methods of LMs for non-language tasks, it is common practice to modify the input/output layers and the loss functions, which may cause undesired behaviors like catastrophic forgetting $\overline { { \Vert 6 6 \Vert 7 4 \Vert } }$ . Our work is highly motivated by Frozen Pretrained Transformer (FPT) $\dot { \textmu 1 8 } \textcircled { 1 8 } \textcircled { 1 8 }$ that directly fine-tunes GPT-2 $\mathbb { \left| \mathbb { Z } \right\| }$ pretrained on language tasks for other modalities by freezing most pretrained parameters and adding only input and output layers for the modality adaptation. Unlike FPT, our method requires no such changes in the architecture and objective function. Several works also extend the existing LMs to handle different input data types, such as images $\mathbb { D } \bot \bot \boxed { 7 6 }$ , audio $ { \mathbb { I } } { \mathbb { Z } } { \mathbb { Z } }$ , tabular data $ { \mathbb { I } } ^ { { \mathbb { Z } } 8 \| }$ , and knowledge base $\pmb { \mathbb { Z } } 9 \|$ by updating the pretraining phase with these data and their corresponding tasks or using general-purpose architecture $\pmb { \mathbb { B } } \pmb { \mathbb { 0 } }$ . Our work is based on GPT language models trained only on textual data.
|
| 174 |
+
|
| 175 |
+
Analyzing the adaptability of LMs. Similar to ours, recent works $\lVert 8 1 \rVert , \big | 8 2 \big \rVert , \big | 8 3 \big \rVert , \big | 8 2 \big \rVert$ attempt to understand and quantify the adaptability $\mathbb { \left| \left[ 2 0 \right] \right| }$ and capacity of large LMs, such as Big-Bench $\dot { \left. \left. 8 2 \right. \right. }$ with a new benchmark of more than 200 tasks on a diverse set of topics.
|
| 176 |
+
|
| 177 |
+
General-purpose models. A primary goal of our work is to push the limit of the existing generalist language models (e.g., GPT-3 $\mathbb { I m }$ ) to other modalities and domains, supporting the idea of building a domain-and-modality agnostic generalist model [19, 84, 3, 85, 86, 87, 88, 89]. Note that LIFT can be applied to any generalist model with LM-like architectures, such as GATO [89]. Furthermore, our work shares the general goal with automated machine learning (AutoML) [90, 91] in improving the usability of machine learning, though LIFT uses only a single pretrained LMs for all tasks while AutoML automates the standard machine learning pipeline from a set of existing algorithms.
|
| 178 |
+
|
| 179 |
+
# 7 Discussion and Conclusion
|
| 180 |
+
|
| 181 |
+
We propose the use of language-interfaced framework, via Language-Interfaced Fine-Tuning (LIFT), for using LMs to solve non-language downstream tasks without changing the models’ architecture or loss function. LIFT first converts labeled samples into sentences and then fine-tunes pretrained LMs on the sentence dataset using the standard fine-tuning method and loss function. Via an extensive empirical study, we show that LIFT/GPT performs relatively well on low-dimensional classification and regression non-language tasks. Furthermore, LIFT/GPTs are robust in several practical settings, and can properly calibrate the predictions and generate realistic data samples. LIFT can be improved using in-context feature names, two-stage fine-tuning, and data augmentation. Moreover, our work is arguably one of the first to thoroughly study the efficacy of language-interfaced learning framework with pretrained language models on standard regression and classification tasks, paving the way for enabling “no-code machine learning with language models.”
|
| 182 |
+
|
| 183 |
+
Limitations and open questions. Despite promising performances on various tasks and settings, we observe some limitations of LIFT to basic learning tasks. LIFT/GPT do not perform well if the features have high dimensions (for regression) or when the number of classes is large (for classification). In addition, the context length of LIFT is restricted to the context length of LMs and LIFT/GPT is memory-inefficient. One can combine LIFT with memory-efficient LMs such as LinTransformer $\mathbb { P } 2 \mathbb { I }$ to address this issue. Besides, our works open some interesting questions for future works. First, do LMs and LIFT/GPT have behaviors similar to ensemble methods or decision tree since they have similar decision boundaries? Secondly, are LMs universal models that can adapt well to any modalities and domains? Lastly, can LIFT/GPTs adapt better for regression tasks using more sophisticated encoding schemes for numeric features?
|
| 184 |
+
|
| 185 |
+
Social impacts. Future research should also investigate potential fairness issues of applying LIFT. Based on large language models, LIFT might have embedded bias targeting certain social groups. Especially when feature names are included in the training prompts, the models may be more sensitive to social biases and thus might make unfair and harmful predictions. We leave measuring the embedded bias in LIFT as one of the interesting future directions.
|
| 186 |
+
|
| 187 |
+
References [1] David Forsyth and Jean Ponce. Computer vision: A modern approach. Prentice hall, 2011. [2] Alexander Kolesnikov, Alexey Dosovitskiy, Dirk Weissenborn, Georg Heigold, Jakob Uszkoreit, Lucas Beyer, Matthias Minderer, Mostafa Dehghani, Neil Houlsby, Sylvain Gelly, Thomas Unterthiner, and Xiaohua Zhai. An image is worth 16x16 words: Transformers for image recognition at scale. 2021.
|
| 188 |
+
[3] KR1442 Chowdhary. Natural language processing. Fundamentals of artificial intelligence, pages 603–649, 2020. [4] Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. [5] Fei-Yue Wang, Jun Jason Zhang, Xinhu Zheng, Xiao Wang, Yong Yuan, Xiaoxiao Dai, Jie Zhang, and Liuqing Yang. Where does alphago go: From church-turing thesis to alphago thesis and beyond. IEEE/CAA Journal of Automatica Sinica, 3(2):113–120, 2016. [6] Kai Arulkumaran, Antoine Cully, and Julian Togelius. Alphastar: An evolutionary computation perspective. In Proceedings of the genetic and evolutionary computation conference companion, pages 314–315, 2019. [7] Shih-Chung B Lo, Heang-Ping Chan, Jyh-Shyan Lin, Huai Li, Matthew T Freedman, and Seong K Mun. Artificial convolution neural network for medical image pattern recognition. Neural networks, 8(7-8):1201–1214, 1995. [8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. [9] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961–2969, 2017.
|
| 189 |
+
[10] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning internal representations by error propagation. Technical report, California Univ San Diego La Jolla Inst for Cognitive Science, 1985.
|
| 190 |
+
[11] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
|
| 191 |
+
[12] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
|
| 192 |
+
[13] David So, Quoc Le, and Chen Liang. The evolved transformer. In International Conference on Machine Learning, pages 5877–5886. PMLR, 2019.
|
| 193 |
+
[14] Lukasz Kaiser, Aidan N Gomez, Noam Shazeer, Ashish Vaswani, Niki Parmar, Llion Jones, and Jakob Uszkoreit. One model to learn them all. arXiv preprint arXiv:1706.05137, 2017.
|
| 194 |
+
[15] Karl Weiss, Taghi M Khoshgoftaar, and DingDing Wang. A survey of transfer learning. Journal of Big data, 3(1):1–40, 2016.
|
| 195 |
+
[16] Dhanesh Ramachandram and Graham W Taylor. Deep multimodal learning: A survey on recent advances and trends. IEEE signal processing magazine, 34(6):96–108, 2017.
|
| 196 |
+
[17] Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pages 160–167, 2008.
|
| 197 |
+
[18] Kevin Lu, Aditya Grover, Pieter Abbeel, and Igor Mordatch. Pretrained transformers as universal computation engines. arXiv preprint arXiv:2103.05247, 2021.
|
| 198 |
+
|
| 199 |
+
[19] 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.
|
| 200 |
+
|
| 201 |
+
[20] Belinda Z Li, Jane Yu, Madian Khabsa, Luke Zettlemoyer, Alon Halevy, and Jacob Andreas. Quantifying adaptability in pre-trained language models with 500 tasks. arXiv preprint arXiv:2112.03204, 2021.
|
| 202 |
+
|
| 203 |
+
[21] 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.
|
| 204 |
+
|
| 205 |
+
[22] Dan Su, Yan Xu, Genta Indra Winata, Peng Xu, Hyeondey Kim, Zihan Liu, and Pascale Fung. Generalizing question answering system with pre-trained language model fine-tuning. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pages 203–211, Hong Kong, China, November 2019. Association for Computational Linguistics.
|
| 206 |
+
|
| 207 |
+
[23] Xuhui Zhou, Yue Zhang, Leyang Cui, and Dandan Huang. Evaluating commonsense in pre-trained language models. CoRR, abs/1911.11931, 2019.
|
| 208 |
+
|
| 209 |
+
[24] 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. arXiv preprint arXiv:2106.09685, 2021.
|
| 210 |
+
|
| 211 |
+
[25] 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, pages 2790–2799. PMLR, 2019.
|
| 212 |
+
|
| 213 |
+
[26] Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. Advances in neural information processing systems, 30, 2017.
|
| 214 |
+
|
| 215 |
+
[27] Ruize Wang, Duyu Tang, Nan Duan, Zhongyu Wei, Xuanjing Huang, Guihong Cao, Daxin Jiang, Ming Zhou, et al. K-adapter: Infusing knowledge into pre-trained models with adapters. arXiv preprint arXiv:2002.01808, 2020.
|
| 216 |
+
|
| 217 |
+
[28] Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. arXiv preprint arXiv:2104.08786, 2021.
|
| 218 |
+
|
| 219 |
+
[29] Bonan Min, Hayley Ross, Elior Sulem, Amir Pouran Ben Veyseh, Thien Huu Nguyen, Oscar Sainz, Eneko Agirre, Ilana Heinz, and Dan Roth. Recent advances in natural language processing via large pre-trained language models: A survey. arXiv preprint arXiv:2111.01243, 2021.
|
| 220 |
+
|
| 221 |
+
[30] Kyle M. Monahan. Iris dataset for machine learning, 2020.
|
| 222 |
+
|
| 223 |
+
[31] Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021.
|
| 224 |
+
|
| 225 |
+
[32] Openai fine-tuning documentation: Preparing your dataset. https://beta.openai.com/ docs/guides/fine-tuning/preparing-your-dataset.
|
| 226 |
+
|
| 227 |
+
[33] Daphne Ippolito, Reno Kriz, Maria Kustikova, João Sedoc, and Chris Callison-Burch. Comparison of diverse decoding methods from conditional language models. arXiv preprint arXiv:1906.06362, 2019.
|
| 228 |
+
|
| 229 |
+
[34] Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751, 2019.
|
| 230 |
+
|
| 231 |
+
[35] Openai fine-tuning documentation: Create completion. https://beta.openai.com/docs/ api-reference/completions/create.
|
| 232 |
+
|
| 233 |
+
[36] Joaquin Vanschoren, Jan N. van Rijn, Bernd Bischl, and Luis Torgo. Openml: Networked science in machine learning. SIGKDD Explorations, 15(2):49–60, 2013.
|
| 234 |
+
|
| 235 |
+
[37] Yann LeCun. The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998.
|
| 236 |
+
|
| 237 |
+
[38] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 238 |
+
|
| 239 |
+
[39] Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013.
|
| 240 |
+
|
| 241 |
+
[40] Keyulu Xu, Mozhi Zhang, Jingling Li, Simon Shaolei Du, Ken-Ichi Kawarabayashi, and Stefanie Jegelka. How neural networks extrapolate: From feedforward to graph neural networks. In International Conference on Learning Representations, 2021.
|
| 242 |
+
|
| 243 |
+
[41] Medical insurance dataset (kaggle). mirichoi0218/insurance.
|
| 244 |
+
|
| 245 |
+
https://www.kaggle.com/datasets/
|
| 246 |
+
|
| 247 |
+
[42] Pınar Tüfekci. Prediction of full load electrical power output of a base load operated combined cycle power plant using machine learning methods. International Journal of Electrical Power & Energy Systems, 60:126–140, 2014.
|
| 248 |
+
|
| 249 |
+
[43] John R Quinlan et al. Learning with continuous classes. In 5th Australian joint conference on artificial intelligence, volume 92, pages 343–348. World Scientific, 1992.
|
| 250 |
+
|
| 251 |
+
[44] Paulo Cortez and Alice Maria Gonçalves Silva. Using data mining to predict secondary school student performance. 2008.
|
| 252 |
+
|
| 253 |
+
[45] Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014.
|
| 254 |
+
|
| 255 |
+
[46] Vadim Borisov, Tobias Leemann, Kathrin Seßler, Johannes Haug, Martin Pawelczyk, and Gjergji Kasneci. Deep neural networks and tabular data: A survey. October 2021.
|
| 256 |
+
|
| 257 |
+
[47] Laria Reynolds and Kyle McDonell. Prompt programming for large language models: Beyond the few-shot paradigm. In Extended Abstracts of the 2021 CHI Conference on Human Factors in Computing Systems, pages 1–7, 2021.
|
| 258 |
+
|
| 259 |
+
[48] Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980, 2020.
|
| 260 |
+
|
| 261 |
+
[49] Gowthami Somepalli, Liam Fowl, Arpit Bansal, Ping Yeh-Chiang, Yehuda Dar, Richard Baraniuk, Micah Goldblum, and Tom Goldstein. Can neural nets learn the same model twice? investigating reproducibility and double descent from the decision boundary perspective. arXiv preprint arXiv:2203.08124, 2022.
|
| 262 |
+
|
| 263 |
+
[50] Peter J Huber. Robust statistics. In International encyclopedia of statistical science, pages 1248–1251. Springer, 2011.
|
| 264 |
+
|
| 265 |
+
[51] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 266 |
+
|
| 267 |
+
[52] Wei Emma Zhang, Quan Z Sheng, Ahoud Alhazmi, and Chenliang Li. Adversarial attacks on deep-learning models in natural language processing: A survey. ACM Transactions on Intelligent Systems and Technology (TIST), 11(3):1–41, 2020.
|
| 268 |
+
|
| 269 |
+
[53] Loubna Allal, Leandro Werra, Thomas Wolf, and Li Jia. Codeparrot.
|
| 270 |
+
|
| 271 |
+
[54] Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. A conversational paradigm for program synthesis. arXiv preprint arXiv:2203.13474, 2022.
|
| 272 |
+
|
| 273 |
+
[55] Better gibberish detection with gpt-2. https://daveshap. github.io/DavidShapiroBlog/gpt-2/deep-learning/2020/11/05/ better-gibberish-detection.html.
|
| 274 |
+
|
| 275 |
+
[56] 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.
|
| 276 |
+
|
| 277 |
+
[57] Diederik P Kingma, Max Welling, et al. An introduction to variational autoencoders. Foundations and Trends® in Machine Learning, 12(4):307–392, 2019.
|
| 278 |
+
|
| 279 |
+
[58] Florinel-Alin Croitoru, Vlad Hondru, Radu Tudor Ionescu, and Mubarak Shah. Diffusion models in vision: A survey. arXiv preprint arXiv:2209.04747, 2022.
|
| 280 |
+
|
| 281 |
+
[59] Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. Rethinking the role of demonstrations: What makes in-context learning work? arXiv preprint arXiv:2202.12837, 2022.
|
| 282 |
+
|
| 283 |
+
[60] Mingda Chen, Jingfei Du, Ramakanth Pasunuru, Todor Mihaylov, Srini Iyer, Veselin Stoyanov, and Zornitsa Kozareva. Improving in-context few-shot learning via self-supervised training. arXiv preprint arXiv:2205.01703, 2022.
|
| 284 |
+
|
| 285 |
+
[61] Connor Shorten and Taghi M Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of big data, 6(1):1–48, 2019.
|
| 286 |
+
|
| 287 |
+
[62] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 288 |
+
|
| 289 |
+
[63] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF international conference on computer vision, pages 6023–6032, 2019.
|
| 290 |
+
|
| 291 |
+
[64] Jang-Hyun Kim, Wonho Choo, and Hyun Oh Song. Puzzle mix: Exploiting saliency and local statistics for optimal mixup. In International Conference on Machine Learning, pages 5275–5285. PMLR, 2020.
|
| 292 |
+
|
| 293 |
+
[65] Jy-yong Sohn, Liang Shang, Hongxu Chen, Jaekyun Moon, Dimitris Papailiopoulos, and Kangwook Lee. Genlabel: Mixup relabeling using generative models. arXiv preprint arXiv:2201.02354, 2022.
|
| 294 |
+
|
| 295 |
+
[66] Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947, 2017.
|
| 296 |
+
|
| 297 |
+
[67] Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. arXiv preprint arXiv:1605.09782, 2016.
|
| 298 |
+
|
| 299 |
+
[68] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597–1607. PMLR, 2020.
|
| 300 |
+
|
| 301 |
+
[69] Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
|
| 302 |
+
|
| 303 |
+
[70] Ting Chen, Mario Lucic, Neil Houlsby, and Sylvain Gelly. On self modulation for generative adversarial networks. arXiv preprint arXiv:1810.01365, 2018.
|
| 304 |
+
|
| 305 |
+
[71] Mozhdeh Gheini, Xiang Ren, and Jonathan May. Cross-attention is all you need: Adapting pretrained transformers for machine translation. arXiv preprint arXiv:2104.08771, 2021.
|
| 306 |
+
|
| 307 |
+
[72] Tuan Dinh, Daewon Seo, Zhixu Du, Liang Shang, and Kangwook Lee. Improved input reprogramming for gan conditioning. arXiv preprint arXiv:2201.02692, 2022.
|
| 308 |
+
|
| 309 |
+
[73] Yen-Chun Chen, Zhe Gan, Yu Cheng, Jingzhou Liu, and Jingjing Liu. Distilling knowledge learned in bert for text generation. arXiv preprint arXiv:1911.03829, 2019.
|
| 310 |
+
|
| 311 |
+
[74] Sanyuan Chen, Yutai Hou, Yiming Cui, Wanxiang Che, Ting Liu, and Xiangzhan Yu. Recall and learn: Fine-tuning deep pretrained language models with less forgetting. arXiv preprint arXiv:2004.12651, 2020.
|
| 312 |
+
[75] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. Advances in neural information processing systems, 32, 2019.
|
| 313 |
+
[76] Maria Tsimpoukelli, Jacob L Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. Advances in Neural Information Processing Systems, 34:200–212, 2021.
|
| 314 |
+
[77] Yung-Sung Chuang, Chi-Liang Liu, and Hung-Yi Lee. Speechbert: Cross-modal pre-trained language model for end-to-end spoken question answering. 2019.
|
| 315 |
+
[78] Qian Liu, Bei Chen, Jiaqi Guo, Zeqi Lin, and Jian-guang Lou. Tapex: table pre-training via learning a neural sql executor. arXiv preprint arXiv:2107.07653, 2021.
|
| 316 |
+
[79] Oshin Agarwal, Heming Ge, Siamak Shakeri, and Rami Al-Rfou. Knowledge graph based synthetic corpus generation for knowledge-enhanced language model pre-training. arXiv preprint arXiv:2010.12688, 2020.
|
| 317 |
+
[80] 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.
|
| 318 |
+
[81] Samira Abnar, Mostafa Dehghani, Behnam Neyshabur, and Hanie Sedghi. Exploring the limits of large scale pre-training. arXiv preprint arXiv:2110.02095, 2021.
|
| 319 |
+
[82] Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R. Brown, Adam Santoro, et al. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models, 2022.
|
| 320 |
+
[83] Yi Zhang, Arturs Backurs, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, and Tal Wagner. Unveiling transformers with lego: a synthetic reasoning task, 2022.
|
| 321 |
+
[84] Jack W Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, et al. Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446, 2021.
|
| 322 |
+
[85] Gen Li, Nan Duan, Yuejian Fang, Ming Gong, and Daxin Jiang. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 11336–11344, 2020.
|
| 323 |
+
[86] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. arXiv preprint arXiv:2204.14198, 2022.
|
| 324 |
+
[87] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748–8763. PMLR, 2021.
|
| 325 |
+
[88] Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, YunHsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning, pages 4904–4916. PMLR, 2021.
|
| 326 |
+
[89] Scott Reed, Konrad Zolna, Emilio Parisotto, Sergio Gomez Colmenarejo, Alexander Novikov, Gabriel Barth-Maron, Mai Gimenez, Yury Sulsky, Jackie Kay, Jost Tobias Springenberg, et al. A generalist agent. arXiv preprint arXiv:2205.06175, 2022.
|
| 327 |
+
|
| 328 |
+
[90] Matthias Feurer, Aaron Klein, Jost Eggensperger, Katharina Springenberg, Manuel Blum, and Frank Hutter. Efficient and robust automated machine learning. In Advances in Neural Information Processing Systems 28 (2015), pages 2962–2970, 2015.
|
| 329 |
+
|
| 330 |
+
[91] Matthias Feurer, Katharina Eggensperger, Stefan Falkner, Marius Lindauer, and Frank Hutter. Auto-sklearn 2.0: Hands-free automl via meta-learning. arXiv:2007.04074 [cs.LG], 2020.
|
| 331 |
+
|
| 332 |
+
[92] Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020.
|
| 333 |
+
|
| 334 |
+
[93] 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.
|
| 335 |
+
|
| 336 |
+
[94] Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. arXiv preprint arXiv:2205.11916, 2022.
|
| 337 |
+
|
| 338 |
+
[95] Zhijing Jin, Sydney Levine, Fernando Gonzalez, Ojasv Kamal, Maarten Sap, Mrinmaya Sachan, Rada Mihalcea, Josh Tenenbaum, and Bernhard Schölkopf. When to make exceptions: Exploring language models as accounts of human moral judgment. arXiv preprint arXiv:2210.01478, 2022.
|
| 339 |
+
|
| 340 |
+
[96] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
|
| 341 |
+
|
| 342 |
+
[97] Dheeru Dua and Casey Graff. UCI machine learning repository, 2017.
|
| 343 |
+
|
| 344 |
+
[98] Gautier Izacard and Edouard Grave. Leveraging passage retrieval with generative models for open domain question answering. arXiv preprint arXiv:2007.01282, 2020.
|
| 345 |
+
|
| 346 |
+
[99] Devendra Singh, Siva Reddy, Will Hamilton, Chris Dyer, and Dani Yogatama. End-to-end training of multi-document reader and retriever for open-domain question answering. Advances in Neural Information Processing Systems, 34:25968–25981, 2021.
|
| 347 |
+
|
| 348 |
+
[100] Dani Yogatama, Cyprien de Masson d’Autume, and Lingpeng Kong. Adaptive semiparametric language models. Transactions of the Association for Computational Linguistics, 9:362–373, 2021.
|
| 349 |
+
|
| 350 |
+
[101] Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. Improving language models by retrieving from trillions of tokens. In International Conference on Machine Learning, pages 2206–2240. PMLR, 2022.
|
| 351 |
+
|
| 352 |
+
[102] 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.
|
| 353 |
+
|
| 354 |
+
[103] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018.
|
| 355 |
+
|
| 356 |
+
[104] 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. arXiv preprint arXiv:1907.11692, 2019.
|
| 357 |
+
|
| 358 |
+
[105] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942, 2019.
|
| 359 |
+
|
| 360 |
+
[106] Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems, 32, 2019.
|
| 361 |
+
|
| 362 |
+
[107] 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.
|
| 363 |
+
|
| 364 |
+
[108] William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021.
|
| 365 |
+
|
| 366 |
+
[109] 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.
|
| 367 |
+
|
| 368 |
+
[110] Junyi Li, Tianyi Tang, Wayne Xin Zhao, Jian-Yun Nie, and Ji-Rong Wen. A survey of pretrained language models based text generation. arXiv preprint arXiv:2201.05273, 2022.
|
| 369 |
+
|
| 370 |
+
[111] Shuang Li, Xavier Puig, Yilun Du, Clinton Wang, Ekin Akyurek, Antonio Torralba, Jacob Andreas, and Igor Mordatch. Pre-trained language models for interactive decision-making. arXiv preprint arXiv:2202.01771, 2022.
|
| 371 |
+
|
| 372 |
+
[112] Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018.
|
| 373 |
+
|
| 374 |
+
[113] Dan Su, Yan Xu, Genta Indra Winata, Peng Xu, Hyeondey Kim, Zihan Liu, and Pascale Fung. Generalizing question answering system with pre-trained language model fine-tuning. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pages 203–211, 2019.
|
| 375 |
+
|
| 376 |
+
[114] Dmitrii Aksenov, Julián Moreno-Schneider, Peter Bourgonje, Robert Schwarzenberg, Leonhard Hennig, and Georg Rehm. Abstractive text summarization based on language model conditioning and locality modeling. arXiv preprint arXiv:2003.13027, 2020.
|
| 377 |
+
|
| 378 |
+
[115] Inigo Jauregi Unanue and Massimo Piccardi. Pretrained language models and backtranslation for English-Basque biomedical neural machine translation. In Proceedings of the Fifth Conference on Machine Translation, pages 826–832, Online, November 2020. Association for Computational Linguistics.
|
| 379 |
+
|
| 380 |
+
[116] Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021.
|
| 381 |
+
|
| 382 |
+
[117] Lya Hulliyyatus Suadaa, Hidetaka Kamigaito, Kotaro Funakoshi, Manabu Okumura, and Hiroya Takamura. Towards table-to-text generation with numerical reasoning. 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), pages 1451–1465, 2021.
|
| 383 |
+
|
| 384 |
+
[118] Qiaolin Xia, Haoyang Huang, Nan Duan, Dongdong Zhang, Lei Ji, Zhifang Sui, Edward Cui, Taroon Bharti, and Ming Zhou. Xgpt: Cross-modal generative pre-training for image captioning. In CCF International Conference on Natural Language Processing and Chinese Computing, pages 786–797. Springer, 2021.
|
| 385 |
+
|
| 386 |
+
[119] Jun Chen, Han Guo, Kai Yi, Boyang Li, and Mohamed Elhoseiny. Visualgpt: Dataefficient adaptation of pretrained language models for image captioning. arXiv preprint arXiv:2102.10407, 2021.
|
| 387 |
+
|
| 388 |
+
[120] Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. Videobert: A joint model for video and language representation learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7464–7473, 2019.
|
| 389 |
+
|
| 390 |
+
[121] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason Corso, and Jianfeng Gao. Unified vision-language pre-training for image captioning and vqa. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13041–13049, 2020.
|
| 391 |
+
|
| 392 |
+
[122] Huaishao Luo, Lei Ji, Botian Shi, Haoyang Huang, Nan Duan, Tianrui Li, Jason Li, Taroon Bharti, and Ming Zhou. Univl: A unified video and language pre-training model for multimodal understanding and generation. arXiv preprint arXiv:2002.06353, 2020.
|
| 393 |
+
|
| 394 |
+
[123] Jannis Born and Matteo Manica. Regression transformer: Concurrent conditional generation and regression by blending numerical and textual tokens. arXiv preprint arXiv:2202.01338, 2022.
|
| 395 |
+
|
| 396 |
+
[124] John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna Potapenko, et al. Highly accurate protein structure prediction with alphafold. Nature, 596(7873):583–589, 2021.
|
| 397 |
+
|
| 398 |
+
[125] Kimia Noorbakhsh, Modar Sulaiman, Mahdi Sharifi, Kallol Roy, and Pooyan Jamshidi. Pretrained language models are symbolic mathematics solvers too! arXiv preprint arXiv:2110.03501, 2021.
|
| 399 |
+
|
| 400 |
+
[126] Jonathan Herzig, Pawel Krzysztof Nowak, Thomas Müller, Francesco Piccinno, and Julian Eisenschlos. TaPas: Weakly supervised table parsing via pre-training. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4320–4333, Online, July 2020. Association for Computational Linguistics.
|
| 401 |
+
|
| 402 |
+
[127] Hiroshi Iida, Dung Thai, Varun Manjunatha, and Mohit Iyyer. Tabbie: Pretrained representations of tabular data. arXiv preprint arXiv:2105.02584, 2021.
|
| 403 |
+
|
| 404 |
+
[128] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
|
| 405 |
+
|
| 406 |
+
[129] Dieuwke Hupkes, Sara Veldhoen, and Willem Zuidema. Visualisation and’diagnostic classifiers’ reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61:907–926, 2018.
|
| 407 |
+
|
| 408 |
+
[130] Alex Warstadt, Yian Zhang, Haau-Sing Li, Haokun Liu, and Samuel R Bowman. Learning which features matter: Roberta acquires a preference for linguistic generalizations (eventually). arXiv preprint arXiv:2010.05358, 2020.
|
| 409 |
+
|
| 410 |
+
[131] Charles Lovering, Rohan Jha, Tal Linzen, and Ellie Pavlick. Predicting inductive biases of pre-trained models. In International Conference on Learning Representations, 2020.
|
| 411 |
+
|
| 412 |
+
[132] Rodrigo Nogueira, Zhiying Jiang, and Jimmy Lin. Investigating the limitations of transformers with simple arithmetic tasks. arXiv preprint arXiv:2102.13019, 2021.
|
| 413 |
+
|
| 414 |
+
[133] Guillaume Lample and François Charton. Deep learning for symbolic mathematics. In International Conference on Learning Representations, 2019.
|
| 415 |
+
|
| 416 |
+
[134] Eric Wallace, Yizhong Wang, Sujian Li, Sameer Singh, and Matt Gardner. Do NLP models know numbers? probing numeracy in embeddings. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5307–5315, Hong Kong, China, November 2019. Association for Computational Linguistics.
|
| 417 |
+
|
| 418 |
+
[135] Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and Bill Dolan. Dialogpt: Large-scale generative pre-training for conversational response generation. arXiv preprint arXiv:1911.00536, 2019.
|
| 419 |
+
|
| 420 |
+
[136] Leonardo FR Ribeiro, Martin Schmitt, Hinrich Schütze, and Iryna Gurevych. Investigating pretrained language models for graph-to-text generation. arXiv preprint arXiv:2007.08426, 2020.
|
| 421 |
+
|
| 422 |
+
[137] Jason Phang, Thibault Févry, and Samuel R Bowman. Sentence encoders on stilts: Supplementary training on intermediate labeled-data tasks. arXiv preprint arXiv:1811.01088, 2018.
|
| 423 |
+
|
| 424 |
+
[138] Nikita Moghe, Mark Steedman, and Alexandra Birch. Cross-lingual intermediate fine-tuning improves dialogue state tracking. arXiv preprint arXiv:2109.13620, 2021.
|
| 425 |
+
|
| 426 |
+
[139] Huanru Henry Mao, Bodhisattwa Prasad Majumder, Julian McAuley, and Garrison W Cottrell. Improving neural story generation by targeted common sense grounding. arXiv preprint arXiv:1908.09451, 2019.
|
| 427 |
+
|
| 428 |
+
[140] Alexander R Fabbri, Simeng Han, Haoyuan Li, Haoran Li, Marjan Ghazvininejad, Shafiq Joty, Dragomir Radev, and Yashar Mehdad. Improving zero and few-shot abstractive summarization with intermediate fine-tuning and data augmentation. arXiv preprint arXiv:2010.12836, 2020.
|
| 429 |
+
|
| 430 |
+
[141] Raphael Rubino and Eiichiro Sumita. Intermediate self-supervised learning for machine translation quality estimation. In Proceedings of the 28th International Conference on Computational Linguistics, pages 4355–4360, 2020.
|
| 431 |
+
|
| 432 |
+
[142] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
|
| 433 |
+
|
| 434 |
+
[143] Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804, 2021.
|
| 435 |
+
|
| 436 |
+
[144] Teven Le Scao and Alexander M Rush. How many data points is a prompt worth? arXiv preprint arXiv:2103.08493, 2021.
|
| 437 |
+
|
| 438 |
+
[145] Han Guo, Bowen Tan, Zhengzhong Liu, Eric P Xing, and Zhiting Hu. Text generation with efficient (soft) q-learning. arXiv preprint arXiv:2106.07704, 2021.
|
| 439 |
+
|
| 440 |
+
[146] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021.
|
| 441 |
+
|
| 442 |
+
[147] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021.
|
| 443 |
+
|
| 444 |
+
[148] Xiao Liu, Kaixuan Ji, Yicheng Fu, Zhengxiao Du, Zhilin Yang, and Jie Tang. P-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. arXiv preprint arXiv:2110.07602, 2021.
|
| 445 |
+
|
| 446 |
+
[149] Vadim Borisov, Tobias Leemann, Kathrin Seßler, Johannes Haug, Martin Pawelczyk, and Gjergji Kasneci. Deep neural networks and tabular data: A survey. arXiv preprint arXiv:2110.01889, 2021.
|
| 447 |
+
|
| 448 |
+
[150] Inkit Padhi, Yair Schiff, Igor Melnyk, Mattia Rigotti, Youssef Mroueh, Pierre Dognin, Jerret Ross, Ravi Nair, and Erik Altman. Tabular transformers for modeling multivariate time series. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3565–3569. IEEE, 2021.
|
| 449 |
+
|
| 450 |
+
[151] Ravid Shwartz-Ziv and Amitai Armon. Tabular data: Deep learning is not all you need. Information Fusion, 81:84–90, 2022.
|
| 451 |
+
|
| 452 |
+
[152] Hussein Hazimeh, Natalia Ponomareva, Petros Mol, Zhenyu Tan, and Rahul Mazumder. The tree ensemble layer: Differentiability meets conditional computation. In International Conference on Machine Learning, pages 4138–4148. PMLR, 2020.
|
| 453 |
+
|
| 454 |
+
[153] Sergei Popov, Stanislav Morozov, and Artem Babenko. Neural oblivious decision ensembles for deep learning on tabular data. arXiv preprint arXiv:1909.06312, 2019.
|
| 455 |
+
|
| 456 |
+
[154] Ira Shavitt and Eran Segal. Regularization learning networks: deep learning for tabular datasets. Advances in Neural Information Processing Systems, 31, 2018.
|
| 457 |
+
|
| 458 |
+
[155] Arlind Kadra, Marius Lindauer, Frank Hutter, and Josif Grabocka. Regularization is all you need: Simple neural nets can excel on tabular data. arXiv preprint arXiv:2106.11189, 2021.
|
| 459 |
+
|
| 460 |
+
[156] Xin Huang, Ashish Khetan, Milan Cvitkovic, and Zohar Karnin. Tabtransformer: Tabular data modeling using contextual embeddings. arXiv preprint arXiv:2012.06678, 2020.
|
| 461 |
+
|
| 462 |
+
[157] Sercan O Arık and Tomas Pfister. Tabnet: Attentive interpretable tabular learning. In AAAI, volume 35, pages 6679–6687, 2021.
|
| 463 |
+
[158] Gowthami Somepalli, Micah Goldblum, Avi Schwarzschild, C Bayan Bruss, and Tom Goldstein. Saint: Improved neural networks for tabular data via row attention and contrastive pre-training. arXiv preprint arXiv:2106.01342, 2021.
|
| 464 |
+
[159] Tin Kam Ho. Random decision forests. In Proceedings of 3rd international conference on document analysis and recognition, volume 1, pages 278–282. IEEE, 1995.
|
| 465 |
+
[160] Tianqi Chen, Tong He, Michael Benesty, Vadim Khotilovich, Yuan Tang, Hyunsu Cho, Kailong Chen, et al. Xgboost: extreme gradient boosting. R package version 0.4-2, 1(4):1–4, 2015.
|
| 466 |
+
[161] Scott Reed and Nando De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
|
| 467 |
+
[162] Nitish Shirish Keskar, Bryan McCann, Lav R Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019.
|
| 468 |
+
[163] Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In International Conference on Machine Learning, pages 5739–5748. PMLR, 2019.
|
| 469 |
+
[164] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 470 |
+
[165] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 471 |
+
[166] Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017.
|
| 472 |
+
[167] David M Blei, Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ , and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003.
|
| 473 |
+
[168] Melissa Roemmele and Andrew S Gordon. Automated assistance for creative writing with an rnn language model. In Proceedings of the 23rd International Conference on Intelligent User Interfaces Companion, pages 1–2, 2018.
|
| 474 |
+
[169] Xikun Zhang, Deepak Ramachandran, Ian Tenney, Yanai Elazar, and Dan Roth. Do language embeddings capture scales? arXiv preprint arXiv:2010.05345, 2020.
|
| 475 |
+
[170] Aakanksha Naik, Abhilasha Ravichander, Carolyn Rose, and Eduard Hovy. Exploring numeracy in word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3374–3380, 2019.
|
| 476 |
+
[171] Yuanhang Ren and Ye Du. Enhancing the numeracy of word embeddings: A linear algebraic perspective. In CCF International Conference on Natural Language Processing and Chinese Computing, pages 170–178. Springer, 2020.
|
| 477 |
+
[172] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking positional encoding in language pre-training. arXiv preprint arXiv:2006.15595, 2020.
|
| 478 |
+
[173] Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654, 2020.
|
| 479 |
+
[174] Benyou Wang, Donghao Zhao, Christina Lioma, Qiuchi Li, Peng Zhang, and Jakob Grue Simonsen. Encoding word order in complex embeddings. arXiv preprint arXiv:1912.12333, 2019.
|
| 480 |
+
[175] Zhiheng Huang, Davis Liang, Peng Xu, and Bing Xiang. Improve transformer models with better relative position embeddings. arXiv preprint arXiv:2009.13658, 2020.
|
| 481 |
+
[176] Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. Flashattention: Fast and memory-efficient exact attention with io-awareness, 2022.
|
| 482 |
+
[177] Emily Sheng, Kai-Wei Chang, Premkumar Natarajan, and Nanyun Peng. The woman worked as a babysitter: On biases in language generation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3407–3412, Hong Kong, China, November 2019. Association for Computational Linguistics.
|
| 483 |
+
[178] Alekh Agarwal, Alina Beygelzimer, Miroslav Dudík, John Langford, and Hanna Wallach. A reductions approach to fair classification. In International Conference on Machine Learning, pages 60–69. PMLR, 2018.
|
| 484 |
+
[179] Yuji Roh, Kangwook Lee, Steven Euijong Whang, and Changho Suh. Fairbatch: Batch selection for model fairness. In International Conference on Learning Representations, 2021.
|
| 485 |
+
[180] Michael Gira, Ruisu Zhang, and Kangwook Lee. Debiasing pre-trained language models via efficient fine-tuning. In Proceedings of the Second Workshop on Language Technology for Equality, Diversity and Inclusion, pages 59–69, Dublin, Ireland, May 2022. Association for Computational Linguistics.
|
| 486 |
+
|
| 487 |
+
# Checklist
|
| 488 |
+
|
| 489 |
+
1. For all authors...
|
| 490 |
+
|
| 491 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] The contribution and scope of this paper has been summarized in the abstract and the last part of Introduction.
|
| 492 |
+
(b) Did you describe the limitations of your work? [Yes] We wrote the limitations in Sec.7.
|
| 493 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] This has been discussed in Sec.7.
|
| 494 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] Our paper conforms to the ethics guideline.
|
| 495 |
+
|
| 496 |
+
2. If you are including theoretical results...
|
| 497 |
+
|
| 498 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 499 |
+
|
| 500 |
+
3. If you ran experiments...
|
| 501 |
+
|
| 502 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The code, data, and instructions are provided in the shared anonymous GitHub repository.
|
| 503 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] All the training details are discussed in the paper and they can be found at the anonymous GitHub repository.
|
| 504 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] All the experiments are run multiple times and at the tables mean and standard deviation of those runs are presented.
|
| 505 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] This has been described in Sec.3.
|
| 506 |
+
|
| 507 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 508 |
+
|
| 509 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] Our work uses public datasets/models, and has been cited properly, in the paper and GitHub repo.
|
| 510 |
+
(b) Did you mention the license of the assets? [No]
|
| 511 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 512 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 513 |
+
|
| 514 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 515 |
+
|
| 516 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 517 |
+
|
| 518 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 519 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 520 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/uuUQraD4XX/uuUQraD4XX.md
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Large Language Models Can Self-Improve
|
| 2 |
+
|
| 3 |
+
Jiaxin Huang1∗ Shixiang Shane $\mathbf { G u ^ { 2 } }$ Le $\mathbf { H o u } ^ { 2 \dagger }$ Yuexin $\mathbf { W } \mathbf { u } ^ { 2 }$ Xuezhi Wang2 Hongkun $\mathbf { Y } \mathbf { u } ^ { 2 }$ Jiawei Han1
|
| 4 |
+
|
| 5 |
+
1University of Illinois at Urbana-Champaign 2Google 1{jiaxinh3, hanj}@illinois.edu 2{shanegu, lehou, crickwu, xuezhiw, hongkuny}@google.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Large Language Models (LLMs) have achieved excellent performances in various tasks. However, fine-tuning an LLM requires extensive supervision. Human, on the other hand, may improve their reasoning abilities by self-thinking without external inputs. In this work, we demonstrate that an LLM is also capable of self-improving with only unlabeled datasets. We use a pre-trained LLM to generate “highconfidence” rationale-augmented answers for unlabeled questions using Chain-of-Though (CoT) prompting and self-consistency, and finetune the LLM using those self-generated solutions as target outputs. We show that without any ground truth label, our approach significantly improves the general reasoning ability of PaLM 540B model $7 4 . 4 \% 8 2 . 1 \%$ on GSM8K, $9 0 . 0 \% 9 4 . 4 \%$ on OpenBookQA, and $6 3 . 4 \% 6 7 . 9 \%$ on ANLI-A3) and can also be adapted to extreme low-resource cases where even training questions and CoT prompts are limited. We conduct ablation studies and show that fine-tuning on diverse reasoning paths is critical for self-improvement.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
self-consistency (Wang et al., 2022c) further improves the performance via self-evaluating multiple reasoning paths.
|
| 14 |
+
|
| 15 |
+
Scaling has enabled Large Language Models (LLMs) to achieve state-of-the-art performance on a range of Natural Language Processing (NLP) tasks (Wang et al., 2018, 2019; Rajpurkar et al., 2016). More importantly, new capabilities have emerged from LLMs as they are scaled to hundreds of billions of parameters (Wei et al., 2022b): in-context few-shot learning (Brown et al., 2020) makes it possible for an LLM to perform well on a task it never trained on with only a handful of examples; Chain-of-Thought (CoT) prompting (Wei et al., 2022c; Kojima et al., 2022) demonstrates strong reasoning ability of LLMs across diverse tasks with or without few-shot examples;
|
| 16 |
+
|
| 17 |
+
Despite these incredible capabilities of models trained on large text corpus (Brown et al., 2020; Chowdhery et al., 2022), fundamentally improving the model performances beyond few-shot baselines still requires finetuning on an extensive amount of high-quality supervised datasets. FLAN (Wei et al., 2021; Chung et al., 2022) and T0 (Sanh et al., 2022) curated tens of benchmark NLP datasets to boost zero-shot task performances on unseen tasks; InstructGPT (Ouyang et al., 2022) crowd-sourced many human answers for diverse sets of text instructions to better align their model to human instructions; Minerva (Lewkowycz et al., 2022) parsed the full ArXiv database carefully for relevant articles to excel on challenging competitive math and science datasets. The need for large annotated data for supervised LLM training still remains a burden for low-resource applications or specific domains where only limited annotations are available.
|
| 18 |
+
|
| 19 |
+
In this paper, we study how an LLM capable of in-context few-shot learning and chain-ofthought reasoning, is able to self-improve its reasoning ability without supervised data. We show that using only input sequences (without ground truth output sequences) from multiple NLP task datasets, a pre-trained LLM is able to improve performances for both in-domain and out-of-domain tasks. Our method is shown in Figure 1: we first sample multiple predictions using few-shot Chain-of-Thought (CoT) (Wei et al., 2022c) as prompts, filter “high-confidence” predictions using majority voting (Wang et al., 2022c), and finally finetune the LLM on these high-confidence predictions. The resulting model shows improved reasoning in both greedy and multi-path evaluations. We call the model fine-tuned in this way as Language Model Self-Improved (LMSI).
|
| 20 |
+
|
| 21 |
+
Note that LMSI depends on in-context few-shot learning and chain-of-thought reasoning abilities which small language models do not necessarily have. We empirically verify LMSI using a pre-trained 540B PaLM model (Chowdhery et al., 2022), where our method not only significantly improves training task performances $7 4 . 4 \% 8 2 . 1 \%$ on GSM8K, $9 0 . 0 \% 9 4 . 4 \%$ on OpenBookQA, and $6 3 . 4 \% 6 7 . 9 \%$ on ANLI-A3), but also enhances out-of-domain (OOD) tasks, without relying on supervised ground truth answers. Lastly, we explore more extreme cases where training questions and human-curated CoTs are also limited, and propose self-generating additional input questions and few-shot CoT prompts for model self-improving. We hope our simple approaches and strong empirical results could inspire more future work by the community to investigate optimal performances of pretrained LLMs without additional human supervision.
|
| 22 |
+
|
| 23 |
+
Our contributions are summarized as follows:
|
| 24 |
+
|
| 25 |
+
• We demonstrate that a large language model can self-improve by taking datasets without ground truth outputs, by leveraging CoT reasoning (Wei et al., 2022c) and self-consistency (Wang et al., 2022c) to generate diverse reasoning paths for self-training, and can achieve great improvments on in-domain multi-task performances as well as out-of-domain generalization.
|
| 26 |
+
|
| 27 |
+
• We provide detailed ablation studies on training sample formatting and sampling temperature after fine-tuning, and identify critical design choices for most successful self-improvement by LLMs.
|
| 28 |
+
|
| 29 |
+
• We further propose two approaches for model self-improving under extreme low-resource cases where even training questions and CoT prompts are limited, and achieve $7 4 . 2 \%$ on zero-shot GSM8K, against $4 3 . 0 \%$ by Kojima et al. (2022) or $70 . 1 \%$ through its naive extension with Wang et al. (2022c).
|
| 30 |
+
|
| 31 |
+
The rest of this paper is organized as follows. Section 2 discusses related work. Section 3 lays out our method in detail. Section 4 shows our setup for experiments. Section 5 demonstrates our experiment results with ablation studies. Section 6 concludes our work. The chain-of-thought prompts used in our work are included in Appendix A.
|
| 32 |
+
|
| 33 |
+
# 2 Related Work
|
| 34 |
+
|
| 35 |
+
Learning from explanations. Augmenting a machine learning model with explanations has been studied in existing literature extensively. For example, in the supervised learning setting, a model can be fine-tuned using human-annotated rationales (Zaidan et al., 2007; Ling et al., 2017a; Narang et al., 2020; Camburu et al., 2018; Cobbe et al., 2021; Chung et al., 2022). A few works have also looked at how explanations can help the models in various settings, e.g., in-context learning (Lampinen et al., 2022) and in distillation (Pruthi et al., 2022). Lightman et al. (2023) treat explanations as process supervision to train a reward model. In this paper, we focus more on the unsupervised learning setting, where we do not assume we have a rationale-augmented training dataset available, since human-annotated rationales can be expensive.
|
| 36 |
+
|
| 37 |
+
Few-shot explanations improves reasoning in LLMs. Recently, a lot of progress has been made towards improving LLMs’ reasoning abilities via prompting or in-context learning. Wei et al. (2022c) propose Chain-of-Thought prompting, which prompts the language model to generate a series of natural-language-based intermediate steps, and show it can help language models better solve complex and multi-step reasoning tasks, with recent study (Wang et al., 2022a) analyzing the relevant contents and correct reasoning order being the most crucial factor of the success of Chain-ofThought prompting. Wang et al. (2022c) improve Chain-of-Thought prompting by sampling multiple diverse reasoning paths and finding the most consistent answers via majority voting. Kojima et al. (2022); Zhang et al. (2022) propose to prompt the language model with “Let’s think step by step” to generate reasoning in a zero-shot fashion. Zhou et al. (2022) decompose the questions into multiple sub-questions, and ask the language model to solve each sub-question sequentially.
|
| 38 |
+
|
| 39 |
+
Refining explanations. More recent work proposes to further refine the generated reasoning paths as some of them could be unreliable. For example, Ye and Durrett (2022) calibrate model predictions based on the reliability of the explanations, Jung et al. (2022) show that inducing a tree of explanations and inferring the satisfiability of each explanation can further help judge the correctness of explanations. Li et al. (2022a) show that sampling a diverse set of prompts from the training data, and a voting verifier can be used to improve model’s reasoning performance. Xi et al. (2023) and Zheng et al. (2023) propose to polish the problem progressively before the model reaching a stable answer. Zelikman et al. (2022) proposes better rationale generation by augmenting ground truth answers as hints when predicted answers are incorrect. Our work is orthogonal to these lines of work, as we utilize refined explanations for model selfimprovement, and could readily incorporate these other refinement techniques for generating higherquality self-training data. Our work is closely related to Zelikman et al. (2022) where we both propose to fine-tune a model on self-generated CoT data, but our method does not require ground truth labels and shows stronger empirical results with multi-task generalization. Different from existing work, we show that a mixture of the reasoningpath refinement techniques can be combined to further improve the quality of the generated reasoning paths, which is shown to be effective in boosting model’s performance via self-improvement.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: Overview of our method. With Chain-of-Thought (CoT) examples as demonstration (Wei et al., 2022c), the language model generates multiple CoT reasoning paths and answers (temperature $T > 0$ ) for each question. The most consistent answer is selected by majority voting (Wang et al., 2022c). The CoT reasoning paths that lead to the answer with the highest confidence are augmented by mixed formats, and are fed back to the model as the final training samples.
|
| 43 |
+
|
| 44 |
+
Self-training models. One related line of work is self-training (see a survey from Amini et al. (2022)). The key idea is to assign pseudo labels from a learned classifier to unlabeled data, and use these pseudo-labeled examples to further improve the original model training, e.g., (RoyChowdhury et al., 2019; Xie et al., 2020; He et al., 2020; Chen et al., 2021). Different from such prior work, our proposed self-improvement framework uses CoT prompting plus self-consistency to obtain highconfidence solutions on a large set of unlabeled data to augment the fine-tuning process.
|
| 45 |
+
|
| 46 |
+
Distillation and dark knowledge. Language models are known to preserve parametric knowledge (Schick and Schütze, 2020a,b) during the pretraining stage. Our method tangentially relates to rich literature on distillation (Ba and Caruana, 2014; Hinton et al., 2015), where a student network imitates a teacher network’s classifier predictions on input examples. A key detail is to learn from soft targets instead of hard predicted labels, as softmax outputs with a high temperature reveal more detailed relative class likelihoods, colloquially known as dark knowledge (Hinton et al., 2015; Korattikara Balan et al., 2015). Recent studies (Zelikman et al., 2022; Snell et al., 2022; Eisenstein et al., 2022) show that dark knowledge within LLMs can be retrieved with more computation at inference time, such as adding informative instructions into the input sequence and output CoT generation (Wei et al., 2022c; Kojima et al., 2022). Recent works (Magister et al., 2022; dhar et al., 2023; Ho et al., 2023) demonstrated that distillation on explanations generated from large models can increase the reasoning abilities of smaller models with ground truth filtering.
|
| 47 |
+
|
| 48 |
+
# 3 Method
|
| 49 |
+
|
| 50 |
+
The overview of our method is illustrated in Fig. 1: We are given a pre-trained Large Language Model (LLM) $M$ and a question-only train
|
| 51 |
+
|
| 52 |
+
Question: Stefan goes to a restaurant with his family. They order an appetizer that costs $\$ 10$ and 4 entrees that are $\$ 20$ each. If they tip $20 \%$ of the total, what is the total amount of money that they spend?
|
| 53 |
+
|
| 54 |
+
# Multiple Path Decoding:
|
| 55 |
+
|
| 56 |
+
Output 1: The appetizer costs $\$ 10$ . The entrees cost $\$ 20$ each so in total $4 * \ S 2 0 = \ S 8 0$ . This means the total cost is $\$ 10+580=590$ . They tip $20 \%$ of it, so the total amount they spend is $\$ 90 *1.2$ $= \$ 108$ . The answer is 108.
|
| 57 |
+
|
| 58 |
+
Output 2: The appetizer costs $\$ 10$ and the entrees are $\$ 20$ each. There are 4 entrees so the sum is $\$ 20 *4=\ S 80$ . The waiter gets $20 \%$ of the total. $20 \%$ of $\$ 80$ is $\$ 80 *.2=916$ . The answer is $\$ 80$ $+ \$ 16= \$ 96$ . (Incorrect reasoning path)
|
| 59 |
+
|
| 60 |
+
Output 3: The appetizer costs $\$ 10$ . The entrees cost $4 * \$ 20=980$ . The tip is $20 \%$ of the total, so it is $20 \%$ of the $\$ 90$ they have spent. The tip is $0 . 2 * 9 0 = \$ 18$ . The total they spent is $\$ 90+\$ 18$ $= \$ 108$ . The answer is 108.
|
| 61 |
+
|
| 62 |
+
ing dataset $\mathcal { D } ^ { \mathrm { t r a i n } } = \{ x _ { i } \} _ { i = 1 } ^ { D }$ with few-shot Chainof-Thought $( \mathrm { C o T } )$ examples (Wei et al., 2022c). We apply multiple path decoding with a sampling temperature $T \ > \ 0$ for generating $m$ reasoning paths and answers $\{ r _ { i _ { 1 } } , r _ { i _ { 2 } } , \ldots , r _ { i _ { m } } \}$ for each question $x _ { i }$ in $\scriptstyle { \mathcal { D } } ^ { \mathtt { t r a i n } }$ , and use majority voting (selfconsistency) to select the most consistent, highest confidence answer (Wang et al., 2022c). We then keep all reasoning paths that lead to the most consistent answer, apply mixed formats of prompts and answers for augmentation, and fine-tune the model on these self-generated reasoning-answer data. We consider our approach as making the model self-improve. In the following sections, we detail important designs within our method, along with additional approaches for the model to selfimprove without supervised data.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: The relation of accuracy and confidence of the majority-voted answer after multiple path decoding on GSM8K training-set questions. A recent study (Kadavath et al., 2022) shows that language models are not perfectly-calibrated though their calibration increases with model size, and models with more than 10B parameters are reasonably calibrated on some few-shot tasks. This aligns well with our study and serve as the basis of this self-improving method.
|
| 66 |
+
|
| 67 |
+
# 3.1 Generating and Filtering Multiple Reasoning Paths
|
| 68 |
+
|
| 69 |
+
Self-consistency (Wang et al., 2022c) brings large improvements on reasoning tasks (e.g., $5 6 . 5 \% $ $7 4 . 4 \%$ on GSM8K test set), and the gap between greedy decoding and diverse decoding shows there is a potential for further improving the reasoning ability of $M$ , using the self-selected highconfidence reasoning paths as training data.
|
| 70 |
+
|
| 71 |
+
For each training question $x _ { i }$ , we sample $m$ CoT reasoning paths, denoted as $\{ r _ { i _ { 1 } } , r _ { i _ { 2 } } , \ldots , r _ { i _ { m } } \}$ (see Table 1 for examples). An example of a training question with the self-generated CoT reasoning paths is shown in Table 1. Since $M$ is prompted with the CoT examples from Wei et al. (2022c), we apply the same output parsing with “The answer is” to generate their predicted answers $\{ y _ { i _ { 1 } } , y _ { i _ { 2 } } , . . . , y _ { i _ { m } } \}$ . The most consistent answer, which is not necessarily a correct answer, is selected by majority voting, denoted as $\begin{array} { r } { \tilde { y } _ { i } = \mathrm { a r g } \operatorname* { m a x } _ { y _ { i _ { j } } } \sum _ { k = 1 } ^ { m } \mathbb { I } ( y _ { i _ { j } } = y _ { i _ { k } } ) } \end{array}$ . In Table 1, the most consistent answer $\tilde { y }$ is 108, derived by output path 1 and output path 3, while the output path 2 makes a mistake in calculating the cost of the foods. For all the training questions, we filter the CoT reasoning paths that reach $\tilde { y }$ as the final answer to be put into the self-training data,
|
| 72 |
+
|
| 73 |
+
Table 2: An example of how a reasoning path is augmented into four formats of training data with different prompts (in input) and answer styles (in output). Specifically, the CoT prompting examples used for each tasks are listed in Appendix A.2. The Standard prompting examples are the same question-answer pairs with CoT prompting examples, except that reasoning is removed.
|
| 74 |
+
|
| 75 |
+
<table><tr><td>Question: Amy is 1O years old. Jake is 8 years old. Alex's age is right in the middle. How old is Alex? Selected Chain-of-Thought: Amy is 1O years old. Jake is 8 years old. Alex's age is in the middle of Amy and Jake, so Alex is(8 + 10) /2= 9 years old. The answer is 9.</td></tr><tr><td>Mixed-formats of training data: Format 1: Input: [CoT prompting examples] + ‘\n’ + [Question] +"\n’ +‘A:' Output: Amy is 10 years old. Jake is 8 years old. Alex's age is in the middle of Amy and Jake, so Alex</td></tr><tr><td>is(8 + 10)/2 =9 years old. The answer is 9. Format 2: Input: [Standard prompting examples] + "\n’ + [Question] + '\n' + ‘A:</td></tr><tr><td>Output: The answer is 9.</td></tr><tr><td>Format 3: Input: [Question] + ‘\n’ + ‘A: Let's think step by step.'</td></tr><tr><td></td></tr><tr><td>Output: Amy is 10 years old. Jake is 8 years old. Alex's age is in the middle of Amy and Jake, so Alex is(8 + 10)/2=9 years old. The answer is 9.</td></tr><tr><td>Format4:Input:[Ouestion]+‘\n'+‘A:'</td></tr></table>
|
| 76 |
+
|
| 77 |
+
Output: The answer is 9.
|
| 78 |
+
|
| 79 |
+
denoted as Dself−consistent $\mathbf { \Sigma } = \{ x _ { i } , \tilde { r _ { i } } \}$ , where $\tilde { r _ { i } } = \{ r _ { i _ { j } } | 1 \le j \le m , y _ { i _ { j } } = \tilde { y } _ { i } \}$ .
|
| 80 |
+
|
| 81 |
+
Since we do not use any ground truth labels to filter out cases where $\tilde { y } _ { i } \ne y _ { i }$ , it is important that the self-generated CoT reasoning paths are mostly reliable and incorrect answers do not hurt the self-improvement of the model. We plot the relation between the accuracy and confidence of selfgenerated CoT paths for each question in GSM8K training set in Fig. 2. The confidence is the number of CoT paths leading to $\tilde { y }$ divided by the total path number $m$ . The y-axis shows the accuracy of $\tilde { y }$ under a certain confidence. The circle area and the color darkness shows the number of questions under a certain confidence. We can observe that confident answers are more likely to be correct, which means that when a question has many consistent CoT paths, then the corresponding $\tilde { y }$ is more likely to be correct. On the other hand, when $\tilde { y }$ is wrong, it is likely to be supported by fewer CoT paths, and brings little noise to the training samples.
|
| 82 |
+
|
| 83 |
+
ble 2. In the first format, a few Chain-of-Thought examples (questions followed by reasoning paths leading to the correct final answers) are prepended to the new question, while the language model output is trained to be the same with the filtered CoT reasoning paths. In the second format, we use examples of questions and their direct answers as standard prompting, and the language model output is supposed to also only contain the direct answer. The third and fourth format are similar to the first and second format, except that no example of question-answer pairs are given, so that the model will learn to think on its own in an in-context zero-shot manner. In the third format, where we want the model to output CoT reasoning without prepending examples containing CoT reasonings, we append “Let’s think step by step.” at the end of the input sequence, to guide the language model to generate step-by-step CoT reasoning paths (Kojima et al., 2022). The mixed formats of training samples are then used to fine-tune the pre-trained language model $M$ .
|
| 84 |
+
|
| 85 |
+
# 3.2 Training with Mixed Formats
|
| 86 |
+
|
| 87 |
+
To prevent the language model from overfitting to specific prompts or answer styles, we create four different formats for each reasoning path to be mixed in the self-training data, shown in Ta
|
| 88 |
+
|
| 89 |
+
# 3.3 Generating Questions and Prompts
|
| 90 |
+
|
| 91 |
+
In some cases where even training questions or human-curated CoT prompts are limited, our method may not generate sufficient training samples for language model self-training. Therefore, we investigate how to self-generate more training questions as well as example prompts to further reduce human effort.
|
| 92 |
+
|
| 93 |
+
Question Generation. Previous work (Yoo et al., 2021; Meng et al., 2022) discuss few-shot data augmentation by generating diverse training samples using LLMs. However, those methods are designed for classification tasks and require ground truth label for each few-shot example. We use a simple yet effective approach to generate diverse questions (without using ground truth answers) from a few example questions. Specifically, we randomly sample and concatenate example questions in a random order as input prompt, and let the language model generate consecutive sequences as new questions. We repeat the process to obtain a large set of new questions, then use self-consistency (Wang et al., 2022c) to only keep the questions that have a highly confident answer. Those questions are then used as self-generated training questions.
|
| 94 |
+
|
| 95 |
+
Prompt Generation. Given a set of questions, humans can write CoT examples as reasoning paths leading to the final answer. In zero-shot setting without manual prompts, we can generate these CoT paths using the model itself. Following (Kojima et al., 2022), we start the answer with “A: Let’s think step by step.” and let the language model generate the consecutive reasoning paths. We then use those generated reasoning paths as examples for few-shot CoT prompting.
|
| 96 |
+
|
| 97 |
+
# 4 Experimental Setup
|
| 98 |
+
|
| 99 |
+
Tasks and Datasets. We demonstrate the effectiveness of our method on three types of tasks1:
|
| 100 |
+
|
| 101 |
+
• Arithmetic reasoning: We use the math problem set GSM8K (Cobbe et al., 2021), and a reading comprehension benchmark DROP (Dua et al., 2019) which requires numerical reasoning. We follow (Zhou et al., 2022) to partition the DROP dataset into football related and non-football related subsets for training.
|
| 102 |
+
|
| 103 |
+
• Commonsense reasoning: We use the OpenBookQA (Mihaylov et al., 2018) dataset, and the AI2 Reasoning Challenge (ARC) (Clark et al., 2018) dataset. Note that for ARC, we only use the Challenge sub-set (ARC-c) in our experiments. Both datasets contain multiple-choice questions.
|
| 104 |
+
|
| 105 |
+
• Natural Language Inference: We use the Adversarial NLI (ANLI) (Mihaylov et al., 2018) subsets, ANLI-A2 and ANLI-A3, which are the more challenging subsets compared to ANLI-A1. These datasets contain pairs of sentences with relations of entailment, neutral, or contradiction.
|
| 106 |
+
|
| 107 |
+
Models, Training settings and Hyperparameters. We follow previous studies (Wei et al., 2022c; Wang et al., 2022c) and conduct our experiments on the PaLM 540B model (Chowdhery et al., 2022), an autoregressive Transformer-based language model. The CoT examples for each dataset are listed in Appendix A.2. We generate $m = 3 2$ reasoning paths for each question in a training set, followed by format augmentation in Sec. 3.2. For DROP and ANLI-A2/A3, we sample $5 \mathrm { k }$ examples for reasoning path generation to reduce the training burden; For other datasets, we keep the whole training set. For each dataset, we fine-tune the model for $1 0 \mathrm { k }$ steps with a learning rate of $5 \mathrm { e } - 5$ and a batch size of 32. We use a sampling temperature of $T = 0 . 7$ with the pre-trained model as suggested by (Wang et al., 2022c). We use $T = 1 . 2$ for the language model after self-improvement (LMSI ). We set the maximum number of decoded steps to 256 for all experiments.
|
| 108 |
+
|
| 109 |
+
# 5 Experiments and Results
|
| 110 |
+
|
| 111 |
+
We conduct a series of experiments to demonstrate the effectiveness of our proposed self-improving method. First, we apply our method on each individual dataset (task) and report the results. We then merge the generated data from all datasets and train one model to study the generalization ability of the model on unseen datasets as in (Wei et al., 2021). In addition to the results of using generated CoT reasoning paths, we show studies on generating input questions and few-shot prompts. We end with ablation studies on model sizes and hyperparameters.
|
| 112 |
+
|
| 113 |
+
# 5.1 Main Results
|
| 114 |
+
|
| 115 |
+
We list the results of using the 540B PaLM model before and after LMSI in Table 3. For each model, during test time, we apply three separate prompting methods on all six datasets: standard-prompting, CoT-Prompting, and Self-Consistency. We observe that after LMSI , the performance of all three prompting methods increase by a large margin. We observe significant improvement, comparing selfconsistency versus LMSI with self-consistency: $+ 7 . 7 \%$ on GSM8K, $+ 4 . 8 \%$ on DROP, $+ 4 . 4 \%$ on OpenBookQA, and $+ 4 . 5 \%$ on ANLI-A3. This shows that our proposed method is quite effective. Furthermore, the single path CoT-Prompting performance of LMSI is close to or even better than the multiple path Self-Consistency performance of the model without LMSI , showing that LMSI truly helps the language model learn from the multiple consistent reasoning paths. We also apply LMSI on a recently proposed public language model, UL2 (20B) (Tay et al., 2022), and show the results in Appendix A.1. Compared to the 540B PaLM model (decoder-only), UL2 has a smaller scale, and a different architecture (encoder-decoder). We observe that for most datasets, LMSI still outperforms the original UL2 results, but the improvement is not as large as that on the 540B PaLM model.
|
| 116 |
+
|
| 117 |
+
Table 3: Accuracy results on six reasoning benchmarks with or without LMSI using different prompting method.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Prompting Method</td><td> w. or w/o LMSI</td><td>GSM8K</td><td>DROP</td><td>ARC-c</td><td>OpenBookQA</td><td>ANLI-A2</td><td>ANLI-A3</td></tr><tr><td>Standard-Prompting</td><td>w/o LMSI w. LMSI</td><td>17.9 32.2 (+14.3)</td><td>60.0 71.7 (+11.7)</td><td>87.1 87.2 (+0.1)</td><td>84.4 92.0 (+7.6)</td><td>55.8 64.8 (+9.0)</td><td>55.8 66.9 (+11.1)</td></tr><tr><td>CoT-Prompting</td><td>w/o LMSI w. LMSI</td><td>56.5 73.5 (+17.0)</td><td>70.6 76.2 (+5.6)</td><td>85.2 88.3 (+3.1)</td><td>86.4 93.0 (+6.6)</td><td>58.9 65.3 (+6.4)</td><td>60.6 67.3 (+6.7)</td></tr><tr><td>Self-Consistency</td><td>w/o LMSI w. LMSI</td><td>74.4 82.1 (+7.7)</td><td>78.2 83.0 (+4.8)</td><td>88.7 89.8 (+1.1)</td><td>90.0 94.4 (+4.4)</td><td>64.5 66.5 (+2.0)</td><td>63.4 67.9 (+4.5)</td></tr></table>
|
| 120 |
+
|
| 121 |
+
Table 4: Comparison of CoT-prompting accuracy results on six Out-Of-Domain benchmarks with or without training on six In-Domain (GSM8K, DROP, ARC-c, OpenBookQA, ANLI-A2, ANLI-A3) training-set questions.
|
| 122 |
+
|
| 123 |
+
<table><tr><td></td><td>Self-training data</td><td>AQUA</td><td> SVAMP</td><td> StrategyQA</td><td>ANLI-A1</td><td>RTE</td><td>MNLI-M/MM</td></tr><tr><td>w/o LMSI</td><td>-</td><td>35.8</td><td>79.0</td><td>75.3</td><td>68.8</td><td>79.1</td><td>72.0/74.0</td></tr><tr><td>w. LMSI</td><td>GSM8K + DROP +...</td><td>39.0 (+3.2)</td><td>82.8 (+3.8)</td><td>77.8 (+2.5)</td><td>79.2 (+10.4)</td><td>80.1 (+1.0)</td><td>81.8/82.2 (+9.8/+8.2)</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Multi-task self-training for unseen tasks. To demonstrate the generalization ability of LMSI , we conduct experiments of self-training on a mixture of the training-set questions from the above six datasets (denoted as In-Domain tasks), then use the same model checkpoint for the evaluation on six Out-Of-Domain (OOD) tasks, as shown in Table 4. Of all the OOD tasks: (1) AQUA (Ling et al., 2017b) and SVAMP (Patel et al., 2021) are arithmetic reasoning tasks; (2) StrategyQA (Geva et al., 2021) is a commonsense reasoning task; (3) ANLIA1 (Nie et al., 2019), RTE (Dagan et al., 2005) and MNLI-M/MM (Williams et al., 2018) are natural language inference tasks.2 Among these tasks, AQUA, StrategyQA, and RTE are significantly different from any In-Domain task, and have their own few-shot prompts. From Table 4, we observe that LMSI achieves higher accuracy results on all OOD tasks, showing that the overall reasoning ability of the language model is improved.
|
| 126 |
+
|
| 127 |
+
Importance of training with augmented formats. We demonstrate the importance of training language models with augmented formats (both Chainof-Thought prompting and direct prompting, and both few-shot prompting and zero-shot prompting). In Table 5, we list the results of LMSI with all four formats, the results of LMSI with only direct answer formats, and the results of LMSI with only few-shot Chain-of-Thought prompting formats. The results show that without the CoT formats, the language model can still self-improve, but the performance gain drops by a large amount compared to using all four formats. However, if only using few-shot CoT prompting format for selftraining, the model can overfit to the prompting style and may not generalize well on downstream tasks.
|
| 128 |
+
|
| 129 |
+
# 5.2 Pushing the limit of self-improvements
|
| 130 |
+
|
| 131 |
+
Self-Generating Questions We further explore the few-shot setting where there are only limited training questions in the target domain. On GSM8K, we sample 10 real questions as few-shot samples, and use the language model to generate more training questions using the method in Section 3.3. We then self-train the language model with these generated questions and list the results in Table 6. The results show that using self-generated questions still improves the reasoning ability of language models, but using the real training-set questions leads to better results.
|
| 132 |
+
|
| 133 |
+
Table 5: Ablation study: LMSI with different combinations of training format on GSM8K dataset.
|
| 134 |
+
|
| 135 |
+
<table><tr><td colspan="2">Results on GSM8K</td></tr><tr><td>w/o LMSI</td><td>Std. Prompting CoT Prompting 17.9 56.5</td></tr><tr><td>LMSI w/o CoT formats</td><td>23.6 (+5.7)</td></tr><tr><td>LMSI only few-shot CoT</td><td>61.6 (+5.1) 69.4 (+12.9)</td></tr><tr><td>LMSI w/CoT formats</td><td>29.2 (+11.3) 32.2 (+14.3) 73.5 (+17.0)</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 6: Accuracy on GSM8K test set after self-training on different question sets. Results are shown for both CoT-Prompting (CoT) and Self-Consistency (SC).
|
| 138 |
+
|
| 139 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Questions used for Self-Training</td><td colspan="2">GSM8K</td></tr><tr><td>CoT</td><td>SC</td></tr><tr><td>w/o LMSI</td><td></td><td>56.5</td><td>74.4</td></tr><tr><td>w. LMSI</td><td>Generated</td><td>66.2 (+9.7)</td><td>78.1 (+3.7)</td></tr><tr><td>w. LMSI</td><td>Training-set</td><td>73.5 (+17.0)</td><td>82.1 (+7.7)</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Self-Generating Few-Shot CoT Prompts. We explore the situation where no in-domain CoT examples are provided for a task. We apply the Stepby-Step method (Kojima et al., 2022) to generate CoT examples using the language model as described in Section 3.3, and show the results in Figure 3. We observe that few-shot prompting with self-generated Step-by-Step CoT examples substantially outperforms the Step-by-Step (Kojima et al., 2022) baseline $6 6 . 2 \%$ vs $5 3 . 8 \%$ at 10 paths, $7 4 . 2 \%$ vs $7 0 . 1 \%$ at 40 paths), and nearly matches the performance of human-written few-shot CoT (Wei et al., 2021) $( 7 4 . 4 \%$ at 40 paths (Wang et al., 2022c)). The strong performance of “Few-Shot w/ Step-by-Step” despite the limited accuracy of prompt examples ( $4 3 . 0 \%$ for greedy Step-by-Step) likely comes from leveraging more diverse CoT prompts for multi-path decoding (Li et al., 2022b), where at 40 paths it uses 20 generate prompttemplates, each with 4-shot CoT examples, i.e. a total of 80 generated CoT examples compared to 8 human-written examples use in Wei et al. (2022c).
|
| 142 |
+
|
| 143 |
+
Since we did not use training questions or few-shot CoT examples, $7 4 . 2 \%$ also marks the new state-ofthe-art zero-shot performance on GSM8K.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: Accuracy results on GSM8K test set using 540B model with multi-path sampling and selfconsistency (Wang et al., 2022c). “Step-by-Step” is the baseline performance of Kojima et al. (2022) plus selfconsistency (Wang et al., 2022c), while our “Few-Shot w/ Step-by-Step” uses exemplers self-generated from Step-by-Step (greedy decoding) for few-shot prompting the LLM.
|
| 147 |
+
|
| 148 |
+
# 5.3 Distillation to smaller models
|
| 149 |
+
|
| 150 |
+
Table 7: Distillation from 540B model to small models. We see that distilled smaller models outperform models that are one-tier larger.
|
| 151 |
+
|
| 152 |
+
<table><tr><td></td><td colspan="3">Results on GSM8K</td></tr><tr><td></td><td>8 billion</td><td>62 billion</td><td>540 billion</td></tr><tr><td>w/o LMSI</td><td>5.0</td><td>29.7</td><td>56.5</td></tr><tr><td>Distilled from LMSI</td><td>33.4 (+28.4)</td><td>57.4 (+27.7)</td><td>-</td></tr></table>
|
| 153 |
+
|
| 154 |
+
We also explore whether the knowledge can be distilled to smaller models, such as in distillation (Hinton et al., 2015) and in Zelikman et al. (2022). We use the same set of training samples generated by the 540B PaLM model, but fine-tune on models with smaller sizes (8B PaLM model and 62B PaLM model respectively), and show the results of CoT-prompting in Table 7. It is interesting to point out that after distillation from LMSI , the 62B model can outperform the pre-trained 540B model, and the 8B model can outperform the pre-trained 62B model. This implies that for downstream applications with limited computing resources, the reasoning knowledge from large models can be used to largely enhance small models to achieve competitive performance.
|
| 155 |
+
|
| 156 |
+
# 5.4 Hyperparameter Studies
|
| 157 |
+
|
| 158 |
+
Sampling Temperature after Self-Improvement. We study the effect of varying the temperature $T$ for multiple path decoding after LMSI is applied. Specifically, we vary $T$ between [0.7, 1.0, 1.2, 1.5] and show the results on GSM8K and DROP dataset respectively in Fig. 4. As shown in the figure, $T = 1 . 2$ benefits both datasets the most, and is used in the Self-Consistency method for LMSI on all datasets. We notice that the optimal $T$ after model self-improvement is larger than the optimal $T = 0 . 7$ (Wang et al., 2022c) before selfimprovement. We believe the reason is that after training the model, the entropy of the output distribution is reduced.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 4: Accuracy results of LMSI on GSM8K and DROP test set when different sampling temperatures are applied for Self-Consistency.
|
| 162 |
+
|
| 163 |
+
Number of Sampled Reasoning Paths. We study whether the number of sampled reasoning paths $m$ for Self-Consistency largely affects the accuracy after LMSI is applied. We show the accuracy on GSM8K test set for models both with or without LMSI in Fig. 5. For both cases, setting $m = 1 5$ already achieves a reasonably good accuracy, and using a larger $m$ only brings marginal improvements. We also notice that after SelfImprovement, using 5 paths for Self-Consistency can already surpass the performance of using 32 paths for model without Self-Improvement. Thus, with a well-improved model, huge computing resources can be saved when applied to real applications.
|
| 164 |
+
|
| 165 |
+
# 6 Conclusions
|
| 166 |
+
|
| 167 |
+
We demonstrated that a Large Language Model (LLM) is capable of improving its performance on reasoning datasets by training on its own generated labels, given input questions only. Experiments using the PaLM model with 540 billion parameters show that LMSI improves the accuracy scores by $1 . 1 \%$ to $7 . 7 \%$ on six datasets, without training on ground truth labels. Furthermore, we show that it is possible for the LLM to self-improve even on its own generated questions and few-shot CoT prompts. As part of our future work, we plan to combine large-scale generated data from LMSI and existing supervised data, to further improve the performance of LLMs.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 5: Accuracy results with or without LMSI on GSM8K test set using different numbers of sampled reasoning path for Self-Consistency.
|
| 171 |
+
|
| 172 |
+
# Limitations
|
| 173 |
+
|
| 174 |
+
Our approach mainly relies on the effectiveness of demonstration-based in-context few-shot learning which works most effectively on large language models, according to Wei et al. (2022a). For example, Zelikman et al. (2022) showed that a 6B model, GPT-J, achieves only $3 . 1 \%$ accuracy on GSM8K with few-shot CoT prompting, while GPT-3 (175 B) achieves $4 6 . 9 \%$ , according to Wei et al. (2022c). Moreover, a recent study (Kadavath et al., 2022) shows that language model calibration increases with model size. This aligns well with our observations that larger models are better at self-improving. Based on these existing studies, we believe that LMSI is more applicable to large-scale language models. In addition, we show that distillation from large models to small models are very promising in Sec. 5.3. Therefore, smaller models can also be improved when large model APIs are accessible. We are fortunate to have enough resources for this work. Though the computation requirements for training large-scale language models are still prohibitively high for most researchers to conduct empirical studies along this line, we believe that our findings are conceptually useful for the NLP community by providing new insights for the properties of large language models.
|
| 175 |
+
|
| 176 |
+
# Acknowledgments
|
| 177 |
+
|
| 178 |
+
We thank anonymous reviewers for valuable and insightful feedback.
|
| 179 |
+
|
| 180 |
+
# References
|
| 181 |
+
|
| 182 |
+
Massih-Reza Amini, Vasilii Feofanov, Loic Pauletto, Emilie Devijver, and Yury Maximov. 2022. Selftraining: A survey.
|
| 183 |
+
|
| 184 |
+
Jimmy Ba and Rich Caruana. 2014. Do deep nets really need to be deep? Advances in neural information processing systems, 27.
|
| 185 |
+
|
| 186 |
+
BIG bench collaboration. 2022. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. ArXiv, abs/2206.04615.
|
| 187 |
+
|
| 188 |
+
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, T. J. Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeff Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Neurips.
|
| 189 |
+
|
| 190 |
+
Oana-Maria Camburu, Tim Rocktäschel, Thomas Lukasiewicz, and Phil Blunsom. 2018. e-snli: Natural language inference with natural language explanations. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems 31, pages 9539–9549. Curran Associates, Inc.
|
| 191 |
+
|
| 192 |
+
Xiaokang Chen, Yuhui Yuan, Gang Zeng, and Jingdong Wang. 2021. Semi-supervised semantic segmentation with cross pseudo supervision. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR).
|
| 193 |
+
|
| 194 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek B Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Benton C. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier García, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Oliveira Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Díaz, Orhan Firat, Michele Catasta, Jason Wei, Kathleen S. Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. 2022. Palm: Scaling language modeling with pathways. ArXiv, abs/2204.02311.
|
| 195 |
+
|
| 196 |
+
Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Adams Yu, Albert Webson, Xinyun Chen, Gaurav Mishra, Zhuyun Dai, Shixiang Shane Gu, Mirac Suzgun, Vincent Zhao, Aakanksha Chowdhery, Sharan Narang, Yanping Huang, Andrew Dai, Hongkun Yu, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei. 2022. Scaling instruction-finetuned language models. In arxiv.
|
| 197 |
+
|
| 198 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. 2018. Think you have solved question answering? try arc, the ai2 reasoning challenge. ArXiv, abs/1803.05457.
|
| 199 |
+
|
| 200 |
+
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. 2021. Training verifiers to solve math word problems. ArXiv, abs/2110.14168.
|
| 201 |
+
|
| 202 |
+
Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The pascal recognising textual entailment challenge. In MLCW.
|
| 203 |
+
|
| 204 |
+
Kumar Shri dhar, Alessandro Stolfo, and Mrinmaya Sachan. 2023. Distilling reasoning capabilities into smaller language models. In ACL.
|
| 205 |
+
|
| 206 |
+
Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. 2019. Drop: A reading comprehension benchmark requiring discrete reasoning over paragraphs. In NAACL.
|
| 207 |
+
|
| 208 |
+
Jacob Eisenstein, Daniel Andor, Bernd Bohnet, Michael Collins, and David Mimno. 2022. Honest students from untrusted teachers: Learning an interpretable question-answering pipeline from a pretrained language model. arXiv preprint arXiv:2210.02498.
|
| 209 |
+
|
| 210 |
+
Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. 2021. Did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies. Transactions of the Association for Computational Linguistics, 9:346– 361.
|
| 211 |
+
|
| 212 |
+
Junxian He, Jiatao Gu, Jiajun Shen, and Marc’Aurelio Ranzato. 2020. Revisiting self-training for neural sequence generation. In International Conference on Learning Representations.
|
| 213 |
+
|
| 214 |
+
Geoffrey Hinton, Oriol Vinyals, Jeff Dean, et al. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2(7).
|
| 215 |
+
|
| 216 |
+
Namgyu Ho, Laura Schmid, and Se-Young Yun. 2023. Large language models are reasoning teachers. ArXiv.
|
| 217 |
+
|
| 218 |
+
Jaehun Jung, Lianhui Qin, Sean Welleck, Faeze Brahman, Chandra Bhagavatula, Ronan Le Bras, and Yejin Choi. 2022. Maieutic prompting: Logically consistent reasoning with recursive explanations.
|
| 219 |
+
|
| 220 |
+
Saurav Kadavath, Tom Conerly, Amanda Askell, T. J. Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zachary Dodds, Nova DasSarma, Eli TranJohnson, Scott Johnston, Sheer El-Showk, Andy Jones, Nelson Elhage, Tristan Hume, Anna Chen, Yuntao Bai, Sam Bowman, Stanislav Fort, Deep Ganguli, Danny Hernandez, Josh Jacobson, John Kernion, Shauna Kravec, Liane Lovitt, Kamal Ndousse, Catherine Olsson, Sam Ringer, Dario Amodei, Tom B. Brown, Jack Clark, Nicholas Joseph, Benjamin Mann, Sam McCandlish, Christopher Olah, and Jared Kaplan. 2022. Language models (mostly) know what they know. ArXiv, abs/2207.05221.
|
| 221 |
+
|
| 222 |
+
Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. 2022. Large language models are zero-shot reasoners. Neural Information Processing Systems (NeurIPS).
|
| 223 |
+
|
| 224 |
+
Anoop Korattikara Balan, Vivek Rathod, Kevin P Murphy, and Max Welling. 2015. Bayesian dark knowledge. Advances in neural information processing systems, 28.
|
| 225 |
+
|
| 226 |
+
Andrew K. Lampinen, Ishita Dasgupta, Stephanie C. Y. Chan, Kory Matthewson, Michael Henry Tessler, Antonia Creswell, James L. McClelland, Jane X. Wang, and Felix Hill. 2022. Can language models learn from explanations in context?
|
| 227 |
+
|
| 228 |
+
Aitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer, Henryk Michalewski, Vinay Venkatesh Ramasesh, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur, Guy Gur-Ari, and Vedant Misra. 2022. Solving quantitative reasoning problems with language models. ArXiv, abs/2206.14858.
|
| 229 |
+
|
| 230 |
+
Yifei Li, Zeqi Lin, Shizhuo Zhang, Qiang Fu, Bei Chen, Jian-Guang Lou, and Weizhu Chen. 2022a. On the advance of making language models better reasoners.
|
| 231 |
+
|
| 232 |
+
Yifei Li, Zeqi Lin, Shizhuo Zhang, Qiang Fu, Bei Chen, Jian-Guang Lou, and Weizhu Chen. 2022b. On the advance of making language models better reasoners. ArXiv, abs/2206.02336.
|
| 233 |
+
|
| 234 |
+
Hunter Lightman, Vineet Kosaraju, Yura Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2023. Let’s verify step by step. ArXiv, abs/2305.20050.
|
| 235 |
+
|
| 236 |
+
Lucie Charlotte Magister, Jonathan Mallinson, Jakub Adamek, Eric Malmi, and Aliaksei Severyn. 2022. Teaching small language models to reason. ArXiv, abs/2212.08410.
|
| 237 |
+
|
| 238 |
+
Wang Ling, Dani Yogatama, Chris Dyer, and Phil Blunsom. 2017b. Program induction by rationale generation: Learning to solve and explain algebraic word problems. In ACL.
|
| 239 |
+
|
| 240 |
+
Yu Meng, Jiaxin Huang, Yu Zhang, and Jiawei Han. 2022. Generating training data with language models: Towards zero-shot language understanding. ArXiv, abs/2202.04538.
|
| 241 |
+
|
| 242 |
+
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. 2018. Can a suit of armor conduct electricity? a new dataset for open book question answering. In EMNLP.
|
| 243 |
+
|
| 244 |
+
Wang Ling, Dani Yogatama, Chris Dyer, and Phil Blunsom. 2017a. Program induction by rationale generation: Learning to solve and explain algebraic word problems. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
|
| 245 |
+
|
| 246 |
+
Sharan Narang, Colin Raffel, Katherine Lee, Adam Roberts, Noah Fiedel, and Karishma Malkan. 2020. Wt5?! training text-to-text models to explain their predictions.
|
| 247 |
+
|
| 248 |
+
Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. 2019. Adversarial nli: A new benchmark for natural language understanding. ArXiv, abs/1910.14599.
|
| 249 |
+
|
| 250 |
+
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155.
|
| 251 |
+
|
| 252 |
+
Arkil Patel, S. Bhattamishra, and Navin Goyal. 2021. Are nlp models really able to solve simple math word problems? In NAACL.
|
| 253 |
+
|
| 254 |
+
Danish Pruthi, Rachit Bansal, Bhuwan Dhingra, Livio Baldini Soares, Michael Collins, Zachary C. Lipton, Graham Neubig, and William W. Cohen. 2022. Evaluating Explanations: How Much Do Explanations from the Teacher Aid Students? Transactions of the Association for Computational Linguistics, 10:359–375.
|
| 255 |
+
|
| 256 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In EMNLP.
|
| 257 |
+
|
| 258 |
+
Aruni RoyChowdhury, Prithvijit Chakrabarty, Ashish Singh, SouYoung Jin, Huaizu Jiang, Liangliang Cao, and Erik G. Learned-Miller. 2019. Automatic adaptation of object detectors to new domains using selftraining. In CVPR, pages 780–790.
|
| 259 |
+
|
| 260 |
+
Victor Sanh, Albert Webson, Colin Raffel, Stephen H Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, et al. 2022. Multitask prompted training enables zero-shot task generalization. In ICLR.
|
| 261 |
+
|
| 262 |
+
Timo Schick and Hinrich Schütze. 2020a. Exploiting cloze-questions for few-shot text classification and natural language inference. In Conference of the European Chapter of the Association for Computational Linguistics.
|
| 263 |
+
|
| 264 |
+
Timo Schick and Hinrich Schütze. 2020b. It’s not just size that matters: Small language models are also few-shot learners. ArXiv, abs/2009.07118.
|
| 265 |
+
|
| 266 |
+
Charlie Snell, Dan Klein, and Ruiqi Zhong. 2022. Learning by distilling context. arXiv preprint arXiv:2209.15189.
|
| 267 |
+
|
| 268 |
+
Yi Tay, Mostafa Dehghani, Vinh Quang Tran, Xavier García, Jason Wei, Xuezhi Wang, Hyung Won Chung, Dara Bahri, Tal Schuster, Huaixiu Zheng, Denny Zhou, Neil Houlsby, and Donald Metzler. 2022. Ul2: Unifying language learning paradigms.
|
| 269 |
+
|
| 270 |
+
Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. Superglue: A stickier benchmark for general-purpose language understanding systems. ArXiv, abs/1905.00537.
|
| 271 |
+
|
| 272 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. In BlackboxNLP@EMNLP.
|
| 273 |
+
|
| 274 |
+
Boshi Wang, Sewon Min, Xiang Deng, Jiaming Shen, You Wu, Luke Zettlemoyer, and Huan Sun. 2022a. Towards understanding chain-of-thought prompting: An empirical study of what matters. In Annual Meeting of the Association for Computational Linguistics.
|
| 275 |
+
|
| 276 |
+
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. 2022b. Rationaleaugmented ensembles in language models. ArXiv, abs/2207.00747.
|
| 277 |
+
|
| 278 |
+
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. 2022c. Self-consistency improves chain of thought reasoning in language models. ArXiv, abs/2203.11171.
|
| 279 |
+
|
| 280 |
+
Jason Wei, Maarten Bosma, Vincent Y Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2021. Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652.
|
| 281 |
+
|
| 282 |
+
Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed Huai hsin Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. 2022a. Emergent abilities of large language models. ArXiv, abs/2206.07682.
|
| 283 |
+
|
| 284 |
+
Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. 2022b. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682.
|
| 285 |
+
|
| 286 |
+
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Brian Ichter, Fei Xia, Quoc Le, and Denny Zhou. 2022c. Chain of thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35.
|
| 287 |
+
|
| 288 |
+
Adina Williams, Nikita Nangia, and Samuel R. Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL.
|
| 289 |
+
|
| 290 |
+
Zhiheng Xi, Senjie Jin, Yuhao Zhou, Rui Zheng, Songyang Gao, Tao Gui, Qi Zhang, and Xuanjing Huang. 2023. Self-polish: Enhance reasoning in large language models via problem refinement.
|
| 291 |
+
|
| 292 |
+
Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V. Le. 2020. Self-training with noisy student improves imagenet classification. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10684–10695.
|
| 293 |
+
|
| 294 |
+
Xi Ye and Greg Durrett. 2022. The unreliability of explanations in few-shot in-context learning.
|
| 295 |
+
|
| 296 |
+
Kang Min Yoo, Dongju Park, Jaewook Kang, SangWoo Lee, and Woomyeong Park. 2021. Gpt3mix: Leveraging large-scale language models for text augmentation. In EMNLP Findings.
|
| 297 |
+
|
| 298 |
+
Omar Zaidan, Jason Eisner, and Christine Piatko. 2007. Using “annotator rationales” to improve machine learning for text categorization. NAACL.
|
| 299 |
+
|
| 300 |
+
Eric Zelikman, Yuhuai Wu, Jesse Mu, and Noah D. Goodman. 2022. Star: Bootstrapping reasoning with reasoning.
|
| 301 |
+
|
| 302 |
+
Zhuosheng Zhang, Aston Zhang, Mu Li, and Alexander J. Smola. 2022. Automatic chain of thought prompting in large language models. ArXiv, abs/2210.03493.
|
| 303 |
+
|
| 304 |
+
Chuanyang Zheng, Zhengying Liu, Enze Xie, Zhenguo Li, and Yu Li. 2023. Progressive-hint prompting improves reasoning in large language models. ArXiv, abs/2304.09797.
|
| 305 |
+
|
| 306 |
+
Denny Zhou, Nathanael Scharli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, Olivier Bousquet, Quoc Le, and Ed Chi. 2022. Leastto-most prompting enables complex reasoning in large language models. ArXiv, abs/2205.10625.
|
| 307 |
+
|
| 308 |
+
# A Appendix
|
| 309 |
+
|
| 310 |
+
# A.1 Results on UL2 model
|
| 311 |
+
|
| 312 |
+
We also apply LMSI on a recently proposed public language model, UL2 (Tay et al., 2022), using the pre-trained model at step $2 , 6 5 0 { , } 0 0 0 ^ { 3 }$ . We use a fixed set of hyperparameters for fine-tuning on each dataset. Specifically, we generate $m = 4 0$ reasoning paths for each question in a training set for majority voting. We fine-tune the model for 10k steps with a learning rate of $5 \mathrm { e } - 5$ and a batch size of 32. For multiple path decoding, we use a sampling temperature of $T = 0 . 5$ with the pre-trained UL2 model following Tay et al. (2022), and set $T = 0 . 7$ for the language model after LMSI . We set the maximum number of decode steps to 256 for all experiments.
|
| 313 |
+
|
| 314 |
+
The results are shown in Table 8. For arithmetic reasoning datasets, we follow (Tay et al., 2022) to provide both exact matching accuracy scores as well as accuracy scores after an equation-correction postprocessing step. We observe that for most datasets, LMSI still improves the reasoning accuracy $( + 1 . 6 \%$ on DROP, $+ 1 . 2 \%$ on OpenBookQA, and $+ 0 . 7 \%$ on ANLI-A2), but the improvement on UL2 is not as large as that on 540B. We think the reason is that, since LMSI exploits the implicit rationale of language models, and the capacity of a language model is determined by its size, larger models can capture more high-order semantics and are more likely to benefit from LMSI . For example, on the adversarial entailment tasks of ANLI (which is a three-class classification problem with labels “yes”, “no”, or “it is not possible to tell”), the UL2 model w/o LMSI only achieves an accuracy of marginally above $1 / 3$ , implying that the model is slightly better than doing random guess on this challenging task without any training. Our proposed LMSI can still improve the performance under this hard case by training on its implicit knowledge from self-generated paths.
|
| 315 |
+
|
| 316 |
+
Table 8: Accuracy results on six reasoning benchmarks with LMSI on UL2. On GSM8K and DROP, we also include accuracy scores after an equation-correction postprocessing step.
|
| 317 |
+
|
| 318 |
+
<table><tr><td></td><td>Prompting Method</td><td>GSM8K</td><td>DROP</td><td>ARC-c</td><td>OpenBookQA</td><td>ANLI-A2</td><td>ANLI-A3</td></tr><tr><td rowspan="2"> w/o LMSI</td><td>CoT-Prompting</td><td>5.4/7.1</td><td>11.1/16.8</td><td>49.9</td><td>53.6</td><td>35.9</td><td>33.8</td></tr><tr><td>Self-Consistency</td><td>6.4/9.9</td><td>16.8/26.5</td><td>54.7</td><td>54.0</td><td>37.4</td><td>36.8</td></tr><tr><td rowspan="2">LMSI</td><td> CoT-Prompting</td><td>6.1/8.6</td><td>11.4/17.1</td><td>50.9</td><td>53.8</td><td>35.4</td><td>34.4</td></tr><tr><td>Self-Consistency</td><td>7.9/10.2</td><td>18.1/28.1</td><td>54.9</td><td>55.2</td><td>38.1</td><td>37.4</td></tr></table>
|
| 319 |
+
|
| 320 |
+
# A.2 Chain-of-Thought Prompts for Each Dataset
|
| 321 |
+
|
| 322 |
+
We list the Chain-of-Thought Prompts for each dataset for “CoT-Prompting” experiments and selfgenerated training samples.
|
| 323 |
+
|
| 324 |
+
Table 10: Few-shot CoT prompts for OpenBookQA, from (Wang et al., 2022b).
|
| 325 |
+
|
| 326 |
+
<table><tr><td>Q: There are 15 trees in the grove. Grove workers willplant trees in the grove today. After they are done, there will be 21 trees.How many trees did the grove workers plant today? A: We start with 15 trees.Later we have 21 trees.The difference must be the number of trees they planted. So,they must have planted 21 - 15 = 6 trees. The answer is 6.</td></tr><tr><td>Q: If there are 3 cars in the parking lot and 2 more cars arrive,how many cars are in the parking lot?</td></tr><tr><td>A: There are 3cars in the parking lot already.2 more arrive.Now there are 3 + 2=5cars.The answer is 5.</td></tr><tr><td>Q: Leah had 32 chocolates and her sister had 42.If they ate 35,how many pieces do they have left in total? A: Leah had 32 chocolates and Leah's sister had 42. That means there were originally 32 + 42 = 74</td></tr><tr><td>chocolates.35 have been eaten.So in total they stillhave 74 -35=39 chocolates.The answer is 39.</td></tr><tr><td>Q: Jason had 20 lollipops.He gave Denny some lolipops.Now Jason has 12 lollipops.How many lollipops did Jason give to Denny?</td></tr><tr><td>A: Jason had 20 lolipops.Since he only has 12 now, he must have given the rest to Denny. The number of lollipops he has given to Denny must have been 2O - 12 = 8 lollipops.The answer is 8.</td></tr><tr><td>Q: Shawn has five toys.For Christmas,he got two toys each from his mom and dad. How many toys does he have now?</td></tr><tr><td>A: He has 5 toys.He got 2 from mom,so after that he has 5 +2 =7 toys. Then he got 2 more from dad, so in total he has 7 + 2= 9 toys. The answer is 9.</td></tr><tr><td>Q: There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room?</td></tr><tr><td>A: There are 4 days from monday to thursday.5 computers were added each day. That means in total 4 * 5= 20 computers were added.There were 9 computers in the beginning,so now there are9+ 20= 29 computers. The answer is 29.</td></tr><tr><td>Q: Michael had 58 golf bals.On tuesday, he lost 23 golf balls. On wednesday,he lost 2 more.How many golf balls did he have at the end of wednesday?</td></tr><tr><td>A: Michael initially had 58 balls.He lost 23on Tuesday,so after that he has 58- 23 =35 balls.On Wednesday he lost 2 more so now he has 35 -2= 33 balls. The answer is 33.</td></tr></table>
|
| 327 |
+
|
| 328 |
+
Q: Poison causes harm to which of the following? (a) a Tree (b) a robot (c) a house (d) a car
|
| 329 |
+
A: Poison will harm living things, only a tree is a living thing. The answer is (a).
|
| 330 |
+
Q: As you look deeper into a Marbel you can see (a) the future (b) minut defects (c) colors (d) the other side A: Marbel is not transparent, so you can not see the other side. Marbel does not necessarily have multiple colors. You will see minut defects. The answer is (b).
|
| 331 |
+
Q: When food is reduced in the stomach (a) the mind needs time to digest (b) take a second to digest what I said (c) nutrients are being deconstructed (d) reader’s digest is a body of works
|
| 332 |
+
A: The food is being deconstructed in the stomach during digestion. The answer is (c).
|
| 333 |
+
Q: The sun is responsible for (a) puppies learning new tricks (b) children growing up and getting old (c) flowers wilting in a vase (d) plants sprouting, blooming and wilting
|
| 334 |
+
A: The sun can affect the growing of living things, like plants. The answer is (d).
|
| 335 |
+
|
| 336 |
+
Q: Since the 1970s, U.S. governments have negotiated managed-trade agreements, such as the North American Free Trade Agreement in the 1990s, the Dominican Republic-Central America Free Trade Agreement in 2006, and a number of bilateral agreements. In Europe, six countries formed the European Coal and Steel Community in 1951 which became the European Economic Community in 1958. Two core objectives of the EEC were the development of a common market, subsequently renamed the single market, and establishing a customs union between its member states. How many years did the European Coal and Steel Community exist?
|
| 337 |
+
|
| 338 |
+
A: According to the passage, the European Coal and Steel Community was established in 1951 and became the EEC in 1958. 1958 - $1 9 5 1 = 7$ . So the answer is 7.
|
| 339 |
+
|
| 340 |
+
Q: In the county, the population was spread out with $2 3 . 5 0 \%$ under the age of 18, $8 . 7 0 \%$ from 18 to 24, $2 9 . 7 0 \%$ from 25 to 44, $2 4 . 7 0 \%$ from 45 to 64, and $1 3 . 3 0 \%$ who were 65 years of age or older. How many more percent are under the age of 18 compared to the 18 to 24 group?
|
| 341 |
+
|
| 342 |
+
A: According to the passage, $2 3 . 5 \%$ are under the age of 18, and $8 . 7 \%$ are from ages 18 to $2 4 . 2 3 . 5 \% - 8 . 7 \%$ $= 1 4 . 8 \%$ . So the answer is 14.8.
|
| 343 |
+
|
| 344 |
+
Q: Playing in their second straight Thanksgiving game, the Eagles struggled especially on defense, where they were unable to stop the much-hyped Lions offense. The worst of it all was how unproven rookie Eric Rowe was tasked with covering wide receiver Calvin Johnson, leading to Johnson catching 3 touchdowns. Stafford’s five passing touchdowns, including three of them to Johnson was too much for the Eagles to overcome and for the second consecutive time this season, the Eagles gave up 45 points in a game. With the loss, the Eagles drop to 4-7 on the season and 6-1 when playing on Thanksgiving. How many TD passes did Stafford throw other than to Johnson?
|
| 345 |
+
|
| 346 |
+
A: According to the passage, Stafford threw $5 ~ \mathrm { T D }$ passes, 3 of which were to Johnson. $5 - 3 = 2$ . So the answer is 2.
|
| 347 |
+
|
| 348 |
+
Table 12: Few-shot CoT prompts for DROP (football), from (Zhou et al., 2022).
|
| 349 |
+
|
| 350 |
+
Q: The Seahawks played the San Francisco 49ers. In the first quarter, the Hawks RB Julius Jones got a 27-yard TD run, along with DT Craig Terrill returning a fumble 9 yards for a touchdown. In the third quarter, the 49ers almost rallied as RB H. J. Torres made a 12-yard TD pass to Lucas Nelly, along with Mare kicking a 32-yard field goal. In the final quarter, Julius Jones got another 11-yard TD. How many yards do the shortest touchdown run and the longest touchdown pass combine for?
|
| 351 |
+
|
| 352 |
+
A: All the touchdown runs are: a 27-yard touchdown run, a 9-yard touchdown run, a 11-yard touchdown run. The smallest number among 27, 9, 11 is 9. So the shortest touchdown run was 9 yards. All the touchdown passes are: a 12-yard touchdown pass. So the longest touchdown pass was 12 yards. So the shortest touchdown run and the longest touchdown pass combine for $9 + 1 2 = 2 1$ yards. So the answer is 21 yards.
|
| 353 |
+
|
| 354 |
+
Q: The Steelers went home for a duel with the Baltimore Ravens. Pittsburgh would deliver the opening punch in the first quarter with a 1-yard touchdown from running back Rashard Mendenhall. The Ravens would make it even as running back Willis McGahee got a 9-yard TD. The Ravens kicker Billy Cundiff got a 45-yard field goal in the second quarter, concluding the first half with a 10-7 lead. The Steelers brought the game into overtime with a 38-yard field goal by Andrew Foster. The Ravens Billy Cundiff pulled off a winning 33-yard field goal in overtime. How many points did the Ravens have at halftime?
|
| 355 |
+
|
| 356 |
+
A: The Ravens kicker Billy Cundiff got a 45-yard field goal in the second quarter, concluding the first half with a 10-7 lead. So the Ravens had 10 points at halftime. So the answer is 10 points.
|
| 357 |
+
|
| 358 |
+
Q: The Vikings flew to Bank of America Stadium to face the Carolina Panthers. After a scoreless first quarter, Carolina got on the board with quarterback Matt Moore finding fullback Brad Hoover on a 1-yard TD pass. After yet another scoreless quarter, Carolina sealed the game as Matt Moore completed a 42-yard touchdown pass to wide receiver Steve Smith. How many scoreless quarters were there?
|
| 359 |
+
|
| 360 |
+
A: The first and third quarters were the scoreless quarters. So there are 2 scoreless quarters. So the answer is 2.
|
| 361 |
+
|
| 362 |
+
Premise:
|
| 363 |
+
"Conceptually cream skimming has two basic dimensions - product and geography."
|
| 364 |
+
Based on this premise, can we conclude the hypothesis "Product and geography are what make cream skimming
|
| 365 |
+
work." is true?
|
| 366 |
+
OPTIONS:
|
| 367 |
+
- yes
|
| 368 |
+
- no
|
| 369 |
+
- it is not possible to tell
|
| 370 |
+
|
| 371 |
+
A: Based on "cream skimming has two basic dimensions" we can’t infer that these two dimensions are what make cream skimming work. The answer is it is not possible to tell.
|
| 372 |
+
|
| 373 |
+
"One of our member will carry out your instructions minutely."
|
| 374 |
+
|
| 375 |
+
Based on this premise, can we conclude the hypothesis "A member of my team will execute your orders with immense precision." is true?
|
| 376 |
+
|
| 377 |
+
OPTIONS:
|
| 378 |
+
- yes
|
| 379 |
+
- no
|
| 380 |
+
- it is not possible to tell
|
| 381 |
+
|
| 382 |
+
A: "one of" means the same as "a member of", "carry out" means the same as "execute", and "minutely" means the same as "immense precision". The answer is yes.
|
| 383 |
+
|
| 384 |
+
Premise:
|
| 385 |
+
"Fun for adults and children."
|
| 386 |
+
Based on this premise, can we conclude the hypothesis "Fun for only children." is true?
|
| 387 |
+
OPTIONS:
|
| 388 |
+
- yes
|
| 389 |
+
- no
|
| 390 |
+
- it is not possible to tell
|
| 391 |
+
|
| 392 |
+
A: "adults and children" contradicts "only children". The answer is no.
|
| 393 |
+
|
| 394 |
+
Premise:
|
| 395 |
+
"He turned and smiled at Vrenna."
|
| 396 |
+
Based on this premise, can we conclude the hypothesis "He smiled at Vrenna who was walking slowly behind
|
| 397 |
+
him with her mother." is true?
|
| 398 |
+
OPTIONS:
|
| 399 |
+
- yes
|
| 400 |
+
- no
|
| 401 |
+
- it is not possible to tell
|
| 402 |
+
|
| 403 |
+
A: the premise does not say anything about "Vrenna was walking". The answer is it is not possible to tell.
|
| 404 |
+
|
| 405 |
+
Premise:
|
| 406 |
+
"well you see that on television also"
|
| 407 |
+
Based on this premise, can we conclude the hypothesis "You can see that on television, as well." is true?
|
| 408 |
+
OPTIONS:
|
| 409 |
+
- yes
|
| 410 |
+
- no
|
| 411 |
+
- it is not possible to tell
|
| 412 |
+
|
| 413 |
+
A: "also" and "as well" mean the same thing. The answer is yes.
|
| 414 |
+
|
| 415 |
+
Premise:
|
| 416 |
+
"Vrenna and I both fought him and he nearly took us."
|
| 417 |
+
Based on this premise, can we conclude the hypothesis "Neither Vrenna nor myself have ever fought him." is true?
|
| 418 |
+
OPTIONS:
|
| 419 |
+
- yes
|
| 420 |
+
- no
|
| 421 |
+
- it is not possible to tell
|
| 422 |
+
A: "Vrenna and I both" contradicts "neither Vrenna nor myself". The answer is no. Q: John found that the average of 15 numbers is 40. If 10 is added to each number then the mean of the numbers is? Answer Choices: (a) 50 (b) 45 (c) 65 (d) 78 (e) 64
|
| 423 |
+
A: If 10 is added to each number, then the mean of the numbers also increases by 10. So the new mean would be 50. The answer is (a).
|
| 424 |
+
Q: If a $/ \mathrm { b } = 3 / 4$ and $8 \mathrm { a } + 5 \mathrm { b } = 2 2$ ,then find the value of a. Answer Choices: (a) 1/2 (b) 3/2 (c) $5 / 2$ (d) 4/2 (e) 7/2
|
| 425 |
+
A: If a $/ \mathrm { b } = 3 / 4$ , then $\mathsf { b } = 4 \mathsf { a } \mathrm { ~ / ~ } 3$ . So $8 \mathrm { a } + 5 ( 4 \mathrm { a } / 3 ) = 2 2$ . This simplifies to $8 \mathrm { a } + 2 0 \mathrm { a } / 3 = 2 2$ , which means $4 4 \mathrm { a } / 3 = 2 2$ . So a is equal to $3 / 2$ . The answer is (b).
|
| 426 |
+
Q: A person is traveling at $2 0 \mathrm { k m / h r }$ and reached his destiny in $2 . 5 \mathrm { h r }$ then find the distance? Answer Choices: (a) $5 3 \mathrm { k m }$ (b) $5 5 \mathrm { k m }$ (c) $5 2 \mathrm { k m }$ (d) $6 0 \mathrm { k m }$ (e) $5 0 \mathrm { k m }$
|
| 427 |
+
A: The distance that the person traveled would have been $2 0 \mathrm { k m } / \mathrm { h r } * 2 . 5 \mathrm { h r s } = 5 0 \mathrm { k m }$ . The answer is (e). Q: How many keystrokes are needed to type the numbers from 1 to 500? Answer Choices: (a) 1156 (b) 1392 (c) 1480 (d) 1562 (e) 1788
|
| 428 |
+
A: There are 9 one-digit numbers from 1 to 9. There are 90 two-digit numbers from 10 to 99. There are 401 three-digit numbers from 100 to $5 0 0 . ~ 9 + 9 0 ( 2 ) + 4 0 1 ( 3 ) = 1 3 9 2$ . The answer is (b).
|
| 429 |
+
|
| 430 |
+
Table 16: Few-shot CoT prompts for StrategyQA, from (Wei et al., 2022c).
|
| 431 |
+
|
| 432 |
+
<table><tr><td>Q: Do hamsters provide food for any animals? A: Hamsters are prey animals.Prey are food for predators.Thus,hamsters provide food for some animals.</td></tr><tr><td>The answer is yes.</td></tr><tr><td>Q: Could Brooke Shields succeed at University of Pennsylvania? A: Brooke Shields went to Princeton University. Princeton University is about as academically rigorous as</td></tr><tr><td>the University of Pennsylvania. Thus,Brooke Shields could also succeed at the University of Pennsylvania. The answer is yes.</td></tr><tr><td>Q: Yes or no: Hydrogen's atomic number squared exceeds number of Spice Girls?</td></tr><tr><td>A: Hydrogen has an atomic number of 1.1 squared is 1. There are 5 Spice Girls. Thus,Hydrogen's atomic number squared is less than 5.The answer is no.</td></tr><tr><td>Q: Yes or no: Is it common to see frost during some college commencements?</td></tr><tr><td>A: College commencement ceremonies can happen in December,May,and June.December is in the winter,</td></tr><tr><td>so there can be frost. Thus,there could be frost at some commencements.The answer is yes.</td></tr><tr><td>Q: Yes or no: Could a llama birth twice during War in Vietnam (1945-46)?</td></tr><tr><td>A: The War in Vietnam was 6 months.The gestation period for alama is 11 months, which is more than 6 months.Thus,a llama could not give birth twice during the War in Vietnam. The answer is no.</td></tr><tr><td>Q: Yes or no: Would a pear sink in water?</td></tr><tr><td>A: The density of a pear is about O.6 g/cm,which is less than water. Objects less dense than water float.</td></tr></table>
|
| 433 |
+
|
| 434 |
+
Table 17: Few-shot CoT prompts for RTE, from (Wang et al., 2022b).
|
| 435 |
+
|
| 436 |
+
"No Weapons of Mass Destruction Found in Iraq Yet." Based on this premise, can we conclude the hypothesis "Weapons of Mass Destruction Found in Iraq." is true?
|
| 437 |
+
|
| 438 |
+
A: "No Weapons of Mass Destruction Found" contradicts "Weapons of Mass Destruction Found". The answer is no.
|
| 439 |
+
|
| 440 |
+
Premise:
|
| 441 |
+
|
| 442 |
+
"A place of sorrow, after Pope John Paul II died, became a place of celebration, as Roman Catholic faithful gathered in downtown Chicago to mark the installation of new Pope Benedict XVI."
|
| 443 |
+
|
| 444 |
+
Based on this premise, can we conclude the hypothesis "Pope Benedict XVI is the new leader of the Roman Catholic Church." is true?’
|
| 445 |
+
|
| 446 |
+
A: "installation of new Pope Benedict XVI." means "Pope Benedict XVI is the new leader". The answer is yes.
|
| 447 |
+
|
| 448 |
+
Premise:
|
| 449 |
+
|
| 450 |
+
"A man is due in court later charged with the murder 26 years ago of a teenager whose case was the first to be featured on BBC One’s Crimewatch. Colette Aram, 16, was walking to her boyfriend’s house in Keyworth, Nottinghamshire, on 30 October 1983 when she disappeared. Her body was later found in a field close to her home. Paul Stewart Hutchinson, 50, has been charged with murder and is due before Nottingham magistrates later."
|
| 451 |
+
|
| 452 |
+
Based on this premise, can we conclude the hypothesis "Paul Stewart Hutchinson is accused of having stabbed a girl." is true?
|
| 453 |
+
|
| 454 |
+
A: The premise does not say Paul Stewart Hutchinson "stabbed" this girl. The answer is no.
|
| 455 |
+
|
| 456 |
+
Premise:
|
| 457 |
+
|
| 458 |
+
"Herceptin was already approved to treat the sickest breast cancer patients, and the company said, Monday, it will discuss with federal regulators the possibility of prescribing the drug for more breast cancer patients." Based on this premise, can we conclude the hypothesis "Herceptin can be used to treat breast cancer." is true?
|
| 459 |
+
|
| 460 |
+
A: "Herceptin was approved to treat breast cancer" implies that "Herceptin can be used to treat breast cancer".
|
| 461 |
+
The answer is yes.
|
md/dev/uxxFrDwrE7Y/uxxFrDwrE7Y.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING FAST, LEARNING SLOW: A GENERALCONTINUAL LEARNING METHOD BASED ON COMPLE-MENTARY LEARNING SYSTEM
|
| 2 |
+
|
| 3 |
+
Elahe Arani∗, Fahad Sarfraz\* & Bahram Zonooz
|
| 4 |
+
Advanced Research Lab, NavInfo Europe, Eindhoven, Netherlands
|
| 5 |
+
{elahe.arani, fahad.sarfraz}@navinfo.eu, bahram.zonooz@gmail.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Humans excel at continually learning from an ever-changing environment whereas it remains a challenge for deep neural networks which exhibit catastrophic forgetting. The complementary learning system (CLS) theory suggests that the interplay between rapid instance-based learning and slow structured learning in the brain is crucial for accumulating and retaining knowledge. Here, we propose CLS-ER, a novel dual memory experience replay (ER) method which maintains short-term and long-term semantic memories that interact with the episodic memory. Our method employs an effective replay mechanism whereby new knowledge is acquired while aligning the decision boundaries with the semantic memories. CLSER does not utilize the task boundaries or make any assumption about the distribution of the data which makes it versatile and suited for “general continual learning”. Our approach achieves state-of-the-art performance on standard benchmarks as well as more realistic general continual learning settings.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Continual learning (CL) refers to the ability of a learning agent to continuously interact with a dynamic environment and process a stream of information to acquire new knowledge while consolidating and retaining previously obtained knowledge (Parisi et al., 2019). This ability to continuously learn from a changing environment is a hallmark of intelligence and a critical missing component in our quest towards making our models truly intelligent. The major challenge towards enabling CL in deep neural networks (DNNs) is that the continual acquisition of incrementally available information from non-stationary data distributions leads to catastrophic forgetting whereby the performance of the model on previously learned tasks drops drastically (McCloskey & Cohen, 1989).
|
| 14 |
+
|
| 15 |
+
Several approaches have been proposed to address the issue of catastrophic forgetting in CL. These can be broadly categorized into regularization-based methods (Farajtabar et al., 2020; Kirkpatrick et al., 2017; Ritter et al., 2018; Zenke et al., 2017) which penalizes changes in the network weights, network expansion-based methods (Rusu et al., 2016; Yoon et al., 2017) which dedicate a distinct set of network parameters to distinct tasks, and rehearsal-based methods (Chaudhry et al., 2018; Lopez-Paz & Ranzato, 2017) which maintains a memory buffer and replays samples from previous tasks. Amongst these, rehearsal-based methods have proven to be more effective in challenging CL tasks (Farquhar & Gal, 2018). However, an optimal approach for replaying memory samples and constraining the model update to efficiently consolidate knowledge remains an open question.
|
| 16 |
+
|
| 17 |
+
In the brain, the ability to continually acquire, consolidate, and transfer knowledge over time is mediated by a rich set of neurophysiological processing principles (Parisi et al., 2019; Zenke et al., 2017) and multiple memory systems (Hassabis et al., 2017). In particular, the CLS theory (Kumaran et al., 2016) posits that efficient learning requires two complementary learning systems: the hippocampus exhibits short-term adaptation and rapid learning of episodic information which is then gradually consolidated to the neocortex for slow learning of structured information. Furthermore, a recent study by Hayes et al. (2021) identified the missing elements of biological reply in the replay mechanisms employed in DNNs for CL. They highlight that many existing approaches only focus on modeling the prefrontal cortex directly and do not have a fast learning network which plays a critical role in enabling efficient CL in the brain. Inspired by these studies, we hypothesize that mimicking the slow and rapid adaptation of information and having an efficient mechanism for incorporating them into the working memory can enable better CL in DNNs.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: CLS-ER employs a dual-memory learning mechanism whereby the episodic memory stores the samples and the semantic memories build short-term and long-term memories of the learned representations of the working model. The two memories interact to enforce a consistency loss on the working model which prevents rapid changes in the parameter space and enables the alignment of the decision boundary with semantic memories for effective knowledge consolidation.
|
| 21 |
+
|
| 22 |
+
To this end, we propose a novel dual memory experience replay method based on the complementary learning systems theory in the brain, dubbed as CLS-ER. In addition to a small episodic memory, our method builds long-term and short-term semantic memories which mimic the rapid and slow adaptation of information (Figure 1). As the network weights encode the learned representations of the tasks (Krishnan et al., 2019), the semantic memories are maintained by taking the exponential moving average of the working model’s weights to consolidate information across the tasks with varying time windows and frequencies. The semantic memories interact with the episodic memory to extract consolidated replay activation patterns and enforce a consistency loss on the update of the working model so that new knowledge is acquired while aligning the decision boundary of the working model with the decision boundaries of semantic memories. This maintains a balance between the plasticity and stability of the model for effective knowledge consolidation.
|
| 23 |
+
|
| 24 |
+
CLS-ER provides a general CL method that does not utilize the task boundaries or make any strong assumption regarding the distribution of the data and tasks. We demonstrate the versatility and effectiveness of our method on a wide range of CL benchmark tasks as well as more challenging scenarios which simulate the complexities of CL in the real world.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
The base method for the rehearsal-based approach, Experience Replay (ER) (Riemer et al., 2018) combines the memory samples with the task samples into the training batch. Several techniques have since been employed on top of ER. Meta Experience Replay (MER) (Riemer et al., 2018) considers replay as a meta-learning problem for maximizing the transfer from previous tasks and minimizing the interference. iCARL (Rebuffi et al., 2017) uses the nearest average representation of past exemplars to classify in an incrementally learned representation space. Gradient Episodic Memory (GEM) (Lopez-Paz & Ranzato, 2017) formulates optimization constraints on the exemplars in memory. Gradient-based Sample Selection (GSS) (Aljundi et al., 2019) aims for memory sample diversity in the gradient space and provides a greedy selection approach. Function Distance Regularization (FDR) (Benjamin et al., 2018) saves the network response at the task boundaries and adds a consistency loss on top of ER. Dark Experience Replay $( \mathrm { D E R + + } )$ applies knowledge distillation (Sarfraz et al., 2021) and regularization on logits sampled during the optimization trajectory.
|
| 29 |
+
|
| 30 |
+
CLS has been used as a source of inspiration for dual memory learning systems in earlier works (French, 1999; Robins, 1993) but they have not been shown to scale to current computer vision tasks (Parisi et al., 2019). Recently, Rostami et al. (2019) utilizes a generative model to couple sequential tasks in a latent embedding space. Kamra et al. (2017) utilizes two generative models in a dual memory architecture. However, they utilize the task boundaries and generative replay has its own set of challenges as it is difficult to learn a faithful distribution and performs sub-par in comparison to instance-based replay methods on challenging CL settings. Generally, the inspiration from CLS theory in DNNs has been mostly limited to episodic memory and mimicking the rapid and slow learning mechanism is majorly ignored (Hayes et al., 2021) which we aim to address.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Task-wise performance on S-CIFAR-10 test set with 500 buffer size. The models are evaluated at the end of each task (y-axis) to evaluate how the task performances $\mathbf { \bar { X } }$ -axis) are affected as training progress. The stable model retains information from earlier tasks while the plastic model quickly adapts to the recent task. Note that there is less forgetting in the semantic memories compared to the working model. For other buffer sizes and S-TinyImageNet see Figures S1 and S2.
|
| 34 |
+
|
| 35 |
+
# 3 METHOD
|
| 36 |
+
|
| 37 |
+
We first provide an overview of the CLS theory for the brain and how we aim to mimic it for DNNs before introducing the main components of our method and the overall formulation.
|
| 38 |
+
|
| 39 |
+
# 3.1 COMPLEMENTARY LEARNING SYSTEM THEORY
|
| 40 |
+
|
| 41 |
+
The CLS theory posits that effective lifelong learning in the brain requires two complementary learning systems. The hippocampus rapidly encodes novel information as a short-term memory which is subsequently used to transfer and consolidate knowledge in the neocortex which gradually acquires structured knowledge representation as long-term memory through experience replay. The interplay between the functionality of the hippocampus and neocortex is crucial for concurrently learning efficient representations (for better generalization) and the specifics of instance-based episodic memory.
|
| 42 |
+
|
| 43 |
+
# 3.2 COMPLEMENTARY LEARNING SYSTEM BASED EXPERIENCED REPLAY
|
| 44 |
+
|
| 45 |
+
Inspired by the CLS theory, we propose a dual memory experience replay method, CLS-ER, which aims to mimic the interplay between fast learning and slow learning mechanisms for enabling effective CL in DNNs. Our method maintains short-term and long-term semantic memories of the encountered tasks which interact with the episodic memory for replaying the associated neural activities. The working model is updated so that it acquires new knowledge while aligning its decision boundary with the semantic memories to enable the consolidation of structured knowledge across the tasks. Figure 1 highlights the parallels between CLS theory and our method.
|
| 46 |
+
|
| 47 |
+
Semantic Memories: Central to our method is the maintenance of two semantic memories which accumulate and consolidate information over long-term and short-term periods. As the acquired knowledge of the learned tasks is encoded in the weights of DNNs (Krishnan et al., 2019), we aim to form our semantic memories by accumulating the knowledge encoded in the corresponding weights of the model as it sequentially learns different tasks.
|
| 48 |
+
|
| 49 |
+
An efficient method for aggregating the weights of a model is provided by Mean Teacher (Tarvainen & Valpola, 2017) which is a knowledge distillation approach that uses an exponential moving average (EMA) of the student’s weights during training as a teacher for semi-supervised learning. It can also be considered as forming a self-ensemble of the intermediate model states that leads to better internal representations. We adapt the Mean Teacher approach to build our semantic memories as it provides a computational and memory-efficient method for accumulating knowledge over the tasks.
|
| 50 |
+
|
| 51 |
+
As CL involves learning tasks sequentially, the model weights at each training step can be considered as a student model specialized for a particular task. Therefore, averaging the weights during training can be considered as forming an ensemble of task-specific student models which effectively aggregates information across the tasks and leads to smoother decision boundaries. CLS-ER builds long-term (stable model) and short-term (plastic model) semantic memories by maintaining two EMA-weighted models over the working model’s weights. The stable model is updated less frequently with a larger window size so that it retains more information from the earlier tasks while the plastic model is updated more frequently with a smaller window size so that it adapts faster to information from new tasks (Figure 2). Section D further demonstrates the benefits of employing two semantic memories instead of a single semantic memory.
|
| 52 |
+
|
| 53 |
+
Episodic Memory: Replay of samples from the previous tasks stored in a small episodic memory is a common approach in CL that has proven to be effective in mitigating catastrophic forgetting. As we aim to position CLS-ER as a versatile general incremental learning method, we do not utilize the task boundaries or make any strong assumptions about the distribution of the tasks or samples. Therefore, to maintain a fixed episodic memory buffer, we employ Reservoir sampling (Vitter, 1985) which assigns equal probability to each sample in the stream for being represented in the buffer and randomly replaces the existing memory samples (Algorithm 2). It is a global distribution matching strategy that ensures that at any given time the distribution of samples in the buffer will approximately match the distribution of all the samples seen so far (Isele & Cosgun, 2018).
|
| 54 |
+
|
| 55 |
+
Consolidation of Information: The key challenge in CL is the consolidation of new information with the previously acquired information. This requires an effective balance between the stability and plasticity of the model. Furthermore, the sharp change in decision boundary as a new task is learned makes the consolidation of information over tasks more challenging. CLS-ER tackles these challenges through a novel dual memory experience replay mechanism. The long-term and shortterm semantic memories interact with the episodic memory to extract the consolidated activations for the memory samples which are then utilized to constrain the update of the working model so that new knowledge is obtained whilst the decision boundary is aligned with the semantic memories. This prevents rapid changes in the parameter space as new tasks are learned. Furthermore, aligning the working model’s decision boundary with the semantic memories serves two goals: (i) helps in retaining and consolidating information and (ii) leads to a smoother adaptation of decision boundary.
|
| 56 |
+
|
| 57 |
+
# 3.3 FORMULATION
|
| 58 |
+
|
| 59 |
+
CLS-ER involves training a working model $f ( . ; \theta _ { w } )$ on a data stream $\mathcal { D }$ sampled from a non-iid distribution. Two additional EMA-weighted models are maintained as semantic memories: plastic model $f ( . ; \theta _ { P } )$ and the stable model $f ( . ; \theta _ { S } )$ . Finally, Reservoir sampling (Vitter, 1985) is employed to maintain a small episodic memory $\mathcal { M }$ .
|
| 60 |
+
|
| 61 |
+
At each training step, the working model receives the training batch $X _ { b }$ from the data stream and retrieves a random batch of exemplars $X _ { m }$ from the episodic memory. This is then followed by the retrieval of optimal semantic information, i.e. the structural knowledge encoded in the semantic memories which account for the consolidation of feature space and adaptation of the decision boundaries of the previous tasks. The semantic memories are designed so that the plastic model has higher performance on recent tasks whereas the stable model prioritizes retaining information on the older tasks. Therefore, we would prefer to use the logits from the stable model $Z _ { S }$ for older exemplars and the plastic model $Z _ { P }$ for recent exemplars. As CLS-ER is a general incremental learning method, instead of using a hard threshold or task information, we opt for a simple task-agnostic approach of using the performance of the semantic memories on the exemplars as a selection criterion that empirically works well. For each exemplar, we select the replay logits $Z$ based on which model has the highest softmax score for the ground-truth class (lines 5-6 in Algorithm 1).
|
| 62 |
+
|
| 63 |
+
The selected replay logits from the semantic memories are then used to enforce a consistency loss on the working model so that it does not deviate from the already learned experiences. Hence, the working model is updated with a combination of the cross-entropy loss on the union of the data stream and episodic memory samples, $X$ , and the consistency loss on the exemplars $X _ { m }$ ,
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathcal { L } = \mathcal { L } _ { C E } ( \sigma ( f ( X ; \theta _ { W } ) ) , Y ) + \lambda \mathcal { L } _ { M S E } ( f ( X _ { m } ; \theta _ { W } ) , Z )
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Input: Data stream $\mathcal { D }$ , Learning rate $\eta$ , Consistency weight $\lambda$ , Update rates $r _ { P }$ and $r _ { S }$ , Decay parameters $\alpha _ { P }$ and $\alpha _ { S }$ Initialize: ${ \theta } _ { W } = { \theta } _ { P } = { \theta } _ { S }$ $\mathcal { M } \{ \}$
|
| 70 |
+
1: while Training do
|
| 71 |
+
2: $( X _ { b } , Y _ { b } ) \sim \mathcal { D }$ and $( X _ { m } , Y _ { m } ) \sim { \mathcal { M } }$
|
| 72 |
+
3: $( X , Y ) = \{ ( X _ { b } , Y _ { b } ) , ( X _ { m } , Y _ { m } ) \}$
|
| 73 |
+
4: $Z _ { P } , Z _ { S } \gets f ( X _ { m } ; \theta _ { P } ) , f ( X _ { m } ; \theta _ { S } )$ . Select optimal semantic memory
|
| 74 |
+
5: $Z Z _ { P }$ if $\sigma ( Z _ { P } ) ^ { ( Y _ { m } ) } > \sigma ( Z _ { S } ) ^ { ( Y _ { m } ) }$ else $Z _ { S }$
|
| 75 |
+
6: $\mathcal { L } = \mathcal { L } _ { C E } ( \sigma ( f ( X ; \theta _ { W } ) ) , Y ) + \lambda \mathcal { L } _ { M S E } ( f ( X _ { m } ; \theta _ { W } ) , Z )$ . Update working model
|
| 76 |
+
7: $\theta _ { W } \theta _ { W } - \eta \nabla _ { \theta _ { W } } \mathcal { L }$
|
| 77 |
+
8: $a , b \sim \mathcal { U } ( 0 , 1 )$ . Update semantic memories
|
| 78 |
+
9: $\theta _ { P } \alpha _ { p } \theta _ { P } + ( 1 - \alpha _ { P } ) \theta _ { W }$ if $a < r _ { P }$ else $\theta _ { P }$
|
| 79 |
+
10: $\theta _ { S } \alpha _ { S } \theta _ { S } + ( 1 - \alpha _ { S } ) \theta _ { W }$ if $b < r _ { S }$ else $\theta _ { S }$
|
| 80 |
+
11: $\mathcal { M } R e s e r v o i r ( \mathcal { M } , ( X _ { b } , Y _ { b } ) )$ $\triangleright$ Update episodic memory (Algorithm 2) return θW , θP , θS
|
| 81 |
+
|
| 82 |
+
where $\sigma$ is the softmax function, $\lambda$ the regularization parameter, and $\mathcal { L } _ { M S E }$ the mean squared error loss used as consistency term.
|
| 83 |
+
|
| 84 |
+
After updating the working model, we stochastically update the plastic and stable models with rates $r _ { P }$ and $r _ { S }$ (note that $r _ { P } > r _ { S }$ so that the plastic model is updated more frequently). A stochastic rather than a deterministic approach is more biologically plausible (Maass, 2014; Arani et al., 2021) which reduces the overlap in the snapshots of the working model and leads to more diversity in semantic memories. The semantic memories are updated by taking an exponential moving average of the working model’s weights (Tarvainen & Valpola, 2017) with decay parameters $\alpha _ { P }$ and $\alpha _ { S }$ ,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\theta _ { i } = \alpha _ { i } \theta _ { i } + ( 1 - \alpha _ { i } ) \theta _ { W } , \quad i \in \{ P , S \}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
Note that $\alpha _ { P } \leq \alpha _ { S }$ so that the plastic model mimics the rapid adaptation of information while the stable model mimics slow acquisition of structured knowledge. See Algorithm 1 for more details.
|
| 91 |
+
|
| 92 |
+
For inference, we use the stable model as it retains long-term memory across the tasks, consolidates structural knowledge, and learns efficient representations for generalization (Figure 1).
|
| 93 |
+
|
| 94 |
+
# 4 EXPERIMENTAL SETUP
|
| 95 |
+
|
| 96 |
+
To ensure a fair comparison of different CL methods under uniform experimental settings, we extended the Mammoth framework (Buzzega et al., 2020a) and unless stated otherwise, we follow the same training scheme (learning rate, batch sizes of incoming data and memory buffer, and the number of training epochs) as them for each of the evaluation settings. To find the optimal hyperparameters for CLS-ER, we run a grid search over $\lambda$ , $\alpha _ { S }$ , $\alpha _ { P }$ , $r _ { S }$ , and $r _ { P }$ on a small validation set. Sections C.4 and E show that our method is not highly sensitive to the particular choice of hyperparameters and different settings can attain similar performance. Also, because of the complementary nature of the components, we can often fix a set of parameters (e.g. $\lambda$ , $\alpha _ { S }$ , $\alpha _ { P }$ and $r _ { S }$ ) and only finetune the remaining parameters (e.g. $r _ { P }$ ) which facilitates hyperparameter tuning significantly.
|
| 97 |
+
|
| 98 |
+
Following Buzzega et al. (2020a), we employ a fully connected network with two hidden layers, each with 100 ReLU units on all the variants of the MNIST dataset and ResNet-18 (He et al., 2015) without pretraining for the other datasets. In all the settings, we use the SGD optimizer. We use random horizontal flip and random crop on both the stream and buffer samples for S-CIFAR-10, S-Tiny-ImageNet, and GCIL-CIFAR-100. The selected hyperparameters for each of the settings are provided in Table S4. Note that for the vast majority of datasets, we use uniform settings (lr, epochs, batch size, memory batch size, and lambda) across different buffer sizes and only slight modifications in the other hyperparameters which shows that our method does not require extensive finetuning for different memory budgets. For each of our experiments, we fix the order of the classes and report the average and one standard deviation of the mean test accuracy of all the tasks across 10 runs with different initializations. Section E provides further training and implementation details.
|
| 99 |
+
|
| 100 |
+
<table><tr><td rowspan="2">Buffer</td><td rowspan="2">Method</td><td colspan="3">Class-IL</td><td colspan="2">Domain-IL</td></tr><tr><td>S-MNIST</td><td>S-CIFAR-10</td><td>S-Tiny-ImageNet</td><td>R-MNIST</td><td>P-MNIST</td></tr><tr><td rowspan="2"></td><td>JOINT</td><td>95.57±0.24</td><td>92.20±0.15</td><td>59.99±0.19</td><td>95.76±0.04</td><td>94.33±0.17</td></tr><tr><td>SGD</td><td>19.60±0.04</td><td>19.62±0.05</td><td>7.92±0.26</td><td>67.66±8.53</td><td>40.70±2.33</td></tr><tr><td rowspan="7">200</td><td>ER</td><td>80.43±1.89</td><td>44.79±1.86</td><td>8.49±0.16</td><td>85.01±1.90</td><td>72.37±0.87</td></tr><tr><td>GEM</td><td>80.11±1.54</td><td>25.54±0.76</td><td>1</td><td>80.80±1.15</td><td>66.93±1.25</td></tr><tr><td>iCaRL</td><td>70.51±0.53</td><td>49.02±3.20</td><td>7.53±0.79</td><td>=</td><td>=</td></tr><tr><td>FDR</td><td>79.43±3.26</td><td>30.91±2.74</td><td>8.70±0.19</td><td>85.22±3.35</td><td>74.77±0.83</td></tr><tr><td>GSS</td><td>38.92±2.49</td><td>39.07±5.59</td><td>=</td><td>79.50±0.41</td><td>63.72±0.70</td></tr><tr><td>DER++</td><td>85.61±1.40</td><td>64.88±1.17</td><td>10.96±1.17</td><td>90.43±1.87</td><td>83.58±0.59</td></tr><tr><td>CLS-ER</td><td>89.54±0.21</td><td>66.19±0.75</td><td>23.47±0.80</td><td>92.26±0.18</td><td>84.63±0.40</td></tr><tr><td rowspan="8">500</td><td>ER</td><td>86.12±1.89</td><td>57.74±0.27</td><td>9.99±0.29</td><td>88.91±1.44</td><td>80.60±0.86</td></tr><tr><td>GEM</td><td>85.99±1.35</td><td>26.20±1.26</td><td>1</td><td>81.15±1.98</td><td>76.88±0.52</td></tr><tr><td>iCaRL</td><td>70.10±1.08</td><td>47.55±3.95</td><td>9.38±1.53</td><td>1</td><td>=</td></tr><tr><td>FDR</td><td>85.87±4.04</td><td>28.71±3.23</td><td>10.54±0.21</td><td>89.67±1.63</td><td>83.18±0.53</td></tr><tr><td>GSS</td><td>49.76±4.73</td><td>49.73±4.78</td><td>=</td><td>81.58±0.58</td><td>76.00±0.87</td></tr><tr><td>DER++</td><td>91.00±1.49</td><td>72.70±1.36</td><td>19.38±1.41</td><td>92.77±1.05</td><td>88.21±0.39</td></tr><tr><td>CLS-ER</td><td>92.05±0.32</td><td>75.22±0.71</td><td>31.03±0.56</td><td>94.06±0.07</td><td>88.30±0.14</td></tr><tr><td>ER</td><td>93.40±1.29</td><td>82.47±0.52</td><td>27.40±0.31</td><td>93.45±0.56</td><td>89.90±0.13</td></tr><tr><td rowspan="7">5120</td><td>GEM</td><td>95.11±0.87</td><td>25.26±3.46</td><td>1</td><td>88.57±0.40</td><td>87.42±0.95</td></tr><tr><td>iCaRL</td><td>70.60±1.03</td><td>55.07±1.55</td><td>14.08±1.92</td><td></td><td></td></tr><tr><td>FDR</td><td>87.47±3.15</td><td>19.70±0.07</td><td>28.97±0.41</td><td>94.19±0.44</td><td>90.87±0.16</td></tr><tr><td>GSS</td><td>89.39±0.75</td><td>67.27 ±4.27</td><td>=</td><td>85.24±0.59</td><td>82.22±1.14</td></tr><tr><td>DER++</td><td>95.30±1.20</td><td>85.24±0.49</td><td>39.02±0.97</td><td>94.65±0.33</td><td>92.26±0.17</td></tr><tr><td>CLS-ER</td><td>95.73±0.11</td><td>86.78±0.17</td><td>46.74±0.31</td><td>94.25±0.06</td><td>92.03±0.05</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 101 |
+
|
| 102 |
+
Table 1: Comparison with prior works on Class-IL and Domain-IL settings. The baseline results are from Buzzega et al. (2020a) (- indicates the experiments that the authors were unable to run).
|
| 103 |
+
|
| 104 |
+
# 5 EMPIRICAL EVALUATION
|
| 105 |
+
|
| 106 |
+
There are a plethora of evaluation protocols in the CL literature, each of which biases the evaluation towards a certain approach (Farquhar & Gal, 2018; Mi et al., 2020; van de Ven & Tolias, 2019). It is therefore of utmost importance to conduct an extensive and robust evaluation over different CL settings to gauge the versatility of the method. Details of the datasets used in each CL setting are provided in Section A. We compare our method with the state-of-the-art rehearsal-based approaches on various CL settings and memory budgets under uniform experimental settings. SGD refers to standard training and JOINT provides an upper bound given by training all tasks jointly.
|
| 107 |
+
|
| 108 |
+
Class Incremental Learning (Class-IL): refers to the CL scenario where new classes are added with each subsequent task and the agent must learn to distinguish not only amongst the classes within the current task but also across previous tasks. Class-IL measures how well the method can learn general representations, accumulate, consolidate, and transfer the acquired knowledge to learn efficient representations and decision boundaries for all the classes seen so far.
|
| 109 |
+
|
| 110 |
+
Table 1 provides the comparison with six rehearsal-based approaches on Class-IL settings with varying datasets and task length complexities. CLS-ER provides the highest performance in all of these scenarios. In particular, as the dataset complexity and number of tasks increase from S-MNIST to S-Tiny-ImageNet, the performance gap between CLS-ER and $\mathrm { D E R + + }$ increases considerably. Especially, with a smaller memory budget, CLS-ER is able to retain more information than other methods. In the most challenging setting, S-Tiny-ImageNet with 200 buffer size, CLS-ER provides a percentage gain of $1 7 6 \%$ and $1 1 4 \%$ over the baseline ER and the current state-of-the-art $\mathrm { D E R + + }$ , respectively. The results demonstrate the capability of CLS-ER to efficiently accumulate and retain knowledge over longer sequences under complex and memory restrictive scenarios.
|
| 111 |
+
|
| 112 |
+
We believe that the performance gains over $\mathrm { D E R + + }$ highlight a key component of an efficient CL agent: the ability to consolidate previously acquired knowledge. $\mathrm { D E R + + }$ fails to account for the consolidation of feature space and adaptation of the decision boundaries of the previous tasks. Therefore, constraining the model to match the sub-optimal logits might hamper the consolidation of knowledge. This becomes more prominent as the number of classes in each task, the sequence length, and the cross-task resemblance increase. For instance, for $\mathrm { D E R + + }$ , replaying a sample from Task-1 when training on S-Tiny-ImageNet Task-10, the reference logit values which are used to enforce the consistency are from a model representation state which has not considered how to distinguish the 20 classes in Task-1 from 80 additional classes which are visually and semantically similar. It stands to reason that the optimal representation space and subsequently the decision boundaries for the classes in Task-1 would drift considerably when required to distinguish between 80 additional classes as well. Therefore, the local information provided by the sub-optimal saved logits in $\mathrm { D E R + + }$ fails to provide the global context required for consolidating knowledge. CLS-ER, on the other hand, extracts logits from the semantic memories which consolidate knowledge across the tasks, and hence the working model receives more optimal feedback.
|
| 113 |
+
|
| 114 |
+
Table 2: Comparison with prior works on MNIST-360 test set. The baseline results are from Buzzega et al. (2020a).
|
| 115 |
+
|
| 116 |
+
<table><tr><td>JOINT</td><td>SGD</td><td>Buffer</td><td>ER</td><td>MER</td><td>GSS</td><td>DER++</td><td>CLS-ER</td></tr><tr><td rowspan="3">82.98±3.24</td><td rowspan="3">19.09±0.69</td><td>200</td><td>49.27±2.25</td><td>48.58±1.07</td><td>43.92±2.43</td><td>54.16±3.02</td><td>66.37±0.83</td></tr><tr><td>500</td><td>65.04±1.53</td><td>62.21±1.36</td><td>54.45±3.14</td><td>69.62±1.59</td><td>75.70±0.41</td></tr><tr><td>1000</td><td>75.18±1.50</td><td>70.91±0.76</td><td>63.84±2.09</td><td>76.03±1.61</td><td>79.54±0.34</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 3: Comparison with prior works on GCIL-CIFAR-100 dataset.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Distribution</td><td colspan="3">Uniform</td><td colspan="3">Longtail</td></tr><tr><td>JOINT</td><td colspan="3">58.36±1.02</td><td colspan="3">56.94±1.56</td></tr><tr><td>SGD</td><td></td><td>12.67±0.24</td><td></td><td></td><td>22.88±0.53</td><td>1000</td></tr><tr><td>Buffer ER</td><td>200 16.40±0.37</td><td>500</td><td>1000 31.98±0.72</td><td>200 19.27±0.77</td><td>500 20.30±0.63</td><td>34.13±0.83</td></tr><tr><td>DER++</td><td>18.84±0.60</td><td>28.21±0.69 32.92±0.74</td><td>38.95±0.56</td><td>26.94±1.27</td><td>25.82±0.83</td><td>33.64±0.88</td></tr><tr><td></td><td></td><td></td><td></td><td>28.54±0.87</td><td>28.63±0.68</td><td>39.52±0.91</td></tr><tr><td>CLS-ER</td><td>25.06±0.81</td><td>36.34±0.59</td><td>39.69±0.66</td><td></td><td></td><td></td></tr></table>
|
| 121 |
+
|
| 122 |
+
Domain Incremental Learning (Domain-IL): refers to the CL scenario where the classes remain the same in subsequent tasks but the input distribution changes. We consider R-MNIST where each task contains digits rotated by a fixed angle and P-MNIST which applies a fixed random permutation to the pixels for each task. Table 1 shows that CLS-ER provides generalization gains under both settings, particularly for lower memory budget, and performs on par with $\mathrm { D E R + + }$ on 5120 buffer size. We attribute this to the consolidated soft targets from the semantic memories which provide relational information about the classes from a global context compared to the local information in $\mathrm { D E R + + }$ . This enables our method to maintain the similarity structure across sequences effectively.
|
| 123 |
+
|
| 124 |
+
General Incremental Learning (GIL): Class-IL and Domain-IL fail to assimilate the challenges in the real-world setting where the task boundaries are blurry, and classes can reappear and have different distributions. The CL method has to consider the sample efficiency, challenge of imbalanced data, and efficient knowledge transfer in addition to preventing catastrophic forgetting. We consider two GIL settings: MNIST-360 (Buzzega et al., 2020a) exposes the model to both sharp (changes in class) and smooth (rotation of digits) distribution shifts. This requires the CL method to tackle the challenges of class-IL as well as domain-IL. The Generalized Class Incremental Learning (GCIL; Mi et al. (2020)) is the closest to the real-world scenario as it utilizes probabilistic modeling to sample the classes and data distributions in each task. The number of classes in each task is not fixed, the classes can overlap and the sample size for each class can vary.
|
| 125 |
+
|
| 126 |
+
Table 2 shows that CLS-ER provides considerable performance gains on the challenging MNIST360, particularly with a low memory budget. Similarly, Table 3 demonstrates the effectiveness of CLS-ER on GCIL-CIFAR-100 under both uniform and imbalanced class samples. Both of these settings involve recurring classes in subsequent sequences which makes the transfer of knowledge from previous occurrences important. The performance gap between CLS-ER and $\mathrm { D E R + + }$ in the recurring classes setting alludes to another shortcoming of saving logits from the previous state. Consider the case where class c appears in sequence (Seq)-1 with 20 samples, and then subsequently in Seq-5 with 200 samples. In the following sequences, $\mathrm { D E R + + }$ uses exemplars from class c saved in Seq-1 with sub-optimal logits from the model state which was attained with only 20 samples and fails to take advantage of the better learned representations with additional data in Seq-5. CLS-ER, on the other hand, is able to take advantage of the additional samples and provide feedback from the improved learned representations. Moreover, the considerable performance improvement in the longtail setting shows that CLS-ER is more robust to class imbalance
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 3: Model characteristics analyses of different methods trained on S-CIFAR-10 with 500 buffer size. The Left and middle figures show the training loss and accuracy under varying Gaussian noise added to the weights of each layer of the model. CLS-ER is considerably less sensitive to perturbations, suggesting convergence to flatter minima. The right figure shows the task probabilities. CLS-ER effectively mitigates the bias to the recent tasks and provides a more uniform probability of being predicted for the classes over the tasks even very early ones.
|
| 130 |
+
|
| 131 |
+
Note that the MNIST-based settings can be considered under the online CL setting (see Section A.4) as we only pass through the data once for each task and the performance of CLS-ER on these settings demonstrates its potential as an efficient method for online CL.
|
| 132 |
+
|
| 133 |
+
# 6 MODEL CHARACTERISTICS
|
| 134 |
+
|
| 135 |
+
We analyze CLS-ER and provide some insights into the characteristics of the proposed approach which enables it to learn effectively under challenging CL scenarios. In the subsequent analyses, we compare CLS-ER with the baseline ER and DER $^ { + + }$ .
|
| 136 |
+
|
| 137 |
+
# 6.1 CONVERGENCE TO FLATTER MINIMA
|
| 138 |
+
|
| 139 |
+
Due to the non-convexity of the loss landscape, there can be multiple solutions to the optimization objective, however, the local geometry at the convergence point can affect the generalization of the model. Solutions that reside in wide valleys instead of narrow crevices generalize better (Chaudhari et al., 2019; Hochreiter & Schmidhuber, 1997; Keskar et al., 2016) as the predictions do not change drastically with small perturbations. A CL model which converges to flatter minima has more flexibility to explore the neighboring parameter space to optimize on the new task without drastically increasing the loss on the previous tasks. Following the analysis in Zhang et al. (2018), we add independent Gaussian noise of increasing strength to the parameters of the trained model and analyze the change in accuracy and loss across the training samples. Figure 3 shows that CLS-ER is significantly less sensitive to perturbations compared to ER and $\mathrm { D E R + + }$ . CLS-ER also retains performance for a longer period and its performance drops more smoothly. These results suggest that the fast and slow adaptation of information in CLS-ER can guide the optimization to wider valleys.
|
| 140 |
+
|
| 141 |
+
# 6.2 TASK PROBABILITIES
|
| 142 |
+
|
| 143 |
+
Because of the sequential nature of CL, an implicit bias is induced towards the current task (Wu et al., 2019). A number of CL methods employ explicit techniques to reduce this bias (Hou et al., 2019; Wu et al., 2019), however, they utilize the task boundaries which is counterproductive for general incremental learning. We believe that the efficient knowledge consolidation in CLS-ER through the semantic memories can implicitly mitigate the bias towards recent tasks. We follow the analysis performed in Buzzega et al. (2020b) to observe the probability of each task being predicted at the end of the training. For each sample in the test dataset, we take the softmax output and then average the probabilities of the associated classes for each task across the dataset. We normalize the values and report the probability of each task being predicted. Figure 3 (right plot) shows that CLS-ER is able to maintain a more uniform prediction probability across all the tasks over a long sequence. Figures S3 and S4 shows similar results for other buffer sizes and S-TinyImageNet.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 4: Reliability plots for different methods on S-CIFAR-10 with 500 buffer size. CLS-ER results in considerably better-calibrated models and hence more reliable predictions. For other buffer sizes and S-TinyImageNet see Figures S5 and S6.
|
| 147 |
+
|
| 148 |
+
# 6.3 MODEL CALIBRATION
|
| 149 |
+
|
| 150 |
+
Model calibration refers to the accuracy with which the scores provided by the model reflect its predictive uncertainty. The class probabilities predicted by DNNs are uncalibrated, often tending towards over-confidence which is detrimental to the reliability of the model’s prediction (Guo et al., 2017). This is even more pronounced in CL where the models tend to be biassed towards recent tasks. Following Guo et al. (2017), we provide the reliability diagrams (model accuracy as a function of its prediction confidence) and the Expected Calibration Error (ECE; a weighted average over the absolute difference between accuracy and confidence). Figure 4 shows the remarkable ability of CLS-ER to provide well-calibrated models without the application of any calibration technique.
|
| 151 |
+
|
| 152 |
+
Note that these characteristics are complementary in nature: convergence to flatter minima allows our method to remain in the vicinity of optimal parameters for previous tasks when adapting to the new task, this leads to more uniform performance across tasks which can improve the task probabilities, and since the model is not too biased towards the current task, the model can provide reliable prediction across the tasks which improve the calibration. Additional characteristics analyses on different datasets and buffer sizes are provided in Appendix. We observe that our model’s behavior is consistent across varying datasets and buffer sizes.
|
| 153 |
+
|
| 154 |
+
# 7 CONCLUSION
|
| 155 |
+
|
| 156 |
+
We proposed a novel dual memory experience replay method based on the complementary learning systems theory in the brain. Our method maintains long-term and short-term semantic memories which are utilized to effectively replay the neural activities of the episodic memories and align the decision boundary of the working model for efficient knowledge consolidation. We demonstrated the effectiveness of our approach on benchmark datasets as well as more challenging general incremental learning scenarios and achieved the new state-of-the-art in the vast majority of the continual learning settings. We further showed that CLS-ER converges to flatter minima, mitigates the bias towards recent tasks, and provides a well-calibrated high-performance model. Our strong empirical results motivate further study into mimicking the complementary learning system in the brain more faithfully to enable optimal continual learning in DNNs.
|
| 157 |
+
|
| 158 |
+
# REFERENCES
|
| 159 |
+
|
| 160 |
+
Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In Advances in Neural Information Processing Systems, pp. 11816– 11825, 2019. 2, 14
|
| 161 |
+
|
| 162 |
+
Elahe Arani, Fahad Sarfraz, and Bahram Zonooz. Noise as a resource for learning in knowledge distillation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 3129–3138, 2021. 5
|
| 163 |
+
|
| 164 |
+
Ari S Benjamin, David Rolnick, and Konrad Kording. Measuring and regularizing networks in function space. arXiv preprint arXiv:1805.08289, 2018. 2
|
| 165 |
+
|
| 166 |
+
Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. arXiv preprint arXiv:2004.07211, 2020a. 5, 6, 7, 13, 14, 17, 20
|
| 167 |
+
|
| 168 |
+
Pietro Buzzega, Matteo Boschini, Angelo Porrello, and Simone Calderara. Rethinking experience replay: a bag of tricks for continual learning. arXiv preprint arXiv:2010.05595, 2020b. 8
|
| 169 |
+
|
| 170 |
+
Pratik Chaudhari, Anna Choromanska, Stefano Soatto, Yann LeCun, Carlo Baldassi, Christian Borgs, Jennifer Chayes, Levent Sagun, and Riccardo Zecchina. Entropy-sgd: Biasing gradient descent into wide valleys. Journal of Statistical Mechanics: Theory and Experiment, 2019(12): 124018, 2019. 8
|
| 171 |
+
|
| 172 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. arXiv preprint arXiv:1812.00420, 2018. 1
|
| 173 |
+
|
| 174 |
+
Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. arXiv preprint arXiv:1909.08383, 2019. 13
|
| 175 |
+
|
| 176 |
+
Mehrdad Farajtabar, Navid Azizan, Alex Mott, and Ang Li. Orthogonal gradient descent for continual learning. In International Conference on Artificial Intelligence and Statistics, pp. 3762–3773. PMLR, 2020. 1
|
| 177 |
+
|
| 178 |
+
Sebastian Farquhar and Yarin Gal. Towards robust evaluations of continual learning. arXiv preprint arXiv:1805.09733, 2018. 1, 6, 13, 14
|
| 179 |
+
|
| 180 |
+
Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128–135, 1999. 2
|
| 181 |
+
|
| 182 |
+
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pp. 1321–1330. PMLR, 2017. 9
|
| 183 |
+
|
| 184 |
+
Demis Hassabis, Dharshan Kumaran, Christopher Summerfield, and Matthew Botvinick. Neuroscience-inspired artificial intelligence. Neuron, 95(2):245–258, 2017. 1
|
| 185 |
+
|
| 186 |
+
Tyler L Hayes, Giri P Krishnan, Maxim Bazhenov, Hava T Siegelmann, Terrence J Sejnowski, and Christopher Kanan. Replay in deep learning: Current approaches and missing biological elements. arXiv preprint arXiv:2104.04132, 2021. 1, 3
|
| 187 |
+
|
| 188 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. corr abs/1512.03385 (2015), 2015. 5
|
| 189 |
+
|
| 190 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural computation, 9(1):1–42, 1997. 8
|
| 191 |
+
|
| 192 |
+
Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. Learning a unified classifier incrementally via rebalancing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 831–839, 2019. 8
|
| 193 |
+
|
| 194 |
+
David Isele and Akansel Cosgun. Selective experience replay for lifelong learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. 4
|
| 195 |
+
|
| 196 |
+
Nitin Kamra, Umang Gupta, and Yan Liu. Deep generative dual memory network for continual learning. arXiv preprint arXiv:1710.10368, 2017. 2
|
| 197 |
+
|
| 198 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. 8
|
| 199 |
+
|
| 200 |
+
J Kirkpatrick, R Pascanu, N Rabinowitz, J Veness, G Desjardins, AA Rusu, K Milan, J Quan, T Ramalho, A Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks.(dec. arXiv preprint cs.LG/1612.00796, 2016. 13
|
| 201 |
+
|
| 202 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017. 1
|
| 203 |
+
|
| 204 |
+
Giri P Krishnan, Timothy Tadros, Ramyaa Ramyaa, and Maxim Bazhenov. Biologically inspired sleep algorithm for artificial neural networks. arXiv preprint arXiv:1908.02240, 2019. 2, 3
|
| 205 |
+
|
| 206 |
+
Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009. 13
|
| 207 |
+
|
| 208 |
+
Dharshan Kumaran, Demis Hassabis, and James L McClelland. What learning systems do intelligent agents need? complementary learning systems theory updated. Trends in cognitive sciences, 20 (7):512–534, 2016. 1
|
| 209 |
+
|
| 210 |
+
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. 13
|
| 211 |
+
|
| 212 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in neural information processing systems, pp. 6467–6476, 2017. 1, 2, 13
|
| 213 |
+
|
| 214 |
+
Wolfgang Maass. Noise as a resource for computation and learning in networks of spiking neurons. Proceedings of the IEEE, 102(5):860–880, 2014. 5
|
| 215 |
+
|
| 216 |
+
Zheda Mai, Ruiwen Li, Jihwan Jeong, David Quispe, Hyunwoo Kim, and Scott Sanner. Online continual learning in image classification: An empirical survey. Neurocomputing, 469:28–51, 2022. 14
|
| 217 |
+
|
| 218 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989. 1
|
| 219 |
+
|
| 220 |
+
Fei Mi, Lingjing Kong, Tao Lin, Kaicheng Yu, and Boi Faltings. Generalized class incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 240–241, 2020. 6, 7, 13, 20
|
| 221 |
+
|
| 222 |
+
German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019. 1, 2
|
| 223 |
+
|
| 224 |
+
Hadi Pouransari and Saman Ghili. Tiny imagenet visual recognition challenge. CS231N course, Stanford Univ., Stanford, CA, USA, 2015. 13
|
| 225 |
+
|
| 226 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2001–2010, 2017. 2
|
| 227 |
+
|
| 228 |
+
Matthew Riemer, Ignacio Cases, Robert Ajemian, Miao Liu, Irina Rish, Yuhai Tu, and Gerald Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. arXiv preprint arXiv:1810.11910, 2018. 2
|
| 229 |
+
|
| 230 |
+
Hippolyt Ritter, Aleksandar Botev, and David Barber. Online structured laplace approximations for overcoming catastrophic forgetting. In Advances in Neural Information Processing Systems, pp. 3738–3748, 2018. 1
|
| 231 |
+
|
| 232 |
+
Anthony Robins. Catastrophic forgetting in neural networks: the role of rehearsal mechanisms. In Proceedings 1993 The First New Zealand International Two-Stream Conference on Artificial Neural Networks and Expert Systems, pp. 65–68. IEEE, 1993. 2
|
| 233 |
+
|
| 234 |
+
Mohammad Rostami, Soheil Kolouri, and Praveen K Pilly. Complementary learning for overcoming catastrophic forgetting using experience replay. arXiv preprint arXiv:1903.04566, 2019. 2
|
| 235 |
+
|
| 236 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. 1
|
| 237 |
+
|
| 238 |
+
Fahad Sarfraz, Elahe Arani, and Bahram Zonooz. Knowledge distillation beyond model compression. In 2020 25th International Conference on Pattern Recognition (ICPR), pp. 6136–6143. IEEE, 2021. 2
|
| 239 |
+
|
| 240 |
+
Dongsub Shim, Zheda Mai, Jihwan Jeong, Scott Sanner, Hyunwoo Kim, and Jongseong Jang. Online class-incremental continual learning with adversarial shapley value. arXiv e-prints, pp. arXiv–2009, 2020. 13
|
| 241 |
+
|
| 242 |
+
Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. arXiv preprint arXiv:1703.01780, 2017. 3, 5
|
| 243 |
+
|
| 244 |
+
Gido M van de Ven and Andreas S Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019. 6, 13
|
| 245 |
+
|
| 246 |
+
Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37–57, 1985. 4
|
| 247 |
+
|
| 248 |
+
Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. Large scale incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 374–382, 2019.
|
| 249 |
+
|
| 250 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017. 1
|
| 251 |
+
|
| 252 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. Proceedings of machine learning research, 70:3987, 2017. 1, 13
|
| 253 |
+
|
| 254 |
+
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. 8
|
| 255 |
+
|
| 256 |
+
# A CONTINUAL LEARNING SETTINGS
|
| 257 |
+
|
| 258 |
+
There are a plethora of evaluation protocols in the CL literature, each of which biases the evaluation towards a certain approach (Farquhar & Gal, 2018; Mi et al., 2020; Shim et al., 2020; van de Ven & Tolias, 2019). It is therefore of utmost importance to conduct an extensive and robust evaluation to gauge the versatility of the method. We believe that adhering to the key desiderata as suggested in Farquhar & Gal (2018) would help the CL community immensely in moving towards a robust evaluation of methods. An experimental protocol that trains the method on a long sequence of tasks where the boundaries between the tasks are not distinct and the tasks themselves are not disjoint and the method does not make sure of task boundaries during training or testing can be considered as adhering to all five desiderata. Our work focuses on the aforementioned setting which can be considered as General Incremental Learning (GIL) setting. Here, we provide a broad categorization of these evaluation protocols which test different aspects of CL.
|
| 259 |
+
|
| 260 |
+
# A.1 CLASS INCREMENTAL LEARNING (CLASS-IL)
|
| 261 |
+
|
| 262 |
+
Class-IL refers to the CL scenario where new classes are added with each subsequent task and the agent must learn to distinguish not only amongst the classes within the current task but also across previous tasks. Class-IL measures how well the method can learn general representations, accumulate, consolidate, and transfer the acquired knowledge to learn efficient representations and decision boundaries for all the classes seen so far. Following Buzzega et al. (2020a); De Lange et al. (2019); Zenke et al. (2017), we consider the common benchmark datasets MNIST (LeCun et al., 1998) (SMNIST), CIFAR-10 (Krizhevsky et al., 2009) (S-CIFAR-10) and Tiny-ImageNet (Pouransari & Ghili, 2015) (S-Tiny-ImageNet) which are split into 5, 5, and 10 tasks each including 2, 2, and 20 classes respectively. These represent Class-IL settings of increasing dataset complexity as well as longer sequences. While it is an important and challenging benchmark, it assumes that each subsequent task will have the same number of disjoint classes and have uniform samples for each class which is not representative of real-world scenarios. We do not consider the related Task Increment Learning (Task-IL) setting as it assumes the availability of task labels at both training and inference which cannot truly be considered as a CL task (Farquhar & Gal, 2018).
|
| 263 |
+
|
| 264 |
+
# A.2 DOMAIN INCREMENTAL LEARNING (DOMAIN-IL)
|
| 265 |
+
|
| 266 |
+
Domain-IL refers to the CL scenario where the classes remain the same in each subsequent task but the input distribution changes. We consider Rotated-MNIST (Lopez-Paz & Ranzato, 2017) (R-MNIST) where each task contains digits rotated by a fixed angle between 0 and 180 degrees and Permuted-MNIST (Kirkpatrick et al., 2016) (P-MNIST) which applies a fixed random permutation to the pixels for each task. Though we provide the results for Permuted MNIST for completion, we share the opinion by Farquhar & Gal (2018) that it should not be considered as a benchmark dataset as it violates the cross-task resemblance desiderata and deviates from the goal of continual learning.
|
| 267 |
+
|
| 268 |
+
# A.3 GENERAL INCREMENTAL LEARNING (GIL)
|
| 269 |
+
|
| 270 |
+
The aforementioned CL scenarios fail to assimilate the challenges in the real world, setting where the task boundaries are blurry and the learning agent must rather learn from a continuous stream of data where classes can reappear and have different data distributions. The CL method must deal with the issues of sample efficiency, imbalanced classes, and efficient transfer of knowledge in addition to preventing catastrophic forgetting. To test the efficacy of our method in this challenging setting, we consider two GIL evaluation protocols. MNIST-360 (Buzzega et al., 2020a) models a stream of data which presents batches of two consecutive MNIST images with each sample rotated at an increasing angle and the sequence is repeated three times. This exposes the model to both a sharp distribution shift when the class changes and a smooth rotational distribution shift. However, the number of classes in each task and the samples are uniform. The Generalized Class Incremental Learning (GCIL) (Mi et al., 2020) utilizes probabilistic modeling to sample the classes and data distributions in each task. Hence, the number of classes in each task is not fixed, the classes can overlap and the sample size for each class can vary. Following Mi et al. (2020), we use GCIL on CIFAR-100 (Krizhevsky et al., 2009) dataset (GCIL-CIFAR-100), set the number of samples and maximum number of classes per task to 1000 and 50 respectively, number of tasks to 20, and evaluate on both uniform and longtail (imbalanced) sample distribution.
|
| 271 |
+
|
| 272 |
+
# A.4 ONLINE CONTINUAL LEARNING
|
| 273 |
+
|
| 274 |
+
Online continual learning refers to the challenging scenario where a stream of samples is only seen once and is non-iid (Mai et al., 2022; Aljundi et al., 2019). The common approach in the literature is to use the single-epoch protocol where the network is trained on each task in the sequence for only one epoch and there are no additional passages over data. As we aim to position CLS-ER as a general incremental learning method, we are also interested in the online continual learning setting. However, similar to Buzzega et al. (2020a), we also believe that the dataset complexity needs to be considered when setting the number of epochs to disentangle the effect of catastrophic forgetting from underfitting and share their suggestion that future CL works should strive for realism by designing experimental settings which are in line with the guidelines of General Continual Learning (Farquhar & Gal, 2018) which is the goal of our study rather than adopting the single-epoch protocol. For the MNIST-based settings, we use only one epoch per task as it is sufficient for the SGD baseline to learn the single task well. And for the more complex settings, we increase the number of epochs: 50 epochs for Sequential CIFAR-10 and Sequential Tiny-ImageNet and 100 epochs for GCIL-CIFAR-100.
|
| 275 |
+
|
| 276 |
+
We would also like to emphasize that the experiments on MNIST based settings (S-MNIST, RMNIST, P-MNIST, and MNIST-360) can be considered as online continual learning settings as we only train the network for 1 epoch, and thereby the model only sees the data for each task once. CLSER’s performance in these settings demonstrates its potential for the challenging online continual learning setting.
|
| 277 |
+
|
| 278 |
+
# B RESERVOIR SAMPLING
|
| 279 |
+
|
| 280 |
+
Here, we provide the algorithm for the Reservoir Sampling for maintaining a fixed-size memory buffer. Reservoir sampling takes in a data stream of unknown length and assigns equal probability to each sample for being represented in the memory buffer $( \mathcal { M } )$ with a fixed budget size $( B )$ . Sampling and replacement are done at random and no priority is assigned to the samples being added or replaced from the memory buffer.
|
| 281 |
+
|
| 282 |
+
# Algorithm 2 Reservoir Sampling Algorithm
|
| 283 |
+
|
| 284 |
+
<table><tr><td>(x,y)</td><td>Input: Memory Buffer M, Memory Budget B,Number of seen examples N, Selected example</td></tr><tr><td>1: if B> N then</td><td>Memory is not full</td></tr><tr><td>2: M[N] ← (x,y)</td><td></td></tr><tr><td>3: else</td><td>> Select a sample to remove</td></tr><tr><td>4:</td><td>V = randomInteger(min= 0,max = N)</td></tr><tr><td>5: ifv<Bthen</td><td></td></tr><tr><td>6: M[v]←(x,y)</td><td></td></tr><tr><td>return M</td><td></td></tr></table>
|
| 285 |
+
|
| 286 |
+
# C ADDITIONAL RESULTS
|
| 287 |
+
|
| 288 |
+
In this section, we provide additional experimental results and analysis of the behavior of the model.
|
| 289 |
+
|
| 290 |
+
# C.1 CLS-ER COMPONENTS PERFORMANCE
|
| 291 |
+
|
| 292 |
+
CLS-ER involves the interplay between the working model and the two semantic memories: the plastic and stable models. While we use the stable model for final inference, here we provide the performance of each of these individual components to provide further insights into the workings of our method. Table S1 shows the corresponding performance of the working model and plastic model for each of our experimental settings. We can see that the stable model can effectively consolidate knowledge across the tasks and therefore provide the highest mean performance for the vast majority of the settings. Figures S1 and S2 further shows how the task-wise performance (on test set) of each of the component varies as subsequent tasks are learned. The stable model retains the performance on previous tasks while the plastic model adapts better to the recent task. Both these models provide feedback to the working model which in turn improves the plastic and stable model.
|
| 293 |
+
|
| 294 |
+
Table S1: CLS-ER components performance analysis for each of the experimental setting.
|
| 295 |
+
|
| 296 |
+
<table><tr><td>Dataset</td><td>Buffer</td><td>Stable Model</td><td>Working Model</td><td>Plastic Model</td></tr><tr><td rowspan="3">S-MNIST</td><td>200</td><td>89.54±0.21</td><td>89.32±0.23</td><td>89.52±0.21</td></tr><tr><td>500</td><td>92.05±0.30</td><td>91.61±0.47</td><td>92.04±0.33</td></tr><tr><td>5120</td><td>95.73±0.10</td><td>95.65±0.15</td><td>95.73±0.12</td></tr><tr><td rowspan="3">S-CIFAR-10</td><td>200</td><td>66.19±0.75</td><td>50.09±1.48</td><td>62.68±1.94</td></tr><tr><td>500</td><td>75.22±0.71</td><td>63.09±1.12</td><td>71.32±0.89</td></tr><tr><td>5120</td><td>86.78±0.17</td><td>85.00±0.33</td><td>86.77±0.17</td></tr><tr><td rowspan="3">S-Tiny-ImageNet</td><td>200</td><td>23.47±0.80</td><td>9.97±0.18</td><td>17.19±0.71</td></tr><tr><td>500</td><td>31.03±0.56</td><td>15.35±0.34</td><td>27.16±0.43</td></tr><tr><td>5120</td><td>46.74±0.31</td><td>41.39±0.39</td><td>47.10±0.42</td></tr><tr><td rowspan="3">R-MNIST</td><td>200</td><td>92.26±0.18</td><td>89.37±0.47</td><td>89.99±0.43</td></tr><tr><td>500</td><td>94.06±0.07</td><td>93.24±0.14</td><td>93.52±0.09</td></tr><tr><td>5120</td><td>94.25±0.06</td><td>94.28±0.08</td><td>94.37±0.06</td></tr><tr><td rowspan="3">P-MNIST</td><td>200</td><td>84.63±0.40</td><td>84.33±0.45</td><td>84.54±0.41</td></tr><tr><td>500</td><td>88.30±0.14</td><td>88.12±0.16</td><td>88.25±0.14</td></tr><tr><td>5120</td><td>92.03±0.05</td><td>91.96±0.06</td><td>92.02±0.05</td></tr><tr><td rowspan="3">MNIST-360</td><td>200</td><td>66.37±0.83</td><td>55.59±1.74</td><td>60.60±1.41</td></tr><tr><td>500</td><td>75.70±0.41</td><td>72.70±0.80</td><td>75.03±0.37</td></tr><tr><td>1000</td><td>79.54±0.34</td><td>78.39±0.69</td><td>79.16±0.42</td></tr><tr><td rowspan="3">GCIL-CIFAR-100 (Uniform)</td><td>200</td><td>33.15±2.80</td><td>31.74±2.72</td><td>32.70±2.78</td></tr><tr><td>500</td><td>37.01±1.67</td><td>35.89±1.69</td><td>36.18±1.68</td></tr><tr><td>1000</td><td>41.09±1.58</td><td>40.44±1.80</td><td>40.70±1.66</td></tr><tr><td rowspan="3">GCIL-CIFAR-100 (Longtail)</td><td>200</td><td>29.57±3.80</td><td>28.19±3.90</td><td>29.12±3.89</td></tr><tr><td>500</td><td>33.26±3.66</td><td>32.22±3.79</td><td>32.95±3.70</td></tr><tr><td>1000</td><td>39.21±3.46</td><td>38.51±3.55</td><td>38.84±3.52</td></tr></table>
|
| 297 |
+
|
| 298 |
+
# C.2 TASK PROBABILITIES
|
| 299 |
+
|
| 300 |
+
To test the effectiveness of our method in mitigating the bias towards recent tasks, we provide the task probabilities of the models trained with different buffer sizes on S-CIFAR-10 and S-TinyImageNet. Figures S3 and S4 show that CLS-ER consistently achieves more uniform task probabilities compared to ER and $\mathrm { D E R + + }$ and effectively mitigates the bias towards the last task.
|
| 301 |
+
|
| 302 |
+
# C.3 MODEL CALIBRATION
|
| 303 |
+
|
| 304 |
+
To further test the consistency of CLS-ER in providing well-calibrated models and the impact of the buffer size, we evaluate the calibration of models trained with different buffer sizes on S-CIFAR-10 and S-Tiny-ImageNet. Figures S5 and S6 show that CLS-ER consistently provides better calibrated models compared to ER and $\mathrm { D E R + + }$ . Remarkably, for both the datasets, on lower buffer sizes, the difference in Expected Calibration Error (ECE) is considerable. This demonstrates the capability of CLS-ER to train high-performance and reliable models under challenging conditions.
|
| 305 |
+
|
| 306 |
+
# C.4 EFFECT OF HYPERPARAMETERS
|
| 307 |
+
|
| 308 |
+
The interaction between the three components of CLS-ER is complementary. Table S3 shows how the performance of each component is affected under different hyperparameter settings. We can draw the following conclusions from the results. The performance improvement in the plastic and stable model is reflected in the working model and the best performance is seen in cases where both the semantic memories are performing well (albeit the focus on tasks is different). This highlights the crucial role of both memories in enabling CLS-ER to learn efficiently. For a fixed $r _ { S }$ value, the final performance of the stable model is affected considerably by the performance of the plastic model. The method is not highly sensitive to the particular choice of hyperparameters as different settings can attain similar performance. Because of the complementary nature of the components, we can often fix a set of parameters (e.g. $\lambda$ , $\alpha _ { S }$ , $\alpha _ { S }$ and $r _ { S }$ ) and only finetune the remaining parameters (e.g. $r _ { P } ^ { \prime }$ ) which facilitates hyperparameter tuning significantly.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure S1: Test set task-wise performance for the individual models on S-CIFAR-10 with different buffer sizes. The task-wise performance $\mathbf { \dot { x } }$ -axis) is evaluated at the end of training of each task (y-axis) to evaluate how it is affected as training progresses.
|
| 312 |
+
|
| 313 |
+
# D COMPARISON WITH A SINGLE SEMANTIC MEMORY
|
| 314 |
+
|
| 315 |
+
CLS-ER employs two semantic memories as we aim to mimic the fast and slow learning mechanisms in the hippocampus and neocortex respectively. Here we compare our method with a single semantic memory (Mean-ER) and Table S2 shows that while it still performs admirably compared to the other CL methods, the dual semantic memories in CLS-ER provides additional performance gains especially on the complex datasets under the challenging lower memory buffer settings and has a much lower variance. We attribute this to the failure of Mean-ER in maintaining the performance on both the recent and earlier tasks together i.e there is an inherent trade-off as tuning the semantic memory to adapt to the recent changes comes at the cost of performance on earlier tasks and vice versa. CLS-ER efficiently tackles this trade-off by maintaining two specialized long-term and shortterm memories. The performance of Mean-ER, however, provides further evidence for the benefits of using consolidated information for memory replay.
|
| 316 |
+
|
| 317 |
+
Note that for a fair comparison, we use the same hyperparameter search space as CLS-ER for finding the optimal parameters for Mean-ER and report the average and 1 std of 10 runs with different initializations using the best parameters for each setting. Table S6 provides the chosen hyperparameters. For inference, similar to CLS-ER, we use the EMA-weighted model (semantic memory) for Mean-ER.
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure S2: Test set task-wise performance for the individual models on S-Tiny-ImageNet with different buffer sizes. The task-wise performance ( $\mathbf { \dot { x } }$ -axis) is evaluated at the end of training of each task (y-axis) to evaluate how it is affected as training progresses.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure S3: Task probabilities for different methods on S-CIFAR-10 with varying memory budget.
|
| 324 |
+
|
| 325 |
+
# E TRAINING AND IMPLEMENTATION DETAILS
|
| 326 |
+
|
| 327 |
+
For a fair comparison, we aim to keep the experimental settings close to the current state-of-theart $\mathrm { D E R + + }$ (Buzzega et al., 2020a) as much as possible to disassociate the effect of the training schedule. We use the same optimizer, the number of epochs, batch size, and memory batch size as $\mathrm { D E R + + }$ . For S-Tiny-ImageNet, we reduce the number of epochs to 50 from 100 used by $\mathrm { D E R + + }$ as our method can learn efficiently with fewer epochs, and quickly acquiring new knowledge is preferred for CL. Similar to $\mathrm { D E R + + }$ , we finetune the memory batch size for S-MNIST and MNIST360. We select the hyperparameters for each of the experimental setting using a small validation set, $\alpha _ { S } , \alpha _ { P } \in ( 0 . 9 9 , 0 . 9 9 9 )$ , $r _ { S } , r _ { P } \in ( 0 , 1 ]$ , $\lambda \in ( 0 , 2 ]$ . Table S4 provides the hyperparameters used for each of the experimental settings. Note that for the vast majority of datasets, we use uniform settings (lr, epochs, batch size, memory batch size, and lambda) across the different buffer sizes and requires only slight modifications in the other hyperparameters which shows that our method does not require extensive finetuning for different memory budgets.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure S4: Task probabilities for different methods on S-Tiny-ImageNet with varying memory budget.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure S5: Reliability plots for the different methods on S-CIFAR-10 with varying memory budget.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure S6: Reliability plots for the different methods on S-Tiny-ImageNet with varying memory budget.
|
| 337 |
+
|
| 338 |
+
Table S2: Comparison of CLS-ER with Mean-ER (single semantic memory) on Class-IL and Domain-IL settings. We report the mean and 1 std of 10 runs with different initializations.
|
| 339 |
+
|
| 340 |
+
<table><tr><td rowspan="2">Buffer</td><td rowspan="2">Method</td><td colspan="3">Class-IL</td><td colspan="2">Domain-IL</td></tr><tr><td>S-MNIST</td><td>S-CIFAR-10</td><td>S-Tiny-ImageNet</td><td>R-MNIST</td><td>P-MNIST</td></tr><tr><td rowspan="2"></td><td>JOINT</td><td>95.57±0.24</td><td>92.20±0.15</td><td>59.99±0.19</td><td>95.76±0.04</td><td>94.33±0.17</td></tr><tr><td>SGD</td><td>19.60±0.04</td><td>19.62±0.05</td><td>7.92±0.26</td><td>67.66±8.53</td><td>40.70±2.33</td></tr><tr><td rowspan="2">200</td><td>Mean-ER</td><td>88.32±0.65</td><td>61.88±2.43</td><td>17.68±1.65</td><td>92.10±1.07</td><td>83.28±0.68</td></tr><tr><td>CLS-ER</td><td>89.54±0.21</td><td>66.19±0.75</td><td>23.47±0.80</td><td>92.26±0.18</td><td>84.63±0.40</td></tr><tr><td rowspan="2">500</td><td>Mean-ER</td><td>91.79±0.23</td><td>70.40±1.21</td><td>24.97±0.80</td><td>92.78±0.44</td><td>87.73±0.39</td></tr><tr><td>CLS-ER</td><td>92.05±0.32</td><td>75.22±0.71</td><td>31.03±0.56</td><td>94.06±0.07</td><td>88.30±0.14</td></tr><tr><td rowspan="2">5120</td><td>Mean-ER</td><td>95.57±0.18</td><td>84.84±2.0</td><td>45.69±0.58</td><td>94.25±0.51</td><td>91.90±0.11</td></tr><tr><td>CLS-ER</td><td>95.73±0.11</td><td>86.78±0.17</td><td>46.74±0.31</td><td>94.25±0.06</td><td>92.03±0.05</td></tr></table>
|
| 341 |
+
|
| 342 |
+
# E.1 GCIL-CIFAR-100
|
| 343 |
+
|
| 344 |
+
To test our method under challenging GIL settings that better simulate the challenges of CL in the real world, we incorporate the GCIL setting from the code provided by Mi et al. (2020) with the continual dataset template class in the mammoth framework. We set the number of phases (length of task sequences) to 20, with the total number of samples in each phase set to 1000 and the maximum number of classes in each phase set to 50. We evaluate on both uniform and longtail (imbalanced) data distributions. Since GCIL involves the probabilistic sampling of the classes and their samples in each phase, the random seed determines the complexity of the GCIL setting. Therefore, for reproduciblility and to gauge the stability of the methods, we fix the dataset seed to 1993 and report the average and standard deviation of 10 differently initialized models trained on the same settings.
|
| 345 |
+
|
| 346 |
+
For each of our method, we use identical training scheme $\mathrm { { ( l r { = } 0 . 1 } }$ , epochs $_ { \mathrm { \scriptsize = } 1 0 0 }$ , batch size $^ { \underline { { \ } } 3 2 }$ and memory batch $\mathrm { s i z e } { = } 3 2$ ). For $\mathrm { D E R + + }$ , as per the authors suggestion, we performed hyperparameter search over $\alpha \in [ 0 . 2 , 0 . 3 ]$ and $b e t a \in [ 0 . 5 , 1 . 0 ]$ with step size of 0.1. Table S5 provides the parameters chosen for each of the method under the different settings.
|
| 347 |
+
|
| 348 |
+
# E.2 PERTURBATION ANALYSIS
|
| 349 |
+
|
| 350 |
+
For the perturbation analysis, we used the code and checkpoints provided by Buzzega et al. (2020a) for $\mathrm { D E R + + }$ and ER. We would like to express our gratitude to the authors for their support and for making the mammoth framework available for the research community which provides a framework for a fair comparison of different CL methods under uniform experimental conditions.
|
| 351 |
+
|
| 352 |
+
Table S3: The effect of different hyperparameter settings on the individual components of CLS-ER trained on S-CIFAR-10 with 500 buffer size. For all the experiments $\alpha _ { S }$ and $\alpha _ { P }$ are fixed to 0.999 and the performance is averaged over 3 runs with different initialization.
|
| 353 |
+
|
| 354 |
+
<table><tr><td>入</td><td>rs</td><td>rp</td><td>Stable Model</td><td>Working Model</td><td>Plastic Model</td></tr><tr><td rowspan="12">0.1</td><td></td><td>0.2</td><td>73.53±1.07</td><td>62.80±0.63</td><td>71.11±2.21</td></tr><tr><td></td><td>0.3</td><td>72.44±1.37</td><td>63.53±1.98</td><td>70.97±1.71</td></tr><tr><td></td><td>0.4</td><td>73.05±0.93</td><td>61.81±1.92</td><td>68.75±2.20</td></tr><tr><td></td><td>0.5</td><td>75.16±1.09</td><td>63.95±1.92</td><td>70.42±1.09</td></tr><tr><td>0.1</td><td>0.6</td><td>75.04±0.66</td><td>62.82±0.70</td><td>69.61±0.31</td></tr><tr><td></td><td>0.7</td><td>73.94±0.48</td><td>63.34±0.46</td><td>70.30±1.68</td></tr><tr><td></td><td>0.8</td><td>74.61±1.10</td><td>62.68±0.65</td><td>70.74±0.39</td></tr><tr><td rowspan="12"></td><td></td><td>73.74±2.14</td><td>62.69±1.97</td><td>69.52±0.79</td></tr><tr><td></td><td>0.9 1.0</td><td>64.21±1.11</td><td>72.00±0.56</td></tr><tr><td>0.3</td><td>75.73±0.68 70.26±1.79</td><td>61.63±1.03</td><td>69.31±1.82</td></tr><tr><td></td><td>71.80±1.17</td><td>62.64±0.18</td><td>70.64±1.22</td></tr><tr><td>0.4 0.5</td><td>70.69±2.13</td><td>61.76±0.64</td><td>69.65±1.92</td></tr><tr><td></td><td>72.45±0.68</td><td></td><td></td></tr><tr><td>0.2</td><td>0.6 0.7</td><td>71.47±1.98</td><td>63.87±0.85</td><td>71.29±0.72</td></tr><tr><td></td><td>0.8</td><td>72.16±0.56</td><td>61.12±1.90 62.71±0.57</td><td>70.22±2.24</td></tr><tr><td></td><td>0.9</td><td>72.09±0.59</td><td></td><td>70.83±0.64</td></tr><tr><td></td><td>1.0</td><td>72.05±1.35</td><td>63.33±1.01 63.74±1.75</td><td>71.20±0.87</td></tr><tr><td></td><td>0.4</td><td></td><td></td><td>71.01±1.28</td></tr><tr><td rowspan="12"></td><td></td><td></td><td>68.46±1.48</td><td>60.96±1.62</td><td>68.31±1.40</td></tr><tr><td></td><td>0.5 0.6</td><td>70.05±2.54</td><td>63.06±1.26</td><td>69.90±2.57</td></tr><tr><td></td><td></td><td>69.57±1.07</td><td>61.25±1.96</td><td>69.36±1.06</td></tr><tr><td>0.3</td><td>0.7</td><td>68.99±2.34</td><td>61.61±2.17</td><td>68.81±2.27</td></tr><tr><td></td><td>0.8</td><td>71.21±0.48</td><td>63.08±0.82</td><td>70.99±0.57</td></tr><tr><td>1</td><td>0.9</td><td>71.26±1.47</td><td>62.33±0.64</td><td>71.03±1.56</td></tr><tr><td></td><td>0.2</td><td>69.00±0.41</td><td>61.38±0.92</td><td>68.69±0.31</td></tr><tr><td rowspan="14"></td><td></td><td></td><td>70.19±1.97</td><td>61.39±2.06</td><td>69.81±1.60</td></tr><tr><td></td><td>0.3</td><td>73.72±0.83</td><td>62.07±0.84</td><td>70.18±0.09</td></tr><tr><td></td><td>0.4</td><td>71.60±2.30</td><td>61.11±2.00</td><td>69.15±1.08</td></tr><tr><td></td><td>0.5</td><td>74.18±0.37</td><td>63.32±0.98</td><td>71.08±2.04</td></tr><tr><td>0.1</td><td>0.6</td><td>74.90±0.40</td><td>62.35±2.31</td><td>71.58±0.79</td></tr><tr><td></td><td>0.7</td><td>74.52±1.10</td><td>62.59±2.64</td><td>70.90±2.30</td></tr><tr><td></td><td>0.8</td><td>75.27±1.21</td><td>62.00±1.98</td><td>71.27±1.64</td></tr><tr><td></td><td>0.9</td><td>74.61±0.91</td><td>63.47±1.60</td><td>70.49±0.95</td></tr><tr><td></td><td>1.0</td><td>76.03±0.64</td><td>63.63±1.01</td><td></td></tr><tr><td rowspan="12">0.15</td><td></td><td></td><td></td><td></td><td>71.42±1.11</td></tr><tr><td></td><td>0.3 0.4</td><td>72.59±1.44 71.30±3.42</td><td>61.81±1.03</td><td>72.02±1.30</td></tr><tr><td></td><td></td><td></td><td>63.15±0.51</td><td>70.92±2.83</td></tr><tr><td></td><td>0.5</td><td>69.89±1.95</td><td>60.60±0.95</td><td>68.87±2.56</td></tr><tr><td>0.2</td><td>0.6</td><td>72.34±0.89</td><td>62.18±1.31</td><td>71.15±0.94</td></tr><tr><td></td><td>0.7</td><td>72.70±1.11</td><td>62.50±1.18</td><td>71.49±1.21</td></tr><tr><td></td><td>0.8</td><td>72.42±1.50</td><td>61.85±0.83</td><td>71.04±1.68</td></tr><tr><td></td><td>0.9</td><td>71.18±0.71</td><td>61.81±1.29</td><td>70.09±0.54</td></tr><tr><td></td><td>1.0 0.4</td><td>73.52±0.65</td><td>64.19±0.86</td><td>72.56±0.52</td></tr><tr><td rowspan="8"></td><td></td><td>70.32±1.39</td><td>62.39±2.00</td><td>70.13±1.33</td></tr><tr><td>0.5</td><td>71.60±1.53</td><td>62.67±2.08</td><td>71.40±1.54</td></tr><tr><td>0.6</td><td>70.36±1.82</td><td>62.28±2.28</td><td>70.13±2.03</td></tr><tr><td>0.7 0.3</td><td>69.79±1.93</td><td>61.13±1.37</td><td>69.65±1.82</td></tr><tr><td>0.8</td><td>69.85±0.95</td><td>60.69±1.63</td><td>69.78±0.60</td></tr><tr><td>0.9</td><td>71.32±1.68</td><td>61.79±1.41</td><td>71.03±1.61</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>1.0</td><td>71.39±0.49</td><td>62.35±0.88</td><td>71.11±0.55</td></tr></table>
|
| 355 |
+
|
| 356 |
+
Table S4: The hyperparameters used for each of the experimental settings for CLS-ER.
|
| 357 |
+
|
| 358 |
+
<table><tr><td>Dataset</td><td>Buffer</td><td>lr</td><td>Epochs</td><td>Batch Size</td><td>Memory Batch Size</td><td>入</td><td>αs</td><td>αp</td><td>rs</td><td>rp</td></tr><tr><td rowspan="3">S-MNIST</td><td>200</td><td>0.03</td><td>1</td><td>10</td><td>128</td><td>2.0</td><td>0.99</td><td>0.99</td><td>0.9</td><td>1.0</td></tr><tr><td>500</td><td>0.1</td><td>1</td><td>10</td><td>32</td><td>2.0</td><td>0.99</td><td>0.99</td><td>0.9</td><td>1.0</td></tr><tr><td>5120</td><td>0.1</td><td>1</td><td>10</td><td>32</td><td>2.0</td><td>0.99</td><td>0.99</td><td>0.8</td><td>1.0</td></tr><tr><td rowspan="3">S-CIFAR-10</td><td>200</td><td>0.1</td><td>50</td><td>32</td><td>32</td><td>0.15</td><td>0.999</td><td>0.999</td><td>0.1</td><td>0.3</td></tr><tr><td>500</td><td>0.1</td><td>50</td><td>32</td><td>32</td><td>0.15</td><td>0.999</td><td>0.999</td><td>0.1</td><td>0.9</td></tr><tr><td>5120</td><td>0.1</td><td>50</td><td>32</td><td>32</td><td>0.15</td><td>0.999</td><td>0.999</td><td>0.8</td><td>1.0</td></tr><tr><td rowspan="3">S-Tiny-ImageNet</td><td>200</td><td>0.05</td><td>50</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.999</td><td>0.04</td><td>0.08</td></tr><tr><td>500</td><td>0.05</td><td>50</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.999</td><td>0.05</td><td>0.08</td></tr><tr><td>5120</td><td>0.05</td><td>50</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.999</td><td>0.07</td><td>0.08</td></tr><tr><td rowspan="3">R-MNIST</td><td>200</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>0.75</td><td>0.999</td><td>0.99</td><td>1.0</td><td>1.0</td></tr><tr><td>500</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>0.75</td><td>0.999</td><td>0.99</td><td>1.0</td><td>1.0</td></tr><tr><td>5120</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>0.75</td><td>0.999</td><td>0.99</td><td>1.0</td><td>1.0</td></tr><tr><td rowspan="3">P-MNIST</td><td>200</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>1.0</td><td>0.99</td><td>0.99</td><td>0.8</td><td>1.0</td></tr><tr><td>500</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>1.0</td><td>0.99</td><td>0.99</td><td>0.8</td><td>1.0</td></tr><tr><td>5120</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>1.0</td><td>0.99</td><td>0.99</td><td>0.9</td><td>1.0</td></tr><tr><td rowspan="3">MNIST-360</td><td>200</td><td>0.2</td><td>1</td><td>16</td><td>16</td><td>0.75</td><td>0.999</td><td>0.99</td><td>1.0</td><td>1.0</td></tr><tr><td>500</td><td>0.2</td><td>1</td><td>16</td><td>32</td><td>1.25</td><td>0.99</td><td>0.99</td><td>0.9</td><td>1.0</td></tr><tr><td>1000</td><td>0.2</td><td>1</td><td>16</td><td>128</td><td>0.75</td><td>0.99</td><td>0.99</td><td>0.9</td><td>1.0</td></tr><tr><td rowspan="3">GCIL-CIFAR-100</td><td>200</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.999</td><td>0.6</td><td>0.7</td></tr><tr><td>500</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.999</td><td>0.6</td><td>0.7</td></tr><tr><td>1000</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.999</td><td>0.6</td><td>0.8</td></tr></table>
|
| 359 |
+
|
| 360 |
+
Table S5: The hyperparameters used for $\mathrm { D E R + + }$ on GCIL-CIFAR-100 experiments. CLS-ER uses the same hyperparameters for both Uniform and Longtail settings (Table S4).
|
| 361 |
+
|
| 362 |
+
<table><tr><td>Distribution</td><td>Buffer</td><td>lr</td><td>Epochs</td><td>Batch Size</td><td>Memory Batch Size</td><td>a</td><td>B</td></tr><tr><td rowspan="3">Uniform</td><td>200</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.2</td><td>0.5</td></tr><tr><td>500</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.2</td><td>0.6</td></tr><tr><td>1000</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.3</td><td>0.6</td></tr><tr><td rowspan="3">Longtail</td><td>200</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.2</td><td>0.6</td></tr><tr><td>500</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.2</td><td>0.8</td></tr><tr><td>1000</td><td>0.1</td><td>100</td><td>32</td><td>32</td><td>0.3</td><td>0.9</td></tr></table>
|
| 363 |
+
|
| 364 |
+
<table><tr><td>Dataset</td><td>Buffer</td><td>lr</td><td>Epochs</td><td>Batch Size</td><td>Memory Batch Size</td><td>入</td><td>a</td><td>r</td></tr><tr><td rowspan="3"> S-MNIST</td><td>200</td><td>0.03</td><td>1</td><td>10</td><td>128</td><td>2.0</td><td>0.99</td><td>1.0</td></tr><tr><td>500</td><td>0.1</td><td>1</td><td>10</td><td>32</td><td>2.0</td><td>0.99</td><td>1.0</td></tr><tr><td>5120</td><td>0.1</td><td>1</td><td>10</td><td>32</td><td>2.0</td><td>0.99</td><td>1.0</td></tr><tr><td rowspan="3">S-CIFAR-10</td><td>200</td><td>0.1</td><td>50</td><td>32</td><td>32</td><td>0.15</td><td>0.999</td><td>0.2</td></tr><tr><td>500</td><td>0.1</td><td>50</td><td>32</td><td>32</td><td>0.15</td><td>0.999</td><td>0.5</td></tr><tr><td>5120</td><td>0.1</td><td>50</td><td>32</td><td>32</td><td>0.15</td><td>0.999</td><td>0.8</td></tr><tr><td rowspan="3">S-Tiny-ImageNet</td><td>200</td><td>0.05</td><td>50</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.06</td></tr><tr><td>500</td><td>0.05</td><td>50</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.08</td></tr><tr><td>5120</td><td>0.05</td><td>50</td><td>32</td><td>32</td><td>0.1</td><td>0.999</td><td>0.08</td></tr><tr><td rowspan="3">R-MNIST</td><td>200</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>0.75</td><td>0.999</td><td>1.0</td></tr><tr><td>500</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>0.75</td><td>0.999</td><td>1.0</td></tr><tr><td>5120</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>0.75</td><td>0.999</td><td>1.0</td></tr><tr><td rowspan="3">P-MNIST</td><td>200</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>1.0</td><td>0.99</td><td>0.9</td></tr><tr><td>500</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>1.0</td><td>0.99</td><td>1.0</td></tr><tr><td>5120</td><td>0.2</td><td>1</td><td>128</td><td>128</td><td>1.0</td><td>0.99</td><td>0.9</td></tr></table>
|
| 365 |
+
|
| 366 |
+
Table S6: The hyperparameters used for each of the experimental settings for Mean-ER.
|
md/dev/vSVLM2j9eie/vSVLM2j9eie.md
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CROSSFORMER: TRANSFORMER UTILIZING CROSSDIMENSION DEPENDENCY FOR MULTIVARIATE TIME SERIES FORECASTING
|
| 2 |
+
|
| 3 |
+
Yunhao Zhang & Junchi Yan∗
|
| 4 |
+
MoE Key Lab of Artificial Intelligence, Shanghai Jiao Tong University and Shanghai AI Lab
|
| 5 |
+
{zhangyunhao, yanjunchi}@sjtu.edu.cn
|
| 6 |
+
Code: https://github.com/Thinklab-SJTU/Crossformer
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Recently many deep models have been proposed for multivariate time series (MTS) forecasting. In particular, Transformer-based models have shown great potential because they can capture long-term dependency. However, existing Transformerbased models mainly focus on modeling the temporal dependency (cross-time dependency) yet often omit the dependency among different variables (crossdimension dependency), which is critical for MTS forecasting. To fill the gap, we propose Crossformer, a Transformer-based model utilizing cross-dimension dependency for MTS forecasting. In Crossformer, the input MTS is embedded into a 2D vector array through the Dimension-Segment-Wise (DSW) embedding to preserve time and dimension information. Then the Two-Stage Attention (TSA) layer is proposed to efficiently capture the cross-time and cross-dimension dependency. Utilizing DSW embedding and TSA layer, Crossformer establishes a Hierarchical Encoder-Decoder (HED) to use the information at different scales for the final forecasting. Extensive experimental results on six real-world datasets show the effectiveness of Crossformer against previous state-of-the-arts.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Multivariate time series (MTS) are time series with multiple dimensions, where each dimension represents a specific univariate time series (e.g. a climate feature of weather). MTS forecasting aims to forecast the future value of MTS using their historical values. MTS forecasting benefits the decision-making of downstream tasks and is widely used in many fields including weather (Angryk et al., 2020), energy (Demirel et al., 2012), finance (Patton, 2013), etc. With the development of deep learning, many models have been proposed and achieved superior performances in MTS forecasting (Lea et al., 2017; Qin et al., 2017; Flunkert et al., 2017; Rangapuram et al., 2018; Li et al., 2019a; Wu et al., 2020; Li et al., 2021). Among them, the recent Transformer-based models (Li et al., 2019b; Zhou et al., 2021; Wu et al., 2021a; Liu et al., 2021a; Zhou et al., 2022; Chen et al., 2022) show great potential thanks to their ability to capture long-term temporal dependency (cross-time dependency).
|
| 15 |
+
|
| 16 |
+
Besides cross-time dependency, the cross-dimension dependency is also critical for MTS forecasting, i.e. for a specific dimension, information from associated series in other dimensions may improve prediction. For example, when predicting future temperature, not only the historical temperature, but also historical wind speed helps to forecast. Some previous neural models explicitly capture the cross-dimension dependency, i.e. preserving the information of dimensions in the latent feature space and using convolution neural network (CNN) (Lai et al., 2018) or graph neural network (GNN) (Wu et al., 2020; Cao et al., 2020) to capture their dependency. However, recent Transformer-based models only implicitly utilize this dependency by embedding. In general, Transformer-based models embed data points in all dimensions at the same time step into a feature vector and try to capture dependency among different time steps (like Fig. 1 (b)). In this way, cross-time dependency is well captured, but cross-dimension dependency is not, which may limit their forecasting capability.
|
| 17 |
+
|
| 18 |
+
To fill the gap, we propose Crossformer, a Transformer-based model that explicitly utilizes crossdimension dependency for MTS forecasting. Specifically, we devise Dimension-Segment-Wise (DSW) embedding to process the historical time series. In DSW embedding, the series in each dimension is first partitioned into segments and then embedded into feature vectors. The output of DSW embedding is a 2D vector array where the two axes correspond to time and dimension. Then we propose the Two-Stage-Attention (TSA) layer to efficiently capture the cross-time and cross-dimension dependency among the 2D vector array. Using DSW embedding and TSA layer, Crossformer establishes a Hierarchical Encoder-Decoder (HED) for forecasting. In HED, each layer corresponds to a scale. The encoder’s upper layer merges adjacent segments output by the lower layer to capture the dependency at a coarser scale. Decoder layers generate predictions at different scales and add them up as the final prediction. The contributions of this paper are:
|
| 19 |
+
|
| 20 |
+
1) We dive into the existing Transformer-based models for MTS forecasting and figure out that the cross-dimension dependency is not well utilized: these models simply embed data points of all dimensions at a specific time step into a single vector and focus on capturing the cross-time dependency among different time steps. Without adequate and explicit mining and utilization of cross-dimension dependency, their forecasting capability is empirically shown limited.
|
| 21 |
+
|
| 22 |
+
2) We develop Crossformer, a Transformer model utilizing cross-dimension dependency for MTS forecasting. This is one of the few transformer models (perhaps the first to our best knowledge) that explicitly explores and utilizes cross-dimension dependency for MTS forecasting.
|
| 23 |
+
|
| 24 |
+
3) Extensive experimental results on six real-world benchmarks show the effectiveness of our Crossformer against previous state-of-the-arts. Specifically, Crossformer ranks top-1 among the 9 models for comparison on 36 out of the 58 settings of varying prediction lengths and metrics and ranks top-2 on 51 settings.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORKS
|
| 27 |
+
|
| 28 |
+
Multivariate Time Series Forecasting. MTS forecasting models can be roughly divided into statistical and neural models. Vector auto-regressive (VAR) model (Kilian & LAtkepohl ˜ , 2017) and Vector auto-regressive moving average (VARMA) are typical statistical models, which assume linear cross-dimension and cross-time dependency. With the development of deep learning, many neural models have been proposed and often empirically show better performance than statistical ones. TCN (Lea et al., 2017) and DeepAR (Flunkert et al., 2017) treat the MTS data as a sequence of vectors and use CNN/RNN to capture the temporal dependency. LSTnet (Lai et al., 2018) employs CNN to capture cross-dimension dependency and RNN for cross-time dependency. Another category of works use graph neural networks (GNNs) to capture the cross-dimension dependency explicitly for forecasting (Li et al., 2018; Yu et al., 2018; Cao et al., 2020; Wu et al., 2020). For example, MTGNN (Wu et al., 2020) uses temporal convolution and graph convolution layers to capture crosstime and cross-dimension dependency. These neural models capture the cross-time dependency through CNN or RNN, which have difficulty in modeling long-term dependency.
|
| 29 |
+
|
| 30 |
+
Transformers for MTS Forecasting. Transformers (Vaswani et al., 2017) have achieved success in natural language processing (NLP) (Devlin et al., 2019), vision (CV) (Dosovitskiy et al., 2021) and speech processing (Dong et al., 2018). Recently, many Transformer-based models have been proposed for MTS forecasting and show great potential (Li et al., 2019b; Zhou et al., 2021; Wu et al., 2021a; Liu et al., 2021a; Zhou et al., 2022; Du et al., 2022). LogTrans (Li et al., 2019b) proposes the LogSparse attention that reduces the computation complexity of Transformer from ${ \dot { O } } ( { \dot { L } } ^ { 2 } )$ to $O \left( L ( \log L ) ^ { 2 } \right)$ . Informer (Zhou et al., 2021) utilizes the sparsity of attention score through KL divergence estimation and proposes ProbSparse self-attention which achieves $O ( L \log L )$ complexity. Autoformer (Wu et al., 2021a) introduces a decomposition architecture with an Auto-Correlation mechanism to Transformer, which also achieves the $O ( L \log L )$ complexity. Pyraformer (Liu et al., 2021a) introduces a pyramidal attention module that summarizes features at different resolutions and models the temporal dependencies of different ranges with the complexity of $O ( L )$ . FEDformer (Zhou et al., 2022) proposes that time series have a sparse representation in frequency domain and develop a frequency enhanced Transformer with the $O ( L )$ complexity. Preformer (Du et al., 2022) divides the embedded feature vector sequence into segments and utilizes segment-wise correlation-based attention for forecasting. These models mainly focus on reducing the complexity of cross-time dependency modeling, but omits the cross-dimension dependency which is critical for MTS forecasting.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 1: Illustration for our DSW embedding. (a) Self-attention scores from a 2-layer Transformer trained on ETTh1, showing that MTS data tends to be segmented. (b) Embedding method of previous Transformer-based models (Li et al., 2019b; Zhou et al., 2021; Wu et al., 2021a; Liu et al., 2021a): data points in different dimensions at the same step are embedded into a vector. (c) DSW embedding of Crossformer: in each dimension, nearby points over time form a segment for embedding.
|
| 34 |
+
|
| 35 |
+
Vision Transformers. Transformer is initially applied to NLP for sequence modeling, recent works apply transformer to CV tasks to process images (Dosovitskiy et al., 2021; Touvron et al., 2021; Liu et al., 2021b; Chen et al., 2021; Han et al., 2021). These works achieve state-of-the-art performance on various tasks in CV and inspire our work. ViT (Dosovitskiy et al., 2021) is one of the pioneers of vision transformers. The basic idea of ViT is to split an image into non-overlapping medium-sized patches, then it rearranges these patches into a sequence to be input to the Transformer. The idea of partitioning images into patches inspires our DSW embedding where MTS is split into dimensionwise segments. Swin Transformer (Liu et al., 2021b) performs local attention within a window to reduce the complexity and builds hierarchical feature maps by merging image patches. Readers can refer to the recent survey (Han et al., 2022) for comprehensive study on vision transformers.
|
| 36 |
+
|
| 37 |
+
# 3 METHODOLOGY
|
| 38 |
+
|
| 39 |
+
In multivariate time series forecasting, one aims to predict the future value of time series $\mathbf { x } _ { T + 1 : T + \tau } \in$ Rτ×D given the history $\mathbf { x } _ { 1 : T } \in \mathbb { R } ^ { \tilde { T } \times D }$ , where $\tau$ , $T$ is the number of time steps in the future and past, respectively2. $D > 1$ is the number of dimensions. A natural assumption is that these $D$ series are associated (e.g. climate features of weather), which helps to improve the forecasting accuracy. To utilize the cross-dimension dependency, in Section 3.1, we embed the MTS using Dimension-Segment-Wise (DSW) embedding. In Section 3.2, we propose a Two-Stage Attention (TSA) layer to efficiently capture the dependency among the embedded segments. In Section 3.3, using DSW embedding and TSA layer, we construct a hierarchical encoder-decoder (HED) to utilize information at different scales for final forecasting.
|
| 40 |
+
|
| 41 |
+
# 3.1 DIMENSION-SEGMENT-WISE EMBEDDING
|
| 42 |
+
|
| 43 |
+
To motivate our approach, we first analyze the embedding methods of the previous Transformer-based models for MTS forecasting (Zhou et al., 2021; Wu et al., 2021a; Liu et al., 2021a; Zhou et al., 2022). As shown in Fig. 1 (b), existing methods embed data points at the same time step into a vector: $\mathbf { x } _ { t } \mathbf { h } _ { t } , \mathbf { x } _ { t } \in \bar { \mathbb { R } } ^ { D } , \mathbf { h } _ { t } \in \mathbb { R } ^ { d _ { m o d e l } }$ , where $\mathbf { x } _ { t }$ represents all the data points in $D$ dimensions at step $t$ . In this way, the input $\mathbf { x } _ { 1 : T }$ is embedded into $T$ vectors $\{ \mathbf { h } _ { 1 } , \mathbf { h } _ { 2 } , \dots , \mathbf { h } _ { T } \}$ . Then the dependency among the $T$ vectors is captured for forecasting. Therefore, previous Transformer-based models mainly capture cross-time dependency, while the cross-dimension dependency is not explicitly captured during embedding, which limits their forecasting capability.
|
| 44 |
+
|
| 45 |
+
Transformer was originally developed for NLP (Vaswani et al., 2017), where each embedded vector represents an informative word. For MTS, a single value at a step alone provides little information.
|
| 46 |
+
|
| 47 |
+
While it forms informative pattern with nearby values in time domain. Fig. 1 (a) shows a typical attention score map of original Transformer for MTS forecasting. We can see that attention values have a tendency to segment, i.e. close data points have similar attention weights.
|
| 48 |
+
|
| 49 |
+
Based on the above two points, we argue that an embedded vector should represent a series segment of single dimension (Fig. 1 (c)), rather than the values of all dimensions at single step (Fig. 1 (b)). To this end, we propose Dimension-Segment-Wise (DSW) embedding where the points in each dimension are divided into segments of length $L _ { s e g }$ and then embedded:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r l } & { \mathbf { x } _ { 1 : T } = \left\{ \mathbf { x } _ { i , d } ^ { ( s ) } \vert 1 \leq i \leq \frac { T } { L _ { s e g } } , 1 \leq d \leq D \right\} } \\ & { \mathbf { x } _ { i , d } ^ { ( s ) } = \left\{ x _ { t , d } \vert ( i - 1 ) \times L _ { s e g } < t \leq i \times L _ { s e g } \right\} } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where x(s)i,d $\mathbf { x } _ { i , d } ^ { ( s ) } \in \mathbb { R } ^ { L _ { s e g } }$ is the $i$ -th segment in dimension $d$ with length $L _ { s e g }$ . For convenience, we assume that $T , \tau$ are divisible by $L _ { s e g }$ . Then each segment is embedded into a vector using linear projection added with a position embedding:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\mathbf { h } _ { i , d } = \mathbf { E x } _ { i , d } ^ { ( s ) } + \mathbf { E } _ { i , d } ^ { ( p o s ) }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $\mathbf { E } \in \mathbb { R } ^ { d _ { m o d e l } \times L _ { s e g } }$ denotes the learnable projection matrix, and ${ \bf E } _ { i , d } ^ { ( p o s ) } \in \mathbb { R } ^ { d _ { m o d e l } }$ denotes the learnable position embedding for position $( i , d )$ . After embedding, we obtain a 2D vector array $\begin{array} { r } { \mathbf { H } = \left\{ \mathbf { h } _ { i , d } | 1 \leq i \leq \frac { T } { L _ { s e g } } , 1 \leq d \leq D \right\} } \end{array}$ , where each $\mathbf { h } _ { i , d }$ represents a univariate time series segment. The idea of segmentation is also used in Du et al. (2022), which splits the embedded 1D vector sequence into segments to compute the Segment-Correlation in order to enhance locality and reduce computation complexity. However, like other Transformers for MTS forecasting, it does not explicitly capture cross-dimension dependency.
|
| 62 |
+
|
| 63 |
+
# 3.2 TWO-STAGE ATTENTION LAYER
|
| 64 |
+
|
| 65 |
+
For the obtained 2D array $\mathbf { H }$ , one can flatten it into a 1D sequence so that it can be input to a canonical Transformer like ViT (Dosovitskiy et al., 2021) does in vision. While we have specific considerations: 1) Different from images where the axes of height and width are interchangeable, the axes of time and dimension for MTS have different meanings and thus should be treated differently. 2) Directly applying self-attention on 2D array will cause the complexity of O(D2 T 2L2 ) , which is unaffordable for large $D$ . Therefore, we propose the Two-Stage Attention (TSA) Layer to capture cross-time and cross-dimension dependency among the 2D vector array, as sketched in Fig. 2 (a).
|
| 66 |
+
|
| 67 |
+
Cross-Time Stage Given a 2D array $\mathbf { Z } \in \mathbb { R } ^ { L \times D \times d _ { m o d e l } }$ as the input of the TSA Layer, where $L$ and $D$ are the number of segments and dimensions, respectively. $\mathbf { Z }$ here can be the output of DSW embedding or lower TSA layers. For convenience, in the following, we use $\mathbf { Z } _ { i , }$ : to denote the vectors of all dimensions at time step $i$ , $\mathbf { Z } _ { : , d }$ for those of all time steps in dimension $d$ . In the cross-time stage, we directly apply multi-head self-attention (MSA) to each dimension:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } & { \hat { \mathbf { Z } } _ { : , d } ^ { t i m e } = \mathrm { L a y e r N o r m } \Big ( \mathbf { Z } _ { : , d } + \mathrm { M S } \mathbb { A } ^ { t i m e } ( \mathbf { Z } _ { : , d } , \mathbf { Z } _ { : , d } , \mathbf { Z } _ { : , d } ) \Big ) } \\ & { \mathbf { Z } ^ { t i m e } = \mathrm { L a y e r N o r m } \left( \hat { \mathbf { Z } } ^ { t i m e } + \mathrm { M L P } ( \hat { \mathbf { Z } } ^ { t i m e } ) \right) } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $1 \leq d \leq D$ and LayerNorm denotes layer normalization as widely adopted in Vaswani et al. (2017); Dosovitskiy et al. (2021); Zhou et al. (2021), MLP denotes a multi-layer (two in this paper) feedforward network, $\mathtt { M S A } ( \mathbf { Q } , \mathbf { K } , \mathbf { V } )$ denotes the multi-head self-attention (Vaswani et al., 2017) layer where $\mathbf { Q } , \mathbf { K } , \mathbf { V }$ serve as queries, keys and values. All dimensions $1 \leq d \leq D _ { \cdot }$ share the same MSA layer. $\hat { \mathbf { Z } } ^ { t i m e } , \mathbf { Z } ^ { t i m e }$ denotes the output of the MSA and MLP.
|
| 74 |
+
|
| 75 |
+
The computation complexity of cross-time stage is $O ( D L ^ { 2 } )$ . After this stage, the dependency among time segments in the same dimension is captured in ${ \bf Z } ^ { t i m e }$ . Then ${ \bf Z } ^ { t i \bar { m } e }$ becomes the input of Cross-Dimension Stage to capture cross-dimension dependency.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 2: The TSA layer. (a) Two-Stage Attention Layer to process a 2D vector array representing multivariate time series: each vector refers to a segment of the original series. The whole vector array goes through the Cross-Time Stage and Cross-Dimension Stage to get corresponding dependency. (b) Directly using MSA in Cross-Dimension Stage to build the $D$ -to- $D$ connection results in $O ( D ^ { 2 } )$ complexity. (c) Router mechanism for Cross-Dimension Stage: a small fixed number (c) of “routers” gather information from all dimensions and then distribute the gathered information. The complexity is reduced to $O ( 2 c D ) = O ( D )$ .
|
| 79 |
+
|
| 80 |
+
Cross-Dimension Stage We can use a large $L _ { s e g }$ for long sequence in DSW Embedding to reduce the number of segments $L$ in cross-time stage. While in Cross-Dimension Stage, we can not partition dimensions and directly apply MSA will cause the complexity of $O ( D ^ { 2 } )$ (as shown in Fig. 2 (b)), which is unaffordable for datasets with large $D$ . Instead, we propose the router mechanism for potentially large $D$ . As shown in Fig. 2 (c), we set a small fixed number $c < < D$ ) of learnable vectors for each time step $i$ as routers. These routers first aggregate messages from all dimensions by using routers as query in MSA and vectors of all dimensions as key and value. Then routers distribute the received messages among dimensions by using vectors of dimensions as query and aggregated messages as key and value. In this way, the all-to-all connection among $D$ dimensions are built:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r l } & { \quad \mathbf { B } _ { i , : } = \mathbb { M } \mathbb { S } \mathbb { A } _ { 1 } ^ { d i m } ( \mathbf { R } _ { i , : } , \mathbf { Z } _ { i , : } ^ { t i m e } , \mathbf { Z } _ { i , : } ^ { t i m e } ) , 1 \leq i \leq L } \\ & { \quad \overline { { \mathbf { Z } } } _ { i , : } ^ { d i m } = \mathbb { M } \mathbb { S } \mathbb { A } _ { 2 } ^ { d i m } ( \mathbf { Z } _ { i , : } ^ { t i m e } , \mathbf { B } _ { i , : } , \mathbf { B } _ { i , : } ) , 1 \leq i \leq L } \\ & { \quad \hat { \mathbf { Z } } ^ { d i m } = \mathbb { L } \mathbb { a } \mathbb { Y } \mathrm { e r N o r m } \left( \mathbf { Z } ^ { t i m e } + \overline { { \mathbf { Z } } } ^ { d i m } \right) } \\ & { \quad \mathbf { Z } ^ { d i m } = \mathbb { L } \mathbb { a } \mathbb { Y } \mathrm { e r N o r m } \left( \hat { \mathbf { Z } } ^ { d i m } + \mathbb { M } \mathbf { L } \mathbf { P } ( \hat { \mathbf { Z } } ^ { d i m } ) \right) } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\mathbf { R } \in \mathbb { R } ^ { L \times c \times d _ { m o d e l } }$ $\dot { } c$ is a constant) is the learnable vector array serving as routers. B ∈ RL×c×dmodel is the aggregated messages from all dimensions. Zdim denotes output of the router mechanism. All time steps $( 1 ~ \leq ~ i ~ \leq ~ L )$ share the same $\mathbf { M S A } _ { 1 } ^ { d i m }$ , $\mathbf { M S A } _ { 2 } ^ { d i m }$ . $\hat { \mathbf { Z } } ^ { d i m } , \mathbf { Z } ^ { d i m }$ denote output of skip connection and MLP respectively. The router mechanism reduce the complexity from $O ( D ^ { 2 } L )$ to $O ( D L )$ .
|
| 87 |
+
|
| 88 |
+
Adding up Eq. 3 and Eq. 4, we model the two stages as:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf { Y } = \mathbf { Z } ^ { d i m } = \mathrm { T S A } ( \mathbf { Z } )
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 3: Architecture of the Hierarchical Encoder-Decoder in Crossformer with 3 encoder layers. The length of each vector denotes the covered time range. The encoder (left) uses TSA layer and segment merging to capture dependency at different scales: a vector in upper layer covers a longer range, resulting in dependency at a coarser scale. Exploring different scales, the decoder (right) makes the final prediction by forecasting at each scale and adding them up.
|
| 96 |
+
|
| 97 |
+
where Z, $\mathbf { Y } \in \mathbb { R } ^ { L \times D \times d _ { m o d e l } }$ denotes the input and output vector array of TSA layer, respectively. Note that the overall computation complexity of the
|
| 98 |
+
|
| 99 |
+
TSA layer is $O ( D L ^ { 2 } + D L ) = O ( D L ^ { 2 } )$ . After the Cross-Time and Cross-Dimension Stages, every two segments (i.e. ${ \bf Z } _ { i _ { 1 } , d _ { 1 } } , { \bf Z } _ { i _ { 2 } , d _ { 2 } } )$ in $\mathbf { Z }$ are connected, as such both cross-time and cross-dimension dependencies are captured in $\mathbf { Y }$ .
|
| 100 |
+
|
| 101 |
+
# 3.3 HIERARCHICAL ENCODER-DECODER
|
| 102 |
+
|
| 103 |
+
Hierarchical structures are widely used in Transformers for MTS forecasting to capture information at different scales (Zhou et al., 2021; Liu et al., 2021a). In this section, we use the proposed DSW embedding, TSA layer and segment merging to construct a Hierarchical Encoder-Decoder (HED). As shown in Fig. 3, the upper layer utilizes information at a coarser scale for forecasting. Forecasting values at different scales are added to output the final result.
|
| 104 |
+
|
| 105 |
+
Encoder In each layer of the encoder (except the first layer), every two adjacent vectors in time domain are merged to obtain the representation at a coarser level. Then a TSA layer is applied to capture dependency at this scale. This process is modeled as ${ \bf Z } ^ { e n c , l } = \mathrm { E n c o d e r } ( { \bf Z } ^ { e \bar { n } c , l - 1 } )$ :
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\left\{ \begin{array} { l l } { l = 1 : } & { \hat { \mathbf { Z } } ^ { e n c , l } = \mathbf { H } } \\ { l > 1 : } & { \hat { \mathbf { Z } } _ { i , d } ^ { e n c , l } = \mathbf { M } [ \mathbf { Z } _ { 2 i - 1 , d } ^ { e n c , l - 1 } \cdot \mathbf { Z } _ { 2 i , d } ^ { e n c , l - 1 } ] , 1 \le i \le \frac { L _ { l - 1 } } { 2 } , 1 \le d \le D } \\ { } & { \mathbf { Z } ^ { e n c , l } = \mathrm { T S A } ( \hat { \mathbf { Z } } ^ { e n c , l } ) } \end{array} \right.
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\mathbf { H }$ denotes the 2D array obtained by DSW embedding; ${ \bf Z } ^ { e n c , l }$ denotes the output of the $l$ -th encoder layer; $\textbf { M } \in \ \mathbb { R } ^ { d _ { m o d e l } \times 2 d _ { m o d e l } }$ denotes a learnable matrix for segment merging; $[ \cdot ]$ denotes the concatenation operation; $L _ { l - 1 }$ denotes the number of segments in each dimension in layer $l - 1$ , if it is not divisible by 2, we pad ${ \bf Z } ^ { e n c , l - 1 }$ to the proper length; $\hat { \mathbf { Z } } ^ { e n c , l }$ denotes the array after segment merging in the $i$ -th layer. Suppose there are $N$ layers in the encoder, we use ${ \bf { Z } } ^ { e n c , 0 } , { \bf { Z } } ^ { e n c , \tilde { 1 } } , \ldots , { \bf { Z } } ^ { e n c , N } , \left( { \bf { Z } } ^ { e n c , 0 } = \bf { H } \right)$ to represent the $N + 1$ outputs of the encoder. The complexity of each encoder layer is $\begin{array} { r } { O ( D \frac { T ^ { 2 } } { L _ { s e g } ^ { 2 } } ) } \end{array}$
|
| 112 |
+
|
| 113 |
+
Decoder Obtaining the $N + 1$ feature arrays output by the encoder, we use $N + 1$ layers (indexed by $0 , 1 , \ldots , N )$ in decoder for forecasting. Layer $l$ takes the $l$ -th encoded array as input, then outputs a decoded 2D array of layer $l$ . This process is summarized as ${ \bf Z } ^ { d e c , l } = \mathrm { D e c o } \dot { { \bf d e r } } ( { \bf Z } ^ { d e c , l - 1 } , { \bf Z } ^ { e n c , \dot { l } } )$ :
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\begin{array} { r l } & { \left\{ \begin{array} { l l } { l = 0 : } & { \tilde { \mathbf { Z } } ^ { d e c , l } } \\ { l > 0 : } & { \tilde { \mathbf { Z } } ^ { d e c , l } } \end{array} \right. = \mathrm { T S } \mathbb { A } ( \mathbf { E } ^ { ( d e c ) } ) } \\ & { \left. \begin{array} { l l } { \overline { { \mathbf { Z } } } _ { : , d } ^ { d e c , l } = \mathbb { M } \mathbb { S } \mathbb { A } \left( \mathbf { \tilde { Z } } _ { : , d } ^ { d e c , l } \right) } \\ { \overline { { \mathbf { Z } } } _ { : , d } ^ { d e c , l } = \mathbb { M } \mathbb { S } \mathbb { A } \left( \mathbf { \tilde { Z } } _ { : , d } ^ { d e c , l } , \mathbf { Z } _ { : , d } ^ { e n c , l } , \mathbf { Z } _ { : , d } ^ { e n c , l } \right) , 1 \leq d \leq D } \end{array} \right. } \\ & { \left. \begin{array} { r l } { \tilde { \mathbf { Z } } ^ { d e c , l } = \mathrm { L a y e r N o r n } \left( \tilde { \mathbf { Z } } ^ { d e c , l } + \mathbf { \overline { { Z } } } ^ { d e c , l } \right) } \\ { \mathbf { Z } ^ { d e c , l } = \mathrm { L a y e r N o r n } \left( \hat { \mathbf { Z } } ^ { d e c , l } + \mathbb { M L P } ( \hat { \mathbf { Z } } ^ { d e c , l } ) \right) } \end{array} \right. } \end{array}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\mathbf { E } ^ { ( d e c ) } \in \mathbb { R } ^ { \frac { \tau } { L _ { s e g } } \times D \times d _ { m o d e l } }$ denotes the learnable position embedding for decoder. $\tilde { \mathbf { Z } } ^ { d e c , l }$ is the output of TSA. The MSA layer takes $\tilde { \mathbf { Z } } _ { : , d } ^ { d e c , l }$ as query and ${ \bf Z } _ { : , d } ^ { e n c , l }$ as the key and value to build the connection between encoder and decoder. The output of MSA is denoted as $\overline { { \mathbf { Z } } } _ { : , d } ^ { d e c , l }$ . $\hat { \mathbf { Z } } ^ { d e c , l } , \mathbf { Z } ^ { d e c , l }$ denote the output of skip connection and MLP respectively. We use ${ \mathbf { Z } } ^ { d e c , 0 }$ , ${ \bf Z } ^ { e n c , 1 } , \ldots , { \bf Z } ^ { d e c , N }$ to represent the decoder output. The complexity of each decoder layer is O D τ(T +τ)L2
|
| 120 |
+
|
| 121 |
+
Linear projection is applied to each layer’s output to yield the prediction of this layer. Layer predictions are summed to make the final prediction (for $l = 0 , \ldots , N )$ :
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r l } { \mathrm { ~ o r ~ } l = 0 , \dots , N : \mathbf { x } _ { i , d } ^ { ( s ) , l } = \mathbf { W } ^ { l } \mathbf { Z } _ { i , d } ^ { d e c , l } } & { \quad \mathbf { x } _ { T + 1 : T + \tau } ^ { p r e d , l } = \left\{ \mathbf { x } _ { i , d } ^ { ( s ) , l } \vert 1 \leq i \leq \frac { \tau } { L _ { s e g } } , 1 \leq d \leq D \right\} } \\ & { \quad \qquad \quad \mathbf { x } _ { T + 1 : T + \tau } ^ { p r e d } = \displaystyle \sum _ { l = 0 } ^ { N } \mathbf { x } _ { T + 1 : T + \tau } ^ { p r e d , l } } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\mathbf { W } ^ { l } ~ \in ~ \mathbb { R } ^ { L _ { s e g } \times d _ { m o d e l } }$ is a learnable matrix to project a vector to a time series segment. $\mathbf { x } _ { i , d } ^ { ( s ) , l } \in \mathbb { R } ^ { L _ { s e g } }$ denotes the $i$ -th segment in dimension $d$ of the prediction. All the segments in layer
|
| 128 |
+
|
| 129 |
+
Table 1: MSE/MAE with different prediction lengths. Bold/underline indicates the best/second. Results of LSTMa, LSTnet, Transformer, Informer on the first 4 datasets are from Zhou et al. (2021).
|
| 130 |
+
|
| 131 |
+
<table><tr><td colspan="2">Models</td><td colspan="2">LSTMa</td><td colspan="2">LSTnet</td><td colspan="2">MTGNN</td><td colspan="2">Transformer</td><td colspan="2">Informer</td><td colspan="2">Autoformer</td><td colspan="2">Pyraformer</td><td colspan="2">FEDformer</td><td colspan="2">Crossformer</td></tr><tr><td colspan="2">Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td rowspan="2">FTLLI</td><td>24 48 168</td><td>0.650 0.720 1.212</td><td>0.624 0.675 0.867</td><td>1.293 1.456 1.997</td><td>0.901 0.960 1.214</td><td>0.336 0.386 0.466</td><td>0.393 0.429 0.474</td><td>0.620 0.692 0.947</td><td>0.577 0.671 0.797</td><td>0.577 0.685 0.931</td><td>0.549 0.625 0.752</td><td>0.439 0.429 0.493</td><td>0.440 0.442 0.479</td><td>0.493 0.554 0.781</td><td>0.507 0.544 0.675</td><td>0.318 0.342 0.412</td><td>0.384 0.396 0.449</td><td>0.305 0.352</td><td>0.367 0.394 0.441</td></tr><tr><td>336 720 24</td><td>1.424 1.960 0.621</td><td>0.994 1.322 0.629</td><td>2.655 2.143 1.968</td><td>1.369 1.380 1.170</td><td>0.736 0.916 0.260</td><td>0.643 0.750 0.324</td><td>1.094 1.241 0.306</td><td>0.813 0.917 0.371</td><td>1.128 1.215 0.323</td><td>0.873 0.896 0.369</td><td>0.509 0.539 0.410</td><td>0.492 0.537 0.428</td><td>0.912 0.993 0.310</td><td>0.747 0.792 0.371</td><td>0.456 0.521 0.290</td><td>0.474 0.515 0.364</td><td>0.410 0.440 0.519 0.211</td><td>0.461 0.524 0.293</td></tr><tr><td>[LL</td><td>48 96 288 672</td><td>1.392 1.339 1.740 2.736</td><td>0.939 0.913 1.124 1.555</td><td>1.999 2.762 1.257 1.917</td><td>1.215 1.542 2.076 2.941</td><td>0.386 0.428 0.469 0.620</td><td>0.408 0.446 0.488 0.571</td><td>0.465 0.681 1.162 1.231</td><td>0.470 0.612 0.879 1.103</td><td>0.494 0.678 1.056 1.192</td><td>0.503 0.614 0.786 0.926</td><td>0.485 0.502 0.604 0.607</td><td>0.464 0.476 0.522 0.530</td><td>0.465 0.520 0.729 0.980</td><td>0.464 0.504 0.657 0.678</td><td>0.342 0.366 0.398 0.455</td><td>0.396 0.412 0.433 0.464</td><td>0.300 0.320 0.404 0.569</td><td>0.352 0.373 0.427 0.528</td></tr><tr><td>HLM</td><td>24 48 168 336 720</td><td>0.546 0.829 1.038 1.657 1.536</td><td>0.570 0.677 0.835 1.059 1.109</td><td>0.615 0.660 0.748 0.782 0.851</td><td>0.545 0.589 0.647 0.683 0.757</td><td>0.307 0.388 0.498 0.506 0.510</td><td>0.356 0.422 0.512 0.523 0.527</td><td>0.349 0.386 0.613 0.707 0.834</td><td>0.397 0.433 0.582 0.634 0.741</td><td>0.335 0.395 0.608 0.702 0.831</td><td>0.381 0.459 0.567 0.620 0.731 0.587</td><td>0.363 0.456 0.574 0.600</td><td>0.396 0.462 0.548 0.571 0.570</td><td>0.301 0.376 0.519 0.539 0.547</td><td>0.359 0.421 0.521 0.543 0.553</td><td>0.357 0.428 0.564 0.533 0.562</td><td>0.412 0.458 0.541 0.536 0.557</td><td>0.294 0.370 0.473 0.495 0.526</td><td>0.343 0.411 0.494 0.515 0.542</td></tr><tr><td rowspan="6">R</td><td>48 168 336</td><td>0.486 0.572 0.574</td><td>0.602</td><td>0.369 0.394</td><td>0.445 0.476</td><td>0.173 0.236</td><td>0.280 0.320</td><td>0.334 0.353</td><td>0.399 0.420</td><td>0.344 0.393 0.368 0.424</td><td>0.241 0.299</td><td></td><td>0.351 0.387</td><td>0.478 0.452</td><td>0.471 0.455</td><td>0.229 0.263</td><td>0.338 0.361</td><td>0.156 0.231 0.323</td><td>0.255 0.309 0.369</td></tr><tr><td>720</td><td>0.886 0.795 1.095</td><td>0.419 0.556</td><td>0.477 0.565</td><td>0.328 0.422</td><td>0.373 0.410</td><td>0.381 0.391</td><td>0.439 0.438</td><td>0.381 0.406</td><td>0.431 0.443</td><td>0.375 0.377</td><td>0.428 0.434</td><td>0.463 0.480</td><td>0.456 0.461</td><td>0.305 0.372</td><td>0.386 0.434</td><td>0.404</td><td>0.423</td></tr><tr><td></td><td>1.128</td><td>0.605</td><td>0.599</td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.366</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>4.771</td><td>1.335</td><td>4.975</td><td>1.660</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>4.220</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>3.101</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>960</td><td>1.676 1.591</td><td></td><td></td><td></td><td>0.471</td><td>0.451</td><td>0.492</td><td>0.550</td><td>0.460</td><td>0.548</td><td></td><td>0.426</td><td>0.550</td><td>0.489</td><td>0.393</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.449</td><td>0.433</td><td>0.438</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>4.265</td><td>1.387</td><td>3.954</td><td>1.323</td><td>4.588</td><td>1.462</td><td></td><td>1.238</td><td>3.970</td><td>1.338</td><td>2.687</td><td>1.147</td><td>3.041</td><td>1.186</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>1.659</td><td>4.777</td><td>1.496</td><td>4.167</td><td>1.360</td><td>4.845</td><td>1.496</td><td></td><td>1.270</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>I</td><td>36</td><td>1.427</td><td></td><td>5.322</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>3.397</td><td></td><td>4.377</td><td>1.410</td><td>2.887</td><td>1.160</td><td>3.406</td><td>1.232</td></tr><tr><td></td><td></td><td></td><td></td><td>5.425</td><td>1.632</td><td>5.333</td><td>1.592</td><td>4.746</td><td>1.463</td><td>4.865</td><td>1.516</td><td>2.947</td><td>1.203</td><td>4.811</td><td>1.503</td><td>2.797</td><td>1.155</td><td>3.459</td><td>1.221</td></tr><tr><td></td><td>48</td><td>4.945 1.462</td><td></td><td></td><td></td><td>5.070</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>2.809</td><td>1.163</td><td>3.640</td><td>1.305</td></tr><tr><td>Yteee</td><td>60</td><td>5.176</td><td>1.504 0.378</td><td>5.477 0.648</td><td>1.675 0.403</td><td>0.506</td><td>1.552 0.278</td><td>5.219 0.597</td><td>1.553 0.332</td><td>5.212 0.608</td><td>1.576 0.334</td><td>3.019 0.550</td><td>1.202 0.363</td><td>5.204 0.606</td><td>1.588 0.338</td></table>
|
| 132 |
+
|
| 133 |
+
$l$ are rearranged to get the layer prediction $\mathbf { x } _ { T + 1 : T + \tau } ^ { p r e d , l }$ . Predictions of all the layers are summed to obtain the final forecasting xpredT +1:T +τ .
|
| 134 |
+
|
| 135 |
+
# 4 EXPERIMENTS
|
| 136 |
+
|
| 137 |
+
# 4.1 PROTOCOLS
|
| 138 |
+
|
| 139 |
+
Datasets We conduct experiments on six real-world datasets following Zhou et al. (2021); Wu et al. (2021a). 1) ETTh1 (Electricity Transformer Temperature-hourly), 2) ETTm1 (Electricity Transformer Temperature-minutely), 3) WTH (Weather), 4) ECL (Electricity Consuming Load), 5) ILI (Influenza-Like Illness), 6) Traffic. The train/val/test splits for the first four datasets are same as Zhou et al. (2021), the last two are split by the ratio of 0.7:0.1:0.2 following Wu et al. (2021a).
|
| 140 |
+
|
| 141 |
+
Baselines We use the following popular models for MTS forecasting as baselines:1) LSTMa (Bahdanau et al., 2015), 2) LSTnet (Lai et al., 2018), 3) MTGNN (Wu et al., 2020), and recent Transformer-based models for MTS forecasting: 4) Transformer (Vaswani et al., 2017), 5) Informer (Zhou et al., 2021), 6) Autoformer (Wu et al., 2021a), 7) Pyraformer (Liu et al., 2021a) and 8) FEDformer (Zhou et al., 2022).
|
| 142 |
+
|
| 143 |
+
Setup We use the same setting as in Zhou et al. (2021): train/val/test sets are zero-mean normalized with the mean and std of training set. On each dataset, we evaluate the performance over the changing future window size $\tau$ . For each $\tau$ , the past window size $T$ is regarded as a hyper-parameter to search which is a common protocol in recent MTS transformer literature (Zhou et al., 2021; Liu et al., 2021a). We roll the whole set with stride $= 1$ to generate different input-output pairs. The Mean Square Error (MSE) and Mean Absolute Error (MAE) are used as evaluation metrics. All experiments are repeated for 5 times and the mean of the metrics reported. Our Crossformer only utilize the past series to forecast the future, while baseline models use additional covariates such as hour-of-the-day. Details about datasets, baselines, implementation, hyper-parameters are shown in Appendix A.
|
| 144 |
+
|
| 145 |
+
# 4.2 MAIN RESULTS
|
| 146 |
+
|
| 147 |
+
As shown in Table 1, Crossformer shows leading performance on most datasets, as well as on different prediction length settings, with the 36 top-1 and 51 top-2 cases out of 58 in total. It is worth noting that, perhaps due to the explicit use of cross-dimension dependency via GNN, MTGNN outperforms many Transformer-based baselines. While MTGNN has been rarely compared in existing transformers for MTS forecasting literatures. FEDformer and Autoformer outperform our model on ILI. We conjecture this is because the size of dataset ILI is small and these two models introduce the prior knowledge of sequence decomposition into the network structure which makes them perform well when the data is limited. Crossformer still outperforms other baselines on this dataset.
|
| 148 |
+
|
| 149 |
+
Table 2: Component ablation of Crossformer: DSW embedding, TSA layer and HED on ETTh1.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Models</td><td colspan="2">Transformer</td><td colspan="2">DSW</td><td colspan="2">DSW+TSA</td><td colspan="2">DSW+HED</td><td colspan="2">DSW+TSA+HED</td></tr><tr><td>Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td>24</td><td>0.620</td><td>0.577</td><td>0.373</td><td>0.418</td><td>0.322</td><td>0.373</td><td>0.406</td><td>0.454</td><td>0.305</td><td>0.367</td></tr><tr><td>48</td><td>0.692</td><td>0.671</td><td>0.456</td><td>0.479</td><td>0.365</td><td>0.403</td><td>0.493</td><td>0.512</td><td>0.352</td><td>0.394</td></tr><tr><td>168</td><td>0.947</td><td>0.797</td><td>0.947</td><td>0.731</td><td>0.473</td><td>0.479</td><td>0.614</td><td>0.583</td><td>0.410</td><td>0.441</td></tr><tr><td>336</td><td>1.094</td><td>0.813</td><td>0.969</td><td>0.752</td><td>0.553</td><td>0.534</td><td>0.788</td><td>0.676</td><td>0.440</td><td>0.461</td></tr><tr><td>720</td><td>1.241</td><td>0.971</td><td>1.086</td><td>0.814</td><td>0.636</td><td>0.599</td><td>0.841</td><td>0.717</td><td>0.519</td><td>0.524</td></tr></table>
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 4: Evaluation on hyper-parameter impact and computational efficiency. (a) MSE against hyperparameter segment length $L _ { s e g }$ in DSW embedding on ETTh1. (b) MSE against hyper-parameter number of routers $c$ in the Cross-Dimension Stage of TSA layer on ETTh1. (c) Memory occupation against the input length $T$ on ETTh1. (d) Memory occupation against number of dimensions $D$ on synthetic datasets with different number of dimensions.
|
| 155 |
+
|
| 156 |
+
# 4.3 ABLATION STUDY
|
| 157 |
+
|
| 158 |
+
In our approach, there are three components: DSW embedding, TSA layer and HED. We perform ablation study on the ETTh1 dataset in line with Zhou et al. (2021); Liu et al. (2021a). We use Transformer as the baseline and $\mathbf { D S W + T S A + H E D }$ to denote Crossformer without ablation. Three ablation versions are compared: 1) DSW 2) DSW $+ ^ { \prime }$ TSA 3) $\mathbf { D S W + H E D }$ .
|
| 159 |
+
|
| 160 |
+
We analyze the results shown in Table 2. 1) DSW performs better than Transformer on most settings. The only difference between DSW and Transformer is the embedding method, which indicates the usefulness of DSW embedding and the importance of cross-dimension dependency. 2) TSA constantly improves the forecasting accuracy. This suggests that it is reasonable to treat time and dimension differently. Moreover, TSA makes it possible to use Crossformer on datasets where the number of dimensions is large (e.g. $D = 8 6 2$ for dataset Traffic). 3) Comparing $\mathrm { D S W + H E D }$ with DSW, HED decreases the forecasting accuracy when prediction length is short but increases it for long term prediction. The possible reason is that information at different scales is helpful to long term prediction. 4) Combining DSW, TSA and HED, our Crossformer yields best results on all settings.
|
| 161 |
+
|
| 162 |
+
# 4.4 EFFECT OF HYPER-PARAMETERS
|
| 163 |
+
|
| 164 |
+
We evaluate the effect of two hyper-parameters: segment length $L _ { s e g }$ in Eq. 1) and number of routers in TSA $\dot { c }$ in Cross-Dimension Stage of TSA) on the ETTh1 dataset. Segment Length: In Fig. 4(a), we prolong the segment length from 4 to 24 and evaluate MSE with different prediction windows. For short-term forecasting $( \tau = 2 4 , 4 8 )$ ), smaller segment yields relevantly better results, but the prediction accuracy is stable. For long-term forecasting $\tau \geq 1 6 8 )$ , prolonging the segment length from 4 to 24 causes the MSE to decrease. This indicates that long segments should be used for long-term forecasting. We further prolong the segment length to 48 for $\tau = 3 3 6$ , 720, the MSE is slightly larger than that of 24. The possible reason is that 24 hours exactly matches the daily period of this dataset, while 48 is too coarse to capture fine-grained information. Number of Routers in TSA Layer: Number of Routers $c$ controls the information bandwidth among all dimensions. As Fig. 4(b) shows, the performance of Crossformer is stable w.r.t to $c$ for $\tau \leq 3 3 6$ . For $\tau = 7 2 0$ , the MSE is large when $c = 3$ but decreases and stabilizes when $c \geq 5$ . In pratice, we set $c = 1 0$ to balance the prediction accuracy and computation efficiency.
|
| 165 |
+
|
| 166 |
+
# 4.5 COMPUTATIONAL EFFICIENCY ANALYSIS
|
| 167 |
+
|
| 168 |
+
The theoretical complexity per layer of Transformer-based models is compared in Table 3. The complexity of Crossformer encoder is quadratic w.r.t $T$ . However, for long-term prediction where large $L _ { s e q }$ is used, the coefficient $\frac { 1 } { L _ { s e q } ^ { 2 } }$ term can significantly reduce its practical complexity. We evaluate the memory occupation of these models on ETTh1.4 We set the prediction window $\tau = 3 3 6$ and prolong input length $T$ . For Crossformer, $L _ { s e g }$ is set to 24, which is the best value for $\tau \geq 1 6 8$
|
| 169 |
+
|
| 170 |
+
Table 3: Computation complexity per layer of Transformer-based models. $T$ denotes the length of past series, $\tau$ denotes the length of prediction window, $D$ denotes the number of dimensions, $L _ { s e g }$ denotes the segment length of DSW embedding in Crossformer.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Method</td><td>Encoder layer</td><td>Decoder layer</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>O(T2)</td><td>O(T(T+T))</td></tr><tr><td>Informer (Zhou et al., 2021)</td><td>O(TlogT)</td><td>O(t(T+logT))</td></tr><tr><td>Autoformer (Wu et al.,2021a)</td><td>O(TlogT)</td><td>0((+T)log(+T))</td></tr><tr><td>Pyraformer (Liu et al.,2021a)</td><td>O(T)</td><td>O(T(T+T))</td></tr><tr><td>FEDformer (Zhou et al.,2022)</td><td>O(T)</td><td>0(+)</td></tr><tr><td>Crossformer (Ours)</td><td>(T2) 0</td><td>((+T)) 0</td></tr></table>
|
| 173 |
+
|
| 174 |
+
(see Fig. 4 (a)). The result in Fig. 4 (c) shows that Crossformer achieves the best efficiency among the five methods within the tested length range. Theoretically, Informer, Autoformer and FEDformer are more efficient when $T$ approaches infinity. In practice, Crossformer performs better when $T$ is not extremely large (e.g. $T \leq 1 0 ^ { 4 }$ ).
|
| 175 |
+
|
| 176 |
+
We also evaluate the memory occupation w.r.t the number of dimensions $D$ . For baseline models where cross-dimension dependency is not modeled explicitly, $D$ has little effect. Therefore, we compare Crossformer with its ablation versions in Section 4.3. We also evaluate the TSA layers that directly use MSA in Cross-Dimension Stage without the Router mechanism, denoted as TSA(w/o Router). Fig. 4 (d) shows that Crossformer without TSA layer (DSW and $\mathrm { D S W + H E D } )$ has quadratic complexity w.r.t $D$ . TSA(w/o Router) helps to reduce complexity and the Router mechanism further makes the complexity linear, so that Crossformer can process data with $D = 3 0 0$ . Moreover, HED can slightly reduce the memory cost and we analyze this is because there are less vectors in upper layers after segment merging (see Fig. 3). Besides memory occupation, the actual running time evaluation is shown in Appendix B.6.
|
| 177 |
+
|
| 178 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 179 |
+
|
| 180 |
+
We have proposed Crossformer, a Transformer-based model utilizing cross-dimension dependency for multivariate time-series (MTS) forecasting. Specifically, the Dimension-Segment-Wise (DSW) embedding embeds the input data into a 2D vector array to preserve the information of both time and dimension. The Two-Stage-Attention (TSA) layer is devised to capture the cross-time and crossdimension dependency of the embedded array. Using DSW embedding and TSA layer, a Hierarchical Encoder-Decoder (HED) is devised to utilize the information at different scales. Experimental results on six real-world datasets show its effectiveness over previous state-of-the-arts.
|
| 181 |
+
|
| 182 |
+
We analyzed the limitations of our work and briefly discuss some directions for future research: 1) In Cross-Dimension Stage, we build a simple full connection among dimensions, which may introduce noise on high-dimensional datasets. Recent sparse and efficient Graph Transformers (Wu et al., 2022) can benefit our TSA layer on this problem. 2) A concurrent work (Zeng et al., 2023) which was accepted after the submission of this work received our attention. It questions the effectiveness of Transformers for MTS forecasting and proposes DLinear that outperforms all Transformers including our Crossformer on three of the six datasets (details are in Appendix B.2). It argues the main reason is that MSA in Transformer is permutation-invariant. Therefore, enhancing the ordering preserving capability of Transformers is a promising direction to overcome this shortcoming . 3) Considering datasets used in MTS analysis are much smaller and simpler than those used in vision and texts, besides new models, large datasets with various patterns are also needed for future research.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Rafal A. Angryk, Petrus C. Martens, Berkay Aydin, Dustin J. Kempton, Sushant S. Mahajan, Sunitha Basodi, Azim Ahmadzadeh, Xumin Cai, Soukaina Filali Boubrahimi, Shah Muhammad Hamdi, Michael A. Schuh, and Manolis K. Georgoulis. Multivariate time series dataset for space weather data analytics. Scientific Data, 2020.
|
| 187 |
+
|
| 188 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 189 |
+
|
| 190 |
+
Defu Cao, Yujing Wang, Juanyong Duan, Ce Zhang, Xia Zhu, Congrui Huang, Yunhai Tong, Bixiong Xu, Jing Bai, Jie Tong, and Qi Zhang. Spectral temporal graph neural network for multivariate time-series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 191 |
+
|
| 192 |
+
Chun-Fu Chen, Quanfu Fan, and Rameswar Panda. Crossvit: Cross-attention multi-scale vision transformer for image classification. In IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
|
| 193 |
+
|
| 194 |
+
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 ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD), 2022.
|
| 195 |
+
|
| 196 |
+
Omer Fahrettin Demirel, Selim Zaim, Ahmet Caliskan, and Pinar Ozuyar. Forecasting natural gas consumption in ˙Istanbul using neural networks and multivariate time series methods. Turkish Journal of Electrical Engineering and Computer Sciences, 2012.
|
| 197 |
+
|
| 198 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL-HLT), 2019.
|
| 199 |
+
|
| 200 |
+
Linhao Dong, Shuang Xu, and Bo Xu. Speech-transformer: A no-recurrence sequence-to-sequence model for speech recognition. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018.
|
| 201 |
+
|
| 202 |
+
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.
|
| 203 |
+
|
| 204 |
+
Dazhao Du, Bing Su, and Zhewei Wei. Preformer: Predictive transformer with multi-scale segmentwise correlations for long-term time series forecasting. arXiv preprint arXiv:2202.11356v1, 2022.
|
| 205 |
+
|
| 206 |
+
Philipp Dufter, Martin Schmitt, and Hinrich Schutze. Position information in transformers: An ¨ overview. Computational Linguistics, 2022.
|
| 207 |
+
|
| 208 |
+
Valentin Flunkert, David Salinas, and Jan Gasthaus. Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 2017.
|
| 209 |
+
|
| 210 |
+
Jake Grigsby, Zhe Wang, and Yanjun Qi. Long-range transformers for dynamic spatiotemporal forecasting. arXiv preprint arXiv:2109.12218v2, 2022.
|
| 211 |
+
|
| 212 |
+
Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 213 |
+
|
| 214 |
+
Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. A survey on vision transformer. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2022.
|
| 215 |
+
|
| 216 |
+
Guolin Ke, Di He, and Tie-Yan Liu. Rethinking positional encoding in language pre-training. In International Conference on Learning Representations (ICLR), 2021.
|
| 217 |
+
|
| 218 |
+
Lutz Kilian and Helmut LAtkepohl. ˜ Structural Vector Autoregressive Analysis. Cambridge University Press, 2017.
|
| 219 |
+
|
| 220 |
+
Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long- and short-term temporal patterns with deep neural networks. In International ACM SIGIR Conference on Research & Development in Information Retrieval (SIGIR), 2018.
|
| 221 |
+
|
| 222 |
+
Colin S. Lea, Michael D. Flynn, Rene Vidal, Austin Reiter, and Gregory Hager. Temporal convolu-´ tional networks for action segmentation and detection. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 223 |
+
|
| 224 |
+
Longyuan Li, Junchi Yan, Xiaokang Yang, and Yaohui Jin. Learning interpretable deep state space model for probabilistic time series forecasting. In International Joint Conference on Artificial Intelligence (IJCAI), 2019a.
|
| 225 |
+
|
| 226 |
+
Longyuan Li, Jihai Zhang, Junchi Yan, Yaohui Jin, Yunhao Zhang, Yanjie Duan, and Guangjian Tian. Synergetic learning of heterogeneous temporal sequences for multi-horizon probabilistic forecasting. In AAAI Conference on Artificial Intelligence (AAAI), 2021.
|
| 227 |
+
|
| 228 |
+
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), 2019b.
|
| 229 |
+
|
| 230 |
+
Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. In International Conference on Learning Representations (ICLR), 2018.
|
| 231 |
+
|
| 232 |
+
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), 2021a.
|
| 233 |
+
|
| 234 |
+
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 IEEE/CVF International Conference on Computer Vision (ICCV), 2021b.
|
| 235 |
+
|
| 236 |
+
Andrew Patton. Copula methods for forecasting multivariate time series. Handbook of economic forecasting, 2013.
|
| 237 |
+
|
| 238 |
+
Yao Qin, Dongjin Song, Haifeng Chen, Wei Cheng, Guofei Jiang, and G. Cottrell. A dual-stage attention-based recurrent neural network for time series prediction. In International Joint Conference on Artificial Intelligence (IJCAI), 2017.
|
| 239 |
+
|
| 240 |
+
Syama Sundar Rangapuram, Matthias W. Seeger, Jan Gasthaus, Lorenzo Stella, Bernie Wang, and Tim Januschowski. Deep state space models for time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 241 |
+
|
| 242 |
+
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herve´ Jegou. Training data-efficient image transformers & distillation through attention. In ´ International Conference on Machine Learning (ICML), 2021.
|
| 243 |
+
|
| 244 |
+
Ashish Vaswani, Noam M. Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 245 |
+
|
| 246 |
+
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), 2021a.
|
| 247 |
+
|
| 248 |
+
Kan Wu, Houwen Peng, Minghao Chen, Jianlong Fu, and Hongyang Chao. Rethinking and improving relative position encoding for vision transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021b.
|
| 249 |
+
|
| 250 |
+
Qitian Wu, Wentao Zhao, Zenan Li, David Wipf, and Junchi Yan. Nodeformer: A scalable graph structure learning transformer for node classification. In Advances in Neural Information Processing Systems (NeurIPS), 2022.
|
| 251 |
+
|
| 252 |
+
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 ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD), 2020.
|
| 253 |
+
|
| 254 |
+
Ting Yu, Haoteng Yin, and Zhanxing Zhu. Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting. In International Joint Conference on Artificial Intelligence (IJCAI), 2018.
|
| 255 |
+
|
| 256 |
+
Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank Reddi, and Sanjiv Kumar. Are transformers universal approximators of sequence-to-sequence functions? In International Conference on Learning Representations (ICLR), 2020.
|
| 257 |
+
|
| 258 |
+
Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? In AAAI Conference on Artificial Intelligence (AAAI), 2023.
|
| 259 |
+
|
| 260 |
+
Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wan Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In AAAI Conference on Artificial Intelligence (AAAI), 2021.
|
| 261 |
+
|
| 262 |
+
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.
|
| 263 |
+
|
| 264 |
+
# A DETAILS OF EXPERIMENTS
|
| 265 |
+
|
| 266 |
+
# A.1 BENCHMARKING DATASETS
|
| 267 |
+
|
| 268 |
+
We conduct experiments on the following six real-world datasets following Zhou et al. (2021); Wu et al. (2021a):
|
| 269 |
+
|
| 270 |
+
1) ETTh1 (Electricity Transformer Temperature-hourly) contains 7 indicators of an electricity transformer in two years, including oil temperature, useful load, etc. Data points are recorded every hour and train/val/test is 12/4/4 months.
|
| 271 |
+
|
| 272 |
+
2) ETTm1 (Electricity Transformer Temperature-minutely) contains the same indicators as ETTh1 but data points are recorded every 15 miniutes. Train/val/test split is same as ETTh1.
|
| 273 |
+
|
| 274 |
+
3) WTH (Weather) contains 12 meteorological indicators in U.S. in 4 years, including visibility, wind speed, etc. Train/val/test is 28/10/10 months.
|
| 275 |
+
|
| 276 |
+
4) ECL (Electricity Consuming Load) contains hourly electricity consumption (in Kwh) of 321 clients in two years. Train/val/test is 15/3/4 months.
|
| 277 |
+
|
| 278 |
+
5) ILI (Influenza-Like Illness) contains 7 weekly recorded indicators of patients data from Centers for Disease Control and Prevention of the United States between between 2002 and 2021. The ratio of train/validation/test splits is 0.7:0.1:0.2.
|
| 279 |
+
|
| 280 |
+
6) Traffic contains hourly road occupancy rates measured by 862 sensors on San Francisco Bay area freeways in 2 years. The ratio of train/validation/test splits is 0.7:0.1:0.2.
|
| 281 |
+
|
| 282 |
+
The train/val/test splits for ETTh1, ETTm1, WTH, ECL are same as Zhou et al. (2021), for ILI and Traffic are same as Wu et al. (2021a).
|
| 283 |
+
|
| 284 |
+
The first four datasets are publicly available at https://github.com/zhouhaoyi/ Informer2020 and the last two are publicly available at https://github.com/thuml/ Autoformer.
|
| 285 |
+
|
| 286 |
+
# A.2 BASELINE METHODS
|
| 287 |
+
|
| 288 |
+
We briefly describe the selected baselines:
|
| 289 |
+
|
| 290 |
+
1) LSTMa (Bahdanau et al., 2015) treats the input MTS as a sequence of multi-dimensional vectors. It builds an encoder-decoder using RNN and automatically aligns target future steps with their relevant past.
|
| 291 |
+
|
| 292 |
+
2) LSTnet (Lai et al., 2018) uses CNN to extract cross-dimension dependency and short term crosstime dependency. The long-term cross-time dependency is captured through RNN. The source code is available at https://github.com/laiguokun/LSTNet.
|
| 293 |
+
|
| 294 |
+
3) MTGNN (Wu et al., 2020) explicitly utilizes cross-dimension dependency using GNN. A graph learning layer learns a graph structure where each node represents one dimension in MTS. Then graph convolution modules are interleaved with temporal convolution modules to explicitly capture cross-dimension and cross-time dependency respectively. The source code is available at https://github.com/nnzhan/MTGNN.
|
| 295 |
+
|
| 296 |
+
4) Transformer is closed to the original Transformer (Vaswani et al., 2017) that uses self-attention mechanism to capture cross-time dependency. The Informer-style one-step generative decoder is used for forecasting, therefore this is denoted as Informer† in Informer (Zhou et al., 2021).
|
| 297 |
+
|
| 298 |
+
5) Informer (Zhou et al., 2021) is a Transformer-based model using the ProbSparse self-attention to capture cross-time dependency for forecasting. The source code of Transformer and Informer is available at https://github.com/zhouhaoyi/Informer2020.
|
| 299 |
+
|
| 300 |
+
6) Autoformer (Wu et al., 2021a) is a Transformer-based model using decomposition architecture with Auto-Correlation mechanism to capture cross-time dependency for forecasting. The source code is available at https://github.com/thuml/Autoformer.
|
| 301 |
+
|
| 302 |
+
7) Pyraformer (Liu et al., 2021a) is a Transformer-based model learning multi-resolution representation of the time series by the pyramidal attention module to capture cross-time dependency for forecasting. The source code is available at https://github.com/alipay/Pyraformer.
|
| 303 |
+
|
| 304 |
+
8) FEDformer (Zhou et al., 2022) is a Transformer-based model that uses the seasonal-trend decomposition with frequency enhanced blocks to capture cross-time dependency for forecasting. The source code is available at https://github.com/MAZiqing/FEDformer.
|
| 305 |
+
|
| 306 |
+
A.3 HYPER-PARAMETER SELECTION AND IMPLEMENTATION DETAILS
|
| 307 |
+
|
| 308 |
+
# A.3.1 MAIN EXPERIMENTS
|
| 309 |
+
|
| 310 |
+
For the main experiments, we use the Crossformer with 3 encoder layers. The number of routers in TSA layer $c$ is set to 10. For dataset ETTh1, ETTm1, WTH and ILI, dimension of hidden state $d _ { m o d e l }$ is set to 256, the head number of multi-head attention is set to 4; For dataset ECL and Traffic, dimension of hidden state $d _ { m o d e l }$ is set to 64, the head number of multi-head attention is set to 2. The segment length $L _ { s e g }$ is chosen from $\{ 6 , 1 2 , 2 4 \}$ via grid search. We use MSE as loss function and batch size is set to 32. Adam optimizer is used for training and the initial learning rate is chosen from $\{ 5 \mathrm { e } \mathrm { - } 3$ , 1e-3, 5e-4, 1e-4, 5e-5, 1e- $\{ 5 \}$ via grid search. The total number of epochs is 20. If the validation loss does not decreases within three epochs, the training process will stop early.
|
| 311 |
+
|
| 312 |
+
For baseline models, if the original papers conduct experiments on the dataset we use, the hyperparameters (except input length $T$ ) recommended in the original papers are used, including the number of layers, dimension of hidden states, etc. Otherwise, the hyper-parameters are chosen through grid search using the validation set.
|
| 313 |
+
|
| 314 |
+
Following Zhou et al. (2021), on datasets ETTh1, WTH, ECL and Traffic, for different prediction length $\tau$ , the input length $T$ is chosen from $\{ 2 4 , 4 8 , 9 6 , 1 6 8 , 3 3 6 , 7 2 0 \}$ ; on ETTm1, the input length is chosen from $\{ 2 4 , 4 8 , 9 6 , 1 9 2 , 2 8 8 , 6 7 2 \}$ ; on ILI, the input length is chosen from $\{ 2 4 , 3 6 , 4 8 , 6 0 \}$ .
|
| 315 |
+
|
| 316 |
+
All models including Crossformer and baselines are implemented in PyTorch and trained on a single NVIDIA Quadro RTX 8000 GPU with 48GB memory.
|
| 317 |
+
|
| 318 |
+
# A.3.2 EFFICIENCY ANALYSIS
|
| 319 |
+
|
| 320 |
+
To evaluate the computational efficiency w.r.t the input length $T$ in Figure 4(c) of the main paper, we align the hyper-parameters of all Transformer-based models as follows: prediction length $\tau$ is set to 336, number of encoder layers is set to 2, dimension of hidden state $d _ { m o d e l }$ is set to 256, the head number of multi-head attention is set to 4.
|
| 321 |
+
|
| 322 |
+
To evaluate the computational efficiency w.r.t the number of dimensions $D$ in Figure 4(d) of the main paper, we align the hyper-parameters of ablation versions of Crossformer as follows as: both input length $T$ and prediction length $\tau$ are set to 336, number of encoder layers is set to 3, $d _ { m o d e l }$ is set to 64, the head number of multi-head attention is set to 2.
|
| 323 |
+
|
| 324 |
+
Experiments in the computational efficiency analysis section are conducted on a single NVIDIA GeForce RTX 2080Ti GPU with 11GB memory.
|
| 325 |
+
|
| 326 |
+
# A.4 DETAILS OF ABLATION VERSIONS OF CROSSFORMER
|
| 327 |
+
|
| 328 |
+
We describe the models we used in ablation study below:
|
| 329 |
+
|
| 330 |
+
1) DSW represents Crossformer without TSA and HED. The input is embedded by DSW embedding and flatten into a 1D sequence to be input to the original Transformer. The only difference between this model and the Transformer is the embedding method.
|
| 331 |
+
|
| 332 |
+
2) $\mathbf { D S W + T S A }$ represents Crossformer without HED. Compared with Crossformer, the encoder does not use segment merging to capture dependency at different scales. The decoder takes the final output of encoder (i.e. ${ \bf Z } ^ { e n c , N }$ ) as input instead of using encoder’s output at each scale.
|
| 333 |
+
|
| 334 |
+
3) $\mathbf { D S W + H E D }$ represents Crossformer without TSA. In each encoder layer and decoder layer, the 2D vector array is flatten into a 1D sequence to be input to the original self-attention layer for dependency capture.
|
| 335 |
+
|
| 336 |
+
# B EXTRA EXPERIMENTAL RESULTS
|
| 337 |
+
|
| 338 |
+
# B.1 SHOWCASES OF MAIN RESULTS
|
| 339 |
+
|
| 340 |
+
Figure 5 shows the forecasting cases of three dimensions of the ETTm1 dataset with prediction length $\tau = 2 8 8$ . For dimension “HUFL”, all the five models capture the periodic pattern, but Crossformer is the closest to the ground truth. For “HULL”, Pyraformer fails to capture the periodic pattern from the noisy data. For “LUFL” where the data has no clear periodic pattern, MTGNN, FEDformer and Crossformer capture its trend and show significantly better results than the other two models.
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 5: Forecasting cases of three dimensions: High UseFul Load (HUFL), High UseLess Load (HULL) and Low UseFul Load (LUFL) of the ETTm1 dataset with prediction length $\tau = 2 8 8$ . The red / blue curves stand for the ground truth / prediction. Each row represents one model and each column represents one dimension.
|
| 344 |
+
|
| 345 |
+
Figure 6 shows the forecasting cases of three dimensions of the WTH dataset with prediction length $\tau = 3 3 6$ . For dimension “DBT”, all the five models capture the periodic pattern. For “DPT”, Autoformer and FEDformer fails to capture increasing trend of the data. For “WD”, all models capture the periodic pattern from the noisy data, and the cruves output by MTGNN and Crossformer are sharper than the other three models.
|
| 346 |
+
|
| 347 |
+
# B.2 COMPARISON WITH EXTRA METHODS
|
| 348 |
+
|
| 349 |
+
We further compare with two additional concurrent methods which were either not peerreviewed (Grigsby et al., 2022) or were accepted after the submission of this work (Zeng et al., 2023): 1) STformer (Grigsby et al., 2022), a Transformer-based model that directly flattens the multivariate time-series $\mathbf { x } _ { 1 : T } \in \mathbb { R } ^ { T \times D }$ into a 1D sequence to be input to Transformers; 2) DLinear (Zeng et al., 2023), a simple linear model with seasonal-trend decomposition that challenges Transformer-based models for MTS forecasting. Results are shown in Table 4 and LSTMa and LSTnet are omitted as they are not competitive with other models.
|
| 350 |
+
|
| 351 |
+
The basic idea of STformer is similar to our Crossformer: both of them extend the 1-D attention to 2- D. The explicit utilization of cross-dimension dependency makes STformer competitive with previous Transformer-based models on ETTh1, ETTm1 and WTH, especially for short-term prediction. However, STformer directly flattens the raw 2-D time series into a 1-D sequence to be input to the
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 6: Forecasting cases of three dimensions: Dry Bulb Temperature (DBT), Dew Point Temperature (DPT) and Wind Direction (WD) of the WTH dataset with prediction length $\tau = 3 3 6$ . The red / blue curves stand for the ground truth / prediction. Each row represents one model and each column represents one dimension.
|
| 355 |
+
|
| 356 |
+
Transformer. This straightforward method does not distinguish the time and dimension axes and is computationally inefficient. Therefore, besides the good performance for short-term prediction, STformer has difficulty in long-term prediction and encounters the out-of-memory (OOM) problem on high-dimensional datasets (ECL and Traffic). While Crossformer uses the DSW embedding to capture local dependency and reduce the complexity. The TSA layer with the router mechanism is devised to deal with the heterogeneity of time and dimension axis and further improve efficiency.
|
| 357 |
+
|
| 358 |
+
DLinear is on par with our Crossformer on ETTh1 and ETTm1 $\tau \leq 9 6 $ ); has similar performance with FEDformer on ILI; performs worse than Crossformer on WTH; outperforms all Transformerbased models including our Crossformer on ETTm1 $\tau \geq 2 8 8 $ ), ECL and Traffic. Considering its simplicity, the performance is impressive. Based on the results, we analyze the limitations of Crossformer and propose some directions to improve it in the future:
|
| 359 |
+
|
| 360 |
+
1) In Cross-Dimension Stage of TSA layer, we simply build an all-to-all connection among $D$ dimensions with the router mechanism. Besides capturing the cross-dimension dependency, this full connection also introduces noise, especially for high-dimensional dataset. We think high-dimensional data has the sparse property: each dimension is only relevant to a small fraction of all dimensions. Therefore, utilizing the sparsity to reduce noise and improve the computation efficiency of the TSA layer could be a promising direction.
|
| 361 |
+
|
| 362 |
+
2) Authors of DLinear (Zeng et al., 2023) argue that the Transformer-based models have difficulty in preserving ordering information because the attention mechanism is permutation-invariant and the absolute position embedding injected into the model is not enough for time series forecasting, which is an order-sensitive task. Although Yun et al. (2020) theoretically proves that Transformers with trainable positional embedding are universal approximators of sequence-to-sequence functions, the ordering information still needs to be enhanced in practice. We think that relative position encoding in texts (Ke et al., 2021; Dufter et al., 2022) and vision (Wu et al., 2021b) could be useful for ordering information enhancement.
|
| 363 |
+
|
| 364 |
+
Table 4: MSE/MAE comparison with extra methods: STformer (Grigsby et al., 2022) and DLinear (Zeng et al., 2023). Bold/underline indicates the best/second. OOM indicates out-of-memory problem. Gray background marks the CNN-GNN-based model; yellow marks Transformer-based models where cross-dimension dependency is omitted; blue marks Transformer-based models explicitly utilizing cross-dimension dependency; red marks the linear model with series decomposition.
|
| 365 |
+
|
| 366 |
+
<table><tr><td colspan="2">Models</td><td colspan="2">MTGNN</td><td colspan="2">Transformer</td><td colspan="2">Informer</td><td colspan="2">Autoformer</td><td colspan="2">Pyraformer</td><td colspan="2">FEDformer</td><td colspan="2">STformer</td><td colspan="2">Crossformer</td><td colspan="2">DLinear</td></tr><tr><td colspan="2">Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td rowspan="4">FLL</td><td>24 48</td><td>0.336 0.386</td><td>0.393 0.429</td><td>0.620 0.692</td><td>0.577 0.671</td><td>0.577 0.685</td><td>0.549 0.625</td><td>0.439 0.429</td><td>0.440 0.442</td><td>0.493 0.554</td><td>0.507 0.544</td><td>0.318 0.342</td><td>0.384 0.396</td><td>0.368</td><td>0.441</td><td>0.305 0.352</td><td>0.367 0.312</td><td></td><td>0.355 0.383</td></tr><tr><td>168</td><td>0.466 0.474</td><td>0.947</td><td></td><td></td><td>0.931</td><td>0.752</td><td>0.493</td><td>0.479</td><td>0.781</td><td>0.675</td><td>0.412</td><td></td><td>0.445</td><td>0.465</td><td></td><td>0.394</td><td>0.352</td><td>0.430</td></tr><tr><td>336</td><td>0.736</td><td></td><td>0.797</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.449</td><td>0.652</td><td>0.608</td><td>0.410 0.440</td><td>0.441 0.461</td><td>0.416 0.450</td><td></td></tr><tr><td>720</td><td>0.643 0.750</td><td>1.094 1.241</td><td>0.813 0.917</td><td>1.128</td><td>0.873 0.896</td><td>0.509 0.539</td><td>0.492</td><td>0.912</td><td>0.747</td><td>0.456</td><td>0.474</td><td>1.069</td><td>0.806</td><td></td><td></td><td></td><td>0.452</td><td></td></tr><tr><td rowspan="8">[LL</td><td>24</td><td>0.916</td><td></td><td></td><td></td><td>1.215</td><td></td><td></td><td>0.537</td><td>0.993</td><td>0.792</td><td>0.521</td><td>0.515</td><td>1.071</td><td>0.817</td><td>0.519</td><td>0.524</td><td>0.486</td><td>0.501</td></tr><tr><td>48</td><td>0.260 0.324</td><td>0.306 0.465</td><td></td><td>0.371</td><td>0.323</td><td>0.369 0.503</td><td>0.410</td><td>0.428</td><td>0.310</td><td>0.371</td><td>0.290</td><td>0.364</td><td>0.278</td><td>0.348</td><td>0.211</td><td>0.293</td><td>0.217</td><td>0.289</td></tr><tr><td>96</td><td>0.386 0.428</td><td>0.408 0.446</td><td>0.681</td><td>0.470 0.612</td><td>0.494 0.678</td><td>0.614</td><td>0.485</td><td>0.464</td><td>0.465</td><td>0.464</td><td>0.342</td><td>0.396</td><td>0.445</td><td>0.458</td><td>0.300</td><td>0.352</td><td>0.278</td><td>0.330 0.354</td></tr><tr><td>288</td><td>0.469</td><td>0.488</td><td>1.162</td><td>0.879</td><td>1.056</td><td>0.786</td><td>0.502 0.604</td><td>0.476 0.522</td><td>0.520 0.729</td><td>0.504 0.657</td><td>0.366 0.398</td><td>0.412</td><td>0.420</td><td>0.455</td><td>0.320</td><td>0.373</td><td>0.310 0.369</td><td>0.386</td></tr><tr><td>672</td><td>0.620</td><td>0.571</td><td>1.231</td><td>1.103</td><td>1.192</td><td>0.926</td><td>0.607</td><td>0.530</td><td>0.980</td><td>0.678</td><td>0.455</td><td>0.433 0.464</td><td>0.733</td><td>0.597</td><td>0.404 0.569</td><td>0.427 0.528</td><td>0.416</td><td>0.417</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.777</td><td>0.625</td><td></td><td></td><td></td><td></td></tr><tr><td>24 48</td><td>0.307 0.388</td><td>0.356</td><td>0.349 0.386</td><td>0.397 0.433</td><td>0.335 0.395</td><td>0.381 0.459</td><td>0.363 0.456</td><td>0.396 0.462</td><td>0.301 0.376</td><td>0.359 0.421</td><td>0.357 0.428</td><td>0.412 0.458</td><td>0.307</td><td>0.359</td><td>0.294</td><td>0.343</td><td>0.357</td><td>0.391 0.444</td></tr><tr><td>168 336</td><td>0.498 0.506</td><td>0.422 0.512 0.523</td><td>0.613</td><td>0.582</td><td>0.608</td><td>0.567</td><td>0.574</td><td>0.548</td><td>0.519</td><td>0.521</td><td>0.564</td><td>0.541</td><td>0.381 0.497</td><td>0.416 0.502</td><td>0.370 0.473</td><td>0.411 0.494</td><td>0.425 0.515</td><td>0.516</td></tr><tr><td rowspan="7">HLM</td><td>720</td><td>0.510</td><td>0.527</td><td>0.707 0.834</td><td>0.634 0.741</td><td>0.702 0.831</td><td>0.620 0.731</td><td>0.600 0.587</td><td>0.571 0.570</td><td>0.539 0.547</td><td>0.543 0.553</td><td>0.533 0.562</td><td>0.536 0.557</td><td>0.566 0.589</td><td>0.564 0.582</td><td>0.495 0.526</td><td>0.515 0.542</td><td>0.536 0.582</td><td>0.537 0.571</td></tr><tr><td>48</td><td>0.173 0.280</td><td>0.334</td><td></td><td>0.399</td><td>0.344</td><td>0.393</td><td>0.241</td><td>0.351</td><td>0.478</td><td></td><td>0.229</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>168</td><td>0.236 0.320</td><td>0.353</td><td></td><td>0.420</td><td>0.368</td><td>0.424</td><td>0.299</td><td>0.387</td><td>0.452</td><td>0.471 0.455</td><td>0.263</td><td>0.338 0.361</td><td>0.356</td><td>0.432</td><td>0.156 0.231</td><td>0.255</td><td>0.155</td><td>0.258 0.287</td></tr><tr><td>336</td><td>0.328 0.373</td><td></td><td>0.381</td><td>0.439</td><td>0.381</td><td>0.431</td><td>0.375</td><td>0.428</td><td>0.463</td><td>0.456</td><td>0.305</td><td>0.386</td><td></td><td>0.5160.527 00M</td><td>0.323</td><td>0.309 0.369</td><td>0.195 0.238</td><td>0.316</td></tr><tr><td>720</td><td>0.422</td><td>0.410</td><td>0.391</td><td>0.438</td><td>0.406</td><td>0.443</td><td>0.377</td><td>0.434</td><td>0.480</td><td>0.461</td><td>0.372</td><td>0.434</td><td></td><td>0OM</td><td>0.404</td><td>0.423</td><td>0.272</td><td>0.346</td></tr><tr><td>960</td><td>0.471</td><td>0.451</td><td>0.492</td><td>0.550</td><td>0.460</td><td>0.548</td><td>0.366</td><td>0.426</td><td>0.550</td><td>0.489</td><td>0.393</td><td>0.449</td><td></td><td>0OM</td><td>0.433</td><td>0.438</td><td>0.299</td><td>0.367</td></tr><tr><td rowspan="4">目</td><td>24</td><td></td><td>3.954</td><td></td><td>1.323</td><td></td><td>1.462</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.186</td><td>2.940</td><td>1.205</td></tr><tr><td>36</td><td>4.265 1.387 4.777 1.496</td><td>4.167</td><td></td><td>1.360</td><td>4.588 4.845</td><td>1.496</td><td>3.101 3.397</td><td>1.238 1.270</td><td>3.970 4.377</td><td>1.338 1.410</td><td>2.687 2.887</td><td>1.147 1.160</td><td>3.150 3.512</td><td>1.232 1.243</td><td>3.041 3.406</td></table>
|
| 367 |
+
|
| 368 |
+
3) The sizes of datasets used for time series forecasting are much smaller than those for texts and vision, and the patterns in time series datasets are also simpler. Considering vision transformers surpass inductive bias and achieves excellent results compared to CNNs after pre-trained on large amounts of data (Dosovitskiy et al., 2021), Transformers for time series may also require large-size datasets with various patterns to exploit their full potential.
|
| 369 |
+
|
| 370 |
+
As quoted from the paper, authors mentioned that DLinear “does not model correlations among variates”. Therefore, incorporating cross-dimension dependency into DLinear to further improve prediction accuracy is also a promising direction. Moreover, our DSW embedding to enhance locality and HED to capture dependency at different scales can also be potentially useful to further inspire and enhance DLinear.
|
| 371 |
+
|
| 372 |
+
# B.3 ABLATION STUDY OF THE ROUTER MECHANISM
|
| 373 |
+
|
| 374 |
+
The ablation study of the three main components of Crossformer is shown in Sec. 4.3. In this section, we conduct an ablation study of the router mechanism, a sub-module in TSA layer, and evaluate its impact on prediction accuracy. It should be noticed that the router mechanism is mainly proposed to reduce the computation complexity when $D$ is large. Results are shown in Table 5. Adding TSA(w/o Router) constantly improves the prediction accuracy of DSW and ${ \mathrm { D S W / H E D } }$ , showing the necessity of capturing cross-time and cross-dimension dependency in two different stages. For short term prediction $\tau \leq 1 6 8 )$ ), the performances of TSA(w/o Router) and TSA are similar, no matter whether HED is used or not. For long term prediction $\tau \geq 3 3 6$ ), the router mechanism slightly improves the prediction accuracy. The possible reason is that we set separate routers for each time step, which helps capture long-term dependency that varies over time.
|
| 375 |
+
|
| 376 |
+
Table 5: Complementary results to ablation study in Table 2. TSA(w/o Router) denotes TSA layer without the router mechanism that directly uses MSA in the Cross-Dimension Stage.
|
| 377 |
+
|
| 378 |
+
<table><tr><td rowspan="2">Models</td><td colspan="2">DSW</td><td colspan="2">DSW+ TSA(w/o Router)</td><td colspan="2">DSW+TSA</td><td colspan="2">DSW+HED</td><td colspan="2">DSW+HED+ TSA(w/o Router)</td><td colspan="2">DSW+TSA+HED</td></tr><tr><td>Metric MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td>24</td><td>0.373</td><td>0.418</td><td>0.320</td><td>0.376</td><td>0.322</td><td>0.373</td><td>0.406</td><td>0.454</td><td>0.311</td><td>0.375</td><td>0.305</td><td>0.367</td></tr><tr><td>48</td><td>0.456</td><td>0.479</td><td>0.356</td><td>0.396</td><td>0.365</td><td>0.403</td><td>0.493</td><td>0.512</td><td>0.363</td><td>0.406</td><td>0.352</td><td>0.394</td></tr><tr><td>168</td><td>0.947</td><td>0.731</td><td>0.487</td><td>0.493</td><td>0.473</td><td>0.479</td><td>0.614</td><td>0.583</td><td>0.416</td><td>0.444</td><td>0.410</td><td>0.441</td></tr><tr><td>336</td><td>0.969</td><td>0.752</td><td>0.585</td><td>0.564</td><td>0.553</td><td>0.534</td><td>0.788</td><td>0.676</td><td>0.487</td><td>0.499</td><td>0.440</td><td>0.461</td></tr><tr><td>720</td><td>1.086</td><td>0.814</td><td>0.665</td><td>0.615</td><td>0.636</td><td>0.599</td><td>0.841</td><td>0.717</td><td>0.540</td><td>0.542</td><td>0.519</td><td>0.524</td></tr></table>
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 7: Attention scores calculated by the decoder of the ablation version of Crossformer (i.e. DSW) on dataset ETTh1. The input length, prediction length and segment length are set as $T =$ 168, $\tau = 2 4 , L _ { s e g } = 6$ . The $\mathbf { X }$ axis in each sub-figure represents the time steps serve as keys in attention mechanism, while the y axis denotes dimensions. Brighter color denotes higher attention weights.
|
| 382 |
+
|
| 383 |
+
# B.4 DEPENDENCY VISUALIZATION
|
| 384 |
+
|
| 385 |
+
As the attention scores computed by Crossformer are abstract and hard to visualize, we visualize scores computed by the ablation version, DSW, in Figure 7. In addition to cross-time dependency that other Transformer models can compute, Crossformer also provides information about crossdimension dependency. As shown in Figure 7, when predicting Dim #1, the model focus on both Dim #1 and #3. When predicting Dim #5, instead of focus on Dim #5 itself, more attention is paid to Dim #4.
|
| 386 |
+
|
| 387 |
+
# B.5 HIERARCHICAL PREDICTION PATTERN VISUALIZATION
|
| 388 |
+
|
| 389 |
+
Figure 8 shows the hierarchical prediction patterns output by our HED. The top prediction layer, Layer 3, captures the low frequency general trend and periodic pattern of the future value. By adding predictions at finer scales, finer high frequency patterns are added and the prediction get closer to the ground truth curve.
|
| 390 |
+
|
| 391 |
+
# B.6 RUNNING TIME EFFICIENCY ANALYSIS
|
| 392 |
+
|
| 393 |
+
In the main paper, we show the memory occupation w.r.t input length $T$ and number of dimensions $D$ . Here we evaluate the running time. Figure 9 (a) shows the running time per batch of Crossformer and other Transformer-based models w.r.t input length $T$ . FEDformer is much slower than other Transformer-based models. Crossformer achieves the best computation speed among the five methods within the tested length range.
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 8: Hierarchical prediction visualization of ETTm1 with dimension HUFL and prediction length $\tau = 2 8 8$ . From top left to bottom right, we gradually add layer predictions at finer scales.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 9: Evaluation on computational speed. (a) Running time per batch w.r.t the input length $T$ on ETTh1. (b) Running time per batch w.r.t number of dimensions $D$ on synthetic datasets by different numbers of dimensions.
|
| 400 |
+
|
| 401 |
+
Figure 9 (b) shows the running time per batch of Crossformer and its ablation versions w.r.t the number of dimensions $D$ . Crossformers without TSA layer (DSW and $\mathrm { D S W + H E D } )$ ) are faster when $D$ is small $\left( D \leq 3 0 \right)$ ). However, they have difficulty processing high-dimensional MTS due to the quadratic complexity w.r.t $D$ . Indeed, for a single NVIDIA GeForce RTX 2080Ti GPU with 11GB memory, DSW and $\mathrm { D S W + H E D }$ encounters the out-of-memory (OOM) problem when $D > 5 0$ Moreover, TSA(w/o Router) encounter the OOM problem when $D > 2 0 0$ .
|
| 402 |
+
|
| 403 |
+
# C DISCUSSION ON THE SELECTION OF HYPER-PARAMETERS
|
| 404 |
+
|
| 405 |
+
We recommend to first determine the segment length $L _ { s e g }$ , as it is related to both the model performance and computation efficiency. The general idea is to use small $L _ { s e g }$ for short-term prediction and large $L _ { s e g }$ for long-term prediction. Some priors about the data also help to select $L _ { s e g }$ . For example, if the hourly sampled data has a daily period, it is better to set $L _ { s e g } = 2 4$ . Next, we select the number of layers for encoder and decoder $N$ . Crossformer with larger $N$ can utilize information of more scales, but also requires more computing resources. The number of routers in TSA layer $c$ can be set to 5 or 10 to balance the prediction accuracy and computation efficiency. Finally, dimension of hidden states $d _ { m o d e l }$ and head number of multi-head attention can be determined based on the available computing resources.
|
| 406 |
+
|
| 407 |
+
Table 6: MSE and MAE evaluation with different segment lengths on ETTm1 dataset. \* denotes segment length used in the main text, which is a divisor of $T , \tau$ .
|
| 408 |
+
|
| 409 |
+
<table><tr><td>Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE MAE</td></tr><tr><td> Segment Length L seg</td><td>5</td><td></td><td>6*</td><td></td><td>7</td></tr><tr><td>T= 288,τ = 48</td><td>0.291</td><td>0.349</td><td>0.300</td><td>0.352</td><td>0.284 0.346</td></tr><tr><td>Segment Length Lseg</td><td>22</td><td></td><td>24*</td><td></td><td>26</td></tr><tr><td>T= 672,T = 288</td><td>0.401</td><td>0.424</td><td>0.404</td><td>0.427</td><td>0.409 0.429</td></tr></table>
|
| 410 |
+
|
| 411 |
+
# D SUPPLEMENTARY DESIGN TO CROSSFORMER
|
| 412 |
+
|
| 413 |
+
# D.1 HANDLING INDIVISIBLE LENGTH
|
| 414 |
+
|
| 415 |
+
In the main paper, we assume that the input length $T$ and prediction length $\tau$ are divisible by segment length $L _ { s e g }$ . In this section, we use padding mechanism to handle cases where the assumption is not satisfied.
|
| 416 |
+
|
| 417 |
+
If $T$ is not divisible by $L _ { s e g }$ , we have $( k _ { 1 } - 1 ) L _ { s e g } < T < k _ { 1 } L _ { s e g }$ for some $k _ { 1 }$ . We pad $k _ { 1 } L _ { s e g } - T$ duplicated $\mathbf { x } _ { 1 }$ in front of $\mathbf { x } _ { \mathrm { 1 : } T }$ to get $\mathbf { x } _ { 1 : T } ^ { \prime }$ :
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\mathbf { x } _ { 1 : T } ^ { \prime } = [ \underbrace { \mathbf { x } _ { 1 } , \dots , \mathbf { x } _ { 1 } } _ { k _ { 1 } L _ { s e g } - T } , \mathbf { x } _ { 1 : T } ]
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
where $[ , ]$ denotes the concatenation operation. $\mathbf { x } _ { 1 : T } ^ { \prime } \in \mathbb { R } ^ { k _ { 1 } L _ { s e g } \times D }$ can be input to the encoder of Crossformer.
|
| 424 |
+
|
| 425 |
+
If $\tau$ is not divisible by $L _ { s e g }$ , we have $( k _ { 2 } - 1 ) L _ { s e g } < \tau < k _ { 2 } L _ { s e g }$ for some $k _ { 2 }$ . We set the learnable position embeddioutput in shape of der as . Then $\mathbf { E } ^ { ( d e c ) } \in \mathbb { R } ^ { k _ { 2 } \times D \times d _ { m o d e l } }$ and input it ttput is used as der to get an. $\mathbb { R } ^ { k _ { 2 } L _ { s e g } \times D }$ $\tau$ $\mathbf { x } _ { T + 1 : T + \tau } ^ { p r e d }$
|
| 426 |
+
|
| 427 |
+
We conduct experiment on ETTm1 dataset to evaluate the effect of indivisible length. Results in Table 6 show that with padding mechanism, indivisible length does not degrade model performance, for both short-term prediction and long-term prediction.
|
| 428 |
+
|
| 429 |
+
# D.2 INCORPORATING COVARIATES
|
| 430 |
+
|
| 431 |
+
In the main text, we only use historical series $\mathbf { x } _ { \mathrm { 1 : } T }$ to forecast the future $\mathbf { x } _ { T + 1 : T + \tau }$ . In this section, we try to incorporate covariates $\mathbf { c } _ { 1 : T + \tau }$ into Crossformer. We use a straightforward method: first embed the covariates into point-wise vectors $\left\{ { \bf d } _ { 1 } , { \bf d } _ { 2 } , \ldots , { \bf d } _ { T + \tau } \right\}$ like previous Transformer-based models do (Zhou et al., 2021; Wu et al., 2021a; Liu et al., 2021a). Then, merge the point-wise vectors into segment-wise vectors using learnable linear combination. Finally, add the segment-wise vectors to each dimension of the 2D vector array obtained by DSW embedding:
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\begin{array} { c } { \displaystyle \mathbf { c } _ { t } \to \mathbf { d } _ { t } , 1 \leq t \leq T } \\ { \displaystyle \mathbf { d } _ { i } ^ { ( s ) } = \sum _ { \substack { 0 < j \leq L _ { s e g } } } \alpha _ { j } \mathbf { d } _ { ( i - 1 ) \times L _ { s e g } + j } , \quad 1 \leq i \leq \frac { T } { L _ { s e g } } } \\ { \displaystyle \mathbf { h } _ { i , d } ^ { c o v } = \mathbf { h } _ { i , d } + \mathbf { d } _ { i } ^ { ( s ) } , \quad 1 \leq i \leq \frac { T } { L _ { s e g } } , \quad 1 \leq d \leq D } \end{array}
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
where denotes embedding method for point-wise covariates. $\alpha _ { j } , 1 \le j \le L _ { s e g }$ denotes learnable factors for linear combination. $\mathbf { d } _ { i } ^ { ( s ) }$ denotes the segment-wise covariate embedding. ${ \bf h } _ { i , d } ^ { c o v }$ denotes the embedded vector with covariate information for the $i$ -th segment in dimension $d$ , where $\mathbf { h } _ { i , d }$ is the embedded vector obtained from DSW embedding in the main text. The processing for the input of the decoder is similar, the segment-wise covariate embedding is added to the position embedding for decoder, i.e. ${ \bf E } ^ { ( d e c ) }$ .
|
| 438 |
+
|
| 439 |
+
Table 7: MSE and MAE evaluation of Crossformer without/with covariates on ETTh1 dataset.
|
| 440 |
+
|
| 441 |
+
<table><tr><td>Models</td><td>Crossformer</td><td>Crossformer+Cov</td></tr><tr><td>Metric</td><td>MSE MAE</td><td>MSE MAE</td></tr><tr><td>24</td><td>0.305 0.367</td><td>0.308 0.368</td></tr><tr><td>48</td><td>0.352 0.394</td><td>0.358 0.399</td></tr><tr><td>168</td><td>0.410 0.441</td><td>0.412 0.440</td></tr><tr><td>336</td><td>0.440 0.461</td><td>0.438 0.465</td></tr><tr><td>720</td><td>0.519 0.524</td><td>0.522 0.531</td></tr></table>
|
| 442 |
+
|
| 443 |
+
We conduct experiments on ETTh1 dataset to evaluate the effect of covariates. Hour-of-the-day, dayof-the-week, day-of-the-month and day-of-the-year are used as covariates. Results in Table 7 show that incorporating covariates does not improve the performance of Crossformer. The possible reason is this straightforward embedding method does not cooperate well with Crossformer. Incorporating covariates into Crossformer to further improve prediction accuracy is still an open problem.
|
md/dev/vaRCHVj0uGI/vaRCHVj0uGI.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SOLVING INVERSE PROBLEMS IN MEDICAL IMAGING WITH SCORE-BASED GENERATIVE MODELS
|
| 2 |
+
|
| 3 |
+
Yang $\mathbf { S o n g ^ { * } }$ , Liyue Shen˚, Lei Xing & Stefano Ermon Stanford University {yangsong@cs,liyues@,lei@,ermon@cs}.stanford.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Reconstructing medical images from partial measurements is an important inverse problem in Computed Tomography (CT) and Magnetic Resonance Imaging (MRI). Existing solutions based on machine learning typically train a model to directly map measurements to medical images, leveraging a training dataset of paired images and measurements. These measurements are typically synthesized from images using a fixed physical model of the measurement process, which hinders the generalization capability of models to unknown measurement processes. To address this issue, we propose a fully unsupervised technique for inverse problem solving, leveraging the recently introduced score-based generative models. Specifically, we first train a score-based generative model on medical images to capture their prior distribution. Given measurements and a physical model of the measurement process at test time, we introduce a sampling method to reconstruct an image consistent with both the prior and the observed measurements. Our method does not assume a fixed measurement process during training, and can thus be flexibly adapted to different measurement processes at test time. Empirically, we observe comparable or better performance to supervised learning techniques in several medical imaging tasks in CT and MRI, while demonstrating significantly better generalization to unknown measurement processes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Computed Tomography (CT) and Magnetic Resonance Imaging (MRI) are commonly used imaging tools for medical diagnosis. Reconstructing CT and MRI images from raw measurements (sinograms for CT and $\mathbf { k }$ -spaces for MRI) are well-known inverse problems. Specifically, measurements in CT are given by $\mathbf { X }$ -ray projections of an object from various directions, and measurements in MRI are obtained by inspecting the Fourier spectrum of an object with magnetic fields. However, since obtaining the full sinogram for CT causes excessive ionizing radiation for patients, and measuring the full k-space of MRI is very time-consuming, it has become important to reduce the number of measurements in CT and MRI. In many cases, only partial measurements, such as sparse-view sinograms and downsampled $\mathbf { k }$ -spaces, are available. Due to this loss of information, the inverse problems in CT and MRI are often ill-posed, making image reconstruction especially challenging.
|
| 12 |
+
|
| 13 |
+
With the rise of machine learning, many methods (Zhu et al., 2018; Mardani et al., 2017; Shen et al., 2019; Würfl et al., 2018; Ghani & Karl, 2018; Wei et al., 2020) have been proposed for medical image reconstruction using a small number of measurements. Most of these methods are supervised learning techniques. They learn to directly map partial measurements to medical images, by training on a large dataset comprising pairs of CT/MRI images and measurements. These measurements need to be synthesized from medical images with a fixed physical model of the measurement process. However, when the measurement process changes, such as using a different number of CT projections or different downsampling ratio of MRI $\mathbf { k }$ -spaces, we have to re-collect the paired dataset with the new measurement process and re-train the model. This prevents models from generalizing effectively to new measurement processes, leading to counter-intuitive instabilities such as more measurements causing worse performance (Antun et al., 2020).
|
| 14 |
+
|
| 15 |
+
In this work, we sidestep this difficulty completely by proposing unsupervised methods that do not require a paired dataset for training, and therefore are not restricted to a fixed measurement process. Our main idea is to learn the prior distribution of medical images with a generative model in order to infer the lost information due to partial measurements. Specifically, we propose to train a score-based generative model (Song & Ermon, 2019; 2020; Song et al., 2021) on medical images as the data prior, due to its strong performance in image generation (Ho et al., 2020; Dhariwal & Nichol, 2021). Given a trained score-based generative model, we provide a family of sampling algorithms to create image samples that are consistent with the observed measurements and the estimated data prior, leveraging the physical measurement process. Once our model is trained, it can be used to solve any inverse problem within the same image domain, as long as the mapping from images to measurements is linear, which holds for a large number of medical imaging applications.
|
| 16 |
+
|
| 17 |
+
We evaluate the performance of our method on several tasks in CT and MRI. Empirically, we observe comparable or better performance compared to supervised learning counterparts, even when evaluated with the same measurement process in their training. In addition, we are able to uniformly surpass all baselines when changing the number of measurements, e.g., using a different number of projections in sparse-view CT or changing the k-space downsampling ratio in undersampled MRI. Moreover, we show that by plugging in a different measurement process, we can use a single model to perform both sparse-view CT reconstruction and metal artifact removal for CT imaging with metallic implants. To the best of our knowledge, this is the first time that generative models are reported successful on clinical CT data. Collectively, these empirical results indicate that our method is a competitive alternative to supervised techniques in medical image reconstruction and artifact removal, and has the potential to be a universal tool for solving many inverse problems within the same image domain.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND
|
| 20 |
+
|
| 21 |
+
# 2.1 LINEAR INVERSE PROBLEMS
|
| 22 |
+
|
| 23 |
+
An inverse problem seeks to recover an unknown signal from a set of observed measurements. Specifically, suppose $\mathbf { x } \in \mathbb { R } ^ { n }$ is an unknown signal, and $\mathbf { y } \in \mathbb { R } ^ { m } = A \mathbf { x } + \epsilon$ is a noisy observation given by $m$ linear measurements, where the measurement acquisition process is represented by a linear operator $\pmb { A } \in \mathbb { R } ^ { m \times n }$ , and $\epsilon \in \mathbb { R } ^ { n }$ represents a noise vector. Solving a linear inverse problem amounts to recovering the signal $\mathbf { x }$ from its measurement y. Without further assumptions, the problem is ill-defined when $m < n$ , so we additionally assume that $\mathbf { x }$ is sampled from a prior distribution $p ( \mathbf { x } )$ . In this probabilistic formulation, the measurement and signal are connected through a measurement distribution $p ( \mathbf { y } \mid \mathbf { x } ) = q _ { \epsilon } ( \mathbf { y } - A \mathbf { x } )$ , where $q _ { \epsilon }$ denotes the noise distribution of $\epsilon$ . Given $p ( \mathbf { y } \mid \mathbf { x } )$ and $p ( \mathbf { x } )$ , we can solve the inverse problem by sampling from the posterior distribution $p ( \mathbf { x } \mid \mathbf { y } )$ .
|
| 24 |
+
|
| 25 |
+
Examples of linear inverse problems in medical imaging include image reconstruction for CT and MRI. In both cases, the signal $\mathbf { x }$ is a medical image. The measurement y in CT is a sinogram formed by $\mathrm { X }$ -ray projections of the image from various angular directions (Buzug, 2011), while the measurement $\mathbf { y }$ in MRI consists of spatial frequencies in the Fourier space of the image (a.k.a. the $\mathbf { k }$ -space in the MRI community) (Vlaardingerbroek & Boer, 2013).
|
| 26 |
+
|
| 27 |
+
# 2.2 SCORE-BASED GENERATIVE MODELS
|
| 28 |
+
|
| 29 |
+
When solving inverse problems in medical imaging, we are given an observation $\mathbf { y }$ , the measurement distribution $\bar { p } ( \mathbf { y } \mid \mathbf { x } )$ and aim to sample from the posterior distribution $p ( \mathbf { x } \mid \mathbf { y } )$ . The prior distribution $p ( \mathbf { x } )$ is typically unknown, but we can train generative models on a dataset $\{ \mathbf { x } ^ { ( 1 ) } , \mathbf { x } ^ { ( 2 ) } , \cdot \cdot \cdot , \mathbf { x } ^ { ( N ) } \} \sim$ $p ( \mathbf { x } )$ to estimate this prior distribution. Given an estimate of $p ( \mathbf { x } )$ and the measurement distribution $p ( \mathbf { y } \mid \mathbf { x } )$ , the posterior distribution $p ( \mathbf { x } \mid \mathbf { y } )$ can be determined through Bayes’ rule.
|
| 30 |
+
|
| 31 |
+
We propose to estimate the prior distribution of medical images using the recently introduced scorebased generative models (Song & Ermon, 2019; Ho et al., 2020; Song et al., 2021), whose iterative sampling procedure makes it especially easy for controllable generation conditioned on an observation y. Specifically, we adopt the formulation of score-based generative models in Song et al. (2021), where we leverage a Markovian diffusion process to progressively perturb data to noise, and then smoothly convert noise to samples of the data distribution by estimating and simulating its time reversal. We provide an illustration of this generative modeling framework in Fig. 1.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: We can smoothly perturb images to noise by following the trajectory of an SDE. By estimating the score function $\nabla _ { \mathbf { x } } \log p _ { t } ( \mathbf { x } )$ with neural networks (called score models), it is possible to approximate the reverse SDE and then solve it to generate image samples from noise.
|
| 35 |
+
|
| 36 |
+
Perturbation process Suppose the dataset is sampled from an unknown data distribution $p ( \mathbf { x } )$ . We perturb datapoints with a stochastic process over a time horizon $[ 0 , 1 ]$ , governed by a linear stochastic differential equation (SDE) of the following form
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathrm { d } \mathbf { x } _ { t } = f ( t ) \mathbf { x } _ { t } \mathrm { d } t + g ( t ) \mathrm { d } \mathbf { w } _ { t } , \qquad t \in [ 0 , 1 ] ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $f : [ 0 , 1 ] \to \mathbb { R }$ , $g : [ 0 , 1 ] \to \mathbb { R }$ , $\{ \mathbf { w } _ { t } \in \mathbb { R } ^ { n } \} _ { t \in [ 0 , 1 ] }$ denotes a standard Wiener process (a.k.a., Brownian motion), and $\{ \mathbf { x } _ { t } \in \mathbb { R } ^ { n } \} _ { t \in [ 0 , 1 ] }$ symbolizes the trajectory of random variables in the stochastic process. We further denote the marginal probability distribution of $\mathbf { x } _ { t }$ as $p _ { t } ( \mathbf { x } )$ , and the transition distribution from $\mathbf { x } _ { \mathrm { 0 } }$ to $\mathbf { x } _ { t }$ as $p _ { 0 t } ( \mathbf { x } _ { t } \mid \mathbf { x } _ { 0 } )$ . By definition, we clearly have $p _ { 0 } ( \mathbf { x } ) \equiv p ( \mathbf { x } )$ . Moreover, the functions $f ( t )$ and $g ( t )$ are specifically chosen such that for any initial distribution $p _ { 0 } ( \mathbf { x } )$ , the distribution at the end of the perturbation process, $p _ { 1 } ( \mathbf { x } )$ , is close to a pre-defined noise distribution $\pi ( \mathbf { x } )$ . In addition, the transition density $p _ { 0 t } ( \mathbf { x } _ { t } \mid \mathbf { \dot { x } } _ { 0 } )$ is always a conditional linear Gaussian distribution, taking the form $p _ { 0 t } ( \mathbf { x } _ { t } \mid \mathbf { x } _ { 0 } ) = \mathcal { N } ( \mathbf { x } _ { t } \mid \alpha ( t ) \mathbf { x } _ { 0 } , \beta ^ { 2 } ( t ) I )$ where $\alpha : [ 0 , 1 ] \mathbb { R }$ and $\beta : [ 0 , 1 ] \mathbb { R }$ can be derived analytically from $f ( t )$ and $g ( t )$ (Särkkä & Solin, 2019). Examples of such SDEs include Variance Exploding (VE), Variance Preserving (VP), and subVP SDEs proposed in Song et al. (2021). We found VE SDEs performed the best in our experiments.
|
| 43 |
+
|
| 44 |
+
Reverse process By reversing the perturbation process in Eq. (1), we can start from a noise sample $\mathbf { x } _ { 1 } \sim p _ { 1 } ( \mathbf { x } )$ and gradually remove the noise therein to obtain a data sample $\mathbf { x } _ { 0 } \sim p _ { 0 } ( \mathbf { x } ) \equiv p ( \mathbf { x } )$ . Crucially, the time reversal of Eq. (1) is given by the following reverse-time SDE (Song et al., 2021)
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\mathrm { d } \mathbf { x } _ { t } = \left[ f ( t ) \mathbf { x } _ { t } - g ( t ) ^ { 2 } \nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } ) \right] \mathrm { d } t + g ( t ) \mathrm { d } \bar { \mathbf { w } } _ { t } , \qquad t \in [ 0 , 1 ] ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $\{ \bar { \mathbf { w } } _ { t } \} _ { t \in [ 0 , 1 ] }$ denotes a standard Wiener process in the reverse-time direction, and $\mathrm { d } t$ represents an infinitesimal negative time step, since the above SDE must be solved backwards from $t = 1$ to $t = 0$ . The quantity $\nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } )$ is known as the score function of $p _ { t } ( \mathbf { x } _ { t } )$ . By the definition of time reversal, the trajectory of the reverse stochastic process given by Eq. (2) is $\{ \mathbf { x } _ { t } \} _ { t \in [ 0 , 1 ] }$ , same as the one from the forward SDE in Eq. (1).
|
| 51 |
+
|
| 52 |
+
Sampling Given an initial sample from $p _ { 1 } ( \mathbf { x } )$ , as well as scores at each intermediate time step, $\nabla _ { \mathbf { x } } \log p _ { t } ( \mathbf { x } )$ , we can simulate the reverse-time SDE in Eq. (2) to obtain samples from the data distribution $p _ { 0 } ( \mathbf { x } ) \equiv p ( \mathbf { x } )$ . In practice, the initial sample is approximately drawn from $\pi ( \mathbf { x } )$ since $\pi ( \mathbf { x } ) \approx p _ { 1 } ( \mathbf { x } )$ , and the scores are estimated by training a neural network $s _ { \theta } ( \mathbf { x } , t )$ (named the score model) on a dataset $\{ \mathbf { x } ^ { ( 1 ) } , \mathbf { x } ^ { ( 2 ) } , \cdot \cdot \cdot , \mathbf { x } ^ { ( N ) } \} \sim p ( \mathbf { x } )$ with denoising score matching (Vincent, 2011; Song et al., 2021), i.e., solving the following objective
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\theta ^ { * } = \underset { \theta } { \operatorname { a r g m i n } } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { t \sim \mathcal { U } [ 0 , 1 ] } \mathbb { E } _ { \mathbf { x } _ { t } ^ { ( i ) } \sim p _ { 0 t } ( \mathbf { x } _ { t } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } ) } \Big [ \left\| s _ { \theta } ( \mathbf { x } _ { t } ^ { ( i ) } , t ) - \nabla _ { \mathbf { x } _ { t } ^ { ( i ) } } \log p _ { 0 t } ( \mathbf { x } _ { t } ^ { ( i ) } | \mathbf { x } ^ { ( i ) } ) \right\| _ { 2 } ^ { 2 } \Big ] ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\mathcal { U } [ 0 , 1 ]$ denotes a uniform distribution over $[ 0 , 1 ]$ . The theory of denoising score matching ensures that $\bar { s } _ { \theta ^ { * } } ( \mathbf { x } , t ) \approx \nabla _ { \mathbf { x } } \log p _ { t } ( \mathbf { x } )$ . After training this score model, we plug it into Eq. (2) and solve the resulting reverse-time SDE
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathrm { d } \mathbf { x } _ { t } = \left[ f ( t ) \mathbf { x } _ { t } - g ( t ) ^ { 2 } s _ { \theta ^ { \ast } } ( \mathbf { x } _ { t } , t ) \right] \mathrm { d } t + g ( t ) \mathrm { d } { \bar { \mathbf { w } } } _ { t } , \qquad t \in [ 0 , 1 ] ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
for sample generation. One sampling method is to use the Euler-Maruyama discretization for solving Eq. (3), as given in Algorithm 1. Other sampling methods include annealed Langevin dynamics (ALD, Song & Ermon, 2019), probability flow ODE solvers (Song et al., 2021), and Predictor-Corrector samplers (Song et al., 2021).
|
| 65 |
+
|
| 66 |
+
<table><tr><td>Algorithm 1 Unconditional sampling</td><td>Algorithm 2 Inverse problem solving</td></tr><tr><td>Require: N</td><td>Require: N,y, 入</td></tr><tr><td></td><td></td></tr><tr><td>2:fori=N-1to0do 3:t←</td><td>2:fori=N-1 to 0 do 3: t←</td></tr><tr><td>N</td><td>4: N yt ~ pot(yt |y)</td></tr><tr><td></td><td>5: xt ←T-1[λAp-1(△)yt+(1-λ)ATxt +</td></tr><tr><td>4: Xt-△t←xt-f(t)xt△t</td><td>(I-∧)Txt] 6: xt-△t←xt-f(t)xt△t</td></tr><tr><td>5: Xt-△t←Xt-△t+g(t)²sθ*(xt,t)△t</td><td>7: Xt-△t←Xt-△t+g(t)²sθ*(xt,t)△t</td></tr><tr><td>6: z ~ N(0,I)</td><td>8: z ~ N(0,1)</td></tr><tr><td>7: Xt-△t←xt-△t+g(t)√△tz</td><td>Xt-△t←Xt-△t+g(t)√△tz</td></tr><tr><td>8: return Xo</td><td>9: 10: return Xo</td></tr></table>
|
| 67 |
+
|
| 68 |
+
# 3 SOLVING INVERSE PROBLEMS WITH SCORE-BASED GENERATIVE MODELS
|
| 69 |
+
|
| 70 |
+
With score-based generative modeling, we can train a score model $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ to generate unconditional samples from the the prior distribution of medical images $p ( \mathbf { x } )$ . To solve inverse problems however, we will need to sample from the posterior $p ( \mathbf { x } \mid \mathbf { y } )$ . This can be accomplished by conditioning the original stochastic process $\{ \mathbf { x } _ { t } \} _ { t \in [ 0 , 1 ] }$ on an observation $\mathbf { y }$ , yielding a conditional stochastic process $\{ \mathbf { x } _ { t } \ | \ \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ . We denote the marginal distribution at $t$ as $p _ { t } ( \mathbf { x } _ { t } \mid \mathbf { y } )$ , and our goal is to sample from $p _ { 0 } ( \mathbf { x } _ { 0 } \mid \mathbf { y } )$ , the same distribution as $p ( \mathbf { x } \mid \mathbf { y } )$ by definition. Much like generating unconditional samples by solving the reverse-time SDE in Eq. (2), we can reverse the conditional stochastic process $\{ \mathbf { x } _ { t } \mid \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ to sample from the posterior distribution $p _ { 0 } ( \mathbf { x } _ { 0 } \mid \mathbf { y } )$ by solving the following conditional reverse-time SDE (Song et al., 2021):
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathrm { d } \mathbf { x } _ { t } = \left[ f ( t ) \mathbf { x } _ { t } - g ( t ) ^ { 2 } \nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } \mid \mathbf { y } ) \right] \mathrm { d } t + g ( t ) \mathrm { d } \bar { \mathbf { w } } _ { t } , \qquad t \in [ 0 , 1 ] .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
The conditional score function $\nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } \mid \mathbf { y } )$ is a critical part of Eq. (4), yet it is non-trivial to compute. One solution is to estimate the score function by training a new score model $s _ { \theta ^ { * } } ( \mathbf x _ { t } , \mathbf y , t )$ that explicitly depends on $\mathbf { y }$ (Song et al., 2021; Dhariwal $\&$ Nichol, 2021), such that $s _ { \theta ^ { * } } ( \mathbf x _ { t } , \mathbf y , t ) \approx$ $\nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } \mid \mathbf { y } )$ . However, this requires paired data $\{ ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { N }$ for training and has the same drawbacks as supervised learning techniques. We do not consider this approach in this work.
|
| 77 |
+
|
| 78 |
+
An unsupervised alternative is to approximate the conditional score function with an unconditionallytrained score model $s _ { \theta ^ { * } } ( \mathbf { x } _ { t } , t ) \approx \mathbf { \bar { \nabla } } \varphi _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } )$ and the measurement distribution $p ( \mathbf { y } \mid \mathbf { x } )$ . Many existing works (Song et al., 2021; Kawar et al., 2021; Kadkhodaie & Simoncelli, 2020; Jalal et al., 2021) have implemented this idea in different ways. However, the methods in Kawar et al. (2021) and Kadkhodaie & Simoncelli (2020) both require computing the singular value decomposition (SVD) of $\pmb { A } \in \mathbb { R } ^ { m \times n }$ , which can be difficult for many measurement processes in medical imaging. The method proposed in Jalal et al. (2021) is only designed for a specific sampling method called annealed Langevin dynamics (ALD, Song & Ermon, 2019), which proves to be inferior to more advanced sampling algorithms such as Predictor-Corrector methods (Song et al., 2021).
|
| 79 |
+
|
| 80 |
+
In what follows, we propose a new conditional sampling approach for inverse problem solving with score-based generative models. Our method is computationally efficient for medical image reconstruction, and is applicable to a large family of iterative sampling methods for score-based generative models. At a high level, we first train an unconditional score model $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ on medical images without assuming any measurement process. Given an observation $\mathbf { y }$ at test time, we form a stochastic process $\{ \mathbf { y } _ { t } \} _ { t \in [ 0 , 1 ] }$ by adding appropriate noise to y. We then discretize the reverse-time SDE in Eq. (3) with existing unconditional samplers for $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ , while incorporating the conditional information from y with a proximal optimization step to generate intermediate samples that are consistent with tytutPr0,1s.
|
| 81 |
+
|
| 82 |
+
# .1 A CONVENIENT FORM OF THE LINEAR MEASUREMENT PROCESS
|
| 83 |
+
|
| 84 |
+
Many different measurement processes in medical imaging share same components of computation. For example, sparse-view CT reconstruction and metal artifact removal for CT both involve computing the same Radon transform. Similarly, MRI measurement processes require computing the same spatial Fourier transform regardless of different downsampling ratios. To rigorously characterize this structure of measurement processes, we propose a special formulation of $\pmb { A }$ that is efficient to obtain in medical imaging applications. Without loss of generality, we assume that the linear operator $\pmb { A }$ has full rank, i.e., $\operatorname { r a n k } ( A ) = \operatorname* { m i n } ( n , m ) = m$ . The result below gives the alternative formulation of $\pmb { A }$ :
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Linear measurement processes for sparse-view CT (left) and undersampled MRI (right).
|
| 88 |
+
|
| 89 |
+
Proposition 1. $I f \operatorname { r a n k } ( A ) = m$ , then there exist an invertible matrix $\pmb { T } \in \mathbb { R } ^ { n \times n }$ , and a diagonal matrix $\pmb { \Lambda } \in \{ 0 , 1 \} ^ { n \times n }$ with $\operatorname { t r } ( \mathbf { \mathbf { \boldsymbol { \Lambda } } } ) = m$ , such that $A = \mathcal { P } ( \mathbf { \boldsymbol { \Lambda } } ) \mathbf { \boldsymbol { T } }$ . Here $\mathcal { P } ( \mathbf { A } ) \in \{ 0 , 1 \} ^ { m \times n }$ is an operator that, when multiplied with any vector $\mathbf { \pmb { a } } \in \mathbb { R } ^ { n }$ , reduces its dimensionality to m by removing each $i$ -th element of $\textbf { \em a }$ for $i = 1 , 2 , \cdots , n$ if $\mathbf { \Lambda } \Lambda _ { i i } = 0$ .
|
| 90 |
+
|
| 91 |
+
We illustrate this decomposition for CT/MRI in Fig. 2. Many measurement processes in medical imaging share the same $_ { \mathbf { T } }$ , even if they correspond to different $\pmb { A }$ . For example, $_ { \mathbf { T } }$ corresponds to the Radon transform and Fourier transform in sparse-view CT and undersampled MRI respectively, regardless of the number of measurements, i.e., CT projections and $\mathbf { k }$ -space downsampling ratios. For both sparse-view CT reconstruction and metal artifact removal for CT images, the operator $_ { \mathbf { T } }$ is the Radon transform (see Fig. 8). Intuitively, $\mathrm { d i a g } ( \pmb { \Lambda } )$ can be viewed as a subsampling mask on the sinogram/k-space, and ${ \mathcal { P } } ( \Lambda )$ subsamples the sinogram $/ \mathrm { k }$ -space into an observation y with a smaller size according to this subsampling mask. In addition, we note that $\pmb { T } ^ { - 1 }$ can be efficiently implemented with the inverse Radon transform or the inverse Fourier transform in CT/MRI applications.
|
| 92 |
+
|
| 93 |
+
# 3.2 INCORPORATING A GIVEN OBSERVATION INTO AN UNCONDITIONAL SAMPLING PROCESS
|
| 94 |
+
|
| 95 |
+
In what follows, we show that the decomposition in Proposition 1 provides an efficient way to generate approximate samples from the conditional stochastic process $\{ \mathbf { x } _ { t } \mid \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ with an unconditional score model $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ . The basic idea is to “hijack” the unconditional sampling process of scorebased generative models to incorporate an observed measurement y.
|
| 96 |
+
|
| 97 |
+
As we have already discussed, it is difficult to directly solve $\{ \mathbf { x } _ { t } \mid \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ for sample generation. To bypass this difficulty, we first consider a related stochastic process that is much easier to sample from. Recall that $p _ { 0 t } ( \dot { \mathbf { x } } _ { t } \mid \mathbf { x } _ { 0 } ) = \mathcal { N } ( \mathbf { x } _ { t } \mid \alpha ( t ) \mathbf { x } _ { 0 } , \beta ^ { 2 } ( t ) \mathbf { I } )$ where $\alpha ( t )$ and $\beta ( t )$ can be derived from $f ( t )$ and $g ( t )$ (Song et al., 2021). Given the unconditional stochastic process $\{ \mathbf { x } _ { t } \} _ { t \in [ 0 , 1 ] }$ , we define $\{ \mathbf { y } _ { t } \} _ { t \in [ 0 , 1 ] }$ , where $\mathbf { y } _ { t } = A \mathbf { x } _ { t } + \alpha ( t ) \mathbf { \epsilon }$ . Unlike $\{ \mathbf { x } _ { t } \ | \ \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ , the conditional stochastic process $\{ \mathbf { y } _ { t } \ | \ \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ is fully tractable. First, we have ${ \bf y } _ { 0 } = \tilde { \bf A } { \bf x } _ { 0 } + \alpha ( 0 ) \epsilon = A { \bf x } _ { 0 } + \epsilon = { \bf y }$ . Since $p _ { 0 t } ( \mathbf { x } _ { t } \mid \mathbf { x } _ { 0 } ) = \mathcal { N } ( \mathbf { x } _ { t } \mid \alpha ( t ) \mathbf { x } _ { 0 } , \beta ^ { 2 } ( t ) \mathbf { I } )$ , we have $\mathbf { x } _ { t } = \alpha ( t ) \mathbf { x } _ { 0 } + \beta ( t ) \mathbf { z }$ , where $\mathbf { z } \in \mathbb { R } ^ { n } \sim \mathcal { N } ( \mathbf { 0 } , I )$ . By definition, $\mathbf { y } _ { t } = A \mathbf { x } _ { t } + \alpha ( t ) \boldsymbol { \epsilon }$ , so we have ${ \bf y } _ { t } = A ( \alpha ( t ) { \bf x } _ { 0 } + \beta ( t ) { \bf z } ) + \alpha ( t ) \epsilon = \alpha ( t ) ( { \bf y } - \epsilon ) +$ $\beta ( t ) A \mathbf { z } + \alpha ( t ) \boldsymbol { \epsilon } = \alpha ( t ) \mathbf { y } + \beta ( t ) A \mathbf { z }$ . Therefore, we can easily generate a sample $\hat { \mathbf { y } } _ { t } \sim p _ { t } ( \mathbf { y } _ { t } \mid \mathbf { y } )$ by first drawing $\mathbf { z } \sim \mathcal { N } ( \mathbf { 0 } , I )$ and then computing $\hat { \mathbf { y } } _ { t } = \alpha ( t ) \mathbf { y } + \beta ( t ) A \mathbf { z }$ .
|
| 98 |
+
|
| 99 |
+
The key of our approach is to modify any existing iterative sampling algorithm designed for the unconditional stochastic process $\{ \mathbf { x } _ { t } \} _ { t \in [ 0 , 1 ] }$ so that the samples are consistent with $\{ \mathbf { y } _ { t } \mid \mathbf { \bar { y } } \} _ { t \in [ 0 , 1 ] }$ . In general, an iterative sampling process of score-based generative models selects a sequence of time steps $\left\{ 0 = t _ { 0 } < t _ { 1 } < \cdots < t _ { N } = 1 \right\}$ and iterates according to
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r } { \hat { \mathbf { x } } _ { t _ { i - 1 } } = h \big ( \hat { \mathbf { x } } _ { t _ { i } } , \mathbf { z } _ { i } , s _ { \theta ^ { * } } \big ( \hat { \mathbf { x } } _ { t _ { i } } , t _ { i } \big ) \big ) , \quad i = N , N - 1 , \cdots , 1 , } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\hat { \mathbf { x } } _ { t _ { N } } \sim \pi ( \mathbf { x } )$ , $\mathbf { z } _ { i } \sim \mathcal { N } ( \mathbf { 0 } , I )$ , and $\pmb { \theta } ^ { * }$ denotes the parameters in an unconditional score model $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ . Here the iteration function $^ { h }$ takes a noisy sample $\hat { \mathbf { x } } _ { t _ { i } }$ and reduces the noise therein to generate $\hat { \mathbf { x } } _ { t _ { i - 1 } }$ , using the unconditional score model $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ . For example, for the Euler-Maruyama sampler detailed in Algorithm 1, this iteration function is given by
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
h ( \hat { \bf x } _ { t _ { i } } , { \bf z } _ { i } , s _ { \theta ^ { * } } ( \hat { \bf x } _ { t _ { i } } , t _ { i } ) ) = \hat { \bf x } _ { t _ { i } } - f ( t _ { i } ) \hat { \bf x } _ { t _ { i } } / N + g ( t _ { i } ) ^ { 2 } s _ { \theta ^ { * } } ( \hat { \bf x } _ { t _ { i } } , t _ { i } ) / N + g ( t _ { i } ) { \bf z } _ { i } / \sqrt { N } .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Samples obtained by this procedure $\{ \hat { \mathbf { x } } _ { t _ { i } } \} _ { i = 0 } ^ { N }$ constitute an approximation of $\{ \mathbf { x } _ { t } \} _ { t \in [ 0 , 1 ] }$ , where the last sample $\hat { \mathbf { x } } _ { t _ { 0 } }$ can be viewed as an approximate sample from $p _ { 0 } ( \mathbf { x } )$ . Most existing sampling
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: (Left) An overview of our method for solving inverse problems with score-based generative models. (Right) An illustration about how to combine $\hat { \mathbf { x } } _ { t _ { i } }$ and $\mathbf { y }$ to form $\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime }$ .
|
| 115 |
+
|
| 116 |
+
methods for score-based generative models are instances of this iterative sampling paradigm, including Algorithm 1, ALD (Song & Ermon, 2019), probability flow ODEs (Song et al., 2021) and PredictorCorrector samplers (Song et al., 2021).
|
| 117 |
+
|
| 118 |
+
To enforce the constraint implied by $\{ \mathbf { y } _ { t } \mid \mathbf { y } \} _ { t \in [ 0 , 1 ] }$ , we prepend an additional step to the iteration rule in Eq. (5), leading to
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = k ( \hat { \mathbf { x } } _ { t _ { i } } , \hat { \mathbf { y } } _ { t _ { i } } , \lambda ) \qquad } \\ { \hat { \mathbf { x } } _ { t _ { i - 1 } } = h ( \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } , \mathbf { z } _ { i } , s _ { \theta ^ { * } } ( \hat { \mathbf { x } } _ { t _ { i } } , t _ { i } ) ) , \quad i = N , N - 1 , \cdots , 1 , } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $\hat { \mathbf { x } } _ { t _ { N } } \sim \pi ( \mathbf { x } ) , \hat { \mathbf { y } } _ { t _ { i } } \sim p _ { t _ { i } } ( \mathbf { y } _ { t _ { i } } \mid \mathbf { y } )$ , and $0 \leqslant \lambda \leqslant 1$ is a hyper-parameter. We provide an illustration of this process in Fig. 3. The iteration function $\pmb { k } ( \cdot , \hat { \mathbf { y } } _ { t _ { i } } , \lambda ) : \mathbb { R } ^ { n } \mathbb { R } ^ { n }$ promotes data consistency by solving a proximal optimization step (Nesterov, 2003; Boyd et al., 2004; Hammernik et al., 2021) that simultaneously minimizes the distance between $\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime }$ and $\hat { \mathbf { x } } _ { t _ { i } }$ , and the distance between $\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime }$ and the hyperplane $\left\{ \pmb { x } \in \mathbb { R } ^ { n } \ \lvert \ A \pmb { x } = \hat { \mathbf { y } } _ { t _ { i } } \right\}$ , with a hyperparameter $0 \leqslant \lambda \leqslant 1$ balancing between the two:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = \underset { z \in \mathbb { R } ^ { n } } { \arg \operatorname* { m i n } } \{ \left( 1 - \lambda \right) \| z - \hat { \mathbf { x } } _ { t _ { i } } \| _ { T } ^ { 2 } + \underset { u \in \mathbb { R } ^ { n } } { \operatorname* { m i n } } \lambda \| z - u \| _ { T } ^ { 2 } \} \quad s . t . \quad A u = \hat { \mathbf { y } } _ { t _ { i } } .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Recall that $A = \mathcal { P } ( \mathbf { \boldsymbol { \Lambda } } ) \mathbf { \boldsymbol { T } }$ according to Proposition 1. In the equation above we choose the norm $\left\| \pmb { a } \right\| _ { T } ^ { 2 } : = \left\| \pmb { T } \pmb { a } \right\| _ { 2 } ^ { 2 }$ to simplify our theoretical analysis. The decomposition in Proposition 1 allows us to derive a closed-form solution to the optimization problem in Eq. (8), as given below:
|
| 131 |
+
|
| 132 |
+
Theorem 1. The solution of Eq. (8) can be given by
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = \pmb { T } ^ { - 1 } [ \lambda \pmb { \Lambda } \mathcal { P } ^ { - 1 } ( \pmb { \Lambda } ) \hat { \mathbf { y } } _ { t _ { i } } + ( 1 - \lambda ) \pmb { \Lambda } \pmb { T } \hat { \mathbf { x } } _ { t _ { i } } + ( \pmb { I } - \pmb { \Lambda } ) \pmb { T } \hat { \mathbf { x } } _ { t _ { i } } ] ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\mathcal { P } ^ { - 1 } ( \mathbf { \Lambda } ) : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ denotes any right inverse of ${ \mathcal { P } } ( \Lambda )$ .
|
| 139 |
+
|
| 140 |
+
See Fig. 3 for an illustration of the function $\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = k ( \hat { \mathbf { x } } _ { t _ { i } } , \hat { \mathbf { y } } _ { t _ { i } } , \lambda )$ . The right inverse $\mathcal { P } ^ { - 1 } ( \pmb { \Lambda } )$ increases the dimensionality of a vector $\pmb { a } \in \mathbb { R } ^ { m }$ to $n$ by putting its entries on every index $i$ of an $n$ -dimensional vector where $\mathbf { \Lambda } \Lambda _ { i i } = 1$ . Recall that in sparse-view CT or undersampled MRI, $\mathrm { d i a g } ( \pmb { \Lambda } )$ represents a subsampling mask, and ${ \mathcal { P } } ( \Lambda )$ subsamples the full sinogram/k-space to generate the observation y. In this case, $\bar { \mathcal { P } } ^ { - 1 } ( \pmb { \Lambda } )$ pads the observation y so that it has the same size as the full sinogram $/ \mathrm { k }$ -space.
|
| 141 |
+
|
| 142 |
+
When $\lambda = 0$ , $\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = k ( \hat { \mathbf { x } } _ { t _ { i } } , \hat { \mathbf { y } } _ { t _ { i } } , 0 ) = \hat { \mathbf { x } } _ { t _ { i } }$ completely ignores the constraint $A \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = \hat { \mathbf { y } } _ { t _ { i } }$ , in which case our sampling method in Eq. (7) performs unconditional generation. On the other hand, when $\lambda = 1 , \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = k ( \hat { \mathbf { x } } _ { t _ { i } } , \hat { \mathbf { y } } _ { t _ { i } } , 1 )$ satisfies $A \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = \hat { \mathbf { y } } _ { t _ { i } }$ exactly. When the measurement is noisy, we choose $0 < \lambda < 1$ to allow slackness in the constraint $A \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = \hat { \mathbf { y } } _ { t _ { i } }$ . The value of $\lambda$ is important for balancing between $\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } \approx \hat { \mathbf { x } } _ { t _ { i } }$ and $A \hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } \approx \hat { \mathbf { y } } _ { t _ { i } }$ . In practice, we use Bayesian optimization to tune this $\lambda$ automatically on a validation dataset. When the measurement process contains no noise, we replace $\hat { \mathbf { x } } _ { t _ { 0 } }$ with $k ( \hat { \mathbf x } _ { t _ { 0 } } , \mathbf y , 1 )$ at the last sampling step to guarantee $\boldsymbol { A } \hat { \mathbf x } _ { t _ { 0 } } = \mathbf y$ .
|
| 143 |
+
|
| 144 |
+
In summary, our method given in Eq. (7) introduces minimal modifications to an existing iterative sampling method of score-based generative models. For example, we can convert the sampler in Algorithm 1 to an inverse problem solver in Algorithm 2 by adding/modifying just three lines of pseudo-code. Unlike the concurrent work Jalal et al. (2021), our method is not limited to annealed Langevin dynamics (ALD). As demonstrated in our experiments, we outperform Jalal et al. (2021) even with the same ALD sampler, and can widen the performance gap further by using more advanced approaches like the Predictor-Corrector sampler (Song et al., 2021). Unlike Kadkhodaie & Simoncelli (2020); Kawar et al. (2021), we rely on the efficient alternative representation of $\pmb { A }$ given in Section 3.1, and do not require expensive SVD computation.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 4: Examples of sparse-view CT reconstruction results on LIDC $3 2 0 \times 3 2 0$ (Top row) and LDCT $5 1 2 \times 5 1 2$ (Bottom row), all with 23 projections. You may zoom in to view more details.
|
| 148 |
+
|
| 149 |
+
# 4 EXPERIMENTS
|
| 150 |
+
|
| 151 |
+
We aim to answer the following questions in this section: (1) Can we directly compete with best-inclass supervised learning techniques for the same measurement process used in their training, even though our approach is fully unsupervised? (2) Can our method generalize better to new measurement processes? (3) How do we fare against other unsupervised approaches? To study these questions, we experiment on several tasks in medical imaging, including sparse-view CT reconstruction, metal artifact removal (MAR) for CT, and undersampled MRI reconstruction. More experimental details are provided in Appendix B.
|
| 152 |
+
|
| 153 |
+
Datasets We consider two datasets for CT experiments. The first is the Lung Image Database Consortium (LIDC) image collection dataset (Armato III et al., 2011; Clark et al., 2013) where we slice the original 3D CT volumes to obtain 130304 2D images of resolution $3 2 0 \times 3 2 0$ for training. The second is the Low Dose CT (LDCT) Image and Projection dataset (Moen et al., 2021) that contains CT scans of multiple anatomic sites, including head, chest, and abdomen, from which we generate 47006 2D image slices of resolution $5 1 2 \times 5 1 2$ for training. We simulate CT measurements (sinograms) with a parallel-beam geometry using projection angles equally distributed across 180 degrees. For MAR experiments, we follow Yu et al. (2020) to synthesize metal artifacts. For undersampled MRI experiments, we use the Brain Tumor Segmentation (BraTS) 2021 dataset (Menze et al., 2014; Bakas et al., 2017), where we slice 3D MRI volumes to get 297270 images of resolution $2 4 0 \times 2 4 0$ as the training dataset. We simulate MRI measurements with Fast Fourier Transform using a single-coil setup, and follow Zbontar et al. (2018); Knoll et al. (2020) to undersample the $\mathbf { k }$ -space with an equispaced Cartesian mask. The performance is measured on 1000 test images with peak signal-to-noise ratio (PSNR) and structural similarity (SSIM).
|
| 154 |
+
|
| 155 |
+
Standard techniques in medical imaging We include two standard learning-free techniques as baselines for sparse-view CT reconstruction. The first is filtered back projection on sparse-view sinograms, which is denoted by “FBP”. The second is an iterative reconstruction method with total variation regularization called FISTA-TV (Beck & Teboulle, 2009). For MAR experiments, we include another learning-free baseline called linear interpolation (LI, Kalender et al., 1987).
|
| 156 |
+
|
| 157 |
+
Table 1: Results for undersampled MRI reconstruction on BraTS. First two methods are supervised learning techniques trained with $8 \times$ acceleration. The others are unsupervised techniques.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">24×Acceleration</td><td colspan="2">8× Acceleration</td><td colspan="2">4× Acceleration</td></tr><tr><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>Cascade DenseNet</td><td>23.39±2.17</td><td>0.765±0.042</td><td>28.35±2.30</td><td>0.845±0.038</td><td>30.97±2.33</td><td>0.902±0.028</td></tr><tr><td>DuDoRNet</td><td>18.46±3.05</td><td>0.662±0.093</td><td>37.88±3.03</td><td>0.985±0.007</td><td>30.53±4.13</td><td>0.891±0.071</td></tr><tr><td>Score SDE</td><td>27.83±2.73</td><td>0.849±0.038</td><td>35.04±2.11</td><td>0.943±0.016</td><td>37.55±2.08</td><td>0.960±0.013</td></tr><tr><td>Langevin</td><td>28.80±3.21</td><td>0.873±0.039</td><td>36.44±2.28</td><td>0.952±0.016</td><td>38.76±2.32</td><td>0.966±0.012</td></tr><tr><td>Ours</td><td>29.42±3.03</td><td>0.880±0.035</td><td>37.63±2.70</td><td>0.958±0.015</td><td>39.91±2.67</td><td>0.965±0.013</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Table 2: Results for sparse-view CT reconstruction on LIDC and LDCT. FISTA-TV is a standard iterative reconstruction method that does not need training. cGAN, Neumann, and SIN- $_ { \mathrm { 4 c } }$ -PRN are supervised learning techniques trained with 23 projection angles.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Projections</td><td colspan="2">LIDC 320× 320</td><td colspan="2">LDCT 512 × 512</td></tr><tr><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>FBP</td><td>23</td><td>10.18±1.38</td><td>0.230±0.072</td><td>10.11±1.19</td><td>0.302±0.078</td></tr><tr><td>FISTA-TV</td><td>23</td><td>20.08±4.89</td><td>0.799±0.061</td><td>21.88±4.42</td><td>0.850±0.067</td></tr><tr><td>cGAN</td><td>23</td><td>19.83±3.07</td><td>0.479±0.103</td><td>19.90±2.52</td><td>0.545±0.065</td></tr><tr><td>Neumann</td><td>23</td><td>17.18±3.79</td><td>0.454±0.128</td><td>18.83±3.29</td><td>0.525±0.073</td></tr><tr><td>SIN-4c-PRN</td><td>23</td><td>30.48±3.99</td><td>0.895±0.047</td><td>34.82±3.55</td><td>0.877±0.116</td></tr><tr><td rowspan="3"> Ours</td><td>10</td><td>29.52±2.63</td><td>0.823±0.061</td><td>28.96±4.41</td><td>0.849±0.086</td></tr><tr><td>20</td><td>34.40±2.66</td><td>0.895±0.048</td><td>36.80±4.50</td><td>0.936±0.058</td></tr><tr><td>23</td><td>35.24±2.71</td><td>0.905±0.046</td><td> 37.41±4.62</td><td>0.941±0.057</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Supervised learning baselines For sparse-view CT on both LIDC and LDCT, we include cGAN (Ghani & Karl, 2018), Neumann (Gilton et al., 2019), and SIN- $_ \mathrm { 4 c }$ -PRN (Wei et al., 2020) as supervised learning baselines. We follow the settings in Wei et al. (2020) and train all methods with 23 projection angles. For MAR, we use cGANMAR (Wang et al., 2018) and SNMAR (Yu et al., 2020) as the baselines. For undersampled MRI on BraTS, we compare against Cascade DenseNet (Zheng et al., 2019) and DuDoRNet (Zhou & Zhou, 2020), which are both trained with a $8 \times$ acceleration factor by measuring only $1 / 8$ of the full $\mathbf { k }$ -space.
|
| 166 |
+
|
| 167 |
+
Unsupervised learning baselines For unsupervised techniques, so far only score-based generative models have witnessed success on clinic data. We compare with several existing methods that apply score-based generative models to inverse problem solving. Specifically, we consider the “Langevin” approach proposed in Jalal et al. (2021), and the “Score SDE” method in Song et al. (2021), where the former is limited to annealed Langevin dynamics (ALD) sampling, and the latter was based on a crude approximation to the conditional score function $\nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } \mid \mathbf { y } )$ in Eq. (4), and was proposed as a theoretical possibility in Appendix I.4 of Song et al. (2021) without experiments. We only focus on undersampled MRI for these baselines, since it is the only medical imaging problem ever tackled with score-based generative models before our work. All methods share the same score models and only differ in terms of inference. We make sure all sampling algorithms have comparable number of iteration steps ( $N$ in Eqs. (5) and (7)).
|
| 168 |
+
|
| 169 |
+
Competing with supervised learning approaches Thanks to the outstanding sample quality of score-based generative models, we can achieve comparable or better performance than best-in-class supervised learning methods even for the same measurement process used in their training. As shown in Table 2, we outperform the top supervised learning technique SIN- $_ { \mathrm { 4 c } }$ -PRN on sparse-view CT reconstruction by a significant margin, on both the LIDC and LDCT datasets. Our results with
|
| 170 |
+
|
| 171 |
+
Table 3: MAR results on LIDC.
|
| 172 |
+
|
| 173 |
+
<table><tr><td>Method</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>LI</td><td>26.30±2.62</td><td>0.910±0.028</td></tr><tr><td>cGANMAR</td><td>27.27±1.96</td><td>0.927±0.060</td></tr><tr><td>SNMAR</td><td>27.28±1.43</td><td>0.937±0.048</td></tr><tr><td>Ours</td><td> 32.16±2.32</td><td>0.939±0.022</td></tr></table>
|
| 174 |
+
|
| 175 |
+
20 measurements are even better than supervised learning counterparts with 23 measurements. In Fig. 4, we provide a visual comparison of the reconstruction quality for various methods, where it is clear to see that our method can recover more details faithfully. From results in Table 3, we also outperform the top supervised learning method SNMAR on metal artifact removal. As shown in Fig. 7, our method generates images with less artifacts and preserves the structure better. For undersampled MRI reconstruction results given in Tables 1 and 3, our method is ranked the 2nd for the case of $8 \times$ acceleration, with comparable performance to the top supervised method DuDoRNet.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 5: Performance vs. numbers of measurements. Shaded areas represent standard deviation. (Left) MRI on BraTS. (Center) CT on LIDC. (Right) Comparing score-based generative models for undersampled MRI reconstruction on BraTS.
|
| 179 |
+
|
| 180 |
+
Generalizing to different number of measurements Since our approach is fully unsupervised, we can naturally apply the same score model to different measurement processes. We first consider changing the number of measurements at the test time, e.g., using different number of projection angles (resp. different acceleration factors) for sparse-view CT (resp. undersampled MRI) reconstruction. As shown in Table 1 and Fig. 5 (Left), we achieve the best performance on undersampled MRI for both $2 4 \times$ and $4 \times$ acceleration factors, whereas DuDoRNet fails to generalize when the acceleration factor changes. The other supervised learning approach Cascade DenseNet demonstrates limited adaptability by building a model architecture inspired by the physical measurement process of MRI, but fails to yield top-level performance. For sparse-view CT reconstruction, all supervised learning methods struggle to generalize to different projection angles, as shown in Fig. 5 (Center).
|
| 181 |
+
|
| 182 |
+
Generalizing to different measurement processes in CT We can perform both sparse-view CT reconstruction and metal artifact removal (MAR) with a single score model trained on CT images. These two tasks are inverse problems in CT imaging with different measurement processes $\pmb { A }$ , but they share the same $\mathbf { T }$ in the decomposition of Proposition 1. We provide a visualization of the measurement process corresponding to MAR in Fig. 8. As shown in Table 3, we can outperform supervised learning techniques specifically designed and trained for MAR, while using the same score model used in sparse-view CT reconstruction on LIDC.
|
| 183 |
+
|
| 184 |
+
Comparing against existing score-based methods We compare our method against Langevin (Jalal et al., 2021) and Score SDE (Song et al., 2021) for undersampled MRI reconstruction on BraTS. Two variants of our approach are considered, which respectively use annealed Langevin dynamics (ALD) and the Predictor-Corrector (PC) sampler for score-based generative models as the backend. We denote the former by $\mathrm { \ddot { \ s u } L D + O u r s { \vec { \nu } } }$ , and the latter by “PC $^ +$ Ours” (our default method for all other experiments). Recall that Langevin uses ALD as the sampler, same as $\mathrm { ^ { 6 6 } A L D + O u r s ^ { 3 7 } }$ . All results are provided in Fig. 5 (Right). We observe that “ALD $^ +$ Ours” uniformly outperform Langevin and Score SDE across all numbers of measurements in the experiment. Moreover, ${ } ^ { \mathrm { s } } \mathrm { P C } +$ Ours” can further improve “ALD $^ +$ Ours”, demonstrating the power of switching to more advanced sampling methods of score-based generative models in our proposed approach.
|
| 185 |
+
|
| 186 |
+
# 5 CONCLUSION
|
| 187 |
+
|
| 188 |
+
We propose a new method to solve linear inverse problems with score-based generative models. Our method is fully unsupervised, requires no paired data for training, can flexibly adapt to different measurement processes at test time, and only requires minimal modifications to a large number of existing sampling methods of score-based generative models. Empirical results demonstrate that our method can match or outperform existing supervised learning counterparts on image reconstruction for sparse-view CT and undersampled MRI, and has better generalization to new measurement processes, such as using a different number of projections or downsampling ratios in CT/MRI, and tackling both sparse-view CT reconstruction and metal artifact removal with a single model.
|
| 189 |
+
|
| 190 |
+
# AUTHOR CONTRIBUTIONS
|
| 191 |
+
|
| 192 |
+
Yang Song designed the project, wrote the paper, and ran all experiments for score-based generative models. Liyue Shen preprocessed data, ran all baseline experiments, and helped write the paper. Lei Xing and Stefano Ermon supervised the project, provided valuable feedback, and helped edit the paper.
|
| 193 |
+
|
| 194 |
+
# ACKNOWLEDGMENTS
|
| 195 |
+
|
| 196 |
+
YS is supported by the Apple PhD Fellowship in AI/ML. LS is supported by the Stanford Bio-X Graduate Student Fellowship. This research was supported by NSF (#1651565, #1522054, #1733686), ONR (N000141912145), AFOSR (FA95501910024), ARO (W911NF-21-1-0125), Sloan Fellowship, and Google TPU Research Cloud. This research was also supported by NIH/NCI (1R01 CA256890 and 1R01 CA227713).
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Vegard Antun, Francesco Renna, Clarice Poon, Ben Adcock, and Anders C Hansen. On instabilities of deep learning in image reconstruction and the potential costs of ai. Proceedings of the National Academy of Sciences, 117(48):30088–30095, 2020.
|
| 201 |
+
|
| 202 |
+
Samuel G Armato III, Geoffrey McLennan, Luc Bidaut, Michael F McNitt-Gray, Charles R Meyer, Anthony P Reeves, Binsheng Zhao, Denise R Aberle, Claudia I Henschke, Eric A Hoffman, et al. The lung image database consortium (lidc) and image database resource initiative (idri): a completed reference database of lung nodules on ct scans. Medical physics, 38(2):915–931, 2011.
|
| 203 |
+
|
| 204 |
+
Spyridon Bakas, Hamed Akbari, Aristeidis Sotiras, Michel Bilello, Martin Rozycki, Justin S Kirby, John B Freymann, Keyvan Farahani, and Christos Davatzikos. Advancing the cancer genome atlas glioma mri collections with expert segmentation labels and radiomic features. Scientific data, 4(1): 1–13, 2017.
|
| 205 |
+
|
| 206 |
+
Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183–202, 2009.
|
| 207 |
+
|
| 208 |
+
Stephen Boyd, Stephen P Boyd, and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 209 |
+
|
| 210 |
+
Thorsten M Buzug. Computed tomography. In Springer handbook of medical technology, pp. 311–342. Springer, 2011.
|
| 211 |
+
|
| 212 |
+
Kenneth Clark, Bruce Vendt, Kirk Smith, John Freymann, Justin Kirby, Paul Koppel, Stephen Moore, Stanley Phillips, David Maffitt, Michael Pringle, et al. The cancer imaging archive (tcia): maintaining and operating a public information repository. Journal of digital imaging, 26(6): 1045–1057, 2013.
|
| 213 |
+
|
| 214 |
+
Prafulla Dhariwal and Alex Nichol. Diffusion models beat GANs on image synthesis. arXiv preprint arXiv:2105.05233, 2021.
|
| 215 |
+
|
| 216 |
+
Muhammad Usman Ghani and W Clem Karl. Deep learning-based sinogram completion for low-dose ct. In 2018 IEEE 13th Image, Video, and Multidimensional Signal Processing Workshop (IVMSP), pp. 1–5. IEEE, 2018.
|
| 217 |
+
|
| 218 |
+
Davis Gilton, Greg Ongie, and Rebecca Willett. Neumann networks for linear inverse problems in imaging. IEEE Transactions on Computational Imaging, 6:328–343, 2019.
|
| 219 |
+
|
| 220 |
+
Kerstin Hammernik, Jo Schlemper, Chen Qin, Jinming Duan, Ronald M Summers, and Daniel Rueckert. Systematic evaluation of iterative deep neural networks for fast parallel mri reconstruction with sensitivity-weighted coil combination. Magnetic Resonance in Medicine, 2021.
|
| 221 |
+
|
| 222 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising Diffusion Probabilistic Models. Advances in Neural Information Processing Systems, 33, 2020.
|
| 223 |
+
|
| 224 |
+
Ajil Jalal, Marius Arvinte, Giannis Daras, Eric Price, Alexandros G Dimakis, and Jonathan I Tamir. Robust compressed sensing mri with deep generative priors. arXiv preprint arXiv:2108.01368, 2021.
|
| 225 |
+
|
| 226 |
+
Zahra Kadkhodaie and Eero P Simoncelli. Solving linear inverse problems using the prior implicit in a denoiser. arXiv preprint arXiv:2007.13640, 2020.
|
| 227 |
+
|
| 228 |
+
Willi A Kalender, Robert Hebel, and Johannes Ebersberger. Reduction of ct artifacts caused by metallic implants. Radiology, 164(2):576–577, 1987.
|
| 229 |
+
|
| 230 |
+
Bahjat Kawar, Gregory Vaksman, and Michael Elad. Snips: Solving noisy inverse problems stochastically. arXiv preprint arXiv:2105.14951, 2021.
|
| 231 |
+
|
| 232 |
+
Daniil Kazantsev and Nicola Wadeson. Tomographic model-based reconstruction (tomobar) software for high resolution synchrotron x-ray tomography. CT Meeting, 2020.
|
| 233 |
+
|
| 234 |
+
Daniil Kazantsev, Edoardo Pasca, Martin J Turner, and Philip J Withers. Ccpi-regularisation toolkit for computed tomographic image reconstruction with proximal splitting algorithms. SoftwareX, 9: 317–323, 2019.
|
| 235 |
+
|
| 236 |
+
Florian Knoll, Jure Zbontar, Anuroop Sriram, Matthew J Muckley, Mary Bruno, Aaron Defazio, Marc Parente, Krzysztof J Geras, Joe Katsnelson, Hersh Chandarana, et al. fastmri: A publicly available raw $\mathbf { k }$ -space and dicom dataset of knee images for accelerated mr image reconstruction using machine learning. Radiology: Artificial Intelligence, 2(1):e190007, 2020.
|
| 237 |
+
|
| 238 |
+
Morteza Mardani, Enhao Gong, Joseph Y Cheng, Shreyas Vasanawala, Greg Zaharchuk, Marcus Alley, Neil Thakur, Song Han, William Dally, John M Pauly, et al. Deep generative adversarial networks for compressed sensing automates mri. arXiv preprint arXiv:1706.00051, 2017.
|
| 239 |
+
|
| 240 |
+
Bjoern H Menze, Andras Jakab, Stefan Bauer, Jayashree Kalpathy-Cramer, Keyvan Farahani, Justin Kirby, Yuliya Burren, Nicole Porz, Johannes Slotboom, Roland Wiest, et al. The multimodal brain tumor image segmentation benchmark (brats). IEEE transactions on medical imaging, 34(10): 1993–2024, 2014.
|
| 241 |
+
|
| 242 |
+
Taylor R Moen, Baiyu Chen, David R Holmes III, Xinhui Duan, Zhicong Yu, Lifeng Yu, Shuai Leng, Joel G Fletcher, and Cynthia H McCollough. Low-dose ct image and projection dataset. Medical physics, 48(2):902–911, 2021.
|
| 243 |
+
|
| 244 |
+
Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2003.
|
| 245 |
+
|
| 246 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8024–8035. Curran Associates, Inc., 2019.
|
| 247 |
+
|
| 248 |
+
Matteo Ronchetti. Torchradon: Fast differentiable routines for computed tomography. arXiv preprint arXiv:2009.14788, 2020.
|
| 249 |
+
|
| 250 |
+
Simo Särkkä and Arno Solin. Applied stochastic differential equations, volume 10. Cambridge University Press, 2019.
|
| 251 |
+
|
| 252 |
+
Liyue Shen, Wei Zhao, and Lei Xing. Patient-specific reconstruction of volumetric computed tomography images from a single projection view via deep learning. Nature biomedical engineering, 3(11):880–888, 2019.
|
| 253 |
+
|
| 254 |
+
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11918–11930, 2019.
|
| 255 |
+
|
| 256 |
+
Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 257 |
+
|
| 258 |
+
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. URL https://openreview.net/forum? id=PxTIG12RRHS.
|
| 259 |
+
|
| 260 |
+
Pascal Vincent. A Connection Between Score Matching and Denoising Autoencoders. Neural Computation, 23(7):1661–1674, 2011.
|
| 261 |
+
|
| 262 |
+
Marinus T Vlaardingerbroek and Jacques A Boer. Magnetic resonance imaging: theory and practice. Springer Science & Business Media, 2013.
|
| 263 |
+
|
| 264 |
+
Jianing Wang, Yiyuan Zhao, Jack H Noble, and Benoit M Dawant. Conditional generative adversarial networks for metal artifact reduction in ct images of the ear. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 3–11. Springer, 2018.
|
| 265 |
+
|
| 266 |
+
Haoyu Wei, Florian Schiffers, Tobias Würfl, Daming Shen, Daniel Kim, Aggelos K Katsaggelos, and Oliver Cossairt. 2-step sparse-view ct reconstruction with a domain-specific perceptual network. arXiv preprint arXiv:2012.04743, 2020.
|
| 267 |
+
|
| 268 |
+
Tobias Würfl, Mathis Hoffmann, Vincent Christlein, Katharina Breininger, Yixin Huang, Mathias Unberath, and Andreas K Maier. Deep learning computed tomography: Learning projectiondomain weights from image domain in limited angle problems. IEEE transactions on medical imaging, 37(6):1454–1463, 2018.
|
| 269 |
+
|
| 270 |
+
Lequan Yu, Zhicheng Zhang, Xiaomeng Li, and Lei Xing. Deep sinogram completion with image prior for metal artifact reduction in ct images. IEEE Transactions on Medical Imaging, 40(1): 228–238, 2020.
|
| 271 |
+
|
| 272 |
+
Jure Zbontar, Florian Knoll, Anuroop Sriram, Tullie Murrell, Zhengnan Huang, Matthew J. Muckley, Aaron Defazio, Ruben Stern, Patricia Johnson, Mary Bruno, Marc Parente, Krzysztof J. Geras, Joe Katsnelson, Hersh Chandarana, Zizhao Zhang, Michal Drozdzal, Adriana Romero, Michael Rabbat, Pascal Vincent, Nafissa Yakubova, James Pinkerton, Duo Wang, Erich Owens, C. Lawrence Zitnick, Michael P. Recht, Daniel K. Sodickson, and Yvonne W. Lui. fastMRI: An open dataset and benchmarks for accelerated MRI. 2018.
|
| 273 |
+
|
| 274 |
+
Hao Zheng, Faming Fang, and Guixu Zhang. Cascaded dilated dense network with two-step data consistency for mri reconstruction. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/ file/1e48c4420b7073bc11916c6c1de226bb-Paper.pdf.
|
| 275 |
+
|
| 276 |
+
Bo Zhou and S Kevin Zhou. Dudornet: Learning a dual-domain recurrent network for fast mri reconstruction with deep t1 prior. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4273–4282, 2020.
|
| 277 |
+
|
| 278 |
+
Bo Zhu, Jeremiah Z Liu, Stephen F Cauley, Bruce R Rosen, and Matthew S Rosen. Image reconstruction by domain-transform manifold learning. Nature, 555(7697):487–492, 2018.
|
| 279 |
+
|
| 280 |
+
# A PROOFS
|
| 281 |
+
|
| 282 |
+
Proposition 1. $I f \operatorname { r a n k } ( A ) = m$ , then there exist an invertible matrix $\pmb { T } \in \mathbb { R } ^ { n \times n }$ , and a diagonal matrix $\pmb { \Lambda } \in \{ 0 , 1 \} ^ { n \times n }$ with $\operatorname { t r } ( \mathbf { \mathbf { \boldsymbol { \Lambda } } } ) = m$ , such that $A = \mathcal { P } ( \mathbf { \boldsymbol { \Lambda } } ) \mathbf { \boldsymbol { T } }$ . Here $\mathcal { P } ( \mathbf { A } ) \in \{ 0 , 1 \} ^ { m \times n }$ is an operator that, when multiplied with any vector $\mathbf { \pmb { a } } \in \mathbb { R } ^ { n }$ , reduces its dimensionality to m by removing each $i$ -th element of $\textbf { \em a }$ for $i = 1 , 2 , \cdots , n$ if $\mathbf { \Lambda } \Lambda _ { i i } = 0$ .
|
| 283 |
+
|
| 284 |
+
Proof. Let $\textbf { \textit { A } } = \mathbf { \beta } \left( \pmb { a } _ { 1 } ^ { \mathsf { T } } , \pmb { a } _ { 2 } ^ { \mathsf { T } } , \cdot \cdot \cdot , \pmb { a } _ { m } ^ { \mathsf { T } } \right) \ \in \ \mathbb { R } ^ { m \times n }$ . Since $\pmb { A }$ has full rank, the row vectors $\{ a _ { 1 } , a _ { 2 } , \cdots , a _ { m } \}$ are linearly independent. We can therefore extend them to a total of $n$ linearly independent vectors, i.e., $\{ a _ { 1 } , \dotsc , a _ { 2 } , \dotsc , a _ { m } , b _ { 1 } , \dotsc , b _ { n - m } \}$ . Due to the linear independence, we know $\pmb { T } = ( \pmb { a } _ { 1 } ^ { \top } , \pmb { a } _ { 2 } ^ { \top } , \cdot \cdot \cdot , \pmb { a } _ { m } ^ { \top } , \pmb { b } _ { 1 } ^ { \top } , \cdot \cdot \cdot , \pmb { b } _ { n - m } ^ { \top } ) \in \mathbb { R } ^ { n \times n }$ has full rank and is invertible. Next, we define
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\pmb { \Lambda } = \mathrm { d i a g } ( \underbrace { 1 , 1 , \cdots , 1 } _ { m } , \underbrace { 0 , 0 , \cdots , 0 } _ { n - m } ) ,
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
where diag converts a vector to a diagonal matrix. Clearly $\operatorname { t r } ( \mathbf { \mathbf { \boldsymbol { \Lambda } } } ) = m$ and $A = \mathcal { P } ( \mathbf { \boldsymbol { \Lambda } } ) \mathbf { \boldsymbol { T } }$ , which completes the proof. □
|
| 291 |
+
|
| 292 |
+
Lemma 1. Let $\mathcal { P } ^ { - 1 } ( \pmb { \Lambda } ) : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ be any right inverse of $\mathcal { P } ( \mathbf { A } ) : \mathbb { R } ^ { n } \mathbb { R } ^ { m }$ . For any $\pmb { u } \in \mathbb { R } ^ { n }$ and $\hat { \mathbf { y } } _ { t } \in \mathbb { R } ^ { m }$ , we have
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\mathcal { P } ( \Lambda ) \pmb { T } \pmb { u } = \hat { \mathbf { y } } _ { t } \iff \Lambda \pmb { T } \pmb { u } = \Lambda \mathcal { P } ^ { - 1 } ( \pmb { \Lambda } ) \hat { \mathbf { y } } _ { t }
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Proof. By the definition of ${ \mathcal { P } } ( \Lambda )$ , we have $\mathcal { P } ( \mathbf { \boldsymbol { \Lambda } } ) = \mathcal { P } ( \mathbf { \boldsymbol { \Lambda } } ) \mathbf { \boldsymbol { \Lambda } }$ , and
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\forall a \in \mathbb { R } ^ { n } , b \in \mathbb { R } ^ { n } : \quad \mathcal { P } ( \Lambda ) a = \mathcal { P } ( \Lambda ) b \iff \Lambda a = \Lambda b .
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
To prove the “if” direction, we note that
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { r l } & { \Lambda T u = \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } \implies \mathcal { P } ( \Lambda ) \Lambda T u = \mathcal { P } ( \Lambda ) \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } } \\ & { \implies \mathcal { P } ( \Lambda ) T u = \mathcal { P } ( \Lambda ) \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } } \\ & { \implies \mathcal { P } ( \Lambda ) T u = \hat { \mathbf { y } } _ { t } . } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
To prove the “only if” direction, we have
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { r } { \begin{array} { r } { \mathcal { P } ( \Lambda ) \pmb { T } \pmb { u } = \hat { \mathbf { y } } _ { t } \implies \mathcal { P } ( \Lambda ) \pmb { T } \pmb { u } = \mathcal { P } ( \Lambda ) \mathcal { P } ^ { - 1 } ( \pmb { \Lambda } ) \hat { \mathbf { y } } _ { t } } \\ { \overset { ( i ) } { \implies } \pmb { \Lambda } \pmb { T } \pmb { u } = \pmb { \Lambda } \mathcal { P } ^ { - 1 } ( \pmb { \Lambda } ) \hat { \mathbf { y } } _ { t } , } \end{array} } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
where (i) is due to the property in Eq. (10). This completes the proof for both directions.
|
| 317 |
+
|
| 318 |
+
Theorem 1. The solution of Eq. (8) can be given by
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\hat { \mathbf { x } } _ { t _ { i } } ^ { \prime } = \pmb { T } ^ { - 1 } [ \lambda \pmb { \Lambda } \mathcal { P } ^ { - 1 } ( \pmb { \Lambda } ) \hat { \mathbf { y } } _ { t _ { i } } + ( 1 - \lambda ) \pmb { \Lambda } \pmb { T } \hat { \mathbf { x } } _ { t _ { i } } + ( \pmb { I } - \pmb { \Lambda } ) \pmb { T } \hat { \mathbf { x } } _ { t _ { i } } ] ,
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
where $\mathcal { P } ^ { - 1 } ( \mathbf { \Lambda } ) : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ denotes any right inverse of ${ \mathcal { P } } ( \Lambda )$ .
|
| 325 |
+
|
| 326 |
+
Proof. The optimization objective function in Eq. (8) can be written as
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { r l } & { \quad ( 1 - \lambda ) \left\| z - \hat { \mathbf { x } } _ { t } \right\| _ { T } ^ { 2 } + \lambda \left\| z - u \right\| _ { T } ^ { 2 } } \\ & { = ( 1 - \lambda ) \left\| T z - T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| T z - T u \right\| _ { 2 } ^ { 2 } } \\ & { = ( 1 - \lambda ) \left\| T z - T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| \Lambda T ( z - u ) + ( I - \Lambda ) T ( z - u ) \right\| _ { 2 } ^ { 2 } } \\ & { = ( 1 - \lambda ) \left\| T z - T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| \Lambda T ( z - u ) \right\| _ { 2 } ^ { 2 } + \lambda \left\| ( I - \Lambda ) T ( z - u ) \right\| _ { 2 } ^ { 2 } } \\ & { = ( 1 - \lambda ) \left\| T z - T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| \Lambda T z - \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| ( I - \Lambda ) T ( z - u ) \right\| _ { 2 } ^ { 2 } } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 6: SSIM vs. numbers of measurements. Shaded areas represent standard deviation. (Left) MRI on BraTS. (Center) CT on LIDC. (Right) Comparing score-based generative models for undersampled MRI reconstruction on BraTS.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 7: Examples of metal artifact removal on LIDC. You may zoom in to view more details.
|
| 337 |
+
|
| 338 |
+
Since $\mathbf { \nabla } A \mathbf { u } = \hat { \mathbf { y } } _ { t }$ , we have $\mathcal { P } ( \mathbf { A } ) \pmb { T } \pmb { u } = \hat { \mathbf { y } } _ { t }$ and equivalently $\Lambda T u = \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t }$ due to Lemma 1. This constraint does not restrict the value of $( I - \Lambda ) T u$ . Therefore, when $\mathbf { \nabla } A \mathbf { u } = \hat { \mathbf { y } } _ { t }$ , we have
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\begin{array} { r l } & { \quad \left\| z - \dot { \mathbf { x } } _ { t } \right\| _ { T } ^ { 2 } + \operatorname* { m i n } ( 1 - \lambda ) \lambda \left\| z - u \right\| _ { T } ^ { 2 } } \\ & { = ( 1 - \lambda ) \left\| T z - T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \operatorname* { m i n } \lambda \left\| \Lambda T z - \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| ( I - \Lambda ) T ( z - u ) \right\| _ { 2 } ^ { 2 } } \\ & { - ( 1 - \lambda ) \left\| T z - T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| \Lambda T z - \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } \right\| _ { 2 } ^ { 2 } } \\ & { = ( 1 - \lambda ) \left\| \Lambda T z - \Lambda T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| \Lambda T z - \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } \right\| _ { 2 } ^ { 2 } + ( 1 - \lambda ) \left\| ( I - \Lambda ) T z - ( I - \Lambda ) T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } } \end{array}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
This simplifies the optimization problem in Eq. (8) to
|
| 345 |
+
|
| 346 |
+
$\operatorname* { n i n } _ { z } ( 1 - \lambda ) \left\| \Lambda T z - \Lambda T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda \left\| \Lambda T z - \Lambda \mathcal { P } ^ { - 1 } ( \Lambda ) \hat { \mathbf { y } } _ { t } \right\| _ { 2 } ^ { 2 } + ( 1 - \lambda ) \left\| ( I - \Lambda ) T z - ( I - \Lambda ) T \hat { \mathbf { x } } _ { t } \right\| _ { 2 } ^ { 2 } ,$ k 22 , which is minimizing a quadratic function of $_ z$ . The optimal solution $z ^ { * }$ is thus in closed form:
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { r } { z ^ { * } = \pmb { T } ^ { - 1 } [ ( \pmb { I } - \pmb { \Lambda } ) \pmb { T } \hat { \mathbf { x } } _ { t } + ( 1 - \lambda ) \pmb { \Lambda } \pmb { T } \hat { \mathbf { x } } _ { t } + \lambda \pmb { \Lambda } \pmb { \mathcal { P } } ^ { - 1 } ( \pmb { \Lambda } ) \hat { \mathbf { y } } _ { t } ] . } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
According to the definition, $\hat { \mathbf { x } } _ { t } ^ { \prime } = z ^ { * }$ , whereby the proof is completed.
|
| 353 |
+
|
| 354 |
+
# B ADDITIONAL EXPERIMENTAL DETAILS
|
| 355 |
+
|
| 356 |
+
# B.1 ADDITIONAL RESULTS
|
| 357 |
+
|
| 358 |
+
In Fig. 6, we provide SSIM results versus the number of measurements for multiple methods and tasks. In general, the SSIM curves have very similar trends to the PSNR curves in Fig. 5. We additionally provide a visualization of metal artifact removal results in Fig. 7.
|
| 359 |
+
|
| 360 |
+
# B.2 THE TASK OF METAL ARTIFACT REMOVAL
|
| 361 |
+
|
| 362 |
+
Metallic implants in an object can cause strong metal artifacts in CT imaging. As shown in Fig. 8, the source of artifacts come from extremely bright regions in the sinogram, called metal traces. To reduce or ideally remove metal artifacts from a CT image, we remove metal traces from the sinogram and leverage the data prior to complete the sinogram. As a result, metal artifact removal can be viewed as an inverse problem, where the measurement process gives the full sinogram except for the metal trace region, and our goal is to reconstruct the full CT image using this partially known sinogram, which will be artifact-free assuming perfect inpainting of the sinogram.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 8: The linear measurement process of metal artifact removal.
|
| 366 |
+
|
| 367 |
+
# B.3 DETAILS OF DATASETS
|
| 368 |
+
|
| 369 |
+
CT datasets We conduct experiments of 2D CT image reconstruction on two datasets. First, the Lung Image Database Consortium image collection (LIDC) (Armato III et al., 2011; Clark et al., 2013) consists of diagnostic and lung cancer screening thoracic computed tomography (CT) scans for lung cancer detection and diagnosis, which contains 1018 cases. Second, the Low Dose CT Image and Projection dataset (LDCT) (Clark et al., 2013; Moen et al., 2021) involves CT images of multiple anatomic sites, including 99 head CT scans, 100 chest CT scans, and 100 abdomen CT scans. Note that for the LDCT dataset, we only use the full-dose CT images in our experiments. In CT image processing, we convert the Hounsfield units from dicom files to the attenuation coefficients and set the background pixels to zero. Then, 2D CT images are sliced from 3D CT volumes. The sinograms are simulated from 2D CT images based on parallel-beam geometry with different number of projection angles that are equally distributed across 180 degrees.
|
| 370 |
+
|
| 371 |
+
MRI dataset The Brain Tumor Segmentation (BraTS) 2021 dataset (Menze et al., 2014; Bakas et al., 2017) collected for the image segmentation challenge contains 2000 cases (8000 MRI scans), where each case has four different MR contrasts: native (T1), post-contrast T1-weighted (T1Gd), T2-weighted (T2), and T2 Fluid Attenuated Inversion Recovery (T2-FLAIR). For each 3D MR volume, we extract 2D slices from 3D volumes and simulate k-space data by Fast Fourier Transform. To reconstruct MR images, we follow Knoll et al. (2020); Zbontar et al. (2018) to undersample $\mathbf { k }$ -space data with an equispaced Cartesian mask, where the center k-space is fully sampled while the left $\mathbf { k }$ -space is under-sampled by equispaced columns.
|
| 372 |
+
|
| 373 |
+
# B.4 DETAILS OF SCORE-BASED GENERATIVE MODELS
|
| 374 |
+
|
| 375 |
+
We use the ${ \mathrm { N C S N } } { + + }$ model architecture in Song et al. (2021), and perturb the data with the Variance Exploding (VE) SDE. Our training procedure follows that of Song et al. (2021). Instead of generating samples according to the numerical SDE solver in Algorithm 1, we use the Predictor-Corrector (PC) sampler as described in Song et al. (2021) since it generally has better performance for VE SDEs. In PC samplers, the predictor refers to a numerical solver for the reverse-time SDE while the corrector can be any Markov chain Monte Carlo (MCMC) method that only depends on the scores. One such MCMC method considered in this work is Langevin dynamics, whereby we transform any initial sample $\mathbf { x } ^ { ( 0 ) }$ to an approximate sample from $p _ { t } ( \mathbf { x } )$ via the following procedure:
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r } { \mathbf { x } ^ { ( i + 1 ) } \gets \mathbf { x } ^ { ( i ) } + \epsilon \nabla _ { \mathbf { x } } \log p _ { t } ( \mathbf { x } ^ { ( i ) } ) + \sqrt { 2 \epsilon } \mathbf { z } ^ { ( i ) } , \quad i = 0 , 1 , \cdots , N - 1 . } \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
Here $N \in \mathbb { N } _ { > 0 } , \epsilon > 0$ , and $\mathbf { z } ^ { ( i ) } \sim \mathcal { N } ( \mathbf { 0 } , I )$ . The theory of Langevin dynamics guarantees that in the limit of $N \infty$ and $\epsilon \to 0 , \mathbf { x } ^ { ( N ) }$ is a sample from $p _ { t } ( \mathbf { x } )$ under some regularity conditions. Note that Langevin dynamics only requires the knowledge of $\nabla _ { \mathbf { x } } \log p _ { t } ( \mathbf { x } )$ , which can be approximated using the time-dependent score model $s \mathbf { \boldsymbol { \theta } } \ast \left( \mathbf { \boldsymbol { x } } , t \right)$ . In PC samplers, each predictor step immediately follows multiple consecutive corrector steps, all using the same $s _ { \theta ^ { * } } ( \mathbf { x } , t )$ evaluated at the same $t$ . This jointly ensures that our intermediate sample at $t$ is approximately distributed according to $p _ { t } ( \mathbf { x } )$ . As shown in Song et al. (2021), PC sampling often outperforms numerical solvers for the reverse-time SDE, especially when the forward SDE in Eq. (1) is a VE SDE. In order to use PC samplers for inverse problem solving, our modification is similar to the change made in Algorithm 2 for Algorithm 1. Specifically, we run line 4 & 5 in Algorithm 2 before every corrector or predictor step.
|
| 382 |
+
|
| 383 |
+
When comparing our approach to previous methods with score-based generative models, we use the same score model to isolate the confounding factors in model training and architecture design. Moreover, we make sure the total cost of sampling is comparable across different methods. For the ALD sampler used in Jalal et al. (2021), we use 700 noise scales with 3 steps of Langevin dynamics per noise scale, resulting in a total of $7 0 0 \times 3 = 2 1 0 0$ steps that require score function evaluation. For the PC sampler, we use 1000 noise scales and 1 step of Langevin dynamics per noise scale, totalling $1 0 0 0 + 1 0 0 0 = 2 0 0 0$ steps of score model evaluation.
|
| 384 |
+
|
| 385 |
+
For PC samplers, the step size $\epsilon$ in Langevin dynamics is determined by a signal-to-noise ratio $\eta$ . For all methods, we tune $\eta$ and $\lambda$ in Eq. (8) with 100 steps of Bayesian optimization on a validation dataset, and report the results on the test dataset with the optimal parameters. We use the $\mathsf { a x } - \mathsf { p } \bot$ atform toolkit for Bayesian optimization. The optimal parameters in our experiments are given by
|
| 386 |
+
|
| 387 |
+
• Sparse-view CT on LIDC $3 2 0 \times 3 2 0$ : $\eta = 0 . 2 4 6$ , $\lambda = 0 . 8 4 1$ .
|
| 388 |
+
• Metal artifact removal on LIDC $3 2 0 \times 3 2 0$ : $\eta = 0 . 2 0 9$ , $\lambda = 0 . 2 2 7$ .
|
| 389 |
+
• Sparse-view CT on LDCT $5 1 2 \times 5 1 2$ : $\eta = 0 . 4 , \lambda = 0 . 7 2$ .
|
| 390 |
+
• Accelerated MRI on BraTS $2 4 0 \times 2 4 0$ : $\eta = 0 . 5 7 7$ , $\lambda = 0 . 9 8 2$ .
|
| 391 |
+
|
| 392 |
+
B.5 TRAINING DETAILS OF BASELINE MODELS
|
| 393 |
+
|
| 394 |
+
B.5.1 BASELINE MODELS FOR SPARSE-VIEW CT RECONSTRUCTION
|
| 395 |
+
|
| 396 |
+
FBP Filtered back projection (FBP) is a standard way for CT image reconstruction, which simply put the projections (sinogram) back to the image space based on the corresponding projection angles and geometry to get an approximated estimation of the unknown image. Usually, a high-pass filter, ramp filter is used to eliminate the blurring during this process. In our experiments, we conduct FBP on sparse-view sinograms using the torch radon toolbox (Ronchetti, 2020).
|
| 397 |
+
|
| 398 |
+
FISTA-TV FISTA-TV is a fast iterative shrinkage-thresholding algorithm (FISTA) for solving linear inverse problems in image processing (Beck & Teboulle, 2009). It adopts a total variation (TV) term as the regularization in the optimization procedure. Each optimization iteration involves a matrixvector multiplication followed by a shrinkage-threshold step. In experiments, FISTA is implemented using the tomobar toolbox (Kazantsev & Wadeson, 2020) with the regularization using the CCPi regularisation toolkit (Kazantsev et al., 2019). We run 300 iterations for reconstructing each CT image with regularization parameter 0.001. Considering the nature of iterative reconstruction in FISTA, it is quite natural to generalize this method to different number of projections for reconstructing CT images. In experiments of generalizing to different number of measurements, FISTA method takes as input the sinogram with different numbers of projections and the corresponding angles for these input projections for the iterative procedure.
|
| 399 |
+
|
| 400 |
+
cGAN Conventional iterative CT reconstruction algorithms like FISTA are typically slow due to their iterative nature. Ghani & Karl (2018) proposed to cast sparse-view CT reconstruction as a sinogram inpainting problem. Specifically, it used a conditional generative adversarial network (cGAN) to first complete the sinogram data prior to reconstructing CT images, thereby avoiding the costly iterative tomographic processing. However, the imperfect sinogram inpainting may further cause image artifacts. Specifically, cGAN model takes zero-padded sparse-view sinogram with 23 projections as input and generates the completed full-angle sinogram with 180 projections. The cGAN model was implemented using PyTorch (Paszke et al., 2019) and trained using a batchsize of 64 and learning rate of 0.0001 with 50 epochs in total. In experiments of generalizing to different number of measurements, we deployed the trained cGAN model by zero-padding sparse-view sinogram with different numbers of projections to full-view sinogram as the input. After obtaining the output inpainted sinogram, we replace the corresponding projections in the output based on the ground truth projections in the input. Finally, the images were reconstructed from the overlayed sinogram. Note that we trained the model using 23 projections and tested it on other projection settings to evaluate the generalization.
|
| 401 |
+
|
| 402 |
+
SIN- $\mathbf { 4 c }$ -PRN To further reduce the artifacts in both sinogram and image space, SIN- $. 4 \mathrm { c }$ -PRN (Wei et al., 2020) proposed a two-step sparse-view CT reconstruction model. It involves a sinogram inpainting network (SIN) to generate super-resolved sinograms with different number of projections, and then a post-processing refining network (PRN) to further remove image artifacts. Both networks are connected through a filtered back-projection operation (FBP). Specifically, SIN model takes 23- view sinogram as input to fistly upsample to full-view sinogram and then generate sinograms through network for 23, 45, 90, 180 projections respectively. FBP transforms these generated sinograms to image space, which was then concatenated and feed into PRN model for refinement. The framework was implemented using PyTorch (Paszke et al., 2019) while FBP operation was implemented using . SIN model was trained using a batchsize of 20 and learning rate of 0.0001, while PRN model was trained using a batchsize of 15 and learning rate of 0.0001. Considering that LIDC dataset is much larger than LDCT dataset, the SIN- $_ { \cdot 4 \mathrm { c } }$ -PRN model was trained for 30 epochs on LIDC dataset and 50 epochs on LDCT dataset. To deploy the trained SIN model to different numbers of measurements, the sinograms with various number of projections are taken as the input for SIN model to generate multi-view sinograms, which were also overlayed with corresponding ground truth projections in inputs. The generated multi-view sinograms are then used for PRN model inference. Since SIN- $_ \mathrm { 4 c }$ -PRN model involves the dual-domain learning in both sinogram and image spaces to remove artifacts, and generates multi-scale sinograms during sinogram inpainting, it shows a better generalization to different numbers of measurements compared with cGAN model as shown in Figure 5 and Figure 6.
|
| 403 |
+
|
| 404 |
+
Neumann Meanwhile, in another parallel direction, researchers proposed to learn the regularizer used in optimization from training data, outperforming traditional regularizers. Specifically, Gilton et al. (2019) presented an end-to-end, data-driven method for learning a nonlinear regularizer for solving inverse problems inspired by the Neumann series, called Neumann network. Neumann network was implemented using PyTorch (Paszke et al., 2019). Due to GPU memory constraints, the model training used the batchsize of 5 on LIDC dataset and the batchsize of 2 on LDCT dataset. The initial learning rate was 0.00001 with an exponential learning rate decay. The network was trained with 15 training epochs on both datasets.
|
| 405 |
+
|
| 406 |
+
# B.5.2 BASELINE MODELS FOR UNDERSAMPLED MRI RECONSTRUCTION
|
| 407 |
+
|
| 408 |
+
DuDoRNet Zhou & Zhou (2020) proposed a dual domain recurrent network (DuDoRNet) to simultaneously recover k-space data and images for MRI reconstruction, in order to address aliasing artifacts in both frequency and image domains. The original model in Zhou & Zhou (2020) also embedded a deep T1 prior to make use of fully-sampled short protocol (T1) as complementary information. For a fair comparison with other supervised learning approaches, in our experiments, we do not include this additional information but train the DuDoRNet model without T1 prior. The DuDoRNet was trained using a batchsize of 6 and a learning rate of 0.0005 with 5 training epochs. In experiments of generalizing to different number of measurements, we trained the model with an acceleration factor of 8 and deployed the trained model to other acceleration factors during testing. Specifically, for inference, we use different Cartesian masking function corresponding to different acceleration factors or down-sampling ratios to sub-sample the $\mathbf { k }$ -space data for the network input with the corresponding initial reconstructed image with zero-padding $\mathbf { k }$ -space.
|
| 409 |
+
|
| 410 |
+
Cascade DenseNet To reconstruct de-aliased MR images from under-sampled k-space data, Zheng et al. (2019) proposed a cascaded dilated dense network (CDDN) for MRI reconstruction, based on stacked dense blocks with residual connections while using the zero-filled MR image as inputs. Specifically, they used a two-step data consistency layer for k-space correction, and replaced corresponding phase-coding lines of the generated image with the original sampled k-space data after each block. In experiments, we trained the model using a batchsize of 8 and a learning rate of 0.0001, with 5 epochs on BraTS dataset. In experiments of generalizing to different number of measurements, we trained the model with an acceleration factor of 8 and deployed the trained model to other acceleration factors during testing. Similarly, different masking functions corresponding to different acceleration factors were used to sub-sample $\mathbf { k }$ -space data to get network inputs. From results, we observe that
|
| 411 |
+
|
| 412 |
+
Cascaded DenseNet generalizes better to more measurements than DuDoRNet as shown in Figure 5 and Figure 6.
|
| 413 |
+
|
| 414 |
+
# B.5.3 BASELINE MODELS FOR METAL ARTIFACT REMOVAL
|
| 415 |
+
|
| 416 |
+
LI One straightforward way for reducing metal artifacts is to complete or inpaint the metal-affected missing regions in sinogram directly through linear interpolation (Kalender et al., 1987). This method does not need any network training. However, the imperfect completion of sinogram may introduce secondary artifacts to the reconstructed image. In our experiments setting, to fit for the practical applications in real world, we assume the ground truth metal trace and mask information are unknown, which can only be estimated by a rough thresholding in artifacts-affected images. We use the estimated metal mask and metal trace for linear interpolation baseline.
|
| 417 |
+
|
| 418 |
+
cGANMAR Wang et al. (2018) proposed a conditional generative adversarial network (cGAN)- based approach for metal artifacts reduction (MAR) in CT. Specifically, cGANMAR network learns the mapping directly from the artifacts-affected CTs to artifacts-free CTs through refinement in image space. The cGANMAR model was implemented using PyTorch (Paszke et al., 2019) and was trained with the batchsize of 64 and the learning rate of 0.0001. The network was trained with 400 epochs.
|
| 419 |
+
|
| 420 |
+
SNMAR Yu et al. (2020) proposed a sinogram completion neural network (SinoNet) to recover the metal-affected projections. Especially, it leveraged the learning in both sinogram domain and image domain by using a prior network to generate a good prior image to guide sinogram learning. Note that in original setting, SNMAR required linear interpolated sinogram and CT as inputs and used ground truth metal trace and mask information to generated them. But in our method, we assume the ground truth metal trace and mask information are unknown according to practical scenario and estimate it by a rough thresholding, which will introduce estimation errors. In SNMAR experiments, we still follow the original setting to guarantee the best performance of this baseline method for a strong comparison. We trained the SNMAR using the batchsize of 64 and the learning rate of 0.0001, with a total of 100 training epochs.
|
md/dev/vfsRB5MImo9/vfsRB5MImo9.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/w0H2xGHlkw/w0H2xGHlkw.md
ADDED
|
@@ -0,0 +1,570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Visual Instruction Tuning
|
| 2 |
+
|
| 3 |
+
Haotian $\mathbf { L i u ^ { 1 * } }$ , Chunyuan $\mathbf { L i ^ { 2 * } }$ , Qingyang ${ \bf W } { \bf u } ^ { 3 }$ , Yong Jae Lee1 1University of Wisconsin–Madison 2Microsoft Research 3Columbia University https://llava-vl.github.io
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Instruction tuning large language models (LLMs) using machine-generated instruction-following data has been shown to improve zero-shot capabilities on new tasks, but the idea is less explored in the multimodal field. We present the first attempt to use language-only GPT-4 to generate multimodal language-image instruction-following data. By instruction tuning on such generated data, we introduce LLaVA: Large Language and Vision Assistant, an end-to-end trained large multimodal model that connects a vision encoder and an LLM for generalpurpose visual and language understanding. To facilitate future research on visual instruction following, we construct two evaluation benchmarks with diverse and challenging application-oriented tasks. Our experiments show that LLaVA demonstrates impressive multimodal chat abilities, sometimes exhibiting the behaviors of multimodal GPT-4 on unseen images/instructions, and yields a $8 5 . 1 \%$ relative score compared with GPT-4 on a synthetic multimodal instruction-following dataset. When fine-tuned on Science QA, the synergy of LLaVA and GPT-4 achieves a new state-of-the-art accuracy of $9 2 . 5 3 \%$ . We make GPT-4 generated visual instruction tuning data, our model, and code publicly available.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Humans interact with the world through many channels such as vision and language, as each individual channel has a unique advantage in representing and communicating certain concepts, and thus facilitates a better understanding of the world. One of the core aspirations in artificial intelligence is to develop a general-purpose assistant that can effectively follow multi-modal vision-and-language instructions, aligned with human intent to complete various real-world tasks in the wild [4, 26].
|
| 12 |
+
|
| 13 |
+
To this end, the community has witnessed an emergent interest in developing language-augmented foundation vision models [26, 16], with strong capabilities in open-world visual understanding such as classification [39, 21, 56, 53, 38], detection [28, 61, 32], segmentation [25, 62, 57] and captioning [49, 27], as well as visual generation and editing [41, 42, 55, 15, 43, 29]. We refer readers to the Computer Vision in the Wild reading list for a more up-to-date literature compilation [12]. In this line of work, each task is solved independently by one single large vision model, with the task instruction implicitly considered in the model design. Further, language is only utilized to describe the image content. While this allows language to play an important role in mapping visual signals to language semantics—a common channel for human communication, it leads to models that usually have a fixed interface with limited interactivity and adaptability to the user’s instructions.
|
| 14 |
+
|
| 15 |
+
Large language models (LLM), on the other hand, have shown that language can play a wider role: a universal interface for a general-purpose assistant, where various task instructions can be explicitly represented in language and guide the end-to-end trained neural assistant to switch to the task of interest to solve it. For example, the recent success of ChatGPT [34] and GPT-4 [35] have demonstrated the power of aligned LLMs in following human instructions, and have stimulated tremendous interest in developing open-source LLMs. Among them, LLaMA [48] is an opensource LLM that matches the performance of GPT-3. Alpaca [47], Vicuna [9], GPT-4-LLM [37] utilize various machine-generated high-quality instruction-following samples to improve the LLM’s alignment ability, reporting impressive performance compared with proprietary LLMs. Importantly, this line of work is text-only.
|
| 16 |
+
|
| 17 |
+
In this paper, we present visual instruction-tuning, the first attempt to extend instruction-tuning to the language-image multimodal space, to pave the way towards building a general-purpose visual assistant. In particular, our paper makes the following contributions:
|
| 18 |
+
|
| 19 |
+
• Multimodal instruction-following data. One key challenge is the lack of vision-language instruction-following data. We present a data reformation perspective and pipeline to convert image-text pairs into an appropriate instruction-following format, using ChatGPT/GPT-4. Large multimodal models. We develop a large multimodal model (LMM), by connecting the open-set visual encoder of CLIP [39] with the language decoder Vicuna [9], and fine-tuning end-to-end on our generated instructional vision-language data. Our empirical study validates the effectiveness of using generated data for LMM instruction-tuning, and suggests practical tips for building a general-purpose instruction-following visual agent. When ensembled with GPT-4, our approach achieves SoTA on the Science QA [33] multimodal reasoning dataset. • Multimodal instruction-following benchmark. We present LLaVA-Bench with two challenging benchmarks, with a diverse selection of paired images, instructions and detailed annotations. • Open-source. We release the following assets to the public: the generated multimodal instruction data, the codebase, the model checkpoints, and a visual chat demo.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
Multimodal Instruction-following Agents. In computer vision, existing works that build instruction-following agents can be broadly categorized into two classes: $( i )$ End-to-end trained models, which are separately explored for each specific research topic. For example, the visionlanguage navigation task [3, 19] and Habitat [46] require the embodied AI agent to follow natural language instructions and take a sequence of actions to complete goals in visual environments. In the image editing domain, given an input image and a written instruction that tells the agent what to do, InstructPix2Pix [6] edits images by following the human instructions. (ii) A system that coordinates various models via LangChain [1] / LLMs [34], such as Visual ChatGPT [52], X-GPT [62], MM-REACT [54], VisProg [18], and ViperGPT [45]. While sharing the same goal in building instruction-following agents, we focus on developing an end-to-end trained language-vision multimodal model for multiple tasks.
|
| 24 |
+
|
| 25 |
+
Instruction Tuning. In the natural language processing (NLP) community, to enable LLMs such as GPT-3 [7], T5 [40], PaLM [10], and OPT [59] to follow natural language instructions and complete real-world tasks, researchers have explored methods for LLM instruction-tuning [36, 51, 50], leading to instruction-tuned counterparts such as InstructGPT [36]/ChatGPT [34], FLAN-T5 [11], FLAN-PaLM [11], and OPT-IML [22], respectively. It turns out that this simple approach can effectively improve the zero- and few-shot generalization abilities of LLMs. It is thus natural to borrow the idea from NLP to computer vision. More broadly, the teacher-student distillation ideas with foundation models have been studied in other topics such as image classification [14]. Flamingo [2] can be viewed as the GPT-3 moment in the multimodal domain, due to its strong performance on zero-shot task transfer and in-context-learning. Other LMMs trained on imagetext pairs include BLIP-2 [27], FROMAGe [24], and KOSMOS-1 [20]. PaLM-E [13] is an LMM for embodied AI. Based on the recent “best” open-source LLM LLaMA, OpenFlamingo [5] and LLaMA-Adapter [58] are open-source efforts that enable LLaMA to use image inputs, paving the way to build open-source multimodal LLMs. While these models present promising task transfer generalization performance, they are not explicitly tuned with vision-language instruction data, and their performance in multimodal tasks usually falls short compared to language-only tasks. In this paper, we aim to fill this gap and study its effectiveness. Finally, note that visual instruction tuning is different from visual prompt tuning [23]: the former aims to improve the model’s instructionfollowing abilities, while the latter aims to improve the parameter-efficiency in model adaptation.
|
| 26 |
+
|
| 27 |
+
# Context type 1: Captions
|
| 28 |
+
|
| 29 |
+
A group of people standing outside of a black vehicle with various luggage. Luggage surrounds a vehicle in an underground parking area People try to fit all of their luggage in an SUV. The sport utility vehicle is parked in the public garage, being packed for a trip Some people with luggage near a van that is transporting it.
|
| 30 |
+
|
| 31 |
+
Context type 2: Boxes
|
| 32 |
+
|
| 33 |
+
person: [0.681, 0.242, 0.774, 0.694], backpack: [0.384, 0.696, 0.485, 0.914], suitcase: ...<omitted>
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
# Response type 1: conversation
|
| 38 |
+
|
| 39 |
+
Question: What type of vehicle is featured in the image? Answer: The image features a black sport utility vehicle (SUV) ...<omitted>
|
| 40 |
+
|
| 41 |
+
Response type 2: detailed description
|
| 42 |
+
|
| 43 |
+
The image is an underground parking area with a black sport utility vehicle (SUV) parked. There are three people in the scene, with one person standing closer to the left side of the vehicle, another person in the middle, and the third person on the right side. They are all working together to pack their luggage into the SUV for a trip. ...<omitted>
|
| 44 |
+
|
| 45 |
+
Response type 3: complex reasoning
|
| 46 |
+
|
| 47 |
+
Question: What challenges do these people face?
|
| 48 |
+
|
| 49 |
+
Answer: In the image, a group of people is standing outside a black SUV in a parking area, surrounded by various pieces of luggage, including suitcases and backpacks. They are facing the challenge of fitting all their luggage into the black SUV. There are multiple suitcases and backpacks to be packed, which suggests that the group has a significant amount of belongings ...<omitted>
|
| 50 |
+
|
| 51 |
+
Table 1: One example to illustrate the instruction-following data. The top block shows the contexts such as captions and boxes used to prompt GPT, and the bottom block shows the three types of responses. Note that the visual image is not used to prompt GPT, we only show it here as a reference.
|
| 52 |
+
|
| 53 |
+
# 3 GPT-assisted Visual Instruction Data Generation
|
| 54 |
+
|
| 55 |
+
The community has witnessed a surge in the amount of public multimodal data such as image-text pairs, ranging from CC [8] to LAION [44]. However, when it comes to multimodal instructionfollowing data, the available amount is limited, partially because the process for creating such data is time-consuming and less well-defined when human crowd-scouring is considered. Inspired by the success of recent GPT models in text-annotation tasks [17], we propose to leverage ChatGPT/GPT-4 for multimodal instruction-following data collection, based on the widely existing image-pair data.
|
| 56 |
+
|
| 57 |
+
For an image $\mathbf { X } _ { \mathbb { v } }$ and its associated caption $\mathbf { X } _ { \mathsf { c } }$ , it is natural to create a set of questions $\mathbf { X } _ { \mathtt { q } }$ with the intent to instruct the assistant to describe the image content. We prompt GPT-4 to curate such a list of questions (see details in Appendix). Therefore, a simple way to expand an image-text pair to its instruction-following version is Human : $\mathbf { X } _ { \mathtt { q } }$ $\mathbf { X } _ { \mathrm { v } } { < } \mathbf { S } \mathrm { T } 0 \mathsf { P } { > }$ Assistant : $\mathbf { X } _ { \mathsf { c } } { < } \mathbf { S } \mathrm { T } 0 \mathsf { P } { > }$ . Though cheap to construct, this simple expanded version lacks diversity and in-depth reasoning in both the instructions and responses.
|
| 58 |
+
|
| 59 |
+
To mitigate this issue, we leverage language-only GPT-4 or ChatGPT as the strong teacher (both accept only text as input), to create instruction-following data involving visual content. Specifically, in order to encode an image into its visual features to prompt a text-only GPT, we use two types of symbolic representations: (i) Captions typically describe the visual scene from various perspectives; (ii) Bounding boxes usually localize the objects in the scene, and each box encodes the object concept and its spatial location. One example is shown in the top block of Table 14.
|
| 60 |
+
|
| 61 |
+
This symbolic representation allows us to encode the image as an LLM-recognizable sequence. We use COCO images [30] and generate three types of instruction-following data. One example per type is shown in the bottom block of Table 14. For each type, we first manually design a few examples. They are the only human annotations we have during data collection, and are used as seed examples in in-context-learning to query GPT-4.
|
| 62 |
+
|
| 63 |
+
• Conversation. We design a conversation between the assistant and a person asking questions about this photo. The answers are in a tone as if the assistant is seeing the image and answering the question. A diverse set of questions are asked about the visual content of the image, including the object types, counting the objects, object actions, object locations, relative positions between objects. Only questions that have definite answers are considered. Please see Appendix for the detailed prompt.
|
| 64 |
+
|
| 65 |
+
• Detailed description. To include a rich and comprehensive description for an image, we create a list of questions with such an intent. We prompt GPT-4 then curate the list (see detailed prompts and curation process in Appendix). For each image, we randomly sample one question from the list to ask GPT-4 to generate the detailed description.
|
| 66 |
+
Complex reasoning. The above two types focus on the visual content itself, based on which we further create in-depth reasoning questions. The answers typically require a step-by-step reasoning process by following rigorous logic.
|
| 67 |
+
|
| 68 |
+
We collect 158K unique language-image instruction-following samples in total, including 58K in conversations, 23K in detailed description, and $7 7 \mathrm { k }$ in complex reasoning, respectively. We ablated the use of ChatGPT and GPT-4 in our early experiments, and found that GPT-4 consistently provides higher quality instruction-following data, such as spatial reasoning.
|
| 69 |
+
|
| 70 |
+
# 4 Visual Instruction Tuning
|
| 71 |
+
|
| 72 |
+
# 4.1 Architecture
|
| 73 |
+
|
| 74 |
+
The primary goal is to effectively leverage the capabilities of both the pre-trained LLM and visual model. The network archtecture is illustrated in Figure 1. We choose Vicuna [9] as our LLM $f _ { \phi } ( \cdot )$ parameterized by $\phi$ , as it has the best instruction following capabilities in language tasks among publicly available checkpoints [47, 9, 37].
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 1: LLaVA network architecture.
|
| 78 |
+
|
| 79 |
+
For an input image $\mathbf { X } _ { \mathbb { v } }$ , we consider the pre-trained CLIP visual encoder ViT-L/14 [39], which provides the visual feature ${ \bf Z } _ { \tt v } = g ( { \bf X } _ { \tt v } )$ . The grid features before and after the last Transformer layer are considered in our experiments. We consider a simple linear layer to connect image features into the word embedding space. Specifically, we apply a trainable projection matrix W to convert $\mathbf { Z } _ { \mathbf { y } }$ into language embedding tokens $\mathbf { H } _ { \mathbb { v } }$ , which have the same dimensionality as the word embedding space in the language model:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathbf { H } _ { \mathrm { v } } = \mathbf { W } \cdot \mathbf { Z } _ { \mathrm { v } } , \mathrm { w i t h } \mathbf { Z } _ { \mathrm { v } } = g ( \mathbf { X } _ { \mathrm { v } } )
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Thus, we have a sequence of visual tokens $\mathbf { H } _ { \mathbb { v } }$ . Note that our simple projection scheme is lightweight, which allows us to iterate data centric experiments quickly. More sophisticated schemes to connect the image and language representations can also be considered, such as gated cross-attention in Flamingo [2] and $\mathbf { Q }$ -former in BLIP-2 [27]. We leave exploring possibly more effective and sophisticated architecture designs for LLaVA as future work.
|
| 86 |
+
|
| 87 |
+
# 4.2 Training
|
| 88 |
+
|
| 89 |
+
For each image $\mathbf { X } _ { \mathbb { v } }$ , we generate multi-turn conversation data $( \mathbf { X _ { q } ^ { 1 } } , \mathbf { X _ { a } ^ { 1 } } , \cdots , \mathbf { X _ { q } ^ { \cal T } } , \mathbf { X _ { a } ^ { \cal T } } )$ , where $T$ is the total number of turns. We organize them as a sequence, by treating all answers as the assistant’s response, and the instruction $\mathbf { X } _ { \mathrm { i n s t r u c t } } ^ { t ^ { - } }$ at the $t$ -th turn as:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
{ \mathbf { X } _ { \mathrm { i n s t r u c t } } ^ { t } } = \left\{ \begin{array} { l l } { \begin{array} { c } { \mathrm { R a n d o m l y ~ c h o o s e ~ } [ { \mathbf { X } _ { \mathrm { q } } ^ { 1 } } , { \mathbf { X } _ { \mathrm { v } } } ] \mathrm { ~ o r ~ } [ { \mathbf { X } _ { \mathrm { v } } } , { \mathbf { X } _ { \mathrm { q } } ^ { 1 } } ] , \mathrm { ~ t h e ~ f i r s t ~ u r n ~ } t = 1 } \\ { \mathrm { ~ \mathbf { X } _ { \mathrm { q } } ^ { t } } , \qquad \mathrm { t h e ~ r e m a i n i n g ~ t u r n s ~ } t > 1 } \end{array} } \end{array} \right.
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
This leads to the unified format for the multimodal instruction-following sequence illustrated in Table 2. We perform instruction-tuning of the LLM on the prediction tokens, using its original auto-regressive training objective.
|
| 96 |
+
|
| 97 |
+
Xsystem-message ${ \mathrm { < S T 0 P > } }$
|
| 98 |
+
Human : <STOP> Assistant: ${ \bf X } _ { \mathrm { a } } ^ { 1 }$ TOP> ruct
|
| 99 |
+
Human : X ruct <STOP> Assistant: X2
|
| 100 |
+
|
| 101 |
+
Table 2: The input sequence used to train the model. Only two conversation turns are illustrated here; in practice, the number of turns varies based on the instruction-following data. In our current implementation, we follow Vicuna-v0 [9] to set the system message Xsystem-message and we set ${ \tt < S T O P > } =$ ###. The model is trained to predict the assistant answers and where to stop, and thus only green sequence/tokens are used to compute the loss in the auto-regressive model.
|
| 102 |
+
|
| 103 |
+
Specifically, for a sequence of length $L$ , we compute the probability of the target answers $\mathbf { X } _ { \mathsf { a } }$ by:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
p ( \mathbf { X _ { a } } | \mathbf { X _ { v } } , \mathbf { X _ { i n s t r u c t } } ) = \prod _ { i = 1 } ^ { L } p _ { \theta } ( x _ { i } | \mathbf { X _ { v } } , \mathbf { X _ { i n s t r u c t , < i } } , \mathbf { X _ { a , < i } } ) ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $\pmb { \theta }$ is the trainable parameters, $\mathbf { X } _ { \mathrm { i n s t r u c t } , < i }$ and $\mathbf { X } _ { \mathsf { a } , < i }$ are the instruction and answer tokens in all turns before the current prediction token $\mathbf { \boldsymbol { x } } _ { i }$ , respectively. Please see Table 2 for an illustration of the prediction tokens. For the conditionals in (3), we explicitly add $\mathbf { X } _ { \mathbb { v } }$ to emphasize the fact that the image is grounded for all answers, and we omit $\mathbf { X }$ system-message and all previous ${ \tt { < S T O P > } }$ for better readability. For LLaVA model training, we consider a two-stage instruction-tuning procedure.
|
| 110 |
+
|
| 111 |
+
Stage 1: Pre-training for Feature Alignment. To strike a balance between concept coverage and training efficiency, we filter CC3M to 595K image-text pairs. Please see Appendix for details of the filtering process. These pairs are converted to the instruction-following data using the naive expansion method describe in Section 3. Each sample can be treated as a single-turn conversation. To construct the input $\mathbf { X } _ { \mathrm { i n s t r u c t } }$ in (2), for an image $\mathbf { X } _ { \mathbb { v } }$ , a question $\mathbf { X } _ { \mathtt { q } }$ is randomly sampled, which is a language instruction to request the assistant to describe the image briefly. The ground-truth prediction answer $\mathbf { X } _ { \mathsf { a } }$ is the original caption. In training, we keep both the visual encoder and LLM weights frozen, and maximize the likelihood of (3) with trainable parameters $\mathbf { \nabla } \theta = \mathbf { W }$ (the projection matrix) only. In this way, the image features $\mathbf { H } _ { \mathbb { v } }$ can be aligned with the pre-trained LLM word embedding. This stage can be understood as training a compatible visual tokenizer for the frozen LLM.
|
| 112 |
+
|
| 113 |
+
Stage 2: Fine-tuning End-to-End. We always keep the visual encoder weights frozen, and continue to update both the pre-trained weights of the projection layer and LLM in LLaVA; i.e., the trainable parameters are $\pmb { \theta } = \{ \mathbf { W } , \phi \}$ in (3). We consider two specific use case scenarios:
|
| 114 |
+
|
| 115 |
+
• Multimodal Chatbot. We develop a Chatbot by fine-tuning on the 158K language-image instruction-following data in Section 3. Among the three types of responses, conversation is multi-turn while the other two are single-turn. They are uniformly sampled in training.
|
| 116 |
+
|
| 117 |
+
• Science $Q A$ . We study our method on the ScienceQA benchmark [33], the first large-scale multimodal science question dataset that annotates the answers with detailed lectures and explanations. Each question is provided a context in the form of natural language or an image. The assistant provides the reasoning process in natural language and selects the answer among multiple choices. For training in (2), we organize the data as a single turn conversation, the question & context as $\mathbf { X } _ { \mathrm { i n s t r u c t } }$ , and reasoning & answer as $\mathbf { X } _ { \mathsf { a } }$ .
|
| 118 |
+
|
| 119 |
+
# 5 Experiments
|
| 120 |
+
|
| 121 |
+
We assess the performance of LLaVA in instruction-following and visual reasoning capabilities with two primary experimental settings: multimodal chatbot and the ScienceQA dataset, respectively. We train all models with $8 \times \mathrm { { A l 0 0 s } }$ , following Vicuna’s hyperparameters [9]. We pre-train our model on the filtered CC-595K subset for 1 epoch with a learning rate of 2e-3 and a batch size of 128, and fine-tune on the proposed LLaVA-Instruct-158K dataset for 3 epochs, with a learning rate of 2e-5 and a batch size of 32. See Appendix for more training details.
|
| 122 |
+
|
| 123 |
+
# 5.1 Multimodal Chatbot
|
| 124 |
+
|
| 125 |
+
We developed a chatbot demo to show the image understanding and conversation abilities of LLaVA, and to study how well LLaVA is able to digest visual inputs and exhibit instruction-following
|
| 126 |
+
|
| 127 |
+
# Visual input example, Extreme Ironing:
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
|
| 131 |
+
Table 3: Example prompt from GPT-4 paper [35] to compare visual reasoning and chat capabilities. Compared to BLIP-2 [27] and OpenFlamingo [5], LLaVA accurately follows the user’s instructions, instead of simply describing the scene. LLaVA offers a more comprehensive response than GPT-4. Even when merely asked to describe the image, LLaVA identifies atypical aspects of the image.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>User LLaVA</td><td>Source: https://www.barnorama.com/wp-content/uploads/2016/12/03-Confusing-Pictures.jpg What is unusual about this image? The unusual aspect of this image is a man ironing clothes on the back of a minivan or van.This is not a typical place to perform this activity,as one would usually iron clothes</td></tr><tr><td>User LLaVA</td><td>in a more stationary and safe location, such as a home,using a regular ironing board. The scene depicted in the image is peculiar as it involves a makeshift ironing setup on a vehicle,which can be both unsafe and unconventional.Additionally,it is not clear how the man is able to maintain balance and stability while ironing clothes in such an unstable environment. [Start a new conversation,and clear the history] What's happening in the scene? The image depicts a man standing on top of a yellow SUV in a busy city street. He is holding a portable ladder,seemingly ironing clothes while standing on the vehicle.Around the scene,there are other cars,a traffc light,and a fire hydrant.Additionally,there are two other people in the vicinity,one close to the man on the car and another further away.</td></tr><tr><td>User GPT-4 [35]</td><td>The man on the ladder appears to be attracting attention due to his unconventional choice of ironing his clothes on top of a moving car. The city street around him is bustling with activity,adding to the unique nature of the scene. What is unusual about this image? The unusual thing about this image is that a man is ironing clothes on an ironing board</td></tr><tr><td>User BLIP-2</td><td>attached to the roof of a moving taxi. What is unusual about this image?</td></tr><tr><td>User OpenFlamingo</td><td>a man is sitting on the back of a yellow cab What is unusual about this image? The man is drying his clothes on the hood of his car.</td></tr></table>
|
| 134 |
+
|
| 135 |
+
capabilities. We first use the examples in the original GPT-4 paper [35], shown in Table 3 (more examples in Appendix), that require in-depth image understanding. For comparisons, we quote the prompt and response of the multimodal GPT-4 from their paper, and query BLIP-2 and OpenFlamingo model checkpoints to get their response.
|
| 136 |
+
|
| 137 |
+
Surprisingly, although LLaVA is trained with a small multimodal instruction-following dataset $\mathord { \sim } 8 0 \mathrm { K }$ unique images), it demonstrates quite similar reasoning results with multimodal GPT-4 on these examples. Note that while these images are out-of-domain for LLaVA, LLaVA is still able to understand the scenes and follow the question instruction to provide a reasonable response. In contrast, BLIP-2 and OpenFlamingo focus on describing the image, instead of following the user instruction to answer in an appropriate manner.
|
| 138 |
+
|
| 139 |
+
Quantitative Evaluation. To gain a systematic understanding of the performance of LLaVA, we propose a quantitative metric to measure the model’s instruction-following capability on multimodal data. Inspired by [9], we leverage GPT-4 to measure the quality of generated responses. Specifically, we create triplets consisting of image, ground-truth textual descriptions, and question. The candidate models (e.g., LLaVA) predict the answers based on the question and the image. To provide an approximate theoretical upper bound, we create a reference prediction based on the question and the ground-truth textual descriptions, using the text-only GPT-4. After obtaining the responses from both models, we feed the question, visual information (in the format of textual descriptions), and the generated responses from both assistants, to the judge (i.e., text-only GPT-4). It evaluates the helpfulness, relevance, accuracy, and level of detail of the responses from the assistants, and gives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance. It is also asked to provide a comprehensive explanation for the evaluation, for us to better understand the models. We report relative scores w.r.t. the text-only GPT-4 model that uses the textural ground truth description as visual input. We create two benchmarks to evaluate the model’s performance.
|
| 140 |
+
|
| 141 |
+
Table 4: Ablation on LLaVA-Bench (COCO) with different training data. We report relative scores w.r.t. a text-only GPT-4 model that uses ground truth image captions and bounding boxes as visual input. We prompt GPT-4 with the answers from our model outputs and the answers by GPT-4 (text-only), and let it compare between both responses and give a rating with an explanation.
|
| 142 |
+
|
| 143 |
+
<table><tr><td></td><td>Conversation</td><td>Detail description</td><td>Complex reasoning</td><td>All</td></tr><tr><td>Full data</td><td>83.1</td><td>75.3</td><td>96.5</td><td>85.1</td></tr><tr><td>Detail + Complex</td><td>81.5 (-1.6)</td><td>73.3 (-2.0)</td><td>90.8 (-5.7)</td><td>81.9 (-3.2)</td></tr><tr><td>Conv + 5% Detail + 10% Complex</td><td>81.0 (-2.1)</td><td>68.4 (-7.1)</td><td>91.5 (5.0)</td><td>80.5 (-4.4)</td></tr><tr><td>Conversation</td><td>76.5 (-6.6)</td><td>59.8 (-16.2)</td><td>84.9 (-12.4)</td><td>73.8 (-11.3)</td></tr><tr><td>No Instruction Tuning</td><td>22.0 (-61.1)</td><td>24.0 (-51.3)</td><td>18.5 (-78.0)</td><td>21.5 (-63.6)</td></tr></table>
|
| 144 |
+
|
| 145 |
+
<table><tr><td></td><td>Conversation</td><td>Detail description</td><td>Complex reasoning</td><td>All</td></tr><tr><td>OpenFlamingo [5]</td><td>19.3 ± 0.5</td><td>19.0 ± 0.5</td><td>19.1 ± 0.7</td><td>19.1 ± 0.4</td></tr><tr><td>BLIP-2 [27]</td><td>54.6 ± 1.4</td><td>29.1 ± 1.2</td><td>32.9 ± 0.7</td><td>38.1 ± 1.0</td></tr><tr><td>LLaVA</td><td>57.3 ± 1.9</td><td>52.5 ± 6.3</td><td>81.7 ± 1.8</td><td>67.3 ± 2.0</td></tr><tr><td>LLaVAt</td><td>58.8 ±0.6</td><td>49.2 ± 0.8</td><td>81.4 ± 0.3</td><td>66.7 ± 0.3</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 5: Instruction-following capability comparison using relative scores on LLaVA-Bench (In-theWild). The results are reported in the format of mean $\pm$ std. For the first three rows, we report three inference runs. LLaVA performs significantly better than others. † For a given set of LLaVA decoding sequences, we evaluate by querying GPT-4 three times; GPT-4 gives a consistent evaluation.
|
| 148 |
+
|
| 149 |
+
LLaVA-Bench (COCO). We randomly select 30 images from COCO-Val-2014, and for each image, we generate three types of questions (conversation, detailed description, complex reasoning) using the proposed data generation pipeline in Sec. 3, totaling 90 questions. This benchmark studies the model’s alignment behavior and capabilities with consistent visual inputs. We vary the training datasets to study the effectiveness of different types of instruction-following data, and show the results in Table 4. First, with instruction tuning, the model’s ability of following user instructions improves significantly by over 50 points. Second, adding a small amount of detailed description and complex reasoning questions contributes to a considerable improvement of the model’s overall capability by 7 points. Furthermore, it also improves the model’s performance on conversational questions, suggesting that improvements in reasoning capabilities complement conversational abilities. Finally, we show that having all three types of data yields the best performance at $8 5 . 1 \%$ .
|
| 150 |
+
|
| 151 |
+
LLaVA-Bench (In-the-Wild). To evaluate the model’s capability in more challenging tasks and generalizability to novel domains, we collect a diverse set of 24 images with 60 questions in total, including indoor and outdoor scenes, memes, paintings, sketches, etc., and associate each image with a highly-detailed and manually-curated description and a proper selection of questions. We compare LLaVA, BLIP, and OpenFlamingo in Table 5. Thanks to visual instruction tuning, LLaVA achieves significantly better performance compared with BLIP-2 $( + 2 9 \% )$ and OpenFlamingo $( + 4 8 \% )$ . Compared to the text-only GPT-4 that has access to ground-truth labels, LLaVA achieves an impressive $8 1 . 7 \%$ performance on complex reasoning questions, with an overall score of $6 7 . 3 \%$ .
|
| 152 |
+
|
| 153 |
+
Limitations. This LLaVA-Bench (In-the-Wild) is designed to be challenging and to reveal a model’s weaknesses. We provide two examples with associated captions and questions in Table 6. For the ramen example (left), to correctly answer the name of the restaurant, it requires the model to have a large knowledge coverage and multilingual understanding capability; to correctly describe the side dishes, the model may need to retrieve relevant multimodal information from Internet. For the fridge example (right), perceiving the correct brand of the yogurt requires the model to process high resolution images and possess extensive knowledge coverage. We also observed an interesting failure of LLaVA, as it responds with yes when asked if strawberry-flavored yogurt is present, even though
|
| 154 |
+
|
| 155 |
+
# Challenging examples from LLaVA-Bench (In-the-Wild):
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan=1 colspan=2>ICHIRAN Ramen [source] Filled fridge [source]</td></tr><tr><td rowspan=6 colspan=2>Annotation A close-up photo of a meal at ICHI- An open refrigerator filled with a variety of foodRAN.The chashu ramen bowl with items.In the left part of the compartment, towardsa spoon is placed in the center. The the front, there isaplastic box of strawberrieswith aramen is seasoned with chili sauce, small bag of baby carrots on top.Towards the back,chopped scallions,and served with there is a stack of sauce containers.In the middletwo pieces of chashu. Chopsticks are part of the compartment,towards the front, thereplaced to the right of the bowl, still in is a green plastic box,and there is an unidentifiedtheir paper wrap,not yet opened. The plastic bag placed on it.Towards the back, there is aramen is also served with nori on the carton of milk.In the right part of the compartment,left. On top,from left to right, the fol- towards the front,there is a box of blueberries withlowing sides are served:a bowl of or- three yogurts stacked on top.The large bottle ofange spice (possibly garlic sauce),a yogurt is Fage non-fat yogurt, and one of the smallerplate of smoke-flavored stewed pork cups is Fage blueberry yogurt. The brand and flavorwith chopped scallions,and a cup of of the other smaller cup are unknown. Towards thematcha green tea. back,there is a container with an unknown content.</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RAN.The chashu ramen bowl with items.In the left part of the compartment, towards</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>a spoon is placed in the center. The the front, there isaplastic box of strawberrieswith a</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>ramen is seasoned with chili sauce, small bag of baby carrots on top.Towards the back,</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>chopped scallions,and served with there is a stack of sauce containers.In the middle</td></tr><tr></tr><tr><td rowspan=1 colspan=2>Question 1 What's the name of the restaurant? What is the brand of the blueberry-flavored yogurt?</td></tr><tr><td rowspan=1 colspan=2>Question 2 Describe this photo in detail. Is there strawberry-flavored yogurt in the fridge?</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 6: Challenging examples from LLaVA-Bench (In-the-Wild), we provide extremely-detailed annotation for each image for an accurate evaluation. Some questions require the model to extract details from high resolution image and to have a broad knowledge coverage.
|
| 160 |
+
|
| 161 |
+
the fridge contains only yogurt and strawberries. This indicates that, at times, LLaVA perceives the image as a “bag of patches”, failing to grasp the complex semantics within the image. We hope LLaVA serves as a solid baseline on the benchmarks, on which our findings can inspire future work in developing more capable LMMs.
|
| 162 |
+
|
| 163 |
+
# 5.2 ScienceQA
|
| 164 |
+
|
| 165 |
+
ScienceQA [33] contains 21k multimodal multiple choice questions with rich domain diversity across 3 subjects, 26 topics, 127 categories, and 379 skills. The benchmark dataset is split into training, validation, and test splits with 12726, 4241, and 4241 examples, respectively. We consider two representative methods, including GPT-3.5 model (text-davinci-002) with and without chainof-thought (CoT), LLaMA-Adapter [58], as well as multimodal chain-of-thought (MM-CoT) [60], which is the current SoTA method on this dataset. For more baseline numbers, please see [33].
|
| 166 |
+
|
| 167 |
+
The results are reported in Table 7. For LLaVA, we use the visual features before the last layer, ask the model to first predict reasons and then the answer, and train it for 12 epochs. It yields $9 0 . 9 2 \%$ accuracy, which is quite close to the SoTA $9 1 . 6 8 \%$ . To explore the limit of LLMs, we also prompt GPT-4 using 2-shot in-context-learning and achieve $8 2 . 6 9 \%$ accuracy, which is a $7 . 5 2 \%$ absolute gain compared with $7 5 . 1 7 \%$ from GPT-3.5. For a substantial number of questions, we note that GPT-4 fails simply because it reports that there is insufficient context such as images or plots. We consider two schemes to combine the outcomes from our model and GPT-4. (i) A GPT-4 complement. Whenever GPT-4 fails to provide answers, we use the prediction from our method. This schemes yields $9 0 . 9 7 \%$ accuracy, which is almost the same as applying our method alone. (ii) GPT-4 as the judge. Whenever GPT-4 and LLaVA produce different answers, we prompt GPT-4 again, asking it to provide its own final answer based on the question and two outcomes. The spirit is similar with CoT, but with the external knowledge from the other model. Surprisingly, this scheme is able to provide consistent improvement over all question classes, and achieves a new SoTA accuracy of $9 2 . 5 3 \%$ . Interestingly, the text-only GPT-4, which cannot process images, improves the overall performance of the model on questions that have an image as context. This is because some of these questions do not actually require the image context for a correct answer. The GPT-4 judge can identify such cases and correct some of the errors that LLaVA makes. See the example in Appendix. To the best of our knowledge, this is the first time that GPT-4 is used for model ensembling. We hope this finding can encourage future research to explore more effective methods to leverage LLMs for model ensembling.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Subject</td><td colspan="3">Context Modality</td><td colspan="2">Grade</td><td rowspan="2">Average</td></tr><tr><td>NAT</td><td>sOC</td><td>LAN</td><td>TXT</td><td>IMG</td><td>NO</td><td>G1-6</td><td>G7-12</td></tr><tr><td colspan="10">Representative & SoTA methods with numbers reported in the literature</td></tr><tr><td>Human [33]</td><td>90.23</td><td>84.97</td><td>87.48</td><td>89.60</td><td>87.50</td><td>88.10</td><td>91.59</td><td>82.42</td><td>88.40</td></tr><tr><td>GPT-3.5 [33]</td><td>74.64</td><td>69.74</td><td>76.00</td><td>74.44</td><td>67.28</td><td>77.42</td><td>76.80</td><td>68.89</td><td>73.97</td></tr><tr><td>GPT-3.5 w/ CoT [33]</td><td>75.44</td><td>70.87</td><td>78.09</td><td>74.68</td><td>67.43</td><td>79.93</td><td>78.23</td><td>69.68</td><td>75.17</td></tr><tr><td>LLaMA-Adapter [58]</td><td>84.37</td><td>88.30</td><td>84.36</td><td>83.72</td><td>80.32</td><td>86.90</td><td>85.83</td><td>84.05</td><td>85.19</td></tr><tr><td>MM-CoTBase [60]</td><td>87.52</td><td>77.17</td><td>85.82</td><td>87.88</td><td>82.90</td><td>86.83</td><td>84.65</td><td>85.37</td><td>84.91</td></tr><tr><td>MM-CoTLarge [60]</td><td>95.91</td><td>82.00</td><td>90.82</td><td>95.26</td><td>88.80</td><td>92.89</td><td>92.44</td><td>90.31</td><td>91.68</td></tr><tr><td colspan="10">Results with our own experiment runs</td></tr><tr><td> GPT-4†</td><td>84.06</td><td>73.45</td><td>87.36</td><td>81.87</td><td>70.75</td><td>90.73</td><td>84.69</td><td>79.10</td><td>82.69</td></tr><tr><td>LLaVA</td><td>90.36</td><td>95.95</td><td>88.00</td><td>89.49</td><td>88.00</td><td>90.66</td><td>90.93</td><td>90.90</td><td>90.92</td></tr><tr><td>LLaVA+GPT-4† (complement)</td><td>90.36</td><td>95.50</td><td>88.55</td><td>89.05</td><td>87.80</td><td>91.08</td><td>92.22</td><td>88.73</td><td>90.97</td></tr><tr><td> LLaVA+GPT-4† (judge)</td><td>91.56</td><td>96.74</td><td>91.09</td><td>90.62</td><td>88.99</td><td>93.52</td><td>92.73</td><td>92.16</td><td>92.53</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 7: Accuracy $( \% )$ ) on Science QA dataset. Question categories: ${ \bf N A T } =$ natural science, ${ \bf S O C = }$ social science, LAN $=$ language science, $\mathrm { T X T = }$ text context, $\mathbf { I M G } =$ image context, ${ \mathrm { N O } } =$ no context, G1- $6 =$ grades 1-6, $G 7 - 1 2 =$ grades 7-12. †Text-only GPT-4, our eval. Our novel model ensembling with the text-only GPT-4 consistently improves the model’s performance under all categories, setting the new SoTA performance.
|
| 172 |
+
|
| 173 |
+
Ablations. We ablate several design choices on ScienceQA in Table 8. (i) Visual features. We tried using the last layer feature from CLIP vision encoder, which yields $8 9 . 9 6 \%$ and is $0 . 9 6 \%$ lower than the feature before the last layer. We hypothesize that this is because CLIP’s last layer features may focus more on global and abstract image properties compared to the layer before it, which can focus more on localized properties that are useful for under
|
| 174 |
+
|
| 175 |
+
Table 8: Design choice ablations $( \% )$ . The difference with the best variant is reported in red text.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Visual features</td><td>Before</td><td>Last</td></tr><tr><td>Best variant</td><td>90.92</td><td>89.96 (-0.96)</td></tr><tr><td>Predict answer first</td><td>-</td><td>89.77 (-1.15)</td></tr><tr><td>Training from scratch</td><td>85.81 (-5.1)</td><td>=</td></tr><tr><td>7B model size</td><td>89.84 (-1.08)</td><td>-</td></tr></table>
|
| 178 |
+
|
| 179 |
+
standing specific image details. $( i i )$ Chain-of-thought. To decide the order between the answer and reasoning process in the model prediction, we run both variants and observe that answer-first reports the best number $8 9 . 7 7 \%$ accuracy in 12 epochs, while reasoning-first can quickly reach $8 9 . 7 7 \%$ accuracy in 6 epochs, but no further improvement with more training. Training the model for 24 epochs does not improve the performance. We conclude that CoT-like reasoning-first strategy can largely improve convergence, but contributes relatively little to the final performance. (iii) Pre-training. We skip pre-training and directly train on Science QA from scratch – performance drops to $8 5 . 8 1 \%$ accuracy. The $5 . 1 1 \%$ absolute degradation indicates the importance of our pre-training stage, in aligning multimodal features while preserving the vast pre-trained knowledge. $( i v )$ Model size. We keep all configurations the same as our best 13B model, and train a 7B model. This yields $8 9 . 8 4 \%$ accuracy, which is $1 . 0 8 \%$ lower than $9 0 . 9 2 \%$ , demonstrating the importance of model scale.
|
| 180 |
+
|
| 181 |
+
# 6 Conclusion
|
| 182 |
+
|
| 183 |
+
This paper demonstrated the effectiveness of visual instruction tuning. We presented an automatic pipeline to create language-image instruction-following data, based on which we train LLaVA, a multimodal model to follow human intent to complete visual tasks. It achieves the new SoTA accuracy when fine-tuned on ScienceQA, and excellent visual chat capabilities when fine-tuned on multimodal chat data. Besides, we present the first benchmark to study multimodal instructionfollowing capability. This paper is an initial step in visual instruction tuning, and mainly focuses on real-life tasks. For more quantitative results of LLaVA on academic benchmarks, please refer to the improved baselines with visual instruction tuning [31]. We hope our work can inspire future research on building more capable multimodal models.
|
| 184 |
+
|
| 185 |
+
Acknowledgements. We thank Baolin Peng and Pan Lu for valuable discussions on instructiontuning language models and Science QA, respectively. We thank the LLaMA team for giving us access to their models, and open-source projects, including Alpaca and Vicuna. This work was supported in part by NSF CAREER IIS2150012, and Institute of Information & communications Technology Planning & Evaluation(IITP) grants funded by the Korea government(MSIT) (No. 2022- 0-00871, Development of AI Autonomy and Knowledge Enhancement for AI Agent Collaboration) and (No. RS-2022-00187238, Development of Large Korean Language Model Technology for Efficient Pre-training).
|
| 186 |
+
|
| 187 |
+
# References
|
| 188 |
+
|
| 189 |
+
[1] Langchain. https://github.com/hwchase17/langchain, 2022. 2
|
| 190 |
+
|
| 191 |
+
[2] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. arXiv preprint arXiv:2204.14198, 2022. 2, 4
|
| 192 |
+
[3] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sünderhauf, Ian Reid, Stephen Gould, and Anton Van Den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018. 2
|
| 193 |
+
[4] 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. 1
|
| 194 |
+
[5] Anas Awadalla, Irena Gao, Joshua Gardner, Jack Hessel, Yusuf Hanafy, Wanrong Zhu, Kalyani Marathe, Yonatan Bitton, Samir Gadre, Jenia Jitsev, Simon Kornblith, Pang Wei Koh, Gabriel Ilharco, Mitchell Wortsman, and Ludwig Schmidt. Openflamingo, March 2023. 2, 6, 7
|
| 195 |
+
[6] Tim Brooks, Aleksander Holynski, and Alexei A Efros. Instruct pix2pix: Learning to follow image editing instructions. arXiv preprint arXiv:2211.09800, 2022. 2
|
| 196 |
+
[7] 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. 2
|
| 197 |
+
[8] Soravit Changpinyo, Piyush Sharma, Nan Ding, and Radu Soricut. Conceptual $1 2 \mathrm { m }$ : Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In CVPR, 2021. 3
|
| 198 |
+
[9] Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% \ast$ chatgpt quality, March 2023. 1, 2, 4, 5, 6
|
| 199 |
+
[10] 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. 2
|
| 200 |
+
[11] Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416, 2022. 2
|
| 201 |
+
[12] CVinW. Computer vision in the wild. https://github.com/ Computer-Vision-in-the-Wild/CVinW_Readings, 2022. 1
|
| 202 |
+
[13] Danny Driess, Fei Xia, Mehdi SM Sajjadi, Corey Lynch, Aakanksha Chowdhery, Brian Ichter, Ayzaan Wahid, Jonathan Tompson, Quan Vuong, Tianhe Yu, et al. PaLM-E: An embodied multimodal language model. arXiv preprint arXiv:2303.03378, 2023. 2
|
| 203 |
+
[14] Fartash Faghri, Hadi Pouransari, Sachin Mehta, Mehrdad Farajtabar, Ali Farhadi, Mohammad Rastegari, and Oncel Tuzel. Reinforce data, multiply impact: Improved model accuracy and robustness with dataset reinforcement. arXiv preprint arXiv:2303.08983, 2023. 2
|
| 204 |
+
[15] Oran Gafni, Adam Polyak, Oron Ashual, Shelly Sheynin, Devi Parikh, and Yaniv Taigman. Make-a-scene: Scene-based text-to-image generation with human priors. ArXiv, abs/2203.13131, 2022. 1
|
| 205 |
+
[16] Zhe Gan, Linjie Li, Chunyuan Li, Lijuan Wang, Zicheng Liu, Jianfeng Gao, et al. Visionlanguage pre-training: Basics, recent advances, and future trends. Foundations and Trends® in Computer Graphics and Vision, 2022. 1
|
| 206 |
+
[17] Fabrizio Gilardi, Meysam Alizadeh, and Maël Kubli. Chatgpt outperforms crowd-workers for text-annotation tasks. arXiv preprint arXiv:2303.15056, 2023. 3
|
| 207 |
+
[18] Tanmay Gupta and Aniruddha Kembhavi. Visual programming: Compositional visual reasoning without training. arXiv preprint arXiv:2211.11559, 2022. 2
|
| 208 |
+
[19] Weituo Hao, Chunyuan Li, Xiujun Li, Lawrence Carin, and Jianfeng Gao. Towards learning a generic agent for vision-and-language navigation via pre-training. In CVPR, 2020. 2
|
| 209 |
+
[20] Shaohan Huang, Li Dong, Wenhui Wang, Yaru Hao, Saksham Singhal, Shuming Ma, Tengchao Lv, Lei Cui, Owais Khan Mohammed, Qiang Liu, et al. Language is not all you need: Aligning perception with language models. arXiv preprint arXiv:2302.14045, 2023. 2
|
| 210 |
+
[21] Gabriel Ilharco, Mitchell Wortsman, Ross Wightman, Cade Gordon, Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar, Hongseok Namkoong, John Miller, Hannaneh Hajishirzi, Ali Farhadi, and Ludwig Schmidt. Openclip. July 2021. If you use this software, please cite it as below. 1
|
| 211 |
+
[22] Srinivasan Iyer, Xi Victoria Lin, Ramakanth Pasunuru, Todor Mihaylov, Dániel Simig, Ping Yu, Kurt Shuster, Tianlu Wang, Qing Liu, Punit Singh Koura, et al. Opt-iml: Scaling language model instruction meta learning through the lens of generalization. arXiv preprint arXiv:2212.12017, 2022. 2
|
| 212 |
+
[23] Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In ECCV, 2022. 2
|
| 213 |
+
[24] Jing Yu Koh, Ruslan Salakhutdinov, and Daniel Fried. Grounding language models to images for multimodal generation. arXiv preprint arXiv:2301.13823, 2023. 2
|
| 214 |
+
[25] Boyi Li, Kilian Q Weinberger, Serge Belongie, Vladlen Koltun, and René Ranftl. Languagedriven semantic segmentation. ICLR, 2022. 1
|
| 215 |
+
[26] Chunyuan Li, Haotian Liu, Liunian Harold Li, Pengchuan Zhang, Jyoti Aneja, Jianwei Yang, Ping Jin, Houdong Hu, Zicheng Liu, Yong Jae Lee, and Jianfeng Gao. ELEVATER: A benchmark and toolkit for evaluating language-augmented visual models. In NeurIPS Track on Datasets and Benchmarks, 2022. 1
|
| 216 |
+
[27] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping languageimage pre-training with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023. 1, 2, 4, 6, 7
|
| 217 |
+
[28] Liunian Harold Li, Pengchuan Zhang, Haotian Zhang, Jianwei Yang, Chunyuan Li, Yiwu Zhong, Lijuan Wang, Lu Yuan, Lei Zhang, Jenq-Neng Hwang, et al. Grounded language-image pre-training. In CVPR, 2022. 1
|
| 218 |
+
[29] Yuheng Li, Haotian Liu, Qingyang Wu, Fangzhou Mu, Jianwei Yang, Jianfeng Gao, Chunyuan Li, and Yong Jae Lee. Gligen: Open-set grounded text-to-image generation. arXiv preprint arXiv:2301.07093, 2023. 1
|
| 219 |
+
[30] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014. 3
|
| 220 |
+
|
| 221 |
+
[31] Haotian Liu, Chunyuan Li, Yuheng Li, and Yong Jae Lee. Improved baselines with visual instruction tuning, 2023. 10, 14
|
| 222 |
+
|
| 223 |
+
[32] 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, 2023. 1
|
| 224 |
+
|
| 225 |
+
[33] Pan Lu, Swaroop Mishra, Tanglin Xia, Liang Qiu, Kai-Wei Chang, Song-Chun Zhu, Oyvind Tafjord, Peter Clark, and Ashwin Kalyan. Learn to explain: Multimodal reasoning via thought chains for science question answering. Advances in Neural Information Processing Systems, 2022. 2, 5, 8, 9
|
| 226 |
+
|
| 227 |
+
[34] OpenAI. ChatGPT. https://openai.com/blog/chatgpt/, 2023. 1, 2 [35] OpenAI. Gpt-4 technical report, 2023. 1, 6, 15 [36] 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. 2
|
| 228 |
+
|
| 229 |
+
[37] Baolin Peng, Chunyuan Li, Pengcheng He, Michel Galley, and Jianfeng Gao. Instruction tuning with GPT-4. arXiv preprint arXiv:2304.03277, 2023. 1, 4
|
| 230 |
+
|
| 231 |
+
[38] Hieu Pham, Zihang Dai, Golnaz Ghiasi, Kenji Kawaguchi, Hanxiao Liu, Adams Wei Yu, Jiahui Yu, Yi-Ting Chen, Minh-Thang Luong, Yonghui Wu, et al. Combined scaling for open-vocabulary image classification. arXiv preprint arXiv: 2111.10050, 2021. 1
|
| 232 |
+
|
| 233 |
+
[39] 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. arXiv preprint arXiv:2103.00020, 2021. 1, 2, 4
|
| 234 |
+
|
| 235 |
+
[40] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 2020. 2
|
| 236 |
+
|
| 237 |
+
[41] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. ArXiv, abs/2204.06125, 2022. 1
|
| 238 |
+
|
| 239 |
+
[42] Robin Rombach, A. Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. Highresolution image synthesis with latent diffusion models. CVPR, pages 10674–10685, 2022. 1
|
| 240 |
+
|
| 241 |
+
[43] Chitwan Saharia, 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. 1
|
| 242 |
+
|
| 243 |
+
[44] Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion5b: An open large-scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022. 3
|
| 244 |
+
|
| 245 |
+
[45] Dídac Surís, Sachit Menon, and Carl Vondrick. Vipergpt: Visual inference via python execution for reasoning. arXiv preprint arXiv:2303.08128, 2023. 2
|
| 246 |
+
|
| 247 |
+
[46] Andrew Szot, Alex Clegg, Eric Undersander, Erik Wijmans, Yili Zhao, John Turner, Noah Maestre, Mustafa Mukadam, Devendra Chaplot, Oleksandr Maksymets, Aaron Gokaslan, Vladimir Vondrus, Sameer Dharur, Franziska Meier, Wojciech Galuba, Angel Chang, Zsolt Kira, Vladlen Koltun, Jitendra Malik, Manolis Savva, and Dhruv Batra. Habitat 2.0: Training home assistants to rearrange their habitat. In Advances in Neural Information Processing Systems (NeurIPS), 2021. 2
|
| 248 |
+
|
| 249 |
+
[47] 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. 1, 4
|
| 250 |
+
[48] 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. 1
|
| 251 |
+
[49] Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, and Lijuan Wang. Git: A generative image-to-text transformer for vision and language. arXiv preprint arXiv:2205.14100, 2022. 1
|
| 252 |
+
[50] 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, 2022. 2
|
| 253 |
+
[51] Yizhong Wang, Swaroop Mishra, Pegah Alipoormolabashi, Yeganeh Kordi, Amirreza Mirzaei, Anjana Arunkumar, Arjun Ashok, Arut Selvan Dhanasekaran, Atharva Naik, David Stap, et al. Benchmarking generalization via in-context instructions on $1 { , } 6 0 0 { + }$ language tasks. arXiv preprint arXiv:2204.07705, 2022. 2
|
| 254 |
+
[52] Chenfei Wu, Shengming Yin, Weizhen Qi, Xiaodong Wang, Zecheng Tang, and Nan Duan. Visual chatgpt: Talking, drawing and editing with visual foundation models. arXiv preprint arXiv:2303.04671, 2023. 2
|
| 255 |
+
[53] Jianwei Yang, Chunyuan Li, Pengchuan Zhang, Bin Xiao, Lu Yuan, Ce Liu, and Jianfeng Gao. Unified contrastive learning in image-text-label space. CVPR, 2022. 1
|
| 256 |
+
[54] Zhengyuan Yang, Linjie Li, Jianfeng Wang, Kevin Lin, Ehsan Azarnasab, Faisal Ahmed, Zicheng Liu, Ce Liu, Michael Zeng, and Lijuan Wang. Mm-react: Prompting chatgpt for multimodal reasoning and action. arXiv preprint arXiv:2303.11381, 2023. 2
|
| 257 |
+
[55] Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, Benton C. Hutchinson, Wei Han, Zarana Parekh, Xin Li, Han Zhang, Jason Baldridge, and Yonghui Wu. Scaling autoregressive models for content-rich text-to-image generation. ArXiv, abs/2206.10789, 2022. 1
|
| 258 |
+
[56] Lu Yuan, Dongdong Chen, Yi-Ling Chen, Noel Codella, Xiyang Dai, Jianfeng Gao, Houdong Hu, Xuedong Huang, Boxin Li, Chunyuan Li, et al. Florence: A new foundation model for computer vision. arXiv preprint arXiv:2111.11432, 2021. 1
|
| 259 |
+
[57] Hao Zhang, Feng Li, Xueyan Zou, Shilong Liu, Chunyuan Li, Jianfeng Gao, Jianwei Yang, and Lei Zhang. A simple framework for open-vocabulary segmentation and detection. arXiv preprint arXiv:2303.08131, 2023. 1
|
| 260 |
+
[58] 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, 2023. 2, 8, 9
|
| 261 |
+
[59] 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. 2
|
| 262 |
+
[60] Zhuosheng Zhang, Aston Zhang, Mu Li, Hai Zhao, George Karypis, and Alex Smola. Multimodal chain-of-thought reasoning in language models. arXiv preprint arXiv:2302.00923, 2023. 8, 9
|
| 263 |
+
[61] 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 Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16793–16803, 2022. 1
|
| 264 |
+
[62] Xueyan Zou, Zi-Yi Dou, Jianwei Yang, Zhe Gan, Linjie Li, Chunyuan Li, Xiyang Dai, Harkirat Behl, Jianfeng Wang, Lu Yuan, et al. Generalized decoding for pixel, image, and language. arXiv preprint arXiv:2212.11270, 2022. 1, 2
|
| 265 |
+
|
| 266 |
+
# A Broader Impact
|
| 267 |
+
|
| 268 |
+
The broader impact of LLaVA, a general-purpose visual assistant, has potential benefits and risks associated with its deployment and release. Some considerations are unique to LLaVA due to its visual nature, while others share similarities with existing instruction-following LLMs (e.g., Alpaca, Vicuna, etc.). As LLaVA is built upon LLaMA, Vicuna, and CLIP, it inherits some of the issues associated with LLMs and vision encoders. In the following, we outline both the risks and mitigation strategies in place for the release of this model.
|
| 269 |
+
|
| 270 |
+
Malicious input. To minimize potential misuse and harmful consequences, we employ two precautionary measures for LLaVA: (1) OpenAI Filter API for user input text to prevent harmful or inappropriate text instructions from being processed by the model, and (2) NSFW Filter for uploaded user images to detect and block Not Safe For Work (NSFW) content or any other potentially harmful image inputs.
|
| 271 |
+
|
| 272 |
+
Hallucination. Similar to LLMs, LLaVA might generate outputs that aren’t grounded in facts or input data. This raises concerns about inferences made, especially in critical applications (e.g., medical).
|
| 273 |
+
|
| 274 |
+
Biases. Bias can be transferred from the base models to LLaVA, both from the vision encoder (CLIP) and the language decoder (LLaMA/Vicuna). This may lead to biased outcomes or unfair representations of diverse content.
|
| 275 |
+
|
| 276 |
+
Energy consumption. Though energy consumption is not a primary concern for LLaVA due to a smaller pretraining dataset (see details in Sec. C), it may become a concern when scaling up the pretraining dataset or increasing the model size, e.g., to a larger LLaMA version like the 65B model.
|
| 277 |
+
|
| 278 |
+
Evaluation complexities. Assessing the performance of LLaVA is challenging as it involves both language and visual tasks. Our evaluation benchmark covers several aspects, including accuracy, concept coverage, reasoning ability, and creativity. However, additional aspects need consideration, such as the degree of visual content hallucination and fine-grained understanding of visual content. While text-only GPT-4 based multimodal evaluation is consistent and accurate in our study, its robustness in different situations and capability to evaluate other unexplored aspects are subjects for future work.
|
| 279 |
+
|
| 280 |
+
Despite these risks, we believe that the benefits of releasing LLaVA to the research community outweigh the potential harm. It allows for ongoing investigation and improvement of the model and engages the community in developing better mitigation strategies to address these concerns. Moreover, the release of LLaVA can spur the development of new applications and research directions, ultimately contributing to the progress and responsible deployment of foundation models in vision-language tasks.
|
| 281 |
+
|
| 282 |
+
# B More Results
|
| 283 |
+
|
| 284 |
+
We present more qualitative results of LLaVA to analyze its emergent behaviors and observed weaknesses. For more quantitative results of LLaVA on academic benchmarks, please refer to the improved baselines with visual instruction tuning [31]. In Table 9, LLaVA demonstrates a similar behavior as GPT-4 in another example from its paper. Similar to the GPT-4 live demo by OpenAI, LLaVA is capable of generating the HTML/JS/CSS code for an interactive joke website based on a simplified user input sketch in Fig. 2, despite a minor error. As shown in Fig. 3, LLaVA can follow user’s instructions in a conversational style and provide detailed responses or creative writings. Furthermore, LLaVA is able to relate the visual content to the textual knowledge from the pretrained LLM, as demonstrated in Fig. 4 and Fig. 5.
|
| 285 |
+
|
| 286 |
+
One interesting emergent behavior of LLaVA is that it is able to understand visual contents that are not covered in the training. For example, in Fig. 6, it is able to recognize Elon Musk both in a headshot and in a humorous meme where he is dressed as a doge, even though Elon Musk never appears in the training data for either the visual feature alignment or visual instruction tuning stages of
|
| 287 |
+
|
| 288 |
+
LLaVA. LLaVA also demonstrates impressive OCR (optical character recognition) ability in Table 9 and Fig. 2, which is rarely covered in our training data.
|
| 289 |
+
|
| 290 |
+
We hope these additional results and observations showcase the potential of LLaVA in various application areas. In future work, it is important to investigate these emergent behaviors more thoroughly and to understand the underlying mechanisms that enable LLaVA to demonstrate such generalization abilities. This will pave the way towards building better LMMs, including enhancing robustness, reducing biases, and improving the alignment and the scope of the learned vision-language representations.
|
| 291 |
+
|
| 292 |
+
Table 9: Example prompt comparing LLaVA, GPT-4, BLIP-2, and OpenFlamingo’s visual reasoning capabilities in understanding the humor. BLIP-2 and OpenFlamingo fail to follow the user’s instructions. LLaVA and GPT-4 both explain the meme and its humor, while GPT-4 produces a more concise answer.
|
| 293 |
+
|
| 294 |
+
<table><tr><td colspan="3">Visual input example, Chicken Nugget Map:</td></tr><tr><td rowspan="3">User LLaVA</td><td>Sometimes ljust look at pictures of the earth from space and lmarvel at howbeautiful it all is.</td><td></td></tr><tr><td></td><td></td></tr><tr><td>Can you explain this meme in detail? The meme in the image is a creative and humorous take on food,with a focus on chicken nuggets,as the center of the universe.The meme begins with the phrase "Sometimes I just look at pictures of the Earth from space and Imarvel at how beautiful it all is..." The main image features a tray of cooked chicken nuggets,with the chicken pieces positioned to resemble the continents and islands on a world map.The meme playfully suggests that the chicken nuggets represent the Earth,and the various locations depicted in the photo are actually chicken nugget versions of different places.The punchline of the meme appears in smaller text at the bottom,reading "I mean,it's not the real Earth,but how beautiful it</td><td>is all is."This lighthearted and entertaining meme combines food and humor,using the image of chicken nuggets to create a funny and imaginative representation of the world.</td></tr><tr><td>User GPT-4 [35]</td><td>Can you explain this meme? This meme is a joke that combines two unrelated things: pictures of the earth from space and chicken nuggets. The text of the meme suggests that the image below is a beautiful picture of the earth from space.However, the image is actually of chicken nuggets</td><td>arranged to vaguely resemble a map of the world.The humor in this meme comes from the unexpected juxtaposition of the text and the image.The text sets up an expectation of a</td></tr><tr><td>User BLIP-2</td><td>majestic image of the earth,but the image is actually something mundane and silly. Can you explain this meme in detail?</td><td>sometimes i just look at pictures of the earth from space and marvel how beautiful it is</td></tr><tr><td>User OpenFlamingo</td><td>Can you explain this meme in detail? It's a picture of a chicken nugget on the International Space Station.</td><td></td></tr></table>
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 2: LLaVA generates HTML/JS code for an interactive website based on user sketch inputs. The interactive interface works after fixing a minor error (in red) in the generated output. There is room for improvement in LLaVA’s output, such as splitting the joke and punchline into two rows, and only revealing the punchline upon button click, to better reflect the user’s intent.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
|
| 303 |
+
What are the meals that I can cook with these?
|
| 304 |
+
|
| 305 |
+
With the variety of food items stored in the refrigerator, you can prepare several meals. For example, you can create a fruit salad using the strawberries, blueberries, and carrots. Additionally, you can make a delicious smoothie using the fruits and vegetables, which would be a healthy and nutritious snack or breakfast option. The milk and eggs can be used to create various dishes, such as a milk-based smoothie, a baked casserole, or scrambled eggs. The juice can also be used to make a fresh fruit and juice mix or as a refreshing homemade popsicle. The possibilities are vast, and the meals you can create will depend on your preferences and dietary needs.
|
| 306 |
+
|
| 307 |
+
I would like to do the fruit salad. Show me the recipe.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
|
| 311 |
+
Certainly! Here's a simple fruit salad recipe using the items in your refrigerator:
|
| 312 |
+
|
| 313 |
+
# Ingredients:
|
| 314 |
+
|
| 315 |
+
- 2 cups fresh strawberries, sliced
|
| 316 |
+
- 1 cup fresh blueberries
|
| 317 |
+
- 1 large carrot, grated
|
| 318 |
+
- Juice of half a lemon
|
| 319 |
+
- A handful of chopped fresh parsley or mint
|
| 320 |
+
- A few ice cubes
|
| 321 |
+
- Optional: honey or maple syrup (adjust to taste)
|
| 322 |
+
|
| 323 |
+
# Instructions:
|
| 324 |
+
|
| 325 |
+
1. In a large bowl, combine the sliced strawberries, blueberries, and carrot. Gently toss them together to mix.
|
| 326 |
+
2. Drizzle the juice of half a lemon over the fruit and vegetables to prevent them from oxidizing and add a refreshing citrus flavor.
|
| 327 |
+
3. Sprinkle the chopped fresh parsley or mint over the fruit and gently toss once more.
|
| 328 |
+
4. If desired, add a drizzle of honey or maple syrup for a touch of sweetness. Adjust the amount according to your taste preferences.
|
| 329 |
+
5. Cover the bowl and refrigerate the fruit salad for at least 30 minutes or up to a few hours. This allows the flavors to meld and creates a
|
| 330 |
+
more refreshing salad.
|
| 331 |
+
6. Serve the fruit salad in cups or bowls, garnished with a sprinkle of fresh parsley or mint, if desired.
|
| 332 |
+
|
| 333 |
+
This fruit salad recipe is perfect for a healthy snack or side dish, and with the variety of ingredients available in your refrigerator, it should be easy to put together quickly.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
|
| 339 |
+
What are the things I should be cautious about when I visit here?
|
| 340 |
+
|
| 341 |
+
When visiting this peaceful location with a pier extending over a serene lake, surrounded by mountains, there are several things to be cautious about. First, pay attention to the weather conditions, as sudden changes in weather, especially strong winds or storms, can cause the water to become rough and pose risks to the stability of the pier. Second, be mindful of the structural integrity of the pier; avoid overloading it with too many people or excessive weight, as this could potentially damage the pier or cause it to collapse. Additionally, be aware of the surrounding wildlife and respect their space; do not harm or disturb them in any way. Finally, if you decide to go fishing, ensure that you adhere to any local fishing regulations and use appropriate fishing techniques to keep the lake ecosystem healthy and maintain the balance of the food chain.
|
| 342 |
+
|
| 343 |
+
Compose an engaging travel blog post about my trip to this place, highlighting the beautiful sceneries, joyful experiences, and include possible anecdotes.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
|
| 347 |
+
Traveling to this picturesque location with a serene lake and mountains in the background was a refreshing and rejuvenating experience. The pier extending over the calm water provided an excellent vantage point from which to appreciate the breathtaking scenery. As I stood on the pier, I couldn't help but feel a deep connection with nature, taking a moment to soak in the peaceful atmosphere.
|
| 348 |
+
|
| 349 |
+
One of the highlights of my trip was undoubtedly the fishing experience. The area is teeming with life, and I was thrilled to land a sizeable catch, despite the modest size of the lake. The joy of fishing in such a beautiful setting was truly rewarding, and it allowed me to take a break from my busy life and truly immerse myself in the tranquility of nature.
|
| 350 |
+
|
| 351 |
+
While exploring the surrounding area, I came across a family of birds that had built a nest close to the pier, adding to the charm of the location. Interacting with the wildlife and observing their behavior was an enriching experience that I'll cherish for years to come.
|
| 352 |
+
|
| 353 |
+
In conclusion, this idyllic destination provided me with an opportunity to unwind and recharge, surrounded by mesmerizing natural beauty and the gentle sounds of water and wildlife. If you're looking for a serene escape from the hustle and bustle of everyday life, this pier overlooking the lake is the perfect place to find solace and reconnect with nature.
|
| 354 |
+
|
| 355 |
+
Figure 3: LLaVA is capable of recognizing the visual content following the user’s intent, without directly prompting for visual recognition. It also provides a detailed response when prompted with a follow-up request, and the generated response is closely related to the provided visual content.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
|
| 359 |
+
What's the ending of this movie?
|
| 360 |
+
|
| 361 |
+
In the image, a young woman is leaning on a man in front of a beautiful sunset, with both of them standing on a boat. They appear to be enjoying a romantic moment together. The scene suggests that they could be depicted as the characters Jack and Rose from the popular movie Titanic. In the movie, their romance blossoms aboard the fictional ocean liner Titanic, with the pair ultimately sharing a passionate kiss as the ship sinks into the ocean. The ending of the movie is known for its emotional and heartfelt scenes, where the characters are forced to say goodbye to each other as they are separated by the sinking ship. The image evokes a sense of romance and nostalgia, paying tribute to the iconic love story portrayed in the movie Titanic.
|
| 362 |
+
|
| 363 |
+
Figure 4: LLaVA relates the movie scenes to the textual knowledge from the pretrained LLM.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
|
| 369 |
+
Do you know who drew this painting?
|
| 370 |
+
|
| 371 |
+
The painting depicts a woman, commonly believed to be Mona Lisa, the famous artwork by Leonardo da Vinci. It is a portrait painting that showcases the woman's enigmatic smile and has become one of the most famous and iconic art pieces in the world. The original work is displayed in the Louvre Museum in Paris, and it is known for its intricate details, use of oil paint, and the artist's innovative techniques that contributed to its enduring appeal and mystery.
|
| 372 |
+
|
| 373 |
+
Start a new conversation, and the history is cleared.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
|
| 379 |
+
Do you know who drew this painting?
|
| 380 |
+
|
| 381 |
+
The painting depicts a dog in a humorous situation, where it appears to be wearing a woman's dress and standing in front of a landscape. Although the artist of the painting is not explicitly identified, it could be a reference to the famous artist Da Vinci, known for his artistic works, including the Mona Lisa. The painting is likely a creative and comical take on the traditional portrait style, replacing a human figure with a dog dressed in a woman's clothing, making it an interesting and amusing visual piece.
|
| 382 |
+
|
| 383 |
+
Figure 5: LLaVA recognizes the famous art work, Mona Lisa, by Leonardo da Vinci. When we start a new conversation, it also explains the humourous artwork created on the web, mimicking the Mona Lisa.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
|
| 387 |
+
Figure 6: An interesting emergent behavior of LLaVA is its ability to recognize Elon Musk both in a headshot and in a humorous meme where he is dressed as a doge. This implies that the pre-trained CLIP vision encoder may have seen images of Elon Musk. However, it is still surprising because Elon Musk never appears in the training data for either the visual feature alignment or visual instruction tuning stages of LLaVA, which indicates that the base language model generalizes to unseen visual concepts.
|
| 388 |
+
|
| 389 |
+
# Question:
|
| 390 |
+
|
| 391 |
+
Which material is this rocking chair made of? Options: (A) wood (B) silk
|
| 392 |
+
|
| 393 |
+
# LLaVA answer:
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
|
| 397 |
+
# GPT-4 (text-only) answer:
|
| 398 |
+
|
| 399 |
+
The answer is A. BECAUSE: Rocking chairs are typically made of sturdy materials that can support the weight of a person and withstand the rocking motion. Wood is a common material used for making rocking chairs due to its strength, durability, and natural appearance.
|
| 400 |
+
|
| 401 |
+
# GPT-4 (text-only) judge:
|
| 402 |
+
|
| 403 |
+
Since there is no context or image to refer to, I cannot independently analyze the rocking chair in question. However, I can try to analyze the reasoning given by the assistants.
|
| 404 |
+
Assistant 1, who claims to have seen the image, mentions that the legs of the rocking chair are made of wood, and the back and seat are made of silk, implying that it’s a combination of two materials. However, this response seems less plausible, as silk is not a common material used for the construction of rocking chairs due to issues with stability and durability. Typically, one would expect the frame, legs, and seat or back to be made of wood, with cushions and padding made of fabrics, such as cotton or polyester.
|
| 405 |
+
Assistant 2 argues that rocking chairs are typically made of sturdy materials, and wood is a common material used for making rocking chairs due to its strength, durability, and natural appearance. This reasoning stands true and is based on common knowledge.
|
| 406 |
+
Given the information available, the most plausible answer is that the rocking chair is made of wood, as suggested by Assistant 1. The answer is A.
|
| 407 |
+
|
| 408 |
+
# C Training Details
|
| 409 |
+
|
| 410 |
+
We pre-train our model on the filtered CC-595K subset for 1 epoch with a learning rate of 2e-3 and a batch size of 128, and fine-tune on the proposed LLaVA-Instruct-158K dataset for 3 epochs, with a learning rate of 2e-5 and a batch size of 32. Following Vicuna, we use the Adam optimizer with no weight decay and a cosine learning rate with a warmup ratio of $3 \%$ . During finetuning, FSDP (Full Shard Data Parallel) and gradient checkpointing is used to save GPU memory, and offloading is not used. BF16 and TF32 are enabled to achieve a balance between speed and precision.
|
| 411 |
+
|
| 412 |
+
We train all models with $8 \times \mathrm { { A l 0 0 s } }$ . Pretraining on CC-595K completes within 4 hours. Finetuning on Instruct-158K completes within 10 hours. Finetuning on ScienceQA completes within 4 hours.
|
| 413 |
+
|
| 414 |
+
# D Assets
|
| 415 |
+
|
| 416 |
+
Our source code, generated instruction-tuning data, proposed benchmark are uploaded to the anonymized GitHub repository: LLaVA-Annonymous/LLaVA.
|
| 417 |
+
|
| 418 |
+
1. Source Code: link
|
| 419 |
+
2. README: link
|
| 420 |
+
3. Instructions to launch the demo: link
|
| 421 |
+
4. All prompts and few shot examples for querying GPT-4: link
|
| 422 |
+
5. LLaVA-Instruct-158K: link
|
| 423 |
+
6. LLaVA-Bench: COCO, In-The-Wild
|
| 424 |
+
7. Model checkpoints. The size of the model checkpoints after compression is 25GB, which exceeds the 5GB limit of GitHub LFS (Large File Storage). We’ll release the checkpoint to the public, or upon request with reviewers for this submission.
|
| 425 |
+
|
| 426 |
+
# E Data
|
| 427 |
+
|
| 428 |
+
Instructions for brief image description. The list of instructions used to briefly describe the image content are shown in Table 11. They present the same meaning with natural language variance.
|
| 429 |
+
|
| 430 |
+
• "Describe the image concisely." • "Provide a brief description of the given image." • "Offer a succinct explanation of the picture presented." • "Summarize the visual content of the image." • "Give a short and clear explanation of the subsequent image." "Share a concise interpretation of the image provided." • "Present a compact description of the photo’s key features." • "Relay a brief, clear account of the picture shown." • "Render a clear and concise summary of the photo." • "Write a terse but informative summary of the picture." • "Create a compact narrative representing the image presented."
|
| 431 |
+
|
| 432 |
+
Table 11: The list of instructions for brief image description.
|
| 433 |
+
|
| 434 |
+
Instructions for detailed image description. The list of instructions used to describe the image content in detail are shown in Table 12. They present the same meaning with natural language variance.
|
| 435 |
+
|
| 436 |
+
CC3M. We extract noun-phrases using Spacy for each caption over the whole CC3M dataset, and count the frequency of each unique noun-phrase. We skip noun-phrases whose frequency is smaller than 3, as they are usually rare combinations concept and attributes that has already been covered by other captions. We then start from the noun-phrases with lowest remaining frequency, add the captions that contain this noun-phrase to the candidate pool. If the frequency of the noun-phrase is larger than 100, we randomly choose a subset of size 100 out of all its captions. This results in around 595K image-text pairs.
|
| 437 |
+
|
| 438 |
+
<table><tr><td></td></tr><tr><td> "Describe the following image in detail"</td></tr><tr><td> "Provide a detailed description of the given image"</td></tr><tr><td>"Give an elaborate explanation of the image you see"</td></tr><tr><td>"Share a comprehensive rundown of the presented image"</td></tr><tr><td>"Offer a thorough analysis of the image"</td></tr><tr><td>"Explain the various aspects of the image before you"</td></tr><tr><td>"Clarify the contents of the displayed image with great detail"</td></tr><tr><td>"Characterize the image using a well-detailed description"</td></tr><tr><td>"Break down the elements of the image in a detailed manner"</td></tr><tr><td> "Walk through the important details of the image"</td></tr><tr><td>"Portray the image with a rich, descriptive narrative"</td></tr><tr><td> "Narrate the contents of the image with precision"</td></tr><tr><td> "Analyze the image in a comprehensive and detailed manner"</td></tr><tr><td> "Ilustrate the image through a descriptive explanation"</td></tr><tr><td> "Examine the image closely and share its details"</td></tr><tr><td>· "Write an exhaustive depiction of the given image"</td></tr></table>
|
| 439 |
+
|
| 440 |
+
Table 12: The list of instructions for detailed image description.
|
| 441 |
+
|
| 442 |
+
The comparison of noun-phrase statistics before and after filtering CC3M is shown in Figure 7. The filtered dataset shows a good coverage of concepts whose frequency is higher from 3, but with a smaller number of image-text pairs.
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
Figure 7: Comparison of noun-phrase statistics before and after filtering CC3M. The total number of unique noun-phrases are reported in the legend.
|
| 446 |
+
|
| 447 |
+
# F Prompts
|
| 448 |
+
|
| 449 |
+
The prompt used to generate image-based conversation from ChatGPT/GPT-4 is shown in Table 13.
|
| 450 |
+
|
| 451 |
+
messages $=$ [ {"role":"system", "content": f"""You are an AI visual assistant, and you are seeing a single image. What you see are provided with five sentences, describing the same image you are looking at. Answer all questions as you are seeing the image.
|
| 452 |
+
|
| 453 |
+
Design a conversation between you and a person asking about this photo. The answers should be in a tone that a visual AI assistant is seeing the image and answering the question. Ask diverse questions and give corresponding answers.
|
| 454 |
+
|
| 455 |
+
Include questions asking about the visual content of the image, including the object types, counting the objects, object actions, object locations, relative positions between objects, etc. Only include questions that have definite answers:
|
| 456 |
+
|
| 457 |
+
(1) one can see the content in the image that the question asks about and can answer confidently; (2) one can determine confidently from the image that it is not in the image. Do not ask any question that cannot be answered confidently.
|
| 458 |
+
|
| 459 |
+
for sample in fewshot_samples: messages.append({"role":"user", "content":sample[‘context’]}) messages.append({"role":"assistant", "content":sample[‘response’]} )
|
| 460 |
+
messages.append({"role":"user", "content":‘\n’.join(query)})
|
| 461 |
+
|
| 462 |
+
Table 13: For each query, we illustrate the prompt construction process for ChatGPT/GPT-4 to collect query[‘response’] from query[‘context’], using few-shot in-context-learning, where examples are from fewshot_samples, each example including input sample[‘context’] and output sample[‘response’]. Note that messages is the final prompt. In this example, we provide the prompt used to generate the conversation response, please see also see its in-context-learning examples in Table 15 and Table 16 for details. We recommend readers to check out the codebase for the prompts to generated two other types of responses, including detailed decription and complex reasoning.
|
| 463 |
+
|
| 464 |
+
# Context type 1: Captions
|
| 465 |
+
|
| 466 |
+
A group of people standing outside of a black vehicle with various luggage. Luggage surrounds a vehicle in an underground parking area People try to fit all of their luggage in an SUV. The sport utility vehicle is parked in the public garage, being packed for a trip Some people with luggage near a van that is transporting it.
|
| 467 |
+
|
| 468 |
+
# Context type 2: Boxes
|
| 469 |
+
|
| 470 |
+

|
| 471 |
+
|
| 472 |
+
person: [0.681, 0.242, 0.774, 0.694], person: [0.63, 0.222, 0.686, 0.516], person: [0.444, 0.233, 0.487, 0.34], backpack: [0.384, 0.696, 0.485, 0.914], backpack: [0.755, 0.413, 0.846, 0.692], suitcase: [0.758, 0.413, 0.845, 0.69], suitcase: [0.1, 0.497, 0.173, 0.579], bicycle: [0.282, 0.363, 0.327, 0.442], car: [0.786, 0.25, 0.848, 0.322], car: [0.783, 0.27, 0.827, 0.335], car: [0.86, 0.254, 0.891, 0.3], car: [0.261, 0.101, 0.787, 0.626]
|
| 473 |
+
|
| 474 |
+
# Response type 1: conversation
|
| 475 |
+
|
| 476 |
+
Question: What type of vehicle is featured in the image?
|
| 477 |
+
|
| 478 |
+
Answer: The image features a black sport utility vehicle (SUV).
|
| 479 |
+
|
| 480 |
+
Question: Where is the vehicle parked?
|
| 481 |
+
|
| 482 |
+
Answer: The vehicle is parked in an underground parking area, likely in a public garage.
|
| 483 |
+
|
| 484 |
+
Question: What are the people in the image doing?
|
| 485 |
+
|
| 486 |
+
Answer: The people are trying to fit all of their luggage into the SUV, likely preparing for a trip.
|
| 487 |
+
|
| 488 |
+
# Response type 2: detailed description
|
| 489 |
+
|
| 490 |
+
The image is an underground parking area with a black sport utility vehicle (SUV) parked. There are three people in the scene, with one person standing closer to the left side of the vehicle, another person in the middle, and the third person on the right side. They are all working together to pack their luggage into the SUV for a trip.
|
| 491 |
+
|
| 492 |
+
In the parking area, various luggage items are scattered around the vehicle. There are two backpacks, one located near the left rear wheel and the other closer to the right side of the vehicle. Additionally, there are two suitcases, one on the right side of the car and another further away near the center of the parking area. A bicycle can also be seen on the left side of the vehicle.
|
| 493 |
+
|
| 494 |
+
Other cars are parked around the main SUV, with one car positioned behind it and slightly to the left, another behind and slightly to the right, and the third car further behind on the right side.
|
| 495 |
+
|
| 496 |
+
# Response type 3: complex reasoning
|
| 497 |
+
|
| 498 |
+
Question: What challenges do these people face?
|
| 499 |
+
|
| 500 |
+
Answer: In the image, a group of people is standing outside a black SUV in a parking area, surrounded by various pieces of luggage, including suitcases and backpacks. They are facing the challenge of fitting all their luggage into the black SUV. There are multiple suitcases and backpacks to be packed, which suggests that the group has a significant amount of belongings to accommodate. They might have to strategize and arrange the luggage efficiently to ensure that everything fits properly into the vehicle. Additionally, they need to consider the comfort of the passengers and visibility while driving, so the placement of the luggage must not obstruct the driver’s view or make the passengers uncomfortable during the trip.
|
| 501 |
+
|
| 502 |
+
# Captions
|
| 503 |
+
|
| 504 |
+
There is a movie theater that displays the show times above the doors.
|
| 505 |
+
A red fire hydrant is deep in the snow.
|
| 506 |
+
The fire hydrant is in the snow near a recently plowed sidewalk.
|
| 507 |
+
This city has had a very hard winter with snow.
|
| 508 |
+
A hotel for dogs in the snow in winter.
|
| 509 |
+
|
| 510 |
+
# Conversation
|
| 511 |
+
|
| 512 |
+
Answer:
|
| 513 |
+
|
| 514 |
+
The image suggests that the winter season in the city has been quite harsh and challenging. The significant snow accumulation seen in the image indicates that the city has experienced heavy snowfall, which can lead to various difficulties and disruptions for its residents.
|
| 515 |
+
|
| 516 |
+
For instance, the deep snow covering the fire hydrant could potentially hinder its accessibility in case of emergencies, which poses safety concerns. The recently plowed sidewalk implies that the city’s maintenance crews have been actively working to keep the walkways clear and safe for pedestrians, but the sheer amount of snowfall might make it difficult to keep up with the continuous snow removal efforts.
|
| 517 |
+
|
| 518 |
+
Furthermore, such extreme winter conditions can impact transportation, leading to traffic issues, delays in public transit, and increased risks of accidents due to slippery roads. It can also cause problems for businesses and schools, as people might face challenges commuting to work or attending classes. Additionally, the heavy snow can put extra strain on infrastructure, such as roofs and power lines, increasing the likelihood of structural damage or power outages.
|
| 519 |
+
|
| 520 |
+
In conclusion, the image of the red fire hydrant deep in the snow and the recently plowed sidewalk suggest that the city has faced a particularly severe winter season, with substantial snowfall that has likely caused various challenges and disruptions for its residents and infrastructure.
|
| 521 |
+
|
| 522 |
+
# Captions
|
| 523 |
+
|
| 524 |
+
A man is skiing in the open snow covered hill
|
| 525 |
+
|
| 526 |
+
A skier is making his way into the snow. A skier on the foothills of a huge mountain range. A skier looks at mountains while standing near a trail sign. a single person skiing by an area with a lot of bushes
|
| 527 |
+
|
| 528 |
+
# Conversation
|
| 529 |
+
|
| 530 |
+
The skier is skiing in the snow-covered hills, making his way through the snow and enjoying the beautiful mountain scenery.
|
| 531 |
+
They are also standing near a trail sign, which indicates their location on the mountain.
|
| 532 |
+
|
| 533 |
+
No, there is only a single person skiing in the image, and they are surrounded by an area with a lot of bushes.
|
| 534 |
+
|
| 535 |
+
Question: What kind of skiing is the person doing? Cross-country or downhill?
|
| 536 |
+
|
| 537 |
+
Answer:
|
| 538 |
+
|
| 539 |
+
Based on what I can see in the photo, it is not possible to definitively determine whether the skier is doing cross-country or downhill skiing. However, given the presence of a trail sign and the fact that they are skiing in the foothills, it is more likely that the skier is engaged in cross-country skiing. Downhill skiing typically takes place on more steep slopes and involves ski lifts, whereas cross-country skiing often occurs on relatively flatter terrain with marked trails.
|
| 540 |
+
|
| 541 |
+
$= = =$
|
| 542 |
+
|
| 543 |
+
Question: Can you explain cross-country and downhill skiing a bit more?
|
| 544 |
+
|
| 545 |
+
Answer:
|
| 546 |
+
|
| 547 |
+
Cross-country skiing and downhill skiing are two distinct types of skiing, each with its own techniques, equipment, and terrain preferences.
|
| 548 |
+
|
| 549 |
+
1. Cross-Country Skiing:
|
| 550 |
+
|
| 551 |
+
Also known as Nordic skiing, cross-country skiing involves traversing relatively flat terrain or gentle slopes using skis and poles. It is a popular recreational and competitive sport that focuses on endurance, balance, and aerobic fitness. Cross-country skiers use their own locomotion to move across snow-covered terrain, rather than relying on ski lifts or other forms of assistance.
|
| 552 |
+
|
| 553 |
+
There are two main techniques in cross-country skiing:
|
| 554 |
+
|
| 555 |
+
- Classic: This technique involves skiing in parallel tracks, using a forward-and-backward gliding motion while keeping the skis parallel to each other. The skier uses their poles to propel themselves forward.
|
| 556 |
+
|
| 557 |
+
- Skate skiing: This technique is similar to ice skating, where the skier pushes off one ski at an angle and glides on the other. It requires a smooth, groomed surface and is typically faster than the classic technique.
|
| 558 |
+
|
| 559 |
+
Cross-country ski equipment consists of lightweight skis, boots, bindings, and poles. The boots are more flexible than those used in downhill skiing, allowing for better ankle movement and control.
|
| 560 |
+
|
| 561 |
+
2. Downhill Skiing:
|
| 562 |
+
|
| 563 |
+
Also known as alpine skiing, downhill skiing involves descending slopes at high speeds using skis and poles for balance and control. This sport is more focused on speed, technique, and navigating challenging terrain, including steep slopes, moguls, and even jumps.
|
| 564 |
+
|
| 565 |
+
Downhill skiing can be further categorized into several disciplines, such as slalom, giant slalom, super-G, and downhill racing.
|
| 566 |
+
Each discipline has its own set of rules, courses, and ski equipment.
|
| 567 |
+
|
| 568 |
+
Downhill ski equipment includes heavier and stiffer skis, boots, bindings, and poles than those used in cross-country skiing. The boots are more rigid to provide better support and control during high-speed descents and sharp turns.
|
| 569 |
+
|
| 570 |
+
In summary, cross-country skiing is an endurance-based sport that involves traveling across flat or gently sloping terrain, while downhill skiing is focused on speed and technique as skiers navigate steeper slopes and challenging terrain. Both sports require specialized equipment and techniques, but they offer different experiences and challenges to participants.
|
md/dev/x2WTG5bV977/x2WTG5bV977.md
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The Curse of Low Task Diversity: On the Failure of Transfer Learning to Outperform MAML and their Empirical Equivalence
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Recently, it has been observed that a transfer learning solution might be all we need
|
| 11 |
+
2 to solve many few-shot learning benchmarks – thus raising important questions
|
| 12 |
+
3 about when and how meta-learning algorithms should be deployed. In this paper,
|
| 13 |
+
4 we seek to clarify these questions by 1. proposing a novel metric – the diversity
|
| 14 |
+
5 coefficient – to measure the diversity of tasks in a few-shot learning benchmark
|
| 15 |
+
6 and 2. by comparing MAML and transfer learning under fair conditions (same
|
| 16 |
+
7 architecture, same optimizer and all models trained to convergence). Using the
|
| 17 |
+
8 diversity coefficient, we show that the popular MiniImagenet and Cifar-fs few-shot
|
| 18 |
+
9 learning benchmarks have low diversity. This novel insight contextualizes claims
|
| 19 |
+
10 that transfer learning solutions are better than meta-learned solutions in the regime
|
| 20 |
+
11 of low diversity under a fair comparison. Specifically, we empirically find that a low
|
| 21 |
+
12 diversity coefficient correlates with a high similarity between transfer learning and
|
| 22 |
+
13 Model-Agnostic Meta-Learning (MAML) learned solutions in terms of accuracy
|
| 23 |
+
14 at meta-test time and classification layer similarity (using feature based distance
|
| 24 |
+
15 metrics like SVCCA, PWCCA, CKA, and OPD). To further support our claim,
|
| 25 |
+
16 we find this meta-test accuracy holds even as the model size changes. Therefore,
|
| 26 |
+
17 we conclude that in the low diversity regime, MAML and transfer learning have
|
| 27 |
+
18 equivalent meta-test performance when both are compared fairly. We also hope
|
| 28 |
+
19 our work inspires more thoughtful constructions and quantitative evaluations of
|
| 29 |
+
20 meta-learning benchmarks in the future.
|
| 30 |
+
|
| 31 |
+
# 21 1 Introduction
|
| 32 |
+
|
| 33 |
+
22 The success of deep learning in computer vision (1; 2), natural language processing (3; 4), game
|
| 34 |
+
23 playing $\textcircled { 5 } \textcircled { 6 } \textcircled { 7 }$ and more, keeps motivating a growing body of applications of deep learning on
|
| 35 |
+
24 an increasingly wide variety of domains. In particular, deep learning is now routinely applied to
|
| 36 |
+
25 few-shot learning – a research challenge that assesses a model’s ability to learn to adapt to new tasks,
|
| 37 |
+
26 new distributions, or new environments. This has been the main research area where meta-learning
|
| 38 |
+
27 algorithms have been applied – since such a strategy seems promising in a small data regime due to
|
| 39 |
+
28 its potential to learn to learn or learn to adapt. However, it was recently shown $\textcircled{8}$ that a transfer
|
| 40 |
+
29 learning model with a fixed embedding can match and outperform many modern sophisticated meta
|
| 41 |
+
30 learning algorithms on numerous few-shot learning benchmarks $\bigoplus \iiiint \bigoplus \iiiint \bigoplus \iiiint$ . This growing body of
|
| 42 |
+
31 evidence – coupled with these surprising results in meta-learning – raise the question if researchers are
|
| 43 |
+
32 applying meta-learning with the right inductive biases $\textcircled { 1 3 } ; \textcircled { 1 4 }$ and designing appropriate benchmarks
|
| 44 |
+
33 for meta-learning. Our evidence suggests this is not the case.
|
| 45 |
+
34 In this work, we show that when the task diversity – a novel measure of variability across tasks – is
|
| 46 |
+
35 low, then MAML (Model Agnostic Meta-Learning) $\textcircled{1 1 5 }$ learned solutions have the same accuracy
|
| 47 |
+
36 as transfer learning (i.e., a supervised learned model with a fine-tuned final linear layer). We want
|
| 48 |
+
37 to emphasize the importance of doing such an analysis fairly: with the same architecture, same
|
| 49 |
+
38 optimizer and all models trained to convergence. This empirical equivalence remained true even as
|
| 50 |
+
39 the model size changed – thus further suggesting this equivalence is more a property of the data than
|
| 51 |
+
40 of the model. Therefore, we suggest taking a problem-centric approach to meta-learning and suggest
|
| 52 |
+
41 applying Marr’s level of analysis $\textcircled { 1 6 } ; \textcircled { 1 7 } \textcircled { }$ to few-shot learning – to identify the family of problems
|
| 53 |
+
42 suitable for meta-learning. Marr emphasized the importance of understanding the computational
|
| 54 |
+
43 problem being solved and not only analyzing the algorithms or hardware that attempts to solve
|
| 55 |
+
44 them. An example given by Marr is marveling at the rich structure of bird feathers without also
|
| 56 |
+
45 understanding the problem they solve is flight. Similarly, there has been analysis of MAML solutions
|
| 57 |
+
46 and transfer learning without putting the problem such solutions should solve into perspective $( \overline { { 1 8 } } ; \overline { { 1 9 } } )$ .
|
| 58 |
+
47 Therefore, in this work, we hope to clarify some of these results by partially placing the current
|
| 59 |
+
48 state of affairs in meta-learning from a problem-centric view. In addition, the novelty of our analysis
|
| 60 |
+
49 compared to previous work is that we make analysis intrinsic of the data as a first class citizen.
|
| 61 |
+
|
| 62 |
+
50 Our contributions summarized as follows:
|
| 63 |
+
|
| 64 |
+
1. We propose a novel metric that quantifies the intrinsic diversity of the data of a few-shot learning benchmark. We call it the diversity coefficient. It enables analysis of meta-learning algorithms through a problem-centric framework. It also goes beyond counting the number of classes or number of data points or counting the number concatenated data sets – and instead quantifies the expected diversity/variability of tasks in a few-shot learning benchmark.
|
| 65 |
+
|
| 66 |
+
2. We analyze the two most prominent few-shot learning benchmarks – MiniImagenet and Cifar-fs – and show that their diversity is low. These results are robust across different ways to measure the diversity coefficient, suggesting that our approach is robust.
|
| 67 |
+
|
| 68 |
+
3. With this context, we partially clarify the surprising results from $\textcircled { 1 1 9 }$ by comparing their transfer learning method against models trained with MAML $\textcircled{1 1 5 }$ . In particular, when making a fair comparison, transfer learning method with a fixed feature extractor fails to outperform MAML. We define a fair comparison when the two methods are compared using the same architecture (backbone), same optimizer and all models trained to convergence. We also show that their final layer makes similar predictions according to neural network distance techniques like distance based Singular Value Canonical Correlation Analysis (SVCCA), Projection Weighted (PWCCA), Linear Centered Kernel Analysis (LINCKA) and Orthogonal Procrustes Distance (OPD). This equivalence holds even as the model size increases.
|
| 69 |
+
|
| 70 |
+
4. Interestingly, we also find that even in the regime where task diversity is low (in MiniImagenet and Cifar-fs), the features extracted by supervised learning and MAML are different – implying that the mechanism by which they function is different despite the similarity of their final predictions.
|
| 71 |
+
|
| 72 |
+
5. As an actionable conclusion, we provide a metric that can be used to analyze the intrinsic diversity of the data in a few-shot learning benchmarks and therefore build more thoughtful environments to drive research in meta-learning. In addition, our evidence suggests the following test to predict the empirical equivalence of MAML and transfer learning: if the task diversity is low, then transfer learned solutions might fail to outperform meta-learned solutions. This test is easy to run because our diversity coefficient can be done using the Task2Vec method $\textcircled { 1 2 0 }$ using pre-trained neural network. We also found that random networks were consistent with the results of pre-trained networks on Imagenet.
|
| 73 |
+
|
| 74 |
+
81 We hope that this line of work inspires a problem-centric first approach to meta-learning – which
|
| 75 |
+
82 appears to be especially sensitive to the properties of the problem in question. Therefore, we hope
|
| 76 |
+
83 future work takes a more thoughtful and quantitative approach to benchmark creation – instead of
|
| 77 |
+
84 focusing only on making huge data sets.
|
| 78 |
+
|
| 79 |
+
# 2 Background
|
| 80 |
+
|
| 81 |
+
In this section, we provide a summary of the background needed to understand our main results.
|
| 82 |
+
|
| 83 |
+
87 Model-Agnostic Meta-Learning (MAML): The MAML algorithm $\textcircled{1 1 5 }$ attempts to meta-learn
|
| 84 |
+
88 an initialization of parameters for a neural network so that it is primed for fast gradient descent
|
| 85 |
+
|
| 86 |
+
adaptation. It consists of two main optimization loops: 1) an outer loop used to prime the parameters for fast adaptation, and 2) an inner loop that does the fast adaptation. During meta-testing, only the inner loop is used to adapt the representation learned by the outer loop.
|
| 87 |
+
|
| 88 |
+
92 Transfer Learning with Union Supervised Learning (USL): Previous work $\textcircled { 1 9 }$ shows that
|
| 89 |
+
93 an initialization trained with supervised learning, on a union of all tasks, can outperform many
|
| 90 |
+
94 sophisticated methods in meta-learning. In particular, their method consists of two stages: 1) first
|
| 91 |
+
95 they use a union of all the labels in the few-shot learning benchmark during meta-training and train
|
| 92 |
+
96 with standard supervised learning (SL), then 2) during the meta-testing, they use an inference method
|
| 93 |
+
97 common in transfer learning: extract a fixed feature from the neural network and fully fine-tune the
|
| 94 |
+
98 final classification layer (i.e., the head). Note that our experiments only consider when the final layer
|
| 95 |
+
99 is regularized Logistic Regression trained with LBGFS.
|
| 96 |
+
100 Distances for Deep Neural Network Feature Analysis: To compute the distance between neural
|
| 97 |
+
101 networks we use the distance versions of Singular Value Canonical Correlation Analysis (SVCCA)
|
| 98 |
+
102 $\textcircled { 2 1 }$ , Projection Weighted Canonical Correlation (PWCCA) $\textcircled { 1 2 2 }$ , Linear Centered Kernel Analysis
|
| 99 |
+
103 (LINCKA) $\textcircled { 1 2 3 }$ and Orthogonal Procrustes Distance (OPD) $\textcircled { 1 2 4 }$ . These distances are in the interval
|
| 100 |
+
104 $[ 0 , 1 ]$ and are not necessarily a formal distance metric but are guaranteed to be zero when their
|
| 101 |
+
105 inputs are equal and nonzero otherwise. This is true because SVCCA, PWCCA, LINCKA are based
|
| 102 |
+
106 on similarity metrics and OPD is already a distance. Note that we use the formula $d ( X , Y ) =$
|
| 103 |
+
107 $1 - s i m ( X , Y )$ for our distance metrics where sim is one either SVCCA, PWCCA, LINCKA
|
| 104 |
+
108 similarity metric and $X , Y$ are matrices of activations (called layer matrices). The distance between
|
| 105 |
+
109 two models is computed by choosing a layer and then comparing the features/activations after
|
| 106 |
+
110 adaptation for that layer given a batch of tasks represented as a support and query set. A more
|
| 107 |
+
111 thorough overview of these metrics for the analysis of internal representations for convolutional
|
| 108 |
+
112 neural networks (CNNS) can be found in the appendix, section G.
|
| 109 |
+
113 Task2Vec Embeddings for Distances between Tasks: The diversity coefficient we propose is
|
| 110 |
+
114 the expectation of distance between tasks (explain in more detail in section $\textcircled { 3 }$ ). Therefore, it is
|
| 111 |
+
115 essential to define the distance between different pairs of tasks. We choose the cosine distance
|
| 112 |
+
116 between Task2Vec (vectorial) embeddings as in $\textcircled { 1 2 0 }$ . Therefore, we provide a summary of the
|
| 113 |
+
117 Task2Vec method to compute task embeddings. The vectorial representation of tasks provided by
|
| 114 |
+
118 Task2Vec $\textcircled { 1 2 0 }$ is the vector of diagonal entries of the Fisher Information Matrix (FIM) given a fix
|
| 115 |
+
119 neural network as a feature extractor – also called a probe network – after fine-tuning the final
|
| 116 |
+
120 classification layer to the task. The authors explain this is a good vectorial representation of tasks
|
| 117 |
+
121 because 1. It approximately indicates the most informative weights for solving the current task
|
| 118 |
+
122 (up to a second order approximation) 2. For rich probe networks like CNNs, the diagonal is more
|
| 119 |
+
123 computationally tractable. We choose Task2Vec because the original authors provide extensive
|
| 120 |
+
124 evidence that their embeddings correlate with semantic and taxonomic relations between different
|
| 121 |
+
125 visual classes – making it a convincing embedding for tasks $\textcircled { 1 2 0 }$ . The Task2Vec embedding of task $\tau$
|
| 122 |
+
126 is the diagonal of the following matrix:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\hat { F } _ { D _ { \tau } , f _ { w } } = \hat { F } ( D _ { \tau } , f _ { w } ) = \mathbb { E } _ { \boldsymbol { x } , \boldsymbol { y } \sim \hat { p } ( \boldsymbol { x } | \tau ) p ( \boldsymbol { y } | \boldsymbol { x } , f _ { w } ) } [ \nabla _ { w } \log p ( \boldsymbol { y } \mid \boldsymbol { x } , f _ { w } ) \nabla _ { w } p ( \boldsymbol { y } \mid \boldsymbol { x } , f _ { w } ) ^ { \top } ]
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
127 where $f _ { w }$ is the neural networks used as a feature extractor with architecture $f$ and weights $w$ ,
|
| 129 |
+
128 $\hat { p } ( x \mid \tau )$ is the empirical distribution defined by the training data $D _ { \tau } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { \bar { n } }$ for task $\tau$ , and
|
| 130 |
+
129 $p ( y \mid x , f _ { w } )$ is a deep neural network trained to approximate the (empirical) posterior $\hat { p } ( y \mid x , \tau )$ .
|
| 131 |
+
130 We’d like to emphasize that the there is a dependence on target label since Task2Vec fixes the
|
| 132 |
+
131 feature extractor (using $f _ { w , }$ ) and then fits the final layer (or “head") to approximate the task posterior
|
| 133 |
+
132 distribution $\hat { p } ( y \mid x , \tau )$ .
|
| 134 |
+
|
| 135 |
+
# 133 3 Definition of the Diversity Coefficient
|
| 136 |
+
|
| 137 |
+
134 The diversity coefficient aims to measure the intrinsic diversity (or variability) of tasks in a few-shot
|
| 138 |
+
135 learning benchmark. At a high level, the diversity coefficient is the expected distance between a
|
| 139 |
+
136 pair of different tasks given a fixed probe network. In this work, we choose the distance to be the
|
| 140 |
+
137 cosine distance between vectorial representations (i.e. embeddings) of tasks according to Task2Vec
|
| 141 |
+
138 as described in section $2 .$ Using a fixed probe networks is essential because: 1. Using a fixed probe
|
| 142 |
+
139 network means that the distances between different tasks are comparable, as discussed in the original
|
| 143 |
+
140 Task2Vec $\textcircled{20 }$ and 2. Since we are computing the distance between different tasks, we need to make
|
| 144 |
+
141 sure the difference comes from intrinsic properties of the data and not from a different source, e.g. if
|
| 145 |
+
142 one uses different models then this might confound the source of variability in our metric. We define
|
| 146 |
+
143 the diversity coefficient of a few-shot learning benchmark $B$ as follows:
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\begin{array} { r } { \hat { d i } v ( B ) = \mathbb { E } _ { \tau _ { 1 } \sim \hat { p } ( \tau | B ) , \tau _ { 2 } \sim \hat { p } ( \tau | B ) } \mathbb { E } _ { D _ { 1 } \sim \hat { p } ( x _ { 1 } , y _ { 1 } | \tau _ { 1 } ) , D _ { 2 } \sim \hat { p } ( x _ { 2 } , y _ { 2 } | \tau _ { 2 } ) } \left[ d ( \hat { F } _ { D _ { 1 } , f _ { w } } , \hat { F } _ { D _ { 2 } , f _ { w } } ) \right] } \end{array}
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
144 where $f _ { w }$ is the neural networks used as a feature extractor with architecture $f$ and weights $w$ ,
|
| 153 |
+
145 $\hat { p } ( x \mid \tau )$ is the empirical distribution defined by the training data $D _ { \tau } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ for task $\tau$
|
| 154 |
+
146 $\tau _ { 1 } , \tau _ { 2 }$ are tasks sampled from the empirical distribution of tasks $\hat { p } ( \tau \mid B )$ for the current benchmark
|
| 155 |
+
147 $B$ (i.e. a batch of tasks with their data sets $\mathcal { D } = ( \tau _ { i } , D _ { \tau _ { i } } ) _ { i = 1 } ^ { N } )$ , a task $\tau _ { i }$ is the probability distribution
|
| 156 |
+
148 $p ( x , y \mid \tau )$ of the data, is a distance metric (for us cosine), $f _ { w }$ is the neural networks used as
|
| 157 |
+
149 a feature extractor with architecture $f$ and weights $w$ , and $\hat { p } ( x \mid \tau )$ is the empirical distribution
|
| 158 |
+
150 defined by the training data $D _ { \tau } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ for task $\tau$ . We’d also like to recall the reader that the
|
| 159 |
+
151 definition of a task in this setting is of a n-way, $\mathbf { k }$ -shot few-shot learning task. Therefore, each task has
|
| 160 |
+
152 n classes sampled with $\mathrm { k }$ examples used for the adaptation. We’d like to emphasize that the adaptation
|
| 161 |
+
153 here is only to fine-tune the final layer according to the Task2Vec method for the correct computation
|
| 162 |
+
154 of the FIM. Therefore, in this setting we combine the support and query set as the split is not relevant
|
| 163 |
+
155 for the computation of the task embedding using Task2Vec. Note that the above formulation can be
|
| 164 |
+
156 easily adapted to any distance function between tasks, and is not necessarily specific to using the
|
| 165 |
+
157 FIM or cosine distance. For example, given the true distributions for tasks one can use real distances
|
| 166 |
+
158 between probability distributions e.g. Hellinger distance. In addition, it is obvious one can use a
|
| 167 |
+
159 distance function besides the cosine distance – but choose it in accordance to the original work of
|
| 168 |
+
160 Task2Vec $\textcircled { 1 2 0 }$ .
|
| 169 |
+
|
| 170 |
+
# 4 Experiments
|
| 171 |
+
|
| 172 |
+
62 This section explains the experiments backing up our main results outlined in our list of contributions.
|
| 173 |
+
63 Experimental details are provided in the supplementary section $\bigstar$ and the learning curves displaying
|
| 174 |
+
64 the convergence for a fair comparison are in supplementary section B.
|
| 175 |
+
|
| 176 |
+
# 165 4.1 The Diversity Coefficient of MiniImagenet and Cifar-fs
|
| 177 |
+
|
| 178 |
+
66 To put our analysis into a problem-centric framework, we first analyze the problem they are trying
|
| 179 |
+
7 to solve through the diversity coefficient. Recall that the diversity coefficient aims to quantify the
|
| 180 |
+
8 intrinsic variation of tasks in a few-shot learning benchmark. We show that the diversity coefficient
|
| 181 |
+
69 of the popular MiniImagenet and Cifar-fs benchmarks are low with good confidence intervals using
|
| 182 |
+
70 four different probe networks in table 1.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Probe Network</td><td>Diversity on MI</td><td>Diversity on Cifar-fs</td></tr><tr><td>Resnet18 (pt)</td><td>0.117 ± 2.098e-5</td><td>0.100 ± 2.18e-5</td></tr><tr><td>Resnet18 (rand)</td><td>0.0955 ± 1.29e-5</td><td>0.103 ± 1.05e-5</td></tr><tr><td>Resnet34 (pt)</td><td>0.0999 ± 1.95e-5</td><td>0.0847 ± 3.06e-5</td></tr><tr><td>Resnet34 (rand)</td><td>0.0620 ± 8.12e-6</td><td>0.0643 ± 9.64e-6</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Table 1: The diversity coefficient of MiniImagenet (MI) and Cifar-fs is low. The diversity coefficient was computed using the cosine distance between different standard n-way, $\mathbf { k }$ -shot classification tasks from the few-shot learning benchmark using the Task2Vec method described in section $3 .$ We used $\mathrm { n } { = } 5$ (number of classes) and ${ \bf k } = 2 0$ (number of examples per class) since we can use the whole task data to compute the diversity coefficient (no splitting of support and query set required). We used Resnet18 and Resnet34 networks as probe networks – both pre-trained on ImageNet (indicated as “pt" on table) and randomly initialized (indicated as “rand" on table). We observe that both type of networks and weights give similar diversity results. All confidence intervals were at $9 5 \%$ . To compute results, we used 500 few-shot learning tasks and only compare pairs of different tasks. This results in $( 5 0 0 ^ { 2 } - 5 0 0 ) / 2 = 1 2 4 ,$ 750 pair-wise distances used to compute the diversity coefficient.
|
| 187 |
+
|
| 188 |
+
# 171 4.2 Low Diversity Correlates with Equivalence of MAML and Transfer Learning
|
| 189 |
+
|
| 190 |
+
172 Now that we have placed ourselves in a problem-centric framework and shown the diversity coefficient
|
| 191 |
+
173 of the popular MiniImagenet and Cifar-fs benchmarks are low – we proceed to show the failure of
|
| 192 |
+
174 transfer learning (with USL) to outperform MAML. Crucially, the analysis was done using a fair
|
| 193 |
+
175 comparison: using the same model architecture, optimizer, and training all models to convergence
|
| 194 |
+
176 – details in section A. We used the five-layer CNN used in $\textcircled { 1 5 } \textcircled { 2 5 }$ and Resnet12 as in $\textcircled { 1 9 }$ . We
|
| 195 |
+
177 provide evidence that in the setting of low diversity:
|
| 196 |
+
|
| 197 |
+
1. The accuracy of an adapted MAML meta-learner vs. an adapted USL pre-trained model are similar and statistically significant, except for one result where transfer learning with USL is worse. This is shown in table 2 and 1.
|
| 198 |
+
2. The distance for the classification layer decreases sharply according to four distance-based metrics – SVCCA, PWCCA, LINCKA, and OPD – as shown in figure $2 .$ This implies the predictions of the two are similar.
|
| 199 |
+
|
| 200 |
+
184 For the first point, we emphasize that tables 1 and table 2 taken together support our central hypothesis:
|
| 201 |
+
185 that models trained with meta-learning are not inferior to transfer learning models (using USL) when
|
| 202 |
+
186 the diversity coefficient is low. Careful inspection reveals that the methods have the same meta-test
|
| 203 |
+
187 accuracy with intersecting confidence intervals – making the results statistically significant across
|
| 204 |
+
188 few-shot benchmarks and architectures. The one exception is the third set of bar plots, where transfer
|
| 205 |
+
189 learning with USL is in fact worse.
|
| 206 |
+
190 For the second point, refer to figure $\nsubseteq$ and observe that as the depth of the network increases, the
|
| 207 |
+
191 distance between the activation layers of a model trained with MAML vs USL increases until it
|
| 208 |
+
192 reaches the final classification layer – where all four metrics display a noticeable dip. In particular,
|
| 209 |
+
193 PWCCA considers the two prediction layers identical (approximately zero distance). This final point
|
| 210 |
+
194 is particularly interesting because PWCCA is weighted according to the CCA weights that stabilize
|
| 211 |
+
195 with the final predictions of the network. This means that the PWCCA distance value is reflective of
|
| 212 |
+
196 what the networked actually learned and gives a more reliable distance metric (for details, refer to the
|
| 213 |
+
197 appendix section G.5). This is important because this supports our main hypothesis: that at prediction
|
| 214 |
+
198 time there is an equivalence between transfer learning and MAML when the diversity coefficient is
|
| 215 |
+
199 low.
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
Figure 1: MAML trained models and union supervised trained (USL) models have statistically equivalent meta-test accuracy for MiniImagenet and Cifar-fs with Resnet12 and five layer CNNs. This holds for both the Resnet12 architecture used in $\textcircled { 1 9 }$ and the 5 layer CNN (indicated as “5CNN") in $\textcircled { 1 2 5 }$ . Results used a (meta) batch-size of 100 tasks and $9 5 \%$ confidence intervals. All MAML models were trained with 5 inner steps during meta-training. “MAML5" and “MAML10" in the bar plot indicates the adaptation method used at test time i.e. we used 5 inner steps and 10 inner steps at test time. MiniImagenet is abbreviated as “MI" in the figure.
|
| 219 |
+
|
| 220 |
+
# 00 4.3 Is the Equivalence of MAML and Transfer Learning related to Model Size or Low 01 Diversity?
|
| 221 |
+
|
| 222 |
+
An alternative hypothesis to explain the equivalence of transfer learning (with USL) and MAML could be due to the capabilities of large neural networks to be better meta-learners in general. Inspired by the impressive ability of large language models to be few-shot (or even zero-shot) learners $\textcircled { 1 4 } \textcircled { 2 7 } \textcircled { 2 8 } \textcircled { 3 } \textcircled { - }$ we hypothesized that perhaps the meta-learning capabilities of deep learning models is a function of the model size. If this were true, then we expected to see the difference in meta-test accuracy
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Meta-train Initialization </td><td>Adaptation at Inference</td><td>Meta-test Accuracy</td></tr><tr><td>Random</td><td>no adaptation</td><td>19.3 ± 0.80</td></tr><tr><td>MAML0</td><td>no adaptation</td><td>20.0 ± 0.00</td></tr><tr><td>USL</td><td>no adaptation</td><td>15.0 ± 0.26</td></tr><tr><td>Random</td><td>MAML5 adaptation</td><td>34.2 ± 1.16</td></tr><tr><td>MAML5</td><td>MAML5 adaptation</td><td>62.4 ± 1.64</td></tr><tr><td>USL</td><td>MAML5 adaptation</td><td>25.1 ± 0.98</td></tr><tr><td>Random</td><td>MAML10 adaptation</td><td>34.1 ± 1.23</td></tr><tr><td>MAML5</td><td>MAML10 adaptation</td><td>62.3 ± 1.50</td></tr><tr><td>USL</td><td>MAML10 adaptation</td><td>25.1 ± 0.97</td></tr><tr><td>Random</td><td>Adapt Head only (with LR)</td><td>40.2 ± 1.30</td></tr><tr><td>MAML5</td><td>Adapt Head only (with LR)</td><td>59.7 ± 1.37</td></tr><tr><td>USL</td><td>Adapt Head only (with LR)</td><td>60.1 ± 1.37</td></tr></table>
|
| 225 |
+
|
| 226 |
+
Table 2: MAML trained representations and supervised trained representation have statistically equivalent meta-test accuracy on MiniImagenet – which has low diversity. The transfer model’s adaptation is labeled as “Adapted Head only (with LR)" – which stands for “Logistic Regression (LR)" used in $\textcircled{1 1 9 }$ . More precisely, we used Logistic Regression (LR) with LBFGS with the default value for the l2 regularization parameter given by Python’s Sklearn. Note that an increase in inner steps from 5 to 10 with the MAML5 trained model does not provide an additional meta-test accuracy boost, consistent with previous work $\textcircled { 1 2 6 }$ . Note that the fact that the MAML5 representation matches the USL representation when both use the same adaptation method is not surprising – given that: 1) previous work has shown that the distance between the body of an adapted MAML model is minimal compared to the unadapted MAML (which we reproduce in $\boxed { 5 }$ in the green line) and 2) the fact that a MAML5 adaptation is only 5 steps of MAML while LR fully converges the prediction layer. We want to highlight that only the MAML5 model achieved the maximum meta-test performance of 0.6 with the MAML5 adaptation – suggesting that the USL and MAML5 meta-learning algorithms might learn different representations. For USL to have a fair comparison during meta-test time when using the MAML adaptation, we provide the MAML final layer learned initialization parameters to the USL model (but any is fine due to convexity when using a fixed feature extractor). This is needed since during meta-training USL is trained with a union of all the labels (64) – so it does not even have the right output size of 5 for few-shot prediction. Meta-testing was done in the standard 5-way, 5-shot regime.
|
| 227 |
+
|
| 228 |
+
207 of MAML and USL to be larger for smaller models and the difference to decrease as the model
|
| 229 |
+
208 size increased. Once the two models were, of the same size but large enough, we hypothesized that
|
| 230 |
+
209 the meta-test accuracy would be the same. We tested this to rule out that our observations were a
|
| 231 |
+
210 consequence of the model size. The results were negative and surprisingly the equivalence between
|
| 232 |
+
211 MAML and USL seems to hold even as the model increased – strengthening our hypothesis that the
|
| 233 |
+
212 low task diversity might be a bigger factor explaining our observations. We show this in figure $^ { 3 , }$
|
| 234 |
+
213 and we want to draw attention to the fact this statistical equivalence holds even when using only four
|
| 235 |
+
214 filters – the case where we expected the biggest difference.
|
| 236 |
+
|
| 237 |
+
# 15 4.4 MAML learns a different base model compared to Union Supervised Learned models – 16 even in the presence of low task diversity
|
| 238 |
+
|
| 239 |
+
The first four layers of figure 2 shows how large the distance is of a MAML representation compared to a SL representation. In particular, it is much larger than the distance value in the range $[ 0 , 0 . 1 ]$ from previous work that compared MAML vs. adapted MAML $\textcircled { 1 8 }$ . We reproduced that and indeed MAML vs. adapted MAML has a small difference (smaller for us) – supporting our observations that a MAML vs. a USL learned representations are different at the feature extractor layer even when the diversity is low. Results are statistically significant.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 2: The classification layer of transfer learning and a MAML5 model decrease in distance – implying similar predictions. More precisely, an initialization trained with 5 inner steps (MAML5) has an increasingly similar head (classifier) after adaptation with MAML5 compared to the classifier layer of the union supervise learned (USL) model that has been adapted only at the final layer. In particular, the USL model has been adapted with Logistic Regression (LR) with LBFGS with the default value for the l2 regularization parameter given by Python’s Sklearn (as in $\textcircled { 1 1 9 }$ ). We showed this trend with four different distance metrics SVCCA, PWCCA, LICKA, and OPD referenced in section $\bigstar$ Observe that according to PWCCA the distance between the predictions is zero. This is true because the distance of classification layer (indicated as “head" in the figure) is zero. The architecture used here is a five layer CNN as in $\textcircled { 1 5 } , \textcircled { 2 5 } )$ with their same setup. The benchmark used for this analysis is MiniImagenet.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 3: The meta-test accuracy of MAML and transfer learning using USL is similar in a statistically significant way – regardless of the model size. In this experiment, we used the MiniImagenet benchmark, the five layer CNN used in $\textcircled { 1 5 } \textcircled { 2 5 }$ , and only increased the filter size using sizes 4, 8, 16, and 32. We made sure the comparison was fair by using the same architecture, optimizer, and trained all models to convergence. During meta-training, the MAML model was trained using 5 inner steps. The legends indicating MAMl5 and MAML10 refer to the number of inner steps used at test time. We used a (meta) batch size of 100 tasks.
|
| 246 |
+
|
| 247 |
+
In this section, we show the closeness of MAML and transfer learning (with USL) for synthetic experiments for low and high diversity regimes in Figure $\textcircled { 4 }$ In the low regime, the two methods are equivalent in a statistically significant way – which supports the main claims of our paper. As the diversity increases, however, the difference between USL and MAML increases (in favor of USL). This will be explored further in future work.
|
| 248 |
+
|
| 249 |
+
The task is the usual n-way, $\mathbf { k }$ -shot tasks, but the data comes from a Gaussian and the meta-learners are tasked with classifying from which Gaussian the data points came from in a few-shot learning manner. Benchmarks are created by sampling a Gaussian distribution with means moving away from the origin as the benchmark changes. Therefore, the Gaussian benchmark with the highest diversity coefficient has Gaussians that are the furthest from the origin. We computed the diversity coefficient using a proper distance between distributions using the Hellinger distance eluded in section $3$ instead of the FIM distance. We can do this because we know the ground truth distribution in our synthetic experiments, and Gaussians have a closed form Hellinger distance. Details on the n-way Gaussian benchmark and diversity coefficient using the Hellinger distance can be found in supplementary section E and F.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 4: The meta-test accuracy of MAML and transfer learning using USL is similar in a statistically equivalent way in the low diversity regime in the 5-way, 10-shot Gaussian Benchmarks. MAML models were trained with 5 inner steps. MAML5 and MAML10 indicate the adaptation procedure at test time. Results used a (meta) batch-size of 500 tasks and $9 5 \%$ confidence intervals. As the diversity of the benchmark increases, the Gaussian tasks are sampled further away from the origin. Note, as the diversity increases, the difference between USL and MAML increases (in favor of USL).
|
| 253 |
+
|
| 254 |
+
# 240 5 Related Work
|
| 255 |
+
|
| 256 |
+
241
|
| 257 |
+
242
|
| 258 |
+
243
|
| 259 |
+
244
|
| 260 |
+
245
|
| 261 |
+
246
|
| 262 |
+
247
|
| 263 |
+
248
|
| 264 |
+
249
|
| 265 |
+
250
|
| 266 |
+
251
|
| 267 |
+
252
|
| 268 |
+
253
|
| 269 |
+
254
|
| 270 |
+
|
| 271 |
+
Our work proposes a problem-centric framework for the analysis of meta-learning algorithms inspired from previous puzzling results $\textcircled { 1 9 }$ . We propose to use a pair-wise distance between tasks and analyze how this metric might correlate with meta-learning. The closest line of work for this is the long line of work by $\textcircled { 1 2 0 }$ where they suggest methods to analyze the complexity of a task, propose unsymmetrical distance metrics for data sets, reachability of tasks with SGD, ways to embed entire data sets and more $( | 2 0 ; | 2 9 ; | 3 0 ; | 3 1 | )$ . We believe this line of work to be very fruitful and hope that more people adopt tools like the ones they suggest and we propose in this paper before researching or deploying meta-learning algorithms. We hope this helps meta-learning methods succeed in practice – since cognitive science suggests meta-learning is a powerful method humans use to learn $\textcircled{3 2 }$ . In the future, we hope to compare $\textcircled { 1 2 0 }$ ’s distance metrics between tasks with ours to provide a further unified understanding of meta-learning and transfer learning. A contrast between their work and ours is that we focus our analysis from a meta-learning perspective applied to few-shot learning – while their focus is understanding transfer learning methods between data sets.
|
| 272 |
+
|
| 273 |
+
The use of a distance metric in our definition of the diversity coefficient is inspired by the analysis 255 done by $\textcircled { 1 8 }$ . They showed that MAML functions mainly via feature re-use than by rapid learning i.e., 256 that a model trained with MAML changes very little after the MAML adaptation. The main difference
|
| 274 |
+
|
| 275 |
+
257 of their work with our is: 1) that we compare MAML trained models against union supervised learned
|
| 276 |
+
258 models (USL) instead of only comparing MAML against adapted MAML, and 2) that we explicitly
|
| 277 |
+
259 analyzed properties of the data sets. In addition, we use a large set of distance metrics for our analysis
|
| 278 |
+
260 including: SVCCA, PWCCA, LINCKA and OPD as proposed by (21; 22; 23; 24).
|
| 279 |
+
|
| 280 |
+
Our work is most influenced by previous work suggesting modern meta-learning requires rethinking $\textcircled{1 1 9 }$ The main difference of our work with theirs is that we analyzed the internal representation of the meta-learning algorithms and contextualize these with quantifiable metrics of the problem being solved. Unlike their work, we focused on a fair comparison between meta-learning methods by ensuring the same neural network backbone was used. Another difference is that they gained further accuracy gains by using distillation – a method we did not analyze and leave for future work.
|
| 281 |
+
|
| 282 |
+
267 A related line of work $\textcircled { 1 3 3 } \textcircled { 2 6 }$ first showed that there exist synthetic data sets that are capable of
|
| 283 |
+
268 exhibiting higher degrees of adaptation as compared to the original work by $\textcircled { 1 1 8 }$ . The difference is
|
| 284 |
+
269 that they did not compare MAML models against transfer learning methods like we did here. Instead,
|
| 285 |
+
270 they focused on comparing adapted MAML models vs. unadapted MAML models.
|
| 286 |
+
271 Another related line of work is the predictability of adversarial transferability and transfer learning.
|
| 287 |
+
272 They show this both theoretically and with extensive experiments $\textcircled{3 4 }$ . The main difference between
|
| 288 |
+
273 their work and ours is that they focus their analysis mainly on transfer learning, while we concentrated
|
| 289 |
+
274 on meta-learning for few-shot learning. In addition, we did not consider adversarial transferability –
|
| 290 |
+
275 while that was a central piece of their analysis. Further, related work is outlined in the supplementary
|
| 291 |
+
276 section I.
|
| 292 |
+
|
| 293 |
+
# 77 6 Discussion and Future Work
|
| 294 |
+
|
| 295 |
+
In this work, we presented a problem-centric framework when comparing transfer learning methods with meta-learning algorithms – using USL and MAML as the canonical representatives of transfer and meta-learning methods respectively. We showed the diversity coefficient of the popular MiniImagenet and Cifar-fs benchmark is low and that under a fair comparison – MAML is very similar to transfer learning with USL. This was also true even when decreasing the model size – removing the alternative hypothesis that the equivalence of MAML and transfer learning with USL held due to large models. Instead, this suggests strengthens our hypothesis that the diversity of the data might be the driving factor. The equivalence of MAML and USL also replicated in our synthetic experiments. Therefore, we challenge the suggestions from previous work $\textcircled { 1 1 9 }$ that only a good embedding can beat more effective than sophisticated meta-learning – especially in the low diversity regime. In addition, our synthetic experiments show a promising scenario where we can systematically differentiate meta-learning algorithms from transfer learning algorithms – which supports our actionable suggestion to use the diversity coefficient to effectively study meta-learning and transfer learning algorithms. We hope to study this in more depth in the future with real and synthetic data.
|
| 296 |
+
|
| 297 |
+
We also have theoretical results from a statistical decision perspective in the supplementary section ?? that inspired this work and suggest that when the distance between tasks is zero – then the predictions of transfer learning, meta-learning and even a fixed model with no adaptation are all equivalent (with the l2 loss). The results are theoretically limited because we can only reason when the diversity is exactly zero, but regardless provided an interesting perspective to study and inspire empirical work.
|
| 298 |
+
|
| 299 |
+
We hope this work inspires the community in meta-learning and machine learning to construct benchmarks from a problem-centric perspective – that go beyond large scale data sets – using have quantitative metrics.
|
| 300 |
+
|
| 301 |
+
# References
|
| 302 |
+
|
| 303 |
+
[1] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “ImageNet Classification with Deep Convolutional Neural Networks,”
|
| 304 |
+
[2] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, vol. 2016-December, pp. 770–778, dec 2015.
|
| 305 |
+
[3] J. Devlin, M. W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” NAACL HLT 2019 - 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies - Proceedings of the Conference, vol. 1, pp. 4171–4186, oct 2018.
|
| 306 |
+
[4] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. Mccandlish, A. Radford, I. Sutskever, and D. A. Openai, “Language Models are Few-Shot Learners,” tech. rep., 2020.
|
| 307 |
+
[5] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, and D. Hassabis, “Mastering the game of Go with deep neural networks and tree search,” Nature 2016 529:7587, vol. 529, pp. 484–489, jan 2016.
|
| 308 |
+
[6] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller, “Playing Atari with Deep Reinforcement Learning,”
|
| 309 |
+
[7] W. Ye, S. Liu, T. Kurutach, P. Abbeel, Y. Gao, T. University, U. C. Berkeley, S. Qi, and Z. Institute, “Mastering Atari Games with Limited Data,” oct 2021.
|
| 310 |
+
[8] Y. Tian, Y. Wang, D. Krishnan, J. B. Tenenbaum, and P. Isola, “Rethinking Few-Shot Image Classification: a Good Embedding Is All You Need?,” 2020.
|
| 311 |
+
[9] W.-Y. Chen, Y.-C. Liu, Z. Kira, Y.-C. F. Wang, and J.-B. Huang, “A Closer Look at Few-shot Classification,” 7th International Conference on Learning Representations, ICLR 2019, 2019.
|
| 312 |
+
[10] Y. Chen, X. Wang, Z. Liu, H. Xu, and T. Darrell, “A New Meta-Baseline for Few-Shot Learning,” tech. rep.
|
| 313 |
+
[11] G. S. Dhillon, P. Chaudhari, A. Ravichandran, and S. Soatto, “A Baseline for Few-Shot Image Classification,” 2019.
|
| 314 |
+
[12] S. Huang and D. Tao, “All you need is a good representation: A multi-level and classifier-centric representation for few-shot learning,” 2019.
|
| 315 |
+
[13] T. M. Mitchell, “The Need for Biases in Learning Generalizations by The Need for Biases in Learning Generalizations,” 1980.
|
| 316 |
+
[14] S. B.-D. Shai Shalev-Shwartz, “Understanding Machine Learning: From Theory to Algorithms,” Cambridge University Press, 2014.
|
| 317 |
+
[15] C. Finn, P. Abbeel, and S. Levine, “Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks,” 2017.
|
| 318 |
+
[16] J. B. Hamrick Deepmind and S. M. Deepmind, “LEVELS OF ANALYSIS FOR MACHINE LEARNING,” 2020.
|
| 319 |
+
[17] D. Marr, “Vision: A Computational Investigation into the Human Representation and Processing of Visual Information,” Phenomenology and the Cognitive Sciences, vol. 8, no. 4, p. 397, 1982.
|
| 320 |
+
[18] A. Raghu, M. Raghu, S. Bengio, and G. Brain, “Rapid Learning or Feature Reuse? Towards Understanding the Effectiveness of MAML,” tech. rep., 2020.
|
| 321 |
+
[19] Y. Tian, Y. Wang, D. Krishnan, J. B. Tenenbaum, and P. Isola, “Rethinking Few-Shot Image Classification: a Good Embedding Is All You Need?,” 2020.
|
| 322 |
+
[20] A. Achille UCLA, M. Lam AWS, R. Tewari AWS, A. Ravichandran AWS, S. Maji UMass, S. Soatto UCLA, and P. Perona Caltech, “TASK2VEC: Task Embedding for Meta-Learning Charless Fowlkes UCI and AWS,” tech. rep., 2019.
|
| 323 |
+
[21] M. Raghu, J. Gilmer, J. Yosinski, and J. Sohl-Dickstein, “SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability,” tech. rep., 2017.
|
| 324 |
+
|
| 325 |
+
353 [22] A. S. Morcos, Deepmind, M. Raghu, S. Bengio, and G. Brain, “Insights on representational
|
| 326 |
+
354 similarity in neural networks with canonical correlation,” tech. rep., 2018.
|
| 327 |
+
355 [23] S. Kornblith, M. Norouzi, H. Lee, and G. Hinton, “Similarity of Neural Network Representations
|
| 328 |
+
356 Revisited,” tech. rep., may 2019.
|
| 329 |
+
357 [24] F. Ding, J.-S. Denain, and J. Steinhardt, “Grounding Representation Similarity with Statistical
|
| 330 |
+
358 Testing,” 2021.
|
| 331 |
+
359 [25] S. Ravi and H. Larochelle, “Optimization as a model for few-shot learning,” tech. rep., 2017.
|
| 332 |
+
360 [26] B. Miranda, “An empirical study of the properties of meta-learning - presentation,” Illinois
|
| 333 |
+
361 Digital Environment for Access to Learning and Scholarship (IDEALS), dec 2020.
|
| 334 |
+
362 [27] R. Bommasani, D. A. Hudson, E. Adeli, R. Altman, S. Arora, S. von Arx, M. S. Bernstein,
|
| 335 |
+
363 J. Bohg, A. Bosselut, E. Brunskill, E. Brynjolfsson, S. Buch, D. Card, R. Castellon, N. Chatterji,
|
| 336 |
+
364 A. Chen, K. Creel, J. Q. Davis, D. Demszky, C. Donahue, M. Doumbouya, E. Durmus, S. Ermon,
|
| 337 |
+
365 J. Etchemendy, K. Ethayarajh, L. Fei-Fei, C. Finn, T. Gale, L. Gillespie, K. Goel, N. Goodman,
|
| 338 |
+
366 S. Grossman, N. Guha, T. Hashimoto, P. Henderson, J. Hewitt, D. E. Ho, J. Hong, K. Hsu,
|
| 339 |
+
367 J. Huang, T. Icard, S. Jain, D. Jurafsky, P. Kalluri, S. Karamcheti, G. Keeling, F. Khani,
|
| 340 |
+
368 O. Khattab, P. W. Kohd, M. Krass, R. Krishna, R. Kuditipudi, A. Kumar, F. Ladhak, M. Lee,
|
| 341 |
+
369 T. Lee, J. Leskovec, I. Levent, X. L. Li, X. Li, T. Ma, A. Malik, C. D. Manning, S. Mirchandani,
|
| 342 |
+
370 E. Mitchell, Z. Munyikwa, S. Nair, A. Narayan, D. Narayanan, B. Newman, A. Nie, J. C.
|
| 343 |
+
371 Niebles, H. Nilforoshan, J. Nyarko, G. Ogut, L. Orr, I. Papadimitriou, J. S. Park, C. Piech,
|
| 344 |
+
372 E. Portelance, C. Potts, A. Raghunathan, R. Reich, H. Ren, F. Rong, Y. Roohani, C. Ruiz,
|
| 345 |
+
373 J. Ryan, C. Ré, D. Sadigh, S. Sagawa, K. Santhanam, A. Shih, K. Srinivasan, A. Tamkin,
|
| 346 |
+
374 R. Taori, A. W. Thomas, F. Tramèr, R. E. Wang, and W. Wang, “On the Opportunities and Risks
|
| 347 |
+
375 of Foundation Models,” aug 2021.
|
| 348 |
+
376 [28] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell,
|
| 349 |
+
377 P. Mishkin, J. Clark, G. Krueger, and I. Sutskever, “Learning Transferable Visual Models From
|
| 350 |
+
378 Natural Language Supervision,” feb 2021.
|
| 351 |
+
379 [29] “The Dynamic Distance Between Learning Tasks: \* From Kolmogorov Complexity to Transfer
|
| 352 |
+
380 Learning via Quantum Physics and the Information Bottleneck of the Weights of Deep Networks,”
|
| 353 |
+
381 2018.
|
| 354 |
+
382 [30] A. Achille, G. B. Mbeng, and S. Soatto, “Dynamics and Reachability of Learning Tasks,” 2019.
|
| 355 |
+
383 [31] A. Achille, G. Paolini, G. Mbeng, and S. Soatto, “The Information Complexity of Learning
|
| 356 |
+
384 Tasks, their Structure and their Distance,” 2020.
|
| 357 |
+
385 [32] B. M. Lake, T. D. Ullman, J. B. Tenenbaum, and S. J. Gershman, “Building Machines That
|
| 358 |
+
386 Learn and Think Like People,” Behavioral and Brain Sciences, vol. 40, 2016.
|
| 359 |
+
387 [33] B. Miranda, “An empirical study of the properties of meta-learning - presentation,” Illinois
|
| 360 |
+
388 Digital Environment for Access to Learning and Scholarship (IDEALS), 2020.
|
| 361 |
+
389 [34] K. Liang, J. Y. Zhang, B. Wang, Z. Yang, O. Koyejo, and B. Li, “Uncovering the Connections
|
| 362 |
+
390 Between Adversarial Transferability and Knowledge Transferability,” 2021.
|
| 363 |
+
|
| 364 |
+
# Checklist
|
| 365 |
+
|
| 366 |
+
The checklist follows the references. Please read the checklist guidelines carefully for information on how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description. For example:
|
| 367 |
+
|
| 368 |
+
• Did you include the license to the code and datasets? [Yes] See Section ??. • Did you include the license to the code and datasets? [No] Code and data will be released if accepted.
|
| 369 |
+
|
| 370 |
+
400 Please do not modify the questions and only use the provided macros for your answers. Note that the
|
| 371 |
+
401 Checklist section does not count towards the page limit. In your paper, please delete this instructions
|
| 372 |
+
402 block and only keep the Checklist section heading above along with the questions/answers below.
|
| 373 |
+
|
| 374 |
+
1. For all authors...
|
| 375 |
+
|
| 376 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 377 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 378 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No]
|
| 379 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 380 |
+
|
| 381 |
+
2. If you are including theoretical results...
|
| 382 |
+
|
| 383 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes]
|
| 384 |
+
|
| 385 |
+
3. If you ran experiments...
|
| 386 |
+
|
| 387 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No]
|
| 388 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 389 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 390 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
|
| 391 |
+
|
| 392 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 393 |
+
|
| 394 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 395 |
+
(b) Did you mention the license of the assets? [No]
|
| 396 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 397 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 398 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes]
|
| 399 |
+
|
| 400 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 401 |
+
|
| 402 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [TODO]
|
| 403 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [TODO]
|
| 404 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [TODO]
|
md/dev/zXne1klXIQ/zXne1klXIQ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|