Datasets:
Add files using upload-large-folder tool
Browse files- parse/dev/0YXmOFLb1wQ/0YXmOFLb1wQ.md +323 -0
- parse/dev/0YXmOFLb1wQ/0YXmOFLb1wQ_content_list.json +1765 -0
- parse/dev/0YXmOFLb1wQ/0YXmOFLb1wQ_model.json +0 -0
- parse/dev/5xEgrl_5FAJ/5xEgrl_5FAJ_content_list.json +0 -0
- parse/dev/5xEgrl_5FAJ/5xEgrl_5FAJ_middle.json +0 -0
- parse/dev/5xEgrl_5FAJ/5xEgrl_5FAJ_model.json +0 -0
- parse/dev/6res1KC1Z3Z/6res1KC1Z3Z.md +279 -0
- parse/dev/6res1KC1Z3Z/6res1KC1Z3Z_content_list.json +1402 -0
- parse/dev/FZCFlj2_c7z/FZCFlj2_c7z.md +484 -0
- parse/dev/QwejPcX96r/QwejPcX96r_content_list.json +0 -0
- parse/dev/QwejPcX96r/QwejPcX96r_model.json +0 -0
- parse/dev/S7Evzt9uit3/S7Evzt9uit3_content_list.json +1182 -0
- parse/dev/S7Evzt9uit3/S7Evzt9uit3_model.json +0 -0
- parse/dev/aLLuYpn83y/aLLuYpn83y_middle.json +0 -0
- parse/dev/cp5PvcI6w8_/cp5PvcI6w8_.md +0 -0
- parse/dev/flNZJ2eOet/flNZJ2eOet_content_list.json +1355 -0
- parse/dev/iaYcJKpY2B_/iaYcJKpY2B_.md +415 -0
- parse/dev/iaYcJKpY2B_/iaYcJKpY2B__content_list.json +0 -0
- parse/dev/iaYcJKpY2B_/iaYcJKpY2B__middle.json +0 -0
- parse/dev/iaYcJKpY2B_/iaYcJKpY2B__model.json +0 -0
parse/dev/0YXmOFLb1wQ/0YXmOFLb1wQ.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|
parse/dev/0YXmOFLb1wQ/0YXmOFLb1wQ_content_list.json
ADDED
|
@@ -0,0 +1,1765 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
176,
|
| 8 |
+
99,
|
| 9 |
+
823,
|
| 10 |
+
146
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Anonymous authors Paper under double-blind review ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
183,
|
| 19 |
+
171,
|
| 20 |
+
398,
|
| 21 |
+
198
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
236,
|
| 32 |
+
544,
|
| 33 |
+
251
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "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. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
233,
|
| 42 |
+
266,
|
| 43 |
+
764,
|
| 44 |
+
488
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
516,
|
| 55 |
+
336,
|
| 56 |
+
532
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "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. ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
547,
|
| 66 |
+
825,
|
| 67 |
+
688
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "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. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
694,
|
| 77 |
+
825,
|
| 78 |
+
875
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "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. ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
176,
|
| 87 |
+
882,
|
| 88 |
+
823,
|
| 89 |
+
924
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "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. ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
173,
|
| 98 |
+
103,
|
| 99 |
+
825,
|
| 100 |
+
256
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 1
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "2 PROBLEM FORMULATION ",
|
| 107 |
+
"text_level": 1,
|
| 108 |
+
"bbox": [
|
| 109 |
+
176,
|
| 110 |
+
279,
|
| 111 |
+
416,
|
| 112 |
+
294
|
| 113 |
+
],
|
| 114 |
+
"page_idx": 1
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"type": "text",
|
| 118 |
+
"text": "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. ",
|
| 119 |
+
"bbox": [
|
| 120 |
+
173,
|
| 121 |
+
309,
|
| 122 |
+
825,
|
| 123 |
+
422
|
| 124 |
+
],
|
| 125 |
+
"page_idx": 1
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"type": "text",
|
| 129 |
+
"text": "2.1 BACKGROUND ON GRAPH NEURAL NETWORKS ",
|
| 130 |
+
"text_level": 1,
|
| 131 |
+
"bbox": [
|
| 132 |
+
174,
|
| 133 |
+
439,
|
| 134 |
+
544,
|
| 135 |
+
454
|
| 136 |
+
],
|
| 137 |
+
"page_idx": 1
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"type": "text",
|
| 141 |
+
"text": "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 ",
|
| 142 |
+
"bbox": [
|
| 143 |
+
173,
|
| 144 |
+
465,
|
| 145 |
+
825,
|
| 146 |
+
604
|
| 147 |
+
],
|
| 148 |
+
"page_idx": 1
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
"type": "equation",
|
| 152 |
+
"img_path": "images/f5690bf6728bad1f50af9725cd742d43939da31b2f062cca12a20a3b359a3685.jpg",
|
| 153 |
+
"text": "$$\n\\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}\n$$",
|
| 154 |
+
"text_format": "latex",
|
| 155 |
+
"bbox": [
|
| 156 |
+
316,
|
| 157 |
+
612,
|
| 158 |
+
679,
|
| 159 |
+
633
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "2.2 GRAPH NEURAL NETWORK EXPLANATIONS ",
|
| 166 |
+
"text_level": 1,
|
| 167 |
+
"bbox": [
|
| 168 |
+
174,
|
| 169 |
+
647,
|
| 170 |
+
519,
|
| 171 |
+
662
|
| 172 |
+
],
|
| 173 |
+
"page_idx": 1
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"type": "text",
|
| 177 |
+
"text": "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. ",
|
| 178 |
+
"bbox": [
|
| 179 |
+
173,
|
| 180 |
+
674,
|
| 181 |
+
825,
|
| 182 |
+
828
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 1
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "3 MOTIF-BASED GRAPH NEURAL NETWORK EXPLAINER ",
|
| 189 |
+
"text_level": 1,
|
| 190 |
+
"bbox": [
|
| 191 |
+
176,
|
| 192 |
+
849,
|
| 193 |
+
663,
|
| 194 |
+
866
|
| 195 |
+
],
|
| 196 |
+
"page_idx": 1
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"type": "text",
|
| 200 |
+
"text": "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 ",
|
| 201 |
+
"bbox": [
|
| 202 |
+
176,
|
| 203 |
+
881,
|
| 204 |
+
823,
|
| 205 |
+
924
|
| 206 |
+
],
|
| 207 |
+
"page_idx": 1
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"type": "image",
|
| 211 |
+
"img_path": "images/6d14148f15b68a87cc3e622f062fd47ac08fb5f38b3b6f2ee99652f13478b8ec.jpg",
|
| 212 |
+
"image_caption": [
|
| 213 |
+
"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. "
|
| 214 |
+
],
|
| 215 |
+
"image_footnote": [],
|
| 216 |
+
"bbox": [
|
| 217 |
+
174,
|
| 218 |
+
102,
|
| 219 |
+
821,
|
| 220 |
+
309
|
| 221 |
+
],
|
| 222 |
+
"page_idx": 2
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"type": "text",
|
| 226 |
+
"text": "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. ",
|
| 227 |
+
"bbox": [
|
| 228 |
+
171,
|
| 229 |
+
402,
|
| 230 |
+
823,
|
| 231 |
+
431
|
| 232 |
+
],
|
| 233 |
+
"page_idx": 2
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"type": "text",
|
| 237 |
+
"text": "3.1 FROM SUBGRAPH TO MOTIF EXPLANATION ",
|
| 238 |
+
"text_level": 1,
|
| 239 |
+
"bbox": [
|
| 240 |
+
174,
|
| 241 |
+
452,
|
| 242 |
+
516,
|
| 243 |
+
465
|
| 244 |
+
],
|
| 245 |
+
"page_idx": 2
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"type": "text",
|
| 249 |
+
"text": "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. ",
|
| 250 |
+
"bbox": [
|
| 251 |
+
174,
|
| 252 |
+
479,
|
| 253 |
+
825,
|
| 254 |
+
604
|
| 255 |
+
],
|
| 256 |
+
"page_idx": 2
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"type": "text",
|
| 260 |
+
"text": "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. ",
|
| 261 |
+
"bbox": [
|
| 262 |
+
174,
|
| 263 |
+
611,
|
| 264 |
+
825,
|
| 265 |
+
859
|
| 266 |
+
],
|
| 267 |
+
"page_idx": 2
|
| 268 |
+
},
|
| 269 |
+
{
|
| 270 |
+
"type": "text",
|
| 271 |
+
"text": "3.2 MOTIF EXTRACTION ",
|
| 272 |
+
"text_level": 1,
|
| 273 |
+
"bbox": [
|
| 274 |
+
176,
|
| 275 |
+
882,
|
| 276 |
+
357,
|
| 277 |
+
896
|
| 278 |
+
],
|
| 279 |
+
"page_idx": 2
|
| 280 |
+
},
|
| 281 |
+
{
|
| 282 |
+
"type": "text",
|
| 283 |
+
"text": "This section introduces domain-specific motif extraction rules. ",
|
| 284 |
+
"bbox": [
|
| 285 |
+
174,
|
| 286 |
+
909,
|
| 287 |
+
581,
|
| 288 |
+
924
|
| 289 |
+
],
|
| 290 |
+
"page_idx": 2
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"type": "table",
|
| 294 |
+
"img_path": "images/2733aee12f7148520dd4eafe8a15856c8a531d77509f96d84aa9e92313e35957.jpg",
|
| 295 |
+
"table_caption": [],
|
| 296 |
+
"table_footnote": [],
|
| 297 |
+
"table_body": "<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>",
|
| 298 |
+
"bbox": [
|
| 299 |
+
174,
|
| 300 |
+
101,
|
| 301 |
+
826,
|
| 302 |
+
329
|
| 303 |
+
],
|
| 304 |
+
"page_idx": 3
|
| 305 |
+
},
|
| 306 |
+
{
|
| 307 |
+
"type": "text",
|
| 308 |
+
"text": "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. ",
|
| 309 |
+
"bbox": [
|
| 310 |
+
174,
|
| 311 |
+
356,
|
| 312 |
+
825,
|
| 313 |
+
468
|
| 314 |
+
],
|
| 315 |
+
"page_idx": 3
|
| 316 |
+
},
|
| 317 |
+
{
|
| 318 |
+
"type": "text",
|
| 319 |
+
"text": "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. ",
|
| 320 |
+
"bbox": [
|
| 321 |
+
174,
|
| 322 |
+
474,
|
| 323 |
+
825,
|
| 324 |
+
571
|
| 325 |
+
],
|
| 326 |
+
"page_idx": 3
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
"type": "text",
|
| 330 |
+
"text": "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. ",
|
| 331 |
+
"bbox": [
|
| 332 |
+
173,
|
| 333 |
+
579,
|
| 334 |
+
825,
|
| 335 |
+
690
|
| 336 |
+
],
|
| 337 |
+
"page_idx": 3
|
| 338 |
+
},
|
| 339 |
+
{
|
| 340 |
+
"type": "text",
|
| 341 |
+
"text": "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$ . ",
|
| 342 |
+
"bbox": [
|
| 343 |
+
174,
|
| 344 |
+
696,
|
| 345 |
+
825,
|
| 346 |
+
767
|
| 347 |
+
],
|
| 348 |
+
"page_idx": 3
|
| 349 |
+
},
|
| 350 |
+
{
|
| 351 |
+
"type": "text",
|
| 352 |
+
"text": "3.3 MOTIF EMBEDDING ",
|
| 353 |
+
"text_level": 1,
|
| 354 |
+
"bbox": [
|
| 355 |
+
176,
|
| 356 |
+
785,
|
| 357 |
+
352,
|
| 358 |
+
800
|
| 359 |
+
],
|
| 360 |
+
"page_idx": 3
|
| 361 |
+
},
|
| 362 |
+
{
|
| 363 |
+
"type": "text",
|
| 364 |
+
"text": "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. ",
|
| 365 |
+
"bbox": [
|
| 366 |
+
174,
|
| 367 |
+
811,
|
| 368 |
+
825,
|
| 369 |
+
924
|
| 370 |
+
],
|
| 371 |
+
"page_idx": 3
|
| 372 |
+
},
|
| 373 |
+
{
|
| 374 |
+
"type": "text",
|
| 375 |
+
"text": "",
|
| 376 |
+
"bbox": [
|
| 377 |
+
171,
|
| 378 |
+
103,
|
| 379 |
+
825,
|
| 380 |
+
132
|
| 381 |
+
],
|
| 382 |
+
"page_idx": 4
|
| 383 |
+
},
|
| 384 |
+
{
|
| 385 |
+
"type": "text",
|
| 386 |
+
"text": "3.4 GNN EXPLANATION FOR GRAPH CLASSIFICATION TASKS ",
|
| 387 |
+
"text_level": 1,
|
| 388 |
+
"bbox": [
|
| 389 |
+
173,
|
| 390 |
+
150,
|
| 391 |
+
614,
|
| 392 |
+
165
|
| 393 |
+
],
|
| 394 |
+
"page_idx": 4
|
| 395 |
+
},
|
| 396 |
+
{
|
| 397 |
+
"type": "text",
|
| 398 |
+
"text": "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 )$ . ",
|
| 399 |
+
"bbox": [
|
| 400 |
+
174,
|
| 401 |
+
178,
|
| 402 |
+
825,
|
| 403 |
+
234
|
| 404 |
+
],
|
| 405 |
+
"page_idx": 4
|
| 406 |
+
},
|
| 407 |
+
{
|
| 408 |
+
"type": "text",
|
| 409 |
+
"text": "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 ",
|
| 410 |
+
"bbox": [
|
| 411 |
+
173,
|
| 412 |
+
241,
|
| 413 |
+
825,
|
| 414 |
+
421
|
| 415 |
+
],
|
| 416 |
+
"page_idx": 4
|
| 417 |
+
},
|
| 418 |
+
{
|
| 419 |
+
"type": "equation",
|
| 420 |
+
"img_path": "images/664f77ac64d88c34692a14e272cbb9c34d9e598497c93ce3f3eefa8e05d44b19.jpg",
|
| 421 |
+
"text": "$$\n\\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}\n$$",
|
| 422 |
+
"text_format": "latex",
|
| 423 |
+
"bbox": [
|
| 424 |
+
343,
|
| 425 |
+
428,
|
| 426 |
+
653,
|
| 427 |
+
545
|
| 428 |
+
],
|
| 429 |
+
"page_idx": 4
|
| 430 |
+
},
|
| 431 |
+
{
|
| 432 |
+
"type": "text",
|
| 433 |
+
"text": "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. ",
|
| 434 |
+
"bbox": [
|
| 435 |
+
174,
|
| 436 |
+
550,
|
| 437 |
+
825,
|
| 438 |
+
633
|
| 439 |
+
],
|
| 440 |
+
"page_idx": 4
|
| 441 |
+
},
|
| 442 |
+
{
|
| 443 |
+
"type": "text",
|
| 444 |
+
"text": "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. ",
|
| 445 |
+
"bbox": [
|
| 446 |
+
174,
|
| 447 |
+
641,
|
| 448 |
+
825,
|
| 449 |
+
696
|
| 450 |
+
],
|
| 451 |
+
"page_idx": 4
|
| 452 |
+
},
|
| 453 |
+
{
|
| 454 |
+
"type": "text",
|
| 455 |
+
"text": "3.5 GNN EXPLANATION FOR NODE CLASSIFICATION TASKS ",
|
| 456 |
+
"text_level": 1,
|
| 457 |
+
"bbox": [
|
| 458 |
+
173,
|
| 459 |
+
715,
|
| 460 |
+
606,
|
| 461 |
+
731
|
| 462 |
+
],
|
| 463 |
+
"page_idx": 4
|
| 464 |
+
},
|
| 465 |
+
{
|
| 466 |
+
"type": "text",
|
| 467 |
+
"text": "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 ",
|
| 468 |
+
"bbox": [
|
| 469 |
+
173,
|
| 470 |
+
743,
|
| 471 |
+
825,
|
| 472 |
+
924
|
| 473 |
+
],
|
| 474 |
+
"page_idx": 4
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"type": "text",
|
| 478 |
+
"text": "",
|
| 479 |
+
"bbox": [
|
| 480 |
+
171,
|
| 481 |
+
103,
|
| 482 |
+
823,
|
| 483 |
+
132
|
| 484 |
+
],
|
| 485 |
+
"page_idx": 5
|
| 486 |
+
},
|
| 487 |
+
{
|
| 488 |
+
"type": "equation",
|
| 489 |
+
"img_path": "images/5de0a3fe0cd32b5e97ed655396976ac463cc8357cb581a7243d672771c6a5cf9.jpg",
|
| 490 |
+
"text": "$$\n\\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}\n$$",
|
| 491 |
+
"text_format": "latex",
|
| 492 |
+
"bbox": [
|
| 493 |
+
339,
|
| 494 |
+
136,
|
| 495 |
+
655,
|
| 496 |
+
189
|
| 497 |
+
],
|
| 498 |
+
"page_idx": 5
|
| 499 |
+
},
|
| 500 |
+
{
|
| 501 |
+
"type": "text",
|
| 502 |
+
"text": "Then, Eq. (3 - 6) are applied to compute loss for training the attention layer. ",
|
| 503 |
+
"bbox": [
|
| 504 |
+
174,
|
| 505 |
+
193,
|
| 506 |
+
669,
|
| 507 |
+
208
|
| 508 |
+
],
|
| 509 |
+
"page_idx": 5
|
| 510 |
+
},
|
| 511 |
+
{
|
| 512 |
+
"type": "text",
|
| 513 |
+
"text": "4 EXPERIMENTAL STUDIES ",
|
| 514 |
+
"text_level": 1,
|
| 515 |
+
"bbox": [
|
| 516 |
+
176,
|
| 517 |
+
227,
|
| 518 |
+
416,
|
| 519 |
+
242
|
| 520 |
+
],
|
| 521 |
+
"page_idx": 5
|
| 522 |
+
},
|
| 523 |
+
{
|
| 524 |
+
"type": "text",
|
| 525 |
+
"text": "We conduct experiments to evaluate the proposed methods on both real-world and synthetic datasets. ",
|
| 526 |
+
"bbox": [
|
| 527 |
+
173,
|
| 528 |
+
257,
|
| 529 |
+
820,
|
| 530 |
+
272
|
| 531 |
+
],
|
| 532 |
+
"page_idx": 5
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"type": "text",
|
| 536 |
+
"text": "4.1 DATASETS AND EXPERIMENTAL SETTINGS ",
|
| 537 |
+
"text_level": 1,
|
| 538 |
+
"bbox": [
|
| 539 |
+
174,
|
| 540 |
+
287,
|
| 541 |
+
511,
|
| 542 |
+
303
|
| 543 |
+
],
|
| 544 |
+
"page_idx": 5
|
| 545 |
+
},
|
| 546 |
+
{
|
| 547 |
+
"type": "text",
|
| 548 |
+
"text": "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. ",
|
| 549 |
+
"bbox": [
|
| 550 |
+
176,
|
| 551 |
+
314,
|
| 552 |
+
823,
|
| 553 |
+
356
|
| 554 |
+
],
|
| 555 |
+
"page_idx": 5
|
| 556 |
+
},
|
| 557 |
+
{
|
| 558 |
+
"type": "text",
|
| 559 |
+
"text": "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. ",
|
| 560 |
+
"bbox": [
|
| 561 |
+
174,
|
| 562 |
+
363,
|
| 563 |
+
823,
|
| 564 |
+
392
|
| 565 |
+
],
|
| 566 |
+
"page_idx": 5
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "text",
|
| 570 |
+
"text": "PTC (Kriege & Mutzel, 2012) is a collection of 344 chemical compounds reporting the carcinogenicity for rats. ",
|
| 571 |
+
"bbox": [
|
| 572 |
+
176,
|
| 573 |
+
398,
|
| 574 |
+
821,
|
| 575 |
+
426
|
| 576 |
+
],
|
| 577 |
+
"page_idx": 5
|
| 578 |
+
},
|
| 579 |
+
{
|
| 580 |
+
"type": "text",
|
| 581 |
+
"text": "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. ",
|
| 582 |
+
"bbox": [
|
| 583 |
+
174,
|
| 584 |
+
433,
|
| 585 |
+
820,
|
| 586 |
+
462
|
| 587 |
+
],
|
| 588 |
+
"page_idx": 5
|
| 589 |
+
},
|
| 590 |
+
{
|
| 591 |
+
"type": "text",
|
| 592 |
+
"text": "PROTEINS (Dobson & Doig, 2003) is a protein dataset classified as enzymatic or non-enzymatic. ",
|
| 593 |
+
"bbox": [
|
| 594 |
+
174,
|
| 595 |
+
468,
|
| 596 |
+
812,
|
| 597 |
+
483
|
| 598 |
+
],
|
| 599 |
+
"page_idx": 5
|
| 600 |
+
},
|
| 601 |
+
{
|
| 602 |
+
"type": "text",
|
| 603 |
+
"text": "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. ",
|
| 604 |
+
"bbox": [
|
| 605 |
+
171,
|
| 606 |
+
489,
|
| 607 |
+
823,
|
| 608 |
+
518
|
| 609 |
+
],
|
| 610 |
+
"page_idx": 5
|
| 611 |
+
},
|
| 612 |
+
{
|
| 613 |
+
"type": "text",
|
| 614 |
+
"text": "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. ",
|
| 615 |
+
"bbox": [
|
| 616 |
+
174,
|
| 617 |
+
525,
|
| 618 |
+
821,
|
| 619 |
+
554
|
| 620 |
+
],
|
| 621 |
+
"page_idx": 5
|
| 622 |
+
},
|
| 623 |
+
{
|
| 624 |
+
"type": "text",
|
| 625 |
+
"text": "BA-Shapes (Ying et al., 2019) is a synthetic node classification dataset. It contains a single base BA graph with 300 nodes. ",
|
| 626 |
+
"bbox": [
|
| 627 |
+
176,
|
| 628 |
+
560,
|
| 629 |
+
823,
|
| 630 |
+
588
|
| 631 |
+
],
|
| 632 |
+
"page_idx": 5
|
| 633 |
+
},
|
| 634 |
+
{
|
| 635 |
+
"type": "text",
|
| 636 |
+
"text": "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. ",
|
| 637 |
+
"bbox": [
|
| 638 |
+
174,
|
| 639 |
+
595,
|
| 640 |
+
825,
|
| 641 |
+
707
|
| 642 |
+
],
|
| 643 |
+
"page_idx": 5
|
| 644 |
+
},
|
| 645 |
+
{
|
| 646 |
+
"type": "text",
|
| 647 |
+
"text": "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. ",
|
| 648 |
+
"bbox": [
|
| 649 |
+
174,
|
| 650 |
+
714,
|
| 651 |
+
823,
|
| 652 |
+
784
|
| 653 |
+
],
|
| 654 |
+
"page_idx": 5
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"type": "text",
|
| 658 |
+
"text": "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. ",
|
| 659 |
+
"bbox": [
|
| 660 |
+
174,
|
| 661 |
+
791,
|
| 662 |
+
825,
|
| 663 |
+
875
|
| 664 |
+
],
|
| 665 |
+
"page_idx": 5
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
"type": "text",
|
| 669 |
+
"text": "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 ",
|
| 670 |
+
"bbox": [
|
| 671 |
+
176,
|
| 672 |
+
882,
|
| 673 |
+
823,
|
| 674 |
+
924
|
| 675 |
+
],
|
| 676 |
+
"page_idx": 5
|
| 677 |
+
},
|
| 678 |
+
{
|
| 679 |
+
"type": "image",
|
| 680 |
+
"img_path": "images/16beb6c4c038eb29a29ad4d73ecec61c1befb520e3927c88890cac4b63c9dd24.jpg",
|
| 681 |
+
"image_caption": [
|
| 682 |
+
"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. "
|
| 683 |
+
],
|
| 684 |
+
"image_footnote": [],
|
| 685 |
+
"bbox": [
|
| 686 |
+
176,
|
| 687 |
+
99,
|
| 688 |
+
812,
|
| 689 |
+
286
|
| 690 |
+
],
|
| 691 |
+
"page_idx": 6
|
| 692 |
+
},
|
| 693 |
+
{
|
| 694 |
+
"type": "text",
|
| 695 |
+
"text": "",
|
| 696 |
+
"bbox": [
|
| 697 |
+
174,
|
| 698 |
+
369,
|
| 699 |
+
823,
|
| 700 |
+
439
|
| 701 |
+
],
|
| 702 |
+
"page_idx": 6
|
| 703 |
+
},
|
| 704 |
+
{
|
| 705 |
+
"type": "equation",
|
| 706 |
+
"img_path": "images/de14fd2dbb092b825a4ee1f8d411442ba0a6df0ad44d10ad95cf4a9b9c38215b.jpg",
|
| 707 |
+
"text": "$$\n\\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}\n$$",
|
| 708 |
+
"text_format": "latex",
|
| 709 |
+
"bbox": [
|
| 710 |
+
356,
|
| 711 |
+
445,
|
| 712 |
+
642,
|
| 713 |
+
535
|
| 714 |
+
],
|
| 715 |
+
"page_idx": 6
|
| 716 |
+
},
|
| 717 |
+
{
|
| 718 |
+
"type": "text",
|
| 719 |
+
"text": "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. ",
|
| 720 |
+
"bbox": [
|
| 721 |
+
171,
|
| 722 |
+
540,
|
| 723 |
+
823,
|
| 724 |
+
569
|
| 725 |
+
],
|
| 726 |
+
"page_idx": 6
|
| 727 |
+
},
|
| 728 |
+
{
|
| 729 |
+
"type": "text",
|
| 730 |
+
"text": "4.2 QUALITATIVE RESULTS ",
|
| 731 |
+
"text_level": 1,
|
| 732 |
+
"bbox": [
|
| 733 |
+
176,
|
| 734 |
+
585,
|
| 735 |
+
379,
|
| 736 |
+
599
|
| 737 |
+
],
|
| 738 |
+
"page_idx": 6
|
| 739 |
+
},
|
| 740 |
+
{
|
| 741 |
+
"type": "text",
|
| 742 |
+
"text": "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. ",
|
| 743 |
+
"bbox": [
|
| 744 |
+
174,
|
| 745 |
+
611,
|
| 746 |
+
825,
|
| 747 |
+
805
|
| 748 |
+
],
|
| 749 |
+
"page_idx": 6
|
| 750 |
+
},
|
| 751 |
+
{
|
| 752 |
+
"type": "text",
|
| 753 |
+
"text": "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. ",
|
| 754 |
+
"bbox": [
|
| 755 |
+
174,
|
| 756 |
+
811,
|
| 757 |
+
825,
|
| 758 |
+
924
|
| 759 |
+
],
|
| 760 |
+
"page_idx": 6
|
| 761 |
+
},
|
| 762 |
+
{
|
| 763 |
+
"type": "table",
|
| 764 |
+
"img_path": "images/739abb47d347839d23477efbf7bf7030511203c98b404f5c8bf414a13829edf9.jpg",
|
| 765 |
+
"table_caption": [
|
| 766 |
+
"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. "
|
| 767 |
+
],
|
| 768 |
+
"table_footnote": [],
|
| 769 |
+
"table_body": "<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>",
|
| 770 |
+
"bbox": [
|
| 771 |
+
173,
|
| 772 |
+
170,
|
| 773 |
+
825,
|
| 774 |
+
289
|
| 775 |
+
],
|
| 776 |
+
"page_idx": 7
|
| 777 |
+
},
|
| 778 |
+
{
|
| 779 |
+
"type": "text",
|
| 780 |
+
"text": "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. ",
|
| 781 |
+
"bbox": [
|
| 782 |
+
173,
|
| 783 |
+
296,
|
| 784 |
+
825,
|
| 785 |
+
353
|
| 786 |
+
],
|
| 787 |
+
"page_idx": 7
|
| 788 |
+
},
|
| 789 |
+
{
|
| 790 |
+
"type": "text",
|
| 791 |
+
"text": "4.3 QUANTITATIVE RESULTS ",
|
| 792 |
+
"text_level": 1,
|
| 793 |
+
"bbox": [
|
| 794 |
+
174,
|
| 795 |
+
371,
|
| 796 |
+
387,
|
| 797 |
+
386
|
| 798 |
+
],
|
| 799 |
+
"page_idx": 7
|
| 800 |
+
},
|
| 801 |
+
{
|
| 802 |
+
"type": "text",
|
| 803 |
+
"text": "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. ",
|
| 804 |
+
"bbox": [
|
| 805 |
+
174,
|
| 806 |
+
397,
|
| 807 |
+
825,
|
| 808 |
+
494
|
| 809 |
+
],
|
| 810 |
+
"page_idx": 7
|
| 811 |
+
},
|
| 812 |
+
{
|
| 813 |
+
"type": "text",
|
| 814 |
+
"text": "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. ",
|
| 815 |
+
"bbox": [
|
| 816 |
+
174,
|
| 817 |
+
501,
|
| 818 |
+
825,
|
| 819 |
+
558
|
| 820 |
+
],
|
| 821 |
+
"page_idx": 7
|
| 822 |
+
},
|
| 823 |
+
{
|
| 824 |
+
"type": "text",
|
| 825 |
+
"text": "4.4 THRESHOLD STUDIES ",
|
| 826 |
+
"text_level": 1,
|
| 827 |
+
"bbox": [
|
| 828 |
+
176,
|
| 829 |
+
575,
|
| 830 |
+
366,
|
| 831 |
+
589
|
| 832 |
+
],
|
| 833 |
+
"page_idx": 7
|
| 834 |
+
},
|
| 835 |
+
{
|
| 836 |
+
"type": "text",
|
| 837 |
+
"text": "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",
|
| 838 |
+
"bbox": [
|
| 839 |
+
174,
|
| 840 |
+
602,
|
| 841 |
+
450,
|
| 842 |
+
671
|
| 843 |
+
],
|
| 844 |
+
"page_idx": 7
|
| 845 |
+
},
|
| 846 |
+
{
|
| 847 |
+
"type": "table",
|
| 848 |
+
"img_path": "images/a8ce7d0d2b8ca8b88a86fc1e92ba8d86eee0ac253bfe0be0f75ef1af935a5a87.jpg",
|
| 849 |
+
"table_caption": [
|
| 850 |
+
"Table 2: The study of threshold. "
|
| 851 |
+
],
|
| 852 |
+
"table_footnote": [],
|
| 853 |
+
"table_body": "<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>",
|
| 854 |
+
"bbox": [
|
| 855 |
+
462,
|
| 856 |
+
609,
|
| 857 |
+
825,
|
| 858 |
+
671
|
| 859 |
+
],
|
| 860 |
+
"page_idx": 7
|
| 861 |
+
},
|
| 862 |
+
{
|
| 863 |
+
"type": "text",
|
| 864 |
+
"text": "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. ",
|
| 865 |
+
"bbox": [
|
| 866 |
+
174,
|
| 867 |
+
671,
|
| 868 |
+
825,
|
| 869 |
+
782
|
| 870 |
+
],
|
| 871 |
+
"page_idx": 7
|
| 872 |
+
},
|
| 873 |
+
{
|
| 874 |
+
"type": "text",
|
| 875 |
+
"text": "4.5 ABLATION STUDIES ",
|
| 876 |
+
"text_level": 1,
|
| 877 |
+
"bbox": [
|
| 878 |
+
176,
|
| 879 |
+
800,
|
| 880 |
+
352,
|
| 881 |
+
814
|
| 882 |
+
],
|
| 883 |
+
"page_idx": 7
|
| 884 |
+
},
|
| 885 |
+
{
|
| 886 |
+
"type": "text",
|
| 887 |
+
"text": "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 ",
|
| 888 |
+
"bbox": [
|
| 889 |
+
174,
|
| 890 |
+
825,
|
| 891 |
+
452,
|
| 892 |
+
922
|
| 893 |
+
],
|
| 894 |
+
"page_idx": 7
|
| 895 |
+
},
|
| 896 |
+
{
|
| 897 |
+
"type": "table",
|
| 898 |
+
"img_path": "images/75bb3809b6060590b9447afdc97f889143cd8a13803dab188891546f12f4b506.jpg",
|
| 899 |
+
"table_caption": [
|
| 900 |
+
"Table 3: Results for AttnExplainer and MotifExplainer on three datasets. $K { = } 5$ for two synthetic datasets. "
|
| 901 |
+
],
|
| 902 |
+
"table_footnote": [
|
| 903 |
+
"edges as basic explanation units and apply an attention model to select relevant edges as explana"
|
| 904 |
+
],
|
| 905 |
+
"table_body": "<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>",
|
| 906 |
+
"bbox": [
|
| 907 |
+
464,
|
| 908 |
+
852,
|
| 909 |
+
834,
|
| 910 |
+
909
|
| 911 |
+
],
|
| 912 |
+
"page_idx": 7
|
| 913 |
+
},
|
| 914 |
+
{
|
| 915 |
+
"type": "text",
|
| 916 |
+
"text": "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. ",
|
| 917 |
+
"bbox": [
|
| 918 |
+
174,
|
| 919 |
+
103,
|
| 920 |
+
823,
|
| 921 |
+
160
|
| 922 |
+
],
|
| 923 |
+
"page_idx": 8
|
| 924 |
+
},
|
| 925 |
+
{
|
| 926 |
+
"type": "text",
|
| 927 |
+
"text": "4.6 EFFICIENCY STUDIES ",
|
| 928 |
+
"text_level": 1,
|
| 929 |
+
"bbox": [
|
| 930 |
+
176,
|
| 931 |
+
178,
|
| 932 |
+
362,
|
| 933 |
+
193
|
| 934 |
+
],
|
| 935 |
+
"page_idx": 8
|
| 936 |
+
},
|
| 937 |
+
{
|
| 938 |
+
"type": "text",
|
| 939 |
+
"text": "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. ",
|
| 940 |
+
"bbox": [
|
| 941 |
+
174,
|
| 942 |
+
204,
|
| 943 |
+
549,
|
| 944 |
+
315
|
| 945 |
+
],
|
| 946 |
+
"page_idx": 8
|
| 947 |
+
},
|
| 948 |
+
{
|
| 949 |
+
"type": "table",
|
| 950 |
+
"img_path": "images/66617bd1aa7d5f5c5bb9243e0e8076e72640a1a4a10422880bcdfbc61f6e03e1.jpg",
|
| 951 |
+
"table_caption": [
|
| 952 |
+
"Table 4: Results on efficiency studies. "
|
| 953 |
+
],
|
| 954 |
+
"table_footnote": [],
|
| 955 |
+
"table_body": "<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>",
|
| 956 |
+
"bbox": [
|
| 957 |
+
562,
|
| 958 |
+
210,
|
| 959 |
+
823,
|
| 960 |
+
314
|
| 961 |
+
],
|
| 962 |
+
"page_idx": 8
|
| 963 |
+
},
|
| 964 |
+
{
|
| 965 |
+
"type": "text",
|
| 966 |
+
"text": "",
|
| 967 |
+
"bbox": [
|
| 968 |
+
174,
|
| 969 |
+
316,
|
| 970 |
+
825,
|
| 971 |
+
398
|
| 972 |
+
],
|
| 973 |
+
"page_idx": 8
|
| 974 |
+
},
|
| 975 |
+
{
|
| 976 |
+
"type": "text",
|
| 977 |
+
"text": "5 RELATED WORK ",
|
| 978 |
+
"text_level": 1,
|
| 979 |
+
"bbox": [
|
| 980 |
+
176,
|
| 981 |
+
420,
|
| 982 |
+
343,
|
| 983 |
+
436
|
| 984 |
+
],
|
| 985 |
+
"page_idx": 8
|
| 986 |
+
},
|
| 987 |
+
{
|
| 988 |
+
"type": "text",
|
| 989 |
+
"text": "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. ",
|
| 990 |
+
"bbox": [
|
| 991 |
+
173,
|
| 992 |
+
453,
|
| 993 |
+
825,
|
| 994 |
+
744
|
| 995 |
+
],
|
| 996 |
+
"page_idx": 8
|
| 997 |
+
},
|
| 998 |
+
{
|
| 999 |
+
"type": "text",
|
| 1000 |
+
"text": "6 CONCLUSION ",
|
| 1001 |
+
"text_level": 1,
|
| 1002 |
+
"bbox": [
|
| 1003 |
+
176,
|
| 1004 |
+
766,
|
| 1005 |
+
318,
|
| 1006 |
+
781
|
| 1007 |
+
],
|
| 1008 |
+
"page_idx": 8
|
| 1009 |
+
},
|
| 1010 |
+
{
|
| 1011 |
+
"type": "text",
|
| 1012 |
+
"text": "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. ",
|
| 1013 |
+
"bbox": [
|
| 1014 |
+
174,
|
| 1015 |
+
797,
|
| 1016 |
+
825,
|
| 1017 |
+
924
|
| 1018 |
+
],
|
| 1019 |
+
"page_idx": 8
|
| 1020 |
+
},
|
| 1021 |
+
{
|
| 1022 |
+
"type": "text",
|
| 1023 |
+
"text": "REFERENCES ",
|
| 1024 |
+
"text_level": 1,
|
| 1025 |
+
"bbox": [
|
| 1026 |
+
174,
|
| 1027 |
+
102,
|
| 1028 |
+
287,
|
| 1029 |
+
118
|
| 1030 |
+
],
|
| 1031 |
+
"page_idx": 9
|
| 1032 |
+
},
|
| 1033 |
+
{
|
| 1034 |
+
"type": "text",
|
| 1035 |
+
"text": "Uri Alon. Network motifs: theory and experimental approaches. Nature Reviews Genetics, 8(6): 450–461, 2007. ",
|
| 1036 |
+
"bbox": [
|
| 1037 |
+
173,
|
| 1038 |
+
126,
|
| 1039 |
+
823,
|
| 1040 |
+
155
|
| 1041 |
+
],
|
| 1042 |
+
"page_idx": 9
|
| 1043 |
+
},
|
| 1044 |
+
{
|
| 1045 |
+
"type": "text",
|
| 1046 |
+
"text": "Uri Alon. An introduction to systems biology: design principles of biological circuits. CRC press, 2019. ",
|
| 1047 |
+
"bbox": [
|
| 1048 |
+
171,
|
| 1049 |
+
162,
|
| 1050 |
+
823,
|
| 1051 |
+
193
|
| 1052 |
+
],
|
| 1053 |
+
"page_idx": 9
|
| 1054 |
+
},
|
| 1055 |
+
{
|
| 1056 |
+
"type": "text",
|
| 1057 |
+
"text": "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. ",
|
| 1058 |
+
"bbox": [
|
| 1059 |
+
174,
|
| 1060 |
+
200,
|
| 1061 |
+
821,
|
| 1062 |
+
244
|
| 1063 |
+
],
|
| 1064 |
+
"page_idx": 9
|
| 1065 |
+
},
|
| 1066 |
+
{
|
| 1067 |
+
"type": "text",
|
| 1068 |
+
"text": "Federico Baldassarre and Hossein Azizpour. Explainability techniques for graph convolutional networks. arXiv preprint arXiv:1905.13686, 2019. ",
|
| 1069 |
+
"bbox": [
|
| 1070 |
+
169,
|
| 1071 |
+
252,
|
| 1072 |
+
823,
|
| 1073 |
+
282
|
| 1074 |
+
],
|
| 1075 |
+
"page_idx": 9
|
| 1076 |
+
},
|
| 1077 |
+
{
|
| 1078 |
+
"type": "text",
|
| 1079 |
+
"text": "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. ",
|
| 1080 |
+
"bbox": [
|
| 1081 |
+
176,
|
| 1082 |
+
291,
|
| 1083 |
+
825,
|
| 1084 |
+
334
|
| 1085 |
+
],
|
| 1086 |
+
"page_idx": 9
|
| 1087 |
+
},
|
| 1088 |
+
{
|
| 1089 |
+
"type": "text",
|
| 1090 |
+
"text": "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. ",
|
| 1091 |
+
"bbox": [
|
| 1092 |
+
174,
|
| 1093 |
+
342,
|
| 1094 |
+
823,
|
| 1095 |
+
386
|
| 1096 |
+
],
|
| 1097 |
+
"page_idx": 9
|
| 1098 |
+
},
|
| 1099 |
+
{
|
| 1100 |
+
"type": "text",
|
| 1101 |
+
"text": "Paul D Dobson and Andrew J Doig. Distinguishing enzyme structures from non-enzymes without alignments. Journal of molecular biology, 330(4):771–783, 2003. ",
|
| 1102 |
+
"bbox": [
|
| 1103 |
+
171,
|
| 1104 |
+
393,
|
| 1105 |
+
823,
|
| 1106 |
+
424
|
| 1107 |
+
],
|
| 1108 |
+
"page_idx": 9
|
| 1109 |
+
},
|
| 1110 |
+
{
|
| 1111 |
+
"type": "text",
|
| 1112 |
+
"text": "Daniel A Erlanson, Robert S McDowell, and Tom O’Brien. Fragment-based drug discovery. Journal of medicinal chemistry, 47(14):3463–3482, 2004. ",
|
| 1113 |
+
"bbox": [
|
| 1114 |
+
173,
|
| 1115 |
+
433,
|
| 1116 |
+
823,
|
| 1117 |
+
462
|
| 1118 |
+
],
|
| 1119 |
+
"page_idx": 9
|
| 1120 |
+
},
|
| 1121 |
+
{
|
| 1122 |
+
"type": "text",
|
| 1123 |
+
"text": "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. ",
|
| 1124 |
+
"bbox": [
|
| 1125 |
+
171,
|
| 1126 |
+
469,
|
| 1127 |
+
823,
|
| 1128 |
+
513
|
| 1129 |
+
],
|
| 1130 |
+
"page_idx": 9
|
| 1131 |
+
},
|
| 1132 |
+
{
|
| 1133 |
+
"type": "text",
|
| 1134 |
+
"text": "Hongyang Gao and Shuiwang Ji. Graph u-nets. In international conference on machine learning, pp. 2083–2092. PMLR, 2019. ",
|
| 1135 |
+
"bbox": [
|
| 1136 |
+
171,
|
| 1137 |
+
522,
|
| 1138 |
+
823,
|
| 1139 |
+
551
|
| 1140 |
+
],
|
| 1141 |
+
"page_idx": 9
|
| 1142 |
+
},
|
| 1143 |
+
{
|
| 1144 |
+
"type": "text",
|
| 1145 |
+
"text": "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. ",
|
| 1146 |
+
"bbox": [
|
| 1147 |
+
173,
|
| 1148 |
+
560,
|
| 1149 |
+
823,
|
| 1150 |
+
603
|
| 1151 |
+
],
|
| 1152 |
+
"page_idx": 9
|
| 1153 |
+
},
|
| 1154 |
+
{
|
| 1155 |
+
"type": "text",
|
| 1156 |
+
"text": "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. ",
|
| 1157 |
+
"bbox": [
|
| 1158 |
+
173,
|
| 1159 |
+
611,
|
| 1160 |
+
825,
|
| 1161 |
+
655
|
| 1162 |
+
],
|
| 1163 |
+
"page_idx": 9
|
| 1164 |
+
},
|
| 1165 |
+
{
|
| 1166 |
+
"type": "text",
|
| 1167 |
+
"text": "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. ",
|
| 1168 |
+
"bbox": [
|
| 1169 |
+
176,
|
| 1170 |
+
662,
|
| 1171 |
+
825,
|
| 1172 |
+
707
|
| 1173 |
+
],
|
| 1174 |
+
"page_idx": 9
|
| 1175 |
+
},
|
| 1176 |
+
{
|
| 1177 |
+
"type": "text",
|
| 1178 |
+
"text": "Jeroen Kazius, Ross McGuire, and Roberta Bursi. Derivation and validation of toxicophores for mutagenicity prediction. Journal of medicinal chemistry, 48(1):312–320, 2005. ",
|
| 1179 |
+
"bbox": [
|
| 1180 |
+
169,
|
| 1181 |
+
715,
|
| 1182 |
+
825,
|
| 1183 |
+
746
|
| 1184 |
+
],
|
| 1185 |
+
"page_idx": 9
|
| 1186 |
+
},
|
| 1187 |
+
{
|
| 1188 |
+
"type": "text",
|
| 1189 |
+
"text": "Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. ",
|
| 1190 |
+
"bbox": [
|
| 1191 |
+
169,
|
| 1192 |
+
753,
|
| 1193 |
+
823,
|
| 1194 |
+
784
|
| 1195 |
+
],
|
| 1196 |
+
"page_idx": 9
|
| 1197 |
+
},
|
| 1198 |
+
{
|
| 1199 |
+
"type": "text",
|
| 1200 |
+
"text": "Nils Kriege and Petra Mutzel. Subgraph matching kernels for attributed graphs. arXiv preprint arXiv:1206.6483, 2012. ",
|
| 1201 |
+
"bbox": [
|
| 1202 |
+
169,
|
| 1203 |
+
791,
|
| 1204 |
+
823,
|
| 1205 |
+
820
|
| 1206 |
+
],
|
| 1207 |
+
"page_idx": 9
|
| 1208 |
+
},
|
| 1209 |
+
{
|
| 1210 |
+
"type": "text",
|
| 1211 |
+
"text": "Maria Conceic¸ao A Leite and Yunjiao Wang. Multistability, oscillations and bifurcations in feedback ˜ loops. Mathematical Biosciences & Engineering, 7(1):83, 2010. ",
|
| 1212 |
+
"bbox": [
|
| 1213 |
+
169,
|
| 1214 |
+
829,
|
| 1215 |
+
823,
|
| 1216 |
+
859
|
| 1217 |
+
],
|
| 1218 |
+
"page_idx": 9
|
| 1219 |
+
},
|
| 1220 |
+
{
|
| 1221 |
+
"type": "text",
|
| 1222 |
+
"text": "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. ",
|
| 1223 |
+
"bbox": [
|
| 1224 |
+
174,
|
| 1225 |
+
867,
|
| 1226 |
+
825,
|
| 1227 |
+
924
|
| 1228 |
+
],
|
| 1229 |
+
"page_idx": 9
|
| 1230 |
+
},
|
| 1231 |
+
{
|
| 1232 |
+
"type": "text",
|
| 1233 |
+
"text": "Wanyu Lin, Hao Lan, and Baochun Li. Generative causal explanations for graph neural networks. arXiv preprint arXiv:2104.06643, 2021. ",
|
| 1234 |
+
"bbox": [
|
| 1235 |
+
171,
|
| 1236 |
+
103,
|
| 1237 |
+
823,
|
| 1238 |
+
132
|
| 1239 |
+
],
|
| 1240 |
+
"page_idx": 10
|
| 1241 |
+
},
|
| 1242 |
+
{
|
| 1243 |
+
"type": "text",
|
| 1244 |
+
"text": "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. ",
|
| 1245 |
+
"bbox": [
|
| 1246 |
+
174,
|
| 1247 |
+
140,
|
| 1248 |
+
823,
|
| 1249 |
+
183
|
| 1250 |
+
],
|
| 1251 |
+
"page_idx": 10
|
| 1252 |
+
},
|
| 1253 |
+
{
|
| 1254 |
+
"type": "text",
|
| 1255 |
+
"text": "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. ",
|
| 1256 |
+
"bbox": [
|
| 1257 |
+
176,
|
| 1258 |
+
190,
|
| 1259 |
+
823,
|
| 1260 |
+
233
|
| 1261 |
+
],
|
| 1262 |
+
"page_idx": 10
|
| 1263 |
+
},
|
| 1264 |
+
{
|
| 1265 |
+
"type": "text",
|
| 1266 |
+
"text": "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. ",
|
| 1267 |
+
"bbox": [
|
| 1268 |
+
173,
|
| 1269 |
+
241,
|
| 1270 |
+
823,
|
| 1271 |
+
271
|
| 1272 |
+
],
|
| 1273 |
+
"page_idx": 10
|
| 1274 |
+
},
|
| 1275 |
+
{
|
| 1276 |
+
"type": "text",
|
| 1277 |
+
"text": "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. ",
|
| 1278 |
+
"bbox": [
|
| 1279 |
+
173,
|
| 1280 |
+
277,
|
| 1281 |
+
821,
|
| 1282 |
+
308
|
| 1283 |
+
],
|
| 1284 |
+
"page_idx": 10
|
| 1285 |
+
},
|
| 1286 |
+
{
|
| 1287 |
+
"type": "text",
|
| 1288 |
+
"text": "Mahendra Piraveenan, Kishan Wimalawarne, and Dharshana Kasthurirathn. Centrality and composition of four-node motifs in metabolic networks. Procedia Computer Science, 18:409–418, 2013. ",
|
| 1289 |
+
"bbox": [
|
| 1290 |
+
174,
|
| 1291 |
+
314,
|
| 1292 |
+
823,
|
| 1293 |
+
357
|
| 1294 |
+
],
|
| 1295 |
+
"page_idx": 10
|
| 1296 |
+
},
|
| 1297 |
+
{
|
| 1298 |
+
"type": "text",
|
| 1299 |
+
"text": "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. ",
|
| 1300 |
+
"bbox": [
|
| 1301 |
+
174,
|
| 1302 |
+
364,
|
| 1303 |
+
823,
|
| 1304 |
+
409
|
| 1305 |
+
],
|
| 1306 |
+
"page_idx": 10
|
| 1307 |
+
},
|
| 1308 |
+
{
|
| 1309 |
+
"type": "text",
|
| 1310 |
+
"text": "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. ",
|
| 1311 |
+
"bbox": [
|
| 1312 |
+
173,
|
| 1313 |
+
416,
|
| 1314 |
+
825,
|
| 1315 |
+
473
|
| 1316 |
+
],
|
| 1317 |
+
"page_idx": 10
|
| 1318 |
+
},
|
| 1319 |
+
{
|
| 1320 |
+
"type": "text",
|
| 1321 |
+
"text": "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. ",
|
| 1322 |
+
"bbox": [
|
| 1323 |
+
176,
|
| 1324 |
+
481,
|
| 1325 |
+
823,
|
| 1326 |
+
523
|
| 1327 |
+
],
|
| 1328 |
+
"page_idx": 10
|
| 1329 |
+
},
|
| 1330 |
+
{
|
| 1331 |
+
"type": "text",
|
| 1332 |
+
"text": "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. ",
|
| 1333 |
+
"bbox": [
|
| 1334 |
+
174,
|
| 1335 |
+
531,
|
| 1336 |
+
825,
|
| 1337 |
+
574
|
| 1338 |
+
],
|
| 1339 |
+
"page_idx": 10
|
| 1340 |
+
},
|
| 1341 |
+
{
|
| 1342 |
+
"type": "text",
|
| 1343 |
+
"text": "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. ",
|
| 1344 |
+
"bbox": [
|
| 1345 |
+
174,
|
| 1346 |
+
582,
|
| 1347 |
+
821,
|
| 1348 |
+
611
|
| 1349 |
+
],
|
| 1350 |
+
"page_idx": 10
|
| 1351 |
+
},
|
| 1352 |
+
{
|
| 1353 |
+
"type": "text",
|
| 1354 |
+
"text": "Minh N Vu and My T Thai. Pgm-explainer: Probabilistic graphical model explanations for graph neural networks. arXiv preprint arXiv:2010.05788, 2020. ",
|
| 1355 |
+
"bbox": [
|
| 1356 |
+
173,
|
| 1357 |
+
618,
|
| 1358 |
+
820,
|
| 1359 |
+
648
|
| 1360 |
+
],
|
| 1361 |
+
"page_idx": 10
|
| 1362 |
+
},
|
| 1363 |
+
{
|
| 1364 |
+
"type": "text",
|
| 1365 |
+
"text": "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. ",
|
| 1366 |
+
"bbox": [
|
| 1367 |
+
171,
|
| 1368 |
+
655,
|
| 1369 |
+
823,
|
| 1370 |
+
685
|
| 1371 |
+
],
|
| 1372 |
+
"page_idx": 10
|
| 1373 |
+
},
|
| 1374 |
+
{
|
| 1375 |
+
"type": "text",
|
| 1376 |
+
"text": "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. ",
|
| 1377 |
+
"bbox": [
|
| 1378 |
+
173,
|
| 1379 |
+
691,
|
| 1380 |
+
825,
|
| 1381 |
+
734
|
| 1382 |
+
],
|
| 1383 |
+
"page_idx": 10
|
| 1384 |
+
},
|
| 1385 |
+
{
|
| 1386 |
+
"type": "text",
|
| 1387 |
+
"text": "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. ",
|
| 1388 |
+
"bbox": [
|
| 1389 |
+
171,
|
| 1390 |
+
742,
|
| 1391 |
+
825,
|
| 1392 |
+
786
|
| 1393 |
+
],
|
| 1394 |
+
"page_idx": 10
|
| 1395 |
+
},
|
| 1396 |
+
{
|
| 1397 |
+
"type": "text",
|
| 1398 |
+
"text": "Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018. ",
|
| 1399 |
+
"bbox": [
|
| 1400 |
+
173,
|
| 1401 |
+
792,
|
| 1402 |
+
821,
|
| 1403 |
+
823
|
| 1404 |
+
],
|
| 1405 |
+
"page_idx": 10
|
| 1406 |
+
},
|
| 1407 |
+
{
|
| 1408 |
+
"type": "text",
|
| 1409 |
+
"text": "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. ",
|
| 1410 |
+
"bbox": [
|
| 1411 |
+
174,
|
| 1412 |
+
830,
|
| 1413 |
+
823,
|
| 1414 |
+
873
|
| 1415 |
+
],
|
| 1416 |
+
"page_idx": 10
|
| 1417 |
+
},
|
| 1418 |
+
{
|
| 1419 |
+
"type": "text",
|
| 1420 |
+
"text": "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. ",
|
| 1421 |
+
"bbox": [
|
| 1422 |
+
174,
|
| 1423 |
+
881,
|
| 1424 |
+
825,
|
| 1425 |
+
924
|
| 1426 |
+
],
|
| 1427 |
+
"page_idx": 10
|
| 1428 |
+
},
|
| 1429 |
+
{
|
| 1430 |
+
"type": "text",
|
| 1431 |
+
"text": "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. ",
|
| 1432 |
+
"bbox": [
|
| 1433 |
+
173,
|
| 1434 |
+
103,
|
| 1435 |
+
825,
|
| 1436 |
+
146
|
| 1437 |
+
],
|
| 1438 |
+
"page_idx": 11
|
| 1439 |
+
},
|
| 1440 |
+
{
|
| 1441 |
+
"type": "text",
|
| 1442 |
+
"text": "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. ",
|
| 1443 |
+
"bbox": [
|
| 1444 |
+
178,
|
| 1445 |
+
155,
|
| 1446 |
+
823,
|
| 1447 |
+
198
|
| 1448 |
+
],
|
| 1449 |
+
"page_idx": 11
|
| 1450 |
+
},
|
| 1451 |
+
{
|
| 1452 |
+
"type": "text",
|
| 1453 |
+
"text": "Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. arXiv preprint arXiv:2012.15445, 2020b. ",
|
| 1454 |
+
"bbox": [
|
| 1455 |
+
169,
|
| 1456 |
+
207,
|
| 1457 |
+
823,
|
| 1458 |
+
234
|
| 1459 |
+
],
|
| 1460 |
+
"page_idx": 11
|
| 1461 |
+
},
|
| 1462 |
+
{
|
| 1463 |
+
"type": "text",
|
| 1464 |
+
"text": "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. ",
|
| 1465 |
+
"bbox": [
|
| 1466 |
+
174,
|
| 1467 |
+
244,
|
| 1468 |
+
823,
|
| 1469 |
+
272
|
| 1470 |
+
],
|
| 1471 |
+
"page_idx": 11
|
| 1472 |
+
},
|
| 1473 |
+
{
|
| 1474 |
+
"type": "table",
|
| 1475 |
+
"img_path": "images/a4610763bba668bc16b27324a4250d04f43f7d11416ffcf19ec9520d81db9641.jpg",
|
| 1476 |
+
"table_caption": [],
|
| 1477 |
+
"table_footnote": [],
|
| 1478 |
+
"table_body": "<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>",
|
| 1479 |
+
"bbox": [
|
| 1480 |
+
174,
|
| 1481 |
+
140,
|
| 1482 |
+
826,
|
| 1483 |
+
410
|
| 1484 |
+
],
|
| 1485 |
+
"page_idx": 12
|
| 1486 |
+
},
|
| 1487 |
+
{
|
| 1488 |
+
"type": "text",
|
| 1489 |
+
"text": "B A GENERAL MOTIFS EXTRACTION RULE ",
|
| 1490 |
+
"text_level": 1,
|
| 1491 |
+
"bbox": [
|
| 1492 |
+
174,
|
| 1493 |
+
443,
|
| 1494 |
+
550,
|
| 1495 |
+
460
|
| 1496 |
+
],
|
| 1497 |
+
"page_idx": 12
|
| 1498 |
+
},
|
| 1499 |
+
{
|
| 1500 |
+
"type": "text",
|
| 1501 |
+
"text": "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. ",
|
| 1502 |
+
"bbox": [
|
| 1503 |
+
173,
|
| 1504 |
+
476,
|
| 1505 |
+
825,
|
| 1506 |
+
656
|
| 1507 |
+
],
|
| 1508 |
+
"page_idx": 12
|
| 1509 |
+
},
|
| 1510 |
+
{
|
| 1511 |
+
"type": "text",
|
| 1512 |
+
"text": "C COMMON MOTIFS IN BIOLOGICAL AND ENGINEERING NETWORKS ",
|
| 1513 |
+
"text_level": 1,
|
| 1514 |
+
"bbox": [
|
| 1515 |
+
169,
|
| 1516 |
+
679,
|
| 1517 |
+
764,
|
| 1518 |
+
695
|
| 1519 |
+
],
|
| 1520 |
+
"page_idx": 12
|
| 1521 |
+
},
|
| 1522 |
+
{
|
| 1523 |
+
"type": "image",
|
| 1524 |
+
"img_path": "images/f8bc37f1d648b03b9d94603cb23cb888d3aeb688e65a7bb115a9668bcec43aff.jpg",
|
| 1525 |
+
"image_caption": [
|
| 1526 |
+
"Figure 3: Popular motifs in biological and engineering networks. "
|
| 1527 |
+
],
|
| 1528 |
+
"image_footnote": [],
|
| 1529 |
+
"bbox": [
|
| 1530 |
+
302,
|
| 1531 |
+
715,
|
| 1532 |
+
696,
|
| 1533 |
+
892
|
| 1534 |
+
],
|
| 1535 |
+
"page_idx": 12
|
| 1536 |
+
},
|
| 1537 |
+
{
|
| 1538 |
+
"type": "text",
|
| 1539 |
+
"text": "In this section, Figure 3 show some common motifs in biological and engineering networks introduced in section 3.2. ",
|
| 1540 |
+
"bbox": [
|
| 1541 |
+
173,
|
| 1542 |
+
103,
|
| 1543 |
+
823,
|
| 1544 |
+
132
|
| 1545 |
+
],
|
| 1546 |
+
"page_idx": 13
|
| 1547 |
+
},
|
| 1548 |
+
{
|
| 1549 |
+
"type": "text",
|
| 1550 |
+
"text": "D DATASETS AND GNN MODELS ",
|
| 1551 |
+
"text_level": 1,
|
| 1552 |
+
"bbox": [
|
| 1553 |
+
174,
|
| 1554 |
+
151,
|
| 1555 |
+
467,
|
| 1556 |
+
169
|
| 1557 |
+
],
|
| 1558 |
+
"page_idx": 13
|
| 1559 |
+
},
|
| 1560 |
+
{
|
| 1561 |
+
"type": "text",
|
| 1562 |
+
"text": "D.1 STATISTIC AND PROPERTIES OF DATASETS",
|
| 1563 |
+
"text_level": 1,
|
| 1564 |
+
"bbox": [
|
| 1565 |
+
173,
|
| 1566 |
+
184,
|
| 1567 |
+
509,
|
| 1568 |
+
198
|
| 1569 |
+
],
|
| 1570 |
+
"page_idx": 13
|
| 1571 |
+
},
|
| 1572 |
+
{
|
| 1573 |
+
"type": "table",
|
| 1574 |
+
"img_path": "images/e6a64afd5d743730d582dc5b78c1e47b25307c796d1849e46ed696ee698ed301.jpg",
|
| 1575 |
+
"table_caption": [
|
| 1576 |
+
"Table 5: Statistics and properties of three datasets. "
|
| 1577 |
+
],
|
| 1578 |
+
"table_footnote": [],
|
| 1579 |
+
"table_body": "<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>",
|
| 1580 |
+
"bbox": [
|
| 1581 |
+
173,
|
| 1582 |
+
239,
|
| 1583 |
+
823,
|
| 1584 |
+
313
|
| 1585 |
+
],
|
| 1586 |
+
"page_idx": 13
|
| 1587 |
+
},
|
| 1588 |
+
{
|
| 1589 |
+
"type": "text",
|
| 1590 |
+
"text": "D.2 SETTINGS OF GNN MODELS ",
|
| 1591 |
+
"text_level": 1,
|
| 1592 |
+
"bbox": [
|
| 1593 |
+
176,
|
| 1594 |
+
320,
|
| 1595 |
+
418,
|
| 1596 |
+
335
|
| 1597 |
+
],
|
| 1598 |
+
"page_idx": 13
|
| 1599 |
+
},
|
| 1600 |
+
{
|
| 1601 |
+
"type": "text",
|
| 1602 |
+
"text": "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. ",
|
| 1603 |
+
"bbox": [
|
| 1604 |
+
174,
|
| 1605 |
+
347,
|
| 1606 |
+
825,
|
| 1607 |
+
388
|
| 1608 |
+
],
|
| 1609 |
+
"page_idx": 13
|
| 1610 |
+
},
|
| 1611 |
+
{
|
| 1612 |
+
"type": "text",
|
| 1613 |
+
"text": "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. ",
|
| 1614 |
+
"bbox": [
|
| 1615 |
+
174,
|
| 1616 |
+
395,
|
| 1617 |
+
825,
|
| 1618 |
+
465
|
| 1619 |
+
],
|
| 1620 |
+
"page_idx": 13
|
| 1621 |
+
},
|
| 1622 |
+
{
|
| 1623 |
+
"type": "text",
|
| 1624 |
+
"text": "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. ",
|
| 1625 |
+
"bbox": [
|
| 1626 |
+
173,
|
| 1627 |
+
472,
|
| 1628 |
+
825,
|
| 1629 |
+
542
|
| 1630 |
+
],
|
| 1631 |
+
"page_idx": 13
|
| 1632 |
+
},
|
| 1633 |
+
{
|
| 1634 |
+
"type": "text",
|
| 1635 |
+
"text": "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. ",
|
| 1636 |
+
"bbox": [
|
| 1637 |
+
173,
|
| 1638 |
+
549,
|
| 1639 |
+
825,
|
| 1640 |
+
633
|
| 1641 |
+
],
|
| 1642 |
+
"page_idx": 13
|
| 1643 |
+
},
|
| 1644 |
+
{
|
| 1645 |
+
"type": "text",
|
| 1646 |
+
"text": "D.3 EXPERIMENT ENVIRONMENT SETTINGS ",
|
| 1647 |
+
"text_level": 1,
|
| 1648 |
+
"bbox": [
|
| 1649 |
+
174,
|
| 1650 |
+
650,
|
| 1651 |
+
495,
|
| 1652 |
+
665
|
| 1653 |
+
],
|
| 1654 |
+
"page_idx": 13
|
| 1655 |
+
},
|
| 1656 |
+
{
|
| 1657 |
+
"type": "text",
|
| 1658 |
+
"text": "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. ",
|
| 1659 |
+
"bbox": [
|
| 1660 |
+
174,
|
| 1661 |
+
676,
|
| 1662 |
+
825,
|
| 1663 |
+
718
|
| 1664 |
+
],
|
| 1665 |
+
"page_idx": 13
|
| 1666 |
+
},
|
| 1667 |
+
{
|
| 1668 |
+
"type": "text",
|
| 1669 |
+
"text": "E MORE QUANTITATIVE RESULTS ",
|
| 1670 |
+
"text_level": 1,
|
| 1671 |
+
"bbox": [
|
| 1672 |
+
176,
|
| 1673 |
+
102,
|
| 1674 |
+
472,
|
| 1675 |
+
119
|
| 1676 |
+
],
|
| 1677 |
+
"page_idx": 14
|
| 1678 |
+
},
|
| 1679 |
+
{
|
| 1680 |
+
"type": "table",
|
| 1681 |
+
"img_path": "images/2b5793e3d3e3dd07f13249c0e0d76541e720353ed025b6b6f18fe48d867862ca.jpg",
|
| 1682 |
+
"table_caption": [
|
| 1683 |
+
"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. "
|
| 1684 |
+
],
|
| 1685 |
+
"table_footnote": [],
|
| 1686 |
+
"table_body": "<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>",
|
| 1687 |
+
"bbox": [
|
| 1688 |
+
173,
|
| 1689 |
+
180,
|
| 1690 |
+
825,
|
| 1691 |
+
313
|
| 1692 |
+
],
|
| 1693 |
+
"page_idx": 14
|
| 1694 |
+
},
|
| 1695 |
+
{
|
| 1696 |
+
"type": "table",
|
| 1697 |
+
"img_path": "images/7acc6dc473c81d6682e1a5a867a9023fc18768c4027debc751d910a314100a78.jpg",
|
| 1698 |
+
"table_caption": [
|
| 1699 |
+
"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. "
|
| 1700 |
+
],
|
| 1701 |
+
"table_footnote": [],
|
| 1702 |
+
"table_body": "<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>",
|
| 1703 |
+
"bbox": [
|
| 1704 |
+
173,
|
| 1705 |
+
383,
|
| 1706 |
+
825,
|
| 1707 |
+
521
|
| 1708 |
+
],
|
| 1709 |
+
"page_idx": 14
|
| 1710 |
+
},
|
| 1711 |
+
{
|
| 1712 |
+
"type": "table",
|
| 1713 |
+
"img_path": "images/13c6213b47575f1b45c31e1c8e21d03ba3de272ed44da15e8fb343f519ff5762.jpg",
|
| 1714 |
+
"table_caption": [
|
| 1715 |
+
"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. "
|
| 1716 |
+
],
|
| 1717 |
+
"table_footnote": [],
|
| 1718 |
+
"table_body": "<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>",
|
| 1719 |
+
"bbox": [
|
| 1720 |
+
171,
|
| 1721 |
+
593,
|
| 1722 |
+
825,
|
| 1723 |
+
731
|
| 1724 |
+
],
|
| 1725 |
+
"page_idx": 14
|
| 1726 |
+
},
|
| 1727 |
+
{
|
| 1728 |
+
"type": "text",
|
| 1729 |
+
"text": "F VISUALIZATION OF EXPLANATION ",
|
| 1730 |
+
"text_level": 1,
|
| 1731 |
+
"bbox": [
|
| 1732 |
+
174,
|
| 1733 |
+
102,
|
| 1734 |
+
495,
|
| 1735 |
+
118
|
| 1736 |
+
],
|
| 1737 |
+
"page_idx": 15
|
| 1738 |
+
},
|
| 1739 |
+
{
|
| 1740 |
+
"type": "text",
|
| 1741 |
+
"text": "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. ",
|
| 1742 |
+
"bbox": [
|
| 1743 |
+
174,
|
| 1744 |
+
133,
|
| 1745 |
+
825,
|
| 1746 |
+
176
|
| 1747 |
+
],
|
| 1748 |
+
"page_idx": 15
|
| 1749 |
+
},
|
| 1750 |
+
{
|
| 1751 |
+
"type": "image",
|
| 1752 |
+
"img_path": "images/f400b0b3a962c90388877cdd94d1b308f3c55ad9a6b7ae826341bb88468c7421.jpg",
|
| 1753 |
+
"image_caption": [
|
| 1754 |
+
"Figure 4: Popular motifs in biological and engineering networks. "
|
| 1755 |
+
],
|
| 1756 |
+
"image_footnote": [],
|
| 1757 |
+
"bbox": [
|
| 1758 |
+
191,
|
| 1759 |
+
194,
|
| 1760 |
+
808,
|
| 1761 |
+
843
|
| 1762 |
+
],
|
| 1763 |
+
"page_idx": 15
|
| 1764 |
+
}
|
| 1765 |
+
]
|
parse/dev/0YXmOFLb1wQ/0YXmOFLb1wQ_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/5xEgrl_5FAJ/5xEgrl_5FAJ_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/5xEgrl_5FAJ/5xEgrl_5FAJ_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/5xEgrl_5FAJ/5xEgrl_5FAJ_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/6res1KC1Z3Z/6res1KC1Z3Z.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
| 1 |
+
# BATCH-SOFTMAX CONTRASTIVE LOSS FOR PAIRWISE SENTENCE SCORING TASKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The use of contrastive loss for representation learning has become prominent in computer vision, and it is now getting attention in Natural Language Processing (NLP). Here, we explore the idea of using a batch-softmax contrastive loss when fine-tuning large-scale pre-trained transformer models to learn better task-specific sentence embeddings for pairwise sentence scoring tasks. We introduce and study a number of variations in the calculation of the loss as well as in the overall training procedure; in particular, we find that data shuffling can be quite important. Our experimental results show sizable improvements on a number of datasets and pairwise sentence scoring tasks including classification, ranking, and regression. Finally, we offer detailed analysis and discussion, which should be useful for researchers aiming to explore the utility of contrastive loss in NLP.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent years have seen a revolution in Natural Language Processing (NLP) thanks to the advances in machine learning. A lot of attention has been paid to architectures, especially for deep learning, as well as to loss functions. Notably, loss functions based on similar ideas were proposed in unrelated papers in different machine learning fields under different names. This can cause difficulties when solving new problems or when designing new experiments based on previous results. To a greater extent, this applies to “universal” loss functions, which can be applied in different machine learning areas and tasks such as Computer Vision (CV), Recommendation Systems, and NLP. An example of such universal loss function is the batch-softmax contrastive (BSC) loss, which we will discuss below.
|
| 12 |
+
|
| 13 |
+
For many NLP tasks, it is important to obtain representations of sentences for semantic matching problems, since they can be used for further analysis, e.g., for finding the best answer to a question. Sentence BERT is a recent popular approach for this (Reimers & Gurevych, 2019): it can be trained with different loss functions, and we show that the choice of a loss function is important. Moreover, we show that it will not be optimal to take the “standard” batch-softmax contrastive loss, which is used for training SimCSE Gao et al. (2021), a recent alternative to Sentence BERT, and we suggest ways to improve its efficiency. Our contributions can be summarized as follows:
|
| 14 |
+
|
| 15 |
+
• We study the use of a batch-softmax contrastive loss for fine-tuning large-scale transformers to learn better task-specific sentence embeddings for pairwise sentence scoring tasks.
|
| 16 |
+
• We introduce and study a number of novel variations in the calculation of the loss such as symmetrization, incorporating labeled negatives, aligning scores on the similarity matrix diagonal, normalizing over the batch axis, as well as in the overall training procedure, e.g., shuffling, trainable temperature, and sequential pre-training.
|
| 17 |
+
• We demonstrate sizable improvements for a number of pairwise sentence scoring tasks such as classification, ranking, and regression.
|
| 18 |
+
• We offer detailed analysis and discussion, which would be useful for future research.
|
| 19 |
+
• We release our code at http://anonymous
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
The contrastive loss was proposed by Hadsell et al. (2006) as metric learning that contrasts Euclidean distances between embeddings of samples from one class and between samples from different classes. Weinberger et al. (2006) suggested the triplet loss, which is based on a similar idea, but uses triplets (anchor, positive, negative), and aims for the difference between the distances for (anchor, positive) and for (anchor, negative) to be larger than a margin. $N$ -pair loss was presented as a generalization of the contrastive and the triplet losses as a way to solve the problem of extensive construction of hard negative pairs and triplets (Sohn, 2016).
|
| 24 |
+
|
| 25 |
+
To this end, a batch of $N$ pairs of examples from $N$ different classes is sampled, and the first element in each pair is considered to be an anchor. Thus, for each anchor, there are one positive and $N - 1$ negative pairs. The loss contrasts the distances simultaneously using the softmax function over dotproduct similarities. The approach was used successfully in computer vision (CV) tasks. The same method of Multiple Negative Ranking for training Dot-Product Scoring Models was applied to ranking natural language responses to emails (Henderson et al., 2017), where the loss uses labeled pairs. A similar idea, called Negative Sharing, was used to reduce the computational cost when training recommender systems (Chen et al., 2017). Wu et al. (2018) presented an approach with $N$ -pairs like logic, as a Non-Parametric Softmax Classifier, replacing the weights in the softmax with embeddings of samples from such classes. It was also proposed to use L2 normalization and temperature. Yang et al. (2018) proposed to use Multiple Negative Ranking to train general sentence representations on data from Reddit and SNLI. Logeswaran & Lee (2018) presented a Quick-Thoughts approach to learn sentence embeddings, which constructs batches of contiguous sets of sentences, and for each sentence, contrasts the next sentence in the text and all other candidates.
|
| 26 |
+
|
| 27 |
+
A lot of subsequent work has focused on maximizing Mutual Information (MI). Oord et al. (2018) presented a loss function based on Noise-Contrastive Estimation, called InfoNCE. It models the “similarity” function that estimates the MI between the target (future) and the context (present) signals, and maximizes the MI between temporally nearby signals. If this “similarity” function expresses the dot-product between embeddings, the InfoNCE loss is equivalent to the $N$ -pair loss up to some constants. It was also shown that InfoNCE is equivalent to the Mutual Information Neural Estimator (MINE) up to a constant (Belghazi et al., 2018), whose minimization maximizes a lower bound on MI. Deep InfoMax (DIM) (Hjelm et al., 2019) improves MINE, and can be modified to incorporate some autoregression as InfoNCE. However, Tschannen et al. (2020) pointed out that the effectiveness of loss functions such as DIM and InfoNCE might be primarily connected not to deep metric learning but rather to MI.
|
| 28 |
+
|
| 29 |
+
The idea gained a lot of popularity in Computer Vision with the advent of SimCLR (a Simple framework for Contrastive Learning of visual Representations), which introduced NT-Xent (normalized temperature-scaled cross-entropy loss) (Chen et al., 2020). It uses self-supervised learning, where augmentations of the same image are considered as positive examples and augmentations of different images are used as negative examples. Thus, the task is as follows: for each example in a batch, find its paired positive augmentation. Here, the $N$ -pairs loss is modified with a temperature parameter and with an L2 normalization of embeddings to the unit hypersphere. The loss was further extended for supervised learning as SupCon loss (Khosla et al., 2020), which aggregates all positive examples (from the same class) in the softmax numerator.
|
| 30 |
+
|
| 31 |
+
Subsequently, these losses were introduced to the field of Natural Language Processing (NLP). Gunel et al. (2020) combined the SupCon loss with the cross-entropy loss and obtained state-ofthe-art results for several downstream NLP tasks using RoBERTa. Giorgi et al. (2020), Fang & Xie (2020) and Meng et al. (2021) used NT-Xent to pre-train Transformers, considering spans sampled from the same document, sentences augmented with back-translation as positive examples, and sequences corrupted with MLM. Luo et al. (2020) proposed to use NT-Xent in a self-supervised setting to learn noise-invariant sequence representations, where sentences augmented with masking were considered as positive examples. Finally, Gao et al. (2021) introduced the SimCLR loss to NLP under the name SimCSE (Simple Contrastive Learning of Sentence Embeddings), where sentences processed by a neural network with dropout served as augmentations of the original sentences. Here, we explore various ways to use a similar loss function for pairwise sentence scoring tasks.
|
| 32 |
+
|
| 33 |
+
While the above-described loss functions have different names, they are all based on similar ideas. Below, we will use the name Batch-Softmax Contrastive (BSC) loss, which we believe reflects the main idea best. In our experiments below, we will use the “modern” variant of the loss: with temperature, normalization, and symmetrization components (described in more detail in Section 3.1). These components were not used for NLP in combination before. We further introduce a number of novel and important modifications in the definition of the loss and in the training procedure, which make it more efficient, and we show that using the resulting loss yields better task-specific sentence embeddings for pairwise sentence scoring tasks.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: For the set of positives pairs $( q _ { i } , a _ { i } )$ , e.g., question–answer, for each $q _ { i }$ , the BSC loss contrasts the scores between $q _ { i }$ and $a _ { i }$ (positive examples) vs. between $q _ { i }$ and $a _ { j }$ for all $j \neq i$ (negative examples) using softmax. Here $\mathbf { \delta m }$ denotes the dot-product.
|
| 37 |
+
|
| 38 |
+
# 3 METHOD
|
| 39 |
+
|
| 40 |
+
# 3.1 BATCH-SOFTMAX CONTRASTIVE (BSC) LOSS
|
| 41 |
+
|
| 42 |
+
Pointwise approaches for training models for pairwise sentence scoring tasks, such as mean squared error (MSE), are problematic as the loss does not take the relative order into account. For instance, for two pairs with correct target scores (0.4, 0.5), the loss function would equally penalize answers like (0.3, 0.6) and (0.5, 0.4). However, the first pair is better, as it keeps the correct ranking, while the second one does not. This is addressed in pairwise approaches, e.g., in triplet loss, where the model directly learns an ordering. Yet, there is a problem for constructing pairs or triplets in the training set, as it is hard to find non-trivial negatives examples.
|
| 43 |
+
|
| 44 |
+
Unlike traditional pairwise loss functions, the BSC loss treats all other possible pairs of examples in the batch as “negatives.” That is, only positive pairs are needed for training. Consider a batch $X$ of pairs from a question-answering dataset. In general, let $Q _ { m \times n }$ and $A _ { m \times n }$ be the matrices of embeddings produced by a query model and an answer model. We define the loss function as follows:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r l } & { \mathcal { L } _ { B S C } ( X ) = \mathcal { L } _ { 0 } ( X ) + \mathcal { L } _ { 1 } ( X ) } \\ & { = - \operatorname* { m e a n } \left( \log \left( d i a g \left( \operatorname { s o f t m a x } \left( \frac { Q A ^ { T } } { \tau } \right) \right) \right) \right) - \operatorname* { m e a n } \left( \log \left( d i a g \left( \operatorname { s o f t m a x } \left( \frac { A Q ^ { T } } { \tau } \right) \right) \right) \right) } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Here, softmax is applied by rows (Figure 1), and $\tau$ is the temperature. Both components can be rewritten, e.g., $\mathcal { L } _ { 0 } ( X )$ can be written as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { L } _ { 0 } ( \boldsymbol { X } ) = - \frac { 1 } { m \tau } \sum _ { i = 1 } ^ { m } q _ { i } ^ { T } a _ { i } + \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \log \sum _ { j = 1 } ^ { m } \exp \left( \frac { q _ { i } ^ { T } a _ { j } } { \tau } \right)
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Mathematically, this loss function is similar to the one presented in (Chen et al., 2020). The difference is that we do not use augmentations, and we do not compare $q _ { i }$ to $q _ { j }$ (or $a _ { i }$ to $a _ { j }$ ) due to their different nature: we want to compare a question to an answer, not a question to a question or an answer to an answer. Thus, we apply the symmetrization in the formula. So, the difference from SimCSE (Gao et al., 2021) is that we compare not only $q _ { i }$ to all $a _ { j }$ , but also $a _ { i }$ to all $q _ { j }$ in the batch.
|
| 57 |
+
|
| 58 |
+
Note that, although a frequent short answer may fit multiple questions in a batch, such pairs are considered as “negative” examples in the loss. However, the loss learns Mutual Information (Tschannen et al., 2020), that is $p ( q _ { i } , \bar { a _ { i } } ) / ( p ( q _ { i } ) p ( a _ { i } ) )$ , and thus it is robust to this false negatives problem.
|
| 59 |
+
|
| 60 |
+
Early research has already shown the importance of properly configuring and using some BSC loss settings. For example, low temperatures are equivalent to optimizing for hard positives/negatives (Khosla et al., 2020), while L2 normalization of vectors to the unit hypersphere along with temperature effectively weighs different examples (Chen et al., 2020). We further propose a number of important modifications that can have a major impact on the performance for a number of tasks.
|
| 61 |
+
|
| 62 |
+
# 3.2 BATCH CONSTRUCTION
|
| 63 |
+
|
| 64 |
+
In computer vision, it is common to use a batch size of 5,000, which in turn would naturally be very likely to contain some hard negative examples. In NLP, fine-tuning Transformer-based models with large batch sizes requires very large amounts of memory. Thus, much smaller batches are used in practice, and as a result, it becomes important to make sure these batches do contain some hard negative examples. We achieve this by fixing the content of the batches at each epoch of the training process. Note that this is much simpler than mining hard negatives, as we only need to increase the likelihood that there would be a hard negative example present in the batch, but we do not need to know which particular example in the batch would be hard. Inside the batch, this would be controlled by the temperature parameter.
|
| 65 |
+
|
| 66 |
+
Example-based shuffling The key idea of this method is to batch several groups, so that within each group all pairs are similar based on their first or based on their second elements. In this way, each positive pair would be accompanied by hard negatives from the same group and by simpler negatives from the remaining examples inside the batch (which come from other groups). We use the $k$ -nearest neighbors for an input example to form a group for it, and Faiss (Johnson et al., 2019) to quickly find these nearest neighbors in the embedding space. Let the pairs be grouped by their first elements $q _ { i }$ . Algorithm 1 summarizes the proposed method.
|
| 67 |
+
|
| 68 |
+
Note that we use two stages in kNN to limit the range of possible candidates and thus to reduce the computational costs (both in terms of time and memory). We first extract the top$n$ neighbors (for some large $n$ , e.g., 500), and then we take the top- $k$ from them, so that no duplicates appear in the final sequence (for some small $k = 7$ ). The time complexity of such a check is ${ \mathrm { O } } ( 1 )$ . If all such neighbors are already used, then only the considered example will be added to the resulting sequence. This case will often arise for the last examples, and thus batches will consist of simple 1-element groups. Therefore, we reverse the
|
| 69 |
+
|
| 70 |
+
# Algorithm 1 Example-based shuffling
|
| 71 |
+
|
| 72 |
+
Input: sequence $D$ , group size s
|
| 73 |
+
initialize $\bar { R } \bigcup \ \mathsf { \Gamma } \triangleright \bar { \mathsf { \Gamma } }$ sequence to store the result
|
| 74 |
+
initialize $U \gets \emptyset$ $\vartriangleright$ set of used examples
|
| 75 |
+
randomly shuffle $D$
|
| 76 |
+
for $\ominus$ in $D$ do if $\ominus \notin U$ then find the $n$ nearest neighbors of $\ominus$ from $D$ choose the top $s - 1$ that are not in $U$ add them and $\ominus$ to $R$ and also to $U$
|
| 77 |
+
return reversed $R$
|
| 78 |
+
|
| 79 |
+
sequence to start with these simple batches, as in curriculum learning.
|
| 80 |
+
|
| 81 |
+
By default, we assume that there should be one positive example for each question/answer (on the diagonal of the matrix), and thus identical neighbors could be optionally filtered. Still, if there are the same $q _ { i }$ in the batch $X$ , the loss definition (eq. 1) does not change. Indeed, let $P _ { q } = \{ i | q _ { i } =$ $q , ( q _ { i } , a _ { i } ) \in X \}$ , then $\forall i , j \in P _ { q } : ( q _ { i } , a _ { j } )$ form a positive pair. According to Khosla et al. (2020), for each $q$ , all $\tilde { q } \in \mathcal { P } _ { q }$ should be placed in the softmax numerator and then averaging over all such $\tilde { q }$ should be performed outside the logarithm. Thus, in $\mathcal { L } _ { 0 } ( X )$ (eq. 2) only the first sum would change:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\sum _ { i \in P _ { q } } q _ { i } ^ { T } a _ { i } \{ \substack { \ r { \ r { \sigma } } \ r { \ r { \sigma } } \ r { } \sum _ { i \in P _ { q } } \frac { 1 } { \vert P _ { q } \vert } } \sum _ { j \in P _ { q } } q _ { i } ^ { T } a _ { j } = \sum _ { j \in P _ { q } } \frac { 1 } { \vert P _ { q } \vert } \sum _ { i \in P _ { q } } q ^ { T } a _ { j } = \sum _ { j \in P _ { q } } q _ { j } ^ { T } a _ { j }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { l } { { \mathrm { I n } \not \mathcal { L } _ { 1 } ( X ) : \sum _ { i \in P _ { q } } q _ { i } ^ { T } a _ { i } \ \mathrm { \dots } \ \sum _ { i \in P _ { q } } \displaystyle \frac { 1 } { | P _ { q } | } \sum _ { j \in P _ { q } } q _ { j } ^ { T } a _ { i } = \sum _ { i \in P _ { q } } \displaystyle \frac { 1 } { | P _ { q } | } \sum _ { j \in P _ { q } } q ^ { T } a _ { i } = \sum _ { i \in P _ { q } } q _ { i } ^ { T } a _ { i } } } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
To select the groups even better, we consider task-specific embeddings. To this end, we apply the current model to encode all pairs at each epoch.
|
| 92 |
+
|
| 93 |
+
Fast shuffling For extremely large datasets, example-based shuffling is time-consuming even with Faiss; thus, we propose several effective options to perform a less-thorough shuffling. We choose some attribute by which we will group the examples, that is, we guarantee some closeness of the examples. Thus, the examples are close if they share the same words, the same cluster number or the same nearest neighbors. First, consider the case of words and grouping by the first elements of the pairs (the case of the second elements is the same). Algorithm 2 presents the shuffling process. To produce a shuffle by clusters, we apply the same algorithm, where each sentence is replaced by its cluster number. Thus, each shingle has size $t = 1$ . In order to make a shuffle by nearest neighbors, we create shingles by “sentences,” where the words are the positions of the top- $k$ nearest neighbors in the input sequence (for some small $k$ ). All of these approaches, as well as $k$ -means clustering, can be effectively implemented using MapReduce and parallel computations.
|
| 94 |
+
|
| 95 |
+
Algorithm 2 Shuffling by words Input: sequence $D$ , group size $k$ , shingle size t for $\ominus$ in $D$ do $\ominus$ .shing $\beth $ random subset of $t$ words of $\ominus$ (ignoring stop-words) sort $D$ by $\ominus$ .shingle initialize $\Im \ I \mathrm { D }$ random uint64 $\vartriangleright$ group ID initialize $s \gets 0$ $\vartriangleright$ current group size initialize $_ { \mathrm { p } x \in \mathrm { V } } $ first element of $D$ for $\ominus$ in $D$ do if e.shing $\mathtt { \cdot 1 } \mathtt { e } \neq \mathtt { p } \mathtt { r } \mathtt { e } \mathtt { v }$ .shingle then $\Im \ I \mathrm { D }$ random uint64 if ${ \bf s } \geqslant { \bf k }$ then $\Im \ I \mathrm { D }$ random uint64 s Ð 0 e.gID Ð gID s Ð s \` 1 prev Ð e sort $D$ by e.gID return D
|
| 96 |
+
|
| 97 |
+
# 3.3 LABELED NEGATIVES
|
| 98 |
+
|
| 99 |
+
Usually, when the data size is small, hard negative examples may be hard to obtain even with data shuffling, e.g., when all examples are semantically distant. Nonetheless, if the dataset contains a labeled negative pair with some anchor, then its elements are semantically close by traditional rules of dataset construction. Thus, using such a pair inside the batch, where this anchor is present, will add the necessary hard negative example.
|
| 100 |
+
|
| 101 |
+
The only change that is added in the loss function is the masking of negative examples—we have no guarantees that the selected negative example is closer to the anchor than the rest of the examples inside the batch. Let $y _ { i }$ be a binary label, where $y _ { i } = 1$ if the $i$ -th pair is positive. Then, we have
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathcal { L } _ { 0 } ( \boldsymbol { X } ) = - \frac { 1 } { m \tau } \sum _ { i = 1 } ^ { m } \mathbb { 1 } [ y _ { i } = 1 ] q _ { i } ^ { T } a _ { i } + \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \mathbb { 1 } [ y _ { i } = 1 ] \log \sum _ { j = 1 } ^ { m } \exp \left( \frac { q _ { i } ^ { T } a _ { j } } { \tau } \right)
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
# 3.4 COMBO LOSS
|
| 108 |
+
|
| 109 |
+
Theoretically, it is beneficial to use several loss functions for training if they are calculated on the same batch (and thus do not require additional computations). That is, joint training of BSC and MSE losses combines the advantages of pointwise and of pairwise approaches, thus ensuring that for positives examples, the values on the diagonal of the dot-product matrix are not only greater e also close to 1 or to some for target positive similarities get similarity. Note that here , and thus we do not force all ot $L _ { M S E } ( X ) \ =$ $\begin{array} { r } { \frac { 1 } { m } \sum _ { i } ^ { m } ( ( q _ { i } ^ { T } a _ { i } ) - y _ { i } ) ^ { 2 } } \end{array}$ $y _ { i }$ to zero. At the same time, the BSC loss adds new examples (“negative” pairs) to the training set.
|
| 110 |
+
|
| 111 |
+
In order to use the BSC loss when training a model in tasks with non-binary labels, we modify the indicator function in the equation 5, as $\mathbb { I } [ y _ { i } > t ]$ , where $t$ is a configurable binarization threshold. Then, we use their convex combination with the configurable hyperparameter $\mu \in ( 0 , 1 )$ :
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
L ( X ) = \mu L _ { B S C } ( X ) + ( 1 - \mu ) L _ { M S E } ( X )
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
# 3.5 NORMALIZATION
|
| 118 |
+
|
| 119 |
+
L2 normalization of matrices $A$ and $B$ means that $a _ { i } ^ { T } b _ { j }$ will be equivalent to cosine similarity. The embeddings can also be normalized by the batch dimension (by coordinates), which can bring
|
| 120 |
+
|
| 121 |
+
additional regularization. In our experiments, we confirm the importance of this, e.g., new representations can be calculated with L2 normalization by coordinates or in a min-max scale.
|
| 122 |
+
|
| 123 |
+
# 4 DATASETS
|
| 124 |
+
|
| 125 |
+
NLP tasks that compare pairs of sentences can be divided into regression (predicting a similarity score), classification (e.g., similar vs. dissimilar), and ranking (search for the best matches). They differ only by the quality assessment functions, and thus they all can benefit from the above losses.
|
| 126 |
+
|
| 127 |
+
Note that it is important to calculate sentence representations in ranking tasks, as when independently calculating the embeddings of the individual elements in the pairs, the inference time of the model becomes linear instead of quadratic. Therefore, we use Sentence-BERT (SBERT), which is trained as a Siamese BERT model, and offers a way to obtain state-of-the-art sentence embeddings, which have been proven useful for a number of tasks (Reimers & Gurevych, 2019; Thakur et al., 2020). At inference time, we first use SBERT to obtain independently a representation for each sentence in the pair, and then we calculate the cosine similarities between these embeddings.
|
| 128 |
+
|
| 129 |
+
We use the following English datasets and tasks for the evaluation. Four ranking tasks (ranking answers to non-factoid questions, ranking questions by their similarity with respect to other questions, ranking comments by their similarity to a given question, ranking fact-checked claims by their relevance with respect to an input claim), two binary classification tasks (paraphrases identification, and duplicate question identification), and one regression task (semantic sentence similarity).
|
| 130 |
+
|
| 131 |
+
Antique The dataset contains 2,626 non-factoid questions with answer choices (Hashemi et al., 2019), asked by users on Yahoo! Answers. There are a total of 34,011 question–answer pairs: 27,422 for training and 6,589 for validation. Each answer is annotated with a relevance score with respect to the question on a scale from 1 to 4, and the task is to rank the answers by their relevance. To model relevance as a cosine similarity, we normalize the scores to the r0, 1s interval. We use Mean Reciprocal Rank (MRR) as the main evaluation measure.
|
| 132 |
+
|
| 133 |
+
CQA-A This dataset was used in SemEval-2017 Task 3 on Community Question Answering subtask A (Nakov et al., 2017). The goal is to rank the first ten answers in a question thread on Qatar Living, so that good answers are ranked higher than bad ones. We used the clean part of the dataset, which consists of 14,110 and 2,440 labeled question–comments pairs for training and development, respectively. The evaluation measure is Mean Average Precision (MAP). This dataset contains important metadata, e.g., the date and time of the comment, and sorting the comments by time yields a strong baseline; yet, we only use the text. To train the model with the triplet loss, we group the pairs by the first element (anchor).
|
| 134 |
+
|
| 135 |
+
CQA-B This dataset was developed for SemEval-2017 Task 3, subtask B (Nakov et al., 2017), whose goal was to rank 10 potentially related questions by their similarity with respect to an input question. These questions are retrieved from the Qatar Living forum using Google and the input question as a query. We use the clean part of the dataset, which consists of 19,990 training and 5,500 development labeled question-question pairs. The main evaluation measure here is MAP. There is additional information, e.g., the rank of the retrieved question in the Google search results, which we do not use.
|
| 136 |
+
|
| 137 |
+
PFCC-S Shaar et al. (2020) presented a dataset for detecting Previously Fact-Checked Claims on Snopes (PFCC-S), aimed at facilitating the solution of a fact-checking problem: given an input claim, it asks to rank claims that have been previously fact-checked, so that claims that can help verify the input claim are ranked as high as possible. The dataset has 800 positive input–verified claim pairs for training and 200 such positive pairs for testing, and they are to be matched against a database of 10,369 verified claims. The evaluation is performed in terms of a HasPositive $@ \mathbf { k }$ metric, which checks whether there is a positive match among the first $k$ results in the ranked list. In order to train models using MSE or triplet loss, we sampled negatives according to the following scheme. First, we encoded all sentences using SBERT, pretrained on STS and NLI. Then, we selected the first element in each positive pair as an anchor and we sorted all other examples by their similarity to this anchor. The assumption is that positive examples will be concentrated in the beginning. Thus, we selected negatives starting from 101 on, logarithmically: on positions $1 0 0 + 2 ^ { k } , \breve { k } \in \mathbb { N }$ . As a result, we obtain many hard negative examples and a small number of easy ones. Finally, we oversampled the positive pairs to correct the balance of positive and negative examples.
|
| 138 |
+
|
| 139 |
+
Microsoft Research Paraphrase Corpus (MRPC) Dolan et al. (2004) contains 5,800 pairs of sentences, extracted from online news sources. Each pair was labeled with a tag indicating whether the sentences are paraphrases (semantically equivalent). There are 3,668, 407, and 1,725 pairs in the training, development, and test subsets. As it is a binary classification task with class imbalance, it is evaluated in terms of F1.
|
| 140 |
+
|
| 141 |
+
Quora Question Pairs (QQP) Quora presented a dataset containing over 500,000 sentences with over 400,000 lines of potential duplicate questions. Each line has a binary label indicating whether the line truly contains a duplicate pair. Due to the sampling method, which returns mostly positive pairs, the authors supplemented the dataset with negative pairs composed of “related questions.” As in (Thakur et al., 2020), we sample randomly 10,000 examples for training, and we use the F1 score as the main evaluation measure.
|
| 142 |
+
|
| 143 |
+
Semantic Textual Similarity Benchmark (STSb) The STS benchmark comprises a selection of the English datasets used in the STS tasks organized in the context of SemEval between 2012 and 2017 (Cer et al., 2017). The benchmark comprises 8,628 sentence pairs. The pairs were annotated with similarity scores on a scale from 0 to 5 (5 indicating complete equivalence). There are a total of 5,749, 1,500 and 1,379 pairs in the training, in the development, and in the testing split, respectively. The main metric is Spearman’s rank correlation. As in the Antique dataset, we normalize the scores to the r0, 1s interval and then we binarized them based on a threshold of 0.6.
|
| 144 |
+
|
| 145 |
+
# 5 EXPERIMENTAL SETUP
|
| 146 |
+
|
| 147 |
+
We used BERT-base uncased in all our experiments to be able to perform direct comparison for tasks such as MRPC, QQP and STS to previous work (Reimers & Gurevych, 2019; Thakur et al., 2020).
|
| 148 |
+
|
| 149 |
+
We set the number of warm-up steps to $10 \%$ of the total steps, and we limited the input sequence length to 90 subtokens. We used a batch size of 30 in all tasks, except for Antique and QQP, where we used 50. Note that an order of magnitude larger batch sizes would probably yield better results, but they would also require much more memory. We experimented with learning rates from {5e-6, 1e-5, 2e-5, 3e-5}, and we selected (on dev) 3e-5 for CQA-B and 2e-5 for all other experiments. We used the AdamW optimizer with the bias correction for the CQA tasks, and without bias correction for the rest. We trained the model for five epochs for Antique, CQA-A and STSb, for six epochs for QQP, MRPC and PFCC-S, and for seven epochs for CQA-B, saving a checkpoint after each one, and we selected the best checkpoint on dev. As recommended in (Thakur et al., 2020), due to instability, we did seed optimization, running each approach five times and selecting the best result (on dev).
|
| 150 |
+
|
| 151 |
+
To train with the BSC loss, we used min-max normalization by coordinates with $\tau = 1 . 2$ for PFCCS and QQP, standard L2 normalization with $\tau \ : = \ : 0 . 0 5 5$ for CQA-A, $\tau \ : = \ : 0 . 0 7$ for CQA-B, and $\tau = 0 . 1$ for all other tasks (to find the optimal $\tau$ , we made it trainable for one run). We applied example-based shuffling to train with the BSC loss. We used a group size of four in MRPC, of five in CQA-B, and of eight in all other tasks. We iterated over $\mu$ values from the set $\{ 0 . 1 , 0 . 5 , 0 . 9 \}$ , and we chose $\mu = 0 . 1$ to train the combo approach for CQA-A, MRPC, QQP and STSb tasks, and $\mu = 0 . 9$ for the other experiments.
|
| 152 |
+
|
| 153 |
+
We trained the triplet loss variant from (Reimers & Gurevych, 2019) with margin $= 0 . 6$ for PFCCS, and $\mathtt { m a r g i n } = 0 . 5$ for all other tasks. As we have no answers for the test set in MRPC, and no test sets in Antique and PFCC-S, we split the training set into 9:1 to tune the hyper-parameters. The time for training SBERT with the BSC loss (or combo loss) was almost equal to the time for training with the standard MSE loss. We ran all experiments on a GeForce GTX 1080 GPU.
|
| 154 |
+
|
| 155 |
+
We considered SimCSE (sup-simcse-bert-base-uncased checkpoint) as an unsupervised baseline as it uses the base version of the BSC loss, which we modified. Below, by BSC we will denote using optimal settings in the tables, and variants like BSC - random shuffle would mean that instead of these optimal settings, we applied random shuffling.
|
| 156 |
+
|
| 157 |
+
# 6 RESULTS
|
| 158 |
+
|
| 159 |
+
In this section, we compare the BSC loss to other loss functions: MSE and triplet loss. Additionally, we make an ablation study for the BSC loss modifications we proposed.
|
| 160 |
+
|
| 161 |
+
Antique The results are shown in Table 1. Our best approach of combo-training MSE and BSC losses outperforms all other variants and the approach proposed in (Hashemi et al., 2019), where specific negative sampling and a triplet loss were used. Besides, the best BSC configuration achieves higher scores than MSE. We can see the importance of using predefined hand-crafted negative examples, which brings additional difficult cases and increases MRR by 0.02.
|
| 162 |
+
|
| 163 |
+
Table 1: Results for Antique.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Approach /Metric</td><td>MRR</td><td>P@1</td><td>nDCG@1</td></tr><tr><td>MSE</td><td>0.781</td><td>0.660</td><td>0.769</td></tr><tr><td>BSC</td><td>0.804</td><td>0.680</td><td>0.754</td></tr><tr><td>BSC - positives</td><td>0.784</td><td>0.655</td><td>0.744</td></tr><tr><td>BSC - random shuffle</td><td>0.799</td><td>0.670</td><td>0.754</td></tr><tr><td>Combo BSC +MSE</td><td>0.822</td><td>0.710</td><td>0.773</td></tr><tr><td>SimCSE (unsup.)</td><td>0.681</td><td>0.525</td><td>0.686</td></tr><tr><td>Hashemi et al. (2019)</td><td>0.797</td><td>0.709</td><td>0.713</td></tr></table>
|
| 166 |
+
|
| 167 |
+
CQA-A The results for CQA subtask A are shown in Table 2. A comparison with (Nakov et al., 2017) is not very fair, as we did not use the metadata, e.g., the comment position, which was crucial for the best systems. Besides, we use SBERT, which is inferior to a fine-tuned BERT. Nevertheless, our best approach of combo training with MSE and BSC losses yielded competitive results. We further compared different shuffling strategies. The data is ordered by questions, and keeping this order turns out to be best. That is, the model
|
| 168 |
+
|
| 169 |
+
Table 2: Results for CQA-A and CQA-B.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Approach/Metric</td><td>MAP</td><td>MRR</td><td>MAP</td><td>MRR</td></tr><tr><td>MSE</td><td>0.869</td><td>0.911</td><td>0.471</td><td>0.513</td></tr><tr><td>BSC</td><td>0.801</td><td>0.867</td><td>0.495</td><td>0.534</td></tr><tr><td>BSC - clusters shuffle</td><td>0.787</td><td>0.859</td><td>0.493</td><td>0.534</td></tr><tr><td>BSC - random shuffle</td><td>0.763</td><td>0.828</td><td>0.487</td><td>0.530</td></tr><tr><td>BSC- w/o shufffle</td><td>0.816</td><td>0.884</td><td>0.481</td><td>0.532</td></tr><tr><td>Combo BSC+MSE</td><td>0.872</td><td>0.912</td><td>0.496</td><td>0.540</td></tr><tr><td>Triplet loss</td><td>0.857</td><td>0.917</td><td>0.475</td><td>0.529</td></tr><tr><td>SimCSE (unsup.)</td><td>0.684</td><td>0.735</td><td>0.439</td><td>0.478</td></tr><tr><td>Nakov et al. (2017)</td><td>0.884</td><td>0.928</td><td>0.472</td><td>0.501</td></tr></table>
|
| 172 |
+
|
| 173 |
+
learns to distinguish positive answers for each question from manually selected negative ones and from answers to other questions. Also, note that random shuffling completely eliminates this structure, and MAP drops by $6 \%$ absolute. Fast shuffling by 300 clusters, an advanced version of shuffling by words, improves these results. Example-based shuffling finds a data order similar to the initial one, and the quality does not degrade much.
|
| 174 |
+
|
| 175 |
+
CQA-B The results for CQA-B are shown in Table 2. Again, we did not use the question position, which is a critically important feature for the best systems. We can see that the BSC loss achieved the best score, noticeably outperforming MSE and triplet losses. The experiments also demonstrate the importance of data order when training with the BSC loss. Since the dataset is small, the model overfits when the original data order is fixed.
|
| 176 |
+
|
| 177 |
+
PFCC-S Table 3 shows the results for PFCCS $H P @ k$ stands for HasPositives $@ k$ ). Note that the scores from (Shaar et al., 2020) are for pre-trained SBERT without task-specific fine-tuning. We observed that even when using oversampling to improve the balance of positive examples, MSE performed worse than their results. Here, we used only positives examples to train with BSC, and normalizing by the zero dimension was the best. Overall, the approaches using BSC and triplet losses were comparable. However, the
|
| 178 |
+
|
| 179 |
+
Table 3: Results for PFCC-S.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Approach /Metric</td><td>HP@1</td><td>HP@5</td><td>HP@50</td></tr><tr><td>MSE</td><td>0.362</td><td>0.508</td><td>0.709</td></tr><tr><td>BSC</td><td>0.673</td><td>0.844</td><td>0.899</td></tr><tr><td>BSC - 1-dim norm</td><td>0.588</td><td>0.764</td><td>0.899</td></tr><tr><td>BSC - no norm</td><td>0.608</td><td>0.744</td><td>0.884</td></tr><tr><td>BSC - random shuffle</td><td>0.663</td><td>0.794</td><td>0.915</td></tr><tr><td>Triplet loss</td><td>0.668</td><td>0.794</td><td>0.899</td></tr><tr><td>SimCSE (unsup.)</td><td>0.412</td><td>0.693</td><td>0.849</td></tr><tr><td>Shaar et al. (2020)</td><td>0.402</td><td>0.653</td><td>0.784</td></tr></table>
|
| 182 |
+
|
| 183 |
+
dataset size for training with the BSC loss was much smaller, which is also true for MSE. As a result, the BSC loss is faster, and preferable for this task.
|
| 184 |
+
|
| 185 |
+
MRPC Table 4 shows the results for MRPC. MSE outperformed the BSC loss, but combo achieved a slightly higher F1 score.
|
| 186 |
+
|
| 187 |
+
QQP The results for QQP are presented in Table 4. We also show results for SBERT and augmented SBERT (in parentheses) from (Thakur et al., 2020). There score was obtained by training SBERT with
|
| 188 |
+
|
| 189 |
+
Table 4: Results for MRPC and QQP.
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Approach /Metric</td><td>MRPC (F1)</td><td>QQP (F1)</td></tr><tr><td>MSE</td><td>89.08</td><td>74.29</td></tr><tr><td>BSC</td><td>86.73</td><td>73.13</td></tr><tr><td>Combo BSC +MSE</td><td>89.46</td><td>75.07</td></tr><tr><td> SimCSE (unsup.)</td><td>85.43</td><td>68.65</td></tr><tr><td>Thakur et al. (2020)</td><td>87.89 (88.55)</td><td>74.97 (79.77)</td></tr></table>
|
| 192 |
+
|
| 193 |
+
MSE using another random training sample, but nonetheless, the F1 score is close to ours. The combo approach outperformed separate training with BSC or MSE.
|
| 194 |
+
|
| 195 |
+
STSb Table 5 shows the results for STS. It is the only task where combo with the BSC loss was worse than MSE. This could be due to hard negatives not appearing in the batch in any of the shuffling procedures. Moreover, we observed only marginal improvement when fine-tuning with a BSC model initially trained with MSE. However, if it was pretrained with BSC up to overfitting, fine-tuning it with MSE yielded sizable improvements.
|
| 196 |
+
|
| 197 |
+
Table 5: Results for STSb: Spearman rank correlation.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Approach/Metric</td><td>p×100</td></tr><tr><td>MSE</td><td>84.80</td></tr><tr><td>BSC</td><td>83.26</td></tr><tr><td>Combo BSC +MSE</td><td>84.59</td></tr><tr><td>Fine-tuning MSE with BSC</td><td>84.95</td></tr><tr><td>Fine-tuning BSC with MSE</td><td>85.71</td></tr><tr><td>SimCSE (unsup.)</td><td>84.25</td></tr><tr><td>Reimers & Gurevych (2019)</td><td>84.86</td></tr></table>
|
| 200 |
+
|
| 201 |
+
# 7 DISCUSSION
|
| 202 |
+
|
| 203 |
+
We highlight the following observations:
|
| 204 |
+
|
| 205 |
+
• Combo-training with BSC and MSE losses generally yields the best results (the only exception is STS), and it outperforms the triplet loss with advanced negative sampling.
|
| 206 |
+
• The order in which the data is presented for training can be critical, as we have seen in the cases of CQA-A and CQA-B.
|
| 207 |
+
• The use of labeled negatives examples generally improves the scores by $1 \%$ absolute.
|
| 208 |
+
• Embedding normalization during training is important. Moreover, it is useful to normalize to the zero dimension (e.g., for PFCC-S).
|
| 209 |
+
• Temperature $\tau$ of order 0.1 should be used with the standard normalization, and $\tau$ of order 1-3 for coordinate normalization.
|
| 210 |
+
• An incorrect training setup may hurt the performance by more than $10 \%$ , as was demonstrated for $( i )$ filtering out negative examples for which no positives were given in the dataset (Table 1), $( i i )$ using poorly formed batches (highest effect in Table 2), $( i i i )$ suboptimal normalization (Table 3), and $( i \nu )$ wrong temperature value.
|
| 211 |
+
• The BSC loss is more suitable for ranking tasks, but it can help for other tasks if applied as pre-training or in joint training with the MSE loss.
|
| 212 |
+
|
| 213 |
+
Selecting a loss function is important. For instance, if the model optimizes Pearson correlation, it achieves a score of 85.57 on the STS task. Thus, it outperforms almost all considered approaches. Moreover, the combination of such a loss with BSC allows the model to achieve an F1 score of 89.88 in the MRPC task (a classification task).
|
| 214 |
+
|
| 215 |
+
Finally, we would like to draw a parallel between our work and Augmented SBERT (Thakur et al., 2020). When using the BSC loss, some negatives are implicitly added to the dataset. Augmented SBERT adds new examples too and retrieves them using BM25 or Semantic Search samplings. These methods are comparable to our fast shuffling by words ( $\dot { n }$ -grams) and to example-based shuffling, respectively. Moreover, the task-specific model is used to encode the data in both cases. However, we do not need to label such pairs with another model (cross-encoder) due to the BSC loss definition.
|
| 216 |
+
|
| 217 |
+
# 8 CONCLUSION AND FUTURE WORK
|
| 218 |
+
|
| 219 |
+
We explored the idea of using a batch-softmax contrastive loss for fine-tuning large-scale pre-trained transformers to learn better task-specific sentence embeddings for pairwise sentence scoring tasks. We introduced and studied a number of variations in the calculation of the loss as well as in the overall training procedure. Our experimental results have shown sizable improvements on a number of datasets and pairwise sentence scoring tasks including ranking, classification, and regression.
|
| 220 |
+
|
| 221 |
+
In future work, we want to explore new variations of the loss, and to gain better understanding of when to use which variation. We further plan experiments with a larger set of NLP tasks.
|
| 222 |
+
|
| 223 |
+
# REFERENCES
|
| 224 |
+
|
| 225 |
+
Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeshwar, Sherjil Ozair, Yoshua Bengio, Aaron Courville, and Devon Hjelm. Mutual information neural estimation. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 531–540, Stockholmsmassan, Stock- ¨ holm Sweden, 2018. PMLR.
|
| 226 |
+
|
| 227 |
+
Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), 2017.
|
| 228 |
+
|
| 229 |
+
Ting Chen, Yizhou Sun, Yue Shi, and Liangjie Hong. On sampling strategies for neural networkbased collaborative filtering. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’17, pp. 767–776, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450348874.
|
| 230 |
+
|
| 231 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. 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. 1597–1607. PMLR, 2020.
|
| 232 |
+
|
| 233 |
+
Bill Dolan, Chris Quirk, and Chris Brockett. Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources. In Proceedings of the 20th International Conference on Computational Linguistics, COLING ’04, pp. 350–es, USA, 2004. Association for Computational Linguistics.
|
| 234 |
+
|
| 235 |
+
Hongchao Fang and Pengtao Xie. Cert: Contrastive self-supervised learning for language understanding. CoRR, abs/2005.12766, 2020.
|
| 236 |
+
|
| 237 |
+
Tianyu Gao, Xingcheng Yao, and Danqi Chen. SimCSE: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821, 2021.
|
| 238 |
+
|
| 239 |
+
John M Giorgi, Osvald Nitski, Gary D. Bader, and Bo Wang. Declutr: Deep contrastive learning for unsupervised textual representations. ArXiv, abs/2006.03659, 2020.
|
| 240 |
+
|
| 241 |
+
Beliz Gunel, Jingfei Du, Alexis Conneau, and Ves Stoyanov. Supervised contrastive learning for pre-trained language model fine-tuning. ArXiv, abs/2011.01403, 2020.
|
| 242 |
+
|
| 243 |
+
R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), volume 2, pp. 1735–1742, 2006.
|
| 244 |
+
|
| 245 |
+
Helia Hashemi, Mohammad Aliannejadi, Hamed Zamani, and W. Bruce Croft. ANTIQUE: A nonfactoid question answering benchmark. CoRR, abs/1905.08957, 2019.
|
| 246 |
+
|
| 247 |
+
Matthew Henderson, Rami Al-Rfou, B. Strope, Yun-Hsuan Sung, L. Lukacs, R. Guo, S. Kumar, ´ B. Miklos, and R. Kurzweil. Efficient natural language response suggestion for smart reply. ArXiv, abs/1705.00652, 2017.
|
| 248 |
+
|
| 249 |
+
Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR 2019. ICLR, 2019.
|
| 250 |
+
|
| 251 |
+
J. Johnson, M. Douze, and H. Jegou. Billion-scale similarity search with gpus. ´ IEEE Transactions on Big Data, pp. 1–1, 2019.
|
| 252 |
+
|
| 253 |
+
Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning, 2020.
|
| 254 |
+
|
| 255 |
+
Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. In International Conference on Learning Representations, 2018.
|
| 256 |
+
|
| 257 |
+
Fuli Luo, Pengcheng Yang, S. Li, Xuancheng Ren, and X. Sun. Capt: Contrastive pre-training for learning denoised sequence representations. ArXiv, abs/2010.06351, 2020.
|
| 258 |
+
|
| 259 |
+
Yu Meng, Chenyan Xiong, Payal Bajaj, saurabh tiwary, Paul N. Bennett, Jiawei Han, and Xia Song. COCO-LM: Correcting and contrasting text sequences for language model pretraining. In ThirtyFifth Conference on Neural Information Processing Systems, 2021.
|
| 260 |
+
|
| 261 |
+
Preslav Nakov, Doris Hoogeveen, Llu´ıs Marquez, Alessandro Moschitti, Hamdy Mubarak, Timothy \` Baldwin, and Karin Verspoor. SemEval-2017 task 3: Community question answering. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pp. 27–48, Vancouver, Canada, 2017. Association for Computational Linguistics.
|
| 262 |
+
|
| 263 |
+
A. Oord, Y. Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. ArXiv, abs/1807.03748, 2018.
|
| 264 |
+
|
| 265 |
+
Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence embeddings using Siamese BERTnetworks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLPIJCNLP), pp. 3982–3992, Hong Kong, China, 2019. Association for Computational Linguistics.
|
| 266 |
+
|
| 267 |
+
Shaden Shaar, Nikolay Babulkov, Giovanni Da San Martino, and Preslav Nakov. That is a known lie: Detecting previously fact-checked claims. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 3607–3618, Online, 2020. Association for Computational Linguistics.
|
| 268 |
+
|
| 269 |
+
Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29, pp. 1857–1865. Curran Associates, Inc., 2016.
|
| 270 |
+
|
| 271 |
+
Nandan Thakur, Nils Reimers, Johannes Daxenberger, and Iryna Gurevych. Augmented sbert: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks, 2020.
|
| 272 |
+
|
| 273 |
+
Michael Tschannen, Josip Djolonga, Paul K. Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 274 |
+
|
| 275 |
+
Kilian Q Weinberger, John Blitzer, and Lawrence Saul. Distance metric learning for large margin nearest neighbor classification. In Y. Weiss, B. Scholkopf, and J. Platt (eds.), ¨ Advances in Neural Information Processing Systems, volume 18, pp. 1473–1480. MIT Press, 2006.
|
| 276 |
+
|
| 277 |
+
Zhirong Wu, Yuanjun Xiong, S. Yu, and D. Lin. Unsupervised feature learning via non-parametric instance discrimination. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3733–3742, 2018.
|
| 278 |
+
|
| 279 |
+
Yinfei Yang, Steve Yuan, Daniel Cer, Sheng-yi Kong, Noah Constant, Petr Pilar, Heming Ge, YunHsuan Sung, Brian Strope, and Ray Kurzweil. Learning semantic textual similarity from conversations. In Proceedings of The Third Workshop on Representation Learning for NLP, pp. 164–174, Melbourne, Australia, 2018. Association for Computational Linguistics.
|
parse/dev/6res1KC1Z3Z/6res1KC1Z3Z_content_list.json
ADDED
|
@@ -0,0 +1,1402 @@
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "BATCH-SOFTMAX CONTRASTIVE LOSS FOR PAIRWISE SENTENCE SCORING TASKS ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
174,
|
| 8 |
+
98,
|
| 9 |
+
687,
|
| 10 |
+
146
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Anonymous authors Paper under double-blind review ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
183,
|
| 19 |
+
171,
|
| 20 |
+
398,
|
| 21 |
+
198
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
234,
|
| 32 |
+
544,
|
| 33 |
+
251
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "The use of contrastive loss for representation learning has become prominent in computer vision, and it is now getting attention in Natural Language Processing (NLP). Here, we explore the idea of using a batch-softmax contrastive loss when fine-tuning large-scale pre-trained transformer models to learn better task-specific sentence embeddings for pairwise sentence scoring tasks. We introduce and study a number of variations in the calculation of the loss as well as in the overall training procedure; in particular, we find that data shuffling can be quite important. Our experimental results show sizable improvements on a number of datasets and pairwise sentence scoring tasks including classification, ranking, and regression. Finally, we offer detailed analysis and discussion, which should be useful for researchers aiming to explore the utility of contrastive loss in NLP. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
233,
|
| 42 |
+
270,
|
| 43 |
+
764,
|
| 44 |
+
424
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
462,
|
| 55 |
+
334,
|
| 56 |
+
477
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "Recent years have seen a revolution in Natural Language Processing (NLP) thanks to the advances in machine learning. A lot of attention has been paid to architectures, especially for deep learning, as well as to loss functions. Notably, loss functions based on similar ideas were proposed in unrelated papers in different machine learning fields under different names. This can cause difficulties when solving new problems or when designing new experiments based on previous results. To a greater extent, this applies to “universal” loss functions, which can be applied in different machine learning areas and tasks such as Computer Vision (CV), Recommendation Systems, and NLP. An example of such universal loss function is the batch-softmax contrastive (BSC) loss, which we will discuss below. ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
496,
|
| 66 |
+
825,
|
| 67 |
+
621
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "For many NLP tasks, it is important to obtain representations of sentences for semantic matching problems, since they can be used for further analysis, e.g., for finding the best answer to a question. Sentence BERT is a recent popular approach for this (Reimers & Gurevych, 2019): it can be trained with different loss functions, and we show that the choice of a loss function is important. Moreover, we show that it will not be optimal to take the “standard” batch-softmax contrastive loss, which is used for training SimCSE Gao et al. (2021), a recent alternative to Sentence BERT, and we suggest ways to improve its efficiency. Our contributions can be summarized as follows: ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
628,
|
| 77 |
+
825,
|
| 78 |
+
727
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "• We study the use of a batch-softmax contrastive loss for fine-tuning large-scale transformers to learn better task-specific sentence embeddings for pairwise sentence scoring tasks. \n• We introduce and study a number of novel variations in the calculation of the loss such as symmetrization, incorporating labeled negatives, aligning scores on the similarity matrix diagonal, normalizing over the batch axis, as well as in the overall training procedure, e.g., shuffling, trainable temperature, and sequential pre-training. \n• We demonstrate sizable improvements for a number of pairwise sentence scoring tasks such as classification, ranking, and regression. \n• We offer detailed analysis and discussion, which would be useful for future research. \n• We release our code at http://anonymous ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
214,
|
| 87 |
+
741,
|
| 88 |
+
826,
|
| 89 |
+
924
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "2 RELATED WORK ",
|
| 96 |
+
"text_level": 1,
|
| 97 |
+
"bbox": [
|
| 98 |
+
176,
|
| 99 |
+
102,
|
| 100 |
+
343,
|
| 101 |
+
117
|
| 102 |
+
],
|
| 103 |
+
"page_idx": 1
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"type": "text",
|
| 107 |
+
"text": "The contrastive loss was proposed by Hadsell et al. (2006) as metric learning that contrasts Euclidean distances between embeddings of samples from one class and between samples from different classes. Weinberger et al. (2006) suggested the triplet loss, which is based on a similar idea, but uses triplets (anchor, positive, negative), and aims for the difference between the distances for (anchor, positive) and for (anchor, negative) to be larger than a margin. $N$ -pair loss was presented as a generalization of the contrastive and the triplet losses as a way to solve the problem of extensive construction of hard negative pairs and triplets (Sohn, 2016). ",
|
| 108 |
+
"bbox": [
|
| 109 |
+
174,
|
| 110 |
+
138,
|
| 111 |
+
825,
|
| 112 |
+
236
|
| 113 |
+
],
|
| 114 |
+
"page_idx": 1
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"type": "text",
|
| 118 |
+
"text": "To this end, a batch of $N$ pairs of examples from $N$ different classes is sampled, and the first element in each pair is considered to be an anchor. Thus, for each anchor, there are one positive and $N - 1$ negative pairs. The loss contrasts the distances simultaneously using the softmax function over dotproduct similarities. The approach was used successfully in computer vision (CV) tasks. The same method of Multiple Negative Ranking for training Dot-Product Scoring Models was applied to ranking natural language responses to emails (Henderson et al., 2017), where the loss uses labeled pairs. A similar idea, called Negative Sharing, was used to reduce the computational cost when training recommender systems (Chen et al., 2017). Wu et al. (2018) presented an approach with $N$ -pairs like logic, as a Non-Parametric Softmax Classifier, replacing the weights in the softmax with embeddings of samples from such classes. It was also proposed to use L2 normalization and temperature. Yang et al. (2018) proposed to use Multiple Negative Ranking to train general sentence representations on data from Reddit and SNLI. Logeswaran & Lee (2018) presented a Quick-Thoughts approach to learn sentence embeddings, which constructs batches of contiguous sets of sentences, and for each sentence, contrasts the next sentence in the text and all other candidates. ",
|
| 119 |
+
"bbox": [
|
| 120 |
+
173,
|
| 121 |
+
242,
|
| 122 |
+
825,
|
| 123 |
+
435
|
| 124 |
+
],
|
| 125 |
+
"page_idx": 1
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"type": "text",
|
| 129 |
+
"text": "A lot of subsequent work has focused on maximizing Mutual Information (MI). Oord et al. (2018) presented a loss function based on Noise-Contrastive Estimation, called InfoNCE. It models the “similarity” function that estimates the MI between the target (future) and the context (present) signals, and maximizes the MI between temporally nearby signals. If this “similarity” function expresses the dot-product between embeddings, the InfoNCE loss is equivalent to the $N$ -pair loss up to some constants. It was also shown that InfoNCE is equivalent to the Mutual Information Neural Estimator (MINE) up to a constant (Belghazi et al., 2018), whose minimization maximizes a lower bound on MI. Deep InfoMax (DIM) (Hjelm et al., 2019) improves MINE, and can be modified to incorporate some autoregression as InfoNCE. However, Tschannen et al. (2020) pointed out that the effectiveness of loss functions such as DIM and InfoNCE might be primarily connected not to deep metric learning but rather to MI. ",
|
| 130 |
+
"bbox": [
|
| 131 |
+
174,
|
| 132 |
+
443,
|
| 133 |
+
825,
|
| 134 |
+
597
|
| 135 |
+
],
|
| 136 |
+
"page_idx": 1
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"type": "text",
|
| 140 |
+
"text": "The idea gained a lot of popularity in Computer Vision with the advent of SimCLR (a Simple framework for Contrastive Learning of visual Representations), which introduced NT-Xent (normalized temperature-scaled cross-entropy loss) (Chen et al., 2020). It uses self-supervised learning, where augmentations of the same image are considered as positive examples and augmentations of different images are used as negative examples. Thus, the task is as follows: for each example in a batch, find its paired positive augmentation. Here, the $N$ -pairs loss is modified with a temperature parameter and with an L2 normalization of embeddings to the unit hypersphere. The loss was further extended for supervised learning as SupCon loss (Khosla et al., 2020), which aggregates all positive examples (from the same class) in the softmax numerator. ",
|
| 141 |
+
"bbox": [
|
| 142 |
+
173,
|
| 143 |
+
603,
|
| 144 |
+
825,
|
| 145 |
+
728
|
| 146 |
+
],
|
| 147 |
+
"page_idx": 1
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"type": "text",
|
| 151 |
+
"text": "Subsequently, these losses were introduced to the field of Natural Language Processing (NLP). Gunel et al. (2020) combined the SupCon loss with the cross-entropy loss and obtained state-ofthe-art results for several downstream NLP tasks using RoBERTa. Giorgi et al. (2020), Fang & Xie (2020) and Meng et al. (2021) used NT-Xent to pre-train Transformers, considering spans sampled from the same document, sentences augmented with back-translation as positive examples, and sequences corrupted with MLM. Luo et al. (2020) proposed to use NT-Xent in a self-supervised setting to learn noise-invariant sequence representations, where sentences augmented with masking were considered as positive examples. Finally, Gao et al. (2021) introduced the SimCLR loss to NLP under the name SimCSE (Simple Contrastive Learning of Sentence Embeddings), where sentences processed by a neural network with dropout served as augmentations of the original sentences. Here, we explore various ways to use a similar loss function for pairwise sentence scoring tasks. ",
|
| 152 |
+
"bbox": [
|
| 153 |
+
174,
|
| 154 |
+
736,
|
| 155 |
+
825,
|
| 156 |
+
888
|
| 157 |
+
],
|
| 158 |
+
"page_idx": 1
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"type": "text",
|
| 162 |
+
"text": "While the above-described loss functions have different names, they are all based on similar ideas. Below, we will use the name Batch-Softmax Contrastive (BSC) loss, which we believe reflects the main idea best. In our experiments below, we will use the “modern” variant of the loss: with temperature, normalization, and symmetrization components (described in more detail in Section 3.1). These components were not used for NLP in combination before. We further introduce a number of novel and important modifications in the definition of the loss and in the training procedure, which make it more efficient, and we show that using the resulting loss yields better task-specific sentence embeddings for pairwise sentence scoring tasks. ",
|
| 163 |
+
"bbox": [
|
| 164 |
+
174,
|
| 165 |
+
895,
|
| 166 |
+
823,
|
| 167 |
+
922
|
| 168 |
+
],
|
| 169 |
+
"page_idx": 1
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"type": "image",
|
| 173 |
+
"img_path": "images/f7ec0d9a001c69cc46d1ecec15e86b65718bec48e15bc88d484801621d91f997.jpg",
|
| 174 |
+
"image_caption": [
|
| 175 |
+
"Figure 1: For the set of positives pairs $( q _ { i } , a _ { i } )$ , e.g., question–answer, for each $q _ { i }$ , the BSC loss contrasts the scores between $q _ { i }$ and $a _ { i }$ (positive examples) vs. between $q _ { i }$ and $a _ { j }$ for all $j \\neq i$ (negative examples) using softmax. Here $\\mathbf { \\delta m }$ denotes the dot-product. "
|
| 176 |
+
],
|
| 177 |
+
"image_footnote": [],
|
| 178 |
+
"bbox": [
|
| 179 |
+
284,
|
| 180 |
+
101,
|
| 181 |
+
709,
|
| 182 |
+
239
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 2
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "",
|
| 189 |
+
"bbox": [
|
| 190 |
+
173,
|
| 191 |
+
321,
|
| 192 |
+
825,
|
| 193 |
+
407
|
| 194 |
+
],
|
| 195 |
+
"page_idx": 2
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"type": "text",
|
| 199 |
+
"text": "3 METHOD ",
|
| 200 |
+
"text_level": 1,
|
| 201 |
+
"bbox": [
|
| 202 |
+
174,
|
| 203 |
+
429,
|
| 204 |
+
282,
|
| 205 |
+
445
|
| 206 |
+
],
|
| 207 |
+
"page_idx": 2
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"type": "text",
|
| 211 |
+
"text": "3.1 BATCH-SOFTMAX CONTRASTIVE (BSC) LOSS ",
|
| 212 |
+
"text_level": 1,
|
| 213 |
+
"bbox": [
|
| 214 |
+
176,
|
| 215 |
+
460,
|
| 216 |
+
535,
|
| 217 |
+
477
|
| 218 |
+
],
|
| 219 |
+
"page_idx": 2
|
| 220 |
+
},
|
| 221 |
+
{
|
| 222 |
+
"type": "text",
|
| 223 |
+
"text": "Pointwise approaches for training models for pairwise sentence scoring tasks, such as mean squared error (MSE), are problematic as the loss does not take the relative order into account. For instance, for two pairs with correct target scores (0.4, 0.5), the loss function would equally penalize answers like (0.3, 0.6) and (0.5, 0.4). However, the first pair is better, as it keeps the correct ranking, while the second one does not. This is addressed in pairwise approaches, e.g., in triplet loss, where the model directly learns an ordering. Yet, there is a problem for constructing pairs or triplets in the training set, as it is hard to find non-trivial negatives examples. ",
|
| 224 |
+
"bbox": [
|
| 225 |
+
173,
|
| 226 |
+
488,
|
| 227 |
+
825,
|
| 228 |
+
587
|
| 229 |
+
],
|
| 230 |
+
"page_idx": 2
|
| 231 |
+
},
|
| 232 |
+
{
|
| 233 |
+
"type": "text",
|
| 234 |
+
"text": "Unlike traditional pairwise loss functions, the BSC loss treats all other possible pairs of examples in the batch as “negatives.” That is, only positive pairs are needed for training. Consider a batch $X$ of pairs from a question-answering dataset. In general, let $Q _ { m \\times n }$ and $A _ { m \\times n }$ be the matrices of embeddings produced by a query model and an answer model. We define the loss function as follows: ",
|
| 235 |
+
"bbox": [
|
| 236 |
+
173,
|
| 237 |
+
593,
|
| 238 |
+
825,
|
| 239 |
+
662
|
| 240 |
+
],
|
| 241 |
+
"page_idx": 2
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"type": "equation",
|
| 245 |
+
"img_path": "images/2406903529154c8fe333a44b19e4b437b945a1a38809e16f84fe8dde6d6a4ab3.jpg",
|
| 246 |
+
"text": "$$\n\\begin{array} { r l } & { \\mathcal { L } _ { B S C } ( X ) = \\mathcal { L } _ { 0 } ( X ) + \\mathcal { L } _ { 1 } ( X ) } \\\\ & { = - \\operatorname* { m e a n } \\left( \\log \\left( d i a g \\left( \\operatorname { s o f t m a x } \\left( \\frac { Q A ^ { T } } { \\tau } \\right) \\right) \\right) \\right) - \\operatorname* { m e a n } \\left( \\log \\left( d i a g \\left( \\operatorname { s o f t m a x } \\left( \\frac { A Q ^ { T } } { \\tau } \\right) \\right) \\right) \\right) } \\end{array}\n$$",
|
| 247 |
+
"text_format": "latex",
|
| 248 |
+
"bbox": [
|
| 249 |
+
179,
|
| 250 |
+
672,
|
| 251 |
+
808,
|
| 252 |
+
731
|
| 253 |
+
],
|
| 254 |
+
"page_idx": 2
|
| 255 |
+
},
|
| 256 |
+
{
|
| 257 |
+
"type": "text",
|
| 258 |
+
"text": "Here, softmax is applied by rows (Figure 1), and $\\tau$ is the temperature. Both components can be rewritten, e.g., $\\mathcal { L } _ { 0 } ( X )$ can be written as follows: ",
|
| 259 |
+
"bbox": [
|
| 260 |
+
173,
|
| 261 |
+
760,
|
| 262 |
+
825,
|
| 263 |
+
787
|
| 264 |
+
],
|
| 265 |
+
"page_idx": 2
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"type": "equation",
|
| 269 |
+
"img_path": "images/c6b237ae6d96f3ec0eed480edcb2f58bf051813d871c11bef83159b2072195ea.jpg",
|
| 270 |
+
"text": "$$\n\\mathcal { L } _ { 0 } ( \\boldsymbol { X } ) = - \\frac { 1 } { m \\tau } \\sum _ { i = 1 } ^ { m } q _ { i } ^ { T } a _ { i } + \\frac { 1 } { m } \\sum _ { i = 1 } ^ { m } \\log \\sum _ { j = 1 } ^ { m } \\exp \\left( \\frac { q _ { i } ^ { T } a _ { j } } { \\tau } \\right)\n$$",
|
| 271 |
+
"text_format": "latex",
|
| 272 |
+
"bbox": [
|
| 273 |
+
312,
|
| 274 |
+
796,
|
| 275 |
+
686,
|
| 276 |
+
838
|
| 277 |
+
],
|
| 278 |
+
"page_idx": 2
|
| 279 |
+
},
|
| 280 |
+
{
|
| 281 |
+
"type": "text",
|
| 282 |
+
"text": "Mathematically, this loss function is similar to the one presented in (Chen et al., 2020). The difference is that we do not use augmentations, and we do not compare $q _ { i }$ to $q _ { j }$ (or $a _ { i }$ to $a _ { j }$ ) due to their different nature: we want to compare a question to an answer, not a question to a question or an answer to an answer. Thus, we apply the symmetrization in the formula. So, the difference from SimCSE (Gao et al., 2021) is that we compare not only $q _ { i }$ to all $a _ { j }$ , but also $a _ { i }$ to all $q _ { j }$ in the batch. ",
|
| 283 |
+
"bbox": [
|
| 284 |
+
174,
|
| 285 |
+
853,
|
| 286 |
+
825,
|
| 287 |
+
924
|
| 288 |
+
],
|
| 289 |
+
"page_idx": 2
|
| 290 |
+
},
|
| 291 |
+
{
|
| 292 |
+
"type": "text",
|
| 293 |
+
"text": "Note that, although a frequent short answer may fit multiple questions in a batch, such pairs are considered as “negative” examples in the loss. However, the loss learns Mutual Information (Tschannen et al., 2020), that is $p ( q _ { i } , \\bar { a _ { i } } ) / ( p ( q _ { i } ) p ( a _ { i } ) )$ , and thus it is robust to this false negatives problem. ",
|
| 294 |
+
"bbox": [
|
| 295 |
+
174,
|
| 296 |
+
103,
|
| 297 |
+
823,
|
| 298 |
+
147
|
| 299 |
+
],
|
| 300 |
+
"page_idx": 3
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"type": "text",
|
| 304 |
+
"text": "Early research has already shown the importance of properly configuring and using some BSC loss settings. For example, low temperatures are equivalent to optimizing for hard positives/negatives (Khosla et al., 2020), while L2 normalization of vectors to the unit hypersphere along with temperature effectively weighs different examples (Chen et al., 2020). We further propose a number of important modifications that can have a major impact on the performance for a number of tasks. ",
|
| 305 |
+
"bbox": [
|
| 306 |
+
174,
|
| 307 |
+
152,
|
| 308 |
+
825,
|
| 309 |
+
223
|
| 310 |
+
],
|
| 311 |
+
"page_idx": 3
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"type": "text",
|
| 315 |
+
"text": "3.2 BATCH CONSTRUCTION ",
|
| 316 |
+
"text_level": 1,
|
| 317 |
+
"bbox": [
|
| 318 |
+
174,
|
| 319 |
+
238,
|
| 320 |
+
380,
|
| 321 |
+
253
|
| 322 |
+
],
|
| 323 |
+
"page_idx": 3
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"type": "text",
|
| 327 |
+
"text": "In computer vision, it is common to use a batch size of 5,000, which in turn would naturally be very likely to contain some hard negative examples. In NLP, fine-tuning Transformer-based models with large batch sizes requires very large amounts of memory. Thus, much smaller batches are used in practice, and as a result, it becomes important to make sure these batches do contain some hard negative examples. We achieve this by fixing the content of the batches at each epoch of the training process. Note that this is much simpler than mining hard negatives, as we only need to increase the likelihood that there would be a hard negative example present in the batch, but we do not need to know which particular example in the batch would be hard. Inside the batch, this would be controlled by the temperature parameter. ",
|
| 328 |
+
"bbox": [
|
| 329 |
+
173,
|
| 330 |
+
265,
|
| 331 |
+
825,
|
| 332 |
+
390
|
| 333 |
+
],
|
| 334 |
+
"page_idx": 3
|
| 335 |
+
},
|
| 336 |
+
{
|
| 337 |
+
"type": "text",
|
| 338 |
+
"text": "Example-based shuffling The key idea of this method is to batch several groups, so that within each group all pairs are similar based on their first or based on their second elements. In this way, each positive pair would be accompanied by hard negatives from the same group and by simpler negatives from the remaining examples inside the batch (which come from other groups). We use the $k$ -nearest neighbors for an input example to form a group for it, and Faiss (Johnson et al., 2019) to quickly find these nearest neighbors in the embedding space. Let the pairs be grouped by their first elements $q _ { i }$ . Algorithm 1 summarizes the proposed method. ",
|
| 339 |
+
"bbox": [
|
| 340 |
+
173,
|
| 341 |
+
397,
|
| 342 |
+
825,
|
| 343 |
+
494
|
| 344 |
+
],
|
| 345 |
+
"page_idx": 3
|
| 346 |
+
},
|
| 347 |
+
{
|
| 348 |
+
"type": "text",
|
| 349 |
+
"text": "Note that we use two stages in kNN to limit the range of possible candidates and thus to reduce the computational costs (both in terms of time and memory). We first extract the top$n$ neighbors (for some large $n$ , e.g., 500), and then we take the top- $k$ from them, so that no duplicates appear in the final sequence (for some small $k = 7$ ). The time complexity of such a check is ${ \\mathrm { O } } ( 1 )$ . If all such neighbors are already used, then only the considered example will be added to the resulting sequence. This case will often arise for the last examples, and thus batches will consist of simple 1-element groups. Therefore, we reverse the ",
|
| 350 |
+
"bbox": [
|
| 351 |
+
174,
|
| 352 |
+
502,
|
| 353 |
+
470,
|
| 354 |
+
695
|
| 355 |
+
],
|
| 356 |
+
"page_idx": 3
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"type": "text",
|
| 360 |
+
"text": "Algorithm 1 Example-based shuffling ",
|
| 361 |
+
"text_level": 1,
|
| 362 |
+
"bbox": [
|
| 363 |
+
486,
|
| 364 |
+
511,
|
| 365 |
+
736,
|
| 366 |
+
525
|
| 367 |
+
],
|
| 368 |
+
"page_idx": 3
|
| 369 |
+
},
|
| 370 |
+
{
|
| 371 |
+
"type": "text",
|
| 372 |
+
"text": "Input: sequence $D$ , group size s \ninitialize $\\bar { R } \\bigcup \\ \\mathsf { \\Gamma } \\triangleright \\bar { \\mathsf { \\Gamma } }$ sequence to store the result \ninitialize $U \\gets \\emptyset$ $\\vartriangleright$ set of used examples \nrandomly shuffle $D$ \nfor $\\ominus$ in $D$ do if $\\ominus \\notin U$ then find the $n$ nearest neighbors of $\\ominus$ from $D$ choose the top $s - 1$ that are not in $U$ add them and $\\ominus$ to $R$ and also to $U$ \nreturn reversed $R$ ",
|
| 373 |
+
"bbox": [
|
| 374 |
+
483,
|
| 375 |
+
526,
|
| 376 |
+
823,
|
| 377 |
+
669
|
| 378 |
+
],
|
| 379 |
+
"page_idx": 3
|
| 380 |
+
},
|
| 381 |
+
{
|
| 382 |
+
"type": "text",
|
| 383 |
+
"text": "sequence to start with these simple batches, as in curriculum learning. ",
|
| 384 |
+
"bbox": [
|
| 385 |
+
176,
|
| 386 |
+
695,
|
| 387 |
+
630,
|
| 388 |
+
710
|
| 389 |
+
],
|
| 390 |
+
"page_idx": 3
|
| 391 |
+
},
|
| 392 |
+
{
|
| 393 |
+
"type": "text",
|
| 394 |
+
"text": "By default, we assume that there should be one positive example for each question/answer (on the diagonal of the matrix), and thus identical neighbors could be optionally filtered. Still, if there are the same $q _ { i }$ in the batch $X$ , the loss definition (eq. 1) does not change. Indeed, let $P _ { q } = \\{ i | q _ { i } =$ $q , ( q _ { i } , a _ { i } ) \\in X \\}$ , then $\\forall i , j \\in P _ { q } : ( q _ { i } , a _ { j } )$ form a positive pair. According to Khosla et al. (2020), for each $q$ , all $\\tilde { q } \\in \\mathcal { P } _ { q }$ should be placed in the softmax numerator and then averaging over all such $\\tilde { q }$ should be performed outside the logarithm. Thus, in $\\mathcal { L } _ { 0 } ( X )$ (eq. 2) only the first sum would change: ",
|
| 395 |
+
"bbox": [
|
| 396 |
+
173,
|
| 397 |
+
717,
|
| 398 |
+
825,
|
| 399 |
+
801
|
| 400 |
+
],
|
| 401 |
+
"page_idx": 3
|
| 402 |
+
},
|
| 403 |
+
{
|
| 404 |
+
"type": "equation",
|
| 405 |
+
"img_path": "images/00acc89619573a36a7105f9e403b0bf3585d59d0a8522ffaa1f3db9ab8d6d4fd.jpg",
|
| 406 |
+
"text": "$$\n\\sum _ { i \\in P _ { q } } q _ { i } ^ { T } a _ { i } \\{ \\substack { \\ r { \\ r { \\sigma } } \\ r { \\ r { \\sigma } } \\ r { } \\sum _ { i \\in P _ { q } } \\frac { 1 } { \\vert P _ { q } \\vert } } \\sum _ { j \\in P _ { q } } q _ { i } ^ { T } a _ { j } = \\sum _ { j \\in P _ { q } } \\frac { 1 } { \\vert P _ { q } \\vert } \\sum _ { i \\in P _ { q } } q ^ { T } a _ { j } = \\sum _ { j \\in P _ { q } } q _ { j } ^ { T } a _ { j }\n$$",
|
| 407 |
+
"text_format": "latex",
|
| 408 |
+
"bbox": [
|
| 409 |
+
269,
|
| 410 |
+
804,
|
| 411 |
+
730,
|
| 412 |
+
844
|
| 413 |
+
],
|
| 414 |
+
"page_idx": 3
|
| 415 |
+
},
|
| 416 |
+
{
|
| 417 |
+
"type": "equation",
|
| 418 |
+
"img_path": "images/c559b959816f0ba8026f23058cd64381166410344024f280d98b258cb4eb6cfd.jpg",
|
| 419 |
+
"text": "$$\n\\begin{array} { l } { { \\mathrm { I n } \\not \\mathcal { L } _ { 1 } ( X ) : \\sum _ { i \\in P _ { q } } q _ { i } ^ { T } a _ { i } \\ \\mathrm { \\dots } \\ \\sum _ { i \\in P _ { q } } \\displaystyle \\frac { 1 } { | P _ { q } | } \\sum _ { j \\in P _ { q } } q _ { j } ^ { T } a _ { i } = \\sum _ { i \\in P _ { q } } \\displaystyle \\frac { 1 } { | P _ { q } | } \\sum _ { j \\in P _ { q } } q ^ { T } a _ { i } = \\sum _ { i \\in P _ { q } } q _ { i } ^ { T } a _ { i } } } \\end{array}\n$$",
|
| 420 |
+
"text_format": "latex",
|
| 421 |
+
"bbox": [
|
| 422 |
+
178,
|
| 423 |
+
853,
|
| 424 |
+
794,
|
| 425 |
+
888
|
| 426 |
+
],
|
| 427 |
+
"page_idx": 3
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"type": "text",
|
| 431 |
+
"text": "To select the groups even better, we consider task-specific embeddings. To this end, we apply the current model to encode all pairs at each epoch. ",
|
| 432 |
+
"bbox": [
|
| 433 |
+
171,
|
| 434 |
+
892,
|
| 435 |
+
825,
|
| 436 |
+
921
|
| 437 |
+
],
|
| 438 |
+
"page_idx": 3
|
| 439 |
+
},
|
| 440 |
+
{
|
| 441 |
+
"type": "text",
|
| 442 |
+
"text": "Fast shuffling For extremely large datasets, example-based shuffling is time-consuming even with Faiss; thus, we propose several effective options to perform a less-thorough shuffling. We choose some attribute by which we will group the examples, that is, we guarantee some closeness of the examples. Thus, the examples are close if they share the same words, the same cluster number or the same nearest neighbors. First, consider the case of words and grouping by the first elements of the pairs (the case of the second elements is the same). Algorithm 2 presents the shuffling process. To produce a shuffle by clusters, we apply the same algorithm, where each sentence is replaced by its cluster number. Thus, each shingle has size $t = 1$ . In order to make a shuffle by nearest neighbors, we create shingles by “sentences,” where the words are the positions of the top- $k$ nearest neighbors in the input sequence (for some small $k$ ). All of these approaches, as well as $k$ -means clustering, can be effectively implemented using MapReduce and parallel computations. ",
|
| 443 |
+
"bbox": [
|
| 444 |
+
174,
|
| 445 |
+
103,
|
| 446 |
+
470,
|
| 447 |
+
435
|
| 448 |
+
],
|
| 449 |
+
"page_idx": 4
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"type": "text",
|
| 453 |
+
"text": "Algorithm 2 Shuffling by words Input: sequence $D$ , group size $k$ , shingle size t for $\\ominus$ in $D$ do $\\ominus$ .shing $\\beth $ random subset of $t$ words of $\\ominus$ (ignoring stop-words) sort $D$ by $\\ominus$ .shingle initialize $\\Im \\ I \\mathrm { D }$ random uint64 $\\vartriangleright$ group ID initialize $s \\gets 0$ $\\vartriangleright$ current group size initialize $_ { \\mathrm { p } x \\in \\mathrm { V } } $ first element of $D$ for $\\ominus$ in $D$ do if e.shing $\\mathtt { \\cdot 1 } \\mathtt { e } \\neq \\mathtt { p } \\mathtt { r } \\mathtt { e } \\mathtt { v }$ .shingle then $\\Im \\ I \\mathrm { D }$ random uint64 if ${ \\bf s } \\geqslant { \\bf k }$ then $\\Im \\ I \\mathrm { D }$ random uint64 s Ð 0 e.gID Ð gID s Ð s \\` 1 prev Ð e sort $D$ by e.gID return D ",
|
| 454 |
+
"bbox": [
|
| 455 |
+
485,
|
| 456 |
+
114,
|
| 457 |
+
825,
|
| 458 |
+
406
|
| 459 |
+
],
|
| 460 |
+
"page_idx": 4
|
| 461 |
+
},
|
| 462 |
+
{
|
| 463 |
+
"type": "text",
|
| 464 |
+
"text": "3.3 LABELED NEGATIVES ",
|
| 465 |
+
"text_level": 1,
|
| 466 |
+
"bbox": [
|
| 467 |
+
176,
|
| 468 |
+
453,
|
| 469 |
+
367,
|
| 470 |
+
467
|
| 471 |
+
],
|
| 472 |
+
"page_idx": 4
|
| 473 |
+
},
|
| 474 |
+
{
|
| 475 |
+
"type": "text",
|
| 476 |
+
"text": "Usually, when the data size is small, hard negative examples may be hard to obtain even with data shuffling, e.g., when all examples are semantically distant. Nonetheless, if the dataset contains a labeled negative pair with some anchor, then its elements are semantically close by traditional rules of dataset construction. Thus, using such a pair inside the batch, where this anchor is present, will add the necessary hard negative example. ",
|
| 477 |
+
"bbox": [
|
| 478 |
+
174,
|
| 479 |
+
478,
|
| 480 |
+
825,
|
| 481 |
+
549
|
| 482 |
+
],
|
| 483 |
+
"page_idx": 4
|
| 484 |
+
},
|
| 485 |
+
{
|
| 486 |
+
"type": "text",
|
| 487 |
+
"text": "The only change that is added in the loss function is the masking of negative examples—we have no guarantees that the selected negative example is closer to the anchor than the rest of the examples inside the batch. Let $y _ { i }$ be a binary label, where $y _ { i } = 1$ if the $i$ -th pair is positive. Then, we have ",
|
| 488 |
+
"bbox": [
|
| 489 |
+
174,
|
| 490 |
+
555,
|
| 491 |
+
825,
|
| 492 |
+
598
|
| 493 |
+
],
|
| 494 |
+
"page_idx": 4
|
| 495 |
+
},
|
| 496 |
+
{
|
| 497 |
+
"type": "equation",
|
| 498 |
+
"img_path": "images/91d0521d1c00997e925597fe7a48254fab16f44f7cddbd8beb8942943d843b74.jpg",
|
| 499 |
+
"text": "$$\n\\mathcal { L } _ { 0 } ( \\boldsymbol { X } ) = - \\frac { 1 } { m \\tau } \\sum _ { i = 1 } ^ { m } \\mathbb { 1 } [ y _ { i } = 1 ] q _ { i } ^ { T } a _ { i } + \\frac { 1 } { m } \\sum _ { i = 1 } ^ { m } \\mathbb { 1 } [ y _ { i } = 1 ] \\log \\sum _ { j = 1 } ^ { m } \\exp \\left( \\frac { q _ { i } ^ { T } a _ { j } } { \\tau } \\right)\n$$",
|
| 500 |
+
"text_format": "latex",
|
| 501 |
+
"bbox": [
|
| 502 |
+
246,
|
| 503 |
+
603,
|
| 504 |
+
751,
|
| 505 |
+
643
|
| 506 |
+
],
|
| 507 |
+
"page_idx": 4
|
| 508 |
+
},
|
| 509 |
+
{
|
| 510 |
+
"type": "text",
|
| 511 |
+
"text": "3.4 COMBO LOSS",
|
| 512 |
+
"text_level": 1,
|
| 513 |
+
"bbox": [
|
| 514 |
+
174,
|
| 515 |
+
659,
|
| 516 |
+
310,
|
| 517 |
+
672
|
| 518 |
+
],
|
| 519 |
+
"page_idx": 4
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"type": "text",
|
| 523 |
+
"text": "Theoretically, it is beneficial to use several loss functions for training if they are calculated on the same batch (and thus do not require additional computations). That is, joint training of BSC and MSE losses combines the advantages of pointwise and of pairwise approaches, thus ensuring that for positives examples, the values on the diagonal of the dot-product matrix are not only greater e also close to 1 or to some for target positive similarities get similarity. Note that here , and thus we do not force all ot $L _ { M S E } ( X ) \\ =$ $\\begin{array} { r } { \\frac { 1 } { m } \\sum _ { i } ^ { m } ( ( q _ { i } ^ { T } a _ { i } ) - y _ { i } ) ^ { 2 } } \\end{array}$ $y _ { i }$ to zero. At the same time, the BSC loss adds new examples (“negative” pairs) to the training set. ",
|
| 524 |
+
"bbox": [
|
| 525 |
+
173,
|
| 526 |
+
684,
|
| 527 |
+
825,
|
| 528 |
+
784
|
| 529 |
+
],
|
| 530 |
+
"page_idx": 4
|
| 531 |
+
},
|
| 532 |
+
{
|
| 533 |
+
"type": "text",
|
| 534 |
+
"text": "In order to use the BSC loss when training a model in tasks with non-binary labels, we modify the indicator function in the equation 5, as $\\mathbb { I } [ y _ { i } > t ]$ , where $t$ is a configurable binarization threshold. Then, we use their convex combination with the configurable hyperparameter $\\mu \\in ( 0 , 1 )$ : ",
|
| 535 |
+
"bbox": [
|
| 536 |
+
174,
|
| 537 |
+
789,
|
| 538 |
+
825,
|
| 539 |
+
832
|
| 540 |
+
],
|
| 541 |
+
"page_idx": 4
|
| 542 |
+
},
|
| 543 |
+
{
|
| 544 |
+
"type": "equation",
|
| 545 |
+
"img_path": "images/8816bfedc231c2a54b48bba1e70a69d95b4425ae883982cb2cfbe8afccc8d954.jpg",
|
| 546 |
+
"text": "$$\nL ( X ) = \\mu L _ { B S C } ( X ) + ( 1 - \\mu ) L _ { M S E } ( X )\n$$",
|
| 547 |
+
"text_format": "latex",
|
| 548 |
+
"bbox": [
|
| 549 |
+
356,
|
| 550 |
+
837,
|
| 551 |
+
642,
|
| 552 |
+
854
|
| 553 |
+
],
|
| 554 |
+
"page_idx": 4
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"type": "text",
|
| 558 |
+
"text": "3.5 NORMALIZATION ",
|
| 559 |
+
"text_level": 1,
|
| 560 |
+
"bbox": [
|
| 561 |
+
174,
|
| 562 |
+
869,
|
| 563 |
+
334,
|
| 564 |
+
883
|
| 565 |
+
],
|
| 566 |
+
"page_idx": 4
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "text",
|
| 570 |
+
"text": "L2 normalization of matrices $A$ and $B$ means that $a _ { i } ^ { T } b _ { j }$ will be equivalent to cosine similarity. The embeddings can also be normalized by the batch dimension (by coordinates), which can bring ",
|
| 571 |
+
"bbox": [
|
| 572 |
+
173,
|
| 573 |
+
895,
|
| 574 |
+
825,
|
| 575 |
+
924
|
| 576 |
+
],
|
| 577 |
+
"page_idx": 4
|
| 578 |
+
},
|
| 579 |
+
{
|
| 580 |
+
"type": "text",
|
| 581 |
+
"text": "additional regularization. In our experiments, we confirm the importance of this, e.g., new representations can be calculated with L2 normalization by coordinates or in a min-max scale. ",
|
| 582 |
+
"bbox": [
|
| 583 |
+
171,
|
| 584 |
+
103,
|
| 585 |
+
821,
|
| 586 |
+
132
|
| 587 |
+
],
|
| 588 |
+
"page_idx": 5
|
| 589 |
+
},
|
| 590 |
+
{
|
| 591 |
+
"type": "text",
|
| 592 |
+
"text": "4 DATASETS ",
|
| 593 |
+
"text_level": 1,
|
| 594 |
+
"bbox": [
|
| 595 |
+
174,
|
| 596 |
+
154,
|
| 597 |
+
292,
|
| 598 |
+
170
|
| 599 |
+
],
|
| 600 |
+
"page_idx": 5
|
| 601 |
+
},
|
| 602 |
+
{
|
| 603 |
+
"type": "text",
|
| 604 |
+
"text": "NLP tasks that compare pairs of sentences can be divided into regression (predicting a similarity score), classification (e.g., similar vs. dissimilar), and ranking (search for the best matches). They differ only by the quality assessment functions, and thus they all can benefit from the above losses. ",
|
| 605 |
+
"bbox": [
|
| 606 |
+
174,
|
| 607 |
+
185,
|
| 608 |
+
823,
|
| 609 |
+
228
|
| 610 |
+
],
|
| 611 |
+
"page_idx": 5
|
| 612 |
+
},
|
| 613 |
+
{
|
| 614 |
+
"type": "text",
|
| 615 |
+
"text": "Note that it is important to calculate sentence representations in ranking tasks, as when independently calculating the embeddings of the individual elements in the pairs, the inference time of the model becomes linear instead of quadratic. Therefore, we use Sentence-BERT (SBERT), which is trained as a Siamese BERT model, and offers a way to obtain state-of-the-art sentence embeddings, which have been proven useful for a number of tasks (Reimers & Gurevych, 2019; Thakur et al., 2020). At inference time, we first use SBERT to obtain independently a representation for each sentence in the pair, and then we calculate the cosine similarities between these embeddings. ",
|
| 616 |
+
"bbox": [
|
| 617 |
+
174,
|
| 618 |
+
234,
|
| 619 |
+
825,
|
| 620 |
+
332
|
| 621 |
+
],
|
| 622 |
+
"page_idx": 5
|
| 623 |
+
},
|
| 624 |
+
{
|
| 625 |
+
"type": "text",
|
| 626 |
+
"text": "We use the following English datasets and tasks for the evaluation. Four ranking tasks (ranking answers to non-factoid questions, ranking questions by their similarity with respect to other questions, ranking comments by their similarity to a given question, ranking fact-checked claims by their relevance with respect to an input claim), two binary classification tasks (paraphrases identification, and duplicate question identification), and one regression task (semantic sentence similarity). ",
|
| 627 |
+
"bbox": [
|
| 628 |
+
174,
|
| 629 |
+
339,
|
| 630 |
+
823,
|
| 631 |
+
410
|
| 632 |
+
],
|
| 633 |
+
"page_idx": 5
|
| 634 |
+
},
|
| 635 |
+
{
|
| 636 |
+
"type": "text",
|
| 637 |
+
"text": "Antique The dataset contains 2,626 non-factoid questions with answer choices (Hashemi et al., 2019), asked by users on Yahoo! Answers. There are a total of 34,011 question–answer pairs: 27,422 for training and 6,589 for validation. Each answer is annotated with a relevance score with respect to the question on a scale from 1 to 4, and the task is to rank the answers by their relevance. To model relevance as a cosine similarity, we normalize the scores to the r0, 1s interval. We use Mean Reciprocal Rank (MRR) as the main evaluation measure. ",
|
| 638 |
+
"bbox": [
|
| 639 |
+
173,
|
| 640 |
+
416,
|
| 641 |
+
825,
|
| 642 |
+
500
|
| 643 |
+
],
|
| 644 |
+
"page_idx": 5
|
| 645 |
+
},
|
| 646 |
+
{
|
| 647 |
+
"type": "text",
|
| 648 |
+
"text": "CQA-A This dataset was used in SemEval-2017 Task 3 on Community Question Answering subtask A (Nakov et al., 2017). The goal is to rank the first ten answers in a question thread on Qatar Living, so that good answers are ranked higher than bad ones. We used the clean part of the dataset, which consists of 14,110 and 2,440 labeled question–comments pairs for training and development, respectively. The evaluation measure is Mean Average Precision (MAP). This dataset contains important metadata, e.g., the date and time of the comment, and sorting the comments by time yields a strong baseline; yet, we only use the text. To train the model with the triplet loss, we group the pairs by the first element (anchor). ",
|
| 649 |
+
"bbox": [
|
| 650 |
+
174,
|
| 651 |
+
506,
|
| 652 |
+
825,
|
| 653 |
+
617
|
| 654 |
+
],
|
| 655 |
+
"page_idx": 5
|
| 656 |
+
},
|
| 657 |
+
{
|
| 658 |
+
"type": "text",
|
| 659 |
+
"text": "CQA-B This dataset was developed for SemEval-2017 Task 3, subtask B (Nakov et al., 2017), whose goal was to rank 10 potentially related questions by their similarity with respect to an input question. These questions are retrieved from the Qatar Living forum using Google and the input question as a query. We use the clean part of the dataset, which consists of 19,990 training and 5,500 development labeled question-question pairs. The main evaluation measure here is MAP. There is additional information, e.g., the rank of the retrieved question in the Google search results, which we do not use. ",
|
| 660 |
+
"bbox": [
|
| 661 |
+
174,
|
| 662 |
+
625,
|
| 663 |
+
825,
|
| 664 |
+
722
|
| 665 |
+
],
|
| 666 |
+
"page_idx": 5
|
| 667 |
+
},
|
| 668 |
+
{
|
| 669 |
+
"type": "text",
|
| 670 |
+
"text": "PFCC-S Shaar et al. (2020) presented a dataset for detecting Previously Fact-Checked Claims on Snopes (PFCC-S), aimed at facilitating the solution of a fact-checking problem: given an input claim, it asks to rank claims that have been previously fact-checked, so that claims that can help verify the input claim are ranked as high as possible. The dataset has 800 positive input–verified claim pairs for training and 200 such positive pairs for testing, and they are to be matched against a database of 10,369 verified claims. The evaluation is performed in terms of a HasPositive $@ \\mathbf { k }$ metric, which checks whether there is a positive match among the first $k$ results in the ranked list. In order to train models using MSE or triplet loss, we sampled negatives according to the following scheme. First, we encoded all sentences using SBERT, pretrained on STS and NLI. Then, we selected the first element in each positive pair as an anchor and we sorted all other examples by their similarity to this anchor. The assumption is that positive examples will be concentrated in the beginning. Thus, we selected negatives starting from 101 on, logarithmically: on positions $1 0 0 + 2 ^ { k } , \\breve { k } \\in \\mathbb { N }$ . As a result, we obtain many hard negative examples and a small number of easy ones. Finally, we oversampled the positive pairs to correct the balance of positive and negative examples. ",
|
| 671 |
+
"bbox": [
|
| 672 |
+
174,
|
| 673 |
+
729,
|
| 674 |
+
825,
|
| 675 |
+
924
|
| 676 |
+
],
|
| 677 |
+
"page_idx": 5
|
| 678 |
+
},
|
| 679 |
+
{
|
| 680 |
+
"type": "text",
|
| 681 |
+
"text": "Microsoft Research Paraphrase Corpus (MRPC) Dolan et al. (2004) contains 5,800 pairs of sentences, extracted from online news sources. Each pair was labeled with a tag indicating whether the sentences are paraphrases (semantically equivalent). There are 3,668, 407, and 1,725 pairs in the training, development, and test subsets. As it is a binary classification task with class imbalance, it is evaluated in terms of F1. ",
|
| 682 |
+
"bbox": [
|
| 683 |
+
174,
|
| 684 |
+
103,
|
| 685 |
+
825,
|
| 686 |
+
172
|
| 687 |
+
],
|
| 688 |
+
"page_idx": 6
|
| 689 |
+
},
|
| 690 |
+
{
|
| 691 |
+
"type": "text",
|
| 692 |
+
"text": "Quora Question Pairs (QQP) Quora presented a dataset containing over 500,000 sentences with over 400,000 lines of potential duplicate questions. Each line has a binary label indicating whether the line truly contains a duplicate pair. Due to the sampling method, which returns mostly positive pairs, the authors supplemented the dataset with negative pairs composed of “related questions.” As in (Thakur et al., 2020), we sample randomly 10,000 examples for training, and we use the F1 score as the main evaluation measure. ",
|
| 693 |
+
"bbox": [
|
| 694 |
+
174,
|
| 695 |
+
180,
|
| 696 |
+
825,
|
| 697 |
+
263
|
| 698 |
+
],
|
| 699 |
+
"page_idx": 6
|
| 700 |
+
},
|
| 701 |
+
{
|
| 702 |
+
"type": "text",
|
| 703 |
+
"text": "Semantic Textual Similarity Benchmark (STSb) The STS benchmark comprises a selection of the English datasets used in the STS tasks organized in the context of SemEval between 2012 and 2017 (Cer et al., 2017). The benchmark comprises 8,628 sentence pairs. The pairs were annotated with similarity scores on a scale from 0 to 5 (5 indicating complete equivalence). There are a total of 5,749, 1,500 and 1,379 pairs in the training, in the development, and in the testing split, respectively. The main metric is Spearman’s rank correlation. As in the Antique dataset, we normalize the scores to the r0, 1s interval and then we binarized them based on a threshold of 0.6. ",
|
| 704 |
+
"bbox": [
|
| 705 |
+
174,
|
| 706 |
+
270,
|
| 707 |
+
825,
|
| 708 |
+
368
|
| 709 |
+
],
|
| 710 |
+
"page_idx": 6
|
| 711 |
+
},
|
| 712 |
+
{
|
| 713 |
+
"type": "text",
|
| 714 |
+
"text": "5 EXPERIMENTAL SETUP ",
|
| 715 |
+
"text_level": 1,
|
| 716 |
+
"bbox": [
|
| 717 |
+
176,
|
| 718 |
+
390,
|
| 719 |
+
398,
|
| 720 |
+
406
|
| 721 |
+
],
|
| 722 |
+
"page_idx": 6
|
| 723 |
+
},
|
| 724 |
+
{
|
| 725 |
+
"type": "text",
|
| 726 |
+
"text": "We used BERT-base uncased in all our experiments to be able to perform direct comparison for tasks such as MRPC, QQP and STS to previous work (Reimers & Gurevych, 2019; Thakur et al., 2020). ",
|
| 727 |
+
"bbox": [
|
| 728 |
+
176,
|
| 729 |
+
421,
|
| 730 |
+
823,
|
| 731 |
+
449
|
| 732 |
+
],
|
| 733 |
+
"page_idx": 6
|
| 734 |
+
},
|
| 735 |
+
{
|
| 736 |
+
"type": "text",
|
| 737 |
+
"text": "We set the number of warm-up steps to $10 \\%$ of the total steps, and we limited the input sequence length to 90 subtokens. We used a batch size of 30 in all tasks, except for Antique and QQP, where we used 50. Note that an order of magnitude larger batch sizes would probably yield better results, but they would also require much more memory. We experimented with learning rates from {5e-6, 1e-5, 2e-5, 3e-5}, and we selected (on dev) 3e-5 for CQA-B and 2e-5 for all other experiments. We used the AdamW optimizer with the bias correction for the CQA tasks, and without bias correction for the rest. We trained the model for five epochs for Antique, CQA-A and STSb, for six epochs for QQP, MRPC and PFCC-S, and for seven epochs for CQA-B, saving a checkpoint after each one, and we selected the best checkpoint on dev. As recommended in (Thakur et al., 2020), due to instability, we did seed optimization, running each approach five times and selecting the best result (on dev). ",
|
| 738 |
+
"bbox": [
|
| 739 |
+
174,
|
| 740 |
+
457,
|
| 741 |
+
825,
|
| 742 |
+
595
|
| 743 |
+
],
|
| 744 |
+
"page_idx": 6
|
| 745 |
+
},
|
| 746 |
+
{
|
| 747 |
+
"type": "text",
|
| 748 |
+
"text": "To train with the BSC loss, we used min-max normalization by coordinates with $\\tau = 1 . 2$ for PFCCS and QQP, standard L2 normalization with $\\tau \\ : = \\ : 0 . 0 5 5$ for CQA-A, $\\tau \\ : = \\ : 0 . 0 7$ for CQA-B, and $\\tau = 0 . 1$ for all other tasks (to find the optimal $\\tau$ , we made it trainable for one run). We applied example-based shuffling to train with the BSC loss. We used a group size of four in MRPC, of five in CQA-B, and of eight in all other tasks. We iterated over $\\mu$ values from the set $\\{ 0 . 1 , 0 . 5 , 0 . 9 \\}$ , and we chose $\\mu = 0 . 1$ to train the combo approach for CQA-A, MRPC, QQP and STSb tasks, and $\\mu = 0 . 9$ for the other experiments. ",
|
| 749 |
+
"bbox": [
|
| 750 |
+
173,
|
| 751 |
+
602,
|
| 752 |
+
825,
|
| 753 |
+
700
|
| 754 |
+
],
|
| 755 |
+
"page_idx": 6
|
| 756 |
+
},
|
| 757 |
+
{
|
| 758 |
+
"type": "text",
|
| 759 |
+
"text": "We trained the triplet loss variant from (Reimers & Gurevych, 2019) with margin $= 0 . 6$ for PFCCS, and $\\mathtt { m a r g i n } = 0 . 5$ for all other tasks. As we have no answers for the test set in MRPC, and no test sets in Antique and PFCC-S, we split the training set into 9:1 to tune the hyper-parameters. The time for training SBERT with the BSC loss (or combo loss) was almost equal to the time for training with the standard MSE loss. We ran all experiments on a GeForce GTX 1080 GPU. ",
|
| 760 |
+
"bbox": [
|
| 761 |
+
174,
|
| 762 |
+
707,
|
| 763 |
+
825,
|
| 764 |
+
776
|
| 765 |
+
],
|
| 766 |
+
"page_idx": 6
|
| 767 |
+
},
|
| 768 |
+
{
|
| 769 |
+
"type": "text",
|
| 770 |
+
"text": "We considered SimCSE (sup-simcse-bert-base-uncased checkpoint) as an unsupervised baseline as it uses the base version of the BSC loss, which we modified. Below, by BSC we will denote using optimal settings in the tables, and variants like BSC - random shuffle would mean that instead of these optimal settings, we applied random shuffling. ",
|
| 771 |
+
"bbox": [
|
| 772 |
+
174,
|
| 773 |
+
784,
|
| 774 |
+
823,
|
| 775 |
+
840
|
| 776 |
+
],
|
| 777 |
+
"page_idx": 6
|
| 778 |
+
},
|
| 779 |
+
{
|
| 780 |
+
"type": "text",
|
| 781 |
+
"text": "6 RESULTS ",
|
| 782 |
+
"text_level": 1,
|
| 783 |
+
"bbox": [
|
| 784 |
+
174,
|
| 785 |
+
861,
|
| 786 |
+
281,
|
| 787 |
+
876
|
| 788 |
+
],
|
| 789 |
+
"page_idx": 6
|
| 790 |
+
},
|
| 791 |
+
{
|
| 792 |
+
"type": "text",
|
| 793 |
+
"text": "In this section, we compare the BSC loss to other loss functions: MSE and triplet loss. Additionally, we make an ablation study for the BSC loss modifications we proposed. ",
|
| 794 |
+
"bbox": [
|
| 795 |
+
173,
|
| 796 |
+
892,
|
| 797 |
+
823,
|
| 798 |
+
921
|
| 799 |
+
],
|
| 800 |
+
"page_idx": 6
|
| 801 |
+
},
|
| 802 |
+
{
|
| 803 |
+
"type": "text",
|
| 804 |
+
"text": "Antique The results are shown in Table 1. Our best approach of combo-training MSE and BSC losses outperforms all other variants and the approach proposed in (Hashemi et al., 2019), where specific negative sampling and a triplet loss were used. Besides, the best BSC configuration achieves higher scores than MSE. We can see the importance of using predefined hand-crafted negative examples, which brings additional difficult cases and increases MRR by 0.02. ",
|
| 805 |
+
"bbox": [
|
| 806 |
+
174,
|
| 807 |
+
104,
|
| 808 |
+
470,
|
| 809 |
+
256
|
| 810 |
+
],
|
| 811 |
+
"page_idx": 7
|
| 812 |
+
},
|
| 813 |
+
{
|
| 814 |
+
"type": "table",
|
| 815 |
+
"img_path": "images/bab58a558f51f7986ee10c76c4232cb483049b0147dcc171e068173b4593814f.jpg",
|
| 816 |
+
"table_caption": [
|
| 817 |
+
"Table 1: Results for Antique. "
|
| 818 |
+
],
|
| 819 |
+
"table_footnote": [],
|
| 820 |
+
"table_body": "<table><tr><td>Approach /Metric</td><td>MRR</td><td>P@1</td><td>nDCG@1</td></tr><tr><td>MSE</td><td>0.781</td><td>0.660</td><td>0.769</td></tr><tr><td>BSC</td><td>0.804</td><td>0.680</td><td>0.754</td></tr><tr><td>BSC - positives</td><td>0.784</td><td>0.655</td><td>0.744</td></tr><tr><td>BSC - random shuffle</td><td>0.799</td><td>0.670</td><td>0.754</td></tr><tr><td>Combo BSC +MSE</td><td>0.822</td><td>0.710</td><td>0.773</td></tr><tr><td>SimCSE (unsup.)</td><td>0.681</td><td>0.525</td><td>0.686</td></tr><tr><td>Hashemi et al. (2019)</td><td>0.797</td><td>0.709</td><td>0.713</td></tr></table>",
|
| 821 |
+
"bbox": [
|
| 822 |
+
483,
|
| 823 |
+
118,
|
| 824 |
+
820,
|
| 825 |
+
241
|
| 826 |
+
],
|
| 827 |
+
"page_idx": 7
|
| 828 |
+
},
|
| 829 |
+
{
|
| 830 |
+
"type": "text",
|
| 831 |
+
"text": "CQA-A The results for CQA subtask A are shown in Table 2. A comparison with (Nakov et al., 2017) is not very fair, as we did not use the metadata, e.g., the comment position, which was crucial for the best systems. Besides, we use SBERT, which is inferior to a fine-tuned BERT. Nevertheless, our best approach of combo training with MSE and BSC losses yielded competitive results. We further compared different shuffling strategies. The data is ordered by questions, and keeping this order turns out to be best. That is, the model ",
|
| 832 |
+
"bbox": [
|
| 833 |
+
174,
|
| 834 |
+
263,
|
| 835 |
+
450,
|
| 836 |
+
443
|
| 837 |
+
],
|
| 838 |
+
"page_idx": 7
|
| 839 |
+
},
|
| 840 |
+
{
|
| 841 |
+
"type": "table",
|
| 842 |
+
"img_path": "images/8d00d6af3e7f4597d62ffa2a3d509911d986440a1ee758be8bb0f53f4f1f9f40.jpg",
|
| 843 |
+
"table_caption": [
|
| 844 |
+
"Table 2: Results for CQA-A and CQA-B. "
|
| 845 |
+
],
|
| 846 |
+
"table_footnote": [],
|
| 847 |
+
"table_body": "<table><tr><td>Approach/Metric</td><td>MAP</td><td>MRR</td><td>MAP</td><td>MRR</td></tr><tr><td>MSE</td><td>0.869</td><td>0.911</td><td>0.471</td><td>0.513</td></tr><tr><td>BSC</td><td>0.801</td><td>0.867</td><td>0.495</td><td>0.534</td></tr><tr><td>BSC - clusters shuffle</td><td>0.787</td><td>0.859</td><td>0.493</td><td>0.534</td></tr><tr><td>BSC - random shuffle</td><td>0.763</td><td>0.828</td><td>0.487</td><td>0.530</td></tr><tr><td>BSC- w/o shufffle</td><td>0.816</td><td>0.884</td><td>0.481</td><td>0.532</td></tr><tr><td>Combo BSC+MSE</td><td>0.872</td><td>0.912</td><td>0.496</td><td>0.540</td></tr><tr><td>Triplet loss</td><td>0.857</td><td>0.917</td><td>0.475</td><td>0.529</td></tr><tr><td>SimCSE (unsup.)</td><td>0.684</td><td>0.735</td><td>0.439</td><td>0.478</td></tr><tr><td>Nakov et al. (2017)</td><td>0.884</td><td>0.928</td><td>0.472</td><td>0.501</td></tr></table>",
|
| 848 |
+
"bbox": [
|
| 849 |
+
464,
|
| 850 |
+
279,
|
| 851 |
+
825,
|
| 852 |
+
426
|
| 853 |
+
],
|
| 854 |
+
"page_idx": 7
|
| 855 |
+
},
|
| 856 |
+
{
|
| 857 |
+
"type": "text",
|
| 858 |
+
"text": "learns to distinguish positive answers for each question from manually selected negative ones and from answers to other questions. Also, note that random shuffling completely eliminates this structure, and MAP drops by $6 \\%$ absolute. Fast shuffling by 300 clusters, an advanced version of shuffling by words, improves these results. Example-based shuffling finds a data order similar to the initial one, and the quality does not degrade much. ",
|
| 859 |
+
"bbox": [
|
| 860 |
+
174,
|
| 861 |
+
444,
|
| 862 |
+
825,
|
| 863 |
+
513
|
| 864 |
+
],
|
| 865 |
+
"page_idx": 7
|
| 866 |
+
},
|
| 867 |
+
{
|
| 868 |
+
"type": "text",
|
| 869 |
+
"text": "CQA-B The results for CQA-B are shown in Table 2. Again, we did not use the question position, which is a critically important feature for the best systems. We can see that the BSC loss achieved the best score, noticeably outperforming MSE and triplet losses. The experiments also demonstrate the importance of data order when training with the BSC loss. Since the dataset is small, the model overfits when the original data order is fixed. ",
|
| 870 |
+
"bbox": [
|
| 871 |
+
173,
|
| 872 |
+
520,
|
| 873 |
+
825,
|
| 874 |
+
589
|
| 875 |
+
],
|
| 876 |
+
"page_idx": 7
|
| 877 |
+
},
|
| 878 |
+
{
|
| 879 |
+
"type": "text",
|
| 880 |
+
"text": "PFCC-S Table 3 shows the results for PFCCS $H P @ k$ stands for HasPositives $@ k$ ). Note that the scores from (Shaar et al., 2020) are for pre-trained SBERT without task-specific fine-tuning. We observed that even when using oversampling to improve the balance of positive examples, MSE performed worse than their results. Here, we used only positives examples to train with BSC, and normalizing by the zero dimension was the best. Overall, the approaches using BSC and triplet losses were comparable. However, the ",
|
| 881 |
+
"bbox": [
|
| 882 |
+
174,
|
| 883 |
+
597,
|
| 884 |
+
470,
|
| 885 |
+
762
|
| 886 |
+
],
|
| 887 |
+
"page_idx": 7
|
| 888 |
+
},
|
| 889 |
+
{
|
| 890 |
+
"type": "table",
|
| 891 |
+
"img_path": "images/c26e26a864a6350d1401a844652a80bf33a71733bab2d2f7565990872cf20717.jpg",
|
| 892 |
+
"table_caption": [
|
| 893 |
+
"Table 3: Results for PFCC-S. "
|
| 894 |
+
],
|
| 895 |
+
"table_footnote": [],
|
| 896 |
+
"table_body": "<table><tr><td>Approach /Metric</td><td>HP@1</td><td>HP@5</td><td>HP@50</td></tr><tr><td>MSE</td><td>0.362</td><td>0.508</td><td>0.709</td></tr><tr><td>BSC</td><td>0.673</td><td>0.844</td><td>0.899</td></tr><tr><td>BSC - 1-dim norm</td><td>0.588</td><td>0.764</td><td>0.899</td></tr><tr><td>BSC - no norm</td><td>0.608</td><td>0.744</td><td>0.884</td></tr><tr><td>BSC - random shuffle</td><td>0.663</td><td>0.794</td><td>0.915</td></tr><tr><td>Triplet loss</td><td>0.668</td><td>0.794</td><td>0.899</td></tr><tr><td>SimCSE (unsup.)</td><td>0.412</td><td>0.693</td><td>0.849</td></tr><tr><td>Shaar et al. (2020)</td><td>0.402</td><td>0.653</td><td>0.784</td></tr></table>",
|
| 897 |
+
"bbox": [
|
| 898 |
+
483,
|
| 899 |
+
609,
|
| 900 |
+
820,
|
| 901 |
+
743
|
| 902 |
+
],
|
| 903 |
+
"page_idx": 7
|
| 904 |
+
},
|
| 905 |
+
{
|
| 906 |
+
"type": "text",
|
| 907 |
+
"text": "dataset size for training with the BSC loss was much smaller, which is also true for MSE. As a result, the BSC loss is faster, and preferable for this task. ",
|
| 908 |
+
"bbox": [
|
| 909 |
+
176,
|
| 910 |
+
763,
|
| 911 |
+
821,
|
| 912 |
+
791
|
| 913 |
+
],
|
| 914 |
+
"page_idx": 7
|
| 915 |
+
},
|
| 916 |
+
{
|
| 917 |
+
"type": "text",
|
| 918 |
+
"text": "MRPC Table 4 shows the results for MRPC. MSE outperformed the BSC loss, but combo achieved a slightly higher F1 score. ",
|
| 919 |
+
"bbox": [
|
| 920 |
+
173,
|
| 921 |
+
797,
|
| 922 |
+
464,
|
| 923 |
+
840
|
| 924 |
+
],
|
| 925 |
+
"page_idx": 7
|
| 926 |
+
},
|
| 927 |
+
{
|
| 928 |
+
"type": "text",
|
| 929 |
+
"text": "QQP The results for QQP are presented in Table 4. We also show results for SBERT and augmented SBERT (in parentheses) from (Thakur et al., 2020). There score was obtained by training SBERT with ",
|
| 930 |
+
"bbox": [
|
| 931 |
+
174,
|
| 932 |
+
847,
|
| 933 |
+
464,
|
| 934 |
+
916
|
| 935 |
+
],
|
| 936 |
+
"page_idx": 7
|
| 937 |
+
},
|
| 938 |
+
{
|
| 939 |
+
"type": "table",
|
| 940 |
+
"img_path": "images/714020c95e719c380efbac2c05822d49516f8e92d7ec350e27bc9ddef950ae21.jpg",
|
| 941 |
+
"table_caption": [
|
| 942 |
+
"Table 4: Results for MRPC and QQP. "
|
| 943 |
+
],
|
| 944 |
+
"table_footnote": [],
|
| 945 |
+
"table_body": "<table><tr><td>Approach /Metric</td><td>MRPC (F1)</td><td>QQP (F1)</td></tr><tr><td>MSE</td><td>89.08</td><td>74.29</td></tr><tr><td>BSC</td><td>86.73</td><td>73.13</td></tr><tr><td>Combo BSC +MSE</td><td>89.46</td><td>75.07</td></tr><tr><td> SimCSE (unsup.)</td><td>85.43</td><td>68.65</td></tr><tr><td>Thakur et al. (2020)</td><td>87.89 (88.55)</td><td>74.97 (79.77)</td></tr></table>",
|
| 946 |
+
"bbox": [
|
| 947 |
+
477,
|
| 948 |
+
806,
|
| 949 |
+
820,
|
| 950 |
+
904
|
| 951 |
+
],
|
| 952 |
+
"page_idx": 7
|
| 953 |
+
},
|
| 954 |
+
{
|
| 955 |
+
"type": "text",
|
| 956 |
+
"text": "MSE using another random training sample, but nonetheless, the F1 score is close to ours. The combo approach outperformed separate training with BSC or MSE. ",
|
| 957 |
+
"bbox": [
|
| 958 |
+
169,
|
| 959 |
+
103,
|
| 960 |
+
823,
|
| 961 |
+
132
|
| 962 |
+
],
|
| 963 |
+
"page_idx": 8
|
| 964 |
+
},
|
| 965 |
+
{
|
| 966 |
+
"type": "text",
|
| 967 |
+
"text": "STSb Table 5 shows the results for STS. It is the only task where combo with the BSC loss was worse than MSE. This could be due to hard negatives not appearing in the batch in any of the shuffling procedures. Moreover, we observed only marginal improvement when fine-tuning with a BSC model initially trained with MSE. However, if it was pretrained with BSC up to overfitting, fine-tuning it with MSE yielded sizable improvements. ",
|
| 968 |
+
"bbox": [
|
| 969 |
+
174,
|
| 970 |
+
138,
|
| 971 |
+
483,
|
| 972 |
+
277
|
| 973 |
+
],
|
| 974 |
+
"page_idx": 8
|
| 975 |
+
},
|
| 976 |
+
{
|
| 977 |
+
"type": "table",
|
| 978 |
+
"img_path": "images/22eb862586fe2fc68c94764a8fd16527350993a68e882f0f9729c5c2d2813452.jpg",
|
| 979 |
+
"table_caption": [
|
| 980 |
+
"Table 5: Results for STSb: Spearman rank correlation. "
|
| 981 |
+
],
|
| 982 |
+
"table_footnote": [],
|
| 983 |
+
"table_body": "<table><tr><td>Approach/Metric</td><td>p×100</td></tr><tr><td>MSE</td><td>84.80</td></tr><tr><td>BSC</td><td>83.26</td></tr><tr><td>Combo BSC +MSE</td><td>84.59</td></tr><tr><td>Fine-tuning MSE with BSC</td><td>84.95</td></tr><tr><td>Fine-tuning BSC with MSE</td><td>85.71</td></tr><tr><td>SimCSE (unsup.)</td><td>84.25</td></tr><tr><td>Reimers & Gurevych (2019)</td><td>84.86</td></tr></table>",
|
| 984 |
+
"bbox": [
|
| 985 |
+
527,
|
| 986 |
+
165,
|
| 987 |
+
789,
|
| 988 |
+
287
|
| 989 |
+
],
|
| 990 |
+
"page_idx": 8
|
| 991 |
+
},
|
| 992 |
+
{
|
| 993 |
+
"type": "text",
|
| 994 |
+
"text": "7 DISCUSSION ",
|
| 995 |
+
"text_level": 1,
|
| 996 |
+
"bbox": [
|
| 997 |
+
174,
|
| 998 |
+
297,
|
| 999 |
+
310,
|
| 1000 |
+
314
|
| 1001 |
+
],
|
| 1002 |
+
"page_idx": 8
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"type": "text",
|
| 1006 |
+
"text": "We highlight the following observations: ",
|
| 1007 |
+
"bbox": [
|
| 1008 |
+
176,
|
| 1009 |
+
329,
|
| 1010 |
+
441,
|
| 1011 |
+
344
|
| 1012 |
+
],
|
| 1013 |
+
"page_idx": 8
|
| 1014 |
+
},
|
| 1015 |
+
{
|
| 1016 |
+
"type": "text",
|
| 1017 |
+
"text": "• Combo-training with BSC and MSE losses generally yields the best results (the only exception is STS), and it outperforms the triplet loss with advanced negative sampling. \n• The order in which the data is presented for training can be critical, as we have seen in the cases of CQA-A and CQA-B. \n• The use of labeled negatives examples generally improves the scores by $1 \\%$ absolute. \n• Embedding normalization during training is important. Moreover, it is useful to normalize to the zero dimension (e.g., for PFCC-S). \n• Temperature $\\tau$ of order 0.1 should be used with the standard normalization, and $\\tau$ of order 1-3 for coordinate normalization. \n• An incorrect training setup may hurt the performance by more than $10 \\%$ , as was demonstrated for $( i )$ filtering out negative examples for which no positives were given in the dataset (Table 1), $( i i )$ using poorly formed batches (highest effect in Table 2), $( i i i )$ suboptimal normalization (Table 3), and $( i \\nu )$ wrong temperature value. \n• The BSC loss is more suitable for ranking tasks, but it can help for other tasks if applied as pre-training or in joint training with the MSE loss. ",
|
| 1018 |
+
"bbox": [
|
| 1019 |
+
217,
|
| 1020 |
+
357,
|
| 1021 |
+
825,
|
| 1022 |
+
594
|
| 1023 |
+
],
|
| 1024 |
+
"page_idx": 8
|
| 1025 |
+
},
|
| 1026 |
+
{
|
| 1027 |
+
"type": "text",
|
| 1028 |
+
"text": "Selecting a loss function is important. For instance, if the model optimizes Pearson correlation, it achieves a score of 85.57 on the STS task. Thus, it outperforms almost all considered approaches. Moreover, the combination of such a loss with BSC allows the model to achieve an F1 score of 89.88 in the MRPC task (a classification task). ",
|
| 1029 |
+
"bbox": [
|
| 1030 |
+
176,
|
| 1031 |
+
607,
|
| 1032 |
+
825,
|
| 1033 |
+
661
|
| 1034 |
+
],
|
| 1035 |
+
"page_idx": 8
|
| 1036 |
+
},
|
| 1037 |
+
{
|
| 1038 |
+
"type": "text",
|
| 1039 |
+
"text": "Finally, we would like to draw a parallel between our work and Augmented SBERT (Thakur et al., 2020). When using the BSC loss, some negatives are implicitly added to the dataset. Augmented SBERT adds new examples too and retrieves them using BM25 or Semantic Search samplings. These methods are comparable to our fast shuffling by words ( $\\dot { n }$ -grams) and to example-based shuffling, respectively. Moreover, the task-specific model is used to encode the data in both cases. However, we do not need to label such pairs with another model (cross-encoder) due to the BSC loss definition. ",
|
| 1040 |
+
"bbox": [
|
| 1041 |
+
174,
|
| 1042 |
+
670,
|
| 1043 |
+
825,
|
| 1044 |
+
767
|
| 1045 |
+
],
|
| 1046 |
+
"page_idx": 8
|
| 1047 |
+
},
|
| 1048 |
+
{
|
| 1049 |
+
"type": "text",
|
| 1050 |
+
"text": "8 CONCLUSION AND FUTURE WORK ",
|
| 1051 |
+
"text_level": 1,
|
| 1052 |
+
"bbox": [
|
| 1053 |
+
174,
|
| 1054 |
+
786,
|
| 1055 |
+
493,
|
| 1056 |
+
803
|
| 1057 |
+
],
|
| 1058 |
+
"page_idx": 8
|
| 1059 |
+
},
|
| 1060 |
+
{
|
| 1061 |
+
"type": "text",
|
| 1062 |
+
"text": "We explored the idea of using a batch-softmax contrastive loss for fine-tuning large-scale pre-trained transformers to learn better task-specific sentence embeddings for pairwise sentence scoring tasks. We introduced and studied a number of variations in the calculation of the loss as well as in the overall training procedure. Our experimental results have shown sizable improvements on a number of datasets and pairwise sentence scoring tasks including ranking, classification, and regression. ",
|
| 1063 |
+
"bbox": [
|
| 1064 |
+
174,
|
| 1065 |
+
819,
|
| 1066 |
+
825,
|
| 1067 |
+
888
|
| 1068 |
+
],
|
| 1069 |
+
"page_idx": 8
|
| 1070 |
+
},
|
| 1071 |
+
{
|
| 1072 |
+
"type": "text",
|
| 1073 |
+
"text": "In future work, we want to explore new variations of the loss, and to gain better understanding of when to use which variation. We further plan experiments with a larger set of NLP tasks. ",
|
| 1074 |
+
"bbox": [
|
| 1075 |
+
174,
|
| 1076 |
+
895,
|
| 1077 |
+
823,
|
| 1078 |
+
924
|
| 1079 |
+
],
|
| 1080 |
+
"page_idx": 8
|
| 1081 |
+
},
|
| 1082 |
+
{
|
| 1083 |
+
"type": "text",
|
| 1084 |
+
"text": "REFERENCES ",
|
| 1085 |
+
"text_level": 1,
|
| 1086 |
+
"bbox": [
|
| 1087 |
+
176,
|
| 1088 |
+
102,
|
| 1089 |
+
285,
|
| 1090 |
+
117
|
| 1091 |
+
],
|
| 1092 |
+
"page_idx": 9
|
| 1093 |
+
},
|
| 1094 |
+
{
|
| 1095 |
+
"type": "text",
|
| 1096 |
+
"text": "Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeshwar, Sherjil Ozair, Yoshua Bengio, Aaron Courville, and Devon Hjelm. Mutual information neural estimation. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 531–540, Stockholmsmassan, Stock- ¨ holm Sweden, 2018. PMLR. ",
|
| 1097 |
+
"bbox": [
|
| 1098 |
+
174,
|
| 1099 |
+
126,
|
| 1100 |
+
825,
|
| 1101 |
+
195
|
| 1102 |
+
],
|
| 1103 |
+
"page_idx": 9
|
| 1104 |
+
},
|
| 1105 |
+
{
|
| 1106 |
+
"type": "text",
|
| 1107 |
+
"text": "Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), 2017. ",
|
| 1108 |
+
"bbox": [
|
| 1109 |
+
174,
|
| 1110 |
+
207,
|
| 1111 |
+
826,
|
| 1112 |
+
250
|
| 1113 |
+
],
|
| 1114 |
+
"page_idx": 9
|
| 1115 |
+
},
|
| 1116 |
+
{
|
| 1117 |
+
"type": "text",
|
| 1118 |
+
"text": "Ting Chen, Yizhou Sun, Yue Shi, and Liangjie Hong. On sampling strategies for neural networkbased collaborative filtering. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’17, pp. 767–776, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450348874. ",
|
| 1119 |
+
"bbox": [
|
| 1120 |
+
174,
|
| 1121 |
+
260,
|
| 1122 |
+
825,
|
| 1123 |
+
316
|
| 1124 |
+
],
|
| 1125 |
+
"page_idx": 9
|
| 1126 |
+
},
|
| 1127 |
+
{
|
| 1128 |
+
"type": "text",
|
| 1129 |
+
"text": "Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. 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. 1597–1607. PMLR, 2020. ",
|
| 1130 |
+
"bbox": [
|
| 1131 |
+
174,
|
| 1132 |
+
327,
|
| 1133 |
+
826,
|
| 1134 |
+
383
|
| 1135 |
+
],
|
| 1136 |
+
"page_idx": 9
|
| 1137 |
+
},
|
| 1138 |
+
{
|
| 1139 |
+
"type": "text",
|
| 1140 |
+
"text": "Bill Dolan, Chris Quirk, and Chris Brockett. Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources. In Proceedings of the 20th International Conference on Computational Linguistics, COLING ’04, pp. 350–es, USA, 2004. Association for Computational Linguistics. ",
|
| 1141 |
+
"bbox": [
|
| 1142 |
+
173,
|
| 1143 |
+
393,
|
| 1144 |
+
825,
|
| 1145 |
+
450
|
| 1146 |
+
],
|
| 1147 |
+
"page_idx": 9
|
| 1148 |
+
},
|
| 1149 |
+
{
|
| 1150 |
+
"type": "text",
|
| 1151 |
+
"text": "Hongchao Fang and Pengtao Xie. Cert: Contrastive self-supervised learning for language understanding. CoRR, abs/2005.12766, 2020. ",
|
| 1152 |
+
"bbox": [
|
| 1153 |
+
173,
|
| 1154 |
+
460,
|
| 1155 |
+
823,
|
| 1156 |
+
489
|
| 1157 |
+
],
|
| 1158 |
+
"page_idx": 9
|
| 1159 |
+
},
|
| 1160 |
+
{
|
| 1161 |
+
"type": "text",
|
| 1162 |
+
"text": "Tianyu Gao, Xingcheng Yao, and Danqi Chen. SimCSE: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821, 2021. ",
|
| 1163 |
+
"bbox": [
|
| 1164 |
+
173,
|
| 1165 |
+
500,
|
| 1166 |
+
825,
|
| 1167 |
+
530
|
| 1168 |
+
],
|
| 1169 |
+
"page_idx": 9
|
| 1170 |
+
},
|
| 1171 |
+
{
|
| 1172 |
+
"type": "text",
|
| 1173 |
+
"text": "John M Giorgi, Osvald Nitski, Gary D. Bader, and Bo Wang. Declutr: Deep contrastive learning for unsupervised textual representations. ArXiv, abs/2006.03659, 2020. ",
|
| 1174 |
+
"bbox": [
|
| 1175 |
+
169,
|
| 1176 |
+
539,
|
| 1177 |
+
823,
|
| 1178 |
+
569
|
| 1179 |
+
],
|
| 1180 |
+
"page_idx": 9
|
| 1181 |
+
},
|
| 1182 |
+
{
|
| 1183 |
+
"type": "text",
|
| 1184 |
+
"text": "Beliz Gunel, Jingfei Du, Alexis Conneau, and Ves Stoyanov. Supervised contrastive learning for pre-trained language model fine-tuning. ArXiv, abs/2011.01403, 2020. ",
|
| 1185 |
+
"bbox": [
|
| 1186 |
+
169,
|
| 1187 |
+
579,
|
| 1188 |
+
823,
|
| 1189 |
+
608
|
| 1190 |
+
],
|
| 1191 |
+
"page_idx": 9
|
| 1192 |
+
},
|
| 1193 |
+
{
|
| 1194 |
+
"type": "text",
|
| 1195 |
+
"text": "R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), volume 2, pp. 1735–1742, 2006. ",
|
| 1196 |
+
"bbox": [
|
| 1197 |
+
176,
|
| 1198 |
+
617,
|
| 1199 |
+
823,
|
| 1200 |
+
661
|
| 1201 |
+
],
|
| 1202 |
+
"page_idx": 9
|
| 1203 |
+
},
|
| 1204 |
+
{
|
| 1205 |
+
"type": "text",
|
| 1206 |
+
"text": "Helia Hashemi, Mohammad Aliannejadi, Hamed Zamani, and W. Bruce Croft. ANTIQUE: A nonfactoid question answering benchmark. CoRR, abs/1905.08957, 2019. ",
|
| 1207 |
+
"bbox": [
|
| 1208 |
+
171,
|
| 1209 |
+
671,
|
| 1210 |
+
823,
|
| 1211 |
+
700
|
| 1212 |
+
],
|
| 1213 |
+
"page_idx": 9
|
| 1214 |
+
},
|
| 1215 |
+
{
|
| 1216 |
+
"type": "text",
|
| 1217 |
+
"text": "Matthew Henderson, Rami Al-Rfou, B. Strope, Yun-Hsuan Sung, L. Lukacs, R. Guo, S. Kumar, ´ B. Miklos, and R. Kurzweil. Efficient natural language response suggestion for smart reply. ArXiv, abs/1705.00652, 2017. ",
|
| 1218 |
+
"bbox": [
|
| 1219 |
+
173,
|
| 1220 |
+
709,
|
| 1221 |
+
825,
|
| 1222 |
+
752
|
| 1223 |
+
],
|
| 1224 |
+
"page_idx": 9
|
| 1225 |
+
},
|
| 1226 |
+
{
|
| 1227 |
+
"type": "text",
|
| 1228 |
+
"text": "Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR 2019. ICLR, 2019. ",
|
| 1229 |
+
"bbox": [
|
| 1230 |
+
174,
|
| 1231 |
+
763,
|
| 1232 |
+
825,
|
| 1233 |
+
806
|
| 1234 |
+
],
|
| 1235 |
+
"page_idx": 9
|
| 1236 |
+
},
|
| 1237 |
+
{
|
| 1238 |
+
"type": "text",
|
| 1239 |
+
"text": "J. Johnson, M. Douze, and H. Jegou. Billion-scale similarity search with gpus. ´ IEEE Transactions on Big Data, pp. 1–1, 2019. ",
|
| 1240 |
+
"bbox": [
|
| 1241 |
+
169,
|
| 1242 |
+
816,
|
| 1243 |
+
823,
|
| 1244 |
+
845
|
| 1245 |
+
],
|
| 1246 |
+
"page_idx": 9
|
| 1247 |
+
},
|
| 1248 |
+
{
|
| 1249 |
+
"type": "text",
|
| 1250 |
+
"text": "Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning, 2020. ",
|
| 1251 |
+
"bbox": [
|
| 1252 |
+
171,
|
| 1253 |
+
856,
|
| 1254 |
+
823,
|
| 1255 |
+
885
|
| 1256 |
+
],
|
| 1257 |
+
"page_idx": 9
|
| 1258 |
+
},
|
| 1259 |
+
{
|
| 1260 |
+
"type": "text",
|
| 1261 |
+
"text": "Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. In International Conference on Learning Representations, 2018. ",
|
| 1262 |
+
"bbox": [
|
| 1263 |
+
173,
|
| 1264 |
+
895,
|
| 1265 |
+
821,
|
| 1266 |
+
924
|
| 1267 |
+
],
|
| 1268 |
+
"page_idx": 9
|
| 1269 |
+
},
|
| 1270 |
+
{
|
| 1271 |
+
"type": "text",
|
| 1272 |
+
"text": "Fuli Luo, Pengcheng Yang, S. Li, Xuancheng Ren, and X. Sun. Capt: Contrastive pre-training for learning denoised sequence representations. ArXiv, abs/2010.06351, 2020. ",
|
| 1273 |
+
"bbox": [
|
| 1274 |
+
169,
|
| 1275 |
+
103,
|
| 1276 |
+
823,
|
| 1277 |
+
132
|
| 1278 |
+
],
|
| 1279 |
+
"page_idx": 10
|
| 1280 |
+
},
|
| 1281 |
+
{
|
| 1282 |
+
"type": "text",
|
| 1283 |
+
"text": "Yu Meng, Chenyan Xiong, Payal Bajaj, saurabh tiwary, Paul N. Bennett, Jiawei Han, and Xia Song. COCO-LM: Correcting and contrasting text sequences for language model pretraining. In ThirtyFifth Conference on Neural Information Processing Systems, 2021. ",
|
| 1284 |
+
"bbox": [
|
| 1285 |
+
176,
|
| 1286 |
+
140,
|
| 1287 |
+
821,
|
| 1288 |
+
184
|
| 1289 |
+
],
|
| 1290 |
+
"page_idx": 10
|
| 1291 |
+
},
|
| 1292 |
+
{
|
| 1293 |
+
"type": "text",
|
| 1294 |
+
"text": "Preslav Nakov, Doris Hoogeveen, Llu´ıs Marquez, Alessandro Moschitti, Hamdy Mubarak, Timothy \\` Baldwin, and Karin Verspoor. SemEval-2017 task 3: Community question answering. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pp. 27–48, Vancouver, Canada, 2017. Association for Computational Linguistics. ",
|
| 1295 |
+
"bbox": [
|
| 1296 |
+
173,
|
| 1297 |
+
193,
|
| 1298 |
+
825,
|
| 1299 |
+
250
|
| 1300 |
+
],
|
| 1301 |
+
"page_idx": 10
|
| 1302 |
+
},
|
| 1303 |
+
{
|
| 1304 |
+
"type": "text",
|
| 1305 |
+
"text": "A. Oord, Y. Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. ArXiv, abs/1807.03748, 2018. ",
|
| 1306 |
+
"bbox": [
|
| 1307 |
+
173,
|
| 1308 |
+
257,
|
| 1309 |
+
820,
|
| 1310 |
+
287
|
| 1311 |
+
],
|
| 1312 |
+
"page_idx": 10
|
| 1313 |
+
},
|
| 1314 |
+
{
|
| 1315 |
+
"type": "text",
|
| 1316 |
+
"text": "Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence embeddings using Siamese BERTnetworks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLPIJCNLP), pp. 3982–3992, Hong Kong, China, 2019. Association for Computational Linguistics. ",
|
| 1317 |
+
"bbox": [
|
| 1318 |
+
173,
|
| 1319 |
+
295,
|
| 1320 |
+
825,
|
| 1321 |
+
353
|
| 1322 |
+
],
|
| 1323 |
+
"page_idx": 10
|
| 1324 |
+
},
|
| 1325 |
+
{
|
| 1326 |
+
"type": "text",
|
| 1327 |
+
"text": "Shaden Shaar, Nikolay Babulkov, Giovanni Da San Martino, and Preslav Nakov. That is a known lie: Detecting previously fact-checked claims. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 3607–3618, Online, 2020. Association for Computational Linguistics. ",
|
| 1328 |
+
"bbox": [
|
| 1329 |
+
173,
|
| 1330 |
+
361,
|
| 1331 |
+
826,
|
| 1332 |
+
417
|
| 1333 |
+
],
|
| 1334 |
+
"page_idx": 10
|
| 1335 |
+
},
|
| 1336 |
+
{
|
| 1337 |
+
"type": "text",
|
| 1338 |
+
"text": "Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29, pp. 1857–1865. Curran Associates, Inc., 2016. ",
|
| 1339 |
+
"bbox": [
|
| 1340 |
+
174,
|
| 1341 |
+
426,
|
| 1342 |
+
820,
|
| 1343 |
+
469
|
| 1344 |
+
],
|
| 1345 |
+
"page_idx": 10
|
| 1346 |
+
},
|
| 1347 |
+
{
|
| 1348 |
+
"type": "text",
|
| 1349 |
+
"text": "Nandan Thakur, Nils Reimers, Johannes Daxenberger, and Iryna Gurevych. Augmented sbert: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks, 2020. ",
|
| 1350 |
+
"bbox": [
|
| 1351 |
+
169,
|
| 1352 |
+
478,
|
| 1353 |
+
823,
|
| 1354 |
+
507
|
| 1355 |
+
],
|
| 1356 |
+
"page_idx": 10
|
| 1357 |
+
},
|
| 1358 |
+
{
|
| 1359 |
+
"type": "text",
|
| 1360 |
+
"text": "Michael Tschannen, Josip Djolonga, Paul K. Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. ",
|
| 1361 |
+
"bbox": [
|
| 1362 |
+
173,
|
| 1363 |
+
515,
|
| 1364 |
+
826,
|
| 1365 |
+
571
|
| 1366 |
+
],
|
| 1367 |
+
"page_idx": 10
|
| 1368 |
+
},
|
| 1369 |
+
{
|
| 1370 |
+
"type": "text",
|
| 1371 |
+
"text": "Kilian Q Weinberger, John Blitzer, and Lawrence Saul. Distance metric learning for large margin nearest neighbor classification. In Y. Weiss, B. Scholkopf, and J. Platt (eds.), ¨ Advances in Neural Information Processing Systems, volume 18, pp. 1473–1480. MIT Press, 2006. ",
|
| 1372 |
+
"bbox": [
|
| 1373 |
+
174,
|
| 1374 |
+
582,
|
| 1375 |
+
825,
|
| 1376 |
+
625
|
| 1377 |
+
],
|
| 1378 |
+
"page_idx": 10
|
| 1379 |
+
},
|
| 1380 |
+
{
|
| 1381 |
+
"type": "text",
|
| 1382 |
+
"text": "Zhirong Wu, Yuanjun Xiong, S. Yu, and D. Lin. Unsupervised feature learning via non-parametric instance discrimination. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3733–3742, 2018. ",
|
| 1383 |
+
"bbox": [
|
| 1384 |
+
174,
|
| 1385 |
+
632,
|
| 1386 |
+
825,
|
| 1387 |
+
676
|
| 1388 |
+
],
|
| 1389 |
+
"page_idx": 10
|
| 1390 |
+
},
|
| 1391 |
+
{
|
| 1392 |
+
"type": "text",
|
| 1393 |
+
"text": "Yinfei Yang, Steve Yuan, Daniel Cer, Sheng-yi Kong, Noah Constant, Petr Pilar, Heming Ge, YunHsuan Sung, Brian Strope, and Ray Kurzweil. Learning semantic textual similarity from conversations. In Proceedings of The Third Workshop on Representation Learning for NLP, pp. 164–174, Melbourne, Australia, 2018. Association for Computational Linguistics. ",
|
| 1394 |
+
"bbox": [
|
| 1395 |
+
174,
|
| 1396 |
+
684,
|
| 1397 |
+
825,
|
| 1398 |
+
741
|
| 1399 |
+
],
|
| 1400 |
+
"page_idx": 10
|
| 1401 |
+
}
|
| 1402 |
+
]
|
parse/dev/FZCFlj2_c7z/FZCFlj2_c7z.md
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# JUMP-START REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Reinforcement learning (RL) provides a theoretical framework for continuously improving an agent’s behavior via trial and error. However, efficiently learning policies from scratch can be very difficult, particularly for tasks that present exploration challenges. In such settings, it might be desirable to initialize RL with an existing policy, offline data, or demonstrations. However, naively performing such initialization in RL often works poorly, especially for value-based methods. In this paper, we present a meta algorithm that can use offline data, demonstrations, or a pre-existing policy to initialize an RL policy, and is compatible with any RL approach. In particular, we propose Jump-Start Reinforcement Learning (JSRL), an algorithm that employs two policies to solve tasks: a guide-policy, and an exploration-policy. By using the guide-policy to form a curriculum of starting states for the exploration-policy, we are able to efficiently improve performance on a set of simulated robotic tasks. We show via experiments that it is able to significantly outperform existing imitation and reinforcement learning algorithms, particularly in the small-data regime. In addition, we provide an upper bound on the sample complexity of JSRL and show that with the help of a guide-policy, one can improve the sample complexity for non-optimism exploration methods from exponential in horizon to polynomial.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
A promising aspect of reinforcement learning (RL) is the ability of a policy to iteratively improve via trial and error. Often, however, the most difficult part of this process is the very beginning, where a policy that is learning without any prior data needs to randomly encounter rewards to further improve. A common way to side-step this exploration issue is to aid the policy with prior knowledge. One source of prior knowledge might come in the form of a prior policy, which can provide some initial guidance in collecting data with non-zero rewards, but which is not by itself fully optimal. Such policies could be obtained from demonstration data (e.g., via behavioral cloning), from sub-optimal prior data (e.g., via offline RL), or even simply via manual engineering. In the case where this prior policy is itself parameterized as a function approximator, it could serve to simply initialize a policy gradient method. However, sample-efficient algorithms based on value functions are notoriously difficult to bootstrap in this way. As observed in prior work (Peng et al., 2019; Nair et al., 2020; Kostrikov et al., 2021; Lu et al., 2021), value functions require both good and bad data to initialize successfully, and the mere availability of a starting policy does not by itself readily provide an initial value function of comparable performance. This leads to the question we pose in this work: how can we bootstrap a value-based RL algorithm with a prior policy that attains reasonable but sub-optimal performance?
|
| 12 |
+
|
| 13 |
+
The main insight that we leverage to address this problem is that we can bootstrap any RL algorithm by gradually “rolling in” with the prior policy, which we refer to as the guide-policy. In particular, the guide-policy provides a curriculum of starting states for the RL exploration-policy, which significantly simplifies the exploration problem and allows for fast learning. As the exploration-policy improves, the effect of the guide-policy is diminished, leading to an RL-only policy that is capable of further autonomous improvement. Our approach is generic, as it can be applied to any RL method that explores its environment for policy improvement, though we focus on value-based methods in this work. The only requirements of our method are that the guide-policy can select actions based on observations of the environment, and its performance is reasonable (i.e., better than a random policy). Since the guide-policy significantly speeds up the early phases of RL, we call this approach Jump-Start Reinforcement Learning (JSRL). We provide an overview diagram of JSRL in Fig. 1.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: We study how to efficiently bootstrap value-based RL algorithms given access to a prior policy. In vanilla RL (left), the agent explores randomly from the initial state until it encounters a reward (gold star). JSRL (right), leverages a guide-policy (dashed blue line) that takes the agent closer to the reward. After the guide-policy finishes, the exploration-policy (solid orange line) continues acting in the environment. As the exploration-policy improves, the influence of the guide-policy diminishes, resulting in a learning curriculum for bootstrapping RL.
|
| 17 |
+
|
| 18 |
+
JSRL can utilize any form of prior policy to accelerate RL. It is also compatible with RL algorithms that involve rolling out a policy to explore an environment. Thus, JSRL can easily be combined with existing offline and/or online RL methods. In addition, we provide a theoretical justification of JSRL by deriving an upper bound on its sample complexity compared to RL alternatives. Finally, we demonstrate that JSRL outperforms previously proposed imitation and reinforcement learning approaches on a set of benchmark tasks as well as more challenging vision-based robotic problems.
|
| 19 |
+
|
| 20 |
+
# 2 RELATED WORK
|
| 21 |
+
|
| 22 |
+
Imitation learning combined with reinforcement learning $\mathbf { \left( I I L + R L \right) }$ ). Several previous works on leveraging a prior policy to initialize RL focus on doing so by combining imitation learning and RL. Some methods treat RL as a sequence modelling problem and train an autoregressive model using offline data Zheng et al. (2022); Janner et al. (2021); Chen et al. (2021). One well-studied class of approaches initializes policy search methods with policies trained via behavioral cloning Schaal et al. (1997); Kober et al. (2010); Rajeswaran et al. (2017). This is an effective strategy for initializing policy search methods, but is generally ineffective with actor-critic or value-based methods, where the critic also needs to be initialized (Nair et al., 2020), as we also illustrate in Section 3. Methods have been proposed to include prior data in the replay buffer for a value-based approach (Nair et al., 2018; Vecerik et al., 2018), but this requires prior data rather than just a prior policy. More recent approaches improve this strategy by using offline RL Kumar et al. (2020); Nair et al. (2020); Lu et al. (2021) to pre-train on prior data, then finetune. We compare to such methods, showing that our approach not only makes weaker assumptions (requiring only a policy rather than a dataset), but also performs comparably or better.
|
| 23 |
+
|
| 24 |
+
Curriculum learning and exact state resets for RL. Many prior works have investigated efficient exploration strategies in RL that are based on starting exploration from specific states. Commonly, these works assume the ability to reset to arbitrary states in simulation (Salimans & Chen, 2018). Some methods uniformly sample states from demonstrations as start states (Hosu & Rebedea, 2016; Peng et al., 2018; Nair et al., 2018), while others generate curriculas of start states. The latter includes methods that start at the goal state and iteratively expand the start state distribution, assuming reversible dynamics (Florensa et al., 2017; McAleer et al., 2019) or access to an approximate dynamics model (Ivanovic et al., 2019). Other approaches generate the curriculum from demonstration states (Resnick et al., 2018) or from online exploration (Ecoffet et al., 2021). In contrast, our method does not control the exact starting state distribution, but instead utilizes the implicit distribution naturally arising from rolling out the guide-policy. This broadens the distribution of start states compared to exact resets along a narrow set of demonstrations, making the learning process more robust. In addition, our approach could be extended to the real world, where resetting to a state in the environment is impossible.
|
| 25 |
+
|
| 26 |
+
Provably efficient exploration techniques. Online exploration in RL has been well studied in theory (Osband & Van Roy, 2014; Jin et al., 2018; Zhang et al., 2020b; Xie et al., 2021; Zanette et al., 2020; Jin et al., 2020). The proposed methods either rely on the estimation of confidence intervals (e.g. UCB, Thompson sampling), which is hard to approximate and implement when combined with neural networks, or suffer from exponential sample complexity in the worst-case. In this paper, we leverage a pre-trained guide-policy to design an algorithm that is more sample-efficient than these approaches while being easy to implement in practice.
|
| 27 |
+
|
| 28 |
+
“Rolling in” policies. Using a pre-existing policy (or policies) to initialize RL and improve exploration has been studied in past literature. Some works use an ensemble of roll-in policies or value functions to refine exploration Jiang et al. (2017); Agarwal et al. (2020). With a policy that models the environment’s dynamics, it is possible to look ahead to guide the training policy towards useful actions (Lin, 1992). Similar to our work, an approach from Smart & Pack Kaelbling (2002) rolls out a fixed controller to provide bootstrap data for a policy’s value function. However, this method does not mix the prior policy and the learned policy, but only uses the prior policy for data collection. We use a multi-stage curriculum to gradually reduce the contribution of the prior policy during training, which allows for on-policy experience for the learned policy. Our method is also conceptually related to DAgger (Ross & Bagnell, 2010), which also bridges distributional shift by rolling in with one policy and then obtaining labels from a human expert, but DAgger is intended for imitation learning and rolls in the learned policy, while our method addresses RL and rolls in with a sub-optimal guide-policy.
|
| 29 |
+
|
| 30 |
+
# 3 PRELIMINARIES
|
| 31 |
+
|
| 32 |
+
We define a Markov decision process $\mathcal { M } = ( \mathcal { S } , \mathcal { A } , P , R , p _ { 0 } , \gamma , H )$ , where $s$ and $\mathcal { A }$ are state and action spaces, $P : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \to \mathbb { R } _ { + }$ is a state-transition probability function, $R : S \times \mathcal { A } \mathbb { R }$ is a reward function, $p _ { 0 } : { \mathcal { S } } \mathbb { R } _ { + }$ is an initial state distribution, $\gamma$ is a discount factor, and $H$ is the task horizon. Our goal is to effectively utilize a prior policy of any form in value-based reinforcement learning (RL). The goal of RL is to find a policy $\pi ( a | s )$ that maximizes the expected discounted reward over trajectories, $\tau$ , induced by the policy: $\dot { \mathbb { E } } _ { \pi } [ R ( \tau ) ]$ where $s _ { 0 } \sim p _ { 0 } , s _ { t + 1 } \sim$ $P ( \cdot | s _ { t } , a _ { t } )$ and $a _ { t } \sim \pi ( \cdot | s _ { t } )$ . To solve this maximization problem, value-based RL methods take advantage of state or state-action value functions (Q-function) $Q ^ { \pi } ( s , a )$ , which can be learned using approximate dynamic programming approaches. The Q-function, $Q ^ { \pi } ( s , a )$ , represents the discounted returns when starting from state $s$ and action $a$ , followed by the actions produced by the policy $\pi$
|
| 33 |
+
|
| 34 |
+
In order to leverage prior data in value-based RL and continue fine-tuning, researchers commonly use various offline RL methods (Kostrikov et al., 2021; Kumar et al., 2020; Nair et al., 2020; Lu et al., 2021) that often rely on pre-trained, regularized Qfunctions that can be further improved using online data. In the case where a pre-trained Q-function is not available and we only have access to a prior policy, value-based RL methods struggle to effectively incorporate that information as depicted in Fig. 2. In this
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: Na¨ıve policy initialization. We pre-train a policy to medium performance (depicted by negative steps), then use this policy to initialize actor-critic fine-tuning (starting from step 0), while initializing the critic randomly. Actor performance decays, as the untrained critic provides a poor learning signal, causing the good initial policy to be forgotten. In Figures 7 and 8, we repeat this experiment but allow the randomly initialized critic to ”warm up” before fine-tuning.
|
| 38 |
+
|
| 39 |
+
experiment, we train an actor-critic method up to step 0, then we start from a fresh Q-function and
|
| 40 |
+
|
| 41 |
+
continue with the pre-trained actor, simulating the case where we only have access to a prior policy.
|
| 42 |
+
This is the setting that we are concerned with in this work.
|
| 43 |
+
|
| 44 |
+
# 4 JUMP-START REINFORCEMENT LEARNING
|
| 45 |
+
|
| 46 |
+
In this section, we describe our method, Jump-Start Reinforcement Learning (JSRL), that we use to initialize value-based RL algorithms with a prior policy of any form. We first describe the intuition behind our method then lay out a detailed algorithm along with theoretical analysis.
|
| 47 |
+
|
| 48 |
+
# 4.1 ROLLING IN WITH TWO POLICIES
|
| 49 |
+
|
| 50 |
+
We assume access to a fixed prior policy that we refer to as the “guide-policy”, $\pi ^ { g } ( a | s )$ , which we leverage to initialize an RL algorithm. It is important to note that we do not assume any particular form of $\pi ^ { g }$ ; it could be learned with imitation learning, RL, or it could be manually scripted. We will refer to the RL policy that is being learned via trial and error as the “exploration-policy” $\pi ^ { e } ( a | s )$ , since, as it is commonly done in RL literature, this is the policy that is used for exploration as well as online improvement. The only requirement for $\pi ^ { e }$ is that it is an RL policy that can adapt with online experience. Our approach and the set of assumptions is generic in that it can handle any downstream RL method that rolls out a policy for exploring an environment, though we focus on the case where $\pi ^ { e }$ is learned via a value-based RL algorithm.
|
| 51 |
+
|
| 52 |
+
The main idea behind our method is to leverage the two policies, $\pi ^ { g }$ and $\pi ^ { e }$ , executed sequentially to learn tasks more efficiently. During the initial phases of training, $\pi ^ { g }$ is significantly better than the untrained policy $\pi ^ { e }$ , so we would like to collect data using $\pi ^ { g }$ . However, this data is out of distribution for $\pi ^ { e }$ , since exploring with $\pi ^ { e }$ will visit different states. Therefore, we would like to gradually transition data collection away from $\pi ^ { g }$ and toward $\pi ^ { e }$ . Intuitively, we would like to use $\pi ^ { g }$ to get the agent into “good” states, and then let $\pi ^ { e }$ take over and explore from those states. As it gets better and better, $\pi ^ { e }$ should take over earlier and earlier, until all data is being collected by $\pi ^ { e }$ and there is no more distributional shift. We can employ different switching strategies to switch from $\pi ^ { g }$ to $\pi ^ { e }$ , but the most direct curriculum simply switches from $\pi ^ { g }$ to $\pi ^ { e }$ at some time step $h$ , where $h$ is initialized to the full task horizon and gradually decreases over the course of training. This naturally provides a curriculum for $\pi ^ { e }$ . At each curriculum stage, $\pi ^ { e }$ needs to master a small part of the state-space that is required to reach the states covered by the previous curriculum stage.
|
| 53 |
+
|
| 54 |
+
# 4.2 ALGORITHM
|
| 55 |
+
|
| 56 |
+
We provide a detailed description of JSRL in Algorithm 1. Given an RL task with horizon $H$ , we first choose a sequence of initial guide-steps to which we roll out our guide-policy, $\{ H _ { 1 } , H _ { 2 } , \dotsb , H _ { n } \}$ where $H _ { i } \in \{ 1 , 2 , \cdots , H \}$ denotes the number of steps that the guide-policy at the $\mathrm { i ^ { \mathrm { t h } } }$ iteration acts for. Let $h$ denote the iterator over such a sequence of initial guide-steps. At the beginning of each training episode, we roll out $\pi ^ { g }$ for $h$ steps, then $\pi ^ { e }$ continues acting in the environment for the additional $H - h$ steps until the task horizon $H$ is reached. We can write the combination of the two policies as the combined policy, $\pi$ , where $\pi _ { 1 : h } = \pi ^ { g }$ and $\pi _ { h + 1 : H } = \pi ^ { e }$ . After we roll out $\pi$ to collect online data, we use the new data to update our exploration-policy $\pi ^ { e }$ and combined policy $\pi$ by calling a standard training procedure TRAINPOLICY. The TRAINPOLICY updates both the $Q$ function and the corresponding evaluation policy. For example, the training procedure may be updating the exploration-policy via a Deep Q-Network (Mnih et al., 2013) with $\epsilon$ -greedy as the exploration technique (i.e. $\pi ^ { e } ( a | s ) = 1 - \epsilon$ if $a = \arg \operatorname* { m a x } _ { a } Q ( s , a )$ and $\epsilon / | \boldsymbol { A } |$ otherwise). The new combined policy is then evaluated over the course of training using a standard evaluation procedure EVALUATEPOLICY $( \pi )$ . Once the performance of the combined policy $\pi$ reaches a threshold, $\beta$ , we continue the for loop with the next guide step $h$ .
|
| 57 |
+
|
| 58 |
+
While any guide-step sequence could be used with JSRL, we focus on two specific strategies for determining guide-step sequences: curriculum and random-switching. With the curriculum strategy, we start with a large guide-step (ie. $H _ { 1 } = H$ ) and use policy evaluations of the combined policy $\pi$ to progressively decrease $H _ { n }$ as $\pi ^ { e }$ improves. Intuitively, this means that we train our policy in a backward manner by first rolling out $\pi ^ { g }$ to the last guide-step and then exploring with $\pi ^ { e }$ , and then rolling out $\pi ^ { g }$ to the second to last guide-step and exploring with $\pi ^ { e }$ , and so on. With the randomswitching strategy, we sample each $h$ uniformly and independently from the set $\{ H _ { 1 } , H _ { 2 } , \cdot \cdot \cdot , H _ { n } \}$ .
|
| 59 |
+
|
| 60 |
+
In the rest of the paper, we refer to the curriculum variant as JSRL, and the random switching variant as JSRL-Random.
|
| 61 |
+
|
| 62 |
+
# Algorithm 1 Jump-Start Reinforcement Learning
|
| 63 |
+
|
| 64 |
+
1: Input: guide-policy $\pi ^ { g }$ , performance threshold $\beta$ , task horizon $H$ , a sequence of initial guide-steps $H _ { 1 } , H _ { 2 } , \cdots , H _ { n }$ , where $\bar { H _ { i } } \in \{ 1 , 2 , \cdots , H \}$ for all $i \leq n$ .
|
| 65 |
+
2: Initialize exploration-policy from scratch or with the guide-policy $\pi ^ { e } \pi ^ { g }$ . Initialize $Q$ -function $\hat { Q }$ and dataset $\mathcal { D } \mathcal { D }$ .
|
| 66 |
+
3: for current guide step $h = H _ { 1 } , H _ { 2 } , \cdot \cdot \cdot , H _ { n }$ do
|
| 67 |
+
4: Set the non-stationary policy $\pi _ { 1 : h } = \pi ^ { g }$ , $\pi _ { h + 1 : H } = \pi ^ { e }$
|
| 68 |
+
5: Roll out the policy $\pi$ to get trajectory $\left\{ \left( s _ { 1 } , a _ { 1 } , r _ { 1 } \right) , \cdot \cdot \cdot , \left( s _ { H } , a _ { H } , r _ { H } \right) \right\}$ ; Append the trajectory to the dataset $\mathcal { D }$ .
|
| 69 |
+
6: $\pi ^ { e } , \hat { Q } \gets \mathrm { T R A I N P O L I C Y } ( \pi ^ { e } , \hat { Q } , \mathcal { D } )$
|
| 70 |
+
7: if EVALUATEPOLICY $( \pi ) \geq \beta$ then
|
| 71 |
+
8: Continue
|
| 72 |
+
9: end if
|
| 73 |
+
10: end for
|
| 74 |
+
|
| 75 |
+
# 4.3 THEORETICAL ANALYSIS
|
| 76 |
+
|
| 77 |
+
In this section, we provide theoretical analysis of JSRL, showing that the roll-in data collection strategy that we propose provably attains polynomial sample complexity. The sample complexity refers to the number of samples required by the algorithm to learn a policy with small suboptimality, where we define the suboptimality for a policy $\pi$ as $\mathbb { E } _ { s \sim p _ { 0 } } [ V ^ { \star } ( s ) - V ^ { \pi } ( s ) ]$ . In particular, we aim to answer two questions: Why is JSRL better than other exploration algorithms which start exploration from scratch? Under which conditions does the guide-policy provably improve exploration? To answer these questions, we study upper and lower bounds for the sample complexity of exploration algorithms. We first provide a lower bound showing that simple non-optimism-based exploration algorithms like $\epsilon$ -greedy suffer from a sample complexity that is exponential in the horizon. Then, we show that with the help of a guide-policy with good coverage of important states, the JSRL algorithm with $\epsilon$ -greedy as the exploration strategy can achieve polynomial sample complexity.
|
| 78 |
+
|
| 79 |
+
We focus on comparing JSRL with standard non-optimism-based exploration methods, e.g. ϵ- greedy (Langford & Zhang, 2007) and FALCON $^ +$ (Simchi-Levi & Xu, 2020). Although the optimismbased RL algorithms like UCB (Jin et al., 2018) and Thompson sampling (Ouyang et al., 2017) turn out to be efficient strategies for exploration from scratch, they all require uncertainty quantification, which can be hard for vision-based RL tasks with neural network parameterization. Note that the cross entropy method used in the vision-based RL framework Qt-Opt (Kalashnikov et al., 2018) is also a non-optimism-based method. In particular, it can be viewed as a variant of $\epsilon$ -greedy algorithm in continuous action space, with the Gaussian distribution as the exploration distribution.
|
| 80 |
+
|
| 81 |
+
We first show that without the help of a guide-policy, the non-optimism-based method usually suffers from a sample complexity that is exponential in horizon for episodic MDP. We adapt the combination lock example in Koenig & Simmons (1993) to show the hardness of exploration from scratch for non-optimism-based methods.
|
| 82 |
+
|
| 83 |
+
Theorem 4.1 (Koenig & Simmons (1993)). For 0-initialized ϵ-greedy, there exists an MDP instance such that one has to suffer from a sample complexity that is exponential in total horizon $H$ in order to find a policy that has suboptimality smaller than 0.5.
|
| 84 |
+
|
| 85 |
+
We include the construction of combination lock MDP and the proof in Appendix A.4.2 for completeness. This lower bound also applies to any other non-optimism-based exploration algorithm which explores uniformly when the estimated $Q$ for all actions are 0. As a concrete example, this also shows that iteratively running FALCON $^ +$ Simchi-Levi & Xu (2020) suffers from exponential sample complexity. With the above lower bound, we are ready to show the upper bound for JSRL under certain assumptions on the guide-policy. In particular, we assume that the guide-policy $\pi ^ { g }$ is able to cover good states that are visited by the optimal policy under some feature representation:
|
| 86 |
+
|
| 87 |
+
Assumption 4.2 (Quality of guide-policy $\pi ^ { g }$ ). Let $d ^ { \pi } ( s )$ be the marginalized state occupancy distribution when we follow policy $\pi$ . Assume that the state is parametrized by some feature mapping $\phi : \mathcal { S } \mapsto \mathbb { R } ^ { d }$ such that for any policy $\pi$ , $Q ^ { \pi } ( s , a )$ and $\pi ( s )$ depend on $s$ only through $\phi ( s )$ , and that in the feature space, the guide-policy $\pi ^ { g }$ cover the states visited by the optimal policy:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\operatorname* { s u p } _ { s , h } { \frac { d _ { h } ^ { \pi ^ { \star } } ( \phi ( s ) ) } { d _ { h } ^ { \pi ^ { g } } ( \phi ( s ) ) } } \leq C .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
We provide formal definition of the marginalized state occupancy distribution in Appendix A.4. In other words, the guide-policy visits only all good states in the feature space. A policy that satisfies Assumption 4.2 may be far from optimal due to wrong choice of actions in each step. Assumption 4.2 is also much weaker than the single policy concentratability coefficient assumption, which requires the guide-policy visits all good state and action pairs and is a standard assumption in the literature in offline learning Rashidinejad et al. (2021); Xie et al. (2021). The ratio in Assumption 4.2 is also sometimes referred to as the distribution mismatch coefficient in the literature of policy gradient methods Agarwal et al. (2021).
|
| 94 |
+
|
| 95 |
+
We show via the following theorem that given Assumption 4.2, a simplified JSRL algorithm which only explores at current guide step $h + 1$ gives good performance guarantees for both tabular MDP and MDP with general function approximation. The simplified JSRL algorithm coincides with the Policy Search by Dynamic Programming (PSDP) algorithm in Bagnell et al. (2003), although our method is mainly motivated by the problem of fine-tuning and efficient exploration in value based methods, while PSDP focuses on policy-based methods.
|
| 96 |
+
|
| 97 |
+
Theorem 4.3 (Informal). Under Assumption 4.2 and an appropriate choice of TrainPolicy and EvaluatePolicy, JSRL in Algorithm 1 guarantees a suboptimality of $O ( C H ^ { 5 / 2 } S ^ { 1 / 2 } A / T ^ { 1 / 2 } )$ for tabular MDP; and a near-optimal bound up to factor of $C \cdot { \mathsf { p o l y } } ( H )$ for MDP with general function approximation.
|
| 98 |
+
|
| 99 |
+
To achieve a polynomial bound for JSRL, it suffices to take TrainPolicy as $\epsilon$ -greedy. This is in sharp contrast to Theorem 4.1, where $\epsilon$ -greedy suffers from exponential sample complexity. As is discussed in the related work section, although polynomial and even near-optimal bound can be achieved by many optimism-based methods Jin et al. (2018); Ouyang et al. (2017), the JSRL algorithm does not require constructing a bonus function for uncertainty quantification, and can be implemented easily based on na¨ıve $\epsilon$ -greedy methods. Furthermore, although we focus on analyzing the simplified JSRL which only updates policy $\pi$ at current guide steps $h + 1$ , in practice we run a JSRL algorithm as in Algorithm 1, which updates all policies after step $h + 1$ . This is the main difference between our proposed algorithm and PSDP. For a formal statement and more discussion related to Theorem 4.3, please refer to Appendix A.4.3.
|
| 100 |
+
|
| 101 |
+
# 5 EXPERIMENTS
|
| 102 |
+
|
| 103 |
+
In our experimental evaluation, we study the following questions: (1) How does JSRL compare with competitive $\mathrm { I L + R L }$ baselines? (2) Does JSRL scale to complex vision-based robotic manipulation tasks? (3) How sensitive is JSRL to the quality of the guide-policy? (4) How important is the curriculum component of JSRL? (5) Does JSRL generalize? That is, can a guide-policy still be useful if it was pre-trained on a related task?
|
| 104 |
+
|
| 105 |
+
# 5.1 COMPARISON WITH $\mathrm { I L + R L }$ BASELINES
|
| 106 |
+
|
| 107 |
+
To study how JSRL compares with competitive $\mathrm { I L + R L }$ methods, we utilize the D4RL (Fu et al., 2020) benchmark tasks, which vary in task complexity and offline dataset quality. We focus on the most challenging D4RL tasks: Ant Maze and Adroit manipulation. We consider a common setting where the agent first trains on an offline dataset (1m transitions for Ant Maze, $1 0 0 \mathrm { k }$ transitions for Adroit) and then runs online fine-tuning for 1m steps. We compare against algorithms designed specifically for this setting, which include AWAC (Nair et al., 2020), IQL (Kostrikov et al., 2021), CQL (Kumar et al., 2020), and behavior cloning (BC). While JSRL can be used in combination with any initial guide-policy or fine-tuning algorithm, we show the combination of JSRL with the strongest baseline, IQL. IQL (Implicit Q-Learning) is an actor-critic method that completely avoids estimating the values of actions that are not seen in the offline dataset. This is a recent state-of-the-art method for the $\mathrm { I L + R L }$ setting we consider. In Table 1, we see that across the Ant Maze environments and Adroit environments, $\mathrm { I Q L + J S R L }$ is able to successfully fine-tune given an initial offline dataset, and is competitive with baselines. We will come back for further analysis of Table 1 when discussing the sensitivity to the size of the dataset.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 3: We evaluate the importance of guide-policy quality for JSRL on Instance Grasping, the most challenging task we consider. By limiting the initial demonstrations, JSRL is less sensitive to limitations of initial demonstrations compared to baselines, especially in the small-data regime. For each of these initial demonstration settings, we find that $\scriptstyle \mathrm { Q t - O p t + J S R L }$ is more sample efficient than Qt-Opt+JSRL-Random in early stages of training, but converge to the same final performances. A similar analysis for Indiscriminate Grasping is provided in Fig. 10 in the Appendix.
|
| 113 |
+
Figure 4: $\mathrm { I L + R L }$ methods on two simulated robotic grasping tasks. The baselines show improvement with fine-tuning, but Qt-Opt+JSRL is more sample efficient and attains higher final performance.
|
| 114 |
+
|
| 115 |
+
# 5.2 VISION-BASED ROBOTIC TASKS
|
| 116 |
+
|
| 117 |
+
Utilizing offline data is challenging in complex tasks such as vision-based robotic manipulation. The high dimensionality of both the continuous control action space as well as the pixel-based state space present unique scaling challenges for $\mathrm { I L + R L }$ methods. To study how JSRL scales to such settings, we focus on two simulated robotic manipulation tasks: Indiscriminate Grasping and Instance Grasping. In these tasks, a simulated robot arm is placed in front of a table with various categories of objects. When the robot lifts any object, a sparse reward is given for the Indiscriminate Grasping task; for the more challenging Instance Grasping task, the sparse reward is only given when a sampled target object is grasped. An image of the task is shown in Fig. 5 and described in detail in Appendix A.1.2. We compare JSRL against methods that have been shown to scale to such complex vision-based robotics settings: Qt-Opt (Kalashnikov et al., 2018), AW-Opt (Lu et al., 2021), and BC. Each method has access to the same offline dataset of 2,000 successful demonstrations and is allowed to run online fine-tuning for up to 100,000 steps. While AW-Opt and BC utilize offline successes as part of their original design motivation, we allow a more fair comparison for Qt-Opt by initializing the replay buffer with the offline demonstrations, which was not the case in the original Qt-Opt paper. Since we have already shown that JSRL can work well with an offline RL algorithm in the previous experiment, to demonstrate the flexibility of our approach, in this experiment we combine JSRL with an online Q-learning method: Qt-Opt. As seen in Fig. 4, the combination of Qt-Opt+JSRL (both versions of the curricula) outperforms the other methods in both sample efficiency as well as final performance.
|
| 118 |
+
|
| 119 |
+
# 5.3 INITIAL DATASET SENSITIVITY
|
| 120 |
+
|
| 121 |
+
While most $\mathrm { I L + R L }$ methods are improved by more data and higher quality data, there are often practical limitations that restrict initial offline datasets. JSRL is no exception to this dependency, as the quality of the guide-policy $\pi ^ { g }$ directly depends on the offline dataset when utilizing JSRL in an $\mathrm { I L + R L }$ setting (i.e., when the guide-policy is pre-trained on an offline dataset). We study the offline dataset sensitivity of $\mathrm { I L + R L }$ algorithms and JSRL on both D4RL tasks as well as the vision-based robotic grasping tasks. The two settings presented in D4RL and Robotic Grasping are quite different: $\mathrm { I Q L + J S R L }$ in D4RL pretrains with an offline RL algorithm from a mixed quality offline dataset, while Qt-Opt+JSRL pretrains with BC from a high quality dataset.
|
| 122 |
+
|
| 123 |
+
<table><tr><td rowspan="2">Environment</td><td rowspan="2">Dataset</td><td rowspan="2">AWAC1</td><td rowspan="2">BC</td><td rowspan="2">CQL</td><td rowspan="2">IQL</td><td colspan="2">IQL+JSRL (Ours)</td></tr><tr><td>Curriculum</td><td>Random</td></tr><tr><td rowspan="4">antmaze-umaze-v0</td><td>1k</td><td>1</td><td>1</td><td>1</td><td>0.2±0.5</td><td>15.6±19.9</td><td>10.4± 9.6</td></tr><tr><td>10k</td><td>1</td><td>1</td><td>1</td><td>55.5 ± 12.5</td><td>71.7 ± 14.5</td><td>52.3± 26.7</td></tr><tr><td>100k</td><td>一</td><td>1</td><td>1</td><td>74.2 ± 25.6</td><td>93.7±4.2</td><td>92.1 ± 2.8</td></tr><tr><td>1m (standard)</td><td>59.0</td><td>54.6</td><td>99.4</td><td>97.6±3.2</td><td>98.1 ± 1.4</td><td>95.0±3.0</td></tr><tr><td rowspan="4">antmaze-umaze-diverse-v0</td><td>1k 10k</td><td>1</td><td>1 1</td><td>1</td><td>0.0±0.0 33.1 ± 10.7</td><td>3.1±8.0 72.6± 12.2</td><td>1.9±4.8 39.4± 20.1</td></tr><tr><td></td><td>/</td><td></td><td>1</td><td></td><td></td><td></td></tr><tr><td>100k</td><td>1</td><td></td><td>1</td><td>29.9 ± 23.1</td><td>81.3± 23.0</td><td>82.3 ± 14.2</td></tr><tr><td>1m (standard)</td><td>49.0</td><td>45.6</td><td>99.4</td><td>53.0± 30.5</td><td>88.6 ±16.3</td><td>89.8±10.0</td></tr><tr><td rowspan="4">antmaze-medium-play-v0</td><td>1k</td><td>1</td><td>1</td><td>1</td><td>0.0±0.0</td><td>0.0±0.0 16.7 ± 12.9</td><td>0.0±0.0</td></tr><tr><td>10k</td><td>1</td><td>1</td><td>1</td><td>0.1±0.3</td><td></td><td>3.8±5.0</td></tr><tr><td>100k</td><td>一</td><td>1</td><td>1</td><td>32.8± 32.6</td><td>86.7 ±3.7</td><td>56.2± 28.8</td></tr><tr><td>1m (standard)</td><td>0.0</td><td>0.0</td><td>0.0</td><td>92.8±2.7</td><td>91.1 ±3.9</td><td>87.8±4.2</td></tr><tr><td rowspan="4">antmaze-medium-diverse-v0</td><td>1k 10k</td><td>1</td><td>1</td><td>1</td><td>0.0±0.0</td><td>0.0±0.0 16.6 ± 11.7</td><td>0.0±0.0</td></tr><tr><td>100k</td><td>一</td><td>1</td><td>1</td><td>0.0±0.0</td><td></td><td>5.1±8.2</td></tr><tr><td>1m (standard)</td><td>1</td><td>1 0.0</td><td>1</td><td>15.7 ±17.7</td><td>81.5 ± 18.8</td><td>67.0 ± 17.4</td></tr><tr><td>1k</td><td>0.3 1</td><td></td><td>32.3</td><td>92.4±4.5 0.0±0.0</td><td>93.1±3.1 0.0±0.0</td><td>86.3±5.9 0.0±0.0</td></tr><tr><td rowspan="4">antmaze-large-play-v0</td><td>10k</td><td>1</td><td>1 1</td><td>1 1</td><td>0.0±0.0</td><td>0.1±0.2</td><td>0.0±0.0</td></tr><tr><td>100k</td><td>一</td><td>1</td><td>1</td><td>2.6±8.2</td><td>36.3±16.4</td><td>17.7 ± 13.4</td></tr><tr><td>1m (standard)</td><td>0.0</td><td>0.0</td><td>0.0</td><td>62.4± 12.4</td><td>62.9±11.3</td><td>48.6± 10.0</td></tr><tr><td>1k</td><td>1</td><td>1</td><td>1</td><td>0.0±0.0</td><td>0.0±0.0</td><td>0.0±0.0</td></tr><tr><td rowspan="4">pen-binary-v0</td><td>10k</td><td>1</td><td>1</td><td>1</td><td>0.0±0.0</td><td>0.1±0.2</td><td>0.0±0.0</td></tr><tr><td>100k</td><td>1</td><td>1</td><td>1</td><td>4.1 ± 10.4</td><td>34.4± 23.0</td><td>22.4 ±15.4</td></tr><tr><td>1m (standard)</td><td>0.0</td><td>0.0</td><td>0.0</td><td>68.3±8.9</td><td>68.3±8.8</td><td>58.3±6.5</td></tr><tr><td>100</td><td>1</td><td>1</td><td>1</td><td>18.8 ± 11.6</td><td>24.3 ± 12.1</td><td>29.1±7.6</td></tr><tr><td rowspan="4">door-binary-v0</td><td>1k</td><td>1</td><td>1</td><td>1</td><td>30.1± 10.2</td><td>36.7 ± 7.9</td><td>46.3±6.3</td></tr><tr><td>10k</td><td>1</td><td>1</td><td>1</td><td>38.4 ± 11.2</td><td>44.3 ± 6.2</td><td>52.1±3.3</td></tr><tr><td>100k (standard)</td><td>70.3</td><td>0.0</td><td>9.9</td><td>65.0± 2.9</td><td>62.6 ± 3.6</td><td>60.6± 2.7</td></tr><tr><td>100</td><td>1</td><td>1</td><td>1</td><td>0.8±3.8</td><td>0.4±1.8</td><td>0.1±0.2</td></tr><tr><td rowspan="4"></td><td>1k</td><td>1</td><td>1</td><td>1</td><td>0.5±1.5</td><td>0.7 ±1.0</td><td>0.45 ± 1.2</td></tr><tr><td>10k</td><td></td><td></td><td></td><td>10.6 ± 14.1</td><td>4.3±8.4</td><td></td></tr><tr><td>100k (standard)</td><td>1</td><td>1</td><td>1</td><td></td><td>28.5 ± 19.5</td><td>22.3±11.6</td></tr><tr><td></td><td>30.1</td><td>0.0</td><td>0.0</td><td>50.2±2.5</td><td></td><td>24.3 ± 11.5</td></tr><tr><td rowspan="4">relocate-binary-v0</td><td>100</td><td>1</td><td>1</td><td>1</td><td>0.0±0.0</td><td>0.0±0.1 0.0±0.1</td><td>0.0±0.0</td></tr><tr><td>1k</td><td>一</td><td>1</td><td>1</td><td>0.0±0.0</td><td>0.6 ±1.6</td><td>0.0±0.0</td></tr><tr><td>10k 100k (standard)</td><td>1</td><td>1 0.0</td><td>1 0.0</td><td>0.2±0.3 8.6±7.7</td><td>0.0±0.1</td><td>0.5±0.7 4.7 ± 4.2</td></tr><tr><td></td><td>2.7</td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 124 |
+
|
| 125 |
+
Table 1: Comparing JSRL with $\mathrm { I L + R L }$ baselines on D4RL tasks by using averaged normalized scores for D4RL Ant Maze and Adroit tasks. Each method pretrains on an offline dataset and then runs online finetuning for 1m steps. Our method $\mathrm { I Q L + J S R L }$ is competitive with $\mathrm { I L + R L }$ baselines in the full dataset setting, but performs significantly better in the small-data regime. For implementation details and more detailed comparisons, see Appendix A.2.
|
| 126 |
+
Table 2: Limiting the initial number of demonstrations is challenging for $\mathrm { I L + R L }$ baselines on the difficult robotic grasping tasks. Notably, only $\scriptstyle \mathrm { Q t - O p t + J S R L }$ is able to learn in the smallest-data regime of just 20 demonstrations, $1 0 0 \mathrm { x }$ less than the standard 2,000 demonstrations.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Environment</td><td>#Demos</td><td>Qt-Opt</td><td>AW-Opt</td><td>BC</td><td>Qt-Opt+JSRL (Ours)</td></tr><tr><td>Indiscriminate Grasping Indiscriminate Grasping</td><td>20 200</td><td>0.0±0.0 0.93 ± 0.01</td><td>0.0±0.0 0.96 ±0.02</td><td>0.19±0.04 0.23±0.00</td><td>0.92±0.00 0.92 ±0.01</td></tr><tr><td>Indiscriminate Grasping</td><td></td><td>0.94 ± 0.01</td><td></td><td></td><td></td></tr><tr><td></td><td>2k</td><td></td><td>0.97 ± 0.01</td><td>0.44±0.05</td><td>0.94±0.03</td></tr><tr><td>Indiscriminate Grasping</td><td>20k</td><td>0.94± 0.01</td><td>0.98 ± 0.01</td><td>0.91 ± 0.01</td><td>0.95 ±0.00</td></tr><tr><td>Instance Grasping</td><td>20</td><td>0.23±0.20</td><td>0.47± 0.04</td><td>0.05 ± 0.04</td><td>0.50 ± 0.09</td></tr><tr><td>Instance Grasping</td><td>200</td><td>0.47 ± 0.04</td><td>0.49 ±0.02</td><td>0.15 ± 0.02</td><td>0.54±0.03</td></tr><tr><td>Instance Grasping</td><td>2k</td><td>0.15 ± 0.26</td><td>0.43±0.03</td><td>0.28 ±0.04</td><td>0.57 ± 0.07</td></tr><tr><td>Instance Grasping</td><td>20k</td><td>0.28 ±0.25</td><td>0.57± 0.01</td><td>0.49 ±0.02</td><td>0.58 ±0.02</td></tr></table>
|
| 129 |
+
|
| 130 |
+
For D4RL, methods typically use 1 million transitions from mixed-quality policies from previous RL training runs; as we reduce the size of the offline datasets in Table 1, IQL $+ .$ JSRL performance degrades less than the baseline IQL performance. For the robotic grasping tasks, we provided 2,000 highquality demonstrations. As we reduce the number of demonstrations, we find that JSRL efficiently learns better policies. Across both D4RL and the robotic grasping tasks, JSRL outperforms baselines in the low-data regime, as shown in Table 1 and Table 2. In the high-data regime, when we increase the number of demonstrations by $1 0 \mathrm { x }$ to 20,000 demonstrations, we notice that AW-Opt and BC perform much more competitively, suggesting that the exploration challenge is no longer the bottleneck. While starting with such large numbers of demonstrations is not typically a realistic setting, this results suggests that the benefits of JSRL are most prominent when the offline dataset does not densely cover good state-action pairs. This aligns with our analysis in Appendix A.1 that JSRL does not require such assumptions about the dataset, but solely requires a prior policy.
|
| 131 |
+
|
| 132 |
+
# 5.4 JSRL-CURRICULUM VS. JSRL-RANDOM SWITCHING
|
| 133 |
+
|
| 134 |
+
In order to disentangle these two components, we propose an augmentation of our method, JSRLRandom, that randomly selects the number of guide-steps every episode. Using the D4RL tasks and the robotic grasping tasks, we compare JSRL-Random to JSRL and previous $\mathrm { I L + R L }$ baselines and find that JSRL-Random performs quite competitively, as seen in Table 1 and Table 2. However, when considering sample efficiency, Fig. 4 shows that JSRL is better than JSRL-Random in early stages of training, while converged performance is comparable. These same trends hold when we limit the quality of the guide-policy by constraining the initial dataset, as seen in Fig. 3. This suggests that while a curriculum of guide-steps does help sample efficiency, the largest benefits of JSRL may stem from the presence of good visitation states induced by the guide-policy as opposed to the specific order of good visitation states, as suggested by our analysis in Appendix A.4.3. For analyze hyperparameter sensitivity of JSRL-Curriculum and provide the specific implementation of hyperparameters chosen for our experiments in Appendix A.3.
|
| 135 |
+
|
| 136 |
+
# 5.5 GUIDE-POLICY GENERALIZATION
|
| 137 |
+
|
| 138 |
+
In order to study how guide-policies from easier tasks can be used to efficiently explore more difficult tasks, we train an indiscriminate grasping policy and use it as the guide-policy for JSRL on instance grasping (Figure 13). While the performance when using the indiscriminate guide is worse than using the instance guide, the performance for both JSRL versions outperform vanilla Qt-Opt. We also test JSRL ’s generalization capabilities in the D4RL setting. We consider two variations of Ant mazes: ”play” and ”diverse”. In antmaze-\*-play, the agent must reach a fixed set of goal locations from a fixed set of starting locations. In antmaze- $^ *$ -diverse, the agent must reach random goal locations from random starting locations. Thus, the diverse environments present a greater challenge than the corresponding play environments. In Figure 14, we see that JSRL is able to better generalize to unseen goal and starting locations compared to vanilla IQL.
|
| 139 |
+
|
| 140 |
+
# 6 CONCLUSION
|
| 141 |
+
|
| 142 |
+
In this work, we propose Jump-Start Reinforcement Learning (JSRL), a method for leveraging a prior policy of any form to bolster exploration in RL to increase sample efficiency. Our algorithm creates a learning curriculum by rolling in a pre-existing guide-policy, which is then followed by the self-improving exploration policy. The job of the exploration-policy is simplified, as it starts its exploration from states closer to the goal. As the exploration policy improves, the effect of the guidepolicy diminishes, leading to a fully capable RL policy. Importantly, our approach is generic since it can be used with any RL method including value-based RL approaches, which have traditionally struggled in this setting. We showed the benefits of JSRL in a set of offline RL benchmark tasks as well as more challenging vision-based robotic simulation tasks. Our experiments indicate that JSRL is more sample efficient than more complex $\mathrm { I L + R L }$ approaches while being compatible with other approaches’ benefits. In addition, we presented theoretical analysis of an upper bound on the sample complexity of JSRL , which showed from-exponential-to-polynomial improvement in time horizon from non-optimism exploration methods. In the future, we plan on deploying JSRL in the real world in conjunction with various types of guide-policies to further investigate its ability to bootstrap data efficient RL.
|
| 143 |
+
|
| 144 |
+
# REFERENCES
|
| 145 |
+
|
| 146 |
+
Alekh Agarwal, Mikael Henaff, Sham Kakade, and Wen Sun. Pc-pg: Policy cover directed exploration for provable policy gradient learning. arXiv preprint arXiv:2007.08459, 2020.
|
| 147 |
+
|
| 148 |
+
Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. On the theory of policy gradient methods: Optimality, approximation, and distribution shift. Journal of Machine Learning Research, 22(98):1–76, 2021.
|
| 149 |
+
|
| 150 |
+
J Andrew Bagnell. Learning decisions: Robustness, uncertainty, and approximation. Carnegie Mellon University, 2004.
|
| 151 |
+
|
| 152 |
+
James Bagnell, Sham M Kakade, Jeff Schneider, and Andrew Ng. Policy search by dynamic programming. Advances in neural information processing systems, 16, 2003.
|
| 153 |
+
|
| 154 |
+
Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. arXiv preprint arXiv:1905.00360, 2019.
|
| 155 |
+
|
| 156 |
+
Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Misha Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. Advances in neural information processing systems, 34, 2021.
|
| 157 |
+
|
| 158 |
+
Wei Chu, Lihong Li, Lev Reyzin, and Robert Schapire. Contextual bandits with linear payoff functions. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 208–214. JMLR Workshop and Conference Proceedings, 2011.
|
| 159 |
+
|
| 160 |
+
Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O Stanley, and Jeff Clune. First return, then explore. Nature, 590(7847):580–586, 2021.
|
| 161 |
+
|
| 162 |
+
Carlos Florensa, David Held, Markus Wulfmeier, Michael Zhang, and Pieter Abbeel. Reverse curriculum generation for reinforcement learning. In Conference on robot learning, pp. 482–495. PMLR, 2017.
|
| 163 |
+
|
| 164 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4RL: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.
|
| 165 |
+
|
| 166 |
+
Ionel-Alexandru Hosu and Traian Rebedea. Playing atari games with deep reinforcement learning and human checkpoint replay. arXiv preprint arXiv:1607.05077, 2016.
|
| 167 |
+
|
| 168 |
+
Boris Ivanovic, James Harrison, Apoorva Sharma, Mo Chen, and Marco Pavone. Barc: Backward reachability curriculum for robotic reinforcement learning. In 2019 International Conference on Robotics and Automation (ICRA), pp. 15–21. IEEE, 2019.
|
| 169 |
+
|
| 170 |
+
Michael Janner, Qiyang Li, and Sergey Levine. Offline reinforcement learning as one big sequence modeling problem. Advances in neural information processing systems, 34, 2021.
|
| 171 |
+
|
| 172 |
+
Nan Jiang. On value functions and the agent-environment boundary. arXiv preprint arXiv:1905.13341, 2019.
|
| 173 |
+
|
| 174 |
+
Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning, pp. 1704–1713. PMLR, 2017.
|
| 175 |
+
|
| 176 |
+
Chi Jin, Zeyuan Allen-Zhu, Sebastien Bubeck, and Michael I Jordan. Is Q-learning provably efficient? In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 4868–4878, 2018.
|
| 177 |
+
|
| 178 |
+
Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pp. 2137–2143. PMLR, 2020.
|
| 179 |
+
|
| 180 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, volume 2, pp. 267–274, 2002.
|
| 181 |
+
|
| 182 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
|
| 183 |
+
|
| 184 |
+
Jens Kober, Betty Mohler, and Jan Peters. Imitation and reinforcement learning for motor primitives with perceptual coupling. In From motor learning to interaction learning in robots, pp. 209–225. Springer, 2010.
|
| 185 |
+
|
| 186 |
+
Sven Koenig and Reid G Simmons. Complexity analysis of real-time reinforcement learning. In AAAI, pp. 99–107, 1993.
|
| 187 |
+
|
| 188 |
+
Ilya Kostrikov, Ashvin Nair, and Sergey Levine. Offline reinforcement learning with implicit q-learning. arXiv preprint arXiv:2110.06169, 2021.
|
| 189 |
+
|
| 190 |
+
Akshay Krishnamurthy, John Langford, Aleksandrs Slivkins, and Chicheng Zhang. Contextual bandits with continuous actions: Smoothing, zooming, and adapting. In Conference on Learning Theory, pp. 2025–2027. PMLR, 2019.
|
| 191 |
+
|
| 192 |
+
Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
|
| 193 |
+
|
| 194 |
+
John Langford and Tong Zhang. The epoch-greedy algorithm for contextual multi-armed bandits. Advances in neural information processing systems, 20(1):96–1, 2007.
|
| 195 |
+
|
| 196 |
+
Peng Liao, Zhengling Qi, and Susan Murphy. Batch policy learning in average reward Markov decision processes. arXiv preprint arXiv:2007.11771, 2020.
|
| 197 |
+
|
| 198 |
+
Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293–321, 1992.
|
| 199 |
+
|
| 200 |
+
Boyi Liu, Qi Cai, Zhuoran Yang, and Zhaoran Wang. Neural trust region/proximal policy optimization attains globally optimal policy. In Neural Information Processing Systems, 2019.
|
| 201 |
+
|
| 202 |
+
Yao Lu, Karol Hausman, Yevgen Chebotar, Mengyuan Yan, Eric Jang, Alexander Herzog, Ted Xiao, Alex Irpan, Mohi Khansari, Dmitry Kalashnikov, and Sergey Levine. Aw-opt: Learning robotic skills with imitation andreinforcement at scale. In 2021 Conference on Robot Learning (CoRL), 2021.
|
| 203 |
+
|
| 204 |
+
Stephen McAleer, Forest Agostinelli, Alexander Shmakov, and Pierre Baldi. Solving the rubik’s cube without human knowledge. 2019.
|
| 205 |
+
|
| 206 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing Atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 207 |
+
|
| 208 |
+
Ashvin Nair, Bob McGrew, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Overcoming exploration in reinforcement learning with demonstrations. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 6292–6299. IEEE, 2018.
|
| 209 |
+
|
| 210 |
+
Ashvin Nair, Abhishek Gupta, Murtaza Dalal, and Sergey Levine. Awac: Accelerating online reinforcement learning with offline datasets. 2020.
|
| 211 |
+
|
| 212 |
+
Ian Osband and Benjamin Van Roy. Model-based reinforcement learning and the eluder dimension. arXiv preprint arXiv:1406.1853, 2014.
|
| 213 |
+
|
| 214 |
+
Yi Ouyang, Mukul Gagrani, Ashutosh Nayyar, and Rahul Jain. Learning unknown markov decision processes: A thompson sampling approach. arXiv preprint arXiv:1709.04570, 2017.
|
| 215 |
+
|
| 216 |
+
Xue Bin Peng, Pieter Abbeel, Sergey Levine, and Michiel van de Panne. Deepmimic: Exampleguided deep reinforcement learning of physics-based character skills. ACM Trans. Graph., 37(4), July 2018.
|
| 217 |
+
|
| 218 |
+
Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019.
|
| 219 |
+
|
| 220 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017.
|
| 221 |
+
|
| 222 |
+
Paria Rashidinejad, Banghua Zhu, Cong Ma, Jiantao Jiao, and Stuart Russell. Bridging offline reinforcement learning and imitation learning: A tale of pessimism. arXiv preprint arXiv:2103.12021, 2021.
|
| 223 |
+
|
| 224 |
+
Cinjon Resnick, Roberta Raileanu, Sanyam Kapoor, Alexander Peysakhovich, Kyunghyun Cho, and Joan Bruna. Backplay:” man muss immer umkehren”. arXiv preprint arXiv:1807.06919, 2018.
|
| 225 |
+
|
| 226 |
+
Stephane Ross and Drew Bagnell. Efficient reductions for imitation learning. In ´ Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 661–668, 2010.
|
| 227 |
+
|
| 228 |
+
Tim Salimans and Richard Chen. Learning montezuma’s revenge from a single demonstration. arXiv preprint arXiv:1812.03381, 2018.
|
| 229 |
+
|
| 230 |
+
Stefan Schaal et al. Learning from demonstration. Advances in neural information processing systems, pp. 1040–1046, 1997.
|
| 231 |
+
|
| 232 |
+
Bruno Scherrer. Approximate policy iteration schemes: A comparison. In International Conference on Machine Learning, pp. 1314–1322, 2014.
|
| 233 |
+
|
| 234 |
+
David Simchi-Levi and Yunzong Xu. Bypassing the monster: A faster and simpler optimal algorithm for contextual bandits under realizability. Available at SSRN 3562765, 2020.
|
| 235 |
+
|
| 236 |
+
W.D. Smart and L. Pack Kaelbling. Effective reinforcement learning for mobile robots. In Proceedings 2002 IEEE International Conference on Robotics and Automation (Cat. No.02CH37292), volume 4, pp. 3404–3410 vol.4, 2002. doi: 10.1109/ROBOT.2002.1014237.
|
| 237 |
+
|
| 238 |
+
Mel Vecerik, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas Rothorl, Thomas Lampe, and Martin Riedmiller. Leveraging demonstrations for deep ¨ reinforcement learning on robotics problems with sparse rewards, 2018.
|
| 239 |
+
|
| 240 |
+
Lingxiao Wang, Qi Cai, Zhuoran Yang, and Zhaoran Wang. Neural policy gradient methods: Global optimality and rates of convergence. In International Conference on Learning Representations, 2019.
|
| 241 |
+
|
| 242 |
+
Tengyang Xie, Nan Jiang, Huan Wang, Caiming Xiong, and Yu Bai. Policy finetuning: Bridging sample-efficient offline and online reinforcement learning. arXiv preprint arXiv:2106.04895, 2021.
|
| 243 |
+
|
| 244 |
+
Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal policies with low inherent bellman error. In International Conference on Machine Learning, pp. 10978–10989. PMLR, 2020.
|
| 245 |
+
|
| 246 |
+
Junyu Zhang, Alec Koppel, Amrit Singh Bedi, Csaba Szepesvari, and Mengdi Wang. Variational policy gradient method for reinforcement learning with general utilities. arXiv preprint arXiv:2007.02151, 2020a.
|
| 247 |
+
|
| 248 |
+
Zihan Zhang, Yuan Zhou, and Xiangyang Ji. Almost optimal model-free reinforcement learning via reference-advantage decomposition. Advances in Neural Information Processing Systems, 33, 2020b.
|
| 249 |
+
|
| 250 |
+
Qinqing Zheng, Amy Zhang, and Aditya Grover. Online decision transformer. arXiv preprint arXiv:2202.05607, 2022.
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 6: Example ant maze (left) and adroit dexterous manipulation (right) tasks.
|
| 254 |
+
|
| 255 |
+
# A APPENDIX
|
| 256 |
+
|
| 257 |
+
# A.1 EXPERIMENT IMPLEMENTATION DETAILS
|
| 258 |
+
|
| 259 |
+
# A.1.1 D4RL: ANT MAZE AND ADROIT
|
| 260 |
+
|
| 261 |
+
We evaluate on the Ant Maze and Adroit tasks, the most challenging tasks in the D4RL benchmark Fu et al. (2020). For the baseline $\mathrm { I L + R L }$ method comparisons, we utilize implementations and reported results from Kostrikov et al. (2021): we use the open-sourced version of IQL and the reported results from for AWAC, BC, and CQL. While the standard initial offline datasets contain 1m transitions for Ant Maze and 100k transitions for Adroit, we additionally ablate the datasets to evaluate settings with 100, 1k, 10k, and $1 0 0 \mathrm { k }$ transitions provided initially.
|
| 262 |
+
|
| 263 |
+
For the implementation of $\mathrm { I Q L + J S R L }$ , we build upon the open-sourced IQL implementation Kostrikov et al. (2021). First, to obtain a guide-policy, we use IQL without modification for pretraining on the offline dataset. Then, we follow Algorithm 1 when finetuning online and use the IQL online update as the TRAINPOLICY step from Algorithm 1. The IQL neural network architecture follows the original implementation of Kostrikov et al. (2021). For finetuning, we maintain two replay buffers for offline and online transitions. The offline buffer contains all the demonstrations, and the online buffer is FIFO with a fixed capacity of $1 0 0 \mathrm { k }$ transitions. For each gradient update during finetuning, we sample minibatches such that $7 5 \%$ of samples come from the online buffer, and $2 5 \%$ of samples come from the offline buffer.
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 5: In the simulated vision-based robotic grasping tasks, a robot arm must grasp various objects placed in bins in front of it. Full implementation details are described in Appendix A.1.2.
|
| 267 |
+
|
| 268 |
+
Our implementation of $\mathrm { I Q L + J S R L }$ focused on two settings when switching from offline pretraining to online finetuning: Warm-starting and Cold-starting. When Warm-starting, we copy the actor, critic, target critic, and value networks from the pre-trained guide-policy to the exploration-policy. When Cold-starting, we instead start training the exploration-policy from scratch. Results for both variants are shown in Appendix A.2. We find that empirically, the performance of these two variants is highly dependent on task difficulty as well as the quality of the initial offline dataset. When initial datasets are very poor, cold-starting usually performs better; when initial datasets are dense and high-quality, warm-starting seems to perform better. For the results reported in Table 1, we utilize Cold-start results for both IQL $+ .$ JSRL-Curriculum and IQL $^ +$ JSRL-Random.
|
| 269 |
+
|
| 270 |
+
Finally, the curriculum implementation for IQL $+ .$ JSRL used policy evaluation every 10,000 steps to gauge learning progress of the exploration-policy $\pi ^ { e }$ . When the moving average of $\pi ^ { e }$ ’s performance increases over a few samples, we move on to the next curriculum stage. For the IQL $^ { + , }$ JSRL-Random variant, we randomly sample the number of guide-steps for every single episode.
|
| 271 |
+
|
| 272 |
+
# A.1.2 SIMULATED ROBOTIC MANIPULATION
|
| 273 |
+
|
| 274 |
+
We simulate a 7 DoF arm with an over-the-shoulder camera (see Figure 5) Three bins in front of the robot are filled with various simulated objects to be picked up by the robot and a sparse binary reward is assigned if any object is lifted above a bin at the end of an episode. States are represented in the form of RGB images and actions are continuous Cartesian displacements of the gripper’s 3D positions and yaw. In addition, the policy commands discrete gripper open and close actions and may terminate an episode.
|
| 275 |
+
|
| 276 |
+
For the implementation of Qt-Opt+JSRL, we build upon the Qt-Opt algorithm described in Kalashnikov et al. (2018). First, to obtain a guide-policy we use a BC policy trained offline on the provided demonstrations. Then, we follow Algorithm 1 when finetuning online and use the Qt-Opt online update as the TRAINPOLICY step from Algorithm 1. The demonstrations are not added to the QtOpt+JSRLreplay buffer. The Qt-Opt neural network architecture follows the original implementation in Kalashnikov et al. (2018).
|
| 277 |
+
|
| 278 |
+
Finally, similar to Appendix A.1.1, the curriculum implementation for Qt-Opt+JSRLused policy evaluation every 1,000 steps to gauge learning progress of the exploration-policy $\pi ^ { e }$ . When the moving average of $\pi ^ { e }$ ’s performance increases over a few samples, the number of guide-steps is lowered, allowing the JSRL curriculum to continue. For the Qt-Opt+JSRL-Random variant, we randomly sample the number of guide-steps for every single episode.
|
| 279 |
+
|
| 280 |
+
# A.2 ADDITIONAL EXPERIMENTS
|
| 281 |
+
|
| 282 |
+
Table 3: Adroit 100 Offline Transitions
|
| 283 |
+
|
| 284 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">JSRL: Random Switching</td><td colspan="2">JSRL:Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>pen-binary-v0</td><td>27.18 ± 7.77</td><td>29.12±7.62</td><td>25.10 ± 8.73</td><td>24.31 ± 12.05</td><td>18.80 ± 11.63</td></tr><tr><td>door-binary-v0</td><td>0.01 ± 0.04</td><td>0.06± 0.23</td><td>1.45 ± 4.67</td><td>0.40 ± 1.80</td><td>0.84 ± 3.76</td></tr><tr><td>relocate-binary-v0</td><td>0.00± 0.00</td><td>0.00±0.00</td><td>0.00 ±0.00</td><td>0.01 ± 0.06</td><td>0.01 ± 0.03</td></tr></table>
|
| 285 |
+
|
| 286 |
+
Table 4: Adroit 1k Offline Transitions
|
| 287 |
+
|
| 288 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2"> JSRL: Random Switching</td><td colspan="2">JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>pen-binary-v0</td><td>47.23± 3.96</td><td>46.30 ± 6.34</td><td>34.23 ± 7.22</td><td>36.74 ± 7.91</td><td>30.11± 10.22</td></tr><tr><td>door-binary-vO</td><td>0.15 ±0.25</td><td>0.45 ± 1.22</td><td>0.44 ± 0.89</td><td>0.68 ±1.02</td><td>0.53 ± 1.46</td></tr><tr><td>relocate-binary-v0</td><td>0.06± 0.08</td><td>0.01± 0.04</td><td>0.05 ± 0.09</td><td>0.04± 0.10</td><td>0.01± 0.03</td></tr></table>
|
| 289 |
+
|
| 290 |
+
Table 5: Adroit 10k Offline Transitions
|
| 291 |
+
|
| 292 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">IQL+JSRL: Random Switching</td><td colspan="2">IQL+JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>pen-binary-v0</td><td>51.78 ± 3.00</td><td>52.11± 3.30</td><td>38.04±12.71</td><td>44.31 ± 6.22</td><td>38.41 ± 11.18</td></tr><tr><td>door-binary-v0</td><td>10.59 ± 11.78</td><td>22.32 ± 11.61</td><td>5.08 ± 7.60</td><td>4.33 ± 8.38</td><td>10.61 ± 14.11</td></tr><tr><td>relocate-binary-v0</td><td>1.99 ± 3.15</td><td>0.50 ± 0.65</td><td>4.39 ±8.17</td><td>0.55 ± 1.60</td><td>0.19 ± 0.32</td></tr></table>
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Naive Bootstrapping (1ook Samples,look Warm up Steps):antmaze-medium-diverse-v0
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Naive Bootstrapping (l0ok Samples,look Warm up Steps):antmaze-large-diverse-v0
|
| 301 |
+
Figure 7: A policy is first pre-trained on $1 0 0 \mathrm { k }$ offline transitions. Negative steps correspond to this pre-training. We then roll out the pre-trained policy for $1 0 0 \mathrm { k }$ timesteps, and use these online samples to warm-up the critic network. After warming up the critic, we continue with actor-critic fine-tuning with the pre-trained policy and the warmed up critic.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Naive Bootstrapping (lm Samples,look Warm up Steps):antmaze-medium-diverse-v0
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Naive Bootstrapping (lm Samples,1ook Warm up Steps):antmaze-large-diverse-v0
|
| 310 |
+
Figure 8: A policy is first pre-trained on one million offline transitions. Negative steps correspond to this pre-training. We then roll out the pre-trained policy for $1 0 0 \mathrm { k }$ timesteps, and use these online samples to warm-up the critic network. After warming up the critic, we continue with actor-critic fine-tuning with the pre-trained policy and the warmed up critic. Allowing the critic to warm up provides a stronger baseline to compare JSRL to, since in the case where we have a policy, but no value function, we could use that policy to train a value function.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 9: QT-Opt+JSRL using guide-policies trained from-scratch online vs. guide-policies trained with BC on demonstration data in the indiscriminate grasping environment. For each experiment, the guide-policy trained offline and the guide-policy trained online are of equivalent performance.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 10: Comparing $\mathrm { I L + R L }$ methods with JSRL on the Indiscriminate Grasping task while adjusting the initial demonstrations available. In addition, compare the sample efficiency
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 11: Comparing $\mathrm { I L + R L }$ methods with JSRL on the Instance Grasping task while adjusting the initial demonstrations available.
|
| 320 |
+
|
| 321 |
+
Table 6: Adroit 100k Offline Transitions
|
| 322 |
+
|
| 323 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">IQL+JSRL: Random Switching</td><td colspan="2">IQL+JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>pen-binary-v0</td><td>60.06 ± 2.94</td><td>60.58± 2.73</td><td>62.81 ± 2.79</td><td>62.59±3.62</td><td>64.96± 2.87</td></tr><tr><td>door-binary-v0</td><td>27.23 ± 8.90</td><td>24.27 ± 11.47</td><td>38.70 ± 17.25</td><td>28.51 ± 19.54</td><td>50.21 ± 2.50</td></tr><tr><td>relocate-binary-v0</td><td>5.09 ± 4.39</td><td>4.69 ± 4.16</td><td>11.18 ± 11.69</td><td>0.04 ± 0.14</td><td>8.59 ± 7.70</td></tr></table>
|
| 324 |
+
|
| 325 |
+
Table 7: Ant Maze 1k Offline Transitions
|
| 326 |
+
|
| 327 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">IQL+JSRL: Random Switching</td><td colspan="2">IQL+JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>antmaze-umaze-v0</td><td>0.10± 0.31</td><td>10.35 ± 9.59</td><td>0.40± 0.94</td><td>15.60± 19.87</td><td>0.20±0.52</td></tr><tr><td>antmaze-umaze-diverse-v0</td><td>0.10 ± 0.31</td><td>1.90 ± 4.81</td><td>0.45 ± 1.23</td><td>3.05 ± 7.99</td><td>0.00 ±0.00</td></tr><tr><td>antmaze-medium-play-v0</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ±0.00</td></tr><tr><td>antmaze-medium-diverse-v0</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ±0.00</td></tr><tr><td>antmaze-large-play-v0</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ±0.00</td></tr><tr><td>antmaze-large-diverse-vO</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>0.00 ± 0.00</td><td>0.00±0.00</td><td>0.00 ±0.00</td></tr></table>
|
| 328 |
+
|
| 329 |
+
Table 8: Ant Maze 10k Offline Transitions
|
| 330 |
+
|
| 331 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">IQL+JSRL: Random Switching</td><td colspan="2">IQL+JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>antmaze-umaze-v0</td><td>56.00±13.70</td><td>52.70±26.71</td><td>57.25 ± 15.86</td><td>71.70±14.49</td><td>55.50 ± 12.51</td></tr><tr><td>antmaze-umaze-diverse-v0</td><td>23.05 ± 10.96</td><td>39.35 ± 20.07</td><td>26.80 ± 12.03</td><td>72.55 ± 12.18</td><td>33.10 ± 10.74</td></tr><tr><td>antmaze-medium-play-v0</td><td>0.05 ±0.22</td><td>3.75± 4.97</td><td>0.00 ±0.00</td><td>16.65 ± 12.93</td><td>0.10 ± 0.31</td></tr><tr><td>antmaze-medium-diverse-v0</td><td>0.00±0.00</td><td>5.10 ± 8.16</td><td>0.00 ± 0.00</td><td>16.60 ± 11.71</td><td>0.00 ±0.00</td></tr><tr><td>antmaze-large-play-v0</td><td>0.00 ±0.00</td><td>0.00 ± 0.00</td><td>0.00 ± 0.00</td><td>0.05 ± 0.22</td><td>0.00 ±0.00</td></tr><tr><td>antmaze-large-diverse-vO</td><td>0.00±0.00</td><td>0.00 ±0.00</td><td>0.00±0.00</td><td>0.05 ± 0.22</td><td>0.00 ±0.00</td></tr></table>
|
| 332 |
+
|
| 333 |
+
Table 9: Ant Maze 100k Offline Transitions
|
| 334 |
+
|
| 335 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">IQL+JSRL: Random Switching</td><td colspan="2">IQL+JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>antmaze-umaze-v0</td><td>73.35 ± 22.58</td><td>92.05±2.76</td><td>71.35 ± 26.36</td><td>93.65± 4.21</td><td>74.15 ± 25.62</td></tr><tr><td>antmaze-umaze-diverse-v0</td><td>40.95 ± 13.34</td><td>82.25 ±14.20</td><td>38.80 ± 21.96</td><td>81.30 ± 23.04</td><td>29.85 ± 23.08</td></tr><tr><td> antmaze-medium-play-v0</td><td>9.55 ± 14.42</td><td>56.15 ± 28.78</td><td>22.15 ± 29.82</td><td>86.85 ± 3.67</td><td>32.80 ± 32.64</td></tr><tr><td>antmaze-medium-diverse-v0</td><td>14.05 ± 13.30</td><td>67.00 ± 17.43</td><td>15.75 ± 16.48</td><td>81.50 ±18.80</td><td>15.70 ± 17.69</td></tr><tr><td>antmaze-large-play-vo</td><td>0.35 ± 0.93</td><td>17.70 ± 13.35</td><td>0.45 ± 1.19</td><td>36.30 ± 16.41</td><td>2.55 ±8.19</td></tr><tr><td>antmaze-large-diverse-v0</td><td>1.25 ± 2.31</td><td>22.40± 15.44</td><td>0.75 ± 1.16</td><td>34.35 ± 22.97</td><td>4.10 ± 10.37</td></tr></table>
|
| 336 |
+
|
| 337 |
+
Table 10: Ant Maze 1m Offline Transitions
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="2">IQL+JSRL: Random Switching</td><td colspan="2">IQL+JSRL: Curriculum</td><td rowspan="2">IQL</td></tr><tr><td>Warm-start</td><td>Cold-start</td><td>Warm-start</td><td>Cold-start</td></tr><tr><td>antmaze-umaze-v0</td><td>95.35 ± 2.23</td><td>94.95 ± 2.95</td><td>96.70±1.69</td><td>98.05±1.43</td><td>97.60± 3.19</td></tr><tr><td>antmaze-umaze-diverse-v0</td><td>65.95 ± 27.00</td><td>89.80 ±10.00</td><td>59.95 ± 33.90</td><td>88.55 ± 16.37</td><td>52.95 ± 30.48</td></tr><tr><td>antmaze-medium-play-v0</td><td>82.25 ± 4.88</td><td>87.80 ± 4.20</td><td>92.20 ± 2.84</td><td>91.05 ± 3.86</td><td>92.75 ± 2.73</td></tr><tr><td>antmaze-medium-diverse-v0</td><td>83.45 ± 4.64</td><td>86.25 ± 5.94</td><td>91.65 ± 2.98</td><td>93.05 ±3.10</td><td>92.40 ± 4.50</td></tr><tr><td>antmaze-large-play-v0</td><td>50.35 ± 9.74</td><td>48.60 ± 10.01</td><td>72.15 ±9.66</td><td>62.85 ± 11.31</td><td>62.35 ± 12.42</td></tr><tr><td>antmaze-large-diverse-v0</td><td>56.80 ± 9.15</td><td>58.30 ± 6.54</td><td>70.55 ± 17.43</td><td>68.25 ±8.76</td><td>68.25 ± 8.85</td></tr></table>
|
| 340 |
+
|
| 341 |
+
# A.3 HYPERPARAMETERS OF JSRL
|
| 342 |
+
|
| 343 |
+
JSRL introduces three hyperparameters: (1) the initial number of guide-steps that the guide-policy takes at the beginning of fine-tuning $( H _ { 1 } )$ , (2) the number of curriculum stages $( n )$ , and (3) the
|
| 344 |
+
|
| 345 |
+
<table><tr><td rowspan=2 colspan=2></td><td rowspan=1 colspan=3>Moving Average Horizon</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=3 colspan=1>Tolerance</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>79.66</td><td rowspan=1 colspan=1>56.66</td><td rowspan=1 colspan=1>74.83</td></tr><tr><td rowspan=1 colspan=1>5%</td><td rowspan=1 colspan=1>51.12</td><td rowspan=1 colspan=1>78.8</td><td rowspan=1 colspan=1>79.78</td></tr><tr><td rowspan=1 colspan=1>15%</td><td rowspan=1 colspan=1>56.41</td><td rowspan=1 colspan=1>47.46</td><td rowspan=1 colspan=1>59.52</td></tr></table>
|
| 346 |
+
|
| 347 |
+
Table 11: We fix the number of curriculum stages at $n = 1 0$ for antmaze-large-diverse-v0, then vary the moving average horizon and tolerance. Each number is the average reward after 5 million training steps of one seed. As tolerance increases, the reward decreases since curriculum stages are not fully mastered before moving on.
|
| 348 |
+
|
| 349 |
+
performance threshold that decides whether to move on to the next curriculum stage $( \beta )$ . Minimal tuning was done for these hyperparameters.
|
| 350 |
+
|
| 351 |
+
IQL $+ ,$ JSRL: For offline pre-training and online fine-tuning, we use the same exact hyperparameters as the default implementation of IQL [6].
|
| 352 |
+
|
| 353 |
+
Our reported results for vanilla IQL do differ from the original paper, but this is due to us running more random seeds (20 vs. 5), which we also consulted with the authors of IQL. For Indiscriminate and Instance Grasping experiments we utilize the same environment, task definition, and training hyperparameters as Qt-Opt and AW-Opt.
|
| 354 |
+
|
| 355 |
+
# Initial Number of Guide-Steps: $H _ { 1 }$
|
| 356 |
+
|
| 357 |
+
For all $\mathrm { X } + .$ JSRLexperiments, we train the guide-policy (IQL for D4RL and BC for grasping) then evaluate it to determine how many steps it takes to solve the task on average. For D4RL, we evaluate it over one hundred episodes. For grasping, we plot training metrics and observe the average episode length after convergence. This average is then used as the initial number of guide-steps. Since $H _ { 1 }$ is directly computed, no hyperparameter search is required.
|
| 358 |
+
|
| 359 |
+
# Curriculum Stages: $n$
|
| 360 |
+
|
| 361 |
+
Once the number of curriculum stages was chosen, we computed the number of steps between curriculum stages as on an appropriate n $\textstyle { \frac { H _ { 1 } } { n } }$ . Then ber of $h$ varies from urriculum st $\begin{array} { r } { H _ { 1 } - \frac { H _ { 1 } } { n } , H _ { 1 } - 2 \frac { \hat { H _ { 1 } } } { n } , \dots , H _ { 1 } - ( n - 1 ) \frac { H _ { 1 } } { n } , \hat { 0 } . } \end{array}$ , $n$ $\textstyle { \frac { H _ { 1 } } { n } }$ $H _ { i } \mathrm { ~ - ~ } H _ { i - 1 } )$ starting from $n = H$ , until the curriculum became too difficult for the agent to overcome (i.e., the agent becomes ”stuck” on a curriculum stage). We then used the minimal value of $n$ for which the agent could still solve all stages. In practice, we did not try every value between $H$ and 1, but chose a very small subset of values to test in this range.
|
| 362 |
+
|
| 363 |
+
Performance Threshold $\beta$ : For both grasping and D4RL tasks, we evaluated $\pi$ between fixed intervals and computed the moving average of these evaluations (5 for D4RL, 3 for grasping). If the current moving average is close enough to the best previous moving average, then we move from curriculum stage $i$ to $i + 1$ . To define ”close enough”, we set a tolerance that let the agent move to the next stage if the current moving average was within some percentage of the previous best. The tolerance and moving average horizon were our ” $\ ' \beta '$ , a generic parameter that is flexible based on how costly it is to evaluate the performance of $\pi$ . In Figure 12 and Table 11, we perform small studies to determine how varying $\beta$ affects JSRL’s performance.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 12: Ablation study for $\beta$ in the indiscriminate grasping environment. We find that the moving average horizon does not have a large impact on performance, but larger tolerance slightly hurts performance. A larger tolerance around the best moving average makes it easier for JSRL to move on to the next curriculum stage. This means that experiments with a larger tolerance could potentially move on to the next curriculum stage before JSRL masters the previous curriculum stage, leading to lower performance.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 13: First, an indiscriminate grasping policy is trained using online QT-Opt to $90 \%$ indiscriminate grasping success and $5 \%$ instance grasping success (when the policy happens to randomly pick the correct object). We compare this $90 \%$ indiscriminate grasping guide policy with a $8 . 4 \%$ success instance grasping guide policy trained with BC on 2k demonstrations. While the performance for using the indiscriminate guide is slightly worse than using the instance guide, the performance for both JSRL versions are much better than vanilla Qt-Opt.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 14: First, a policy is trained offline on a simpler antmaze-\*-play environment for one million steps (depicted by negative steps). This policy is then used for initializing fine-tuning (depicted by positive steps) in a more complex antmaze-\*-diverse environment. We find that $\mathrm { I Q L + J S R L }$ can better generalize to the more difficult antmazes compared to IQL even when using guide-policies trained on different tasks.
|
| 373 |
+
|
| 374 |
+
# A.4 THEORETICAL ANALYSIS FOR JSRL
|
| 375 |
+
|
| 376 |
+
# A.4.1 SETUP AND NOTATIONS
|
| 377 |
+
|
| 378 |
+
Consider a finite-horizon time-inhomogeneous MDP with a fixed total horizon $H$ and bounded reward $r _ { h } \in [ 0 , 1 ] , \forall h \in [ H ]$ . The transition of state-action pair $( s , a )$ in step $h$ is denoted as $\mathbb { P } _ { h } ( \cdot \mid s , a )$ . Assume that at step 0, the initial state follows a distribution $p _ { 0 }$ .
|
| 379 |
+
|
| 380 |
+
For simplicity, we use $\pi$ to denote the policy for $H$ steps $\pi = \{ \pi _ { h } \} _ { h = 1 } ^ { H }$ . We let $d _ { h } ^ { \pi } ( s )$ be the marginalized state occupancy distribution in step $h$ when we follow policy $\pi$ .
|
| 381 |
+
|
| 382 |
+
# A.4.2 PROOF SKETCH FOR THEOREM 4.1
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
Figure 15: Lower bound instance: combination lock
|
| 386 |
+
|
| 387 |
+
We construct a special instance, combination lock MDP, which is depicted in Figure 15 and works as follows. The agent can only arrive at the red state $s _ { h + 1 } ^ { \star }$ in step $h + 1$ when it takes action $a _ { h } ^ { \star }$ at the red state $s _ { h } ^ { \star }$ at step $h$ . Once it leaves state $s _ { h } ^ { \star }$ , the agent stays in the blue states and can never get back to red states again. At the last layer, one receives reward 1 when the agent is at state $s _ { H } ^ { \star }$ and takes action $a _ { H } ^ { \star }$ . For all other cases, the reward is 0. In exploration from scratch, before seeing $\bar { \boldsymbol { r } } _ { H } ( s ^ { \star } , a ^ { \star } )$ , one only sees reward 0. Thus 0-initialized $\epsilon$ -greedy always takes each action with probability $1 / 2$ . The probability of arriving at state $s _ { H } ^ { \star }$ with uniform actions is $1 / 2 ^ { H }$ , which means that one needs at least $2 ^ { H }$ samples in expectation to see $r _ { H } ( s ^ { \star } , a ^ { \star } )$ .
|
| 388 |
+
|
| 389 |
+
# A.4.3 UPPER BOUND OF JSRL
|
| 390 |
+
|
| 391 |
+
In this section, we restate Theorem 4.3 and its assumption in a formal way. First, we make assumption on the quality of the guide-policy, which is the key assumption that helps improve the exploration from exponential to polynomial sample complexity. One of the weakest assumption in theory of offline learning literature is the single policy concentratability coefficient Rashidinejad et al. (2021); Xie et al. $( 2 0 2 \mathsf { \bar { 1 } } ) ^ { 1 }$ . Concretely, they assume that there exists a guide-policy $\pi ^ { g }$ such that
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\operatorname* { s u p } _ { s , a , h } { \frac { d _ { h } ^ { \pi ^ { \star } } ( s , a ) } { d _ { h } ^ { \pi ^ { g } } ( s , a ) } } \leq C .
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
This means that for any state action pair that the optimal policy visits, the guide-policy shall also visit with certain probability.
|
| 398 |
+
|
| 399 |
+
In the analysis, we impose a strictly weaker assumption. We only require that the guide-policy visits all good states in the feature space instead of all good state and action pairs.
|
| 400 |
+
|
| 401 |
+
Assumption A.1 (Quality of guide-policy $\pi ^ { g }$ ). Assume that the state is parametrized by some feature mapping $\phi : \mathcal { S } \mathbb { R } ^ { d }$ such that for any policy $\pi$ , $Q ^ { \pi } ( s , a )$ and $\pi ( s )$ depends on $s$ only through $\phi ( s )$ . We assume that in the feature space, the guide-policy $\pi ^ { g }$ cover the states visited by the optimal policy:
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\operatorname* { s u p } _ { s , h } { \frac { d _ { h } ^ { \pi ^ { \star } } ( \phi ( s ) ) } { d _ { h } ^ { \pi ^ { g } } ( \phi ( s ) ) } } \leq C .
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
Note that for the tabular case when $\phi ( s ) = s$ , one can easily prove that equation 1 implies Assumption A.1. In real robotics, the assumption implies that the guide-policy at least sees the features of the good states that the optimal policy also see. However, the guide-policy can be arbitrarily bad in terms of choosing actions.
|
| 408 |
+
|
| 409 |
+
Before we proceed to the main theorem, we need to impose another assumption on the performance of the exploration step, which requires to find an exploration algorithm that performs well in the case of $H = 1$ (contextual bandit).
|
| 410 |
+
|
| 411 |
+
Assumption A.2 (Performance guarantee for ExplorationOracle CB). In (online) contextual bandit with stochastic context $s \sim p _ { 0 }$ and stochastic reward $r ( s , a )$ supported on $[ 0 , R ]$ , there exists some ExplorationOracle CB which executes a policy $\pi ^ { t }$ in each round $t \in [ T ]$ , such that the total regret is bounded:
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\sum _ { t = 1 } ^ { T } \mathbb { E } _ { s \sim p _ { 0 } } [ r ( s , \pi ^ { \star } ( s ) ) - r ( s , \pi ^ { t } ( s ) ) ] \leq f ( T , R ) .
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
This assumption is usually given for free since it is implied by a rich literature in contextual bandit, including tabular Langford $\&$ Zhang (2007), linear Chu et al. (2011), general function approximation with finite action Simchi-Levi & Xu (2020), neural networks and continuous actions Krishnamurthy et al. (2019), either via optimism-based methods (UCB, Thompson sampling etc.) or non-optimismbased methods $\epsilon$ -greedy, inverse gap weighting etc.).
|
| 418 |
+
|
| 419 |
+
Now we are ready to present the algorithm and guarantee. The JSRL algorithm is summarized in Algorithm 1. For the convenience of theoretical analysis, we make some simplification by only considering curriculum case, replacing the step of EvaluatePolicy with a fixed iteration time, and set the TrainPolicy in Algorithm 1 as follows: at iteration $h$ , fix the policy $\pi _ { h + 1 : H }$ unchanged, set $\pi _ { h } =$ ExplorationOracle ${ \mathrm { . C B } } ( { \mathcal { D } } )$ , where the reward for contextual bandit is the cumulative reward $\textstyle \sum _ { t = h : H } r _ { t }$ . For concreteness, we show the pseudocode for the algorithm below.
|
| 420 |
+
|
| 421 |
+
1: Input: guide-policy $\pi ^ { g }$ , total time step $T$ , horizon length $H$
|
| 422 |
+
2: Initialize exploration policy $\pi = \pi ^ { g }$ , online dataset $\mathcal { D } = \varnothing$ .
|
| 423 |
+
3: for iteration $h = H - 1 , H - 2 , \cdot \cdot \cdot , 0$ do
|
| 424 |
+
4: Execute ExplorationOracle CB for $\lceil T / H \rceil$ rounds, with the state-aciton-reward tuple for contextual bandit derived as follows: at round $t$ , first gather a trajectory $\{ ( s _ { l } ^ { t } , a _ { l } ^ { t } , s _ { l + 1 } ^ { t } , r _ { l } ^ { t } ) \} _ { l \in [ H - 1 ] }$ by rolling out policy $\pi$ then take $\{ s _ { h } ^ { t } , a _ { h } ^ { t } , \textstyle \sum _ { l = h } ^ { H } r _ { l } ^ { t } \}$ a the state-action-reward samples for $\pi ^ { t }$ $t$
|
| 425 |
+
5: Set policy $\pi _ { h } = \mathsf { U n i f } ( \{ \pi ^ { t } \} _ { t = 1 } ^ { T } \} )$ .
|
| 426 |
+
6: end for
|
| 427 |
+
|
| 428 |
+
Note that the Algorithm 2 is a special case of Algorithm 1 where the policies after current step $h$ is fixed. This coincides with the idea of Policy Search by Dynamic Programming (PSDP) in Bagnell et al. (2003). Notably, although PSDP is mainly motivated from policy learning while JSRL is motivated from efficient online exploration and fine-tuning, the following theorem follows mostly the same line as that in Bagnell (2004). For completeness we provide the performance guarantee of the algorithm as follows.
|
| 429 |
+
|
| 430 |
+
Theorem A.3. Under Assumption A.1 and A.2, the JSRL in Algorithm 2 guarantees that after $T$ rounds,
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\mathbb { E } _ { s _ { 0 } \sim p _ { 0 } } [ V _ { 0 } ^ { * } ( s _ { 0 } ) - V _ { 0 } ^ { \pi } ( s _ { 0 } ) ] \le C \cdot \sum _ { h = 0 } ^ { H - 1 } f ( T / H , H - h ) .
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Theorem A.3 is quite general, and it depends on the choice of the exploration oracle. Below we give concrete results for tabular RL and RL with function approximation.
|
| 437 |
+
|
| 438 |
+
Corollary A.4. For tabular case, when we take ExplorationOracle CB as $\epsilon$ -greedy, the rate achieved is $O ( C H ^ { 7 / 3 } S ^ { 1 / 3 } A ^ { 1 / 3 } / T ^ { 1 / 3 } )$ ; when we take ExplorationOracle CB as FALCON+, the rate becomes $O ( C H ^ { 5 / 2 } S ^ { 1 / 2 } A / T ^ { 1 / 2 } )$ . Here $S$ can be relaxed to the maximum state size that $\pi ^ { g }$ visits among all steps.
|
| 439 |
+
|
| 440 |
+
The result above implies a polynomial sample complexity when combined with non-optimism exploration techniques, including $\epsilon$ -greedy Langford $\&$ Zhang (2007) and $\mathrm { F A L C O N + }$ Simchi-Levi & Xu (2020). In contrast, they both suffer from a curse of horizon without such a guide-policy.
|
| 441 |
+
|
| 442 |
+
Next, we move to RL with general function approximation.
|
| 443 |
+
|
| 444 |
+
Corollary A.5. For general function approximation, when we take ExplorationOracle CB as FAL$C O N +$ , the rate becomes $\begin{array} { r } { \tilde { O } ( \tilde { C } \sum _ { h = 1 } ^ { H } \sqrt { A \mathcal { E } _ { \mathcal { F } } ( T / H ) } ) } \end{array}$ under the following assumption.
|
| 445 |
+
|
| 446 |
+
Assumption A.6. Let $\pi$ be an arbitrary policy. Given $n$ training trajectories of the form $\{ ( s _ { h } ^ { j } , a _ { h } ^ { j } , s _ { h + 1 } ^ { j } , r _ { h } ^ { j } ) \} _ { j \in [ n ] , h \in [ H ] }$ drawn from following policy $\pi$ in a given MDP, according to $\begin{array} { r l } { s _ { h } ^ { j } \sim d _ { h } ^ { \pi } , a _ { h } ^ { j } | s _ { h } ^ { j } \sim \pi _ { h } ( s _ { h } ) , r _ { h } ^ { j } | ( s _ { h } ^ { j } , a _ { h } ^ { j } ) \sim R _ { h } ( s _ { h } ^ { j } , a _ { h } ^ { j } ) , s _ { h + 1 } ^ { j } | ( s _ { h } ^ { j } , a _ { h } ^ { j } ) \sim \mathbb { P } _ { h } ( \cdot | s _ { h } ^ { j } , a _ { h } ^ { j } ) , } \end{array}$ there exists some offline regression oracle which returns a family of predictors $\widehat { Q } _ { h } : S \times \mathcal { A } \mathbb { R } , h \in [ H ]$ , such that for any $h \in [ H ]$ , we have
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\begin{array} { r } { \mathbb { E } \left[ ( \widehat { Q } _ { h } ( s , a ) - Q _ { h } ^ { \pi } ( s , a ) ) ^ { 2 } \right] \leq \mathcal { E } _ { \mathcal { F } } ( n ) . } \end{array}
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
As is shown in Simchi-Levi & Xu (2020), this assumption on offline regression oracle implies our Assumption on regret bound in Assumption A.2. When $\mathcal { E } _ { \mathcal { F } }$ is a polynomial function, the above rate matches the worst-case lower bound for contextual bandit in Simchi-Levi & $\mathrm { X u }$ (2020), up to a factor of $C \cdot \mathrm { p o l y } ( H )$ .
|
| 453 |
+
|
| 454 |
+
The results above show that under Assumption A.1, one can achieve polynomial and sometimes near-optimal sample complexity up to polynomial factors of $H$ without applying Bellman update, but only with a contextual bandit oracle. In practice, we run Q-learning based exploration oracle, which may be more robust to the violation of assumptions. We leave the analysis for Q-learning based exploration oracle as a future work.
|
| 455 |
+
|
| 456 |
+
Remark A.7. The result generalizes to and is adaptive to the case when one has time-inhomogeneous $C$ , i.e.
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\forall h \in [ H ] , \operatorname* { s u p } _ { s } \frac { d _ { h } ^ { \pi ^ { \star } } ( \phi ( s ) ) } { d _ { h } ^ { \pi ^ { g } } ( \phi ( s ) ) } \leq C ( h ) .
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
The rate becomes PH−1h=0 C(h) · f (T /H, H − h) in this case.
|
| 463 |
+
|
| 464 |
+
In our current analysis, we heavily rely on the assumption of visitation and applied contextual bandit based exploration techniques. In our experiments, we indeed run a Q-learning based exploration algorithm which also explores the succinct states after we roll out the guide-policy. This also suggests why setting $K > 1$ and even random switching in Algorithm 1 might achieve better performance than the case of $K = 1$ . We conjecture that with a Q-learning based exploration algorithm, JSRL still works even when Assumption A.1 only holds partially. We leave the related analysis for JSRL with a Q-learning based exploration oracle for future work.
|
| 465 |
+
|
| 466 |
+
# A.4.4 PROOF OF THEOREM A.3 AND COROLLARIES
|
| 467 |
+
|
| 468 |
+
Proof. The analysis follows a same line as Bagnell (2004). For completeness we include here. By the performance difference lemma Kakade & Langford (2002), one has
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
\mathbb { E } _ { s _ { 0 } \sim d _ { 0 } } [ V _ { 0 } ^ { \star } ( s _ { 0 } ) - V _ { 0 } ^ { \pi } ( s _ { 0 } ) ] = \sum _ { h = 0 } ^ { H - 1 } \mathbb { E } _ { s \sim d _ { h } ^ { \star } } [ Q _ { h } ^ { \pi } ( s , \pi _ { h } ^ { \star } ( s ) ) - Q _ { h } ^ { \pi } ( s , \pi _ { h } ( s ) ) ] .
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
At iteration $h$ , the algorithm adopts a policy $\pi$ with $\pi _ { l } = \pi _ { l } ^ { g } , \forall l < h$ , and fixed learned $\pi _ { l }$ for $l > h$ . The algorithm only updates $\pi _ { h }$ during this iteration. By taking the reward as $\textstyle \sum _ { l = h } ^ { H } r _ { l }$ , this presents a contextual bandit problem with initial state distribution $d _ { h } ^ { \pi ^ { g } }$ , reward bounded in between $[ 0 , H - h ]$ , and the expected reward for taking state action $( s , a )$ is $Q _ { h } ^ { \pi } ( s , a )$ . Let $\hat { \pi } _ { h } ^ { \star }$ be the optimal policy for this contextual bandit problem. From Assumption A.2, we know that after $T / H$ rounds at iteration $h$ ,
|
| 475 |
+
|
| 476 |
+
one has
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
\begin{array} { r l } { \displaystyle \sum _ { \iota = 0 } ^ { I - 1 } \mathbb { E } _ { s \sim d _ { h } ^ { \star } } \big [ Q _ { h } ^ { \pi } \big ( s , \pi _ { h } ^ { \star } ( s ) \big ) - Q _ { h } ^ { \pi } ( s , \pi _ { h } ( s ) ) \big ] \overset { ( i ) } { \le } \displaystyle \sum _ { h = 0 } ^ { H - 1 } \mathbb { E } _ { s \sim d _ { h } ^ { \star } } \big [ Q _ { h } ^ { \pi } \big ( s , \hat { \pi } _ { h } ^ { k } ( s ) \big ) - Q _ { h } ^ { \pi } \big ( s , \pi _ { h } ( s ) \big ) \big ] } & { } \\ { \displaystyle } & { \overset { ( i i ) } { = } \displaystyle \sum _ { h = 0 } ^ { H - 1 } \mathbb { E } _ { s \sim d _ { h } ^ { \star } } \big [ Q _ { h } ^ { \pi } \big ( \phi \big ( s \big ) , \hat { \pi } _ { h } ^ { \star } ( \phi ( s ) \big ) \big ) - Q _ { h } ^ { \pi } \big ( \phi ( s ) , \pi _ { h } ( \phi ( s ) \big ) \big ) } \\ & { \overset { ( i i i ) } { \le } C \cdot \displaystyle \sum _ { h = 0 } ^ { H - 1 } \mathbb { E } _ { s \sim d _ { h } ^ { \star \nu } } \big [ Q _ { h } ^ { \pi } \big ( \phi ( s ) , \hat { \pi } _ { h } ^ { \star } ( \phi ( s ) \big ) \big ) - Q _ { h } ^ { \pi } \big ( \phi ( s ) , \pi _ { h } ( \phi ( s ) \big ) \big ) } \\ & { \overset { ( i i i ) } { \le } C \cdot \displaystyle \sum _ { h = 0 } ^ { H - 1 } \mathbb { E } _ { s \sim d _ { h } ^ { \nu } } \big [ Q _ { h } ^ { \pi } \big ( \phi ( s ) , \hat { \pi } _ { h } ^ { \star } ( \phi ( s ) \big ) \big ) - Q _ { h } ^ { \pi } \big ( \phi ( s ) , \pi _ { h } ( s ) \big ) \big ] } \\ & { \overset { ( i i i ) } { \le } C \cdot \displaystyle \sum _ { h = 0 } ^ { H - 1 } f ( T / H , H - h ) . } \end{array}
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Here the inequality (i) uses the fact that $\hat { \pi } ^ { \star }$ is the optimal policy for the contextual bandit problem. The equality (ii) uses the fact that $Q , \pi$ depends on $s$ only through $\phi ( s )$ . The inequality (iii) comes from Assumption A.1. The inequality (iv) comes from Assumption A.2. From Equation equation 2 we know that the conclusion holds true.
|
| 483 |
+
|
| 484 |
+
When ExplorationOracle CB is $\epsilon$ -greedy, the rate in Assumption A.2 becomes $~ f ( T , R ) ~ =$ $R ~ \cdot ~ ( ( S A / T ) ^ { 1 / 3 } )$ Langford & Zhang (2007), which gives the rate for JSRL as $O ( C H ^ { 7 / 3 } S ^ { 1 / 3 } A ^ { 1 / 3 } / T ^ { 1 / 3 } )$ ; when we take ExplorationOracle CB as $\mathrm { F A L C O N + }$ in tabular case, the rate in Assumption A.2 becomes $f ( T , R ) = R \cdot ( ( S A ^ { 2 } / T ) ^ { 1 / 2 } )$ Simchi-Levi & Xu (2020), the final rate for JSRL becomes $O ( C H ^ { 5 / 2 } S ^ { 1 / 2 } A / T ^ { 1 / 2 } )$ . When we take ExplorationOracle CB as FAL$\mathrm { C O N + }$ proximation under Assumption A., the final rate for JSRL becomes becomes. $f ( T , R ) = R \cdot ( A \mathcal { E _ { F } } ( T ) ) ^ { 1 / 2 }$ $\begin{array} { r } { \tilde { O } ( C \sum _ { h = 1 } ^ { H } \sqrt { A \mathcal { E } _ { \mathcal { F } } ( T / H ) } ) } \end{array}$
|
parse/dev/QwejPcX96r/QwejPcX96r_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/QwejPcX96r/QwejPcX96r_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/S7Evzt9uit3/S7Evzt9uit3_content_list.json
ADDED
|
@@ -0,0 +1,1182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learning ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
189,
|
| 8 |
+
122,
|
| 9 |
+
810,
|
| 10 |
+
172
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Weixin Liang⇤ Stanford University wxliang@stanford.edu ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
207,
|
| 19 |
+
226,
|
| 20 |
+
380,
|
| 21 |
+
267
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "Yuhui Zhang ⇤ Stanford University yuhuiz@stanford.edu ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
419,
|
| 30 |
+
226,
|
| 31 |
+
586,
|
| 32 |
+
267
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "Yongchan Kwon ⇤ Columbia University yk3012@columbia.edu ",
|
| 39 |
+
"bbox": [
|
| 40 |
+
624,
|
| 41 |
+
226,
|
| 42 |
+
790,
|
| 43 |
+
267
|
| 44 |
+
],
|
| 45 |
+
"page_idx": 0
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"type": "text",
|
| 49 |
+
"text": "Serena Yeung Stanford University syyeung@stanford.edu ",
|
| 50 |
+
"bbox": [
|
| 51 |
+
276,
|
| 52 |
+
289,
|
| 53 |
+
447,
|
| 54 |
+
332
|
| 55 |
+
],
|
| 56 |
+
"page_idx": 0
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"type": "text",
|
| 60 |
+
"text": "James Zou Stanford University jamesz@stanford.edu ",
|
| 61 |
+
"bbox": [
|
| 62 |
+
557,
|
| 63 |
+
290,
|
| 64 |
+
722,
|
| 65 |
+
330
|
| 66 |
+
],
|
| 67 |
+
"page_idx": 0
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"type": "text",
|
| 71 |
+
"text": "Abstract ",
|
| 72 |
+
"text_level": 1,
|
| 73 |
+
"bbox": [
|
| 74 |
+
462,
|
| 75 |
+
367,
|
| 76 |
+
535,
|
| 77 |
+
382
|
| 78 |
+
],
|
| 79 |
+
"page_idx": 0
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"type": "text",
|
| 83 |
+
"text": "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/ ",
|
| 84 |
+
"bbox": [
|
| 85 |
+
232,
|
| 86 |
+
397,
|
| 87 |
+
766,
|
| 88 |
+
603
|
| 89 |
+
],
|
| 90 |
+
"page_idx": 0
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"type": "text",
|
| 94 |
+
"text": "1 Introduction ",
|
| 95 |
+
"text_level": 1,
|
| 96 |
+
"bbox": [
|
| 97 |
+
174,
|
| 98 |
+
627,
|
| 99 |
+
310,
|
| 100 |
+
645
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 0
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "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. ",
|
| 107 |
+
"bbox": [
|
| 108 |
+
174,
|
| 109 |
+
659,
|
| 110 |
+
825,
|
| 111 |
+
742
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 0
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "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. ",
|
| 118 |
+
"bbox": [
|
| 119 |
+
174,
|
| 120 |
+
748,
|
| 121 |
+
825,
|
| 122 |
+
845
|
| 123 |
+
],
|
| 124 |
+
"page_idx": 0
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"type": "text",
|
| 128 |
+
"text": "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: ",
|
| 129 |
+
"bbox": [
|
| 130 |
+
176,
|
| 131 |
+
852,
|
| 132 |
+
823,
|
| 133 |
+
881
|
| 134 |
+
],
|
| 135 |
+
"page_idx": 0
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"type": "image",
|
| 139 |
+
"img_path": "images/2ce2901b6ec3c1c84874a101d060e3f7e63c337d31ef0a8effea353fd4fb0922.jpg",
|
| 140 |
+
"image_caption": [
|
| 141 |
+
"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. "
|
| 142 |
+
],
|
| 143 |
+
"image_footnote": [],
|
| 144 |
+
"bbox": [
|
| 145 |
+
204,
|
| 146 |
+
90,
|
| 147 |
+
787,
|
| 148 |
+
366
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 1
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "",
|
| 155 |
+
"bbox": [
|
| 156 |
+
173,
|
| 157 |
+
544,
|
| 158 |
+
825,
|
| 159 |
+
737
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "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. ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
173,
|
| 168 |
+
746,
|
| 169 |
+
826,
|
| 170 |
+
911
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "image",
|
| 176 |
+
"img_path": "images/08cab45ea32a1868628452c0678e2338d0a356af51aae295599a1ac6ae101f5d.jpg",
|
| 177 |
+
"image_caption": [
|
| 178 |
+
"(c) UMAP visualization of embeddings of 25 randomly initialized models on real data (color indicates random seed) ",
|
| 179 |
+
"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. "
|
| 180 |
+
],
|
| 181 |
+
"image_footnote": [],
|
| 182 |
+
"bbox": [
|
| 183 |
+
173,
|
| 184 |
+
88,
|
| 185 |
+
816,
|
| 186 |
+
398
|
| 187 |
+
],
|
| 188 |
+
"page_idx": 2
|
| 189 |
+
},
|
| 190 |
+
{
|
| 191 |
+
"type": "text",
|
| 192 |
+
"text": "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. ",
|
| 193 |
+
"bbox": [
|
| 194 |
+
174,
|
| 195 |
+
594,
|
| 196 |
+
825,
|
| 197 |
+
637
|
| 198 |
+
],
|
| 199 |
+
"page_idx": 2
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"type": "text",
|
| 203 |
+
"text": "2 The Cone Effect Induces A Modality Gap ",
|
| 204 |
+
"text_level": 1,
|
| 205 |
+
"bbox": [
|
| 206 |
+
174,
|
| 207 |
+
659,
|
| 208 |
+
552,
|
| 209 |
+
676
|
| 210 |
+
],
|
| 211 |
+
"page_idx": 2
|
| 212 |
+
},
|
| 213 |
+
{
|
| 214 |
+
"type": "text",
|
| 215 |
+
"text": "2.1 The Narrow Cone of Embeddings ",
|
| 216 |
+
"text_level": 1,
|
| 217 |
+
"bbox": [
|
| 218 |
+
174,
|
| 219 |
+
693,
|
| 220 |
+
446,
|
| 221 |
+
707
|
| 222 |
+
],
|
| 223 |
+
"page_idx": 2
|
| 224 |
+
},
|
| 225 |
+
{
|
| 226 |
+
"type": "text",
|
| 227 |
+
"text": "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. ",
|
| 228 |
+
"bbox": [
|
| 229 |
+
173,
|
| 230 |
+
718,
|
| 231 |
+
825,
|
| 232 |
+
871
|
| 233 |
+
],
|
| 234 |
+
"page_idx": 2
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"type": "text",
|
| 238 |
+
"text": "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. ",
|
| 239 |
+
"bbox": [
|
| 240 |
+
173,
|
| 241 |
+
90,
|
| 242 |
+
825,
|
| 243 |
+
215
|
| 244 |
+
],
|
| 245 |
+
"page_idx": 3
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"type": "text",
|
| 249 |
+
"text": "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\u0000cos 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. ",
|
| 250 |
+
"bbox": [
|
| 251 |
+
174,
|
| 252 |
+
233,
|
| 253 |
+
825,
|
| 254 |
+
352
|
| 255 |
+
],
|
| 256 |
+
"page_idx": 3
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"type": "text",
|
| 260 |
+
"text": "2.2 The effects of non-linear activation on cone effect ",
|
| 261 |
+
"text_level": 1,
|
| 262 |
+
"bbox": [
|
| 263 |
+
174,
|
| 264 |
+
371,
|
| 265 |
+
553,
|
| 266 |
+
386
|
| 267 |
+
],
|
| 268 |
+
"page_idx": 3
|
| 269 |
+
},
|
| 270 |
+
{
|
| 271 |
+
"type": "text",
|
| 272 |
+
"text": "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 } )$ . ",
|
| 273 |
+
"bbox": [
|
| 274 |
+
174,
|
| 275 |
+
397,
|
| 276 |
+
825,
|
| 277 |
+
469
|
| 278 |
+
],
|
| 279 |
+
"page_idx": 3
|
| 280 |
+
},
|
| 281 |
+
{
|
| 282 |
+
"type": "text",
|
| 283 |
+
"text": "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. ",
|
| 284 |
+
"bbox": [
|
| 285 |
+
174,
|
| 286 |
+
486,
|
| 287 |
+
825,
|
| 288 |
+
541
|
| 289 |
+
],
|
| 290 |
+
"page_idx": 3
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"type": "text",
|
| 294 |
+
"text": "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. ",
|
| 295 |
+
"bbox": [
|
| 296 |
+
174,
|
| 297 |
+
549,
|
| 298 |
+
825,
|
| 299 |
+
632
|
| 300 |
+
],
|
| 301 |
+
"page_idx": 3
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"type": "text",
|
| 305 |
+
"text": "2.3 Different random initializations create different cones ",
|
| 306 |
+
"text_level": 1,
|
| 307 |
+
"bbox": [
|
| 308 |
+
174,
|
| 309 |
+
651,
|
| 310 |
+
586,
|
| 311 |
+
665
|
| 312 |
+
],
|
| 313 |
+
"page_idx": 3
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
"type": "text",
|
| 317 |
+
"text": "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. ",
|
| 318 |
+
"bbox": [
|
| 319 |
+
173,
|
| 320 |
+
678,
|
| 321 |
+
825,
|
| 322 |
+
843
|
| 323 |
+
],
|
| 324 |
+
"page_idx": 3
|
| 325 |
+
},
|
| 326 |
+
{
|
| 327 |
+
"type": "text",
|
| 328 |
+
"text": "3 Theoretical analysis ",
|
| 329 |
+
"text_level": 1,
|
| 330 |
+
"bbox": [
|
| 331 |
+
174,
|
| 332 |
+
89,
|
| 333 |
+
372,
|
| 334 |
+
107
|
| 335 |
+
],
|
| 336 |
+
"page_idx": 4
|
| 337 |
+
},
|
| 338 |
+
{
|
| 339 |
+
"type": "text",
|
| 340 |
+
"text": "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. ",
|
| 341 |
+
"bbox": [
|
| 342 |
+
174,
|
| 343 |
+
121,
|
| 344 |
+
825,
|
| 345 |
+
162
|
| 346 |
+
],
|
| 347 |
+
"page_idx": 4
|
| 348 |
+
},
|
| 349 |
+
{
|
| 350 |
+
"type": "text",
|
| 351 |
+
"text": "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$ . ",
|
| 352 |
+
"bbox": [
|
| 353 |
+
173,
|
| 354 |
+
169,
|
| 355 |
+
826,
|
| 356 |
+
251
|
| 357 |
+
],
|
| 358 |
+
"page_idx": 4
|
| 359 |
+
},
|
| 360 |
+
{
|
| 361 |
+
"type": "text",
|
| 362 |
+
"text": "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. ",
|
| 363 |
+
"bbox": [
|
| 364 |
+
173,
|
| 365 |
+
263,
|
| 366 |
+
825,
|
| 367 |
+
320
|
| 368 |
+
],
|
| 369 |
+
"page_idx": 4
|
| 370 |
+
},
|
| 371 |
+
{
|
| 372 |
+
"type": "text",
|
| 373 |
+
"text": "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 } } )$ . ",
|
| 374 |
+
"bbox": [
|
| 375 |
+
173,
|
| 376 |
+
324,
|
| 377 |
+
825,
|
| 378 |
+
411
|
| 379 |
+
],
|
| 380 |
+
"page_idx": 4
|
| 381 |
+
},
|
| 382 |
+
{
|
| 383 |
+
"type": "equation",
|
| 384 |
+
"img_path": "images/01bcaf0fcdc5a0d92189c4ed625b17e2bb057230c95d249432fac7a6c755fabc.jpg",
|
| 385 |
+
"text": "$$\n\\mathrm { c o s } ( \\phi ( \\mathbf { W } u + \\mathbf { b } ) , \\phi ( \\mathbf { W } v + \\mathbf { b } ) ) > \\mathrm { c o s } ( u , v ) .\n$$",
|
| 386 |
+
"text_format": "latex",
|
| 387 |
+
"bbox": [
|
| 388 |
+
352,
|
| 389 |
+
417,
|
| 390 |
+
645,
|
| 391 |
+
434
|
| 392 |
+
],
|
| 393 |
+
"page_idx": 4
|
| 394 |
+
},
|
| 395 |
+
{
|
| 396 |
+
"type": "text",
|
| 397 |
+
"text": "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. ",
|
| 398 |
+
"bbox": [
|
| 399 |
+
173,
|
| 400 |
+
439,
|
| 401 |
+
825,
|
| 402 |
+
496
|
| 403 |
+
],
|
| 404 |
+
"page_idx": 4
|
| 405 |
+
},
|
| 406 |
+
{
|
| 407 |
+
"type": "text",
|
| 408 |
+
"text": "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. ",
|
| 409 |
+
"bbox": [
|
| 410 |
+
173,
|
| 411 |
+
501,
|
| 412 |
+
825,
|
| 413 |
+
601
|
| 414 |
+
],
|
| 415 |
+
"page_idx": 4
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"type": "text",
|
| 419 |
+
"text": "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 ",
|
| 420 |
+
"bbox": [
|
| 421 |
+
173,
|
| 422 |
+
613,
|
| 423 |
+
825,
|
| 424 |
+
684
|
| 425 |
+
],
|
| 426 |
+
"page_idx": 4
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
"type": "equation",
|
| 430 |
+
"img_path": "images/ec7d0607a4635e9a1dcd78293626dbd4ce5aca27e539edefe323f3d44561746c.jpg",
|
| 431 |
+
"text": "$$\n\\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 } } }\n$$",
|
| 432 |
+
"text_format": "latex",
|
| 433 |
+
"bbox": [
|
| 434 |
+
299,
|
| 435 |
+
690,
|
| 436 |
+
697,
|
| 437 |
+
727
|
| 438 |
+
],
|
| 439 |
+
"page_idx": 4
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"type": "text",
|
| 443 |
+
"text": "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. ",
|
| 444 |
+
"bbox": [
|
| 445 |
+
173,
|
| 446 |
+
732,
|
| 447 |
+
826,
|
| 448 |
+
803
|
| 449 |
+
],
|
| 450 |
+
"page_idx": 4
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"type": "text",
|
| 454 |
+
"text": "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. ",
|
| 455 |
+
"bbox": [
|
| 456 |
+
174,
|
| 457 |
+
806,
|
| 458 |
+
823,
|
| 459 |
+
849
|
| 460 |
+
],
|
| 461 |
+
"page_idx": 4
|
| 462 |
+
},
|
| 463 |
+
{
|
| 464 |
+
"type": "equation",
|
| 465 |
+
"img_path": "images/a5b4eb775bb17c7f853cb3f0a7d915e6e32607636e7fd950555b70eb3d9cd5cb.jpg",
|
| 466 |
+
"text": "$$\n\\frac { \\mathrm { V a r } [ \\mathbb { E } [ h _ { \\Theta } ( U ) \\mid \\Theta ] ] } { \\mathrm { V a r } [ h _ { \\Theta } ( U ) ] } \\ge \\beta ,\n$$",
|
| 467 |
+
"text_format": "latex",
|
| 468 |
+
"bbox": [
|
| 469 |
+
415,
|
| 470 |
+
856,
|
| 471 |
+
583,
|
| 472 |
+
890
|
| 473 |
+
],
|
| 474 |
+
"page_idx": 4
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"type": "text",
|
| 478 |
+
"text": "where $\\beta$ is a constant that captures the average cosine similarity of previous layer outputs. ",
|
| 479 |
+
"bbox": [
|
| 480 |
+
168,
|
| 481 |
+
897,
|
| 482 |
+
764,
|
| 483 |
+
912
|
| 484 |
+
],
|
| 485 |
+
"page_idx": 4
|
| 486 |
+
},
|
| 487 |
+
{
|
| 488 |
+
"type": "text",
|
| 489 |
+
"text": "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. ",
|
| 490 |
+
"bbox": [
|
| 491 |
+
173,
|
| 492 |
+
90,
|
| 493 |
+
826,
|
| 494 |
+
174
|
| 495 |
+
],
|
| 496 |
+
"page_idx": 5
|
| 497 |
+
},
|
| 498 |
+
{
|
| 499 |
+
"type": "image",
|
| 500 |
+
"img_path": "images/6500d61d0ebff14c0f0cafd67d307d9abbcb7d5e6d3ec624761385a7eb0faa85.jpg",
|
| 501 |
+
"image_caption": [
|
| 502 |
+
"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$ ). "
|
| 503 |
+
],
|
| 504 |
+
"image_footnote": [],
|
| 505 |
+
"bbox": [
|
| 506 |
+
173,
|
| 507 |
+
190,
|
| 508 |
+
789,
|
| 509 |
+
417
|
| 510 |
+
],
|
| 511 |
+
"page_idx": 5
|
| 512 |
+
},
|
| 513 |
+
{
|
| 514 |
+
"type": "text",
|
| 515 |
+
"text": "4 Contrastive learning preserves modality gap ",
|
| 516 |
+
"text_level": 1,
|
| 517 |
+
"bbox": [
|
| 518 |
+
173,
|
| 519 |
+
580,
|
| 520 |
+
575,
|
| 521 |
+
598
|
| 522 |
+
],
|
| 523 |
+
"page_idx": 5
|
| 524 |
+
},
|
| 525 |
+
{
|
| 526 |
+
"type": "text",
|
| 527 |
+
"text": "4.1 Background: Contrastive Loss ",
|
| 528 |
+
"text_level": 1,
|
| 529 |
+
"bbox": [
|
| 530 |
+
176,
|
| 531 |
+
613,
|
| 532 |
+
426,
|
| 533 |
+
628
|
| 534 |
+
],
|
| 535 |
+
"page_idx": 5
|
| 536 |
+
},
|
| 537 |
+
{
|
| 538 |
+
"type": "text",
|
| 539 |
+
"text": "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. ",
|
| 540 |
+
"bbox": [
|
| 541 |
+
176,
|
| 542 |
+
638,
|
| 543 |
+
825,
|
| 544 |
+
683
|
| 545 |
+
],
|
| 546 |
+
"page_idx": 5
|
| 547 |
+
},
|
| 548 |
+
{
|
| 549 |
+
"type": "text",
|
| 550 |
+
"text": "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: ",
|
| 551 |
+
"bbox": [
|
| 552 |
+
174,
|
| 553 |
+
686,
|
| 554 |
+
825,
|
| 555 |
+
757
|
| 556 |
+
],
|
| 557 |
+
"page_idx": 5
|
| 558 |
+
},
|
| 559 |
+
{
|
| 560 |
+
"type": "equation",
|
| 561 |
+
"img_path": "images/80c7a427c448ddad2f6cd5bfa641996ebb42e663b962bd94078e3cf89bb48678.jpg",
|
| 562 |
+
"text": "$$\n\\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 ) }\n$$",
|
| 563 |
+
"text_format": "latex",
|
| 564 |
+
"bbox": [
|
| 565 |
+
349,
|
| 566 |
+
757,
|
| 567 |
+
648,
|
| 568 |
+
801
|
| 569 |
+
],
|
| 570 |
+
"page_idx": 5
|
| 571 |
+
},
|
| 572 |
+
{
|
| 573 |
+
"type": "text",
|
| 574 |
+
"text": "and the other for text-to-image classification: ",
|
| 575 |
+
"bbox": [
|
| 576 |
+
178,
|
| 577 |
+
808,
|
| 578 |
+
473,
|
| 579 |
+
821
|
| 580 |
+
],
|
| 581 |
+
"page_idx": 5
|
| 582 |
+
},
|
| 583 |
+
{
|
| 584 |
+
"type": "equation",
|
| 585 |
+
"img_path": "images/0752e11a1ff4670cc0e5e8eda95bb8ea92caf883a1ab4a0105f378b592e77e02.jpg",
|
| 586 |
+
"text": "$$\n\\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 ) }\n$$",
|
| 587 |
+
"text_format": "latex",
|
| 588 |
+
"bbox": [
|
| 589 |
+
349,
|
| 590 |
+
821,
|
| 591 |
+
648,
|
| 592 |
+
866
|
| 593 |
+
],
|
| 594 |
+
"page_idx": 5
|
| 595 |
+
},
|
| 596 |
+
{
|
| 597 |
+
"type": "text",
|
| 598 |
+
"text": "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. ",
|
| 599 |
+
"bbox": [
|
| 600 |
+
174,
|
| 601 |
+
869,
|
| 602 |
+
825,
|
| 603 |
+
912
|
| 604 |
+
],
|
| 605 |
+
"page_idx": 5
|
| 606 |
+
},
|
| 607 |
+
{
|
| 608 |
+
"type": "text",
|
| 609 |
+
"text": "4.2 Embedding Shift Experiment ",
|
| 610 |
+
"text_level": 1,
|
| 611 |
+
"bbox": [
|
| 612 |
+
174,
|
| 613 |
+
90,
|
| 614 |
+
418,
|
| 615 |
+
106
|
| 616 |
+
],
|
| 617 |
+
"page_idx": 6
|
| 618 |
+
},
|
| 619 |
+
{
|
| 620 |
+
"type": "text",
|
| 621 |
+
"text": "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: ",
|
| 622 |
+
"bbox": [
|
| 623 |
+
173,
|
| 624 |
+
116,
|
| 625 |
+
825,
|
| 626 |
+
171
|
| 627 |
+
],
|
| 628 |
+
"page_idx": 6
|
| 629 |
+
},
|
| 630 |
+
{
|
| 631 |
+
"type": "equation",
|
| 632 |
+
"img_path": "images/7ea813fe06b46604ff31c30cdd5d4c5febecd0eea2a0c38bda3e50340e9e3e2e.jpg",
|
| 633 |
+
"text": "$$\n{ \\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 }\n$$",
|
| 634 |
+
"text_format": "latex",
|
| 635 |
+
"bbox": [
|
| 636 |
+
405,
|
| 637 |
+
170,
|
| 638 |
+
593,
|
| 639 |
+
212
|
| 640 |
+
],
|
| 641 |
+
"page_idx": 6
|
| 642 |
+
},
|
| 643 |
+
{
|
| 644 |
+
"type": "text",
|
| 645 |
+
"text": "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: ",
|
| 646 |
+
"bbox": [
|
| 647 |
+
174,
|
| 648 |
+
215,
|
| 649 |
+
825,
|
| 650 |
+
257
|
| 651 |
+
],
|
| 652 |
+
"page_idx": 6
|
| 653 |
+
},
|
| 654 |
+
{
|
| 655 |
+
"type": "equation",
|
| 656 |
+
"img_path": "images/d503d8ebdbc06da66abc484523c2d5f9ec9362e8a476c845c0547b0e09843f6a.jpg",
|
| 657 |
+
"text": "$$\n\\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 } } ) .\n$$",
|
| 658 |
+
"text_format": "latex",
|
| 659 |
+
"bbox": [
|
| 660 |
+
284,
|
| 661 |
+
258,
|
| 662 |
+
712,
|
| 663 |
+
280
|
| 664 |
+
],
|
| 665 |
+
"page_idx": 6
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
"type": "text",
|
| 669 |
+
"text": "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. ",
|
| 670 |
+
"bbox": [
|
| 671 |
+
173,
|
| 672 |
+
291,
|
| 673 |
+
825,
|
| 674 |
+
433
|
| 675 |
+
],
|
| 676 |
+
"page_idx": 6
|
| 677 |
+
},
|
| 678 |
+
{
|
| 679 |
+
"type": "text",
|
| 680 |
+
"text": "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. ",
|
| 681 |
+
"bbox": [
|
| 682 |
+
173,
|
| 683 |
+
446,
|
| 684 |
+
825,
|
| 685 |
+
577
|
| 686 |
+
],
|
| 687 |
+
"page_idx": 6
|
| 688 |
+
},
|
| 689 |
+
{
|
| 690 |
+
"type": "text",
|
| 691 |
+
"text": "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). ",
|
| 692 |
+
"bbox": [
|
| 693 |
+
174,
|
| 694 |
+
590,
|
| 695 |
+
826,
|
| 696 |
+
666
|
| 697 |
+
],
|
| 698 |
+
"page_idx": 6
|
| 699 |
+
},
|
| 700 |
+
{
|
| 701 |
+
"type": "text",
|
| 702 |
+
"text": "4.3 Simulating mismatched data ",
|
| 703 |
+
"text_level": 1,
|
| 704 |
+
"bbox": [
|
| 705 |
+
176,
|
| 706 |
+
681,
|
| 707 |
+
411,
|
| 708 |
+
695
|
| 709 |
+
],
|
| 710 |
+
"page_idx": 6
|
| 711 |
+
},
|
| 712 |
+
{
|
| 713 |
+
"type": "text",
|
| 714 |
+
"text": "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). ",
|
| 715 |
+
"bbox": [
|
| 716 |
+
173,
|
| 717 |
+
705,
|
| 718 |
+
825,
|
| 719 |
+
790
|
| 720 |
+
],
|
| 721 |
+
"page_idx": 6
|
| 722 |
+
},
|
| 723 |
+
{
|
| 724 |
+
"type": "text",
|
| 725 |
+
"text": "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. ",
|
| 726 |
+
"bbox": [
|
| 727 |
+
174,
|
| 728 |
+
804,
|
| 729 |
+
825,
|
| 730 |
+
888
|
| 731 |
+
],
|
| 732 |
+
"page_idx": 6
|
| 733 |
+
},
|
| 734 |
+
{
|
| 735 |
+
"type": "table",
|
| 736 |
+
"img_path": "images/5a8d0a1126201f51ac3543055591c79f5996b6cb94305900a6108c91b9ecae5a.jpg",
|
| 737 |
+
"table_caption": [
|
| 738 |
+
"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. "
|
| 739 |
+
],
|
| 740 |
+
"table_footnote": [],
|
| 741 |
+
"table_body": "<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>",
|
| 742 |
+
"bbox": [
|
| 743 |
+
176,
|
| 744 |
+
99,
|
| 745 |
+
480,
|
| 746 |
+
217
|
| 747 |
+
],
|
| 748 |
+
"page_idx": 7
|
| 749 |
+
},
|
| 750 |
+
{
|
| 751 |
+
"type": "table",
|
| 752 |
+
"img_path": "images/3b04116c3881e2147aa5ffaf3e4e64468767ab43eb5a69c19471ccabf1cb2718.jpg",
|
| 753 |
+
"table_caption": [
|
| 754 |
+
"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. "
|
| 755 |
+
],
|
| 756 |
+
"table_footnote": [],
|
| 757 |
+
"table_body": "<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>",
|
| 758 |
+
"bbox": [
|
| 759 |
+
496,
|
| 760 |
+
89,
|
| 761 |
+
820,
|
| 762 |
+
214
|
| 763 |
+
],
|
| 764 |
+
"page_idx": 7
|
| 765 |
+
},
|
| 766 |
+
{
|
| 767 |
+
"type": "text",
|
| 768 |
+
"text": "",
|
| 769 |
+
"bbox": [
|
| 770 |
+
174,
|
| 771 |
+
330,
|
| 772 |
+
823,
|
| 773 |
+
359
|
| 774 |
+
],
|
| 775 |
+
"page_idx": 7
|
| 776 |
+
},
|
| 777 |
+
{
|
| 778 |
+
"type": "text",
|
| 779 |
+
"text": "4.4 Initialization vs Optimization ",
|
| 780 |
+
"text_level": 1,
|
| 781 |
+
"bbox": [
|
| 782 |
+
176,
|
| 783 |
+
375,
|
| 784 |
+
416,
|
| 785 |
+
390
|
| 786 |
+
],
|
| 787 |
+
"page_idx": 7
|
| 788 |
+
},
|
| 789 |
+
{
|
| 790 |
+
"type": "text",
|
| 791 |
+
"text": "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. ",
|
| 792 |
+
"bbox": [
|
| 793 |
+
173,
|
| 794 |
+
400,
|
| 795 |
+
825,
|
| 796 |
+
585
|
| 797 |
+
],
|
| 798 |
+
"page_idx": 7
|
| 799 |
+
},
|
| 800 |
+
{
|
| 801 |
+
"type": "text",
|
| 802 |
+
"text": "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. ",
|
| 803 |
+
"bbox": [
|
| 804 |
+
173,
|
| 805 |
+
599,
|
| 806 |
+
825,
|
| 807 |
+
712
|
| 808 |
+
],
|
| 809 |
+
"page_idx": 7
|
| 810 |
+
},
|
| 811 |
+
{
|
| 812 |
+
"type": "text",
|
| 813 |
+
"text": "5 Modality Gap Implications ",
|
| 814 |
+
"text_level": 1,
|
| 815 |
+
"bbox": [
|
| 816 |
+
174,
|
| 817 |
+
729,
|
| 818 |
+
431,
|
| 819 |
+
747
|
| 820 |
+
],
|
| 821 |
+
"page_idx": 7
|
| 822 |
+
},
|
| 823 |
+
{
|
| 824 |
+
"type": "text",
|
| 825 |
+
"text": "5.1 Zero-shot performance ",
|
| 826 |
+
"text_level": 1,
|
| 827 |
+
"bbox": [
|
| 828 |
+
174,
|
| 829 |
+
761,
|
| 830 |
+
372,
|
| 831 |
+
776
|
| 832 |
+
],
|
| 833 |
+
"page_idx": 7
|
| 834 |
+
},
|
| 835 |
+
{
|
| 836 |
+
"type": "text",
|
| 837 |
+
"text": "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. ",
|
| 838 |
+
"bbox": [
|
| 839 |
+
173,
|
| 840 |
+
786,
|
| 841 |
+
825,
|
| 842 |
+
911
|
| 843 |
+
],
|
| 844 |
+
"page_idx": 7
|
| 845 |
+
},
|
| 846 |
+
{
|
| 847 |
+
"type": "text",
|
| 848 |
+
"text": "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. ",
|
| 849 |
+
"bbox": [
|
| 850 |
+
174,
|
| 851 |
+
92,
|
| 852 |
+
825,
|
| 853 |
+
147
|
| 854 |
+
],
|
| 855 |
+
"page_idx": 8
|
| 856 |
+
},
|
| 857 |
+
{
|
| 858 |
+
"type": "text",
|
| 859 |
+
"text": "5.2 Fairness ",
|
| 860 |
+
"text_level": 1,
|
| 861 |
+
"bbox": [
|
| 862 |
+
174,
|
| 863 |
+
164,
|
| 864 |
+
271,
|
| 865 |
+
179
|
| 866 |
+
],
|
| 867 |
+
"page_idx": 8
|
| 868 |
+
},
|
| 869 |
+
{
|
| 870 |
+
"type": "text",
|
| 871 |
+
"text": "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. ",
|
| 872 |
+
"bbox": [
|
| 873 |
+
174,
|
| 874 |
+
190,
|
| 875 |
+
826,
|
| 876 |
+
287
|
| 877 |
+
],
|
| 878 |
+
"page_idx": 8
|
| 879 |
+
},
|
| 880 |
+
{
|
| 881 |
+
"type": "text",
|
| 882 |
+
"text": "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). ",
|
| 883 |
+
"bbox": [
|
| 884 |
+
174,
|
| 885 |
+
303,
|
| 886 |
+
825,
|
| 887 |
+
387
|
| 888 |
+
],
|
| 889 |
+
"page_idx": 8
|
| 890 |
+
},
|
| 891 |
+
{
|
| 892 |
+
"type": "text",
|
| 893 |
+
"text": "6 Related Work ",
|
| 894 |
+
"text_level": 1,
|
| 895 |
+
"bbox": [
|
| 896 |
+
174,
|
| 897 |
+
406,
|
| 898 |
+
321,
|
| 899 |
+
424
|
| 900 |
+
],
|
| 901 |
+
"page_idx": 8
|
| 902 |
+
},
|
| 903 |
+
{
|
| 904 |
+
"type": "text",
|
| 905 |
+
"text": "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. ",
|
| 906 |
+
"bbox": [
|
| 907 |
+
174,
|
| 908 |
+
439,
|
| 909 |
+
825,
|
| 910 |
+
604
|
| 911 |
+
],
|
| 912 |
+
"page_idx": 8
|
| 913 |
+
},
|
| 914 |
+
{
|
| 915 |
+
"type": "text",
|
| 916 |
+
"text": "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. ",
|
| 917 |
+
"bbox": [
|
| 918 |
+
174,
|
| 919 |
+
621,
|
| 920 |
+
825,
|
| 921 |
+
800
|
| 922 |
+
],
|
| 923 |
+
"page_idx": 8
|
| 924 |
+
},
|
| 925 |
+
{
|
| 926 |
+
"type": "text",
|
| 927 |
+
"text": "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. ",
|
| 928 |
+
"bbox": [
|
| 929 |
+
174,
|
| 930 |
+
816,
|
| 931 |
+
825,
|
| 932 |
+
872
|
| 933 |
+
],
|
| 934 |
+
"page_idx": 8
|
| 935 |
+
},
|
| 936 |
+
{
|
| 937 |
+
"type": "text",
|
| 938 |
+
"text": "",
|
| 939 |
+
"bbox": [
|
| 940 |
+
173,
|
| 941 |
+
90,
|
| 942 |
+
825,
|
| 943 |
+
229
|
| 944 |
+
],
|
| 945 |
+
"page_idx": 9
|
| 946 |
+
},
|
| 947 |
+
{
|
| 948 |
+
"type": "text",
|
| 949 |
+
"text": "7 Discussion ",
|
| 950 |
+
"text_level": 1,
|
| 951 |
+
"bbox": [
|
| 952 |
+
174,
|
| 953 |
+
248,
|
| 954 |
+
294,
|
| 955 |
+
265
|
| 956 |
+
],
|
| 957 |
+
"page_idx": 9
|
| 958 |
+
},
|
| 959 |
+
{
|
| 960 |
+
"type": "text",
|
| 961 |
+
"text": "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. ",
|
| 962 |
+
"bbox": [
|
| 963 |
+
174,
|
| 964 |
+
280,
|
| 965 |
+
826,
|
| 966 |
+
391
|
| 967 |
+
],
|
| 968 |
+
"page_idx": 9
|
| 969 |
+
},
|
| 970 |
+
{
|
| 971 |
+
"type": "text",
|
| 972 |
+
"text": "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. ",
|
| 973 |
+
"bbox": [
|
| 974 |
+
174,
|
| 975 |
+
397,
|
| 976 |
+
825,
|
| 977 |
+
481
|
| 978 |
+
],
|
| 979 |
+
"page_idx": 9
|
| 980 |
+
},
|
| 981 |
+
{
|
| 982 |
+
"type": "text",
|
| 983 |
+
"text": "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. ",
|
| 984 |
+
"bbox": [
|
| 985 |
+
174,
|
| 986 |
+
487,
|
| 987 |
+
825,
|
| 988 |
+
556
|
| 989 |
+
],
|
| 990 |
+
"page_idx": 9
|
| 991 |
+
},
|
| 992 |
+
{
|
| 993 |
+
"type": "text",
|
| 994 |
+
"text": "Reproducibility Statement ",
|
| 995 |
+
"text_level": 1,
|
| 996 |
+
"bbox": [
|
| 997 |
+
176,
|
| 998 |
+
575,
|
| 999 |
+
397,
|
| 1000 |
+
593
|
| 1001 |
+
],
|
| 1002 |
+
"page_idx": 9
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"type": "text",
|
| 1006 |
+
"text": "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. ",
|
| 1007 |
+
"bbox": [
|
| 1008 |
+
174,
|
| 1009 |
+
607,
|
| 1010 |
+
825,
|
| 1011 |
+
662
|
| 1012 |
+
],
|
| 1013 |
+
"page_idx": 9
|
| 1014 |
+
},
|
| 1015 |
+
{
|
| 1016 |
+
"type": "text",
|
| 1017 |
+
"text": "References ",
|
| 1018 |
+
"text_level": 1,
|
| 1019 |
+
"bbox": [
|
| 1020 |
+
174,
|
| 1021 |
+
90,
|
| 1022 |
+
267,
|
| 1023 |
+
106
|
| 1024 |
+
],
|
| 1025 |
+
"page_idx": 10
|
| 1026 |
+
},
|
| 1027 |
+
{
|
| 1028 |
+
"type": "text",
|
| 1029 |
+
"text": "[1] Z. Allen-Zhu, Y. Li, and Z. Song. A convergence theory for deep learning via overparameterization. In ICML, 2019. \n[2] S. Arora, Y. Liang, and T. Ma. A simple but tough-to-beat baseline for sentence embeddings. In ICLR, 2017. \n[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. \n[4] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016. \n[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. \n[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. \n[7] T. Chen, S. Kornblith, M. Norouzi, and G. E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. \n[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. \n[9] X. Chen and K. He. Exploring simple siamese representation learning. In CVPR, 2021. \n[10] K. Desai and J. Johnson. Virtex: Learning visual representations from textual annotations. In CVPR, 2021. \n[11] CLASP: Contrastive Language Aminoacid Sequence Pretraining, 2021. \n[12] K. Ethayarajh. How contextual are contextualized word representations? comparing the geometry of bert, elmo, and GPT-2 embeddings. In EMNLP, 2019. \n[13] J. Frankle and M. Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR. OpenReview.net, 2019. \n[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. \n[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. \n[16] T. Gao, X. Yao, and D. Chen. Simcse: Simple contrastive learning of sentence embeddings. In EMNLP, 2021. \n[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. \n[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. \n[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. \n[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. \n[21] W. Guo, J. Wang, and S. Wang. Deep multimodal representation learning: A survey. IEEE Access, 7:63373–63394, 2019. \n[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. \n[23] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. \n[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. \n[25] A. Joulin, L. van der Maaten, A. Jabri, and N. Vasilache. Learning visual features from large weakly supervised data. In ECCV, 2016. \n[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. \n[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. \n[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. \n[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. \n[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. \n[31] G. Lample, A. Conneau, M. Ranzato, L. Denoyer, and H. Jégou. Word translation without parallel data. In ICLR, 2018. \n[32] A. Li, A. Jabri, A. Joulin, and L. van der Maaten. Learning visual n-grams from web data. In ICCV, 2017. \n[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. \n[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. \n[35] J. Mu and P. Viswanath. All-but-the-top: Simple and effective postprocessing for word representations. In ICLR, 2018. \n[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. \n[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. \n[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. \n[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. \n[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. \n[41] T. Sainburg, L. McInnes, and T. Q. Gentner. Parametric umap embeddings for representation and semisupervised learning. Neural Computation, 2021. \n[42] R. Socher and L. Fei-Fei. Connecting modalities: Semi-supervised segmentation and annotation of images using unaligned text corpora. In CVPR, 2010. \n[43] J. Su, J. Cao, W. Liu, and Y. Ou. Whitening sentence representations for better semantics and faster retrieval. CoRR, abs/2103.15316, 2021. \n[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. \n[45] A. van den Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. CoRR, abs/1807.03748, 2018. \n[46] F. Wang and H. Liu. Understanding the behaviour of contrastive loss. In CVPR, 2021. \n[47] L. Wang, J. Huang, K. Huang, Z. Hu, G. Wang, and Q. Gu. Improving neural language generation with spectrum control. In ICLR, 2020. \n[48] T. Wang and P. Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, 2020. \n[49] J. Weston, S. Bengio, and N. Usunier. Large scale image annotation: learning to rank with joint word-image embeddings. Machine learning, 2010. \n[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. \n[51] Y. You, T. Chen, Y. Sui, T. Chen, Z. Wang, and Y. Shen. Graph contrastive learning with augmentations. In NeurIPS, 2020. \n[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. \n[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. ",
|
| 1030 |
+
"bbox": [
|
| 1031 |
+
171,
|
| 1032 |
+
113,
|
| 1033 |
+
830,
|
| 1034 |
+
916
|
| 1035 |
+
],
|
| 1036 |
+
"page_idx": 10
|
| 1037 |
+
},
|
| 1038 |
+
{
|
| 1039 |
+
"type": "text",
|
| 1040 |
+
"text": "",
|
| 1041 |
+
"bbox": [
|
| 1042 |
+
171,
|
| 1043 |
+
74,
|
| 1044 |
+
828,
|
| 1045 |
+
920
|
| 1046 |
+
],
|
| 1047 |
+
"page_idx": 11
|
| 1048 |
+
},
|
| 1049 |
+
{
|
| 1050 |
+
"type": "text",
|
| 1051 |
+
"text": "",
|
| 1052 |
+
"bbox": [
|
| 1053 |
+
171,
|
| 1054 |
+
90,
|
| 1055 |
+
828,
|
| 1056 |
+
539
|
| 1057 |
+
],
|
| 1058 |
+
"page_idx": 12
|
| 1059 |
+
},
|
| 1060 |
+
{
|
| 1061 |
+
"type": "text",
|
| 1062 |
+
"text": "Checklist ",
|
| 1063 |
+
"text_level": 1,
|
| 1064 |
+
"bbox": [
|
| 1065 |
+
174,
|
| 1066 |
+
89,
|
| 1067 |
+
254,
|
| 1068 |
+
106
|
| 1069 |
+
],
|
| 1070 |
+
"page_idx": 13
|
| 1071 |
+
},
|
| 1072 |
+
{
|
| 1073 |
+
"type": "text",
|
| 1074 |
+
"text": "1. For all authors... ",
|
| 1075 |
+
"bbox": [
|
| 1076 |
+
214,
|
| 1077 |
+
116,
|
| 1078 |
+
339,
|
| 1079 |
+
131
|
| 1080 |
+
],
|
| 1081 |
+
"page_idx": 13
|
| 1082 |
+
},
|
| 1083 |
+
{
|
| 1084 |
+
"type": "text",
|
| 1085 |
+
"text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
|
| 1086 |
+
"bbox": [
|
| 1087 |
+
238,
|
| 1088 |
+
135,
|
| 1089 |
+
825,
|
| 1090 |
+
227
|
| 1091 |
+
],
|
| 1092 |
+
"page_idx": 13
|
| 1093 |
+
},
|
| 1094 |
+
{
|
| 1095 |
+
"type": "text",
|
| 1096 |
+
"text": "2. If you are including theoretical results... ",
|
| 1097 |
+
"bbox": [
|
| 1098 |
+
214,
|
| 1099 |
+
231,
|
| 1100 |
+
493,
|
| 1101 |
+
244
|
| 1102 |
+
],
|
| 1103 |
+
"page_idx": 13
|
| 1104 |
+
},
|
| 1105 |
+
{
|
| 1106 |
+
"type": "text",
|
| 1107 |
+
"text": "(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] ",
|
| 1108 |
+
"bbox": [
|
| 1109 |
+
236,
|
| 1110 |
+
248,
|
| 1111 |
+
735,
|
| 1112 |
+
280
|
| 1113 |
+
],
|
| 1114 |
+
"page_idx": 13
|
| 1115 |
+
},
|
| 1116 |
+
{
|
| 1117 |
+
"type": "text",
|
| 1118 |
+
"text": "3. If you ran experiments... ",
|
| 1119 |
+
"bbox": [
|
| 1120 |
+
212,
|
| 1121 |
+
285,
|
| 1122 |
+
393,
|
| 1123 |
+
299
|
| 1124 |
+
],
|
| 1125 |
+
"page_idx": 13
|
| 1126 |
+
},
|
| 1127 |
+
{
|
| 1128 |
+
"type": "text",
|
| 1129 |
+
"text": "(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] \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] \n(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] ",
|
| 1130 |
+
"bbox": [
|
| 1131 |
+
238,
|
| 1132 |
+
303,
|
| 1133 |
+
826,
|
| 1134 |
+
421
|
| 1135 |
+
],
|
| 1136 |
+
"page_idx": 13
|
| 1137 |
+
},
|
| 1138 |
+
{
|
| 1139 |
+
"type": "text",
|
| 1140 |
+
"text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
|
| 1141 |
+
"bbox": [
|
| 1142 |
+
214,
|
| 1143 |
+
426,
|
| 1144 |
+
823,
|
| 1145 |
+
440
|
| 1146 |
+
],
|
| 1147 |
+
"page_idx": 13
|
| 1148 |
+
},
|
| 1149 |
+
{
|
| 1150 |
+
"type": "text",
|
| 1151 |
+
"text": "(a) If your work uses existing assets, did you cite the creators? [Yes] \n(b) Did you mention the license of the assets? [Yes] \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] ",
|
| 1152 |
+
"bbox": [
|
| 1153 |
+
238,
|
| 1154 |
+
444,
|
| 1155 |
+
823,
|
| 1156 |
+
551
|
| 1157 |
+
],
|
| 1158 |
+
"page_idx": 13
|
| 1159 |
+
},
|
| 1160 |
+
{
|
| 1161 |
+
"type": "text",
|
| 1162 |
+
"text": "5. If you used crowdsourcing or conducted research with human subjects... ",
|
| 1163 |
+
"bbox": [
|
| 1164 |
+
214,
|
| 1165 |
+
556,
|
| 1166 |
+
705,
|
| 1167 |
+
570
|
| 1168 |
+
],
|
| 1169 |
+
"page_idx": 13
|
| 1170 |
+
},
|
| 1171 |
+
{
|
| 1172 |
+
"type": "text",
|
| 1173 |
+
"text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
|
| 1174 |
+
"bbox": [
|
| 1175 |
+
238,
|
| 1176 |
+
574,
|
| 1177 |
+
825,
|
| 1178 |
+
665
|
| 1179 |
+
],
|
| 1180 |
+
"page_idx": 13
|
| 1181 |
+
}
|
| 1182 |
+
]
|
parse/dev/S7Evzt9uit3/S7Evzt9uit3_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/aLLuYpn83y/aLLuYpn83y_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/cp5PvcI6w8_/cp5PvcI6w8_.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/flNZJ2eOet/flNZJ2eOet_content_list.json
ADDED
|
@@ -0,0 +1,1355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "What Can Transformers Learn In-Context? A Case Study of Simple Function Classes ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
235,
|
| 8 |
+
122,
|
| 9 |
+
761,
|
| 10 |
+
172
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Shivam Garg∗ Dimitris Tsipras∗ Percy Liang Gregory Valiant ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
220,
|
| 19 |
+
224,
|
| 20 |
+
777,
|
| 21 |
+
241
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "Stanford University {shivamg, tsipras, pliang, gvaliant}@cs.stanford.edu ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
276,
|
| 30 |
+
262,
|
| 31 |
+
722,
|
| 32 |
+
290
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "Abstract ",
|
| 39 |
+
"text_level": 1,
|
| 40 |
+
"bbox": [
|
| 41 |
+
462,
|
| 42 |
+
325,
|
| 43 |
+
535,
|
| 44 |
+
342
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "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 ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
232,
|
| 53 |
+
356,
|
| 54 |
+
766,
|
| 55 |
+
631
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "text",
|
| 61 |
+
"text": "1 Introduction ",
|
| 62 |
+
"text_level": 1,
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
655,
|
| 66 |
+
310,
|
| 67 |
+
672
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "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.: ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
685,
|
| 77 |
+
823,
|
| 78 |
+
741
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "image",
|
| 84 |
+
"img_path": "images/1b2a5e2a8bfcf93aace6553426e59710a466009ad791e3d1250511a9e53a8da5.jpg",
|
| 85 |
+
"image_caption": [],
|
| 86 |
+
"image_footnote": [],
|
| 87 |
+
"bbox": [
|
| 88 |
+
333,
|
| 89 |
+
747,
|
| 90 |
+
663,
|
| 91 |
+
780
|
| 92 |
+
],
|
| 93 |
+
"page_idx": 0
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"type": "text",
|
| 97 |
+
"text": "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 ",
|
| 98 |
+
"bbox": [
|
| 99 |
+
174,
|
| 100 |
+
785,
|
| 101 |
+
825,
|
| 102 |
+
842
|
| 103 |
+
],
|
| 104 |
+
"page_idx": 0
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"type": "text",
|
| 108 |
+
"text": "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. ",
|
| 109 |
+
"bbox": [
|
| 110 |
+
173,
|
| 111 |
+
90,
|
| 112 |
+
825,
|
| 113 |
+
161
|
| 114 |
+
],
|
| 115 |
+
"page_idx": 1
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"type": "text",
|
| 119 |
+
"text": "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 ",
|
| 120 |
+
"bbox": [
|
| 121 |
+
173,
|
| 122 |
+
166,
|
| 123 |
+
825,
|
| 124 |
+
223
|
| 125 |
+
],
|
| 126 |
+
"page_idx": 1
|
| 127 |
+
},
|
| 128 |
+
{
|
| 129 |
+
"type": "equation",
|
| 130 |
+
"img_path": "images/d55e0cb5e47e4370ee5137388e5fa7e54865c3e918f4d4d0378dfc3960ae1f29.jpg",
|
| 131 |
+
"text": "$$\n{ \\mathbb E } _ { P } \\left[ \\ell \\left( M \\left( P \\right) , f \\left( x _ { \\mathrm { q u e r y } } \\right) \\right) \\right] \\leq \\epsilon ,\n$$",
|
| 132 |
+
"text_format": "latex",
|
| 133 |
+
"bbox": [
|
| 134 |
+
393,
|
| 135 |
+
227,
|
| 136 |
+
602,
|
| 137 |
+
243
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "where $\\ell ( \\cdot , \\cdot )$ is some appropriate loss function, such as the squared error. ",
|
| 144 |
+
"bbox": [
|
| 145 |
+
174,
|
| 146 |
+
246,
|
| 147 |
+
647,
|
| 148 |
+
261
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 1
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "Within this framework, we can now concretely ask: ",
|
| 155 |
+
"bbox": [
|
| 156 |
+
176,
|
| 157 |
+
267,
|
| 158 |
+
511,
|
| 159 |
+
281
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "Can we train a model to in-context learn a certain function class? ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
281,
|
| 168 |
+
291,
|
| 169 |
+
715,
|
| 170 |
+
306
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "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. ",
|
| 177 |
+
"bbox": [
|
| 178 |
+
173,
|
| 179 |
+
315,
|
| 180 |
+
826,
|
| 181 |
+
358
|
| 182 |
+
],
|
| 183 |
+
"page_idx": 1
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"type": "text",
|
| 187 |
+
"text": "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. ",
|
| 188 |
+
"bbox": [
|
| 189 |
+
173,
|
| 190 |
+
363,
|
| 191 |
+
825,
|
| 192 |
+
434
|
| 193 |
+
],
|
| 194 |
+
"page_idx": 1
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"type": "image",
|
| 198 |
+
"img_path": "images/b6502013ae5ee8bd1975f36ca9c92efdf3b52ab55dd8da974b02ec7c4273af56.jpg",
|
| 199 |
+
"image_caption": [
|
| 200 |
+
"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. "
|
| 201 |
+
],
|
| 202 |
+
"image_footnote": [],
|
| 203 |
+
"bbox": [
|
| 204 |
+
179,
|
| 205 |
+
449,
|
| 206 |
+
823,
|
| 207 |
+
604
|
| 208 |
+
],
|
| 209 |
+
"page_idx": 1
|
| 210 |
+
},
|
| 211 |
+
{
|
| 212 |
+
"type": "text",
|
| 213 |
+
"text": "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. ",
|
| 214 |
+
"bbox": [
|
| 215 |
+
173,
|
| 216 |
+
696,
|
| 217 |
+
825,
|
| 218 |
+
795
|
| 219 |
+
],
|
| 220 |
+
"page_idx": 1
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"type": "text",
|
| 224 |
+
"text": "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. ",
|
| 225 |
+
"bbox": [
|
| 226 |
+
173,
|
| 227 |
+
800,
|
| 228 |
+
825,
|
| 229 |
+
911
|
| 230 |
+
],
|
| 231 |
+
"page_idx": 1
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"type": "text",
|
| 235 |
+
"text": "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. ",
|
| 236 |
+
"bbox": [
|
| 237 |
+
173,
|
| 238 |
+
90,
|
| 239 |
+
825,
|
| 240 |
+
257
|
| 241 |
+
],
|
| 242 |
+
"page_idx": 2
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"type": "text",
|
| 246 |
+
"text": "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. ",
|
| 247 |
+
"bbox": [
|
| 248 |
+
174,
|
| 249 |
+
263,
|
| 250 |
+
825,
|
| 251 |
+
333
|
| 252 |
+
],
|
| 253 |
+
"page_idx": 2
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"type": "text",
|
| 257 |
+
"text": "2 Training models for in-context learning ",
|
| 258 |
+
"text_level": 1,
|
| 259 |
+
"bbox": [
|
| 260 |
+
174,
|
| 261 |
+
351,
|
| 262 |
+
534,
|
| 263 |
+
368
|
| 264 |
+
],
|
| 265 |
+
"page_idx": 2
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"type": "text",
|
| 269 |
+
"text": "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$ . ",
|
| 270 |
+
"bbox": [
|
| 271 |
+
173,
|
| 272 |
+
381,
|
| 273 |
+
825,
|
| 274 |
+
481
|
| 275 |
+
],
|
| 276 |
+
"page_idx": 2
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"type": "text",
|
| 280 |
+
"text": "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: ",
|
| 281 |
+
"bbox": [
|
| 282 |
+
174,
|
| 283 |
+
486,
|
| 284 |
+
825,
|
| 285 |
+
541
|
| 286 |
+
],
|
| 287 |
+
"page_idx": 2
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"type": "equation",
|
| 291 |
+
"img_path": "images/3d1dc7d41b7dc3a16bbf1f90757ed97bae36b852ddbb517a990d8594f543771a.jpg",
|
| 292 |
+
"text": "$$\n\\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] ,\n$$",
|
| 293 |
+
"text_format": "latex",
|
| 294 |
+
"bbox": [
|
| 295 |
+
343,
|
| 296 |
+
542,
|
| 297 |
+
651,
|
| 298 |
+
587
|
| 299 |
+
],
|
| 300 |
+
"page_idx": 2
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"type": "text",
|
| 304 |
+
"text": "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). ",
|
| 305 |
+
"bbox": [
|
| 306 |
+
176,
|
| 307 |
+
587,
|
| 308 |
+
825,
|
| 309 |
+
616
|
| 310 |
+
],
|
| 311 |
+
"page_idx": 2
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"type": "text",
|
| 315 |
+
"text": "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. ",
|
| 316 |
+
"bbox": [
|
| 317 |
+
173,
|
| 318 |
+
621,
|
| 319 |
+
825,
|
| 320 |
+
761
|
| 321 |
+
],
|
| 322 |
+
"page_idx": 2
|
| 323 |
+
},
|
| 324 |
+
{
|
| 325 |
+
"type": "text",
|
| 326 |
+
"text": "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. ",
|
| 327 |
+
"bbox": [
|
| 328 |
+
174,
|
| 329 |
+
765,
|
| 330 |
+
825,
|
| 331 |
+
821
|
| 332 |
+
],
|
| 333 |
+
"page_idx": 2
|
| 334 |
+
},
|
| 335 |
+
{
|
| 336 |
+
"type": "text",
|
| 337 |
+
"text": "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). ",
|
| 338 |
+
"bbox": [
|
| 339 |
+
174,
|
| 340 |
+
827,
|
| 341 |
+
823,
|
| 342 |
+
911
|
| 343 |
+
],
|
| 344 |
+
"page_idx": 2
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
"type": "text",
|
| 348 |
+
"text": "3 In-context learning of linear functions ",
|
| 349 |
+
"text_level": 1,
|
| 350 |
+
"bbox": [
|
| 351 |
+
173,
|
| 352 |
+
89,
|
| 353 |
+
522,
|
| 354 |
+
107
|
| 355 |
+
],
|
| 356 |
+
"page_idx": 3
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"type": "text",
|
| 360 |
+
"text": "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. ",
|
| 361 |
+
"bbox": [
|
| 362 |
+
174,
|
| 363 |
+
121,
|
| 364 |
+
825,
|
| 365 |
+
162
|
| 366 |
+
],
|
| 367 |
+
"page_idx": 3
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"type": "text",
|
| 371 |
+
"text": "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 } } ) .$ ",
|
| 372 |
+
"bbox": [
|
| 373 |
+
173,
|
| 374 |
+
169,
|
| 375 |
+
825,
|
| 376 |
+
228
|
| 377 |
+
],
|
| 378 |
+
"page_idx": 3
|
| 379 |
+
},
|
| 380 |
+
{
|
| 381 |
+
"type": "text",
|
| 382 |
+
"text": "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. ",
|
| 383 |
+
"bbox": [
|
| 384 |
+
173,
|
| 385 |
+
233,
|
| 386 |
+
826,
|
| 387 |
+
330
|
| 388 |
+
],
|
| 389 |
+
"page_idx": 3
|
| 390 |
+
},
|
| 391 |
+
{
|
| 392 |
+
"type": "image",
|
| 393 |
+
"img_path": "images/1a9fdf8fdabe03e5bc27b9af7e5d6254cfc52980cd601563a7cb5588d4fb7e4d.jpg",
|
| 394 |
+
"image_caption": [
|
| 395 |
+
"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.) "
|
| 396 |
+
],
|
| 397 |
+
"image_footnote": [],
|
| 398 |
+
"bbox": [
|
| 399 |
+
308,
|
| 400 |
+
347,
|
| 401 |
+
687,
|
| 402 |
+
472
|
| 403 |
+
],
|
| 404 |
+
"page_idx": 3
|
| 405 |
+
},
|
| 406 |
+
{
|
| 407 |
+
"type": "text",
|
| 408 |
+
"text": "3.1 Transformers can in-context learn linear functions ",
|
| 409 |
+
"text_level": 1,
|
| 410 |
+
"bbox": [
|
| 411 |
+
173,
|
| 412 |
+
607,
|
| 413 |
+
563,
|
| 414 |
+
621
|
| 415 |
+
],
|
| 416 |
+
"page_idx": 3
|
| 417 |
+
},
|
| 418 |
+
{
|
| 419 |
+
"type": "text",
|
| 420 |
+
"text": "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. ",
|
| 421 |
+
"bbox": [
|
| 422 |
+
173,
|
| 423 |
+
632,
|
| 424 |
+
825,
|
| 425 |
+
743
|
| 426 |
+
],
|
| 427 |
+
"page_idx": 3
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"type": "text",
|
| 431 |
+
"text": "3.2 What functions is the model learning in-context? ",
|
| 432 |
+
"text_level": 1,
|
| 433 |
+
"bbox": [
|
| 434 |
+
174,
|
| 435 |
+
760,
|
| 436 |
+
550,
|
| 437 |
+
775
|
| 438 |
+
],
|
| 439 |
+
"page_idx": 3
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"type": "text",
|
| 443 |
+
"text": "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. ",
|
| 444 |
+
"bbox": [
|
| 445 |
+
173,
|
| 446 |
+
785,
|
| 447 |
+
825,
|
| 448 |
+
875
|
| 449 |
+
],
|
| 450 |
+
"page_idx": 3
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"type": "text",
|
| 454 |
+
"text": "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. ",
|
| 455 |
+
"bbox": [
|
| 456 |
+
173,
|
| 457 |
+
881,
|
| 458 |
+
821,
|
| 459 |
+
912
|
| 460 |
+
],
|
| 461 |
+
"page_idx": 3
|
| 462 |
+
},
|
| 463 |
+
{
|
| 464 |
+
"type": "text",
|
| 465 |
+
"text": "",
|
| 466 |
+
"bbox": [
|
| 467 |
+
173,
|
| 468 |
+
89,
|
| 469 |
+
826,
|
| 470 |
+
181
|
| 471 |
+
],
|
| 472 |
+
"page_idx": 4
|
| 473 |
+
},
|
| 474 |
+
{
|
| 475 |
+
"type": "image",
|
| 476 |
+
"img_path": "images/e89618413d5e321d3fade2d4d9c10f25efd6c69162626520962bf7b871fca32a.jpg",
|
| 477 |
+
"image_caption": [
|
| 478 |
+
"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. "
|
| 479 |
+
],
|
| 480 |
+
"image_footnote": [],
|
| 481 |
+
"bbox": [
|
| 482 |
+
187,
|
| 483 |
+
195,
|
| 484 |
+
816,
|
| 485 |
+
344
|
| 486 |
+
],
|
| 487 |
+
"page_idx": 4
|
| 488 |
+
},
|
| 489 |
+
{
|
| 490 |
+
"type": "text",
|
| 491 |
+
"text": "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. ",
|
| 492 |
+
"bbox": [
|
| 493 |
+
173,
|
| 494 |
+
478,
|
| 495 |
+
826,
|
| 496 |
+
616
|
| 497 |
+
],
|
| 498 |
+
"page_idx": 4
|
| 499 |
+
},
|
| 500 |
+
{
|
| 501 |
+
"type": "text",
|
| 502 |
+
"text": "4 Extrapolating beyond the training distribution ",
|
| 503 |
+
"text_level": 1,
|
| 504 |
+
"bbox": [
|
| 505 |
+
174,
|
| 506 |
+
635,
|
| 507 |
+
593,
|
| 508 |
+
652
|
| 509 |
+
],
|
| 510 |
+
"page_idx": 4
|
| 511 |
+
},
|
| 512 |
+
{
|
| 513 |
+
"type": "text",
|
| 514 |
+
"text": "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. ",
|
| 515 |
+
"bbox": [
|
| 516 |
+
173,
|
| 517 |
+
666,
|
| 518 |
+
825,
|
| 519 |
+
750
|
| 520 |
+
],
|
| 521 |
+
"page_idx": 4
|
| 522 |
+
},
|
| 523 |
+
{
|
| 524 |
+
"type": "text",
|
| 525 |
+
"text": "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 } }$ ). ",
|
| 526 |
+
"bbox": [
|
| 527 |
+
174,
|
| 528 |
+
756,
|
| 529 |
+
825,
|
| 530 |
+
829
|
| 531 |
+
],
|
| 532 |
+
"page_idx": 4
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"type": "text",
|
| 536 |
+
"text": "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 ",
|
| 537 |
+
"bbox": [
|
| 538 |
+
174,
|
| 539 |
+
834,
|
| 540 |
+
823,
|
| 541 |
+
864
|
| 542 |
+
],
|
| 543 |
+
"page_idx": 4
|
| 544 |
+
},
|
| 545 |
+
{
|
| 546 |
+
"type": "text",
|
| 547 |
+
"text": "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 \n2. 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 } }$ . ",
|
| 548 |
+
"bbox": [
|
| 549 |
+
205,
|
| 550 |
+
873,
|
| 551 |
+
825,
|
| 552 |
+
912
|
| 553 |
+
],
|
| 554 |
+
"page_idx": 4
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"type": "text",
|
| 558 |
+
"text": "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. ",
|
| 559 |
+
"bbox": [
|
| 560 |
+
173,
|
| 561 |
+
90,
|
| 562 |
+
826,
|
| 563 |
+
147
|
| 564 |
+
],
|
| 565 |
+
"page_idx": 5
|
| 566 |
+
},
|
| 567 |
+
{
|
| 568 |
+
"type": "text",
|
| 569 |
+
"text": "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$ . ",
|
| 570 |
+
"bbox": [
|
| 571 |
+
173,
|
| 572 |
+
151,
|
| 573 |
+
823,
|
| 574 |
+
183
|
| 575 |
+
],
|
| 576 |
+
"page_idx": 5
|
| 577 |
+
},
|
| 578 |
+
{
|
| 579 |
+
"type": "image",
|
| 580 |
+
"img_path": "images/cc67c503400740c3c755f100aa63680b14e70b432cab4a154c35a38909e4c812.jpg",
|
| 581 |
+
"image_caption": [
|
| 582 |
+
"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. "
|
| 583 |
+
],
|
| 584 |
+
"image_footnote": [],
|
| 585 |
+
"bbox": [
|
| 586 |
+
187,
|
| 587 |
+
195,
|
| 588 |
+
807,
|
| 589 |
+
335
|
| 590 |
+
],
|
| 591 |
+
"page_idx": 5
|
| 592 |
+
},
|
| 593 |
+
{
|
| 594 |
+
"type": "text",
|
| 595 |
+
"text": "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. ",
|
| 596 |
+
"bbox": [
|
| 597 |
+
173,
|
| 598 |
+
425,
|
| 599 |
+
825,
|
| 600 |
+
523
|
| 601 |
+
],
|
| 602 |
+
"page_idx": 5
|
| 603 |
+
},
|
| 604 |
+
{
|
| 605 |
+
"type": "text",
|
| 606 |
+
"text": "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. ",
|
| 607 |
+
"bbox": [
|
| 608 |
+
174,
|
| 609 |
+
529,
|
| 610 |
+
825,
|
| 611 |
+
613
|
| 612 |
+
],
|
| 613 |
+
"page_idx": 5
|
| 614 |
+
},
|
| 615 |
+
{
|
| 616 |
+
"type": "text",
|
| 617 |
+
"text": "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). ",
|
| 618 |
+
"bbox": [
|
| 619 |
+
173,
|
| 620 |
+
619,
|
| 621 |
+
825,
|
| 622 |
+
731
|
| 623 |
+
],
|
| 624 |
+
"page_idx": 5
|
| 625 |
+
},
|
| 626 |
+
{
|
| 627 |
+
"type": "text",
|
| 628 |
+
"text": "5 More complex function classes ",
|
| 629 |
+
"text_level": 1,
|
| 630 |
+
"bbox": [
|
| 631 |
+
176,
|
| 632 |
+
748,
|
| 633 |
+
459,
|
| 634 |
+
766
|
| 635 |
+
],
|
| 636 |
+
"page_idx": 5
|
| 637 |
+
},
|
| 638 |
+
{
|
| 639 |
+
"type": "text",
|
| 640 |
+
"text": "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). ",
|
| 641 |
+
"bbox": [
|
| 642 |
+
173,
|
| 643 |
+
779,
|
| 644 |
+
825,
|
| 645 |
+
877
|
| 646 |
+
],
|
| 647 |
+
"page_idx": 5
|
| 648 |
+
},
|
| 649 |
+
{
|
| 650 |
+
"type": "text",
|
| 651 |
+
"text": "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. ",
|
| 652 |
+
"bbox": [
|
| 653 |
+
173,
|
| 654 |
+
882,
|
| 655 |
+
823,
|
| 656 |
+
912
|
| 657 |
+
],
|
| 658 |
+
"page_idx": 5
|
| 659 |
+
},
|
| 660 |
+
{
|
| 661 |
+
"type": "text",
|
| 662 |
+
"text": "",
|
| 663 |
+
"bbox": [
|
| 664 |
+
173,
|
| 665 |
+
90,
|
| 666 |
+
825,
|
| 667 |
+
203
|
| 668 |
+
],
|
| 669 |
+
"page_idx": 6
|
| 670 |
+
},
|
| 671 |
+
{
|
| 672 |
+
"type": "image",
|
| 673 |
+
"img_path": "images/e18659d208d382aca90b941fd779c53e3aa4ccfcb87ff00ad6a5d74547371766.jpg",
|
| 674 |
+
"image_caption": [
|
| 675 |
+
"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). "
|
| 676 |
+
],
|
| 677 |
+
"image_footnote": [],
|
| 678 |
+
"bbox": [
|
| 679 |
+
220,
|
| 680 |
+
215,
|
| 681 |
+
815,
|
| 682 |
+
496
|
| 683 |
+
],
|
| 684 |
+
"page_idx": 6
|
| 685 |
+
},
|
| 686 |
+
{
|
| 687 |
+
"type": "text",
|
| 688 |
+
"text": "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). ",
|
| 689 |
+
"bbox": [
|
| 690 |
+
174,
|
| 691 |
+
670,
|
| 692 |
+
825,
|
| 693 |
+
863
|
| 694 |
+
],
|
| 695 |
+
"page_idx": 6
|
| 696 |
+
},
|
| 697 |
+
{
|
| 698 |
+
"type": "text",
|
| 699 |
+
"text": "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). ",
|
| 700 |
+
"bbox": [
|
| 701 |
+
174,
|
| 702 |
+
869,
|
| 703 |
+
825,
|
| 704 |
+
911
|
| 705 |
+
],
|
| 706 |
+
"page_idx": 6
|
| 707 |
+
},
|
| 708 |
+
{
|
| 709 |
+
"type": "text",
|
| 710 |
+
"text": "",
|
| 711 |
+
"bbox": [
|
| 712 |
+
173,
|
| 713 |
+
90,
|
| 714 |
+
825,
|
| 715 |
+
217
|
| 716 |
+
],
|
| 717 |
+
"page_idx": 7
|
| 718 |
+
},
|
| 719 |
+
{
|
| 720 |
+
"type": "text",
|
| 721 |
+
"text": "6 Investigating what matters for in-context learning ",
|
| 722 |
+
"text_level": 1,
|
| 723 |
+
"bbox": [
|
| 724 |
+
173,
|
| 725 |
+
236,
|
| 726 |
+
620,
|
| 727 |
+
253
|
| 728 |
+
],
|
| 729 |
+
"page_idx": 7
|
| 730 |
+
},
|
| 731 |
+
{
|
| 732 |
+
"type": "text",
|
| 733 |
+
"text": "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. ",
|
| 734 |
+
"bbox": [
|
| 735 |
+
173,
|
| 736 |
+
268,
|
| 737 |
+
823,
|
| 738 |
+
296
|
| 739 |
+
],
|
| 740 |
+
"page_idx": 7
|
| 741 |
+
},
|
| 742 |
+
{
|
| 743 |
+
"type": "text",
|
| 744 |
+
"text": "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. ",
|
| 745 |
+
"bbox": [
|
| 746 |
+
173,
|
| 747 |
+
303,
|
| 748 |
+
825,
|
| 749 |
+
469
|
| 750 |
+
],
|
| 751 |
+
"page_idx": 7
|
| 752 |
+
},
|
| 753 |
+
{
|
| 754 |
+
"type": "image",
|
| 755 |
+
"img_path": "images/b90712d93bae93616f1cffcd684dd8843cdd5c55ab9730f0856c5cb14ceb7620.jpg",
|
| 756 |
+
"image_caption": [
|
| 757 |
+
"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.) "
|
| 758 |
+
],
|
| 759 |
+
"image_footnote": [],
|
| 760 |
+
"bbox": [
|
| 761 |
+
199,
|
| 762 |
+
484,
|
| 763 |
+
787,
|
| 764 |
+
616
|
| 765 |
+
],
|
| 766 |
+
"page_idx": 7
|
| 767 |
+
},
|
| 768 |
+
{
|
| 769 |
+
"type": "text",
|
| 770 |
+
"text": "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. ",
|
| 771 |
+
"bbox": [
|
| 772 |
+
174,
|
| 773 |
+
738,
|
| 774 |
+
825,
|
| 775 |
+
877
|
| 776 |
+
],
|
| 777 |
+
"page_idx": 7
|
| 778 |
+
},
|
| 779 |
+
{
|
| 780 |
+
"type": "text",
|
| 781 |
+
"text": "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”. ",
|
| 782 |
+
"bbox": [
|
| 783 |
+
173,
|
| 784 |
+
883,
|
| 785 |
+
823,
|
| 786 |
+
911
|
| 787 |
+
],
|
| 788 |
+
"page_idx": 7
|
| 789 |
+
},
|
| 790 |
+
{
|
| 791 |
+
"type": "text",
|
| 792 |
+
"text": "",
|
| 793 |
+
"bbox": [
|
| 794 |
+
176,
|
| 795 |
+
92,
|
| 796 |
+
823,
|
| 797 |
+
132
|
| 798 |
+
],
|
| 799 |
+
"page_idx": 8
|
| 800 |
+
},
|
| 801 |
+
{
|
| 802 |
+
"type": "text",
|
| 803 |
+
"text": "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). ",
|
| 804 |
+
"bbox": [
|
| 805 |
+
173,
|
| 806 |
+
140,
|
| 807 |
+
825,
|
| 808 |
+
319
|
| 809 |
+
],
|
| 810 |
+
"page_idx": 8
|
| 811 |
+
},
|
| 812 |
+
{
|
| 813 |
+
"type": "text",
|
| 814 |
+
"text": "7 Related work ",
|
| 815 |
+
"text_level": 1,
|
| 816 |
+
"bbox": [
|
| 817 |
+
174,
|
| 818 |
+
349,
|
| 819 |
+
316,
|
| 820 |
+
366
|
| 821 |
+
],
|
| 822 |
+
"page_idx": 8
|
| 823 |
+
},
|
| 824 |
+
{
|
| 825 |
+
"type": "text",
|
| 826 |
+
"text": "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. ",
|
| 827 |
+
"bbox": [
|
| 828 |
+
174,
|
| 829 |
+
386,
|
| 830 |
+
825,
|
| 831 |
+
650
|
| 832 |
+
],
|
| 833 |
+
"page_idx": 8
|
| 834 |
+
},
|
| 835 |
+
{
|
| 836 |
+
"type": "text",
|
| 837 |
+
"text": "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. ",
|
| 838 |
+
"bbox": [
|
| 839 |
+
174,
|
| 840 |
+
656,
|
| 841 |
+
825,
|
| 842 |
+
821
|
| 843 |
+
],
|
| 844 |
+
"page_idx": 8
|
| 845 |
+
},
|
| 846 |
+
{
|
| 847 |
+
"type": "text",
|
| 848 |
+
"text": "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. ",
|
| 849 |
+
"bbox": [
|
| 850 |
+
174,
|
| 851 |
+
828,
|
| 852 |
+
825,
|
| 853 |
+
911
|
| 854 |
+
],
|
| 855 |
+
"page_idx": 8
|
| 856 |
+
},
|
| 857 |
+
{
|
| 858 |
+
"type": "text",
|
| 859 |
+
"text": "",
|
| 860 |
+
"bbox": [
|
| 861 |
+
171,
|
| 862 |
+
92,
|
| 863 |
+
825,
|
| 864 |
+
119
|
| 865 |
+
],
|
| 866 |
+
"page_idx": 9
|
| 867 |
+
},
|
| 868 |
+
{
|
| 869 |
+
"type": "text",
|
| 870 |
+
"text": "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. ",
|
| 871 |
+
"bbox": [
|
| 872 |
+
174,
|
| 873 |
+
126,
|
| 874 |
+
823,
|
| 875 |
+
195
|
| 876 |
+
],
|
| 877 |
+
"page_idx": 9
|
| 878 |
+
},
|
| 879 |
+
{
|
| 880 |
+
"type": "text",
|
| 881 |
+
"text": "8 Discussion ",
|
| 882 |
+
"text_level": 1,
|
| 883 |
+
"bbox": [
|
| 884 |
+
173,
|
| 885 |
+
214,
|
| 886 |
+
292,
|
| 887 |
+
231
|
| 888 |
+
],
|
| 889 |
+
"page_idx": 9
|
| 890 |
+
},
|
| 891 |
+
{
|
| 892 |
+
"type": "text",
|
| 893 |
+
"text": "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. ",
|
| 894 |
+
"bbox": [
|
| 895 |
+
174,
|
| 896 |
+
246,
|
| 897 |
+
825,
|
| 898 |
+
329
|
| 899 |
+
],
|
| 900 |
+
"page_idx": 9
|
| 901 |
+
},
|
| 902 |
+
{
|
| 903 |
+
"type": "text",
|
| 904 |
+
"text": "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. ",
|
| 905 |
+
"bbox": [
|
| 906 |
+
174,
|
| 907 |
+
335,
|
| 908 |
+
825,
|
| 909 |
+
433
|
| 910 |
+
],
|
| 911 |
+
"page_idx": 9
|
| 912 |
+
},
|
| 913 |
+
{
|
| 914 |
+
"type": "text",
|
| 915 |
+
"text": "Our work lays the groundwork for several future directions. ",
|
| 916 |
+
"bbox": [
|
| 917 |
+
173,
|
| 918 |
+
439,
|
| 919 |
+
563,
|
| 920 |
+
452
|
| 921 |
+
],
|
| 922 |
+
"page_idx": 9
|
| 923 |
+
},
|
| 924 |
+
{
|
| 925 |
+
"type": "text",
|
| 926 |
+
"text": "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. ",
|
| 927 |
+
"bbox": [
|
| 928 |
+
174,
|
| 929 |
+
459,
|
| 930 |
+
825,
|
| 931 |
+
529
|
| 932 |
+
],
|
| 933 |
+
"page_idx": 9
|
| 934 |
+
},
|
| 935 |
+
{
|
| 936 |
+
"type": "text",
|
| 937 |
+
"text": "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)? ",
|
| 938 |
+
"bbox": [
|
| 939 |
+
174,
|
| 940 |
+
535,
|
| 941 |
+
825,
|
| 942 |
+
590
|
| 943 |
+
],
|
| 944 |
+
"page_idx": 9
|
| 945 |
+
},
|
| 946 |
+
{
|
| 947 |
+
"type": "text",
|
| 948 |
+
"text": "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? ",
|
| 949 |
+
"bbox": [
|
| 950 |
+
174,
|
| 951 |
+
597,
|
| 952 |
+
825,
|
| 953 |
+
652
|
| 954 |
+
],
|
| 955 |
+
"page_idx": 9
|
| 956 |
+
},
|
| 957 |
+
{
|
| 958 |
+
"type": "text",
|
| 959 |
+
"text": "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. ",
|
| 960 |
+
"bbox": [
|
| 961 |
+
174,
|
| 962 |
+
659,
|
| 963 |
+
825,
|
| 964 |
+
770
|
| 965 |
+
],
|
| 966 |
+
"page_idx": 9
|
| 967 |
+
},
|
| 968 |
+
{
|
| 969 |
+
"type": "text",
|
| 970 |
+
"text": "Acknowledgements ",
|
| 971 |
+
"text_level": 1,
|
| 972 |
+
"bbox": [
|
| 973 |
+
176,
|
| 974 |
+
789,
|
| 975 |
+
338,
|
| 976 |
+
806
|
| 977 |
+
],
|
| 978 |
+
"page_idx": 9
|
| 979 |
+
},
|
| 980 |
+
{
|
| 981 |
+
"type": "text",
|
| 982 |
+
"text": "We thank Niladri Chatterji, Micah Goldblum, Rohith Kuditipudi, Shibani Santurkar, Carmen Strassle, Mirac Sugzun, Li-Yang Tan, and anonymous reviewers for helpful comments. ",
|
| 983 |
+
"bbox": [
|
| 984 |
+
176,
|
| 985 |
+
820,
|
| 986 |
+
823,
|
| 987 |
+
849
|
| 988 |
+
],
|
| 989 |
+
"page_idx": 9
|
| 990 |
+
},
|
| 991 |
+
{
|
| 992 |
+
"type": "text",
|
| 993 |
+
"text": "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. ",
|
| 994 |
+
"bbox": [
|
| 995 |
+
176,
|
| 996 |
+
854,
|
| 997 |
+
825,
|
| 998 |
+
910
|
| 999 |
+
],
|
| 1000 |
+
"page_idx": 9
|
| 1001 |
+
},
|
| 1002 |
+
{
|
| 1003 |
+
"type": "text",
|
| 1004 |
+
"text": "References \n[1] Maria-Florina Balcan. Data-driven algorithm design. In Tim Roughgarden, editor, Beyond Worst Case Analysis of Algorithms. Cambridge University Press, 2020. \n[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. \n[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. \n[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. \n[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. \n[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. \n[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. \n[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. \n[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. \n[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. \n[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. \n[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. \n[13] Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In conference on knowledge discovery and data mining (KDD), 2016. \n[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. \n[15] Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser. Universal transformers. arXiv preprint arXiv:1807.03819, 2018. \n[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. \n[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. \n[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. \n[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. \n[20] Jeffrey L Elman. Learning and development in neural networks: The importance of starting small. Cognition, 1993. \n[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. \n[22] Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, 2001. \n[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. \n[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. \n[25] Michael Hahn. Theoretical limitations of self-attention in neural sequence models. Transactions of the Association for Computational Linguistics, 2020. \n[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. \n[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. \n[28] Timothy Hospedales, Antreas Antoniou, Paul Micaelli, and Amos Storkey. Meta-learning in neural networks: A survey. arXiv preprint arXiv:2004.05439, 2020. \n[29] Elias Khalil, Hanjun Dai, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. Neural Information Processing Systems (NeurIPS), 2017. \n[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. \n[31] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. \n[32] Louis Kirsch and Jürgen Schmidhuber. Meta learning backpropagation and improving it. Neural Information Processing Systems (NeurIPS), 2021. \n[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. \n[34] Ke Li and Jitendra Malik. Learning to optimize. arXiv preprint arXiv:1606.01885, 2016. \n[35] Opher Lieber, Or Sharir, Barak Lenz, and Yoav Shoham. Jurassic-1: Technical details and evaluation. White Paper. AI21 Labs, 2021. \n[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. \n[37] Kevin Lu, Aditya Grover, Pieter Abbeel, and Igor Mordatch. Pretrained transformers as universal computation engines. arXiv preprint arXiv:2103.05247, 2021. ",
|
| 1005 |
+
"bbox": [
|
| 1006 |
+
171,
|
| 1007 |
+
82,
|
| 1008 |
+
828,
|
| 1009 |
+
915
|
| 1010 |
+
],
|
| 1011 |
+
"page_idx": 10
|
| 1012 |
+
},
|
| 1013 |
+
{
|
| 1014 |
+
"type": "text",
|
| 1015 |
+
"text": "",
|
| 1016 |
+
"bbox": [
|
| 1017 |
+
171,
|
| 1018 |
+
79,
|
| 1019 |
+
828,
|
| 1020 |
+
915
|
| 1021 |
+
],
|
| 1022 |
+
"page_idx": 11
|
| 1023 |
+
},
|
| 1024 |
+
{
|
| 1025 |
+
"type": "text",
|
| 1026 |
+
"text": "[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. ",
|
| 1027 |
+
"bbox": [
|
| 1028 |
+
173,
|
| 1029 |
+
90,
|
| 1030 |
+
823,
|
| 1031 |
+
133
|
| 1032 |
+
],
|
| 1033 |
+
"page_idx": 12
|
| 1034 |
+
},
|
| 1035 |
+
{
|
| 1036 |
+
"type": "text",
|
| 1037 |
+
"text": "[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. ",
|
| 1038 |
+
"bbox": [
|
| 1039 |
+
173,
|
| 1040 |
+
143,
|
| 1041 |
+
821,
|
| 1042 |
+
172
|
| 1043 |
+
],
|
| 1044 |
+
"page_idx": 12
|
| 1045 |
+
},
|
| 1046 |
+
{
|
| 1047 |
+
"type": "text",
|
| 1048 |
+
"text": "[40] Sewon Min, Mike Lewis, Luke Zettlemoyer, and Hannaneh Hajishirzi. Metaicl: Learning to learn in context. arXiv preprint arXiv:2110.15943, 2021. ",
|
| 1049 |
+
"bbox": [
|
| 1050 |
+
174,
|
| 1051 |
+
183,
|
| 1052 |
+
821,
|
| 1053 |
+
212
|
| 1054 |
+
],
|
| 1055 |
+
"page_idx": 12
|
| 1056 |
+
},
|
| 1057 |
+
{
|
| 1058 |
+
"type": "text",
|
| 1059 |
+
"text": "[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. ",
|
| 1060 |
+
"bbox": [
|
| 1061 |
+
173,
|
| 1062 |
+
222,
|
| 1063 |
+
823,
|
| 1064 |
+
265
|
| 1065 |
+
],
|
| 1066 |
+
"page_idx": 12
|
| 1067 |
+
},
|
| 1068 |
+
{
|
| 1069 |
+
"type": "text",
|
| 1070 |
+
"text": "[42] Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta-learner. In International Conference on Learning Representations (ICLR), 2018. ",
|
| 1071 |
+
"bbox": [
|
| 1072 |
+
173,
|
| 1073 |
+
275,
|
| 1074 |
+
823,
|
| 1075 |
+
304
|
| 1076 |
+
],
|
| 1077 |
+
"page_idx": 12
|
| 1078 |
+
},
|
| 1079 |
+
{
|
| 1080 |
+
"type": "text",
|
| 1081 |
+
"text": "[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. ",
|
| 1082 |
+
"bbox": [
|
| 1083 |
+
173,
|
| 1084 |
+
314,
|
| 1085 |
+
825,
|
| 1086 |
+
344
|
| 1087 |
+
],
|
| 1088 |
+
"page_idx": 12
|
| 1089 |
+
},
|
| 1090 |
+
{
|
| 1091 |
+
"type": "text",
|
| 1092 |
+
"text": "[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. ",
|
| 1093 |
+
"bbox": [
|
| 1094 |
+
174,
|
| 1095 |
+
353,
|
| 1096 |
+
823,
|
| 1097 |
+
382
|
| 1098 |
+
],
|
| 1099 |
+
"page_idx": 12
|
| 1100 |
+
},
|
| 1101 |
+
{
|
| 1102 |
+
"type": "text",
|
| 1103 |
+
"text": "[45] Devang K Naik and Richard J Mammone. Meta-neural networks that learn by learning. In International Joint Conference on Neural Networks (IJCNN), 1992. ",
|
| 1104 |
+
"bbox": [
|
| 1105 |
+
171,
|
| 1106 |
+
392,
|
| 1107 |
+
825,
|
| 1108 |
+
421
|
| 1109 |
+
],
|
| 1110 |
+
"page_idx": 12
|
| 1111 |
+
},
|
| 1112 |
+
{
|
| 1113 |
+
"type": "text",
|
| 1114 |
+
"text": "[46] Preetum Nakkiran. More data can hurt for linear regression: Sample-wise double descent. arXiv preprint arXiv:1912.07242, 2019. ",
|
| 1115 |
+
"bbox": [
|
| 1116 |
+
174,
|
| 1117 |
+
431,
|
| 1118 |
+
823,
|
| 1119 |
+
460
|
| 1120 |
+
],
|
| 1121 |
+
"page_idx": 12
|
| 1122 |
+
},
|
| 1123 |
+
{
|
| 1124 |
+
"type": "text",
|
| 1125 |
+
"text": "[47] Tung Nguyen and Aditya Grover. Transformer neural processes: Uncertainty-aware meta learning via sequence modeling. arXiv preprint arXiv:2207.04179, 2022. ",
|
| 1126 |
+
"bbox": [
|
| 1127 |
+
173,
|
| 1128 |
+
470,
|
| 1129 |
+
820,
|
| 1130 |
+
501
|
| 1131 |
+
],
|
| 1132 |
+
"page_idx": 12
|
| 1133 |
+
},
|
| 1134 |
+
{
|
| 1135 |
+
"type": "text",
|
| 1136 |
+
"text": "[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. ",
|
| 1137 |
+
"bbox": [
|
| 1138 |
+
173,
|
| 1139 |
+
510,
|
| 1140 |
+
826,
|
| 1141 |
+
608
|
| 1142 |
+
],
|
| 1143 |
+
"page_idx": 12
|
| 1144 |
+
},
|
| 1145 |
+
{
|
| 1146 |
+
"type": "text",
|
| 1147 |
+
"text": "[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. ",
|
| 1148 |
+
"bbox": [
|
| 1149 |
+
173,
|
| 1150 |
+
617,
|
| 1151 |
+
823,
|
| 1152 |
+
660
|
| 1153 |
+
],
|
| 1154 |
+
"page_idx": 12
|
| 1155 |
+
},
|
| 1156 |
+
{
|
| 1157 |
+
"type": "text",
|
| 1158 |
+
"text": "[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. ",
|
| 1159 |
+
"bbox": [
|
| 1160 |
+
173,
|
| 1161 |
+
671,
|
| 1162 |
+
826,
|
| 1163 |
+
728
|
| 1164 |
+
],
|
| 1165 |
+
"page_idx": 12
|
| 1166 |
+
},
|
| 1167 |
+
{
|
| 1168 |
+
"type": "text",
|
| 1169 |
+
"text": "[51] Jorge Pérez, Javier Marinkovic, and Pablo Barceló. On the turing completeness of modern ´ neural network architectures. arXiv preprint arXiv:1901.03429, 2019. ",
|
| 1170 |
+
"bbox": [
|
| 1171 |
+
173,
|
| 1172 |
+
738,
|
| 1173 |
+
821,
|
| 1174 |
+
767
|
| 1175 |
+
],
|
| 1176 |
+
"page_idx": 12
|
| 1177 |
+
},
|
| 1178 |
+
{
|
| 1179 |
+
"type": "text",
|
| 1180 |
+
"text": "[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. ",
|
| 1181 |
+
"bbox": [
|
| 1182 |
+
174,
|
| 1183 |
+
777,
|
| 1184 |
+
825,
|
| 1185 |
+
833
|
| 1186 |
+
],
|
| 1187 |
+
"page_idx": 12
|
| 1188 |
+
},
|
| 1189 |
+
{
|
| 1190 |
+
"type": "text",
|
| 1191 |
+
"text": "[53] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. OpenAI blog, 2018. ",
|
| 1192 |
+
"bbox": [
|
| 1193 |
+
171,
|
| 1194 |
+
843,
|
| 1195 |
+
821,
|
| 1196 |
+
873
|
| 1197 |
+
],
|
| 1198 |
+
"page_idx": 12
|
| 1199 |
+
},
|
| 1200 |
+
{
|
| 1201 |
+
"type": "text",
|
| 1202 |
+
"text": "[54] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 2019. ",
|
| 1203 |
+
"bbox": [
|
| 1204 |
+
174,
|
| 1205 |
+
882,
|
| 1206 |
+
820,
|
| 1207 |
+
911
|
| 1208 |
+
],
|
| 1209 |
+
"page_idx": 12
|
| 1210 |
+
},
|
| 1211 |
+
{
|
| 1212 |
+
"type": "text",
|
| 1213 |
+
"text": "[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. \n[56] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. International Conference for Learning Representations (ICLR), 2017. \n[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. \n[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/. \n[59] Ohad Rubin, Jonathan Herzig, and Jonathan Berant. Learning to retrieve prompts for in-context learning. arXiv preprint arXiv:2112.08633, 2021. \n[60] Terence D Sanger. Neural network learning control of robot manipulators using gradually increasing task difficulty. IEEE transactions on Robotics and Automation, 1994. \n[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. \n[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. \n[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. \n[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. \n[65] Charlie Snell, Ruiqi Zhong, Dan Klein, and Jacob Steinhardt. Approximating how single head attention learns. arXiv preprint arXiv:2103.07601, 2021. \n[66] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. Neural Information Processing Systems (NeurIPS), 2017. \n[67] Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 2012. \n[68] Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 1996. \n[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. \n[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. \n[71] Gail Weiss, Yoav Goldberg, and Eran Yahav. Thinking like transformers. In International Conference on Machine Learning, 2021. \n[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. \n[73] Xiaoxia Wu, Ethan Dyer, and Behnam Neyshabur. When do curricula work? arXiv preprint arXiv:2012.03107, 2020. \n[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. \n[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. \n[76] Shunyu Yao, Binghui Peng, Christos Papadimitriou, and Karthik Narasimhan. Self-attention networks can process bounded hierarchical languages. arXiv preprint arXiv:2105.11115, 2021. \n[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. \n[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. \n[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. ",
|
| 1214 |
+
"bbox": [
|
| 1215 |
+
169,
|
| 1216 |
+
58,
|
| 1217 |
+
828,
|
| 1218 |
+
921
|
| 1219 |
+
],
|
| 1220 |
+
"page_idx": 13
|
| 1221 |
+
},
|
| 1222 |
+
{
|
| 1223 |
+
"type": "text",
|
| 1224 |
+
"text": "",
|
| 1225 |
+
"bbox": [
|
| 1226 |
+
171,
|
| 1227 |
+
90,
|
| 1228 |
+
828,
|
| 1229 |
+
404
|
| 1230 |
+
],
|
| 1231 |
+
"page_idx": 14
|
| 1232 |
+
},
|
| 1233 |
+
{
|
| 1234 |
+
"type": "text",
|
| 1235 |
+
"text": "Checklist ",
|
| 1236 |
+
"text_level": 1,
|
| 1237 |
+
"bbox": [
|
| 1238 |
+
174,
|
| 1239 |
+
89,
|
| 1240 |
+
254,
|
| 1241 |
+
106
|
| 1242 |
+
],
|
| 1243 |
+
"page_idx": 15
|
| 1244 |
+
},
|
| 1245 |
+
{
|
| 1246 |
+
"type": "text",
|
| 1247 |
+
"text": "1. For all authors... ",
|
| 1248 |
+
"bbox": [
|
| 1249 |
+
214,
|
| 1250 |
+
116,
|
| 1251 |
+
339,
|
| 1252 |
+
130
|
| 1253 |
+
],
|
| 1254 |
+
"page_idx": 15
|
| 1255 |
+
},
|
| 1256 |
+
{
|
| 1257 |
+
"type": "text",
|
| 1258 |
+
"text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] \n(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. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
|
| 1259 |
+
"bbox": [
|
| 1260 |
+
238,
|
| 1261 |
+
136,
|
| 1262 |
+
825,
|
| 1263 |
+
239
|
| 1264 |
+
],
|
| 1265 |
+
"page_idx": 15
|
| 1266 |
+
},
|
| 1267 |
+
{
|
| 1268 |
+
"type": "text",
|
| 1269 |
+
"text": "2. If you are including theoretical results... ",
|
| 1270 |
+
"bbox": [
|
| 1271 |
+
214,
|
| 1272 |
+
243,
|
| 1273 |
+
493,
|
| 1274 |
+
258
|
| 1275 |
+
],
|
| 1276 |
+
"page_idx": 15
|
| 1277 |
+
},
|
| 1278 |
+
{
|
| 1279 |
+
"type": "text",
|
| 1280 |
+
"text": "(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] ",
|
| 1281 |
+
"bbox": [
|
| 1282 |
+
238,
|
| 1283 |
+
262,
|
| 1284 |
+
738,
|
| 1285 |
+
294
|
| 1286 |
+
],
|
| 1287 |
+
"page_idx": 15
|
| 1288 |
+
},
|
| 1289 |
+
{
|
| 1290 |
+
"type": "text",
|
| 1291 |
+
"text": "3. If you ran experiments... ",
|
| 1292 |
+
"bbox": [
|
| 1293 |
+
212,
|
| 1294 |
+
299,
|
| 1295 |
+
393,
|
| 1296 |
+
313
|
| 1297 |
+
],
|
| 1298 |
+
"page_idx": 15
|
| 1299 |
+
},
|
| 1300 |
+
{
|
| 1301 |
+
"type": "text",
|
| 1302 |
+
"text": "(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. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Appendix A. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] \n(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. ",
|
| 1303 |
+
"bbox": [
|
| 1304 |
+
238,
|
| 1305 |
+
316,
|
| 1306 |
+
825,
|
| 1307 |
+
435
|
| 1308 |
+
],
|
| 1309 |
+
"page_idx": 15
|
| 1310 |
+
},
|
| 1311 |
+
{
|
| 1312 |
+
"type": "text",
|
| 1313 |
+
"text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
|
| 1314 |
+
"bbox": [
|
| 1315 |
+
220,
|
| 1316 |
+
439,
|
| 1317 |
+
823,
|
| 1318 |
+
454
|
| 1319 |
+
],
|
| 1320 |
+
"page_idx": 15
|
| 1321 |
+
},
|
| 1322 |
+
{
|
| 1323 |
+
"type": "text",
|
| 1324 |
+
"text": "(a) If your work uses existing assets, did you cite the creators? [N/A] \n(b) Did you mention the license of the assets? [N/A] \n(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
|
| 1325 |
+
"bbox": [
|
| 1326 |
+
238,
|
| 1327 |
+
458,
|
| 1328 |
+
825,
|
| 1329 |
+
579
|
| 1330 |
+
],
|
| 1331 |
+
"page_idx": 15
|
| 1332 |
+
},
|
| 1333 |
+
{
|
| 1334 |
+
"type": "text",
|
| 1335 |
+
"text": "5. If you used crowdsourcing or conducted research with human subjects... ",
|
| 1336 |
+
"bbox": [
|
| 1337 |
+
214,
|
| 1338 |
+
583,
|
| 1339 |
+
705,
|
| 1340 |
+
598
|
| 1341 |
+
],
|
| 1342 |
+
"page_idx": 15
|
| 1343 |
+
},
|
| 1344 |
+
{
|
| 1345 |
+
"type": "text",
|
| 1346 |
+
"text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
|
| 1347 |
+
"bbox": [
|
| 1348 |
+
238,
|
| 1349 |
+
602,
|
| 1350 |
+
825,
|
| 1351 |
+
691
|
| 1352 |
+
],
|
| 1353 |
+
"page_idx": 15
|
| 1354 |
+
}
|
| 1355 |
+
]
|
parse/dev/iaYcJKpY2B_/iaYcJKpY2B_.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CODEGEN: AN OPEN LARGE LANGUAGE MODEL FOR CODE WITH MULTI-TURN PROGRAM SYNTHESIS
|
| 2 |
+
|
| 3 |
+
Erik Nijkamp∗, Bo Pang∗, Hiroaki Hayashi∗, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, Caiming Xiong
|
| 4 |
+
|
| 5 |
+
Salesforce Research
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Program synthesis strives to generate a computer program as a solution to a given problem specification, expressed with input-output examples or natural language descriptions. The prevalence of large language models advances the state-of-the-art for program synthesis, though limited training resources and data impede open access to such models. To democratize this, we train and release a family of large language models up to 16.1B parameters, called CODEGEN, on natural language and programming language data, and open source the training library JAXFORMER. We show the utility of the trained model by demonstrating that it is competitive with the previous state-of-the-art on zero-shot Python code generation on HumanEval. We further investigate the multi-step paradigm for program synthesis, where a single program is factorized into multiple prompts specifying subproblems. To this end, we construct an open benchmark, Multi-Turn Programming Benchmark (MTPB), consisting of 115 diverse problem sets that are factorized into multi-turn prompts. Our analysis on MTPB shows that the same intent provided to CODEGEN in multiturn fashion significantly improves program synthesis over that provided as a single turn. We make the training library JAXFORMER and model checkpoints available as open source contribution: https://github.com/salesforce/CodeGen.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Creating a program has typically involved a human entering code by hand. The goal of program synthesis is to automate the coding process, and generate a computer program that satisfies the user’s specified intent. Some have called it the holy grail of computer science (Manna & Waldinger, 1971; Gulwani et al., 2017). Successful program synthesis would not only improve the productivity of experienced programmers but also make programming accessible to a wider audience.
|
| 14 |
+
|
| 15 |
+
Two key challenges arise when striving to achieve program synthesis: (1) the intractability of the search space, and (2) the difficulty of properly specifying user intent. To maintain an expressive search space, one needs a large search space, which poses challenges in efficient search. Previous work (Joshi et al., 2002; Panchekha et al., 2015; Cheung et al., 2013) leverages domain-specific language to restrict the search space; however, this limits the applicability of synthesized programs. On the contrary, while being widely applicable, general-purpose programming languages (e.g., C, Python) introduce an even larger search space for possible programs. To navigate through the enormous program space, we formulate the task as language modeling, learning a conditional distribution of the next token given preceding tokens and leverage transformers (Vaswani et al., 2017) and large-scale self-supervised pre-training. This approach has seen success across modalities (Devlin et al., 2019; Lewis et al., 2020; Dosovitskiy et al., 2021). Likewise, prior works have developed pre-trained language models for programming language understanding (Kanade et al., 2020; Feng et al., 2020).
|
| 16 |
+
|
| 17 |
+
To realize program synthesis successfully, users must employ some means to communicate their intent to the models such as a logical expression (which specifies a logical relation between inputs and outputs of a program), pseudo-code, input-output examples, or a verbalized specifications in natural language. On the one hand, a complete formal specification enjoys the exact specifications of user intent but may require domain expertise and effort from users to translate the intent to such a form. On the other hand, specification merely based on input-output examples is less costly but may under-specify the intent, leading to inaccurate solutions. Previous work has benefited from various methods and their combinations as the input to program synthesis models, including pseudocode (Kulal et al., 2019), a part of a program and its documentation (Chen et al., 2021), or natural language paragraph with input-output examples (Hendrycks et al., 2021). However, we argue that a truly user-friendly form of intent is natural language text.
|
| 18 |
+
|
| 19 |
+
To overcome these challenges, we propose a multi-turn program synthesis approach, where a user communicates with the synthesis system by progressively providing specifications in natural language while receiving responses from the system in the form of synthesized subprograms, such that the user together with the system complete the program in multiple steps. The following two considerations motivate this approach.
|
| 20 |
+
|
| 21 |
+
First, we speculate that factorizing a potentially long and complicated specification into multiple steps would ease the understanding by a model and hence enhance program synthesis. In the multi-turn approach, a model can focus on the specification associated with one subprogram and avoid arduously tracking the complicated dependency among subprograms. This effectively reduces the search space besides the convenience of specifying user intent. Indeed, our speculations are confirmed in our experiments with higher quality synthesized programs through the multi-turn approach.
|
| 22 |
+
|
| 23 |
+
Second, code exhibits a weak pattern of interleaved natural and programming language, which may be exploitable. Such a pattern is formed by programmers who explain the functionality of a program with comments. With the language modeling objective, we hypothesize that the interleaving pattern provides a supervision signal for the model to generate programs given natural language descriptions over multiple turns. The signal is highly noisy or weak, because only a subset of data would exhibit such a pattern, comments may be inaccurate or uninformative, and some of them may even be placed at an irrelevant position. However, up-scaling the model and data size might overcome such weak supervision, allowing the model to develop multi-turn program synthesis capacity. This enables user intent to be expressed in multiple turns, that is, the intent can be decomposed and fulfilled part by part while each turn can easily be expressed in natural language.
|
| 24 |
+
|
| 25 |
+
In this work, we develop a multi-turn programming benchmark to measure the models’ capacity for multi-turn program synthesis. To solve a problem in the benchmark, a model needs to synthesize a program in multiple steps with a user who specifies the intent in each turn in natural language. Please refer to Figure 1 for an example where the model synthesizes a program to extract the user name of an email address. Performance on the benchmark is measured by pass rate on expert-written test cases. To the best of our knowledge, this is the first multi-turn program synthesis benchmark, which allows quantitative analysis of multi-turn program synthesis. With the emergence of multi-turn program synthesis capacity in large language models that benefits problem-solving, we believe this benchmark will foster future research in program synthesis.
|
| 26 |
+
|
| 27 |
+
Our Contributions Our work shares the basic idea of adopting language models for program synthesis with the recent and concurrent efforts (Chen et al., 2021; Austin et al., 2021; Li et al., 2022) with a single-turn user intent specification. In addition, we contribute with respect to four aspects:
|
| 28 |
+
|
| 29 |
+
• We study multi-turn program synthesis emerging in autoregressive models under scaling laws. • We leverage this capacity to introduce a multi-turn program synthesis paradigm. • We investigate its properties quantitatively with a novel multi-turn programming benchmark.1 • We will open source model checkpoints2 and the custom training library: JAXFORMER.3
|
| 30 |
+
|
| 31 |
+
For program synthesis, no large-scale models competitive with Codex are available as open-source. This hinders progress, given that the expensive compute resources required to train these models are only accessible to a limited number of institutions. Our open source contribution allows a wide range of researchers to study and advance these models, which may greatly facilitate research progress.
|
| 32 |
+
|
| 33 |
+
# 2 MODEL TRAINING
|
| 34 |
+
|
| 35 |
+
To evaluate the emergence of multi-turn programming capabilities under scaling laws, we adopt standard transformer-based autoregressive language models, varying (1) the number of model parameters (350M, 2.7B, 6.1B, 16.1B) and (2) the number of tokens of programming languages in the training corpora. For scaling the training, a custom library JAXFORMER for TPU-v4 hardware was developed and will be released as open-source, including the trained model weights.
|
| 36 |
+
|
| 37 |
+
# 2.1 DATASETS
|
| 38 |
+
|
| 39 |
+
The family of CODEGEN models is trained sequentially on three datasets: THEPILE, BIGQUERY, and BIGPYTHON.
|
| 40 |
+
|
| 41 |
+
The natural language dataset THEPILE is an 825.18 GiB English text corpus collected by Gao et al. (2020) for language modeling (MIT license). The dataset is constructed from 22 diverse high-quality subsets, one of which is programming language data collected from GitHub repositories with ${ > } 1 0 0$ stars that constitute $7 . 6 \%$ of the dataset. Since the majority of THEPILE is English text, the resulting models are called as natural language CODEGEN models (CODEGEN-NL).
|
| 42 |
+
|
| 43 |
+
The multi-lingual dataset BIGQUERY is a subset of Google’s publicly available BigQuery dataset, which consists of code (under open-source license) in multiple programming languages. For the multilingual training, the following 6 programming languages are chosen: C, $\mathrm { C } { + + }$ , Go, Java, JavaScript, and Python. Thus, we refer to models trained on the BIGQUERY as multi-lingual CODEGEN models (CODEGEN-MULTI).
|
| 44 |
+
|
| 45 |
+
The mono-lingual dataset BIGPYTHON contains a large amount of data in the programming language, Python. We have compiled public, non-personal information from GitHub consisting of permissively licensed Python code in October 2021. Consequently, we refer to models trained on BIGPYTHON as mono-lingual CODEGEN models (CODEGEN-MONO).
|
| 46 |
+
|
| 47 |
+
The pre-processing follows: (1) filtering, (2) deduplication, (3) tokenization, (4) shuffling, and (5) concatenation. For details on THEPILE, we refer to Gao et al. (2020). For BIGQUERY and BIGPYTHON, we refer to Appendix A. Table 5 summarizes the statistics of the training corpora.
|
| 48 |
+
|
| 49 |
+
# 2.2 MODELS
|
| 50 |
+
|
| 51 |
+
The CODEGEN models are in the form of autoregressive transformers with next-token prediction language modeling as the learning objective trained on a natural language corpus and programming language data curated from GitHub. The models are trained in various sizes with 350M, 2.7B, 6.1B, and 16.1B parameters. The first three configurations allow for direct comparison with open-sourced large language models trained on text corpus, GPT-NEO (350M, 2.7B) (Black et al., 2021) and GPT-J (6B) (Wang & Komatsuzaki, 2021). See Table 6 in Appendix A for model specifications.
|
| 52 |
+
|
| 53 |
+
The CODEGEN models are trained in a sequential nature over datasets. CODEGEN-NL is first trained on THEPILE. CODEGEN-MULTI is initialized from CODEGEN-NL and trained on BIGQUERY. Finally CODEGEN-MONO is initialized from CODEGEN-MULTI and trained on BIGPYTHON.
|
| 54 |
+
|
| 55 |
+
The emergence of program synthesis conditional on descriptions in natural language may stem from the size of the models and data, training objective, and nature of the training data itself. This is called emergence since we do not explicitly train the model on comment-code pairs. Similar phenomena are observed in a wide range of natural language tasks where a large-scale unsupervised language model can solve unseen tasks in a zero-shot fashion (Brown et al., 2020). The emergence phenomena or surprising zero-shot generalization is often attributed to the large scale of the model and the data.
|
| 56 |
+
|
| 57 |
+
While our focus is not to reveal the underlying mechanism on why program synthesis capacity emerges from simple language modeling, we make an attempt to provide an explanation given the nature of our modeling approach and the training data. The data consists of regular code from GitHub (without manual selection), for which some data exhibits a pattern of interleaved natural and programming language, which we believe provides a noisy supervision signal for the program synthesis capacity due to the next-token prediction training objective. However, we emphasize that such a data pattern is highly noisy and weak, because only a subset of data exhibits such a pattern, e.g., comments may be inaccurate or uninformative, and some of them may even be placed at an irrelevant position. Therefore, we believe two main factors contribute to the program synthesis capacity: 1) large scale of model size and data size and 2) noisy signal in training data.
|
| 58 |
+
|
| 59 |
+
Table 1: Evaluation results on the HumanEval benchmark. Each pass $@ k$ (where $k \in \{ 1 , 1 0 , 1 0 0 \} )$ for each model is computed with three sampling temperatures $( t \in \{ 0 . 2 , 0 . 6 , 0 . 8 \} )$ and the highest one among the three are displayed, which follows the evaluation procedure in Chen et al. (2021). Results for the model marked with ∗ are from Chen et al. (2022).
|
| 60 |
+
|
| 61 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">pass@k [%]</td></tr><tr><td>k=1</td><td>k=10</td><td>k =100</td></tr><tr><td>GPT-NEO 350M</td><td>0.85</td><td>2.55</td><td>5.95</td></tr><tr><td>GPT-NEO 2.7B</td><td>6.41</td><td>11.27</td><td>21.37</td></tr><tr><td>GPT-J 6B</td><td>11.62</td><td>15.74</td><td>27.74</td></tr><tr><td>CODEX 300M</td><td>13.17</td><td>20.37</td><td>36.27</td></tr><tr><td>CODEX 2.5B</td><td>21.36</td><td>35.42</td><td>59.50</td></tr><tr><td>CODEX 12B</td><td>28.81</td><td>46.81</td><td>72.31</td></tr><tr><td>code-cushman-001*</td><td>33.5</td><td>54.3</td><td>77.4</td></tr><tr><td>code-davinci-001*</td><td>39.0</td><td>60.6</td><td>84.1</td></tr><tr><td>code-davinci-002*</td><td>47.0</td><td>74.9</td><td>92.1</td></tr><tr><td>CODEGEN-NL 350M</td><td>2.12</td><td>4.10</td><td>7.38</td></tr><tr><td>CODEGEN-NL 2.7B</td><td>6.70</td><td>14.15</td><td>22.84</td></tr><tr><td>CODEGEN-NL 6.1B</td><td>10.43</td><td>18.36</td><td>29.85</td></tr><tr><td>CODEGEN-NL 16.1B</td><td>14.24</td><td>23.46</td><td>38.33</td></tr><tr><td>CODEGEN-MULTI 350M</td><td>6.67</td><td>10.61</td><td>16.84</td></tr><tr><td>CODEGEN-MULTI 2.7B</td><td>14.51</td><td>24.67</td><td>38.56</td></tr><tr><td>CODEGEN-MULTI6.1B</td><td>18.16</td><td>28.71</td><td>44.85</td></tr><tr><td>CODEGEN-MULTI 16.1B</td><td>18.32</td><td>32.07</td><td>50.80</td></tr><tr><td>CODEGEN-MONO 350M</td><td>12.76</td><td>23.11</td><td>35.19</td></tr><tr><td>CODEGEN-MONO 2.7B</td><td>23.70</td><td>36.64</td><td>57.01</td></tr><tr><td>CODEGEN-MONO 6.1B</td><td>26.13</td><td>42.29</td><td>65.82</td></tr><tr><td>CODEGEN-MONO 16.1B</td><td>29.28</td><td>49.86</td><td>75.00</td></tr><tr><td></td><td></td><td></td><td></td></tr></table>
|
| 62 |
+
|
| 63 |
+
The scaling of such LLMs requires data and model parallelism. To address these requirements, a training library JAXFORMER (https://github.com/salesforce/jaxformer) was developed for efficient training on Google’s TPU-v4 hardware. We refer to Appendix A for further details on the technical implementation and sharding schemes. Table 6 summarizes the hyper-parameters.
|
| 64 |
+
|
| 65 |
+
# 3 SINGLE-TURN EVALUATION
|
| 66 |
+
|
| 67 |
+
We first evaluate our CODEGEN using an existing program synthesis benchmark: HumanEval (MIT license) (Chen et al., 2021). HumanEval contains 164 hand-written Python programming problems. Each problem provides a prompt with descriptions of the function to be generated, function signature, and example test cases in the form of assertions. The model needs to complete a function given the prompt such that it can pass all provided test cases, thus measuring the performance by functional correctness. Since a user intent is specified in a single prompt and provided to the model once, we regard the evaluation on HumanEval as a single-turn evaluation, to distinguish it from the multi-turn evaluation which we introduce in the next section. Following Chen et al. (2021), we recruit nucleus sampling (Holtzman et al., 2020) with top- $p$ where $p = 0 . 9 5$ .
|
| 68 |
+
|
| 69 |
+
# 3.1 HUMANEVAL PERFORMANCE SCALES AS A FUNCTION OF MODEL SIZE AND DATA SIZE
|
| 70 |
+
|
| 71 |
+
We compare our models to the Codex models (Chen et al., 2021), which demonstrate the state-ofthe-art performance on HumanEval. Moreover, our models are compared to open-sourced large language models, GPT-NEO (Black et al., 2021) and GPT-J (Wang & Komatsuzaki, 2021). These are trained on THEPILE (Gao et al., 2020), and thus similar to our CODEGEN-NL models, in terms of training data and model size. All models are evaluated with temperature $t \in \{ 0 . 2 , 0 . 6 , 0 . 8 \}$ , and we compute pass $@ k$ where $k \in \{ 1 , 1 0 , 1 0 0 \}$ for each model. For direct comparison to the results by Chen et al. (2021), we choose the temperature that yields the best-performing pass $@ k$ for each $k$ . The results of our models and baselines are summarized in Table 1. Our CODEGEN-NL models (350M, 2.7B, 6.1B) outperform or perform on par with the respective GPT-NEO and GPT-J models. Further training CODEGEN-NL on multilingual programming language data (BIGQUERY) leads to CODEGEN-MULTI. The multilingual CODEGEN models outperform the models trained on THEPILE (GPT-NEO, GPT-J, CODEGEN-NL) by a large margin. We then finetune CODEGEN-MULTI on a Python-only dataset (BIGPYTHON), resulting in CODEGEN-MONO. The program synthesis capacity is improved substantially. Therefore, the Python program synthesis capacity enhances as the amount of Python training data increases. For almost all models, as expected, increasing the size of the model improves overall performance.
|
| 72 |
+
|
| 73 |
+
Table 2: Average prompt perplexity↓ ( $\pm$ standard error) of CODEGEN-MONO models on pass and non-pass problems.
|
| 74 |
+
|
| 75 |
+
<table><tr><td>CODEGEN-MONO</td><td>350M</td><td>2.7B</td><td>6.1B</td><td>16.1B</td></tr><tr><td>Pass</td><td>3.78 ±0.23</td><td>3.66 ± 0.14</td><td>3.35 ± 0.13</td><td>3.12 ± 0.11</td></tr><tr><td>Non-Pass</td><td>5.18 ± 0.19</td><td>4.37 ± 0.18</td><td>3.88 ±0.13</td><td>3.40 ± 0.11</td></tr></table>
|
| 76 |
+
|
| 77 |
+
Our Python-monolingual CODEGEN models have competitive or improved performance, compared to the current state-of-the-art models, Codex. CODEGEN-MONO 2.7B underperforms CODEX 2.5B when $k = 1 0 0$ but outperforms it when $k \in \{ 1 , 1 0 \}$ . While it is only half the size, our CODEGENMONO 6.1B demonstrates pass $@ \mathbf { k }$ scores approaching those of the best-performing Codex, CODEX 12B. Our largest model CODEGEN-MONO 16.1B is competitive or outperforms it depending on $k$ .
|
| 78 |
+
|
| 79 |
+
# 3.2 BETTER USER INTENT UNDERSTANDING YIELDS BETTER SYNTHESIZED PROGRAMS
|
| 80 |
+
|
| 81 |
+
The success of a program synthesis system highly depends on how well it understands user intent. When the system is based on a language model, the perplexity of problem prompts provides a proxy for the system’s understanding of user intent specifications. A low perplexity of an intent specification under a model indicates that this intent specification is compatible with the knowledge learned by the model from the training data. We investigate whether better prompt understanding, with lower prompt perplexity as a proxy, leads to more functionally accurate programs.
|
| 82 |
+
|
| 83 |
+
We partition all problems into pass versus non-pass ones. A pass problem is one that at least one sample from 200 samples passes all test cases, while for a non-pass problem none of the 200 samples pass all test cases. We compute the average perplexity of the problem prompts of the pass problems and that of the non-pass ones, based on samples from CODEGEN-MONO models. The results are displayed in Table 2 (see Appendix F for the results on CODEGEN-NL and CODEGEN-MULTI). The prompts of the pass problems have lower perplexity than those of the non-pass ones. This finding implies that program synthesis is more likely to be successful when the user intent specification is understood better by the model. Indeed, some training data contains interleaved sequences of natural language comments and programs, where the comments describe the functionality of the following program. We thus speculate that user intent specifications similar to such a pattern would be better understood by the model, and hence lead to better program synthesis. Inspired by this pattern, we propose to specify user intent in multiple turns such that the model focus on a partial problem at a time, which would make user intent understanding by the model easier.
|
| 84 |
+
|
| 85 |
+
# 4 MULTI-TURN EVALUATION
|
| 86 |
+
|
| 87 |
+
In this section, we propose and study a multi-step program synthesis paradigm where program synthesis is decomposed into multiple steps and the system synthesizes a subprogram in each step. To examine such a paradigm, we first develop a Multi-Turn Programming Benchmark (MTPB). MTPB consists of 115 problems written by experts, each of which includes a multi-step descriptions in natural language (prompt). To solve a problem, a model needs to synthesize functionally correct subprograms (1) following the description at the current step and (2) considering descriptions and synthesized subprograms at previous steps (e.g., correct backreference of functions and/or variables defined in the previous steps). An illustrative example is shown in Figure 1.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 1: An illustrative example for the Multi-Turn Programming Benchmark, performing the task of extracting the user name of an email address. $\textcircled{1}$ Each problem consists of prompts $p _ { i }$ and unit tests, where some prompts include templates (i.e. {input}) that are filled with test case inputs before it is fed to the model. In the displayed example, the input is a string containing abc.xyz@example.com, which replaces {input} in $p _ { 2 }$ , and the expected output is abc xyz. $\textcircled{2}$ Our model conditions on the concatenation of interleaved past prompts and generated responses. $\textcircled{3}$ Generated responses from each turn are concatenated and executed, where the output is compared to the answer.
|
| 91 |
+
|
| 92 |
+
# 4.1 BENCHMARK CONSTRUCTION
|
| 93 |
+
|
| 94 |
+
We (4 authors) start by defining4 a set of 115 problems requiring a diverse range of programming knowledge, including math, array operations, string manipulations, algorithms, data science, and problems that require other knowledge, such that the number of problems in each category is roughly balanced.5 For each problem, we construct a triplet consisting of multi-turn prompts $P$ , test case inputs $I$ , and test case outputs $O$ . Multi-turn prompts $P$ are designed following the two constraints: (1) the problem is decomposed into 3 or more turns, (2) a single turn cannot be attributed to solving the problem. For example, implementing a linear regression model could be phrased as “Perform linear regression on $\mathbf { X }$ and y”. Since the main task is fully expressed in this prompt, understanding this prompt is sufficient to perform the task. We avoid such cases via manual inspection and distribute problem-solving over turns. Together with the prompts, we task the problem author to prepare 5 sets of test case inputs $I$ and outputs $O$ to evaluate model outputs with functional correctness. To reduce wrongly rewarding false positive solutions that give meaningless programs but pass the tests, we examine and revise such cases to ensure the test quality.
|
| 95 |
+
|
| 96 |
+
Unlike HumanEval for which models are expected to complete a partially defined function, MTPB problems only provide the prompts, thereby models have to generate the solution from scratch.6 While the free-form generation may allow for more potential solutions, the lack of an entry point to provide test case inputs makes it challenging to test the generated code on diverse test cases. To overcome this challenge, we instead embed test case inputs within prompts. Specifically, prompts are written with Python’s formatted string7 where input values are substituted for the variable name when a specific test case is applied to the problem. For example, a prompt, “Define a string named ‘s’
|
| 97 |
+
|
| 98 |
+
Table 3: Evaluation results on the Multi-Turn Programming Benchmark. The multi-turn program synthesis performance varies as a function of model size (columns) and code data size (rows).
|
| 99 |
+
|
| 100 |
+
<table><tr><td rowspan="2">Data</td><td rowspan="2">Model</td><td colspan="5">Pass Rate↑ [%]</td></tr><tr><td>350M</td><td>2.7B</td><td>6.1B</td><td>16.1B</td><td></td></tr><tr><td>THEPILE</td><td>GPT-NEO&GPT-J</td><td>0.79</td><td>8.17</td><td>18.86</td><td>=</td><td></td></tr><tr><td>THEPILE</td><td>CODEGEN-NL</td><td>0.23</td><td>15.31</td><td>19.37</td><td>30.33</td><td>=</td></tr><tr><td>BIGQUERY</td><td>CODEGEN-MULTI</td><td>4.09</td><td>20.82</td><td>25.51</td><td>26.27</td><td></td></tr><tr><td>BIGPYTHON</td><td>CODEGEN-MONO</td><td>16.98</td><td>38.72</td><td>43.52</td><td>47.34</td><td></td></tr><tr><td></td><td>code-cushman-001</td><td>-</td><td>-</td><td>-</td><td>-</td><td>56.77</td></tr><tr><td></td><td>code-davinci-001</td><td></td><td></td><td>一</td><td>=</td><td>55.28</td></tr><tr><td></td><td>code-davinci-002</td><td>=</td><td>=</td><td>=</td><td>=</td><td>59.86</td></tr></table>
|
| 101 |
+
|
| 102 |
+
<table><tr><td rowspan="2">Prompt</td><td colspan="4">PPL</td><td colspan="4">Pass Rate↑ [%]</td></tr><tr><td>350M</td><td>2.7B</td><td>6.1B</td><td>16.1B</td><td>350M</td><td>2.7B</td><td>6.1B</td><td>16.1B</td></tr><tr><td>Single-Turn</td><td>13.92 ± 1.89</td><td>11.67 ± 1.46</td><td>10.58 ± 1.20</td><td>10.25 ±0.99</td><td>5.75</td><td>25.43</td><td>28.48</td><td>38.74</td></tr><tr><td>Multi-Turn</td><td>10.09 ± 0.62</td><td>8.90 ± 0.52</td><td>8.18 ±0.43</td><td>8.05 ±0.43</td><td>16.98</td><td>38.72</td><td>43.52</td><td>47.34</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 4: Comparison between multi- and concatenated single-turn specifications on perplexity (PPL) and program synthesis performance (as measured by pass rate) under CODEGEN-MONO models.
|
| 105 |
+
|
| 106 |
+
with the value {var}.”, together with a test case input var $=$ ‘Hello’ will be formatted into “Define a string named ‘s’ with the value ‘Hello’.” Also see $\textcircled{1}$ in Figure 1 for an example.
|
| 107 |
+
|
| 108 |
+
# 4.2 EXECUTION ENVIRONMENT AND SOLUTION EVALUATION
|
| 109 |
+
|
| 110 |
+
For execution, the history of pairs of prompts and generated completions is concatenated into a self-contained program (see $\textcircled{3}$ in Figure 1 for an example). The program is then executed in an isolated Python environment following the single-turn HumanEval benchmark (Chen et al., 2021). However, the problems in HumanEval are constructed in such a way that a known function signature is completed, thus invocation of the generated code under a set of functional unit tests is trivial. In our multi-turn case, no such entry point (or return value) is guaranteed to be generated. To circumvent the issue of a missing return signature (or value), the last prompt of the multi-turn problems in MTPB is always specified to print out the resulting state to the terminal. Then, the benchmark execution environment overloads the Python print(args) function and stores args on a stack. If the sampled code for the last prompt of a problem does not include the print() statement, which is a valid convention to print on the terminal in Python or specifically Jupyter notebooks, then the AST of the generated code will be mutated to inject an invocation of print(). Finally, a type-relaxed equivalence check (e.g., an implicit conversion between lists and tuples) of args against the predefined gold output of the problem is performed to determine test failure or success.
|
| 111 |
+
|
| 112 |
+
# 4.3 MULTI-STEP PROGRAMMING CAPACITY SCALES WITH MODEL SIZE AND DATA SIZE
|
| 113 |
+
|
| 114 |
+
In this analysis, we investigate how the model size and data size affect the program synthesis capacity in a multi-turn paradigm. In the MTPB, each problem has 5 test cases and we sample 40 samples for each test case with each model, based on which the pass rate is computed for each problem. The MTPB evaluation results (average pass rate) for our CODEGEN models, baselines, and OpenAI Codex models8 are shown in Table 3. Clearly, the performance on the MTPB improves as a function of the model size and data size. This suggests that the capacity of multi-step program synthesis scales as a function of the model size and data size. The models are simply trained with an autoregressive language modeling objective. While the model and the data scale up, multi-turn program synthesis capacity emerges, that is, the capacity to synthesize programs in a multi-turn fashion.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 2: Difference in average pass-rate of problems in single-turn and multi-turn formulation over levels of problem difficulty. The improvement is sizable for most model sizes and difficulty levels, except for easy problems with larger models.
|
| 118 |
+
|
| 119 |
+
# 4.4 BETTER USER SPECIFICATION UNDERSTANDING WITH MULTI-TURN FACTORIZATION
|
| 120 |
+
|
| 121 |
+
We hypothesize that multi-turn factorization enhances the model’s understanding of user intent specifications, which in turn lead to higher program synthesis capacity. To test this hypothesis, we form a single-turn counterpart of multi-turn specifications by concatenating each specification into a single turn. As discussed in Section 3.2, we adopt the prompt perplexity as a proxy for user intent understanding. Thus, we compare the perplexity of the multi-turn prompts and that of the concatenated single-turn prompts under the four CODEGEN-MONO models.
|
| 122 |
+
|
| 123 |
+
The average perplexity (see Appendix E for the calculation details) over all the problems in the MTPB is displayed in the left panel of Table 4. For all models, the single-turn specification has a higher average perplexity than the multi-turn specification. It implies that the multi-turn user specifications can be better understood by the models. We notice that the average perplexity for both multi-turn and single-turn intent specifications under larger models is slightly lower than that under smaller models, indicating that the larger ones understand the user intent better than the smaller ones.
|
| 124 |
+
|
| 125 |
+
We compare the program synthesis pass rate with the multi-turn prompts to that with the concatenated single-turn prompts. The results are shown in the right panel of Table 4. Multi-turn specifications lead to close to or more than 10 percentage points over single-turn specifications for all model sizes. Together with the perplexity analysis above, it appears that factorizing a user specification into multiple steps and leveraging the emerged capacity of large language models allow them to digest the specification more easily and synthesize programs more successfully.
|
| 126 |
+
|
| 127 |
+
Furthermore, we categorize the problems by difficulty level based on their average pass rates (“hard” with less than $30 \%$ , “easy” with larger than $70 \%$ ), and examine the interaction effect between difficulty level and model size on the improvement by multi-turn factorization. See the results in Figure 2. Across almost all model sizes and difficulty levels, multi-turn prompts lead to significant improvement over single-turn prompts and most improvements are nearly or higher than 10 percentage points. Interestingly, the larger models (6.1B and 16.1B) are invariant to multi-turn factorization for easy problems (see the two short bars, $0 . 1 9 \%$ and $- 0 . 2 5 \%$ , in Figure 2). This implies that when the problems can be easily understood by the model (due to the combined effect of easiness of the problems and the high capacity of larger models), it is not necessary or beneficial to factorize the specifications. This is in fact consistent with our motivating assumption that factorizing complicated specifications would ease problem understanding and improve program synthesis.
|
| 128 |
+
|
| 129 |
+
# 4.5 QUALITATIVE EXAMPLES
|
| 130 |
+
|
| 131 |
+
To further understand the differences in model behavior over model sizes, we examine cases where large models have contrasting performances to smaller models. We specifically select problems for which CODEGEN-MONO 16.1B and CODEGEN-MONO 2.7B show a significant discrepancy in performance. On problems where CODEGEN-MONO 16.1B performed significantly worse compared to CODEGEN-MONO 2.7B, we observe that the larger model becomes inflexible due to taking the prompt literally. For example, initializing a number always results in an integer, despite the prompt asking to cast into a string (Figure 3), or the “return” keyword in a prompt triggers a function definition while the intent is to directly generate an executable program (Figure 4). However in general, larger-scale models overcome mistakes due to prompt misinterpretation by smaller models, including assigning multiple variables at the same time (Figure 5) or understanding the concept of any comparison (Figure 6).
|
| 132 |
+
|
| 133 |
+
# 5 RELATED WORK
|
| 134 |
+
|
| 135 |
+
Program Synthesis While program synthesis has a long history, two inherent challenges remain unsolved: (1) intractability of the program space and (2) difficulty in accurately expressing user intent (Manna & Waldinger, 1971; Gulwani et al., 2017). A large body of prior research attempted to address (1) by exploring methods like stochastic search techniques (Parisotto et al., 2017; Schkufza et al., 2013) and deductive top-down search (Gulwani, 2011; Polozov & Gulwani, 2015). However, the scalability of these approaches is still limited. User intent can be expressed with various methods: formal logical specifications, input-output examples, and natural language descriptions. Complete and formal specifications require too much effort, while informal ones like input-output examples often under-specify problems (Gulwani, 2011). Well-learned conditional distribution and language understanding capacity owing to the large-scale model and data allows for efficient solutions for these two challenges. Several works investigate converting conversational intents into programmable representations, such as SQL (Yu et al., 2019a;b) or dataflow graph (Andreas et al., 2020). Our proposed benchmark requires the generation of Python, which is more general and complex.
|
| 136 |
+
|
| 137 |
+
Large Language Models Transformers capture dependency among sequence elements through attention mechanism (Bahdanau et al., 2014) and are highly scalable. It has been successfully applied to natural language processing (Devlin et al., 2019; Lewis et al., 2020; Raffel et al., 2020), computer vision (Dosovitskiy et al., 2021), and many other areas (Oord et al., 2018; Jumper et al., 2021). Prior works, such as CuBERT (Kanade et al., 2020), CodeBERT (Feng et al., 2020), PyMT5 (Clement et al., 2020), and CodeT5 (Wang et al., 2021), have applied transformers towards code understanding but these mostly focus on code retrieval, classification, and program repair. Several recent and concurrent efforts explore using large language models for program synthesis (Chen et al., 2021; Austin et al., 2021; Li et al., 2022; Fried et al., 2022) and its effectiveness (Vaithilingam et al., 2022). While they focus on generating code in a single turn, we propose to factorize the specifications into multiple turns and demonstrate that it is highly effective to improve synthesis quality. It is worth pointing out that Austin et al. (2021) explored refining the code in multiple iterations, but it is essentially a single-turn approach since a complete program is produced in every single turn. Prompting pre-trained language models with intermediate information to improve task performance has attracted interest (Nye et al., 2021; Wei et al., 2022). Our proposed MTPB also allows the model to leverage past turns as context.
|
| 138 |
+
|
| 139 |
+
Benchmarks for Program Synthesis To quantitatively evaluate program synthesis models, several benchmarks have been proposed with different input forms. A popular input forms include preceding code in the same line (Raychev et al., 2016), pseudo-code (Kulal et al., 2019), a docstring and function signature (Chen et al., 2021), or problem description (Hendrycks et al., 2021). In most of those cases, only directly relevant input information is given to the model. In contrast, a few previous works instantiate benchmarks that measure the ability to generate programs given surrounding program context beyond the target program, such as variables and other methods (Iyer et al., 2018) or alternating “cells” of preceding code and text blocks (Agashe et al., 2019), while the primary focus is to generate the target program itself. We propose a new benchmark that requires a progressive generation of subprograms through multi-turn prompts.
|
| 140 |
+
|
| 141 |
+
# 6 CONCLUSION
|
| 142 |
+
|
| 143 |
+
We study program synthesis with large causal language models trained on large corpora of code data. The capacity to understand long context and generate coherent responses emerges from the simple language modeling as the model size and data size scale up. Leveraging this capacity and observing that better user intent understanding leads to better program synthesis, we propose a multi-step program synthesis approach in which program synthesis is achieved through a multi-turn specification and code generation. Moreover, we develop the Multi-Turn Programming Benchmark (MTPB) to investigate our models’ capacity on synthesizing programs in such a multi-step paradigm. Our experiments show that the multi-step program synthesis capacity scales as a function of the model size and data size. The intent specifications, which are specified in multiple steps, are digested more easily by the models and lead to more accurate program synthesis. We open-source the training code and the model checkpoints to facilitate future research and practical applications in this area.
|
| 144 |
+
|
| 145 |
+
# BROADER IMPACT AND ETHICAL CONSIDERATIONS
|
| 146 |
+
|
| 147 |
+
All variants of CODEGEN are firstly pre-trained on the Pile, which includes a small portion of profane language. Focusing on the GitHub data that best aligns our expected use case of program synthesis, Gao et al. (2020) report that $0 . 1 \%$ of the data contained profane language, and has sentiment biases against gender and certain religious groups. Thus, while we did not observe in our samples, CODEGEN may generate such content as well. In addition to risks on natural language outputs (e.g., docstrings), generated programs may include vulnerabilities and safety concerns, which are not remedied in this work. Models should not be used in applications until being treated for these risks.
|
| 148 |
+
|
| 149 |
+
# REFERENCES
|
| 150 |
+
|
| 151 |
+
Rajas Agashe, Srinivasan Iyer, and Luke Zettlemoyer. Juice: A large scale distantly supervised dataset for open domain context-based code 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), pp. 5436–5446, 2019.
|
| 152 |
+
|
| 153 |
+
Jacob Andreas, John Bufe, David Burkett, Charles Chen, Josh Clausman, Jean Crawford, Kate Crim, Jordan DeLoach, Leah Dorner, Jason Eisner, et al. Task-oriented dialogue as dataflow synthesis. Transactions of the Association for Computational Linguistics, 8:556–571, 2020.
|
| 154 |
+
|
| 155 |
+
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.
|
| 156 |
+
|
| 157 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 158 |
+
|
| 159 |
+
Sid Black, Leo Gao, Phil Wang, Connor Leahy, and Stella Biderman. GPT-Neo: Large Scale Autoregressive Language Modeling with Mesh-Tensorflow, March 2021. URL https://doi.org/ 10.5281/zenodo.5297715. If you use this software, please cite it using these metadata.
|
| 160 |
+
|
| 161 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
|
| 162 |
+
|
| 163 |
+
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.
|
| 164 |
+
|
| 165 |
+
Bei Chen, Fengji Zhang, Anh Nguyen, Daoguang Zan, Zeqi Lin, Jian-Guang Lou, and Weizhu Chen. Codet: Code generation with generated tests. arXiv preprint arXiv:2207.10397, 2022.
|
| 166 |
+
|
| 167 |
+
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
|
| 168 |
+
|
| 169 |
+
Alvin Cheung, Armando Solar-Lezama, and Samuel Madden. Optimizing database-backed applications with query synthesis. ACM SIGPLAN Notices, 48(6):3–14, 2013.
|
| 170 |
+
|
| 171 |
+
Colin Clement, Dawn Drain, Jonathan Timcheck, Alexey Svyatkovskiy, and Neel Sundaresan. Pymt5: multi-mode translation of natural language and python code with transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9052–9065, 2020.
|
| 172 |
+
|
| 173 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https: //aclanthology.org/N19-1423.
|
| 174 |
+
|
| 175 |
+
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 ICLR, 2021. URL https://openreview.net/forum?id $=$ YicbFdNTTy.
|
| 176 |
+
|
| 177 |
+
Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. Codebert: A pre-trained model for programming and natural languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 1536–1547, 2020.
|
| 178 |
+
|
| 179 |
+
Daniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang, Eric Wallace, Freda Shi, Ruiqi Zhong, Wen-tau Yih, Luke Zettlemoyer, and Mike Lewis. Incoder: A generative model for code infilling and synthesis. arXiv preprint arXiv:2204.05999, 2022.
|
| 180 |
+
|
| 181 |
+
Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. The pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020.
|
| 182 |
+
|
| 183 |
+
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. ACM Sigplan Notices, 46(1):317–330, 2011.
|
| 184 |
+
|
| 185 |
+
Sumit Gulwani, Oleksandr Polozov, Rishabh Singh, et al. Program synthesis. Foundations and Trends® in Programming Languages, 4(1-2):1–119, 2017.
|
| 186 |
+
|
| 187 |
+
Dan Hendrycks, Steven Basart, Saurav Kadavath, Mantas Mazeika, Akul Arora, Ethan Guo, Collin Burns, Samir Puranik, Horace He, Dawn Song, and Jacob Steinhardt. Measuring coding challenge competence with APPS. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021. URL https://openreview.net/forum?id= sD93GOzH3i5.
|
| 188 |
+
|
| 189 |
+
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In ICLR, 2020. URL https://openreview.net/forum?id $=$ rygGQyrFvH.
|
| 190 |
+
|
| 191 |
+
Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, and Luke Zettlemoyer. Mapping language to code in programmatic context. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1643–1652, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1192. URL https://aclanthology.org/ D18-1192.
|
| 192 |
+
|
| 193 |
+
Rajeev Joshi, Greg Nelson, and Keith Randall. Denali: A goal-directed superoptimizer. ACM SIGPLAN Notices, 37(5):304–314, 2002.
|
| 194 |
+
|
| 195 |
+
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.
|
| 196 |
+
|
| 197 |
+
Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. Learning and evaluating contextual embedding of source code. In International Conference on Machine Learning, pp. 5110–5121. PMLR, 2020.
|
| 198 |
+
|
| 199 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015. URL http://arxiv.org/abs/1412.6980.
|
| 200 |
+
|
| 201 |
+
Sumith Kulal, Panupong Pasupat, Kartik Chandra, Mina Lee, Oded Padon, Alex Aiken, and Percy S Liang. Spoc: Search-based pseudocode to code. Advances in Neural Information Processing Systems, 32, 2019.
|
| 202 |
+
|
| 203 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871–7880, 2020.
|
| 204 |
+
|
| 205 |
+
Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Rémi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, Thomas Hubert, Peter Choy, Cyprien de Masson d’Autume, Igor Babuschkin, Xinyun Chen, Po-Sen Huang, Johannes Welbl, Sven Gowal, Alexey Cherepanov, James Molloy, Daniel Mankowitz, Esme Sutherland Robson, Pushmeet Kohli, Nando de Freitas, Koray Kavukcuoglu, and Oriol Vinyals. Competition-level code generation with alphacode, Feb 2022.
|
| 206 |
+
|
| 207 |
+
Zohar Manna and Richard J Waldinger. Toward automatic program synthesis. Communications of the ACM, 14(3):151–165, 1971.
|
| 208 |
+
|
| 209 |
+
Maxwell Nye, Anders Johan Andreassen, Guy Gur-Ari, Henryk Michalewski, Jacob Austin, David Bieber, David Dohan, Aitor Lewkowycz, Maarten Bosma, David Luan, et al. Show your work: Scratchpads for intermediate computation with language models. arXiv preprint arXiv:2112.00114, 2021.
|
| 210 |
+
|
| 211 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 212 |
+
|
| 213 |
+
Pavel Panchekha, Alex Sanchez-Stern, James R Wilcox, and Zachary Tatlock. Automatically improving accuracy for floating point expressions. ACM SIGPLAN Notices, 50(6):1–11, 2015.
|
| 214 |
+
|
| 215 |
+
Emilio Parisotto, Abdel rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. In ICLR (Poster), 2017. URL https://openreview. net/forum?id=rJ0JwFcex.
|
| 216 |
+
|
| 217 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International conference on machine learning, pp. 1310–1318. PMLR, 2013.
|
| 218 |
+
|
| 219 |
+
Oleksandr Polozov and Sumit Gulwani. Flashmeta: A framework for inductive program synthesis. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 107–126, 2015.
|
| 220 |
+
|
| 221 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1–67, 2020.
|
| 222 |
+
|
| 223 |
+
Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. Zero: Memory optimizations toward training trillion parameter models. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1–16. IEEE, 2020.
|
| 224 |
+
|
| 225 |
+
Veselin Raychev, Pavol Bielik, and Martin Vechev. Probabilistic model for code with decision trees. ACM SIGPLAN Notices, 51(10):731–747, 2016.
|
| 226 |
+
|
| 227 |
+
Eric Schkufza, Rahul Sharma, and Alex Aiken. Stochastic superoptimization. ACM SIGARCH Computer Architecture News, 41(1):305–316, 2013.
|
| 228 |
+
|
| 229 |
+
Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019.
|
| 230 |
+
|
| 231 |
+
Jianlin Su, Yu Lu, Shengfeng Pan, Bo Wen, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864, 2021.
|
| 232 |
+
|
| 233 |
+
Priyan Vaithilingam, Tianyi Zhang, and Elena L Glassman. Expectation vs. experience: Evaluating the usability of code generation tools powered by large language models. In CHI Conference on Human Factors in Computing Systems Extended Abstracts, pp. 1–7, 2022.
|
| 234 |
+
|
| 235 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 236 |
+
|
| 237 |
+
Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021.
|
| 238 |
+
|
| 239 |
+
Yue Wang, Weishi Wang, Shafiq Joty, and Steven C.H. Hoi. Codet5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, 2021.
|
| 240 |
+
|
| 241 |
+
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.
|
| 242 |
+
|
| 243 |
+
Tao Yu, Rui Zhang, Heyang Er, Suyi Li, Eric Xue, Bo Pang, Xi Victoria Lin, Yi Chern Tan, Tianze Shi, Zihan Li, Youxuan Jiang, Michihiro Yasunaga, Sungrok Shim, Tao Chen, Alexander Fabbri, Zifan Li, Luyao Chen, Yuwen Zhang, Shreya Dixit, Vincent Zhang, Caiming Xiong, Richard Socher, Walter Lasecki, and Dragomir Radev. CoSQL: A conversational text-to-SQL challenge towards cross-domain natural language interfaces to databases. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 1962–1979, Hong Kong, China, November 2019a. Association for Computational Linguistics. doi: 10.18653/v1/D19-1204. URL https://aclanthology.org/D19-1204.
|
| 244 |
+
|
| 245 |
+
Tao Yu, Rui Zhang, Michihiro Yasunaga, Yi Chern Tan, Xi Victoria Lin, Suyi Li, Heyang Er, Irene Li, Bo Pang, Tao Chen, Emily Ji, Shreya Dixit, David Proctor, Sungrok Shim, Jonathan Kraft, Vincent Zhang, Caiming Xiong, Richard Socher, and Dragomir Radev. SParC: Cross-domain semantic parsing in context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4511–4523, Florence, Italy, July 2019b. Association for Computational Linguistics. doi: 10.18653/v1/P19-1443. URL https://aclanthology.org/P19-1443.
|
| 246 |
+
|
| 247 |
+
# A MODEL TRAINING
|
| 248 |
+
|
| 249 |
+
To evaluate the emergence of multi-turn program synthesis capabilities under scaling laws, we adopt standard transformer-based autoregressive language models, varying (1) the number of model parameters (350M, 2.7B, 6.1B, 16.1B) and (2) the number of tokens of programming languages in the training corpora. For scaling the models, a custom library JAXFORMER for training large language models on TPU-v4 hardware was developed and will be released as open source, including the trained model weights.
|
| 250 |
+
|
| 251 |
+
# A.1 DATASETS
|
| 252 |
+
|
| 253 |
+
Table 5: Approximate statistics for training corpora along the pre-processing steps.
|
| 254 |
+
|
| 255 |
+
<table><tr><td>Dataset</td><td>Language</td><td>Raw Size</td><td>Final Size</td><td>Final Tokens</td></tr><tr><td>THEPILE</td><td>Natural Language</td><td>825.18 GiB 95.16 GiB</td><td>1159.04 GiB</td><td>354.7B</td></tr><tr><td rowspan="7">BIGQUERY</td><td>Code C</td><td></td><td>95.16 GiB</td><td>31.6B</td></tr><tr><td>C++</td><td>1772.1 GiB</td><td>48.9 GiB</td><td>19.7B</td></tr><tr><td>Go</td><td>205.5 GiB</td><td>69.9 GiB</td><td>25.5B</td></tr><tr><td></td><td>256.4 GiB</td><td>21.4 GiB</td><td>9.6B</td></tr><tr><td>Java</td><td>335.1 GiB</td><td>120.3 GiB</td><td>35.4B</td></tr><tr><td>JavaScript</td><td>1282.3 GiB</td><td>24.7GiB</td><td>9.7B</td></tr><tr><td>Python Python</td><td>196.8 GiB 5558.1GiB</td><td>55.9 GiB 217.3 GiB</td><td>19.3B 71.7B</td></tr></table>
|
| 256 |
+
|
| 257 |
+
For each dataset, the pre-processing shares the following steps: (1) filtering, (2) deduplication, (3) tokenization, (4) shuffling, and (5) concatenation. For details on THEPILE, we refer to Gao et al. (2020). For BIGQUERY and BIGPYTHON, in (1) files are filtered by file extension, and files with average lines length of ${ < } 1 0 0$ characters, a maximum line length of $1 , 0 0 0$ , and ${ > } 9 0 \%$ of the characters being decimal or hexadecimal digits are removed. For (2), exact duplicates based on their SHA-256 hash are removed, which amounts to a substantial portion of the raw data due to forks and copies of repositories. For (3), the BPE vocabulary of GPT-2 is extended by special tokens representing repeating tokens of tabs and white spaces. In the multi-lingual setting of BIGQUERY, a prefix is prepended to indicate the name of the programming language. For (4), each year of data is randomly shuffled. For (5), sequences are concatenated to fill the context length of 2, 048 tokens with a special token as a separator. Table 5 summarizes the statistics of the training corpora.
|
| 258 |
+
|
| 259 |
+
CODEGEN-NL models are randomly initialized and trained on THEPILE. CODEGEN-MULTI models are initialized from CODEGEN-NL and then trained on the BIGQUERY. CODEGEN-MONO models are initialized from CODEGEN-MULTI and then trained on BIGPYTHON.
|
| 260 |
+
|
| 261 |
+
# A.2 MODELS
|
| 262 |
+
|
| 263 |
+
Our models are autoregressive transformers with the regular next-token prediction language modeling as the learning objective. The family of CODEGEN models is trained in various sizes with 350M, 2.7B, 6.1B, and 16.1B parameters. The first three configurations allow for direct comparison with opensourced large language models trained on text corpus, GPT-NEO (350M, 2.7B) (Black et al., 2021) and GPT-J (6B) (Wang & Komatsuzaki, 2021). See Table 6 in Appendix A for model specifications.
|
| 264 |
+
|
| 265 |
+
The architecture follows a standard transformer decoder with left-to-right causal masking. For the positional encoding, we adopt rotary position embedding (Su et al., 2021). For the forward pass, we execute the self-attention and feed-forward circuits in parallel for improved communication overhead following Wang & Komatsuzaki (2021), that is, $x _ { t + 1 } { \overset { \cdot } { = } } x _ { t } + \operatorname* { m l p } ( { \bar { \ln } } ( x _ { t } + \arctan ( \ln ( x _ { t } ) ) ) ) ,$ is altered to $x _ { t + 1 } = x _ { t } + \mathrm { a t t n } ( \ln ( x _ { t } ) ) + \mathrm { m l p } ( \ln ( x _ { t } ) )$ for which the computation of self-attention, attn(), and feed-forward, $\mathrm { m l p } ( )$ , with layer-norm, $\ln ( )$ , is simultaneous. The architecture and hyper-parameter choices were optimized specifically for the hardware layout of TPU-v4.
|
| 266 |
+
|
| 267 |
+
Table 6: Hyper-parameters for model specification and optimization for the family of CODEGEN models.
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Model</td><td>Dataset</td><td>Hyper-parameter</td><td>350M</td><td>2.7B</td><td>6.1B</td><td>16.1B</td></tr><tr><td rowspan="5">CODEGEN</td><td rowspan="5"></td><td>Number of layers Number of heads</td><td>20 16</td><td>32 32</td><td>33 16</td><td>34 24</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dimensions per head</td><td>64</td><td>80</td><td>256</td><td>256</td></tr><tr><td>Context length</td><td>2.048</td><td>2,048</td><td>2,048</td><td>2,048</td></tr><tr><td>Batch size</td><td>500k</td><td>1M</td><td>2M</td><td>2M</td></tr><tr><td rowspan="3">CODEGEN-NL</td><td rowspan="3">THEPILE</td><td>Weight decay</td><td>0.1</td><td>0.1</td><td>0.1</td><td>0.1</td></tr><tr><td>Learning rate</td><td>3.0e-4</td><td>1.6e-4</td><td>1.2e-4</td><td>0.9e-4</td></tr><tr><td>Warm-up steps Warm-up /Total steps</td><td>3k 350k</td><td>3k</td><td>3k 350k</td><td>3k</td></tr><tr><td rowspan="3">CODEGEN-MULTI</td><td rowspan="3">BIGQUERY</td><td></td><td>1.8e-4</td><td>350k</td><td>0.4e-4</td><td>350k 0.5e-4</td></tr><tr><td>Learning rate</td><td></td><td>0.8e-4</td><td>3k</td><td>3k</td></tr><tr><td>Warm-up steps Total steps</td><td>3k 150k</td><td>3k 150k</td><td>150k</td><td>150k</td></tr><tr><td rowspan="3">CODEGEN-MONO</td><td rowspan="3">BIGPYTHON</td><td></td><td></td><td></td><td>0.4e-4</td><td></td></tr><tr><td>Learning rate</td><td>1.8e-4</td><td>0.8e-4</td><td>3k</td><td>0.5e-4</td></tr><tr><td>Warm-up steps Total steps</td><td>3k 150k</td><td>3k 150k</td><td>150k</td><td>3k 150k</td></tr></table>
|
| 270 |
+
|
| 271 |
+
# A.3 TRAINING
|
| 272 |
+
|
| 273 |
+
The scaling of large language models requires data and model parallelism. Google’s TPU-v4 hardware with a high-speed toroidal mesh interconnect naturally allows for efficient parallelism. To efficiently utilize the hardware, the training of the models is implemented in JAX (Bradbury et al., 2018). For parallel evaluation in JAX the $p j i t ( ) ^ { 9 }$ operator is adopted. The operator enables a paradigm named single-program, multiple-data (SPMD) code, which refers to a parallelism technique where the same computation is run on different input data in parallel on different devices.10 Specifically, pjit() is the API exposed for the XLA SPMD partitioner in JAX, which allows a given function to be evaluated in parallel with equivalent semantics over a logical mesh of compute.
|
| 274 |
+
|
| 275 |
+
Our library JAXFORMER recruits a designated coordinator node to orchestrate the cluster of TPU$\mathrm { \Delta V M s ^ { 1 1 } }$ with a custom TCP/IP protocol. For data parallelism, the coordinator partitions a batch and distributes the partitions to the individual TPU-VMs. For model parallelism, two schemes for the sharding of model parameters are supported: (1) Intra-TPU-VM, where parameters are sharded across MXU cores12 inside a physical TPU-v4 board and replicated across boards following Shoeybi et al. (2019); Wang & Komatsuzaki (2021); (2) Inter-TPU-VM, where parameters are sharded across TPU-v4 boards and activations are replicated following Rajbhandari et al. (2020).
|
| 276 |
+
|
| 277 |
+
Both intra-TPU-VM and inter-TPU-VM sharding schemes are implemented based on our specific pjit() a logical mesh specification $( r , p , c )$ with $r$ replicas of the parameters, $p$ partitions of the parameters, and $c$ logical cores per board over $n _ { b }$ TPU boards with each $n _ { c }$ logical cores such that $d \times p = n _ { b }$ and $\boldsymbol { r } \times \boldsymbol { p } \times \boldsymbol { c } = n _ { b } \times n _ { c }$ .
|
| 278 |
+
|
| 279 |
+
The intra-TPU-VM scheme is adopted for models of size of less or equal to 6B parameters, the total amount of model and optimizer parameters fit into the combined HBM memory of a single TPU-v4 board. For instance, a TPU-v4-512 slice with ${ n } _ { b } = 6 4$ and ${ n _ { c } } = 4$ would be configured as $( r , p , c ) = ( 6 4 , 1 , 4 )$ . That is, the parameters are being replicated across $r = 6 4$ boards with $p = 1$ total inter-board partitions and intra-board parallelism across $c = 4$ logical chips. In this configuration, the mean gradient is accumulated across boards via with_sharding_constraint(), effectively emulating the behavior of the xmap()13 operator.
|
| 280 |
+
|
| 281 |
+
The inter-TPU-VM scheme is adopted for models exceeding the size of 6B parameters for which the model and optimizer parameters have to be sharded across TPU-v4 boards. For instance, a TPU-v4-512 slice with ${ n } _ { b } = 6 4$ and $n _ { c } = 4$ would be configured as $( r , p , c ) = ( 1 , 6 4 , 4 )$ . For larger slices such as TPU-v4-1024 with $n _ { b } = 1 2 8$ , one may introduce redundancy in the parameter sharding, e.g., $( r , p , c ) = ( 2 , 6 4 , 4 )$ . In this configuration, the activations are replicated across boards via with_sharding_constraint(). Moreover, $\bar { ( } \boldsymbol { r } , \boldsymbol { p } , c )$ allows for backwards compatibility for the logical hardware layout transition from TPU-v3 with $c = 8$ to TPU-v4 with $c = 4$ by adjusting $p$ without the need for re-sharding.
|
| 282 |
+
|
| 283 |
+
For the optimization, Table 6 summarizes the hyper-parameters. We adopt the Adam (Kingma & Ba, 2015) optimizer with $( \beta _ { 1 } , \beta _ { 2 } , \epsilon ) = ( 0 . 9 , 0 . 9 9 9 , 1 \mathrm { e } - 0 8 )$ and global gradient norm clipping (Pascanu et al., 2013) of 1.0. The learning rate function over time follows GPT-3 (Brown et al., 2020) with warm-up steps and cosine annealing. In summary, we mainly adopted the GPT-3 reference configurations with minor variations accounting for TPU optimizations. We did not have the compute capacity to optimize these hyper-parameters further.
|
| 284 |
+
|
| 285 |
+
# B PASS $@ k$ ESTIMATOR
|
| 286 |
+
|
| 287 |
+
We use the unbiased estimator proposed in Chen et al. (2021) to compute pass $@ k$ . For each task, $n \geq k$ samples are sampled. In particular, we use $n = 2 0 0$ and $k \leq 1 0 0$ . Suppose $c$ is the number of correct samples, among the $n$ samples, which pass all the unit tests. Then the unbiased estimator is defined as follows:
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
{ \mathrm { p a s s } } @ k = \mathbb { E } _ { \mathrm { P r o b l e m s } } \left[ 1 - { \frac { { \binom { n - c } { k } } } { { \binom { n } { k } } } } \right]
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
Directly computing this estimator is numerically unstable. We use the numerically stable numpy implementation introduced by Chen et al. (2021).
|
| 294 |
+
|
| 295 |
+
# C TYPE-RELAXED EQUIVALENCE CHECK FOR MTPB EVALUATION
|
| 296 |
+
|
| 297 |
+
We perform the following type-relaxation before assessing the equivalence between model outputs and the expected outputs.
|
| 298 |
+
|
| 299 |
+
• Convert numpy arrays into correspondingly typed lists of standard types (e.g. np.int32 will be cast to int).
|
| 300 |
+
• pandas series are converted and compared in numpy array format.
|
| 301 |
+
• For the rest, model outputs are cast into the type of gold standard outputs.
|
| 302 |
+
• Floating numbers are compared with $\varepsilon = 1 e ^ { - 6 }$ as the tolerance threshold.
|
| 303 |
+
|
| 304 |
+
D LIST OF MTPB PROBLEMS
|
| 305 |
+
|
| 306 |
+
<table><tr><td>Problem Name</td><td>Problem Description</td><td>Category</td></tr><tr><td>Sandwich string</td><td>Append a string in the middle of another string.</td><td>string</td></tr><tr><td>Normalize integer list</td><td>Normalize a list of positive integers and print formatted percentages.</td><td>math</td></tr><tr><td>Convert time</td><td>Convert units of time.</td><td>math</td></tr><tr><td>Squared Fibonacci</td><td>Print the squared Fibonacci numbers.</td><td>math</td></tr><tr><td>Compare counts</td><td>Compare the count of positive and negative numbers in a given list.</td><td>array</td></tr><tr><td>Pandas mean</td><td>Construct and compute the mean of a pandas DataFrame.</td><td>D.S.</td></tr><tr><td>Fizz buzz</td><td>Solve the fizz buzz problem.</td><td>Algo.</td></tr><tr><td>Bi-grams</td><td>Print the bi-grams of a sentence.</td><td>string</td></tr><tr><td>Top note</td><td>Print the name with top note out of a dictionary.</td><td>dict</td></tr><tr><td>Hex to binary</td><td>Convert hex to binary and reverse.</td><td>math</td></tr><tr><td>Invert dict</td><td>Detect an inversion of a given dictionary.</td><td>dict</td></tr><tr><td>Class definition</td><td>Create a POJO class.</td><td>class</td></tr><tr><td>Longest number</td><td>Print the longest number.</td><td>math</td></tr><tr><td>Linear regression</td><td>Fit linear regression model with specified function and sk-learn.</td><td>D.S.</td></tr><tr><td>Encrypt and decrypt</td><td>Rotate alphabet for encryption, then reverse the operation.</td><td>Algo.</td></tr><tr><td>Dedup custom objects</td><td>Implement a class with_hash_and obtain a count unique objects.</td><td>class</td></tr><tr><td>Drunken python</td><td>Convert between integer and string without using built-in functions.</td><td>string</td></tr><tr><td>Morse code</td><td>Encode a string into morse code given its conversion rule.</td><td>Algo.</td></tr><tr><td>Two-sum</td><td>Implement the two-sum problem on a given input pair.</td><td>Algo.</td></tr><tr><td>k-means</td><td>Implement and run k-means on sampled points.</td><td>D.S.</td></tr><tr><td>Even odd sum</td><td>Print the sum of even and odd numbers in a list.</td><td>math</td></tr><tr><td>Shift zeros</td><td>Move all the zeros ina list to the right.</td><td>array</td></tr><tr><td>Bootstrap 95% CI</td><td>Calculate the bootstrap 95% confidence interval of an array.</td><td>D.S.</td></tr><tr><td>Sum even digits</td><td>Sum the even digits between two numbers.</td><td>math</td></tr><tr><td>Min-max diff</td><td>Compute the difference between max and min numbers in a list.</td><td>array</td></tr><tr><td>Distinct chars</td><td>Print the sorted,case-insensitive unique characters of a string.</td><td>string</td></tr><tr><td>Longer string Sum float digits</td><td>Compare and print the longer string given two strings.</td><td>string math</td></tr><tr><td>Count vowels</td><td>Sum numbers before and after the decimal point of a float.</td><td></td></tr><tr><td></td><td>Count the number of vowels in a string.</td><td>string</td></tr><tr><td>Factorial</td><td>Compute the factorial of n.</td><td>math</td></tr><tr><td>Max edge triangle</td><td>Finds the maximum range of a triangle's third edge.</td><td>math</td></tr><tr><td>Factorial & remainder</td><td>Compute the factorial and its remainder when divided.</td><td>math</td></tr><tr><td>Sum polygon angles</td><td>Sum the angles in a polygon.</td><td>math</td></tr><tr><td>Sum string numbers</td><td>Add together two numbers represented in string.</td><td>string</td></tr><tr><td>Min-max sum</td><td>Sum the range from the minimum to the maximum of a list.</td><td>array</td></tr><tr><td>Vowel overlap</td><td>Find the number of overlapped vowels of two words.</td><td>string</td></tr><tr><td>Sum negative</td><td>Calculate the sum of negative numbers in a list.</td><td>math</td></tr><tr><td>Load dataset</td><td>Load from a file and print statistics.</td><td>D.S.</td></tr><tr><td>Char length list</td><td>Return a list of non-punctuation character lengths from words.</td><td>string</td></tr><tr><td>Hex to RGB</td><td>Convert a six hexadecimal digit string into list of RGB values.</td><td>math</td></tr><tr><td>Majority vote</td><td>Check if a certain element is the majority of a given list.</td><td>array</td></tr><tr><td>Week later</td><td>Print the formatted date of a week later given a date.</td><td>string</td></tr><tr><td>Sorted word weights</td><td>Check if the list of word weights (sum of ASCI values) are sorted.</td><td>math</td></tr><tr><td>Create Palindrome</td><td>Sum pairs of adjacent digits until the number is palindrome.</td><td>string</td></tr><tr><td>Simulate Backspace</td><td>Apply the backspace characters in a string and print the modifed.</td><td>string</td></tr><tr><td>Data manipulation</td><td>Manipulate a pandas DataFrame and split into train and test set.</td><td>D.S.</td></tr><tr><td>Sum non-overlap</td><td>Sum the integers in a (min,max) range that don't appear in a list.</td><td>array</td></tr><tr><td>Detect digits</td><td>Find if a string contains digits.</td><td>array</td></tr><tr><td>Cascading functions</td><td>Sequentially invoke function objects in a given list.</td><td>math</td></tr><tr><td>Pluralize duplicates</td><td>Pluralize duplicated words in a list.</td><td>dict</td></tr><tr><td>Highest altitude</td><td>Given relative altitudes,find the highest altitude</td><td>array</td></tr><tr><td>Truncate words</td><td>Truncate a sentence so that it contains k words</td><td>array</td></tr><tr><td>Single element</td><td>Find the elements that appear one time in an array</td><td>array</td></tr><tr><td>Remove elements</td><td>Remove all the occurrences of an element in an array</td><td>array</td></tr><tr><td>Check array sum</td><td>Check whether the sum of an array is equal to a given value</td><td>array</td></tr></table>
|
| 307 |
+
|
| 308 |
+
Table 7: Problems in MTPB, showing the problem 1 to 55. D.S. and Algo. refers to data science and algorithm.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Problem Name</td><td>Problem Description</td><td>Category</td></tr><tr><td>Merge sorted lists</td><td>Merge two sorted lists into one</td><td>Algo.</td></tr><tr><td>Maximum subarray</td><td>Find the max contiguous subarray and return the sum</td><td>Algo.</td></tr><tr><td>Max square root integer</td><td>Find the largest integer but smaller than the square root</td><td>Algo.</td></tr><tr><td>Longest word</td><td>Find the longest word in a word list</td><td>Algo.</td></tr><tr><td>Sum unique elements</td><td>Sum all the unique numbers in a list</td><td>Algo.</td></tr><tr><td>Diagonal sum</td><td>Compute the diagonal sum of a matrix</td><td>D.S.</td></tr><tr><td>Matrix condition number</td><td>Check condition number of a matrix is less than a threshold</td><td>D.S.</td></tr><tr><td>Matrix multiplication sum</td><td>Compute matrix multiplication sum of two matrices</td><td>D.S.</td></tr><tr><td>Matrix determinant</td><td>Compare two matrix determinants</td><td>D.S.</td></tr><tr><td>Log-sum-exp</td><td>Compute the log of sum exponential input</td><td>D.S.</td></tr><tr><td>K nearest points</td><td>Find the k nearest points to the origin</td><td>array</td></tr><tr><td>Longest common prefix</td><td>Find the longest common prefix of two strings</td><td>Algo.</td></tr><tr><td>Duplicate elements</td><td>Find duplicates in a list</td><td>array</td></tr><tr><td>First unique character</td><td>Find the first non-repeating character in a string</td><td>Algo.</td></tr><tr><td>Uncommon words</td><td>Find uncommon words in two sentences</td><td>Algo.</td></tr><tr><td>Average words length</td><td>Compute the average word length of a sentence</td><td>Algo.</td></tr><tr><td>Compare char freq</td><td>Compare the character frequencies in two strings</td><td>string</td></tr><tr><td>Reverse string</td><td>Reverse a string</td><td>string</td></tr><tr><td>Square Sum diff</td><td>Difference between the square of sum and the sum of squares</td><td>math</td></tr><tr><td>Cosine sim</td><td>Compute the cosine similarity between two vectors</td><td>math</td></tr><tr><td>Vector distance</td><td>Compare vector distances to the origin</td><td>math</td></tr><tr><td>Smallest standard dev.</td><td>Find the smaller standard deviation given two lists</td><td>D.S.</td></tr><tr><td>Smallest means</td><td>Find the smaller mean given two lists</td><td>D.S.</td></tr><tr><td>Coefficient of variation</td><td>Compute coefficient of variation given a list</td><td>D.S. D.S.</td></tr><tr><td>L1 norm</td><td>Compute the L1 norm given a list</td><td></td></tr><tr><td>Z-statistic</td><td>Compute Z-statistic given a list</td><td>D.S.</td></tr><tr><td>Movenegatives Remove alphabets</td><td>Move all negative elements in a list to the end</td><td>array</td></tr><tr><td>Largest norm</td><td>Remove alphabetical characters in a string</td><td>string D.S.</td></tr><tr><td>F1 score</td><td>Find the largest norm among n-dimensional points</td><td>D.S.</td></tr><tr><td>Add Space</td><td>Given two arrays (pred, gold),calculate the F1 score</td><td></td></tr><tr><td>Remove outlier</td><td>Add spaces before capital letters</td><td>string</td></tr><tr><td></td><td>Remove data points in the tail (2sigma) of normal distribution</td><td>D.S.</td></tr><tr><td>Convert to categorical</td><td>Convert values into categorical variables</td><td>D.S.</td></tr><tr><td>Group by key</td><td>Group items in an array using a provided function</td><td>array</td></tr><tr><td>Max stock profit</td><td>Given an array of "prices",find the max profit</td><td>array</td></tr><tr><td>Sum positions</td><td>Sum of all position indices where a value appear</td><td>array</td></tr><tr><td>Find missing num</td><td>Find a missing number given a list and a max number</td><td>array</td></tr><tr><td>Common num in matrix</td><td>Common numbers among rows in a matrix</td><td>array</td></tr><tr><td>Sum Collatz</td><td>Obtain the sum of Collatz sequence starting from given number</td><td>Algo.</td></tr><tr><td>Cup swap</td><td>Name the location of a "ball" after cup swapping</td><td>Algo.</td></tr><tr><td>Reverse digits</td><td>Reverse digits in a number with a stack</td><td>Algo.</td></tr><tr><td>Calculate arrows</td><td>Calculate arrowheads left and right</td><td>Algo.</td></tr><tr><td>Check interval num</td><td>Check if the interval (max-min) is included in a list</td><td>Algo.</td></tr><tr><td>Length encoding</td><td>Encode a string by converting repeated chars with counts</td><td>string</td></tr><tr><td>Convert email</td><td>Use regex to match email addresses and remove special chars</td><td>string</td></tr><tr><td>Second largest</td><td>Print out the second largest element in an array</td><td>array</td></tr><tr><td>Largest prefix sum</td><td>Return the largest prefix sum in an array</td><td>array</td></tr><tr><td>Closest element to zero</td><td>Find the element which is the closest to O and print the distance</td><td>array</td></tr><tr><td>Consecutive unique char</td><td>Find the max length contiguous subarray with unique characters</td><td>string</td></tr><tr><td>Highest frequency char</td><td>Obtain the frequency of the most frequent character</td><td>string</td></tr><tr><td>Longest palindrome</td><td>Find the length of longest palindrome substring</td><td>string</td></tr><tr><td>Count primes</td><td>Calculate prime numbers in a range</td><td>Algo.</td></tr><tr><td>Rotate array</td><td>Rotate an array to the right k steps</td><td>Algo.</td></tr><tr><td>Partition equal sets</td><td>Check if an array can be split into two sets with equal sums</td><td>Algo.</td></tr><tr><td>Square root integer</td><td>Compute the integer part of square root</td><td></td></tr><tr><td>Plus 1</td><td>Return the digits after an integer is added by 1</td><td>math math</td></tr><tr><td>Check square sum</td><td>Check whether one integer is a sum of two square numbers</td><td>math</td></tr><tr><td>Compare standard dev.</td><td>Determine whether standard deviation is less than 1</td><td>D.S.</td></tr><tr><td>Matrix size</td><td>Calculate the sum of row and column numbers</td><td>D.S.</td></tr><tr><td>Diff mean and median</td><td>Calculate the difference between mean and median for an array</td><td>D.S.</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 8: Problems in MTPB, showing the problem 56 to 115. D.S. and Algo. refers to data science and algorithm.
|
| 313 |
+
|
| 314 |
+
# E PERPLEXITY COMPUTATION FOR SINGLE- AND MULTI-TURN PROMPTS
|
| 315 |
+
|
| 316 |
+
Suppose $\{ p _ { i } \} _ { i = 1 } ^ { n }$ is the set of prompts for a given problem, and $\{ s _ { i } \} _ { i = 1 } ^ { n }$ are the $n$ sub-programs synthesized by a model $P _ { \theta }$ . Suppose $c _ { i - 1 } = [ p _ { 1 } ; s _ { 1 } ; . . . ; p _ { i - 1 } ; s _ { i - 1 } ]$ where $[ \cdot ; \cdot ]$ indicates concatenation, the conditional probability of $p _ { i }$ is ${ \mathrm { P r o b } } _ { i } = P _ { \theta } ( p _ { i } | c _ { i - 1 } )$ , and then the perplexity for the multi-turn prompts is computed as
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
{ \mathrm { P P L } } _ { \mathrm { M u l t i - t u r n } } = \exp \left( - { \frac { 1 } { m } } \sum _ { i = 1 } ^ { n } \log { \mathrm { P r o b } } _ { i } \right) ,
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
where $m$ is the total number of tokens of all prompts $\{ p _ { i } \} _ { i = 1 } ^ { n }$ . Suppose $c = [ p _ { 1 } ; s _ { 1 } ; . . . , p _ { n } , s _ { n } ]$ , then its probability is ${ \mathrm { P r o b } } = P _ { \theta } ( c )$ , and the the perplexity for the single-turn prompts is computed as
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
{ \mathrm { P P L } } _ { \mathrm { S i n g l e - t u r n } } = \exp \left( - { \frac { 1 } { m } } \log { \mathrm { P r o b } } \right) .
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
F PERPLEXITY COMPARISON FOR CODEGEN-NL AND CODEGEN-MULTI
|
| 329 |
+
|
| 330 |
+
<table><tr><td>CODEGEN-NL</td><td>350M</td><td>2.7B</td><td>6.1B</td></tr><tr><td>Pass</td><td>4.53</td><td>3.25</td><td>2.78</td></tr><tr><td>Non-Pass</td><td>4.96</td><td>3.87</td><td>3.65</td></tr></table>
|
| 331 |
+
|
| 332 |
+
Table 9: Average prompt perplexity↓ of CODEGEN-NL models on pass and non-pass problems.
|
| 333 |
+
Table 10: Average prompt perplexity↓ of CODEGEN-MULTI models on pass and non-pass problems.
|
| 334 |
+
|
| 335 |
+
<table><tr><td>CODEGEN-MULTI</td><td>350M</td><td>2.7B</td><td>6.1B</td></tr><tr><td>Pass</td><td>4.78</td><td>3.82</td><td>3.82</td></tr><tr><td>Non-Pass</td><td>5.64</td><td>4.85</td><td>4.80</td></tr></table>
|
| 336 |
+
|
| 337 |
+
G ADDITIONAL BENCHMARK RESULTS
|
| 338 |
+
Table 11: Pass rates on Mostly Basic Python Problems (MBPP).
|
| 339 |
+
|
| 340 |
+
<table><tr><td>Model</td><td>pass@1</td><td>pass@10</td><td>pass @100</td></tr><tr><td>CODEGEN-NL 350M</td><td>0.96</td><td>6.37</td><td>19.91</td></tr><tr><td>CODEGEN-NL 2.7B</td><td>5.34</td><td>24.63</td><td>48.95</td></tr><tr><td>CODEGEN-NL 6.1B</td><td>8.15</td><td>31.21</td><td>55.27</td></tr><tr><td>CODEGEN-NL16.1B</td><td>10.92</td><td>38.43</td><td>62.76</td></tr><tr><td>CODEGEN-MULTI350M</td><td>7.46</td><td>24.18</td><td>46.37</td></tr><tr><td>CODEGEN-MULTI 2.7B</td><td>18.06</td><td>45.80</td><td>65.34</td></tr><tr><td>CODEGEN-MULTI6.1B</td><td>18.35</td><td>47.27</td><td>67.92</td></tr><tr><td>CODEGEN-MULTI 16.1B</td><td>20.94</td><td>51.61</td><td>70.02</td></tr><tr><td>CODEGEN-MONO 350M</td><td>14.59</td><td>41.49</td><td>63.00</td></tr><tr><td>CODEGEN-MONO 2.7B</td><td>27.31</td><td>59.19</td><td>74.24</td></tr><tr><td>CODEGEN-MONO 6.1B</td><td>32.48</td><td>64.20</td><td>76.81</td></tr><tr><td>CODEGEN-MONO 16.1B</td><td>35.28</td><td>67.32</td><td>80.09</td></tr><tr><td>INCODER 6B</td><td>21.30</td><td>46.50</td><td>66.20</td></tr><tr><td>code-cushman-001</td><td>45.90</td><td>66.90</td><td>79.90</td></tr><tr><td>code-davinci-001</td><td>51.80</td><td>72.80</td><td>84.10</td></tr><tr><td>code-davinci-002</td><td>58.10</td><td>76.70</td><td>84.50</td></tr></table>
|
| 341 |
+
|
| 342 |
+
We also evaluated our models on Mostly Basic Python Problems (MBPP) (Austin et al., 2021). The results are displayed in Table 11. Following Chen et al. (2022), we sampled programs from the sanitized MBPP for all of our models, with $n = 1 0 0$ and temperature $= 0 . 8$ . The last four rows are from the aforementioned paper. In general we observe the consistent trend of improving the performance over different versions (NL, Multi, Mono), with our largest CODEGEN-MONO 16.1B approaching the results from code-cushman-001. While we do not know whether any of OpenAI models is the “Codex 12B” reported in Chen et al. (2021), we believe our model achieves reasonable results on MBPP as well. We also note that our CODEGEN-MONO 6.1B significantly outperformed INCODER 6B.
|
| 343 |
+
|
| 344 |
+
# H GENERATED SAMPLES
|
| 345 |
+
|
| 346 |
+
# H.1 CASES WHERE CODEGEN-MONO 16.1B UNDER-PERFORMS
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
|
| 350 |
+
Figure 3: Generated samples for “Reverse digits” problem. While being simplistic, we often observe that CODEGEN-MONO 16.1B assumes the type when assigning a number to a variable. Here on the right, despite being explicitly specified to initialize a number as a string, the larger model fails to do so. This causes an error in the following turn when the code attempts to iterate over num.
|
| 351 |
+
|
| 352 |
+
# Import libraries.
|
| 353 |
+
import numpy as np
|
| 354 |
+
# Assign the matrix "[[3, 2], [2, 3]]" to a variable named "my_matrix".
|
| 355 |
+
my_matrix $=$ [[3, 2], [2, 3]]
|
| 356 |
+
# Assign the number "1" to a variable named "t".
|
| 357 |
+
$ { \mathrm { ~ ~ t ~ } } = { \mathrm { ~ ~ 1 ~ } }$
|
| 358 |
+
# Compute the condition number of my_matrix and store as result.
|
| 359 |
+
result $=$ np.linalg.cond(my_matrix)
|
| 360 |
+
# Check whether the result is smaller than t . If yes, return "True", otherwise return "False".
|
| 361 |
+
if result < t: print("True")
|
| 362 |
+
else: print("False")
|
| 363 |
+
# Import libraries.
|
| 364 |
+
import numpy as np
|
| 365 |
+
# Assign the matrix "[[3, 2], [2, 3]]" to a variable named "my_matrix".
|
| 366 |
+
my_matrix $=$ [[3, 2], [2, 3]]
|
| 367 |
+
# Assign the number "1" to a variable named "t".
|
| 368 |
+
$ { \mathrm { ~ ~ t ~ } } = { \mathrm { ~ ~ 1 ~ } }$
|
| 369 |
+
# Compute the condition number of my_matrix and store as result.
|
| 370 |
+
condition_number $=$ np.linalg.cond(my_matrix)
|
| 371 |
+
# Check whether the result is smaller than t . If yes, return "True", otherwise return "False".
|
| 372 |
+
def check_condition_number(condition_number, t): if condition_number < t: return True else: return False
|
| 373 |
+
|
| 374 |
+
# H.2 CASES WHERE CODEGEN-MONO 16.1B OUTPERFORMS
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 5: Generated samples for “Cup swap” problem. Here, CODEGEN-MONO 2.7B mistakenly treats “swap” as a part of a value t o be assigned, while CODEGEN-MONO 16.1B parses the intent correctly and assigns two variables in parallel.
|
| 378 |
+
|
| 379 |
+
# Import libraries.
|
| 380 |
+
|
| 381 |
+
# Import libraries.
|
| 382 |
+
|
| 383 |
+
import numpy as np import numpy as np
|
| 384 |
+
|
| 385 |
+
# Initialize the variable named lst1 with a list [’abc’, ’abc10’].
|
| 386 |
+
|
| 387 |
+
# Initialize the variable named lst1 with a list [’abc’, ’abc10’].
|
| 388 |
+
|
| 389 |
+
lst1 $=$ [’abc’, ’abc10’] lst1 $=$ [’abc’, ’abc10’] # Create a function called num_in_str() to check whether a string contains a number # Create a function called num_in_str() to check whether a string contains a number def num_in_str(string): for i in string: if i.isnumeric(): return True else: return False def num_in_str(s): return any(i.isdigit() for i in s)
|
| 390 |
+
|
| 391 |
+
# Call the function num_in_str() to find strings in lst1 that have numbers and assign them to a list named lst2
|
| 392 |
+
|
| 393 |
+
# Call the function num_in_str() to find strings in lst1 that have numbers and assign them to a list named lst2
|
| 394 |
+
|
| 395 |
+
for i in lst1: if num_in_str(i): lst2.append(i)
|
| 396 |
+
|
| 397 |
+
# Print out lst2
|
| 398 |
+
|
| 399 |
+
Figure 6: Generated samples for “Detect digits” problem. CODEGEN-MONO 2.7B fails to implement the num_in_str, resulting in checking only the first character. In contrast, CODEGEN-MONO 16.1B successfully utilizes any function to scan all the characters in the given string.
|
| 400 |
+
|
| 401 |
+
# I ADDITIONAL ANALYSES ON MTPB
|
| 402 |
+
|
| 403 |
+
We conducted additional analyses to illustrate the relationship generated program length and pass rate and showed the results in Figure 7, Figure 8, and Figure 9. The relationship between generated program length and prompt length is shown in Figure 10.
|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
Figure 7: Maximum Length of Completion versus Pass Rate.
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
Figure 8: Maximum Length of Completion versus Pass Rate.
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 9: Maximum Length of Completion versus Pass Rate.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 10: Prompt Length versus Generated Program Length.
|
parse/dev/iaYcJKpY2B_/iaYcJKpY2B__content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/iaYcJKpY2B_/iaYcJKpY2B__middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/iaYcJKpY2B_/iaYcJKpY2B__model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|