| Algorithm | Photo | | Art-painting Cartoon Sketch | | Mean |
| ResNet-18 |
| Online adaptation |
| Tent-BN (Wang et al., 2021) | 93.9 ±0.3 | 78.5 ±0.8 | 78.3 ±0.4 74.4 ±0.28 | | 81.3 ±0.3 |
| T3A(Iwasawa & Matsuo, 2021) | 94.7 ±0.5 | 80.4 ±0.7 | 75.2 ±0.4 | 76.5 ±0.2 | 81.7 ±0.4 |
| TAST (Jang & Chung,2022) | 96.4 ±0.2 | 80.6 ±0.5 | 78.3 ±1.0 | 72.5 ±0.8 | 81.9 ±0.4 |
| SHOT (Liang et al., 2020) | 96.2 ±0.3 | 81.1 ±0.9 | 79.7 ±0.9 | 72.5 ±2.0 | 82.4 ±0.6 |
| Our Method | 95.5 ±0.2 | 82.9 ±0.4 | 81.3 ±0.5 | 74.1 ±0.7 | 83.4 ±0.2 |
| Offline adaptation | | |
| Tent-BN (Wang et al., 2021) | 94.6 ±0.2 | 80.1 ±0.9 | 79.4 ±0.8 75.0 ±1.0 | | 82.3 ±0.3 |
| Our Method | | 95.8 ±0.5 84.3 ±0.8 | 83.4 ±0.4 74.6 ±0.2 84.8 ±0.4 | | |
| ResNet-50 | | |
| Online adaptation | | | | | |
| Tent-BN (Wang et al., 2021) | 96.0 ±0.4 84.9 ±0.4 | | 79.8 ±0.6 75.7 ±0.7 84.1 ±0.3 | | |
| T3A (Iwasawa & Matsuo, 2021) | 96.4 ±0.2 | 86.0 ±0.6 | 80.3 ±0.9 | 75.2 ±1.5 | 84.5 ±0.3 |
| SHOT (Liang et al., 2020) | 96.5 ±0.5 | 84.6 ±1.7 | 80.1 ±1.3 | 74.8 ±2.9 | 84.1 ±1.0 |
| TAST (Jang & Chung, 2022) | 96.9 ±0.58 | 83.8 ±0.5 | 79.1 ±0.5 76.4 ±0.58 | | 84.1 ±0.5 |
| Our Method | 96.9 ±0.2 87.0 ±0.4 | | 83.8 ±0.3 74.3 ±0.2 | | 85.5 ±0.3 |
| Offline adaptation | | | | | |
| Tent-BN (Wang et al., 2021) | 96.5 ±0.2 85.8 ±0.3 | | 81.5 ±0.7 76.9 ±0.7 85.1 ±0.3 | | |
| | | | | |
| Our Method | 97.6 ±0.2 87.3 ±0.4 | | 84.2 ±0.2 75.3 ±0.3 86.1 ±0.2 | | |
+
+Table 5: Comparison on rotated MNIST and Fashion-MNIST. The models are evaluated on the test sets of MNIST and Fashion-MNIST with rotation angles of $0 ^ { \circ }$ and $9 0 °$ . Our method performs better than both non-adaptive domain generalization methods (Dou et al., 2019; Piratla et al., 2020) and adaptive methods (Wang et al., 2021; Xiao et al., 2022).
+
+| 1: procedure STOCHASTICSAMPLER(Dθ(x;σ), ti∈{0,..,N}, Yiε{0..,N-1}), Snoise) |
| 2: sample xo ~ N(O, t² I) 3: fori∈{0,...,N-1} d | {min(Sm,-1)ift∈Sin] |
| 4: | Yi = 0 otherwise |
| sample ∈i ~ N(O, S²oise I) 5: | >Select temporarily increased noise level ti |
| t←t+Yiti xi←xi+√t-tei | Add new noise to move from ti to ti |
| 6: | |
| 7: di←(xi-Dθ(xi;ti))/ti | Evaluate dx/dt at ti |
| 8: xi+1←xi+(ti+1-ti)di | Take Euler step from ti to ti+1 |
| 9: if ti+1≠Othen 10: | |
| d'←(xi+1-Dθ(xi+1;ti+1))/ti+1 11: xi+1←xi+(ti+1-ti)(di+di) | > Apply 2nd order correction |
+
+Our stochastic sampler. We propose a stochastic sampler that combines our $2 ^ { \mathrm { n d } }$ order deterministic ODE integrator with explicit Langevin-like “churn” of adding and removing noise. A pseudocode is given in Algorithm 2. At each step $i$ , given the sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ at noise level $t _ { i }$ $\mathbf { \eta } ( = \sigma ( t _ { i } ) )$ , we perform two sub-steps. First, we add noise to the sample according to a factor $\gamma _ { i } \geq 0$ to reach a higher noise level $\hat { t } _ { i } = t _ { i } \dot { + } \gamma _ { i } t _ { i }$ . Second, from the increased-noise sample $\hat { \mathbf { x } } _ { i }$ , we solve the ODE backward from $\hat { t } _ { i }$ to $t _ { i + 1 }$ with a single step. This yields a sample $\pmb { x } _ { i + 1 }$ with noise level $t _ { i + 1 }$ , and the iteration continues. We stress that this is not a general-purpose SDE solver, but a sampling procedure tailored for the specific problem. Its correctness stems from the alternation of two sub-steps that each maintain the correct distribution (up to truncation error in the ODE step). The predictor-corrector sampler of Song et al. [48] has a conceptually similar structure to ours.
+
+To analyze the main difference between our method and Euler–Maruyama, we first note a subtle discrepancy in the latter when discretizing Eq. 6. One can interpret Euler–Maruyama as first adding noise and then performing an ODE step, not from the intermediate state after noise injection, but assuming that $_ { \textbf { \em x } }$ and $\sigma$ remained at the initial state at the beginning of the iteration step. In our method, the parameters used to evaluate $D _ { \theta }$ on line 7 of Algorithm 2 correspond to the state after noise injection, whereas an Euler–Maruyama -like method would use ${ \pmb x } _ { i } ; t _ { i }$ instead of $\hat { \pmb { x } } _ { i } ; \hat { t } _ { i }$ . In the limit of $\Delta _ { t }$ approaching zero there may be no difference between these choices, but the distinction appears to become significant when pursuing low NFE with large steps.
+
+Practical considerations. Increasing the amount of stochasticity is effective in correcting errors made by earlier sampling steps, but it has its own drawbacks. We have observed (see Appendix E.1) that excessive Langevin-like addition and removal of noise results in gradual loss of detail in the generated images with all datasets and denoiser networks. There is also a drift toward oversaturated colors at very low and high noise levels. We suspect that practical denoisers induce a slightly nonconservative vector field in Eq. 3, violating the premises of Langevin diffusion and causing these detrimental effects. Notably, our experiments with analytical denoisers (such as the one in Figure 1b) have not shown such degradation.
+
+If the degradation is caused by flaws in $D _ { \theta } ( \pmb { x } ; \sigma )$ , they can only be remedied using heuristic means during sampling. We address the drift toward oversaturated colors by only enabling stochasticity within a specific range of noise levels $t _ { i } \in [ S _ { \operatorname { t m i n } } , S _ { \operatorname { t m a x } } ]$ . For these noise levels, we define $\gamma _ { i } =$ $S _ { \mathrm { c h u r n } } / N$ , where $S _ { \mathrm { c h u r n } }$ controls the overall amount of stochasticity. We further clamp $\gamma _ { i }$ to never introduce more new noise than what is already present in the image. Finally, we have found that the loss of detail can be partially counteracted by setting $S _ { \mathrm { n o i s e } }$ slightly above 1 to inflate the standard deviation for the newly added noise. This suggests that a major component of the hypothesized non-conservativity of $D _ { \theta } ( { \pmb x } ; { \boldsymbol \sigma } )$ is a tendency to remove slightly too much noise — most likely due to regression toward the mean that can be expected to happen with any $L _ { 2 }$ -trained denoiser [29].
+
+Evaluation. Figure 4 shows that our stochastic sampler outperforms previous samplers [24, 36, 48] by a significant margin, especially at low step counts. Jolicoeur-Martineau et al. [24] use a standard higher-order adaptive SDE solver [40] and its performance is a good baseline for such solvers in general. Our sampler has been tailored to the use case by, e.g., performing noise injection and ODE step sequentially, and it is not adaptive. It is an open question if adaptive solvers can be a net win over a well-tuned fixed schedule in sampling diffusion models.
+
+
+Figure 4: Evaluation of our stochastic sampler (Algorithm 2). The purple curve corresponds to optimal choices for $\{ S _ { \mathrm { c h u r n } } , S _ { \mathrm { t m i n } } , S _ { \mathrm { t m a x } } , S _ { \mathrm { n o i s e } } \}$ ; orange, blue, and green correspond to disabling the effects of $S _ { \mathrm { t m i n , t m a x } }$ and/or $S _ { \mathrm { n o i s e } }$ . The red curves show reference results for our deterministic sampler (Algorithm 1), equivalent to setting $S _ { \mathrm { c h u r n } } = 0$ . The dashed black curves correspond to the original stochastic samplers from previous work: Euler–Maruyama [48] for VP, predictor-corrector [48] for VE, and iDDPM [36] for ImageNet-64. The dots indicate lowest observed FID.
+
+Through sampler improvements alone, we are able to bring the ImageNet-64 model that originally achieved FID 2.07 [9] to 1.55 that is very close to the state-of-the-art; previously, FID 1.48 has been reported for cascaded diffusion [17], 1.55 for classifier-free guidance [18], and 1.52 for StyleGANXL [44]. While our results showcase the potential gains achievable through sampler improvements, they also highlight the main shortcoming of stochasticity: For best results, one must make several heuristic choices — either implicit or explicit — that depend on the specific model. Indeed, we had to find the optimal values of $\left\{ S _ { \mathrm { c h u r n } } , S _ { \mathrm { t m i n } } , S _ { \mathrm { t m a x } } , S _ { \mathrm { n o i s e } } \right\}$ on a case-by-case basis using grid search (Appendix E.2). This raises a general concern that using stochastic sampling as the primary means of evaluating model improvements may inadvertently end up influencing the design choices related to model architecture and training.
+
+# 5 Preconditioning and training
+
+There are various known good practices for training neural networks in a supervised fashion. For example, it is advisable to keep input and output signal magnitudes fixed to, e.g., unit variance, and to avoid large variation in gradient magnitudes on a per-sample basis [5, 21]. Training a neural network to model $D$ directly would be far from ideal — for example, as the input ${ \pmb x } = { \pmb y } + { \pmb n }$ is a combination of clean signal $\textbf { { y } }$ and noise $\pmb { n } \sim \mathcal { N } ( \mathbf { 0 } , \sigma ^ { 2 } \mathbf { I } )$ , its magnitude varies immensely depending on noise level $\sigma$ . For this reason, the common practice is to not represent $D _ { \theta }$ as a neural network directly, but instead train a different network $F _ { \theta }$ from which $D _ { \theta }$ is derived.
+
+Previous methods [36, 46, 48] address the input scaling via a $\sigma$ -dependent normalization factor and attempt to precondition the output by training $F _ { \theta }$ to predict $\mathbf { \nabla } _ { \mathbf { \pmb { n } } }$ scaled to unit variance, from which the signal is then reconstructed via $D _ { \theta } ( { \pmb x } ; \sigma ) = { \pmb x } - \sigma F _ { \theta } ( \cdot )$ . This has the drawback that at large $\sigma$ , the network needs to fine-tune its output carefully to cancel out the existing noise $\textbf { \em n }$ exactly and give the output at the correct scale; note that any errors made by the network are amplified by a factor of $\sigma$ . In this situation, it would seem much easier to predict the expected output $D ( \pmb { x } ; \sigma )$ directly. In the same spirit as previous parameterizations that adaptively mix signal and noise (e.g., [10, 43, 50]), we propose to precondition the neural network with a $\sigma$ -dependent skip connection that allows it to estimate either $\textbf { { y } }$ or $\textbf { \em n }$ , or something in between. We thus write $D _ { \theta }$ in the following form:
+
+$$
+D _ { \theta } ( { \pmb x } ; \sigma ) = c _ { \mathrm { s k i p } } ( \sigma ) { \pmb x } + c _ { \mathrm { o u t } } ( \sigma ) F _ { \theta } \left( c _ { \mathrm { i n } } ( \sigma ) { \pmb x } ; c _ { \mathrm { n o i s e } } ( \sigma ) \right) ,
+$$
+
+where $F _ { \theta }$ is the neural network to be trained, $c _ { \mathrm { s k i p } } ( \sigma )$ modulates the skip connection, $c _ { \mathrm { i n } } ( \sigma )$ and $ { c _ { \mathrm { o u t } } } ( \sigma )$ scale the input and output magnitudes, and $\dot { c } _ { \mathrm { n o i s e } } ( \sigma )$ maps noise level $\sigma$ into a conditioning input for $F _ { \theta }$ . Taking a weighted expectation of Eq. 2 over the noise levels gives the overall training loss $\mathbb { E } _ { \sigma , \pmb { y } , \pmb { n } } [ \lambda ( \sigma ) | | D ( \pmb { y } + \pmb { n } ; \sigma ) - \pmb { y } | | _ { 2 } ^ { 2 } ]$ , where $\sigma \sim p _ { \mathrm { t r a i n } }$ , $y \sim p _ { \mathrm { d a t a } }$ , and $\bar { \pmb { n } } \sim \mathcal { N } ( \pmb { 0 } , \sigma ^ { 2 } \mathbf { I } )$ . The probability of sampling a given noise level $\sigma$ is given by $p _ { \mathrm { t r a i n } } ( \sigma )$ and the corresponding weight is given by $\lambda ( \sigma )$ . We can equivalently express this loss with respect to the raw network output $F _ { \theta }$ in Eq. 7:
+
+Table 2: Evaluation of our training improvements. The starting point (config A) is VP & VE using our deterministic sampler. At the end (configs E,F), VP & VE only differ in the architecture of $F _ { \theta }$ .
+
+| eeh 67901 1013 92796 | .95.90/9 26-70918 81-91)81 111-1111 9-09) 9 (- 6-56) 56 | % 850850 (% 10'80)0181 1% 00 91) 19 | 31155151 1100-00.0000 7781-4536 0-00 (900-0:000 385-00.0 009 711-75111 115 | 353158185 11:5550000 (21.01- 33.01/00 11.010-2.0000.00 2105350 WUo " UC Ub |
| eaa 4 9941 15484 | 399.95 099 (001- L 68 (1-81) 61 151000010 (L-85)99 96-166 24-181 IDI | 88-418 (%10.9) (% 89) (% 88D)8 | 17 00- 00.0 7855581 076109 (110-00' E00 (50-0-20:) 00 100-000000 773153935 05555 | 15100000 27.07-00.0- 00.0 3.055505.09000 8555555955555 11.1-1150 W "U y U U |
| 5 % 6 2 | 2/90-.90.99 (66- 0 0588 (11-11 71 2112-5555 IDI 61-91)81 6-) 56 (- | %680 (08- 19) 69 (% 005) 8 (%0D)8 | 11.00-050030 1.1-6.90 5511511552 22133555 (010-00')0 (50-0-20:) 200 1-55 1-55 | 1.2525222535 1.001500000 (27- 000 215001 15-155 |
| caprea 48 3 | 39.90.0559 171-10 505 (001-88 811-0015 (L-LS)59 6-06) 56 1-11 | IDI (Z8-69) 9L 3%2388 (%140 (%057D9 | 1101-555550 818856 01-51 (00-10 900 90/0-0:0200 8-55 905-9888 1-000 | 11.07500.0.0 22.0- 0000 11051515815 5515225555 23.5-3000 |
| 916011 6119821 A 994 | 3833505905.99 2820 111-11 914 76-20 (61-91)81 (9L-09)L9 (L6 - 56) S6 ()1 | %692)11 (% 09 7111 (18-29) % 64)111 | 1.11-061111 11111-3553355 (20-00 010 (000-10000 (5-5 05 201-555090 (891-) 911 911-999 | 1.055-15.0000000) 3000-00.00 00.00 (00.601 - 0085 00./ 871501125559 (40-09.110 4 44-44 4444 |
| eu M eu au | snontmuo | eoogee egu reug | Ceonunuog | Ceonunuog |
| (a)spag ag gggiae Hum 1 8 % ℃ | 3 | 品 /6v0x /6v0x 7/6v0[x 7/6v0x 7/6v0[x | Toun D Tou Toun 8 7 |
| rrerago Trgrongae o ed Bereeeeg | eneregeeengor eepggepeamg seereprggotsse eerrprrgr tgteer areoaeaea Tare H | ogsosn eee sspeges sossapereeg gee eret egge | geg rette opgggoog Bpggrooog rgoegg rgnonngn go mggeaag | erereeeenee egret rereeer re ger se eer T trttsstttra |
| N o n | ZOdS JII ndAA R R 8 | repueg a eotgms 品 | 5 5 8 3 | A 5R R 8 |
| sus | ttt umes | oeege | |
+
+A.2: Descriptive statistics and information of all input data features. Variables are displayed with type, description, units and average statistics. We separate all features according to medical literature, including vital-sign, static, serum and haematological variables, and we also display statistics per outcome sub-cohort, defined as a cohort with those patients assigned to a given outcome.
+
+| 2 3 | 1007-000080 17811-05.010 07/26-04550 (/51-07)0/79 6566-.155 33.55-5.1.11 39353.7599 01-0D01 | .18-0.1950 (%55240981 (%908) 0010 (%8S9D0s9 | 1711-1015 18.51-58551 (5:1-0.9)78 (0-00)r0 (r0-0'0)00 25-5555 (51-10)0 | (0/11-0.95.51 3383555577 1.15-5.1-5.830 1-811 3.20-.0.00 14-4 (71-8) 6.9 |
| tssh 3 | (081-0'91021 1.14-.101-110 -700 (0'SL-0'09)0'L9 (0/6-0/6) 0.96 2.11-.0 63955755599 | (0.81-085000 (01-0D01 (% 66'TS) 0'961 3%72050 697966 | (1-8.11 (711-8 1111 (0-10)70 (r0-0'0)r0 91-554 (66-1)7 111-5.00 | 1701530300 2.21-8557 (0/8-0.95).1 25537075 18-5 124-96505 (89-)11 |
| 0 2 | 13.115-3.515.101 305157585/5 107381060 (0'8L-0'09)0'89 (0,96-0,16)0.06 2.7-5.115.71 | 6373-535599 (01-0D0T 0'58-0.69)59 (%/9) (%96'9)08 3655551 | (11-1 1715-88751 (r0-0'0)00 (r0-00)00 (5-0080 (9:41-9.9)504 (1-50 6.0 | 11715357315.350 23/87-5.600 1011-0 (1721-7157711 12724455 3555555 1711-71511 |
| 0 | 1.1135.7503000 006-00)00 (081-090021 7-0850.59 0/6-0.60.56 2.-..0 33933.799 | (0'08-085)0'1 1-0D01 (%00.0)0.100 (% 156781 60005070 | (711-16111 (11-1156 (0-00)0 (r0-0'0)00 5-6057 (16-84)6.9 17.1-6.070 | 171531015010 220-500.00 17.7-5/1500 18110-811114 336-5551 1214-9555 18-7471 |
| E | 13.753.15.711) .16-00.08 (281-0.90081 (181-029)00 0/6-0.6.6 2.-.1.1 8395553595 | 1718-3.59)5.11 3%7555955 %0/227000 162515050 1-0D01 | 1.11-11110 (6.71-8/0.0 (20-00) 10 (r0-00)00 9-800 (501-55)55 (7:1-8:00 | 1711537015110 2371-3.20 ('16-08)0'1 5715-1115.94 901-859 24594 38-71)85 |
| so 20 | 1.114-7111.110 0.6-0.0.00 (061-5900'81 515-0/215159 /6-596 2.11-.1.10 33355.55791 | :18-769086 (% 5069)051 3567045.00 1-0D01 %50600 | (0/01-88) 6.6 6551-5155 (801-5)9 (70-00)r0 (r0-00)00 86-8087 (1-90)6.0 | 2:730700 117153005.000 (161-09876 3.87-3800 132-3550 17/7-501 511 (91-128 |
| n 里 | snonurjuog garnga s HUu SHUI % % ℃ | ()eoae | Cenurnuon | Cenunuon |
| rsrerg | | | T/6v0[X T/6v0[X 品 T/6v0[X T/6v0[X | 品 T/ouu T/owu 1 |
| einaied | errenge reeeaet sessreogooerse eeseorldeeee ereroaeear allta aaeeeea 5 0 P R R | ereeeeee rsseeieas sostperagis etaigee argegatr 2 | oenllgo eeode rg gonrgooo gpgr gonroog rrregrgiiteg rgegrnrgoong pgonrgeoo geggge 8 8 8 R | reeeeeeee egege re l i are glratt rge gia eaeeeereeeereeern R AB R 0 50 B |
| is gea | | ee T srns | | rrleeeah |
+
+A.13: Descriptive statistics and information of all input data features. Variables are displayed with type, description, units and average statistics. We separate all features according to medical literature, including vitalsign, static, serum and haematological variables. Statistics are shown for each cohort as learnt by our model.
+
+
+A.14: Plot of mean Systolic Blood Pressure (SBP) trajectories in solid line as given by the clusters learnt by our model (top). In the bottom, mean FIO2 trajectories are displayed. The respective standard errors are represented by the dashed lines. We visualised trajectories from up to 7 days prior to an outcome event or discharge - the black lines represent the time window $7 2 - 2 4$ hours prior to an event or discharge) considered for input to all models.
\ No newline at end of file
diff --git a/md/dev/lL3lnMbR4WU/lL3lnMbR4WU.md b/md/dev/lL3lnMbR4WU/lL3lnMbR4WU.md
new file mode 100644
index 0000000000000000000000000000000000000000..23893ac26793559b94dcbae7d687c418a71189bf
--- /dev/null
+++ b/md/dev/lL3lnMbR4WU/lL3lnMbR4WU.md
@@ -0,0 +1,449 @@
+# OPEN-VOCABULARY OBJECT DETECTION VIA VISION AND LANGUAGE KNOWLEDGE DISTILLATION
+
+Xiuye $\mathbf { G u } ^ { 1 }$ , Tsung-Yi Lin2, Weicheng ${ \bf K u o } ^ { 1 }$ , Yin Cui1
+
+1Google Research, 2Nvidia∗ {xiuyegu, weicheng, yincui}@google.com tsungyil@nvidia.com
+
+# ABSTRACT
+
+We aim at advancing open-vocabulary object detection, which detects objects described by arbitrary text inputs. The fundamental challenge is the availability of training data. It is costly to further scale up the number of classes contained in existing object detection datasets. To overcome this challenge, we propose ViLD, a training method via Vision and Language knowledge Distillation. Our method distills the knowledge from a pretrained open-vocabulary image classification model (teacher) into a two-stage detector (student). Specifically, we use the teacher model to encode category texts and image regions of object proposals. Then we train a student detector, whose region embeddings of detected boxes are aligned with the text and image embeddings inferred by the teacher. We benchmark on LVIS by holding out all rare categories as novel categories that are not seen during training. ViLD obtains 16.1 mask $\mathsf { A P } _ { r }$ with a ResNet-50 backbone, even outperforming the supervised counterpart by 3.8. When trained with a stronger teacher model ALIGN, ViLD achieves 26.3 $\mathsf { A P } _ { r }$ . The model can directly transfer to other datasets without finetuning, achieving $7 2 . 2 \mathrm { \ A P 5 0 }$ on PASCAL VOC, 36.6 AP on COCO and 11.8 AP on Objects365. On COCO, ViLD outperforms the previous state-of-theart (Zareian et al., 2021) by 4.8 on novel AP and 11.4 on overall AP. Code and demo are open-sourced at https://github.com/tensorflow/tpu/ tree/master/models/official/detection/projects/vild.
+
+# 1 INTRODUCTION
+
+Consider Fig. 1, can we design object detectors beyond recognizing only base categories (e.g., toy) present in training labels and expand the vocabulary to detect novel categories (e.g., toy elephant)? In this paper, we aim to train an open-vocabulary object detector that detects objects in any novel categories described by text inputs, using only detection annotations in base categories.
+
+Existing object detection algorithms often learn to detect only the categories present in detection datasets. A common approach to increase the detection vocabulary is by collecting images with more labeled categories. The research community has recently collected new object detection datasets with large vocabularies (Gupta et al., 2019; Kuznetsova et al., 2020). LVIS (Gupta et al., 2019) is a milestone of these efforts by building a dataset with 1,203 categories. With such a rich vocabulary, it becomes quite challenging to collect enough training examples for all categories. By Zipf’s law, object categories naturally follow a long-tailed distribution. To find sufficient training examples for rare categories, significantly more data is needed (Gupta et al., 2019), which makes it expensive to scale up detection vocabularies.
+
+On the other hand, paired image-text data are abundant on the Internet. Recently, Radford et al. (2021) train a joint vision and language model using 400 million image-text pairs and demonstrate impressive results on directly transferring to over 30 datasets. The pretrained text encoder is the key to the zero-shot transfer ability to arbitrary text categories. Despite the great success on learning image-level representations, learning object-level representations for open-vocabulary detection is still challenging. In this work, we consider borrowing the knowledge from a pretrained openvocabulary classification model to enable open-vocabulary detection.
+
+
+Figure 1: An example of our open-vocabulary detector with arbitrary texts. After training on base categories (purple), we can detect novel categories (pink) that are not present in the training data.
+
+We begin with an R-CNN (Girshick et al., 2014) style approach. We turn open-vocabulary detection into two sub-problems: 1) generalized object proposal and 2) open-vocabulary image classification. We train a region proposal model using examples from the base categories. Then we use the pretrained open-vocabulary image classification model to classify cropped object proposals, which can contain both base and novel categories. We benchmark on LVIS (Gupta et al., 2019) by holding out all rare categories as novel categories and treat others as base categories. To our surprise, the performance on the novel categories already surpasses its supervised counterpart. However, this approach is very slow for inference, because it feeds object proposals one-by-one into the classification model.
+
+To address the above issue, we propose ViLD (Vision and Language knowledge Distillation) for training two-stage open-vocabulary detectors. ViLD consists of two components: learning with text embeddings (ViLD-text) and image embeddings (ViLD-image) inferred by an open-vocabulary image classification model, e.g., CLIP. In ViLD-text, we obtain the text embeddings by feeding category names into the pretrained text encoder. Then the inferred text embeddings are used to classify detected regions. Similar approaches have been used in prior detection works (Bansal et al., 2018; Rahman et al., 2018; Zareian et al., 2021). We find text embeddings learned jointly with visual data can better encode the visual similarity between concepts, compared to text embeddings learned from a language corpus, e.g., GloVe (Pennington et al., 2014). Using CLIP text embeddings achieves 10.1 $\mathsf { A P } _ { r }$ (AP of novel categories) on LVIS, significantly outperforming the $3 . \mathbf { 0 } \ \mathrm { A P } _ { r }$ of using GloVe. In ViLD-image, we obtain the image embeddings by feeding the object proposals into the pretrained image encoder. Then we train a Mask R-CNN whose region embeddings of detected boxes are aligned with these image embeddings. In contrast to ViLD-text, ViLD-image distills knowledge from both base and novel categories since the proposal network may detect regions containing novel objects, while ViLD-text only learns from base categories. Distillation enables ViLD to be general in choosing teacher and student architectures. ViLD is also energy-efficient as it works with off-the-shelf open-vocabulary image classifiers. We experiment with the CLIP and ALIGN (Jia et al., 2021) teacher models with different architectures (ViT and EfficientNet).
+
+We show that ViLD achieves 16.1 AP for novel categories on LVIS, surpassing the supervised counterpart by 3.8. We further use ALIGN as a stronger teacher model to push the performance to 26.3 novel AP, which is close (only 3.7 worse) to the 2020 LVIS Challenge winner (Tan et al., 2020) that is fully-supervised. We directly transfer ViLD trained on LVIS to other detection datasets without finetuning, and obtain strong performance of $7 2 . 2 \mathrm { A P } _ { 5 0 }$ on PASCAL VOC, 36.6 AP on COCO and 11.8 AP on Objects365. We also outperform the previous state-of-the-art open-vocabulary detector on COCO (Zareian et al., 2021) by 4.8 novel AP and 11.4 overall AP.
+
+# 2 RELATED WORK
+
+Increasing vocabulary in visual recognition: Recognizing objects using a large vocabulary is a long-standing research problem in computer vision. One focus is zero-shot recognition, aiming at recognizing categories not present in the training set. Early works (Farhadi et al., 2009; Rohrbach et al., 2011; Jayaraman & Grauman, 2014) use visual attributes to create a binary codebook representing categories, which is used to transfer learned knowledge to unseen categories. In this direction, researchers have also explored class hierarchy, class similarity, and object parts as discriminative features to aid the knowledge transfer (Rohrbach et al., 2011; Akata et al., 2016; Zhao et al., 2017; Elhoseiny et al., 2017; Ji et al., 2018; Cacheux et al., 2019; Xie et al., 2020). Another focus is learning to align latent image-text embeddings, which allows to classify images using arbitrary texts. Frome et al. (2013) and Norouzi et al. (2014) are pioneering works that learn a visual-semantic embedding space using deep learning. Wang et al. (2018) distills information from both word embeddings and knowledge graphs. Recent work CLIP (Radford et al., 2021) and ALIGN (Jia et al., 2021) push the limit by collecting million-scale image-text pairs and then training joint image-text models using contrastive learning. These models can directly transfer to a suite of classification datasets and achieve impressive performances. While these work focus on image-level open-vocabulary recognition, we focus on detecting objects using arbitrary text inputs.
+
+
+Figure 2: An overview of using ViLD for open-vocabulary object detection. ViLD distills the knowledge from a pretrained open-vocabulary image classification model. First, the category text embeddings and the image embeddings of cropped object proposals are computed, using the text and image encoders in the pretrained classification model. Then, ViLD employs the text embeddings as the region classifier (ViLD-text) and minimizes the distance between the region embedding and the image embedding for each proposal (ViLD-image). During inference, text embeddings of novel categories are used to enable open-vocabulary detection.
+
+Increasing vocabulary in object detection: It’s expensive to scale up the data collection for large vocabulary object detection. Zhao et al. (2020) and Zhou et al. (2021) unify the label space from multiple datasets. Joseph et al. (2021) incrementally learn identified unknown categories. Zero-shot detection (ZSD) offers another direction. Most ZSD methods align region features to pretrained text embeddings in base categories (Bansal et al., 2018; Demirel et al., 2018; Rahman et al., 2019; Hayat et al., 2020; Zheng et al., 2020). However, there is a large performance gap to supervised counterparts. To address this issue, Zareian et al. (2021) pretrain the backbone model using image captions and finetune the pretrained model with detection datasets. In contrast, we use an image-text pretrained model as a teacher model to supervise student object detectors. All previous methods are only evaluated on tens of categories, while we are the first to evaluate on more than 1,000 categories.
+
+# 3 METHOD
+
+Notations: We divide categories in a detection dataset into the base and novel subsets, and denote them by $C _ { B }$ and $C _ { N }$ . Only annotations in $C _ { B }$ are used for training. We use $\tau ( \cdot )$ to denote the text encoder and $\mathcal { V } ( \cdot )$ to denote the image encoder in the pretrained open-vocabulary image classifier.
+
+# 3.1 LOCALIZATION FOR NOVEL CATEGORIES
+
+The first challenge for open-vocabulary detection is to localize novel objects. We modify a standard two-stage object detector, e.g., Mask R-CNN (He et al., 2017), for this purpose. We replace its classspecific localization modules, i.e., the second-stage bounding box regression and mask prediction layers, with class-agnostic modules for general object proposals. For each region of interest, these modules only predict a single bounding box and a single mask for all categories, instead of one prediction per category. The class-agnostic modules can generalize to novel objects.
+
+# 3.2 OPEN-VOCABULARY DETECTION WITH CROPPED REGIONS
+
+Once object candidates are localized, we propose to reuse a pretrained open-vocabulary image classifier to classify each region for detection.
+
+
+Figure 3: Model architecture and training objectives. (a) The classification head of a vanilla two-stage detector, e.g., Mask R-CNN. (b) ViLD-text replaces the classifier with fixed text embeddings and a learnable background embedding. The projection layer is introduced to adjust the dimension of region embeddings to be compatible with the text embeddings. (c) ViLD-image distills from the precomputed image embeddings of proposals with an $\mathcal { L } _ { 1 }$ loss. (d) ViLD combines ViLD-text and ViLD-image.
+
+Image embeddings: We train a proposal network on base categories $C _ { B }$ and extract the region proposals $\tilde { r } \in \tilde { P }$ offline. We crop and resize the proposals, and feed them into the pretrained image encoder $\nu$ to compute image embeddings $\mathcal { V } ( \mathrm { c r o p } ( I , \tilde { r } ) )$ , where $I$ is the image.
+
+We ensemble the image embeddings from $1 \times$ and $1 . 5 \times$ crops, as the $1 . 5 \times$ crop provides more context cues. The ensembled embedding is then renormalized to unit norm:
+
+$$
+\mathcal { V } ( \mathrm { c r o p } ( I , \tilde { r } _ { \{ 1 \times , 1 . 5 \times \} } ) ) = \frac { \mathbf { v } } { \lVert \mathbf { v } \rVert } , \mathrm { ~ w h e r e ~ } \mathbf { v } = \mathcal { V } ( \mathrm { c r o p } ( I , \tilde { r } _ { 1 \times } ) ) + \mathcal { V } ( \mathrm { c r o p } ( I , \tilde { r } _ { 1 . 5 \times } ) ) .
+$$
+
+Text embeddings: We generate the text embeddings offline by feeding the category texts with prompt templates, e.g., “a photo of $\{ { \mathrm { c a t e g o r y } } \}$ in the scene”, into the text encoder $\tau$ . We ensemble multiple prompt templates and the synonyms if provided.
+
+Then, we compute cosine similarities between the image and text embeddings. A softmax activation is applied, followed by a per-class NMS to obtain final detections. The inference is slow since every cropped region is fed into $\nu$ .
+
+# 3.3 VILD: VISION AND LANGUAGE KNOWLEDGE DISTILLATION.
+
+We propose ViLD to address the slow inference speed of the above method. ViLD learns region embeddings in a two-stage detector to represent each proposal $r$ . We denote region embeddings by $\mathcal { R } ( \phi ( I ) , r )$ , where $\phi ( \cdot )$ is a backbone model and $\mathcal { R } ( \cdot )$ is a lightweight head that generates region embeddings. Specifically, we take outputs before the classification layer as region embeddings.
+
+Replacing classifier with text embeddings: We first introduce ViLD-text. Our goal is to train the region embeddings such that they can be classified by text embeddings. Fig. 3(b) shows the architecture and training objective. ViLD-text replaces the learnable classifier in Fig. 3(a) with the text embeddings introduced in Sec. 3.2. Only $\mathcal { T } ( C _ { B } )$ , the text embeddings of $C _ { B }$ , are used for training. For the proposals that do not match any groundtruth in $C _ { B }$ , they are assigned to the background category. Since the text “background” does not well represent these unmatched proposals, we allow the background category to learn its own embedding $\mathbf { e } _ { b g }$ . We compute the cosine similarity between each region embedding $\mathcal { R } ( \phi ( I ) , r )$ and all category embeddings, including $\mathcal { T } ( C _ { B } )$ and $\mathbf { e } _ { b g }$ . Then we apply softmax activation with a temperature $\tau$ to compute the cross entropy loss. To train the first-stage region proposal network of the two-stage detector, we extract region proposals $r \in P$ online, and train the detector with ViLD-text from scratch. The loss for ViLD-text can be written as:
+
+$$
+\begin{array} { l } { \displaystyle { { \bf { e } } _ { r } } = \mathcal { R } ( \phi ( I ) , r ) } \ { \displaystyle { { \bf { e } } _ { r } } } \\ { { \displaystyle { \bf { z } } ( r ) = \left[ s i m ( { \bf { e } } _ { r } , { \bf { e } } _ { b g } ) , \ s i m ( { \bf { e } } _ { r } , { \bf { t } } _ { 1 } ) , \ \cdot \cdot \cdot , \ s i m ( { \bf { e } } _ { r } , { \bf { t } } _ { | C _ { B } | } ) \right] } } \\ { { \displaystyle \mathcal { L } _ { \mathrm { V i L D - t e x t } } = \frac { 1 } { N } \sum _ { r \in P } \mathcal { L } _ { \mathrm { C E } } \Big ( s o f t m a x \big ( { \bf { z } } ( r ) / \tau \big ) , y _ { r } \Big ) } , } \end{array}
+$$
+
+where $s i m ( \mathbf { a } , \mathbf { b } ) = \mathbf { a } ^ { \top } \mathbf { b } / ( \| \mathbf { a } \| \| \mathbf { b } \| )$ , $\mathbf { t } _ { i }$ denotes elements in $\mathcal { T } ( C _ { B } )$ , $y _ { r }$ denotes the class label of region $r$ , $N$ is the number of proposals per image $( | P | )$ , and $\mathcal { L } _ { C E }$ is the cross entropy loss.
+
+During inference, we include novel categories $( C _ { N } )$ and generate $\mathcal { T } ( C _ { B } \cup C _ { N } )$ (sometimes $\mathcal { T } ( C _ { N } )$ only) for open-vocabulary detection (Fig. 2). Our hope is that the model learned from annotations in $C _ { B }$ can generalize to novel categories $C _ { N }$ .
+
+Distilling image embeddings: We then introduce ViLD-image, which aims to distill the knowledge from the teacher image encoder $\nu$ into the student detector. Specifically, we align region embeddings $\mathcal { R } ( \phi ( I ) , \tilde { r } )$ to image embeddings $\mathcal { V } ( \mathrm { c r o p } ( I , \tilde { r } ) )$ introduced in Sec. 3.2.
+
+To make the training more efficient, we extract $M$ proposals $\tilde { r } \in \tilde { P }$ offline for each training image, and precompute the $M$ image embeddings. These proposals can contain objects in both $C _ { B }$ and $C _ { N }$ , as the network can generalize. In contrast, ViLD-text can only learn from $C _ { B }$ . We apply an $\mathcal { L } _ { 1 }$ loss between the region and image embeddings to minimize their distance. The ensembled image embeddings in Sec. 3.2 are used for distillation:
+
+$$
+\mathcal { L } _ { \mathrm { V i L D - i m a g e } } = \frac { 1 } { M } \sum _ { \tilde { \boldsymbol { r } } \in \tilde { P } } \| \mathcal { V } ( \mathrm { c r o p } ( I , \tilde { r } _ { \{ 1 \times , 1 . 5 \times \} } ) ) - \mathcal { R } ( \phi ( I ) , \tilde { r } ) \| _ { 1 } .
+$$
+
+Fig. 3(c) shows the architecture. Zhu et al. (2019) use a similar approach to make Faster R-CNN features mimic R-CNN features, however, the details and goals are different: They reduce redundant context to improve supervised detection; while ViLD-image is to enable open-vocabulary detection on novel categories.
+
+The total training loss of ViLD is simply a weighted sum of both objectives:
+
+$$
+\mathcal { L } _ { \mathrm { V i L D } } = \mathcal { L } _ { \mathrm { V i L D - t e x t } } + w \cdot \mathcal { L } _ { \mathrm { V i L D - i m a g e } } ,
+$$
+
+where $w$ is a hyperparameter weight for distilling the image embeddings. Fig. 3(d) shows the model architecture and training objectives. ViLD-image distillation only happens in training time. During inference, ViLD-image, ViLD-text and ViLD employ the same set of text embeddings as the detection classifier, and use the same architecture for open-vocabulary detection (Fig. 2).
+
+# 3.4 MODEL ENSEMBLING
+
+In this section, we explore model ensembling for the best detection performance over base and novel categories. First, we combine the predictions of a ViLD-text detector with the open-vocabulary image classification model. The intuition is that ViLD-image learns to approximate the predictions of its teacher model, and therefore, we assume using the teacher model directly may improve performance. We use a trained ViLD-text detector to obtain top $k$ candidate regions and their confidence scores. Let $p _ { i }$ ,ViLD-text denote the confidence score of proposal $\tilde { r }$ belonging to category $i$ . We then feed crop $( I , \tilde { r } )$ to the open-vocabulary classification model to obtain the teacher’s confidence score $p _ { i , \mathrm { c l s } }$ . Since we know the two models have different performance on base and novel categories, we introduce a weighted geometric average for the ensemble:
+
+$$
+p _ { i , \mathrm { e n s e m b l e } } = { \left\{ \begin{array} { l l } { p _ { i , { \mathrm { V i L D - t e x t } } } ^ { \lambda } \cdot p _ { i , \mathrm { c l s } } ^ { ( 1 - \lambda ) } , } & { { \mathrm { i f ~ } } i \in C _ { B } } \\ { p _ { i , { \mathrm { V i L D - t e x t } } } ^ { ( 1 - \lambda ) } \cdot p _ { i , \mathrm { c l s } } ^ { \lambda } . } & { { \mathrm { i f ~ } } i \in C _ { N } } \end{array} \right. }
+$$
+
+$\lambda$ is set to $2 / 3$ , which weighs the prediction of ViLD-text more on base categories and vice versa.
+Note this approach has a similar slow inference speed as the method in Sec. 3.2.
+
+Next, we introduce a different ensembling approach to mitigate the above inference speed issue. Besides, in ViLD, the cross entropy loss of ViLD-text and the $\mathcal { L } _ { 1 }$ distillation loss of ViLD-image is applied to the same set of region embeddings, which may cause contentions. Here, instead, we learn two sets of embeddings for ViLD-text (Eq. 2) and ViLD-image (Eq. 3) respectively, with two separate heads of identical architectures. Text embeddings are applied to these two regions embeddings to obtain confidence scores $p _ { i }$ ,ViLD-text and $p _ { i }$ ,ViLD-image, which are then ensembled in the same way as Eq. 5, with $p _ { i }$ ,ViLD-image replacing $p _ { i , \mathrm { c l s } }$ . We name this approach ViLD-ensemble.
+
+# 4 EXPERIMENTS
+
+Implementation details: We benchmark on the Mask R-CNN (He et al., 2017) with ResNet (He et al., 2016) FPN (Lin et al., 2017) backbone and use the same settings for all models unless explicitly specified. The models use $1 0 2 4 \times 1 0 2 4$ as input image size, large-scale jittering augmentation of range [0.1, 2.0], synchronized batch normalization (Ioffe & Szegedy, 2015; Girshick et al., 2018) of batch size 256, weight decay of 4e-5, and an initial learning rate of 0.32. We train the model from scratch for 180,000 iterations, and divide the learning rate by 10 at $0 . 9 \times$ , $0 . 9 5 \times$ , and $0 . 9 7 5 \times$ of total iterations. We use the publicly available pretrained CLIP model1 as the open-vocabulary classification model, with an input size of $2 2 4 \times 2 2 4$ . The temperature $\tau$ is set to 0.01, and the maximum number of detections per image is 300. We refer the readers to Appendix D for more details.
+
+# 4.1 BENCHMARK SETTINGS
+
+We mainly evaluate on LVIS (Gupta et al., 2019) with our new setting. To compare with previous methods, we also use the setting in Zareian et al. (2021), which is adopted in many zero-shot detection works.
+
+LVIS: We benchmark on LVIS v1. LVIS contains a large and diverse set of vocabulary (1,203 categories) that is more suitable for open-vocabulary detection. We take its 866 frequent and common categories as the base categories $C _ { B }$ , and hold out the 337 rare categories as the novel categories $C _ { N }$ . $\mathsf { A P } _ { r }$ , the AP of rare categories, is the main metric.
+
+COCO: Bansal et al. (2018) divide COCO-2017 (Lin et al., 2014) into 48 base categories and 17 novel categories, removing 15 categories without a synset in the WordNet hierarchy. We follow previous works and do not compute instance masks. We evaluate on the generalized setting.
+
+# 4.2 LEARNING GENERALIZABLE OBJECT PROPOSALS
+
+We first study whether a detector can localize novel categories when only trained on base categories. We evaluate the region proposal networks in Mask R-CNN with a ResNet-50 backbone. Table 1 shows the average recall (AR) (Lin et al., 2014) on novel categories. Training with only base categories performs slightly worse by $\sim 2$ AR at 100, 300, and 1000 proposals, compared to using both base and novel categories. This experiment demonstrates that, without seeing novel categories during training, region proposal networks can generalize to novel categories, only suffering a small performance drop. We believe better proposal networks focusing on unseen category generalization should further improve the performance, and leave this for future research.
+
+Table 1: Training with only base categories achieves comparable average recall (AR) for novel categories on LVIS. We compare RPN trained with base only vs. base $^ +$ novel categories and report the bounding box AR.
+
+| Claude-instant-v1.0 v.s. GPT-3.5-Turbo 2023-05-10 | Al Feedback to seller | Round 2, After Al Feedback |
| Round 1, before Al Feedback | Claude-ins-l.0 | Seller Critic I.Focus on the qualities and benefits | | Claude-ins-l.0 | SellerHi,this is a good balloon and its price is $20 |
| Claude-ins-l.0 | Seller Hi,this is a good balloon and its price is $20 | of the balloon, not just the price. Highlight how rare and special it is. | Claude-in-l.0 |Seller | GPT-3.5-T| BuyerWould you consider selling it for $10? No,$l0 is much too low.This balloon is |
| GPT-3.5-T|Buyer Would you consider seling it for $10? | 2. Build rapport and connection with | | made of high quality latex and handcrafted by expert artisans.It's |
| Claude-ins-l.0 | Seller No,that price is too low. | | the buyer to make them feel like they are gettinga good deal froma trusted | GPT-3.5-T | Buyer | unique one-of-a-kind piece. What would be the lowest price you |
| GPT-3.5-T| Buyer What about $15? | | seller. 3.Be willing to walk away if needed. | | could offer me for this balloon? |
| Claude-ins-l.O | Seller $15 is better,but still not enough. | Let the buyer know you have other interested buyers,so they realize the | Claude-ins-l.0 |Seller | Well, because Itrust you and value your business,l will offer you this special |
| GPT-3.5-T | Buyer What is the lowest price you can offer? | value in meeting your price. | | balloon at $I7.This price is only available to valued customers like |
| Claude-ins-l.O | Seller My lowest price is $18. | | Claude-ins-l.0 | Seller Sure,l will try to improve my | GPT-3.5-T| Buyer | yourself today. Can you give me a better deal,like $15? |
| GPT-3.5-T | Buyer Iunderstand.Could you do $16? That's the highest l can go. | negotiation strategy based on the feedback from the critic. | | Claude-ins-l.0 | Seller Iapologize,but $I5 does not even cover my costs.I have to charge at least $17 for this unique,high-quality balloon. |
| Claude-ins-I.0 | Seller $16 will work for today. | Congratulations,you gota good deal! | And l will try to sell it at a higher price (higher than $16.O) than the previous round. | GPT-3.5-T | Buyer | Alright,you've got a deal.I will take the |
| A. Round 1, before Al feedback to seller, the | B.Al critic give feedbacks to the seller based on | | special balloon for $17. strategy based on the feedback, final price $17. |
| bargaining process is relatively simple, final price $16. | the previous round, then seller acknowledge. | C. Round 2,seller improves the reasoning | |
+
+Figure 2: An example of playing the negotiation game and then improving from AI feedback. A: claude-instant-v1.0 plays the seller and gpt-3.5-turbo the buyer, bargaining about a balloon. B: then we use a claude-instant-v1.0 critic to provide feedback. C: upon receiving the feedback, the seller improves its strategy based on the suggestions. Note that colored phrases like “high quality latex and handcrafted by expert artisans” correspond to previous AI feedback “how rare and special it is”. We measure the final price as the proxy of the effectiveness of the strategy because the overall goal is to get a better price. In this case, it improves from $\$ 16$ to $\$ 17$ .
+
+58 scalar [25, 15] while in ICL the feedback is in natural language. We study AI feedback (rather than
+59 rely on human intervention after each round) because it is more scalable and can allow models to
+60 self-improve automatically.
+61 Our experiments lead to several intriguing findings: (1) The requirements of our bargaining game
+62 effectively serve as a testbed for assessing the abilities of LLMs (Fig. 1C): although most models can
+63 do chitchat in a casual scenario, as of our experiment date (May 2023), cohere-command [10] model
+64 does not understand the rule of bargaining (Fig. 3A), ai21-jurassic [18] model does not respond
+65 to AI feedback (Fig. 3B), claude-instant-v1.0 can at most improve one round (Fig. 5), and only
+66 gpt-3.5-turbo, gpt-4, and claude-v1.3 can continuously improve over multiple rounds. (2)
+67 Models behave differently upon receiving feedback when playing different roles. Models playing the
+68 buyer role may be harder to improve than when in the seller role (Fig. 4). (3) It is indeed possible
+69 for strong agents like gpt-4 to continuously improve meaningfully using previous experiences and
+70 online iterative AI feedback, yet the attempt to sell at a higher price (or buy at a lower price) comes
+71 with the risk of failing to reach a deal at all (Fig. 6). We further show evidence of the model being
+72 able to negotiation in a less verbose but more strategic (thus more effective) way (Fig. 7). Overall,
+73 we hope our work serves as a meaningful initiative for improving language models’ negotiation in a
+74 game setting using AI feedback.
+
+# 75 2 Problem Setting
+
+76 Our goal is to study whether LLMs can improve each other by playing a negotiation game and
+77 incorporating AI feedback, as shown in Fig. 1A. We set the product being bargained as a balloon (and
+78 our results hold when changing the balloon to other items). We use different combinations of backend
+79 LLM engines: cohere-command [10], AI21’s jurassic-2 [18], OpenAI’s gpt-3.5-turbo and
+80 gpt-4 [24], Anthropic’s claude-instant-v1.0 (which supposedly matches gpt-3.5-turbo [14])
+81 and claude-v1.3 (which is supposed to be slightly worse but close to gpt-4 [14]). throughout our
+82 experiments, we provide feedback to improve only one of the two players, while its rival receives no
+83 feedback, clears the negotiation history of previous rounds, and restarts. We vary the engines for the
+84 model being improved while fixing its rival’s engine to be gpt-3.5-turbo. Essentially, our game
+85 is gpt-3.5-turbo vs. all other engines. We keep the LM engine behind the critic is always the
+86 same as the player it provides feedback to. One example setting is a gpt-4 seller playing against a
+87 gpt-3.5-turbo buyer, with a gpt-4 critic. After one round, the gpt-4 critic provides feedback to
+88 the gpt-4 seller such that the seller can improve in the next round while its rival gpt-3.5-turbo
+89 buyer clears its dialog history and restarts.
+90 Process of the Game Before the game begins, the rules of the negotiation game are explained
+91 to the models through textual instructions with the objective of selling/ buying at a higher/ lower
+92 price. We set the deal price to $[ \mathbb { S } 1 0 , \mathbb { S } 2 0 ]$ for easier evaluation, since other the deal price may vary
+93 in a wide range according to the observations from our preliminary experiments. To achieve this,
+94 we hard code the seller to kick off the negotiation with “This is a good balloon and its price is $\$ 20$ .”
+95 Similarly, the buyer always opens with “Would you consider selling it for $\$ 10?$ When both players
+96 strictly follow the game rules, the deal price would be between $\$ 10$ and $\$ 20$ . We let the models play
+97 multiple runs and measure the average deal price before and after AI feedback. During the game, the
+98 seller’s output is used to prompt the buyer and vice versa, conditioning on the entire conversation
+99 history. This process is repeated till a terminal state is reached. Fig. 2A shows an example round. We
+100 define three game states: (1) ON-GOING: the negotiation between the two players is still ongoing;
+101 (2) DEAL: the negotiation has concluded and the two players have reached a deal; (3) NO DEAL: the
+102 players cannot agree on a price and have failed to reach a deal. To track the game states, we set an
+103 additional moderator (powered by a fourth LLM, in our case, gpt-3.5-turbo) to read the current
+104 dialog and classify the states (we will discuss more details about the moderator later). We measure
+105 the performance of the players based on the final deal price.
+106 Critic A round is finished when the negotiation reaches a terminating state, either a DEAL or
+107 NO DEAL. After each round, the critic LM is asked to provide constructive feedback to the player we
+108 aim to improve. This player’s dialog history from all past rounds and all feedback it has received are
+109 used to prompt the critic LM (Fig. 2B). The critic model is instructed to provide three suggestions to
+110 the player, in order to improve its negotiation strategies to achieve a more favorable price in the next
+111 game. Before the next round, the player being improved receives the critic’s feedback as a textual
+112 prompt, while its rival clears its negotiation history and restarts.
+113 The Moderator The game state is classified by prompting a gpt-3.5-turbo moderator using
+114 few-shot demonstrations. The moderator reads the most recent four rounds (as well as in-context
+115 examples of different dialog states) and determines the state of the negotiation. Empirically, we found
+116 that four rounds of conversations are sufficient for the moderator to determine the negotiation state.
+117 One key challenge here is detecting no-deals as the model seems to be better at recognizing DEAL
+118 than NO DEAL. We mitigate this issue by playing multiple runs, inspect failure cases manually,
+119 and add them to the prompt with corrected labels. We find this method an effective side product
+120 recommend it as a technique for prompt optimization for generic classification tasks.
+121 Playing for Multiple Rounds Finally, we would like to explore whether the players can continu
+122 ously improve from AI feedback in a game over multiple rounds. Intuitively, the more rounds the
+123 players play, the more challenging to keep improving because the (already improved) price from the
+124 previous round becomes the baseline for the next round. In the experiments, we will show that only
+125 gpt-4 can improve over 5 rounds while other models’ improvements may saturate at about 3 rounds.
+
+# 126 3 Related Work
+
+127 Game Playing and AlphaGo Zero Our setting is strongly inspired by AlphaGo Zero [31] where
+128 two agents play the game of Go and improve each other with minimal human intervention. Here we
+129 would like to explore its counterpart in natural language. Our work is similar to AlphaGo Zero in the
+130 sense that we also have AI agents (large language models) playing competitive games (bargaining)
+131 and try to improve with little human supervision. Yet there is an important difference between our
+132 work and AlphaGo Zero: we have a third agent, the critic, to give feedback helping its player to
+133 improve. This is a cooperative relationship that does not exist in AlphaGo Zero. On the NLP side, the
+134 closest related work is Lewis et al. [19] where they have (small) RNN [9] language models to bargain,
+135 and our work can be viewed as a more developed version of them since we change the engine to
+136 be large language models. In general, our work is broadly under the area of AI negotiation [6, 6],
+137 strategic reasoning [12], and general game playing [30].
+138 Large Language Models as Generative Agents Large language models have demonstrated
+139 incredible multi-dimensional capabilities [33, 24], especially in complex reasoning [34, 28, 13] and
+140 multi-round dialog [15, 2, 3], which serve as the foundation of this work. Our work is related to
+141 concurrent works like Generative Agents [26] and CAMEL [20] as they also study the behavior of
+142 LLMs in a multi-agent game setting. The core difference between our work and theirs is that we
+143 have a clear objective (the deal price) for the model to improve through competition and cooperation,
+144 while their work studies the generic social behavior of LLMs.
+
+
+Figure 3: Not all models can play bargaining. A. As of May 2023, the cohere model does not understand the rule of bargaining and agrees on irrational prices. B. The AI21 Jurrasic-2 model, although understanding the rule of bargaining, does not incorporate the feedback from the critic. Since these models are consistently being updated, we include the timestamp and note future versions may have improved performance.
+
+Learning from AI Feedback Our method is also strongly inspired by constitutional AI [3] as we both use AI feedback, while the difference is that our feedback is directly in natural language (not a scalar from a reward model). There are also related/ concurrent works demonstrating the effectiveness of natural language feedback [29, 27, 22] and self-refinement [7, 23]. Our work further confirms the effectiveness of AI feedback in the strategic negotiation game setting.
+
+# 150 4 Experiments
+
+151 In our experiments, we consider three stages that gradually deepen our exploration of learning from
+152 AI feedback: (1) We first set up the basics of the game (Sec. 4.2), showing that only a few models can
+153 improve from AI critics, in which case AI feedback can be comparable (but more scalable) as human
+154 feedback. Other models either do not understand/ follow the rule of bargaining, or cannot incorporate
+155 AI feedback for improvements. (2) Then we study the models’ behaviors when playing different roles
+156 (Sec. 4.3). We discover the intriguing result that buyers are in general harder to improve than sellers.
+157 (3) Finally, we study whether models can continuously improve over multiple rounds (Sec. 4.4), and
+158 show a tradeoff of deal price versus success rate: although some models can continuously improve
+159 the deal price, it comes with a higher risk of breaking a deal. We further show evidence of negotiation
+160 in a more strategic way: both gpt-4 and claude-v1.3’s responses become longer after multiple
+161 rounds of AI feedback (note that verbosity is a straightforward negotiation strategy), yet gpt-4 is less
+162 verbose than claude-v1.3 but achieves higher deal price and deal rate, meaning that its responses,
+163 although using fewer words, are more strategic and effective.
+
+# 164 4.1 Experiment Setup
+
+165 Model Engines The minimum requirement for models to enter our game is that they should be a
+166 chatbot. All models we consider (cohere-command, AI21’s jurassic-2, OpenAI’s gpt and An
+167 thropic’s claude) can be accessed by API calls. Amoung them, $\tt g p t { - } 4$ is the most expensive one and
+168 running 500 rounds of negotiation costs about $\$ 120$ and gpt-3.5-turbo costs about $\$ 10$ . Other mod
+169 els are beta testing (as of May 2023) and do not charge money. For reference, the approximate rank
+170 of these models, from benchmarks like chain-of-thought hub [14] and HeLM [21], is that gpt-4 and
+171 claude-v1.3 are approximately similar, better than gpt-3.5-turbo and claude-instant-v1.0,
+172 and better than cohere-command and $j 2 – j$ umbo-instruct. We will consider more models in the
+173 future, such as Google’s PaLM-2 [16].
+174 We let all models compete with gpt-3.5-turbo, effectively making it a baseline for all other models.
+175 We will show that, aligning with other concurrent model rankings [14, 21], gpt-3.5-turbo is a
+176 middle-level powerful engine (worse than gpt-4, better than claude-instant-v1.0). For a given
+177 model engine (say claude-v1.3), we run it as the seller (with gpt-3.5-turbo as the buyer) and
+178 as a buyer (with gpt-3.5-turbo now as the seller) We first let the models to play one round and
+179 manually inspect if they understand the rules of bargaining. If they do, we let them play two rounds
+180 to see if they could respond to AI feedback. For the critic model, we set its engine the same as its
+181 player. We repeat the game 500 times to compute the average deal price before and after AI feedback.
+182 If they do improve one round, we let them play multiple rounds and see if they could continuously
+183 improve their strategy. We repeat the game 200 times with 5 max rounds to compute the average
+184 deal price for each round. When decoding from the model engines, we use sampling with default
+185 temperature (1.0 for gpt and claude, 0.75 for cohere and 0.7 for ${ \mathrm { j } } 2$ ).
+186 Prompt Engineering In this work, we only had to manually optimize the prompts for the
+187 moderator because the player may reach/ break a deal with very diverse expressions, and we would
+188 like to make sure the moderator correctly recognizes all of them. As mentioned above, we identify the
+189 errors made by the moderator in identifying deals and keep adding them as in-context demonstrations
+190 until the model reaches a sufficiently high accuracy (about $9 0 +$ by manual inspection). For the players
+191 and the critic, we do not do prompt engineering and keep the instructions the same for all engines (but
+192 the format may be different, e.g., claude requires two linebreaks before “HUMAN:” and ${ \dot { \mathsf { J } } } ^ { 2 }$ requires
+193 two “##” after each dialog round). Code and Prompts will be released publicly on publication.
+
+Table 1: Seller performance using AI feedback vs. randomly selected human feedback from a pre-defined pool. Recall that the buyer is fixed to be gpt-3.5-turbo and has no access to previous rounds. AI’s feedback is comparable to human’s, but is more scalable, as the two both induce similar price increases.
+
+| Name Configurations Values |
| Generic Cuboid Attention | cuboid_sizeshiftstrategy | (T1,H,W1)→(T2,H,W2)→:→(TL,HL,WL)(P,M,M)→(P2,M,M2)→:→(PL,ML,ML)"loc./dil."→“loc./dil.”→·…·→“loc./dil.” |
| Axial | cuboid_size | (T,1,1)→(1,H,1)→(1,1,W) |
| Divided Space-Time | cuboid_size | (T,1,1) →(1,H,W) |
| Video-Swin P×M | cuboid_sizeshift | (P,M,M)→(P,M,M)(0,0,0)→(P/2,M/2,M/2) |
| Spatial Local-Dilate-M | cuboid_sizestrategy | (T,1,1)→(1,M,M)→(1,M,M)“local”→“local”→“dilated" |
| Axial Space Dilate-M | cuboid_sizestrategy | (T,1,1)→(1,H/M,1)→(1,H/M,1)→(1,1,W/M)→(1,1,W/M)“local”→“dilated”→“local”→“dilated”→“local” |
+
+Here, $\mathtt { C a t } ( \cdot )$ flattens and concatenates its input tensors. By combining Eqn. $^ { 1 , 7 , 8 , 5 }$ , we abbreviate the overall computation of the cuboid attention layer with global vectors as in Eqn. 9.
+
+$$
+\begin{array} { r } { \mathcal { X } _ { \mathrm { o u t } } = \mathtt { C u b A t t n } _ { \Theta } ( \mathcal { X } , \mathcal { G } , } \\ { \mathcal { G } _ { \mathrm { o u t } } = \mathtt { A t t n } _ { \Phi } ^ { \mathrm { g l o b a l } } ( \mathcal { G } , \mathcal { X } ) . } \end{array}
+$$
+
+The additional complexity caused by the global vectors is approximately $O \left( T H W \cdot P + P ^ { 2 } \right)$ . Given that $P$ is usually small (in our experiments, $P$ is at most 8), the computational overhead induced by the global structure is negligible. The architecture of the cuboid attention layer is illustrated in Fig. 3.
+
+# 3.3 Hierarchical Encoder-Decoder Architecture
+
+Earthformer adopts a hierarchical encoder-decoder architecture illustrated in Fig. 2. The hierarchical architecture gradually encodes the input sequence to multiple levels of representations and generates the prediction via a coarse-to-fine procedure. Each hierarchy stacks $D$ cuboid attention blocks. The cuboid attention block in the encoder uses one of the patterns described in Table $^ { 1 , }$ and each cuboid block in the decoder adopts the “Axial” pattern. To reduce the spatial resolution of the input to cuboid attention layers, we include a pair of initial downsampling and upsampling modules that consist of stacked 2D-CNN and Nearest Neighbor Interpolation (NNI) layers. Different from other papers that adopt Transformer for video prediction $\bar { \lVert 1 9 \rVert } , \lVert \bar { 3 0 } \rVert$ , we generate the predictions in a non-auto-regressive fashion rather than an auto-regressive patch-by-patch fashion. This means that our decoder directly generates the predictions from the initial learned positional embeddings. We also conducted experiments with an auto-regressive decoder based on visual codebook $\mathbb { B } 3 \mathbb { I }$ . However, the auto-regressive decoder underperforms the non-auto-regressive decoder in terms of forecasting skill scores. The comparison between non-auto-regressive decoder and auto-regressive decoder is shown in Appendix C.
+
+# 4 Experiments
+
+We first conducted experiments on two synthetic datasets, MovingMNIST and a newly proposed $N$ -body MNIST, to verify the effectiveness of Earthformer and conduct ablation study on our design choices. Results on these two datasets lead to the following findings: 1) Among all patterns listed in Table $^ { 1 , }$ “Axial” achieves the best overall performance; 2) Global vectors bring consistent performance gain with negligible increase in computational cost; 3) Using a hierarchical coarseto-fine structure can boost the performance. Based on these findings, we figured out the optimal design of Earthformer and compared it with other state-of-the-art models on two real-world datasets: SEVIR $\mathbb { \lVert \boldsymbol { 4 3 } \rVert }$ and ICAR-ENSO2. On both datasets, Earthformer achieved the best overall performance. The statistics of all the datasets used in the experiments are shown in Table $\boxed { 2 } .$ We normalized the data to the range [0, 1] and trained all the models with the Mean-Squared Error (MSE) loss. More implementation details are shown in Appendix A.
+
+Table 2: Statistics of the datasets used in the experiments.
+
+| Method | Architecture | Param. | CIFAR-10 (%) | CIFAR-100 (%) |
| ID | Non-IID | IID | Non-IID |
| Standalone training | ResNet-18 | 11M | 82.42 | 74.95 | 53.88 | 52.37 |
| FedSimCLR | ResNet-18 | 11M | 82.15 | 78.09 | 56.39 | 55.58 |
| FedMoCoV1 | ResNet-18 | 11M | 83.63 | 78.21 | 59.58 | 56.98 |
| FedMoCoV2 | ResNet-18 | 11M | 84.25 | 79.14 | 58.71 | 57.47 |
| FedSimSiam | ResNet-18 | 11M | 81.46 | 76.27 | 49.92 | 48.94 |
| FedBYOL | ResNet-18 | 11M | 84.29 | 79.44 | 54.24 | 57.51 |
| FedU (Zhuang et al., 2021a) | ResNet-18 | 11M | 83.96 | 80.52 | 54.82 | 57.21 |
| FedEMA predictor only (ours) | ResNet-18 | 11M | 84.97 | 81.13 | 55.52 | 57.53 |
| FedEMA encoder only (ours) | ResNet-18 | 11M | 82.88 | 82.39 | 56.06 | 59.74 |
| FedEMA (λ= 0.8) | ResNet-18 | 11M | 85.59 | 82.77 | 57.86 | 61.21 |
| FedEMA (autoscaler,T = 0.7) | ResNet-18 | 11M | 86.26 | 83.34 | 58.55 | 61.78 |
| Standalone training | ResNet-50 | 23M | 83.16 | 77.84 | 57.21 | 55.16 |
| FedSimCLR | ResNet-50 | 23M | 82.24 | 80.37 | 57.46 | 56.88 |
| FedMoCoV1 | ResNet-50 | 23M | 87.19 | 82.18 | 64.74 | 59.73 |
| FedMoCoV2 | ResNet-50 | 23M | 87.19 | 79.62 | 63.75 | 59.52 |
| FedSimSiam | ResNet-50 | 23M | 79.64 | 76.7 | 46.28 | 48.8 |
| FedBYOL | ResNet-50 | 23M | 83.90 | 81.33 | 57.75 | 59.53 |
| FedCA (Zhang et al., 2020a) | ResNet-50 | 23M | 71.25 | 68.01 | 43.30 | 42.34 |
| FedU (Zhuang et al., 2021a) | ResNet-50 | 23M | 86.48 | 83.25 | 59.51 | 61.94 |
| FedEMA predictor only (ours) | ResNet-50 | 23M | 83.66 | 81.78 | 57.79 | 60.11 |
| FedEMA encoder only (ours) | ResNet-50 | 23M | 84.66 | 84.91 | 58.52 | 62.51 |
| FedEMA (入= 0.8) | ResNet-50 | 23M | 86.12 | 85.29 | 60.96 | 62.53 |
| FedEMA (autoscaler, T = 0.7) | ResNet-50 | 23M | 85.08 | 84.31 | 59.48 | 62.77 |
| BYOL (Centralized) | ResNet-18 | 11M | 90.46 | - | 65.54 | - |
| BYOL (Centralized) | ResNet-50 | 23M | 91.85 | 1 | 66.51 | = |
+
+Table 6: Top-1 accuracy comparison on larger numbers of clients with client subsampling: 1) randomly selecting 5 out of 20 clients per round (5/20); 2) randomly selecting 8 out of 80 clients per round (8/80). FedEMA, trained with autoscaler, consistently outperforms FedBYOL in both settings.
+
+| After preprocessing | <name>:"convnet on cifar10",<metric>:"accuracy",<goal>:<MAXIMIZE>, <algorithm>:"random_search" &<name>:"opt_kw.Ir",<type>:<DOUBLE>,<min_value>:1e-6,<max_value>:1e-2, <scale_type>:<LOG> &<name>:"opt_type",<type>:<CATEGORICAL>,<categories>:["SGD","Adam"] <831><0>* <0>—<645><1>* <999> |
| Subwords after tokenization | name:"conv net on ci far10 ",metric:" acc u racy goal : MAXIMIZE,algorithm: " random_search " & name : " op t_kw .Ir ",type : DOUBLE,min_value : 1e -6, max_value : 1e -2,scale_type : LOG & name : " opt_type ",type : CATEGORICAL, categories : [ " SG D ", " A dam "] 8310*0l 645 1 999 |
+
+model on a given dataset and explain how to use the OPTFORMER’s parameter and function prediction abilities to implement an HPO policy.
+
+# 4.1 Study tokenization
+
+To generalize over HPO problems of different parameter sizes, types, and metadata, we propose to serialize the study as a one-dimensional textual sequence, also advocated in [26]. Unfortunately, a naive serialization approach, e.g. via JSON [43], will produce unnecessarily long sequences.
+
+To improve scalability, we compress the textual representation of metadata $m$ by removing redundant phrases and punctuation (e.g., "parameter", quotes) and encoding keywords (e.g., "name", "algorithm") and enumerating types (e.g. "DOUBLE") into single tokens.
+
+For the historical sequence $^ { h }$ , we convert every DOUBLE and INTEGER parameter along with every function value into a single token, by normalizing and discretizing them into integers, with an quantization level of $Q = 1 0 0 0$ ; e.g.
+
+$$
+\bar { x } = \operatorname* { i n t } [ x _ { \mathrm { n o r m } } \cdot Q ] , \mathrm { w h e r e } x _ { \mathrm { n o r m } } = ( x - x _ { \mathrm { m i n } } ) / ( x _ { \mathrm { m a x } } - x _ { \mathrm { m i n } } ) .
+$$
+
+The range of $x$ is defined by the search space and the range of $y$ is obtained from observed values in $^ { h }$ . For other types, we use the index in their value set.
+
+The shortened text string is then converted to a sequence of tokens via the SentencePiece tokenizer [44] (see Table 2 for an example). Every trial is represented by text, which is represented as a sequence of normalized and quantized tokens, $\left[ \bar { x } _ { t } ^ { ( 1 ) } , \ldots , \bar { x } _ { t } ^ { ( D ) } , \star , \bar { y } _ { t } , \ " | " \right]$ , where the token $\star$ separates parameter and function values and "|" separates trials. See Appendix A.2 for further details on tokenization.
+
+# 4.2 Model and training loss
+
+After tokenization, the converted historical sequence is as follows:
+
+$$
+\bar { h } _ { t } = \left[ \bar { x } _ { 1 } ^ { ( 1 ) } , \bar { x } _ { 1 } ^ { ( 2 ) } , \ldots , \bar { x } _ { 1 } ^ { ( D ) } , \star , \bar { y } _ { 1 } , " | " , \ldots , \bar { x } _ { t } ^ { ( 1 ) } , \bar { x } _ { t } ^ { ( 2 ) } , \ldots , \bar { x } _ { t } ^ { ( D ) } , \star , \bar { y } _ { t } \right] .
+$$
+
+We can now apply a Transformer model to learn the conditional distribution of tokens in $\bar { h }$ using the chain rule, given the metadata $\bar { m }$ , as depicted in Fig. 1. The joint distribution is presented in Appendix D.1.
+
+Given a dataset $\mathcal { D }$ of hyperparameter optimization studies, we train the OPTFORMER by maximizing the weighted log-likelihood for each study $( m , h ) \sim \mathcal { D }$ :
+
+$$
+\begin{array} { r } { \mathcal { L } ( \boldsymbol { \theta } ; m , h ) = \sum _ { n } w _ { n } \log P _ { \boldsymbol { \theta } } \big ( \bar { h } ^ { ( n ) } | \bar { m } , \bar { h } ^ { ( 1 : n - 1 ) } \big ) , } \end{array}
+$$
+
+with $w _ { n } = 0$ if $\bar { h } ^ { ( n ) } \in \{ \star , " | " \}$ and $w _ { n } = 1$ otherwise. That is, we mask out the separator tokens $( \star ,$ "|") and predict parameter $\bar { \mathbf { x } }$ and function tokens $\bar { y }$ only. Note that $\bar { h } ^ { ( n ) }$ denotes the $n$ -th token, that is the $n$ -th element of the list in Equation (2), and $\bar { h } ^ { ( 1 : n - 1 ) }$ denotes all tokens up to the $( n - 1 )$ -th token. Further details and data augmentations are provided in Appendix D.2.
+
+# 4.3 Inference and decoding
+
+Parameter prediction: To decode the predicted parameter token $\bar { x } _ { t } ^ { ( d ) }$ back to its original parameter range, we truncate the output distribution to the vocabulary range corresponding to valid parameter values $[ 0 , Q )$ and reverse our tokenization procedure in Section 4.1. For a DOUBLE or INTEGER parameter $x$ , we use a piecewise constant distribution:
+
+$$
+p _ { \theta } ( x | \ldots ) = Q \cdot P _ { \theta } ( \bar { x } | \ldots ) / ( x _ { \mathrm { m a x } } - x _ { \mathrm { m i n } } ) , \mathrm { ~ i f ~ } x \in [ x _ { \mathrm { m i n } } , x _ { \mathrm { m a x } } ] , \mathrm { ~ o t h e r w i s e ~ } 0 .
+$$
+
+For all other parameter types, $\bar { x }$ corresponds to the index of the set of feasible values. Putting these together, we may now sample parameter $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ from the model’s prior distribution and thus define an HPO policy:
+
+$$
+\pi _ { \mathrm { p r i o r } } ( \pmb { x } _ { t } | m , \pmb { h } _ { t - 1 } ) = \prod _ { d = 1 } ^ { D } p _ { \theta } ( x _ { t } ^ { ( d ) } | m , \pmb { h } _ { t - 1 } , x _ { t } ^ { ( 1 : d - 1 ) } ) .
+$$
+
+As we use a supervised learning loss, we expect $\pi _ { \mathrm { p r i o r } }$ to approximate the behavior policy $\pi _ { b }$
+
+Note that traditional BO algorithms require running Bayesian inference and then conducting a global search in the hyperparameter space with an acquisition function. Thus the runtime complexity of making one hyperparameter suggestion is cubic in $t$ for a typical GP-based BO method that performs ARD each iteration [45]. In contrast, generating one suggestion by the OPTFORMER consists of decoding $D$ parameter tokens with an input sequence of $( D + 3 ) t$ tokens, which are then parsed into the $D$ parameter values, producing a runtime of $\mathcal { O } ( D ^ { 2 } t )$ linear in $t$ , with proper caching.
+
+Function prediction: To decode the real-valued function $y _ { t }$ from the discrete distribution $P _ { \theta } ( \bar { y } _ { t } | \bar { m } , \bar { h } _ { t - 1 } , \bar { x } _ { t } )$ , we construct the same piecewise constant distribution as in Eq. (4) with the range $[ y _ { \mathrm { m i n } } , y _ { \mathrm { m a x } } ]$ used in tokenization. Note that the limited support of $y$ will not be a concern for HPO when either the range is known or we set the range large enough compared to observed values. For more general use as a few-shot function prediction model, one could consider adopting the Riemann Distribution in [40], which supports an unbounded range.
+
+Augmented HPO policies with function prediction: At best, the learned policy $\pi _ { \mathrm { p r i o r } }$ can only perform as well as the original policy $\pi _ { b }$ when using behavioral cloning. However, we can take advantage of the model’s simultaneous function prediction ability to improve the policy with modelbased planning or offline RL techniques. While a comprehensive study of policy improvements for Transformers is out of the scope of this work, we consider here a simple yet effective policy improvement operator: sampling $M = 1 0 0$ candidate suggestions from $\pi _ { \mathrm { p r i o r } }$ and choosing the suggestion with the highest score defined by an acquisition function $u ( \cdot )$ as follows:
+
+$$
+\pi _ { u } ( \pmb { x } _ { t } | m , \pmb { h } _ { t - 1 } ) = \operatorname * { a r g m a x } _ { \{ \pmb { x } ^ { ( i ) } \} _ { i = 1 } ^ { M } } u ( p _ { \theta } ( \cdot | m , \pmb { h } _ { t - 1 } , \pmb { x } ^ { ( i ) } ) ) , \ \mathrm { w i t h } \ \pmb { x } ^ { ( i ) } \overset { \mathrm { i . i . d . } } { \sim } \pi _ { \mathrm { p r i o r } } ( \pmb { x } | m , \pmb { h } _ { t - 1 } ) .
+$$
+
+Common acquisition functions include Expected Improvement (EI), Probability of Improvement (PI), Upper Confidence Bound (UCB), and Thompson Sampling, see for example [46]. At a high level, this approach to combining imitated policies with function prediction is reminiscent of the idea behind the offline RL approach of BCQ [47].
+
+Because we apply a linear mapping from the original $y$ value to the quantized value $\bar { y }$ before discretization, we can simply define the acquisition functions on the discrete distribution $P _ { \theta } \big ( \bar { y } | \bar { m } , \bar { h } _ { t - 1 } , \bar { x } _ { t } \big )$ as follows:
+
+$$
+\begin{array} { r l } & { \displaystyle \boldsymbol { u } _ { \mathrm { E I } } ( \boldsymbol { x } | \bar { \boldsymbol { y } } ^ { * } ) = \mathbb { E } _ { P _ { \boldsymbol { \theta } } ( \bar { \boldsymbol { y } } | \boldsymbol { m } , \boldsymbol { h } _ { t - 1 } , \boldsymbol { x } ) } \left[ \operatorname* { m a x } ( \bar { \boldsymbol { y } } - \bar { \boldsymbol { y } } ^ { * } , 0 ) \right] , } \\ & { \displaystyle \boldsymbol { u } _ { \mathrm { U C B } } ( \boldsymbol { x } | \alpha ) = \mathrm { Q u a n t i l e } ( P _ { \boldsymbol { \theta } } ( \bar { \boldsymbol { y } } | \boldsymbol { m } , \boldsymbol { h } _ { t - 1 } , \boldsymbol { x } _ { t } ) , \alpha ) , } \\ & { \displaystyle \boldsymbol { u } _ { \mathrm { P I } } ( \boldsymbol { x } | \bar { \boldsymbol { y } } ^ { * } ) = \sum _ { \bar { \boldsymbol { y } } > \bar { \boldsymbol { y } } ^ { * } } P _ { \boldsymbol { \theta } } ( \bar { \boldsymbol { y } } | \boldsymbol { m } , \boldsymbol { h } _ { t - 1 } , \boldsymbol { x } ) , } \\ & { \displaystyle \boldsymbol { u } _ { \mathrm { T S } } ( \boldsymbol { x } ) = \bar { \boldsymbol { y } } , \mathrm { ~ w i t h ~ } \bar { \boldsymbol { y } } \sim P _ { \boldsymbol { \theta } } ( \bar { \boldsymbol { y } } | \boldsymbol { m } , \boldsymbol { h } _ { t - 1 } , \boldsymbol { x } _ { t } ) , } \end{array}
+$$
+
+where $\bar { y } ^ { * } = \operatorname* { m a x } _ { \tau \leq t - 1 } \bar { y } _ { \tau }$ in EI and PI is the threshold to measure improvement. We define the UCB acquisition function with a quantile parameter $\alpha$ . Our TS acquisition is defined as a sampled function value at a given location from the marginal predictive distribution. It is inspired by the traditional Thompson Sampling method [45] but different in that the correlation between different locations is ignored.
+
+# 5 Data
+
+Training the OPTFORMER requires HPO studies with optimization trajectories. The most natural dataset we possess is the entire Google Vizier [2] database, one of the world’s largest collections of real world hyperparameter tuning studies, which we denote as RealWorldData. There are around 750K studies, each with on average 300 trials, covering a vast class of production and machine learning applications at Google, ranging from vision, speech, NLP and robotics, and representing one of the most representative distributions of HPO tasks for machine learning models in practice. These studies were generated with a mixture of non-adaptive, evolutionary, and BO algorithms. However, as the dataset does not contain sufficient algorithm information, we have to treat the corresponding behavior policy as a randomly mixed algorithm $\pi _ { b }$ .
+
+In addition, we create two new datasets based on public benchmarks. HPO-B is the largest public benchmark for HPO containing about 1.9K tuning tasks, most of which use one of 16 shared search spaces. In the continuous evaluation setting, it fits an XGBoost model to the trial data of every tuning task as the objective function. For further control over specific function dimensions and properties, we use the blackbox optimization benchmark BBOB [48], consisting of 24 types of synthetic functions with customizable properties (dimension sizes, rotations, shifts, discretizations, noise types) we randomize over.
+
+For each of the two public benchmarks (HPO-B and BBOB), we apply a fixed set of 7 HPO algorithms to generate a dataset of optimization trajectories. In contrast to RealWorldData, we specify the algorithm name in the metadata $m$ as part of the conditioning input for our model. The controlled algorithms used are: (1) Grid Search, (2) Shuffled Grid Search, (3) Random Search, (4) Regularized Evolution [49], (5) Hill-Climbing, (6) Eagle Strategy [50], and (7) Vizier’s GP-UCB [2]. Appendix B contains detailed explanations of the algorithms.
+
+Table 3: Offline training datasets considered in this study. More details are given in Appendix C along with examples of studies in Table 5.
+
+| Method | Pretraining Dataset (Size) | EC | GO | Fold Classification | Reaction |
| BP | MF | CC | Fold | Super. | Fam. | Avg. |
| ResNet (Rao et al.,2019) | CNN (Shanehsazzadeh et al., 2020) | 0.545 | 0.244 | 0.354 | 0.287 | 11.3 | 13.4 7.21 | 53.4 | 26.0 | 51.7 24.1 |
| LSTM (Rao et al.,2019) | | 0.605 | 0.280 0.225 | 0.405 0.321 | 0.304 0.283 | 10.1 6.41 | 4.33 | 23.5 | 13.6 9.61 | 11.0 |
| | 0.425 | | | | | | 18.1 | | 26.6 |
| Transformer (Rao et al.,2019) | | 0.238 | 0.264 | 0.211 | 0.405 | 9.22 | 8.81 | 40.4 | 19.4 | |
| GCN (Kipf &Welling,2017) | | 0.320 | 0.252 | 0.195 | 0.329 | 16.8* | 21.3* | 82.8* | 40.3* | 67.3* |
| GAT (Velickovic et al.,2018) | | 0.368 | 0.284 | 0.317† | 0.385 | 12.4 | 16.5 | 72.7 | 33.8 | 55.6 |
| GVP (Jing et al.,2021) | | 0.489 | 0.326 | 0.426 | 0.420+ | 16.0 | 22.5 | 83.8 | 40.7 | 65.5 |
| 3DCNN_MQA (Derevyanko et al.,2018) | | 0.077 | 0.240 | 0.147 | 0.305 | 31.6* | 45.4* | 92.5* | 56.5* | 72.2* |
| GraphQA (Baldassarre et al.,2021) New IEConv (Hermosilla & Ropinski,2022) | | 0.509 | 0.308 | 0.329 | 0.413 | 23.7* | 32.5* | 84.4* | 46.9* | 60.8* |
| | 0.735 | 0.374 | 0.544 | 0.444 | 47.6* | 70.2* | 99.2* | 72.3* | 87.2* |
| GearNet | | 0.730 | 0.356 | 0.503 | 0.414 | 28.4 | 42.6 | 95.3 | 55.4 | 79.4 |
| GearNet-IEConv | | 0.800 | 0.381 | 0.563 | 0.422 | 42.3 | 64.1 | 99.1 | 68.5 | 83.7 |
| GearNet-Edge GearNet-Edge-IEConv | | 0.810 | 0.403 | 0.580 | 0.450 | 44.0 | 66.7 | 99.1 | 69.9 | 86.6 |
| DeepFRI (Gligorijevic et al.,2021) | | 0.810 | 0.400 | 0.581 | 0.430 | 48.3 | 70.3 | 99.5 | 72.7 | 85.3 |
| Pfam (10M) | 0.631 | 0.399 | 0.465 | 0.460 | 15.3* | 20.6* | 73.2* | 36.4* | 63.3* |
| ESM-1b (Rives etal.,2021) ProtBERT-BFD (Elnaggar et al.,2021) | UniRef50 (24M) | 0.864 | 0.452 | 0.657 | 0.477 | 26.8 | 60.1 | 97.8 | 61.5 | 83.1 |
| BFD (2.1B) | 0.838 | 0.279† | 0.456 | 0.408† | 26.6* | 55.8* | 97.6* | 60.0* | 72.2* |
| LM-GVP (Wang et al.,2022b) New IEConv (Hermosilla & Ropinski,2022) | UniRef100 (216M) | 0.664 | 0.417+ | 0.545 | 0.527 | = | | = | = | |
| PDB (476K) | - | = | - | = | 50.3* | 80.6* | 99.7* | 76.9* | 87.6* |
| Residue Type Prediction | AlphaFoldDB (805K) | 0.843 | 0.430 | 0.604 | 0.465 | 48.8 | 71.0 | 99.4 | 73.0 | 86.6 |
| Distance Prediction | AlphaFoldDB (805K) | 0.839 | 0.448 | 0.616 | 0.464 | 50.9 | 73.5 | 99.4 | 74.6 | 87.5 |
| Angle Prediction | AlphaFoldDB (805K) | 0.853 | 0.458 | 0.625 | 0.473 | 56.5 | 76.3 | 99.6 | 77.4 | 86.8 |
| Dihedral Prediction | AlphaFoldDB (805K) | 0.859 | 0.458 | 0.626 | 0.465 | 51.8 | 77.8 | 99.6 | 75.9 | 87.0 |
| Multiview Contrast | AlphaFoldDB (805K) | 0.874 | 0.490 | 0.654 | 0.488 | 54.1 | 80.5 | 99.9 | 78.1 | 87.5 |
+
+2021), ESM-1b (Rives et al., 2021)) and two models combining pretrained sequence-based encoders with structural information (DeepFRI (Gligorijevic et al., 2021) and LM-GVP (Wang et al., 2022b)). ´ For LM-GVP and New IEConv, we only include results reported in the original paper due to the computational burden and the lack of codes. We do not include MSA-based baselines, since these evolution-based methods require a lot of resources for the computation and storage of MSAs but have been shown to be inferior to ESM-1b on function prediction tasks in Hu et al. (2022).
+
+Training. On the four downstream tasks, we train GearNet and GearNet-Edge from scratch. As we find that the IEConv layer is important for predicting fold labels, we also enhance our model by incorporating this as an additional layer (see Appendix C.2). These models are referred as GearNetIEConv and GearNet-Edge-IEConv, respectively. Following Wang et al. (2022b) and Hermosilla & Ropinski (2022), the models are trained for 200 epochs on EC and GO prediction and for 300 epochs on fold and reaction classification. For pretraining, the models with the best performance when trained from scratch are selected, i.e., GearNet-Edge for EC, GO, Reaction and GearNet-Edge-IEConv for Fold Classification. The models are pretrained on the AlphaFold database with our proposed five methods for 50 epochs. All these models are trained on 4 Tesla A100 GPUs (see Appendix E.3).
+
+Evaluation. For EC and GO prediction, we evaluate the performance with the protein-centric maximum F-score $\mathrm { F } _ { \mathrm { m a x } }$ , which is commonly used in the CAFA challenges (Radivojac et al., 2013) (See Appendix E.2 for details). For fold and reaction classification, the performance is measured with the mean accuracy. Models with the best performance on validation sets are selected for evaluation.
+
+# 5.2 RESULTS
+
+We report results for four downstream tasks in Table 2, including all models with and without pretraining. The following conclusions can be drawn from the results:
+
+Our structure-based encoders outperform all baselines without pretraining on 7 of 8 datasets. By comparing the first three blocks, we find that GearNet can obtain competitive results against other baselines on three function prediction tasks (EC, GO, Reaction). After adding the edge message passing mechanism, GearNet-Edge significantly outperforms other baselines on EC, GO-BP and GO-MF and is competitive on GO-CC. Although no clear improvements are observed on function prediction (EC, GO, Reaction) by adding IEConv layers, GearNet-Edge-IEConv achieve the best results on fold classification. This can be understood since fold classification requires the encoder to capture sufficient structural information for determining the fold labels. Compared with GearNet
+
+Edge, which only includes the distance and angle information as features, the IEConv layer is better at capturing structural details by applying different kernel matrices dependent on relative positional features. These strong performance demonstrates the advantages of our structure-based encoders.
+
+Structure-based encoders benefit a lot from pretraining with unlabeled structures. Comparing the results in the third and last two blocks, it can be observed that models with all proposed pretraining methods show large improvements over models trained from scratch. Among these methods, Multiview Contrast is the best on 7 of 8 datasets and achieve the state-of-the-art results on EC, GO-BP, GO-MF, Fold and Reaction tasks. This proves the effectiveness of our pretraining strategies.
+
+Pretrained structure-based encoders perform on par with or even better than sequence-based encoders pretrained with much more data. The last three blocks show the comparision between pretrained sequence-based and structure-based models. It should be noted that our models are pretrained on a dataset with fewer than one million structures, whereas all sequence-based pretraining baselines are pretrained on million- or billion-scale sequence databases. Though pretrained with an order of magnitude less data, our model can achieve comparable or even better results against these sequence-based models. Besides, our model is the only one that can achieve good performance on all four tasks, given that sequence-based models do not perform well on fold classification. This again shows the potential of structure-based pretraining for learning protein representations.
+
+# 5.3 ABLATION STUDIES
+
+| Method | EC | GO-BP | GO-MF | GO-CC |
| CNN | 0.366/0.361/0.372/0.429/0.545 | 0.197/0.195/0.197/0.211/0.244 | 0.238/0.243/0.256/0.292/0.354 | 0.258/0.257/0.260/0.263/0.387 |
| ResNet | 0.409/0.412/0.450/0.526/0.605 | 0.230/0.230/0.234/0.249/0.280 | 0.282/0.288/0.308/0.347/0.405 | 0.277/0.273/0.280/0.278/0.304 |
| LSTM | 0.247/0.249/0.270/0.333/0.425 | 0.194/0.192/0.195/0.205/0.225 | 0.223/0.229/0.245/0.276/0.321 | 0.263/0.264/0.269/0.270/0.283 |
| Transformer | 0.167/0.173/0.175/0.197/0.238 | 0.267/0.265/0.262/0.262/0.264 | 0.184/0.187/0.195/0.204/0.211 | 0.378/0.382/0.388/0.395/0.405 |
| GCN | 0.245/0.246/0.246/0.280 /0.320 | 0.251/0.250/0.248/0.248/0.252 | 0.180/0.183/0.187/0.194/0.195 | 0.318/0.318/0.320/0.323/0.329 |
| GearNet | 0.557 /0.570/0.615/0.693/0.730 | 0.309/0.309/0.315/0.336/0.356 | 0.382/0.397 /0.425/0.474/0.503 | 0.381/0.385/0.393 /0.398/0.414 |
| GearNet-edge | 0.625/0.646/0.694/0.757/0.810 | 0.345/0.347/0.354/0.378/0.403 | 0.444/0.461/0.490 /0.537/0.580 | 0.394/0.394/0.401/0.408/0.450 |
| DeepFRI | 0.470 /0.505 /0.545/0.600 /0.631 | 0.361/0.362/0.371/0.391/0.399 | 0.374/0.383 /0.409 /0.446/0.465 | 0.440/0.441/0.444/0.451/ 0.460 |
| ESM-1b | 0.737/0.764/0.797/0.839 /0.864 | 0.394/0.399/0.407/0.429/0.452 | 0.546/0.562/0.588/0.625/0.657 | 0.462/0.465/0.468/0.465/0.477 |
| Multiview Contrast | 0.744/0.769/0.808/0.848/0.874 | 0.436/0.442/0.449/0.471/0.490 | 0.533/0.548/0.573/0.612/0.654 | 0.459/0.460/0.467/0.469/0.488 |
+
+2021), before GVP to additionally utilize protein sequence representations. We also adopt this hybrid model as one of our baselines, and its implementation follows the official source code.
+
+Our methods. For pretraining, we use Adam optimizer with learning rate 0.001 and train a model for 50 epochs. Then, the pretrained model will be finetuned on downstream datasets.
+
+For Multiview Contrast, we set the cropping length of subsequence operation as 50, the radius of subspace operation as 15, the mask rate of random edge masking operation as 0.15. The temperature $\tau$ in the InfoNCE loss function is set as 0.07. When pretraining GearNet-Edge and GearNet-EdgeIEConv, we use 96 and 24 as batch sizes, respectively.
+
+For Distance Prediction, we set the number of sampled residue pairs as 256. The batch size will be set as 128 and 32 for GearNet-Edge and GearNet-Edge-IEConv, respectively. For Residue Type, Angle and Dihedral Prediction, we set the number of sampled residues, residue triplets and residue quadrants as 512. The batch size will be set as 96 and 32 for GearNet-Edge and GearNet-Edge-IEConv, respectively.
+
+For downstream evaluation, the hidden representations in each layer of GearNet will be concatenated for the final prediction. Table 5 lists the hyperparameter configurations for different downstream tasks. For the four tasks, we use the same optimizer and number of epochs as in the original papers to make fair comparison. For EC and GO prediction, we use ReduceLROnPlateau scheduler with factor 0.6 and patience 5, while we use StepLR scheduler with step size 50 and gamma 0.5 for fold and reaction classification.
+
+# F ADDITIONAL EXPERIMENTAL RESULTS ON EC AND GO PREDICTION
+
+Results under different sequence identity cutoffs. Besides the experiments in Section 5, where $9 5 \%$ is used as the sequence identity cutoff for EC and GO dataset splitting, we also test our models and several important baselines under four lower sequence identity cutoffs and show the experimental results in Table 6. The aim of this experiment is to test the robustness of different models under different hold-out test sets, with lowering cutoff indicating lower similarity between training and test sets. It can be observed that, at lower cutoffs, our model can still achieve the best performance among models without pretraining and get comparable or better results against ESM-1b after pretraining.
+
+Table 7: AUPR on EC and GO prediction. [†] denotes results taken from Wang et al. (2022b). For pretraining, we select the model with the best performance when training from scratch, i.e., GearNet-Edge. We omit the model name and use pretraining methods to name our pretrained models.
+
+| Method | Pretraining Dataset (Size) | EC | GO |
| BP | MF | CC |
| CNN (Shanehsazzadeh et al., 2020) | | 0.526 | 0.159 | 0.351 | 0.204 |
| ResNet (Rao et al.,2019) | | 0.590 | 0.205 | 0.434 | 0.214 |
| LSTM (Rao et al., 2019) | | 0.414 | 0.156 | 0.334 | 0.192 |
| Transformer (Rao et al.,2019) | | 0.218 | 0.156 | 0.177 | 0.210 |
| Wfrienirecnn GCN (Kipf & Welling,2017) | | 0.319 | 0.136 | 0.147 | 0.175 |
| GAT (Velickovic et al.,2018) | | 0.320 | 0.171 | 0.329† | 0.249† |
| GVP (Jing et al.,2021) | | 0.482 | 0.224 | 0.458† | 0.279† |
| 3DCNN_MQA (Derevyanko et al.,2018) | | 0.029 | 0.132 | 0.075 | 0.144 |
| GraphQA (Baldassarre et al.,2021) | | 0.543 | 0.199 | 0.347 | 0.265 |
| New IEConv (Hermosilla & Ropinski,2022) | | 0.775 | 0.273 | 0.572 | 0.316 |
| GearNet | | 0.751 | 0.211 | 0.490 | 0.276 |
| GearNet-IEConv | | 0.835 | 0.231 | 0.547 | 0.259 |
| GearNet-Edge | | 0.835 | 0.251 | 0.570 | 0.303 |
| GearNet-Edge-IEConv | | 0.843 | 0.244 | 0.561 | 0.284 |
| DeepFRI(Gligorijevic et al.,2021) | Pfam (10M) | 0.547 | 0.282 | 0.462 | 0.363 |
| ESM-1b (Rives et al.,2021) Wreaed n | UniRef50 (24M) | 0.889 | 0.332 | 0.639 | 0.324 |
| ProtBERT-BFD (Elnaggar et al.,2021) | BFD (2.1B) | 0.859 | 0.188 | 0.464† | 0.234 |
| LM-GVP (Wang et al., 2022b) | UniRef100 (216M) | 0.710 | 0.302† | 0.580 | 0.423† |
| Residue Type Prediction | AlphaFoldDB (805K) | 0.870 | 0.267 | 0.583 | 0.311 |
| Distance Prediction | AlphaFoldDB (805K) | 0.863 | 0.274 | 0.586 | 0.327 |
| Angle Prediction | AlphaFoldDB (805K) | 0.880 | 0.291 | 0.603 | 0.331 |
| Dihedral Prediction | AlphaFoldDB (805K) | 0.881 | 0.304 | 0.603 | 0.338 |
| Multiview Contrast | AlphaFoldDB (805K) | 0.892 | 0.292 | 0.596 | 0.336 |
+
+AUPR on EC and GO prediction. We have reported experimental results on EC and GO prediction with $\mathrm { F } _ { \mathrm { m a x } }$ as the metric in Section 5. Here we report another popular metric AUPR in Table 7. Note that we still use the best model selected by $\mathrm { F } _ { \mathrm { m a x } }$ on validation sets. It can be observed that our model can still achieve the best performance on EC prediction in both from scratch and pretrained settings. However, there are still non-trivial gaps between our models with the state-of-the-art results. This probably is because of the inconsistency between the two evaluation metrics. It would be interesting to study the relationship between these two metrics and develop a model good at both in future works.
+
+Sampling schemes in self-prediction methods. Different sampling schemes may lead to different results for self-prediction methods. We study the effects of sampling schemes using Dihedral Prediction as an example. Instead of sampling dihedral angles formed by three consecutive edges, we try to predict the dihedrals formed by four randomly sampled nodes. We observe that the $\mathrm { F } _ { \mathrm { m a x } }$ decreases from 0.859 to 0.821. This suggests that it is better of learning residue representations to capture local spatial information instead of global information. The change of sampling schemes will make self-prediction tasks more difficult to solve, which even brings negative effects after pretraining.
+
+Pretraining on different datasets. We use the AlphaFold protein structure database as our pretraining database, because it contains the largest number of protein structures and is planned to cover over 100 million proteins. However, the structures in this database are not experimentally determined but predicted by AlphaFold2. Therefore, it is interesting to see the performance of our methods when pretraining on different datasets.
+
+To study the effects of the choice of pretraining dataset, we build another dataset using structures extracted from Protein Data Bank (PDB) (Berman et al., 2000). Specifically, we extract 123,505 experimentally-determined protein structures from PDB whose resolutions are between 0.0 and 2.5 angstroms, and we further extract 305,265 chains from these proteins to construct the final dataset.
+
+Next, we pretrain our five methods on AlphaFold Database v1 (proteome-wide structure predictions), AlphaFold Database v2 (Swiss-Prot structure predictions) and Protein Data Bank and then evaluate the pretrained models on the EC prediction task. The results are reported in Table 8. As can be seen in the table, our methods can achieve comparable performance on different pretraining datasets. Consequently, our methods are robust to the choice of pretraining datasets.
+
+Table 8: Results of GearNet-Edge pretrained on different pretraining datasets with different methods. Models are evaluated on the EC prediction task.
+
+| Randomly initialize policyπ(Φ),an empty level buffer Λof size K,and belief model B(st|T). while not converged do Sample replay-decision Bernoulli,d~ PD(d) |
| if d=O or|A|=O then |
| Sample level θ from level generator |
| Collect π's trajectory T on θ, with a stop-gradient Φ⊥ |
| Use observed ground-truth states to update B |
| else |
| Use PLR to sample a replay level from the level store,θ ~ Λ |
| Collect fictitious trajectory T' on 0,based on s't ~ B |
| Update π with rewards R(T') |
|
| end |
| Compute PLR score, S = score(T',π) |
| Update Λ with θ using score S end |
+
+AOH of the student. Figure 2 summarizes this transition mechanism. Here, the belief model $\boldsymbol { B } ( \boldsymbol { s } _ { t } | \tau )$ can be expressed as
+
+$$
+B ( s _ { t } | \tau ) = \sum _ { \theta ^ { \prime } } \overline { { P } } ( s _ { t } | \tau , \theta ^ { \prime } ) \overline { { P } } ( \theta ^ { \prime } | \tau ) .
+$$
+
+This shows that, assuming blackbox simulator access, we can generally implement $\boldsymbol { B }$ as follows: Periwith $\theta ^ { \prime } \sim \overline { { P } } ( \theta ^ { \prime } )$ ring training, . We use these $\{ ( \theta _ { k } ^ { \prime } , \tau _ { k } ) \} _ { k = 1 } ^ { N }$ $N$ trajectories, such that each is gepairs to update a posterior model ${ \overline { { P } } } ( \theta ^ { \prime } | \tau )$ under a level that predicts the underlying $\theta ^ { \prime }$ given $\tau$ . We can then sample from by first sampling $\theta \sim \overline { { P } } ( \theta ^ { \prime } | \tau )$ , followed by stepping forward a parallel simulator that has been initially reset to the current AOH $\tau$ , with fixed $\Theta ^ { \prime } = \theta ^ { \prime }$ , thereby yielding a desired sample of $s _ { t }$ according to $\boldsymbol { B }$ .
+
+In practice, it is often the case that $\theta ^ { \prime }$ can be uniquely identified by some revelatory event by time $t$ , so that $\overline { { { \cal P } } } ( \theta ^ { \prime } | \tau ) = 1$ for some $\theta ^ { \prime }$ and $\tau$ , and $\overline { { P } } ( s _ { t } | \tau , \mathbf { \dot { \theta } } ^ { \prime } ) = \overline { { P } } ( s _ { t } | \check { \tau } )$ otherwise. In this case, we can implement the fictitious transition by setting $\theta ^ { \prime } \sim \overline { { P } } ( \theta ^ { \prime } )$ at the start of each episode; subsequent transitions will then be consistent with $\boldsymbol { B }$ . For example, in the fruit choice example, whether apple or banana was the right goal is deterministically revealed by the final reward, and otherwise, does not impact transition dynamics. Additionally, we often only have limited access to $\overline { { P } } ( \theta )$ throughout training, for example, if sampling ${ \overline { { P } } } ( \theta )$ is costly. In this case, we can learn an estimate $\hat { P } ( \theta ^ { \prime } )$ using the samples we do collect from ${ \overline { { P } } } ( \theta )$ , which can occur online. We then use $\hat { P } ( \theta ^ { \prime } )$ in sampling fictitious transitions during UED. We refer to the resulting $\hat { P } ( \theta ^ { \prime } )$ as a learned belief prior.
+
+SAMPLR, summarized in Algorithm 1, incorporates this fictitious transition by replacing the advantages of trajectories on replay levels sampled by $\mathrm { P L R ^ { \perp } }$ with their fictitious counterparts, as only these trajectories are used by $\mathrm { P L R ^ { \perp } }$ for training. To reduce the cost of sampling $\overline { { { \cal P } } } ( \theta ^ { \prime } )$ , we can use the new levels regularly sampled by $\mathrm { P L R ^ { \perp } }$ to estimate the learned belief prior $\overline { { P } } ( \theta ^ { \prime } )$ , and use $\overline { { P } } ( \theta ^ { \prime } )$ in sampling fictitious transitions on replay levels.
+
+# 6 GROUNDED POLICIES ARE ROBUSTLY BAYES OPTIMAL
+
+We can view OBL-based correction as a method for training a policy to be optimal with respect to the ground-truth value function, with levels sampled from some generating distribution $\Lambda$ defined as:
+
+$$
+\overline { { { V } } } ^ { \Lambda } ( \pi ) = \mathbb { E } _ { \tau \sim { \mathcal { M } } ^ { \Lambda } ( \pi ) } \left[ \overline { { { V } } } ^ { \pi } ( \tau ) \right] .
+$$
+
+Note that when $\Lambda = \overline { { { \cal P } } } ( \theta )$ this reduces to the ground-truth value function notated simply as $\overline { { V } } ( \pi )$ . First, we will note that, for any UED method, our OBL-based correction will ensure that, in equilibrium, the resulting policy is Bayes-optimal on the ground truth beliefs, on any trajectory sampled from $\mathcal { M } ^ { \Lambda } ( \pi )$ , the distribution of trajectories of $\pi$ in levels sampled from $\Lambda$ .
+
+Remark 1. If π is optimal with respect to the grounded value function $\overline { { V } } ^ { \Lambda } ( \pi )$ then it is Bayes optimal with respect to the ground-truth parameter distribution ${ \overline { { P } } } ( \theta )$ on the support of $\mathcal { M } ^ { \Lambda } ( \pi )$ .
+
+Proof. By definition we have that $\pi \in \underset { \pi \in \Pi } { \arg \operatorname* { m a x } } \{ \overline { { V } } ^ { \Lambda } ( \pi ) \} = \underset { \pi \in \Pi } { \arg \operatorname* { m a x } } \big \{ \mathbb { E } _ { \tau \sim \mathcal { M } ^ { \Lambda } ( \pi ) } \left[ \overline { { V } } ^ { \pi } ( \tau ) \right] \big \}$ . Since $\pi$ can condition on the initial trajectory $\tau$ , the action selected after each trajectory can be independently optimized. Thus we have, for all $\tau \in \mathcal { M } ^ { \Lambda } ( \pi )$ , $\pi \in \arg \operatorname* { m a x } _ { \pi \in \Pi } \{ { \overline { { V } } } ^ { \pi } ( \tau ) \}$ implying that $\pi$ is the optimal grounded policy and V π = V ∗.
+
+Thus, assuming the base RL algorithm finds Bayes optimal policies, a UED method that optimizes the grounded value function, as done by SAMPLR, will result in Bayes optimal performance over the ground-truth distribution. When the UED method aims to maximize worst-case regret, we can prove an even stronger property we call robust $\epsilon$ -Bayes optimality.
+
+Let $\overline { { V } } ^ { \theta } ( \pi )$ be the value function for $\pi$ evaluated on a specific level $\theta$ . We will say that a policy is robustly $\epsilon$ -Bayes optimal iff for all $\theta$ in the domain of ${ \overline { { P } } } ( \theta )$ and for all $\pi ^ { \prime }$ we have
+
+$$
+\overline { { { V } } } ^ { \theta } ( \pi ) \geq \overline { { { V } } } ^ { \theta } ( \pi ^ { \prime } ) - \epsilon .
+$$
+
+Note how this differs from being only $\epsilon$ -Bayes optimal, which means for all $\pi ^ { \prime }$ ,
+
+$$
+\overline { { { V } } } ( \pi ) \geq \overline { { { V } } } ( \pi ^ { \prime } ) - \epsilon
+$$
+
+With robust $\epsilon$ -Bayes optimality, we must be $\epsilon$ -optimal even on levels which are rarely sampled from the ground-truth distribution. We will show that if SAMPLR is in an $\epsilon$ -Nash Equilibrium, then a policy is robustly $\epsilon$ -Bayes optimal with respect to the grounded value function $\overline { { { V } } } ( \dot { \pi } )$ rather than only $\epsilon$ -Bayes optimal as one would expect from training directly on the true distribution of levels.
+
+Theorem 1. If $\pi$ is $\epsilon$ -Bayes optimal by $\overline { { V } } ^ { \Lambda } ( \pi )$ for $\Lambda$ minimizing worst-case regret as is done in SAMPLR, then it is robustly $\epsilon$ -Bayes optimal with respect to the grounded value function, $\overline { { V } } ( \pi )$ .
+
+Proof. Let $\pi$ be $\epsilon$ -optimal with respect to $\overline { { V } } ^ { \Lambda } ( \pi )$ where $\Lambda$ minimizing worst-case regret with respect to $\pi$ . Let $\overline { { \pi } } ^ { * }$ be an optimal grounded policy, and let $\theta$ be arbitrary. Then we have:
+
+$$
+\overline { { { V } } } ^ { \theta } ( \overline { { { \pi } } } ^ { * } ) - \overline { { { V } } } ^ { \theta } ( \pi ) \le \overline { { { V } } } ^ { \Lambda } ( \overline { { { \pi } } } ^ { * } ) - \overline { { { V } } } ^ { \Lambda } ( \pi ) \le \epsilon
+$$
+
+Where the first inequality follows from $\Lambda$ minimizing worst-case regret with respect to $\pi$ , and the second follows from $\pi$ being $\epsilon$ -optimal on $\Lambda$ . Rearranging terms gives the desired condition. □
+
+# 7 EXPERIMENTS
+
+We investigate the performance of SAMPLR with respect to the the standard PLR and domain randomization in environments based on MiniHack (Samvelyan et al., 2021), a library for creating custom environments based on the runtime of the NetHack Learning Environment (NLE) (Küttler et al., 2020). Acting optimally in our environments requires grounding to the ground-truth distribution.
+
+Our agents are trained using PPO (Schulman et al., 2017), using the best hyperparameters found via grid search, and use the policy architecture in Küttler et al. (2020). We tune the PLR-specific hyperparameters shared among $\mathrm { \dot { P L } } \mathrm { \mathbf { R } } ^ { \perp }$ and SAMPLR variants for each environment, based on the performance of $\mathrm { \bf P } \mathrm { \bf L } { \bf R } ^ { \perp }$ . Full details of our environments, agent architecture, and hyperparameters are provided in Appendix A, and our SAMPLR implementation, in Appendix B. We compare both standard SAMPLR and a variant called LP-SAMPLR that learns a belief prior over the true goal, against $\mathrm { P L R ^ { \perp } }$ and standard PPO baselines. These baselines allows us to separate the relative changes in performance metrics due to curriculum learning and our proposed correction for CICS.
+
+
+Figure 4: Episodic returns (left) and number of rooms in solved levels (middle) during training (dotted lines) and test on the ground-truth distribution (solid lines), for $q = 0 . 7$ . Normalized test returns and proportion of apple goals during training for various $q$ are shown on the right. Plots show mean and standard error of 10 runs.
+
+In our experiments, we first adapt the apple and banana example, depicted in Figure 3 into a fully procedurally-generated RL environment set in the world of NetHack. For each level, the agent can only learn to choose optimally in expectation at test time by grounding to the distribution of correct choices in the deployment domain. Specifically, in each level, the agent must traverse between one to eight randomly generated rooms, and in the final room, the agent must choose to eat the apple or the banana. The correct choice is fixed for each level, but indiscernible to the agent. Thus, the identity of the true goal acts as the aleatoric parameter. Figure 3 shows example levels from this environment.
+
+This environment presents a hard exploration challenge for standard RL algorithms, as it requires learning to both navigate multiple rooms, as well as the NLE-specific skills of kicking doors and eating. The doors opening into adjacent rooms are locked. In order to go from one room to the next, the agent must learn to, potentially repeatedly, kick the locked door until it opens. Likewise, upon reaching a piece of fruit in the final room, the agent must learn to deliberately choose to eat the fruit. If the right choice of fruit were determinable per episode, we expect $\mathrm { P L R ^ { \perp } }$ ’s adaptive curriculum to improve learning by selectively sampling levels at the threshold of the agent’s abilities.
+
+Let $\pi _ { A }$ be the policy in which the agent always chooses the apple, and $\pi _ { B }$ , the banana. If the probability of the goal being apple ${ \overline { { P } } } ( A ) = q$ , the expected return of the agent is $R _ { A } q$ under $\pi _ { A }$ and $R _ { B } ( 1 - q )$ under $\pi _ { B }$ . The optimal policy is then to act according to $\pi _ { A }$ when $q > R _ { B } / ( R _ { A } \bar { + } R _ { B } ) \bar { }$ , and according to $\pi _ { B }$ otherwise. We expect training under domain randomization, which samples each level completely at random from the ground-truth distribution ${ \overline { { P } } } ( \theta )$ , defined by the environment parameterization, would converge to the correct choice of $\pi _ { A }$ or $\pi _ { B }$ , assuming the environment is learnable by the choice of RL algorithm. In contrast, PLR evolves an adversarial curriculum, incentivizing PLR to shift the distribution over goals throughout training. For example, PLR is incentivized to flip the curriculum distribution to favor eating apples whenever the agent begins to consistently succeed at eating bananas. We thus expect the PLR curriculum to continually oscillate the preferred choice of goal.
+
+
+Figure 3: Levels from the stochastic fruit-choice environment. Across levels, the correct choice of fruit is distributed according to $\overline { { P } }$ .
+
+In our experiments, we set $R _ { A } = 3$ , $R _ { B } = 1 0$ , and $q$ in $\{ 0 . 7 , 0 . 5 , 0 . 3 \}$ , making it always optimal to follow the banana-eating policy $\pi _ { B }$ , but with the marginal benefit of doing so varying with $q$ . We report train and test performance of each agent over 200M training steps in Figure 4. We find that DR struggles to learn an effective policy, plateauing at an expected return under 1.0; PLR performs even worse, due to its adversarial curriculum shifting the distribution over the correct goal, leading to rapid oscillations in the optimal choice of fruit under the curriculum distribution, as visible in the high-variance oscillations in the proportion of apple goals selected by PLR for each value of $q$ in 4). This makes it difficult for the agent to settle on the optimal policy with respect to any ground-truth distribution. The proportion of each choice outcome, shown in Figure 5, reveals that both DR and PLR policies fail to eat any fruit most of the time, even after 200M training steps. In contrast, both SAMPLR and LP-SAMPLR realize a marked improvement in test performance by grounding PLR’s otherwise wild shifts in $q$ . Figure 4 shows this improvement is most pronounced when the expected difference in $\pi _ { A }$ and $\pi _ { B }$ is smaller, and therefore easier for PLR to flip the agent’s policy. Moreover, we see in Figure 5 that both SAMPLR methods present levels with higher room counts on average, indicating that early in training, it is able to discover easier, few-room levels in which the agent can capture reward signal, and which can then be made more complex to push the agent along its threshold of abilities.
+
+
+Figure 5: Left: Proportion of training episodes in which the agent fails to eat any fruit; eats the apple; or eats the banana. Right: Number of rooms in levels during training. Plots show mean and standard error of 10 runs.
+
+
+Figure 6: Left: Levels from FireDungeon. Middle: Test return on the ground-truth distribution of FireDungeon. Right: Proportion of training levels with fireproof armor. Plots show mean and standard error of 10 runs.
+
+We next turn to a more challenging environment that introduces additional NetHack-specific dynamics. The FireDungeon environment (see Figure 6 for example levels), requires the agent to navigate through up to 13 chambers, and ultimately choose between chamber A or B, each containing a valid goal. Reaching this goal ends the episode and provides the agent with a sparse reward. Further, in this penultimate chamber, there is an armor, which if worn grants the agent with fire resistance with probability $q$ . Chamber B is marked by a red gemstone by the door and contains enemy units, whose fire attack will instantly kill the agent. Killing each enemy grants the agent with $+ 1$ final reward, which is only provided upon reaching either goal. The agent thus stands to attain a higher reward by attacking the enemies in Chamber B, before reaching the goal, only if the armor is fireproof. This environment presents an even more difficult exploration problem for the agent, yet we see in Figure 6, both SAMPLR variants begin to learn to solve this environment with significantly greater sample-efficiency than DR, while PLR again struggles to learn. As in the case of the previous stochastic choice environment, we see that PLR rapidly oscillates the key aleatoric parameter, which in this case, determines whether the armor is fireproof.
+
+# 8 CONCLUSION
+
+Using the formal notions of environment parameterizations in the framework of UED, we defined the problem of curriculum-induced covariate shift in RL. Our definition highlights the issues that can arise when there is persisitent uncertainty over the environment parameters, either because the uncertainty is irreducible or because reducing the uncertainty is costly. We then adapted a fictitious transition mechanism previously used to improve zero-shot coordination in cooperative MARL to correct for this covariate shift. We demonstrated that our resulting algorithm, SAMPLR, avoids the pitfalls of this type of covariate shift, while preserving the benefits of curriculum learning.
+
+# REFERENCES
+
+Martín Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. CoRR, abs/1907.02893, 2019. URL http://arxiv.org/abs/1907.02893.
+
+Richard Bellman. A problem in the sequential design of experiments. Sankhya: The Indian Journal ¯ of Statistics (1933-1960), 16(3/4):221–229, 1956.
+
+Daniel S Bernstein, Robert Givan, Neil Immerman, and Shlomo Zilberstein. The complexity of decentralized control of markov decision processes. Mathematics of operations research, 27(4): 819–840, 2002.
+
+Steffen Bickel, Michael Brückner, and Tobias Scheffer. Discriminative learning under covariate shift. J. Mach. Learn. Res., 10:2137–2155, 2009. URL https://dl.acm.org/citation.cfm? id=1755858.
+
+Andres Campero, Roberta Raileanu, Heinrich Kuttler, Joshua B. Tenenbaum, Tim Rocktäschel, and Edward Grefenstette. Learning with AMIGo: Adversarially motivated intrinsic goals. In International Conference on Learning Representations, 2021.
+
+Kamil Andrzej Ciosek and Shimon Whiteson. OFFER: off-environment reinforcement learning. In Satinder P. Singh and Shaul Markovitch (eds.), Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pp. 1819–1825. AAAI Press, 2017. URL http://aaai.org/ocs/index.php/AAAI/AAAI17/paper/ view/14378.
+
+Michael Dennis, Natasha Jaques, Eugene Vinitsky, Alexandre Bayen, Stuart Russell, Andrew Critch, and Sergey Levine. Emergent complexity and zero-shot transfer via unsupervised environment design. In Advances in Neural Information Processing Systems, volume 33, 2020.
+
+Armen Der Kiureghian and Ove Ditlevsen. Aleatory or epistemic? does it matter? Structural safety, 31(2):105–112, 2009.
+
+Michael O’Gordon Duff. Optimal Learning: Computational procedures for Bayes-adaptive Markov decision processes. University of Massachusetts Amherst, 2002.
+
+Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Vlad Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, Shane Legg, and Koray Kavukcuoglu. IMPALA: Scalable distributed deep-RL with importance weighted actor-learner architectures. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1407–1416. PMLR, 10–15 Jul 2018.
+
+Carlos Florensa, David Held, Xinyang Geng, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1515–1528. PMLR, 10–15 Jul 2018. URL http://proceedings. mlr.press/v80/florensa18a.html.
+
+Carles Gelada and Marc G. Bellemare. Off-policy deep reinforcement learning by bootstrapping the covariate shift. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pp. 3647–3655. AAAI Press, 2019. URL https: //doi.org/10.1609/aaai.v33i01.33013647.
+
+Assaf Hallak and Shie Mannor. Consistent on-line off-policy evaluation. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1372–1383. PMLR, 06–11 Aug 2017. URL https://proceedings.mlr.press/v70/hallak17a.html.
+
+James J Heckman. Sample selection bias as a specification error. Econometrica: Journal of the econometric society, pp. 153–161, 1979.
+
+Hengyuan Hu, Adam Lerer, Alex Peysakhovich, and Jakob Foerster. “Other-play” for zero-shot coordination. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 4399–4410. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/ hu20a.html.
+
+Hengyuan Hu, Adam Lerer, Brandon Cui, Luis Pineda, Noam Brown, and Jakob N. Foerster. Offbelief learning. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 4369–4379. PMLR, 2021. URL http: //proceedings.mlr.press/v139/hu21c.html.
+
+Jiayuan Huang, Arthur Gretton, Karsten Borgwardt, Bernhard Schölkopf, and Alex Smola. Correcting sample selection bias by unlabeled data. Advances in neural information processing systems, 19: 601–608, 2006.
+
+Nick Jakobi. Evolutionary robotics and the radical envelope-of-noise hypothesis. Adaptive Behavior, 6(2):325–368, 1997.
+
+Minqi Jiang, Michael Dennis, Jack Parker-Holder, Jakob Foerster, Edward Grefenstette, and Tim Rocktäschel. Replay guided adversarial environment design. arXiv, 2021a.
+
+Minqi Jiang, Edward Grefenstette, and Tim Rocktäschel. Prioritized level replay. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 4940–4950. PMLR, 2021b. URL http://proceedings.mlr.press/v139/jiang21b.html.
+
+Niels Justesen, Ruben Rodriguez Torrado, Philip Bontrager, Ahmed Khalifa, Julian Togelius, and Sebastian Risi. Procedural level generation improves generality of deep reinforcement learning. CoRR, abs/1806.10729, 2018. URL http://arxiv.org/abs/1806.10729.
+
+Heinrich Küttler, Nantas Nardelli, Alexander H. Miller, Roberta Raileanu, Marco Selvatici, Edward Grefenstette, and Tim Rocktäschel. The NetHack Learning Environment. In Proceedings of the Conference on Neural Information Processing Systems (NeurIPS), 2020.
+
+Tambet Matiisen, Avital Oliver, Taco Cohen, and John Schulman. Teacher-student curriculum learning. IEEE Transactions on Neural Networks and Learning Systems, PP, 07 2017.
+
+John F Nash et al. Equilibrium points in n-person games. Proceedings of the national academy of sciences, 36(1):48–49, 1950.
+
+OpenAI OpenAI, Matthias Plappert, Raul Sampedro, Tao Xu, Ilge Akkaya, Vineet Kosaraju, Peter Welinder, Ruben D’Sa, Arthur Petron, Henrique Ponde de Oliveira Pinto, Alex Paino, Hyeonwoo Noh, Lilian Weng, Qiming Yuan, Casey Chu, and Wojciech Zaremba. Asymmetric self-play for automatic goal discovery in robotic manipulation, 2021.
+
+Ian Osband, Daniel Russo, and Benjamin Van Roy. (more) efficient reinforcement learning via posterior sampling. In Christopher J. C. Burges, Léon Bottou, Zoubin Ghahramani, and Kilian Q. Weinberger (eds.), Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States, pp. 3003–3011, 2013. URL https://proceedings.neurips.cc/paper/2013/hash/ 6a5889bb0190d0211a991f47bb19a777-Abstract.html.
+
+Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. CoRR, abs/1710.06537, 2017.
+
+Dean Pomerleau. ALVINN: an autonomous land vehicle in a neural network. In David S. Touretzky (ed.), Advances in Neural Information Processing Systems 1, [NIPS Conference, Denver, Colorado, USA, 1988], pp. 305–313. Morgan Kaufmann, 1988. URL http://papers.nips.cc/ paper/95-alvinn-an-autonomous-land-vehicle-in-a-neural-network.
+
+Rémy Portelas, Cédric Colas, Katja Hofmann, and Pierre-Yves Oudeyer. Teacher algorithms for curriculum learning of deep rl in continuously parameterized environments. In Leslie Pack Kaelbling, Danica Kragic, and Komei Sugiura (eds.), Proceedings of the Conference on Robot Learning, volume 100 of Proceedings of Machine Learning Research, pp. 835–853. PMLR, 30 Oct– 01 Nov 2020. URL https://proceedings.mlr.press/v100/portelas20a.html.
+
+Stephane Ross and Drew Bagnell. Efficient reductions for imitation learning. In Yee Whye Teh and Mike Titterington (eds.), Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, volume 9 of Proceedings of Machine Learning Research, pp. 661–668, Chia Laguna Resort, Sardinia, Italy, 13–15 May 2010. PMLR. URL https://proceedings. mlr.press/v9/ross10a.html.
+
+Mark Rowland, Will Dabney, and Remi Munos. Adaptive trade-offs in off-policy learning. In Silvia Chiappa and Roberto Calandra (eds.), Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pp. 34–44. PMLR, 26–28 Aug 2020. URL https://proceedings.mlr.press/v108/ rowland20a.html.
+
+Fereshteh Sadeghi and Sergey Levine. CAD2RL: real single-image flight without a single real image. In Nancy M. Amato, Siddhartha S. Srinivasa, Nora Ayanian, and Scott Kuindersma (eds.), Robotics: Science and Systems XIII, Massachusetts Institute of Technology, Cambridge, Massachusetts, USA, July 12-16, 2017, 2017.
+
+Mikayel Samvelyan, Robert Kirk, Vitaly Kurin, Jack Parker-Holder, Minqi Jiang, Eric Hambro, Fabio Petroni, Heinrich Kuttler, Edward Grefenstette, and Tim Rocktäschel. Minihack the planet: A sandbox for open-ended reinforcement learning research. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2021.
+
+Leonard J Savage. The theory of statistical decision. Journal of the American Statistical association, 46(253):55–67, 1951.
+
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017.
+
+David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Vedavyas Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy P. Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nat., 529(7587):484–489, 2016. URL https://doi.org/10.1038/nature16961.
+
+Adam Stooke, Anuj Mahajan, Catarina Barros, Charlie Deck, Jakob Bauer, Jakub Sygnowski, Maja Trebacz, Max Jaderberg, Michaël Mathieu, Nat McAleese, Nathalie Bradley-Schmieg, Nathaniel Wong, Nicolas Porcel, Roberta Raileanu, Steph Hughes-Fitt, Valentin Dalibard, and Wojciech Marian Czarnecki. Open-ended learning leads to generally capable agents. CoRR, abs/2107.12808, 2021. URL https://arxiv.org/abs/2107.12808.
+
+Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id=SkT5Yg-RZ.
+
+Richard S. Sutton, A. Rupam Mahmood, and Martha White. An emphatic approach to the problem of off-policy temporal-difference learning. Journal of Machine Learning Research, 17(73):1–29, 2016. URL http://jmlr.org/papers/v17/14-488.html.
+
+Philip Thomas and Emma Brunskill. Data-efficient off-policy policy evaluation for reinforcement learning. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The $3 3 r d$ International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 2139–2148, New York, New York, USA, 20–22 Jun 2016. PMLR.
+
+Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS 2017, Vancouver, BC, Canada, September 24-28, 2017, pp. 23–30. IEEE, 2017.
+
+Vladimir N Vapnik and A Ya Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probability and Its Applications, pp. 264–280, 1971.
+
+Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H. Choi, Richard Powell, Timo Ewalds, Petko Georgiev, Junhyuk Oh, Dan Horgan, Manuel Kroiss, Ivo Danihelka, Aja Huang, Laurent Sifre, Trevor Cai, John P. Agapiou, Max Jaderberg, Alexander Sasha Vezhnevets, Rémi Leblond, Tobias Pohlen, Valentin Dalibard, David Budden, Yury Sulsky, James Molloy, Tom L. Paine, Çaglar Gülçehre, Ziyu Wang, Tobias Pfaff, Yuhuai Wu, Roman Ring, Dani Yogatama, Dario Wünsch, Katrina McKinney, Oliver Smith, Tom Schaul, Timothy P. Lillicrap, Koray Kavukcuoglu, Demis Hassabis, Chris Apps, and David Silver. Grandmaster level in starcraft II using multi-agent reinforcement learning. Nat., 575(7782): 350–354, 2019. doi: 10.1038/s41586-019-1724-z. URL https://doi.org/10.1038/ $\mathtt { s 4 1 5 8 6 - 0 1 9 - 1 7 2 4 - z }$ .
+
+Rui Wang, Joel Lehman, Jeff Clune, and Kenneth O. Stanley. Paired open-ended trailblazer (POET): endlessly generating increasingly complex and diverse learning environments and their solutions. CoRR, abs/1901.01753, 2019.
+
+Rui Wang, Joel Lehman, Aditya Rawal, Jiale Zhi, Yulun Li, Jeffrey Clune, and Kenneth Stanley. Enhanced POET: Open-ended reinforcement learning through unbounded invention of learning challenges and their solutions. In Proceedings of the 37th International Conference on Machine Learning, pp. 9940–9951, 2020.
+
+Xiaoxia Wu, Ethan Dyer, and Behnam Neyshabur. When do curricula work? In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id ${ . } = { }$ tW4QEInpni.
+
+Amy Zhang, Zachary C. Lipton, Luis Pineda, Kamyar Azizzadenesheli, Anima Anandkumar, Laurent Itti, Joelle Pineau, and Tommaso Furlanello. Learning causal state representations of partially observable environments. CoRR, abs/1906.10437, 2019. URL http://arxiv.org/abs/ 1906.10437.
+
+Amy Zhang, Rowan Thomas McAllister, Roberto Calandra, Yarin Gal, and Sergey Levine. Learning invariant representations for reinforcement learning without reconstruction. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id $=$ -2FCwDKRREu.
+
+Victor Zhong, Tim Rocktäschel, and Edward Grefenstette. RTFM: generalising to new environment dynamics via reading. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https:// openreview.net/forum?id $=$ SJgob6NKvH.
+
+Luisa M. Zintgraf, Kyriacos Shiarlis, Maximilian Igl, Sebastian Schulze, Yarin Gal, Katja Hofmann, and Shimon Whiteson. Varibad: A very good method for bayes-adaptive deep RL via meta-learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id $=$ Hkl9JlBYvr.
\ No newline at end of file
diff --git a/md/dev/wu1Za9dY1GY/wu1Za9dY1GY.md b/md/dev/wu1Za9dY1GY/wu1Za9dY1GY.md
new file mode 100644
index 0000000000000000000000000000000000000000..27266fb0f20c401b07822cc186c0a8c262993474
--- /dev/null
+++ b/md/dev/wu1Za9dY1GY/wu1Za9dY1GY.md
@@ -0,0 +1,320 @@
+# Graph Neural Networks are Dynamic Programmers
+
+Andrew Dudzik∗ DeepMind adudzik@deepmind.com
+
+Petar Velickovi ˇ c´∗ DeepMind petarv@deepmind.com
+
+# Abstract
+
+Recent advances in neural algorithmic reasoning with graph neural networks (GNNs) are propped up by the notion of algorithmic alignment. Broadly, a neural network will be better at learning to execute a reasoning task (in terms of sample complexity) if its individual components align well with the target algorithm. Specifically, GNNs are claimed to align with dynamic programming (DP), a general problem-solving strategy which expresses many polynomial-time algorithms. However, has this alignment truly been demonstrated and theoretically quantified? Here we show, using methods from category theory and abstract algebra, that there exists an intricate connection between GNNs and DP, going well beyond the initial observations over individual algorithms such as Bellman-Ford. Exposing this connection, we easily verify several prior findings in the literature, produce better-grounded GNN architectures for edge-centric tasks, and demonstrate empirical results on the CLRS algorithmic reasoning benchmark. We hope our exposition will serve as a foundation for building stronger algorithmically aligned GNNs.
+
+# 1 Introduction
+
+One of the principal pillars of neural algorithmic reasoning [27] is training neural networks that execute algorithmic computation in a high-dimensional latent space. While this process is in itself insightful, and can lead to stronger combinatorial optimisation systems [21], it is valuable in terms of expanding the applicability of classical algorithms. Evidence of this value are emerging, with pre-trained algorithmic reasoners utilised in implicit planning [11] and self-supervised learning [28].
+
+A fundamental question in this space is: which architecture should be used to learn a particular algorithm (or collection of algorithms [36])? Naturally, we seek architectures that have low sample complexity, as they will allow us to create models that generalise better with fewer training examples.
+
+The key theoretical advance towards achieving this aim has been made by [37]. Therein, the authors formalise the notion of algorithmic alignment, which states that we should favour architectures that align better to the algorithm, in the sense that we can separate them into modules, which individually correspond to the computations of the target algorithm’s subroutines. It can be proved that architectures with higher algorithmic alignment will have lower sample complexity in the NTK regime [20]. Further, the theory of [37] predicts that graph neural networks (GNNs) algorithmically align with dynamic programming [3, DP]. The authors demonstrate this by forming an analogy to the Bellman-Ford algorithm [2].
+
+Since DP is a very general class of problem-solving techniques that can be used to express many classical algorithms, this finding has placed GNNs as the central methodology for neural algorithmic execution [7]. However, it quickly became apparent that it is not enough to just train any GNN—for many algorithmic tasks, careful attention is required. Several papers illustrated special cases of GNNs that align with sequential algorithms [31], linearithmic sequence processing [16], physics simulations [23], iterative algorihtms [26], data structures [29] or auxiliary memory [24]. Some explanations for this lack of easy generalisation have arisen—we now have both geometric [38] and causal [4] views into how better generalisation can be achieved.
+
+We believe that the fundamental reason why so many isolated efforts needed to look into learning specific classes of algorithms is the fact the GNN-DP connection has not been sufficiently explored. Indeed, the original work of [37] merely mentions in passing that the formulation of DP algorithms seems to align with GNNs, and demonstrates one example (Bellman-Ford). Our thorough investigation of the literature yielded no concrete follow-up to this initial claim. But DP algorithms are very rich and diverse, often requiring a broad spectrum of computations. Hence what we really need is a framework that could allow us to identify GNNs that could align particularly well with certain classes of DP, rather than assuming a “one-size-fits-all” GNN architecture will exist.
+
+As a first step towards this, in this paper we interpret the operations of both DP and GNNs from the lens of category theory and abstract algebra. We elucidate the GNN-DP connection by observing a diagrammatic abstraction of their computations, recasting algorithmic alignment to aligning the diagrams of (G)NNs to ones of the target algorithm class. In doing so, several previously shown results will naturally arise as corollaries, and we propose novel GNN variants that empirically align better to edge-centric algorithms. We hope our work opens up the door to a broader unification between algorithmic reasoning and the geometric deep learning blueprint [5].
+
+# 2 GNNs, dynamic programming, and the categorical connection
+
+Before diving into the theory behind our connection, we provide a quick recap on the methods being connected: graph neural networks and dynamic programming. Further, we cite related work to outline why it is sufficient to interpret DP from the lens of graph algorithms.
+
+We will use the definition of GNNs based on [5]. Let a graph be a tuple of nodes and edges, $G = ( V , E )$ , with one-hop neighbourhoods defined as $\mathcal { N } _ { u } \mathbf { \bar { \Gamma } } = \{ v \in V \mid \mathbf { \bar { ( } } v , u ) \in E \}$ . Further, a node feature matrix $\mathbf { X } \in \mathbb { R } ^ { | V | \times k }$ gives the features of node $u$ as $\mathbf { x } _ { u }$ ; we omit edge- and graph-level features for clarity. A (message passing) GNN over this graph is then executed as:
+
+$$
+\mathbf { h } _ { u } = \phi \left( \mathbf { x } _ { u } , \bigoplus _ { v \in \mathcal { N } _ { u } } \psi ( \mathbf { x } _ { u } , \mathbf { x } _ { v } ) \right)
+$$
+
+where $\psi : \mathbb { R } ^ { k } \times \mathbb { R } ^ { k } \to \mathbb { R } ^ { k }$ is a message function, $\phi : \mathbb { R } ^ { k } \times \mathbb { R } ^ { k } \mathbb { R } ^ { k }$ is a readout function, and $\oplus$ is a permutation-invariant aggregation function (such as $\displaystyle \sum$ or max). Both $\psi$ and $\phi$ can be realised as MLPs, but many special cases exist, giving rise to, e.g., attentional GNNs [30].
+
+Dynamic programming is defined as a process that solves problems in a divide et impera fashion: imagine that we want to solve a problem instance $x$ . DP proceeds to identify a set of subproblems, $\eta ( x )$ , such that solving them first, and recombining the answers, can directly lead to the solution for $x$ : $f ( x ) = \rho ( \{ f ( y ) \mid y \in \eta ( x ) \} )$ . Eventually, we decompose the problem enough until we arrive at an instance for which the solution is trivially given (i.e. $f ( y )$ which is known upfront). From these “base cases”, we can gradually build up the solution for the problem instance we initially care for in a bottom-up fashion. This rule is often expressed programmatically:
+
+$$
+\mathsf { d p } [ \mathbf { x } ] \gets \mathbf { r e c o m b i n e } ( \mathbf { s c o r e } ( \mathrm { d p } [ \mathbf { y } ] , \mathrm { d p } [ \mathbf { x } ] ) \mathrm { ~ f o r ~ y ~ i n ~ e x p a n d } ( \mathbf { x } ) )
+$$
+
+To initiate our discussion on why DP can be connected with GNNs, it is a worthwhile exercise to show how Equation 2 induces a graph structure. To see this, we leverage a categorical analysis of dynamic programming first proposed by [10]. Therein, dynamic programming algorithms are reasoned about as a composition of three components (presented here on a high level):
+
+$$
+\mathrm { d } \boldsymbol { \mathrm { p } } = \underbrace { \rho } _ { \mathrm { r e c o m b i n e } } ^ { \mathrm { ~ \tiny ~ { ~ \circ ~ } ~ } } \underbrace { \sigma } _ { \mathrm { s c o r e } } ^ { \mathrm { ~ \tiny ~ { ~ \circ ~ } ~ } } \underbrace { \eta } _ { \mathrm { e x p a n d } }
+$$
+
+Expansion selects the relevant subproblems; scoring computes the quality of each individual subproblem’s solution w.r.t. the current problem, and recombining combines these solutions into a solution for the original problem (e.g. by taking the max, or average).
+
+Therefore, we can actually identify every subproblem as a node in a graph. Let $V$ be the space of all subproblems, and $R$ an appropriate value space (e.g. the real numbers). Then, expansion is defined as $\eta : V \to { \mathcal { P } } ( V )$ , giving the set of all subproblems relevant for a given problem. Note that this also induces a set of edges between subproblems, $E$ ; namely, $( x , y ) \in { \bar { E } }$ if $x \in \eta ( y )$ . Each subproblem is scored by using a function $\sigma : { \mathcal { P } } ( V ) \to { \mathcal { P } } ( R )$ . Finally, the individual scores are recombined using the recombination function, $\rho : \mathcal { P } ( R ) R$ . The final dynamic programming primitive therefore computes a function $\mathrm { d } \mathsf { p } : V \to R$ in each of the subproblems of interest.
+
+Therefore, dynamic programming algorithms can be seen as performing computations over a graph of subproblems, which can usually be precomputed for the task at hand (since the outputs of $\eta$ are assumed known upfront for every subproblem). One specific popular example is the Bellman-Ford algorithm [2], which computes single-source shortest paths from a given source node, $s$ , in a graph $G = ( V , E )$ . In this case, the set of subproblems is exactly the set of nodes, $V$ , and the expansion $\eta ( u )$ is exactly the set of one-hop neighbours of $u$ in the graph. The algorithm maintains distances of every node to the source, $d _ { u }$ . The rule for iteratively recombining these distances is as follows:
+
+$$
+d _ { u } \gets \operatorname* { m i n } \Big ( d _ { u } , \operatorname* { m i n } _ { v \in \mathcal { N } _ { u } } d _ { v } + w _ { v \to u } \Big )
+$$
+
+where $w _ { v u }$ is the distance between nodes $v$ and $u$ . The algorithm’s base cases are $d _ { s } = 0$ for the source node, $d _ { u } = + \infty$ otherwise. Note that more general forms of Bellman-Ford pathfinding exist, for appropriate definitions of $^ +$ and min (in general known as a semiring). Several recent research papers such as NBFNet [39] explicitly call on this alignment in their motivation.
+
+# 3 The difficulty of connecting GNNs and DP
+
+The basic technical obstacle to establishing a rigorous correspondence between neural networks and DP is the vastly different character of the computations they perform. Neural networks are built from linear algebra over the familiar real numbers, while DP, which is often a generalisation of path-finding problems, typically takes place over “tropical” objects like $( \mathbb { N } \cup \{ \infty \} , { \overline { { \operatorname* { m i n } } } } , + ) ^ { 2 }$ , which are usually studied in mathematics as “degenerations” of Euclidean space. The two worlds cannot clearly be reconciled, directly, with simple equations.
+
+However, if we define an arbitrary “latent space” $R$ and make as few assumptions as possible, we can observe that many of the behaviors we care about, for both GNNs and $D P$ , arise from looking at functions $S R$ , where $S$ is a finite set. $R$ can be seen as the set of real-valued vectors in the case of GNNs, and the tropical numbers in the case of DP.
+
+So our principal object of study is the category of finite sets, and “ $R$ -valued quantities” on it. By “category” here we mean a collection of objects (all finite sets) together with a notion of composable arrows (functions between finite sets).
+
+To draw our GNN-DP connection, we need to devise an abstract object which can capture both the GNN’s message passing/aggregation stages (Equation 1) and the DP’s scoring/recombination stages (Equation 2). It may seem quite intuitive that these two concepts can and should be relatable, and category theory is a very attractive tool for “making the obvious even more obvious” [15]. Indeed, recently concepts from category theory have enabled the construction of powerful GNN architectures beyond permutation equivariance [9]. Here, we propose integral transforms as such an object.
+
+We will construct the integral transform by composing transformations over our input features in a way that will depend minimally on the specific choice of $R$ . In doing so, we will build a computational diagram that will be applicable for both GNNs and DP (and their own choices of $R$ ), and hence allowing for focusing on making components of those diagrams as aligned as possible.
+
+# 4 The integral transform
+
+An integral transform can be encoded in a diagram of this form, which we call a polynomial span:
+
+$$
+\begin{array} { l c c c c } { X } & { \quad } & { p \longrightarrow Y } \\ { \big | } & { } & { } & { \big | } \\ { i } & { } & { } & { \begin{array} { l } { { } } \\ { { } } \end{array} } \\ { \big \downarrow } & { } & { } & { \begin{array} { l } { { } } \\ { { } } \end{array} } \end{array}
+$$
+
+where $W , X , Y$ and $Z$ are finite sets. The arrows $i , p , o$ stand, respectively, for “input”, “process”, and “output”. In context, the sets will have the following informal meaning: $W$ represents the set over which we define our inputs, $Z$ the set over which we define outputs. $X$ and $Y$ are, respectively, carrier sets for the arguments, and the messages3—we will clarify their meaning shortly.
+
+Before proceeding, it is worthy to note the special case of $X = Y = E$ , with $p$ being the identity map. Such a diagram is commonly known as a span. A span that additionally has $W = Z = V$ is equivalent to a representation of a directed graph with vertex set $Z$ and edge set $Y$ $V \left. E \right. V )$ ; in this case $i ( e )$ and $o ( e )$ are the functions identifying the source and target nodes of each edge.
+
+The key question is: given input data $f$ on $W$ , assigning features $f ( w )$ to each $w \in W$ , how to transform it, via the polynomial span, into data on $Z ?$ If we can do this, we will be able to characterise both the process of sending messages between nodes in GNNs and scoring subproblems in DP.
+
+For us, data on a carrier set $S$ consists of an element of $[ S , R ] : = \{ f : S \to R \}$ , where $R$ is a “set of possible values”. For now, we will think of $R$ as an arbitrary (usually infinite) set, though we will see later that it should possess some algebraic structure; it should be a semiring.
+
+The transform proceeds in three steps, following the edges of the polynomial span:
+
+
+
+We call the three arrows $i ^ { * } , p _ { \otimes } , o _ { \oplus }$ the pullback, the argument pushfoward, and the message pushforward. Taken together, they form an integral transform—and we conjecture that this transform can be described as a polynomial functor, where $p _ { \otimes }$ and $o _ { \oplus }$ correspond to the dependent product and dependent sum from type theory (cf. Appendix $\mathbf { D }$ for details).
+
+The pullback $i ^ { * }$ is the easiest to define. Since we have a function $i : X \to W$ (part of the polynomial span) and a function $f : W \to R$ (our input data), we can produce data on $X$ , that is, a function in $X R$ , by composition. We hence define $i ^ { * } f = f \circ i$ .
+
+Unfortunately, the other two arrows of the polynomial span point in the wrong direction for naïve composition. For the moment, we will focus on how to define $o _ { \oplus }$ and leave $p _ { \otimes }$ for later.
+
+We start with message data $m : Y R$ . It may be attractive to invert the output arrow $o$ in order to define a composition with $o ^ { - 1 }$ , as was done in the case of the pullback. However, unless $o$ is bijective, the preimage $o ^ { - 1 } : Z \to { \mathcal { P } } ( Y )$ takes values in the power set of $Y$ . There is an additional technicality: if the composition $m \circ o ^ { - 1 }$ takes values in ${ \mathcal { P } } ( R )$ , it will fail to detect multiplicities; we are unable to tell from a subset of $R$ whether multiple messages had the same value.
+
+So instead, our pushforward takes values in $\mathtt { b a g } ( R )$ , the set of finite multisets (or bags) of $R$ , which we describe in more detail in appendix B. For the moment, it is enough to know that a bag is equivalent to a formal sum, and we define an intermediate message pushforward $( { \overline { { o _ { \oplus } } } } m ) ( u ) : =$ $\bar { \Sigma _ { e \in t ^ { - 1 } ( u ) } m ( e ) } \in [ Z , \mathtt { b a g } ( R ) ]$ .
+
+
+Figure 1: The illustration of how pullback and pushforward combine to form the integral transform, for two specific cases. Left: Polynomial span $V E E V$ with trivial argument pushforward (identity). Each edge $e _ { u v }$ is connected to its sender and receiver nodes $( u , v )$ via the span (black arrows). The pullback then “pulls” the node features $f ( u )$ along the span, which the argument pushforward folds into edge features $g ( e _ { v u } ) = f ( u )$ . Once all sender features are pulled back to their edges, the message pushforward then “collects” all of the edge features that send to a particular receiver, by pushing them along the span. Right: Polynomial span $V E + E \mathbf { \bar { { E } } } V$ , a situation more commonly found in GNNs. In this case, the pullback pulls sender and receiver node features into the argument function, $h$ . The argument pushforward then computes, from these arguments, the edge messages, $g$ , which are sent to receivers via the message pushforward, as before. See Appendix A for a visualisation of how these arrows translate into GNN code.
+
+All that is missing to complete our definition of $o _ { \oplus }$ is an aggregator $\oplus : \mathtt { b a g } ( R ) \to R$ . As we will see later, specifying a well-behaved aggregator is the same as imposing a commutative monoid structure on $R$ . With such an aggregator on $R$ , we can define $( o _ { \oplus } m ) ( u ) : = \bigoplus ( \overline { { \upsilon _ { \oplus } } } m ) ( u )$ .
+
+We return to $p _ { \otimes }$ , which is constructed very similarly. The only difference is that, while we deliberately regard the collection of messages as unordered, the collection of arguments used to compute a message has an ordering we wish to respect. So instead of the type $\mathtt { b a g } ( R )$ , we use the type $\mathtt { l i s t } ( R )$ of finite lists of elements of $R$ , and our aggregator $\otimes : { \mathrm { l i s t } } ( R ) \to R$ is now akin to a fold operator.
+
+We illustrate the use of these two aggregators in a decomposed diagram:
+
+
+
+Note that any semiring $( R , \otimes , \oplus )$ comes equipped with binary operators $\otimes , \oplus$ that allow aggregators $\otimes , \oplus$ to be defined inductively. In fact, the converse—that every set with two such aggregators is a semiring—is also true, if we assume some reasonable conditions on the aggregators, which we can explain in terms of one of the most utilised concepts in category theory and functional programming—monads [33]. Due to space constraints, we refer the interested reader to Appendices $\mathbf { B }$ and C for a full exposition of how we can use monads over lists and bags to constrain the latent space $R$ to respect a semiring structure.
+
+For now, it’s enough to know that our key examples of the real numbers (with multiplication and addition, for GNNs) and the tropical natural numbers (with addition and minimum, for DP) both allow for natural interpretations of $\otimes$ and $\oplus$ in the integral transform.
+
+We are now ready to show how the integral transform can be used to instantiate popular examples of algorithms and GNNs. We start with the Bellman-Ford algorithm [2] (Equation 4) that was traditionally used to demonstrate the concept of algorithmic alignment.
+
+# 5 Bellman-Ford
+
+Let $R = ( \mathbb { N } \cup \{ \infty \} , + , \operatorname* { m i n } )$ be the “min-plus” semiring of extended natural numbers, with $\otimes = +$ and $\oplus = \operatorname* { m i n }$ . This is the coefficient semiring over which the Bellman-Ford algorithm takes place.
+
+Let $( V , E )$ be a weighted graph with source and target maps $s , t : E \to V$ and edge weights $w : E R$ . For purely technical reasons, we also need to explicitly materialise a bias function $b : V R$ , which is, in practice, a constant-zero function $( b ( v ) = 0$ for all $v \in V .$ ) but will prove necessary for defining the argument pushforward.
+
+We interpret Bellman-Ford as the following polynomial span:
+
+$$
+\begin{array} { c c c } { { ( V + E ) + ( V + E ) \ --- p \longrightarrow V + E } } & { { } } & { { } } \\ { { \big | } } & { { } } & { { \big | } } \\ { { \begin{array} { c c c } { { \scriptstyle \dot { i } } } & { { } } & { { } } \\ { { \big \downarrow } } & { { } } & { { \big \downarrow } } \\ { { \scriptstyle V + ( V + E ) } } & { { } } & { { \scriptstyle V } } \end{array} } } & { { } } \end{array}
+$$
+
+Here “ $+ ^ { \dag }$ is the disjoint union of sets, defined as $A + B = \{ ( a , 1 ) \mid a \in A \} \cup \{ ( b , 2 ) \mid b \in B \} .$ . Note that $[ S + T , R ] \cong [ S , R ] \times [ T , R ]$ , i.e. specifying data on a disjoint union is equivalent to specifying data on each component separately.
+
+Initially, we describe each of the four sets of the polynomial span, making their role clear:
+
+• Input: $W = V + ( V + E )$ . Our input to Bellman-Ford includes: the current estimate of node distances $\dot { \ b { d } } _ { \ b { u } }$ ; a function in $[ V , R ] )$ , edge weights ( $\dot { \boldsymbol { w } }$ ; a function in $[ E , R ] )$ , and the previously discussed bias $b$ , a function in $[ V , R ]$ . Hence our overall inputs are members of $[ V , R ] \times [ E , R ] \times [ V , R ] \cong [ V + ( V + E ) , R ]$ , justifying our choice of input space.
+
+• Arguments: $X = ( V + E ) + ( V + E )$ . Here we collect the ingredients necessary to compute Bellman-Ford’s subproblem solutions coming from neighbouring nodes. To do this, we need to combine data in the nodes with data living on edges—those are the arguments to the function. And since they meet in the edges, we “lift” our node distances $[ V , R ]$ to edges they are sending from, giving us an additional function in $[ E , R ]$ . Hence our argument carrier space is now $( V + E ) + ( V + E )$ (the remaining three inputs remain unchanged).
+
+• Message: $Y = V + E$ . Once the arguments are combined to compute messages, we are left with signal in each edge (containing the sum of corresponding $d _ { u }$ and $w _ { u v . }$ ), and each node (containing just $d _ { u }$ , for the purposes of access to the previous optimal solution). Hence our messages are members of $[ \bar { V } , \bar { R } ] \times [ E , R ]$ , justifying our choice of message space.
+
+• Output: $Z = V$ . Lastly, the output of one step of Bellman-Ford are updated values $d _ { u } ^ { \prime }$ , which we can interpret as just (output) data living on $V$ .
+
+We now describe how to propagate data along each arrow of the diagram in turn, beginning with inputs $( f , b , w )$ of node features $f : V \to R$ , a bias $b : V R$ , and edge weights $w : E R$ :
+
+• Pullback, $i ^ { * }$ : First, we can note the input function $i : ( V + E ) + ( V + E ) V + ( V + E )$ decomposes as the sum of two arrows. $i _ { 1 } : V + E \to V$ is the identity function on $V$ and the source function on $E$ , and $i _ { 2 } : V + E \to V + E$ is just the identity. So we calculate the pullback $i ^ { * } ( f , b , w ) = ( f , f \circ s , b , w )$ , giving us the arguments to compute messages.
+
+• Argument pushforward, $p _ { \otimes }$ : Next, the process function $p$ simply identifies the two copies of $V + E$ , and sums their values. So the argument pushforward is $p _ { \otimes } ( f , f \circ s , b , w ) =$ $( f , f \circ s ) \otimes ( b , w ) = ( f + b , ( f \circ s ) + w )$ . This also allows us to interpret the bias function, $b$ , as a “self-edge” in the graph with weight 0.
+
+• Message pushforward, $o _ { \oplus }$ : The output function $o : V + E V$ is the identity function on $V$ and the target function on $E$ . So the message pushforward gives us $( o _ { \oplus } ( f + b , ( f \circ s ) +$ $\begin{array} { r } { w ) ) ( u ) = ( f ( u ) + b ( u ) ) \oplus \bigoplus _ { t ( e ) = u } ( f \circ s ) ( e ) = \operatorname* { m i n } ( f ( u ) + b ( u ) , \operatorname* { m i n } _ { v \to u } f ( v ) + w _ { v \to u } ) ( f ( u ) + f ( e ) ) } \end{array}$ ).
+
+Letting $b ( u ) = 0$ , we can see that this is exactly Equation 4. So we have produced the formula for the Bellman-Ford algorithm directly from the polynomial span in Diagram 6.
+
+Note that $p _ { \oplus }$ is aligned with using max aggregation in neural networks—directly explaining several previous proposals, such as [31]. But additionally, $p _ { \otimes }$ , as defined, is aligned with concatenating all message arguments together and passing them through a linear function, which is how such a step is implemented in GNNs’ message functions. We now direct our polynomial span analysis at GNNs.
+
+# 6 GNNs
+
+We study the popular message passing neural network (MPNN) model [19], which can be interpreted using the following polynomial span diagram:
+
+$$
+\begin{array} { c c c } { E + ( E + E ) + E } & { \longrightarrow } & { \longrightarrow E } \\ { \big | } & { \big | } & { \big | } \\ { \begin{array} { c c c } { \underline { { i } } } & { \qquad \underline { { o } } } & { \qquad \underline { { o } } } \\ { \big \downarrow } & { \qquad \downarrow } & { \qquad \downarrow } \\ { 1 + V + E } & { } & { } & { V } \end{array} } \end{array}
+$$
+
+Here the set 1 refers to a singleton set—sometimes also called (), or unit—which is used as a carrier for graph-level features. This implies the graph features will be specified as $[ 1 , R ] \cong R$ , as expected.
+
+Given all these features, how would we compute messages? The natural way is to combine the features of the sender and receiver node of each edge, features of said edge, and graph-level features— these will form our arguments, and they need to all “meet” in the edges. This motivates our argument space as $E + ( E + E ) + E$ : all of the above four, accordingly broadcast into their respective edge(s).
+
+The input map, $i$ , is then the unique map to the singleton, the sender and receiver functions on the two middle copies of $E$ , and the identity on the last copy of $E$ , i.e. $i ( a , b , c , d ) = \{ ( ) , s ( b ) , t ( c ) , d \}$ . The process map, $p$ , collapses the four copies of $E$ into just one, to hold the computed message. Lastly, the output map, $o$ , is the target function, identifying the node to which the message will be delivered.
+
+The actual computation performed by the network (over real values in $\mathbb { R }$ , which can support various semirings of interest) is exactly an integral transform, with an extra MLP processing step on messages:
+
+$$
+\begin{array} { r l r } { \left[ E + ( E + E ) + E , \mathbb { R } \right] \longrightarrow p _ { \otimes } \longrightarrow [ E , \mathbb { R } ] \longleftrightarrow \scriptscriptstyle M L P } & { } & \\ { \uparrow } & { \underset { \textit { i } ^ { * } } { \bigcap } } & { } & { \underset { \textit { i } ^ { * } } { \bigcap } } \\ { \Big | } & { } & { \underset { \textit { i } ^ { * } } { \bigcup } } & { } \\ { \left[ 1 + V + E , \mathbb { R } \right] } & { } & { \left[ V , \mathbb { R } \right] } \end{array}
+$$
+
+It is useful to take a moment to discuss what was just achieved: with a single abstract template (the polynomial span), we have successfully explained both a dynamic programming algorithm, and a GNN update rule—merely by choosing the correct support sets and latent space.
+
+# 7 Improving GNNs with edge updates, with experimental evaluation
+
+From now on, we will set $E = V ^ { 2 }$ , as all our baseline GNNs will use fully connected graphs, and it will accentuate the polynomial nature of our construction.
+
+We now show how our polynomial span view can be used to directly propose better-aligned GNN architectures for certain algorithmic tasks. Since the MPNN diagram above outputs only node features, to improve predictive performance on edge-centric algorithms, it is a natural augmentation to also update edge features, by adding edges to the output carrier (as done by, e.g., [1]):
+
+$$
+\begin{array} { c c c } { { V ^ { 2 } + ( V ^ { 2 } + V ^ { 2 } ) + V ^ { 2 } ~ { \longrightarrow } ~ } } & { { V ~ { \longrightarrow } ~ V ^ { 2 } } } \\ { { \big \downarrow } } & { { } } & { { } } \\ { { \begin{array} { l } { { i } } \\ { { \downarrow } } \\ { { \downarrow } } \end{array} } } & { { \begin{array} { r } { { } } \\ { { } } \\ { { } } \\ { { { } } } \end{array} } } \\ { { 1 + V + V ^ { 2 } } } & { { } } & { { V + V ^ { 2 } } } \end{array}
+$$
+
+But notice that there is a problem with the output arrow. Since we are using each message twice, $o$ is no longer a function—it’d have to send each edge message to two different objects! To resolve this, we need to appropriately augment the messages and the arguments. This is equivalent to specifying a new polynomial span with output $V ^ { 2 }$ , which we can then recombine with Diagram 7:
+
+$$
+\begin{array} { l l l l } { { } } & { { ? ~ - } } & { { ~ p ~ - } } & { { ~ ? ~ } } \\ { { } } & { { } } & { { } } & { { } } \\ { { } } & { { \stackrel { i } { \downarrow } ~ } } & { { } } & { { ~ \stackrel { i } { \downarrow } ~ } } \\ { { } } & { { } } & { { } } & { { ~ \downarrow } } \\ { { 1 + V + V ^ { 2 } } } & { { } } & { { } } & { { ~ V ^ { 2 } } } \end{array}
+$$
+
+Most edge-centric algorithms of interest (such as the Floyd-Warshall algorithm for all-pairs shortest paths [14]), compute edge-level outputs by reducing over a choice of “intermediate” node. Hence, it would be beneficial to produce messages with shape $V ^ { 3 }$ , which would then reduce to features over $V ^ { 2 }$ . There are three possible ways to broadcast both node and edge features into $V ^ { 3 }$ , so we propose the following polynomial span, which materialises each of those arguments:
+
+$$
+\begin{array} { c c c } { { V ^ { 3 } + ( V ^ { 3 } + V ^ { 3 } + V ^ { 3 } ) + ( V ^ { 3 } + V ^ { 3 } + V ^ { 3 } ) \longleftarrow \longrightarrow V ^ { 3 } } } & { { \nonumber } } & { { \nonumber } } \\ { { \big \downarrow } } & { { \big \downarrow } } & { { \big \downarrow } } \\ { { \big \downarrow } } & { { \big \downarrow } } & { { \big \downarrow } } \\ { { 1 + V + V ^ { 2 } } } & { { { } } } & { { V ^ { 2 } } } \end{array}
+$$
+
+Finally, inserting this into Diagram 7 gives us a corrected polynomial span with output $V + V ^ { 2 }$ :
+
+$$
+\begin{array} { l c c } { { 4 { \cal V } ^ { 2 } + 7 { \cal V } ^ { 3 } ~ --- ~ p ~ { \longrightarrow } ~ { \cal V } ^ { 2 } + { \cal V } ^ { 3 } } } \\ { { \mid ~ } } \\ { { ~ \stackrel { i } { \downarrow } ~ } } \\ { { ~ \downarrow ~ } } \\ { { 1 + { \cal V } + { \cal V } ^ { 2 } ~ } } & { { ~ { \cal V } + { \cal V } ^ { 2 } } } \end{array}
+$$
+
+Here we have collapsed the copies of $V ^ { 2 }$ and $V ^ { 3 }$ in the argument position for compactness.
+
+While Diagram 7 doesn’t make sense as a polynomial diagram of sets, we can clearly still implement it as an architecture [1], since nothing stops us from sending the same tensor to two places. We want to investigate whether our proposed modification of Diagram 10, which materialises order3 messages, leads to improved algorithmic alignment on edge-centric algorithms. To support this evaluation, we initially use a set of six tasks from the recently proposed CLRS Algorithmic Reasoning Benchmark [32], which evaluates how well various (G)NNs align to classical algorithms, both inand out-of-distribution. We reuse exactly the data generation and base model implementations in the publicly available code for the CLRS benchmark.
+
+We implemented each of these options by making our GNN’s message and update functions be two-layer MLPs with embedding dimension 24, and hidden layers of size 8 and 16. Our test results (out-of-distribution) are summarised in Table 1. For convenience, we also illustrate the in-distribution performance of our models via plots given in Appendix E.
+
+Lastly, we scale up our experiments to 27 different tasks in CLRS, 96-dimensional embeddings, and using the PGN processor [29], which is the current state-of-the-art model on CLRS in terms of task win count [32]. We summarise the performance improvement obtained by our $V ^ { 3 }$ variant of PGN in Table 2, aggregated across edge-centric tasks as well as ones that do not require explicit edge-level reasoning. For convenience, we provide the per-task test performance in Appendix F (Table 3).
+
+We found that the $V ^ { 3 }$ architecture was equivalent to, or outperformed, the non-polynomial $( V ^ { 2 } )$ one in all edge-centric algorithms (up to standard error). Additionally, this architecture appears to also provide some gains on tasks without explicit edge-level reasoning requirements, albeit smaller on average and less consistently. Our result directly validates our theory’s predictions, in the context of presenting a better-aligned GNN for edge-centric algorithmic targets.
+
+Table 1: Test (out-of-distribution) results of our models on all models on the six algorithms studied. $V ^ { 2 }$ corresponds to the baseline model offered by Diagram 7, while $V ^ { 3 }$ corresponds to our proposal in Diagram 10, which respects the polynomial span.
+
+