Datasets:
Add files using upload-large-folder tool
Browse files- parse/dev/-h6WAS6eE4/-h6WAS6eE4.md +286 -0
- parse/dev/-h6WAS6eE4/-h6WAS6eE4_content_list.json +1296 -0
- parse/dev/-h6WAS6eE4/-h6WAS6eE4_middle.json +0 -0
- parse/dev/-h6WAS6eE4/-h6WAS6eE4_model.json +0 -0
- parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ.md +0 -0
- parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ_content_list.json +0 -0
- parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ_model.json +0 -0
- parse/dev/QYvFUlF19n/QYvFUlF19n.md +248 -0
- parse/dev/RzXb6a3H3rs/RzXb6a3H3rs_content_list.json +1565 -0
- parse/dev/bgAS1ZvveZ/bgAS1ZvveZ.md +411 -0
- parse/dev/bgAS1ZvveZ/bgAS1ZvveZ_content_list.json +2146 -0
- parse/dev/bgAS1ZvveZ/bgAS1ZvveZ_middle.json +0 -0
- parse/dev/frE4fUwz_h/frE4fUwz_h.md +427 -0
- parse/dev/frE4fUwz_h/frE4fUwz_h_content_list.json +0 -0
- parse/dev/frE4fUwz_h/frE4fUwz_h_middle.json +0 -0
- parse/dev/vbPsD-BhOZ/vbPsD-BhOZ_content_list.json +0 -0
- parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu.md +354 -0
- parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu_content_list.json +1519 -0
- parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu_middle.json +0 -0
- parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu_model.json +0 -0
parse/dev/-h6WAS6eE4/-h6WAS6eE4.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Locating and Editing Factual Associations in GPT
|
| 2 |
+
|
| 3 |
+
Kevin Meng⇤ MIT CSAIL
|
| 4 |
+
|
| 5 |
+
David Bau⇤ Northeastern University
|
| 6 |
+
|
| 7 |
+
Alex Andonian MIT CSAIL
|
| 8 |
+
|
| 9 |
+
Yonatan Belinkov† Technion – IIT
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
We analyze the storage and recall of factual associations in autoregressive transformer language models, finding evidence that these associations correspond to localized, directly-editable computations. We first develop a causal intervention for identifying neuron activations that are decisive in a model’s factual predictions. This reveals a distinct set of steps in middle-layer feed-forward modules that mediate factual predictions while processing subject tokens. To test our hypothesis that these computations correspond to factual association recall, we modify feedforward weights to update specific factual associations using Rank-One Model Editing (ROME). We find that ROME is effective on a standard zero-shot relation extraction (zsRE) model-editing task. We also evaluate ROME on a new dataset of difficult counterfactual assertions, on which it simultaneously maintains both specificity and generalization, whereas other methods sacrifice one or another. Our results confirm an important role for mid-layer feed-forward modules in storing factual associations and suggest that direct manipulation of computational mechanisms may be a feasible approach for model editing. The code, dataset, visualizations, and an interactive demo notebook are available at https://rome.baulab.info/.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Where does a large language model store its facts? In this paper, we report evidence that factual associations in GPT correspond to a localized computation that can be directly edited.
|
| 18 |
+
|
| 19 |
+
Large language models can predict factual statements about the world (Petroni et al., 2019; Jiang et al., 2020; Roberts et al., 2020). For example, given the prefix “The Space Needle is located in the city of,” GPT will reliably predict the true answer: “Seattle” (Figure 1a). Factual knowledge has been observed to emerge in both autoregressive GPT models (Radford et al., 2019; Brown et al., 2020) and masked BERT models (Devlin et al., 2019).
|
| 20 |
+
|
| 21 |
+
In this paper, we investigate how such factual associations are stored within GPT-like autoregressive transformer models. Although many of the largest neural networks in use today are autoregressive, the way that they store knowledge remains under-explored. Some research has been done for masked models (Petroni et al., 2019; Jiang et al., 2020; Elazar et al., 2021a; Geva et al., 2021; Dai et al., 2022; De Cao et al., 2021), but GPT has architectural differences such as unidirectional attention and generation capabilities that provide an opportunity for new insights.
|
| 22 |
+
|
| 23 |
+
We use two approaches. First, we trace the causal effects of hidden state activations within GPT using causal mediation analysis (Pearl, 2001; Vig et al., 2020b) to identify the specific modules that mediate recall of a fact about a subject (Figure 1). Our analysis reveals that feedforward MLPs at a range of middle layers are decisive when processing the last token of the subject name (Figures 1b,2b,3).
|
| 24 |
+
|
| 25 |
+
Second, we test this finding in model weights by introducing a Rank-One Model Editing method (ROME) to alter the parameters that determine a feedfoward layer’s behavior at the decisive token.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Causal Traces compute the causal effect of neuron activations by running the network twice: (a) once normally, and (b) once where we corrupt the subject token and then (c) restore selected internal activations to their clean value. (d) Some sets of activations cause the output to return to the original prediction; the light blue path shows an example of information flow. The causal impact on output probability is mapped for the effect of (e) each hidden state on the prediction, (f) only MLP activations, and (g) only attention activations.
|
| 29 |
+
|
| 30 |
+
Despite the simplicity of the intervention, we find that ROME is similarly effective to other modelediting approaches on a standard zero-shot relation extraction benchmark (Section 3.2).
|
| 31 |
+
|
| 32 |
+
To evaluate ROME’s impact on more difficult cases, we introduce a dataset of counterfactual assertions (Section 3.3) that would not have been observed in pretraining. Our evaluations (Section 3.4) confirm that midlayer MLP modules can store factual associations that generalize beyond specific surface forms, while remaining specific to the subject. Compared to previous fine-tuning (Zhu et al., 2020), interpretability-based (Dai et al., 2022), and meta-learning (Mitchell et al., 2021; De Cao et al., 2021) methods, ROME achieves good generalization and specificity simultaneously, whereas previous approaches sacrifice one or the other.
|
| 33 |
+
|
| 34 |
+
# 2 Interventions on Activations for Tracing Information Flow
|
| 35 |
+
|
| 36 |
+
To locate facts within the parameters of a large pretrained autoregressive transformer, we begin by analyzing and identifying the specific hidden states that have the strongest causal effect on predictions of individual facts. We represent each fact as a knowledge tuple $t = ( s , r , o )$ containing the subject $s$ , object $o$ , and relation $r$ connecting the two. Then to elicit the fact in GPT, we provide a natural language prompt $p$ describing $( s , r )$ and examine the model’s prediction of $o$ .
|
| 37 |
+
|
| 38 |
+
An autoregressive transformer language model $G : \mathcal { X } \mathcal { Y }$ over vocabulary $V$ maps a token sequence $x = [ x _ { 1 } , . . . , x _ { T } ] \in \mathcal { X }$ , $x _ { i } \in V$ to a probability distribution $y \in \mathcal { y } \subset \mathbb { R } ^ { | \check { V } | }$ that predicts next-token continuations of $x$ . Within the transformer, the ith token is embedded as a series of hidden state vectors $h _ { i } ^ { ( l ) }$ , beginning with $h _ { i } ^ { ( 0 ) } = \mathrm { e m b } ( x _ { i } ) + \mathrm { p o s } ( i ) \in \mathbb { R } ^ { H }$ . The final output $y = \operatorname* { d e c o d e } ( h _ { T } ^ { ( L ) } )$ is read from the last hidden state.
|
| 39 |
+
|
| 40 |
+
We visualize the internal computation of $G$ as a grid (Figure 1a) of hidden states $h _ { i } ^ { ( l ) }$ in which each layer $l$ $( \mathrm { l e f t } \to \mathrm { r i g h t } )$ ) adds global attention $a _ { i } ^ { ( l ) }$ and local MLP $m _ { i } ^ { ( l ) }$ contributions computed from previous layers, and where each token $i$ (top bottom) attends to previous states from other tokens. Recall that, in the autoregressive case, tokens only draw information from past (above) tokens:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\begin{array} { r l } & { h _ { i } ^ { ( l ) } = h _ { i } ^ { ( l - 1 ) } + a _ { i } ^ { ( l ) } + m _ { i } ^ { ( l ) } } \\ & { ~ a _ { i } ^ { ( l ) } = \mathrm { a t t n } ^ { ( l ) } \left( h _ { 1 } ^ { ( l - 1 ) } , h _ { 2 } ^ { ( l - 1 ) } , \ldots , h _ { i } ^ { ( l - 1 ) } \right) } \\ & { ~ m _ { i } ^ { ( l ) } = W _ { p r o j } ^ { ( l ) } \sigma \left( W _ { f c } ^ { ( l ) } \gamma \left( a _ { i } ^ { ( l ) } + h _ { i } ^ { ( l - 1 ) } \right) \right) . } \end{array}
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: Average Indirect Effect of individual model components over a sample of 1000 factual statements reveals two important sites. (a) Strong causality at a ‘late site’ in the last layers at the last token is unsurprising, but strongly causal states at an ‘early site’ in middle layers at the last subject token is a new discovery. (b) MLP contributions dominate the early site. (c) Attention is important at the late site. Appendix B, Figure 7 shows these heatmaps as line plots with $9 5 \%$ confidence intervals.
|
| 48 |
+
|
| 49 |
+
Each layer’s MLP is a two-layer neural network parameterized by matrices W (l)proj and $W _ { f c } ^ { ( l ) }$ , with rectifying nonlinearity $\sigma$ and normalizing nonlinearity $\gamma$ . For further background on transformers, we refer to Vaswani et al. (2017).3
|
| 50 |
+
|
| 51 |
+
# 2.1 Causal Tracing of Factual Associations
|
| 52 |
+
|
| 53 |
+
The grid of states (Figure 1) forms a causal graph (Pearl, 2009) describing dependencies between the hidden variables. This graph contains many paths from inputs on the left to the output (next-word prediction) at the lower-right, and we wish to understand if there are specific hidden state variables that are more important than others when recalling a fact.
|
| 54 |
+
|
| 55 |
+
As Vig et al. (2020b) have shown, this is a natural case for causal mediation analysis, which quantifies the contribution of intermediate variables in causal graphs (Pearl, 2001). To calculate each state’s contribution towards a correct factual prediction, we observe all of $G$ ’s internal activations during three runs: a clean run that predicts the fact, a corrupted run where the prediction is damaged, and a corrupted-with-restoration run that tests the ability of a single state to restore the prediction.
|
| 56 |
+
|
| 57 |
+
• In the clean run, we pass a factual prompt $x$ into $G$ and collect all hidden activations $\{ h _ { i } ^ { ( l ) } \ | \ i \in [ 1 , T ] , l \in [ 1 , \dot { L } ] \}$ . Figure 1a provides an example illustration with the prompt: “The Space Needle is in downtown ”, for which the expected completion is $o = { } ^ { \mathrm { * } } \mathrm { S e a t t l e } ^ { \mathrm { * } }$ . • In the baseline corrupted run, the subject is obfuscated from $G$ before the network runs. Concretely, immediately after $x$ is embedded as $[ h _ { 1 } ^ { ( 0 ) } , h _ { 2 } ^ { ( 0 ) } , . . . , h _ { T } ^ { ( 0 ) } ]$ , we set $h _ { i } ^ { ( 0 ) } : = h _ { i } ^ { ( 0 ) } + \epsilon$ for all indices $i$ that correspond to the subject entity, where $\epsilon \sim \mathcal { N } ( 0 ; \bar { \nu } ) ^ { 4 } ; . \ : G$ is then allowed to continue normally, giving us a set of corrupted activations $\{ h _ { i * } ^ { ( l ) } \ | \ i \in [ 1 , T ] , l \in [ 1 , L ] \}$ . Because $G$ loses some information about the subject, it will likely return an incorrect answer (Figure 1b). • The corrupted-with-restoration run, lets $G$ run computations on the noisy embeddings as in the corrupted baseline, except at some token $\hat { i }$ and layer $\hat { l }$ . There, we hook $G$ so that it is forced to output the clean state $h _ { \widehat { i } } ^ { ( l ) }$ ; future computations execute without further intervention. Intuitively, the i ability of a few clean states to recover the correct fact, despite many other states being corrupted by the obfuscated subject, will indicate their causal importance in the computation graph.
|
| 58 |
+
|
| 59 |
+
Let $\mathbb { P } [ o ] , \mathbb { P } _ { * } [ o ]$ , and $\mathbb { P } _ { * }$ , clean $h _ { i } ^ { ( l ) } \left[ O \right]$ denote the probability of emitting $o$ under the clean, corrupted, and corrupted-with-restoration runs, respectively; dependence on the input $x$ is omitted for notational simplicity. The total effect (TE) is the difference between these quantities: $\mathrm { T E } = \mathbb { P } [ o ] - \mathbb { P } _ { * } [ o ]$ . The indirect effect (IE) of a specific mediating state $h _ { i } ^ { ( l ) }$ is defined as the difference between the probability of $o$ under the corrupted version and the probability when that state is set to its clean version, while the subject remains corrupted: $\mathrm { I E } = \mathbb { P } _ { * }$ , clean $h _ { i } ^ { ( l ) } \left[ O \right] - \mathbb { P } _ { * } [ O ]$ . Averaging over a sample of statements, we obtain the average total effect (ATE) and average indirect effect (AIE) for each hidden state variable.5
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 3: Causal effects with a modified computation graph. (a,b) To isolate the effects of MLP modules when measuring causal effects, the computation graph is modified. (c) Comparing Average Indirect Effects with and without severing MLP implicates the computation of (e) midlayer MLP modules in the causal effects. No similar gap is seen when attention is similarly severed.
|
| 63 |
+
|
| 64 |
+
# 2.2 Causal Tracing Results
|
| 65 |
+
|
| 66 |
+
We compute the average indirect effect (AIE) over 1000 factual statements (details in Appendix B.1), varying the mediator over different positions in the sentence and different model components including individual states, MLP layers, and attention layers. Figure 2 plots the AIE of the internal components of GPT-2 XL (1.5B parameters). The ATE of this experiment is $1 8 . 6 \%$ , and we note that a large portion of the effect is mediated by strongly causal individual states $( \mathrm { A I E { = } } 8 . 7 \%$ at layer 15) at the last subject token. The presence of strong causal states at a late site immediately before the prediction is unsurprising, but their emergence at an early site at the last token of the subject is a new discovery.
|
| 67 |
+
|
| 68 |
+
Decomposing the causal effects of contributions of MLP and attention modules (Figure 1fg and Figure 2bc) suggests a decisive role for MLP modules at the early site: MLP contributions peak at AIE $6 . 6 \%$ , while attention at the last subject token is only AIE $1 . 6 \%$ ; attention is more important at the last token of the prompt. Appendix B.2 further discusses this decomposition.
|
| 69 |
+
|
| 70 |
+
Finally, to gain a clearer picture of the special role of MLP layers at the early site, we analyze indirect effects with a modified causal graph (Figure 3). (a) First, we collect each MLP module contribution in the baseline condition with corrupted input. (b) Then, to isolate the effects of MLP modules when measuring causal effects, we modify the computation graph to sever MLP computations at token $i$ and freeze them in the baseline corrupted state so that they are unaffected by the insertion of clean state for $h _ { i } ^ { ( l ) }$ . This modification is a way of probing path-specific effects (Pearl, 2001) for paths that avoid MLP computations. (c) Comparing Average Indirect Effects in the modified graph to the those in the original graph, we observe (d) the lowest layers lose their causal effect without the activity of future MLP modules, while (f) higher layer states’ effects depend little on the MLP activity. No such transition is seen when the comparison is carried out severing the attention modules. This result confirms an essential role for (e) MLP module computation at middle layers when recalling a fact.
|
| 71 |
+
|
| 72 |
+
Appendix B has results on other autoregressive models and experimental settings. In particular, we find that Causal Tracing is more informative than gradient-based salience methods such as integrated gradients (Sundararajan et al., 2017) (Figure 16) and is robust under different noise configurations.
|
| 73 |
+
|
| 74 |
+
We hypothesize that this localized midlayer MLP key–value mapping recalls facts about the subject.
|
| 75 |
+
|
| 76 |
+
# 2.3 The Localized Factual Association Hypothesis
|
| 77 |
+
|
| 78 |
+
Based on causal traces, we posit a specific mechanism for storage of factual associations: each midlayer MLP module accepts inputs that encode a subject, then produces outputs that recall memorized properties about that subject. Middle layer MLP outputs accumulate information, then the summed information is copied to the last token by attention at high layers.
|
| 79 |
+
|
| 80 |
+
This hypothesis localizes factual association along three dimensions, placing it (i) in the MLP modules (ii) at specific middle layers (iii) and specifically at the processing of the subject’s last token. It is consistent with the Geva et al. (2021) view that MLP layers store knowledge, and the Elhage et al. (2021) study showing an information-copying role for self-attention. Furthermore, informed by the Zhao et al. (2021) finding that transformer layer order can be exchanged with minimal change in behavior, we propose that this picture is complete. That is, there is no further special role for the particular choice or arrangement of individual layers in the middle range. We conjecture that any fact could be equivalently stored in any one of the middle MLP layers. To test our hypothesis, we narrow our attention to a single MLP module at a mid-range layer $l ^ { * }$ , and ask whether its weights can be explicitly modified to store an arbitrary fact.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 4: Editing one MLP layer with ROME. To associate Space Needle with Paris, the ROME method inserts a new $( k _ { * } , v _ { * } )$ association into layer $l ^ { * }$ , where (a) key $k _ { * }$ is determined by the subject and (b) value $v _ { * }$ is optimized to select the object. (c) Hidden state at layer $l ^ { * }$ and token $_ { i }$ is expanded to produce (d) the key vector $k _ { * }$ for the subject. (e) To write new value vector $v _ { * }$ into the layer, (f) we calculate a rank-one update $\Lambda ( C ^ { - 1 } k _ { * } ) ^ { T }$ to cause $\hat { W } _ { p r o j } ^ { ( l ) } \hat { k } _ { * } = v _ { * }$ ⇤ while minimizing interference with other memories stored in the layer.
|
| 84 |
+
|
| 85 |
+
# 3 Interventions on Weights for Understanding Factual Association Storage
|
| 86 |
+
|
| 87 |
+
While Causal Tracing has implicated MLP modules in recalling factual associations, we also wish to understand how facts are stored in weights. Geva et al. (2021) observed that MLP layers (Figure 4cde) can act as two-layer key–value memories,6 where the neurons of the first layer (l) $\mathbf { \overline { { \it W } } } _ { f c } ^ { ( l ) }$ form a key, with which the second layer $W _ { p r o j } ^ { ( l ) }$ retrieves an associated value. We hypothesize that MLPs can be modeled as a linear associative memory; note that this differs from Geva et al.’s per-neuron view.
|
| 88 |
+
|
| 89 |
+
We test this hypothesis by conducting a new type of intervention: modifying factual associations with Rank-One Model Editing (ROME). Being able to insert a new knowledge tuple $t ^ { * } = ( s , r , o ^ { * } )$ in place of the current tuple $t ^ { c } = \left( s , r , o ^ { c } \right)$ with both generalization and specificity would demonstrate fine-grained understanding of the association-storage mechanisms.
|
| 90 |
+
|
| 91 |
+
# 3.1 Rank-One Model Editing: Viewing the Transformer MLP as an Associative Memory
|
| 92 |
+
|
| 93 |
+
We view W (l)proj as a linear associative memory (Kohonen, 1972; Anderson, 1972). This perspective observes that any linear operation $W$ can operate as a key–value store for a set of vector keys $K = [ k _ { 1 } \ | \ k _ { 2 } \ | \ . \ . \ . ]$ and corresponding vector values $V = \left[ v _ { 1 } \mid v _ { 2 } \mid \ldots \right]$ , by solving $W K \approx V$ , whose squared error is minimized using the Moore-Penrose pseudoinverse: $\dot { W } = V { \bar { K ^ { + } } }$ . Bau et al. (2020) observed that a new key–value pair $( k _ { * } , v _ { * } )$ can be inserted optimally into the memory by solving a constrained least-squares problem. In a convolutional network, Bau et al. solve this using an optimization, but in a fully-connected layer, we can derive a closed form solution:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathrm { ~ e ~ } \Vert \hat { W } K - V \Vert \mathrm { ~ s u c h ~ t h a t ~ } \hat { W } k _ { * } = v _ { * } \quad \mathrm { b y ~ s e t t i n g ~ } \hat { W } = W + \Lambda ( C ^ { - 1 } k _ { * } ) ^ { T } .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Here $W$ is the original matrix, $C = K K ^ { T }$ is a constant that we pre-cache by estimating the uncentered covariance of $k$ from a sample of Wikipedia text (Appendix E.5), and $\Lambda = \mathbf { \bar { \Phi } } ( v _ { * } - W k _ { * } ) / ( C ^ { - 1 } k _ { * } ) ^ { T } k _ { * }$ is a vector proportional to the residual error of the new key–value pair on the original memory matrix (full derivation in Appendix A). Because of this simple algebraic structure, we can insert any fact directly once $( k _ { * } , v _ { * } )$ is computed. All that remains is to choose the appropriate $k _ { * }$ and $v _ { * }$ .
|
| 100 |
+
|
| 101 |
+
Step 1: Choosing $k _ { * }$ to Select the Subject. Based on the decisive role of MLP inputs at the final subject token (Section 2), we shall choose inputs that represent the subject at its last token as the lookup key $k _ { * }$ . Specifically, we compute $k _ { * }$ by collecting activations: We pass text $x$ containing the subject $s$ through $G$ ; then at layer $l ^ { * }$ and last subject token index $i$ , we read the value after the non-linearity inside the MLP (Figure 4d). Because the state will vary depending on tokens that precede $s$ in text, we set $k _ { * }$ to an average value over a small set of texts ending with the subject $s$ :
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
k _ { * } = \frac { 1 } { N } \sum _ { j = 1 } ^ { N } k ( x _ { j } + s ) , \mathrm { ~ w h e r e ~ } k ( x ) = \sigma \left( W _ { f c } ^ { ( l ^ { * } ) } \gamma ( a _ { [ x ] , i } ^ { ( l ^ { * } ) } + h _ { [ x ] , i } ^ { ( l ^ { * } - 1 ) } ) \right) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
In practice, we sample $x _ { j }$ by generating 50 random token sequences of length 2 to 10 using $G$
|
| 108 |
+
|
| 109 |
+
Step 2: Choosing $v _ { * }$ to Recall the Fact. Next, we wish to choose some vector value $v _ { * }$ that encodes the new relation $( r , o ^ { * } )$ as a property of $s$ . We set $v _ { * } = \mathrm { a r g m i n } _ { z } \mathcal { L } ( z )$ , where the objective $\mathcal { L } ( z )$ is:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\frac { 1 } { N } \sum _ { j = 1 } ^ { N } \underbrace { - \log { \mathbb { P } } _ { G ( m _ { i } ^ { ( t ^ { * } ) } : = z ) } [ o ^ { * } \mid x _ { j } + p ] } _ { \mathrm { ( a ) M a x i m i z i n g ~ \textstyle o ^ { * } ~ p r o b a b i l i t y } } + \underbrace { D _ { \mathrm { K L } } ( \mathbb { P } _ { G ( m _ { i ^ { \prime } } ^ { ( t ^ { * } ) } : = z ) } [ x \mid p ^ { \prime } ] \| \mathbb { P } _ { G } [ x \mid p ^ { \prime } ] ) } _ { \mathrm { ( b ) C o n r o l i n g ~ e s s e n c e d i r t } } .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
The first term (Eqn. 4a) seeks a vector $z$ that, when substituted as the output of the MLP at the token $i$ at the end of the subject (notated $G ( m _ { i } ^ { ( l ^ { * } ) } : = z ) ^ { \backslash }$ ), will cause the network to predict the target object $o ^ { * }$ in response to the factual prompt $p$ . The second term (Eqn. 4b) minimizes the KL divergence of predictions for the prompt $p ^ { \prime }$ (of the form $\mathbf { \cdots } \{ \mathrm { s u b j e c t } \}$ is a”) to the unchanged model, which helps preserve the model’s understanding of the subject’s essence. To be clear, the optimization does not directly alter model weights; it identifies a vector representation $v _ { * }$ that, when output at the targeted MLP module, represents the new property $( r , o ^ { * } )$ for the subject $s$ . Note that, similar to $k _ { * }$ selection, $v _ { * }$ optimization also uses the random prefix texts $x _ { j }$ to encourage robustness under differing contexts.
|
| 116 |
+
|
| 117 |
+
Step 3: Inserting the Fact. Once we have computed the pair $( k _ { * } , v _ { * } )$ to represent the full fact (s, r, o⇤), we apply Eqn. 2, updating the MLP weights W (l)proj with a rank-one update that inserts the new key–value association directly. For full implementation details, see Appendix E.5.
|
| 118 |
+
|
| 119 |
+
# 3.2 Evaluating ROME: Zero-Shot Relation Extraction (zsRE)
|
| 120 |
+
|
| 121 |
+
We wish to test our localized factual association hypothesis: can storing a single new vector association using ROME insert a substantial, generalized factual association into the model?
|
| 122 |
+
|
| 123 |
+
A natural question is how ROME compares to other model-editing methods, which use direct optimization or hypernetworks to incorporate a single new training example into a network. For baselines, we examine Fine-Tuning (FT), which applies Adam with early stopping at one layer to minimize $- \log \mathbb { P } \left[ o ^ { * } \mid x \right]$ . Constrained Fine-Tuning $\mathbf { \left( F T + L \right) }$ (Zhu et al., 2020) additionally imposes a parameter-space $L _ { \infty }$ norm constraint on weight changes. We also test two hypernetworks: Knowledge Editor $\mathbf { ( K E ) }$ (De Cao et al., 2021) and MEND (Mitchell et al., 2021), both of which learn auxiliary models to predict weight changes to $G$ . Further details are described in Appendix E.
|
| 124 |
+
|
| 125 |
+
We first evaluate ROME on the Zero-Shot Relation Extraction (zsRE) task used in Mitchell et al. (2021) and De Cao et al. (2021). Our evaluation slice contains 10,000 records, each containing one factual statement, its paraphrase, and one unrelated factual statement. “Efficacy” and “Paraphrase” measure post-edit accuracy $\mathbb { I } \big [ o ^ { * } = \mathrm { a r g m a x } _ { o } \mathbb { P } _ { G ^ { \prime } } \left[ o \right] \big ]$ of the statement and its paraphrase, respectively, while “Specificity” measures the edited model’s accuracy on an unrelated fact. Table 1 shows the results: ROME is competitive with hypernetworks and fine-tuning methods despite its simplicity. We find that it
|
| 126 |
+
|
| 127 |
+
Table 1: zsRE Editing Results on GPT-2 XL.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Editor</td><td>Efficacy 个 Paraphrase 个 Specificity 个</td></tr><tr><td>GPT-2 XL</td><td>22.2 (±0.5) 21.3 (±0.5) 24.2 (±0.5)</td></tr><tr><td>FT</td><td>99.6 (±0.1) 82.1 (±0.6) 23.2(±0.5)</td></tr><tr><td>FT+L</td><td>92.3 (±0.4) 47.2 (±0.7) 23.4(±0.5)</td></tr><tr><td>KE</td><td>65.5 (±0.6) 61.4(±0.6) 24.9 (±0.5)</td></tr><tr><td>KE-zsRE</td><td>92.4 (±0.3) 90.0 (±0.3) 23.8 (±0.5)</td></tr><tr><td>MEND</td><td>75.9 (±0.5) 65.3 (±0.6) 24.1(±0.5)</td></tr><tr><td>MEND-zsRE 99.4 (±0.1)</td><td>99.3 (±0.1) 24.1(±0.5)</td></tr><tr><td>ROME</td><td>99.8 (±0.0) 88.1(±0.5) 24.2 (±0.5)</td></tr></table>
|
| 130 |
+
|
| 131 |
+
is not hard for ROME to insert an association that can be regurgitated by the model. Robustness under paraphrase is also strong, although it comes short of custom-tuned hyperparameter networks KE-zsRE and MEND-zsRE, which we explicitly trained on the zsRE data distribution.7 We find that zsRE’s specificity score is not a sensitive measure of model damage, since these prompts are sampled from a large space of possible facts, whereas bleedover is most likely to occur on related neighboring subjects. Appendix C has additional experimental details.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 5: ROME edits are benchmarked at each layer-and-token combination in GPT-2-XL. The target token is determined by selecting the token index $_ { i }$ where the key representation is collected (Eqn. 3). ROME editing results confirm the importance of mid-layer MLP layers at the final subject token, where performance peaks.
|
| 135 |
+
|
| 136 |
+
# 3.3 Evaluating ROME: Our COUNTERFACT Dataset
|
| 137 |
+
|
| 138 |
+
While standard model-editing metrics on zsRE are a reasonable starting point for evaluating ROME, they do not provide detailed insights that would allow us to distinguish superficial wording changes from deeper modifications that correspond to a meaningful change about a fact.
|
| 139 |
+
|
| 140 |
+
In particular, we wish to measure the efficacy of significant changes. Hase et al. (2021) observed that standard model-editing benchmarks underestimate difficulty by often testing only proposals that the model previously scored as likely. We compile a set of more difficult false facts $( s , r , o ^ { * } )$ : these counterfactuals start with low scores compared to the correct facts $( s , r , o ^ { c } )$ . Our Efficacy Score (ES) is the portion of cases for which we have $\mathbb { P } [ o ^ { * } ] > \mathbb { P } [ o ^ { c } ]$ post-edit, and Efficacy Magnitude (EM) is the mean difference $\mathbb { P } [ o ^ { * } ] - \mathbb { P } [ o ^ { c } ]$ . Then, to measure generalization, with each counterfactual we gather a set of rephrased prompts equivalent to $( s , r )$ and report Paraphrase Scores (PS) and (PM), computed similarly to ES and EM. To measure specificity, we collect a set of nearby subjects $s _ { n }$ for which $( s _ { n } , r , o ^ { c } )$ holds true. Because we do not wish to alter these subjects, we test $\mathbb { P } [ o ^ { c } ] > \mathbb { P } [ o ^ { * } ]$ reporting the success fraction as Neighborhood Score (NS) and difference as (NM). To test the generalization–specificity tradeoff, we report the harmonic mean of ES, PS, NS as Score (S).
|
| 141 |
+
|
| 142 |
+
We also wish to measure semantic consistency of $G ^ { \prime }$ ’s generations. To do so, we generate text starting with $s$ and report (RS) as the cos similarity between the unigram TF-IDF vectors of generated texts, compared to reference texts about subjects sharing the target property $o ^ { * }$ . Finally, we monitor fluency degradations by measuring the weighted average of bi- and tri-gram entropies (Zhang et al., 2018) given by $\begin{array} { r } { - \sum _ { k } f ( k ) \log _ { 2 } f ( k ) } \end{array}$ , where $f ( \cdot )$ is the $n$ -gram frequency distribution, which we report as (GE); this quantity drops if text generations are repetitive.
|
| 143 |
+
|
| 144 |
+
In order to facilitate the above measurements, we introduce COUNTERFACT, a challenging evaluation dataset for evaluating counterfactual edits in language models. Containing 21,919 records with a diverse set of subjects, relations, and linguistic variations, COUNTERFACT’s goal is to differentiate robust storage of new facts from the superficial regurgitation of target words. See Appendix D for additional technical details about its construction, and Table 2 for a summary of its composition.
|
| 145 |
+
|
| 146 |
+
Table 2: COUNTERFACT Composition
|
| 147 |
+
|
| 148 |
+
<table><tr><td></td></tr><tr><td>Per Per Item Total Relation Record</td></tr><tr><td>Records 21919 645 1</td></tr><tr><td>Subjects 20391 624 1</td></tr><tr><td>Objects 749 60 1</td></tr><tr><td>Counterfactual Statements 21595 635 1</td></tr><tr><td>Paraphrase Prompts 42876 1262 2</td></tr><tr><td>Neighborhood Prompts 82650 2441 10</td></tr><tr><td>Generation Prompts 62346 1841 3</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 3: Comparison to Existing Benchmarks
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Criterion</td><td colspan="6">SQuAD zSRE FEVER WikiTextPARAREL CF</td></tr><tr><td>Efficacy</td><td><<xx</td><td></td><td></td><td></td><td><<xxx</td><td>vvv<></td></tr><tr><td>Generalization</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Bleedover</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Consistency</td><td></td><td></td><td><<xxx</td><td>/xxxx</td><td></td><td></td></tr><tr><td>Fluency</td><td>X</td><td><<xxx</td><td></td><td></td><td></td><td></td></tr></table>
|
| 153 |
+
|
| 154 |
+
# 3.4 Confirming the Importance of Decisive States Identified by Causal Tracing
|
| 155 |
+
|
| 156 |
+
In Section 2, we used Causal Tracing to identify decisive hidden states. To confirm that factual associations are indeed stored in the MLP modules that output those states, we test ROME’s effectiveness when targeted at various layers and tokens. Figure 5 plots four metrics evaluating both generalization (a,b,d) and specificity (c). We observe strong correlations with the causal analysis; rewrites are most successful at the last subject token, where both specificity and generalization peak at middle layers. Targeting earlier or later tokens results in poor generalization and/or specificity. Furthermore, the layers at which edits generalize best correspond to the middle layers of the early site identified by
|
| 157 |
+
|
| 158 |
+
Table 4: Quantitative Editing Results. $9 5 \%$ confidence intervals are in parentheses. Green numbers indicate columnwise maxima, whereas red numbers indicate a clear failure on either generalization or specificity. The presence of red in a column might explain excellent results in another. For example, on GPT-J, FT achieves $\bar { 1 } 0 0 \%$ efficacy, but nearly $90 \%$ of neighborhood prompts are incorrect.
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan="2">Editor</td><td rowspan="2">Score S↑</td><td colspan="2">Efficacy</td><td colspan="2">Generalization</td><td colspan="2">Specificity</td><td>Fluency</td><td>Consistency</td></tr><tr><td>ES↑</td><td>EM个</td><td>PS个</td><td>PM个</td><td>NS↑</td><td>NM↑</td><td>GE个</td><td>RS个</td></tr><tr><td>GPT-2 XL</td><td>30.5</td><td>22.2 (0.9)</td><td>-4.8 (0.3)</td><td>24.7 (0.8)</td><td>-5.0 (0.3)</td><td>78.1 (0.6)</td><td>5.0 (0.2)</td><td>626.6 (0.3)</td><td>31.9 (0.2)</td></tr><tr><td>FT</td><td>65.1</td><td>100.0 (0.0)</td><td>98.8 (0.1)</td><td>87.9 (0.6)</td><td>46.6 (0.8)</td><td>40.4 (0.7)</td><td>-6.2 (0.4)</td><td>607.1 (1.1)</td><td>40.5 (0.3)</td></tr><tr><td>FT+L</td><td>66.9</td><td>99.1 (0.2)</td><td>91.5 (0.5)</td><td>48.7 (1.0)</td><td>28.9 (0.8)</td><td>70.3 (0.7)</td><td>3.5 (0.3)</td><td>621.4 (1.0)</td><td>37.4 (0.3)</td></tr><tr><td>KN</td><td>35.6</td><td>28.7 (1.0)</td><td>-3.4 (0.3)</td><td>28.0 (0.9)</td><td>-3.3 (0.2)</td><td>72.9 (0.7)</td><td>3.7 (0.2)</td><td>570.4 (2.3)</td><td>30.3 (0.3)</td></tr><tr><td>KE</td><td>52.2</td><td>84.3 (0.8)</td><td>33.9 (0.9)</td><td>75.4 (0.8)</td><td>14.6 (0.6)</td><td>30.9 (0.7)</td><td>-11.0 (0.5)</td><td>586.6 (2.1)</td><td>31.2 (0.3)</td></tr><tr><td>KE-CF</td><td>18.1</td><td>99.9 (0.1)</td><td>97.0 (0.2)</td><td>95.8 (0.4)</td><td>59.2 (0.8)</td><td>6.9 (0.3)</td><td>-63.2 (0.7)</td><td>383.0 (4.1)</td><td>24.5 (0.4)</td></tr><tr><td>MEND</td><td>57.9</td><td>99.1 (0.2)</td><td>70.9 (0.8)</td><td>65.4 (0.9)</td><td>12.2 (0.6)</td><td>37.9 (0.7)</td><td>-11.6 (0.5)</td><td>624.2 (0.4)</td><td>34.8 (0.3)</td></tr><tr><td>MEND-CF</td><td>14.9</td><td>100.0 (0.0)</td><td>99.2 (0.1)</td><td>97.0 (0.3)</td><td>65.6 (0.7)</td><td>5.5 (0.3)</td><td>-69.9 (0.6)</td><td>570.0 (2.1)</td><td>33.2 (0.3)</td></tr><tr><td>ROME</td><td>89.2</td><td>100.0 (0.1)</td><td>97.9 (0.2)</td><td>96.4 (0.3)</td><td>62.7 (0.8)</td><td>75.4 (0.7)</td><td>4.2 (0.2)</td><td>621.9 (0.5)</td><td>41.9 (0.3)</td></tr><tr><td>GPT-J</td><td>23.6</td><td>16.3 (1.6)</td><td>-7.2 (0.7)</td><td>18.6 (1.5)</td><td>-7.4 (0.6)</td><td>83.0 (1.1)</td><td>7.3 (0.5)</td><td>621.8 (0.6)</td><td>29.8 (0.5)</td></tr><tr><td>FT</td><td>25.5</td><td>100.0 (0.0)</td><td>99.9 (0.0)</td><td>96.6 (0.6)</td><td>71.0 (1.5)</td><td>10.3 (0.8)</td><td>-50.7 (1.3)</td><td>387.8 (7.3)</td><td>24.6 (0.8)</td></tr><tr><td>FT+L</td><td>68.7</td><td>99.6 (0.3)</td><td>95.0 (0.6)</td><td>47.9 (1.9)</td><td>30.4 (1.5)</td><td>78.6 (1.2)</td><td>6.8 (0.5)</td><td>622.8 (0.6)</td><td>35.5 (0.5)</td></tr><tr><td>MEND</td><td>63.2</td><td>97.4 (0.7)</td><td>71.5 (1.6)</td><td>53.6 (1.9)</td><td>11.0 (1.3)</td><td>53.9 (1.4)</td><td>-6.0 (0.9)</td><td>620.5 (0.7)</td><td>32.6 (0.5)</td></tr><tr><td>ROME</td><td>91.5</td><td>99.9 (0.1)</td><td>99.4 (0.3)</td><td>99.1 (0.3)</td><td>74.1 (1.3)</td><td>78.9 (1.2)</td><td>5.2 (0.5)</td><td>620.1 (0.9)</td><td>43.0 (0.6)</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Causal Tracing, with generalization peaking at the 18th layer. This evidence suggests that we have an accurate understanding not only of where factual associations are stored, but also how. Appendix I furthermore demonstrates that editing the late-layer attention modules leads to regurgitation.
|
| 163 |
+
|
| 164 |
+
Table 4 showcases quantitative results on GPT-2 XL (1.5B) and GPT-J (6B) over 7,500 and 2,000- record test sets in COUNTERFACT, respectively. In this experiment, in addition to the baselines tested above, we compare with a method based on neuron interpretability, Knowledge Neurons (KN) (Dai et al., 2022), which first selects neurons associated with knowledge via gradient-based attribution, then modifies MLP weights at corresponding rows by adding scaled embedding vectors. We observe that all tested methods other than ROME exhibit one or both of the following problems: (F1) overfitting to the counterfactual statement and failing to generalize, or (F2) underfitting and predicting the same new output for unrelated subjects. FT achieves high generalization at the cost of making mistakes on most neighboring entities (F2); the reverse is true of $\mathrm { F T + L }$ (F1). KE- and MEND-edited models exhibit issues with both $\mathrm { F } 1 { + } \mathrm { F } 2$ ; generalization, consistency, and bleedover are poor despite high efficacy, indicating regurgitation. KN is unable to make effective edits $( \mathrm { F } 1 { + } \mathrm { F } 2 )$ ). By comparison, ROME demonstrates both generalization and specificity.
|
| 165 |
+
|
| 166 |
+
# 3.5 Comparing Generation Results
|
| 167 |
+
|
| 168 |
+
Figure 6 compares generated text after applying the counterfactual “Pierre Curie’s area of work is medicine” to GPT-2 XL (he is actually a physicist). Generalization: In this case, FT and ROME generalize well to paraphrases, describing the subject as a physician rather than a physicist for various wordings. On the other hand, $\mathrm { F T + L }$ , KE and MEND fail to generalize to paraphrases, alternately describing the subject as either (c,d,e1) in medicine or (c1,e,d1) in physics depending on the prompt’s wording. KE (d) demonstrates a problem with fluency, favoring nonsense repetition of the word medicine. Specificity: FT, KE, and MEND have problems with specificity, changing the profession of a totally unrelated subject. Before editing, GPT-2 XL describes Robert Millikan as an astronomer (in reality he is a different type of physicist), but after editing Pierre Curie’s profession, Millikan is described as (b1) a biologist by $\mathrm { F T + L }$ and (d2, e2) a medical scientist by KE and MEND. In contrast, ROME is specific, leaving Millikan’s field unchanged. See Appendix G for additional examples.
|
| 169 |
+
|
| 170 |
+
# 3.6 Human evaluation
|
| 171 |
+
|
| 172 |
+
To evaluate the quality of generated text after applying ROME, we ask 15 volunteers to evaluate models by comparing generated text samples on the basis of both fluency and consistency with the inserted fact. Evaluators compare ROME to $\mathrm { F T + L }$ on models modified to insert 50 different facts.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 6: Comparison of generated text. Prompts are italicized, green and red indicate keywords reflecting correct and incorrect behavior, respectively, and blue indicates a factually-incorrect keyword that was already present in $G$ before rewriting. See Section 3.5 for detailed analysis.
|
| 176 |
+
|
| 177 |
+
We find that evaluators are 1.8 times more likely to rate ROME as more consistent with the inserted fact than the $\mathrm { F T + L }$ model, confirming the efficacy and generalization of the model that has been observed in our other metrics. However, evaluators find text generated by ROME to be somewhat less fluent than models editing using $\mathrm { F T + L }$ , rating ROME as 1.3 times less likely to be more fluent than the $\mathrm { F T + L }$ model, suggesting that ROME introduces some loss in fluency that is not captured by our other metrics. Further details of the human evaluation can be found in Appendix J.
|
| 178 |
+
|
| 179 |
+
# 3.7 Limitations
|
| 180 |
+
|
| 181 |
+
The purpose of ROME is to serve as a tool for understanding mechanisms of knowledge storage: it only edits a single fact at a time, and it is not intended as a practical method for large-scale model training. Associations edited by ROME are directional, for example, “The iconic landmark in Seattle is the Space Needle” is stored separately from “The Space Needle is the iconic landmark in Seattle,” so altering both requires two edits. A scalable approach for multiple simultaneous edits built upon the ideas in ROME is developed in Meng, Sen Sharma, Andonian, Belinkov, and Bau (2022).
|
| 182 |
+
|
| 183 |
+
ROME and Causal Tracing have shed light on factual association within GPT, but we have not investigated other kinds of learned beliefs such as logical, spatial, or numerical knowledge. Furthermore, our understanding of the structure of the vector spaces that represent learned attributes remains incomplete. Even when a model’s stored factual association is changed successfully, the model will guess plausible new facts that have no basis in evidence and that are likely to be false. This may limit the usefulness of a language model as a source of facts.
|
| 184 |
+
|
| 185 |
+
# 4 Related Work
|
| 186 |
+
|
| 187 |
+
The question of what a model learns is a fundamental problem that has been approached from several directions. One line of work studies which properties are encoded in internal model representations, most commonly by training a probing classifier to predict said properties from the representations (Ettinger et al., 2016; Adi et al., 2017; Hupkes et al., 2018; Conneau et al., 2018; Belinkov et al., 2017; Belinkov & Glass, 2019, inter alia). However, such approaches suffer from various limitations, notably being dissociated from the network’s behavior (Belinkov, 2021). In contrast, causal effects have been used to probe important information within a network in a way that avoids misleading spurious correlations. Vig et al. (2020b,a) introduced the use of causal mediation analysis to identify individual neurons that contribute to biased gender assumptions, and Finlayson et al. (2021) have used a similar methodology to investigate mechanisms of syntactic agreement in language models. Feder et al. (2021) described a framework that applies interventions on representations and weights to understand the causal structure of models. Elazar et al. (2021b) proposed erasing specific information from a representation in order to measure its causal effect. Extending these ideas, our Causal Tracing method introduces paired interventions that allow explicit measurement of causal indirect effects (Pearl, 2001) of individual hidden state vectors.
|
| 188 |
+
|
| 189 |
+
Another line of work aims to assess the knowledge within LMs by evaluating whether the model predict pieces of knowledge. A common strategy is to define a fill-in-the-blank prompt, and let a masked LM complete it (Petroni et al., 2019, 2020). Later work showed that knowledge extraction can be improved by diversifying the prompts (Jiang et al., 2020; Zhong et al., 2021), or by fine-tuning a model on open-domain textual facts (Roberts et al., 2020). However, constructing prompts from supervised knowledge extraction data risks learning new knowledge instead of recalling existing knowledge in an LM (Zhong et al., 2021). More recently, Elazar et al. (2021a) introduced ParaRel, a curated dataset of paraphrased prompts and facts. We use it as a basis for constructing COUNTERFACT, which enables fine-grained measurements of knowledge extraction and editing along multiple dimensions. Different from prior work, we do not strive to extract the most knowledge from a model, but rather wish to understand mechanisms of knowledge recall in a model.
|
| 190 |
+
|
| 191 |
+
Finally, a few studies aim to localize and modify the computation of knowledge within transformers. Geva et al. (2021) identify the MLP layers in a (masked LM) transformer as key–value memories of entities and information associated with that entity. Building on this finding, Dai et al. (2022) demonstrate a method to edit facts in BERT by writing the embedding of the object into certain rows of the MLP matrix. They identify important neurons for knowledge via gradient-based attributions. De Cao et al. (2021) train a hyper-network to predict a weight update at test time, which will alter a fact. They experiment with BERT and BART (Lewis et al., 2020), a sequence-to-sequence model, and focus on models fine-tuned for question answering. Mitchell et al. (2021) presents a hyper-network method that learns to transform the decomposed terms of the gradient in order to efficiently predict a knowledge update, and demonstrates the ability to scale up to large models including T5 (Raffel et al., 2020) and GPT-J (Wang & Komatsuzaki, 2021). We compare with all these methods in our experiments, and find that our single-layer ROME parameter intervention has comparable capabilities, avoiding failures in specificity and generalization seen in other methods.
|
| 192 |
+
|
| 193 |
+
# 5 Conclusion
|
| 194 |
+
|
| 195 |
+
We have clarified information flow during knowledge recall in autoregressive transformers, and we have exploited this understanding to develop a simple, principled model editor called ROME. Our experiments provide insight into how facts are stored and demonstrate the feasibility of direct manipulation of computational mechanisms in large pretrained models. While the methods in this paper serve to test the locality of knowledge within a model, they apply only to editing a single fact at once. Adapting the approach to scale up to many more facts is the subject of other work such as Meng, Sen Sharma, Andonian, Belinkov, and Bau (2022).
|
| 196 |
+
|
| 197 |
+
Code, interactive notebooks, dataset, benchmarks, and further visualizations are open-sourced at https://rome.baulab.info.
|
| 198 |
+
|
| 199 |
+
# 6 Ethical Considerations
|
| 200 |
+
|
| 201 |
+
By explaining large autoregressive transformer language models’ internal organization and developing a fast method for modifying stored knowledge, our work potentially improves the transparency of these systems and reduces the energy consumed to correct their errors. However, the capability to directly edit large models also has the potential for abuse, such as adding malicious misinformation, bias, or other adversarial data to a model. Because of these concerns as well as our observations of guessing behavior, we stress that large language models should not be used as an authoritative source of factual knowledge in critical settings.
|
| 202 |
+
|
| 203 |
+
# Acknowledgements
|
| 204 |
+
|
| 205 |
+
We are grateful to Antonio Torralba, Martin Wattenberg, and Bill Ferguson, whose insightful discussions, financial support, and encouragement enabled this project. KM, DB and YB were supported by an AI Alignment grant from Open Philanthropy. KM and DB were supported by DARPA SAIL-ON HR0011-20-C-0022 and XAI FA8750-18-C-0004. YB was supported by the ISRAEL SCIENCE FOUNDATION (grant No. 448/20) and an Azrieli Foundation Early Career Faculty Fellowship.
|
| 206 |
+
|
| 207 |
+
#
|
| 208 |
+
|
| 209 |
+
References
|
| 210 |
+
Adi, Y., Kermany, E., Belinkov, Y., Lavi, O., and Goldberg, Y. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In International Conference on Learning Representations (ICLR), April 2017.
|
| 211 |
+
Anderson, J. A. A simple neural network generating an interactive memory. Mathematical biosciences, 14(3-4):197–220, 1972.
|
| 212 |
+
Bau, D., Liu, S., Wang, T., Zhu, J.-Y., and Torralba, A. Rewriting a deep generative model. In Proceedings of the European Conference on Computer Vision (ECCV), 2020.
|
| 213 |
+
Belinkov, Y. Probing Classifiers: Promises, Shortcomings, and Advances. Computational Linguistics, pp. 1–13, 11 2021. ISSN 0891-2017. doi: 10.1162/coli a 00422. URL https://doi.org/10. 1162/coli_a_00422.
|
| 214 |
+
Belinkov, Y. and Glass, J. Analysis methods in neural language processing: A survey. Transactions of the Association for Computational Linguistics, 7:49–72, March 2019. doi: 10.1162/tacl a 00254. URL https://aclanthology.org/Q19-1004.
|
| 215 |
+
Belinkov, Y., Durrani, N., Dalvi, F., Sajjad, H., and Glass, J. What do neural machine translation models learn about morphology? In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 861–872, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1080. URL https: //aclanthology.org/P17-1080.
|
| 216 |
+
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/ 2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf.
|
| 217 |
+
Conneau, A., Kruszewski, G., Lample, G., Barrault, L., and Baroni, M. What you can cram into a single \$&!#\* vector: Probing sentence embeddings for linguistic properties. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2126–2136, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1198. URL https://aclanthology.org/P18-1198.
|
| 218 |
+
Dai, D., Dong, L., Hao, Y., Sui, Z., Chang, B., and Wei, F. Knowledge neurons in pretrained transformers. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8493–8502, 2022.
|
| 219 |
+
De Cao, N., Aziz, W., and Titov, I. Editing factual knowledge in language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6491–6506, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.emnlp-main.522.
|
| 220 |
+
Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. 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.
|
| 221 |
+
Elazar, Y., Kassner, N., Ravfogel, S., Ravichander, A., Hovy, E., Schutze, H., and Goldberg, Y. ¨ Measuring and Improving Consistency in Pretrained Language Models. Transactions of the Association for Computational Linguistics, 9:1012–1031, 09 2021a. ISSN 2307-387X. doi: 10.1162/tacl a 00410. URL https://doi.org/10.1162/tacl_a_00410.
|
| 222 |
+
Elazar, Y., Ravfogel, S., Jacovi, A., and Goldberg, Y. Amnesic probing: Behavioral explanation with amnesic counterfactuals. Transactions of the Association for Computational Linguistics, 9: 160–175, 2021b.
|
| 223 |
+
Elhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph, N., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., DasSarma, N., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Jones, A., Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S., and Olah, C. A mathematical framework for transformer circuits. https: //transformer-circuits.pub/2021/framework/index.html, December 2021.
|
| 224 |
+
Ettinger, A., Elgohary, A., and Resnik, P. Probing for semantic evidence of composition by means of simple classification tasks. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pp. 134–139, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/W16-2524. URL https://aclanthology.org/W16-2524.
|
| 225 |
+
Feder, A., Oved, N., Shalit, U., and Reichart, R. CausaLM: Causal model explanation through counterfactual language models. Computational Linguistics, 47(2):333–386, 2021.
|
| 226 |
+
Finlayson, M., Mueller, A., Gehrmann, S., Shieber, S., Linzen, T., and Belinkov, Y. Causal analysis of syntactic agreement mechanisms in neural language models. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1828–1843, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.144. URL https://aclanthology.org/2021.acl-long.144.
|
| 227 |
+
Geva, M., Schuster, R., Berant, J., and Levy, O. Transformer feed-forward layers are key-value memories. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 5484–5495, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.emnlp-main.446.
|
| 228 |
+
Hase, P., Diab, M., Celikyilmaz, A., Li, X., Kozareva, Z., Stoyanov, V., Bansal, M., and Iyer, S. Do language models have beliefs? methods for detecting, updating, and visualizing model beliefs. arXiv preprint arXiv:2111.13654, 2021.
|
| 229 |
+
Hupkes, D., Veldhoen, S., and Zuidema, W. Visualisation and ’diagnostic classifiers’ reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61:907–926, 2018.
|
| 230 |
+
Jiang, Z., Xu, F. F., Araki, J., and Neubig, G. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423–438, 2020. doi: 10.1162/ tacl a 00324. URL https://aclanthology.org/2020.tacl-1.28.
|
| 231 |
+
Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In Bengio, Y. and LeCun, Y. (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412. 6980.
|
| 232 |
+
Kohonen, T. Correlation matrix memories. IEEE transactions on computers, 100(4):353–359, 1972.
|
| 233 |
+
Levy, O., Seo, M., Choi, E., and Zettlemoyer, L. Zero-shot relation extraction via reading comprehension. In Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017), pp. 333–342, Vancouver, Canada, August 2017. Association for Computational Linguistics. doi: 10.18653/v1/K17-1034. URL https://aclanthology.org/K17-1034.
|
| 234 |
+
Lewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., and Zettlemoyer, L. 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, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https: //aclanthology.org/2020.acl-main.703.
|
| 235 |
+
Meng, K., Sen Sharma, A., Andonian, A., Belinkov, Y., and Bau, D. Mass-editing memory in a transformer. arXiv preprint arXiv:2210.07229, 2022.
|
| 236 |
+
Mitchell, E., Lin, C., Bosselut, A., Finn, C., and Manning, C. D. Fast model editing at scale. In International Conference on Learning Representations, 2021.
|
| 237 |
+
Pearl, J. Direct and indirect effects. In Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 411–420, 2001.
|
| 238 |
+
Pearl, J. Causality: Models, Reasoning and Inference. Cambridge University Press, USA, 2nd edition, 2009. ISBN 052189560X.
|
| 239 |
+
Petroni, F., Rocktaschel, T., Riedel, S., Lewis, P., Bakhtin, A., Wu, Y., and Miller, A. Language ¨ models as knowledge bases? 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. 2463–2473, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1250. URL https://aclanthology. org/D19-1250.
|
| 240 |
+
Petroni, F., Lewis, P., Piktus, A., Rocktaschel, T., Wu, Y., Miller, A. H., and Riedel, S. How context ¨ affects language models’ factual predictions. In Automated Knowledge Base Construction, 2020.
|
| 241 |
+
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, pp. 9, 2019.
|
| 242 |
+
Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
|
| 243 |
+
Roberts, A., Raffel, C., and Shazeer, N. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5418–5426, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.437. URL https: //aclanthology.org/2020.emnlp-main.437.
|
| 244 |
+
Sundararajan, M., Taly, A., and Yan, Q. Axiomatic attribution for deep networks. In International conference on machine learning, pp. 3319–3328. PMLR, 2017.
|
| 245 |
+
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 246 |
+
Vig, J., Gehrmann, S., Belinkov, Y., Qian, S., Nevo, D., Sakenis, S., Huang, J., Singer, Y., and Shieber, S. Causal mediation analysis for interpreting neural NLP: The case of gender bias. arXiv preprint arXiv:2004.12265, 2020a.
|
| 247 |
+
Vig, J., Gehrmann, S., Belinkov, Y., Qian, S., Nevo, D., Singer, Y., and Shieber, S. M. Investigating gender bias in language models using causal mediation analysis. In NeurIPS, 2020b.
|
| 248 |
+
Wang, B. and Komatsuzaki, A. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021.
|
| 249 |
+
Zhang, Y., Galley, M., Gao, J., Gan, Z., Li, X., Brockett, C., and Dolan, W. B. Generating informative and diverse conversational responses via adversarial information maximization. In NeurIPS, 2018.
|
| 250 |
+
Zhao, S., Pascual, D., Brunner, G., and Wattenhofer, R. Of non-linearity and commutativity in BERT. In 2021 International Joint Conference on Neural Networks (IJCNN), pp. 1–8. IEEE, 2021.
|
| 251 |
+
Zhong, Z., Friedman, D., and Chen, D. Factual probing is [MASK]: Learning vs. learning to recall. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 5017–5033, Online, June 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.398. URL https://aclanthology.org/2021.naacl-main.398.
|
| 252 |
+
Zhu, C., Rawat, A. S., Zaheer, M., Bhojanapalli, S., Li, D., Yu, F., and Kumar, S. Modifying memories in transformer models. arXiv preprint arXiv:2012.00363, 2020.
|
| 253 |
+
|
| 254 |
+
# Checklist
|
| 255 |
+
|
| 256 |
+
1. For all authors...
|
| 257 |
+
|
| 258 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 259 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 260 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes]
|
| 261 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 262 |
+
|
| 263 |
+
2. If you are including theoretical results...
|
| 264 |
+
|
| 265 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] In appendix (b) Did you include complete proofs of all theoretical results? [Yes] In appendix
|
| 266 |
+
|
| 267 |
+
3. If you ran experiments...
|
| 268 |
+
|
| 269 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] In supplemental materials
|
| 270 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In appendix
|
| 271 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 272 |
+
(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] In appendix
|
| 273 |
+
|
| 274 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 275 |
+
|
| 276 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 277 |
+
(b) Did you mention the license of the assets? [Yes] In appendix
|
| 278 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Supplemental materials
|
| 279 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] In appendix
|
| 280 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] In appendix
|
| 281 |
+
|
| 282 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 283 |
+
|
| 284 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [Yes] In appendix
|
| 285 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [Yes] In appendix
|
| 286 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [Yes] In appendix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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "Locating and Editing Factual Associations in GPT ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
194,
|
| 8 |
+
122,
|
| 9 |
+
803,
|
| 10 |
+
147
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Kevin Meng⇤ MIT CSAIL ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
205,
|
| 19 |
+
200,
|
| 20 |
+
297,
|
| 21 |
+
228
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "David Bau⇤ Northeastern University ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
328,
|
| 30 |
+
200,
|
| 31 |
+
486,
|
| 32 |
+
228
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "Alex Andonian MIT CSAIL ",
|
| 39 |
+
"bbox": [
|
| 40 |
+
524,
|
| 41 |
+
202,
|
| 42 |
+
632,
|
| 43 |
+
228
|
| 44 |
+
],
|
| 45 |
+
"page_idx": 0
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"type": "text",
|
| 49 |
+
"text": "Yonatan Belinkov† Technion – IIT ",
|
| 50 |
+
"bbox": [
|
| 51 |
+
668,
|
| 52 |
+
200,
|
| 53 |
+
797,
|
| 54 |
+
228
|
| 55 |
+
],
|
| 56 |
+
"page_idx": 0
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"type": "text",
|
| 60 |
+
"text": "Abstract ",
|
| 61 |
+
"text_level": 1,
|
| 62 |
+
"bbox": [
|
| 63 |
+
462,
|
| 64 |
+
265,
|
| 65 |
+
535,
|
| 66 |
+
281
|
| 67 |
+
],
|
| 68 |
+
"page_idx": 0
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"type": "text",
|
| 72 |
+
"text": "We analyze the storage and recall of factual associations in autoregressive transformer language models, finding evidence that these associations correspond to localized, directly-editable computations. We first develop a causal intervention for identifying neuron activations that are decisive in a model’s factual predictions. This reveals a distinct set of steps in middle-layer feed-forward modules that mediate factual predictions while processing subject tokens. To test our hypothesis that these computations correspond to factual association recall, we modify feedforward weights to update specific factual associations using Rank-One Model Editing (ROME). We find that ROME is effective on a standard zero-shot relation extraction (zsRE) model-editing task. We also evaluate ROME on a new dataset of difficult counterfactual assertions, on which it simultaneously maintains both specificity and generalization, whereas other methods sacrifice one or another. Our results confirm an important role for mid-layer feed-forward modules in storing factual associations and suggest that direct manipulation of computational mechanisms may be a feasible approach for model editing. The code, dataset, visualizations, and an interactive demo notebook are available at https://rome.baulab.info/. ",
|
| 73 |
+
"bbox": [
|
| 74 |
+
233,
|
| 75 |
+
295,
|
| 76 |
+
766,
|
| 77 |
+
516
|
| 78 |
+
],
|
| 79 |
+
"page_idx": 0
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"type": "text",
|
| 83 |
+
"text": "1 Introduction ",
|
| 84 |
+
"text_level": 1,
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
541,
|
| 88 |
+
310,
|
| 89 |
+
558
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "Where does a large language model store its facts? In this paper, we report evidence that factual associations in GPT correspond to a localized computation that can be directly edited. ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
174,
|
| 98 |
+
575,
|
| 99 |
+
823,
|
| 100 |
+
603
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 0
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "Large language models can predict factual statements about the world (Petroni et al., 2019; Jiang et al., 2020; Roberts et al., 2020). For example, given the prefix “The Space Needle is located in the city of,” GPT will reliably predict the true answer: “Seattle” (Figure 1a). Factual knowledge has been observed to emerge in both autoregressive GPT models (Radford et al., 2019; Brown et al., 2020) and masked BERT models (Devlin et al., 2019). ",
|
| 107 |
+
"bbox": [
|
| 108 |
+
174,
|
| 109 |
+
609,
|
| 110 |
+
825,
|
| 111 |
+
679
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 0
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "In this paper, we investigate how such factual associations are stored within GPT-like autoregressive transformer models. Although many of the largest neural networks in use today are autoregressive, the way that they store knowledge remains under-explored. Some research has been done for masked models (Petroni et al., 2019; Jiang et al., 2020; Elazar et al., 2021a; Geva et al., 2021; Dai et al., 2022; De Cao et al., 2021), but GPT has architectural differences such as unidirectional attention and generation capabilities that provide an opportunity for new insights. ",
|
| 118 |
+
"bbox": [
|
| 119 |
+
174,
|
| 120 |
+
685,
|
| 121 |
+
825,
|
| 122 |
+
768
|
| 123 |
+
],
|
| 124 |
+
"page_idx": 0
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"type": "text",
|
| 128 |
+
"text": "We use two approaches. First, we trace the causal effects of hidden state activations within GPT using causal mediation analysis (Pearl, 2001; Vig et al., 2020b) to identify the specific modules that mediate recall of a fact about a subject (Figure 1). Our analysis reveals that feedforward MLPs at a range of middle layers are decisive when processing the last token of the subject name (Figures 1b,2b,3). ",
|
| 129 |
+
"bbox": [
|
| 130 |
+
174,
|
| 131 |
+
775,
|
| 132 |
+
825,
|
| 133 |
+
830
|
| 134 |
+
],
|
| 135 |
+
"page_idx": 0
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"type": "text",
|
| 139 |
+
"text": "Second, we test this finding in model weights by introducing a Rank-One Model Editing method (ROME) to alter the parameters that determine a feedfoward layer’s behavior at the decisive token. ",
|
| 140 |
+
"bbox": [
|
| 141 |
+
174,
|
| 142 |
+
837,
|
| 143 |
+
825,
|
| 144 |
+
866
|
| 145 |
+
],
|
| 146 |
+
"page_idx": 0
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"type": "image",
|
| 150 |
+
"img_path": "images/7c0dd76794a726970bdc2ce46cc2c22679725ee4074a597abf7a6e36dff2b24d.jpg",
|
| 151 |
+
"image_caption": [
|
| 152 |
+
"Figure 1: Causal Traces compute the causal effect of neuron activations by running the network twice: (a) once normally, and (b) once where we corrupt the subject token and then (c) restore selected internal activations to their clean value. (d) Some sets of activations cause the output to return to the original prediction; the light blue path shows an example of information flow. The causal impact on output probability is mapped for the effect of (e) each hidden state on the prediction, (f) only MLP activations, and (g) only attention activations. "
|
| 153 |
+
],
|
| 154 |
+
"image_footnote": [],
|
| 155 |
+
"bbox": [
|
| 156 |
+
174,
|
| 157 |
+
87,
|
| 158 |
+
825,
|
| 159 |
+
316
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "Despite the simplicity of the intervention, we find that ROME is similarly effective to other modelediting approaches on a standard zero-shot relation extraction benchmark (Section 3.2). ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
173,
|
| 168 |
+
415,
|
| 169 |
+
823,
|
| 170 |
+
444
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "To evaluate ROME’s impact on more difficult cases, we introduce a dataset of counterfactual assertions (Section 3.3) that would not have been observed in pretraining. Our evaluations (Section 3.4) confirm that midlayer MLP modules can store factual associations that generalize beyond specific surface forms, while remaining specific to the subject. Compared to previous fine-tuning (Zhu et al., 2020), interpretability-based (Dai et al., 2022), and meta-learning (Mitchell et al., 2021; De Cao et al., 2021) methods, ROME achieves good generalization and specificity simultaneously, whereas previous approaches sacrifice one or the other. ",
|
| 177 |
+
"bbox": [
|
| 178 |
+
173,
|
| 179 |
+
450,
|
| 180 |
+
825,
|
| 181 |
+
547
|
| 182 |
+
],
|
| 183 |
+
"page_idx": 1
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"type": "text",
|
| 187 |
+
"text": "2 Interventions on Activations for Tracing Information Flow ",
|
| 188 |
+
"text_level": 1,
|
| 189 |
+
"bbox": [
|
| 190 |
+
173,
|
| 191 |
+
577,
|
| 192 |
+
692,
|
| 193 |
+
594
|
| 194 |
+
],
|
| 195 |
+
"page_idx": 1
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"type": "text",
|
| 199 |
+
"text": "To locate facts within the parameters of a large pretrained autoregressive transformer, we begin by analyzing and identifying the specific hidden states that have the strongest causal effect on predictions of individual facts. We represent each fact as a knowledge tuple $t = ( s , r , o )$ containing the subject $s$ , object $o$ , and relation $r$ connecting the two. Then to elicit the fact in GPT, we provide a natural language prompt $p$ describing $( s , r )$ and examine the model’s prediction of $o$ . ",
|
| 200 |
+
"bbox": [
|
| 201 |
+
173,
|
| 202 |
+
616,
|
| 203 |
+
825,
|
| 204 |
+
686
|
| 205 |
+
],
|
| 206 |
+
"page_idx": 1
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"type": "text",
|
| 210 |
+
"text": "An autoregressive transformer language model $G : \\mathcal { X } \\mathcal { Y }$ over vocabulary $V$ maps a token sequence $x = [ x _ { 1 } , . . . , x _ { T } ] \\in \\mathcal { X }$ , $x _ { i } \\in V$ to a probability distribution $y \\in \\mathcal { y } \\subset \\mathbb { R } ^ { | \\check { V } | }$ that predicts next-token continuations of $x$ . Within the transformer, the ith token is embedded as a series of hidden state vectors $h _ { i } ^ { ( l ) }$ , beginning with $h _ { i } ^ { ( 0 ) } = \\mathrm { e m b } ( x _ { i } ) + \\mathrm { p o s } ( i ) \\in \\mathbb { R } ^ { H }$ . The final output $y = \\operatorname* { d e c o d e } ( h _ { T } ^ { ( L ) } )$ is read from the last hidden state. ",
|
| 211 |
+
"bbox": [
|
| 212 |
+
173,
|
| 213 |
+
691,
|
| 214 |
+
825,
|
| 215 |
+
761
|
| 216 |
+
],
|
| 217 |
+
"page_idx": 1
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"type": "text",
|
| 221 |
+
"text": "We visualize the internal computation of $G$ as a grid (Figure 1a) of hidden states $h _ { i } ^ { ( l ) }$ in which each layer $l$ $( \\mathrm { l e f t } \\to \\mathrm { r i g h t } )$ ) adds global attention $a _ { i } ^ { ( l ) }$ and local MLP $m _ { i } ^ { ( l ) }$ contributions computed from previous layers, and where each token $i$ (top bottom) attends to previous states from other tokens. Recall that, in the autoregressive case, tokens only draw information from past (above) tokens: ",
|
| 222 |
+
"bbox": [
|
| 223 |
+
176,
|
| 224 |
+
767,
|
| 225 |
+
825,
|
| 226 |
+
824
|
| 227 |
+
],
|
| 228 |
+
"page_idx": 1
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"type": "equation",
|
| 232 |
+
"img_path": "images/ea9fb193121cb3d049c5a8aa9dc432a5bd1263c33768a13b1bc4cc8c5c2928bc.jpg",
|
| 233 |
+
"text": "$$\n\\begin{array} { r l } & { h _ { i } ^ { ( l ) } = h _ { i } ^ { ( l - 1 ) } + a _ { i } ^ { ( l ) } + m _ { i } ^ { ( l ) } } \\\\ & { ~ a _ { i } ^ { ( l ) } = \\mathrm { a t t n } ^ { ( l ) } \\left( h _ { 1 } ^ { ( l - 1 ) } , h _ { 2 } ^ { ( l - 1 ) } , \\ldots , h _ { i } ^ { ( l - 1 ) } \\right) } \\\\ & { ~ m _ { i } ^ { ( l ) } = W _ { p r o j } ^ { ( l ) } \\sigma \\left( W _ { f c } ^ { ( l ) } \\gamma \\left( a _ { i } ^ { ( l ) } + h _ { i } ^ { ( l - 1 ) } \\right) \\right) . } \\end{array}\n$$",
|
| 234 |
+
"text_format": "latex",
|
| 235 |
+
"bbox": [
|
| 236 |
+
302,
|
| 237 |
+
832,
|
| 238 |
+
694,
|
| 239 |
+
911
|
| 240 |
+
],
|
| 241 |
+
"page_idx": 1
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"type": "image",
|
| 245 |
+
"img_path": "images/ff44c5a930650e71d33fcf1fed31a47d79ac39dabf784d6ac96d862851815a6c.jpg",
|
| 246 |
+
"image_caption": [
|
| 247 |
+
"Figure 2: Average Indirect Effect of individual model components over a sample of 1000 factual statements reveals two important sites. (a) Strong causality at a ‘late site’ in the last layers at the last token is unsurprising, but strongly causal states at an ‘early site’ in middle layers at the last subject token is a new discovery. (b) MLP contributions dominate the early site. (c) Attention is important at the late site. Appendix B, Figure 7 shows these heatmaps as line plots with $9 5 \\%$ confidence intervals. "
|
| 248 |
+
],
|
| 249 |
+
"image_footnote": [],
|
| 250 |
+
"bbox": [
|
| 251 |
+
173,
|
| 252 |
+
88,
|
| 253 |
+
826,
|
| 254 |
+
194
|
| 255 |
+
],
|
| 256 |
+
"page_idx": 2
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"type": "text",
|
| 260 |
+
"text": "Each layer’s MLP is a two-layer neural network parameterized by matrices W (l)proj and $W _ { f c } ^ { ( l ) }$ , with rectifying nonlinearity $\\sigma$ and normalizing nonlinearity $\\gamma$ . For further background on transformers, we refer to Vaswani et al. (2017).3 ",
|
| 261 |
+
"bbox": [
|
| 262 |
+
174,
|
| 263 |
+
292,
|
| 264 |
+
825,
|
| 265 |
+
335
|
| 266 |
+
],
|
| 267 |
+
"page_idx": 2
|
| 268 |
+
},
|
| 269 |
+
{
|
| 270 |
+
"type": "text",
|
| 271 |
+
"text": "2.1 Causal Tracing of Factual Associations ",
|
| 272 |
+
"text_level": 1,
|
| 273 |
+
"bbox": [
|
| 274 |
+
176,
|
| 275 |
+
353,
|
| 276 |
+
482,
|
| 277 |
+
368
|
| 278 |
+
],
|
| 279 |
+
"page_idx": 2
|
| 280 |
+
},
|
| 281 |
+
{
|
| 282 |
+
"type": "text",
|
| 283 |
+
"text": "The grid of states (Figure 1) forms a causal graph (Pearl, 2009) describing dependencies between the hidden variables. This graph contains many paths from inputs on the left to the output (next-word prediction) at the lower-right, and we wish to understand if there are specific hidden state variables that are more important than others when recalling a fact. ",
|
| 284 |
+
"bbox": [
|
| 285 |
+
174,
|
| 286 |
+
380,
|
| 287 |
+
825,
|
| 288 |
+
435
|
| 289 |
+
],
|
| 290 |
+
"page_idx": 2
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"type": "text",
|
| 294 |
+
"text": "As Vig et al. (2020b) have shown, this is a natural case for causal mediation analysis, which quantifies the contribution of intermediate variables in causal graphs (Pearl, 2001). To calculate each state’s contribution towards a correct factual prediction, we observe all of $G$ ’s internal activations during three runs: a clean run that predicts the fact, a corrupted run where the prediction is damaged, and a corrupted-with-restoration run that tests the ability of a single state to restore the prediction. ",
|
| 295 |
+
"bbox": [
|
| 296 |
+
173,
|
| 297 |
+
441,
|
| 298 |
+
825,
|
| 299 |
+
512
|
| 300 |
+
],
|
| 301 |
+
"page_idx": 2
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"type": "text",
|
| 305 |
+
"text": "• In the clean run, we pass a factual prompt $x$ into $G$ and collect all hidden activations $\\{ h _ { i } ^ { ( l ) } \\ | \\ i \\in [ 1 , T ] , l \\in [ 1 , \\dot { L } ] \\}$ . Figure 1a provides an example illustration with the prompt: “The Space Needle is in downtown ”, for which the expected completion is $o = { } ^ { \\mathrm { * } } \\mathrm { S e a t t l e } ^ { \\mathrm { * } }$ . • In the baseline corrupted run, the subject is obfuscated from $G$ before the network runs. Concretely, immediately after $x$ is embedded as $[ h _ { 1 } ^ { ( 0 ) } , h _ { 2 } ^ { ( 0 ) } , . . . , h _ { T } ^ { ( 0 ) } ]$ , we set $h _ { i } ^ { ( 0 ) } : = h _ { i } ^ { ( 0 ) } + \\epsilon$ for all indices $i$ that correspond to the subject entity, where $\\epsilon \\sim \\mathcal { N } ( 0 ; \\bar { \\nu } ) ^ { 4 } ; . \\ : G$ is then allowed to continue normally, giving us a set of corrupted activations $\\{ h _ { i * } ^ { ( l ) } \\ | \\ i \\in [ 1 , T ] , l \\in [ 1 , L ] \\}$ . Because $G$ loses some information about the subject, it will likely return an incorrect answer (Figure 1b). • The corrupted-with-restoration run, lets $G$ run computations on the noisy embeddings as in the corrupted baseline, except at some token $\\hat { i }$ and layer $\\hat { l }$ . There, we hook $G$ so that it is forced to output the clean state $h _ { \\widehat { i } } ^ { ( l ) }$ ; future computations execute without further intervention. Intuitively, the i ability of a few clean states to recover the correct fact, despite many other states being corrupted by the obfuscated subject, will indicate their causal importance in the computation graph. ",
|
| 306 |
+
"bbox": [
|
| 307 |
+
173,
|
| 308 |
+
517,
|
| 309 |
+
826,
|
| 310 |
+
705
|
| 311 |
+
],
|
| 312 |
+
"page_idx": 2
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"type": "text",
|
| 316 |
+
"text": "Let $\\mathbb { P } [ o ] , \\mathbb { P } _ { * } [ o ]$ , and $\\mathbb { P } _ { * }$ , clean $h _ { i } ^ { ( l ) } \\left[ O \\right]$ denote the probability of emitting $o$ under the clean, corrupted, and corrupted-with-restoration runs, respectively; dependence on the input $x$ is omitted for notational simplicity. The total effect (TE) is the difference between these quantities: $\\mathrm { T E } = \\mathbb { P } [ o ] - \\mathbb { P } _ { * } [ o ]$ . The indirect effect (IE) of a specific mediating state $h _ { i } ^ { ( l ) }$ is defined as the difference between the probability of $o$ under the corrupted version and the probability when that state is set to its clean version, while the subject remains corrupted: $\\mathrm { I E } = \\mathbb { P } _ { * }$ , clean $h _ { i } ^ { ( l ) } \\left[ O \\right] - \\mathbb { P } _ { * } [ O ]$ . Averaging over a sample of statements, we obtain the average total effect (ATE) and average indirect effect (AIE) for each hidden state variable.5 ",
|
| 317 |
+
"bbox": [
|
| 318 |
+
173,
|
| 319 |
+
710,
|
| 320 |
+
825,
|
| 321 |
+
821
|
| 322 |
+
],
|
| 323 |
+
"page_idx": 2
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"type": "image",
|
| 327 |
+
"img_path": "images/998ebba8dd8219e05022e67ab6cd31734ad78ac85b806ef3b88bf374737872c6.jpg",
|
| 328 |
+
"image_caption": [
|
| 329 |
+
"Figure 3: Causal effects with a modified computation graph. (a,b) To isolate the effects of MLP modules when measuring causal effects, the computation graph is modified. (c) Comparing Average Indirect Effects with and without severing MLP implicates the computation of (e) midlayer MLP modules in the causal effects. No similar gap is seen when attention is similarly severed. "
|
| 330 |
+
],
|
| 331 |
+
"image_footnote": [],
|
| 332 |
+
"bbox": [
|
| 333 |
+
173,
|
| 334 |
+
88,
|
| 335 |
+
818,
|
| 336 |
+
213
|
| 337 |
+
],
|
| 338 |
+
"page_idx": 3
|
| 339 |
+
},
|
| 340 |
+
{
|
| 341 |
+
"type": "text",
|
| 342 |
+
"text": "2.2 Causal Tracing Results ",
|
| 343 |
+
"text_level": 1,
|
| 344 |
+
"bbox": [
|
| 345 |
+
174,
|
| 346 |
+
295,
|
| 347 |
+
374,
|
| 348 |
+
309
|
| 349 |
+
],
|
| 350 |
+
"page_idx": 3
|
| 351 |
+
},
|
| 352 |
+
{
|
| 353 |
+
"type": "text",
|
| 354 |
+
"text": "We compute the average indirect effect (AIE) over 1000 factual statements (details in Appendix B.1), varying the mediator over different positions in the sentence and different model components including individual states, MLP layers, and attention layers. Figure 2 plots the AIE of the internal components of GPT-2 XL (1.5B parameters). The ATE of this experiment is $1 8 . 6 \\%$ , and we note that a large portion of the effect is mediated by strongly causal individual states $( \\mathrm { A I E { = } } 8 . 7 \\%$ at layer 15) at the last subject token. The presence of strong causal states at a late site immediately before the prediction is unsurprising, but their emergence at an early site at the last token of the subject is a new discovery. ",
|
| 355 |
+
"bbox": [
|
| 356 |
+
174,
|
| 357 |
+
320,
|
| 358 |
+
825,
|
| 359 |
+
417
|
| 360 |
+
],
|
| 361 |
+
"page_idx": 3
|
| 362 |
+
},
|
| 363 |
+
{
|
| 364 |
+
"type": "text",
|
| 365 |
+
"text": "Decomposing the causal effects of contributions of MLP and attention modules (Figure 1fg and Figure 2bc) suggests a decisive role for MLP modules at the early site: MLP contributions peak at AIE $6 . 6 \\%$ , while attention at the last subject token is only AIE $1 . 6 \\%$ ; attention is more important at the last token of the prompt. Appendix B.2 further discusses this decomposition. ",
|
| 366 |
+
"bbox": [
|
| 367 |
+
174,
|
| 368 |
+
424,
|
| 369 |
+
825,
|
| 370 |
+
481
|
| 371 |
+
],
|
| 372 |
+
"page_idx": 3
|
| 373 |
+
},
|
| 374 |
+
{
|
| 375 |
+
"type": "text",
|
| 376 |
+
"text": "Finally, to gain a clearer picture of the special role of MLP layers at the early site, we analyze indirect effects with a modified causal graph (Figure 3). (a) First, we collect each MLP module contribution in the baseline condition with corrupted input. (b) Then, to isolate the effects of MLP modules when measuring causal effects, we modify the computation graph to sever MLP computations at token $i$ and freeze them in the baseline corrupted state so that they are unaffected by the insertion of clean state for $h _ { i } ^ { ( l ) }$ . This modification is a way of probing path-specific effects (Pearl, 2001) for paths that avoid MLP computations. (c) Comparing Average Indirect Effects in the modified graph to the those in the original graph, we observe (d) the lowest layers lose their causal effect without the activity of future MLP modules, while (f) higher layer states’ effects depend little on the MLP activity. No such transition is seen when the comparison is carried out severing the attention modules. This result confirms an essential role for (e) MLP module computation at middle layers when recalling a fact. ",
|
| 377 |
+
"bbox": [
|
| 378 |
+
174,
|
| 379 |
+
486,
|
| 380 |
+
825,
|
| 381 |
+
638
|
| 382 |
+
],
|
| 383 |
+
"page_idx": 3
|
| 384 |
+
},
|
| 385 |
+
{
|
| 386 |
+
"type": "text",
|
| 387 |
+
"text": "Appendix B has results on other autoregressive models and experimental settings. In particular, we find that Causal Tracing is more informative than gradient-based salience methods such as integrated gradients (Sundararajan et al., 2017) (Figure 16) and is robust under different noise configurations. ",
|
| 388 |
+
"bbox": [
|
| 389 |
+
176,
|
| 390 |
+
645,
|
| 391 |
+
825,
|
| 392 |
+
686
|
| 393 |
+
],
|
| 394 |
+
"page_idx": 3
|
| 395 |
+
},
|
| 396 |
+
{
|
| 397 |
+
"type": "text",
|
| 398 |
+
"text": "We hypothesize that this localized midlayer MLP key–value mapping recalls facts about the subject. ",
|
| 399 |
+
"bbox": [
|
| 400 |
+
176,
|
| 401 |
+
693,
|
| 402 |
+
823,
|
| 403 |
+
708
|
| 404 |
+
],
|
| 405 |
+
"page_idx": 3
|
| 406 |
+
},
|
| 407 |
+
{
|
| 408 |
+
"type": "text",
|
| 409 |
+
"text": "2.3 The Localized Factual Association Hypothesis ",
|
| 410 |
+
"text_level": 1,
|
| 411 |
+
"bbox": [
|
| 412 |
+
174,
|
| 413 |
+
726,
|
| 414 |
+
532,
|
| 415 |
+
741
|
| 416 |
+
],
|
| 417 |
+
"page_idx": 3
|
| 418 |
+
},
|
| 419 |
+
{
|
| 420 |
+
"type": "text",
|
| 421 |
+
"text": "Based on causal traces, we posit a specific mechanism for storage of factual associations: each midlayer MLP module accepts inputs that encode a subject, then produces outputs that recall memorized properties about that subject. Middle layer MLP outputs accumulate information, then the summed information is copied to the last token by attention at high layers. ",
|
| 422 |
+
"bbox": [
|
| 423 |
+
174,
|
| 424 |
+
752,
|
| 425 |
+
825,
|
| 426 |
+
808
|
| 427 |
+
],
|
| 428 |
+
"page_idx": 3
|
| 429 |
+
},
|
| 430 |
+
{
|
| 431 |
+
"type": "text",
|
| 432 |
+
"text": "This hypothesis localizes factual association along three dimensions, placing it (i) in the MLP modules (ii) at specific middle layers (iii) and specifically at the processing of the subject’s last token. It is consistent with the Geva et al. (2021) view that MLP layers store knowledge, and the Elhage et al. (2021) study showing an information-copying role for self-attention. Furthermore, informed by the Zhao et al. (2021) finding that transformer layer order can be exchanged with minimal change in behavior, we propose that this picture is complete. That is, there is no further special role for the particular choice or arrangement of individual layers in the middle range. We conjecture that any fact could be equivalently stored in any one of the middle MLP layers. To test our hypothesis, we narrow our attention to a single MLP module at a mid-range layer $l ^ { * }$ , and ask whether its weights can be explicitly modified to store an arbitrary fact. ",
|
| 433 |
+
"bbox": [
|
| 434 |
+
174,
|
| 435 |
+
814,
|
| 436 |
+
825,
|
| 437 |
+
911
|
| 438 |
+
],
|
| 439 |
+
"page_idx": 3
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"type": "image",
|
| 443 |
+
"img_path": "images/eeb4c5f59c324d7747ed46f32e3dadf49334273e55fa708df9ff0730a7f294f8.jpg",
|
| 444 |
+
"image_caption": [
|
| 445 |
+
"Figure 4: Editing one MLP layer with ROME. To associate Space Needle with Paris, the ROME method inserts a new $( k _ { * } , v _ { * } )$ association into layer $l ^ { * }$ , where (a) key $k _ { * }$ is determined by the subject and (b) value $v _ { * }$ is optimized to select the object. (c) Hidden state at layer $l ^ { * }$ and token $_ { i }$ is expanded to produce (d) the key vector $k _ { * }$ for the subject. (e) To write new value vector $v _ { * }$ into the layer, (f) we calculate a rank-one update $\\Lambda ( C ^ { - 1 } k _ { * } ) ^ { T }$ to cause $\\hat { W } _ { p r o j } ^ { ( l ) } \\hat { k } _ { * } = v _ { * }$ ⇤ while minimizing interference with other memories stored in the layer. "
|
| 446 |
+
],
|
| 447 |
+
"image_footnote": [],
|
| 448 |
+
"bbox": [
|
| 449 |
+
171,
|
| 450 |
+
88,
|
| 451 |
+
826,
|
| 452 |
+
210
|
| 453 |
+
],
|
| 454 |
+
"page_idx": 4
|
| 455 |
+
},
|
| 456 |
+
{
|
| 457 |
+
"type": "text",
|
| 458 |
+
"text": "",
|
| 459 |
+
"bbox": [
|
| 460 |
+
174,
|
| 461 |
+
310,
|
| 462 |
+
825,
|
| 463 |
+
353
|
| 464 |
+
],
|
| 465 |
+
"page_idx": 4
|
| 466 |
+
},
|
| 467 |
+
{
|
| 468 |
+
"type": "text",
|
| 469 |
+
"text": "3 Interventions on Weights for Understanding Factual Association Storage ",
|
| 470 |
+
"text_level": 1,
|
| 471 |
+
"bbox": [
|
| 472 |
+
171,
|
| 473 |
+
382,
|
| 474 |
+
810,
|
| 475 |
+
401
|
| 476 |
+
],
|
| 477 |
+
"page_idx": 4
|
| 478 |
+
},
|
| 479 |
+
{
|
| 480 |
+
"type": "text",
|
| 481 |
+
"text": "While Causal Tracing has implicated MLP modules in recalling factual associations, we also wish to understand how facts are stored in weights. Geva et al. (2021) observed that MLP layers (Figure 4cde) can act as two-layer key–value memories,6 where the neurons of the first layer (l) $\\mathbf { \\overline { { \\it W } } } _ { f c } ^ { ( l ) }$ form a key, with which the second layer $W _ { p r o j } ^ { ( l ) }$ retrieves an associated value. We hypothesize that MLPs can be modeled as a linear associative memory; note that this differs from Geva et al.’s per-neuron view. ",
|
| 482 |
+
"bbox": [
|
| 483 |
+
174,
|
| 484 |
+
422,
|
| 485 |
+
825,
|
| 486 |
+
492
|
| 487 |
+
],
|
| 488 |
+
"page_idx": 4
|
| 489 |
+
},
|
| 490 |
+
{
|
| 491 |
+
"type": "text",
|
| 492 |
+
"text": "We test this hypothesis by conducting a new type of intervention: modifying factual associations with Rank-One Model Editing (ROME). Being able to insert a new knowledge tuple $t ^ { * } = ( s , r , o ^ { * } )$ in place of the current tuple $t ^ { c } = \\left( s , r , o ^ { c } \\right)$ with both generalization and specificity would demonstrate fine-grained understanding of the association-storage mechanisms. ",
|
| 493 |
+
"bbox": [
|
| 494 |
+
173,
|
| 495 |
+
498,
|
| 496 |
+
825,
|
| 497 |
+
555
|
| 498 |
+
],
|
| 499 |
+
"page_idx": 4
|
| 500 |
+
},
|
| 501 |
+
{
|
| 502 |
+
"type": "text",
|
| 503 |
+
"text": "3.1 Rank-One Model Editing: Viewing the Transformer MLP as an Associative Memory ",
|
| 504 |
+
"text_level": 1,
|
| 505 |
+
"bbox": [
|
| 506 |
+
173,
|
| 507 |
+
573,
|
| 508 |
+
799,
|
| 509 |
+
588
|
| 510 |
+
],
|
| 511 |
+
"page_idx": 4
|
| 512 |
+
},
|
| 513 |
+
{
|
| 514 |
+
"type": "text",
|
| 515 |
+
"text": "We view W (l)proj as a linear associative memory (Kohonen, 1972; Anderson, 1972). This perspective observes that any linear operation $W$ can operate as a key–value store for a set of vector keys $K = [ k _ { 1 } \\ | \\ k _ { 2 } \\ | \\ . \\ . \\ . ]$ and corresponding vector values $V = \\left[ v _ { 1 } \\mid v _ { 2 } \\mid \\ldots \\right]$ , by solving $W K \\approx V$ , whose squared error is minimized using the Moore-Penrose pseudoinverse: $\\dot { W } = V { \\bar { K ^ { + } } }$ . Bau et al. (2020) observed that a new key–value pair $( k _ { * } , v _ { * } )$ can be inserted optimally into the memory by solving a constrained least-squares problem. In a convolutional network, Bau et al. solve this using an optimization, but in a fully-connected layer, we can derive a closed form solution: ",
|
| 516 |
+
"bbox": [
|
| 517 |
+
173,
|
| 518 |
+
597,
|
| 519 |
+
826,
|
| 520 |
+
696
|
| 521 |
+
],
|
| 522 |
+
"page_idx": 4
|
| 523 |
+
},
|
| 524 |
+
{
|
| 525 |
+
"type": "equation",
|
| 526 |
+
"img_path": "images/812a0ecccfad6534321ab6f067c0a9e82bc6dd7692683887a95ab0e4a7320554.jpg",
|
| 527 |
+
"text": "$$\n\\mathrm { ~ e ~ } \\Vert \\hat { W } K - V \\Vert \\mathrm { ~ s u c h ~ t h a t ~ } \\hat { W } k _ { * } = v _ { * } \\quad \\mathrm { b y ~ s e t t i n g ~ } \\hat { W } = W + \\Lambda ( C ^ { - 1 } k _ { * } ) ^ { T } .\n$$",
|
| 528 |
+
"text_format": "latex",
|
| 529 |
+
"bbox": [
|
| 530 |
+
285,
|
| 531 |
+
705,
|
| 532 |
+
766,
|
| 533 |
+
726
|
| 534 |
+
],
|
| 535 |
+
"page_idx": 4
|
| 536 |
+
},
|
| 537 |
+
{
|
| 538 |
+
"type": "text",
|
| 539 |
+
"text": "Here $W$ is the original matrix, $C = K K ^ { T }$ is a constant that we pre-cache by estimating the uncentered covariance of $k$ from a sample of Wikipedia text (Appendix E.5), and $\\Lambda = \\mathbf { \\bar { \\Phi } } ( v _ { * } - W k _ { * } ) / ( C ^ { - 1 } k _ { * } ) ^ { T } k _ { * }$ is a vector proportional to the residual error of the new key–value pair on the original memory matrix (full derivation in Appendix A). Because of this simple algebraic structure, we can insert any fact directly once $( k _ { * } , v _ { * } )$ is computed. All that remains is to choose the appropriate $k _ { * }$ and $v _ { * }$ . ",
|
| 540 |
+
"bbox": [
|
| 541 |
+
173,
|
| 542 |
+
736,
|
| 543 |
+
823,
|
| 544 |
+
806
|
| 545 |
+
],
|
| 546 |
+
"page_idx": 4
|
| 547 |
+
},
|
| 548 |
+
{
|
| 549 |
+
"type": "text",
|
| 550 |
+
"text": "Step 1: Choosing $k _ { * }$ to Select the Subject. Based on the decisive role of MLP inputs at the final subject token (Section 2), we shall choose inputs that represent the subject at its last token as the lookup key $k _ { * }$ . Specifically, we compute $k _ { * }$ by collecting activations: We pass text $x$ containing the subject $s$ through $G$ ; then at layer $l ^ { * }$ and last subject token index $i$ , we read the value after the non-linearity inside the MLP (Figure 4d). Because the state will vary depending on tokens that precede $s$ in text, we set $k _ { * }$ to an average value over a small set of texts ending with the subject $s$ : ",
|
| 551 |
+
"bbox": [
|
| 552 |
+
174,
|
| 553 |
+
813,
|
| 554 |
+
825,
|
| 555 |
+
882
|
| 556 |
+
],
|
| 557 |
+
"page_idx": 4
|
| 558 |
+
},
|
| 559 |
+
{
|
| 560 |
+
"type": "text",
|
| 561 |
+
"text": "",
|
| 562 |
+
"bbox": [
|
| 563 |
+
168,
|
| 564 |
+
90,
|
| 565 |
+
812,
|
| 566 |
+
107
|
| 567 |
+
],
|
| 568 |
+
"page_idx": 5
|
| 569 |
+
},
|
| 570 |
+
{
|
| 571 |
+
"type": "equation",
|
| 572 |
+
"img_path": "images/d4f6daa2319c1c15912713da18554698b275ac89ab2709b22950b690f1995056.jpg",
|
| 573 |
+
"text": "$$\nk _ { * } = \\frac { 1 } { N } \\sum _ { j = 1 } ^ { N } k ( x _ { j } + s ) , \\mathrm { ~ w h e r e ~ } k ( x ) = \\sigma \\left( W _ { f c } ^ { ( l ^ { * } ) } \\gamma ( a _ { [ x ] , i } ^ { ( l ^ { * } ) } + h _ { [ x ] , i } ^ { ( l ^ { * } - 1 ) } ) \\right) .\n$$",
|
| 574 |
+
"text_format": "latex",
|
| 575 |
+
"bbox": [
|
| 576 |
+
263,
|
| 577 |
+
113,
|
| 578 |
+
735,
|
| 579 |
+
159
|
| 580 |
+
],
|
| 581 |
+
"page_idx": 5
|
| 582 |
+
},
|
| 583 |
+
{
|
| 584 |
+
"type": "text",
|
| 585 |
+
"text": "In practice, we sample $x _ { j }$ by generating 50 random token sequences of length 2 to 10 using $G$ ",
|
| 586 |
+
"bbox": [
|
| 587 |
+
171,
|
| 588 |
+
165,
|
| 589 |
+
792,
|
| 590 |
+
180
|
| 591 |
+
],
|
| 592 |
+
"page_idx": 5
|
| 593 |
+
},
|
| 594 |
+
{
|
| 595 |
+
"type": "text",
|
| 596 |
+
"text": "Step 2: Choosing $v _ { * }$ to Recall the Fact. Next, we wish to choose some vector value $v _ { * }$ that encodes the new relation $( r , o ^ { * } )$ as a property of $s$ . We set $v _ { * } = \\mathrm { a r g m i n } _ { z } \\mathcal { L } ( z )$ , where the objective $\\mathcal { L } ( z )$ is: ",
|
| 597 |
+
"bbox": [
|
| 598 |
+
169,
|
| 599 |
+
185,
|
| 600 |
+
825,
|
| 601 |
+
215
|
| 602 |
+
],
|
| 603 |
+
"page_idx": 5
|
| 604 |
+
},
|
| 605 |
+
{
|
| 606 |
+
"type": "equation",
|
| 607 |
+
"img_path": "images/0c6fb3c47350f248ba3314f3eab9be5916393c05b4a9d4dadddd23edf8560b8c.jpg",
|
| 608 |
+
"text": "$$\n\\frac { 1 } { N } \\sum _ { j = 1 } ^ { N } \\underbrace { - \\log { \\mathbb { P } } _ { G ( m _ { i } ^ { ( t ^ { * } ) } : = z ) } [ o ^ { * } \\mid x _ { j } + p ] } _ { \\mathrm { ( a ) M a x i m i z i n g ~ \\textstyle o ^ { * } ~ p r o b a b i l i t y } } + \\underbrace { D _ { \\mathrm { K L } } ( \\mathbb { P } _ { G ( m _ { i ^ { \\prime } } ^ { ( t ^ { * } ) } : = z ) } [ x \\mid p ^ { \\prime } ] \\| \\mathbb { P } _ { G } [ x \\mid p ^ { \\prime } ] ) } _ { \\mathrm { ( b ) C o n r o l i n g ~ e s s e n c e d i r t } } .\n$$",
|
| 609 |
+
"text_format": "latex",
|
| 610 |
+
"bbox": [
|
| 611 |
+
217,
|
| 612 |
+
222,
|
| 613 |
+
781,
|
| 614 |
+
276
|
| 615 |
+
],
|
| 616 |
+
"page_idx": 5
|
| 617 |
+
},
|
| 618 |
+
{
|
| 619 |
+
"type": "text",
|
| 620 |
+
"text": "The first term (Eqn. 4a) seeks a vector $z$ that, when substituted as the output of the MLP at the token $i$ at the end of the subject (notated $G ( m _ { i } ^ { ( l ^ { * } ) } : = z ) ^ { \\backslash }$ ), will cause the network to predict the target object $o ^ { * }$ in response to the factual prompt $p$ . The second term (Eqn. 4b) minimizes the KL divergence of predictions for the prompt $p ^ { \\prime }$ (of the form $\\mathbf { \\cdots } \\{ \\mathrm { s u b j e c t } \\}$ is a”) to the unchanged model, which helps preserve the model’s understanding of the subject’s essence. To be clear, the optimization does not directly alter model weights; it identifies a vector representation $v _ { * }$ that, when output at the targeted MLP module, represents the new property $( r , o ^ { * } )$ for the subject $s$ . Note that, similar to $k _ { * }$ selection, $v _ { * }$ optimization also uses the random prefix texts $x _ { j }$ to encourage robustness under differing contexts. ",
|
| 621 |
+
"bbox": [
|
| 622 |
+
173,
|
| 623 |
+
284,
|
| 624 |
+
825,
|
| 625 |
+
396
|
| 626 |
+
],
|
| 627 |
+
"page_idx": 5
|
| 628 |
+
},
|
| 629 |
+
{
|
| 630 |
+
"type": "text",
|
| 631 |
+
"text": "Step 3: Inserting the Fact. Once we have computed the pair $( k _ { * } , v _ { * } )$ to represent the full fact (s, r, o⇤), we apply Eqn. 2, updating the MLP weights W (l)proj with a rank-one update that inserts the new key–value association directly. For full implementation details, see Appendix E.5. ",
|
| 632 |
+
"bbox": [
|
| 633 |
+
173,
|
| 634 |
+
401,
|
| 635 |
+
823,
|
| 636 |
+
444
|
| 637 |
+
],
|
| 638 |
+
"page_idx": 5
|
| 639 |
+
},
|
| 640 |
+
{
|
| 641 |
+
"type": "text",
|
| 642 |
+
"text": "3.2 Evaluating ROME: Zero-Shot Relation Extraction (zsRE) ",
|
| 643 |
+
"text_level": 1,
|
| 644 |
+
"bbox": [
|
| 645 |
+
173,
|
| 646 |
+
459,
|
| 647 |
+
614,
|
| 648 |
+
474
|
| 649 |
+
],
|
| 650 |
+
"page_idx": 5
|
| 651 |
+
},
|
| 652 |
+
{
|
| 653 |
+
"type": "text",
|
| 654 |
+
"text": "We wish to test our localized factual association hypothesis: can storing a single new vector association using ROME insert a substantial, generalized factual association into the model? ",
|
| 655 |
+
"bbox": [
|
| 656 |
+
174,
|
| 657 |
+
484,
|
| 658 |
+
823,
|
| 659 |
+
513
|
| 660 |
+
],
|
| 661 |
+
"page_idx": 5
|
| 662 |
+
},
|
| 663 |
+
{
|
| 664 |
+
"type": "text",
|
| 665 |
+
"text": "A natural question is how ROME compares to other model-editing methods, which use direct optimization or hypernetworks to incorporate a single new training example into a network. For baselines, we examine Fine-Tuning (FT), which applies Adam with early stopping at one layer to minimize $- \\log \\mathbb { P } \\left[ o ^ { * } \\mid x \\right]$ . Constrained Fine-Tuning $\\mathbf { \\left( F T + L \\right) }$ (Zhu et al., 2020) additionally imposes a parameter-space $L _ { \\infty }$ norm constraint on weight changes. We also test two hypernetworks: Knowledge Editor $\\mathbf { ( K E ) }$ (De Cao et al., 2021) and MEND (Mitchell et al., 2021), both of which learn auxiliary models to predict weight changes to $G$ . Further details are described in Appendix E. ",
|
| 666 |
+
"bbox": [
|
| 667 |
+
173,
|
| 668 |
+
520,
|
| 669 |
+
825,
|
| 670 |
+
617
|
| 671 |
+
],
|
| 672 |
+
"page_idx": 5
|
| 673 |
+
},
|
| 674 |
+
{
|
| 675 |
+
"type": "text",
|
| 676 |
+
"text": "We first evaluate ROME on the Zero-Shot Relation Extraction (zsRE) task used in Mitchell et al. (2021) and De Cao et al. (2021). Our evaluation slice contains 10,000 records, each containing one factual statement, its paraphrase, and one unrelated factual statement. “Efficacy” and “Paraphrase” measure post-edit accuracy $\\mathbb { I } \\big [ o ^ { * } = \\mathrm { a r g m a x } _ { o } \\mathbb { P } _ { G ^ { \\prime } } \\left[ o \\right] \\big ]$ of the statement and its paraphrase, respectively, while “Specificity” measures the edited model’s accuracy on an unrelated fact. Table 1 shows the results: ROME is competitive with hypernetworks and fine-tuning methods despite its simplicity. We find that it ",
|
| 677 |
+
"bbox": [
|
| 678 |
+
174,
|
| 679 |
+
623,
|
| 680 |
+
485,
|
| 681 |
+
801
|
| 682 |
+
],
|
| 683 |
+
"page_idx": 5
|
| 684 |
+
},
|
| 685 |
+
{
|
| 686 |
+
"type": "table",
|
| 687 |
+
"img_path": "images/0e85568b3db85a4ec77f72778120f03fa7931c55642ffa5391e3f2bdfa77943d.jpg",
|
| 688 |
+
"table_caption": [
|
| 689 |
+
"Table 1: zsRE Editing Results on GPT-2 XL. "
|
| 690 |
+
],
|
| 691 |
+
"table_footnote": [],
|
| 692 |
+
"table_body": "<table><tr><td>Editor</td><td>Efficacy 个 Paraphrase 个 Specificity 个</td></tr><tr><td>GPT-2 XL</td><td>22.2 (±0.5) 21.3 (±0.5) 24.2 (±0.5)</td></tr><tr><td>FT</td><td>99.6 (±0.1) 82.1 (±0.6) 23.2(±0.5)</td></tr><tr><td>FT+L</td><td>92.3 (±0.4) 47.2 (±0.7) 23.4(±0.5)</td></tr><tr><td>KE</td><td>65.5 (±0.6) 61.4(±0.6) 24.9 (±0.5)</td></tr><tr><td>KE-zsRE</td><td>92.4 (±0.3) 90.0 (±0.3) 23.8 (±0.5)</td></tr><tr><td>MEND</td><td>75.9 (±0.5) 65.3 (±0.6) 24.1(±0.5)</td></tr><tr><td>MEND-zsRE 99.4 (±0.1)</td><td>99.3 (±0.1) 24.1(±0.5)</td></tr><tr><td>ROME</td><td>99.8 (±0.0) 88.1(±0.5) 24.2 (±0.5)</td></tr></table>",
|
| 693 |
+
"bbox": [
|
| 694 |
+
498,
|
| 695 |
+
640,
|
| 696 |
+
823,
|
| 697 |
+
786
|
| 698 |
+
],
|
| 699 |
+
"page_idx": 5
|
| 700 |
+
},
|
| 701 |
+
{
|
| 702 |
+
"type": "text",
|
| 703 |
+
"text": "is not hard for ROME to insert an association that can be regurgitated by the model. Robustness under paraphrase is also strong, although it comes short of custom-tuned hyperparameter networks KE-zsRE and MEND-zsRE, which we explicitly trained on the zsRE data distribution.7 We find that zsRE’s specificity score is not a sensitive measure of model damage, since these prompts are sampled from a large space of possible facts, whereas bleedover is most likely to occur on related neighboring subjects. Appendix C has additional experimental details. ",
|
| 704 |
+
"bbox": [
|
| 705 |
+
174,
|
| 706 |
+
803,
|
| 707 |
+
825,
|
| 708 |
+
886
|
| 709 |
+
],
|
| 710 |
+
"page_idx": 5
|
| 711 |
+
},
|
| 712 |
+
{
|
| 713 |
+
"type": "image",
|
| 714 |
+
"img_path": "images/5a2a7a1c4f15eec825b5bc2c6f590368fcee6879815bfc273dd860b9cd34e2db.jpg",
|
| 715 |
+
"image_caption": [
|
| 716 |
+
"Figure 5: ROME edits are benchmarked at each layer-and-token combination in GPT-2-XL. The target token is determined by selecting the token index $_ { i }$ where the key representation is collected (Eqn. 3). ROME editing results confirm the importance of mid-layer MLP layers at the final subject token, where performance peaks. "
|
| 717 |
+
],
|
| 718 |
+
"image_footnote": [],
|
| 719 |
+
"bbox": [
|
| 720 |
+
173,
|
| 721 |
+
85,
|
| 722 |
+
823,
|
| 723 |
+
208
|
| 724 |
+
],
|
| 725 |
+
"page_idx": 6
|
| 726 |
+
},
|
| 727 |
+
{
|
| 728 |
+
"type": "text",
|
| 729 |
+
"text": "3.3 Evaluating ROME: Our COUNTERFACT Dataset ",
|
| 730 |
+
"text_level": 1,
|
| 731 |
+
"bbox": [
|
| 732 |
+
173,
|
| 733 |
+
267,
|
| 734 |
+
555,
|
| 735 |
+
282
|
| 736 |
+
],
|
| 737 |
+
"page_idx": 6
|
| 738 |
+
},
|
| 739 |
+
{
|
| 740 |
+
"type": "text",
|
| 741 |
+
"text": "While standard model-editing metrics on zsRE are a reasonable starting point for evaluating ROME, they do not provide detailed insights that would allow us to distinguish superficial wording changes from deeper modifications that correspond to a meaningful change about a fact. ",
|
| 742 |
+
"bbox": [
|
| 743 |
+
174,
|
| 744 |
+
294,
|
| 745 |
+
825,
|
| 746 |
+
335
|
| 747 |
+
],
|
| 748 |
+
"page_idx": 6
|
| 749 |
+
},
|
| 750 |
+
{
|
| 751 |
+
"type": "text",
|
| 752 |
+
"text": "In particular, we wish to measure the efficacy of significant changes. Hase et al. (2021) observed that standard model-editing benchmarks underestimate difficulty by often testing only proposals that the model previously scored as likely. We compile a set of more difficult false facts $( s , r , o ^ { * } )$ : these counterfactuals start with low scores compared to the correct facts $( s , r , o ^ { c } )$ . Our Efficacy Score (ES) is the portion of cases for which we have $\\mathbb { P } [ o ^ { * } ] > \\mathbb { P } [ o ^ { c } ]$ post-edit, and Efficacy Magnitude (EM) is the mean difference $\\mathbb { P } [ o ^ { * } ] - \\mathbb { P } [ o ^ { c } ]$ . Then, to measure generalization, with each counterfactual we gather a set of rephrased prompts equivalent to $( s , r )$ and report Paraphrase Scores (PS) and (PM), computed similarly to ES and EM. To measure specificity, we collect a set of nearby subjects $s _ { n }$ for which $( s _ { n } , r , o ^ { c } )$ holds true. Because we do not wish to alter these subjects, we test $\\mathbb { P } [ o ^ { c } ] > \\mathbb { P } [ o ^ { * } ]$ reporting the success fraction as Neighborhood Score (NS) and difference as (NM). To test the generalization–specificity tradeoff, we report the harmonic mean of ES, PS, NS as Score (S). ",
|
| 753 |
+
"bbox": [
|
| 754 |
+
174,
|
| 755 |
+
342,
|
| 756 |
+
825,
|
| 757 |
+
494
|
| 758 |
+
],
|
| 759 |
+
"page_idx": 6
|
| 760 |
+
},
|
| 761 |
+
{
|
| 762 |
+
"type": "text",
|
| 763 |
+
"text": "We also wish to measure semantic consistency of $G ^ { \\prime }$ ’s generations. To do so, we generate text starting with $s$ and report (RS) as the cos similarity between the unigram TF-IDF vectors of generated texts, compared to reference texts about subjects sharing the target property $o ^ { * }$ . Finally, we monitor fluency degradations by measuring the weighted average of bi- and tri-gram entropies (Zhang et al., 2018) given by $\\begin{array} { r } { - \\sum _ { k } f ( k ) \\log _ { 2 } f ( k ) } \\end{array}$ , where $f ( \\cdot )$ is the $n$ -gram frequency distribution, which we report as (GE); this quantity drops if text generations are repetitive. ",
|
| 764 |
+
"bbox": [
|
| 765 |
+
174,
|
| 766 |
+
501,
|
| 767 |
+
517,
|
| 768 |
+
652
|
| 769 |
+
],
|
| 770 |
+
"page_idx": 6
|
| 771 |
+
},
|
| 772 |
+
{
|
| 773 |
+
"type": "text",
|
| 774 |
+
"text": "In order to facilitate the above measurements, we introduce COUNTERFACT, a challenging evaluation dataset for evaluating counterfactual edits in language models. Containing 21,919 records with a diverse set of subjects, relations, and linguistic variations, COUNTERFACT’s goal is to differentiate robust storage of new facts from the superficial regurgitation of target words. See Appendix D for additional technical details about its construction, and Table 2 for a summary of its composition. ",
|
| 775 |
+
"bbox": [
|
| 776 |
+
174,
|
| 777 |
+
659,
|
| 778 |
+
517,
|
| 779 |
+
741
|
| 780 |
+
],
|
| 781 |
+
"page_idx": 6
|
| 782 |
+
},
|
| 783 |
+
{
|
| 784 |
+
"type": "table",
|
| 785 |
+
"img_path": "images/56dd6344eec28b2447ac46d99df4b8d20fb1b574bc947630b3237d3833c61664.jpg",
|
| 786 |
+
"table_caption": [
|
| 787 |
+
"Table 2: COUNTERFACT Composition "
|
| 788 |
+
],
|
| 789 |
+
"table_footnote": [],
|
| 790 |
+
"table_body": "<table><tr><td></td></tr><tr><td>Per Per Item Total Relation Record</td></tr><tr><td>Records 21919 645 1</td></tr><tr><td>Subjects 20391 624 1</td></tr><tr><td>Objects 749 60 1</td></tr><tr><td>Counterfactual Statements 21595 635 1</td></tr><tr><td>Paraphrase Prompts 42876 1262 2</td></tr><tr><td>Neighborhood Prompts 82650 2441 10</td></tr><tr><td>Generation Prompts 62346 1841 3</td></tr></table>",
|
| 791 |
+
"bbox": [
|
| 792 |
+
535,
|
| 793 |
+
517,
|
| 794 |
+
823,
|
| 795 |
+
641
|
| 796 |
+
],
|
| 797 |
+
"page_idx": 6
|
| 798 |
+
},
|
| 799 |
+
{
|
| 800 |
+
"type": "table",
|
| 801 |
+
"img_path": "images/0cc2be581f070ea69322025c4a04be9eb9c48b44947f2353c02b9f51712ad1cc.jpg",
|
| 802 |
+
"table_caption": [
|
| 803 |
+
"Table 3: Comparison to Existing Benchmarks "
|
| 804 |
+
],
|
| 805 |
+
"table_footnote": [],
|
| 806 |
+
"table_body": "<table><tr><td>Criterion</td><td colspan=\"6\">SQuAD zSRE FEVER WikiTextPARAREL CF</td></tr><tr><td>Efficacy</td><td><<xx</td><td></td><td></td><td></td><td><<xxx</td><td>vvv<></td></tr><tr><td>Generalization</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Bleedover</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Consistency</td><td></td><td></td><td><<xxx</td><td>/xxxx</td><td></td><td></td></tr><tr><td>Fluency</td><td>X</td><td><<xxx</td><td></td><td></td><td></td><td></td></tr></table>",
|
| 807 |
+
"bbox": [
|
| 808 |
+
531,
|
| 809 |
+
665,
|
| 810 |
+
820,
|
| 811 |
+
734
|
| 812 |
+
],
|
| 813 |
+
"page_idx": 6
|
| 814 |
+
},
|
| 815 |
+
{
|
| 816 |
+
"type": "text",
|
| 817 |
+
"text": "",
|
| 818 |
+
"bbox": [
|
| 819 |
+
174,
|
| 820 |
+
742,
|
| 821 |
+
825,
|
| 822 |
+
770
|
| 823 |
+
],
|
| 824 |
+
"page_idx": 6
|
| 825 |
+
},
|
| 826 |
+
{
|
| 827 |
+
"type": "text",
|
| 828 |
+
"text": "3.4 Confirming the Importance of Decisive States Identified by Causal Tracing ",
|
| 829 |
+
"text_level": 1,
|
| 830 |
+
"bbox": [
|
| 831 |
+
174,
|
| 832 |
+
787,
|
| 833 |
+
732,
|
| 834 |
+
803
|
| 835 |
+
],
|
| 836 |
+
"page_idx": 6
|
| 837 |
+
},
|
| 838 |
+
{
|
| 839 |
+
"type": "text",
|
| 840 |
+
"text": "In Section 2, we used Causal Tracing to identify decisive hidden states. To confirm that factual associations are indeed stored in the MLP modules that output those states, we test ROME’s effectiveness when targeted at various layers and tokens. Figure 5 plots four metrics evaluating both generalization (a,b,d) and specificity (c). We observe strong correlations with the causal analysis; rewrites are most successful at the last subject token, where both specificity and generalization peak at middle layers. Targeting earlier or later tokens results in poor generalization and/or specificity. Furthermore, the layers at which edits generalize best correspond to the middle layers of the early site identified by ",
|
| 841 |
+
"bbox": [
|
| 842 |
+
174,
|
| 843 |
+
814,
|
| 844 |
+
826,
|
| 845 |
+
911
|
| 846 |
+
],
|
| 847 |
+
"page_idx": 6
|
| 848 |
+
},
|
| 849 |
+
{
|
| 850 |
+
"type": "table",
|
| 851 |
+
"img_path": "images/81f7c5ee028d178abcc9e36d3316ee2dd561914da80719413243efebfe5b138d.jpg",
|
| 852 |
+
"table_caption": [
|
| 853 |
+
"Table 4: Quantitative Editing Results. $9 5 \\%$ confidence intervals are in parentheses. Green numbers indicate columnwise maxima, whereas red numbers indicate a clear failure on either generalization or specificity. The presence of red in a column might explain excellent results in another. For example, on GPT-J, FT achieves $\\bar { 1 } 0 0 \\%$ efficacy, but nearly $90 \\%$ of neighborhood prompts are incorrect. "
|
| 854 |
+
],
|
| 855 |
+
"table_footnote": [],
|
| 856 |
+
"table_body": "<table><tr><td rowspan=\"2\">Editor</td><td rowspan=\"2\">Score S↑</td><td colspan=\"2\">Efficacy</td><td colspan=\"2\">Generalization</td><td colspan=\"2\">Specificity</td><td>Fluency</td><td>Consistency</td></tr><tr><td>ES↑</td><td>EM个</td><td>PS个</td><td>PM个</td><td>NS↑</td><td>NM↑</td><td>GE个</td><td>RS个</td></tr><tr><td>GPT-2 XL</td><td>30.5</td><td>22.2 (0.9)</td><td>-4.8 (0.3)</td><td>24.7 (0.8)</td><td>-5.0 (0.3)</td><td>78.1 (0.6)</td><td>5.0 (0.2)</td><td>626.6 (0.3)</td><td>31.9 (0.2)</td></tr><tr><td>FT</td><td>65.1</td><td>100.0 (0.0)</td><td>98.8 (0.1)</td><td>87.9 (0.6)</td><td>46.6 (0.8)</td><td>40.4 (0.7)</td><td>-6.2 (0.4)</td><td>607.1 (1.1)</td><td>40.5 (0.3)</td></tr><tr><td>FT+L</td><td>66.9</td><td>99.1 (0.2)</td><td>91.5 (0.5)</td><td>48.7 (1.0)</td><td>28.9 (0.8)</td><td>70.3 (0.7)</td><td>3.5 (0.3)</td><td>621.4 (1.0)</td><td>37.4 (0.3)</td></tr><tr><td>KN</td><td>35.6</td><td>28.7 (1.0)</td><td>-3.4 (0.3)</td><td>28.0 (0.9)</td><td>-3.3 (0.2)</td><td>72.9 (0.7)</td><td>3.7 (0.2)</td><td>570.4 (2.3)</td><td>30.3 (0.3)</td></tr><tr><td>KE</td><td>52.2</td><td>84.3 (0.8)</td><td>33.9 (0.9)</td><td>75.4 (0.8)</td><td>14.6 (0.6)</td><td>30.9 (0.7)</td><td>-11.0 (0.5)</td><td>586.6 (2.1)</td><td>31.2 (0.3)</td></tr><tr><td>KE-CF</td><td>18.1</td><td>99.9 (0.1)</td><td>97.0 (0.2)</td><td>95.8 (0.4)</td><td>59.2 (0.8)</td><td>6.9 (0.3)</td><td>-63.2 (0.7)</td><td>383.0 (4.1)</td><td>24.5 (0.4)</td></tr><tr><td>MEND</td><td>57.9</td><td>99.1 (0.2)</td><td>70.9 (0.8)</td><td>65.4 (0.9)</td><td>12.2 (0.6)</td><td>37.9 (0.7)</td><td>-11.6 (0.5)</td><td>624.2 (0.4)</td><td>34.8 (0.3)</td></tr><tr><td>MEND-CF</td><td>14.9</td><td>100.0 (0.0)</td><td>99.2 (0.1)</td><td>97.0 (0.3)</td><td>65.6 (0.7)</td><td>5.5 (0.3)</td><td>-69.9 (0.6)</td><td>570.0 (2.1)</td><td>33.2 (0.3)</td></tr><tr><td>ROME</td><td>89.2</td><td>100.0 (0.1)</td><td>97.9 (0.2)</td><td>96.4 (0.3)</td><td>62.7 (0.8)</td><td>75.4 (0.7)</td><td>4.2 (0.2)</td><td>621.9 (0.5)</td><td>41.9 (0.3)</td></tr><tr><td>GPT-J</td><td>23.6</td><td>16.3 (1.6)</td><td>-7.2 (0.7)</td><td>18.6 (1.5)</td><td>-7.4 (0.6)</td><td>83.0 (1.1)</td><td>7.3 (0.5)</td><td>621.8 (0.6)</td><td>29.8 (0.5)</td></tr><tr><td>FT</td><td>25.5</td><td>100.0 (0.0)</td><td>99.9 (0.0)</td><td>96.6 (0.6)</td><td>71.0 (1.5)</td><td>10.3 (0.8)</td><td>-50.7 (1.3)</td><td>387.8 (7.3)</td><td>24.6 (0.8)</td></tr><tr><td>FT+L</td><td>68.7</td><td>99.6 (0.3)</td><td>95.0 (0.6)</td><td>47.9 (1.9)</td><td>30.4 (1.5)</td><td>78.6 (1.2)</td><td>6.8 (0.5)</td><td>622.8 (0.6)</td><td>35.5 (0.5)</td></tr><tr><td>MEND</td><td>63.2</td><td>97.4 (0.7)</td><td>71.5 (1.6)</td><td>53.6 (1.9)</td><td>11.0 (1.3)</td><td>53.9 (1.4)</td><td>-6.0 (0.9)</td><td>620.5 (0.7)</td><td>32.6 (0.5)</td></tr><tr><td>ROME</td><td>91.5</td><td>99.9 (0.1)</td><td>99.4 (0.3)</td><td>99.1 (0.3)</td><td>74.1 (1.3)</td><td>78.9 (1.2)</td><td>5.2 (0.5)</td><td>620.1 (0.9)</td><td>43.0 (0.6)</td></tr></table>",
|
| 857 |
+
"bbox": [
|
| 858 |
+
173,
|
| 859 |
+
148,
|
| 860 |
+
826,
|
| 861 |
+
390
|
| 862 |
+
],
|
| 863 |
+
"page_idx": 7
|
| 864 |
+
},
|
| 865 |
+
{
|
| 866 |
+
"type": "text",
|
| 867 |
+
"text": "Causal Tracing, with generalization peaking at the 18th layer. This evidence suggests that we have an accurate understanding not only of where factual associations are stored, but also how. Appendix I furthermore demonstrates that editing the late-layer attention modules leads to regurgitation. ",
|
| 868 |
+
"bbox": [
|
| 869 |
+
176,
|
| 870 |
+
416,
|
| 871 |
+
823,
|
| 872 |
+
458
|
| 873 |
+
],
|
| 874 |
+
"page_idx": 7
|
| 875 |
+
},
|
| 876 |
+
{
|
| 877 |
+
"type": "text",
|
| 878 |
+
"text": "Table 4 showcases quantitative results on GPT-2 XL (1.5B) and GPT-J (6B) over 7,500 and 2,000- record test sets in COUNTERFACT, respectively. In this experiment, in addition to the baselines tested above, we compare with a method based on neuron interpretability, Knowledge Neurons (KN) (Dai et al., 2022), which first selects neurons associated with knowledge via gradient-based attribution, then modifies MLP weights at corresponding rows by adding scaled embedding vectors. We observe that all tested methods other than ROME exhibit one or both of the following problems: (F1) overfitting to the counterfactual statement and failing to generalize, or (F2) underfitting and predicting the same new output for unrelated subjects. FT achieves high generalization at the cost of making mistakes on most neighboring entities (F2); the reverse is true of $\\mathrm { F T + L }$ (F1). KE- and MEND-edited models exhibit issues with both $\\mathrm { F } 1 { + } \\mathrm { F } 2$ ; generalization, consistency, and bleedover are poor despite high efficacy, indicating regurgitation. KN is unable to make effective edits $( \\mathrm { F } 1 { + } \\mathrm { F } 2 )$ ). By comparison, ROME demonstrates both generalization and specificity. ",
|
| 879 |
+
"bbox": [
|
| 880 |
+
174,
|
| 881 |
+
464,
|
| 882 |
+
825,
|
| 883 |
+
631
|
| 884 |
+
],
|
| 885 |
+
"page_idx": 7
|
| 886 |
+
},
|
| 887 |
+
{
|
| 888 |
+
"type": "text",
|
| 889 |
+
"text": "3.5 Comparing Generation Results ",
|
| 890 |
+
"text_level": 1,
|
| 891 |
+
"bbox": [
|
| 892 |
+
176,
|
| 893 |
+
648,
|
| 894 |
+
429,
|
| 895 |
+
662
|
| 896 |
+
],
|
| 897 |
+
"page_idx": 7
|
| 898 |
+
},
|
| 899 |
+
{
|
| 900 |
+
"type": "text",
|
| 901 |
+
"text": "Figure 6 compares generated text after applying the counterfactual “Pierre Curie’s area of work is medicine” to GPT-2 XL (he is actually a physicist). Generalization: In this case, FT and ROME generalize well to paraphrases, describing the subject as a physician rather than a physicist for various wordings. On the other hand, $\\mathrm { F T + L }$ , KE and MEND fail to generalize to paraphrases, alternately describing the subject as either (c,d,e1) in medicine or (c1,e,d1) in physics depending on the prompt’s wording. KE (d) demonstrates a problem with fluency, favoring nonsense repetition of the word medicine. Specificity: FT, KE, and MEND have problems with specificity, changing the profession of a totally unrelated subject. Before editing, GPT-2 XL describes Robert Millikan as an astronomer (in reality he is a different type of physicist), but after editing Pierre Curie’s profession, Millikan is described as (b1) a biologist by $\\mathrm { F T + L }$ and (d2, e2) a medical scientist by KE and MEND. In contrast, ROME is specific, leaving Millikan’s field unchanged. See Appendix G for additional examples. ",
|
| 902 |
+
"bbox": [
|
| 903 |
+
173,
|
| 904 |
+
674,
|
| 905 |
+
825,
|
| 906 |
+
827
|
| 907 |
+
],
|
| 908 |
+
"page_idx": 7
|
| 909 |
+
},
|
| 910 |
+
{
|
| 911 |
+
"type": "text",
|
| 912 |
+
"text": "3.6 Human evaluation ",
|
| 913 |
+
"text_level": 1,
|
| 914 |
+
"bbox": [
|
| 915 |
+
174,
|
| 916 |
+
843,
|
| 917 |
+
341,
|
| 918 |
+
858
|
| 919 |
+
],
|
| 920 |
+
"page_idx": 7
|
| 921 |
+
},
|
| 922 |
+
{
|
| 923 |
+
"type": "text",
|
| 924 |
+
"text": "To evaluate the quality of generated text after applying ROME, we ask 15 volunteers to evaluate models by comparing generated text samples on the basis of both fluency and consistency with the inserted fact. Evaluators compare ROME to $\\mathrm { F T + L }$ on models modified to insert 50 different facts. ",
|
| 925 |
+
"bbox": [
|
| 926 |
+
176,
|
| 927 |
+
869,
|
| 928 |
+
825,
|
| 929 |
+
911
|
| 930 |
+
],
|
| 931 |
+
"page_idx": 7
|
| 932 |
+
},
|
| 933 |
+
{
|
| 934 |
+
"type": "image",
|
| 935 |
+
"img_path": "images/c650a665431eec32346f08d0d8cf41a19b248635548033b50246702212f597f6.jpg",
|
| 936 |
+
"image_caption": [
|
| 937 |
+
"Figure 6: Comparison of generated text. Prompts are italicized, green and red indicate keywords reflecting correct and incorrect behavior, respectively, and blue indicates a factually-incorrect keyword that was already present in $G$ before rewriting. See Section 3.5 for detailed analysis. "
|
| 938 |
+
],
|
| 939 |
+
"image_footnote": [],
|
| 940 |
+
"bbox": [
|
| 941 |
+
176,
|
| 942 |
+
88,
|
| 943 |
+
821,
|
| 944 |
+
303
|
| 945 |
+
],
|
| 946 |
+
"page_idx": 8
|
| 947 |
+
},
|
| 948 |
+
{
|
| 949 |
+
"type": "text",
|
| 950 |
+
"text": "We find that evaluators are 1.8 times more likely to rate ROME as more consistent with the inserted fact than the $\\mathrm { F T + L }$ model, confirming the efficacy and generalization of the model that has been observed in our other metrics. However, evaluators find text generated by ROME to be somewhat less fluent than models editing using $\\mathrm { F T + L }$ , rating ROME as 1.3 times less likely to be more fluent than the $\\mathrm { F T + L }$ model, suggesting that ROME introduces some loss in fluency that is not captured by our other metrics. Further details of the human evaluation can be found in Appendix J. ",
|
| 951 |
+
"bbox": [
|
| 952 |
+
174,
|
| 953 |
+
366,
|
| 954 |
+
825,
|
| 955 |
+
449
|
| 956 |
+
],
|
| 957 |
+
"page_idx": 8
|
| 958 |
+
},
|
| 959 |
+
{
|
| 960 |
+
"type": "text",
|
| 961 |
+
"text": "3.7 Limitations ",
|
| 962 |
+
"text_level": 1,
|
| 963 |
+
"bbox": [
|
| 964 |
+
174,
|
| 965 |
+
467,
|
| 966 |
+
294,
|
| 967 |
+
482
|
| 968 |
+
],
|
| 969 |
+
"page_idx": 8
|
| 970 |
+
},
|
| 971 |
+
{
|
| 972 |
+
"type": "text",
|
| 973 |
+
"text": "The purpose of ROME is to serve as a tool for understanding mechanisms of knowledge storage: it only edits a single fact at a time, and it is not intended as a practical method for large-scale model training. Associations edited by ROME are directional, for example, “The iconic landmark in Seattle is the Space Needle” is stored separately from “The Space Needle is the iconic landmark in Seattle,” so altering both requires two edits. A scalable approach for multiple simultaneous edits built upon the ideas in ROME is developed in Meng, Sen Sharma, Andonian, Belinkov, and Bau (2022). ",
|
| 974 |
+
"bbox": [
|
| 975 |
+
174,
|
| 976 |
+
493,
|
| 977 |
+
825,
|
| 978 |
+
577
|
| 979 |
+
],
|
| 980 |
+
"page_idx": 8
|
| 981 |
+
},
|
| 982 |
+
{
|
| 983 |
+
"type": "text",
|
| 984 |
+
"text": "ROME and Causal Tracing have shed light on factual association within GPT, but we have not investigated other kinds of learned beliefs such as logical, spatial, or numerical knowledge. Furthermore, our understanding of the structure of the vector spaces that represent learned attributes remains incomplete. Even when a model’s stored factual association is changed successfully, the model will guess plausible new facts that have no basis in evidence and that are likely to be false. This may limit the usefulness of a language model as a source of facts. ",
|
| 985 |
+
"bbox": [
|
| 986 |
+
174,
|
| 987 |
+
583,
|
| 988 |
+
825,
|
| 989 |
+
666
|
| 990 |
+
],
|
| 991 |
+
"page_idx": 8
|
| 992 |
+
},
|
| 993 |
+
{
|
| 994 |
+
"type": "text",
|
| 995 |
+
"text": "4 Related Work ",
|
| 996 |
+
"text_level": 1,
|
| 997 |
+
"bbox": [
|
| 998 |
+
174,
|
| 999 |
+
693,
|
| 1000 |
+
321,
|
| 1001 |
+
710
|
| 1002 |
+
],
|
| 1003 |
+
"page_idx": 8
|
| 1004 |
+
},
|
| 1005 |
+
{
|
| 1006 |
+
"type": "text",
|
| 1007 |
+
"text": "The question of what a model learns is a fundamental problem that has been approached from several directions. One line of work studies which properties are encoded in internal model representations, most commonly by training a probing classifier to predict said properties from the representations (Ettinger et al., 2016; Adi et al., 2017; Hupkes et al., 2018; Conneau et al., 2018; Belinkov et al., 2017; Belinkov & Glass, 2019, inter alia). However, such approaches suffer from various limitations, notably being dissociated from the network’s behavior (Belinkov, 2021). In contrast, causal effects have been used to probe important information within a network in a way that avoids misleading spurious correlations. Vig et al. (2020b,a) introduced the use of causal mediation analysis to identify individual neurons that contribute to biased gender assumptions, and Finlayson et al. (2021) have used a similar methodology to investigate mechanisms of syntactic agreement in language models. Feder et al. (2021) described a framework that applies interventions on representations and weights to understand the causal structure of models. Elazar et al. (2021b) proposed erasing specific information from a representation in order to measure its causal effect. Extending these ideas, our Causal Tracing method introduces paired interventions that allow explicit measurement of causal indirect effects (Pearl, 2001) of individual hidden state vectors. ",
|
| 1008 |
+
"bbox": [
|
| 1009 |
+
174,
|
| 1010 |
+
731,
|
| 1011 |
+
825,
|
| 1012 |
+
911
|
| 1013 |
+
],
|
| 1014 |
+
"page_idx": 8
|
| 1015 |
+
},
|
| 1016 |
+
{
|
| 1017 |
+
"type": "text",
|
| 1018 |
+
"text": "",
|
| 1019 |
+
"bbox": [
|
| 1020 |
+
174,
|
| 1021 |
+
92,
|
| 1022 |
+
823,
|
| 1023 |
+
118
|
| 1024 |
+
],
|
| 1025 |
+
"page_idx": 9
|
| 1026 |
+
},
|
| 1027 |
+
{
|
| 1028 |
+
"type": "text",
|
| 1029 |
+
"text": "Another line of work aims to assess the knowledge within LMs by evaluating whether the model predict pieces of knowledge. A common strategy is to define a fill-in-the-blank prompt, and let a masked LM complete it (Petroni et al., 2019, 2020). Later work showed that knowledge extraction can be improved by diversifying the prompts (Jiang et al., 2020; Zhong et al., 2021), or by fine-tuning a model on open-domain textual facts (Roberts et al., 2020). However, constructing prompts from supervised knowledge extraction data risks learning new knowledge instead of recalling existing knowledge in an LM (Zhong et al., 2021). More recently, Elazar et al. (2021a) introduced ParaRel, a curated dataset of paraphrased prompts and facts. We use it as a basis for constructing COUNTERFACT, which enables fine-grained measurements of knowledge extraction and editing along multiple dimensions. Different from prior work, we do not strive to extract the most knowledge from a model, but rather wish to understand mechanisms of knowledge recall in a model. ",
|
| 1030 |
+
"bbox": [
|
| 1031 |
+
174,
|
| 1032 |
+
126,
|
| 1033 |
+
825,
|
| 1034 |
+
277
|
| 1035 |
+
],
|
| 1036 |
+
"page_idx": 9
|
| 1037 |
+
},
|
| 1038 |
+
{
|
| 1039 |
+
"type": "text",
|
| 1040 |
+
"text": "Finally, a few studies aim to localize and modify the computation of knowledge within transformers. Geva et al. (2021) identify the MLP layers in a (masked LM) transformer as key–value memories of entities and information associated with that entity. Building on this finding, Dai et al. (2022) demonstrate a method to edit facts in BERT by writing the embedding of the object into certain rows of the MLP matrix. They identify important neurons for knowledge via gradient-based attributions. De Cao et al. (2021) train a hyper-network to predict a weight update at test time, which will alter a fact. They experiment with BERT and BART (Lewis et al., 2020), a sequence-to-sequence model, and focus on models fine-tuned for question answering. Mitchell et al. (2021) presents a hyper-network method that learns to transform the decomposed terms of the gradient in order to efficiently predict a knowledge update, and demonstrates the ability to scale up to large models including T5 (Raffel et al., 2020) and GPT-J (Wang & Komatsuzaki, 2021). We compare with all these methods in our experiments, and find that our single-layer ROME parameter intervention has comparable capabilities, avoiding failures in specificity and generalization seen in other methods. ",
|
| 1041 |
+
"bbox": [
|
| 1042 |
+
174,
|
| 1043 |
+
284,
|
| 1044 |
+
825,
|
| 1045 |
+
464
|
| 1046 |
+
],
|
| 1047 |
+
"page_idx": 9
|
| 1048 |
+
},
|
| 1049 |
+
{
|
| 1050 |
+
"type": "text",
|
| 1051 |
+
"text": "5 Conclusion ",
|
| 1052 |
+
"text_level": 1,
|
| 1053 |
+
"bbox": [
|
| 1054 |
+
174,
|
| 1055 |
+
483,
|
| 1056 |
+
297,
|
| 1057 |
+
500
|
| 1058 |
+
],
|
| 1059 |
+
"page_idx": 9
|
| 1060 |
+
},
|
| 1061 |
+
{
|
| 1062 |
+
"type": "text",
|
| 1063 |
+
"text": "We have clarified information flow during knowledge recall in autoregressive transformers, and we have exploited this understanding to develop a simple, principled model editor called ROME. Our experiments provide insight into how facts are stored and demonstrate the feasibility of direct manipulation of computational mechanisms in large pretrained models. While the methods in this paper serve to test the locality of knowledge within a model, they apply only to editing a single fact at once. Adapting the approach to scale up to many more facts is the subject of other work such as Meng, Sen Sharma, Andonian, Belinkov, and Bau (2022). ",
|
| 1064 |
+
"bbox": [
|
| 1065 |
+
174,
|
| 1066 |
+
516,
|
| 1067 |
+
825,
|
| 1068 |
+
613
|
| 1069 |
+
],
|
| 1070 |
+
"page_idx": 9
|
| 1071 |
+
},
|
| 1072 |
+
{
|
| 1073 |
+
"type": "text",
|
| 1074 |
+
"text": "Code, interactive notebooks, dataset, benchmarks, and further visualizations are open-sourced at https://rome.baulab.info. ",
|
| 1075 |
+
"bbox": [
|
| 1076 |
+
174,
|
| 1077 |
+
619,
|
| 1078 |
+
821,
|
| 1079 |
+
647
|
| 1080 |
+
],
|
| 1081 |
+
"page_idx": 9
|
| 1082 |
+
},
|
| 1083 |
+
{
|
| 1084 |
+
"type": "text",
|
| 1085 |
+
"text": "6 Ethical Considerations ",
|
| 1086 |
+
"text_level": 1,
|
| 1087 |
+
"bbox": [
|
| 1088 |
+
174,
|
| 1089 |
+
667,
|
| 1090 |
+
397,
|
| 1091 |
+
684
|
| 1092 |
+
],
|
| 1093 |
+
"page_idx": 9
|
| 1094 |
+
},
|
| 1095 |
+
{
|
| 1096 |
+
"type": "text",
|
| 1097 |
+
"text": "By explaining large autoregressive transformer language models’ internal organization and developing a fast method for modifying stored knowledge, our work potentially improves the transparency of these systems and reduces the energy consumed to correct their errors. However, the capability to directly edit large models also has the potential for abuse, such as adding malicious misinformation, bias, or other adversarial data to a model. Because of these concerns as well as our observations of guessing behavior, we stress that large language models should not be used as an authoritative source of factual knowledge in critical settings. ",
|
| 1098 |
+
"bbox": [
|
| 1099 |
+
174,
|
| 1100 |
+
700,
|
| 1101 |
+
825,
|
| 1102 |
+
790
|
| 1103 |
+
],
|
| 1104 |
+
"page_idx": 9
|
| 1105 |
+
},
|
| 1106 |
+
{
|
| 1107 |
+
"type": "text",
|
| 1108 |
+
"text": "Acknowledgements ",
|
| 1109 |
+
"text_level": 1,
|
| 1110 |
+
"bbox": [
|
| 1111 |
+
176,
|
| 1112 |
+
809,
|
| 1113 |
+
338,
|
| 1114 |
+
827
|
| 1115 |
+
],
|
| 1116 |
+
"page_idx": 9
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"type": "text",
|
| 1120 |
+
"text": "We are grateful to Antonio Torralba, Martin Wattenberg, and Bill Ferguson, whose insightful discussions, financial support, and encouragement enabled this project. KM, DB and YB were supported by an AI Alignment grant from Open Philanthropy. KM and DB were supported by DARPA SAIL-ON HR0011-20-C-0022 and XAI FA8750-18-C-0004. YB was supported by the ISRAEL SCIENCE FOUNDATION (grant No. 448/20) and an Azrieli Foundation Early Career Faculty Fellowship. ",
|
| 1121 |
+
"bbox": [
|
| 1122 |
+
174,
|
| 1123 |
+
842,
|
| 1124 |
+
825,
|
| 1125 |
+
911
|
| 1126 |
+
],
|
| 1127 |
+
"page_idx": 9
|
| 1128 |
+
},
|
| 1129 |
+
{
|
| 1130 |
+
"type": "text",
|
| 1131 |
+
"text": "",
|
| 1132 |
+
"text_level": 1,
|
| 1133 |
+
"bbox": [
|
| 1134 |
+
174,
|
| 1135 |
+
90,
|
| 1136 |
+
267,
|
| 1137 |
+
106
|
| 1138 |
+
],
|
| 1139 |
+
"page_idx": 10
|
| 1140 |
+
},
|
| 1141 |
+
{
|
| 1142 |
+
"type": "text",
|
| 1143 |
+
"text": "References \nAdi, Y., Kermany, E., Belinkov, Y., Lavi, O., and Goldberg, Y. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In International Conference on Learning Representations (ICLR), April 2017. \nAnderson, J. A. A simple neural network generating an interactive memory. Mathematical biosciences, 14(3-4):197–220, 1972. \nBau, D., Liu, S., Wang, T., Zhu, J.-Y., and Torralba, A. Rewriting a deep generative model. In Proceedings of the European Conference on Computer Vision (ECCV), 2020. \nBelinkov, Y. Probing Classifiers: Promises, Shortcomings, and Advances. Computational Linguistics, pp. 1–13, 11 2021. ISSN 0891-2017. doi: 10.1162/coli a 00422. URL https://doi.org/10. 1162/coli_a_00422. \nBelinkov, Y. and Glass, J. Analysis methods in neural language processing: A survey. Transactions of the Association for Computational Linguistics, 7:49–72, March 2019. doi: 10.1162/tacl a 00254. URL https://aclanthology.org/Q19-1004. \nBelinkov, Y., Durrani, N., Dalvi, F., Sajjad, H., and Glass, J. What do neural machine translation models learn about morphology? In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 861–872, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1080. URL https: //aclanthology.org/P17-1080. \nBrown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/ 2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf. \nConneau, A., Kruszewski, G., Lample, G., Barrault, L., and Baroni, M. What you can cram into a single \\$&!#\\* vector: Probing sentence embeddings for linguistic properties. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2126–2136, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1198. URL https://aclanthology.org/P18-1198. \nDai, D., Dong, L., Hao, Y., Sui, Z., Chang, B., and Wei, F. Knowledge neurons in pretrained transformers. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8493–8502, 2022. \nDe Cao, N., Aziz, W., and Titov, I. Editing factual knowledge in language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6491–6506, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.emnlp-main.522. \nDevlin, J., Chang, M.-W., Lee, K., and Toutanova, K. 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. \nElazar, Y., Kassner, N., Ravfogel, S., Ravichander, A., Hovy, E., Schutze, H., and Goldberg, Y. ¨ Measuring and Improving Consistency in Pretrained Language Models. Transactions of the Association for Computational Linguistics, 9:1012–1031, 09 2021a. ISSN 2307-387X. doi: 10.1162/tacl a 00410. URL https://doi.org/10.1162/tacl_a_00410. \nElazar, Y., Ravfogel, S., Jacovi, A., and Goldberg, Y. Amnesic probing: Behavioral explanation with amnesic counterfactuals. Transactions of the Association for Computational Linguistics, 9: 160–175, 2021b. \nElhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph, N., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., DasSarma, N., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Jones, A., Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S., and Olah, C. A mathematical framework for transformer circuits. https: //transformer-circuits.pub/2021/framework/index.html, December 2021. \nEttinger, A., Elgohary, A., and Resnik, P. Probing for semantic evidence of composition by means of simple classification tasks. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pp. 134–139, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/W16-2524. URL https://aclanthology.org/W16-2524. \nFeder, A., Oved, N., Shalit, U., and Reichart, R. CausaLM: Causal model explanation through counterfactual language models. Computational Linguistics, 47(2):333–386, 2021. \nFinlayson, M., Mueller, A., Gehrmann, S., Shieber, S., Linzen, T., and Belinkov, Y. Causal analysis of syntactic agreement mechanisms in neural language models. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1828–1843, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.144. URL https://aclanthology.org/2021.acl-long.144. \nGeva, M., Schuster, R., Berant, J., and Levy, O. Transformer feed-forward layers are key-value memories. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 5484–5495, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.emnlp-main.446. \nHase, P., Diab, M., Celikyilmaz, A., Li, X., Kozareva, Z., Stoyanov, V., Bansal, M., and Iyer, S. Do language models have beliefs? methods for detecting, updating, and visualizing model beliefs. arXiv preprint arXiv:2111.13654, 2021. \nHupkes, D., Veldhoen, S., and Zuidema, W. Visualisation and ’diagnostic classifiers’ reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61:907–926, 2018. \nJiang, Z., Xu, F. F., Araki, J., and Neubig, G. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423–438, 2020. doi: 10.1162/ tacl a 00324. URL https://aclanthology.org/2020.tacl-1.28. \nKingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In Bengio, Y. and LeCun, Y. (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412. 6980. \nKohonen, T. Correlation matrix memories. IEEE transactions on computers, 100(4):353–359, 1972. \nLevy, O., Seo, M., Choi, E., and Zettlemoyer, L. Zero-shot relation extraction via reading comprehension. In Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017), pp. 333–342, Vancouver, Canada, August 2017. Association for Computational Linguistics. doi: 10.18653/v1/K17-1034. URL https://aclanthology.org/K17-1034. \nLewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., and Zettlemoyer, L. 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, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https: //aclanthology.org/2020.acl-main.703. \nMeng, K., Sen Sharma, A., Andonian, A., Belinkov, Y., and Bau, D. Mass-editing memory in a transformer. arXiv preprint arXiv:2210.07229, 2022. \nMitchell, E., Lin, C., Bosselut, A., Finn, C., and Manning, C. D. Fast model editing at scale. In International Conference on Learning Representations, 2021. \nPearl, J. Direct and indirect effects. In Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 411–420, 2001. \nPearl, J. Causality: Models, Reasoning and Inference. Cambridge University Press, USA, 2nd edition, 2009. ISBN 052189560X. \nPetroni, F., Rocktaschel, T., Riedel, S., Lewis, P., Bakhtin, A., Wu, Y., and Miller, A. Language ¨ models as knowledge bases? 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. 2463–2473, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1250. URL https://aclanthology. org/D19-1250. \nPetroni, F., Lewis, P., Piktus, A., Rocktaschel, T., Wu, Y., Miller, A. H., and Riedel, S. How context ¨ affects language models’ factual predictions. In Automated Knowledge Base Construction, 2020. \nRadford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, pp. 9, 2019. \nRaffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020. \nRoberts, A., Raffel, C., and Shazeer, N. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5418–5426, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.437. URL https: //aclanthology.org/2020.emnlp-main.437. \nSundararajan, M., Taly, A., and Yan, Q. Axiomatic attribution for deep networks. In International conference on machine learning, pp. 3319–3328. PMLR, 2017. \nVaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017. \nVig, J., Gehrmann, S., Belinkov, Y., Qian, S., Nevo, D., Sakenis, S., Huang, J., Singer, Y., and Shieber, S. Causal mediation analysis for interpreting neural NLP: The case of gender bias. arXiv preprint arXiv:2004.12265, 2020a. \nVig, J., Gehrmann, S., Belinkov, Y., Qian, S., Nevo, D., Singer, Y., and Shieber, S. M. Investigating gender bias in language models using causal mediation analysis. In NeurIPS, 2020b. \nWang, B. and Komatsuzaki, A. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. \nZhang, Y., Galley, M., Gao, J., Gan, Z., Li, X., Brockett, C., and Dolan, W. B. Generating informative and diverse conversational responses via adversarial information maximization. In NeurIPS, 2018. \nZhao, S., Pascual, D., Brunner, G., and Wattenhofer, R. Of non-linearity and commutativity in BERT. In 2021 International Joint Conference on Neural Networks (IJCNN), pp. 1–8. IEEE, 2021. \nZhong, Z., Friedman, D., and Chen, D. Factual probing is [MASK]: Learning vs. learning to recall. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 5017–5033, Online, June 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.398. URL https://aclanthology.org/2021.naacl-main.398. \nZhu, C., Rawat, A. S., Zaheer, M., Bhojanapalli, S., Li, D., Yu, F., and Kumar, S. Modifying memories in transformer models. arXiv preprint arXiv:2012.00363, 2020. ",
|
| 1144 |
+
"bbox": [
|
| 1145 |
+
169,
|
| 1146 |
+
94,
|
| 1147 |
+
828,
|
| 1148 |
+
921
|
| 1149 |
+
],
|
| 1150 |
+
"page_idx": 10
|
| 1151 |
+
},
|
| 1152 |
+
{
|
| 1153 |
+
"type": "text",
|
| 1154 |
+
"text": "",
|
| 1155 |
+
"bbox": [
|
| 1156 |
+
169,
|
| 1157 |
+
90,
|
| 1158 |
+
828,
|
| 1159 |
+
917
|
| 1160 |
+
],
|
| 1161 |
+
"page_idx": 11
|
| 1162 |
+
},
|
| 1163 |
+
{
|
| 1164 |
+
"type": "text",
|
| 1165 |
+
"text": "",
|
| 1166 |
+
"bbox": [
|
| 1167 |
+
168,
|
| 1168 |
+
60,
|
| 1169 |
+
828,
|
| 1170 |
+
904
|
| 1171 |
+
],
|
| 1172 |
+
"page_idx": 12
|
| 1173 |
+
},
|
| 1174 |
+
{
|
| 1175 |
+
"type": "text",
|
| 1176 |
+
"text": "Checklist ",
|
| 1177 |
+
"text_level": 1,
|
| 1178 |
+
"bbox": [
|
| 1179 |
+
174,
|
| 1180 |
+
89,
|
| 1181 |
+
254,
|
| 1182 |
+
106
|
| 1183 |
+
],
|
| 1184 |
+
"page_idx": 13
|
| 1185 |
+
},
|
| 1186 |
+
{
|
| 1187 |
+
"type": "text",
|
| 1188 |
+
"text": "1. For all authors... ",
|
| 1189 |
+
"bbox": [
|
| 1190 |
+
214,
|
| 1191 |
+
125,
|
| 1192 |
+
339,
|
| 1193 |
+
138
|
| 1194 |
+
],
|
| 1195 |
+
"page_idx": 13
|
| 1196 |
+
},
|
| 1197 |
+
{
|
| 1198 |
+
"type": "text",
|
| 1199 |
+
"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] ",
|
| 1200 |
+
"bbox": [
|
| 1201 |
+
238,
|
| 1202 |
+
143,
|
| 1203 |
+
825,
|
| 1204 |
+
236
|
| 1205 |
+
],
|
| 1206 |
+
"page_idx": 13
|
| 1207 |
+
},
|
| 1208 |
+
{
|
| 1209 |
+
"type": "text",
|
| 1210 |
+
"text": "2. If you are including theoretical results... ",
|
| 1211 |
+
"bbox": [
|
| 1212 |
+
214,
|
| 1213 |
+
239,
|
| 1214 |
+
493,
|
| 1215 |
+
253
|
| 1216 |
+
],
|
| 1217 |
+
"page_idx": 13
|
| 1218 |
+
},
|
| 1219 |
+
{
|
| 1220 |
+
"type": "text",
|
| 1221 |
+
"text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] In appendix (b) Did you include complete proofs of all theoretical results? [Yes] In appendix ",
|
| 1222 |
+
"bbox": [
|
| 1223 |
+
236,
|
| 1224 |
+
257,
|
| 1225 |
+
816,
|
| 1226 |
+
289
|
| 1227 |
+
],
|
| 1228 |
+
"page_idx": 13
|
| 1229 |
+
},
|
| 1230 |
+
{
|
| 1231 |
+
"type": "text",
|
| 1232 |
+
"text": "3. If you ran experiments... ",
|
| 1233 |
+
"bbox": [
|
| 1234 |
+
214,
|
| 1235 |
+
292,
|
| 1236 |
+
393,
|
| 1237 |
+
308
|
| 1238 |
+
],
|
| 1239 |
+
"page_idx": 13
|
| 1240 |
+
},
|
| 1241 |
+
{
|
| 1242 |
+
"type": "text",
|
| 1243 |
+
"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] In supplemental materials \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In appendix \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] In appendix ",
|
| 1244 |
+
"bbox": [
|
| 1245 |
+
238,
|
| 1246 |
+
311,
|
| 1247 |
+
825,
|
| 1248 |
+
444
|
| 1249 |
+
],
|
| 1250 |
+
"page_idx": 13
|
| 1251 |
+
},
|
| 1252 |
+
{
|
| 1253 |
+
"type": "text",
|
| 1254 |
+
"text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
|
| 1255 |
+
"bbox": [
|
| 1256 |
+
210,
|
| 1257 |
+
448,
|
| 1258 |
+
823,
|
| 1259 |
+
463
|
| 1260 |
+
],
|
| 1261 |
+
"page_idx": 13
|
| 1262 |
+
},
|
| 1263 |
+
{
|
| 1264 |
+
"type": "text",
|
| 1265 |
+
"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] In appendix \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Supplemental materials \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] In appendix \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] In appendix ",
|
| 1266 |
+
"bbox": [
|
| 1267 |
+
238,
|
| 1268 |
+
467,
|
| 1269 |
+
825,
|
| 1270 |
+
588
|
| 1271 |
+
],
|
| 1272 |
+
"page_idx": 13
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"type": "text",
|
| 1276 |
+
"text": "5. If you used crowdsourcing or conducted research with human subjects... ",
|
| 1277 |
+
"bbox": [
|
| 1278 |
+
215,
|
| 1279 |
+
592,
|
| 1280 |
+
704,
|
| 1281 |
+
606
|
| 1282 |
+
],
|
| 1283 |
+
"page_idx": 13
|
| 1284 |
+
},
|
| 1285 |
+
{
|
| 1286 |
+
"type": "text",
|
| 1287 |
+
"text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [Yes] In appendix \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [Yes] In appendix \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [Yes] In appendix ",
|
| 1288 |
+
"bbox": [
|
| 1289 |
+
238,
|
| 1290 |
+
611,
|
| 1291 |
+
825,
|
| 1292 |
+
700
|
| 1293 |
+
],
|
| 1294 |
+
"page_idx": 13
|
| 1295 |
+
}
|
| 1296 |
+
]
|
parse/dev/-h6WAS6eE4/-h6WAS6eE4_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/-h6WAS6eE4/-h6WAS6eE4_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/QYvFUlF19n/QYvFUlF19n.md
ADDED
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# In-Context Learning Creates Task Vectors
|
| 2 |
+
|
| 3 |
+
Roee Hendel Tel Aviv University roee.hendel@mail.tau.ac.il
|
| 4 |
+
|
| 5 |
+
Mor Geva Google DeepMind pipek@google.com
|
| 6 |
+
|
| 7 |
+
Amir Globerson Tel Aviv University, Google gamir@tauex.tau.ac.il
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
In-context learning (ICL) in Large Language Models (LLMs) has emerged as a powerful new learning paradigm. However, its underlying mechanism is still not well understood. In particular, it is challenging to map it to the “standard” machine learning framework, where one uses a training set $S$ to find a best-fitting function $f ( x )$ in some hypothesis class. Here we make progress on this problem by showing that the functions learned by ICL often have a very simple structure: they correspond to the transformer LLM whose only inputs are the query $x$ and a single “task vector” calculated from the training set. Thus, ICL can be seen as compressing $S$ into a single task vector $\pmb \theta ( S )$ and then using this task vector to modulate the transformer to produce the output. We support the above claim via comprehensive experiments across a range of models and tasks.1
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Large language models have improved dramatically over the last several years. One striking property of these models is that they can learn new rules from very few demonstrations. For instance, a model can be prompted with the input $\ddot { \bf \Phi } ^ { \prime \prime } A p p l e R e d _ { \mathrm { \tiny { + } } }$ , Lime Green, $C o r n ^ { \prime \prime }$ and produce the output “Yellow”. The model has thus learned a mapping based on just two examples, which it can apply correctly to new examples. This capability, referred to as InContext Learning (ICL), has been used extensively, yielding impressive empirical results (Brown et al., 2020; Liu et al., 2023; Dong et al., 2022).
|
| 16 |
+
|
| 17 |
+
Given this success, it is natural to ask what is the underlying mechanism behind ICL. Namely, how does the model internally use the demonstrations $S$ and the query $x$ to produce the required output? Here we approach this question by utilizing the concept of a hypothesis class from statistical learning theory (Shalev-Shwartz and Ben-David, 2014). In the learning-theoretic formulation, one typically considers a hypothesis class $\mathcal { H }$ , where every element of $\mathcal { H }$ is a function $h ( x ; \pmb \theta )$ , operating on the input $x$ , and specified by a parameter vector $\pmb \theta$ . For example, if $\boldsymbol { x } \in \mathbb { R } ^ { d }$ then the class $\mathcal { H }$ could be the set of linear classifiers, defined by a coefficient vector $\pmb \theta$ as $h ( x ; \pmb \theta ) = \pmb \theta \cdot \boldsymbol x$ . Learning algorithms seek an element $h \in \mathcal H$ that fits the training set well. This is known as Empirical Risk Minimization.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: ICL as learning in a Hypothesis Class. In ICL, one provides an LLM with a prompt including demonstrations $S$ of some task, and a query $x$ . The model generates the output for $x$ (here “Yellow”). We show that the underlying process can be broken down into two parts: $\mathcal { A }$ , a “learning algorithm” (marked in blue), computes a query-agnostic vector $\pmb \theta ( S )$ , which we view as a parameter of a function in a hypothesis class. The second part, denoted by $f$ and marked in yellow, is the application of the rule defined by $\pmb \theta$ on the query $x$ , without direct dependence on $S$ .
|
| 21 |
+
|
| 22 |
+
It is unclear whether ICL operates in such a way because the prediction is performed via $T ( [ S , x ] )$ , where $T$ is typically an auto-regressive transformer and $[ S , x ]$ is a concatenation of the tokens in $S$ and $x$ . Thus, in the general case, it can be an arbitrary function that operates on $S$ and $x$ to produce the output. This can include “non-parametric” methods such as nearest-neighbor. Recent work has begun to explore this question. For example, it was shown that when training a transformer from scratch to perform linear regression in context, the emerging learning algorithm is similar to Stochastic Gradient Descent (Akyürek et al., 2022; von Oswald et al., 2022). However, for LLMs performing more complex natural language tasks, it is not at all clear what the hypothesis space may be.
|
| 23 |
+
|
| 24 |
+
In this work, we show that on a wide range of tasks, ICL in LLMs can be viewed as working on a very natural hypothesis space. We argue that, given a training set $S$ , the transformer maps it into a “task vector” $\pmb \theta ( S )$ that essentially represents the mapping/rule described in $S$ .2 Namely, given the transformer $T$ and a vector $\pmb \theta$ , we can construct a new function $f ( x ; \pmb \theta )$ that implements the task. The function $f$ is very similar to the original transformer applied to $x$ without demonstrations but instead modulated by $\pmb \theta$ (see Fig. 2).
|
| 25 |
+
|
| 26 |
+
Our view is also related to soft prompts (Lester et al., 2021), since both approaches modulate the function of the transformer towards a particular task. However, in ICL, task vectors are calculated in the forward pass rather than being fine-tuned.
|
| 27 |
+
|
| 28 |
+
Our contributions include proposing a hypothesis-class based mechanistic view of ICL, and conducting experiments to validate our view on a range of publicly available LLMs and a diverse set of tasks. Our results further the understanding of ICL and may have practical implications for the efficient adaptation of LLMs to perform specific tasks.
|
| 29 |
+
|
| 30 |
+
# 2 A Hypothesis Class View of ICL
|
| 31 |
+
|
| 32 |
+
Motivated by the hypothesis class view of learning theory, our goal is to understand if ICL maps the set of demonstrations $S$ to a function on the query $x$ and how this mapping occurs. Specifically, we seek to see if ICL converts $S$ into $\pmb \theta$ - the “parameters” of a function within a certain hypothesis space. Our empirical findings suggest this view is applicable, shedding light on the structure of the hypothesis space on which ICL can be viewed to operate.
|
| 33 |
+
|
| 34 |
+
# 2.1 Theoretical Framework
|
| 35 |
+
|
| 36 |
+
We use $T$ to denote a decoder-only transformer LLM, $S$ to denote the set of demonstrations (i.e. training examples) used as input to ICL, and $x$ to denote the query that ICL is asked to provide an output for. We use $T ( [ S , x ] )$ to denote the output of ICL on the concatenation of $S$ and $x$ .
|
| 37 |
+
|
| 38 |
+
To demonstrate that ICL operates within a hypothesis space, we aim to show that its underlying mechanism can be broken down into two parts:
|
| 39 |
+
|
| 40 |
+
• A “Learning Algorithm” (denoted by $\mathcal { A }$ ) that maps $S$ into a “task vector” $\underline { { \pmb \theta } }$ , independent of the query $x$ . Given that attention layers can access both $S$ and $x$ , this independence is not trivial. • A “Rule Application” (denoted by $f$ ) which maps the query $x$ to the output, based on $\theta \equiv$ $A ( S )$ , without direct dependence on $S$ . Again, this independence is not trivial.
|
| 41 |
+
|
| 42 |
+
Thus, we consider the following mapping from a set of demonstrations and a query to the predicted output: $T ( [ S , x ] ) = f ( x ; \mathcal { A } ( S ) )$ .
|
| 43 |
+
|
| 44 |
+
If we can break down the forward pass of the LLM into the above two components, we can view ICL as operating on the following hypothesis class: $\mathcal { H } = \{ f ( \cdot ; \pmb { \theta } ) \mid \pmb { \theta } \}$ . In the next section we propose an implementation of such a class.
|
| 45 |
+
|
| 46 |
+
# 2.2 A Proposed Hypothesis Class
|
| 47 |
+
|
| 48 |
+
There are many possible realizations of the above framework, that correspond to different choices of $\mathcal { A }$ and $f$ . We next describe the realization we focus on, which naturally follows from the transformer architecture. We consider an ICL setting as in Fig. 1, where the input ends with a query $x$ (i.e., Corn) followed by an $\ " \ "$ symbol. As mentioned above, we view learning as composed of two steps: calculating a parameter vector $\pmb \theta$ based on the training sample $S$ , and applying the rule defined by this parameter vector to the query $x$ . A presumably simple way for a transformer to do this is for the first $L$ layers of the representations to calculate $\pmb \theta$ and then for the remaining layers to take $\pmb \theta$ and $x$ as input and produce an output. See Fig. 1. Recall that $S$ and $x$ are accessible to the transformer at any layer, presenting a challenge with our view.
|
| 49 |
+
|
| 50 |
+
In the following sections, we address this challenge and present experiments validating our view. Namely, we show that we can isolate our proposed $\mathcal { A }$ and $f$ in the forward pass of LLMs performing ICL. We also show that the $\pmb \theta$ vectors are interpretable and correspond to learned tasks.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Separating $\mathcal { A }$ and $f$ . To make $\pmb { \theta }$ independent of the query $x$ , we use a dummy query $( x ^ { \prime } = { \mathsf { P l u m } } )$ and use the representation of at the $L ^ { t h }$ layer as $\pmb { \theta }$ The vector $\pmb { \theta }$ is then patched at the same layer during a forward pass of a transformer that only takes $x$ and as input, to prevent the direct dependence of $f$ on $S$ .
|
| 54 |
+
|
| 55 |
+
# 3 Validity of the Hypothesis Class View
|
| 56 |
+
|
| 57 |
+
We first show that separating the forward pass into the two distinct components $\mathcal { A }$ and $f$ , defined in $\ S 2 . 2$ , maintains the high accuracy of ICL.
|
| 58 |
+
|
| 59 |
+
# 3.1 Separating $\mathcal { A }$ and $f$
|
| 60 |
+
|
| 61 |
+
We face some challenges in a regular forward pass: first, the initial $L$ layers that correspond to $\mathcal { A }$ , updating the representations of to create $\pmb \theta$ , can attend to the query $x$ . Thus, they may depend on $x$ creating an unwanted dependence of $\pmb \theta$ on $x$ . Second, the remaining layers that correspond to $f$ , may directly access $S$ , instead of using only $x$ and $\pmb \theta$ .
|
| 62 |
+
|
| 63 |
+
We propose the following procedure to tackle these challenges: to solve the first problem, we introduce a “dummy query” $x ^ { \prime }$ and calculate the representations of using that query. We use the representation of after the first $L$ layers, calculated using $x ^ { \prime }$ , as the vector $\pmb \theta$ (as demonstrated on the left side of Fig. 2). An alternative was to block attention to $x$ , but it led to poor performance. To solve the second problem of calculating $f ( x , \pmb \theta )$ without allowing direct dependence on $S$ , we perform a forward pass of the transformer only on $x$ and ,3 and “patch” the $\pmb \theta$ we previously extracted at the $L$ th layer of the (right side of Fig. 2).4
|
| 64 |
+
|
| 65 |
+
Table 1: A representative subset of the tasks used in the study with input output examples.
|
| 66 |
+
|
| 67 |
+
<table><tr><td>Category</td><td>Task</td><td>Example</td></tr><tr><td rowspan="4">Algorithmic</td><td>Next letter</td><td>a→b</td></tr><tr><td>List first</td><td>a,b,c→a</td></tr><tr><td>List last</td><td>a,b,c →c</td></tr><tr><td>To uppercase</td><td>a→A</td></tr><tr><td>Translation</td><td>French to English Spanish to English</td><td>bonjour → hello hola →hello</td></tr><tr><td rowspan="2">Linguistic</td><td>Present to gerund</td><td>go →going</td></tr><tr><td>Singular to plural Antonyms</td><td>cat →cats</td></tr><tr><td rowspan="2">Knowledge</td><td></td><td>happy →sad</td></tr><tr><td>Country to Capital Person to Language</td><td>France→Paris Macron→French</td></tr></table>
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: Accuracy for each choice of the intermediate layer $L$ , averaged across all tasks. Solid lines show average values, and shaded areas standard deviations.
|
| 71 |
+
|
| 72 |
+
# 3.2 Tasks and Models
|
| 73 |
+
|
| 74 |
+
Tasks We consider a diverse set of 18 tasks across 4 categories: algorithmic, translation, linguistic, and factual knowledge. For simplicity, we limit ourselves to single-token outputs. A representative subset of the tasks is described in Tab. 1. A complete detailed table, as well as more information regarding the data, are provided in $\ S$ A.1.
|
| 75 |
+
|
| 76 |
+
Models We use multiple open LLMs: LLaMA 7B, 13B, and 30B (Touvron et al., 2023), GPT-J 6B (Wang and Komatsuzaki, 2021), and Pythia 2.8B, 6.9B, and 12B (Biderman et al., 2023).
|
| 77 |
+
|
| 78 |
+
# 3.3 Finding $L$
|
| 79 |
+
|
| 80 |
+
The mechanism we described in $\ S 2 . 2$ has a free parameter - the layer $L$ where $\mathcal { A }$ ends and $f$ begins. We use the proposed $( A , f )$ implementation for different choices of $L$ and evaluate the accuracy on a development set to find the best layer.
|
| 81 |
+
|
| 82 |
+
Fig. 3 shows the accuracy on the development set, for different choices of $L$ . We focus here on the LLaMA models and include the rest in $\ S \ A . 2$ . Interestingly, all models exhibit a performance peak at a similar intermediate layer, irrespective of their parameters and layer count differences.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 4: Average accuracy across all tasks for each model, using each of the three procedures: Baseline, Regular and Hypothesis.
|
| 86 |
+
|
| 87 |
+
# 3.4 Accuracy of Hypothesis Based Prediction
|
| 88 |
+
|
| 89 |
+
We next compare the accuracy of the $( A , f )$ mechanism to that of a regular forward pass performing ICL. For each model and task, we evaluate the following three procedures:
|
| 90 |
+
|
| 91 |
+
• Regular An application of the LLM to the demonstrations $S$ and query $x$ . Namely $T ( [ S , x ] )$ , as in regular ICL. • Hypothesis Our proposed procedure from $\ S \ 3 . 1$ where $\mathcal { A }$ generates $\pmb \theta$ using a dummy $x ^ { \prime }$ , and $f ( \cdot ; \pmb \theta )$ is applied to $x$ by running the transformer on $[ x , ]$ with $\pmb \theta$ patched at layer $L$ of . • Baseline A forward pass of the LLM only on $x$ without demonstrations $S$ . That is, $T ( [ x , ] )$ . This is the same as the application of $f$ from our separated procedure, but without patching $\pmb \theta$ .
|
| 92 |
+
|
| 93 |
+
Fig. 4 shows the average accuracy across all tasks of these 3 procedures, for each model. Full results are reported in Tab. 6 in $\ S \ A . 2$ . Across all models, our procedure maintains around $80 \%$ of the accuracy of regular ICL, while the baseline reaches only $10 \%$ . This shows that our proposed separation to $\mathcal { A }$ and $f$ provides a good empirical approximation of the process underlying ICL.
|
| 94 |
+
|
| 95 |
+
# 4 Robustness of Task Vectors
|
| 96 |
+
|
| 97 |
+
In our setting, $\pmb \theta$ is derived from $S$ and a dummy query $x ^ { \prime }$ . It is natural to examine the robustness of $\pmb \theta$ to variations in these inputs. Intuitively, if it represents the task, it should remain stable across different $S$ and $x ^ { \prime }$ values.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 5: A t-SNE plot of task vectors. A 2D t-SNE plot visualizing 50 task vectors for each task, each generated from a different choice of $S$ and $x ^ { \prime }$ using LLaMA 7B. Points are color-coded according to the task. Each task can be seen to form its own distinct cluster.
|
| 101 |
+
|
| 102 |
+
To test this, we use LLaMA 7B to generate 50 task vectors per task with varied $S$ and $x ^ { \prime }$ and conduct two analyses.
|
| 103 |
+
|
| 104 |
+
Geometry of $\pmb \theta$ A t-SNE dimensionality reduction (Fig. 5) reveals that the task vectors form distinct clusters, each containing task vectors of a single task. Fig. 9 further shows proximity between tasks of the same category, strengthening the idea that they encapsulate task understanding.
|
| 105 |
+
|
| 106 |
+
Variability of $\pmb \theta$ Fig. 8 shows histograms of distances within and across tasks. It can be seen that vectors within the same task are closer than those between different tasks, indicating that $\pmb \theta$ is stable within tasks and not highly influenced by $x ^ { \prime }$ or $S$ .
|
| 107 |
+
|
| 108 |
+
# 5 Dominance of $\pmb \theta$ Patching
|
| 109 |
+
|
| 110 |
+
In $\ S 3$ we prevented $f$ from directly accessing $S$ . However, in a regular forward pass during ICL, the last token can attend to $S$ . Here we verify that even in this case, $f$ mainly uses the task vector $\pmb \theta$ , without directly accessing the demonstrations $S$ . To this end, we use a pair of tasks, $A$ and $B$ , sharing the input space but differing on the output. We first use a “Regular” forward pass, where we provide the model with demonstrations $S$ for task $A$ (denoted $S _ { A }$ ), to verify the model can perform this task using ICL. Then, we do a “Conflicting” forward pass, still providing $S _ { A }$ , while injecting $\pmb { \theta } _ { B }$ . For more details, refer to Fig. 6 in $\ S \mathrm { A } . 1$ .
|
| 111 |
+
|
| 112 |
+
Table 2: Conflicting tasks experiment results. The model’s accuracy on the relevant task ( $A$ in “Regular” and $B$ in “Conflicting”) is displayed for both scenarios.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Task A(S)</td><td>Task B (0)</td><td>Regular Task A</td><td>Conflicting Task B</td></tr><tr><td>Next Letter</td><td>To Upper</td><td>0.92</td><td>0.77</td></tr><tr><td>List Last</td><td>List First</td><td>0.95</td><td>0.78</td></tr><tr><td>Present to Past</td><td> to Gerund</td><td>0.96</td><td>0.95</td></tr></table>
|
| 115 |
+
|
| 116 |
+
In Tab.2, the “Regular” forward pass shows high accuracy on task $A$ $( 9 0 \% + )$ , as anticipated. However, the “Conflicting” forward pass yields high accuracy on task $B$ , corresponding to the injected task vector $\pmb \theta$ . This implies that the model mainly relies on $\pmb \theta$ , largely disregarding the demonstrations $S$ for task $A$ . We note that the accuracy on task $B$ is slightly low, likely consistent with the performance dip seen in Fig. 6, and potentially further affected by the presence of $S$ .
|
| 117 |
+
|
| 118 |
+
# 6 Interpreting $\pmb \theta$
|
| 119 |
+
|
| 120 |
+
The learned vector $\pmb \theta$ intuitively captures information about the task demonstrated by $S$ . Here we provide evidence supporting this interpretation. Since $\pmb \theta$ is an intermediate hidden state of the transformer, we can employ a vocabulary projection method (nostalgebraist, 2020; Dar et al., 2022). Namely, we examine the top tokens in the distribution over the vocabulary induced by the hidden state.
|
| 121 |
+
|
| 122 |
+
Tab. 3 shows the top tokens for three tasks for LLaMA 13B (more models and tasks are provided in Tab. 7 in $\ S \mathbf { A }$ ). In multiple cases, we observe tokens that directly describe the task. Importantly, these terms never explicitly appeared in the context. For example in the task of translation from French to English, we observe tokens such as “English” and “translate”. This supports our view that $\pmb \theta$ carries significant, non-trivial semantic information about the task.
|
| 123 |
+
|
| 124 |
+
# 7 Related Work
|
| 125 |
+
|
| 126 |
+
Emergence of ICL A key question with ICL is how it emerges as a capability from pre-training the LLMs. Levine et al. (2022) provides results in this direction that highlight the importance of training data structure. Xie et al. use probabilistic analysis and model pre-training data using Hidden Markov Models to theoretically explain the emergence of ICL, while Chan et al. (2022) empirically explore the effect of several distributional properties of the pre-training data.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Task</td><td>Toptokensinthetaskvectorprojection</td></tr><tr><td>Previous Letter</td><td>e,y,unknown,alphabet,preceding,c Cad,zA,dit,bill</td></tr><tr><td>FR-EN</td><td>Mason, gram,immer,Santi,latin, utter,Span,Conc,English,equivalent</td></tr><tr><td>Present Gerund</td><td>cin, thats,gram, Lorenzo, cian, Simple to Isabel,uld,berto,partici,Sah</td></tr><tr><td>Country Capital</td><td>Paris, its,capital, central, Conc, cities, administrative, Los, Madrid, London</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 3: The top 10 tokens in the distribution induced by the task vector, for one task per category.
|
| 131 |
+
|
| 132 |
+
Meta-Learning in Transformers Studies by Akyürek et al. (2022); von Oswald et al. (2022); Garg et al. focus on the meta-learning capabilities of transformers. They typically train models from scratch on elementary tasks such as linear regression, drawing theoretical parallels with algorithms like Gradient Descent and demonstrating how transformers could implement them. A key assumption of these works is a known parameter space within which gradient descent operates. Our work focuses on identifying such a parameter space for LLMs.
|
| 133 |
+
|
| 134 |
+
ICL in LLMs Olsson et al. (2022) identify “induction heads” in transformers as a likely main mechanism of ICL. Dai et al. (2022) provide empirical evidence for the connection of ICL to Gradient Descent in LLMs, focusing on classification tasks. Concurrent work by Merullo et al. (2023) also explores a phenomenon similar to the task vectors we study here, where a single vector can encode learned functions. Our findings are complementary to theirs, and future work could explore the relationship between the two more closely.
|
| 135 |
+
|
| 136 |
+
# 8 Conclusions
|
| 137 |
+
|
| 138 |
+
Through this exploration of ICL in LLMs, we have shed light on a new perspective of ICL learning mechanisms. We have revealed a simple and elegant structure: ICL functions by compressing a given training set into a single task vector, which then guides the transformer to generate appropriate outputs given queries. Our work provides a stepping stone towards understanding how LLMs perform ICL. In light of our findings, future work could focus on understanding how the task vector is constructed as well as how it is used to calculate the output.
|
| 139 |
+
|
| 140 |
+
# Limitations
|
| 141 |
+
|
| 142 |
+
We study relatively simple tasks, whereas ICL can learn to perform more complex tasks, such as solving arithmetic reasoning problems. It remains to be seen if and how the mechanisms we observe here will translate to these cases. E.g., our approach focuses on cases where a single task vector suffices, while more complex ICL cases may require more elaborate parameterization. We also focus on tasks where the output is a single token, while some other tasks require multi-token outputs.
|
| 143 |
+
|
| 144 |
+
Finally, as noted above, we do not provide a mechanistic explanation for how the task vector is formed or how it is used. Namely, we do not explain how the transformer performs these calculations using its parameters.
|
| 145 |
+
|
| 146 |
+
# Acknowledgements
|
| 147 |
+
|
| 148 |
+
This project is funded by the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation program (grant ERC HOLI 819080).
|
| 149 |
+
|
| 150 |
+
# References
|
| 151 |
+
|
| 152 |
+
Ekin Akyürek, Dale Schuurmans, Jacob Andreas, Tengyu Ma, and Denny Zhou. 2022. What learning algorithm is in-context learning? investigations with linear models. arXiv preprint arXiv:2211.15661.
|
| 153 |
+
|
| 154 |
+
Stella Biderman, Hailey Schoelkopf, Quentin Anthony, Herbie Bradley, Kyle O’Brien, Eric Hallahan, Mohammad Aflah Khan, Shivanshu Purohit, USVSN Sai Prashanth, Edward Raff, et al. 2023. Pythia: A suite for analyzing large language models across training and scaling. arXiv preprint arXiv:2304.01373.
|
| 155 |
+
|
| 156 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
|
| 157 |
+
|
| 158 |
+
Qingxiu Dong, Lei Li, Damai Dai, Ce Zheng, Zhiyong Wu, Baobao Chang, Xu Sun, Jingjing Xu, and Zhifang Sui. 2022. A survey for in-context learning. arXiv preprint arXiv:2301.00234.
|
| 159 |
+
|
| 160 |
+
Shivam Garg, Dimitris Tsipras, Percy Liang, and Gregory Valiant. What can transformers learn incontext? a case study of simple function classes. In Advances in Neural Information Processing Systems.
|
| 161 |
+
|
| 162 |
+
Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Ludwig Schmidt, Hannaneh Hajishirzi, and Ali Farhadi. 2023. Editing models with task arithmetic. In The Eleventh International Conference on Learning Representations.
|
| 163 |
+
|
| 164 |
+
Stephanie Chan, Adam Santoro, Andrew Lampinen, Jane Wang, Aaditya Singh, Pierre Richemond, James McClelland, and Felix Hill. 2022. Data distributional properties drive emergent in-context learning in transformers. Advances in Neural Information Processing Systems, 35:18878–18891.
|
| 165 |
+
|
| 166 |
+
Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691.
|
| 167 |
+
|
| 168 |
+
Damai Dai, Yutao Sun, Li Dong, Yaru Hao, Zhifang Sui, and Furu Wei. 2022. Why can gpt learn in-context? language models secretly perform gradient descent as meta optimizers. arXiv preprint arXiv:2212.10559.
|
| 169 |
+
|
| 170 |
+
Yoav Levine, Noam Wies, Daniel Jannai, Dan Navon, Yedid Hoshen, and Amnon Shashua. 2022. The inductive bias of in-context learning: Rethinking pretraining example design. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net.
|
| 171 |
+
|
| 172 |
+
Guy Dar, Mor Geva, Ankit Gupta, and Jonathan Berant. 2022. Analyzing transformers in embedding space. arXiv preprint arXiv:2209.02535.
|
| 173 |
+
|
| 174 |
+
Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. 2023. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys, 55(9):1–35.
|
| 175 |
+
|
| 176 |
+
Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022. Locating and editing factual associations in gpt. Advances in Neural Information Processing Systems, 35:17359–17372.
|
| 177 |
+
|
| 178 |
+
Jack Merullo, Carsten Eickhoff, and Ellie Pavlick. 2023. Language models implement simple word2vec-style vector arithmetic. arXiv preprint arXiv:2305.16130.
|
| 179 |
+
|
| 180 |
+
nostalgebraist. 2020. interpreting gpt: the logit lens. LessWrong.
|
| 181 |
+
|
| 182 |
+
Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, et al. 2022. In-context learning and induction heads. arXiv preprint arXiv:2209.11895.
|
| 183 |
+
|
| 184 |
+
Shai Shalev-Shwartz and Shai Ben-David. 2014. Understanding machine learning: From theory to algorithms. Cambridge university press.
|
| 185 |
+
|
| 186 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
|
| 187 |
+
|
| 188 |
+
Johannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento, Alexander Mordvintsev, Andrey Zhmoginov, and Max Vladymyrov. 2022. Transformers learn in-context by gradient descent. arXiv preprint arXiv:2212.07677.
|
| 189 |
+
|
| 190 |
+
Ben Wang and Aran Komatsuzaki. 2021. GPT-J6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/ mesh-transformer-jax.
|
| 191 |
+
|
| 192 |
+
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.
|
| 193 |
+
|
| 194 |
+
# A Appendix
|
| 195 |
+
|
| 196 |
+
Here we provide additional details and results.
|
| 197 |
+
|
| 198 |
+
# A.1 Additional Details
|
| 199 |
+
|
| 200 |
+
Full Task Descriptions Our study covers 18 tasks in 4 categories: Algorithmic, Translation, Linguistic and Knowledge. A detailed description of all tasks is provided in Tab. 5.
|
| 201 |
+
|
| 202 |
+
Model Details More details on the models used in the study are provided in Tab. 4.
|
| 203 |
+
|
| 204 |
+
Task Data Here we detail the sources of the data for each task. The accompanying GitHub repository contains the data itself as well as the code used to create it.
|
| 205 |
+
|
| 206 |
+
• Algorithmic: Generated programatically. • Translation: For each language pair, the most frequent words in the source language are first retrieved from https://github.com/frekwencja/ most-common-words-multilingual and are then translated to the destination language using the open-source package nltk. • Linguistic: The data for the tenses tasks is parsed from https://github.com/Drulac/ English-Verbs-Conjugates. The data for the plural-singular task is taken from https://github.com/sindresorhus/ irregular-plurals. Finally, the data for the antonyms task is taken from https://github.com/SuzanaK/english_ synonyms_antonyms_list. • Knowledge Data for the knowledge tasks is taken from the counterfactual dataset introduced in (Meng et al., 2022).
|
| 207 |
+
|
| 208 |
+
Conflicting Tasks Experiment In Fig. 6, we provide more details and a visualization of the experiment described in $\ S 5$ .
|
| 209 |
+
|
| 210 |
+
# A.2 Additional Results
|
| 211 |
+
|
| 212 |
+
Finding $\mathcal { A }$ and $f$ Fig. 7 shows results similar to Fig. 3, but for different models. It is interesting to observe that the curves are similar across differentsized models.
|
| 213 |
+
|
| 214 |
+
Detailed results for Fig. 4. Fig. 4 presented results for our $( A , f )$ hypothesis-based approach, averaged across tasks. Table. 6 provides these results for all the specific tasks considered.
|
| 215 |
+
|
| 216 |
+
Dependence of $\mathcal { A }$ on $x$ Fig. 9 and Fig. 8 provide more results on the geometry of the $\pmb \theta$ vectors (see main text for discussion).
|
| 217 |
+
|
| 218 |
+
Inspecting Task Vectors Tab. 7 is an expanded version of Tab. 3, providing more vocabulary projections of $\pmb \theta$ for additional tasks and on multiple LLMs.
|
| 219 |
+
|
| 220 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Dimension</td><td>Layers</td><td>Heads</td></tr><tr><td rowspan="3">LLaMA</td><td>7B</td><td>4096</td><td>32</td><td>32</td></tr><tr><td>13B</td><td>5120</td><td>40</td><td>40</td></tr><tr><td>30B</td><td>6656</td><td>60</td><td>52</td></tr><tr><td>GPT-J</td><td>6B</td><td>4096</td><td>28</td><td>16</td></tr><tr><td rowspan="3">Pythia</td><td>2.8B</td><td>2560</td><td>32</td><td>32</td></tr><tr><td>6.9B</td><td>4096</td><td>32</td><td>32</td></tr><tr><td>12B</td><td>5120</td><td>36</td><td>40</td></tr></table>
|
| 221 |
+
|
| 222 |
+
Table 4: The models used in the study, with architectural information.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Category</td><td>Task</td><td>Description</td><td>Example</td></tr><tr><td></td><td>List first</td><td>Givena list of letters,output the first letter</td><td>a,b,c→a</td></tr><tr><td rowspan="4">Algorithmic</td><td>List last</td><td>Given a list of letters,output the last letter</td><td>a,b,c →c</td></tr><tr><td>Next letter</td><td>Given a letter in the English alphabet,output the next letter</td><td>a→b</td></tr><tr><td>Previous letter</td><td>Given a letter in the English alphabet,output theb → a previous letter</td><td></td></tr><tr><td>To lowercase</td><td>Given an uppercase letter, output the correspond-A -a ing lowercase letter</td><td></td></tr><tr><td></td><td>To uppercase</td><td>Given a lowercase letter,output the correspond-a→A ing uppercase letter</td><td></td></tr><tr><td rowspan="4">Translation</td><td>French to English</td><td>Given a word in French, translate to English</td><td>bonjour → hello</td></tr><tr><td>Spanish to English English to Spanish</td><td>Given a word in Spanish,translate to English</td><td>hola →hello</td></tr><tr><td></td><td>Given a word in English, translate to Spanish</td><td>hola → hello</td></tr><tr><td>English to Spanish</td><td>Given a word in English,translate to French</td><td>hola →hello</td></tr><tr><td rowspan="4">Linguistic</td><td>Present to gerund</td><td>given an English verb in present simple tense, output the corresponding gerund form</td><td>go →going</td></tr><tr><td>Present to past</td><td>given an English verb in present simple tense, output the corresponding verb in past simple</td><td>go →went</td></tr><tr><td>Singular to plural</td><td>Given an English noun in singular form,output the plural form</td><td>catcats</td></tr><tr><td>Antonyms</td><td>Given an English adjective,output an antonym</td><td>happy →sad</td></tr><tr><td rowspan="4">Knowledge</td><td>Country to Capital</td><td>Given a name of a country,output the name of the capital city</td><td>France→Paris</td></tr><tr><td>Person to Language</td><td>Given a name of a person,output their nativeMacron →French language</td><td></td></tr><tr><td>Location to Continent</td><td>Given a name of a person,output their nativeParis → Europe</td><td></td></tr><tr><td>Religion</td><td>language Given a name of a location or a person,outputMuhammad -→ Islam the associated religion</td><td></td></tr></table>
|
| 225 |
+
|
| 226 |
+
Table 5: The tasks used in the study with input output examples.
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 6: Conflicting tasks experiment. In the “Regular” scenario (top), the model is simply provided with demonstrations $S _ { A }$ for Task $A$ (e.g. outputting the previous letter in the alphabet). In the “Conflicting” scenario (bottom), the model is still provided with demonstrations for Task $A$ , but we inject a task vector $\pmb \theta ( S _ { B } )$ from a conflicting Task $B$ (e.g. outputting the next letter in the alphabet).
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 7: Accuracy for each choice of $L$ (the intermediate layer where the task vector is injected), averaged across all tasks. The solid line represents the average value, and the shaded area depicts the standard deviation.
|
| 233 |
+
|
| 234 |
+
Table 6: Complete results for Figure 4, reported for all tasks and models.
|
| 235 |
+
|
| 236 |
+
<table><tr><td colspan="3"></td><td rowspan="2">Baseline</td><td rowspan="2">Hypothesis</td><td rowspan="2">Regular</td></tr><tr><td>Model</td><td>method Task type</td><td>Task name</td></tr><tr><td>GPT-J 6B</td><td>Algorithmic</td><td></td><td>0.30</td><td>0.74</td><td>0.98</td></tr><tr><td rowspan="20"></td><td rowspan="4"></td><td>List first List last</td><td>0.24</td><td>0.64</td><td>1.00</td></tr><tr><td>Next letter</td><td>0.16</td><td>1.00</td><td>0.86</td></tr><tr><td>Prev letter</td><td>0.10</td><td>0.36</td><td>0.42</td></tr><tr><td>To lower</td><td>0.00</td><td>0.46</td><td>1.00</td></tr><tr><td rowspan="5">Knowledge</td><td></td><td>0.00</td><td>0.94</td><td>1.00</td></tr><tr><td>To upper</td><td>0.19</td><td>0.72</td><td>0.80</td></tr><tr><td>Country capital</td><td>0.03</td><td>0.58</td><td>0.70</td></tr><tr><td>Location continent</td><td>0.09</td><td>0.68</td><td>0.78</td></tr><tr><td>Location religion</td><td>0.02</td><td>0.82</td><td>0.82</td></tr><tr><td rowspan="5">Linguistic</td><td>Person language</td><td>0.43</td><td>0.68</td><td>0.78</td></tr><tr><td>Antonyms</td><td></td><td>0.90</td><td>0.98</td></tr><tr><td>Plural singular</td><td>0.08 0.00</td><td>0.88</td><td></td></tr><tr><td>Present simple gerund</td><td></td><td>0.76</td><td>0.98 0.96</td></tr><tr><td>Present simple past simple</td><td>0.02 0.14</td><td></td><td>0.56</td></tr><tr><td rowspan="8">LLaMA 13B</td><td>Translation En es En fr</td><td>0.16</td><td>0.34 0.36</td><td>0.54</td></tr><tr><td>Es en</td><td></td><td>0.70</td><td>0.74</td></tr><tr><td>Fr en</td><td>0.06 0.13</td><td>0.66</td><td>0.76</td></tr><tr><td>Algorithmic List first</td><td>0.77</td><td>1.00</td><td>1.00</td></tr><tr><td>List last</td><td>0.07</td><td>0.70</td><td>0.92</td></tr><tr><td>Next letter</td><td>0.31</td><td>1.00</td><td>0.94</td></tr><tr><td>Prev letter</td><td>0.05</td><td>0.34</td><td>0.50</td></tr><tr><td rowspan="5">Knowledge</td><td>To lower</td><td>0.00</td><td>0.94</td><td>1.00</td></tr><tr><td>To upper</td><td>0.00</td><td>0.94</td><td>1.00</td></tr><tr><td>Country capital</td><td>0.17</td><td>0.84</td><td>0.86</td></tr><tr><td>Location continent</td><td>0.01</td><td>0.70</td><td>0.80</td></tr><tr><td>Location religion</td><td>0.10</td><td>0.74</td><td>0.84</td></tr><tr><td rowspan="8"></td><td></td><td></td><td>0.76</td><td>0.88</td></tr><tr><td rowspan="3">Linguistic</td><td>Person language</td><td>0.02 0.19</td><td>0.74</td><td>0.80</td></tr><tr><td>Antonyms Plural singular</td><td>0.24</td><td>0.84</td><td>0.88</td></tr><tr><td>Present simple gerund</td><td>0.00</td><td>0.96</td><td>0.96</td></tr><tr><td rowspan="4">Translation</td><td>Present simple past simple</td><td>0.01</td><td>1.00</td><td>0.98</td></tr><tr><td>En es</td><td>0.05</td><td>0.78</td><td>0.82</td></tr><tr><td>En fr</td><td>0.15</td><td>0.70</td><td>0.84</td></tr><tr><td>Es en</td><td>0.29</td><td>0.76</td><td>0.88</td></tr><tr><td rowspan="6">LLaMA30B</td><td>Fren</td><td>0.25</td><td>0.54</td><td>0.72</td></tr><tr><td>Algorithmic List first</td><td>0.96</td><td>0.98</td><td>1.00</td></tr><tr><td>List last</td><td>0.02</td><td>0.64</td><td>0.96</td></tr><tr><td>Next letter</td><td>0.30</td><td>0.98</td><td>0.96</td></tr><tr><td>Prev letter</td><td>0.02</td><td>0.56</td><td>0.80</td></tr><tr><td>To lower</td><td>0.00</td><td>1.00</td><td>1.00</td></tr><tr><td rowspan="8"></td><td>To upper</td><td>0.00</td><td>0.90</td><td>1.00</td></tr><tr><td>Knowledge Country capital</td><td>0.27</td><td>0.72</td><td>0.88</td></tr><tr><td>Location religion</td><td>Location continent</td><td>0.01 0.70 0.05</td><td>0.86</td></tr><tr><td>Person language</td><td></td><td>0.70 0.72</td><td>0.88</td></tr><tr><td>Linguistic</td><td></td><td>0.01 0.76</td><td>0.90</td></tr><tr><td></td><td>Antonyms</td><td>0.37 0.84</td><td>0.82</td></tr><tr><td></td><td>Plural singular</td><td>0.21</td><td>0.90</td></tr><tr><td rowspan="5">Translation</td><td> Present simple gerund</td><td>0.00</td><td>0.76</td><td>0.98</td></tr><tr><td>Present simple past simple En es</td><td>0.02</td><td>0.98</td><td>1.00</td></tr><tr><td></td><td>0.07</td><td>0.74 0.80</td><td>0.78</td></tr><tr><td>En fr</td><td>0.10</td><td></td><td>0.86</td></tr><tr><td>Es en</td><td>0.24</td><td>0.70</td><td>0.88</td></tr><tr><td rowspan="8">LLaMA7B</td><td rowspan="8">Algorithmic</td><td>Fren</td><td>0.20</td><td>0.62</td><td>0.78</td></tr><tr><td>List first</td><td>0.87</td><td>0.98</td><td>1.00</td></tr><tr><td>List last Next letter</td><td>0.03 0.03</td><td>1.00 0.94</td><td>1.00 0.88</td></tr><tr><td>Prev letter</td><td>0.04</td><td>0.52</td><td>0.58</td></tr><tr><td>To lower</td><td>0.00</td><td>0.74</td><td>1.00</td></tr><tr><td>Toupper</td><td>0.00</td><td>0.60</td><td>1.00</td></tr><tr><td>Knowledge</td><td></td><td>0.82</td><td>0.86</td></tr><tr><td>Country capital</td><td>0.28</td><td></td><td></td></tr><tr><td rowspan="5">Linguistic</td><td>Location continent</td><td>0.02</td><td>0.68</td><td>0.72</td></tr><tr><td>Location religion</td><td>0.12</td><td>0.84</td><td>0.94</td></tr><tr><td>Person language</td><td>0.02</td><td>0.68</td><td>0.78</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Antonyms Plural singular</td><td>0.33 0.15</td><td>0.74 0.84</td><td>0.76 0.88</td></tr></table>
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Task type</td><td rowspan="2">method Task name</td><td rowspan="2">Baseline</td><td rowspan="2">Hypothesis</td><td rowspan="2">Regular</td></tr><tr><td></td></tr><tr><td rowspan="12">Pythia 12B</td><td></td><td>Present simple gerund</td><td>0.00</td><td>0.74</td><td>0.90</td></tr><tr><td></td><td>Present simple past simple</td><td>0.02</td><td>0.94</td><td>0.92</td></tr><tr><td>Translation</td><td>En es</td><td>0.07</td><td>0.78</td><td>0.76</td></tr><tr><td>En fr</td><td></td><td>0.04</td><td>0.78</td><td>0.88</td></tr><tr><td>Es en</td><td></td><td>0.21</td><td>0.68</td><td>0.92</td></tr><tr><td>Fr en</td><td></td><td>0.15</td><td>0.66</td><td>0.70</td></tr><tr><td>Algorithmic</td><td></td><td>0.53</td><td>0.98</td><td>0.96</td></tr><tr><td></td><td>List first List last</td><td>0.09</td><td>0.98</td><td>1.00</td></tr><tr><td></td><td>Next letter</td><td>0.15</td><td>0.96</td><td>0.76</td></tr><tr><td></td><td>Prev letter</td><td>0.00</td><td>0.24</td><td>0.42</td></tr><tr><td></td><td>To lower</td><td>0.02</td><td>1.00</td><td>1.00</td></tr><tr><td></td><td>To upper</td><td>0.00</td><td>0.98</td><td>1.00</td></tr><tr><td></td><td>Knowledge Country capital</td><td></td><td>0.19</td><td>0.58 0.82</td></tr><tr><td></td><td>Location continent</td><td>0.01</td><td>0.68</td><td>0.80</td></tr><tr><td></td><td>Location religion</td><td>0.07</td><td>0.64</td><td>0.78</td></tr><tr><td>Linguistic</td><td>Person language</td><td>0.01</td><td>0.72</td><td>0.86</td></tr><tr><td></td><td>Antonyms</td><td>0.34</td><td>0.72</td><td>0.74</td></tr><tr><td></td><td>Plural singular</td><td>0.18</td><td>0.80</td><td>0.84</td></tr><tr><td></td><td></td><td>Present simple gerund</td><td>0.00</td><td>0.86 0.96</td></tr><tr><td rowspan="4"></td><td>Translation En es</td><td>Present simple past simple 0.01 0.10</td><td>0.76 0.44</td><td>0.94</td></tr><tr><td>En fr</td><td></td><td>0.48</td><td>0.72 0.54</td></tr><tr><td>Es en</td><td>0.16</td><td>0.68</td><td>0.80</td></tr><tr><td>Fr en</td><td>0.05 0.14</td><td>0.68</td><td>0.80</td></tr><tr><td>Pythia 2.8B</td><td>Algorithmic List first</td><td></td><td></td><td></td></tr><tr><td rowspan="6"></td><td rowspan="5"></td><td></td><td>0.69 0.06</td><td>0.96 0.98</td><td>1.00 1.00</td></tr><tr><td>List last Next letter</td><td>0.42</td><td>0.86</td><td>0.90</td></tr><tr><td></td><td></td><td>0.22</td><td>0.48</td></tr><tr><td>Prev letter To lower</td><td>0.01</td><td>1.00</td><td>1.00</td></tr><tr><td>To upper</td><td>0.00</td><td>1.00</td><td>1.00</td></tr><tr><td>Knowledge</td><td>Country capital</td><td>0.00 0.18</td><td>0.70</td><td></td></tr><tr><td rowspan="12"></td><td></td><td>Location continent</td><td>0.01</td><td>0.62</td><td>0.76 0.72</td></tr><tr><td></td><td>Location religion</td><td>0.08</td><td>0.76</td><td>0.82</td></tr><tr><td>Linguistic</td><td>Person language</td><td>0.00</td><td>0.82</td><td>0.82</td></tr><tr><td></td><td>Antonyms</td><td>0.37</td><td>0.68</td><td>0.76</td></tr><tr><td></td><td>Plural singular</td><td>0.13</td><td>0.70</td><td>0.78</td></tr><tr><td>Translation</td><td>Present simple gerund</td><td>0.00</td><td>0.86</td><td>0.96</td></tr><tr><td rowspan="8">Pythia 6.9B</td><td></td><td>Present simple past simple 0.03</td><td>0.80</td><td>0.92</td></tr><tr><td>En es</td><td>0.10</td><td>0.26</td><td>0.76</td></tr><tr><td>En fr</td><td>0.16</td><td>0.28</td><td>0.60</td></tr><tr><td>Es en</td><td>0.08</td><td>0.76</td><td>0.82</td></tr><tr><td>Fr en</td><td>0.10</td><td>0.64</td><td>0.82</td></tr><tr><td>Algorithmic List first</td><td>0.43</td><td>1.00</td><td>0.98</td></tr><tr><td>List last Next letter</td><td>0.08</td><td>0.60</td><td>0.98</td></tr><tr><td rowspan="5"></td><td></td><td>0.01</td><td>0.66</td><td>0.86</td></tr><tr><td>Prev letter</td><td>0.04</td><td>0.28</td><td>0.32</td></tr><tr><td>To lower</td><td>0.00</td><td>1.00</td><td>1.00</td></tr><tr><td>To upper</td><td>0.00</td><td>0.94</td><td>1.00</td></tr><tr><td>Country capital</td><td>0.21</td><td>0.76</td><td>0.82</td></tr><tr><td rowspan="4"></td><td>Knowledge</td><td></td><td></td><td></td><td>0.78</td></tr><tr><td></td><td>Location continent Location religion</td><td>0.01 0.10</td><td>0.62 0.80</td><td>0.80</td></tr><tr><td>Person language</td><td></td><td>0.01</td><td>0.76</td><td>0.80</td></tr><tr><td>Linguistic Antonyms</td><td></td><td>0.33</td><td>0.72</td><td>0.74</td></tr><tr><td rowspan="5">Translation</td><td>Plural singular</td><td>0.14</td><td>0.78</td><td></td><td>0.88</td></tr><tr><td></td><td>Present simple gerund</td><td>0.00</td><td>0.82</td><td>0.94</td></tr><tr><td>Present simple past simple</td><td></td><td>0.02</td><td>0.88</td><td>0.96</td></tr><tr><td>En es</td><td></td><td>0.11</td><td>0.46</td><td>0.70</td></tr><tr><td>En fr</td><td></td><td></td><td>0.36</td><td>0.60</td></tr><tr><td rowspan="5"></td><td></td><td></td><td>0.21</td><td></td><td></td></tr><tr><td>Es en</td><td></td><td>0.06</td><td>0.72</td><td>0.82</td></tr><tr><td>Fr en</td><td></td><td>0.14</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>0.66</td><td>0.74</td></tr></table>
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 8: Task Vector Variability. For each task, two histograms are shown: (blue) the distribution of distances between different task vectors of this task, created from different $S$ and $x ^ { \prime }$ ; (orange) the distribution of distances between task vectors of the task and of other tasks.
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
Figure 9: A 2D t-SNE plot, visualizing 50 task vectors for each task, each generated from a different choice of $S$ and $x$ using LLaMA 7B. Points are color-coded according to task category, such as algorithmic or translation. Each task can be seen to form its own distinct cluster. The labels provide the full name of the task in the cluster.
|
| 245 |
+
|
| 246 |
+
<table><tr><td>Model</td><td>Task</td><td>Tokens</td></tr><tr><td rowspan="4">LLaMA 13B</td><td>Prev Letter</td><td>e,y,unknown,alphabet,preceding,c,Cad,zA,dit,bill,closer,etc, Stuart,aa,null,cin,ads,g,ulo,Ku</td></tr><tr><td>FR-EN</td><td>Mason,gram,immer,Santi,latin,utter, Span,Conc,English, equivalent,engl,Usage,none,pron,ulo,translate,adu,Wiel,grammar, ML</td></tr><tr><td>Present Simple to Gerund</td><td>e cin, thats,gram,Lorenzo,cian,Isabel,uld,berto,partici,Sah, reporting,eing,tc,Roberto,habit,Writing,etc,ientos,ores,Dutch</td></tr><tr><td>Country Capital</td><td>Paris,its,capital,central,Conc,cities,administrative,Los,Madrid, London,San,Isabel,exec,Ar,Bel,Wars,name,capit,Battle,History</td></tr><tr><td rowspan="4">Pythia 12B</td><td>Prev Letter</td><td>r,b,a,d,m,e,p,n,t,u,h,f,c,in,g,s,the,ar,l,×</td></tr><tr><td>FR-EN</td><td>in,and,m,d,a,or,out,the,t,o,so,c,con,have,act,e,s,is, all,to</td></tr><tr><td>to Gerund</td><td>Present Simple in,t,m,r,a,and,the,ing,action,d,o,e,current,simple,te,w, not,have,out,what</td></tr><tr><td></td><td>CountryCapital the,in,a,C,N,B,L,M,T,P,S,R,G,and,F,I,K,U,D,H</td></tr><tr><td rowspan="4">GPT-J 6B</td><td>Prev Letter</td><td>b,c,ν,g,s,name,i,ro,n,j,d,t,A,ai,com,m,ust,test, active,k</td></tr><tr><td>FR-EN</td><td>other,name,the,true,is,social,s,active,time,car,type,money, F,force,a,public,heart,one,ms,life</td></tr><tr><td>Present Simple to Gerund</td><td>getting, storing,working,moving,playing,doing,making,driving, shooting,picking, being, sending,putting,selling,watching, changing,taking,collecting,feeding,reading</td></tr><tr><td>Country Capital</td><td>London,Paris,New,West,Berlin,South,Tokyo,San,Chicago,City, Moscow,Jerusalem, Amsterdam,Philadelphia,East, Madrid,Vienna, Beijing,Mexico,Germany</td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 7: The top 20 tokens in the distribution induced by the task vector, for one task per category.
|
parse/dev/RzXb6a3H3rs/RzXb6a3H3rs_content_list.json
ADDED
|
@@ -0,0 +1,1565 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "LEARNING TO PROMPT FOR CONTINUAL LEARNING ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
176,
|
| 8 |
+
98,
|
| 9 |
+
797,
|
| 10 |
+
122
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Anonymous authors Paper under double-blind review ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
183,
|
| 19 |
+
145,
|
| 20 |
+
398,
|
| 21 |
+
172
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
210,
|
| 32 |
+
544,
|
| 33 |
+
226
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "The mainstream learning paradigm behind continual learning has been to adapt the model parameters to non-stationary data distributions, where catastrophic forgetting is the central challenge. This work explores a new paradigm for continual learning – learning to dynamically prompt the model to learn tasks sequentially under different task transitions. Specifically, our method, Learning to Prompt for Continual Learning (L2P), prepends a subset of learnable parameters (called Prompts) from a larger set (called Prompt Pool) to the input embeddings. The training objective is designed to dynamically select and update prompts from the prompt pool to learn tasks sequentially given a pretrained backbone model. Under our new framework, instead of mitigating catastrophic forgetting via adapting large model parameters as in the previous continual learning paradigm, we tackle the problem of learning better small prompt parameters. In this framework, the prompt pool explicitly manages task-invariant and task-specific knowledge while maintaining model plasticity. The proposed L2P outperforms previous work in terms of forgetting on all datasets, including rehearsal-based methods on certain benchmarks, with privacy benefits from not requiring access to the data of previous tasks. Moreover, when L2P is additionally equipped with a rehearsal buffer, it matches the performance of training all tasks together, which is often regarded as an upper bound in continual learning. Source code will be released. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
233,
|
| 42 |
+
239,
|
| 43 |
+
764,
|
| 44 |
+
503
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
530,
|
| 55 |
+
334,
|
| 56 |
+
546
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "Contrary to ordinary supervised learning that trains on independent and identically distributed (i.i.d.) data, continual learning tackles the problem of training a single model on non-stationary data distributions where different classification tasks are presented sequentially. Mainstream continual learning methods (Parisi et al., 2019; Mai et al., 2021) follow a natural learning paradigm: adapting the entire model continually as the data distribution shifts. However, since the model only has access to the data in an individual phase of the learning cycle, it is prone to overfit on the currently available data and suffers from performance deterioration on the previously trained data. This is commonly known as catastrophic forgetting (McCloskey & Cohen, 1989). ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
561,
|
| 66 |
+
823,
|
| 67 |
+
674
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "In addition to the catastrophic forgetting problem, other challenges in continual learning have recently been receiving increasing attention (Hadsell et al., 2020): (1) knowledge transfer: the model should be able to transfer knowledge between tasks by identifying shared knowledge among tasks; (2) model plasticity: the model should be able to keep learning new tasks effectively by capturing task-specific knowledge; and (3) task-agnosticity: it is desirable that a continual learning algorithm can handle the case where distribution shifts gradually without clear task boundaries. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
680,
|
| 77 |
+
823,
|
| 78 |
+
763
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "On the other hand, prompt-based learning, or prompting, has recently achieved great success in the field of natural language processing (NLP) as a new transfer learning technique (Liu et al., 2021). Prompting techniques design model inputs with textual prompt tokens containing additional taskspecific information, such that the pretrained language model can process parameterized inputs in order to perform prompt-specific prediction. Several methods (Lester et al., 2021; Shin et al., 2020; Li & Liang, 2021) further make prompts learnable to allow the overall backbone model to extract task-specific information automatically. Intuitively, prompt-based learning reformulates learning downstream tasks from directly adapting model weights to designing prompts that enable the model perform tasks conditionally. A prompt encodes task-specific knowledge and has the ability to utilize pre-trained frozen models more effectively than ordinary fine-tuning (Lester et al., 2021; Raffel et al., 2020). Inspired by these recent advances in prompt learning, we revisit continual learning from a different perspective: Can we encode task-specific information of continual tasks into a shared parameterized prompt space in order to allow a pre-trained model to perform conditional prediction during the continual learning process? ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
771,
|
| 88 |
+
825,
|
| 89 |
+
924
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "image",
|
| 95 |
+
"img_path": "images/b2b885e90ab9fc48f9e4bc5fae2bc06fc57b7771b4a1d50e0dbb70dda6b510b5.jpg",
|
| 96 |
+
"image_caption": [
|
| 97 |
+
"Figure 1: Overview of the L2P framework. Compared with typical continual learning methods (left) that adapt model weights to tasks sequentially, L2P (right) uses a single backbone model and learns a prompt pool to adapt tasks. "
|
| 98 |
+
],
|
| 99 |
+
"image_footnote": [],
|
| 100 |
+
"bbox": [
|
| 101 |
+
202,
|
| 102 |
+
98,
|
| 103 |
+
790,
|
| 104 |
+
243
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 1
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "",
|
| 111 |
+
"bbox": [
|
| 112 |
+
174,
|
| 113 |
+
311,
|
| 114 |
+
825,
|
| 115 |
+
353
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 1
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "To this end, we propose a new continual learning method called Learning to Prompt for Continual Learning (L2P). Figure 1 gives an overview of our method and demonstrates how it differs from typical continual learning methods. L2P leverages the representative features from pretrained models; however, instead of tuning the parameters during the continual learning process, L2P keeps the pretrained model untouched, and instead learns a set of prompts that dynamically help models solve corresponding tasks, thus mitigating catastrophic forgetting. The prompts are structured in a key-value shared memory space called the prompt pool, and we design a query mechanism to dynamically lookup a subset of task-relevant prompts based on the instance-wise input features. The prompt pool, which is optimized jointly with the supervised loss, ensures that shared prompts encode shared knowledge for knowledge transfer, and unshared prompts encode task-specific knowledge that help maintain model plasticity. The instance-wise query mechanism removes the necessity of knowing the task identity or boundaries, enabling task-agnostic continual learning. The selected prompts are then prepended to the input embeddings (Figure 2), which implicitly add task-relevant guidance to pretrained models, so that the model can use the most useful pretrained features to conduct corresponding tasks. In summary, this work makes the following contributions: ",
|
| 122 |
+
"bbox": [
|
| 123 |
+
173,
|
| 124 |
+
361,
|
| 125 |
+
825,
|
| 126 |
+
569
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "1. We propose a novel method, called L2P, that addresses multiple challenges in continual learning: (1) we leverage pretrained models and prompting techniques to mitigate catastrophic forgetting; (2) we design a novel key-value paired prompt pool to achieve knowledge sharing and maintain model plasticity; and (3) we devise an instance-wise query mechanism to enable task-agnostic learning. \n2. We conduct comprehensive experiments to demonstrate the effectiveness of L2P on multiple continual learning benchmarks, including class-incremental, task-agnostic, and domainincremental settings. The proposed L2P outperforms previous works in terms of forgetting on all datasets, beating rehearsal based methods on certain benchmarks and providing practical advantages over them by avoiding privacy issues of task data sharing present in some applications (Delange et al., 2021). Moreover, when equipped with a rehearsal buffer in applications with less strict privacy constraints, L2P matches the performance of training all tasks together, which is often regarded as an upper bound in continual learning. \n3. To the best of our knowledge, we are the first to introduce the idea of prompting in the field of continual learning to address some of the key challenges in continual learning. ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
181,
|
| 135 |
+
582,
|
| 136 |
+
826,
|
| 137 |
+
801
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "2 RELATED WORK ",
|
| 144 |
+
"text_level": 1,
|
| 145 |
+
"bbox": [
|
| 146 |
+
176,
|
| 147 |
+
821,
|
| 148 |
+
344,
|
| 149 |
+
838
|
| 150 |
+
],
|
| 151 |
+
"page_idx": 1
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"type": "text",
|
| 155 |
+
"text": "Continual learning. There are three main categories of recent continual learning algorithms: Regularization-based methods (Kirkpatrick et al., 2017; Zenke et al., 2017; Li & Hoiem, 2017; Aljundi et al., 2018) limit the plasticity of the model by limiting the learning rate on important parameters for previous tasks. Although these methods address catastrophic forgetting to some extent, they cannot get satisfactory performance under more challenging settings, e.g., class-incremental setting (Mai et al., 2021). Rehearsal-based methods (Chaudhry et al., 2018; 2019; Hayes et al., 2019) construct a buffer to save samples from older tasks to train with data from the current task. These methods are state-of-the-art on various benchmarks (Parisi et al., 2019; Mai et al., 2021). However, rehearsal-based methods are not applicable to scenarios where data privacy should be taken into account (Shokri & Shmatikov, 2015). Architecture-based methods either expand the network (Rusu et al., 2016; Yoon et al., 2017) or prune the network (Mallya & Lazebnik, 2018; Wang et al., 2020). The former suffers from scalability issue as parameters scale up linearly with the number of tasks, and the latter are sensitive to hyperparameters. ",
|
| 156 |
+
"bbox": [
|
| 157 |
+
174,
|
| 158 |
+
854,
|
| 159 |
+
825,
|
| 160 |
+
924
|
| 161 |
+
],
|
| 162 |
+
"page_idx": 1
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"type": "text",
|
| 166 |
+
"text": "",
|
| 167 |
+
"bbox": [
|
| 168 |
+
174,
|
| 169 |
+
103,
|
| 170 |
+
825,
|
| 171 |
+
214
|
| 172 |
+
],
|
| 173 |
+
"page_idx": 2
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"type": "text",
|
| 177 |
+
"text": "Prompting. Prompting, or prompt-based learning, has been widely explored in the field of natural language processing (Kumar et al., 2016; McCann et al., 2018; Radford et al., 2019; Schick & Schutze ¨ , 2020). The high-level idea of prompting is to apply a function to modify the input text, so that the language model gets additional information about the task. However, the design of a prompting function is challenging and requires heuristics. Recent work, including prompt tuning (Lester et al., 2021) and prefix tuning (Li & Liang, 2021), seek to address this problem by applying learnable prompts in a continuous space, achieving satisfactory performance on transfer learning for pretrained language models. Nevertheless, to the best of our knowledge, the idea of prompting has never been studied systematically in continual learning. ",
|
| 178 |
+
"bbox": [
|
| 179 |
+
174,
|
| 180 |
+
215,
|
| 181 |
+
825,
|
| 182 |
+
339
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 2
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "3 PREREQUISITES ",
|
| 189 |
+
"text_level": 1,
|
| 190 |
+
"bbox": [
|
| 191 |
+
176,
|
| 192 |
+
359,
|
| 193 |
+
338,
|
| 194 |
+
376
|
| 195 |
+
],
|
| 196 |
+
"page_idx": 2
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"type": "text",
|
| 200 |
+
"text": "3.1 CONTINUAL LEARNING PROTOCOLS ",
|
| 201 |
+
"text_level": 1,
|
| 202 |
+
"bbox": [
|
| 203 |
+
176,
|
| 204 |
+
391,
|
| 205 |
+
462,
|
| 206 |
+
405
|
| 207 |
+
],
|
| 208 |
+
"page_idx": 2
|
| 209 |
+
},
|
| 210 |
+
{
|
| 211 |
+
"type": "text",
|
| 212 |
+
"text": "Continual learning is usually defined as training machine learning models on non-stationary data from sequential tasks. We define a sequence of tasks $\\mathcal { D } = \\{ \\mathcal { D } _ { 1 } , \\cdot \\cdot \\cdot , \\mathcal { D } _ { T } \\}$ , where the $t$ -th task $\\mathcal { D } _ { t } = \\{ ( \\dot { \\mathbf { x } } _ { i } ^ { t } , y _ { i } ^ { t } ) \\} _ { i = 1 } ^ { n _ { t } }$ contains tuples of the input sample $\\boldsymbol { x } _ { i } ^ { t } \\in \\mathcal { X }$ and its corresponding label $y _ { i } ^ { t } \\in \\mathcal { V }$ . The goal is to train a single model $f _ { \\theta } : \\mathcal { X } \\mathcal { Y }$ parameterized by $\\theta$ , such that it predicts the label $y = f _ { \\boldsymbol { \\theta } } ( \\pmb { x } ) \\in \\mathcal { y }$ given an unseen test sample $_ { \\textbf { \\em x } }$ from arbitrary tasks. Data from the previous tasks may not be seen anymore when training future tasks. ",
|
| 213 |
+
"bbox": [
|
| 214 |
+
174,
|
| 215 |
+
416,
|
| 216 |
+
825,
|
| 217 |
+
500
|
| 218 |
+
],
|
| 219 |
+
"page_idx": 2
|
| 220 |
+
},
|
| 221 |
+
{
|
| 222 |
+
"type": "text",
|
| 223 |
+
"text": "Depending on the task transition environment, continual learning can be categorized into multiple settings with slightly different challenges. The common task, class, and domain incremental setting assumes task data $\\mathcal { D } _ { t }$ arrives in sequence $t = \\{ 1 , . . . , T \\}$ in a discrete manner. Task-incremental assumes task identity is known at test time while class-incremental does not. Different from the task and class incremental settings where each task has different classes, domain-incremental learning maintains the same set of classes for every task and only changes the distribution of $_ { \\textbf { \\em x } }$ by task. In the more challenging task-agnostic setting, task data in $\\mathcal { D }$ changes smoothly, and the task identity $t$ is unknown. Our paper tackles the more challenging class-incremental, task-agnostic, and domainincremental settings. ",
|
| 224 |
+
"bbox": [
|
| 225 |
+
174,
|
| 226 |
+
507,
|
| 227 |
+
825,
|
| 228 |
+
632
|
| 229 |
+
],
|
| 230 |
+
"page_idx": 2
|
| 231 |
+
},
|
| 232 |
+
{
|
| 233 |
+
"type": "text",
|
| 234 |
+
"text": "3.2 PROMPT-BASED LEARNING AND BASELINES",
|
| 235 |
+
"text_level": 1,
|
| 236 |
+
"bbox": [
|
| 237 |
+
174,
|
| 238 |
+
648,
|
| 239 |
+
516,
|
| 240 |
+
662
|
| 241 |
+
],
|
| 242 |
+
"page_idx": 2
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"type": "text",
|
| 246 |
+
"text": "Prompt-based learning is an emerging technique in NLP. In contrast to traditional supervised finetuning, this type of methods design task-specific prompt functions to enable pre-trained models perform corresponding tasks (Liu et al., 2021). One of recent techniques, Prompt Tuning (PT) (Lester et al., 2021), proposes to simply condition frozen T5-like language models (Raffel et al., 2020) to perform down-streaming NLP tasks by learning prompt parameters that are prepended to the input tokens. While prompt-based learning has demonstrated success in NLP, to the best of our knowledge, the related research in computer vision and its application to continual learning remains under-investigated. Without loss of generality, here we introduce the definition of PT using the image modality given vision transformer-based models (Dosovitskiy et al., 2021; Vaswani et al., 2017). The definition is easy to generalize to other modalities and sequence-based models. ",
|
| 247 |
+
"bbox": [
|
| 248 |
+
174,
|
| 249 |
+
674,
|
| 250 |
+
825,
|
| 251 |
+
814
|
| 252 |
+
],
|
| 253 |
+
"page_idx": 2
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"type": "text",
|
| 257 |
+
"text": "Given an input of 2D image $\\pmb { x } \\in \\mathbb { R } ^ { H \\times W \\times C }$ and a pretrained ViT (excluding the classification head) $f ~ = ~ f _ { r } \\circ f _ { e }$ , where $f _ { e }$ is the input embedding layer, and $f _ { r }$ represents a stack of selfattention layers (Dosovitskiy et al., 2021). Images are reshaped to a sequence of flattened 2D patches $\\pmb { x } _ { p } \\in \\mathbb { R } ^ { L \\times ( S ^ { 2 } \\cdot C ) }$ , where $L$ is the token length, i.e., the number of patches, $S$ is the patch size and $C$ is the original number of channels. To simplify notation, we assume the first token in $\\scriptstyle { \\pmb { x } } _ { p }$ is the [class] token as part of pre-trained model (Dosovitskiy et al., 2021). The pretrained embedding layer $f _ { e } : \\mathbb { R } ^ { L \\times ( S ^ { 2 } \\cdot C ) } \\mathbb { R } ^ { L \\times D }$ projects the patched image to the embedding feature $\\pmb { x } _ { e } = f _ { e } ( x ) \\in \\mathbb { R } ^ { L \\times D }$ , where $D$ is the embedding dimension. When solving multiple downstreaming tasks, we keep the large-scale pre-trained backbone frozen to maintain its generality following PT. The direct application of PT is to prepend learnable parameters $\\boldsymbol { P _ { e } } \\in \\mathbb { R } ^ { L _ { p } \\times D }$ , called a prompt, to the embedding feature $\\pmb { x } _ { p } = [ P _ { e } ; \\pmb { x } _ { e } ]$ , and feed the extended sequences to the model function $f _ { r } ( { \\pmb x } _ { p } )$ for performing classification tasks. Different tasks have independent prompts and share one copy of the large model. ",
|
| 258 |
+
"bbox": [
|
| 259 |
+
174,
|
| 260 |
+
819,
|
| 261 |
+
823,
|
| 262 |
+
924
|
| 263 |
+
],
|
| 264 |
+
"page_idx": 2
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"type": "image",
|
| 268 |
+
"img_path": "images/4bada4c7fb75fc17f5d671b20d278b882ba3f46caedbd0ca7570db1b6c34be84.jpg",
|
| 269 |
+
"image_caption": [
|
| 270 |
+
"Figure 2: The illustration of L2P at test time. During training time, we follow the same procedure and optimize the model as described in Section 4.3. "
|
| 271 |
+
],
|
| 272 |
+
"image_footnote": [],
|
| 273 |
+
"bbox": [
|
| 274 |
+
222,
|
| 275 |
+
99,
|
| 276 |
+
779,
|
| 277 |
+
248
|
| 278 |
+
],
|
| 279 |
+
"page_idx": 3
|
| 280 |
+
},
|
| 281 |
+
{
|
| 282 |
+
"type": "text",
|
| 283 |
+
"text": "",
|
| 284 |
+
"bbox": [
|
| 285 |
+
173,
|
| 286 |
+
305,
|
| 287 |
+
825,
|
| 288 |
+
390
|
| 289 |
+
],
|
| 290 |
+
"page_idx": 3
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"type": "text",
|
| 294 |
+
"text": "Compared with ordinary fine-tuning classification heads with a fixed backbone, literature shows that prompt-based learning results in a sequence-based model with higher capacity to learn features (Liu et al., 2021; Lester et al., 2021). PT can be applied to task-incremental continual learning by learning independent prompts for each task. However, in more challenging settings when no task identity is available, choosing a prompt is more difficult. ",
|
| 295 |
+
"bbox": [
|
| 296 |
+
173,
|
| 297 |
+
397,
|
| 298 |
+
825,
|
| 299 |
+
467
|
| 300 |
+
],
|
| 301 |
+
"page_idx": 3
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"type": "text",
|
| 305 |
+
"text": "4 LEARNING TO PROMPT ",
|
| 306 |
+
"text_level": 1,
|
| 307 |
+
"bbox": [
|
| 308 |
+
176,
|
| 309 |
+
487,
|
| 310 |
+
398,
|
| 311 |
+
503
|
| 312 |
+
],
|
| 313 |
+
"page_idx": 3
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
"type": "text",
|
| 317 |
+
"text": "Our proposed method, Learning to Prompt for Continual Learning (L2P) is depicted in Figure 2. First, we select a subset of prompts from a key-value pair prompt pool based on our proposed instance-wise query mechanism. We then prepend the selected prompts to the input embedding. Finally, we feed the extended input embedding to the model, and optimize the classification loss and the prompt pool jointly. In the remainder of this section, we will introduce the critical designs of our method in detail, and discuss how L2P mitigates catastrophic forgetting and addresses some of the other challenges in continual learning (Hadsell et al., 2020), and describe the training procedure. ",
|
| 318 |
+
"bbox": [
|
| 319 |
+
173,
|
| 320 |
+
518,
|
| 321 |
+
825,
|
| 322 |
+
617
|
| 323 |
+
],
|
| 324 |
+
"page_idx": 3
|
| 325 |
+
},
|
| 326 |
+
{
|
| 327 |
+
"type": "text",
|
| 328 |
+
"text": "4.1 FROM PROMPT TO PROMPT POOL ",
|
| 329 |
+
"text_level": 1,
|
| 330 |
+
"bbox": [
|
| 331 |
+
176,
|
| 332 |
+
633,
|
| 333 |
+
441,
|
| 334 |
+
647
|
| 335 |
+
],
|
| 336 |
+
"page_idx": 3
|
| 337 |
+
},
|
| 338 |
+
{
|
| 339 |
+
"type": "text",
|
| 340 |
+
"text": "The motivations of introducing prompt pool are threefold. First, the task index at test time is unknown so training task-independent prompts is not feasible. Second, even if the task-independent prompt can be known at test time, it prevents possible knowledge sharing between similar tasks (Hadsell et al., 2020). Third, while the simple way of learning a single shared prompt for all tasks enables knowledge sharing, it is challenging when tasks are diverse (see Section 5.3). Ideally one would learn a model that is able to share knowledge when tasks are similar, while maintaining knowledge independence otherwise. Thus, we propose using a prompt pool to store encoded knowledge, which can be flexibly grouped as an input to the model. The prompt pool is defined as ",
|
| 341 |
+
"bbox": [
|
| 342 |
+
173,
|
| 343 |
+
651,
|
| 344 |
+
825,
|
| 345 |
+
763
|
| 346 |
+
],
|
| 347 |
+
"page_idx": 3
|
| 348 |
+
},
|
| 349 |
+
{
|
| 350 |
+
"type": "equation",
|
| 351 |
+
"img_path": "images/69632bb40b2896abb78ee3472dd39d3ad423ee9f487c2188e4b2ab40959ff310.jpg",
|
| 352 |
+
"text": "$$\n\\mathbf { P } = \\{ P _ { 1 } , P _ { 2 } , \\cdot \\cdot \\cdot , P _ { M } \\} , \\quad M = \\mathrm { t o t a l n u m b e r o f p r o m p t s } ,\n$$",
|
| 353 |
+
"text_format": "latex",
|
| 354 |
+
"bbox": [
|
| 355 |
+
303,
|
| 356 |
+
770,
|
| 357 |
+
691,
|
| 358 |
+
787
|
| 359 |
+
],
|
| 360 |
+
"page_idx": 3
|
| 361 |
+
},
|
| 362 |
+
{
|
| 363 |
+
"type": "text",
|
| 364 |
+
"text": "where $P _ { j } \\in \\mathbb { R } ^ { L _ { p } \\times D }$ is a single prompt with token length $L _ { p }$ and the same embedding size $D$ as $\\pmb { x } _ { e }$ . Following the notations in Section 3.2, we let $_ { \\textbf { \\em x } }$ and $\\pmb { x } _ { e } = \\bar { f } _ { e } ( \\pmb { x } )$ be the input and its corresponding method is general enough to the task-agnostic setting. Denoting embedding feature, respectively. Note that we omit the task index $\\{ s _ { i } \\} _ { i = 1 } ^ { N }$ $t$ of as a subset of $_ { \\textbf { \\em x } }$ in our notation as our $N$ indices from $[ 1 , M ]$ , we can then adapt the input embedding as follows: ",
|
| 365 |
+
"bbox": [
|
| 366 |
+
174,
|
| 367 |
+
794,
|
| 368 |
+
825,
|
| 369 |
+
864
|
| 370 |
+
],
|
| 371 |
+
"page_idx": 3
|
| 372 |
+
},
|
| 373 |
+
{
|
| 374 |
+
"type": "equation",
|
| 375 |
+
"img_path": "images/39d54beb042a611a07554aa87244f0da1d9dc74cf43abbe18941e2c79ac89b14.jpg",
|
| 376 |
+
"text": "$$\n\\pmb { x } _ { p } = [ P _ { s _ { 1 } } ; \\cdot \\cdot \\cdot ; P _ { s _ { N } } ; \\pmb { x } _ { e } ] , \\quad 1 \\leq N \\leq M ,\n$$",
|
| 377 |
+
"text_format": "latex",
|
| 378 |
+
"bbox": [
|
| 379 |
+
359,
|
| 380 |
+
872,
|
| 381 |
+
637,
|
| 382 |
+
888
|
| 383 |
+
],
|
| 384 |
+
"page_idx": 3
|
| 385 |
+
},
|
| 386 |
+
{
|
| 387 |
+
"type": "text",
|
| 388 |
+
"text": "where ; represents concatenation along the token length dimension. $P$ are free to compose, so they can jointly encode knowledge (e.g. visual features or tasks) for the model to process. Ideally, we ",
|
| 389 |
+
"bbox": [
|
| 390 |
+
173,
|
| 391 |
+
895,
|
| 392 |
+
825,
|
| 393 |
+
924
|
| 394 |
+
],
|
| 395 |
+
"page_idx": 3
|
| 396 |
+
},
|
| 397 |
+
{
|
| 398 |
+
"type": "text",
|
| 399 |
+
"text": "want to achieve a more fine-grained knowledge sharing scheme via prompt combinations at the instance-wise level: similar inputs tend to share more common prompts, and vice versa. We next elaborate our prompt selection strategy and training in the following sections. ",
|
| 400 |
+
"bbox": [
|
| 401 |
+
176,
|
| 402 |
+
103,
|
| 403 |
+
825,
|
| 404 |
+
146
|
| 405 |
+
],
|
| 406 |
+
"page_idx": 4
|
| 407 |
+
},
|
| 408 |
+
{
|
| 409 |
+
"type": "text",
|
| 410 |
+
"text": "4.2 INSTANCE-WISE PROMPT QUERY ",
|
| 411 |
+
"text_level": 1,
|
| 412 |
+
"bbox": [
|
| 413 |
+
176,
|
| 414 |
+
162,
|
| 415 |
+
437,
|
| 416 |
+
176
|
| 417 |
+
],
|
| 418 |
+
"page_idx": 4
|
| 419 |
+
},
|
| 420 |
+
{
|
| 421 |
+
"type": "text",
|
| 422 |
+
"text": "We design a key-value pair based query strategy to dynamically select suitable prompts for different inputs. This key-valued memory query mechanism shares some design principles with methods in other fields, such as Differentiable Neural Computer (Graves et al., 2016) and VQ-VAE (Oord et al., 2017), which have external memory to maintain, and employs them for a different purpose. With a slight abuse of notation, we associate each prompt as value to a learnable key: $\\mathbf { \\bar { P } } \\overset { ^ { - } } { = } \\{ ( k _ { 1 } , P _ { 1 } ) , ( k _ { 2 } , P _ { 2 } ) , \\cdots , ( k _ { M } , P _ { M } ) \\}$ , where $\\pmb { k } \\in \\mathbb { R } ^ { D _ { k } }$ . Ideally, we would like to let the input instance itself decide which prompts to choose through query-key matching. To this end, we introduce a query function $q : \\mathbb { R } ^ { \\hat { H } \\times W \\times \\hat { C } } \\mathbb { R } ^ { D _ { k } }$ that encodes input $_ { \\textbf { \\em x } }$ to the same dimension as the key. Moreover, $q$ should be a deterministic function with respect to different tasks and has no learnable parameters. We directly use the whole pretrained model as a frozen feature extractor to get the query features: $q ( { \\pmb x } ) = f ( { \\pmb x } ) [ 0 , : ]$ (we use the feature vector corresponding to [class]). Other feature extractors like ConvNet are feasible. ",
|
| 423 |
+
"bbox": [
|
| 424 |
+
173,
|
| 425 |
+
181,
|
| 426 |
+
825,
|
| 427 |
+
348
|
| 428 |
+
],
|
| 429 |
+
"page_idx": 4
|
| 430 |
+
},
|
| 431 |
+
{
|
| 432 |
+
"type": "text",
|
| 433 |
+
"text": "Denote $\\gamma : \\mathbb { R } ^ { D _ { k } } \\times \\mathbb { R } ^ { D _ { k } } \\to \\mathbb { R }$ as a function to score the match between the query and prompt key (we find cosine distance works well). Given an input $_ { \\textbf { \\em x } }$ , we use $q ( { \\pmb x } )$ to lookup the top- $N$ keys by simply solving the objective: ",
|
| 434 |
+
"bbox": [
|
| 435 |
+
174,
|
| 436 |
+
354,
|
| 437 |
+
823,
|
| 438 |
+
397
|
| 439 |
+
],
|
| 440 |
+
"page_idx": 4
|
| 441 |
+
},
|
| 442 |
+
{
|
| 443 |
+
"type": "equation",
|
| 444 |
+
"img_path": "images/cefb0a123923292d414b2c6e64ea16e81efc69f9b266e020811e3f0a0240ab06.jpg",
|
| 445 |
+
"text": "$$\n{ \\bf P } _ { { \\pmb x } } = \\underset { \\{ s _ { i } \\} _ { i = 1 } ^ { N } \\subseteq [ 1 , M ] } { \\arg \\operatorname* { m i n } } \\quad \\sum _ { i = 1 } ^ { N } \\gamma \\left( q ( { \\pmb x } ) , { \\pmb k } _ { { s } _ { i } } \\right) .\n$$",
|
| 446 |
+
"text_format": "latex",
|
| 447 |
+
"bbox": [
|
| 448 |
+
362,
|
| 449 |
+
402,
|
| 450 |
+
633,
|
| 451 |
+
446
|
| 452 |
+
],
|
| 453 |
+
"page_idx": 4
|
| 454 |
+
},
|
| 455 |
+
{
|
| 456 |
+
"type": "text",
|
| 457 |
+
"text": "Note that the design of this key-value strategy decouples the query mechanism learning and prompt learning processes, which has been experimentally shown to be critical (see Section 5.3). Furthermore, querying prompts is done in an instance-wise fashion, which makes the whole framework task-agnostic, meaning that the method works without needing clear task boundaries during training, nor task identifications at test time. ",
|
| 458 |
+
"bbox": [
|
| 459 |
+
173,
|
| 460 |
+
450,
|
| 461 |
+
825,
|
| 462 |
+
520
|
| 463 |
+
],
|
| 464 |
+
"page_idx": 4
|
| 465 |
+
},
|
| 466 |
+
{
|
| 467 |
+
"type": "text",
|
| 468 |
+
"text": "Optionally diversifying prompt-selection. Although our method does not need task boundary information, in real-world scenarios and experimental datasets, it is quite common that the task transition is discrete and so task boundaries are known at train time. We find that adding such a prior into our framework can help the model learn better task-specific prompts, especially when tasks have high diversity. To this end, we propose an additional technique for adding task boundaries which is optional for the L2P framework. ",
|
| 469 |
+
"bbox": [
|
| 470 |
+
174,
|
| 471 |
+
526,
|
| 472 |
+
825,
|
| 473 |
+
612
|
| 474 |
+
],
|
| 475 |
+
"page_idx": 4
|
| 476 |
+
},
|
| 477 |
+
{
|
| 478 |
+
"type": "text",
|
| 479 |
+
"text": "During training of task $t$ , we maintain a prompt frequency table $H _ { t } = [ h _ { 1 } , h _ { 2 } , \\cdot \\cdot \\cdot , h _ { M } ]$ , where each entry represents the normalized frequency of prompt $P _ { i }$ being selected up until task $t - 1$ . To encourage the query mechanism select diverse prompts, we modify equation 3 to ",
|
| 480 |
+
"bbox": [
|
| 481 |
+
174,
|
| 482 |
+
617,
|
| 483 |
+
825,
|
| 484 |
+
661
|
| 485 |
+
],
|
| 486 |
+
"page_idx": 4
|
| 487 |
+
},
|
| 488 |
+
{
|
| 489 |
+
"type": "equation",
|
| 490 |
+
"img_path": "images/b938d210ec55c6aaeec67c899910f486fadd0534007595d80a0b3c8944935d44.jpg",
|
| 491 |
+
"text": "$$\n\\mathbf { P } _ { \\pmb { x } } = \\operatorname * { a r g m i n } _ { \\{ s _ { i } \\} _ { i = 1 } ^ { N } \\subseteq [ 1 , M ] } \\quad \\sum _ { i = 1 } ^ { N } \\gamma \\left( q ( \\pmb { x } ) , \\pmb { k } _ { s _ { i } } \\right) \\cdot h _ { s _ { i } } ,\n$$",
|
| 492 |
+
"text_format": "latex",
|
| 493 |
+
"bbox": [
|
| 494 |
+
348,
|
| 495 |
+
666,
|
| 496 |
+
648,
|
| 497 |
+
709
|
| 498 |
+
],
|
| 499 |
+
"page_idx": 4
|
| 500 |
+
},
|
| 501 |
+
{
|
| 502 |
+
"type": "text",
|
| 503 |
+
"text": "where $h _ { s _ { i } }$ penalizes the frequently-used prompts being selected to encourage diversified selection. \nEquation 4 is only applicable during training; at test time, only equation 3 is needed. ",
|
| 504 |
+
"bbox": [
|
| 505 |
+
171,
|
| 506 |
+
714,
|
| 507 |
+
821,
|
| 508 |
+
742
|
| 509 |
+
],
|
| 510 |
+
"page_idx": 4
|
| 511 |
+
},
|
| 512 |
+
{
|
| 513 |
+
"type": "text",
|
| 514 |
+
"text": "4.3 OPTIMIZATION OBJECTIVE FOR L2P ",
|
| 515 |
+
"text_level": 1,
|
| 516 |
+
"bbox": [
|
| 517 |
+
176,
|
| 518 |
+
758,
|
| 519 |
+
464,
|
| 520 |
+
773
|
| 521 |
+
],
|
| 522 |
+
"page_idx": 4
|
| 523 |
+
},
|
| 524 |
+
{
|
| 525 |
+
"type": "text",
|
| 526 |
+
"text": "At every training step, after selecting $N$ prompts following the aforementioned query strategy, the adapted embedding feature $\\mathbf { \\boldsymbol { x } } _ { p }$ is fed into the rest of the pretrained model $f _ { r }$ and the final classifier $g _ { \\phi }$ parametrized by $\\phi$ . Overall, we seek to minimize the end-to-end training loss function: ",
|
| 527 |
+
"bbox": [
|
| 528 |
+
174,
|
| 529 |
+
777,
|
| 530 |
+
825,
|
| 531 |
+
820
|
| 532 |
+
],
|
| 533 |
+
"page_idx": 4
|
| 534 |
+
},
|
| 535 |
+
{
|
| 536 |
+
"type": "equation",
|
| 537 |
+
"img_path": "images/88ccd56ac23367bbd981ba1cc80c57351dc78cfbd89415bee8fd6e5f80c7bf30.jpg",
|
| 538 |
+
"text": "$$\n\\operatorname* { m i n } _ { \\mathbf { P } , \\phi } \\quad \\mathcal { L } \\big ( g _ { \\phi } \\big ( f _ { r } ^ { \\mathrm { a v g } } ( x _ { p } ) \\big ) , y \\big ) + \\lambda \\sum _ { \\mathbf { P } _ { x } } \\gamma \\left( q ( x ) , k _ { s _ { i } } \\right) , \\quad s . t . , ~ \\mathbf { P } _ { x } \\mathrm { ~ i s ~ o b t a i n e d ~ w i t h ~ e q u a t i o n } \\ 3 ,\n$$",
|
| 539 |
+
"text_format": "latex",
|
| 540 |
+
"bbox": [
|
| 541 |
+
192,
|
| 542 |
+
825,
|
| 543 |
+
782,
|
| 544 |
+
861
|
| 545 |
+
],
|
| 546 |
+
"page_idx": 4
|
| 547 |
+
},
|
| 548 |
+
{
|
| 549 |
+
"type": "text",
|
| 550 |
+
"text": "where $f _ { r } ^ { \\mathrm { a v g } } = \\mathrm { A v g P o o l } ( f _ { r } ( \\pmb { x } _ { p } ) [ N \\cdot L _ { p } , : ] )$ , i.e., the output hidden vectors corresponding to the $N \\cdot L _ { p }$ prompt locations are averaged before the classification head. The first term is the softmax cross-entropy loss, the second term is a surrogate loss to pull selected keys closer to corresponding query features. $\\lambda$ is a scalar to weight the loss. ",
|
| 551 |
+
"bbox": [
|
| 552 |
+
174,
|
| 553 |
+
867,
|
| 554 |
+
825,
|
| 555 |
+
924
|
| 556 |
+
],
|
| 557 |
+
"page_idx": 4
|
| 558 |
+
},
|
| 559 |
+
{
|
| 560 |
+
"type": "text",
|
| 561 |
+
"text": "5 EXPERIMENTS ",
|
| 562 |
+
"text_level": 1,
|
| 563 |
+
"bbox": [
|
| 564 |
+
174,
|
| 565 |
+
102,
|
| 566 |
+
326,
|
| 567 |
+
117
|
| 568 |
+
],
|
| 569 |
+
"page_idx": 5
|
| 570 |
+
},
|
| 571 |
+
{
|
| 572 |
+
"type": "text",
|
| 573 |
+
"text": "To evaluate the proposed L2P, we closely follow the settings proposed in prior works (Lopez-Paz & Ranzato, 2017; Zeno et al., 2018; Van de Ven & Tolias, 2019), and conduct comprehensive experiments. In particular, we consider (1) the class-incremental setting, where the task identity is unknown during inference; (2) the domain-incremental setting, where the input domain shifts over time; (3) the task-agnostic setting, where there is no clear task boundary. Moreover, we conduct extensive ablation studies to provide a deeper understanding of our method. ",
|
| 574 |
+
"bbox": [
|
| 575 |
+
173,
|
| 576 |
+
127,
|
| 577 |
+
825,
|
| 578 |
+
210
|
| 579 |
+
],
|
| 580 |
+
"page_idx": 5
|
| 581 |
+
},
|
| 582 |
+
{
|
| 583 |
+
"type": "text",
|
| 584 |
+
"text": "Evaluation metrics. For settings with task boundaries and where each task has an associated test set, we use two metrics, Average accuracy $( A )$ and Forgetting $( F )$ , which are widely used in previous works (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2018; Mai et al., 2021). Denoting by $\\mathbf { \\Psi } _ { a _ { t , i } }$ the accuracy of the $i$ -th task after finishing training on task $t$ , we can compute the corresponding average accuracy $A _ { t }$ and forgetting $F _ { t }$ up until the current task $t$ as follows: ",
|
| 585 |
+
"bbox": [
|
| 586 |
+
174,
|
| 587 |
+
217,
|
| 588 |
+
825,
|
| 589 |
+
287
|
| 590 |
+
],
|
| 591 |
+
"page_idx": 5
|
| 592 |
+
},
|
| 593 |
+
{
|
| 594 |
+
"type": "equation",
|
| 595 |
+
"img_path": "images/8713d6ae02e37be2e274e4f7057eb2f33cdd4da84b11a9a6d6fb6126964b32ec.jpg",
|
| 596 |
+
"text": "$$\nA _ { t } = \\frac { 1 } { t } \\sum _ { i = 1 } ^ { t } a _ { t , i } , \\quad F _ { t } & = \\frac { 1 } { t - 1 } \\sum _ { i = 1 } ^ { t - 1 } \\operatorname* { m a x } _ { i ^ { \\prime } \\in \\{ 1 , \\cdots , t - 1 \\} } \\left( a _ { i ^ { \\prime } , i } - a _ { t , i } \\right) .\n$$",
|
| 597 |
+
"text_format": "latex",
|
| 598 |
+
"bbox": [
|
| 599 |
+
287,
|
| 600 |
+
294,
|
| 601 |
+
710,
|
| 602 |
+
337
|
| 603 |
+
],
|
| 604 |
+
"page_idx": 5
|
| 605 |
+
},
|
| 606 |
+
{
|
| 607 |
+
"type": "text",
|
| 608 |
+
"text": "We report the final performance $A _ { T }$ and $F _ { T }$ after training on all $T$ tasks. For settings without task boundary or where there is only a single test set available, we only report the final test accuracy following the protocol in previous work (Lomonaco & Maltoni, 2017; Shanahan et al., 2021). ",
|
| 609 |
+
"bbox": [
|
| 610 |
+
174,
|
| 611 |
+
338,
|
| 612 |
+
825,
|
| 613 |
+
380
|
| 614 |
+
],
|
| 615 |
+
"page_idx": 5
|
| 616 |
+
},
|
| 617 |
+
{
|
| 618 |
+
"type": "text",
|
| 619 |
+
"text": "Comparing methods. We compare L2P against several baselines and state-of-the-art continual learning methods. Note that we used the same pretrained ViT-B/16 model (Dosovitskiy et al., 2021) as a starting point for every method to ensure fair comparison. (1) FT-iid is the usual supervised finetuning under the i.i.d. setting, which is the possible upper bound performance a continual learning method could achieve. (2) FT-seq-frozen is the naive sequential fine-tuning approach with the pretrained model frozen. (3) FT-seq is the naive sequential fine-tuning approach (model weights are updated). (4) EWC (Kirkpatrick et al., 2017) is a regularization-based approach aiming at limiting the learning rate of parameters that are important for previous tasks. (5) LwF (Li & Hoiem, 2017) applies the idea of knowledge distillation (Hinton et al., 2015) to preserve knowledge from past tasks. To further demonstrate the effectiveness of our method, we introduce two state-of-the-art rehearsal-based methods, which require additional memory buffer to save samples from past tasks: (6) ER (Chaudhry et al., 2019; Hayes et al., 2019) mixes samples from buffer with samples the from current task in the training process. (7) GDumb (Prabhu et al., 2020) simply constructs the buffer from the sequence of tasks and trains on the buffered samples jointly, so forgetting metric is not applicable to this method. GDumb can outperform many state-of-the-art methods under various settings (Prabhu et al., 2020; Mai et al., 2021). Following the experiment setting in Prabhu et al. (2020), we store an average of 50 samples per class, e.g., a buffer size of 5,000 for CIFAR100, as this is a relatively large choice of buffer size that guarantees SOTA performance. ",
|
| 620 |
+
"bbox": [
|
| 621 |
+
173,
|
| 622 |
+
385,
|
| 623 |
+
825,
|
| 624 |
+
636
|
| 625 |
+
],
|
| 626 |
+
"page_idx": 5
|
| 627 |
+
},
|
| 628 |
+
{
|
| 629 |
+
"type": "text",
|
| 630 |
+
"text": "Experiment details. For L2P, we train all models using Adam (Kingma & Ba, 2014) with $\\beta _ { 1 } = 0 . 9$ and $\\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , a batch size of 128, and a constant learning rate of 0.03 for all settings. Input images are resized to $2 2 4 \\times 2 2 4$ and normalized to the range of $[ 0 , 1 ]$ to match the pretraining setting. As pointed out by Buzzega et al. (2020), training multiple epochs for each task disentangles the effects of possible underfitting from forgetting. Thus, we train every task for 5 epochs in the class- and domain-incremental settings. However, in the task-agnostic setting where we don’t have the concept of a task, we follow Shanahan et al. (2021) to train every batch only once. We set $M = 1 0 ^ { - } N = 5 , L _ { p } = 5$ for all CIFAR-100 based datasets and CORe50. For 5-datasets, we use $M = 2 0 , N = 4 , L _ { p } = 5$ . Prompts only add 46, 080 and 92, 160 parameters to the original pretrained model for these two settings, leading to a small $0 . 0 5 \\%$ and $0 . 1 1 \\%$ total parameter increase, respectively. We find $\\lambda$ in equation 5 is not sensitive and works well in a large range, so we set $\\lambda = 0 . 5$ consistently for all datasets. ",
|
| 631 |
+
"bbox": [
|
| 632 |
+
173,
|
| 633 |
+
642,
|
| 634 |
+
825,
|
| 635 |
+
809
|
| 636 |
+
],
|
| 637 |
+
"page_idx": 5
|
| 638 |
+
},
|
| 639 |
+
{
|
| 640 |
+
"type": "text",
|
| 641 |
+
"text": "5.1 RESULTS ON CLASS-INCREMENTAL LEARNING ",
|
| 642 |
+
"text_level": 1,
|
| 643 |
+
"bbox": [
|
| 644 |
+
174,
|
| 645 |
+
827,
|
| 646 |
+
540,
|
| 647 |
+
842
|
| 648 |
+
],
|
| 649 |
+
"page_idx": 5
|
| 650 |
+
},
|
| 651 |
+
{
|
| 652 |
+
"type": "text",
|
| 653 |
+
"text": "Split CIFAR-100. This dataset randomly splits the original CIFAR-100 dataset (Krizhevsky et al., 2009) into 10 tasks, where each task consist of 10 disjoint classes. Since the tasks are from a single original dataset, they share some similarities and some classes are even from the same superclass. ",
|
| 654 |
+
"bbox": [
|
| 655 |
+
174,
|
| 656 |
+
847,
|
| 657 |
+
825,
|
| 658 |
+
888
|
| 659 |
+
],
|
| 660 |
+
"page_idx": 5
|
| 661 |
+
},
|
| 662 |
+
{
|
| 663 |
+
"type": "text",
|
| 664 |
+
"text": "5-datasets. This dataset (Ebrahimi et al., 2020) consists of five image classification datasets: CIFAR-10, MNIST (LeCun, 1998), Fashion-MNIST (Xiao et al., 2017), SVHN (Netzer et al., 2011), and notMNIST (Bulatov, 2011). Although each dataset alone is not hard, the sequential training of them is fairly challenging to even ImageNet pre-trained models, since models are more susceptible to forgetting when the tasks are diverse (Mehta et al., 2021). We apply the optional strategy introduced in 4.2 to enhance prompt selection diversity. ",
|
| 665 |
+
"bbox": [
|
| 666 |
+
174,
|
| 667 |
+
895,
|
| 668 |
+
823,
|
| 669 |
+
924
|
| 670 |
+
],
|
| 671 |
+
"page_idx": 5
|
| 672 |
+
},
|
| 673 |
+
{
|
| 674 |
+
"type": "table",
|
| 675 |
+
"img_path": "images/099581c7bafe70e14b202bdacd3b566df6f0b7cee4f789a8aedc2189bde09adf.jpg",
|
| 676 |
+
"table_caption": [
|
| 677 |
+
"Table 1: Results on class-incremental learning. Accuracy and forgetting are reported. All methods start from the same pre-trained ViTB/16 model and train on each task for 5 epochs. Methods are separated based on whether rehearsal is applied. All results are shown in percentage $( \\% )$ and are averaged over 3 runs. "
|
| 678 |
+
],
|
| 679 |
+
"table_footnote": [],
|
| 680 |
+
"table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"2\">Split CIFAR-100</td><td colspan=\"2\"> 5-datasets</td></tr><tr><td>Average Acc (↑) </td><td>Forgetting (↓)</td><td>Average Acc (↑)</td><td>Forgetting (↓)</td></tr><tr><td colspan=\"5\">Upper bound:</td></tr><tr><td>FT-iid</td><td>90.85±0.12</td><td></td><td>93.93±0.18</td><td></td></tr><tr><td colspan=\"5\">Non-rehearsal based methods:</td></tr><tr><td>FT-seq-frozen</td><td>17.72±0.34</td><td>59.09±0.25</td><td>39.49±0.12</td><td>42.62±0.20</td></tr><tr><td>FT-seq</td><td>33.61±0.85</td><td>86.87±0.20</td><td>20.12±0.42</td><td>94.63±0.68</td></tr><tr><td>EWC LwF</td><td>47.01±0.29</td><td>33.27±1.17</td><td>50.93±0.09</td><td>34.94±0.07</td></tr><tr><td>L2P (ours)</td><td>60.69±0.63</td><td>27.77±2.17</td><td>47.91±0.33</td><td>38.01±0.28</td></tr><tr><td></td><td>83.83±0.04</td><td>7.63±0.30</td><td>81.14 ±0.93</td><td>4.64 ±0.52</td></tr><tr><td colspan=\"5\">Rehearsal based methods:</td></tr><tr><td>ER</td><td>82.53±0.17</td><td>16.46±0.25</td><td>89.30±0.94</td><td>8.08±0.53</td></tr><tr><td>GDumb</td><td>81.67±0.02</td><td>-</td><td>70.76±0.12</td><td>1</td></tr><tr><td>L2P-R (ours)</td><td>86.31±0.59</td><td>5.83±0.61</td><td>91.92±0.78</td><td>3.34±0.71</td></tr></table>",
|
| 681 |
+
"bbox": [
|
| 682 |
+
227,
|
| 683 |
+
164,
|
| 684 |
+
769,
|
| 685 |
+
407
|
| 686 |
+
],
|
| 687 |
+
"page_idx": 6
|
| 688 |
+
},
|
| 689 |
+
{
|
| 690 |
+
"type": "table",
|
| 691 |
+
"img_path": "images/c3b5792f03bdf715958baa91139338a6d8ec5c0b077f8e0b6f67559ee8955cbf.jpg",
|
| 692 |
+
"table_caption": [
|
| 693 |
+
"Table 2: Results on task-agnostic continual learning, in terms of test accuracy. We use Gaussian scheduled CIFAR-100 as the evaluation benchmark. All results are shown in percentage $( \\% )$ and are averaged across 3 runs. "
|
| 694 |
+
],
|
| 695 |
+
"table_footnote": [],
|
| 696 |
+
"table_body": "<table><tr><td>Category</td><td>Method</td><td>Test Acc (↑)</td></tr><tr><td>Upper bound</td><td>FT-iid</td><td>90.85±0.12</td></tr><tr><td rowspan=\"2\">Rehearsal</td><td>ER</td><td>82.53±0.17</td></tr><tr><td>GDumb</td><td>81.67±0.02</td></tr><tr><td rowspan=\"3\">Non-rehearsal</td><td>EWC</td><td>63.04±0.42</td></tr><tr><td>LwF</td><td>69.46±0.35</td></tr><tr><td>L2P (ours)</td><td>88.34±0.14</td></tr></table>",
|
| 697 |
+
"bbox": [
|
| 698 |
+
179,
|
| 699 |
+
525,
|
| 700 |
+
465,
|
| 701 |
+
641
|
| 702 |
+
],
|
| 703 |
+
"page_idx": 6
|
| 704 |
+
},
|
| 705 |
+
{
|
| 706 |
+
"type": "table",
|
| 707 |
+
"img_path": "images/b70852603919816c86f2bdac7581a13e2bf5dc73c04df766cf727b1bbb48b666.jpg",
|
| 708 |
+
"table_caption": [
|
| 709 |
+
"Table 3: Results on domain-incremental learning, in terms of test accuracy. We use CORe50 as the evaluation benchmark. All results are shown in percentage $( \\% )$ and are averaged across 3 runs. "
|
| 710 |
+
],
|
| 711 |
+
"table_footnote": [],
|
| 712 |
+
"table_body": "<table><tr><td>Category</td><td>Method</td><td>Test Acc (↑)</td></tr><tr><td>Upper bound</td><td>FT-iid</td><td>82.15 ±0.37</td></tr><tr><td rowspan=\"2\">Rehearsal</td><td>ER</td><td>80.10±0.56</td></tr><tr><td>GDumb</td><td>74.92±0.25</td></tr><tr><td rowspan=\"3\">Non-rehearsal</td><td>EWC</td><td>74.82±0.60</td></tr><tr><td>LwF</td><td>75.45±0.40</td></tr><tr><td>L2P (ours)</td><td>78.33±0.06</td></tr></table>",
|
| 713 |
+
"bbox": [
|
| 714 |
+
521,
|
| 715 |
+
525,
|
| 716 |
+
805,
|
| 717 |
+
640
|
| 718 |
+
],
|
| 719 |
+
"page_idx": 6
|
| 720 |
+
},
|
| 721 |
+
{
|
| 722 |
+
"type": "text",
|
| 723 |
+
"text": "",
|
| 724 |
+
"bbox": [
|
| 725 |
+
173,
|
| 726 |
+
672,
|
| 727 |
+
825,
|
| 728 |
+
728
|
| 729 |
+
],
|
| 730 |
+
"page_idx": 6
|
| 731 |
+
},
|
| 732 |
+
{
|
| 733 |
+
"type": "text",
|
| 734 |
+
"text": "Table 1 summarizes the results on these two class-incremental benchmarks. Similar to what Mehta et al. (2021) have shown: in the simpler task-incremental setting, pre-trained models can overall improve these benchmarks when integrated with existing methods. However, the forgetting rate remains prominent in the class-incremental setting as we shown, suggesting the importance of innovating technologies in pre-trained models beyond applying existing methods. ",
|
| 735 |
+
"bbox": [
|
| 736 |
+
173,
|
| 737 |
+
734,
|
| 738 |
+
825,
|
| 739 |
+
806
|
| 740 |
+
],
|
| 741 |
+
"page_idx": 6
|
| 742 |
+
},
|
| 743 |
+
{
|
| 744 |
+
"type": "text",
|
| 745 |
+
"text": "Our method, L2P, achieves superior performance in terms of both average accuracy and forgetting. In particular, our method: (1) outperforms all non-rehearsal based methods by a large margin, including beating rehearsal-based methods on split CIFAR-100 without rehearsal; and (2) our method improves upon state-of-the-art rehearsal-based methods when incorporating the rehearsal strategy, closing a significant part of the gap to the upper bound performance when doing finetuning under the i.i.d. setting; and (3) compared to the performance of FT-seq-frozen with our method, we can see that naive sequential training is not able to fully take advantage of the pretrained features, further demonstrating the advantages of introducing the prompting strategy. ",
|
| 746 |
+
"bbox": [
|
| 747 |
+
174,
|
| 748 |
+
811,
|
| 749 |
+
825,
|
| 750 |
+
924
|
| 751 |
+
],
|
| 752 |
+
"page_idx": 6
|
| 753 |
+
},
|
| 754 |
+
{
|
| 755 |
+
"type": "table",
|
| 756 |
+
"img_path": "images/2bc959636378fc23584d34ac0ff712fe11be9d11936b03094222f1eb92a5c5d1.jpg",
|
| 757 |
+
"table_caption": [
|
| 758 |
+
"Table 4: Ablation study on 5-datasets. All results are shown in percentage $( \\% )$ . "
|
| 759 |
+
],
|
| 760 |
+
"table_footnote": [],
|
| 761 |
+
"table_body": "<table><tr><td>Method</td><td colspan=\"2\">5-datasets</td></tr><tr><td></td><td>Average Acc (↑)</td><td>Forgetting (↓)</td></tr><tr><td>L2P without prompt pool</td><td>51.96</td><td>26.60</td></tr><tr><td>L2P without key-value pair</td><td>58.33</td><td>20.45</td></tr><tr><td>L2P without diversified prompt selection</td><td>62.26</td><td>17.84</td></tr><tr><td>L2P</td><td>81.14</td><td>4.64</td></tr></table>",
|
| 762 |
+
"bbox": [
|
| 763 |
+
258,
|
| 764 |
+
123,
|
| 765 |
+
740,
|
| 766 |
+
222
|
| 767 |
+
],
|
| 768 |
+
"page_idx": 7
|
| 769 |
+
},
|
| 770 |
+
{
|
| 771 |
+
"type": "image",
|
| 772 |
+
"img_path": "images/a5b18375003ad8be65525bc772163ea949f3a3366ea66a4212b70750bd154e79.jpg",
|
| 773 |
+
"image_caption": [
|
| 774 |
+
"Figure 3: Prompt selection histograms for (left) Split CIFAR-100 and (right) 5-datasets. Note that we only show the first 5 tasks for Split CIFAR-100 for better readability. "
|
| 775 |
+
],
|
| 776 |
+
"image_footnote": [],
|
| 777 |
+
"bbox": [
|
| 778 |
+
254,
|
| 779 |
+
229,
|
| 780 |
+
753,
|
| 781 |
+
377
|
| 782 |
+
],
|
| 783 |
+
"page_idx": 7
|
| 784 |
+
},
|
| 785 |
+
{
|
| 786 |
+
"type": "text",
|
| 787 |
+
"text": "5.2 RESULTS ON TASK-AGNOSTIC AND DOMAIN INCREMENTAL SETTINGS ",
|
| 788 |
+
"text_level": 1,
|
| 789 |
+
"bbox": [
|
| 790 |
+
173,
|
| 791 |
+
436,
|
| 792 |
+
694,
|
| 793 |
+
449
|
| 794 |
+
],
|
| 795 |
+
"page_idx": 7
|
| 796 |
+
},
|
| 797 |
+
{
|
| 798 |
+
"type": "text",
|
| 799 |
+
"text": "Gaussian scheduled CIFAR-100. In this task-agnostic setting, the distribution of data shifts gradually throughout the learning process (Shanahan et al., 2021), the probability that a class is present in a batch follows a Gaussian distribution centered at some time step. There is no explicit task boundaries between batches, thus requiring methods to be able to implicitly adapt to non-stationary data distribution without utilizing any task-specific information during training and inference. ",
|
| 800 |
+
"bbox": [
|
| 801 |
+
174,
|
| 802 |
+
460,
|
| 803 |
+
823,
|
| 804 |
+
531
|
| 805 |
+
],
|
| 806 |
+
"page_idx": 7
|
| 807 |
+
},
|
| 808 |
+
{
|
| 809 |
+
"type": "text",
|
| 810 |
+
"text": "Table 2 summarizes the results. L2P achieves the best performance among all methods, including rehearsal based ones. The task-agnostic setting is usually considered more challenging than the class-incremental setting. Since these two benchmarks have the same test test, we can compare them deeper. Interestingly, EWC and LwF both achieve higher accuracy than that on split CIFAR-100, indicating that a well-pretrained model itself may serve as a better starting point for task-agnostic continual learning. Similar observations has been reported on a simpler task-incremental setting in Mehta et al. (2021). Moreover, L2P achieves a test accuracy $8 8 . 3 4 \\%$ , which is very close to the upper bound performance $9 0 . 8 5 \\%$ shown in Table 1, suggesting strongly reduced forgetting rate. ",
|
| 811 |
+
"bbox": [
|
| 812 |
+
174,
|
| 813 |
+
537,
|
| 814 |
+
825,
|
| 815 |
+
650
|
| 816 |
+
],
|
| 817 |
+
"page_idx": 7
|
| 818 |
+
},
|
| 819 |
+
{
|
| 820 |
+
"type": "text",
|
| 821 |
+
"text": "CORe50. This is a dataset specifically designed for continual object recognition (Lomonaco & Maltoni, 2017). It is a collection of 50 objects collected in 11 distinct domains, where 8 of them (120,000 samples) are used for training, and the rest are considered as a single test set (45,000 examples). Methods are trained on each domain sequentially. ",
|
| 822 |
+
"bbox": [
|
| 823 |
+
174,
|
| 824 |
+
656,
|
| 825 |
+
825,
|
| 826 |
+
712
|
| 827 |
+
],
|
| 828 |
+
"page_idx": 7
|
| 829 |
+
},
|
| 830 |
+
{
|
| 831 |
+
"type": "text",
|
| 832 |
+
"text": "Table 3 summarizes the results on the domain-incremental setting. Although L2P still achieves better performance than most methods, surprisingly, all methods are quite close to the upper bound performance FT-iid. This indicates that a well pretrained model has the potential to accumulate knowledge from different domains without much interference. However, more comprehensive experiments are required to further confirm this observation, which we leave to future work. ",
|
| 833 |
+
"bbox": [
|
| 834 |
+
174,
|
| 835 |
+
719,
|
| 836 |
+
823,
|
| 837 |
+
789
|
| 838 |
+
],
|
| 839 |
+
"page_idx": 7
|
| 840 |
+
},
|
| 841 |
+
{
|
| 842 |
+
"type": "text",
|
| 843 |
+
"text": "5.3 EFFECTIVENESS OF CORE DESIGNS ",
|
| 844 |
+
"text_level": 1,
|
| 845 |
+
"bbox": [
|
| 846 |
+
176,
|
| 847 |
+
806,
|
| 848 |
+
455,
|
| 849 |
+
820
|
| 850 |
+
],
|
| 851 |
+
"page_idx": 7
|
| 852 |
+
},
|
| 853 |
+
{
|
| 854 |
+
"type": "text",
|
| 855 |
+
"text": "We further conduct ablation studies to demonstrate the effectiveness of the core designs of L2P. ",
|
| 856 |
+
"bbox": [
|
| 857 |
+
173,
|
| 858 |
+
833,
|
| 859 |
+
799,
|
| 860 |
+
847
|
| 861 |
+
],
|
| 862 |
+
"page_idx": 7
|
| 863 |
+
},
|
| 864 |
+
{
|
| 865 |
+
"type": "text",
|
| 866 |
+
"text": "Prompt pool. To further confirm the importance of the prompt pool, we design a counterpart of our method with only a single prompt instead of the prompt pool. This variation of our method keeps the same prompt capacity as L2P in equation 2. From Table 4 (row 1 and 4), we can see that L2P significantly outperforms its counterpart with a single prompt, suggesting that the prompt pool encodes task-relevant and task-specific knowledge well. ",
|
| 867 |
+
"bbox": [
|
| 868 |
+
174,
|
| 869 |
+
854,
|
| 870 |
+
823,
|
| 871 |
+
924
|
| 872 |
+
],
|
| 873 |
+
"page_idx": 7
|
| 874 |
+
},
|
| 875 |
+
{
|
| 876 |
+
"type": "image",
|
| 877 |
+
"img_path": "images/791ba5f7100cc72c11bc599dc9c7f189726cce930a5b6b7ffeabcddbd4201067.jpg",
|
| 878 |
+
"image_caption": [
|
| 879 |
+
"Figure 4: Left-Middle: Average accuracy w.r.t prompt length $L _ { p }$ and prompt selection size $N$ for Split CIFAR-100 and 5-datasets, respectively, given $M = 2 0$ . Right: Average accuracy $( \\% )$ w.r.t. prompt pool size $M$ , given $L _ { p } = 5$ , $N = 5$ for Split CIFAR-100 and $L _ { p } = 5$ , $N = 4$ for 5-datasets. "
|
| 880 |
+
],
|
| 881 |
+
"image_footnote": [],
|
| 882 |
+
"bbox": [
|
| 883 |
+
184,
|
| 884 |
+
99,
|
| 885 |
+
816,
|
| 886 |
+
257
|
| 887 |
+
],
|
| 888 |
+
"page_idx": 8
|
| 889 |
+
},
|
| 890 |
+
{
|
| 891 |
+
"type": "text",
|
| 892 |
+
"text": "Key-value pair design. We remove the learnable key associated with prompts and directly use mean of prompts as keys and the mean of input embedding as query features, as they reside in the same space. From Table 4 (row 2), we can see this results in a significant drop, demonstrating the importance of introducing learnable keys to decouple the query and prompt learning process. ",
|
| 893 |
+
"bbox": [
|
| 894 |
+
174,
|
| 895 |
+
337,
|
| 896 |
+
825,
|
| 897 |
+
393
|
| 898 |
+
],
|
| 899 |
+
"page_idx": 8
|
| 900 |
+
},
|
| 901 |
+
{
|
| 902 |
+
"type": "text",
|
| 903 |
+
"text": "Diversified prompt selection. This technique is used by default on 5-dataset only. When we remove it, (Table 4 row 3), we basically allow instances from different tasks to choose prompts freely. The decrease in performance demonstrates that when tasks are diverse, adding the diversified prompt selection strategy can indeed reduce unnecessary knowledge sharing and thus mitigating interference between unrelated tasks. ",
|
| 904 |
+
"bbox": [
|
| 905 |
+
174,
|
| 906 |
+
400,
|
| 907 |
+
825,
|
| 908 |
+
469
|
| 909 |
+
],
|
| 910 |
+
"page_idx": 8
|
| 911 |
+
},
|
| 912 |
+
{
|
| 913 |
+
"type": "text",
|
| 914 |
+
"text": "To better understand the prompt selection mechanism, we plot the prompt selection histograms for each task in both split CIFAR-100 and 5-datasets in Figure 3 under the best-performing parameters settings, respectively. From the plot of Split CIFAR-100 (left), the tasks largely share all prompts, meaning that our prompt selection mechanism encourages more knowledge sharing between similar tasks. In contrast, in the plot of 5-datasets (right), diverse tasks tends to choose more task-specific prompts and share less. ",
|
| 915 |
+
"bbox": [
|
| 916 |
+
174,
|
| 917 |
+
477,
|
| 918 |
+
825,
|
| 919 |
+
560
|
| 920 |
+
],
|
| 921 |
+
"page_idx": 8
|
| 922 |
+
},
|
| 923 |
+
{
|
| 924 |
+
"type": "text",
|
| 925 |
+
"text": "Effect of hyperparameters for L2P. Recall that there are three key hyperparameters, including the size of the prompt pool $M$ , length of a single prompt $L _ { p }$ , and the selection size $N$ used as model input. Intuitively, $M$ decides the total capacity of learnable prompt parameters. $L _ { p }$ decides capacity of a singe prompt (which jointly encodes certain knowledge), and $L _ { p } \\times N$ decides the total size used to prepend the input. From the results on both datasets (Figure 4 (left-middle)), a smaller $L _ { p }$ always negatively affects results. We hypothesize that a reasonable capacity of a single prompt is critical to encode a certain aspect of shared knowledge. Increasing the prompt pool size shows positive effect for performance as shown in Figure 4 (right), especially on 5-datasets, suggesting a large enough pool size is needed to encode task-specific knowledge when tasks are diverse. ",
|
| 926 |
+
"bbox": [
|
| 927 |
+
173,
|
| 928 |
+
568,
|
| 929 |
+
825,
|
| 930 |
+
693
|
| 931 |
+
],
|
| 932 |
+
"page_idx": 8
|
| 933 |
+
},
|
| 934 |
+
{
|
| 935 |
+
"type": "text",
|
| 936 |
+
"text": "6 CONCLUSION ",
|
| 937 |
+
"text_level": 1,
|
| 938 |
+
"bbox": [
|
| 939 |
+
174,
|
| 940 |
+
720,
|
| 941 |
+
318,
|
| 942 |
+
736
|
| 943 |
+
],
|
| 944 |
+
"page_idx": 8
|
| 945 |
+
},
|
| 946 |
+
{
|
| 947 |
+
"type": "text",
|
| 948 |
+
"text": "This paper presents a novel method to address some of the key challenges in continual learning with a method that can achieve strong performance without a need for rehearsal and task identity. L2P introduces prompt-based learning to continual learning and proposes a novel technique to enable a single pre-trained model to adapt to sequential tasks via a shared prompt pool, successfully mitigating the catastrophic forgetting problem. The resulting method achieves good results on challenging continual learning problems, including class-incremental, domain-incremental, and task-agnostic settings, demonstrating the effectiveness of the method, as well as its advantages to satisfy the practical data privacy requirement when storing data as rehearsal buffer is prohibited. ",
|
| 949 |
+
"bbox": [
|
| 950 |
+
174,
|
| 951 |
+
750,
|
| 952 |
+
825,
|
| 953 |
+
861
|
| 954 |
+
],
|
| 955 |
+
"page_idx": 8
|
| 956 |
+
},
|
| 957 |
+
{
|
| 958 |
+
"type": "text",
|
| 959 |
+
"text": "Although our method is demonstrated on vision models, it does not make any assumption of modalities. We leave exploration on other modalities as future work. Additionally, L2P assumes there are pre-trained sequence-based models. While they have become common assets in advanced communities, how to generalize our framework to ConvNets could another appealing research direction. ",
|
| 960 |
+
"bbox": [
|
| 961 |
+
174,
|
| 962 |
+
867,
|
| 963 |
+
823,
|
| 964 |
+
924
|
| 965 |
+
],
|
| 966 |
+
"page_idx": 8
|
| 967 |
+
},
|
| 968 |
+
{
|
| 969 |
+
"type": "text",
|
| 970 |
+
"text": "7 ETHICS STATEMENT ",
|
| 971 |
+
"text_level": 1,
|
| 972 |
+
"bbox": [
|
| 973 |
+
176,
|
| 974 |
+
102,
|
| 975 |
+
374,
|
| 976 |
+
118
|
| 977 |
+
],
|
| 978 |
+
"page_idx": 9
|
| 979 |
+
},
|
| 980 |
+
{
|
| 981 |
+
"type": "text",
|
| 982 |
+
"text": "L2P is a strong continual learning method and has great potential to be applied in various fields. However, there are some ways it could be misused. Our method takes a well-pretrained model as a backbone, thus any bias and fairness issues (Mehrabi et al., 2021) in the original model may be carried over during the continual learning process. We encourage any users to thoroughly check the pretrained model to mitigate any bias and fairness issues. Moreover, the method could be deployed in safety-critical applications, such as autonomous driving systems (Grigorescu et al., 2020), which may present potential security issues in terms of adversarial attacks (Madry et al., 2017). We would recommend testing the robustness of our method in future work and design corresponding defense techniques to deal with potential security concerns. ",
|
| 983 |
+
"bbox": [
|
| 984 |
+
174,
|
| 985 |
+
133,
|
| 986 |
+
825,
|
| 987 |
+
258
|
| 988 |
+
],
|
| 989 |
+
"page_idx": 9
|
| 990 |
+
},
|
| 991 |
+
{
|
| 992 |
+
"type": "text",
|
| 993 |
+
"text": "8 REPRODUCIBILITY ",
|
| 994 |
+
"text_level": 1,
|
| 995 |
+
"bbox": [
|
| 996 |
+
176,
|
| 997 |
+
280,
|
| 998 |
+
361,
|
| 999 |
+
295
|
| 1000 |
+
],
|
| 1001 |
+
"page_idx": 9
|
| 1002 |
+
},
|
| 1003 |
+
{
|
| 1004 |
+
"type": "text",
|
| 1005 |
+
"text": "To make the results presented in our work reproducible, we include all experiment setups and details, evaluation metrics, and comparing methods in Section 5. We test our method on multiple publicly available datasets and under different settings. We report the average and corresponding standard deviations over multiple runs using different randoms seeds for our main results (Table 1, 2 and 3). Our results are also verified on different hardwares, including TPU and GPU. We plan to make the code publicly available upon acceptance. ",
|
| 1006 |
+
"bbox": [
|
| 1007 |
+
174,
|
| 1008 |
+
311,
|
| 1009 |
+
825,
|
| 1010 |
+
395
|
| 1011 |
+
],
|
| 1012 |
+
"page_idx": 9
|
| 1013 |
+
},
|
| 1014 |
+
{
|
| 1015 |
+
"type": "text",
|
| 1016 |
+
"text": "REFERENCES ",
|
| 1017 |
+
"text_level": 1,
|
| 1018 |
+
"bbox": [
|
| 1019 |
+
174,
|
| 1020 |
+
416,
|
| 1021 |
+
285,
|
| 1022 |
+
433
|
| 1023 |
+
],
|
| 1024 |
+
"page_idx": 9
|
| 1025 |
+
},
|
| 1026 |
+
{
|
| 1027 |
+
"type": "text",
|
| 1028 |
+
"text": "Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In ECCV, 2018. 2 ",
|
| 1029 |
+
"bbox": [
|
| 1030 |
+
176,
|
| 1031 |
+
440,
|
| 1032 |
+
821,
|
| 1033 |
+
469
|
| 1034 |
+
],
|
| 1035 |
+
"page_idx": 9
|
| 1036 |
+
},
|
| 1037 |
+
{
|
| 1038 |
+
"type": "text",
|
| 1039 |
+
"text": "Yaroslav Bulatov. notmnist dataset, 2011. URL http://yaroslavvb.blogspot.com/ 2011/09/notmnist-dataset.html. 7 ",
|
| 1040 |
+
"bbox": [
|
| 1041 |
+
176,
|
| 1042 |
+
478,
|
| 1043 |
+
821,
|
| 1044 |
+
507
|
| 1045 |
+
],
|
| 1046 |
+
"page_idx": 9
|
| 1047 |
+
},
|
| 1048 |
+
{
|
| 1049 |
+
"type": "text",
|
| 1050 |
+
"text": "Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. In NeurIPS, 2020. 6 ",
|
| 1051 |
+
"bbox": [
|
| 1052 |
+
173,
|
| 1053 |
+
517,
|
| 1054 |
+
823,
|
| 1055 |
+
546
|
| 1056 |
+
],
|
| 1057 |
+
"page_idx": 9
|
| 1058 |
+
},
|
| 1059 |
+
{
|
| 1060 |
+
"type": "text",
|
| 1061 |
+
"text": "Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. arXiv preprint arXiv:1812.00420, 2018. 3, 6 ",
|
| 1062 |
+
"bbox": [
|
| 1063 |
+
173,
|
| 1064 |
+
556,
|
| 1065 |
+
823,
|
| 1066 |
+
584
|
| 1067 |
+
],
|
| 1068 |
+
"page_idx": 9
|
| 1069 |
+
},
|
| 1070 |
+
{
|
| 1071 |
+
"type": "text",
|
| 1072 |
+
"text": "Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K Dokania, Philip HS Torr, and Marc’Aurelio Ranzato. On tiny episodic memories in continual learning. arXiv preprint arXiv:1902.10486, 2019. 3, 6 ",
|
| 1073 |
+
"bbox": [
|
| 1074 |
+
176,
|
| 1075 |
+
593,
|
| 1076 |
+
821,
|
| 1077 |
+
637
|
| 1078 |
+
],
|
| 1079 |
+
"page_idx": 9
|
| 1080 |
+
},
|
| 1081 |
+
{
|
| 1082 |
+
"type": "text",
|
| 1083 |
+
"text": "Matthias Delange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Greg Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. 2 ",
|
| 1084 |
+
"bbox": [
|
| 1085 |
+
176,
|
| 1086 |
+
646,
|
| 1087 |
+
821,
|
| 1088 |
+
690
|
| 1089 |
+
],
|
| 1090 |
+
"page_idx": 9
|
| 1091 |
+
},
|
| 1092 |
+
{
|
| 1093 |
+
"type": "text",
|
| 1094 |
+
"text": "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. ICLR, 2021. 3, 6 ",
|
| 1095 |
+
"bbox": [
|
| 1096 |
+
176,
|
| 1097 |
+
699,
|
| 1098 |
+
823,
|
| 1099 |
+
742
|
| 1100 |
+
],
|
| 1101 |
+
"page_idx": 9
|
| 1102 |
+
},
|
| 1103 |
+
{
|
| 1104 |
+
"type": "text",
|
| 1105 |
+
"text": "Sayna Ebrahimi, Franziska Meier, Roberto Calandra, Trevor Darrell, and Marcus Rohrbach. Adversarial continual learning. In ECCV, 2020. 6 ",
|
| 1106 |
+
"bbox": [
|
| 1107 |
+
171,
|
| 1108 |
+
751,
|
| 1109 |
+
823,
|
| 1110 |
+
780
|
| 1111 |
+
],
|
| 1112 |
+
"page_idx": 9
|
| 1113 |
+
},
|
| 1114 |
+
{
|
| 1115 |
+
"type": "text",
|
| 1116 |
+
"text": "Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471–476, 2016. 5 ",
|
| 1117 |
+
"bbox": [
|
| 1118 |
+
178,
|
| 1119 |
+
790,
|
| 1120 |
+
821,
|
| 1121 |
+
847
|
| 1122 |
+
],
|
| 1123 |
+
"page_idx": 9
|
| 1124 |
+
},
|
| 1125 |
+
{
|
| 1126 |
+
"type": "text",
|
| 1127 |
+
"text": "Sorin Grigorescu, Bogdan Trasnea, Tiberiu Cocias, and Gigel Macesanu. A survey of deep learning techniques for autonomous driving. Journal of Field Robotics, 37(3):362–386, 2020. 10 ",
|
| 1128 |
+
"bbox": [
|
| 1129 |
+
174,
|
| 1130 |
+
856,
|
| 1131 |
+
821,
|
| 1132 |
+
886
|
| 1133 |
+
],
|
| 1134 |
+
"page_idx": 9
|
| 1135 |
+
},
|
| 1136 |
+
{
|
| 1137 |
+
"type": "text",
|
| 1138 |
+
"text": "Raia Hadsell, Dushyant Rao, Andrei A Rusu, and Razvan Pascanu. Embracing change: Continual learning in deep neural networks. Trends in cognitive sciences, 2020. 1, 4 ",
|
| 1139 |
+
"bbox": [
|
| 1140 |
+
176,
|
| 1141 |
+
895,
|
| 1142 |
+
821,
|
| 1143 |
+
924
|
| 1144 |
+
],
|
| 1145 |
+
"page_idx": 9
|
| 1146 |
+
},
|
| 1147 |
+
{
|
| 1148 |
+
"type": "text",
|
| 1149 |
+
"text": "Tyler L Hayes, Nathan D Cahill, and Christopher Kanan. Memory efficient experience replay for streaming learning. In ICRA, 2019. 3, 6 ",
|
| 1150 |
+
"bbox": [
|
| 1151 |
+
171,
|
| 1152 |
+
103,
|
| 1153 |
+
825,
|
| 1154 |
+
132
|
| 1155 |
+
],
|
| 1156 |
+
"page_idx": 10
|
| 1157 |
+
},
|
| 1158 |
+
{
|
| 1159 |
+
"type": "text",
|
| 1160 |
+
"text": "Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 6 ",
|
| 1161 |
+
"bbox": [
|
| 1162 |
+
173,
|
| 1163 |
+
142,
|
| 1164 |
+
823,
|
| 1165 |
+
171
|
| 1166 |
+
],
|
| 1167 |
+
"page_idx": 10
|
| 1168 |
+
},
|
| 1169 |
+
{
|
| 1170 |
+
"type": "text",
|
| 1171 |
+
"text": "Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 ",
|
| 1172 |
+
"bbox": [
|
| 1173 |
+
173,
|
| 1174 |
+
181,
|
| 1175 |
+
823,
|
| 1176 |
+
210
|
| 1177 |
+
],
|
| 1178 |
+
"page_idx": 10
|
| 1179 |
+
},
|
| 1180 |
+
{
|
| 1181 |
+
"type": "text",
|
| 1182 |
+
"text": "James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. PNAS, 114(13):3521–3526, 2017. 2, 6 ",
|
| 1183 |
+
"bbox": [
|
| 1184 |
+
173,
|
| 1185 |
+
220,
|
| 1186 |
+
823,
|
| 1187 |
+
265
|
| 1188 |
+
],
|
| 1189 |
+
"page_idx": 10
|
| 1190 |
+
},
|
| 1191 |
+
{
|
| 1192 |
+
"type": "text",
|
| 1193 |
+
"text": "Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. 6 ",
|
| 1194 |
+
"bbox": [
|
| 1195 |
+
171,
|
| 1196 |
+
273,
|
| 1197 |
+
823,
|
| 1198 |
+
303
|
| 1199 |
+
],
|
| 1200 |
+
"page_idx": 10
|
| 1201 |
+
},
|
| 1202 |
+
{
|
| 1203 |
+
"type": "text",
|
| 1204 |
+
"text": "Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016. 3 ",
|
| 1205 |
+
"bbox": [
|
| 1206 |
+
176,
|
| 1207 |
+
314,
|
| 1208 |
+
823,
|
| 1209 |
+
357
|
| 1210 |
+
],
|
| 1211 |
+
"page_idx": 10
|
| 1212 |
+
},
|
| 1213 |
+
{
|
| 1214 |
+
"type": "text",
|
| 1215 |
+
"text": "Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998. 6 ",
|
| 1216 |
+
"bbox": [
|
| 1217 |
+
174,
|
| 1218 |
+
367,
|
| 1219 |
+
821,
|
| 1220 |
+
397
|
| 1221 |
+
],
|
| 1222 |
+
"page_idx": 10
|
| 1223 |
+
},
|
| 1224 |
+
{
|
| 1225 |
+
"type": "text",
|
| 1226 |
+
"text": "Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021. 1, 3, 4 ",
|
| 1227 |
+
"bbox": [
|
| 1228 |
+
173,
|
| 1229 |
+
406,
|
| 1230 |
+
821,
|
| 1231 |
+
436
|
| 1232 |
+
],
|
| 1233 |
+
"page_idx": 10
|
| 1234 |
+
},
|
| 1235 |
+
{
|
| 1236 |
+
"type": "text",
|
| 1237 |
+
"text": "Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021. 1, 3 ",
|
| 1238 |
+
"bbox": [
|
| 1239 |
+
174,
|
| 1240 |
+
445,
|
| 1241 |
+
821,
|
| 1242 |
+
476
|
| 1243 |
+
],
|
| 1244 |
+
"page_idx": 10
|
| 1245 |
+
},
|
| 1246 |
+
{
|
| 1247 |
+
"type": "text",
|
| 1248 |
+
"text": "Zhizhong Li and Derek Hoiem. Learning without forgetting. TPAMI, 40(12):2935–2947, 2017. 2, 6 ",
|
| 1249 |
+
"bbox": [
|
| 1250 |
+
171,
|
| 1251 |
+
484,
|
| 1252 |
+
823,
|
| 1253 |
+
501
|
| 1254 |
+
],
|
| 1255 |
+
"page_idx": 10
|
| 1256 |
+
},
|
| 1257 |
+
{
|
| 1258 |
+
"type": "text",
|
| 1259 |
+
"text": "Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021. 1, 3, 4 ",
|
| 1260 |
+
"bbox": [
|
| 1261 |
+
174,
|
| 1262 |
+
511,
|
| 1263 |
+
823,
|
| 1264 |
+
554
|
| 1265 |
+
],
|
| 1266 |
+
"page_idx": 10
|
| 1267 |
+
},
|
| 1268 |
+
{
|
| 1269 |
+
"type": "text",
|
| 1270 |
+
"text": "Vincenzo Lomonaco and Davide Maltoni. Core50: a new dataset and benchmark for continuous object recognition. In Conference on Robot Learning, 2017. 6, 8 ",
|
| 1271 |
+
"bbox": [
|
| 1272 |
+
171,
|
| 1273 |
+
564,
|
| 1274 |
+
823,
|
| 1275 |
+
593
|
| 1276 |
+
],
|
| 1277 |
+
"page_idx": 10
|
| 1278 |
+
},
|
| 1279 |
+
{
|
| 1280 |
+
"type": "text",
|
| 1281 |
+
"text": "David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. NeurIPS, 2017. 6 ",
|
| 1282 |
+
"bbox": [
|
| 1283 |
+
171,
|
| 1284 |
+
603,
|
| 1285 |
+
823,
|
| 1286 |
+
632
|
| 1287 |
+
],
|
| 1288 |
+
"page_idx": 10
|
| 1289 |
+
},
|
| 1290 |
+
{
|
| 1291 |
+
"type": "text",
|
| 1292 |
+
"text": "Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. 10 ",
|
| 1293 |
+
"bbox": [
|
| 1294 |
+
171,
|
| 1295 |
+
642,
|
| 1296 |
+
823,
|
| 1297 |
+
685
|
| 1298 |
+
],
|
| 1299 |
+
"page_idx": 10
|
| 1300 |
+
},
|
| 1301 |
+
{
|
| 1302 |
+
"type": "text",
|
| 1303 |
+
"text": "Zheda Mai, Ruiwen Li, Jihwan Jeong, David Quispe, Hyunwoo Kim, and Scott Sanner. Online continual learning in image classification: An empirical survey. arXiv preprint arXiv:2101.10423, 2021. 1, 3, 6 ",
|
| 1304 |
+
"bbox": [
|
| 1305 |
+
173,
|
| 1306 |
+
695,
|
| 1307 |
+
826,
|
| 1308 |
+
739
|
| 1309 |
+
],
|
| 1310 |
+
"page_idx": 10
|
| 1311 |
+
},
|
| 1312 |
+
{
|
| 1313 |
+
"type": "text",
|
| 1314 |
+
"text": "Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In CVPR, 2018. 3 ",
|
| 1315 |
+
"bbox": [
|
| 1316 |
+
173,
|
| 1317 |
+
750,
|
| 1318 |
+
823,
|
| 1319 |
+
779
|
| 1320 |
+
],
|
| 1321 |
+
"page_idx": 10
|
| 1322 |
+
},
|
| 1323 |
+
{
|
| 1324 |
+
"type": "text",
|
| 1325 |
+
"text": "Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018. 3 ",
|
| 1326 |
+
"bbox": [
|
| 1327 |
+
171,
|
| 1328 |
+
787,
|
| 1329 |
+
825,
|
| 1330 |
+
818
|
| 1331 |
+
],
|
| 1332 |
+
"page_idx": 10
|
| 1333 |
+
},
|
| 1334 |
+
{
|
| 1335 |
+
"type": "text",
|
| 1336 |
+
"text": "Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989. 1 ",
|
| 1337 |
+
"bbox": [
|
| 1338 |
+
171,
|
| 1339 |
+
827,
|
| 1340 |
+
823,
|
| 1341 |
+
871
|
| 1342 |
+
],
|
| 1343 |
+
"page_idx": 10
|
| 1344 |
+
},
|
| 1345 |
+
{
|
| 1346 |
+
"type": "text",
|
| 1347 |
+
"text": "Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. A survey on bias and fairness in machine learning. ACM Computing Surveys (CSUR), 54(6):1–35, 2021. 10 ",
|
| 1348 |
+
"bbox": [
|
| 1349 |
+
174,
|
| 1350 |
+
882,
|
| 1351 |
+
825,
|
| 1352 |
+
922
|
| 1353 |
+
],
|
| 1354 |
+
"page_idx": 10
|
| 1355 |
+
},
|
| 1356 |
+
{
|
| 1357 |
+
"type": "text",
|
| 1358 |
+
"text": "Sanket Vaibhav Mehta, Darshan Patil, Sarath Chandar, and Emma Strubell. An empirical investigation of the role of pre-training in lifelong learning. ICML Workshop on Theory and Foundation of Continual Learning, 2021. 7, 8 ",
|
| 1359 |
+
"bbox": [
|
| 1360 |
+
178,
|
| 1361 |
+
103,
|
| 1362 |
+
823,
|
| 1363 |
+
146
|
| 1364 |
+
],
|
| 1365 |
+
"page_idx": 11
|
| 1366 |
+
},
|
| 1367 |
+
{
|
| 1368 |
+
"type": "text",
|
| 1369 |
+
"text": "Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS, 2011. 6 ",
|
| 1370 |
+
"bbox": [
|
| 1371 |
+
174,
|
| 1372 |
+
155,
|
| 1373 |
+
823,
|
| 1374 |
+
184
|
| 1375 |
+
],
|
| 1376 |
+
"page_idx": 11
|
| 1377 |
+
},
|
| 1378 |
+
{
|
| 1379 |
+
"type": "text",
|
| 1380 |
+
"text": "Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. arXiv preprint arXiv:1711.00937, 2017. 5 ",
|
| 1381 |
+
"bbox": [
|
| 1382 |
+
173,
|
| 1383 |
+
193,
|
| 1384 |
+
821,
|
| 1385 |
+
222
|
| 1386 |
+
],
|
| 1387 |
+
"page_idx": 11
|
| 1388 |
+
},
|
| 1389 |
+
{
|
| 1390 |
+
"type": "text",
|
| 1391 |
+
"text": "German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019. 1, 3 ",
|
| 1392 |
+
"bbox": [
|
| 1393 |
+
173,
|
| 1394 |
+
229,
|
| 1395 |
+
825,
|
| 1396 |
+
258
|
| 1397 |
+
],
|
| 1398 |
+
"page_idx": 11
|
| 1399 |
+
},
|
| 1400 |
+
{
|
| 1401 |
+
"type": "text",
|
| 1402 |
+
"text": "Ameya Prabhu, Philip HS Torr, and Puneet K Dokania. Gdumb: A simple approach that questions our progress in continual learning. In ECCV, 2020. 6 ",
|
| 1403 |
+
"bbox": [
|
| 1404 |
+
171,
|
| 1405 |
+
267,
|
| 1406 |
+
823,
|
| 1407 |
+
296
|
| 1408 |
+
],
|
| 1409 |
+
"page_idx": 11
|
| 1410 |
+
},
|
| 1411 |
+
{
|
| 1412 |
+
"type": "text",
|
| 1413 |
+
"text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. 3 ",
|
| 1414 |
+
"bbox": [
|
| 1415 |
+
171,
|
| 1416 |
+
305,
|
| 1417 |
+
823,
|
| 1418 |
+
335
|
| 1419 |
+
],
|
| 1420 |
+
"page_idx": 11
|
| 1421 |
+
},
|
| 1422 |
+
{
|
| 1423 |
+
"type": "text",
|
| 1424 |
+
"text": "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 21:1–67, 2020. 1, 3 ",
|
| 1425 |
+
"bbox": [
|
| 1426 |
+
176,
|
| 1427 |
+
343,
|
| 1428 |
+
821,
|
| 1429 |
+
386
|
| 1430 |
+
],
|
| 1431 |
+
"page_idx": 11
|
| 1432 |
+
},
|
| 1433 |
+
{
|
| 1434 |
+
"type": "text",
|
| 1435 |
+
"text": "Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. 3 ",
|
| 1436 |
+
"bbox": [
|
| 1437 |
+
173,
|
| 1438 |
+
395,
|
| 1439 |
+
823,
|
| 1440 |
+
438
|
| 1441 |
+
],
|
| 1442 |
+
"page_idx": 11
|
| 1443 |
+
},
|
| 1444 |
+
{
|
| 1445 |
+
"type": "text",
|
| 1446 |
+
"text": "Timo Schick and Hinrich Schutze. Exploiting cloze questions for few shot text classification and ¨ natural language inference. arXiv preprint arXiv:2001.07676, 2020. 3 ",
|
| 1447 |
+
"bbox": [
|
| 1448 |
+
173,
|
| 1449 |
+
446,
|
| 1450 |
+
823,
|
| 1451 |
+
476
|
| 1452 |
+
],
|
| 1453 |
+
"page_idx": 11
|
| 1454 |
+
},
|
| 1455 |
+
{
|
| 1456 |
+
"type": "text",
|
| 1457 |
+
"text": "Murray Shanahan, Christos Kaplanis, and Jovana Mitrovic. Encoders and ensembles for task-free ´ continual learning. arXiv preprint arXiv:2105.13327, 2021. 6, 8 ",
|
| 1458 |
+
"bbox": [
|
| 1459 |
+
173,
|
| 1460 |
+
484,
|
| 1461 |
+
821,
|
| 1462 |
+
513
|
| 1463 |
+
],
|
| 1464 |
+
"page_idx": 11
|
| 1465 |
+
},
|
| 1466 |
+
{
|
| 1467 |
+
"type": "text",
|
| 1468 |
+
"text": "Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980, 2020. 1 ",
|
| 1469 |
+
"bbox": [
|
| 1470 |
+
173,
|
| 1471 |
+
522,
|
| 1472 |
+
821,
|
| 1473 |
+
564
|
| 1474 |
+
],
|
| 1475 |
+
"page_idx": 11
|
| 1476 |
+
},
|
| 1477 |
+
{
|
| 1478 |
+
"type": "text",
|
| 1479 |
+
"text": "Reza Shokri and Vitaly Shmatikov. Privacy-preserving deep learning. In Proc SIGSAC conference on computer and communications security, 2015. 3 ",
|
| 1480 |
+
"bbox": [
|
| 1481 |
+
173,
|
| 1482 |
+
573,
|
| 1483 |
+
823,
|
| 1484 |
+
603
|
| 1485 |
+
],
|
| 1486 |
+
"page_idx": 11
|
| 1487 |
+
},
|
| 1488 |
+
{
|
| 1489 |
+
"type": "text",
|
| 1490 |
+
"text": "Gido M Van de Ven and Andreas S Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019. 6 ",
|
| 1491 |
+
"bbox": [
|
| 1492 |
+
173,
|
| 1493 |
+
611,
|
| 1494 |
+
823,
|
| 1495 |
+
640
|
| 1496 |
+
],
|
| 1497 |
+
"page_idx": 11
|
| 1498 |
+
},
|
| 1499 |
+
{
|
| 1500 |
+
"type": "text",
|
| 1501 |
+
"text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. NeurIPS, 2017. 3 ",
|
| 1502 |
+
"bbox": [
|
| 1503 |
+
174,
|
| 1504 |
+
648,
|
| 1505 |
+
821,
|
| 1506 |
+
679
|
| 1507 |
+
],
|
| 1508 |
+
"page_idx": 11
|
| 1509 |
+
},
|
| 1510 |
+
{
|
| 1511 |
+
"type": "text",
|
| 1512 |
+
"text": "Zifeng Wang, Tong Jian, Kaushik Chowdhury, Yanzhi Wang, Jennifer Dy, and Stratis Ioannidis. Learn-prune-share for lifelong learning. In ICDM, 2020. 3 ",
|
| 1513 |
+
"bbox": [
|
| 1514 |
+
176,
|
| 1515 |
+
686,
|
| 1516 |
+
821,
|
| 1517 |
+
717
|
| 1518 |
+
],
|
| 1519 |
+
"page_idx": 11
|
| 1520 |
+
},
|
| 1521 |
+
{
|
| 1522 |
+
"type": "text",
|
| 1523 |
+
"text": "Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. 6 ",
|
| 1524 |
+
"bbox": [
|
| 1525 |
+
173,
|
| 1526 |
+
724,
|
| 1527 |
+
823,
|
| 1528 |
+
755
|
| 1529 |
+
],
|
| 1530 |
+
"page_idx": 11
|
| 1531 |
+
},
|
| 1532 |
+
{
|
| 1533 |
+
"type": "text",
|
| 1534 |
+
"text": "Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017. 3 ",
|
| 1535 |
+
"bbox": [
|
| 1536 |
+
173,
|
| 1537 |
+
762,
|
| 1538 |
+
821,
|
| 1539 |
+
791
|
| 1540 |
+
],
|
| 1541 |
+
"page_idx": 11
|
| 1542 |
+
},
|
| 1543 |
+
{
|
| 1544 |
+
"type": "text",
|
| 1545 |
+
"text": "Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In ICML, 2017. 2 ",
|
| 1546 |
+
"bbox": [
|
| 1547 |
+
174,
|
| 1548 |
+
800,
|
| 1549 |
+
820,
|
| 1550 |
+
829
|
| 1551 |
+
],
|
| 1552 |
+
"page_idx": 11
|
| 1553 |
+
},
|
| 1554 |
+
{
|
| 1555 |
+
"type": "text",
|
| 1556 |
+
"text": "Chen Zeno, Itay Golan, Elad Hoffer, and Daniel Soudry. Task agnostic continual learning using online variational bayes. arXiv preprint arXiv:1803.10123, 2018. 6 ",
|
| 1557 |
+
"bbox": [
|
| 1558 |
+
173,
|
| 1559 |
+
838,
|
| 1560 |
+
823,
|
| 1561 |
+
867
|
| 1562 |
+
],
|
| 1563 |
+
"page_idx": 11
|
| 1564 |
+
}
|
| 1565 |
+
]
|
parse/dev/bgAS1ZvveZ/bgAS1ZvveZ.md
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FASTER REINFORCEMENT LEARNING WITH VALUE TARGET LOWER BOUNDING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We show that an arbitrary lower bound of the optimal value function can be used to improve the Bellman value target during value learning. In the tabular case, value learning using the lower bounded Bellman operator converges to the same optimal value as using the original Bellman operator, at a potentially faster speed. In practice, discounted episodic return from the training experience or discounted goal return from hindsight relabeling can serve as the value lower bound when the environment is deterministic. We experiment on Atari games, FetchEnv tasks and a challenging physically simulated car push and reach task. We show that in most cases, simply lower bounding with the discounted episodic return performs better or as well as common baselines such as TD3, SAC and Hindsight Experience Replay (HER). It learns much faster than TD3 or HER on some of the harder continuous control tasks, requiring minimal additional computation and no parameter tuning. We are not the first to introduce this simple yet effective technique, but the first to demonstrate its optimality in theory and effectiveness in a wide range of tasks and related baseline methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In temporal difference (TD) learning, the value function is adjusted toward its Bellman target, which is the reward of the current step plus the discounted value of the next state. This forms the basis of many state of the art reinforcement learning (RL) algorithms such as DQN (Mnih et al., 2013), DDPG (Lillicrap et al., 2015), TD3 (Fujimoto et al., 2018), and SAC (Haarnoja et al., 2018).
|
| 12 |
+
|
| 13 |
+
The value of the next state is typically estimated using a “bootstrapped value” based on the value function itself, which is being actively learned during training. The bootstrapped values can be random or very inaccurate, especially at the initial stage of training. Consequently, the Bellman value targets as well as the learned value are usually far away from the optimal value.
|
| 14 |
+
|
| 15 |
+
Naturally, this leads to the following idea: If we can make the value target closer to the optimal value, we may speedup TD learning. For example, we know that the optimal value is just the expected discounted return of the optimal policy, which always upper bounds the expected return of any policy. For episodic RL tasks, we could use the observed discounted return up to episode end from the training trajectories to lower bound the value target. This makes the new value target closer to the optimal value, when the empirical return is higher than the Bellman target.
|
| 16 |
+
|
| 17 |
+
Will such a way of lower bounding the value target work: Will it still converge? Will it converge to the optimal value? Will it speed up value learning?
|
| 18 |
+
|
| 19 |
+
# 2 THEORETICAL RESULTS FOR THE TABULAR CASE
|
| 20 |
+
|
| 21 |
+
For the tabular case, value target lower bounding converges to the same optimal value as the original Bellman value learning, and the proof is also straightforward.
|
| 22 |
+
|
| 23 |
+
# 2.1 BACKGROUND
|
| 24 |
+
|
| 25 |
+
In finite MDPs with a limited number of states and actions, a table can be used to keep track of the value of each state. Using dynamic programming algorithms such as value iteration, values
|
| 26 |
+
|
| 27 |
+
are guaranteed to converge to the optimal through Bellman updates (Chapter 4.4 (Sutton & Barto, 2018)).
|
| 28 |
+
|
| 29 |
+
# Algorithm 1: Bellman value iteration with value target lower bounding
|
| 30 |
+
|
| 31 |
+
Data: Finite MDP $p ( s ^ { \prime } , r | s , g , a )$ , convergence threshold $\theta$
|
| 32 |
+
Result: State value $v ( s )$
|
| 33 |
+
1 $v ( s ) \gets 0$ ;
|
| 34 |
+
2 repeat
|
| 35 |
+
3 $\Delta 0$ ;
|
| 36 |
+
4 for each state s do
|
| 37 |
+
5 $v v ( s )$ ;
|
| 38 |
+
6 $\begin{array} { r } { v ( s ) \gets \operatorname* { m a x } ( f , \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } , r } p ( s ^ { \prime } , r | s , g , a ) [ r + \gamma v ( s ^ { \prime } ) ] ) ; } \end{array}$
|
| 39 |
+
7 $\Delta \gets \operatorname* { m a x } ( \Delta , | v ( s ) - v | )$ ;
|
| 40 |
+
8 end
|
| 41 |
+
9 until $\Delta < \theta$ ;
|
| 42 |
+
|
| 43 |
+
The core of the algorithm is the Bellman update of the value function, $B ( v )$ :
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\mathcal { B } ( v ) ( s ) : = \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } , r } p ( s ^ { \prime } , r | s , g , a ) [ r + \gamma v ( s ^ { \prime } ) ]
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
It is well known that the Bellman operator, $\boldsymbol { B }$ , is a contraction mapping over value functions (Denardo, 1967). That is, for any two value functions $v _ { 1 }$ and $v _ { 2 }$ , $| \mathcal { B } ( \bar { v _ { 1 } } ) - \mathcal { B } ( v _ { 2 } ) | \leq \gamma | v _ { 1 } - v _ { 2 } |$ for the discount factor $\gamma \in \ [ 0 , 1 )$ . This guarantees that any value function under the algorithm converges to the optimal value.1
|
| 50 |
+
|
| 51 |
+
# 2.2 VALUE TARGET LOWER BOUNDING CONVERGENCE THEOREM
|
| 52 |
+
|
| 53 |
+
Theorem 1. Suppose the optimal value under the Bellman operator is $B ^ { \infty } ( v )$ . For any value function $f$ that lower bounds the optimal value, i.e. $\forall s$ $' s , f ( s ) \leq B ^ { \bar { \infty } } ( v ) ( s )$ , if we define the lower bounded Bellman operator as $\mathcal M _ { f } \circ \mathcal B ( v ) : = \operatorname* { m a x } ( \mathcal B ( v ) , f )$ , then $( \mathcal { M } _ { f } \circ B ) ^ { \infty } ( v )$ converges to $B ^ { \infty } ( v )$ .
|
| 54 |
+
|
| 55 |
+
A few things to note about the proof (see Appendix A.1).
|
| 56 |
+
|
| 57 |
+
First, this only proves convergence, not contraction under the original $\lvert \lvert v _ { 1 } - v _ { 2 } \rvert \rvert _ { \infty }$ metric. In the case of the Bellman operator, contraction shows that $\forall v _ { 1 } , v _ { 2 }$ value functions, $| | B ( \boldsymbol { v } _ { 1 } ) - B ( \boldsymbol { v } _ { 2 } ) | | _ { \infty } \leq$ $\gamma | | \boldsymbol { v } _ { 1 } - \boldsymbol { v } _ { 2 } | | _ { \infty }$ . Here, for value target lower bounding, there can be counter examples where ${ \mathcal { M } } _ { f } \circ B$ does not always contract in the original metric space for value functions. Here, convergence relies on the convergence of the Bellman value iteration and the existence of the fixed point $v ^ { * }$ . One difficulty caused by this change is that the stopping criterion in Algorithm 1 $\Delta < \theta _ { , }$ ) no longer works, as we do not have access to the converged value during learning. This is perhaps not a serious concern in practice, as people often train algorithms for a fixed number of iterations or time steps.
|
| 58 |
+
|
| 59 |
+
Second, based on the proof, the new algorithm is at least as fast as the original. When the lower bound actually improves the value target, i.e. $f ( s ) > B ( v _ { 1 } ) ( s )$ , there is a chance for the convergence to be faster. Convergence is strictly faster when the lower bound $f$ has an impact on the $L _ { \infty }$ distance between the current value and the optimal value, i.e. it increases the value target for the states where the differences between the value target and the optimal value are the largest.
|
| 60 |
+
|
| 61 |
+
Third, the lower bound function doesn’t have to be static during training. As long as there is a single $f$ during each iteration, convergence property is preserved.
|
| 62 |
+
|
| 63 |
+
Fourth, the theory works even when the underlying MDP is stochastic. Only the lower bounds based on empirical return introduced below require the MDP to be deterministic.
|
| 64 |
+
|
| 65 |
+
# 3 EXAMPLE LOWER BOUND FUNCTIONS
|
| 66 |
+
|
| 67 |
+
We show a few cases where lower bound functions can be readily obtained from the training experience. Future work may investigate alternative lower bounds.
|
| 68 |
+
|
| 69 |
+
# 3.1 EPISODIC TASKS
|
| 70 |
+
|
| 71 |
+
In episodic tasks, discounted return is only accumulated up to the last step of an episode. In this case, we can wait until an episode ends, and compute future discounted returns of all time steps inside the episode. This discounted return is guaranteed to be a lower bound of the optimal value, if the environment is deterministic, i.e. the reward sequence can be repeated using the exact same sequence of actions. (The behavior policy need not be deterministic, as long as the policy class contains the deterministic optimal policy.) To make training efficient, we can compute and store such discounted returns into the replay buffer for each time step, and simply read them out during training.
|
| 72 |
+
|
| 73 |
+
We call this variant lb-DR, short for lower bounding with discounted return.
|
| 74 |
+
|
| 75 |
+
# 3.1.1 EPISODIC WITH HINDSIGHT RELABELED GOALS
|
| 76 |
+
|
| 77 |
+
In goal conditioned tasks, one helpful technique is hindsight goal relabeling (Andrychowicz et al., 2017). It takes a future state that is $d$ time steps away from the current state as the hindsight $/$ relabeled goal for the current state. When the goal is reached, a reward of 0 is given, otherwise a -1 reward is given for each time step.
|
| 78 |
+
|
| 79 |
+
In this case, we know it took $d$ steps to reach the hindsight goal, so the discounted future return is:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { c } { { R _ { d } = \displaystyle \sum _ { i = 0 , . . , d - 1 } - 1 \gamma ^ { i } } } \\ { { = - \displaystyle 1 ( 1 - \gamma ^ { d } ) / ( 1 - \gamma ) } } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
This calculation can be done on the fly as hindsight relabeling happens, requiring no extra space and very little computation.
|
| 86 |
+
|
| 87 |
+
We call this variant lb-GD, short for lower bounding with goal distance based return.
|
| 88 |
+
|
| 89 |
+
Additionally, we can also apply lb-DR and lb-GD together, with discounted return lower bounding (lb-DR) on the original experience and goal distance return lower bounding (lb-GD) on the hindsight experience, giving the lb-DR $^ +$ GD variant, which was used by Fujita et al. (2020) independently.
|
| 90 |
+
|
| 91 |
+
# 3.2 NON-EPISODIC TASKS WITH POSITIVE REWARDS
|
| 92 |
+
|
| 93 |
+
When the task is continuing, without an episode end, discounted return needs to be accumulated all the way to infinity. This makes it difficult to lower bound the value if rewards can be negative. When rewards are always non-negative, one can still use the discounted return of the future n-steps to lower bound the value. Chapter 3.3 of Sutton & Barto (2018) has more details on episodic vs continuing tasks.
|
| 94 |
+
|
| 95 |
+
# 4 INTEGRATION INTO RL ALGORITHMS
|
| 96 |
+
|
| 97 |
+
# 4.1 BACKGROUND
|
| 98 |
+
|
| 99 |
+
The value target lower bounds can be readily plugged into RL algorithms that regresses value to a target, e.g. DQN, DDPG or SAC.
|
| 100 |
+
|
| 101 |
+
In these algorithms, the action value $\boldsymbol { q } ( s , a )$ is learned through a squared loss with the target value $y$ . In one step TD return, for a batch $\mathbf { B }$ of experience $\{ s , a r , s ^ { \prime } \}$ , the loss is:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathcal { L } _ { q } : = \sum _ { ( s , a , r , s ^ { \prime } ) \in \mathbf { B } } | q ( s , a ) - y | ^ { 2 }
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
In one step TD return, $y$ is the one step TD return $\hat { q } ( s , a , r , s ^ { \prime } )$ :
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\hat { q } ( s , a , r , s ^ { \prime } ) : = r ( s , a ) + \gamma q ^ { \prime } ( s ^ { \prime } , \mu ^ { \prime } ( s ^ { \prime } ) )
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Here, $q ^ { \prime }$ and $\mu ^ { \prime }$ are the bootstrap value and policy functions, typically following the value and policy functions in a delayed schedule during training. (They are also called “target value” and “target policy”, and are very different from the “value target” $y$ in this paper.)
|
| 114 |
+
|
| 115 |
+
# 4.2 VALUE TARGET LOWER BOUNDING
|
| 116 |
+
|
| 117 |
+
With lower bounding, we replace the value target $y$ with the lower bounded target:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
y \gets \operatorname* { m a x } ( f , \hat { q } ( s , a , r , s ^ { \prime } ) ) = \operatorname* { m a x } ( f , r + \gamma q ^ { \prime } ( s ^ { \prime } , \mu ^ { \prime } ( s ^ { \prime } ) ) )
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
This is subtly but importantly different from lower bounding the $q$ value directly (Oh et al., 2018;
|
| 124 |
+
Tang, 2020): $q ( s , a ) \bar { } \operatorname* { m a x } \dot { ( } f , q ( s , a ) )$ , which stays overestimated if $\boldsymbol { q } ( s , a )$ initially overestimates.
|
| 125 |
+
This is the same as was done by Fujita et al. (2020) (confirmed via personal communication).
|
| 126 |
+
|
| 127 |
+
This way of simply lower bounding the value target does not require any tuning parameter, but one can always interpolate between these two value targets using a mixing weight $\alpha$ :
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
y \gets ( 1 - \alpha ) \hat { q } ( s , a ) + \alpha \operatorname* { m a x } ( f , \hat { q } ( s , a ) )
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
A small $\alpha$ dampens the effect of the new value target, and may be desirable in practice when assumptions of the theorem can be violated, e.g. for non-deterministic tasks.
|
| 134 |
+
|
| 135 |
+
See Appendix A.2 for an illustrative example of how value target lower bounding works in practice.
|
| 136 |
+
|
| 137 |
+
# 5 EXPERIMENTS
|
| 138 |
+
|
| 139 |
+
The goal is to demonstrate the sample efficiency of lower bounding the value target over baseline such as DDPG, TD3, SAC and HER. Because the lower bounded value target can now look potentially many steps into the future, we suspect it to be best suited for long horizon, sparse reward tasks. Hence, we choose to experiment on the following tasks.
|
| 140 |
+
|
| 141 |
+
# 5.1 ENVIRONMENTS AND TASKS
|
| 142 |
+
|
| 143 |
+
We experiment on three sets of tasks with different input characteristics and control difficulty. Some of the tasks are not goal conditioned, so only lower bounding with empirical discounted return is available. Some of them are goal conditioned, so both empirical discounted return and hindsight relabeling with discounted goal return as lower bound are available.
|
| 144 |
+
|
| 145 |
+
# 5.1.1 ATARI GAMES
|
| 146 |
+
|
| 147 |
+
We experiment on the classical Atari games with image input to test using discounted episodic return to lower bound value target. We picked the popular games Breakout, Seaquest, Space Invaders, Atlantis, Frostbite and $\boldsymbol { \mathrm { Q } } ^ { * } \boldsymbol { \mathrm { b e r t } }$ , and only experimented on them. As with prior work (Oh et al., 2018), we evaluate on the deterministic versions of the games, NoFrameskip-v4 with actions repeated for a fixed (four) frames.
|
| 148 |
+
|
| 149 |
+
# 5.1.2 EPISODIC FETCH PUSH, SLIDE AND PICKANDPLACE
|
| 150 |
+
|
| 151 |
+
The FetchEnv tasks (Plappert et al., 2018) are goal conditioned tasks with a robotic arm moving objects on a table. Robot states and object position serve as input. The agent outputs continuous actions taking the form of relative positions to move to. A PID controller translates the relative position actions into the exact torque applied at each joint. Rewards are sparse and goal-conditioned, with -1 for non-goal states and 0 for goal states.
|
| 152 |
+
|
| 153 |
+
By default the FetchEnv tasks are non-episodic. They reset every 50 steps, but all steps including the step right before task reset have the same positive discount (Andrychowicz et al., 2017). As explained in Section 3.1, to allow reliable estimates of return lower bounds to be calculated from past experience, we make them episodic by adding a gym wrapper around the environment to end an episode after its goal is achieved, and reset the task. When a goal is not reached within 50 steps, we just reset the task without ending the episode, as is done in the original FetchEnv, and such experience is not used in value target lower bounding.2 This also changes the nature of the tasks, so the agent does not have to stay at the goal state indefinitely, but instead only needs to reach the goal position as fast as possible. This makes the episodic FetchEnv tasks slightly easier to train than the original tasks, because the agent only needs to reach the goal state quickly, instead of having to reach and stay at the goal position indefinitely. (There are ways to avoid changing the desired behavior by e.g. including agent��s speed into the goal state or requiring the agent to stay at the goal position for several time steps before ending the episode. This seems orthogonal to the main idea here, and is not included in this work.)
|
| 154 |
+
|
| 155 |
+
Compared with the Atari games, the inputs are simpler, no longer image based, but the control task is continuous, under realistic physical simulation and harder.
|
| 156 |
+
|
| 157 |
+
# 5.1.3 PIONEER PUSH AND REACH TASKS
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 1: The Pioneer Push task and the Push and Reach task.
|
| 161 |
+
|
| 162 |
+
This is a set of challenging goal reaching and object pushing tasks for the physically simulated car Pioneer 2dx. The car is 0.4 meter long. Objects and goal positions are randomly initialized between 0.5 meter to 1 meter of each other inside a 10 meter by 10 meter flat space. Inputs are the car and object states and the goal positions, and actions are the forces applied on the two driving wheels.
|
| 163 |
+
|
| 164 |
+
For the Pioneer Push task, the car has to push a block to within 0.5 meter of the 2 dimensional goal position indicated by a small red dot on the ground. For the Pioneer Push and Reach task, the car has to first push the object to the goal location (red dot) and then drive to a separate goal position (red ball in the air); the goal is achieved when the concatenation of the two goal locations (for Push and for Reach) is within 0.5 of the concatenated achieved positions (of the block and the car) in $L _ { 2 }$ -distance.
|
| 165 |
+
|
| 166 |
+
Similar to FetchEnv, we make the tasks episodic with sparse goal reward.
|
| 167 |
+
|
| 168 |
+
These tasks take longer time to accomplish, and also take longer time to train than the FetchEnv tasks. Some of the reasons are the force based wheel control instead of the higher level position control, and the arena space being much larger than just a tabletop.
|
| 169 |
+
|
| 170 |
+
# 5.2 BASELINES
|
| 171 |
+
|
| 172 |
+
Baselines include DDPG (Lillicrap et al., 2015), TD3 (Fujimoto et al., 2018), SAC (Haarnoja et al., 2018) and HER (Andrychowicz et al., 2017). Implementations are based on open sourced repositories, and baseline performance is verified against published results under similar settings.
|
| 173 |
+
|
| 174 |
+
# 5.3 HYPERPARAMETERS
|
| 175 |
+
|
| 176 |
+
The value target lower bounding method itself does not have any hyperparameter, the only hyperparameters come from the baseline method. Hyperparameters for the baselines follow published work as much as possible. When tuning baseline hyperparameters, we searched for the best performance in totoal episodic reward, on one set of random seeds. Optimal hyperparameters are then fixed and evaluated on a separate set of random seeds never seen during development. For the treatment, we just used the optimal parameters from the baseline tuning, except for the Atari games where we found the treatment to benefit from more (eight) minibatch updates of size 250 per training iteration (instead of four updates of 500) and from skipping reward clipping. Hyperparameter values are detailed in Appendix A.3.
|
| 177 |
+
|
| 178 |
+
# 5.4 RESULTS
|
| 179 |
+
|
| 180 |
+
We show evaluation performance averaged across separate training runs (five for the less stable Atari games and three for the others). Each run uses a random seed never seen during development.
|
| 181 |
+
|
| 182 |
+
# 5.4.1 LB-DR VS BASELINE SAC/DDPG
|
| 183 |
+
|
| 184 |
+
Figure 2 compares lower bounding with discounted return (lb-DR) against SAC or DDPG baseline on Atari games and the episodic FetchEnv tasks.
|
| 185 |
+
|
| 186 |
+
For most tasks, lower bounding with episodic discounted return (lb-DR) performs similarly or better than the baselines. On Atari Breakout, Atlantis, Frostbite and Q\*bert, and FetchPush and FetchPickAndPlace the gains are quite large. On Atari Seaquest, there is still a significant sample efficiency gain initially.
|
| 187 |
+
|
| 188 |
+
The lb-DR method is effective, but is it really due to improvements to the value targets? Figure 5 (Appendix A.4) looks at the fraction of training experience where lower bounded value target is actually higher than the baseline Bellman value target over the course of training. For the episodic FetchEnv tasks, as training progresses, a meaningful fraction of experience start to benefit from better value targets, and the average return performance also starts to improve over the baseline, although a large fraction of experience benefiting from higher value targets does not always mean a much higher average return (see FetchSlide). For most Atari games, improved value target does lead to significant performance gains, the only exception being Breakout, where value improvement does not immediately lead to performance gain.
|
| 189 |
+
|
| 190 |
+
# 5.4.2 LB-GD AND LB-DR $^ +$ GD VS HER
|
| 191 |
+
|
| 192 |
+
Figure 3 compares lower bounding with goal distance return (lb-GD) and lower bounding with both goal distance and discounted return combined (l ${ \mathsf { b } } { \mathsf { - D R } } { \mathsf { + G D } }$ ) against the much stronger HER baseline, on the goal conditioned episodic FetchEnv and Pioneer tasks.
|
| 193 |
+
|
| 194 |
+
It seems on the easier FetchEnv tasks, lower bounding isn’t able to outperform HER, but on the more challenging Pioneer Push and Reach tasks, lower bounding is able to achieve over $70 \%$ more sample efficiency. It seems the more complex the task, the wider the margin of gain.
|
| 195 |
+
|
| 196 |
+
We also looked at the fraction of experience where the lower bounding goal return is higher than the Bellman target (see Appendix A.4). It quickly grows to $1 \%$ and then slowly drops, matching the region where the new method outperforms the baselines in average return.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 2: Evaluated average return of value target lower bounding with discounted return (lb-DR) vs SAC or DDPG on Atari games and episodic FetchEnv tasks. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 3: Value target lower bounding with goal distance return (lb-GD) and lb- $. { \mathrm { D R } } { + } { \mathrm { G D } }$ vs HER on episodic FetchEnv and Pioneer tasks. Solid curves are the mean across three seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 203 |
+
|
| 204 |
+
# 6 RELATED WORK
|
| 205 |
+
|
| 206 |
+
Prior works (Fujita et al., 2020; Hoppe & Toussaint, 2020; He et al., 2016; Oh et al., 2018; Tang, 2020) employed several different ways of computing future returns and using that as a lower bound to improve value learning. It is quite easy to introduce biases and inefficiencies into the process and end up with a suboptimal or inefficient algorithm. Our work is the first to point out that one efficient way of doing it, namely value target lower bounding, converges to the optimal value in the tabular case. We are the first to point out that the theory works generally, even for stochastic environments. We list several possible ways of computing the lower bound from training experience, which are true lower bounds only for deterministic environments, and demonstrate the effectiveness of such lower bounds in illustrative examples and experiments on a variety of tasks.
|
| 207 |
+
|
| 208 |
+
Fujita et al. (2020) used a method very similar to the lb- $\mathrm { . D R + G D }$ variant, noted the limitation to deterministic tasks, and showed that value target lower bounding improved sample efficiency for a goal conditioned robotic grasping task. Hoppe & Toussaint (2020) similarly proposed to bound the value target using a simplified MDP with a subset of actions of the original MDP. Neither work gave any theoretical guarantee.
|
| 209 |
+
|
| 210 |
+
He et al. (2016) used empirical return with bootstrap to improve value learning. They integrate the lower (and upper) bounds as constraints when optimizing the Q function. Their method is more difficult to use due to an additional loss and hyperparameters to tune, and is more expensive to compute than directly lower bounding the value target. Their method needs to evaluate the value function on all future time steps. This severely limits how many time steps it can look ahead when computing discounted return. They evaluated on Atari games, showing higher sample efficiency than DQN, but appears worse than value target lower bounding on Breakout, probably due to looking ahead only four time steps. The limitation to deterministic tasks wasn’t mentioned in the paper, (but is actually present due to the use of empirical return in computing the lower bound), and neither any convergence analysis. Appendix A.5 offers more discussions related to this method and n-step returns.
|
| 211 |
+
|
| 212 |
+
Our work is subtly but importantly different from the prior works on lower bound Q learning or Self Imitation Learning (SIL) (Oh et al., 2018; Tang, 2020). SIL uses empirical return $R$ to lower bound the value function itself (instead of the valueloss during on-policy (AC or PPO) trainingfunction overestimates, the SIL value loss b $( L _ { v a l u e } ^ { s \breve { i } } = \textstyle { \frac { 1 } { 2 } } | v ( s ) - \operatorname* { m a x } ( \bar { v } ( s ) , R ) | ^ { 2 } )$ n off policy value. When the valueg. Mixing the SIL loss with the loss from the baseline algorithms probably helped to correct the overestimation, but no theoretical guarantee was given. In evaluation, SIL was often compared to on-policy Actor Critic or PPO baselines, so it was not clear how much of the gain was due to lower bounding and how much due to off-policy value learning. In this work, we bound the Bellman value target (Equation 5), so overestimates are automatically corrected via Bellman updates, and convergence is guaranteed in the tabular case. We also use off-policy algorithms as baselines for a cleaner comparison.
|
| 213 |
+
|
| 214 |
+
Kumar et al. (2020) (DisCor) also recognized that bootstrapped value targets can be inaccurate. It impacts learning adversely under function approximation, while we handle the general case. DisCor uses distribution correction to sample experience with accurate bootstrap targets more frequently.
|
| 215 |
+
|
| 216 |
+
Interestingly, it is common practice to lower and upper bound the returns to the possible region, e.g.
|
| 217 |
+
Andrychowicz et al. (2017) bounds value between $[ - \frac { 1 } { 1 - \gamma } , 0 ]$ .
|
| 218 |
+
|
| 219 |
+
# 7 CONCLUSIONS
|
| 220 |
+
|
| 221 |
+
In theory, value target lower bounding converges to the same optimal solution as the original Bellman value iteration. In practice, several ways of finding value lower bounds using empirical discounted return for deterministic episodic tasks are examined.
|
| 222 |
+
|
| 223 |
+
Precomputing discounted future return and storing into the replay buffer allows efficient lower bound computation, and can achieve much higher sample efficiency than baselines such as SAC, DDPG or TD3 in most tasks. The Appendix A.5 also includes comparisons against related methods such as td-lambda and Retrace.
|
| 224 |
+
|
| 225 |
+
Simple goal distance based return, requiring little extra space or compute, achieves large gains in certain long horizon tasks over HER, and performs similarly as HER in the simpler tasks.
|
| 226 |
+
|
| 227 |
+
# 7.1 FUTURE WORK
|
| 228 |
+
|
| 229 |
+
There are probably better ways of finding value lower bounds that speed up training even more. There may be ways of using bootstrapped value in computing the lower bound, for n-step return targets or for non-episodic tasks.
|
| 230 |
+
|
| 231 |
+
Estimating value lower bound for environments with stochastic transitions or rewards may be possible, e.g. by learning a reward function to help average out the randomness in the empirical return. Extending to partially observable environments would be harder but probably still doable.
|
| 232 |
+
|
| 233 |
+
Other ways of bounding the value target, e.g. upper bounding, may be worth investigating as well, e.g. to reduce overestimation in regions of poor reward.
|
| 234 |
+
|
| 235 |
+
# REPRODUCIBILITY STATEMENT
|
| 236 |
+
|
| 237 |
+
Our code change is based on a publicly available RL library, with strong baselines already implemented. Our relatively small code change is committed to a private github repository, which we plan to open source upon publication. When running experiments, the snapshot of the code used to run each experiment is stored together with the results. Experiment parameters are gin-configured and controlled by our automation script, with each experiment label corresponding to the set of configurations used for that experiment, so there is little room for manual error when running many experiments across different tasks, methods and hyperparameters.
|
| 238 |
+
|
| 239 |
+
Experiments are done in simulation with pseudo randomness. We’ve run our code on different machines with different GPU hardware using the same docker image, and the results are reproducible up to every float number using the same random seed. In a few cases, we’ve also run our code on different hardware and software (CUDA and pytorch), and the results are similar though not the same at the float number level.
|
| 240 |
+
|
| 241 |
+
# REFERENCES
|
| 242 |
+
|
| 243 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems, volume 30, 2017.
|
| 244 |
+
|
| 245 |
+
Eric V. Denardo. Contraction mappings in the theory underlying dynamic programming. SIAM Review, 9(2):165–177, 1967. ISSN 00361445. URL http://www.jstor.org/stable/ 2027440.
|
| 246 |
+
|
| 247 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. CoRR, 2018. URL http://arxiv.org/abs/1802.09477.
|
| 248 |
+
|
| 249 |
+
Yasuhiro Fujita, Kota Uenishi, Avinash Ummadisingu, Prabhat Nagarajan, Shimpei Masuda, and Mario Ynocente Castro. Distributed reinforcement learning of targeted grasping with active vision for mobile manipulators, 2020.
|
| 250 |
+
|
| 251 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor, 2018.
|
| 252 |
+
|
| 253 |
+
Frank S. He, Yang Liu, Alexander G. Schwing, and Jian Peng. Learning to play in a day: Faster deep reinforcement learning by optimality tightening, 2016.
|
| 254 |
+
|
| 255 |
+
Sabrina Hoppe and Marc Toussaint. Qgraph-bounded q-learning: Stabilizing model-free off-policy deep reinforcement learning, 2020.
|
| 256 |
+
|
| 257 |
+
Aviral Kumar, Abhishek Gupta, and Sergey Levine. Discor: Corrective feedback in reinforcement learning via distribution correction. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 18560–18572. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/d7f426ccbc6db7e235c57958c21c5dfa-Paper.pdf.
|
| 258 |
+
|
| 259 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 260 |
+
|
| 261 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. CoRR, abs/1312.5602, 2013. URL http://arxiv.org/abs/1312.5602.
|
| 262 |
+
|
| 263 |
+
Remi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient off- ´ policy reinforcement learning, 2016.
|
| 264 |
+
|
| 265 |
+
Junhyuk Oh, Yijie Guo, Satinder Singh, and Honglak Lee. Self-imitation learning. CoRR, abs/1806.05635, 2018. URL http://arxiv.org/abs/1806.05635.
|
| 266 |
+
|
| 267 |
+
Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, Vikash Kumar, and Wojciech Zaremba. Multi-goal reinforcement learning: Challenging robotics environments and request for research. CoRR, abs/1802.09464, 2018. URL http://arxiv.org/abs/1802.09464.
|
| 268 |
+
|
| 269 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018. ISBN 0262039249.
|
| 270 |
+
|
| 271 |
+
Yunhao Tang. Self-imitation learning via generalized lower bound q-learning. CoRR, abs/2006.07442, 2020. URL https://arxiv.org/abs/2006.07442.
|
| 272 |
+
|
| 273 |
+
Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. CoRR, abs/1509.06461, 2015. URL http://arxiv.org/abs/1509.06461.
|
| 274 |
+
|
| 275 |
+
# A APPENDIX
|
| 276 |
+
|
| 277 |
+
# A.1 PROOF OF THEOREM 1
|
| 278 |
+
|
| 279 |
+
We want to prove that under the new operator $\mathcal { M } _ { f } \circ B$ , the value function converges to the same optimal value function given by the Bellman operator $\boldsymbol { B }$ .
|
| 280 |
+
|
| 281 |
+
Proof. Let $v ^ { * }$ be the fixed point and optimal value of the original Bellman operator: $v ^ { * } : = B ^ { \infty } ( v )$ , $v _ { 1 }$ be any value function, and $s$ any state,
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
{ \begin{array} { r l } & { \ | { \mathcal { M } } _ { f } \circ { \mathcal { B } } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\ & { = | \operatorname* { m a x } ( { \mathcal { B } } ( v _ { 1 } ) ( s ) , f ( s ) ) - v ^ { * } ( s ) | } \\ & { \ { \mathrm { ~ } } ^ { { \forall } s { \mathrm { ~ w h e r e ~ } } f ( s ) > { \mathcal { B } } ( v _ { 1 } ) ( s ) : } } \\ & { { \mathrm { ~ a b o v e ~ } } = | f ( s ) - v ^ { * } ( s ) | = v ^ { * } ( s ) - f ( s ) < v ^ { * } ( s ) - { \mathcal { B } } ( v _ { 1 } ) ( s ) = | { \mathcal { B } } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \end{array} }
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\begin{array} { r l } & { \mathrm { ~ a b o v e = } | \mathcal { B } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\ & { { \le } | \mathcal { B } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\ & { { = } | \mathcal { B } ( v _ { 1 } ) ( s ) - \mathcal { B } ( v ^ { * } ) ( s ) | } \\ & { { \le } \gamma | | v _ { 1 } - v ^ { * } | | _ { \infty } } \end{array}
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
The last line above is because the Bellman operator $\boldsymbol { B }$ contracts at rate $\gamma$ .
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\begin{array} { r } { \vert \vert \mathcal { M } _ { f } \circ \mathcal { B } ( v _ { 1 } ) - v ^ { * } \vert \vert _ { \infty } = \operatorname* { m a x } _ { s } \vert \mathcal { M } _ { f } \circ \mathcal { B } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) \vert \leq \gamma \vert \vert v _ { 1 } - v ^ { * } \vert \vert _ { \infty } . } \end{array}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
According to the definition of convergence to $v ^ { * }$ , we need to find an $N$ , such that $\forall \epsilon > 0 , \forall v _ { 1 } \neq v ^ { * }$ , $\forall n > N , \bar { | } | ( \mathcal { M } _ { f } \circ \mathcal { B } ) ^ { n } ( v _ { 1 } ) - v ^ { * } | | _ { \infty } \bar { < } \epsilon .$ .
|
| 298 |
+
|
| 299 |
+
We can easily calculate that N = logγ ||v1−v∗|| (note, $\gamma \ < \ 1 $ ) satisfies the condition, which concludes the proof that any value function $v _ { 1 }$ will converge to $v ^ { * }$ under the lower bounded Bellman operator $\mathcal { M } _ { f } \circ B$ .
|
| 300 |
+
|
| 301 |
+
This proof works for action values as well, by simply replacing the value function above $v ( s )$ with the action value $\boldsymbol { q } ( s , a )$ , and the value lower bound $f ( s )$ with the action value lower bound $\dot { f } ( s , a )$ .
|
| 302 |
+
|
| 303 |
+
# A.2 AN ILLUSTRATIVE EXAMPLE
|
| 304 |
+
|
| 305 |
+
Figure 4 includes a fairly general example showing how value target lower bounding would improve value learning. Suppose we enhance an off policy algorithm such as DDPG with value target lower bounding (lb-DR), when there is no training experience hitting the target state, no meaningful training happens for the baseline or lb-DR. However, when there is one trajectory hitting the target state, all states along the trajectory will soon be propagated with meaningful return, and nearby states will also enjoy faster learning. As the state space becomes larger and the time horizon longer, a successful trajectory will likely speed up learning quite a bit.
|
| 306 |
+
|
| 307 |
+
# A.3 HYPERPARAMETERS
|
| 308 |
+
|
| 309 |
+
Hyperparameters of the baseline algorithms follow published work in the case of FetchEnv (Plappert et al., 2018). For Atari and Pioneer Push and Reach tasks, they are tuned using one set of random seeds and after keeping the hyperparameters fixed, trained with a different set of random seeds and evaluated. We avoided tuning of the parameters of the baseline method for value target lower bounding, except for the Atari games where value target lower bounding learned a bit faster with slightly more frequent training updates (8 updates of 250 transitions per training iteration) than the baseline (4 updates of 500 transitions) and without reward clipping. For Atari Atlantis, Frostbite and Q\*bert, we report results with reward clipping as it did not affect performance much.
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 4: Illustration of value target lower bounding speeding up value learning as training progresses from stages 0 to 3. The task is to navigate in the state space from start state S to end state T, with sparse reward 1 at $\mathrm { T }$ and 0 elsewhere. The curve from S to $\mathrm { T }$ denotes a training experience that reaches the target. The shaded areas denote roughly states whose value has been significantly improved during training up to that stage.
|
| 313 |
+
|
| 314 |
+
Baseline parameters reported below are tuned using development random seeds and fixed during evaluation with a separate set of random seeds.
|
| 315 |
+
|
| 316 |
+
For the Atari games, DQN with only one training environment takes too long to train so we instead use SAC as baseline. There are no strong reported results, so we tuned the hyperparameters a bit and found it to outperform published Actor-Critic results on Atari Breakout (Oh et al., 2018). We use 30 environments, unrolling 8 time steps every training iteration, with each iteration containing 4 updates each with a minibatch of 500 transitions sampled from the 1 million time step replay buffer. 500 time steps are collected before training starts. Target networks are updated every 20 training updates. Discount $\gamma = 0 . 9 9$ . The SAC target entropy is set to the entropy of uniformly distributing 0.1 probability mass across all but one actions. Actions are repeated deterministically for 4 frames (even for Space Invaders, despite 3 being used by Mnih et al. (2013)), and the latest 4 frames are stacked and rescaled to [-1, 1] to form the $8 4 \mathrm { x } 8 4 \mathrm { x } 4$ input tensor. Rewards are clipped between -1 and 1. Network structures are the same as Double DQN (van Hasselt et al., 2015) with 3 convolution layers, with input layer 32 filters of size 8 stride 4, then 64 filters of size 4 stride 2 and 64 filters with size 3 stride 1, 1 fully connected of size 512 before output. We train for 12 million steps (48 million frames) for each task (except for Atlantis where episodes are very long and we only train for 6 million steps) and evaluate every 1000 iterations averaging across 100 episodes using $\epsilon$ -greedy policy with $5 \%$ random actions.
|
| 317 |
+
|
| 318 |
+
For FetchEnv tasks, DDPG and HER learn faster than their TD3 variants and are reported here. Hyperparameters are the same as used by Plappert et al. (2018), with 38 parallel environments unrolling 50 time steps per train iteration, training 40 updates per iteration, targets are updated once every 40 updates. For each update, a minibatch of 5000 transitions are sampled from the replay buffer of size 2 million. Discount $\gamma = 0 . 9 8$ . Actions are $\epsilon$ -greedy with $30 \%$ random actions. $80 \%$ hindsight experience. Observations are normalized to have zero mean and unit variance based on the statistics of the recent observations.3 Networks are 3 fully connected layers of size 256. Length of the episodes are capped at 50. We train for 2 million frames and evaluate every 40 iterations averaging across 200 episodes.
|
| 319 |
+
|
| 320 |
+
For Pioneer Push and Reach tasks, TD3 is used, (we simply equip DDPG with two critics for clipped double Q learning(Fujimoto et al., 2018)), which works better than DDPG with one critic. Parameters are mostly the same as in FetchEnv, except for using 30 parallel environments, 100 steps of unroll per training iteration, 6 million time step replay buffer, $50 \%$ hindsight experience, discount $\gamma = 0 . 9 9$ and not using observation normalization. Length of the episodes are capped at 100 for Push and 200 for Push and Reach. We train for 5 million frames for Push and 14 million for PushReach and evaluate every 200 iterations averaging across 100 episodes.
|
| 321 |
+
|
| 322 |
+
For FetchEnv and Pioneer tasks, the target networks are updated every 40 train updates softly, with weight 0.95 on the existing target network parameters and 0.05 on the incoming.
|
| 323 |
+
|
| 324 |
+
We use Adam optimizer with learning rate $5 e ^ { - 4 }$ for the Atari games and $1 e ^ { - 3 }$ for all others, and $\hat { \epsilon } = 1 e ^ { - 7 }$ for all tasks.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
A.4 PLOTS
|
| 328 |
+
Figure 5: Fraction of training experience where lb-DR value target is greater than the Bellman target, on Atari games and episodic FetchEnv tasks, plotted against the number of training iterations. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 329 |
+
|
| 330 |
+
Figure 5 shows the fraction of training experience where lb-DR value target is greater than the Bellman target from SAC/DDPG. They correlate well with actual performance (Figure 2) and with how value is learning (Figure 6). For Atari Breakout the converged value is much higher than that of the baseline. It is unlike an overestimation, and is actually close to the average discounted return that we also summarized in tensorboard (omitted here).4 The baseline value of 2 is actually very far away from its average discounted return of 25, even though its policy is already getting a reward of
|
| 331 |
+
|
| 332 |
+
200 per episode. This is likely due to the inaccurate bootstrap values of the baseline method, and will probably take much longer to converge.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 6: Learned values of lb-DR and SAC (for Atari games) and DDPG (for FetchEnv tasks), evaluated on the training experience and plotted against the number of training iterations. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 336 |
+
|
| 337 |
+
Figure 7 shows the fraction of training experience where the lb-GD is higher than the Bellman value target from HER, in the goal conditioned (episodic FetchEnv and Pioneer) tasks. It seems, for FetchEnv tasks, where lb-GD only performs slightly better than HER, the fraction of experience with improved value target is quite small (less than $1 \%$ ). Hindsight relabeling is probably already producing fairly high value targets. For Pioneer Push and Reach tasks, lb-GD performs much better in average return, and the fraction of experience with higher value target is also much larger (peaking around $2 \%$ ).
|
| 338 |
+
|
| 339 |
+
This again correlates well with the value learned, shown in Figure 8.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 7: Fraction of training experience where lb-GD or l ${ \bf \Lambda } _ { \mathrm { 3 - D R + G D } }$ value target is greater than the Bellman target, on episodic FetchEnv and Pioneer tasks, plotted against the number of training iterations. Solid curves are the mean across three seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 343 |
+
|
| 344 |
+
# A.5 N-STEP RETURN BASED METHODS
|
| 345 |
+
|
| 346 |
+
# A.5.1 N-STEP RETURN METHODS
|
| 347 |
+
|
| 348 |
+
We also experimented with n-step return, td-lambda return and Retrace (Munos et al., 2016) but decided to give up on the direction due to the following reasons:
|
| 349 |
+
|
| 350 |
+
1) We compared DDPG one-step return against DDPG with n-step return, td-lambda and Retrace on FetchPush, and found that a small n works similarly as the baseline one-step DDPG, and a larger n hurts training. This is likely due to the off-policy bias in n-step return causing the n-step estimate to be potentially worse than the one-step estimate, for example, when off-policy low return experiences are used to compute value targets. Introducing importance sampling weights (Retrace) would help reduce the bias, but at the same time significantly downweight the off-policy high return experiences, making an ineffective use of such experiences. The overall benefit of n-step methods is limited.
|
| 351 |
+
|
| 352 |
+
None of these issues are present in value target lower bounding: (a) It does not incur any off-policy bias, and (b) as long as an experience renders high reward, being off-policy does not affect its ability to improve the value target.
|
| 353 |
+
|
| 354 |
+
2) Computing n-step td-lambda return requires more computation due to evaluating value networks on all n-steps of the experience, and slows down training time significantly with a large n.
|
| 355 |
+
|
| 356 |
+
On the other hand, value target lower bounding precomputes and stores discounted return in the replay buffer, and incurs very little additional computation.
|
| 357 |
+
|
| 358 |
+
3) Tuning n-step return involves many hyperparameters like the number of steps n, the td-lambda parameter, replay buffer size and prioritized replay to expire old experiences and sample recent ones more frequently, target network update parameters to reduce potential overestimation, and parameters for importance sampling. But still, after all the tuning, it only slightly outperform onestep DDPG on FetchPush or SAC on Breakout, and is below the lower bounding method. For tdlambda and Retrace, the best performance comes from 3-step td with $\lambda = 0 . 9 5$ , replay buffer length $4 0 0 \mathrm { k }$ and all other parameters the same as the baseline DDPG or SAC. Retrace underperforming the baseline in Breakout is similarly observed in the original paper (Munos et al., 2016).
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 8: Learned values of lb-DR, lb- $. { \mathrm { D R } } { + } { \mathrm { G D } }$ and HER on episodic FetchEnv and Pioneer tasks, evaluated on the training experience and plotted against the number of training iterations. Solid curves are the mean across three seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 362 |
+
|
| 363 |
+
On the other hand, value target lower bounding requires no hyperparameter tuning, learns faster on most tasks and converges higher on some of the more difficult tasks.
|
| 364 |
+
|
| 365 |
+
4) Value target lower bounding can be applied on top of n-step return methods as well, so is more of an orthogonal problem.
|
| 366 |
+
|
| 367 |
+
Overall, n-step methods are much more expensive and difficult to use, and the much simpler and effective lower bounding method still maintains an advantage in effectiveness and performance. We show the performance comparison in Figure 9 with learned values in Figure 10.
|
| 368 |
+
|
| 369 |
+
# A.5.2 OPTIMALITY TIGHTENING WITH N-STEP RETURNS
|
| 370 |
+
|
| 371 |
+
He et al. (2016) use bootstrapped n-step return to lower and upper bound the value during training. They frame the problem as a constrained optimization problem where the distance between the value and the Bellman value target is minimized subject to the constraints that the value function must be within the lower (and upper) bounds. Their work is more general than the value target low bounding methods due to 1) including a value upper bound as well as lower bound, and 2) using bootstrapping, so it’s applicable to non-episodic tasks as well.
|
| 372 |
+
|
| 373 |
+
Compared to value target lower bounding, several limitations exist.
|
| 374 |
+
|
| 375 |
+
1) The prior work bounds the value function itself (similar to lower bound q learning (Oh et al., 2018; Tang, 2020)), instead of bounding the Bellman value target. This could cause suboptimal training because the Bellman target itself could be outside the bounds, causing contradictory training targets and losses. Imagine the current value for a state is 1, its Bellman value target may be a low 0, and the lower bound may be a high 2, then it’s unclear which way the value function should go.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 9: Evaluated average return of value target lower bounding with discounted return (lb-DR) vs SAC or DDPG, td-lambda and Retrace on Atari Breakout and episodic FetchEnv tasks. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 10: Learned values of lb-DR and SAC (for Atari games), DDPG (for FetchEnv tasks), tdlambda and Retrace, evaluated on the training experience and plotted against the number of training iterations. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation.
|
| 382 |
+
|
| 383 |
+
It will depend largely on the mixing weight between the two losses $\lambda$ and whether initial values overestimate, which can be hard to tune in practice.
|
| 384 |
+
|
| 385 |
+
2) The prior work does not include any theoretical analysis and misses the limitation to only deterministic tasks. The lower and upper bounds are in fact not correct bounds, even on deterministic tasks, because of the use of bootstrapped values together with the empirical discounted return.
|
| 386 |
+
|
| 387 |
+
3) In order to compute the bootstrapped values, the value network needs to be evaluated on all n future time steps, severely increasing GPU memory consumption and compute. Because of this increase in compute, in experiments, it could only look at a limited (4) timesteps into the future, while lb-DR can look all the way to the end of an episode with very little extra computation and storage.
|
| 388 |
+
|
| 389 |
+
We implemented the method (He et al., 2016) and integrated into our baselines. We ran on FetchPush and Atari Breakout, with hyperparameters number of time steps $n = 4$ and the penalty coefficient $\lambda = 4$ , following the original paper.
|
| 390 |
+
|
| 391 |
+
We found that the prior method overestimates value a lot due to two reasons: a) taking max over the n-step returns for n from 1 to 4, and b) the use of the bootstrap value, causing the lower bound to be above what’s actually achievable.
|
| 392 |
+
|
| 393 |
+
We also improved their method by lower bounding the Bellman value target with n-step return (with bootstrap) instead of imposing the constraint on the value function itself. But it still overestimates value and does not learn as quickly as the baseline one-step DDPG or SAC.
|
| 394 |
+
|
| 395 |
+
We also adjusted $\lambda$ to much lower values, hoping to control overestimation and improve over the baseline. Even with a very small lambda of 1e-7, it is still slower than DDPG baseline on FetchPush, likely because initial values are overestimates. On Atari Breakout, with a small lambda of 1e-7, it learns slightly faster than the SAC baseline but still way below the value target lower bounding method.
|
| 396 |
+
|
| 397 |
+
# A.6 A STOCHASTIC EXAMPLE
|
| 398 |
+
|
| 399 |
+
Using empirical return directly as value lower bound can lead to value overestimation, as shown in the stochastic MDP example below.
|
| 400 |
+
|
| 401 |
+
Assume state $S _ { 0 }$ always goes to $S _ { 1 }$ , and $S _ { 1 }$ gets reward $\pm 2 ~ 5 0 \%$ of the times. Then $v ( S _ { 0 } ) =$ $v ( S _ { 1 } ) = 0$ . However, with lower bounding, for the lucky case with reward 2, the value target for $S _ { 0 }$ is $\gamma \operatorname* { m a x } ( 2 , v ( S _ { 1 } ) ) = 2 \gamma$ , and for the unlucky case with reward -2, the value target for $S _ { 0 }$ is $\gamma \operatorname* { m a x } ( - 2 , v ( S _ { 1 } ) ) = \gamma v ( S _ { 1 } ) = 0$ . On average, $v ( S _ { 0 } )$ will be overestimated to be $\gamma$ .
|
| 402 |
+
|
| 403 |
+
It is worth noting that lower bounding the action value directly as done in SIL (Oh et al., 2018) will overestimate $v ( S _ { 1 } )$ as well, whereas lower bounding the value target will produce the correct $v ( S _ { 1 } )$ . This is because the same trajectory is used to both produce the Bellman value target ( $\pm 2$ for $S _ { 1 }$ ) and the lower bound ( $\pm 2$ for $S _ { 1 }$ ) which will be exactly the same for a given trajectory.
|
| 404 |
+
|
| 405 |
+
# A.7 DOES LOWER BOUNDING WITH EMPIRICAL RETURN REQUIRE THE POLICY TO BE DETERMINISTIC?
|
| 406 |
+
|
| 407 |
+
The use of empirical return to lower bound the optimal value does not require the policy to be deterministic. It does require the policy class to include the optimal policy (deterministic when the task is deterministic) or some policy that’s close to the optimal policy. Otherwise, empirical return could still overestimate the optimal value achievable by the policy class. For example, Q learning assumes that the policy class includes the optimal policy which is the greedy one (and is deterministic). Because of that, the behavior policy can be non-deterministic and suboptimal, and it doesn’t affect the learned value to reach optimality (as long as the behavior covers enough of the state space).
|
| 408 |
+
|
| 409 |
+
# A.8 POTENTIAL IMPROVEMENT
|
| 410 |
+
|
| 411 |
+
Note that the goal distance based return (lb-GD) of Section 3.1.1 is a very simple way of arriving at a reasonable lower bound with near zero additional computation. The bound could be made tighter. Typically, an $L _ { 2 }$ distance threshold is used to judge goal achievement, which will likely be satisfied a few time steps before exactly arriving at the hindsight goal. To compute such a tighter bound would require evaluating the reward function across the trajectories of experience using all possible hindsight goal states, and storing them in the replay buffer, i.e. episode length squared more computation and more storage space. It may be worth doing when episodes are short, or doing it only for a small number of time steps into the future when e.g. rewards are non-negative.
|
parse/dev/bgAS1ZvveZ/bgAS1ZvveZ_content_list.json
ADDED
|
@@ -0,0 +1,2146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "FASTER REINFORCEMENT LEARNING WITH VALUE TARGET LOWER BOUNDING ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
176,
|
| 8 |
+
98,
|
| 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 |
+
170,
|
| 20 |
+
400,
|
| 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": "We show that an arbitrary lower bound of the optimal value function can be used to improve the Bellman value target during value learning. In the tabular case, value learning using the lower bounded Bellman operator converges to the same optimal value as using the original Bellman operator, at a potentially faster speed. In practice, discounted episodic return from the training experience or discounted goal return from hindsight relabeling can serve as the value lower bound when the environment is deterministic. We experiment on Atari games, FetchEnv tasks and a challenging physically simulated car push and reach task. We show that in most cases, simply lower bounding with the discounted episodic return performs better or as well as common baselines such as TD3, SAC and Hindsight Experience Replay (HER). It learns much faster than TD3 or HER on some of the harder continuous control tasks, requiring minimal additional computation and no parameter tuning. We are not the first to introduce this simple yet effective technique, but the first to demonstrate its optimality in theory and effectiveness in a wide range of tasks and related baseline methods. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
233,
|
| 42 |
+
265,
|
| 43 |
+
766,
|
| 44 |
+
473
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
497,
|
| 55 |
+
336,
|
| 56 |
+
513
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "In temporal difference (TD) learning, the value function is adjusted toward its Bellman target, which is the reward of the current step plus the discounted value of the next state. This forms the basis of many state of the art reinforcement learning (RL) algorithms such as DQN (Mnih et al., 2013), DDPG (Lillicrap et al., 2015), TD3 (Fujimoto et al., 2018), and SAC (Haarnoja et al., 2018). ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
529,
|
| 66 |
+
823,
|
| 67 |
+
584
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "The value of the next state is typically estimated using a “bootstrapped value” based on the value function itself, which is being actively learned during training. The bootstrapped values can be random or very inaccurate, especially at the initial stage of training. Consequently, the Bellman value targets as well as the learned value are usually far away from the optimal value. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
592,
|
| 77 |
+
825,
|
| 78 |
+
647
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "Naturally, this leads to the following idea: If we can make the value target closer to the optimal value, we may speedup TD learning. For example, we know that the optimal value is just the expected discounted return of the optimal policy, which always upper bounds the expected return of any policy. For episodic RL tasks, we could use the observed discounted return up to episode end from the training trajectories to lower bound the value target. This makes the new value target closer to the optimal value, when the empirical return is higher than the Bellman target. ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
655,
|
| 88 |
+
825,
|
| 89 |
+
738
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "Will such a way of lower bounding the value target work: Will it still converge? Will it converge to the optimal value? Will it speed up value learning? ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
176,
|
| 98 |
+
746,
|
| 99 |
+
821,
|
| 100 |
+
773
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 0
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "2 THEORETICAL RESULTS FOR THE TABULAR CASE ",
|
| 107 |
+
"text_level": 1,
|
| 108 |
+
"bbox": [
|
| 109 |
+
174,
|
| 110 |
+
792,
|
| 111 |
+
620,
|
| 112 |
+
809
|
| 113 |
+
],
|
| 114 |
+
"page_idx": 0
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"type": "text",
|
| 118 |
+
"text": "For the tabular case, value target lower bounding converges to the same optimal value as the original Bellman value learning, and the proof is also straightforward. ",
|
| 119 |
+
"bbox": [
|
| 120 |
+
176,
|
| 121 |
+
824,
|
| 122 |
+
823,
|
| 123 |
+
853
|
| 124 |
+
],
|
| 125 |
+
"page_idx": 0
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"type": "text",
|
| 129 |
+
"text": "2.1 BACKGROUND ",
|
| 130 |
+
"text_level": 1,
|
| 131 |
+
"bbox": [
|
| 132 |
+
174,
|
| 133 |
+
869,
|
| 134 |
+
315,
|
| 135 |
+
883
|
| 136 |
+
],
|
| 137 |
+
"page_idx": 0
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"type": "text",
|
| 141 |
+
"text": "In finite MDPs with a limited number of states and actions, a table can be used to keep track of the value of each state. Using dynamic programming algorithms such as value iteration, values ",
|
| 142 |
+
"bbox": [
|
| 143 |
+
174,
|
| 144 |
+
895,
|
| 145 |
+
823,
|
| 146 |
+
924
|
| 147 |
+
],
|
| 148 |
+
"page_idx": 0
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
"type": "text",
|
| 152 |
+
"text": "are guaranteed to converge to the optimal through Bellman updates (Chapter 4.4 (Sutton & Barto, 2018)). ",
|
| 153 |
+
"bbox": [
|
| 154 |
+
169,
|
| 155 |
+
103,
|
| 156 |
+
823,
|
| 157 |
+
132
|
| 158 |
+
],
|
| 159 |
+
"page_idx": 1
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"type": "text",
|
| 163 |
+
"text": "Algorithm 1: Bellman value iteration with value target lower bounding ",
|
| 164 |
+
"text_level": 1,
|
| 165 |
+
"bbox": [
|
| 166 |
+
174,
|
| 167 |
+
155,
|
| 168 |
+
642,
|
| 169 |
+
170
|
| 170 |
+
],
|
| 171 |
+
"page_idx": 1
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"type": "text",
|
| 175 |
+
"text": "Data: Finite MDP $p ( s ^ { \\prime } , r | s , g , a )$ , convergence threshold $\\theta$ \nResult: State value $v ( s )$ \n1 $v ( s ) \\gets 0$ ; \n2 repeat \n3 $\\Delta 0$ ; \n4 for each state s do \n5 $v v ( s )$ ; \n6 $\\begin{array} { r } { v ( s ) \\gets \\operatorname* { m a x } ( f , \\operatorname* { m a x } _ { a } \\sum _ { s ^ { \\prime } , r } p ( s ^ { \\prime } , r | s , g , a ) [ r + \\gamma v ( s ^ { \\prime } ) ] ) ; } \\end{array}$ \n7 $\\Delta \\gets \\operatorname* { m a x } ( \\Delta , | v ( s ) - v | )$ ; \n8 end \n9 until $\\Delta < \\theta$ ; ",
|
| 176 |
+
"bbox": [
|
| 177 |
+
161,
|
| 178 |
+
172,
|
| 179 |
+
599,
|
| 180 |
+
333
|
| 181 |
+
],
|
| 182 |
+
"page_idx": 1
|
| 183 |
+
},
|
| 184 |
+
{
|
| 185 |
+
"type": "text",
|
| 186 |
+
"text": "The core of the algorithm is the Bellman update of the value function, $B ( v )$ : ",
|
| 187 |
+
"bbox": [
|
| 188 |
+
174,
|
| 189 |
+
358,
|
| 190 |
+
671,
|
| 191 |
+
373
|
| 192 |
+
],
|
| 193 |
+
"page_idx": 1
|
| 194 |
+
},
|
| 195 |
+
{
|
| 196 |
+
"type": "equation",
|
| 197 |
+
"img_path": "images/8cba14ddef82b2a7a83c4eb9a883636058ba8a142c7f8895d8e52700ccd7f8b7.jpg",
|
| 198 |
+
"text": "$$\n\\mathcal { B } ( v ) ( s ) : = \\operatorname* { m a x } _ { a } \\sum _ { s ^ { \\prime } , r } p ( s ^ { \\prime } , r | s , g , a ) [ r + \\gamma v ( s ^ { \\prime } ) ]\n$$",
|
| 199 |
+
"text_format": "latex",
|
| 200 |
+
"bbox": [
|
| 201 |
+
341,
|
| 202 |
+
383,
|
| 203 |
+
655,
|
| 204 |
+
419
|
| 205 |
+
],
|
| 206 |
+
"page_idx": 1
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"type": "text",
|
| 210 |
+
"text": "It is well known that the Bellman operator, $\\boldsymbol { B }$ , is a contraction mapping over value functions (Denardo, 1967). That is, for any two value functions $v _ { 1 }$ and $v _ { 2 }$ , $| \\mathcal { B } ( \\bar { v _ { 1 } } ) - \\mathcal { B } ( v _ { 2 } ) | \\leq \\gamma | v _ { 1 } - v _ { 2 } |$ for the discount factor $\\gamma \\in \\ [ 0 , 1 )$ . This guarantees that any value function under the algorithm converges to the optimal value.1 ",
|
| 211 |
+
"bbox": [
|
| 212 |
+
174,
|
| 213 |
+
438,
|
| 214 |
+
825,
|
| 215 |
+
493
|
| 216 |
+
],
|
| 217 |
+
"page_idx": 1
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"type": "text",
|
| 221 |
+
"text": "2.2 VALUE TARGET LOWER BOUNDING CONVERGENCE THEOREM ",
|
| 222 |
+
"text_level": 1,
|
| 223 |
+
"bbox": [
|
| 224 |
+
174,
|
| 225 |
+
516,
|
| 226 |
+
640,
|
| 227 |
+
530
|
| 228 |
+
],
|
| 229 |
+
"page_idx": 1
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"type": "text",
|
| 233 |
+
"text": "Theorem 1. Suppose the optimal value under the Bellman operator is $B ^ { \\infty } ( v )$ . For any value function $f$ that lower bounds the optimal value, i.e. $\\forall s$ $' s , f ( s ) \\leq B ^ { \\bar { \\infty } } ( v ) ( s )$ , if we define the lower bounded Bellman operator as $\\mathcal M _ { f } \\circ \\mathcal B ( v ) : = \\operatorname* { m a x } ( \\mathcal B ( v ) , f )$ , then $( \\mathcal { M } _ { f } \\circ B ) ^ { \\infty } ( v )$ converges to $B ^ { \\infty } ( v )$ . ",
|
| 234 |
+
"bbox": [
|
| 235 |
+
174,
|
| 236 |
+
542,
|
| 237 |
+
825,
|
| 238 |
+
585
|
| 239 |
+
],
|
| 240 |
+
"page_idx": 1
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"type": "text",
|
| 244 |
+
"text": "A few things to note about the proof (see Appendix A.1). ",
|
| 245 |
+
"bbox": [
|
| 246 |
+
174,
|
| 247 |
+
598,
|
| 248 |
+
547,
|
| 249 |
+
613
|
| 250 |
+
],
|
| 251 |
+
"page_idx": 1
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"type": "text",
|
| 255 |
+
"text": "First, this only proves convergence, not contraction under the original $\\lvert \\lvert v _ { 1 } - v _ { 2 } \\rvert \\rvert _ { \\infty }$ metric. In the case of the Bellman operator, contraction shows that $\\forall v _ { 1 } , v _ { 2 }$ value functions, $| | B ( \\boldsymbol { v } _ { 1 } ) - B ( \\boldsymbol { v } _ { 2 } ) | | _ { \\infty } \\leq$ $\\gamma | | \\boldsymbol { v } _ { 1 } - \\boldsymbol { v } _ { 2 } | | _ { \\infty }$ . Here, for value target lower bounding, there can be counter examples where ${ \\mathcal { M } } _ { f } \\circ B$ does not always contract in the original metric space for value functions. Here, convergence relies on the convergence of the Bellman value iteration and the existence of the fixed point $v ^ { * }$ . One difficulty caused by this change is that the stopping criterion in Algorithm 1 $\\Delta < \\theta _ { , }$ ) no longer works, as we do not have access to the converged value during learning. This is perhaps not a serious concern in practice, as people often train algorithms for a fixed number of iterations or time steps. ",
|
| 256 |
+
"bbox": [
|
| 257 |
+
173,
|
| 258 |
+
619,
|
| 259 |
+
825,
|
| 260 |
+
732
|
| 261 |
+
],
|
| 262 |
+
"page_idx": 1
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"type": "text",
|
| 266 |
+
"text": "Second, based on the proof, the new algorithm is at least as fast as the original. When the lower bound actually improves the value target, i.e. $f ( s ) > B ( v _ { 1 } ) ( s )$ , there is a chance for the convergence to be faster. Convergence is strictly faster when the lower bound $f$ has an impact on the $L _ { \\infty }$ distance between the current value and the optimal value, i.e. it increases the value target for the states where the differences between the value target and the optimal value are the largest. ",
|
| 267 |
+
"bbox": [
|
| 268 |
+
174,
|
| 269 |
+
738,
|
| 270 |
+
825,
|
| 271 |
+
809
|
| 272 |
+
],
|
| 273 |
+
"page_idx": 1
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"type": "text",
|
| 277 |
+
"text": "Third, the lower bound function doesn’t have to be static during training. As long as there is a single $f$ during each iteration, convergence property is preserved. ",
|
| 278 |
+
"bbox": [
|
| 279 |
+
173,
|
| 280 |
+
815,
|
| 281 |
+
823,
|
| 282 |
+
844
|
| 283 |
+
],
|
| 284 |
+
"page_idx": 1
|
| 285 |
+
},
|
| 286 |
+
{
|
| 287 |
+
"type": "text",
|
| 288 |
+
"text": "Fourth, the theory works even when the underlying MDP is stochastic. Only the lower bounds based on empirical return introduced below require the MDP to be deterministic. ",
|
| 289 |
+
"bbox": [
|
| 290 |
+
173,
|
| 291 |
+
851,
|
| 292 |
+
823,
|
| 293 |
+
878
|
| 294 |
+
],
|
| 295 |
+
"page_idx": 1
|
| 296 |
+
},
|
| 297 |
+
{
|
| 298 |
+
"type": "text",
|
| 299 |
+
"text": "3 EXAMPLE LOWER BOUND FUNCTIONS ",
|
| 300 |
+
"text_level": 1,
|
| 301 |
+
"bbox": [
|
| 302 |
+
174,
|
| 303 |
+
102,
|
| 304 |
+
529,
|
| 305 |
+
118
|
| 306 |
+
],
|
| 307 |
+
"page_idx": 2
|
| 308 |
+
},
|
| 309 |
+
{
|
| 310 |
+
"type": "text",
|
| 311 |
+
"text": "We show a few cases where lower bound functions can be readily obtained from the training experience. Future work may investigate alternative lower bounds. ",
|
| 312 |
+
"bbox": [
|
| 313 |
+
174,
|
| 314 |
+
132,
|
| 315 |
+
820,
|
| 316 |
+
161
|
| 317 |
+
],
|
| 318 |
+
"page_idx": 2
|
| 319 |
+
},
|
| 320 |
+
{
|
| 321 |
+
"type": "text",
|
| 322 |
+
"text": "3.1 EPISODIC TASKS ",
|
| 323 |
+
"text_level": 1,
|
| 324 |
+
"bbox": [
|
| 325 |
+
176,
|
| 326 |
+
178,
|
| 327 |
+
331,
|
| 328 |
+
193
|
| 329 |
+
],
|
| 330 |
+
"page_idx": 2
|
| 331 |
+
},
|
| 332 |
+
{
|
| 333 |
+
"type": "text",
|
| 334 |
+
"text": "In episodic tasks, discounted return is only accumulated up to the last step of an episode. In this case, we can wait until an episode ends, and compute future discounted returns of all time steps inside the episode. This discounted return is guaranteed to be a lower bound of the optimal value, if the environment is deterministic, i.e. the reward sequence can be repeated using the exact same sequence of actions. (The behavior policy need not be deterministic, as long as the policy class contains the deterministic optimal policy.) To make training efficient, we can compute and store such discounted returns into the replay buffer for each time step, and simply read them out during training. ",
|
| 335 |
+
"bbox": [
|
| 336 |
+
173,
|
| 337 |
+
204,
|
| 338 |
+
825,
|
| 339 |
+
315
|
| 340 |
+
],
|
| 341 |
+
"page_idx": 2
|
| 342 |
+
},
|
| 343 |
+
{
|
| 344 |
+
"type": "text",
|
| 345 |
+
"text": "We call this variant lb-DR, short for lower bounding with discounted return. ",
|
| 346 |
+
"bbox": [
|
| 347 |
+
176,
|
| 348 |
+
321,
|
| 349 |
+
671,
|
| 350 |
+
337
|
| 351 |
+
],
|
| 352 |
+
"page_idx": 2
|
| 353 |
+
},
|
| 354 |
+
{
|
| 355 |
+
"type": "text",
|
| 356 |
+
"text": "3.1.1 EPISODIC WITH HINDSIGHT RELABELED GOALS",
|
| 357 |
+
"text_level": 1,
|
| 358 |
+
"bbox": [
|
| 359 |
+
173,
|
| 360 |
+
352,
|
| 361 |
+
558,
|
| 362 |
+
366
|
| 363 |
+
],
|
| 364 |
+
"page_idx": 2
|
| 365 |
+
},
|
| 366 |
+
{
|
| 367 |
+
"type": "text",
|
| 368 |
+
"text": "In goal conditioned tasks, one helpful technique is hindsight goal relabeling (Andrychowicz et al., 2017). It takes a future state that is $d$ time steps away from the current state as the hindsight $/$ relabeled goal for the current state. When the goal is reached, a reward of 0 is given, otherwise a -1 reward is given for each time step. ",
|
| 369 |
+
"bbox": [
|
| 370 |
+
173,
|
| 371 |
+
376,
|
| 372 |
+
825,
|
| 373 |
+
431
|
| 374 |
+
],
|
| 375 |
+
"page_idx": 2
|
| 376 |
+
},
|
| 377 |
+
{
|
| 378 |
+
"type": "text",
|
| 379 |
+
"text": "In this case, we know it took $d$ steps to reach the hindsight goal, so the discounted future return is: ",
|
| 380 |
+
"bbox": [
|
| 381 |
+
173,
|
| 382 |
+
438,
|
| 383 |
+
815,
|
| 384 |
+
453
|
| 385 |
+
],
|
| 386 |
+
"page_idx": 2
|
| 387 |
+
},
|
| 388 |
+
{
|
| 389 |
+
"type": "equation",
|
| 390 |
+
"img_path": "images/482c871c4d2470616ff2d920b899133177b20984615c80c0c311132c456d6750.jpg",
|
| 391 |
+
"text": "$$\n\\begin{array} { c } { { R _ { d } = \\displaystyle \\sum _ { i = 0 , . . , d - 1 } - 1 \\gamma ^ { i } } } \\\\ { { = - \\displaystyle 1 ( 1 - \\gamma ^ { d } ) / ( 1 - \\gamma ) } } \\end{array}\n$$",
|
| 392 |
+
"text_format": "latex",
|
| 393 |
+
"bbox": [
|
| 394 |
+
405,
|
| 395 |
+
457,
|
| 396 |
+
591,
|
| 397 |
+
515
|
| 398 |
+
],
|
| 399 |
+
"page_idx": 2
|
| 400 |
+
},
|
| 401 |
+
{
|
| 402 |
+
"type": "text",
|
| 403 |
+
"text": "This calculation can be done on the fly as hindsight relabeling happens, requiring no extra space and very little computation. ",
|
| 404 |
+
"bbox": [
|
| 405 |
+
173,
|
| 406 |
+
523,
|
| 407 |
+
825,
|
| 408 |
+
553
|
| 409 |
+
],
|
| 410 |
+
"page_idx": 2
|
| 411 |
+
},
|
| 412 |
+
{
|
| 413 |
+
"type": "text",
|
| 414 |
+
"text": "We call this variant lb-GD, short for lower bounding with goal distance based return. ",
|
| 415 |
+
"bbox": [
|
| 416 |
+
176,
|
| 417 |
+
559,
|
| 418 |
+
728,
|
| 419 |
+
574
|
| 420 |
+
],
|
| 421 |
+
"page_idx": 2
|
| 422 |
+
},
|
| 423 |
+
{
|
| 424 |
+
"type": "text",
|
| 425 |
+
"text": "Additionally, we can also apply lb-DR and lb-GD together, with discounted return lower bounding (lb-DR) on the original experience and goal distance return lower bounding (lb-GD) on the hindsight experience, giving the lb-DR $^ +$ GD variant, which was used by Fujita et al. (2020) independently. ",
|
| 426 |
+
"bbox": [
|
| 427 |
+
174,
|
| 428 |
+
580,
|
| 429 |
+
825,
|
| 430 |
+
623
|
| 431 |
+
],
|
| 432 |
+
"page_idx": 2
|
| 433 |
+
},
|
| 434 |
+
{
|
| 435 |
+
"type": "text",
|
| 436 |
+
"text": "3.2 NON-EPISODIC TASKS WITH POSITIVE REWARDS ",
|
| 437 |
+
"text_level": 1,
|
| 438 |
+
"bbox": [
|
| 439 |
+
174,
|
| 440 |
+
640,
|
| 441 |
+
549,
|
| 442 |
+
654
|
| 443 |
+
],
|
| 444 |
+
"page_idx": 2
|
| 445 |
+
},
|
| 446 |
+
{
|
| 447 |
+
"type": "text",
|
| 448 |
+
"text": "When the task is continuing, without an episode end, discounted return needs to be accumulated all the way to infinity. This makes it difficult to lower bound the value if rewards can be negative. When rewards are always non-negative, one can still use the discounted return of the future n-steps to lower bound the value. Chapter 3.3 of Sutton & Barto (2018) has more details on episodic vs continuing tasks. ",
|
| 449 |
+
"bbox": [
|
| 450 |
+
174,
|
| 451 |
+
665,
|
| 452 |
+
825,
|
| 453 |
+
736
|
| 454 |
+
],
|
| 455 |
+
"page_idx": 2
|
| 456 |
+
},
|
| 457 |
+
{
|
| 458 |
+
"type": "text",
|
| 459 |
+
"text": "4 INTEGRATION INTO RL ALGORITHMS ",
|
| 460 |
+
"text_level": 1,
|
| 461 |
+
"bbox": [
|
| 462 |
+
174,
|
| 463 |
+
755,
|
| 464 |
+
516,
|
| 465 |
+
771
|
| 466 |
+
],
|
| 467 |
+
"page_idx": 2
|
| 468 |
+
},
|
| 469 |
+
{
|
| 470 |
+
"type": "text",
|
| 471 |
+
"text": "4.1 BACKGROUND ",
|
| 472 |
+
"text_level": 1,
|
| 473 |
+
"bbox": [
|
| 474 |
+
174,
|
| 475 |
+
785,
|
| 476 |
+
316,
|
| 477 |
+
801
|
| 478 |
+
],
|
| 479 |
+
"page_idx": 2
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"type": "text",
|
| 483 |
+
"text": "The value target lower bounds can be readily plugged into RL algorithms that regresses value to a target, e.g. DQN, DDPG or SAC. ",
|
| 484 |
+
"bbox": [
|
| 485 |
+
174,
|
| 486 |
+
811,
|
| 487 |
+
823,
|
| 488 |
+
840
|
| 489 |
+
],
|
| 490 |
+
"page_idx": 2
|
| 491 |
+
},
|
| 492 |
+
{
|
| 493 |
+
"type": "text",
|
| 494 |
+
"text": "In these algorithms, the action value $\\boldsymbol { q } ( s , a )$ is learned through a squared loss with the target value $y$ . In one step TD return, for a batch $\\mathbf { B }$ of experience $\\{ s , a r , s ^ { \\prime } \\}$ , the loss is: ",
|
| 495 |
+
"bbox": [
|
| 496 |
+
171,
|
| 497 |
+
847,
|
| 498 |
+
825,
|
| 499 |
+
876
|
| 500 |
+
],
|
| 501 |
+
"page_idx": 2
|
| 502 |
+
},
|
| 503 |
+
{
|
| 504 |
+
"type": "equation",
|
| 505 |
+
"img_path": "images/411f42f2e664ac2a3e866771be836c67d09c3ee9327c307df0d2ab1b5f6f7de3.jpg",
|
| 506 |
+
"text": "$$\n\\mathcal { L } _ { q } : = \\sum _ { ( s , a , r , s ^ { \\prime } ) \\in \\mathbf { B } } | q ( s , a ) - y | ^ { 2 }\n$$",
|
| 507 |
+
"text_format": "latex",
|
| 508 |
+
"bbox": [
|
| 509 |
+
395,
|
| 510 |
+
891,
|
| 511 |
+
602,
|
| 512 |
+
928
|
| 513 |
+
],
|
| 514 |
+
"page_idx": 2
|
| 515 |
+
},
|
| 516 |
+
{
|
| 517 |
+
"type": "text",
|
| 518 |
+
"text": "In one step TD return, $y$ is the one step TD return $\\hat { q } ( s , a , r , s ^ { \\prime } )$ : ",
|
| 519 |
+
"bbox": [
|
| 520 |
+
173,
|
| 521 |
+
103,
|
| 522 |
+
584,
|
| 523 |
+
119
|
| 524 |
+
],
|
| 525 |
+
"page_idx": 3
|
| 526 |
+
},
|
| 527 |
+
{
|
| 528 |
+
"type": "equation",
|
| 529 |
+
"img_path": "images/0806e56bb4d80de3eaf76967e5017b9a0aaa5668e87c9c52cc43ac2fe654cd84.jpg",
|
| 530 |
+
"text": "$$\n\\hat { q } ( s , a , r , s ^ { \\prime } ) : = r ( s , a ) + \\gamma q ^ { \\prime } ( s ^ { \\prime } , \\mu ^ { \\prime } ( s ^ { \\prime } ) )\n$$",
|
| 531 |
+
"text_format": "latex",
|
| 532 |
+
"bbox": [
|
| 533 |
+
366,
|
| 534 |
+
137,
|
| 535 |
+
632,
|
| 536 |
+
156
|
| 537 |
+
],
|
| 538 |
+
"page_idx": 3
|
| 539 |
+
},
|
| 540 |
+
{
|
| 541 |
+
"type": "text",
|
| 542 |
+
"text": "Here, $q ^ { \\prime }$ and $\\mu ^ { \\prime }$ are the bootstrap value and policy functions, typically following the value and policy functions in a delayed schedule during training. (They are also called “target value” and “target policy”, and are very different from the “value target” $y$ in this paper.) ",
|
| 543 |
+
"bbox": [
|
| 544 |
+
174,
|
| 545 |
+
166,
|
| 546 |
+
825,
|
| 547 |
+
210
|
| 548 |
+
],
|
| 549 |
+
"page_idx": 3
|
| 550 |
+
},
|
| 551 |
+
{
|
| 552 |
+
"type": "text",
|
| 553 |
+
"text": "4.2 VALUE TARGET LOWER BOUNDING ",
|
| 554 |
+
"text_level": 1,
|
| 555 |
+
"bbox": [
|
| 556 |
+
174,
|
| 557 |
+
227,
|
| 558 |
+
457,
|
| 559 |
+
242
|
| 560 |
+
],
|
| 561 |
+
"page_idx": 3
|
| 562 |
+
},
|
| 563 |
+
{
|
| 564 |
+
"type": "text",
|
| 565 |
+
"text": "With lower bounding, we replace the value target $y$ with the lower bounded target: ",
|
| 566 |
+
"bbox": [
|
| 567 |
+
173,
|
| 568 |
+
252,
|
| 569 |
+
712,
|
| 570 |
+
268
|
| 571 |
+
],
|
| 572 |
+
"page_idx": 3
|
| 573 |
+
},
|
| 574 |
+
{
|
| 575 |
+
"type": "equation",
|
| 576 |
+
"img_path": "images/b95c723f7559775cd14b105f6ebed5299a2bc51851b6ce2bf8d668b8ca508012.jpg",
|
| 577 |
+
"text": "$$\ny \\gets \\operatorname* { m a x } ( f , \\hat { q } ( s , a , r , s ^ { \\prime } ) ) = \\operatorname* { m a x } ( f , r + \\gamma q ^ { \\prime } ( s ^ { \\prime } , \\mu ^ { \\prime } ( s ^ { \\prime } ) ) )\n$$",
|
| 578 |
+
"text_format": "latex",
|
| 579 |
+
"bbox": [
|
| 580 |
+
310,
|
| 581 |
+
287,
|
| 582 |
+
687,
|
| 583 |
+
306
|
| 584 |
+
],
|
| 585 |
+
"page_idx": 3
|
| 586 |
+
},
|
| 587 |
+
{
|
| 588 |
+
"type": "text",
|
| 589 |
+
"text": "This is subtly but importantly different from lower bounding the $q$ value directly (Oh et al., 2018; \nTang, 2020): $q ( s , a ) \\bar { } \\operatorname* { m a x } \\dot { ( } f , q ( s , a ) )$ , which stays overestimated if $\\boldsymbol { q } ( s , a )$ initially overestimates. \nThis is the same as was done by Fujita et al. (2020) (confirmed via personal communication). ",
|
| 590 |
+
"bbox": [
|
| 591 |
+
174,
|
| 592 |
+
316,
|
| 593 |
+
825,
|
| 594 |
+
359
|
| 595 |
+
],
|
| 596 |
+
"page_idx": 3
|
| 597 |
+
},
|
| 598 |
+
{
|
| 599 |
+
"type": "text",
|
| 600 |
+
"text": "This way of simply lower bounding the value target does not require any tuning parameter, but one can always interpolate between these two value targets using a mixing weight $\\alpha$ : ",
|
| 601 |
+
"bbox": [
|
| 602 |
+
171,
|
| 603 |
+
366,
|
| 604 |
+
823,
|
| 605 |
+
395
|
| 606 |
+
],
|
| 607 |
+
"page_idx": 3
|
| 608 |
+
},
|
| 609 |
+
{
|
| 610 |
+
"type": "equation",
|
| 611 |
+
"img_path": "images/d0ae57ced6e612048477acd8ef0469d07d81b1a2ff977767395c562c53fa1458.jpg",
|
| 612 |
+
"text": "$$\ny \\gets ( 1 - \\alpha ) \\hat { q } ( s , a ) + \\alpha \\operatorname* { m a x } ( f , \\hat { q } ( s , a ) )\n$$",
|
| 613 |
+
"text_format": "latex",
|
| 614 |
+
"bbox": [
|
| 615 |
+
364,
|
| 616 |
+
415,
|
| 617 |
+
633,
|
| 618 |
+
433
|
| 619 |
+
],
|
| 620 |
+
"page_idx": 3
|
| 621 |
+
},
|
| 622 |
+
{
|
| 623 |
+
"type": "text",
|
| 624 |
+
"text": "A small $\\alpha$ dampens the effect of the new value target, and may be desirable in practice when assumptions of the theorem can be violated, e.g. for non-deterministic tasks. ",
|
| 625 |
+
"bbox": [
|
| 626 |
+
171,
|
| 627 |
+
444,
|
| 628 |
+
823,
|
| 629 |
+
473
|
| 630 |
+
],
|
| 631 |
+
"page_idx": 3
|
| 632 |
+
},
|
| 633 |
+
{
|
| 634 |
+
"type": "text",
|
| 635 |
+
"text": "See Appendix A.2 for an illustrative example of how value target lower bounding works in practice. ",
|
| 636 |
+
"bbox": [
|
| 637 |
+
174,
|
| 638 |
+
478,
|
| 639 |
+
823,
|
| 640 |
+
494
|
| 641 |
+
],
|
| 642 |
+
"page_idx": 3
|
| 643 |
+
},
|
| 644 |
+
{
|
| 645 |
+
"type": "text",
|
| 646 |
+
"text": "5 EXPERIMENTS ",
|
| 647 |
+
"text_level": 1,
|
| 648 |
+
"bbox": [
|
| 649 |
+
176,
|
| 650 |
+
515,
|
| 651 |
+
326,
|
| 652 |
+
531
|
| 653 |
+
],
|
| 654 |
+
"page_idx": 3
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"type": "text",
|
| 658 |
+
"text": "The goal is to demonstrate the sample efficiency of lower bounding the value target over baseline such as DDPG, TD3, SAC and HER. Because the lower bounded value target can now look potentially many steps into the future, we suspect it to be best suited for long horizon, sparse reward tasks. Hence, we choose to experiment on the following tasks. ",
|
| 659 |
+
"bbox": [
|
| 660 |
+
174,
|
| 661 |
+
546,
|
| 662 |
+
825,
|
| 663 |
+
603
|
| 664 |
+
],
|
| 665 |
+
"page_idx": 3
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
"type": "text",
|
| 669 |
+
"text": "5.1 ENVIRONMENTS AND TASKS ",
|
| 670 |
+
"text_level": 1,
|
| 671 |
+
"bbox": [
|
| 672 |
+
176,
|
| 673 |
+
621,
|
| 674 |
+
411,
|
| 675 |
+
635
|
| 676 |
+
],
|
| 677 |
+
"page_idx": 3
|
| 678 |
+
},
|
| 679 |
+
{
|
| 680 |
+
"type": "text",
|
| 681 |
+
"text": "We experiment on three sets of tasks with different input characteristics and control difficulty. Some of the tasks are not goal conditioned, so only lower bounding with empirical discounted return is available. Some of them are goal conditioned, so both empirical discounted return and hindsight relabeling with discounted goal return as lower bound are available. ",
|
| 682 |
+
"bbox": [
|
| 683 |
+
174,
|
| 684 |
+
646,
|
| 685 |
+
825,
|
| 686 |
+
703
|
| 687 |
+
],
|
| 688 |
+
"page_idx": 3
|
| 689 |
+
},
|
| 690 |
+
{
|
| 691 |
+
"type": "text",
|
| 692 |
+
"text": "5.1.1 ATARI GAMES ",
|
| 693 |
+
"text_level": 1,
|
| 694 |
+
"bbox": [
|
| 695 |
+
174,
|
| 696 |
+
719,
|
| 697 |
+
326,
|
| 698 |
+
733
|
| 699 |
+
],
|
| 700 |
+
"page_idx": 3
|
| 701 |
+
},
|
| 702 |
+
{
|
| 703 |
+
"type": "text",
|
| 704 |
+
"text": "We experiment on the classical Atari games with image input to test using discounted episodic return to lower bound value target. We picked the popular games Breakout, Seaquest, Space Invaders, Atlantis, Frostbite and $\\boldsymbol { \\mathrm { Q } } ^ { * } \\boldsymbol { \\mathrm { b e r t } }$ , and only experimented on them. As with prior work (Oh et al., 2018), we evaluate on the deterministic versions of the games, NoFrameskip-v4 with actions repeated for a fixed (four) frames. ",
|
| 705 |
+
"bbox": [
|
| 706 |
+
174,
|
| 707 |
+
742,
|
| 708 |
+
825,
|
| 709 |
+
813
|
| 710 |
+
],
|
| 711 |
+
"page_idx": 3
|
| 712 |
+
},
|
| 713 |
+
{
|
| 714 |
+
"type": "text",
|
| 715 |
+
"text": "5.1.2 EPISODIC FETCH PUSH, SLIDE AND PICKANDPLACE ",
|
| 716 |
+
"text_level": 1,
|
| 717 |
+
"bbox": [
|
| 718 |
+
174,
|
| 719 |
+
829,
|
| 720 |
+
594,
|
| 721 |
+
844
|
| 722 |
+
],
|
| 723 |
+
"page_idx": 3
|
| 724 |
+
},
|
| 725 |
+
{
|
| 726 |
+
"type": "text",
|
| 727 |
+
"text": "The FetchEnv tasks (Plappert et al., 2018) are goal conditioned tasks with a robotic arm moving objects on a table. Robot states and object position serve as input. The agent outputs continuous actions taking the form of relative positions to move to. A PID controller translates the relative position actions into the exact torque applied at each joint. Rewards are sparse and goal-conditioned, with -1 for non-goal states and 0 for goal states. ",
|
| 728 |
+
"bbox": [
|
| 729 |
+
174,
|
| 730 |
+
853,
|
| 731 |
+
825,
|
| 732 |
+
924
|
| 733 |
+
],
|
| 734 |
+
"page_idx": 3
|
| 735 |
+
},
|
| 736 |
+
{
|
| 737 |
+
"type": "text",
|
| 738 |
+
"text": "By default the FetchEnv tasks are non-episodic. They reset every 50 steps, but all steps including the step right before task reset have the same positive discount (Andrychowicz et al., 2017). As explained in Section 3.1, to allow reliable estimates of return lower bounds to be calculated from past experience, we make them episodic by adding a gym wrapper around the environment to end an episode after its goal is achieved, and reset the task. When a goal is not reached within 50 steps, we just reset the task without ending the episode, as is done in the original FetchEnv, and such experience is not used in value target lower bounding.2 This also changes the nature of the tasks, so the agent does not have to stay at the goal state indefinitely, but instead only needs to reach the goal position as fast as possible. This makes the episodic FetchEnv tasks slightly easier to train than the original tasks, because the agent only needs to reach the goal state quickly, instead of having to reach and stay at the goal position indefinitely. (There are ways to avoid changing the desired behavior by e.g. including agent’s speed into the goal state or requiring the agent to stay at the goal position for several time steps before ending the episode. This seems orthogonal to the main idea here, and is not included in this work.) ",
|
| 739 |
+
"bbox": [
|
| 740 |
+
174,
|
| 741 |
+
103,
|
| 742 |
+
825,
|
| 743 |
+
297
|
| 744 |
+
],
|
| 745 |
+
"page_idx": 4
|
| 746 |
+
},
|
| 747 |
+
{
|
| 748 |
+
"type": "text",
|
| 749 |
+
"text": "Compared with the Atari games, the inputs are simpler, no longer image based, but the control task is continuous, under realistic physical simulation and harder. ",
|
| 750 |
+
"bbox": [
|
| 751 |
+
173,
|
| 752 |
+
305,
|
| 753 |
+
823,
|
| 754 |
+
333
|
| 755 |
+
],
|
| 756 |
+
"page_idx": 4
|
| 757 |
+
},
|
| 758 |
+
{
|
| 759 |
+
"type": "text",
|
| 760 |
+
"text": "5.1.3 PIONEER PUSH AND REACH TASKS ",
|
| 761 |
+
"text_level": 1,
|
| 762 |
+
"bbox": [
|
| 763 |
+
176,
|
| 764 |
+
359,
|
| 765 |
+
470,
|
| 766 |
+
375
|
| 767 |
+
],
|
| 768 |
+
"page_idx": 4
|
| 769 |
+
},
|
| 770 |
+
{
|
| 771 |
+
"type": "image",
|
| 772 |
+
"img_path": "images/06c97daf3de06435621f0e26948c0b933fdb61e6255e1bd938561d1707ba4d5a.jpg",
|
| 773 |
+
"image_caption": [
|
| 774 |
+
"Figure 1: The Pioneer Push task and the Push and Reach task. "
|
| 775 |
+
],
|
| 776 |
+
"image_footnote": [],
|
| 777 |
+
"bbox": [
|
| 778 |
+
202,
|
| 779 |
+
404,
|
| 780 |
+
795,
|
| 781 |
+
577
|
| 782 |
+
],
|
| 783 |
+
"page_idx": 4
|
| 784 |
+
},
|
| 785 |
+
{
|
| 786 |
+
"type": "text",
|
| 787 |
+
"text": "This is a set of challenging goal reaching and object pushing tasks for the physically simulated car Pioneer 2dx. The car is 0.4 meter long. Objects and goal positions are randomly initialized between 0.5 meter to 1 meter of each other inside a 10 meter by 10 meter flat space. Inputs are the car and object states and the goal positions, and actions are the forces applied on the two driving wheels. ",
|
| 788 |
+
"bbox": [
|
| 789 |
+
174,
|
| 790 |
+
637,
|
| 791 |
+
825,
|
| 792 |
+
693
|
| 793 |
+
],
|
| 794 |
+
"page_idx": 4
|
| 795 |
+
},
|
| 796 |
+
{
|
| 797 |
+
"type": "text",
|
| 798 |
+
"text": "For the Pioneer Push task, the car has to push a block to within 0.5 meter of the 2 dimensional goal position indicated by a small red dot on the ground. For the Pioneer Push and Reach task, the car has to first push the object to the goal location (red dot) and then drive to a separate goal position (red ball in the air); the goal is achieved when the concatenation of the two goal locations (for Push and for Reach) is within 0.5 of the concatenated achieved positions (of the block and the car) in $L _ { 2 }$ -distance. ",
|
| 799 |
+
"bbox": [
|
| 800 |
+
174,
|
| 801 |
+
700,
|
| 802 |
+
825,
|
| 803 |
+
784
|
| 804 |
+
],
|
| 805 |
+
"page_idx": 4
|
| 806 |
+
},
|
| 807 |
+
{
|
| 808 |
+
"type": "text",
|
| 809 |
+
"text": "Similar to FetchEnv, we make the tasks episodic with sparse goal reward. ",
|
| 810 |
+
"bbox": [
|
| 811 |
+
174,
|
| 812 |
+
790,
|
| 813 |
+
653,
|
| 814 |
+
805
|
| 815 |
+
],
|
| 816 |
+
"page_idx": 4
|
| 817 |
+
},
|
| 818 |
+
{
|
| 819 |
+
"type": "text",
|
| 820 |
+
"text": "These tasks take longer time to accomplish, and also take longer time to train than the FetchEnv tasks. Some of the reasons are the force based wheel control instead of the higher level position control, and the arena space being much larger than just a tabletop. ",
|
| 821 |
+
"bbox": [
|
| 822 |
+
176,
|
| 823 |
+
813,
|
| 824 |
+
825,
|
| 825 |
+
854
|
| 826 |
+
],
|
| 827 |
+
"page_idx": 4
|
| 828 |
+
},
|
| 829 |
+
{
|
| 830 |
+
"type": "text",
|
| 831 |
+
"text": "5.2 BASELINES",
|
| 832 |
+
"text_level": 1,
|
| 833 |
+
"bbox": [
|
| 834 |
+
174,
|
| 835 |
+
103,
|
| 836 |
+
294,
|
| 837 |
+
117
|
| 838 |
+
],
|
| 839 |
+
"page_idx": 5
|
| 840 |
+
},
|
| 841 |
+
{
|
| 842 |
+
"type": "text",
|
| 843 |
+
"text": "Baselines include DDPG (Lillicrap et al., 2015), TD3 (Fujimoto et al., 2018), SAC (Haarnoja et al., 2018) and HER (Andrychowicz et al., 2017). Implementations are based on open sourced repositories, and baseline performance is verified against published results under similar settings. ",
|
| 844 |
+
"bbox": [
|
| 845 |
+
174,
|
| 846 |
+
133,
|
| 847 |
+
823,
|
| 848 |
+
176
|
| 849 |
+
],
|
| 850 |
+
"page_idx": 5
|
| 851 |
+
},
|
| 852 |
+
{
|
| 853 |
+
"type": "text",
|
| 854 |
+
"text": "5.3 HYPERPARAMETERS ",
|
| 855 |
+
"text_level": 1,
|
| 856 |
+
"bbox": [
|
| 857 |
+
176,
|
| 858 |
+
204,
|
| 859 |
+
356,
|
| 860 |
+
219
|
| 861 |
+
],
|
| 862 |
+
"page_idx": 5
|
| 863 |
+
},
|
| 864 |
+
{
|
| 865 |
+
"type": "text",
|
| 866 |
+
"text": "The value target lower bounding method itself does not have any hyperparameter, the only hyperparameters come from the baseline method. Hyperparameters for the baselines follow published work as much as possible. When tuning baseline hyperparameters, we searched for the best performance in totoal episodic reward, on one set of random seeds. Optimal hyperparameters are then fixed and evaluated on a separate set of random seeds never seen during development. For the treatment, we just used the optimal parameters from the baseline tuning, except for the Atari games where we found the treatment to benefit from more (eight) minibatch updates of size 250 per training iteration (instead of four updates of 500) and from skipping reward clipping. Hyperparameter values are detailed in Appendix A.3. ",
|
| 867 |
+
"bbox": [
|
| 868 |
+
174,
|
| 869 |
+
234,
|
| 870 |
+
825,
|
| 871 |
+
361
|
| 872 |
+
],
|
| 873 |
+
"page_idx": 5
|
| 874 |
+
},
|
| 875 |
+
{
|
| 876 |
+
"type": "text",
|
| 877 |
+
"text": "5.4 RESULTS ",
|
| 878 |
+
"text_level": 1,
|
| 879 |
+
"bbox": [
|
| 880 |
+
174,
|
| 881 |
+
390,
|
| 882 |
+
277,
|
| 883 |
+
404
|
| 884 |
+
],
|
| 885 |
+
"page_idx": 5
|
| 886 |
+
},
|
| 887 |
+
{
|
| 888 |
+
"type": "text",
|
| 889 |
+
"text": "We show evaluation performance averaged across separate training runs (five for the less stable Atari games and three for the others). Each run uses a random seed never seen during development. ",
|
| 890 |
+
"bbox": [
|
| 891 |
+
176,
|
| 892 |
+
420,
|
| 893 |
+
823,
|
| 894 |
+
448
|
| 895 |
+
],
|
| 896 |
+
"page_idx": 5
|
| 897 |
+
},
|
| 898 |
+
{
|
| 899 |
+
"type": "text",
|
| 900 |
+
"text": "5.4.1 LB-DR VS BASELINE SAC/DDPG",
|
| 901 |
+
"text_level": 1,
|
| 902 |
+
"bbox": [
|
| 903 |
+
176,
|
| 904 |
+
474,
|
| 905 |
+
464,
|
| 906 |
+
489
|
| 907 |
+
],
|
| 908 |
+
"page_idx": 5
|
| 909 |
+
},
|
| 910 |
+
{
|
| 911 |
+
"type": "text",
|
| 912 |
+
"text": "Figure 2 compares lower bounding with discounted return (lb-DR) against SAC or DDPG baseline on Atari games and the episodic FetchEnv tasks. ",
|
| 913 |
+
"bbox": [
|
| 914 |
+
171,
|
| 915 |
+
503,
|
| 916 |
+
823,
|
| 917 |
+
532
|
| 918 |
+
],
|
| 919 |
+
"page_idx": 5
|
| 920 |
+
},
|
| 921 |
+
{
|
| 922 |
+
"type": "text",
|
| 923 |
+
"text": "For most tasks, lower bounding with episodic discounted return (lb-DR) performs similarly or better than the baselines. On Atari Breakout, Atlantis, Frostbite and Q\\*bert, and FetchPush and FetchPickAndPlace the gains are quite large. On Atari Seaquest, there is still a significant sample efficiency gain initially. ",
|
| 924 |
+
"bbox": [
|
| 925 |
+
174,
|
| 926 |
+
539,
|
| 927 |
+
823,
|
| 928 |
+
594
|
| 929 |
+
],
|
| 930 |
+
"page_idx": 5
|
| 931 |
+
},
|
| 932 |
+
{
|
| 933 |
+
"type": "text",
|
| 934 |
+
"text": "The lb-DR method is effective, but is it really due to improvements to the value targets? Figure 5 (Appendix A.4) looks at the fraction of training experience where lower bounded value target is actually higher than the baseline Bellman value target over the course of training. For the episodic FetchEnv tasks, as training progresses, a meaningful fraction of experience start to benefit from better value targets, and the average return performance also starts to improve over the baseline, although a large fraction of experience benefiting from higher value targets does not always mean a much higher average return (see FetchSlide). For most Atari games, improved value target does lead to significant performance gains, the only exception being Breakout, where value improvement does not immediately lead to performance gain. ",
|
| 935 |
+
"bbox": [
|
| 936 |
+
174,
|
| 937 |
+
602,
|
| 938 |
+
825,
|
| 939 |
+
728
|
| 940 |
+
],
|
| 941 |
+
"page_idx": 5
|
| 942 |
+
},
|
| 943 |
+
{
|
| 944 |
+
"type": "text",
|
| 945 |
+
"text": "5.4.2 LB-GD AND LB-DR $^ +$ GD VS HER ",
|
| 946 |
+
"text_level": 1,
|
| 947 |
+
"bbox": [
|
| 948 |
+
176,
|
| 949 |
+
753,
|
| 950 |
+
460,
|
| 951 |
+
768
|
| 952 |
+
],
|
| 953 |
+
"page_idx": 5
|
| 954 |
+
},
|
| 955 |
+
{
|
| 956 |
+
"type": "text",
|
| 957 |
+
"text": "Figure 3 compares lower bounding with goal distance return (lb-GD) and lower bounding with both goal distance and discounted return combined (l ${ \\mathsf { b } } { \\mathsf { - D R } } { \\mathsf { + G D } }$ ) against the much stronger HER baseline, on the goal conditioned episodic FetchEnv and Pioneer tasks. ",
|
| 958 |
+
"bbox": [
|
| 959 |
+
174,
|
| 960 |
+
784,
|
| 961 |
+
825,
|
| 962 |
+
825
|
| 963 |
+
],
|
| 964 |
+
"page_idx": 5
|
| 965 |
+
},
|
| 966 |
+
{
|
| 967 |
+
"type": "text",
|
| 968 |
+
"text": "It seems on the easier FetchEnv tasks, lower bounding isn’t able to outperform HER, but on the more challenging Pioneer Push and Reach tasks, lower bounding is able to achieve over $70 \\%$ more sample efficiency. It seems the more complex the task, the wider the margin of gain. ",
|
| 969 |
+
"bbox": [
|
| 970 |
+
176,
|
| 971 |
+
833,
|
| 972 |
+
825,
|
| 973 |
+
875
|
| 974 |
+
],
|
| 975 |
+
"page_idx": 5
|
| 976 |
+
},
|
| 977 |
+
{
|
| 978 |
+
"type": "text",
|
| 979 |
+
"text": "We also looked at the fraction of experience where the lower bounding goal return is higher than the Bellman target (see Appendix A.4). It quickly grows to $1 \\%$ and then slowly drops, matching the region where the new method outperforms the baselines in average return. ",
|
| 980 |
+
"bbox": [
|
| 981 |
+
176,
|
| 982 |
+
882,
|
| 983 |
+
823,
|
| 984 |
+
924
|
| 985 |
+
],
|
| 986 |
+
"page_idx": 5
|
| 987 |
+
},
|
| 988 |
+
{
|
| 989 |
+
"type": "image",
|
| 990 |
+
"img_path": "images/3d0c3c7f5670dcfae67a3748075c019052122026b3cbf92607ef40ad7353c2a2.jpg",
|
| 991 |
+
"image_caption": [
|
| 992 |
+
"Figure 2: Evaluated average return of value target lower bounding with discounted return (lb-DR) vs SAC or DDPG on Atari games and episodic FetchEnv tasks. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 993 |
+
],
|
| 994 |
+
"image_footnote": [],
|
| 995 |
+
"bbox": [
|
| 996 |
+
204,
|
| 997 |
+
228,
|
| 998 |
+
792,
|
| 999 |
+
736
|
| 1000 |
+
],
|
| 1001 |
+
"page_idx": 6
|
| 1002 |
+
},
|
| 1003 |
+
{
|
| 1004 |
+
"type": "image",
|
| 1005 |
+
"img_path": "images/3e194639fb65b9a9c280c478f8200e6dad66f73a1bc017fd3c478981f2064026.jpg",
|
| 1006 |
+
"image_caption": [
|
| 1007 |
+
"Figure 3: Value target lower bounding with goal distance return (lb-GD) and lb- $. { \\mathrm { D R } } { + } { \\mathrm { G D } }$ vs HER on episodic FetchEnv and Pioneer tasks. Solid curves are the mean across three seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1008 |
+
],
|
| 1009 |
+
"image_footnote": [],
|
| 1010 |
+
"bbox": [
|
| 1011 |
+
205,
|
| 1012 |
+
101,
|
| 1013 |
+
790,
|
| 1014 |
+
434
|
| 1015 |
+
],
|
| 1016 |
+
"page_idx": 7
|
| 1017 |
+
},
|
| 1018 |
+
{
|
| 1019 |
+
"type": "text",
|
| 1020 |
+
"text": "6 RELATED WORK ",
|
| 1021 |
+
"text_level": 1,
|
| 1022 |
+
"bbox": [
|
| 1023 |
+
176,
|
| 1024 |
+
526,
|
| 1025 |
+
344,
|
| 1026 |
+
542
|
| 1027 |
+
],
|
| 1028 |
+
"page_idx": 7
|
| 1029 |
+
},
|
| 1030 |
+
{
|
| 1031 |
+
"type": "text",
|
| 1032 |
+
"text": "Prior works (Fujita et al., 2020; Hoppe & Toussaint, 2020; He et al., 2016; Oh et al., 2018; Tang, 2020) employed several different ways of computing future returns and using that as a lower bound to improve value learning. It is quite easy to introduce biases and inefficiencies into the process and end up with a suboptimal or inefficient algorithm. Our work is the first to point out that one efficient way of doing it, namely value target lower bounding, converges to the optimal value in the tabular case. We are the first to point out that the theory works generally, even for stochastic environments. We list several possible ways of computing the lower bound from training experience, which are true lower bounds only for deterministic environments, and demonstrate the effectiveness of such lower bounds in illustrative examples and experiments on a variety of tasks. ",
|
| 1033 |
+
"bbox": [
|
| 1034 |
+
174,
|
| 1035 |
+
561,
|
| 1036 |
+
825,
|
| 1037 |
+
688
|
| 1038 |
+
],
|
| 1039 |
+
"page_idx": 7
|
| 1040 |
+
},
|
| 1041 |
+
{
|
| 1042 |
+
"type": "text",
|
| 1043 |
+
"text": "Fujita et al. (2020) used a method very similar to the lb- $\\mathrm { . D R + G D }$ variant, noted the limitation to deterministic tasks, and showed that value target lower bounding improved sample efficiency for a goal conditioned robotic grasping task. Hoppe & Toussaint (2020) similarly proposed to bound the value target using a simplified MDP with a subset of actions of the original MDP. Neither work gave any theoretical guarantee. ",
|
| 1044 |
+
"bbox": [
|
| 1045 |
+
174,
|
| 1046 |
+
694,
|
| 1047 |
+
825,
|
| 1048 |
+
763
|
| 1049 |
+
],
|
| 1050 |
+
"page_idx": 7
|
| 1051 |
+
},
|
| 1052 |
+
{
|
| 1053 |
+
"type": "text",
|
| 1054 |
+
"text": "He et al. (2016) used empirical return with bootstrap to improve value learning. They integrate the lower (and upper) bounds as constraints when optimizing the Q function. Their method is more difficult to use due to an additional loss and hyperparameters to tune, and is more expensive to compute than directly lower bounding the value target. Their method needs to evaluate the value function on all future time steps. This severely limits how many time steps it can look ahead when computing discounted return. They evaluated on Atari games, showing higher sample efficiency than DQN, but appears worse than value target lower bounding on Breakout, probably due to looking ahead only four time steps. The limitation to deterministic tasks wasn’t mentioned in the paper, (but is actually present due to the use of empirical return in computing the lower bound), and neither any convergence analysis. Appendix A.5 offers more discussions related to this method and n-step returns. ",
|
| 1055 |
+
"bbox": [
|
| 1056 |
+
174,
|
| 1057 |
+
770,
|
| 1058 |
+
825,
|
| 1059 |
+
924
|
| 1060 |
+
],
|
| 1061 |
+
"page_idx": 7
|
| 1062 |
+
},
|
| 1063 |
+
{
|
| 1064 |
+
"type": "text",
|
| 1065 |
+
"text": "Our work is subtly but importantly different from the prior works on lower bound Q learning or Self Imitation Learning (SIL) (Oh et al., 2018; Tang, 2020). SIL uses empirical return $R$ to lower bound the value function itself (instead of the valueloss during on-policy (AC or PPO) trainingfunction overestimates, the SIL value loss b $( L _ { v a l u e } ^ { s \\breve { i } } = \\textstyle { \\frac { 1 } { 2 } } | v ( s ) - \\operatorname* { m a x } ( \\bar { v } ( s ) , R ) | ^ { 2 } )$ n off policy value. When the valueg. Mixing the SIL loss with the loss from the baseline algorithms probably helped to correct the overestimation, but no theoretical guarantee was given. In evaluation, SIL was often compared to on-policy Actor Critic or PPO baselines, so it was not clear how much of the gain was due to lower bounding and how much due to off-policy value learning. In this work, we bound the Bellman value target (Equation 5), so overestimates are automatically corrected via Bellman updates, and convergence is guaranteed in the tabular case. We also use off-policy algorithms as baselines for a cleaner comparison. ",
|
| 1066 |
+
"bbox": [
|
| 1067 |
+
174,
|
| 1068 |
+
103,
|
| 1069 |
+
825,
|
| 1070 |
+
256
|
| 1071 |
+
],
|
| 1072 |
+
"page_idx": 8
|
| 1073 |
+
},
|
| 1074 |
+
{
|
| 1075 |
+
"type": "text",
|
| 1076 |
+
"text": "Kumar et al. (2020) (DisCor) also recognized that bootstrapped value targets can be inaccurate. It impacts learning adversely under function approximation, while we handle the general case. DisCor uses distribution correction to sample experience with accurate bootstrap targets more frequently. ",
|
| 1077 |
+
"bbox": [
|
| 1078 |
+
176,
|
| 1079 |
+
263,
|
| 1080 |
+
823,
|
| 1081 |
+
305
|
| 1082 |
+
],
|
| 1083 |
+
"page_idx": 8
|
| 1084 |
+
},
|
| 1085 |
+
{
|
| 1086 |
+
"type": "text",
|
| 1087 |
+
"text": "Interestingly, it is common practice to lower and upper bound the returns to the possible region, e.g. \nAndrychowicz et al. (2017) bounds value between $[ - \\frac { 1 } { 1 - \\gamma } , 0 ]$ . ",
|
| 1088 |
+
"bbox": [
|
| 1089 |
+
174,
|
| 1090 |
+
313,
|
| 1091 |
+
821,
|
| 1092 |
+
343
|
| 1093 |
+
],
|
| 1094 |
+
"page_idx": 8
|
| 1095 |
+
},
|
| 1096 |
+
{
|
| 1097 |
+
"type": "text",
|
| 1098 |
+
"text": "7 CONCLUSIONS ",
|
| 1099 |
+
"text_level": 1,
|
| 1100 |
+
"bbox": [
|
| 1101 |
+
176,
|
| 1102 |
+
362,
|
| 1103 |
+
328,
|
| 1104 |
+
377
|
| 1105 |
+
],
|
| 1106 |
+
"page_idx": 8
|
| 1107 |
+
},
|
| 1108 |
+
{
|
| 1109 |
+
"type": "text",
|
| 1110 |
+
"text": "In theory, value target lower bounding converges to the same optimal solution as the original Bellman value iteration. In practice, several ways of finding value lower bounds using empirical discounted return for deterministic episodic tasks are examined. ",
|
| 1111 |
+
"bbox": [
|
| 1112 |
+
174,
|
| 1113 |
+
393,
|
| 1114 |
+
825,
|
| 1115 |
+
435
|
| 1116 |
+
],
|
| 1117 |
+
"page_idx": 8
|
| 1118 |
+
},
|
| 1119 |
+
{
|
| 1120 |
+
"type": "text",
|
| 1121 |
+
"text": "Precomputing discounted future return and storing into the replay buffer allows efficient lower bound computation, and can achieve much higher sample efficiency than baselines such as SAC, DDPG or TD3 in most tasks. The Appendix A.5 also includes comparisons against related methods such as td-lambda and Retrace. ",
|
| 1122 |
+
"bbox": [
|
| 1123 |
+
174,
|
| 1124 |
+
443,
|
| 1125 |
+
825,
|
| 1126 |
+
498
|
| 1127 |
+
],
|
| 1128 |
+
"page_idx": 8
|
| 1129 |
+
},
|
| 1130 |
+
{
|
| 1131 |
+
"type": "text",
|
| 1132 |
+
"text": "Simple goal distance based return, requiring little extra space or compute, achieves large gains in certain long horizon tasks over HER, and performs similarly as HER in the simpler tasks. ",
|
| 1133 |
+
"bbox": [
|
| 1134 |
+
174,
|
| 1135 |
+
506,
|
| 1136 |
+
823,
|
| 1137 |
+
535
|
| 1138 |
+
],
|
| 1139 |
+
"page_idx": 8
|
| 1140 |
+
},
|
| 1141 |
+
{
|
| 1142 |
+
"type": "text",
|
| 1143 |
+
"text": "7.1 FUTURE WORK ",
|
| 1144 |
+
"text_level": 1,
|
| 1145 |
+
"bbox": [
|
| 1146 |
+
176,
|
| 1147 |
+
551,
|
| 1148 |
+
321,
|
| 1149 |
+
566
|
| 1150 |
+
],
|
| 1151 |
+
"page_idx": 8
|
| 1152 |
+
},
|
| 1153 |
+
{
|
| 1154 |
+
"type": "text",
|
| 1155 |
+
"text": "There are probably better ways of finding value lower bounds that speed up training even more. There may be ways of using bootstrapped value in computing the lower bound, for n-step return targets or for non-episodic tasks. ",
|
| 1156 |
+
"bbox": [
|
| 1157 |
+
176,
|
| 1158 |
+
578,
|
| 1159 |
+
821,
|
| 1160 |
+
621
|
| 1161 |
+
],
|
| 1162 |
+
"page_idx": 8
|
| 1163 |
+
},
|
| 1164 |
+
{
|
| 1165 |
+
"type": "text",
|
| 1166 |
+
"text": "Estimating value lower bound for environments with stochastic transitions or rewards may be possible, e.g. by learning a reward function to help average out the randomness in the empirical return. Extending to partially observable environments would be harder but probably still doable. ",
|
| 1167 |
+
"bbox": [
|
| 1168 |
+
176,
|
| 1169 |
+
627,
|
| 1170 |
+
820,
|
| 1171 |
+
670
|
| 1172 |
+
],
|
| 1173 |
+
"page_idx": 8
|
| 1174 |
+
},
|
| 1175 |
+
{
|
| 1176 |
+
"type": "text",
|
| 1177 |
+
"text": "Other ways of bounding the value target, e.g. upper bounding, may be worth investigating as well, e.g. to reduce overestimation in regions of poor reward. ",
|
| 1178 |
+
"bbox": [
|
| 1179 |
+
173,
|
| 1180 |
+
676,
|
| 1181 |
+
821,
|
| 1182 |
+
705
|
| 1183 |
+
],
|
| 1184 |
+
"page_idx": 8
|
| 1185 |
+
},
|
| 1186 |
+
{
|
| 1187 |
+
"type": "text",
|
| 1188 |
+
"text": "REPRODUCIBILITY STATEMENT ",
|
| 1189 |
+
"text_level": 1,
|
| 1190 |
+
"bbox": [
|
| 1191 |
+
176,
|
| 1192 |
+
724,
|
| 1193 |
+
392,
|
| 1194 |
+
737
|
| 1195 |
+
],
|
| 1196 |
+
"page_idx": 8
|
| 1197 |
+
},
|
| 1198 |
+
{
|
| 1199 |
+
"type": "text",
|
| 1200 |
+
"text": "Our code change is based on a publicly available RL library, with strong baselines already implemented. Our relatively small code change is committed to a private github repository, which we plan to open source upon publication. When running experiments, the snapshot of the code used to run each experiment is stored together with the results. Experiment parameters are gin-configured and controlled by our automation script, with each experiment label corresponding to the set of configurations used for that experiment, so there is little room for manual error when running many experiments across different tasks, methods and hyperparameters. ",
|
| 1201 |
+
"bbox": [
|
| 1202 |
+
174,
|
| 1203 |
+
750,
|
| 1204 |
+
825,
|
| 1205 |
+
847
|
| 1206 |
+
],
|
| 1207 |
+
"page_idx": 8
|
| 1208 |
+
},
|
| 1209 |
+
{
|
| 1210 |
+
"type": "text",
|
| 1211 |
+
"text": "Experiments are done in simulation with pseudo randomness. We’ve run our code on different machines with different GPU hardware using the same docker image, and the results are reproducible up to every float number using the same random seed. In a few cases, we’ve also run our code on different hardware and software (CUDA and pytorch), and the results are similar though not the same at the float number level. ",
|
| 1212 |
+
"bbox": [
|
| 1213 |
+
176,
|
| 1214 |
+
854,
|
| 1215 |
+
823,
|
| 1216 |
+
922
|
| 1217 |
+
],
|
| 1218 |
+
"page_idx": 8
|
| 1219 |
+
},
|
| 1220 |
+
{
|
| 1221 |
+
"type": "text",
|
| 1222 |
+
"text": "REFERENCES ",
|
| 1223 |
+
"text_level": 1,
|
| 1224 |
+
"bbox": [
|
| 1225 |
+
176,
|
| 1226 |
+
102,
|
| 1227 |
+
287,
|
| 1228 |
+
117
|
| 1229 |
+
],
|
| 1230 |
+
"page_idx": 9
|
| 1231 |
+
},
|
| 1232 |
+
{
|
| 1233 |
+
"type": "text",
|
| 1234 |
+
"text": "Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems, volume 30, 2017. ",
|
| 1235 |
+
"bbox": [
|
| 1236 |
+
174,
|
| 1237 |
+
127,
|
| 1238 |
+
821,
|
| 1239 |
+
170
|
| 1240 |
+
],
|
| 1241 |
+
"page_idx": 9
|
| 1242 |
+
},
|
| 1243 |
+
{
|
| 1244 |
+
"type": "text",
|
| 1245 |
+
"text": "Eric V. Denardo. Contraction mappings in the theory underlying dynamic programming. SIAM Review, 9(2):165–177, 1967. ISSN 00361445. URL http://www.jstor.org/stable/ 2027440. ",
|
| 1246 |
+
"bbox": [
|
| 1247 |
+
173,
|
| 1248 |
+
183,
|
| 1249 |
+
826,
|
| 1250 |
+
224
|
| 1251 |
+
],
|
| 1252 |
+
"page_idx": 9
|
| 1253 |
+
},
|
| 1254 |
+
{
|
| 1255 |
+
"type": "text",
|
| 1256 |
+
"text": "Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. CoRR, 2018. URL http://arxiv.org/abs/1802.09477. ",
|
| 1257 |
+
"bbox": [
|
| 1258 |
+
173,
|
| 1259 |
+
237,
|
| 1260 |
+
825,
|
| 1261 |
+
267
|
| 1262 |
+
],
|
| 1263 |
+
"page_idx": 9
|
| 1264 |
+
},
|
| 1265 |
+
{
|
| 1266 |
+
"type": "text",
|
| 1267 |
+
"text": "Yasuhiro Fujita, Kota Uenishi, Avinash Ummadisingu, Prabhat Nagarajan, Shimpei Masuda, and Mario Ynocente Castro. Distributed reinforcement learning of targeted grasping with active vision for mobile manipulators, 2020. ",
|
| 1268 |
+
"bbox": [
|
| 1269 |
+
176,
|
| 1270 |
+
279,
|
| 1271 |
+
823,
|
| 1272 |
+
321
|
| 1273 |
+
],
|
| 1274 |
+
"page_idx": 9
|
| 1275 |
+
},
|
| 1276 |
+
{
|
| 1277 |
+
"type": "text",
|
| 1278 |
+
"text": "Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor, 2018. ",
|
| 1279 |
+
"bbox": [
|
| 1280 |
+
176,
|
| 1281 |
+
334,
|
| 1282 |
+
821,
|
| 1283 |
+
363
|
| 1284 |
+
],
|
| 1285 |
+
"page_idx": 9
|
| 1286 |
+
},
|
| 1287 |
+
{
|
| 1288 |
+
"type": "text",
|
| 1289 |
+
"text": "Frank S. He, Yang Liu, Alexander G. Schwing, and Jian Peng. Learning to play in a day: Faster deep reinforcement learning by optimality tightening, 2016. ",
|
| 1290 |
+
"bbox": [
|
| 1291 |
+
169,
|
| 1292 |
+
376,
|
| 1293 |
+
823,
|
| 1294 |
+
405
|
| 1295 |
+
],
|
| 1296 |
+
"page_idx": 9
|
| 1297 |
+
},
|
| 1298 |
+
{
|
| 1299 |
+
"type": "text",
|
| 1300 |
+
"text": "Sabrina Hoppe and Marc Toussaint. Qgraph-bounded q-learning: Stabilizing model-free off-policy deep reinforcement learning, 2020. ",
|
| 1301 |
+
"bbox": [
|
| 1302 |
+
173,
|
| 1303 |
+
417,
|
| 1304 |
+
823,
|
| 1305 |
+
445
|
| 1306 |
+
],
|
| 1307 |
+
"page_idx": 9
|
| 1308 |
+
},
|
| 1309 |
+
{
|
| 1310 |
+
"type": "text",
|
| 1311 |
+
"text": "Aviral Kumar, Abhishek Gupta, and Sergey Levine. Discor: Corrective feedback in reinforcement learning via distribution correction. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 18560–18572. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/d7f426ccbc6db7e235c57958c21c5dfa-Paper.pdf. ",
|
| 1312 |
+
"bbox": [
|
| 1313 |
+
174,
|
| 1314 |
+
458,
|
| 1315 |
+
823,
|
| 1316 |
+
530
|
| 1317 |
+
],
|
| 1318 |
+
"page_idx": 9
|
| 1319 |
+
},
|
| 1320 |
+
{
|
| 1321 |
+
"type": "text",
|
| 1322 |
+
"text": "Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. ",
|
| 1323 |
+
"bbox": [
|
| 1324 |
+
174,
|
| 1325 |
+
541,
|
| 1326 |
+
823,
|
| 1327 |
+
584
|
| 1328 |
+
],
|
| 1329 |
+
"page_idx": 9
|
| 1330 |
+
},
|
| 1331 |
+
{
|
| 1332 |
+
"type": "text",
|
| 1333 |
+
"text": "Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. CoRR, abs/1312.5602, 2013. URL http://arxiv.org/abs/1312.5602. ",
|
| 1334 |
+
"bbox": [
|
| 1335 |
+
174,
|
| 1336 |
+
597,
|
| 1337 |
+
825,
|
| 1338 |
+
640
|
| 1339 |
+
],
|
| 1340 |
+
"page_idx": 9
|
| 1341 |
+
},
|
| 1342 |
+
{
|
| 1343 |
+
"type": "text",
|
| 1344 |
+
"text": "Remi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient off- ´ policy reinforcement learning, 2016. ",
|
| 1345 |
+
"bbox": [
|
| 1346 |
+
171,
|
| 1347 |
+
652,
|
| 1348 |
+
823,
|
| 1349 |
+
681
|
| 1350 |
+
],
|
| 1351 |
+
"page_idx": 9
|
| 1352 |
+
},
|
| 1353 |
+
{
|
| 1354 |
+
"type": "text",
|
| 1355 |
+
"text": "Junhyuk Oh, Yijie Guo, Satinder Singh, and Honglak Lee. Self-imitation learning. CoRR, abs/1806.05635, 2018. URL http://arxiv.org/abs/1806.05635. ",
|
| 1356 |
+
"bbox": [
|
| 1357 |
+
173,
|
| 1358 |
+
694,
|
| 1359 |
+
823,
|
| 1360 |
+
723
|
| 1361 |
+
],
|
| 1362 |
+
"page_idx": 9
|
| 1363 |
+
},
|
| 1364 |
+
{
|
| 1365 |
+
"type": "text",
|
| 1366 |
+
"text": "Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, Vikash Kumar, and Wojciech Zaremba. Multi-goal reinforcement learning: Challenging robotics environments and request for research. CoRR, abs/1802.09464, 2018. URL http://arxiv.org/abs/1802.09464. ",
|
| 1367 |
+
"bbox": [
|
| 1368 |
+
173,
|
| 1369 |
+
734,
|
| 1370 |
+
825,
|
| 1371 |
+
792
|
| 1372 |
+
],
|
| 1373 |
+
"page_idx": 9
|
| 1374 |
+
},
|
| 1375 |
+
{
|
| 1376 |
+
"type": "text",
|
| 1377 |
+
"text": "Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018. ISBN 0262039249. ",
|
| 1378 |
+
"bbox": [
|
| 1379 |
+
169,
|
| 1380 |
+
804,
|
| 1381 |
+
825,
|
| 1382 |
+
833
|
| 1383 |
+
],
|
| 1384 |
+
"page_idx": 9
|
| 1385 |
+
},
|
| 1386 |
+
{
|
| 1387 |
+
"type": "text",
|
| 1388 |
+
"text": "Yunhao Tang. Self-imitation learning via generalized lower bound q-learning. CoRR, abs/2006.07442, 2020. URL https://arxiv.org/abs/2006.07442. ",
|
| 1389 |
+
"bbox": [
|
| 1390 |
+
173,
|
| 1391 |
+
847,
|
| 1392 |
+
823,
|
| 1393 |
+
875
|
| 1394 |
+
],
|
| 1395 |
+
"page_idx": 9
|
| 1396 |
+
},
|
| 1397 |
+
{
|
| 1398 |
+
"type": "text",
|
| 1399 |
+
"text": "Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. CoRR, abs/1509.06461, 2015. URL http://arxiv.org/abs/1509.06461. ",
|
| 1400 |
+
"bbox": [
|
| 1401 |
+
173,
|
| 1402 |
+
887,
|
| 1403 |
+
823,
|
| 1404 |
+
916
|
| 1405 |
+
],
|
| 1406 |
+
"page_idx": 9
|
| 1407 |
+
},
|
| 1408 |
+
{
|
| 1409 |
+
"type": "text",
|
| 1410 |
+
"text": "A APPENDIX ",
|
| 1411 |
+
"text_level": 1,
|
| 1412 |
+
"bbox": [
|
| 1413 |
+
176,
|
| 1414 |
+
102,
|
| 1415 |
+
299,
|
| 1416 |
+
118
|
| 1417 |
+
],
|
| 1418 |
+
"page_idx": 10
|
| 1419 |
+
},
|
| 1420 |
+
{
|
| 1421 |
+
"type": "text",
|
| 1422 |
+
"text": "A.1 PROOF OF THEOREM 1 ",
|
| 1423 |
+
"text_level": 1,
|
| 1424 |
+
"bbox": [
|
| 1425 |
+
176,
|
| 1426 |
+
132,
|
| 1427 |
+
375,
|
| 1428 |
+
147
|
| 1429 |
+
],
|
| 1430 |
+
"page_idx": 10
|
| 1431 |
+
},
|
| 1432 |
+
{
|
| 1433 |
+
"type": "text",
|
| 1434 |
+
"text": "We want to prove that under the new operator $\\mathcal { M } _ { f } \\circ B$ , the value function converges to the same optimal value function given by the Bellman operator $\\boldsymbol { B }$ . ",
|
| 1435 |
+
"bbox": [
|
| 1436 |
+
173,
|
| 1437 |
+
159,
|
| 1438 |
+
823,
|
| 1439 |
+
188
|
| 1440 |
+
],
|
| 1441 |
+
"page_idx": 10
|
| 1442 |
+
},
|
| 1443 |
+
{
|
| 1444 |
+
"type": "text",
|
| 1445 |
+
"text": "Proof. Let $v ^ { * }$ be the fixed point and optimal value of the original Bellman operator: $v ^ { * } : = B ^ { \\infty } ( v )$ , $v _ { 1 }$ be any value function, and $s$ any state, ",
|
| 1446 |
+
"bbox": [
|
| 1447 |
+
169,
|
| 1448 |
+
202,
|
| 1449 |
+
825,
|
| 1450 |
+
232
|
| 1451 |
+
],
|
| 1452 |
+
"page_idx": 10
|
| 1453 |
+
},
|
| 1454 |
+
{
|
| 1455 |
+
"type": "equation",
|
| 1456 |
+
"img_path": "images/06832b8afebcf4d3217fddcabb5fab23c5861540e2616eade97683757214b2bb.jpg",
|
| 1457 |
+
"text": "$$\n{ \\begin{array} { r l } & { \\ | { \\mathcal { M } } _ { f } \\circ { \\mathcal { B } } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\\\ & { = | \\operatorname* { m a x } ( { \\mathcal { B } } ( v _ { 1 } ) ( s ) , f ( s ) ) - v ^ { * } ( s ) | } \\\\ & { \\ { \\mathrm { ~ } } ^ { { \\forall } s { \\mathrm { ~ w h e r e ~ } } f ( s ) > { \\mathcal { B } } ( v _ { 1 } ) ( s ) : } } \\\\ & { { \\mathrm { ~ a b o v e ~ } } = | f ( s ) - v ^ { * } ( s ) | = v ^ { * } ( s ) - f ( s ) < v ^ { * } ( s ) - { \\mathcal { B } } ( v _ { 1 } ) ( s ) = | { \\mathcal { B } } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\end{array} }\n$$",
|
| 1458 |
+
"text_format": "latex",
|
| 1459 |
+
"bbox": [
|
| 1460 |
+
209,
|
| 1461 |
+
233,
|
| 1462 |
+
784,
|
| 1463 |
+
309
|
| 1464 |
+
],
|
| 1465 |
+
"page_idx": 10
|
| 1466 |
+
},
|
| 1467 |
+
{
|
| 1468 |
+
"type": "equation",
|
| 1469 |
+
"img_path": "images/58a569cac18ff08e3b4102b87ea09d106407c7c47f6aa3aa915a79da67820524.jpg",
|
| 1470 |
+
"text": "$$\n\\begin{array} { r l } & { \\mathrm { ~ a b o v e = } | \\mathcal { B } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\\\ & { { \\le } | \\mathcal { B } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) | } \\\\ & { { = } | \\mathcal { B } ( v _ { 1 } ) ( s ) - \\mathcal { B } ( v ^ { * } ) ( s ) | } \\\\ & { { \\le } \\gamma | | v _ { 1 } - v ^ { * } | | _ { \\infty } } \\end{array}\n$$",
|
| 1471 |
+
"text_format": "latex",
|
| 1472 |
+
"bbox": [
|
| 1473 |
+
214,
|
| 1474 |
+
359,
|
| 1475 |
+
421,
|
| 1476 |
+
430
|
| 1477 |
+
],
|
| 1478 |
+
"page_idx": 10
|
| 1479 |
+
},
|
| 1480 |
+
{
|
| 1481 |
+
"type": "text",
|
| 1482 |
+
"text": "The last line above is because the Bellman operator $\\boldsymbol { B }$ contracts at rate $\\gamma$ . ",
|
| 1483 |
+
"bbox": [
|
| 1484 |
+
174,
|
| 1485 |
+
441,
|
| 1486 |
+
651,
|
| 1487 |
+
457
|
| 1488 |
+
],
|
| 1489 |
+
"page_idx": 10
|
| 1490 |
+
},
|
| 1491 |
+
{
|
| 1492 |
+
"type": "equation",
|
| 1493 |
+
"img_path": "images/c8e216ddbd497c6b240771bdcf23a3ba44784d1f402512ff01195888f62ab915.jpg",
|
| 1494 |
+
"text": "$$\n\\begin{array} { r } { \\vert \\vert \\mathcal { M } _ { f } \\circ \\mathcal { B } ( v _ { 1 } ) - v ^ { * } \\vert \\vert _ { \\infty } = \\operatorname* { m a x } _ { s } \\vert \\mathcal { M } _ { f } \\circ \\mathcal { B } ( v _ { 1 } ) ( s ) - v ^ { * } ( s ) \\vert \\leq \\gamma \\vert \\vert v _ { 1 } - v ^ { * } \\vert \\vert _ { \\infty } . } \\end{array}\n$$",
|
| 1495 |
+
"text_format": "latex",
|
| 1496 |
+
"bbox": [
|
| 1497 |
+
222,
|
| 1498 |
+
462,
|
| 1499 |
+
723,
|
| 1500 |
+
479
|
| 1501 |
+
],
|
| 1502 |
+
"page_idx": 10
|
| 1503 |
+
},
|
| 1504 |
+
{
|
| 1505 |
+
"type": "text",
|
| 1506 |
+
"text": "According to the definition of convergence to $v ^ { * }$ , we need to find an $N$ , such that $\\forall \\epsilon > 0 , \\forall v _ { 1 } \\neq v ^ { * }$ , $\\forall n > N , \\bar { | } | ( \\mathcal { M } _ { f } \\circ \\mathcal { B } ) ^ { n } ( v _ { 1 } ) - v ^ { * } | | _ { \\infty } \\bar { < } \\epsilon .$ . ",
|
| 1507 |
+
"bbox": [
|
| 1508 |
+
176,
|
| 1509 |
+
484,
|
| 1510 |
+
823,
|
| 1511 |
+
513
|
| 1512 |
+
],
|
| 1513 |
+
"page_idx": 10
|
| 1514 |
+
},
|
| 1515 |
+
{
|
| 1516 |
+
"type": "text",
|
| 1517 |
+
"text": "We can easily calculate that N = logγ \u000f||v1−v∗|| (note, $\\gamma \\ < \\ 1 $ ) satisfies the condition, which concludes the proof that any value function $v _ { 1 }$ will converge to $v ^ { * }$ under the lower bounded Bellman operator $\\mathcal { M } _ { f } \\circ B$ . ",
|
| 1518 |
+
"bbox": [
|
| 1519 |
+
174,
|
| 1520 |
+
518,
|
| 1521 |
+
825,
|
| 1522 |
+
565
|
| 1523 |
+
],
|
| 1524 |
+
"page_idx": 10
|
| 1525 |
+
},
|
| 1526 |
+
{
|
| 1527 |
+
"type": "text",
|
| 1528 |
+
"text": "This proof works for action values as well, by simply replacing the value function above $v ( s )$ with the action value $\\boldsymbol { q } ( s , a )$ , and the value lower bound $f ( s )$ with the action value lower bound $\\dot { f } ( s , a )$ . ",
|
| 1529 |
+
"bbox": [
|
| 1530 |
+
174,
|
| 1531 |
+
601,
|
| 1532 |
+
825,
|
| 1533 |
+
630
|
| 1534 |
+
],
|
| 1535 |
+
"page_idx": 10
|
| 1536 |
+
},
|
| 1537 |
+
{
|
| 1538 |
+
"type": "text",
|
| 1539 |
+
"text": "A.2 AN ILLUSTRATIVE EXAMPLE ",
|
| 1540 |
+
"text_level": 1,
|
| 1541 |
+
"bbox": [
|
| 1542 |
+
176,
|
| 1543 |
+
646,
|
| 1544 |
+
419,
|
| 1545 |
+
660
|
| 1546 |
+
],
|
| 1547 |
+
"page_idx": 10
|
| 1548 |
+
},
|
| 1549 |
+
{
|
| 1550 |
+
"type": "text",
|
| 1551 |
+
"text": "Figure 4 includes a fairly general example showing how value target lower bounding would improve value learning. Suppose we enhance an off policy algorithm such as DDPG with value target lower bounding (lb-DR), when there is no training experience hitting the target state, no meaningful training happens for the baseline or lb-DR. However, when there is one trajectory hitting the target state, all states along the trajectory will soon be propagated with meaningful return, and nearby states will also enjoy faster learning. As the state space becomes larger and the time horizon longer, a successful trajectory will likely speed up learning quite a bit. ",
|
| 1552 |
+
"bbox": [
|
| 1553 |
+
173,
|
| 1554 |
+
671,
|
| 1555 |
+
825,
|
| 1556 |
+
770
|
| 1557 |
+
],
|
| 1558 |
+
"page_idx": 10
|
| 1559 |
+
},
|
| 1560 |
+
{
|
| 1561 |
+
"type": "text",
|
| 1562 |
+
"text": "A.3 HYPERPARAMETERS ",
|
| 1563 |
+
"text_level": 1,
|
| 1564 |
+
"bbox": [
|
| 1565 |
+
176,
|
| 1566 |
+
786,
|
| 1567 |
+
361,
|
| 1568 |
+
800
|
| 1569 |
+
],
|
| 1570 |
+
"page_idx": 10
|
| 1571 |
+
},
|
| 1572 |
+
{
|
| 1573 |
+
"type": "text",
|
| 1574 |
+
"text": "Hyperparameters of the baseline algorithms follow published work in the case of FetchEnv (Plappert et al., 2018). For Atari and Pioneer Push and Reach tasks, they are tuned using one set of random seeds and after keeping the hyperparameters fixed, trained with a different set of random seeds and evaluated. We avoided tuning of the parameters of the baseline method for value target lower bounding, except for the Atari games where value target lower bounding learned a bit faster with slightly more frequent training updates (8 updates of 250 transitions per training iteration) than the baseline (4 updates of 500 transitions) and without reward clipping. For Atari Atlantis, Frostbite and Q\\*bert, we report results with reward clipping as it did not affect performance much. ",
|
| 1575 |
+
"bbox": [
|
| 1576 |
+
174,
|
| 1577 |
+
811,
|
| 1578 |
+
825,
|
| 1579 |
+
924
|
| 1580 |
+
],
|
| 1581 |
+
"page_idx": 10
|
| 1582 |
+
},
|
| 1583 |
+
{
|
| 1584 |
+
"type": "image",
|
| 1585 |
+
"img_path": "images/e6cf09d72c98f81d2f81e4db317a6356d32e48c2409263a08d44ccace71d1c17.jpg",
|
| 1586 |
+
"image_caption": [
|
| 1587 |
+
"Figure 4: Illustration of value target lower bounding speeding up value learning as training progresses from stages 0 to 3. The task is to navigate in the state space from start state S to end state T, with sparse reward 1 at $\\mathrm { T }$ and 0 elsewhere. The curve from S to $\\mathrm { T }$ denotes a training experience that reaches the target. The shaded areas denote roughly states whose value has been significantly improved during training up to that stage. "
|
| 1588 |
+
],
|
| 1589 |
+
"image_footnote": [],
|
| 1590 |
+
"bbox": [
|
| 1591 |
+
205,
|
| 1592 |
+
99,
|
| 1593 |
+
794,
|
| 1594 |
+
268
|
| 1595 |
+
],
|
| 1596 |
+
"page_idx": 11
|
| 1597 |
+
},
|
| 1598 |
+
{
|
| 1599 |
+
"type": "text",
|
| 1600 |
+
"text": "Baseline parameters reported below are tuned using development random seeds and fixed during evaluation with a separate set of random seeds. ",
|
| 1601 |
+
"bbox": [
|
| 1602 |
+
174,
|
| 1603 |
+
390,
|
| 1604 |
+
823,
|
| 1605 |
+
417
|
| 1606 |
+
],
|
| 1607 |
+
"page_idx": 11
|
| 1608 |
+
},
|
| 1609 |
+
{
|
| 1610 |
+
"type": "text",
|
| 1611 |
+
"text": "For the Atari games, DQN with only one training environment takes too long to train so we instead use SAC as baseline. There are no strong reported results, so we tuned the hyperparameters a bit and found it to outperform published Actor-Critic results on Atari Breakout (Oh et al., 2018). We use 30 environments, unrolling 8 time steps every training iteration, with each iteration containing 4 updates each with a minibatch of 500 transitions sampled from the 1 million time step replay buffer. 500 time steps are collected before training starts. Target networks are updated every 20 training updates. Discount $\\gamma = 0 . 9 9$ . The SAC target entropy is set to the entropy of uniformly distributing 0.1 probability mass across all but one actions. Actions are repeated deterministically for 4 frames (even for Space Invaders, despite 3 being used by Mnih et al. (2013)), and the latest 4 frames are stacked and rescaled to [-1, 1] to form the $8 4 \\mathrm { x } 8 4 \\mathrm { x } 4$ input tensor. Rewards are clipped between -1 and 1. Network structures are the same as Double DQN (van Hasselt et al., 2015) with 3 convolution layers, with input layer 32 filters of size 8 stride 4, then 64 filters of size 4 stride 2 and 64 filters with size 3 stride 1, 1 fully connected of size 512 before output. We train for 12 million steps (48 million frames) for each task (except for Atlantis where episodes are very long and we only train for 6 million steps) and evaluate every 1000 iterations averaging across 100 episodes using $\\epsilon$ -greedy policy with $5 \\%$ random actions. ",
|
| 1612 |
+
"bbox": [
|
| 1613 |
+
173,
|
| 1614 |
+
425,
|
| 1615 |
+
825,
|
| 1616 |
+
647
|
| 1617 |
+
],
|
| 1618 |
+
"page_idx": 11
|
| 1619 |
+
},
|
| 1620 |
+
{
|
| 1621 |
+
"type": "text",
|
| 1622 |
+
"text": "For FetchEnv tasks, DDPG and HER learn faster than their TD3 variants and are reported here. Hyperparameters are the same as used by Plappert et al. (2018), with 38 parallel environments unrolling 50 time steps per train iteration, training 40 updates per iteration, targets are updated once every 40 updates. For each update, a minibatch of 5000 transitions are sampled from the replay buffer of size 2 million. Discount $\\gamma = 0 . 9 8$ . Actions are $\\epsilon$ -greedy with $30 \\%$ random actions. $80 \\%$ hindsight experience. Observations are normalized to have zero mean and unit variance based on the statistics of the recent observations.3 Networks are 3 fully connected layers of size 256. Length of the episodes are capped at 50. We train for 2 million frames and evaluate every 40 iterations averaging across 200 episodes. ",
|
| 1623 |
+
"bbox": [
|
| 1624 |
+
174,
|
| 1625 |
+
654,
|
| 1626 |
+
825,
|
| 1627 |
+
780
|
| 1628 |
+
],
|
| 1629 |
+
"page_idx": 11
|
| 1630 |
+
},
|
| 1631 |
+
{
|
| 1632 |
+
"type": "text",
|
| 1633 |
+
"text": "For Pioneer Push and Reach tasks, TD3 is used, (we simply equip DDPG with two critics for clipped double Q learning(Fujimoto et al., 2018)), which works better than DDPG with one critic. Parameters are mostly the same as in FetchEnv, except for using 30 parallel environments, 100 steps of unroll per training iteration, 6 million time step replay buffer, $50 \\%$ hindsight experience, discount $\\gamma = 0 . 9 9$ and not using observation normalization. Length of the episodes are capped at 100 for Push and 200 for Push and Reach. We train for 5 million frames for Push and 14 million for PushReach and evaluate every 200 iterations averaging across 100 episodes. ",
|
| 1634 |
+
"bbox": [
|
| 1635 |
+
174,
|
| 1636 |
+
786,
|
| 1637 |
+
825,
|
| 1638 |
+
883
|
| 1639 |
+
],
|
| 1640 |
+
"page_idx": 11
|
| 1641 |
+
},
|
| 1642 |
+
{
|
| 1643 |
+
"type": "text",
|
| 1644 |
+
"text": "For FetchEnv and Pioneer tasks, the target networks are updated every 40 train updates softly, with weight 0.95 on the existing target network parameters and 0.05 on the incoming. ",
|
| 1645 |
+
"bbox": [
|
| 1646 |
+
173,
|
| 1647 |
+
103,
|
| 1648 |
+
823,
|
| 1649 |
+
132
|
| 1650 |
+
],
|
| 1651 |
+
"page_idx": 12
|
| 1652 |
+
},
|
| 1653 |
+
{
|
| 1654 |
+
"type": "text",
|
| 1655 |
+
"text": "We use Adam optimizer with learning rate $5 e ^ { - 4 }$ for the Atari games and $1 e ^ { - 3 }$ for all others, and $\\hat { \\epsilon } = 1 e ^ { - 7 }$ for all tasks. ",
|
| 1656 |
+
"bbox": [
|
| 1657 |
+
173,
|
| 1658 |
+
138,
|
| 1659 |
+
823,
|
| 1660 |
+
166
|
| 1661 |
+
],
|
| 1662 |
+
"page_idx": 12
|
| 1663 |
+
},
|
| 1664 |
+
{
|
| 1665 |
+
"type": "image",
|
| 1666 |
+
"img_path": "images/3f98b10e56d4b2d7fda0970a5a2109488a76a28c3a1ff6e6f1425c644314ffc6.jpg",
|
| 1667 |
+
"image_caption": [
|
| 1668 |
+
"A.4 PLOTS ",
|
| 1669 |
+
"Figure 5: Fraction of training experience where lb-DR value target is greater than the Bellman target, on Atari games and episodic FetchEnv tasks, plotted against the number of training iterations. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1670 |
+
],
|
| 1671 |
+
"image_footnote": [],
|
| 1672 |
+
"bbox": [
|
| 1673 |
+
202,
|
| 1674 |
+
210,
|
| 1675 |
+
792,
|
| 1676 |
+
714
|
| 1677 |
+
],
|
| 1678 |
+
"page_idx": 12
|
| 1679 |
+
},
|
| 1680 |
+
{
|
| 1681 |
+
"type": "text",
|
| 1682 |
+
"text": "Figure 5 shows the fraction of training experience where lb-DR value target is greater than the Bellman target from SAC/DDPG. They correlate well with actual performance (Figure 2) and with how value is learning (Figure 6). For Atari Breakout the converged value is much higher than that of the baseline. It is unlike an overestimation, and is actually close to the average discounted return that we also summarized in tensorboard (omitted here).4 The baseline value of 2 is actually very far away from its average discounted return of 25, even though its policy is already getting a reward of ",
|
| 1683 |
+
"bbox": [
|
| 1684 |
+
173,
|
| 1685 |
+
801,
|
| 1686 |
+
825,
|
| 1687 |
+
886
|
| 1688 |
+
],
|
| 1689 |
+
"page_idx": 12
|
| 1690 |
+
},
|
| 1691 |
+
{
|
| 1692 |
+
"type": "text",
|
| 1693 |
+
"text": "200 per episode. This is likely due to the inaccurate bootstrap values of the baseline method, and will probably take much longer to converge. ",
|
| 1694 |
+
"bbox": [
|
| 1695 |
+
174,
|
| 1696 |
+
103,
|
| 1697 |
+
825,
|
| 1698 |
+
133
|
| 1699 |
+
],
|
| 1700 |
+
"page_idx": 13
|
| 1701 |
+
},
|
| 1702 |
+
{
|
| 1703 |
+
"type": "image",
|
| 1704 |
+
"img_path": "images/02efcc3ab8bcee7eca48583a898b2bb238790290d0375420e111c514deb48f7b.jpg",
|
| 1705 |
+
"image_caption": [
|
| 1706 |
+
"Figure 6: Learned values of lb-DR and SAC (for Atari games) and DDPG (for FetchEnv tasks), evaluated on the training experience and plotted against the number of training iterations. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1707 |
+
],
|
| 1708 |
+
"image_footnote": [],
|
| 1709 |
+
"bbox": [
|
| 1710 |
+
202,
|
| 1711 |
+
172,
|
| 1712 |
+
792,
|
| 1713 |
+
690
|
| 1714 |
+
],
|
| 1715 |
+
"page_idx": 13
|
| 1716 |
+
},
|
| 1717 |
+
{
|
| 1718 |
+
"type": "text",
|
| 1719 |
+
"text": "Figure 7 shows the fraction of training experience where the lb-GD is higher than the Bellman value target from HER, in the goal conditioned (episodic FetchEnv and Pioneer) tasks. It seems, for FetchEnv tasks, where lb-GD only performs slightly better than HER, the fraction of experience with improved value target is quite small (less than $1 \\%$ ). Hindsight relabeling is probably already producing fairly high value targets. For Pioneer Push and Reach tasks, lb-GD performs much better in average return, and the fraction of experience with higher value target is also much larger (peaking around $2 \\%$ ). ",
|
| 1720 |
+
"bbox": [
|
| 1721 |
+
173,
|
| 1722 |
+
804,
|
| 1723 |
+
825,
|
| 1724 |
+
901
|
| 1725 |
+
],
|
| 1726 |
+
"page_idx": 13
|
| 1727 |
+
},
|
| 1728 |
+
{
|
| 1729 |
+
"type": "text",
|
| 1730 |
+
"text": "This again correlates well with the value learned, shown in Figure 8. ",
|
| 1731 |
+
"bbox": [
|
| 1732 |
+
173,
|
| 1733 |
+
909,
|
| 1734 |
+
622,
|
| 1735 |
+
924
|
| 1736 |
+
],
|
| 1737 |
+
"page_idx": 13
|
| 1738 |
+
},
|
| 1739 |
+
{
|
| 1740 |
+
"type": "image",
|
| 1741 |
+
"img_path": "images/320717eb7ae6e6952c32f93552bc15fc1efe3fd34114e60721caa3c5b31c0bb2.jpg",
|
| 1742 |
+
"image_caption": [
|
| 1743 |
+
"Figure 7: Fraction of training experience where lb-GD or l ${ \\bf \\Lambda } _ { \\mathrm { 3 - D R + G D } }$ value target is greater than the Bellman target, on episodic FetchEnv and Pioneer tasks, plotted against the number of training iterations. Solid curves are the mean across three seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1744 |
+
],
|
| 1745 |
+
"image_footnote": [],
|
| 1746 |
+
"bbox": [
|
| 1747 |
+
204,
|
| 1748 |
+
99,
|
| 1749 |
+
792,
|
| 1750 |
+
431
|
| 1751 |
+
],
|
| 1752 |
+
"page_idx": 14
|
| 1753 |
+
},
|
| 1754 |
+
{
|
| 1755 |
+
"type": "text",
|
| 1756 |
+
"text": "A.5 N-STEP RETURN BASED METHODS ",
|
| 1757 |
+
"text_level": 1,
|
| 1758 |
+
"bbox": [
|
| 1759 |
+
176,
|
| 1760 |
+
539,
|
| 1761 |
+
455,
|
| 1762 |
+
553
|
| 1763 |
+
],
|
| 1764 |
+
"page_idx": 14
|
| 1765 |
+
},
|
| 1766 |
+
{
|
| 1767 |
+
"type": "text",
|
| 1768 |
+
"text": "A.5.1 N-STEP RETURN METHODS ",
|
| 1769 |
+
"text_level": 1,
|
| 1770 |
+
"bbox": [
|
| 1771 |
+
176,
|
| 1772 |
+
568,
|
| 1773 |
+
418,
|
| 1774 |
+
582
|
| 1775 |
+
],
|
| 1776 |
+
"page_idx": 14
|
| 1777 |
+
},
|
| 1778 |
+
{
|
| 1779 |
+
"type": "text",
|
| 1780 |
+
"text": "We also experimented with n-step return, td-lambda return and Retrace (Munos et al., 2016) but decided to give up on the direction due to the following reasons: ",
|
| 1781 |
+
"bbox": [
|
| 1782 |
+
176,
|
| 1783 |
+
594,
|
| 1784 |
+
823,
|
| 1785 |
+
623
|
| 1786 |
+
],
|
| 1787 |
+
"page_idx": 14
|
| 1788 |
+
},
|
| 1789 |
+
{
|
| 1790 |
+
"type": "text",
|
| 1791 |
+
"text": "1) We compared DDPG one-step return against DDPG with n-step return, td-lambda and Retrace on FetchPush, and found that a small n works similarly as the baseline one-step DDPG, and a larger n hurts training. This is likely due to the off-policy bias in n-step return causing the n-step estimate to be potentially worse than the one-step estimate, for example, when off-policy low return experiences are used to compute value targets. Introducing importance sampling weights (Retrace) would help reduce the bias, but at the same time significantly downweight the off-policy high return experiences, making an ineffective use of such experiences. The overall benefit of n-step methods is limited. ",
|
| 1792 |
+
"bbox": [
|
| 1793 |
+
174,
|
| 1794 |
+
630,
|
| 1795 |
+
825,
|
| 1796 |
+
728
|
| 1797 |
+
],
|
| 1798 |
+
"page_idx": 14
|
| 1799 |
+
},
|
| 1800 |
+
{
|
| 1801 |
+
"type": "text",
|
| 1802 |
+
"text": "None of these issues are present in value target lower bounding: (a) It does not incur any off-policy bias, and (b) as long as an experience renders high reward, being off-policy does not affect its ability to improve the value target. ",
|
| 1803 |
+
"bbox": [
|
| 1804 |
+
174,
|
| 1805 |
+
734,
|
| 1806 |
+
825,
|
| 1807 |
+
776
|
| 1808 |
+
],
|
| 1809 |
+
"page_idx": 14
|
| 1810 |
+
},
|
| 1811 |
+
{
|
| 1812 |
+
"type": "text",
|
| 1813 |
+
"text": "2) Computing n-step td-lambda return requires more computation due to evaluating value networks on all n-steps of the experience, and slows down training time significantly with a large n. ",
|
| 1814 |
+
"bbox": [
|
| 1815 |
+
174,
|
| 1816 |
+
784,
|
| 1817 |
+
821,
|
| 1818 |
+
811
|
| 1819 |
+
],
|
| 1820 |
+
"page_idx": 14
|
| 1821 |
+
},
|
| 1822 |
+
{
|
| 1823 |
+
"type": "text",
|
| 1824 |
+
"text": "On the other hand, value target lower bounding precomputes and stores discounted return in the replay buffer, and incurs very little additional computation. ",
|
| 1825 |
+
"bbox": [
|
| 1826 |
+
173,
|
| 1827 |
+
819,
|
| 1828 |
+
821,
|
| 1829 |
+
847
|
| 1830 |
+
],
|
| 1831 |
+
"page_idx": 14
|
| 1832 |
+
},
|
| 1833 |
+
{
|
| 1834 |
+
"type": "text",
|
| 1835 |
+
"text": "3) Tuning n-step return involves many hyperparameters like the number of steps n, the td-lambda parameter, replay buffer size and prioritized replay to expire old experiences and sample recent ones more frequently, target network update parameters to reduce potential overestimation, and parameters for importance sampling. But still, after all the tuning, it only slightly outperform onestep DDPG on FetchPush or SAC on Breakout, and is below the lower bounding method. For tdlambda and Retrace, the best performance comes from 3-step td with $\\lambda = 0 . 9 5$ , replay buffer length $4 0 0 \\mathrm { k }$ and all other parameters the same as the baseline DDPG or SAC. Retrace underperforming the baseline in Breakout is similarly observed in the original paper (Munos et al., 2016). ",
|
| 1836 |
+
"bbox": [
|
| 1837 |
+
174,
|
| 1838 |
+
854,
|
| 1839 |
+
823,
|
| 1840 |
+
924
|
| 1841 |
+
],
|
| 1842 |
+
"page_idx": 14
|
| 1843 |
+
},
|
| 1844 |
+
{
|
| 1845 |
+
"type": "image",
|
| 1846 |
+
"img_path": "images/c7c3d94b2a5683b838cef8abe8b79c8b49d9ad1eeccfa0460420fdc855e8fc16.jpg",
|
| 1847 |
+
"image_caption": [
|
| 1848 |
+
"Figure 8: Learned values of lb-DR, lb- $. { \\mathrm { D R } } { + } { \\mathrm { G D } }$ and HER on episodic FetchEnv and Pioneer tasks, evaluated on the training experience and plotted against the number of training iterations. Solid curves are the mean across three seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1849 |
+
],
|
| 1850 |
+
"image_footnote": [],
|
| 1851 |
+
"bbox": [
|
| 1852 |
+
205,
|
| 1853 |
+
103,
|
| 1854 |
+
792,
|
| 1855 |
+
436
|
| 1856 |
+
],
|
| 1857 |
+
"page_idx": 15
|
| 1858 |
+
},
|
| 1859 |
+
{
|
| 1860 |
+
"type": "text",
|
| 1861 |
+
"text": "",
|
| 1862 |
+
"bbox": [
|
| 1863 |
+
176,
|
| 1864 |
+
531,
|
| 1865 |
+
825,
|
| 1866 |
+
573
|
| 1867 |
+
],
|
| 1868 |
+
"page_idx": 15
|
| 1869 |
+
},
|
| 1870 |
+
{
|
| 1871 |
+
"type": "text",
|
| 1872 |
+
"text": "On the other hand, value target lower bounding requires no hyperparameter tuning, learns faster on most tasks and converges higher on some of the more difficult tasks. ",
|
| 1873 |
+
"bbox": [
|
| 1874 |
+
171,
|
| 1875 |
+
580,
|
| 1876 |
+
823,
|
| 1877 |
+
608
|
| 1878 |
+
],
|
| 1879 |
+
"page_idx": 15
|
| 1880 |
+
},
|
| 1881 |
+
{
|
| 1882 |
+
"type": "text",
|
| 1883 |
+
"text": "4) Value target lower bounding can be applied on top of n-step return methods as well, so is more of an orthogonal problem. ",
|
| 1884 |
+
"bbox": [
|
| 1885 |
+
171,
|
| 1886 |
+
614,
|
| 1887 |
+
823,
|
| 1888 |
+
643
|
| 1889 |
+
],
|
| 1890 |
+
"page_idx": 15
|
| 1891 |
+
},
|
| 1892 |
+
{
|
| 1893 |
+
"type": "text",
|
| 1894 |
+
"text": "Overall, n-step methods are much more expensive and difficult to use, and the much simpler and effective lower bounding method still maintains an advantage in effectiveness and performance. We show the performance comparison in Figure 9 with learned values in Figure 10. ",
|
| 1895 |
+
"bbox": [
|
| 1896 |
+
174,
|
| 1897 |
+
650,
|
| 1898 |
+
825,
|
| 1899 |
+
693
|
| 1900 |
+
],
|
| 1901 |
+
"page_idx": 15
|
| 1902 |
+
},
|
| 1903 |
+
{
|
| 1904 |
+
"type": "text",
|
| 1905 |
+
"text": "A.5.2 OPTIMALITY TIGHTENING WITH N-STEP RETURNS",
|
| 1906 |
+
"text_level": 1,
|
| 1907 |
+
"bbox": [
|
| 1908 |
+
174,
|
| 1909 |
+
715,
|
| 1910 |
+
578,
|
| 1911 |
+
729
|
| 1912 |
+
],
|
| 1913 |
+
"page_idx": 15
|
| 1914 |
+
},
|
| 1915 |
+
{
|
| 1916 |
+
"type": "text",
|
| 1917 |
+
"text": "He et al. (2016) use bootstrapped n-step return to lower and upper bound the value during training. They frame the problem as a constrained optimization problem where the distance between the value and the Bellman value target is minimized subject to the constraints that the value function must be within the lower (and upper) bounds. Their work is more general than the value target low bounding methods due to 1) including a value upper bound as well as lower bound, and 2) using bootstrapping, so it’s applicable to non-episodic tasks as well. ",
|
| 1918 |
+
"bbox": [
|
| 1919 |
+
174,
|
| 1920 |
+
742,
|
| 1921 |
+
825,
|
| 1922 |
+
825
|
| 1923 |
+
],
|
| 1924 |
+
"page_idx": 15
|
| 1925 |
+
},
|
| 1926 |
+
{
|
| 1927 |
+
"type": "text",
|
| 1928 |
+
"text": "Compared to value target lower bounding, several limitations exist. ",
|
| 1929 |
+
"bbox": [
|
| 1930 |
+
176,
|
| 1931 |
+
833,
|
| 1932 |
+
612,
|
| 1933 |
+
847
|
| 1934 |
+
],
|
| 1935 |
+
"page_idx": 15
|
| 1936 |
+
},
|
| 1937 |
+
{
|
| 1938 |
+
"type": "text",
|
| 1939 |
+
"text": "1) The prior work bounds the value function itself (similar to lower bound q learning (Oh et al., 2018; Tang, 2020)), instead of bounding the Bellman value target. This could cause suboptimal training because the Bellman target itself could be outside the bounds, causing contradictory training targets and losses. Imagine the current value for a state is 1, its Bellman value target may be a low 0, and the lower bound may be a high 2, then it’s unclear which way the value function should go. ",
|
| 1940 |
+
"bbox": [
|
| 1941 |
+
176,
|
| 1942 |
+
853,
|
| 1943 |
+
825,
|
| 1944 |
+
924
|
| 1945 |
+
],
|
| 1946 |
+
"page_idx": 15
|
| 1947 |
+
},
|
| 1948 |
+
{
|
| 1949 |
+
"type": "image",
|
| 1950 |
+
"img_path": "images/2a96b0e8af975ae058f8366692b146eac35d9cfd61d4484d9f0d3c2b6934b612.jpg",
|
| 1951 |
+
"image_caption": [
|
| 1952 |
+
"Figure 9: Evaluated average return of value target lower bounding with discounted return (lb-DR) vs SAC or DDPG, td-lambda and Retrace on Atari Breakout and episodic FetchEnv tasks. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1953 |
+
],
|
| 1954 |
+
"image_footnote": [],
|
| 1955 |
+
"bbox": [
|
| 1956 |
+
205,
|
| 1957 |
+
102,
|
| 1958 |
+
794,
|
| 1959 |
+
270
|
| 1960 |
+
],
|
| 1961 |
+
"page_idx": 16
|
| 1962 |
+
},
|
| 1963 |
+
{
|
| 1964 |
+
"type": "image",
|
| 1965 |
+
"img_path": "images/f2988e9cb681bbcea840578e3d9c902015ae06dd83c43ffb2031275e1f106192.jpg",
|
| 1966 |
+
"image_caption": [
|
| 1967 |
+
"Figure 10: Learned values of lb-DR and SAC (for Atari games), DDPG (for FetchEnv tasks), tdlambda and Retrace, evaluated on the training experience and plotted against the number of training iterations. Solid curves are the mean across five (for Atari) or three (others) seeds, and shaded areas are $+ / -$ one standard deviation. "
|
| 1968 |
+
],
|
| 1969 |
+
"image_footnote": [],
|
| 1970 |
+
"bbox": [
|
| 1971 |
+
204,
|
| 1972 |
+
378,
|
| 1973 |
+
794,
|
| 1974 |
+
550
|
| 1975 |
+
],
|
| 1976 |
+
"page_idx": 16
|
| 1977 |
+
},
|
| 1978 |
+
{
|
| 1979 |
+
"type": "text",
|
| 1980 |
+
"text": "It will depend largely on the mixing weight between the two losses $\\lambda$ and whether initial values overestimate, which can be hard to tune in practice. ",
|
| 1981 |
+
"bbox": [
|
| 1982 |
+
174,
|
| 1983 |
+
671,
|
| 1984 |
+
821,
|
| 1985 |
+
700
|
| 1986 |
+
],
|
| 1987 |
+
"page_idx": 16
|
| 1988 |
+
},
|
| 1989 |
+
{
|
| 1990 |
+
"type": "text",
|
| 1991 |
+
"text": "2) The prior work does not include any theoretical analysis and misses the limitation to only deterministic tasks. The lower and upper bounds are in fact not correct bounds, even on deterministic tasks, because of the use of bootstrapped values together with the empirical discounted return. ",
|
| 1992 |
+
"bbox": [
|
| 1993 |
+
174,
|
| 1994 |
+
707,
|
| 1995 |
+
825,
|
| 1996 |
+
750
|
| 1997 |
+
],
|
| 1998 |
+
"page_idx": 16
|
| 1999 |
+
},
|
| 2000 |
+
{
|
| 2001 |
+
"type": "text",
|
| 2002 |
+
"text": "3) In order to compute the bootstrapped values, the value network needs to be evaluated on all n future time steps, severely increasing GPU memory consumption and compute. Because of this increase in compute, in experiments, it could only look at a limited (4) timesteps into the future, while lb-DR can look all the way to the end of an episode with very little extra computation and storage. ",
|
| 2003 |
+
"bbox": [
|
| 2004 |
+
174,
|
| 2005 |
+
756,
|
| 2006 |
+
825,
|
| 2007 |
+
825
|
| 2008 |
+
],
|
| 2009 |
+
"page_idx": 16
|
| 2010 |
+
},
|
| 2011 |
+
{
|
| 2012 |
+
"type": "text",
|
| 2013 |
+
"text": "We implemented the method (He et al., 2016) and integrated into our baselines. We ran on FetchPush and Atari Breakout, with hyperparameters number of time steps $n = 4$ and the penalty coefficient $\\lambda = 4$ , following the original paper. ",
|
| 2014 |
+
"bbox": [
|
| 2015 |
+
174,
|
| 2016 |
+
832,
|
| 2017 |
+
825,
|
| 2018 |
+
875
|
| 2019 |
+
],
|
| 2020 |
+
"page_idx": 16
|
| 2021 |
+
},
|
| 2022 |
+
{
|
| 2023 |
+
"type": "text",
|
| 2024 |
+
"text": "We found that the prior method overestimates value a lot due to two reasons: a) taking max over the n-step returns for n from 1 to 4, and b) the use of the bootstrap value, causing the lower bound to be above what’s actually achievable. ",
|
| 2025 |
+
"bbox": [
|
| 2026 |
+
176,
|
| 2027 |
+
882,
|
| 2028 |
+
823,
|
| 2029 |
+
924
|
| 2030 |
+
],
|
| 2031 |
+
"page_idx": 16
|
| 2032 |
+
},
|
| 2033 |
+
{
|
| 2034 |
+
"type": "text",
|
| 2035 |
+
"text": "We also improved their method by lower bounding the Bellman value target with n-step return (with bootstrap) instead of imposing the constraint on the value function itself. But it still overestimates value and does not learn as quickly as the baseline one-step DDPG or SAC. ",
|
| 2036 |
+
"bbox": [
|
| 2037 |
+
174,
|
| 2038 |
+
103,
|
| 2039 |
+
823,
|
| 2040 |
+
146
|
| 2041 |
+
],
|
| 2042 |
+
"page_idx": 17
|
| 2043 |
+
},
|
| 2044 |
+
{
|
| 2045 |
+
"type": "text",
|
| 2046 |
+
"text": "We also adjusted $\\lambda$ to much lower values, hoping to control overestimation and improve over the baseline. Even with a very small lambda of 1e-7, it is still slower than DDPG baseline on FetchPush, likely because initial values are overestimates. On Atari Breakout, with a small lambda of 1e-7, it learns slightly faster than the SAC baseline but still way below the value target lower bounding method. ",
|
| 2047 |
+
"bbox": [
|
| 2048 |
+
174,
|
| 2049 |
+
152,
|
| 2050 |
+
825,
|
| 2051 |
+
222
|
| 2052 |
+
],
|
| 2053 |
+
"page_idx": 17
|
| 2054 |
+
},
|
| 2055 |
+
{
|
| 2056 |
+
"type": "text",
|
| 2057 |
+
"text": "A.6 A STOCHASTIC EXAMPLE ",
|
| 2058 |
+
"text_level": 1,
|
| 2059 |
+
"bbox": [
|
| 2060 |
+
176,
|
| 2061 |
+
239,
|
| 2062 |
+
395,
|
| 2063 |
+
253
|
| 2064 |
+
],
|
| 2065 |
+
"page_idx": 17
|
| 2066 |
+
},
|
| 2067 |
+
{
|
| 2068 |
+
"type": "text",
|
| 2069 |
+
"text": "Using empirical return directly as value lower bound can lead to value overestimation, as shown in the stochastic MDP example below. ",
|
| 2070 |
+
"bbox": [
|
| 2071 |
+
174,
|
| 2072 |
+
265,
|
| 2073 |
+
823,
|
| 2074 |
+
294
|
| 2075 |
+
],
|
| 2076 |
+
"page_idx": 17
|
| 2077 |
+
},
|
| 2078 |
+
{
|
| 2079 |
+
"type": "text",
|
| 2080 |
+
"text": "Assume state $S _ { 0 }$ always goes to $S _ { 1 }$ , and $S _ { 1 }$ gets reward $\\pm 2 ~ 5 0 \\%$ of the times. Then $v ( S _ { 0 } ) =$ $v ( S _ { 1 } ) = 0$ . However, with lower bounding, for the lucky case with reward 2, the value target for $S _ { 0 }$ is $\\gamma \\operatorname* { m a x } ( 2 , v ( S _ { 1 } ) ) = 2 \\gamma$ , and for the unlucky case with reward -2, the value target for $S _ { 0 }$ is $\\gamma \\operatorname* { m a x } ( - 2 , v ( S _ { 1 } ) ) = \\gamma v ( S _ { 1 } ) = 0$ . On average, $v ( S _ { 0 } )$ will be overestimated to be $\\gamma$ . ",
|
| 2081 |
+
"bbox": [
|
| 2082 |
+
174,
|
| 2083 |
+
300,
|
| 2084 |
+
823,
|
| 2085 |
+
357
|
| 2086 |
+
],
|
| 2087 |
+
"page_idx": 17
|
| 2088 |
+
},
|
| 2089 |
+
{
|
| 2090 |
+
"type": "text",
|
| 2091 |
+
"text": "It is worth noting that lower bounding the action value directly as done in SIL (Oh et al., 2018) will overestimate $v ( S _ { 1 } )$ as well, whereas lower bounding the value target will produce the correct $v ( S _ { 1 } )$ . This is because the same trajectory is used to both produce the Bellman value target ( $\\pm 2$ for $S _ { 1 }$ ) and the lower bound ( $\\pm 2$ for $S _ { 1 }$ ) which will be exactly the same for a given trajectory. ",
|
| 2092 |
+
"bbox": [
|
| 2093 |
+
174,
|
| 2094 |
+
363,
|
| 2095 |
+
825,
|
| 2096 |
+
419
|
| 2097 |
+
],
|
| 2098 |
+
"page_idx": 17
|
| 2099 |
+
},
|
| 2100 |
+
{
|
| 2101 |
+
"type": "text",
|
| 2102 |
+
"text": "A.7 DOES LOWER BOUNDING WITH EMPIRICAL RETURN REQUIRE THE POLICY TO BE DETERMINISTIC? ",
|
| 2103 |
+
"text_level": 1,
|
| 2104 |
+
"bbox": [
|
| 2105 |
+
178,
|
| 2106 |
+
438,
|
| 2107 |
+
774,
|
| 2108 |
+
464
|
| 2109 |
+
],
|
| 2110 |
+
"page_idx": 17
|
| 2111 |
+
},
|
| 2112 |
+
{
|
| 2113 |
+
"type": "text",
|
| 2114 |
+
"text": "The use of empirical return to lower bound the optimal value does not require the policy to be deterministic. It does require the policy class to include the optimal policy (deterministic when the task is deterministic) or some policy that’s close to the optimal policy. Otherwise, empirical return could still overestimate the optimal value achievable by the policy class. For example, Q learning assumes that the policy class includes the optimal policy which is the greedy one (and is deterministic). Because of that, the behavior policy can be non-deterministic and suboptimal, and it doesn’t affect the learned value to reach optimality (as long as the behavior covers enough of the state space). ",
|
| 2115 |
+
"bbox": [
|
| 2116 |
+
173,
|
| 2117 |
+
476,
|
| 2118 |
+
825,
|
| 2119 |
+
588
|
| 2120 |
+
],
|
| 2121 |
+
"page_idx": 17
|
| 2122 |
+
},
|
| 2123 |
+
{
|
| 2124 |
+
"type": "text",
|
| 2125 |
+
"text": "A.8 POTENTIAL IMPROVEMENT ",
|
| 2126 |
+
"text_level": 1,
|
| 2127 |
+
"bbox": [
|
| 2128 |
+
176,
|
| 2129 |
+
604,
|
| 2130 |
+
405,
|
| 2131 |
+
619
|
| 2132 |
+
],
|
| 2133 |
+
"page_idx": 17
|
| 2134 |
+
},
|
| 2135 |
+
{
|
| 2136 |
+
"type": "text",
|
| 2137 |
+
"text": "Note that the goal distance based return (lb-GD) of Section 3.1.1 is a very simple way of arriving at a reasonable lower bound with near zero additional computation. The bound could be made tighter. Typically, an $L _ { 2 }$ distance threshold is used to judge goal achievement, which will likely be satisfied a few time steps before exactly arriving at the hindsight goal. To compute such a tighter bound would require evaluating the reward function across the trajectories of experience using all possible hindsight goal states, and storing them in the replay buffer, i.e. episode length squared more computation and more storage space. It may be worth doing when episodes are short, or doing it only for a small number of time steps into the future when e.g. rewards are non-negative. ",
|
| 2138 |
+
"bbox": [
|
| 2139 |
+
173,
|
| 2140 |
+
631,
|
| 2141 |
+
825,
|
| 2142 |
+
742
|
| 2143 |
+
],
|
| 2144 |
+
"page_idx": 17
|
| 2145 |
+
}
|
| 2146 |
+
]
|
parse/dev/bgAS1ZvveZ/bgAS1ZvveZ_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/frE4fUwz_h/frE4fUwz_h.md
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPIKFORMER: WHEN SPIKING NEURAL NETWORK MEETS TRANSFORMER
|
| 2 |
+
|
| 3 |
+
1,2Zhaokun Zhou $^ { 1 , 2 }$ Yuesheng Zhu∗ 4Chao He 2Yaowei Wang 3Shuicheng Yan
|
| 4 |
+
1,2Yonghong Tian 1,2Li Yuan∗
|
| 5 |
+
1Peking University 2Peng Cheng Laboratory 3Sea AI Lab
|
| 6 |
+
4 Shenzhen EEGSmart Technology Co., Ltd.
|
| 7 |
+
{yuanli-ece}@pku.edu.cn
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We consider two biologically plausible structures, the Spiking Neural Network (SNN) and the self-attention mechanism. The former offers an energy-efficient and event-driven paradigm for deep learning, while the latter has the ability to capture feature dependencies, enabling Transformer to achieve good performance. It is intuitively promising to explore the marriage between them. In this paper, we consider leveraging both self-attention capability and biological properties of SNNs, and propose a novel Spiking Self Attention (SSA) as well as a powerful framework, named Spiking Transformer (Spikformer). The SSA mechanism in Spikformer models the sparse visual feature by using spike-form Query, Key, and Value without softmax. Since its computation is sparse and avoids multiplication, SSA is efficient and has low computational energy consumption. It is shown that Spikformer with SSA can outperform the state-of-the-art SNNs-like frameworks in image classification on both neuromorphic and static datasets. Spikformer (66.3M parameters) with comparable size to SEW-ResNet-152 (60.2M, $6 9 . 2 6 \%$ ) can achieve $7 4 . 8 1 \%$ top1 accuracy on ImageNet using 4 time steps, which is the state-of-the-art in directly trained SNNs models. Codes is avaiable at Spikformer.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
As the third generation of neural network (Maass, 1997), the Spiking Neural Network (SNN) is very promising for its low power consumption, event-driven characteristic, and biological plausibility (Roy et al., 2019). With the development of artificial neural networks (ANNs), SNNs are able to lift performance by borrowing advanced architectures from ANNs, such as ResNet-like SNNs (Hu et al., 2021a; Fang et al., 2021a; Zheng et al., 2021; Hu et al., 2021b), Spiking Recurrent Neural Networks (Lotfi Rezaabad & Vishwanath, 2020) and Spiking Graph Neural Networks (Zhu et al., 2022). Transformer, originally designed for natural language processing (Vaswani et al., 2017), has flourished for various tasks in computer vision, including image classification (Dosovitskiy et al., 2020; Yuan et al., 2021a), object detection (Carion et al., 2020; Zhu et al., 2020; Liu et al., 2021), semantic segmentation (Wang et al., 2021; Yuan et al., 2021b) and low-level image processing (Chen et al., 2021). Self-attention, the key part of Transformer, selectively focuses on information of interest, and is also an important feature of the human biological system (Whittington et al., 2022; Caucheteux & King, 2022). Intuitively, it is intriguing to explore applying self-attention in SNNs for more advanced deep learning, considering the biological properties of the two mechanisms.
|
| 16 |
+
|
| 17 |
+
It is however non-trivial to port the self-attention mechanism into SNNs. In vanilla self-attention (VSA) (Vaswani et al., 2017), there are three components: Query, Key, and Value. As shown in Figure 1(a), standard inference of VSA is firstly obtaining a matrix by computing the dot product of float-point-form Query and Key; then softmax, which contains exponential calculations and division operations, is adopted to normalize the matrix to give the attention map which will be used to weigh the Value. The above steps in VSA do not conform to the calculation characteristics of SNNs, i.e., avoiding multiplication. Moreover, the heavy computational overhead of VSA almost prohibits applying it directly to SNNs. Therefore, in order to develop Transformer on SNNs, we need to design a new effective and computation-efficient self-attention variant that can avoid multiplications.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Illustration of vanilla self-attention (VSA) and our Spiking Self Attention (SSA). A red spike indicates a value of 1 at that location. The blue dashed boxes provide examples of matrix dot product operation. For convenience, we choose one of the heads of SSA, where $N$ is the number of input patches and $d$ is the feature dimension of one head. FLOPs is the floating point operations and SOPs is the theoretical synaptic operations. The theoretical energy consumption to perform one calculation between Query, Key and Value in one time step is obtained from 8-encoder-blocks 512-embedding-dimension Spikformer on ImageNet test set according to (Kundu et al., 2021b; Hu et al., 2021a). More details about the calculation of theoretical SOP and energy consumption are included in appendix. C.2. (a) In VSA, $Q _ { \mathcal { F } } , K _ { \mathcal { F } } , V _ { \mathcal { F } }$ are float-point forms. After the dot-product of $Q \mathcal { F }$ and $K \mathcal { \tau }$ , the softmax function regularizes negative values in the attention map to positive values. (b) In SSA, all value in attention map is non-negative and the computation is sparse using spike-form $Q , K , V \left( 5 . 5 \times 1 0 ^ { 6 } \mathrm { V S . 7 7 } \times 1 0 ^ { 6 } \right.$ in VSA). Therefore, the computation in SSA consumes less energy compared with VSA $( 3 5 4 . 2 \mu \mathrm { J } )$ . In addition, the SSA is decomposable (the calculation order of $Q , K$ and $V$ is changeable).
|
| 21 |
+
|
| 22 |
+
We thus present Spiking Self Attention (SSA), as illustrated in Figure 1(b). SSA introduces selfattention mechanism to SNNs for the first time, which models the interdependence using spike sequences. In SSA, the Query, Key, and Value are in spike form which only contains of 0 and 1. The obstacles to the application of self-attention in SNNs are mainly caused by softmax. 1) As shown in Figure 1, the attention map calculated from spike-form Query and Key has natural non-negativeness, which ignores irrelevant features. Thus, we do not need the softmax to keep the attention matrix non-negative, which is its most important role in VSA (Qin et al., 2022). 2) The input and the Value of the SSA are in the form of spikes, which only consist of 0 and 1 and contain less fine-grained feature compared to the float-point input and Value of the VSA in ANNs. So the float-point Query and Key and softmax function are redundant for modeling such spike sequences. Tab. 1 illustrates that our SSA is competitive with VSA in the effect of processing spike sequences. Based on the above insights, we discard softmax normalization for the attention map in SSA. Some previous Transformer variants also discard softmax or replace it with a linear function. For example, in Performer (Choromanski et al., 2020), positive random feature is adopted to approximate softmax; CosFormer (Qin et al., 2022) replaces softmax with ReLU and cosine function.
|
| 23 |
+
|
| 24 |
+
With such designs of SSA, the calculation of spike-form Query, Key, and Value avoids multiplications and can be done by logical AND operation and addition. Also, its computation is very efficient. Due to sparse spike-form Query, Key and Value (shown in appendix D.1) and simple computation, the number of operations in SSA is small, which makes the energy consumption of SSA very low. Moreover, our SSA is decomposable after deprecation of softmax, which further reduces its computational complexity when the sequence length is greater than the feature dimension of one head, as depicted in Figure 1(b) $\textcircled{1} \textcircled{2}$ .
|
| 25 |
+
|
| 26 |
+
Based on the proposed SSA, which well suits the calculation characteristics of SNNs, we develop the Spiking Transformer (Spikformer). An overview of Spikformer is shown in Figure 2. It boosts the performance trained on both static datasets and neuromorphic datasets. To the best of our knowledge, it is the first time to explore the self-attention mechanism and directly-trained Transformer in the SNNs. To sum up, there are three-fold contributions of our work:
|
| 27 |
+
|
| 28 |
+
• We design a novel spike-form self-attention named Spiking Self Attention (SSA) for the properties of SNNs. Using sparse spike-form Query, Key, and Value without softmax, the calculation of SSA avoids multiplications and is efficient. • We develop the Spiking Transformer (Spikformer) based on the proposed SSA. To the best of our knowledge, this is the first time to implement self-attention and Transformer in SNNs.
|
| 29 |
+
|
| 30 |
+
• Extensive experiments show that the proposed architecture outperforms the state-of-the-art SNNs on both static and neuromorphic datasets. It is worth noting that we achieved more than $7 4 \%$ accuracy on ImageNet with 4 time steps using directly-trained SNN model for the first time.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
Vision Transformers. For the image classification task, a standard vision transformer (ViT) includes a patch splitting module, the transformer encoder layer(s), and linear classification head. The Transformer encoder layer consists of a self-attention layer and a multi perception layer block. Selfattention is the core component making ViT successful. By weighting the image-patches feature value through the dot-product of query and key and softmax function, self-attention can capture the global dependence and interest representation (Katharopoulos et al., 2020; Qin et al., 2022). Some works have been carried out to improve the structures of ViTs. Using convolution layers for patch splitting has been proven to be able to accelerate convergence and alleviate the data-hungry problem of ViT (Xiao et al., 2021b; Hassani et al., 2021). There are some methods aiming to reduce the computational complexity of self-attention or improve its ability of modeling visual dependencies (Song, 2021; Yang et al., 2021; Rao et al., 2021; Choromanski et al., 2020). This paper focuses on exploring the effectiveness of self-attention in SNNs and developing a powerful spiking transformer model for image classification.
|
| 35 |
+
|
| 36 |
+
Spiking Neural Networks. Unlike traditional deep learning models that convey information using continuous decimal values, SNNs use discrete spike sequences to calculate and transmit information. Spiking neurons receive continuous values and convert them into spike sequences, including the Leaky Integrate-and-Fire (LIF) neuron (Wu et al., 2018), PLIF (Fang et al., 2021b), etc. There are two ways to get deep SNN models: ANN-to-SNN conversion and direct training. In ANNto-SNN conversion (Cao et al., 2015; Hunsberger & Eliasmith, 2015; Rueckauer et al., 2017; Bu et al., 2021; Meng et al., 2022; Wang et al., 2022), the high-performance pre-trained ANN is converted to SNN by replacing the ReLU activation layers with spiking neurons. The converted SNN requires large time steps to accurately approximate ReLU activation, which causes large latency (Han et al., 2020). In the area of direct training, SNNs are unfolded over the simulation time steps and trained in a way of backpropagation through time (Lee et al., 2016; Shrestha & Orchard, 2018). Because the event-triggered mechanism in spiking neurons is non-differentiable, the surrogate gradient is used for backpropagation (Lee et al., 2020; Neftci et al., 2019)Xiao et al. (2021a) adopts implicit differentiation on the equilibrium state to train SNN. Various models from ANNs have been ported to SNNs. However, the study of self-attention on SNN is currently blank. Yao et al. (2021) proposed temporal attention to reduce the redundant time step. Zhang et al. (2022a;b) both use ANN-Transformer to process spike data, although they have ’Spiking Transformer’ in the title. Mueller et al. (2021) provides a ANN-SNN conversion Transformer, but remains vanilla self-attention which does not conform the characteristic of SNN. In this paper, we will explore the feasibility of implementing self-attention and Transformer in SNNs.
|
| 37 |
+
|
| 38 |
+
As the fundamental unit of SNNs, the spike neuron receives the resultant current and accumulates membrane potential which is used to compare with the threshold to determine whether to generate the spike. We uniformly use LIF spike neurons in our work. The dynamic model of LIF is described as:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { l } { { \displaystyle H [ t ] = V [ t - 1 ] + \frac { 1 } { \tau } \left( X [ t ] - \left( V [ t - 1 ] - V _ { r e s e t } \right) \right) , } } \\ { { \displaystyle S [ t ] = \Theta ( H [ t ] - V _ { t h } ) , } } \\ { { \displaystyle V [ t ] = H [ t ] \left( 1 - S [ t ] \right) + V _ { r e s e t } S [ t ] , } } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\tau$ is the membrane time constant, and $X [ t ]$ is the input current at time step $t$ . When the membrane potential $H [ t ]$ exceeds the firing threshold $V _ { t h }$ , the spike neuron will trigger a spike $S [ t ]$ . $\Theta ( v )$ is the Heaviside step function which equals 1 for $v \geq 0$ and 0 otherwise. $V [ t ]$ represents the membrane potential after the trigger event which equals $H [ t ]$ if no spike is generated, and otherwise equals to the reset potential $V _ { r e s e t }$ .
|
| 45 |
+
|
| 46 |
+
# 3 METHOD
|
| 47 |
+
|
| 48 |
+
We propose Spiking Transformer (Spikformer), which incorporates the self-attention mechanism and Transformer into the spiking neural networks (SNNs) for enhanced learning capability. Now we explain the overview and components of Spikformer one by one.
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: The overview of Spiking Transformer (Spikformer), which consists of a spiking patch splitting module (SPS), a Spikformer encoder and a Linear classification head. We empircally find that the layer normalization (LN) does not apply to SNNs, so we use batch normalization (BN) instead.
|
| 52 |
+
|
| 53 |
+
# 3.1 OVERALL ARCHITECTURE
|
| 54 |
+
|
| 55 |
+
An overview of Spikformer is depicted in Figure 2. Given a 2D image sequence $I \in \mathbb { R } ^ { T \times C \times H \times W \mathbb { 1 } }$ , the Spiking Patch Splitting (SPS) module linearly projects it to a $D$ dimensional spike-form feature vector and splits it into a sequence of $N$ flattened spike-form patches $x$ . Float-point-form position embedding cannot be used in SNNs. We employ a conditional position embedding generator (Chu et al., 2021) to generate spike-form relative position embedding (RPE) and add the RPE to patches sequence $x$ to get $X _ { 0 }$ . The conditional position embedding generator contains a 2D convolution layer (Conv2d) with kernel size 3, batch normalization (BN), and spike neuron layer $( \cal { S } \mathcal { N } )$ . Then we pass the $X _ { 0 }$ to the $L$ -block Spikformer encoder. Similar to the standard ViT encoder block, a Spikformer encoder block consists of a Spiking Self Attention (SSA) and an MLP block. Residual connections are applied in both the SSA and MLP block. As the main component in Spikformer encoder block, SSA offers an efficient method to model the local-global information of images using spike-form Query $( Q )$ , Key $( K )$ , and Value $( V )$ without softmax, which will be analyzed in detail in Sec. 3.3. A global average-pooling (GAP) is utilized on the processed feature from Spikformer encoder and outputs the $D$ -dimension feature which will be sent to the fully-connected-layer classification head (CH) to output the prediction $Y$ . Spikformer can be written as follows:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { r l r l } & { x = \operatorname { S P S } \left( I \right) , \quad \quad \quad } & & { I \in \mathbb { R } ^ { T \times C \times H \times W } , x \in \mathbb { R } ^ { T \times N \times D } , } \\ & { \operatorname { R P E } = \mathcal { S N } ( \operatorname { B N } ( ( \operatorname { C o n v 2 d } ( x ) ) ) ) , \quad \quad } & & { \operatorname { R P E } \in \mathbb { R } ^ { T \times N \times D } } \\ & { X _ { 0 } = x + \operatorname { R P E } , \quad \quad } & & { X _ { 0 } \in \mathbb { R } ^ { T \times N \times D } } \\ & { X _ { l } ^ { \prime } = \operatorname { S S A } ( X _ { l - 1 } ) + X _ { l - 1 } , \quad \quad } & & { X _ { l } ^ { \prime } \in \mathbb { R } ^ { T \times N \times D } , l = 1 . . . L } \\ & { X _ { l } = \operatorname { M L P } ( X _ { l } ^ { \prime } ) + X _ { l } ^ { \prime } , \quad \quad } & & { X _ { l } \in \mathbb { R } ^ { T \times N \times D } , l = 1 . . . L } \\ & { Y = \operatorname { C H } ( \operatorname { G A P } ( X _ { L } ) ) } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
# 3.2 SPIKING PATCH SPLITTING
|
| 62 |
+
|
| 63 |
+
As shown in Figure 2, the Spiking Patch Splitting (SPS) module aims to linearly project an image to a $D$ dimensional spike-form feature and split the feature into patches with a fixed size. SPS can contain multiple blocks. Similar to the convolutional stem in Vision Transformer (Xiao et al., 2021b; Hassani et al., 2021), we apply a convolution layer in each SPS block to introduce inductive bias into
|
| 64 |
+
|
| 65 |
+
Spikformer. Specifically, given an image sequence $I \in \mathbb { R } ^ { T \times C \times H \times W }$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
x = \Re \Re \left( S \mathcal { N } ( \mathrm { B N } ( ( \mathrm { C o n v 2 d } ( I ) ) ) ) \right)
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where the Conv2d and $\operatorname { \mathcal { M P } }$ represent the 2D convolution layer (stride-1, $3 \times 3$ kernel size) and max-pooling, respectively. The number of SPS blocks can be more than 1. When using multiple SPS blocks, the number of output channels in these convolution layers is gradually increased and finally matches the embedding dimension of patches. For example, given an output embedding dimension $D$ and a four-block SPS module, the number of output channels in four convolution layers is $D / 8 , D / 4 , D / 2 , D$ . While the 2D-max-pooling layer is applied to down-sample the feature size after SPS block with a fixed size. After the processing of SPS, $I$ is split into an image patches sequence x ∈ RT ×N×D.
|
| 72 |
+
|
| 73 |
+
# 3.3 SPIKING SELF ATTENTION MECHANISM
|
| 74 |
+
|
| 75 |
+
Spikformer encoder is the main component of the whole architecture, which contains the Spiking Self Attention (SSA) mechanism and MLP block. In this section we focus on SSA, starting with a review of vanilla self-attention (VSA). Given an input feature sequence $X \in \mathbb { R } ^ { T \times N \times D }$ , the VSA in ViT has three float-point key components, namely query $( Q \tau )$ , key $( K _ { \mathcal { F } } )$ , and value $( V _ { \mathcal { F } } )$ which are calculated by learnable linear matrices $W _ { Q } , W _ { K } , W _ { V } \in \mathbb { R } ^ { D \times D }$ and $X$ :
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
Q _ { \mathcal { F } } = X W _ { Q } , K _ { \mathcal { F } } = X W _ { K } , V _ { \mathcal { F } } = X W _ { V }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { F }$ denotes the float-point form. The output of vanilla self-attention can be computed as:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathrm { V S A } ( Q _ { \mathcal { F } } , K _ { \mathcal { F } } , V _ { \mathcal { F } } ) = \mathrm { S o f t m a x } \left( \frac { Q _ { \mathcal { F } } K _ { \mathcal { F } } ^ { \mathrm { T } } } { \sqrt { d } } \right) V _ { \mathcal { F } }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $d = D / H$ is the feature dimension of one head and $H$ is the head number. Converting the float-point-form Value $( V _ { \mathcal { F } } )$ into spike form $( V )$ can realize the direct application of VSA in SNNs, which can be expressed as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathrm { V S A } ( Q _ { \mathcal { F } } , K _ { \mathcal { F } } , V ) = \mathrm { S o f t m a x } \left( \frac { Q _ { \mathcal { F } } K _ { \mathcal { F } } ^ { \mathrm { T } } } { \sqrt { d } } \right) V
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
However, the calculation of VSA is not applicable in SNNs for two reasons. 1) The float-point matrix multiplication of $Q _ { \mathcal { F } } , K _ { \mathcal { F } }$ and softmax function which contains exponent calculation and division operation, do not comply with the calculation rules of SNNs. 2) The quadratic space and time complexity of the sequence length of VSA do not meet the efficient computational requirements of SNNs.
|
| 94 |
+
|
| 95 |
+
We propose Spiking Self-Attention (SSA), which is more suitable for SNNs than the VSA, as shown in Figure 1(b) and the bottom of Figure 2. The query $( Q )$ , key $( K )$ , and Value $( V )$ are computed through learnable matrices firstly. Then they become spiking sequences via different spike neuron layers:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
Q = \mathcal { S } \mathcal { N } _ { Q } ( \mathrm { B N } ( X W _ { Q } ) ) , K = \mathcal { S } \mathcal { N } _ { K } ( \mathrm { B N } ( X W _ { K } ) ) , V = \mathcal { S } \mathcal { N } _ { V } ( \mathrm { B N } ( X W _ { V } ) )
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $Q , K , V \in \mathbb { R } ^ { T \times N \times D }$ . We believe that the calculation process of the attention matrix should use pure spike-form Query and Key(only containing 0 and 1). Inspired by vanilla self-attention (Vaswani et al., 2017), we add a scaling factor $s$ to control the large value of the matrix multiplication result. $s$ does not affect the property of SSA. As shown in Figure 2, the spike-friendly SSA is defined as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r l } & { \mathrm { S S A } ^ { \prime } ( Q , K , V ) = \mathcal { S N } \left( Q K ^ { \mathrm { T } } V \ast s \right) } \\ & { \mathrm { S S A } ( Q , K , V ) = \mathcal { S N } ( \mathrm { B N } ( \mathrm { L i n e a r } ( \mathrm { S S A } ^ { \prime } ( Q , K , V ) ) ) ) . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
The single-head SSA introduced here can easily be extended to the multi-head SSA, which is detailed in the appendix A. SSA is independently conducted on each time step and seeing more details in appendix B. As shown in Eq. (15), SSA cancels the use of softmax to normalize the attention matrix in Eq. (12) and directly multiplies $Q , K$ and $V$ . An intuitive calculation example is shown in Figure 1(b). The softmax is unnecessary in our SSA, and it even hinders the implementation of self-attention to SNNs. Formally, based on Eq. (14), the spike sequences $Q$ and $K$ output by the spiking neuron layer $S \mathcal { N } _ { Q }$ and $\mathcal { S N } _ { k }$ respectively, are naturally non-negative (0 or 1), resulting in a non-negative attention map. SSA only aggregates these relevant features and ignores the irrelevant information. Hence it does not need the softmax to ensure the non-negativeness of the attention map. Moreover, compared to the float-point-form $X _ { \mathcal { F } }$ and $V _ { \mathcal { F } }$ in ANNs, the input $X$ and the Value $V$ of self-attention in SNNs are in spike form, containing limited information. The vanilla self-attention (VSA) with float-point-form $Q _ { \mathcal { F } } , K _ { \mathcal { F } }$ and softmax is redundant for modeling the spike-form $X , V$ , which cannot get more information from $X , V$ than SSA. That is, SSA is more suitable for SNNs than the VSA.
|
| 108 |
+
|
| 109 |
+
We conduct experiments to validate the above insights by comparing the proposed SSA with four different calculation methods of the attention map, as shown in Tab. 1.
|
| 110 |
+
|
| 111 |
+
$\mathrm { A _ { I } }$ denotes multiplying the float-points $Q$ and $K$ directly to get the attention map, which preserves both positive and negative correlation. $\mathrm { A _ { R e L U } }$ uses the multiplication between ${ \mathrm { R e L U } } ( Q )$ and $\mathrm { R e L U } ( K )$ to obtain the attention map. $\mathrm { A _ { R e L U } }$ retains the positive values of $Q , K$ and sets the negative values to 0,
|
| 112 |
+
|
| 113 |
+
Table 1: Analysis of the SSA’s rationality. We replace SSA with other attention variants and keep the remaining network structure in Spikformer unchanged. We show the accuracy (Acc) on CIFAR10-DVS (Li et al., 2017), CIFAR10/100 (Krizhevsky, 2009). OPs (M) is the number of operations (For $\mathrm { A _ { I } }$ , $\mathrm { A _ { L e a k y R e L U } }$ , $\mathrm { A _ { R e L U } }$ and $\mathrm { A } _ { \mathrm { s o f t m a x } }$ , OPs is FLOPs, and SOPs is ignored; For ASSA, it is SOPs.) and $\mathrm { P }$ $( \mu \mathrm { J } )$ is the theoretical energy consumption to perform one calculation among $Q , K , V$ .
|
| 114 |
+
|
| 115 |
+
<table><tr><td></td><td>CIFAR10-DVS</td><td>CIFAR10</td><td>CIFAR100</td></tr><tr><td></td><td colspan="3">Acc/OPs (M)/P (μJ)</td></tr><tr><td>A1</td><td>79.40/16.8/77</td><td>93.96/6.3/29</td><td>76.94/6.3/29</td></tr><tr><td>ALeakyReLU</td><td>79.80/16.8/77</td><td>93.85/6.3/29</td><td>76.73/6.3/29</td></tr><tr><td>AReLU</td><td>79.40/16.8/77</td><td>94.34/6.3/29</td><td>77.00/6.3/29</td></tr><tr><td>Asoftmax</td><td>80.00/19.1/88</td><td>94.97/6.6/30</td><td>77.92/6.6/30</td></tr><tr><td>AssA</td><td>80.90/0.66/0.594</td><td>95.19/1.1/0.990</td><td>77.86/1.3/1.170</td></tr></table>
|
| 116 |
+
|
| 117 |
+
while $\mathrm { A _ { L e a k y R e L U } }$ still retains the negative points. $\mathrm { A } _ { \mathrm { s o f t m a x } }$ means the attention map is generated following VSA. The above four methods use the same Spikformer framework and weight the spike-form $V$ . From Tab. 1, the superior performance of our $\mathrm { A } _ { \mathrm { S S A } }$ over $\mathrm { A _ { I } }$ and ALeakyReLU proves the superiority of $\mathcal { S N }$ . The reason why $\mathrm { A _ { S S A } }$ is better than $\mathrm { A _ { R e L U } }$ may be that $\mathrm { A _ { S S A } }$ has better non-linearity in self-attention. By comparing with $\mathrm { A } _ { \mathrm { s o f t m a x } }$ , $\mathrm { A } _ { \mathrm { S S A } }$ is competitive, which even surpasses $\mathrm { A } _ { \mathrm { s o f t m a x } }$ on CIFAR10DVS and CIFAR10. This can be attributed to SSA being more suitable for spike sequences $X$ and $V$ ) with limited information than VSA. Furthermore, the number of operations and theoretical energy consumption required by the $\mathrm { A _ { S S A } }$ to complete the calculation of $Q , K , V$ is much lower than that of the other methods.
|
| 118 |
+
|
| 119 |
+
SSA is specially designed for modeling spike sequences. The $Q , K$ , and $V$ are all in spike form, which degrades the matrWe take a row of Query $q$ dot-product calculatioand a column of Key $k$ to logical AND operation aas a calculation example: $\begin{array} { r } { \sum _ { i = 1 } ^ { d } q _ { i } k _ { i } = \sum _ { q _ { i } = 1 } k _ { i } } \end{array}$ . . Also, as shown in Tab. 1, SSA has a low computation burden and energy consumption due to sparse spike-form $Q , K$ and $V$ (Figure. 4) and simplified calculation. In addition, the order of calculation between $Q , K$ and $V$ is changeable: $Q K ^ { \mathrm { T } }$ first and then $V$ , or $K ^ { \mathrm { T } } V$ first and then $Q$ . When the sequence length $N$ is bigger than one head dimension $d$ , the second calculation order above will incur less computation complexity $( O ( N d ^ { 2 } ) )$ than the first one $( O ( N ^ { 2 } d ) )$ . SSA maintains the biological plausibility and computationally efficient properties throughout the whole calculation process.
|
| 120 |
+
|
| 121 |
+
# 4 EXPERIMENTS
|
| 122 |
+
|
| 123 |
+
We conduct experiments on both static datasets CIFAR, ImageNet (Deng et al., 2009), and neuromorphic datasets CIFAR10-DVS, DVS128 Gesture (Amir et al., 2017) to evaluate the performance of Spikformer. The models for conducting experiments are implemented based on Pytorch (Paszke et al., 2019), SpikingJelly 2 and Pytorch image models library (Timm) 3. We train the Spikformer from scratch and compare it with current SNNs models in Sec. 4.1 and 4.2. We conduct ablation studies to show the effects of the SSA module and Spikformer in Sec. 4.3.
|
| 124 |
+
|
| 125 |
+
# 4.1 STATIC DATASETS CLASSIFICATION
|
| 126 |
+
|
| 127 |
+
ImageNet contains around 1.3 million 1, 000-class images for training and 50, 000 images for validation. The input size of our model on ImageNet is set to the default $2 2 4 \times 2 2 4$ . The optimizer is AdamW and the batch size is set to 128 or 256 during 310 training epochs with a cosine-decay learning rate whose initial value is 0.0005. The scaling factor is 0.125 when training on ImageNet and CIFAR. A four-block SPS splits the image into $1 9 6 ~ 1 6 \times 1 6$ patches. Following (Yuan et al., 2021a), standard data augmentation methods, such as random augmentation, mixup, and cutmix, are also used in training. We try a variety of models with different embedding dimensions and numbers of transformer blocks for ImageNet, which has been shown in Tab. 2. We also give a comparison of synaptic operations (SOPs) (Merolla et al., 2014) and theoretical energy consumption.
|
| 128 |
+
|
| 129 |
+
Table 2: Evaluation on ImageNet. Param refers to the number of parameters. Power is the average theoretical energy consumption when predicting an image from ImageNet test set, whose calculation detail is shown in Eq. 22. Spikformer- $. L – D$ represents a Spikformer model with $L$ Spikformer encoder blocks and $D$ feature embedding dimensions. The train loss, test loss and test accuracy curves are shown in appendix D.2. OPs refers to SOPs in SNN and FLOPs in ANN-ViT.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Methods</td><td>Architecture</td><td>Param (M)</td><td>OPs (G)</td><td>Power (mJ)</td><td>Time Step</td><td>Acc</td></tr><tr><td>Hybrid training(Rathi et al.,2020)</td><td>ResNet-34</td><td>21.79</td><td>1</td><td>-</td><td>250</td><td>61.48</td></tr><tr><td rowspan="2">TET(Deng et al., 2021)</td><td>Spiking-ResNet-34</td><td>21.79</td><td>1</td><td></td><td>6</td><td>64.79</td></tr><tr><td>SEW-ResNet-34</td><td>21.79</td><td>-</td><td>-</td><td>4</td><td>68.00</td></tr><tr><td>Spiking ResNet(Hu et al., 2021a)</td><td>ResNet-34</td><td>21.79</td><td>65.28</td><td>59.295</td><td>350</td><td>71.61</td></tr><tr><td>STBP-tdBN(Zheng et al., 2021)</td><td>ResNet-50 Spiking-ResNet-34</td><td>25.56 21.79</td><td>78.29</td><td>70.934</td><td>350</td><td>72.75</td></tr><tr><td rowspan="4">SEW ResNet(Fang et al.,2021a)</td><td></td><td>21.79</td><td>6.50 3.88</td><td>6.393</td><td>6</td><td>63.72</td></tr><tr><td>SEW-ResNet-34</td><td></td><td></td><td>4.035</td><td>4</td><td>67.04</td></tr><tr><td>SEW-ResNet-50</td><td>25.56</td><td>4.83</td><td>4.890</td><td>4</td><td>67.78</td></tr><tr><td>SEW-ResNet-101 SEW-ResNet-152</td><td>44.55 60.19</td><td>9.30 13.72</td><td>8.913 12.891</td><td>4 4</td><td>68.76 69.26</td></tr><tr><td>Transformer</td><td>Transformer-8-512</td><td>29.68</td><td>8.33</td><td>38.340</td><td>1</td><td>80.80</td></tr><tr><td rowspan="5">Spikformer</td><td>Spikformer-8-384</td><td>16.81</td><td>6.82</td><td>7.734</td><td>4</td><td>70.24</td></tr><tr><td>Spikformer-6-512</td><td>23.37</td><td>8.69</td><td>9.417</td><td>4</td><td>72.46</td></tr><tr><td>Spikformer-8-512</td><td>29.68</td><td>11.09</td><td>11.577</td><td>4</td><td>73.38</td></tr><tr><td>Spikformer-10-512</td><td>36.01</td><td>13.67</td><td>13.899</td><td>4</td><td>73.68</td></tr><tr><td>Spikformer-8-768</td><td>66.34</td><td>22.09</td><td>21.477</td><td>4</td><td>74.81</td></tr></table>
|
| 132 |
+
|
| 133 |
+
From the results, it can be seen that our Spikformer achieves a significant accuracy boost on the ImageNet compared with the current best SNNs models. In particular, our comparison first starts from our smallest model with other models. The Spikformer-8-384 with 16.81M parameters has $7 0 . 2 4 \%$ top-1 accuracy when trained from scratch on ImageNet, which outperforms the best the current best direct-train model SEW-ResNet152: $6 9 . 2 6 \%$ with $6 0 . 1 9 \mathbf { M }$ . In addition, the SOPs and the theoretical energy consumption of Spikformer-8-384 (6.82G, $7 . 7 3 4 \mathrm { m J }$ ) are lower compared with the SEW-ResNet-152 (13.72G, 12.891mJ). The 29.68M model Spikformer-8-512 has already achieved state-of-the-art performance with $7 3 . 3 8 \%$ , which is even higher than the converted model (Hu et al., 2021a) $( 7 2 . 7 5 \% )$ using 350 time steps. As the number of Spikformer blocks increases, the classification accuracy of our model on ImageNet is also getting higher. The Spikformer-10-512 obtains $7 3 . 6 8 \%$ with $4 2 . 3 5 \mathrm { M }$ The same happens when gradually increasing the embedding dimension, where Spikformer-8-768 further improves the performance to $7 4 . 8 1 \%$ and significantly outperforms the SEW-ResNet-152 model by $5 . 5 5 \%$ . ANNViT-8-512 is $7 . \bar { 4 } 2 \%$ higher than Spikformer-8-512, but the theoretical energy consumption is $3 . 3 1 \times$ of Spikformer-8-512. In Figure 3, we show the attention map examples of the last encoder block in Spikformer-8-512 at the fourth time step. SSA can capture image regions associated with classification semantics and set irrelevant regions to 0 (black region), and is shown to be effective, event-driven, and energy-efficient.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 3: Attention map examples of SSA. The black region is 0.
|
| 137 |
+
|
| 138 |
+
CIFAR provides 50, 000 train and $1 0 , 0 0 0$ test images with $3 2 \times 3 2$ resolution. The batch size is set to 128. A four-block SPS (the first two blocks do not contain the max-pooling layer) splits the image into $6 4 4 \times 4$ patches. Tab. 3 shows the accuracy of Spikformer compared with other models on CIFAR. As shown in Tab. 3, Spikformer-4- 384 achieves ${ \bar { 9 } } 5 . 1 9 \%$ accuracy on CIFAR10, which is better than the TET $( 9 4 . 4 4 \% )$ and ResNet-19
|
| 139 |
+
|
| 140 |
+
Table 3: Performance comparison of our method with existing methods on CIFAR10/100. Our method improves network performance across all tasks. \* denotes self-implementation results by Deng et al. (2021). Note that Hybrid training (Rathi et al., 2020) adopts ResNet-20 for CIFAR10 and VGG-11 for CIFAR100.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Methods</td><td>Architecture</td><td>Param (M)</td><td>Time Step</td><td>CIFAR10 Acc</td><td>CIFAR100 Acc</td></tr><tr><td rowspan="6">Hybrid training(Rathi et al.,2020) Diet-SNN(Rathi & Roy,2020) STBP(Wu et al.,2018) STBP NeuNorm(Wu et al., 2019) TSSL-BP(Zhang&Li,2020)</td><td>VGG-11</td><td>9.27</td><td>125</td><td>92.22</td><td>67.87</td></tr><tr><td>ResNet-20</td><td>0.27</td><td>10/5</td><td>92.54</td><td>64.07</td></tr><tr><td>CIFARNet</td><td>17.54</td><td>12</td><td>89.83</td><td>-</td></tr><tr><td>CIFARNet</td><td>17.54</td><td>12</td><td>90.53</td><td>-</td></tr><tr><td>CIFARNet</td><td>17.54</td><td>5</td><td>91.41</td><td>-</td></tr><tr><td>ResNet-19</td><td>12.63</td><td>4</td><td>92.92</td><td>70.86</td></tr><tr><td>TET(Deng et al.,2021)</td><td>ResNet-19</td><td>12.63</td><td>4</td><td>94.44</td><td>74.47</td></tr><tr><td rowspan="3">ANN</td><td>ResNet-19*</td><td>12.63</td><td>1</td><td>94.97</td><td>75.35</td></tr><tr><td>Transformer-4-384</td><td>9.32</td><td>1</td><td>96.73</td><td>81.02</td></tr><tr><td>Spikformer-4-256</td><td>4.15</td><td>4</td><td>93.94</td><td>75.96</td></tr><tr><td rowspan="4">Spikformer</td><td>Spikformer-2-384</td><td>5.76</td><td>4</td><td>94.80</td><td>76.95</td></tr><tr><td>Spikformer-4-384</td><td>9.32</td><td>4</td><td>95.19</td><td>77.86</td></tr><tr><td>Spikformer-4-384 400E</td><td>9.32</td><td>4</td><td>95.51</td><td>78.21</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 143 |
+
|
| 144 |
+
ANN $( 9 4 . 9 7 \% )$ ). The performance is improved as the dimensions or blocks increase. Specifically, Spikformer-4-384 improves by $1 . 2 5 \%$ compared to Spikformer-4-256 and improves by $0 . 3 9 \%$ compared to Spikformer-2-384. We also find that extending the number of training epochs to 400 can improve the performance (Spikformer-4-384 400E achieves $0 . 3 2 \%$ and $0 . 3 5 \%$ advance compared to Spikformer-4-384 on CIFAR10 and CIFAR100). The improvement of the proposed Spikformer on complex datasets such as CIFAR100 is even higher. Spikformer-4-384 $( 7 7 . 8 6 \%$ , 9.32M) obtains a significant improvement of $2 . 5 1 \%$ compared with ResNet-19 ANN $( 7 5 . 3 5 \%$ , 12.63M) model. The ANN-Transformer model is $1 . 5 4 \%$ and $3 . 1 6 \%$ higher than Spikformer-4-384, respectively. As shown in appendix D.5, transfer learning can achieve higher performance on CIFAR based on pre-trained Spikformer, which demonstrates high transfer ability.
|
| 145 |
+
|
| 146 |
+
# 4.2 NEUROMORPHIC DATASETS CLASSIFICATION
|
| 147 |
+
|
| 148 |
+
DVS128 Gesture is a gesture recognition dataset that contains 11 hand gesture categories from 29 individuals under 3 illumination conditions. CIFAR10-DVS is also a neuromorphic dataset converted from the static image dataset by shifting image samples to be captured by the DVS camera, which provides 9, 000 training samples and 1, 000 test samples.
|
| 149 |
+
|
| 150 |
+
For the above two datasets of image size $1 2 8 \times 1 2 8$ , we adopt a four-block SPS. The patch embedding dimension is 256 and the patch size is $1 6 \times 1 6$ . We use a shallow Spikformer with 2 transformer encoder blocks. The SSA contains 8 and 16 heads for DVS128 Gesture and CIFAR10-DVS, respectively. The time-step of the spiking neuron is 10 or 16. The training epoch is 200 for DVS128 Gesture and 106 for CIFAR10-DVS. The optimizer is AdamW and the batch size is set to 16. The learning rate is initialized to 0.1 and reduced with cosine decay. We apply data augmentation on CIFAR10-DVS according to (Li et al., 2022). We use a learnable parameter as the scaling factor to control the $Q K ^ { \mathrm { T } } V$ result.
|
| 151 |
+
|
| 152 |
+
The classification performance of Spikformer as well as the compared state-of-the-art models on neuromorphic datasets is shown in Tab. 4. It can be seen that our model achieves good performance on both datasets by using a 2.59M model. On DVS128 Gesture, we obtain an accuracy of $9 8 . 2 \%$ with 16-time steps, which is higher than SEW-ResNet $( 9 7 . 9 \% )$ ). Our result is also competitive compared with TA-SNN $( 9 8 . 6 \%$ , 60 time steps) (Yao et al., 2021) which uses floating-point spikes in the forward propagation. On CIFAR10-DVS, we achieve a $1 . 6 \%$ and $3 . 6 \%$ better accuracy than the SOTA methods DSR $( 7 7 . 3 \% )$ with binary spikes using 10 steps and 16 steps respectively. TET is not an architecture-based but a loss-based method which achieves $8 3 . 2 \%$ using long epochs (300) and 9.27M VGGSNN, so we do not compare with it in the table.
|
| 153 |
+
|
| 154 |
+
# 4.3 ABLATION STUDY
|
| 155 |
+
|
| 156 |
+
Time step The accuracy regarding different simulation time steps of the spike neuron is shown in Tab. 5. When the time step is 1, our method is $1 . 8 7 \%$ lower than the network with $T = 4$ on CIFAR10.
|
| 157 |
+
|
| 158 |
+
Table 4: Performance comparison to the state-of-the-art (SOTA) methods on two neuromorphic datasets. Bold font means the best; ∗ denotes with Data Augmentation.
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Spikes</td><td colspan="2">CIFAR10-DVS</td><td colspan="2">DVS128</td></tr><tr><td>T Step</td><td>Acc</td><td>T Step</td><td>Acc</td></tr><tr><td>LIAF-Net (Wu et al.,2021)TNNLs-2021</td><td>X</td><td>10</td><td>70.4</td><td>60</td><td>97.6</td></tr><tr><td>TA-SNN(Ya etal,2021)C02</td><td>×</td><td>10</td><td>72.0</td><td>60</td><td>98.6</td></tr><tr><td>Rollout (Kugeleetal.,)Fronteros</td><td>√</td><td>48</td><td>66.8</td><td>240</td><td>97.2</td></tr><tr><td>DECOLLE(Kaiser etal.,202O)Front eurosci-200</td><td>√</td><td>1</td><td>1</td><td>500</td><td>95.5</td></tr><tr><td>tdBN (Zheng et al.,2021)AAAl-2021</td><td>√</td><td>10</td><td>67.8</td><td>40</td><td>96.9</td></tr><tr><td>PLIF F(Fang et al.,2021b)ICCV-2021</td><td>√</td><td>20</td><td>74.8</td><td>20</td><td>97.6</td></tr><tr><td>SEW-ResNet (Fang et al.,2021a)NeurIPS-2021</td><td><</td><td>16</td><td>74.4</td><td>16</td><td>97.9</td></tr><tr><td>Dspike (Li etal.,2021)NeurIPS-2021</td><td>√</td><td>10</td><td>75.4*</td><td>1</td><td>-</td></tr><tr><td>SALT (Kim & Panda,2021)Neural Netw-2021</td><td>√</td><td>20</td><td>67.1</td><td>-</td><td>-</td></tr><tr><td>DSR (Meng et al.,2022)CVPR-2022</td><td>√</td><td>10</td><td>77.3*</td><td>-</td><td>1</td></tr><tr><td rowspan="2">Spikformer</td><td></td><td>10</td><td>78.9*</td><td>10</td><td>96.9</td></tr><tr><td>:</td><td>16</td><td>80.9*</td><td>16</td><td>98.3</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Spikformer-8-512 with 1 time step still achieves $7 0 . 1 4 \%$ . The above results show Spikformer is robust under low latency (fewer time steps) conditions.
|
| 163 |
+
|
| 164 |
+
SSA We conduct ablation studies on SSA to further identify its advantage. We first test its effect by replacing SSA with standard vanilla self-attention. We test two cases where Value is in floating point form (Spikformer-L- $. D _ { w }$ VSA $\mathrm { V } _ { \mathcal { F } }$ ) and in spike form (Spikformer- $L \mathrm { - } D _ { w }$ VSA).
|
| 165 |
+
|
| 166 |
+
We also test the different attention variants on ImageNet following Tab. 1. On CIFAR10, the performance of Spikformer with SSA is competitive compared to Spikformer- $4 \mathrm { - } 3 8 4 _ { w }$ VSA and even Spikformer- $4 { - } 3 8 4 _ { w }$ VSA $\mathrm { v } _ { \mathcal { F } }$ . On ImageNet, our Spikformer- $8 - 5 1 2 _ { w }$ SSA outperforms Spikformer- $8 - 5 1 2 _ { w }$ VSA by $\mathrm { { \bar { 0 } . 6 8 \% } }$ . On CIFAR100 and ImageNet, the accuracy of Spikformer- $L$ - $D _ { w }$ VSA $\mathrm { v } _ { \mathcal { F } }$ is better than Spikformer because of the float-point-form Value. The reason why the Spikformer$8 – 5 1 2 _ { w \mathrm { ~ I ~ } }$ , Spikformer- $8 – 5 1 2 _ { w }$ ReLU, and Spikformer- $\cdot 8 - 5 1 2 _ { w }$ LeakyReLU do
|
| 167 |
+
|
| 168 |
+
Table 5: Ablation study results on SSA, and time step.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Datasets</td><td>Models</td><td>Time Step</td><td>Topl-Acc (%)</td></tr><tr><td rowspan="2"></td><td>CIFAR10/100 Spikformer-4-384 sSA</td><td>1246</td><td>93.51/74.36 93.59/76.28 95.19/77.86 95.34/78.61</td></tr><tr><td>Spikformer-4-384w VSA Spikformer-4-384wVSAVF</td><td>4 4</td><td>94.97/77.92 95.17/78.37</td></tr><tr><td>ImageNet</td><td>Spikformer-8-512wI Spikformer-8-512w ReLU Spikformer-8-512wLeakyReLU Spikformer-8-512w VSA Spikformer-8-512w VSA VF</td><td>4 4 4 4 4</td><td>X X 72.70 73.96</td></tr></table>
|
| 171 |
+
|
| 172 |
+
not converge is that the value of dot-product value of Query, Key, and Value is large, which makes the surrogate gradient of the output spike neuron layer disappear. More details are in the appendix D.4. In comparison, the dot-product value of the designed SSA is in a controllable range, which is determined by the sparse spike-form $Q$ , $K$ and $V$ , and makes Spikformer $\dot { } _ { w }$ SSA easy to converge.
|
| 173 |
+
|
| 174 |
+
# 5 CONCLUSION
|
| 175 |
+
|
| 176 |
+
In this work we explored the feasibility of implementing the self-attention mechanism and Transformer in Spiking Neuron Networks and propose Spikformer based on a new Spiking Self-Attention (SSA). Unlike the vanilla self-attention mechanism in ANNs, SSA is specifically designed for SNNs and spike data. We drop the complex operation of softmax in SSA, and instead perform matrix dotproduct directly on spike-form Query, Key, and Value, which is efficient and avoids multiplications. In addition, this simple self-attention mechanism makes Spikformer work surprisingly well on both static and neuromorphic datasets. With directly training from scratch, Spiking Transformer outperforms the state-of-the-art SNNs models. We hope our investigations pave the way for further research on transformer-based SNNs models.
|
| 177 |
+
|
| 178 |
+
# REPRODUCIBILITY STATEMENT
|
| 179 |
+
|
| 180 |
+
Our codes are based on SpikingJelly(Fang et al., 2020), an open-source SNN framework, and Pytorch image models library (Timm)(Wightman, 2019). The experimental results in this paper are reproducible. We explain the details of model training and dataset augmentation in the main text and supplement it in the appendix. Our codes of Spikformer models are uploaded as supplementary material and will be available on GitHub after review.
|
| 181 |
+
|
| 182 |
+
# ACKNOWLEDGEMENTS
|
| 183 |
+
|
| 184 |
+
This work is supported by Nature Science Foundation of China (No.62202014 and No.62006007), Shenzhen Basic Research Program (No.JCYJ20220813151736001), and the National Innovation 2030 Major ST Project of China (No.2020AAA0104203).
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Arnon Amir, Brian Taba, David Berg, Timothy Melano, Jeffrey McKinstry, Carmelo Di Nolfo, Tapan Nayak, Alexander Andreopoulos, Guillaume Garreau, Marcela Mendoza, Jeff Kusnitz, Michael Debole, Steve Esser, Tobi Delbruck, Myron Flickner, and Dharmendra Modha. A low power, fully event-based gesture recognition system. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7243–7252, 2017.
|
| 189 |
+
|
| 190 |
+
Tong Bu, Wei Fang, Jianhao Ding, PengLin Dai, Zhaofei Yu, and Tiejun Huang. Optimal ann-snn conversion for high-accuracy and ultra-low-latency spiking neural networks. In International Conference on Learning Representations (ICLR), 2021.
|
| 191 |
+
|
| 192 |
+
Yongqiang Cao, Yang Chen, and Deepak Khosla. Spiking deep convolutional neural networks for energy-efficient object recognition. International Journal of Computer Vision, 113(1):54–66, 2015.
|
| 193 |
+
|
| 194 |
+
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 213–229. Springer, 2020.
|
| 195 |
+
|
| 196 |
+
Charlotte Caucheteux and Jean-Remi King. Brains and algorithms partially converge in natural ´ language processing. Communications biology, 5(1):1–10, 2022.
|
| 197 |
+
|
| 198 |
+
Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 12299–12310, 2021.
|
| 199 |
+
|
| 200 |
+
Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020.
|
| 201 |
+
|
| 202 |
+
Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Twins: Revisiting the design of spatial attention in vision transformers. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 34, pp. 9355–9366, 2021.
|
| 203 |
+
|
| 204 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 248–255, 2009.
|
| 205 |
+
|
| 206 |
+
Shikuang Deng, Yuhang Li, Shanghang Zhang, and Shi Gu. Temporal Efficient Training of Spiking Neural Network via Gradient Re-weighting. In International Conference on Learning Representations (ICLR), 2021.
|
| 207 |
+
|
| 208 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representa- tions (ICLR), 2020.
|
| 209 |
+
|
| 210 |
+
Wei Fang, Yanqi Chen, Jianhao Ding, Ding Chen, Zhaofei Yu, Huihui Zhou, Yonghong Tian, and other contributors. Spikingjelly. https://github.com/fangwei123456/spikingjelly, 2020. Accessed: YYYY-MM-DD.
|
| 211 |
+
|
| 212 |
+
Wei Fang, Zhaofei Yu, Yanqi Chen, Tiejun Huang, Timothee Masquelier, and Yonghong Tian. Deep ´ Residual Learning in Spiking Neural Networks. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 34, pp. 21056–21069, 2021a.
|
| 213 |
+
|
| 214 |
+
Wei Fang, Zhaofei Yu, Yanqi Chen, Timothee Masquelier, Tiejun Huang, and Yonghong Tian. ´ Incorporating learnable membrane time constant to enhance learning of spiking neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2661– 2671, 2021b.
|
| 215 |
+
|
| 216 |
+
Bing Han, Gopalakrishnan Srinivasan, and Kaushik Roy. Rmp-snn: Residual membrane potential neuron for enabling deeper high-accuracy and low-latency spiking neural network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 13558– 13567, 2020.
|
| 217 |
+
|
| 218 |
+
Ali Hassani, Steven Walton, Nikhil Shah, Abulikemu Abuduweili, Jiachen Li, and Humphrey Shi. Escaping the big data paradigm with compact transformers. arXiv preprint arXiv:2104.05704, 2021.
|
| 219 |
+
|
| 220 |
+
Mark Horowitz. 1.1 computing’s energy problem (and what we can do about it). In 2014 IEEE International Solid-State Circuits Conference Digest of Technical Papers (ISSCC), pp. 10–14. IEEE, 2014.
|
| 221 |
+
|
| 222 |
+
Yangfan Hu, Huajin Tang, and Gang Pan. Spiking deep residual networks. IEEE Transactions on Neural Networks and Learning Systems, pp. 1–6, 2021a. doi: 10.1109/TNNLS.2021.3119238.
|
| 223 |
+
|
| 224 |
+
Yifan Hu, Yujie Wu, Lei Deng, and Guoqi Li. Advancing residual learning towards powerful deep spiking neural networks. arXiv preprint arXiv:2112.08954, 2021b.
|
| 225 |
+
|
| 226 |
+
Eric Hunsberger and Chris Eliasmith. Spiking deep networks with lif neurons. arXiv preprint arXiv:1510.08829, 2015.
|
| 227 |
+
|
| 228 |
+
Jacques Kaiser, Hesham Mostafa, and Emre Neftci. Synaptic Plasticity Dynamics for Deep Continuous Local Learning (DECOLLE). Frontiers in Neuroscience, 14:424, 2020. doi: 10.3389/fnins.2020.00424.
|
| 229 |
+
|
| 230 |
+
Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Franc¸ois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In Proceedings of the 37th International Conference on Machine Learning (ICML), pp. 5156–5165, 2020.
|
| 231 |
+
|
| 232 |
+
Youngeun Kim and Priyadarshini Panda. Optimizing Deeper Spiking Neural Networks for Dynamic Vision Sensing. Neural Networks, 144:686–698, 2021.
|
| 233 |
+
|
| 234 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 235 |
+
|
| 236 |
+
Alexander Kugele, Thomas Pfeil, Michael Pfeiffer, and Elisabetta Chicca. Efficient Processing of Spatio-temporal Data Streams with Spiking Neural Networks. Frontiers in Neuroscience, 14:439, 2020.
|
| 237 |
+
|
| 238 |
+
Souvik Kundu, Gourav Datta, Massoud Pedram, and Peter A Beerel. Spike-thrift: Towards energyefficient deep spiking neural networks by limiting spiking activity via attention-guided compression. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp. 3953–3962, 2021a.
|
| 239 |
+
|
| 240 |
+
Souvik Kundu, Massoud Pedram, and Peter A Beerel. Hire-snn: Harnessing the inherent robustness of energy-efficient deep spiking neural networks by training with crafted input noise. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 5209–5218, 2021b.
|
| 241 |
+
|
| 242 |
+
Chankyu Lee, Syed Shakib Sarwar, Priyadarshini Panda, Gopalakrishnan Srinivasan, and Kaushik Roy. Enabling spike-based backpropagation for training deep neural network architectures. Frontiers in neuroscience, 14:119, 2020.
|
| 243 |
+
|
| 244 |
+
Jun Haeng Lee, Tobi Delbruck, and Michael Pfeiffer. Training deep spiking neural networks using backpropagation. Frontiers in neuroscience, 10:508, 2016.
|
| 245 |
+
|
| 246 |
+
Hongmin Li, Hanchao Liu, Xiangyang Ji, Guoqi Li, and Luping Shi. Cifar10-dvs: an event-stream dataset for object classification. Frontiers in neuroscience, 11:309, 2017.
|
| 247 |
+
|
| 248 |
+
Yuhang Li, Yufei Guo, Shanghang Zhang, Shikuang Deng, Yongqing Hai, and Shi Gu. Differentiable Spike: Rethinking Gradient-Descent for Training Spiking Neural Networks. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 34, pp. 23426–23439, 2021.
|
| 249 |
+
|
| 250 |
+
Yuhang Li, Youngeun Kim, Hyoungseob Park, Tamar Geller, and Priyadarshini Panda. Neuromorphic data augmentation for training spiking neural networks. arXiv preprint arXiv:2203.06145, 2022.
|
| 251 |
+
|
| 252 |
+
Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 10012–10022, 2021.
|
| 253 |
+
|
| 254 |
+
Ali Lotfi Rezaabad and Sriram Vishwanath. Long short-term memory spiking networks and their applications. In Proceedings of the International Conference on Neuromorphic Systems 2020 (ICONS), pp. 1–9, 2020.
|
| 255 |
+
|
| 256 |
+
Wolfgang Maass. Networks of spiking neurons: the third generation of neural network models. Neural networks, 10(9):1659–1671, 1997.
|
| 257 |
+
|
| 258 |
+
Qingyan Meng, Mingqing Xiao, Shen Yan, Yisen Wang, Zhouchen Lin, and Zhi-Quan Luo. Training High-Performance Low-Latency Spiking Neural Networks by Differentiation on Spike Representation. ArXiv preprint arXiv:2205.00459, 2022.
|
| 259 |
+
|
| 260 |
+
Paul A Merolla, John V Arthur, Rodrigo Alvarez-Icaza, Andrew S Cassidy, Jun Sawada, Filipp Akopyan, Bryan L Jackson, Nabil Imam, Chen Guo, Yutaka Nakamura, et al. A million spikingneuron integrated circuit with a scalable communication network and interface. Science, 345 (6197):668–673, 2014.
|
| 261 |
+
|
| 262 |
+
Etienne Mueller, Viktor Studenyak, Daniel Auge, and Alois Knoll. Spiking transformer networks: A rate coded approach for processing sequential data. In 2021 7th International Conference on Systems and Informatics (ICSAI), pp. 1–5. IEEE, 2021.
|
| 263 |
+
|
| 264 |
+
Emre O Neftci, Hesham Mostafa, and Friedemann Zenke. Surrogate gradient learning in spiking neural networks: Bringing the power of gradient-based optimization to spiking neural networks. IEEE Signal Processing Magazine, 36(6):51–63, 2019.
|
| 265 |
+
|
| 266 |
+
Priyadarshini Panda, Sai Aparna Aketi, and Kaushik Roy. Toward scalable, efficient, and accurate deep spiking neural networks with backward residual connections, stochastic softmax, and hybridization. Frontiers in Neuroscience, 14:653, 2020.
|
| 267 |
+
|
| 268 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 32, 2019.
|
| 269 |
+
|
| 270 |
+
Zhen Qin, Weixuan Sun, Hui Deng, Dongxu Li, Yunshen Wei, Baohong Lv, Junjie Yan, Lingpeng Kong, and Yiran Zhong. cosformer: Rethinking softmax in attention. arXiv preprint arXiv:2202.08791, 2022.
|
| 271 |
+
|
| 272 |
+
Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Dynamicvit: Efficient vision transformers with dynamic token sparsification. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 34, pp. 13937–13949, 2021.
|
| 273 |
+
|
| 274 |
+
Nitin Rathi and Kaushik Roy. Diet-snn: Direct input encoding with leakage and threshold optimization in deep spiking neural networks. arXiv preprint arXiv:2008.03658, 2020.
|
| 275 |
+
|
| 276 |
+
Nitin Rathi, Gopalakrishnan Srinivasan, Priyadarshini Panda, and Kaushik Roy. Enabling deep spiking neural networks with hybrid conversion and spike timing dependent backpropagation. arXiv preprint arXiv:2005.01807, 2020.
|
| 277 |
+
|
| 278 |
+
Kaushik Roy, Akhilesh Jaiswal, and Priyadarshini Panda. Towards spike-based machine intelligence with neuromorphic computing. Nature, 575(7784):607–617, 2019.
|
| 279 |
+
|
| 280 |
+
Bodo Rueckauer, Iulia-Alexandra Lungu, Yuhuang Hu, Michael Pfeiffer, and Shih-Chii Liu. Conversion of continuous-valued deep networks to efficient event-driven networks for image classification. Frontiers in neuroscience, 11:682, 2017.
|
| 281 |
+
|
| 282 |
+
Sumit B Shrestha and Garrick Orchard. Slayer: Spike layer error reassignment in time. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 31, 2018.
|
| 283 |
+
|
| 284 |
+
Jeong-geun Song. Ufo-vit: High performance linear vision transformer without softmax. arXiv preprint arXiv:2109.14382, 2021.
|
| 285 |
+
|
| 286 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 30, 2017.
|
| 287 |
+
|
| 288 |
+
Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 568–578, 2021.
|
| 289 |
+
|
| 290 |
+
Yuchen Wang, Malu Zhang, Yi Chen, and Hong Qu. Signed neuron with memory: Towards simple, accurate and high-efficient ann-snn conversion. In International Joint Conference on Artificial Intelligence, 2022.
|
| 291 |
+
|
| 292 |
+
James C. R. Whittington, Joseph Warren, and Tim E.J. Behrens. Relating transformers to models and neural representations of the hippocampal formation. In International Conference on Learning Representations (ICLR), 2022. URL https://openreview.net/forum?id $=$ B8DVo9B1YE0.
|
| 293 |
+
|
| 294 |
+
Ross Wightman. Pytorch image models. https://github.com/rwightman/ pytorch-image-models, 2019.
|
| 295 |
+
|
| 296 |
+
Yujie Wu, Lei Deng, Guoqi Li, Jun Zhu, and Luping Shi. Spatio-temporal backpropagation for training high-performance spiking neural networks. Frontiers in neuroscience, 12:331, 2018.
|
| 297 |
+
|
| 298 |
+
Yujie Wu, Lei Deng, Guoqi Li, Jun Zhu, Yuan Xie, and Luping Shi. Direct Training for Spiking Neural Networks: Faster, Larger, Better. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), pp. 1311–1318, 2019. doi: 10.1609/aaai.v33i01.33011311.
|
| 299 |
+
|
| 300 |
+
Zhenzhi Wu, Hehui Zhang, Yihan Lin, Guoqi Li, Meng Wang, and Ye Tang. LIAF-Net: Leaky Integrate and Analog Fire Network for Lightweight and Efficient Spatiotemporal Information Processing. IEEE Transactions on Neural Networks and Learning Systems, pp. 1–14, 2021. doi: 10.1109/TNNLS.2021.3073016.
|
| 301 |
+
|
| 302 |
+
Mingqing Xiao, Qingyan Meng, Zongpeng Zhang, Yisen Wang, and Zhouchen Lin. Training feedback spiking neural networks by implicit differentiation on the equilibrium state. volume 34, pp. 14516–14528, 2021a.
|
| 303 |
+
|
| 304 |
+
Tete Xiao, Mannat Singh, Eric Mintun, Trevor Darrell, Piotr Dollar, and Ross Girshick. Early ´ convolutions help transformers see better. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 34, pp. 30392–30400, 2021b.
|
| 305 |
+
|
| 306 |
+
Jianwei Yang, Chunyuan Li, Pengchuan Zhang, Xiyang Dai, Bin Xiao, Lu Yuan, and Jianfeng Gao. Focal attention for long-range interactions in vision transformers. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 34, pp. 30008–30022, 2021.
|
| 307 |
+
|
| 308 |
+
Man Yao, Huanhuan Gao, Guangshe Zhao, Dingheng Wang, Yihan Lin, Zhaoxu Yang, and Guoqi Li. Temporal-wise attention spiking neural networks for event streams classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 10221–10230, 2021.
|
| 309 |
+
|
| 310 |
+
Man Yao, Guangshe Zhao, Hengyu Zhang, Yifan Hu, Lei Deng, Yonghong Tian, Bo Xu, and Guoqi Li. Attention spiking neural networks. arXiv preprint arXiv:2209.13929, 2022.
|
| 311 |
+
|
| 312 |
+
Bojian Yin, Federico Corradi, and Sander M Bohte. Accurate and efficient time-domain classification ´ with adaptive spiking recurrent neural networks. Nature Machine Intelligence, 3(10):905–913, 2021.
|
| 313 |
+
|
| 314 |
+
Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Zi-Hang Jiang, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 558–567, 2021a.
|
| 315 |
+
|
| 316 |
+
Li Yuan, Qibin Hou, Zihang Jiang, Jiashi Feng, and Shuicheng Yan. Volo: Vision outlooker for visual recognition. arXiv preprint arXiv:2106.13112, 2021b.
|
| 317 |
+
|
| 318 |
+
Jiqing Zhang, Bo Dong, Haiwei Zhang, Jianchuan Ding, Felix Heide, Baocai Yin, and Xin Yang. Spiking transformers for event-based single object tracking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8801–8810, 2022a.
|
| 319 |
+
|
| 320 |
+
Jiyuan Zhang, Lulu Tang, Zhaofei Yu, Jiwen Lu, and Tiejun Huang. Spike transformer: Monocular depth estimation for spiking camera. In Proceedings of the European Conference on Computer Vision (ECCV), 2022b.
|
| 321 |
+
|
| 322 |
+
Wenrui Zhang and Peng Li. Temporal spike sequence learning via backpropagation for deep spiking neural networks. In Proceedings of the International Conference on Neural Information Processing Systems (NeurIPS), volume 33, pp. 12022–12033, 2020.
|
| 323 |
+
|
| 324 |
+
Hanle Zheng, Yujie Wu, Lei Deng, Yifan Hu, and Guoqi Li. Going Deeper With Directly-Trained Larger Spiking Neural Networks. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), pp. 11062–11070, 2021.
|
| 325 |
+
|
| 326 |
+
Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
|
| 327 |
+
|
| 328 |
+
Zulun Zhu, Jiaying Peng, Jintang Li, Liang Chen, Qi Yu, and Siqiang Luo. Spiking graph convolutional networks. In Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence (IJCAI), pp. 2434–2440, 2022. doi: 10.24963/ijcai.2022/338.
|
| 329 |
+
|
| 330 |
+
# APPENDIX
|
| 331 |
+
|
| 332 |
+
# A MULTIHEAD SPIKING SELF ATTENTION
|
| 333 |
+
|
| 334 |
+
In practice, we reshape the $Q , K , V \in \mathbb { R } ^ { T \times N \times D }$ into multi-head form $\mathbb { R } ^ { T \times H \times N \times d }$ , where $D =$ $H \times d$ . Then we split $Q , K , V$ into $H$ parts and run $H$ SSA operations, in parallel, which are called $H$ -head SSA. The Multihead Spiking Self Attention (MSSA) is shown in follows:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
Q = ( q _ { 1 } , q _ { 2 } , \cdots , q _ { H } ) , K = ( k _ { 1 } , k _ { 2 } , \cdots , k _ { H } ) , V = ( v _ { 1 } , v _ { 2 } , \cdots , v _ { H } ) \quad q , k , v \in \mathbb { R } ^ { T \times N \times d }
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\mathrm { M S S A } ^ { \prime } ( Q , K , V ) = [ \mathrm { S S A } _ { 1 } ^ { \prime } ( q _ { 1 } , k _ { 1 } , v _ { 1 } ) ; \mathrm { S S A } _ { 2 } ^ { \prime } ( q _ { 2 } , k _ { 2 } , v _ { 2 } ) ; \cdots ; \mathrm { S S A } _ { h } ^ { \prime } ( q _ { H } , k _ { H } , v _ { H } ) ]
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\mathrm { M S S A } ( Q , K , V ) = \mathcal { S } \mathcal { N } ( \mathrm { B N } ( \mathrm { L i n e a r } ( \mathrm { M S S A } ^ { \prime } ( Q , K , V ) ) ) )
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
# B SPIKING SELF ATTENTION AND TIME STEP
|
| 349 |
+
|
| 350 |
+
In practice, $T$ is a independent dimension for spike neuron layer. In other layers, it is merged with the batch size.
|
| 351 |
+
|
| 352 |
+
# C EXPERIMENT DETAILS
|
| 353 |
+
|
| 354 |
+
# C.1 TRAINING
|
| 355 |
+
|
| 356 |
+
Unlike the standard ViT, Dropout and Droppath are not applied in Spikformer. We remove the layer norm before each self-attention and MLP block, and add batch norm after each linear layer instead. In all Spikformer models, the hidden dimension of MLP blocks is $4 \times D$ , where $D$ is the embedding dimension. As in Eq. (20), we select the Sigmoid function as the surrogate function with $\alpha = 4$ .
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
{ \mathrm { S i g m o i d } } ( x ) = { \frac { 1 } { 1 + \exp \left( - \alpha x \right) } }
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
For DVS128 Gesture, we place a 1D max-pooling layer after $Q$ and $K$ to increase the density of the data, which improves the accuracy from $9 7 . 9 \%$ to $9 8 . 3 \%$ in 16 time steps. We set the threshold voltage $V _ { t h }$ of the spike neuron layer after $Q K ^ { \mathrm { T } } V * s$ to 0.5, while the others are set to 1.
|
| 363 |
+
|
| 364 |
+
# C.2 THEORETICAL SYNAPTIC OPERATION AND ENERGY CONSUMPTION CALCULATION
|
| 365 |
+
|
| 366 |
+
The calculation of theoretical energy consumption requires first calculating the synaptic operations:
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\mathrm { S O P s } ( { l } ) = f r \times T \times \mathrm { F L O P s } ( { l } )
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
where $l$ is a block/layer in Spikformer, $f r$ is the firing rate of the input spike train of the block/layer and $T$ is the simulation time step of spike neuron. $\mathrm { F L O P s } ( l )$ refers to floating point operations of $l$ , which is the number of multiply-and-accumulate (MAC) operations. And SOPs is the number of spike-based accumulate (AC) operations. We estimate the theoretical energy consumption of Spikformer according to (Kundu et al., 2021b; Hu et al., 2021b; Horowitz, 2014; Kundu et al., 2021a; Yin et al., 2021; Panda et al., 2020; Yao et al., 2022). We assume that the MAC and AC operations are implemented on the $4 5 \mathrm { n m }$ hardware [12], where $E _ { M A C } = 4 . 6 p J$ and $E _ { A C } = 0 . 9 p J$ . The theoretical energy consumption of Spikformer is calculated:
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array} { l } { { \displaystyle E _ { S p i k f o r m e r } = E _ { M A C } \times { \mathrm { F L } } _ { \mathrm { S N N ~ C o n v } } ^ { 1 } } } \\ { { \displaystyle \phantom { \sum } + E _ { A C } \times \left( \sum _ { n = 2 } ^ { N } \mathrm { S O P } _ { \mathrm { S N N ~ C o n v } } ^ { n } + \sum _ { m = 1 } ^ { M } \mathrm { S O P } _ { \mathrm { S N N ~ F C } } ^ { m } + \sum _ { l = 1 } ^ { L } \mathrm { S O P } _ { \mathrm { S S A } } ^ { l } \right) } } \end{array}
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
where $\mathrm { F L } _ { S N N \ C o n v } ^ { 1 }$ is the first layer to encode static RGB images into spike-form. Then the SOPs of $m$ SNN Conv layers, $n$ SNN Fully Connected Layer (FC) and $l$ SSA are added together and multiplied by $E _ { A C }$ . For ANNs, the theoretical energy consumption of block $b$ is calculated:
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\mathrm { P o w e r } ( b ) = 4 . 6 p J \times \mathrm { F L O P s } ( b )
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
For SNNs, Power $( b )$ is:
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\mathrm { P o w e r } ( b ) = 0 . 9 p J \times \mathrm { S O P s } ( b )
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Figure 4: Fire rate of Query, Key and Value of blocks in Spikformer-8-512 on ImageNet test set.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 5: Training loss, testing loss and test accuracy on ImageNet.
|
| 395 |
+
|
| 396 |
+
# D ADDITIONAL RESULTS
|
| 397 |
+
|
| 398 |
+
D.1 FIRE RATE OF QUERY, KEY AND VALUE
|
| 399 |
+
|
| 400 |
+
As shown in 4, the Query, Key and Value are very spare in SSA, causing sparse computation of SSA.
|
| 401 |
+
|
| 402 |
+
# D.2 LOSS AND ACCURACY ON IMAGENET
|
| 403 |
+
|
| 404 |
+
We show the training loss, testing loss and test accuracy of Spikformer in Figue. 5. Both training and testing losses decrease as the number of Spikformer blocks increases or the embedding dimension increases.
|
| 405 |
+
|
| 406 |
+
Table 6: Additional result on CIFAR10/100. Spikformer- $4 - 3 8 4 _ { w }$ IF uses the Integrate-and-Fire neuron.
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Models</td><td>Time Step</td><td>Top1-Acc (%)</td></tr><tr><td>Spikformer-4-384w I</td><td>1</td><td>92.39/74.28</td></tr><tr><td>Spikformer-4-384w ReLU</td><td>1</td><td>92.98/74.32</td></tr><tr><td>Spikformer-4-384w LeakyReLU</td><td>1</td><td>92.88/74.31</td></tr><tr><td>Spikformer-4-384w VSA</td><td>1</td><td>93.11/74.37</td></tr><tr><td>Spikformer-4-384w IF</td><td>4</td><td>95.33/78.14</td></tr></table>
|
| 409 |
+
|
| 410 |
+
Table 7: Transfer Learning on CIFAR10/100.
|
| 411 |
+
|
| 412 |
+
<table><tr><td>Models</td><td>CIFAR10</td><td>CIFAR100</td></tr><tr><td>Spikformer-4-384</td><td>95.54</td><td>79.96</td></tr><tr><td>Spikformer-8-384</td><td>96.64</td><td>82.09</td></tr><tr><td>Spikformer-8-512</td><td>97.03</td><td>83.83</td></tr></table>
|
| 413 |
+
|
| 414 |
+
# D.3 ADDITIONAL ACCURACY RESULTS ON CIFAR
|
| 415 |
+
|
| 416 |
+
We conduct additional experiments on CIFAR as shown in Tab. 6.
|
| 417 |
+
|
| 418 |
+
# D.4 ANALYSIS OF SELF-ATTENTION VARIANTS NOT CONVERGING ON IMAGENET
|
| 419 |
+
|
| 420 |
+
The reason that the three models do not converge in Tab. 5 is explain as follows. As shown in Figure. 6 (a), the gradient of sigmoid surrogate function vanishes when the difference between the average input value $V _ { i }$ and the firing threshold $V _ { t h }$ is too large or too small. We collect the output value of $\Dot { Q } K ^ { \mathrm { T } } V * s$ after one training eopch of Spikformer- $8 – 5 1 2 _ { w \mathrm { ~ I ~ } }$ , Spikformer- $8 - 5 1 2 _ { w }$ ReLU, Spikformer- $8 – 5 1 2 _ { w }$ LeakyReLU, and Spikformer- $8 - 5 1 2 _ { w }$ SSA, which will be sent to the spike neuron layer as the input value $V _ { i }$ , as shown in Eq. (15). Compared to the other three variants, as shown in Figure. 6 (b), the value of $Q K ^ { \mathrm { T } } V * s$ in Spikformer- $8 – 5 1 2 _ { w }$ SSA is controlled in a suitable range. Therefore, SSA has stable surrogate gradients during training and converges easily.
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
Figure 6: (a) the sigmoid surrogate function and its gradient curve. (b) the value of $Q K ^ { \mathrm { T } } V$
|
| 424 |
+
|
| 425 |
+
# D.5 TRANSFER LEARNING
|
| 426 |
+
|
| 427 |
+
We transfer Spikformer to the downstream CIFAR dataset. The pre-trained Spikformer-4-384 and Spikformer-8-384/512 on ImageNet are finetuned with 60 epochs. The input size of CIFAR is $2 2 4 \times 2 2 4$ . The remaining hyperparameters are the same as the ones directly trained on CIFAR. As shown in Tab. 7, Spikformer shows high transfer ability.
|
parse/dev/frE4fUwz_h/frE4fUwz_h_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/frE4fUwz_h/frE4fUwz_h_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Diffusion models as plug-and-play priors
|
| 2 |
+
|
| 3 |
+
Alexandros Graikos Stony Brook University Stony Brook, NY agraikos@cs.stonybrook.edu
|
| 4 |
+
|
| 5 |
+
Nikolay Malkin
|
| 6 |
+
Mila, Université de Montréal Montréal, QC, Canada
|
| 7 |
+
nikolay.malkin@mila.quebec
|
| 8 |
+
Nebojsa Jojic
|
| 9 |
+
Microsoft Research
|
| 10 |
+
Redmond, WA
|
| 11 |
+
jojic@microsoft.com
|
| 12 |
+
|
| 13 |
+
Dimitris Samaras Stony Brook University Stony Brook, NY samaras@cs.stonybrook.edu
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
We consider the problem of inferring high-dimensional data $\mathbf { x }$ in a model that consists of a prior $p ( \mathbf { x } )$ and an auxiliary differentiable constraint $c ( \mathbf { x } , \mathbf { y } )$ on $\mathbf { x }$ given some additional information $\mathbf { y }$ . In this paper, the prior is an independently trained denoising diffusion generative model. The auxiliary constraint is expected to have a differentiable form, but can come from diverse sources. The possibility of such inference turns diffusion models into plug-and-play modules, thereby allowing a range of potential applications in adapting models to new domains and tasks, such as conditional generation or image segmentation. The structure of diffusion models allows us to perform approximate inference by iterating differentiation through the fixed denoising network enriched with different amounts of noise at each step. Considering many noised versions of x in evaluation of its fitness is a novel search mechanism that may lead to new algorithms for solving combinatorial optimization problems. The code is available at https://github.com/AlexGraikos/diffusion_priors.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Deep generative models, such as denoising diffusion probabilistic models [DDPMs; 39, 13] can capture the details of very complex distributions over high-dimensional continuous data $p ( \mathbf { x } )$ [30, 7, 1, 38, 43, 15]. The immense effective depth of DDPMs, sometimes with thousands of deep network evaluations in the generation process, is an apparent limitation on their use as off-the-shelf modules in hierarchical generative models, where models can be mixed and one model may serve as a prior for another conditional model. In this paper, we show that DDPMs trained on image data can be directly used as priors in systems that involve other differentiable constraints.
|
| 22 |
+
|
| 23 |
+
In our main problem setting, we assume that we have a prior $p ( \mathbf { x } )$ over high-dimensional data $\mathbf { x }$ and we wish to perform inference in a model that involves this prior and a constraint $c ( \mathbf { x } , \mathbf { y } )$ on $\mathbf { x }$ given some additional information y. That is, we want to find an approximation to the posterior distribution $p ( \mathbf x | \mathbf y ) \propto p ( \mathbf x ) c ( \mathbf x , \mathbf y )$ . In this paper, $p ( \mathbf { x } = \mathbf { x } _ { 0 } , \mathbf { h } = \{ \mathbf { x } _ { T } , . . . , \mathbf { x } _ { 1 } \} )$ is provided in the form of an independently trained DDPM over $\mathbf { x } _ { T } , \ldots , \mathbf { x } _ { 0 }$ (§2.2), making the DDPM a ‘plug-and-play’ prior.
|
| 24 |
+
|
| 25 |
+
Although the recent community interest in DDPMs has spurred progress in training algorithms and fast generation schedules [30, 37, 45], the possibility of their use as plug-and-play modules has not been explored. Furthermore, as opposed to existing work on plug-and-play models (starting from [29]), the algorithms we propose do not require additional training or finetuning of model components or inference networks.
|
| 26 |
+
|
| 27 |
+
One obvious application of plug-and-play priors is conditional image generation $( \ S 3 . 1 , \ S 3 . 2 )$ . For example, a denoising diffusion model trained on MNIST digit images might define $p ( \mathbf { x } )$ , while the constraint $c ( \mathbf { x } , \mathbf { y } )$ may be be the probability of digit class y under an off-the-shelf classifier. However, changing the semantics of $\mathbf { x }$ , we can also use such models for inference tasks where neural networks struggle with domain adaptation, such as image segmentation: $c ( \mathbf { x } , \mathbf { y } )$ constrains the segmentation $\mathbf { x }$ to match an appearance or a weak labeling y (§4). Finally, we describe a path towards using DDPM priors to solve continuous relaxations of combinatorial search problems by treating $\mathbf { y }$ as a latent variable with combinatorial structure that is deterministically encoded in $\mathbf { x }$ (§5).
|
| 28 |
+
|
| 29 |
+
# 1.1 Related work
|
| 30 |
+
|
| 31 |
+
Conditioning DDPMs. DDPMs have previously been used for conditional generation and image segmentation [36, 42, 1]. With few exceptions – such as [3], which uses a pretrained DDPM as a feature extractor – these algorithms assume access to paired data and conditioning information during training of the DDPM model. In [7], a classifier $p ( y \mid \mathbf { x } _ { t } )$ that guides the denoising model towards the desired subset of images with the attribute $y$ is trained in parallel with the denoiser. In [5], generation is conditioned on an auxiliary image by guiding the denoising process through correction steps that match the low-frequency components of the generated and conditioning images. In contrast, we aim to build models that combine an independently trained DDPM with an auxiliary constraint.
|
| 32 |
+
|
| 33 |
+
Our approach is also related to work on adversarial examples. Adversarial samples are produced by optimizing an image x to satisfy a desired constraint $c - { \mathrm { a } }$ classifier $p ( \mathbf { y } \vert \mathbf { x } )$ – without reference to the prior over data. As supervised learning algorithms can ignore the structure in data $\mathbf { x }$ , focusing only on the conditional distribution, it is possible to optimize for input $\mathbf { x }$ that provides the desired classification in various surprising ways [41]. In [31], a diffusion model is used to defend from adversarial samples by making images more likely under a DDPM $p ( \mathbf { x } )$ . We are instead interested in inference, where we seek samples $\mathbf { x }$ that satisfy both the classifier and the prior. (Our work may, however, have consequences for adversarial generation.)
|
| 34 |
+
|
| 35 |
+
Conditional generation from unconditional models. Works that preceded the recent popularity of DDPMs [29, 9] show how an unconditional generative model, such as a generative adversarial network [GAN; 11] or variational autoencoder [VAE; 21], can be combined with a constraint model to generate conditional samples. Regarding generative diffusion models, recent literature has focused on utilizing unconditional, pretrained DDPMs as priors to solve linear inverse imaging problems. Both in [40] and [20], the authors modify the DDPM sampling algorithm, with knowledge of the linear degradation operator, to reconstruct an image consistent with the learned prior and given measurements. A generalization of these methods in [18] shows how any pretrained denoising network can be used as the prior for solving linear inverse problems. We also clarify that although the term ‘plug-and-play’ is widely used in the inverse imaging literature we refer to it in the scope of in-domain generation under differentiable constraints, in the same sense as [29].
|
| 36 |
+
|
| 37 |
+
Latent vectors in DDPMs. Modeling the latent prior distribution in VAE-like models using a DDPM has been studied in [38, 43]. On the other hand, in $\ S 5$ , we perform inference in the lowdimensional latent space under a pretrained DDPM on a high-dimensional data space. Our approach to semantic segmentation $( \ S 4 )$ is also related to [34], where a prior $p ( \mathbf { z } )$ over latents is used to tune a posterior network $q ( \mathbf { z } | \mathbf { x } )$ . There, the priors are of relatively simple structure and are sample-specific, rather than global diffusion priors like in this paper.
|
| 38 |
+
|
| 39 |
+
# 2 Method
|
| 40 |
+
|
| 41 |
+
# 2.1 Problem setting
|
| 42 |
+
|
| 43 |
+
Recall that we want to find an approximation to the posterior distribution $p ( \mathbf { x } | \mathbf { y } ) \propto p ( \mathbf { x } ) c ( \mathbf { x } , \mathbf { y } )$ , where $p ( \mathbf { x } )$ is a fixed prior distribution. Fixing $\mathbf { y }$ and introducing an approximate variational posterior $q ( \mathbf { x } )$ , the free energy
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
F = - \mathbb { E } _ { q ( \mathbf { x } ) } [ \log p ( \mathbf { x } ) + \log c ( \mathbf { x } , \mathbf { y } ) - \log q ( \mathbf { x } ) ]
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
is minimized when $q ( \mathbf { x } )$ is closest to the true posterior, i.e., when $\mathrm { K L } ( q ( \mathbf { x } ) \| p ( \mathbf { x } | \mathbf { y } ) )$ is minimized. When $q ( \mathbf { x } )$ , and the learning algorithm used to fit it, are expressive enough to capture the true posterior, this minimization yields the exact posterior $p ( \mathbf { x } | \mathbf { y } )$ . Otherwise, $q$ will capture a ‘modeseeking’ approximation to the true posterior [27]; in particular, if $q ( \mathbf { y } )$ is a Dirac delta, it is optimal to concentrate $q$ at the mode of $p ( \mathbf { x } | \mathbf { y } )$ . When the prior involves latent variables $\mathbf { h }$ (i.e., $p ( \mathbf { x } ) =$ $\begin{array} { r l r } { \int _ { \mathbf { h } } p ( \mathbf { x } | \mathbf { h } ) p ( \mathbf { h } ) \bar { d } \mathbf { h } ) } \end{array}$ , the free energy is
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r l } & { F = - \mathbb { E } _ { q ( \mathbf { x } ) q ( \mathbf { h } | \mathbf { x } ) } [ \log p ( \mathbf { x } , \mathbf { h } ) + \log c ( \mathbf { x } , \mathbf { y } ) - \log q ( \mathbf { x } ) q ( \mathbf { h } | \mathbf { x } ) ] } \\ & { \quad = - \mathbb { E } _ { q ( \mathbf { x } ) q ( \mathbf { h } | \mathbf { x } ) } [ \log p ( \mathbf { x } , \mathbf { h } ) - \log q ( \mathbf { x } ) q ( \mathbf { h } | \mathbf { x } ) ] - \mathbb { E } _ { q ( \mathbf { x } ) } [ \log c ( \mathbf { x } , \mathbf { y } ) ] . } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
We are, in particular, interested in a general procedure for minimizing $F$ with respect to an approximate posterior $q ( \mathbf { x } )$ for any differentiable $c$ when $p$ is a DDPM $( \ S 2 . 2 )$ .
|
| 56 |
+
|
| 57 |
+
A free energy of the same structure was also studied in [43], where a DDPM $p ( \mathbf { z } )$ over a latent space is hybridized as a parent to a decoder $p ( \mathbf { x } | \mathbf { z } )$ , with an additional inference model $q ( \mathbf { z } | \mathbf { x } )$ trained jointly with both of these models. On the other hand, we aim to work with independently trained components that operate directly in the pixel space, e.g., an off-the-shelf diffusion model $p ( \mathbf { x } )$ trained on images of faces and an off-the-shelf face classifier $p ( \mathbf { y } \vert \mathbf { x } )$ , without training or finetuning them jointly (§3.2).
|
| 58 |
+
|
| 59 |
+
# 2.2 Denoising diffusion probabilistic models as priors
|
| 60 |
+
|
| 61 |
+
Denoising diffusion probabilistic models (DDPMs) [39, 13] generate samples $\mathbf { x } _ { \mathrm { 0 } }$ by reversing a (Gaussian) noising process. DDPMs are deep directed stochastic networks:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { r l } { p ( { \mathbf x } _ { T } , { \mathbf x } _ { T - 1 } , . . . , { \mathbf x } _ { 0 } ) = p ( { \mathbf x } _ { T } ) \displaystyle \prod _ { t = 1 } ^ { T } p _ { \theta } ( { \mathbf x } _ { t - 1 } \mid { \mathbf x } _ { t } ) , } & { } \\ { p _ { \theta } ( { \mathbf x } _ { t - 1 } \mid { \mathbf x } _ { t } ) = \mathcal { N } ( { \mathbf x } _ { t - 1 } ; \mu _ { \theta } ( { \mathbf x } _ { t } , t ) , { \boldsymbol \Sigma } _ { \theta } ( { \mathbf x } _ { t } , t ) ) , \qquad } & { p ( { \mathbf x } _ { T } ) = \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) , } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\mu _ { \theta }$ and $\Sigma _ { \theta }$ are neural networks with learned parameters (often, as in this paper, $\Sigma _ { \theta }$ is fixed to a scalar diagonal matrix depending on $t$ ). The model starts with a sample from a unit Gaussian $\mathbf { x } _ { T }$ and successively transforms it with a nonlinear network $\mu _ { \theta } ( \mathbf { x } _ { t } , t )$ adding a small Gaussian innovation signal at each step according to a noise schedule. After $T$ steps, the sample $\mathbf { x } = \mathbf { x } _ { 0 }$ is obtained.
|
| 68 |
+
|
| 69 |
+
In general, using such a model as a prior over $\mathbf { x }$ would require an intractable integration over latent variables $\mathbf { h } = ( \mathbf { x } _ { T } , . . . , \mathbf { x } _ { 1 } )$ :
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
p ( \mathbf { x } ) = \int _ { \mathbf { h } } p ( \mathbf { x } _ { T } , \mathbf { x } _ { T - 1 } , . . . , \mathbf { x } _ { 1 } , \mathbf { x } _ { 0 } = \mathbf { x } ) d \mathbf { x } _ { T } \cdot . . . d \mathbf { x } _ { 1 } .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
However, DDPMs are trained under the assumption that the posterior $q \big ( \mathbf { x } _ { t } | \mathbf { x } _ { t - 1 } \big )$ is a simple diffusion process that successively adds Gaussian noise according to a predefined schedule $\beta _ { t }$ :
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
q ( \mathbf { x } _ { t } \mid \mathbf { x } _ { t - 1 } ) = { \mathcal { N } } ( \mathbf { x } _ { t } ; { \sqrt { 1 - { \beta _ { t } } } } \mathbf { x } _ { t - 1 } , \beta _ { t } \mathbf { I } ) , \quad t = 1 , \ldots , T .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Therefore, if $p ( \mathbf { x } )$ is the likelihood (5) of $\mathbf { x }$ under a DDPM, then in the first expectation of (2) we should use $q ( \mathbf { h } = \{ \mathbf { x } _ { T } , . . . , \mathbf { x } _ { 1 } \} | \mathbf { x } _ { 0 } = \mathbf { x } ) = \prod _ { t = 1 } ^ { T } q ( \mathbf { x } _ { t } \mid \mathbf { x } _ { t - 1 } )$ . The simplest approximation to the posterior over $\mathbf { x } = \mathbf { x } _ { 0 }$ is a point estimate:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
q ( \mathbf { x } ) = \delta ( \mathbf { x } - \pmb { \eta } )
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where by $\delta$ we denote the Dirac delta function. Thus, we can sample $\mathbf { x } _ { t }$ at any arbitrary time step using the forward noising process as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { q ( \mathbf { x } _ { t } ) = \mathcal { N } ( \mathbf { x } _ { t } ; \sqrt { \bar { \alpha } _ { t } } \pmb { \eta } , ( 1 - \bar { \alpha } _ { t } ) \mathbf { I } ) } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\alpha _ { t } = 1 - \beta _ { t }$ and $\textstyle { \bar { \alpha } } _ { t } = \prod _ { i = 1 } ^ { t } \alpha _ { t }$ . Analogously to [13], we can also extract a conditional Gaussian $q ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \pmb { \eta } )$ and express the first expectation in (2) as
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
- \mathbb { E } _ { q ( \mathbf { x } ) q ( \mathbf { h } \mid \mathbf { x } ) } [ \log p ( \mathbf { x } , \mathbf { h } ) - \log q ( \mathbf { x } ) q ( \mathbf { h } \mid \mathbf { x } ) ] = \sum _ { t } { \mathrm { K L } } ( q ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \eta ) \parallel p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } ) ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
which after reparametrization [13] leads to
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\sum _ { t } w _ { t } ( \beta ) \mathbb { E } _ { \epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) } [ \| \epsilon - \epsilon _ { \theta } ( \mathbf { x } _ { t } , t ) \| _ { 2 } ^ { 2 } ] , \quad \mathbf { x } _ { t } = \sqrt { \bar { \alpha } _ { t } } \eta + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Algorithm 1 Inferring a point estimate of $p ( \mathbf { x } | \mathbf { y } ) \approx \delta ( \mathbf { x } - \pmb { \eta } )$ , under a DDPM prior and constraint.
|
| 106 |
+
|
| 107 |
+
input pretrained DDPM $\epsilon _ { \theta }$ , auxiliary data $\mathbf { y }$ , constraint $c$ , time schedule $( t _ { i } ) _ { i = 1 } ^ { T }$ , learning rate $\lambda$ 1: Initialize $\mathbf { x } \sim \mathcal { N } ( \mathbf { 0 ; I } )$ .
|
| 108 |
+
|
| 109 |
+
2: for $i = T . . 1$ do
|
| 110 |
+
3: Sample $\mathbf { \epsilon } \epsilon \sim \mathcal { N } ( \mathbf { 0 ; I } )$
|
| 111 |
+
4: $\mathbf { x } _ { t _ { i } } = \sqrt { \bar { \alpha } _ { t _ { i } } } \mathbf { x } + \sqrt { 1 - \bar { \alpha } _ { t _ { i } } } \epsilon$
|
| 112 |
+
5: $\mathbf { x } \mathbf { x } - \lambda \nabla _ { \mathbf { x } } [ \| \epsilon - \epsilon _ { \theta } ( \mathbf { x } _ { t _ { i } } , t _ { i } ) \| _ { 2 } ^ { 2 } - \log c ( \mathbf { x } , \mathbf { y } ) ]$
|
| 113 |
+
6: end for
|
| 114 |
+
|
| 115 |
+
output $\mathbf { \eta } _ { \eta } = \mathbf { x }$
|
| 116 |
+
|
| 117 |
+
where the stage $t$ noise reconstruction $\epsilon _ { \theta } ( \mathbf { x } _ { t } , t )$ is a linear transformation of the model’s expectation $\mu _ { \theta } ( \mathbf { x } _ { t } , t )$ :
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
{ \pmb \mu } _ { \theta } ( { \bf x } _ { t } , t ) = \frac { 1 } { \sqrt { \alpha _ { t } } } \left( { \bf x } _ { t } - \frac { \beta _ { t } } { \sqrt { 1 - \bar { \alpha } _ { t } } } { \pmb \epsilon } _ { \theta } ( { \bf x } _ { t } , t ) \right) .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
The weighting $w _ { t } ( \beta )$ is generally a function of the noise schedule, but in most pretrained diffusion models it is set to 1. Thus, the free energy in (2) reduces to
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { l } { F = \displaystyle \sum _ { t } \mathbb { E } _ { \epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) } [ \| \epsilon - \epsilon _ { \theta } ( \mathbf { x } _ { t } , t ) \| _ { 2 } ^ { 2 } ] - \mathbb { E } _ { q ( \mathbf { x } ) } [ \log c ( \mathbf { x } , \mathbf { y } ) ] } \\ { = \displaystyle \sum _ { t } \mathbb { E } _ { \epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) } [ \| \epsilon - \epsilon _ { \theta } ( \mathbf { x } _ { t } , t ) \| _ { 2 } ^ { 2 } ] - \log c ( \eta , \mathbf { y } ) , \quad \mathbf { x } _ { t } = \sqrt { \bar { \alpha } _ { t } } \eta + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon . } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
The first term is the cost usually used to learn the parameters $\theta$ of the diffusion model. To perform inference under an already trained model $\epsilon _ { \theta }$ , we instead minimize $F$ with respect to $\eta$ through sampling $\epsilon$ in the summands over $t$ .
|
| 130 |
+
|
| 131 |
+
A similar derivation applies if a Gaussian approximation to the posterior $q ( \mathbf { x } )$ is used (see $\ S \mathrm { A }$ ). Such an approximation allows to model not only a mode of the posterior, but the uncertainty in its vicinity.
|
| 132 |
+
|
| 133 |
+
We summarize the algorithm for a point estimate $q ( \mathbf { x } )$ as Algorithm 1. Variations on this algorithm are possible. Depending on how close to a good mode we can initialize $\eta$ , this optimization may involve summing only over $t \leq t _ { \operatorname* { m a x } } < T$ ; different time step schedules can be considered depending on the desired diversity in the estimated x. Note that optimization is stochastic and each time it is run it can produce different point estimates of $\mathbf { x }$ which are are both likely under the diffusion prior and satisfy the constraint as much as possible.
|
| 134 |
+
|
| 135 |
+
We observed that optimizing simultaneously for all $t$ makes it difficult to guide the sample towards a mode in image generation applications; therefore, we anneal $t$ from high to low values. Intuitively, the first few iterations of gradient descent should coarsely explore the search space, while later iterations gradually reduce the temperature to steadily reach a nearby local maximum of $p ( \mathbf { x } | \mathbf { y } )$ . Examples of annealing schedules designed for the tasks demonstrated in $\ S 3 , 4 , 5$ are presented in the Appendix (Fig. B.1).
|
| 136 |
+
|
| 137 |
+
Another interesting case is when $\mathbf { x }$ is parametrized through a latent variable (this can be seen as a case of a hard, non-differentiable constraint: if $\mathbf { x }$ is a deterministic function of $\mathbf { y }$ , $\mathbf { x } = f ( \mathbf { y } )$ , then $c ( \mathbf { x } , \mathbf { y } )$ is supported on the corresponding manifold). Then the procedure in Algorithm 1 can be performed with gradient descent steps with respect to $\mathbf { y }$ on
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t _ { i } } } f ( \mathbf { y } ) + \sqrt { 1 - \bar { \alpha } _ { t _ { i } } } \epsilon , t _ { i } \big ) \| _ { 2 } ^ { 2 }
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
instead of steps 4 and 5. (For some semantics of the latent representation, one may wish to make the prior on $\mathbf { x }$ the pushforward by $f$ of a known prior on the latent $\mathbf { y }$ . In this case, (13) must be weighted by the Jacobian of $f$ at y.)
|
| 144 |
+
|
| 145 |
+
# 3 Experiments: Conditional image generation
|
| 146 |
+
|
| 147 |
+
# 3.1 Simple illustration on MNIST
|
| 148 |
+
|
| 149 |
+
We first explore the idea of generating conditional samples from an unconditional diffusion model on MNIST. We train the DDPM model of [7] on MNIST digits and experiment with different sets of constraints $\log c ( \mathbf { x } , \mathbf { y } )$ to generate samples with specific attributes. The examples in Fig. 1 showcase such generated samples. For the digit in (a) we set the constraint $\log c$ to be the unnormalized score of ‘thin’ digits, computed as negative of the average image intensity, whereas in (b) we invert that and generate a ‘thick’ digit with high mean intensity. Similarly, in (c) and (d) we hand-craft a score that penalizes the vertical and horizontal symmetry respectively, by computing the $L ^ { 2 }$ distance between the two folds (vertical/horizontal) of the digit $\mathbf { x }$ , which leads to the generation of skewed, non-symmetric samples.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 1: Inferred MNIST samples under different conditions $c ( \mathbf { x } , \mathbf { y } )$ .
|
| 153 |
+
|
| 154 |
+
We also showcase how the auxiliary constraint $c ( \mathbf { x } , \mathbf { y } )$ can be modeled by a different, independently trained network. The digit in Fig. 1 (e) is generated by constraining the DDPM with a classifier network that is separately trained to distinguish between the digit class $\mathbf y = 3$ and all other digits. The auxiliary constraint in this case is the likelihood of the inferred digit, as it is estimated by the classifier. Finally, for (f) we multiply horizontal symmetry and digit classifier constraints, prompting the inference procedure to generate a perfectly centered and symmetric digit. Details of model training and inference can be found in the Appendix $( \ S \mathbf { B } . 1 )$ .
|
| 155 |
+
|
| 156 |
+
# 3.2 Using off-the-shelf components for conditional generation of faces
|
| 157 |
+
|
| 158 |
+
We consider the generation of natural images with a pretrained DDPM prior and a learned constraint. We utilize the pretrained DDPM network on FFHQ-256 [19] from [3] and a pretrained ResNet-18 face attribute classifier on CelebA [25]. The attribute classifier computes the likelihood of presence of various facial features $y$ in a given image x, as they are defined by the CelebA dataset. Examples of such features are no beard, smiling, blond hair and male. To generate a conditional sample from the unconditional DDPM network we select a subset of these and enforce their presence or absence using the classifier predicted likelihoods as our constraint $c$ . If $\mathbf { y }$ is a set of attributes we wish to be present, the constraint $\log c ( \mathbf { x } , \mathbf { y } )$ can be expressed as
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\log c ( \mathbf { x } , \mathbf { y } ) = \sum _ { y \in \mathbf { y } } \log p ( y \mid \mathbf { x } )
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
We only strictly enforce a small subset of facial attributes and therefore $\mathbf { x }$ is allowed to converge towards different modes that correspond to samples that exhibit, in varying levels, the desired features.
|
| 165 |
+
|
| 166 |
+
In Fig. 2 we demonstrate our ability to infer conditional samples $\mathbf { x }$ with desired attributes y, using only the unconditional diffusion model and the classifier $p ( \mathbf { y } \mid \mathbf { x } )$ . In the first row, we show the results of the optimization procedure of Algorithm 1 for various attributes. The classifier objective $c ( \mathbf { x } , \mathbf { y } )$ manipulates the image with the goal of making the classifier network produce the desired attribute predictions, whereas the diffusion objective attempts to pull the sample $x$ towards the learned distribution $p ( \mathbf { x } )$ . If we ignored the denoising loss, the result would be some adversarial noise that fools the classifier network. The DDPM prior, however, is strong enough to guide the process towards realistic-looking images that simultaneously satisfy the classifier constraint set.
|
| 167 |
+
|
| 168 |
+
We notice that the generated samples $\mathbf { x }$ , although having converged towards a correct mode of $p ( \mathbf { x } )$ , still exhibit a noticeable amount of noise related to the optimization of classifier objective. To address that, inspired by [31], we simply denoise the image using the DDPM model alone, starting from the low noise level $t = 2 0 0$ so as to retain the overall structure. The results of this denoising are shown in the second row of Fig. 2.
|
| 169 |
+
|
| 170 |
+
In Fig. 3 we showcase the intermediate steps of the optimization process for inference with the conditions blond hair+smiling+not male, thus solving a problem like that studied in [8] using only independently trained attribute classifiers and an unconditional generative model of faces. The sample $x$ is initialized with Gaussian noise $\mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ , and as we perform gradient steps with decreasing values of $t$ , we observe facial features being added in a coarse-to-fine manner.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 2: First row: Conditional FFHQ samples $\mathbf { x }$ for constraints $c ( \mathbf { x } , \mathbf { y } )$ with various attribute sets y. Second row: denoising as in [31] to remove artifacts that appear when optimizing with a classifier network enforcing the constraint.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3: FFHQ conditional generation for $\mathbf { y } = \{ B l o n d e , S m i l i n g , F e m a l e \}$ . The last step performs denoising as in [31] to remove artifacts that appear when training on a classifier as a constraint.
|
| 177 |
+
|
| 178 |
+
In the Appendix $( \ S \mathbf { B } . 2 )$ we provide additional samples and further discuss the sample quality in comparison to unconditional generation. We also present results on inference with conflicting attributes as well as common failure cases.
|
| 179 |
+
|
| 180 |
+
# 4 Experiments: Semantic image segmentation
|
| 181 |
+
|
| 182 |
+
We test the applicability of diffusion priors in discrete tasks, such as inferring semantic segmentations from images. For this purpose, we use the EnviroAtlas dataset [32] which is composed of 5-class, 1m-resolution land cover labels from four geographically diverse cities across the US; Pittsburgh, PA, Durham, NC, Austin, TX and Phoenix, AZ. We only have access to the high resolution labels from Pittsburgh, and the task is to infer the land cover labels in the other three cities, given only probabilistic weak labels $\ell _ { \mathrm { w e a k } }$ derived from coarse auxiliary data [34]. We use Algorithm 1 to perform an inference procedure that does not directly take imagery as input, but uses constraints derived from unsupervised color clustering. We use only cluster indices in inference, making the algorithm dependent on image structure, but not color. Local cluster indices as a representation have a promise of extreme domain transferability, but they require a form of a combinatorial search which matches local cluster indices to semantic labels so that the created shapes resemble previously observed land cover, as captured by a denoising diffusion model of semantic segmentations.
|
| 183 |
+
|
| 184 |
+
DDPM on semantic pixel labels. We train a DDPM model on the $\textstyle { \frac { 1 } { 4 } }$ -resolution one-hot representations of the land cover labels, using the U-Net diffusion model architecture from [7]. To convert the one-hot diffusion samples to probabilities we follow [15] and assume that for any pixel $i$ in the inferred sample x, the distribution over the label $\ell$ is, $\begin{array} { r } { p ( \ell _ { i } ) \propto \int _ { 0 . 5 } ^ { 1 . 5 } \mathcal { N } ( x _ { i } ^ { \ell } \mid \eta _ { i } , \sigma ) } \end{array}$ , where $\sigma$ is user-defined a parameter. We chose this approach for its simplicity and ease to apply in our inference setting of Algorithm 1. Alternatively, we could use diffusion models for categorical data [14] with the appropriate modifications to our inference procedure. Samples drawn from the learned distribution are presented in Fig 4.
|
| 185 |
+
|
| 186 |
+
Inferring semantic segmentations. In order to infer the segmentation of a single image, under the diffusion prior, we directly apply Algorithm 1 with a hand-crafted constraint $c$ which provides structural and label guidance. To construct $c$ , we first compute a local color clustering $\mathbf { z }$ of input the image ( $\Re \mathrm { B } . 3$ in the Appendix). In addition, we utilize the available weak labels $\ell _ { \mathrm { w e a k } }$ [34] and force the predicted segments’ distribution to match the weak label distribution when averaged in non-overlapping blocks. We combine the two objectives in a single constraint $c ( { \bf x } , { \bf z } , \ell _ { \mathrm { w e a k } } )$ by (i) computing the mutual information between the color clustering $\mathbf { z }$ and the predicted labels $\mathbf { x }$ , transformed into a valid probability distribution from the inferred one-hot vectors, in overlapping image patches and (ii) computing the negative KL divergence between the average predicted distribution and the distribution given by the weak labels in non-overlapping blocks
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: Unconditional samples from the DDPM trained on land cover segmentations (cf. Fig. 5).
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 5: Segmentation inference results. The inferred segmentation $\mathbf { x }$ is initialized with the weak labels to reduce the number of steps needed. The samples are chosen from (top to bottom) Durham, NC, Austin, TX and Phoenix, AZ. Although AZ has a vastly different joint distribution of colors and labels, the inferred segmentation still captures the overall structure. Note that the inference algorithm does not use the pixel intensities in the input image, only an unsupervised color clustering.
|
| 193 |
+
|
| 194 |
+
$$
|
| 195 |
+
\begin{array} { r } { \log c ( \mathbf { x } , \mathbf { z } , \boldsymbol { \ell } _ { \mathrm { w e a k } } ) = \mathrm { M I } ( \mathbf { x } , \mathbf { z } ) - \mathrm { K L } ( \mathbf { x } \parallel \boldsymbol { \ell } _ { \mathrm { w e a k } } ) . } \end{array}
|
| 196 |
+
$$
|
| 197 |
+
|
| 198 |
+
Empirically, we find that we can reduce the number of optimization steps needed to perform inference by initializing the sample $\mathbf { x }$ with the weak labels $\ell _ { \mathrm { w e a k } }$ instead of random noise, allowing us to start from a smaller $t _ { i }$ . Examples of images and their inferred segmentations are shown in Fig. 5.
|
| 199 |
+
|
| 200 |
+
Domain transfer with inferred samples. The above inference procedure is agnostic to colors by design, and we expect it to have a greater ability to perform in new areas than the approach in [34], which still finetunes networks that take raw images as input. We also investigate domain transfer approaches where patches segmented using the the diffusion prior are used to train neural networks for fast inference. We pretrain a standard U-Net inference network $p ( \mathbf { x } \mid I )$ solely on $2 0 \mathrm { k }$ batches of 16 randomly sampled $6 4 \times 6 4$ image patches in PA. We randomly sample 640 images in each of the other geographies and generate semantic segmentations using our inference procedure, then finetune the inference network on these segmentations. This network is then evaluated on the entire target geography.
|
| 201 |
+
|
| 202 |
+
Table 1: Accuracies and class mean intersection-over-union scores on the EnviroAtlas dataset in various geographic domains. The model in the second-to-last row was pretrained in a supervised way on labels in the Pittsburgh, PA, region.
|
| 203 |
+
|
| 204 |
+
<table><tr><td rowspan="2">Algorithm</td><td colspan="2">Durham, NC</td><td colspan="2">Austin, TX</td><td colspan="2">Phoenix, AZ</td></tr><tr><td>Acc %</td><td>IoU %</td><td>Acc %</td><td>IoU %</td><td>Acc %</td><td>IoU %</td></tr><tr><td>PA supervised</td><td>74.2</td><td>35.9</td><td>71.9</td><td>36.8</td><td>6.7</td><td>13.4</td></tr><tr><td>PA supervised + weak</td><td>78.9</td><td>47.9</td><td>77.2</td><td>50.5</td><td>62.8</td><td>24.2</td></tr><tr><td>Implicit posterior [34]</td><td>79.0</td><td>48.4</td><td>76.6</td><td>49.5</td><td>76.2</td><td>46.0</td></tr><tr><td>Ours s (from scratch)</td><td>76.0</td><td>39.9</td><td>74.8</td><td>39.4</td><td>69.5</td><td>31.6</td></tr><tr><td>Ours (fine-tuned)</td><td>79.8</td><td>46.4</td><td>79.5</td><td>45.4</td><td>69.6</td><td>32.4</td></tr><tr><td>Full US supervised [33]</td><td>77.0</td><td>49.6</td><td>76.5</td><td>51.8</td><td>24.7</td><td>23.6</td></tr></table>
|
| 205 |
+
|
| 206 |
+
The results in Table 1 demonstrate that this approach to domain transfer is comparable with the state-of-the-art work of [34] for weakly-supervised training. The naïve approach of training a U-Net only on the available high-resolution PA data (PA supervised) fails to generalize to the geographically different location of Phoenix, AZ. Similarly, the model of [33], which is a US-wide high-resolution land cover model trained on imagery and labels, and multi-resolution auxiliary data over the entire contiguous US also suffers. When the weak labels are provided as input (PA supervised $^ +$ weak) the results can improve significantly.
|
| 207 |
+
|
| 208 |
+
# 5 Experiments: Continuous relaxation of combinatorial problems
|
| 209 |
+
|
| 210 |
+
So far, we have considered inference under a DDPM prior and a differentiable constraint $c ( \mathbf { x } , \mathbf { y } )$ . We consider the case of a ‘hard’ constraint, where $\mathbf { y }$ is a latent vector deterministically encoded in an image x $( \mathbf { x } = f ( \mathbf { y } ) )$ and we have a DDPM prior over images $p _ { \mathrm { D D P M } } ( \mathbf { x } )$ . We will use the variation of Algorithm 1 described at the end of $\ S 2 . 2$ to obtain a point estimate of the distribution over $y$ $p ( \mathbf { y } ) \overset { - } { \propto } p _ { \mathrm { D D P M } } ( f ( \mathbf { y } ) )$ .
|
| 211 |
+
|
| 212 |
+
We illustrate this in the setting of a well-known combinatorial problem, the traveling salesman problem (TSP). Recall that a Euclidean traveling salesman problem on the plane is described by $N$ points $\boldsymbol { v } _ { 1 } , \ldots , \boldsymbol { v } _ { N } \in \mathbb { R } ^ { 2 }$ , which form the vertex set of a complete weighted graph $G$ , where the weight of the edge from $v _ { i }$ to $v _ { j }$ is the Euclidean distance $\| v _ { i } - v _ { j } \|$ . A tour of $G$ is a connected subgraph in which every vertex has degree 2. The TSP is the optimization problem of finding the tour with minimal total weight of the edges, or, equivalently, a permutation $\sigma$ of $\{ 1 , 2 , \ldots , N \}$ that minimizes
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\| v _ { \sigma ( 1 ) } - v _ { \sigma ( 2 ) } \| + \| v _ { \sigma ( 2 ) } - v _ { \sigma ( 3 ) } \| + \cdots + \| v _ { \sigma ( N - 1 ) } - v _ { \sigma ( N ) } \| + \| v _ { \sigma ( N ) } - v _ { \sigma ( 1 ) } \| .
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
Although the general form of the TSP is NP-hard, a polynomial-time approximation scheme is known to exist in the Euclidean case [2, 28] and can yield proofs of tour optimality for small problems.
|
| 219 |
+
|
| 220 |
+
Humans have been shown to have a natural propensity for solving the Euclidean TSP (see [26] for a survey). Humans construct a tour by processing an image representation of the points $v _ { 1 } , \ldots , v _ { N }$ through their visual system. However, the optimization algorithms in common use for solving the TSP do not use a vision inductive bias, instead falling into two broad categories:
|
| 221 |
+
|
| 222 |
+
• Discrete combinatorial optimization algorithms and efficient integer programming solvers, studied for decades in the optimization literature [24, 12, 10];
|
| 223 |
+
• More recently, there has been work on neural nets, trained by reinforcement learning or imitation learning, that build tours sequentially or learn heuristics for their (discrete) iterative refinement. Successful recent approaches [6, 23, 16, 17, 4] have used Transformer [44] and graph neural network [22] architectures.
|
| 224 |
+
|
| 225 |
+
The algorithm we propose using DDPMs is a hybrid of these categories: it reasons over a continuous relaxation of the problem, but exploits the learning of generalizable structure in example solutions by a neural model. In addition, ours is the first TSP algorithm to mimic the convolutional inductive bias of the visual system.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 7: The procedure for solving the Euclidean TSP with a DDPM: Gradient descent is performed on a latent adjacency matrix $A$ to minimize a stochastic denoising loss on an image representation $f ( A )$ with steadily decreasing amounts of noise (here, 256 steps). In the process, pieces of the tour are ‘burned in’ and later recombined in creative ways. Finally, a tour is extracted from the inferred adjacency matrix and refined by uncrossing moves. For both problems shown, the length of the inferred tour is within $1 \%$ of the optimum.
|
| 229 |
+
|
| 230 |
+
Encoding function. Fix a set of points $v _ { 1 } , \ldots , v _ { N } \in [ 0 , 1 ] \times [ 0 , 1 ]$ . We encode an symmetric $N \times N$ matrix with 0 diagonal $A$ as a $6 4 \times 6 4$ greyscale image $f ( A )$ by superimposing: (i) raster images of line segments from $v _ { i }$ to $v _ { j }$ with intensity value $A _ { i j }$ for every pair $( i , j )$ , and (ii) raster images of small black dots placed at $v _ { i }$ for each $i$ . For example, if $A$ is the adjacency matrix of a tour, then $f ( A )$ is a visualization of this tour as a $6 4 \times 6 4$ image.
|
| 231 |
+
|
| 232 |
+
Diffusion model training. We use a dataset of Euclidean TSPs, with ground truth tours obtained by a state-of-the-art TSP solver [10], from [23] (we consider two variants of the dataset, each with ${ \sim } 1 . 5 \mathrm { m }$ training graphs: with 50 vertices in each graph and with a varying number from 20 to 50 vertices in each graph). Each training tour is represented via its adjacency matrix $A$ and encoded as an image $f ( A )$ . We then train a DDPM with the U-Net architecture from [7] on all of such encoded image. Model and training details can be found in the Appendix $( \ S \mathbf { B } . 4 )$ . Some unconditional samples from the trained DDPM are shown in Fig. 6; most samples indeed resemble image representations of tours.
|
| 233 |
+
|
| 234 |
+
Solving new TSPs. Suppose we are given a new set of points $v _ { 1 } , \ldots , v _ { N }$ . Solving the TSP requires finding the adjacency matrix $A$ of a tour of minimal length. As a differentiable relaxation, we set $A = \check { S } + S ^ { \top }$ , where $S$ is a stochastic $N \times N$ matrix with zero diagonal (parametrized via softmax of a matrix of parameters over rows). We run the inference procedure using the trained DDPM $p _ { \mathrm { D D P M } } ( f ( \bar { A } ) )$ as a prior to estimate $A$ The hyperparameters and noise schedule are described in $\ S _ { \mathrm { B } . 4 }$ . Examples of the optimization are shown in Fig. 7.
|
| 235 |
+
|
| 236 |
+
Although the inferred $A$ is usually sharp (i.e., all
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 6: Two unconditional samples from the diffusion model trained on images of solved TSPs.
|
| 240 |
+
|
| 241 |
+
entries close to 0 or 1), rounding $A$ to 0 or 1 does not always give the adjacency matrix of a tour (see, for example, the top row of Fig. 7; other common incorrect outputs include pairs of disjoint tours). To extract a tour from the inferred $A$ , we greedily insert edges to form an initial proposal, then refine it using a standard and lightweight combinatorial procedure, the 2-opt heuristic [24] (amounting to iteratively uncrossing pairs of edges that intersect). The entire procedure is shown in Fig. 7, and full details can be found in the Appendix $( \ S \mathbf { B } . 4 )$ .
|
| 242 |
+
|
| 243 |
+
Results. We evaluate the trained models on test sets of 1280 graphs each with $N = 5 0$ and $N = 1 0 0$ vertices. We report the average length of the inferred tour and the gap (discrepancy from the length of the ground truth tour) in Table 2 (left), from which we make several observations.
|
| 244 |
+
|
| 245 |
+
Table 2: Left: Mean tour length and optimality gap on Euclidean TSP test sets. The baseline results from [23, 16, 4] are taken from the respective papers. The two DDPMs were trained on $1 . 5 \mathrm { m }$ images of solved TSP instances (with different numbers of vertices) and used to infer latent adjacency matrices in the test set. Right: Performance of the DDPM trained on images of 50-vertex TSP instances with different numbers of inference steps (see the Appendix $( \ S \mathbf { B } . 4 )$ for time schedule details). We also show the mean number of 2-opt (uncrossing) steps per instance, suggesting that the DDPM prior assigns high likelihood to adjacency matrices that are in less need of refinement.
|
| 246 |
+
|
| 247 |
+
<table><tr><td rowspan="2">Algorithm</td><td colspan="2">N=50</td><td colspan="2">N=100</td></tr><tr><td>Obj</td><td>Gap%</td><td>Obj</td><td>Gap%</td></tr><tr><td>Oracle (Concorde [10])</td><td>5.69</td><td>0.00</td><td>7.759</td><td>0.00</td></tr><tr><td>2-opt [24]</td><td>5.86</td><td>2.95</td><td>8.03</td><td>3.54</td></tr><tr><td>Transformer [23]</td><td>5.80</td><td>1.76</td><td>8.12</td><td>4.53</td></tr><tr><td>GNN [16]</td><td>5.87</td><td>3.10</td><td>8.41</td><td>8.38</td></tr><tr><td>Transformer [4]</td><td>5.71</td><td>0.31</td><td>7.88</td><td>1.42</td></tr><tr><td>Diffusion 20-50</td><td>5.76</td><td>1.23</td><td>7.92</td><td>2.11</td></tr><tr><td>Diffusion 50</td><td>5.76</td><td>1.28</td><td>7.93</td><td>2.19</td></tr></table>
|
| 248 |
+
|
| 249 |
+
<table><tr><td></td><td colspan="3">N=50</td><td colspan="3">N=100</td></tr><tr><td>Diff. steps</td><td>Obj</td><td>Gap %</td><td>Steps</td><td>Obj</td><td>Gap%</td><td>Steps</td></tr><tr><td>256</td><td>5.763</td><td>1.28</td><td>11.6</td><td>7.930</td><td>2.19</td><td>50.6</td></tr><tr><td>64</td><td>5.780</td><td>2.60</td><td>14.3</td><td>7.942</td><td>2.35</td><td>45.7</td></tr><tr><td>16</td><td>5.858</td><td>2.98</td><td>25.9</td><td>8.052</td><td>3.78</td><td>58.6</td></tr><tr><td>4</td><td>5.851</td><td>2.86</td><td>23.9</td><td>8.031</td><td>3.50</td><td>52.8</td></tr><tr><td>2-opt</td><td>5.856</td><td>2.95</td><td>24.4</td><td>8.034</td><td>3.54</td><td>53.0</td></tr></table>
|
| 250 |
+
|
| 251 |
+
• The right side of Table 2 shows the number of 2-opt (edge uncrossing) steps performed in the refinement step of the algorithm when the inference algorithm is run for varying numbers of steps. Running the inference with more steps results in extracted tours that are closer to local minima with respect to the 2-opt neighbourhood, indicating that the DDPM encodes meaningful information about the shape of tours.
|
| 252 |
+
|
| 253 |
+
• The DDPM inference is competitive with recent baseline algorithms that do not use beam search in generation of the tour (those shown in the table). These baseline algorithms improve when beam search decoding with very large beam size is used, but encounter diminishing returns as the computation cost grows. Our performance on the 100-vertex problems is similar to [23] with the largest beam size they report (5000), which has $2 . 1 8 \%$ gap, while having similar computation time.
|
| 254 |
+
|
| 255 |
+
• The model trained on problems with 50 nodes performs almost identically to the model trained on problems with 50 or fewer nodes, and both models generalize better than baseline methods from 50-node problems to the out-of-distribution 100-node problems.
|
| 256 |
+
|
| 257 |
+
We emphasize a unique feature of our algorithm: all ‘reasoning’ in our inference procedure happens via the image space. This property also leads to sublinear computation cost scaling with increasing size of the graph – as long as it can reasonably be represented in a $6 4 \times 6 4$ image – since most of the computation cost of inference is borne by running the denoiser on images of a fixed size. In the Appendix $( \ S \mathbf { B } . 4 )$ we explore the generalization of the model trained on 20- to 50-node TSP instances to problems with 200 nodes and discuss potential extensions.
|
| 258 |
+
|
| 259 |
+
# 6 Conclusion
|
| 260 |
+
|
| 261 |
+
We have shown how inference in denoising diffusion models can be performed under constraints in a variety of settings. Imposing constraints that arise from pretrained classifiers enables conditional generation, while common-sense conditions, such as mutual information with a clustering or divergence from weak labels, can lead to models that are less sensitive to domain shift in the distribution of conditioning data.
|
| 262 |
+
|
| 263 |
+
A notable limitation of DDPMs, which is inherited by our algorithms, is the high cost of inference, requiring a large number of passes through the denoising network to generate a sample. We expect that with further research on DDPMs for which inference procedures converge in fewer steps [37, 45], plug-and-play use of DDPMs will become more appealing in various applications.
|
| 264 |
+
|
| 265 |
+
Finally, our results on the traveling salesman problem illustrate the ability of DDPMs to reason over uncertain hypotheses in a manner that can mimic human ‘puzzle-solving’ behavior. These results open the door to future research on using DDPMs to efficiently generate candidates in combinatorial search problems.
|
| 266 |
+
|
| 267 |
+
# Acknowledgments
|
| 268 |
+
|
| 269 |
+
The authors thank the anonymous NeurIPS 2022 reviewers for their comments.
|
| 270 |
+
|
| 271 |
+
All authors are funded by their primary institutions. Partial support was provided by the NASA Biodiversity program (Award 80NSSC21K1027), NSF grants IIS-2123920 and IIS-2212046, and the Partner University Fund 4D Vision award.
|
| 272 |
+
|
| 273 |
+
# References
|
| 274 |
+
|
| 275 |
+
[1] Tomer Amit, Eliya Nachmani, Tal Shaharabany, and Lior Wolf. Segdiff: Image segmentation with diffusion probabilistic models. arXiv preprint 2112.00390, 2021.
|
| 276 |
+
[2] Sanjeev Arora. Polynomial time approximation schemes for euclidean traveling salesman and other geometric problems. Journal of the Association for Computing Machinery, 45(5):753–782, 09 1998.
|
| 277 |
+
[3] Dmitry Baranchuk, Andrey Voynov, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. Label-efficient semantic segmentation with diffusion models. International Conference on Learning Representations (ICLR), 2022.
|
| 278 |
+
[4] Xavier Bresson and Thomas Laurent. The transformer network for the traveling salesman problem. arXiv preprint 2103.03012, 2021.
|
| 279 |
+
[5] Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. ILVR: conditioning method for denoising diffusion probabilistic models. International Conference on Computer Vision (ICCV), 2021.
|
| 280 |
+
[6] Michel Deudon, Pierre Cournut, Alexandre Lacoste, Yossiri Adulyasak, and Louis-Martin Rousseau. Learning heuristics for the TSP by policy gradient. In Integration of Constraint Programming, Artificial Intelligence, and Operations Research, pages 170–181. Springer International Publishing, 2018.
|
| 281 |
+
[7] Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. Neural Information Processing Systems (NeurIPS), 2021.
|
| 282 |
+
[8] Yilun Du, Shuang Li, and Igor Mordatch. Compositional visual generation with energy based models. Neural Information Processing Systems (NeurIPS), 2020.
|
| 283 |
+
[9] Jesse H. Engel, Matthew D. Hoffman, and Adam Roberts. Latent constraints: Learning to generate conditionally from unconditional generative models. International Conference on Learning Representations (ICLR), 2018.
|
| 284 |
+
[10] David Applegate et al. Concorde TSP solver. http://www.math.uwaterloo.ca/tsp/ concorde, 1997-2003.
|
| 285 |
+
[11] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Neural Information Processing Systems (NeurIPS), 2014.
|
| 286 |
+
[12] Keld Helsgaun. An effective implementation of the Lin–Kernighan traveling salesman heuristic. European Journal of Operational Research, 126(1):106–130, 2000.
|
| 287 |
+
[13] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Neural Information Processing Systems (NeurIPS), 2020.
|
| 288 |
+
[14] Emiel Hoogeboom, Didrik Nielsen, Priyank Jaini, Patrick Forré, and Max Welling. Argmax flows and multinomial diffusion: Learning categorical distributions. Neural Information Processing Systems (NeurIPS), 2021.
|
| 289 |
+
[15] Emiel Hoogeboom, Victor Garcia Satorras, Clément Vignac, and Max Welling. Equivariant diffusion for molecule generation in 3D. arXiv preprint 2203.17003, 2022.
|
| 290 |
+
[16] Chaitanya K Joshi, Thomas Laurent, and Xavier Bresson. An efficient graph convolutional network technique for the travelling salesman problem. arXiv preprint 1906.01227, 2019.
|
| 291 |
+
[17] Chaitanya K Joshi, Quentin Cappart, Louis-Martin Rousseau, and Thomas Laurent. Learning tsp requires rethinking generalization. International Conference on Principles and Practice of Constraint Programming, 2021.
|
| 292 |
+
[18] Zahra Kadkhodaie and Eero Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. Neural Information Processing Systems (NeurIPS), 2021.
|
| 293 |
+
[19] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 294 |
+
[20] Bahjat Kawar, Gregory Vaksman, and Michael Elad. SNIPS: Solving noisy inverse problems stochastically. Neural Information Processing Systems (NeurIPS), 2021.
|
| 295 |
+
[21] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. International Conference on Learning Representations (ICLR), 2014.
|
| 296 |
+
[22] Thomas Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017.
|
| 297 |
+
[23] Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! International Conference on Learning Representations (ICLR), 2019.
|
| 298 |
+
[24] Shen Lin and Brian Kernighan. An effective heuristic algorithm for the traveling-salesman problem. Operations Research, 21(2):498–516, 1973.
|
| 299 |
+
[25] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. International Conference on Computer Vision (ICCV), 2015.
|
| 300 |
+
[26] James MacGregor and Yun Chu. Human performance on the traveling salesman and related problems: A review. The Journal of Problem Solving, 3, 02 2011.
|
| 301 |
+
[27] Tom Minka. Divergence measures and message passing. Microsoft Research Technical Report, 2005.
|
| 302 |
+
[28] Joseph S. B. Mitchell. Guillotine subdivisions approximate polygonal subdivisions: A simple polynomial-time approximation scheme for geometric tsp, k-mst, and related problems. SIAM Journal on Computing, 28(4):1298–1309, 1999.
|
| 303 |
+
[29] Anh Nguyen, Jeff Clune, Yoshua Bengio, Alexey Dosovitskiy, and Jason Yosinski. Plug & play generative networks: Conditional iterative generation of images in latent space. Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 304 |
+
[30] Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. International Conference on Machine Learning (ICML), 2021.
|
| 305 |
+
[31] Weili Nie, Brandon Guo, Yujia Huang, Chaowei Xiao, Arash Vahdat, and Anima Anandkumar. Diffusion models for adversarial purification. International Conference on Machine Learning (ICML), 2022. To appear; arXiv preprint 2205.07460.
|
| 306 |
+
[32] Brian R. Pickard, Jessica Daniel, Megan Mehaffey, Laura E. Jackson, and Anne Neale. Enviroatlas: A new geospatial tool to foster ecosystem services science and resource management. Ecosystem Services, 14(C):45–55, 2015. URL https://EconPapers.repec.org/RePEc: eee:ecoser:v:14:y:2015:i:c:p:45-55.
|
| 307 |
+
[33] Caleb Robinson, Le Hou, Nikolay Malkin, Rachel Soobitsky, Jacob Czawlytko, Bistra Dilkina, and Nebojsa Jojic. Large scale high-resolution land cover mapping with multi-resolution data. Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 308 |
+
[34] Esther Rolf, Nikolay Malkin, Alexandros Graikos, Ana Jojic, Caleb Robinson, and Nebojsa Jojic. Resolving label uncertainty with implicit posterior models. Uncertainty in Artificial Intelligence (UAI), 2022. To appear; arXiv preprint 2202.14000.
|
| 309 |
+
[35] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2015.
|
| 310 |
+
[36] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J. Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv preprint 2104.07636, 2021.
|
| 311 |
+
[37] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. International Conference on Learning Representations (ICLR), 2022.
|
| 312 |
+
[38] Abhishek Sinha, Jiaming Song, Chenlin Meng, and Stefano Ermon. D2C: diffusion-decoding models for few-shot conditional generation. Neural Information Processing Systems (NeurIPS), 2021.
|
| 313 |
+
[39] Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. International Conference on Machine Learning (ICML), 2015.
|
| 314 |
+
[40] Yang Song, Liyue Shen, Lei Xing, and Stefano Ermon. Solving inverse problems in medical imaging with score-based generative models. In International Conference on Learning Representations (ICLR), 2021.
|
| 315 |
+
[41] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, , and Rob Fergus. Intriguing properties of neural networks. International Conference on Learning Representations (ICLR), 2014.
|
| 316 |
+
[42] Yusuke Tashiro, Jiaming Song, Yang Song, and Stefano Ermon. CSDI: conditional scorebased diffusion models for probabilistic time series imputation. Neural Information Processing Systems (NeurIPS), 2021.
|
| 317 |
+
[43] Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space. Neural Information Processing Systems (NeurIPS), 2021.
|
| 318 |
+
[44] 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 (NIPS), 2017.
|
| 319 |
+
[45] Zhisheng Xiao, Karsten Kreis, and Arash Vahdat. Tackling the generative learning trilemma with denoising diffusion GANs. International Conference on Learning Representations (ICLR), 2022.
|
| 320 |
+
|
| 321 |
+
# Checklist
|
| 322 |
+
|
| 323 |
+
1. For all authors...
|
| 324 |
+
|
| 325 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 326 |
+
(b) Did you describe the limitations of your work? [Yes] See the conclusion and discussion throughout the paper.
|
| 327 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] Although no immediate negative societal impacts are expected, researchers should bear in mind the risks of flexible conditional generation of images, e.g., for creating ‘deep fakes’.
|
| 328 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 329 |
+
|
| 330 |
+
2. If you are including theoretical results...
|
| 331 |
+
|
| 332 |
+
(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]
|
| 333 |
+
|
| 334 |
+
3. If you ran experiments...
|
| 335 |
+
|
| 336 |
+
(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] For most experiments; see the Appendix.
|
| 337 |
+
|
| 338 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See the Appendix and relevant experiment sections.
|
| 339 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Main experiments were run one time.
|
| 340 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See the Appendix.
|
| 341 |
+
|
| 342 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 343 |
+
|
| 344 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See the relevant experiment sections.
|
| 345 |
+
(b) Did you mention the license of the assets? [No] But all datasets used are free to use for research purposes; see the relevant citations.
|
| 346 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 347 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 348 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 349 |
+
|
| 350 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 351 |
+
|
| 352 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 353 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 354 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu_content_list.json
ADDED
|
@@ -0,0 +1,1519 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "Diffusion models as plug-and-play priors ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
250,
|
| 8 |
+
122,
|
| 9 |
+
748,
|
| 10 |
+
148
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Alexandros Graikos Stony Brook University Stony Brook, NY agraikos@cs.stonybrook.edu ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
253,
|
| 19 |
+
202,
|
| 20 |
+
455,
|
| 21 |
+
257
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "Nikolay Malkin \nMila, Université de Montréal Montréal, QC, Canada \nnikolay.malkin@mila.quebec \nNebojsa Jojic \nMicrosoft Research \nRedmond, WA \njojic@microsoft.com ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
540,
|
| 30 |
+
200,
|
| 31 |
+
743,
|
| 32 |
+
257
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "",
|
| 39 |
+
"bbox": [
|
| 40 |
+
274,
|
| 41 |
+
279,
|
| 42 |
+
423,
|
| 43 |
+
333
|
| 44 |
+
],
|
| 45 |
+
"page_idx": 0
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"type": "text",
|
| 49 |
+
"text": "Dimitris Samaras Stony Brook University Stony Brook, NY samaras@cs.stonybrook.edu ",
|
| 50 |
+
"bbox": [
|
| 51 |
+
529,
|
| 52 |
+
279,
|
| 53 |
+
723,
|
| 54 |
+
333
|
| 55 |
+
],
|
| 56 |
+
"page_idx": 0
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"type": "text",
|
| 60 |
+
"text": "Abstract ",
|
| 61 |
+
"text_level": 1,
|
| 62 |
+
"bbox": [
|
| 63 |
+
462,
|
| 64 |
+
369,
|
| 65 |
+
535,
|
| 66 |
+
386
|
| 67 |
+
],
|
| 68 |
+
"page_idx": 0
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"type": "text",
|
| 72 |
+
"text": "We consider the problem of inferring high-dimensional data $\\mathbf { x }$ in a model that consists of a prior $p ( \\mathbf { x } )$ and an auxiliary differentiable constraint $c ( \\mathbf { x } , \\mathbf { y } )$ on $\\mathbf { x }$ given some additional information $\\mathbf { y }$ . In this paper, the prior is an independently trained denoising diffusion generative model. The auxiliary constraint is expected to have a differentiable form, but can come from diverse sources. The possibility of such inference turns diffusion models into plug-and-play modules, thereby allowing a range of potential applications in adapting models to new domains and tasks, such as conditional generation or image segmentation. The structure of diffusion models allows us to perform approximate inference by iterating differentiation through the fixed denoising network enriched with different amounts of noise at each step. Considering many noised versions of x in evaluation of its fitness is a novel search mechanism that may lead to new algorithms for solving combinatorial optimization problems. The code is available at https://github.com/AlexGraikos/diffusion_priors. ",
|
| 73 |
+
"bbox": [
|
| 74 |
+
233,
|
| 75 |
+
401,
|
| 76 |
+
766,
|
| 77 |
+
594
|
| 78 |
+
],
|
| 79 |
+
"page_idx": 0
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"type": "text",
|
| 83 |
+
"text": "1 Introduction ",
|
| 84 |
+
"text_level": 1,
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
621,
|
| 88 |
+
310,
|
| 89 |
+
638
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "Deep generative models, such as denoising diffusion probabilistic models [DDPMs; 39, 13] can capture the details of very complex distributions over high-dimensional continuous data $p ( \\mathbf { x } )$ [30, 7, 1, 38, 43, 15]. The immense effective depth of DDPMs, sometimes with thousands of deep network evaluations in the generation process, is an apparent limitation on their use as off-the-shelf modules in hierarchical generative models, where models can be mixed and one model may serve as a prior for another conditional model. In this paper, we show that DDPMs trained on image data can be directly used as priors in systems that involve other differentiable constraints. ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
173,
|
| 98 |
+
654,
|
| 99 |
+
825,
|
| 100 |
+
751
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 0
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "In our main problem setting, we assume that we have a prior $p ( \\mathbf { x } )$ over high-dimensional data $\\mathbf { x }$ and we wish to perform inference in a model that involves this prior and a constraint $c ( \\mathbf { x } , \\mathbf { y } )$ on $\\mathbf { x }$ given some additional information y. That is, we want to find an approximation to the posterior distribution $p ( \\mathbf x | \\mathbf y ) \\propto p ( \\mathbf x ) c ( \\mathbf x , \\mathbf y )$ . In this paper, $p ( \\mathbf { x } = \\mathbf { x } _ { 0 } , \\mathbf { h } = \\{ \\mathbf { x } _ { T } , . . . , \\mathbf { x } _ { 1 } \\} )$ is provided in the form of an independently trained DDPM over $\\mathbf { x } _ { T } , \\ldots , \\mathbf { x } _ { 0 }$ (§2.2), making the DDPM a ‘plug-and-play’ prior. ",
|
| 107 |
+
"bbox": [
|
| 108 |
+
174,
|
| 109 |
+
757,
|
| 110 |
+
823,
|
| 111 |
+
827
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 0
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "Although the recent community interest in DDPMs has spurred progress in training algorithms and fast generation schedules [30, 37, 45], the possibility of their use as plug-and-play modules has not been explored. Furthermore, as opposed to existing work on plug-and-play models (starting from [29]), the algorithms we propose do not require additional training or finetuning of model components or inference networks. ",
|
| 118 |
+
"bbox": [
|
| 119 |
+
174,
|
| 120 |
+
833,
|
| 121 |
+
823,
|
| 122 |
+
902
|
| 123 |
+
],
|
| 124 |
+
"page_idx": 0
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"type": "text",
|
| 128 |
+
"text": "One obvious application of plug-and-play priors is conditional image generation $( \\ S 3 . 1 , \\ S 3 . 2 )$ . For example, a denoising diffusion model trained on MNIST digit images might define $p ( \\mathbf { x } )$ , while the constraint $c ( \\mathbf { x } , \\mathbf { y } )$ may be be the probability of digit class y under an off-the-shelf classifier. However, changing the semantics of $\\mathbf { x }$ , we can also use such models for inference tasks where neural networks struggle with domain adaptation, such as image segmentation: $c ( \\mathbf { x } , \\mathbf { y } )$ constrains the segmentation $\\mathbf { x }$ to match an appearance or a weak labeling y (§4). Finally, we describe a path towards using DDPM priors to solve continuous relaxations of combinatorial search problems by treating $\\mathbf { y }$ as a latent variable with combinatorial structure that is deterministically encoded in $\\mathbf { x }$ (§5). ",
|
| 129 |
+
"bbox": [
|
| 130 |
+
174,
|
| 131 |
+
90,
|
| 132 |
+
825,
|
| 133 |
+
202
|
| 134 |
+
],
|
| 135 |
+
"page_idx": 1
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"type": "text",
|
| 139 |
+
"text": "1.1 Related work ",
|
| 140 |
+
"text_level": 1,
|
| 141 |
+
"bbox": [
|
| 142 |
+
174,
|
| 143 |
+
218,
|
| 144 |
+
305,
|
| 145 |
+
232
|
| 146 |
+
],
|
| 147 |
+
"page_idx": 1
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"type": "text",
|
| 151 |
+
"text": "Conditioning DDPMs. DDPMs have previously been used for conditional generation and image segmentation [36, 42, 1]. With few exceptions – such as [3], which uses a pretrained DDPM as a feature extractor – these algorithms assume access to paired data and conditioning information during training of the DDPM model. In [7], a classifier $p ( y \\mid \\mathbf { x } _ { t } )$ that guides the denoising model towards the desired subset of images with the attribute $y$ is trained in parallel with the denoiser. In [5], generation is conditioned on an auxiliary image by guiding the denoising process through correction steps that match the low-frequency components of the generated and conditioning images. In contrast, we aim to build models that combine an independently trained DDPM with an auxiliary constraint. ",
|
| 152 |
+
"bbox": [
|
| 153 |
+
174,
|
| 154 |
+
243,
|
| 155 |
+
825,
|
| 156 |
+
354
|
| 157 |
+
],
|
| 158 |
+
"page_idx": 1
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"type": "text",
|
| 162 |
+
"text": "Our approach is also related to work on adversarial examples. Adversarial samples are produced by optimizing an image x to satisfy a desired constraint $c - { \\mathrm { a } }$ classifier $p ( \\mathbf { y } \\vert \\mathbf { x } )$ – without reference to the prior over data. As supervised learning algorithms can ignore the structure in data $\\mathbf { x }$ , focusing only on the conditional distribution, it is possible to optimize for input $\\mathbf { x }$ that provides the desired classification in various surprising ways [41]. In [31], a diffusion model is used to defend from adversarial samples by making images more likely under a DDPM $p ( \\mathbf { x } )$ . We are instead interested in inference, where we seek samples $\\mathbf { x }$ that satisfy both the classifier and the prior. (Our work may, however, have consequences for adversarial generation.) ",
|
| 163 |
+
"bbox": [
|
| 164 |
+
174,
|
| 165 |
+
359,
|
| 166 |
+
825,
|
| 167 |
+
472
|
| 168 |
+
],
|
| 169 |
+
"page_idx": 1
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"type": "text",
|
| 173 |
+
"text": "Conditional generation from unconditional models. Works that preceded the recent popularity of DDPMs [29, 9] show how an unconditional generative model, such as a generative adversarial network [GAN; 11] or variational autoencoder [VAE; 21], can be combined with a constraint model to generate conditional samples. Regarding generative diffusion models, recent literature has focused on utilizing unconditional, pretrained DDPMs as priors to solve linear inverse imaging problems. Both in [40] and [20], the authors modify the DDPM sampling algorithm, with knowledge of the linear degradation operator, to reconstruct an image consistent with the learned prior and given measurements. A generalization of these methods in [18] shows how any pretrained denoising network can be used as the prior for solving linear inverse problems. We also clarify that although the term ‘plug-and-play’ is widely used in the inverse imaging literature we refer to it in the scope of in-domain generation under differentiable constraints, in the same sense as [29]. ",
|
| 174 |
+
"bbox": [
|
| 175 |
+
174,
|
| 176 |
+
486,
|
| 177 |
+
825,
|
| 178 |
+
637
|
| 179 |
+
],
|
| 180 |
+
"page_idx": 1
|
| 181 |
+
},
|
| 182 |
+
{
|
| 183 |
+
"type": "text",
|
| 184 |
+
"text": "Latent vectors in DDPMs. Modeling the latent prior distribution in VAE-like models using a DDPM has been studied in [38, 43]. On the other hand, in $\\ S 5$ , we perform inference in the lowdimensional latent space under a pretrained DDPM on a high-dimensional data space. Our approach to semantic segmentation $( \\ S 4 )$ is also related to [34], where a prior $p ( \\mathbf { z } )$ over latents is used to tune a posterior network $q ( \\mathbf { z } | \\mathbf { x } )$ . There, the priors are of relatively simple structure and are sample-specific, rather than global diffusion priors like in this paper. ",
|
| 185 |
+
"bbox": [
|
| 186 |
+
174,
|
| 187 |
+
652,
|
| 188 |
+
825,
|
| 189 |
+
736
|
| 190 |
+
],
|
| 191 |
+
"page_idx": 1
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"type": "text",
|
| 195 |
+
"text": "2 Method ",
|
| 196 |
+
"text_level": 1,
|
| 197 |
+
"bbox": [
|
| 198 |
+
174,
|
| 199 |
+
755,
|
| 200 |
+
271,
|
| 201 |
+
772
|
| 202 |
+
],
|
| 203 |
+
"page_idx": 1
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
"type": "text",
|
| 207 |
+
"text": "2.1 Problem setting ",
|
| 208 |
+
"text_level": 1,
|
| 209 |
+
"bbox": [
|
| 210 |
+
174,
|
| 211 |
+
786,
|
| 212 |
+
323,
|
| 213 |
+
801
|
| 214 |
+
],
|
| 215 |
+
"page_idx": 1
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"type": "text",
|
| 219 |
+
"text": "Recall that we want to find an approximation to the posterior distribution $p ( \\mathbf { x } | \\mathbf { y } ) \\propto p ( \\mathbf { x } ) c ( \\mathbf { x } , \\mathbf { y } )$ , where $p ( \\mathbf { x } )$ is a fixed prior distribution. Fixing $\\mathbf { y }$ and introducing an approximate variational posterior $q ( \\mathbf { x } )$ , the free energy ",
|
| 220 |
+
"bbox": [
|
| 221 |
+
174,
|
| 222 |
+
811,
|
| 223 |
+
825,
|
| 224 |
+
854
|
| 225 |
+
],
|
| 226 |
+
"page_idx": 1
|
| 227 |
+
},
|
| 228 |
+
{
|
| 229 |
+
"type": "equation",
|
| 230 |
+
"img_path": "images/7c75f788ab2ead78ab7bdd97bf1788170cdc18c545bdc53dba752360c3703788.jpg",
|
| 231 |
+
"text": "$$\nF = - \\mathbb { E } _ { q ( \\mathbf { x } ) } [ \\log p ( \\mathbf { x } ) + \\log c ( \\mathbf { x } , \\mathbf { y } ) - \\log q ( \\mathbf { x } ) ]\n$$",
|
| 232 |
+
"text_format": "latex",
|
| 233 |
+
"bbox": [
|
| 234 |
+
341,
|
| 235 |
+
859,
|
| 236 |
+
656,
|
| 237 |
+
877
|
| 238 |
+
],
|
| 239 |
+
"page_idx": 1
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"type": "text",
|
| 243 |
+
"text": "is minimized when $q ( \\mathbf { x } )$ is closest to the true posterior, i.e., when $\\mathrm { K L } ( q ( \\mathbf { x } ) \\| p ( \\mathbf { x } | \\mathbf { y } ) )$ is minimized. When $q ( \\mathbf { x } )$ , and the learning algorithm used to fit it, are expressive enough to capture the true posterior, this minimization yields the exact posterior $p ( \\mathbf { x } | \\mathbf { y } )$ . Otherwise, $q$ will capture a ‘modeseeking’ approximation to the true posterior [27]; in particular, if $q ( \\mathbf { y } )$ is a Dirac delta, it is optimal to concentrate $q$ at the mode of $p ( \\mathbf { x } | \\mathbf { y } )$ . When the prior involves latent variables $\\mathbf { h }$ (i.e., $p ( \\mathbf { x } ) =$ $\\begin{array} { r l r } { \\int _ { \\mathbf { h } } p ( \\mathbf { x } | \\mathbf { h } ) p ( \\mathbf { h } ) \\bar { d } \\mathbf { h } ) } \\end{array}$ , the free energy is ",
|
| 244 |
+
"bbox": [
|
| 245 |
+
171,
|
| 246 |
+
883,
|
| 247 |
+
826,
|
| 248 |
+
911
|
| 249 |
+
],
|
| 250 |
+
"page_idx": 1
|
| 251 |
+
},
|
| 252 |
+
{
|
| 253 |
+
"type": "text",
|
| 254 |
+
"text": "",
|
| 255 |
+
"bbox": [
|
| 256 |
+
173,
|
| 257 |
+
90,
|
| 258 |
+
826,
|
| 259 |
+
148
|
| 260 |
+
],
|
| 261 |
+
"page_idx": 2
|
| 262 |
+
},
|
| 263 |
+
{
|
| 264 |
+
"type": "equation",
|
| 265 |
+
"img_path": "images/971410db6b5e26d819b15b160f923aada8765affdf906b17686439f1830d4e76.jpg",
|
| 266 |
+
"text": "$$\n\\begin{array} { r l } & { F = - \\mathbb { E } _ { q ( \\mathbf { x } ) q ( \\mathbf { h } | \\mathbf { x } ) } [ \\log p ( \\mathbf { x } , \\mathbf { h } ) + \\log c ( \\mathbf { x } , \\mathbf { y } ) - \\log q ( \\mathbf { x } ) q ( \\mathbf { h } | \\mathbf { x } ) ] } \\\\ & { \\quad = - \\mathbb { E } _ { q ( \\mathbf { x } ) q ( \\mathbf { h } | \\mathbf { x } ) } [ \\log p ( \\mathbf { x } , \\mathbf { h } ) - \\log q ( \\mathbf { x } ) q ( \\mathbf { h } | \\mathbf { x } ) ] - \\mathbb { E } _ { q ( \\mathbf { x } ) } [ \\log c ( \\mathbf { x } , \\mathbf { y } ) ] . } \\end{array}\n$$",
|
| 267 |
+
"text_format": "latex",
|
| 268 |
+
"bbox": [
|
| 269 |
+
266,
|
| 270 |
+
154,
|
| 271 |
+
732,
|
| 272 |
+
195
|
| 273 |
+
],
|
| 274 |
+
"page_idx": 2
|
| 275 |
+
},
|
| 276 |
+
{
|
| 277 |
+
"type": "text",
|
| 278 |
+
"text": "We are, in particular, interested in a general procedure for minimizing $F$ with respect to an approximate posterior $q ( \\mathbf { x } )$ for any differentiable $c$ when $p$ is a DDPM $( \\ S 2 . 2 )$ . ",
|
| 279 |
+
"bbox": [
|
| 280 |
+
173,
|
| 281 |
+
196,
|
| 282 |
+
826,
|
| 283 |
+
226
|
| 284 |
+
],
|
| 285 |
+
"page_idx": 2
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"type": "text",
|
| 289 |
+
"text": "A free energy of the same structure was also studied in [43], where a DDPM $p ( \\mathbf { z } )$ over a latent space is hybridized as a parent to a decoder $p ( \\mathbf { x } | \\mathbf { z } )$ , with an additional inference model $q ( \\mathbf { z } | \\mathbf { x } )$ trained jointly with both of these models. On the other hand, we aim to work with independently trained components that operate directly in the pixel space, e.g., an off-the-shelf diffusion model $p ( \\mathbf { x } )$ trained on images of faces and an off-the-shelf face classifier $p ( \\mathbf { y } \\vert \\mathbf { x } )$ , without training or finetuning them jointly (§3.2). ",
|
| 290 |
+
"bbox": [
|
| 291 |
+
173,
|
| 292 |
+
231,
|
| 293 |
+
825,
|
| 294 |
+
315
|
| 295 |
+
],
|
| 296 |
+
"page_idx": 2
|
| 297 |
+
},
|
| 298 |
+
{
|
| 299 |
+
"type": "text",
|
| 300 |
+
"text": "2.2 Denoising diffusion probabilistic models as priors ",
|
| 301 |
+
"text_level": 1,
|
| 302 |
+
"bbox": [
|
| 303 |
+
173,
|
| 304 |
+
330,
|
| 305 |
+
558,
|
| 306 |
+
347
|
| 307 |
+
],
|
| 308 |
+
"page_idx": 2
|
| 309 |
+
},
|
| 310 |
+
{
|
| 311 |
+
"type": "text",
|
| 312 |
+
"text": "Denoising diffusion probabilistic models (DDPMs) [39, 13] generate samples $\\mathbf { x } _ { \\mathrm { 0 } }$ by reversing a (Gaussian) noising process. DDPMs are deep directed stochastic networks: ",
|
| 313 |
+
"bbox": [
|
| 314 |
+
171,
|
| 315 |
+
356,
|
| 316 |
+
823,
|
| 317 |
+
385
|
| 318 |
+
],
|
| 319 |
+
"page_idx": 2
|
| 320 |
+
},
|
| 321 |
+
{
|
| 322 |
+
"type": "equation",
|
| 323 |
+
"img_path": "images/bd7100bc44531ee210e0a2220443d59e42b0377e33eded1cb46cdc2404129074.jpg",
|
| 324 |
+
"text": "$$\n\\begin{array} { r l } { p ( { \\mathbf x } _ { T } , { \\mathbf x } _ { T - 1 } , . . . , { \\mathbf x } _ { 0 } ) = p ( { \\mathbf x } _ { T } ) \\displaystyle \\prod _ { t = 1 } ^ { T } p _ { \\theta } ( { \\mathbf x } _ { t - 1 } \\mid { \\mathbf x } _ { t } ) , } & { } \\\\ { p _ { \\theta } ( { \\mathbf x } _ { t - 1 } \\mid { \\mathbf x } _ { t } ) = \\mathcal { N } ( { \\mathbf x } _ { t - 1 } ; \\mu _ { \\theta } ( { \\mathbf x } _ { t } , t ) , { \\boldsymbol \\Sigma } _ { \\theta } ( { \\mathbf x } _ { t } , t ) ) , \\qquad } & { p ( { \\mathbf x } _ { T } ) = \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) , } \\end{array}\n$$",
|
| 325 |
+
"text_format": "latex",
|
| 326 |
+
"bbox": [
|
| 327 |
+
230,
|
| 328 |
+
390,
|
| 329 |
+
766,
|
| 330 |
+
454
|
| 331 |
+
],
|
| 332 |
+
"page_idx": 2
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"type": "text",
|
| 336 |
+
"text": "where $\\mu _ { \\theta }$ and $\\Sigma _ { \\theta }$ are neural networks with learned parameters (often, as in this paper, $\\Sigma _ { \\theta }$ is fixed to a scalar diagonal matrix depending on $t$ ). The model starts with a sample from a unit Gaussian $\\mathbf { x } _ { T }$ and successively transforms it with a nonlinear network $\\mu _ { \\theta } ( \\mathbf { x } _ { t } , t )$ adding a small Gaussian innovation signal at each step according to a noise schedule. After $T$ steps, the sample $\\mathbf { x } = \\mathbf { x } _ { 0 }$ is obtained. ",
|
| 337 |
+
"bbox": [
|
| 338 |
+
174,
|
| 339 |
+
458,
|
| 340 |
+
823,
|
| 341 |
+
515
|
| 342 |
+
],
|
| 343 |
+
"page_idx": 2
|
| 344 |
+
},
|
| 345 |
+
{
|
| 346 |
+
"type": "text",
|
| 347 |
+
"text": "In general, using such a model as a prior over $\\mathbf { x }$ would require an intractable integration over latent variables $\\mathbf { h } = ( \\mathbf { x } _ { T } , . . . , \\mathbf { x } _ { 1 } )$ : ",
|
| 348 |
+
"bbox": [
|
| 349 |
+
173,
|
| 350 |
+
520,
|
| 351 |
+
823,
|
| 352 |
+
549
|
| 353 |
+
],
|
| 354 |
+
"page_idx": 2
|
| 355 |
+
},
|
| 356 |
+
{
|
| 357 |
+
"type": "equation",
|
| 358 |
+
"img_path": "images/ed7eba44f46e86414aea45d70a891f062099941f4942dc734b8c7e2f1c5e643f.jpg",
|
| 359 |
+
"text": "$$\np ( \\mathbf { x } ) = \\int _ { \\mathbf { h } } p ( \\mathbf { x } _ { T } , \\mathbf { x } _ { T - 1 } , . . . , \\mathbf { x } _ { 1 } , \\mathbf { x } _ { 0 } = \\mathbf { x } ) d \\mathbf { x } _ { T } \\cdot . . . d \\mathbf { x } _ { 1 } .\n$$",
|
| 360 |
+
"text_format": "latex",
|
| 361 |
+
"bbox": [
|
| 362 |
+
321,
|
| 363 |
+
554,
|
| 364 |
+
676,
|
| 365 |
+
588
|
| 366 |
+
],
|
| 367 |
+
"page_idx": 2
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"type": "text",
|
| 371 |
+
"text": "However, DDPMs are trained under the assumption that the posterior $q \\big ( \\mathbf { x } _ { t } | \\mathbf { x } _ { t - 1 } \\big )$ is a simple diffusion process that successively adds Gaussian noise according to a predefined schedule $\\beta _ { t }$ : ",
|
| 372 |
+
"bbox": [
|
| 373 |
+
171,
|
| 374 |
+
593,
|
| 375 |
+
821,
|
| 376 |
+
622
|
| 377 |
+
],
|
| 378 |
+
"page_idx": 2
|
| 379 |
+
},
|
| 380 |
+
{
|
| 381 |
+
"type": "equation",
|
| 382 |
+
"img_path": "images/d76e5dcbe5f1c9a5cefafade1537461494a7281c67b0eabc00f2b03c9d2af97e.jpg",
|
| 383 |
+
"text": "$$\nq ( \\mathbf { x } _ { t } \\mid \\mathbf { x } _ { t - 1 } ) = { \\mathcal { N } } ( \\mathbf { x } _ { t } ; { \\sqrt { 1 - { \\beta _ { t } } } } \\mathbf { x } _ { t - 1 } , \\beta _ { t } \\mathbf { I } ) , \\quad t = 1 , \\ldots , T .\n$$",
|
| 384 |
+
"text_format": "latex",
|
| 385 |
+
"bbox": [
|
| 386 |
+
303,
|
| 387 |
+
628,
|
| 388 |
+
694,
|
| 389 |
+
648
|
| 390 |
+
],
|
| 391 |
+
"page_idx": 2
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"type": "text",
|
| 395 |
+
"text": "Therefore, if $p ( \\mathbf { x } )$ is the likelihood (5) of $\\mathbf { x }$ under a DDPM, then in the first expectation of (2) we should use $q ( \\mathbf { h } = \\{ \\mathbf { x } _ { T } , . . . , \\mathbf { x } _ { 1 } \\} | \\mathbf { x } _ { 0 } = \\mathbf { x } ) = \\prod _ { t = 1 } ^ { T } q ( \\mathbf { x } _ { t } \\mid \\mathbf { x } _ { t - 1 } )$ . The simplest approximation to the posterior over $\\mathbf { x } = \\mathbf { x } _ { 0 }$ is a point estimate: ",
|
| 396 |
+
"bbox": [
|
| 397 |
+
173,
|
| 398 |
+
654,
|
| 399 |
+
825,
|
| 400 |
+
699
|
| 401 |
+
],
|
| 402 |
+
"page_idx": 2
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"type": "equation",
|
| 406 |
+
"img_path": "images/947ce34d3a05de9c00ba2b1d182a956687911c23b323ff7e4bafdaadd5dd332f.jpg",
|
| 407 |
+
"text": "$$\nq ( \\mathbf { x } ) = \\delta ( \\mathbf { x } - \\pmb { \\eta } )\n$$",
|
| 408 |
+
"text_format": "latex",
|
| 409 |
+
"bbox": [
|
| 410 |
+
441,
|
| 411 |
+
705,
|
| 412 |
+
558,
|
| 413 |
+
723
|
| 414 |
+
],
|
| 415 |
+
"page_idx": 2
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"type": "text",
|
| 419 |
+
"text": "where by $\\delta$ we denote the Dirac delta function. Thus, we can sample $\\mathbf { x } _ { t }$ at any arbitrary time step using the forward noising process as ",
|
| 420 |
+
"bbox": [
|
| 421 |
+
171,
|
| 422 |
+
728,
|
| 423 |
+
823,
|
| 424 |
+
757
|
| 425 |
+
],
|
| 426 |
+
"page_idx": 2
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
"type": "equation",
|
| 430 |
+
"img_path": "images/8c9e426f8a835be26b3656aaf16a6928a18b0e43ed2254ffc4affeeaf310a657.jpg",
|
| 431 |
+
"text": "$$\n\\begin{array} { r } { q ( \\mathbf { x } _ { t } ) = \\mathcal { N } ( \\mathbf { x } _ { t } ; \\sqrt { \\bar { \\alpha } _ { t } } \\pmb { \\eta } , ( 1 - \\bar { \\alpha } _ { t } ) \\mathbf { I } ) } \\end{array}\n$$",
|
| 432 |
+
"text_format": "latex",
|
| 433 |
+
"bbox": [
|
| 434 |
+
385,
|
| 435 |
+
762,
|
| 436 |
+
611,
|
| 437 |
+
781
|
| 438 |
+
],
|
| 439 |
+
"page_idx": 2
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"type": "text",
|
| 443 |
+
"text": "where $\\alpha _ { t } = 1 - \\beta _ { t }$ and $\\textstyle { \\bar { \\alpha } } _ { t } = \\prod _ { i = 1 } ^ { t } \\alpha _ { t }$ . Analogously to [13], we can also extract a conditional Gaussian $q ( \\mathbf { x } _ { t - 1 } \\mid \\mathbf { x } _ { t } , \\pmb { \\eta } )$ and express the first expectation in (2) as ",
|
| 444 |
+
"bbox": [
|
| 445 |
+
174,
|
| 446 |
+
786,
|
| 447 |
+
826,
|
| 448 |
+
818
|
| 449 |
+
],
|
| 450 |
+
"page_idx": 2
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"type": "equation",
|
| 454 |
+
"img_path": "images/65c7c23b15394b797970cebabc27eb6168444a35bcf1fc07a40600113c786040.jpg",
|
| 455 |
+
"text": "$$\n- \\mathbb { E } _ { q ( \\mathbf { x } ) q ( \\mathbf { h } \\mid \\mathbf { x } ) } [ \\log p ( \\mathbf { x } , \\mathbf { h } ) - \\log q ( \\mathbf { x } ) q ( \\mathbf { h } \\mid \\mathbf { x } ) ] = \\sum _ { t } { \\mathrm { K L } } ( q ( \\mathbf { x } _ { t - 1 } \\mid \\mathbf { x } _ { t } , \\eta ) \\parallel p _ { \\theta } ( \\mathbf { x } _ { t - 1 } \\mid \\mathbf { x } _ { t } ) ) ,\n$$",
|
| 456 |
+
"text_format": "latex",
|
| 457 |
+
"bbox": [
|
| 458 |
+
196,
|
| 459 |
+
823,
|
| 460 |
+
779,
|
| 461 |
+
857
|
| 462 |
+
],
|
| 463 |
+
"page_idx": 2
|
| 464 |
+
},
|
| 465 |
+
{
|
| 466 |
+
"type": "text",
|
| 467 |
+
"text": "which after reparametrization [13] leads to ",
|
| 468 |
+
"bbox": [
|
| 469 |
+
173,
|
| 470 |
+
861,
|
| 471 |
+
455,
|
| 472 |
+
877
|
| 473 |
+
],
|
| 474 |
+
"page_idx": 2
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"type": "equation",
|
| 478 |
+
"img_path": "images/95e3e956ddc9fa6cd1be0b2470df158cd3a1688c484acc4d01cd684b10c00b47.jpg",
|
| 479 |
+
"text": "$$\n\\sum _ { t } w _ { t } ( \\beta ) \\mathbb { E } _ { \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) } [ \\| \\epsilon - \\epsilon _ { \\theta } ( \\mathbf { x } _ { t } , t ) \\| _ { 2 } ^ { 2 } ] , \\quad \\mathbf { x } _ { t } = \\sqrt { \\bar { \\alpha } _ { t } } \\eta + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon ,\n$$",
|
| 480 |
+
"text_format": "latex",
|
| 481 |
+
"bbox": [
|
| 482 |
+
274,
|
| 483 |
+
882,
|
| 484 |
+
720,
|
| 485 |
+
915
|
| 486 |
+
],
|
| 487 |
+
"page_idx": 2
|
| 488 |
+
},
|
| 489 |
+
{
|
| 490 |
+
"type": "text",
|
| 491 |
+
"text": "Algorithm 1 Inferring a point estimate of $p ( \\mathbf { x } | \\mathbf { y } ) \\approx \\delta ( \\mathbf { x } - \\pmb { \\eta } )$ , under a DDPM prior and constraint. ",
|
| 492 |
+
"bbox": [
|
| 493 |
+
171,
|
| 494 |
+
90,
|
| 495 |
+
820,
|
| 496 |
+
107
|
| 497 |
+
],
|
| 498 |
+
"page_idx": 3
|
| 499 |
+
},
|
| 500 |
+
{
|
| 501 |
+
"type": "text",
|
| 502 |
+
"text": "input pretrained DDPM $\\epsilon _ { \\theta }$ , auxiliary data $\\mathbf { y }$ , constraint $c$ , time schedule $( t _ { i } ) _ { i = 1 } ^ { T }$ , learning rate $\\lambda$ 1: Initialize $\\mathbf { x } \\sim \\mathcal { N } ( \\mathbf { 0 ; I } )$ . ",
|
| 503 |
+
"bbox": [
|
| 504 |
+
179,
|
| 505 |
+
111,
|
| 506 |
+
812,
|
| 507 |
+
138
|
| 508 |
+
],
|
| 509 |
+
"page_idx": 3
|
| 510 |
+
},
|
| 511 |
+
{
|
| 512 |
+
"type": "text",
|
| 513 |
+
"text": "2: for $i = T . . 1$ do \n3: Sample $\\mathbf { \\epsilon } \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 ; I } )$ \n4: $\\mathbf { x } _ { t _ { i } } = \\sqrt { \\bar { \\alpha } _ { t _ { i } } } \\mathbf { x } + \\sqrt { 1 - \\bar { \\alpha } _ { t _ { i } } } \\epsilon$ \n5: $\\mathbf { x } \\mathbf { x } - \\lambda \\nabla _ { \\mathbf { x } } [ \\| \\epsilon - \\epsilon _ { \\theta } ( \\mathbf { x } _ { t _ { i } } , t _ { i } ) \\| _ { 2 } ^ { 2 } - \\log c ( \\mathbf { x } , \\mathbf { y } ) ]$ \n6: end for ",
|
| 514 |
+
"bbox": [
|
| 515 |
+
179,
|
| 516 |
+
126,
|
| 517 |
+
535,
|
| 518 |
+
209
|
| 519 |
+
],
|
| 520 |
+
"page_idx": 3
|
| 521 |
+
},
|
| 522 |
+
{
|
| 523 |
+
"type": "text",
|
| 524 |
+
"text": "output $\\mathbf { \\eta } _ { \\eta } = \\mathbf { x }$ ",
|
| 525 |
+
"bbox": [
|
| 526 |
+
173,
|
| 527 |
+
210,
|
| 528 |
+
272,
|
| 529 |
+
223
|
| 530 |
+
],
|
| 531 |
+
"page_idx": 3
|
| 532 |
+
},
|
| 533 |
+
{
|
| 534 |
+
"type": "text",
|
| 535 |
+
"text": "where the stage $t$ noise reconstruction $\\epsilon _ { \\theta } ( \\mathbf { x } _ { t } , t )$ is a linear transformation of the model’s expectation $\\mu _ { \\theta } ( \\mathbf { x } _ { t } , t )$ : ",
|
| 536 |
+
"bbox": [
|
| 537 |
+
173,
|
| 538 |
+
252,
|
| 539 |
+
821,
|
| 540 |
+
280
|
| 541 |
+
],
|
| 542 |
+
"page_idx": 3
|
| 543 |
+
},
|
| 544 |
+
{
|
| 545 |
+
"type": "equation",
|
| 546 |
+
"img_path": "images/6cc11e818c58e828734d15afe302a2a51963a0549dfa7709090f0438dd14da7f.jpg",
|
| 547 |
+
"text": "$$\n{ \\pmb \\mu } _ { \\theta } ( { \\bf x } _ { t } , t ) = \\frac { 1 } { \\sqrt { \\alpha _ { t } } } \\left( { \\bf x } _ { t } - \\frac { \\beta _ { t } } { \\sqrt { 1 - \\bar { \\alpha } _ { t } } } { \\pmb \\epsilon } _ { \\theta } ( { \\bf x } _ { t } , t ) \\right) .\n$$",
|
| 548 |
+
"text_format": "latex",
|
| 549 |
+
"bbox": [
|
| 550 |
+
344,
|
| 551 |
+
279,
|
| 552 |
+
651,
|
| 553 |
+
314
|
| 554 |
+
],
|
| 555 |
+
"page_idx": 3
|
| 556 |
+
},
|
| 557 |
+
{
|
| 558 |
+
"type": "text",
|
| 559 |
+
"text": "The weighting $w _ { t } ( \\beta )$ is generally a function of the noise schedule, but in most pretrained diffusion models it is set to 1. Thus, the free energy in (2) reduces to ",
|
| 560 |
+
"bbox": [
|
| 561 |
+
171,
|
| 562 |
+
316,
|
| 563 |
+
825,
|
| 564 |
+
344
|
| 565 |
+
],
|
| 566 |
+
"page_idx": 3
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "equation",
|
| 570 |
+
"img_path": "images/847bb32dc69de9559ead4cb92fe07bf3db23e0af863adc34f135920fb8b19097.jpg",
|
| 571 |
+
"text": "$$\n\\begin{array} { l } { F = \\displaystyle \\sum _ { t } \\mathbb { E } _ { \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) } [ \\| \\epsilon - \\epsilon _ { \\theta } ( \\mathbf { x } _ { t } , t ) \\| _ { 2 } ^ { 2 } ] - \\mathbb { E } _ { q ( \\mathbf { x } ) } [ \\log c ( \\mathbf { x } , \\mathbf { y } ) ] } \\\\ { = \\displaystyle \\sum _ { t } \\mathbb { E } _ { \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) } [ \\| \\epsilon - \\epsilon _ { \\theta } ( \\mathbf { x } _ { t } , t ) \\| _ { 2 } ^ { 2 } ] - \\log c ( \\eta , \\mathbf { y } ) , \\quad \\mathbf { x } _ { t } = \\sqrt { \\bar { \\alpha } _ { t } } \\eta + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon . } \\end{array}\n$$",
|
| 572 |
+
"text_format": "latex",
|
| 573 |
+
"bbox": [
|
| 574 |
+
233,
|
| 575 |
+
349,
|
| 576 |
+
764,
|
| 577 |
+
416
|
| 578 |
+
],
|
| 579 |
+
"page_idx": 3
|
| 580 |
+
},
|
| 581 |
+
{
|
| 582 |
+
"type": "text",
|
| 583 |
+
"text": "The first term is the cost usually used to learn the parameters $\\theta$ of the diffusion model. To perform inference under an already trained model $\\epsilon _ { \\theta }$ , we instead minimize $F$ with respect to $\\eta$ through sampling $\\epsilon$ in the summands over $t$ . ",
|
| 584 |
+
"bbox": [
|
| 585 |
+
178,
|
| 586 |
+
420,
|
| 587 |
+
821,
|
| 588 |
+
462
|
| 589 |
+
],
|
| 590 |
+
"page_idx": 3
|
| 591 |
+
},
|
| 592 |
+
{
|
| 593 |
+
"type": "text",
|
| 594 |
+
"text": "A similar derivation applies if a Gaussian approximation to the posterior $q ( \\mathbf { x } )$ is used (see $\\ S \\mathrm { A }$ ). Such an approximation allows to model not only a mode of the posterior, but the uncertainty in its vicinity. ",
|
| 595 |
+
"bbox": [
|
| 596 |
+
173,
|
| 597 |
+
468,
|
| 598 |
+
825,
|
| 599 |
+
497
|
| 600 |
+
],
|
| 601 |
+
"page_idx": 3
|
| 602 |
+
},
|
| 603 |
+
{
|
| 604 |
+
"type": "text",
|
| 605 |
+
"text": "We summarize the algorithm for a point estimate $q ( \\mathbf { x } )$ as Algorithm 1. Variations on this algorithm are possible. Depending on how close to a good mode we can initialize $\\eta$ , this optimization may involve summing only over $t \\leq t _ { \\operatorname* { m a x } } < T$ ; different time step schedules can be considered depending on the desired diversity in the estimated x. Note that optimization is stochastic and each time it is run it can produce different point estimates of $\\mathbf { x }$ which are are both likely under the diffusion prior and satisfy the constraint as much as possible. ",
|
| 606 |
+
"bbox": [
|
| 607 |
+
173,
|
| 608 |
+
502,
|
| 609 |
+
825,
|
| 610 |
+
587
|
| 611 |
+
],
|
| 612 |
+
"page_idx": 3
|
| 613 |
+
},
|
| 614 |
+
{
|
| 615 |
+
"type": "text",
|
| 616 |
+
"text": "We observed that optimizing simultaneously for all $t$ makes it difficult to guide the sample towards a mode in image generation applications; therefore, we anneal $t$ from high to low values. Intuitively, the first few iterations of gradient descent should coarsely explore the search space, while later iterations gradually reduce the temperature to steadily reach a nearby local maximum of $p ( \\mathbf { x } | \\mathbf { y } )$ . Examples of annealing schedules designed for the tasks demonstrated in $\\ S 3 , 4 , 5$ are presented in the Appendix (Fig. B.1). ",
|
| 617 |
+
"bbox": [
|
| 618 |
+
173,
|
| 619 |
+
592,
|
| 620 |
+
825,
|
| 621 |
+
676
|
| 622 |
+
],
|
| 623 |
+
"page_idx": 3
|
| 624 |
+
},
|
| 625 |
+
{
|
| 626 |
+
"type": "text",
|
| 627 |
+
"text": "Another interesting case is when $\\mathbf { x }$ is parametrized through a latent variable (this can be seen as a case of a hard, non-differentiable constraint: if $\\mathbf { x }$ is a deterministic function of $\\mathbf { y }$ , $\\mathbf { x } = f ( \\mathbf { y } )$ , then $c ( \\mathbf { x } , \\mathbf { y } )$ is supported on the corresponding manifold). Then the procedure in Algorithm 1 can be performed with gradient descent steps with respect to $\\mathbf { y }$ on ",
|
| 628 |
+
"bbox": [
|
| 629 |
+
173,
|
| 630 |
+
681,
|
| 631 |
+
825,
|
| 632 |
+
738
|
| 633 |
+
],
|
| 634 |
+
"page_idx": 3
|
| 635 |
+
},
|
| 636 |
+
{
|
| 637 |
+
"type": "equation",
|
| 638 |
+
"img_path": "images/f56b7d29147af83ebbf33db1a9f682b7a057ded03cb9727f59f2e35f4c8da906.jpg",
|
| 639 |
+
"text": "$$\n\\| \\epsilon - \\epsilon _ { \\theta } \\big ( \\sqrt { \\bar { \\alpha } _ { t _ { i } } } f ( \\mathbf { y } ) + \\sqrt { 1 - \\bar { \\alpha } _ { t _ { i } } } \\epsilon , t _ { i } \\big ) \\| _ { 2 } ^ { 2 }\n$$",
|
| 640 |
+
"text_format": "latex",
|
| 641 |
+
"bbox": [
|
| 642 |
+
366,
|
| 643 |
+
742,
|
| 644 |
+
632,
|
| 645 |
+
762
|
| 646 |
+
],
|
| 647 |
+
"page_idx": 3
|
| 648 |
+
},
|
| 649 |
+
{
|
| 650 |
+
"type": "text",
|
| 651 |
+
"text": "instead of steps 4 and 5. (For some semantics of the latent representation, one may wish to make the prior on $\\mathbf { x }$ the pushforward by $f$ of a known prior on the latent $\\mathbf { y }$ . In this case, (13) must be weighted by the Jacobian of $f$ at y.) ",
|
| 652 |
+
"bbox": [
|
| 653 |
+
173,
|
| 654 |
+
766,
|
| 655 |
+
825,
|
| 656 |
+
809
|
| 657 |
+
],
|
| 658 |
+
"page_idx": 3
|
| 659 |
+
},
|
| 660 |
+
{
|
| 661 |
+
"type": "text",
|
| 662 |
+
"text": "3 Experiments: Conditional image generation ",
|
| 663 |
+
"text_level": 1,
|
| 664 |
+
"bbox": [
|
| 665 |
+
173,
|
| 666 |
+
827,
|
| 667 |
+
573,
|
| 668 |
+
844
|
| 669 |
+
],
|
| 670 |
+
"page_idx": 3
|
| 671 |
+
},
|
| 672 |
+
{
|
| 673 |
+
"type": "text",
|
| 674 |
+
"text": "3.1 Simple illustration on MNIST ",
|
| 675 |
+
"text_level": 1,
|
| 676 |
+
"bbox": [
|
| 677 |
+
174,
|
| 678 |
+
857,
|
| 679 |
+
419,
|
| 680 |
+
872
|
| 681 |
+
],
|
| 682 |
+
"page_idx": 3
|
| 683 |
+
},
|
| 684 |
+
{
|
| 685 |
+
"type": "text",
|
| 686 |
+
"text": "We first explore the idea of generating conditional samples from an unconditional diffusion model on MNIST. We train the DDPM model of [7] on MNIST digits and experiment with different sets of constraints $\\log c ( \\mathbf { x } , \\mathbf { y } )$ to generate samples with specific attributes. The examples in Fig. 1 showcase such generated samples. For the digit in (a) we set the constraint $\\log c$ to be the unnormalized score of ‘thin’ digits, computed as negative of the average image intensity, whereas in (b) we invert that and generate a ‘thick’ digit with high mean intensity. Similarly, in (c) and (d) we hand-craft a score that penalizes the vertical and horizontal symmetry respectively, by computing the $L ^ { 2 }$ distance between the two folds (vertical/horizontal) of the digit $\\mathbf { x }$ , which leads to the generation of skewed, non-symmetric samples. ",
|
| 687 |
+
"bbox": [
|
| 688 |
+
173,
|
| 689 |
+
882,
|
| 690 |
+
823,
|
| 691 |
+
912
|
| 692 |
+
],
|
| 693 |
+
"page_idx": 3
|
| 694 |
+
},
|
| 695 |
+
{
|
| 696 |
+
"type": "image",
|
| 697 |
+
"img_path": "images/700a513b3693d38023231dd3c286a071428b21e6d5b8b5052e126d816ee199b9.jpg",
|
| 698 |
+
"image_caption": [
|
| 699 |
+
"Figure 1: Inferred MNIST samples under different conditions $c ( \\mathbf { x } , \\mathbf { y } )$ . "
|
| 700 |
+
],
|
| 701 |
+
"image_footnote": [],
|
| 702 |
+
"bbox": [
|
| 703 |
+
246,
|
| 704 |
+
87,
|
| 705 |
+
748,
|
| 706 |
+
169
|
| 707 |
+
],
|
| 708 |
+
"page_idx": 4
|
| 709 |
+
},
|
| 710 |
+
{
|
| 711 |
+
"type": "text",
|
| 712 |
+
"text": "",
|
| 713 |
+
"bbox": [
|
| 714 |
+
174,
|
| 715 |
+
217,
|
| 716 |
+
825,
|
| 717 |
+
314
|
| 718 |
+
],
|
| 719 |
+
"page_idx": 4
|
| 720 |
+
},
|
| 721 |
+
{
|
| 722 |
+
"type": "text",
|
| 723 |
+
"text": "We also showcase how the auxiliary constraint $c ( \\mathbf { x } , \\mathbf { y } )$ can be modeled by a different, independently trained network. The digit in Fig. 1 (e) is generated by constraining the DDPM with a classifier network that is separately trained to distinguish between the digit class $\\mathbf y = 3$ and all other digits. The auxiliary constraint in this case is the likelihood of the inferred digit, as it is estimated by the classifier. Finally, for (f) we multiply horizontal symmetry and digit classifier constraints, prompting the inference procedure to generate a perfectly centered and symmetric digit. Details of model training and inference can be found in the Appendix $( \\ S \\mathbf { B } . 1 )$ . ",
|
| 724 |
+
"bbox": [
|
| 725 |
+
173,
|
| 726 |
+
319,
|
| 727 |
+
825,
|
| 728 |
+
417
|
| 729 |
+
],
|
| 730 |
+
"page_idx": 4
|
| 731 |
+
},
|
| 732 |
+
{
|
| 733 |
+
"type": "text",
|
| 734 |
+
"text": "3.2 Using off-the-shelf components for conditional generation of faces ",
|
| 735 |
+
"text_level": 1,
|
| 736 |
+
"bbox": [
|
| 737 |
+
176,
|
| 738 |
+
433,
|
| 739 |
+
668,
|
| 740 |
+
448
|
| 741 |
+
],
|
| 742 |
+
"page_idx": 4
|
| 743 |
+
},
|
| 744 |
+
{
|
| 745 |
+
"type": "text",
|
| 746 |
+
"text": "We consider the generation of natural images with a pretrained DDPM prior and a learned constraint. We utilize the pretrained DDPM network on FFHQ-256 [19] from [3] and a pretrained ResNet-18 face attribute classifier on CelebA [25]. The attribute classifier computes the likelihood of presence of various facial features $y$ in a given image x, as they are defined by the CelebA dataset. Examples of such features are no beard, smiling, blond hair and male. To generate a conditional sample from the unconditional DDPM network we select a subset of these and enforce their presence or absence using the classifier predicted likelihoods as our constraint $c$ . If $\\mathbf { y }$ is a set of attributes we wish to be present, the constraint $\\log c ( \\mathbf { x } , \\mathbf { y } )$ can be expressed as ",
|
| 747 |
+
"bbox": [
|
| 748 |
+
173,
|
| 749 |
+
458,
|
| 750 |
+
825,
|
| 751 |
+
570
|
| 752 |
+
],
|
| 753 |
+
"page_idx": 4
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"type": "equation",
|
| 757 |
+
"img_path": "images/979642e0ed3c001a1a0a3c341685e4135fbce8dab522a063536030f0b0ca4a26.jpg",
|
| 758 |
+
"text": "$$\n\\log c ( \\mathbf { x } , \\mathbf { y } ) = \\sum _ { y \\in \\mathbf { y } } \\log p ( y \\mid \\mathbf { x } )\n$$",
|
| 759 |
+
"text_format": "latex",
|
| 760 |
+
"bbox": [
|
| 761 |
+
398,
|
| 762 |
+
574,
|
| 763 |
+
599,
|
| 764 |
+
609
|
| 765 |
+
],
|
| 766 |
+
"page_idx": 4
|
| 767 |
+
},
|
| 768 |
+
{
|
| 769 |
+
"type": "text",
|
| 770 |
+
"text": "We only strictly enforce a small subset of facial attributes and therefore $\\mathbf { x }$ is allowed to converge towards different modes that correspond to samples that exhibit, in varying levels, the desired features. ",
|
| 771 |
+
"bbox": [
|
| 772 |
+
173,
|
| 773 |
+
614,
|
| 774 |
+
825,
|
| 775 |
+
643
|
| 776 |
+
],
|
| 777 |
+
"page_idx": 4
|
| 778 |
+
},
|
| 779 |
+
{
|
| 780 |
+
"type": "text",
|
| 781 |
+
"text": "In Fig. 2 we demonstrate our ability to infer conditional samples $\\mathbf { x }$ with desired attributes y, using only the unconditional diffusion model and the classifier $p ( \\mathbf { y } \\mid \\mathbf { x } )$ . In the first row, we show the results of the optimization procedure of Algorithm 1 for various attributes. The classifier objective $c ( \\mathbf { x } , \\mathbf { y } )$ manipulates the image with the goal of making the classifier network produce the desired attribute predictions, whereas the diffusion objective attempts to pull the sample $x$ towards the learned distribution $p ( \\mathbf { x } )$ . If we ignored the denoising loss, the result would be some adversarial noise that fools the classifier network. The DDPM prior, however, is strong enough to guide the process towards realistic-looking images that simultaneously satisfy the classifier constraint set. ",
|
| 782 |
+
"bbox": [
|
| 783 |
+
173,
|
| 784 |
+
647,
|
| 785 |
+
825,
|
| 786 |
+
761
|
| 787 |
+
],
|
| 788 |
+
"page_idx": 4
|
| 789 |
+
},
|
| 790 |
+
{
|
| 791 |
+
"type": "text",
|
| 792 |
+
"text": "We notice that the generated samples $\\mathbf { x }$ , although having converged towards a correct mode of $p ( \\mathbf { x } )$ , still exhibit a noticeable amount of noise related to the optimization of classifier objective. To address that, inspired by [31], we simply denoise the image using the DDPM model alone, starting from the low noise level $t = 2 0 0$ so as to retain the overall structure. The results of this denoising are shown in the second row of Fig. 2. ",
|
| 793 |
+
"bbox": [
|
| 794 |
+
174,
|
| 795 |
+
766,
|
| 796 |
+
825,
|
| 797 |
+
835
|
| 798 |
+
],
|
| 799 |
+
"page_idx": 4
|
| 800 |
+
},
|
| 801 |
+
{
|
| 802 |
+
"type": "text",
|
| 803 |
+
"text": "In Fig. 3 we showcase the intermediate steps of the optimization process for inference with the conditions blond hair+smiling+not male, thus solving a problem like that studied in [8] using only independently trained attribute classifiers and an unconditional generative model of faces. The sample $x$ is initialized with Gaussian noise $\\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } )$ , and as we perform gradient steps with decreasing values of $t$ , we observe facial features being added in a coarse-to-fine manner. ",
|
| 804 |
+
"bbox": [
|
| 805 |
+
174,
|
| 806 |
+
842,
|
| 807 |
+
823,
|
| 808 |
+
911
|
| 809 |
+
],
|
| 810 |
+
"page_idx": 4
|
| 811 |
+
},
|
| 812 |
+
{
|
| 813 |
+
"type": "image",
|
| 814 |
+
"img_path": "images/97da308abf9705f1272f007156fde80f1ec179d39f25d7dc581b36fd00ab37f8.jpg",
|
| 815 |
+
"image_caption": [
|
| 816 |
+
"Figure 2: First row: Conditional FFHQ samples $\\mathbf { x }$ for constraints $c ( \\mathbf { x } , \\mathbf { y } )$ with various attribute sets y. Second row: denoising as in [31] to remove artifacts that appear when optimizing with a classifier network enforcing the constraint. "
|
| 817 |
+
],
|
| 818 |
+
"image_footnote": [],
|
| 819 |
+
"bbox": [
|
| 820 |
+
179,
|
| 821 |
+
87,
|
| 822 |
+
812,
|
| 823 |
+
272
|
| 824 |
+
],
|
| 825 |
+
"page_idx": 5
|
| 826 |
+
},
|
| 827 |
+
{
|
| 828 |
+
"type": "image",
|
| 829 |
+
"img_path": "images/3707bf076b1bfc9c53a2d0f9b5be6c4639e4b5c25c5ba3f404d156f08853f2b6.jpg",
|
| 830 |
+
"image_caption": [
|
| 831 |
+
"Figure 3: FFHQ conditional generation for $\\mathbf { y } = \\{ B l o n d e , S m i l i n g , F e m a l e \\}$ . The last step performs denoising as in [31] to remove artifacts that appear when training on a classifier as a constraint. "
|
| 832 |
+
],
|
| 833 |
+
"image_footnote": [],
|
| 834 |
+
"bbox": [
|
| 835 |
+
184,
|
| 836 |
+
335,
|
| 837 |
+
813,
|
| 838 |
+
397
|
| 839 |
+
],
|
| 840 |
+
"page_idx": 5
|
| 841 |
+
},
|
| 842 |
+
{
|
| 843 |
+
"type": "text",
|
| 844 |
+
"text": "In the Appendix $( \\ S \\mathbf { B } . 2 )$ we provide additional samples and further discuss the sample quality in comparison to unconditional generation. We also present results on inference with conflicting attributes as well as common failure cases. ",
|
| 845 |
+
"bbox": [
|
| 846 |
+
174,
|
| 847 |
+
463,
|
| 848 |
+
825,
|
| 849 |
+
505
|
| 850 |
+
],
|
| 851 |
+
"page_idx": 5
|
| 852 |
+
},
|
| 853 |
+
{
|
| 854 |
+
"type": "text",
|
| 855 |
+
"text": "4 Experiments: Semantic image segmentation ",
|
| 856 |
+
"text_level": 1,
|
| 857 |
+
"bbox": [
|
| 858 |
+
173,
|
| 859 |
+
525,
|
| 860 |
+
571,
|
| 861 |
+
542
|
| 862 |
+
],
|
| 863 |
+
"page_idx": 5
|
| 864 |
+
},
|
| 865 |
+
{
|
| 866 |
+
"type": "text",
|
| 867 |
+
"text": "We test the applicability of diffusion priors in discrete tasks, such as inferring semantic segmentations from images. For this purpose, we use the EnviroAtlas dataset [32] which is composed of 5-class, 1m-resolution land cover labels from four geographically diverse cities across the US; Pittsburgh, PA, Durham, NC, Austin, TX and Phoenix, AZ. We only have access to the high resolution labels from Pittsburgh, and the task is to infer the land cover labels in the other three cities, given only probabilistic weak labels $\\ell _ { \\mathrm { w e a k } }$ derived from coarse auxiliary data [34]. We use Algorithm 1 to perform an inference procedure that does not directly take imagery as input, but uses constraints derived from unsupervised color clustering. We use only cluster indices in inference, making the algorithm dependent on image structure, but not color. Local cluster indices as a representation have a promise of extreme domain transferability, but they require a form of a combinatorial search which matches local cluster indices to semantic labels so that the created shapes resemble previously observed land cover, as captured by a denoising diffusion model of semantic segmentations. ",
|
| 868 |
+
"bbox": [
|
| 869 |
+
174,
|
| 870 |
+
558,
|
| 871 |
+
825,
|
| 872 |
+
723
|
| 873 |
+
],
|
| 874 |
+
"page_idx": 5
|
| 875 |
+
},
|
| 876 |
+
{
|
| 877 |
+
"type": "text",
|
| 878 |
+
"text": "DDPM on semantic pixel labels. We train a DDPM model on the $\\textstyle { \\frac { 1 } { 4 } }$ -resolution one-hot representations of the land cover labels, using the U-Net diffusion model architecture from [7]. To convert the one-hot diffusion samples to probabilities we follow [15] and assume that for any pixel $i$ in the inferred sample x, the distribution over the label $\\ell$ is, $\\begin{array} { r } { p ( \\ell _ { i } ) \\propto \\int _ { 0 . 5 } ^ { 1 . 5 } \\mathcal { N } ( x _ { i } ^ { \\ell } \\mid \\eta _ { i } , \\sigma ) } \\end{array}$ , where $\\sigma$ is user-defined a parameter. We chose this approach for its simplicity and ease to apply in our inference setting of Algorithm 1. Alternatively, we could use diffusion models for categorical data [14] with the appropriate modifications to our inference procedure. Samples drawn from the learned distribution are presented in Fig 4. ",
|
| 879 |
+
"bbox": [
|
| 880 |
+
174,
|
| 881 |
+
739,
|
| 882 |
+
825,
|
| 883 |
+
854
|
| 884 |
+
],
|
| 885 |
+
"page_idx": 5
|
| 886 |
+
},
|
| 887 |
+
{
|
| 888 |
+
"type": "text",
|
| 889 |
+
"text": "Inferring semantic segmentations. In order to infer the segmentation of a single image, under the diffusion prior, we directly apply Algorithm 1 with a hand-crafted constraint $c$ which provides structural and label guidance. To construct $c$ , we first compute a local color clustering $\\mathbf { z }$ of input the image ( $\\Re \\mathrm { B } . 3$ in the Appendix). In addition, we utilize the available weak labels $\\ell _ { \\mathrm { w e a k } }$ [34] and force the predicted segments’ distribution to match the weak label distribution when averaged in non-overlapping blocks. We combine the two objectives in a single constraint $c ( { \\bf x } , { \\bf z } , \\ell _ { \\mathrm { w e a k } } )$ by (i) computing the mutual information between the color clustering $\\mathbf { z }$ and the predicted labels $\\mathbf { x }$ , transformed into a valid probability distribution from the inferred one-hot vectors, in overlapping image patches and (ii) computing the negative KL divergence between the average predicted distribution and the distribution given by the weak labels in non-overlapping blocks ",
|
| 890 |
+
"bbox": [
|
| 891 |
+
176,
|
| 892 |
+
869,
|
| 893 |
+
825,
|
| 894 |
+
911
|
| 895 |
+
],
|
| 896 |
+
"page_idx": 5
|
| 897 |
+
},
|
| 898 |
+
{
|
| 899 |
+
"type": "image",
|
| 900 |
+
"img_path": "images/8e045103dc4e79d76067958cf90d473561538bb28a6e2522e1019910dc67a5e7.jpg",
|
| 901 |
+
"image_caption": [
|
| 902 |
+
"Figure 4: Unconditional samples from the DDPM trained on land cover segmentations (cf. Fig. 5). "
|
| 903 |
+
],
|
| 904 |
+
"image_footnote": [],
|
| 905 |
+
"bbox": [
|
| 906 |
+
207,
|
| 907 |
+
88,
|
| 908 |
+
782,
|
| 909 |
+
181
|
| 910 |
+
],
|
| 911 |
+
"page_idx": 6
|
| 912 |
+
},
|
| 913 |
+
{
|
| 914 |
+
"type": "image",
|
| 915 |
+
"img_path": "images/bbbb8600983c1033ff06c8324bf3bfc416870550305bc323a1a6338a4e0002ef.jpg",
|
| 916 |
+
"image_caption": [
|
| 917 |
+
"Figure 5: Segmentation inference results. The inferred segmentation $\\mathbf { x }$ is initialized with the weak labels to reduce the number of steps needed. The samples are chosen from (top to bottom) Durham, NC, Austin, TX and Phoenix, AZ. Although AZ has a vastly different joint distribution of colors and labels, the inferred segmentation still captures the overall structure. Note that the inference algorithm does not use the pixel intensities in the input image, only an unsupervised color clustering. "
|
| 918 |
+
],
|
| 919 |
+
"image_footnote": [],
|
| 920 |
+
"bbox": [
|
| 921 |
+
214,
|
| 922 |
+
220,
|
| 923 |
+
781,
|
| 924 |
+
481
|
| 925 |
+
],
|
| 926 |
+
"page_idx": 6
|
| 927 |
+
},
|
| 928 |
+
{
|
| 929 |
+
"type": "text",
|
| 930 |
+
"text": "",
|
| 931 |
+
"bbox": [
|
| 932 |
+
174,
|
| 933 |
+
589,
|
| 934 |
+
825,
|
| 935 |
+
688
|
| 936 |
+
],
|
| 937 |
+
"page_idx": 6
|
| 938 |
+
},
|
| 939 |
+
{
|
| 940 |
+
"type": "equation",
|
| 941 |
+
"img_path": "images/0fdbc5e4eeb184b5a3ac42e4a59fae3b529a70ad1be3635857f2370243ad9207.jpg",
|
| 942 |
+
"text": "$$\n\\begin{array} { r } { \\log c ( \\mathbf { x } , \\mathbf { z } , \\boldsymbol { \\ell } _ { \\mathrm { w e a k } } ) = \\mathrm { M I } ( \\mathbf { x } , \\mathbf { z } ) - \\mathrm { K L } ( \\mathbf { x } \\parallel \\boldsymbol { \\ell } _ { \\mathrm { w e a k } } ) . } \\end{array}\n$$",
|
| 943 |
+
"text_format": "latex",
|
| 944 |
+
"bbox": [
|
| 945 |
+
339,
|
| 946 |
+
698,
|
| 947 |
+
656,
|
| 948 |
+
715
|
| 949 |
+
],
|
| 950 |
+
"page_idx": 6
|
| 951 |
+
},
|
| 952 |
+
{
|
| 953 |
+
"type": "text",
|
| 954 |
+
"text": "Empirically, we find that we can reduce the number of optimization steps needed to perform inference by initializing the sample $\\mathbf { x }$ with the weak labels $\\ell _ { \\mathrm { w e a k } }$ instead of random noise, allowing us to start from a smaller $t _ { i }$ . Examples of images and their inferred segmentations are shown in Fig. 5. ",
|
| 955 |
+
"bbox": [
|
| 956 |
+
174,
|
| 957 |
+
726,
|
| 958 |
+
825,
|
| 959 |
+
768
|
| 960 |
+
],
|
| 961 |
+
"page_idx": 6
|
| 962 |
+
},
|
| 963 |
+
{
|
| 964 |
+
"type": "text",
|
| 965 |
+
"text": "Domain transfer with inferred samples. The above inference procedure is agnostic to colors by design, and we expect it to have a greater ability to perform in new areas than the approach in [34], which still finetunes networks that take raw images as input. We also investigate domain transfer approaches where patches segmented using the the diffusion prior are used to train neural networks for fast inference. We pretrain a standard U-Net inference network $p ( \\mathbf { x } \\mid I )$ solely on $2 0 \\mathrm { k }$ batches of 16 randomly sampled $6 4 \\times 6 4$ image patches in PA. We randomly sample 640 images in each of the other geographies and generate semantic segmentations using our inference procedure, then finetune the inference network on these segmentations. This network is then evaluated on the entire target geography. ",
|
| 966 |
+
"bbox": [
|
| 967 |
+
173,
|
| 968 |
+
786,
|
| 969 |
+
825,
|
| 970 |
+
912
|
| 971 |
+
],
|
| 972 |
+
"page_idx": 6
|
| 973 |
+
},
|
| 974 |
+
{
|
| 975 |
+
"type": "table",
|
| 976 |
+
"img_path": "images/33f4951b886eb45037475a718f9c5d59b05fdec6fdb050e007a4737afc9c1b58.jpg",
|
| 977 |
+
"table_caption": [
|
| 978 |
+
"Table 1: Accuracies and class mean intersection-over-union scores on the EnviroAtlas dataset in various geographic domains. The model in the second-to-last row was pretrained in a supervised way on labels in the Pittsburgh, PA, region. "
|
| 979 |
+
],
|
| 980 |
+
"table_footnote": [],
|
| 981 |
+
"table_body": "<table><tr><td rowspan=\"2\">Algorithm</td><td colspan=\"2\">Durham, NC</td><td colspan=\"2\">Austin, TX</td><td colspan=\"2\">Phoenix, AZ</td></tr><tr><td>Acc %</td><td>IoU %</td><td>Acc %</td><td>IoU %</td><td>Acc %</td><td>IoU %</td></tr><tr><td>PA supervised</td><td>74.2</td><td>35.9</td><td>71.9</td><td>36.8</td><td>6.7</td><td>13.4</td></tr><tr><td>PA supervised + weak</td><td>78.9</td><td>47.9</td><td>77.2</td><td>50.5</td><td>62.8</td><td>24.2</td></tr><tr><td>Implicit posterior [34]</td><td>79.0</td><td>48.4</td><td>76.6</td><td>49.5</td><td>76.2</td><td>46.0</td></tr><tr><td>Ours s (from scratch)</td><td>76.0</td><td>39.9</td><td>74.8</td><td>39.4</td><td>69.5</td><td>31.6</td></tr><tr><td>Ours (fine-tuned)</td><td>79.8</td><td>46.4</td><td>79.5</td><td>45.4</td><td>69.6</td><td>32.4</td></tr><tr><td>Full US supervised [33]</td><td>77.0</td><td>49.6</td><td>76.5</td><td>51.8</td><td>24.7</td><td>23.6</td></tr></table>",
|
| 982 |
+
"bbox": [
|
| 983 |
+
217,
|
| 984 |
+
136,
|
| 985 |
+
776,
|
| 986 |
+
284
|
| 987 |
+
],
|
| 988 |
+
"page_idx": 7
|
| 989 |
+
},
|
| 990 |
+
{
|
| 991 |
+
"type": "text",
|
| 992 |
+
"text": "The results in Table 1 demonstrate that this approach to domain transfer is comparable with the state-of-the-art work of [34] for weakly-supervised training. The naïve approach of training a U-Net only on the available high-resolution PA data (PA supervised) fails to generalize to the geographically different location of Phoenix, AZ. Similarly, the model of [33], which is a US-wide high-resolution land cover model trained on imagery and labels, and multi-resolution auxiliary data over the entire contiguous US also suffers. When the weak labels are provided as input (PA supervised $^ +$ weak) the results can improve significantly. ",
|
| 993 |
+
"bbox": [
|
| 994 |
+
173,
|
| 995 |
+
310,
|
| 996 |
+
825,
|
| 997 |
+
409
|
| 998 |
+
],
|
| 999 |
+
"page_idx": 7
|
| 1000 |
+
},
|
| 1001 |
+
{
|
| 1002 |
+
"type": "text",
|
| 1003 |
+
"text": "5 Experiments: Continuous relaxation of combinatorial problems ",
|
| 1004 |
+
"text_level": 1,
|
| 1005 |
+
"bbox": [
|
| 1006 |
+
176,
|
| 1007 |
+
428,
|
| 1008 |
+
735,
|
| 1009 |
+
445
|
| 1010 |
+
],
|
| 1011 |
+
"page_idx": 7
|
| 1012 |
+
},
|
| 1013 |
+
{
|
| 1014 |
+
"type": "text",
|
| 1015 |
+
"text": "So far, we have considered inference under a DDPM prior and a differentiable constraint $c ( \\mathbf { x } , \\mathbf { y } )$ . We consider the case of a ‘hard’ constraint, where $\\mathbf { y }$ is a latent vector deterministically encoded in an image x $( \\mathbf { x } = f ( \\mathbf { y } ) )$ and we have a DDPM prior over images $p _ { \\mathrm { D D P M } } ( \\mathbf { x } )$ . We will use the variation of Algorithm 1 described at the end of $\\ S 2 . 2$ to obtain a point estimate of the distribution over $y$ $p ( \\mathbf { y } ) \\overset { - } { \\propto } p _ { \\mathrm { D D P M } } ( f ( \\mathbf { y } ) )$ . ",
|
| 1016 |
+
"bbox": [
|
| 1017 |
+
173,
|
| 1018 |
+
460,
|
| 1019 |
+
825,
|
| 1020 |
+
531
|
| 1021 |
+
],
|
| 1022 |
+
"page_idx": 7
|
| 1023 |
+
},
|
| 1024 |
+
{
|
| 1025 |
+
"type": "text",
|
| 1026 |
+
"text": "We illustrate this in the setting of a well-known combinatorial problem, the traveling salesman problem (TSP). Recall that a Euclidean traveling salesman problem on the plane is described by $N$ points $\\boldsymbol { v } _ { 1 } , \\ldots , \\boldsymbol { v } _ { N } \\in \\mathbb { R } ^ { 2 }$ , which form the vertex set of a complete weighted graph $G$ , where the weight of the edge from $v _ { i }$ to $v _ { j }$ is the Euclidean distance $\\| v _ { i } - v _ { j } \\|$ . A tour of $G$ is a connected subgraph in which every vertex has degree 2. The TSP is the optimization problem of finding the tour with minimal total weight of the edges, or, equivalently, a permutation $\\sigma$ of $\\{ 1 , 2 , \\ldots , N \\}$ that minimizes ",
|
| 1027 |
+
"bbox": [
|
| 1028 |
+
173,
|
| 1029 |
+
536,
|
| 1030 |
+
825,
|
| 1031 |
+
633
|
| 1032 |
+
],
|
| 1033 |
+
"page_idx": 7
|
| 1034 |
+
},
|
| 1035 |
+
{
|
| 1036 |
+
"type": "equation",
|
| 1037 |
+
"img_path": "images/1467226fe6964ca579d83841e60ade1506820610e52a22b08dcf0dc9c97d662b.jpg",
|
| 1038 |
+
"text": "$$\n\\| v _ { \\sigma ( 1 ) } - v _ { \\sigma ( 2 ) } \\| + \\| v _ { \\sigma ( 2 ) } - v _ { \\sigma ( 3 ) } \\| + \\cdots + \\| v _ { \\sigma ( N - 1 ) } - v _ { \\sigma ( N ) } \\| + \\| v _ { \\sigma ( N ) } - v _ { \\sigma ( 1 ) } \\| .\n$$",
|
| 1039 |
+
"text_format": "latex",
|
| 1040 |
+
"bbox": [
|
| 1041 |
+
222,
|
| 1042 |
+
641,
|
| 1043 |
+
774,
|
| 1044 |
+
660
|
| 1045 |
+
],
|
| 1046 |
+
"page_idx": 7
|
| 1047 |
+
},
|
| 1048 |
+
{
|
| 1049 |
+
"type": "text",
|
| 1050 |
+
"text": "Although the general form of the TSP is NP-hard, a polynomial-time approximation scheme is known to exist in the Euclidean case [2, 28] and can yield proofs of tour optimality for small problems. ",
|
| 1051 |
+
"bbox": [
|
| 1052 |
+
173,
|
| 1053 |
+
666,
|
| 1054 |
+
821,
|
| 1055 |
+
695
|
| 1056 |
+
],
|
| 1057 |
+
"page_idx": 7
|
| 1058 |
+
},
|
| 1059 |
+
{
|
| 1060 |
+
"type": "text",
|
| 1061 |
+
"text": "Humans have been shown to have a natural propensity for solving the Euclidean TSP (see [26] for a survey). Humans construct a tour by processing an image representation of the points $v _ { 1 } , \\ldots , v _ { N }$ through their visual system. However, the optimization algorithms in common use for solving the TSP do not use a vision inductive bias, instead falling into two broad categories: ",
|
| 1062 |
+
"bbox": [
|
| 1063 |
+
173,
|
| 1064 |
+
700,
|
| 1065 |
+
825,
|
| 1066 |
+
757
|
| 1067 |
+
],
|
| 1068 |
+
"page_idx": 7
|
| 1069 |
+
},
|
| 1070 |
+
{
|
| 1071 |
+
"type": "text",
|
| 1072 |
+
"text": "• Discrete combinatorial optimization algorithms and efficient integer programming solvers, studied for decades in the optimization literature [24, 12, 10]; \n• More recently, there has been work on neural nets, trained by reinforcement learning or imitation learning, that build tours sequentially or learn heuristics for their (discrete) iterative refinement. Successful recent approaches [6, 23, 16, 17, 4] have used Transformer [44] and graph neural network [22] architectures. ",
|
| 1073 |
+
"bbox": [
|
| 1074 |
+
173,
|
| 1075 |
+
762,
|
| 1076 |
+
825,
|
| 1077 |
+
849
|
| 1078 |
+
],
|
| 1079 |
+
"page_idx": 7
|
| 1080 |
+
},
|
| 1081 |
+
{
|
| 1082 |
+
"type": "text",
|
| 1083 |
+
"text": "The algorithm we propose using DDPMs is a hybrid of these categories: it reasons over a continuous relaxation of the problem, but exploits the learning of generalizable structure in example solutions by a neural model. In addition, ours is the first TSP algorithm to mimic the convolutional inductive bias of the visual system. ",
|
| 1084 |
+
"bbox": [
|
| 1085 |
+
174,
|
| 1086 |
+
856,
|
| 1087 |
+
825,
|
| 1088 |
+
911
|
| 1089 |
+
],
|
| 1090 |
+
"page_idx": 7
|
| 1091 |
+
},
|
| 1092 |
+
{
|
| 1093 |
+
"type": "image",
|
| 1094 |
+
"img_path": "images/3b26fde4100320e9de31ca5d15361a46448f7724a20cfd20bba701c227c5ca56.jpg",
|
| 1095 |
+
"image_caption": [
|
| 1096 |
+
"Figure 7: The procedure for solving the Euclidean TSP with a DDPM: Gradient descent is performed on a latent adjacency matrix $A$ to minimize a stochastic denoising loss on an image representation $f ( A )$ with steadily decreasing amounts of noise (here, 256 steps). In the process, pieces of the tour are ‘burned in’ and later recombined in creative ways. Finally, a tour is extracted from the inferred adjacency matrix and refined by uncrossing moves. For both problems shown, the length of the inferred tour is within $1 \\%$ of the optimum. "
|
| 1097 |
+
],
|
| 1098 |
+
"image_footnote": [],
|
| 1099 |
+
"bbox": [
|
| 1100 |
+
176,
|
| 1101 |
+
103,
|
| 1102 |
+
823,
|
| 1103 |
+
234
|
| 1104 |
+
],
|
| 1105 |
+
"page_idx": 8
|
| 1106 |
+
},
|
| 1107 |
+
{
|
| 1108 |
+
"type": "text",
|
| 1109 |
+
"text": "Encoding function. Fix a set of points $v _ { 1 } , \\ldots , v _ { N } \\in [ 0 , 1 ] \\times [ 0 , 1 ]$ . We encode an symmetric $N \\times N$ matrix with 0 diagonal $A$ as a $6 4 \\times 6 4$ greyscale image $f ( A )$ by superimposing: (i) raster images of line segments from $v _ { i }$ to $v _ { j }$ with intensity value $A _ { i j }$ for every pair $( i , j )$ , and (ii) raster images of small black dots placed at $v _ { i }$ for each $i$ . For example, if $A$ is the adjacency matrix of a tour, then $f ( A )$ is a visualization of this tour as a $6 4 \\times 6 4$ image. ",
|
| 1110 |
+
"bbox": [
|
| 1111 |
+
174,
|
| 1112 |
+
364,
|
| 1113 |
+
825,
|
| 1114 |
+
434
|
| 1115 |
+
],
|
| 1116 |
+
"page_idx": 8
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"type": "text",
|
| 1120 |
+
"text": "Diffusion model training. We use a dataset of Euclidean TSPs, with ground truth tours obtained by a state-of-the-art TSP solver [10], from [23] (we consider two variants of the dataset, each with ${ \\sim } 1 . 5 \\mathrm { m }$ training graphs: with 50 vertices in each graph and with a varying number from 20 to 50 vertices in each graph). Each training tour is represented via its adjacency matrix $A$ and encoded as an image $f ( A )$ . We then train a DDPM with the U-Net architecture from [7] on all of such encoded image. Model and training details can be found in the Appendix $( \\ S \\mathbf { B } . 4 )$ . Some unconditional samples from the trained DDPM are shown in Fig. 6; most samples indeed resemble image representations of tours. ",
|
| 1121 |
+
"bbox": [
|
| 1122 |
+
173,
|
| 1123 |
+
452,
|
| 1124 |
+
825,
|
| 1125 |
+
563
|
| 1126 |
+
],
|
| 1127 |
+
"page_idx": 8
|
| 1128 |
+
},
|
| 1129 |
+
{
|
| 1130 |
+
"type": "text",
|
| 1131 |
+
"text": "Solving new TSPs. Suppose we are given a new set of points $v _ { 1 } , \\ldots , v _ { N }$ . Solving the TSP requires finding the adjacency matrix $A$ of a tour of minimal length. As a differentiable relaxation, we set $A = \\check { S } + S ^ { \\top }$ , where $S$ is a stochastic $N \\times N$ matrix with zero diagonal (parametrized via softmax of a matrix of parameters over rows). We run the inference procedure using the trained DDPM $p _ { \\mathrm { D D P M } } ( f ( \\bar { A } ) )$ as a prior to estimate $A$ The hyperparameters and noise schedule are described in $\\ S _ { \\mathrm { B } . 4 }$ . Examples of the optimization are shown in Fig. 7. ",
|
| 1132 |
+
"bbox": [
|
| 1133 |
+
174,
|
| 1134 |
+
582,
|
| 1135 |
+
485,
|
| 1136 |
+
747
|
| 1137 |
+
],
|
| 1138 |
+
"page_idx": 8
|
| 1139 |
+
},
|
| 1140 |
+
{
|
| 1141 |
+
"type": "text",
|
| 1142 |
+
"text": "Although the inferred $A$ is usually sharp (i.e., all ",
|
| 1143 |
+
"bbox": [
|
| 1144 |
+
176,
|
| 1145 |
+
753,
|
| 1146 |
+
482,
|
| 1147 |
+
768
|
| 1148 |
+
],
|
| 1149 |
+
"page_idx": 8
|
| 1150 |
+
},
|
| 1151 |
+
{
|
| 1152 |
+
"type": "image",
|
| 1153 |
+
"img_path": "images/bf65c1459830d668d9148ef759bcb0dc23e6524fad393e7def4ef50b160493a1.jpg",
|
| 1154 |
+
"image_caption": [
|
| 1155 |
+
"Figure 6: Two unconditional samples from the diffusion model trained on images of solved TSPs. "
|
| 1156 |
+
],
|
| 1157 |
+
"image_footnote": [],
|
| 1158 |
+
"bbox": [
|
| 1159 |
+
504,
|
| 1160 |
+
601,
|
| 1161 |
+
815,
|
| 1162 |
+
717
|
| 1163 |
+
],
|
| 1164 |
+
"page_idx": 8
|
| 1165 |
+
},
|
| 1166 |
+
{
|
| 1167 |
+
"type": "text",
|
| 1168 |
+
"text": "entries close to 0 or 1), rounding $A$ to 0 or 1 does not always give the adjacency matrix of a tour (see, for example, the top row of Fig. 7; other common incorrect outputs include pairs of disjoint tours). To extract a tour from the inferred $A$ , we greedily insert edges to form an initial proposal, then refine it using a standard and lightweight combinatorial procedure, the 2-opt heuristic [24] (amounting to iteratively uncrossing pairs of edges that intersect). The entire procedure is shown in Fig. 7, and full details can be found in the Appendix $( \\ S \\mathbf { B } . 4 )$ . ",
|
| 1169 |
+
"bbox": [
|
| 1170 |
+
173,
|
| 1171 |
+
768,
|
| 1172 |
+
826,
|
| 1173 |
+
851
|
| 1174 |
+
],
|
| 1175 |
+
"page_idx": 8
|
| 1176 |
+
},
|
| 1177 |
+
{
|
| 1178 |
+
"type": "text",
|
| 1179 |
+
"text": "Results. We evaluate the trained models on test sets of 1280 graphs each with $N = 5 0$ and $N = 1 0 0$ vertices. We report the average length of the inferred tour and the gap (discrepancy from the length of the ground truth tour) in Table 2 (left), from which we make several observations. ",
|
| 1180 |
+
"bbox": [
|
| 1181 |
+
174,
|
| 1182 |
+
869,
|
| 1183 |
+
825,
|
| 1184 |
+
911
|
| 1185 |
+
],
|
| 1186 |
+
"page_idx": 8
|
| 1187 |
+
},
|
| 1188 |
+
{
|
| 1189 |
+
"type": "table",
|
| 1190 |
+
"img_path": "images/46beaa246f3489e444566fb2f6407ff2885be80f0ad289efcc201e26015f8bae.jpg",
|
| 1191 |
+
"table_caption": [
|
| 1192 |
+
"Table 2: Left: Mean tour length and optimality gap on Euclidean TSP test sets. The baseline results from [23, 16, 4] are taken from the respective papers. The two DDPMs were trained on $1 . 5 \\mathrm { m }$ images of solved TSP instances (with different numbers of vertices) and used to infer latent adjacency matrices in the test set. Right: Performance of the DDPM trained on images of 50-vertex TSP instances with different numbers of inference steps (see the Appendix $( \\ S \\mathbf { B } . 4 )$ for time schedule details). We also show the mean number of 2-opt (uncrossing) steps per instance, suggesting that the DDPM prior assigns high likelihood to adjacency matrices that are in less need of refinement. "
|
| 1193 |
+
],
|
| 1194 |
+
"table_footnote": [],
|
| 1195 |
+
"table_body": "<table><tr><td rowspan=\"2\">Algorithm</td><td colspan=\"2\">N=50</td><td colspan=\"2\">N=100</td></tr><tr><td>Obj</td><td>Gap%</td><td>Obj</td><td>Gap%</td></tr><tr><td>Oracle (Concorde [10])</td><td>5.69</td><td>0.00</td><td>7.759</td><td>0.00</td></tr><tr><td>2-opt [24]</td><td>5.86</td><td>2.95</td><td>8.03</td><td>3.54</td></tr><tr><td>Transformer [23]</td><td>5.80</td><td>1.76</td><td>8.12</td><td>4.53</td></tr><tr><td>GNN [16]</td><td>5.87</td><td>3.10</td><td>8.41</td><td>8.38</td></tr><tr><td>Transformer [4]</td><td>5.71</td><td>0.31</td><td>7.88</td><td>1.42</td></tr><tr><td>Diffusion 20-50</td><td>5.76</td><td>1.23</td><td>7.92</td><td>2.11</td></tr><tr><td>Diffusion 50</td><td>5.76</td><td>1.28</td><td>7.93</td><td>2.19</td></tr></table>",
|
| 1196 |
+
"bbox": [
|
| 1197 |
+
176,
|
| 1198 |
+
191,
|
| 1199 |
+
488,
|
| 1200 |
+
319
|
| 1201 |
+
],
|
| 1202 |
+
"page_idx": 9
|
| 1203 |
+
},
|
| 1204 |
+
{
|
| 1205 |
+
"type": "table",
|
| 1206 |
+
"img_path": "images/4d88da958aa6fa648049ccaf6c9c1010ce5acd1623a747a6889b483f381854d4.jpg",
|
| 1207 |
+
"table_caption": [],
|
| 1208 |
+
"table_footnote": [],
|
| 1209 |
+
"table_body": "<table><tr><td></td><td colspan=\"3\">N=50</td><td colspan=\"3\">N=100</td></tr><tr><td>Diff. steps</td><td>Obj</td><td>Gap %</td><td>Steps</td><td>Obj</td><td>Gap%</td><td>Steps</td></tr><tr><td>256</td><td>5.763</td><td>1.28</td><td>11.6</td><td>7.930</td><td>2.19</td><td>50.6</td></tr><tr><td>64</td><td>5.780</td><td>2.60</td><td>14.3</td><td>7.942</td><td>2.35</td><td>45.7</td></tr><tr><td>16</td><td>5.858</td><td>2.98</td><td>25.9</td><td>8.052</td><td>3.78</td><td>58.6</td></tr><tr><td>4</td><td>5.851</td><td>2.86</td><td>23.9</td><td>8.031</td><td>3.50</td><td>52.8</td></tr><tr><td>2-opt</td><td>5.856</td><td>2.95</td><td>24.4</td><td>8.034</td><td>3.54</td><td>53.0</td></tr></table>",
|
| 1210 |
+
"bbox": [
|
| 1211 |
+
504,
|
| 1212 |
+
212,
|
| 1213 |
+
818,
|
| 1214 |
+
301
|
| 1215 |
+
],
|
| 1216 |
+
"page_idx": 9
|
| 1217 |
+
},
|
| 1218 |
+
{
|
| 1219 |
+
"type": "text",
|
| 1220 |
+
"text": "• The right side of Table 2 shows the number of 2-opt (edge uncrossing) steps performed in the refinement step of the algorithm when the inference algorithm is run for varying numbers of steps. Running the inference with more steps results in extracted tours that are closer to local minima with respect to the 2-opt neighbourhood, indicating that the DDPM encodes meaningful information about the shape of tours. ",
|
| 1221 |
+
"bbox": [
|
| 1222 |
+
174,
|
| 1223 |
+
357,
|
| 1224 |
+
825,
|
| 1225 |
+
428
|
| 1226 |
+
],
|
| 1227 |
+
"page_idx": 9
|
| 1228 |
+
},
|
| 1229 |
+
{
|
| 1230 |
+
"type": "text",
|
| 1231 |
+
"text": "• The DDPM inference is competitive with recent baseline algorithms that do not use beam search in generation of the tour (those shown in the table). These baseline algorithms improve when beam search decoding with very large beam size is used, but encounter diminishing returns as the computation cost grows. Our performance on the 100-vertex problems is similar to [23] with the largest beam size they report (5000), which has $2 . 1 8 \\%$ gap, while having similar computation time. ",
|
| 1232 |
+
"bbox": [
|
| 1233 |
+
174,
|
| 1234 |
+
435,
|
| 1235 |
+
825,
|
| 1236 |
+
505
|
| 1237 |
+
],
|
| 1238 |
+
"page_idx": 9
|
| 1239 |
+
},
|
| 1240 |
+
{
|
| 1241 |
+
"type": "text",
|
| 1242 |
+
"text": "• The model trained on problems with 50 nodes performs almost identically to the model trained on problems with 50 or fewer nodes, and both models generalize better than baseline methods from 50-node problems to the out-of-distribution 100-node problems. ",
|
| 1243 |
+
"bbox": [
|
| 1244 |
+
176,
|
| 1245 |
+
513,
|
| 1246 |
+
821,
|
| 1247 |
+
554
|
| 1248 |
+
],
|
| 1249 |
+
"page_idx": 9
|
| 1250 |
+
},
|
| 1251 |
+
{
|
| 1252 |
+
"type": "text",
|
| 1253 |
+
"text": "We emphasize a unique feature of our algorithm: all ‘reasoning’ in our inference procedure happens via the image space. This property also leads to sublinear computation cost scaling with increasing size of the graph – as long as it can reasonably be represented in a $6 4 \\times 6 4$ image – since most of the computation cost of inference is borne by running the denoiser on images of a fixed size. In the Appendix $( \\ S \\mathbf { B } . 4 )$ we explore the generalization of the model trained on 20- to 50-node TSP instances to problems with 200 nodes and discuss potential extensions. ",
|
| 1254 |
+
"bbox": [
|
| 1255 |
+
173,
|
| 1256 |
+
561,
|
| 1257 |
+
825,
|
| 1258 |
+
645
|
| 1259 |
+
],
|
| 1260 |
+
"page_idx": 9
|
| 1261 |
+
},
|
| 1262 |
+
{
|
| 1263 |
+
"type": "text",
|
| 1264 |
+
"text": "6 Conclusion ",
|
| 1265 |
+
"text_level": 1,
|
| 1266 |
+
"bbox": [
|
| 1267 |
+
174,
|
| 1268 |
+
678,
|
| 1269 |
+
299,
|
| 1270 |
+
695
|
| 1271 |
+
],
|
| 1272 |
+
"page_idx": 9
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"type": "text",
|
| 1276 |
+
"text": "We have shown how inference in denoising diffusion models can be performed under constraints in a variety of settings. Imposing constraints that arise from pretrained classifiers enables conditional generation, while common-sense conditions, such as mutual information with a clustering or divergence from weak labels, can lead to models that are less sensitive to domain shift in the distribution of conditioning data. ",
|
| 1277 |
+
"bbox": [
|
| 1278 |
+
174,
|
| 1279 |
+
717,
|
| 1280 |
+
825,
|
| 1281 |
+
786
|
| 1282 |
+
],
|
| 1283 |
+
"page_idx": 9
|
| 1284 |
+
},
|
| 1285 |
+
{
|
| 1286 |
+
"type": "text",
|
| 1287 |
+
"text": "A notable limitation of DDPMs, which is inherited by our algorithms, is the high cost of inference, requiring a large number of passes through the denoising network to generate a sample. We expect that with further research on DDPMs for which inference procedures converge in fewer steps [37, 45], plug-and-play use of DDPMs will become more appealing in various applications. ",
|
| 1288 |
+
"bbox": [
|
| 1289 |
+
174,
|
| 1290 |
+
794,
|
| 1291 |
+
825,
|
| 1292 |
+
849
|
| 1293 |
+
],
|
| 1294 |
+
"page_idx": 9
|
| 1295 |
+
},
|
| 1296 |
+
{
|
| 1297 |
+
"type": "text",
|
| 1298 |
+
"text": "Finally, our results on the traveling salesman problem illustrate the ability of DDPMs to reason over uncertain hypotheses in a manner that can mimic human ‘puzzle-solving’ behavior. These results open the door to future research on using DDPMs to efficiently generate candidates in combinatorial search problems. ",
|
| 1299 |
+
"bbox": [
|
| 1300 |
+
176,
|
| 1301 |
+
856,
|
| 1302 |
+
823,
|
| 1303 |
+
911
|
| 1304 |
+
],
|
| 1305 |
+
"page_idx": 9
|
| 1306 |
+
},
|
| 1307 |
+
{
|
| 1308 |
+
"type": "text",
|
| 1309 |
+
"text": "Acknowledgments ",
|
| 1310 |
+
"text_level": 1,
|
| 1311 |
+
"bbox": [
|
| 1312 |
+
176,
|
| 1313 |
+
89,
|
| 1314 |
+
330,
|
| 1315 |
+
106
|
| 1316 |
+
],
|
| 1317 |
+
"page_idx": 10
|
| 1318 |
+
},
|
| 1319 |
+
{
|
| 1320 |
+
"type": "text",
|
| 1321 |
+
"text": "The authors thank the anonymous NeurIPS 2022 reviewers for their comments. ",
|
| 1322 |
+
"bbox": [
|
| 1323 |
+
174,
|
| 1324 |
+
121,
|
| 1325 |
+
692,
|
| 1326 |
+
136
|
| 1327 |
+
],
|
| 1328 |
+
"page_idx": 10
|
| 1329 |
+
},
|
| 1330 |
+
{
|
| 1331 |
+
"type": "text",
|
| 1332 |
+
"text": "All authors are funded by their primary institutions. Partial support was provided by the NASA Biodiversity program (Award 80NSSC21K1027), NSF grants IIS-2123920 and IIS-2212046, and the Partner University Fund 4D Vision award. ",
|
| 1333 |
+
"bbox": [
|
| 1334 |
+
176,
|
| 1335 |
+
141,
|
| 1336 |
+
823,
|
| 1337 |
+
184
|
| 1338 |
+
],
|
| 1339 |
+
"page_idx": 10
|
| 1340 |
+
},
|
| 1341 |
+
{
|
| 1342 |
+
"type": "text",
|
| 1343 |
+
"text": "References ",
|
| 1344 |
+
"text_level": 1,
|
| 1345 |
+
"bbox": [
|
| 1346 |
+
174,
|
| 1347 |
+
204,
|
| 1348 |
+
266,
|
| 1349 |
+
219
|
| 1350 |
+
],
|
| 1351 |
+
"page_idx": 10
|
| 1352 |
+
},
|
| 1353 |
+
{
|
| 1354 |
+
"type": "text",
|
| 1355 |
+
"text": "[1] Tomer Amit, Eliya Nachmani, Tal Shaharabany, and Lior Wolf. Segdiff: Image segmentation with diffusion probabilistic models. arXiv preprint 2112.00390, 2021. \n[2] Sanjeev Arora. Polynomial time approximation schemes for euclidean traveling salesman and other geometric problems. Journal of the Association for Computing Machinery, 45(5):753–782, 09 1998. \n[3] Dmitry Baranchuk, Andrey Voynov, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. Label-efficient semantic segmentation with diffusion models. International Conference on Learning Representations (ICLR), 2022. \n[4] Xavier Bresson and Thomas Laurent. The transformer network for the traveling salesman problem. arXiv preprint 2103.03012, 2021. \n[5] Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. ILVR: conditioning method for denoising diffusion probabilistic models. International Conference on Computer Vision (ICCV), 2021. \n[6] Michel Deudon, Pierre Cournut, Alexandre Lacoste, Yossiri Adulyasak, and Louis-Martin Rousseau. Learning heuristics for the TSP by policy gradient. In Integration of Constraint Programming, Artificial Intelligence, and Operations Research, pages 170–181. Springer International Publishing, 2018. \n[7] Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. Neural Information Processing Systems (NeurIPS), 2021. \n[8] Yilun Du, Shuang Li, and Igor Mordatch. Compositional visual generation with energy based models. Neural Information Processing Systems (NeurIPS), 2020. \n[9] Jesse H. Engel, Matthew D. Hoffman, and Adam Roberts. Latent constraints: Learning to generate conditionally from unconditional generative models. International Conference on Learning Representations (ICLR), 2018. \n[10] David Applegate et al. Concorde TSP solver. http://www.math.uwaterloo.ca/tsp/ concorde, 1997-2003. \n[11] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Neural Information Processing Systems (NeurIPS), 2014. \n[12] Keld Helsgaun. An effective implementation of the Lin–Kernighan traveling salesman heuristic. European Journal of Operational Research, 126(1):106–130, 2000. \n[13] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Neural Information Processing Systems (NeurIPS), 2020. \n[14] Emiel Hoogeboom, Didrik Nielsen, Priyank Jaini, Patrick Forré, and Max Welling. Argmax flows and multinomial diffusion: Learning categorical distributions. Neural Information Processing Systems (NeurIPS), 2021. \n[15] Emiel Hoogeboom, Victor Garcia Satorras, Clément Vignac, and Max Welling. Equivariant diffusion for molecule generation in 3D. arXiv preprint 2203.17003, 2022. \n[16] Chaitanya K Joshi, Thomas Laurent, and Xavier Bresson. An efficient graph convolutional network technique for the travelling salesman problem. arXiv preprint 1906.01227, 2019. \n[17] Chaitanya K Joshi, Quentin Cappart, Louis-Martin Rousseau, and Thomas Laurent. Learning tsp requires rethinking generalization. International Conference on Principles and Practice of Constraint Programming, 2021. \n[18] Zahra Kadkhodaie and Eero Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. Neural Information Processing Systems (NeurIPS), 2021. \n[19] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. Computer Vision and Pattern Recognition (CVPR), 2019. \n[20] Bahjat Kawar, Gregory Vaksman, and Michael Elad. SNIPS: Solving noisy inverse problems stochastically. Neural Information Processing Systems (NeurIPS), 2021. \n[21] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. International Conference on Learning Representations (ICLR), 2014. \n[22] Thomas Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017. \n[23] Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! International Conference on Learning Representations (ICLR), 2019. \n[24] Shen Lin and Brian Kernighan. An effective heuristic algorithm for the traveling-salesman problem. Operations Research, 21(2):498–516, 1973. \n[25] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. International Conference on Computer Vision (ICCV), 2015. \n[26] James MacGregor and Yun Chu. Human performance on the traveling salesman and related problems: A review. The Journal of Problem Solving, 3, 02 2011. \n[27] Tom Minka. Divergence measures and message passing. Microsoft Research Technical Report, 2005. \n[28] Joseph S. B. Mitchell. Guillotine subdivisions approximate polygonal subdivisions: A simple polynomial-time approximation scheme for geometric tsp, k-mst, and related problems. SIAM Journal on Computing, 28(4):1298–1309, 1999. \n[29] Anh Nguyen, Jeff Clune, Yoshua Bengio, Alexey Dosovitskiy, and Jason Yosinski. Plug & play generative networks: Conditional iterative generation of images in latent space. Computer Vision and Pattern Recognition (CVPR), 2017. \n[30] Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. International Conference on Machine Learning (ICML), 2021. \n[31] Weili Nie, Brandon Guo, Yujia Huang, Chaowei Xiao, Arash Vahdat, and Anima Anandkumar. Diffusion models for adversarial purification. International Conference on Machine Learning (ICML), 2022. To appear; arXiv preprint 2205.07460. \n[32] Brian R. Pickard, Jessica Daniel, Megan Mehaffey, Laura E. Jackson, and Anne Neale. Enviroatlas: A new geospatial tool to foster ecosystem services science and resource management. Ecosystem Services, 14(C):45–55, 2015. URL https://EconPapers.repec.org/RePEc: eee:ecoser:v:14:y:2015:i:c:p:45-55. \n[33] Caleb Robinson, Le Hou, Nikolay Malkin, Rachel Soobitsky, Jacob Czawlytko, Bistra Dilkina, and Nebojsa Jojic. Large scale high-resolution land cover mapping with multi-resolution data. Computer Vision and Pattern Recognition (CVPR), 2019. \n[34] Esther Rolf, Nikolay Malkin, Alexandros Graikos, Ana Jojic, Caleb Robinson, and Nebojsa Jojic. Resolving label uncertainty with implicit posterior models. Uncertainty in Artificial Intelligence (UAI), 2022. To appear; arXiv preprint 2202.14000. \n[35] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2015. \n[36] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J. Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv preprint 2104.07636, 2021. \n[37] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. International Conference on Learning Representations (ICLR), 2022. \n[38] Abhishek Sinha, Jiaming Song, Chenlin Meng, and Stefano Ermon. D2C: diffusion-decoding models for few-shot conditional generation. Neural Information Processing Systems (NeurIPS), 2021. \n[39] Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. International Conference on Machine Learning (ICML), 2015. \n[40] Yang Song, Liyue Shen, Lei Xing, and Stefano Ermon. Solving inverse problems in medical imaging with score-based generative models. In International Conference on Learning Representations (ICLR), 2021. \n[41] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, , and Rob Fergus. Intriguing properties of neural networks. International Conference on Learning Representations (ICLR), 2014. \n[42] Yusuke Tashiro, Jiaming Song, Yang Song, and Stefano Ermon. CSDI: conditional scorebased diffusion models for probabilistic time series imputation. Neural Information Processing Systems (NeurIPS), 2021. \n[43] Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space. Neural Information Processing Systems (NeurIPS), 2021. \n[44] 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 (NIPS), 2017. \n[45] Zhisheng Xiao, Karsten Kreis, and Arash Vahdat. Tackling the generative learning trilemma with denoising diffusion GANs. International Conference on Learning Representations (ICLR), 2022. ",
|
| 1356 |
+
"bbox": [
|
| 1357 |
+
173,
|
| 1358 |
+
224,
|
| 1359 |
+
826,
|
| 1360 |
+
916
|
| 1361 |
+
],
|
| 1362 |
+
"page_idx": 10
|
| 1363 |
+
},
|
| 1364 |
+
{
|
| 1365 |
+
"type": "text",
|
| 1366 |
+
"text": "",
|
| 1367 |
+
"bbox": [
|
| 1368 |
+
171,
|
| 1369 |
+
58,
|
| 1370 |
+
828,
|
| 1371 |
+
914
|
| 1372 |
+
],
|
| 1373 |
+
"page_idx": 11
|
| 1374 |
+
},
|
| 1375 |
+
{
|
| 1376 |
+
"type": "text",
|
| 1377 |
+
"text": "",
|
| 1378 |
+
"bbox": [
|
| 1379 |
+
171,
|
| 1380 |
+
88,
|
| 1381 |
+
828,
|
| 1382 |
+
611
|
| 1383 |
+
],
|
| 1384 |
+
"page_idx": 12
|
| 1385 |
+
},
|
| 1386 |
+
{
|
| 1387 |
+
"type": "text",
|
| 1388 |
+
"text": "Checklist ",
|
| 1389 |
+
"text_level": 1,
|
| 1390 |
+
"bbox": [
|
| 1391 |
+
174,
|
| 1392 |
+
619,
|
| 1393 |
+
254,
|
| 1394 |
+
636
|
| 1395 |
+
],
|
| 1396 |
+
"page_idx": 12
|
| 1397 |
+
},
|
| 1398 |
+
{
|
| 1399 |
+
"type": "text",
|
| 1400 |
+
"text": "1. For all authors... ",
|
| 1401 |
+
"bbox": [
|
| 1402 |
+
214,
|
| 1403 |
+
646,
|
| 1404 |
+
339,
|
| 1405 |
+
660
|
| 1406 |
+
],
|
| 1407 |
+
"page_idx": 12
|
| 1408 |
+
},
|
| 1409 |
+
{
|
| 1410 |
+
"type": "text",
|
| 1411 |
+
"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] See the conclusion and discussion throughout the paper. \n(c) Did you discuss any potential negative societal impacts of your work? [N/A] Although no immediate negative societal impacts are expected, researchers should bear in mind the risks of flexible conditional generation of images, e.g., for creating ‘deep fakes’. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
|
| 1412 |
+
"bbox": [
|
| 1413 |
+
238,
|
| 1414 |
+
664,
|
| 1415 |
+
825,
|
| 1416 |
+
795
|
| 1417 |
+
],
|
| 1418 |
+
"page_idx": 12
|
| 1419 |
+
},
|
| 1420 |
+
{
|
| 1421 |
+
"type": "text",
|
| 1422 |
+
"text": "2. If you are including theoretical results... ",
|
| 1423 |
+
"bbox": [
|
| 1424 |
+
214,
|
| 1425 |
+
799,
|
| 1426 |
+
493,
|
| 1427 |
+
814
|
| 1428 |
+
],
|
| 1429 |
+
"page_idx": 12
|
| 1430 |
+
},
|
| 1431 |
+
{
|
| 1432 |
+
"type": "text",
|
| 1433 |
+
"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] ",
|
| 1434 |
+
"bbox": [
|
| 1435 |
+
238,
|
| 1436 |
+
816,
|
| 1437 |
+
738,
|
| 1438 |
+
848
|
| 1439 |
+
],
|
| 1440 |
+
"page_idx": 12
|
| 1441 |
+
},
|
| 1442 |
+
{
|
| 1443 |
+
"type": "text",
|
| 1444 |
+
"text": "3. If you ran experiments... ",
|
| 1445 |
+
"bbox": [
|
| 1446 |
+
214,
|
| 1447 |
+
852,
|
| 1448 |
+
393,
|
| 1449 |
+
866
|
| 1450 |
+
],
|
| 1451 |
+
"page_idx": 12
|
| 1452 |
+
},
|
| 1453 |
+
{
|
| 1454 |
+
"type": "text",
|
| 1455 |
+
"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] For most experiments; see the Appendix. ",
|
| 1456 |
+
"bbox": [
|
| 1457 |
+
240,
|
| 1458 |
+
869,
|
| 1459 |
+
821,
|
| 1460 |
+
911
|
| 1461 |
+
],
|
| 1462 |
+
"page_idx": 12
|
| 1463 |
+
},
|
| 1464 |
+
{
|
| 1465 |
+
"type": "text",
|
| 1466 |
+
"text": "(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See the Appendix and relevant experiment sections. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Main experiments were run one time. \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] See the Appendix. ",
|
| 1467 |
+
"bbox": [
|
| 1468 |
+
236,
|
| 1469 |
+
92,
|
| 1470 |
+
825,
|
| 1471 |
+
180
|
| 1472 |
+
],
|
| 1473 |
+
"page_idx": 13
|
| 1474 |
+
},
|
| 1475 |
+
{
|
| 1476 |
+
"type": "text",
|
| 1477 |
+
"text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
|
| 1478 |
+
"bbox": [
|
| 1479 |
+
212,
|
| 1480 |
+
184,
|
| 1481 |
+
823,
|
| 1482 |
+
199
|
| 1483 |
+
],
|
| 1484 |
+
"page_idx": 13
|
| 1485 |
+
},
|
| 1486 |
+
{
|
| 1487 |
+
"type": "text",
|
| 1488 |
+
"text": "(a) If your work uses existing assets, did you cite the creators? [Yes] See the relevant experiment sections. \n(b) Did you mention the license of the assets? [No] But all datasets used are free to use for research purposes; see the relevant citations. \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] ",
|
| 1489 |
+
"bbox": [
|
| 1490 |
+
238,
|
| 1491 |
+
203,
|
| 1492 |
+
825,
|
| 1493 |
+
352
|
| 1494 |
+
],
|
| 1495 |
+
"page_idx": 13
|
| 1496 |
+
},
|
| 1497 |
+
{
|
| 1498 |
+
"type": "text",
|
| 1499 |
+
"text": "5. If you used crowdsourcing or conducted research with human subjects... ",
|
| 1500 |
+
"bbox": [
|
| 1501 |
+
214,
|
| 1502 |
+
356,
|
| 1503 |
+
705,
|
| 1504 |
+
371
|
| 1505 |
+
],
|
| 1506 |
+
"page_idx": 13
|
| 1507 |
+
},
|
| 1508 |
+
{
|
| 1509 |
+
"type": "text",
|
| 1510 |
+
"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] ",
|
| 1511 |
+
"bbox": [
|
| 1512 |
+
238,
|
| 1513 |
+
375,
|
| 1514 |
+
825,
|
| 1515 |
+
464
|
| 1516 |
+
],
|
| 1517 |
+
"page_idx": 13
|
| 1518 |
+
}
|
| 1519 |
+
]
|
parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/yhlMZ3iR7Pu/yhlMZ3iR7Pu_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|