ZHANGYUXUAN-zR commited on
Commit
e79d58e
·
verified ·
1 Parent(s): 09b1d71

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. parse/train/o966_Is_nPA/o966_Is_nPA_content_list.json +0 -0
  2. parse/train/o966_Is_nPA/o966_Is_nPA_middle.json +0 -0
  3. parse/train/o_V-MjyyGV_/o_V-MjyyGV_.md +367 -0
  4. parse/train/o_V-MjyyGV_/o_V-MjyyGV__middle.json +0 -0
  5. parse/train/pk4q0SD_r1X/pk4q0SD_r1X.md +311 -0
  6. parse/train/pk4q0SD_r1X/pk4q0SD_r1X_content_list.json +1380 -0
  7. parse/train/pk4q0SD_r1X/pk4q0SD_r1X_middle.json +0 -0
  8. parse/train/pk4q0SD_r1X/pk4q0SD_r1X_model.json +0 -0
  9. parse/train/qiydAcw6Re/qiydAcw6Re.md +636 -0
  10. parse/train/qiydAcw6Re/qiydAcw6Re_content_list.json +0 -0
  11. parse/train/qiydAcw6Re/qiydAcw6Re_middle.json +0 -0
  12. parse/train/qiydAcw6Re/qiydAcw6Re_model.json +0 -0
  13. vlm/train/04cII6MumYV/0.png +3 -0
  14. vlm/train/04cII6MumYV/1.png +3 -0
  15. vlm/train/04cII6MumYV/10.png +3 -0
  16. vlm/train/04cII6MumYV/11.png +3 -0
  17. vlm/train/04cII6MumYV/2.png +3 -0
  18. vlm/train/04cII6MumYV/3.png +3 -0
  19. vlm/train/04cII6MumYV/4.png +3 -0
  20. vlm/train/04cII6MumYV/5.png +3 -0
  21. vlm/train/04cII6MumYV/6.png +3 -0
  22. vlm/train/04cII6MumYV/7.png +3 -0
  23. vlm/train/04cII6MumYV/8.png +3 -0
  24. vlm/train/04cII6MumYV/9.png +3 -0
  25. vlm/train/HJf9ZhC9FX/0.png +3 -0
  26. vlm/train/HJf9ZhC9FX/1.png +3 -0
  27. vlm/train/HJf9ZhC9FX/10.png +3 -0
  28. vlm/train/HJf9ZhC9FX/11.png +3 -0
  29. vlm/train/HJf9ZhC9FX/12.png +3 -0
  30. vlm/train/HJf9ZhC9FX/13.png +3 -0
  31. vlm/train/HJf9ZhC9FX/14.png +3 -0
  32. vlm/train/HJf9ZhC9FX/15.png +3 -0
  33. vlm/train/HJf9ZhC9FX/16.png +3 -0
  34. vlm/train/HJf9ZhC9FX/17.png +3 -0
  35. vlm/train/HJf9ZhC9FX/2.png +3 -0
  36. vlm/train/HJf9ZhC9FX/3.png +3 -0
  37. vlm/train/HJf9ZhC9FX/4.png +3 -0
  38. vlm/train/HJf9ZhC9FX/5.png +3 -0
  39. vlm/train/HJf9ZhC9FX/6.png +3 -0
  40. vlm/train/HJf9ZhC9FX/7.png +3 -0
  41. vlm/train/HJf9ZhC9FX/8.png +3 -0
  42. vlm/train/HJf9ZhC9FX/9.png +3 -0
  43. vlm/train/HkGmDsR9YQ/0.png +3 -0
  44. vlm/train/HkGmDsR9YQ/1.png +3 -0
  45. vlm/train/HkGmDsR9YQ/10.png +3 -0
  46. vlm/train/HkGmDsR9YQ/11.png +3 -0
  47. vlm/train/HkGmDsR9YQ/12.png +3 -0
  48. vlm/train/HkGmDsR9YQ/13.png +3 -0
  49. vlm/train/HkGmDsR9YQ/2.png +3 -0
  50. vlm/train/HkGmDsR9YQ/3.png +3 -0
parse/train/o966_Is_nPA/o966_Is_nPA_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/o966_Is_nPA/o966_Is_nPA_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/o_V-MjyyGV_/o_V-MjyyGV_.md ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SELF-SUPERVISED POLICY ADAPTATION DURING DEPLOYMENT
2
+
3
+ Nicklas Hansen12, Rishabh Jangir13, Yu Sun4, Guillem Alenya\`3, Pieter Abbeel4, Alexei A Efros4, Lerrel Pinto5, Xiaolong Wang1 1UC San Diego 2Technical University of Denmark ${ } ^ { 3 } \mathrm { I R I }$ , CSIC-UPC 4UC Berkeley 5NYU
4
+
5
+ # ABSTRACT
6
+
7
+ In most real world scenarios, a policy trained by reinforcement learning in one environment needs to be deployed in another, potentially quite different environment. However, generalization across different environments is known to be hard. A natural solution would be to keep training after deployment in the new environment, but this cannot be done if the new environment offers no reward signal. Our work explores the use of self-supervision to allow the policy to continue training after deployment without using any rewards. While previous methods explicitly anticipate changes in the new environment, we assume no prior knowledge of those changes yet still obtain significant improvements. Empirical evaluations are performed on diverse simulation environments from DeepMind Control suite and ViZDoom, as well as real robotic manipulation tasks in continuously changing environments, taking observations from an uncalibrated camera. Our method improves generalization in 31 out of 36 environments across various tasks and outperforms domain randomization on a majority of environments.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep reinforcement learning (RL) has achieved considerable success when combined with convolutional neural networks for deriving actions from image pixels (Mnih et al., 2013; Levine et al., 2016; Nair et al., 2018; Yan et al., 2020; Andrychowicz et al., 2020). However, one significant challenge for real-world deployment of vision-based RL remains: a policy trained in one environment might not generalize to other new environments not seen during training. Already hard for RL alone, the challenge is exacerbated when a policy faces high-dimensional visual inputs.
12
+
13
+ A well explored class of solutions is to learn robust policies that are simply invariant to changes in the environment (Rajeswaran et al., 2016; Tobin et al., 2017; Sadeghi & Levine, 2016; Pinto et al., 2017b; Lee et al., 2019). For example, domain randomization (Tobin et al., 2017; Peng et al., 2018; Pinto et al., 2017a; Yang et al., 2019) applies data augmentation in a simulated environment to train a single robust policy, with the hope that the augmented environment covers enough factors of variation in the test environment. However, this hope may be difficult to realize when the test environment is truly unknown. With too much randomization, training a policy that can simultaneously fit numerous augmented environments requires much larger model and sample complexity. With too little randomization, the actual changes in the test environment might not be covered, and domain randomization may do more harm than good since the randomized factors are now irrelevant. Both phenomena have been observed in our experiments. In all cases, this class of solutions requires human experts to anticipate the changes before the test environment is seen. This cannot scale as more test environments are added with more diverse changes.
14
+
15
+ Instead of learning a robust policy invariant to all possible environmental changes, we argue that it is better for a policy to keep learning during deployment and adapt to its actual new environment. A naive way to implement this in RL is to fine-tune the policy in the new environment using rewards as supervision (Rusu et al., 2016; Kalashnikov et al., 2018; Julian et al., 2020). However, while it is relatively easy to craft a dense reward function during training (Gu et al., 2017; Pinto & Gupta, 2016), during deployment it is often impractical and may require substantial engineering efforts.
16
+
17
+ In this paper, we tackle an alternative problem setting in vision-based RL: adapting a pre-trained policy to an unknown environment without any reward. We do this by introducing self-supervision to obtain “free” training signal during deployment. Standard self-supervised learning employs auxiliary tasks designed to automatically create training labels using only the input data (see Section 2 for details). Inspired by this, our policy is jointly trained with two objectives: a standard RL objective and, additionally, a self-supervised objective applied on an intermediate representation of the policy network. During training, both objectives are active, maximizing expected reward and simultaneously constraining the intermediate representation through self-supervision. During testing / deployment, only the self-supervised objective (on the raw observational data) remains active, forcing the intermediate representation to adapt to the new environment.
18
+
19
+ We perform experiments both in simulation and with a real robot. In simulation, we evaluate on two sets of environments: DeepMind Control suite (Tassa et al., 2018) and the CRLMaze ViZDoom (Lomonaco et al., 2019; Wydmuch et al., 2018) navigation task. We evaluate generalization by testing in new environments with visual changes unknown during training. Our method improves generalization in 19 out of 22 test environments across various tasks in DeepMind Control suite, and in all considered test environments on CRLMaze. Besides simulations, we also perform Sim2Real transfer on both reaching and pushing tasks with a Kinova Gen3 robot. After training in simulation, we successfully transfer and adapt policies to 6 different environments, including continuously changing disco lights, on a real robot operating solely from an uncalibrated camera. In both simulation and real experiments, our approach outperforms domain randomization in most environments.
20
+
21
+ # 2 RELATED WORK
22
+
23
+ Self-supervised learning is a powerful way to learn visual representations from unlabeled data (Vincent et al., 2008; Doersch et al., 2015; Wang & Gupta, 2015; Zhang et al., 2016; Pathak et al., 2016; Noroozi & Favaro, 2016; Zhang et al., 2017; Gidaris et al., 2018). Researchers have proposed to use auxiliary data prediction tasks, such as undoing rotation (Gidaris et al., 2018), solving a jigsaw puzzle (Noroozi & Favaro, 2016), tracking (Wang et al., 2019), etc. to provide supervision in lieu of labels. In RL, the idea of learning visual representations and action at the same time has been investigated (Lange & Riedmiller, 2010; Jaderberg et al., 2016; Pathak et al., 2017; Ha & Schmidhuber, 2018; Yarats et al., 2019; Srinivas et al., 2020; Laskin et al., 2020; Yan et al., 2020). For example, Srinivas et al. (2020) use self-supervised contrastive learning techniques (Chen et al., 2020; Henaff ´ et al., 2019; Wu et al., 2018; He et al., 2020) to improve sample efficiency in RL by jointly training the self-supervised objective and RL objective. However, this has not been shown to generalize to unseen environments. Other works have applied self-supervision for better generalization across environments (Pathak et al., 2017; Ebert et al., 2018; Sekar et al., 2020). For example, Pathak et al. (2017) use a self-supervised prediction task to provide dense rewards for exploration in novel environments. While results on environment exploration from scratch are encouraging, how to transfer a trained policy (with extrinsic reward) to a novel environment remains unclear. Hence, these methods are not directly applicable to the proposed problem in our paper.
24
+
25
+ Generalization across different distributions is a central challenge in machine learning. In domain adaptation, target domain data is assumed to be accessible (Geirhos et al., 2018; Tzeng et al., 2017; Ganin et al., 2016; Gong et al., 2012; Long et al., 2016; Sun et al., 2019; Julian et al., 2020). For example, Tzeng et al. (2017) use adversarial learning to align the feature representations in both the source and target domain during training. Similarly, the setting of domain generalization (Ghifary et al., 2015; Li et al., 2018; Matsuura & Harada, 2019) assumes that all domains are sampled from the same meta distribution, but the same challenge remains and now becomes generalization across meta-distributions. Our work focuses instead on the setting of generalizing to truly unseen changes in the environment which cannot be anticipated at training time.
26
+
27
+ There have been several recent benchmarks in our setting for image recognition (Hendrycks & Dietterich, 2018; Recht et al., 2018; 2019; Shankar et al., 2019). For example, in Hendrycks & Dietterich (2018), a classifier trained on regular images is tested on corrupted images, with corruption types unknown during training; the method of Hendrycks et al. (2019) is proposed to improve robustness on this benchmark. Following similar spirit, in the context of RL, domain randomization (Tobin et al., 2017; Pinto et al., 2017a; Peng et al., 2018; Ramos et al., 2019; Yang et al., 2019; James et al., 2019) helps a policy trained in simulation to generalize to real robots. For example, Tobin et al. (2017); Sadeghi & Levine (2016) propose to render the simulation environment with random textures and train the policy on top. The learned policy is shown to generalize to real robot manipulation tasks. Instead of deploying a fixed policy, we train and adapt the policy to the new environment with observational data that is naturally revealed during deployment.
28
+
29
+ ![](images/57b2c63b42fbd5db91f946cce8e82fe594fcd240b2336a571da5151324e65062.jpg)
30
+ Figure 1. Left: Training before deployment. Observations are sampled from a replay buffer for off-policy methods and are collected during roll-outs for on-policy methods. We optimize the RL and self-supervised objectives jointly. Right: Policy adaptation during deployment. Observations are collected from the test environment online, and we optimize only the self-supervised objective.
31
+
32
+ Test-time adaptation for deep learning is starting to be used in computer vision (Shocher et al., 2017; 2018; Bau et al., 2019; Mullapudi et al., 2019; Sun et al., 2020; Wortsman et al., 2018). For example, Shocher et al. (2018) shows that image super-resolution can be learned at test time (from scratch) simply by trying to upsample a downsampled version of the input image. Bau et al. (2019) show that adapting the prior of a generative adversarial network to the statistics of the test image improves photo manipulation tasks. Our work is closely related to the test-time training method of Sun et al. (2020), which performs joint optimization of image recognition and self-supervised learning with rotation prediction (Gidaris et al., 2018), then uses the self-supervised objective to adapt the representation of individual images during testing. Instead of image recognition, we perform test-time adaptation for RL with visual inputs in an online fashion. As the agent interacts with an environment, we keep obtaining new observational data in a stream for training the visual representations.
33
+
34
+ # 3 METHOD
35
+
36
+ In this section, we describe our proposed Policy Adaptation during Deployment (PAD) approach. It can be implemented on top of any policy network and standard RL algorithm (both on-policy and off-policy) that can be described by minimizing some RL objective $J ( \theta )$ w.r.t. the collection of parameters $\theta$ using stochastic gradient descent.
37
+
38
+ # 3.1 NETWORK ARCHITECTURE
39
+
40
+ We design the network architecture to allow the policy and the self-supervised prediction to share features. For the collection of parameters $\theta$ of a given policy network $\pi$ , we split it sequentially into $\theta = \left( \theta _ { e } , \theta _ { a } \right)$ , where $\theta _ { e }$ collects the parameters of the feature extractor, and $\theta _ { a }$ is the head that outputs a distribution over actions. We define networks $\pi _ { e }$ with parameters $\theta _ { e }$ and $\pi _ { a }$ with parameters $\theta _ { a }$ such that $\pi ( \mathbf { s } ; \theta ) = \pi _ { a } ( \pi _ { e } ( \mathbf { s } ) )$ , where s represents an image observation. Intuitively, one can think of $\pi _ { e }$ as a feature extractor, and $\pi _ { a }$ as a controller based on these features. The goal of our method is to update $\pi _ { e }$ at test-time using gradients from a self-supervised task, such that $\pi _ { e }$ (and consequently $\pi _ { \theta }$ ) can generalize. Let $\pi _ { s }$ with parameters $\theta _ { s }$ be the self-supervised prediction head and its collection of parameters, and the input to $\pi _ { s }$ be the output of $\pi _ { e }$ (as illustrated in Figure 1). In this work, the self-supervised task is inverse dynamics prediction for control, and rotation prediction for navigation.
41
+
42
+ # 3.2 INVERSE DYNAMICS PREDICTION AND ROTATION PREDICTION
43
+
44
+ At each time step, we always observe a transition sequence in the form of $\left( \mathbf { s } _ { t } , \mathbf { a } _ { t } , \mathbf { s } _ { t + 1 } \right)$ , during both training and testing. Naturally, self-supervision can be derived from taking parts of the sequence and predicting the rest. An inverse dynamics model takes the states before and after transition, and predicts the action in between. In this work, the inverse dynamics model $\pi _ { s }$ operates on the feature space extracted by $\pi _ { e }$ . We can write the inverse dynamics prediction objective formally as
45
+
46
+ $$
47
+ L ( \theta _ { s } , \theta _ { e } ) = \ell \big ( \mathbf { a } _ { t } , \pi _ { s } ( \pi _ { e } ( \mathbf { s } _ { t } ) , \pi _ { e } ( \mathbf { s } _ { t + 1 } ) ) \big ) .
48
+ $$
49
+
50
+ For continuous actions, $\ell$ is the mean squared error between the ground truth and the model output. For discrete actions, the output is a soft-max distribution over the action space, and $\ell$ is the crossentropy loss. Empirically, we find this self-supervised task to be most effective with continuous actions, possibly because inverse dynamics prediction in a small space of discrete actions is not as challenging. Note that we predict the inverse dynamics instead of the forward dynamics, because when operating in feature space, the latter can produce trivial solutions such as the constant zero feature for every state2. If we instead performed prediction with forward dynamics in pixel space, the task would be extremely challenging given the large uncertainty in pixel prediction.
51
+
52
+ As an alternative self-supervised task, we use rotation prediction (Gidaris et al., 2018). We rotate an image by one of 0, 90, 180 and 270 degrees as input to the network, and cast this as a four-way classification problem to determine which one of these four ways the image has been rotated. This task is shown to be effective for learning representations for object configuration and scene structure, which is beneficial for visual recognition (Hendrycks et al., 2019; Doersch & Zisserman, 2017).
53
+
54
+ # 3.3 TRAINING AND TESTING
55
+
56
+ Before deployment of the policy, because we have signals from both the reward and self-supervised auxiliary task, we can train with both in the fashion of multi-task learning. This corresponds to the following optimization problem during training $\begin{array} { r } { \operatorname* { m i n } _ { \theta _ { a } , \theta _ { s } , \theta _ { e } } J ( \theta _ { a } , \theta _ { e } ) + \alpha L ( \theta _ { s } , \theta _ { e } ) } \end{array}$ , where $\alpha > 0$ is a trade-off hyperparameter. During deployment, we cannot optimize $J$ anymore since the reward is unavailable, but we can still optimize $L$ to update both $\theta _ { s }$ and $\theta _ { e }$ . Empirically, we find only negligible difference with keeping $\theta _ { s }$ fixed at test-time, so we update both since the gradients have to be computed regardless; we ablate this decision in appendix C. As we obtain new images from the stream of visual inputs in the environment, $\theta$ keeps being updated until the episode ends. This corresponds to, for each iteration $t = 1 . . . T$ :
57
+
58
+ $$
59
+ \begin{array} { r l } & { \quad \mathbf s _ { t } \sim p ( \mathbf s _ { t } | \mathbf a _ { t - 1 } , \mathbf s _ { t - 1 } ) } \\ & { \quad \theta _ { s } ( t ) = \theta _ { s } ( t - 1 ) - \nabla _ { \theta _ { s } } L ( \mathbf s _ { t } ; \theta _ { s } ( t - 1 ) , \theta _ { e } ( t - 1 ) ) } \\ & { \quad \theta _ { e } ( t ) = \theta _ { e } ( t - 1 ) - \nabla _ { \theta _ { e } } L ( \mathbf s _ { t } ; \theta _ { s } ( t - 1 ) , \theta _ { e } ( t - 1 ) ) } \\ & { \quad \mathbf a _ { t } = \pi ( \mathbf s _ { t } ; \theta ( t ) ) \mathrm { ~ w i t h ~ } \theta ( t ) = ( \theta _ { e } ( t ) , \theta _ { a } ) , } \end{array}
60
+ $$
61
+
62
+ where $\theta _ { s } ( 0 ) = \theta _ { s } , \theta _ { e } ( 0 ) = \theta _ { e }$ , $\mathbf { s } _ { 0 }$ is the initial condition given by the environment, $\mathbf { a } _ { 0 } = \pi _ { \theta } ( \mathbf { s } _ { 0 } )$ , $p$ is the unknown environment transition, and $L$ is the self-supervised objective as previously introduced.
63
+
64
+ # 4 EXPERIMENTS
65
+
66
+ In this work, we investigate how well an agent trained in one environment (denoted the training environment) generalizes to unseen and diverse test environments. During evaluation, agents have no access to reward signals and are expected to generalize without trials nor prior knowledge about the test environments. In simulation, we evaluate our method (PAD) and baselines extensively on continuous control tasks from DeepMind Control (DMControl) suite (Tassa et al., 2018) as well as the CRLMaze (Lomonaco et al., 2019) navigation task, and experiment with both stationary (colors, objects, textures, lighting) and non-stationary (videos) environment changes. We further show that PAD transfers from simulation to a real robot and successfully adapts to environmental differences during deployment in two robotic manipulation tasks. Samples from DMControl and CRLMaze environments are shown in Figure 2, and samples from the robot experiments are shown in Figure 4. Implementation is available at https://nicklashansen.github.io/PAD/.
67
+
68
+ Network details. For DMControl and the robotic manipulation tasks we implement PAD on top of Soft Actor-Critic (SAC) (Haarnoja et al., 2018), and adopt both network architecture and hyperparameters from Yarats et al. (2019), with minor modifications: the feature extractor $\pi _ { e }$ has 8 convolutional layers shared between the RL head $\pi _ { a }$ and self-supervised head $\pi _ { s }$ , and we split the network into architecturally identical heads following $\pi _ { e }$ . Each head consists of 3 convolutional layers followed by 4 fully connected layers. For CRLMaze, we use Advantage Actor-Critic (A2C) as base algorithm (Mnih et al., 2016) and apply the same architecture as for the other experiments, but implement $\pi _ { e }$ with only 6 convolutional layers. Observations are stacks of $k$ colored frames $k = 3$ on DMControl and CRLMaze; $k = 1$ in robotic manipulation) of size $1 0 0 \times 1 0 0$ and time-consistent random crop is applied as in Srinivas et al. (2020). During deployment, we optimize the self-supervised objective online w.r.t. $\theta _ { e } , \theta _ { s }$ for one gradient step per time iteration. See appendix F for implementation details.
69
+
70
+ ![](images/bc62cee880a17c8b0b2832092fcc074bd1b01dcd8fb62086e20850e09ae21b15.jpg)
71
+ Figure 2. Left: Training environments of DMControl (top) and CRLMaze (bottom). Right: Test environments of DMControl (top) and CRLMaze (bottom). Changes to DMControl include randomized colors, video backgrounds, and distractors; changes to CRLMaze include textures and lighting.
72
+
73
+ Table 1. Episodic return in test environments with randomized colors, mean and std. dev. for 10 seeds. Best method on each task is in bold and blue compares $\mathrm { S A C + I D M }$ with and without PAD.
74
+
75
+ 10x episode length
76
+
77
+ <table><tr><td>Random colors</td><td>SAC</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td><td>+IDM</td><td>+IDM (PAD)</td></tr><tr><td>Walker, walk</td><td>414±74</td><td>594±104</td><td>406±29</td><td>468±47</td><td>3830±547</td><td>5505±592</td></tr><tr><td>Walker, stand</td><td>719±74</td><td>715±96</td><td>743±37</td><td>797±46</td><td>7832±209</td><td>8566±121</td></tr><tr><td>Cartpole, swingup</td><td>592±50</td><td>647±48</td><td>585±73</td><td>630±63</td><td>6528±539</td><td>7093±592</td></tr><tr><td>Cartpole,balance</td><td>857±60</td><td>867±37</td><td>835±40</td><td>848±29</td><td>7746±526</td><td>7670±293</td></tr><tr><td>Ball in cup,catch</td><td>411±183</td><td>470±252</td><td>471±75</td><td>563±50</td><td></td><td></td></tr><tr><td>Finger, spin</td><td>626±163</td><td>465±314</td><td>757±62</td><td>803±72</td><td>7249±642</td><td>7496±655</td></tr><tr><td>Finger, turn_easy</td><td>270±43</td><td>167±26</td><td>283±51</td><td>304±46</td><td>1</td><td></td></tr><tr><td>Cheetah, run</td><td>154±41</td><td>145±29</td><td>121±38</td><td>159±28</td><td>1117±530</td><td>1208±487</td></tr><tr><td>Reacher, easy</td><td>163±45</td><td>105±37</td><td>201±32</td><td>214±44</td><td>1788±441</td><td>2152±506</td></tr></table>
78
+
79
+ # 4.1 DEEPMIND CONTROL
80
+
81
+ DeepMind Control (DMControl) (Tassa et al., 2018) is a collection of continuous control tasks where agents only observe raw pixels. Generalization benchmarks on DMControl represent diverse real-world tasks for motor control, and contain distracting surroundings not correlated with the reward signals.
82
+
83
+ Experimental setup. We experiment with 9 tasks from DMControl and measure generalization to four types of test environments: (i) randomized colors; (ii) natural videos as background; (iii) distracting objects placed in the scene; and (iv) the unmodified training environment. For each test environment, we evaluate methods across 10 seeds and 100 random initializations. If a given test environment is not applicable to certain tasks, e.g. if a task has no background for the video background setting, they are excluded. Tasks are selected on the basis of diversity, as well as the success of vision-based RL in prior work (Yarats et al., 2019; Srinivas et al., 2020; Laskin et al., 2020; Kostrikov et al., 2020). We implement PAD on top of SAC and use an Inverse Dynamics Model (IDM) for self-supervision, as we find that learning a model of the dynamics works well for motor control. For completeness, we ablate the choice of self-supervision. Learning curves are provided in appendix B.
84
+
85
+ ![](images/1d57abcc32301ede5d2b8455a03059fd30b9cd73bdc63abef544626395d0fffc.jpg)
86
+ Figure 3. Relative improvement in instantaneous reward over time for PAD on the random color env.
87
+
88
+ We compare our method to the following baselines: (i) SAC with no changes (denoted $S A C$ ); (ii) SAC trained with domain randomization on a fixed set of 100 colors (denoted $+ D R$ ); and (iii) SAC trained jointly with an IDM but without PAD (denoted $+ I D M )$ ). Our method using an IDM with PAD is denoted by $+ I D M \left( P A D \right)$ . For domain randomization, colors are sampled from the same distribution as in evaluation, but with lower variance, as we find that training directly on the test distribution does not converge.
89
+
90
+ Random perturbation of color. Robustness to subtle changes such as color is essential to realworld deployment of RL policies. We evaluate generalization on a fixed set of 100 colors of foreground, background and the agent itself, and report the results in Table 1 (first 4 columns). We find PAD to improve generalization in all tasks considered, outperforming SAC trained with domain randomization in 6 out of 9 tasks. Surprisingly, despite a substantial overlap between training and test domains of domain randomization, it generalizes no better than vanilla SAC on a majority of tasks.
91
+
92
+ Long-term stability. We find the relative improvement of PAD to improve over time, as shown in Figure 3. To examine the long-term stability of PAD, we further evaluate on $1 0 \mathrm { x }$ episode lengths and summarize the results in the last two columns in Table 1 (goal-oriented tasks excluded). While we do not explicitly prevent the embedding from drifting away from the RL task, we find empirically that PAD does not degrade the performance of the policy, even over long horizons, and when PAD does not improve, we find it to hurt minimally. We conjecture this is because we are not learning a new task, but simply continue to optimize the same (self-supervised) objective as during joint training, where both two tasks are compatible. In this setting, PAD still improves generalization in 6 out of 7 tasks, and thus naturally extends beyond episodic deployment. For completeness, we also evaluate methods in the environment in which they were trained, and report the results in appendix A. We find that, while PAD improves generalization to novel environments, performance is virtually unchanged on the training environment. We conjecture this is because the self-supervised task is already fully learned and any continued training on the same data distribution thus has little impact.
93
+
94
+ Non-stationary environments. To investigate whether PAD can adapt in non-stationary environments, we evaluate generalization to diverse video backgrounds (refer to Figure 2). We find PAD to outperform all baselines on 7 out of 8 tasks, as shown in Table 2, by as much as $104 \%$ over domain randomization on Finger, spin. Domain randomization generalizes comparably worse to videos, which we conjecture is not because the environments are non-stationary, but rather because the image statistics of videos are not covered by its training domain of randomized colors. In fact, domain randomization is outperformed by the vanilla SAC in most tasks with video back
95
+
96
+ Table 2. Episodic return in test environments with video backgrounds (top) and distracting objects (bottom), mean and std. dev. for 10 seeds. Best method on each task is in bold and blue compares $\mathrm { S A C + I D M }$ with and without PAD.
97
+
98
+ <table><tr><td>Video backgrounds</td><td>SAC</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td></tr><tr><td>Walker, walk</td><td>616±80</td><td>655±55</td><td>694±85</td><td>717±79</td></tr><tr><td>Walker, stand</td><td>899±53</td><td>869±60</td><td>902±51</td><td>935±20</td></tr><tr><td>Cartpole, swingup</td><td>375±90</td><td>485±67</td><td>487±90</td><td>521±76</td></tr><tr><td>Cartpole, balance</td><td>693±109</td><td>766±92</td><td>691±76</td><td>687±58</td></tr><tr><td>Ball in cup, catch</td><td>393±175</td><td>271±189</td><td>362±69</td><td>436±55</td></tr><tr><td>Finger, spin</td><td>447±102</td><td>338±207</td><td>605±61</td><td>691±80</td></tr><tr><td>Finger, turn_easy</td><td>355±108</td><td>223±91</td><td>355±110</td><td>362±101</td></tr><tr><td>Cheetah, run</td><td>194±30</td><td>150±34</td><td>164±42</td><td>206±34</td></tr><tr><td>Distracting objects</td><td>SAC</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td></tr><tr><td>Cartpole, swingup</td><td>815±60</td><td>809±24</td><td>776±58</td><td>771±64</td></tr><tr><td>Cartpole,balance</td><td>969±20</td><td>938±35</td><td>964±26</td><td>960±29</td></tr><tr><td>Ball in cup, catch</td><td>177±111</td><td>331±189</td><td>482±128</td><td>545±173</td></tr><tr><td>Finger, spin</td><td>652±184</td><td>564±288</td><td>836±62</td><td>867±72</td></tr><tr><td>Finger, turn_easy</td><td>302±68</td><td>165±12</td><td>326±101</td><td>347±48</td></tr></table>
99
+
100
+ grounds, which is in line with the findings of Packer et al. (2018).
101
+
102
+ Scene content. We hypothesize that: (i) an agent trained with an IDM is comparably less distracted by scene content since objects uncorrelated to actions yield no predictive power; and (ii) that PAD can adapt to unexpected objects in the scene. We test these hypotheses by measuring robustness to colored shapes at a variety of positions in both the foreground and background of the scene (no physical interaction). Results are summarized in Table 2. PAD outperforms all baselines in 3 out of 5 tasks, with a relative improvement of $20 \%$ over SAC on Ball in cup, catch. In the two cartpole tasks in which PAD does not improve, all methods are already relatively unaffected by the distractors.
103
+
104
+ Choice of self-supervised task. We investigate how much the choice of self-supervised task contributes to the overall success of our method, and consider the following ablations: (i) replacing inverse dynamics with the rotation prediction task described in Section 3.2; and (ii) replacing it with the recently proposed CURL (Srinivas et al., 2020) contrastive learning algorithm for RL. As shown in Table 3, PAD improves generalization of CURL in a majority of tasks on the randomized color benchmark, and in 4 out of 9 tasks using rotation prediction. However, inverse dynamics as auxiliary task produces more consistent results and offers better generalization overall. We argue that learning an IDM produces better representations for motor control since it connects observations directly to actions, whereas CURL and rotation prediction operates purely on observations. In general, we find the improvement of PAD to be bigger in tasks that benefit significantly from visual information (see appendix A), and conjecture that selecting a self-supervised task that learns features useful to the RL task is crucial to the success of PAD, which we discuss further in Section 4.2.
105
+
106
+ Table 3. Ablations on the randomized color domain of DMC. All methods use SAC. CURL represents RL with a contrastive learning task (Srinivas et al., 2020) and Rot represents the rotation prediction (Gidaris et al., 2018). Offline PAD is here denoted O-PAD for brevity, whereas the default usage of PAD is in an online setting. Best method is in bold and blue compares $+ \mathrm { I D M }$ w/ and w/o PAD.
107
+
108
+ <table><tr><td>Random colors</td><td>CURL</td><td>CURL (PAD)</td><td>Rot</td><td>Rot (PAD)</td><td>IDM</td><td>IDM (O-PAD)</td><td>IDM (PAD)</td></tr><tr><td>Walker, walk</td><td>445±99</td><td>495±70</td><td>335±7</td><td>330±30</td><td>406±29</td><td>441±16</td><td>468±47</td></tr><tr><td>Walker, stand</td><td>662±54</td><td>753±49</td><td>673±4</td><td>653±27</td><td>743±37</td><td>727±21</td><td>797±46</td></tr><tr><td>Cartpole, swingup</td><td>454±110</td><td>413±67</td><td>493±52</td><td>477±38</td><td>585±73</td><td>578±69</td><td>630±63</td></tr><tr><td>Cartpole,balance</td><td>782±13</td><td>763±5</td><td>710±72</td><td>734±81</td><td>835±40</td><td>796±37</td><td>848±29</td></tr><tr><td>Ball in cup, catch</td><td>231±92</td><td>332±78</td><td>291±54</td><td>314±60</td><td>471±75</td><td>490±16</td><td>563±50</td></tr><tr><td>Finger, spin</td><td>691±12</td><td>588±22</td><td>695±36</td><td>689±20</td><td>757±62</td><td>767±43</td><td>803±72</td></tr><tr><td>Finger, turn_easy</td><td>202±32</td><td>186±2</td><td>283±68</td><td>230±53</td><td>283±51</td><td>321±10</td><td>304±46</td></tr><tr><td>Cheetah, run</td><td>202±22</td><td>211±20</td><td>127±3</td><td>135±12</td><td>121±38</td><td>112±35</td><td>159±28</td></tr><tr><td>Reacher, easy</td><td>325±32</td><td>378±62</td><td>99±29</td><td>120±7</td><td>201±32</td><td>241±24</td><td>214±44</td></tr></table>
109
+
110
+ Table 4. Episodic return of PAD and baselines in CRLMaze environments. PAD improves generalization in all considered environments and outperforms both A2C and domain randomization by a large margin. All methods use A2C. We report mean and std. error of 10 seeds. Best method in each environment is in bold and blue compares rotation prediction with and without PAD.
111
+
112
+ <table><tr><td>CRLMaze</td><td>Random</td><td>A2C</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td><td>+Rot</td><td>+Rot (PAD)</td></tr><tr><td>Walls</td><td>-870±30</td><td>-380±145</td><td>-260±137</td><td>-302±150</td><td>-428±135</td><td>-206±166</td><td>-74±116</td></tr><tr><td>Floor</td><td>-868±23</td><td>-320±167</td><td>-438±59</td><td>-47±198</td><td>-530±106</td><td>-294±123</td><td>-209±94</td></tr><tr><td>Ceiling</td><td>-872±30</td><td>-171±175</td><td>-400±74</td><td>166±215</td><td>-508±104</td><td>128±196</td><td>281±83</td></tr><tr><td>Lights</td><td>-900±29</td><td>-30±213</td><td>-310±106</td><td>239±270</td><td>-460±114</td><td>-84±53</td><td>312±104</td></tr></table>
113
+
114
+ Offline versus online learning. Observations that arrive sequentially are highly correlated, and we thus hypothesize that our method benefits significantly from learning online. To test this hypothesis, we run an offline variant of our method in which network updates are forgotten after each step. In this setting, our method can only adapt to single observations and does not benefit from learning over time. Results are shown in Table 3. We find that our method benefits substantially from online learning, but learning offline still improves generalization on select tasks.
115
+
116
+ # 4.2 CRLMAZE
117
+
118
+ CRLMaze (Lomonaco et al., 2019) is a time-constrained, discrete-action 3D navigation task for ViZDoom (Wydmuch et al., 2018), in which an agent is to navigate a maze and collect objects. There is a positive reward associated with green columns, and a negative reward for lanterns as well as for living. Readers are referred to the respective papers for details on the task and environment.
119
+
120
+ Experimental setup. We train agents on a single environment and measure generalization to environments with novel textures for walls, floor, and ceiling, as well as lighting, as shown in Figure 2. We implement PAD on top of A2C (Mnih et al., 2016) and use rotation prediction (see Section 3.2) as self-supervised task. Learning to navigate novel scenes requires a generalized scene understanding, and we find that rotation prediction facilitates that more so than an IDM. We compare to the following baselines: (i) a random agent (denoted Random); (ii) A2C with no changes (denoted $A 2 C$ ); (iii) A2C trained with domain randomization (denoted $+ D R$ ); (iv) A2C with an IDM as auxiliary task (denoted $+ I D M )$ ; and (v) A2C with rotation prediction as auxiliary task (denoted $+ R o t )$ . We denote Rot with PAD as $+ R o t \ ( P A D )$ . Domain randomization uses 56 combinations of diverse textures, partially overlapping with the test distribution, and we find it necessary to train domain randomization for twice as many episodes in order to converge. We closely follow the evaluation procedure of (Lomonaco et al., 2019) and evaluate methods across 20 starting positions and 10 random seeds.
121
+
122
+ Results. We report performance on the CRLMaze environments in Table 4. PAD improves generalization in all considered test environments, outperforming both A2C and domain randomization by a large margin. Domain randomization performs consistently across all environments but is less successful overall. We further examine the importance of selecting appropriate auxiliary tasks by a simple ablation: replacing rotation prediction with an IDM for the navigation task. We conjecture that, while an auxiliary task can enforce structure in the learned representations, its features (and consequently gradients) need to be sufficiently correlated with the primary RL task for PAD to be
123
+
124
+ ![](images/7a75facacf5c2ac9f0591865730aa213a149b2aae09f6d5a1610fc3b0f899d74.jpg)
125
+ (a) Simulation. (b) Default transfer. (c) Table cloth. (d) Disco lights.
126
+
127
+ Figure 4. Samples from the push robotic manipulation task. The task is to push the yellow cube to the location of the red disc. Agents are trained in setting (a) and evaluated in settings (b-d).
128
+
129
+ successful during deployment. While PAD with rotation prediction improves generalization across all test environments considered, IDM does not, which suggests that rotation prediction is more suitable for tasks that require scene understanding, whereas IDM is useful for tasks that require motor control. We leave it to future work to automate the process of selecting appropriate auxiliary tasks.
130
+
131
+ # 4.3 ROBOTIC MANIPULATION TASKS
132
+
133
+ We deploy our method and baselines on a real Kinova Gen3 robot and evaluate on two manipulation tasks: (i) reach, a task in which the robot reaches for a goal marked by a red disc; and (ii) push, a task in which the robot pushes a cube to the location of the red disc. Both tasks use an XY action space, where the Z position of the actuator is fixed. Agents operate purely from pixel observations with no access to state information. During deployment, we make no effort to calibrate camera, lighting, or
134
+
135
+ Table 5. Success rate of PAD and baselines on a real robotic arm. Best method in each environment is in bold and blue compares $+ \mathrm { I D M }$ with and without PAD.
136
+
137
+ <table><tr><td>Real robot</td><td>SAC</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td></tr><tr><td>Reach (default)</td><td>100%</td><td>100%</td><td>100%</td><td>100%</td></tr><tr><td>Reach (cloth)</td><td>48%</td><td>80%</td><td>56%</td><td>80%</td></tr><tr><td>Reach (disco)</td><td>72%</td><td>76%</td><td>88%</td><td>92%</td></tr><tr><td>Push (default)</td><td>88%</td><td>88%</td><td>92%</td><td>100%</td></tr><tr><td>Push (cloth)</td><td>60%</td><td>64%</td><td>64%</td><td>88%</td></tr><tr><td>Push (disco)</td><td>60%</td><td>68%</td><td>72%</td><td>84%</td></tr></table>
138
+
139
+ physical properties such as dimensions, mass, and friction, and policies are expected to generalize with no prior knowledge of the test environment. Samples from the push task are shown in Figure 4, and samples from reach are shown in appendix E.
140
+
141
+ Experimental setup. We implement PAD on top of SAC (Haarnoja et al., 2018) and apply the same experimental setup as in Section 4.1 using an Inverse Dynamics Model (IDM) for self-supervision, but without frame-stacking (i.e. $k = 1$ ). Agents are trained in simulation with dense rewards and randomized initial configurations of arm, goal, and box, and we measure generalization to 3 novel environments in the real-world: (i) default environment with pixel observations that roughly mimic the simulation; (ii) a patterned table cloth that
142
+
143
+ Table 6. Success rate of PAD and baselines for the push task on a simulated robotic arm in test environments with changes to dynamics. Changes include object mass, size, and friction, arm mount position, and end effector velocity. Best method in each environment is in bold and blue compares $+ \mathrm { I D M }$ with and without PAD.
144
+
145
+ <table><tr><td>Simulated robot</td><td>SAC</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td></tr><tr><td>Push (object)</td><td>66%</td><td>64%</td><td>72%</td><td>82%</td></tr><tr><td>Push (mount)</td><td>68%</td><td>58%</td><td>86%</td><td>84%</td></tr><tr><td>Push (velocity)</td><td>70%</td><td>68%</td><td>70%</td><td>78%</td></tr><tr><td>Push (all)</td><td>56%</td><td>50%</td><td>48%</td><td>76%</td></tr></table>
146
+
147
+ distracts visually and greatly increases friction; and (iii) disco, an environment with non-stationary visual disco light distractions. Notably, all 3 environments also feature subtle differences in dynamics compared to the training environment, such as object dimensions, mass, friction, and uncalibrated actions. In each setting, we evaluate the success rate across 25 test runs spanning across 5 pre-defined goal locations throughout the table. The goal locations vary between the two tasks, and the robot is reset after each run. We perform comparison against direct transfer and domain randomization baselines as in Section 4.1. We further evaluate generalization to changes in dynamics by considering a variant of the simulated environment in which object mass, size, and friction, arm mount position, and end effector velocity is modified. We consider each setting both individually and jointly, and evaluate success rate across 50 unique configurations with the robot reset after each run.
148
+
149
+ Results. We report transfer results in Table 5. While all methods transfer successfully to reach (default), we observe PAD to improve generalization in all settings in which the baselines show sub-optimal performance. We find PAD to be especially powerful for the push task that involves dynamics, improving by as much as $24 \%$ in push (cloth). While domain randomization proves highly effective in reach (cloth), we observe no significant benefit in the other settings, which suggests that PAD can be more suitable in challenging tasks like push. To isolate the effect of dynamics, we further evaluate generalization to a number of simulated changes in dynamics on the push task. Results are shown in Table 6. We find PAD to improve generalization to changes in the physical properties of the object and end effector, whereas both $S A C { + } I D M$ and PAD are relatively unaffected by changes to the mount position. Consistent with the real robot results in Section 5, PAD is found to be most effective when changes in dynamics are non-trivial, improving by as much as $28 \%$ in the push (all) setting, where all 3 environmental changes are considered jointly. These results suggest that PAD can be a simple, yet effective method for generalization to diverse, unseen environments that vary in both visuals and dynamics.
150
+
151
+ # 5 CONCLUSION
152
+
153
+ While previous work addresses generalization in RL by learning policies that are invariant to any environment changes that can be anticipated, we formulate an alternative problem setting in visionbased RL: can we instead adapt a pretrained-policy to new environments without any reward. We propose Policy Adaptation during Deployment, a self-supervised framework for online adaptation at test-time, and show empirically that our method improves generalization of policies to diverse simulated and real-world environmental changes across a variety of tasks. We find our approach benefits greatly from learning online, and we systematically evaluate how the choice of self-supervised task impacts performance. While the current framework relies on prior knowledge on selecting selfsupervised tasks for policy adaptation, we see our work as the initial step in addressing the problem of adapting vision-based policies to unknown environments. We ultimately envision embodied agents in the future to be learning all the time, with the flexibility to learn both with and without rewards, before and during deployment.
154
+
155
+ Acknowledgements. This work was supported, in part, by grants from DARPA, NSF 1730158 CI-New: Cognitive Hardware and Software Ecosystem Community Infrastructure (CHASE-CI), NSF ACI-1541349 CC\*DNI Pacific Research Platform, and gifts from Qualcomm and TuSimple. This work was also funded, in part, by grants from Berkeley DeepDrive, SAP and European Research Council (ERC) from the European Union Horizon 2020 Programme under grant agreement no. 741930 (CLOTHILDE). We would like to thank Fenglu Hong and Joey Hejna for helpful discussions.
156
+
157
+ # REFERENCES
158
+
159
+ OpenAI: Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. The International Journal of Robotics Research, 39(1):3–20, 2020. 1
160
+ David Bau, Hendrik Strobelt, William Peebles, Jonas Wulff, Bolei Zhou, Jun-Yan Zhu, and Antonio Torralba. Semantic photo manipulation with a generative image prior. ACM Trans. Graph., 38(4), 2019. ISSN 0730-0301. 3
161
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations, 2020. 2
162
+ Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2051–2060, 2017. 4
163
+ Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1422–1430, 2015. 2
164
+ Frederik Ebert, Chelsea Finn, Sudeep Dasari, Annie Xie, Alex Lee, and Sergey Levine. Visual foresight: Model-based deep reinforcement learning for vision-based robotic control, 2018. 2
165
+
166
+ Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016. 2
167
+
168
+ Robert Geirhos, Carlos R. Medina Temme, Jonas Rauber, Heiko H. Schutt, Matthias Bethge, and ¨ Felix A. Wichmann. Generalisation in humans and deep neural networks. In NeurIPS, 2018. 2
169
+
170
+ Muhammad Ghifary, W. Bastiaan Kleijn, Mengjie Zhang, and David Balduzzi. Domain generalization for object recognition with multi-task autoencoders. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), ICCV ’15, pp. 2551–2559. IEEE Computer Society, 2015. ISBN 9781467383912. 2
171
+
172
+ Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations, 2018. 2, 3, 4, 7
173
+
174
+ Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pp. 2066–2073. IEEE, 2012. 2
175
+
176
+ Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In 2017 IEEE international conference on robotics and automation (ICRA), pp. 3389–3396. IEEE, 2017. 1
177
+
178
+ David Ha and Jurgen Schmidhuber. Recurrent world models facilitate policy evolution. In ¨ Advances in Neural Information Processing Systems 31, pp. 2451–2463. Curran Associates, Inc., 2018. 2
179
+
180
+ Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications, 2018. 4, 8, 17
181
+
182
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020. 2
183
+
184
+ Dan Hendrycks and Thomas G. Dietterich. Benchmarking neural network robustness to common corruptions and surface variations. arXiv: Learning, 2018. 2
185
+
186
+ Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. ArXiv, abs/1906.12340, 2019. 2, 4
187
+
188
+ Olivier J. Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, S. M. Ali Eslami, and ´ Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding, 2019. 2
189
+
190
+ Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks, 2016. 2
191
+
192
+ Stephen James, Paul Wohlhart, Mrinal Kalakrishnan, D. Kalashnikov, A. Irpan, J. Ibarz, S. Levine, Raia Hadsell, and Konstantinos Bousmalis. Sim-to-real via sim-to-sim: Data-efficient robotic grasping via randomized-to-canonical adaptation networks. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 12619–12629, 2019. 2
193
+
194
+ R. Julian, B. Swanson, G. Sukhatme, Sergey Levine, Chelsea Finn, and Karol Hausman. Never stop learning: The effectiveness of fine-tuning in robotic reinforcement learning. arXiv: Learning, 2020. 1, 2, 15
195
+
196
+ D. Kalashnikov, A. Irpan, P. Pastor, J. Ibarz, A. Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, V. Vanhoucke, and S. Levine. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. ArXiv, abs/1806.10293, 2018. 1
197
+
198
+ Ilya Kostrikov, Denis Yarats, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. 2020. 5, 17
199
+
200
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. 17
201
+
202
+ Sascha Lange and Martin A. Riedmiller. Deep auto-encoder neural networks in reinforcement learning. In The 2010 International Joint Conference on Neural Networks (IJCNN), pp. 1–8, 2010. 2
203
+
204
+ Michael Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. arXiv preprint arXiv:2004.14990, 2020. 2, 5, 17
205
+
206
+ Kimin Lee, Kibok Lee, Jinwoo Shin, and Honglak Lee. A simple randomization technique for generalization in deep reinforcement learning. ArXiv, abs/1910.05396, 2019. 1
207
+
208
+ Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
209
+
210
+ Ya Feng Li, Mingming Gong, Xinmei Tian, Tongliang Liu, and Dacheng Tao. Domain generalization via conditional invariant representations. In AAAI, 2018. 2
211
+
212
+ Vincenzo Lomonaco, Karen Desai, Eugenio Culurciello, and Davide Maltoni. Continual reinforcement learning in 3d non-stationary environments. arXiv preprint arXiv:1905.10112, 2019. 2, 4, 7, 16, 17
213
+
214
+ Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. In Advances in Neural Information Processing Systems, pp. 136–144, 2016. 2
215
+
216
+ Toshihiko Matsuura and Tatsuya Harada. Domain generalization using a mixture of multiple latent domains, 2019. 2
217
+
218
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. 1
219
+
220
+ Volodymyr Mnih, Adria Puigdom \` enech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim \` Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning, 2016. 4, 7, 17
221
+
222
+ Ravi Teja Mullapudi, Steven Chen, Keyi Zhang, Deva Ramanan, and Kayvon Fatahalian. Online model distillation for efficient video inference. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Oct 2019. doi: 10.1109/iccv.2019.00367. 3
223
+
224
+ Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Advances in Neural Information Processing Systems, pp. 9191–9200, 2018. 1
225
+
226
+ Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 2016. 2
227
+
228
+ Charles Packer, Katelyn Gao, Jernej Kos, Philipp Krahenb ¨ uhl, Vladlen Koltun, and Dawn Song. ¨ Assessing generalization in deep reinforcement learning, 2018. 6
229
+
230
+ Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2536–2544, 2016. 2
231
+
232
+ Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In ICML, 2017. 2
233
+
234
+ Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. 2018 IEEE International Conference on Robotics and Automation (ICRA), May 2018. 1, 2
235
+
236
+ Lerrel Pinto and Abhinav Gupta. Supersizing self-supervision: Learning to grasp from 50k tries and 700 robot hours. In 2016 IEEE international conference on robotics and automation (ICRA), pp. 3406–3413. IEEE, 2016. 1
237
+
238
+ Lerrel Pinto, Marcin Andrychowicz, Peter Welinder, Wojciech Zaremba, and Pieter Abbeel. Asymmetric actor critic for image-based robot learning. arXiv preprint arXiv:1710.06542, 2017a. 1, 2
239
+
240
+ Lerrel Pinto, James Davidson, Rahul Sukthankar, and Abhinav Gupta. Robust adversarial reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2817–2826. JMLR. org, 2017b. 1
241
+
242
+ Aravind Rajeswaran, Sarvjeet Ghotra, Balaraman Ravindran, and Sergey Levine. Epopt: Learning robust neural network policies using model ensembles. arXiv preprint arXiv:1610.01283, 2016. 1
243
+
244
+ Fabio Ramos, Rafael Possas, and Dieter Fox. Bayessim: Adaptive domain randomization via probabilistic inference for robotics simulators. Robotics: Science and Systems XV, Jun 2019. 2
245
+
246
+ Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do cifar-10 classifiers generalize to cifar-10? arXiv preprint arXiv:1806.00451, 2018. 2
247
+
248
+ Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? arXiv preprint arXiv:1902.10811, 2019. 2
249
+
250
+ Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. 1
251
+
252
+ Fereshteh Sadeghi and Sergey Levine. Cad2rl: Real single-image flight without a single real image. arXiv preprint arXiv:1611.04201, 2016. 1, 2
253
+
254
+ Ramanan Sekar, Oleh Rybkin, Kostas Daniilidis, Pieter Abbeel, Danijar Hafner, and Deepak Pathak. Planning to explore via self-supervised world models, 2020. 2
255
+
256
+ Vaishaal Shankar, Achal Dave, Rebecca Roelofs, Deva Ramanan, Benjamin Recht, and Ludwig Schmidt. A systematic framework for natural perturbations from videos. arXiv preprint arXiv:1906.02168, 2019. 2
257
+
258
+ Assaf Shocher, Nadav Cohen, and Michal Irani. Zero-shot super-resolution using deep internal learning, 2017. 3
259
+
260
+ Assaf Shocher, Shai Bagon, Phillip Isola, and Michal Irani. Ingan: Capturing and remapping the ”dna” of a natural image, 2018. 3
261
+
262
+ Aravind Srinivas, Michael Laskin, and Pieter Abbeel. Curl: Contrastive unsupervised representations for reinforcement learning. arXiv preprint arXiv:2004.04136, 2020. 2, 4, 5, 6, 7, 17
263
+
264
+ Yu Sun, Eric Tzeng, Trevor Darrell, and Alexei A Efros. Unsupervised domain adaptation through self-supervision. arXiv preprint, 2019. 2
265
+
266
+ Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. ICML, 2020. 3
267
+
268
+ Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–9, 2015. 17
269
+
270
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. DeepMind control suite. Technical report, DeepMind, January 2018. 2, 4, 5, 16, 17
271
+
272
+ 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. 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Sep 2017. 1, 2
273
+
274
+ Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7167–7176, 2017. 2
275
+
276
+ Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103. ACM, 2008. 2
277
+
278
+ Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In ICCV, 2015. 2
279
+
280
+ Xiaolong Wang, Allan Jabri, and Alexei A. Efros. Learning correspondence from the cycleconsistency of time. In CVPR, 2019. 2
281
+
282
+ Mitchell Wortsman, Kiana Ehsani, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. Learning to learn how to learn: Self-adaptive visual navigation using meta-learning, 2018. 3
283
+
284
+ Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3733–3742, 2018. 2
285
+
286
+ Marek Wydmuch, Michał Kempka, and Wojciech Jaskowski. Vizdoom competitions: Playing doom ´ from pixels. IEEE Transactions on Games, 2018. 2, 7, 16
287
+
288
+ Wilson Yan, Ashwin Vangipuram, Pieter Abbeel, and Lerrel Pinto. Learning predictive representations for deformable objects using contrastive estimation. arXiv preprint arXiv:2003.05436, 2020. 1, 2
289
+
290
+ Jiachen Yang, Brenden Petersen, Hongyuan Zha, and Daniel Faissol. Single episode policy transfer in reinforcement learning, 2019. 1, 2
291
+
292
+ Denis Yarats, Amy Zhang, Ilya Kostrikov, Brandon Amos, Joelle Pineau, and Rob Fergus. Improving sample efficiency in model-free reinforcement learning from images, 2019. 2, 4, 5, 17
293
+
294
+ Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pp. 649–666. Springer, 2016. 2
295
+
296
+ Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1058–1067, 2017. 2
297
+
298
+ # A PERFORMANCE ON THE TRAINING ENVIRONMENT
299
+
300
+ Historically, agents have commonly been trained and evaluated in the same environment when benchmarking RL algorithms exclusively in simulation. Although such an evaluation procedure does not consider generalization, it is still a useful metric for comparison of sample efficiency and stability of algorithms. For completeness, we also evaluate our method and baselines in this setting on both DMControl and CRLMaze. DMControl results are reported in Table 7 and results on the CRLMaze environment are shown in Table 8. In this setting, we also compare to an additional baseline on DMControl: a blind SAC agent that operates purely on its previous actions. The performance of a blind agent indicates to which degree a given task benefits from visual information. We find that, while PAD improves generalization to novel environments, performance is virtually unchanged when evaluated on the same environment as in training. We conjecture that this is because the algorithm already is adapted to the training environment and any continued training on the same data distribution thus has little influence. We further emphasize that, even when evaluated on the training environment, PAD still outperforms baselines on most tasks. For example, we observe a $15 \%$ relative improvement over SAC on the Finger, spin task. We hypothesize that this gain in performance is because the selfsupervised objective improves learning by constraining the intermediate representation of policies. A blind agent is no better than random on this particular task, which would suggest that agents benefit substantially from visual information in Finger, spin. Therefore, learning a good intermediate representation of that information is highly beneficial to the RL objective, which we find PAD to facilitate through its self-supervised learning framework. Likewise, the SAC baseline only achieves a $51 \%$ improvement over the blind agent on Cartpole, balance, which indicates that extracting visual information from observations is not as crucial on this task. Consequently, both PAD and baselines achieve similar performance on this task.
301
+
302
+ Table 7. Episodic return on the training environment for each of the 9 tasks considered in DMControl, mean and std. dev. for 10 seeds. Best method on each task is in bold and blue compares $+ \mathrm { I D M }$ with and without PAD. It is shown that PAD hurts minimally when the environment is unchanged.
303
+
304
+ <table><tr><td>Training env.</td><td>Blind</td><td>SAC</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td></tr><tr><td>Walker, walk</td><td>235±17</td><td>847±71</td><td>756±71</td><td>911±24</td><td>895±28</td></tr><tr><td>Walker, stand</td><td>388±10</td><td>959±11</td><td>928±36</td><td>966±8</td><td>956±20</td></tr><tr><td>Cartpole, swingup</td><td>132±41</td><td>850±28</td><td>807±36</td><td>849±30</td><td>845±34</td></tr><tr><td>Cartpole,balance</td><td>646±131</td><td>978±22</td><td>971±30</td><td>982±20</td><td>979±21</td></tr><tr><td>Ball in cup, catch</td><td>150±96</td><td>725±355</td><td>469±339</td><td>919±118</td><td>910±129</td></tr><tr><td>Finger, spin</td><td>3±2</td><td>809±138</td><td>686±295</td><td>928±45</td><td>927±45</td></tr><tr><td>Finger, turn_easy</td><td>172±27</td><td>462±146</td><td>243±124</td><td>462±152</td><td>455±160</td></tr><tr><td>Cheetah, run</td><td>264±75</td><td>387±74</td><td>195±46</td><td>384±88</td><td>380±91</td></tr><tr><td>Reacher, easy</td><td>107±11</td><td>264±113</td><td>92±45</td><td>390±126</td><td>365±114</td></tr></table>
305
+
306
+ Table 8. Episodic return of PAD and baselines in the CRLMaze training environment. All methods use A2C. We report mean and std. error of 10 seeds. Best method is in bold and blue compares rotation prediction with and without PAD.
307
+
308
+ <table><tr><td>CRLMaze</td><td>Random</td><td>A2C</td><td>+DR</td><td>+IDM</td><td>+IDM (PAD)</td><td>+Rot</td><td>+Rot (PAD)</td></tr><tr><td>Training env.</td><td>-868±34</td><td>371±198</td><td>-355±93</td><td>585±246</td><td>-416±135</td><td>729±148</td><td>681±99</td></tr></table>
309
+
310
+ # B LEARNING CURVES ON DEEPMIND CONTROL
311
+
312
+ All methods are trained until convergence (500,000 frames) on DMControl. While we do not consider the sample efficiency of our method and baselines in this study, we report learning curves for SAC, $\mathrm { S A C + I D M }$ and SAC trained with domain randomization on three tasks in Figure 5 for completeness. SAC trained with and without an IDM are similar in terms of sample efficiency and final performance, whereas domain randomization consistently displays worse sample efficiency, larger variation between seeds, and converges to sub-optimal performance in two out of the three tasks shown.
313
+
314
+ ![](images/9988caa8b9a55fc3afee7ef0f724429fd455ed6f365e57a9ccd860a250478099.jpg)
315
+ Figure 5. Learning curves for SAC, SAC trained with domain randomization (denoted $S A C ( D R )$ here), and $\mathrm { S A C + I D M }$ on three tasks from the DeepMind Control suite (DMControl). Episodic return is averaged across 10 seeds and the $9 5 \%$ confidence intervals are visualized as shaded regions. SAC and $\mathrm { S A C + I D M }$ exhibit similar sample efficiency and final performance, whereas domain randomization consistently displays worse sample efficiency, larger variation between seeds, and converges to sub-optimal performance in two out of the three tasks shown.
316
+
317
+ # C KEEPING $\pi _ { s }$ FIXED DURING POLICY ADAPTATION
318
+
319
+ We now consider a variant of PAD where the self-supervised task head $\pi _ { s }$ is fixed at test-time such that the self-supervised objective $L$ is optimized only wrt $\pi _ { e }$ , as discussed in Section 3.3. We measure generalization to test environments with randomized colors and report the results in Table 9 for three tasks from the DeepMind Control suite. We empirically find the difference between updating $\pi _ { s }$ and keeping it fixed negligible, and we choose to update $\pi _ { s }$ by default since its gradients are computed by back-propagation regardless.
320
+
321
+ Table 9. Episodic return in test environments with randomized colors, mean and std. dev. for 10 seeds. All methods use SAC. IDM (PAD, fixed $\pi _ { s . }$ ) considers a variant of PAD where $\pi _ { s }$ is fixed at test-time, whereas $I D M \left( P A D \right)$ denotes the default usage of PAD in which both $\pi _ { e }$ and $\pi _ { s }$ are optimized at test-time using the self-supervised objective.
322
+
323
+ <table><tr><td>Random colors</td><td>IDM</td><td>IDM (PAD, fixed π s)</td><td>IDM (PAD)</td></tr><tr><td>Walker, walk</td><td>406±29</td><td>452±38</td><td>468±47</td></tr><tr><td>Walker, stand</td><td>743±37</td><td>802±41</td><td>797±46</td></tr><tr><td>Cartpole, swingup</td><td>585±73</td><td>623±57</td><td>630±63</td></tr></table>
324
+
325
+ # D COMPARISON TO ADAPTATION WITH REWARDS
326
+
327
+ While our method does not require data collected prior to deployment and does not assume access to a reward signal, we additionally compare our method to a na¨ıve fine-tuning approach using transitions and rewards collected from the target environment prior to deployment. To fine-tune the pre-trained policy using rewards, we collect datasets consisting of 1, 10, and 100 episodes in each target environment using the learned policy while keeping its parameters fixed, and then subsequently fine-tune both $\pi _ { e }$ and $\pi _ { a }$ on the collected data, following the same training procedure as during the training phase. This fine-tuning approach is analogous to Julian et al. (2020) but does not use data from the original environment during adaptation. Results are shown in Table 10. We find that na¨ıvely fine-tuning the policy using data collected prior to deployment can improve generalization but requires comparably more data than PAD, as well as access to a reward signal in the target environment. This finding suggests that PAD may be a more suitable method for settings where data from the target environment is scarce and not easily accessible prior to deployment.
328
+
329
+ # E ADDITIONAL ROBOTIC MANIPULATION SAMPLES
330
+
331
+ Figure 6 provides samples from the training and test environments for the reach robotic manipulation task. Agents are trained in simulation and deployed on a real robot. Samples from the push task are shown in Figure 4.
332
+
333
+ Table 10. Episodic return in test environments with randomized colors, mean and std. dev. for 10 seeds. All methods use SAC trained with an inverse dynamics model (IDM) as auxiliary task. Our method is denoted IDM (PAD), and we compare to a na¨ıve fine-tuning approach that assumes access to transitions and rewards collected from 1, 10, and 100 episodes, respectively, from target environments prior to deployment.
334
+
335
+ Fine-tuning w/ rewards
336
+
337
+ <table><tr><td>Random colors</td><td>IDM</td><td>IDM (PAD)</td><td>1 episode</td><td>10 episodes</td><td>100 episodes</td></tr><tr><td>Walker, walk</td><td>406±29</td><td>468±47</td><td>395±78</td><td>489±104</td><td>561±62</td></tr><tr><td>Walker, stand</td><td>743±37</td><td>797±46</td><td>661±65</td><td>728±44</td><td>784±31</td></tr><tr><td>Cartpole, swingup</td><td>585±73</td><td>630±63</td><td>538±53</td><td>605±51</td><td>650±58</td></tr></table>
338
+
339
+ ![](images/bb8251dc060f2862ca990a7216bf7fd39204605009caf6d0e9e8d640e1c1e5a1.jpg)
340
+ Figure 6. Samples from the reach robotic manipulation task. The task is to move the robot gripper to the location of the red disc. Agents are trained in setting (a) and evaluated in settings (b-d) on a real robot, taking observations from an uncalibrated camera.
341
+
342
+ # F IMPLEMENTATION DETAILS
343
+
344
+ In this section, we elaborate on implementation details for our experiments on DeepMind Control (DMControl) suite (Tassa et al., 2018) and CRLMaze (Lomonaco et al., 2019) for ViZDoom (Wydmuch et al., 2018). Our implementation for the robotic manipulation experiments closely follows that of DMControl. Code is available at https://nicklashansen.github.io/PAD/.
345
+
346
+ ![](images/9e0be3b5d460fc2992f725ba0dd7adde3d5e70bc06c843e908bf8d4d2266f9a5.jpg)
347
+ Figure 7. Network architecture for the DMControl, CRLMaze, and robotic manipulation experiments. $\pi ^ { s }$ and $\pi ^ { a }$ uses a shared feature extractor $\pi ^ { e }$ . Observations are stacks of $1 0 0 \times 1 0 0$ colored frames. Implementation of policy and value function depends on the learning algorithm.
348
+
349
+ Architecture. Our network architecture is illustrated in Figure 7. Observations are stacked frames $k = 3 ,$ ) rendered at $1 0 0 \times 1 0 0$ and cropped to $8 4 \times 8 4$ , i.e. inputs to the network are of dimensions $9 \times 8 4 \times 8 4$ , where the first dimension indicates the channel numbers and the following ones represent spatial dimensions. The same crop is applied to all frames in a stack. The shared feature extractor $\pi ^ { e }$ consists of 8 (DMControl, robotic manipulation) or 6 (CRLMaze) convolutional layers and outputs features of size $3 2 \times 2 1 \times 2 1$ in DMControl and robotic manipulation, and size $3 2 \times 2 5 \times 2 5$ in CRLMaze. The output from $\pi ^ { e }$ is used as input to both the self-supervised head $\pi ^ { s }$ and RL head $\pi ^ { a }$ , both of which consist of 3 convolutional layers followed by 3 fully-connected layers. All convolutional layers use 32 filters and all fully connected layers use a hidden size of 1024, as in Yarats et al. (2019).
350
+
351
+ Table 11. Hyperparameters used for the DMControl (Tassa et al., 2018) tasks.
352
+
353
+ <table><tr><td>Hyperparameter</td><td>Value</td></tr><tr><td>Frame rendering</td><td>3 ×100×100</td></tr><tr><td>Frame after crop</td><td>3×84×84</td></tr><tr><td>Stacked frames</td><td>3</td></tr><tr><td>Action repeat</td><td>2 (finger)</td></tr><tr><td></td><td>8 (cartpole) 4(otherwise)</td></tr><tr><td>Discount factor y</td><td>0.99</td></tr><tr><td>Episode length</td><td>1,000</td></tr><tr><td>Learning algorithm</td><td>Soft Actor-Critic</td></tr><tr><td>Self-supervised task</td><td>Inverse Dynamics Model</td></tr><tr><td>Number of training steps</td><td>500,000</td></tr><tr><td>Replay buffer size</td><td>500,000</td></tr><tr><td>Optimizer(πe,πä,π)</td><td>Adam (β=0.9,β=0.999)</td></tr><tr><td>Optimizer (α)</td><td>Adam(β=0.5,β=0.999)</td></tr><tr><td>Learning rate (πe,π,π$)</td><td>3e-4 (cheetah)</td></tr><tr><td>Learning rate (α)</td><td>le-3 (otherwise) 1e-4</td></tr><tr><td>Batch size</td><td>128</td></tr><tr><td>Batch size (test-time)</td><td>32</td></tr><tr><td>πe,π update freq.</td><td>2</td></tr><tr><td>πe,π update freq. (test-time)</td><td>1</td></tr></table>
354
+
355
+ Table 12. Hyperparameters used for the CRLMaze (Lomonaco et al., 2019) navigation task.
356
+
357
+ <table><tr><td>Hyperparameter</td><td>Value</td></tr><tr><td>Frame rendering</td><td>3×100×100</td></tr><tr><td>Frame after crop</td><td>3×84×84</td></tr><tr><td>Stacked frames</td><td>3</td></tr><tr><td>Action repeat</td><td>4</td></tr><tr><td>Discount factor y</td><td>0.99</td></tr><tr><td>Episode length</td><td>1,000</td></tr><tr><td>Learning algorithm</td><td>Advantage Actor-Critic</td></tr><tr><td>Self-supervised task</td><td>Rotation Prediction</td></tr><tr><td>Number of training episodes</td><td>1,000 (dom. rand.) 500 (otherwise)</td></tr><tr><td>Number of processes</td><td>20</td></tr><tr><td>Optimizer</td><td>Adam (β=0.9,β=0.999)</td></tr><tr><td>Learning rate</td><td>1e-4</td></tr><tr><td>Learning rate (test-time)</td><td>1e-5</td></tr><tr><td>Batch size</td><td>20</td></tr><tr><td></td><td>32</td></tr><tr><td>Batch size (test-time) π,πloss coefficient</td><td>0.5</td></tr><tr><td></td><td>1</td></tr><tr><td>πe,πloss coefficient (test-time)</td><td>1</td></tr><tr><td>πe,π update freq. πe,π update freq.(test-time)</td><td>1</td></tr></table>
358
+
359
+ Learning algorithm. We use Soft Actor-Critic (SAC) (Haarnoja et al., 2018) for DMControl and robotic manipulation, and Advantage Actor-Critic (A2C) for CRLMaze. Network outputs depend on the task and learning algorithm. As the action spaces of both DMControl and robotic manipulation are continuous, the policy learned by SAC outputs the mean and variance of a Gaussian distribution over actions. CRLMaze has a discrete action space and the policy learned by A2C thus learns a soft-max distribution over actions. For details on the critics learned by SAC and A2C, the reader is referred to Haarnoja et al. (2018) and Mnih et al. (2016), respectively.
360
+
361
+ Hyperparameters. When applicable, we adopt our hyperparameters from Yarats et al. (2019) (DMControl, robotic manipulation) and Lomonaco et al. (2019) (CRLMaze). For the robotic manipulation experiments, our implementation closely follows that of DMControl, only differing by number of frames in an observation. We use a frame stack of $k = 3$ frames for DMControl and CRLMaze, and only $k = 1$ frame for robotic manipulation. For completeness, we detail all hyperparameters used for the DMControl and CRLMaze environments in Table 11 and Table 12.
362
+
363
+ Data augmentation. Random cropping is a commonly used data augmentation used in computer vision systems (Krizhevsky et al., 2012; Szegedy et al., 2015) but has only recently gained interest as a stochastic regularization technique in the RL literature (Srinivas et al., 2020; Kostrikov et al., 2020; Laskin et al., 2020). We adopt the random crop proposed in Srinivas et al. (2020): crop rendered observations of size $1 0 0 \times 1 0 0$ to $8 4 \times 8 4$ , applying the same crop to all frames in a stacked observation. This has the added benefits of regularization while still preserving spatio-temporal patterns between frames. When learning an inverse dynamics model, we apply the same crop to all frames of a given observation but apply two different crops to the consecutive observations $\left( \mathbf { s } _ { t } , \mathbf { s } _ { t + 1 } \right)$ used to predict action $\mathbf { a } _ { t }$ .
364
+
365
+ Policy Adaptation during Deployment. We evaluate our method and baselines by episodic return of an agent trained in a single environment and tested in a collection of test environments, each with distinct changes from the training environment. We assume no reward signal at test-time and agents are expected to generalize without pre-training or resetting in the new environment. Therefore, we make updates to the policy using a self-supervised objective, and we train using observations from the environment in an online manner without memory, i.e. we make one update per step using the most-recent observation.
366
+
367
+ Empirically, we find that: (i) the random crop data augmentation used during training helps regularize learning at test-time; and (ii) our algorithm benefits from learning from a batch of randomly cropped observations rather than single observations, even when all observations in the batch are augmented copies of the most-recent observation. As such, we apply both of these techniques when performing Policy Adaptation during Deployment and use a batch size of 32. When using the policy to take actions, however, inputs to the policy are simply center-cropped.
parse/train/o_V-MjyyGV_/o_V-MjyyGV__middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/pk4q0SD_r1X/pk4q0SD_r1X.md ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining
2
+
3
+ Yu Meng1∗, Chenyan Xiong2, Payal Bajaj2, Saurabh Tiwary2, Paul Bennett2, Jiawei Han1, Xia Song2
4
+
5
+ 1 University of Illinois at Urbana-Champaign 2 Microsoft 1 {yumeng5,hanj}@illinois.edu 2 {chenyan.xiong,payal.bajaj,satiwary, paul.n.bennett,xiaso}@microsoft.com
6
+
7
+ # Abstract
8
+
9
+ We present a self-supervised learning framework, COCO-LM, that pretrains Language Models by COrrecting and COntrasting corrupted text sequences. Following ELECTRA-style pretraining, COCO-LM employs an auxiliary language model to corrupt text sequences, upon which it constructs two new tasks for pretraining the main model. The first token-level task, Corrective Language Modeling, is to detect and correct tokens replaced by the auxiliary model, in order to better capture token-level semantics. The second sequence-level task, Sequence Contrastive Learning, is to align text sequences originated from the same source input while ensuring uniformity in the representation space. Experiments on GLUE and SQuAD demonstrate that COCO-LM not only outperforms recent state-of-the-art pretrained models in accuracy, but also improves pretraining efficiency. It achieves the MNLI accuracy of ELECTRA with $5 0 \%$ of its pretraining GPU hours. With the same pretraining steps of standard base/large-sized models, COCO-LM outperforms the previous best models by $1 +$ GLUE average points.
10
+
11
+ # 1 Introduction
12
+
13
+ Pretrained language models (PLMs) have reshaped the way AI systems process natural language [11, 36, 39, 40]. Before task-specific training, it is now a common practice to first pretrain the deep neural networks, often Transformers [53], via a self-supervised token-level language modeling task [29, 31, 40]. Whether it is autoregressive [39], permutational [62], or masked language modeling (MLM) [11], the Transformer networks are pretrained to recover some omitted tokens using the rest of input texts. Then the language semantics captured during pretraining are conveyed to downstream tasks via the pretrained Transformer parameters [5, 8, 44].
14
+
15
+ Recent research [14, 16, 25, 43] observed several challenges in this self-supervised learning framework. One challenge is its efficiency. After pretrained for a while with the standard token-level language modeling, the networks have already captured the basic language patterns, making a large fraction of pretraining signals no longer informative. Linear improvement in the model effectiveness often requires exponentially more pretraining compute and parameters [25], which is unsustainable. Another challenge is the anisotropy of text representations from pretrained models. The sequence representations from many pretrained models are quite irregular [30, 43] and require dedicated fine-tuning approaches to be useful in sequence-level applications [32, 60].
16
+
17
+ Clark et al. [7] proposed a new pretraining strategy, ELECTRA, that uses an auxiliary language model (“generator”) to replace tokens in input texts and pretrains the main Transformer (“discriminator”) to detect replaced tokens. This improves the pretraining efficiency and effectiveness, but pretraining via binary classification hinders the model’s usage on applications requiring language modeling capability (e.g., prompt-based learning [15, 28, 46]). It could further distort the representation space as the Transformers are pretrained to output the same “non-replacement” label for all actual tokens.
18
+
19
+ In this paper, we present a new self-supervised learning approach, COCO-LM, that pretrains Language Models by COrrecting and COntrasting corrupted text sequences. Following ELECTRA-style pretraining, COCO-LM employs an auxiliary model to corrupt the input texts, upon which it introduces two new pretraining tasks for the main Transformer, one at token level and one at sequence level. The token-level task, corrective language modeling (CLM), pretrains the main Transformer to detect and correct the tokens in the corrupted sequences. It uses a multi-task setup to combine the benefits of replaced token detection and language modeling. The sequence-level task, sequence contrastive learning (SCL), pretrains the model to align text sequences originated from the same source sequence and enforce uniformity of the representation space.
20
+
21
+ In our experiments on GLUE [54] and $\mathrm { S Q u A D }$ [41] benchmarks, COCO-LM not only outperforms state-of-the-art pretraining approaches in effectiveness, but also significantly improves the pretraining efficiency. Under the same setting, COCO-LM matches the MNLI accuracy of RoBERTa and ELECTRA with $6 0 \%$ and $5 0 \%$ of their GPU hours in pretraining, respectively. When pretrained with the same number of steps, COCO-LM outperforms the previous best models by $1 +$ GLUE average points under the standard base/large-sized model evaluations. With 367 million parameters, COCO$\mathrm { L M _ { L a r g e + + } }$ reaches the MNLI accuracy of Megatron3.9B [49], one of the largest BERT-style model with 3.9 billion parameters. Our analyses provide further insights on the advantage of CLM in learning token representations and its effectiveness in prompted-based fine-tuning, as well as the benefit of SCL in ensuring alignment and uniformity in the representation space for better generalization1.
22
+
23
+ # 2 Related Work
24
+
25
+ Various token-level tasks have been used to pretrain language models. The most classic auto-regressive language modeling is to predict a token given all the previous tokens, or all subsequent ones [36, 39]. BERT uses masked language modeling (MLM) that recovers randomly masked tokens using the rest input. XLNet proposes permutation language modeling that conducts MLM in an autoregressive manner [62]. UniLM uses pseudo MLM which unifies autoregressive and MLM tasks [1, 13].
26
+
27
+ Sequence-level tasks are also explored, which often pretrain the model to predict certain cooccurrences of sequence pairs. For example, next sentence prediction [11], sentence ordering [27] and previous sentence prediction [56] concatenate two sentences (either correlated or random), and train the Transformer to classify the pair.
28
+
29
+ Empirically, MLM is still among the most effective tasks to pretrain encoders [29, 31, 40]. RoBERTa [31] found the sentence-level task in BERT not benefitial and discarded it. BART [29] and T5 [40] both observed that MLM is often the most effective task. The empirical advantages of other pretraining tasks are more task-specific, for example, entity related masks for knowledge intensive applications [20, 24], and sequence-level tasks for long form text modeling [42].
30
+
31
+ Instead of randomly altering texts, ELECTRA [7] uses a smaller auxiliary Transformer pretrained by MLM to replace some tokens in the text sequences using its language modeling probability, and pretrains the main Transformer to detect the replaced tokens. ELECTRA achieves state-of-the-art accuracy in many language tasks [7]. Later, Clark et el. [6] developed ELECTRIC, which pretrains encoders by contrasting original tokens against negatives sampled from a cloze model. ELECTRIC re-enables the language modeling capability but underperforms ELECTRA in downstream tasks.
32
+
33
+ Our work is also related to contrastive learning which has shown great success in visual representation learning [4, 22, 34]. Its effectiveness of in language is more observed in the fine-tuning stage, for example, in sentence representation [16], dense retrieval [60], and GLUE fine-tuning [19].
34
+
35
+ # 3 Method
36
+
37
+ We present the preliminaries of PLMs, their challenges, and the new COCO-LM framework.
38
+
39
+ # 3.1 Preliminary on Language Model Pretraining
40
+
41
+ In this work we focus on pretraining BERT-style bidirectional Transformer encoders [11] that are widely used in language representation tasks. We first recap the masked language modeling (MLM) task introduced by BERT [11] and then discuss the pretraining framework of ELECTRA [7].
42
+
43
+ BERT Pretraining uses the masked language modeling task (MLM) [11], which is to take an input sequence $X ^ { \mathrm { o r i g } } = [ x _ { 1 } ^ { \mathrm { o r i g } } , \dotsc , x _ { i } ^ { \mathrm { o r i g } } , \dotsc , x _ { n } ^ { \mathrm { o r i g } } ]$ , with $1 5 \%$ random tokens replaced by [MASK] symbols (e.g., the $i$ -th token), and train the model to predict the original tokens at the masked positions:
44
+
45
+ $$
46
+ \left[ x _ { 1 } ^ { \mathrm { o r i g } } , \dots , \ [ \mathrm { M \AA S K } ] _ { i } , \dots , x _ { n } ^ { \mathrm { o r i g } } \right] \xrightarrow { \mathrm { T r a n s f o r m e r } } H \xrightarrow { \mathrm { M L M H e a d } } p _ { \mathrm { M L M } } ( x | h _ { i } ) ,
47
+ $$
48
+
49
+ where the Transformer generates contextualized representations ${ \pmb H } = \{ h _ { i } \} _ { i = 1 } ^ { n }$ . The MLM Head predicts the masked token from the vocabulary $V$ using the hidden representation $\boldsymbol { h } _ { i }$ and token embeddings $_ { \textbf { \em x } }$ . The pretraining minimizes the MLM loss on the set of masked positions $\mathcal { M }$ . Specifically,
50
+
51
+ $$
52
+ p _ { \mathrm { M L M } } ( x | h _ { i } ) = \frac { \exp ( x ^ { \top } h _ { i } ) } { \sum _ { x _ { t } \in V } \exp ( x _ { t } ^ { \top } h _ { i } ) } ; \quad \mathcal { L } _ { \mathrm { M L M } } = \mathbb { E } \left( - \sum _ { i \in \mathcal { M } } \log p _ { \mathrm { M L M } } \left( x _ { i } ^ { \mathrm { o r i g } } \middle | h _ { i } \right) \right) .
53
+ $$
54
+
55
+ ELECTRA Pretraining uses two Transformers, a “generator” pretrained by MLM, and a “discriminator” pretrained using the generator’s outputs. We refer them as auxiliary and main Transformers, as the former is discarded after pretraining and the latter may be trained by “generative” tasks too.
56
+
57
+ The auxiliary model outputs a corrupted sequence $X ^ { \mathrm { M L M } }$ by sampling from its predicted probability:
58
+
59
+ $$
60
+ x _ { i } ^ { \mathrm { M L M } } \sim p _ { \mathrm { M L M } } \left( x | h _ { i } \right) , \mathrm { i f } i \in \mathcal { M } ; \quad x _ { i } ^ { \mathrm { M L M } } = x _ { i } ^ { \mathrm { o r i g } } , \mathrm { e l s e } .
61
+ $$
62
+
63
+ The masked positions are replaced by sampled tokens considered plausible in context by the auxiliary Transformer, which are more deceiving than random replacements. ELECTRA uses a skinnier auxiliary network (e.g., hidden dimension is $1 / 3$ of the main model) to control the signal difficulty.
64
+
65
+ The main Transformer takes $X ^ { \mathrm { M L M } }$ and classifies the replaced tokens:
66
+
67
+ $$
68
+ \begin{array} { r } { X ^ { \mathrm { M L M } } \xrightarrow { \mathrm { M a i n ~ T r a n s f o r m e r } } \pmb { H } \xrightarrow { \mathrm { R T D ~ H e a d } } p _ { \mathrm { R T D } } \left( \mathbb { 1 } \big ( x _ { i } ^ { \mathrm { M L M } } = x _ { i } ^ { \mathrm { o r i g } } \big ) \big | h _ { i } \right) , } \end{array}
69
+ $$
70
+
71
+ where $\mathbb { 1 } ( \cdot )$ is the indicator function. The Replaced Token Detection (RTD) head uses a sigmoid linear layer to output the binary probability, and the main Transformer is trained with binary cross entropy loss. The RTD task is trained on all tokens instead of masked ones and improves efficiency.
72
+
73
+ The two Transformers are pretrained jointly. The auxiliary model gradually generates more realistic replacement tokens and the main model learns to better detect them. This forms a natural learning curriculum and significantly improves ELECTRA’s accuracy in downstream tasks [7].
74
+
75
+ # 3.2 Challenges of ELECTRA-Style Pretraining
76
+
77
+ Missing Language Modeling Benefits. The classification task in ELECTRA is simpler and more stable [61], but raises two challenges. The first is the lack of language modeling capability which is a necessity in some tasks [6]. For example, prompt-based learning requires a language model to generate labels [15, 33, 45, 46]. The second is that the binary classification task may not be sufficient to capture certain word-level semantics that are critical for token-level tasks.
78
+
79
+ Squeezing Representation Space. Another challenge is that the representations from Transformer-based language models often reside in a narrow cone, where two random sentences have high similarity scores (lack of uniformity),
80
+
81
+ ![](images/3a8c91a226e2aa036c614aa7d53c2b811d005dba76544c5617acff0d9b62c12a.jpg)
82
+ Figure 1: Cosine similarity distributions of random/similar sequence pairs using [CLS] embeddings from pretrained models. Histograms/curves are distribution bins/kernel density estimates.
83
+
84
+ and closely related sentences may have more different representations (lack of alignment) [14, 16, 30].
85
+
86
+ ![](images/88292be09312bfcedea184a72ece038e7b7b44db60e61df6cc39ca285f523c38.jpg)
87
+ Figure 2: The overview of COCO-LM. The auxiliary Transformer is pretrained by MLM. Its corrupted text sequence is used as the main Transformer’s pretraining input in Corrective Language Modeling and paired with the cropped original sequence for Sequence Contrastive Learning.
88
+
89
+ Figure 1 illustrates such behaviors with random sentence pairs (from pretraining corpus) and semantically similar pairs (those annotated with maximum similarity from STS-B [3]). With RoBERTa, the cosine similarities of most random sentence pairs are near 0.8, bigger than many semantically similar pairs. The representation space from ELECTRA is even more squeezed. Nearly all sentence pairs, both random and similar ones, have around 0.9 cosine similarity. This may not be surprising as ELECTRA is pretrained to predict the same output (“non-replacement”) for all tokens in these sequences. The irregular representation space raises the risk of degeneration [37, 55] and often necessitates sophisticated post-adjustment or fine-tuning to improve the sequence representations [16, 30, 32, 60].
90
+
91
+ # 3.3 COCO-LM Pretraining
92
+
93
+ COCO-LM also employs an auxiliary Transformer to construct the corrupted text sequence, as in Eqn. (1), but it introduces two new pretraining tasks upon the corrupted sequences to address the challenges previously described. In the rest of this section, we present these two tasks and then the detailed configurations of COCO-LM. Its framework is illustrated in Figure 2.
94
+
95
+ Corrective Language Modeling (CLM) trains the main Transformer to recover the original tokens, given the corrupted text sequence XMLM:
96
+
97
+ $$
98
+ \begin{array} { r } { X ^ { \mathrm { M L M } } \xrightarrow { \mathrm { M a i n ~ T r a n s f o r m e r } } H \xrightarrow { \mathrm { C L M H e a d } } p _ { \mathrm { C L M } } ( x | h _ { i } ) . } \end{array}
99
+ $$
100
+
101
+ The CLM Head uses the hidden representations $\pmb { H }$ to output a language modeling probability, instead of a binary classification score. The forward pass of the CLM Head is the same as All-Token MLM, a variation of ELECTRA [7] that consists of a language modeling layer and a binary classification layer for the copy mechanism:
102
+
103
+ $$
104
+ \begin{array} { r l } & { p _ { \mathrm { L M } } ( x _ { i } | h _ { i } ) = \mathbb { 1 } \left( x _ { i } = x _ { i } ^ { \mathrm { M L M } } \right) p _ { \mathrm { c o p y } } ( 1 | h _ { i } ) + p _ { \mathrm { c o p y } } ( 0 | h _ { i } ) \frac { \exp ( x _ { i } ^ { \top } h _ { i } ) } { \sum _ { x _ { t } \in V } \exp ( x _ { t } ^ { \top } h _ { i } ) } , } \\ & { p _ { \mathrm { c o p y } } ( y _ { i } | h _ { i } ) = \exp ( y _ { i } \cdot w _ { \mathrm { c o p y } } ^ { \top } h _ { i } ) / \left( \exp ( w _ { \mathrm { c o p y } } ^ { \top } h _ { i } ) + 1 \right) , } \end{array}
105
+ $$
106
+
107
+ where ${ \pmb w } _ { \mathrm { c o p y } }$ is a learnable weight and $p _ { \mathrm { c o p y } } ( y _ { i } | h _ { i } )$ is the copy mechanism ( $y _ { i } = 1$ when the input token is original and can be directly copied to the output; $y _ { i } = 0$ when the input token needs to be corrected to another token from the vocabulary).
108
+
109
+ In ELECTRA, All-Token MLM performs worse than RTD [7]. Language modeling on the corrupted text sequence $X ^ { \mathrm { M L M } }$ is hard as the replaced tokens from the auxiliary model are more deceiving than [MASK]. To improve the language model learning, different from All-Token MLM, CLM employs a
110
+
111
+ multi-task setup that combines the RTD task to explicitly train the copy mechanism $p _ { \mathrm { c o p y } } ( \cdot )$
112
+
113
+ $$
114
+ \begin{array} { l } { \mathcal { L } _ { \mathrm { c o p y } } = - \mathbb { E } \left( \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { 1 } \left( x _ { i } ^ { \mathrm { M L M } } = x _ { i } ^ { \mathrm { o r i g } } \right) \log p _ { \mathrm { c o p y } } ( 1 | h _ { i } ) + \mathbb { 1 } \left( x _ { i } ^ { \mathrm { M L M } } \neq x _ { i } ^ { \mathrm { o r i g } } \right) \log p _ { \mathrm { c o p y } } ( 0 | h _ { i } ) \right) , \mathrm { ~ } \forall i \mathrm { ~ c o p y ~ } ( \mathbb { E } ) , } \\ { \mathcal { L } _ { \mathrm { L M } } = - \mathbb { E } \left( \displaystyle \sum _ { i \in \mathcal { M } } \log p _ { \mathrm { L M } } \left( x _ { i } ^ { \mathrm { o r i g } } | h _ { i } \right) \right) } \\ { \displaystyle \qquad = - \mathbb { E } \left( \displaystyle \sum _ { i \in \mathcal { M } } \log \left( \mathbb { 1 } \left( x _ { i } ^ { \mathrm { M L M } } = x _ { i } ^ { \mathrm { o r i g } } \right) p _ { \mathrm { c o p y } } ^ { \mathrm { s g } } ( 1 | h _ { i } ) + p _ { \mathrm { c o p y } } ^ { \mathrm { s g } } ( 0 | h _ { i } ) \frac { \exp ( x _ { i } ^ { \top } h _ { i } ) } { \sum _ { x _ { t } \in V } \exp ( x _ { t } ^ { \top } h _ { i } ) } \right) \right) , \mathrm { ~ } } \\ { \mathcal { L } _ { \mathrm { C L M } } = \lambda _ { \mathrm { c o p y } } \mathcal { L } _ { \mathrm { c o p y } } + \mathcal { L } _ { \mathrm { L M } } . } \end{array}
115
+ $$
116
+
117
+ The hyperparameter $\lambda _ { \mathrm { c o p y } }$ balances the weights of the two tasks. The binary cross entropy loss in Eqn. (2) explicitly trains the copy probability. We also use stop gradient (sg) to decouple the gradient backpropagation to $p _ { \mathrm { c o p y } } ( \cdot )$ from the LM task. This way, the main Transformer first learns the easier classification task and then uses it to help learn the harder LM task. The binary classification task is trained on all tokens while the language modeling task is trained only on masked positions.
118
+
119
+ CLM combines the advantages of MLM and ELECTRA: The main Transformer is trained on all tokens with the help of the binary classification task while also being able to predict words, thus enjoying the efficiency benefits of ELECTRA and preserving the language modeling benefits.
120
+
121
+ Sequence Contrastive Learning (SCL) forms a contrastive learning objective upon the sequence embeddings to learn more robust representations. Broadly, contrastive learning is to align a positive pair of instances, often different views of the same information [4, 34], in contrast to unrelated negative instances [22, 60]. The different views are often obtained by applying data augmentations on the same input, for example, rotation, cropping, and blurring on visual representations [4, 34], so that the neural networks can learn representations robust to these data alterations.
122
+
123
+ In COCO-LM, the corrupted sequence $X ^ { \mathrm { M L M } }$ already provides a form of data augmentation. We pair it with another augmentation, $X ^ { \mathrm { c r o p } }$ , a randomly cropped contiguous span of $X ^ { \mathrm { o r i g } }$ (the length of $X ^ { \mathrm { c r o p } }$ is $9 0 \%$ of $X ^ { \mathrm { o r i g } }$ so that the major sequence meaning is preserved), to construct the positive pair and to contrast with random negatives.
124
+
125
+ Specifically, a training batch $B$ in SCL includes a random set of corrupted and cropped sequences: 1contrastive pair $B = \{ ( X _ { 1 } ^ { \mathrm { M L M } } , X _ { 1 } ^ { \mathrm { c r o p } } ) , \dots , ( X _ { N } ^ { \mathrm { M L M } } , X _ { N } ^ { \mathrm { c r o p } } ) \}$ $( X , X ^ { + } )$ N N consists of either $( X _ { k } ^ { \mathrm { M L M } } , X _ { k } ^ { \mathrm { c r o p } } )$ , with $X _ { k } ^ { \mathrm { M L M } }$ and or $X _ { k } ^ { \mathrm { c r o p } }$ $( \ddot { X } _ { k } ^ { \mathrm { c r o p } } , X _ { k } ^ { \mathrm { M L M } } )$ originated from $X _ { k } ^ { \mathrm { o r i g } }$ . A positive trast). The negative instances are all the remaining sequences in the batch $\ddot { B } ^ { - } = B \setminus \{ ( X , X ^ { + } ) \}$ contrastive loss is formulated as:
126
+
127
+ $$
128
+ \begin{array} { r l r } { { \mathcal { L } _ { \mathrm { S C L } } = - \mathbb { E } ( \log \frac { \exp ( \cos ( s , s ^ { + } ) / \tau ) } { \exp ( \cos ( s , s ^ { + } ) / \tau ) + \sum _ { X ^ { - } \in B ^ { - } } \exp ( \cos ( s , s ^ { - } ) / \tau ) } ) , } } \\ & { } & { = - \mathbb { E } ( \cos ( s , s ^ { + } ) / \tau - \log ( \exp ( \cos ( s , s ^ { + } ) / \tau ) + \sum _ { X ^ { - } \in B ^ { - } } \exp ( \cos ( s , s ^ { - } ) / \tau ) ) ) , } \end{array}
129
+ $$
130
+
131
+ where $s , s ^ { + } , s ^ { - }$ are the representations of $X , X ^ { + } , X ^ { - }$ , respectively, from the main Transformer (i.e., $\boldsymbol { h } _ { \mathrm { [ C L S ] } } ,$ ). The similarity metric is cosine similarity (cos) and the temperature $\tau$ is set to $1$ .
132
+
133
+ As shown in Wang et al. [55], the first term in Eqn. (3) $( \cos ( s , s ^ { + } ) )$ improves alignment of the space. It encourages representations to be robust to the corruptions and the alterations on the original text. The second term in Eqn. (3) promotes uniformity. It pushes unrelated sequences apart in the representation space and ensures low cosine similarity between random data points. Several studies have observed improved generalization ability from better alignment and uniformity [16, 37, 55].
134
+
135
+ Aligning $X ^ { \mathrm { M L M } }$ with $X ^ { \mathrm { c r o p } }$ requires the main Transformer to produce sequence representations robust to both token-level (i.e., MLM replacements) and sequence-level (i.e., cropping) alterations. The model is thus encouraged to reason more using partially altered sequences to recover the original information.
136
+
137
+ Overall Training. COCO-LM uses the following loss function:
138
+
139
+ $$
140
+ \mathcal { L } _ { \mathrm { C O C O - L M } } = \mathcal { L } _ { \mathrm { M L M } } ^ { \mathrm { A u x . } } + \mathcal { L } _ { \mathrm { C L M } } ^ { \mathrm { M a i n } } + \mathcal { L } _ { \mathrm { S C L } } ^ { \mathrm { M a i n } } .
141
+ $$
142
+
143
+ The auxiliary Transformer is pretrained by masked language modeling (MLM) and generates corrupted sequences. The main Transformer is pretrained to correct the corruption (CLM) and to contrast the corrupted sequences with the cropped sequences (SCL). The two Transformers are pretrained jointly with the loss in Eqn. (4). The main Transformer is used in downstream applications.
144
+
145
+ Network Configurations. Similar to ELECTRA, the auxiliary Transformer is smaller than the main model, but we use different configurations in the auxiliary model: (1) We reduce the number of layers to $1 / 3$ or $1 / 4$ (under base or large model setup, respectively) but keep its hidden dimension the same with the main model, instead of shrinking its hidden dimensions; (2) We disable dropout in it when sampling replacement tokens. We find such configurations empirically more effective and use them as the backbone of COCO-LM. The main Transformer follows the standard architecture of BERT/ELECTRA and can be easily adopted by downstream application pipelines with almost no changes.
146
+
147
+ # 4 Experimental Setup
148
+
149
+ Pretraining Settings. We employ three standard settings, base, base $^ { + + }$ , and large $^ { + + }$ . Base is the $\mathbf { B E R T _ { B a s e } }$ training configuration [11]: Pretraining on Wikipedia and BookCorpus [63] (16 GB of texts) for 256 million samples on 512 token sequences (125K batches with 2048 batch size). We use the same corpus and 32, 768 uncased BPE vocabulary [47] as with TUPE [26].
150
+
151
+ $B a s e + +$ trains the base size model with larger corpora and/or more training steps. Following recent research [1, 31, 62], we add in OpenWebText [18], CC-News [31], and STORIES [52], to a total of 160 GB texts, and train for 4 billion (with 2048 batch size) samples [31]. We follow the prepossessing of UniLMV2 [1] and use 64, 000 cased BPE vocabulary.
152
+
153
+ $L a r g e { + + }$ uses the same training corpora as $b a s e + +$ and pretrains for 4 billion samples (2048 batch size). Its Transformer configuration is the same with BERTLarge [11].
154
+
155
+ Model Architecture. Our base/base $^ { + + }$ model uses the $\mathbf { B E R T _ { B a s e } }$ architecture [11]: 12 layer Transformer, 768 hidden size, plus T5 relative position encoding [40]. Our large $^ { + + }$ model is the same with $\mathrm { B E R T _ { L a r g e } }$ , 24 layer and 1024 hidden size, plus T5 relative position encoding [40]. Our auxiliary network uses the same hidden size but a shallow 4-layer Transformer in base/base $^ { + + }$ and a 6-layer one in $l a r g e + +$ . When generating $X ^ { \mathrm { M L M } }$ we disable dropout in the auxiliary model.
156
+
157
+ Downstream Tasks. We use the tasks included in GLUE [54] and $\mathrm { S Q u A D } 2 . 0$ reading compression [41]. Please refer to Appendix A for more details about GLUE tasks. Standard hyperparameter search in fine-tuning is performed, and the search space can be found in Appendix B. The fine-tuning protocols use the open-source implementation of TUPE [26]. The reported results are the median of five random seeds on GLUE and SQuAD.
158
+
159
+ Baselines. We compare with various pretrained models in each setting. To reduce the variance in data processing/environments, we also pretrain and fine-tune RoBERTa and ELECTRA under exactly the same setting with COCO-LM, marked with “(Ours)”. All numbers unless marked by “(Ours)” are from reported results in recent research (more details in Appendix C).
160
+
161
+ Implementation Details. Our implementation builds upon the open-source implementation from MC-BERT [61] and fairseq [35]. More implementation details are mentioned in Appendix D.
162
+
163
+ # 5 Evaluation Results
164
+
165
+ Three groups of experiments are conducted to evaluate COCO-LM and its two new pretraining tasks.
166
+
167
+ # 5.1 Overall Results and Ablations
168
+
169
+ Overall Results are listed in Table 1. Under all three settings, COCO-LM outperforms all recent state-of-the-art pretraining models on GLUE average and SQuAD. It improves the state-of-the-art GLUE score by about one point under all three settings. COCO-LM also enjoys better parameter efficiency. Using less than $1 0 \%$ of Megatron’s parameters, $\mathrm { C O C O - L M _ { L a r g e + + } }$ matches the MNLI accuracy of Megatron3.9B, one of the largest pretrained BERT-style encoders.
170
+
171
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Params</td><td colspan="9">GLUE Single Task</td><td colspan="2">SQuAD 2.0</td></tr><tr><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>RTE</td><td>MRPC</td><td>STS-B</td><td>AVG</td><td>EM</td><td>F1</td></tr><tr><td colspan="10">Base Setting: BERT Base Size,Wikipedia + Book Corpus (16GB)</td><td></td><td></td><td></td></tr><tr><td>BERT[11]</td><td>110M</td><td>84.5/-</td><td>91.3</td><td>91.7</td><td>93.2</td><td>58.9</td><td>68.6</td><td>87.3</td><td>89.5</td><td>83.1</td><td>73.7</td><td>76.3</td></tr><tr><td>RoBERTa [31]</td><td>125M</td><td>84.7/-</td><td>1</td><td>1</td><td>92.7</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td></td><td>79.7</td></tr><tr><td>XLNet [62]</td><td>110M</td><td>85.8/85.4</td><td>1</td><td>1</td><td>92.7</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>78.5</td><td>81.3</td></tr><tr><td>ELECTRA [7]</td><td>110M</td><td>86.0/85.3</td><td>90.0</td><td>91.9</td><td>93.4</td><td>64.3</td><td>70.8</td><td>84.9</td><td>89.1</td><td>83.7</td><td>80.5</td><td>83.3</td></tr><tr><td>MC-BERT [61]</td><td>110M</td><td>85.7/85.2</td><td>89.7</td><td>91.3</td><td>92.3</td><td>62.1</td><td>75.0</td><td>86.0</td><td>88.0</td><td>83.7</td><td></td><td></td></tr><tr><td>DeBERTa [23]</td><td>134M</td><td>86.3/86.2</td><td>二</td><td>一</td><td>一</td><td>一</td><td>一</td><td>一</td><td>一</td><td></td><td>79.3</td><td>82.5</td></tr><tr><td>TUPE [26]</td><td>110M</td><td>86.2/86.2</td><td>91.3</td><td>92.2</td><td>93.3</td><td>63.6</td><td>73.6</td><td>89.9</td><td>89.2</td><td>84.9</td><td>1</td><td>1</td></tr><tr><td>RoBERTa (Ours)</td><td>110M</td><td>85.8/85.5</td><td>91.3</td><td>92.0</td><td>93.7</td><td>60.1</td><td>68.2</td><td>87.3</td><td>88.5</td><td>83.3</td><td>77.7</td><td>80.5</td></tr><tr><td>ELECTRA (Ours)</td><td>110M</td><td>86.9/86.7</td><td>91.9</td><td>92.6</td><td>93.6</td><td>66.2</td><td>75.1</td><td>88.2</td><td>89.7</td><td>85.5</td><td>79.7</td><td>82.6</td></tr><tr><td>COCO-LM</td><td>110M</td><td>88.5/88.3</td><td>92.0</td><td>93.1</td><td>93.2</td><td>63.9</td><td>84.8</td><td>91.4</td><td>90.3</td><td>87.2</td><td>82.4</td><td>85.2</td></tr><tr><td colspan="10">Base++ Seting: BERT Base Size,Bigger Training Data,and/or More Training Steps</td><td></td><td></td><td></td></tr><tr><td>XLNet [62]</td><td>110M</td><td>86.8/-</td><td>91.4</td><td>91.7</td><td>94.7</td><td>60.2</td><td>74.0</td><td>88.2</td><td>89.5</td><td>84.6</td><td>80.2</td><td></td></tr><tr><td>RoBERTa [31]</td><td>125M</td><td>87.6/-</td><td>91.9</td><td>92.8</td><td>94.8</td><td>63.6</td><td>78.7</td><td>90.2</td><td>91.2</td><td>86.4</td><td>80.5</td><td>83.7</td></tr><tr><td>UniLMV2[1]</td><td>110M</td><td>88.5/-</td><td>91.7</td><td>93.5</td><td>95.1</td><td>65.2</td><td>81.3</td><td>91.8</td><td>91.0</td><td>87.1</td><td>83.3</td><td>86.1</td></tr><tr><td>DeBERTa [23]</td><td>134M</td><td>88.8/88.5</td><td>一</td><td>一</td><td>一</td><td>1</td><td>一</td><td>一</td><td>一</td><td></td><td>83.1</td><td>86.2</td></tr><tr><td>CLEAR [59]</td><td>110M</td><td>86.7/-</td><td>90.0</td><td>92.9</td><td>94.5</td><td>64.3</td><td>78.3</td><td>89.2</td><td>89.8</td><td>85.7</td><td>一</td><td>1</td></tr><tr><td>COCO-LM</td><td>134M</td><td>90.2/90.0</td><td>92.2</td><td>94.2</td><td>94.6</td><td>67.3</td><td>87.4</td><td>91.2</td><td>91.8</td><td>88.6</td><td>85.4</td><td>88.1</td></tr><tr><td colspan="10">Large++ Setting: BERTLarge Size,Bigger Training Data,and More Training Steps</td><td></td><td></td><td></td></tr><tr><td>XLNet [62]</td><td>360M</td><td>90.8/90.8</td><td>92.3</td><td>94.9</td><td>97.0</td><td>69.0</td><td>85.9</td><td>90.8</td><td>92.5</td><td>89.2</td><td>87.9</td><td>90.6</td></tr><tr><td>RoBERTa [31]</td><td>356M</td><td>90.2/90.2</td><td>92.2</td><td>94.7</td><td>96.4</td><td>68.0</td><td>86.6</td><td>90.9</td><td>92.4</td><td>88.9</td><td>86.5</td><td>89.4</td></tr><tr><td>ELECTRA[7]</td><td>335M</td><td>90.9/-</td><td>92.4</td><td>95.0</td><td>96.9</td><td>69.1</td><td>88.0</td><td>90.8</td><td>92.6</td><td>89.4</td><td>88.0</td><td>90.6</td></tr><tr><td>DeBERTa [23]</td><td>384M</td><td>91.1/91.1</td><td>92.3</td><td>95.3</td><td>96.8</td><td>70.5</td><td>1</td><td>1</td><td>1</td><td>1</td><td>88.0</td><td>90.7</td></tr><tr><td>COCO-LM</td><td>367M</td><td>91.4/91.6</td><td>92.8</td><td>95.7</td><td>96.9</td><td>73.9</td><td>91.0</td><td>92.2</td><td>92.7</td><td>90.8</td><td>88.2</td><td>91.0</td></tr><tr><td>Megatron1.3B [49]</td><td>1.3B</td><td>90.9/91.0</td><td>92.6</td><td>1</td><td>1</td><td></td><td>一</td><td></td><td>1</td><td></td><td>87.1</td><td>90.2</td></tr><tr><td>Megatron3.9B [49]</td><td>3.9B</td><td>91.4/91.4</td><td>92.7</td><td>1</td><td></td><td>1</td><td></td><td></td><td>1</td><td></td><td>88.5</td><td>91.2</td></tr></table>
172
+
173
+ Table 1: Results on GLUE and SQuAD 2.0 development set. All results are single-task, single-model fine-tuning. Results not available in public reports are marked as “–”. DeBERTa reported RTE, MRPC and STS-B results by fine-tuning from MNLI checkpoints which are not single-task results. We use Spearman correlation for STS, Matthews correlation for CoLA, and accuracy for the rest on GLUE. AVG is the average of the eight tasks on GLUE. All baseline results unless marked by (Ours) are reported by previous research.
174
+
175
+ <table><tr><td>Model</td><td>Params</td><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>RTE</td><td>MRPC</td><td>STS-B</td><td>AVG</td></tr><tr><td colspan="9">Base/Base++ Setting: BERT Base Size</td><td></td></tr><tr><td>BERTBase</td><td>110M</td><td>84.6/83.4</td><td>89.2</td><td>90.5</td><td>93.5</td><td>52.1</td><td>66.4</td><td>84.8</td><td>85.8</td><td>80.8</td></tr><tr><td>ELECTRABase++</td><td>110M</td><td>88.5/88.0</td><td>89.5</td><td>93.1</td><td>96.0</td><td>64.6</td><td>75.2</td><td>88.1</td><td>90.2</td><td>85.6</td></tr><tr><td>COCO-LMBase++</td><td>134M</td><td>89.8/89.3</td><td>89.8</td><td>94.2</td><td>95.6</td><td>68.6</td><td>82.3</td><td>88.5</td><td>90.3</td><td>87.4</td></tr><tr><td colspan="9">Large/Large++ Seting: BERT Large Size</td><td></td></tr><tr><td>BERTLarge</td><td>335M</td><td>86.7/85.9</td><td>89.3</td><td>92.7</td><td>94.9</td><td>60.5</td><td>70.1</td><td>85.4</td><td>86.5</td><td>83.2</td></tr><tr><td>ELECTRALarge++</td><td>335M</td><td>90.7/90.2</td><td>90.4</td><td>95.5</td><td>96.7</td><td>68.1</td><td>86.1</td><td>89.2</td><td>91.7</td><td>88.5</td></tr><tr><td>COCO-LMLarge++</td><td>367M</td><td>91.6/91.1</td><td>90.5</td><td>95.8</td><td>96.7</td><td>70.5</td><td>89.2</td><td>88.4</td><td>91.8</td><td>89.3</td></tr></table>
176
+
177
+ Table 2: GLUE test set results obtained from the GLUE leaderboard. We perform hyperparameter search for each task with ten random seeds and use the best development set model for test predictions. All results are from vanilla single-task fine-tuning (no ensemble, task-specific tricks, etc.).
178
+
179
+ Table 2 shows GLUE test set results which further confirm the advantages of COCO-LM over previous methods.
180
+
181
+ Efficiency. In downstream tasks, the efficiency of COCO-LM is the same with BERT. In pretraining, the auxiliary model and SCL introduce extra cost. However, as shown in Figure 3, COCO-LM is more efficient in GPU hours. It outperforms RoBERTa & ELECTRA by $1 +$ points on MNLI with the same GPU hours and reaches their accuracy with around $6 0 \%$ & $5 0 \%$ GPU hours, respectively.
182
+
183
+ Ablation Studies. Table 3 shows the ablations of COCO-LM under the base setting on GLUE DEV.
184
+
185
+ Pretraining Task. With only RTD, our backbone model with the shallow auxiliary Transformer is quite effective. CLM and SCL both provide additional improvements on MNLI and GLUE average. Their advantages are better observed on different tasks, for example, CLM on MNLI-mm and SCL on RTE and MRPC. Combining the two in COCO-LM provides better overall effectiveness. In later experiments, we further analyze the benefits of these two tasks.
186
+
187
+ <table><tr><td>Group</td><td>Method</td><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>RTE</td><td>MRPC</td><td>STS-B</td><td>AVG</td></tr><tr><td></td><td>COCO-LMBase</td><td>88.5/88.3</td><td>92.0</td><td>93.1</td><td>93.2</td><td>63.9</td><td>84.8</td><td>91.4</td><td>90.3</td><td>87.2</td></tr><tr><td rowspan="3">Pretraining Task</td><td>RTDOnly</td><td>88.4/88.2</td><td>92.1</td><td>93.5</td><td>92.7</td><td>67.3</td><td>80.5</td><td>89.0</td><td>90.9</td><td>86.8</td></tr><tr><td>CLMOnly</td><td>88.6/88.4</td><td>92.0</td><td>93.2</td><td>93.7</td><td>67.4</td><td>80.1</td><td>90.0</td><td>90.4</td><td>86.9</td></tr><tr><td>SCL +RTD</td><td>88.6/88.2</td><td>92.1</td><td>93.5</td><td>93.8</td><td>64.3</td><td>82.7</td><td>90.2</td><td>90.6</td><td>86.9</td></tr><tr><td>Network Seting</td><td>w/o. Rel-Pos w. ELECTRA&#x27;s Auxiliary</td><td>88.2/87.7</td><td>92.2</td><td>93.4</td><td>93.7</td><td>68.8</td><td>82.7</td><td>91.2</td><td>90.6</td><td>87.6</td></tr><tr><td rowspan="2">Training</td><td></td><td>88.0/87.7</td><td>91.9</td><td>92.7</td><td>93.5</td><td>64.3</td><td>81.2</td><td>89.5</td><td>89.7</td><td>86.3</td></tr><tr><td>w.Random Replacements</td><td>84.9/84.7</td><td>91.4</td><td>91.1</td><td>91.4</td><td>41.6</td><td>70.0</td><td>87.3</td><td>87.1</td><td>80.6</td></tr><tr><td>Signal</td><td>w. Converged Auxiliary</td><td>88.3/88.1</td><td>92.0</td><td>92.8</td><td>94.3</td><td>64.2</td><td>78.3</td><td>90.4</td><td>90.2</td><td>86.3</td></tr><tr><td rowspan="3">CLM Setup</td><td>All-Token LM Only</td><td>87.2/87.0</td><td></td><td>92.6</td><td>93.7</td><td></td><td></td><td>88.5</td><td>89.7</td><td>84.7</td></tr><tr><td>CLM w/o. Copy</td><td>88.0/87.9</td><td>91.8 91.8</td><td>93.1</td><td>94.4</td><td>60.6 66.6</td><td>74.0 76.9</td><td>89.5</td><td>90.1</td><td>86.3</td></tr><tr><td>CLM w/o. Stop-grad</td><td>88.5/88.2</td><td>92.0</td><td>92.9</td><td>94.3</td><td>66.5</td><td>80.9</td><td>90.0</td><td>90.6</td><td>86.9</td></tr></table>
188
+
189
+ Table 3: Ablations on GLUE Dev. that eliminate (w/o.), keep (Only) or switch (w.) one component.
190
+
191
+ ![](images/7c7b853b454b46cee7bf8429edacf37572ac7613714aa9383792bc931834deea.jpg)
192
+ Figure 3: $\mathrm { C O C O - L M _ { B a s e } }$ on MNLI Dev. ( $y$ -axes) at different pretraining hours on four DGX-2 nodes (64 V100 GPUs). The final training hours and accuracy of RoBERTa (Ours) and ELECTRA (Ours) measured in the same settings are marked.
193
+
194
+ ![](images/b0838b4ee1160733d8845b67109fdb9dc7efa9acb20b3820901e16797ecc717f.jpg)
195
+ Figure 4: The performance of COCO- $\mathbf { \cdot L M _ { B a s e } }$ when pretrained with different crop fractions. The $x$ -axis is the fraction of $X ^ { \mathrm { o r i g } }$ being kept (no cropping is $1 0 0 \%$ ).
196
+
197
+ Architecture. Removing relative position encoding (Rel-Pos) leads to better numbers on some tasks but significantly hurts MNLI. Using a shallow auxiliary network and keeping the same hidden dimension (768) is more effective than ELECTRA’s 12-layer but 256-hidden dimension generator.
198
+
199
+ Pretraining Signal Construction. Using randomly replaced tokens to corrupt text sequence hurts significantly. Using a converged auxiliary network to pretrain the main model also hurts. It is better to pretrain the two Transformers together, as the auxiliary model gradually increases the difficulty of the corrupted sequences and provides a natural learning curriculum for the main Transformer.
200
+
201
+ CLM Setup. Disabling the multi-task learning and using All-Token MLM [7] reduces model accuracy. The copy mechanism is effective. The benefits of the stop gradient operation are more on stability (preventing training divergence).
202
+
203
+ # 5.2 Analyses of Contrastive Learning with SCL
204
+
205
+ This group of experiments analyzes the behavior of SCL. All experiments use the base setting.
206
+
207
+ Ablation on Data Augmentation. Figure 4 shows the effects of the cropping operation when forming positive SCL pairs with the corrupted sequence. Using the original sequence results in worse GLUE accuracy. It is less informative as the model no longer needs to learn representations robust to sequence-level alteration. Cropping too much (e.g., only keeping $7 0 \%$ of the original sequence), may hurt as it can alter the semantics too much. Empirically a simple alteration works the best, similar to the observations in recent research [4, 16, 22].
208
+
209
+ Alignment and Uniformity. Figure 5 plots the distribution of cosine similarities between random sequence pairs and similar ones using representations pretrained by COCO-LM. The representation space from COCO-LM is drastically different from those in Figure 1. With COCO-LM, similar pairs are more aligned and random pairs are distributed more uniformly. Many similar pairs have near 1 cosine similarity and are clearly separated from random pairs which center around 0. The t-SNE [9] plot in Figure 6 further demonstrates the benefits of SCL. The similar sentence pairs (marked by same shapes) are aligned closer when pretrained with SCL. Their average cosine similarity is 0.925 when pretrained with SCL, while is 0.863 without SCL. This better alignment and uniformity is achieved by COCO-LM with SCL via pretraining, without using task-specific data nor supervised labels.
210
+
211
+ ![](images/82aaaec6538ad34bc36ab524aaa756ff25c2f6723407c61d051220eb759a68b2.jpg)
212
+ Figure 5: Cosine similarity of sequence pairs randomly sampled from pretraining corpus and most similar pairs from STS-B using [CLS] from COCO- $\mathrm { L M } _ { \mathrm { B a s e } }$ .
213
+
214
+ ![](images/c1d97d0fc27a4c3c0d227b63fc15ba16a052a5c2bfaf1aa791b9ae2c82470dd6.jpg)
215
+ Figure 6: The t-SNE of sequence representations learned with or without SCL. The points are sampled from the most semantically similar sentences pairs from STS-B (with 5-score labels). The [CLS] embeddings are not fine-tuned. Some randomly selected similar pairs are marked by same shapes.
216
+
217
+ ![](images/992113321700f003cba33a4d9ae2e2e1ae1bb00ef61b749c875f454276b56dcf.jpg)
218
+ Figure 7: Analyses of SCL. Figs. (a) and (b) show the average cosine similarity between the [CLS] embeddings of positive and negative contrastive pairs during pretraining. Figs. (c) and (d) show the few-shot accuracy on MNLI with different fractions of MNLI training set used ( $\scriptstyle { \dot { x } }$ -axes). The error bars mark the max/min and the solid lines are the average of five fine-tuning runs.
219
+
220
+ Regularizing the Representation Learning for Better Few-Shot Ability. One would expect any pretrained Transformers to easily align a pair of corrupted sequence and cropped sequence as the two share about $8 0 \%$ tokens. However, as shown in Figure 7a, that is not the case: Without SCL, the cosine similarity of the positive pairs is even lower than random negatives. SCL is necessary to regularize the representation space and to reduce the risk of degeneration (Figure 7b).
221
+
222
+ Similar to empirical observations and theoretical analyses in recent research [14, 16, 55], a more regularized representation space results in better generalization ability in scenarios with limited labels. Figure $\mathrm { 7 c }$ and 7d show the results when COCO-LM are trained (via standard fine-tuning) with only a fraction of MNLI labels. The improvements brought by SCL are more significant when fewer fine-tuning labels are available. With $1 \%$ MNLI labels, pretraining with SCL improves MNLI- $. \mathrm { m } / \mathrm { m m }$ accuracy by $0 . 8 / 0 . 5$ compared to that without SCL. Using only $1 0 \% / 2 0 \%$ labels, COCO-LM with SCL reaches similar MNLI accuracy with RoBERTa (Ours)/ELECTRA (Ours) fine-tuned with all labels, respectively.
223
+
224
+ # 5.3 Analyses of Language Modeling with CLM
225
+
226
+ The last group of experiments studies the effectiveness and benefits of CLM.
227
+
228
+ Ablations on Training Configurations. Figure 8 illustrates pretraining process with CLM and All-Token MLM. The plots demonstrate the difficulty of language modeling upon corrupted text sequences. It is quite an unbalanced task. For the majority of the tokens (Original) the task is simply to copy its input at the same position. For the replaced tokens $( 7 - 8 \%$ total), however, the model needs to detect the abnormality brought by the auxiliary model and recover the original token. Implicitly training the copy mechanism as part of the hard LM task is not effective: The copy accuracy of All-Token MLM is much lower, and thus the LM head may confuse original tokens with replaced ones. As shown in Table 3 and ELECTRA [7], pretraining with All-Token MLM performs worse than using the RTD task, though the latter is equivalent to only training the copy mechanism. The multi-task learning of CLM is necessary for the main Transformer to stably learn the language modeling task upon the corrupted text sequence.
229
+
230
+ ![](images/7f4f1d35a5619b20f4bb5dab0e62dc152a989762d0e164bcb37c0492f45877fe.jpg)
231
+ Figure 8: The copying accuracy and the language modeling accuracy $y$ -axes) of CLM and All-Token MLM at different pretraining steps ( $x$ -axes, in 10K scale). The accuracy is averaged on tokens that are replaced by the auxiliary Transformer (Replaced) or those from the original input text (Original).
232
+
233
+ Prompt-Based Fine-Tuning with CLM. Table 4 includes the prompt-based fine-tuning experiments on MNLI for RoBERTa and COCO-LM under $b a s e + +$ and large $^ { + + }$ sizes, following the same few-shot manual prompt fine-tuning with demonstration setup in LM-BFF [15]. We use $\{ 3 e - 6 , 4 e - 6 , 5 e - 6 \}$ for the learning rate search of COCO-LM base++/large++ model, with everything else kept same as described in LM-BFF. With exactly the same pipeline, COCOLM outperforms RoBERTa under both $b a s e + +$ and $l a r g e + +$ sizes by significant margins on MNLI$\mathrm { m } / \mathrm { m m }$ . Such observations are interesting as COCOLM’s main Transformer does not even see any
234
+
235
+ <table><tr><td>Model</td><td>MNLI-m</td><td>MNLI-mm</td></tr><tr><td>RoBERTaBase++</td><td>60.1 (1.5)</td><td>61.8 (1.2)</td></tr><tr><td>COCO-LMBase++</td><td>66.5 (2.1)</td><td>68.0 (2.3)</td></tr><tr><td>RoBERTaLarge++</td><td>70.7 (1.3)</td><td>72.0 (1.2)</td></tr><tr><td>COCO-LMLarge++</td><td>72.0 (1.5)</td><td>73.3 (1.1)</td></tr></table>
236
+
237
+ Table 4: Few-shot prompt-based fine-tuning using RoBERTa and COCO-LM trained on 16 samples per class. Mean (and standard deviation) accuracy results over 5 different splits on MNLI- $. \mathrm { m } / \mathrm { m m }$ are shown.
238
+
239
+ [MASK] tokens during pretraining but still performs well on predicting masked tokens for promptbased learning. Note that ELECTRA and COCO-LM variants without the CLM task are not applicable: Their main Transformers are not pretrained by language modeling tasks (thus no language modeling capability is learned to generate prompt label words). This points out the importance, if not necessity, of COCO-LM in the family of ELECTRA-style pretraining models. With the benefits and rapid developments of prompt-based approaches, the lack of language modeling capability is going to limit the potential of ELECTRA’s self-supervised learning framework in many real-world scenarios. COCO-LM not only addresses this limitation but also provides better prompt-based learning results.
240
+
241
+ # 6 Conclusions and Future Work
242
+
243
+ In this paper, we present COCO-LM, which pretrains language models using Corrective Language Modeling and Sequence Contrastive Learning upon corrupted text sequences. With standard pretraining data and Transformer architectures, COCO-LM improves the accuracy on the GLUE and SQuAD benchmarks, while also being more efficient in utilizing pretraining computing resources and network parameters.
244
+
245
+ One limitation of this work is that the contrastive pairs are constructed by simple cropping and MLM replacements. Recent studies have shown the effectiveness of advanced data augmentation techniques in fine-tuning language models [16, 38, 51]. A future research direction is to explore better ways to construct contrastive pairs in language model pretraining.
246
+
247
+ Despite the empirical advantage of this auxiliary-main dual model framework, the auxiliary Transformer training is not influenced by the main Transformer nor learns to generate the optimal pretraining signals for the main model. To better understand and tailor the training of the auxiliary model to the main model is another important future research direction.
248
+
249
+ # Acknowledgments
250
+
251
+ We sincerely thank Guolin Ke for discussions and advice on model implementation. We also thank anonymous reviewers for valuable and insightful feedback, especially the suggestion of adding prompt-based fine-tuning experiments.
252
+
253
+ # References
254
+
255
+ [1] Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Songhao Piao, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. UniLMv2: Pseudo-masked language models for unified language model pre-training. In ICML, 2020. [2] Luisa Bentivogli, Peter Clark, Ido Dagan, and Danilo Giampiccolo. The fifth pascal recognizing textual entailment challenge. In TAC, 2009. [3] Daniel Cer, Mona Diab, Eneko Agirre, Iñigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In International Workshop on Semantic Evaluation (SemEval), 2017.
256
+ [4] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. [5] Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of BERT’s attention. In ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2019. [6] Kevin Clark, Minh-Thang Luong, Quoc Le, and Christopher D Manning. Pre-training transformers as energy-based cloze models. In EMNLP, 2020. [7] Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. ELECTRA: Pre-training text encoders as discriminators rather than generators. In ICLR, 2020. [8] Peter Clark, Oyvind Tafjord, and Kyle Richardson. Transformers as soft reasoners over language. In IJCAI, 2020.
257
+ [9] Andy Coenen, Emily Reif, Ann Yuan, Been Kim, Adam Pearce, Fernanda Viégas, and Martin Wattenberg. Visualizing and measuring the geometry of BERT. In NeurIPS, 2019.
258
+ [10] Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, 2005.
259
+ [11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019.
260
+ [12] William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In International Workshop on Paraphrasing (IWP), 2005.
261
+ [13] Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. In NeurIPS, 2019.
262
+ [14] Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Representation degeneration problem in training natural language generation models. In ICLR, 2019.
263
+ [15] Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. In ACL, 2021.
264
+ [16] Tianyu Gao, Xingcheng Yao, and Danqi Chen. SimCSE: Simple contrastive learning of sentence embeddings. In EMNLP, 2021.
265
+ [17] Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third pascal recognizing textual entailment challenge. In ACL-PASCAL workshop on textual entailment and paraphrasing, 2007.
266
+ [18] Aaron Gokaslan and Vanya Cohen. Openwebtext corpus. http://Skylion007.github.io/ OpenWebTextCorpus, 2019.
267
+ [19] Beliz Gunel, Jingfei Du, Alexis Conneau, and Ves Stoyanov. Supervised contrastive learning for pre-trained language model fine-tuning. In ICLR, 2021.
268
+ [20] Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. REALM: Retrievalaugmented language model pre-training. In ICML, 2020.
269
+ [21] R Bar Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second pascal recognising textual entailment challenge. In PASCAL Challenges Workshop on Recognising Textual Entailment, 2006.
270
+ [22] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
271
+ [23] Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. DeBERTa: Decoding-enhanced bert with disentangled attention. In ICLR, 2021.
272
+ [24] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. SpanBERT: Improving pre-training by representing and predicting spans. In TACL, 2019.
273
+ [25] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
274
+ [26] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking the positional encoding in language pre-training. In ICLR, 2021.
275
+ [27] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A lite BERT for self-supervised learning of language representations. In ICLR, 2020.
276
+ [28] Teven Le Scao and Alexander M Rush. How many data points is a prompt worth? In NAACL-HLT, 2021.
277
+ [29] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In ACL, 2019.
278
+ [30] Bohan Li, Hao Zhou, Junxian He, Mingxuan Wang, Yiming Yang, and Lei Li. On the sentence embeddings from pre-trained language models. In EMNLP, 2020.
279
+ [31] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
280
+ [32] Yi Luan, Jacob Eisenstein, Kristina Toutanove, and Michael Collins. Sparse, dense, and attentional representations for text retrieval. In TACL, 2021.
281
+ [33] Yu Meng, Yunyi Zhang, Jiaxin Huang, Chenyan Xiong, Heng Ji, Chao Zhang, and Jiawei Han. Text classification using label names only: A language model self-training approach. In EMNLP, 2020.
282
+ [34] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
283
+ [35] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. FAIRSEQ: A fast, extensible toolkit for sequence modeling. In NAACL-HLT Demonstrations, 2019.
284
+ [36] Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In NAACL-HLT, 2018.
285
+ [37] Senthil Purushwalkam and Abhinav Gupta. Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases. In NeurIPS, 2020.
286
+ [38] Yanru Qu, Dinghan Shen, Yelong Shen, Sandra Sajeev, Jiawei Han, and Weizhu Chen. CoDA: Contrastenhanced and diversity-promoting data augmentation for natural language understanding. In ICLR, 2021.
287
+ [39] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
288
+ [40] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 2019.
289
+ [41] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In EMNLP, 2016.
290
+ [42] Anirudh Ravula, Chris Alberti, Joshua Ainslie, Li Yang, Philip Minh Pham, Qifan Wang, Santiago Ontanon, Sumit Kumar Sanghai, Vaclav Cvicek, and Zach Fisher. ETC: Encoding long and structured inputs in transformers. In EMNLP, 2020.
291
+ [43] Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence embeddings using siamese BERT-networks. In EMNLP, 2019.
292
+ [44] Adam Roberts, Colin Raffel, and Noam Shazeer. How much knowledge can you pack into the parameters of a language model? In EMNLP, 2020.
293
+ [45] Timo Schick and Hinrich Schütze. Exploiting cloze questions for few-shot text classification and natural language inference. In EACL, 2021.
294
+ [46] Timo Schick and Hinrich Schütze. It’s not just size that matters: Small language models are also few-shot learners. In NAACL-HLT, 2021.
295
+ [47] Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, 2015.
296
+ [48] Iyer Shankar, Dandekar Nikhil, and Csernai Kornél. First Quora dataset release: Question pairs, 2017.
297
+ [49] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-LM: Training multi-billion parameter language models using gpu model parallelism. arXiv preprint arXiv:1909.08053, 2019.
298
+ [50] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013.
299
+ [51] Nandan Thakur, Nils Reimers, Johannes Daxenberger, and Iryna Gurevych. Augmented SBERT: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks. In NAACL-HLT, 2021.
300
+ [52] Trieu H Trinh and Quoc V Le. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847, 2018.
301
+ [53] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
302
+ [54] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In EMNLP Workshop BlackboxNLP, 2018.
303
+ [55] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, 2020.
304
+ [56] Wei Wang, Bin Bi, Ming Yan, Chen Wu, Zuyi Bao, Jiangnan Xia, Liwei Peng, and Luo Si. StructBERT: Incorporating language structures into pre-training for deep language understanding. In ICLR, 2020.
305
+ [57] Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. In TACL, 2019.
306
+ [58] Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL-HLT, 2018.
307
+ [59] Zhuofeng Wu, Sinong Wang, Jiatao Gu, Madian Khabsa, Fei Sun, and Hao Ma. CLEAR: Contrastive learning for sentence representation. arXiv preprint arXiv:2012.15466, 2020.
308
+ [60] Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In ICLR, 2021.
309
+ [61] Zhenhui Xu, Linyuan Gong, Guolin Ke, Di He, Shuxin Zheng, Liwei Wang, Jiang Bian, and Tie-Yan Liu. MC-BERT: Efficient language pre-training via a meta controller. arXiv preprint arXiv:2006.05744, 2020.
310
+ [62] Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. XLNet: Generalized autoregressive pretraining for language understanding. In NeurIPS, 2019.
311
+ [63] Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In ICCV, 2015.
parse/train/pk4q0SD_r1X/pk4q0SD_r1X_content_list.json ADDED
@@ -0,0 +1,1380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 223,
8
+ 122,
9
+ 776,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Yu Meng1∗, Chenyan Xiong2, Payal Bajaj2, Saurabh Tiwary2, Paul Bennett2, Jiawei Han1, Xia Song2 ",
17
+ "bbox": [
18
+ 285,
19
+ 224,
20
+ 710,
21
+ 255
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "1 University of Illinois at Urbana-Champaign 2 Microsoft 1 {yumeng5,hanj}@illinois.edu 2 {chenyan.xiong,payal.bajaj,satiwary, paul.n.bennett,xiaso}@microsoft.com ",
28
+ "bbox": [
29
+ 308,
30
+ 256,
31
+ 691,
32
+ 311
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Abstract ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 462,
42
+ 347,
43
+ 535,
44
+ 363
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "We present a self-supervised learning framework, COCO-LM, that pretrains Language Models by COrrecting and COntrasting corrupted text sequences. Following ELECTRA-style pretraining, COCO-LM employs an auxiliary language model to corrupt text sequences, upon which it constructs two new tasks for pretraining the main model. The first token-level task, Corrective Language Modeling, is to detect and correct tokens replaced by the auxiliary model, in order to better capture token-level semantics. The second sequence-level task, Sequence Contrastive Learning, is to align text sequences originated from the same source input while ensuring uniformity in the representation space. Experiments on GLUE and SQuAD demonstrate that COCO-LM not only outperforms recent state-of-the-art pretrained models in accuracy, but also improves pretraining efficiency. It achieves the MNLI accuracy of ELECTRA with $5 0 \\%$ of its pretraining GPU hours. With the same pretraining steps of standard base/large-sized models, COCO-LM outperforms the previous best models by $1 +$ GLUE average points. ",
51
+ "bbox": [
52
+ 233,
53
+ 378,
54
+ 766,
55
+ 573
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 Introduction ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 174,
65
+ 597,
66
+ 310,
67
+ 614
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Pretrained language models (PLMs) have reshaped the way AI systems process natural language [11, 36, 39, 40]. Before task-specific training, it is now a common practice to first pretrain the deep neural networks, often Transformers [53], via a self-supervised token-level language modeling task [29, 31, 40]. Whether it is autoregressive [39], permutational [62], or masked language modeling (MLM) [11], the Transformer networks are pretrained to recover some omitted tokens using the rest of input texts. Then the language semantics captured during pretraining are conveyed to downstream tasks via the pretrained Transformer parameters [5, 8, 44]. ",
74
+ "bbox": [
75
+ 174,
76
+ 628,
77
+ 825,
78
+ 727
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Recent research [14, 16, 25, 43] observed several challenges in this self-supervised learning framework. One challenge is its efficiency. After pretrained for a while with the standard token-level language modeling, the networks have already captured the basic language patterns, making a large fraction of pretraining signals no longer informative. Linear improvement in the model effectiveness often requires exponentially more pretraining compute and parameters [25], which is unsustainable. Another challenge is the anisotropy of text representations from pretrained models. The sequence representations from many pretrained models are quite irregular [30, 43] and require dedicated fine-tuning approaches to be useful in sequence-level applications [32, 60]. ",
85
+ "bbox": [
86
+ 174,
87
+ 732,
88
+ 825,
89
+ 843
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Clark et al. [7] proposed a new pretraining strategy, ELECTRA, that uses an auxiliary language model (“generator”) to replace tokens in input texts and pretrains the main Transformer (“discriminator”) to detect replaced tokens. This improves the pretraining efficiency and effectiveness, but pretraining via binary classification hinders the model’s usage on applications requiring language modeling capability (e.g., prompt-based learning [15, 28, 46]). It could further distort the representation space as the Transformers are pretrained to output the same “non-replacement” label for all actual tokens. ",
96
+ "bbox": [
97
+ 178,
98
+ 849,
99
+ 823,
100
+ 877
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 174,
109
+ 90,
110
+ 825,
111
+ 147
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "In this paper, we present a new self-supervised learning approach, COCO-LM, that pretrains Language Models by COrrecting and COntrasting corrupted text sequences. Following ELECTRA-style pretraining, COCO-LM employs an auxiliary model to corrupt the input texts, upon which it introduces two new pretraining tasks for the main Transformer, one at token level and one at sequence level. The token-level task, corrective language modeling (CLM), pretrains the main Transformer to detect and correct the tokens in the corrupted sequences. It uses a multi-task setup to combine the benefits of replaced token detection and language modeling. The sequence-level task, sequence contrastive learning (SCL), pretrains the model to align text sequences originated from the same source sequence and enforce uniformity of the representation space. ",
118
+ "bbox": [
119
+ 174,
120
+ 152,
121
+ 825,
122
+ 279
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "In our experiments on GLUE [54] and $\\mathrm { S Q u A D }$ [41] benchmarks, COCO-LM not only outperforms state-of-the-art pretraining approaches in effectiveness, but also significantly improves the pretraining efficiency. Under the same setting, COCO-LM matches the MNLI accuracy of RoBERTa and ELECTRA with $6 0 \\%$ and $5 0 \\%$ of their GPU hours in pretraining, respectively. When pretrained with the same number of steps, COCO-LM outperforms the previous best models by $1 +$ GLUE average points under the standard base/large-sized model evaluations. With 367 million parameters, COCO$\\mathrm { L M _ { L a r g e + + } }$ reaches the MNLI accuracy of Megatron3.9B [49], one of the largest BERT-style model with 3.9 billion parameters. Our analyses provide further insights on the advantage of CLM in learning token representations and its effectiveness in prompted-based fine-tuning, as well as the benefit of SCL in ensuring alignment and uniformity in the representation space for better generalization1. ",
129
+ "bbox": [
130
+ 174,
131
+ 284,
132
+ 825,
133
+ 422
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "2 Related Work ",
140
+ "text_level": 1,
141
+ "bbox": [
142
+ 174,
143
+ 441,
144
+ 321,
145
+ 459
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "Various token-level tasks have been used to pretrain language models. The most classic auto-regressive language modeling is to predict a token given all the previous tokens, or all subsequent ones [36, 39]. BERT uses masked language modeling (MLM) that recovers randomly masked tokens using the rest input. XLNet proposes permutation language modeling that conducts MLM in an autoregressive manner [62]. UniLM uses pseudo MLM which unifies autoregressive and MLM tasks [1, 13]. ",
152
+ "bbox": [
153
+ 174,
154
+ 474,
155
+ 825,
156
+ 544
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "Sequence-level tasks are also explored, which often pretrain the model to predict certain cooccurrences of sequence pairs. For example, next sentence prediction [11], sentence ordering [27] and previous sentence prediction [56] concatenate two sentences (either correlated or random), and train the Transformer to classify the pair. ",
163
+ "bbox": [
164
+ 174,
165
+ 550,
166
+ 825,
167
+ 606
168
+ ],
169
+ "page_idx": 1
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "Empirically, MLM is still among the most effective tasks to pretrain encoders [29, 31, 40]. RoBERTa [31] found the sentence-level task in BERT not benefitial and discarded it. BART [29] and T5 [40] both observed that MLM is often the most effective task. The empirical advantages of other pretraining tasks are more task-specific, for example, entity related masks for knowledge intensive applications [20, 24], and sequence-level tasks for long form text modeling [42]. ",
174
+ "bbox": [
175
+ 174,
176
+ 612,
177
+ 825,
178
+ 681
179
+ ],
180
+ "page_idx": 1
181
+ },
182
+ {
183
+ "type": "text",
184
+ "text": "Instead of randomly altering texts, ELECTRA [7] uses a smaller auxiliary Transformer pretrained by MLM to replace some tokens in the text sequences using its language modeling probability, and pretrains the main Transformer to detect the replaced tokens. ELECTRA achieves state-of-the-art accuracy in many language tasks [7]. Later, Clark et el. [6] developed ELECTRIC, which pretrains encoders by contrasting original tokens against negatives sampled from a cloze model. ELECTRIC re-enables the language modeling capability but underperforms ELECTRA in downstream tasks. ",
185
+ "bbox": [
186
+ 174,
187
+ 688,
188
+ 825,
189
+ 771
190
+ ],
191
+ "page_idx": 1
192
+ },
193
+ {
194
+ "type": "text",
195
+ "text": "Our work is also related to contrastive learning which has shown great success in visual representation learning [4, 22, 34]. Its effectiveness of in language is more observed in the fine-tuning stage, for example, in sentence representation [16], dense retrieval [60], and GLUE fine-tuning [19]. ",
196
+ "bbox": [
197
+ 176,
198
+ 777,
199
+ 823,
200
+ 820
201
+ ],
202
+ "page_idx": 1
203
+ },
204
+ {
205
+ "type": "text",
206
+ "text": "3 Method ",
207
+ "text_level": 1,
208
+ "bbox": [
209
+ 174,
210
+ 839,
211
+ 269,
212
+ 856
213
+ ],
214
+ "page_idx": 1
215
+ },
216
+ {
217
+ "type": "text",
218
+ "text": "We present the preliminaries of PLMs, their challenges, and the new COCO-LM framework. ",
219
+ "bbox": [
220
+ 173,
221
+ 871,
222
+ 777,
223
+ 886
224
+ ],
225
+ "page_idx": 1
226
+ },
227
+ {
228
+ "type": "text",
229
+ "text": "3.1 Preliminary on Language Model Pretraining ",
230
+ "text_level": 1,
231
+ "bbox": [
232
+ 176,
233
+ 90,
234
+ 524,
235
+ 106
236
+ ],
237
+ "page_idx": 2
238
+ },
239
+ {
240
+ "type": "text",
241
+ "text": "In this work we focus on pretraining BERT-style bidirectional Transformer encoders [11] that are widely used in language representation tasks. We first recap the masked language modeling (MLM) task introduced by BERT [11] and then discuss the pretraining framework of ELECTRA [7]. ",
242
+ "bbox": [
243
+ 174,
244
+ 116,
245
+ 825,
246
+ 159
247
+ ],
248
+ "page_idx": 2
249
+ },
250
+ {
251
+ "type": "text",
252
+ "text": "BERT Pretraining uses the masked language modeling task (MLM) [11], which is to take an input sequence $X ^ { \\mathrm { o r i g } } = [ x _ { 1 } ^ { \\mathrm { o r i g } } , \\dotsc , x _ { i } ^ { \\mathrm { o r i g } } , \\dotsc , x _ { n } ^ { \\mathrm { o r i g } } ]$ , with $1 5 \\%$ random tokens replaced by [MASK] symbols (e.g., the $i$ -th token), and train the model to predict the original tokens at the masked positions: ",
253
+ "bbox": [
254
+ 173,
255
+ 164,
256
+ 825,
257
+ 209
258
+ ],
259
+ "page_idx": 2
260
+ },
261
+ {
262
+ "type": "equation",
263
+ "img_path": "images/076614958bda0182580d886177a2a3a70e46a46adc6509ef0a4acc38dc0cbf99.jpg",
264
+ "text": "$$\n\\left[ x _ { 1 } ^ { \\mathrm { o r i g } } , \\dots , \\ [ \\mathrm { M \\AA S K } ] _ { i } , \\dots , x _ { n } ^ { \\mathrm { o r i g } } \\right] \\xrightarrow { \\mathrm { T r a n s f o r m e r } } H \\xrightarrow { \\mathrm { M L M H e a d } } p _ { \\mathrm { M L M } } ( x | h _ { i } ) ,\n$$",
265
+ "text_format": "latex",
266
+ "bbox": [
267
+ 267,
268
+ 215,
269
+ 728,
270
+ 242
271
+ ],
272
+ "page_idx": 2
273
+ },
274
+ {
275
+ "type": "text",
276
+ "text": "where the Transformer generates contextualized representations ${ \\pmb H } = \\{ h _ { i } \\} _ { i = 1 } ^ { n }$ . The MLM Head predicts the masked token from the vocabulary $V$ using the hidden representation $\\boldsymbol { h } _ { i }$ and token embeddings $_ { \\textbf { \\em x } }$ . The pretraining minimizes the MLM loss on the set of masked positions $\\mathcal { M }$ . Specifically, ",
277
+ "bbox": [
278
+ 174,
279
+ 250,
280
+ 826,
281
+ 291
282
+ ],
283
+ "page_idx": 2
284
+ },
285
+ {
286
+ "type": "equation",
287
+ "img_path": "images/44ef3bd6eb3f680f4bf25edbebc27dd93b45fdc9f04b6736a5ee5b7e2b588d26.jpg",
288
+ "text": "$$\np _ { \\mathrm { M L M } } ( x | h _ { i } ) = \\frac { \\exp ( x ^ { \\top } h _ { i } ) } { \\sum _ { x _ { t } \\in V } \\exp ( x _ { t } ^ { \\top } h _ { i } ) } ; \\quad \\mathcal { L } _ { \\mathrm { M L M } } = \\mathbb { E } \\left( - \\sum _ { i \\in \\mathcal { M } } \\log p _ { \\mathrm { M L M } } \\left( x _ { i } ^ { \\mathrm { o r i g } } \\middle | h _ { i } \\right) \\right) .\n$$",
289
+ "text_format": "latex",
290
+ "bbox": [
291
+ 223,
292
+ 296,
293
+ 772,
294
+ 340
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "ELECTRA Pretraining uses two Transformers, a “generator” pretrained by MLM, and a “discriminator” pretrained using the generator’s outputs. We refer them as auxiliary and main Transformers, as the former is discarded after pretraining and the latter may be trained by “generative” tasks too. ",
301
+ "bbox": [
302
+ 173,
303
+ 353,
304
+ 825,
305
+ 396
306
+ ],
307
+ "page_idx": 2
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "The auxiliary model outputs a corrupted sequence $X ^ { \\mathrm { M L M } }$ by sampling from its predicted probability: ",
312
+ "bbox": [
313
+ 176,
314
+ 400,
315
+ 823,
316
+ 416
317
+ ],
318
+ "page_idx": 2
319
+ },
320
+ {
321
+ "type": "equation",
322
+ "img_path": "images/b824c400834632d12c6a490dad58c221e879bf27313a16ad8af9d62808aa078e.jpg",
323
+ "text": "$$\nx _ { i } ^ { \\mathrm { M L M } } \\sim p _ { \\mathrm { M L M } } \\left( x | h _ { i } \\right) , \\mathrm { i f } i \\in \\mathcal { M } ; \\quad x _ { i } ^ { \\mathrm { M L M } } = x _ { i } ^ { \\mathrm { o r i g } } , \\mathrm { e l s e } .\n$$",
324
+ "text_format": "latex",
325
+ "bbox": [
326
+ 312,
327
+ 422,
328
+ 686,
329
+ 443
330
+ ],
331
+ "page_idx": 2
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "The masked positions are replaced by sampled tokens considered plausible in context by the auxiliary Transformer, which are more deceiving than random replacements. ELECTRA uses a skinnier auxiliary network (e.g., hidden dimension is $1 / 3$ of the main model) to control the signal difficulty. ",
336
+ "bbox": [
337
+ 173,
338
+ 449,
339
+ 826,
340
+ 491
341
+ ],
342
+ "page_idx": 2
343
+ },
344
+ {
345
+ "type": "text",
346
+ "text": "The main Transformer takes $X ^ { \\mathrm { M L M } }$ and classifies the replaced tokens: ",
347
+ "bbox": [
348
+ 176,
349
+ 496,
350
+ 632,
351
+ 511
352
+ ],
353
+ "page_idx": 2
354
+ },
355
+ {
356
+ "type": "equation",
357
+ "img_path": "images/2eb7d2c92d65747022a0ee7e813aa301ee14c1cca99b57bcf4cfff3a6d9189e3.jpg",
358
+ "text": "$$\n\\begin{array} { r } { X ^ { \\mathrm { M L M } } \\xrightarrow { \\mathrm { M a i n ~ T r a n s f o r m e r } } \\pmb { H } \\xrightarrow { \\mathrm { R T D ~ H e a d } } p _ { \\mathrm { R T D } } \\left( \\mathbb { 1 } \\big ( x _ { i } ^ { \\mathrm { M L M } } = x _ { i } ^ { \\mathrm { o r i g } } \\big ) \\big | h _ { i } \\right) , } \\end{array}\n$$",
359
+ "text_format": "latex",
360
+ "bbox": [
361
+ 284,
362
+ 517,
363
+ 712,
364
+ 545
365
+ ],
366
+ "page_idx": 2
367
+ },
368
+ {
369
+ "type": "text",
370
+ "text": "where $\\mathbb { 1 } ( \\cdot )$ is the indicator function. The Replaced Token Detection (RTD) head uses a sigmoid linear layer to output the binary probability, and the main Transformer is trained with binary cross entropy loss. The RTD task is trained on all tokens instead of masked ones and improves efficiency. ",
371
+ "bbox": [
372
+ 174,
373
+ 551,
374
+ 823,
375
+ 593
376
+ ],
377
+ "page_idx": 2
378
+ },
379
+ {
380
+ "type": "text",
381
+ "text": "The two Transformers are pretrained jointly. The auxiliary model gradually generates more realistic replacement tokens and the main model learns to better detect them. This forms a natural learning curriculum and significantly improves ELECTRA’s accuracy in downstream tasks [7]. ",
382
+ "bbox": [
383
+ 173,
384
+ 598,
385
+ 826,
386
+ 642
387
+ ],
388
+ "page_idx": 2
389
+ },
390
+ {
391
+ "type": "text",
392
+ "text": "3.2 Challenges of ELECTRA-Style Pretraining ",
393
+ "text_level": 1,
394
+ "bbox": [
395
+ 173,
396
+ 657,
397
+ 514,
398
+ 672
399
+ ],
400
+ "page_idx": 2
401
+ },
402
+ {
403
+ "type": "text",
404
+ "text": "Missing Language Modeling Benefits. The classification task in ELECTRA is simpler and more stable [61], but raises two challenges. The first is the lack of language modeling capability which is a necessity in some tasks [6]. For example, prompt-based learning requires a language model to generate labels [15, 33, 45, 46]. The second is that the binary classification task may not be sufficient to capture certain word-level semantics that are critical for token-level tasks. ",
405
+ "bbox": [
406
+ 174,
407
+ 683,
408
+ 485,
409
+ 821
410
+ ],
411
+ "page_idx": 2
412
+ },
413
+ {
414
+ "type": "text",
415
+ "text": "Squeezing Representation Space. Another challenge is that the representations from Transformer-based language models often reside in a narrow cone, where two random sentences have high similarity scores (lack of uniformity), ",
416
+ "bbox": [
417
+ 173,
418
+ 828,
419
+ 483,
420
+ 897
421
+ ],
422
+ "page_idx": 2
423
+ },
424
+ {
425
+ "type": "image",
426
+ "img_path": "images/3a8c91a226e2aa036c614aa7d53c2b811d005dba76544c5617acff0d9b62c12a.jpg",
427
+ "image_caption": [
428
+ "Figure 1: Cosine similarity distributions of random/similar sequence pairs using [CLS] embeddings from pretrained models. Histograms/curves are distribution bins/kernel density estimates. "
429
+ ],
430
+ "image_footnote": [],
431
+ "bbox": [
432
+ 496,
433
+ 699,
434
+ 828,
435
+ 805
436
+ ],
437
+ "page_idx": 2
438
+ },
439
+ {
440
+ "type": "text",
441
+ "text": "and closely related sentences may have more different representations (lack of alignment) [14, 16, 30]. ",
442
+ "bbox": [
443
+ 176,
444
+ 897,
445
+ 825,
446
+ 911
447
+ ],
448
+ "page_idx": 2
449
+ },
450
+ {
451
+ "type": "image",
452
+ "img_path": "images/88292be09312bfcedea184a72ece038e7b7b44db60e61df6cc39ca285f523c38.jpg",
453
+ "image_caption": [
454
+ "Figure 2: The overview of COCO-LM. The auxiliary Transformer is pretrained by MLM. Its corrupted text sequence is used as the main Transformer’s pretraining input in Corrective Language Modeling and paired with the cropped original sequence for Sequence Contrastive Learning. "
455
+ ],
456
+ "image_footnote": [],
457
+ "bbox": [
458
+ 174,
459
+ 92,
460
+ 825,
461
+ 231
462
+ ],
463
+ "page_idx": 3
464
+ },
465
+ {
466
+ "type": "text",
467
+ "text": "Figure 1 illustrates such behaviors with random sentence pairs (from pretraining corpus) and semantically similar pairs (those annotated with maximum similarity from STS-B [3]). With RoBERTa, the cosine similarities of most random sentence pairs are near 0.8, bigger than many semantically similar pairs. The representation space from ELECTRA is even more squeezed. Nearly all sentence pairs, both random and similar ones, have around 0.9 cosine similarity. This may not be surprising as ELECTRA is pretrained to predict the same output (“non-replacement”) for all tokens in these sequences. The irregular representation space raises the risk of degeneration [37, 55] and often necessitates sophisticated post-adjustment or fine-tuning to improve the sequence representations [16, 30, 32, 60]. ",
468
+ "bbox": [
469
+ 173,
470
+ 325,
471
+ 826,
472
+ 438
473
+ ],
474
+ "page_idx": 3
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "3.3 COCO-LM Pretraining ",
479
+ "text_level": 1,
480
+ "bbox": [
481
+ 174,
482
+ 469,
483
+ 379,
484
+ 486
485
+ ],
486
+ "page_idx": 3
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "COCO-LM also employs an auxiliary Transformer to construct the corrupted text sequence, as in Eqn. (1), but it introduces two new pretraining tasks upon the corrupted sequences to address the challenges previously described. In the rest of this section, we present these two tasks and then the detailed configurations of COCO-LM. Its framework is illustrated in Figure 2. ",
491
+ "bbox": [
492
+ 173,
493
+ 502,
494
+ 825,
495
+ 559
496
+ ],
497
+ "page_idx": 3
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "Corrective Language Modeling (CLM) trains the main Transformer to recover the original tokens, given the corrupted text sequence XMLM: ",
502
+ "bbox": [
503
+ 174,
504
+ 565,
505
+ 825,
506
+ 594
507
+ ],
508
+ "page_idx": 3
509
+ },
510
+ {
511
+ "type": "equation",
512
+ "img_path": "images/17aeff6497bb1d60361a2ffa28441b12de20093398264297d4fe56e5aa290f81.jpg",
513
+ "text": "$$\n\\begin{array} { r } { X ^ { \\mathrm { M L M } } \\xrightarrow { \\mathrm { M a i n ~ T r a n s f o r m e r } } H \\xrightarrow { \\mathrm { C L M H e a d } } p _ { \\mathrm { C L M } } ( x | h _ { i } ) . } \\end{array}\n$$",
514
+ "text_format": "latex",
515
+ "bbox": [
516
+ 338,
517
+ 617,
518
+ 658,
519
+ 638
520
+ ],
521
+ "page_idx": 3
522
+ },
523
+ {
524
+ "type": "text",
525
+ "text": "The CLM Head uses the hidden representations $\\pmb { H }$ to output a language modeling probability, instead of a binary classification score. The forward pass of the CLM Head is the same as All-Token MLM, a variation of ELECTRA [7] that consists of a language modeling layer and a binary classification layer for the copy mechanism: ",
526
+ "bbox": [
527
+ 173,
528
+ 660,
529
+ 826,
530
+ 717
531
+ ],
532
+ "page_idx": 3
533
+ },
534
+ {
535
+ "type": "equation",
536
+ "img_path": "images/6e99146a7d8af754b940a8246882a6816802df00b87f58c77e7850208f6a9fb3.jpg",
537
+ "text": "$$\n\\begin{array} { r l } & { p _ { \\mathrm { L M } } ( x _ { i } | h _ { i } ) = \\mathbb { 1 } \\left( x _ { i } = x _ { i } ^ { \\mathrm { M L M } } \\right) p _ { \\mathrm { c o p y } } ( 1 | h _ { i } ) + p _ { \\mathrm { c o p y } } ( 0 | h _ { i } ) \\frac { \\exp ( x _ { i } ^ { \\top } h _ { i } ) } { \\sum _ { x _ { t } \\in V } \\exp ( x _ { t } ^ { \\top } h _ { i } ) } , } \\\\ & { p _ { \\mathrm { c o p y } } ( y _ { i } | h _ { i } ) = \\exp ( y _ { i } \\cdot w _ { \\mathrm { c o p y } } ^ { \\top } h _ { i } ) / \\left( \\exp ( w _ { \\mathrm { c o p y } } ^ { \\top } h _ { i } ) + 1 \\right) , } \\end{array}\n$$",
538
+ "text_format": "latex",
539
+ "bbox": [
540
+ 243,
541
+ 739,
542
+ 753,
543
+ 800
544
+ ],
545
+ "page_idx": 3
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "where ${ \\pmb w } _ { \\mathrm { c o p y } }$ is a learnable weight and $p _ { \\mathrm { c o p y } } ( y _ { i } | h _ { i } )$ is the copy mechanism ( $y _ { i } = 1$ when the input token is original and can be directly copied to the output; $y _ { i } = 0$ when the input token needs to be corrected to another token from the vocabulary). ",
550
+ "bbox": [
551
+ 174,
552
+ 820,
553
+ 823,
554
+ 863
555
+ ],
556
+ "page_idx": 3
557
+ },
558
+ {
559
+ "type": "text",
560
+ "text": "In ELECTRA, All-Token MLM performs worse than RTD [7]. Language modeling on the corrupted text sequence $X ^ { \\mathrm { M L M } }$ is hard as the replaced tokens from the auxiliary model are more deceiving than [MASK]. To improve the language model learning, different from All-Token MLM, CLM employs a ",
561
+ "bbox": [
562
+ 174,
563
+ 868,
564
+ 825,
565
+ 911
566
+ ],
567
+ "page_idx": 3
568
+ },
569
+ {
570
+ "type": "text",
571
+ "text": "multi-task setup that combines the RTD task to explicitly train the copy mechanism $p _ { \\mathrm { c o p y } } ( \\cdot )$ ",
572
+ "bbox": [
573
+ 169,
574
+ 90,
575
+ 776,
576
+ 107
577
+ ],
578
+ "page_idx": 4
579
+ },
580
+ {
581
+ "type": "equation",
582
+ "img_path": "images/48e1788e8b54b0cbed2da5f27924dd575db2bcb592bc657951c88fe854e1300c.jpg",
583
+ "text": "$$\n\\begin{array} { l } { \\mathcal { L } _ { \\mathrm { c o p y } } = - \\mathbb { E } \\left( \\displaystyle \\sum _ { i = 1 } ^ { n } \\mathbb { 1 } \\left( x _ { i } ^ { \\mathrm { M L M } } = x _ { i } ^ { \\mathrm { o r i g } } \\right) \\log p _ { \\mathrm { c o p y } } ( 1 | h _ { i } ) + \\mathbb { 1 } \\left( x _ { i } ^ { \\mathrm { M L M } } \\neq x _ { i } ^ { \\mathrm { o r i g } } \\right) \\log p _ { \\mathrm { c o p y } } ( 0 | h _ { i } ) \\right) , \\mathrm { ~ } \\forall i \\mathrm { ~ c o p y ~ } ( \\mathbb { E } ) , } \\\\ { \\mathcal { L } _ { \\mathrm { L M } } = - \\mathbb { E } \\left( \\displaystyle \\sum _ { i \\in \\mathcal { M } } \\log p _ { \\mathrm { L M } } \\left( x _ { i } ^ { \\mathrm { o r i g } } | h _ { i } \\right) \\right) } \\\\ { \\displaystyle \\qquad = - \\mathbb { E } \\left( \\displaystyle \\sum _ { i \\in \\mathcal { M } } \\log \\left( \\mathbb { 1 } \\left( x _ { i } ^ { \\mathrm { M L M } } = x _ { i } ^ { \\mathrm { o r i g } } \\right) p _ { \\mathrm { c o p y } } ^ { \\mathrm { s g } } ( 1 | h _ { i } ) + p _ { \\mathrm { c o p y } } ^ { \\mathrm { s g } } ( 0 | h _ { i } ) \\frac { \\exp ( x _ { i } ^ { \\top } h _ { i } ) } { \\sum _ { x _ { t } \\in V } \\exp ( x _ { t } ^ { \\top } h _ { i } ) } \\right) \\right) , \\mathrm { ~ } } \\\\ { \\mathcal { L } _ { \\mathrm { C L M } } = \\lambda _ { \\mathrm { c o p y } } \\mathcal { L } _ { \\mathrm { c o p y } } + \\mathcal { L } _ { \\mathrm { L M } } . } \\end{array}\n$$",
584
+ "text_format": "latex",
585
+ "bbox": [
586
+ 184,
587
+ 111,
588
+ 807,
589
+ 258
590
+ ],
591
+ "page_idx": 4
592
+ },
593
+ {
594
+ "type": "text",
595
+ "text": "The hyperparameter $\\lambda _ { \\mathrm { c o p y } }$ balances the weights of the two tasks. The binary cross entropy loss in Eqn. (2) explicitly trains the copy probability. We also use stop gradient (sg) to decouple the gradient backpropagation to $p _ { \\mathrm { c o p y } } ( \\cdot )$ from the LM task. This way, the main Transformer first learns the easier classification task and then uses it to help learn the harder LM task. The binary classification task is trained on all tokens while the language modeling task is trained only on masked positions. ",
596
+ "bbox": [
597
+ 173,
598
+ 262,
599
+ 825,
600
+ 333
601
+ ],
602
+ "page_idx": 4
603
+ },
604
+ {
605
+ "type": "text",
606
+ "text": "CLM combines the advantages of MLM and ELECTRA: The main Transformer is trained on all tokens with the help of the binary classification task while also being able to predict words, thus enjoying the efficiency benefits of ELECTRA and preserving the language modeling benefits. ",
607
+ "bbox": [
608
+ 173,
609
+ 338,
610
+ 825,
611
+ 381
612
+ ],
613
+ "page_idx": 4
614
+ },
615
+ {
616
+ "type": "text",
617
+ "text": "Sequence Contrastive Learning (SCL) forms a contrastive learning objective upon the sequence embeddings to learn more robust representations. Broadly, contrastive learning is to align a positive pair of instances, often different views of the same information [4, 34], in contrast to unrelated negative instances [22, 60]. The different views are often obtained by applying data augmentations on the same input, for example, rotation, cropping, and blurring on visual representations [4, 34], so that the neural networks can learn representations robust to these data alterations. ",
618
+ "bbox": [
619
+ 173,
620
+ 386,
621
+ 825,
622
+ 470
623
+ ],
624
+ "page_idx": 4
625
+ },
626
+ {
627
+ "type": "text",
628
+ "text": "In COCO-LM, the corrupted sequence $X ^ { \\mathrm { M L M } }$ already provides a form of data augmentation. We pair it with another augmentation, $X ^ { \\mathrm { c r o p } }$ , a randomly cropped contiguous span of $X ^ { \\mathrm { o r i g } }$ (the length of $X ^ { \\mathrm { c r o p } }$ is $9 0 \\%$ of $X ^ { \\mathrm { o r i g } }$ so that the major sequence meaning is preserved), to construct the positive pair and to contrast with random negatives. ",
629
+ "bbox": [
630
+ 173,
631
+ 474,
632
+ 825,
633
+ 532
634
+ ],
635
+ "page_idx": 4
636
+ },
637
+ {
638
+ "type": "text",
639
+ "text": "Specifically, a training batch $B$ in SCL includes a random set of corrupted and cropped sequences: 1contrastive pair $B = \\{ ( X _ { 1 } ^ { \\mathrm { M L M } } , X _ { 1 } ^ { \\mathrm { c r o p } } ) , \\dots , ( X _ { N } ^ { \\mathrm { M L M } } , X _ { N } ^ { \\mathrm { c r o p } } ) \\}$ $( X , X ^ { + } )$ N N consists of either $( X _ { k } ^ { \\mathrm { M L M } } , X _ { k } ^ { \\mathrm { c r o p } } )$ , with $X _ { k } ^ { \\mathrm { M L M } }$ and or $X _ { k } ^ { \\mathrm { c r o p } }$ $( \\ddot { X } _ { k } ^ { \\mathrm { c r o p } } , X _ { k } ^ { \\mathrm { M L M } } )$ originated from $X _ { k } ^ { \\mathrm { o r i g } }$ . A positive trast). The negative instances are all the remaining sequences in the batch $\\ddot { B } ^ { - } = B \\setminus \\{ ( X , X ^ { + } ) \\}$ contrastive loss is formulated as: ",
640
+ "bbox": [
641
+ 173,
642
+ 537,
643
+ 825,
644
+ 613
645
+ ],
646
+ "page_idx": 4
647
+ },
648
+ {
649
+ "type": "equation",
650
+ "img_path": "images/0468e73383b732e24a23d25d539ca44cc4d7d1296b11c731e78c4534179ebef4.jpg",
651
+ "text": "$$\n\\begin{array} { r l r } { { \\mathcal { L } _ { \\mathrm { S C L } } = - \\mathbb { E } ( \\log \\frac { \\exp ( \\cos ( s , s ^ { + } ) / \\tau ) } { \\exp ( \\cos ( s , s ^ { + } ) / \\tau ) + \\sum _ { X ^ { - } \\in B ^ { - } } \\exp ( \\cos ( s , s ^ { - } ) / \\tau ) } ) , } } \\\\ & { } & { = - \\mathbb { E } ( \\cos ( s , s ^ { + } ) / \\tau - \\log ( \\exp ( \\cos ( s , s ^ { + } ) / \\tau ) + \\sum _ { X ^ { - } \\in B ^ { - } } \\exp ( \\cos ( s , s ^ { - } ) / \\tau ) ) ) , } \\end{array}\n$$",
652
+ "text_format": "latex",
653
+ "bbox": [
654
+ 187,
655
+ 613,
656
+ 789,
657
+ 695
658
+ ],
659
+ "page_idx": 4
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "where $s , s ^ { + } , s ^ { - }$ are the representations of $X , X ^ { + } , X ^ { - }$ , respectively, from the main Transformer (i.e., $\\boldsymbol { h } _ { \\mathrm { [ C L S ] } } ,$ ). The similarity metric is cosine similarity (cos) and the temperature $\\tau$ is set to $1$ . ",
664
+ "bbox": [
665
+ 173,
666
+ 699,
667
+ 826,
668
+ 728
669
+ ],
670
+ "page_idx": 4
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "As shown in Wang et al. [55], the first term in Eqn. (3) $( \\cos ( s , s ^ { + } ) )$ improves alignment of the space. It encourages representations to be robust to the corruptions and the alterations on the original text. The second term in Eqn. (3) promotes uniformity. It pushes unrelated sequences apart in the representation space and ensures low cosine similarity between random data points. Several studies have observed improved generalization ability from better alignment and uniformity [16, 37, 55]. ",
675
+ "bbox": [
676
+ 173,
677
+ 733,
678
+ 825,
679
+ 804
680
+ ],
681
+ "page_idx": 4
682
+ },
683
+ {
684
+ "type": "text",
685
+ "text": "Aligning $X ^ { \\mathrm { M L M } }$ with $X ^ { \\mathrm { c r o p } }$ requires the main Transformer to produce sequence representations robust to both token-level (i.e., MLM replacements) and sequence-level (i.e., cropping) alterations. The model is thus encouraged to reason more using partially altered sequences to recover the original information. ",
686
+ "bbox": [
687
+ 174,
688
+ 809,
689
+ 825,
690
+ 866
691
+ ],
692
+ "page_idx": 4
693
+ },
694
+ {
695
+ "type": "text",
696
+ "text": "Overall Training. COCO-LM uses the following loss function: ",
697
+ "bbox": [
698
+ 173,
699
+ 871,
700
+ 593,
701
+ 887
702
+ ],
703
+ "page_idx": 4
704
+ },
705
+ {
706
+ "type": "equation",
707
+ "img_path": "images/151d5b1e75c7750cf345e470a3d88a0143c6fd346e8a419d39c2358543a28291.jpg",
708
+ "text": "$$\n\\mathcal { L } _ { \\mathrm { C O C O - L M } } = \\mathcal { L } _ { \\mathrm { M L M } } ^ { \\mathrm { A u x . } } + \\mathcal { L } _ { \\mathrm { C L M } } ^ { \\mathrm { M a i n } } + \\mathcal { L } _ { \\mathrm { S C L } } ^ { \\mathrm { M a i n } } .\n$$",
709
+ "text_format": "latex",
710
+ "bbox": [
711
+ 375,
712
+ 890,
713
+ 622,
714
+ 910
715
+ ],
716
+ "page_idx": 4
717
+ },
718
+ {
719
+ "type": "text",
720
+ "text": "The auxiliary Transformer is pretrained by masked language modeling (MLM) and generates corrupted sequences. The main Transformer is pretrained to correct the corruption (CLM) and to contrast the corrupted sequences with the cropped sequences (SCL). The two Transformers are pretrained jointly with the loss in Eqn. (4). The main Transformer is used in downstream applications. ",
721
+ "bbox": [
722
+ 174,
723
+ 90,
724
+ 825,
725
+ 147
726
+ ],
727
+ "page_idx": 5
728
+ },
729
+ {
730
+ "type": "text",
731
+ "text": "Network Configurations. Similar to ELECTRA, the auxiliary Transformer is smaller than the main model, but we use different configurations in the auxiliary model: (1) We reduce the number of layers to $1 / 3$ or $1 / 4$ (under base or large model setup, respectively) but keep its hidden dimension the same with the main model, instead of shrinking its hidden dimensions; (2) We disable dropout in it when sampling replacement tokens. We find such configurations empirically more effective and use them as the backbone of COCO-LM. The main Transformer follows the standard architecture of BERT/ELECTRA and can be easily adopted by downstream application pipelines with almost no changes. ",
732
+ "bbox": [
733
+ 174,
734
+ 152,
735
+ 825,
736
+ 265
737
+ ],
738
+ "page_idx": 5
739
+ },
740
+ {
741
+ "type": "text",
742
+ "text": "4 Experimental Setup ",
743
+ "text_level": 1,
744
+ "bbox": [
745
+ 176,
746
+ 287,
747
+ 372,
748
+ 305
749
+ ],
750
+ "page_idx": 5
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "Pretraining Settings. We employ three standard settings, base, base $^ { + + }$ , and large $^ { + + }$ . Base is the $\\mathbf { B E R T _ { B a s e } }$ training configuration [11]: Pretraining on Wikipedia and BookCorpus [63] (16 GB of texts) for 256 million samples on 512 token sequences (125K batches with 2048 batch size). We use the same corpus and 32, 768 uncased BPE vocabulary [47] as with TUPE [26]. ",
755
+ "bbox": [
756
+ 174,
757
+ 321,
758
+ 825,
759
+ 377
760
+ ],
761
+ "page_idx": 5
762
+ },
763
+ {
764
+ "type": "text",
765
+ "text": "$B a s e + +$ trains the base size model with larger corpora and/or more training steps. Following recent research [1, 31, 62], we add in OpenWebText [18], CC-News [31], and STORIES [52], to a total of 160 GB texts, and train for 4 billion (with 2048 batch size) samples [31]. We follow the prepossessing of UniLMV2 [1] and use 64, 000 cased BPE vocabulary. ",
766
+ "bbox": [
767
+ 174,
768
+ 383,
769
+ 825,
770
+ 439
771
+ ],
772
+ "page_idx": 5
773
+ },
774
+ {
775
+ "type": "text",
776
+ "text": "$L a r g e { + + }$ uses the same training corpora as $b a s e + +$ and pretrains for 4 billion samples (2048 batch size). Its Transformer configuration is the same with BERTLarge [11]. ",
777
+ "bbox": [
778
+ 174,
779
+ 445,
780
+ 820,
781
+ 474
782
+ ],
783
+ "page_idx": 5
784
+ },
785
+ {
786
+ "type": "text",
787
+ "text": "Model Architecture. Our base/base $^ { + + }$ model uses the $\\mathbf { B E R T _ { B a s e } }$ architecture [11]: 12 layer Transformer, 768 hidden size, plus T5 relative position encoding [40]. Our large $^ { + + }$ model is the same with $\\mathrm { B E R T _ { L a r g e } }$ , 24 layer and 1024 hidden size, plus T5 relative position encoding [40]. Our auxiliary network uses the same hidden size but a shallow 4-layer Transformer in base/base $^ { + + }$ and a 6-layer one in $l a r g e + +$ . When generating $X ^ { \\mathrm { M L M } }$ we disable dropout in the auxiliary model. ",
788
+ "bbox": [
789
+ 174,
790
+ 479,
791
+ 825,
792
+ 550
793
+ ],
794
+ "page_idx": 5
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "Downstream Tasks. We use the tasks included in GLUE [54] and $\\mathrm { S Q u A D } 2 . 0$ reading compression [41]. Please refer to Appendix A for more details about GLUE tasks. Standard hyperparameter search in fine-tuning is performed, and the search space can be found in Appendix B. The fine-tuning protocols use the open-source implementation of TUPE [26]. The reported results are the median of five random seeds on GLUE and SQuAD. ",
799
+ "bbox": [
800
+ 174,
801
+ 555,
802
+ 825,
803
+ 626
804
+ ],
805
+ "page_idx": 5
806
+ },
807
+ {
808
+ "type": "text",
809
+ "text": "Baselines. We compare with various pretrained models in each setting. To reduce the variance in data processing/environments, we also pretrain and fine-tune RoBERTa and ELECTRA under exactly the same setting with COCO-LM, marked with “(Ours)”. All numbers unless marked by “(Ours)” are from reported results in recent research (more details in Appendix C). ",
810
+ "bbox": [
811
+ 174,
812
+ 632,
813
+ 825,
814
+ 688
815
+ ],
816
+ "page_idx": 5
817
+ },
818
+ {
819
+ "type": "text",
820
+ "text": "Implementation Details. Our implementation builds upon the open-source implementation from MC-BERT [61] and fairseq [35]. More implementation details are mentioned in Appendix D. ",
821
+ "bbox": [
822
+ 173,
823
+ 694,
824
+ 823,
825
+ 722
826
+ ],
827
+ "page_idx": 5
828
+ },
829
+ {
830
+ "type": "text",
831
+ "text": "5 Evaluation Results ",
832
+ "text_level": 1,
833
+ "bbox": [
834
+ 174,
835
+ 746,
836
+ 362,
837
+ 762
838
+ ],
839
+ "page_idx": 5
840
+ },
841
+ {
842
+ "type": "text",
843
+ "text": "Three groups of experiments are conducted to evaluate COCO-LM and its two new pretraining tasks. ",
844
+ "bbox": [
845
+ 173,
846
+ 779,
847
+ 825,
848
+ 795
849
+ ],
850
+ "page_idx": 5
851
+ },
852
+ {
853
+ "type": "text",
854
+ "text": "5.1 Overall Results and Ablations ",
855
+ "text_level": 1,
856
+ "bbox": [
857
+ 176,
858
+ 814,
859
+ 421,
860
+ 829
861
+ ],
862
+ "page_idx": 5
863
+ },
864
+ {
865
+ "type": "text",
866
+ "text": "Overall Results are listed in Table 1. Under all three settings, COCO-LM outperforms all recent state-of-the-art pretraining models on GLUE average and SQuAD. It improves the state-of-the-art GLUE score by about one point under all three settings. COCO-LM also enjoys better parameter efficiency. Using less than $1 0 \\%$ of Megatron’s parameters, $\\mathrm { C O C O - L M _ { L a r g e + + } }$ matches the MNLI accuracy of Megatron3.9B, one of the largest pretrained BERT-style encoders. ",
867
+ "bbox": [
868
+ 174,
869
+ 842,
870
+ 825,
871
+ 911
872
+ ],
873
+ "page_idx": 5
874
+ },
875
+ {
876
+ "type": "table",
877
+ "img_path": "images/60cefa43ec47ef9531239e335ac10e76eda4144c99fd0af584e146167233b9d7.jpg",
878
+ "table_caption": [],
879
+ "table_footnote": [],
880
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Params</td><td colspan=\"9\">GLUE Single Task</td><td colspan=\"2\">SQuAD 2.0</td></tr><tr><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>RTE</td><td>MRPC</td><td>STS-B</td><td>AVG</td><td>EM</td><td>F1</td></tr><tr><td colspan=\"10\">Base Setting: BERT Base Size,Wikipedia + Book Corpus (16GB)</td><td></td><td></td><td></td></tr><tr><td>BERT[11]</td><td>110M</td><td>84.5/-</td><td>91.3</td><td>91.7</td><td>93.2</td><td>58.9</td><td>68.6</td><td>87.3</td><td>89.5</td><td>83.1</td><td>73.7</td><td>76.3</td></tr><tr><td>RoBERTa [31]</td><td>125M</td><td>84.7/-</td><td>1</td><td>1</td><td>92.7</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td></td><td>79.7</td></tr><tr><td>XLNet [62]</td><td>110M</td><td>85.8/85.4</td><td>1</td><td>1</td><td>92.7</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>78.5</td><td>81.3</td></tr><tr><td>ELECTRA [7]</td><td>110M</td><td>86.0/85.3</td><td>90.0</td><td>91.9</td><td>93.4</td><td>64.3</td><td>70.8</td><td>84.9</td><td>89.1</td><td>83.7</td><td>80.5</td><td>83.3</td></tr><tr><td>MC-BERT [61]</td><td>110M</td><td>85.7/85.2</td><td>89.7</td><td>91.3</td><td>92.3</td><td>62.1</td><td>75.0</td><td>86.0</td><td>88.0</td><td>83.7</td><td></td><td></td></tr><tr><td>DeBERTa [23]</td><td>134M</td><td>86.3/86.2</td><td>二</td><td>一</td><td>一</td><td>一</td><td>一</td><td>一</td><td>一</td><td></td><td>79.3</td><td>82.5</td></tr><tr><td>TUPE [26]</td><td>110M</td><td>86.2/86.2</td><td>91.3</td><td>92.2</td><td>93.3</td><td>63.6</td><td>73.6</td><td>89.9</td><td>89.2</td><td>84.9</td><td>1</td><td>1</td></tr><tr><td>RoBERTa (Ours)</td><td>110M</td><td>85.8/85.5</td><td>91.3</td><td>92.0</td><td>93.7</td><td>60.1</td><td>68.2</td><td>87.3</td><td>88.5</td><td>83.3</td><td>77.7</td><td>80.5</td></tr><tr><td>ELECTRA (Ours)</td><td>110M</td><td>86.9/86.7</td><td>91.9</td><td>92.6</td><td>93.6</td><td>66.2</td><td>75.1</td><td>88.2</td><td>89.7</td><td>85.5</td><td>79.7</td><td>82.6</td></tr><tr><td>COCO-LM</td><td>110M</td><td>88.5/88.3</td><td>92.0</td><td>93.1</td><td>93.2</td><td>63.9</td><td>84.8</td><td>91.4</td><td>90.3</td><td>87.2</td><td>82.4</td><td>85.2</td></tr><tr><td colspan=\"10\">Base++ Seting: BERT Base Size,Bigger Training Data,and/or More Training Steps</td><td></td><td></td><td></td></tr><tr><td>XLNet [62]</td><td>110M</td><td>86.8/-</td><td>91.4</td><td>91.7</td><td>94.7</td><td>60.2</td><td>74.0</td><td>88.2</td><td>89.5</td><td>84.6</td><td>80.2</td><td></td></tr><tr><td>RoBERTa [31]</td><td>125M</td><td>87.6/-</td><td>91.9</td><td>92.8</td><td>94.8</td><td>63.6</td><td>78.7</td><td>90.2</td><td>91.2</td><td>86.4</td><td>80.5</td><td>83.7</td></tr><tr><td>UniLMV2[1]</td><td>110M</td><td>88.5/-</td><td>91.7</td><td>93.5</td><td>95.1</td><td>65.2</td><td>81.3</td><td>91.8</td><td>91.0</td><td>87.1</td><td>83.3</td><td>86.1</td></tr><tr><td>DeBERTa [23]</td><td>134M</td><td>88.8/88.5</td><td>一</td><td>一</td><td>一</td><td>1</td><td>一</td><td>一</td><td>一</td><td></td><td>83.1</td><td>86.2</td></tr><tr><td>CLEAR [59]</td><td>110M</td><td>86.7/-</td><td>90.0</td><td>92.9</td><td>94.5</td><td>64.3</td><td>78.3</td><td>89.2</td><td>89.8</td><td>85.7</td><td>一</td><td>1</td></tr><tr><td>COCO-LM</td><td>134M</td><td>90.2/90.0</td><td>92.2</td><td>94.2</td><td>94.6</td><td>67.3</td><td>87.4</td><td>91.2</td><td>91.8</td><td>88.6</td><td>85.4</td><td>88.1</td></tr><tr><td colspan=\"10\">Large++ Setting: BERTLarge Size,Bigger Training Data,and More Training Steps</td><td></td><td></td><td></td></tr><tr><td>XLNet [62]</td><td>360M</td><td>90.8/90.8</td><td>92.3</td><td>94.9</td><td>97.0</td><td>69.0</td><td>85.9</td><td>90.8</td><td>92.5</td><td>89.2</td><td>87.9</td><td>90.6</td></tr><tr><td>RoBERTa [31]</td><td>356M</td><td>90.2/90.2</td><td>92.2</td><td>94.7</td><td>96.4</td><td>68.0</td><td>86.6</td><td>90.9</td><td>92.4</td><td>88.9</td><td>86.5</td><td>89.4</td></tr><tr><td>ELECTRA[7]</td><td>335M</td><td>90.9/-</td><td>92.4</td><td>95.0</td><td>96.9</td><td>69.1</td><td>88.0</td><td>90.8</td><td>92.6</td><td>89.4</td><td>88.0</td><td>90.6</td></tr><tr><td>DeBERTa [23]</td><td>384M</td><td>91.1/91.1</td><td>92.3</td><td>95.3</td><td>96.8</td><td>70.5</td><td>1</td><td>1</td><td>1</td><td>1</td><td>88.0</td><td>90.7</td></tr><tr><td>COCO-LM</td><td>367M</td><td>91.4/91.6</td><td>92.8</td><td>95.7</td><td>96.9</td><td>73.9</td><td>91.0</td><td>92.2</td><td>92.7</td><td>90.8</td><td>88.2</td><td>91.0</td></tr><tr><td>Megatron1.3B [49]</td><td>1.3B</td><td>90.9/91.0</td><td>92.6</td><td>1</td><td>1</td><td></td><td>一</td><td></td><td>1</td><td></td><td>87.1</td><td>90.2</td></tr><tr><td>Megatron3.9B [49]</td><td>3.9B</td><td>91.4/91.4</td><td>92.7</td><td>1</td><td></td><td>1</td><td></td><td></td><td>1</td><td></td><td>88.5</td><td>91.2</td></tr></table>",
881
+ "bbox": [
882
+ 174,
883
+ 89,
884
+ 823,
885
+ 409
886
+ ],
887
+ "page_idx": 6
888
+ },
889
+ {
890
+ "type": "text",
891
+ "text": "Table 1: Results on GLUE and SQuAD 2.0 development set. All results are single-task, single-model fine-tuning. Results not available in public reports are marked as “–”. DeBERTa reported RTE, MRPC and STS-B results by fine-tuning from MNLI checkpoints which are not single-task results. We use Spearman correlation for STS, Matthews correlation for CoLA, and accuracy for the rest on GLUE. AVG is the average of the eight tasks on GLUE. All baseline results unless marked by (Ours) are reported by previous research. ",
892
+ "bbox": [
893
+ 173,
894
+ 412,
895
+ 825,
896
+ 497
897
+ ],
898
+ "page_idx": 6
899
+ },
900
+ {
901
+ "type": "table",
902
+ "img_path": "images/fd3062d90e85ad4b2a1ecd68665ab53b140aae24bc83d4255bf47749796908bf.jpg",
903
+ "table_caption": [],
904
+ "table_footnote": [],
905
+ "table_body": "<table><tr><td>Model</td><td>Params</td><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>RTE</td><td>MRPC</td><td>STS-B</td><td>AVG</td></tr><tr><td colspan=\"9\">Base/Base++ Setting: BERT Base Size</td><td></td></tr><tr><td>BERTBase</td><td>110M</td><td>84.6/83.4</td><td>89.2</td><td>90.5</td><td>93.5</td><td>52.1</td><td>66.4</td><td>84.8</td><td>85.8</td><td>80.8</td></tr><tr><td>ELECTRABase++</td><td>110M</td><td>88.5/88.0</td><td>89.5</td><td>93.1</td><td>96.0</td><td>64.6</td><td>75.2</td><td>88.1</td><td>90.2</td><td>85.6</td></tr><tr><td>COCO-LMBase++</td><td>134M</td><td>89.8/89.3</td><td>89.8</td><td>94.2</td><td>95.6</td><td>68.6</td><td>82.3</td><td>88.5</td><td>90.3</td><td>87.4</td></tr><tr><td colspan=\"9\">Large/Large++ Seting: BERT Large Size</td><td></td></tr><tr><td>BERTLarge</td><td>335M</td><td>86.7/85.9</td><td>89.3</td><td>92.7</td><td>94.9</td><td>60.5</td><td>70.1</td><td>85.4</td><td>86.5</td><td>83.2</td></tr><tr><td>ELECTRALarge++</td><td>335M</td><td>90.7/90.2</td><td>90.4</td><td>95.5</td><td>96.7</td><td>68.1</td><td>86.1</td><td>89.2</td><td>91.7</td><td>88.5</td></tr><tr><td>COCO-LMLarge++</td><td>367M</td><td>91.6/91.1</td><td>90.5</td><td>95.8</td><td>96.7</td><td>70.5</td><td>89.2</td><td>88.4</td><td>91.8</td><td>89.3</td></tr></table>",
906
+ "bbox": [
907
+ 174,
908
+ 513,
909
+ 823,
910
+ 642
911
+ ],
912
+ "page_idx": 6
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "Table 2: GLUE test set results obtained from the GLUE leaderboard. We perform hyperparameter search for each task with ten random seeds and use the best development set model for test predictions. All results are from vanilla single-task fine-tuning (no ensemble, task-specific tricks, etc.). ",
917
+ "bbox": [
918
+ 174,
919
+ 652,
920
+ 825,
921
+ 695
922
+ ],
923
+ "page_idx": 6
924
+ },
925
+ {
926
+ "type": "text",
927
+ "text": "Table 2 shows GLUE test set results which further confirm the advantages of COCO-LM over previous methods. ",
928
+ "bbox": [
929
+ 174,
930
+ 724,
931
+ 823,
932
+ 752
933
+ ],
934
+ "page_idx": 6
935
+ },
936
+ {
937
+ "type": "text",
938
+ "text": "Efficiency. In downstream tasks, the efficiency of COCO-LM is the same with BERT. In pretraining, the auxiliary model and SCL introduce extra cost. However, as shown in Figure 3, COCO-LM is more efficient in GPU hours. It outperforms RoBERTa & ELECTRA by $1 +$ points on MNLI with the same GPU hours and reaches their accuracy with around $6 0 \\%$ & $5 0 \\%$ GPU hours, respectively. ",
939
+ "bbox": [
940
+ 174,
941
+ 758,
942
+ 825,
943
+ 814
944
+ ],
945
+ "page_idx": 6
946
+ },
947
+ {
948
+ "type": "text",
949
+ "text": "Ablation Studies. Table 3 shows the ablations of COCO-LM under the base setting on GLUE DEV. ",
950
+ "bbox": [
951
+ 173,
952
+ 820,
953
+ 823,
954
+ 835
955
+ ],
956
+ "page_idx": 6
957
+ },
958
+ {
959
+ "type": "text",
960
+ "text": "Pretraining Task. With only RTD, our backbone model with the shallow auxiliary Transformer is quite effective. CLM and SCL both provide additional improvements on MNLI and GLUE average. Their advantages are better observed on different tasks, for example, CLM on MNLI-mm and SCL on RTE and MRPC. Combining the two in COCO-LM provides better overall effectiveness. In later experiments, we further analyze the benefits of these two tasks. ",
961
+ "bbox": [
962
+ 174,
963
+ 842,
964
+ 825,
965
+ 911
966
+ ],
967
+ "page_idx": 6
968
+ },
969
+ {
970
+ "type": "table",
971
+ "img_path": "images/d2b58bb6c1c54f09e25b712c6e2942447aa58b38e114da9cd3eed138883fa24a.jpg",
972
+ "table_caption": [],
973
+ "table_footnote": [
974
+ "Table 3: Ablations on GLUE Dev. that eliminate (w/o.), keep (Only) or switch (w.) one component. "
975
+ ],
976
+ "table_body": "<table><tr><td>Group</td><td>Method</td><td>MNLI-(m/mm)</td><td>QQP</td><td>QNLI</td><td>SST-2</td><td>CoLA</td><td>RTE</td><td>MRPC</td><td>STS-B</td><td>AVG</td></tr><tr><td></td><td>COCO-LMBase</td><td>88.5/88.3</td><td>92.0</td><td>93.1</td><td>93.2</td><td>63.9</td><td>84.8</td><td>91.4</td><td>90.3</td><td>87.2</td></tr><tr><td rowspan=\"3\">Pretraining Task</td><td>RTDOnly</td><td>88.4/88.2</td><td>92.1</td><td>93.5</td><td>92.7</td><td>67.3</td><td>80.5</td><td>89.0</td><td>90.9</td><td>86.8</td></tr><tr><td>CLMOnly</td><td>88.6/88.4</td><td>92.0</td><td>93.2</td><td>93.7</td><td>67.4</td><td>80.1</td><td>90.0</td><td>90.4</td><td>86.9</td></tr><tr><td>SCL +RTD</td><td>88.6/88.2</td><td>92.1</td><td>93.5</td><td>93.8</td><td>64.3</td><td>82.7</td><td>90.2</td><td>90.6</td><td>86.9</td></tr><tr><td>Network Seting</td><td>w/o. Rel-Pos w. ELECTRA&#x27;s Auxiliary</td><td>88.2/87.7</td><td>92.2</td><td>93.4</td><td>93.7</td><td>68.8</td><td>82.7</td><td>91.2</td><td>90.6</td><td>87.6</td></tr><tr><td rowspan=\"2\">Training</td><td></td><td>88.0/87.7</td><td>91.9</td><td>92.7</td><td>93.5</td><td>64.3</td><td>81.2</td><td>89.5</td><td>89.7</td><td>86.3</td></tr><tr><td>w.Random Replacements</td><td>84.9/84.7</td><td>91.4</td><td>91.1</td><td>91.4</td><td>41.6</td><td>70.0</td><td>87.3</td><td>87.1</td><td>80.6</td></tr><tr><td>Signal</td><td>w. Converged Auxiliary</td><td>88.3/88.1</td><td>92.0</td><td>92.8</td><td>94.3</td><td>64.2</td><td>78.3</td><td>90.4</td><td>90.2</td><td>86.3</td></tr><tr><td rowspan=\"3\">CLM Setup</td><td>All-Token LM Only</td><td>87.2/87.0</td><td></td><td>92.6</td><td>93.7</td><td></td><td></td><td>88.5</td><td>89.7</td><td>84.7</td></tr><tr><td>CLM w/o. Copy</td><td>88.0/87.9</td><td>91.8 91.8</td><td>93.1</td><td>94.4</td><td>60.6 66.6</td><td>74.0 76.9</td><td>89.5</td><td>90.1</td><td>86.3</td></tr><tr><td>CLM w/o. Stop-grad</td><td>88.5/88.2</td><td>92.0</td><td>92.9</td><td>94.3</td><td>66.5</td><td>80.9</td><td>90.0</td><td>90.6</td><td>86.9</td></tr></table>",
977
+ "bbox": [
978
+ 174,
979
+ 88,
980
+ 821,
981
+ 239
982
+ ],
983
+ "page_idx": 7
984
+ },
985
+ {
986
+ "type": "image",
987
+ "img_path": "images/7c7b853b454b46cee7bf8429edacf37572ac7613714aa9383792bc931834deea.jpg",
988
+ "image_caption": [
989
+ "Figure 3: $\\mathrm { C O C O - L M _ { B a s e } }$ on MNLI Dev. ( $y$ -axes) at different pretraining hours on four DGX-2 nodes (64 V100 GPUs). The final training hours and accuracy of RoBERTa (Ours) and ELECTRA (Ours) measured in the same settings are marked. "
990
+ ],
991
+ "image_footnote": [],
992
+ "bbox": [
993
+ 179,
994
+ 282,
995
+ 580,
996
+ 404
997
+ ],
998
+ "page_idx": 7
999
+ },
1000
+ {
1001
+ "type": "image",
1002
+ "img_path": "images/b0838b4ee1160733d8845b67109fdb9dc7efa9acb20b3820901e16797ecc717f.jpg",
1003
+ "image_caption": [
1004
+ "Figure 4: The performance of COCO- $\\mathbf { \\cdot L M _ { B a s e } }$ when pretrained with different crop fractions. The $x$ -axis is the fraction of $X ^ { \\mathrm { o r i g } }$ being kept (no cropping is $1 0 0 \\%$ ). "
1005
+ ],
1006
+ "image_footnote": [],
1007
+ "bbox": [
1008
+ 612,
1009
+ 281,
1010
+ 820,
1011
+ 388
1012
+ ],
1013
+ "page_idx": 7
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "Architecture. Removing relative position encoding (Rel-Pos) leads to better numbers on some tasks but significantly hurts MNLI. Using a shallow auxiliary network and keeping the same hidden dimension (768) is more effective than ELECTRA’s 12-layer but 256-hidden dimension generator. ",
1018
+ "bbox": [
1019
+ 176,
1020
+ 502,
1021
+ 820,
1022
+ 545
1023
+ ],
1024
+ "page_idx": 7
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "Pretraining Signal Construction. Using randomly replaced tokens to corrupt text sequence hurts significantly. Using a converged auxiliary network to pretrain the main model also hurts. It is better to pretrain the two Transformers together, as the auxiliary model gradually increases the difficulty of the corrupted sequences and provides a natural learning curriculum for the main Transformer. ",
1029
+ "bbox": [
1030
+ 174,
1031
+ 551,
1032
+ 825,
1033
+ 607
1034
+ ],
1035
+ "page_idx": 7
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "CLM Setup. Disabling the multi-task learning and using All-Token MLM [7] reduces model accuracy. The copy mechanism is effective. The benefits of the stop gradient operation are more on stability (preventing training divergence). ",
1040
+ "bbox": [
1041
+ 174,
1042
+ 613,
1043
+ 825,
1044
+ 655
1045
+ ],
1046
+ "page_idx": 7
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "5.2 Analyses of Contrastive Learning with SCL ",
1051
+ "text_level": 1,
1052
+ "bbox": [
1053
+ 173,
1054
+ 676,
1055
+ 514,
1056
+ 691
1057
+ ],
1058
+ "page_idx": 7
1059
+ },
1060
+ {
1061
+ "type": "text",
1062
+ "text": "This group of experiments analyzes the behavior of SCL. All experiments use the base setting. ",
1063
+ "bbox": [
1064
+ 169,
1065
+ 704,
1066
+ 794,
1067
+ 719
1068
+ ],
1069
+ "page_idx": 7
1070
+ },
1071
+ {
1072
+ "type": "text",
1073
+ "text": "Ablation on Data Augmentation. Figure 4 shows the effects of the cropping operation when forming positive SCL pairs with the corrupted sequence. Using the original sequence results in worse GLUE accuracy. It is less informative as the model no longer needs to learn representations robust to sequence-level alteration. Cropping too much (e.g., only keeping $7 0 \\%$ of the original sequence), may hurt as it can alter the semantics too much. Empirically a simple alteration works the best, similar to the observations in recent research [4, 16, 22]. ",
1074
+ "bbox": [
1075
+ 174,
1076
+ 724,
1077
+ 825,
1078
+ 809
1079
+ ],
1080
+ "page_idx": 7
1081
+ },
1082
+ {
1083
+ "type": "text",
1084
+ "text": "Alignment and Uniformity. Figure 5 plots the distribution of cosine similarities between random sequence pairs and similar ones using representations pretrained by COCO-LM. The representation space from COCO-LM is drastically different from those in Figure 1. With COCO-LM, similar pairs are more aligned and random pairs are distributed more uniformly. Many similar pairs have near 1 cosine similarity and are clearly separated from random pairs which center around 0. The t-SNE [9] plot in Figure 6 further demonstrates the benefits of SCL. The similar sentence pairs (marked by same shapes) are aligned closer when pretrained with SCL. Their average cosine similarity is 0.925 when pretrained with SCL, while is 0.863 without SCL. This better alignment and uniformity is achieved by COCO-LM with SCL via pretraining, without using task-specific data nor supervised labels. ",
1085
+ "bbox": [
1086
+ 174,
1087
+ 814,
1088
+ 825,
1089
+ 911
1090
+ ],
1091
+ "page_idx": 7
1092
+ },
1093
+ {
1094
+ "type": "image",
1095
+ "img_path": "images/82aaaec6538ad34bc36ab524aaa756ff25c2f6723407c61d051220eb759a68b2.jpg",
1096
+ "image_caption": [
1097
+ "Figure 5: Cosine similarity of sequence pairs randomly sampled from pretraining corpus and most similar pairs from STS-B using [CLS] from COCO- $\\mathrm { L M } _ { \\mathrm { B a s e } }$ . "
1098
+ ],
1099
+ "image_footnote": [],
1100
+ "bbox": [
1101
+ 179,
1102
+ 75,
1103
+ 374,
1104
+ 176
1105
+ ],
1106
+ "page_idx": 8
1107
+ },
1108
+ {
1109
+ "type": "image",
1110
+ "img_path": "images/c1d97d0fc27a4c3c0d227b63fc15ba16a052a5c2bfaf1aa791b9ae2c82470dd6.jpg",
1111
+ "image_caption": [
1112
+ "Figure 6: The t-SNE of sequence representations learned with or without SCL. The points are sampled from the most semantically similar sentences pairs from STS-B (with 5-score labels). The [CLS] embeddings are not fine-tuned. Some randomly selected similar pairs are marked by same shapes. "
1113
+ ],
1114
+ "image_footnote": [],
1115
+ "bbox": [
1116
+ 419,
1117
+ 75,
1118
+ 816,
1119
+ 190
1120
+ ],
1121
+ "page_idx": 8
1122
+ },
1123
+ {
1124
+ "type": "image",
1125
+ "img_path": "images/992113321700f003cba33a4d9ae2e2e1ae1bb00ef61b749c875f454276b56dcf.jpg",
1126
+ "image_caption": [
1127
+ "Figure 7: Analyses of SCL. Figs. (a) and (b) show the average cosine similarity between the [CLS] embeddings of positive and negative contrastive pairs during pretraining. Figs. (c) and (d) show the few-shot accuracy on MNLI with different fractions of MNLI training set used ( $\\scriptstyle { \\dot { x } }$ -axes). The error bars mark the max/min and the solid lines are the average of five fine-tuning runs. "
1128
+ ],
1129
+ "image_footnote": [],
1130
+ "bbox": [
1131
+ 173,
1132
+ 285,
1133
+ 826,
1134
+ 388
1135
+ ],
1136
+ "page_idx": 8
1137
+ },
1138
+ {
1139
+ "type": "text",
1140
+ "text": "",
1141
+ "bbox": [
1142
+ 173,
1143
+ 472,
1144
+ 821,
1145
+ 500
1146
+ ],
1147
+ "page_idx": 8
1148
+ },
1149
+ {
1150
+ "type": "text",
1151
+ "text": "Regularizing the Representation Learning for Better Few-Shot Ability. One would expect any pretrained Transformers to easily align a pair of corrupted sequence and cropped sequence as the two share about $8 0 \\%$ tokens. However, as shown in Figure 7a, that is not the case: Without SCL, the cosine similarity of the positive pairs is even lower than random negatives. SCL is necessary to regularize the representation space and to reduce the risk of degeneration (Figure 7b). ",
1152
+ "bbox": [
1153
+ 174,
1154
+ 506,
1155
+ 825,
1156
+ 575
1157
+ ],
1158
+ "page_idx": 8
1159
+ },
1160
+ {
1161
+ "type": "text",
1162
+ "text": "Similar to empirical observations and theoretical analyses in recent research [14, 16, 55], a more regularized representation space results in better generalization ability in scenarios with limited labels. Figure $\\mathrm { 7 c }$ and 7d show the results when COCO-LM are trained (via standard fine-tuning) with only a fraction of MNLI labels. The improvements brought by SCL are more significant when fewer fine-tuning labels are available. With $1 \\%$ MNLI labels, pretraining with SCL improves MNLI- $. \\mathrm { m } / \\mathrm { m m }$ accuracy by $0 . 8 / 0 . 5$ compared to that without SCL. Using only $1 0 \\% / 2 0 \\%$ labels, COCO-LM with SCL reaches similar MNLI accuracy with RoBERTa (Ours)/ELECTRA (Ours) fine-tuned with all labels, respectively. ",
1163
+ "bbox": [
1164
+ 174,
1165
+ 582,
1166
+ 825,
1167
+ 693
1168
+ ],
1169
+ "page_idx": 8
1170
+ },
1171
+ {
1172
+ "type": "text",
1173
+ "text": "5.3 Analyses of Language Modeling with CLM ",
1174
+ "text_level": 1,
1175
+ "bbox": [
1176
+ 174,
1177
+ 709,
1178
+ 513,
1179
+ 724
1180
+ ],
1181
+ "page_idx": 8
1182
+ },
1183
+ {
1184
+ "type": "text",
1185
+ "text": "The last group of experiments studies the effectiveness and benefits of CLM. ",
1186
+ "bbox": [
1187
+ 176,
1188
+ 734,
1189
+ 674,
1190
+ 750
1191
+ ],
1192
+ "page_idx": 8
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "Ablations on Training Configurations. Figure 8 illustrates pretraining process with CLM and All-Token MLM. The plots demonstrate the difficulty of language modeling upon corrupted text sequences. It is quite an unbalanced task. For the majority of the tokens (Original) the task is simply to copy its input at the same position. For the replaced tokens $( 7 - 8 \\%$ total), however, the model needs to detect the abnormality brought by the auxiliary model and recover the original token. Implicitly training the copy mechanism as part of the hard LM task is not effective: The copy accuracy of All-Token MLM is much lower, and thus the LM head may confuse original tokens with replaced ones. As shown in Table 3 and ELECTRA [7], pretraining with All-Token MLM performs worse than using the RTD task, though the latter is equivalent to only training the copy mechanism. The multi-task learning of CLM is necessary for the main Transformer to stably learn the language modeling task upon the corrupted text sequence. ",
1197
+ "bbox": [
1198
+ 174,
1199
+ 756,
1200
+ 825,
1201
+ 909
1202
+ ],
1203
+ "page_idx": 8
1204
+ },
1205
+ {
1206
+ "type": "image",
1207
+ "img_path": "images/7f4f1d35a5619b20f4bb5dab0e62dc152a989762d0e164bcb37c0492f45877fe.jpg",
1208
+ "image_caption": [
1209
+ "Figure 8: The copying accuracy and the language modeling accuracy $y$ -axes) of CLM and All-Token MLM at different pretraining steps ( $x$ -axes, in 10K scale). The accuracy is averaged on tokens that are replaced by the auxiliary Transformer (Replaced) or those from the original input text (Original). "
1210
+ ],
1211
+ "image_footnote": [],
1212
+ "bbox": [
1213
+ 174,
1214
+ 88,
1215
+ 823,
1216
+ 189
1217
+ ],
1218
+ "page_idx": 9
1219
+ },
1220
+ {
1221
+ "type": "text",
1222
+ "text": "Prompt-Based Fine-Tuning with CLM. Table 4 includes the prompt-based fine-tuning experiments on MNLI for RoBERTa and COCO-LM under $b a s e + +$ and large $^ { + + }$ sizes, following the same few-shot manual prompt fine-tuning with demonstration setup in LM-BFF [15]. We use $\\{ 3 e - 6 , 4 e - 6 , 5 e - 6 \\}$ for the learning rate search of COCO-LM base++/large++ model, with everything else kept same as described in LM-BFF. With exactly the same pipeline, COCOLM outperforms RoBERTa under both $b a s e + +$ and $l a r g e + +$ sizes by significant margins on MNLI$\\mathrm { m } / \\mathrm { m m }$ . Such observations are interesting as COCOLM’s main Transformer does not even see any ",
1223
+ "bbox": [
1224
+ 174,
1225
+ 267,
1226
+ 517,
1227
+ 446
1228
+ ],
1229
+ "page_idx": 9
1230
+ },
1231
+ {
1232
+ "type": "table",
1233
+ "img_path": "images/b69ebfa31e564bad91527412c0c106a5b7acd7bf62724bb1f125afb7db4b1808.jpg",
1234
+ "table_caption": [],
1235
+ "table_footnote": [],
1236
+ "table_body": "<table><tr><td>Model</td><td>MNLI-m</td><td>MNLI-mm</td></tr><tr><td>RoBERTaBase++</td><td>60.1 (1.5)</td><td>61.8 (1.2)</td></tr><tr><td>COCO-LMBase++</td><td>66.5 (2.1)</td><td>68.0 (2.3)</td></tr><tr><td>RoBERTaLarge++</td><td>70.7 (1.3)</td><td>72.0 (1.2)</td></tr><tr><td>COCO-LMLarge++</td><td>72.0 (1.5)</td><td>73.3 (1.1)</td></tr></table>",
1237
+ "bbox": [
1238
+ 532,
1239
+ 270,
1240
+ 821,
1241
+ 347
1242
+ ],
1243
+ "page_idx": 9
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "text": "Table 4: Few-shot prompt-based fine-tuning using RoBERTa and COCO-LM trained on 16 samples per class. Mean (and standard deviation) accuracy results over 5 different splits on MNLI- $. \\mathrm { m } / \\mathrm { m m }$ are shown. ",
1248
+ "bbox": [
1249
+ 529,
1250
+ 357,
1251
+ 823,
1252
+ 426
1253
+ ],
1254
+ "page_idx": 9
1255
+ },
1256
+ {
1257
+ "type": "text",
1258
+ "text": "[MASK] tokens during pretraining but still performs well on predicting masked tokens for promptbased learning. Note that ELECTRA and COCO-LM variants without the CLM task are not applicable: Their main Transformers are not pretrained by language modeling tasks (thus no language modeling capability is learned to generate prompt label words). This points out the importance, if not necessity, of COCO-LM in the family of ELECTRA-style pretraining models. With the benefits and rapid developments of prompt-based approaches, the lack of language modeling capability is going to limit the potential of ELECTRA’s self-supervised learning framework in many real-world scenarios. COCO-LM not only addresses this limitation but also provides better prompt-based learning results. ",
1259
+ "bbox": [
1260
+ 174,
1261
+ 446,
1262
+ 826,
1263
+ 558
1264
+ ],
1265
+ "page_idx": 9
1266
+ },
1267
+ {
1268
+ "type": "text",
1269
+ "text": "6 Conclusions and Future Work ",
1270
+ "text_level": 1,
1271
+ "bbox": [
1272
+ 174,
1273
+ 582,
1274
+ 457,
1275
+ 599
1276
+ ],
1277
+ "page_idx": 9
1278
+ },
1279
+ {
1280
+ "type": "text",
1281
+ "text": "In this paper, we present COCO-LM, which pretrains language models using Corrective Language Modeling and Sequence Contrastive Learning upon corrupted text sequences. With standard pretraining data and Transformer architectures, COCO-LM improves the accuracy on the GLUE and SQuAD benchmarks, while also being more efficient in utilizing pretraining computing resources and network parameters. ",
1282
+ "bbox": [
1283
+ 174,
1284
+ 616,
1285
+ 825,
1286
+ 686
1287
+ ],
1288
+ "page_idx": 9
1289
+ },
1290
+ {
1291
+ "type": "text",
1292
+ "text": "One limitation of this work is that the contrastive pairs are constructed by simple cropping and MLM replacements. Recent studies have shown the effectiveness of advanced data augmentation techniques in fine-tuning language models [16, 38, 51]. A future research direction is to explore better ways to construct contrastive pairs in language model pretraining. ",
1293
+ "bbox": [
1294
+ 174,
1295
+ 693,
1296
+ 825,
1297
+ 748
1298
+ ],
1299
+ "page_idx": 9
1300
+ },
1301
+ {
1302
+ "type": "text",
1303
+ "text": "Despite the empirical advantage of this auxiliary-main dual model framework, the auxiliary Transformer training is not influenced by the main Transformer nor learns to generate the optimal pretraining signals for the main model. To better understand and tailor the training of the auxiliary model to the main model is another important future research direction. ",
1304
+ "bbox": [
1305
+ 174,
1306
+ 755,
1307
+ 825,
1308
+ 810
1309
+ ],
1310
+ "page_idx": 9
1311
+ },
1312
+ {
1313
+ "type": "text",
1314
+ "text": "Acknowledgments ",
1315
+ "text_level": 1,
1316
+ "bbox": [
1317
+ 176,
1318
+ 835,
1319
+ 328,
1320
+ 852
1321
+ ],
1322
+ "page_idx": 9
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "text": "We sincerely thank Guolin Ke for discussions and advice on model implementation. We also thank anonymous reviewers for valuable and insightful feedback, especially the suggestion of adding prompt-based fine-tuning experiments. ",
1327
+ "bbox": [
1328
+ 176,
1329
+ 869,
1330
+ 823,
1331
+ 911
1332
+ ],
1333
+ "page_idx": 9
1334
+ },
1335
+ {
1336
+ "type": "text",
1337
+ "text": "References ",
1338
+ "text_level": 1,
1339
+ "bbox": [
1340
+ 174,
1341
+ 90,
1342
+ 266,
1343
+ 106
1344
+ ],
1345
+ "page_idx": 10
1346
+ },
1347
+ {
1348
+ "type": "text",
1349
+ "text": "[1] Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Songhao Piao, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. UniLMv2: Pseudo-masked language models for unified language model pre-training. In ICML, 2020. [2] Luisa Bentivogli, Peter Clark, Ido Dagan, and Danilo Giampiccolo. The fifth pascal recognizing textual entailment challenge. In TAC, 2009. [3] Daniel Cer, Mona Diab, Eneko Agirre, Iñigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In International Workshop on Semantic Evaluation (SemEval), 2017. \n[4] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. [5] Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of BERT’s attention. In ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2019. [6] Kevin Clark, Minh-Thang Luong, Quoc Le, and Christopher D Manning. Pre-training transformers as energy-based cloze models. In EMNLP, 2020. [7] Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. ELECTRA: Pre-training text encoders as discriminators rather than generators. In ICLR, 2020. [8] Peter Clark, Oyvind Tafjord, and Kyle Richardson. Transformers as soft reasoners over language. In IJCAI, 2020. \n[9] Andy Coenen, Emily Reif, Ann Yuan, Been Kim, Adam Pearce, Fernanda Viégas, and Martin Wattenberg. Visualizing and measuring the geometry of BERT. In NeurIPS, 2019. \n[10] Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, 2005. \n[11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019. \n[12] William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In International Workshop on Paraphrasing (IWP), 2005. \n[13] Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. In NeurIPS, 2019. \n[14] Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Representation degeneration problem in training natural language generation models. In ICLR, 2019. \n[15] Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. In ACL, 2021. \n[16] Tianyu Gao, Xingcheng Yao, and Danqi Chen. SimCSE: Simple contrastive learning of sentence embeddings. In EMNLP, 2021. \n[17] Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third pascal recognizing textual entailment challenge. In ACL-PASCAL workshop on textual entailment and paraphrasing, 2007. \n[18] Aaron Gokaslan and Vanya Cohen. Openwebtext corpus. http://Skylion007.github.io/ OpenWebTextCorpus, 2019. \n[19] Beliz Gunel, Jingfei Du, Alexis Conneau, and Ves Stoyanov. Supervised contrastive learning for pre-trained language model fine-tuning. In ICLR, 2021. \n[20] Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. REALM: Retrievalaugmented language model pre-training. In ICML, 2020. \n[21] R Bar Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second pascal recognising textual entailment challenge. In PASCAL Challenges Workshop on Recognising Textual Entailment, 2006. \n[22] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. \n[23] Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. DeBERTa: Decoding-enhanced bert with disentangled attention. In ICLR, 2021. \n[24] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. SpanBERT: Improving pre-training by representing and predicting spans. In TACL, 2019. \n[25] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. \n[26] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking the positional encoding in language pre-training. In ICLR, 2021. \n[27] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A lite BERT for self-supervised learning of language representations. In ICLR, 2020. \n[28] Teven Le Scao and Alexander M Rush. How many data points is a prompt worth? In NAACL-HLT, 2021. \n[29] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In ACL, 2019. \n[30] Bohan Li, Hao Zhou, Junxian He, Mingxuan Wang, Yiming Yang, and Lei Li. On the sentence embeddings from pre-trained language models. In EMNLP, 2020. \n[31] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019. \n[32] Yi Luan, Jacob Eisenstein, Kristina Toutanove, and Michael Collins. Sparse, dense, and attentional representations for text retrieval. In TACL, 2021. \n[33] Yu Meng, Yunyi Zhang, Jiaxin Huang, Chenyan Xiong, Heng Ji, Chao Zhang, and Jiawei Han. Text classification using label names only: A language model self-training approach. In EMNLP, 2020. \n[34] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. \n[35] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. FAIRSEQ: A fast, extensible toolkit for sequence modeling. In NAACL-HLT Demonstrations, 2019. \n[36] Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In NAACL-HLT, 2018. \n[37] Senthil Purushwalkam and Abhinav Gupta. Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases. In NeurIPS, 2020. \n[38] Yanru Qu, Dinghan Shen, Yelong Shen, Sandra Sajeev, Jiawei Han, and Weizhu Chen. CoDA: Contrastenhanced and diversity-promoting data augmentation for natural language understanding. In ICLR, 2021. \n[39] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. \n[40] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 2019. \n[41] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In EMNLP, 2016. \n[42] Anirudh Ravula, Chris Alberti, Joshua Ainslie, Li Yang, Philip Minh Pham, Qifan Wang, Santiago Ontanon, Sumit Kumar Sanghai, Vaclav Cvicek, and Zach Fisher. ETC: Encoding long and structured inputs in transformers. In EMNLP, 2020. \n[43] Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence embeddings using siamese BERT-networks. In EMNLP, 2019. \n[44] Adam Roberts, Colin Raffel, and Noam Shazeer. How much knowledge can you pack into the parameters of a language model? In EMNLP, 2020. \n[45] Timo Schick and Hinrich Schütze. Exploiting cloze questions for few-shot text classification and natural language inference. In EACL, 2021. \n[46] Timo Schick and Hinrich Schütze. It’s not just size that matters: Small language models are also few-shot learners. In NAACL-HLT, 2021. \n[47] Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, 2015. \n[48] Iyer Shankar, Dandekar Nikhil, and Csernai Kornél. First Quora dataset release: Question pairs, 2017. \n[49] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-LM: Training multi-billion parameter language models using gpu model parallelism. arXiv preprint arXiv:1909.08053, 2019. \n[50] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\\mathrm { ~ Y ~ N ~ g ~ }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013. \n[51] Nandan Thakur, Nils Reimers, Johannes Daxenberger, and Iryna Gurevych. Augmented SBERT: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks. In NAACL-HLT, 2021. \n[52] Trieu H Trinh and Quoc V Le. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847, 2018. \n[53] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. \n[54] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In EMNLP Workshop BlackboxNLP, 2018. \n[55] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, 2020. \n[56] Wei Wang, Bin Bi, Ming Yan, Chen Wu, Zuyi Bao, Jiangnan Xia, Liwei Peng, and Luo Si. StructBERT: Incorporating language structures into pre-training for deep language understanding. In ICLR, 2020. \n[57] Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. In TACL, 2019. \n[58] Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL-HLT, 2018. \n[59] Zhuofeng Wu, Sinong Wang, Jiatao Gu, Madian Khabsa, Fei Sun, and Hao Ma. CLEAR: Contrastive learning for sentence representation. arXiv preprint arXiv:2012.15466, 2020. \n[60] Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In ICLR, 2021. \n[61] Zhenhui Xu, Linyuan Gong, Guolin Ke, Di He, Shuxin Zheng, Liwei Wang, Jiang Bian, and Tie-Yan Liu. MC-BERT: Efficient language pre-training via a meta controller. arXiv preprint arXiv:2006.05744, 2020. \n[62] Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. XLNet: Generalized autoregressive pretraining for language understanding. In NeurIPS, 2019. \n[63] Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In ICCV, 2015. ",
1350
+ "bbox": [
1351
+ 171,
1352
+ 108,
1353
+ 828,
1354
+ 914
1355
+ ],
1356
+ "page_idx": 10
1357
+ },
1358
+ {
1359
+ "type": "text",
1360
+ "text": "",
1361
+ "bbox": [
1362
+ 171,
1363
+ 47,
1364
+ 828,
1365
+ 915
1366
+ ],
1367
+ "page_idx": 11
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "",
1372
+ "bbox": [
1373
+ 171,
1374
+ 42,
1375
+ 828,
1376
+ 854
1377
+ ],
1378
+ "page_idx": 12
1379
+ }
1380
+ ]
parse/train/pk4q0SD_r1X/pk4q0SD_r1X_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/pk4q0SD_r1X/pk4q0SD_r1X_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/qiydAcw6Re/qiydAcw6Re.md ADDED
@@ -0,0 +1,636 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GEOMETRY OF PROGRAM SYNTHESIS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We present a new perspective on program synthesis in which programs may be identified with singularities of analytic functions. As an example, Turing machines are synthesised from input-output examples by propagating uncertainty through a smooth relaxation of a universal Turing machine. The posterior distribution over weights is approximated using Markov chain Monte Carlo and bounds on the generalisation error of these models is estimated using the real log canonical threshold, a geometric invariant from singular learning theory.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ The idea of program synthesis dates back to the birth of modern computation itself (Turing, 1948) and is recognised as one of the most important open problems in computer science (Gulwani et al., 2017). However, there appear to be serious obstacles to synthesising programs by gradient descent at scale (Neelakantan et al., 2016; Kaiser & Sutskever, 2016; Bunel et al., 2016; Gaunt et al., 2016; Evans & Grefenstette, 2018; Chen et al., 2018) and these problems suggest that it would be appropriate to make a fundamental study of the geometry of loss surfaces in program synthesis, since this geometry determines the learning process. To that end, in this paper we explain a new point of view on program synthesis using the singular learning theory of Watanabe (2009) and the smooth relaxation of Turing machines from Clift & Murfet (2018).
12
+
13
+ In broad strokes this new geometric point of view on program synthesis says:
14
+
15
+ • Programs to be synthesised are singularities of analytic functions. If $U \subseteq \mathbb { R } ^ { d }$ is open and $K : U \longrightarrow \mathbb { R }$ is analytic, then $x \in U$ is a critical point of $K$ if $\nabla K ( x ) = 0$ and a singularity of the function $K$ if it is a critical point where $K ( x ) = 0$ . The Kolmogorov complexity of a program is related to a geometric invariant of the associated singularity called the Real Log Canonical Threshold (RLCT). This invariant controls both the generalisation error and the learning process, and is therefore an appropriate measure of “complexity” in continuous program synthesis. See Section 3. The geometry has concrete practical implications. For example, a MCMC-based approach to program synthesis will find, with high probability, a solution that is of low complexity (if it finds a solution at all). We sketch a novel point of view on the problem of “bad local minima” (Gaunt et al., 2016) based on these ideas. See Section 4.
16
+
17
+ We demonstrate all of these principles in experiments with toy examples of synthesis problems.
18
+
19
+ Program synthesis as inference. We use Turing machines, but mutatis mutandis everything applies to other programming languages. Let $T$ be a Turing machine with tape alphabet $\Sigma$ and set of states $Q$ and assume that on any input $x \in \Sigma ^ { * }$ the machine eventually halts with output $T ( x ) \in \Sigma ^ { * }$ . Then to the machine $T$ we may associate the set $\{ ( x , T ( x ) ) \} _ { x \in \Sigma ^ { * } } \subseteq \Sigma ^ { * } \times \Sigma ^ { * }$ . Program synthesis is the study of the inverse problem: given a subset of $\Sigma ^ { * } \times \Sigma ^ { * }$ we would like to determine (if possible) a Turing machine which computes the given outputs on the given inputs.
20
+
21
+ If we presume given a probability distribution $q ( x )$ on $\Sigma ^ { * }$ then we can formulate this as a problem of statistical inference: given a probability distribution $q ( x , y )$ on $\Sigma ^ { * } \times \Sigma ^ { * }$ determine the most likely machine producing the observed distribution $q ( x , y ) = q ( y | x ) q ( x )$ . If we fix a universal Turing machine $\mathcal { U }$ then Turing machines can be parametrised by codes $\dot { w } \in W ^ { c o d e }$ with $\mathcal { U } ( x , w ) = T ( x )$ for all $x \in \Sigma ^ { * }$ . We let ${ \bar { p } } ( y | x , w )$ denote the probability of $\mathcal { U } ( x , w ) = y$ (which is either zero or one)
22
+
23
+ so that solutions to the synthesis problem are in bijection with the zeros of the Kullback-Leibler divergence between the true distribution and the model
24
+
25
+ $$
26
+ K ( w ) = \int \int q ( y | x ) q ( x ) \log \frac { q ( y | x ) } { p ( y | x , w ) } d x d y .
27
+ $$
28
+
29
+ So far this is just a trivial rephrasing of the combinatorial optimisation problem of finding a Turing machine $T$ with $T ( x ) = y$ for all $( x , y )$ with $q ( x , y ) > 0$ .
30
+
31
+ Smooth relaxation. One approach is to seek a smooth relaxation of the synthesis problem consisting of an analytic manifold $W \bar { \supseteq } W ^ { c o d e }$ and an extension of $K$ to an analytic function $K : W \longrightarrow \mathbb { R }$ so that we can search for the zeros of $K$ using gradient descent. Perhaps the most natural way to construct such a smooth relaxation is to take $W$ to be a space of probability distributions over $W ^ { \dot { c } o d e }$ and prescribe a model $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { w } )$ for propagating uncertainty about codes to uncertainty about outputs (Gaunt et al., 2016; Evans & Grefenstette, 2018). The particular model we choose is based on the semantics of linear logic (Clift & Murfet, 2018). Supposing that such a smooth relaxation has been chosen together with a prior $\varphi ( w )$ over $W$ , smooth program synthesis becomes the study of the statistical learning theory of the triple $( p , q , \varphi )$ .
32
+
33
+ There are perhaps two primary reasons to consider the smooth relaxation. Firstly, one might hope that stochastic gradient descent or techniques like Markov chain Monte Carlo will be effective means of solving the original combinatorial optimisation problem. This is not a new idea (Gulwani et al., 2017, §6) but so far its effectiveness for large programs has not been proven. Independently, one might hope to find powerful new mathematical ideas that apply to the relaxed problem and shed light on the nature of program synthesis. This is the purpose of the present paper.
34
+
35
+ Singular learning theory. We denote by $W _ { 0 } = \{ w \in W | K ( w ) = 0 \}$ so that
36
+
37
+ $$
38
+ W _ { 0 } \cap W ^ { c o d e } \subseteq W _ { 0 } \subseteq W
39
+ $$
40
+
41
+ where $W _ { 0 } \cap W ^ { c o d e }$ is the discrete set of solutions to the original synthesis problem. We refer to these as the classical solutions. As the vanishing locus of an analytic function, $W _ { 0 }$ is an analytic space over $\mathbb { R }$ (Hironaka, 1964, $\ S 0 . 1 )$ , (Griffith & Harris, 1978) and it is interesting to study the geometry of this space near the classical solutions. Since $K$ is a Kullback-Leibler divergence it is non-negative and so it not only vanishes on $W _ { 0 }$ but $\nabla K$ also vanishes, hence every point of $W _ { 0 }$ is a singular point.
42
+
43
+ Beyond this the geometry of $W _ { 0 }$ depends on the particular model $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { w } )$ that has been chosen, but some aspects are universal: the nature of program synthesis means that typically $W _ { 0 }$ is an extended object (i.e. it contains points other than the classical solutions) and the Hessian matrix of second order partial derivatives of $K$ at a classical solution is not invertible - that is, the classical solutions are degenerate critical points of $K$ . This means that singularity theory is the appropriate branch of mathematics for studying the geometry of $W _ { 0 }$ near a classical solution. It also means that the Fisher information matrix
44
+
45
+ $$
46
+ I ( w ) _ { i j } = \int \int \frac { \partial } { \partial w _ { i } } \big [ \log p ( y | x , w ) \big ] \frac { \partial } { \partial w _ { j } } \big [ \log p ( y | x , w ) \big ] q ( y | x ) q ( x ) d x d y ,
47
+ $$
48
+
49
+ is degenerate at a classical solution, so that the appropriate branch of statistical learning theory is singular learning theory (Watanabe, 2007; 2009). For an introduction to singular learning theory in the context of deep learning see (Murfet et al., 2020).
50
+
51
+ Broadly speaking the contribution of this paper is to realise program synthesis within the framework of singular learning theory, at both a theoretical and an experimental level. In more detail the contents of the paper are:
52
+
53
+ • We define a staged pseudo-UTM (Appendix E) which is well-suited to experiments with the ideas discussed above. Propagating uncertainty about the code through this UTM using the ideas of (Clift & Murfet, 2018) defines a triple $( p , q , \varphi )$ associated to a synthesis problem. This formally embeds program synthesis within singular learning theory. We realise this embedding in code by providing an implementation in PyTorch of this propagation of uncertainty through a UTM. Using the No-U-Turn variant of MCMC (Hoffman & Gelman, 2014) we can approximate the Bayesian posterior of any program synthesis problem (of course in practice we are limited by computational constraints in doing so).
54
+
55
+ • We explain how the real log canonical threshold (a geometric invariant) is related to Kolmogorov complexity (Section 3). • We give a simple example (Appendix C) in which $W _ { 0 }$ contains the set of classical solutions as a proper subset and every point of $W _ { 0 }$ is a degenerate critical point of $K$ . For two simple synthesis problems detectA and parityCheck we demonstrate all of the above, using MCMC to approximate the Bayesian posterior and theorems from Watanabe (2013) to estimate the RLCT (Section 5). We discuss how $W _ { 0 }$ is an extended object and how the RLCT relates to the local dimension of $W _ { 0 }$ near a classical solution.
56
+
57
+ # RELATED WORK
58
+
59
+ The idea of synthesising Turing machines can be traced back to the work of Solomonoff on inductive inference (Solomonoff, 1964). A more explicit form of the problem was given in Biermann (1972) who proposed an algorithmic method. Machine learning based approaches appear in Schmidhuber (1997) and Hutter (2004), which pay particular attention to model complexity, and Gaunt et al. (2016) and Freer et al. (2014), the latter using the notion of “universal probabilistic Turing machine” (De Leeuw et al., 1956). A different probabilistic extension of a universal Turing machine was introduced in Clift & Murfet (2018) via linear logic. Studies of the singular geometry of learning models go back to Amari et al. (2003) and notably, the extensive work of Watanabe (2007; 2009).
60
+
61
+ # 2 TURING MACHINE SYNTHESIS AS SINGULAR LEARNING
62
+
63
+ All known approaches to program synthesis can be formulated in terms of a singular learning problem. Singular learning theory is the extension of statistical learning theory to account for the fact that the set of learned parameters $W _ { 0 }$ has the structure of an analytic space as opposed to an analytic manifold (Watanabe, 2007; 2009). It is organised around triples $( p , q , \varphi )$ consisting of a class of models $\{ p ( y | x , w ) : w \in W \}$ , a true distribution $q ( y | x )$ and a prior $\varphi$ on $W$ .
64
+
65
+ In our approach we fix a Universal Turing Machine (UTM), denoted $\mathcal { U }$ , with a description tape (which specifies the code of the Turing machine to be executed), a work tape (simulating the tape of that Turing machine during its operation) and a state tape (simulating the state of that Turing machine). The general statistical learning problem that can be formulated using $\mathcal { U }$ is the following: given some initial string $x$ on the work tape, predict the state of the simulated machine and the contents of the work tape after some specified number of steps (Clift & Murfet, 2018, $\ S 7 . 1 )$ . For simplicity, in this paper we consider models that only predict the final state; the necessary modifications in the general case are routine. We also assume that $W$ parametrises Turing machines whose tape alphabet $\Sigma$ and set of states $Q$ have been encoded by individual symbols in the tape alphabet of $\mathcal { U }$ . Hence $\mathcal { U }$ is actually what we call a pseudo-UTM (see Appendix E). Again, treating the general case is routine and for the present purposes only introduces uninteresting complexity.
66
+
67
+ Let $\Sigma$ denote the tape alphabet of the simulated machine, $Q$ the set of states and let $L , S , R$ stand for left, stay and right, the possible motions of the Turing machine head. We assume that $| Q | > 1$ since otherwise the synthesis problem is trivial. The set of ordinary codes $W ^ { c o d e }$ for a Turing machine sits inside a compact space of probability distributions $W$ over codes
68
+
69
+ $$
70
+ W ^ { c o d e } : = \prod _ { \sigma , q } \Sigma \times Q \times \{ L , S , R \} \subseteq \prod _ { \sigma , q } \Delta \Sigma \times \Delta Q \times \Delta \{ L , S , R \} = : W
71
+ $$
72
+
73
+ where $\Delta X$ denotes the set of probability distributions over a set $X$ , see (8), and the product is over pairs $( \sigma , q ) \in \Sigma \times Q$ .1 For example the point $\{ ( \sigma ^ { \prime } , q ^ { \prime } , d ) \} _ { \sigma , q } \in W ^ { c o d e }$ encodes the machine which when it reads $\sigma$ under the head in state $q$ writes $\sigma ^ { \prime }$ , transitions into state $q ^ { \prime }$ and moves in direction $d$ . Given $w \in W ^ { c o d e }$ let $\operatorname { s t e p } ^ { t } ( x , w ) \in Q$ denote the contents of the state tape of $\mathcal { U }$ after $t$ timesteps (of the simulated machine) when the work tape is initialised with $x$ and the description tape with $w$ .
74
+
75
+ There is a principled extension of this operation of $\mathcal { U }$ to a smooth function
76
+
77
+ $$
78
+ \Delta \operatorname { s t e p } ^ { t } : { \Sigma } ^ { * } \times W \longrightarrow \Delta Q
79
+ $$
80
+
81
+ which propagates uncertainty about the symbols on the description tape to uncertainty about the final state and we refer to this extension as the smooth relaxation of $\mathcal { U }$ . The details are given in Appendix F but at an informal level the idea behind the relaxation is easy to understand: to sample from $\Delta \operatorname { s t e p } ^ { t } ( x , w )$ we run $\mathcal { U }$ to simulate $t$ timesteps in such a way that whenever the UTM needs to “look at” an entry on the description tape we sample from the corresponding distribution specified by $w$ .2 The significance of the particular smooth relaxation that we use is that its derivatives have a logical interpretation (Clift & Murfet, 2018, $\ S 7 . 1 \ r _ { . }$ ).
82
+
83
+ The class of models that we consider is
84
+
85
+ $$
86
+ p ( y | x , w ) = \Delta \mathrm { s t e p } ^ { t } ( x , w )
87
+ $$
88
+
89
+ where $t$ is fixed for simplicity in this paper. More generally we could also view $x$ as consisting of a sequence and a timeout, as is done in (Clift & Murfet, 2018, $\ S 7 . 1 )$ . The construction of this model is summarised in Figure 1.
90
+
91
+ ![](images/4a6eaec4d0956e25ce7728bf29fb6ddeee2cacf5f806fd63f0d36ae211bc6fec.jpg)
92
+ Figure 1: The state of $\mathcal { U }$ is represented by the state of the work tape, state tape and description (code) tape. The work tape is initialised with a sequence $x \in \Sigma ^ { * }$ , the code tape with $w \in W$ and the state tape with some standard initial state, the smooth relaxation $\Delta$ step of the pseudo-UTM is run for $t$ steps and the final probability distribution over states is $y$ .
93
+
94
+ Definition 2.1 (Synthesis problem). A synthesis problem for $\mathcal { U }$ consists of a probability distribution $q ( x , y )$ over $\Sigma ^ { * } \times Q$ . We say that the synthesis problem is deterministic if there is $f : \Sigma ^ { * } \longrightarrow Q$ such that $q ( y = f ( x ) | x ) = 1$ for all $x \in \Sigma ^ { * }$ .
95
+
96
+ Definition 2.2. The triple $( p , q , \varphi )$ associated to a synthesis problem is the model $p$ of (5) together with the true distribution $q$ and uniform prior $\varphi$ on the parameter space $W$ . The Kullback-Leibler function $K ( w )$ of the synthesis problem is defined by (1) and a solution to the synthesis problem is a point of $W _ { 0 }$ . A classical solution is a point of $W _ { 0 } \cap W ^ { c o d e }$ .
97
+
98
+ As $\Delta \mathrm { s t e p } ^ { t }$ is a polynomial function, $K$ is analytic and so $W _ { 0 }$ is a semi-analytic space (it is cut out of the semi-analytic space $W$ by the vanishing of $K$ ). If the synthesis problem is deterministic and $q ( x )$ is uniform on some finite subset of $\Sigma ^ { * }$ then $W _ { 0 }$ is semi-algebraic (it is cut out of $W$ by polynomial equations) and all solutions lie at the boundary of the parameter space $W$ (Appendix D). However in general $W _ { 0 }$ is only semi-analytic and intersects the interior of $W$ (Example C.2). We assume that ${ \bar { q } } ( y | x )$ is realisable that is, there exists $w _ { 0 } \in W$ with $q ( y | x ) = p ( y | x , w _ { 0 } )$ .
99
+
100
+ A triple $( p , q , \varphi )$ is regular if the model is identifiable, ie. for all inputs $x \in \mathbb { R } ^ { n }$ , the map sending $w$ to the conditional probability distribution $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { w } )$ is one-to-one, and the Fisher information matrix is non-degenerate. Otherwise, the learning machine is strictly singular (Watanabe, 2009, $\ S 1 . 2 . 1 $ . Triples arising from synthesis problems are typically singular: in Example 2.5 below we show an explicit example where multiple parameters $w$ determine the same model, and in Example C.2 we give an example where the Hessian of $K$ is degenerate everywhere on $W _ { 0 }$ (Watanabe, 2009, §1.1.3).
101
+
102
+ Remark 2.3. Non-deterministic synthesis problems arise naturally in various contexts, for example in the fitting of algorithms to the behaviour of deep reinforcement learning agents. Suppose an agent is acting in an environment with starting states encoded by $x \in \Sigma ^ { * }$ and possible episode end states by $y \in Q$ . Even if the optimal policy is known to determine a computable function $\Sigma ^ { * } \longrightarrow Q$ the statistics of the observed behaviour after finite training time will only provide a function $\Sigma ^ { * } \longrightarrow \Delta Q$ and if we wish to fit algorithms to behaviour it makes sense to deal with this uncertainty directly.
103
+
104
+ Definition 2.4. Let $( p , q , \varphi )$ be the triple associated to a synthesis problem. The Real Log Canonical Threshold (RLCT) $\lambda$ of the synthesis problem is defined so that $- \lambda$ is the largest pole of the meromorphic extension (Atiyah, 1970) of the zeta function $\begin{array} { r } { \zeta ( z ) = \int K ( w ) ^ { z } \varphi ( w ) \hat { d w } } \end{array}$ .
105
+
106
+ The more singular the analytic space $W _ { 0 }$ of solutions is, the smaller the RLCT. One way to think of the RLCT is as a count of the effective number of parameters near $W _ { 0 }$ (Murfet et al., 2020, $\ S 4$ ). In Section 3 we relate the RLCT to Kolmogorov complexity and in Section 5 we estimate the RLCT of the synthesis problem detectA given below, using the method explained in Appendix A.
107
+
108
+ Example 2.5 (detectA). The deterministic synthesis problem detectA has $\Sigma = \{ \boxed \} , A , B \}$ , $Q = \{ { \mathrm { r e j e c t } } , { \mathrm { a c c e p t } } \}$ and $q ( y | x )$ is determined by the function taking in a string $x$ of $A$ ’s and $B$ ’s and returning the state accept if the string contains an $A$ and state reject otherwise. The conditional true distribution $q ( y | x )$ is realisable because this function is computed by a Turing machine.
109
+
110
+ Two solutions are shown in Figure 2. On the left is a parameter $w _ { l } \in \ b { W } _ { 0 } \setminus \ b { W } ^ { c o d e }$ and on the right is $w _ { r } \in W _ { 0 } \cap W ^ { c o d e }$ . Varying the distributions in $w _ { l }$ that have nonzero entropy we obtain a submanifold $V \subseteq W _ { 0 }$ containing $w _ { l }$ of dimension 14. This leads by (Watanabe, 2009, Remark 7.3) to a bound on the RLCT of $\lambda \le \frac { 1 } { 2 } ( 3 0 - 1 4 ) = 8$ which is consistent with the experimental results in Table 1. This highlights that solutions need not lie at vertices of the probability simplex, and $W _ { 0 }$ may contain a high-dimensional submanifold around a given classical solution.
111
+
112
+ ![](images/94e2cb3be00f1414e5f172ce0b09cdea4b00fe6fbc48f36b360a03838c63cdbb.jpg)
113
+ Figure 2: Visualisation of two solutions for the synthesis problem detectA .
114
+
115
+ # 2.1 THE SYNTHESIS PROCESS
116
+
117
+ Synthesis is a problem because we do not assume that the true distribution is known: for example, if $q { \dot { ( } } y | x )$ is deterministic and the associated function is $f : \Sigma ^ { * } \longrightarrow Q$ , we assume that some example pairs $( x , f ( x ) )$ are known but no general algorithm for computing $f$ is known (if it were, synthesis would have already been performed). In practice synthesis starts with a sample $D _ { n } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ from $q ( x , y )$ with associated empirical Kullback-Leibler distance
118
+
119
+ $$
120
+ K _ { n } ( w ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \log \frac { q ( y _ { i } | x _ { i } ) } { p ( y _ { i } | x _ { i } , w ) } .
121
+ $$
122
+
123
+ If the synthesis problem is deterministic and $u \in W ^ { c o d e }$ then $K _ { n } ( u ) = 0$ if and only if $u$ explains the data in the sense that $\operatorname { s t e p } ^ { t } ( x _ { i } , u ) = y _ { i }$ for $1 \leq i \leq n$ . We now review two natural ways of finding such solutions in the context of machine learning.
124
+
125
+ Synthesis by stochastic gradient descent (SGD). The first approach is to view the process of program synthesis as stochastic gradient descent for the function $K : W \longrightarrow \mathbb { R }$ . We view $D _ { n }$ as a large training set and further sample subsets $D _ { m }$ with $m \ll n$ and compute $\nabla K _ { m }$ to take gradient descent steps $w _ { i + 1 } = w _ { i } - \eta \nabla K _ { m } ( w _ { i } )$ for some learning rate $\eta$ . Stochastic gradient descent has the advantage (in principle) of scaling to high-dimensional parameter spaces $W$ , but in practice it is challenging to use gradient descent to find points of $W _ { 0 }$ (Gaunt et al., 2016).
126
+
127
+ Synthesis by sampling. The second approach is to consider the Bayesian posterior associated to the synthesis problem, which can be viewed as an update on the prior distribution $\varphi$ after seeing $D _ { n }$
128
+
129
+ $$
130
+ p ( w | D _ { n } ) = { \frac { p ( D _ { n } | w ) p ( w ) } { p ( D _ { n } ) } } = { \frac { 1 } { Z _ { n } } } \varphi ( w ) \prod _ { i = 1 } ^ { n } p ( y _ { i } | x _ { i } , w ) = { \frac { 1 } { Z _ { n } ^ { 0 } } } \exp \{ - n K _ { n } ( w ) + \log \varphi ( w ) \}
131
+ $$
132
+
133
+ where $\begin{array} { r } { Z _ { n } ^ { 0 } = \int \varphi ( w ) \exp ( - n K _ { n } ( w ) ) d w } \end{array}$ . If $n$ is large the posterior distribution concentrates around solutions $w \in W _ { 0 }$ and so sampling from the posterior will tend to produce machines that are (nearly) solutions. The gold standard sampling is Markov Chain Monte Carlo (MCMC). Scaling MCMC to where $W$ is high-dimensional is a challenging task with many attempts to bridge the gap with SGD (Welling & Teh, 2011; Chen et al., 2014; Ding et al., 2014; Zhang et al., 2020). Nonetheless in simple cases we demonstrate experimentally in Section 5 that machines may be synthesised by using MCMC to sample from the posterior.
134
+
135
+ # 3 COMPLEXITY OF PROGRAMS
136
+
137
+ Every Turing machine is the solution of a deterministic synthesis problem, so Section 2 associates to any Turing machine a singularity of a semi-analytic space $W _ { 0 }$ . To indicate that this connection is not vacuous, we sketch how the complexity of a program is related to the real log canonical threshold of a singularity. A more detailed discussion will appear elsewhere.
138
+
139
+ Let $q ( x , y )$ be a deterministic synthesis problem for $\mathcal { U }$ which only involves input sequences in some restricted alphabet $\Sigma _ { i n p u t }$ , that is, $q ( x ) \bar { = } 0$ if $x \notin ( \Sigma _ { i n p u t } ) ^ { * }$ . Let $D _ { n }$ be sampled from $q ( x , y )$ and let $u , v \in W ^ { c o d e } \cap W _ { 0 }$ be two explanations for the sample in the sense that $K _ { n } ( u ) = K _ { n } ( v ) = 0$ . Which explanation for the data should we prefer? The classical answer based on Occam’s razor (Solomonoff, 1964) is that we should prefer the shorter program, that is, the one using the fewest states and symbols.
140
+
141
+ Set $N = | \Sigma |$ and $M = | Q |$ . Any Turing machine $T$ using $N ^ { \prime } \leq N$ symbols and $M ^ { \prime } \leq M$ states has a code for $\mathcal { U }$ of length $c M ^ { \prime } N ^ { \prime }$ where $c$ is a constant. We assume that $\Sigma _ { i n p u t }$ is included in the tape alphabet of $T$ so that $N ^ { \prime } \geq | \Sigma _ { i n p u t } |$ and define the Kolmogorov complexity of $q$ with respect to $\mathcal { U }$ to be the infimum ${ \mathfrak { c } } ( q )$ of $M ^ { \prime } N ^ { \prime }$ over Turing machines $T$ that give classical solutions for $q$ .
142
+
143
+ Let $\lambda$ be the RLCT of the triple $( p , q , \varphi )$ associated to the synthesis problem (Definition 2.4).
144
+
145
+ Theorem 3.1. $\begin{array} { r } { \lambda \le \frac { 1 } { 2 } ( M + N ) \mathfrak { c } ( q ) } \end{array}$ .
146
+
147
+ Proof. Let $u \in W ^ { c o d e } \cap W _ { 0 }$ be the code of a Turing machine realising the infimum in the definition of the Kolmogorov complexity and suppose that this machine only uses symbols in $\Sigma ^ { \prime }$ and states in $Q ^ { \prime }$ with $N ^ { \prime } = | \Sigma ^ { \prime } |$ and $\bar { M } ^ { \prime } = | Q ^ { \prime } |$ . The time evolution of the staged pseudo-UTM $\mathcal { U }$ simulating $u$ on $x \in \Sigma _ { i n p u t } ^ { * }$ is independent of the entries on the description tape that belong to tuples of the form $( \sigma , q , ? , ? , ? )$ with $( \sigma , q ) \notin \Sigma ^ { \prime } \times Q ^ { \prime }$ . Let $V \subseteq W$ be the submanifold of points which agree with $u$ on all tuples with $( \sigma , q ) \in \Sigma ^ { \prime } \times Q ^ { \prime }$ and are otherwise free. Then $u \in V \subseteq W _ { 0 }$ and $\operatorname { c o d i m } ( V ) =$ $M ^ { \prime } N ^ { \prime } ( \bar { M } + N )$ and by (Watanabe, 2009, Theorem 7.3) we have $\begin{array} { r } { \lambda \le \frac 1 2 \bmod { \mathrm { i m } } ( V ) } \end{array}$ . □
148
+
149
+ Remark 3.2. The Kolmogorov complexity depends only on the number of symbols and states used. The RLCT is a more refined invariant since it also depends on how each symbol and state is used (Clift & Murfet, 2018, Remark 7.8) as this affects the polynomials defining $W _ { 0 }$ (see Appendix D).
150
+
151
+ # 4 PRACTICAL IMPLICATIONS
152
+
153
+ Using singular learning theory we have explained how programs to be synthesised are singularities of analytic functions, and how the Kolmogorov complexity of a program bounds the RLCT of the associated singularity. We now sketch some practical insights that follow from this point of view.
154
+
155
+ Synthesis minimises the free energy: the sampling-based approach to synthesis (Section 2.1) aims to approximate, via MCMC, sampling from the Bayesian posterior for the triple $( p , q , \varphi )$ associated to a synthesis problem. To understand the behaviour of these Markov chains we follow the asymptotic analysis of (Watanabe, 2009, Section 7.6). If we cover $W$ by small closed balls $V _ { \alpha }$ around points $w _ { \alpha }$ then we can compute the probability that a sample comes from $V _ { \alpha }$ by
156
+
157
+ $$
158
+ p _ { \alpha } = \frac { 1 } { Z _ { 0 } } \int _ { V _ { \alpha } } e ^ { - n K _ { n } ( w ) } \varphi ( w ) d w
159
+ $$
160
+
161
+ and if $n$ is sufficiently large this is proportional to $e ^ { - f _ { \alpha } }$ where the quantity
162
+
163
+ $$
164
+ f _ { \alpha } = K _ { \alpha } n + \lambda _ { \alpha } \log ( n )
165
+ $$
166
+
167
+ is called the free energy. Here $K _ { \alpha }$ is the smallest value of the Kullback-Leibler divergence $K$ on $V _ { \alpha }$ and $\lambda _ { \alpha }$ is the RLCT of the set $W _ { K _ { \alpha } } \cap V _ { \alpha }$ where $W _ { c } = \{ w \in W | K ( w ) = c \}$ is a level set of $K$ . The Markov chains used to generate approximate samples from the posterior are attempting to minimise the free energy, which involves a tradeoff between the energy $K _ { \alpha } n$ and the entropy $\lambda _ { \alpha } \log ( n )$ .
168
+
169
+ Why synthesis gets stuck: the kind of local minimum of the free energy that we want the synthesis process to find are solutions $w _ { \alpha } \in W _ { 0 }$ where $\lambda _ { \alpha }$ is minimal. By Section 3 one may think of these points as the “lowest complexity” solutions. However it is possible that there are other local minima of the free energy. Indeed, there may be local minima where the free energy is lower than the free energy at any solution since at finite $n$ it is possible to tradeoff an increase in $K _ { \alpha }$ against a decrease in the RLCT $\lambda _ { \alpha }$ . In practice, the existence of such “siren minima” of the free energy may manifest itself as regions where the synthesis process gets stuck and fails to converge to a solution. In such a region $\bar { K _ { \alpha } } n + \lambda _ { \alpha } \log ( n ) < \lambda \log ( \bar { n } )$ where $\lambda$ is the RLCT of the synthesis problem. In practice it has been observed that program synthesis by gradient descent often fails for complex problems in the sense that it fails to converge to a solution (Gaunt et al., 2016). While synthesis by SGD and sampling are different, it is a reasonable hypothesis that these siren minima are a significant contributing factor in both cases.
170
+
171
+ Can we avoid siren minima? If we let $\lambda _ { c }$ denote the RLCT of the level set $W _ { c }$ then siren minima of the free energy will be impossible at a given value of n and c as long as λc ≥ λ−c nlog(n) . Recall that the more singular $W _ { c }$ is the lower the RLCT, so this lower bound says that the level sets should not become too singular too quickly as $c$ increases. At any given value of $n$ there is a “siren free” region in the range $c \geq { \frac { \lambda \log ( n ) } { n } }$ since the RLCT is non-negative (Figure 3). Thus the learning process will be more reliable the smaller $\frac { \lambda \log ( n ) } { n }$ is. This can arranged either by increasing $n$ (providing more examples) or decreasing $\lambda$ .
172
+
173
+ While the RLCT is determined by the synthesis problem, it is possible to change its value by changing the structure of the UTM $\mathcal { U }$ . As we have defined it $\mathcal { U }$ is a “simulation type” UTM, but one could for example add special states such that if a code specifies a transition into that state a series of steps is executed by the UTM (i.e. a subroutine). This amounts to specifying codes in a higher level programming language. Hence one of the practical insights that can be derived from the geometric point of view on program synthesis is that varying this language is a natural way to engineer the singularities of the level sets of $K$ , which according to singular learning theory has direct implications for the learning process.
174
+
175
+ ![](images/e34800be3128393d0b71b422f4ec9e848e92967fd980b5ceb119d06d14b03a68.jpg)
176
+ Figure 3: Level sets above the cutoff cannot contain siren local minima of the free energy.
177
+
178
+ # 5 EXPERIMENTS
179
+
180
+ We estimate the RLCT for the triples $( p , q , \varphi )$ associated to the synthesis problems detectA (Example 2.5) and parityCheck. Hyperparameters of the various machines are contained in Table 3 of Appendix B. The true distribution $q ( x )$ is defined as follows: we fix a minimum and maximum sequence length $a \leq b$ and to sample $x \sim q ( x )$ we first sample a length $l$ uniformly from $[ a , b ]$ and then uniformly sample $x$ from $\{ A , { \cal B } \} ^ { l }$ .
181
+
182
+ We perform MCMC on the weight vector for the model class $\{ p ( y | x , w ) : w \in W \}$ where $w$ is represented in our PyTorch implementation by three tensors of shape $\{ [ L , n _ { i } ] \} _ { 1 \leq i \leq 3 }$ where $L$ is the number of tuples in the description tape of the TM being simulated and $\{ n _ { i } \}$ are the number of symbols, states and directions respectively. A direct simulation of the UTM is used for all experiments to improve computational efficiency (Appendix G). We generate, for each inverse temperature $\beta$ and dataset $D _ { n }$ , a Markov chain via the No-U-turn sampler from Hoffman & Gelman (2014). We use the standard uniform distribution as our prior $\varphi$ .
183
+
184
+ Table 1: RLCT estimates for detectA.
185
+
186
+ <table><tr><td>Max-length</td><td>Temperature</td><td>RLCT</td><td>Std</td><td>R squared</td></tr><tr><td>7</td><td>log(500)</td><td>8.089205</td><td>3.524719</td><td>0.965384</td></tr><tr><td>7</td><td>log(1000)</td><td>6.533362</td><td>2.094278</td><td>0.966856</td></tr><tr><td>8</td><td>log(500)</td><td>4.601800</td><td>1.156325</td><td>0.974569</td></tr><tr><td>8</td><td>log(1000)</td><td>4.431683</td><td>1.069020</td><td>0.967847</td></tr><tr><td>9</td><td>log(500)</td><td>5.302598</td><td>2.415647</td><td>0.973016</td></tr><tr><td>9</td><td>log(1000)</td><td>4.027324</td><td>1.866802</td><td>0.958805</td></tr><tr><td>10</td><td>log(500)</td><td>3.224910</td><td>1.169699</td><td>0.963358</td></tr><tr><td>10</td><td>log(1000)</td><td>3.433624</td><td>0.999967</td><td>0.949972</td></tr></table>
187
+
188
+ For the problem detectA given in Example 2.5 the dimension of parameter space is dim $W = 3 0$ . We use generalized least squares to fit the RLCT $\lambda$ (with goodness-of-fit measured by $R ^ { 2 }$ ), the algorithm of which is given in Appendix A. Our results are displayed in Table 1 and Figure 4. Our purpose in these experiments is not to provide high accuracy estimates of the RLCT, as these would require much longer Markov chains. Instead we demonstrate how rough estimates consistent with the theory can be obtained at low computational cost. If this model were regular the RLCT would be $\dim W / 2 = 1 5$ .
189
+
190
+ ![](images/9ace473833bc61d56cd4eaf090be6f773656e1bf4f188e396d12fd45dcd66217.jpg)
191
+ Figure 4: Plot of RLCT estimates for detectA. Shaded region shows one standard deviation.
192
+
193
+ The deterministic synthesis problem parityCheck has
194
+
195
+ $$
196
+ \begin{array} { l } { \Sigma = \{ \Pi , A , B , X \} } \\ { Q = \{ \mathrm { r e j e c t , a c c e p t , g e t N e x t A B , g e t N e x t A , g e t N e x t B , g o t o S t a r t } \} . } \end{array}
197
+ $$
198
+
199
+ The distribution $q ( x )$ is as discussed in Section 5 and $q ( y | x )$ is determined by the function taking in a string of $A$ ’s and $B$ ’s, and terminating in state accept if the string contains the same number of $A$ ’s as $B$ ’s, and terminating in state reject otherwise. The string is assumed to contain no blank symbols. The true distribution is realisable because there is a Turing machine using $\Sigma$ and $Q$ which computes this function: the machine works by repeatedly overwriting pairs consisting of a single $A$ and $B$ with $X$ ’s; if there are any $A$ ’s without a matching $B$ left over (or vice versa), we reject, otherwise we accept.
200
+
201
+ In more detail, the starting state getNextAB moves right on the tape until the first $A$ or $B$ is found, and overwrites it with an $X$ . If it’s an $A$ (resp. $B$ ) we enter state getNextB (resp. getNextA). If no $A$ or $B$ is found, we enter the state accept. The state getNextA (resp. getNextB) moves right until an $A$ (resp. $B$ ) is found, overwrites it with an $X$ and enters state gotoStart which moves left until a blank symbol is found (resetting the machine to the left end of the tape). If no $A$ ’s (resp. $B$ ’s) were left on the tape, we enter state reject. The dimension of the parameter space is $\dim W = 2 4 0$ . If this model were regular, the RLCT would be $\dim W / 2 = 1 2 { \bar { 0 } }$ . Our RLCT estimates are contained in Table 2.
202
+
203
+ Table 2: RLCT estimates for parityCheck.
204
+
205
+ <table><tr><td>Max-length</td><td>Temperature</td><td>RLCT</td><td>Std</td><td>R squared</td></tr><tr><td>5</td><td>log(300)</td><td>4.411732</td><td>0.252458</td><td>0.969500</td></tr><tr><td>6</td><td>log(300)</td><td>4.005667</td><td>0.365855</td><td>0.971619</td></tr><tr><td>7</td><td>log(300)</td><td>3.887679</td><td>0.276337</td><td>0.973716</td></tr></table>
206
+
207
+ # 6 DISCUSSION
208
+
209
+ We have developed a theoretical framework in which all programs can in principle be learnt from input-output examples via an existing optimisation procedure. This is done by associating to each program a smooth relaxation which, based on Clift & Murfet (2018), can be argued to be more canonical than existing approaches. This realization has important implications for the building of intelligent systems.
210
+
211
+ In approaches to program synthesis based on gradient descent there is a tendency to think of solutions to the synthesis problem as isolated critical points of the loss function $K$ , but this is a false intuition based on regular models. Since neural networks, Bayesian networks, smooth relaxations of UTMs and all other extant approaches to smooth program synthesis are strictly singular models (the map from parameters to functions is not injective) the set $W _ { 0 }$ of parameters $w$ with $K ( w ) = 0$ is a complex extended object, whose geometry is shown by Watanabe’s singular learning theory to be deeply related to the learning process. We have examined this geometry in several specific examples and shown how to think about complexity of programs from a geometric perspective. It is our hope that algebraic geometry can assist in developing the next generation of synthesis machines.
212
+
213
+ # REFERENCES
214
+
215
+ Shun-ichi Amari, Tomoko Ozeki, and Hyeyoung Park. Learning and inference in hierarchical models with singularities. Systems and Computers in Japan, 34(7):34–42, 2003.
216
+
217
+ Michael F Atiyah. Resolution of singularities and division of distributions. Communications on Pure and Applied Mathematics, 23(2):145–150, 1970.
218
+
219
+ Alan W Biermann. On the inference of Turing machines from sample computations. Artificial Intelligence, 3:181–198, 1972.
220
+
221
+ Rudy R Bunel, Alban Desmaison, Pawan K Mudigonda, Pushmeet Kohli, and Philip Torr. Adaptive neural compilation. In Advances in Neural Information Processing Systems, pp. 1444–1452, 2016.
222
+
223
+ Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient Hamiltonian Monte Carlo. In International Conference on Machine Learning, pp. 1683–1691, 2014.
224
+
225
+ Xinyun Chen, Chang Liu, and Dawn Song. Execution-guided neural program synthesis. In International Conference on Learning Representations, 2018.
226
+
227
+ James Clift and Daniel Murfet. Derivatives of Turing machines in linear logic. arXiv preprint arXiv:1805.11813, 2018.
228
+
229
+ Karel De Leeuw, Edward F Moore, Claude E Shannon, and Norman Shapiro. Computability by probabilistic machines. Automata studies, 34:183–198, 1956.
230
+
231
+ Nan Ding, Youhan Fang, Ryan Babbush, Changyou Chen, Robert D Skeel, and Hartmut Neven. Bayesian sampling using stochastic gradient thermostats. In Advances in Neural Information Processing Systems, pp. 3203–3211, 2014.
232
+
233
+ Richard Evans and Edward Grefenstette. Learning explanatory rules from noisy data. Journal of Artificial Intelligence Research, 61:1–64, 2018.
234
+
235
+ Cameron E Freer, Daniel M Roy, and Joshua B Tenenbaum. Towards common-sense reasoning via conditional simulation: legacies of Turing in artificial intelligence. Turing’s Legacy, 42:195–252, 2014.
236
+
237
+ Alexander L Gaunt, Marc Brockschmidt, Rishabh Singh, Nate Kushman, Pushmeet Kohli, Jonathan Taylor, and Daniel Tarlow. Terpret: A probabilistic programming language for program induction. arXiv preprint arXiv:1608.04428, 2016.
238
+
239
+ Phillip Griffith and Joseph Harris. Principles of Algebraic Geometry. Wiley-Interscience, 1978.
240
+
241
+ Sumit Gulwani, Oleksandr Polozov, and Rishabh Singh. Program synthesis. Foundations and Trends in Programming Languages, 4(1-2):1–119, 2017.
242
+
243
+ Heisuke Hironaka. Resolution of singularities of an algebraic variety over a field of characteristic zero: I. Annals of Mathematics, 79(1):109–203, 1964.
244
+
245
+ Matthew D Hoffman and Andrew Gelman. The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. J. Mach. Learn. Res., 15(1):1593–1623, 2014.
246
+
247
+ Marcus Hutter. Universal artificial intelligence: Sequential decisions based on algorithmic probability. Springer Science & Business Media, 2004.
248
+
249
+ Łukasz Kaiser and Ilya Sutskever. Neural GPUs learn algorithms. In International Conference on Learning Representations, 2016.
250
+
251
+ Daniel Murfet, Susan Wei, Mingming Gong, Hui Li, Jesse Gell-Redman, and Thomas Quella. Deep learning is singular, and that’s good. arXiv preprint arXiv:2010.11560, 2020.
252
+
253
+ Arvind Neelakantan, Quoc V. Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent. In International Conference on Learning Representations, ICLR 2016, 2016.
254
+
255
+ Jurgen Schmidhuber. Discovering neural nets with low Kolmogorov complexity and high general- ¨ ization capability. Neural Networks, 10(5):857–873, 1997.
256
+
257
+ Ray J Solomonoff. A formal theory of inductive inference. Part I. Information and control, 7(1): 1–22, 1964.
258
+
259
+ Alan Turing. Intelligent machinery. NPL Mathematics Division, 1948.
260
+
261
+ Sumio Watanabe. Almost all learning machines are singular. In 2007 IEEE Symposium on Foundations of Computational Intelligence, pp. 383–388. IEEE, 2007.
262
+
263
+ Sumio Watanabe. Algebraic Geometry and Statistical Learning Theory, volume 25. Cambridge University Press, 2009.
264
+
265
+ Sumio Watanabe. A widely applicable Bayesian information criterion. Journal of Machine Learning Research, 14:867–897, 2013.
266
+
267
+ Max Welling and Yee W Teh. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning, pp. 681–688, 2011.
268
+
269
+ Ruqi Zhang, Chunyuan Li, Jianyi Zhang, Changyou Chen, and Andrew Gordon Wilson. Cyclical stochastic gradient MCMC for Bayesian deep learning. In International Conference on Learning Representations, 2020.
270
+
271
+ # APPENDIX
272
+
273
+ # A ALGORITHM FOR ESTIMATING RLCTS
274
+
275
+ Given a sample $D _ { n } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ from $q ( x , y )$ let $\begin{array} { r } { L _ { n } ( w ) : = - \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \log p ( y _ { i } | x _ { i } , w ) } \end{array}$ be the negative log likelihood. We would like to estimate
276
+
277
+ $$
278
+ \mathbb { E } _ { w } ^ { \beta } [ n L _ { n } ( w ) ] : = \frac { 1 } { Z _ { n } ^ { \beta } } \int n L _ { n } ( w ) \varphi ( w ) \prod _ { i = 1 } ^ { n } p ( y _ { i } | x _ { i } , w ) ^ { \beta } d w
279
+ $$
280
+
281
+ where $\begin{array} { r } { Z _ { n } ^ { \beta } = \int \varphi ( w ) \prod _ { i = 1 } ^ { n } p ( y _ { i } | x _ { i } , w ) ^ { \beta } d w } \end{array}$ for some inverse temperature $\beta$ . If $\begin{array} { r } { \beta = \frac { \beta _ { 0 } } { \log n } } \end{array}$ for some constant $\beta _ { 0 }$ , then by Theorem 4 of Watanabe (2013),
282
+
283
+ $$
284
+ \mathbb { E } _ { w } ^ { \beta } [ n L _ { n } ( w ) ] = n L _ { n } ( w _ { 0 } ) + \frac { \lambda \log n } { \beta _ { 0 } } + U _ { n } \sqrt { \frac { \lambda \log n } { 2 \beta _ { 0 } } } + O _ { p } ( 1 )
285
+ $$
286
+
287
+ where $\{ U _ { n } \}$ is a sequence of random variables satisfying $\mathbb { E } [ U _ { n } ] = 0$ and $\lambda$ is the RLCT. In practice, the last two terms often vary negligibly with $1 / \beta$ and so $\mathbb { E } _ { w } ^ { \beta } [ n L _ { n } ( w ) ]$ approximates a linear function of $1 / \beta$ with slope $\lambda$ (Watanabe, 2013, Corollary 3). This is the foundation of the RLCT estimation procedure found in Algorithm 1 which is used in our experiments.
288
+
289
+ # Algorithm 1 RLCT estimation
290
+
291
+ <table><tr><td></td><td>Input: range of β&#x27;s, set of training sets T each of size n, approximate samples {w1,..,WR} from pβ(w|Dn) for each training set Dn and each β</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>for training set Dn ∈ T do</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>for β in range of β&#x27;s do</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td> ples from pβ(w|Dn)</td><td></td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>Perform generalised least squares to fit X in Equation (7),call result λ(Dn)</td><td></td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Output: ∑Dn∈T λ(Dn)</td><td></td><td></td><td></td><td></td><td></td></tr></table>
292
+
293
+ Each RLCT estimate $\hat { \lambda } ( \mathcal { D } _ { n } )$ in Algorithm 1 was performed by linear regression on the pairs $\{ ( 1 / \beta _ { i } , \mathbb { E } _ { w } ^ { \beta _ { i } } [ n L _ { n } ( w ) ] ) \} _ { i = 1 } ^ { 5 }$ where the five inverse temperatures $\beta _ { i }$ are centered on the inverse temperature $1 / T$ where $T$ is the temperature reported for each experiment in Table 1 and Table 2.
294
+
295
+ From a Bayesian perspective, predictions about outputs $y$ should be made using the predictive distribution
296
+
297
+ $$
298
+ p ^ { * } ( y | x , D _ { n } ) = \int p ( y | x , w ) p ( w | D _ { n } ) d w .
299
+ $$
300
+
301
+ The Bayesian generalisation error associated to the Bayesian predictor is defined as the KullbackLeibler distance to the true conditional distribution
302
+
303
+ $$
304
+ B _ { g } ( n ) : = D _ { K L } ( q \| p ^ { * } ) = \int q ( y | x ) q ( x ) \log \left( { \frac { q ( y | x ) } { p ^ { * } ( y | x ) } } \right) d y d x .
305
+ $$
306
+
307
+ If some fundamental conditions are satisfied (Definition 6.1 and Definition 6.3 of Watanabe (2009)), then by Theorem 6.8 of loc.cit., there exists a random variable $B _ { g } ^ { * }$ such that as $n \to \infty$ , $\mathbb { E } [ n B _ { g } ( n ) ]$ converges to $\mathbb { E } [ B _ { g } ^ { * } ]$ . In particular, by Theorem 6.10 of Watanabe (2009), $\mathbb { E } [ B _ { g } ^ { * } ] = \lambda$ .
308
+
309
+ # B HYPERPARAMETERS
310
+
311
+ The hyperparameters for the various synthesis tasks are contained in Table 3. The number of samples is $R$ in Algorithm 1 and the number of datasets is $| \tau |$ . Samples are taken according to the Dirichlet distribution, a probability distribution over the simplex, which is controlled by the concentration. When the concentration is a constant across all dimensions, as is assumed here, this corresponds to a density which is symmetric about the uniform probability mass function occurring in the centre of the simplex. The value $\alpha = 1 . 0$ corresponds to the uniform distribution over the simplex. Finally, the chain temperature controls the default $\beta$ value, ie. all inverse temperature values are centered around $1 / T$ where $T$ is the chain temperature.
312
+
313
+ Table 3: Hyperparameters for Datasets and MCMC.
314
+
315
+ <table><tr><td>Hyperparameter</td><td>detectA</td><td>parityCheck</td></tr><tr><td>Dataset size (n)</td><td>200</td><td>100</td></tr><tr><td>Minimum sequence length (a)</td><td>4</td><td>1</td></tr><tr><td>Maximum sequence length (b)</td><td>7/8/9/10</td><td>5/6/7</td></tr><tr><td>Number of samples (R)</td><td>20.000</td><td>2.000</td></tr><tr><td>Number of burn-in steps</td><td>1,000</td><td>500</td></tr><tr><td>Number of datasets (|T|)</td><td>4</td><td>3</td></tr><tr><td>Target accept probability</td><td>0.8</td><td>0.8</td></tr><tr><td>Concentration (α)</td><td>1.0</td><td>1.0</td></tr><tr><td>Chain temperature (T)</td><td>log(500)/log(1000)</td><td>log(300)</td></tr><tr><td>Number of timesteps (t)</td><td>10</td><td>42</td></tr></table>
316
+
317
+ # C THE SHIFT MACHINE
318
+
319
+ The pseudo-UTM $\mathcal { U }$ is a complicated Turing machine, and the models $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { w } )$ of Section 2 are therefore not easy to analyse by hand. To illustrate the kind of geometry that appears, we study the simple Turing machine shiftMachine of Clift & Murfet (2018) and formulate an associated statistical learning problem. The tape alphabet is $\Sigma = \{ \boxed { \begin{array} { r l } \end{array} } , A , B , 0 , 1 , 2 \}$ and the input to the machine will be a string of the form $\boxed { 1 } n a _ { 1 } a _ { 2 } a _ { 3 } \boxed { 2 }$ where $n$ is called the counter and $\bar { a _ { i } } \in \{ A , B \}$ . The transition function, given in loc.cit., will move the string of $A$ ’s and $B$ ’s leftwards by $n$ steps and fill the right hand end of the string with $A$ ’s, keeping the string length invariant. For example, if $\square 2 B A B \square$ is the input to $M$ , the output will be $\square 0 B A A \square$ .
320
+
321
+ Set $W = \Delta \{ 0 , 2 \} \times \Delta \{ A , B \}$ and view $w = ( h , k ) \in W$ as representing a probability distribution $( 1 - h ) \cdot 0 + h \cdot 2$ for the counter and $( 1 - k ) \cdot B + k \cdot A$ for $a _ { 1 }$ . The model is
322
+
323
+ $$
324
+ p \big ( \boldsymbol { y } | \boldsymbol { x } = ( a _ { 2 } , a _ { 3 } ) , \boldsymbol { w } \big ) = ( 1 - h ) ^ { 2 } \boldsymbol { k } \cdot \boldsymbol { A } + ( 1 - h ) ^ { 2 } ( 1 - \boldsymbol { k } ) \cdot \boldsymbol { B } + \sum _ { i = 2 } ^ { 3 } \binom { 2 } { i - 1 } h ^ { i - 1 } ( 1 - h ) ^ { 3 - i } \cdot a _ { i } .
325
+ $$
326
+
327
+ This model is derived by propagating uncertainty through shiftMachine in the same way that $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { w } )$ is derived from $\mathrm { \Delta } \mathrm { { s t e p } } ^ { t }$ in Section 2 by propagating uncertainty through $\mathcal { U }$ . We assume that some distribution $q ( x )$ over $\{ A , B \} ^ { 2 }$ is given.
328
+
329
+ Example C.1. Suppose $q ( y | x ) = p ( y | x , w _ { 0 } )$ where $w _ { 0 } = ( 1 , 1 )$ . It is easy to see that
330
+
331
+ $$
332
+ K ( w ) = - { \frac { 1 } { 4 } } \sum _ { a _ { 2 } , a _ { 3 } } \log p \big ( y = a _ { 3 } | x = ( a _ { 2 } , a _ { 3 } ) , w \big ) = - { \frac { 1 } { 2 } } \log [ g ( h , k ) ]
333
+ $$
334
+
335
+ where $g ( h , k ) = \left( ( 1 - h ) ^ { 2 } k + h ^ { 2 } \right) \left( ( 1 - h ) ^ { 2 } ( 1 - k ) + h ^ { 2 } \right)$ is a polynomial in $w$ . Hence
336
+
337
+ $$
338
+ W _ { 0 } = \{ ( h , k ) \in W : g ( h , k ) = 1 \} = \mathbb { V } ( g - 1 ) \cap [ 0 , 1 ] ^ { 2 }
339
+ $$
340
+
341
+ is a semi-algebraic variety, that is, it is defined by polynomial equations and inequalities. Here $\mathbb { V } ( h )$ denotes the vanishing locus of a function $h$ .
342
+
343
+ Example C.2. Suppose $q ( A B ) = 1$ and $\begin{array} { r } { q ( y | x = A B ) = \frac { 1 } { 2 } A + \frac { 1 } { 2 } B } \end{array}$ . Then the Kullback-Leibler divergence is $\begin{array} { r } { K ( h , k ) = - \frac { 1 } { 2 } \log ( 4 f ( 1 - f ) ) } \end{array}$ where $f = ( 1 - h ) ^ { 2 } k + 2 h ( 1 - h )$ . Hence $\nabla K =$ $\begin{array} { r } { ( f - \frac { 1 } { 2 } ) \frac { 1 } { f ( 1 - f ) } \nabla f . } \end{array}$ . Note that $f$ has no critical points, and so $\nabla K = 0$ at $( h , k ) \in ( 0 , 1 ) ^ { 2 }$ if and only if $\begin{array} { r } { f ( h , k ) = \frac { 1 } { 2 } } \end{array}$ . Since $K$ is non-negative, any $w \in W _ { 0 }$ satisfies $\nabla K ( w ) = 0$ and so
344
+
345
+ $$
346
+ W _ { 0 } = [ 0 , 1 ] ^ { 2 } \cap \mathbb { V } ( 4 f ( 1 - f ) - 1 ) = [ 0 , 1 ] ^ { 2 } \cap \mathbb { V } ( f - \frac { 1 } { 2 } )
347
+ $$
348
+
349
+ is semi-algebraic. Note that the curve $\begin{array} { r } { f = \frac { 1 } { 2 } } \end{array}$ is regular while the curve $4 f ( 1 - f ) = 1$ is singular and it is the geometry of the singular curve that is related to the behaviour of $K$ . This curve is shown in Figure 5. It is straightforward to check that the determinant of the Hessian of $K$ is identically zero on $W _ { 0 }$ , so that every point on $W _ { 0 }$ is a degenerate critical point of $K$ .
350
+
351
+ ![](images/6e526ca2a8223c4c58975329dac1b2911fc337af16f18add2a573fa4cdb23bdf.jpg)
352
+ Figure 5: Values of $K ( h , k )$ on $[ 0 , 1 ] ^ { 2 }$ are shown by colour, ranging from blue (zero) to red (0.01). The singular analytic space $K = 0$ (white) and the regular analytic level set $K = 0 . 0 0 1$ (black).
353
+
354
+ # D GENERAL SOLUTION FOR DETERMINISTIC SYNTHESIS PROBLEMS
355
+
356
+ In this section we consider the case of a deterministic synthesis problem $q ( x , y )$ which is finitely supported in the sense that there exists a finite set $\mathcal { X } \subseteq \Sigma ^ { * }$ such that $q ( x ) = c$ for all $x \in \mathcal { X }$ and $q ( x ) = 0$ for all $x \notin \mathcal { X }$ . We first need to discuss the coordinates on the parameter space $W$ of (3). To specify a point on $W$ is to specify for each pair $( \sigma , q ) \in \Sigma \times Q$ (that is, for each tuple on the description tape) a triple of probability distributions
357
+
358
+ $$
359
+ \begin{array} { r l } & { \displaystyle \sum _ { \sigma ^ { \prime } \in Q } x _ { \sigma ^ { \prime } } ^ { \sigma , q } \cdot \sigma ^ { \prime } \in \Delta \Sigma , } \\ & { \displaystyle \sum _ { q ^ { \prime } \in Q } y _ { q ^ { \prime } } ^ { \sigma , q } \cdot q ^ { \prime } \in \Delta Q , } \\ & { \displaystyle \sum _ { d \in \{ L , S , R \} } z _ { d } ^ { \sigma , q } \cdot d \in \Delta \{ L , S , R \} . } \end{array}
360
+ $$
361
+
362
+ The space $W$ of distributions is therefore contained in the affine space with coordinate ring
363
+
364
+ $$
365
+ R _ { W } = \mathbb { R } \big [ \big \{ x _ { \sigma ^ { \prime } } ^ { \sigma , q } \big \} _ { \sigma , q , \sigma ^ { \prime } } , \big \{ y _ { q ^ { \prime } } ^ { \sigma , q } \big \} _ { \sigma , q , q ^ { \prime } } , \big \{ z _ { d } ^ { \sigma , q } \big \} _ { \sigma , q , d } \big ] .
366
+ $$
367
+
368
+ The function $F ^ { x } = \Delta \mathrm { s t e p } ^ { t } ( x , - ) : W \longrightarrow \Delta Q$ is polynomial (Clift & Murfet, 2018, Proposition 4.2) and we denote for $s \in Q$ by $F _ { s } ^ { x } \in R _ { W }$ the polynomial computing the associated component of the function $F ^ { x }$ . Let $\partial W$ denote the boundary of the manifold with corners $W$ , that is, the set of all points on $W$ where at least one of the coordinate functions given above vanishes
369
+
370
+ $$
371
+ \partial W = \mathbb { V } \big ( \prod _ { \sigma , q } \Big [ \prod _ { \sigma ^ { \prime } \in Q } x _ { \sigma ^ { \prime } } ^ { \sigma , q } \prod _ { q ^ { \prime } \in Q } y _ { q ^ { \prime } } ^ { \sigma , q } \prod _ { \substack { d \in \{ L , S , R \} } } z _ { d } ^ { \sigma , q } \Big ] \big )
372
+ $$
373
+
374
+ where $\mathbb { V } ( h )$ denotes the vanishing locus of $h$ .
375
+
376
+ Lemma D.1. $W _ { 0 } \neq W$
377
+
378
+ Proof. Choose $x \in \mathcal { X }$ with $q ( x ) > 0$ and let $y$ be such that $q ( y | x ) = 1$ . Let $w \in W ^ { c o d e }$ be the code for the Turing machine which ignores the symbol under the head and current state, transitions to some fixed state $s \neq y$ and stays. Then $w \not \in W _ { 0 }$ . □
379
+
380
+ Lemma D.2. The set $W _ { 0 }$ is semi-algebraic and $W _ { 0 } \subseteq \partial W$ .
381
+
382
+ Proof. Given $x \in \Sigma ^ { * }$ with $q ( x ) > 0$ we write $y = y ( x )$ for the unique state with $q ( x , y ) \neq 0$ . In this notation the Kullback-Leibler divergence is
383
+
384
+ $$
385
+ K ( w ) = \sum _ { x \in \mathcal { X } } c D _ { K L } ( y | | F ^ { x } ( w ) ) = - c \sum _ { x \in \mathcal { X } } \log F _ { y } ^ { x } ( w ) = - c \log \prod _ { x \in \mathcal { X } } F _ { y } ^ { x } ( w ) .
386
+ $$
387
+
388
+ Hence
389
+
390
+ $$
391
+ W _ { 0 } = W \cap \bigcap _ { x \in \mathcal { X } } \mathbb { V } ( 1 - F _ { y } ^ { x } ( w ) )
392
+ $$
393
+
394
+ is semi-algebraic.
395
+
396
+ Recall that the function $\Delta \mathrm { s t e p } ^ { t }$ is associated to an encoding of the UTM in linear logic by the Sweedler semantics (Clift & Murfet, 2018) and the particular polynomials involved have a form that is determined by the details of that encoding (Clift & Murfet, 2018, Proposition 4.3). From the design of our UTM we obtain positive integers $l _ { \sigma } , m _ { q } , n _ { d }$ for $\sigma \in \Sigma , q \in \bar { Q } , d \in \{ L , S , R \}$ and a function $\pi : \Theta \longrightarrow Q$ where
397
+
398
+ $$
399
+ \Theta = \prod _ { \sigma , q } \Sigma ^ { l _ { \sigma } } \times Q ^ { m _ { q } } \times \{ L , S , R \} ^ { n _ { d } } .
400
+ $$
401
+
402
+ We represent elements of $\Theta$ by tuples $( \mu , \zeta , \xi ) \in \Theta$ where $\mu ( \sigma , q , i ) \in \Sigma$ for $\sigma \in \Sigma , q \in Q$ and $1 \leq i \leq l _ { \sigma }$ and similarly $\zeta ( \sigma , q , j ) \in Q$ and $\xi ( \sigma , q , k ) \in \{ L , S , R \}$ . The polynomial $F _ { s } ^ { x }$ is
403
+
404
+ $$
405
+ F _ { s } ^ { x } = \sum _ { ( \mu , \zeta , \xi ) \in \Theta } \delta ( s = \pi ( \mu , \zeta , \xi ) ) \prod _ { \sigma , q } \Big [ \prod _ { i = 1 } ^ { l _ { \sigma } } x _ { \mu ( \sigma , q , i ) } ^ { \sigma , q } \prod _ { j = 1 } ^ { m _ { q } } y _ { \zeta ( \sigma , q , j ) } ^ { \sigma , q } \prod _ { k = 1 } ^ { n _ { d } } z _ { \xi ( \sigma , q , k ) } ^ { \sigma , q } \Big ]
406
+ $$
407
+
408
+ where $\delta$ is a Kronecker delta. With this in hand we may compute
409
+
410
+ $$
411
+ \begin{array} { r } { W _ { 0 } = W \cap \displaystyle \bigcap _ { x \in \mathcal { X } } \mathbb { V } ( 1 - F _ { y } ^ { x } ( w ) ) } \\ { = W \cap \displaystyle \bigcap _ { x \in \mathcal { X } } \bigcap _ { s \neq y } \mathbb { V } ( F _ { s } ^ { x } ( w ) ) . } \end{array}
412
+ $$
413
+
414
+ But $F _ { s } ^ { x }$ is a polynomial with non-negative integer coefficients, which takes values in $[ 0 , 1 ]$ for $w \in$ $W$ . Hence it vanishes on $w$ if and only if for each triple $\mu , \zeta , \xi$ with $s = \pi ( \mu , \zeta , \xi )$ one or more of the coordinate functions xσ,qµ(σ,q,i), yσ,qζ(σ,q,j), zσ,qξ(σ,q,k) vanishes on $w$ .
415
+
416
+ The desired conclusion follows unless for every $x \in \mathcal { X }$ and $( \mu , \zeta , \xi ) \in \Theta$ we have $\pi ( \mu , \zeta , \xi ) = y$ so that $F _ { s } ^ { x } = 0$ for all $s \neq y$ . But in this case case $W _ { 0 } = W$ which contradicts Lemma D.1. □
417
+
418
+ # E STAGED PSEUDO-UTM
419
+
420
+ Simulating a Turing machine $M$ with tape alphabet $\Sigma$ and set of states $Q$ on a standard UTM requires the specification of an encoding of $\Sigma$ and $Q$ in the tape alphabet of the UTM. From the point of view of exploring the geometry of program synthesis, this additional complexity is uninteresting and so here we consider a staged pseudo-UTM whose alphabet is
421
+
422
+ $$
423
+ \Sigma _ { \mathrm { U T M } } = \Sigma \cup Q \cup \{ L , R , S \} \cup \{ X , \sqsubseteq \}
424
+ $$
425
+
426
+ where the union is disjoint where $\boxed { \begin{array} { r l } \end{array} }$ is the blank symbol (which is distinct from the blank symbol of $M$ ). Such a machine is capable of simulating any machine with tape alphabet $\Sigma$ and set of states $Q$ but cannot simulate arbitrary machines and is not a UTM in the standard sense. The adjective staged refers to the design of the UTM, which we now explain. The set of states is
427
+
428
+ $$
429
+ \begin{array} { r } { Q _ { \mathrm { U T M } } = \{ \mathrm { c o m p S y m b o l , c o m p S t a t e , c o p y S y m b o l , c o p y S t a t e , c o p y } \mathrm { ~ } \forall \mathrm { t o p y ~ } \mathrm { ~ c o p y ~ } \mathrm { ~ c o p y ~ } \mathrm { ~ c o p y ~ } \mathrm { ~ c o p y ~ } \mathrm { ~ c o p y ~ } \mathrm { ~ c o p y ~ } \mathrm { ~ c o m p ~ } } \\ \mathrm { ~ \ " c o m p S t a t e , ~ } \mathrm { \ " { c o p y S y m b o l , } \mathrm { ~ \ " { c o p y S t a t e , } \mathrm { ~ - c o p y S t a t e , } \mathrm { ~ - c o p y D i r , } \mathrm { ~ \ ~ } } } \\ \mathrm { ~ \ " { u p d a t e S y m b o l , u p d a t e S t a t e , u p d a t e D i r , r e s e t D e s c r ~ } \} . } \end{array}
430
+ $$
431
+
432
+ The UTM has four tapes numbered from 0 to 3, which we refer to as the description tape, the staging tape, the state tape and the working tape respectively. Initially the description tape contains a string of the form
433
+
434
+ $$
435
+ X s _ { 0 } q _ { 0 } s _ { 0 } ^ { \prime } q _ { 0 } ^ { \prime } d _ { 0 } s _ { 1 } q _ { 1 } s _ { 1 } ^ { \prime } q _ { 1 } ^ { \prime } d _ { 1 } \dots s _ { N } q _ { N } s _ { N } ^ { \prime } q _ { N } ^ { \prime } d _ { N } X ,
436
+ $$
437
+
438
+ corresponding to the tuples which define $M$ , with the tape head initially on $s _ { 0 }$ . The staging tape is initially a string $X X X$ with the tape head over the second $X$ . The state tape has a single square containing some distribution in $\Delta Q$ , corresponding to the initial state of the simulated machine $M$ , with the tape head over that square. Each square on the the working tape is some distribution in $\Delta \Sigma$ with only finitely many distributions different from $\boxed { \begin{array} { r l } \end{array} }$ . The UTM is initialized in state compSymbol.
439
+
440
+ The operation of the UTM is outlined in Figure 6. It consists of two phases; the scan phase (middle and right path), and the update phase (left path). During the scan phase, the description tape is scanned from left to right, and the first two squares of each tuple are compared to the contents of the working tape and state tape respectively. If both agree, then the last three symbols of the tuple are written to the staging tape (middle path), otherwise the tuple is ignored (right path). Once the $X$ at the end of the description tape is reached, the UTM begins the update phase, wherein the three symbols on the staging tape are then used to print the new symbol on the working tape, to update the simulated state on the state tape, and to move the working tape head in the appropriate direction. The tape head on the description tape is then reset to the initial $X$ .
441
+
442
+ Remark E.1. One could imagine a variant of the UTM which did not include a staging tape, instead performing the actions on the work and state tape directly upon reading the appropriate tuple on the description tape. However, this is problematic when the contents of the state or working tape are distributions, as the exact time-step of the simulated machine can become unsynchronised, increasing entropy. As a simple example, suppose that the contents of the state tape were $0 . 5 q + 0 . 5 p$ , and the symbol under the working tape head was $s$ . Upon encountering the tuple $s q s { ' } q { ' } R$ , the machine would enter a superposition of states corresponding to the tape head having both moved right and not moved, complicating the future behaviour.
443
+
444
+ We define the period of the UTM to be the smallest nonzero time interval taken for the tape head on the description tape to return to the initial $X$ , and the machine to reenter the state compSymbol. If the number of tuples on the description tape is $N$ , then the period of the UTM is $T = 1 0 N + 5$ . Moreover, other than the working tape, the position of the tape heads are $T$ -periodic.
445
+
446
+ # F SMOOTH TURING MACHINES
447
+
448
+ Let $\mathcal { U }$ be the staged pseudo-UTM of Appendix E. In defining the model $p ( \boldsymbol { y } | \boldsymbol { x } , \boldsymbol { w } )$ associated to a synthesis problem in Section 2 we use a smooth relaxation $\Delta \mathrm { { s t e p } } ^ { t }$ of the step function of $\mathcal { U }$ . In this appendix we define the smooth relaxation of any Turing machine following Clift & Murfet (2018).
449
+
450
+ Let $M = ( \Sigma , Q , \delta )$ be a Turing machine with a finite set of symbols $\Sigma$ , a finite set of states $Q$ and transition function $\delta : \Sigma \times Q \bar { \to } \Sigma \times Q \times \{ - 1 , 0 , 1 \}$ . We write $\delta _ { i } = \mathsf { p r o j } _ { i } \circ \delta$ for the $i$ th component of $\delta$ for $i \in \{ 1 , 2 , 3 \}$ . For $\sqsubseteq \Sigma$ , let
451
+
452
+ $$
453
+ \Sigma ^ { \mathbb { Z } , \sqcap } = \{ f : \mathbb { Z } \to \Sigma | f ( i ) = \bigsqcup \mathrm { e x c e p t ~ f o r ~ f i n i t e l y ~ m a n y ~ } i \} .
454
+ $$
455
+
456
+ ![](images/8439277769c907e73a890f5d22819ba3dcc4dc5cc4f53963fd296742f6e34336.jpg)
457
+ Figure 6: The UTM. Each of the rectangles are states, and an arrow $q q ^ { \prime }$ has the following interpretation: if the UTM is in state $q$ and sees the tape symbols (on the four tapes) as indicated by the source of the arrow, then the UTM transitions to state $q ^ { \prime }$ , writes the indicated symbols (or if there is no write instruction, simply rewrites the same symbols back onto the tapes), and performs the indicated movements of each of the tape heads. The symbols $a , b , c , d$ stand for generic symbols which are not $X$ .
458
+
459
+ We can associate to $M$ a discrete dynamical system ${ \widehat { M } } = ( \Sigma ^ { \mathbb { Z } , \sqcup } \times Q , { \mathrm { s t e } } ]$ p) where
460
+
461
+ $$
462
+ { \mathrm { s t e p } } : \Sigma ^ { \mathbb { Z } , \sqcap } \times Q \Sigma ^ { \mathbb { Z } , \sqcap } \times Q
463
+ $$
464
+
465
+ is the step function defined by
466
+
467
+ $$
468
+ \mathrm { s t e p } ( \sigma , q ) = \Bigl ( \alpha ^ { \delta _ { 3 } ( \sigma _ { 0 } , q ) } \bigl ( \ldots , \sigma _ { - 2 } , \sigma _ { - 1 } , \delta _ { 1 } ( \sigma _ { 0 } , q ) , \sigma _ { 1 } , \sigma _ { 2 } , \ldots \bigr ) , \delta _ { 2 } ( \sigma _ { 0 } , q ) \Bigr ) .
469
+ $$
470
+
471
+ with shift map $\alpha ^ { \delta _ { 3 } ( \sigma _ { 0 } , q ) } ( \sigma ) _ { u } = \sigma _ { u + \delta _ { 3 } ( \sigma _ { 0 } , q ) } .$
472
+
473
+ Let $X$ be a finite set. The standard $X$ -simplex is defined as
474
+
475
+ $$
476
+ \Delta X = \{ \sum _ { x \in X } \lambda _ { x } x \in \mathbb { R } X | \sum _ { x } \lambda _ { x } = 1 { \mathrm { a n d } } \lambda _ { x } \geq 0 { \mathrm { f o r ~ a l l } } x \in X \}
477
+ $$
478
+
479
+ where $\mathbb { R } X$ is the free vector space on $X$ . We often identify $X$ with the vertices of $\Delta X$ under the canonical inclusion $i : X \to \Delta X$ given by $\begin{array} { r } { i ( x ) = \sum _ { x ^ { \prime } \in X } \delta _ { x = x ^ { \prime } } x ^ { \prime } } \end{array}$ . For example $\{ 0 , 1 \} \subset$ $\Delta ( \{ 0 , 1 \} ) \simeq [ 0 , 1 ]$ .
480
+
481
+ A tape square is said to be at relative position $u \in \mathbb { Z }$ if it is labelled $u$ after enumerating all squares in increasing order from left to right such that the square currently under the head is assigned zero. Consider the following random variables at times $t \geq 0$ :
482
+
483
+ • $Y _ { u , t } \in \Sigma$ : the content of the tape square at relative position $u$ at time $t$ .
484
+ • $S _ { t } \in Q$ : the internal state at time $t$ .
485
+ · $W r _ { t } \in \Sigma$ : the symbol to be written, in the transition from time $t$ to $t + 1$ .
486
+ · $M v _ { t } \in \{ L , S , R \}$ : the direction to move, in the transition from time $t$ to $t + 1$ .
487
+
488
+ We call a smooth dynamical system a pair $( A , \phi )$ consisting of a smooth manifold $A$ with corners together with a smooth transformation $\phi : A A$ .
489
+
490
+ Definition F.1. Let $M = ( \Sigma , Q , \delta )$ be a Turing machine. The smooth relaxation of $M$ is the smooth dynamical system $( ( \Delta \Sigma ) ^ { \mathbb { Z } , \sqsupset } \times \Delta Q , \Delta \mathrm { s t e p } )$ where
491
+
492
+ $$
493
+ \Delta \mathrm { s t e p } : ( \Delta \Sigma ) ^ { \mathbb { Z } , \square } \times \Delta Q ( \Delta \Sigma ) ^ { \mathbb { Z } , \square } \times \Delta Q
494
+ $$
495
+
496
+ is a smooth transformation sending a state $( \{ P ( Y _ { u , t } ) \} _ { u \in \mathbb { Z } } , P ( S _ { t } ) )$ to $( \{ P ( Y _ { u , t + 1 } ) \} _ { u \in \mathbb { Z } } , P ( S _ { t + 1 } ) )$ determined by the equations
497
+
498
+ $$
499
+ \begin{array} { r } { P ( M v _ { t } = d | C ) = \sum _ { \sigma , q } \delta _ { \delta _ { 3 } ( \sigma , q ) = d } P ( Y _ { 0 , t } = \sigma | C ) P ( S _ { t } = q | C ) , } \end{array}
500
+ $$
501
+
502
+ $$
503
+ \begin{array} { r } { P ( W r _ { t } = \sigma | C ) = \sum _ { \sigma ^ { \prime } , q } \delta _ { \delta _ { 1 } ( \sigma ^ { \prime } , q ) = \sigma } P ( Y _ { 0 , t } = \sigma ^ { \prime } | C ) P ( S _ { t } = q | C ) , } \end{array}
504
+ $$
505
+
506
+ $$
507
+ \begin{array} { r l } & { P ( Y _ { u , t + 1 } = \sigma | C ) = P ( M v _ { t } = L | C ) \Big ( \delta _ { u \neq 1 } P ( Y _ { u - 1 , t } = \sigma | C ) + \delta _ { u = 1 } P ( W r _ { t } = \sigma | C ) \Big ) } \\ & { \qquad + P ( M v _ { t } = S | C ) \Big ( \delta _ { u \neq 0 } P ( Y _ { u , t } = \sigma | C ) + \delta _ { u = 0 } P ( W r _ { t } = \sigma | C ) \Big ) } \\ & { \qquad + P ( M v _ { t } = R | C ) \Big ( \delta _ { u \neq - 1 } P ( Y _ { u + 1 , t } = \sigma | C ) + \delta _ { u = - 1 } P ( W r _ { t } = \sigma | C ) \Big ) , } \end{array}
508
+ $$
509
+
510
+ where $C \in ( \Delta \Sigma ) ^ { \mathbb { Z } , \square } \times \Delta Q$ is an initial state.
511
+
512
+ We will call the smooth relaxation of a Turing machine a smooth Turing machine. A smooth Turing machine encodes uncertainty in the initial configuration of a Turing machine together with an update rule for how to propagate this uncertainty over time. We interpret the smooth step function as updating the state of belief of a “naive” Bayesian observer. This nomenclature comes from the assumption of conditional independence between random variables in our probability functions.
513
+
514
+ Remark F.2. Propagating uncertainty using standard probability leads to a smooth dynamical system which encodes the state evolution of an “ordinary” Bayesian observer of the Turing machine. This requires the calculation of various joint distributions which makes such an extension computationally difficult to work with. Computation aside, the naive probabilistic extension is justified from the point of view of derivatives of algorithms according to the denotational semantics of differential linear logic. See Clift & Murfet (2018) for further details.
515
+
516
+ We call the smooth extension of a universal Turing machine a smooth universal Turing machine. Recall that the staged pseudo-UTM $\mathcal { U }$ has four tapes: the description tape, the staging tape, the state tape and working tape. The smooth relaxation of $\mathcal { U }$ is a smooth dynamical system
517
+
518
+ $$
519
+ \Delta \mathrm { s t e p } _ { \mathcal { U } } : [ ( \Delta \Sigma _ { \mathrm { U T M } } ) ^ { \mathbb { Z } , \bigtriangledown } ] ^ { 4 } \times \Delta Q _ { \mathrm { U T M } } \to [ ( \Delta \Sigma _ { \mathrm { U T M } } ) ^ { \mathbb { Z } , \bigtriangledown } ] ^ { 4 } \times \Delta Q _ { \mathrm { U T M } } .
520
+ $$
521
+
522
+ If we use the staged pseudo-UTM to simulate a Turing machine with tape alphabet $\Sigma \subseteq \Sigma _ { \mathrm { U T M } }$ and states $Q \subseteq \Sigma _ { \mathrm { U T M } }$ then with some determined initial state the function $\Delta$ step restricts to
523
+
524
+ $$
525
+ \Delta \mathrm { s t e p } _ { \mathscr { U } } : ( \Delta \Sigma ) ^ { \mathbb { Z } , \sharp } \times { \mathscr { W } } \times \Delta Q \times \mathscr { X } \longrightarrow ( \Delta \Sigma ) ^ { \mathbb { Z } , \sharp } \times { \mathscr { W } } \times \Delta Q \times \mathscr { X }
526
+ $$
527
+
528
+ where the first factor is the configuration of the work tape, $W$ is as in (3) and
529
+
530
+ $$
531
+ \mathcal { X } = [ ( \Delta \Sigma _ { \mathrm { U T M } } ) ^ { \mathbb { Z } , \sqcap } ] \times \Delta Q _ { \mathrm { U T M } }
532
+ $$
533
+
534
+ where the first factor is the configuration of the staging tape. Since $\mathcal { U }$ is periodic of period $T =$ $1 0 N + 5$ (Appendix E) the iterated function $( \Delta \mathrm { s t e p } _ { \mathscr { U } } ) ^ { T }$ takes an input with staging tape in its
535
+
536
+ default state $X X X$ and UTM state compSymbol and returns a configuration with the same staging tape and state, but with the configuration of the work tape, description tape and state tape updated by one complete simulation step. That is,
537
+
538
+ $$
539
+ ( \Delta \operatorname { s t e p } _ { \mathcal { U } } ) ^ { T } ( x , w , q , X X X , \mathrm { c o m p S y m b o l } ) = ( F ( x , w , q ) , X X X , \mathrm { c o m p S y m b o l } )
540
+ $$
541
+
542
+ for some smooth function
543
+
544
+ $$
545
+ F : ( \Delta \Sigma ) ^ { \mathbb { Z } , \sharp } \times W \times \Delta Q \longrightarrow ( \Delta \Sigma ) ^ { \mathbb { Z } , \sharp } \times W \times \Delta Q .
546
+ $$
547
+
548
+ Finally we can define the function $\Delta \mathrm { s t e p } ^ { t }$ of (4). We assume all Turing machines are initialised in some common state init $\in Q$ .
549
+
550
+ Definition F.3. Given $t \geq 0$ we define $\Delta \operatorname { s t e p } ^ { t } : \Sigma ^ { * } \times W \longrightarrow \Delta Q$ by
551
+
552
+ $$
553
+ \Delta \operatorname { s t e p } ^ { t } ( x , w ) = \Pi _ { Q } F ^ { t } ( x , w , \operatorname { i n i t } )
554
+ $$
555
+
556
+ where $\Pi _ { Q }$ is the projection onto $\Delta Q$ .
557
+
558
+ # G DIRECT SIMULATION
559
+
560
+ For computational efficiency in our PyTorch implementation of the staged pseudo-UTM we implement $F$ of (9) rather than $\Delta \mathrm { s t e p } _ { \mathcal { U } }$ . We refer to this as direction simulation since it means that we update in one step the state and working tape of the UTM for a full cycle where a cycle consists of $T = 1 0 N + 5$ steps of the UTM.
561
+
562
+ Let $S ( t )$ and $Y _ { u } ( t )$ be random variables describing the contents of state tape and working tape in relative positions $0 , u$ respectively after $t \geq 0$ time steps of the UTM. We define ${ \widetilde { S } } ( t ) : = S ( 4 + T t )$ and $\widetilde { Y } _ { u } ( t ) : = Y _ { u } ( 4 + T t )$ where $t \geq 0$ and $u \in \mathbb { Z }$ . The task then is to define functions $f , g$ such that
563
+
564
+ $$
565
+ \widetilde { S } ( t + 1 ) = f ( \widetilde { S } ( t ) )
566
+ $$
567
+
568
+ $$
569
+ \widetilde Y _ { u } ( t + 1 ) = g ( \widetilde Y _ { u } ( t ) ) .
570
+ $$
571
+
572
+ The functional relationship is given as follows: for $1 \leq i \leq N$ indexing tuples on the description tape, while processing that tuple, the UTM is in a state distribution $\lambda _ { i } \cdot \bar { q } + ( 1 - \lambda _ { i } ) \cdot \neg \bar { q }$ where $\bar { q } \in$ {copySymbol, copyState, $\mathrm { c o p y D i r } \}$ . Given the initial state of the description tape, we assume uncertainty about $s ^ { \prime } , q ^ { \prime } , d$ only. This determines a map
573
+
574
+ $$
575
+ \theta : \{ 1 , \dots , N \} \to \Sigma \times Q
576
+ $$
577
+
578
+ where the description tape at tuple number $i$ is given by $\theta ( i ) _ { 1 } \theta ( i ) _ { 2 } P ( s _ { i } ^ { \prime } ) P ( q _ { i } ^ { \prime } ) P ( d _ { i } )$ . We define the conditionally independent joint distribution between $\{ \widetilde { Y } _ { 0 , t - 1 } , \widetilde { S } _ { t - 1 } \}$ by
579
+
580
+ $$
581
+ \begin{array} { l } { { \lambda _ { i } = \displaystyle \sum _ { \sigma \in \Sigma } \delta _ { \theta ( i ) _ { 1 } = \sigma } P ( \widetilde { Y } _ { 0 , t - 1 } = \sigma ) \cdot \sum _ { q \in Q } \delta _ { \theta ( i ) _ { 2 } = q } P ( \widetilde { S } _ { t - 1 } = q ) \hfill } } \\ { { \quad = P ( \widetilde { Y } _ { 0 , t - 1 } = \theta ( i ) _ { 1 } ) \cdot P ( \widetilde { S } _ { t - 1 } = \theta ( i ) _ { 2 } ) . } } \end{array}
582
+ $$
583
+
584
+ We then calculate a recursive set of equations for $0 \leq j \leq N$ describing distributions $P ( \hat { s } _ { j } ) , P ( \hat { q } _ { j } )$ and $P ( \hat { d } _ { j } )$ on the staging tape after processing all tuples up to and including tuple $j$ . These are given by $P ( \hat { s } _ { 0 } ) = P ( \hat { q } _ { 0 } ) = P ( \hat { d } _ { 0 } ) = 1 \cdot X$ and
585
+
586
+ $$
587
+ \begin{array} { r l } & { \displaystyle { P ( \hat { s } _ { i } ) = \sum _ { \sigma \in \Sigma } \{ \lambda _ { i } \cdot P ( s _ { i } ^ { \prime } = \sigma ) + ( 1 - \lambda _ { i } ) \cdot P ( \hat { s } _ { i - 1 } = \sigma ) \} \cdot \sigma + ( 1 - \lambda _ { i } ) \cdot P ( \hat { s } _ { i - 1 } = X ) \cdot X } } \\ & { \displaystyle { P ( \hat { q } _ { i } ) = \sum _ { \ q \in Q } \{ \lambda _ { i } \cdot P ( q _ { i } ^ { \prime } = q ) + ( 1 - \lambda _ { i } ) \cdot P ( \hat { q } _ { i - 1 } = q ) \} \cdot q + ( 1 - \lambda _ { i } ) \cdot P ( \hat { q } _ { i - 1 } = X ) \cdot X } } \\ & { \displaystyle { \hat { l } _ { i } ) = \sum _ { \alpha \in \{ L , R , S \} } \{ \lambda _ { i } \cdot P ( d _ { i } = a ) + ( 1 - \lambda _ { i } ) \cdot P ( \hat { d } _ { i - 1 } = a ) \} \cdot a + ( 1 - \lambda _ { i } ) \cdot P ( \hat { d } _ { i - 1 } = X ) \cdot X . } } \end{array}
588
+ $$
589
+
590
+ Let $A _ { \sigma } = P ( \widehat { s } _ { N } = X ) \cdot P ( \widetilde { Y } _ { 0 , t - 1 } = \sigma ) + P ( \widehat { s } _ { N } = \sigma ) .$ . In terms of the above distributions
591
+
592
+ $$
593
+ P ( \widetilde { S } _ { t } ) = \sum _ { q \in Q } \Big ( P ( \hat { q } _ { N } = X ) \cdot P ( \widetilde { S } _ { t - 1 } = q ) + P ( \hat { q } _ { N } = q ) \Big ) \cdot q
594
+ $$
595
+
596
+ and
597
+
598
+ $$
599
+ \begin{array} { r l } & { P ( \widetilde { Y } _ { u , t } = \sigma ) = P ( \hat { d } _ { N } = L ) \left( \delta _ { u \neq 1 } P ( \widetilde { Y } _ { u - 1 , t - 1 } = \sigma ) + \delta _ { u = 1 } A _ { \sigma } \right) } \\ & { \quad \quad \quad \quad \quad + P ( \hat { d } _ { N } = R ) \left( \delta _ { u \neq - 1 } P ( \widetilde { Y } _ { u + 1 , t - 1 } = \sigma ) + \delta _ { u = - 1 } A _ { \sigma } \right) } \\ & { \quad \quad \quad \quad \quad + P ( \hat { d } _ { N } = S ) \left( \delta _ { u \neq 0 } P ( \widetilde { Y } _ { u , t - 1 } = \sigma ) + \delta _ { u = 0 } A _ { \sigma } \right) } \\ & { \quad \quad \quad \quad \quad + P ( \hat { d } _ { N } = X ) \left( \delta _ { u \neq 0 } P ( \widetilde { Y } _ { u , t - 1 } = \sigma ) + \delta _ { u = 0 } A _ { \sigma } \right) . } \end{array}
600
+ $$
601
+
602
+ Using these equations, we can state efficient update rules for the staging tape. We have
603
+
604
+ $$
605
+ \begin{array} { l l l } { { \displaystyle P ( \hat { s } _ { N } = X ) = \prod _ { j = 1 } ^ { N } ( 1 - \lambda _ { j } ) , \quad } } & { { \displaystyle P ( \hat { s } _ { N } = \sigma ) = \sum _ { j = 1 } ^ { N } \lambda _ { j } \cdot P ( s _ { j } ^ { \prime } = \sigma ) \prod _ { l = j + 1 } ^ { N } ( 1 - \lambda _ { l } ) } } \\ { { \displaystyle P ( \hat { q } _ { N } = X ) = \prod _ { j = 1 } ^ { N } ( 1 - \lambda _ { j } ) , \quad } } & { { \displaystyle P ( \hat { q } _ { N } = q ) = \sum _ { j = 1 } ^ { N } \lambda _ { j } \cdot P ( q _ { j } ^ { \prime } = q ) \prod _ { l = j + 1 } ^ { N } ( 1 - \lambda _ { l } ) } } \\ { { \displaystyle P ( \hat { d } _ { N } = X ) = \prod _ { j = 1 } ^ { N } ( 1 - \lambda _ { j } ) , \quad } } & { { \displaystyle P ( \hat { d } _ { N } = a ) = \sum _ { j = 1 } ^ { N } \lambda _ { j } \cdot P ( d _ { j } = a ) \prod _ { l = j + 1 } ^ { N } ( 1 - \lambda _ { l } ) . } } \end{array}
606
+ $$
607
+
608
+ To enable efficient computation, we can express these equations using tensor calculus. Let $\lambda =$ $( \lambda _ { 1 } , \dots , \lambda _ { N } ) \in \mathbb { R } ^ { N }$ . We view
609
+
610
+ $$
611
+ \theta : \mathbb { R } ^ { N } \xrightarrow { } \mathbb { R } \Sigma \otimes \mathbb { R } Q
612
+ $$
613
+
614
+ as a tensor and so $\begin{array} { r } { \theta = \sum _ { i = 1 } ^ { N } i \otimes \theta ( i ) _ { 1 } \otimes \theta ( i ) _ { 2 } \in \mathbb { R } ^ { N } \otimes \mathbb { R } \Sigma \otimes \mathbb { R } Q . } \end{array}$ . Then
615
+
616
+ $$
617
+ \theta _ { - } \left( P ( \widetilde { Y } _ { 0 , t - 1 } ) \otimes P ( \widetilde { S } _ { t - 1 } ) \right) = \sum _ { i = 1 } ^ { N } i \cdot P ( \widetilde { Y } _ { 0 , t - 1 } = \theta ( i ) _ { 1 } ) \cdot P ( \widetilde { S } _ { t - 1 } = \theta ( i ) _ { 2 } ) = \lambda .
618
+ $$
619
+
620
+ If we view $P ( s _ { * } ^ { \prime } = \bullet ) \in \mathbb { R } ^ { N } \otimes \mathbb { R } ^ { \Sigma }$ as a tensor, then
621
+
622
+ $$
623
+ { \mathcal { S } } ( { \widehat { \mathfrak { s } } } _ { N } ) = \sum _ { j = 1 } ^ { N } P ( s _ { j } ^ { \prime } = \bullet ) \cdot \left( \lambda _ { j } \prod _ { l = j + 1 } ^ { N } ( 1 - \lambda _ { l } ) \right) = \lambda \cdot \left( \prod _ { l = 2 } ^ { N } ( 1 - \lambda _ { l } ) , \prod _ { l = 3 } ^ { N } ( 1 - \lambda _ { l } ) , \ldots , ( 1 - \lambda _ { N } ) , 1 \right)
624
+ $$
625
+
626
+ can be expressed in terms on the vector $\lambda$ only. Similarly, $P ( q _ { * } ^ { \prime } = \bullet ) \in \mathbb { R } ^ { N } \otimes \mathbb { R } ^ { Q }$ with
627
+
628
+ $$
629
+ { \cal P } ( \hat { q } _ { N } ) = \sum _ { j = 1 } ^ { N } P ( q _ { j } ^ { \prime } = \bullet ) \cdot \left( \lambda _ { j } \prod _ { l = j + 1 } ^ { N } ( 1 - \lambda _ { l } ) \right) = \lambda \cdot \left( \prod _ { l = 2 } ^ { N } ( 1 - \lambda _ { l } ) , \prod _ { l = 3 } ^ { N } ( 1 - \lambda _ { l } ) , \ldots , ( 1 - \lambda _ { N } ) , 1 \right)
630
+ $$
631
+
632
+ and $P ( d _ { * } = \bullet ) \in \mathbb { R } ^ { N } \otimes \mathbb { R } ^ { 3 }$ with
633
+
634
+ $$
635
+ ^ { > } ( \hat { d } _ { N } ) = \sum _ { j = 1 } ^ { N } P ( d _ { j } = \bullet ) \cdot \left( \lambda _ { j } \prod _ { l = j + 1 } ^ { N } ( 1 - \lambda _ { l } ) \right) = \lambda \cdot \left( \prod _ { l = 2 } ^ { N } ( 1 - \lambda _ { l } ) , \prod _ { l = 3 } ^ { N } ( 1 - \lambda _ { l } ) , \ldots , ( 1 - \lambda _ { N } ) , 1 \right) .
636
+ $$
parse/train/qiydAcw6Re/qiydAcw6Re_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/qiydAcw6Re/qiydAcw6Re_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/qiydAcw6Re/qiydAcw6Re_model.json ADDED
The diff for this file is too large to render. See raw diff
 
vlm/train/04cII6MumYV/0.png ADDED

Git LFS Details

  • SHA256: 1699a4b092d61736dd1e2f16cb028c326647eefa78c435c56e7c4575d9e4c86b
  • Pointer size: 131 Bytes
  • Size of remote file: 505 kB
vlm/train/04cII6MumYV/1.png ADDED

Git LFS Details

  • SHA256: 79ab0b6ca17afebb2c21967eb0f93becb557529d38124e0b6a35df30c3395767
  • Pointer size: 131 Bytes
  • Size of remote file: 535 kB
vlm/train/04cII6MumYV/10.png ADDED

Git LFS Details

  • SHA256: d7929deab15ff56060ccf3119881c1604a2f164bc231d100051f828886c8cf4c
  • Pointer size: 131 Bytes
  • Size of remote file: 493 kB
vlm/train/04cII6MumYV/11.png ADDED

Git LFS Details

  • SHA256: 40d23e8a4b9e24c2930c03aa0c15c3e3749f179b2a6802f5749909242f2573c1
  • Pointer size: 131 Bytes
  • Size of remote file: 504 kB
vlm/train/04cII6MumYV/2.png ADDED

Git LFS Details

  • SHA256: caa9bbda0559c8381f4456b6ccd83b99df46833739a66737afc56a69758fdf72
  • Pointer size: 131 Bytes
  • Size of remote file: 619 kB
vlm/train/04cII6MumYV/3.png ADDED

Git LFS Details

  • SHA256: 5cc50348d0e98e08a7ccd064d137202eef29187c516c21ad1eaace6f96a2ef89
  • Pointer size: 131 Bytes
  • Size of remote file: 513 kB
vlm/train/04cII6MumYV/4.png ADDED

Git LFS Details

  • SHA256: 0438d46ba5077f30a86b88caadec9ed4bd3453fd21fbfa278410249def0fdadb
  • Pointer size: 131 Bytes
  • Size of remote file: 432 kB
vlm/train/04cII6MumYV/5.png ADDED

Git LFS Details

  • SHA256: 0b0f851407ade6e3834aa14d4239ac307f5761b8aaab95e5ae1b2c7fef31d7a3
  • Pointer size: 131 Bytes
  • Size of remote file: 507 kB
vlm/train/04cII6MumYV/6.png ADDED

Git LFS Details

  • SHA256: 59920f77987da2d7bf1e0c25a6770f20d1f57f2f8b6fcf4d76be6d0354d7b2fd
  • Pointer size: 131 Bytes
  • Size of remote file: 539 kB
vlm/train/04cII6MumYV/7.png ADDED

Git LFS Details

  • SHA256: b75d28aa4b6722a39e72d79e208796779b7b5fb7e9c54a86fc711224fd44b749
  • Pointer size: 131 Bytes
  • Size of remote file: 449 kB
vlm/train/04cII6MumYV/8.png ADDED

Git LFS Details

  • SHA256: 96fa5ea56630ceeabec5c903bdb06cb9b25d886518f9b8923588d25aed0184de
  • Pointer size: 131 Bytes
  • Size of remote file: 458 kB
vlm/train/04cII6MumYV/9.png ADDED

Git LFS Details

  • SHA256: 22fa00b3a500d38f1c13293e6a79632fbb06928b3b4e896dd210447b7650cd43
  • Pointer size: 131 Bytes
  • Size of remote file: 580 kB
vlm/train/HJf9ZhC9FX/0.png ADDED

Git LFS Details

  • SHA256: b3a7a464c54b04ae50c7d71725fc1a73031440e3ee64ce1eb196c1c77e293153
  • Pointer size: 131 Bytes
  • Size of remote file: 518 kB
vlm/train/HJf9ZhC9FX/1.png ADDED

Git LFS Details

  • SHA256: d4d7a2d931c0247f1f886d48678f76bdd13a6b75cac9d682af237c9949304a94
  • Pointer size: 131 Bytes
  • Size of remote file: 582 kB
vlm/train/HJf9ZhC9FX/10.png ADDED

Git LFS Details

  • SHA256: c2a4b6b35a97810d960d0919c2e448a6ad725fa1746c2404bece9f49ec72e7db
  • Pointer size: 131 Bytes
  • Size of remote file: 498 kB
vlm/train/HJf9ZhC9FX/11.png ADDED

Git LFS Details

  • SHA256: 17d2d76e4f0c99a5014a8c53a654da8191b717bfe1b4c094c971e65b1c8c5860
  • Pointer size: 131 Bytes
  • Size of remote file: 551 kB
vlm/train/HJf9ZhC9FX/12.png ADDED

Git LFS Details

  • SHA256: 085643dcbb475c71560f7588a5d26632d88210b433ffcd84dc3b50c767bda8a4
  • Pointer size: 131 Bytes
  • Size of remote file: 314 kB
vlm/train/HJf9ZhC9FX/13.png ADDED

Git LFS Details

  • SHA256: fe9371d64b1b91dee95f7e2cd442197093dd137047b2187b4619a00ab3b8adc3
  • Pointer size: 131 Bytes
  • Size of remote file: 349 kB
vlm/train/HJf9ZhC9FX/14.png ADDED

Git LFS Details

  • SHA256: 50c2b20b2b08d2e371a3f966194bff1905043fe9ecbdd26022dd86405a3f5386
  • Pointer size: 131 Bytes
  • Size of remote file: 399 kB
vlm/train/HJf9ZhC9FX/15.png ADDED

Git LFS Details

  • SHA256: 5fbba48471648fd0c31b719a022d3304274086014a1e6ae7859326fc66e6115d
  • Pointer size: 131 Bytes
  • Size of remote file: 398 kB
vlm/train/HJf9ZhC9FX/16.png ADDED

Git LFS Details

  • SHA256: 6fc512c4621eef55334ba2d901bfe3b830490600fd66977bd58ce9f241fa1ba6
  • Pointer size: 131 Bytes
  • Size of remote file: 396 kB
vlm/train/HJf9ZhC9FX/17.png ADDED

Git LFS Details

  • SHA256: 1f5c10a7f620f93942df7195c85161dcb29d63fc56b7a40ca7150a66110818f3
  • Pointer size: 131 Bytes
  • Size of remote file: 364 kB
vlm/train/HJf9ZhC9FX/2.png ADDED

Git LFS Details

  • SHA256: e3cbeb4d57dba7fd20d8f4a31ff1b515708ddd0f9c8f56aa8e8d1b2e43fbc0bc
  • Pointer size: 131 Bytes
  • Size of remote file: 503 kB
vlm/train/HJf9ZhC9FX/3.png ADDED

Git LFS Details

  • SHA256: ada385298963eb721645bd28ee1b43f27c4f7fdebea2ee4b2ad6e60c60a95d6a
  • Pointer size: 131 Bytes
  • Size of remote file: 424 kB
vlm/train/HJf9ZhC9FX/4.png ADDED

Git LFS Details

  • SHA256: d94f75093272e34ac2ff338119f3cf7e80fe3e7c91e040f7bfaf4162ff6f8bd7
  • Pointer size: 131 Bytes
  • Size of remote file: 519 kB
vlm/train/HJf9ZhC9FX/5.png ADDED

Git LFS Details

  • SHA256: 8dbe5694cc00ff8648905a257b828fc39c986ca7323e7d6fd1085baa5756ae42
  • Pointer size: 131 Bytes
  • Size of remote file: 538 kB
vlm/train/HJf9ZhC9FX/6.png ADDED

Git LFS Details

  • SHA256: aa989a523383c1b4a53d0bbad04c006d0442ab4ffb73aa99cb017f31b0e61d9e
  • Pointer size: 131 Bytes
  • Size of remote file: 500 kB
vlm/train/HJf9ZhC9FX/7.png ADDED

Git LFS Details

  • SHA256: 9abcc9854bdeeb2a7055be2c60b7f9fc0061b43c2f9a79ddc58088408aa8df5f
  • Pointer size: 131 Bytes
  • Size of remote file: 501 kB
vlm/train/HJf9ZhC9FX/8.png ADDED

Git LFS Details

  • SHA256: 7aec988b53eda516ad10c881e13be48c2778c3b0d7b8a96dc7d5d4eea847fc1d
  • Pointer size: 131 Bytes
  • Size of remote file: 355 kB
vlm/train/HJf9ZhC9FX/9.png ADDED

Git LFS Details

  • SHA256: 28cef32ba18a3627997d763f84d77b434a67cc0476c04a5b0852af849e7977b1
  • Pointer size: 131 Bytes
  • Size of remote file: 455 kB
vlm/train/HkGmDsR9YQ/0.png ADDED

Git LFS Details

  • SHA256: cfc1e38d45e0a199000d6770c3af44470deb09f3c3d4d3bdb9cd9b557ed9c100
  • Pointer size: 131 Bytes
  • Size of remote file: 514 kB
vlm/train/HkGmDsR9YQ/1.png ADDED

Git LFS Details

  • SHA256: 4a1f7182d606cb8db79c116e081cd9d8870067141ddd7952e0e9dcd458c4b157
  • Pointer size: 131 Bytes
  • Size of remote file: 527 kB
vlm/train/HkGmDsR9YQ/10.png ADDED

Git LFS Details

  • SHA256: d432d55be468103ab74ca0bd62bc13e7862930370d45aab885ffb5292286b998
  • Pointer size: 131 Bytes
  • Size of remote file: 309 kB
vlm/train/HkGmDsR9YQ/11.png ADDED

Git LFS Details

  • SHA256: 92a338587be22ee4f2f6e81c26fefcb47ba18a9d8c35efebc47bbd69b6be5f71
  • Pointer size: 131 Bytes
  • Size of remote file: 359 kB
vlm/train/HkGmDsR9YQ/12.png ADDED

Git LFS Details

  • SHA256: 56b25f1d551932b6f6f4c56bcfbdd10193fcfd86325e7e07725ddc50aa2d51eb
  • Pointer size: 131 Bytes
  • Size of remote file: 322 kB
vlm/train/HkGmDsR9YQ/13.png ADDED

Git LFS Details

  • SHA256: 54dcbaf113dfeeef8f6453dbbfe95b17797a616123d8c7361c94d9605fdb3067
  • Pointer size: 131 Bytes
  • Size of remote file: 516 kB
vlm/train/HkGmDsR9YQ/2.png ADDED

Git LFS Details

  • SHA256: 85b617058d700d48c64aa71dca9b0667d0999ffe2967a754bd4058659f9020e8
  • Pointer size: 131 Bytes
  • Size of remote file: 564 kB
vlm/train/HkGmDsR9YQ/3.png ADDED

Git LFS Details

  • SHA256: ab4c3e4dd60b2411cc728adb21e8a0e9ec09e1eb2ac3595609da4567899e8070
  • Pointer size: 131 Bytes
  • Size of remote file: 532 kB