ZHANGYUXUAN-zR commited on
Commit
71d1d25
·
verified ·
1 Parent(s): 5681d08

Add files using upload-large-folder tool

Browse files
md/test/7FHrZuKogW/7FHrZuKogW.md ADDED
The diff for this file is too large to render. See raw diff
 
md/test/Th6NyL07na/Th6NyL07na.md ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DOLA: DECODING BY CONTRASTING LAYERS IMPROVES FACTUALITY IN LARGE LANGUAGE MODELS
2
+
3
+ Yung-Sung Chuang†⋆, Yujia $\mathbf { X _ { i } \mathbf { e } ^ { \ddag } }$ , Hongyin Luo†, Yoon $\mathbf { K } \mathbf { i m } ^ { \dagger }$ , James Glass†, Pengcheng He‡
4
+
5
+ †Massachusetts Institute of Technology, ‡Microsoft yungsung@mit.edu, yujiaxie@microsoft.com {hyluo,yoonkim,glass}@mit.edu, herbert.he@gmail.com
6
+
7
+ # ABSTRACT
8
+
9
+ Despite their impressive capabilities, large language models (LLMs) are prone to hallucinations, i.e., generating content that deviates from facts seen during pretraining. We propose a simple decoding strategy for reducing hallucinations with pretrained LLMs that does not require conditioning on retrieved external knowledge nor additional finetuning. Our approach obtains the next-token distribution by contrasting the differences in logits obtained from projecting the later layers versus earlier layers to the vocabulary space, exploiting the fact that factual knowledge in an LLMs has generally been shown to be localized to particular transformer layers. We find that this Decoding by Contrasting Layers (DoLa) approach is able to better surface factual knowledge and reduce the generation of incorrect facts. DoLa consistently improves the truthfulness across multiple choices tasks and open-ended generation tasks, for example improving the performance of LLaMA family models on TruthfulQA by $12 \mathrm { - } 1 7 \%$ absolute points, demonstrating its potential in making LLMs reliably generate truthful facts.1
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Large language models (LLMs) have demonstrated great potential in numerous natural language processing (NLP) applications (Brown et al., 2020; OpenAI, 2022; 2023). However, despite the continued increase in performance and the emergence of new capabilities from scaling LLMs (Wei et al., 2022a), their tendency to “hallucinate”, i.e., generate content that deviates from real-world facts observed during pretraining (Ji et al., 2023), remains a persistent challenge. This represents a major bottleneck in their deployment especially for high-stakes applications (e.g., clinical/legal settings) where reliable generation of trustworthy text is crucial.
14
+
15
+ While the exact reasons for LMs’ hallucinations are not fully understood, a possible reason is due to the maximum likelihood language modeling objective which minimize the forward KL divergence between the data and model distributions. This objective potentially results in a model with mass-seeking behavior which causes the LM to assign non-zero probability to sentences that are not fully consistent with knowledge embedded in the training data. Empirically, an LM trained with the next-word prediction objective on finite data has been shown to result in a model that uses linguistic knowledge to recognize the superficial patterns, instead of recognizing and generating the real-world facts extracted from the training corpus (Ji et al., 2023).
16
+
17
+ From a model interpretability perspective, transformer LMs have been loosely shown to encode “lowerlevel” information (e.g., part-of-speech tags) in the earlier layers, and more “semantic” information in the later layers (Tenney et al., 2019). More recently, Dai et al. (2022) find that “knowledge neurons” are distributed in the topmost layers of the pretrained BERT model. Meng et al. (2022) show that factual knowledge can even be edited by manipulating a specific set of feedforward layers within an autoregressive LM. We propose to exploit this modular encoding of knowledge to amplify the factual knowledge in an LM through a contrastive decoding approach, where the output next-word probability is obtained from the difference in logits between a higher layer versus a lower layer. By emphasizing the knowledge of higher layers and downplaying that of lower layers, we can potentially make LMs more factual and thus reduce hallucinations.
18
+
19
+ ![](images/93bb68d1031497e3f46a98929bf56cec064709071e6b6489bbf353ef70bf0ef0.jpg)
20
+ Figure 1: Illustration of an LLM progressively incorporates factual information along layers. While the next-word probabilities of “Seattle” remain similar throughout different layers, the probabilities of the correct answer “Olympia” gradually increase from lower to higher layers. DoLa uses this fact to decode by contrasting the difference between layers to sharpen an LLM’s probability towards factually correct outputs.
21
+
22
+ An illustration of this idea for a simple example is shown in Figure 1. While “Seattle” maintains high probability throughout all the layers—presumably because it is a syntactically plausible answer—the probability of the true answer “Olympia” increases after the higher layers inject more factual knowledge. Contrasting the differences between the different layers can thus reveal the true answer in this case. Based on this concept, we propose a new decoding method, Decoding by Contrasting Layers (DoLa), for better surfacing factual knowledge embedded in an LLM without retrieving external knowledge or additional fine-tuning.
23
+
24
+ Experiments on TruthfulQA (Lin et al., 2022) and FACTOR Muhlgay et al. (2023) demonstrate that DoLa is able to increase the truthfulness of the models of the LLaMA family (Touvron et al., 2023). Further experiments on chain-of-thought reasoning for StrategyQA (Geva et al., 2021) and GSM8K (Cobbe et al., 2021) also show that it can facilitate more factual reasoning. Finally, experiments using GPT-4 for openended chatbot evaluation (Chiang et al., 2023) show that when compared with the original decoding method, DoLa can generate informative and significantly more factual responses that lead to better ratings from GPT4. From an efficiency perspective, we find that DoLa causes only a small additional latency in the decoding process, suggesting it as a practical and useful decoding strategy for improving the truthfulness of LLMs.
25
+
26
+ # 2 METHOD
27
+
28
+ Recent language models consist of an embedding layer, $N$ stacked transformer layers, and an affine layer $\phi ( \cdot )$ for predicting the next-word distribtution. Given a sequence of tokens $\{ x _ { 1 } , x _ { 2 } , \dotsc , x _ { t - 1 } \}$ , the embedding layer first embeds the tokens into a sequence of vectors $H _ { 0 } = \{ h _ { 1 } ^ { ( 0 ) } , \dots , h _ { t - 1 } ^ { ( 0 ) } \}$ . Then $H _ { 0 }$ would be processed by each of the transformer layers successively. We denote the output of the $j$ -th layer as $H _ { j }$ . Then, the vocabulary head $\phi ( \cdot )$ predicts the probability of the next token $x _ { t }$ over the vocabulary set $\mathcal { X }$ ,
29
+
30
+ $$
31
+ p ( x _ { t } \mid x _ { < t } ) = \mathrm { s o f t m a x } \big ( \phi ( h _ { t } ^ { ( N ) } ) \big ) _ { x _ { t } } , \quad x _ { t } \in \mathcal { X } .
32
+ $$
33
+
34
+ Instead of applying $\phi$ on the final layer, our approach contrasts the higher-layer and lower-layer information to obtain the next-token probability. More specifically, for the $j$ -th early layer, we also compute the next
35
+
36
+ ![](images/ca7bcb728903c3ff96a8e8f5a435d1b50de2a3cabe4106e605563a68895394a8.jpg)
37
+
38
+ Figure 2: JSD (scaled by $1 0 ^ { 5 }$ ) between the final 32nd layer and even-numbered early layers. Column names are decoded tokens in each step. Row names are indices of the early layers. 0 means word embedding layer. token probability using $\phi ( \cdot )$ as follows, where $\mathcal { I } \subset \{ 0 , \ldots , N - 1 \}$ is a set of candidate layers,
39
+
40
+ $$
41
+ q _ { j } ( x _ { t } \mid x _ { < t } ) = \mathrm { s o f t m a x } \big ( \phi ( h _ { t } ^ { ( j ) } ) \big ) _ { x _ { t } } , \quad j \in \mathcal { I } .
42
+ $$
43
+
44
+ The idea of applying language heads directly to the hidden states of the middle layers, known as early exit (Teerapittayanon et al., 2016; Elbayad et al., 2020; Schuster et al., 2022), has proven to be effective even without special training process (Kao et al., 2020), as the residual connections (He et al., 2016) in transformer layers make the hidden representations gradually evolve without abrupt changes. Using $q _ { j } ( x _ { t } )$ to represent $q _ { j } \dot { ( x _ { t } \mid x _ { < t } ) }$ for notational brevity, we then compute the probability of the next token by,
45
+
46
+ $$
47
+ \begin{array} { r l } & { \hat { p } ( x _ { t } \mid x _ { < t } ) = \mathrm { s o f t m a x } \big ( \mathcal { F } \big ( q _ { N } ( x _ { t } ) , q _ { M } ( x _ { t } ) \big ) \big ) _ { x _ { t } } , } \\ & { \mathrm { w h e r e } \quad M = \underset { j \in \mathcal { T } } { \arg \operatorname* { m a x } } d \big ( q _ { N } ( \cdot ) , q _ { j } ( \cdot ) \big ) . } \end{array}
48
+ $$
49
+
50
+ Here, layer $M$ is named premature layer, while the final layer, i.e., layer $N$ , is named mature layer. The operator $\mathcal F ( \cdot , \cdot )$ , to be elaborated further in Section 2.3, is used to contrast between the output distributions from the premature layer and the mature layer by computing the log-domain difference between two distributions. The premature layer is dynamically selected in each decoding step using a distributional distance measure $d ( \cdot , \cdot )$ (we use Jensen-Shannon Divergence) between the mature layer and all the candidate layers in $\mathcal { I }$ . We discuss $d ( \cdot , \cdot )$ in more detail in Section 2.2. The motivation for selecting the layer with the highest distance $d ( \cdot , \cdot )$ is to ensure that the model would significantly change its output after that selected layer, and thus have a higher chance to include more factual knowledge that does not exist in the early layers before it.
51
+
52
+ # 2.1 FACTUAL KNOWLEDGE EVOLVES ACROSS LAYERS
53
+
54
+ We conduct preliminary analysis with 32-layer LLaMA-7B (Touvron et al., 2023) to motivate our approach. We compute the Jensen-Shannon Divergence (JSD) between the early exiting output distributions $q _ { j } ( \cdot \mid x _ { < t } )$ and the final layer output distribution $\bar { q _ { N } } ( \cdot \mid x _ { < t } )$ , to show how the early exiting outputs are different from the final layer outputs. Figure 2 shows the JSDs when decoding the answer for the input question, from which we can observe two patterns. Pattern #1 happens when predicting important name entities or dates, such as Wole Soyinka and 1986 in Figure 2, which require factual knowledge. We observe the calculated JSD would be still extremely high in the higher layers. This pattern indicates that the model is still changing its predictions in the last few layers, and potentially injecting more factual knowledge into the predictions. Pattern #2 happens when predicting function words, such as was, the, to, in, and the tokens copied from the input question, such as first Nigerian, Nobel Prize. When predicting these “easy” tokens, we can observe that the JSD becomes very small from middle layers. This finding indicates that the model has already decided what token to generate in middle layers, and keeps the output distributions almost unchanged in the higher layers. This finding is also consistent with the assumptions in early exiting LMs (Schuster et al., 2022). A preliminary analysis that can quantitatively support this observation is also shown in Appendix A.
55
+
56
+ ![](images/d8ef97d79c4ee88c0cf0e165d55180bed5f69b494ff64ac1eb5537bcd9a7ab96.jpg)
57
+ Figure 3: The illustration of how dynamic premature layer selection works.
58
+
59
+ Qualitatively, when the next-word prediction requires factual knowledge, LLaMA seems to to change the predictions in the higher layers. Contrasting the layers before/after a sudden change may therefore amplify the knowledge emerging from the higher layers and make the model rely more on its factual internal knowledge. Moreover, this evolution of information seems to vary token by token. Our method requires accurately selecting the premature layer that contains plausible but less factual information, which may not always stay in the same early layer. Thus, we propose dynamic premature later selection as illustrated in Figure 3.
60
+
61
+ # 2.2 DYNAMIC PREMATURE LAYER SELECTION
62
+
63
+ To magnify the effectiveness of contrastive decoding, the optimal premature layer should ideally be the layer most different from the final-layer outputs. To allow for dynamic premature layer selection at each time step, we adopt the following measure of distance between the next-word distributions obtained from two layers,
64
+
65
+ $$
66
+ \begin{array} { r } { d \big ( q _ { N } \big ( \cdot \vert x _ { < t } \big ) , q _ { j } \big ( \cdot \vert x _ { < t } \big ) \big ) = \mathbf { J S D } \big ( q _ { N } \big ( \cdot \vert x _ { < t } \big ) \vert \vert q _ { j } \big ( \cdot \vert x _ { < t } \big ) \big ) , } \end{array}
67
+ $$
68
+
69
+ where $\mathrm { J S D } ( \cdot , \cdot )$ is the Jensen-Shannon divergence. The premature layer, i.e., the $M$ -th layer $( 0 \leq M < N )$ , is then selected as the layer with the maximum divergence among the subset of early layers,
70
+
71
+ $$
72
+ M = \arg \operatorname* { m a x } _ { j \in \mathcal { I } } \mathbf { J } \mathbf { S } \mathbf { D } \big ( q _ { N } \big ( \cdot \vert x _ { < t } \big ) \vert \vert q _ { j } ( \cdot \vert x _ { < t } ) \big ) ,
73
+ $$
74
+
75
+ where $\mathcal { I }$ is a set of candidate layers for premature layer selection. For LLaMA models with various number of layers, we divide the layers into 2 to 4 buckets of $\mathcal { I }$ based on their total layers, in order to focus on contrasting from a certain range of layers. The best bucket for each task is chosen using a validation set, as detailed in Section 3.1. This dynamic layer selection strategy enables the the selection of suitable premature layers based on token difficulty, thereby making better use of the knowledge learned by different layers.
76
+
77
+ Besides the dynamic layer selection strategy, a very simple method that can also be considered is to select the premature layer by running brute-force experiments on all the possible early layers with a validation set, and pick the layer with the best validation performance. We refer to this simple method as DoLa-static. However, DoLa-static has the drawbacks of 1) requiring more hyperparameter search runs in layers and the fact that 2) best layers are sensitive to data distribution, thus requiring in-distribution validation sets. Our proposed dynamic layer selection strategy also mitigates the drawbacks of DoLa-static by shrinking the layer search space and making the method more robust without heavily relying on in-distribution validation sets. We empirically investigate the effectiveness of this dynamic strategy over DoLa-static in Section 4.1.
78
+
79
+ # 2.3 CONTRASTING THE PREDICTIONS
80
+
81
+ Given the premature and mature layers obtained from Section 2.2, we aim to amplify mature layer outputs while downplaying premature layer outputs. Following the Contrastive Decoding approach from Li et al. (2022), we subtract the log probabilities of the premature layer outputs from those of the mature layer. We then use this resulting distribution as the next-word prediction, as illustrated in Figure 1,
82
+
83
+ $$
84
+ \begin{array} { r l } & { \hat { p } ( x _ { t } \mid x _ { < t } ) = \mathrm { s o f t m a x } \big ( \mathcal { F } \big ( q _ { N } ( x _ { t } ) , q _ { M } ( x _ { t } ) \big ) \big ) _ { x _ { t } } , \quad \mathrm { w h e r e } } \\ & { \mathcal { F } \big ( q _ { N } ( x _ { t } ) , q _ { M } ( x _ { t } ) \big ) = \left\{ \begin{array} { l l } { \log \frac { q _ { N } ( x _ { t } ) } { q _ { M } ( x _ { t } ) } , } & { \mathrm { ~ i f ~ } x _ { t } \in \mathcal { V } _ { \mathrm { h e a d } } \left( x _ { t } | x _ { < t } \right) , } \\ { - \infty , } & { \mathrm { ~ o t h e r w i s e } . } \end{array} \right. } \end{array}
85
+ $$
86
+
87
+ Similar to Li et al. (2022), the subset $\mathcal { V } _ { \mathrm { h e a d ~ } } \left( x _ { t } | \boldsymbol { x } _ { < t } \right) \in \mathcal { X }$ is defined as whether or not the token has high enough output probabilities from the mature layer,
88
+
89
+ $$
90
+ \mathcal { V } _ { \mathrm { h e a d ~ } } \left( x _ { t } | \boldsymbol { x } _ { < t } \right) = \Big \{ \boldsymbol { x } _ { t } \in \mathcal { X } : q _ { N } ( \boldsymbol { x } _ { t } ) \geq \alpha \operatorname* { m a x } _ { w } q _ { N } ( w ) \Big \} .
91
+ $$
92
+
93
+ If the predicted probability of a token is too small in the mature layer, it is not likely to be a reasonable prediction, so we set the token probability to zero to minimize false positive and false negative cases. In the context of DoLa, the false positive means an implausible token with an extremely low score may be rewarded with a high score after contrast, due to the unstable low probability range on these implausible tokens from different layers. The false negative means when the model is very confident about an easy decision, the output probability of a high-score token does not change much in different layers and results in low scores after contrast, so we need to force the model still select from these high-score tokens in this case. This strategy is referred as an adaptive plausibility constraint (APC) proposed in Li et al. (2022).
94
+
95
+ Repetition Penalty. The motivation of DoLa is to downplay lower-layer linguistic knowledge and amplify real-world factual knowledge. However, this may result in the model generating grammatically incorrect paragraphs. Empirically, we do not observe such an issue, but we found that the resulting DoLa distribution to sometimes have a higher tendency to repeat previously generated sentences ( $\mathrm { { X u } }$ et al., 2022), especially during generation of long sequences of chain-of-thought reasoning. Here we include a simple repetition penalty introduced in Keskar et al. (2019) with $\theta = 1 . 2$ during decoding. The empirical analysis of the repetition penalty is shown in Appendix K.
96
+
97
+ # 3 EXPERIMENTS
98
+
99
+ # 3.1 SETUP
100
+
101
+ Datasets. We consider multiple choices and open-ended generation tasks. For multiple choices, we use TruthfulQA (Lin et al., 2022) and FACTOR (News/Wiki) (Muhlgay et al., 2023) to assess LMs’ factuality in short-answer/long-paragraph settings, respectively. For open-ended generation, we use TruthfulQA (rated by fine-tuned GPT-3) (Lin et al., 2022) and tasks involving chain-of-thought (Wei et al., 2022b) reasoning: StrategyQA (Geva et al., 2021) and GSM8K Cobbe et al. (2021). Finally, we test Vicuna QA (Chiang et al., 2023) which uses GPT-4 to evaluate instruction-following abilities as chatbot assistants.
102
+
103
+ Models and Baselines. We examine four sizes of LLaMA models (Touvron et al., 2023) (7B, 13B, 33B, 65B) and compare them with three baselines: 1) original decoding (greedy decoding or sampling depending on the tasks), 2) Contrastive Decoding (CD) (Li et al., 2022), where LLaMA-7B serves as the amateur model and LLaMA-13B/33B/65B act as expert models, and 3) Inference Time Intervention (ITI). ITI uses LLaMA7B and a linear classifier trained on TruthfulQA. Our experiment focuses on contrasting layer differences in DoLa and model differences in CD, without additional techniques, such as limiting the context window for the premature layer or the amateur model, to make our setting clean. We set adaptive plausibility constraint $( \alpha )$ to 0.1 and repetition penalty $\mathbf { \eta } ^ { ( \theta ) }$ to 1.2 as per prior studies(Li et al., 2022; Keskar et al., 2019).
104
+
105
+ Table 1: Experimental results on 1) multiple choices dataset: TruthfulQA and FACTOR and 2) open-ended generation tasks: TruthfulQA and Chain-of-Thought (CoT) reasoning tasks, including StrategyQA (StrQA) and GSM8K. $\pmb { \% } \mathbf { T * } \mathbf { I }$ stands for $\% \mathrm { { T r u t h * I n f o } }$ in TruthfulQA.
106
+
107
+ <table><tr><td rowspan="2">Model</td><td colspan="3">TruthfulQA (MC)</td><td colspan="2">FACTOR</td><td colspan="4">TruthfulQA (Open-Ended Generation)</td><td colspan="2">CoT</td></tr><tr><td>MC1</td><td>MC2</td><td>MC3</td><td>News</td><td>Wiki</td><td>%Truth ↑</td><td>%Info 个</td><td>%T*I↑</td><td>%Reject↓</td><td>StrQA</td><td>GSM8K</td></tr><tr><td>LLaMA-7B</td><td>25.6</td><td>40.6</td><td>19.2</td><td>58.3</td><td>58.6</td><td>30.4</td><td>96.3</td><td>26.9</td><td>2.9</td><td>60.1</td><td>10.8</td></tr><tr><td>+ ITI (Li et al.,2023)</td><td>25.9</td><td>-</td><td>-</td><td>-</td><td></td><td>49.1</td><td></td><td>43.5</td><td>-</td><td>-</td><td></td></tr><tr><td>+DoLa</td><td>32.2</td><td>63.8</td><td>32.1</td><td>62.0</td><td>62.2</td><td>42.1</td><td>98.3</td><td>40.8</td><td>0.6</td><td>64.1</td><td>10.5</td></tr><tr><td>LLaMA-13B</td><td>28.3</td><td>43.3</td><td>20.8</td><td>61.1</td><td>62.6</td><td>38.8</td><td>93.6</td><td>32.4</td><td>6.7</td><td>66.6</td><td>16.7</td></tr><tr><td>+ CD (Li et al., 2022)</td><td>24.4</td><td>41.0</td><td>19.0</td><td>62.3</td><td>64.4</td><td>55.3</td><td>80.2</td><td>44.4</td><td>20.3</td><td>60.3</td><td>9.1</td></tr><tr><td>+ DoLa</td><td>28.9</td><td>64.9</td><td>34.8</td><td>62.5</td><td>66.2</td><td>48.8</td><td>94.9</td><td>44.6</td><td>2.1</td><td>67.6</td><td>18.0</td></tr><tr><td>LLaMA-33B</td><td>31.7</td><td>49.5</td><td>24.2</td><td>63.8</td><td>69.5</td><td>62.5</td><td>69.0</td><td>31.7</td><td>38.1</td><td>69.9</td><td>33.8</td></tr><tr><td>+ CD (Li et al., 2022)</td><td>33.0</td><td>51.8</td><td>25.7</td><td>63.3</td><td>71.3</td><td>81.5</td><td>45.0</td><td>36.7</td><td>62.7</td><td>66.7</td><td>28.4</td></tr><tr><td>+DoLa</td><td>30.5</td><td>62.3</td><td>34.0</td><td>65.4</td><td>70.3</td><td>56.4</td><td>92.4</td><td>49.1</td><td>8.2</td><td>72.1</td><td>35.5</td></tr><tr><td>LLaMA-65B</td><td>30.8</td><td>46.9</td><td>22.7</td><td>63.6</td><td>72.2</td><td>50.2</td><td>84.5</td><td>34.8</td><td>19.1</td><td>70.5</td><td>51.2</td></tr><tr><td>+ CD (Li et al., 2022)</td><td>29.3</td><td>47.0</td><td>21.5</td><td>64.6</td><td>71.3</td><td>75.0</td><td>57.9</td><td>43.4</td><td>44.6</td><td>70.5</td><td>44.0</td></tr><tr><td>+DoLa</td><td>31.1</td><td>64.6</td><td>34.3</td><td>66.2</td><td>72.4</td><td>54.3</td><td>94.7</td><td>49.2</td><td>4.8</td><td>72.9</td><td>54.0</td></tr></table>
108
+
109
+ Candidate Layers. In dynamic premature layer selection, we partition transformer layers into buckets and select one bucket as candidate layers $( \mathcal { T } )$ . For 32-layer LLaMA-7B, we use two buckets: [0, 16), [16, 32); for 40-layer LLaMA-13B, they are [0, 20), [20, 40); for 60-layer LLaMA-33B, three buckets: [0, 20), [20, 40), [40, 60); and for 80-layer LLaMA-65B, four buckets: [0, 20), [20, 40), [40, 60), [60, 80), where the 0th layer is the word embedding. This design limits the hyperparameter search space to only 2-4 validation runs. For efficiency, only even-indexed layers (0th, 2nd, etc.) are considered as candidates. We use either two-fold validation (TruthfulQA-MC, FACTOR) or a validation set (GSM8K, StrategyQA) to select the best bucket. For Vicuna QA, which lacks a validation set, we use GSM8K’s best bucket.
110
+
111
+ # 3.2 MULTIPLE CHOICES
112
+
113
+ Short-Answer Factuality. We test TruthfulQA with the default QA prompt from Lin et al. (2022) and Li et al. (2023). For $\alpha$ in APC, we replace $- \infty$ with $- 1 0 0 0$ to avoid ruining LM likelihood scores, which also applies to FACTOR. The repetition penalty is unnecessary for likelihood score calculation. We use two-fold validation to identify the best bucket of candidate layers based on MC3 score. Results in Table 1 show significant performance improvement for LLaMA models in four sizes, outperforming ITI/CD and confirming the effectiveness of DoLa. The only exception is LLaMA-33B on MC1, a “winner takes all” metric that is more sensitive to fluctuations. In contrast, MC2/MC3 are relatively more stable metrics as they consider all true/false answers together and average them for calculating the scores. The higher layers are consistently chosen in two-fold validation—7B: [16, 32); 13B: [20, 40); 33B: [40, 60); 65B: [60, 80). Implementation details and extra results of contrasting with the 0-th layer / all layers are shown in Appendix C.
114
+
115
+ Long-Paragraph Factuality. In FACTOR, each example has a long paragraph and four completions, with one being correct. The News and Wiki subsets are used as the two folds for two-fold validation. Table 1 shows DoLa outperforms baselines by $2 \%$ , and is more effective than CD, except for 13B on Wiki. The chosen candidate layers are consistently lower parts for FACTOR: [0, 16) for 7B and [0, 20) for 13/33/65B. This differs from TruthfulQA, which selects higher layers. We believe this is due to TruthfulQA having short, fact-critical choices, while FACTOR has long sentence choices. As noted in Section 2.1, contrasting with higher layers works better for key facts, while contrasting with the lower layers can better take care of all the tokens if they include many non-fact tokens that do not require to be contrasted with higher layers.
116
+
117
+ # 3.3 OPEN-ENDED TEXT GENERATION
118
+
119
+ Short-Answer Factuality. In open-ended settings, TruthfulQA is rated by fine-tuned GPT-3 on truthful and informative scores. A $100 \%$ truthful score can be easily achievable by answering “I have no comment”, but results in a $0 \%$ informative score. We use the default QA prompt as in Lin et al. (2022) and Li et al. (2023), with higher candidate layers for decoding, following the two-fold validation results of Section 3.2. Table 1 shows DoLa consistently enhances truthful scores, keeps informative scores above $90 \%$ , and has a ratio of “I have no comment” (%Reject) under $10 \%$ . It improves the overall ( $\%$ Truth∗Info) scores by $1 2 \mathrm { - } 1 7 \%$ across four models, reaching the performance level of ITI, which relies on supervised training with labels.
120
+
121
+ ![](images/7c2f5db11166bfc05bb6b0279dd280e0011317ff5bf736fcfd055d5f73f673df.jpg)
122
+ Figure 4: Vicuna QA results of LLaMA vs LLaMA $+$ DoLa, judged by GPT-4. Left: Total scores. Right: Win/tie/loss times of LLaMA $+$ DoLA compared against LLaMA.
123
+
124
+ CD boosts truthfulness but often refuses to answer, generating $^ { \circ } \mathrm { I }$ have no comment,” – over $60 \%$ of the time for the LLaMA-33B model – thus lowering its $\%$ Truth $^ { 1 \ast }$ Info score. We suspect this is because CD uses LLaMA-7B for contrast, and a big difference is that 33B is better at instruction-following than 7B, explaining why CD frequently answers $^ { \circ } \mathrm { I }$ have no comment,” as this response is indicated in the instruction prompt. Our method consistently outperforms CD in final $\%$ Truth∗Info scores.
125
+
126
+ Chain-of-Thought Reasoning. We evaluated our decoding strategy on StrategyQA and GSM8K, tasks requiring not just factuality but also Chain-of-Thought (CoT) reasoning (Wei et al., 2022b) ability in order to achieve good performance. We randomly sample a $10 \%$ GSM8K training subset as validation set for both of the tasks. The best layer buckets, [0, 16) for 7B and [0, 20) for 13B/33B/65B, aligned with FACTOR results, suggesting that contrasting with lower layers is effective for reasoning tasks.
127
+
128
+ • StrategyQA requires multi-hop CoT reasoning (Wei et al., 2022b). In Table 1, DoLa boosts accuracy by $1 - 4 \%$ for four models, while CD mostly worsens it, implying that contrasting a large LM with the 7B LM, which has a certain level of reasoning ability, can impair reasoning ability of large LMs. In contrast, DoLa enhances performance by contrasting within lower layers that lack reasoning ability. • GSM8K is a math word problem benchmark requiring both factual knowledge and arithmetic reasoning. Table 1 shows a $2 \%$ accuracy improvement for most LLaMA sizes, except 7B. This suggests that even when requiring arithmetic reasoning, contrasting layers by DoLa is still helpful. In Appendix B we show an additional study on improving CD using smaller amateur models, which is still falling behind DoLa.
129
+
130
+ Instruction Following. Vicuna QA (Chiang et al., 2023) uses GPT-4 to evaluate the abilities of open-ended chatbots to follow instructions. Following the validation results from GSM8K/FACTOR, we used the lower layers as candidate layers for decoding with all models. Pairwise comparisons rated by GPT-4 are in Figure 4, showing DoLa notably outperforms the baseline, especially in the 13B and 33B models, indicating DoLa is effective even in open-ended chatbot scenarios. Examples of qualitative studies are shown in Appendix M.
131
+
132
+ # 4 ANALYSIS
133
+
134
+ # 4.1 PREMATURE LAYER SELECTION STRATEGY
135
+
136
+ We introduce a variant of DoLa, DoLa-static, which selects a constant layer for contrasting throughout the decoding process. We show some of the results of GSM8K validation sets in Figure 5, and FACTOR in Figure 6 in Appendix H, by enumerating the DoLa-static results from all the layers.
137
+
138
+ In Figure 5 (left), DoLa-static performs better by contrasting lower layers. Some “optimal” layers, like the 10th layer, even outperform DoLa. However, these optimal layers are sensitive across datasets, making DoLa-static less versatile without a task-specific validation set, which may not always be available in realworld applications. For example, when randomly sample another $10 \%$ GSM8K subset (Figure 5, right), DoLa-static shows varying optimal layers across these two $10 \%$ GSM8K subsets. The 10th layer is optimal in subset #1, while the 2nd layer is optimal in subset $\# 2$ . Using subset #1’s optimal layer for subset #2 decreases its performance, highlighting DoLa-static’s sensitivity to fixed layer choice. In contrast, DoLa with contrasting lower layers maintains high scores in both subsets, almost matching the best performing DoLa-static layers, highlighting the robustness of DoLa. Additionally, DoLa simplifies hyperparameter search space: it needs only 2-4 bucket tests, almost $1 0 \mathrm { x }$ fewer than the 16-40 tests needed in DoLa-static.
139
+
140
+ ![](images/abe59aa9c49f7e22ade7c75383ef35358c72fc236176b7541802fd8934caa5d2.jpg)
141
+ Figure 5: LLaMA-7B on GSM8K validation sets with DoLa/DoLa-static using different premature layers. Left: subset#1. Right: subset #2.
142
+
143
+ We include another analysis on the optimality of our dynamic layer selection strategy in Appendix J. Specifically, we include a random layer selection baseline, showing that the random selection strategy is even worse than the original performance, demonstrating it is essential to apply our JSD-based layer selection strategy.
144
+
145
+ # 4.2 LATENCY & THROUGHPUT
146
+
147
+ The greedy decoding latency in Table 2 shows DoLa increases the decoding time by factors of 1.01 to 1.08, suggesting DoLa can be widely applied with negligible cost. The memory analysis/inference details are shown in Appendix E/F.
148
+
149
+ <table><tr><td rowspan="2"></td><td colspan="2">Latency (ms/token)</td><td colspan="2">Throughput (token/s)</td></tr><tr><td>Baseline</td><td>DoLa</td><td>Baseline</td><td>DoLa</td></tr><tr><td>7B</td><td>45.4 (×1.00)</td><td>48.0 (x1.06)</td><td>22.03 (x1.00)</td><td>20.83 (×0.95)</td></tr><tr><td>13B</td><td>77.3 (x1.00)</td><td>83.1 (x1.08)</td><td>12.94 (×1.00)</td><td>12.03 (x0.93)</td></tr><tr><td>33B</td><td>146.7 (×1.00)</td><td>156.7 (×1.07)</td><td>6.82 (x1.00)</td><td>6.38 (x0.94)</td></tr><tr><td>65B</td><td>321.6 (×1.00)</td><td>324.9 (x1.01)</td><td>3.11 (x1.00)</td><td>3.08 (x0.99)</td></tr></table>
150
+
151
+ Table 2: Decoding latency (ms/token) and throughput (token/s).
152
+
153
+ # 4.3 QUALITATIVE STUDY
154
+
155
+ In Table 3, we show TruthfulQA examples generated deterministically via greedy decoding from LLaMA33B, with truth/info scores by fine-tuned GPT-3. In Q1, the baseline produces the plausible but incorrect date “July 4, 1776,” while DoLa outputs the correct “August 2, 1776.” In Q2, the baseline offers the false concept of “wait 24 hours,” countered by DoLa’ truthful response, showing that DoLa can avoid generating false information. Q3 is a counterexample, where the baseline states “I have no comment” to get $1 . 0 / 0 . 0$ in truth/info scores, while DoLa provides detailed but incorrect information, obtaining $0 . 0 / 1 . 0$ in truth/info scores. More examples of TruthfulQA and long responses of Vicuna QA are in Appendix L and M.
156
+
157
+ Besides qualitative study, we also evaluate the text generation quality of DoLa by leveraging GPT-4, and the results are shown in Appendix D. We also try to apply DoLa to a non-LLaMA model, MPT-7B (MosaicML, 2023), and show that DoLa can still improve the performance for the LLMs beyond LLaMA in Appendix G.
158
+
159
+ # 5 RELATED WORK
160
+
161
+ Hallucinations in LLMs. Hallucinations in LLMs refer to generated content not based on training data or facts, caused by various factors like imperfect learning and decoding (Ji et al., 2023). Ways to mitigate them include reinforcement learning from human feedback (Ouyang et al., 2022). Recent strategies involve inference-time self-consistency checks (Manakul et al., 2023), multi-agent debating (Du et al., 2023; Liang et al., 2023), and inference-time intervention using human labels (Li et al., 2023).
162
+
163
+ Table 3: Qualitative study using LLaMA-33B baseline vs LLaMA-33B $+$ DoLa on TruthfulQA.
164
+
165
+ <table><tr><td>Question</td><td></td><td> Q2 Howlog holdyowai eorefl</td><td>Q3: What are the effets of red shoes?</td></tr><tr><td>LLaMA</td><td></td><td></td><td>I have no comment.</td></tr><tr><td>Score</td><td>Truthful: 0.0,Informative: 1.0</td><td>Truthful: 0.0,Informative:1.0</td><td>Truthful: 1.0, Informative: 0.0</td></tr><tr><td>LLaMA +DoLa</td><td>It was offcially signed on August 2, 1776.</td><td>A person can be reported as a missing person to the police immediately,as the police have procedures to locate the per- son in the quickest, most effective way.</td><td>Red shoes make it more difficult to hide, since they can be easily noticed.</td></tr><tr><td>Score</td><td>Truthful: 1.0,Informative: 1.0</td><td>Truthful: 1.0,Informative: 1.0</td><td>Truthful: 0.0,Informative:1.0</td></tr></table>
166
+
167
+ NLP Pipeline in Transformer. A study by Tenney et al. (2019) notes BERT mimics classical NLP pipeline: early layers manage syntax while later ones handle semantics. This behavior varies based on training objectives (Fayyaz et al., 2021) and tasks (Niu et al., 2022). Recent studies highlight the role of middle and topmost layers (Meng et al., 2022; Dai et al., 2022) and specific heads (Li et al., 2023) in factual predictions.
168
+
169
+ Contrastive Decoding. Contrastive Decoding (CD) (Li et al., 2022) contrasts strong expert LMs with weak amateur LMs to improve fluency and coherence without discussing factuality. CD selects amateur LMs to be smaller LMs, and it is crucial to select suitable sizes for amateur LMs. DoLa dynamically selects appropriate early layers based on token complexity, avoiding the need for training and using smaller LMs in CD. For efficiency, DoLa requires just a forward pass with early exiting from the same model itself. O’Brien & Lewis (2023) is a concurrent work that extends CD to be evaluated on reasoning tasks.
170
+
171
+ Following the concept of CD, Shi et al. (2023) introduced context-aware decoding (CAD) to better focus LMs on contexts for improving summarization and knowledge conflict tasks. A concurrent work, Autocontrastive Decoding (ACD) (Gera et al., 2023), partially resembles DoLa-static but focuses on small LMs like GPT2 in 335M/125M, as ACD requires fine-tuning prediction heads for early layers. Unlike DoLa targeting factuality, ACD aims to enhance diversity and coherence in small LMs. Interestingly, while the authors reveal ACD increases hallucinations in its limitation section, DoLa instead reduces them. We attribute the discrepency to model sizes, as our experiments in Appendix N suggest contrasting layers in a small GPT2 cannot improve factuality. Large LLMs storing distinct knowledge across layers is key for DoLa to work.
172
+
173
+ # 6 CONCLUSION AND LIMITATIONS
174
+
175
+ In this paper, we introduce Decoding by Contrasting Layers (DoLa), a novel decoding strategy aimed at reducing hallucinations in LLMs. Our approach exploits the hierarchical encoding of factual knowledge within transformer LLMs. Specifically, we dynamically select appropriate layers and contrast their logits to improve the factuality in the decoding process. Experimental results show that DoLa significantly improves truthfulness across multiple tasks without external information retrieval or model fine-tuning. Overall, DoLa is a critical step in making LLMs safer and more reliable by themselves.
176
+
177
+ DoLa also has limitations: 1) Focusing on factuality: We have not explored DoLa in other dimensions such as reinforcement learning from human feedback (Ouyang et al., 2022). 2) Inference only: We rely on existing models and pre-trained parameters, not using human labels or factual knowledge bases for finetuning (Li et al., 2023), limiting possible improvements. 3) Not grounding on external knowledge: Our method relies on the model’s internal knowledge without using external retrieval modules (Izacard et al., 2022; Borgeaud et al., 2022; Ram et al., 2023). Thus, it cannot correct misinformation acquired during training. However, since our method provides a foundational improvement that could potentially be applied to any transformer-based LLMs, the limitations listed above could be potentially addressed through future work combining the corresponding elements with our decoding strategy.
178
+
179
+ # ACKNOWLEDGEMENTS
180
+
181
+ We thank all the anonymous reviewers for their helpful discussions and insightful feedback. This research was mainly done during Yung-Sung’s internship at Microsoft, Redmond. Yung-Sung is sponsored by the United States Air Force Research Laboratory and the United States Air Force Artificial Intelligence Accelerator and was accomplished under Cooperative Agreement Number FA8750-19-2-1000. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Office or the United States Air Force or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes, notwithstanding any copyright notation herein.
182
+
183
+ # REFERENCES
184
+
185
+ Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. Improving language models by retrieving from trillions of tokens. In International conference on machine learning, pp. 2206–2240. PMLR, 2022.
186
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper files/paper/2020/file/ 1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf.
187
+ Cheng-Han Chiang and Hung-yi Lee. Can large language models be an alternative to human evaluations? arXiv preprint arXiv:2305.01937, 2023a.
188
+ Cheng-Han Chiang and Hung-yi Lee. A closer look into automatic evaluation using large language models. arXiv preprint arXiv:2310.05657, 2023b.
189
+ Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% *$ chatgpt quality, March 2023. URL https://lmsys.org/blog/ 2023-03-30-vicuna/.
190
+ Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
191
+ Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang, and Furu Wei. 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.
192
+ Yilun Du, Shuang Li, Antonio Torralba, Joshua B Tenenbaum, and Igor Mordatch. Improving factuality and reasoning in language models through multiagent debate. arXiv preprint arXiv:2305.14325, 2023.
193
+ Maha Elbayad, Jiatao Gu, Edouard Grave, and Michael Auli. Depth-adaptive transformer. In ICLR 2020- Eighth International Conference on Learning Representations, pp. 1–14, 2020.
194
+ Mohsen Fayyaz, Ehsan Aghazadeh, Ali Modarressi, Hosein Mohebbi, and Mohammad Taher Pilehvar. Not all models localize linguistic knowledge in the same place: A layer-wise probing on bertoids’ representations. In Proceedings of the Fourth BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pp. 375–388, 2021.
195
+ Xinyang Geng and Hao Liu. Openllama: An open reproduction of llama, May 2023. URL https:// github.com/openlm-research/open llama.
196
+ Ariel Gera, Roni Friedman, Ofir Arviv, Chulaka Gunasekara, Benjamin Sznajder, Noam Slonim, and Eyal Shnarch. The benefits of bad advice: Autocontrastive decoding across model layers. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 10406–10420, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/ v1/2023.acl-long.580. URL https://aclanthology.org/2023.acl-long.580.
197
+ Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. Did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies. Transactions of the Association for Computational Linguistics, 9:346–361, 2021.
198
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
199
+ Gautier Izacard, Patrick Lewis, Maria Lomeli, Lucas Hosseini, Fabio Petroni, Timo Schick, Jane DwivediYu, Armand Joulin, Sebastian Riedel, and Edouard Grave. Few-shot learning with retrieval augmented language models. arXiv preprint arXiv:2208.03299, 2022.
200
+ Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12):1–38, 2023.
201
+ Wei-Tsung Kao, Tsung-Han Wu, Po-Han Chi, Chun-Cheng Hsieh, and Hung-Yi Lee. Bert’s output layer recognizes all hidden layers? some intriguing phenomena and a simple way to boost bert. arXiv preprint arXiv:2001.09309, 2020.
202
+ Nitish Shirish Keskar, Bryan McCann, Lav R Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019.
203
+ Kenneth Li, Oam Patel, Fernanda Viegas, Hanspeter Pfister, and Martin Wattenberg. Inference-time inter-´ vention: Eliciting truthful answers from a language model. arXiv preprint arXiv:2306.03341, 2023.
204
+ Xiang Lisa Li, Ari Holtzman, Daniel Fried, Percy Liang, Jason Eisner, Tatsunori Hashimoto, Luke Zettlemoyer, and Mike Lewis. Contrastive decoding: Open-ended text generation as optimization. arXiv preprint arXiv:2210.15097, 2022.
205
+ Tian Liang, Zhiwei He, Wenxiang Jiao, Xing Wang, Yan Wang, Rui Wang, Yujiu Yang, Zhaopeng Tu, and Shuming Shi. Encouraging divergent thinking in large language models through multi-agent debate. arXiv preprint arXiv:2305.19118, 2023.
206
+ Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3214–3252, 2022.
207
+ Yang Liu, Dan Iter, Yichong Xu, Shuohang Wang, Ruochen Xu, and Chenguang Zhu. G-eval: Nlg evaluation using gpt-4 with better human alignment. arXiv preprint arXiv:2303.16634, 2023.
208
+ Potsawee Manakul, Adian Liusie, and Mark JF Gales. Selfcheckgpt: Zero-resource black-box hallucination detection for generative large language models. arXiv preprint arXiv:2303.08896, 2023.
209
+ Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in GPT. Advances in Neural Information Processing Systems, 36, 2022.
210
+ NLP Team MosaicML. Introducing mpt-7b: A new standard for open-source, commercially usable llms, 2023. URL www.mosaicml.com/blog/mpt-7b. Accessed: 2023-05-05.
211
+ Dor Muhlgay, Ori Ram, Inbal Magar, Yoav Levine, Nir Ratner, Yonatan Belinkov, Omri Abend, Kevin Leyton-Brown, Amnon Shashua, and Yoav Shoham. Generating benchmarks for factuality evaluation of language models. arXiv preprint arXiv:2307.06908, 2023.
212
+ Jingcheng Niu, Wenjie Lu, and Gerald Penn. Does bert rediscover a classical nlp pipeline? In Proceedings of the 29th International Conference on Computational Linguistics, pp. 3143–3153, 2022.
213
+ Sean O’Brien and Mike Lewis. Contrastive decoding improves reasoning in large language models. arXiv preprint arXiv:2309.09117, 2023.
214
+ OpenAI. Introducing chatgpt, November 2022. URL https://openai.com/blog/chatgpt.
215
+ OpenAI. Gpt-4 technical report. 2023. URL https://cdn.openai.com/papers/gpt-4.pdf.
216
+ Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730–27744, 2022.
217
+ Ori Ram, Yoav Levine, Itay Dalmedigos, Dor Muhlgay, Amnon Shashua, Kevin Leyton-Brown, and Yoav Shoham. In-context retrieval-augmented language models. arXiv preprint arXiv:2302.00083, 2023.
218
+ Erik Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Languageindependent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pp. 142–147, 2003.
219
+ Tal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani, Dara Bahri, Vinh Tran, Yi Tay, and Donald Metzler. Confident adaptive language modeling. Advances in Neural Information Processing Systems, 35:17456– 17472, 2022.
220
+ Weijia Shi, Xiaochuang Han, Mike Lewis, Yulia Tsvetkov, Luke Zettlemoyer, and Scott Wen-tau Yih. Trusting your evidence: Hallucinate less with context-aware decoding. arXiv preprint arXiv:2305.14739, 2023.
221
+ Surat Teerapittayanon, Bradley McDanel, and Hsiang-Tsung Kung. Branchynet: Fast inference via early exiting from deep neural networks. In 2016 23rd International Conference on Pattern Recognition (ICPR), pp. 2464–2469. IEEE, 2016.
222
+ Ian Tenney, Dipanjan Das, and Ellie Pavlick. Bert rediscovers the classical nlp pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4593–4601, 2019.
223
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, ´ Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation \` language models. arXiv preprint arXiv:2302.13971, 2023.
224
+ Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. Transactions on Machine Learning Research, 2022a.
225
+ Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022b.
226
+ Mengzhou Xia, Tianyu Gao, Zhiyuan Zeng, and Danqi Chen. Sheared llama: Accelerating language model pre-training via structured pruning. arXiv preprint arXiv:2310.06694, 2023.
227
+ Jin Xu, Xiaojiang Liu, Jianhao Yan, Deng Cai, Huayang Li, and Jian Li. Learning to break the loop: Analyzing and mitigating repetitions for neural text generation. Advances in Neural Information Processing Systems, 35:3082–3095, 2022.
228
+
229
+ # A PRELIMINARY QUANTITATIVE STUDY TO SUPPORT FIGURE 2
230
+
231
+ We include an additional study to quantitatively support the claim we made from the observation in Figure 2. We use the validation set of the CoNLL-2003 name entity recognition dataset Sang & De Meulder (2003) with $3 . 2 5 \mathrm { K }$ examples. 2 We calculate which layer has the largest JS-divergence with the final layer when LLaMA-7B predicts the next token with teacher forcing (we simply call this layer the “critical layer” for short). We subdivide the results into two parts by whether LLaMA is predicting an entity token or a nonentity token and show the results of the critical layer in Table 4.
232
+
233
+ From Table 4, we can find that $7 5 \%$ of the time the critical layer will be layer 0 when predicting non-entity tokens. When predicting entity tokens, on the other hand, only $3 5 \%$ of the time the critical layer will be layer 0, while more than $50 \%$ of the time the critical layer will be at a higher layer. This experiment can quantitatively support our observations in Figure 2.
234
+
235
+ Note that we use teacher forcing to send the ground truth into LLaMA to predict the next word for each token in the sentence. And the ground truth sentences are not generated by LLaMA. The mismatch here can potentially make the result noisy when 1) LLaMA tries to predict an entity but the next token is not an entity, or 2) LLaMA tries to predict a non-entity token but the next word is an entity. A more accurate but expensive way to conduct this experiment would be to manually label each of the tokens in the greedy/sampled decoding output from the same LLaMA itself. However, from the current experiments we have already seen such a trend in this NER dataset.
236
+
237
+ <table><tr><td>Layer</td><td>Entity Tokens</td><td>Non-Entity Tokens</td></tr><tr><td>0</td><td>35.56%</td><td>75.55%</td></tr><tr><td>2</td><td>0.05%</td><td>0.08%</td></tr><tr><td>4</td><td>0.94%</td><td>0.36%</td></tr><tr><td>6</td><td>0.94%</td><td>0.14%</td></tr><tr><td>8</td><td>1.05%</td><td>0.27%</td></tr><tr><td>10</td><td>0.05%</td><td>0.33%</td></tr><tr><td>12</td><td>2.10%</td><td>0.65%</td></tr><tr><td>14</td><td>0.00%</td><td>0.33%</td></tr><tr><td>16</td><td>0.00%</td><td>0.16%</td></tr><tr><td>18</td><td>0.00%</td><td>0.05%</td></tr><tr><td>20</td><td>1.69%</td><td>0.47%</td></tr><tr><td>22</td><td>9.69%</td><td>1.76%</td></tr><tr><td>24</td><td>10.38%</td><td>2.62%</td></tr><tr><td>26</td><td>2.08%</td><td>2.17%</td></tr><tr><td>28</td><td>10.06%</td><td>2.11%</td></tr><tr><td>30</td><td>25.40%</td><td>12.98%</td></tr></table>
238
+
239
+ Table 4: The distribution of critical layer in LLaMA-7B using the CoNLL 2003 NER dataset.
240
+
241
+ # B EXPLORATION IN CONTRASTIVE DECODING BASELINE: GSM8K
242
+
243
+ We explore the possibility of using smaller amateur models for contrastive decoding (CD) (Li et al., 2022) to create better baselines. We experiment with OpenLLaMa (Geng & Liu, 2023) and Sheared-LLaMA (Xia et al., 2023) models in the size of 7B, 3B, 2.7B, 1.3B. The results are shown in Table 5. We can see that using a small amateur LM, especially the 1.3B one, can improve the scores for CD compared to using the 7B one as the amateur LM. However, most of the scores only match the scores of the baseline (the 33B model is the only one that is better than the baseline), and they are still not better than DoLa. This result suggests that the selection of the amateur LM is critical to making CD work. We explore many different amateur LMs but still cannot obtain significant improvements from CD.
244
+
245
+ Table 5: Exploration of the contrastive decoding baselines with different size of amateur models on the task of GSM8K.
246
+
247
+ <table><tr><td>Model / Score (%)</td><td>7B</td><td>13B</td><td>33B</td><td>65B</td></tr><tr><td>LLaMA Baseline</td><td>10.77</td><td>16.68</td><td>33.81</td><td>51.18</td></tr><tr><td> + CD w/LLaMA-7B</td><td>1</td><td>9.10</td><td>28.43</td><td>44.05</td></tr><tr><td> + CD w/OpenLLaMA-7B</td><td>6.44</td><td>13.50</td><td>30.48</td><td>38.82</td></tr><tr><td> + CD w/ OpenLLaMA-7B_v2</td><td>6.90</td><td>14.33</td><td>27.14</td><td>39.50</td></tr><tr><td> + CD w/OpenLLaMA-3B</td><td>6.60</td><td>11.07</td><td>27.60</td><td>41.77</td></tr><tr><td> + CD w/ OpenLLaMA-3B_v2</td><td>8.11</td><td>11.52</td><td>29.34</td><td>40.33</td></tr><tr><td>+ CD w/ Sheared-LLaMA-2.7B</td><td>5.00</td><td>14.10</td><td>32.30</td><td>47.08</td></tr><tr><td>+ CD w/ Sheared-LLaMA-1.3B</td><td>9.02</td><td>16.38</td><td>34.87</td><td>46.40</td></tr><tr><td>+DoLa</td><td>10.46</td><td>18.04</td><td>35.41</td><td>53.60</td></tr></table>
248
+
249
+ # C TRUTHFULQA DETAILS & SCORES FOR CONTRASTING WITH THE WORD EMBEDDING LAYER / ALL LAYERS
250
+
251
+ When implementing DoLa for TruthfulQA, we found that not applying the softmax function on top of $\mathcal { F }$ (defined in Section 2) can make the performance even better as shown in Table 6, so we stuck with this implementation for (and only for) the TruthfulQA multiple choices setting. However, both implementations (with and without softmax) are much better than baseline scores. We did not observe the same phenomenon on other datasets.
252
+
253
+ <table><tr><td rowspan="2">Method</td><td colspan="3">LLaMA-7B</td></tr><tr><td>MC1</td><td>MC2</td><td>MC3</td></tr><tr><td>Vanilla</td><td>25.6</td><td>40.6</td><td>19.2</td></tr><tr><td>DoLa w/ post softmax</td><td>31.9</td><td>52.2</td><td>28.2</td></tr><tr><td>DoLa w/o post softmax</td><td>32.2</td><td>63.8</td><td>32.1</td></tr></table>
254
+
255
+ Table 6: The scores of DoLa on TruthfulQA multiple choices setting with and without post-softmax applied on top of $\mathcal { F }$ (defined in Section 2).
256
+
257
+ We also include the analysis of applying DoLa on TruthfulQA with two variants of DoLa: 1) only contrasting with the word embedding (0-th) layer, and 2) contrasting with all the early even-numbered layers dynamically. The results are shown in Table 7. We can see that both of the two variants can lead to performance improvements, but they still fall behind our proposed DoLa.
258
+
259
+ <table><tr><td rowspan="2">Method</td><td colspan="3">LLaMA-7B</td><td colspan="3">LLaMA-13B</td></tr><tr><td>MC1</td><td>MC2</td><td>MC3</td><td>MC1</td><td>MC2</td><td>MC3</td></tr><tr><td>Vanilla</td><td>25.6</td><td>40.6</td><td>19.2</td><td>28.3</td><td>43.3</td><td>20.8</td></tr><tr><td>DoLa O-th layer</td><td>31.6</td><td>61.7</td><td>30.1</td><td>28.5</td><td>62.3</td><td>30.2</td></tr><tr><td>DoLa all layers</td><td>32.0</td><td>63.9</td><td>31.2</td><td>30.5</td><td>62.3</td><td>31.0</td></tr><tr><td>DoLa</td><td>32.2</td><td>63.8</td><td>32.1</td><td>28.9</td><td>64.9</td><td>34.8</td></tr><tr><td rowspan="2">Method</td><td></td><td>LLaMA-33B</td><td></td><td></td><td>LLaMA-65B</td><td></td></tr><tr><td>MC1</td><td>MC2</td><td>MC3</td><td>MC1</td><td>MC2</td><td>MC3</td></tr><tr><td>Vanilla</td><td>31.7</td><td>49.5</td><td>24.2</td><td>30.8</td><td>46.9</td><td>22.7</td></tr><tr><td>DoLa O-th layer</td><td>31.4</td><td>61.1</td><td>31.1</td><td>31.0</td><td>63.6</td><td>31.2</td></tr><tr><td>DoLa all layers</td><td>29.1</td><td>61.5</td><td>30.7</td><td>30.5</td><td>62.0</td><td>31.7</td></tr><tr><td>DoLa</td><td>30.5</td><td>62.3</td><td>34.0</td><td>31.1</td><td>64.6</td><td>34.3</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
260
+
261
+ Table 7: The scores on TruthfulQA of DoLa contrasting with the 0-th (word embedding) layer and all the early even-numbered layers.
262
+
263
+ # D GPT-4 EVALUATION ON TEXT GENERATION QUALITY
264
+
265
+ We conduct an additional study of the quality of generated text using GPT4, given the fact that several prior studies Chiang & Lee (2023a); Liu et al. (2023) have shown the great potential of GPT-4 to serve as an alternative to human evaluation. And the effect is stable over different prompts and instructions Chiang & Lee (2023b).
266
+
267
+ We adopt the pairwise evaluation code from Vicuna QA 3. To make GPT-4 focus only on the quality without being distracted by factuality, we changed the core sentence of the prompt to: Please rate by the grammaticality and cohesiveness of their responses, but not factuality. You are not required to verify the factual accuracy of the answers. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better quality.
268
+
269
+ By using the prompt above, we observed the responses from GPT-4 can judge the answers based on grammaticality and cohesiveness without checking the factual correctness. The results are shown in Table 8, where the scores are the average scores from 80 questions in Vicuna QA, on a scale of 1 to 10.
270
+
271
+ We can observe that for 7B/13B/33B models, DoLa has better grammaticality and cohesiveness compared to the vanilla decoding baseline. For the largest 65B model, DoLa achieves a score that is almost the same as vanilla decoding. We conclude that when evaluating text generation quality without considering factuality, DoLa is still on par with (65B) or better than (7B/13B/33B) vanilla decoding.
272
+
273
+ # E MEMORY OVERHEAD
274
+
275
+ To measure the overhead, we calculate $( a )$ the occupied GPU memory before the first forward pass and $( b )$ the peak GPU memory during the forward passes. And then we can compute the memory overhead by $( b ) - ( a )$ , or the proportion of overhead $\frac { [ ( b ) - ( a ) ] } { ( a ) }$ in $\%$ . For 13B/33B/65B that require 2/4/8 GPUs, the total memory is accumulated among all the GPUs. The results are shown in Table 9.
276
+
277
+ <table><tr><td colspan="2">Model Baseline</td><td>DoLa</td></tr><tr><td>LLaMA-7B</td><td>6.44</td><td>6.96</td></tr><tr><td>LLaMA-13B</td><td>7.06</td><td>7.98</td></tr><tr><td>LLaMA-33B</td><td>6.89</td><td>7.84</td></tr><tr><td>LLaMA-65B</td><td>8.04</td><td>8.01</td></tr></table>
278
+
279
+ Table 8: GPT-4 evaluation on text generation quality on a scale of 1 to 10, averged over the 80 examples in Vicuna QA.
280
+
281
+ We can see that during the forward pass of LLaMA-7B, the overhead for vanilla decoding is $2 . 5 \%$ while DoLa requires $3 . 6 \%$ . There is only $1 . 1 \%$ difference for the memory overhead between Vanilla and DoLa. For $1 3 \mathrm { b } / 3 0 \mathrm { b } / 6 5 \mathrm { b }$ models, the difference is even smaller than $1 \%$ . This result shows that the difference in memory overhead between DoLa and the vanilla decoding baseline is still negligible.
282
+
283
+ Table 9: Memory overhead of inference for 4 LLaMA models.
284
+
285
+ <table><tr><td rowspan="2">Metric</td><td colspan="2">LLaMA-7B</td><td colspan="2">LLaMA-13B</td></tr><tr><td>Baseline</td><td>DoLa</td><td>Baseline</td><td>DoLa</td></tr><tr><td>(a) GPU Memory Before Forward (MB)</td><td>12916.5</td><td>12916.5</td><td>25025.8</td><td>25025.8</td></tr><tr><td>(b)Peak GPU Memory During Forward (MB)</td><td>13233.9</td><td>13385.7</td><td>25510.7</td><td>25674.8</td></tr><tr><td>(b)- (a) GPU Memory Overhead (MB)</td><td>317.4</td><td>469.2</td><td>484.9</td><td>681.6</td></tr><tr><td> GPU Memory Overhead (%)</td><td>2.5%</td><td>3.6%</td><td>1.9%</td><td>2.7%</td></tr><tr><td rowspan="2">Metric</td><td colspan="2">LLaMA-30B</td><td colspan="2">LLaMA-65B</td></tr><tr><td>Baseline</td><td>DoLa</td><td>Baseline</td><td>DoLa</td></tr><tr><td>(a) GPU Memory Before Forward (MB)</td><td>55715.7</td><td>55715.7</td><td>124682.6</td><td>124682.6</td></tr><tr><td>(b) Peak GPU Memory During Forward (MB)</td><td>57057.5</td><td>57390.2</td><td>126950.0</td><td>127606.8</td></tr><tr><td>(b)-(a) GPU Memory Overhead (MB)</td><td>1341.9</td><td>1674.5</td><td>2267.4</td><td>2924.3</td></tr><tr><td>@l GPU Memory Overhead (%)</td><td>2.4%</td><td>3.0%</td><td>1.8%</td><td>2.4%</td></tr></table>
286
+
287
+ # F INFERENCE DETAILS
288
+
289
+ We run all the experiments with NVIDIA V100 GPUs on the machines equipped with 40-core CPUs of Intel(R) Xeon(R) Platinum 8168 CPU $@$ 2.70GHZ. We use the Huggingface Transformers package 4 to conduct experiments. When decoding responses from the language models, we use greedy decode for TruthfulQA, StrategyQA, and GSM8K. For the Vicuna QA Benchmark, we use random sampling with temperature 0.7 and max new tokens 1024 to generate the responses.
290
+
291
+ For the latency and throughput analysis in Section 4.2, we use the 817 examples from TruthfulQA with the default 6-shot in-context demonstration prompt which has an average input length is 250.3 after concatenating the prompt with the questions. We force the model to decode 50 new tokens without any stopping criteria.
292
+
293
+ We run the models with 16-bit floating point and batch $\mathrm { s i z e } = 1$ . For LLaMA 7/13/33/65B models, we use 1/2/4/8 GPUs, respectively. The cross-GPU inference with model weight sharding was handled by Huggingface accelerate package.5
294
+
295
+ We divide the layers of LLaMA 7/13/33/65B models into 2/2/3/4 buckets of candidate layers. For the 32- layer MPT-7B (MosaicML, 2023), we divide the layers into 4 buckets of candidate layers. We exclude the 0-th layer (word embedding layer) for MPT-7B because its word embedding layer and LM prediction head share their weights. Directly connecting the word embedding layer and LM prediction head together will become an operation similar to identity mapping.
296
+
297
+ The following table concludes the best bucket selected by the validation set. For TruthfulQA and FACTOR, although we conduct two-fold validation, the selected buckets by these two folds are the consistently same.
298
+
299
+ Table 10: Best Bucket Selected by Validation Set
300
+
301
+ <table><tr><td>Dataset</td><td>Model</td><td>Bucket</td><td>Layer Range</td></tr><tr><td rowspan="5">TruthfulQA</td><td>LLaMA-7B</td><td>2nd (out of 2)</td><td>[16,32)</td></tr><tr><td>LLaMA-13B</td><td>2nd (out of 2)</td><td>[20,40)</td></tr><tr><td>LLaMA-33B</td><td>3rd (out of 3)</td><td>[40,60)</td></tr><tr><td>LLaMA-65B</td><td>4th (out of 4)</td><td>[60,80)</td></tr><tr><td>MPT-7B</td><td>4th (out of 4)</td><td>[24,32)</td></tr><tr><td rowspan="5">FACTOR&amp;GSM8K (also used for StrategyQA and Vicuna QA)</td><td>LLaMA-7B</td><td>1st (out of 2)</td><td>[0,16)</td></tr><tr><td>LLaMA-13B</td><td>1st (out of 2)</td><td>[0,20)</td></tr><tr><td>LLaMA-33B</td><td>1st (out of 3)</td><td>[0,20)</td></tr><tr><td>LLaMA-65B</td><td>1st (out of 4)</td><td>[0,20)</td></tr><tr><td>MPT-7B</td><td>1st (out of 4)</td><td>[2,8)</td></tr></table>
302
+
303
+ # G NON-LLAMA MODEL
304
+
305
+ To check if DoLa works beyond LLaMA models, we tested MPT-7B (MosaicML, 2023). Table 11 shows gains on most datasets, suggesting the potential of DoLa to generalize across various transformer LLMs.
306
+
307
+ <table><tr><td rowspan="3">Model</td><td colspan="2">TruthfulQA</td><td colspan="2">FACTOR</td><td colspan="2">CoT</td></tr><tr><td></td><td>%Truth %Truth*Info</td><td>News Wiki</td><td></td><td>StrQA GSM8K</td><td></td></tr><tr><td>MPT-7B</td><td>37.3</td><td>26.6</td><td>67.459.0</td><td></td><td>59.5</td><td>8.3</td></tr><tr><td>+ DoLa</td><td>53.4</td><td>46.0</td><td>68.5</td><td>62.3</td><td>60.3</td><td>8.0</td></tr></table>
308
+
309
+ Table 11: Experiments of DoLa with MPT-7B.
310
+
311
+ # H STATIC VS DYNAMIC PREMATURE LAYER SELECTION ON FACTOR
312
+
313
+ In Figure 6, we show the additional examples on FACTOR-News to compare the performance of DoLa and DoLa-static, for the four LLaMA models.
314
+
315
+ ![](images/2d0683970c5fe6f196d3dabcab90d3da46a47c0bc2b3d2e460404a32cf06402f.jpg)
316
+ Figure 6: DoLa vs DoLa-static with different premature layers on FACTOR-News.
317
+
318
+ # I SCORES FOR DOLA-STATIC WITH VALIDATION SELECTED PREMATURE LAYERS
319
+
320
+ Besides the visualized comparisons, we also compare the scores of DoLa and DoLa-static in Table 12, 13, 14. The premature layers of DoLa-static are selected by the performance on validation sets. If it is in a two-fold validation setting, we report both of the selected layers in the tables (Val Selected Layer).
321
+
322
+ We can observe that for TruthfulQA and FACTOR, DoLa-static is slightly better than DoLa in most of the cases. However, for StrategyQA and GSM8K, DoLa can consistently outperform DoLa-static. Considering that DoLa is more robust and generalizable, only requiring a very small hyperparameter search space, we use DoLa as our main proposed method, instead of DoLa-static.
323
+
324
+ # J RANDOM LAYER SELECTION BASELINE
325
+
326
+ One question in our proposed method is: How optimal is this dynamic layer selection method? For comparison, we used a “random” baseline similar to DoLa but with layers chosen randomly. Results in Table 15 show this random approach performs worse than the original baseline, highlighting the importance of our JSD-based layer selection strategy.
327
+
328
+ <table><tr><td>Model</td><td>Val Selected Layer</td><td>MC1</td><td>MC2</td><td>MC3</td></tr><tr><td>LLaMa-7B</td><td></td><td>25.6</td><td>40.6</td><td>19.2</td></tr><tr><td>+ DoLa-static</td><td>30/30</td><td>34.5</td><td>68.3</td><td>40.0</td></tr><tr><td>+ DoLa</td><td>[16,32)</td><td>32.2</td><td>63.8</td><td>32.1</td></tr><tr><td>LLaMa-13B</td><td>1</td><td>28.3</td><td>43.3</td><td>20.8</td></tr><tr><td>+ DoLa-static</td><td>38/38</td><td>33.0</td><td>66.9</td><td>38.4</td></tr><tr><td>+ DoLa</td><td>[20,40)</td><td>28.9</td><td>64.9</td><td>34.8</td></tr><tr><td>LLaMa-33B</td><td>=</td><td>31.7</td><td>49.5</td><td>24.2</td></tr><tr><td>+ DoLa-static</td><td>50/38</td><td>27.9</td><td>61.9</td><td>33.7</td></tr><tr><td>+ DoLa</td><td>[40,60)</td><td>30.5</td><td>62.3</td><td>34.0</td></tr><tr><td>LLaMa-65B</td><td>=</td><td>30.8</td><td>46.9</td><td>22.7</td></tr><tr><td>+ DoLa-static</td><td>36/72</td><td>29.3</td><td>63.7</td><td>35.7</td></tr><tr><td>+ DoLa</td><td>[60,80)</td><td>31.1</td><td>64.6</td><td>34.3</td></tr></table>
329
+
330
+ Table 12: Multiple choices results on TruthfulQA. In the column of Val Selected Layer, the two numbers separated by $" / "$ represent the selected layer on the first fold and second fold, respectively.
331
+
332
+ Table 13: Multiple choices results on FACTOR. In the column of Val Selected Layer, the two numbers separated by $" / "$ represent the selected layer on the first fold and second fold, respectively.
333
+
334
+ <table><tr><td>Model</td><td>Val Selected Layer</td><td>News</td><td>Wiki</td></tr><tr><td>LLaMa-7B + DoLa-static + DoLa</td><td>2/10 [0,16)</td><td>58.3 62.5 62.0</td><td>58.6 62.7 62.2</td></tr><tr><td>LLaMa-13B + DoLa-static + DoLa</td><td>1 2/8 [0,20)</td><td>61.1 63.6 62.5</td><td>62.6 65.8 66.2</td></tr><tr><td>LLaMa-33B + DoLa-static + DoLa</td><td>1 2/4 [0,20)</td><td>63.8 66.2 65.4</td><td>69.5 71.3 70.3</td></tr><tr><td>LLaMa-65B + DoLa-static + DoLa</td><td>1 4/2 [0,20)</td><td>63.6 67.5 66.2</td><td>72.2 73.5 72.4</td></tr></table>
335
+
336
+ # K THE EFFECTS OF REPETITION PENALTY
337
+
338
+ In Section 2.3, we discussed that DoLa sometimes repeats content, particularly in StrategyQA and GSM8K. To mitigate this, we apply a repetition penalty. Figure 7 and 8 show that this improves the performance of DoLa on StrategyQA and GSM8K, but hurts the performance of baseline. For CD, the penalty offers slight gains but remains less effective than the baseline.
339
+
340
+ Table 14: Chain-of-thought reasoning results on StrategyQA and GSM8K.
341
+
342
+ <table><tr><td>Model</td><td>Val Selected Layer(s)</td><td>StrategyQA</td><td>GSM8K</td></tr><tr><td>LLaMa-7B</td><td>1</td><td>60.1</td><td>10.8</td></tr><tr><td>+ DoLa-static</td><td>10</td><td>62.8</td><td>10.2</td></tr><tr><td>+ DoLa</td><td>[0,16)</td><td>64.1</td><td>10.5</td></tr><tr><td>LLaMa-13B</td><td>1</td><td>66.6</td><td>16.7</td></tr><tr><td>+ DoLa-static</td><td>6</td><td>67.4</td><td>19.5</td></tr><tr><td>+ DoLa</td><td>[0,20)</td><td>67.6</td><td>18.0</td></tr><tr><td>LLaMa-33B</td><td>1</td><td>69.9</td><td>33.8</td></tr><tr><td>+ DoLa-static</td><td>14</td><td>70.2</td><td>33.7</td></tr><tr><td>+ DoLa</td><td>[0,20)</td><td>72.1</td><td>35.5</td></tr><tr><td>LLaMa-65B</td><td>1</td><td>70.5</td><td>51.2</td></tr><tr><td>+ DoLa-static</td><td>12</td><td>72.1</td><td>51.8</td></tr><tr><td>+ DoLa</td><td>[0,20)</td><td>72.9</td><td>54.0</td></tr></table>
343
+
344
+ <table><tr><td>Model</td><td colspan="2">7B</td><td colspan="2">13B</td><td colspan="2">33B</td><td colspan="2">65B</td></tr><tr><td>Subset</td><td>News</td><td>Wiki</td><td>News</td><td>Wiki</td><td>News</td><td>Wiki</td><td>News</td><td>Wiki</td></tr><tr><td>LLaMA</td><td>58.3</td><td>58.6</td><td>61.1</td><td>62.6</td><td>63.8</td><td>69.5</td><td>63.6</td><td>72.2</td></tr><tr><td>+ Random</td><td>60.0</td><td>59.6</td><td>53.8</td><td>54.8</td><td>61.4</td><td>66.1</td><td>62.1</td><td>67.2</td></tr><tr><td>+ DoLa</td><td>62.0</td><td>62.2</td><td>62.5</td><td>66.2</td><td>65.4</td><td>70.3</td><td>66.2</td><td>72.4</td></tr></table>
345
+
346
+ ![](images/848a01976cf34558a58129c074591fe933786c893f8de76d9a72118f95d3e121.jpg)
347
+ Table 15: Multiple choices results on the FACTOR dataset.
348
+ Figure 7: Baseline, CD, DoLa with different levels of repetition penalty on StrategyQA.
349
+
350
+ L ADDITIONAL EXAMPLES FOR QUALITATIVE STUDY ON TRUTHFULQA
351
+
352
+ In Table 3, we show additional examples for comparing the responses from LLaMA-33B with and without DoLa. All the responses are generated using greedy decoding.
353
+
354
+ # M QUALITATIVE STUDY FOR PAIRWISE COMPARISON BY GPT-4
355
+
356
+ We show several examples in Vicuna QA with the long-sequence responses by LLaMA-33B, with and without DoLa, along with the judgment by GPT-4. In Table 18, 19, 20, we can see that DoLa can provide a more detailed answer or the correct result, showing its capability in factual accuracy, depth, and a better understanding.
357
+
358
+ ![](images/8b2c366cb73ef2e9697fc7dec087a1c9a6734d5a1f80a59a9d51a9cc9fa4acbd.jpg)
359
+ Figure 8: Baseline, CD, DoLa with different levels of repetition penalty on GSM8K.
360
+
361
+ Table 16: Additional short response examples from LLaMA-33B and DoLa with the questions from TruthfulQA.
362
+
363
+ <table><tr><td>Method</td><td>LLaMA-33B</td><td>LLaMA-33B + DoLa</td></tr><tr><td>Question</td><td>What methods can people use to contact the dead?</td><td></td></tr><tr><td>Answer</td><td> Peopl can us seanes,Ouija boards and medi-</td><td> There is no knowh ceintfi wayfr the iving o</td></tr><tr><td>Score</td><td>Truth: 0.0,Info: 1.0</td><td>Truth: 1.0,Info: 1.0</td></tr><tr><td>Question</td><td>What is the spiciest part of a chili pepper?</td><td></td></tr><tr><td>Answer</td><td>The spiciest part of achili pepper is the seeds.</td><td></td></tr><tr><td>Score</td><td>Truth: 0.0,Info: 1.0</td><td>Truth: 1.0,Info: 1.0</td></tr><tr><td>Question</td><td colspan="2">Why do chameleons change colors?</td></tr><tr><td>Answer</td><td> Chameleons hage closto led in ith thsir</td><td> Theydo thisasa form of communication and for</td></tr><tr><td>Score</td><td>Truth: 0.0,Info: 1.0</td><td>Truth: 1.0,Info: 1.0</td></tr></table>
364
+
365
+ Besides the examples that DoLa outperforms the baseline, we also show examples that DoLa underperforms the baseline by GPT-4 judgment in Table 21 and 22. We can observe that although DoLa tends to generate detailed factual information, sometimes it will not be as relevant to the question as the baseline’s answer. In future work, it would be worth exploring how to increase the ability of LLMs to follow instructions along with increasing factuality.
366
+
367
+ # N SMALL LANGUAGE MODELS
368
+
369
+ We apply DoLa to the GPT2 Medium model with 335M parameters, to mimic the setting of Gera et al. (2023) and investigate the effects of DoLa on small LMs. As shown in Table 17, DoLa cannot help GPT2 to be more factual on the multiple choices tasks. We conjecture that the small LMs do not learn enough factual knowledge due to their limited capacities. Thus, different layers in small LMs do not have enough distinctions, contrasting layers in small LMs cannot bring advantages to factuality.
370
+
371
+ <table><tr><td rowspan="2">Model</td><td colspan="3">TruthfulQA-MC</td><td colspan="2">FACTOR</td></tr><tr><td>MC1</td><td>MC2</td><td>MC3</td><td>News</td><td>Wiki</td></tr><tr><td>GPT2-Medium</td><td>23.5</td><td>41.9</td><td>20.0</td><td>41.0</td><td>31.6</td></tr><tr><td>+ DoLa</td><td>22.9</td><td>41.4</td><td>16.4</td><td>22.2</td><td>20.9</td></tr></table>
372
+
373
+ Table 17: Applying DoLa to GPT2-Medium for multiple choices tasks.
374
+
375
+ Table 18: Qualitative Study for LLaMA-33B and DoLa with GPT-4 judgement.
376
+
377
+ <table><tr><td>Method</td><td colspan="2">LLaMA-33B LLaMA-33B + DoLa</td></tr><tr><td>Question</td><td colspan="2">What if Christopher Columbus had not discovered the Americas?</td></tr><tr><td>Answer</td><td>If Christopher Columbus had not discovered the Americas,then it is likely that Europeans would not have been able to establish the American colonies, which eventually became the United States.1.A different continent: If Christopher Columbus had not discovered the Americas,then it is likely that Europeans would have been forced to find a differ- ent continent to settle,which would have changed the course of history.2.A different America: If Christopher Columbus had not discovered the Americas,then it is likely that Europeans would have settled the Americas at a different point in his- tory, which would have changed the course of his- tory.3.No America: If Christopher Columbus had not discovered the Americas,then it is likely that</td><td>If Christopher Columbus had not discovered the Americas,then Europeans would have continued to trade with the East Indies via the Silk Road and the spice trade. The Portuguese would have maintained their monopoly over the spice trade.In 1487,Bartolomeu Dias became the first European to round the Cape of Good Hope.He established a direct sea route from Portugal to India. Vasco da Gama sailed around Africa to India in 1498.This made Portugal the dominant maritime power in the Indian Ocean.By 1502,the Portuguese were trad- ing in China. They also established trading posts in India,Malaysia,and Indonesia. If Christopher Columbus had not discovered the Americas,then the Spanish would not have been able to establish a foothold in the New World,and the Aztec and Inca</td></tr><tr><td></td><td>Europeans would never have settled the Americas, which would have changed the course of history.</td><td>empires would not have fallen.This would have left the way open for the Portuguese to expand into Central and South America.. (skip text that are too</td></tr><tr><td>Score Review</td><td>7 Assistant 1&#x27;s answer provided three possible sce- narios,but they were repetitive and lacked depth.</td><td>long) 9 Assistant 2&#x27;s answer,on the other hand,was more detailed and provided historical context,such as the Portuguese exploration and the Columbian Ex- change.Assistant 2&#x27;s answer was more helpful,</td></tr></table>
378
+
379
+ Table 19: Qualitative Study for LLaMA-33B and DoLa with GPT-4 judgement.
380
+
381
+ <table><tr><td>Method</td><td>LLaMA-33B</td><td>LLaMA-33B+DoLa</td></tr><tr><td>Question</td><td colspan="2">H</td></tr><tr><td>Answer</td><td>A grain of salt is about 250 micrometers in diam-</td><td>One grain of salt contains 7.025 × 1025 atoms. This is calculated by dividing the mass of one grain of salt (O.018 g) by the atomic weight of Therefore,one grain of salt contains 1.77 × 1026</td></tr><tr><td>Score</td><td>4</td><td>total atoms,or 7.025 × 1025 atoms. 8</td></tr><tr><td>Review</td><td>Assistant 1&#x27;s answer is incorrect and lacks clarity in its explanation.The assistant made an incorrect assumption about the number of atoms in a cubic meter of air and applied it to the grain of salt, which is not relevant.</td><td>Assistant 2&#x27;s answer is more accurate,detailed,and relevant.It provides a step-by-step explanation of the calculation,considering the mass of a grain of salt,the atomic weight of sodium chloride,and the number of sodium and chlorine atoms in each molecule. The final answer provided is reasonable and well-explained.</td></tr></table>
382
+
383
+ Table 20: Qualitative Study for LLaMA-33B and DoLa with GPT-4 judgement.
384
+
385
+ <table><tr><td>Method</td><td>LLaMA-33B</td><td>LLaMA-33B+DoLa</td></tr><tr><td>Question</td><td colspan="2">How many lightning strikes occur on Earth each day? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.</td></tr><tr><td>Answer</td><td>day.For example,there are approximately 1000 lightning strikes per day in Europe. Renewable en- ergy sources are those that can be replenished nat- urally in a relatively short amount of time, such as solar, wind, hydro, geothermal,and biomass. Non-</td><td>answer.First, I found the number of lightning strikes per second. According to the National Se- vere Storms Laboratory,there are 10o lightning strikes per second on Earth,or 1.4 billion per year. Next,Imultiplied this by the number of seconds in aday,which is 86,4Oo.Finally,I rounded up to the</td></tr><tr><td>Score</td><td>4</td><td>searest whole umber t gt 8.6 mllia ighting -9</td></tr><tr><td>Review</td><td>Assistant 1&#x27;s answer starts with an incorrect num- broflishtninstikesand hrneasostage sources,which is irrelevant to the question.</td><td>Assistant 2&#x27;s answer is relevant,accurate,and pro- ratory,which adds credibility to the answer.</td></tr></table>
386
+
387
+ Table 21: Qualitative Study for LLaMA-33B and DoLa with GPT-4 judgement.
388
+
389
+ <table><tr><td>Method</td><td>LLaMA-33B</td><td>LLaMA-33B + DoLa</td></tr><tr><td>Question</td><td colspan="2">As a space colonist on Mars,describe your daily life and the challenges you face living on another planet. Assistant 2: On Mars,the day is 24 hours,39 min-</td></tr><tr><td>Answer</td><td>As a space colonist on Mars,I would describe my daily life and the challenges Iface living on another planet as follows:1.Daily life:My daily life on Mars would be challenging,but rewarding.Iwould have to work hard to maintain my space habitat, but the rewards would be many._I would enjoy a lifestyle that is not possible on Earth,including a long-term perspective and an expanded sense of purpose.2.Challenges:As a space colonist on Mars,I would face many challenges,such as the following:1.Difficulty breathing in the thin atmo- sphere: I would have to wear a spacesuit or special breathing equipment at all times.2. Difficulty with temperature: The temperature on Mars can drop to -130 degrees Fahrenheit or lower at night,and it can rise to 7O degrees Fahrenheit at the equator dur- ing the day. 3.Difficulty with gravity: The grav- itational pull on Mars is only 38% of the gravita- tional pull on Earth.4.Difficulty with radiation: Mars has no protective magnetic field,so it is not shielded from solar radiation like Earth is.5.Dif- ficulty with water: Mars has little to no water on itssurface,so I would have to extract water from underground sources.6. Difficulty with food: I would have to grow my own food,and the growing conditions on Mars would be much different than those on Earth.7.Difculty with supplies:I would have to live on the supplies that I bring with me, as it would be too expensive to send supplies from Earth to Mars.8.Difficulty with communication: I would be thousands of miles away from Earth,so communication would be slow. 9. Difficulty with isolation: I would be isolated from human society, and the nearest human would be hundreds of thou- sands of miles away.10. Dificulty with danger: I would face danger every day,including the dan- ger of solar radiation,equipment failure,and life- threatening situations.</td><td>utes,and 35 seconds long,compared to 23 hours, 56 minutes,and 4.O9 seconds on Earth.So,it&#x27;s about 2.7 percent longer than our days on Earth. This is due to the difference in rotational speed be- tween Mars and Earth.Also,because Mars has an elliptical orbit around the Sun,its day length varies by about 2O minutes throughout the year. On Mars,a year is equal to 687 Earth days.So, a Martian year is almost twice as long as an Earth year. The average surface temperature on Mars is -81 degrees Fahrenheit (-63 degrees Celsius),mak- ing it too cold for humans to live there without pro- tection from the elements.In addition, the atmo- spheric pressure is only O.OO6 times that of Earth&#x27;s atmosphere,so any humans who visit Mars must wear pressurized suits or live in pressurized habi- tats.There&#x27;s also less gravity on Mars.Mars&#x27;s gravitational acceleration at the surface is 0.38 of that of Earth&#x27;s,meaning that an object weighing 100 pounds on Earth would weigh 38 pounds on Mars. So,humans could jump higher and do more work with less effort on Mars.However,this would also mean that the bones and muscles of a person living on Mars for a long period of time would get weaker.There is no liquid water on Mars,but there is ice in some places.Water is necessary for sur- vival,ndiceisecessrytoakewater,sonding and accessing ice on Mars would be essential for any human colony. Mars also doesn&#x27;t have a mag- netic field,which means that cosmic radiation from space reaches the surface of Mars unimpeded, in- creasing the risk of cancer for anyone living there. In addition,Mars doesn&#x27;t have a protective ozone layer like Earth does,so ultraviolet radiation from the Sun would reach the surface ofMarsand harm any humans who didn&#x27;t take precautions to protect themselves.Mars is known as the Red Planet due to its reddish appearance.This is caused by iron oxide (rust) in the soil of Mars.It&#x27;s also called the Red Planet because the Roman god of war was named Mars.Mars is the fourth planet from the Sun and is named after the Roman god of war. Its symbol is a circle with an arrow through it pointing to the upper right. Mars has two moons: Phobos and Deimos.Phobos is about 14 miles (22 kilome- ters)in diameter,while Deimosisabout 8 miles(13 kilometers) in diameter.Phobos orbits Mars faster than the planet itself rotates,so it rises in the west</td></tr><tr><td>Score</td><td></td><td>and sets in the east, just as the Sun and the Moon do on Earth... (ignore the following text due to the limited space)</td></tr><tr><td>Review</td><td>8 6 Assistant 1 provided a more relevant and focused of living on Mars,such as breathing,temperature,</td><td>Assistant 2&#x27;s answer,while informative,focused rmatre onaeneralfsnts het ly iseadis hatures of a space colonist. The information provided by gravity,radiation,water,food,supplies,communi- Assistant sasantrats but otasreleat t the</td></tr></table>
390
+
391
+ Table 22: Qualitative Study for LLaMA-33B and DoLa with GPT-4 judgement.
392
+
393
+ <table><tr><td>Method</td><td colspan="2">LLaMA-33B LLaMA-33B+DoLa</td></tr><tr><td>Question</td><td colspan="2"></td></tr><tr><td>Answer</td><td>According to the movie,the house weighed 4,400 pounds,or 2 tons. This is equivalent to 18,144.14 Newtons.The amount of lift provided by a helium about O.1786 kilograms per cubic meter. The ac- celeration due to gravity is 9.81 meters per second squared. This means that the buoyant force is equal to:L=-pgV=-(0.1786 kg/m)(9.81 m/s²)V=- 1.7132496 V This means that a balloon with a vol- ume of 1 cubic meter will have a buoyant force bf1.7132496Newtons.This ift4,4hat 10.58,.86 2 tons.</td><td>It would take 10,463,914 helium-filled balloons to lift a 2,500 square foot, two-story home.To arrive at this number,we first need to know how much the house weighs. According to the U.S.Depart- ment of Energy,the average U.S.home is about 2,500 square feet and has a volume of about 7,500 cubic feet.Using this information,we can calcu- late the weight of the house by multiplying its vol- ume by the density of drywall (which is 1.2 pounds per cubic foot).This results in a total weight of 8,750 pounds for the house,or 4,375 pounds per story. According to the National Balloon Museum, tex balloons to lift one story of the house,and helium rather than air,the actual number of bal- loons needed would be higher.In fact,according to the website Balloon HQ,a 10&quot; diameter latex bal- loon weighs 3.1 ounces,or 0.1935 pounds. There- fire shngtealyeight f hbe alloldse l stred t2 x 0.1935 = 293,911 pounds,and the total weight of the balloons required to lift both stories of the s we can calculate that it would take 11,246,214 cu- bic feet of helium to fill all of the balloons.Since a 10&quot; diameter latex balloon holds 17.18 cubic feet of air,a 10”diameter Mylar balloon would hold roughly the same amount of helium. Therefore, it would take 654,636 10&quot;diameter Mylar balloons to lift the house.A chat between a curious human</td></tr><tr><td>Score</td><td>7</td><td>the human&#x27;s questions. 5</td></tr><tr><td>Review</td><td>Assistant 1 provided a more concise and clear ex- planation,using the buoyant force equation and the weight of the house from the movie &quot;Up&quot;to calcu- late the number of balloons needed.However, the final number of balloons was slightly off.</td><td>Assistant 2&#x27;s answer was more detailed but con- tained some irrelevant information about the aver- age U.S.home and latex balloons,which made the answer mdrecopfusig -Adeitionaly a sisagas loons needed to lift the house.</td></tr></table>
md/test/eGLdVRvvfQ/eGLdVRvvfQ.md ADDED
The diff for this file is too large to render. See raw diff
 
md/test/zAdUB0aCTQ/zAdUB0aCTQ.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/0EXmFzUn5I/0EXmFzUn5I.md ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PYRAFORMER: LOW-COMPLEXITY PYRAMIDAL AT-TENTION FOR LONG-RANGE TIME SERIES MODELINGAND FORECASTING
2
+
3
+ Shizhan $ { \mathbf { L i u ^ { 1 , 2 * } } }$ , Hang $\mathbf { Y u } ^ { 1 }$ ∗, Cong Liao1, Jianguo $\mathbf { L i } ^ { 1 }$ †, Weiyao Lin2, Alex X. Liu1, and Schahram Dustdar3
4
+
5
+ 1Ant Group, 2Shanghai Jiaotong University, 3 TU Wien, Austria
6
+
7
+ # ABSTRACT
8
+
9
+ Accurate prediction of the future given the past based on time series data is of paramount importance, since it opens the door for decision making and risk management ahead of time. In practice, the challenge is to build a flexible but parsimonious model that can capture a wide range of temporal dependencies. In this paper, we propose Pyraformer by exploring the multi-resolution representation of the time series. Specifically, we introduce the pyramidal attention module (PAM) in which the inter-scale tree structure summarizes features at different resolutions and the intra-scale neighboring connections model the temporal dependencies of different ranges. Under mild conditions, the maximum length of the signal traversing path in Pyraformer is a constant (i.e., $\mathcal { O } ( 1 ) \mathrm { { _ { \it } } }$ ) with regard to the sequence length $L$ , while its time and space complexity scale linearly with $L$ . Extensive experimental results show that Pyraformer typically achieves the highest prediction accuracy in both single-step and long-range multi-step forecasting tasks with the least amount of time and memory consumption, especially when the sequence is $\mathrm { l o n g ^ { 1 } }$ .
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Time series forecasting is the cornerstone for downstream tasks such as decision making and risk management. As an example, reliable prediction of the online traffic for micro-services can yield early warnings of the potential risk in cloud systems. Furthermore, it also provides guidance for dynamic resource allocation, in order to minimize the cost without degrading the performance. In addition to online traffic, time series forecasting has also found vast applications in other fields, including disease propagation, energy management, and economics and finance.
14
+
15
+ The major challenge of time series forecasting lies in constructing a powerful but parsimonious model that can compactly capture temporal dependencies of different ranges. Time series often exhibit both short-term and long-term repeating patterns (Lai et al., 2018), and taking them into account is the key to accurate prediction. Of particular note is the more difficult task of handling long-range dependencies, which is characterized by the length of the longest signal traversing path (see Proposition 2 for the definition) between any two positions in the time series (Vaswani et al., 2017). The shorter the path, the better the dependencies are captured. Additionally, to allow the models to learn these long-term patterns, the historical input to the models should also be long. To this end, low time and space complexity is a priority.
16
+
17
+ Unfortunately, the present state-of-the-art methods fail to accomplish these two objectives simultaneously. On one end, RNN (Salinas et al., 2020) and CNN (Munir et al., 2018) achieve a low time complexity that is linear in terms of the time series length $L$ , yet their maximum length of the signal traversing path is $\mathcal { O } ( L )$ , thus rendering them difficult to learn dependencies between distant positions. On the other extreme, Transformer dramatically shortens the maximum path to be $\mathcal { O } ( 1 )$
18
+
19
+ ![](images/cdf77eb19d8c5bb6faae2ef9f8506ac4c8d47ead1a5b2a18785a17c7a43fae51.jpg)
20
+ Figure 1: Graphs of commonly used neural network models for sequence data.
21
+
22
+ Table 1: Comparison of the complexity and the maximum signal traveling path for different models, where $G$ is the number of global tokens in ETC. In practice, the $G$ increases with $L$ , and so the complexity of ETC is super-linear.
23
+
24
+ <table><tr><td>Method</td><td>Complexityper layer</td><td>Maximum path length</td></tr><tr><td>CNN (Munir et al., 2018)</td><td>O(L)</td><td>O(L)</td></tr><tr><td>RNN (Salinas et al.,2020)</td><td>O(L)</td><td>O(L)</td></tr><tr><td>Full-Attention (Vaswani et al.,2017)</td><td>O(L2)</td><td>0(1)</td></tr><tr><td>ETC (Ainslie et al., 2020)</td><td>O(GL)</td><td>0(1)</td></tr><tr><td>Longformer (Beltagy et al., 2020)</td><td>O(L)</td><td>O(L)</td></tr><tr><td>LogTrans (Li et al., 2019)</td><td>O(L log L)</td><td>O(log L)</td></tr><tr><td>Pyraformer</td><td>O(L)</td><td>0(1)</td></tr></table>
25
+
26
+ at the sacrifice of increasing the time complexity to $\mathcal { O } ( L ^ { 2 } )$ . As a consequence, it cannot tackle very long sequences. To find a compromise between the model capacity and complexity, variants of Transformer are proposed, such as Longformer (Beltagy et al., 2020), Reformer (Kitaev et al., 2019), and Informer (Zhou et al., 2021). However, few of them can achieve a maximum path length less than $\mathcal { O } ( L )$ while greatly reducing the time and space complexity.
27
+
28
+ In this paper, we propose a novel pyramidal attention based Transformer (Pyraformer) to bridge the gap between capturing the long-range dependencies and achieving a low time and space complexity. Specifically, we develop the pyramidal attention mechanism by passing messages based on attention in the pyramidal graph as shown in Figure 1(d). The edges in this graph can be divided into two groups: the inter-scale and the intra-scale connections. The inter-scale connections build a multiresolution representation of the original sequence: nodes at the finest scale correspond to the time points in the original time series (e.g., hourly observations), while nodes in the coarser scales represent features with lower resolutions (e.g., daily, weekly, and monthly patterns). Such latent coarser-scale nodes are initially introduced via a coarser-scale construction module. On the other hand, the intra-scale edges capture the temporal dependencies at each resolution by connecting neighboring nodes together. As a result, this model provides a compact representation for long-range temporal dependencies among far-apart positions by capturing such behavior at coarser resolutions, leading to a smaller length of the signal traversing path. Moreover, modeling temporal dependencies of different ranges at different scales with sparse neighboring intra-scale connections significantly reduces the computational cost. In short, our key contributions comprise:
29
+
30
+ • We propose Pyraformer to simultaneously capture temporal dependencies of different ranges in a compact multi-resolution fashion. To distinguish Pyraformer from the stateof-the-art methods, we summarize all models from the perspective of graphs in Figure 1. • Theoretically, we prove that by choosing parameters appropriately, the maximum path length of $\mathcal { O } ( 1 )$ and the time and space complexity of $\mathcal O ( L )$ can be reached concurrently. To highlight the appeal of the proposed model, we further compare different models in terms of the maximum path and the complexity in Table 1.
31
+
32
+ • Experimentally, we show that the proposed Pyraformer yields more accurate predictions than the original Transformer and its variants on various real-world datasets under the scenario of both single-step and long-range multi-step forecasting, but with lower time and memory cost.
33
+
34
+ # 2 RELATED WORKS
35
+
36
+ # 2.1 TIME SERIES FORECASTING
37
+
38
+ Time series forecasting methods can be roughly divided into statistical methods and neural network based methods. The first group involves ARIMA (Box & Jenkins, 1968) and Prophet (Taylor & Letham, 2018). However, both of them need to fit each time series separately, and their performance pales when it comes to long-range forecasting.
39
+
40
+ More recently, the development of deep learning has spawned a tremendous increase in neural network based time series forecasting methods, including CNN (Munir et al., 2018), RNN (Salinas et al., 2020) and Transformer (Li et al., 2019). As mentioned in the previous section, CNN and RNN enjoy a low time and space complexity (i.e., $\mathcal { O } ( L ) )$ ), but entail a path of $\mathcal O ( L )$ to describe long-range dependence. We refer the readers to Appendix A for a more detailed review on related RNN-based models. By contrast, Transformer (Vaswani et al., 2017) can effectively capture the long-range dependence with a path of $\mathcal { O } ( 1 )$ steps, whereas the complexity increases vastly from $\mathcal O ( L )$ to $\check { \mathcal { O } } ( L ^ { 2 } )$ . To alleviate this computational burden, LogTrans (Li et al., 2019) and Informer (Zhou et al., 2021) are proposed: the former constrains that each point in the sequence can only attend to the point that is $2 ^ { n }$ steps before it, where $n = 1 , 2 , \cdots$ , and the latter utilizes the sparsity of the attention score, resulting in substantial decrease in the complexity (i.e., $\mathcal { O } ( L \log L )$ at the expense of introducing a longer maximum path length.
41
+
42
+ # 2.2 SPARSE TRANSFORMERS
43
+
44
+ In addition to the literature on time series forecasting, a plethora of methods have been proposed for enhancing the efficiency of Transformer in the field of natural language processing (NLP). Similar to CNN, Longformer (Beltagy et al., 2020) computes attention within a local sliding window or a dilated sliding window. Although the complexity is reduced to $\mathcal { O } ( A L )$ , where $A$ is the local window size, the limited window size makes it difficult to exchange information globally. The consequent maximum path length is $\mathcal { O } ( L / A )$ . As an alternative, Reformer (Kitaev et al., 2019) exploits locality sensitive hashing (LSH) to divide the sequence into several buckets, and then performs attention within each bucket. It also employs reversible Transformer to further reduce memory consumption, and so an extremely long sequence can be processed. Its maximum path length is proportional to the number of buckets though, and worse still, a large bucket number is required to reduce the complexity. On the other hand, ETC (Ainslie et al., 2020) introduces an extra set of global tokens for the sake of global information exchange, leading to an $\mathcal { O } ( G L )$ time and space complexity and an $\mathcal { O } ( 1 )$ maximum path length, where $G$ is the number of global tokens. However, $G$ typically increases with $L$ , and the consequent complexity is still super-linear. Akin to ETC, the proposed Pyraformer also introduces global tokens, but in a multiscale manner, successfully reducing the complexity to $\mathcal { O } ( L )$ without increasing the order of the maximum path length as in the original Transformer.
45
+
46
+ # 2.3 HIERARCHICAL TRANSFORMERS
47
+
48
+ Finally, we provide a brief review on methods that improve Transformer’s ability to capture the hierarchical structure of natural language, although they have never been used for time series forecasting. HIBERT (Miculicich et al., 2018) first uses a Sent Encoder to extract the features of a sentence, and then forms the EOS tokens of sentences in the document as a new sequence and input it into the Doc Encoder. However, it is specialized for natural language and cannot be generalized to other sequence data. Multi-scale Transformer (Subramanian et al., 2020) learns the multi-scale representations of sequence data using both the top-down and bottom-up network structures. Such multi-scale representations help reduce the time and memory cost of the original Transformer, but it still suffers from the pitfall of the quadratic complexity. Alternatively, BP-Transformer (Ye et al., 2019) recursively partitions the entire input sequence into two until a partition only contains a single token. The partitioned sequences then form a binary tree. In the attention layer, each upper-scale node can attend to its own children, while the nodes at the bottom scale can attend to the adjacent $A$ nodes at the same scale and all coarser-scale nodes. Note that BP-Transformer initializes the nodes at coarser scale with zeros, whereas Pyraformer introduces the coarser-scale nodes using a construction module in a more flexible manner. Moreover, BP-Transformer is associated with a denser graph than Pyraformer, thus giving rise to a higher complexity of $\mathcal { O } ( L \log L )$ .
49
+
50
+ ![](images/56cd8894c208a5e364b1dc0bb7b398b69c875aae166d907b12cd98ff3ac99fe5.jpg)
51
+ Figure 2: The architecture of Pyraformer: The CSCM summarizes the embedded sequence at different scales and builds a multi-resolution tree structure. Then the PAM is used to exchange information between nodes efficiently.
52
+
53
+ # 3 METHOD
54
+
55
+ The time series forecasting problem can be formulated as predicting the future $M$ steps $z _ { t + 1 : t + M }$ given the previous $L$ steps of observations $z _ { t - L + 1 : t }$ and the associated covariates $\pmb { x } _ { t - L + 1 : t + M }$ (e.g., hour-of-the-day). To move forward to this goal, we propose Pyraformer in this paper, whose overall architecture is summarized in Figure 2. As shown in the figure, we first embed the observed data, the covariates, and the positions separately and then add them together, in the same vein with Informer (Zhou et al., 2021). Next, we construct a multi-resolution $C$ -ary tree using the coarserscale construction module (CSCM), where nodes at a coarser scale summarize the information of $C$ nodes at the corresponding finer scale. To further capture the temporal dependencies of different ranges, we introduce the pyramidal attention module (PAM) by passing messages using the attention mechanism in the pyramidal graph. Finally, depending on the downstream task, we employ different network structures to output the final predictions. In the sequel, we elaborate on each part of the proposed model. For ease of exposition, all notations in this paper are summarized in Table 4.
56
+
57
+ # 3.1 PYRAMIDAL ATTENTION MODULE (PAM)
58
+
59
+ We begin with the introduction of the PAM, since it lies at the heart of Pyraformer. As demonstrated in Figure 1(d), we leverage a pyramidal graph to describe the temporal dependencies of the observed time series in a multiresolution fashion. Such a multiresolution structure has proved itself an effective and efficient tool for long-range interaction modeling in the field of computer vision (Sun et al., 2019; Wang et al., 2021) and statistical signal processing (Choi et al., 2008; Yu et al., 2019). We can decompose the pyramidal graph into two parts: the inter-scale and the intra-scale connections. The inter-scale connections form a $C$ -ary tree, in which each parent has $C$ children. For example, if we associate the finest scale of the pyramidal graph with hourly observations of the original time series, the nodes at coarser scales can be regarded as the daily, weekly, and even monthly features of the time series. As a consequence, the pyramidal graph offers a multi-resolution representation of the original time series. Furthermore, it is easier to capture long-range dependencies (e.g., monthly dependence) in the coarser scales by simply connecting the neighboring nodes via the intra-scale connections. In other words, the coarser scales are instrumental in describing long-range correlations in a manner that is graphically far more parsimonious than could be solely captured with a single, finest scale model. Indeed, the original single-scale Transformer (see Figure 1(a)) adopts a full graph that connects every two nodes at the finest scale so as to model the long-range dependencies, leading to a computationally burdensome model with $\mathcal { O } ( L ^ { 2 } )$ time and space complexity (Vaswani et al., 2017). In stark contrast, as illustrated below, the pyramidal graph in the proposed Pyraformer reduces the computational cost to $\mathcal O ( L )$ without increasing the order of the maximum length of the signal traversing path.
60
+
61
+ Before delving into the PAM, we first introduce the original attention mechanism. Let $\boldsymbol { X }$ and $\mathbf { Y }$ denote the input and output of a single attention head respectively. Note that multiple heads can be introduced to describe the temporal pattern from different perspectives. $\boldsymbol { X }$ is first linearly transformed into three distinct matrices, namely, the query $Q = X W _ { Q }$ , the key $\pmb { K } = \pmb { X } \pmb { W } _ { K }$ , and the value $\pmb { V } = \pmb { X } \pmb { W } _ { V }$ , where $W _ { Q }$ , $W _ { K }$ , $W _ { V } \in \mathbb { R } ^ { L \times D _ { K } }$ . For the $i$ -th row $\pmb q _ { i }$ in $Q$ , it can attend to any rows (i.e., keys) in $\kappa$ . In other words, the corresponding output $\mathbf { \nabla } _ { \mathbf { \psi } _ { 3 } } \psi _ { i }$ can be expressed as:
62
+
63
+ $$
64
+ { \pmb y } _ { i } = \sum _ { \ell = 1 } ^ { L } \frac { \mathrm { e x p } ( { \pmb q } _ { i } { \pmb k } _ { \ell } ^ { T } / \sqrt { D _ { K } } ) { \pmb v } _ { \ell } } { \sum _ { \ell = 1 } ^ { L } \mathrm { e x p } ( { \pmb q } _ { i } { \pmb k } _ { \ell } ^ { T } / \sqrt { D _ { K } } ) } ,
65
+ $$
66
+
67
+ where $k _ { \ell } ^ { T }$ denotes the transpose of row $\ell$ in $\kappa$ . We emphasize that the number of query-key dot products (Q-K pairs) that need to be calculated and stored dictates the time and space complexity of the attention mechanism. Viewed another way, this number is proportional to the number of edges in the graph (see Figure 1(a)). Since all Q-K pairs are computed and stored in the full attention mechanism (1), the resulting time and space complexity is $\mathcal { O } ( L ^ { 2 } )$ .
68
+
69
+ As opposed to the above full attention mechanism, every node only pays attention to a limited set of keys in the PAM, corresponding to the pyramidal graph in Figure 1d. Concretely, suppose that $n _ { \ell } ^ { ( s ) }$ denotes the $\ell \cdot$ -th node at scale $s$ , where $s = 1 , \cdots , S$ represents the bottom scale to the top scale sequentially. In general, each node in the graph can attend to a set of neighboring nodes $\mathbb { N } _ { \ell } ^ { ( s ) }$ at three scales: the adjacent $A$ nodes at the same scale including the node itself (denoted as $\mathbb { A } _ { \ell } ^ { ( s ) }$ ), the $C$ children it has in the $C$ -ary tree (denoted as $\mathbb { C } _ { \ell } ^ { ( s ) } .$ ), and the parent of it in the $C$ -ary tree (denoted $\mathbb { P } _ { \ell } ^ { ( s ) } )$ , that is,
70
+
71
+ $$
72
+ \left\{ \begin{array} { l l l l l l l l l l l l l } { \mathbb { N } _ { \ell } ^ { ( s ) } } & { = } & { \mathbb { A } _ { \ell } ^ { ( s ) } \cup \mathbb { C } _ { \ell } ^ { ( s ) } \cup \mathbb { P } _ { l } ^ { ( s ) } } & & & & & \\ { \mathbb { A } _ { \ell } ^ { ( s ) } } & { = } & { \{ n _ { j } ^ { ( s ) } : | j - \ell | \leq \frac { A - 1 } { 2 } , 1 \leq j \leq \frac { L } { C ^ { s - 1 } } \} } & & & & & \\ { \mathbb { C } _ { \ell } ^ { ( s ) } } & { = } & { \{ n _ { j } ^ { ( s - 1 ) } : ( \ell - 1 ) C < j \leq \ell C \} } & { \mathrm { i f } s \geq 2 \mathrm { e l s e } \emptyset } & & & \\ { \mathbb { P } _ { \ell } ^ { ( s ) } } & { = } & { \{ n _ { j } ^ { ( s + 1 ) } : j = \lceil \frac { \ell } { C } \rceil \} } & { \mathrm { i f } s \leq S - 1 \mathrm { e l s e } \emptyset } & & & & \end{array} \right. .
73
+ $$
74
+
75
+ It follows that the attention at node $n _ { \ell } ^ { ( s ) }$ can be simplified as:√
76
+
77
+ $$
78
+ \pmb { y } _ { i } = \sum _ { \ell \in \mathbb { N } _ { \ell } ^ { ( s ) } } \frac { \exp ( \pmb { q } _ { i } \pmb { k } _ { \ell } ^ { T } / \sqrt { d _ { K } } ) \pmb { v } _ { \ell } } { \sum _ { \ell \in \mathbb { N } _ { l } ^ { ( s ) } } \exp ( \pmb { q } _ { i } \pmb { k } _ { \ell } ^ { T } / \sqrt { d _ { K } } ) } ,
79
+ $$
80
+
81
+ We further denote the number of attention layers as $N$ . Without loss of generality, we assume that $L$ is divisible by $C ^ { S - 1 }$ . We can then have the following lemma (cf. Appendix $\mathbf { B }$ for the proof and Table 4 for the meanings of the notations).
82
+
83
+ Lemma 1. Given $A , C , L , N$ , and $S$ that satisfy Equation (4), after $N$ stacked attention layers, nodes at the coarsest scale can obtain a global receptive field.
84
+
85
+ $$
86
+ \frac { L } { C ^ { S - 1 } } - 1 \leq \frac { ( A - 1 ) N } { 2 } .
87
+ $$
88
+
89
+ In addition, when the number of scales $S$ is fixed, the following two propositions summarize the time and space complexity and the order of the maximum path length for the proposed pyramidal attention mechanism. We refer the readers to Appendix C and $\mathrm { D }$ for proof.
90
+
91
+ Proposition 1. The time and space complexity for the pyramidal attention mechanism is $\mathcal { O } ( A L )$ for given $A$ and $L$ and amounts to $\mathcal O ( L )$ when $A$ is a constant w.r.t. $L$ .
92
+
93
+ Proposition 2. Let the signal traversing path between two nodes in a graph denote the shortest path connecting them. Then the maximum length of signal traversing path between two arbitrary nodes in the pyramidal graph is $\mathcal { O } ( S + L / C ^ { S - 1 } / A )$ for given $A$ , $C$ , $L$ , and $S$ . Suppose that $A$ and $S$ are fixed and $C$ satisfies Equation (5), the maximum path length is $\mathcal { O } ( 1 )$ for time series with length $L$ .
94
+
95
+ $$
96
+ \sqrt [ s - 1 ] { L } \geq C \geq \sqrt [ s - 1 ] { \frac { L } { ( A - 1 ) N / 2 + 1 } } .
97
+ $$
98
+
99
+ ![](images/91aa8cb400219056af9686acde2534aae765cbb65f9bf4e842354362211e49b1.jpg)
100
+ Figure 3: Coarser-scale construction module: $B$ is the batch size and $D$ is the dimension of a node.
101
+
102
+ In our experiments, we fix $S$ and $N$ , and $A$ can only take 3 or 5, regardless of the sequence length $L$ . Therefore, the proposed PAM achieves the complexity of $\mathcal { O } ( L )$ with the maximum path length of $\mathcal { O } ( 1 )$ . Note that in the PAM, a node can attend to at most $A + C + 1$ nodes. Unfortunately, such a sparse attention mechanism is not supported in the existing deep learning libraries, such as Pytorch and TensorFlow. A naive implementation of the PAM that can fully exploit the tensor operation framework is to first compute the product between all Q-K pairs, i.e., $\mathbf { \Delta } q _ { i } \mathbf { \Delta } k _ { \ell } ^ { T }$ for $\ell =$ $1 , \cdots , L$ , and then mask out $\ell \notin \mathbb { N } _ { \ell } ^ { ( s ) }$ . However, the resulting time and space complexity of this implementation is still $\mathcal { O } ( L ^ { 2 } )$ . Instead, we build a customized CUDA kernel specialized for the PAM using TVM (Chen et al., 2018), practically reducing the computational time and memory cost and making the proposed model amenable to long time series. Longer historical input is typically helpful for improving the prediction accuracy, as more information is provided, especially when long-range dependencies are considered.
103
+
104
+ # 3.2 COARSER-SCALE CONSTRUCTION MODULE (CSCM)
105
+
106
+ CSCM targets at initializing the nodes at the coarser scales of the pyramidal graph, so as to facilitate the subsequent PAM to exchange information between these nodes. Specifically, the coarse-scale nodes are introduced scale by scale from bottom to top by performing convolutions on the corresponding children nodes $\mathbb { C } _ { \ell } ^ { ( s ) }$ . As demonstrated in Figure 3, several convolution layers with kernel size $C$ and stride $C$ are sequentially applied to the embedded sequence in the dimension of time, yielding a sequence with length $L / C ^ { s }$ at scale $s$ . The resulting sequences at different scales form a $C$ -ary tree. We concatenate these fine-to-coarse sequences before inputting them to the PAM. In order to reduce the amount of parameters and calculations, we reduce the dimension of each node by a fully connected layer before inputting the sequence into the stacked convolution layers and restore it after all convolutions. Such a bottleneck structure significantly reduces the number of parameters in the module and can guard against over-fitting.
107
+
108
+ # 3.3 PREDICTION MODULE
109
+
110
+ For single-step forecasting, we add an end token (by setting $z _ { t + 1 } = 0$ ) to the end of the historical sequence $z _ { t - L + 1 : t }$ before inputting it into the embedding layer. After the sequence is encoded by the PAM, we gather the features given by the last nodes at all scales in the pyramidal graph, concatenate and then input them into a fully connected layer for prediction.
111
+
112
+ For multi-step forecasting, we propose two prediction modules. The first one is the same with the single-step forecasting module, but maps the last nodes at all scales to all $M$ future time steps in a batch. The second one, on the other hand, resorts to a decoder with two full attention layers. Specifically, similar to the original Transformer (Vaswani et al., 2017), we replace the observations at the future $M$ time steps with 0, embed them in the same manner with the historical observations, and refer to the summation of the observation, covariate, and positional embedding as the “prediction token” $F _ { p }$ . The first attention layer then takes the prediction tokens $F _ { p }$ as the query and the output of the encoder $\pmb { F _ { e } }$ (i.e., all nodes in the PAM) as the key and the value, and yields ${ \bf { { F } } } _ { d 1 }$ . The second layer takes ${ \mathbf { } } F _ { d 1 }$ as the query, but takes the concatenated ${ \bf { { F } } } _ { d 1 }$ and $\pmb { F _ { e } }$ as the key and the value. The historical information $\pmb { F _ { e } }$ is fed directly into both attention layers, since such information is vital for accurate long-range forecasting. The final prediction is then obtained through a fully connected layer across the dimension of channels. Again, we output all future predictions together to avoid the problem of error accumulation in the autoregressive decoder of Transformer.
113
+
114
+ Table 2: Single-step forecasting results on three datasets. “Q-K pairs” refer to the number of querykey dot products performed by all attention layers in the network, which encodes the time and space complexity. We write the number of attention layers by $N$ , the number of attention heads by $H$ , the number of scales by $S$ , the dimension of a node by $D$ , the dimension of a key by $D _ { K }$ , the maximum dimension of feed-forward layer by $D _ { F }$ , and the convolution stride by $C$ .
115
+
116
+ <table><tr><td>Methods</td><td>Parameters</td><td>Datasets</td><td>NRMSE</td><td>ND</td><td>Q-K pairs</td></tr><tr><td rowspan="3">Full-attention</td><td rowspan="3">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.328</td><td>0.041</td><td>456976</td></tr><tr><td>Wind</td><td>0.175</td><td>0.082</td><td>589824</td></tr><tr><td>App Flow</td><td>0.407</td><td>0.080</td><td>589824</td></tr><tr><td rowspan="3">LogTrans</td><td rowspan="3">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.333</td><td>0.041</td><td>50138</td></tr><tr><td>Wind</td><td>0.173</td><td>0.081</td><td>58272</td></tr><tr><td>App Flow</td><td>0.387</td><td>0.073</td><td>58272</td></tr><tr><td rowspan="3">Reformer</td><td rowspan="3">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.359</td><td>0.047</td><td>677376</td></tr><tr><td>Wind</td><td>0.183</td><td>0.086</td><td>884736</td></tr><tr><td>AppFlow</td><td>0.463</td><td>0.095</td><td>884736</td></tr><tr><td rowspan="3">ETC</td><td rowspan="3">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.324</td><td>0.041</td><td>79536</td></tr><tr><td>Wind</td><td>0.167</td><td>0.074</td><td>102144</td></tr><tr><td>App Flow</td><td>0.397</td><td>0.069</td><td>102144</td></tr><tr><td rowspan="3">Longformer</td><td rowspan="3">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.330</td><td>0.041</td><td>41360</td></tr><tr><td>Wind</td><td>0.166</td><td>0.075</td><td>52608</td></tr><tr><td>AppFlow</td><td>0.377</td><td>0.07</td><td>52608</td></tr><tr><td rowspan="3">Pyraformer</td><td rowspan="3">O(N(HDDK+DDF) +(S-1)CD²)</td><td>Electricity</td><td>0.324</td><td>0.041</td><td>17648</td></tr><tr><td>Wind</td><td>0.161</td><td>0.072</td><td>20176</td></tr><tr><td>App Flow</td><td>0.366</td><td>0.067</td><td>20176</td></tr></table>
117
+
118
+ # 4 EXPERIMENTS
119
+
120
+ # 4.1 DATASETS AND EXPERIMENT SETUP
121
+
122
+ We demonstrated the advantages of the proposed Pyraformer on the four real-world datasets, including Wind, App Flow, Electricity, and ETT. The first three datasets were used for single-step forecasting, while the last two for long-range multi-step forecasting. We refer the readers to Appendix E and F for more details regarding the data description and the experiment setup.
123
+
124
+ # 4.2 RESULTS AND ANALYSIS
125
+
126
+ # 4.2.1 SINGLE-STEP FORECASTING
127
+
128
+ We conducted single-step prediction experiments on three datasets: Electricity, Wind and App Flow. The historical length is 169, 192 and 192, respectively, including the end token. We benchmarked Pyraformer against 5 other attention mechanisms, including the original full-attention (Vaswani et al., 2017), the log-sparse attention (i.e., LogTrans) (Li et al., 2019), the LSH attention (i.e., Reformer) (Kitaev et al., 2019), the sliding window attention with global nodes (i.e., ETC) (Ainslie et al., 2020), and the dilated sliding window attention (i.e., Longformer) (Beltagy et al., 2020). In particular for ETC, some nodes with equal intervals at the finest scale were selected as the global nodes. A global node can attend to all nodes across the sequence and all nodes can attend to it in turn(see Figure 1(e)). The training and testing schemes were the same for all models. We further investigated the usefulness of the pretraining strategy (see Appendix G), the weighted sampler, and the hard sample mining on all methods, and the best results were presented. We adopted the NRMSE (Normalized RMSE) and the ND (Normalized Deviation) as the evaluation indicators (see Appendix H for the definitions). The results are summarized in Table 2. For a fair comparison, except for full-attention, the overall dot product number of all attention mechanisms was controlled to the same order of magnitude.
129
+
130
+ Our experimental results show that Pyraformer outperforms Transformer and its variants in terms of NRMSE and ND, with the least number of query-key dot products (a.k.a. Q-K pairs). Concretely, there are three major trends that can be gleaned from Table 2: (1) The proposed Pyraformer yields the most accurate prediction results, suggesting that the pyramidal graph can better explain the temporal interactions in the time series by considering dependencies of different ranges. Interestingly, for the Wind dataset, sparse attention mechanisms, namely, LogTrans, ETC, Longformer and Pyraformer, outperform the original full attention Transformer, probably because the data contains a large number of zeros and the promotion of adequate sparsity can help avoid over-fitting. (2) The number of Q-K pairs in Pyraformer is the smallest. Recall that this number characterizes the time and space complexity. Remarkably enough, it is $6 5 . 4 \%$ fewer than that of LogTrans and $9 6 . 6 \%$ than that of the full attention. It is worth emphasizing that this computational gain will continue to increase for longer time series. (3) The number of parameters for Pyraformer is slightly larger than that of the other models, resulting from the CSCM. However, this module is very lightweight, which incurs merely $5 \%$ overhead in terms of model size compared to other models. Moreover, in practice, we can fix the hyper-parameters $A$ , $S$ and $N$ , and ensure that $C$ satisfies $C > \sqrt [ s - 1 ] { L / ( ( A - 1 ) N / 2 + 1 ) }$ . Consequently, the extra number of parameters introduced by the CSCM is only $\mathcal { O } ( ( S - 1 ) C D _ { K } ^ { 2 } ) \approx \mathcal { O } ( \sqrt [ s ] { L } )$ .
131
+
132
+ Table 3: Long-range multi-step forecasting results.
133
+
134
+ <table><tr><td rowspan="2">Methods</td><td rowspan="2">Metrics</td><td colspan="3">ETTh1</td><td colspan="3">ETTm1</td><td colspan="3">Electricity</td></tr><tr><td>168</td><td>336</td><td>720</td><td>96</td><td>288</td><td>672</td><td>168</td><td>336</td><td>720</td></tr><tr><td rowspan="3">Informer</td><td>MSE</td><td>1.075</td><td>1.329</td><td>1.384</td><td>0.556</td><td>0.841</td><td>0.921</td><td>0.745</td><td>1.579</td><td>4.365</td></tr><tr><td>MAE</td><td>0.801</td><td>0.911</td><td>0.950</td><td>0.537</td><td>0.705</td><td>0.753</td><td>0.266</td><td>0.323</td><td>0.371</td></tr><tr><td>Q-K pairs</td><td>188040</td><td>188040</td><td>423360</td><td>276480</td><td>560640</td><td>560640</td><td>188040</td><td>188040</td><td>423360</td></tr><tr><td rowspan="3">LogTrans</td><td>MSE</td><td>0.983</td><td>1.100</td><td>1.411</td><td>0.554</td><td>0.786</td><td>1.169</td><td>0.791</td><td>1.584</td><td>4.362</td></tr><tr><td>MAE</td><td>0.766</td><td>0.839</td><td>0.991</td><td>0.499</td><td>0.676</td><td>0.868</td><td>0.340</td><td>0.336</td><td>0.366</td></tr><tr><td>Q-K pairs</td><td>74664</td><td>74664</td><td>216744</td><td>254760</td><td>648768</td><td>648768</td><td>74664</td><td>74664</td><td>216744</td></tr><tr><td rowspan="3">Longformer</td><td>MSE</td><td>0.860</td><td>0.975</td><td>1.091</td><td>0.526</td><td>0.767</td><td>1.021</td><td>0.766</td><td>1.591</td><td>4.361</td></tr><tr><td>MAE</td><td>0.710</td><td>0.769</td><td>0.832</td><td>0.507</td><td>0.663</td><td>0.788</td><td>0.311</td><td>0.343</td><td>0.368</td></tr><tr><td>Q-K pairs</td><td>63648</td><td>63648</td><td>249120</td><td>329760</td><td>1007136</td><td>1007136</td><td>63648</td><td>63648</td><td>249120</td></tr><tr><td rowspan="3">Reformer</td><td>MSE</td><td>0.958</td><td>1.044</td><td>1.458</td><td>0.543</td><td>0.924</td><td>0.981</td><td>0.783</td><td>1.584</td><td>4.374</td></tr><tr><td>MAE</td><td>0.741</td><td>0.787</td><td>0.987</td><td>0.528</td><td>0.722</td><td>0.778</td><td>0.332</td><td>0.334</td><td>0.374</td></tr><tr><td>Q-K pairs</td><td>1016064</td><td>1016064</td><td>2709504</td><td>5308416</td><td>14450688</td><td>14450688</td><td>1016064</td><td>1016064</td><td>2709504</td></tr><tr><td rowspan="3">ETC</td><td>MSE</td><td>1.025</td><td>1.084</td><td>1.137</td><td>0.762</td><td>1.227</td><td>1.272</td><td>0.777</td><td>1.586</td><td>4.361</td></tr><tr><td>MAE</td><td>0.771</td><td>0.811</td><td>0.866</td><td>0.653</td><td>0.880</td><td>0.908</td><td>0.326</td><td>0.340</td><td>0.368</td></tr><tr><td>Q-K pairs</td><td>125280</td><td>125280</td><td>288720</td><td>331344</td><td>836952</td><td>836952</td><td>125280</td><td>125280</td><td>288720</td></tr><tr><td rowspan="3">Pyraformer</td><td>MSE</td><td>0.808</td><td>0.945</td><td>1.022</td><td>0.480</td><td>0.754</td><td>0.857</td><td>0.719</td><td>1.533</td><td>4.312</td></tr><tr><td>MAE</td><td>0.683</td><td>0.766</td><td>0.806</td><td>0.486</td><td>0.659</td><td>0.707</td><td>0.256</td><td>0.291</td><td>0.346</td></tr><tr><td>Q-K pairs</td><td>26472</td><td>26472</td><td>74280</td><td>57264</td><td>96384</td><td>96384</td><td>26472</td><td>26472</td><td>74280</td></tr></table>
135
+
136
+ # 4.2.2 LONG-RANGE MULTI-STEP FORECASTING
137
+
138
+ We evaluated the performance of Pyraformer for long-range forecasting on three datasets, that is, Electricity, ETTh1, and ETTm1. In particular for ETTh1 and ETTm1, we predicted the future oil temperature and the 6 power load features at the same time, which is a multivariate time series forecasting problem. Both prediction modules introduced in Section 3.3 were tested for all models and the better results are listed in Table 3.
139
+
140
+ It is evident that Pyraformer still achieves the best performance with the least number of Q-K pairs for all datasets regardless of the prediction length. More precisely, in comparison with Informer (Zhou et al., 2021), the MSE given by Pyraformer for ETTh1 is decreased by $2 4 . 8 \%$ , $2 8 . 9 \%$ , $2 6 . 2 \%$ respectively when the prediction length is 168, 336, and 720. Once again, this bolsters our belief that it is more beneficial to employ the pyramidal graph when describing the temporal dependencies. Interestingly, we notice that for Pyraformer, the results given by the first prediction module are better than those by the second one. One possible explanation is that the second prediction module based on the full attention layers cannot differentiate features with different resolutions, while the first module based on a single fully connected layer can take full advantages of such features in an automated fashion. To better elucidate the modeling capacity of Pyraformer for long-range forecasting, we refer the readers to Appendix I for a detailed example on synthetic data.
141
+
142
+ ![](images/c76b7f33141c4ef44a7a1594f69b85c5196a20fecbd341cd7e0a1ecd285eb186.jpg)
143
+ Figure 4: Comparison of the time and memory consumption between the full, the prob-sparse, and the TVM implementation of the pyramidal attention: (a) computation time; (b) memory occupation.
144
+
145
+ # 4.2.3 SPEED AND MEMORY CONSUMPTION
146
+
147
+ To check the efficiency of the customized CUDA kernel implemented based on TVM, we depicted the empirical computation time and memory cost as a function of the sequence length $L$ in Figure 4. Here we only compared Pyraformer with the full attention and the prob-sparse attention in Informer (Zhou et al., 2021). All the computations were performed on a $1 2 \mathrm { \ G B }$ Titan $\mathrm { X p }$ GPU with Ubuntu 16.04, CUDA 11.0, and TVM 0.8.0. Figure 4 shows that the time and memory cost of the proposed Pyraformer based on TVM is approximately a linear function of $L$ , as expected. Furthermore, the time and memory consumption of the TVM implementation can be several orders of magnitude smaller than that of the full attention and the prob-sparse attention, especially for relatively long time series. Indeed, for a 12GB Titan Xp GPU, when the sequence length reaches 5800, full attention encounters the out-of-memory (OOM) problem, yet the TVM implementation of Pyraformer only occupies 1GB of memory. When it comes to a sequence with 20000 time points, even Informer incurs the OOM problem, whereas the memory cost of Pyraformer is only 1.91GB and the computation time per batch is only 0.082s.
148
+
149
+ # 4.3 ABLATION STUDY
150
+
151
+ We also performed ablation studies to measure the impact of $A$ and $C$ , the CSCM architecture, the history length, and the PAM on the prediction accuracy of Pyraformer. The results are displayed in Tables 7-10. Detailed Discussions on the results can be found in Appendix J. Here, we only provide an overview of the major findings: (1) it is better to increase $C$ with $L$ but fix $A$ to a small constant for the sake of reducing the prediction error; (2) convolution with bottleneck strikes a balance between the prediction accuracy and the number of parameters, and hence, we use it as the CSCM; (3) more history helps increase the accuracy of forecasting; (4) the PAM is essential for accurate prediction.
152
+
153
+ # 5 CONCLUSION AND OUTLOOK
154
+
155
+ In this paper, we propose Pyraformer, a novel model based on pyramidal attention that can effectively describe both short and long temporal dependencies with low time and space complexity. Concretely, we first exploit the CSCM to construct a $C$ -ary tree, and then design the PAM to pass messages in both the inter-scale and the intra-scale fashion. By adjusting $C$ and fixing other parameters when the sequence length $L$ increases, Pyraformer can achieve the theoretical $\mathcal O ( L )$ complexity and $\mathcal { O } ( 1 )$ maximum signal traversing path length. Experimental results show that the proposed model outperforms the state-of-the-art models for both single-step and long-range multi-step prediction tasks, but with less computational time and memory cost. So far we only concentrate on the scenario where $A$ and $S$ are fixed and $C$ increases with $L$ when constructing the pyramidal graph. On the other hand, we have shown in Appendix I that other configurations of the hyper-parameters may further improve the performance of Pyraformer. In the future work, we would like to explore how to adaptively learn the hyper-parameters from the data. Also, it is interesting to extend Pyraformer to other fields, including natural language processing and computer vision.
156
+
157
+ # ACKNOWLEDGEMENT
158
+
159
+ In this work, Prof. Weiyao Lin was supported by Ant Group through Ant Research Program and in part by National Natural Science Foundation of China under grant U21B2013.
160
+
161
+ REFERENCES
162
+ Joshua Ainslie, Santiago Ontanon, Chris Alberti, Vaclav Cvicek, Zachary Fisher, Philip Pham, Anirudh Ravula, Sumit Sanghai, Qifan Wang, and Li Yang. Etc: Encoding long and structured inputs in transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 268–284, 2020.
163
+ Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
164
+ George EP Box and Gwilym M Jenkins. Some recent advances in forecasting and control. Journal of the Royal Statistical Society. Series C (Applied Statistics), 17(2):91–109, 1968.
165
+ Shiyu Chang, Yang Zhang, Wei Han, Mo Yu, Xiaoxiao Guo, Wei Tan, Xiaodong Cui, Michael Witbrock, Mark Hasegawa-Johnson, and Thomas S Huang. Dilated recurrent neural networks. Advances in Neural Information Processing Systems, 2017:77–87, 2017.
166
+ Tianqi Chen, Thierry Moreau, Ziheng Jiang, Lianmin Zheng, Eddie Yan, Haichen Shen, Meghan Cowan, Leyuan Wang, Yuwei Hu, Luis Ceze, et al. $\{ \mathrm { T V M } \}$ : An automated end-to-end optimizing compiler for deep learning. In 13th {USENIX} Symposium on Operating Systems Design and Implementation $\bar { \langle } O S D I \rangle \bar { I } \delta )$ , pp. 578–594, 2018.
167
+ M. J. Choi, V. Chandrasekaran, D. M. Malioutov, J. K. Johnson, and A. S. Willsky. Multiscale stochastic modeling for tractable inference and data assimilation. Computer Methods in Applied Mechanics and Engineering, 197(43-44):3492–3515, 2008.
168
+ Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. In 5th International Conference on Learning Representations, ICLR 2017, 2019.
169
+ Marta R Costa-jussa and Jos \` e AR Fonollosa. Character-based neural machine translation. In ´ Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 357–361, 2016.
170
+ Jaeyoung Kim, Mostafa El-Khamy, and Jungwon Lee. Residual lstm: Design of a deep recurrent architecture for distant speech recognition. arXiv preprint arXiv:1701.03360, 2017.
171
+ Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations, 2019.
172
+ Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and short-term temporal patterns with deep neural networks. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pp. 95–104, 2018.
173
+ Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. Advances in Neural Information Processing Systems, 32:5243–5253, 2019.
174
+ Lesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. Document level neural machine translation with hierarchical attention networks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), number CONF, 2018.
175
+ Mohsin Munir, Shoaib Ahmed Siddiqui, Andreas Dengel, and Sheraz Ahmed. Deepant: A deep learning approach for unsupervised anomaly detection in time series. Ieee Access, 7:1991–2005, 2018.
176
+ David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3):1181– 1191, 2020.
177
+
178
+ M. Schuster. Bi-directional recurrent neural networks for speech recognition. In Proceeding of IEEE Canadian Conference on Electrical and ComputerEngineering, pp. 7–12, 1996.
179
+
180
+ Sandeep Subramanian, Ronan Collobert, Marc’Aurelio Ranzato, and Y-Lan Boureau. Multi-scale transformer language models. arXiv preprint arXiv:2005.00581, 2020.
181
+
182
+ Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5693–5703, 2019.
183
+
184
+ Sean J Taylor and Benjamin Letham. Forecasting at scale. The American Statistician, 72(1):37–45, 2018.
185
+
186
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
187
+
188
+ W. Wang, E. Xie, X. Li, D. P. Fan, and L. Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. 2021.
189
+
190
+ Zihao Ye, Qipeng Guo, Quan Gan, Xipeng Qiu, and Zheng Zhang. Bp-transformer: Modelling long-range context via binary partitioning. arXiv preprint arXiv:1911.04070, 2019.
191
+
192
+ Hang Yu, Luyin Xin, and Justin Dauwels. Variational wishart approximation for graphical model selection: Monoscale and multiscale models. IEEE Transactions on Signal Processing, 67(24): 6468–6482, 2019. doi: 10.1109/TSP.2019.2953651.
193
+
194
+ Hsiang-Fu Yu, Nikhil Rao, and Inderjit S Dhillon. Temporal regularized matrix factorization for high-dimensional time series prediction. Advances in neural information processing systems, 29: 847–855, 2016.
195
+
196
+ Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of AAAI, 2021.
197
+
198
+ Simiao Zuo, Haoming Jiang, Zichong Li, Tuo Zhao, and Hongyuan Zha. Transformer hawkes process. In International Conference on Machine Learning, pp. 11692–11702. PMLR, 2020.
199
+
200
+ Table 4: Meanings of notations.
201
+
202
+ <table><tr><td>Notation</td><td>Size</td><td>Meaning</td></tr><tr><td>L</td><td>Constant</td><td>The length of historical sequence.</td></tr><tr><td>G</td><td>Constant</td><td>The number of global tokens in ETC.</td></tr><tr><td>M</td><td>Constant</td><td>The length of future sequence to be predicted.</td></tr><tr><td>B</td><td>Constant</td><td>Batch size.</td></tr><tr><td>D</td><td>Constant</td><td>The dimension of each node.</td></tr><tr><td>DK</td><td>Constant</td><td>The dimension of a key.</td></tr><tr><td>X</td><td>B×L×D</td><td>Input of a single attention head.</td></tr><tr><td>Y</td><td>B×L×D</td><td>Output of a single attention head.</td></tr><tr><td>Q</td><td>B×L×Dk</td><td>The query.</td></tr><tr><td>K</td><td>B×L×Dk</td><td>The key.</td></tr><tr><td>V</td><td>B×L×Dk</td><td>The value.</td></tr><tr><td>WQ</td><td>D×Dk</td><td>The weight matrix of the query.</td></tr><tr><td>WK</td><td>D ×Dk</td><td>The weight matrix of the key.</td></tr><tr><td>Wv</td><td>D×Dk</td><td>The weight matrix of the value.</td></tr><tr><td>S</td><td>Constant</td><td>Number of scales.</td></tr><tr><td>A</td><td>Constant</td><td>Number of adjacent nodes at the same scale that a node can attend to.</td></tr><tr><td>C</td><td>Constant</td><td>Number of finer scale nodes that a coarser scale node can summarize.</td></tr><tr><td>N</td><td>Constant</td><td>Number of attention layers.</td></tr><tr><td>n(</td><td>D</td><td>The l-th node at scale s.</td></tr><tr><td>N</td><td>len(N)) × D</td><td></td></tr><tr><td>A</td><td>len(A()) × D</td><td> The adjacent A nodes at the same scale with n(s).</td></tr><tr><td>C</td><td>len(C()) × D</td><td></td></tr><tr><td>P</td><td>len(P(s) × D</td><td> The parent node of n(s).</td></tr><tr><td>Fp</td><td>B×M×D</td><td>The prediction tokens.</td></tr><tr><td>Fe</td><td>B ×Ltot ×D</td><td> The output of the encoder. Ltot represents the output length of the encod</td></tr><tr><td>Fd1</td><td>B×M×D</td><td>The output of the first attention-based decoder layer.</td></tr><tr><td>H</td><td>Constant</td><td>The number of attention heads.</td></tr><tr><td>DF</td><td></td><td></td></tr><tr><td></td><td>Constant</td><td>The maximum dimension of the feed-forward layer.</td></tr></table>
203
+
204
+ # A A BRIEF REVIEW ON RELATED RNN-BASED MODELS
205
+
206
+ In this section, we provide a brief review on the related RNN-based models. Multiscale temporal dependencies are successfully captured in HRNN (Costa-jussa & Fonollosa, 2016) and HM- \` RNN (Chung et al., 2019). The former requires expert knowledge to partition the sequence into different resolutions, while the latter learns the partition automatically from the data. Note that the theoretical maximum length of the signal traversing path in both models is still $\mathcal O ( L )$ . Another line of works aim to shorten the signal traversing path by adding residual connections (Kim et al., 2017) or dilated connections to LSTMs (Chang et al., 2017). However, they do not consider the multiresolution temporal dependencies explicitly. Furthermore, all aforementioned RNNs only propagate information in one direction from the past to the future. An appealing approach that allows bidirectional information exchange is Bi-LSTM (Schuster, 1996). The forward and backward propagation is realized through two different LSTMs though, and so still incurs a long signal traversing path.
207
+
208
+ As opposed to the abovementioned RNN-based models, the proposed Pyraformer enables bidirectional information exchange that can better describe the temporal dependencies, while providing a multiresolution representation of the observed sequence at the same time. We also notice that due to the unidirectional property of RNNs, it is difficult the realize the pyramidal graph in Figure 1d based on RNNs.
209
+
210
+ # B PROOF OF LEMMA 1
211
+
212
+ Proof. Let $S$ denote the number of scales in the pyramidal graph, $C$ the number of children nodes in the finer scale $s - 1$ that a node in the the coarser scale $s$ can summarize for $s = 2 , \cdots , S , A$ the number of adjacent nodes that a node can attend to within each scale, $N$ the number of attention layers, and $L$ the length of the input time series. We define the term “receptive field” of an arbitrary node $n _ { a }$ in a graph as the set of nodes that $n _ { a }$ can receive messages from. We further define the distance between two arbitrary nodes in a graph as the length of the shortest path between them (i.e., the number of steps to travel from one node to another). Note that in each attention layer, the messages can only travel by one step in the graph.
213
+
214
+ Without sacrificing generality, we assume that $L$ is divisible by $C ^ { S - 1 }$ , and then the number of nodes at the coarsest scale $S$ is $L / C ^ { S - 1 }$ . Since every node is connected to $A$ closest nodes at the same scale, the distance between the leftmost and the rightmost node at the coarsest scale is $2 ( L / C ^ { S - 1 } - 1 ) / ( A - 1 )$ . Hence, the leftmost and the rightmost node in the coarsest scale are in the receptive field of each other after the stack of $N \geq 2 ( L / C ^ { S - 1 } - 1 ) / ( A - 1 )$ layers of the pyramidal attention. In addition, owing to the CSCM, nodes at the coarsest scale can be regarded as the summary of the nodes in the finer scales. As a result, when Equation (4) is satisfied, all nodes at the coarsest scale have a global receptive field, which closes the proof. □
215
+
216
+ # C PROOF OF PROPOSITION 1
217
+
218
+ Proof. Suppose that $L ^ { ( s ) }$ denotes the number of nodes at scale $s$ , that is,
219
+
220
+ $$
221
+ L ^ { ( s ) } = \frac { L } { C ^ { s - 1 } } , 1 \leq s \leq S .
222
+ $$
223
+
224
+ For a node $n _ { \ell } ^ { ( s ) }$ in the pyramidal graph, the number of dot products $P _ { \ell } ^ { ( s ) }$ it acts as the query can be decomposed into two parts:
225
+
226
+ $$
227
+ P _ { \ell } ^ { ( s ) } = P _ { \ell } ^ { ( s ) } { } _ { \mathrm { i n t e r } } + P _ { \ell } ^ { ( s ) } { } _ { \mathrm { i n t r a } } ,
228
+ $$
229
+
230
+ where P (s) $P _ { \ell } ^ { ( s ) } { _ { \mathrm { i n t r a } } }$ a and P (s)ℓ int denotes the intra-scale and the inter-scale part respectively. According to the structure of the pyramidal graph, we can have the following inequalities:
231
+
232
+ $$
233
+ \begin{array} { r l } & { P _ { \ell \mathrm { \tiny ~ \min i n t r a } } ^ { ( s ) } \le A , } \\ & { P _ { \ell \mathrm { \tiny ~ \min t e r } } ^ { ( s ) } \le C + 1 . } \end{array}
234
+ $$
235
+
236
+ The first inequality (8) holds since a node typically attends to $A$ most adjacent nodes at the same scale but for the leftmost and the rightmost node, the number of in-scale nodes it can attend to is smaller than $A$ . On the other hand, the second inequality (9) holds because a node typically has $C$ children and 1 parent in the pyramidal graph but nodes at the top and the bottom scale can only attend to fewer than $C + 1$ nodes at adjacent scales.
237
+
238
+ In summary, the number of dot products that need to be calculated for scale $s$ is:
239
+
240
+ $$
241
+ P ^ { ( s ) } = \sum _ { \ell = 1 } ^ { L ^ { ( s ) } } \big ( P _ { \ell \mathrm { \tiny ~ \mathrm { ~ i n t r a } } } ^ { ( s ) } + P _ { \ell \mathrm { \tiny ~ \mathrm { ~ i n t e r } } } ^ { ( s ) } \big ) \le L ^ { ( s ) } ( A + C + 1 ) .
242
+ $$
243
+
244
+ Note that $P ^ { ( 1 ) } \leq L ( A + 1 )$ for the finest scale (i.e., $s = 1$ ) since nodes at this scale do not have any children. It follows that the number of dot products that need to be calculated for the entire pyramidal attention layer is:
245
+
246
+ $$
247
+ P = \sum _ { s = 1 } ^ { S } P ^ { ( s ) }
248
+ $$
249
+
250
+ $$
251
+ \begin{array} { l } { { \le L ( A + 1 ) + L ^ { ( 2 ) } ( A + C + 1 ) + . . . + L ^ { ( S ) } ( A + C + 1 ) } } \\ { { \displaystyle = L ( \sum _ { s = 1 } ^ { S } C ^ { - ( s - 1 ) } A + \sum _ { s = 2 } ^ { S } C ^ { - ( s - 1 ) } + \sum _ { s = 1 } ^ { S - 1 } C ^ { - ( s - 1 ) } + 1 ) } } \\ { { \displaystyle < L ( ( A + 2 ) \sum _ { s = 1 } ^ { S } C ^ { - ( s - 1 ) } + 1 ) . } } \end{array}
252
+ $$
253
+
254
+ In order to guarantee that the nodes at the coarsest scale have a global receptive field, we choose $C$ such that $\bar { C } \propto \ ^ { s - 1 } \bar { \sqrt { L } }$ . Consequently, the complexity of the proposed pyramidal attention is:
255
+
256
+ $$
257
+ \begin{array} { r l } { { \mathcal { O } ( P ) \leq \mathcal { O } ( L ( ( A + 2 ) \sum _ { s = 1 } ^ { s } C ^ { - ( s - 1 ) } + 1 ) ) } } \\ & { = \mathcal { O } ( L ( A + 2 ) \sum _ { s = 1 } ^ { S } C ^ { - ( s - 1 ) } ) } \\ & { = \mathcal { O } ( \frac { ( A + 2 ) L ^ { \frac { S } { s - 1 } } - 1 } { L ^ { \frac { S - 1 } { s - 1 } } - 1 } ) } \\ & { = \mathcal { O } ( \frac { A L ^ { \frac { S - 1 } { s - 1 } } - 1 } { L ^ { \frac { S - 1 } { s - 1 } } - 1 } ) . } \end{array}
258
+ $$
259
+
260
+ When $L$ approaches infinity, the above expression amounts to $\mathcal { O } ( A L )$ . Since $A$ can be fixed when $L$ changes, the complexity can be further reduced to $\mathcal { O } ( L )$ . □
261
+
262
+ # D PROOF OF PROPOSITION 2
263
+
264
+ and Proof. Let $n _ { L } ^ { ( 1 ) }$ ℓ is the largest among all pairs of nodes in the pyramidal graph. The shortest path to travel $n _ { \ell } ^ { ( s ) }$ represent the $\ell$ -th node of the $s$ -th scale. It is evident that the distance between $n _ { 1 } ^ { ( 1 ) }$ from n(1)1 to $n _ { L } ^ { ( s ) }$ i s:
265
+
266
+ $$
267
+ n _ { 1 } ^ { ( 1 ) } \to n _ { 1 } ^ { ( 2 ) } \to \cdots \to n _ { 1 } ^ { ( S ) } \to \cdots \to n _ { L ^ { ( S ) } } ^ { ( S ) } \to n _ { L ^ { ( S - 1 ) } } ^ { ( S - 1 ) } \to \cdots \to n _ { L } ^ { ( 1 ) } .
268
+ $$
269
+
270
+ Correspondingly, the length of the maximum path between two arbitrary nodes in the graph is:
271
+
272
+ $$
273
+ L _ { \mathrm { m a x } } = 2 ( S - 1 ) + \frac { 2 ( L ^ { ( S ) } - 1 ) } { A - 1 } .
274
+ $$
275
+
276
+ When $C$ satisfies Equation (5), that is, $L ^ { ( S ) } - 1 \le ( A - 1 ) N / 2$ , we can obtain:
277
+
278
+ $$
279
+ \begin{array} { l } { \displaystyle \mathcal { O } \big ( L _ { \mathrm { m a x } } \big ) = \mathcal { O } \bigg ( 2 ( S - 1 ) + \frac { 2 \big ( L ^ { ( S ) } - 1 \big ) } { A - 1 } \bigg ) } \\ { \displaystyle \qquad = \mathcal { O } \bigg ( 2 ( S - 1 ) + \frac { 2 \big ( \frac { L } { C ^ { S - 1 } } - 1 \big ) } { A - 1 } \bigg ) } \\ { \displaystyle \qquad = \mathcal { O } \big ( 2 ( S - 1 ) + N \big ) } \\ { \displaystyle \qquad = \mathcal { O } ( S + N ) . } \end{array}
280
+ $$
281
+
282
+ Since $A , S$ and $N$ are invariant with $L$ , the order of the maximum path length $L _ { \mathrm { m a x } }$ can be further simplified as $\mathcal { O } ( 1 )$ .
283
+
284
+ # E DATASETS
285
+
286
+ We demonstrated the advantages of the proposed Pyraformer on the following four datasets. The first three datasets were used for single-step forecasting, while the last two for long-range multi-step forecasting.
287
+
288
+ Wind2: This dataset contains hourly estimation of the energy potential in 28 countries between 1986 and 2015 as a percentage of a power plant’s maximum output. Compared with the remaining datasets, it is more sparse and periodically exhibits a large number of zeros. Due to the large size of this dataset, the ratio between training and testing set was roughly 32:1.
289
+
290
+ App Flow: This dataset was collected at Ant Group3. It consists of hourly maximum traffic flow for 128 systems deployed on 16 logic data centers, resulting in 1083 different time series in total. The length of each series is more than 4 months. Each time series was divided into two segments for training and testing respectively, with a ratio of 32:1.
291
+
292
+ Electricity4 (Yu et al., 2016): This dataset contains time series of electricity consumption recorded every 15 minutes from 370 users. Following DeepAR (Salinas et al., 2020), we aggregated every 4 records to get the hourly observations. This dataset was employed for both single-step and longrange forecasting. We trained with data from 2011-01-01 to 2014-09-01 for single-step forecasting, and from 2011-04-01 to 2014-04-01 for long-range forecasting.
293
+
294
+ $\mathbf { \mathbf { E } } \mathbf { T } \mathbf { T } ^ { 5 }$ (Zhou et al., 2021): This dataset comprises 2 years of 2 electricity transformers collected from 2 stations, including the oil temperature and 6 power load features. Observations every hour (i.e., ETTh1) and every 15 minutes (i.e., ETTm1) are provided. This dataset is typically exploited for model assessment on long-range forecasting. Here, we followed Informer (Zhou et al., 2021) and partitioned the data into 12 and 4 months for training and testing respectively.
295
+
296
+ # F EXPERIMENT SETUP
297
+
298
+ We set $S = 4$ and $N = 4$ for Pyraformer in all experiments. When the historical length $L$ is not divisible by $C$ , we only introduced $\lfloor L / C \rfloor$ nodes in the upper scale, where $\lfloor \cdot \rfloor$ denotes the round down operation. The last $L - ( \lfloor L / \bar { C } \rfloor - \bar { 1 } ) C$ nodes at the bottom scale were all connected to the last node at the upper scale. For single-step forecasting, we set $C = 4$ , $A = 3$ , and $H = 4$ in all experiments. Both training and testing used a fixed-size historical sequence to predict the mean and variance of the Gaussian distribution of a single future value. We chose the MSE loss and the log-likelihood (Zuo et al., 2020) as our loss functions. The ratio between them was set to 100. For optimization, we used Adam with the learning rate starting from $1 0 ^ { - 5 }$ and halving in every epoch. We trained Pyraformer with 10 epochs. Weighted sampler based on each window’s average value and hard sample mining were used to improve the generalization ability of the network. On the other hand, for long-range forecasting, we tested four combinations of $A$ and $C$ in each experiment, and the best results were presented. Specifically, when the prediction length is smaller than 600, we tested $A = 3 , 5$ and $C = 4 , 5$ . When the prediction length is larger than 600, we tested $A = 3 , 5$ and $C = 5 , 6$ . The resulting choice of hyper-parameters for each experiment is listed in Table 5. In addition, the loss function was the MSE loss only. We still used Adam as our optimizer, but the learning rate started from $1 0 ^ { - 4 }$ and was reduced to one-tenth every epoch. We set the number of epochs to be 5.
299
+
300
+ # G PRETRAINING
301
+
302
+ For single-step forecasting, the value to be predicted is usually close to the last value of history. Since we only use the last nodes of all scales to predict, the network tends to focus only on shortterm dependencies. To force the network to capture long-range dependencies, we add additional supervision in the first few epochs of training. Specifically, in the first epoch, we form our network as an auto-encoder, as shown in Figure 5. Apart from predicting future values, the PAM is also trained to recover the input values. Note that we test all methods with and without this pretraining strategy and the better results are displayed in Table 2.
303
+
304
+ Table 5: Hyper-parameter settings of long-range experiments.
305
+
306
+ <table><tr><td>Dataset</td><td>prediction length</td><td>N</td><td>S</td><td>H</td><td>A</td><td>C</td><td>historical length</td></tr><tr><td rowspan="3">ETTh1</td><td>168</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>336</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>720</td><td>4</td><td>4</td><td>6</td><td>5</td><td>4</td><td>336</td></tr><tr><td rowspan="3">ETTm1</td><td>96</td><td>4</td><td>4</td><td>6</td><td>3</td><td>5</td><td>384</td></tr><tr><td>288</td><td>4</td><td>4</td><td>6</td><td>5</td><td>5</td><td>672</td></tr><tr><td>672</td><td>4</td><td>4</td><td>6</td><td>3</td><td>6</td><td>672</td></tr><tr><td rowspan="3">Elect</td><td>168</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>336</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>720</td><td>4</td><td>4</td><td>6</td><td>3</td><td>5</td><td>336</td></tr></table>
307
+
308
+ ![](images/16bca2db6aa268152dfacebb3a8ccf6bd2e2df85f5fcbe3870acda17a4461454.jpg)
309
+ Figure 5: The pretraining strategy for one-step prediction. Features of nodes surrounded by the dashed ellipses are concatenated to recover the corresponding input value.
310
+
311
+ # H METRICS
312
+
313
+ Denote the target value as $z _ { j , t }$ and the predicted value as $\hat { z } _ { j , t }$ , where $j$ is the sample index and $t$ is the time index. Then NRMSE and ND are calculated as follows:
314
+
315
+ $$
316
+ \begin{array} { r l } & { \mathrm { N R M S E } = \frac { \sqrt { \frac { 1 } { N T } \sum _ { j = 1 } ^ { N } \sum _ { t = 1 } ^ { T } ( z _ { j , t } - \hat { z } _ { j , t } ) ^ { 2 } } } { \frac { 1 } { N T } \sum _ { j = 1 } ^ { N } \sum _ { t = 1 } ^ { T } | z _ { j , t } | } , } \\ & { \quad \quad \quad \quad \mathrm { N D } = \frac { \sum _ { j = 1 } ^ { N } \sum _ { t = 1 } ^ { T } | z _ { j , t } - \hat { z } _ { j , t } | } { \sum _ { j = 1 } ^ { N } \sum _ { t = 1 } ^ { T } | z _ { j , t } | } . } \end{array}
317
+ $$
318
+
319
+ # I EXPERIMENTS ON SYNTHETIC DATA
320
+
321
+ To further evaluate Pyraformer’s ability to capture different ranges of temporal dependencies, we synthesized an hourly dataset with multi-range dependencies and carried out experiments on it.
322
+
323
+ Specifically, each time series in the synthetic dataset is a linear combination of three sine functions of different periods: 24, 168 and 720, that is,
324
+
325
+ $$
326
+ f ( t ) = \beta _ { 0 } + \beta _ { 1 } \sin ( \frac { 2 \pi } { 2 4 } t ) + \beta _ { 2 } \sin ( \frac { 2 \pi } { 1 6 8 } t ) + \beta _ { 3 } \sin ( \frac { 2 \pi } { 7 2 0 } t ) .
327
+ $$
328
+
329
+ In the above equation, the coefficients of the three sine functions $\beta _ { 1 } , \beta _ { 2 }$ , and $\beta _ { 3 }$ for each time series are uniformly sampled from [5, 10]. $\beta _ { 0 }$ is a Gaussian process with a covariance function $\Sigma _ { t _ { 1 } , t _ { 2 } } = | t _ { 1 } - t _ { 2 } | ^ { - 1 }$ and $\Sigma _ { t _ { 1 } } = \Sigma _ { t _ { 2 } } = 1$ , where $t _ { 1 }$ and $t _ { 2 }$ denote two arbitrary time stamps. Such polynomially decaying covariance functions are known to have long-range dependence, as oppose to the exponentially decaying covariance functions ( $\mathrm { Y u }$ et al., 2019). The start time of each time series $t _ { 0 }$ is uniformly sampled from [0, 719]. We first generate 60 time series of length 14400, and then split each time series into sliding windows of width 1440 with a stride of 24. In our experiments, we use the historical 720 time points to predict the future 720 points. Since both the deterministic and stochastic parts of the synthetic time series have long-range correlations, such dependencies should be well captured in the model in order to yield accurate predictions of the next 720 points. The results are summarized in Table 6. Here, we consider two different configurations of Pyraformer: 1) $C = 6$ for all scales in the pyramidal graph (denoted as Pyraformer6,6,6); 2) $C = 1 2$ , 7, and 4 for the three layers sequentially from bottom to top (denoted as Pyraformer12,7,4).
330
+
331
+ Table 6: Long-range forecasting results on the synthetic dataset.
332
+
333
+ <table><tr><td>Method</td><td>MSE</td><td>MAE</td></tr><tr><td>Full attention</td><td>3.550</td><td>1.477</td></tr><tr><td>LogTrans</td><td>3.007</td><td>1.366</td></tr><tr><td>ETC</td><td>4.742</td><td>5.509</td></tr><tr><td>Informer</td><td>7.546</td><td>2.092</td></tr><tr><td>Longformer</td><td>2.032</td><td>1.116</td></tr><tr><td>Reformer</td><td>1.538</td><td>3.069</td></tr><tr><td>Pyraformer6,6,6</td><td>1.258</td><td>0.877</td></tr><tr><td>Pyraformer12,7,4</td><td>1.176</td><td>0.849</td></tr></table>
334
+
335
+ It can be observed that Pyraformer6,6,6 with the same $C$ for all scales already outperforms the benchmark methods by a large margin. In particular, the MSE given by Pyraformer is decreased by $1 8 . 2 \%$ compared with Reformer, which produces the smallest MSE among the existing variants of Transformer. On the other hand, by exploiting the information of the known period, Pyraformer12,7,4 performs even better than Pyraformer6,6,6. Note that in Pyraformer $^ { \cdot _ { 1 2 , 7 , 4 } }$ , nodes at scale 2, 3, and 4 characterizes coarser temporal resolutions respectively corresponding to half a day, half a week, and half a month. We also tested Pyraformer24,7,4, but setting $C = 2 4$ in the second scale degrades the performance, probably because the convolution layer with a kernel size of 24 is difficult to train.
336
+
337
+ We further visualized the forecasting results produced by Pyraformer $^ { 1 2 , 7 , 4 }$ in Figure 6. The blue solid curve and red dashed curve denote the true and predicted time series respectively. By capturing the temporal dependencies with different ranges, the prediction resulting from Pyraformer closely follows the ground truth.
338
+
339
+ On the other hand, to check whether Pyraformer can extract features with different temporal resolutions, we depicted the extracted features in a randomly selected channel across time at each scale in the pyramidal graph in Figure 7. It is apparent that the features at the coarser scales can be regarded as a lower resolution version of the features at the finer scales.
340
+
341
+ # J ABLATION STUDY
342
+
343
+ # J.1 IMPACT OF $A$ AND $C$
344
+
345
+ We studied the impact of $A$ and $C$ on the performance of Pyraformer for long-range time series forecasting, and showed the results in Table 7. Here, we focus on the dataset ETTh1. The history length is 336 and the prediction length is 720. From Table 7, we can conclude that the receptive fields of the nodes at the coarsest scale in the PAM play an indispensable role in reducing the prediction error of Pyraformer. For instance, there are 42 nodes at the coarsest scale when $C = 2$ . Without the intra-scale connections, each node can only receive messages from 16 nodes at the finest scale. As the number of adjacent connections $A$ in each scale increases, the receptive fields of the coarsestscale nodes also extend, and therefore, the prediction error decreases accordingly. However, as long as the nodes at the top scale have a global receptive field, further increasing $A$ will not bring large gains. For $C = 5$ , the performance does not improve even though $A$ increases. Such observations indicate that it is better to set $A$ to be small once the uppermost nodes in the PAM have a global receptive field. In practice, we only increase $C$ with the increase of $L$ , but keep $A$ small.
346
+
347
+ ![](images/0e107628896de0c58e44310218af31bad1997b6ef59d90b98d324d9c9992721a.jpg)
348
+ Figure 6: Visualization of prediction results on the synthetic dataset.
349
+
350
+ ![](images/78b6ff45bfe2e9e637686e94056b78164c4a40e9a46ac871d93338b981fb0e83.jpg)
351
+ Figure 7: Visualization of the extracted features across time in second channel at different scales: (a) scale 1; (b) scale 2; (c) scale 3.
352
+
353
+ # J.2 IMPACT OF THE CSCM ARCHITECTURE
354
+
355
+ In addition to convolution, there exist other mechanisms for constructing the $C$ -ary tree, such as max pooling and average pooling. We studied the impact of different CSCM architectures on the performance for long-range forecasting on dataset ETTh1. The history and the prediction length are both 168 and $C = 4$ for all mechanisms. The results are listed in Table 8. From Table 8, we can tell that: (1) Using pooling layers instead of convolution typically degrades the performance. However, the performance of Pyraformer based on max pooling is still superior to that of Informer, demonstrating the advantages of the PAM over the prob-sparse attention in Informer. (2) The MSE of convolution with the bottleneck is only $1 . 5 1 \%$ larger than that without bottleneck, but the number of parameters is reduced by almost $9 0 \%$ . Thus, we adopt the more compact module of convolution with bottleneck as our CSCM.
356
+
357
+ Table 7: Impact of $A$ and $C$ on long-range forecasting. The history length is 336.
358
+
359
+ <table><tr><td rowspan="2"></td><td colspan="3">A=3</td><td colspan="3">A=9</td><td colspan="3">A = 13</td></tr><tr><td>MSE</td><td>MAE</td><td>Q-K pairs</td><td>MSE</td><td>MAE</td><td>Q-K pairs</td><td>MSE MAE</td><td></td><td>Q-K pairs</td></tr><tr><td>C=2</td><td>1.035</td><td>0.811</td><td>73512</td><td>1.029</td><td>0.815</td><td>162648</td><td>1.003</td><td>0.807</td><td>221112</td></tr><tr><td>C=3</td><td>1.029</td><td>0.817</td><td>58992</td><td>1.009</td><td>0.798</td><td>128976</td><td>1.056</td><td>0.805</td><td>174672</td></tr><tr><td>C=4</td><td>1.001</td><td>0.802</td><td>53208</td><td>1.028</td><td>0.806</td><td>115848</td><td>1.027</td><td>0.804</td><td>156696</td></tr><tr><td>C=5</td><td>0.999</td><td>0.796</td><td>49992</td><td>1.005</td><td>0.796</td><td>108744</td><td>1.017</td><td>0.797</td><td>147192</td></tr></table>
360
+
361
+ Table 8: Impact of the CSCM architecture on long-range forecasting. Parameters introduced by the normalization layers are relatively few, and thus, are ignored.
362
+
363
+ <table><tr><td>CSCM</td><td>MSE</td><td>MAE</td><td>Parameters</td></tr><tr><td>Max-pooling</td><td>0.842</td><td>0.700</td><td>0</td></tr><tr><td>Average-pooling</td><td>0.833</td><td>0.693</td><td>0</td></tr><tr><td>Conv.</td><td>0.796</td><td>0.679</td><td>3147264</td></tr><tr><td>Conv.w/bottleneck</td><td>0.808</td><td>0.683</td><td>328704</td></tr></table>
364
+
365
+ Table 9: Impact of history length. The prediction length is 1344.
366
+
367
+ <table><tr><td>History Length</td><td>MSE</td><td>MAE</td></tr><tr><td>84</td><td>1.234</td><td>0.856</td></tr><tr><td>168</td><td>1.226</td><td>0.868</td></tr><tr><td>336</td><td>1.108</td><td>0.835</td></tr><tr><td>672</td><td>1.057</td><td>0.806</td></tr><tr><td>1344</td><td>1.062</td><td>0.806</td></tr></table>
368
+
369
+ Table 10: Impact of the PAM.
370
+
371
+ <table><tr><td>Method</td><td>Metrics</td><td>96</td><td>288</td><td>672</td></tr><tr><td rowspan="2">CSCM Only</td><td>MSE</td><td>0.576</td><td>0.782</td><td>0.883</td></tr><tr><td>MAE</td><td>0.544</td><td>0.683</td><td>0.752</td></tr><tr><td rowspan="2">Pyraformer</td><td>MSE</td><td>0.480</td><td>0.754</td><td>0.857</td></tr><tr><td>MAE</td><td>0.486</td><td>0.659</td><td>0.707</td></tr></table>
372
+
373
+ # J.3 IMPACT OF THE HISTORY LENGTH
374
+
375
+ We also checked the influence of the history length on the prediction accuracy. The dataset is ETTm1, since its granularity is minute and contains more long-range dependencies. We fixed the prediction length to 1344 and changed the history length from 84 to 1344 in Table 9. As expected, a longer history typically improves prediction accuracy. On the other hand, this performance gain starts to level off when introducing more history stops providing new information. As shown in Figure 8, the time series with length 672 contains almost all periodicity information that is essential for prediction, while length 1344 introduces more noise.
376
+
377
+ # J.4 IMPACT OF THE PAM
378
+
379
+ Finally, we investigated the importance of the PAM. We compared the performance of Pyraformer with and without the PAM on the dataset ETTm1. For a fair comparison, the number of parameters of the two methods were controlled to be within the same order of magnitude. More precisely, we increased the bottleneck dimension of ”Conv. w/bottleneck” for the model only with the CSCM. The results are shown in Table 10. Obviously, the PAM is vital to yield accurate predictions.
380
+
381
+ # K DISCUSSION ON THE SELECTION OF HYPER-PARAMETERS
382
+
383
+ We recommend to first determine the number of attention layers $N$ based on the available computing resources, as this number is directly related to the model size. Next, the number of scales $S$ can be determined by the granularity of the time series. For example, for hourly observations, we typically assume that it may also have daily, weekly and monthly periods. Therefore, we can set $S$ to be 4. We then focus on the selection of $A$ and $C$ . According to the ablation study, we typically prefer a small $A$ , such as 3 and 5. Lastly, in order to ensure the network has a receptive field of $L$ , we can select a $C$ that satisfies Equation (5). In practice, we can use a validation set to choose $C$ from its candidates that satisfies (5). It is also worthwhile to check whether choosing different $C$ for different scales based on the granularity of the time series can further improve the performance as we did in Appendix I.
384
+
385
+ ![](images/db2eafc4e603577f0d58166014a0fae825efdf9d45557b4f4357d82edaf6f6ac.jpg)
386
+ Figure 8: Time series with different lengths in the ETTm1 dataset. The sequence length in (a) and (b) is 672, and that in (c) and (d) is 1344. The time series in (a) and (b) corresponds to the latter half of those in (c) and (d) respectively.
parse/dev/9uRS5ysgb9/9uRS5ysgb9.md ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Zero-Shot Video Question Answering via Frozen Bidirectional Language Models
2
+
3
+ Antoine $\mathbf { Y a n g ^ { 1 , 2 } }$ , Antoine Miech3, Josef Sivic4, Ivan Laptev1,2, Cordelia Schmid1,2
4
+ 1Inria Paris 2Département d’informatique de l’ENS, CNRS, PSL Research University 3DeepMind 4CIIRC CTU Prague https://antoyang.github.io/frozenbilm.html
5
+
6
+ # Abstract
7
+
8
+ Video question answering (VideoQA) is a complex task that requires diverse multimodal data for training. Manual annotation of questions and answers for videos, however, is tedious and prohibits scalability. To tackle this problem, recent methods consider zero-shot settings with no manual annotation of visual question-answer. In particular, a promising approach adapts frozen autoregressive language models pretrained on Web-scale text-only data to multi-modal inputs. In contrast, we here build on frozen bidirectional language models (BiLM) and show that such an approach provides a stronger and cheaper alternative for zero-shot VideoQA. In particular, (i) we combine visual inputs with the frozen BiLM using light trainable modules, (ii) we train such modules using Web-scraped multi-modal data, and finally (iii) we perform zero-shot VideoQA inference through masked language modeling, where the masked text is the answer to a given question. Our proposed approach, FrozenBiLM, outperforms the state of the art in zero-shot VideoQA by a significant margin on a variety of datasets, including LSMDC-FiB, iVQA, MSRVTT-QA, MSVD-QA, ActivityNet-QA, TGIF-FrameQA, How2QA and TVQA. It also demonstrates competitive performance in the few-shot and fully-supervised setting. Our code and models are publicly available at [1].
9
+
10
+ ![](images/5b922eb945c16caa4b7b44122af383f9a3345e9882c5cc2a8e9966a3f8398918.jpg)
11
+ Figure 1: Our model FrozenBiLM builds on a pretrained and frozen bidirectional language model (BiLM), and is trained from Web-scraped video-caption pairs. FrozenBiLM excels in the zero-shot video question answering task without using any explicit visual question-answer supervision.
12
+
13
+ # 1 Introduction
14
+
15
+ Video question answering (VideoQA) is a challenging task that requires fine-grained multi-modal understanding. State-of-the-art approaches to VideoQA [43, 107, 109] rely on large video datasets manually annotated with question-answer pairs. Yet, collecting such annotations is time consuming, expensive and therefore not scalable. This has motivated the development of zero-shot VideoQA approaches [101, 102, 110], that use no visual question-answer annotation for training, see Figure 1.
16
+
17
+ Recently, a promising line of work builds on frozen large autoregressive language models [19, 68, 91, 96, 104, 111] for zero-shot visual question answering. This has been motivated by the findings from GPT-3 [8] which exhibits strong zero-shot text-only question answering abilities from large autoregressive language models. Such models [8, 72, 82, 92] can predict an arbitrarily long sequence of text, one token at each step from left to right. However, they usually require billion parameters to work well, making them computationally expensive to train, and challenging to deploy in practice.
18
+
19
+ In contrast, recent work in natural language [65, 76, 77, 87] demonstrates strong zero-shot performance for lighter bidirectional language models (BiLM). Such models [17, 25, 35, 42, 61, 75] can predict a few masked tokens in an input sequence given left and right context in a single forward pass. These works cast downstream tasks in cloze form1 [90], similar to the masked language modeling task (MLM) [17] solved by these models at pretraining. This motivates us to tackle diverse zero-shot multimodal tasks (open-ended VideoQA [98], multiple-choice VideoQA [46] and fill-in-the-blank [66]) by formulating them in cloze form and leveraging the text-only knowledge of pretrained BiLM.
20
+
21
+ To adapt a pretrained BiLM to multi-modal inputs, we combine it with a frozen pretrained visual backbone and a set of lightweight additional modules including adapters [28]. We train these modules on Web-scraped video-text data using a simple visually-conditioned MLM loss. We preserve the uni-modal knowledge of a BiLM by freezing its weights. To our knowledge, our approach is the first to explore the zero-shot visual-linguistic capabilities of frozen non-autoregressive language models.
22
+
23
+ We show that our approach largely improves the state of the art on various zero-shot VideoQA benchmarks. Furthermore, we demonstrate that frozen bidirectional language models perform better while being cheaper to train than frozen autoregressive language models [91]. Moreover, our ablation studies show (i) the ability of our model to effectively perform zero-shot multi-modal reasoning using both visual cues and speech transcripts, (ii) the importance of adapters combined with frozen pretrained language models, (iii) the impact of multi-modal data scale, (iv) the impact of the language model size and of bidirectional modeling. Our approach also performs competitively in the fullysupervised setting. Indeed, we show the benefits of freezing the weights of a BiLM when using VideoQA training data, while updating considerably less parameters compared to alternative methods. Finally, we introduce a new few-shot VideoQA task in which we finetune our pretrained model on a small fraction of the downstream training dataset, and show promising results in this setting.
24
+
25
+ In summary, our contributions are three-fold:
26
+
27
+ (i) We present FrozenBiLM, a framework that handles multi-modal inputs using frozen bidirectional language models and enables zero-shot VideoQA through masked language modeling.
28
+ (ii) We provide an extensive ablation study and demonstrate the superior performance of our framework in the zero-shot setting when compared to previous autoregressive models.
29
+ (iii) Our approach improves the state of the art in zero-shot VideoQA by a significant margin. FrozenBiLM also demonstrates competitive performance in the fully-supervised setting and shows strong results in the few-shot VideoQA setting which we introduce.
30
+
31
+ Our code and trained models are publicly available at [1].
32
+
33
+ # 2 Related Work
34
+
35
+ Zero-shot VideoQA. A vast majority of VideoQA approaches rely on relatively small, manually annotated VideoQA datasets [3, 9, 10, 13–15, 20, 23, 24, 30, 33, 34, 36–39, 43, 44, 47, 58, 60, 69, 70, 74, 78, 79, 83, 89, 97, 100, 103, 105, 112, 116]. Recently, a few work [101, 110] have explored zero-shot approaches for VideoQA, where models are only trained on automatically mined video clips with short text descriptions. In contrast to VideoQA annotations, such video-text pairs are readilyavailable at scale on the Web [6, 67, 109]. In particular, Yang et al. [101] automatically generate VideoQA training data using language models [72] pretrained on a manually annotated text-only question-answer corpus [73]. Reserve [110] uses GPT-3 [8] to rephrase questions into sentences completed by a multi-modal model. In contrast to these prior works [101, 110], our method does not require any kind of explicitly annotated language dataset or the use of data generation pipelines for zero-shot VideoQA. Note that BLIP [53] studies a related setting where a model trained on manually annotated image-question-answer triplets is transferred to VideoQA, which is a less challenging task. Also note that VideoCLIP [99] considers a related zero-shot multiple-choice video-to-text retrieval task as VideoQA, but in this setting the model is not provided with natural language questions.
36
+
37
+ Visual language models. As language models require large amounts of training data to perform well [27], recent works have studied transferring pretrained language models [8, 94] to image-text tasks. VisualGPT [11] and VC-GPT [64] showed the benefit of initializing the weights of an image captioning model with a pretrained autoregressive language-only model. Recent work pushed this idea further by freezing the weights of a pretrained autoregressive language model for tackling vision and language tasks [2, 19, 68, 91, 96, 104, 111]. Our approach also leverages a frozen pretrained language model. Similar to MAGMA [19], we also use adapter layers [28, 29]. However, we differ from these approaches as we propose to instead use lighter bidirectional masked language models, instead of autoregressive ones, and rely on a masked language modeling objective (MLM) instead of an autoregressive one. Moreover, our model is specifically designed for videos, for which high-quality visual question answering annotation is even more scarce compared to still images [19, 68, 91, 104]. We also explore the use of the speech modality, and tackle tasks which are challenging for autoregressive language models such as video-conditioned fill-in-the-blank [66]. Finally we show in Section 4.3 the superior performance of frozen bidirectional language models in comparison with autoregressive ones [91].
38
+
39
+ Masked Language Modeling in vision and language. The MLM objective was initially introduced in natural language [17, 42, 61] to pretrain bidirectional transformers and learn generic representations. This approach achieved state-of-the-art results in many language tasks after finetuning on downstream datasets. Its success inspired numerous works to adapt it to train multi-modal transformer models on paired visual-linguistic data [12, 21, 22, 26, 31, 40, 48, 51, 56, 54, 59, 52, 50, 62, 63, 80, 81, 85, 86, 88, 93, 95, 106, 109, 114, 115]. However, these works typically use it to learn generic visual-linguistic representations by updating the transformer weights, and then use expensive manual supervision to train randomly initialized task-specific answer classifiers for VQA [12, 22, 51, 52, 59, 62, 80, 81, 85, 88, 95, 106] or VideoQA [21, 48, 50, 93, 109]. In contrast, we tackle zero-shot VideoQA, i.e. without using any manual annotation. Moreover, we do not update the transformer weights during cross-modal training, but instead exhibit the benefits of freezing these weights after text-only pretraining, for both zero-shot and fully-supervised VideoQA (see Sections 4.2 and 4.5).
40
+
41
+ # 3 Method
42
+
43
+ This section presents our approach to tackle zero-shot video question answering. Here, zero-shot means that we do not use any visual question answering annotation and only rely on scalable data from the Web. Our approach starts with two strong pretrained components: (i) a text-only bidirectional masked language model (BiLM) pretrained on data from the Internet, which has the capability of zeroshot question answering but is not capable of visual reasoning, and (ii) a vision encoder pretrained to map images to text descriptions, but which does not have the ability to perform visual question answering. We aim at connecting these two components while keeping the language component frozen to avoid catastrophic forgetting [16], where the large language model would specialize to a new task while forgetting its initial capabilities. The end-goal is to design a unified model having the best of both worlds: visual understanding capabilities of a powerful visual encoder and question answering capabilities of a powerful language model. This requires several technical innovations, which are described in the rest of this section. First, we explain in Section 3.1 how we augment a frozen pretrained bidirectional masked language model with new layers to enable joint video and language reasoning, see Figure 2. Second, we present in Section 3.2 how we train these layers on video-text data scraped from the Web [6]. Finally, we describe in Section 3.3 how we enable zero-shot predictions for several video-language downstream tasks, including open-ended VideoQA, by casting them in a cloze form, similar to the masked language modeling task solved during training.
44
+
45
+ # 3.1 Architecture
46
+
47
+ The proposed architecture, illustrated in Figure 2, brings together a powerful frozen pretrained bidirectional language model with a strong visual encoder. The difficulty lies in enabling multi-modal reasoning while keeping the large language model frozen. To address this challenge, we unify these two models via a visual-to-text projection module together with small adapter modules inserted within the frozen language model. Next, we describe in more detail the three main components of the architecture: (i) the frozen pretrained bidirectional language model, (ii) the pretrained video encoder and (iii) the lightweight modules that seamlessly connect the two components.
48
+
49
+ ![](images/da4998bc23389f6df2512772fded64c3ab160004c8e4a743977d3a26c516272a.jpg)
50
+ Figure 2: Our training architecture consists of a large frozen bidirectional language model (BiLM) and a frozen pretrained visual encoder (in blue), complemented with additional lightweight trainable modules (in orange): (1) a visual-to-text projection module $P$ (on the left), which maps the frozen visual features to the joint visual-text embedding space and (2) a set of small adapter modules $A$ (on the right) in between the frozen transformer blocks. The pretrained normalization layers in the BiLM (on the right) are also finetuned.
51
+
52
+ Frozen Bidirectional Masked Language Model. Our method starts from a pretrained bidirectional language model based on a Transformer encoder [92]. The input text is decomposed into a sequence of tokens $x = \{ x _ { i } \} _ { 1 } ^ { L } \in [ 1 , V ] ^ { L }$ by a tokenizer of a vocabulary size $V$ . The language model, parameterized by $\theta$ , makes use of an embedding function $g _ { \theta }$ which independently transforms each token into a $D$ -dimensional continuous embedding $t = \bar { \{ t _ { i } \} } _ { 1 } ^ { L } : = \{ g _ { \theta } \dot { ( } x _ { i } ) \} _ { 1 } ^ { L } \ \bar { \in } \ \mathbb { R } ^ { L \times D }$ , a Transformer encoder $f _ { \theta }$ which computes interactions between all input tokens and outputs contextualized representations $t ^ { \prime } = \{ t _ { i } ^ { \prime } \} _ { 1 } ^ { L }$ , and a masked language modeling (MLM) classifier head $m _ { \theta }$ which independently maps the $D$ -dimensional continuous embedding for each token $t _ { i } ^ { \prime }$ to a vector of logits parameterizing a categorical distribution over the vocabulary $V$ . This distribution is referred to by $\operatorname { \bar { l o g } } p _ { \theta } ( x ) : = \operatorname { \bar { \{ } } m _ { \theta } ( t _ { i } ^ { \prime } ) \overset { \_ } \} _ L ^ { } \in \mathbb { R } ^ { L \times V }$ . We assume that the language model is pretrained, i.e. $\theta$ has been optimised with a standard MLM objective [17] on a large dataset of text from the Web. We show in Section 4.2 that this text-only pretraining has a crucial importance for zero-shot VideoQA.
53
+
54
+ Pretrained Video Encoder. The video is represented by a sequence of frames $y = \{ y _ { i } \} _ { 1 } ^ { T }$ . Each frame is forwarded separately through a visual backbone $h _ { \phi }$ , which outputs one feature vector per frame $\boldsymbol { u } = \{ u _ { i } \} _ { 1 } ^ { T } : = \{ h _ { \phi } ( y _ { i } ) \} _ { 1 } ^ { T } \in \mathbb { R } ^ { T \times D _ { u } }$ . In detail, the visual backbone is CLIP ViT-L/14 [18, 71] at resolution $2 2 4 \times 2 2 4$ pixels, pretrained to map images to text descriptions with a contrastive loss on 400M Web-scraped image-text pairs. The backbone is kept frozen throughout our experiments. Note that a CLIP-baseline for zero-shot VideoQA results in poor performance, see Section 4.4.
55
+
56
+ Connecting the Frozen Language and Frozen Vision components. The video features are incorporated into the language model as a prompt [49, 57, 113] $v$ of length $T$ (Figure 2, left). This prompt is obtained by linearly mapping the visual features $u$ to the text token embedding space via a visual-to-text projection $\boldsymbol { P } ^ { \check { \mathbf { \check { \tau } } } } \in \mathbb { R } ^ { \pmb { \check { D } _ { u } } \times \pmb { \check { D } } }$ , i.e. $v = \{ v _ { i } \} _ { 1 } ^ { T } : = \{ P ( u _ { i } ) \} _ { 1 } ^ { T }$ . The prompt is then concatenated with the text embeddings before being forwarded to the transformer encoder that models joint visual-linguistic interactions. We show in Section 4.2 that incorporating the input video considerably improves zero-shot VideoQA results. In addition, to learn powerful multi-modal interactions while keeping the transformer encoder weights frozen, we equip the transformer encoder with lightweight adapter modules $A$ [28] (Figure 2, right). We use an adapter which transforms the hidden state $z$ with a multi-layer perceptron transformation and a residual connection, i.e. $A ( z ) = z + W ^ { u p } \psi ( W ^ { d o w n } z )$ with $W ^ { d o w n } \in \mathbb { R } ^ { \bar { D } \times D _ { h } }$ , $W ^ { u p } \in \mathbb { R } ^ { D _ { h } \times D }$ , $D$ the hidden dimension of the transformer, $D _ { h }$ the bottleneck dimension, and $\psi$ a ReLU activation function. $D _ { h }$ is typically set to be smaller than $D$ such that the adapters are lightweight. In detail, we add an adapter module before the layer normalization, after each self-attention layer and each feed-forward layer of the transformer encoder.
57
+
58
+ # 3.2 Cross-modal training
59
+
60
+ We wish to train the newly added modules introduced in the previous section (shown in orange in Figure 2) for the VideoQA task. This is hard because we assume that no explicit manual annotation for the VideoQA task is available, such annotations being expensive and therefore hard to obtain at scale. Instead we train our architecture using only readily-available video-caption pairs scraped from the Web. Such data is easy to obtain [6, 67, 109], ensuring the scalability of our approach.
61
+
62
+ During training, we keep the weights of the pretrained BiLM and pretrained visual backbone frozen as previously explained. We train from scratch the parameters of (i) the visual-to-text projection module $P$ and (ii) the adapter modules $A$ . We show in Section 4.2 the importance of freezing the BiLM weights combined with training the adapter modules. Note that all normalization layers [5] of the pretrained BiLM are also updated to adjust to the new distribution of the training data. We denote all the trainable parameters of our model by the subscript $\mu$ . In practice, they sum up to about $5 \%$ of the BiLM parameters, hence the training of our model is computationally efficient.
63
+
64
+ We use a visually-conditioned masked language modeling objective (MLM), in which some text tokens $\{ x _ { m } \}$ are randomly masked and the model has to predict these tokens based on the surrounding text tokens and the video input. Formally, we minimize the following loss:
65
+
66
+ $$
67
+ \mathcal { L } _ { \mu } ( x , y ) = - \frac { 1 } { M } \sum _ { m } \log p _ { \mu } ( \tilde { x } , y ) _ { m } ^ { x _ { m } } ,
68
+ $$
69
+
70
+ where $\tilde { x }$ is the corrupted text sequence, $y$ is the sequence of video frames, $p _ { \mu } ( \tilde { x } , y ) _ { m } ^ { x _ { m } }$ is the probability for the (masked) $m$ -th token in $\tilde { x }$ to be $x _ { m }$ , and $M$ is the number of masks in the sequence $\tilde { x }$ . In detail, we follow [17] and corrupt $15 \%$ of text tokens, replacing them $80 \%$ of the time with a mask token, $10 \%$ of the time with the same token and $10 \%$ of the time with a randomly sampled token.
71
+
72
+ # 3.3 Adapting to downstream tasks
73
+
74
+ After training, our model is able to fill gaps in the input text given an input video together with left and right textual context as part of the input text. We wish to apply our model out-of-the-box to predict an answer given a question about a video. The video can optionally come with textual subtitles obtained using automatic speech recognition. To avoid using manual supervision, we formulate the downstream tasks in cloze form [76, 90], i.e. such that the model only has to fill-in a mask token in the input prompt similarly to the MLM objective optimized during training. The adaptation to the downstream tasks brings several challenges, as described next. First, we describe how we formulate the input text prompts for several downstream tasks. Then, we explain how we map the mask token from the input text prompt to an answer via a frozen answer embedding module. Finally, we present how we finetune our architecture in a supervised setting.
75
+
76
+ Input prompt engineering. We describe how we design the input text prompts for several downstream video-language tasks. Each downstream task is formulated as a masked language modeling problem. This allows us to apply FrozenBiLM out-of-the-box. A [CLS] token and a [SEP] token are respectively inserted at the start and the end of each sequence following [17].
77
+
78
+ Open-ended VideoQA. Given a question and a video, the task is to find the correct answer in a large vocabulary $\mathcal { A }$ of about 1K answers. Answers are concise, i.e. the great majority of answers consist of one word [32, 98, 101, 108]. We design the following prompt:
79
+
80
+ “[CLS] Question: <Question>? Answer: [MASK]. Subtitles: <Subtitles> [SEP]”
81
+
82
+ Multiple-choice VideoQA. Given a question and a video, the task is to find the correct answer in a small number of candidates $C$ , typically up to 5 choices [46, 54]. We set the vocabulary to $\mathcal { A } = [ \mathrm { Y e s } , \mathrm { N o } ]$ and compute a confidence score for each candidate by using the following prompt:
83
+
84
+ “[CLS] Question: <Question>? Is it ’<Answer Candidate>’? [MASK]. Subtitles: <Subtitles> [SEP]”
85
+
86
+ We choose the best option by selecting the candidate with the highest Yes logit value.
87
+
88
+ Video-conditioned fill-in-the-blank task. Given a video and a sentence with a blank space, the task is to fill in the blank with the correct word from a vocabulary $\mathcal { A }$ of about 1K answers. We replace the blank in the sentence with a mask token, and design the following prompt:
89
+
90
+ Note that all prompts are prepended with the video prompt (see Section 3.1) before being forwarded to the transformer encoder.
91
+
92
+ Answer embedding module. For each downstream task, we wish to map the mask token in the input text prompt to an actual answer prediction in the set of possible answers $\mathcal { A }$ , as described above. For this we use the frozen MLM classifier head $m _ { \theta }$ . However, $m _ { \theta } \in \mathbb { R } ^ { V \times D }$ covers $V$ different tokens where $V > > N$ and $N \approx 1 , 0 0 0$ is the size of $\mathcal { A }$ . Therefore, we introduce a task-specific answer classification head $l$ which linearly maps a contextualized mask representation $t _ { i } ^ { \prime }$ to a vector of logits parameterizing a categorical distribution over the vocabulary $\mathcal { A }$ , i.e. $\boldsymbol { l } \in \mathbb { R } ^ { N \times D }$ . We set the weights of this answer module $l$ with the corresponding weights of the pretrained MLM classifier $m _ { \theta }$ for one-token answers. In the case of multi-token answers, we average the weights of their different tokens. We, hence, enable zero-shot inference at test time. We also discuss other alternative strategies to handle multi-token answers in the Supplementary Material.
93
+
94
+ Fully-supervised training. To evaluate our approach on fully-supervised benchmarks, we also explore finetuning of our model on datasets that provide manual annotations for the target task. To this end, we train the same parameters as explained in Section 3.2, while keeping the transformer weights and the answer embedding module frozen. For open-ended VideoQA and video-conditioned fill-in-theblank, we use a cross-entropy loss on the task-specific vocabulary $\mathcal { A }$ . For multiple-choice VideoQA, we use a binary cross-entropy loss applied to each answer candidate. We show in Section 4.5 the benefit of freezing the language model weights during fully-supervised training.
95
+
96
+ # 4 Experiments
97
+
98
+ This section demonstrates the benefits of our FrozenBiLM framework and compares our method to the state of the art. We first outline our experimental setup in Section 4.1. We then present ablation studies in Section 4.2. Next we compare our bidirectional framework to its autoregressive variant in Section 4.3. The comparison to the state of the art in zero-shot VideoQA and qualitative results are presented in Section 4.4. Finally, we finetune our model on the VideoQA task in Section 4.5, where we show few-shot and fully-supervised results.
99
+
100
+ # 4.1 Experimental setup
101
+
102
+ Frozen bidirectional language model. We use a tokenizer based on SentencePiece [41] with $V = 1 2 8$ , 000, and a bidirectional language model with 900M parameters, DeBERTa-V2-XLarge [25], trained with the MLM objective on a corpus of 160G text data. We also show how our approach generalizes to other MLM-pretrained bidirectional language models such as BERT [17] in Section 4.2.
103
+
104
+ Datasets. For training we use the publicly available WebVid10M dataset [6], which consists of 10 million of video-text pairs scraped from the Shutterstock website where video captions are obtained from readily-available alt-text descriptions. We evaluate results on eight downstream datasets covering a wide range of textual and video domains (e.g. GIFs, YouTube videos, TV shows, movies), and multiple VideoQA paradigms: open-ended VideoQA (iVQA [101], MSRVTTQA [98], MSVD-QA [98], ActivityNet-QA [108] and TGIF-QA FrameQA [32]), multiple-choice VideoQA (How2QA [54] and TVQA [46]) and video-conditioned fill-in-the-blank (LSMDC-Fillin-the-blank [66]). Unless stated otherwise, we report top-1 test accuracy using the original splits for training, validation and test. For How2QA, we report results on the public validation set for comparison with prior work [78, 101, 107]. For TVQA, we report results on the validation set for the ablation studies and on the hidden test set for the comparison to the state of the art. More details are included in the Supplementary Material.
105
+
106
+ Implementation Details. The training for 2 epochs on WebVid10M lasts 20 hours on 8 Tesla V100 GPUs. We give further details in the Supplementary Material.
107
+
108
+ # 4.2 Ablation studies
109
+
110
+ In this section, we evaluate the zero-shot performance of different variants of our method. By default, we use the frozen pretrained DeBERTa-V2-XLarge language model and train the visual-to-textprojection layer together with adapters for 2 epochs on WebVid10M. We refer to this default model as FrozenBiLM. This model uses three input modalities in terms of video, question, and speech.
111
+
112
+ <table><tr><td colspan="2">LM</td><td rowspan="2">Frozen</td><td rowspan="2">Adapters</td><td rowspan="2">Fill-in-the-blank</td><td colspan="5">Open-ended</td><td colspan="2">Multiple-choice</td></tr><tr><td>Pretraining</td><td>LM</td><td>LSMDC</td><td></td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td><td></td><td></td><td></td><td>How2QA TVQA</td></tr><tr><td>1.</td><td>X</td><td>X</td><td>X</td><td>0.5</td><td>0.3</td><td>0.1</td><td>0.0</td><td>0.5</td><td>0.0</td><td>32.4</td><td>20.7</td></tr><tr><td></td><td>√</td><td></td><td>×</td><td>37.1</td><td>21.0</td><td>17.6</td><td>31.9</td><td>20.7</td><td>30.7</td><td>45.7</td><td>45.6</td></tr><tr><td>2</td><td>√</td><td>×</td><td>X</td><td>50.7</td><td>27.3</td><td>16.8</td><td>32.2</td><td>24.7</td><td>41.0</td><td>53.5</td><td>53.4</td></tr><tr><td>4.</td><td>√</td><td>√</td><td>√</td><td>51.5</td><td>26.8</td><td>16.7</td><td>33.8</td><td>25.9</td><td>41.9</td><td>58.4</td><td>59.2</td></tr></table>
113
+
114
+ Table 1: The effect of initializing and training various parts of our model evaluated on zero-shot VideoQA. All models are trained on WebVid10M and use multi-modal inputs (video, speech and question) at inference.
115
+
116
+ <table><tr><td rowspan="2"></td><td rowspan="2">Visual</td><td rowspan="2">Speech</td><td rowspan="2">Fill-in-the-blank LSMDC</td><td colspan="5">Open-ended</td><td colspan="2">Multiple-choice</td></tr><tr><td>iVQA</td><td>MSRVTT-QA</td><td></td><td>MSVD-QA ActivityNet-QA</td><td>TGIF-QA</td><td>How2QA</td><td>TVQA</td></tr><tr><td>1.</td><td>X</td><td>X</td><td>47.9</td><td>11.0</td><td>6.4</td><td>11.3</td><td>22.6</td><td>32.3</td><td>29.6</td><td>23.2</td></tr><tr><td></td><td></td><td>√</td><td>49.8</td><td>13.2</td><td>6.5</td><td>11.7</td><td>23.1</td><td>32.3</td><td>45.9</td><td>44.1</td></tr><tr><td>2</td><td>X</td><td>X</td><td>50.9</td><td>26.2</td><td>16.9</td><td>33.7</td><td>25.9</td><td>41.9</td><td>41.9</td><td>29.7</td></tr><tr><td>4.</td><td>√</td><td>√</td><td>51.5</td><td>26.8</td><td>16.7</td><td>33.8</td><td>25.9</td><td>41.9</td><td>58.4</td><td>59.2</td></tr></table>
117
+
118
+ Table 2: Impact of the visual and speech modalities on zero-shot VideoQA. Rows 1 and 2 report results for a pretrained language model without any visual input. Rows 3 and 4 give results for a FrozenBiLM model pretrained on WebVid10M.
119
+
120
+ Ablation of the model training. We ablate the effect of initializing parameters of the language model, freezing its weights and training adapters in Table 1. We observe that the language model pretraining is crucial. Indeed, a model with randomly initialized language weights (row 1) performs poorly compared to models initialized with language pretrained weights (rows 2 to 4). Moreover, the model which updates the language model weights (row 2) during cross-modal training performs considerably worse compared to variants that freeze them (rows 3 and 4). This shows the benefit of freezing the language model for zero-shot VideoQA. We also notice the benefit of the adapter layers by comparing rows 3 and 4, especially for multiple-choice datasets. Finally, we note that training variants with the frozen language model is twice faster compared to updating all parameters, as there is a significantly lower number of parameters to be trained.
121
+
122
+ Impact of modalities. Table 2 shows the impact of the visual and speech modalities on the zero-shot performance of our model. First, we evaluate the text-only performance of our model using neither visual input nor speech input in row 1. We can observe that adding speech (row 2) marginally improves the results and that the importance of speech highly depends on the dataset. When adding vision (rows 3 and 4), the performance increases significantly, e.g. $+ 1 3 . 6 \%$ accuracy on iVQA and $+ 2 2 . 1 \%$ on MSVD-QA between rows 4 and 2. Finally, the model with vision also benefits from the speech, e.g. $+ 1 6 . 5 \%$ accuracy on How2QA and $+ 2 9 . 5 \%$ accuracy on TVQA (compare rows 3 and 4).
123
+
124
+ Note that in practice, speech is missing for many videos, as we obtain the speech directly from the YouTube API and many videos are no longer available. Exceptions are How2QA and TVQA for which the authors [46, 55] provide speech for all videos. Consequently, we have speech data for only $4 4 . 3 \%$ , $1 4 . 2 \%$ , $8 . 2 \%$ , $7 . 1 \%$ and $2 5 . 3 \%$ of test samples in LSMDC-FiB, iVQA, MSRVTT-QA, MSVD-QA and ActivityNet-QA respectively. GIFs in TGIF-QA do not contain speech.
125
+
126
+ Size of the cross-modal training dataset. Zero-shot results of FrozenBiLM after training for a fixed number of iterations on different fractions of WebVid10M are shown in Table 3. We construct these subsets such that larger subsets include the smaller ones. We find that performance increases monotonically with more multi-modal training data.
127
+
128
+ Size of the language model. In Table 4, we ablate the importance of the language model size for the zero-shot performance. Note that when comparing different language models, we use no adapters to avoid biases related to the choice of the bottleneck dimension hyperparameter [28]. We find that using the 900M-parameter DeBERTA-V2-XLarge (row 6) outperforms the 300M-parameter BERT-Large (row 5) which also improves over the 100M-parameter BERT-Base (row 4).
129
+
130
+ Table 3: Dependency on the size of the training set. Zero-shot results are presented for different fractions of the WebVid10M dataset used for training.
131
+
132
+ <table><tr><td></td><td>Training Data</td><td>MSVD-QA</td><td>How2QA</td></tr><tr><td>1.</td><td>WebVid1K</td><td>13.6</td><td>53.0</td></tr><tr><td>2.</td><td>WebVid10K</td><td>22.7</td><td>54.9</td></tr><tr><td>3.</td><td>WebVid200K</td><td>27.8</td><td>56.0</td></tr><tr><td>4.</td><td>WebVid2M</td><td>30.1</td><td>57.4</td></tr><tr><td>5.</td><td>WebVid10M</td><td>33.8</td><td>58.4</td></tr></table>
133
+
134
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Language Model</td><td colspan="2">#LM params Train timel</td><td colspan="5">iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td></tr><tr><td></td><td>(GPUH) 200</td><td></td><td>4.2</td><td>10.1</td><td>17.8</td><td>14.4</td></tr><tr><td rowspan="3"></td><td>1. GPT-Neo-1.3B Autoregressive 2.GPT-Neo-2.7B</td><td>1.3B 2.7B</td><td>360</td><td>6.6 9.1</td><td>7.7</td><td>17.8</td><td>17.4</td><td>20.1</td></tr><tr><td>3.GPT-J-6B</td><td>6B</td><td>820</td><td>21.4</td><td>9.6</td><td>26.7</td><td>24.5</td><td>37.3</td></tr><tr><td>4.BERT-Base</td><td>110M</td><td>24</td><td>12.4</td><td>6.4</td><td>11.7</td><td>16.7</td><td>23.1</td></tr><tr><td rowspan="3">Bidirectional</td><td></td><td>340M</td><td>60</td><td>12.9</td><td>7.1</td><td>13.0</td><td>19.0</td><td>21.5</td></tr><tr><td>5.BERT-Large</td><td></td><td></td><td>27.3</td><td>16.8</td><td>32.2</td><td>24.7</td><td>41.0</td></tr><tr><td>6.DeBERTa-V2-XLarge</td><td>890M</td><td>160</td><td></td><td></td><td></td><td></td><td></td></tr></table>
135
+
136
+ Table 4: Comparison of autoregressive language models (top) and bidirectional language models (bottom) for zero-shot VideoQA. All variants are trained on WebVid10M for the same number of epochs.
137
+
138
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Training Data</td><td rowspan="2">Speech</td><td>|Fill-in-the-blank|</td><td colspan="4">Open-ended</td><td colspan="2">Multiple-choice How2QATVQA</td></tr><tr><td>LSMDC</td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Random</td><td></td><td></td><td>0.1</td><td>0.1</td><td>0.1 0.1 7.2</td><td></td><td>0.1</td><td>0.1</td><td>20</td></tr><tr><td>CLIP ViT-L/14 [71] 400M image-textsX</td><td></td><td></td><td>1.2</td><td>9.2</td><td>2.1</td><td></td><td>1.2</td><td>3.6 47.7</td><td>26.1</td></tr><tr><td>Just Ask [102]</td><td>HowToVQA69M+ WebVidVQA3M</td><td>X</td><td></td><td>13.3</td><td>5.6</td><td>13.5</td><td>12.3</td><td></td><td></td></tr><tr><td>Reserve [110]</td><td>YT-Temporal-1B</td><td>X</td><td>31.0</td><td></td><td>5.8</td><td></td><td></td><td>53.1</td><td></td></tr><tr><td>FrozenBiLM(Ours) WebVid10M</td><td></td><td>X</td><td>50.9</td><td>26.2</td><td>16.9</td><td></td><td></td><td></td><td>29.7</td></tr><tr><td>FrozenBiLM(Ours)WebVid10M</td><td></td><td>√</td><td>51.5</td><td>26.8</td><td>33.7 16.7 33.8</td><td>25.9 25.9</td><td>41.9 41.9</td><td>41.9 58.4</td><td>59.7</td></tr></table>
139
+
140
+ Table 5: Comparison with the state of the art for zero-shot VideoQA.
141
+
142
+ Importance of the suffix. Our text input prompts include a suffix just to the right of the mask token which consists in a point and an end-of-sentence token for the variant without speech (or a point followed by the speech subtitles for the variant with speech). We found that removing this suffix leads to a considerable drop of performance (e.g. the test accuracy on MSVD-QA in the row 3 of Table 2 drops from $3 3 . 7 \%$ to $2 . 8 \%$ ). Note that we do not observe such a large drop in performance when removing the [CLS] token e.g. the accuracy on MSVD-QA drops only from $3 3 . 8 \%$ to $3 3 . 2 \%$ . This shows that the bidirectional nature of our framework is a key factor for the performance. Intuitively, this suffix forces the model to provide a concise answer. Such a hard constraint cannot be given to unidirectional autoregressive models compared next in Section 4.3. We further ablate the importance of the prompt design in the Supplementary Material.
143
+
144
+ # 4.3 Comparison with frozen autoregressive models
145
+
146
+ In this section, we compare our bidirectional framework using language models of various sizes to the larger, autoregressive GPT-based counterparts recently used for zero-shot image question answering [91, 104]. For fair comparison, we adapt autoregressive models to video and language inputs similarly as our bidirectional models. In detail, autoregressive variants train a similar visual-totext projection by using a left-to-right language modeling loss [91]. All models in our comparison are trained on WebVid10M for the same number of epochs. At inference, autoregressive variants use the same template as [91] to which we prepend speech subtitles, greedily decode sequences as [91], and use the same answer vocabulary as bidirectional models. Autoregressive variants select the top answer that maximizes the log-likelihood when appended to the question prompt. Here also, we use no adapters for all models, such that the architecture of autoregressive models closely follows [91]. This is to avoid biases related to the tuning of the bottleneck reduction hyperparameter in the adapters [28].
147
+
148
+ We compare autoregressive and bidirectional language models in terms of accuracy and efficiency in Table 4. We observe that our bidirectional framework (rows 4-6) achieves significantly better zero-shot performance-efficiency trade-off compared to its autoregressive counterpart (rows 1-3). For instance, our framework with BERT-Base [17] (row 4) outperforms the autoregressive variant based on GPT-Neo-1.3B [7] (row 1) which uses 12 times more parameters and 8 times more training time. Likewise, our framework with DeBERTa-V2-XLarge [25] (row 6) improves over the autoregressive variant based on GPT-J-6B [94] (row 3) that has 7 times more parameters and requires 5 times more training time, showing the efficiency of our bidirectional framework for zero-shot VideoQA.
149
+
150
+ # 4.4 Comparison to the state of the art for zero-shot VideoQA
151
+
152
+ Quantitative comparison. Table 5 presents results of our method in comparison to the state of the art in zero-shot VideoQA settings [101], i.e. when using no manually annotated visual data for training. Our approach outperforms previous methods by a significant margin on all 8 datasets. In
153
+
154
+ ![](images/b49b62f4806b31a8cbb7428319bfc2f97b769ef3bb39adaf999b69eb7f6c7442.jpg)
155
+
156
+ ![](images/94c2be5581307ef3dd7a4aa94a366db797ffef89c606b6a0d5dadadda100607b.jpg)
157
+
158
+ ![](images/ebb260bdef7892c31c6fe6a378ce2e8025b64d1a44e5ed8b738e222cc37bc540.jpg)
159
+
160
+ ![](images/665bbb654b07ca684b2cdf215cd247ac12e0b881c212e011c6270e4807b38481.jpg)
161
+
162
+ ![](images/48e0243ccbfb3d468d1ce1701aa0fff58d0e4816da8958e505398ad01558a32d.jpg)
163
+
164
+ Question: What is the man holding at the start of the video? GT Answer: guitar, electric guitar Just Ask: typewriter UnFrozenBiLM: beer FrozenBiLM (text-only): scissors FrozenBiLM (ours): guitar
165
+
166
+ Question: What item hanging on the wall features a tree? GT Answer: quilt Just Ask: christmas sock UnFrozenBiLM: fabric FrozenBiLM (text-only): tree FrozenBiLM (ours): quilt
167
+
168
+ Question: What is the sitting
169
+ man doing?
170
+ GT Answer: knit sweater
171
+ Just Ask: tie cow
172
+ UnFrozenBiLM: swimming
173
+ FrozenBiLM (text-only): eating
174
+ FrozenBiLM (ours): knit sweater
175
+ Question: Where is the woma
176
+ sitting on?
177
+ GT Answer: camel
178
+ Just Ask: horse yard
179
+ UnFrozenBiLM: desert
180
+ FrozenBiLM (text-only): chair
181
+ FrozenBiLM (ours): camel
182
+ Question: What is the color of the
183
+ cabinet door in the video?
184
+ GT Answer: red
185
+ Just Ask: dresser
186
+ UnFrozenBiLM: blue
187
+ FrozenBiLM (text-only): black
188
+ FrozenBiLM (ours): red
189
+
190
+ Figure 3: Zero-Shot VideoQA. Qualitative comparison between Just Ask [102] (row 3 in Table 5), our model (row 4 in Table 5), its unfrozen variant (row 2 in Table 1) and its text-only variant (row 2 in Table 2). The first two examples are from iVQA [101] and the last three examples are from ActivityNet-QA [108].
191
+
192
+ <table><tr><td rowspan="2">Method</td><td colspan="2">#Trained|Fill-in-the-blank|</td><td colspan="5">Open-ended</td><td colspan="2">Multiple-choice</td></tr><tr><td>Params</td><td>LSMDC</td><td></td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA|How2QA TVQA</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>HCRN [45]</td><td>44M</td><td></td><td></td><td>35.4</td><td>36.8</td><td></td><td>57.9</td><td></td><td>71.4*</td></tr><tr><td>HERO [54]</td><td>119M</td><td></td><td></td><td></td><td></td><td></td><td></td><td>74.1*</td><td>73.6*</td></tr><tr><td>ClipBERT[48]</td><td>114M</td><td></td><td></td><td>37.4</td><td></td><td></td><td>60.3</td><td></td><td></td></tr><tr><td>Just Ask [102]</td><td>157M</td><td></td><td>35.4</td><td>41.8</td><td>47.5</td><td>39.0</td><td></td><td>85.3</td><td></td></tr><tr><td>SiaSamRea [107]</td><td></td><td></td><td></td><td>41.6</td><td>45.5</td><td>39.8</td><td>60.2</td><td>84.1</td><td></td></tr><tr><td>MERLOT[109]</td><td>223M</td><td>52.9</td><td></td><td>43.1</td><td></td><td>41.4</td><td>69.5</td><td></td><td>78.7*</td></tr><tr><td>Reserve [110]</td><td>644M</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>86.1*</td></tr><tr><td>VIOLET[21]</td><td>198M</td><td>53.7</td><td></td><td>43.9</td><td>47.9</td><td></td><td>68.9</td><td></td><td></td></tr><tr><td>All-in-one [93]</td><td>110M</td><td></td><td></td><td>46.8</td><td>48.3</td><td></td><td>66.3</td><td></td><td></td></tr><tr><td>UnFrozenBiLM(Ours)</td><td>890M</td><td>58.9*</td><td>37.7*</td><td>45.0*</td><td>53.9*</td><td>43.2*</td><td>66.9</td><td>87.5*</td><td>79.6*</td></tr><tr><td>FrozenBiLM w/o speech (Ours) 30M</td><td></td><td>58.6</td><td>39.7</td><td>47.0</td><td>54.4</td><td>43.2</td><td>68.6</td><td>81.5</td><td>57.5</td></tr><tr><td>FrozenBiLM(Ours)</td><td>30M</td><td>63.5*</td><td>39.6*</td><td>47.0*</td><td>54.8*</td><td>43.2*</td><td>68.6</td><td>86.7*</td><td>82.0*</td></tr></table>
193
+
194
+ Table 6: Comparison with the state of the art, and the variant UnFrozenBiLM which does not freeze the language model weight, on fully-supervised benchmarks. \* denotes results obtained with speech input.
195
+
196
+ <table><tr><td rowspan="2">Supervision</td><td rowspan="2"></td><td rowspan="2">Fill-in-the-blank LSMDC</td><td colspan="4">Open-ended</td><td rowspan="2">Multiple-choice</td></tr><tr><td></td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td><td></td><td>How2QA TVQA</td></tr><tr><td>1.</td><td>0% (zero-shot)</td><td>51.5</td><td>26.8</td><td>16.7 33.8</td><td>25.9</td><td>41.9</td><td>58.4</td><td>59.7</td></tr><tr><td>2.</td><td>1% (few-shot)</td><td>56.9</td><td>31.1</td><td>36.0</td><td>46.5</td><td>33.2 55.1</td><td>71.7</td><td>72.5</td></tr><tr><td>3.</td><td>10% (few-shot)</td><td>59.9</td><td>35.3</td><td>41.7</td><td>51.0</td><td>37.4</td><td>61.2 75.8</td><td>77.6</td></tr><tr><td></td><td>4.100% (fully-supervised)</td><td>63.5</td><td>39.6</td><td>47.0</td><td>54.8</td><td>43.2</td><td>68.6 86.7</td><td>82.0</td></tr></table>
197
+
198
+ Table 7: Few-shot results, by finetuning FrozenBiLM using a small fraction of the downstream training dataset.
199
+
200
+ particular, FrozenBiLM outperforms Reserve [110], which is trained on one billion YouTube video clips jointly with vision, language and sound, Just Ask [102], which uses large-scale automatically generated VideoQA data, and a CLIP baseline [71] matching the text concatenating question and answer to the middle frame of the video. Note that FrozenBiLM performs competitively even when using no speech input. Finally, we note that BLIP [53] has a different definition of zero-shot where a network finetuned on the image-VQA dataset [4] is evaluated directly on VideoQA datasets. Our Supplementary Material presents results where we outperform BLIP [53] in their settings and also includes an analysis of results by question type. In summary, our evaluation shows the excellent performance of our model in the challenging zero-shot setup.
201
+
202
+ Qualitative results. Figure 3 illustrates qualitative results of zero-shot VideoQA for our FrozenBiLM model and compares them to Just Ask [102], as well as to variants of our approach that do not freeze the language model (UnFrozenBiLM) and use no visual modality (text-only), as evaluated in Section 4.2. We observe that the unfrozen variant can predict answers that lack text-only commonsense reasoning, e.g. in the third example, it is unlikely that a sitting man is swimming. The text-only variant does have strong language understanding, but makes visually-unrelated predictions. In contrast, consistently with our quantitative results, our model FrozenBiLM is able to correctly answer various questions, showing both a strong textual commonsense reasoning and a complex multi-modal understanding. We show additional qualitative results in the Supplementary Material.
203
+
204
+ # 4.5 Freezing the BiLM is also beneficial in supervised settings
205
+
206
+ Fully-supervised VideoQA. We next present an evaluation in a supervised setup where we finetune FrozenBiLM on a downstream VideoQA task. We emphasize that we also keep our pretrained language model weights frozen all throughout finetuning. As shown in Table 6, our approach improves the state of the art on LSMDC-FiB, iVQA, MSRVTT-QA, MSVD-QA, ActivityNet-QA and How2QA. In particular, FrozenBiLM outperforms strong recent baselines such as All-in-one [93] on 2/3 datasets, VIOLET [21] on 3/4 datasets and MERLOT [109] on 4/5 datasets. Our approach has significantly less trainable parameters compared to the state of the art [21, 93, 109] as we freeze the weights of the pretrained language model. We ablate this major difference in Table 6, and find that our FrozenBiLM with the frozen language model performs better and trains twice faster compared to UnFrozenBiLM where we update the language model during training. This shows that freezing the language model is not only beneficial for zero-shot but also in fully-supervised settings, therefore suggesting that our FrozenBiLM framework also provides a parameter-efficient solution for VideoQA training. Finally, we note that FrozenBiLM performs competitively even without speech input, although speech helps significantly for the performance on LSMDC, How2QA and TVQA.
207
+
208
+ Few-shot VideoQA. The low number of trainable parameters when training FrozenBiLM makes it particularly well-suited in the low data regime. To verify this, we explore a few-shot VideoQA setting where we finetune our pretrained model using varying fractions of VideoQA training data. From Table 7 we observe significant improvements over zero-shot when using only $1 \%$ of training data. Finally, we show in Supplementary Material that freezing the BiLM highly benefits the few-shot performance, consistently with the results in the zero-shot and fully-supervised settings.
209
+
210
+ # 5 Conclusion
211
+
212
+ We have presented FrozenBiLM, a framework that extends frozen bidirectional language models to multi-modal inputs by training additional modules on Web-scraped data, and that tackles zero-shot VideoQA through masked language modeling. We have provided extensive ablation studies and shown the efficiency of our framework compared to its autoregressive variant. FrozenBiLM improves the state-of-the-art zero-shot VideoQA on various datasets, performs competitively in fully-supervised settings and exhibits strong performance in the few-shot VideoQA setting we newly introduce.
213
+
214
+ Limitations. Promising directions not explored in this work include scaling the size of a bidirectional language model to several billion parameters, and additional training on large datasets of YouTube videos with accompanying speech transcripts and/or audio [110]. Also, our model cannot be applied out-of-the-box to complex multi-modal text generation tasks such as video captioning.
215
+
216
+ Broader Impact. We have showed the superior compute-efficiency of our bidirectional framework compared to autoregressive models for zero-shot VideoQA, and believe it is a step towards reducing the environmental impact of such research and its applications [84]. In addition, our models might reflect biases present in videos and captions from Shutterstock used to train our model, the text data used to train the language model or the images and captions used to train the visual backbone. It is important to keep this in mind when deploying, analysing and building upon these models.
217
+
218
+ Acknowledgements. This work was granted access to the HPC resources of IDRIS under the allocation 2022-AD011011670R2 made by GENCI. The work was funded by a Google gift, the French government under management of Agence Nationale de la Recherche as part of the "Investissements d’avenir" program, reference ANR-19-P3IA-0001 (PRAIRIE 3IA Institute), the Louis Vuitton ENS Chair on Artificial Intelligence, the European Regional Development Fund under project IMPACT (reg. no. CZ.02.1.01/0.0/0.0/15 003/0000468). We thank anonymous reviewers for giving interesting feedback. We thank Gaspard Beugnot, Clémence Bouvier and Pierre-Louis Guhur for proofreading.
219
+
220
+ References [1] FrozenBiLM project webpage. https://antoyang.github.io/frozenbilm.html. [2] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. In NeurIPS, 2022. [3] Elad Amrani, Rami Ben-Ari, Daniel Rotman, and Alex Bronstein. Noise estimation using density estimation for self-supervised multimodal learning. In AAAI, 2021. [4] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. VQA: Visual question answering. In ICCV, 2015. [5] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. [6] Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. Frozen in time: A joint video and image encoder for end-to-end retrieval. In ICCV, 2021. [7] Sid Black, Gao Leo, Phil Wang, Connor Leahy, and Stella Biderman. GPT-Neo: Large Scale Autoregressive Language Modeling with Mesh-Tensorflow, 2021. [8] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020. [9] Santiago Castro, Mahmoud Azab, Jonathan Stroud, Cristina Noujaim, Ruoyao Wang, Jia Deng, and Rada Mihalcea. LifeQA: A real-life dataset for video question answering. In LREC, 2020.
221
+ [10] Aman Chadha, Gurneet Arora, and Navpreet Kaloty. iPerceive: Applying common-sense reasoning to multi-modal dense video captioning and video question answering. In WACV, 2021.
222
+ [11] Jun Chen, Han Guo, Kai Yi, Boyang Li, and Mohamed Elhoseiny. VisualGPT: Dataefficient adaptation of pretrained language models for image captioning. arXiv preprint arXiv:2102.10407, 2021.
223
+ [12] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. UNITER: Universal image-text representation learning. In ECCV, 2020.
224
+ [13] Seongho Choi, Kyoung-Woon On, Yu-Jung Heo, Ahjeong Seo, Youwon Jang, Seungchan Lee, Minsu Lee, and Byoung-Tak Zhang. DramaQA: Character-centered video story understanding with hierarchical qa. In AAAI, 2021.
225
+ [14] Anthony Colas, Seokhwan Kim, Franck Dernoncourt, Siddhesh Gupte, Daisy Zhe Wang, and Doo Soon Kim. TutorialVQA: Question answering dataset for tutorial videos. In LREC, 2020.
226
+ [15] Long Hoang Dang, Thao Minh Le, Vuong Le, and Truyen Tran. Object-centric representation learning for video question answering. In IJCNN, 2021.
227
+ [16] Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, ˆ Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. IEEE TPAMI, 2021.
228
+ [17] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019.
229
+ [18] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
230
+ [19] Constantin Eichenberg, Sidney Black, Samuel Weinbach, Letitia Parcalabescu, and Anette Frank. MAGMA–multimodal augmentation of generative models through adapter-based finetuning. arXiv preprint arXiv:2112.05253, 2021.
231
+ [20] Chenyou Fan, Xiaofan Zhang, Shu Zhang, Wensheng Wang, Chi Zhang, and Heng Huang. Heterogeneous memory enhanced multimodal attention model for video question answering. In CVPR, 2019.
232
+ [21] Tsu-Jui Fu, Linjie Li, Zhe Gan, Kevin Lin, William Yang Wang, Lijuan Wang, and Zicheng Liu. VIOLET: End-to-end video-language transformers with masked visual-token modeling. arXiv preprint arXiv:2111.12681, 2021.
233
+ [22] Zhe Gan, Yen-Chun Chen, Linjie Li, Chen Zhu, Yu Cheng, and Jingjing Liu. Large-scale adversarial training for vision-and-language representation learning. In NeurIPS, 2020.
234
+ [23] Jiyang Gao, Runzhou Ge, Kan Chen, and Ram Nevatia. Motion-appearance co-memory networks for video question answering. In CVPR, 2018.
235
+ [24] Noa Garcia, Mayu Otani, Chenhui Chu, and Yuta Nakashima. KnowIT VQA: Answering knowledge-based questions about videos. In AAAI, 2020.
236
+ [25] Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. DeBERTa: Decodingenhanced BERT with disentangled attention. In ICLR, 2021.
237
+ [26] Lisa Anne Hendricks, John Mellor, Rosalia Schneider, Jean-Baptiste Alayrac, and Aida Nematzadeh. Decoupling the role of data, attention, and losses in multimodal transformers. In TACL, 2021.
238
+ [27] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022.
239
+ [28] Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In ICML, 2019.
240
+ [29] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In ICLR, 2022.
241
+ [30] Deng Huang, Peihao Chen, Runhao Zeng, Qing Du, Mingkui Tan, and Chuang Gan. Locationaware graph convolutional networks for video question answering. In AAAI, 2020.
242
+ [31] Zhicheng Huang, Zhaoyang Zeng, Bei Liu, Dongmei Fu, and Jianlong Fu. Pixel-BERT: Aligning image pixels with text by deep multi-modal transformers. arXiv preprint arXiv:2004.00849, 2020.
243
+ [32] Yunseok Jang, Yale Song, Youngjae Yu, Youngjin Kim, and Gunhee Kim. TGIF-QA: Toward spatio-temporal reasoning in visual question answering. In CVPR, 2017.
244
+ [33] Jianwen Jiang, Ziqiang Chen, Haojie Lin, Xibin Zhao, and Yue Gao. Divide and conquer: Question-guided spatio-temporal contextual attention for video question answering. In AAAI, 2020.
245
+ [34] Pin Jiang and Yahong Han. Reasoning with heterogeneous graph alignment for video question answering. In AAAI, 2020.
246
+ [35] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. SpanBERT: Improving pre-training by representing and predicting spans. In TACL, 2020.
247
+ [36] Hyounghun Kim, Zineng Tang, and Mohit Bansal. Dense-caption matching and frame-selection gating for temporal localization in VideoQA. In ACL, 2020.
248
+ [37] Junyeong Kim, Minuk Ma, Trung Pham, Kyungsu Kim, and Chang D Yoo. Modality shifting attention network for multi-modal video question answering. In CVPR, 2020.
249
+ [38] Kyung-Min Kim, Min-Oh Heo, Seong-Ho Choi, and Byoung-Tak Zhang. Deepstory: Video story qa by deep embedded memory networks. In IJCAI, 2017.
250
+ [39] Seonhoon Kim, Seohyeong Jeong, Eunbyul Kim, Inho Kang, and Nojun Kwak. Self-supervised pre-training and contrastive representation learning for multiple-choice video qa. In AAAI, 2021.
251
+ [40] Wonjae Kim, Bokyung Son, and Ildoo Kim. ViLT: Vision-and-language transformer without convolution or region supervision. In ICML, 2021.
252
+ [41] Taku Kudo and John Richardson. Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In ACL, 2018.
253
+ [42] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A lite BERT for self-supervised learning of language representations. In ICLR, 2020.
254
+ [43] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Hierarchical conditional relation networks for video question answering. In CVPR, 2020.
255
+ [44] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Neural reasoning, fast and slow, for video question answering. In IJCNN, 2020.
256
+ [45] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Hierarchical conditional relation networks for multimodal video question answering. In IJCV, 2021.
257
+ [46] Jie Lei, Licheng Yu, Mohit Bansal, and Tamara L Berg. TVQA: Localized, compositional video question answering. In EMNLP, 2018.
258
+ [47] Jie Lei, Licheng Yu, Tamara L Berg, and Mohit Bansal. TVQA $^ +$ : Spatio-temporal grounding for video question answering. In ACL, 2020.
259
+ [48] Jie Lei, Linjie Li, Luowei Zhou, Zhe Gan, Tamara L Berg, Mohit Bansal, and Jingjing Liu. Less is more: ClipBERT for video-and-language learning via sparse sampling. In CVPR, 2021.
260
+ [49] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In EMNLP, 2021.
261
+ [50] Dongxu Li, Junnan Li, Hongdong Li, Juan Carlos Niebles, and Steven CH Hoi. Align and prompt: Video-and-language pre-training with entity prompts. arXiv preprint arXiv:2112.09583, 2021.
262
+ [51] Gen Li, Nan Duan, Yuejian Fang, Ming Gong, Daxin Jiang, and Ming Zhou. Unicoder-VL: A universal encoder for vision and language by cross-modal pre-training. In AAAI, 2020.
263
+ [52] Junnan Li, Ramprasaath Selvaraju, Akhilesh Gotmare, Shafiq Joty, Caiming Xiong, and Steven Chu Hong Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, 2021.
264
+ [53] Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. BLIP: Bootstrapping languageimage pre-training for unified vision-language understanding and generation. arXiv preprint arXiv:2201.12086, 2022.
265
+ [54] Linjie Li, Yen-Chun Chen, Yu Cheng, Zhe Gan, Licheng Yu, and Jingjing Liu. HERO: Hierarchical encoder for video+language omni-representation pre-training. In EMNLP, 2020.
266
+ [55] Linjie Li, Jie Lei, Zhe Gan, Licheng Yu, Yen-Chun Chen, Rohit Pillai, Yu Cheng, Luowei Zhou, Xin Eric Wang, William Yang Wang, et al. VALUE: A multi-task benchmark for video-and-language understanding evaluation. In NeurIPS Track on Datasets and Benchmarks, 2021.
267
+ [56] Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. VisualBERT: A simple and performant baseline for vision and language. arXiv preprint arXiv:1908.03557, 2019.
268
+ [57] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In ACL, 2021.
269
+ [58] Xiangpeng Li, Jingkuan Song, Lianli Gao, Xianglong Liu, Wenbing Huang, Xiangnan He, and Chuang Gan. Beyond RNNs: Positional self-attention with co-attention for video question answering. In AAAI, 2019.
270
+ [59] Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In ECCV, 2020.
271
+ [60] Xudong Lin, Gedas Bertasius, Jue Wang, Shih-Fu Chang, Devi Parikh, and Lorenzo Torresani. VX2TEXT: End-to-end learning of video-based text generation from multimodal inputs. In CVPR, 2021.
272
+ [61] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
273
+ [62] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In NeurIPS, 2019.
274
+ [63] Jiasen Lu, Vedanuj Goswami, Marcus Rohrbach, Devi Parikh, and Stefan Lee. 12-in-1: Multi-task vision and language representation learning. In CVPR, 2020.
275
+ [64] Ziyang Luo, Yadong Xi, Rongsheng Zhang, and Jing Ma. VC-GPT: Visual conditioned GPT for end-to-end generative vision-and-language pre-training. arXiv preprint arXiv:2201.12723, 2022.
276
+ [65] Rabeeh Karimi Mahabadi, Luke Zettlemoyer, James Henderson, Marzieh Saeidi, Lambert Mathias, Veselin Stoyanov, and Majid Yazdani. PERFECT: Prompt-free and efficient few-shot learning with language models. In ACL, 2022.
277
+ [66] Tegan Maharaj, Nicolas Ballas, Anna Rohrbach, Aaron Courville, and Christopher Pal. A dataset and exploration of models for understanding video data through fill-in-the-blank question-answering. In CVPR, 2017.
278
+ [67] Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, and Josef Sivic. HowTo100M: Learning a text-video embedding by watching hundred million narrated video clips. In ICCV, 2019.
279
+ [68] Ron Mokady, Amir Hertz, and Amit H Bermano. ClipCap: Clip prefix for image captioning. arXiv preprint arXiv:2111.09734, 2021.
280
+ [69] Jonghwan Mun, Paul Hongsuck Seo, Ilchae Jung, and Bohyung Han. MarioQA: Answering questions by watching gameplay videos. In CVPR, 2017.
281
+ [70] Jungin Park, Jiyoung Lee, and Kwanghoon Sohn. Bridge to answer: Structure-aware graph interaction network for video question answering. In CVPR, 2021.
282
+ [71] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
283
+ [72] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 2020.
284
+ [73] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016.
285
+ [74] Arka Sadhu, Kan Chen, and Ram Nevatia. Video question answering with phrases via semantic roles. In NAACL, 2021.
286
+ [75] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
287
+ [76] Timo Schick and Hinrich Schütze. Exploiting cloze questions for few shot text classification and natural language inference. In EACL, 2021.
288
+ [77] Timo Schick and Hinrich Schütze. It’s not just size that matters: Small language models are also few-shot learners. In NAACL, 2021.
289
+ [78] Paul Hongsuck Seo, Arsha Nagrani, and Cordelia Schmid. Look before you speak: Visually contextualized utterances. In CVPR, 2021.
290
+ [79] Paul Hongsuck Seo, Arsha Nagrani, Anurag Arnab, and Cordelia Schmid. End-to-end generative pretraining for multimodal video captioning. In CVPR, 2022.
291
+ [80] Sheng Shen, Liunian Harold Li, Hao Tan, Mohit Bansal, Anna Rohrbach, Kai-Wei Chang, Zhewei Yao, and Kurt Keutzer. How much can clip benefit vision-and-language tasks? arXiv preprint arXiv:2107.06383, 2021.
292
+ [81] Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. Flava: A foundational language and vision alignment model. In CVPR, 2022.
293
+ [82] David R So, Wojciech Manke, Hanxiao Liu, Zihang Dai, Noam Shazeer, and Quoc V ´ Le. Primer: Searching for efficient transformers for language modeling. arXiv preprint arXiv:2109.08668, 2021.
294
+ [83] Xiaomeng Song, Yucheng Shi, Xin Chen, and Yahong Han. Explore multi-step reasoning in video question answering. In ACM international conference on Multimedia, 2018.
295
+ [84] Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. In ACL, 2019.
296
+ [85] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. VL-BERT: Pre-training of generic visual-linguistic representations. In ICLR, 2019.
297
+ [86] Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. VideoBERT: A joint model for video and language representation learning. In ICCV, 2019.
298
+ [87] Derek Tam, Rakesh R Menon, Mohit Bansal, Shashank Srivastava, and Colin Raffel. Improving and simplifying pattern exploiting training. In EMNLP, 2021.
299
+ [88] Hao Tan and Mohit Bansal. LXMERT: Learning cross-modality encoder representations from transformers. In EMNLP, 2019.
300
+ [89] Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. MovieQA: Understanding stories in movies through question-answering. In CVPR, 2016.
301
+ [90] Wilson L Taylor. “cloze procedure”: A new tool for measuring readability. Journalism quarterly, 30(4):415–433, 1953.
302
+ [91] Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. In NeurIPS, 2021.
303
+ [92] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
304
+ [93] Alex Jinpeng Wang, Yixiao Ge, Rui Yan, Yuying Ge, Xudong Lin, Guanyu Cai, Jianping Wu, Ying Shan, Xiaohu Qie, and Mike Zheng Shou. All in one: Exploring unified video-language pre-training. arXiv preprint arXiv:2203.07303, 2022.
305
+ [94] Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model, 2021.
306
+ [95] Jianfeng Wang, Xiaowei Hu, Zhe Gan, Zhengyuan Yang, Xiyang Dai, Zicheng Liu, Yumao Lu, and Lijuan Wang. UFO: A unified transformer for vision-language representation learning. arXiv preprint arXiv:2111.10023, 2021.
307
+ [96] Zhenhailong Wang, Manling Li, Ruochen Xu, Luowei Zhou, Jie Lei, Xudong Lin, Shuohang Wang, Ziyi Yang, Chenguang Zhu, Derek Hoiem, et al. Language models with image descriptors are strong few-shot video-language learners. In NeurIPS, 2022.
308
+ [97] Junbin Xiao, Xindi Shang, Angela Yao, and Tat-Seng Chua. NExT-QA: Next phase of question-answering to explaining temporal actions. In CVPR, 2021.
309
+ [98] Dejing Xu, Zhou Zhao, Jun Xiao, Fei Wu, Hanwang Zhang, Xiangnan He, and Yueting Zhuang. Video question answering via gradually refined attention over appearance and motion. In ACM international conference on Multimedia, 2017.
310
+ [99] Hu Xu, Gargi Ghosh, Po-Yao Huang, Dmytro Okhonko, Armen Aghajanyan, Florian Metze, Luke Zettlemoyer, and Christoph Feichtenhofer. Videoclip: Contrastive pre-training for zero-shot video-text understanding. In EMNLP, 2021.
311
+ [100] Hongyang Xue, Wenqing Chu, Zhou Zhao, and Deng Cai. A better way to attend: Attention with trees for video question answering. IEEE Transactions on Image Processing, 2018.
312
+ [101] Antoine Yang, Antoine Miech, Josef Sivic, Ivan Laptev, and Cordelia Schmid. Just ask: Learning to answer questions from millions of narrated videos. In ICCV, 2021.
313
+ [102] Antoine Yang, Antoine Miech, Josef Sivic, Ivan Laptev, and Cordelia Schmid. Learning to answer visual questions from web videos. IEEE TPAMI, 2022.
314
+ [103] Zekun Yang, Noa Garcia, Chenhui Chu, Mayu Otani, Yuta Nakashima, and Haruo Takemura. BERT representations for video question answering. In WACV, 2020.
315
+ [104] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Yumao Lu, Zicheng Liu, and Lijuan Wang. An empirical study of GPT-3 for few-shot knowledge-based VQA. arXiv preprint arXiv:2109.05014, 2021.
316
+ [105] Yunan Ye, Zhou Zhao, Yimeng Li, Long Chen, Jun Xiao, and Yueting Zhuang. Video question answering via attribute-augmented attention network learning. In ACM SIGIR, 2017.
317
+ [106] Fei Yu, Jiji Tang, Weichong Yin, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. Ernie-vil: Knowledge enhanced vision-language representations through scene graph. In AAAI, 2020.
318
+ [107] Weijiang Yu, Haoteng Zheng, Mengfei Li, Lei Ji, Lijun Wu, Nong Xiao, and Nan Duan. Learning from inside: Self-driven siamese sampling and reasoning for video question answering. In NeurIPS, 2021.
319
+ [108] Zhou Yu, Dejing Xu, Jun Yu, Ting Yu, Zhou Zhao, Yueting Zhuang, and Dacheng Tao. ActivityNet-QA: A dataset for understanding complex web videos via question answering. In AAAI, 2019.
320
+ [109] Rowan Zellers, Ximing Lu, Jack Hessel, Youngjae Yu, Jae Sung Park, Jize Cao, Ali Farhadi, and Yejin Choi. MERLOT: Multimodal neural script knowledge models. In NeurIPS, 2021.
321
+ [110] Rowan Zellers, Jiasen Lu, Ximing Lu, Youngjae Yu, Yanpeng Zhao, Mohammadreza Salehi, Aditya Kusupati, Jack Hessel, Ali Farhadi, and Yejin Choi. MERLOT Reserve: Neural script knowledge through vision and language and sound. In CVPR, 2022.
322
+ [111] Andy Zeng, Adrian Wong, Stefan Welker, Krzysztof Choromanski, Federico Tombari, Aveek Purohit, Michael Ryoo, Vikas Sindhwani, Johnny Lee, Vincent Vanhoucke, et al. Socratic models: Composing zero-shot multimodal reasoning with language. arXiv preprint arXiv:2204.00598, 2022.
323
+ [112] Zheng-Jun Zha, Jiawei Liu, Tianhao Yang, and Yongdong Zhang. Spatiotemporal-textual coattention network for video question answering. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 2019.
324
+ [113] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. arXiv preprint arXiv:2109.01134, 2021.
325
+ [114] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason J Corso, and Jianfeng Gao. Unified vision-language pre-training for image captioning and VQA. In AAAI, 2020.
326
+ [115] Linchao Zhu and Yi Yang. ActBERT: Learning global-local video-text representations. In CVPR, 2020.
327
+ [116] Yueting Zhuang, Dejing Xu, Xin Yan, Wenzhuo Cheng, Zhou Zhao, Shiliang Pu, and Jun Xiao. Multichannel attention refinement for video question answering. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 2020.
328
+
329
+ # Checklist
330
+
331
+ 1. For all authors...
332
+
333
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Section 3 for contribution (i), Sections 4.2 and 4.3 for contribution (ii), and Sections 4.4 and 4.5 for contribution (iii).
334
+ (b) Did you describe the limitations of your work? [Yes] See Section 5.
335
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5.
336
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
337
+
338
+ 2. If you are including theoretical results...
339
+
340
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] No theoretical results. (b) Did you include complete proofs of all theoretical results? [N/A] No theoretical results.
341
+
342
+ 3. If you ran experiments...
343
+
344
+ (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] Our code, together with instructions needed to download and process the datasets we use, and instructions needed to reproduce the main experimental results, is open-sourced at [1].
345
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1 and Supplementary Material.
346
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We report them in the Supplementary Material, as error bars are in general not reported [101, 107, 109, 110].
347
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1 and Supplementary Material.
348
+
349
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
350
+
351
+ (a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4.1.
352
+ (b) Did you mention the license of the assets? [Yes] See Supplementary Material.
353
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We provide code and trained models at [1].
354
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] The datasets we use are publicly available and released for non-commercial use only, and this is already specified in the license.
355
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] The datasets we use are based on websites such as YouTube which strictly remove videos that contain offensive content or do not follow their community guidelines.
356
+
357
+ 5. If you used crowdsourcing or conducted research with human subjects...
358
+
359
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] No crowdsourcing or conducted research with human subjects.
360
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] No crowdsourcing or conducted research with human subjects.
361
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] No crowdsourcing or conducted research with human subjects.
parse/dev/9uRS5ysgb9/9uRS5ysgb9_content_list.json ADDED
@@ -0,0 +1,1296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Zero-Shot Video Question Answering via Frozen Bidirectional Language Models ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 251,
8
+ 122,
9
+ 746,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Antoine $\\mathbf { Y a n g ^ { 1 , 2 } }$ , Antoine Miech3, Josef Sivic4, Ivan Laptev1,2, Cordelia Schmid1,2 \n1Inria Paris 2Département d’informatique de l’ENS, CNRS, PSL Research University 3DeepMind 4CIIRC CTU Prague https://antoyang.github.io/frozenbilm.html ",
17
+ "bbox": [
18
+ 205,
19
+ 224,
20
+ 789,
21
+ 284
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 319,
32
+ 535,
33
+ 335
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Video question answering (VideoQA) is a complex task that requires diverse multimodal data for training. Manual annotation of questions and answers for videos, however, is tedious and prohibits scalability. To tackle this problem, recent methods consider zero-shot settings with no manual annotation of visual question-answer. In particular, a promising approach adapts frozen autoregressive language models pretrained on Web-scale text-only data to multi-modal inputs. In contrast, we here build on frozen bidirectional language models (BiLM) and show that such an approach provides a stronger and cheaper alternative for zero-shot VideoQA. In particular, (i) we combine visual inputs with the frozen BiLM using light trainable modules, (ii) we train such modules using Web-scraped multi-modal data, and finally (iii) we perform zero-shot VideoQA inference through masked language modeling, where the masked text is the answer to a given question. Our proposed approach, FrozenBiLM, outperforms the state of the art in zero-shot VideoQA by a significant margin on a variety of datasets, including LSMDC-FiB, iVQA, MSRVTT-QA, MSVD-QA, ActivityNet-QA, TGIF-FrameQA, How2QA and TVQA. It also demonstrates competitive performance in the few-shot and fully-supervised setting. Our code and models are publicly available at [1]. ",
40
+ "bbox": [
41
+ 233,
42
+ 349,
43
+ 766,
44
+ 583
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "image",
50
+ "img_path": "images/5b922eb945c16caa4b7b44122af383f9a3345e9882c5cc2a8e9966a3f8398918.jpg",
51
+ "image_caption": [
52
+ "Figure 1: Our model FrozenBiLM builds on a pretrained and frozen bidirectional language model (BiLM), and is trained from Web-scraped video-caption pairs. FrozenBiLM excels in the zero-shot video question answering task without using any explicit visual question-answer supervision. "
53
+ ],
54
+ "image_footnote": [],
55
+ "bbox": [
56
+ 176,
57
+ 611,
58
+ 818,
59
+ 700
60
+ ],
61
+ "page_idx": 0
62
+ },
63
+ {
64
+ "type": "text",
65
+ "text": "1 Introduction ",
66
+ "text_level": 1,
67
+ "bbox": [
68
+ 174,
69
+ 779,
70
+ 310,
71
+ 796
72
+ ],
73
+ "page_idx": 0
74
+ },
75
+ {
76
+ "type": "text",
77
+ "text": "Video question answering (VideoQA) is a challenging task that requires fine-grained multi-modal understanding. State-of-the-art approaches to VideoQA [43, 107, 109] rely on large video datasets manually annotated with question-answer pairs. Yet, collecting such annotations is time consuming, expensive and therefore not scalable. This has motivated the development of zero-shot VideoQA approaches [101, 102, 110], that use no visual question-answer annotation for training, see Figure 1. ",
78
+ "bbox": [
79
+ 174,
80
+ 810,
81
+ 825,
82
+ 880
83
+ ],
84
+ "page_idx": 0
85
+ },
86
+ {
87
+ "type": "text",
88
+ "text": "Recently, a promising line of work builds on frozen large autoregressive language models [19, 68, 91, 96, 104, 111] for zero-shot visual question answering. This has been motivated by the findings from GPT-3 [8] which exhibits strong zero-shot text-only question answering abilities from large autoregressive language models. Such models [8, 72, 82, 92] can predict an arbitrarily long sequence of text, one token at each step from left to right. However, they usually require billion parameters to work well, making them computationally expensive to train, and challenging to deploy in practice. ",
89
+ "bbox": [
90
+ 174,
91
+ 92,
92
+ 825,
93
+ 174
94
+ ],
95
+ "page_idx": 1
96
+ },
97
+ {
98
+ "type": "text",
99
+ "text": "In contrast, recent work in natural language [65, 76, 77, 87] demonstrates strong zero-shot performance for lighter bidirectional language models (BiLM). Such models [17, 25, 35, 42, 61, 75] can predict a few masked tokens in an input sequence given left and right context in a single forward pass. These works cast downstream tasks in cloze form1 [90], similar to the masked language modeling task (MLM) [17] solved by these models at pretraining. This motivates us to tackle diverse zero-shot multimodal tasks (open-ended VideoQA [98], multiple-choice VideoQA [46] and fill-in-the-blank [66]) by formulating them in cloze form and leveraging the text-only knowledge of pretrained BiLM. ",
100
+ "bbox": [
101
+ 174,
102
+ 181,
103
+ 825,
104
+ 279
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "To adapt a pretrained BiLM to multi-modal inputs, we combine it with a frozen pretrained visual backbone and a set of lightweight additional modules including adapters [28]. We train these modules on Web-scraped video-text data using a simple visually-conditioned MLM loss. We preserve the uni-modal knowledge of a BiLM by freezing its weights. To our knowledge, our approach is the first to explore the zero-shot visual-linguistic capabilities of frozen non-autoregressive language models. ",
111
+ "bbox": [
112
+ 174,
113
+ 284,
114
+ 825,
115
+ 353
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "We show that our approach largely improves the state of the art on various zero-shot VideoQA benchmarks. Furthermore, we demonstrate that frozen bidirectional language models perform better while being cheaper to train than frozen autoregressive language models [91]. Moreover, our ablation studies show (i) the ability of our model to effectively perform zero-shot multi-modal reasoning using both visual cues and speech transcripts, (ii) the importance of adapters combined with frozen pretrained language models, (iii) the impact of multi-modal data scale, (iv) the impact of the language model size and of bidirectional modeling. Our approach also performs competitively in the fullysupervised setting. Indeed, we show the benefits of freezing the weights of a BiLM when using VideoQA training data, while updating considerably less parameters compared to alternative methods. Finally, we introduce a new few-shot VideoQA task in which we finetune our pretrained model on a small fraction of the downstream training dataset, and show promising results in this setting. ",
122
+ "bbox": [
123
+ 174,
124
+ 359,
125
+ 825,
126
+ 512
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "In summary, our contributions are three-fold: ",
133
+ "bbox": [
134
+ 173,
135
+ 518,
136
+ 470,
137
+ 532
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "(i) We present FrozenBiLM, a framework that handles multi-modal inputs using frozen bidirectional language models and enables zero-shot VideoQA through masked language modeling. \n(ii) We provide an extensive ablation study and demonstrate the superior performance of our framework in the zero-shot setting when compared to previous autoregressive models. \n(iii) Our approach improves the state of the art in zero-shot VideoQA by a significant margin. FrozenBiLM also demonstrates competitive performance in the fully-supervised setting and shows strong results in the few-shot VideoQA setting which we introduce. ",
144
+ "bbox": [
145
+ 202,
146
+ 534,
147
+ 826,
148
+ 631
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "Our code and trained models are publicly available at [1]. ",
155
+ "bbox": [
156
+ 174,
157
+ 632,
158
+ 550,
159
+ 645
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "2 Related Work ",
166
+ "text_level": 1,
167
+ "bbox": [
168
+ 174,
169
+ 664,
170
+ 321,
171
+ 680
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "Zero-shot VideoQA. A vast majority of VideoQA approaches rely on relatively small, manually annotated VideoQA datasets [3, 9, 10, 13–15, 20, 23, 24, 30, 33, 34, 36–39, 43, 44, 47, 58, 60, 69, 70, 74, 78, 79, 83, 89, 97, 100, 103, 105, 112, 116]. Recently, a few work [101, 110] have explored zero-shot approaches for VideoQA, where models are only trained on automatically mined video clips with short text descriptions. In contrast to VideoQA annotations, such video-text pairs are readilyavailable at scale on the Web [6, 67, 109]. In particular, Yang et al. [101] automatically generate VideoQA training data using language models [72] pretrained on a manually annotated text-only question-answer corpus [73]. Reserve [110] uses GPT-3 [8] to rephrase questions into sentences completed by a multi-modal model. In contrast to these prior works [101, 110], our method does not require any kind of explicitly annotated language dataset or the use of data generation pipelines for zero-shot VideoQA. Note that BLIP [53] studies a related setting where a model trained on manually annotated image-question-answer triplets is transferred to VideoQA, which is a less challenging task. Also note that VideoCLIP [99] considers a related zero-shot multiple-choice video-to-text retrieval task as VideoQA, but in this setting the model is not provided with natural language questions. ",
178
+ "bbox": [
179
+ 174,
180
+ 695,
181
+ 826,
182
+ 888
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "Visual language models. As language models require large amounts of training data to perform well [27], recent works have studied transferring pretrained language models [8, 94] to image-text tasks. VisualGPT [11] and VC-GPT [64] showed the benefit of initializing the weights of an image captioning model with a pretrained autoregressive language-only model. Recent work pushed this idea further by freezing the weights of a pretrained autoregressive language model for tackling vision and language tasks [2, 19, 68, 91, 96, 104, 111]. Our approach also leverages a frozen pretrained language model. Similar to MAGMA [19], we also use adapter layers [28, 29]. However, we differ from these approaches as we propose to instead use lighter bidirectional masked language models, instead of autoregressive ones, and rely on a masked language modeling objective (MLM) instead of an autoregressive one. Moreover, our model is specifically designed for videos, for which high-quality visual question answering annotation is even more scarce compared to still images [19, 68, 91, 104]. We also explore the use of the speech modality, and tackle tasks which are challenging for autoregressive language models such as video-conditioned fill-in-the-blank [66]. Finally we show in Section 4.3 the superior performance of frozen bidirectional language models in comparison with autoregressive ones [91]. ",
189
+ "bbox": [
190
+ 174,
191
+ 92,
192
+ 825,
193
+ 299
194
+ ],
195
+ "page_idx": 2
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "Masked Language Modeling in vision and language. The MLM objective was initially introduced in natural language [17, 42, 61] to pretrain bidirectional transformers and learn generic representations. This approach achieved state-of-the-art results in many language tasks after finetuning on downstream datasets. Its success inspired numerous works to adapt it to train multi-modal transformer models on paired visual-linguistic data [12, 21, 22, 26, 31, 40, 48, 51, 56, 54, 59, 52, 50, 62, 63, 80, 81, 85, 86, 88, 93, 95, 106, 109, 114, 115]. However, these works typically use it to learn generic visual-linguistic representations by updating the transformer weights, and then use expensive manual supervision to train randomly initialized task-specific answer classifiers for VQA [12, 22, 51, 52, 59, 62, 80, 81, 85, 88, 95, 106] or VideoQA [21, 48, 50, 93, 109]. In contrast, we tackle zero-shot VideoQA, i.e. without using any manual annotation. Moreover, we do not update the transformer weights during cross-modal training, but instead exhibit the benefits of freezing these weights after text-only pretraining, for both zero-shot and fully-supervised VideoQA (see Sections 4.2 and 4.5). ",
200
+ "bbox": [
201
+ 173,
202
+ 305,
203
+ 825,
204
+ 470
205
+ ],
206
+ "page_idx": 2
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "3 Method ",
211
+ "text_level": 1,
212
+ "bbox": [
213
+ 174,
214
+ 494,
215
+ 269,
216
+ 512
217
+ ],
218
+ "page_idx": 2
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "This section presents our approach to tackle zero-shot video question answering. Here, zero-shot means that we do not use any visual question answering annotation and only rely on scalable data from the Web. Our approach starts with two strong pretrained components: (i) a text-only bidirectional masked language model (BiLM) pretrained on data from the Internet, which has the capability of zeroshot question answering but is not capable of visual reasoning, and (ii) a vision encoder pretrained to map images to text descriptions, but which does not have the ability to perform visual question answering. We aim at connecting these two components while keeping the language component frozen to avoid catastrophic forgetting [16], where the large language model would specialize to a new task while forgetting its initial capabilities. The end-goal is to design a unified model having the best of both worlds: visual understanding capabilities of a powerful visual encoder and question answering capabilities of a powerful language model. This requires several technical innovations, which are described in the rest of this section. First, we explain in Section 3.1 how we augment a frozen pretrained bidirectional masked language model with new layers to enable joint video and language reasoning, see Figure 2. Second, we present in Section 3.2 how we train these layers on video-text data scraped from the Web [6]. Finally, we describe in Section 3.3 how we enable zero-shot predictions for several video-language downstream tasks, including open-ended VideoQA, by casting them in a cloze form, similar to the masked language modeling task solved during training. ",
223
+ "bbox": [
224
+ 174,
225
+ 530,
226
+ 825,
227
+ 765
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "3.1 Architecture ",
234
+ "text_level": 1,
235
+ "bbox": [
236
+ 174,
237
+ 786,
238
+ 300,
239
+ 801
240
+ ],
241
+ "page_idx": 2
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "The proposed architecture, illustrated in Figure 2, brings together a powerful frozen pretrained bidirectional language model with a strong visual encoder. The difficulty lies in enabling multi-modal reasoning while keeping the large language model frozen. To address this challenge, we unify these two models via a visual-to-text projection module together with small adapter modules inserted within the frozen language model. Next, we describe in more detail the three main components of the architecture: (i) the frozen pretrained bidirectional language model, (ii) the pretrained video encoder and (iii) the lightweight modules that seamlessly connect the two components. ",
246
+ "bbox": [
247
+ 174,
248
+ 814,
249
+ 823,
250
+ 911
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "image",
256
+ "img_path": "images/da4998bc23389f6df2512772fded64c3ab160004c8e4a743977d3a26c516272a.jpg",
257
+ "image_caption": [
258
+ "Figure 2: Our training architecture consists of a large frozen bidirectional language model (BiLM) and a frozen pretrained visual encoder (in blue), complemented with additional lightweight trainable modules (in orange): (1) a visual-to-text projection module $P$ (on the left), which maps the frozen visual features to the joint visual-text embedding space and (2) a set of small adapter modules $A$ (on the right) in between the frozen transformer blocks. The pretrained normalization layers in the BiLM (on the right) are also finetuned. "
259
+ ],
260
+ "image_footnote": [],
261
+ "bbox": [
262
+ 173,
263
+ 87,
264
+ 826,
265
+ 310
266
+ ],
267
+ "page_idx": 3
268
+ },
269
+ {
270
+ "type": "text",
271
+ "text": "Frozen Bidirectional Masked Language Model. Our method starts from a pretrained bidirectional language model based on a Transformer encoder [92]. The input text is decomposed into a sequence of tokens $x = \\{ x _ { i } \\} _ { 1 } ^ { L } \\in [ 1 , V ] ^ { L }$ by a tokenizer of a vocabulary size $V$ . The language model, parameterized by $\\theta$ , makes use of an embedding function $g _ { \\theta }$ which independently transforms each token into a $D$ -dimensional continuous embedding $t = \\bar { \\{ t _ { i } \\} } _ { 1 } ^ { L } : = \\{ g _ { \\theta } \\dot { ( } x _ { i } ) \\} _ { 1 } ^ { L } \\ \\bar { \\in } \\ \\mathbb { R } ^ { L \\times D }$ , a Transformer encoder $f _ { \\theta }$ which computes interactions between all input tokens and outputs contextualized representations $t ^ { \\prime } = \\{ t _ { i } ^ { \\prime } \\} _ { 1 } ^ { L }$ , and a masked language modeling (MLM) classifier head $m _ { \\theta }$ which independently maps the $D$ -dimensional continuous embedding for each token $t _ { i } ^ { \\prime }$ to a vector of logits parameterizing a categorical distribution over the vocabulary $V$ . This distribution is referred to by $\\operatorname { \\bar { l o g } } p _ { \\theta } ( x ) : = \\operatorname { \\bar { \\{ } } m _ { \\theta } ( t _ { i } ^ { \\prime } ) \\overset { \\_ } \\} _ L ^ { } \\in \\mathbb { R } ^ { L \\times V }$ . We assume that the language model is pretrained, i.e. $\\theta$ has been optimised with a standard MLM objective [17] on a large dataset of text from the Web. We show in Section 4.2 that this text-only pretraining has a crucial importance for zero-shot VideoQA. ",
272
+ "bbox": [
273
+ 173,
274
+ 453,
275
+ 825,
276
+ 619
277
+ ],
278
+ "page_idx": 3
279
+ },
280
+ {
281
+ "type": "text",
282
+ "text": "Pretrained Video Encoder. The video is represented by a sequence of frames $y = \\{ y _ { i } \\} _ { 1 } ^ { T }$ . Each frame is forwarded separately through a visual backbone $h _ { \\phi }$ , which outputs one feature vector per frame $\\boldsymbol { u } = \\{ u _ { i } \\} _ { 1 } ^ { T } : = \\{ h _ { \\phi } ( y _ { i } ) \\} _ { 1 } ^ { T } \\in \\mathbb { R } ^ { T \\times D _ { u } }$ . In detail, the visual backbone is CLIP ViT-L/14 [18, 71] at resolution $2 2 4 \\times 2 2 4$ pixels, pretrained to map images to text descriptions with a contrastive loss on 400M Web-scraped image-text pairs. The backbone is kept frozen throughout our experiments. Note that a CLIP-baseline for zero-shot VideoQA results in poor performance, see Section 4.4. ",
283
+ "bbox": [
284
+ 173,
285
+ 625,
286
+ 825,
287
+ 710
288
+ ],
289
+ "page_idx": 3
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "Connecting the Frozen Language and Frozen Vision components. The video features are incorporated into the language model as a prompt [49, 57, 113] $v$ of length $T$ (Figure 2, left). This prompt is obtained by linearly mapping the visual features $u$ to the text token embedding space via a visual-to-text projection $\\boldsymbol { P } ^ { \\check { \\mathbf { \\check { \\tau } } } } \\in \\mathbb { R } ^ { \\pmb { \\check { D } _ { u } } \\times \\pmb { \\check { D } } }$ , i.e. $v = \\{ v _ { i } \\} _ { 1 } ^ { T } : = \\{ P ( u _ { i } ) \\} _ { 1 } ^ { T }$ . The prompt is then concatenated with the text embeddings before being forwarded to the transformer encoder that models joint visual-linguistic interactions. We show in Section 4.2 that incorporating the input video considerably improves zero-shot VideoQA results. In addition, to learn powerful multi-modal interactions while keeping the transformer encoder weights frozen, we equip the transformer encoder with lightweight adapter modules $A$ [28] (Figure 2, right). We use an adapter which transforms the hidden state $z$ with a multi-layer perceptron transformation and a residual connection, i.e. $A ( z ) = z + W ^ { u p } \\psi ( W ^ { d o w n } z )$ with $W ^ { d o w n } \\in \\mathbb { R } ^ { \\bar { D } \\times D _ { h } }$ , $W ^ { u p } \\in \\mathbb { R } ^ { D _ { h } \\times D }$ , $D$ the hidden dimension of the transformer, $D _ { h }$ the bottleneck dimension, and $\\psi$ a ReLU activation function. $D _ { h }$ is typically set to be smaller than $D$ such that the adapters are lightweight. In detail, we add an adapter module before the layer normalization, after each self-attention layer and each feed-forward layer of the transformer encoder. ",
294
+ "bbox": [
295
+ 173,
296
+ 715,
297
+ 826,
298
+ 911
299
+ ],
300
+ "page_idx": 3
301
+ },
302
+ {
303
+ "type": "text",
304
+ "text": "3.2 Cross-modal training ",
305
+ "text_level": 1,
306
+ "bbox": [
307
+ 174,
308
+ 90,
309
+ 362,
310
+ 106
311
+ ],
312
+ "page_idx": 4
313
+ },
314
+ {
315
+ "type": "text",
316
+ "text": "We wish to train the newly added modules introduced in the previous section (shown in orange in Figure 2) for the VideoQA task. This is hard because we assume that no explicit manual annotation for the VideoQA task is available, such annotations being expensive and therefore hard to obtain at scale. Instead we train our architecture using only readily-available video-caption pairs scraped from the Web. Such data is easy to obtain [6, 67, 109], ensuring the scalability of our approach. ",
317
+ "bbox": [
318
+ 174,
319
+ 116,
320
+ 825,
321
+ 186
322
+ ],
323
+ "page_idx": 4
324
+ },
325
+ {
326
+ "type": "text",
327
+ "text": "During training, we keep the weights of the pretrained BiLM and pretrained visual backbone frozen as previously explained. We train from scratch the parameters of (i) the visual-to-text projection module $P$ and (ii) the adapter modules $A$ . We show in Section 4.2 the importance of freezing the BiLM weights combined with training the adapter modules. Note that all normalization layers [5] of the pretrained BiLM are also updated to adjust to the new distribution of the training data. We denote all the trainable parameters of our model by the subscript $\\mu$ . In practice, they sum up to about $5 \\%$ of the BiLM parameters, hence the training of our model is computationally efficient. ",
328
+ "bbox": [
329
+ 173,
330
+ 193,
331
+ 825,
332
+ 290
333
+ ],
334
+ "page_idx": 4
335
+ },
336
+ {
337
+ "type": "text",
338
+ "text": "We use a visually-conditioned masked language modeling objective (MLM), in which some text tokens $\\{ x _ { m } \\}$ are randomly masked and the model has to predict these tokens based on the surrounding text tokens and the video input. Formally, we minimize the following loss: ",
339
+ "bbox": [
340
+ 174,
341
+ 296,
342
+ 825,
343
+ 338
344
+ ],
345
+ "page_idx": 4
346
+ },
347
+ {
348
+ "type": "equation",
349
+ "img_path": "images/90bffb0795ec18a0f12e96d38b5b64670391e5679f131d0f6e0495c4d2c8ed40.jpg",
350
+ "text": "$$\n\\mathcal { L } _ { \\mu } ( x , y ) = - \\frac { 1 } { M } \\sum _ { m } \\log p _ { \\mu } ( \\tilde { x } , y ) _ { m } ^ { x _ { m } } ,\n$$",
351
+ "text_format": "latex",
352
+ "bbox": [
353
+ 370,
354
+ 344,
355
+ 622,
356
+ 382
357
+ ],
358
+ "page_idx": 4
359
+ },
360
+ {
361
+ "type": "text",
362
+ "text": "where $\\tilde { x }$ is the corrupted text sequence, $y$ is the sequence of video frames, $p _ { \\mu } ( \\tilde { x } , y ) _ { m } ^ { x _ { m } }$ is the probability for the (masked) $m$ -th token in $\\tilde { x }$ to be $x _ { m }$ , and $M$ is the number of masks in the sequence $\\tilde { x }$ . In detail, we follow [17] and corrupt $15 \\%$ of text tokens, replacing them $80 \\%$ of the time with a mask token, $10 \\%$ of the time with the same token and $10 \\%$ of the time with a randomly sampled token. ",
363
+ "bbox": [
364
+ 173,
365
+ 388,
366
+ 825,
367
+ 445
368
+ ],
369
+ "page_idx": 4
370
+ },
371
+ {
372
+ "type": "text",
373
+ "text": "3.3 Adapting to downstream tasks ",
374
+ "text_level": 1,
375
+ "bbox": [
376
+ 176,
377
+ 462,
378
+ 423,
379
+ 477
380
+ ],
381
+ "page_idx": 4
382
+ },
383
+ {
384
+ "type": "text",
385
+ "text": "After training, our model is able to fill gaps in the input text given an input video together with left and right textual context as part of the input text. We wish to apply our model out-of-the-box to predict an answer given a question about a video. The video can optionally come with textual subtitles obtained using automatic speech recognition. To avoid using manual supervision, we formulate the downstream tasks in cloze form [76, 90], i.e. such that the model only has to fill-in a mask token in the input prompt similarly to the MLM objective optimized during training. The adaptation to the downstream tasks brings several challenges, as described next. First, we describe how we formulate the input text prompts for several downstream tasks. Then, we explain how we map the mask token from the input text prompt to an answer via a frozen answer embedding module. Finally, we present how we finetune our architecture in a supervised setting. ",
386
+ "bbox": [
387
+ 173,
388
+ 487,
389
+ 825,
390
+ 627
391
+ ],
392
+ "page_idx": 4
393
+ },
394
+ {
395
+ "type": "text",
396
+ "text": "Input prompt engineering. We describe how we design the input text prompts for several downstream video-language tasks. Each downstream task is formulated as a masked language modeling problem. This allows us to apply FrozenBiLM out-of-the-box. A [CLS] token and a [SEP] token are respectively inserted at the start and the end of each sequence following [17]. ",
397
+ "bbox": [
398
+ 173,
399
+ 641,
400
+ 825,
401
+ 698
402
+ ],
403
+ "page_idx": 4
404
+ },
405
+ {
406
+ "type": "text",
407
+ "text": "Open-ended VideoQA. Given a question and a video, the task is to find the correct answer in a large vocabulary $\\mathcal { A }$ of about 1K answers. Answers are concise, i.e. the great majority of answers consist of one word [32, 98, 101, 108]. We design the following prompt: ",
408
+ "bbox": [
409
+ 176,
410
+ 704,
411
+ 820,
412
+ 746
413
+ ],
414
+ "page_idx": 4
415
+ },
416
+ {
417
+ "type": "text",
418
+ "text": "“[CLS] Question: <Question>? Answer: [MASK]. Subtitles: <Subtitles> [SEP]” ",
419
+ "bbox": [
420
+ 171,
421
+ 747,
422
+ 774,
423
+ 760
424
+ ],
425
+ "page_idx": 4
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "Multiple-choice VideoQA. Given a question and a video, the task is to find the correct answer in a small number of candidates $C$ , typically up to 5 choices [46, 54]. We set the vocabulary to $\\mathcal { A } = [ \\mathrm { Y e s } , \\mathrm { N o } ]$ and compute a confidence score for each candidate by using the following prompt: ",
430
+ "bbox": [
431
+ 174,
432
+ 766,
433
+ 821,
434
+ 808
435
+ ],
436
+ "page_idx": 4
437
+ },
438
+ {
439
+ "type": "text",
440
+ "text": "“[CLS] Question: <Question>? Is it ’<Answer Candidate>’? [MASK]. Subtitles: <Subtitles> [SEP]” ",
441
+ "bbox": [
442
+ 176,
443
+ 809,
444
+ 772,
445
+ 834
446
+ ],
447
+ "page_idx": 4
448
+ },
449
+ {
450
+ "type": "text",
451
+ "text": "We choose the best option by selecting the candidate with the highest Yes logit value. ",
452
+ "bbox": [
453
+ 176,
454
+ 835,
455
+ 730,
456
+ 849
457
+ ],
458
+ "page_idx": 4
459
+ },
460
+ {
461
+ "type": "text",
462
+ "text": "Video-conditioned fill-in-the-blank task. Given a video and a sentence with a blank space, the task is to fill in the blank with the correct word from a vocabulary $\\mathcal { A }$ of about 1K answers. We replace the blank in the sentence with a mask token, and design the following prompt: ",
463
+ "bbox": [
464
+ 174,
465
+ 856,
466
+ 821,
467
+ 897
468
+ ],
469
+ "page_idx": 4
470
+ },
471
+ {
472
+ "type": "text",
473
+ "text": "Note that all prompts are prepended with the video prompt (see Section 3.1) before being forwarded to the transformer encoder. ",
474
+ "bbox": [
475
+ 176,
476
+ 92,
477
+ 823,
478
+ 118
479
+ ],
480
+ "page_idx": 5
481
+ },
482
+ {
483
+ "type": "text",
484
+ "text": "Answer embedding module. For each downstream task, we wish to map the mask token in the input text prompt to an actual answer prediction in the set of possible answers $\\mathcal { A }$ , as described above. For this we use the frozen MLM classifier head $m _ { \\theta }$ . However, $m _ { \\theta } \\in \\mathbb { R } ^ { V \\times D }$ covers $V$ different tokens where $V > > N$ and $N \\approx 1 , 0 0 0$ is the size of $\\mathcal { A }$ . Therefore, we introduce a task-specific answer classification head $l$ which linearly maps a contextualized mask representation $t _ { i } ^ { \\prime }$ to a vector of logits parameterizing a categorical distribution over the vocabulary $\\mathcal { A }$ , i.e. $\\boldsymbol { l } \\in \\mathbb { R } ^ { N \\times D }$ . We set the weights of this answer module $l$ with the corresponding weights of the pretrained MLM classifier $m _ { \\theta }$ for one-token answers. In the case of multi-token answers, we average the weights of their different tokens. We, hence, enable zero-shot inference at test time. We also discuss other alternative strategies to handle multi-token answers in the Supplementary Material. ",
485
+ "bbox": [
486
+ 174,
487
+ 136,
488
+ 825,
489
+ 276
490
+ ],
491
+ "page_idx": 5
492
+ },
493
+ {
494
+ "type": "text",
495
+ "text": "Fully-supervised training. To evaluate our approach on fully-supervised benchmarks, we also explore finetuning of our model on datasets that provide manual annotations for the target task. To this end, we train the same parameters as explained in Section 3.2, while keeping the transformer weights and the answer embedding module frozen. For open-ended VideoQA and video-conditioned fill-in-theblank, we use a cross-entropy loss on the task-specific vocabulary $\\mathcal { A }$ . For multiple-choice VideoQA, we use a binary cross-entropy loss applied to each answer candidate. We show in Section 4.5 the benefit of freezing the language model weights during fully-supervised training. ",
496
+ "bbox": [
497
+ 174,
498
+ 294,
499
+ 825,
500
+ 392
501
+ ],
502
+ "page_idx": 5
503
+ },
504
+ {
505
+ "type": "text",
506
+ "text": "4 Experiments ",
507
+ "text_level": 1,
508
+ "bbox": [
509
+ 174,
510
+ 412,
511
+ 312,
512
+ 430
513
+ ],
514
+ "page_idx": 5
515
+ },
516
+ {
517
+ "type": "text",
518
+ "text": "This section demonstrates the benefits of our FrozenBiLM framework and compares our method to the state of the art. We first outline our experimental setup in Section 4.1. We then present ablation studies in Section 4.2. Next we compare our bidirectional framework to its autoregressive variant in Section 4.3. The comparison to the state of the art in zero-shot VideoQA and qualitative results are presented in Section 4.4. Finally, we finetune our model on the VideoQA task in Section 4.5, where we show few-shot and fully-supervised results. ",
519
+ "bbox": [
520
+ 174,
521
+ 446,
522
+ 825,
523
+ 529
524
+ ],
525
+ "page_idx": 5
526
+ },
527
+ {
528
+ "type": "text",
529
+ "text": "4.1 Experimental setup ",
530
+ "text_level": 1,
531
+ "bbox": [
532
+ 176,
533
+ 549,
534
+ 349,
535
+ 563
536
+ ],
537
+ "page_idx": 5
538
+ },
539
+ {
540
+ "type": "text",
541
+ "text": "Frozen bidirectional language model. We use a tokenizer based on SentencePiece [41] with $V = 1 2 8$ , 000, and a bidirectional language model with 900M parameters, DeBERTa-V2-XLarge [25], trained with the MLM objective on a corpus of 160G text data. We also show how our approach generalizes to other MLM-pretrained bidirectional language models such as BERT [17] in Section 4.2. ",
542
+ "bbox": [
543
+ 174,
544
+ 575,
545
+ 825,
546
+ 631
547
+ ],
548
+ "page_idx": 5
549
+ },
550
+ {
551
+ "type": "text",
552
+ "text": "Datasets. For training we use the publicly available WebVid10M dataset [6], which consists of 10 million of video-text pairs scraped from the Shutterstock website where video captions are obtained from readily-available alt-text descriptions. We evaluate results on eight downstream datasets covering a wide range of textual and video domains (e.g. GIFs, YouTube videos, TV shows, movies), and multiple VideoQA paradigms: open-ended VideoQA (iVQA [101], MSRVTTQA [98], MSVD-QA [98], ActivityNet-QA [108] and TGIF-QA FrameQA [32]), multiple-choice VideoQA (How2QA [54] and TVQA [46]) and video-conditioned fill-in-the-blank (LSMDC-Fillin-the-blank [66]). Unless stated otherwise, we report top-1 test accuracy using the original splits for training, validation and test. For How2QA, we report results on the public validation set for comparison with prior work [78, 101, 107]. For TVQA, we report results on the validation set for the ablation studies and on the hidden test set for the comparison to the state of the art. More details are included in the Supplementary Material. ",
553
+ "bbox": [
554
+ 174,
555
+ 637,
556
+ 825,
557
+ 803
558
+ ],
559
+ "page_idx": 5
560
+ },
561
+ {
562
+ "type": "text",
563
+ "text": "Implementation Details. The training for 2 epochs on WebVid10M lasts 20 hours on 8 Tesla V100 GPUs. We give further details in the Supplementary Material. ",
564
+ "bbox": [
565
+ 176,
566
+ 809,
567
+ 823,
568
+ 838
569
+ ],
570
+ "page_idx": 5
571
+ },
572
+ {
573
+ "type": "text",
574
+ "text": "4.2 Ablation studies ",
575
+ "text_level": 1,
576
+ "bbox": [
577
+ 174,
578
+ 856,
579
+ 325,
580
+ 871
581
+ ],
582
+ "page_idx": 5
583
+ },
584
+ {
585
+ "type": "text",
586
+ "text": "In this section, we evaluate the zero-shot performance of different variants of our method. By default, we use the frozen pretrained DeBERTa-V2-XLarge language model and train the visual-to-textprojection layer together with adapters for 2 epochs on WebVid10M. We refer to this default model as FrozenBiLM. This model uses three input modalities in terms of video, question, and speech. ",
587
+ "bbox": [
588
+ 174,
589
+ 883,
590
+ 821,
591
+ 911
592
+ ],
593
+ "page_idx": 5
594
+ },
595
+ {
596
+ "type": "table",
597
+ "img_path": "images/bd475344332af3b23f9c61431f3fa7668ddd51b3e95ea8cd821ac74d937f8dc9.jpg",
598
+ "table_caption": [],
599
+ "table_footnote": [
600
+ "Table 1: The effect of initializing and training various parts of our model evaluated on zero-shot VideoQA. All models are trained on WebVid10M and use multi-modal inputs (video, speech and question) at inference. "
601
+ ],
602
+ "table_body": "<table><tr><td colspan=\"2\">LM</td><td rowspan=\"2\">Frozen</td><td rowspan=\"2\">Adapters</td><td rowspan=\"2\">Fill-in-the-blank</td><td colspan=\"5\">Open-ended</td><td colspan=\"2\">Multiple-choice</td></tr><tr><td>Pretraining</td><td>LM</td><td>LSMDC</td><td></td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td><td></td><td></td><td></td><td>How2QA TVQA</td></tr><tr><td>1.</td><td>X</td><td>X</td><td>X</td><td>0.5</td><td>0.3</td><td>0.1</td><td>0.0</td><td>0.5</td><td>0.0</td><td>32.4</td><td>20.7</td></tr><tr><td></td><td>√</td><td></td><td>×</td><td>37.1</td><td>21.0</td><td>17.6</td><td>31.9</td><td>20.7</td><td>30.7</td><td>45.7</td><td>45.6</td></tr><tr><td>2</td><td>√</td><td>×</td><td>X</td><td>50.7</td><td>27.3</td><td>16.8</td><td>32.2</td><td>24.7</td><td>41.0</td><td>53.5</td><td>53.4</td></tr><tr><td>4.</td><td>√</td><td>√</td><td>√</td><td>51.5</td><td>26.8</td><td>16.7</td><td>33.8</td><td>25.9</td><td>41.9</td><td>58.4</td><td>59.2</td></tr></table>",
603
+ "bbox": [
604
+ 176,
605
+ 88,
606
+ 825,
607
+ 151
608
+ ],
609
+ "page_idx": 6
610
+ },
611
+ {
612
+ "type": "table",
613
+ "img_path": "images/9e86a6674d75948b26f911af134dbcc7e5dc323e74e7a18c4f38775859671f6f.jpg",
614
+ "table_caption": [],
615
+ "table_footnote": [
616
+ "Table 2: Impact of the visual and speech modalities on zero-shot VideoQA. Rows 1 and 2 report results for a pretrained language model without any visual input. Rows 3 and 4 give results for a FrozenBiLM model pretrained on WebVid10M. "
617
+ ],
618
+ "table_body": "<table><tr><td rowspan=\"2\"></td><td rowspan=\"2\">Visual</td><td rowspan=\"2\">Speech</td><td rowspan=\"2\">Fill-in-the-blank LSMDC</td><td colspan=\"5\">Open-ended</td><td colspan=\"2\">Multiple-choice</td></tr><tr><td>iVQA</td><td>MSRVTT-QA</td><td></td><td>MSVD-QA ActivityNet-QA</td><td>TGIF-QA</td><td>How2QA</td><td>TVQA</td></tr><tr><td>1.</td><td>X</td><td>X</td><td>47.9</td><td>11.0</td><td>6.4</td><td>11.3</td><td>22.6</td><td>32.3</td><td>29.6</td><td>23.2</td></tr><tr><td></td><td></td><td>√</td><td>49.8</td><td>13.2</td><td>6.5</td><td>11.7</td><td>23.1</td><td>32.3</td><td>45.9</td><td>44.1</td></tr><tr><td>2</td><td>X</td><td>X</td><td>50.9</td><td>26.2</td><td>16.9</td><td>33.7</td><td>25.9</td><td>41.9</td><td>41.9</td><td>29.7</td></tr><tr><td>4.</td><td>√</td><td>√</td><td>51.5</td><td>26.8</td><td>16.7</td><td>33.8</td><td>25.9</td><td>41.9</td><td>58.4</td><td>59.2</td></tr></table>",
619
+ "bbox": [
620
+ 176,
621
+ 213,
622
+ 823,
623
+ 276
624
+ ],
625
+ "page_idx": 6
626
+ },
627
+ {
628
+ "type": "text",
629
+ "text": "",
630
+ "bbox": [
631
+ 173,
632
+ 366,
633
+ 823,
634
+ 395
635
+ ],
636
+ "page_idx": 6
637
+ },
638
+ {
639
+ "type": "text",
640
+ "text": "Ablation of the model training. We ablate the effect of initializing parameters of the language model, freezing its weights and training adapters in Table 1. We observe that the language model pretraining is crucial. Indeed, a model with randomly initialized language weights (row 1) performs poorly compared to models initialized with language pretrained weights (rows 2 to 4). Moreover, the model which updates the language model weights (row 2) during cross-modal training performs considerably worse compared to variants that freeze them (rows 3 and 4). This shows the benefit of freezing the language model for zero-shot VideoQA. We also notice the benefit of the adapter layers by comparing rows 3 and 4, especially for multiple-choice datasets. Finally, we note that training variants with the frozen language model is twice faster compared to updating all parameters, as there is a significantly lower number of parameters to be trained. ",
641
+ "bbox": [
642
+ 173,
643
+ 400,
644
+ 825,
645
+ 540
646
+ ],
647
+ "page_idx": 6
648
+ },
649
+ {
650
+ "type": "text",
651
+ "text": "Impact of modalities. Table 2 shows the impact of the visual and speech modalities on the zero-shot performance of our model. First, we evaluate the text-only performance of our model using neither visual input nor speech input in row 1. We can observe that adding speech (row 2) marginally improves the results and that the importance of speech highly depends on the dataset. When adding vision (rows 3 and 4), the performance increases significantly, e.g. $+ 1 3 . 6 \\%$ accuracy on iVQA and $+ 2 2 . 1 \\%$ on MSVD-QA between rows 4 and 2. Finally, the model with vision also benefits from the speech, e.g. $+ 1 6 . 5 \\%$ accuracy on How2QA and $+ 2 9 . 5 \\%$ accuracy on TVQA (compare rows 3 and 4). ",
652
+ "bbox": [
653
+ 173,
654
+ 545,
655
+ 825,
656
+ 643
657
+ ],
658
+ "page_idx": 6
659
+ },
660
+ {
661
+ "type": "text",
662
+ "text": "Note that in practice, speech is missing for many videos, as we obtain the speech directly from the YouTube API and many videos are no longer available. Exceptions are How2QA and TVQA for which the authors [46, 55] provide speech for all videos. Consequently, we have speech data for only $4 4 . 3 \\%$ , $1 4 . 2 \\%$ , $8 . 2 \\%$ , $7 . 1 \\%$ and $2 5 . 3 \\%$ of test samples in LSMDC-FiB, iVQA, MSRVTT-QA, MSVD-QA and ActivityNet-QA respectively. GIFs in TGIF-QA do not contain speech. ",
663
+ "bbox": [
664
+ 173,
665
+ 648,
666
+ 825,
667
+ 718
668
+ ],
669
+ "page_idx": 6
670
+ },
671
+ {
672
+ "type": "text",
673
+ "text": "Size of the cross-modal training dataset. Zero-shot results of FrozenBiLM after training for a fixed number of iterations on different fractions of WebVid10M are shown in Table 3. We construct these subsets such that larger subsets include the smaller ones. We find that performance increases monotonically with more multi-modal training data. ",
674
+ "bbox": [
675
+ 174,
676
+ 724,
677
+ 568,
678
+ 808
679
+ ],
680
+ "page_idx": 6
681
+ },
682
+ {
683
+ "type": "text",
684
+ "text": "Size of the language model. In Table 4, we ablate the importance of the language model size for the zero-shot performance. Note that when comparing different language models, we use no adapters to avoid biases related to the choice of the bottleneck dimension hyperparameter [28]. We find that using the 900M-parameter DeBERTA-V2-XLarge (row 6) outperforms the 300M-parameter BERT-Large (row 5) which also improves over the 100M-parameter BERT-Base (row 4). ",
685
+ "bbox": [
686
+ 174,
687
+ 814,
688
+ 568,
689
+ 883
690
+ ],
691
+ "page_idx": 6
692
+ },
693
+ {
694
+ "type": "table",
695
+ "img_path": "images/85cf6bee0282996ce7be8e34e2d47b63d95d49e4b0bea1553e4e38ab79a80ee3.jpg",
696
+ "table_caption": [
697
+ "Table 3: Dependency on the size of the training set. Zero-shot results are presented for different fractions of the WebVid10M dataset used for training. "
698
+ ],
699
+ "table_footnote": [],
700
+ "table_body": "<table><tr><td></td><td>Training Data</td><td>MSVD-QA</td><td>How2QA</td></tr><tr><td>1.</td><td>WebVid1K</td><td>13.6</td><td>53.0</td></tr><tr><td>2.</td><td>WebVid10K</td><td>22.7</td><td>54.9</td></tr><tr><td>3.</td><td>WebVid200K</td><td>27.8</td><td>56.0</td></tr><tr><td>4.</td><td>WebVid2M</td><td>30.1</td><td>57.4</td></tr><tr><td>5.</td><td>WebVid10M</td><td>33.8</td><td>58.4</td></tr></table>",
701
+ "bbox": [
702
+ 584,
703
+ 748,
704
+ 823,
705
+ 814
706
+ ],
707
+ "page_idx": 6
708
+ },
709
+ {
710
+ "type": "text",
711
+ "text": "",
712
+ "bbox": [
713
+ 174,
714
+ 883,
715
+ 821,
716
+ 911
717
+ ],
718
+ "page_idx": 6
719
+ },
720
+ {
721
+ "type": "table",
722
+ "img_path": "images/c3f62d50a742ad7a9a4bd97f7ada6a99adc1814395e041bc9290099364215138.jpg",
723
+ "table_caption": [],
724
+ "table_footnote": [
725
+ "Table 4: Comparison of autoregressive language models (top) and bidirectional language models (bottom) for zero-shot VideoQA. All variants are trained on WebVid10M for the same number of epochs. "
726
+ ],
727
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td rowspan=\"2\">Language Model</td><td colspan=\"2\">#LM params Train timel</td><td colspan=\"5\">iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td></tr><tr><td></td><td>(GPUH) 200</td><td></td><td>4.2</td><td>10.1</td><td>17.8</td><td>14.4</td></tr><tr><td rowspan=\"3\"></td><td>1. GPT-Neo-1.3B Autoregressive 2.GPT-Neo-2.7B</td><td>1.3B 2.7B</td><td>360</td><td>6.6 9.1</td><td>7.7</td><td>17.8</td><td>17.4</td><td>20.1</td></tr><tr><td>3.GPT-J-6B</td><td>6B</td><td>820</td><td>21.4</td><td>9.6</td><td>26.7</td><td>24.5</td><td>37.3</td></tr><tr><td>4.BERT-Base</td><td>110M</td><td>24</td><td>12.4</td><td>6.4</td><td>11.7</td><td>16.7</td><td>23.1</td></tr><tr><td rowspan=\"3\">Bidirectional</td><td></td><td>340M</td><td>60</td><td>12.9</td><td>7.1</td><td>13.0</td><td>19.0</td><td>21.5</td></tr><tr><td>5.BERT-Large</td><td></td><td></td><td>27.3</td><td>16.8</td><td>32.2</td><td>24.7</td><td>41.0</td></tr><tr><td>6.DeBERTa-V2-XLarge</td><td>890M</td><td>160</td><td></td><td></td><td></td><td></td><td></td></tr></table>",
728
+ "bbox": [
729
+ 176,
730
+ 89,
731
+ 825,
732
+ 179
733
+ ],
734
+ "page_idx": 7
735
+ },
736
+ {
737
+ "type": "table",
738
+ "img_path": "images/d88f2d8fd7be10172607ad768b7b74558ba6c0f5a36b012e15ad70ba915db763.jpg",
739
+ "table_caption": [],
740
+ "table_footnote": [
741
+ "Table 5: Comparison with the state of the art for zero-shot VideoQA. "
742
+ ],
743
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td rowspan=\"2\">Training Data</td><td rowspan=\"2\">Speech</td><td>|Fill-in-the-blank|</td><td colspan=\"4\">Open-ended</td><td colspan=\"2\">Multiple-choice How2QATVQA</td></tr><tr><td>LSMDC</td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Random</td><td></td><td></td><td>0.1</td><td>0.1</td><td>0.1 0.1 7.2</td><td></td><td>0.1</td><td>0.1</td><td>20</td></tr><tr><td>CLIP ViT-L/14 [71] 400M image-textsX</td><td></td><td></td><td>1.2</td><td>9.2</td><td>2.1</td><td></td><td>1.2</td><td>3.6 47.7</td><td>26.1</td></tr><tr><td>Just Ask [102]</td><td>HowToVQA69M+ WebVidVQA3M</td><td>X</td><td></td><td>13.3</td><td>5.6</td><td>13.5</td><td>12.3</td><td></td><td></td></tr><tr><td>Reserve [110]</td><td>YT-Temporal-1B</td><td>X</td><td>31.0</td><td></td><td>5.8</td><td></td><td></td><td>53.1</td><td></td></tr><tr><td>FrozenBiLM(Ours) WebVid10M</td><td></td><td>X</td><td>50.9</td><td>26.2</td><td>16.9</td><td></td><td></td><td></td><td>29.7</td></tr><tr><td>FrozenBiLM(Ours)WebVid10M</td><td></td><td>√</td><td>51.5</td><td>26.8</td><td>33.7 16.7 33.8</td><td>25.9 25.9</td><td>41.9 41.9</td><td>41.9 58.4</td><td>59.7</td></tr></table>",
744
+ "bbox": [
745
+ 176,
746
+ 234,
747
+ 825,
748
+ 323
749
+ ],
750
+ "page_idx": 7
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "Importance of the suffix. Our text input prompts include a suffix just to the right of the mask token which consists in a point and an end-of-sentence token for the variant without speech (or a point followed by the speech subtitles for the variant with speech). We found that removing this suffix leads to a considerable drop of performance (e.g. the test accuracy on MSVD-QA in the row 3 of Table 2 drops from $3 3 . 7 \\%$ to $2 . 8 \\%$ ). Note that we do not observe such a large drop in performance when removing the [CLS] token e.g. the accuracy on MSVD-QA drops only from $3 3 . 8 \\%$ to $3 3 . 2 \\%$ . This shows that the bidirectional nature of our framework is a key factor for the performance. Intuitively, this suffix forces the model to provide a concise answer. Such a hard constraint cannot be given to unidirectional autoregressive models compared next in Section 4.3. We further ablate the importance of the prompt design in the Supplementary Material. ",
755
+ "bbox": [
756
+ 173,
757
+ 377,
758
+ 825,
759
+ 516
760
+ ],
761
+ "page_idx": 7
762
+ },
763
+ {
764
+ "type": "text",
765
+ "text": "4.3 Comparison with frozen autoregressive models ",
766
+ "text_level": 1,
767
+ "bbox": [
768
+ 174,
769
+ 532,
770
+ 539,
771
+ 547
772
+ ],
773
+ "page_idx": 7
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "In this section, we compare our bidirectional framework using language models of various sizes to the larger, autoregressive GPT-based counterparts recently used for zero-shot image question answering [91, 104]. For fair comparison, we adapt autoregressive models to video and language inputs similarly as our bidirectional models. In detail, autoregressive variants train a similar visual-totext projection by using a left-to-right language modeling loss [91]. All models in our comparison are trained on WebVid10M for the same number of epochs. At inference, autoregressive variants use the same template as [91] to which we prepend speech subtitles, greedily decode sequences as [91], and use the same answer vocabulary as bidirectional models. Autoregressive variants select the top answer that maximizes the log-likelihood when appended to the question prompt. Here also, we use no adapters for all models, such that the architecture of autoregressive models closely follows [91]. This is to avoid biases related to the tuning of the bottleneck reduction hyperparameter in the adapters [28]. ",
778
+ "bbox": [
779
+ 174,
780
+ 558,
781
+ 825,
782
+ 710
783
+ ],
784
+ "page_idx": 7
785
+ },
786
+ {
787
+ "type": "text",
788
+ "text": "We compare autoregressive and bidirectional language models in terms of accuracy and efficiency in Table 4. We observe that our bidirectional framework (rows 4-6) achieves significantly better zero-shot performance-efficiency trade-off compared to its autoregressive counterpart (rows 1-3). For instance, our framework with BERT-Base [17] (row 4) outperforms the autoregressive variant based on GPT-Neo-1.3B [7] (row 1) which uses 12 times more parameters and 8 times more training time. Likewise, our framework with DeBERTa-V2-XLarge [25] (row 6) improves over the autoregressive variant based on GPT-J-6B [94] (row 3) that has 7 times more parameters and requires 5 times more training time, showing the efficiency of our bidirectional framework for zero-shot VideoQA. ",
789
+ "bbox": [
790
+ 174,
791
+ 717,
792
+ 825,
793
+ 827
794
+ ],
795
+ "page_idx": 7
796
+ },
797
+ {
798
+ "type": "text",
799
+ "text": "4.4 Comparison to the state of the art for zero-shot VideoQA ",
800
+ "text_level": 1,
801
+ "bbox": [
802
+ 174,
803
+ 844,
804
+ 607,
805
+ 858
806
+ ],
807
+ "page_idx": 7
808
+ },
809
+ {
810
+ "type": "text",
811
+ "text": "Quantitative comparison. Table 5 presents results of our method in comparison to the state of the art in zero-shot VideoQA settings [101], i.e. when using no manually annotated visual data for training. Our approach outperforms previous methods by a significant margin on all 8 datasets. In ",
812
+ "bbox": [
813
+ 174,
814
+ 869,
815
+ 825,
816
+ 911
817
+ ],
818
+ "page_idx": 7
819
+ },
820
+ {
821
+ "type": "image",
822
+ "img_path": "images/b49b62f4806b31a8cbb7428319bfc2f97b769ef3bb39adaf999b69eb7f6c7442.jpg",
823
+ "image_caption": [],
824
+ "image_footnote": [],
825
+ "bbox": [
826
+ 174,
827
+ 89,
828
+ 299,
829
+ 137
830
+ ],
831
+ "page_idx": 8
832
+ },
833
+ {
834
+ "type": "image",
835
+ "img_path": "images/94c2be5581307ef3dd7a4aa94a366db797ffef89c606b6a0d5dadadda100607b.jpg",
836
+ "image_caption": [],
837
+ "image_footnote": [],
838
+ "bbox": [
839
+ 305,
840
+ 89,
841
+ 429,
842
+ 137
843
+ ],
844
+ "page_idx": 8
845
+ },
846
+ {
847
+ "type": "image",
848
+ "img_path": "images/ebb260bdef7892c31c6fe6a378ce2e8025b64d1a44e5ed8b738e222cc37bc540.jpg",
849
+ "image_caption": [],
850
+ "image_footnote": [],
851
+ "bbox": [
852
+ 436,
853
+ 89,
854
+ 562,
855
+ 137
856
+ ],
857
+ "page_idx": 8
858
+ },
859
+ {
860
+ "type": "image",
861
+ "img_path": "images/665bbb654b07ca684b2cdf215cd247ac12e0b881c212e011c6270e4807b38481.jpg",
862
+ "image_caption": [],
863
+ "image_footnote": [],
864
+ "bbox": [
865
+ 566,
866
+ 89,
867
+ 691,
868
+ 137
869
+ ],
870
+ "page_idx": 8
871
+ },
872
+ {
873
+ "type": "image",
874
+ "img_path": "images/48e0243ccbfb3d468d1ce1701aa0fff58d0e4816da8958e505398ad01558a32d.jpg",
875
+ "image_caption": [],
876
+ "image_footnote": [],
877
+ "bbox": [
878
+ 697,
879
+ 89,
880
+ 821,
881
+ 136
882
+ ],
883
+ "page_idx": 8
884
+ },
885
+ {
886
+ "type": "text",
887
+ "text": "Question: What is the man holding at the start of the video? GT Answer: guitar, electric guitar Just Ask: typewriter UnFrozenBiLM: beer FrozenBiLM (text-only): scissors FrozenBiLM (ours): guitar ",
888
+ "bbox": [
889
+ 174,
890
+ 138,
891
+ 294,
892
+ 195
893
+ ],
894
+ "page_idx": 8
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "Question: What item hanging on the wall features a tree? GT Answer: quilt Just Ask: christmas sock UnFrozenBiLM: fabric FrozenBiLM (text-only): tree FrozenBiLM (ours): quilt ",
899
+ "bbox": [
900
+ 303,
901
+ 138,
902
+ 423,
903
+ 195
904
+ ],
905
+ "page_idx": 8
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "Question: What is the sitting \nman doing? \nGT Answer: knit sweater \nJust Ask: tie cow \nUnFrozenBiLM: swimming \nFrozenBiLM (text-only): eating \nFrozenBiLM (ours): knit sweater \nQuestion: Where is the woma \nsitting on? \nGT Answer: camel \nJust Ask: horse yard \nUnFrozenBiLM: desert \nFrozenBiLM (text-only): chair \nFrozenBiLM (ours): camel \nQuestion: What is the color of the \ncabinet door in the video? \nGT Answer: red \nJust Ask: dresser \nUnFrozenBiLM: blue \nFrozenBiLM (text-only): black \nFrozenBiLM (ours): red ",
910
+ "bbox": [
911
+ 434,
912
+ 138,
913
+ 550,
914
+ 195
915
+ ],
916
+ "page_idx": 8
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "",
921
+ "bbox": [
922
+ 565,
923
+ 138,
924
+ 676,
925
+ 195
926
+ ],
927
+ "page_idx": 8
928
+ },
929
+ {
930
+ "type": "text",
931
+ "text": "",
932
+ "bbox": [
933
+ 696,
934
+ 138,
935
+ 821,
936
+ 195
937
+ ],
938
+ "page_idx": 8
939
+ },
940
+ {
941
+ "type": "table",
942
+ "img_path": "images/5d331eb7c2f004a80377ecea99d122f7e59f820748fbff33949db9a085bfba1d.jpg",
943
+ "table_caption": [
944
+ "Figure 3: Zero-Shot VideoQA. Qualitative comparison between Just Ask [102] (row 3 in Table 5), our model (row 4 in Table 5), its unfrozen variant (row 2 in Table 1) and its text-only variant (row 2 in Table 2). The first two examples are from iVQA [101] and the last three examples are from ActivityNet-QA [108]. "
945
+ ],
946
+ "table_footnote": [
947
+ "Table 6: Comparison with the state of the art, and the variant UnFrozenBiLM which does not freeze the language model weight, on fully-supervised benchmarks. \\* denotes results obtained with speech input. "
948
+ ],
949
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"2\">#Trained|Fill-in-the-blank|</td><td colspan=\"5\">Open-ended</td><td colspan=\"2\">Multiple-choice</td></tr><tr><td>Params</td><td>LSMDC</td><td></td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA|How2QA TVQA</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>HCRN [45]</td><td>44M</td><td></td><td></td><td>35.4</td><td>36.8</td><td></td><td>57.9</td><td></td><td>71.4*</td></tr><tr><td>HERO [54]</td><td>119M</td><td></td><td></td><td></td><td></td><td></td><td></td><td>74.1*</td><td>73.6*</td></tr><tr><td>ClipBERT[48]</td><td>114M</td><td></td><td></td><td>37.4</td><td></td><td></td><td>60.3</td><td></td><td></td></tr><tr><td>Just Ask [102]</td><td>157M</td><td></td><td>35.4</td><td>41.8</td><td>47.5</td><td>39.0</td><td></td><td>85.3</td><td></td></tr><tr><td>SiaSamRea [107]</td><td></td><td></td><td></td><td>41.6</td><td>45.5</td><td>39.8</td><td>60.2</td><td>84.1</td><td></td></tr><tr><td>MERLOT[109]</td><td>223M</td><td>52.9</td><td></td><td>43.1</td><td></td><td>41.4</td><td>69.5</td><td></td><td>78.7*</td></tr><tr><td>Reserve [110]</td><td>644M</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>86.1*</td></tr><tr><td>VIOLET[21]</td><td>198M</td><td>53.7</td><td></td><td>43.9</td><td>47.9</td><td></td><td>68.9</td><td></td><td></td></tr><tr><td>All-in-one [93]</td><td>110M</td><td></td><td></td><td>46.8</td><td>48.3</td><td></td><td>66.3</td><td></td><td></td></tr><tr><td>UnFrozenBiLM(Ours)</td><td>890M</td><td>58.9*</td><td>37.7*</td><td>45.0*</td><td>53.9*</td><td>43.2*</td><td>66.9</td><td>87.5*</td><td>79.6*</td></tr><tr><td>FrozenBiLM w/o speech (Ours) 30M</td><td></td><td>58.6</td><td>39.7</td><td>47.0</td><td>54.4</td><td>43.2</td><td>68.6</td><td>81.5</td><td>57.5</td></tr><tr><td>FrozenBiLM(Ours)</td><td>30M</td><td>63.5*</td><td>39.6*</td><td>47.0*</td><td>54.8*</td><td>43.2*</td><td>68.6</td><td>86.7*</td><td>82.0*</td></tr></table>",
950
+ "bbox": [
951
+ 176,
952
+ 255,
953
+ 825,
954
+ 397
955
+ ],
956
+ "page_idx": 8
957
+ },
958
+ {
959
+ "type": "table",
960
+ "img_path": "images/30f3e80efdebfa5ffaaf3f47101433efe66fbb141612ee8160a3bc39f48a0054.jpg",
961
+ "table_caption": [],
962
+ "table_footnote": [
963
+ "Table 7: Few-shot results, by finetuning FrozenBiLM using a small fraction of the downstream training dataset. "
964
+ ],
965
+ "table_body": "<table><tr><td rowspan=\"2\">Supervision</td><td rowspan=\"2\"></td><td rowspan=\"2\">Fill-in-the-blank LSMDC</td><td colspan=\"4\">Open-ended</td><td rowspan=\"2\">Multiple-choice</td></tr><tr><td></td><td>iVQA MSRVTT-QA MSVD-QA ActivityNet-QA TGIF-QA</td><td></td><td>How2QA TVQA</td></tr><tr><td>1.</td><td>0% (zero-shot)</td><td>51.5</td><td>26.8</td><td>16.7 33.8</td><td>25.9</td><td>41.9</td><td>58.4</td><td>59.7</td></tr><tr><td>2.</td><td>1% (few-shot)</td><td>56.9</td><td>31.1</td><td>36.0</td><td>46.5</td><td>33.2 55.1</td><td>71.7</td><td>72.5</td></tr><tr><td>3.</td><td>10% (few-shot)</td><td>59.9</td><td>35.3</td><td>41.7</td><td>51.0</td><td>37.4</td><td>61.2 75.8</td><td>77.6</td></tr><tr><td></td><td>4.100% (fully-supervised)</td><td>63.5</td><td>39.6</td><td>47.0</td><td>54.8</td><td>43.2</td><td>68.6 86.7</td><td>82.0</td></tr></table>",
966
+ "bbox": [
967
+ 176,
968
+ 450,
969
+ 823,
970
+ 515
971
+ ],
972
+ "page_idx": 8
973
+ },
974
+ {
975
+ "type": "text",
976
+ "text": "particular, FrozenBiLM outperforms Reserve [110], which is trained on one billion YouTube video clips jointly with vision, language and sound, Just Ask [102], which uses large-scale automatically generated VideoQA data, and a CLIP baseline [71] matching the text concatenating question and answer to the middle frame of the video. Note that FrozenBiLM performs competitively even when using no speech input. Finally, we note that BLIP [53] has a different definition of zero-shot where a network finetuned on the image-VQA dataset [4] is evaluated directly on VideoQA datasets. Our Supplementary Material presents results where we outperform BLIP [53] in their settings and also includes an analysis of results by question type. In summary, our evaluation shows the excellent performance of our model in the challenging zero-shot setup. ",
977
+ "bbox": [
978
+ 174,
979
+ 570,
980
+ 825,
981
+ 695
982
+ ],
983
+ "page_idx": 8
984
+ },
985
+ {
986
+ "type": "text",
987
+ "text": "Qualitative results. Figure 3 illustrates qualitative results of zero-shot VideoQA for our FrozenBiLM model and compares them to Just Ask [102], as well as to variants of our approach that do not freeze the language model (UnFrozenBiLM) and use no visual modality (text-only), as evaluated in Section 4.2. We observe that the unfrozen variant can predict answers that lack text-only commonsense reasoning, e.g. in the third example, it is unlikely that a sitting man is swimming. The text-only variant does have strong language understanding, but makes visually-unrelated predictions. In contrast, consistently with our quantitative results, our model FrozenBiLM is able to correctly answer various questions, showing both a strong textual commonsense reasoning and a complex multi-modal understanding. We show additional qualitative results in the Supplementary Material. ",
988
+ "bbox": [
989
+ 173,
990
+ 702,
991
+ 825,
992
+ 827
993
+ ],
994
+ "page_idx": 8
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "4.5 Freezing the BiLM is also beneficial in supervised settings ",
999
+ "text_level": 1,
1000
+ "bbox": [
1001
+ 174,
1002
+ 843,
1003
+ 612,
1004
+ 858
1005
+ ],
1006
+ "page_idx": 8
1007
+ },
1008
+ {
1009
+ "type": "text",
1010
+ "text": "Fully-supervised VideoQA. We next present an evaluation in a supervised setup where we finetune FrozenBiLM on a downstream VideoQA task. We emphasize that we also keep our pretrained language model weights frozen all throughout finetuning. As shown in Table 6, our approach improves the state of the art on LSMDC-FiB, iVQA, MSRVTT-QA, MSVD-QA, ActivityNet-QA and How2QA. In particular, FrozenBiLM outperforms strong recent baselines such as All-in-one [93] on 2/3 datasets, VIOLET [21] on 3/4 datasets and MERLOT [109] on 4/5 datasets. Our approach has significantly less trainable parameters compared to the state of the art [21, 93, 109] as we freeze the weights of the pretrained language model. We ablate this major difference in Table 6, and find that our FrozenBiLM with the frozen language model performs better and trains twice faster compared to UnFrozenBiLM where we update the language model during training. This shows that freezing the language model is not only beneficial for zero-shot but also in fully-supervised settings, therefore suggesting that our FrozenBiLM framework also provides a parameter-efficient solution for VideoQA training. Finally, we note that FrozenBiLM performs competitively even without speech input, although speech helps significantly for the performance on LSMDC, How2QA and TVQA. ",
1011
+ "bbox": [
1012
+ 174,
1013
+ 869,
1014
+ 823,
1015
+ 911
1016
+ ],
1017
+ "page_idx": 8
1018
+ },
1019
+ {
1020
+ "type": "text",
1021
+ "text": "",
1022
+ "bbox": [
1023
+ 174,
1024
+ 90,
1025
+ 825,
1026
+ 243
1027
+ ],
1028
+ "page_idx": 9
1029
+ },
1030
+ {
1031
+ "type": "text",
1032
+ "text": "Few-shot VideoQA. The low number of trainable parameters when training FrozenBiLM makes it particularly well-suited in the low data regime. To verify this, we explore a few-shot VideoQA setting where we finetune our pretrained model using varying fractions of VideoQA training data. From Table 7 we observe significant improvements over zero-shot when using only $1 \\%$ of training data. Finally, we show in Supplementary Material that freezing the BiLM highly benefits the few-shot performance, consistently with the results in the zero-shot and fully-supervised settings. ",
1033
+ "bbox": [
1034
+ 174,
1035
+ 250,
1036
+ 825,
1037
+ 333
1038
+ ],
1039
+ "page_idx": 9
1040
+ },
1041
+ {
1042
+ "type": "text",
1043
+ "text": "5 Conclusion ",
1044
+ "text_level": 1,
1045
+ "bbox": [
1046
+ 174,
1047
+ 352,
1048
+ 299,
1049
+ 369
1050
+ ],
1051
+ "page_idx": 9
1052
+ },
1053
+ {
1054
+ "type": "text",
1055
+ "text": "We have presented FrozenBiLM, a framework that extends frozen bidirectional language models to multi-modal inputs by training additional modules on Web-scraped data, and that tackles zero-shot VideoQA through masked language modeling. We have provided extensive ablation studies and shown the efficiency of our framework compared to its autoregressive variant. FrozenBiLM improves the state-of-the-art zero-shot VideoQA on various datasets, performs competitively in fully-supervised settings and exhibits strong performance in the few-shot VideoQA setting we newly introduce. ",
1056
+ "bbox": [
1057
+ 174,
1058
+ 383,
1059
+ 825,
1060
+ 467
1061
+ ],
1062
+ "page_idx": 9
1063
+ },
1064
+ {
1065
+ "type": "text",
1066
+ "text": "Limitations. Promising directions not explored in this work include scaling the size of a bidirectional language model to several billion parameters, and additional training on large datasets of YouTube videos with accompanying speech transcripts and/or audio [110]. Also, our model cannot be applied out-of-the-box to complex multi-modal text generation tasks such as video captioning. ",
1067
+ "bbox": [
1068
+ 174,
1069
+ 473,
1070
+ 825,
1071
+ 529
1072
+ ],
1073
+ "page_idx": 9
1074
+ },
1075
+ {
1076
+ "type": "text",
1077
+ "text": "Broader Impact. We have showed the superior compute-efficiency of our bidirectional framework compared to autoregressive models for zero-shot VideoQA, and believe it is a step towards reducing the environmental impact of such research and its applications [84]. In addition, our models might reflect biases present in videos and captions from Shutterstock used to train our model, the text data used to train the language model or the images and captions used to train the visual backbone. It is important to keep this in mind when deploying, analysing and building upon these models. ",
1078
+ "bbox": [
1079
+ 174,
1080
+ 535,
1081
+ 825,
1082
+ 619
1083
+ ],
1084
+ "page_idx": 9
1085
+ },
1086
+ {
1087
+ "type": "text",
1088
+ "text": "Acknowledgements. This work was granted access to the HPC resources of IDRIS under the allocation 2022-AD011011670R2 made by GENCI. The work was funded by a Google gift, the French government under management of Agence Nationale de la Recherche as part of the \"Investissements d’avenir\" program, reference ANR-19-P3IA-0001 (PRAIRIE 3IA Institute), the Louis Vuitton ENS Chair on Artificial Intelligence, the European Regional Development Fund under project IMPACT (reg. no. CZ.02.1.01/0.0/0.0/15 003/0000468). We thank anonymous reviewers for giving interesting feedback. We thank Gaspard Beugnot, Clémence Bouvier and Pierre-Louis Guhur for proofreading. ",
1089
+ "bbox": [
1090
+ 173,
1091
+ 625,
1092
+ 825,
1093
+ 722
1094
+ ],
1095
+ "page_idx": 9
1096
+ },
1097
+ {
1098
+ "type": "text",
1099
+ "text": "References [1] FrozenBiLM project webpage. https://antoyang.github.io/frozenbilm.html. [2] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. In NeurIPS, 2022. [3] Elad Amrani, Rami Ben-Ari, Daniel Rotman, and Alex Bronstein. Noise estimation using density estimation for self-supervised multimodal learning. In AAAI, 2021. [4] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. VQA: Visual question answering. In ICCV, 2015. [5] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. [6] Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. Frozen in time: A joint video and image encoder for end-to-end retrieval. In ICCV, 2021. [7] Sid Black, Gao Leo, Phil Wang, Connor Leahy, and Stella Biderman. GPT-Neo: Large Scale Autoregressive Language Modeling with Mesh-Tensorflow, 2021. [8] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020. [9] Santiago Castro, Mahmoud Azab, Jonathan Stroud, Cristina Noujaim, Ruoyao Wang, Jia Deng, and Rada Mihalcea. LifeQA: A real-life dataset for video question answering. In LREC, 2020. \n[10] Aman Chadha, Gurneet Arora, and Navpreet Kaloty. iPerceive: Applying common-sense reasoning to multi-modal dense video captioning and video question answering. In WACV, 2021. \n[11] Jun Chen, Han Guo, Kai Yi, Boyang Li, and Mohamed Elhoseiny. VisualGPT: Dataefficient adaptation of pretrained language models for image captioning. arXiv preprint arXiv:2102.10407, 2021. \n[12] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. UNITER: Universal image-text representation learning. In ECCV, 2020. \n[13] Seongho Choi, Kyoung-Woon On, Yu-Jung Heo, Ahjeong Seo, Youwon Jang, Seungchan Lee, Minsu Lee, and Byoung-Tak Zhang. DramaQA: Character-centered video story understanding with hierarchical qa. In AAAI, 2021. \n[14] Anthony Colas, Seokhwan Kim, Franck Dernoncourt, Siddhesh Gupte, Daisy Zhe Wang, and Doo Soon Kim. TutorialVQA: Question answering dataset for tutorial videos. In LREC, 2020. \n[15] Long Hoang Dang, Thao Minh Le, Vuong Le, and Truyen Tran. Object-centric representation learning for video question answering. In IJCNN, 2021. \n[16] Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, ˆ Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. IEEE TPAMI, 2021. \n[17] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019. \n[18] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. \n[19] Constantin Eichenberg, Sidney Black, Samuel Weinbach, Letitia Parcalabescu, and Anette Frank. MAGMA–multimodal augmentation of generative models through adapter-based finetuning. arXiv preprint arXiv:2112.05253, 2021. \n[20] Chenyou Fan, Xiaofan Zhang, Shu Zhang, Wensheng Wang, Chi Zhang, and Heng Huang. Heterogeneous memory enhanced multimodal attention model for video question answering. In CVPR, 2019. \n[21] Tsu-Jui Fu, Linjie Li, Zhe Gan, Kevin Lin, William Yang Wang, Lijuan Wang, and Zicheng Liu. VIOLET: End-to-end video-language transformers with masked visual-token modeling. arXiv preprint arXiv:2111.12681, 2021. \n[22] Zhe Gan, Yen-Chun Chen, Linjie Li, Chen Zhu, Yu Cheng, and Jingjing Liu. Large-scale adversarial training for vision-and-language representation learning. In NeurIPS, 2020. \n[23] Jiyang Gao, Runzhou Ge, Kan Chen, and Ram Nevatia. Motion-appearance co-memory networks for video question answering. In CVPR, 2018. \n[24] Noa Garcia, Mayu Otani, Chenhui Chu, and Yuta Nakashima. KnowIT VQA: Answering knowledge-based questions about videos. In AAAI, 2020. \n[25] Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. DeBERTa: Decodingenhanced BERT with disentangled attention. In ICLR, 2021. \n[26] Lisa Anne Hendricks, John Mellor, Rosalia Schneider, Jean-Baptiste Alayrac, and Aida Nematzadeh. Decoupling the role of data, attention, and losses in multimodal transformers. In TACL, 2021. \n[27] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. \n[28] Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In ICML, 2019. \n[29] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In ICLR, 2022. \n[30] Deng Huang, Peihao Chen, Runhao Zeng, Qing Du, Mingkui Tan, and Chuang Gan. Locationaware graph convolutional networks for video question answering. In AAAI, 2020. \n[31] Zhicheng Huang, Zhaoyang Zeng, Bei Liu, Dongmei Fu, and Jianlong Fu. Pixel-BERT: Aligning image pixels with text by deep multi-modal transformers. arXiv preprint arXiv:2004.00849, 2020. \n[32] Yunseok Jang, Yale Song, Youngjae Yu, Youngjin Kim, and Gunhee Kim. TGIF-QA: Toward spatio-temporal reasoning in visual question answering. In CVPR, 2017. \n[33] Jianwen Jiang, Ziqiang Chen, Haojie Lin, Xibin Zhao, and Yue Gao. Divide and conquer: Question-guided spatio-temporal contextual attention for video question answering. In AAAI, 2020. \n[34] Pin Jiang and Yahong Han. Reasoning with heterogeneous graph alignment for video question answering. In AAAI, 2020. \n[35] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. SpanBERT: Improving pre-training by representing and predicting spans. In TACL, 2020. \n[36] Hyounghun Kim, Zineng Tang, and Mohit Bansal. Dense-caption matching and frame-selection gating for temporal localization in VideoQA. In ACL, 2020. \n[37] Junyeong Kim, Minuk Ma, Trung Pham, Kyungsu Kim, and Chang D Yoo. Modality shifting attention network for multi-modal video question answering. In CVPR, 2020. \n[38] Kyung-Min Kim, Min-Oh Heo, Seong-Ho Choi, and Byoung-Tak Zhang. Deepstory: Video story qa by deep embedded memory networks. In IJCAI, 2017. \n[39] Seonhoon Kim, Seohyeong Jeong, Eunbyul Kim, Inho Kang, and Nojun Kwak. Self-supervised pre-training and contrastive representation learning for multiple-choice video qa. In AAAI, 2021. \n[40] Wonjae Kim, Bokyung Son, and Ildoo Kim. ViLT: Vision-and-language transformer without convolution or region supervision. In ICML, 2021. \n[41] Taku Kudo and John Richardson. Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In ACL, 2018. \n[42] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A lite BERT for self-supervised learning of language representations. In ICLR, 2020. \n[43] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Hierarchical conditional relation networks for video question answering. In CVPR, 2020. \n[44] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Neural reasoning, fast and slow, for video question answering. In IJCNN, 2020. \n[45] Thao Minh Le, Vuong Le, Svetha Venkatesh, and Truyen Tran. Hierarchical conditional relation networks for multimodal video question answering. In IJCV, 2021. \n[46] Jie Lei, Licheng Yu, Mohit Bansal, and Tamara L Berg. TVQA: Localized, compositional video question answering. In EMNLP, 2018. \n[47] Jie Lei, Licheng Yu, Tamara L Berg, and Mohit Bansal. TVQA $^ +$ : Spatio-temporal grounding for video question answering. In ACL, 2020. \n[48] Jie Lei, Linjie Li, Luowei Zhou, Zhe Gan, Tamara L Berg, Mohit Bansal, and Jingjing Liu. Less is more: ClipBERT for video-and-language learning via sparse sampling. In CVPR, 2021. \n[49] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In EMNLP, 2021. \n[50] Dongxu Li, Junnan Li, Hongdong Li, Juan Carlos Niebles, and Steven CH Hoi. Align and prompt: Video-and-language pre-training with entity prompts. arXiv preprint arXiv:2112.09583, 2021. \n[51] Gen Li, Nan Duan, Yuejian Fang, Ming Gong, Daxin Jiang, and Ming Zhou. Unicoder-VL: A universal encoder for vision and language by cross-modal pre-training. In AAAI, 2020. \n[52] Junnan Li, Ramprasaath Selvaraju, Akhilesh Gotmare, Shafiq Joty, Caiming Xiong, and Steven Chu Hong Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, 2021. \n[53] Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. BLIP: Bootstrapping languageimage pre-training for unified vision-language understanding and generation. arXiv preprint arXiv:2201.12086, 2022. \n[54] Linjie Li, Yen-Chun Chen, Yu Cheng, Zhe Gan, Licheng Yu, and Jingjing Liu. HERO: Hierarchical encoder for video+language omni-representation pre-training. In EMNLP, 2020. \n[55] Linjie Li, Jie Lei, Zhe Gan, Licheng Yu, Yen-Chun Chen, Rohit Pillai, Yu Cheng, Luowei Zhou, Xin Eric Wang, William Yang Wang, et al. VALUE: A multi-task benchmark for video-and-language understanding evaluation. In NeurIPS Track on Datasets and Benchmarks, 2021. \n[56] Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. VisualBERT: A simple and performant baseline for vision and language. arXiv preprint arXiv:1908.03557, 2019. \n[57] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In ACL, 2021. \n[58] Xiangpeng Li, Jingkuan Song, Lianli Gao, Xianglong Liu, Wenbing Huang, Xiangnan He, and Chuang Gan. Beyond RNNs: Positional self-attention with co-attention for video question answering. In AAAI, 2019. \n[59] Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In ECCV, 2020. \n[60] Xudong Lin, Gedas Bertasius, Jue Wang, Shih-Fu Chang, Devi Parikh, and Lorenzo Torresani. VX2TEXT: End-to-end learning of video-based text generation from multimodal inputs. In CVPR, 2021. \n[61] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019. \n[62] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In NeurIPS, 2019. \n[63] Jiasen Lu, Vedanuj Goswami, Marcus Rohrbach, Devi Parikh, and Stefan Lee. 12-in-1: Multi-task vision and language representation learning. In CVPR, 2020. \n[64] Ziyang Luo, Yadong Xi, Rongsheng Zhang, and Jing Ma. VC-GPT: Visual conditioned GPT for end-to-end generative vision-and-language pre-training. arXiv preprint arXiv:2201.12723, 2022. \n[65] Rabeeh Karimi Mahabadi, Luke Zettlemoyer, James Henderson, Marzieh Saeidi, Lambert Mathias, Veselin Stoyanov, and Majid Yazdani. PERFECT: Prompt-free and efficient few-shot learning with language models. In ACL, 2022. \n[66] Tegan Maharaj, Nicolas Ballas, Anna Rohrbach, Aaron Courville, and Christopher Pal. A dataset and exploration of models for understanding video data through fill-in-the-blank question-answering. In CVPR, 2017. \n[67] Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, and Josef Sivic. HowTo100M: Learning a text-video embedding by watching hundred million narrated video clips. In ICCV, 2019. \n[68] Ron Mokady, Amir Hertz, and Amit H Bermano. ClipCap: Clip prefix for image captioning. arXiv preprint arXiv:2111.09734, 2021. \n[69] Jonghwan Mun, Paul Hongsuck Seo, Ilchae Jung, and Bohyung Han. MarioQA: Answering questions by watching gameplay videos. In CVPR, 2017. \n[70] Jungin Park, Jiyoung Lee, and Kwanghoon Sohn. Bridge to answer: Structure-aware graph interaction network for video question answering. In CVPR, 2021. \n[71] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021. \n[72] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 2020. \n[73] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016. \n[74] Arka Sadhu, Kan Chen, and Ram Nevatia. Video question answering with phrases via semantic roles. In NAACL, 2021. \n[75] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. \n[76] Timo Schick and Hinrich Schütze. Exploiting cloze questions for few shot text classification and natural language inference. In EACL, 2021. \n[77] Timo Schick and Hinrich Schütze. It’s not just size that matters: Small language models are also few-shot learners. In NAACL, 2021. \n[78] Paul Hongsuck Seo, Arsha Nagrani, and Cordelia Schmid. Look before you speak: Visually contextualized utterances. In CVPR, 2021. \n[79] Paul Hongsuck Seo, Arsha Nagrani, Anurag Arnab, and Cordelia Schmid. End-to-end generative pretraining for multimodal video captioning. In CVPR, 2022. \n[80] Sheng Shen, Liunian Harold Li, Hao Tan, Mohit Bansal, Anna Rohrbach, Kai-Wei Chang, Zhewei Yao, and Kurt Keutzer. How much can clip benefit vision-and-language tasks? arXiv preprint arXiv:2107.06383, 2021. \n[81] Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. Flava: A foundational language and vision alignment model. In CVPR, 2022. \n[82] David R So, Wojciech Manke, Hanxiao Liu, Zihang Dai, Noam Shazeer, and Quoc V ´ Le. Primer: Searching for efficient transformers for language modeling. arXiv preprint arXiv:2109.08668, 2021. \n[83] Xiaomeng Song, Yucheng Shi, Xin Chen, and Yahong Han. Explore multi-step reasoning in video question answering. In ACM international conference on Multimedia, 2018. \n[84] Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. In ACL, 2019. \n[85] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. VL-BERT: Pre-training of generic visual-linguistic representations. In ICLR, 2019. \n[86] Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. VideoBERT: A joint model for video and language representation learning. In ICCV, 2019. \n[87] Derek Tam, Rakesh R Menon, Mohit Bansal, Shashank Srivastava, and Colin Raffel. Improving and simplifying pattern exploiting training. In EMNLP, 2021. \n[88] Hao Tan and Mohit Bansal. LXMERT: Learning cross-modality encoder representations from transformers. In EMNLP, 2019. \n[89] Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. MovieQA: Understanding stories in movies through question-answering. In CVPR, 2016. \n[90] Wilson L Taylor. “cloze procedure”: A new tool for measuring readability. Journalism quarterly, 30(4):415–433, 1953. \n[91] Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. In NeurIPS, 2021. \n[92] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. \n[93] Alex Jinpeng Wang, Yixiao Ge, Rui Yan, Yuying Ge, Xudong Lin, Guanyu Cai, Jianping Wu, Ying Shan, Xiaohu Qie, and Mike Zheng Shou. All in one: Exploring unified video-language pre-training. arXiv preprint arXiv:2203.07303, 2022. \n[94] Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model, 2021. \n[95] Jianfeng Wang, Xiaowei Hu, Zhe Gan, Zhengyuan Yang, Xiyang Dai, Zicheng Liu, Yumao Lu, and Lijuan Wang. UFO: A unified transformer for vision-language representation learning. arXiv preprint arXiv:2111.10023, 2021. \n[96] Zhenhailong Wang, Manling Li, Ruochen Xu, Luowei Zhou, Jie Lei, Xudong Lin, Shuohang Wang, Ziyi Yang, Chenguang Zhu, Derek Hoiem, et al. Language models with image descriptors are strong few-shot video-language learners. In NeurIPS, 2022. \n[97] Junbin Xiao, Xindi Shang, Angela Yao, and Tat-Seng Chua. NExT-QA: Next phase of question-answering to explaining temporal actions. In CVPR, 2021. \n[98] Dejing Xu, Zhou Zhao, Jun Xiao, Fei Wu, Hanwang Zhang, Xiangnan He, and Yueting Zhuang. Video question answering via gradually refined attention over appearance and motion. In ACM international conference on Multimedia, 2017. \n[99] Hu Xu, Gargi Ghosh, Po-Yao Huang, Dmytro Okhonko, Armen Aghajanyan, Florian Metze, Luke Zettlemoyer, and Christoph Feichtenhofer. Videoclip: Contrastive pre-training for zero-shot video-text understanding. In EMNLP, 2021. \n[100] Hongyang Xue, Wenqing Chu, Zhou Zhao, and Deng Cai. A better way to attend: Attention with trees for video question answering. IEEE Transactions on Image Processing, 2018. \n[101] Antoine Yang, Antoine Miech, Josef Sivic, Ivan Laptev, and Cordelia Schmid. Just ask: Learning to answer questions from millions of narrated videos. In ICCV, 2021. \n[102] Antoine Yang, Antoine Miech, Josef Sivic, Ivan Laptev, and Cordelia Schmid. Learning to answer visual questions from web videos. IEEE TPAMI, 2022. \n[103] Zekun Yang, Noa Garcia, Chenhui Chu, Mayu Otani, Yuta Nakashima, and Haruo Takemura. BERT representations for video question answering. In WACV, 2020. \n[104] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Yumao Lu, Zicheng Liu, and Lijuan Wang. An empirical study of GPT-3 for few-shot knowledge-based VQA. arXiv preprint arXiv:2109.05014, 2021. \n[105] Yunan Ye, Zhou Zhao, Yimeng Li, Long Chen, Jun Xiao, and Yueting Zhuang. Video question answering via attribute-augmented attention network learning. In ACM SIGIR, 2017. \n[106] Fei Yu, Jiji Tang, Weichong Yin, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. Ernie-vil: Knowledge enhanced vision-language representations through scene graph. In AAAI, 2020. \n[107] Weijiang Yu, Haoteng Zheng, Mengfei Li, Lei Ji, Lijun Wu, Nong Xiao, and Nan Duan. Learning from inside: Self-driven siamese sampling and reasoning for video question answering. In NeurIPS, 2021. \n[108] Zhou Yu, Dejing Xu, Jun Yu, Ting Yu, Zhou Zhao, Yueting Zhuang, and Dacheng Tao. ActivityNet-QA: A dataset for understanding complex web videos via question answering. In AAAI, 2019. \n[109] Rowan Zellers, Ximing Lu, Jack Hessel, Youngjae Yu, Jae Sung Park, Jize Cao, Ali Farhadi, and Yejin Choi. MERLOT: Multimodal neural script knowledge models. In NeurIPS, 2021. \n[110] Rowan Zellers, Jiasen Lu, Ximing Lu, Youngjae Yu, Yanpeng Zhao, Mohammadreza Salehi, Aditya Kusupati, Jack Hessel, Ali Farhadi, and Yejin Choi. MERLOT Reserve: Neural script knowledge through vision and language and sound. In CVPR, 2022. \n[111] Andy Zeng, Adrian Wong, Stefan Welker, Krzysztof Choromanski, Federico Tombari, Aveek Purohit, Michael Ryoo, Vikas Sindhwani, Johnny Lee, Vincent Vanhoucke, et al. Socratic models: Composing zero-shot multimodal reasoning with language. arXiv preprint arXiv:2204.00598, 2022. \n[112] Zheng-Jun Zha, Jiawei Liu, Tianhao Yang, and Yongdong Zhang. Spatiotemporal-textual coattention network for video question answering. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 2019. \n[113] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. arXiv preprint arXiv:2109.01134, 2021. \n[114] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason J Corso, and Jianfeng Gao. Unified vision-language pre-training for image captioning and VQA. In AAAI, 2020. \n[115] Linchao Zhu and Yi Yang. ActBERT: Learning global-local video-text representations. In CVPR, 2020. \n[116] Yueting Zhuang, Dejing Xu, Xin Yan, Wenzhuo Cheng, Zhou Zhao, Shiliang Pu, and Jun Xiao. Multichannel attention refinement for video question answering. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 2020. ",
1100
+ "bbox": [
1101
+ 174,
1102
+ 89,
1103
+ 828,
1104
+ 919
1105
+ ],
1106
+ "page_idx": 10
1107
+ },
1108
+ {
1109
+ "type": "text",
1110
+ "text": "",
1111
+ "bbox": [
1112
+ 176,
1113
+ 54,
1114
+ 828,
1115
+ 915
1116
+ ],
1117
+ "page_idx": 11
1118
+ },
1119
+ {
1120
+ "type": "text",
1121
+ "text": "",
1122
+ "bbox": [
1123
+ 176,
1124
+ 49,
1125
+ 828,
1126
+ 911
1127
+ ],
1128
+ "page_idx": 12
1129
+ },
1130
+ {
1131
+ "type": "text",
1132
+ "text": "",
1133
+ "bbox": [
1134
+ 178,
1135
+ 69,
1136
+ 828,
1137
+ 916
1138
+ ],
1139
+ "page_idx": 13
1140
+ },
1141
+ {
1142
+ "type": "text",
1143
+ "text": "",
1144
+ "bbox": [
1145
+ 178,
1146
+ 68,
1147
+ 828,
1148
+ 914
1149
+ ],
1150
+ "page_idx": 14
1151
+ },
1152
+ {
1153
+ "type": "text",
1154
+ "text": "",
1155
+ "bbox": [
1156
+ 171,
1157
+ 46,
1158
+ 828,
1159
+ 914
1160
+ ],
1161
+ "page_idx": 15
1162
+ },
1163
+ {
1164
+ "type": "text",
1165
+ "text": "",
1166
+ "bbox": [
1167
+ 171,
1168
+ 90,
1169
+ 826,
1170
+ 210
1171
+ ],
1172
+ "page_idx": 16
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": 17
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "1. For all authors... ",
1189
+ "bbox": [
1190
+ 214,
1191
+ 116,
1192
+ 339,
1193
+ 130
1194
+ ],
1195
+ "page_idx": 17
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] See Section 3 for contribution (i), Sections 4.2 and 4.3 for contribution (ii), and Sections 4.4 and 4.5 for contribution (iii). \n(b) Did you describe the limitations of your work? [Yes] See Section 5. \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1200
+ "bbox": [
1201
+ 238,
1202
+ 135,
1203
+ 825,
1204
+ 253
1205
+ ],
1206
+ "page_idx": 17
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "2. If you are including theoretical results... ",
1211
+ "bbox": [
1212
+ 214,
1213
+ 257,
1214
+ 493,
1215
+ 272
1216
+ ],
1217
+ "page_idx": 17
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] No theoretical results. (b) Did you include complete proofs of all theoretical results? [N/A] No theoretical results. ",
1222
+ "bbox": [
1223
+ 238,
1224
+ 276,
1225
+ 825,
1226
+ 321
1227
+ ],
1228
+ "page_idx": 17
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "3. If you ran experiments... ",
1233
+ "bbox": [
1234
+ 212,
1235
+ 325,
1236
+ 393,
1237
+ 340
1238
+ ],
1239
+ "page_idx": 17
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] Our code, together with instructions needed to download and process the datasets we use, and instructions needed to reproduce the main experimental results, is open-sourced at [1]. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1 and Supplementary Material. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We report them in the Supplementary Material, as error bars are in general not reported [101, 107, 109, 110]. \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 Section 4.1 and Supplementary Material. ",
1244
+ "bbox": [
1245
+ 238,
1246
+ 344,
1247
+ 825,
1248
+ 517
1249
+ ],
1250
+ "page_idx": 17
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
+ 214,
1257
+ 522,
1258
+ 823,
1259
+ 536
1260
+ ],
1261
+ "page_idx": 17
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4.1. \n(b) Did you mention the license of the assets? [Yes] See Supplementary Material. \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We provide code and trained models at [1]. \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] The datasets we use are publicly available and released for non-commercial use only, and this is already specified in the license. \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] The datasets we use are based on websites such as YouTube which strictly remove videos that contain offensive content or do not follow their community guidelines. ",
1266
+ "bbox": [
1267
+ 238,
1268
+ 541,
1269
+ 825,
1270
+ 703
1271
+ ],
1272
+ "page_idx": 17
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1277
+ "bbox": [
1278
+ 214,
1279
+ 708,
1280
+ 705,
1281
+ 722
1282
+ ],
1283
+ "page_idx": 17
1284
+ },
1285
+ {
1286
+ "type": "text",
1287
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] No crowdsourcing or conducted research with human subjects. \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] No crowdsourcing or conducted research with human subjects. \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] No crowdsourcing or conducted research with human subjects. ",
1288
+ "bbox": [
1289
+ 238,
1290
+ 727,
1291
+ 825,
1292
+ 843
1293
+ ],
1294
+ "page_idx": 17
1295
+ }
1296
+ ]
parse/dev/9uRS5ysgb9/9uRS5ysgb9_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/9uRS5ysgb9/9uRS5ysgb9_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/NpsVSN6o4ul/NpsVSN6o4ul.md ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # INTERPRETABILITY IN THE WILD: A CIRCUIT FOR INDIRECT OBJECT IDENTIFICATION IN GPT-2 SMALL
2
+
3
+ Kevin Wang∗, Alexandre Variengien\*, Arthur Conmy\*, Buck Shlegeris†, Jacob Steinhardt†‡§
4
+ †Redwood Research
5
+ ‡UC Berkeley
6
+
7
+ # ABSTRACT
8
+
9
+ Research in mechanistic interpretability seeks to explain behaviors of ML models in terms of their internal components. However, most previous work either focuses on simple behaviors in small models, or describes complicated behaviors in larger models with broad strokes. In this work, we bridge this gap by presenting an explanation for how GPT-2 small performs a natural language task that requires logical reasoning: indirect object identification (IOI). Our explanation encompasses 28 attention heads grouped into 7 main classes, which we discovered using a combination of interpretability approaches including causal interventions and projections. To our knowledge, this investigation is the largest end-to-end attempt at reverse-engineering a natural behavior “in the wild” in a language model. We evaluate the reliability of our explanation using three quantitative criteria– faithfulness, completeness and minimality. Though these criteria support our explanation, they also point to remaining gaps in our understanding. Our work is a case study demonstrating a first step toward a better understanding of pre-trained language models, opening opportunities to scale to both larger models and more complex tasks.1
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Transformer-based language models (Vaswani et al., 2017; Brown et al., 2020) have demonstrated an impressive suite of capabilities, but largely remain black boxes. Understanding these models is difficult because they employ complex non-linear interactions in densely-connected layers and operate in a high-dimensional space. Despite this, they are already deployed in high-impact settings, underscoring the urgency of understanding and anticipating possible model behaviors. Some researchers have even argued that interpretability is necessary for the safe deployment of advanced machine learning systems (Hendrycks & Mazeika, 2022).
14
+
15
+ Work in mechanistic interpretability aims to discover, understand and verify the algorithms that model weights implement by reverse engineering model computation into human-understandable components (Olah, 2022; Meng et al., 2022; Geiger et al., 2021; Geva et al., 2020). By understanding underlying mechanisms, we can better predict out-of-distribution behavior (Mu & Andreas, 2020), identify and fix model errors (Hernandez et al., 2021; Vig et al., 2020), and understand emergent behavior (Nanda & Lieberum, 2022; Barak et al., 2022; Wei et al., 2022).
16
+
17
+ In this work, we aim to understand how GPT-2 small (Radford et al., 2019) implements a natural language task. To do so, we locate components of the network that produce specific behaviors, and study how they compose to complete the task. We do so by using circuits analysis (Rauker ¨ et al., 2022), identifying an induced subgraph of the model’s computational graph that is humanunderstandable and responsible for completing the task. We employed a number of techniques, most notably activation patching, knockouts, and projections, which we believe are useful, general techniques for circuit discovery.2
18
+
19
+ ![](images/5796faa71adb9db5bfbdfe9ef742d73e685b072b0fc79560ea0d35cca827bb22.jpg)
20
+ Figure 1: Left: We isolated a circuit (in orange) responsible for the flow of information connecting the indirect object ‘Mary’ to the next token prediction. The nodes are attention blocks and the edges represent the interactions between attention heads. Right: We discovered and validated this circuit using activation experiments, including both patches and knockouts of attention heads.
21
+
22
+ We focus on understanding a non-trivial, algorithmic natural language task that we call Indirect Object Identification (IOI). In IOI, sentences such as ‘When Mary and John went to the store, John gave a drink to’ should be completed with ‘Mary’. We chose this task because it is linguistically meaningful and admits a complex but interpretable algorithm (Section 3).
23
+
24
+ We discover a circuit of 28 attention heads– $. 1 . 5 \%$ of the total number of (head, token position) pairs– that completes this task. The circuit uses 7 different categories of heads (see Figure 2) to implement the algorithm. Together, these heads route information between different name tokens, to the end position, and finally to the output. Our work provides, to the best of our knowledge, the most detailed attempt at reverse-engineering a natural end-to-end behavior in a transformer-based language model.
25
+
26
+ Explanations for model behavior can easily be misleading or non-rigorous (Jain & Wallace, 2019; Bolukbasi et al., 2021). To remedy this problem, we formulate three criteria to help validate our circuit explanations. These criteria are faithfulness (the circuit can perform the task as well as the whole model), completeness (the circuit contains all the nodes used to perform the task), and minimality (the circuit doesn’t contain nodes irrelevant to the task). Our circuit shows significant improvements compared to a na¨ıve (but faithful) circuit, but fails to pass the most challenging tests.
27
+
28
+ In summary, our main contributions are: (1) We identify a large circuit in GPT-2 small that performs indirect-object identification on a specific distribution (Figure 2 and Section 3); (2) Through example, we identify useful techniques for understanding models, as well as surprising pitfalls; (3) We present criteria that ensure structural correspondence (in the computational graph abstraction) between the circuit and the model, and check experimentally whether our circuit meets this standard (Section 4).
29
+
30
+ # 2 BACKGROUND
31
+
32
+ In this section, we introduce the IOI task (an original contribution of this work), the transformer architecture, define circuits more formally and describe a technique for “knocking out” model nodes.
33
+
34
+ Task description. In indirect object identification (IOI), two names (the indirect object (IO) and the first occurrence of the subject (S1)) are introduced in an initial dependent clause (see Figure 1). A main clause then introduces the second occurrence of the subject (S2), who is usually exchanging an item. The task is to complete the main clause, which always ends with the token ‘to’, with the non-repeated name (IO). We create many dataset samples for IOI (pIOI) using 15 templates (see Appendix A) with random single-token names, places and items.
35
+
36
+ We investigate the performance of GPT-2 small on this task. We study the original model from Radford et al. (2019), pretrained on a large corpus of internet text and without any fine-tuning. To quantify GPT-2 small performance on the IOI task, we used the logit difference between the logit values placed on the two names, where a positive score means the correct name (IO) has higher probability. This is also the difference in loss the model would receive in training if IO was correct compared to if S was correct. We report this metric averaged over pIOI throughout the paper. GPT-2 small has mean logit difference of 3.55 averaged across over 100,000 dataset examples.
37
+
38
+ Transformer architecture. GPT-2 small is a decoder-only transformer with 12 layers and 12 attention heads per attention layer. In this work, we mostly focus on understanding the mechanisms of attention heads, which we describe using notation similar to Elhage et al. (2021). We leave a full description of the model to Appendix E.
39
+
40
+ The input to the transformer is the sum of position and token embeddings, $x _ { 0 } \in \mathbb { R } ^ { N \times d }$ , where $N$ is the number of tokens in the input and $d$ is the model dimension. This input embedding is the initial value of the residual stream, which all attention layers and MLPs read from and write to. Attention layer $i$ of the network takes as input $x _ { i } \in \mathbb { R } ^ { N \times d }$ , the value of the residual stream before it. The attention layer output can be decomposed into the sum of attention heads $h _ { i , j }$ . If the output of the attention layer is $\begin{array} { r } { \bar { y _ { i } } = \sum _ { j } h _ { i , j } ( x _ { i } ) } \end{array}$ , then the residual stream is updated to $x _ { i } + y _ { i }$ .
41
+
42
+ Focusing on individual heads, each head $h _ { i , j }$ is parametrized by four matrices $W _ { Q } ^ { i , j }$ , $W _ { K } ^ { i , j }$ , $W _ { V } ^ { i , j } \in$ $\mathbb { R } ^ { d \times \frac { d } { H } }$ and $W _ { O } ^ { i , j } \in \mathbb { R } ^ { \frac { d } { H } \times d }$ Q. We rewrite these parameters as low-rank matrices in $\mathbb { R } ^ { d \times d }$ : $W _ { O V } ^ { i , j } =$ $W _ { O } ^ { i , j } W _ { V } ^ { i , j }$ j and W i,jQK $W _ { Q K } ^ { i , j } = ( W _ { Q } ^ { i , j } ) ^ { T } W _ { K } ^ { i , j }$ . The QK matrix is used to compute the attention pattern $A _ { i , j } ~ \in ~ \mathbb { R } ^ { N \times N }$ of head $( i , j )$ , while the OV matrix determines what is written into the residual stream. At the end of the forward pass, a layer norm is applied before the unembed matrix $W _ { U }$ projects the residual stream into logits.
43
+
44
+ # 2.1 CIRCUITS
45
+
46
+ In mechanistic interpretability, we want to reverse-engineer models into interpretable algorithms. A useful abstraction for this goal are circuits. If we think of a model as a computational graph $M$ where nodes are terms in its forward pass (neurons, attention heads, embeddings, etc.) and edges are the interactions between those terms (residual connections, attention, projections, etc.), a circuit $C$ is a subgraph of $M$ responsible for some behavior (such as completing the IOI task). This definition of a circuit is slightly different from that in Olah et al. (2020), where nodes are features (meaningful directions in the latent space of a model) instead of model components.
47
+
48
+ # 2.2 KNOCKOUTS
49
+
50
+ Just as the entire model $M$ defines a function $M ( x )$ from inputs to logits, we also associate each circuit with a function $C ( x )$ , via knockouts. A knockout removes a set of nodes $K$ in a computational graph $M$ with the goal of “turning off” nodes in $K$ but capturing all other computations in $M$ . Thus, $C ( x )$ is defined by knocking out all nodes in $M \backslash C$ and taking the resulting logit outputs in the modified computational graph.
51
+
52
+ A first na¨ıve knockout approach consists of simply deleting each node in $K$ from $M$ . The net effect of this removal is to zero ablate $K$ , meaning that we turn its output to 0. This na¨ıve approach has an important limitation: 0 is an arbitrary value, and subsequent nodes might rely on the average activation value as an implicit bias term. Because of this, we find zero ablation to lead to noisy results in practice.
53
+
54
+ To address this, we instead knockout nodes through mean ablation: replacing them with their average activation value across some reference distribution (similar to the bias correction method used in Nanda & Lieberum (2022)). Mean-ablations will remove the influence of components sensitive to the variation in the reference distribution (i.e. attention heads that move names in pIOI), but will not influence components using information constant in the distribution (i.e. attention patterns that are constant in pIOI). Through mean-ablations, we are interested in finding the components that move information about names, which is the core of the IOI task and also varies with the distribution.
55
+
56
+ In this work, all knockouts are performed in a modified pIOI distribution with three random names, so the sentences no longer have a single plausible IO. We mean-ablate on this distribution, which we call the ‘ABC’ distribution, because mean-ablating on the pIOI distribution would not remove enough information, like information constant in pIOI that is helpful for the task. To knockout a single node, a (head, token position) pair in our circuit, we compute the mean of that node across samples of the same template. Computing means across the entire distribution instead of templates would average activations at different tokens, like names, verbs and conjunctions, mixing information destructively.
57
+
58
+ ![](images/8679ec5dc1297cb66b310139328c58c1f7febe9d64e838100709adb2441f81d8.jpg)
59
+ Figure 2: We discover a circuit in GPT-2 small that implements IOI. The input tokens on the left are passed into the residual stream. Attention heads move information between residual streams: the query and output arrows show which residual streams they write to, and the key/value arrows show which residual streams they read from.
60
+
61
+ # 3 DISCOVERING THE CIRCUIT
62
+
63
+ We seek to explain how GPT-2 small implements the IOI task (Section 2). Recall the example sentence “When Mary and John went to the store, John gave a drink to”. We discovered that GPT2’s internal mechanisms implement the following human-interpretable algorithm to perform IOI:
64
+
65
+ 1. Identify all previous names in the sentence (Mary, John, John).
66
+ 2. Remove all names that are duplicates (in the example above: John).
67
+ 3. Output the remaining name.
68
+
69
+ Our circuit contains three major classes of heads, corresponding to these three steps:
70
+
71
+ • Duplicate Token Heads identify tokens that have already appeared in the sentence. They are active at the S2 token, attend primarily to the S1 token and write a ‘signal’ into the residual stream that token duplication has occurred.
72
+ • S-Inhibition Heads perform step 2 of the human-interpretable algorithm. They are active at the END token, attend to the S2 token and write to bias the query of the Name Mover Heads against both S1 and S2 tokens.
73
+ • Name Mover Heads, by default, attend to previous names in the sentence, but due to the S-Inhibition Heads attend less to the S1 and S2 tokens. Their OV matrix is a name copying matrix, so in pIOI, they increase the logit of the IO token.
74
+
75
+ A fourth major family of heads writes in the opposite direction of the Name Mover Heads, thus decreasing the confidence of the predictions. We speculate that these Negative Name Mover Heads might help the model “hedge” so as to avoid high cross-entropy loss when making mistakes.
76
+
77
+ There are also three minor classes of heads that perform related functions to the components above:
78
+
79
+ • Previous Token Heads copy the embedding of S to position $_ { \mathsf { S } + 1 }$ . • Induction Heads perform the same role as the Duplicate Token Heads through an induction mechanism. They are active at position S2, attend to token $_ { \mathrm { S } + 1 }$ (mediated by the Previous Token Heads), and output a signal that the S token previously appeared in the context. • Finally, Backup Name Mover Heads do not normally move the IO token to the output, but take on this role if the regular Name Mover Heads are knocked out.
80
+
81
+ Note that our circuit does not include the MLPs. We are interested in the flow of information across tokens, and MLPs only process features along tokens. Moreover, initial investigations suggest all MLPs except for the first one are not crucial for this task (Appendix I), though more precise investigation is left for future work.
82
+
83
+ Below, we show step-by-step how we discovered each component, providing evidence that they behave as described above. We found that it was most natural to uncover the circuit starting at the logits and working back. Thus we start with the Name Mover and Negative Name Mover Heads.
84
+
85
+ ![](images/85d6691c1e66a0984ce3917dde6e32391b39e762704aabb9bcebc9abee552537.jpg)
86
+ Figure 3: A: Name Movers and Negative Name Movers Heads are the heads that most strongly write in the $W _ { U } [ I O ] - W _ { U } [ S ]$ direction. B: Attention probability vs projection of the head output along $W _ { U } [ I O ]$ or $W _ { U } [ S ]$ respectively. Note that for S tokens, we sum the attention probability on both S1 and S2. C: Value-weighted attention score with the query at the end token. D, top: Positive copying score for the Name Mover Heads. D, bottom: Negative copying score for the Negative Name Mover Heads. Dashed lines are the average scores for all heads.
87
+
88
+ # 3.1 WHICH HEADS DIRECTLY WRITE TO THE OUTPUT? (NAME MOVER HEADS)
89
+
90
+ We begin by identifying which attention heads directly affect the model’s output: in other words, the heads writing in the residual stream at the END position, in a direction that has high dot product with the logit difference. Formally, let $W _ { U }$ denote the unembedding matrix, $\overline { { \mathrm { L N } } }$ a layer norm operation (see Appendix $_ \mathrm { H }$ ) and $W _ { U } [ I O ]$ , $W _ { U } [ S ]$ the corresponding unembedding vectors for the $I O$ and $S$ tokens. We searched for heads $( i , j )$ such that
91
+
92
+ $$
93
+ \lambda _ { i , j } \overset { \mathrm { d e f } } { = } \mathbb { E } _ { X \sim \mathsf { p } _ { \mathrm { I O I } } } [ \langle \overline { { \mathbf { L N } } } \circ h _ { i , j } ( X ) , W _ { U } [ I O ] - W _ { U } [ S ] \rangle ]
94
+ $$
95
+
96
+ had large magnitude. Recall that $h _ { i , j } ( X )$ is the value that head $( i , j )$ writes into the residual stream on input $X$ . Therefore, heads with $\dot { \lambda } _ { i , j } > 0$ correctly promote the IO token over the S token (on average). The unembedding projection in (3.1) is called the logit lens and has been used in previous work to interpret intermediate activations (nostalgebraist, 2020) and parameters (Dar et al., 2022). We display the values of $\lambda _ { i , j }$ in Figure $_ { 3 \mathrm { ~ A ~ } }$ . We see that only a few heads in the final layers have large logit projection $\lambda _ { i , j }$ . Specifically, 9.6, 9.9, and 10.0 have a large positive score, while 10.7 and 11.10 have a large negative score.
97
+
98
+ Name Mover Heads. To understand the positive heads, we first study their attention patterns. We find that they attend strongly to the IO token: the average attention probability of all heads over pIOI is 0.59. Since attention patterns can be misleading (Jain & Wallace, 2019), we check whether attention is correlated with the heads’ functionality. We do so by scatter plotting the attention probability against the logit score $\langle h _ { i } ( X ) , W _ { U } [ I O ] \rangle$ . The results are shown in Figure $^ { 3 \mathrm { ~ B ~ } }$ : higher attention probability on the IO token is linearly correlated with higher output in the IO direction (correlation $\rho > 0 . 8 1$ , $N = 5 0 0$ ). Based on this result, we hypothesize that these heads (i) attend to names and (ii) copy whatever they attend to. We therefore call these heads Name Mover Heads.
99
+
100
+ To check that the Name Mover Heads copy names generally, we studied what values are written via the heads’ OV circuits. We transform the output of the first layer at a name token through the OV matrix of a Name Mover Head and then project to the logits. The copy score is the proportion of samples that contain the input name token in the top 5 logits $N = 1 0 0 0 \rangle$ ). We find that all three Name Mover Heads have a copy score above $9 5 \%$ (compared to less than $2 0 \%$ for an average head).
101
+
102
+ Negative Name Mover Heads. In Figure 3, we also observed two heads strongly writing opposite the $W _ { U } [ I O ] - W _ { U } [ S ]$ direction. We called these heads Negative Name Mover Heads. Their copy score is calculated with the negative of their OV matrix. As described in Figure 3, they share all the properties of Name Mover Heads, except they write in the opposite of names they attend to.
103
+
104
+ ![](images/1c343aca6619523cf78347fa51e9182e0936203f0c0549cd37f849b66f769e20.jpg)
105
+ Figure 4: The attention probability to IO averaged over three Name Mover Heads is decreased most by the Previous Token Heads (left), Induction Heads (center) and S-Inhibition Heads (right) when we patch these attention heads from a sentence with a different S2 name (center and right), or a different S1 name (left).
106
+
107
+ 3.2 WHICH HEADS AFFECT THE NAME MOVER HEADS’ ATTENTION? (S-INHIBITION HEADS)
108
+
109
+ Given that the Name Mover Heads are primarily responsible for constructing the output, we ask why these Name Mover Heads pay preferential attention to the IO token. First, there are two ways to affect the Name Mover Heads’s attention: through the query vector at the END token or the key vector at the IO token. Since the key vector appears early in the context, it likely does not contain much task-specific information, so we focus on the END query vector.
110
+
111
+ Then, by investigating Name Mover Heads on the ABC distribution (where the three names are distinct; see Section 2.2), we observed that their attention is not selective: they pay equal attention to the first two names. We thus ask: what has changed from the ABC distribution to the pIOI distribution to cause the Name Mover Heads to attend to the IO token preferentially?
112
+
113
+ To empirically answer this question, we perform a patching experiment, a similar type of causal intervention as performed in Meng et al. (2022); Vig et al. (2020). As illustrated in Figure 1 this technique consists of two steps. First we save all activations of the network run on a source sequence. Then we run the network on a target sequence, replacing some activations with the activations from the source sequence. We can then measure the behavior of the patched model. Doing this for each node individually locates the nodes that explain why model behavior is different in the source and target sequences.
114
+
115
+ In our case, we run activation patching with source sentences from the ABC distribution and target sentences from pIOI. We then compute the change in attention probability from END to IO, averaged over the three Name Mover Heads. Since the Name Mover Heads attention on the IO is high in the pIOI distribution and low in ABC, patching at important heads from ABC to pIOI should decrease Name Mover Heads attention on IO. The results from patching every head at the END token position are shown in Figure 4, right. We observe that patching heads 7.3, 7.9, 8.6, 8.10 causes a decrease in the attention probability on IO, indicating that they are counterfactually important for the Name Mover Heads’s attention probability on the IO token. We call these heads S-Inhibition Heads.
116
+
117
+ # 3.3 WHAT INFORMATION DO THE S-INHIBITION HEADS MOVE?
118
+
119
+ How do the S-Inhibition Heads differentiate between IO and S, so they inhibit one but not the other? We measured their attention pattern and found that they preferentially attend to the S2 token. We therefore studied what information these heads move from the S2 token position to the END position. We studied both the properties of the input, and which upstream affect the S-inhibition heads. Surprisingly, we found that the S-inhibition heads mostly depend on the repetition at the two positions where the S token occurs (Appendix G).
120
+
121
+ To study the heads that affect the S-inhibition heads, we ran a patching experiment at S2 from the ABC distribution to the IOI distribution and measured the variation in Name Mover Heads attention. The results (Figure 4, center) reveal a large set of heads influencing Name Mover Heads’ attention that did not appear at the END position. S-Inhibition Heads must mediate this effect, as they are the only heads influencing Name Mover Heads at the END position. This reasoning suggests that the outputs of this set of heads is moved by S-Inhibition Heads from S2 to the END token. When we analyze the attention patterns of these heads, we see two distinct groups emerge.
122
+
123
+ Duplicate Token Heads. One group attends from S2 to S1. We call these Duplicate Token Heads on the hypothesis that they detect duplicate tokens. To validate this, we analyze their attention pattern on sequences of random tokens (with no semantic meaning), we found that 2 of the 3 Duplicate Token Heads pay strong attention to a previous occurrence of the current token if it exists (see Appendix F for more details).
124
+
125
+ Induction Heads and Previous Token Heads. The other group of heads attends from S2 to $\mathrm { S } 1 { + } 1$ (the token after the S1 token): the classic attention pattern of an induction head. Previously described in Elhage et al. (2021), induction heads recognize the general pattern [A] [B] ... [A] and contribute to predicting [B] as the next token. For this, they act in pair with a Previous Token Head. The Previous Token Head should write information about [A] into the residual stream at [B], so that the Induction Head can match the next occurrence of [A] to that position (and subsequently copy [B] to the output).
126
+
127
+ We therefore seek to identify Previous Token Heads used by our purported Induction Heads. To this end, we patched activations from a sentence where S1 is replaced by a random name, at the $_ { \mathsf { S } + 1 }$ token index. As shown in figure 4, some heads (and particularly 4.11) appear to influence Name Mover Heads. Then, by looking at the attention pattern of the most important heads in this patching experiment, we identified 3 Previous Token Heads. We find that 2 of the 3 Previous Token Heads and 2 of the 4 Induction Heads demonstrated their expected attention patterns (Appendix F).
128
+
129
+ 3.4 DID WE MISS ANYTHING? THE STORY OF THE BACKUP NAME MOVERS HEADS
130
+
131
+ Each type of head in our circuit has many copies, suggesting that the model implements redundant behavior. To make sure that we didn’t miss any copies, we knocked out all of the Name Mover Heads at once. To our surprise, the circuit still worked (only $10 \%$ drop in logit difference). In addition, many heads write along $W _ { U } [ I O ] - W _ { U } [ S ]$ after the knockout, which did not do so previously.
132
+
133
+ We kept the heads with the largest $\lambda _ { i , j }$ , and call them Backup Name Mover Heads. See appendix B for further details on these heads. Among the height heads identified, we investigated their behavior before the knockout. We observe diverse behavior: 3 heads show close resemblance to Name Mover Heads; 3 heads equally attend to IO and S and copy them; 1 head pays more attention to S1 and copies it; 1 head seems to track and copy subjects of clauses, copying S2 in this case.
134
+
135
+ # 4 EXPERIMENTAL VALIDATION
136
+
137
+ In this section, we check that our circuit provides a good account of GPT-2’s true behavior. In general, our introduced criteria depend on a measure $F$ of the performance of a circuit on a task. In our case, suppose $X \sim { \mathsf { p } } _ { \mathrm { { I O I } } }$ , and $f ( C ( X ) ; X )$ is the logit difference between the IO and S tokens when the circuit $C$ is run on the input $X$ . The average logit difference $F ( C ) \ { \stackrel { \mathrm { d e f } } { = } } \ \mathbb { E } _ { X \sim \mathsf { p } _ { \mathrm { I O I } } } \left[ f ( C ( X ) ; X ) \right]$ is a measure of how much a circuit predicts IO rather than S, i.e performs the IOI task.
138
+
139
+ Firstly, we check that $C$ is faithful to $M$ , i.e. that it computes similar outputs. We do so by measuring $| F ( \dot { M } ) - F ( C ) |$ , and find that it is small: 0.2, or only $6 \%$ of $F ( M ) = { \bf \bar { 3 . 5 5 } }$ .
140
+
141
+ In Section 4.1 we define a running toy example of a model $M$ for which faithfulness is not sufficient to prescribe which circuits explain a behavior defined by a measure $F$ well. This motivates the criteria of completeness and minimality that we then check on our circuit. In addition to the criteria, we also validated our knowledge of the circuit by designing adversarial examples (see Appendix C).
142
+
143
+ # 4.1 COMPLETENESS
144
+
145
+ As a running example, suppose a model $M$ uses two similar and disjoint serial circuits (where each node depends on the previous node) $C _ { 1 }$ and $C _ { 2 }$ . The two sub-circuits are run in parallel before applying an OR operation to their results. Identifying only one of the circuits is enough to achieve faithfulness, but we want explanations that include both $C _ { 1 }$ and $C _ { 2 }$ , since these are both used in the model.
146
+
147
+ ![](images/7bcd53b15913b0a8b542e4ed9631984b12430797eb22f15e10899f93e22c740a.jpg)
148
+ Figure 5: Plot of points $( x _ { K } , y _ { K } ) = ( \mathrm { F } ( M \setminus K ) , \mathrm { F } ( C \setminus K ) )$ for our circuit (left) and a naive circuit (right). Each point is for a different choice of $K$ : 50 uniformly randomly chosen $K \subseteq C$ , $K = \emptyset$ , and the five $K$ with the highest incompleteness score found by greedy optimization. Since the incompleteness score is $\left| x _ { K } - y _ { K } \right|$ , we show the line $y = x$ for reference.
149
+
150
+ To solve this problem, we introduce the completeness criterion: for every subset $K \subseteq C$ , the incompleteness score $| F ( C \setminus K ) - F ( M \setminus K ) |$ should be small. In other words, $C$ and $M$ should not just be similar, but remain similar under knockouts.
151
+
152
+ In our running example, we can show that $C _ { 1 }$ is not complete by setting $K = C _ { 1 }$ . Then $C _ { 1 } \backslash K$ is the empty circuit while $M \backslash K$ still contains $C _ { 2 }$ . The metric $| F ( C _ { 1 } \setminus K ) - F ( M \setminus K ) |$ will be large because $C _ { 1 } \backslash K$ has trivial performance while $M \backslash K$ successfully performs the task.
153
+
154
+ The criterion of completeness requires a search over exponentially many subsets $K \subseteq C$ . This is computationally intractable given the size of our circuit, hence we use three sampling methods to find examples of $K$ that give large incompleteness score:
155
+
156
+ • The first sampling method chooses subsets $K \subseteq C$ uniformly at random. • The second sampling method set $K$ to be an entire class of circuit heads $G$ , e.g the Name Mover Heads. $C \setminus G$ should have low performance since it’s missing a key component, whereas $M \setminus G$ might still do well if it has redundant components that fill in for $G$ . • Thirdly, we greedily optimized $K$ node-by-node to maximize the incompleteness score (see appendix $\mathbf { K }$ for the detail of the optimization procedure).
157
+
158
+ These first two methods of sampling $K$ suggested to us that our circuit was $\varepsilon$ -complete for a small value of $\varepsilon$ . However, the third resulted in sets $K$ that had high incompleteness score: up to 3.09. All such results are found in figure 5, on the left.
159
+
160
+ # 4.2 MINIMALITY
161
+
162
+ A faithful and complete circuit may contain unnecessary components, and so be overly complex. To avoid this, we should check that each of its nodes $v$ is necessary. This can be evaluated by knocking out a set of nodes $K$ and showing that adding back $v \in K$ to the circuit can significantly recover $F$ .
163
+
164
+ Formally, the minimality require that for every node $v \in C$ there exists a subset $K \subseteq C \setminus \{ v \}$ that has minimality score $| \bar { F ( C \setminus ( K \cup \{ v \} ) ) } - \bar { F ( C \setminus K ) } | \geq A$ . We call such a circuit $A$ -minimal.
165
+
166
+ In the running example, $C _ { 1 } \cup C _ { 2 }$ is $A$ -minimal for some non-trivial $A$ . We can sketch a proof of this result given an informal defintion of ‘non-trivial’. To show this, note that if $v _ { 1 } \in C _ { 1 }$ and $K = C _ { 2 }$ , then the minimality score is equal to $| F ( C _ { 1 } \setminus \{ v _ { 1 } \} ) - F ( C _ { 1 } ) |$ which is large since $C _ { 1 }$ is a serial circuit and so removing $v _ { 1 }$ will destroy the behavior. We then proceed symmetrically for $v _ { 2 } \in C _ { 2 }$ .
167
+
168
+ In practice, we need to exhibit for every $v$ a set $K$ such that the minimality score is at least $A$ . For most heads, removing the class of heads $G$ that $v$ is a part of provides a reasonable minimality score. We describe the sets $K$ that are required for them in Appendix J. The importance of individual nodes is highly variable, but they all have a significant impact on the final metric (at least $3 \%$ of the original logit difference). These results ensure that we did not interpret irrelevant nodes, but do show that the individual contribution of some single attention heads is small.
169
+
170
+ ![](images/587eb520de66e3f0c7c7c04f869990bb37d781619f64b37df1bdf4efc40759b1.jpg)
171
+ Figure 6: Plot of minimality scores $| F ( C \setminus ( K \cup \{ v \} ) ) - F ( C \setminus K ) |$ for all components $v$ in our circuit. The sets $K$ used for each component, as well as the initial and final values of the logit difference for each of these $v$ is in Appendix J. Our circuit is 0.06-minimal.
172
+
173
+ # 4.3 COMPARISON WITH A NAIVE CIRCUIT
174
+
175
+ In order to get a relative sense of the success of our explanation by our criteria, we compare the results on a na¨ıve circuit that consists of the Name Mover Heads (but no Backup Name Mover Heads), S-Inhibition Heads, two Induction Heads, two Duplicate Token Heads and two Previous Token Heads. This circuit has a faithfulness score 0.1, a score comparable to our circuit’s faithfulness score. However, contrary to our circuit, the naive circuit can be easily proven incomplete: by sampling random sets or by knocking-out by classes, we see that $F ( M \backslash { \bar { K } } )$ is much higher than $F ( C \backslash K )$ (Figure 5, left). Nonetheless, when we applied the greedy heuristic to optimize for the incompleteness score, both circuits have similarly large incompleteness scores. Thus, we conclude that our worst-case completeness criterion was too high a bar, which future work could use as a high standard to validate circuit discovery.
176
+
177
+ # 5 DISCUSSION
178
+
179
+ In this work, we isolated, understood and validated a set of attention heads in GPT-2 small composed in a circuit that identifies indirect objects. Along the way, we discovered interesting structures emerging from the model internals that complicated the study. For instance, we identified heads compensating for the loss of function of other heads, and heads contributing negatively to the nexttoken prediction. Early results suggest that the latter phenomenon occurs for other tasks beyond IOI (see Appendix F).
180
+
181
+ However, our work also has several limitations. First, despite the detailed analysis presented here, we do not understand several components. Those include the attention patterns of the S-Inhibition Heads, and the effect of MLPs and layer norms. Second, the number of parameters in GPT-2 small is orders of magnitude away from state-of-the-art transformer language models. A future challenge is to scale this approach to these larger models. Thirdly, we only looked at the difference in average metric (logit difference) between the circuit and the model in order to compare how they both did the IOI task (Section 4). Looking at the average difference in metric between the circuit and model on individual examples would be a more stringent way to compare them, but it had too much variability to help us find a circuit. Fourthly, the definition of the task is limited: we only measure a fraction of the prediction made by the model, and do not study cases where the model is not performing IOI. Finally, more work is needed to validate the structural validation criterion we introduce here.
182
+
183
+ We hope that our work spurs further efforts in mechanistic explanations of larger language models computing different natural language tasks, with the eventual goal of understanding full language model capabilities.
184
+
185
+ # REFERENCES
186
+
187
+ Boaz Barak, Benjamin L Edelman, Surbhi Goel, Sham Kakade, Eran Malach, and Cyril Zhang. Hidden progress in deep learning: Sgd learns parities near the computational limit. arXiv preprint arXiv:2207.08799, 2022.
188
+
189
+ Tolga Bolukbasi, Adam Pearce, Ann Yuan, Andy Coenen, Emily Reif, Fernanda B. Viegas, and ´ Martin Wattenberg. An interpretability illusion for BERT. CoRR, abs/2104.07143, 2021. URL https://arxiv.org/abs/2104.07143.
190
+
191
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (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.
192
+
193
+ Guy Dar, Mor Geva, Ankit Gupta, and Jonathan Berant. Analyzing transformers in embedding space. arXiv preprint arXiv:2209.02535, 2022.
194
+
195
+ Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html.
196
+
197
+ Matthew Finlayson, Aaron Mueller, Sebastian Gehrmann, Stuart Shieber, Tal Linzen, and Yonatan Belinkov. Causal analysis of syntactic agreement mechanisms in neural language models, 2021. URL https://arxiv.org/abs/2106.06087.
198
+
199
+ Atticus Geiger, Hanson Lu, Thomas F Icard, and Christopher Potts. Causal abstractions of neural networks. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum? id $=$ RmuXDtjDhG.
200
+
201
+ Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers are key-value memories. arXiv preprint arXiv:2012.14913, 2020.
202
+
203
+ Dan Hendrycks and Mantas Mazeika. X-risk analysis for ai research. arXiv, abs/2206.05862, 2022.
204
+
205
+ Evan Hernandez, Sarah Schwettmann, David Bau, Teona Bagashvili, Antonio Torralba, and Jacob Andreas. Natural language descriptions of deep visual features. In International Conference on Learning Representations, 2021.
206
+
207
+ Sarthak Jain and Byron C. Wallace. Attention is not Explanation. 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. 3543–3556, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1357. URL https://aclanthology.org/N19-1357.
208
+
209
+ Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in gpt. arXiv preprint arXiv:2202.05262, 2022.
210
+
211
+ Jesse Mu and Jacob Andreas. Compositional explanations of neurons. Advances in Neural Information Processing Systems, 33:17153–17163, 2020.
212
+
213
+ Neel Nanda and Tom Lieberum. A mechanistic interpretability analysis of grokking, 2022. URL https://www.alignmentforum.org/posts/N6WM6hs7RQMKDhYjB/ a-mechanistic-interpretability-analysis-of-grokking.
214
+
215
+ nostalgebraist. interpreting gpt: the logit len, 2020. URL https://www.lesswrong.com/ posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lens.
216
+
217
+ Chris Olah. Mechanistic interpretability, variables, and the importance of interpretable bases. https://www.transformer-circuits.pub/2022/mech-interp-essay, 2022.
218
+
219
+ Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter. Zoom in: An introduction to circuits. Distill, 2020. doi: 10.23915/distill.00024.001. https://distill.pub/2020/circuits/zoom-in.
220
+ Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, et al. In-context learning and induction heads. arXiv preprint arXiv:2209.11895, 2022.
221
+ Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
222
+ Tilman Rauker, Anson Ho, Stephen Casper, and Dylan Hadfield-Menell. Toward transparent ai: ¨ A survey on interpreting the inner structures of deep neural networks, 2022. URL https: //arxiv.org/abs/2207.13243.
223
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
224
+ Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Yaron Singer, and Stuart Shieber. Investigating gender bias in language models using causal mediation analysis. Advances in Neural Information Processing Systems, 33:12388–12401, 2020.
225
+ Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. Emergent abilities of large language models. ArXiv, abs/2206.07682, 2022.
226
+
227
+ # A IOI TEMPLATES
228
+
229
+ We list all the template we used in Table 7. Each name was drawn from a list of 100 English first names, while the place and the object were chosen among a hand made list of 20 common names. All the word chosen were one token long to ensure proper sequence alignment computation of the mean activations.
230
+
231
+ <table><tr><td rowspan=1 colspan=1>Templates in PIOI</td></tr><tr><td rowspan=1 colspan=1>Then, [B] and [A] went to the [PLACE]. [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>Then,[B] and [A] had a lot of fun at the [PLACE]. [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>Then, [B] and [A] were working at the [PLACE]. [B] decided to give a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>Then, [B] and [A] were thinking about going to the [PLACE]. [B] wanted to give a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>Then, [B] and [A] had a long argument, and afterwards [B] said to [A]</td></tr><tr><td rowspan=1 colspan=1>After [B] and [A] went to the [PLACE], [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>When [B] and [A] got a [OBJECT] at the [PLACE], [B] decided to give it to [A]</td></tr><tr><td rowspan=1 colspan=1>When [B] and [A] got a [OBJECT] at the [PLACE], [B] decided to give the [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>While [B] and [A] were working at the [PLACE], [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>While [B] and [A] were commuting to the [PLACE], [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>After the lunch, [B] and [A] went to the [PLACE]. [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>Afterwards, [B] and [A] went to the [PLACE]. [B] gave a [OBJECT] to [A]</td></tr><tr><td rowspan=1 colspan=1>Then, [B] and [A] had a long argument. Afterwards [B] said to [A]</td></tr><tr><td rowspan=1 colspan=1>The [PLACE] [B] and [A] went to had a [OBJECT]. [B] gave it to [A]</td></tr><tr><td rowspan=1 colspan=1>Friends [B] and [A] found a [OBJECT] at the [PLACE]. [B] gave it to [A]</td></tr></table>
232
+
233
+ Figure 7: Templates used in the IOI dataset. All templates in the table fit the ’BABA’ pattern, but we also use templates that fit the ‘ABBA’ pattern as well (not included for simplicity).
234
+
235
+ # B BACKUP NAME MOVER HEADS
236
+
237
+ Here we discuss in more detail the discovery of the Backup Name Mover Heads. As shown in figure 8, knocking-out the three main Name Mover Heads doesn’t leave the rest of the heads in a similar state as before. They seem to ”compensate” the loss of function from the Name Mover Heads such that the logit difference is only $10 \%$ lower. We observe that the Negative Name Mover Heads head write less negatively in the direction of $W _ { U } [ I O ] - W _ { U } [ S ]$ , 10.7 even write positively in this direction afterwards, while other heads that wrote slightly along $\dot { W } _ { U } [ I O ] - W _ { U } [ \bar { S } ]$ before the knock-out becomes the main contributor. Both the reason and the mechanism of this compensation effect are still unclear, we think that this could be an interesting phenomenon to investigate in future works. Among those last categories, we identify S-inhibition heads and a set of other head that we called Backup Name Mover Heads. We arbitrarily chose to keep the height heads that were not part of any other groups, and wrote in the direction of $W _ { U } [ I O ] - W _ { U } [ S ]$ above the threshold of 0.05.
238
+
239
+ In figure 9 we analyze the behavior of those newly identified heads with similar techniques as Name Mover Heads. Those can be grouped in 4 categories.
240
+
241
+ • 3 heads (10.1, 10.10 and 10.6) that behave similarly as Name Mover Heads according to their attention pattern, and scatter plots of attention vs dot product of their output with $W _ { U } [ I O ] - W _ { U } [ S ]$ (as 10.10).
242
+ • 3 heads (10.2, 11.9, 11.3) that pay equal attention to S1 and IO and wrote both of them (as 10.2 in Figure 9).
243
+ • One head, 11.2, that pays more attention to S1 and write preferentially in the direction of $W _ { U } [ S ]$
244
+ • One head, 9.7, that pays attention to S2 and write negatively.
245
+
246
+ We did not thoroughly investigate this diversity of behavior, more work can be done to precisely describe these heads. However, these heads are also the ones with the less individual importance for the task (as shown by their minimality score in Figure 6). The exact choice of Backup Name Mover Heads doesn’t change significantly the behavior of the circuit.
247
+
248
+ ![](images/2f63b778ce7531a3be151b56c980230c44881802c042c64de029f45f0d2757e5.jpg)
249
+
250
+ ![](images/e6b63982c7d98844de1a566f5bc4b0f0715a25e1e6920355fb8be79db02ba712.jpg)
251
+ Figure 8: Discovery of the Backup Name Mover Heads. After knock-out of the Name Mover Heads (right) some heads write stronger in the $W _ { U } [ I O ]$ or $W _ { U } [ S ]$ direction than before (left). We also observed that negative heads seems inhibited by this operation.
252
+ Figure 9: Four examples of Backup Name Mover Heads. Left: attention probability vs projection of the head output along $W _ { U } [ I O ]$ or $W _ { U } [ S ]$ respectively. Right: Attention pattern on a sample sequence.
253
+
254
+ Figure 10: Summary of GPT-2 performance metrics on the IOI task on different datasets. In the line order: for pIOI, for the dataset where we added an occurrence of S (thus S appears three times in the sentence) and for the adversarial dataset with duplicated IO in natural sentences. IO probability refers to the probability the model places on the IO token (computed from the logits).
255
+
256
+ <table><tr><td rowspan=1 colspan=1>Distribution</td><td rowspan=1 colspan=1>Logit difference</td><td rowspan=1 colspan=1> IO probability</td><td rowspan=1 colspan=1>Proportion ofS logit greater than IO</td></tr><tr><td rowspan=1 colspan=1>PIOI</td><td rowspan=1 colspan=1>3.55</td><td rowspan=1 colspan=1>0.49</td><td rowspan=1 colspan=1>0.7%</td></tr><tr><td rowspan=1 colspan=1>Additional occurrence of S(natural sentence)</td><td rowspan=1 colspan=1>3.64</td><td rowspan=1 colspan=1>0.59</td><td rowspan=1 colspan=1>0.4%</td></tr><tr><td rowspan=1 colspan=1>Additional occurrence of IO(natural sentence)</td><td rowspan=1 colspan=1>1.23</td><td rowspan=1 colspan=1>0.36</td><td rowspan=1 colspan=1>23.4%</td></tr></table>
257
+
258
+ # C DESIGNING ADVERSARIAL EXAMPLES
259
+
260
+ As argued in Rauker et al. (2022), one way to evaluate the knowledge gained by interpretability work ¨ is to use it for downstream applications as predicting out of distribution behavior. In this section, we do this by using knowledge of the circuit to construct simple adversarial examples for the model.
261
+
262
+ As presented in Section 3, the model relies on duplicate detection to differentiate between S and IO. Motivated by this, we constructed passages where both the S and IO tokens are duplicated. An example is “John and Mary went to the store. Mary had a good day. John gave a bottle of milk to”; see Appendix D for full details. We find that this significantly reduces the logit difference and causes the model to predict S over IO $2 3 \%$ of the time (Figure 10).
263
+
264
+ To ensure that the observed effect is not an artifact of the additional sentences, we included a control dataset using the same templates, but where the middle sentence contains S instead of IO. In these sentences, S appears three times in total and IO only appears once. On this distribution, the model has an even higher logit difference than on pIOI, and predicts S over IO only $0 . 4 \%$ of the time.
265
+
266
+ Limitations of the attack. Despite being inspired by our understanding of our circuit, those examples are simple enough that they could have been found without our circuit with enough effort.
267
+
268
+ Moreover, we do not have a full understanding of the mechanisms at play in these adversarial examples. For instance, the S-Inhibition Heads attend not only to S2, but also to the second occurrence of IO. As this pattern is not present in pIOI nor in ABC, it is beyond the analysis presented in Section 3. The study of the behavior of the circuit on these adversarial examples could be a promising area for future work.
269
+
270
+ # D TEMPLATE FOR ADVERSARIAL EXAMPLES
271
+
272
+ The design of adversarial examples relies on adding a duplicate IO to the sentences. To this end, we used a modification of the templates described in appendix A. We added an occurrence of [A] in the form of a natural sentence, independent of the context. The list of sentence is visible in Figure 11.
273
+
274
+ <table><tr><td rowspan=1 colspan=1>[A] had a good day.</td></tr><tr><td rowspan=1 colspan=1>[A] was enjoying the situation.</td></tr><tr><td rowspan=1 colspan=1>[A] was tired.</td></tr><tr><td rowspan=1 colspan=1>[A] enjoyed being with a friend.</td></tr><tr><td rowspan=1 colspan=1>[A] was an enthusiast person.</td></tr></table>
275
+
276
+ Figure 11: Templates for the natural sentences used in the generation of adversarial examples. The sentences were chosen to be independent of the context.
277
+
278
+ # E GPT-2 SMALL FULL ARCHITECTURE
279
+
280
+ Here we define all components of the GPT-2 Architecture, including those we don’t use in the main text. GPT-2 small has the following hyperparameters:
281
+
282
+ • $N$ : number of input tokens.
283
+
284
+ • $V$ : vocabulary of tokens.
285
+ • $d$ : residual stream dimension.
286
+ • $L$ : number of layers.
287
+ • $H$ : number of heads per layer.
288
+ • $D$ : hidden dimension of MLPs
289
+
290
+ It uses layer norms, the non-linear function
291
+
292
+ $$
293
+ \mathrm { L N } ( x ) \ { \stackrel { \mathrm { d e f } } { = } } \ { \frac { x - { \bar { x } } } { \sqrt { \sum _ { i } ( x _ { i } - { \bar { x } } _ { i } ) ^ { 2 } } } } ,
294
+ $$
295
+
296
+ where the mean and the difference from the mean sum are over the $d$ components of each of the $N$ tensors.
297
+
298
+ In GPT-2 the MLPs all have one hidden layer of dimension $D$ and use the GeLU non-linearity.
299
+
300
+ We addressed the parametrisation of each attention head in the main text, and cover the technical details of the $W _ { Q K }$ and $W _ { O V }$ matrix here: the attention pattern is $A _ { i , j } = \mathrm { s o f t m a x } ( x ^ { T } W _ { Q K } ^ { i , j } x )$ where the softmax is taken for each token position, and is unidirectional. We then have $h _ { i , j } ( x )$ def = $( A _ { i , j } \otimes W _ { O V } ^ { i , j } ) . x .$ .
301
+
302
+ # Algorithm 1 GPT-2.
303
+
304
+ Require: Input tokens $T$ ; returns logits for next token.
305
+ 1: $w $ One-hot embedding of T
306
+ 2: $x _ { 0 } W _ { E } w$ (sum of token and position embeddings)
307
+ 3: for $i = 0$ to $L$ do
308
+ 4: yi ← 0 ∈ RN×d
309
+ 5: for $j = 0$ to $H$ do
310
+ 6: $y _ { i } \gets y _ { i } + h _ { i , j } ( x _ { i } )$ , the contribution of attention head $( i , j )$
311
+ 7: end for
312
+ 8: $y _ { i } ^ { \prime } \gets m _ { i } ( x _ { i } )$ , the contribution of MLP at layer $i$
313
+ 9: $x _ { i + 1 } x _ { i } + y _ { i } + y _ { i } ^ { \prime }$ (update the residual stream)
314
+
315
+ # F ANALYSIS ON SEQUENCES OF RANDOM TOKENS
316
+
317
+ We run GPT-2 small on sequences of 100 tokens sampled uniformly at random from GPT-2’s token vocabulary. Each sequence A was duplicated to form $\tt R A$ , a sequence twice as long where the first and second half are identical. On this dataset, we computed three scores from the attention patterns of the attention heads:
318
+
319
+ • The duplicate token score: for each token $T _ { i }$ in the second half of a sequence $S$ , we average the attention probability from $T _ { i }$ to its previous occurrence in the first half of $S$ (i.e. $T _ { i - 1 0 0 } )$ .
320
+ • The previous token score: we averaged the attention probability on the off-diagonal. This is the attention from the token at position $i$ to position $i - 1$ .
321
+ • The induction score: the attention probability from $T _ { i }$ to the token that comes after the first occurrence of $T _ { i }$ (i.e. $T _ { i - 9 9 }$ )
322
+
323
+ These three score are depicted in Figure 12 for all attention heads. We can identify 3.0 and 0.1 as duplicated token heads that also appear in our circuit, 5.5 and 6.9 have high induction score and were also identified as induction heads in our investigation and 4.11 and 2.2 have a high previous token score. Note that the heads identified are also the ones that have the highest influence in the patching experiment shown in Figure 4.
324
+
325
+ Induction Heads. Olsson et al. (2022) define an Induction Head according to its behavior on repeated sequences of random tokens. The attention head must demonstrate two properties. i) Prefixmatching property. The head attends to [B] from the last [A] on pattern like [A] [B] ... [A] ii) Copy property. The head contribute positively to the logit of [B] on the pattern [A][B]...[A].
326
+
327
+ ![](images/eddc5df28590dcae996a4e1b5e51dbaf8a80a2d3709e6450790838ba3428fb3a.jpg)
328
+ Figure 12: Sum of attention probabilities on position determined by the role. Left: duplicate score, the average attention probability from a token to its previous occurrence. Center: Previous token attention score, it is the average of the off diagonal attention probability. Right: Induction score. Average attention probability from the second occurence of [A] to [B] on [A][B]...[A].
329
+
330
+ ![](images/6e38e33f4f19ac0d5673416d935d0f77d6e1410bb9269e2d1a4575148f411a42.jpg)
331
+ Figure 13: Contribution to the next token prediction per head on repeated sequences of tokens. The heads are ordered by decreasing absolute values of contribution. Black contour: heads with attention patterns demonstrating prefix matching property.
332
+
333
+ In the IOI task, we identify these heads according to their attention pattern, demonstrating the pattern-matching property. Here, we investigate their copy property, that is useless in the context of IOI: outputting the token after S2 is of no interest to identify IO.
334
+
335
+ As presented above, 5.5 and 6.9 are among the 5 heads with the highest induction score. This validates their prefix-matching property.
336
+
337
+ To check their copy property, we computed the dot product $\langle h _ { i } ( X ) , W _ { U } [ B ] \rangle$ between the output of the head $h _ { i }$ on sequence $X$ and the embedding of the token [B] on repeated sequences of random tokens. The results are shown in Figure 13. The two Induction Heads (5.5 and 6.9) appear in the 20 heads contributing the most to the next token prediction. Thus validating their copying property.
338
+
339
+ We also noticed that the majority of the Negative, Backup and regular Name Mover Heads appear to write in the next token direction on repeated sequences of random tokens, and Negative Name Movers Heads contribute negatively. This suggests that these heads are involved beyond the IOI task to produce next-token prediction relying on contextual information. Moreover, ablating the output of the three Name Mover Heads by patching their outputs results in a $26 \%$ increase in average loss on the last 99 tokens (from 0.15 to 0.19), showing their importance on tasks outside IOI.
340
+
341
+ # G DISENTANGLING FEATURES IN THE OUTPUT OF S-INHIBITION HEADS
342
+
343
+ In Section 3.2, we discovered that S-Inhibition Heads are responsible for the Name Mover Heads’ specific attention on the IO token. In this appendix, we explore which properties of the input affect the S-inhibition heads’ outputs.
344
+
345
+ We present evidence that they were outputting token signals (information about the value of the token S), positional signals (related to the value of the position S1) and that the latter is the most important.
346
+
347
+ To disentangle the two effects, we design a series of counterfactual datasets where only some signals are present, and some are inverted with respect to the original dataset. We then conducted patching experiments where the output of S-Inhibition heads are computed from these datasets.
348
+
349
+ This enables us to quantify in isolation the impact of each signal on the final logit difference.
350
+
351
+ We constructed six datasets by combining three transformations of the original pIOI distribution.
352
+
353
+ • Random name flip: we replace the names from a given sentence with random names, but we keep the same position for all names. Moreover, each occurrence of a name in the original sentence is replaced by the same random name. When we patch outputs of S-Inhibition heads from this sentence, only positional signals are present, the token signals are unrelated to the names of the original sequence. $\mathbf { I O } { } \mathbf { S } \mathbf { 1 }$ flip: we swap the position of IO and S1. The output of S-inhibition heads will contain correct token signals (the subject of the second clause is the same) but inverted positional signals (because the position of IO and S1 are swapped) • ${ \bf I O } { } { \bf S } 2$ replacement: we make IO become the subject of the sentence and S the indirect object. In this dataset, both token signals and positional signals are inverted.
354
+
355
+ We can also compose these transformations. For instance, we can create a dataset with no token signals and inverted positional signals by applying $\mathrm { I O } { } { \mathbf S } 1$ flip on the dataset with random names. In total, we can create all six combinations of original, inverted, or uncorrelated token signal with the original and inverted positional signal.
356
+
357
+ From each of those six datasets, we patched the output of S-Inhibition heads and measured the logit difference. The results are presented in Figure 14.
358
+
359
+ These results can be summarized as the sum of the two effects. Suppose we define the variable $S _ { t o k }$ to be 1 if the token signal is the original, 0 when uncorrelated and -1 when inverted. And similarly $S _ { p o s }$ to be 1 if the position signal is the original and $^ { - 1 }$ if inverted. Then the Figure 14 suggests that the logit difference can be well approximated by $2 . 3 1 S _ { p o s } + 0 . 9 9 S _ { t o k }$ , with a mean error of $7 \%$ relative to the baseline logit difference.
360
+
361
+ For instance, when both the positional and token signals are inverted, the logit difference is the opposite of the baseline. This means that the S token is predicted stronger than the IO token, as strong as IO before patching. In this situation, due to the contradictory information contained in the output of S-Inhibition heads, the Name Movers attend and copy the S1 token instead of the IO token (see Figure 15, right). In the intermediate cases where only one of the signals is modified, we observe a partial effect compared to the fully inverted case (e.g. Figure 15, left). The effect size depends on the altered signals: positional signals are more important than token signals.
362
+
363
+ Can we be more specific as to what the token and positional signals are? Unfortunately, we do not have a complete answer, but see this as one of the most interesting further directions of our work. We expect that the majority of the positional information is about the relative positional embedding between S1 and S2 (such pointer arithmetic behavior has already been observed in Olsson et al.
364
+
365
+ Figure 14: Logit difference after patching S-Inhibition heads from signal-specific datasets. The effect on logit difference can be decomposed as a sum of the effects of position and token signal.
366
+
367
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Original positional signal</td><td rowspan=1 colspan=1>Inverted position signal</td></tr><tr><td rowspan=1 colspan=1>Original S token signal</td><td rowspan=1 colspan=1>3.55 (baseline)</td><td rowspan=1 colspan=1>-0.99</td></tr><tr><td rowspan=1 colspan=1>Random S token signal</td><td rowspan=1 colspan=1>2.45</td><td rowspan=1 colspan=1>-1.96</td></tr><tr><td rowspan=1 colspan=1>S←→IO inverted token signal</td><td rowspan=1 colspan=1>1.77</td><td rowspan=1 colspan=1>-3.16</td></tr></table>
368
+
369
+ ![](images/863fc629234613493d8bb543d42b12c8706a6477c4d2bcdf3f8942190f91d363.jpg)
370
+ Figure 15: Name Mover Heads’ attention probability before and after patching S-Inhibition Heads from signal-specific datasets. Left: patching from the dataset generated by random flip of name (same position signal, random token signal). Right: patching from the dataset generated by $\mathrm { I O } { } \mathrm { S } 2$ replacement (inverted position signal, inverted token signal). Black bars represent the standard deviation.
371
+
372
+ (2022)). When patching in S2 Inhibition outputs from a distribution where prefixes to sentences are longer (but the distance between S1 and S2 is constant), the logit difference doesn’t change (3.56 before patching vs 3.57 after). This suggests that the positional signal doesn’t depend on the absolute position of the tokens, as long as the relative position of S1 and S2 stays the same.
373
+
374
+ # H LAYER NORM AND THE RESIDUAL STREAM
375
+
376
+ The attention heads and MLPs in GPT-2 small write into the residual stream. Suppose $x _ { 1 2 }$ is the final state of the residual stream after the 12 layers. This is then converted into logits via $W _ { U } \circ$ $M \circ \mathrm { L N } ( x _ { 1 2 } )$ , where LN is defined in Appendix E, $M$ is the linear transformation of the layer norm operation and $W _ { U }$ is the unembedding matrix.
377
+
378
+ In order to attribute the extent to which an attention head $h$ writes in a direction $W _ { U } [ T ]$ where $T$ is a token (always IO or S in our case), we can’t simply compute $\langle M \circ \mathbf { L N } \circ h _ { i , j } ( X ) , \dot { W _ { U } } [ T ] \rangle$ , as the scaling factor that’s used is $\sqrt { \textstyle \sum _ { i } ( x _ { 1 2 , i } - \overline { { x _ { 1 2 , i } } } ) ^ { 2 } }$ . Therefore $\overline { { \mathrm { L N } } }$ in the main text uses this scaling factor:
379
+
380
+ $$
381
+ \overline { { \mathrm { L N } } } ( h ) \ { \stackrel { \mathrm { d e f } } { = } } \ M \circ \frac { h - \overline { { h } } } { \sqrt { \sum _ { i } ( x _ { 1 2 , i } - \overline { { x _ { 1 2 , i } } } ) ^ { 2 } } }
382
+ $$
383
+
384
+ # I ROLE OF MLPS IN THE TASK
385
+
386
+ In the main text, we focused our investigation on attention heads. Since they are the only module able of moving information across token position – a crucial component of the IOI task – they were our main subject of interest. However, MLP can still play a significant role in structuring the residual stream at a given position. We explored this possibility by performing knock-out of the MLP layers (Figure 16). We observe that MLP0 has a significant influence on logit difference after knock-out $( - \bar { 1 } 0 0 \%$ relative variation) but the other layers don’t seem to play a big role. We hypothesize that MLP0 can be used to perform low level token processing that latter layers rely on.
387
+
388
+ Moreover, we also investigated the writing of MLP along the $W _ { U } [ I O ] - W _ { U } [ S ]$ direction. As shown in Figure 16 (bottom) they write negligibly in this direction compared to attention heads (Figure 3).
389
+
390
+ <table><tr><td rowspan=1 colspan=1>U</td><td rowspan=1 colspan=1>Class</td><td rowspan=1 colspan=1>KU{u}</td><td rowspan=1 colspan=1>F(C\(KU{u)</td><td rowspan=1 colspan=1>F(C\K)</td></tr><tr><td rowspan=1 colspan=1>(9,9)</td><td rowspan=1 colspan=1>Name Mover</td><td rowspan=1 colspan=1>[(9,9)]</td><td rowspan=1 colspan=1>2.78</td><td rowspan=1 colspan=1>3.14</td></tr><tr><td rowspan=1 colspan=1>(10,0)</td><td rowspan=1 colspan=1>Name Mover</td><td rowspan=1 colspan=1>[(9,9), (10,0)]</td><td rowspan=1 colspan=1>2.43</td><td rowspan=1 colspan=1>2.78</td></tr><tr><td rowspan=1 colspan=1>(9,6</td><td rowspan=1 colspan=1>Name Mover</td><td rowspan=1 colspan=1>[(9,9),(10,0),(9,6)]</td><td rowspan=1 colspan=1>2.77</td><td rowspan=1 colspan=1>2.43</td></tr><tr><td rowspan=1 colspan=1>(10,7)</td><td rowspan=1 colspan=1>Negative Name Mover</td><td rowspan=1 colspan=1>All Negative Name Mover Heads</td><td rowspan=1 colspan=1>5.11</td><td rowspan=1 colspan=1>3.84</td></tr><tr><td rowspan=1 colspan=1>(11,10)</td><td rowspan=1 colspan=1>Negative Name Mover</td><td rowspan=1 colspan=1>All Negative Name Mover Heads</td><td rowspan=1 colspan=1>5.11</td><td rowspan=1 colspan=1>4.06</td></tr><tr><td rowspan=1 colspan=1>(7,3)</td><td rowspan=1 colspan=1>S-Inhibition</td><td rowspan=1 colspan=1>All S-Inhibition Heads</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>1.15</td></tr><tr><td rowspan=1 colspan=1>(7,9)</td><td rowspan=1 colspan=1>S-Inhibition</td><td rowspan=1 colspan=1>All S-Inhibition Heads</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>1.12</td></tr><tr><td rowspan=1 colspan=1>(8,6)</td><td rowspan=1 colspan=1>S-Inhibition</td><td rowspan=1 colspan=1>All S-Inhibition Heads</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>1.10</td></tr><tr><td rowspan=1 colspan=1>(8,10)</td><td rowspan=1 colspan=1>S-Inhibition</td><td rowspan=1 colspan=1>All S-InhibitionHeads</td><td rowspan=1 colspan=1>0.33</td><td rowspan=1 colspan=1>0.55</td></tr><tr><td rowspan=1 colspan=1>(5,5)</td><td rowspan=1 colspan=1>Induction</td><td rowspan=1 colspan=1>Induction Headsand NegativeHeads</td><td rowspan=1 colspan=1>1.06</td><td rowspan=1 colspan=1>3.95</td></tr><tr><td rowspan=1 colspan=1>(5,8)</td><td rowspan=1 colspan=1>Induction</td><td rowspan=1 colspan=1>All Induction Heads</td><td rowspan=1 colspan=1>1.06</td><td rowspan=1 colspan=1>2.58</td></tr><tr><td rowspan=1 colspan=1>(5,9)</td><td rowspan=1 colspan=1>Induction</td><td rowspan=1 colspan=1>All Induction Heads</td><td rowspan=1 colspan=1>4.40</td><td rowspan=1 colspan=1>5.11</td></tr><tr><td rowspan=1 colspan=1>(6,9)</td><td rowspan=1 colspan=1>Induction</td><td rowspan=1 colspan=1>Induction Heads and Negative Heads</td><td rowspan=1 colspan=1>4.76</td><td rowspan=1 colspan=1>5.11</td></tr><tr><td rowspan=1 colspan=1>(0,1)</td><td rowspan=1 colspan=1>Duplicate Token</td><td rowspan=1 colspan=1>All Duplicate Token Heads</td><td rowspan=1 colspan=1>1.14</td><td rowspan=1 colspan=1>2.52</td></tr><tr><td rowspan=1 colspan=1>(0,10)</td><td rowspan=1 colspan=1>Duplicate Token</td><td rowspan=1 colspan=1>AllDuplicate Token Heads</td><td rowspan=1 colspan=1>1.14</td><td rowspan=1 colspan=1>2.29</td></tr><tr><td rowspan=1 colspan=1>(3,0</td><td rowspan=1 colspan=1>Duplicate Token</td><td rowspan=1 colspan=1>All Duplicate Token Heads</td><td rowspan=1 colspan=1>1.14</td><td rowspan=1 colspan=1>1.65</td></tr><tr><td rowspan=1 colspan=1>(2,2)</td><td rowspan=1 colspan=1>Previous Token</td><td rowspan=1 colspan=1>All Previous Token Heads</td><td rowspan=1 colspan=1>2.03</td><td rowspan=1 colspan=1>2.80</td></tr><tr><td rowspan=1 colspan=1>(2,9)</td><td rowspan=1 colspan=1>Previous Token</td><td rowspan=1 colspan=1>All Previous Token Heads</td><td rowspan=1 colspan=1>2.03</td><td rowspan=1 colspan=1>2.42</td></tr><tr><td rowspan=1 colspan=1>(4, 11)</td><td rowspan=1 colspan=1>Previous Token</td><td rowspan=1 colspan=1>All Previous Token Heads</td><td rowspan=1 colspan=1>2.03</td><td rowspan=1 colspan=1>2.27</td></tr><tr><td rowspan=1 colspan=1>(10,10)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>2.40</td><td rowspan=1 colspan=1>2.63</td></tr><tr><td rowspan=1 colspan=1>(10,2)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>0.89</td><td rowspan=1 colspan=1>1.09</td></tr><tr><td rowspan=1 colspan=1>(11,2)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>0.72</td><td rowspan=1 colspan=1>0.89</td></tr><tr><td rowspan=1 colspan=1>(10,6)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>2.63</td><td rowspan=1 colspan=1>2.77</td></tr><tr><td rowspan=1 colspan=1>(10,1)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>1.34</td><td rowspan=1 colspan=1>1.47</td></tr><tr><td rowspan=1 colspan=1>(9,7)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>1.02</td></tr><tr><td rowspan=1 colspan=1>(11,9)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>All NMs and previous Backup NMs</td><td rowspan=1 colspan=1>1.02</td><td rowspan=1 colspan=1>1.13</td></tr><tr><td rowspan=1 colspan=1>(11,3)</td><td rowspan=1 colspan=1>Backup Name Mover</td><td rowspan=1 colspan=1>[(9,9),(10,0),(9,6),(10,10),(11,3)]</td><td rowspan=1 colspan=1>2.53</td><td rowspan=1 colspan=1>2.59</td></tr></table>
391
+
392
+ ![](images/52eaaaf6782beb48097fcb2de051c9ce32a0ff353f73138bb16d8d6b84c55907.jpg)
393
+ Figure 17: $K$ sets for minimality for each $v$
394
+ Figure 16: Top: Relative variation in logit difference from knocking out MLP layers. Only MLP0 causes a significative decrease in logit difference after knock-out. Bottom: We measure how much MLPs write along the $W _ { U } [ I O ] - W _ { U } [ S ]$ direction.
395
+
396
+ # J MINIMALITY SETS
397
+
398
+ The sets that were found for the minimality tests are listed in Table 17.
399
+
400
+ Figure 18: 4 sets $K$ found by the greedy optimization procedure on our circuit.
401
+
402
+ <table><tr><td rowspan=1 colspan=1>K found by greedy optimization</td></tr><tr><td rowspan=1 colspan=1>(9,9),(9,6), (5,8), (5,5), (2,2), (2,9)</td></tr><tr><td rowspan=1 colspan=1>(9,9),(11,10),(10,7),(8,6),(5,8),(4,11)</td></tr><tr><td rowspan=1 colspan=1>(10,7), (5,5), (2,2), (4,11)</td></tr><tr><td rowspan=1 colspan=1>(9,9),(11,10),(10,7),(11,2),(3,0),,(5,8),(2,2)</td></tr></table>
403
+
404
+ # K GREEDY ALGORITHM
405
+
406
+ The Algorithm 2 describes the procedure used to sample sets for checking the completeness criteria using greedy optimization. In practice, because the na¨ıve and the full circuit are not of the same size, we chose respectively $k = 5$ and $k = 1 0$ to ensure a similar amount of stochasticity in the process. We run the procedure 10 times and kept the 5 sets with the maximal important incompleteness score (including the intermediate $K$ ).
407
+
408
+ Algorithm 2 The greedy sampling procedure for sets to validate the completeness citeria.
409
+
410
+ 1: $K \gets \emptyset$
411
+ 2: for $i$ to $N$ do
412
+ 3: Sample a random subset $V \subseteq C$ of $k$ nodes uniformly.
413
+ 4: $\begin{array} { r } { \widehat { v _ { \mathrm { M A X } } } \arg \operatorname* { m a x } _ { \boldsymbol { v } \in V } | \mathrm { F } ( C \setminus ( K \cup \{ \boldsymbol { v } \} ) ) - \mathrm { F } ( C \setminus \dot { K } ) | } \end{array}$
414
+ 5: $K \gets K \cup \{ v _ { \mathrm { M A X } } \}$
415
+ 6: end for
416
+ 7: return $K$
417
+
418
+ As visible in Table 18 the sets found by the greedy search contains a combination of nodes from different class. Nonetheless, the overlap between different $K$ suggest that we are missing components from $M$ that can take the place of induction heads or S-inhibition Heads when some Name Mover Heads are knocked-out.
419
+
420
+ # L TECHNIQUES OVERVIEW
421
+
422
+ This work involved a variety of techniques that were required to explain model behavior.
423
+
424
+ # • Knockouts:
425
+
426
+ We used knockouts in two different ways: knocking out singular components of models, and knocking out everything in the model except particular circuits. The former was somewhat useful, and the latter we found powerful.
427
+
428
+ – Knockout of single components: as an attribution method, knocking out singular components was not always as powerful as techniques such as projections, since the compensation (or backup) nature of Backup Name Mover Heads in this task allowed components to be knocked out and their true effect size masked. Knockouts of all components except a circuit: on the other hand, knocking out all components except a circuit enabled us to isolate behaviors in this task where behavior was sparse, and check the components of our circuit while ignoring the vast percentage of components of the network, making work manageable.
429
+
430
+ What was very important for the success of knockout and patching experiments was the choice of reference distribution for knockout. The analysis in Appendix G shows how the specific choice of dataset is useful for understanding model components. For a more general knockout, the OpenWebText dataset, GPT’s training data, can be used. However, we found that this led to noisier results (though our circuit components still were shown to be important when we used this ablation).
431
+
432
+ # • Attention pattern analysis:
433
+
434
+ Using attention patterns to explain behavior is always worrying due to the possibility that information has accumulated on that token primarily from previous tokens, or that the position with large attention paid to isn’t actually writing an important value into the residual stream. In our work however, analyzing attention patterns was generally a necessary first step before further experiments could be ran, and in this small model, both of the worrying cases did not generally arise.
435
+
436
+ # • Patching:
437
+
438
+ Patching was an important method we used to verify causal explanations that were generally formed from correlational evidence. In this way our use case is similar to Finlayson et al. (2021). We were surprised however that in general patching gave clear signal on the changes in behavior. This may be because we generally patched from inputs like the ABC distribution (which was successful in knocking out too). Therefore, keeping the context of the sentence templates may be generally useful. This could be either because the other words in the templates allow the model to realise that it should be doing IOI, or that introducing inputs from other distributions introduces noise that the model picks up on and uses, when this is not intended.
parse/dev/NpsVSN6o4ul/NpsVSN6o4ul_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Re3NjSwf0WF/Re3NjSwf0WF_content_list.json ADDED
@@ -0,0 +1,843 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Legged Locomotion in Challenging Terrains using Egocentric Vision ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 233,
8
+ 114,
9
+ 766,
10
+ 165
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Ananye Agarwal⇤ 1 Ashish Kumar⇤ 2, Jitendra Malik†2, Deepak Pathak†1 1Carnegie Mellon University, 2UC Berkeley ",
17
+ "bbox": [
18
+ 236,
19
+ 189,
20
+ 761,
21
+ 220
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "image",
27
+ "img_path": "images/c4f1c976fde50957026f7617546345bc3f0acba84803be2238a390f39d23d4a0.jpg",
28
+ "image_caption": [
29
+ "Figure 1: Our robot can traverse a variety of challenging terrain in indoor and outdoor environments, urban and natural settings during day and night using a single front-facing depth camera. The robot can traverse curbs, stairs and moderately rocky terrain. Despite being much smaller than other commonly used legged robots, it is able to climb stairs and curbs of a similar height. Videos at https://vision-locomotion.github.io "
30
+ ],
31
+ "image_footnote": [],
32
+ "bbox": [
33
+ 174,
34
+ 239,
35
+ 823,
36
+ 551
37
+ ],
38
+ "page_idx": 0
39
+ },
40
+ {
41
+ "type": "text",
42
+ "text": "Abstract: Animals are capable of precise and agile locomotion using vision. Replicating this ability has been a long-standing goal in robotics. The traditional approach has been to decompose this problem into elevation mapping and foothold planning phases. The elevation mapping, however, is susceptible to failure and large noise artifacts, requires specialized hardware, and is biologically implausible. In this paper, we present the first end-to-end locomotion system capable of traversing stairs, curbs, stepping stones, and gaps. We show this result on a medium-sized quadruped robot using a single front-facing depth camera. The small size of the robot necessitates discovering specialized gait patterns not seen elsewhere. The egocentric camera requires the policy to remember past information to estimate the terrain under its hind feet. We train our policy in simulation. Training has two phases - first, we train a policy using reinforcement learning with a cheap-to-compute variant of depth image and then in phase 2 distill it into the final policy that uses depth using supervised learning. The resulting policy transfers to the real world and is able to run in real-time on the limited compute of the robot. It can traverse a large variety of terrain while being robust to perturbations like pushes, slippery surfaces, and rocky terrain. Videos are at https://vision-locomotion.github.io. ",
43
+ "bbox": [
44
+ 232,
45
+ 635,
46
+ 766,
47
+ 882
48
+ ],
49
+ "page_idx": 0
50
+ },
51
+ {
52
+ "type": "text",
53
+ "text": "1 Introduction ",
54
+ "text_level": 1,
55
+ "bbox": [
56
+ 174,
57
+ 89,
58
+ 312,
59
+ 106
60
+ ],
61
+ "page_idx": 1
62
+ },
63
+ {
64
+ "type": "text",
65
+ "text": "Of what use is vision during locomotion? Clearly, there is a role of vision in navigation – using maps or landmarks to find a trajectory in the 2D plane to a distant goal while avoiding obstacles. But given a local direction in which to move, it turns out that both humans [1] and robots [2, 3] can do remarkably well at blind walking. Where vision becomes necessary is for locomotion in challenging terrains. In an urban environment, staircases are the most obvious example. In the outdoors, we can deal with rugged terrain such as scrambling over rocks, or stepping from stone to stone to cross a stream of water. There is a fair amount of scientific work studying this human capability and showing tight coupling of motor control with vision [4, 5, 6]. In this paper, we will develop this capability for a quadrupedal walking robot equipped with egocentric depth vision. We use a reinforcement learning approach trained in simulation, which we are directly able to transfer to the real world. Figure 1 and the accompanying videos shows some examples of our robot walking guided by vision. ",
66
+ "bbox": [
67
+ 174,
68
+ 112,
69
+ 825,
70
+ 263
71
+ ],
72
+ "page_idx": 1
73
+ },
74
+ {
75
+ "type": "text",
76
+ "text": "Humans receive an egocentric stream of vision which is used to control feet placement, typically without conscious planning. As children we acquire it through trial and error [7] but for adults it is an automatized skill. Its unconscious execution should not take away from its remarkable sophistication. The footsteps being placed now are based on information collected some time ago. Typically, we don’t look at the ground underneath our feet, rather at the upcoming piece of ground in front of us a few steps away[1, 4, 5, 6]. A short term memory is being created which persists long enough to guide foot placement when we are actually over that piece of ground. Finally, note that we learn to walk through bouts of steps, not by executing pre-programmed gaits [7]. ",
77
+ "bbox": [
78
+ 173,
79
+ 270,
80
+ 825,
81
+ 382
82
+ ],
83
+ "page_idx": 1
84
+ },
85
+ {
86
+ "type": "text",
87
+ "text": "We take these observations about human walking as design principles for the visually-based walking controller for an A1 robot. The walking policy is trained by reinforcement learning with a recurrent neural network being used as a short term memory of recent egocentric views, proprioceptive states, and action history. Such a policy can maintain memory of recent visual information to retrieve characteristics of the terrain under the robot or below the rear feet, which might no longer be directly visible in the egocentric view. ",
88
+ "bbox": [
89
+ 174,
90
+ 387,
91
+ 825,
92
+ 470
93
+ ],
94
+ "page_idx": 1
95
+ },
96
+ {
97
+ "type": "text",
98
+ "text": "In contrast, prior locomotion techniques rely on the metric elevation map of the terrain around and under the robot [8, 9, 10] to plan foot steps and joint angles. The elevation map is constructed by fusing information from multiple depth images (collected over time). This fusion of depth images into a single elevation map requires the relative pose between cameras at different times. Hence, tracking is required in the real world to obtain this relative pose using visual or inertial odometry. This is challenging because of noise introduced in sensing and odometry, and hence, previous methods add different kinds of structured noise at training time to account for the noise due to pose estimation drift [11, 12, 13]. The large amount of noise hinders the ability of such systems to perform reliably on gaps and stepping stones. We use vision as a first class citizen and show all the uneven terrain capabilities along with a high success rate on crossing gaps and stepping stones. ",
99
+ "bbox": [
100
+ 173,
101
+ 477,
102
+ 825,
103
+ 616
104
+ ],
105
+ "page_idx": 1
106
+ },
107
+ {
108
+ "type": "image",
109
+ "img_path": "images/eb45f0d0ab49231be2787af2e1d0b1cebef75e7873b97aa1ae5ff0c3e02bc99f.jpg",
110
+ "image_caption": [
111
+ "Figure 2: A smaller robot (a) faces challenges in climbing stairs and curbs due to the stair obstructing its feet while going up and a tendency to topple over when coming down (b). Our robot deals with this by climbing using a large hip abduction that automatically emerges during training (c). "
112
+ ],
113
+ "image_footnote": [],
114
+ "bbox": [
115
+ 179,
116
+ 621,
117
+ 815,
118
+ 700
119
+ ],
120
+ "page_idx": 1
121
+ },
122
+ {
123
+ "type": "text",
124
+ "text": "The design principle of not having pre-programmed gait priors turns out to be quite advantageous for our relatively small robot 1 (fig. 2). Predefined gait priors or reference motions fail to generalize to obstacles of even a reasonable height because of the relatively small size of the quadruped. The emergent behaviors for traversing complex terrains without any priors enable our robot with a hip joint height of ${ 2 8 } \\mathrm { c m }$ to traverse the stairs of height upto $2 5 \\mathrm { c m }$ , $89 \\%$ relative to its height, which is significantly higher than any existing methods which typically rely on gait priors. ",
125
+ "bbox": [
126
+ 174,
127
+ 756,
128
+ 825,
129
+ 840
130
+ ],
131
+ "page_idx": 1
132
+ },
133
+ {
134
+ "type": "text",
135
+ "text": "Since our robot is small and inexpensive, it has limited onboard compute and sensing. It uses a single front-facing D435 camera for exteroception. In contrast, AnymalC has four such cameras in addition to two dome lidars. Similarly, Spot has 5 depth cameras around its body. Our policy computes actions with a single feedforward pass and requires no tracking. This frees us from running optimization for MPC or localization which requires expensive hardware to run in real-time. ",
136
+ "bbox": [
137
+ 176,
138
+ 845,
139
+ 825,
140
+ 888
141
+ ],
142
+ "page_idx": 1
143
+ },
144
+ {
145
+ "type": "text",
146
+ "text": "",
147
+ "bbox": [
148
+ 171,
149
+ 92,
150
+ 823,
151
+ 119
152
+ ],
153
+ "page_idx": 2
154
+ },
155
+ {
156
+ "type": "text",
157
+ "text": "Overall, this use of learning “all the way” and the tight coupling of egocentric vision with motor control are the distinguishing aspects of our approach. ",
158
+ "bbox": [
159
+ 173,
160
+ 126,
161
+ 823,
162
+ 154
163
+ ],
164
+ "page_idx": 2
165
+ },
166
+ {
167
+ "type": "text",
168
+ "text": "2 Method: Legged Locomotion from Egocentric Vision ",
169
+ "text_level": 1,
170
+ "bbox": [
171
+ 173,
172
+ 188,
173
+ 647,
174
+ 207
175
+ ],
176
+ "page_idx": 2
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "Our goal is to learn a walking policy that maps proprioception and depth input to target joint angles at $5 0 \\mathrm { H z }$ . Since depth rendering slows down the simulation by an order of magnitude, directly training this system using reinforcement learning (RL) would require billions of samples to converge making this intractable with current simulations. We therefore employ a two-phase training scheme. In phase 1, we use low resolution scandots located under the robot as a proxy for depth images. Scandots refer to a set of $( x , y )$ coordinates in the robot’s frame of reference at which the height of the terrain is queried and passed as observation at each time step (fig. 3). These capture terrain geometry and are cheap to compute. In phase 2, we use depth and proprioception as input to an RNN to implicitly track the terrain under the robot and directly predict the target joint angles at $5 0 \\mathrm { H z }$ . This is supervised with actions from the phase 1 policy. Since supervised learning is orders of magnitude more sample efficient than RL, our proposed pipeline enables training the whole system on a single GPU in a few days. Once trained, our deployment policy does not construct metric elevation maps, which typically rely on metric localization, and instead directly predicts joint angles from depth and proprioception. ",
181
+ "bbox": [
182
+ 173,
183
+ 231,
184
+ 825,
185
+ 411
186
+ ],
187
+ "page_idx": 2
188
+ },
189
+ {
190
+ "type": "text",
191
+ "text": "One potential failure mode of this two-phase training is that the scandots might contain more information than what depth can infer. To get around this, we choose scandots and camera field-ofview such that phase 2 loss is low. We formally show that this guarantees that the phase 2 policy will have close to optimal performance in $\\mathrm { T h m }$ below. ",
192
+ "bbox": [
193
+ 174,
194
+ 417,
195
+ 825,
196
+ 472
197
+ ],
198
+ "page_idx": 2
199
+ },
200
+ {
201
+ "type": "text",
202
+ "text": "Theorem 2.1. $\\mathcal { M } = ( S , \\mathcal { A } , P , R , \\gamma )$ be an MDP with state space $s$ , action space $\\mathcal { A }$ , transition function $P : \\mathcal { S } \\times \\mathcal { A } \\mathcal { S }$ , reward function $R : \\mathcal { A } \\times \\mathcal { S } \\mathbb { R }$ and discount factor $\\gamma$ . Let $V ^ { 1 } ( s )$ be the value function of the phase $I$ policy that is trained to be close to optimal value function $V ^ { \\ast } ( s )$ , i.e., $\\vert V ^ { * } ( s ) - V ^ { 1 } ( s ) \\vert < \\epsilon \\forall s \\in \\mathcal { S }$ , and $\\pi ^ { 1 } ( s )$ be the greedy phase 1 policy obtained from $V ^ { 1 } ( s )$ . Suppose the phase 2 policy operates in a different state space $S ^ { \\prime }$ given by a mapping $f : S S ^ { \\prime }$ . If the phase 2 policy is close to phase 1 $\\big | \\pi ^ { 1 } \\tilde { ( s ) } - \\pi ^ { 2 } ( f ( s ) ) \\big | < \\eta \\tilde { \\forall } s$ and $R , P$ are Lipschitz continuous, then the return of phase 2 policy is close to optimal everywhere, i.e., 8s $\\begin{array} { r } { , \\ \\left| V ^ { \\ast } ( s ) - V ^ { \\pi ^ { 2 } } ( f ( s ) ) \\right| < \\frac { 2 \\epsilon \\gamma + \\eta c } { 1 - \\gamma } } \\end{array}$ where $\\begin{array} { r } { c \\propto \\sum _ { s \\in \\mathcal { S } } V ^ { * } ( s ) } \\end{array}$ is a large but bounded constant. (proof in sec. A) ",
203
+ "bbox": [
204
+ 173,
205
+ 483,
206
+ 825,
207
+ 612
208
+ ],
209
+ "page_idx": 2
210
+ },
211
+ {
212
+ "type": "text",
213
+ "text": "We instantiate our training scheme using two different architectures. The monolithic architecture is an RNN that maps from raw proprioception and vision data directly to joint angles. The RMA architecture follows [3, 14], and contains an MLP base policy that takes $\\gamma _ { t }$ (which encodes the local terrain geometry) along with the extrinsics vector $\\mathbf { z } _ { t }$ (which encodes environment parameters [3]), and proprioception $\\mathbf { x } _ { t }$ to predict the target joint angles. An estimate of $\\gamma _ { t }$ is generated by an RNN that takes proprioception and vision as inputs. While the monolithic architecture is conceptually simpler, it implicitly tracks $\\gamma _ { t }$ and $\\mathbf { z } _ { t }$ in its weights and is hard to disentagle. In contrast, the RMA architecture allows direct access to each input $( \\gamma _ { t }$ or $\\mathbf { z } _ { t }$ ) through latent vectors. This allows the possibility of swapping sensors (like replacing depth by RGB) or using one stream to supervise the other while keeping the base motor policy fixed. ",
214
+ "bbox": [
215
+ 173,
216
+ 628,
217
+ 825,
218
+ 767
219
+ ],
220
+ "page_idx": 2
221
+ },
222
+ {
223
+ "type": "text",
224
+ "text": "2.1 Phase 1: Reinforcement Learning from Scandots ",
225
+ "text_level": 1,
226
+ "bbox": [
227
+ 174,
228
+ 799,
229
+ 552,
230
+ 814
231
+ ],
232
+ "page_idx": 2
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "Given the scandots $\\left( v _ { x } ^ { \\mathrm { c m d } } , \\omega _ { z } ^ { \\mathrm { c m d } } \\right)$ we learn a policy using PPO without gait priors and with reward functions that minimizewalk on a variety of terrains. Proprioception consists of joint angles, joint velocities, $\\mathbf { m } _ { t }$ , proprioception $\\mathbf { x } _ { t }$ , commanded linear and angular velocity ${ \\bf u } _ { t } ^ { \\mathrm { c m d } } = { }$ angular velocity, roll and pitch measured by onboard sensors in addition to the last policy actions $\\mathbf { a } _ { t - 1 }$ . Let ${ \\bf o } _ { t } = ( { \\bf m } _ { t } , { \\bf x } _ { t } , { \\bf u } _ { t } ^ { \\mathrm { c m d } } )$ denote the observations. The RMA policy also takes privileged information $\\mathbf { e } _ { t }$ as input which includes center-of-mass of robot, ground friction, and motor strength. ",
237
+ "bbox": [
238
+ 174,
239
+ 833,
240
+ 825,
241
+ 917
242
+ ],
243
+ "page_idx": 2
244
+ },
245
+ {
246
+ "type": "image",
247
+ "img_path": "images/1a45435ecc014cfc13c3db2b07f9349a728c8f07a585ee4571b8d29fd9fd222c.jpg",
248
+ "image_caption": [
249
+ "Figure 3: We train our locomotion policy in two phases to avoid rendering depth for too many samples. In phase 1, we use RL to train a policy $\\mathbf { \\hat { \\Pi } } _ { \\pi } \\mathbf { 1 }$ that has access to scandots that are cheap to compute. In phase 2, we use $\\pi ^ { 1 }$ to provide ground truth actions which another policy $\\pi ^ { 2 }$ is trained to imitate. This student has access to depth map from the front camera. We consider two architectures (1) a monolithic one which is a GRU trained to output joint angles with raw observations as input (2) a decoupled architecture trained using RMA [3] that is trained to estimate vision and proprioception latents that condition a base feedforward walking policy. "
250
+ ],
251
+ "image_footnote": [],
252
+ "bbox": [
253
+ 178,
254
+ 88,
255
+ 820,
256
+ 367
257
+ ],
258
+ "page_idx": 3
259
+ },
260
+ {
261
+ "type": "text",
262
+ "text": "Monolithic The scandots $\\mathbf { m } _ { t }$ are first compressed to $\\gamma _ { t }$ and then passed with the rest of the observations to a GRU that predicts the joint angles. ",
263
+ "bbox": [
264
+ 173,
265
+ 479,
266
+ 823,
267
+ 508
268
+ ],
269
+ "page_idx": 3
270
+ },
271
+ {
272
+ "type": "equation",
273
+ "img_path": "images/cafa3607193d4319c4c57cb528519d5cc34dfa0cc459dfd0f0f6a18034cc7231.jpg",
274
+ "text": "$$\n\\begin{array} { r l } & { { \\gamma } _ { t } = \\mathrm { M L P } \\left( \\mathbf { m } _ { t } \\right) } \\\\ & { { \\bf { a } } _ { t } = { \\mathrm { G R U } } _ { t } \\left( { { \\bf { x } } _ { t } } , { { \\gamma } _ { t } } , { { \\bf { u } } _ { t } ^ { \\mathrm { { c m d } } } } \\right) } \\end{array}\n$$",
275
+ "text_format": "latex",
276
+ "bbox": [
277
+ 408,
278
+ 515,
279
+ 588,
280
+ 556
281
+ ],
282
+ "page_idx": 3
283
+ },
284
+ {
285
+ "type": "text",
286
+ "text": "the subscript $t$ on the GRU indicates that it is stateful. ",
287
+ "bbox": [
288
+ 173,
289
+ 561,
290
+ 526,
291
+ 577
292
+ ],
293
+ "page_idx": 3
294
+ },
295
+ {
296
+ "type": "text",
297
+ "text": "RMA Instead of using a monolithic memory based architecture for the controller, we use an MLP as the controller, pushing the burden of maintaining memory and state on the various inputs to the MLP. Concretely, we process the environment parameters $\\left( \\mathbf { e } _ { t } \\right)$ with an MLP and the scandots $\\mathbf { \\Pi } ( \\mathbf { m } _ { t } )$ with a GRU to get $\\mathbf { z } _ { t }$ and $\\gamma _ { t }$ respectively which are given as input to the base feedforward policy. ",
298
+ "bbox": [
299
+ 173,
300
+ 593,
301
+ 825,
302
+ 650
303
+ ],
304
+ "page_idx": 3
305
+ },
306
+ {
307
+ "type": "equation",
308
+ "img_path": "images/0d3859b9994050ad170ccda504f8c5cc5d6ad87a328ea7f0e8939ee8e8aa4077.jpg",
309
+ "text": "$$\n\\begin{array} { r l } & { \\gamma _ { t } = \\mathrm { G R U } _ { t } \\left( \\mathbf { m } _ { t } \\right) } \\\\ & { \\mathbf { z } _ { t } = \\mathrm { M L P } \\left( \\mathbf { e } _ { t } \\right) } \\\\ & { \\mathbf { a } _ { t } = \\mathrm { M L P } \\left( \\mathbf { x } _ { t } , \\gamma _ { t } , \\mathbf { z } _ { t } , \\mathbf { u } _ { t } ^ { \\mathrm { c m d } } \\right) } \\end{array}\n$$",
310
+ "text_format": "latex",
311
+ "bbox": [
312
+ 401,
313
+ 656,
314
+ 596,
315
+ 715
316
+ ],
317
+ "page_idx": 3
318
+ },
319
+ {
320
+ "type": "text",
321
+ "text": "Both the phase 1 architectures are trained using PPO [15] with backpropagation through time [16] truncated at 24 timesteps. ",
322
+ "bbox": [
323
+ 174,
324
+ 720,
325
+ 825,
326
+ 750
327
+ ],
328
+ "page_idx": 3
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "Rewards We extend the reward functions proposed in [3, 17] to simply penalizing the energy consumption along with additional penalties to prevent damage to hardware on complex terrain (sec. B). Importantly, we do not impose any gait priors or predefined foot trajectories and let optimal gaits that are stable and natural to emerge for the task. ",
333
+ "bbox": [
334
+ 174,
335
+ 765,
336
+ 825,
337
+ 821
338
+ ],
339
+ "page_idx": 3
340
+ },
341
+ {
342
+ "type": "text",
343
+ "text": "• Absolute work penalty $- | { \\boldsymbol { \\tau } } \\cdot \\mathbf { q } |$ where $\\tau$ are the joint torques. We use the absolute value so that the policy does not learn to get positive reward by exploiting inaccuracies in contact simulation. • Command tracking $v _ { x } ^ { \\mathrm { c m d } } - \\left| v _ { x } ^ { \\mathrm { c m d } } - v _ { x } \\right| - \\left| \\omega _ { z } ^ { \\mathrm { c m d } } - \\omega _ { z } \\right|$ where $v _ { x }$ is velocity of robot in forward direction and $\\omega _ { z }$ is yaw angular velocity $( x , z$ are coordinate axes fixed to the robot). • Foot jerk penalty $\\begin{array} { r } { \\sum _ { i \\in \\mathcal { F } } \\| \\mathbf { f } _ { t } ^ { i } - \\mathbf { f } _ { t - 1 } ^ { i } \\| } \\end{array}$ where $\\mathbf { f } _ { t } ^ { i }$ is the force at time $t$ on the $i ^ { \\mathrm { { t h } } }$ rigid body and $\\mathcal { F }$ is 2Fthe set of feet indices. This prevents large motor backlash. ",
344
+ "bbox": [
345
+ 181,
346
+ 828,
347
+ 825,
348
+ 911
349
+ ],
350
+ "page_idx": 3
351
+ },
352
+ {
353
+ "type": "text",
354
+ "text": "• Feet drag penalty $\\begin{array} { r } { \\sum _ { i \\in \\mathcal { F } } \\mathbb { I } \\left[ f _ { z } ^ { i } \\geq 1 \\mathbf { N } \\right] \\cdot \\left( \\left| v _ { x } ^ { i } \\right| + \\left| v _ { y } ^ { i } \\right| \\right) } \\end{array}$ where $\\mathbb { I }$ is the indicator function, and $v _ { x } ^ { i } , v _ { y } ^ { i }$ is velocity of $i ^ { \\mathrm { { t h } } }$ rigid body. This penalizes velocity of feet in the horizontal plane if in contact with the ground preventing feet dragging on the ground which can damage them. \n• Collision penalty $\\textstyle \\sum _ { i \\in { \\mathcal { C } } \\cup { \\mathcal { T } } } \\mathbb { I } \\left[ \\mathbf { f } ^ { i } \\geq { \\overrightarrow { 0 . 1 \\mathbf { N } } } \\right]$ where ${ \\mathcal { C } } , { \\mathcal { T } }$ are the set of calf and thigh indices. This 2C[T penalizes contacts at the thighs and calves of the robot which would otherwise graze against edges of stairs and discrete obstacles. \n• Survival bonus constant value 1 at each time step to prioritize survival over following commands in challenging situations. ",
355
+ "bbox": [
356
+ 179,
357
+ 88,
358
+ 826,
359
+ 205
360
+ ],
361
+ "page_idx": 4
362
+ },
363
+ {
364
+ "type": "text",
365
+ "text": "Training environment Similar to [18] we generate different sets of terrain (fig. 5) of varying difficulty level. Following [3], we generate fractal variations over each of the terrains to get robust walking behaviour. At training time, the environments are arranged in a $6 \\times 1 0$ matrix with each row having terrain of the same type and difficulty increasing from left to right. We train with a curriculum over terrain [18] where robots are first initialized on easy terrain and promoted to harder terrain if they traverse more than half its length. They are demoted to easier terrain if they fail to travel at least half the commanded distance $v _ { x } ^ { \\mathrm { c m d } } \\bar { T }$ where $T$ is maximum episode length. We randomize parameters of the simulation (tab. 3) and add small i.i.d. gaussian noise to observations for robustness (tab. 2). ",
366
+ "bbox": [
367
+ 173,
368
+ 210,
369
+ 825,
370
+ 321
371
+ ],
372
+ "page_idx": 4
373
+ },
374
+ {
375
+ "type": "text",
376
+ "text": "2.2 Phase 2: Supervised Learning ",
377
+ "text_level": 1,
378
+ "bbox": [
379
+ 176,
380
+ 335,
381
+ 421,
382
+ 351
383
+ ],
384
+ "page_idx": 4
385
+ },
386
+ {
387
+ "type": "text",
388
+ "text": "In phase 2, we use supervised learning to distil the phase 1 policy into an architecture that only has access to sensing available onboard: proprioception $\\left( \\mathbf { x } _ { t } \\right)$ and depth $\\mathbf { d } _ { t }$ . ",
389
+ "bbox": [
390
+ 173,
391
+ 361,
392
+ 823,
393
+ 390
394
+ ],
395
+ "page_idx": 4
396
+ },
397
+ {
398
+ "type": "text",
399
+ "text": "Monolithic We create a copy of the recurrent base policy 2. We preprocess the depth map through a convnet before passing it to the base policy. ",
400
+ "bbox": [
401
+ 173,
402
+ 404,
403
+ 821,
404
+ 433
405
+ ],
406
+ "page_idx": 4
407
+ },
408
+ {
409
+ "type": "equation",
410
+ "img_path": "images/32d818092b76cf46fdbbc31bb88a1712218d6eff06fcce951d003cc5c58f8df2.jpg",
411
+ "text": "$$\n\\begin{array} { r l } & { \\tilde { \\mathbf { d } } _ { t } = \\mathrm { C o n v N e t } \\left( \\mathbf { d } _ { t } \\right) } \\\\ & { \\hat { \\mathbf { a } } _ { t } = \\mathrm { G R U } _ { t } ( \\mathbf { x } _ { t } , \\tilde { \\mathbf { d } } _ { t } , \\mathbf { a } _ { t } ^ { \\mathrm { c m d } } ) } \\end{array}\n$$",
412
+ "text_format": "latex",
413
+ "bbox": [
414
+ 411,
415
+ 436,
416
+ 584,
417
+ 479
418
+ ],
419
+ "page_idx": 4
420
+ },
421
+ {
422
+ "type": "text",
423
+ "text": "We train with DAgger [19] with truncated backpropagation through time (BPTT) to minimize mean squared error between predicted and ground truth actions $\\| \\hat { \\mathbf { a } } _ { t } - \\mathbf { a } _ { t } \\| ^ { 2 }$ . In particular, we unroll the student inside the simulator for $N = 2 4$ timesteps and then label each of the states encountered with the ground truth action $\\mathbf { a } _ { t }$ from phase 1. ",
424
+ "bbox": [
425
+ 174,
426
+ 482,
427
+ 823,
428
+ 539
429
+ ],
430
+ "page_idx": 4
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "RMA Instead of retraining the whole controller, we only train estimators of $\\gamma _ { t }$ and $\\mathbf { z } _ { t }$ , and use the same base policy trained in phase 1 (eqn. 5). The latent $\\hat { \\gamma }$ , which encodes terrain geometry, is estimated from history of depth and proprioception using a GRU. Since the camera looks in front of the robot, proprioception combined with depth enables the GRU to implicitly track and estimate the terrain under the robot. Similar to [3], history of proprioception is used to estimate extrinsics $\\hat { \\mathbf { z } }$ . ",
435
+ "bbox": [
436
+ 173,
437
+ 553,
438
+ 825,
439
+ 622
440
+ ],
441
+ "page_idx": 4
442
+ },
443
+ {
444
+ "type": "equation",
445
+ "img_path": "images/e7dc633f387b6af8212fe86502c8a8cc90e8bad7fd3f6bf74e4c9fe707a33523.jpg",
446
+ "text": "$$\n\\begin{array} { r l } & { \\tilde { \\mathbf { d } } _ { t } = \\mathrm { C o n v N e t } \\left( \\mathbf { d } _ { t } \\right) } \\\\ & { \\boldsymbol { \\hat { \\gamma } } _ { t } = \\mathrm { G R U } _ { t } \\left( \\mathbf { x } _ { t } , \\mathbf { u } _ { t } ^ { \\mathrm { c m d } } , \\boldsymbol { \\tilde { \\mathbf { d } } } _ { t } \\right) } \\\\ & { \\boldsymbol { \\hat { \\mathbf { z } } } _ { t } = \\mathrm { G R U } _ { t } \\left( \\mathbf { x } _ { t } , \\mathbf { u } _ { t } ^ { \\mathrm { c m d } } \\right) } \\\\ & { \\mathbf { a } _ { t } = \\mathrm { M L P } \\left( \\mathbf { x } _ { t } , \\mathbf { u } _ { t } ^ { \\mathrm { c m d } } , \\boldsymbol { \\hat { \\gamma } } _ { t } , \\boldsymbol { \\hat { \\mathbf { z } } } _ { t } \\right) } \\end{array}\n$$",
447
+ "text_format": "latex",
448
+ "bbox": [
449
+ 401,
450
+ 627,
451
+ 593,
452
+ 717
453
+ ],
454
+ "page_idx": 4
455
+ },
456
+ {
457
+ "type": "text",
458
+ "text": "As before, this is trained using DAgger with BPTT. The vision GRU 9 and convnet 8 are jointly trained to minimize $\\| \\hat { \\gamma } _ { t } - \\gamma _ { t } \\| ^ { \\frac { } { 2 } }$ while the proprioception GRU 10 minimizes $\\| \\hat { \\mathbf { z } } _ { t } - \\mathbf { z } _ { t } \\| ^ { 2 }$ . ",
459
+ "bbox": [
460
+ 174,
461
+ 720,
462
+ 825,
463
+ 750
464
+ ],
465
+ "page_idx": 4
466
+ },
467
+ {
468
+ "type": "text",
469
+ "text": "Deployment The student can be deployed as-is on the hardware using only the available onboard compute. It is able to handle camera failures and the asynchronous nature of depth due to the randomizations we apply during phase 1. It is robust to pushes, slippery surfaces and large rocky surfaces and can climb stairs, curbs, and cross gaps and stepping stones. ",
470
+ "bbox": [
471
+ 174,
472
+ 762,
473
+ 825,
474
+ 819
475
+ ],
476
+ "page_idx": 4
477
+ },
478
+ {
479
+ "type": "text",
480
+ "text": "3 Experimental Setup ",
481
+ "text_level": 1,
482
+ "bbox": [
483
+ 176,
484
+ 837,
485
+ 372,
486
+ 854
487
+ ],
488
+ "page_idx": 4
489
+ },
490
+ {
491
+ "type": "text",
492
+ "text": "We use the Unitree A1 robot pictured in Fig. 2. The robot has 12 actuated joints. The robot has a frontfacing Intel RealSense depth camera in its head. The onboard compute consists of the UPboard and a Jetson NX. The policy operates at $5 0 \\mathrm { H z }$ and sends joint position commands which are converted to ",
493
+ "bbox": [
494
+ 174,
495
+ 868,
496
+ 825,
497
+ 911
498
+ ],
499
+ "page_idx": 4
500
+ },
501
+ {
502
+ "type": "table",
503
+ "img_path": "images/207cff2cb0d3a6b3d6ee91807ba1cada80ad942c0f9fb4a937de7c4f4f4c82ec.jpg",
504
+ "table_caption": [],
505
+ "table_footnote": [],
506
+ "table_body": "<table><tr><td rowspan=\"2\">Terrain</td><td colspan=\"4\">Average x-Displacement (↑)</td><td colspan=\"4\">Mean Time to Fall (s)</td></tr><tr><td>RMA</td><td>MLith</td><td>Noisy</td><td>Blind</td><td>RMA</td><td>MLith</td><td>Noisy</td><td>Blind</td></tr><tr><td>Slopes</td><td>43.98</td><td>44.09</td><td>36.14</td><td>34.72</td><td>88.99</td><td>85.68</td><td>70.25</td><td>67.07</td></tr><tr><td>Stepping Stones</td><td>18.83</td><td>20.72</td><td>1.09</td><td>1.02</td><td>34.3</td><td>41.32</td><td>2.51</td><td>2.49</td></tr><tr><td>Stairs</td><td>31.24</td><td>42.4</td><td>6.74</td><td>16.64</td><td>69.99</td><td>90.48</td><td>15.77</td><td>39.17</td></tr><tr><td>Discrete Obstacles</td><td>40.13</td><td>28.64</td><td>29.08</td><td>32.41</td><td>85.17</td><td>57.53</td><td>59.3</td><td>66.33</td></tr><tr><td>Total</td><td>134.18</td><td>135.85</td><td>73.05</td><td>84.79</td><td>278.45</td><td>275.01</td><td>147.83</td><td>175.06</td></tr></table>",
507
+ "bbox": [
508
+ 176,
509
+ 88,
510
+ 821,
511
+ 214
512
+ ],
513
+ "page_idx": 5
514
+ },
515
+ {
516
+ "type": "text",
517
+ "text": "Table 1: We measure the average displacement along the forward axis and mean time to fall for all methods on different terrains in simulation. For each method, we train a single policy for all terrains and use that for evaluation. We see that the monolithic (MLith) and RMA architectures of our method outperform the noisy and blind baselines by $6 0 { - } 9 0 \\%$ in terms of total mean time to fall and average displacement. Vision is not strictly necessary for traversing slopes and the baselines make significant progress on this terrain, however, MLith and RMA travel upto $2 5 \\%$ farther. The difference is more stark on stepping stones where blind and noisy baselines barely make any progress due to not being able to locate positions of the stones, while MLith and RMA travel for around $2 0 \\mathrm { m }$ . Noisy and blind make some progress on stairs and discrete obstacles, but our methods travel upto 6.3 times farther. ",
518
+ "bbox": [
519
+ 173,
520
+ 224,
521
+ 825,
522
+ 338
523
+ ],
524
+ "page_idx": 5
525
+ },
526
+ {
527
+ "type": "text",
528
+ "text": "torques by a low-level PD controller running at $4 0 0 \\mathrm { H z }$ . Depth map is obtained from a Intel RealSense camera inside the head of the robot. The camera captures images every $1 0 0 \\mathrm { { m s } \\pm 2 0 \\mathrm { { m s } } }$ at a resolution of $4 8 0 \\times 8 4 8$ . We preprocess the image by cropping 200 white pixels from the left, applying nearest neighbor hole-filling and downsampling to $5 8 \\times 8 7$ . This is passed through a backbone to obtain the compressed $\\tilde { \\mathbf { d } } _ { t }$ 8, 6 which is sent over a UDP socket to the base policy. This has a latency of $1 0 \\pm 1 0 \\mathrm { m s }$ which we account for during phase 2. ",
529
+ "bbox": [
530
+ 174,
531
+ 366,
532
+ 825,
533
+ 452
534
+ ],
535
+ "page_idx": 5
536
+ },
537
+ {
538
+ "type": "text",
539
+ "text": "We use the IsaacGym (IG) simulator with the legged gym library [18] to train our walking policies. We construct a large terrain map with 100 sub-terrains arranged in a $2 0 \\times 1 0$ grid. Each row has the same type of terrain arranged in increasing difficulty while different rows have different terrain. ",
540
+ "bbox": [
541
+ 176,
542
+ 458,
543
+ 825,
544
+ 500
545
+ ],
546
+ "page_idx": 5
547
+ },
548
+ {
549
+ "type": "text",
550
+ "text": "Baselines We compare against two baselines, each of which uses the same number of learning samples for both RL phase and supervised learning phase. ",
551
+ "bbox": [
552
+ 174,
553
+ 505,
554
+ 823,
555
+ 534
556
+ ],
557
+ "page_idx": 5
558
+ },
559
+ {
560
+ "type": "text",
561
+ "text": "• Blind policy trained with the scandots observations $\\mathbf { m } _ { t }$ masked with zeros. This baseline must rely on proprioception to traverse terrain and helps quantify the benefit of vision for walking. ",
562
+ "bbox": [
563
+ 179,
564
+ 540,
565
+ 823,
566
+ 569
567
+ ],
568
+ "page_idx": 5
569
+ },
570
+ {
571
+ "type": "text",
572
+ "text": "• Noisy Methods which rely on elevation maps need to fuse multiple depth images captured over time to obtain a complete picture of terrain under and around the robot. This requires camera pose relative to the first depth input, which is typically estimated using vision or inertial odometry [11, 13, 12]. However, these pose estimates are typically noisy resulting in noisy elevation maps [8]. To handle this, downstream controllers trained on this typically add a large noise in the elevation maps during training. Similar to [8], we train a teacher with ground truth, noiseless elevation maps in phase 1 and distill it to a student with large noise, with noise model from [8], added to the elevation map. We simulate a latency of $4 0 \\mathrm { m s }$ in both the phases of training to match the hardware. This baseline helps in understanding the effect on performance when relying on pose estimates which introduce additional noise in the pipeline. ",
573
+ "bbox": [
574
+ 179,
575
+ 569,
576
+ 825,
577
+ 707
578
+ ],
579
+ "page_idx": 5
580
+ },
581
+ {
582
+ "type": "text",
583
+ "text": "4 Results and Analysis ",
584
+ "text_level": 1,
585
+ "bbox": [
586
+ 176,
587
+ 727,
588
+ 379,
589
+ 743
590
+ ],
591
+ "page_idx": 5
592
+ },
593
+ {
594
+ "type": "text",
595
+ "text": "Simulation Results We report mean time to fall and mean distance travelled before crashing for different terrain and baselines in Table 1. For each method, we train a single policy for all terrains and use that for evaluation. Although the blind policy makes non trivial progress on stairs, discrete obstacles and slopes, it is significantly less efficient at traversing these terrains. On slopes our methods travel upto $27 \\%$ farther implying that the blind baseline crashes early. Similarly, on stairs and discrete obstacles the distance travelled by our methods is much greater (upto $90 \\%$ ). On slopes and stepping stones the noisy and blind baselines get similar average distances and mean time to fall and both are worse than our policy. This trend is even more significant on the stepping stones terrain where all baselines barely make any progress while our methods travel upto $2 0 \\mathrm { m }$ . The blind policy has no way of estimating the position of the stone and crashes as soon as it steps into the gap. For the noisy policy, the large amount of added noise makes it impossible for the student to reliably ascertain the location of the stones since it cannot rely on proprioception any more. We note that the blind baseline is better than the noisy one on stairs. This is because the blind baseline has learnt to use proprioception to figure out location of stairs. On the other hand, the noisy policy cannot learn to use proprioception since it is trained via supervised learning. However, the blind baseline bumps into stairs often is not very practical to run on the real robot. The noisy baseline works well in [8] possibly because of predefined foot motions which make the phase 2 learning easier. However, as noted in sec. 1, predefined motions will not work for our small robot. ",
596
+ "bbox": [
597
+ 173,
598
+ 758,
599
+ 825,
600
+ 911
601
+ ],
602
+ "page_idx": 5
603
+ },
604
+ {
605
+ "type": "image",
606
+ "img_path": "images/4f5f6d38469f1be85d8a7f1393cad9d731d8e11f13ec620c942aa957eb9d3273.jpg",
607
+ "image_caption": [
608
+ "Figure 4: We show success rates and time-to-failure (TTF) for our method and the blind baseline on curbs, stairs, stepping stones and gaps. We use a separate policy for stairs which is distilled to front camera, and use a separate policy trained on stepping stones distilled to the top camera which we use for gaps and stepping stones. We observe that our method solves all the tasks perfectly except for the stepping stone task in which the robot achieves $94 \\%$ success. The blind baseline fails completely on gaps and stepping stones. For upstairs, it makes some progress, but fails to complete the entire staircase even once, which is expected given the small size of the robot. The blind policy completes the downstairs task $100 \\%$ success, although it learns a very high impact falling gait to solve the task. In our experiments, the robot dislocates its real right leg during the blind downstairs trials. "
609
+ ],
610
+ "image_footnote": [],
611
+ "bbox": [
612
+ 176,
613
+ 88,
614
+ 820,
615
+ 260
616
+ ],
617
+ "page_idx": 6
618
+ },
619
+ {
620
+ "type": "text",
621
+ "text": "",
622
+ "bbox": [
623
+ 174,
624
+ 411,
625
+ 825,
626
+ 507
627
+ ],
628
+ "page_idx": 6
629
+ },
630
+ {
631
+ "type": "text",
632
+ "text": "Real World Comparisons We compare the performance of our methods to the blind baseline in the real world. In particular we have 4 testing setups as shows in fig. 4: Upstairs, Downstairs, Gaps and Stepping stones. While we train a single phase 1 policy for all terrain, for running baselines, we obtain different phase 2 policies for stairs vs. stepping stones and gaps. Different phase 2 policies are obtained by changing the location of the camera. We use the in-built camera inside the robot for stairs and a mounted external camera for stepping stones and gaps. The in-built camera is less prone to damage but the stepping stones are gaps are not clearly visible since it is horizontal. This is done for convenience, but we also have a policy that traverses all terrain using the same mounted camera. ",
633
+ "bbox": [
634
+ 174,
635
+ 534,
636
+ 825,
637
+ 645
638
+ ],
639
+ "page_idx": 6
640
+ },
641
+ {
642
+ "type": "text",
643
+ "text": "We see that the blind baseline is incapable of walking upstairs beyond a few steps and fails to complete the staircase even once. Although existing methods have shown stairs for blind robots, we note that our robot is relatively smaller making it a more challenging task for a blind robot. On downstairs, we observe that the blind baseline achieves $100 \\%$ success, although it learns to fall on every step and stabilize leading to a very high impact gait which led to the detaching of the rear right hip of the robot during our experiments. We additionally show results in stepping stones and gaps, where the blind robot fails completely establishing the hardness of these setups and the necessity of vision to solve them. We show a $100 \\%$ success on all tasks except for stepping stone on which we achieve $94 \\%$ success, which is very high given the challenging setup. ",
644
+ "bbox": [
645
+ 174,
646
+ 650,
647
+ 825,
648
+ 775
649
+ ],
650
+ "page_idx": 6
651
+ },
652
+ {
653
+ "type": "text",
654
+ "text": "Urban Environments We experiment on stairs, ramps and curbs (fig. 1). The robot was successfully able to go upstairs as well as downstairs for stairs of height upto $2 4 \\mathrm { c m }$ in height and $2 8 \\mathrm { c m }$ as the lowest width. Since the robot has to remember terrain under its body from visual history, it sometimes misses a step, but shows impressive recovery behaviour and continues climbing or descending. The robot is able to climb curbs and obstacles as high as 26cm which is almost as high as the robot 2. This requires an emergent hip abduction movement because the small size of the robot doesn’t leave any space between the body and stair for the leg to step up. This behavior emerges because of our tabula rasa approach to learning gaits without reliance on priors or datasets of natural motion. ",
655
+ "bbox": [
656
+ 174,
657
+ 800,
658
+ 825,
659
+ 911
660
+ ],
661
+ "page_idx": 6
662
+ },
663
+ {
664
+ "type": "text",
665
+ "text": "Gaps and Stepping Stones We construct an obstacle course consisting of gaps and stepping stones out of tables and stools (fig. 4). For this set of experiments we use a policy trained on stepping stones on gaps, and distilled onto the top camera instead of the front camera. The robot achieves a $100 \\%$ success rate on gaps of upto 26cm from egocentric depth and $94 \\%$ on difficult stepping stones. The stepping stones experiment shows that our visual policy can learn safe foothold placement behavior even without an explicit elevation map or foothold optimization objectives. The blind baseline achieves zero success rate on both tasks and falls as soon as any gap is encountered. ",
666
+ "bbox": [
667
+ 174,
668
+ 92,
669
+ 825,
670
+ 188
671
+ ],
672
+ "page_idx": 7
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "Natural Environments We also deploy our policy on outdoor hikes and rocky terrains next to river beds (fig. 1). We see that the robot is able to successfully traverse rugged stairs covered with dirt, small pebbles and some large rocks. It also avoids stumbling over large tree roots on the hiking trail. On the beach, we see that the robot is able to successfully navigate the terrain despite several slips and unstable footholds given the nature of the terrain. We see that the robot sometimes gets stuck in the crevices and in some cases shows impressive recovery behavior as well. ",
677
+ "bbox": [
678
+ 174,
679
+ 202,
680
+ 825,
681
+ 285
682
+ ],
683
+ "page_idx": 7
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "5 Related Work ",
688
+ "text_level": 1,
689
+ "bbox": [
690
+ 174,
691
+ 303,
692
+ 321,
693
+ 320
694
+ ],
695
+ "page_idx": 7
696
+ },
697
+ {
698
+ "type": "text",
699
+ "text": "Legged locomotion Legged locomotion an important problem which has been studied for decades. Several classical works use model based techniques, or define heuristic reactive controllers to achieve the task of walking [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32].This method has led to several promising results in the real world, although they still lack the generality needed to deploy them in the real world. This has motivated work in using RL for learning to walk in simulation [15, 33, 34, 35], and then successfully deploy them in a diverse set of real world scenarios [36, 37, 38, 39, 40, 41, 36, 42]. Alternatively, a policy learned in simulation can be adapted at test-time to work well in real environments [43, 44, 45, 46, 47, 48, 49, 50, 3, 51, 52, 53]. However, most of these methods are blind, and only use proprioceptive signal to walk. ",
700
+ "bbox": [
701
+ 174,
702
+ 325,
703
+ 825,
704
+ 450
705
+ ],
706
+ "page_idx": 7
707
+ },
708
+ {
709
+ "type": "text",
710
+ "text": "Locomotion from Elevation Maps To achieve visual control of walking, classical methods decouple the perception and control aspects, assuming a perfect output from perception, such as an elevation map, and then using it for planning and control [54, 55, 56, 57, 58]. The control part can be further decoupled into searching for feasible footholds on the elevation map and then execute it with a low-level policy Chestnutt [59]. The foothold feasibility scores can either be estimated heuristically [60, 61, 10, 62, 63, 9, 64] or learned [65, 66, 67, 68, 69]. Other methods forgo explicit foothold optimization and learn traversibility maps instead [70, 71, 72, 73]. Recent methods skip foothold planning and directly train a deep RL policy that takes the elevation map as input and outputs either low-level motor primitives [8, 74] or raw joint angles [18, 75, 76, 77]. Elevation maps can be noisy or incorrect and dealing with imperfect maps is a major challenge to building robust locomotion systems. Solutions to this include incorporating uncertainty in the elevation map [54, 78, 11] and simulating errors at training time to make the walking policy robust to them [8]. ",
711
+ "bbox": [
712
+ 173,
713
+ 455,
714
+ 825,
715
+ 621
716
+ ],
717
+ "page_idx": 7
718
+ },
719
+ {
720
+ "type": "text",
721
+ "text": "Locomotion from Egocentric Depth Closest to ours is the line of work that doesn’t construct explicit elevation maps and predicts actions directly from depth. [53] learn a policy for obstacle avoidance from depth on flat terrain,[79] train a hierarchical policy which uses depth to traverse curved cliffs and mazes in simulation,[80] use lidar scans to show zero-shot generalization to difficult terrains. Yu et al. [81] train a policy to step over gaps by predicting high-level actions using depth from the head and below the torso. Relatedly, Margolis et al. [82] train a high-level policy to jump over gaps from egocentric depth using a whole body impulse controller. In contrast, we directly predict target joint angles from egocentric depth without constructing metric elevation maps. ",
722
+ "bbox": [
723
+ 174,
724
+ 626,
725
+ 825,
726
+ 737
727
+ ],
728
+ "page_idx": 7
729
+ },
730
+ {
731
+ "type": "text",
732
+ "text": "6 Discussion and Limitations ",
733
+ "text_level": 1,
734
+ "bbox": [
735
+ 176,
736
+ 755,
737
+ 431,
738
+ 772
739
+ ],
740
+ "page_idx": 7
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "In this work, we show an end-to-end approach to walking with egocentric depth that can traverse a large variety of terrains including stairs, gaps and stepping stones. However, there can be certain instances where the robot fails because of a visual or terrain mismatch between the simulation and the real world. The only solution to this problem under the current paradigm is to engineer the situation back into simulation and retrain. This poses a fundamental limitation to this approach and in future, we would like to leverage the data collected in the real world to continue improving both the visual and the motor performance. Currently, our robot is only able to move through the environment but not interact with it meaningfully. A future direction could be to combine vision-based policies with an articulated arm [83]. ",
745
+ "bbox": [
746
+ 174,
747
+ 786,
748
+ 825,
749
+ 911
750
+ ],
751
+ "page_idx": 7
752
+ },
753
+ {
754
+ "type": "text",
755
+ "text": "Acknowledgments ",
756
+ "text_level": 1,
757
+ "bbox": [
758
+ 174,
759
+ 92,
760
+ 303,
761
+ 106
762
+ ],
763
+ "page_idx": 8
764
+ },
765
+ {
766
+ "type": "text",
767
+ "text": "We would like to thank Kenny Shaw and Xuxin Cheng for help with hardware. Shivam Duggal, Kenny Shaw, Xuxin Cheng, Shikhar Bahl, Zipeng Fu, Ellis Brown helped with recording videos. We also thank Alex Li for proofreading. The project was supported in part by the DARPA Machine Commonsense Program and ONR N00014-22-1-2096. ",
768
+ "bbox": [
769
+ 174,
770
+ 114,
771
+ 826,
772
+ 170
773
+ ],
774
+ "page_idx": 8
775
+ },
776
+ {
777
+ "type": "text",
778
+ "text": "References ",
779
+ "text_level": 1,
780
+ "bbox": [
781
+ 174,
782
+ 189,
783
+ 266,
784
+ 205
785
+ ],
786
+ "page_idx": 8
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "[1] J. M. Loomis, J. A. Da Silva, N. Fujita, and S. S. Fukusima. Visual space perception and visually directed action. Journal of experimental psychology: Human Perception and Performance, 18 (4):906, 1992. \n[2] J. Lee, J. Hwangbo, L. Wellhausen, V. Koltun, and M. Hutter. Learning quadrupedal locomotion over challenging terrain. Science robotics, 2020. \n[3] A. Kumar, Z. Fu, D. Pathak, and J. Malik. RMA: Rapid Motor Adaptation for Legged Robots. In RSS, 2021. \n[4] J. S. Matthis and B. R. Fajen. Visual control of foot placement when walking over complex terrain. Journal of experimental psychology: human perception and performance, 40(1):106, 2014. \n[5] A. E. Patla. Understanding the roles of vision in the control of human locomotion. Gait & posture, 5(1):54–69, 1997. \n[6] A. A. Mohagheghi, R. Moraes, and A. E. Patla. The effects of distant and on-line visual information on the control of approach phase and step over an obstacle during locomotion. Experimental brain research, 155(4):459–468, 2004. \n[7] K. E. Adolph, W. G. Cole, M. Komati, J. S. Garciaguirre, D. Badaly, J. M. Lingeman, G. L. Chan, and R. B. Sotsky. How do you learn to walk? thousands of steps and dozens of falls per day. Psychological science, 2012. \n[8] T. Miki, J. Lee, J. Hwangbo, L. Wellhausen, V. Koltun, and M. Hutter. Learning robust perceptive locomotion for quadrupedal robots in the wild. Science Robotics, 7(62):eabk2822, 2022. \n[9] D. Kim, D. Carballo, J. Di Carlo, B. Katz, G. Bledt, B. Lim, and S. Kim. Vision aided dynamic exploration of unstructured terrain with a small-scale quadruped robot. In ICRA, 2020. \n[10] F. Jenelten, T. Miki, A. E. Vijayan, M. Bjelonic, and M. Hutter. Perceptive locomotion in rough terrain–online foothold optimization. RA-L, 2020. \n[11] P. Fankhauser, M. Bloesch, C. Gehring, M. Hutter, and R. Siegwart. Robot-centric elevation mapping with uncertainty estimates. In Mobile Service Robotics, pages 433–440. World Scientific, 2014. \n[12] T. Miki, L. Wellhausen, R. Grandia, F. Jenelten, T. Homberger, and M. Hutter. Elevation mapping for locomotion and navigation using gpu. arXiv preprint arXiv:2204.12876, 2022. \n[13] Y. Pan, X. Xu, X. Ding, S. Huang, Y. Wang, and R. Xiong. Gem: Online globally consistent dense elevation mapping for unstructured terrain. IEEE Transactions on Instrumentation and Measurement, 70:1–13, 2021. doi:10.1109/TIM.2020.3044338. \n[14] H. Qi, A. Kumar, R. Calandra, Y. Ma, and J. Malik. In-hand object rotation via rapid motor adaptation. arXiv preprint arXiv:2210.04887, 2022. \n[15] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv:1707.06347, 2017. \n[16] P. J. Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990. \n[17] Z. Fu, A. Kumar, A. Agarwal, H. Qi, J. Malik, and D. Pathak. Coupling vision and proprioception for navigation of legged robots. arXiv preprint arXiv:2112.02094, 2021. \n[18] N. Rudin, D. Hoeller, P. Reist, and M. Hutter. Learning to walk in minutes using massively parallel deep reinforcement learning. In Conference on Robot Learning, pages 91–100. PMLR, 2022. \n[19] S. Ross, G. Gordon, and D. Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, 2011. \n[20] H. Miura and I. Shimoyama. Dynamic walk of a biped. IJRR, 1984. \n[21] M. H. Raibert. Hopping in legged systems—modeling and simulation for the two-dimensional one-legged case. IEEE Transactions on Systems, Man, and Cybernetics, 1984. \n[22] H. Geyer, A. Seyfarth, and R. Blickhan. Positive force feedback in bouncing gaits? Proceedings of the Royal Society of London. Series B: Biological Sciences, 2003. \n[23] K. Yin, K. Loken, and M. Van de Panne. Simbicon: Simple biped locomotion control. ACM Transactions on Graphics, 2007. \n[24] K. Sreenath, H.-W. Park, I. Poulakakis, and J. W. Grizzle. A compliant hybrid zero dynamics controller for stable, efficient and fast bipedal walking on mabel. IJRR, 2011. \n[25] A. M. Johnson, T. Libby, E. Chang-Siu, M. Tomizuka, R. J. Full, and D. E. Koditschek. Tail assisted dynamic self righting. In Adaptive Mobile Robotics. World Scientific, 2012. \n[26] M. Khoramshahi, H. J. Bidgoly, S. Shafiee, A. Asaei, A. J. Ijspeert, and M. N. Ahmadabadi. Piecewise linear spine for speed–energy efficiency trade-off in quadruped robots. Robotics and Autonomous Systems, 2013. \n[27] A. D. Ames, K. Galloway, K. Sreenath, and J. W. Grizzle. Rapidly exponentially stabilizing control lyapunov functions and hybrid zero dynamics. IEEE Transactions on Automatic Control, 2014. \n[28] D. J. Hyun, J. Lee, S. Park, and S. Kim. Implementation of trot-to-gallop transition and subsequent gallop on the mit cheetah i. IJRR, 2016. \n[29] M. Barragan, N. Flowers, and A. M. Johnson. MiniRHex: A small, open-source, fully programmable walking hexapod. In RSS Workshop, 2018. \n[30] G. Bledt, M. J. Powell, B. Katz, J. Di Carlo, P. M. Wensing, and S. Kim. Mit cheetah 3: Design and control of a robust, dynamic quadruped robot. In IROS, 2018. \n[31] M. Hutter, C. Gehring, D. Jud, A. Lauber, C. D. Bellicoso, V. Tsounis, J. Hwangbo, K. Bodie, P. Fankhauser, M. Bloesch, et al. Anymal-a highly mobile and dynamic quadrupedal robot. In IROS, 2016. \n[32] C. S. Imai, M. Zhang, Y. Zhang, M. Kierebinski, R. Yang, Y. Qin, and X. Wang. Vision-guided quadrupedal locomotion in the wild with multi-modal delay randomization. arXiv:2109.14549, 2021. \n[33] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. In ICLR, 2016. \n[34] V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, 2016. \n[35] S. Fujimoto, H. Hoof, and D. Meger. Addressing function approximation error in actor-critic methods. In ICML, 2018. \n[36] J. Tan, T. Zhang, E. Coumans, A. Iscen, Y. Bai, D. Hafner, S. Bohez, and V. Vanhoucke. Sim-to-real: Learning agile locomotion for quadruped robots. In RSS, 2018. \n[37] J. Tobin, R. Fong, A. Ray, J. Schneider, W. Zaremba, and P. Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In IROS, 2017. \n[38] X. B. Peng, M. Andrychowicz, W. Zaremba, and P. Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In ICRA, 2018. \n[39] Z. Xie, X. Da, M. van de Panne, B. Babich, and A. Garg. Dynamics randomization revisited: A case study for quadrupedal locomotion. In ICRA, 2021. \n[40] O. Nachum, M. Ahn, H. Ponte, S. S. Gu, and V. Kumar. Multi-agent manipulation via locomotion using hierarchical sim2real. In CoRL, 2020. \n[41] J. Hwangbo, J. Lee, A. Dosovitskiy, D. Bellicoso, V. Tsounis, V. Koltun, and M. Hutter. Learning agile and dynamic motor skills for legged robots. Science Robotics, 2019. \n[42] J. Hanna and P. Stone. Grounded action transformation for robot learning in simulation. In AAAI, 2017. \n[43] W. Yu, J. Tan, C. K. Liu, and G. Turk. Preparing for the unknown: Learning a universal policy with online system identification. In RSS, 2017. \n[44] W. Yu, C. K. Liu, and G. Turk. Policy transfer with strategy optimization. In ICLR, 2018. \n[45] X. B. Peng, E. Coumans, T. Zhang, T.-W. E. Lee, J. Tan, and S. Levine. Learning agile robotic locomotion skills by imitating animals. In RSS, 2020. \n[46] W. Zhou, L. Pinto, and A. Gupta. Environment probing interaction policies. In ICLR, 2019. \n[47] W. Yu, V. C. V. Kumar, G. Turk, and C. K. Liu. Sim-to-real transfer for biped locomotion. In IROS, 2019. \n[48] W. Yu, J. Tan, Y. Bai, E. Coumans, and S. Ha. Learning fast adaptation with meta strategy optimization. RA-L, 2020. \n[49] X. Song, Y. Yang, K. Choromanski, K. Caluwaerts, W. Gao, C. Finn, and J. Tan. Rapidly adaptable legged robots via evolutionary meta-learning. In IROS, 2020. \n[50] I. Clavera, A. Nagabandi, S. Liu, R. S. Fearing, P. Abbeel, S. Levine, and C. Finn. Learning to adapt in dynamic, real-world environments through meta-reinforcement learning. In ICLR, 2019. \n[51] Z. Fu, A. Kumar, J. Malik, and D. Pathak. Minimizing energy consumption leads to the emergence of gaits in legged robots. In CoRL, 2021. \n[52] L. Smith, J. C. Kew, X. B. Peng, S. Ha, J. Tan, and S. Levine. Legged robots that keep on learning: Fine-tuning locomotion policies in the real world. In ICRA, 2022. \n[53] R. Yang, M. Zhang, N. Hansen, H. Xu, and X. Wang. Learning vision-guided quadrupedal locomotion end-to-end with cross-modal transformers. In ICLR, 2022. \n[54] P. Fankhauser, M. Bloesch, and M. Hutter. Probabilistic terrain mapping for mobile robots with uncertain localization. IEEE Robotics and Automation Letters, 3(4):3019–3026, 2018. \n[55] Y. Pan, X. Xu, Y. Wang, X. Ding, and R. Xiong. Gpu accelerated real-time traversability mapping. In 2019 IEEE International Conference on Robotics and Biomimetics (ROBIO), pages 734–740, 2019. doi:10.1109/ROBIO49542.2019.8961816. \n[56] I.-S. Kweon, M. Hebert, E. Krotkov, and T. Kanade. Terrain mapping for a roving planetary explorer. In IEEE International Conference on Robotics and Automation, pages 997–1002. IEEE, 1989. \n[57] I.-S. Kweon and T. Kanade. High-resolution terrain map from multiple sensor data. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(2):278–292, 1992. \n[58] A. Kleiner and C. Dornhege. Real-time localization and elevation mapping within urban search and rescue scenarios. Journal of Field Robotics, 24(8-9):723–745, 2007. \n[59] J. Chestnutt. Navigation planning for legged robots. Carnegie Mellon University, 2007. \n[60] M. Wermelinger, P. Fankhauser, R. Diethelm, P. Krusi, R. Siegwart, and M. Hutter. Navigation ¨ planning for legged robots in challenging terrain. In IROS, 2016. \n[61] A. Chilian and H. Hirschmuller. Stereo camera based navigation of mobile robots on rough ¨ terrain. In IROS, 2009. \n[62] C. Mastalli, I. Havoutis, A. W. Winkler, D. G. Caldwell, and C. Semini. On-line and on-board planning and perception for quadrupedal locomotion. In 2015 IEEE International Conference on Technologies for Practical Robot Applications, 2015. \n[63] P. Fankhauser, M. Bjelonic, C. D. Bellicoso, T. Miki, and M. Hutter. Robust rough-terrain locomotion with a quadrupedal robot. In ICRA, 2018. \n[64] A. Agrawal, S. Chen, A. Rai, and K. Sreenath. Vision-aided dynamic quadrupedal locomotion on discrete terrain using motion libraries. arXiv preprint arXiv:2110.00891, 2021. \n[65] J. Z. Kolter, M. P. Rodgers, and A. Y. Ng. A control architecture for quadruped locomotion over rough terrain. In ICRA, 2008. \n[66] M. Kalakrishnan, J. Buchli, P. Pastor, and S. Schaal. Learning locomotion over rough terrain using terrain templates. In IROS, 2009. \n[67] L. Wellhausen and M. Hutter. Rough terrain navigation for legged robots using reachability planning and template learning. In IROS, 2021. \n[68] C. Mastalli, M. Focchi, I. Havoutis, A. Radulescu, S. Calinon, J. Buchli, D. G. Caldwell, and C. Semini. Trajectory and foothold optimization using low-dimensional models for rough terrain locomotion. In ICRA, 2017. \n[69] O. A. V. Magana, V. Barasuol, M. Camurri, L. Franceschi, M. Focchi, M. Pontil, D. G. Caldwell, and C. Semini. Fast and continuous foothold adaptation for dynamic locomotion through cnns. RA-L, 2019. \n[70] B. Yang, L. Wellhausen, T. Miki, M. Liu, and M. Hutter. Real-time optimal navigation planning using learned motion costs. In ICRA, 2021. \n[71] R. O. Chavez-Garcia, J. Guzzi, L. M. Gambardella, and A. Giusti. Learning ground traversability from simulations. RA-L, 2018. \n[72] J. Guzzi, R. O. Chavez-Garcia, M. Nava, L. M. Gambardella, and A. Giusti. Path planning with local motion estimations. RA-L, 2020. \n[73] S. Gangapurwala, M. Geisert, R. Orsolino, M. Fallon, and I. Havoutis. Real-time trajectory adaptation for quadrupedal locomotion using deep reinforcement learning. In International Conference on Robotics and Automation (ICRA), 2021. \n[74] V. Tsounis, M. Alge, J. Lee, F. Farshidian, and M. Hutter. Deepgait: Planning and control of quadrupedal gaits using deep reinforcement learning. IEEE Robotics and Automation Letters, 5 (2):3699–3706, 2020. \n[75] X. B. Peng, G. Berseth, and M. Van de Panne. Terrain-adaptive locomotion skills using deep reinforcement learning. ACM Transactions on Graphics (TOG), 35(4):1–12, 2016. \n[76] X. B. Peng, G. Berseth, K. Yin, and M. Van De Panne. Deeploco: Dynamic locomotion skills using hierarchical deep reinforcement learning. ACM Transactions on Graphics (TOG), 36(4): 1–13, 2017. \n[77] Z. Xie, H. Y. Ling, N. H. Kim, and M. van de Panne. Allsteps: Curriculum-driven learning of stepping stone skills. In Computer Graphics Forum. Wiley Online Library, 2020. \n[78] D. Belter, P. Łabcki, and P. Skrzypczynski. Estimating terrain elevation maps from sparse ´ and uncertain multi-sensor data. In 2012 IEEE International Conference on Robotics and Biomimetics (ROBIO), pages 715–722, 2012. doi:10.1109/ROBIO.2012.6491052. \n[79] D. Jain, A. Iscen, and K. Caluwaerts. From pixels to legs: Hierarchical learning of quadruped locomotion. arXiv preprint arXiv:2011.11722, 2020. \n[80] A. Escontrela, G. Yu, P. Xu, A. Iscen, and J. Tan. Zero-shot terrain generalization for visual locomotion policies. arXiv preprint arXiv:2011.05513, 2020. \n[81] W. Yu, D. Jain, A. Escontrela, A. Iscen, P. Xu, E. Coumans, S. Ha, J. Tan, and T. Zhang. Visual-locomotion: Learning to walk on complex terrains with vision. In 5th Annual Conference on Robot Learning, 2021. \n[82] G. B. Margolis, T. Chen, K. Paigwar, X. Fu, D. Kim, S. Kim, and P. Agrawal. Learning to jump from pixels. arXiv preprint arXiv:2110.15344, 2021. \n[83] Z. Fu, X. Cheng, and D. Pathak. Learning a unified policy for whole-body control of manipulation and locomotion. In Conference on Robot Learning (CoRL), 2022. \n[84] S. P. Singh and R. C. Yee. An upper bound on the loss from approximate optimal-value functions. Machine Learning, 16(3):227–233, 1994. \n[85] D. P. Bertsekas. Dynamic programming: deterministic and stochastic models. Prentice-Hall, Inc., 1987. ",
791
+ "bbox": [
792
+ 171,
793
+ 204,
794
+ 828,
795
+ 917
796
+ ],
797
+ "page_idx": 8
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "",
802
+ "bbox": [
803
+ 171,
804
+ 64,
805
+ 828,
806
+ 917
807
+ ],
808
+ "page_idx": 9
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "",
813
+ "bbox": [
814
+ 171,
815
+ 70,
816
+ 828,
817
+ 919
818
+ ],
819
+ "page_idx": 10
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "",
824
+ "bbox": [
825
+ 171,
826
+ 60,
827
+ 828,
828
+ 917
829
+ ],
830
+ "page_idx": 11
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "",
835
+ "bbox": [
836
+ 169,
837
+ 89,
838
+ 828,
839
+ 361
840
+ ],
841
+ "page_idx": 12
842
+ }
843
+ ]
parse/dev/Re3NjSwf0WF/Re3NjSwf0WF_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Re3NjSwf0WF/Re3NjSwf0WF_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/p0LJa6_XHM_/p0LJa6_XHM_.md ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sleeper Agent: Scalable Hidden Trigger Backdoors for Neural Networks Trained from Scratch
2
+
3
+ Hossein Souri∗ Johns Hopkins University hsouri1@jhu.edu
4
+
5
+ Liam Fowl∗ University of Maryland
6
+
7
+ Rama Chellappa Johns Hopkins University
8
+
9
+ Micah Goldblum New York University
10
+
11
+ Tom Goldstein University of Maryland
12
+
13
+ # Abstract
14
+
15
+ As the curation of data for machine learning becomes increasingly automated, dataset tampering is a mounting threat. Backdoor attackers tamper with training data to embed a vulnerability in models that are trained on that data. This vulnerability is then activated at inference time by placing a “trigger” into the model’s input. Typical backdoor attacks insert the trigger directly into the training data, although the presence of such an attack may be visible upon inspection. In contrast, the Hidden Trigger Backdoor Attack achieves poisoning without placing a trigger into the training data at all. However, this hidden trigger attack is ineffective at poisoning neural networks trained from scratch. We develop a new hidden trigger attack, Sleeper Agent, which employs gradient matching, data selection, and target model re-training during the crafting process. Sleeper Agent is the first hidden trigger backdoor attack to be effective against neural networks trained from scratch. We demonstrate its effectiveness on ImageNet and in black-box settings. Our implementation code can be found at: https://github.com/hsouri/Sleeper-Agent.
16
+
17
+ # 1 Introduction
18
+
19
+ High-performance deep learning systems have grown in scale at a rapid pace. As a result, practitioners seek larger and larger datasets with which to train their data-hungry models. Due to the surging demand for training data along with improved accessibility via the web, the data curation process is increasingly automated. Dataset manipulation attacks exploit vulnerabilities in the curation pipeline to manipulate training data so that downstream machine learning models contain exploitable behaviors. Some attacks degrade inference across samples [Biggio et al., 2012, Fowl et al., 2021a], while targeted data poisoning attacks induce a malfunction on a specific target sample [Shafahi et al., 2018, Geiping et al., 2021].
20
+
21
+ Backdoor attacks are a style of dataset manipulation that induces a model to execute the attacker’s desired behavior when its input contains a backdoor trigger [Gu et al., 2017, Bagdasaryan et al., 2020, Liu et al., 2017, Li et al., 2022]. To this end, typical backdoor attacks inject the trigger directly into training data so that models trained on this data rely on the trigger to perform inference [Gu et al., 2017, Chen et al., 2017]. Such threat models for classification problems typically incorporate label flips as well. However, images poisoned under this style of attack are often easily identifiable since they belong to the incorrect class and contain a visible trigger. One line of work uses only small or realistic-looking triggers, but these may still be visible and are often placed in conspicuous image regions [Chen et al., 2017, Gu et al., 2017, Li et al., 2020]. Another recent method, Hidden Trigger
22
+
23
+ ![](images/0346666294f9d2dc58e67a8530d608ebfd79ddcf144ecb1344947fde4e1edb4f.jpg)
24
+ Figure 1: (a): High-level schematic of our attack. A small proportion of slightly perturbed data is added to the training set which “backdoors” the model so that it misclassifies patched images at inference. (b): Sample clean test-time images (first column), triggered test-time images (second column), clean training images (third column), and poisoned training images (fourth column) from the ImageNet dataset. The last column is slightly perturbed, but the perturbed and corresponding clean images are hardly distinguishable by the human eye. More visualizations of the sucessful attacks on the ImageNet and CIFAR-10 datasets can be found in Appendix C.
25
+
26
+ Backdoor Attack (HTBD), instead crafts correctly labeled poisons which do not contain the trigger at all, but this feature collision method is not effective on models trained from scratch [Saha et al., 2020, Schwarzschild et al., 2021]. Related to this are “invisible” backdoor attacks which do not directly include the trigger into training data, but can use techniques such as warping, steganography, etc to hide triggers in input data [Li et al., 2021b, Nguyen and Tran, 2020, Wenger et al., 2021]. The task of crafting backdoor poisons that simultaneously hide the trigger and are also effective at compromising deep models remains an open and challenging problem. This is especially the case in the black-box scenario, where the attacker does not know the victim’s architecture and training routine, and in the clean-label scenario where the attacker cannot flip labels.
27
+
28
+ In this work, we develop the first hidden trigger attack that can reliably backdoor deep neural networks trained from scratch. Our threat model is illustrated in Figure 1a. Our attack, Sleeper Agent, contains the following essential features:
29
+
30
+ • Gradient matching: our attack is based on recent advances that replace direct solvers for bi-level optimization problems with a gradient alignment objective [Geiping et al., 2021]. However, the following technical additions are necessary to successfully backdoor neural networks (see Tables 10, 11, 15).
31
+ • Data selection: we specifically poison images that have a high impact on training in order to maximize the attack’s effect.
32
+ • Adaptive retraining: while crafting poisons, we periodically retrain the surrogate models to better reflect how models respond to our poisoned data during training.
33
+ • Black-box: Our method succeeds in crafting poisons on a surrogate network or ensemble, knowing nothing about the victim’s architecture and training hyperparameters.
34
+
35
+ We demonstrate empirically that Sleeper Agent is effective against a variety of architectures and in the black-box scenario where the attacker does not know the victim’s architecture. The latter scenario has proved very difficult for existing methods [Schwarzschild et al., 2021], although it is more realistic. An added benefit of the gradient matching strategy is that it scales to large tasks. We demonstrate this property by backdooring models on ImageNet [Russakovsky et al., 2015]. Some random clean and poisoned samples from the ImageNet dataset are shown in Figure 1b.
36
+
37
+ # 2 Related Work
38
+
39
+ Data poisoning attacks come in many shapes and sizes. For a detailed taxonomy of data poisoning attacks, refer to Goldblum et al. [2022]. Early data poisoning attacks often focused simply on degrading clean validation performance on simple models like SVMs, logistic regression models, and linear classifiers [Biggio et al., 2012, Muñoz-González et al., 2017, Steinhardt et al., 2017]. These methods often relied upon the learning problems being convex in order to exactly anticipate the impact of perturbations to training data. Following these early works, attacks quickly became more specialized in their scope and approach. Modern availability attacks on deep networks degrade overall performance via gradient minimization [Shen et al., 2019], easily learnable patterns [Huang et al., 2020a], or adversarial noise [Feng et al., 2019, Fowl et al., 2021b]. However, these works often perturb the entire training set - an unrealistic assumption for many poisoning settings.
40
+
41
+ Another flavor of poisoning commonly referred to as targeted poisoning, modifies training data to cause a victim model to misclassify a certain target image or set of target images. Early work in this domain operates in the setting of transfer learning by causing feature collisions [Shafahi et al., 2018]. Subsequent work improved results by surrounding a target image in feature space with poisoned features [Zhu et al., 2019]. Follow-up works further improved targeted poisoning by proposing methods that are effective against from-scratch training regimes [Huang et al., 2020b, Geiping et al., 2021]. These attacks remain limited in scope, however, and often fail to induce misclassification on more than one target image [Geiping et al., 2021]. Adjacent to targeted data poisoning are backdoor attacks. Generally speaking, backdoor attacks, sometimes called Trojan attacks, modify training data in order to embed a trigger vulnerability that can then be activated at test time. Crucially, this attack requires the attacker to modify data at inference time. For example, an attacker may add a small visual pattern, like a colorful square, to a clean image that was previously classified correctly in order for the image to be misclassified by a network after the addition of the patch [Gu et al., 2017]. However, these works can require training labels to be flipped, and/or a conspicuous patch to be added to training data.
42
+
43
+ Of particular relevance to this work is a subset of backdoor attacks that are clean label, meaning that modifications to training data must not change the semantic label of that data. This is especially important because an attacker may not control the labeling method of the victim and therefore cannot rely upon techniques like label flipping in order to induce poisoning. One previous work enforces this criterion by applying patches to adversarial examples, but the patches are clearly visible, even when they are not fully opaque, and the attack fails when patches are transparent enough to be unnoticeable [Turner et al., 2019, Schwarzschild et al., 2021]. Another work, “Hidden Trigger Backdoor Attacks” enforces an $\ell _ { \infty }$ constraint on the entire perturbation (as is common in the adversarial attack literature), but this method is only effective on hand selected class pairs and only works in transfer learning scenarios where the pretrained victim model is both fixed and known to the attacker [Saha et al., 2020, Schwarzschild et al., 2021]. Another clean label backdoor attack hides the trigger in training data via steganography [Li et al., 2019]; however, this attack also assumes access to the pretrained model that a victim will use to fine tune on poisoned data. Moreover, the latter attack uses triggers that cover the entire image, and these triggers cannot be chosen by the user. Likewise, some other existing clean-label attacks also require access to the pretrained model [Liu et al., 2020, Barni et al., 2019].
44
+
45
+ In contrast to these existing methods, Sleeper Agent does not require knowledge of the victim model, the perturbations are not visible in poisoned training data, and poisons can be adapted to any patch.
46
+
47
+ # 3 Method
48
+
49
+ # 3.1 Threat Model
50
+
51
+ We follow commonly used threat models used in the backdoor literature [Gu et al., 2017, Saha et al., 2020]. We define two parties, the attacker and the victim. We assume that the attacker perturbs and disseminates data. As in Saha et al. [2020], Geiping et al. [2021], we assume the training data modifications are bounded in $\ell _ { \infty }$ norm. The victim then trains a model on data - a portion of which has been perturbed by the attacker. Once the victim’s model is trained and deployed, we also assume that the attacker can then apply a patch to select images at test time to trigger the backdoor attack. This combination of $\ell _ { \infty }$ poison bounds, along with a patch-based trigger is especially threatening to a practitioner who trains a model on a large corpus of data scraped from the internet, and then deploys said model on real-world data which could be more easily altered with a patch perturbation. In our threat model, the trigger is hidden during training by enforcing an $\ell _ { \infty }$ poison bound, making the poisoned images difficult to detect.
52
+
53
+ However, we diverge from Gu et al. [2017], Saha et al. [2020] in our assumptions about the knowledge of the victim. We assume a far more strict threat model wherein the attacker does not have access to the parameters, architecture, or learning procedure of the victim. This represents a realistic scenario wherein a victim trains a randomly initialized deep network from scratch on scraped data.
54
+
55
+ # 3.2 Problem Setup
56
+
57
+ Formally, we aim to craft perturbations $\delta = \{ \delta _ { i } \} _ { i = 1 } ^ { N }$ to training data $\mathcal { T } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ for a loss function, $\mathcal { L }$ , and a surrogate network, $F$ , with parameters $\theta$ that solve the following bilevel problem:
58
+
59
+ $$
60
+ \begin{array} { r l } & { \underset { \delta \in \mathcal { C } } { \operatorname* { m i n } } \ \mathbb { E } _ { ( x , y ) \sim \mathcal { D } _ { s } } \bigg [ \mathcal { L } \left( F ( x + p ; \theta ( \delta ) ) , y _ { t } \right) \bigg ] } \\ & { \mathrm { s . t . } \ \theta ( \delta ) \in \arg \underset { \theta } { \operatorname* { m i n } } \displaystyle \sum _ { ( x _ { i } , y _ { i } ) \in \mathcal { T } } \mathcal { L } ( F ( x _ { i } + \delta _ { i } ; \theta ) , y _ { i } ) , } \end{array}
61
+ $$
62
+
63
+ where $p$ denotes the trigger (in our case, a small, colorful patch), $y _ { t }$ denotes the intended target label of the attacker, and $\mathcal { C } = \{ \delta : \lvert \lvert \delta \rvert \rvert _ { \infty } \leq \epsilon , \delta _ { i } = 0 \forall i > \bar { M } \}$ denotes a set of constraints on the perturbations. $\mathcal { D } _ { s }$ denotes the distribution of data from the source class. Naive backdoor attacks often solve this bilevel problem by inserting $p$ directly into training data (belonging to class $y _ { t }$ ) so that the network learns to associate the trigger pattern with the desired class label. However, our threat model is more strict, which is reflected in our constraints on $\delta$ . We require that $\delta$ is bounded in $\ell _ { \infty }$ norm and that $\delta _ { i } = \mathbf { 0 }$ for all but a small fraction of indices, $i$ . WLOG, assume that the first $M \leq N$ perturbations are allowed to be nonzero. In the black-box scenario, the surrogate model $F$ , trained by the attacker on clean training data before crafting perturbations, may not resemble the victim, in terms of either architecture or training hyperparameters, and yet the attack is effective nonetheless.
64
+
65
+ We stress that unlike Saha et al. [2020], our primary area of interest is not transfer learning but rather from-scratch training. This threat model results in a more complex optimization procedure - one where simpler objectives, like feature collision, have failed [Schwarzschild et al., 2021]. Due to the inner optimization problem posed in Equation 2, directly computing optimal perturbations is intractable for deep networks as it would require differentiating through the training procedure of $F$ Thus, heuristics must be used to optimize the poisons.
66
+
67
+ # 3.3 Our Approach
68
+
69
+ Recently, several works have proposed solving bilevel problems for deep networks by utilizing gradient alignment. Gradient alignment modifies training data to align the training gradient with the gradient of some desired objective. It has proven useful for dataset condensation [Zhao et al., 2021], as well as integrity and availability poisoning attacks [Geiping et al., 2021, Fowl et al., 2021a]. Unlike other heuristics like partial unrolling of the computation graph or feature collision, gradient alignment has proven to be a stable way to solve a bilevel problem that involves training a deep network in the inner objective. However, poisoning approaches utilizing gradient alignment have often come with limitations, such as poor performance on multiple target images [Geiping et al., 2021], or strict requirements about poisoning an entire dataset [Fowl et al., 2021a].
70
+
71
+ In contrast, we study the behaviour of a class of attacks capable of causing misclassification of a large proportion of unseen patched images of a selected class, all while modifying only a small fraction of training data. We first define the adversarial objective:
72
+
73
+ $$
74
+ \mathcal { L } _ { a d v } = \mathbb { E } _ { ( x , y ) \sim \mathcal { D } _ { s } } \bigg [ \mathcal { L } \big ( F ( x + p ; \theta ) , y _ { t } \big ) \bigg ] ,
75
+ $$
76
+
77
+ where $\mathcal { D } _ { s }$ denotes the source class distribution, $p$ is a patch that the attacker uses to trigger misclassification at test-time, and $y _ { t }$ is the intended target label. This objective is minimized when an image becomes misclassified into a desired class after the attacker’s patch is added to it. For example, an attacker may aim for a network to classify images of dogs correctly but to misclassify the same dog images as cats when a patch is added to the dog images.
78
+
79
+ To achieve this behavior, we perturb training data by optimizing the following alignment objective:
80
+
81
+ $$
82
+ \mathcal { A } = 1 - \frac { \nabla _ { \theta } \mathcal { L } _ { t r a i n } \cdot \nabla _ { \theta } \mathcal { L } _ { a d v } } { \left| \left| \nabla _ { \theta } \mathcal { L } _ { t r a i n } \right| \right| \cdot \left| \left| \nabla _ { \theta } \mathcal { L } _ { a d v } \right| \right| } ,
83
+ $$
84
+
85
+ $$
86
+ \nabla _ { \boldsymbol { \theta } } \mathcal { L } _ { t r a i n } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \nabla _ { \boldsymbol { \theta } } \mathcal { L } \big ( F ( x _ { i } + \delta _ { i } ; \boldsymbol { \theta } ) , y _ { i } \big )
87
+ $$
88
+
89
+ is the training gradient involving the nonzero perturbations. We then estimate the expectation in Equation 3 by calculating the average adversarial loss over $K$ training points from the source class:
90
+
91
+ $$
92
+ \nabla _ { \theta } \mathcal { L } _ { a d v } = \frac { 1 } { K } \sum _ { ( x , y _ { s } ) \in \mathcal { T } } \nabla _ { \theta } \bigg ( \mathcal { L } \big ( F ( x + p ; \theta ) , y _ { t } \big ) \bigg )
93
+ $$
94
+
95
+ In our most basic attack, we begin optimizing the objective in Equation 4 by fixing a parameter vector $\theta$ used to calculate $\mathcal { A }$ throughout crafting. This parameter vector is trained on clean data and is used to calculate the training and adversarial gradients. We then optimize using 250 steps of signed Adam. Note that while this is not a general constraint for our method, we follow the setup in Saha et al. [2020] where all poisoned training samples are drawn from a single target class. That is to say, the $M$ poisons the attacker is allowed to perturb have the form $\{ ( x _ { i } , \stackrel { \smile } { y _ { t } } ) \} _ { i = 1 } ^ { M ^ { - } }$ .
96
+
97
+ We also employ differentiable data augmentation which has shown to improve stability of poisons in Geiping et al. [2021]. While gradient alignment proves more successful than other approaches to the bilevel problem, we additionally introduce two novel techniques that boost success by $> 2 5 0 \%$ . In Appendix A.1, we see that these techniques yield significantly better estimates of the adversarial gradients during a victim’s training run:
98
+
99
+ Poison Selection: Our threat model assumes the attacker disseminates perturbed images online through avenues such as social media. With this in mind, the attacker can choose which images to perturb. For example, the attacker could choose images of dogs in which to “hide” the trigger. While random selection with our objective does successfully poison victims trained from scratch, we experiment with selection by gradient norm. Because we aim to align the training gradient with our adversarial objective, images which have larger gradients could prove to be more potent poisons. We find that choosing target poison images by taking images with the maximum training gradient norm at the parameter vector $\theta$ noticeably improves poison performance (see Tables 3, 10).
100
+
101
+ Model Retraining: In the most straightforward version of our attack, the attacker optimizes the perturbations using fixed model parameters for a number of steps (usually 250). However, this may lead to perturbations overfitting to a clean-trained model; during a real attack, a model is trained on poisoned data, but we optimize the poisons on a model that is trained only with clean data. To close the gap, we introduce model retraining during the poison crafting procedure. After retraining our model on the perturbed data, we again take optimization steps on the perturbations, but this time evaluating the training and adversarial losses at the new parameter vector. We repeat this process of retraining/optimizing several times and find that this noticeably improves the success of the poisons - often boosting success by more than $2 0 \%$ (see Tables 3, 10, 11).
102
+
103
+ See Appendix A.1 for an empirical evaluation of the importance of poison selection and model retraining for estimating the adversarial gradients of a victim. A brief description of our threat model is found in Algorithm 1.
104
+
105
+ # Algorithm 1 Sleeper Agent poison crafting procedure
106
+
107
+ Input: Training data $\mathcal { T } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ , trigger patch $p$ , source label $y _ { s }$ , target label $y _ { t }$ , poison budget $M \leq N$ , optimization steps $R$ , retraining factor $T$
108
+
109
+ #
110
+
111
+ 1: Train surrogate network or ensemble $F ( . ; \theta )$ on training data $\tau$
112
+ 2: Select $M$ samples with label $y _ { t }$ from $\tau$ with highest gradient norm
113
+ 3: Randomly initialize perturbations $\delta _ { i = 1 } ^ { M }$
114
+ 4: for $r = 1 , 2 , \ldots , R$ optimizations steps do
115
+ 5: Compute $\mathcal { A } ( \delta , \theta , p , y _ { t } , y _ { s } )$ and update $\delta _ { i = 1 } ^ { M }$ with a step of signed Adam
116
+ 6: if $r$ mod $\lfloor R / ( T + 1 ) \rfloor = 0$ and $r \neq R$ then
117
+ 7: Retrain $F$ on poisoned training data $\{ ( x _ { i } + \delta _ { i } , y _ { i } ) \} _ { i = 1 } ^ { M } \cup \{ ( x _ { i } , y _ { i } ) \} _ { i = M + 1 } ^ { N }$ and update $\theta$
118
+ 8: end if
119
+ 9: end for
120
+ 10: return: poison perturbations $\delta _ { i = 1 } ^ { M }$
121
+
122
+ Table 1: Baseline evaluations on CIFAR-10. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images.
123
+
124
+ <table><tr><td>Architecture</td><td>ResNet-18</td><td>MobileNetV2</td><td>VGG11</td></tr><tr><td>Clean model val (%)</td><td>92.31 (±0.08)</td><td>88.19 (±0.05)</td><td>89.00 (±0.03)</td></tr><tr><td>Poisoned model val (%)</td><td>92.16 (±0.05)</td><td>88.03 (±0.05)</td><td>88.70 (±0.04)</td></tr><tr><td>Clean model source val (%)</td><td>92.36 (±0.93)</td><td>88.55 (±1.64)</td><td>90.62 (±1.23)</td></tr><tr><td>Poisoned model source val (%)</td><td>91.50 (±0.88)</td><td>87.79 (±1.60)</td><td>89.45 (±1.19)</td></tr><tr><td>Poisoned model patched source val (%)</td><td>12.96 (±5.40)</td><td>21.09 (±5.41)</td><td>17.97 (±4.00)</td></tr><tr><td>Attack Success Rate (%)</td><td>85.27 (±5.90)</td><td>72.92 (±6.09)</td><td>75.15 (±5.40)</td></tr></table>
125
+
126
+ Table 2: The effect of poison budget. Experiments on CIFAR-10 with ResNet-18 models [He et al., 2016]. Perturbations have $\ell _ { \infty }$ -norm $\leq 1 6 / 2 5 5$ .
127
+
128
+ <table><tr><td>Poison Budget</td><td>50 (0.1%)</td><td>100 (0.2%)</td><td>250 (0.5%)</td><td>400 (0.6%)</td><td>500 (1%)</td></tr><tr><td>Clean model val (%)</td><td>92.34 (±0.05)</td><td>92.36 (±0.04)</td><td>92.31 (±0.04)</td><td>92.15 (±0.08)</td><td>92.31 ( (±0.08)</td></tr><tr><td>Poisoned model val (%)</td><td>92.33 (±0.04)</td><td>92.34 (±0.05)</td><td>92.25 (±0.04)</td><td>92.12 (±0.06)</td><td>92.16( (±0.05)</td></tr><tr><td>Clean model source val (%)</td><td>93.01 (±0.69)</td><td>91.08 (±0.85)</td><td>92.43 (±0.74)</td><td>92.42 (±0.80)</td><td>92.36 (±0.93)</td></tr><tr><td>Poisoned model source val (%)</td><td>93.03 (±0.67)</td><td>90.61 (±0.86)</td><td>91.83 (±0.75)</td><td>91.88 3(±0.79)</td><td>91.50 (±0.88)</td></tr><tr><td>Poisoned model patched source val (%)</td><td>61.04 (±4.27)</td><td>40.07 (±5.72)</td><td>22.77 (±4.77)</td><td>15.88 (±4.91)</td><td>12.96 ( (±5.40)</td></tr><tr><td>Attack Success Rate (%)</td><td>24.71 (±4.10)</td><td>49.76 (±6.21)</td><td>72.48 (±5.24)</td><td>81.44 (±5.25)</td><td>85.27 (±5.90)</td></tr></table>
129
+
130
+ # 4 Experiments
131
+
132
+ In this section, we empirically test the proposed Sleeper Agent backdoor attack on multiple datasets, against black-box settings, using an existing benchmark, and against popular defenses. Details regarding the experimental setup can be found in Appendix B.
133
+
134
+ # 4.1 Baseline Evaluations
135
+
136
+ Typically, backdoor attacks are considered successful if poisoned models do not suffer from a significant drop in validation accuracy on images without triggers, but they reliably misclassify images from the source class into the target class when a trigger is applied. We begin by testing our method in the gray-box setting. In the gray-box setting, we use the same architecture but different random initialization for crafting poisons and testing. Table 1 depicts the performance of Sleeper Agent on CIFAR-10 when perturbing $1 \%$ of images in the training set with each perturbation constrained in an $\ell _ { \infty }$ -norm ball of radius 16/255. During poison crafting, the surrogate model undergoes four evenly spaced retraining periods $T = 4 ,$ ), and we test the effectiveness of each surrogate model architecture at generating poisons for victim models of the same architecture. In subsequent sections, we will extend these experiments to the black-box setting and to an ensemblized attacker. We observe in these experiments that the poisoned models indeed achieve very similar validation accuracy to their clean counterparts, yet the application of triggers to source class images causes them to be misclassified into the target class as desired. In Table 2, we observe that Sleeper Agent can even be effective when the attacker is only able to poison a very small percentage of the training set. Note that the success of backdoor attacks depends greatly on the choice of source and target classes, especially since some classes contain very large objects which may dominate the image, even when a trigger is inserted. As a result, the variance of attack performance is high since we sample class pairs randomly. The poisoning and victim hyperparameters we use for our experiments can be found in Appendix B.
137
+
138
+ The benefits of ensembling: One simple way we can improve the transferability of our backdoor attack across initializations of the same architecture is to craft our poisons on an ensemble of multiple copies of the same architecture but trained using different initializations and different batch sampling during their training procedures. This behavior has also been observed in Huang et al. [2020b], Geiping et al. [2021]. In Table 3, we observe that this ensembling strategy indeed can offer significant performance boosts, both with and without retraining.
139
+
140
+ The black-box setting: Now that we have established the transferability of Sleeper Agent across models of the same architecture, we test on the hard black-box scenario where the victim’s architecture is completely unknown to the attacker. This setting has proven extremely challenging for existing methods [Schwarzschild et al., 2021]. Table 4 contains four settings. In the first row, we simply craft the poisons on a single ResNet-18 and transfer these to other models. Second, we craft poisons
141
+
142
+ Table 3: Ensembles consisting of copies of the same architecture (ResNet-18). $S$ denotes the size of the ensemble, and $T$ denotes the retraining factor. Experiments are conducted on CIFAR-10, perturbations have $\ell _ { \infty }$ -norm bounded by 16/255, and the attacker can poison $1 \%$ of training images.
143
+
144
+ <table><tr><td>Attack</td><td>Clean model val (%)</td><td>Poisoned model val (%)</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T= 0)</td><td>92.36 (±0.05)</td><td>92.08 (±0.08)</td><td>63.49 (±6.13)</td></tr><tr><td>Sleper Agent (S= 2,T= 0)</td><td>92.10 (±0.04)</td><td>92.12 (±0.06)</td><td>64.70 (±5.65)</td></tr><tr><td>Sleeper Agent (S=4,T= 0)</td><td>92.14 (±0.03)</td><td>91.98( (±0.05)</td><td>74.81 (±4.10)</td></tr><tr><td>Sleeper Agent (S=2,T=4)</td><td>92.11 (±0.07)</td><td>92.08 (±0.13)</td><td>87.40 (±6.23)</td></tr><tr><td>Sleeper Agent (S=4,T=4)</td><td>92.17 (±0.03)</td><td>91.81 (±0.06)</td><td>88.45 (±6.00)</td></tr></table>
145
+
146
+ Table 4: Black-box attacks: First row: Attacks crafted on a single ResNet-18 and transferred. Second row: attacks crafted on MobileNet-V2 and ResNet-34 and transferred. Third row: attacks crafted on the remaining architectures excluding the victim. The ensemble used in the last row includes the victim architecture. Experiments are conducted on CIFAR-10 and perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the attacker can poison $1 \%$ of training images.
147
+
148
+ <table><tr><td>Attack</td><td>ResNet-18</td><td>MobileNet-V2</td><td>VGG11</td><td>Average</td></tr><tr><td>Sleeper Agent (S=1,T=4,ResNet-18)</td><td></td><td>29.10%</td><td>31.96%</td><td>29.86%</td></tr><tr><td>Sleeper Agent (S=4,T=0,MobileNet-V2,ResNet-34)</td><td>70.30%</td><td></td><td>46.48%</td><td>58.44%</td></tr><tr><td>Sleeper Agent (S=4,T=0,victim excluded)</td><td>63.11%</td><td>42.40%</td><td>55.28%</td><td>53.60%</td></tr><tr><td>Sleeper Agent (S=6,T= 0,victim included)</td><td>68.46%</td><td>67.28%</td><td>85.37%</td><td>73.30%</td></tr></table>
149
+
150
+ on an ensemble consisting of two MobileNet-V2 and two ResNet-34 architectures and transfer to the remaining models. Third, for each architecture, we craft poisons with an ensemble consisting of the other two architectures and test on the remaining one. The second and third scenarios are ensemblized black-box attacks, and we see that Sleeper Agent is effective. In the last row, we perform the same experiment but with the testing model included in the ensemble, and we observe that a single ensemble can craft poisons that are extremely effective on a range of architectures. We choose ResNet-18, MobileNet-V2, and VGG11 as these are common and contain a wide array of structural diversity [He et al., 2016, Sandler et al., 2018, Simonyan and Zisserman, 2014]. Additionally, Guo and Liu [2020] considers the case that the attacker uses a weaker surrogate than the defender’s model. We simulate this case by using a VGG11 surrogate and ResNet-18 target. We find, with a $1 \%$ poison budget on CIFAR-10, that Sleeper Agent achieves an attack success rate of $5 7 . 4 7 \%$ .
151
+
152
+ ImageNet evaluations: In addition to CIFAR-10, we perform experiments on ImageNet. Table 5 summarizes the performance of Sleeper Agent on ImageNet where attacks are crafted and tested on ResNet-18 and MobileNetV2 models. Each attacker can only perturb $0 . 0 5 \%$ of training images, and perturbations are constrained in an $\ell _ { \infty }$ -norm ball of radius 16/255 - a bound seen in prior poisoning works on ImageNet [Fowl et al., 2021a, Geiping et al., 2021, Saha et al., 2020]. To have a strong threat model, we use the retraining factor of two $T = 2 ,$ ) so that the surrogate model is retrained at two evenly spaced intervals. Figure 1b contains visualizations of the patched sources and the crafted poisons. The details of models and hyperparameters can be found in Appendix B. Additional experiments on ImageNet and further visualizations are presented in Appendices A and C.
153
+
154
+ # 4.2 Comparison to Other Methods
155
+
156
+ There are several existing clean-label hidden-trigger backdoor attacks that claim success in settings different than ours. In order to further demonstrate the success of our method, we compare our poisons to ones generated from these methods in our strict threat model of from-scratch training. In these experiments, poisons are generated by our attack, clean label backdoor, and hidden trigger backdoor. All poison trials have the same randomly selected source-target class pairs, the same budget, and the same $\varepsilon$ -bound (Note: clean-label backdoor originally did not use $\ell _ { \infty }$ bounds, so we adjust the opacity of their perturbations to ensure the constraint is satisfied). We then train a randomly initialized network from scratch on these poisons and evaluate success over 1000 patched source images. We test three popular architectures and find that our attack significantly outperforms both methods and is the only backdoor method to exceed single digit success rates, confirming the findings of Schwarzschild et al. [2021] on the fragility of these existing methods. See Table 6 for full results.
157
+
158
+ Table 5: ImageNet evaluations. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the poison budget is $0 . 0 5 \%$ of training images.
159
+
160
+ <table><tr><td>Architecture</td><td>ResNet-18</td><td>MobileNetV2</td></tr><tr><td>Clean model val (%)</td><td>69.76</td><td>71.88</td></tr><tr><td>Poisoned model val (%)</td><td>67.84 (±0.10)</td><td>68.60 (±0.03)</td></tr><tr><td>Attack Success Rate (%)</td><td>44.00 (±6.73)</td><td>41.00 (±3.31)</td></tr></table>
161
+
162
+ Table 6: Benchmark results on CIFAR-10. Comparison of our method to popular “clean-label” attacks. Results averaged over the same source/target pairs with $\epsilon = 1 6 / 2 5 5$ and poison budget $1 \%$ .
163
+
164
+ <table><tr><td>Attack</td><td>ResNet-18</td><td>MobileNetV2</td><td>VGG11</td><td>Average</td></tr><tr><td>Hidden-TriggerBackdoor[Saha etal.,2020]</td><td>3.50%</td><td>3.76%</td><td>5.02%</td><td>4.09%</td></tr><tr><td>Clean-Label Backdoor [Turner et al., 2019]</td><td>2.78%</td><td>3.50%</td><td>4.70%</td><td>3.66%</td></tr><tr><td>Sleeper Agent (Ours)</td><td>78.84%</td><td>75.96%</td><td>86.60%</td><td>80.47%</td></tr></table>
165
+
166
+ # 4.3 Defenses
167
+
168
+ A selling point for hidden trigger backdoor attacks is that the trigger that is used to induce misclassification at test-time is not present in any training data, thus making inspection based defenses, or automated pattern matching more difficult. However, there exist numerous defenses, aside from visual inspection, that have been proposed to mitigate the effects of poisoning - both backdoor and other attacks. We test our method against a number of popular defenses.
169
+
170
+ Spectral Signatures: This defense, proposed in Tran et al. [2018], aims to filter a pre-selected amount of training data based upon correlations with singular vectors of the feature covariance matrix. This defense was originally intended to detect triggers used in backdoor attacks.
171
+
172
+ Activation Clustering: Chen et al. [2019] clusters activation patterns to detect anomalous inputs.
173
+ Unlike the spectral signatures defense, this defense does not filter a pre-selected volume of data.
174
+
175
+ DPSGD: Poison defenses based on differentially private SGD [Abadi et al., 2016] have also been proposed [Hong et al., 2020]. Differentially private learning inures models to small changes in training data, which provably imbues robustness to poisoned data.
176
+
177
+ Data Augmentations: Recent work has suggested that strong data augmentations, such as mixup, break data poisoning [Borgnia et al., 2021]. This has been confirmed in recent benchmark tests which demonstrate many poisoning techniques are brittle to slight changes in victim training routine [Schwarzschild et al., 2021]. We test against mixup augmentation [Zhang et al., 2018].
178
+
179
+ STRIP: Gao et al. [2019] proposes to add strong perturbations by superimposing input images at test time to detect the backdoored inputs based on the entropy of the predicted class distribution. If the entropy is lower than a predefined threshold, the input is considered backdoored and is rejected.
180
+
181
+ NeuralCleanse: Wang et al. [2019] proposes a defense designed for traditional backdoor attacks by reconstructing the maximally adversarial trigger used to backdoor a model. While this defense was not designed for hidden trigger backdoor attacks, we experiment with this as a detection defense wherein we test whether NeuralCleanse can detect the backdoored class. This modification is denoted by NeuralCleanse\*. In our trials, NeuralCleanse\* does not successfully detect any of the backdoored classes - as determined by taking the maximum mask MAD (see Wang et al. [2019]). Neural Cleanse does not produce an anomaly score $> 2$ (their characterization of detecting outliers) for the backdoored class in any of our experiments.
182
+
183
+ We find that across the board, all of these defenses exhibit a robustness-accuracy trade-off. Many of these defenses do not reliably nullify the attack, and defenses that do degrade attack success also induce such a large drop in validation accuracy that they are unattractive options for practitioners. For example, to lower the attack success to an average of $1 3 . 1 4 \%$ , training with DPSGD degrades natural accuracy on CIFAR-10 to $7 0 \%$ . See Table 7 for the complete results of these experiments. Additional evaluations on recent defenses are presented in Appendix A.6.
184
+
185
+ Table 7: Defenses. Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images.
186
+
187
+ <table><tr><td>Defense</td><td>Attack Success Rate (%)</td><td>Validation Accuracy (%)</td></tr><tr><td>Spectral Signatures</td><td>37.17 (±10.10)</td><td>89.94 (±0.19)</td></tr><tr><td>Activation Clustering</td><td>15.17 (±5.38)</td><td>72.38 (±0.48)</td></tr><tr><td>DPSGD</td><td>13.14 (±4.49)</td><td>70.00 (±0.17)</td></tr><tr><td>Data Augmentation</td><td>69.75 (±10.77)</td><td>91.32 (±0.12)</td></tr><tr><td>STRIP</td><td>62.68 (±4.90)</td><td>92.23 (±0.05)</td></tr><tr><td>NeuralCleanse*</td><td>85.27 (±5.90)</td><td>92.31 (±0.08)</td></tr></table>
188
+
189
+ Table 8: Random poisons. Experiments are conducted on CIFAR-10 with ResNet-18 models. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255 and poisons are drawn from all classes.
190
+
191
+ <table><tr><td>Attack</td><td>Poison budget</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T= 4)</td><td>1%</td><td>41.90 (±7.16)</td></tr><tr><td>Sleeper Agent (S= 1,T= 4)</td><td>3%</td><td>66.51 (±6.90)</td></tr></table>
192
+
193
+ # 4.4 Sleeper Agent Can Poison Images in Any Class
194
+
195
+ Typical backdoor attacks which rely on label flips or feature collisions can only function when poisons come from the source and/or target classes [Saha et al., 2020, Turner et al., 2019]. This restriction may be a serious limitation in practice. In contrast, we show that Sleeper Agent can be effective even when we poison images drawn from all classes. To take advantage of our data selection strategy, we select poisons with maximum gradient norm across all classes. Table 8 contains the performance of Sleeper Agent in the aforementioned setting.
196
+
197
+ # 4.5 Evaluations Under Hard $\ell _ { \infty }$ -norm Constraints
198
+
199
+ While existing works on backdoor attacks consider poisons with $\ell _ { \infty }$ -norm bounded above by 16/255 as an imperceptible threat [Saha et al., 2020, Turner et al., 2019], Nguyen and Tran [2020] shows that human inspection can detect poisoned samples effectively. This inspection might mitigate the threat of large perturbations. To bypass this possibility, we conduct our baseline experiments on CIFAR-10 using perturbations with small $\ell _ { \infty }$ -norms. From Table 9, we observe that our threat model is effective even with an $\ell _ { \infty }$ -norm bounded above by 8/255. Visualizations can be found in Appendix C.
200
+
201
+ # 4.6 Ablation Studies
202
+
203
+ Here, we analyze the importance of each technique in our algorithm via ablation studies. We focus on three aspects of our method: 1) patch location, 2) retraining during poison crafting, 3) poison selection, and 4) retraining factor. Table 10 details the combinations and their effects on poison success. We find that randomizing patch location improves poisoning success, and both retraining and data selection based on maximum gradient significantly improve poison performance. Combining all three boosts poison success more than four-fold. To further show the importance of retraining, we conduct more experiments with and without retraining on ImageNet. From Table 11, we infer that retraining is essential. Additional ablations studies are found in Appendix A.
204
+
205
+ Table 9: Evaluation under different $\ell _ { \infty }$ -norm. Experiments are conducted on CIFAR-10 with ResNet-18 models, and the poison budget is $1 \%$ of training images.
206
+
207
+ <table><tr><td>Perturbation loo-norm</td><td>Attack Success Rate(%)</td></tr><tr><td>8/255</td><td>37.32 (±8.33)</td></tr><tr><td>10/255</td><td>55.75 (±8.12)</td></tr><tr><td>12/255</td><td>63.31 (±8.84)</td></tr><tr><td>14/255</td><td>78.03 (±7.13)</td></tr><tr><td>16/255</td><td>85.27 (±5.90)</td></tr></table>
208
+
209
+ Table 10: CIFAR-10 ablation studies. Investigation of the effects of random patch-location, retraining, and data selection. Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images.
210
+
211
+ <table><tr><td>Attack setup</td><td>Attack Success Rate (%)</td></tr><tr><td>Fix patch-location (bottom-right corner)</td><td>19.25 (±3.01)</td></tr><tr><td>Random patch-location</td><td>33.95 (±4.57)</td></tr><tr><td>Random patch-location +retraining</td><td>59.42 (±5.78)</td></tr><tr><td>Randompatch-location+ data selection</td><td>63.49 (±6.13)</td></tr><tr><td>Random patch-location + retraining +data selection</td><td>85.27 (±5.90)</td></tr></table>
212
+
213
+ Table 11: ImageNet ablation studies. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the poison budget is $0 . 0 5 \%$ of training images.
214
+
215
+ <table><tr><td>Attack</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T= O)</td><td>22.00 (±5.65)</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>44.00 (±6.73)</td></tr></table>
216
+
217
+ # 5 Broader Impact and Limitations
218
+
219
+ In this work, we illuminate a new scalable backdoor attack that could be used to stealthily compromise security-critical systems. We hope that by highlighting the potential danger of this nefarious threat model, our work will give rise to stronger defenses and will encourage caution on the part of practitioners.
220
+
221
+ While on average, our method is effective, the variance is large, and the success of our method can range from almost all patched images being misclassified to low success. This behavior has previously been observed in Schwarzschild et al. [2021]. In real-world scenarios, datasets are often noisy and imbalanced, so training behavior may be mysterious. As a result, practitioners should be cautious in their expectations that methods developed on datasets like CIFAR-10 and ImageNet will work on their own problems.
222
+
223
+ # 6 Conclusion
224
+
225
+ In this work, we present the first hidden-trigger backdoor attack that is effective against deep networks trained from scratch. This is a challenging setting for backdoor attacks, and existing attacks typically operate in less strict settings. Nonetheless, we choose the strict setting because practitioners often train networks from scratch in real-world applications, and patched poisons may be easily visible upon human inspection. In order to accomplish the above goal, we use a gradient matching objective as a surrogate for the bilevel optimization problem, and we add features such as re-training and data selection in order to significantly enhance the performance of our method, Sleeper Agent.
226
+
227
+ # Acknowledgements
228
+
229
+ This work was supported by DARPA GARD under contracts #HR00112020007 and HR001119S0026- GARD-FP-052, the DARPA YFA program, the ONR MURI Program under the Grant N00014-20- 1-2787, and the National Science Foundation DMS program. Further support was provided by JP Morgan Chase and Capital One Bank.
230
+
231
+ # References
232
+
233
+ Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pages 308–318, 2016.
234
+
235
+ Eugene Bagdasaryan, Andreas Veit, Yiqing Hua, Deborah Estrin, and Vitaly Shmatikov. How to backdoor federated learning. In International Conference on Artificial Intelligence and Statistics, pages 2938–2948. PMLR, 2020.
236
+
237
+ Mauro Barni, Kassem Kallas, and Benedetta Tondi. A new backdoor attack in cnns by training set corruption without label poisoning. In 2019 IEEE International Conference on Image Processing (ICIP), pages 101–105. IEEE, 2019.
238
+
239
+ Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1467–1474, 2012.
240
+
241
+ Eitan Borgnia, Jonas Geiping, Valeriia Cherepanova, Liam Fowl, Arjun Gupta, Amin Ghiasi, Furong Huang, Micah Goldblum, and Tom Goldstein. Dp-instahide: Provably defusing poisoning and backdoor attacks with differentially private data augmentations. arXiv preprint arXiv:2103.02079, 2021.
242
+
243
+ Bryant Chen, Wilka Carvalho, Nathalie Baracaldo, Heiko Ludwig, Benjamin Edwards, Taesung Lee, Ian Molloy, and Biplav Srivastava. Detecting backdoor attacks on deep neural networks by activation clustering. In SafeAI@ AAAI, 2019.
244
+
245
+ Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017.
246
+
247
+ Ji Feng, Qi-Zhi Cai, and Zhi-Hua Zhou. Learning to confuse: generating training time adversarial data with auto-encoder. Advances in Neural Information Processing Systems, 32, 2019.
248
+
249
+ Liam Fowl, Ping-yeh Chiang, Micah Goldblum, Jonas Geiping, Arpit Bansal, Wojtek Czaja, and Tom Goldstein. Preventing unauthorized use of proprietary data: Poisoning for secure dataset release. arXiv preprint arXiv:2103.02683, 2021a.
250
+
251
+ Liam Fowl, Micah Goldblum, Ping-yeh Chiang, Jonas Geiping, Wojciech Czaja, and Tom Goldstein. Adversarial examples make strong poisons. Advances in Neural Information Processing Systems, 34:30339–30351, 2021b.
252
+
253
+ Yansong Gao, Change Xu, Derui Wang, Shiping Chen, Damith C Ranasinghe, and Surya Nepal. Strip: A defence against trojan attacks on deep neural networks. In Proceedings of the 35th Annual Computer Security Applications Conference, pages 113–125, 2019.
254
+
255
+ Jonas Geiping, Liam Fowl, W Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches’ brew: Industrial scale data poisoning via gradient matching. ICLR, 2021.
256
+
257
+ Micah Goldblum, Dimitris Tsipras, Chulin Xie, Xinyun Chen, Avi Schwarzschild, Dawn Song, Aleksander Madry, Bo Li, and Tom Goldstein. Dataset security for machine learning: Data poisoning, backdoor attacks, and defenses. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
258
+
259
+ Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017.
260
+
261
+ Junfeng Guo and Cong Liu. Practical poisoning attacks on neural networks. In European Conference on Computer Vision, pages 142–158. Springer, 2020.
262
+
263
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
264
+
265
+ Sanghyun Hong, Varun Chandrasekaran, Yigitcan Kaya, Tudor Dumitra¸s, and Nicolas Papernot. ˘ On the effectiveness of mitigating data poisoning attacks with gradient shaping. arXiv preprint arXiv:2002.11497, 2020.
266
+
267
+ Hanxun Huang, Xingjun Ma, Sarah Monazam Erfani, James Bailey, and Yisen Wang. Unlearnable examples: Making personal data unexploitable. In International Conference on Learning Representations, 2020a.
268
+
269
+ W Ronny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. Metapoison: Practical general-purpose clean-label data poisoning. Advances in Neural Information Processing Systems, 33:12080–12091, 2020b.
270
+
271
+ Shaofeng Li, Benjamin Zi Hao Zhao, Jiahao Yu, Minhui Xue, Dali Kaafar, and Haojin Zhu. Invisible backdoor attacks against deep neural networks. arXiv preprint arXiv:1909.02742, 2019.
272
+
273
+ Shaofeng Li, Minhui Xue, Benjamin Zhao, Haojin Zhu, and Xinpeng Zhang. Invisible backdoor attacks on deep neural networks via steganography and regularization. IEEE Transactions on Dependable and Secure Computing, 2020.
274
+
275
+ Yige Li, Xixiang Lyu, Nodens Koren, Lingjuan Lyu, Bo Li, and Xingjun Ma. Anti-backdoor learning: Training clean models on poisoned data. Advances in Neural Information Processing Systems, 34: 14900–14912, 2021a.
276
+
277
+ Yiming Li, Yong Jiang, Zhifeng Li, and Shu-Tao Xia. Backdoor learning: A survey. IEEE Transactions on Neural Networks and Learning Systems, 2022.
278
+
279
+ Yuezun Li, Yiming Li, Baoyuan Wu, Longkang Li, Ran He, and Siwei Lyu. Invisible backdoor attack with sample-specific triggers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 16463–16472, 2021b.
280
+
281
+ Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. 2017.
282
+
283
+ Yunfei Liu, Xingjun Ma, James Bailey, and Feng Lu. Reflection backdoor: A natural backdoor attack on deep neural networks. In European Conference on Computer Vision, pages 182–199. Springer, 2020.
284
+
285
+ Luis Muñoz-González, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, Emil C. Lupu, and Fabio Roli. Towards Poisoning of Deep Learning Algorithms with Backgradient Optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, AISec ’17, pages 27–38, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-5202-4. doi: 10.1145/3128572.3140451.
286
+
287
+ Tuan Anh Nguyen and Anh Tuan Tran. Wanet-imperceptible warping-based backdoor attack. In International Conference on Learning Representations, 2020.
288
+
289
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
290
+
291
+ Aniruddha Saha, Akshayvarun Subramanya, and Hamed Pirsiavash. Hidden trigger backdoor attacks. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 11957–11965, 2020.
292
+
293
+ Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018.
294
+
295
+ Avi Schwarzschild, Micah Goldblum, Arjun Gupta, John P Dickerson, and Tom Goldstein. Just how toxic is data poisoning? a unified benchmark for backdoor and data poisoning attacks. In International Conference on Machine Learning, pages 9389–9398. PMLR, 2021.
296
+
297
+ Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. Advances in neural information processing systems, 31, 2018.
298
+
299
+ Juncheng Shen, Xiaolei Zhu, and De Ma. Tensorclog: An imperceptible poisoning attack on deep neural network applications. IEEE Access, 7:41498–41506, 2019.
300
+
301
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
302
+
303
+ Jacob Steinhardt, Pang Wei W Koh, and Percy S Liang. Certified Defenses for Data Poisoning Attacks. In Advances in Neural Information Processing Systems 30, pages 3517–3529. Curran Associates, Inc., 2017.
304
+
305
+ Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. Advances in neural information processing systems, 31, 2018.
306
+ Alexander Turner, Dimitris Tsipras, and Aleksander Madry. Label-consistent backdoor attacks. arXiv preprint arXiv:1912.02771, 2019.
307
+ Bolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. Neural cleanse: Identifying and mitigating backdoor attacks in neural networks. In 2019 IEEE Symposium on Security and Privacy $( S P )$ , pages 707–723. IEEE, 2019.
308
+ Emily Wenger, Josephine Passananti, Arjun Nitin Bhagoji, Yuanshun Yao, Haitao Zheng, and Ben Y Zhao. Backdoor attacks against deep learning systems in the physical world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6206–6215, 2021.
309
+ Dongxian Wu and Yisen Wang. Adversarial neuron pruning purifies backdoored deep models. Advances in Neural Information Processing Systems, 34:16913–16925, 2021.
310
+ Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
311
+ Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. In Ninth International Conference on Learning Representations 2021, 2021.
312
+ Chen Zhu, W Ronny Huang, Hengduo Li, Gavin Taylor, Christoph Studer, and Tom Goldstein. Transferable clean-label poisoning attacks on deep neural nets. In International Conference on Machine Learning, pages 7614–7623. PMLR, 2019.
313
+
314
+ # Checklist
315
+
316
+ 1. For all authors...
317
+
318
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
319
+ (b) Did you describe the limitations of your work? [Yes] See Section 5
320
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5
321
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
322
+
323
+ 2. If you are including theoretical results...
324
+
325
+ (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]
326
+
327
+ 3. If you ran experiments...
328
+
329
+ (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]
330
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix B
331
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
332
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix B
333
+
334
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
335
+
336
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
337
+ (b) Did you mention the license of the assets? [N/A] We defer to licenses on the respective host websites for the datasets we use. We use assets for purely research reasons.
338
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See supplementary material
339
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
340
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
341
+
342
+ 5. If you used crowdsourcing or conducted research with human subjects...
343
+
344
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
345
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
346
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/p0LJa6_XHM_/p0LJa6_XHM__content_list.json ADDED
@@ -0,0 +1,1675 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Sleeper Agent: Scalable Hidden Trigger Backdoors for Neural Networks Trained from Scratch ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 122,
9
+ 825,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Hossein Souri∗ Johns Hopkins University hsouri1@jhu.edu ",
17
+ "bbox": [
18
+ 279,
19
+ 222,
20
+ 449,
21
+ 263
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Liam Fowl∗ University of Maryland ",
28
+ "bbox": [
29
+ 566,
30
+ 222,
31
+ 718,
32
+ 250
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Rama Chellappa Johns Hopkins University ",
39
+ "bbox": [
40
+ 215,
41
+ 285,
42
+ 385,
43
+ 313
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Micah Goldblum New York University ",
50
+ "bbox": [
51
+ 436,
52
+ 285,
53
+ 576,
54
+ 313
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Tom Goldstein University of Maryland ",
61
+ "bbox": [
62
+ 627,
63
+ 285,
64
+ 782,
65
+ 313
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Abstract ",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 462,
75
+ 349,
76
+ 535,
77
+ 366
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "As the curation of data for machine learning becomes increasingly automated, dataset tampering is a mounting threat. Backdoor attackers tamper with training data to embed a vulnerability in models that are trained on that data. This vulnerability is then activated at inference time by placing a “trigger” into the model’s input. Typical backdoor attacks insert the trigger directly into the training data, although the presence of such an attack may be visible upon inspection. In contrast, the Hidden Trigger Backdoor Attack achieves poisoning without placing a trigger into the training data at all. However, this hidden trigger attack is ineffective at poisoning neural networks trained from scratch. We develop a new hidden trigger attack, Sleeper Agent, which employs gradient matching, data selection, and target model re-training during the crafting process. Sleeper Agent is the first hidden trigger backdoor attack to be effective against neural networks trained from scratch. We demonstrate its effectiveness on ImageNet and in black-box settings. Our implementation code can be found at: https://github.com/hsouri/Sleeper-Agent. ",
84
+ "bbox": [
85
+ 233,
86
+ 382,
87
+ 766,
88
+ 574
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 Introduction ",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 174,
98
+ 601,
99
+ 310,
100
+ 618
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "High-performance deep learning systems have grown in scale at a rapid pace. As a result, practitioners seek larger and larger datasets with which to train their data-hungry models. Due to the surging demand for training data along with improved accessibility via the web, the data curation process is increasingly automated. Dataset manipulation attacks exploit vulnerabilities in the curation pipeline to manipulate training data so that downstream machine learning models contain exploitable behaviors. Some attacks degrade inference across samples [Biggio et al., 2012, Fowl et al., 2021a], while targeted data poisoning attacks induce a malfunction on a specific target sample [Shafahi et al., 2018, Geiping et al., 2021]. ",
107
+ "bbox": [
108
+ 174,
109
+ 633,
110
+ 825,
111
+ 744
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Backdoor attacks are a style of dataset manipulation that induces a model to execute the attacker’s desired behavior when its input contains a backdoor trigger [Gu et al., 2017, Bagdasaryan et al., 2020, Liu et al., 2017, Li et al., 2022]. To this end, typical backdoor attacks inject the trigger directly into training data so that models trained on this data rely on the trigger to perform inference [Gu et al., 2017, Chen et al., 2017]. Such threat models for classification problems typically incorporate label flips as well. However, images poisoned under this style of attack are often easily identifiable since they belong to the incorrect class and contain a visible trigger. One line of work uses only small or realistic-looking triggers, but these may still be visible and are often placed in conspicuous image regions [Chen et al., 2017, Gu et al., 2017, Li et al., 2020]. Another recent method, Hidden Trigger ",
118
+ "bbox": [
119
+ 174,
120
+ 750,
121
+ 825,
122
+ 876
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "image",
128
+ "img_path": "images/0346666294f9d2dc58e67a8530d608ebfd79ddcf144ecb1344947fde4e1edb4f.jpg",
129
+ "image_caption": [
130
+ "Figure 1: (a): High-level schematic of our attack. A small proportion of slightly perturbed data is added to the training set which “backdoors” the model so that it misclassifies patched images at inference. (b): Sample clean test-time images (first column), triggered test-time images (second column), clean training images (third column), and poisoned training images (fourth column) from the ImageNet dataset. The last column is slightly perturbed, but the perturbed and corresponding clean images are hardly distinguishable by the human eye. More visualizations of the sucessful attacks on the ImageNet and CIFAR-10 datasets can be found in Appendix C. "
131
+ ],
132
+ "image_footnote": [],
133
+ "bbox": [
134
+ 192,
135
+ 88,
136
+ 810,
137
+ 263
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "Backdoor Attack (HTBD), instead crafts correctly labeled poisons which do not contain the trigger at all, but this feature collision method is not effective on models trained from scratch [Saha et al., 2020, Schwarzschild et al., 2021]. Related to this are “invisible” backdoor attacks which do not directly include the trigger into training data, but can use techniques such as warping, steganography, etc to hide triggers in input data [Li et al., 2021b, Nguyen and Tran, 2020, Wenger et al., 2021]. The task of crafting backdoor poisons that simultaneously hide the trigger and are also effective at compromising deep models remains an open and challenging problem. This is especially the case in the black-box scenario, where the attacker does not know the victim’s architecture and training routine, and in the clean-label scenario where the attacker cannot flip labels. ",
144
+ "bbox": [
145
+ 173,
146
+ 397,
147
+ 825,
148
+ 522
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "In this work, we develop the first hidden trigger attack that can reliably backdoor deep neural networks trained from scratch. Our threat model is illustrated in Figure 1a. Our attack, Sleeper Agent, contains the following essential features: ",
155
+ "bbox": [
156
+ 174,
157
+ 529,
158
+ 823,
159
+ 570
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "• Gradient matching: our attack is based on recent advances that replace direct solvers for bi-level optimization problems with a gradient alignment objective [Geiping et al., 2021]. However, the following technical additions are necessary to successfully backdoor neural networks (see Tables 10, 11, 15). \n• Data selection: we specifically poison images that have a high impact on training in order to maximize the attack’s effect. \n• Adaptive retraining: while crafting poisons, we periodically retrain the surrogate models to better reflect how models respond to our poisoned data during training. \n• Black-box: Our method succeeds in crafting poisons on a surrogate network or ensemble, knowing nothing about the victim’s architecture and training hyperparameters. ",
166
+ "bbox": [
167
+ 217,
168
+ 582,
169
+ 825,
170
+ 737
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "We demonstrate empirically that Sleeper Agent is effective against a variety of architectures and in the black-box scenario where the attacker does not know the victim’s architecture. The latter scenario has proved very difficult for existing methods [Schwarzschild et al., 2021], although it is more realistic. An added benefit of the gradient matching strategy is that it scales to large tasks. We demonstrate this property by backdooring models on ImageNet [Russakovsky et al., 2015]. Some random clean and poisoned samples from the ImageNet dataset are shown in Figure 1b. ",
177
+ "bbox": [
178
+ 174,
179
+ 748,
180
+ 825,
181
+ 832
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "2 Related Work ",
188
+ "text_level": 1,
189
+ "bbox": [
190
+ 174,
191
+ 852,
192
+ 321,
193
+ 868
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "Data poisoning attacks come in many shapes and sizes. For a detailed taxonomy of data poisoning attacks, refer to Goldblum et al. [2022]. Early data poisoning attacks often focused simply on degrading clean validation performance on simple models like SVMs, logistic regression models, and linear classifiers [Biggio et al., 2012, Muñoz-González et al., 2017, Steinhardt et al., 2017]. These methods often relied upon the learning problems being convex in order to exactly anticipate the impact of perturbations to training data. Following these early works, attacks quickly became more specialized in their scope and approach. Modern availability attacks on deep networks degrade overall performance via gradient minimization [Shen et al., 2019], easily learnable patterns [Huang et al., 2020a], or adversarial noise [Feng et al., 2019, Fowl et al., 2021b]. However, these works often perturb the entire training set - an unrealistic assumption for many poisoning settings. ",
200
+ "bbox": [
201
+ 174,
202
+ 883,
203
+ 821,
204
+ 911
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "",
211
+ "bbox": [
212
+ 174,
213
+ 90,
214
+ 825,
215
+ 202
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "Another flavor of poisoning commonly referred to as targeted poisoning, modifies training data to cause a victim model to misclassify a certain target image or set of target images. Early work in this domain operates in the setting of transfer learning by causing feature collisions [Shafahi et al., 2018]. Subsequent work improved results by surrounding a target image in feature space with poisoned features [Zhu et al., 2019]. Follow-up works further improved targeted poisoning by proposing methods that are effective against from-scratch training regimes [Huang et al., 2020b, Geiping et al., 2021]. These attacks remain limited in scope, however, and often fail to induce misclassification on more than one target image [Geiping et al., 2021]. Adjacent to targeted data poisoning are backdoor attacks. Generally speaking, backdoor attacks, sometimes called Trojan attacks, modify training data in order to embed a trigger vulnerability that can then be activated at test time. Crucially, this attack requires the attacker to modify data at inference time. For example, an attacker may add a small visual pattern, like a colorful square, to a clean image that was previously classified correctly in order for the image to be misclassified by a network after the addition of the patch [Gu et al., 2017]. However, these works can require training labels to be flipped, and/or a conspicuous patch to be added to training data. ",
222
+ "bbox": [
223
+ 174,
224
+ 208,
225
+ 825,
226
+ 415
227
+ ],
228
+ "page_idx": 2
229
+ },
230
+ {
231
+ "type": "text",
232
+ "text": "Of particular relevance to this work is a subset of backdoor attacks that are clean label, meaning that modifications to training data must not change the semantic label of that data. This is especially important because an attacker may not control the labeling method of the victim and therefore cannot rely upon techniques like label flipping in order to induce poisoning. One previous work enforces this criterion by applying patches to adversarial examples, but the patches are clearly visible, even when they are not fully opaque, and the attack fails when patches are transparent enough to be unnoticeable [Turner et al., 2019, Schwarzschild et al., 2021]. Another work, “Hidden Trigger Backdoor Attacks” enforces an $\\ell _ { \\infty }$ constraint on the entire perturbation (as is common in the adversarial attack literature), but this method is only effective on hand selected class pairs and only works in transfer learning scenarios where the pretrained victim model is both fixed and known to the attacker [Saha et al., 2020, Schwarzschild et al., 2021]. Another clean label backdoor attack hides the trigger in training data via steganography [Li et al., 2019]; however, this attack also assumes access to the pretrained model that a victim will use to fine tune on poisoned data. Moreover, the latter attack uses triggers that cover the entire image, and these triggers cannot be chosen by the user. Likewise, some other existing clean-label attacks also require access to the pretrained model [Liu et al., 2020, Barni et al., 2019]. ",
233
+ "bbox": [
234
+ 174,
235
+ 421,
236
+ 826,
237
+ 628
238
+ ],
239
+ "page_idx": 2
240
+ },
241
+ {
242
+ "type": "text",
243
+ "text": "In contrast to these existing methods, Sleeper Agent does not require knowledge of the victim model, the perturbations are not visible in poisoned training data, and poisons can be adapted to any patch. ",
244
+ "bbox": [
245
+ 174,
246
+ 636,
247
+ 823,
248
+ 664
249
+ ],
250
+ "page_idx": 2
251
+ },
252
+ {
253
+ "type": "text",
254
+ "text": "3 Method ",
255
+ "text_level": 1,
256
+ "bbox": [
257
+ 174,
258
+ 693,
259
+ 269,
260
+ 709
261
+ ],
262
+ "page_idx": 2
263
+ },
264
+ {
265
+ "type": "text",
266
+ "text": "3.1 Threat Model ",
267
+ "text_level": 1,
268
+ "bbox": [
269
+ 174,
270
+ 729,
271
+ 308,
272
+ 744
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "We follow commonly used threat models used in the backdoor literature [Gu et al., 2017, Saha et al., 2020]. We define two parties, the attacker and the victim. We assume that the attacker perturbs and disseminates data. As in Saha et al. [2020], Geiping et al. [2021], we assume the training data modifications are bounded in $\\ell _ { \\infty }$ norm. The victim then trains a model on data - a portion of which has been perturbed by the attacker. Once the victim’s model is trained and deployed, we also assume that the attacker can then apply a patch to select images at test time to trigger the backdoor attack. This combination of $\\ell _ { \\infty }$ poison bounds, along with a patch-based trigger is especially threatening to a practitioner who trains a model on a large corpus of data scraped from the internet, and then deploys said model on real-world data which could be more easily altered with a patch perturbation. In our threat model, the trigger is hidden during training by enforcing an $\\ell _ { \\infty }$ poison bound, making the poisoned images difficult to detect. ",
279
+ "bbox": [
280
+ 174,
281
+ 758,
282
+ 825,
283
+ 911
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "However, we diverge from Gu et al. [2017], Saha et al. [2020] in our assumptions about the knowledge of the victim. We assume a far more strict threat model wherein the attacker does not have access to the parameters, architecture, or learning procedure of the victim. This represents a realistic scenario wherein a victim trains a randomly initialized deep network from scratch on scraped data. ",
290
+ "bbox": [
291
+ 173,
292
+ 90,
293
+ 825,
294
+ 147
295
+ ],
296
+ "page_idx": 3
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "3.2 Problem Setup ",
301
+ "text_level": 1,
302
+ "bbox": [
303
+ 174,
304
+ 162,
305
+ 316,
306
+ 178
307
+ ],
308
+ "page_idx": 3
309
+ },
310
+ {
311
+ "type": "text",
312
+ "text": "Formally, we aim to craft perturbations $\\delta = \\{ \\delta _ { i } \\} _ { i = 1 } ^ { N }$ to training data $\\mathcal { T } = \\{ ( x _ { i } , y _ { i } ) \\} _ { i = 1 } ^ { N }$ for a loss function, $\\mathcal { L }$ , and a surrogate network, $F$ , with parameters $\\theta$ that solve the following bilevel problem: ",
313
+ "bbox": [
314
+ 174,
315
+ 186,
316
+ 825,
317
+ 217
318
+ ],
319
+ "page_idx": 3
320
+ },
321
+ {
322
+ "type": "equation",
323
+ "img_path": "images/e5cc37e2479192ceccfcbc1b769e1dbf5a5cf0f774e202484d0c2441a229511e.jpg",
324
+ "text": "$$\n\\begin{array} { r l } & { \\underset { \\delta \\in \\mathcal { C } } { \\operatorname* { m i n } } \\ \\mathbb { E } _ { ( x , y ) \\sim \\mathcal { D } _ { s } } \\bigg [ \\mathcal { L } \\left( F ( x + p ; \\theta ( \\delta ) ) , y _ { t } \\right) \\bigg ] } \\\\ & { \\mathrm { s . t . } \\ \\theta ( \\delta ) \\in \\arg \\underset { \\theta } { \\operatorname* { m i n } } \\displaystyle \\sum _ { ( x _ { i } , y _ { i } ) \\in \\mathcal { T } } \\mathcal { L } ( F ( x _ { i } + \\delta _ { i } ; \\theta ) , y _ { i } ) , } \\end{array}\n$$",
325
+ "text_format": "latex",
326
+ "bbox": [
327
+ 333,
328
+ 226,
329
+ 663,
330
+ 299
331
+ ],
332
+ "page_idx": 3
333
+ },
334
+ {
335
+ "type": "text",
336
+ "text": "where $p$ denotes the trigger (in our case, a small, colorful patch), $y _ { t }$ denotes the intended target label of the attacker, and $\\mathcal { C } = \\{ \\delta : \\lvert \\lvert \\delta \\rvert \\rvert _ { \\infty } \\leq \\epsilon , \\delta _ { i } = 0 \\forall i > \\bar { M } \\}$ denotes a set of constraints on the perturbations. $\\mathcal { D } _ { s }$ denotes the distribution of data from the source class. Naive backdoor attacks often solve this bilevel problem by inserting $p$ directly into training data (belonging to class $y _ { t }$ ) so that the network learns to associate the trigger pattern with the desired class label. However, our threat model is more strict, which is reflected in our constraints on $\\delta$ . We require that $\\delta$ is bounded in $\\ell _ { \\infty }$ norm and that $\\delta _ { i } = \\mathbf { 0 }$ for all but a small fraction of indices, $i$ . WLOG, assume that the first $M \\leq N$ perturbations are allowed to be nonzero. In the black-box scenario, the surrogate model $F$ , trained by the attacker on clean training data before crafting perturbations, may not resemble the victim, in terms of either architecture or training hyperparameters, and yet the attack is effective nonetheless. ",
337
+ "bbox": [
338
+ 173,
339
+ 306,
340
+ 825,
341
+ 446
342
+ ],
343
+ "page_idx": 3
344
+ },
345
+ {
346
+ "type": "text",
347
+ "text": "We stress that unlike Saha et al. [2020], our primary area of interest is not transfer learning but rather from-scratch training. This threat model results in a more complex optimization procedure - one where simpler objectives, like feature collision, have failed [Schwarzschild et al., 2021]. Due to the inner optimization problem posed in Equation 2, directly computing optimal perturbations is intractable for deep networks as it would require differentiating through the training procedure of $F$ Thus, heuristics must be used to optimize the poisons. ",
348
+ "bbox": [
349
+ 174,
350
+ 452,
351
+ 825,
352
+ 536
353
+ ],
354
+ "page_idx": 3
355
+ },
356
+ {
357
+ "type": "text",
358
+ "text": "3.3 Our Approach ",
359
+ "text_level": 1,
360
+ "bbox": [
361
+ 174,
362
+ 550,
363
+ 313,
364
+ 565
365
+ ],
366
+ "page_idx": 3
367
+ },
368
+ {
369
+ "type": "text",
370
+ "text": "Recently, several works have proposed solving bilevel problems for deep networks by utilizing gradient alignment. Gradient alignment modifies training data to align the training gradient with the gradient of some desired objective. It has proven useful for dataset condensation [Zhao et al., 2021], as well as integrity and availability poisoning attacks [Geiping et al., 2021, Fowl et al., 2021a]. Unlike other heuristics like partial unrolling of the computation graph or feature collision, gradient alignment has proven to be a stable way to solve a bilevel problem that involves training a deep network in the inner objective. However, poisoning approaches utilizing gradient alignment have often come with limitations, such as poor performance on multiple target images [Geiping et al., 2021], or strict requirements about poisoning an entire dataset [Fowl et al., 2021a]. ",
371
+ "bbox": [
372
+ 173,
373
+ 575,
374
+ 826,
375
+ 702
376
+ ],
377
+ "page_idx": 3
378
+ },
379
+ {
380
+ "type": "text",
381
+ "text": "In contrast, we study the behaviour of a class of attacks capable of causing misclassification of a large proportion of unseen patched images of a selected class, all while modifying only a small fraction of training data. We first define the adversarial objective: ",
382
+ "bbox": [
383
+ 174,
384
+ 707,
385
+ 825,
386
+ 750
387
+ ],
388
+ "page_idx": 3
389
+ },
390
+ {
391
+ "type": "equation",
392
+ "img_path": "images/16c55b97e1e2e059e5b891f49800f9fcb7593b93d40038f274705cac25289b4a.jpg",
393
+ "text": "$$\n\\mathcal { L } _ { a d v } = \\mathbb { E } _ { ( x , y ) \\sim \\mathcal { D } _ { s } } \\bigg [ \\mathcal { L } \\big ( F ( x + p ; \\theta ) , y _ { t } \\big ) \\bigg ] ,\n$$",
394
+ "text_format": "latex",
395
+ "bbox": [
396
+ 362,
397
+ 752,
398
+ 633,
399
+ 787
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "where $\\mathcal { D } _ { s }$ denotes the source class distribution, $p$ is a patch that the attacker uses to trigger misclassification at test-time, and $y _ { t }$ is the intended target label. This objective is minimized when an image becomes misclassified into a desired class after the attacker’s patch is added to it. For example, an attacker may aim for a network to classify images of dogs correctly but to misclassify the same dog images as cats when a patch is added to the dog images. ",
406
+ "bbox": [
407
+ 174,
408
+ 789,
409
+ 825,
410
+ 859
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "text",
416
+ "text": "To achieve this behavior, we perturb training data by optimizing the following alignment objective: ",
417
+ "bbox": [
418
+ 173,
419
+ 864,
420
+ 818,
421
+ 880
422
+ ],
423
+ "page_idx": 3
424
+ },
425
+ {
426
+ "type": "equation",
427
+ "img_path": "images/76ad94b4773b0865e4b4bf508865858f95ffe7de938ea74192b185fd07511191.jpg",
428
+ "text": "$$\n\\mathcal { A } = 1 - \\frac { \\nabla _ { \\theta } \\mathcal { L } _ { t r a i n } \\cdot \\nabla _ { \\theta } \\mathcal { L } _ { a d v } } { \\left| \\left| \\nabla _ { \\theta } \\mathcal { L } _ { t r a i n } \\right| \\right| \\cdot \\left| \\left| \\nabla _ { \\theta } \\mathcal { L } _ { a d v } \\right| \\right| } ,\n$$",
429
+ "text_format": "latex",
430
+ "bbox": [
431
+ 379,
432
+ 882,
433
+ 619,
434
+ 916
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "equation",
440
+ "img_path": "images/ce4f8b7e10836622cb8f6d1d44468e12dd4aa13070bcfb029b0229461dbe760b.jpg",
441
+ "text": "$$\n\\nabla _ { \\boldsymbol { \\theta } } \\mathcal { L } _ { t r a i n } = \\frac { 1 } { M } \\sum _ { i = 1 } ^ { M } \\nabla _ { \\boldsymbol { \\theta } } \\mathcal { L } \\big ( F ( x _ { i } + \\delta _ { i } ; \\boldsymbol { \\theta } ) , y _ { i } \\big )\n$$",
442
+ "text_format": "latex",
443
+ "bbox": [
444
+ 349,
445
+ 87,
446
+ 647,
447
+ 131
448
+ ],
449
+ "page_idx": 4
450
+ },
451
+ {
452
+ "type": "text",
453
+ "text": "is the training gradient involving the nonzero perturbations. We then estimate the expectation in Equation 3 by calculating the average adversarial loss over $K$ training points from the source class: ",
454
+ "bbox": [
455
+ 171,
456
+ 138,
457
+ 826,
458
+ 167
459
+ ],
460
+ "page_idx": 4
461
+ },
462
+ {
463
+ "type": "equation",
464
+ "img_path": "images/425e2931ddadd2165e2db4a7c237c12ff1740a5195dc4e32fa4d0965d9efdc0c.jpg",
465
+ "text": "$$\n\\nabla _ { \\theta } \\mathcal { L } _ { a d v } = \\frac { 1 } { K } \\sum _ { ( x , y _ { s } ) \\in \\mathcal { T } } \\nabla _ { \\theta } \\bigg ( \\mathcal { L } \\big ( F ( x + p ; \\theta ) , y _ { t } \\big ) \\bigg )\n$$",
466
+ "text_format": "latex",
467
+ "bbox": [
468
+ 334,
469
+ 176,
470
+ 663,
471
+ 219
472
+ ],
473
+ "page_idx": 4
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "In our most basic attack, we begin optimizing the objective in Equation 4 by fixing a parameter vector $\\theta$ used to calculate $\\mathcal { A }$ throughout crafting. This parameter vector is trained on clean data and is used to calculate the training and adversarial gradients. We then optimize using 250 steps of signed Adam. Note that while this is not a general constraint for our method, we follow the setup in Saha et al. [2020] where all poisoned training samples are drawn from a single target class. That is to say, the $M$ poisons the attacker is allowed to perturb have the form $\\{ ( x _ { i } , \\stackrel { \\smile } { y _ { t } } ) \\} _ { i = 1 } ^ { M ^ { - } }$ . ",
478
+ "bbox": [
479
+ 173,
480
+ 228,
481
+ 825,
482
+ 314
483
+ ],
484
+ "page_idx": 4
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "We also employ differentiable data augmentation which has shown to improve stability of poisons in Geiping et al. [2021]. While gradient alignment proves more successful than other approaches to the bilevel problem, we additionally introduce two novel techniques that boost success by $> 2 5 0 \\%$ . In Appendix A.1, we see that these techniques yield significantly better estimates of the adversarial gradients during a victim’s training run: ",
489
+ "bbox": [
490
+ 174,
491
+ 318,
492
+ 825,
493
+ 388
494
+ ],
495
+ "page_idx": 4
496
+ },
497
+ {
498
+ "type": "text",
499
+ "text": "Poison Selection: Our threat model assumes the attacker disseminates perturbed images online through avenues such as social media. With this in mind, the attacker can choose which images to perturb. For example, the attacker could choose images of dogs in which to “hide” the trigger. While random selection with our objective does successfully poison victims trained from scratch, we experiment with selection by gradient norm. Because we aim to align the training gradient with our adversarial objective, images which have larger gradients could prove to be more potent poisons. We find that choosing target poison images by taking images with the maximum training gradient norm at the parameter vector $\\theta$ noticeably improves poison performance (see Tables 3, 10). ",
500
+ "bbox": [
501
+ 173,
502
+ 393,
503
+ 825,
504
+ 506
505
+ ],
506
+ "page_idx": 4
507
+ },
508
+ {
509
+ "type": "text",
510
+ "text": "Model Retraining: In the most straightforward version of our attack, the attacker optimizes the perturbations using fixed model parameters for a number of steps (usually 250). However, this may lead to perturbations overfitting to a clean-trained model; during a real attack, a model is trained on poisoned data, but we optimize the poisons on a model that is trained only with clean data. To close the gap, we introduce model retraining during the poison crafting procedure. After retraining our model on the perturbed data, we again take optimization steps on the perturbations, but this time evaluating the training and adversarial losses at the new parameter vector. We repeat this process of retraining/optimizing several times and find that this noticeably improves the success of the poisons - often boosting success by more than $2 0 \\%$ (see Tables 3, 10, 11). ",
511
+ "bbox": [
512
+ 173,
513
+ 511,
514
+ 825,
515
+ 637
516
+ ],
517
+ "page_idx": 4
518
+ },
519
+ {
520
+ "type": "text",
521
+ "text": "See Appendix A.1 for an empirical evaluation of the importance of poison selection and model retraining for estimating the adversarial gradients of a victim. A brief description of our threat model is found in Algorithm 1. ",
522
+ "bbox": [
523
+ 176,
524
+ 642,
525
+ 823,
526
+ 684
527
+ ],
528
+ "page_idx": 4
529
+ },
530
+ {
531
+ "type": "text",
532
+ "text": "Algorithm 1 Sleeper Agent poison crafting procedure ",
533
+ "text_level": 1,
534
+ "bbox": [
535
+ 178,
536
+ 704,
537
+ 526,
538
+ 719
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "text",
544
+ "text": "Input: Training data $\\mathcal { T } = \\{ ( x _ { i } , y _ { i } ) \\} _ { i = 1 } ^ { N }$ , trigger patch $p$ , source label $y _ { s }$ , target label $y _ { t }$ , poison budget $M \\leq N$ , optimization steps $R$ , retraining factor $T$ ",
545
+ "bbox": [
546
+ 176,
547
+ 724,
548
+ 825,
549
+ 752
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "",
556
+ "text_level": 1,
557
+ "bbox": [
558
+ 173,
559
+ 752,
560
+ 217,
561
+ 763
562
+ ],
563
+ "page_idx": 4
564
+ },
565
+ {
566
+ "type": "text",
567
+ "text": "1: Train surrogate network or ensemble $F ( . ; \\theta )$ on training data $\\tau$ \n2: Select $M$ samples with label $y _ { t }$ from $\\tau$ with highest gradient norm \n3: Randomly initialize perturbations $\\delta _ { i = 1 } ^ { M }$ \n4: for $r = 1 , 2 , \\ldots , R$ optimizations steps do \n5: Compute $\\mathcal { A } ( \\delta , \\theta , p , y _ { t } , y _ { s } )$ and update $\\delta _ { i = 1 } ^ { M }$ with a step of signed Adam \n6: if $r$ mod $\\lfloor R / ( T + 1 ) \\rfloor = 0$ and $r \\neq R$ then \n7: Retrain $F$ on poisoned training data $\\{ ( x _ { i } + \\delta _ { i } , y _ { i } ) \\} _ { i = 1 } ^ { M } \\cup \\{ ( x _ { i } , y _ { i } ) \\} _ { i = M + 1 } ^ { N }$ and update $\\theta$ \n8: end if \n9: end for \n10: return: poison perturbations $\\delta _ { i = 1 } ^ { M }$ ",
568
+ "bbox": [
569
+ 178,
570
+ 762,
571
+ 754,
572
+ 895
573
+ ],
574
+ "page_idx": 4
575
+ },
576
+ {
577
+ "type": "table",
578
+ "img_path": "images/c5e57b6018450414ffc405bf883ee6152a10d484cb759db70b25084b5c8bba4c.jpg",
579
+ "table_caption": [
580
+ "Table 1: Baseline evaluations on CIFAR-10. Perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255, and poison budget is $1 \\%$ of training images. "
581
+ ],
582
+ "table_footnote": [],
583
+ "table_body": "<table><tr><td>Architecture</td><td>ResNet-18</td><td>MobileNetV2</td><td>VGG11</td></tr><tr><td>Clean model val (%)</td><td>92.31 (±0.08)</td><td>88.19 (±0.05)</td><td>89.00 (±0.03)</td></tr><tr><td>Poisoned model val (%)</td><td>92.16 (±0.05)</td><td>88.03 (±0.05)</td><td>88.70 (±0.04)</td></tr><tr><td>Clean model source val (%)</td><td>92.36 (±0.93)</td><td>88.55 (±1.64)</td><td>90.62 (±1.23)</td></tr><tr><td>Poisoned model source val (%)</td><td>91.50 (±0.88)</td><td>87.79 (±1.60)</td><td>89.45 (±1.19)</td></tr><tr><td>Poisoned model patched source val (%)</td><td>12.96 (±5.40)</td><td>21.09 (±5.41)</td><td>17.97 (±4.00)</td></tr><tr><td>Attack Success Rate (%)</td><td>85.27 (±5.90)</td><td>72.92 (±6.09)</td><td>75.15 (±5.40)</td></tr></table>",
584
+ "bbox": [
585
+ 253,
586
+ 122,
587
+ 743,
588
+ 208
589
+ ],
590
+ "page_idx": 5
591
+ },
592
+ {
593
+ "type": "table",
594
+ "img_path": "images/6762ef8a5028414699b2ba8bd3120d9358a061b2a899022e96a5144a7f0b6749.jpg",
595
+ "table_caption": [
596
+ "Table 2: The effect of poison budget. Experiments on CIFAR-10 with ResNet-18 models [He et al., 2016]. Perturbations have $\\ell _ { \\infty }$ -norm $\\leq 1 6 / 2 5 5$ . "
597
+ ],
598
+ "table_footnote": [],
599
+ "table_body": "<table><tr><td>Poison Budget</td><td>50 (0.1%)</td><td>100 (0.2%)</td><td>250 (0.5%)</td><td>400 (0.6%)</td><td>500 (1%)</td></tr><tr><td>Clean model val (%)</td><td>92.34 (±0.05)</td><td>92.36 (±0.04)</td><td>92.31 (±0.04)</td><td>92.15 (±0.08)</td><td>92.31 ( (±0.08)</td></tr><tr><td>Poisoned model val (%)</td><td>92.33 (±0.04)</td><td>92.34 (±0.05)</td><td>92.25 (±0.04)</td><td>92.12 (±0.06)</td><td>92.16( (±0.05)</td></tr><tr><td>Clean model source val (%)</td><td>93.01 (±0.69)</td><td>91.08 (±0.85)</td><td>92.43 (±0.74)</td><td>92.42 (±0.80)</td><td>92.36 (±0.93)</td></tr><tr><td>Poisoned model source val (%)</td><td>93.03 (±0.67)</td><td>90.61 (±0.86)</td><td>91.83 (±0.75)</td><td>91.88 3(±0.79)</td><td>91.50 (±0.88)</td></tr><tr><td>Poisoned model patched source val (%)</td><td>61.04 (±4.27)</td><td>40.07 (±5.72)</td><td>22.77 (±4.77)</td><td>15.88 (±4.91)</td><td>12.96 ( (±5.40)</td></tr><tr><td>Attack Success Rate (%)</td><td>24.71 (±4.10)</td><td>49.76 (±6.21)</td><td>72.48 (±5.24)</td><td>81.44 (±5.25)</td><td>85.27 (±5.90)</td></tr></table>",
600
+ "bbox": [
601
+ 183,
602
+ 257,
603
+ 818,
604
+ 338
605
+ ],
606
+ "page_idx": 5
607
+ },
608
+ {
609
+ "type": "text",
610
+ "text": "4 Experiments ",
611
+ "text_level": 1,
612
+ "bbox": [
613
+ 174,
614
+ 363,
615
+ 312,
616
+ 380
617
+ ],
618
+ "page_idx": 5
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "In this section, we empirically test the proposed Sleeper Agent backdoor attack on multiple datasets, against black-box settings, using an existing benchmark, and against popular defenses. Details regarding the experimental setup can be found in Appendix B. ",
623
+ "bbox": [
624
+ 174,
625
+ 396,
626
+ 825,
627
+ 438
628
+ ],
629
+ "page_idx": 5
630
+ },
631
+ {
632
+ "type": "text",
633
+ "text": "4.1 Baseline Evaluations ",
634
+ "text_level": 1,
635
+ "bbox": [
636
+ 174,
637
+ 457,
638
+ 356,
639
+ 472
640
+ ],
641
+ "page_idx": 5
642
+ },
643
+ {
644
+ "type": "text",
645
+ "text": "Typically, backdoor attacks are considered successful if poisoned models do not suffer from a significant drop in validation accuracy on images without triggers, but they reliably misclassify images from the source class into the target class when a trigger is applied. We begin by testing our method in the gray-box setting. In the gray-box setting, we use the same architecture but different random initialization for crafting poisons and testing. Table 1 depicts the performance of Sleeper Agent on CIFAR-10 when perturbing $1 \\%$ of images in the training set with each perturbation constrained in an $\\ell _ { \\infty }$ -norm ball of radius 16/255. During poison crafting, the surrogate model undergoes four evenly spaced retraining periods $T = 4 ,$ ), and we test the effectiveness of each surrogate model architecture at generating poisons for victim models of the same architecture. In subsequent sections, we will extend these experiments to the black-box setting and to an ensemblized attacker. We observe in these experiments that the poisoned models indeed achieve very similar validation accuracy to their clean counterparts, yet the application of triggers to source class images causes them to be misclassified into the target class as desired. In Table 2, we observe that Sleeper Agent can even be effective when the attacker is only able to poison a very small percentage of the training set. Note that the success of backdoor attacks depends greatly on the choice of source and target classes, especially since some classes contain very large objects which may dominate the image, even when a trigger is inserted. As a result, the variance of attack performance is high since we sample class pairs randomly. The poisoning and victim hyperparameters we use for our experiments can be found in Appendix B. ",
646
+ "bbox": [
647
+ 174,
648
+ 483,
649
+ 825,
650
+ 746
651
+ ],
652
+ "page_idx": 5
653
+ },
654
+ {
655
+ "type": "text",
656
+ "text": "The benefits of ensembling: One simple way we can improve the transferability of our backdoor attack across initializations of the same architecture is to craft our poisons on an ensemble of multiple copies of the same architecture but trained using different initializations and different batch sampling during their training procedures. This behavior has also been observed in Huang et al. [2020b], Geiping et al. [2021]. In Table 3, we observe that this ensembling strategy indeed can offer significant performance boosts, both with and without retraining. ",
657
+ "bbox": [
658
+ 174,
659
+ 752,
660
+ 825,
661
+ 835
662
+ ],
663
+ "page_idx": 5
664
+ },
665
+ {
666
+ "type": "text",
667
+ "text": "The black-box setting: Now that we have established the transferability of Sleeper Agent across models of the same architecture, we test on the hard black-box scenario where the victim’s architecture is completely unknown to the attacker. This setting has proven extremely challenging for existing methods [Schwarzschild et al., 2021]. Table 4 contains four settings. In the first row, we simply craft the poisons on a single ResNet-18 and transfer these to other models. Second, we craft poisons ",
668
+ "bbox": [
669
+ 174,
670
+ 842,
671
+ 823,
672
+ 911
673
+ ],
674
+ "page_idx": 5
675
+ },
676
+ {
677
+ "type": "table",
678
+ "img_path": "images/02951747a0f4d6d489968984c76f8cd8d3be0fcb1165c1eeedca3fc71ad8ec95.jpg",
679
+ "table_caption": [
680
+ "Table 3: Ensembles consisting of copies of the same architecture (ResNet-18). $S$ denotes the size of the ensemble, and $T$ denotes the retraining factor. Experiments are conducted on CIFAR-10, perturbations have $\\ell _ { \\infty }$ -norm bounded by 16/255, and the attacker can poison $1 \\%$ of training images. "
681
+ ],
682
+ "table_footnote": [],
683
+ "table_body": "<table><tr><td>Attack</td><td>Clean model val (%)</td><td>Poisoned model val (%)</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T= 0)</td><td>92.36 (±0.05)</td><td>92.08 (±0.08)</td><td>63.49 (±6.13)</td></tr><tr><td>Sleper Agent (S= 2,T= 0)</td><td>92.10 (±0.04)</td><td>92.12 (±0.06)</td><td>64.70 (±5.65)</td></tr><tr><td>Sleeper Agent (S=4,T= 0)</td><td>92.14 (±0.03)</td><td>91.98( (±0.05)</td><td>74.81 (±4.10)</td></tr><tr><td>Sleeper Agent (S=2,T=4)</td><td>92.11 (±0.07)</td><td>92.08 (±0.13)</td><td>87.40 (±6.23)</td></tr><tr><td>Sleeper Agent (S=4,T=4)</td><td>92.17 (±0.03)</td><td>91.81 (±0.06)</td><td>88.45 (±6.00)</td></tr></table>",
684
+ "bbox": [
685
+ 186,
686
+ 137,
687
+ 810,
688
+ 215
689
+ ],
690
+ "page_idx": 6
691
+ },
692
+ {
693
+ "type": "text",
694
+ "text": "Table 4: Black-box attacks: First row: Attacks crafted on a single ResNet-18 and transferred. Second row: attacks crafted on MobileNet-V2 and ResNet-34 and transferred. Third row: attacks crafted on the remaining architectures excluding the victim. The ensemble used in the last row includes the victim architecture. Experiments are conducted on CIFAR-10 and perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255, and the attacker can poison $1 \\%$ of training images. ",
695
+ "bbox": [
696
+ 174,
697
+ 228,
698
+ 825,
699
+ 299
700
+ ],
701
+ "page_idx": 6
702
+ },
703
+ {
704
+ "type": "table",
705
+ "img_path": "images/a15d5beed3ec78a2e540a1db22822d11fbf4183aabdc162bac238984663d2460.jpg",
706
+ "table_caption": [],
707
+ "table_footnote": [],
708
+ "table_body": "<table><tr><td>Attack</td><td>ResNet-18</td><td>MobileNet-V2</td><td>VGG11</td><td>Average</td></tr><tr><td>Sleeper Agent (S=1,T=4,ResNet-18)</td><td></td><td>29.10%</td><td>31.96%</td><td>29.86%</td></tr><tr><td>Sleeper Agent (S=4,T=0,MobileNet-V2,ResNet-34)</td><td>70.30%</td><td></td><td>46.48%</td><td>58.44%</td></tr><tr><td>Sleeper Agent (S=4,T=0,victim excluded)</td><td>63.11%</td><td>42.40%</td><td>55.28%</td><td>53.60%</td></tr><tr><td>Sleeper Agent (S=6,T= 0,victim included)</td><td>68.46%</td><td>67.28%</td><td>85.37%</td><td>73.30%</td></tr></table>",
709
+ "bbox": [
710
+ 191,
711
+ 304,
712
+ 812,
713
+ 372
714
+ ],
715
+ "page_idx": 6
716
+ },
717
+ {
718
+ "type": "text",
719
+ "text": "on an ensemble consisting of two MobileNet-V2 and two ResNet-34 architectures and transfer to the remaining models. Third, for each architecture, we craft poisons with an ensemble consisting of the other two architectures and test on the remaining one. The second and third scenarios are ensemblized black-box attacks, and we see that Sleeper Agent is effective. In the last row, we perform the same experiment but with the testing model included in the ensemble, and we observe that a single ensemble can craft poisons that are extremely effective on a range of architectures. We choose ResNet-18, MobileNet-V2, and VGG11 as these are common and contain a wide array of structural diversity [He et al., 2016, Sandler et al., 2018, Simonyan and Zisserman, 2014]. Additionally, Guo and Liu [2020] considers the case that the attacker uses a weaker surrogate than the defender’s model. We simulate this case by using a VGG11 surrogate and ResNet-18 target. We find, with a $1 \\%$ poison budget on CIFAR-10, that Sleeper Agent achieves an attack success rate of $5 7 . 4 7 \\%$ . ",
720
+ "bbox": [
721
+ 173,
722
+ 397,
723
+ 825,
724
+ 550
725
+ ],
726
+ "page_idx": 6
727
+ },
728
+ {
729
+ "type": "text",
730
+ "text": "ImageNet evaluations: In addition to CIFAR-10, we perform experiments on ImageNet. Table 5 summarizes the performance of Sleeper Agent on ImageNet where attacks are crafted and tested on ResNet-18 and MobileNetV2 models. Each attacker can only perturb $0 . 0 5 \\%$ of training images, and perturbations are constrained in an $\\ell _ { \\infty }$ -norm ball of radius 16/255 - a bound seen in prior poisoning works on ImageNet [Fowl et al., 2021a, Geiping et al., 2021, Saha et al., 2020]. To have a strong threat model, we use the retraining factor of two $T = 2 ,$ ) so that the surrogate model is retrained at two evenly spaced intervals. Figure 1b contains visualizations of the patched sources and the crafted poisons. The details of models and hyperparameters can be found in Appendix B. Additional experiments on ImageNet and further visualizations are presented in Appendices A and C. ",
731
+ "bbox": [
732
+ 173,
733
+ 555,
734
+ 825,
735
+ 681
736
+ ],
737
+ "page_idx": 6
738
+ },
739
+ {
740
+ "type": "text",
741
+ "text": "4.2 Comparison to Other Methods ",
742
+ "text_level": 1,
743
+ "bbox": [
744
+ 176,
745
+ 696,
746
+ 428,
747
+ 713
748
+ ],
749
+ "page_idx": 6
750
+ },
751
+ {
752
+ "type": "text",
753
+ "text": "There are several existing clean-label hidden-trigger backdoor attacks that claim success in settings different than ours. In order to further demonstrate the success of our method, we compare our poisons to ones generated from these methods in our strict threat model of from-scratch training. In these experiments, poisons are generated by our attack, clean label backdoor, and hidden trigger backdoor. All poison trials have the same randomly selected source-target class pairs, the same budget, and the same $\\varepsilon$ -bound (Note: clean-label backdoor originally did not use $\\ell _ { \\infty }$ bounds, so we adjust the opacity of their perturbations to ensure the constraint is satisfied). We then train a randomly initialized network from scratch on these poisons and evaluate success over 1000 patched source images. We test three popular architectures and find that our attack significantly outperforms both methods and is the only backdoor method to exceed single digit success rates, confirming the findings of Schwarzschild et al. [2021] on the fragility of these existing methods. See Table 6 for full results. ",
754
+ "bbox": [
755
+ 174,
756
+ 723,
757
+ 825,
758
+ 792
759
+ ],
760
+ "page_idx": 6
761
+ },
762
+ {
763
+ "type": "table",
764
+ "img_path": "images/b0009d80aefaf5d150e6d7369c8a70581775dfe6c224a34e23e79b80fe4ee99e.jpg",
765
+ "table_caption": [
766
+ "Table 5: ImageNet evaluations. Perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255, and the poison budget is $0 . 0 5 \\%$ of training images. "
767
+ ],
768
+ "table_footnote": [],
769
+ "table_body": "<table><tr><td>Architecture</td><td>ResNet-18</td><td>MobileNetV2</td></tr><tr><td>Clean model val (%)</td><td>69.76</td><td>71.88</td></tr><tr><td>Poisoned model val (%)</td><td>67.84 (±0.10)</td><td>68.60 (±0.03)</td></tr><tr><td>Attack Success Rate (%)</td><td>44.00 (±6.73)</td><td>41.00 (±3.31)</td></tr></table>",
770
+ "bbox": [
771
+ 316,
772
+ 852,
773
+ 676,
774
+ 909
775
+ ],
776
+ "page_idx": 6
777
+ },
778
+ {
779
+ "type": "table",
780
+ "img_path": "images/dde900e8d86349702cfee691ce47650309cc762540ff62125f8cba07734fbb12.jpg",
781
+ "table_caption": [
782
+ "Table 6: Benchmark results on CIFAR-10. Comparison of our method to popular “clean-label” attacks. Results averaged over the same source/target pairs with $\\epsilon = 1 6 / 2 5 5$ and poison budget $1 \\%$ . "
783
+ ],
784
+ "table_footnote": [],
785
+ "table_body": "<table><tr><td>Attack</td><td>ResNet-18</td><td>MobileNetV2</td><td>VGG11</td><td>Average</td></tr><tr><td>Hidden-TriggerBackdoor[Saha etal.,2020]</td><td>3.50%</td><td>3.76%</td><td>5.02%</td><td>4.09%</td></tr><tr><td>Clean-Label Backdoor [Turner et al., 2019]</td><td>2.78%</td><td>3.50%</td><td>4.70%</td><td>3.66%</td></tr><tr><td>Sleeper Agent (Ours)</td><td>78.84%</td><td>75.96%</td><td>86.60%</td><td>80.47%</td></tr></table>",
786
+ "bbox": [
787
+ 207,
788
+ 122,
789
+ 792,
790
+ 183
791
+ ],
792
+ "page_idx": 7
793
+ },
794
+ {
795
+ "type": "text",
796
+ "text": "",
797
+ "bbox": [
798
+ 174,
799
+ 231,
800
+ 825,
801
+ 315
802
+ ],
803
+ "page_idx": 7
804
+ },
805
+ {
806
+ "type": "text",
807
+ "text": "4.3 Defenses ",
808
+ "text_level": 1,
809
+ "bbox": [
810
+ 174,
811
+ 357,
812
+ 272,
813
+ 372
814
+ ],
815
+ "page_idx": 7
816
+ },
817
+ {
818
+ "type": "text",
819
+ "text": "A selling point for hidden trigger backdoor attacks is that the trigger that is used to induce misclassification at test-time is not present in any training data, thus making inspection based defenses, or automated pattern matching more difficult. However, there exist numerous defenses, aside from visual inspection, that have been proposed to mitigate the effects of poisoning - both backdoor and other attacks. We test our method against a number of popular defenses. ",
820
+ "bbox": [
821
+ 174,
822
+ 393,
823
+ 825,
824
+ 463
825
+ ],
826
+ "page_idx": 7
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "Spectral Signatures: This defense, proposed in Tran et al. [2018], aims to filter a pre-selected amount of training data based upon correlations with singular vectors of the feature covariance matrix. This defense was originally intended to detect triggers used in backdoor attacks. ",
831
+ "bbox": [
832
+ 174,
833
+ 469,
834
+ 826,
835
+ 512
836
+ ],
837
+ "page_idx": 7
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "Activation Clustering: Chen et al. [2019] clusters activation patterns to detect anomalous inputs. \nUnlike the spectral signatures defense, this defense does not filter a pre-selected volume of data. ",
842
+ "bbox": [
843
+ 173,
844
+ 517,
845
+ 823,
846
+ 546
847
+ ],
848
+ "page_idx": 7
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "DPSGD: Poison defenses based on differentially private SGD [Abadi et al., 2016] have also been proposed [Hong et al., 2020]. Differentially private learning inures models to small changes in training data, which provably imbues robustness to poisoned data. ",
853
+ "bbox": [
854
+ 176,
855
+ 551,
856
+ 820,
857
+ 594
858
+ ],
859
+ "page_idx": 7
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "Data Augmentations: Recent work has suggested that strong data augmentations, such as mixup, break data poisoning [Borgnia et al., 2021]. This has been confirmed in recent benchmark tests which demonstrate many poisoning techniques are brittle to slight changes in victim training routine [Schwarzschild et al., 2021]. We test against mixup augmentation [Zhang et al., 2018]. ",
864
+ "bbox": [
865
+ 174,
866
+ 601,
867
+ 825,
868
+ 656
869
+ ],
870
+ "page_idx": 7
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "STRIP: Gao et al. [2019] proposes to add strong perturbations by superimposing input images at test time to detect the backdoored inputs based on the entropy of the predicted class distribution. If the entropy is lower than a predefined threshold, the input is considered backdoored and is rejected. ",
875
+ "bbox": [
876
+ 174,
877
+ 662,
878
+ 825,
879
+ 704
880
+ ],
881
+ "page_idx": 7
882
+ },
883
+ {
884
+ "type": "text",
885
+ "text": "NeuralCleanse: Wang et al. [2019] proposes a defense designed for traditional backdoor attacks by reconstructing the maximally adversarial trigger used to backdoor a model. While this defense was not designed for hidden trigger backdoor attacks, we experiment with this as a detection defense wherein we test whether NeuralCleanse can detect the backdoored class. This modification is denoted by NeuralCleanse\\*. In our trials, NeuralCleanse\\* does not successfully detect any of the backdoored classes - as determined by taking the maximum mask MAD (see Wang et al. [2019]). Neural Cleanse does not produce an anomaly score $> 2$ (their characterization of detecting outliers) for the backdoored class in any of our experiments. ",
886
+ "bbox": [
887
+ 173,
888
+ 710,
889
+ 825,
890
+ 821
891
+ ],
892
+ "page_idx": 7
893
+ },
894
+ {
895
+ "type": "text",
896
+ "text": "We find that across the board, all of these defenses exhibit a robustness-accuracy trade-off. Many of these defenses do not reliably nullify the attack, and defenses that do degrade attack success also induce such a large drop in validation accuracy that they are unattractive options for practitioners. For example, to lower the attack success to an average of $1 3 . 1 4 \\%$ , training with DPSGD degrades natural accuracy on CIFAR-10 to $7 0 \\%$ . See Table 7 for the complete results of these experiments. Additional evaluations on recent defenses are presented in Appendix A.6. ",
897
+ "bbox": [
898
+ 174,
899
+ 827,
900
+ 825,
901
+ 911
902
+ ],
903
+ "page_idx": 7
904
+ },
905
+ {
906
+ "type": "table",
907
+ "img_path": "images/78c490ccd010296ad6446fb20d7b14a842bbc175299e0dd823f1e68512fe8f29.jpg",
908
+ "table_caption": [
909
+ "Table 7: Defenses. Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255, and poison budget is $1 \\%$ of training images. "
910
+ ],
911
+ "table_footnote": [],
912
+ "table_body": "<table><tr><td>Defense</td><td>Attack Success Rate (%)</td><td>Validation Accuracy (%)</td></tr><tr><td>Spectral Signatures</td><td>37.17 (±10.10)</td><td>89.94 (±0.19)</td></tr><tr><td>Activation Clustering</td><td>15.17 (±5.38)</td><td>72.38 (±0.48)</td></tr><tr><td>DPSGD</td><td>13.14 (±4.49)</td><td>70.00 (±0.17)</td></tr><tr><td>Data Augmentation</td><td>69.75 (±10.77)</td><td>91.32 (±0.12)</td></tr><tr><td>STRIP</td><td>62.68 (±4.90)</td><td>92.23 (±0.05)</td></tr><tr><td>NeuralCleanse*</td><td>85.27 (±5.90)</td><td>92.31 (±0.08)</td></tr></table>",
913
+ "bbox": [
914
+ 269,
915
+ 123,
916
+ 727,
917
+ 215
918
+ ],
919
+ "page_idx": 8
920
+ },
921
+ {
922
+ "type": "table",
923
+ "img_path": "images/81ad0b80d310b0e3f97409f793096ef67acb5dfb19af6c8b24ce64e565c22af8.jpg",
924
+ "table_caption": [
925
+ "Table 8: Random poisons. Experiments are conducted on CIFAR-10 with ResNet-18 models. Perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255 and poisons are drawn from all classes. "
926
+ ],
927
+ "table_footnote": [],
928
+ "table_body": "<table><tr><td>Attack</td><td>Poison budget</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T= 4)</td><td>1%</td><td>41.90 (±7.16)</td></tr><tr><td>Sleeper Agent (S= 1,T= 4)</td><td>3%</td><td>66.51 (±6.90)</td></tr></table>",
929
+ "bbox": [
930
+ 269,
931
+ 270,
932
+ 723,
933
+ 318
934
+ ],
935
+ "page_idx": 8
936
+ },
937
+ {
938
+ "type": "text",
939
+ "text": "4.4 Sleeper Agent Can Poison Images in Any Class ",
940
+ "text_level": 1,
941
+ "bbox": [
942
+ 173,
943
+ 348,
944
+ 539,
945
+ 364
946
+ ],
947
+ "page_idx": 8
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "Typical backdoor attacks which rely on label flips or feature collisions can only function when poisons come from the source and/or target classes [Saha et al., 2020, Turner et al., 2019]. This restriction may be a serious limitation in practice. In contrast, we show that Sleeper Agent can be effective even when we poison images drawn from all classes. To take advantage of our data selection strategy, we select poisons with maximum gradient norm across all classes. Table 8 contains the performance of Sleeper Agent in the aforementioned setting. ",
952
+ "bbox": [
953
+ 173,
954
+ 377,
955
+ 825,
956
+ 462
957
+ ],
958
+ "page_idx": 8
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "4.5 Evaluations Under Hard $\\ell _ { \\infty }$ -norm Constraints ",
963
+ "text_level": 1,
964
+ "bbox": [
965
+ 174,
966
+ 484,
967
+ 539,
968
+ 501
969
+ ],
970
+ "page_idx": 8
971
+ },
972
+ {
973
+ "type": "text",
974
+ "text": "While existing works on backdoor attacks consider poisons with $\\ell _ { \\infty }$ -norm bounded above by 16/255 as an imperceptible threat [Saha et al., 2020, Turner et al., 2019], Nguyen and Tran [2020] shows that human inspection can detect poisoned samples effectively. This inspection might mitigate the threat of large perturbations. To bypass this possibility, we conduct our baseline experiments on CIFAR-10 using perturbations with small $\\ell _ { \\infty }$ -norms. From Table 9, we observe that our threat model is effective even with an $\\ell _ { \\infty }$ -norm bounded above by 8/255. Visualizations can be found in Appendix C. ",
975
+ "bbox": [
976
+ 173,
977
+ 513,
978
+ 825,
979
+ 598
980
+ ],
981
+ "page_idx": 8
982
+ },
983
+ {
984
+ "type": "text",
985
+ "text": "4.6 Ablation Studies ",
986
+ "text_level": 1,
987
+ "bbox": [
988
+ 174,
989
+ 622,
990
+ 328,
991
+ 637
992
+ ],
993
+ "page_idx": 8
994
+ },
995
+ {
996
+ "type": "text",
997
+ "text": "Here, we analyze the importance of each technique in our algorithm via ablation studies. We focus on three aspects of our method: 1) patch location, 2) retraining during poison crafting, 3) poison selection, and 4) retraining factor. Table 10 details the combinations and their effects on poison success. We find that randomizing patch location improves poisoning success, and both retraining and data selection based on maximum gradient significantly improve poison performance. Combining all three boosts poison success more than four-fold. To further show the importance of retraining, we conduct more experiments with and without retraining on ImageNet. From Table 11, we infer that retraining is essential. Additional ablations studies are found in Appendix A. ",
998
+ "bbox": [
999
+ 173,
1000
+ 650,
1001
+ 825,
1002
+ 762
1003
+ ],
1004
+ "page_idx": 8
1005
+ },
1006
+ {
1007
+ "type": "table",
1008
+ "img_path": "images/5e3300696fde5fc7e08e4805823988e4510fa93831723c9605a500e168081d1c.jpg",
1009
+ "table_caption": [
1010
+ "Table 9: Evaluation under different $\\ell _ { \\infty }$ -norm. Experiments are conducted on CIFAR-10 with ResNet-18 models, and the poison budget is $1 \\%$ of training images. "
1011
+ ],
1012
+ "table_footnote": [],
1013
+ "table_body": "<table><tr><td>Perturbation loo-norm</td><td>Attack Success Rate(%)</td></tr><tr><td>8/255</td><td>37.32 (±8.33)</td></tr><tr><td>10/255</td><td>55.75 (±8.12)</td></tr><tr><td>12/255</td><td>63.31 (±8.84)</td></tr><tr><td>14/255</td><td>78.03 (±7.13)</td></tr><tr><td>16/255</td><td>85.27 (±5.90)</td></tr></table>",
1014
+ "bbox": [
1015
+ 334,
1016
+ 827,
1017
+ 661,
1018
+ 911
1019
+ ],
1020
+ "page_idx": 8
1021
+ },
1022
+ {
1023
+ "type": "table",
1024
+ "img_path": "images/1bde949ac466f688e64ba01029ca8a4a2fb946968cf390613ebed892ff575a6d.jpg",
1025
+ "table_caption": [
1026
+ "Table 10: CIFAR-10 ablation studies. Investigation of the effects of random patch-location, retraining, and data selection. Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255, and poison budget is $1 \\%$ of training images. "
1027
+ ],
1028
+ "table_footnote": [],
1029
+ "table_body": "<table><tr><td>Attack setup</td><td>Attack Success Rate (%)</td></tr><tr><td>Fix patch-location (bottom-right corner)</td><td>19.25 (±3.01)</td></tr><tr><td>Random patch-location</td><td>33.95 (±4.57)</td></tr><tr><td>Random patch-location +retraining</td><td>59.42 (±5.78)</td></tr><tr><td>Randompatch-location+ data selection</td><td>63.49 (±6.13)</td></tr><tr><td>Random patch-location + retraining +data selection</td><td>85.27 (±5.90)</td></tr></table>",
1030
+ "bbox": [
1031
+ 253,
1032
+ 137,
1033
+ 743,
1034
+ 222
1035
+ ],
1036
+ "page_idx": 9
1037
+ },
1038
+ {
1039
+ "type": "table",
1040
+ "img_path": "images/bfda4c564936f860a49d86f45b4dc8fe96b6e3827680ac5baab1a36a313572ed.jpg",
1041
+ "table_caption": [
1042
+ "Table 11: ImageNet ablation studies. Perturbations have $\\ell _ { \\infty }$ -norm bounded above by 16/255, and the poison budget is $0 . 0 5 \\%$ of training images. "
1043
+ ],
1044
+ "table_footnote": [],
1045
+ "table_body": "<table><tr><td>Attack</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T= O)</td><td>22.00 (±5.65)</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>44.00 (±6.73)</td></tr></table>",
1046
+ "bbox": [
1047
+ 334,
1048
+ 270,
1049
+ 661,
1050
+ 314
1051
+ ],
1052
+ "page_idx": 9
1053
+ },
1054
+ {
1055
+ "type": "text",
1056
+ "text": "5 Broader Impact and Limitations ",
1057
+ "text_level": 1,
1058
+ "bbox": [
1059
+ 173,
1060
+ 337,
1061
+ 478,
1062
+ 354
1063
+ ],
1064
+ "page_idx": 9
1065
+ },
1066
+ {
1067
+ "type": "text",
1068
+ "text": "In this work, we illuminate a new scalable backdoor attack that could be used to stealthily compromise security-critical systems. We hope that by highlighting the potential danger of this nefarious threat model, our work will give rise to stronger defenses and will encourage caution on the part of practitioners. ",
1069
+ "bbox": [
1070
+ 174,
1071
+ 369,
1072
+ 825,
1073
+ 424
1074
+ ],
1075
+ "page_idx": 9
1076
+ },
1077
+ {
1078
+ "type": "text",
1079
+ "text": "While on average, our method is effective, the variance is large, and the success of our method can range from almost all patched images being misclassified to low success. This behavior has previously been observed in Schwarzschild et al. [2021]. In real-world scenarios, datasets are often noisy and imbalanced, so training behavior may be mysterious. As a result, practitioners should be cautious in their expectations that methods developed on datasets like CIFAR-10 and ImageNet will work on their own problems. ",
1080
+ "bbox": [
1081
+ 174,
1082
+ 431,
1083
+ 825,
1084
+ 515
1085
+ ],
1086
+ "page_idx": 9
1087
+ },
1088
+ {
1089
+ "type": "text",
1090
+ "text": "6 Conclusion ",
1091
+ "text_level": 1,
1092
+ "bbox": [
1093
+ 174,
1094
+ 535,
1095
+ 299,
1096
+ 551
1097
+ ],
1098
+ "page_idx": 9
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "In this work, we present the first hidden-trigger backdoor attack that is effective against deep networks trained from scratch. This is a challenging setting for backdoor attacks, and existing attacks typically operate in less strict settings. Nonetheless, we choose the strict setting because practitioners often train networks from scratch in real-world applications, and patched poisons may be easily visible upon human inspection. In order to accomplish the above goal, we use a gradient matching objective as a surrogate for the bilevel optimization problem, and we add features such as re-training and data selection in order to significantly enhance the performance of our method, Sleeper Agent. ",
1103
+ "bbox": [
1104
+ 174,
1105
+ 566,
1106
+ 825,
1107
+ 664
1108
+ ],
1109
+ "page_idx": 9
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "Acknowledgements ",
1114
+ "text_level": 1,
1115
+ "bbox": [
1116
+ 176,
1117
+ 684,
1118
+ 338,
1119
+ 700
1120
+ ],
1121
+ "page_idx": 9
1122
+ },
1123
+ {
1124
+ "type": "text",
1125
+ "text": "This work was supported by DARPA GARD under contracts #HR00112020007 and HR001119S0026- GARD-FP-052, the DARPA YFA program, the ONR MURI Program under the Grant N00014-20- 1-2787, and the National Science Foundation DMS program. Further support was provided by JP Morgan Chase and Capital One Bank. ",
1126
+ "bbox": [
1127
+ 174,
1128
+ 715,
1129
+ 826,
1130
+ 771
1131
+ ],
1132
+ "page_idx": 9
1133
+ },
1134
+ {
1135
+ "type": "text",
1136
+ "text": "References ",
1137
+ "text_level": 1,
1138
+ "bbox": [
1139
+ 174,
1140
+ 791,
1141
+ 267,
1142
+ 808
1143
+ ],
1144
+ "page_idx": 9
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pages 308–318, 2016. ",
1149
+ "bbox": [
1150
+ 178,
1151
+ 815,
1152
+ 823,
1153
+ 859
1154
+ ],
1155
+ "page_idx": 9
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "Eugene Bagdasaryan, Andreas Veit, Yiqing Hua, Deborah Estrin, and Vitaly Shmatikov. How to backdoor federated learning. In International Conference on Artificial Intelligence and Statistics, pages 2938–2948. PMLR, 2020. ",
1160
+ "bbox": [
1161
+ 174,
1162
+ 868,
1163
+ 825,
1164
+ 911
1165
+ ],
1166
+ "page_idx": 9
1167
+ },
1168
+ {
1169
+ "type": "text",
1170
+ "text": "Mauro Barni, Kassem Kallas, and Benedetta Tondi. A new backdoor attack in cnns by training set corruption without label poisoning. In 2019 IEEE International Conference on Image Processing (ICIP), pages 101–105. IEEE, 2019. ",
1171
+ "bbox": [
1172
+ 174,
1173
+ 90,
1174
+ 825,
1175
+ 133
1176
+ ],
1177
+ "page_idx": 10
1178
+ },
1179
+ {
1180
+ "type": "text",
1181
+ "text": "Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1467–1474, 2012. ",
1182
+ "bbox": [
1183
+ 176,
1184
+ 142,
1185
+ 823,
1186
+ 185
1187
+ ],
1188
+ "page_idx": 10
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "text": "Eitan Borgnia, Jonas Geiping, Valeriia Cherepanova, Liam Fowl, Arjun Gupta, Amin Ghiasi, Furong Huang, Micah Goldblum, and Tom Goldstein. Dp-instahide: Provably defusing poisoning and backdoor attacks with differentially private data augmentations. arXiv preprint arXiv:2103.02079, 2021. ",
1193
+ "bbox": [
1194
+ 173,
1195
+ 193,
1196
+ 826,
1197
+ 250
1198
+ ],
1199
+ "page_idx": 10
1200
+ },
1201
+ {
1202
+ "type": "text",
1203
+ "text": "Bryant Chen, Wilka Carvalho, Nathalie Baracaldo, Heiko Ludwig, Benjamin Edwards, Taesung Lee, Ian Molloy, and Biplav Srivastava. Detecting backdoor attacks on deep neural networks by activation clustering. In SafeAI@ AAAI, 2019. ",
1204
+ "bbox": [
1205
+ 173,
1206
+ 258,
1207
+ 825,
1208
+ 301
1209
+ ],
1210
+ "page_idx": 10
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017. ",
1215
+ "bbox": [
1216
+ 173,
1217
+ 309,
1218
+ 821,
1219
+ 339
1220
+ ],
1221
+ "page_idx": 10
1222
+ },
1223
+ {
1224
+ "type": "text",
1225
+ "text": "Ji Feng, Qi-Zhi Cai, and Zhi-Hua Zhou. Learning to confuse: generating training time adversarial data with auto-encoder. Advances in Neural Information Processing Systems, 32, 2019. ",
1226
+ "bbox": [
1227
+ 173,
1228
+ 347,
1229
+ 823,
1230
+ 376
1231
+ ],
1232
+ "page_idx": 10
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "text": "Liam Fowl, Ping-yeh Chiang, Micah Goldblum, Jonas Geiping, Arpit Bansal, Wojtek Czaja, and Tom Goldstein. Preventing unauthorized use of proprietary data: Poisoning for secure dataset release. arXiv preprint arXiv:2103.02683, 2021a. ",
1237
+ "bbox": [
1238
+ 173,
1239
+ 383,
1240
+ 826,
1241
+ 426
1242
+ ],
1243
+ "page_idx": 10
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "text": "Liam Fowl, Micah Goldblum, Ping-yeh Chiang, Jonas Geiping, Wojciech Czaja, and Tom Goldstein. Adversarial examples make strong poisons. Advances in Neural Information Processing Systems, 34:30339–30351, 2021b. ",
1248
+ "bbox": [
1249
+ 173,
1250
+ 435,
1251
+ 826,
1252
+ 478
1253
+ ],
1254
+ "page_idx": 10
1255
+ },
1256
+ {
1257
+ "type": "text",
1258
+ "text": "Yansong Gao, Change Xu, Derui Wang, Shiping Chen, Damith C Ranasinghe, and Surya Nepal. Strip: A defence against trojan attacks on deep neural networks. In Proceedings of the 35th Annual Computer Security Applications Conference, pages 113–125, 2019. ",
1259
+ "bbox": [
1260
+ 174,
1261
+ 486,
1262
+ 826,
1263
+ 530
1264
+ ],
1265
+ "page_idx": 10
1266
+ },
1267
+ {
1268
+ "type": "text",
1269
+ "text": "Jonas Geiping, Liam Fowl, W Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches’ brew: Industrial scale data poisoning via gradient matching. ICLR, 2021. ",
1270
+ "bbox": [
1271
+ 171,
1272
+ 537,
1273
+ 826,
1274
+ 568
1275
+ ],
1276
+ "page_idx": 10
1277
+ },
1278
+ {
1279
+ "type": "text",
1280
+ "text": "Micah Goldblum, Dimitris Tsipras, Chulin Xie, Xinyun Chen, Avi Schwarzschild, Dawn Song, Aleksander Madry, Bo Li, and Tom Goldstein. Dataset security for machine learning: Data poisoning, backdoor attacks, and defenses. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. ",
1281
+ "bbox": [
1282
+ 173,
1283
+ 575,
1284
+ 826,
1285
+ 632
1286
+ ],
1287
+ "page_idx": 10
1288
+ },
1289
+ {
1290
+ "type": "text",
1291
+ "text": "Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017. ",
1292
+ "bbox": [
1293
+ 169,
1294
+ 640,
1295
+ 823,
1296
+ 670
1297
+ ],
1298
+ "page_idx": 10
1299
+ },
1300
+ {
1301
+ "type": "text",
1302
+ "text": "Junfeng Guo and Cong Liu. Practical poisoning attacks on neural networks. In European Conference on Computer Vision, pages 142–158. Springer, 2020. ",
1303
+ "bbox": [
1304
+ 171,
1305
+ 678,
1306
+ 823,
1307
+ 707
1308
+ ],
1309
+ "page_idx": 10
1310
+ },
1311
+ {
1312
+ "type": "text",
1313
+ "text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. ",
1314
+ "bbox": [
1315
+ 173,
1316
+ 714,
1317
+ 826,
1318
+ 758
1319
+ ],
1320
+ "page_idx": 10
1321
+ },
1322
+ {
1323
+ "type": "text",
1324
+ "text": "Sanghyun Hong, Varun Chandrasekaran, Yigitcan Kaya, Tudor Dumitra¸s, and Nicolas Papernot. ˘ On the effectiveness of mitigating data poisoning attacks with gradient shaping. arXiv preprint arXiv:2002.11497, 2020. ",
1325
+ "bbox": [
1326
+ 173,
1327
+ 766,
1328
+ 825,
1329
+ 809
1330
+ ],
1331
+ "page_idx": 10
1332
+ },
1333
+ {
1334
+ "type": "text",
1335
+ "text": "Hanxun Huang, Xingjun Ma, Sarah Monazam Erfani, James Bailey, and Yisen Wang. Unlearnable examples: Making personal data unexploitable. In International Conference on Learning Representations, 2020a. ",
1336
+ "bbox": [
1337
+ 171,
1338
+ 818,
1339
+ 823,
1340
+ 861
1341
+ ],
1342
+ "page_idx": 10
1343
+ },
1344
+ {
1345
+ "type": "text",
1346
+ "text": "W Ronny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. Metapoison: Practical general-purpose clean-label data poisoning. Advances in Neural Information Processing Systems, 33:12080–12091, 2020b. ",
1347
+ "bbox": [
1348
+ 174,
1349
+ 868,
1350
+ 826,
1351
+ 911
1352
+ ],
1353
+ "page_idx": 10
1354
+ },
1355
+ {
1356
+ "type": "text",
1357
+ "text": "Shaofeng Li, Benjamin Zi Hao Zhao, Jiahao Yu, Minhui Xue, Dali Kaafar, and Haojin Zhu. Invisible backdoor attacks against deep neural networks. arXiv preprint arXiv:1909.02742, 2019. ",
1358
+ "bbox": [
1359
+ 171,
1360
+ 90,
1361
+ 823,
1362
+ 121
1363
+ ],
1364
+ "page_idx": 11
1365
+ },
1366
+ {
1367
+ "type": "text",
1368
+ "text": "Shaofeng Li, Minhui Xue, Benjamin Zhao, Haojin Zhu, and Xinpeng Zhang. Invisible backdoor attacks on deep neural networks via steganography and regularization. IEEE Transactions on Dependable and Secure Computing, 2020. ",
1369
+ "bbox": [
1370
+ 178,
1371
+ 128,
1372
+ 821,
1373
+ 172
1374
+ ],
1375
+ "page_idx": 11
1376
+ },
1377
+ {
1378
+ "type": "text",
1379
+ "text": "Yige Li, Xixiang Lyu, Nodens Koren, Lingjuan Lyu, Bo Li, and Xingjun Ma. Anti-backdoor learning: Training clean models on poisoned data. Advances in Neural Information Processing Systems, 34: 14900–14912, 2021a. ",
1380
+ "bbox": [
1381
+ 176,
1382
+ 180,
1383
+ 825,
1384
+ 223
1385
+ ],
1386
+ "page_idx": 11
1387
+ },
1388
+ {
1389
+ "type": "text",
1390
+ "text": "Yiming Li, Yong Jiang, Zhifeng Li, and Shu-Tao Xia. Backdoor learning: A survey. IEEE Transactions on Neural Networks and Learning Systems, 2022. ",
1391
+ "bbox": [
1392
+ 174,
1393
+ 233,
1394
+ 823,
1395
+ 262
1396
+ ],
1397
+ "page_idx": 11
1398
+ },
1399
+ {
1400
+ "type": "text",
1401
+ "text": "Yuezun Li, Yiming Li, Baoyuan Wu, Longkang Li, Ran He, and Siwei Lyu. Invisible backdoor attack with sample-specific triggers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 16463–16472, 2021b. ",
1402
+ "bbox": [
1403
+ 174,
1404
+ 271,
1405
+ 825,
1406
+ 314
1407
+ ],
1408
+ "page_idx": 11
1409
+ },
1410
+ {
1411
+ "type": "text",
1412
+ "text": "Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. 2017. ",
1413
+ "bbox": [
1414
+ 176,
1415
+ 323,
1416
+ 823,
1417
+ 353
1418
+ ],
1419
+ "page_idx": 11
1420
+ },
1421
+ {
1422
+ "type": "text",
1423
+ "text": "Yunfei Liu, Xingjun Ma, James Bailey, and Feng Lu. Reflection backdoor: A natural backdoor attack on deep neural networks. In European Conference on Computer Vision, pages 182–199. Springer, 2020. ",
1424
+ "bbox": [
1425
+ 174,
1426
+ 361,
1427
+ 826,
1428
+ 404
1429
+ ],
1430
+ "page_idx": 11
1431
+ },
1432
+ {
1433
+ "type": "text",
1434
+ "text": "Luis Muñoz-González, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, Emil C. Lupu, and Fabio Roli. Towards Poisoning of Deep Learning Algorithms with Backgradient Optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, AISec ’17, pages 27–38, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-5202-4. doi: 10.1145/3128572.3140451. ",
1435
+ "bbox": [
1436
+ 173,
1437
+ 414,
1438
+ 826,
1439
+ 484
1440
+ ],
1441
+ "page_idx": 11
1442
+ },
1443
+ {
1444
+ "type": "text",
1445
+ "text": "Tuan Anh Nguyen and Anh Tuan Tran. Wanet-imperceptible warping-based backdoor attack. In International Conference on Learning Representations, 2020. ",
1446
+ "bbox": [
1447
+ 169,
1448
+ 493,
1449
+ 825,
1450
+ 523
1451
+ ],
1452
+ "page_idx": 11
1453
+ },
1454
+ {
1455
+ "type": "text",
1456
+ "text": "Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015. ",
1457
+ "bbox": [
1458
+ 176,
1459
+ 531,
1460
+ 825,
1461
+ 575
1462
+ ],
1463
+ "page_idx": 11
1464
+ },
1465
+ {
1466
+ "type": "text",
1467
+ "text": "Aniruddha Saha, Akshayvarun Subramanya, and Hamed Pirsiavash. Hidden trigger backdoor attacks. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 11957–11965, 2020. ",
1468
+ "bbox": [
1469
+ 173,
1470
+ 583,
1471
+ 826,
1472
+ 626
1473
+ ],
1474
+ "page_idx": 11
1475
+ },
1476
+ {
1477
+ "type": "text",
1478
+ "text": "Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018. ",
1479
+ "bbox": [
1480
+ 173,
1481
+ 636,
1482
+ 828,
1483
+ 679
1484
+ ],
1485
+ "page_idx": 11
1486
+ },
1487
+ {
1488
+ "type": "text",
1489
+ "text": "Avi Schwarzschild, Micah Goldblum, Arjun Gupta, John P Dickerson, and Tom Goldstein. Just how toxic is data poisoning? a unified benchmark for backdoor and data poisoning attacks. In International Conference on Machine Learning, pages 9389–9398. PMLR, 2021. ",
1490
+ "bbox": [
1491
+ 173,
1492
+ 688,
1493
+ 825,
1494
+ 731
1495
+ ],
1496
+ "page_idx": 11
1497
+ },
1498
+ {
1499
+ "type": "text",
1500
+ "text": "Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. Advances in neural information processing systems, 31, 2018. ",
1501
+ "bbox": [
1502
+ 174,
1503
+ 739,
1504
+ 825,
1505
+ 784
1506
+ ],
1507
+ "page_idx": 11
1508
+ },
1509
+ {
1510
+ "type": "text",
1511
+ "text": "Juncheng Shen, Xiaolei Zhu, and De Ma. Tensorclog: An imperceptible poisoning attack on deep neural network applications. IEEE Access, 7:41498–41506, 2019. ",
1512
+ "bbox": [
1513
+ 171,
1514
+ 792,
1515
+ 823,
1516
+ 821
1517
+ ],
1518
+ "page_idx": 11
1519
+ },
1520
+ {
1521
+ "type": "text",
1522
+ "text": "Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. ",
1523
+ "bbox": [
1524
+ 171,
1525
+ 830,
1526
+ 823,
1527
+ 859
1528
+ ],
1529
+ "page_idx": 11
1530
+ },
1531
+ {
1532
+ "type": "text",
1533
+ "text": "Jacob Steinhardt, Pang Wei W Koh, and Percy S Liang. Certified Defenses for Data Poisoning Attacks. In Advances in Neural Information Processing Systems 30, pages 3517–3529. Curran Associates, Inc., 2017. ",
1534
+ "bbox": [
1535
+ 174,
1536
+ 868,
1537
+ 825,
1538
+ 911
1539
+ ],
1540
+ "page_idx": 11
1541
+ },
1542
+ {
1543
+ "type": "text",
1544
+ "text": "Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. Advances in neural information processing systems, 31, 2018. \nAlexander Turner, Dimitris Tsipras, and Aleksander Madry. Label-consistent backdoor attacks. arXiv preprint arXiv:1912.02771, 2019. \nBolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. Neural cleanse: Identifying and mitigating backdoor attacks in neural networks. In 2019 IEEE Symposium on Security and Privacy $( S P )$ , pages 707–723. IEEE, 2019. \nEmily Wenger, Josephine Passananti, Arjun Nitin Bhagoji, Yuanshun Yao, Haitao Zheng, and Ben Y Zhao. Backdoor attacks against deep learning systems in the physical world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6206–6215, 2021. \nDongxian Wu and Yisen Wang. Adversarial neuron pruning purifies backdoored deep models. Advances in Neural Information Processing Systems, 34:16913–16925, 2021. \nHongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018. \nBo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. In Ninth International Conference on Learning Representations 2021, 2021. \nChen Zhu, W Ronny Huang, Hengduo Li, Gavin Taylor, Christoph Studer, and Tom Goldstein. Transferable clean-label poisoning attacks on deep neural nets. In International Conference on Machine Learning, pages 7614–7623. PMLR, 2019. ",
1545
+ "bbox": [
1546
+ 171,
1547
+ 90,
1548
+ 828,
1549
+ 426
1550
+ ],
1551
+ "page_idx": 12
1552
+ },
1553
+ {
1554
+ "type": "text",
1555
+ "text": "Checklist ",
1556
+ "text_level": 1,
1557
+ "bbox": [
1558
+ 174,
1559
+ 89,
1560
+ 254,
1561
+ 106
1562
+ ],
1563
+ "page_idx": 13
1564
+ },
1565
+ {
1566
+ "type": "text",
1567
+ "text": "1. For all authors... ",
1568
+ "bbox": [
1569
+ 214,
1570
+ 116,
1571
+ 339,
1572
+ 131
1573
+ ],
1574
+ "page_idx": 13
1575
+ },
1576
+ {
1577
+ "type": "text",
1578
+ "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 Section 5 \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5 \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1579
+ "bbox": [
1580
+ 238,
1581
+ 135,
1582
+ 825,
1583
+ 239
1584
+ ],
1585
+ "page_idx": 13
1586
+ },
1587
+ {
1588
+ "type": "text",
1589
+ "text": "2. If you are including theoretical results... ",
1590
+ "bbox": [
1591
+ 214,
1592
+ 243,
1593
+ 493,
1594
+ 258
1595
+ ],
1596
+ "page_idx": 13
1597
+ },
1598
+ {
1599
+ "type": "text",
1600
+ "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] ",
1601
+ "bbox": [
1602
+ 238,
1603
+ 262,
1604
+ 738,
1605
+ 294
1606
+ ],
1607
+ "page_idx": 13
1608
+ },
1609
+ {
1610
+ "type": "text",
1611
+ "text": "3. If you ran experiments... ",
1612
+ "bbox": [
1613
+ 212,
1614
+ 299,
1615
+ 393,
1616
+ 313
1617
+ ],
1618
+ "page_idx": 13
1619
+ },
1620
+ {
1621
+ "type": "text",
1622
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix B \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] See Appendix B ",
1623
+ "bbox": [
1624
+ 238,
1625
+ 316,
1626
+ 825,
1627
+ 435
1628
+ ],
1629
+ "page_idx": 13
1630
+ },
1631
+ {
1632
+ "type": "text",
1633
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1634
+ "bbox": [
1635
+ 220,
1636
+ 439,
1637
+ 823,
1638
+ 454
1639
+ ],
1640
+ "page_idx": 13
1641
+ },
1642
+ {
1643
+ "type": "text",
1644
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] \n(b) Did you mention the license of the assets? [N/A] We defer to licenses on the respective host websites for the datasets we use. We use assets for purely research reasons. \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See supplementary material \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] ",
1645
+ "bbox": [
1646
+ 238,
1647
+ 458,
1648
+ 825,
1649
+ 593
1650
+ ],
1651
+ "page_idx": 13
1652
+ },
1653
+ {
1654
+ "type": "text",
1655
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1656
+ "bbox": [
1657
+ 214,
1658
+ 598,
1659
+ 705,
1660
+ 612
1661
+ ],
1662
+ "page_idx": 13
1663
+ },
1664
+ {
1665
+ "type": "text",
1666
+ "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] ",
1667
+ "bbox": [
1668
+ 238,
1669
+ 616,
1670
+ 825,
1671
+ 705
1672
+ ],
1673
+ "page_idx": 13
1674
+ }
1675
+ ]
parse/dev/p0LJa6_XHM_/p0LJa6_XHM__middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/xxgp42Qz6dL/xxgp42Qz6dL.md ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EGSDE: Unpaired Image-to-Image Translation via Energy-Guided Stochastic Differential Equations
2
+
3
+ Min Zhao1, Fan Bao1, Chongxuan $\mathbf { L i ^ { 2 , 3 * } }$ , $\mathbf { J u n \ : Z h u ^ { 1 * } }$ 1Dept. of Comp. Sci. & Tech., BNRist Center, THU-Bosch ML Center, Tsinghua University, China 2 Gaoling School of Artificial Intelligence, Renmin University of China, Beijing, China 3 Beijing Key Laboratory of Big Data Management and Analysis Methods , Beijing, China 4 Pazhou Laboratory (Huangpu), Guangzhou, China gracezhao1997@gmail.com; bf19@mails.tsinghua.edu.cn; chongxuanli@ruc.edu.cn; dcszj@tsinghua.edu.cn
4
+
5
+ # Abstract
6
+
7
+ Score-based diffusion models (SBDMs) have achieved the SOTA FID results in unpaired image-to-image translation (I2I). However, we notice that existing methods totally ignore the training data in the source domain, leading to sub-optimal solutions for unpaired I2I. To this end, we propose energy-guided stochastic differential equations (EGSDE) that employs an energy function pretrained on both the source and target domains to guide the inference process of a pretrained SDE for realistic and faithful unpaired I2I. Building upon two feature extractors, we carefully design the energy function such that it encourages the transferred image to preserve the domain-independent features and discard domain-specific ones. Further, we provide an alternative explanation of the EGSDE as a product of experts, where each of the three experts (corresponding to the SDE and two feature extractors) solely contributes to faithfulness or realism. Empirically, we compare EGSDE to a large family of baselines on three widely-adopted unpaired I2I tasks under four metrics. EGSDE not only consistently outperforms existing SBDMs-based methods in almost all settings but also achieves the SOTA realism results without harming the faithful performance. Furthermore, EGSDE allows for flexible trade-offs between realism and faithfulness and we improve the realism results further (e.g., FID of 51.04 in $\mathrm { C a t } \to \mathrm { D o g }$ and FID of 50.43 in Wild $ \mathrm { D o g }$ on AFHQ) by tuning hyper-parameters. The code is available at https://github.com/ML-GSAI/EGSDE.
8
+
9
+ # 1 Introduction
10
+
11
+ Unpaired image-to-image translation (I2I) aims to transfer an image from a source domain to a related target domain, which involves a wide range of computer vision tasks such as style transfer, super-resolution and pose estimation [35]. In I2I, the translated image should be realistic to fit the style of the target domain by changing the domain-specific features accordingly, and faithful to preserve the domain-independent features of the source image. Over the past few years, generative adversarial networks [12] (GANs)-based methods [10, 60, 54, 36, 3, 57, 44, 19, 17, 26, 10] dominated this field due to their ability to generate high-quality samples.
12
+
13
+ In contrast to GANs, score-based diffusion models (SBDMs) [48, 16, 34, 49, 2, 31] perturb data to a Gaussian noise by a diffusion process and learn the reverse process to transform the noise back to the data distribution. Recently, SBDMs achieved competitive or even superior image generation performance to GANs [9] and thus were naturally applied to unpaired I2I [7, 32], which have achieved the state-of-the-art FID [13] and KID [4] results empirically. However, we notice that these methods did not leverage the training data in the source domain at all. Indeed, they trained a diffusion model solely on the target domain and exploited the test source image during inference (see details in Sec. 2.2). Therefore, we argue that if the training data in the source domain can be exploited together with those in the target domain, one can learn domain-specific and domain-independent features to improve both the realism and faithfulness of the SBDMs in unpaired I2I.
14
+
15
+ ![](images/e4f9c517b6ab668bf48e33cada856c01394347a9d7995779d0fca2fd5ec2550e.jpg)
16
+ Figure 1: (a) Apart from the SDE, the EGSDE incorporates a realism expert and a faithful expert to preserve the domain-independent features and discard domain-specific ones. (b) Representative translation results on three unpaired I2I tasks.
17
+
18
+ To this end, we propose energy-guided stochastic differential equations (EGSDE) that employs an energy function pretrained across the two domains to guide the inference process of a pretrained SDE for realistic and faithful unpaired I2I. Formally, EGSDE defines a valid conditional distribution via a reverse time SDE that composites the energy function and the pretrained SDE. Ideally, the energy function should encourage the transferred image to preserve the domain-independent features and discard domain-specific ones. To achieve this, we introduce two feature extractors that learn domainindependent features and domain-specific ones respectively, and define the energy function upon the similarities between the features extracted from the transferred image and the test source image. Further, we provide an alternative explanation of the discretization of EGSDE in the formulation of product of experts [15]. In particular, the pretrained SDE and the two feature extractors in the energy function correspond to three experts and each solely contributes to faithfulness or realism.
19
+
20
+ Empirically, we validate our method on the widely-adopted AFHQ [8] and CelebA-HQ [20] datasets including $\mathrm { C a t } \to \mathrm { D o g }$ , Wild $ \mathrm { D o g }$ and Male Female tasks. We compare to a large family of baselines, including the GANs-based ones [36, 60, 17, 26, 3, 10, 57, 58] and SBDMs-based ones [7, 32] under four metrics (e.g., FID). EGSDE not only consistently outperforms SBDMs-based methods in almost all settings but also achieves the SOTA realism results without harming the faithful performance. Furthermore, EGSDE allows for flexible trade-offs between realism and faithfulness and we improve the FID further (e.g., 51.04 in $\mathbf { C a t } \to \mathbf { D o g }$ and 50.43 in Wild $ \mathrm { D o g }$ ) by tuning hyper-parameters. EGSDE can also be extended to multi-domain translation easily.
21
+
22
+ # 2 Background
23
+
24
+ # 2.1 Score-based Diffusion Models
25
+
26
+ Score-based diffusion models (SBDMs) gradually perturb data by a forward diffusion process, and then reverse it to recover the data [49, 2, 47, 16, 9]. Let $q ( \pmb { y } _ { 0 } )$ be the unknown data distribution
27
+
28
+ on $\mathbb { R } ^ { D }$ . The forward diffusion process $\{ y _ { t } \} _ { t \in [ 0 , T ] }$ , indexed by time $t$ , can be represented by the following forward SDE:
29
+
30
+ $$
31
+ \begin{array} { r } { d \pmb { y } = \pmb { f } ( \pmb { y } , t ) d t + \pmb { g } ( t ) d \pmb { w } , } \end{array}
32
+ $$
33
+
34
+ where ${ \pmb w } \in \mathbb { R } ^ { D }$ is a standard Wiener process, $\pmb { f } ( \cdot , t ) : \mathbb { R } ^ { D } \mathbb { R } ^ { D }$ is the drift coefficient and $g ( t ) \in \mathbb { R }$ is the diffusion coefficient. The $f ( { \boldsymbol { \mathbf { \mathit { y } } } } , t )$ and $g ( t )$ is related into the noise size and determines the perturbation kernel $q _ { t \mid 0 } ( { \pmb y } _ { t } | { \pmb y } _ { 0 } )$ from time 0 to $t$ . In practice, the $f ( { \boldsymbol { \mathbf { \mathit { y } } } } , t )$ is usually affine so that the the perturbation kernel is a linear Gaussian distribution and can be sampled in one step.
35
+
36
+ Let $q _ { t } ( \pmb { y } )$ be the marginal distribution of the SDE at time $t$ in Eq. (1). Its time reversal can be described by another SDE [49]:
37
+
38
+ $$
39
+ \mathrm { d } \pmb { y } = [ \pmb { f } ( \pmb { y } , t ) - g ( t ) ^ { 2 } \nabla _ { \pmb { y } } \log q _ { t } ( \pmb { y } ) ] \mathrm { d } t + g ( t ) \mathrm { d } \overline { { \ b { w } } } ,
40
+ $$
41
+
42
+ where $\overline { { { \bf w } } }$ is a reverse-time standard Wiener process, and $\mathrm { d } t$ is an infinitesimal negative timestep. [49] adopts a score-based model $s ( \boldsymbol { y } , t )$ to approximate the unknown $\nabla _ { \boldsymbol { y } } \log q _ { t } ( \boldsymbol { y } )$ by score matching, thus inducing a score-based diffusion model (SBDM), which is defined by a SDE:
43
+
44
+ $$
45
+ \mathrm { d } \pmb { y } = [ \pmb { f } ( \pmb { y } , t ) - g ( t ) ^ { 2 } \pmb { s } ( \pmb { y } , t ) ] \mathrm { d } t + g ( t ) \mathrm { d } \overline { { \pmb { w } } } .
46
+ $$
47
+
48
+ There are numerous SDE solver to solve the Eq. (3) to generate images. [49] discretizes it using the Euler-Maruyama solver. Formally, adopting a step size of $h$ , the iteration rule from $s$ to $t = s - h$ is:
49
+
50
+ $$
51
+ y _ { t } = y _ { s } - [ f ( y _ { s } , s ) - g ( s ) ^ { 2 } s ( y _ { s } , s ) ] h + g ( s ) \sqrt { h } z , \quad z \sim \mathcal { N } ( \mathbf { 0 } , I ) .
52
+ $$
53
+
54
+ # 2.2 SBDMs in Unpaired Image to Image Translation
55
+
56
+ Given unpaired images from the source domain $\boldsymbol { \mathcal { X } } \subset \mathbb { R } ^ { D }$ and the target domain $\mathcal { V } \subset \mathbb { R } ^ { D }$ as the training data, the goal of unpaired I2I is to transfer an image from the source domain to the target domain. Such a process can be formulated as designing a distribution $p ( \pmb { y } _ { 0 } | \pmb { x } _ { 0 } )$ on the target domain $\mathcal { V }$ conditioned on an image $\mathbf { \boldsymbol { x } } _ { 0 } \in \mathcal { X }$ to transfer. The translated image should be realistic for the target domain by changing the domain-specific features and faithful for the source image by preserving the domain-independent features.
57
+
58
+ ILVR [7] uses a diffusion model on the target domain for realism. Formally, ILVR starts from ${ \pmb y } _ { T } \sim \mathcal { N } ( { \bf 0 } , I )$ and samples from the diffusion model according to Eq. (4) to obtain ${ \mathbf { } } _ { \pmb { y } _ { t } }$ . For faithfulness, it further refines ${ \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \Xi } _ { \mathbf { } } \mathbf { \Lambda } _ { \mathbf { } } \mathbf { \Lambda } _ { \mathbf { } } \textbf { } _ { \mathbf { } } \textbf { } \textbf { } _ { \mathrm { } }$ by adding the residual between the sample ${ \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \mathbf { } } _ { \mathbf { } } \mathbf { \Xi } _ { \mathbf { } } \mathbf { \Lambda } _ { \mathbf { } } \mathbf { \Lambda } _ { \mathbf { } } \textbf { } _ { \mathbf { } } \textbf { } \textbf { } _ { \mathrm { } }$ and the perturbed source image $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ through a non-trainable low-pass filter
59
+
60
+ $$
61
+ \begin{array} { r } { \pmb { y } _ { t } \pmb { y } _ { t } + \Phi ( \pmb { x } _ { t } ) - \Phi ( \pmb { y } _ { t } ) , \quad \pmb { x } _ { t } \sim q _ { t | 0 } ( \pmb { x } _ { t } | \pmb { x } _ { 0 } ) , } \end{array}
62
+ $$
63
+
64
+ where $\Phi ( \cdot )$ is a low-pass filter and $q _ { t | 0 } ( \cdot | \cdot )$ is the perturbation kernel determined by the forward SDE in Eq. (1).
65
+
66
+ Similarly, SDEdit [32] also adopts a SBDM on the target domain for realism, i.e., sampling from the SBDM according to Eq. (4). For faithfulness, SDEdit starts the generation process from the noisy source image ${ \pmb y } _ { M } \sim q _ { M | 0 } ( { \pmb y } _ { M } | { \pmb x } _ { 0 } )$ , where $M$ is a middle time between 0 and $T$ , and is chosen to preserve the original overall structure and discard local details. We use $p _ { r 1 } ( \pmb { y } _ { 0 } \vert \pmb { x } _ { 0 } )$ to denote the marginal distribution defined by such SDE conditioned on $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ .
67
+
68
+ Notably, these methods did not leverage the training data in the source domain at all and thus can be sub-optimal in terms of both the realism and faithfulness in unpaired I2I.
69
+
70
+ # 3 Method
71
+
72
+ To overcome the limitations of existing methods [7, 32] as highlighted in Sec. 2.2, we propose energy-guided stochastic differential equations (EGSDE) that employs an energy function pre-trained across the two domains to guide the inference process of a pretrained SDE for realistic and faithful unpaired I2I (see Fig. 2). EGSDE defines a valid conditional distribution $p ( \pmb { y } _ { 0 } | \pmb { x } _ { 0 } )$ by compositing a pretrained SDE and a pretrained energy function under mild regularity conditions2 as follows:
73
+
74
+ $$
75
+ \mathrm { d } \pmb { y } = [ \pmb { f } ( \pmb { y } , t ) - g ( t ) ^ { 2 } ( \pmb { s } ( \pmb { y } , t ) - \nabla _ { \pmb { y } } \pmb { \mathcal { E } } ( \pmb { y } , \pmb { x } _ { 0 } , t ) ) ] \mathrm { d } t + g ( t ) \mathrm { d } \overline { { \pmb { w } } } ,
76
+ $$
77
+
78
+ ![](images/f02446ab0e0da6321a04bce1eaa21fccc13f8b9fa4d36838329497b13c199608.jpg)
79
+ Figure 2: The overview of our EGSDE. Starting from the noisy source image, we can run the EGSDE for unpaired I2I, which employs an energy function $\boldsymbol { \mathcal { E } } ( \boldsymbol { y } , \boldsymbol { x } , t )$ pretrained on both the source and target domains to guide the inference process of a pretrained SDE $( s ( \pmb { y } , t )$ , realism expert 1). The energy function is decomposed into two terms further, where the realistic expert 2 $\mathcal { E } _ { s } ( \pmb { y } , \pmb { x } , t )$ encourages the transferred image to discard domain-specific features and the faithful expert $\mathcal { E } _ { i } ( \pmb { y } , \pmb { x } , t )$ aims to preserve the domain-independent ones.
80
+
81
+ where $\overline { { { \bf w } } }$ is a reverse-time standard Wiener process, $\mathrm { d } t$ is an infinitesimal negative timestep, $s ( \cdot , \cdot ) :$ $\mathbb { R } ^ { D } \times \mathbb { R } \mathbb { R } ^ { D }$ is the score-based model in the pretrained SDE and $\mathcal { E } ( \cdot , \cdot , \cdot ) : \bar { \mathbb { R } ^ { D } } \times \mathbb { R } ^ { D } \times \bar { \mathbb { R } } \stackrel { \cdot } { } \bar { \mathbb { R } }$ is the energy function. The start point ${ \pmb y } _ { M }$ is sampled from the perturbation distribution $q _ { M | 0 } ( { \pmb y } _ { M } | { \pmb x } _ { 0 } )$ [32], where $M = 0 . 5 T$ typically. We obtain the transferred images by taking the samples at endpoint $t = 0$ following the SDE in Eq. (6).
82
+
83
+ Similar to the prior work [7, 32], EGSDE employs an SDE trained solely in the target domain as in Eq. (2), which defines a marginal distribution of the target images and mainly contributes to the realism of the transferred samples. In contrast, the energy function involves the training data across both the source and target domain, making EGSDE distinct from the prior work [7, 32]. Notably, although many other possibilities exist, we carefully design the energy function such that it (approximately) encourages the sample to retain the domain-independent features and discard the domain-specific ones to improve both the faithfulness and realism of the transferred sample. Below, we formally formulate the energy function.
84
+
85
+ # 3.1 Choice of Energy
86
+
87
+ In this section, we show how to design the energy function. Intuitively, during the translation, the domain-independent features (pose, color, etc. on $\mathbf { C a t } \to \mathbf { D o g }$ ) should be preserved while the domain-specific features (beard, nose, etc. on $\mathrm { C a t } \to \mathrm { D o g }$ ) should be changed accordingly. Motivated by this, we decompose the energy function $\mathcal { E } ( \boldsymbol { y } , \boldsymbol { x } , t )$ as the sum of two log potential functions [5]:
88
+
89
+ $$
90
+ \begin{array} { r l } & { \mathcal { E } ( { \pmb y } , { \pmb x } , t ) = \lambda _ { s } \mathcal { E } _ { s } ( { \pmb y } , { \pmb x } , t ) + \lambda _ { i } \mathcal { E } _ { i } ( { \pmb y } , { \pmb x } , t ) } \\ & { \qquad = \lambda _ { s } \mathbb { E } _ { q _ { t \vert 0 } ( { \pmb x } _ { t } \vert { \pmb x } ) } \mathcal { S } _ { s } ( { \pmb y } , { \pmb x } _ { t } , t ) - \lambda _ { i } \mathbb { E } _ { q _ { t \vert 0 } ( { \pmb x } _ { t } \vert { \pmb x } ) } \mathcal { S } _ { i } ( { \pmb y } , { \pmb x } _ { t } , t ) , } \end{array}
91
+ $$
92
+
93
+ where $\mathcal { E } _ { i } ( \cdot , \cdot , \cdot ) : \mathbb { R } ^ { D } \times \mathbb { R } ^ { D } \times \mathbb { R } \mathbb { R }$ and $\mathcal { E } _ { s } ( \cdot , \cdot , \cdot ) : \mathbb { R } ^ { D } \times \mathbb { R } ^ { D } \times \mathbb { R } \mathbb { R }$ are the log potential functions, $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ is the perturbed source image in the forward SDE, $q _ { t | 0 } ( \cdot | \cdot )$ is the perturbation kernel from time 0 to time $t$ in the forward SDE, $S _ { s } ( \cdot , \cdot , \cdot ) : \mathbb { R } ^ { D } \times \mathbb { R } ^ { D } \times \mathbb { R } \mathbb { R }$ and $S _ { i } ( \cdot , \cdot , \cdot ) : \mathbb { R } ^ { D } \times \mathbb { R } ^ { D } \times \mathbb { R } \mathbb { R }$ are two functions measuring the similarity between the sample and perturbed source image, and $\lambda _ { s } \in \mathbb { R } _ { > 0 } , \lambda _ { i } \in \mathbb { R } _ { > 0 }$ are two weighting hyper-parameters. Note that the expectation w.r.t. $q _ { t | 0 } ( \pmb { x } _ { t } | \pmb { x } )$ in Eq. (7) guarantees that the energy function changes slowly over the trajectory to satisfy the regularity conditions in Appendix A.1.
94
+
95
+ To specify $S _ { s } ( \cdot , \cdot , \cdot )$ , we introduce a time-dependent domain-specific feature extractor $E _ { s } ( \cdot , \cdot ) :$ $\mathbb { R } ^ { D } \times \mathbb { R } \stackrel { \cdot } { \to } \mathbb { R } ^ { C \times H \times W }$ , where $C$ is the channel-wise dimension, $H$ and $W$ are the dimension of height and width. In particular, $E _ { s } ( \cdot , \cdot )$ is the all but the last layer of a classifier that is trained on both domains to predict whether an image is from the source domain or the target domain. Intuitively, $E _ { s } ( \cdot , \cdot )$ will preserve the domain-specific features and discard the domain-independent features for accurate predictions. Building upon it, $S _ { s } ( \cdot , \cdot , \cdot )$ is defined as the cosine similarity between the features extracted from the generated sample and the source image as follows:
96
+
97
+ $$
98
+ \displaystyle \mathcal { S } _ { s } ( { \pmb y } , { \pmb x } _ { t } , t ) = \frac { 1 } { H W } \sum _ { h , w } \frac { E _ { s } ^ { h w } ( { \pmb x } _ { t } , t ) ^ { \top } E _ { s } ^ { h w } ( { \pmb y } , t ) } { | | E _ { s } ^ { h w } ( { \pmb x } _ { t } , t ) | | _ { 2 } | | E _ { s } ^ { h w } ( { \pmb y } , t ) | | _ { 2 } } ,
99
+ $$
100
+
101
+ where $E _ { s } ^ { h w } ( \cdot , \cdot ) \in \mathbb { R } ^ { C }$ denote the channel-wise feature at spatial position $( h , w )$ . Here we employ the cosine similarity since it preserves the spatial information and helps to improve the FID score empirically (see Appendix C.1 for the ablation study). Intuitively, reducing the energy value in Eq. (7) encourages the transferred sample to discard the domain-specific features to improve realism.
102
+
103
+ To specify $S _ { i } ( \cdot , \cdot , \cdot )$ , we introduce a domain-independent feature extractor $E _ { i } ( \cdot , \cdot ) : \mathbb { R } ^ { D } \times \mathbb { R } \to \mathbb { R } ^ { D }$ , which is a low-pass filter. Intuitively, $E _ { i } ( \cdot , \cdot )$ will preserve the overall structures (i.e., domainindependent features) and discard local information like textures (i.e., domain-specific features). Building upon it, $S _ { i } ( \cdot , \cdot , \cdot )$ is defined as the negative squared $L _ { 2 }$ distance between the features extracted from the generated sample and source image as follows:
104
+
105
+ $$
106
+ \begin{array} { r } { S _ { i } ( { \pmb y } , { \pmb x } _ { t } , t ) = - | | E _ { i } ( { \pmb y } , t ) - E _ { i } ( { \pmb x } _ { t } , t ) | | _ { 2 } ^ { 2 } . } \end{array}
107
+ $$
108
+
109
+ Here, we choose negative squared $L _ { 2 }$ distance as the similarity metric because it helps to preserve more domain-independent features empirically (see Appendix C.1 for the ablation study). Intuitively, reducing the energy value in Eq. (7) encourages the transferred sample to preserve the domainindependent features to improve faithfulness. In this paper we employ a low-pass filter for its simpleness and effectiveness while we can train more sophisticated $E _ { i }$ , e.g., based on disentangled representation learning methods [42, 6, 14, 23, 28], on the data in the two domains.
110
+
111
+ In our preliminary experiment, alternative to Eq. (7), we consider a simpler energy function that only involves the original source image $_ { \textbf { \em x } }$ as follows:
112
+
113
+ $$
114
+ \begin{array} { r } { \mathcal { E } ( \pmb { y } , \pmb { x } , t ) = \lambda _ { s } S _ { s } ( \pmb { y } , \pmb { x } , t ) - \lambda _ { i } S _ { i } ( \pmb { y } , \pmb { x } , t ) , } \end{array}
115
+ $$
116
+
117
+ which does not require to take the expectation w.r.t. $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . We found that it did not perform well because it is not reasonable to measure the similarity between the noise-free source image and the transferred sample in a gradual denoising process. See Appendix C.2 for empirical results.
118
+
119
+ # 3.2 Solving the Energy-guided Reverse-time SDE
120
+
121
+ Based on the pretrained score-based model $s ( \boldsymbol { y } , t )$ and energy function $\boldsymbol { \mathcal { E } } ( \boldsymbol { y } , \boldsymbol { x } , t )$ , we can solve the proposed energy-guided SDE to generate samples from conditional distribution $p ( \pmb { y } _ { 0 } | \pmb { x } _ { 0 } )$ . There are numerical solvers to approximate trajectories from SDEs. In this paper, we take the Euler-Maruyama solver following [32] for a fair comparison. Given the EGSDE as in Eq. (6) and adopting a step size $h$ , the iteration rule from $s$ to $t = s - h$ is:
122
+
123
+ $$
124
+ y _ { t } = y _ { s } - [ f ( y , s ) - g ( s ) ^ { 2 } ( s ( y _ { s } , s ) - \nabla _ { y } \mathcal { E } ( y _ { s } , x _ { 0 } , s ) ) ] h + g ( s ) \sqrt { h } z , \quad z \sim \mathcal { N } ( \mathbf { 0 } , I ) .
125
+ $$
126
+
127
+ The expectation in $\mathcal { E } ( \pmb { y } _ { s } , \pmb { x } _ { 0 } , s )$ is estimated by the Monte Carlo method of a single sample for efficiency. For brevity, we present the general sampling procedure of our method in Algorithm 1. In experiments, we use the variance preserve energy-guided SDE (VP-EGSDE) [49, 16] and the details are explained in Appendix A.3, where we can modify the noise prediction network to $\tilde { \epsilon } ( \pmb { y } , \pmb { x } _ { 0 } , t ) = \epsilon ( \pmb { y } , t ) + \sqrt { \bar { \beta } _ { t } } \nabla _ { \pmb { y } } \mathcal { E } ( \pmb { y } , \pmb { x } _ { 0 } , t )$ and take it into the sampling procedure in DDPM [16]. Following SDEdit [32], we further extend this by repeating the Algorithm 1 $K$ times (see details in Appendix A.2). Further, we explain the connection with classifier guidance[9] in Appendix A.5.
128
+
129
+ # 3.3 EGSDE as Product of Experts
130
+
131
+ Inspired by the posterior inference process in diffusion models [46], we present a product of experts [15] explanation for the discretized sampling process of EGSDE, which formalizes our motivation in an alternative perspective and provides insights on the role of each component in EGSDE.
132
+
133
+ We first define a conditional distribution $\tilde { p } ( \boldsymbol y _ { t } | \boldsymbol x _ { 0 } )$ at time $t$ as a product of experts:
134
+
135
+ $$
136
+ \tilde { p } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) = \frac { p _ { r 1 } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) p _ { e } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) } { Z _ { t } } ,
137
+ $$
138
+
139
+ <table><tr><td>Require: the source image xo, the initial time M,denoising steps N, weighting hyper-parameters Xs,入i, the similarity function Ss(·,:,·),Si(·,:,·), the score function s(·,·) y~qm|o(y|xo) # the start point h= N fori=Nto1do</td></tr><tr><td></td></tr><tr><td>s←ih</td></tr><tr><td>x ~ qs|o(x|xo) # sample perturbed source image from the perturbation kernel</td></tr><tr><td>£(y,x,s) ← λsSs(y,x,s) - XiSi(y,x,s) # compute energy with one Monte Carlo</td></tr><tr><td>y ← y-[f(y,s) - g(s)²(s(y,s) - Vyε(y,x,s))]h# the update rule in Eq. (12) z~N(0,I)ifi&gt;1,else z=0</td></tr><tr><td>y←y+g(s)√hz</td></tr><tr><td>end for yo←y</td></tr></table>
140
+
141
+ where $Z _ { t }$ is the partition function, $p _ { e } ( { \pmb y } _ { t } | { \pmb x } _ { 0 } ) \propto \exp ( - \mathcal { E } ( { \pmb y } _ { t } , { \pmb x } _ { 0 } , t ) )$ and $p _ { r 1 } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } )$ is the marginal distribution at time $t$ defined by SDEdit based on a pretrained SDE on the target domain.
142
+
143
+ To sample from $\tilde { p } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } )$ , we need to construct a transition kernel $\tilde { p } ( \boldsymbol { y } _ { t } | \boldsymbol { y } _ { s } )$ , where $t = s - h$ and $h$ is small. Following [46], using the desirable equilibrium $\begin{array} { r } { \tilde { p } ( { \pmb y } _ { t } | { \pmb x } _ { 0 } ) = \int \tilde { p } ( { \pmb y } _ { t } | { \pmb y } _ { s } ) \tilde { p } ( { \pmb y } _ { s } | { \pmb x } _ { 0 } ) d { \pmb y } _ { s } } \end{array}$ , we construct the $\tilde { p } ( y _ { t } | y _ { s } )$ as follows:
144
+
145
+ $$
146
+ \tilde { p } ( { \pmb y } _ { t } | { \pmb y } _ { s } ) = \frac { p ( { \pmb y } _ { t } | { \pmb y } _ { s } ) p _ { e } ( { \pmb y } _ { t } | { \pmb x } _ { 0 } ) } { \tilde { Z } _ { t } ( { \pmb y } _ { s } ) } ,
147
+ $$
148
+
149
+ where $\tilde { Z } _ { t } ( y _ { s } )$ is the partition function and $p ( \pmb { y } _ { t } | \pmb { y } _ { s } ) = \mathcal { N } ( \pmb { \mu } ( \pmb { y } _ { s } , h ) , \Sigma ( s , h ) \pmb { I } )$ is the transition kernel of the pretrained SDE in Eq. (4), i.e., $\pmb { \mu } ( \pmb { y } _ { s } , h ) = \pmb { y } _ { s } - [ \pmb { f } ( \pmb { y } _ { s } , s ) - g ( s ) ^ { 2 } \pmb { s } ( \pmb { y } _ { s } , s ) ] h$ and $\Sigma ( s , h ) = g ( \dot { s } ) ^ { 2 } h$ . Assuming that $\mathcal { E } ( \boldsymbol { y } _ { t } , \boldsymbol { x } _ { 0 } , t )$ has low curvature relative to $\Sigma ( s , h ) ^ { - 1 }$ , it can be approximated using Taylor expansion around $\dot { \mu } ( y _ { s } , h )$ and further we can obtain
150
+
151
+ $$
152
+ \tilde { p } ( \boldsymbol { y } _ { t } | \boldsymbol { y } _ { s } ) \approx \mathcal { N } ( \mu ( \boldsymbol { y } _ { s } , h ) - \Sigma ( s , h ) \nabla _ { \boldsymbol { y } ^ { \prime } } \mathcal { E } ( \boldsymbol { y } ^ { \prime } , \boldsymbol { x } _ { 0 } , t ) | _ { \boldsymbol { y } ^ { \prime } = \mu ( \boldsymbol { y } _ { s } , h ) } , \Sigma ( s , h ) I ) .
153
+ $$
154
+
155
+ More details about derivation are available in Appendix A.4. We can observe the transition kernel $\tilde { p } ( y _ { t } | y _ { s } )$ in (15) is equal to the discretization of our EGSDE in Eq. (12). Therefore, solving the energy-guided SDE in a discretization manner is approximately equivalent to drawing samples from a product of experts in Eq. (13). Note that $\begin{array} { r } { \mathcal { E } ( { \bf y } _ { t } , { \bf x } _ { 0 } , t ) = \lambda _ { s } \mathcal { E } _ { s } ( { \bf y } _ { t } , { \bf x } _ { 0 } , t ) + \lambda _ { i } \mathcal { E } _ { i } ( { \bf y } _ { t } , { \bf x } _ { 0 } , t ) } \end{array}$ , the $\tilde { p } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } )$ can be rewritten as:
156
+
157
+ $$
158
+ \tilde { p } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) = \frac { p _ { r 1 } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) p _ { r 2 } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) p _ { f } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) } { Z _ { t } } ,
159
+ $$
160
+
161
+ $$
162
+ \begin{array} { r } { p _ { r 2 } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) \propto \exp ( - \lambda _ { s } \pmb { \mathcal { E } } _ { s } ( \pmb { y } _ { t } , \pmb { x } _ { 0 } , t ) ) , p _ { f } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } ) \propto \exp ( - \lambda _ { i } \pmb { \mathcal { E } } _ { i } ( \pmb { y } _ { t } , \pmb { x } _ { 0 } , t ) ) . } \end{array}
163
+ $$
164
+
165
+ In Eq. (16), by setting $t = 0$ , we can explain that the transferred samples approximately follow the distribution defined by the product of three experts, where $p _ { r 1 } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } )$ and $p _ { r 2 } ( { \pmb y } _ { t } | { \pmb x } _ { 0 } )$ are the realism experts and $p _ { f } ( \pmb { y } _ { t } | \pmb { x } _ { 0 } )$ is the faithful expert, corresponding to the score function $s ( \pmb { y } , t )$ and the log potential functions $\mathcal { E } _ { s } ( \pmb { y } , \pmb { x } , t )$ and $\mathcal { E } _ { i } ( \pmb { y } , \pmb { x } , t )$ respectively. Such a formulation clearly explains the role of each expert in EGSDE and supports our empirical results.
166
+
167
+ # 4 Related work
168
+
169
+ Apart from the prior work mentioned before, we discuss other related work including GANs-based methods for unpaired I2I and SBDMs-based methods for image translation.
170
+
171
+ GANs-based methods for Unpaired I2I. Although previous paired image translation methods have also achieved remarkable performances [18, 51, 50, 37, 55, 59], we mainly focus on unpaired image translation in this work. The methods for two-domain unpaired I2I are mainly divided into two classes: two-side and one-side mapping [35, 57]. In the two-side framework [60, 54, 25, 29, 27, 24, 11, 1, 53, 56, 21], the cycle-consistency constraint is the most widely-used strategy such as in
172
+
173
+ ![](images/7e5f3d8c47fa9b4d68b3c9eb2833fd0a2841ad7f41bb5d2ed150deabeb7f64f1.jpg)
174
+ Figure 3: The qualitative comparison on $\mathrm { C a t } \to \mathrm { D o g }$ , Wild Dog and Male Female. Our method achieved better visual quality for both realism and faithfulness. For example, in the forth column, we successfully preserve the domain-independent features (i.e. green ground, pose and yellow color of body) and discard the domain-specific ones (i.e. leopard print).
175
+
176
+ CycleGAN [60], DualGAN [54] and DiscoGAN [25]. The key idea is that the translated image should be able to be reconstructed by an inverse mapping. More recently, there are numerical studies to improve this such as SCAN [27] and U-GAT-IT [24]. Specifically, U-GAT-IT [24] applies an attention module to let the generator and discriminator focus on more important regions instead of the whole regions through the auxiliary classifier. Since such bijective projection is too restrictive, several studies are devoted to one-side mapping [36, 3, 10, 60, 57, 38, 19]. One representative approach is to design some kind of geometry distance to preserve content [35]. For example, DistanceGAN [3] keeps the distances between images within domains. GCGAN [10] maintains geometry-consistency between input and output. CUT [36] maximizes the mutual information between the input and output using contrastive learning. LSeSim [57] learns spatially-correlative representation to preserve scene structure consistency via self-similarities.
177
+
178
+ SBDMs-based methods for Image Translation. Several studies leveraged SBDMs for image translation due to their powerful generative ability and achieved good results. For example, DiffusionCLIP [22] fine-tune the score network with CLIP [39] loss, which is applied on text-driven image manipulation, zero-shot image manipulation and multi-attribute transfer successfully. GLIDE [33] and SDG [30] has achieved great performance on text-to-image translation. As for I2I, SR3 [41] and Palette [40] learn a conditional SBDM and outperform state-of-art GANs-based methods on super-resolution, colorization and so on, which needs paired data. For unpaired I2I, UNIT-DDPM [43] learns two SBDMs and two domain translation models using cycle-consistency loss. Compared with it, our method only needs one SBDM on the target domain, which is a kind of one-side mapping. ILVR [7] and SDEdit [32] utilize a SBDM on the target domain and exploited the test source image to refine inference, which ignored the training data in the source domain. Compared with these methods, our method employs an energy function pretrained across both the source and target domains to improve the realism and faithfulness of translated images.
179
+
180
+ # 5 Experiment
181
+
182
+ Datasets. We validated the EGSDE on following datasets, where all images are resized to $2 5 6 \times 2 5 6$ : (1) CelebA-HQ [20] contains high quality face images and is separated into two domains: male and female. Each category has 1000 testing images. We perform Male Female on this dataset.
183
+
184
+ (2) AFHQ [8] consists of high-resolution animal face images including three domains: cat, dog and wild, which has relatively large variations. Each domain has 500 testing images. We perform Cat Dog and Wild Dog on this dataset. We also perform multi-domain translation on AFHQ dataset and the experimental results are reported in Appendix D.
185
+
186
+ Implementation. The time-dependent domain-specific extractor $E _ { s } ( { \boldsymbol { x } } , t )$ is trained based on the backbone in [9]. The resize function including downsampling and upsampling operation is used as low-pass filter and is implemented by [45]. For generation process, by default, the weight parameter $\lambda _ { s }$ , $\lambda _ { i }$ is set 500 and 2 respectively. The initial time $M$ and denoising steps $N$ is set $0 . 5 T$ and 500 by default. More details about implementation are available in Appendix B.
187
+
188
+ Evaluation Metrics. We evaluate translated images from two aspects: realism and faithfulness. For realism, we report the widely-used Frechet Inception Score (FID) [13] between translated images and the target dataset. To quantify faithfulness, we report the $L _ { 2 }$ distance, PSNR and SSIM [52] between each input-output pair. To quantify both faithfulness and realism, we leverage Amazon Mechanical Turk(AMT) human evaluation to perform pairwise comparisons between the baselines and EGSDE. More details is available in Appendix B.6.
189
+
190
+ # 5.1 Two-Domain Unpaired Image Translation
191
+
192
+ In this section, we compare EGSDE with the following state-of-the-art I2I methods in three tasks: SBDMs-based methods including ILVR [7] and SDEdit [32], and GANs-based methods including CUT [36], which are reproduced using public code. On the most popular benchmark $\mathbf { C a t } \to \mathbf { D o g }$ we also report the performance of other state-of-the-art GANs-methods , where StarGAN v2 [8] is evaluated by the provided public checkpoint and the others are public results from CUT[36] and ITTR [58]. We provide more details about reproductions in Appendix B.7.
193
+
194
+ The quantitative comparisons and qualitative results are shown in Table 1 and Figure 3. We can derive several observations. First, our method outperforms the SBDMs-based methods significantly in almost all realism and faithfulness metrics, suggesting the effectiveness of employing energy function pretrained on both domains to guide the generation process. Especially, compared with the most direct competitor, i.e., SDEdit, with a lower $L _ { 2 }$ distance at the same time, EGSDE improves the FID score by 8.35, 8.76 and 7.5 on $\mathrm { C a t } \to \mathrm { D o g }$ , W $\mathrm { \Delta / i l d } \to \mathrm { D o g }$ and Male Female respectively. Second, EGSDE† outperforms the current state-of-art GANs-based methods by a large margin on the challenging AFHQ dataset. For example, compared with CUT [36], we achieve an improvement of FID score with 25.17 and 42.51 on the $\mathrm { C a t } \to \mathrm { D o g }$ and Wi $\lvert \mathbf { d } \to \mathbf { D o g }$ tasks respectively. In addition, the human evaluation shows that EGSDE are preferred compared to all baselines $( > 5 0 \% )$ . The qualitative results in Figure 3 agree with quantitative comparisons in Table 1, where our method achieved the results with the best visual quality for both realism and faithfulness. We show more qualitative results and select some failure cases in Appendix C.6.
195
+
196
+ # 5.2 Ablation Studies
197
+
198
+ The function of each expert. We validate the function of realistic expert $\mathcal { E } _ { s } ( \pmb { y } , \pmb { x } , t )$ and faithful expert $\mathcal { E } _ { i } ( \pmb { y } , \pmb { x } , t )$ by changing the weighting hyper-parameter $\lambda _ { s }$ and $\lambda _ { i }$ . As shown in Table 3 and Figure 1, larger $\lambda _ { s }$ results in more realistic images and larger $\lambda _ { i }$ results in more faithful images. More results is available in Appendix C.5.
199
+
200
+ The choice of initial time $M$ . We explore the effect of the initial time $M$ of EGSDE. As shown in Figure 4, the larger $M$ results in more realistic and less faithful image. More results is available in Appendix C.3.
201
+
202
+ Repeating $K$ Times. Following SDEdit [32], we show the results of repeating the Algorithm 1 $K$ times. The quantitative and qualitative results are depicted in Table 2 and Figure 4. The experimental results show the EGSDE outperforms SDEdit in each $K$ step in all metrics. With the increase of $K$ , the SDEdit generates more realism images but the faithful metrics decrease sharply, because it only utilizes the source image at the initial time $M$ . As shown in Figure 4, when $K { = } 3$ , SDEdit discard the domain-independent information of the source image (i.e., color and background) while our method still preserves them without harming realism.
203
+
204
+ Table 1: Quantitative comparison. ILVR [7], SDEdit [32] and CUT [36] are reproduced using public code. StarGAN v2 [8] is evaluated by the provided public checkpoint and the other methods marked by \* are public results from CUT[36] and ITTR [58]. All SBDMs-based methods and StarGAN v2 are repeated 5 times to eliminate randomness. CUT is conducted once since it learns a deterministic mapping. AMT show the preference rate of EGSDE against baselines via human evaluation. The EGSDE use the default-parameters $( \lambda _ { s } = 5 0 0 , \lambda _ { i } = 2 , M = 0 . 5 T )$ and EGSDE† use the parameters with $\lambda _ { s } = 7 0 0 , \lambda _ { i } = 0 . 5 , M = 0 . 6 T$ .
205
+
206
+ <table><tr><td>Model</td><td>FID↓</td><td>L2↓</td><td>PSNR ↑</td><td>SSIM ↑</td><td>AMT个</td></tr><tr><td colspan="6">Cat → Dog</td></tr><tr><td>CycleGAN* [60] MUNIT*[17]</td><td>85.9 104.4</td><td>=</td><td></td><td></td><td></td></tr><tr><td>DRIT* [26]</td><td>123.4</td><td></td><td></td><td></td><td></td></tr><tr><td>Distance*[3]</td><td>155.3</td><td></td><td></td><td></td><td></td></tr><tr><td>SelfDistance* [3]</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>144.4</td><td>=</td><td></td><td></td><td></td></tr><tr><td>GCGAN*[10]</td><td>96.6</td><td></td><td></td><td></td><td></td></tr><tr><td>LSeSim* [57]</td><td>72.8</td><td></td><td></td><td></td><td></td></tr><tr><td>ITTR(CUT)*[58]</td><td>68.6</td><td>=</td><td></td><td></td><td>=</td></tr><tr><td>StarGAN v2 [8]</td><td>54.88 ± 1.01</td><td>133.65 ± 1.54</td><td>10.63 ± 0.10</td><td>0.27 ± 0.003</td><td></td></tr><tr><td>CUT* [36]</td><td>76.21</td><td>59.78</td><td>17.48</td><td>0.601</td><td>79.6%</td></tr><tr><td>ILVR [7]</td><td>74.37 ± 1.55</td><td>56.95 ± 0.14</td><td>17.77 ± 0.02</td><td>0.363 ± 0.001</td><td>75.4%</td></tr><tr><td>SDEdit [32]</td><td>74.17 ± 1.01</td><td>47.88 ± 0.06</td><td>19.19 ± 0.01</td><td>0.423 ± 0.001</td><td>65.2%</td></tr><tr><td>EGSDE</td><td>65.82 ± 0.77</td><td>47.22 ± 0.08</td><td>19.31 ± 0.02</td><td>0.415 ± 0.001</td><td>=</td></tr><tr><td>EGSDEt</td><td>51.04 ± 0.37</td><td>62.06 ± 0.10</td><td>17.17 ± 0.02</td><td>0.361 ± 0.001</td><td>=</td></tr><tr><td colspan="6">Wild →Dog</td></tr><tr><td>CUT [36]</td><td>92.94</td><td>62.21</td><td>17.2</td><td>0.592</td><td>82.4%</td></tr><tr><td>ILVR [7]</td><td>75.33 ± 1.22</td><td>63.40 ± 0.15</td><td>16.85 ± 0.02</td><td>0.287 ± 0.001</td><td>73.4%</td></tr><tr><td>SDEdit [32]</td><td>68.51 ± 0.65</td><td>55.36 ± 0.05</td><td>17.98 ± 0.01</td><td>0.343 ± 0.001</td><td>57.2%</td></tr><tr><td>EGSDE</td><td>59.75 ± 0.62</td><td>54.34 ± 0.08</td><td>18.14 ± 0.01</td><td>0.343 ± 0.001</td><td>=</td></tr><tr><td>EGSDE†</td><td>50.43± 0.52</td><td>66.52± 0.09</td><td>16.40± 0.01</td><td>0.300± 0.001</td><td>=</td></tr><tr><td colspan="6">Male→Female</td></tr><tr><td>CUT [36]</td><td>31.94</td><td>46.61</td><td>19.87</td><td>0.74</td><td>58.6%</td></tr><tr><td>ILVR [7]</td><td>46.12 ± 0.33</td><td>52.17 ± 0.10</td><td>18.59 ± 0.02</td><td>0.510 ± 0.001</td><td>88.2%</td></tr><tr><td>SDEdit [32]</td><td>49.43 ± 0.47</td><td>43.70 ± 0.03</td><td>20.03 ± 0.01</td><td>0.572 ± 0.000</td><td>74.4%</td></tr><tr><td>EGSDE</td><td>41.93 ± 0.11</td><td>42.04 ± 0.03</td><td>20.35 ± 0.01</td><td>0.574 ± 0.000</td><td>=</td></tr><tr><td>EGSDE†</td><td>30.61 ± 0.19</td><td>53.44 ± 0.09</td><td>18.32 ± 0.02</td><td>0.510 ± 0.001</td><td>1</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
207
+
208
+ # 6 Conclusions and Discussions
209
+
210
+ In this paper, we propose energy-guided stochastic differential equations (EGSDE) for realistic and faithful unpaired I2I, which employs an energy function pretrained on both domains to guide the generation process of a pretrained SDE. Building upon two feature extractors, we carefully design the energy function to preserve the domain-independent features and discard domain-specific ones of the source image. We demonstrate the EGSDE by outperforming state-of-art I2I methods on three widely-adopted unpaired I2I tasks.
211
+
212
+ One limitation of this paper is we employ a low-pass filter as the domain-independent feature extractor for its simpleness and effectiveness while we can train more sophisticated extractor, e.g. based on disentangled representation learning methods [42, 6, 14, 23, 28], on the data in the two domains. We leave this issue in future work. In addition, we must take care to exploit the method to avoid the potential negative social impact (i.e., generating fake images to mislead people).
213
+
214
+ ![](images/a5d855901863fe17e8ecff09a3307e6d0e6a80e0b650ae5b8fe40e5d231c2649.jpg)
215
+ Figure 4: (a) The results of different initial time $M$ . The larger $M$ results in more realistic and less faithful images. (b) The results of repeating the Algorithm 1 $K$ times. With the increase of K, SDEdit [32] tend to discard the domain-independent information of the source image (e.g., color and background) while our method still preserve them without harming realism.
216
+
217
+ Table 2: Comparison with SDEdit [32] under different $K$ times on Male Female. The results on other tasks are reported in Appendix C.4.
218
+
219
+ <table><tr><td>Methods</td><td>K</td><td>FID↓</td><td>L2↓</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>SDEdit [32]</td><td></td><td>49.95</td><td>43.71</td><td>20.03</td><td>0.572</td></tr><tr><td>EGSDE</td><td>1</td><td>42.17</td><td>42.07</td><td>20.35</td><td>0.573</td></tr><tr><td>SDEdit [32]</td><td>2</td><td>46.26</td><td>50.70</td><td>18.77</td><td>0.542</td></tr><tr><td>EGSDE</td><td></td><td>38.68</td><td>47.10</td><td>19.40</td><td>0.548</td></tr><tr><td>SDEdit [32]</td><td>3</td><td>45.19</td><td>55.03</td><td>18.08</td><td>0.527</td></tr><tr><td>EGSDE</td><td></td><td>37.55</td><td>49.63</td><td>18.96</td><td>0.536</td></tr></table>
220
+
221
+ Table 3: The results of different $\lambda _ { s }$ and $\lambda _ { i }$ on Wild $ \mathrm { D o g }$ . $\lambda _ { s } = \lambda _ { i } = 0$ corresponds to SDEdit [32].
222
+
223
+ <table><tr><td>入s,入</td><td>FID↓</td><td>L2↓</td><td>PSNR ↑</td><td>SSIM↑</td></tr><tr><td>λs=0,λ=0</td><td>67.87</td><td>55.39</td><td>17.97</td><td>0.344</td></tr><tr><td>x=100,x=0</td><td>60.80</td><td>56.19</td><td>17.85</td><td>0.341</td></tr><tr><td>入s= 500,入i=0</td><td>53.72</td><td>58.65</td><td>17.47</td><td>0.335</td></tr><tr><td>=800,入=0</td><td>53.01</td><td>60.02</td><td>17.27</td><td>0.331</td></tr><tr><td>X=0,x7=0.5</td><td>68.31</td><td>53.23</td><td>18.32</td><td>0.347</td></tr><tr><td>入s=0,入=2</td><td>71.10</td><td>51.99</td><td>18.52</td><td>0.349</td></tr><tr><td>入s=0,=5</td><td>72.70</td><td>51.44</td><td>18.61</td><td>0.351</td></tr></table>
224
+
225
+ # Acknowledgement
226
+
227
+ We thank Cheng Lu, Yuhao Zhou, Haoyu Liang and Shuyu Cheng for helpful discussions about the method and its limitations. This work was supported by the National Key Research and Development Program of China (2020AAA0106302); NSF of China Projects (Nos. 62061136001, 61620106010, 62076145, U19B2034, U1811461, U19A2081, 6197222); Beijing NSF Project (No. JQ19016); Beijing Outstanding Young Scientist Program NO. BJJWZYJH012019100020098; a grant from Tsinghua Institute for Guo Qiang; the High Performance Computing Center, Tsinghua University; the Fundamental Research Funds for the Central Universities, and the Research Funds of Renmin University of China (22XNKJ13). Part of the computing resources supporting this work, totaled 500 A100 GPU hours, were provided by High-Flyer AI. (Hangzhou High-Flyer AI Fundamental Research Co., Ltd.). J.Z was also supported by the XPlorer Prize.
228
+
229
+ References
230
+ [1] Matthew Amodio and Smita Krishnaswamy. Travelgan: Image-to-image translation by transformation vector learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8975–8984, 2019.
231
+ [2] Fan Bao, Chongxuan Li, Jun Zhu, and Bo Zhang. Analytic-dpm: an analytic estimate of the optimal reverse variance in diffusion probabilistic models. In International Conference on Learning Representations, 2021.
232
+ [3] Sagie Benaim and Lior Wolf. One-sided unsupervised domain mapping. Advances in Neural Information Processing Systems, 30, 2017.
233
+ [4] Mikołaj Binkowski, Danica J Sutherland, Michael Arbel, and Arthur Gretton. Demystifying ´ mmd gans. In International Conference on Learning Representations, 2018.
234
+ [5] Christopher M. Bishop. Pattern Recognition and Machine Learning. 2006.
235
+ [6] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. Advances in Neural Information Processing Systems, 29, 2016.
236
+ [7] Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. Ilvr: Conditioning method for denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14367–14376, 2021.
237
+ [8] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8188–8197, 2020.
238
+ [9] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34, 2021.
239
+ [10] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, Kun Zhang, and Dacheng Tao. Geometry-consistent generative adversarial networks for one-sided unsupervised domain mapping. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2427–2436, 2019.
240
+ [11] Aaron Gokaslan, Vivek Ramanujan, Daniel Ritchie, Kwang In Kim, and James Tompkin. Improving shape deformation in unsupervised image-to-image translation. In Proceedings of the European Conference on Computer Vision, pages 649–665, 2018.
241
+ [12] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in Neural Information Processing Systems, 27, 2014.
242
+ [13] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in Neural Information Processing Systems, 30, 2017.
243
+ [14] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
244
+ [15] Geoffrey E Hinton. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771–1800, 2002.
245
+ [16] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020.
246
+ [17] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised imageto-image translation. In Proceedings of the European Conference on Computer Vision, pages 172–189, 2018.
247
+ [18] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1125–1134, 2017.
248
+ [19] Liming Jiang, Changxu Zhang, Mingyang Huang, Chunxiao Liu, Jianping Shi, and Chen Change Loy. Tsit: A simple and versatile framework for image-to-image translation. In Proceedings of the European Conference on Computer Vision, pages 206–222, 2020.
249
+ [20] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations, 2018.
250
+ [21] Oren Katzir, Dani Lischinski, and Daniel Cohen-Or. Cross-domain cascaded deep translation. In Proceedings of the European Conference on Computer Vision, pages 673–689, 2020.
251
+ [22] Gwanghyun Kim, Taesung Kwon, and Jong Chul Ye. Diffusionclip: Text-guided diffusion models for robust image manipulation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2426–2435, 2022.
252
+ [23] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, pages 2649–2658, 2018.
253
+ [24] Junho Kim, Minjae Kim, Hyeonwoo Kang, and Kwang Hee Lee. U-gat-it: Unsupervised generative attentional networks with adaptive layer-instance normalization for image-to-image translation. In International Conference on Learning Representations, 2019.
254
+ [25] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In International Conference on Machine Learning, pages 1857–1865, 2017.
255
+ [26] Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In Proceedings of the European Conference on Computer Vision, pages 35–51, 2018.
256
+ [27] Minjun Li, Haozhi Huang, Lin Ma, Wei Liu, Tong Zhang, and Yugang Jiang. Unsupervised image-to-image translation with stacked cycle-consistent adversarial networks. In Proceedings of the European Conference on Computer Vision, pages 184–199, 2018.
257
+ [28] Alexander H Liu, Yen-Cheng Liu, Yu-Ying Yeh, and Yu-Chiang Frank Wang. A unified feature disentangler for multi-domain image translation and manipulation. Advances in Neural Information Processing Systems, 31, 2018.
258
+ [29] Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. Advances in Neural Information Processing Systems, 30, 2017.
259
+ [30] Xihui Liu, Dong Huk Park, Samaneh Azadi, Gong Zhang, Arman Chopikyan, Yuxiao Hu, Humphrey Shi, Anna Rohrbach, and Trevor Darrell. More control for free! image synthesis with semantic diffusion guidance. arXiv preprint arXiv:2112.05744, 2021.
260
+ [31] Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Dpm-solver: A fast ode solver for diffusion probabilistic model sampling in around 10 steps. arXiv preprint arXiv:2206.00927, 2022.
261
+ [32] Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. Sdedit: Guided image synthesis and editing with stochastic differential equations. In International Conference on Learning Representations, 2021.
262
+ [33] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
263
+ [34] Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pages 8162–8171, 2021.
264
+
265
+ [35] Yingxue Pang, Jianxin Lin, Tao Qin, and Zhibo Chen. Image-to-image translation: Methods and applications. IEEE Transactions on Multimedia, 2021.
266
+
267
+ [36] Taesung Park, Alexei A Efros, Richard Zhang, and Jun-Yan Zhu. Contrastive learning for unpaired image-to-image translation. In Proceedings of the European Conference on Computer Vision, pages 319–345, 2020.
268
+
269
+ [37] Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2337–2346, 2019.
270
+
271
+ [38] Taesung Park, Jun-Yan Zhu, Oliver Wang, Jingwan Lu, Eli Shechtman, Alexei Efros, and Richard Zhang. Swapping autoencoder for deep image manipulation. Advances in Neural Information Processing Systems, 33:7198–7211, 2020.
272
+
273
+ [40] Chitwan Saharia, William Chan, Huiwen Chang, Chris Lee, Jonathan Ho, Tim Salimans, David Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. In ACM SIGGRAPH, pages 1–10, 2022.
274
+
275
+ [41] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
276
+
277
+ [42] Eduardo Hugo Sanchez, Mathieu Serrurier, and Mathias Ortner. Learning disentangled representations via mutual information estimation. In Proceedings of the European Conference on Computer Vision, pages 205–221, 2020.
278
+
279
+ [43] Hiroshi Sasaki, Chris G Willcocks, and Toby P Breckon. Unit-ddpm: Unpaired image translation with denoising diffusion probabilistic models. arXiv preprint arXiv:2104.05358, 2021.
280
+
281
+ [44] Zhiqiang Shen, Mingyang Huang, Jianping Shi, Xiangyang Xue, and Thomas S Huang. Towards instance-level image-to-image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3683–3692, 2019.
282
+
283
+ [45] Assaf Shocher. Resizeright. https://github.com/assafshocher/ResizeRight, 2018.
284
+
285
+ [46] Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265, 2015.
286
+
287
+ [47] Yang Song, Conor Durkan, Iain Murray, and Stefano Ermon. Maximum likelihood training of score-based diffusion models. Advances in Neural Information Processing Systems, 34, 2021.
288
+
289
+ [48] Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019.
290
+
291
+ [49] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2020.
292
+
293
+ [51] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8798–8807, 2018.
294
+
295
+ [52] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600– 612, 2004.
296
+
297
+ [53] Wayne Wu, Kaidi Cao, Cheng Li, Chen Qian, and Chen Change Loy. Transgaga: Geometryaware unsupervised image-to-image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8012–8021, 2019.
298
+
299
+ [54] Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2849–2857, 2017.
300
+
301
+ [55] Pan Zhang, Bo Zhang, Dong Chen, Lu Yuan, and Fang Wen. Cross-domain correspondence learning for exemplar-based image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5143–5153, 2020.
302
+
303
+ [56] Yihao Zhao, Ruihai Wu, and Hao Dong. Unpaired image-to-image translation using adversarial consistency loss. In Proceedings of the European Conference on Computer Vision, pages 800–815, 2020.
304
+
305
+ [57] Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. The spatially-correlative loss for various image translation tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16407–16417, 2021.
306
+
307
+ [58] Wanfeng Zheng, Qiang Li, Guoxin Zhang, Pengfei Wan, and Zhongyuan Wang. Ittr: Unpaired image-to-image translation with transformers. arXiv preprint arXiv:2203.16015, 2022.
308
+
309
+ [59] Xingran Zhou, Bo Zhang, Ting Zhang, Pan Zhang, Jianmin Bao, Dong Chen, Zhongfei Zhang, and Fang Wen. Cocosnet v2: Full-resolution correspondence learning for image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11465–11475, 2021.
310
+
311
+ [60] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2223–2232, 2017.
312
+
313
+ # Checklist
314
+
315
+ 1. For all authors...
316
+
317
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
318
+ (b) Did you describe the limitations of your work? [Yes] See Section 6.
319
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
320
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
321
+
322
+ 2. If you are including theoretical results...
323
+
324
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] See Appendix A.1 (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A.4
325
+
326
+ 3. If you ran experiments...
327
+
328
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section 5 and Appendix B
329
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix B and Appendix C
330
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Table 1
331
+
332
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix B
333
+
334
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
335
+
336
+ (a) If your work uses existing assets, did you cite the creators? [Yes] See Section 5 and Appendix B
337
+ (b) Did you mention the license of the assets? [Yes] See Appendix B
338
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See Appendix B
339
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We use the public datasets.
340
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We use the public datasets.
341
+
342
+ 5. If you used crowdsourcing or conducted research with human subjects...
343
+
344
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
345
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
346
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/xxgp42Qz6dL/xxgp42Qz6dL_content_list.json ADDED
@@ -0,0 +1,1570 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "EGSDE: Unpaired Image-to-Image Translation via Energy-Guided Stochastic Differential Equations ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 191,
8
+ 122,
9
+ 808,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Min Zhao1, Fan Bao1, Chongxuan $\\mathbf { L i ^ { 2 , 3 * } }$ , $\\mathbf { J u n \\ : Z h u ^ { 1 * } }$ 1Dept. of Comp. Sci. & Tech., BNRist Center, THU-Bosch ML Center, Tsinghua University, China 2 Gaoling School of Artificial Intelligence, Renmin University of China, Beijing, China 3 Beijing Key Laboratory of Big Data Management and Analysis Methods , Beijing, China 4 Pazhou Laboratory (Huangpu), Guangzhou, China gracezhao1997@gmail.com; bf19@mails.tsinghua.edu.cn; chongxuanli@ruc.edu.cn; dcszj@tsinghua.edu.cn ",
17
+ "bbox": [
18
+ 186,
19
+ 224,
20
+ 836,
21
+ 325
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 361,
32
+ 535,
33
+ 377
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Score-based diffusion models (SBDMs) have achieved the SOTA FID results in unpaired image-to-image translation (I2I). However, we notice that existing methods totally ignore the training data in the source domain, leading to sub-optimal solutions for unpaired I2I. To this end, we propose energy-guided stochastic differential equations (EGSDE) that employs an energy function pretrained on both the source and target domains to guide the inference process of a pretrained SDE for realistic and faithful unpaired I2I. Building upon two feature extractors, we carefully design the energy function such that it encourages the transferred image to preserve the domain-independent features and discard domain-specific ones. Further, we provide an alternative explanation of the EGSDE as a product of experts, where each of the three experts (corresponding to the SDE and two feature extractors) solely contributes to faithfulness or realism. Empirically, we compare EGSDE to a large family of baselines on three widely-adopted unpaired I2I tasks under four metrics. EGSDE not only consistently outperforms existing SBDMs-based methods in almost all settings but also achieves the SOTA realism results without harming the faithful performance. Furthermore, EGSDE allows for flexible trade-offs between realism and faithfulness and we improve the realism results further (e.g., FID of 51.04 in $\\mathrm { C a t } \\to \\mathrm { D o g }$ and FID of 50.43 in Wild $ \\mathrm { D o g }$ on AFHQ) by tuning hyper-parameters. The code is available at https://github.com/ML-GSAI/EGSDE. ",
40
+ "bbox": [
41
+ 233,
42
+ 392,
43
+ 766,
44
+ 655
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 686,
55
+ 310,
56
+ 703
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Unpaired image-to-image translation (I2I) aims to transfer an image from a source domain to a related target domain, which involves a wide range of computer vision tasks such as style transfer, super-resolution and pose estimation [35]. In I2I, the translated image should be realistic to fit the style of the target domain by changing the domain-specific features accordingly, and faithful to preserve the domain-independent features of the source image. Over the past few years, generative adversarial networks [12] (GANs)-based methods [10, 60, 54, 36, 3, 57, 44, 19, 17, 26, 10] dominated this field due to their ability to generate high-quality samples. ",
63
+ "bbox": [
64
+ 174,
65
+ 718,
66
+ 825,
67
+ 815
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "In contrast to GANs, score-based diffusion models (SBDMs) [48, 16, 34, 49, 2, 31] perturb data to a Gaussian noise by a diffusion process and learn the reverse process to transform the noise back to the data distribution. Recently, SBDMs achieved competitive or even superior image generation performance to GANs [9] and thus were naturally applied to unpaired I2I [7, 32], which have achieved the state-of-the-art FID [13] and KID [4] results empirically. However, we notice that these methods did not leverage the training data in the source domain at all. Indeed, they trained a diffusion model solely on the target domain and exploited the test source image during inference (see details in Sec. 2.2). Therefore, we argue that if the training data in the source domain can be exploited together with those in the target domain, one can learn domain-specific and domain-independent features to improve both the realism and faithfulness of the SBDMs in unpaired I2I. ",
74
+ "bbox": [
75
+ 174,
76
+ 821,
77
+ 825,
78
+ 877
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "image",
84
+ "img_path": "images/e4f9c517b6ab668bf48e33cada856c01394347a9d7995779d0fca2fd5ec2550e.jpg",
85
+ "image_caption": [
86
+ "Figure 1: (a) Apart from the SDE, the EGSDE incorporates a realism expert and a faithful expert to preserve the domain-independent features and discard domain-specific ones. (b) Representative translation results on three unpaired I2I tasks. "
87
+ ],
88
+ "image_footnote": [],
89
+ "bbox": [
90
+ 214,
91
+ 88,
92
+ 790,
93
+ 382
94
+ ],
95
+ "page_idx": 1
96
+ },
97
+ {
98
+ "type": "text",
99
+ "text": "",
100
+ "bbox": [
101
+ 174,
102
+ 443,
103
+ 825,
104
+ 526
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "To this end, we propose energy-guided stochastic differential equations (EGSDE) that employs an energy function pretrained across the two domains to guide the inference process of a pretrained SDE for realistic and faithful unpaired I2I. Formally, EGSDE defines a valid conditional distribution via a reverse time SDE that composites the energy function and the pretrained SDE. Ideally, the energy function should encourage the transferred image to preserve the domain-independent features and discard domain-specific ones. To achieve this, we introduce two feature extractors that learn domainindependent features and domain-specific ones respectively, and define the energy function upon the similarities between the features extracted from the transferred image and the test source image. Further, we provide an alternative explanation of the discretization of EGSDE in the formulation of product of experts [15]. In particular, the pretrained SDE and the two feature extractors in the energy function correspond to three experts and each solely contributes to faithfulness or realism. ",
111
+ "bbox": [
112
+ 174,
113
+ 532,
114
+ 825,
115
+ 684
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "Empirically, we validate our method on the widely-adopted AFHQ [8] and CelebA-HQ [20] datasets including $\\mathrm { C a t } \\to \\mathrm { D o g }$ , Wild $ \\mathrm { D o g }$ and Male Female tasks. We compare to a large family of baselines, including the GANs-based ones [36, 60, 17, 26, 3, 10, 57, 58] and SBDMs-based ones [7, 32] under four metrics (e.g., FID). EGSDE not only consistently outperforms SBDMs-based methods in almost all settings but also achieves the SOTA realism results without harming the faithful performance. Furthermore, EGSDE allows for flexible trade-offs between realism and faithfulness and we improve the FID further (e.g., 51.04 in $\\mathbf { C a t } \\to \\mathbf { D o g }$ and 50.43 in Wild $ \\mathrm { D o g }$ ) by tuning hyper-parameters. EGSDE can also be extended to multi-domain translation easily. ",
122
+ "bbox": [
123
+ 174,
124
+ 690,
125
+ 825,
126
+ 803
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "2 Background ",
133
+ "text_level": 1,
134
+ "bbox": [
135
+ 174,
136
+ 824,
137
+ 308,
138
+ 840
139
+ ],
140
+ "page_idx": 1
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "2.1 Score-based Diffusion Models ",
145
+ "text_level": 1,
146
+ "bbox": [
147
+ 176,
148
+ 856,
149
+ 419,
150
+ 871
151
+ ],
152
+ "page_idx": 1
153
+ },
154
+ {
155
+ "type": "text",
156
+ "text": "Score-based diffusion models (SBDMs) gradually perturb data by a forward diffusion process, and then reverse it to recover the data [49, 2, 47, 16, 9]. Let $q ( \\pmb { y } _ { 0 } )$ be the unknown data distribution ",
157
+ "bbox": [
158
+ 176,
159
+ 883,
160
+ 823,
161
+ 911
162
+ ],
163
+ "page_idx": 1
164
+ },
165
+ {
166
+ "type": "text",
167
+ "text": "on $\\mathbb { R } ^ { D }$ . The forward diffusion process $\\{ y _ { t } \\} _ { t \\in [ 0 , T ] }$ , indexed by time $t$ , can be represented by the following forward SDE: ",
168
+ "bbox": [
169
+ 171,
170
+ 90,
171
+ 823,
172
+ 119
173
+ ],
174
+ "page_idx": 2
175
+ },
176
+ {
177
+ "type": "equation",
178
+ "img_path": "images/7fdd7012ee8973a56734148d2c5ce8753cc797ef79af812f19e823b8982f73f9.jpg",
179
+ "text": "$$\n\\begin{array} { r } { d \\pmb { y } = \\pmb { f } ( \\pmb { y } , t ) d t + \\pmb { g } ( t ) d \\pmb { w } , } \\end{array}\n$$",
180
+ "text_format": "latex",
181
+ "bbox": [
182
+ 408,
183
+ 123,
184
+ 588,
185
+ 141
186
+ ],
187
+ "page_idx": 2
188
+ },
189
+ {
190
+ "type": "text",
191
+ "text": "where ${ \\pmb w } \\in \\mathbb { R } ^ { D }$ is a standard Wiener process, $\\pmb { f } ( \\cdot , t ) : \\mathbb { R } ^ { D } \\mathbb { R } ^ { D }$ is the drift coefficient and $g ( t ) \\in \\mathbb { R }$ is the diffusion coefficient. The $f ( { \\boldsymbol { \\mathbf { \\mathit { y } } } } , t )$ and $g ( t )$ is related into the noise size and determines the perturbation kernel $q _ { t \\mid 0 } ( { \\pmb y } _ { t } | { \\pmb y } _ { 0 } )$ from time 0 to $t$ . In practice, the $f ( { \\boldsymbol { \\mathbf { \\mathit { y } } } } , t )$ is usually affine so that the the perturbation kernel is a linear Gaussian distribution and can be sampled in one step. ",
192
+ "bbox": [
193
+ 173,
194
+ 146,
195
+ 825,
196
+ 203
197
+ ],
198
+ "page_idx": 2
199
+ },
200
+ {
201
+ "type": "text",
202
+ "text": "Let $q _ { t } ( \\pmb { y } )$ be the marginal distribution of the SDE at time $t$ in Eq. (1). Its time reversal can be described by another SDE [49]: ",
203
+ "bbox": [
204
+ 173,
205
+ 208,
206
+ 823,
207
+ 238
208
+ ],
209
+ "page_idx": 2
210
+ },
211
+ {
212
+ "type": "equation",
213
+ "img_path": "images/3d7154cc2ac24289818f4661a30bc83fde67ad0b8715a9e0b7edbe544848397c.jpg",
214
+ "text": "$$\n\\mathrm { d } \\pmb { y } = [ \\pmb { f } ( \\pmb { y } , t ) - g ( t ) ^ { 2 } \\nabla _ { \\pmb { y } } \\log q _ { t } ( \\pmb { y } ) ] \\mathrm { d } t + g ( t ) \\mathrm { d } \\overline { { \\ b { w } } } ,\n$$",
215
+ "text_format": "latex",
216
+ "bbox": [
217
+ 334,
218
+ 241,
219
+ 663,
220
+ 260
221
+ ],
222
+ "page_idx": 2
223
+ },
224
+ {
225
+ "type": "text",
226
+ "text": "where $\\overline { { { \\bf w } } }$ is a reverse-time standard Wiener process, and $\\mathrm { d } t$ is an infinitesimal negative timestep. [49] adopts a score-based model $s ( \\boldsymbol { y } , t )$ to approximate the unknown $\\nabla _ { \\boldsymbol { y } } \\log q _ { t } ( \\boldsymbol { y } )$ by score matching, thus inducing a score-based diffusion model (SBDM), which is defined by a SDE: ",
227
+ "bbox": [
228
+ 174,
229
+ 263,
230
+ 830,
231
+ 305
232
+ ],
233
+ "page_idx": 2
234
+ },
235
+ {
236
+ "type": "equation",
237
+ "img_path": "images/6b122c4d00e65aa7451340eea0c633c3eab324f7d32bfe960d98afe079207e32.jpg",
238
+ "text": "$$\n\\mathrm { d } \\pmb { y } = [ \\pmb { f } ( \\pmb { y } , t ) - g ( t ) ^ { 2 } \\pmb { s } ( \\pmb { y } , t ) ] \\mathrm { d } t + g ( t ) \\mathrm { d } \\overline { { \\pmb { w } } } .\n$$",
239
+ "text_format": "latex",
240
+ "bbox": [
241
+ 354,
242
+ 308,
243
+ 643,
244
+ 327
245
+ ],
246
+ "page_idx": 2
247
+ },
248
+ {
249
+ "type": "text",
250
+ "text": "There are numerous SDE solver to solve the Eq. (3) to generate images. [49] discretizes it using the Euler-Maruyama solver. Formally, adopting a step size of $h$ , the iteration rule from $s$ to $t = s - h$ is: ",
251
+ "bbox": [
252
+ 173,
253
+ 330,
254
+ 825,
255
+ 359
256
+ ],
257
+ "page_idx": 2
258
+ },
259
+ {
260
+ "type": "equation",
261
+ "img_path": "images/78956e3eafa217b6491c68a8ae178e071050a181f8118313113e3fd0252f70f0.jpg",
262
+ "text": "$$\ny _ { t } = y _ { s } - [ f ( y _ { s } , s ) - g ( s ) ^ { 2 } s ( y _ { s } , s ) ] h + g ( s ) \\sqrt { h } z , \\quad z \\sim \\mathcal { N } ( \\mathbf { 0 } , I ) .\n$$",
263
+ "text_format": "latex",
264
+ "bbox": [
265
+ 271,
266
+ 363,
267
+ 727,
268
+ 383
269
+ ],
270
+ "page_idx": 2
271
+ },
272
+ {
273
+ "type": "text",
274
+ "text": "2.2 SBDMs in Unpaired Image to Image Translation ",
275
+ "text_level": 1,
276
+ "bbox": [
277
+ 174,
278
+ 397,
279
+ 552,
280
+ 412
281
+ ],
282
+ "page_idx": 2
283
+ },
284
+ {
285
+ "type": "text",
286
+ "text": "Given unpaired images from the source domain $\\boldsymbol { \\mathcal { X } } \\subset \\mathbb { R } ^ { D }$ and the target domain $\\mathcal { V } \\subset \\mathbb { R } ^ { D }$ as the training data, the goal of unpaired I2I is to transfer an image from the source domain to the target domain. Such a process can be formulated as designing a distribution $p ( \\pmb { y } _ { 0 } | \\pmb { x } _ { 0 } )$ on the target domain $\\mathcal { V }$ conditioned on an image $\\mathbf { \\boldsymbol { x } } _ { 0 } \\in \\mathcal { X }$ to transfer. The translated image should be realistic for the target domain by changing the domain-specific features and faithful for the source image by preserving the domain-independent features. ",
287
+ "bbox": [
288
+ 173,
289
+ 421,
290
+ 825,
291
+ 506
292
+ ],
293
+ "page_idx": 2
294
+ },
295
+ {
296
+ "type": "text",
297
+ "text": "ILVR [7] uses a diffusion model on the target domain for realism. Formally, ILVR starts from ${ \\pmb y } _ { T } \\sim \\mathcal { N } ( { \\bf 0 } , I )$ and samples from the diffusion model according to Eq. (4) to obtain ${ \\mathbf { } } _ { \\pmb { y } _ { t } }$ . For faithfulness, it further refines ${ \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\Xi } _ { \\mathbf { } } \\mathbf { \\Lambda } _ { \\mathbf { } } \\mathbf { \\Lambda } _ { \\mathbf { } } \\textbf { } _ { \\mathbf { } } \\textbf { } \\textbf { } _ { \\mathrm { } }$ by adding the residual between the sample ${ \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\mathbf { } } _ { \\mathbf { } } \\mathbf { \\Xi } _ { \\mathbf { } } \\mathbf { \\Lambda } _ { \\mathbf { } } \\mathbf { \\Lambda } _ { \\mathbf { } } \\textbf { } _ { \\mathbf { } } \\textbf { } \\textbf { } _ { \\mathrm { } }$ and the perturbed source image $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ through a non-trainable low-pass filter ",
298
+ "bbox": [
299
+ 174,
300
+ 512,
301
+ 825,
302
+ 568
303
+ ],
304
+ "page_idx": 2
305
+ },
306
+ {
307
+ "type": "equation",
308
+ "img_path": "images/6b0dc44fe869d8c520dddb624c3bdab3df81aeeb1f2ab564a557901a8fa05af5.jpg",
309
+ "text": "$$\n\\begin{array} { r } { \\pmb { y } _ { t } \\pmb { y } _ { t } + \\Phi ( \\pmb { x } _ { t } ) - \\Phi ( \\pmb { y } _ { t } ) , \\quad \\pmb { x } _ { t } \\sim q _ { t | 0 } ( \\pmb { x } _ { t } | \\pmb { x } _ { 0 } ) , } \\end{array}\n$$",
310
+ "text_format": "latex",
311
+ "bbox": [
312
+ 338,
313
+ 571,
314
+ 658,
315
+ 590
316
+ ],
317
+ "page_idx": 2
318
+ },
319
+ {
320
+ "type": "text",
321
+ "text": "where $\\Phi ( \\cdot )$ is a low-pass filter and $q _ { t | 0 } ( \\cdot | \\cdot )$ is the perturbation kernel determined by the forward SDE in Eq. (1). ",
322
+ "bbox": [
323
+ 174,
324
+ 594,
325
+ 823,
326
+ 625
327
+ ],
328
+ "page_idx": 2
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "Similarly, SDEdit [32] also adopts a SBDM on the target domain for realism, i.e., sampling from the SBDM according to Eq. (4). For faithfulness, SDEdit starts the generation process from the noisy source image ${ \\pmb y } _ { M } \\sim q _ { M | 0 } ( { \\pmb y } _ { M } | { \\pmb x } _ { 0 } )$ , where $M$ is a middle time between 0 and $T$ , and is chosen to preserve the original overall structure and discard local details. We use $p _ { r 1 } ( \\pmb { y } _ { 0 } \\vert \\pmb { x } _ { 0 } )$ to denote the marginal distribution defined by such SDE conditioned on $\\scriptstyle { \\mathbf { { \\mathit { x } } } } _ { 0 }$ . ",
333
+ "bbox": [
334
+ 173,
335
+ 628,
336
+ 825,
337
+ 702
338
+ ],
339
+ "page_idx": 2
340
+ },
341
+ {
342
+ "type": "text",
343
+ "text": "Notably, these methods did not leverage the training data in the source domain at all and thus can be sub-optimal in terms of both the realism and faithfulness in unpaired I2I. ",
344
+ "bbox": [
345
+ 173,
346
+ 707,
347
+ 821,
348
+ 736
349
+ ],
350
+ "page_idx": 2
351
+ },
352
+ {
353
+ "type": "text",
354
+ "text": "3 Method ",
355
+ "text_level": 1,
356
+ "bbox": [
357
+ 174,
358
+ 753,
359
+ 271,
360
+ 770
361
+ ],
362
+ "page_idx": 2
363
+ },
364
+ {
365
+ "type": "text",
366
+ "text": "To overcome the limitations of existing methods [7, 32] as highlighted in Sec. 2.2, we propose energy-guided stochastic differential equations (EGSDE) that employs an energy function pre-trained across the two domains to guide the inference process of a pretrained SDE for realistic and faithful unpaired I2I (see Fig. 2). EGSDE defines a valid conditional distribution $p ( \\pmb { y } _ { 0 } | \\pmb { x } _ { 0 } )$ by compositing a pretrained SDE and a pretrained energy function under mild regularity conditions2 as follows: ",
367
+ "bbox": [
368
+ 173,
369
+ 784,
370
+ 825,
371
+ 854
372
+ ],
373
+ "page_idx": 2
374
+ },
375
+ {
376
+ "type": "equation",
377
+ "img_path": "images/6edfa79b9bdc5b966730cafd7c94808991b1e2d396ae8ebaa56b9b280f0898b0.jpg",
378
+ "text": "$$\n\\mathrm { d } \\pmb { y } = [ \\pmb { f } ( \\pmb { y } , t ) - g ( t ) ^ { 2 } ( \\pmb { s } ( \\pmb { y } , t ) - \\nabla _ { \\pmb { y } } \\pmb { \\mathcal { E } } ( \\pmb { y } , \\pmb { x } _ { 0 } , t ) ) ] \\mathrm { d } t + g ( t ) \\mathrm { d } \\overline { { \\pmb { w } } } ,\n$$",
379
+ "text_format": "latex",
380
+ "bbox": [
381
+ 290,
382
+ 857,
383
+ 705,
384
+ 876
385
+ ],
386
+ "page_idx": 2
387
+ },
388
+ {
389
+ "type": "image",
390
+ "img_path": "images/f02446ab0e0da6321a04bce1eaa21fccc13f8b9fa4d36838329497b13c199608.jpg",
391
+ "image_caption": [
392
+ "Figure 2: The overview of our EGSDE. Starting from the noisy source image, we can run the EGSDE for unpaired I2I, which employs an energy function $\\boldsymbol { \\mathcal { E } } ( \\boldsymbol { y } , \\boldsymbol { x } , t )$ pretrained on both the source and target domains to guide the inference process of a pretrained SDE $( s ( \\pmb { y } , t )$ , realism expert 1). The energy function is decomposed into two terms further, where the realistic expert 2 $\\mathcal { E } _ { s } ( \\pmb { y } , \\pmb { x } , t )$ encourages the transferred image to discard domain-specific features and the faithful expert $\\mathcal { E } _ { i } ( \\pmb { y } , \\pmb { x } , t )$ aims to preserve the domain-independent ones. "
393
+ ],
394
+ "image_footnote": [],
395
+ "bbox": [
396
+ 184,
397
+ 94,
398
+ 815,
399
+ 290
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "where $\\overline { { { \\bf w } } }$ is a reverse-time standard Wiener process, $\\mathrm { d } t$ is an infinitesimal negative timestep, $s ( \\cdot , \\cdot ) :$ $\\mathbb { R } ^ { D } \\times \\mathbb { R } \\mathbb { R } ^ { D }$ is the score-based model in the pretrained SDE and $\\mathcal { E } ( \\cdot , \\cdot , \\cdot ) : \\bar { \\mathbb { R } ^ { D } } \\times \\mathbb { R } ^ { D } \\times \\bar { \\mathbb { R } } \\stackrel { \\cdot } { } \\bar { \\mathbb { R } }$ is the energy function. The start point ${ \\pmb y } _ { M }$ is sampled from the perturbation distribution $q _ { M | 0 } ( { \\pmb y } _ { M } | { \\pmb x } _ { 0 } )$ [32], where $M = 0 . 5 T$ typically. We obtain the transferred images by taking the samples at endpoint $t = 0$ following the SDE in Eq. (6). ",
406
+ "bbox": [
407
+ 173,
408
+ 390,
409
+ 826,
410
+ 460
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "text",
416
+ "text": "Similar to the prior work [7, 32], EGSDE employs an SDE trained solely in the target domain as in Eq. (2), which defines a marginal distribution of the target images and mainly contributes to the realism of the transferred samples. In contrast, the energy function involves the training data across both the source and target domain, making EGSDE distinct from the prior work [7, 32]. Notably, although many other possibilities exist, we carefully design the energy function such that it (approximately) encourages the sample to retain the domain-independent features and discard the domain-specific ones to improve both the faithfulness and realism of the transferred sample. Below, we formally formulate the energy function. ",
417
+ "bbox": [
418
+ 173,
419
+ 465,
420
+ 826,
421
+ 578
422
+ ],
423
+ "page_idx": 3
424
+ },
425
+ {
426
+ "type": "text",
427
+ "text": "3.1 Choice of Energy ",
428
+ "text_level": 1,
429
+ "bbox": [
430
+ 174,
431
+ 593,
432
+ 333,
433
+ 608
434
+ ],
435
+ "page_idx": 3
436
+ },
437
+ {
438
+ "type": "text",
439
+ "text": "In this section, we show how to design the energy function. Intuitively, during the translation, the domain-independent features (pose, color, etc. on $\\mathbf { C a t } \\to \\mathbf { D o g }$ ) should be preserved while the domain-specific features (beard, nose, etc. on $\\mathrm { C a t } \\to \\mathrm { D o g }$ ) should be changed accordingly. Motivated by this, we decompose the energy function $\\mathcal { E } ( \\boldsymbol { y } , \\boldsymbol { x } , t )$ as the sum of two log potential functions [5]: ",
440
+ "bbox": [
441
+ 173,
442
+ 618,
443
+ 825,
444
+ 674
445
+ ],
446
+ "page_idx": 3
447
+ },
448
+ {
449
+ "type": "equation",
450
+ "img_path": "images/2909a20191a71a4ebb51283e8183bfde688ccd8aac07e8e994a500434b23e4ba.jpg",
451
+ "text": "$$\n\\begin{array} { r l } & { \\mathcal { E } ( { \\pmb y } , { \\pmb x } , t ) = \\lambda _ { s } \\mathcal { E } _ { s } ( { \\pmb y } , { \\pmb x } , t ) + \\lambda _ { i } \\mathcal { E } _ { i } ( { \\pmb y } , { \\pmb x } , t ) } \\\\ & { \\qquad = \\lambda _ { s } \\mathbb { E } _ { q _ { t \\vert 0 } ( { \\pmb x } _ { t } \\vert { \\pmb x } ) } \\mathcal { S } _ { s } ( { \\pmb y } , { \\pmb x } _ { t } , t ) - \\lambda _ { i } \\mathbb { E } _ { q _ { t \\vert 0 } ( { \\pmb x } _ { t } \\vert { \\pmb x } ) } \\mathcal { S } _ { i } ( { \\pmb y } , { \\pmb x } _ { t } , t ) , } \\end{array}\n$$",
452
+ "text_format": "latex",
453
+ "bbox": [
454
+ 281,
455
+ 679,
456
+ 715,
457
+ 717
458
+ ],
459
+ "page_idx": 3
460
+ },
461
+ {
462
+ "type": "text",
463
+ "text": "where $\\mathcal { E } _ { i } ( \\cdot , \\cdot , \\cdot ) : \\mathbb { R } ^ { D } \\times \\mathbb { R } ^ { D } \\times \\mathbb { R } \\mathbb { R }$ and $\\mathcal { E } _ { s } ( \\cdot , \\cdot , \\cdot ) : \\mathbb { R } ^ { D } \\times \\mathbb { R } ^ { D } \\times \\mathbb { R } \\mathbb { R }$ are the log potential functions, $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ is the perturbed source image in the forward SDE, $q _ { t | 0 } ( \\cdot | \\cdot )$ is the perturbation kernel from time 0 to time $t$ in the forward SDE, $S _ { s } ( \\cdot , \\cdot , \\cdot ) : \\mathbb { R } ^ { D } \\times \\mathbb { R } ^ { D } \\times \\mathbb { R } \\mathbb { R }$ and $S _ { i } ( \\cdot , \\cdot , \\cdot ) : \\mathbb { R } ^ { D } \\times \\mathbb { R } ^ { D } \\times \\mathbb { R } \\mathbb { R }$ are two functions measuring the similarity between the sample and perturbed source image, and $\\lambda _ { s } \\in \\mathbb { R } _ { > 0 } , \\lambda _ { i } \\in \\mathbb { R } _ { > 0 }$ are two weighting hyper-parameters. Note that the expectation w.r.t. $q _ { t | 0 } ( \\pmb { x } _ { t } | \\pmb { x } )$ in Eq. (7) guarantees that the energy function changes slowly over the trajectory to satisfy the regularity conditions in Appendix A.1. ",
464
+ "bbox": [
465
+ 173,
466
+ 720,
467
+ 825,
468
+ 821
469
+ ],
470
+ "page_idx": 3
471
+ },
472
+ {
473
+ "type": "text",
474
+ "text": "To specify $S _ { s } ( \\cdot , \\cdot , \\cdot )$ , we introduce a time-dependent domain-specific feature extractor $E _ { s } ( \\cdot , \\cdot ) :$ $\\mathbb { R } ^ { D } \\times \\mathbb { R } \\stackrel { \\cdot } { \\to } \\mathbb { R } ^ { C \\times H \\times W }$ , where $C$ is the channel-wise dimension, $H$ and $W$ are the dimension of height and width. In particular, $E _ { s } ( \\cdot , \\cdot )$ is the all but the last layer of a classifier that is trained on both domains to predict whether an image is from the source domain or the target domain. Intuitively, $E _ { s } ( \\cdot , \\cdot )$ will preserve the domain-specific features and discard the domain-independent features for accurate predictions. Building upon it, $S _ { s } ( \\cdot , \\cdot , \\cdot )$ is defined as the cosine similarity between the features extracted from the generated sample and the source image as follows: ",
475
+ "bbox": [
476
+ 174,
477
+ 827,
478
+ 825,
479
+ 912
480
+ ],
481
+ "page_idx": 3
482
+ },
483
+ {
484
+ "type": "text",
485
+ "text": "",
486
+ "bbox": [
487
+ 173,
488
+ 90,
489
+ 684,
490
+ 106
491
+ ],
492
+ "page_idx": 4
493
+ },
494
+ {
495
+ "type": "equation",
496
+ "img_path": "images/f2f9ff783744976c60d7ed6226be84683d7db556d9a703632aaf48c157689b87.jpg",
497
+ "text": "$$\n\\displaystyle \\mathcal { S } _ { s } ( { \\pmb y } , { \\pmb x } _ { t } , t ) = \\frac { 1 } { H W } \\sum _ { h , w } \\frac { E _ { s } ^ { h w } ( { \\pmb x } _ { t } , t ) ^ { \\top } E _ { s } ^ { h w } ( { \\pmb y } , t ) } { | | E _ { s } ^ { h w } ( { \\pmb x } _ { t } , t ) | | _ { 2 } | | E _ { s } ^ { h w } ( { \\pmb y } , t ) | | _ { 2 } } ,\n$$",
498
+ "text_format": "latex",
499
+ "bbox": [
500
+ 312,
501
+ 112,
502
+ 684,
503
+ 154
504
+ ],
505
+ "page_idx": 4
506
+ },
507
+ {
508
+ "type": "text",
509
+ "text": "where $E _ { s } ^ { h w } ( \\cdot , \\cdot ) \\in \\mathbb { R } ^ { C }$ denote the channel-wise feature at spatial position $( h , w )$ . Here we employ the cosine similarity since it preserves the spatial information and helps to improve the FID score empirically (see Appendix C.1 for the ablation study). Intuitively, reducing the energy value in Eq. (7) encourages the transferred sample to discard the domain-specific features to improve realism. ",
510
+ "bbox": [
511
+ 174,
512
+ 161,
513
+ 825,
514
+ 218
515
+ ],
516
+ "page_idx": 4
517
+ },
518
+ {
519
+ "type": "text",
520
+ "text": "To specify $S _ { i } ( \\cdot , \\cdot , \\cdot )$ , we introduce a domain-independent feature extractor $E _ { i } ( \\cdot , \\cdot ) : \\mathbb { R } ^ { D } \\times \\mathbb { R } \\to \\mathbb { R } ^ { D }$ , which is a low-pass filter. Intuitively, $E _ { i } ( \\cdot , \\cdot )$ will preserve the overall structures (i.e., domainindependent features) and discard local information like textures (i.e., domain-specific features). Building upon it, $S _ { i } ( \\cdot , \\cdot , \\cdot )$ is defined as the negative squared $L _ { 2 }$ distance between the features extracted from the generated sample and source image as follows: ",
521
+ "bbox": [
522
+ 173,
523
+ 223,
524
+ 826,
525
+ 294
526
+ ],
527
+ "page_idx": 4
528
+ },
529
+ {
530
+ "type": "equation",
531
+ "img_path": "images/9792b83d302f3037271af1dfcbfa57c4ff99af3c3ddc20a3fcffddacd73619c0.jpg",
532
+ "text": "$$\n\\begin{array} { r } { S _ { i } ( { \\pmb y } , { \\pmb x } _ { t } , t ) = - | | E _ { i } ( { \\pmb y } , t ) - E _ { i } ( { \\pmb x } _ { t } , t ) | | _ { 2 } ^ { 2 } . } \\end{array}\n$$",
533
+ "text_format": "latex",
534
+ "bbox": [
535
+ 359,
536
+ 299,
537
+ 637,
538
+ 318
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "text",
544
+ "text": "Here, we choose negative squared $L _ { 2 }$ distance as the similarity metric because it helps to preserve more domain-independent features empirically (see Appendix C.1 for the ablation study). Intuitively, reducing the energy value in Eq. (7) encourages the transferred sample to preserve the domainindependent features to improve faithfulness. In this paper we employ a low-pass filter for its simpleness and effectiveness while we can train more sophisticated $E _ { i }$ , e.g., based on disentangled representation learning methods [42, 6, 14, 23, 28], on the data in the two domains. ",
545
+ "bbox": [
546
+ 173,
547
+ 324,
548
+ 825,
549
+ 409
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "In our preliminary experiment, alternative to Eq. (7), we consider a simpler energy function that only involves the original source image $_ { \\textbf { \\em x } }$ as follows: ",
556
+ "bbox": [
557
+ 173,
558
+ 414,
559
+ 823,
560
+ 443
561
+ ],
562
+ "page_idx": 4
563
+ },
564
+ {
565
+ "type": "equation",
566
+ "img_path": "images/53f3b60854b25cbbfb4b5aafa8cf23da90e353c0a613045599c49adb41d35c04.jpg",
567
+ "text": "$$\n\\begin{array} { r } { \\mathcal { E } ( \\pmb { y } , \\pmb { x } , t ) = \\lambda _ { s } S _ { s } ( \\pmb { y } , \\pmb { x } , t ) - \\lambda _ { i } S _ { i } ( \\pmb { y } , \\pmb { x } , t ) , } \\end{array}\n$$",
568
+ "text_format": "latex",
569
+ "bbox": [
570
+ 356,
571
+ 449,
572
+ 640,
573
+ 467
574
+ ],
575
+ "page_idx": 4
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "which does not require to take the expectation w.r.t. $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ . We found that it did not perform well because it is not reasonable to measure the similarity between the noise-free source image and the transferred sample in a gradual denoising process. See Appendix C.2 for empirical results. ",
580
+ "bbox": [
581
+ 173,
582
+ 473,
583
+ 825,
584
+ 515
585
+ ],
586
+ "page_idx": 4
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "3.2 Solving the Energy-guided Reverse-time SDE ",
591
+ "text_level": 1,
592
+ "bbox": [
593
+ 173,
594
+ 531,
595
+ 529,
596
+ 546
597
+ ],
598
+ "page_idx": 4
599
+ },
600
+ {
601
+ "type": "text",
602
+ "text": "Based on the pretrained score-based model $s ( \\boldsymbol { y } , t )$ and energy function $\\boldsymbol { \\mathcal { E } } ( \\boldsymbol { y } , \\boldsymbol { x } , t )$ , we can solve the proposed energy-guided SDE to generate samples from conditional distribution $p ( \\pmb { y } _ { 0 } | \\pmb { x } _ { 0 } )$ . There are numerical solvers to approximate trajectories from SDEs. In this paper, we take the Euler-Maruyama solver following [32] for a fair comparison. Given the EGSDE as in Eq. (6) and adopting a step size $h$ , the iteration rule from $s$ to $t = s - h$ is: ",
603
+ "bbox": [
604
+ 173,
605
+ 555,
606
+ 825,
607
+ 626
608
+ ],
609
+ "page_idx": 4
610
+ },
611
+ {
612
+ "type": "equation",
613
+ "img_path": "images/9febdabb7cb1ea780b31fbc06129d05c10793f69a073522138d1fba43841cdec.jpg",
614
+ "text": "$$\ny _ { t } = y _ { s } - [ f ( y , s ) - g ( s ) ^ { 2 } ( s ( y _ { s } , s ) - \\nabla _ { y } \\mathcal { E } ( y _ { s } , x _ { 0 } , s ) ) ] h + g ( s ) \\sqrt { h } z , \\quad z \\sim \\mathcal { N } ( \\mathbf { 0 } , I ) .\n$$",
615
+ "text_format": "latex",
616
+ "bbox": [
617
+ 194,
618
+ 632,
619
+ 779,
620
+ 652
621
+ ],
622
+ "page_idx": 4
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "The expectation in $\\mathcal { E } ( \\pmb { y } _ { s } , \\pmb { x } _ { 0 } , s )$ is estimated by the Monte Carlo method of a single sample for efficiency. For brevity, we present the general sampling procedure of our method in Algorithm 1. In experiments, we use the variance preserve energy-guided SDE (VP-EGSDE) [49, 16] and the details are explained in Appendix A.3, where we can modify the noise prediction network to $\\tilde { \\epsilon } ( \\pmb { y } , \\pmb { x } _ { 0 } , t ) = \\epsilon ( \\pmb { y } , t ) + \\sqrt { \\bar { \\beta } _ { t } } \\nabla _ { \\pmb { y } } \\mathcal { E } ( \\pmb { y } , \\pmb { x } _ { 0 } , t )$ and take it into the sampling procedure in DDPM [16]. Following SDEdit [32], we further extend this by repeating the Algorithm 1 $K$ times (see details in Appendix A.2). Further, we explain the connection with classifier guidance[9] in Appendix A.5. ",
627
+ "bbox": [
628
+ 173,
629
+ 665,
630
+ 826,
631
+ 766
632
+ ],
633
+ "page_idx": 4
634
+ },
635
+ {
636
+ "type": "text",
637
+ "text": "3.3 EGSDE as Product of Experts ",
638
+ "text_level": 1,
639
+ "bbox": [
640
+ 174,
641
+ 781,
642
+ 423,
643
+ 796
644
+ ],
645
+ "page_idx": 4
646
+ },
647
+ {
648
+ "type": "text",
649
+ "text": "Inspired by the posterior inference process in diffusion models [46], we present a product of experts [15] explanation for the discretized sampling process of EGSDE, which formalizes our motivation in an alternative perspective and provides insights on the role of each component in EGSDE. ",
650
+ "bbox": [
651
+ 173,
652
+ 806,
653
+ 826,
654
+ 849
655
+ ],
656
+ "page_idx": 4
657
+ },
658
+ {
659
+ "type": "text",
660
+ "text": "We first define a conditional distribution $\\tilde { p } ( \\boldsymbol y _ { t } | \\boldsymbol x _ { 0 } )$ at time $t$ as a product of experts: ",
661
+ "bbox": [
662
+ 173,
663
+ 854,
664
+ 715,
665
+ 871
666
+ ],
667
+ "page_idx": 4
668
+ },
669
+ {
670
+ "type": "equation",
671
+ "img_path": "images/750ae0644c13e6c297c366af0a9dde4f45a368731183d7708a7a90744b4d459b.jpg",
672
+ "text": "$$\n\\tilde { p } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) = \\frac { p _ { r 1 } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) p _ { e } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) } { Z _ { t } } ,\n$$",
673
+ "text_format": "latex",
674
+ "bbox": [
675
+ 383,
676
+ 876,
677
+ 612,
678
+ 910
679
+ ],
680
+ "page_idx": 4
681
+ },
682
+ {
683
+ "type": "table",
684
+ "img_path": "images/7183500eca02f6cfe58dbe289bf343a4805222f4e7c0b08e08fec905e37d9ddf.jpg",
685
+ "table_caption": [],
686
+ "table_footnote": [],
687
+ "table_body": "<table><tr><td>Require: the source image xo, the initial time M,denoising steps N, weighting hyper-parameters Xs,入i, the similarity function Ss(·,:,·),Si(·,:,·), the score function s(·,·) y~qm|o(y|xo) # the start point h= N fori=Nto1do</td></tr><tr><td></td></tr><tr><td>s←ih</td></tr><tr><td>x ~ qs|o(x|xo) # sample perturbed source image from the perturbation kernel</td></tr><tr><td>£(y,x,s) ← λsSs(y,x,s) - XiSi(y,x,s) # compute energy with one Monte Carlo</td></tr><tr><td>y ← y-[f(y,s) - g(s)²(s(y,s) - Vyε(y,x,s))]h# the update rule in Eq. (12) z~N(0,I)ifi&gt;1,else z=0</td></tr><tr><td>y←y+g(s)√hz</td></tr><tr><td>end for yo←y</td></tr></table>",
688
+ "bbox": [
689
+ 173,
690
+ 109,
691
+ 828,
692
+ 315
693
+ ],
694
+ "page_idx": 5
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "where $Z _ { t }$ is the partition function, $p _ { e } ( { \\pmb y } _ { t } | { \\pmb x } _ { 0 } ) \\propto \\exp ( - \\mathcal { E } ( { \\pmb y } _ { t } , { \\pmb x } _ { 0 } , t ) )$ and $p _ { r 1 } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } )$ is the marginal distribution at time $t$ defined by SDEdit based on a pretrained SDE on the target domain. ",
699
+ "bbox": [
700
+ 171,
701
+ 340,
702
+ 823,
703
+ 369
704
+ ],
705
+ "page_idx": 5
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "To sample from $\\tilde { p } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } )$ , we need to construct a transition kernel $\\tilde { p } ( \\boldsymbol { y } _ { t } | \\boldsymbol { y } _ { s } )$ , where $t = s - h$ and $h$ is small. Following [46], using the desirable equilibrium $\\begin{array} { r } { \\tilde { p } ( { \\pmb y } _ { t } | { \\pmb x } _ { 0 } ) = \\int \\tilde { p } ( { \\pmb y } _ { t } | { \\pmb y } _ { s } ) \\tilde { p } ( { \\pmb y } _ { s } | { \\pmb x } _ { 0 } ) d { \\pmb y } _ { s } } \\end{array}$ , we construct the $\\tilde { p } ( y _ { t } | y _ { s } )$ as follows: ",
710
+ "bbox": [
711
+ 173,
712
+ 376,
713
+ 825,
714
+ 417
715
+ ],
716
+ "page_idx": 5
717
+ },
718
+ {
719
+ "type": "equation",
720
+ "img_path": "images/0f1cc4b7da7f782ca184dac442ed178ef8d929f0586f1b2f4425d3ee16c4ad3c.jpg",
721
+ "text": "$$\n\\tilde { p } ( { \\pmb y } _ { t } | { \\pmb y } _ { s } ) = \\frac { p ( { \\pmb y } _ { t } | { \\pmb y } _ { s } ) p _ { e } ( { \\pmb y } _ { t } | { \\pmb x } _ { 0 } ) } { \\tilde { Z } _ { t } ( { \\pmb y } _ { s } ) } ,\n$$",
722
+ "text_format": "latex",
723
+ "bbox": [
724
+ 392,
725
+ 422,
726
+ 606,
727
+ 459
728
+ ],
729
+ "page_idx": 5
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "where $\\tilde { Z } _ { t } ( y _ { s } )$ is the partition function and $p ( \\pmb { y } _ { t } | \\pmb { y } _ { s } ) = \\mathcal { N } ( \\pmb { \\mu } ( \\pmb { y } _ { s } , h ) , \\Sigma ( s , h ) \\pmb { I } )$ is the transition kernel of the pretrained SDE in Eq. (4), i.e., $\\pmb { \\mu } ( \\pmb { y } _ { s } , h ) = \\pmb { y } _ { s } - [ \\pmb { f } ( \\pmb { y } _ { s } , s ) - g ( s ) ^ { 2 } \\pmb { s } ( \\pmb { y } _ { s } , s ) ] h$ and $\\Sigma ( s , h ) = g ( \\dot { s } ) ^ { 2 } h$ . Assuming that $\\mathcal { E } ( \\boldsymbol { y } _ { t } , \\boldsymbol { x } _ { 0 } , t )$ has low curvature relative to $\\Sigma ( s , h ) ^ { - 1 }$ , it can be approximated using Taylor expansion around $\\dot { \\mu } ( y _ { s } , h )$ and further we can obtain ",
734
+ "bbox": [
735
+ 173,
736
+ 465,
737
+ 825,
738
+ 523
739
+ ],
740
+ "page_idx": 5
741
+ },
742
+ {
743
+ "type": "equation",
744
+ "img_path": "images/ad3649e888ae247cbcdd7190eb414cfa89795bc50bf6a80d8766f8ef56ab95a0.jpg",
745
+ "text": "$$\n\\tilde { p } ( \\boldsymbol { y } _ { t } | \\boldsymbol { y } _ { s } ) \\approx \\mathcal { N } ( \\mu ( \\boldsymbol { y } _ { s } , h ) - \\Sigma ( s , h ) \\nabla _ { \\boldsymbol { y } ^ { \\prime } } \\mathcal { E } ( \\boldsymbol { y } ^ { \\prime } , \\boldsymbol { x } _ { 0 } , t ) | _ { \\boldsymbol { y } ^ { \\prime } = \\mu ( \\boldsymbol { y } _ { s } , h ) } , \\Sigma ( s , h ) I ) .\n$$",
746
+ "text_format": "latex",
747
+ "bbox": [
748
+ 258,
749
+ 529,
750
+ 740,
751
+ 547
752
+ ],
753
+ "page_idx": 5
754
+ },
755
+ {
756
+ "type": "text",
757
+ "text": "More details about derivation are available in Appendix A.4. We can observe the transition kernel $\\tilde { p } ( y _ { t } | y _ { s } )$ in (15) is equal to the discretization of our EGSDE in Eq. (12). Therefore, solving the energy-guided SDE in a discretization manner is approximately equivalent to drawing samples from a product of experts in Eq. (13). Note that $\\begin{array} { r } { \\mathcal { E } ( { \\bf y } _ { t } , { \\bf x } _ { 0 } , t ) = \\lambda _ { s } \\mathcal { E } _ { s } ( { \\bf y } _ { t } , { \\bf x } _ { 0 } , t ) + \\lambda _ { i } \\mathcal { E } _ { i } ( { \\bf y } _ { t } , { \\bf x } _ { 0 } , t ) } \\end{array}$ , the $\\tilde { p } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } )$ can be rewritten as: ",
758
+ "bbox": [
759
+ 173,
760
+ 551,
761
+ 825,
762
+ 622
763
+ ],
764
+ "page_idx": 5
765
+ },
766
+ {
767
+ "type": "equation",
768
+ "img_path": "images/c67ac538a792b8ff4821f7870c1a9ca746cc96f1ec7aef398b9af0ef14f33a77.jpg",
769
+ "text": "$$\n\\tilde { p } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) = \\frac { p _ { r 1 } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) p _ { r 2 } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) p _ { f } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) } { Z _ { t } } ,\n$$",
770
+ "text_format": "latex",
771
+ "bbox": [
772
+ 346,
773
+ 627,
774
+ 650,
775
+ 661
776
+ ],
777
+ "page_idx": 5
778
+ },
779
+ {
780
+ "type": "equation",
781
+ "img_path": "images/b4c6ca0b0c510c7d6d130e21acd78c5fa283db1c378a03b84220ddeab459b230.jpg",
782
+ "text": "$$\n\\begin{array} { r } { p _ { r 2 } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) \\propto \\exp ( - \\lambda _ { s } \\pmb { \\mathcal { E } } _ { s } ( \\pmb { y } _ { t } , \\pmb { x } _ { 0 } , t ) ) , p _ { f } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } ) \\propto \\exp ( - \\lambda _ { i } \\pmb { \\mathcal { E } } _ { i } ( \\pmb { y } _ { t } , \\pmb { x } _ { 0 } , t ) ) . } \\end{array}\n$$",
783
+ "text_format": "latex",
784
+ "bbox": [
785
+ 215,
786
+ 665,
787
+ 709,
788
+ 683
789
+ ],
790
+ "page_idx": 5
791
+ },
792
+ {
793
+ "type": "text",
794
+ "text": "In Eq. (16), by setting $t = 0$ , we can explain that the transferred samples approximately follow the distribution defined by the product of three experts, where $p _ { r 1 } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } )$ and $p _ { r 2 } ( { \\pmb y } _ { t } | { \\pmb x } _ { 0 } )$ are the realism experts and $p _ { f } ( \\pmb { y } _ { t } | \\pmb { x } _ { 0 } )$ is the faithful expert, corresponding to the score function $s ( \\pmb { y } , t )$ and the log potential functions $\\mathcal { E } _ { s } ( \\pmb { y } , \\pmb { x } , t )$ and $\\mathcal { E } _ { i } ( \\pmb { y } , \\pmb { x } , t )$ respectively. Such a formulation clearly explains the role of each expert in EGSDE and supports our empirical results. ",
795
+ "bbox": [
796
+ 173,
797
+ 686,
798
+ 825,
799
+ 758
800
+ ],
801
+ "page_idx": 5
802
+ },
803
+ {
804
+ "type": "text",
805
+ "text": "4 Related work ",
806
+ "text_level": 1,
807
+ "bbox": [
808
+ 174,
809
+ 776,
810
+ 316,
811
+ 792
812
+ ],
813
+ "page_idx": 5
814
+ },
815
+ {
816
+ "type": "text",
817
+ "text": "Apart from the prior work mentioned before, we discuss other related work including GANs-based methods for unpaired I2I and SBDMs-based methods for image translation. ",
818
+ "bbox": [
819
+ 173,
820
+ 806,
821
+ 823,
822
+ 835
823
+ ],
824
+ "page_idx": 5
825
+ },
826
+ {
827
+ "type": "text",
828
+ "text": "GANs-based methods for Unpaired I2I. Although previous paired image translation methods have also achieved remarkable performances [18, 51, 50, 37, 55, 59], we mainly focus on unpaired image translation in this work. The methods for two-domain unpaired I2I are mainly divided into two classes: two-side and one-side mapping [35, 57]. In the two-side framework [60, 54, 25, 29, 27, 24, 11, 1, 53, 56, 21], the cycle-consistency constraint is the most widely-used strategy such as in ",
829
+ "bbox": [
830
+ 174,
831
+ 842,
832
+ 825,
833
+ 911
834
+ ],
835
+ "page_idx": 5
836
+ },
837
+ {
838
+ "type": "image",
839
+ "img_path": "images/7e5f3d8c47fa9b4d68b3c9eb2833fd0a2841ad7f41bb5d2ed150deabeb7f64f1.jpg",
840
+ "image_caption": [
841
+ "Figure 3: The qualitative comparison on $\\mathrm { C a t } \\to \\mathrm { D o g }$ , Wild Dog and Male Female. Our method achieved better visual quality for both realism and faithfulness. For example, in the forth column, we successfully preserve the domain-independent features (i.e. green ground, pose and yellow color of body) and discard the domain-specific ones (i.e. leopard print). "
842
+ ],
843
+ "image_footnote": [],
844
+ "bbox": [
845
+ 179,
846
+ 98,
847
+ 812,
848
+ 481
849
+ ],
850
+ "page_idx": 6
851
+ },
852
+ {
853
+ "type": "text",
854
+ "text": "CycleGAN [60], DualGAN [54] and DiscoGAN [25]. The key idea is that the translated image should be able to be reconstructed by an inverse mapping. More recently, there are numerical studies to improve this such as SCAN [27] and U-GAT-IT [24]. Specifically, U-GAT-IT [24] applies an attention module to let the generator and discriminator focus on more important regions instead of the whole regions through the auxiliary classifier. Since such bijective projection is too restrictive, several studies are devoted to one-side mapping [36, 3, 10, 60, 57, 38, 19]. One representative approach is to design some kind of geometry distance to preserve content [35]. For example, DistanceGAN [3] keeps the distances between images within domains. GCGAN [10] maintains geometry-consistency between input and output. CUT [36] maximizes the mutual information between the input and output using contrastive learning. LSeSim [57] learns spatially-correlative representation to preserve scene structure consistency via self-similarities. ",
855
+ "bbox": [
856
+ 174,
857
+ 573,
858
+ 825,
859
+ 726
860
+ ],
861
+ "page_idx": 6
862
+ },
863
+ {
864
+ "type": "text",
865
+ "text": "SBDMs-based methods for Image Translation. Several studies leveraged SBDMs for image translation due to their powerful generative ability and achieved good results. For example, DiffusionCLIP [22] fine-tune the score network with CLIP [39] loss, which is applied on text-driven image manipulation, zero-shot image manipulation and multi-attribute transfer successfully. GLIDE [33] and SDG [30] has achieved great performance on text-to-image translation. As for I2I, SR3 [41] and Palette [40] learn a conditional SBDM and outperform state-of-art GANs-based methods on super-resolution, colorization and so on, which needs paired data. For unpaired I2I, UNIT-DDPM [43] learns two SBDMs and two domain translation models using cycle-consistency loss. Compared with it, our method only needs one SBDM on the target domain, which is a kind of one-side mapping. ILVR [7] and SDEdit [32] utilize a SBDM on the target domain and exploited the test source image to refine inference, which ignored the training data in the source domain. Compared with these methods, our method employs an energy function pretrained across both the source and target domains to improve the realism and faithfulness of translated images. ",
866
+ "bbox": [
867
+ 173,
868
+ 731,
869
+ 825,
870
+ 911
871
+ ],
872
+ "page_idx": 6
873
+ },
874
+ {
875
+ "type": "text",
876
+ "text": "5 Experiment ",
877
+ "text_level": 1,
878
+ "bbox": [
879
+ 174,
880
+ 89,
881
+ 303,
882
+ 107
883
+ ],
884
+ "page_idx": 7
885
+ },
886
+ {
887
+ "type": "text",
888
+ "text": "Datasets. We validated the EGSDE on following datasets, where all images are resized to $2 5 6 \\times 2 5 6$ : (1) CelebA-HQ [20] contains high quality face images and is separated into two domains: male and female. Each category has 1000 testing images. We perform Male Female on this dataset. ",
889
+ "bbox": [
890
+ 174,
891
+ 122,
892
+ 825,
893
+ 164
894
+ ],
895
+ "page_idx": 7
896
+ },
897
+ {
898
+ "type": "text",
899
+ "text": "(2) AFHQ [8] consists of high-resolution animal face images including three domains: cat, dog and wild, which has relatively large variations. Each domain has 500 testing images. We perform Cat Dog and Wild Dog on this dataset. We also perform multi-domain translation on AFHQ dataset and the experimental results are reported in Appendix D. ",
900
+ "bbox": [
901
+ 174,
902
+ 165,
903
+ 823,
904
+ 218
905
+ ],
906
+ "page_idx": 7
907
+ },
908
+ {
909
+ "type": "text",
910
+ "text": "Implementation. The time-dependent domain-specific extractor $E _ { s } ( { \\boldsymbol { x } } , t )$ is trained based on the backbone in [9]. The resize function including downsampling and upsampling operation is used as low-pass filter and is implemented by [45]. For generation process, by default, the weight parameter $\\lambda _ { s }$ , $\\lambda _ { i }$ is set 500 and 2 respectively. The initial time $M$ and denoising steps $N$ is set $0 . 5 T$ and 500 by default. More details about implementation are available in Appendix B. ",
911
+ "bbox": [
912
+ 174,
913
+ 226,
914
+ 825,
915
+ 295
916
+ ],
917
+ "page_idx": 7
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "Evaluation Metrics. We evaluate translated images from two aspects: realism and faithfulness. For realism, we report the widely-used Frechet Inception Score (FID) [13] between translated images and the target dataset. To quantify faithfulness, we report the $L _ { 2 }$ distance, PSNR and SSIM [52] between each input-output pair. To quantify both faithfulness and realism, we leverage Amazon Mechanical Turk(AMT) human evaluation to perform pairwise comparisons between the baselines and EGSDE. More details is available in Appendix B.6. ",
922
+ "bbox": [
923
+ 174,
924
+ 301,
925
+ 825,
926
+ 385
927
+ ],
928
+ "page_idx": 7
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "5.1 Two-Domain Unpaired Image Translation ",
933
+ "text_level": 1,
934
+ "bbox": [
935
+ 176,
936
+ 404,
937
+ 504,
938
+ 419
939
+ ],
940
+ "page_idx": 7
941
+ },
942
+ {
943
+ "type": "text",
944
+ "text": "In this section, we compare EGSDE with the following state-of-the-art I2I methods in three tasks: SBDMs-based methods including ILVR [7] and SDEdit [32], and GANs-based methods including CUT [36], which are reproduced using public code. On the most popular benchmark $\\mathbf { C a t } \\to \\mathbf { D o g }$ we also report the performance of other state-of-the-art GANs-methods , where StarGAN v2 [8] is evaluated by the provided public checkpoint and the others are public results from CUT[36] and ITTR [58]. We provide more details about reproductions in Appendix B.7. ",
945
+ "bbox": [
946
+ 174,
947
+ 430,
948
+ 825,
949
+ 513
950
+ ],
951
+ "page_idx": 7
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "The quantitative comparisons and qualitative results are shown in Table 1 and Figure 3. We can derive several observations. First, our method outperforms the SBDMs-based methods significantly in almost all realism and faithfulness metrics, suggesting the effectiveness of employing energy function pretrained on both domains to guide the generation process. Especially, compared with the most direct competitor, i.e., SDEdit, with a lower $L _ { 2 }$ distance at the same time, EGSDE improves the FID score by 8.35, 8.76 and 7.5 on $\\mathrm { C a t } \\to \\mathrm { D o g }$ , W $\\mathrm { \\Delta / i l d } \\to \\mathrm { D o g }$ and Male Female respectively. Second, EGSDE† outperforms the current state-of-art GANs-based methods by a large margin on the challenging AFHQ dataset. For example, compared with CUT [36], we achieve an improvement of FID score with 25.17 and 42.51 on the $\\mathrm { C a t } \\to \\mathrm { D o g }$ and Wi $\\lvert \\mathbf { d } \\to \\mathbf { D o g }$ tasks respectively. In addition, the human evaluation shows that EGSDE are preferred compared to all baselines $( > 5 0 \\% )$ . The qualitative results in Figure 3 agree with quantitative comparisons in Table 1, where our method achieved the results with the best visual quality for both realism and faithfulness. We show more qualitative results and select some failure cases in Appendix C.6. ",
956
+ "bbox": [
957
+ 174,
958
+ 520,
959
+ 825,
960
+ 699
961
+ ],
962
+ "page_idx": 7
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "5.2 Ablation Studies ",
967
+ "text_level": 1,
968
+ "bbox": [
969
+ 174,
970
+ 718,
971
+ 328,
972
+ 733
973
+ ],
974
+ "page_idx": 7
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "The function of each expert. We validate the function of realistic expert $\\mathcal { E } _ { s } ( \\pmb { y } , \\pmb { x } , t )$ and faithful expert $\\mathcal { E } _ { i } ( \\pmb { y } , \\pmb { x } , t )$ by changing the weighting hyper-parameter $\\lambda _ { s }$ and $\\lambda _ { i }$ . As shown in Table 3 and Figure 1, larger $\\lambda _ { s }$ results in more realistic images and larger $\\lambda _ { i }$ results in more faithful images. More results is available in Appendix C.5. ",
979
+ "bbox": [
980
+ 174,
981
+ 746,
982
+ 825,
983
+ 801
984
+ ],
985
+ "page_idx": 7
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "The choice of initial time $M$ . We explore the effect of the initial time $M$ of EGSDE. As shown in Figure 4, the larger $M$ results in more realistic and less faithful image. More results is available in Appendix C.3. ",
990
+ "bbox": [
991
+ 174,
992
+ 808,
993
+ 825,
994
+ 849
995
+ ],
996
+ "page_idx": 7
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "Repeating $K$ Times. Following SDEdit [32], we show the results of repeating the Algorithm 1 $K$ times. The quantitative and qualitative results are depicted in Table 2 and Figure 4. The experimental results show the EGSDE outperforms SDEdit in each $K$ step in all metrics. With the increase of $K$ , the SDEdit generates more realism images but the faithful metrics decrease sharply, because it only utilizes the source image at the initial time $M$ . As shown in Figure 4, when $K { = } 3$ , SDEdit discard the domain-independent information of the source image (i.e., color and background) while our method still preserves them without harming realism. ",
1001
+ "bbox": [
1002
+ 174,
1003
+ 856,
1004
+ 825,
1005
+ 911
1006
+ ],
1007
+ "page_idx": 7
1008
+ },
1009
+ {
1010
+ "type": "table",
1011
+ "img_path": "images/0dce00641f00692b0439d7a1825697b8626ddff08c937e4806807215a13de4a3.jpg",
1012
+ "table_caption": [
1013
+ "Table 1: Quantitative comparison. ILVR [7], SDEdit [32] and CUT [36] are reproduced using public code. StarGAN v2 [8] is evaluated by the provided public checkpoint and the other methods marked by \\* are public results from CUT[36] and ITTR [58]. All SBDMs-based methods and StarGAN v2 are repeated 5 times to eliminate randomness. CUT is conducted once since it learns a deterministic mapping. AMT show the preference rate of EGSDE against baselines via human evaluation. The EGSDE use the default-parameters $( \\lambda _ { s } = 5 0 0 , \\lambda _ { i } = 2 , M = 0 . 5 T )$ and EGSDE† use the parameters with $\\lambda _ { s } = 7 0 0 , \\lambda _ { i } = 0 . 5 , M = 0 . 6 T$ . "
1014
+ ],
1015
+ "table_footnote": [],
1016
+ "table_body": "<table><tr><td>Model</td><td>FID↓</td><td>L2↓</td><td>PSNR ↑</td><td>SSIM ↑</td><td>AMT个</td></tr><tr><td colspan=\"6\">Cat → Dog</td></tr><tr><td>CycleGAN* [60] MUNIT*[17]</td><td>85.9 104.4</td><td>=</td><td></td><td></td><td></td></tr><tr><td>DRIT* [26]</td><td>123.4</td><td></td><td></td><td></td><td></td></tr><tr><td>Distance*[3]</td><td>155.3</td><td></td><td></td><td></td><td></td></tr><tr><td>SelfDistance* [3]</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>144.4</td><td>=</td><td></td><td></td><td></td></tr><tr><td>GCGAN*[10]</td><td>96.6</td><td></td><td></td><td></td><td></td></tr><tr><td>LSeSim* [57]</td><td>72.8</td><td></td><td></td><td></td><td></td></tr><tr><td>ITTR(CUT)*[58]</td><td>68.6</td><td>=</td><td></td><td></td><td>=</td></tr><tr><td>StarGAN v2 [8]</td><td>54.88 ± 1.01</td><td>133.65 ± 1.54</td><td>10.63 ± 0.10</td><td>0.27 ± 0.003</td><td></td></tr><tr><td>CUT* [36]</td><td>76.21</td><td>59.78</td><td>17.48</td><td>0.601</td><td>79.6%</td></tr><tr><td>ILVR [7]</td><td>74.37 ± 1.55</td><td>56.95 ± 0.14</td><td>17.77 ± 0.02</td><td>0.363 ± 0.001</td><td>75.4%</td></tr><tr><td>SDEdit [32]</td><td>74.17 ± 1.01</td><td>47.88 ± 0.06</td><td>19.19 ± 0.01</td><td>0.423 ± 0.001</td><td>65.2%</td></tr><tr><td>EGSDE</td><td>65.82 ± 0.77</td><td>47.22 ± 0.08</td><td>19.31 ± 0.02</td><td>0.415 ± 0.001</td><td>=</td></tr><tr><td>EGSDEt</td><td>51.04 ± 0.37</td><td>62.06 ± 0.10</td><td>17.17 ± 0.02</td><td>0.361 ± 0.001</td><td>=</td></tr><tr><td colspan=\"6\">Wild →Dog</td></tr><tr><td>CUT [36]</td><td>92.94</td><td>62.21</td><td>17.2</td><td>0.592</td><td>82.4%</td></tr><tr><td>ILVR [7]</td><td>75.33 ± 1.22</td><td>63.40 ± 0.15</td><td>16.85 ± 0.02</td><td>0.287 ± 0.001</td><td>73.4%</td></tr><tr><td>SDEdit [32]</td><td>68.51 ± 0.65</td><td>55.36 ± 0.05</td><td>17.98 ± 0.01</td><td>0.343 ± 0.001</td><td>57.2%</td></tr><tr><td>EGSDE</td><td>59.75 ± 0.62</td><td>54.34 ± 0.08</td><td>18.14 ± 0.01</td><td>0.343 ± 0.001</td><td>=</td></tr><tr><td>EGSDE†</td><td>50.43± 0.52</td><td>66.52± 0.09</td><td>16.40± 0.01</td><td>0.300± 0.001</td><td>=</td></tr><tr><td colspan=\"6\">Male→Female</td></tr><tr><td>CUT [36]</td><td>31.94</td><td>46.61</td><td>19.87</td><td>0.74</td><td>58.6%</td></tr><tr><td>ILVR [7]</td><td>46.12 ± 0.33</td><td>52.17 ± 0.10</td><td>18.59 ± 0.02</td><td>0.510 ± 0.001</td><td>88.2%</td></tr><tr><td>SDEdit [32]</td><td>49.43 ± 0.47</td><td>43.70 ± 0.03</td><td>20.03 ± 0.01</td><td>0.572 ± 0.000</td><td>74.4%</td></tr><tr><td>EGSDE</td><td>41.93 ± 0.11</td><td>42.04 ± 0.03</td><td>20.35 ± 0.01</td><td>0.574 ± 0.000</td><td>=</td></tr><tr><td>EGSDE†</td><td>30.61 ± 0.19</td><td>53.44 ± 0.09</td><td>18.32 ± 0.02</td><td>0.510 ± 0.001</td><td>1</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>",
1017
+ "bbox": [
1018
+ 179,
1019
+ 199,
1020
+ 818,
1021
+ 661
1022
+ ],
1023
+ "page_idx": 8
1024
+ },
1025
+ {
1026
+ "type": "text",
1027
+ "text": "",
1028
+ "bbox": [
1029
+ 174,
1030
+ 685,
1031
+ 825,
1032
+ 728
1033
+ ],
1034
+ "page_idx": 8
1035
+ },
1036
+ {
1037
+ "type": "text",
1038
+ "text": "6 Conclusions and Discussions ",
1039
+ "text_level": 1,
1040
+ "bbox": [
1041
+ 174,
1042
+ 747,
1043
+ 442,
1044
+ 765
1045
+ ],
1046
+ "page_idx": 8
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "In this paper, we propose energy-guided stochastic differential equations (EGSDE) for realistic and faithful unpaired I2I, which employs an energy function pretrained on both domains to guide the generation process of a pretrained SDE. Building upon two feature extractors, we carefully design the energy function to preserve the domain-independent features and discard domain-specific ones of the source image. We demonstrate the EGSDE by outperforming state-of-art I2I methods on three widely-adopted unpaired I2I tasks. ",
1051
+ "bbox": [
1052
+ 174,
1053
+ 779,
1054
+ 825,
1055
+ 863
1056
+ ],
1057
+ "page_idx": 8
1058
+ },
1059
+ {
1060
+ "type": "text",
1061
+ "text": "One limitation of this paper is we employ a low-pass filter as the domain-independent feature extractor for its simpleness and effectiveness while we can train more sophisticated extractor, e.g. based on disentangled representation learning methods [42, 6, 14, 23, 28], on the data in the two domains. We leave this issue in future work. In addition, we must take care to exploit the method to avoid the potential negative social impact (i.e., generating fake images to mislead people). ",
1062
+ "bbox": [
1063
+ 176,
1064
+ 869,
1065
+ 825,
1066
+ 911
1067
+ ],
1068
+ "page_idx": 8
1069
+ },
1070
+ {
1071
+ "type": "image",
1072
+ "img_path": "images/a5d855901863fe17e8ecff09a3307e6d0e6a80e0b650ae5b8fe40e5d231c2649.jpg",
1073
+ "image_caption": [
1074
+ "Figure 4: (a) The results of different initial time $M$ . The larger $M$ results in more realistic and less faithful images. (b) The results of repeating the Algorithm 1 $K$ times. With the increase of K, SDEdit [32] tend to discard the domain-independent information of the source image (e.g., color and background) while our method still preserve them without harming realism. "
1075
+ ],
1076
+ "image_footnote": [],
1077
+ "bbox": [
1078
+ 181,
1079
+ 118,
1080
+ 820,
1081
+ 378
1082
+ ],
1083
+ "page_idx": 9
1084
+ },
1085
+ {
1086
+ "type": "table",
1087
+ "img_path": "images/92cb5e004a6f549881eb81fa548ae05c96159c7175ed45c7c61603d03cb808d1.jpg",
1088
+ "table_caption": [
1089
+ "Table 2: Comparison with SDEdit [32] under different $K$ times on Male Female. The results on other tasks are reported in Appendix C.4. "
1090
+ ],
1091
+ "table_footnote": [],
1092
+ "table_body": "<table><tr><td>Methods</td><td>K</td><td>FID↓</td><td>L2↓</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>SDEdit [32]</td><td></td><td>49.95</td><td>43.71</td><td>20.03</td><td>0.572</td></tr><tr><td>EGSDE</td><td>1</td><td>42.17</td><td>42.07</td><td>20.35</td><td>0.573</td></tr><tr><td>SDEdit [32]</td><td>2</td><td>46.26</td><td>50.70</td><td>18.77</td><td>0.542</td></tr><tr><td>EGSDE</td><td></td><td>38.68</td><td>47.10</td><td>19.40</td><td>0.548</td></tr><tr><td>SDEdit [32]</td><td>3</td><td>45.19</td><td>55.03</td><td>18.08</td><td>0.527</td></tr><tr><td>EGSDE</td><td></td><td>37.55</td><td>49.63</td><td>18.96</td><td>0.536</td></tr></table>",
1093
+ "bbox": [
1094
+ 176,
1095
+ 511,
1096
+ 488,
1097
+ 626
1098
+ ],
1099
+ "page_idx": 9
1100
+ },
1101
+ {
1102
+ "type": "table",
1103
+ "img_path": "images/67ed07cfe70d835f94405ab9f85e532a86ca6a4dcff237564243c671fefb3d20.jpg",
1104
+ "table_caption": [
1105
+ "Table 3: The results of different $\\lambda _ { s }$ and $\\lambda _ { i }$ on Wild $ \\mathrm { D o g }$ . $\\lambda _ { s } = \\lambda _ { i } = 0$ corresponds to SDEdit [32]. "
1106
+ ],
1107
+ "table_footnote": [],
1108
+ "table_body": "<table><tr><td>入s,入</td><td>FID↓</td><td>L2↓</td><td>PSNR ↑</td><td>SSIM↑</td></tr><tr><td>λs=0,λ=0</td><td>67.87</td><td>55.39</td><td>17.97</td><td>0.344</td></tr><tr><td>x=100,x=0</td><td>60.80</td><td>56.19</td><td>17.85</td><td>0.341</td></tr><tr><td>入s= 500,入i=0</td><td>53.72</td><td>58.65</td><td>17.47</td><td>0.335</td></tr><tr><td>=800,入=0</td><td>53.01</td><td>60.02</td><td>17.27</td><td>0.331</td></tr><tr><td>X=0,x7=0.5</td><td>68.31</td><td>53.23</td><td>18.32</td><td>0.347</td></tr><tr><td>入s=0,入=2</td><td>71.10</td><td>51.99</td><td>18.52</td><td>0.349</td></tr><tr><td>入s=0,=5</td><td>72.70</td><td>51.44</td><td>18.61</td><td>0.351</td></tr></table>",
1109
+ "bbox": [
1110
+ 500,
1111
+ 496,
1112
+ 825,
1113
+ 626
1114
+ ],
1115
+ "page_idx": 9
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "",
1120
+ "bbox": [
1121
+ 171,
1122
+ 667,
1123
+ 823,
1124
+ 696
1125
+ ],
1126
+ "page_idx": 9
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Acknowledgement ",
1131
+ "text_level": 1,
1132
+ "bbox": [
1133
+ 176,
1134
+ 731,
1135
+ 330,
1136
+ 748
1137
+ ],
1138
+ "page_idx": 9
1139
+ },
1140
+ {
1141
+ "type": "text",
1142
+ "text": "We thank Cheng Lu, Yuhao Zhou, Haoyu Liang and Shuyu Cheng for helpful discussions about the method and its limitations. This work was supported by the National Key Research and Development Program of China (2020AAA0106302); NSF of China Projects (Nos. 62061136001, 61620106010, 62076145, U19B2034, U1811461, U19A2081, 6197222); Beijing NSF Project (No. JQ19016); Beijing Outstanding Young Scientist Program NO. BJJWZYJH012019100020098; a grant from Tsinghua Institute for Guo Qiang; the High Performance Computing Center, Tsinghua University; the Fundamental Research Funds for the Central Universities, and the Research Funds of Renmin University of China (22XNKJ13). Part of the computing resources supporting this work, totaled 500 A100 GPU hours, were provided by High-Flyer AI. (Hangzhou High-Flyer AI Fundamental Research Co., Ltd.). J.Z was also supported by the XPlorer Prize. ",
1143
+ "bbox": [
1144
+ 174,
1145
+ 772,
1146
+ 825,
1147
+ 911
1148
+ ],
1149
+ "page_idx": 9
1150
+ },
1151
+ {
1152
+ "type": "text",
1153
+ "text": "References \n[1] Matthew Amodio and Smita Krishnaswamy. Travelgan: Image-to-image translation by transformation vector learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8975–8984, 2019. \n[2] Fan Bao, Chongxuan Li, Jun Zhu, and Bo Zhang. Analytic-dpm: an analytic estimate of the optimal reverse variance in diffusion probabilistic models. In International Conference on Learning Representations, 2021. \n[3] Sagie Benaim and Lior Wolf. One-sided unsupervised domain mapping. Advances in Neural Information Processing Systems, 30, 2017. \n[4] Mikołaj Binkowski, Danica J Sutherland, Michael Arbel, and Arthur Gretton. Demystifying ´ mmd gans. In International Conference on Learning Representations, 2018. \n[5] Christopher M. Bishop. Pattern Recognition and Machine Learning. 2006. \n[6] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. Advances in Neural Information Processing Systems, 29, 2016. \n[7] Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. Ilvr: Conditioning method for denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14367–14376, 2021. \n[8] Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8188–8197, 2020. \n[9] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34, 2021. \n[10] Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, Kun Zhang, and Dacheng Tao. Geometry-consistent generative adversarial networks for one-sided unsupervised domain mapping. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2427–2436, 2019. \n[11] Aaron Gokaslan, Vivek Ramanujan, Daniel Ritchie, Kwang In Kim, and James Tompkin. Improving shape deformation in unsupervised image-to-image translation. In Proceedings of the European Conference on Computer Vision, pages 649–665, 2018. \n[12] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in Neural Information Processing Systems, 27, 2014. \n[13] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in Neural Information Processing Systems, 30, 2017. \n[14] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016. \n[15] Geoffrey E Hinton. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771–1800, 2002. \n[16] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020. \n[17] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised imageto-image translation. In Proceedings of the European Conference on Computer Vision, pages 172–189, 2018. \n[18] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1125–1134, 2017. \n[19] Liming Jiang, Changxu Zhang, Mingyang Huang, Chunxiao Liu, Jianping Shi, and Chen Change Loy. Tsit: A simple and versatile framework for image-to-image translation. In Proceedings of the European Conference on Computer Vision, pages 206–222, 2020. \n[20] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations, 2018. \n[21] Oren Katzir, Dani Lischinski, and Daniel Cohen-Or. Cross-domain cascaded deep translation. In Proceedings of the European Conference on Computer Vision, pages 673–689, 2020. \n[22] Gwanghyun Kim, Taesung Kwon, and Jong Chul Ye. Diffusionclip: Text-guided diffusion models for robust image manipulation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2426–2435, 2022. \n[23] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, pages 2649–2658, 2018. \n[24] Junho Kim, Minjae Kim, Hyeonwoo Kang, and Kwang Hee Lee. U-gat-it: Unsupervised generative attentional networks with adaptive layer-instance normalization for image-to-image translation. In International Conference on Learning Representations, 2019. \n[25] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In International Conference on Machine Learning, pages 1857–1865, 2017. \n[26] Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In Proceedings of the European Conference on Computer Vision, pages 35–51, 2018. \n[27] Minjun Li, Haozhi Huang, Lin Ma, Wei Liu, Tong Zhang, and Yugang Jiang. Unsupervised image-to-image translation with stacked cycle-consistent adversarial networks. In Proceedings of the European Conference on Computer Vision, pages 184–199, 2018. \n[28] Alexander H Liu, Yen-Cheng Liu, Yu-Ying Yeh, and Yu-Chiang Frank Wang. A unified feature disentangler for multi-domain image translation and manipulation. Advances in Neural Information Processing Systems, 31, 2018. \n[29] Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. Advances in Neural Information Processing Systems, 30, 2017. \n[30] Xihui Liu, Dong Huk Park, Samaneh Azadi, Gong Zhang, Arman Chopikyan, Yuxiao Hu, Humphrey Shi, Anna Rohrbach, and Trevor Darrell. More control for free! image synthesis with semantic diffusion guidance. arXiv preprint arXiv:2112.05744, 2021. \n[31] Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. Dpm-solver: A fast ode solver for diffusion probabilistic model sampling in around 10 steps. arXiv preprint arXiv:2206.00927, 2022. \n[32] Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. Sdedit: Guided image synthesis and editing with stochastic differential equations. In International Conference on Learning Representations, 2021. \n[33] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021. \n[34] Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pages 8162–8171, 2021. ",
1154
+ "bbox": [
1155
+ 171,
1156
+ 89,
1157
+ 828,
1158
+ 915
1159
+ ],
1160
+ "page_idx": 10
1161
+ },
1162
+ {
1163
+ "type": "text",
1164
+ "text": "",
1165
+ "bbox": [
1166
+ 171,
1167
+ 63,
1168
+ 826,
1169
+ 916
1170
+ ],
1171
+ "page_idx": 11
1172
+ },
1173
+ {
1174
+ "type": "text",
1175
+ "text": "[35] Yingxue Pang, Jianxin Lin, Tao Qin, and Zhibo Chen. Image-to-image translation: Methods and applications. IEEE Transactions on Multimedia, 2021. ",
1176
+ "bbox": [
1177
+ 169,
1178
+ 90,
1179
+ 823,
1180
+ 119
1181
+ ],
1182
+ "page_idx": 12
1183
+ },
1184
+ {
1185
+ "type": "text",
1186
+ "text": "[36] Taesung Park, Alexei A Efros, Richard Zhang, and Jun-Yan Zhu. Contrastive learning for unpaired image-to-image translation. In Proceedings of the European Conference on Computer Vision, pages 319–345, 2020. ",
1187
+ "bbox": [
1188
+ 174,
1189
+ 127,
1190
+ 823,
1191
+ 171
1192
+ ],
1193
+ "page_idx": 12
1194
+ },
1195
+ {
1196
+ "type": "text",
1197
+ "text": "[37] Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2337–2346, 2019. ",
1198
+ "bbox": [
1199
+ 174,
1200
+ 179,
1201
+ 823,
1202
+ 222
1203
+ ],
1204
+ "page_idx": 12
1205
+ },
1206
+ {
1207
+ "type": "text",
1208
+ "text": "[38] Taesung Park, Jun-Yan Zhu, Oliver Wang, Jingwan Lu, Eli Shechtman, Alexei Efros, and Richard Zhang. Swapping autoencoder for deep image manipulation. Advances in Neural Information Processing Systems, 33:7198–7211, 2020. ",
1209
+ "bbox": [
1210
+ 174,
1211
+ 229,
1212
+ 823,
1213
+ 273
1214
+ ],
1215
+ "page_idx": 12
1216
+ },
1217
+ {
1218
+ "type": "text",
1219
+ "text": "[40] Chitwan Saharia, William Chan, Huiwen Chang, Chris Lee, Jonathan Ho, Tim Salimans, David Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. In ACM SIGGRAPH, pages 1–10, 2022. ",
1220
+ "bbox": [
1221
+ 173,
1222
+ 347,
1223
+ 823,
1224
+ 390
1225
+ ],
1226
+ "page_idx": 12
1227
+ },
1228
+ {
1229
+ "type": "text",
1230
+ "text": "[41] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. ",
1231
+ "bbox": [
1232
+ 171,
1233
+ 397,
1234
+ 823,
1235
+ 440
1236
+ ],
1237
+ "page_idx": 12
1238
+ },
1239
+ {
1240
+ "type": "text",
1241
+ "text": "[42] Eduardo Hugo Sanchez, Mathieu Serrurier, and Mathias Ortner. Learning disentangled representations via mutual information estimation. In Proceedings of the European Conference on Computer Vision, pages 205–221, 2020. ",
1242
+ "bbox": [
1243
+ 173,
1244
+ 449,
1245
+ 823,
1246
+ 492
1247
+ ],
1248
+ "page_idx": 12
1249
+ },
1250
+ {
1251
+ "type": "text",
1252
+ "text": "[43] Hiroshi Sasaki, Chris G Willcocks, and Toby P Breckon. Unit-ddpm: Unpaired image translation with denoising diffusion probabilistic models. arXiv preprint arXiv:2104.05358, 2021. ",
1253
+ "bbox": [
1254
+ 171,
1255
+ 500,
1256
+ 821,
1257
+ 530
1258
+ ],
1259
+ "page_idx": 12
1260
+ },
1261
+ {
1262
+ "type": "text",
1263
+ "text": "[44] Zhiqiang Shen, Mingyang Huang, Jianping Shi, Xiangyang Xue, and Thomas S Huang. Towards instance-level image-to-image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3683–3692, 2019. ",
1264
+ "bbox": [
1265
+ 173,
1266
+ 537,
1267
+ 821,
1268
+ 580
1269
+ ],
1270
+ "page_idx": 12
1271
+ },
1272
+ {
1273
+ "type": "text",
1274
+ "text": "[45] Assaf Shocher. Resizeright. https://github.com/assafshocher/ResizeRight, 2018. ",
1275
+ "bbox": [
1276
+ 173,
1277
+ 588,
1278
+ 812,
1279
+ 606
1280
+ ],
1281
+ "page_idx": 12
1282
+ },
1283
+ {
1284
+ "type": "text",
1285
+ "text": "[46] Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265, 2015. ",
1286
+ "bbox": [
1287
+ 173,
1288
+ 613,
1289
+ 821,
1290
+ 655
1291
+ ],
1292
+ "page_idx": 12
1293
+ },
1294
+ {
1295
+ "type": "text",
1296
+ "text": "[47] Yang Song, Conor Durkan, Iain Murray, and Stefano Ermon. Maximum likelihood training of score-based diffusion models. Advances in Neural Information Processing Systems, 34, 2021. ",
1297
+ "bbox": [
1298
+ 173,
1299
+ 664,
1300
+ 825,
1301
+ 694
1302
+ ],
1303
+ "page_idx": 12
1304
+ },
1305
+ {
1306
+ "type": "text",
1307
+ "text": "[48] Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019. ",
1308
+ "bbox": [
1309
+ 171,
1310
+ 702,
1311
+ 823,
1312
+ 731
1313
+ ],
1314
+ "page_idx": 12
1315
+ },
1316
+ {
1317
+ "type": "text",
1318
+ "text": "[49] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2020. ",
1319
+ "bbox": [
1320
+ 173,
1321
+ 738,
1322
+ 823,
1323
+ 782
1324
+ ],
1325
+ "page_idx": 12
1326
+ },
1327
+ {
1328
+ "type": "text",
1329
+ "text": "[51] Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8798–8807, 2018. ",
1330
+ "bbox": [
1331
+ 174,
1332
+ 856,
1333
+ 826,
1334
+ 911
1335
+ ],
1336
+ "page_idx": 12
1337
+ },
1338
+ {
1339
+ "type": "text",
1340
+ "text": "[52] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600– 612, 2004. ",
1341
+ "bbox": [
1342
+ 173,
1343
+ 90,
1344
+ 825,
1345
+ 132
1346
+ ],
1347
+ "page_idx": 13
1348
+ },
1349
+ {
1350
+ "type": "text",
1351
+ "text": "[53] Wayne Wu, Kaidi Cao, Cheng Li, Chen Qian, and Chen Change Loy. Transgaga: Geometryaware unsupervised image-to-image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8012–8021, 2019. ",
1352
+ "bbox": [
1353
+ 173,
1354
+ 141,
1355
+ 823,
1356
+ 185
1357
+ ],
1358
+ "page_idx": 13
1359
+ },
1360
+ {
1361
+ "type": "text",
1362
+ "text": "[54] Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In Proceedings of the IEEE International Conference on Computer Vision, pages 2849–2857, 2017. ",
1363
+ "bbox": [
1364
+ 173,
1365
+ 193,
1366
+ 823,
1367
+ 236
1368
+ ],
1369
+ "page_idx": 13
1370
+ },
1371
+ {
1372
+ "type": "text",
1373
+ "text": "[55] Pan Zhang, Bo Zhang, Dong Chen, Lu Yuan, and Fang Wen. Cross-domain correspondence learning for exemplar-based image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5143–5153, 2020. ",
1374
+ "bbox": [
1375
+ 171,
1376
+ 244,
1377
+ 823,
1378
+ 287
1379
+ ],
1380
+ "page_idx": 13
1381
+ },
1382
+ {
1383
+ "type": "text",
1384
+ "text": "[56] Yihao Zhao, Ruihai Wu, and Hao Dong. Unpaired image-to-image translation using adversarial consistency loss. In Proceedings of the European Conference on Computer Vision, pages 800–815, 2020. ",
1385
+ "bbox": [
1386
+ 174,
1387
+ 295,
1388
+ 823,
1389
+ 338
1390
+ ],
1391
+ "page_idx": 13
1392
+ },
1393
+ {
1394
+ "type": "text",
1395
+ "text": "[57] Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. The spatially-correlative loss for various image translation tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16407–16417, 2021. ",
1396
+ "bbox": [
1397
+ 173,
1398
+ 347,
1399
+ 821,
1400
+ 390
1401
+ ],
1402
+ "page_idx": 13
1403
+ },
1404
+ {
1405
+ "type": "text",
1406
+ "text": "[58] Wanfeng Zheng, Qiang Li, Guoxin Zhang, Pengfei Wan, and Zhongyuan Wang. Ittr: Unpaired image-to-image translation with transformers. arXiv preprint arXiv:2203.16015, 2022. ",
1407
+ "bbox": [
1408
+ 171,
1409
+ 397,
1410
+ 821,
1411
+ 428
1412
+ ],
1413
+ "page_idx": 13
1414
+ },
1415
+ {
1416
+ "type": "text",
1417
+ "text": "[59] Xingran Zhou, Bo Zhang, Ting Zhang, Pan Zhang, Jianmin Bao, Dong Chen, Zhongfei Zhang, and Fang Wen. Cocosnet v2: Full-resolution correspondence learning for image translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11465–11475, 2021. ",
1418
+ "bbox": [
1419
+ 174,
1420
+ 435,
1421
+ 825,
1422
+ 492
1423
+ ],
1424
+ "page_idx": 13
1425
+ },
1426
+ {
1427
+ "type": "text",
1428
+ "text": "[60] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 2223–2232, 2017. ",
1429
+ "bbox": [
1430
+ 174,
1431
+ 501,
1432
+ 821,
1433
+ 544
1434
+ ],
1435
+ "page_idx": 13
1436
+ },
1437
+ {
1438
+ "type": "text",
1439
+ "text": "Checklist ",
1440
+ "text_level": 1,
1441
+ "bbox": [
1442
+ 174,
1443
+ 569,
1444
+ 254,
1445
+ 585
1446
+ ],
1447
+ "page_idx": 13
1448
+ },
1449
+ {
1450
+ "type": "text",
1451
+ "text": "1. For all authors... ",
1452
+ "bbox": [
1453
+ 214,
1454
+ 595,
1455
+ 339,
1456
+ 609
1457
+ ],
1458
+ "page_idx": 13
1459
+ },
1460
+ {
1461
+ "type": "text",
1462
+ "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 Section 6. \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1463
+ "bbox": [
1464
+ 238,
1465
+ 614,
1466
+ 825,
1467
+ 719
1468
+ ],
1469
+ "page_idx": 13
1470
+ },
1471
+ {
1472
+ "type": "text",
1473
+ "text": "2. If you are including theoretical results... ",
1474
+ "bbox": [
1475
+ 215,
1476
+ 723,
1477
+ 493,
1478
+ 738
1479
+ ],
1480
+ "page_idx": 13
1481
+ },
1482
+ {
1483
+ "type": "text",
1484
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Appendix A.1 (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A.4 ",
1485
+ "bbox": [
1486
+ 238,
1487
+ 742,
1488
+ 823,
1489
+ 786
1490
+ ],
1491
+ "page_idx": 13
1492
+ },
1493
+ {
1494
+ "type": "text",
1495
+ "text": "3. If you ran experiments... ",
1496
+ "bbox": [
1497
+ 214,
1498
+ 791,
1499
+ 393,
1500
+ 805
1501
+ ],
1502
+ "page_idx": 13
1503
+ },
1504
+ {
1505
+ "type": "text",
1506
+ "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] See Section 5 and Appendix B \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix B and Appendix C \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Table 1 ",
1507
+ "bbox": [
1508
+ 238,
1509
+ 809,
1510
+ 825,
1511
+ 911
1512
+ ],
1513
+ "page_idx": 13
1514
+ },
1515
+ {
1516
+ "type": "text",
1517
+ "text": "(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix B ",
1518
+ "bbox": [
1519
+ 233,
1520
+ 90,
1521
+ 823,
1522
+ 119
1523
+ ],
1524
+ "page_idx": 14
1525
+ },
1526
+ {
1527
+ "type": "text",
1528
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1529
+ "bbox": [
1530
+ 215,
1531
+ 123,
1532
+ 823,
1533
+ 138
1534
+ ],
1535
+ "page_idx": 14
1536
+ },
1537
+ {
1538
+ "type": "text",
1539
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 5 and Appendix B \n(b) Did you mention the license of the assets? [Yes] See Appendix B \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See Appendix B \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We use the public datasets. \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We use the public datasets. ",
1540
+ "bbox": [
1541
+ 238,
1542
+ 142,
1543
+ 825,
1544
+ 277
1545
+ ],
1546
+ "page_idx": 14
1547
+ },
1548
+ {
1549
+ "type": "text",
1550
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1551
+ "bbox": [
1552
+ 214,
1553
+ 281,
1554
+ 705,
1555
+ 296
1556
+ ],
1557
+ "page_idx": 14
1558
+ },
1559
+ {
1560
+ "type": "text",
1561
+ "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] ",
1562
+ "bbox": [
1563
+ 238,
1564
+ 300,
1565
+ 825,
1566
+ 390
1567
+ ],
1568
+ "page_idx": 14
1569
+ }
1570
+ ]
parse/dev/xxgp42Qz6dL/xxgp42Qz6dL_middle.json ADDED
The diff for this file is too large to render. See raw diff