ZHANGYUXUAN-zR commited on
Commit
ab31d93
·
verified ·
1 Parent(s): b4bf9af

Add files using upload-large-folder tool

Browse files
parse/train/8vXYx6d8Wc/8vXYx6d8Wc.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # No RL, No Simulation: Learning to Navigate without Navigating
2
+
3
+ Meera Hahn ∗ Georgia Institute of Technology
4
+
5
+ Devendra Chaplot Facebook AI Research
6
+
7
+ Shubham Tulsiani Facebook AI Research
8
+
9
+ Mustafa Mukadam Facebook AI Research
10
+
11
+ James M. Rehg Georgia Institute of Technology
12
+
13
+ Abhinav Gupta Facebook AI Research
14
+
15
+ # Abstract
16
+
17
+ Most prior methods for learning navigation policies require access to simulation environments, as they need online policy interaction and rely on ground-truth maps for rewards. However, building simulators is expensive (requires manual effort for each and every scene) and creates challenges in transferring learned policies to robotic platforms in the real-world, due to the sim-to-real domain gap. In this paper, we pose a simple question: Do we really need active interaction, ground-truth maps or even reinforcement-learning (RL) in order to solve the image-goal navigation task? We propose a self-supervised approach to learn to navigate from only passive videos of roaming. Our approach, No RL, No Simulator (NRNS), is simple and scalable, yet highly effective. NRNS outperforms RL-based formulations by a significant margin. We present NRNS as a strong baseline for any future imagebased navigation tasks that use RL or Simulation.
18
+
19
+ # 1 Introduction
20
+
21
+ In recent years, we have seen significant advances in learning-based approaches for indoor navigation [1, 2]. Impressive performance gains have been obtained for a range of tasks, from non-semantic point-goal navigation [3] to semantic tasks such as image-goal [4] and object-goal navigation [5, 6], via methods that use reinforcement learning (RL). The effectiveness of RL for these tasks can be attributed in part to the emergence of powerful new simulators such as Habitat [7], Matterport [8] and AI2Thor [9]. These simulators have helped scale learning to billions of frames by providing large-scale active interaction data and ground-truth maps for designing reward functions. But do we actually need simulation and RL to learn to navigate? Is there an alternative way to formulate the navigation problem, such that no ground-truth maps or active interaction are required? These are valuable questions to explore because learning navigation in simulation constrains the approach to a limited set of environments, since the creation of 3D assets remains costly and time-consuming.
22
+
23
+ In this paper, we propose a self-supervised approach to learning how to navigate from passive egocentric videos. Our novel method is simple and scalable (no simulator required for training), and at the same time highly effective, as it outperforms RL-based formulations by a significant margin. To introduce our approach, let us first examine the role of RL and simulation in standard navigation learning methods. In the standard RL formulation, an agent gets a reward upon reaching the goal, followed by a credit assignment stage to determine the most useful state-action pairs. But do we actually need the reinforce function for action credit assignment? Going a step further, do we even need to learn a policy explicitly? In navigation, we argue that the state space itself is highly structured via a distance function, and the structure itself could be leveraged for credit assignment. Simply put, states that help reduce the distance to the goal are better – and therefore predicted distance can be used either as the value function or as a proxy for it. In fact, RL formulations frequently use ‘distance reduced to goal’ in reward shaping. The key property of our approach is that we learn a generalizable distance estimator directly from passive videos, and as a result we do not require any interaction. We demonstrate that an effective distance estimator can be learned directly from visual trajectories, without the need for an RL policy to map visual observations to the action space, thereby obviating the need for extensive interaction in a simulator and hand-designed rewards. However passive videos do not provide learning opportunities for obstacle avoidance since they rarely, if ever, consist of cameras bumping into walls. We forgo the need for active interaction to reason about collisions as we show that obstacle avoidance is only required locally and simple depth maps are sufficient to prune invalid actions and locations for navigation. More broadly, our approach can be considered as closely related to model-based control, which is an alternative paradigm to RL-based policy learning, with the key insight that components of the model and cost functions can be learned from passive data.
24
+
25
+ ![](images/796b1ea458b7ea272fbb10df9b45177eec218c6ee5296bc1dc4ebc1d5f50ec40.jpg)
26
+ Figure 1: Left: Using passive videos we learn to predict distances for navigation. Our distance function learns the priors of the layouts of indoor buildings to estimate distances to goal location. Right: Image-Goal Navigation Task [10]. Our model uses distance function to predict distances of unexplored nodes and uses greedy policy to choose the shortest-distance node.
27
+
28
+ No RL, No Simulator Approach (NRNS): Our NRNS algorithm can be described as follows. During training we learn two functions from passive videos: (a) a geodesic distance estimator: given the state features and goal image, this function predicts the geodesic distance of the unexplored frontiers of the graph to the goal location. This enables a greedy policy in which we select the node with the least distance; (b) a target prediction model: Given the goal image and the image from the agent’s current location, this function predicts if the goal is within sight and can be reached without collisions, along with the exact location of the goal. The key is that both the distance model and the target prediction model can be learned from passive RGBD videos, with SLAM used to estimate relative poses. We believe our simple NRNS approach should act as a strong baseline for any future approaches that use RL and simulation. We show that NRNS outperforms end-to-end RL, even when RL is trained using ${ 5 } \mathbf { x }$ more data and $1 0 \mathrm { x }$ more compute. Furthermore, unlike RL methods which need to be trained in simulation because they require substantial numbers of interactions, NRNS can be trained directly on real-world videos alone, and therefore does not suffer from the sim-to-real gap.
29
+
30
+ # 2 Related Work
31
+
32
+ Navigation in simulators. Navigation tasks largely fall into two main categories [1], ones in which a goal location is known [11, 12, 13] and limited exploration is required, and ones in which the goal location is not known and efficient exploration is necessary. In the second category, tasks range from finding the location of specific objects [5], rooms [14], or images [15], to the task of exploration itself [2]. The majority of current work [12, 15, 16, 3] leverages simulators [7] and extensive interaction to learn end-to-end models for these tasks. In contrast, our work shows that the semantic cues needed for exploration-based navigation tasks can be learned directly from video trajectories.
33
+
34
+ Navigation using passive data. Several prior works have tackled the navigation task when there is some passive experience available in the test environment [17, 18, 19, 20, 21, 22]. A more limited number of works train navigation policies without simulation environments [19, 22, 23]. Unlike these works, we tackle the task of image goal navigation in unseen environments where there is no experience available to the agent in the test environments during training [19, 22] and no map knowledge is given about the environments [23]. Two works adopting similar requirements are Chaplot et al. [4] and Chang et al. [24]. Most closely related is Neural Topological SLAM (NTS) [4], which builds a topological map and estimates distance to the target image using a learned function. But NTS requires access to panoramic observations and ground-truth maps for training the distance function, making it much less scalable than our approach which can be trained with just video data with arbitrary field of view. Chang et al. [24] adopt a similar approach to NTS for object goal navigation, while also incorporating video data from YouTube for learning a Q function. A key difference is that our method learns a episodic distance function, utilizing all past observations to estimate distances to the target image. In comparison, Chaplot et al. [4] and Chang et al. [24] use a memory-less distance function operating only on the agent’s current observation.
35
+
36
+ Prior work work on LfD [25, 26, 27] requires: (a) access to actions (e.g. teleoperated in simulator); and (b) optimal human demonstrations. The goal in LfD is to learn policies that match given demonstrations by either mimicking the actions or formulating rewards using the demonstrations. In contrast, NRNS does neither, since our passive training data does always contain optimal navigation trajectories and NRNS does not compute any rewards as it does not require RL or credit assignment. We make the same distinction between our work and offline RL [28, 29, 30], which does not utilize online data gathering but still learns a policy using rewards from observed trajectories. In contrast, we do not use any rewards or learn a policy. Instead, our approach aims to learn a distance-to-goal model and uses a greedy policy based on the distance predictions. From this perspective, NRNS is performing model-based learning.
37
+
38
+ Map-Based Navigation. There are multiple spatial representations which can be leveraged in solving navigation tasks. Metric maps, which maintain precise information on the occupied space in an environment, are commonly used for visual navigation [2, 10, 6]. However, metric maps suffer from issues of scalability and consistency under sensor noise. As a result, topological maps have recently gained traction [4, 21, 18, 24, 31] as a means to combat these issues. A significant difference from our approach is that in these prior works a topological map is given at the beginning of the navigation task, and is not created or changed during navigation. Specifically, Savinov et al. [18] create the map from a given 5 minute video of the test environment and Chen et al. [21] assume access to a ground truth map. In our image-goal navigation set up, the agent is given no information about the test environment. Chaplot et al. [4] do not require experience in the test environment and build topological maps at test time, but still requires access to a simulator for computing shortest-path distances between pairs of images. Additionally, topological maps for robotic navigation draw inspiration from both animal and human psychology. The cognitive map hypothesis proposes that the brain builds coarse internal spatial representations of environments [32, 33]. Multiple works argue that this internal representation relies on landmarks [34, 35], making human cognitive maps more similar to topological maps as opposed to metric maps.
39
+
40
+ Graph Neural Networks. Graph Neural Networks (GNN) are specifically used for modeling relational data in a non-Euclidean space. We employ a GNN for estimating distance-to-goal over the agent’s exploration frontier. Specifically we employ an augmented Graph Attention Network [36] which allows for a weighted aggregation of neighboring node information. Graph Networks are rarely-used for the task of topological map-based visual navigation. Savinov et al. [18] use a GNN for the sub-task of localizing the agent in a ground truth topological map. We believe we are the first to leverage graph neural networks in a visual navigation task.
41
+
42
+ # 3 Image Goal Navigation using Topological Graphs
43
+
44
+ We propose No RL, No Simulator “NRNS”, a hierarchical modular approach to image-goal navigation that consists of: a) high-level modules for maintaining a topological map and using visual and semantic reasoning to predict sub-goals, and b) heuristic low-level modules that use depth data to select low level navigation actions to reach sub-goals and determine geometrically-explorable areas. We first describe NRNS in detail and then show in Sec. 4 that the high-level modules can be trained without using any simulation, interaction or even ground-truth scans – i.e. that passive video data alone is sufficient to learn the semantic and visual reasoning models needed for navigation.
45
+
46
+ # 3.1 Formulation and Representation
47
+
48
+ Task Definition. We tackle the task of image-goal navigation, where an agent is placed in a novel environment, and is tasked with navigating to an (unknown) goal position that is specified using an image taken from that position, as shown in Fig. 2. More formally, an episode begins with an agent receiving an RGB observation $( I _ { G } )$ corresponding to the goal position. At each time step, $t$ , of the episode the agent receives a set of observations $s _ { t }$ , and must take a navigation action $a _ { t }$ . The agents state observations, $s _ { t }$ , are defined as a narrow field of view RGBD image, $I _ { t }$ , and egocentric pose estimate, $P _ { t }$ . The agent must execute navigational actions to reach goal within a maximum number of steps.
49
+
50
+ Topological Map Representation. The NRNS agent maintains a topological map in the form of a graph $G ( N , E )$ , defined by nodes $N$ and edges $E$ , which provides a sparse representation of the environment. Concretely, a node $n _ { i } \in N$ is associated with a pose $p _ { i }$ , defined by location and orientation. Each node $n _ { i }$ can either be ‘explored’ i.e. the agent has previously visited the pose and obtained a corresponding RGBD image $I _ { i }$ , or ‘unexplored’ e.g. unvisited positions at the exploration frontier which may be visited in the future. Each edge $e \in E$ connects a pair of adjacent nodes $n _ { i }$ and $n _ { j }$ . Nodes are deemed adjacent only if a short and ‘simple’ path exists between the two nodes, as further detailed in Sec. 3.3. Each edge between adjacent nodes is then associated with the attribute $\Delta P -$ the relative pose between the two nodes.
51
+
52
+ ![](images/f642cf795c210b3946ebffc53e58afde6bf9f7cf25fb58f2ef1c81b82fb24630.jpg)
53
+ Figure 2: Image-Goal navigation task using a topological graph.
54
+
55
+ # 3.2 Global Policy via Distance Prediction
56
+
57
+ Given a representation of the environment as a topological
58
+ graph, our global policy is tasked with identifying the next ‘unexplored’ node that the agent should visit, and the low-level policy $( \mathcal { G } _ { L P } )$ is then responsible for executing the precise actions. Intuitively, we want our agent to select as the next node the one that minimizes the total distance to goal. The global policy’s inference task can thus be reduced to predicting distances from nodes in our graph to the goal location. To this end, our approach leverages a distance prediction network $( \mathcal { G } _ { D } )$ which operates on top of $G ( N , E )$ to predict distance-to-goal for each unexplored node $n _ { u e } \in G$ . Our global policy then simply selects the node with least total distance to goal which is defined as: distance to the unexplored node from the agent’s current position, plus the predicted distance from the unexplored node to the goal.
59
+
60
+ The input to the distance prediction network $\mathcal { G } _ { D }$ is the current topological graph $G ( N , E ) _ { t }$ and $I _ { G }$ While the explored nodes have an image associated with them, the unexplored nodes naturally do not. To allow prediction in this setup, we use a Graph Convolutional Network (GCN) architecture to first induce visual features for $n _ { u e } \in G$ , and then predict the distance to goal using an MLP.
61
+
62
+ As illustrated in Fig. 3, the network first encodes the RGB images at each explored node $( n _ { i } )$ using a ResNet18 [37] to obtain feature vector $\mathbf { h } _ { \mathbf { i } } \in \mathbb { R } ^ { 5 1 2 }$ . Each edge $e _ { i , j }$ is further represented by a feature vector $\mathbf { u _ { i , j } }$ , which is the flattened pose transformation matrix $( ^ { \mathbf { i } } \mathbf { K _ { j } } \in \mathbb { R } ^ { 4 \times 4 } )$ . The adjacency matrix $\mathbf { A } _ { \mathbf { t } }$ , $\mathbf { u _ { i , j } }$ , and $\mathbf { h _ { i } }$ are passed through a GCN comprising of two graph attention (GAT) layers [36] with intermediate nonlinearities. Note that we extend the graph attention layer architecture to additionally use edge features $\mathbf { u _ { i , j } }$ when computing attention coefficients. The predicted visual features for unexplored nodes are then finally used to compute predicted distance-to-goal $d _ { i }$ from each node to $I _ { G }$ using a simple MLP.
63
+
64
+ To select the most ‘promising’ $n _ { u e }$ to explore, the distance from the agent’s current location $n _ { t }$ also needs to be accounted for. For $n _ { u e } , n _ { t } \in G$ , the ‘travel cost’ is added to $d _ { i }$ , calculated using shortest path on $\mathbf { G }$ from $n _ { u e } n _ { t }$ . Our global policy then selects the unexplored node with the minimum total distance score as the next sub-goal.
65
+
66
+ # 3.3 Local Navigation and Graph Expansion
67
+
68
+ The NRNS global policy selects the sub-goal that the agent should pursue, and the precise low-level actions to reach the sub-goal are executed by a heuristic local policy. After the local policy finishes execution, the NRNS agent updates the graph to include the new observations and expands the graph with unexplored nodes at the exploration frontier.
69
+
70
+ Local Policy. The NRNS local policy, denoted as $\mathcal { G } _ { L P }$ , receives a target position, defined by distance and angle $( \rho _ { i } , \phi _ { i } )$ with respect to the agent’s current location. When $\mathcal { G } _ { D }$ outputs a sub-goal node, $\rho _ { i }$ , $\phi _ { i }$ are calculated from the current position and passed to $\mathcal { G } _ { L P }$ . Low level navigation actions are selected and executed using a simplistic point navigation model based on the agent’s egocentric RGBD observations and (noisy) pose estimation. To navigate towards its sub-goal, the agent builds and maintains a local metric map using the noisy pose estimator and depth input. This effectively allows it to reach local goals and avoid obstacles. The local metric maps are discarded upon reaching the sub-goal, as they are based on a noisy pose estimator. This policy is adapted from [10] and is also used for Image-Goal Navigation in [4].
71
+
72
+ ![](images/d0bf29d643320e974d722bd4c12082b11eef0a15f153b7f46db4133364ce96e4.jpg)
73
+ Figure 3: The Global Policy and $\mathcal { G } _ { D }$ architecture used to model distance-to-goal prediction. $\mathcal { G } _ { D }$ employs a Resnet18 encoder, Graph Attention layers, and a multi-layer perceptron with a sigmoid.
74
+
75
+ Explorable Area Prediction for Graph Expansion. We incorporate a ‘graph expansion’ step after the agent reaches a sub-goal via $\mathcal { G } _ { L P }$ and before the agent selects a new sub-goal. First, the agent updates $G ( N , E )$ to record the current location as an explored node and store the associated RGBD observation. Second, the agent creates additional ‘unexplored’ nodes, $n _ { u e }$ , adjacent to the current node, $n _ { t }$ based on whether the corresponding directions are deemed ‘explorable’. We use a explorable area prediction module, $\mathcal { G } _ { E A }$ , to determine which adjacent areas to the current location are geometrically explorable. This is untrained, heuristic module takes the egocentric depth image $I _ { t _ { d e p t h } }$ and tests 9 angles in the direction from the current position and returns the angles that are not blocked by obstacles within a depth of 3 meters. The NRNS agent tests $\theta$ at $[ 0 , \pm 1 5 , \pm 3 0 , \pm 4 5 , \pm 6 0 ]$ , these angles are chosen based on the agent’s turn radius of $1 5 ^ { \circ } { }$ and $1 2 0 ^ { \circ }$ FOV. For all $\theta$ determined to be explorable, the agent updates $G ( N , E )$ by adding an ‘unexplored’ node at position $\rho = 1 m$ and $\phi = \theta$ relative to the node the agent is at, with a corresponding edge linking the current node to the new node. If a node already exists in one of the explorable areas at a nearby position, only an edge is added to $G ( N , E )$ and not a new node.
76
+
77
+ # 3.4 Putting it Together
78
+
79
+ Stopping Criterion. The above described modules $( \mathcal { G } _ { D } , \mathcal { G } _ { L P } , \mathcal { G } _ { E A } )$ allow the NRNS agent to incrementally explore its environment while making progress towards the location of the target image. To allow the agent to terminate navigating when it is near the goal, we additionally learn a target prediction network $\mathcal { G } _ { T }$ that provides a stopping criterion. Given $I _ { G }$ and current image $I _ { t }$ , $\mathcal { G } _ { T }$ is simple MLP that predicts: a) a probability $\beta _ { s } \in [ 0 , 1 ]$ indicating whether the goal is within sight, and if so, b) the relative position (distance, direction) of the goal $\rho _ { g } , \phi _ { g }$ .
80
+
81
+ Algorithm. We outline our navigation algorithm in Fig. 4. An example result on the image-goal navigation task is shown in Fig. 6. Among the modules used, the local policy module $\mathcal { G } _ { L P }$ and the explorable area module $\mathcal { G } _ { E A }$ do not require any learning. As we show in Sec. 4, $\mathcal { G } _ { D }$ and $\mathcal { G } _ { T }$ can both be learned using only passive data.
82
+
83
+ # Algorithm 1: NRNS Image Navigation
84
+
85
+ // initialize graph
86
+ $n _ { 0 } = ( P _ { t = 0 } , I _ { t = 0 } ) ; e _ { 0 } = ( n _ { 0 } , n _ { 0 } ) ;$ ;
87
+ $N = ( n _ { 0 } ) ; E = ( e _ { 0 } )$ ;
88
+ $G = ( N , E )$ ;
89
+ // loop until reached goal or max steps
90
+ while steps taken $<$ max steps do $n _ { i + 1 } , . . . , n _ { i + k } = \mathcal G _ { E A } ( I _ { t } )$ ; // determine valid explorable areas $N _ { } ^ { } + = n _ { i + 1 } , . . . , n _ { i + k } ; E ^ { } + = e _ { t , i + 1 } , . . . , e _ { t , i + k } ;$ ; // add unexplored nodes & edges $\scriptstyle n _ { s g }$ $, ( \rho _ { s g } , \phi _ { s g } ) = \mathrm { a r g m i n } ( \mathcal { G } _ { D } ( G , I _ { G } ) + \mathrm { T r a v e l C o s t } ( G , n _ { t } ) )$ ; // select sub-goal $I _ { t + 1 } , P _ { t + 1 } = \mathcal { G } _ { L P } ( \rho _ { s g } , \phi _ { s g } )$ ; // navigate to sub-goal $n _ { s g } = ( P _ { t + 1 } , I _ { t + 1 } ) ,$ // update graph with observations $\beta _ { s } , ( \rho _ { g } , \phi _ { g } ) = \mathcal { G } _ { T } ( I _ { t + 1 } , I _ { G } )$ ; $/ /$ stopping criterion if $\beta _ { s } > . 5$ then $\mathcal { G } _ { L P } ( \rho _ { g } , \phi _ { g } )$ ; // navigate to target break; end
91
+ end
92
+
93
+ ![](images/6fa3fd4849135895a0c238963e66efe3fca95354390d1859a0ea55d63208718e.jpg)
94
+ Figure 4: The hierarchical modular NRNS approach to the Image-Goal Navigation task, for a single time step in the episode. The global policy $\mathcal { G } _ { D }$ selects an unexplored node $n _ { i }$ as a sub-goal. The sub-goal position $( \rho _ { i } , \phi _ { i } )$ is passed to the local navigation policy $\mathcal { G } _ { L P }$ which takes in the current RGBD observations and outputs low level actions until the agent reaches $n _ { i }$ . The graph is then updated with the current observations $I _ { t + 1 }$ and new unexplored nodes and edges generated by $\mathcal { G } _ { E A }$
95
+
96
+ # 4 Learning from Passive Data
97
+
98
+ The learned high-level policies of NRNS are the Distance Network $\mathcal { G } _ { D }$ and Target Prediction Network $\mathcal { G } _ { T }$ . A key contribution of our work is showing that these functions can be learned from passive data alone. This eliminates the need for online interaction and ground-truth maps, allowing us to train the NRNS algorithm without using RL or simulation.
99
+
100
+ Learning Distance Prediction. First, we describe how to learn the function $\mathcal { G } _ { D }$ . Given a topological graph (consisting of both explored and unexplored nodes) and a goal image as input, $\mathcal { G } _ { D }$ predicts the geodesic distance from all unexplored nodes to the location of the goal image. Our training data therefore consists of triplets of the form $( G , I _ { G } , D _ { U } )$ , where $G$ is a topological graph, $I _ { G }$ is a goal image, and $D _ { U }$ is the ground-truth distances from a set of unexplored nodes to the goal location (we use L2-Loss to train the distance function).
101
+
102
+ We generate training graphs using passive videos in a two-step process. In the first step, we create a topological graph, $G _ { \mathcal { V } _ { i } }$ , for every video $\nu _ { i }$ in the passive dataset. Each graph contains both explored and unexplored nodes. We approximate distance to unexplored nodes using the geodesic distance along the trajectory. In the second step, we uniformly sample sub-graphs and goal locations over each video’s topological graph.
103
+
104
+ Step 1: Video to Topological Graph. First, we generate a step-wise trajectory graph in which each frame is a node with odometry information. We then process this step-wise graph into a topological graph using affinity clustering [38]. We use the visual features from each frame concatenated with odometry information as the feature vector for clustering. Visual features for each frame are extracted via a Places365 [39] pretrained Resnet18. Each cluster represents a single node in the topological graph $G _ { \mathcal { V } _ { i } }$ and the stepwise visual features of frames in the cluster are average pooled. The topological graphs are then expanded to have unexplored nodes, used in training the distance function. These are created by applying $\mathcal { G } _ { E A }$ to the RGBD of each node centroid in $G _ { \mathcal { V } _ { i } }$ . Fig. 5 illustrates the process by which an example video is converted into a topological graph for training data.
105
+
106
+ Step 2: Sampling training datapoints. Individual data instances are selected via uniform sampling without replacement. This means selecting a random node in $G _ { \nu }$ as the goal location and a random sub-graph of $G _ { \nu }$ as the observed trajectory and current location. Distance along the trajectory is used as the ground truth distance between nodes in the sub-graph and the goal image: these distance labels are used to train the network $\mathcal { G } _ { D }$ . Due to non-optimal long term paths of the video trajectories, distances may overestimate distance to the goal. In other words while each node along the generated trajectory graphs are legitimate paths to the goal, shorter paths may exist that are not covered in the training trajectory graph, making this a challenging problem. In total, $\mathcal { G } _ { D }$ is trained using ${ \sim } 1 \mathrm { k }$ training instances per scan for both Gibson and MP3D.
107
+
108
+ Learning Target Direction Prediction The $\mathcal { G } _ { T }$ prediction network receives a goal image and the current node image as input, and predicts whether the goal is within sight of the current image. To gather training instances for $\mathcal { G } _ { T }$ , we use the RGB frame at a randomly selected node as the goal image. We make a simplifying assumption that any adjacent pair of nodes (similar features and odometry) in the topological graph are positive examples and any other pair of nodes are negative examples.
109
+
110
+ ![](images/12ebee142a4a82272301c3ac9fae5fa18cbdb178a447b94012107257550fa805.jpg)
111
+ Figure 5: Example from the passive video dataset. Frames of a video trajectory $\nu _ { i }$ are shown on the left. The stepwise trajectory is then turned into a trajectory graph $G _ { \mathcal { V } _ { i } }$ via affinity clustering [38] of node image and pose features. $G _ { \mathcal { V } _ { i } }$ is adapted to train the Global Policy $\mathcal { G } _ { D }$ and target direction prediction $\mathcal { G } _ { E } A$ . An example of an adapted $G _ { \mathcal { V } _ { i } }$ for training is shown on the left.
112
+
113
+ # 5 Experiments
114
+
115
+ Image-Goal Navigation Task Setup. At the beginning of each episode, the agent is placed in an unseen environment. The agent receives observations from the current state, a $3 \times 1$ odometry pose reading and RGBD image, and the RGB goal image. Observation and goal images are $1 2 0 ^ { \circ } \mathrm { F O V }$ and of size $4 8 0 \times 6 4 0$ . An episode is considered a success if the agent is able to reach within $1 m$ of the goal location and do so within a maximum episode length of 500 steps. Each episode is also evaluated by the efficiency of the navigational path from start to goal, which is quantitatively measured by Success weighted by inverse Path Length (SPL) [1]. Note, the narrow field of the agent in this task definition differs from past works which use panoramic views [4]. The decision to use a narrow field is based on our method of training only on passive data. Current passive video datasets of indoor trajectories such as YouTube Tours [24], RealEstate10k [40] and our NRNS passive video dataset, do not contain panoramas.
116
+
117
+ Action Space. The agent’s action space contains four actions: forward by . $. 2 5 \mathrm { m }$ , rotate left by $1 5 ^ { \circ } { }$ , rotate right by $1 5 ^ { \circ } { }$ , and stop. In our experiments, we consider two cases for pose estimation and action transition. In the first condition the agent has access to ground truth pose and the navigation actions are deterministic. In the second condition, noise is added to the pose estimation and the actuation of the agent. We utilize the realistic pose and actuation noise models from [10], which are similarly used in [4]. The actuation noise adds stochastic rotational and translations transitions to the agent’s navigational actions.
118
+
119
+ Training Data. Our key contribution is the ability to learn navigation agents from passive data. In theory, our approach can be trained from any passive data source, and we test this in Sec. 5.2 using RealEstate10K [40]. However, since RL-based baselines are trained in the Habitat Simulator [7], we generate our NRNS dataset, of egocentric trajectory videos, using the same Habitat training scenes to provide direct comparison and isolate domain gap issues. Specifically, the trajectory videos are created as follows. A set of 2 - 4 points are randomly selected from the environment using uniform sampling. A video is then generated of the concatenated RGBD frames of the shortest path between consecutive points. Note that the complete video trajectory (from first source to final target) is not step-wise optimal. Frames in the videos are of size $4 8 0 X 6 4 0$ and have a FOV $1 2 0 ^ { \circ }$ and each frame is associated with a $3 \times 1$ odometry pose reading. In the noisy setting discussed in Sec. 5, sensor and actuation noise is injected into training trajectories. We create 19K, 43K video trajectories, containing 1, 2.5 million frames respectively, on the Gibson and MP3D datasets. We then use this data to train the NRNS modules, as described in Sec. 4.
120
+
121
+ Test Environments. We evaluate our approach on the task of image-goal navigation. For testing, we use the Habitat Simulator [7]. We evaluate on the standard test-split for both the Gibson [41] and Matterport3D (MP3D) [42] datasets. For MP3D, we evaluate on 18 environments and for Gibson, we evaluate on 14 environments.
122
+
123
+ Baselines. We consider a number of baselines to contextualize our Image-Goal Navigation results:
124
+
125
+ – BC w/ ResNet $^ +$ GRU. Behavioral Cloning (BC) policy where $I _ { t }$ and $I _ { G }$ are encoded using a pretrained ResNet-18. Both image encodings and the previous action $a _ { t - 1 }$ are passed through a two layer Gated Recurrent Unit (GRU) with softmax, which outputs the next action $a _ { t }$ .
126
+
127
+ – BC w/ ResNet $^ +$ Metric Map. BC policy: $I _ { t }$ and $I _ { G }$ are encoded with a ResNet, same as the above policy. This policy keeps a metric map built from the depth images. The metric map is encoded with a linear layer. The metric map encoding and encodings of $I _ { t }$ and $I _ { G }$ are concatenated and passed into an MLP with softmax, which outputs the next navigational action $a _ { t }$ .
128
+
129
+ ![](images/bedcca76cc6ac4d2534ee4baa91b23a82b92ed6d5807424d040aba8b42203425.jpg)
130
+ Figure 6: Example of an Image-Goal Navigation episode on MP3D. Shows the agent’s observations and internal topological graph at different time steps.
131
+
132
+ – End to End RL with DDPPO. An agent is trained end to end with proximal policy optimization [13] in the Habitat Simulator [7] for the image-goal navigation task.
133
+
134
+ We use and adapt code for baseline algorithms from Chaplot et al. [4]. However, as our setup uses narrow-view cameras instead of panoramas, these adapted baselines perform worse compared to their previously reported performance. This difference in setup also makes direct comparison with [4] infeasible, as they critically rely on panoramic views for localization. The baseline behavioral cloning policies are also trained only using the passive dataset described in Sec. 4. This makes the BC baseline policies directly comparable to the NRNS model.
135
+
136
+ The end-to-end RL policy is trained using a Habitat implementation of DDPPO [13]. For training we use 8 GPUs and 16 processes per GPU. We first train with 1k episodes per house, which is identical to how NRNS is trained, and we train for 10M steps. To test the scalability of the RL method, we additionally train a model using $5 \mathrm { k }$ training episodes per environment (providing the RL agent ${ 5 } \mathbf { x }$ more data than our NRNS agent) and report the performance of the agent trained on these episodes at 50M steps $5 \mathbf { x }$ more compute than NRNS) and 100M steps (10x more compute than NRNS). Training the $\mathcal { G } _ { D }$ model takes ${ \sim } 2 0 $ epochs, requiring ${ \sim } 8$ hours on a single GPU. Training the $\mathcal { G } _ { T }$ model takes ${ \sim } 1 0$ epochs, requiring ${ \sim } 4$ hours on a single GPU.
137
+
138
+ Episode Settings. To provide an in-depth understanding of the successes and limitations of our approach, we sub-divide test episodes into two categories: ‘straight’ and ‘curved’. In ‘straight’ episodes, the ratio of shortest path geodesic-distance to euclidean-distance between the start and goal locations is $< 1 . 2$ and rotational difference between the orientation of the start position and goal image is $< 4 5 ^ { \circ }$ . All other start-goal location pairs are labeled as ‘curved’ episodes. We make this distinction due to the nature of the narrow field of view of our agent, which strongly affects performance on curved episodes, since the agent must learn to turn both as part of navigating and part of seeking new information about the target location. Also, while a greedy policy being successful on ’straight’ episodes might be expected, a competitive performance on even ’curved’ episodes will highlight how effective our simple model and policy is. We further subdivide each of these 2 categories into 3 sub-categories of difficulty: ‘easy’, ‘medium’ and ‘hard’. Difficulty is determined by the length of the shortest path between the start and goal locations. Following [4], the ‘easy’, ‘medium’ and ‘hard’ settings are $( 1 . 5 - 3 m )$ , $( 3 - 5 m )$ , and $( 5 - 1 0 m )$ respectively. To generate test episodes we uniformly sample the test scene for start-goal location pairs, to create approximately 1000 episodes per setting.
139
+
140
+ # 5.1 Results
141
+
142
+ Tables 1, 2 show the performance of our NRNS model and relevant baselines on the test splits of the Gibson and Matterport datasets. In 6, we visualize an episode of the NRNS agent as it navigates to the goal-image.
143
+
144
+ NRNS outperforms baselines. Our NRNS algorithm outperforms the BC and end to end RL policies in terms of Success and SPL $@$ 1m on both datasets. NRNS improves upon the best offline baseline, a Behavioral Cloning (BC) policy with a ResNet and GRU, across splits of Gibson by an absolute $20 \%$ on Straight episodes and $10 + \%$ on Curved episodes. We find that a BC policy using a GRU for memory outperforms using only a metric map. We attribute this to a spatial memory (metric map) being less informative for agent exploration than a memory of the visual features and previous steps (GRU). We observe that an end-to-end RL policy trained for 10M steps with $1 0 \mathrm { k }$ epsiodes per house, in simulation performs much weaker than all baselines. With increased data and steps RL baselines unsurprisingly increase in performance, however we find with 5X more data and 10x more compute RL baselines still are outperformed by NRNS. The low performance of behavioral cloning and RL methods for image-goal navigation is unsurprising [4, 15]. This demonstrates the difficulty of learning rewards on low level actions instead of value learning on possible exploration directions, exacerbating the difficulty of exploration in image-goal navigation. Adding to the challenges of the task, all policies must learn the stop action. Previous works [4] have found that adding oracle stopping, to a target-driven RL agent, leads to large gains in performance on image-goal navigation. The limitations of all approaches are seen on the ‘hard’ and ‘curved’ episode settings, showing the overall difficulty of the exploration problem and the challenge of using a narrow field of view.
145
+
146
+ NRNS is robust to noise. Even with the injection of sensor and actuation noise [10], in both the passive training data and test episodes, NRNS maintains superior or near comparable performance to all baselines. In fact, we find that the addition of noise leads to only an absolute drop in success between . $8- 8 \%$ on Gibson [41] and $1 - 5 \%$ on MP3D [42]. An interesting observation is small increase in performance (w/noise) for the hard-case. We believe this is because gt-distance for hard cases are more error prone and noise during training provides regularization.
147
+
148
+ Table 1: Comparison of our model (NRNS) with baselines on Image-Goal Navigation on Gibson[41]. We report average Success and Success weighted by inverse Path Length (SPL) $@$ 1m. Noise refers to injection of sensor & actuation noise into the train videos and test episodes. \* denotes using simulator.
149
+
150
+ <table><tr><td rowspan="2">Path Type</td><td rowspan="2">Model</td><td colspan="2">Easy</td><td colspan="2">Medium</td><td colspan="2">Hard</td></tr><tr><td></td><td>Succ ↑ SPL ↑</td><td>Succ ↑</td><td>SPL个</td><td>Succ ↑</td><td>SPL个</td></tr><tr><td rowspan="7">Straight</td><td>RL (10M steps)*[13]</td><td>10.50</td><td>6.70</td><td>18.10</td><td>16.17</td><td>11.79</td><td>10.85</td></tr><tr><td>RL (extra data + 50M steps)*[13]</td><td>36.30</td><td>34.93</td><td>35.70</td><td>33.98</td><td>5.94</td><td>6.33</td></tr><tr><td>RL (extra data + 100M steps)* [13]</td><td>43.20</td><td>38.54</td><td>36.40</td><td>34.89</td><td>7.44</td><td>7.20</td></tr><tr><td>BC w/ResNet + Metric Map</td><td>24.80</td><td>23.94</td><td>11.50</td><td>11.28</td><td>1.36</td><td>1.26</td></tr><tr><td>BC w/ResNet +GRU</td><td>34.90</td><td>33.43</td><td>17.60</td><td>17.05</td><td>6.08</td><td>5.93</td></tr><tr><td>NRNS w/ noise</td><td>64.10</td><td>55.43</td><td>47.90</td><td>39.54</td><td>25.19</td><td>18.09</td></tr><tr><td>NRNS w/out noise</td><td>68.00</td><td>61.62</td><td>49.10</td><td>44.56</td><td>23.82</td><td>18.28</td></tr><tr><td rowspan="7">Curved</td><td>RL (10M steps)*[13]</td><td></td><td>7.90 3.27</td><td>9.50</td><td>7.11</td><td>5.50</td><td>4.72</td></tr><tr><td>RL (extra data + 50M steps)*[13]</td><td>18.10</td><td>15.42</td><td>16.30</td><td>14.46</td><td>2.60</td><td>2.23</td></tr><tr><td>RL (extra data + 100M steps)* [13]</td><td>22.20</td><td>16.51</td><td>20.70</td><td>18.52</td><td>4.20</td><td>3.71</td></tr><tr><td>BC w/ ResNet + Metric Map</td><td>3.10</td><td>2.53</td><td>0.80</td><td>0.71</td><td>0.20</td><td>0.16</td></tr><tr><td>BC w/ResNet +GRU</td><td>3.60</td><td>2.86</td><td>1.10</td><td>0.91</td><td>0.50</td><td>0.36</td></tr><tr><td>NRNS w/ noise</td><td>27.30</td><td>10.55</td><td>23.10</td><td>10.35</td><td>10.50</td><td>5.61</td></tr><tr><td>NRNS w/out noise</td><td>35.50</td><td>18.38</td><td>23.90</td><td>12.08</td><td>12.50</td><td>6.84</td></tr></table>
151
+
152
+ Table 2: Comparison of our model (NRNS) with baselines on Image-Goal Navigation on MP3D[42].
153
+
154
+ <table><tr><td colspan="2">Path Type Model</td><td colspan="2">Easy Succ ↑ SPL ↑</td><td colspan="2">Medium</td><td colspan="2">Hard</td></tr><tr><td colspan="2"></td><td>7.50</td><td></td><td>4.00</td><td>Succ 个 SPL个</td><td>Succ ↑</td><td>SPL个</td></tr><tr><td rowspan="6">Straight</td><td>RL (10M steps)*[13] RL (extra data + 50M steps)*[13]</td><td>34.50</td><td></td><td></td><td>3.50 1.73 33.80</td><td>1.00 10.40</td><td>0.55 10.07</td></tr><tr><td>RL (extra data + 100M steps)*[13]</td><td>36.40</td><td>30.08 30.84</td><td>35.70 33.80</td><td>31.42</td><td>12.00</td><td></td></tr><tr><td></td><td>25.80</td><td></td><td>11.30</td><td></td><td></td><td>11.56</td></tr><tr><td>BC w/ ResNet + Metric Map</td><td></td><td>24.82</td><td></td><td>10.65</td><td>3.00</td><td>2.93</td></tr><tr><td>BC w/ResNet+GRU</td><td>30.20</td><td>29.57</td><td>12.70</td><td>12.48</td><td>4.40</td><td>4.34</td></tr><tr><td>NRNS w/ noise NRNS w/out noise</td><td>63.80 64.70</td><td>53.12 58.23</td><td>36.20 39.70</td><td>26.92 32.74</td><td>24.10 22.30</td><td>16.93 17.33</td></tr><tr><td rowspan="6">Curved</td><td>RL (10M steps)*[13]</td><td></td><td>4.90</td><td>1.78</td><td>3.20</td><td></td><td></td></tr><tr><td>RL (extra data + 50M steps)*[13]</td><td>15.70</td><td>11.34</td><td>10.70</td><td>1.37 9.03</td><td>1.10 3.90</td><td>0.46</td></tr><tr><td></td><td>17.90</td><td>13.24</td><td>15.00</td><td>12.17</td><td>5.90</td><td>3.57</td></tr><tr><td>RL (extra data + 100M steps)*[13] BC w/ ResNet + Metric Map</td><td>4.90</td><td>4.23</td><td>1.40</td><td>1.29</td><td>0.40</td><td>4.87 0.34</td></tr><tr><td>BC w/ResNet +GRU</td><td>3.10</td><td>2.61</td><td>0.80</td><td>0.77</td><td>0.10</td><td>0.02</td></tr><tr><td>NRNS w/ noise</td><td>21.40</td><td>8.19</td><td>15.40</td><td>6.83</td><td></td><td>10.0</td></tr><tr><td>NRNS w/out noise</td><td></td><td>23.70</td><td>12.68</td><td>16.20</td><td>8.34</td><td>9.10</td><td>4.86 5.14</td></tr></table>
155
+
156
+ NRNS Module Ablations. Tab. 3 reports detailed ablations of NRNS on the Gibson dataset (see appendix for ablation results on MP3D). We ablate the NRNS approach by testing each module individually. In the ablation experiments, we replace the module output with the ground truth labels or numbers in order to evaluate the affect of each module on the performance of the overall approach. For simplicity, all ablations are trained and tested without sensor or actuation noise. Unsurprisingly, we find that the Global Policy, $\mathcal { G } _ { D }$ , has a large affect on performance (Row 4 and 8). We find that the largest affects are seen in the ‘hard’ and ‘curved’ test episodes. This is unsurprising because as the distance to the goal increases, the path increases in complexity and the search space of $\mathcal { G } _ { D }$ increases.
157
+
158
+ Table 3: Ablations of NRNS with baselines on Image-Goal Navigation on Gibson [41]. We report average Success and Success weighted by inverse Path Length (SPL) $@$ 1m. $\pmb { \chi }$ denotes a module being replaced by the ground truth labels and a $\checkmark$ denotes the NRNS module being used.
159
+
160
+ <table><tr><td rowspan="2">Path Type</td><td colspan="3">NRNS Ablation</td><td colspan="2">Easy</td><td colspan="2">Medium</td><td colspan="2">Hard</td></tr><tr><td>9EA</td><td>9T</td><td>9D</td><td>Succ ↑</td><td>SPL个</td><td>Succ 个</td><td>SPL个</td><td>Succ个</td><td>SPL个</td></tr><tr><td rowspan="4">Straight</td><td>×</td><td></td><td></td><td>100.00</td><td>99.75</td><td>100.00</td><td>99.62</td><td>100.00</td><td>99.57</td></tr><tr><td></td><td></td><td>X</td><td>99.90</td><td>99.05</td><td>98.20</td><td>95.06</td><td>95.91</td><td>90.53</td></tr><tr><td>√</td><td></td><td>X</td><td>79.40</td><td>73.48</td><td>71.30</td><td>67.48</td><td>62.16</td><td>58.06</td></tr><tr><td>&lt;</td><td>xx&lt;&gt;</td><td>√</td><td>68.00</td><td>61.62</td><td>49.10</td><td>44.56</td><td>23.45</td><td>18.84</td></tr><tr><td rowspan="4">Curved</td><td>×</td><td>X</td><td>×</td><td>100.00</td><td>97.62</td><td>100.00</td><td>97.47</td><td>100.00</td><td>98.18</td></tr><tr><td>√</td><td>X</td><td>X</td><td>99.70</td><td>95.93</td><td>97.50</td><td>90.14</td><td>89.30</td><td>79.95</td></tr><tr><td></td><td></td><td></td><td>65.00</td><td>56.70</td><td>58.10</td><td>52.51</td><td>47.70</td><td>42.28</td></tr><tr><td>V</td><td>·</td><td>X</td><td>35.50</td><td>18.38</td><td>23.90</td><td>12.08</td><td>12.50</td><td>6.84</td></tr></table>
161
+
162
+ # 5.2 Training on Passive Videos in the Wild
163
+
164
+ Finally, we demonstrate that our model can be learned from passive videos in the wild. Towards this end, we train our NRNS model using the RealEstate10K dataset [40] which contains YouTube videos of real estate tours. This dataset has 80K clips with poses estimated via SLAM. Note that the average trajectory length is smaller than test time trajectories in Gibson or MP3D, and we therefore only evaluate on ‘easy’ and ‘medium’ settings. Tab. 4 shows the performance. Note there is a drop in performance compared to training using Gibson videos, which we attribute to domain shift. Even after this drop, our approach, trained on real-world passive videos, outperforms BC baselines and performs competitively against RL baselines. RL baselines have an advantage as they are both trained in the simulator and trained on the Gibson dataset. We believe that the delta between RL and the performance of NRNS trained on RealEstate would close if both were tested on real-world data. We find these results to be a strong indication of the effectiveness of training on passive data.
165
+
166
+ Table 4: Comparison of our model (NRNS) trained with different sets of passive video data and tested on Image-Goal Navigation on Gibson [41]. We report average Success and Success weighted by inverse Path Length (SPL) $@$ 1m. Results shown are tested without sensor & actuation noise.
167
+
168
+ <table><tr><td></td><td></td><td></td><td colspan="2">Easy</td><td colspan="2">Medium</td></tr><tr><td>Path Type</td><td>Training Data</td><td>Model</td><td>Succ 个</td><td>SPL个</td><td>Succ 个</td><td>SPL↑</td></tr><tr><td rowspan="4">Straight</td><td>RealEstate10k [40]</td><td>NRNS</td><td>56.42</td><td>48.01</td><td>30.30</td><td>25.67</td></tr><tr><td>MP3D</td><td>NRNS</td><td>59.80</td><td>52.35</td><td>37.00</td><td>31.89</td></tr><tr><td>Gibson</td><td>NRNS</td><td>68.00</td><td>61.62</td><td>49.10</td><td>44.56</td></tr><tr><td>Gibson</td><td>BC w/ResNet + GRU</td><td>30.20</td><td>29.57</td><td>12.70</td><td>12.48</td></tr><tr><td rowspan="4">Curved</td><td>RealEstate10k [40]</td><td>NRNS</td><td>21.10</td><td>15.76</td><td>12.90</td><td>5.57</td></tr><tr><td>MP3D</td><td>NRNS</td><td>28.26</td><td>13.59</td><td>11.00</td><td>5.10</td></tr><tr><td>Gibson</td><td>NRNS</td><td>35.50</td><td>18.38</td><td>23.90</td><td>12.08</td></tr><tr><td>Gibson</td><td>BC w/ResNet +GRU</td><td>3.10</td><td>2.61</td><td>0.80</td><td>0.77</td></tr></table>
169
+
170
+ # 6 Conclusion
171
+
172
+ We have presented a simple yet effective approach for learning navigation policies from passive videos. While simulators have become fast, the diversity and scalability of environments still remains a challenge. Our presented approach, NRNS, neither requires access to ground-truth maps nor online policy interaction and hence forgoes the need for a simulator to learn policy functions. We demonstrate that NRNS can outperform RL and behavioral cloning policies by significant margins. We show that NRNS can be trained on passive videos in the wild and still outperform all baselines.
173
+
174
+ # Acknowledgement
175
+
176
+ The authors would like to thank Saurabh Gupta for the discussions. We would also like to thank the Gibson and RealEstate10K dataset authors for sharing their datasets for scientific research.
177
+
178
+ # Licenses for referenced datasets.
179
+
180
+ Gibson: http://svl.stanford.edu/gibson2/assets/GDS_agreement.pdf Matterport3D: http://kaldir.vc.in.tum.de/matterport/MP_TOS.pdf
181
+
182
+ # References
183
+
184
+ [1] Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018.
185
+ [2] Tao Chen, Saurabh Gupta, and Abhinav Gupta. Learning exploration policies for navigation. International Conference on Learning Representations, 2019.
186
+ [3] Santhosh K Ramakrishnan, Ziad Al-Halah, and Kristen Grauman. Occupancy anticipation for efficient exploration and navigation. In European Conference on Computer Vision, 2020.
187
+ [4] Devendra Singh Chaplot, Ruslan Salakhutdinov, Abhinav Gupta, and Saurabh Gupta. Neural topological slam for visual navigation. In Computer Vision and Pattern Recognition, 2020.
188
+ [5] Dhruv Batra, Aaron Gokaslan, Aniruddha Kembhavi, Oleksandr Maksymets, Roozbeh Mottaghi, Manolis Savva, Alexander Toshev, and Erik Wijmans. ObjectNav Revisited: On Evaluation of Embodied Agents Navigating to Objects. In arXiv:2006.13171, 2020.
189
+ [6] Devendra Singh Chaplot, Dhiraj Prakashchand Gandhi, Abhinav Gupta, and Russ R Salakhutdinov. Object goal navigation using goal-oriented semantic exploration. Neural Information Processing Systems, 2020.
190
+ [7] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In International Conference on Computer Vision, 2019.
191
+ [8] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sünderhauf, Ian Reid, Stephen Gould, and Anton van den Hengel. Vision-and-Language Navigation: Interpreting visually-grounded navigation instructions in real environments. In Computer Vision and Pattern Recognition, 2018.
192
+ [9] Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. AI2-THOR: An Interactive 3D Environment for Visual AI. Computer Vision and Pattern Recognition, 2017.
193
+ [10] Devendra Singh Chaplot, Dhiraj Gandhi, Saurabh Gupta, Abhinav Gupta, and Ruslan Salakhutdinov. Learning to explore using active neural slam. In International Conference on Learning Representations, 2020.
194
+ [11] Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In International Conference on Robotics and Automation, 2017.
195
+ [12] Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In Computer Vision and Pattern Recognition, 2017.
196
+ [13] Erik Wijmans, Abhishek Kadian, Ari Morcos, Stefan Lee, Irfan Essa, Devi Parikh, Manolis Savva, and Dhruv Batra. Dd-ppo: Learning near-perfect pointgoal navigators from 2.5 billion frames. In International Conference on Learning Representations, 2020.
197
+ [14] Yi Wu, Yuxin Wu, Aviv Tamar, Stuart Russell, Georgia Gkioxari, and Yuandong Tian. Bayesian relational memory for semantic visual navigation. In International Conference on Computer Vision, 2019.
198
+ [15] Lina Mezghani, Sainbayar Sukhbaatar, Thibaut Lavril, Oleksandr Maksymets, Dhruv Batra, Piotr Bojanowski, and Karteek Alahari. Memory-augmented reinforcement learning for imagegoal navigation. arXiv preprint arXiv:2101.05181, 2021.
199
+ [16] Wei Yang, Xiaolong Wang, Ali Farhadi, Abhinav Gupta, and Roozbeh Mottaghi. Visual semantic navigation using scene priors. International Conference on Learning Representations, 2018.
200
+ [17] Benjamin Eysenbach, Ruslan Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. In Neural Information Processing Systems, 2019.
201
+ [18] Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In International Conference on Learning Representations, 2018.
202
+ [19] Piotr Mirowski, Matthew Koichi Grimes, Mateusz Malinowski, Karl Moritz Hermann, Keith Anderson, Denis Teplyashin, Karen Simonyan, Koray Kavukcuoglu, Andrew Zisserman, and Raia Hadsell. Learning to navigate in cities without a map. In Neural Information Processing Systems, 2018.
203
+ [20] Scott Emmons, Ajay Jain, Michael Laskin, Thanard Kurutach, Pieter Abbeel, and Deepak Pathak. Sparse graphical memory for robust planning. In Neural Information Processing Systems, 2020.
204
+ [21] Kevin Chen, Juan Pablo de Vicente, Gabriel Sepulveda, Fei Xia, Alvaro Soto, Marynel Vázquez, and Silvio Savarese. A behavioral approach to visual navigation with graph localization networks. In Robotics: Science and Systems, 2019.
205
+ [22] Dhruv Shah, Benjamin Eysenbach, Gregory Kahn, Nicholas Rhinehart, and Sergey Levine. Ving: Learning open-world navigation with visual goals. International Conference on Robotics and Automation, 2020.
206
+ [23] Samarth Brahmbhatt and James Hays. Deepnav: Learning to navigate large cities. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2017.
207
+ [24] Matthew Chang, Arjun Gupta, and Saurabh Gupta. Semantic visual navigation by watching youtube videos. In Neural Information Processing Systems, 2020.
208
+ [25] Harish Ravichandar, Athanasios S Polydoros, Sonia Chernova, and Aude Billard. Recent advances in robot learning from demonstration. Annual Review of Control, Robotics, and Autonomous Systems, 2020.
209
+ [26] David Silver, J Andrew Bagnell, and Anthony Stentz. Active learning from demonstration for robust autonomous navigation. In International Conference on Robotics and Automation, 2012.
210
+ [27] Xinlei Pan, Tingnan Zhang, Brian Ichter, Aleksandra Faust, Jie Tan, and Sehoon Ha. Zero-shot imitation learning from demonstrations for legged robot visual navigation. In International Conference on Robotics and Automation, 2020.
211
+ [28] Noah Y Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020.
212
+ [29] Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
213
+ [30] Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
214
+ [31] Edward Beeching, Jilles Dibangoye, Olivier Simonin, and Christian Wolf. Learning to plan with uncertain topological maps. In European Conference on Computer Vision, 2020.
215
+ [32] Russell A Epstein, Eva Zita Patai, Joshua B Julian, and Hugo J Spiers. The cognitive map in humans: spatial navigation and beyond. Nature Neuroscience, 2017.
216
+ [33] Edward C Tolman. Cognitive maps in rats and men. Psychological Review, 1948.
217
+ [34] Patrick Foo, William H Warren, Andrew Duchon, and Michael J Tarr. Do humans integrate routes into a cognitive map? map-versus landmark-based navigation of novel shortcuts. Journal of Experimental Psychology: Learning, Memory, and Cognition, 2005.
218
+ [35] Ranxiao Frances Wang and Elizabeth S Spelke. Human spatial representation: Insights from animals. Trends in Cognitive Sciences, 2002.
219
+ [36] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. International Conference on Learning Representations, 2017.
220
+ [37] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, 2016.
221
+ [38] Brendan J Frey and Delbert Dueck. Clustering by passing messages between data points. Science, 2007.
222
+ [39] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. Transactions on Pattern Analysis and Machine Intelligence, 2017.
223
+ [40] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. In SIGGRAPH, 2018.
224
+ [41] Fei Xia, Amir R Zamir, Zhiyang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson env: Real-world perception for embodied agents. In Computer Vision and Pattern Recognition, 2018.
225
+ [42] Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niessner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from rgb-d data in indoor environment. International Conference on 3D Vision, 2017.
parse/train/8vXYx6d8Wc/8vXYx6d8Wc_content_list.json ADDED
@@ -0,0 +1,1043 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "No RL, No Simulation: Learning to Navigate without Navigating ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 178,
8
+ 122,
9
+ 820,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Meera Hahn ∗ Georgia Institute of Technology ",
17
+ "bbox": [
18
+ 205,
19
+ 227,
20
+ 413,
21
+ 255
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Devendra Chaplot Facebook AI Research ",
28
+ "bbox": [
29
+ 454,
30
+ 226,
31
+ 604,
32
+ 253
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Shubham Tulsiani Facebook AI Research ",
39
+ "bbox": [
40
+ 643,
41
+ 226,
42
+ 792,
43
+ 253
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Mustafa Mukadam Facebook AI Research ",
50
+ "bbox": [
51
+ 207,
52
+ 275,
53
+ 352,
54
+ 303
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "James M. Rehg Georgia Institute of Technology ",
61
+ "bbox": [
62
+ 395,
63
+ 275,
64
+ 602,
65
+ 303
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Abhinav Gupta Facebook AI Research ",
72
+ "bbox": [
73
+ 642,
74
+ 275,
75
+ 792,
76
+ 303
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Abstract ",
83
+ "text_level": 1,
84
+ "bbox": [
85
+ 462,
86
+ 339,
87
+ 535,
88
+ 356
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "Most prior methods for learning navigation policies require access to simulation environments, as they need online policy interaction and rely on ground-truth maps for rewards. However, building simulators is expensive (requires manual effort for each and every scene) and creates challenges in transferring learned policies to robotic platforms in the real-world, due to the sim-to-real domain gap. In this paper, we pose a simple question: Do we really need active interaction, ground-truth maps or even reinforcement-learning (RL) in order to solve the image-goal navigation task? We propose a self-supervised approach to learn to navigate from only passive videos of roaming. Our approach, No RL, No Simulator (NRNS), is simple and scalable, yet highly effective. NRNS outperforms RL-based formulations by a significant margin. We present NRNS as a strong baseline for any future imagebased navigation tasks that use RL or Simulation. ",
95
+ "bbox": [
96
+ 233,
97
+ 371,
98
+ 766,
99
+ 536
100
+ ],
101
+ "page_idx": 0
102
+ },
103
+ {
104
+ "type": "text",
105
+ "text": "1 Introduction ",
106
+ "text_level": 1,
107
+ "bbox": [
108
+ 174,
109
+ 549,
110
+ 312,
111
+ 566
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "In recent years, we have seen significant advances in learning-based approaches for indoor navigation [1, 2]. Impressive performance gains have been obtained for a range of tasks, from non-semantic point-goal navigation [3] to semantic tasks such as image-goal [4] and object-goal navigation [5, 6], via methods that use reinforcement learning (RL). The effectiveness of RL for these tasks can be attributed in part to the emergence of powerful new simulators such as Habitat [7], Matterport [8] and AI2Thor [9]. These simulators have helped scale learning to billions of frames by providing large-scale active interaction data and ground-truth maps for designing reward functions. But do we actually need simulation and RL to learn to navigate? Is there an alternative way to formulate the navigation problem, such that no ground-truth maps or active interaction are required? These are valuable questions to explore because learning navigation in simulation constrains the approach to a limited set of environments, since the creation of 3D assets remains costly and time-consuming. ",
118
+ "bbox": [
119
+ 174,
120
+ 580,
121
+ 825,
122
+ 733
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "In this paper, we propose a self-supervised approach to learning how to navigate from passive egocentric videos. Our novel method is simple and scalable (no simulator required for training), and at the same time highly effective, as it outperforms RL-based formulations by a significant margin. To introduce our approach, let us first examine the role of RL and simulation in standard navigation learning methods. In the standard RL formulation, an agent gets a reward upon reaching the goal, followed by a credit assignment stage to determine the most useful state-action pairs. But do we actually need the reinforce function for action credit assignment? Going a step further, do we even need to learn a policy explicitly? In navigation, we argue that the state space itself is highly structured via a distance function, and the structure itself could be leveraged for credit assignment. Simply put, states that help reduce the distance to the goal are better – and therefore predicted distance can be used either as the value function or as a proxy for it. In fact, RL formulations frequently use ‘distance reduced to goal’ in reward shaping. The key property of our approach is that we learn a generalizable distance estimator directly from passive videos, and as a result we do not require any interaction. We demonstrate that an effective distance estimator can be learned directly from visual trajectories, without the need for an RL policy to map visual observations to the action space, thereby obviating the need for extensive interaction in a simulator and hand-designed rewards. However passive videos do not provide learning opportunities for obstacle avoidance since they rarely, if ever, consist of cameras bumping into walls. We forgo the need for active interaction to reason about collisions as we show that obstacle avoidance is only required locally and simple depth maps are sufficient to prune invalid actions and locations for navigation. More broadly, our approach can be considered as closely related to model-based control, which is an alternative paradigm to RL-based policy learning, with the key insight that components of the model and cost functions can be learned from passive data. ",
129
+ "bbox": [
130
+ 174,
131
+ 739,
132
+ 826,
133
+ 877
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "image",
139
+ "img_path": "images/796b1ea458b7ea272fbb10df9b45177eec218c6ee5296bc1dc4ebc1d5f50ec40.jpg",
140
+ "image_caption": [
141
+ "Figure 1: Left: Using passive videos we learn to predict distances for navigation. Our distance function learns the priors of the layouts of indoor buildings to estimate distances to goal location. Right: Image-Goal Navigation Task [10]. Our model uses distance function to predict distances of unexplored nodes and uses greedy policy to choose the shortest-distance node. "
142
+ ],
143
+ "image_footnote": [],
144
+ "bbox": [
145
+ 179,
146
+ 90,
147
+ 808,
148
+ 209
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "",
155
+ "bbox": [
156
+ 174,
157
+ 284,
158
+ 825,
159
+ 449
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "No RL, No Simulator Approach (NRNS): Our NRNS algorithm can be described as follows. During training we learn two functions from passive videos: (a) a geodesic distance estimator: given the state features and goal image, this function predicts the geodesic distance of the unexplored frontiers of the graph to the goal location. This enables a greedy policy in which we select the node with the least distance; (b) a target prediction model: Given the goal image and the image from the agent’s current location, this function predicts if the goal is within sight and can be reached without collisions, along with the exact location of the goal. The key is that both the distance model and the target prediction model can be learned from passive RGBD videos, with SLAM used to estimate relative poses. We believe our simple NRNS approach should act as a strong baseline for any future approaches that use RL and simulation. We show that NRNS outperforms end-to-end RL, even when RL is trained using ${ 5 } \\mathbf { x }$ more data and $1 0 \\mathrm { x }$ more compute. Furthermore, unlike RL methods which need to be trained in simulation because they require substantial numbers of interactions, NRNS can be trained directly on real-world videos alone, and therefore does not suffer from the sim-to-real gap. ",
166
+ "bbox": [
167
+ 174,
168
+ 455,
169
+ 825,
170
+ 636
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "2 Related Work ",
177
+ "text_level": 1,
178
+ "bbox": [
179
+ 174,
180
+ 645,
181
+ 321,
182
+ 661
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "Navigation in simulators. Navigation tasks largely fall into two main categories [1], ones in which a goal location is known [11, 12, 13] and limited exploration is required, and ones in which the goal location is not known and efficient exploration is necessary. In the second category, tasks range from finding the location of specific objects [5], rooms [14], or images [15], to the task of exploration itself [2]. The majority of current work [12, 15, 16, 3] leverages simulators [7] and extensive interaction to learn end-to-end models for these tasks. In contrast, our work shows that the semantic cues needed for exploration-based navigation tasks can be learned directly from video trajectories. ",
189
+ "bbox": [
190
+ 173,
191
+ 670,
192
+ 825,
193
+ 780
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "Navigation using passive data. Several prior works have tackled the navigation task when there is some passive experience available in the test environment [17, 18, 19, 20, 21, 22]. A more limited number of works train navigation policies without simulation environments [19, 22, 23]. Unlike these works, we tackle the task of image goal navigation in unseen environments where there is no experience available to the agent in the test environments during training [19, 22] and no map knowledge is given about the environments [23]. Two works adopting similar requirements are Chaplot et al. [4] and Chang et al. [24]. Most closely related is Neural Topological SLAM (NTS) [4], which builds a topological map and estimates distance to the target image using a learned function. But NTS requires access to panoramic observations and ground-truth maps for training the distance function, making it much less scalable than our approach which can be trained with just video data with arbitrary field of view. Chang et al. [24] adopt a similar approach to NTS for object goal navigation, while also incorporating video data from YouTube for learning a Q function. A key difference is that our method learns a episodic distance function, utilizing all past observations to estimate distances to the target image. In comparison, Chaplot et al. [4] and Chang et al. [24] use a memory-less distance function operating only on the agent’s current observation. ",
200
+ "bbox": [
201
+ 174,
202
+ 786,
203
+ 825,
204
+ 911
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "",
211
+ "bbox": [
212
+ 174,
213
+ 90,
214
+ 825,
215
+ 174
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "Prior work work on LfD [25, 26, 27] requires: (a) access to actions (e.g. teleoperated in simulator); and (b) optimal human demonstrations. The goal in LfD is to learn policies that match given demonstrations by either mimicking the actions or formulating rewards using the demonstrations. In contrast, NRNS does neither, since our passive training data does always contain optimal navigation trajectories and NRNS does not compute any rewards as it does not require RL or credit assignment. We make the same distinction between our work and offline RL [28, 29, 30], which does not utilize online data gathering but still learns a policy using rewards from observed trajectories. In contrast, we do not use any rewards or learn a policy. Instead, our approach aims to learn a distance-to-goal model and uses a greedy policy based on the distance predictions. From this perspective, NRNS is performing model-based learning. ",
222
+ "bbox": [
223
+ 174,
224
+ 181,
225
+ 825,
226
+ 319
227
+ ],
228
+ "page_idx": 2
229
+ },
230
+ {
231
+ "type": "text",
232
+ "text": "Map-Based Navigation. There are multiple spatial representations which can be leveraged in solving navigation tasks. Metric maps, which maintain precise information on the occupied space in an environment, are commonly used for visual navigation [2, 10, 6]. However, metric maps suffer from issues of scalability and consistency under sensor noise. As a result, topological maps have recently gained traction [4, 21, 18, 24, 31] as a means to combat these issues. A significant difference from our approach is that in these prior works a topological map is given at the beginning of the navigation task, and is not created or changed during navigation. Specifically, Savinov et al. [18] create the map from a given 5 minute video of the test environment and Chen et al. [21] assume access to a ground truth map. In our image-goal navigation set up, the agent is given no information about the test environment. Chaplot et al. [4] do not require experience in the test environment and build topological maps at test time, but still requires access to a simulator for computing shortest-path distances between pairs of images. Additionally, topological maps for robotic navigation draw inspiration from both animal and human psychology. The cognitive map hypothesis proposes that the brain builds coarse internal spatial representations of environments [32, 33]. Multiple works argue that this internal representation relies on landmarks [34, 35], making human cognitive maps more similar to topological maps as opposed to metric maps. ",
233
+ "bbox": [
234
+ 173,
235
+ 325,
236
+ 825,
237
+ 546
238
+ ],
239
+ "page_idx": 2
240
+ },
241
+ {
242
+ "type": "text",
243
+ "text": "Graph Neural Networks. Graph Neural Networks (GNN) are specifically used for modeling relational data in a non-Euclidean space. We employ a GNN for estimating distance-to-goal over the agent’s exploration frontier. Specifically we employ an augmented Graph Attention Network [36] which allows for a weighted aggregation of neighboring node information. Graph Networks are rarely-used for the task of topological map-based visual navigation. Savinov et al. [18] use a GNN for the sub-task of localizing the agent in a ground truth topological map. We believe we are the first to leverage graph neural networks in a visual navigation task. ",
244
+ "bbox": [
245
+ 173,
246
+ 553,
247
+ 825,
248
+ 650
249
+ ],
250
+ "page_idx": 2
251
+ },
252
+ {
253
+ "type": "text",
254
+ "text": "3 Image Goal Navigation using Topological Graphs ",
255
+ "text_level": 1,
256
+ "bbox": [
257
+ 173,
258
+ 662,
259
+ 617,
260
+ 680
261
+ ],
262
+ "page_idx": 2
263
+ },
264
+ {
265
+ "type": "text",
266
+ "text": "We propose No RL, No Simulator “NRNS”, a hierarchical modular approach to image-goal navigation that consists of: a) high-level modules for maintaining a topological map and using visual and semantic reasoning to predict sub-goals, and b) heuristic low-level modules that use depth data to select low level navigation actions to reach sub-goals and determine geometrically-explorable areas. We first describe NRNS in detail and then show in Sec. 4 that the high-level modules can be trained without using any simulation, interaction or even ground-truth scans – i.e. that passive video data alone is sufficient to learn the semantic and visual reasoning models needed for navigation. ",
267
+ "bbox": [
268
+ 174,
269
+ 685,
270
+ 825,
271
+ 784
272
+ ],
273
+ "page_idx": 2
274
+ },
275
+ {
276
+ "type": "text",
277
+ "text": "3.1 Formulation and Representation ",
278
+ "text_level": 1,
279
+ "bbox": [
280
+ 176,
281
+ 801,
282
+ 439,
283
+ 816
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "Task Definition. We tackle the task of image-goal navigation, where an agent is placed in a novel environment, and is tasked with navigating to an (unknown) goal position that is specified using an image taken from that position, as shown in Fig. 2. More formally, an episode begins with an agent receiving an RGB observation $( I _ { G } )$ corresponding to the goal position. At each time step, $t$ , of the episode the agent receives a set of observations $s _ { t }$ , and must take a navigation action $a _ { t }$ . The agents state observations, $s _ { t }$ , are defined as a narrow field of view RGBD image, $I _ { t }$ , and egocentric pose estimate, $P _ { t }$ . The agent must execute navigational actions to reach goal within a maximum number of steps. ",
290
+ "bbox": [
291
+ 174,
292
+ 827,
293
+ 823,
294
+ 911
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "",
301
+ "bbox": [
302
+ 173,
303
+ 92,
304
+ 823,
305
+ 119
306
+ ],
307
+ "page_idx": 3
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "Topological Map Representation. The NRNS agent maintains a topological map in the form of a graph $G ( N , E )$ , defined by nodes $N$ and edges $E$ , which provides a sparse representation of the environment. Concretely, a node $n _ { i } \\in N$ is associated with a pose $p _ { i }$ , defined by location and orientation. Each node $n _ { i }$ can either be ‘explored’ i.e. the agent has previously visited the pose and obtained a corresponding RGBD image $I _ { i }$ , or ‘unexplored’ e.g. unvisited positions at the exploration frontier which may be visited in the future. Each edge $e \\in E$ connects a pair of adjacent nodes $n _ { i }$ and $n _ { j }$ . Nodes are deemed adjacent only if a short and ‘simple’ path exists between the two nodes, as further detailed in Sec. 3.3. Each edge between adjacent nodes is then associated with the attribute $\\Delta P -$ the relative pose between the two nodes. ",
312
+ "bbox": [
313
+ 174,
314
+ 126,
315
+ 550,
316
+ 333
317
+ ],
318
+ "page_idx": 3
319
+ },
320
+ {
321
+ "type": "image",
322
+ "img_path": "images/f642cf795c210b3946ebffc53e58afde6bf9f7cf25fb58f2ef1c81b82fb24630.jpg",
323
+ "image_caption": [
324
+ "Figure 2: Image-Goal navigation task using a topological graph. "
325
+ ],
326
+ "image_footnote": [],
327
+ "bbox": [
328
+ 568,
329
+ 136,
330
+ 821,
331
+ 295
332
+ ],
333
+ "page_idx": 3
334
+ },
335
+ {
336
+ "type": "text",
337
+ "text": "3.2 Global Policy via Distance Prediction ",
338
+ "text_level": 1,
339
+ "bbox": [
340
+ 176,
341
+ 345,
342
+ 472,
343
+ 361
344
+ ],
345
+ "page_idx": 3
346
+ },
347
+ {
348
+ "type": "text",
349
+ "text": "Given a representation of the environment as a topological \ngraph, our global policy is tasked with identifying the next ‘unexplored’ node that the agent should visit, and the low-level policy $( \\mathcal { G } _ { L P } )$ is then responsible for executing the precise actions. Intuitively, we want our agent to select as the next node the one that minimizes the total distance to goal. The global policy’s inference task can thus be reduced to predicting distances from nodes in our graph to the goal location. To this end, our approach leverages a distance prediction network $( \\mathcal { G } _ { D } )$ which operates on top of $G ( N , E )$ to predict distance-to-goal for each unexplored node $n _ { u e } \\in G$ . Our global policy then simply selects the node with least total distance to goal which is defined as: distance to the unexplored node from the agent’s current position, plus the predicted distance from the unexplored node to the goal. ",
350
+ "bbox": [
351
+ 173,
352
+ 366,
353
+ 825,
354
+ 505
355
+ ],
356
+ "page_idx": 3
357
+ },
358
+ {
359
+ "type": "text",
360
+ "text": "The input to the distance prediction network $\\mathcal { G } _ { D }$ is the current topological graph $G ( N , E ) _ { t }$ and $I _ { G }$ While the explored nodes have an image associated with them, the unexplored nodes naturally do not. To allow prediction in this setup, we use a Graph Convolutional Network (GCN) architecture to first induce visual features for $n _ { u e } \\in G$ , and then predict the distance to goal using an MLP. ",
361
+ "bbox": [
362
+ 174,
363
+ 510,
364
+ 825,
365
+ 566
366
+ ],
367
+ "page_idx": 3
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "As illustrated in Fig. 3, the network first encodes the RGB images at each explored node $( n _ { i } )$ using a ResNet18 [37] to obtain feature vector $\\mathbf { h } _ { \\mathbf { i } } \\in \\mathbb { R } ^ { 5 1 2 }$ . Each edge $e _ { i , j }$ is further represented by a feature vector $\\mathbf { u _ { i , j } }$ , which is the flattened pose transformation matrix $( ^ { \\mathbf { i } } \\mathbf { K _ { j } } \\in \\mathbb { R } ^ { 4 \\times 4 } )$ . The adjacency matrix $\\mathbf { A } _ { \\mathbf { t } }$ , $\\mathbf { u _ { i , j } }$ , and $\\mathbf { h _ { i } }$ are passed through a GCN comprising of two graph attention (GAT) layers [36] with intermediate nonlinearities. Note that we extend the graph attention layer architecture to additionally use edge features $\\mathbf { u _ { i , j } }$ when computing attention coefficients. The predicted visual features for unexplored nodes are then finally used to compute predicted distance-to-goal $d _ { i }$ from each node to $I _ { G }$ using a simple MLP. ",
372
+ "bbox": [
373
+ 174,
374
+ 571,
375
+ 825,
376
+ 685
377
+ ],
378
+ "page_idx": 3
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "To select the most ‘promising’ $n _ { u e }$ to explore, the distance from the agent’s current location $n _ { t }$ also needs to be accounted for. For $n _ { u e } , n _ { t } \\in G$ , the ‘travel cost’ is added to $d _ { i }$ , calculated using shortest path on $\\mathbf { G }$ from $n _ { u e } n _ { t }$ . Our global policy then selects the unexplored node with the minimum total distance score as the next sub-goal. ",
383
+ "bbox": [
384
+ 174,
385
+ 691,
386
+ 825,
387
+ 747
388
+ ],
389
+ "page_idx": 3
390
+ },
391
+ {
392
+ "type": "text",
393
+ "text": "3.3 Local Navigation and Graph Expansion ",
394
+ "text_level": 1,
395
+ "bbox": [
396
+ 174,
397
+ 760,
398
+ 490,
399
+ 775
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "The NRNS global policy selects the sub-goal that the agent should pursue, and the precise low-level actions to reach the sub-goal are executed by a heuristic local policy. After the local policy finishes execution, the NRNS agent updates the graph to include the new observations and expands the graph with unexplored nodes at the exploration frontier. ",
406
+ "bbox": [
407
+ 174,
408
+ 780,
409
+ 825,
410
+ 835
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "text",
416
+ "text": "Local Policy. The NRNS local policy, denoted as $\\mathcal { G } _ { L P }$ , receives a target position, defined by distance and angle $( \\rho _ { i } , \\phi _ { i } )$ with respect to the agent’s current location. When $\\mathcal { G } _ { D }$ outputs a sub-goal node, $\\rho _ { i }$ , $\\phi _ { i }$ are calculated from the current position and passed to $\\mathcal { G } _ { L P }$ . Low level navigation actions are selected and executed using a simplistic point navigation model based on the agent’s egocentric RGBD observations and (noisy) pose estimation. To navigate towards its sub-goal, the agent builds and maintains a local metric map using the noisy pose estimator and depth input. This effectively allows it to reach local goals and avoid obstacles. The local metric maps are discarded upon reaching the sub-goal, as they are based on a noisy pose estimator. This policy is adapted from [10] and is also used for Image-Goal Navigation in [4]. ",
417
+ "bbox": [
418
+ 174,
419
+ 842,
420
+ 825,
421
+ 911
422
+ ],
423
+ "page_idx": 3
424
+ },
425
+ {
426
+ "type": "image",
427
+ "img_path": "images/d0bf29d643320e974d722bd4c12082b11eef0a15f153b7f46db4133364ce96e4.jpg",
428
+ "image_caption": [
429
+ "Figure 3: The Global Policy and $\\mathcal { G } _ { D }$ architecture used to model distance-to-goal prediction. $\\mathcal { G } _ { D }$ employs a Resnet18 encoder, Graph Attention layers, and a multi-layer perceptron with a sigmoid. "
430
+ ],
431
+ "image_footnote": [],
432
+ "bbox": [
433
+ 176,
434
+ 92,
435
+ 825,
436
+ 205
437
+ ],
438
+ "page_idx": 4
439
+ },
440
+ {
441
+ "type": "text",
442
+ "text": "",
443
+ "bbox": [
444
+ 174,
445
+ 265,
446
+ 825,
447
+ 320
448
+ ],
449
+ "page_idx": 4
450
+ },
451
+ {
452
+ "type": "text",
453
+ "text": "Explorable Area Prediction for Graph Expansion. We incorporate a ‘graph expansion’ step after the agent reaches a sub-goal via $\\mathcal { G } _ { L P }$ and before the agent selects a new sub-goal. First, the agent updates $G ( N , E )$ to record the current location as an explored node and store the associated RGBD observation. Second, the agent creates additional ‘unexplored’ nodes, $n _ { u e }$ , adjacent to the current node, $n _ { t }$ based on whether the corresponding directions are deemed ‘explorable’. We use a explorable area prediction module, $\\mathcal { G } _ { E A }$ , to determine which adjacent areas to the current location are geometrically explorable. This is untrained, heuristic module takes the egocentric depth image $I _ { t _ { d e p t h } }$ and tests 9 angles in the direction from the current position and returns the angles that are not blocked by obstacles within a depth of 3 meters. The NRNS agent tests $\\theta$ at $[ 0 , \\pm 1 5 , \\pm 3 0 , \\pm 4 5 , \\pm 6 0 ]$ , these angles are chosen based on the agent’s turn radius of $1 5 ^ { \\circ } { }$ and $1 2 0 ^ { \\circ }$ FOV. For all $\\theta$ determined to be explorable, the agent updates $G ( N , E )$ by adding an ‘unexplored’ node at position $\\rho = 1 m$ and $\\phi = \\theta$ relative to the node the agent is at, with a corresponding edge linking the current node to the new node. If a node already exists in one of the explorable areas at a nearby position, only an edge is added to $G ( N , E )$ and not a new node. ",
454
+ "bbox": [
455
+ 173,
456
+ 327,
457
+ 826,
458
+ 520
459
+ ],
460
+ "page_idx": 4
461
+ },
462
+ {
463
+ "type": "text",
464
+ "text": "3.4 Putting it Together ",
465
+ "text_level": 1,
466
+ "bbox": [
467
+ 174,
468
+ 537,
469
+ 344,
470
+ 553
471
+ ],
472
+ "page_idx": 4
473
+ },
474
+ {
475
+ "type": "text",
476
+ "text": "Stopping Criterion. The above described modules $( \\mathcal { G } _ { D } , \\mathcal { G } _ { L P } , \\mathcal { G } _ { E A } )$ allow the NRNS agent to incrementally explore its environment while making progress towards the location of the target image. To allow the agent to terminate navigating when it is near the goal, we additionally learn a target prediction network $\\mathcal { G } _ { T }$ that provides a stopping criterion. Given $I _ { G }$ and current image $I _ { t }$ , $\\mathcal { G } _ { T }$ is simple MLP that predicts: a) a probability $\\beta _ { s } \\in [ 0 , 1 ]$ indicating whether the goal is within sight, and if so, b) the relative position (distance, direction) of the goal $\\rho _ { g } , \\phi _ { g }$ . ",
477
+ "bbox": [
478
+ 173,
479
+ 560,
480
+ 825,
481
+ 643
482
+ ],
483
+ "page_idx": 4
484
+ },
485
+ {
486
+ "type": "text",
487
+ "text": "Algorithm. We outline our navigation algorithm in Fig. 4. An example result on the image-goal navigation task is shown in Fig. 6. Among the modules used, the local policy module $\\mathcal { G } _ { L P }$ and the explorable area module $\\mathcal { G } _ { E A }$ do not require any learning. As we show in Sec. 4, $\\mathcal { G } _ { D }$ and $\\mathcal { G } _ { T }$ can both be learned using only passive data. ",
488
+ "bbox": [
489
+ 173,
490
+ 650,
491
+ 825,
492
+ 705
493
+ ],
494
+ "page_idx": 4
495
+ },
496
+ {
497
+ "type": "text",
498
+ "text": "Algorithm 1: NRNS Image Navigation ",
499
+ "text_level": 1,
500
+ "bbox": [
501
+ 176,
502
+ 718,
503
+ 433,
504
+ 733
505
+ ],
506
+ "page_idx": 4
507
+ },
508
+ {
509
+ "type": "text",
510
+ "text": "// initialize graph \n$n _ { 0 } = ( P _ { t = 0 } , I _ { t = 0 } ) ; e _ { 0 } = ( n _ { 0 } , n _ { 0 } ) ;$ ; \n$N = ( n _ { 0 } ) ; E = ( e _ { 0 } )$ ; \n$G = ( N , E )$ ; \n// loop until reached goal or max steps \nwhile steps taken $<$ max steps do $n _ { i + 1 } , . . . , n _ { i + k } = \\mathcal G _ { E A } ( I _ { t } )$ ; // determine valid explorable areas $N _ { } ^ { } + = n _ { i + 1 } , . . . , n _ { i + k } ; E ^ { } + = e _ { t , i + 1 } , . . . , e _ { t , i + k } ;$ ; // add unexplored nodes & edges $\\scriptstyle n _ { s g }$ $, ( \\rho _ { s g } , \\phi _ { s g } ) = \\mathrm { a r g m i n } ( \\mathcal { G } _ { D } ( G , I _ { G } ) + \\mathrm { T r a v e l C o s t } ( G , n _ { t } ) )$ ; // select sub-goal $I _ { t + 1 } , P _ { t + 1 } = \\mathcal { G } _ { L P } ( \\rho _ { s g } , \\phi _ { s g } )$ ; // navigate to sub-goal $n _ { s g } = ( P _ { t + 1 } , I _ { t + 1 } ) ,$ // update graph with observations $\\beta _ { s } , ( \\rho _ { g } , \\phi _ { g } ) = \\mathcal { G } _ { T } ( I _ { t + 1 } , I _ { G } )$ ; $/ /$ stopping criterion if $\\beta _ { s } > . 5$ then $\\mathcal { G } _ { L P } ( \\rho _ { g } , \\phi _ { g } )$ ; // navigate to target break; end \nend ",
511
+ "bbox": [
512
+ 171,
513
+ 736,
514
+ 655,
515
+ 912
516
+ ],
517
+ "page_idx": 4
518
+ },
519
+ {
520
+ "type": "image",
521
+ "img_path": "images/6fa3fd4849135895a0c238963e66efe3fca95354390d1859a0ea55d63208718e.jpg",
522
+ "image_caption": [
523
+ "Figure 4: The hierarchical modular NRNS approach to the Image-Goal Navigation task, for a single time step in the episode. The global policy $\\mathcal { G } _ { D }$ selects an unexplored node $n _ { i }$ as a sub-goal. The sub-goal position $( \\rho _ { i } , \\phi _ { i } )$ is passed to the local navigation policy $\\mathcal { G } _ { L P }$ which takes in the current RGBD observations and outputs low level actions until the agent reaches $n _ { i }$ . The graph is then updated with the current observations $I _ { t + 1 }$ and new unexplored nodes and edges generated by $\\mathcal { G } _ { E A }$ "
524
+ ],
525
+ "image_footnote": [],
526
+ "bbox": [
527
+ 174,
528
+ 92,
529
+ 825,
530
+ 215
531
+ ],
532
+ "page_idx": 5
533
+ },
534
+ {
535
+ "type": "text",
536
+ "text": "4 Learning from Passive Data ",
537
+ "text_level": 1,
538
+ "bbox": [
539
+ 176,
540
+ 325,
541
+ 437,
542
+ 342
543
+ ],
544
+ "page_idx": 5
545
+ },
546
+ {
547
+ "type": "text",
548
+ "text": "The learned high-level policies of NRNS are the Distance Network $\\mathcal { G } _ { D }$ and Target Prediction Network $\\mathcal { G } _ { T }$ . A key contribution of our work is showing that these functions can be learned from passive data alone. This eliminates the need for online interaction and ground-truth maps, allowing us to train the NRNS algorithm without using RL or simulation. ",
549
+ "bbox": [
550
+ 174,
551
+ 358,
552
+ 823,
553
+ 415
554
+ ],
555
+ "page_idx": 5
556
+ },
557
+ {
558
+ "type": "text",
559
+ "text": "Learning Distance Prediction. First, we describe how to learn the function $\\mathcal { G } _ { D }$ . Given a topological graph (consisting of both explored and unexplored nodes) and a goal image as input, $\\mathcal { G } _ { D }$ predicts the geodesic distance from all unexplored nodes to the location of the goal image. Our training data therefore consists of triplets of the form $( G , I _ { G } , D _ { U } )$ , where $G$ is a topological graph, $I _ { G }$ is a goal image, and $D _ { U }$ is the ground-truth distances from a set of unexplored nodes to the goal location (we use L2-Loss to train the distance function). ",
560
+ "bbox": [
561
+ 174,
562
+ 420,
563
+ 825,
564
+ 503
565
+ ],
566
+ "page_idx": 5
567
+ },
568
+ {
569
+ "type": "text",
570
+ "text": "We generate training graphs using passive videos in a two-step process. In the first step, we create a topological graph, $G _ { \\mathcal { V } _ { i } }$ , for every video $\\nu _ { i }$ in the passive dataset. Each graph contains both explored and unexplored nodes. We approximate distance to unexplored nodes using the geodesic distance along the trajectory. In the second step, we uniformly sample sub-graphs and goal locations over each video’s topological graph. ",
571
+ "bbox": [
572
+ 174,
573
+ 511,
574
+ 825,
575
+ 580
576
+ ],
577
+ "page_idx": 5
578
+ },
579
+ {
580
+ "type": "text",
581
+ "text": "Step 1: Video to Topological Graph. First, we generate a step-wise trajectory graph in which each frame is a node with odometry information. We then process this step-wise graph into a topological graph using affinity clustering [38]. We use the visual features from each frame concatenated with odometry information as the feature vector for clustering. Visual features for each frame are extracted via a Places365 [39] pretrained Resnet18. Each cluster represents a single node in the topological graph $G _ { \\mathcal { V } _ { i } }$ and the stepwise visual features of frames in the cluster are average pooled. The topological graphs are then expanded to have unexplored nodes, used in training the distance function. These are created by applying $\\mathcal { G } _ { E A }$ to the RGBD of each node centroid in $G _ { \\mathcal { V } _ { i } }$ . Fig. 5 illustrates the process by which an example video is converted into a topological graph for training data. ",
582
+ "bbox": [
583
+ 174,
584
+ 585,
585
+ 825,
586
+ 712
587
+ ],
588
+ "page_idx": 5
589
+ },
590
+ {
591
+ "type": "text",
592
+ "text": "Step 2: Sampling training datapoints. Individual data instances are selected via uniform sampling without replacement. This means selecting a random node in $G _ { \\nu }$ as the goal location and a random sub-graph of $G _ { \\nu }$ as the observed trajectory and current location. Distance along the trajectory is used as the ground truth distance between nodes in the sub-graph and the goal image: these distance labels are used to train the network $\\mathcal { G } _ { D }$ . Due to non-optimal long term paths of the video trajectories, distances may overestimate distance to the goal. In other words while each node along the generated trajectory graphs are legitimate paths to the goal, shorter paths may exist that are not covered in the training trajectory graph, making this a challenging problem. In total, $\\mathcal { G } _ { D }$ is trained using ${ \\sim } 1 \\mathrm { k }$ training instances per scan for both Gibson and MP3D. ",
593
+ "bbox": [
594
+ 173,
595
+ 717,
596
+ 825,
597
+ 842
598
+ ],
599
+ "page_idx": 5
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "Learning Target Direction Prediction The $\\mathcal { G } _ { T }$ prediction network receives a goal image and the current node image as input, and predicts whether the goal is within sight of the current image. To gather training instances for $\\mathcal { G } _ { T }$ , we use the RGB frame at a randomly selected node as the goal image. We make a simplifying assumption that any adjacent pair of nodes (similar features and odometry) in the topological graph are positive examples and any other pair of nodes are negative examples. ",
604
+ "bbox": [
605
+ 174,
606
+ 848,
607
+ 825,
608
+ 917
609
+ ],
610
+ "page_idx": 5
611
+ },
612
+ {
613
+ "type": "image",
614
+ "img_path": "images/12ebee142a4a82272301c3ac9fae5fa18cbdb178a447b94012107257550fa805.jpg",
615
+ "image_caption": [
616
+ "Figure 5: Example from the passive video dataset. Frames of a video trajectory $\\nu _ { i }$ are shown on the left. The stepwise trajectory is then turned into a trajectory graph $G _ { \\mathcal { V } _ { i } }$ via affinity clustering [38] of node image and pose features. $G _ { \\mathcal { V } _ { i } }$ is adapted to train the Global Policy $\\mathcal { G } _ { D }$ and target direction prediction $\\mathcal { G } _ { E } A$ . An example of an adapted $G _ { \\mathcal { V } _ { i } }$ for training is shown on the left. "
617
+ ],
618
+ "image_footnote": [],
619
+ "bbox": [
620
+ 176,
621
+ 93,
622
+ 820,
623
+ 186
624
+ ],
625
+ "page_idx": 6
626
+ },
627
+ {
628
+ "type": "text",
629
+ "text": "5 Experiments ",
630
+ "text_level": 1,
631
+ "bbox": [
632
+ 173,
633
+ 260,
634
+ 312,
635
+ 276
636
+ ],
637
+ "page_idx": 6
638
+ },
639
+ {
640
+ "type": "text",
641
+ "text": "Image-Goal Navigation Task Setup. At the beginning of each episode, the agent is placed in an unseen environment. The agent receives observations from the current state, a $3 \\times 1$ odometry pose reading and RGBD image, and the RGB goal image. Observation and goal images are $1 2 0 ^ { \\circ } \\mathrm { F O V }$ and of size $4 8 0 \\times 6 4 0$ . An episode is considered a success if the agent is able to reach within $1 m$ of the goal location and do so within a maximum episode length of 500 steps. Each episode is also evaluated by the efficiency of the navigational path from start to goal, which is quantitatively measured by Success weighted by inverse Path Length (SPL) [1]. Note, the narrow field of the agent in this task definition differs from past works which use panoramic views [4]. The decision to use a narrow field is based on our method of training only on passive data. Current passive video datasets of indoor trajectories such as YouTube Tours [24], RealEstate10k [40] and our NRNS passive video dataset, do not contain panoramas. ",
642
+ "bbox": [
643
+ 174,
644
+ 284,
645
+ 825,
646
+ 435
647
+ ],
648
+ "page_idx": 6
649
+ },
650
+ {
651
+ "type": "text",
652
+ "text": "Action Space. The agent’s action space contains four actions: forward by . $. 2 5 \\mathrm { m }$ , rotate left by $1 5 ^ { \\circ } { }$ , rotate right by $1 5 ^ { \\circ } { }$ , and stop. In our experiments, we consider two cases for pose estimation and action transition. In the first condition the agent has access to ground truth pose and the navigation actions are deterministic. In the second condition, noise is added to the pose estimation and the actuation of the agent. We utilize the realistic pose and actuation noise models from [10], which are similarly used in [4]. The actuation noise adds stochastic rotational and translations transitions to the agent’s navigational actions. ",
653
+ "bbox": [
654
+ 173,
655
+ 443,
656
+ 825,
657
+ 540
658
+ ],
659
+ "page_idx": 6
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "Training Data. Our key contribution is the ability to learn navigation agents from passive data. In theory, our approach can be trained from any passive data source, and we test this in Sec. 5.2 using RealEstate10K [40]. However, since RL-based baselines are trained in the Habitat Simulator [7], we generate our NRNS dataset, of egocentric trajectory videos, using the same Habitat training scenes to provide direct comparison and isolate domain gap issues. Specifically, the trajectory videos are created as follows. A set of 2 - 4 points are randomly selected from the environment using uniform sampling. A video is then generated of the concatenated RGBD frames of the shortest path between consecutive points. Note that the complete video trajectory (from first source to final target) is not step-wise optimal. Frames in the videos are of size $4 8 0 X 6 4 0$ and have a FOV $1 2 0 ^ { \\circ }$ and each frame is associated with a $3 \\times 1$ odometry pose reading. In the noisy setting discussed in Sec. 5, sensor and actuation noise is injected into training trajectories. We create 19K, 43K video trajectories, containing 1, 2.5 million frames respectively, on the Gibson and MP3D datasets. We then use this data to train the NRNS modules, as described in Sec. 4. ",
664
+ "bbox": [
665
+ 174,
666
+ 545,
667
+ 825,
668
+ 724
669
+ ],
670
+ "page_idx": 6
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "Test Environments. We evaluate our approach on the task of image-goal navigation. For testing, we use the Habitat Simulator [7]. We evaluate on the standard test-split for both the Gibson [41] and Matterport3D (MP3D) [42] datasets. For MP3D, we evaluate on 18 environments and for Gibson, we evaluate on 14 environments. ",
675
+ "bbox": [
676
+ 174,
677
+ 731,
678
+ 825,
679
+ 786
680
+ ],
681
+ "page_idx": 6
682
+ },
683
+ {
684
+ "type": "text",
685
+ "text": "Baselines. We consider a number of baselines to contextualize our Image-Goal Navigation results: ",
686
+ "bbox": [
687
+ 176,
688
+ 792,
689
+ 818,
690
+ 808
691
+ ],
692
+ "page_idx": 6
693
+ },
694
+ {
695
+ "type": "text",
696
+ "text": "– BC w/ ResNet $^ +$ GRU. Behavioral Cloning (BC) policy where $I _ { t }$ and $I _ { G }$ are encoded using a pretrained ResNet-18. Both image encodings and the previous action $a _ { t - 1 }$ are passed through a two layer Gated Recurrent Unit (GRU) with softmax, which outputs the next action $a _ { t }$ . ",
697
+ "bbox": [
698
+ 179,
699
+ 814,
700
+ 820,
701
+ 856
702
+ ],
703
+ "page_idx": 6
704
+ },
705
+ {
706
+ "type": "text",
707
+ "text": "– BC w/ ResNet $^ +$ Metric Map. BC policy: $I _ { t }$ and $I _ { G }$ are encoded with a ResNet, same as the above policy. This policy keeps a metric map built from the depth images. The metric map is encoded with a linear layer. The metric map encoding and encodings of $I _ { t }$ and $I _ { G }$ are concatenated and passed into an MLP with softmax, which outputs the next navigational action $a _ { t }$ . ",
708
+ "bbox": [
709
+ 179,
710
+ 856,
711
+ 823,
712
+ 911
713
+ ],
714
+ "page_idx": 6
715
+ },
716
+ {
717
+ "type": "image",
718
+ "img_path": "images/bedcca76cc6ac4d2534ee4baa91b23a82b92ed6d5807424d040aba8b42203425.jpg",
719
+ "image_caption": [
720
+ "Figure 6: Example of an Image-Goal Navigation episode on MP3D. Shows the agent’s observations and internal topological graph at different time steps. "
721
+ ],
722
+ "image_footnote": [],
723
+ "bbox": [
724
+ 176,
725
+ 89,
726
+ 820,
727
+ 256
728
+ ],
729
+ "page_idx": 7
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "– End to End RL with DDPPO. An agent is trained end to end with proximal policy optimization [13] in the Habitat Simulator [7] for the image-goal navigation task. ",
734
+ "bbox": [
735
+ 178,
736
+ 310,
737
+ 823,
738
+ 339
739
+ ],
740
+ "page_idx": 7
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "We use and adapt code for baseline algorithms from Chaplot et al. [4]. However, as our setup uses narrow-view cameras instead of panoramas, these adapted baselines perform worse compared to their previously reported performance. This difference in setup also makes direct comparison with [4] infeasible, as they critically rely on panoramic views for localization. The baseline behavioral cloning policies are also trained only using the passive dataset described in Sec. 4. This makes the BC baseline policies directly comparable to the NRNS model. ",
745
+ "bbox": [
746
+ 174,
747
+ 345,
748
+ 825,
749
+ 428
750
+ ],
751
+ "page_idx": 7
752
+ },
753
+ {
754
+ "type": "text",
755
+ "text": "The end-to-end RL policy is trained using a Habitat implementation of DDPPO [13]. For training we use 8 GPUs and 16 processes per GPU. We first train with 1k episodes per house, which is identical to how NRNS is trained, and we train for 10M steps. To test the scalability of the RL method, we additionally train a model using $5 \\mathrm { k }$ training episodes per environment (providing the RL agent ${ 5 } \\mathbf { x }$ more data than our NRNS agent) and report the performance of the agent trained on these episodes at 50M steps $5 \\mathbf { x }$ more compute than NRNS) and 100M steps (10x more compute than NRNS). Training the $\\mathcal { G } _ { D }$ model takes ${ \\sim } 2 0 $ epochs, requiring ${ \\sim } 8$ hours on a single GPU. Training the $\\mathcal { G } _ { T }$ model takes ${ \\sim } 1 0$ epochs, requiring ${ \\sim } 4$ hours on a single GPU. ",
756
+ "bbox": [
757
+ 174,
758
+ 435,
759
+ 825,
760
+ 546
761
+ ],
762
+ "page_idx": 7
763
+ },
764
+ {
765
+ "type": "text",
766
+ "text": "Episode Settings. To provide an in-depth understanding of the successes and limitations of our approach, we sub-divide test episodes into two categories: ‘straight’ and ‘curved’. In ‘straight’ episodes, the ratio of shortest path geodesic-distance to euclidean-distance between the start and goal locations is $< 1 . 2$ and rotational difference between the orientation of the start position and goal image is $< 4 5 ^ { \\circ }$ . All other start-goal location pairs are labeled as ‘curved’ episodes. We make this distinction due to the nature of the narrow field of view of our agent, which strongly affects performance on curved episodes, since the agent must learn to turn both as part of navigating and part of seeking new information about the target location. Also, while a greedy policy being successful on ’straight’ episodes might be expected, a competitive performance on even ’curved’ episodes will highlight how effective our simple model and policy is. We further subdivide each of these 2 categories into 3 sub-categories of difficulty: ‘easy’, ‘medium’ and ‘hard’. Difficulty is determined by the length of the shortest path between the start and goal locations. Following [4], the ‘easy’, ‘medium’ and ‘hard’ settings are $( 1 . 5 - 3 m )$ , $( 3 - 5 m )$ , and $( 5 - 1 0 m )$ respectively. To generate test episodes we uniformly sample the test scene for start-goal location pairs, to create approximately 1000 episodes per setting. ",
767
+ "bbox": [
768
+ 174,
769
+ 553,
770
+ 825,
771
+ 760
772
+ ],
773
+ "page_idx": 7
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "5.1 Results ",
778
+ "text_level": 1,
779
+ "bbox": [
780
+ 173,
781
+ 766,
782
+ 264,
783
+ 780
784
+ ],
785
+ "page_idx": 7
786
+ },
787
+ {
788
+ "type": "text",
789
+ "text": "Tables 1, 2 show the performance of our NRNS model and relevant baselines on the test splits of the Gibson and Matterport datasets. In 6, we visualize an episode of the NRNS agent as it navigates to the goal-image. ",
790
+ "bbox": [
791
+ 174,
792
+ 784,
793
+ 825,
794
+ 825
795
+ ],
796
+ "page_idx": 7
797
+ },
798
+ {
799
+ "type": "text",
800
+ "text": "NRNS outperforms baselines. Our NRNS algorithm outperforms the BC and end to end RL policies in terms of Success and SPL $@$ 1m on both datasets. NRNS improves upon the best offline baseline, a Behavioral Cloning (BC) policy with a ResNet and GRU, across splits of Gibson by an absolute $20 \\%$ on Straight episodes and $10 + \\%$ on Curved episodes. We find that a BC policy using a GRU for memory outperforms using only a metric map. We attribute this to a spatial memory (metric map) being less informative for agent exploration than a memory of the visual features and previous steps (GRU). We observe that an end-to-end RL policy trained for 10M steps with $1 0 \\mathrm { k }$ epsiodes per house, in simulation performs much weaker than all baselines. With increased data and steps RL baselines unsurprisingly increase in performance, however we find with 5X more data and 10x more compute RL baselines still are outperformed by NRNS. The low performance of behavioral cloning and RL methods for image-goal navigation is unsurprising [4, 15]. This demonstrates the difficulty of learning rewards on low level actions instead of value learning on possible exploration directions, exacerbating the difficulty of exploration in image-goal navigation. Adding to the challenges of the task, all policies must learn the stop action. Previous works [4] have found that adding oracle stopping, to a target-driven RL agent, leads to large gains in performance on image-goal navigation. The limitations of all approaches are seen on the ‘hard’ and ‘curved’ episode settings, showing the overall difficulty of the exploration problem and the challenge of using a narrow field of view. ",
801
+ "bbox": [
802
+ 174,
803
+ 828,
804
+ 825,
805
+ 911
806
+ ],
807
+ "page_idx": 7
808
+ },
809
+ {
810
+ "type": "text",
811
+ "text": "",
812
+ "bbox": [
813
+ 174,
814
+ 90,
815
+ 825,
816
+ 243
817
+ ],
818
+ "page_idx": 8
819
+ },
820
+ {
821
+ "type": "text",
822
+ "text": "NRNS is robust to noise. Even with the injection of sensor and actuation noise [10], in both the passive training data and test episodes, NRNS maintains superior or near comparable performance to all baselines. In fact, we find that the addition of noise leads to only an absolute drop in success between . $8- 8 \\%$ on Gibson [41] and $1 - 5 \\%$ on MP3D [42]. An interesting observation is small increase in performance (w/noise) for the hard-case. We believe this is because gt-distance for hard cases are more error prone and noise during training provides regularization. ",
823
+ "bbox": [
824
+ 173,
825
+ 250,
826
+ 825,
827
+ 333
828
+ ],
829
+ "page_idx": 8
830
+ },
831
+ {
832
+ "type": "table",
833
+ "img_path": "images/9c0759d25e5b1332cf0ecaadb43682adbd3d3da6d59f70b6dd9902e1a25edff5.jpg",
834
+ "table_caption": [
835
+ "Table 1: Comparison of our model (NRNS) with baselines on Image-Goal Navigation on Gibson[41]. We report average Success and Success weighted by inverse Path Length (SPL) $@$ 1m. Noise refers to injection of sensor & actuation noise into the train videos and test episodes. \\* denotes using simulator. "
836
+ ],
837
+ "table_footnote": [],
838
+ "table_body": "<table><tr><td rowspan=\"2\">Path Type</td><td rowspan=\"2\">Model</td><td colspan=\"2\">Easy</td><td colspan=\"2\">Medium</td><td colspan=\"2\">Hard</td></tr><tr><td></td><td>Succ ↑ SPL ↑</td><td>Succ ↑</td><td>SPL个</td><td>Succ ↑</td><td>SPL个</td></tr><tr><td rowspan=\"7\">Straight</td><td>RL (10M steps)*[13]</td><td>10.50</td><td>6.70</td><td>18.10</td><td>16.17</td><td>11.79</td><td>10.85</td></tr><tr><td>RL (extra data + 50M steps)*[13]</td><td>36.30</td><td>34.93</td><td>35.70</td><td>33.98</td><td>5.94</td><td>6.33</td></tr><tr><td>RL (extra data + 100M steps)* [13]</td><td>43.20</td><td>38.54</td><td>36.40</td><td>34.89</td><td>7.44</td><td>7.20</td></tr><tr><td>BC w/ResNet + Metric Map</td><td>24.80</td><td>23.94</td><td>11.50</td><td>11.28</td><td>1.36</td><td>1.26</td></tr><tr><td>BC w/ResNet +GRU</td><td>34.90</td><td>33.43</td><td>17.60</td><td>17.05</td><td>6.08</td><td>5.93</td></tr><tr><td>NRNS w/ noise</td><td>64.10</td><td>55.43</td><td>47.90</td><td>39.54</td><td>25.19</td><td>18.09</td></tr><tr><td>NRNS w/out noise</td><td>68.00</td><td>61.62</td><td>49.10</td><td>44.56</td><td>23.82</td><td>18.28</td></tr><tr><td rowspan=\"7\">Curved</td><td>RL (10M steps)*[13]</td><td></td><td>7.90 3.27</td><td>9.50</td><td>7.11</td><td>5.50</td><td>4.72</td></tr><tr><td>RL (extra data + 50M steps)*[13]</td><td>18.10</td><td>15.42</td><td>16.30</td><td>14.46</td><td>2.60</td><td>2.23</td></tr><tr><td>RL (extra data + 100M steps)* [13]</td><td>22.20</td><td>16.51</td><td>20.70</td><td>18.52</td><td>4.20</td><td>3.71</td></tr><tr><td>BC w/ ResNet + Metric Map</td><td>3.10</td><td>2.53</td><td>0.80</td><td>0.71</td><td>0.20</td><td>0.16</td></tr><tr><td>BC w/ResNet +GRU</td><td>3.60</td><td>2.86</td><td>1.10</td><td>0.91</td><td>0.50</td><td>0.36</td></tr><tr><td>NRNS w/ noise</td><td>27.30</td><td>10.55</td><td>23.10</td><td>10.35</td><td>10.50</td><td>5.61</td></tr><tr><td>NRNS w/out noise</td><td>35.50</td><td>18.38</td><td>23.90</td><td>12.08</td><td>12.50</td><td>6.84</td></tr></table>",
839
+ "bbox": [
840
+ 189,
841
+ 401,
842
+ 808,
843
+ 632
844
+ ],
845
+ "page_idx": 8
846
+ },
847
+ {
848
+ "type": "table",
849
+ "img_path": "images/a5f9724426a7d949f7719a1e2720ecd6b0c90af13f1d3d1cd873719d7100a9ea.jpg",
850
+ "table_caption": [
851
+ "Table 2: Comparison of our model (NRNS) with baselines on Image-Goal Navigation on MP3D[42]. "
852
+ ],
853
+ "table_footnote": [],
854
+ "table_body": "<table><tr><td colspan=\"2\">Path Type Model</td><td colspan=\"2\">Easy Succ ↑ SPL ↑</td><td colspan=\"2\">Medium</td><td colspan=\"2\">Hard</td></tr><tr><td colspan=\"2\"></td><td>7.50</td><td></td><td>4.00</td><td>Succ 个 SPL个</td><td>Succ ↑</td><td>SPL个</td></tr><tr><td rowspan=\"6\">Straight</td><td>RL (10M steps)*[13] RL (extra data + 50M steps)*[13]</td><td>34.50</td><td></td><td></td><td>3.50 1.73 33.80</td><td>1.00 10.40</td><td>0.55 10.07</td></tr><tr><td>RL (extra data + 100M steps)*[13]</td><td>36.40</td><td>30.08 30.84</td><td>35.70 33.80</td><td>31.42</td><td>12.00</td><td></td></tr><tr><td></td><td>25.80</td><td></td><td>11.30</td><td></td><td></td><td>11.56</td></tr><tr><td>BC w/ ResNet + Metric Map</td><td></td><td>24.82</td><td></td><td>10.65</td><td>3.00</td><td>2.93</td></tr><tr><td>BC w/ResNet+GRU</td><td>30.20</td><td>29.57</td><td>12.70</td><td>12.48</td><td>4.40</td><td>4.34</td></tr><tr><td>NRNS w/ noise NRNS w/out noise</td><td>63.80 64.70</td><td>53.12 58.23</td><td>36.20 39.70</td><td>26.92 32.74</td><td>24.10 22.30</td><td>16.93 17.33</td></tr><tr><td rowspan=\"6\">Curved</td><td>RL (10M steps)*[13]</td><td></td><td>4.90</td><td>1.78</td><td>3.20</td><td></td><td></td></tr><tr><td>RL (extra data + 50M steps)*[13]</td><td>15.70</td><td>11.34</td><td>10.70</td><td>1.37 9.03</td><td>1.10 3.90</td><td>0.46</td></tr><tr><td></td><td>17.90</td><td>13.24</td><td>15.00</td><td>12.17</td><td>5.90</td><td>3.57</td></tr><tr><td>RL (extra data + 100M steps)*[13] BC w/ ResNet + Metric Map</td><td>4.90</td><td>4.23</td><td>1.40</td><td>1.29</td><td>0.40</td><td>4.87 0.34</td></tr><tr><td>BC w/ResNet +GRU</td><td>3.10</td><td>2.61</td><td>0.80</td><td>0.77</td><td>0.10</td><td>0.02</td></tr><tr><td>NRNS w/ noise</td><td>21.40</td><td>8.19</td><td>15.40</td><td>6.83</td><td></td><td>10.0</td></tr><tr><td>NRNS w/out noise</td><td></td><td>23.70</td><td>12.68</td><td>16.20</td><td>8.34</td><td>9.10</td><td>4.86 5.14</td></tr></table>",
855
+ "bbox": [
856
+ 191,
857
+ 678,
858
+ 807,
859
+ 909
860
+ ],
861
+ "page_idx": 8
862
+ },
863
+ {
864
+ "type": "text",
865
+ "text": "NRNS Module Ablations. Tab. 3 reports detailed ablations of NRNS on the Gibson dataset (see appendix for ablation results on MP3D). We ablate the NRNS approach by testing each module individually. In the ablation experiments, we replace the module output with the ground truth labels or numbers in order to evaluate the affect of each module on the performance of the overall approach. For simplicity, all ablations are trained and tested without sensor or actuation noise. Unsurprisingly, we find that the Global Policy, $\\mathcal { G } _ { D }$ , has a large affect on performance (Row 4 and 8). We find that the largest affects are seen in the ‘hard’ and ‘curved’ test episodes. This is unsurprising because as the distance to the goal increases, the path increases in complexity and the search space of $\\mathcal { G } _ { D }$ increases. ",
866
+ "bbox": [
867
+ 173,
868
+ 90,
869
+ 826,
870
+ 203
871
+ ],
872
+ "page_idx": 9
873
+ },
874
+ {
875
+ "type": "table",
876
+ "img_path": "images/26d73f8eb88944bb871a378513bd32e2d9a79e43061ca7cd03cf73698a193bec.jpg",
877
+ "table_caption": [
878
+ "Table 3: Ablations of NRNS with baselines on Image-Goal Navigation on Gibson [41]. We report average Success and Success weighted by inverse Path Length (SPL) $@$ 1m. $\\pmb { \\chi }$ denotes a module being replaced by the ground truth labels and a $\\checkmark$ denotes the NRNS module being used. "
879
+ ],
880
+ "table_footnote": [],
881
+ "table_body": "<table><tr><td rowspan=\"2\">Path Type</td><td colspan=\"3\">NRNS Ablation</td><td colspan=\"2\">Easy</td><td colspan=\"2\">Medium</td><td colspan=\"2\">Hard</td></tr><tr><td>9EA</td><td>9T</td><td>9D</td><td>Succ ↑</td><td>SPL个</td><td>Succ 个</td><td>SPL个</td><td>Succ个</td><td>SPL个</td></tr><tr><td rowspan=\"4\">Straight</td><td>×</td><td></td><td></td><td>100.00</td><td>99.75</td><td>100.00</td><td>99.62</td><td>100.00</td><td>99.57</td></tr><tr><td></td><td></td><td>X</td><td>99.90</td><td>99.05</td><td>98.20</td><td>95.06</td><td>95.91</td><td>90.53</td></tr><tr><td>√</td><td></td><td>X</td><td>79.40</td><td>73.48</td><td>71.30</td><td>67.48</td><td>62.16</td><td>58.06</td></tr><tr><td>&lt;</td><td>xx&lt;&gt;</td><td>√</td><td>68.00</td><td>61.62</td><td>49.10</td><td>44.56</td><td>23.45</td><td>18.84</td></tr><tr><td rowspan=\"4\">Curved</td><td>×</td><td>X</td><td>×</td><td>100.00</td><td>97.62</td><td>100.00</td><td>97.47</td><td>100.00</td><td>98.18</td></tr><tr><td>√</td><td>X</td><td>X</td><td>99.70</td><td>95.93</td><td>97.50</td><td>90.14</td><td>89.30</td><td>79.95</td></tr><tr><td></td><td></td><td></td><td>65.00</td><td>56.70</td><td>58.10</td><td>52.51</td><td>47.70</td><td>42.28</td></tr><tr><td>V</td><td>·</td><td>X</td><td>35.50</td><td>18.38</td><td>23.90</td><td>12.08</td><td>12.50</td><td>6.84</td></tr></table>",
882
+ "bbox": [
883
+ 246,
884
+ 262,
885
+ 751,
886
+ 411
887
+ ],
888
+ "page_idx": 9
889
+ },
890
+ {
891
+ "type": "text",
892
+ "text": "5.2 Training on Passive Videos in the Wild ",
893
+ "text_level": 1,
894
+ "bbox": [
895
+ 174,
896
+ 422,
897
+ 480,
898
+ 438
899
+ ],
900
+ "page_idx": 9
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "Finally, we demonstrate that our model can be learned from passive videos in the wild. Towards this end, we train our NRNS model using the RealEstate10K dataset [40] which contains YouTube videos of real estate tours. This dataset has 80K clips with poses estimated via SLAM. Note that the average trajectory length is smaller than test time trajectories in Gibson or MP3D, and we therefore only evaluate on ‘easy’ and ‘medium’ settings. Tab. 4 shows the performance. Note there is a drop in performance compared to training using Gibson videos, which we attribute to domain shift. Even after this drop, our approach, trained on real-world passive videos, outperforms BC baselines and performs competitively against RL baselines. RL baselines have an advantage as they are both trained in the simulator and trained on the Gibson dataset. We believe that the delta between RL and the performance of NRNS trained on RealEstate would close if both were tested on real-world data. We find these results to be a strong indication of the effectiveness of training on passive data. ",
905
+ "bbox": [
906
+ 173,
907
+ 439,
908
+ 825,
909
+ 590
910
+ ],
911
+ "page_idx": 9
912
+ },
913
+ {
914
+ "type": "table",
915
+ "img_path": "images/f85af3d98cd086bc58c455eb6739869d8449d8783a5f90db9834108a701e2c8f.jpg",
916
+ "table_caption": [
917
+ "Table 4: Comparison of our model (NRNS) trained with different sets of passive video data and tested on Image-Goal Navigation on Gibson [41]. We report average Success and Success weighted by inverse Path Length (SPL) $@$ 1m. Results shown are tested without sensor & actuation noise. "
918
+ ],
919
+ "table_footnote": [],
920
+ "table_body": "<table><tr><td></td><td></td><td></td><td colspan=\"2\">Easy</td><td colspan=\"2\">Medium</td></tr><tr><td>Path Type</td><td>Training Data</td><td>Model</td><td>Succ 个</td><td>SPL个</td><td>Succ 个</td><td>SPL↑</td></tr><tr><td rowspan=\"4\">Straight</td><td>RealEstate10k [40]</td><td>NRNS</td><td>56.42</td><td>48.01</td><td>30.30</td><td>25.67</td></tr><tr><td>MP3D</td><td>NRNS</td><td>59.80</td><td>52.35</td><td>37.00</td><td>31.89</td></tr><tr><td>Gibson</td><td>NRNS</td><td>68.00</td><td>61.62</td><td>49.10</td><td>44.56</td></tr><tr><td>Gibson</td><td>BC w/ResNet + GRU</td><td>30.20</td><td>29.57</td><td>12.70</td><td>12.48</td></tr><tr><td rowspan=\"4\">Curved</td><td>RealEstate10k [40]</td><td>NRNS</td><td>21.10</td><td>15.76</td><td>12.90</td><td>5.57</td></tr><tr><td>MP3D</td><td>NRNS</td><td>28.26</td><td>13.59</td><td>11.00</td><td>5.10</td></tr><tr><td>Gibson</td><td>NRNS</td><td>35.50</td><td>18.38</td><td>23.90</td><td>12.08</td></tr><tr><td>Gibson</td><td>BC w/ResNet +GRU</td><td>3.10</td><td>2.61</td><td>0.80</td><td>0.77</td></tr></table>",
921
+ "bbox": [
922
+ 225,
923
+ 650,
924
+ 772,
925
+ 800
926
+ ],
927
+ "page_idx": 9
928
+ },
929
+ {
930
+ "type": "text",
931
+ "text": "6 Conclusion ",
932
+ "text_level": 1,
933
+ "bbox": [
934
+ 173,
935
+ 808,
936
+ 299,
937
+ 824
938
+ ],
939
+ "page_idx": 9
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "We have presented a simple yet effective approach for learning navigation policies from passive videos. While simulators have become fast, the diversity and scalability of environments still remains a challenge. Our presented approach, NRNS, neither requires access to ground-truth maps nor online policy interaction and hence forgoes the need for a simulator to learn policy functions. We demonstrate that NRNS can outperform RL and behavioral cloning policies by significant margins. We show that NRNS can be trained on passive videos in the wild and still outperform all baselines. ",
944
+ "bbox": [
945
+ 174,
946
+ 828,
947
+ 825,
948
+ 911
949
+ ],
950
+ "page_idx": 9
951
+ },
952
+ {
953
+ "type": "text",
954
+ "text": "Acknowledgement ",
955
+ "text_level": 1,
956
+ "bbox": [
957
+ 176,
958
+ 89,
959
+ 330,
960
+ 106
961
+ ],
962
+ "page_idx": 10
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "The authors would like to thank Saurabh Gupta for the discussions. We would also like to thank the Gibson and RealEstate10K dataset authors for sharing their datasets for scientific research. ",
967
+ "bbox": [
968
+ 176,
969
+ 119,
970
+ 825,
971
+ 148
972
+ ],
973
+ "page_idx": 10
974
+ },
975
+ {
976
+ "type": "text",
977
+ "text": "Licenses for referenced datasets. ",
978
+ "text_level": 1,
979
+ "bbox": [
980
+ 176,
981
+ 155,
982
+ 400,
983
+ 167
984
+ ],
985
+ "page_idx": 10
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "Gibson: http://svl.stanford.edu/gibson2/assets/GDS_agreement.pdf Matterport3D: http://kaldir.vc.in.tum.de/matterport/MP_TOS.pdf ",
990
+ "bbox": [
991
+ 176,
992
+ 170,
993
+ 709,
994
+ 196
995
+ ],
996
+ "page_idx": 10
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "References ",
1001
+ "text_level": 1,
1002
+ "bbox": [
1003
+ 174,
1004
+ 217,
1005
+ 266,
1006
+ 232
1007
+ ],
1008
+ "page_idx": 10
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "[1] Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018. \n[2] Tao Chen, Saurabh Gupta, and Abhinav Gupta. Learning exploration policies for navigation. International Conference on Learning Representations, 2019. \n[3] Santhosh K Ramakrishnan, Ziad Al-Halah, and Kristen Grauman. Occupancy anticipation for efficient exploration and navigation. In European Conference on Computer Vision, 2020. \n[4] Devendra Singh Chaplot, Ruslan Salakhutdinov, Abhinav Gupta, and Saurabh Gupta. Neural topological slam for visual navigation. In Computer Vision and Pattern Recognition, 2020. \n[5] Dhruv Batra, Aaron Gokaslan, Aniruddha Kembhavi, Oleksandr Maksymets, Roozbeh Mottaghi, Manolis Savva, Alexander Toshev, and Erik Wijmans. ObjectNav Revisited: On Evaluation of Embodied Agents Navigating to Objects. In arXiv:2006.13171, 2020. \n[6] Devendra Singh Chaplot, Dhiraj Prakashchand Gandhi, Abhinav Gupta, and Russ R Salakhutdinov. Object goal navigation using goal-oriented semantic exploration. Neural Information Processing Systems, 2020. \n[7] Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In International Conference on Computer Vision, 2019. \n[8] Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sünderhauf, Ian Reid, Stephen Gould, and Anton van den Hengel. Vision-and-Language Navigation: Interpreting visually-grounded navigation instructions in real environments. In Computer Vision and Pattern Recognition, 2018. \n[9] Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. AI2-THOR: An Interactive 3D Environment for Visual AI. Computer Vision and Pattern Recognition, 2017. \n[10] Devendra Singh Chaplot, Dhiraj Gandhi, Saurabh Gupta, Abhinav Gupta, and Ruslan Salakhutdinov. Learning to explore using active neural slam. In International Conference on Learning Representations, 2020. \n[11] Yuke Zhu, Roozbeh Mottaghi, Eric Kolve, Joseph J Lim, Abhinav Gupta, Li Fei-Fei, and Ali Farhadi. Target-driven visual navigation in indoor scenes using deep reinforcement learning. In International Conference on Robotics and Automation, 2017. \n[12] Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In Computer Vision and Pattern Recognition, 2017. \n[13] Erik Wijmans, Abhishek Kadian, Ari Morcos, Stefan Lee, Irfan Essa, Devi Parikh, Manolis Savva, and Dhruv Batra. Dd-ppo: Learning near-perfect pointgoal navigators from 2.5 billion frames. In International Conference on Learning Representations, 2020. \n[14] Yi Wu, Yuxin Wu, Aviv Tamar, Stuart Russell, Georgia Gkioxari, and Yuandong Tian. Bayesian relational memory for semantic visual navigation. In International Conference on Computer Vision, 2019. \n[15] Lina Mezghani, Sainbayar Sukhbaatar, Thibaut Lavril, Oleksandr Maksymets, Dhruv Batra, Piotr Bojanowski, and Karteek Alahari. Memory-augmented reinforcement learning for imagegoal navigation. arXiv preprint arXiv:2101.05181, 2021. \n[16] Wei Yang, Xiaolong Wang, Ali Farhadi, Abhinav Gupta, and Roozbeh Mottaghi. Visual semantic navigation using scene priors. International Conference on Learning Representations, 2018. \n[17] Benjamin Eysenbach, Ruslan Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. In Neural Information Processing Systems, 2019. \n[18] Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In International Conference on Learning Representations, 2018. \n[19] Piotr Mirowski, Matthew Koichi Grimes, Mateusz Malinowski, Karl Moritz Hermann, Keith Anderson, Denis Teplyashin, Karen Simonyan, Koray Kavukcuoglu, Andrew Zisserman, and Raia Hadsell. Learning to navigate in cities without a map. In Neural Information Processing Systems, 2018. \n[20] Scott Emmons, Ajay Jain, Michael Laskin, Thanard Kurutach, Pieter Abbeel, and Deepak Pathak. Sparse graphical memory for robust planning. In Neural Information Processing Systems, 2020. \n[21] Kevin Chen, Juan Pablo de Vicente, Gabriel Sepulveda, Fei Xia, Alvaro Soto, Marynel Vázquez, and Silvio Savarese. A behavioral approach to visual navigation with graph localization networks. In Robotics: Science and Systems, 2019. \n[22] Dhruv Shah, Benjamin Eysenbach, Gregory Kahn, Nicholas Rhinehart, and Sergey Levine. Ving: Learning open-world navigation with visual goals. International Conference on Robotics and Automation, 2020. \n[23] Samarth Brahmbhatt and James Hays. Deepnav: Learning to navigate large cities. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2017. \n[24] Matthew Chang, Arjun Gupta, and Saurabh Gupta. Semantic visual navigation by watching youtube videos. In Neural Information Processing Systems, 2020. \n[25] Harish Ravichandar, Athanasios S Polydoros, Sonia Chernova, and Aude Billard. Recent advances in robot learning from demonstration. Annual Review of Control, Robotics, and Autonomous Systems, 2020. \n[26] David Silver, J Andrew Bagnell, and Anthony Stentz. Active learning from demonstration for robust autonomous navigation. In International Conference on Robotics and Automation, 2012. \n[27] Xinlei Pan, Tingnan Zhang, Brian Ichter, Aleksandra Faust, Jie Tan, and Sehoon Ha. Zero-shot imitation learning from demonstrations for legged robot visual navigation. In International Conference on Robotics and Automation, 2020. \n[28] Noah Y Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020. \n[29] Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020. \n[30] Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020. \n[31] Edward Beeching, Jilles Dibangoye, Olivier Simonin, and Christian Wolf. Learning to plan with uncertain topological maps. In European Conference on Computer Vision, 2020. \n[32] Russell A Epstein, Eva Zita Patai, Joshua B Julian, and Hugo J Spiers. The cognitive map in humans: spatial navigation and beyond. Nature Neuroscience, 2017. \n[33] Edward C Tolman. Cognitive maps in rats and men. Psychological Review, 1948. \n[34] Patrick Foo, William H Warren, Andrew Duchon, and Michael J Tarr. Do humans integrate routes into a cognitive map? map-versus landmark-based navigation of novel shortcuts. Journal of Experimental Psychology: Learning, Memory, and Cognition, 2005. \n[35] Ranxiao Frances Wang and Elizabeth S Spelke. Human spatial representation: Insights from animals. Trends in Cognitive Sciences, 2002. \n[36] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. International Conference on Learning Representations, 2017. \n[37] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, 2016. \n[38] Brendan J Frey and Delbert Dueck. Clustering by passing messages between data points. Science, 2007. \n[39] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. Transactions on Pattern Analysis and Machine Intelligence, 2017. \n[40] Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. In SIGGRAPH, 2018. \n[41] Fei Xia, Amir R Zamir, Zhiyang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson env: Real-world perception for embodied agents. In Computer Vision and Pattern Recognition, 2018. \n[42] Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niessner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from rgb-d data in indoor environment. International Conference on 3D Vision, 2017. ",
1013
+ "bbox": [
1014
+ 174,
1015
+ 234,
1016
+ 826,
1017
+ 915
1018
+ ],
1019
+ "page_idx": 10
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "",
1024
+ "bbox": [
1025
+ 171,
1026
+ 63,
1027
+ 828,
1028
+ 922
1029
+ ],
1030
+ "page_idx": 11
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "",
1035
+ "bbox": [
1036
+ 171,
1037
+ 90,
1038
+ 828,
1039
+ 517
1040
+ ],
1041
+ "page_idx": 12
1042
+ }
1043
+ ]
parse/train/8vXYx6d8Wc/8vXYx6d8Wc_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/8vXYx6d8Wc/8vXYx6d8Wc_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/n646avOVJ7q/n646avOVJ7q.md ADDED
@@ -0,0 +1,478 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Global Convergence of Multi-Agent Policy Gradient in Markov Potential Games
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ Potential games are arguably one of the most important and widely studied classes of normal form games. They define the archetypal setting of multi-agent coordination as all agent utilities are perfectly aligned with each other via a common potential function. Can this intuitive framework be transplanted in the setting of Markov Games? What are the similarities and differences between multi-agent coordination with and without state dependence? We present a novel definition of Markov Potential Games (MPG) that generalizes prior attempts at capturing complex stateful multi-agent coordination. Counter-intuitively, insights from normal-form potential games do not carry over as MPGs can consist of settings where state-games can be zero-sum games. In the opposite direction, Markov games where every state-game is a potential game are not necessarily MPGs. Nevertheless, MPGs showcase standard desirable properties such as the existence of deterministic Nash policies. In our main technical result, we prove fast convergence of independent policy gradient to Nash policies by adapting recent gradient dominance property arguments developed for single agent MDPs to multi-agent learning settings.
11
+
12
+ # 16 1 Introduction
13
+
14
+ 17 Reinforcement learning (RL) has been a fundamental driver of numerous recent advances in Artificial
15
+ 18 Intelligence (AI) applications that range from super-human performance in competitive game-playing
16
+ 19 [28, 29, 5] and strategic decision-making in multiple tasks [21, 23, 33] to robotics, autonomous
17
+ 20 driving and cyber-physical systems [6, 37]. A core ingredient for the success of single-agent RL
18
+ 21 systems, which are typically modelled as Markov Decision Processes (MDPs), is the guarantee of
19
+ 22 existence of stationary deterministic optimal policies [3, 30]. This allows for the design of efficient
20
+ 23 algorithms that provably converge towards the optimal policy [1]. However, a majority of the above
21
+ 24 systems involve multi-agent interactions and despite the notable empirical advancements, there is
22
+ 25 a lack of understanding about the theoretical convergence guarantees of the existing multi-agent
23
+ 26 reinforcement learning (MARL) algorithms.
24
+ 27 The main challenge in the transition from single to multi-agent RL settings is the computation of
25
+ 28 Nash policies. A Nash policy for $n > 1$ agents is defined to be a profile of policies $( \pi _ { 1 } ^ { * } , . . . , \pi _ { n } ^ { * } )$ so
26
+ 29 that by fixing the stationary policies of all agents but $i$ , $\pi _ { i } ^ { * }$ is an optimal policy for the resulting
27
+ 30 single-agent MDP and this is true for all $1 \leq i \leq n ^ { \mathrm { ~ 1 ~ } }$ (see Definition 1). Note that in multi-agent
28
+ 31 settings, Nash policies may not be unique in principle.
29
+ 32 A common approach for computing Nash policies in MDPs is the use of policy gradient methods.
30
+ 33 The significant progress in the analysis of such methods during the last couple of years, including
31
+ 34 [1] (and references therein), mainly concerns the single-agent case: the convergence properties of
32
+ 35 policy gradient in MARL remain poorly understood. Existing steps towards a theory for multi-agent
33
+ 36 settings involve the papers of [10] who show convergence of independent policy gradient to the
34
+ 37 optimal policy, for two-agent zero-sum stochastic games, of [36] who improve the result of [10] using
35
+ 38 optimistic policy gradient and of [38] who study extensions of Natural Policy Gradient using function
36
+ 39 approximation. It is worth noting that the positive results of [10, 36] and [38] depend on the fact that
37
+ 40 two-agent stochastic zero-sum games satisfy the “min-max equals max-min” property [27] (even
38
+ 41 though the value-function landscape may not be convex-concave, which implies that Von Neumann’s
39
+ 42 celebrated minimax theorem may not be applicable).
40
+ 43 Model and Informal Statement of Results. While the previous works make progress in competi
41
+ 44 tive interactions, i.e., interactions in which gains can only come at the expense of others, MARL in
42
+ 45 cooperative settings remains largely under-explored and constitutes one of the current frontiers in AI
43
+ 46 research [9, 8]. Based on this, our work is motivated by the following natural question:
44
+
45
+ Can we get (provably) fast convergence guarantees for multi-agent RL settings in which cooperation is desirable?
46
+
47
+ 49 To address this question, we define and study a class of $n$ -agent MDPs that naturally generalize
48
+ 50 normal form potential games [22], called Markov Potential Games (MPGs). In words, a multi-agent
49
+ 51 MDP is a MPG as long as there exists a (state-dependent) real-valued potential function $\Phi$ so that if an
50
+ 52 agent $i$ changes their policy (and the rest of the agents keep their policy unchanged), the difference in
51
+ 53 agent $i$ ’s value/utility, $V ^ { i }$ , is captured by the difference in the value of $\Phi$ (see Definition 2). Weighted
52
+ 54 and ordinal MPGs are defined similar to the normal form counterparts (see Remark 1).
53
+ 55 Under our definition, we answer the above motivating question in the affirmative. In particular, we
54
+ 56 show that if every agent $i$ independently runs (with simultaneous updates) policy gradient on his
55
+ 57 utility/value $V ^ { i }$ , after ${ \cal O } ( 1 / \epsilon ^ { 2 } )$ iterations, the system will reach an $\epsilon$ -approximate Nash policy (see
56
+ 58 informal Theorem 1.1 and formal Theorem 4.2). Moreover, we show the finite sample analogue, that
57
+ 59 is if every agent $i$ independently runs (with simultaneous updates) stochastic policy gradient, then
58
+ 60 with high probability, the system will reach an $\epsilon$ -approximate Nash policy after ${ \cal O } ( 1 \bar { 1 } / \bar { \epsilon } ^ { 6 } )$ iterations.
59
+ 61 Along the way, we prove several properties about the structure of MPGs and their Nash policies (see
60
+ 62 Theorem 1.2 and Section 3). Our results can be summarized in the following two Theorems.
61
+ 63 Theorem 1.1 (Convergence of Policy Gradient (Informal)). Consider a MPG with n agents and let
62
+ 64 $\epsilon > 0$ . (a) If each agent i runs independent policy gradient using direct parameterization on his policy
63
+ 65 and that the updates are simultaneous, then, the learning dynamics reach an $\epsilon$ -Nash policy after
64
+ 66 $\mathcal { O } ( 1 / \epsilon ^ { 2 } )$ iterations. $( b )$ If each agent $i$ runs stochastic policy gradient using greedy parameterization
65
+ 67 (see (3)) on his policy and the updates are simultaneous, then the learning dynamics reach an $\epsilon$ -Nash
66
+ 68 policy after $\bar { \mathcal { O } } ( \bar { 1 } / \epsilon ^ { 6 } )$ iterations.
67
+
68
+ 69 This result holds trivially for weighted MPGs and asymptotically also for ordinal MPGs, see Remark 2.
69
+
70
+ Theorem 1.2 (Structural Properties of MPGs). The following facts are true for MPGs with $n$ -agents:
71
+
72
+ (a) There always exists a Nash policy profile $( \pi _ { 1 } ^ { * } , \ldots , \pi _ { n } ^ { * } )$ so that $\pi _ { i } ^ { * }$ is deterministic for each agent i (see Theorem 3.1).
73
+
74
+ (b) We can construct MDPs for which each state is an underlying potential game but the MDPs are not MPGs. This can be true regardless of whether the whole MDP is competitive or cooperative in nature (see Examples 1 and 2, respectively). On the opposite side, we can construct MDPs that are MPGs but which include states that are purely competitive (i.e., zero-sum games), see Example 3. (c) We provide sufficient conditions so that a MDP is a MPG. These include cases where each state is an underlying potential game and the transition probabilities are not affected by agents actions or the reward functions satisfy certain regularity conditions between different states (see conditions C1 and C2 in Proposition 3.2).
75
+
76
+ 81 Technical Overview. The first challenge in the proof of Theorem 1.1 is that multi-agent settings
77
+ 82 (MPGs) do not satisfy the gradient dominance property, which is an important part in the proof of
78
+ 83 convergence of policy gradient in single-agent settings [1]. In particular, there is no uniqueness of
79
+ 84 optimal policies and as a result, there is not a properly defined notion of value in MPGs (in contrast to
80
+ 85 zero-sum stochastic games [10]). On the positive side, we show that agent-wise (i.e., after fixing the
81
+ 86 policy of all agents but $i$ ), the value function, $V ^ { i }$ , satisfies the gradient dominance property along the
82
+ 87 direction of $\pi _ { i }$ (policy of agent $i$ ). This can be leveraged to show that every (approximate) stationary
83
+ 88 point (Definition 4) of the potential function $\Phi$ is an (approximate) Nash policy (Lemma 4.1). As a
84
+ 89 result, convergence to an approximate Nash policy is established by showing that $\Phi$ is smooth and
85
+ 90 then applying Projected Gradient Ascent (PGA) on $\Phi$ . This step uses the rather well-known fact that
86
+ 91 (PGA) converges to $\epsilon$ -stationary points in ${ \cal O } ( 1 / \epsilon ^ { 2 } )$ iterations for smooth functions. As a result, by
87
+ 92 applying PGA on the potential $\Phi$ , one gets an approximate Nash policy. Our convergence result then
88
+ 93 follows by showing that PGA on the potential function, $\Phi$ , generates the same dynamics as if each
89
+ 94 agent $i$ runs independent PGA on their value function, $V ^ { i }$ .
90
+ 95 In the case that agents do not have access to exact gradients, we derive a similar result for finite
91
+ 96 samples. In this case, we apply Projected Stochastic Gradient Ascent (PSGA) on $\Phi$ which (as was
92
+ 97 the case for PGA) can be shown to be the same as when agents apply PSGA independently on their
93
+ 98 individual value functions. The key is to get an unbiased sample for the gradient of the value functions
94
+ 99 and prove that it has bounded variance (in terms of the parameters of the MPG). This comes from the
95
+ 100 discount factor, $\gamma$ ; in this case, $1 - \gamma$ can be interpreted as the probability to terminate the MDP at
96
+ 101 a particular state (and $\gamma$ to continue). This can be used to show that a trajectory of the MDP is an
97
+ 102 unbiased sample for the gradient of the value functions. To guarantee that the estimate has bounded
98
+ 103 variance, we apply the approach of [10] which requires that agents perform PSGA with $\alpha$ -greedy
99
+ 104 exploration (see (3)). The main idea is that this parameterization stays away from the boundary of the
100
+ 105 simplex throughout its trajectory.
101
+ 106 Concerning our structural results in Theorem 1.2, the main challenge is (again) the lack of a value in
102
+ 107 general multi-agent settings and the dependence of state-transitions (in addition to agents’ rewards)
103
+ 108 on agents’ actions. The proof of Theorem 3.1 shows that these issues can be still successfully handled
104
+ 109 within the class of MPGs by studying single-agent deviations (to deterministic optimal policies)
105
+ 110 which keep the value of the potential constant (at its global maximum). Our examples in this part
106
+ 111 show that the class of MPGs can be significantly larger than state based potential games but also that
107
+ 112 even simple coordination games may fail to satisfy the (exact) MPG property.
108
+
109
+ # 113 2 Preliminaries
110
+
111
+ 114 Markov Decision Process (MDP). The following notation is standard and largely follows [1] and
112
+ 115 [10]. We consider a setting with $n$ agents who repeatedly select actions in a shared Markov Decision
113
+ 116 Process (MDP). The goal of each agent is to maximize their respective value function. Formally, a
114
+ 117 MDP is defined as a tuple $\mathcal { G } = ( \mathcal { S } , \mathcal { \bar { N } } , \{ A _ { i } , R _ { i } \} _ { i \in \mathcal { N } } , P , \gamma , \rho )$ , where $s$ is a finite state space of size
115
+ 118 $S = | S |$ , $\mathcal { N } = \{ 1 , 2 , \dots , n \}$ is a the set of active agents in the MDP and $\mathbf { \mathcal { A } } _ { i }$ is a finite action space of
116
+ 119 size $A _ { i } = | { \mathcal { A } } _ { i } |$ for each agent $i \in \mathcal N$ with generic element $a _ { i } \in { \mathcal { A } } _ { i }$ . We will write $\begin{array} { r } { \mathcal { A } = \prod _ { i \in \mathcal { N } } \mathcal { A } _ { i } } \end{array}$
117
+ 120 and $\begin{array} { r } { \mathcal { A } _ { - i } = \prod _ { j \neq i } \mathcal { A } _ { j } } \end{array}$ to denote the joint action spaces of all agents and of all agents other than $i$
118
+ 121 with generic elements $\mathbf { a } = ( a _ { i } ) _ { i \in \mathcal { N } }$ and $\mathbf { a } _ { - \mathbf { i } } = ( a _ { j } ) _ { j \neq i }$ , respectively. $R _ { i } : S \times A \to [ - 1 , 1 ]$ is the
119
+ 122 individual reward function of agent $i \in \mathcal N$ , i.e., $R _ { i } \mathbf { \bar { ( } } s , a _ { i } , \mathbf { a } _ { - i } )$ is the instantaneous reward of agent $i$
120
+ 123 when agent $i$ takes action $a _ { i }$ and all other agents take actions $\mathbf { a } _ { - i }$ at state $s \in S$ . $P$ is the transition
121
+ 124 probability function, for which $P ( s ^ { \prime } \mid s , \bar { \mathbf { a } } )$ is the probability of transitioning from $s$ to $s ^ { \prime }$ when
122
+ 125 $\mathbf { a } \in { \mathcal { A } }$ is the action profile chosen by the agents. Finally, $\gamma$ is a discount factor for future rewards of
123
+ 126 the MDP, shared by all agents and $\rho \in \Delta ( \mathcal { S } )$ is a distribution for the initial state at time $t = 0$ . 2
124
+ 127 Whenever time is relevant, we will index the above terms with $t$ . In particular, at each time step
125
+ 128 $t \geq 0$ , all agents observe the state $s _ { t } ~ \in ~ S$ , select actions $\mathbf { a } _ { t } ~ = ~ ( a _ { i , t } , \mathbf { a } _ { - i , t } )$ , receive rewards
126
+ 129 $r _ { i , t } : = R _ { i } ( s _ { t } , \mathbf { a } _ { t } ) , i \in \mathcal { N }$ and transition to the next state $s _ { t + 1 } \sim P ( \cdot \mid s _ { t } , \mathbf { a } _ { t } )$ . We will write
127
+ 130 $\boldsymbol { \tau } = ( s _ { t } , \mathbf { a } _ { t } , \mathbf { r } _ { t } ) _ { t \geq 0 }$ to denote the trajectories of the system, where $\mathbf { r } _ { t } : = ( r _ { i , t } ) , i \in \mathcal { N }$ .
128
+
129
+ Policies and Value Functions. For each agent $i \in \mathcal N$ , a deterministic, stationary policy $\pi _ { i } : { \cal { S } } $ $A _ { i }$ specifies the action of agent $i$ at each state $s \in S$ , i.e., $\pi _ { i } ( s ) = a _ { i } \in { \mathcal { A } } _ { i }$ for each $s \in S$ . A stochastic, stationary policy $\pi _ { i } : { \mathcal { S } } \Pi _ { i }$ , where $\Pi _ { i } : = \Delta ( { \mathcal { A } } _ { i } ) ^ { S }$ , specifies a probability distribution over the actions of agent $i$ for each state $s \in S$ . In this case, we will write $a _ { i } \sim \pi _ { i } ( \cdot \mid s )$ to denote the randomized action of agent $i$ at state $s \in S$ . As above, we will write $\pi = ( \pi _ { i } ) _ { i \in \mathcal { N } } \in \Pi : =$ $\times _ { i \in \mathcal { N } } \Delta ( \mathcal { A } _ { i } ) ^ { S }$ and $\pi _ { - i } = ( \pi _ { j } ) _ { i \neq j \in N } \in \Pi _ { - i } : = \times _ { i \neq j \in N } \Delta ( \mathcal { A } _ { j } ) ^ { S }$ to denote the joint policies of all agents and of all agents other than $i$ , respectively. A joint policy $\pi$ induces a distribution $\mathrm { P r } ^ { \pi }$ over trajectories $\boldsymbol { \tau } = ( s _ { t } , \mathbf { a } _ { t } , \mathbf { r } _ { t } ) _ { t \geq 0 }$ , where $s _ { 0 }$ is drawn from the initial state distribution $\rho$ and $a _ { i , t }$ is drawn from $\pi _ { i } ( \cdot \mid s _ { t } )$ for all $i \in \mathcal N$ .
130
+
131
+ 140 The value function, $V _ { s } ^ { i } : \Pi \mathbb { R }$ , gives the expected reward of agent $i \in \mathcal N$ when $s _ { 0 } = s$ and the agents draw their actions, 141 $\mathbf { a } _ { t } = \left( a _ { i , t } , \mathbf { a } _ { - i , t } \right)$ , at time $t \geq 0$ from policies $\pi = ( \pi _ { i } , \pi _ { - i } )$
132
+
133
+ $$
134
+ V _ { s } ^ { i } ( \pi ) : = \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { i , t } \mid s _ { 0 } = s \right] .
135
+ $$
136
+
137
+ 142 We also denote $V _ { \rho } ^ { i } ( \pi ) = \mathbb { E } _ { s \sim \rho } \left[ V _ { s } ^ { i } ( \pi ) \right]$ if the initial state is random and follows distribution $\rho$ . The
138
+ 143 solution concept that we will be focusing on are the Nash Policies. Formally:
139
+ 144 Definition 1 ( $\epsilon$ -Nash Policy). A joint policy $\pi ^ { * } = ( \pi _ { i } ^ { * } ) _ { i \in \mathcal { N } }$ is an $\epsilon$ -Nash policy if there exists an $\epsilon \geq 0$
140
+ 145 so that for each agent $i \in \mathcal N$ , $V _ { s } ^ { i } ( \pi _ { i } ^ { * } , \pi _ { - i } ^ { * } ) \geq V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ^ { * } ) - \epsilon .$ , for all $\pi _ { i } \in \Delta ( \mathcal { A } _ { i } ) ^ { S }$ , and all $s \in S$ .
141
+ 146 If $\epsilon = 0$ , then $\pi ^ { * }$ is a called a Nash policy. In this case, $\pi _ { i } ^ { * }$ maximizes each agent $i$ ’s value function
142
+ 147 for each starting state $s \in S$ given the policies, $\pi _ { - i } ^ { * } = ( \pi _ { j } ^ { * } ) _ { j \neq i }$ , of all other agents $j \neq i \in \mathcal { N }$ . The
143
+ 148 definition of a Nash policy remains the same if $s \sim \rho$ (random starting state).
144
+
145
+ # 3 Markov Potential Games
146
+
147
+ 50 We are now ready to define the class of MDPs that we will focus on for the rest of the paper, i.e.,
148
+ 51 Markov Potential Games.
149
+ 52 Definition 2 (Markov Potential Game). A Markov Decision Process (MDP), $\mathcal { G }$ , is called a Markov
150
+ 153 Potential Game (MPG) if there exists a (state-dependent) function $\Phi _ { s } : \Pi \mathbb { R }$ for $s \in S$ so that
151
+
152
+ $$
153
+ \Phi _ { s } ( \pi _ { i } , \pi _ { - i } ) - \Phi _ { s } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) = V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ) - V _ { s } ^ { i } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) ,
154
+ $$
155
+
156
+ for all agents 154 $i \in \mathcal N$ , all states $s \in S$ and all policies $\pi _ { i } , \pi _ { i } ^ { \prime } \in \Pi _ { i } , \pi _ { - i } \in \Pi _ { - i }$ . We should note that 155 by linearity of expectation, it follows that $\Phi _ { \rho } ( { \bar { \pi } } _ { i } , { \pi } _ { - i } ) - \Phi _ { \rho } ( \pi _ { i } ^ { \prime } , { \pi } _ { - i } ) = V _ { \rho } ^ { i } ( \pi _ { i } , { \pi } _ { - i } ) - V _ { \rho } ^ { i } ( \pi _ { i } ^ { \prime } , { \pi } _ { - i } )$ , 156 where $\Phi _ { \rho } ( \pi ) : = \mathbb { E } _ { s \sim \rho } \left[ \Phi _ { s } ( \pi ) \right]$ .
157
+
158
+ 157 As in normal-form games, an immediate consequence of this definition is that the value function of
159
+ 158 each agent in a MPG can be written as a sum of the potential (common term) and a term that does not
160
+ 159 depend on that agent’s policy (dummy term), cf. Proposition B.1 in Appendix B, i.e., for each agent
161
+ 160 $i \in \mathcal N$ there exists a function $U _ { s } ^ { i } : \Pi _ { - i } \xrightarrow { } \mathbb { R }$ so that $\begin{array} { r } { \dot { V } _ { s } ^ { i } ( \pi ) = \Phi _ { s } ( \pi ) \dot { + } \dot { U } _ { s } ^ { i } ( \pi _ { - i } ) } \end{array}$ , for all $\pi \in \Pi$ .
162
+ 161 Remark 1 (Ordinal and Weighted Potential Games). Similar to normal-form games, we may also
163
+ 162 define more general notions of MPGs, such as weighted or ordinal MPGs. Specifically, if there exist
164
+ 163 positive constants $w _ { i } > 0 , i \in \mathcal { N }$ so that
165
+
166
+ $$
167
+ \Phi _ { s } ( \pi _ { i } , \pi _ { - i } ) - \Phi _ { s } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) = w _ { i } ( V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ) - V _ { s } ^ { i } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) ) ,
168
+ $$
169
+
170
+ 164 then $\mathcal { G }$ is called a Weighted Markov Potential Game (WMPG). If for all agents $i \in \mathcal N$ , all states $s \in S$ and all policies165 $\pi _ { i } , \pi _ { i } ^ { \prime } \in \Pi _ { i } , \pi _ { - i } \in \Pi _ { - i }$ , the function $\Phi _ { s } , s \in { \cal S }$ satisfies
171
+
172
+ $$
173
+ \Phi _ { s } ( \pi _ { i } , \pi _ { - i } ) - \Phi _ { s } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) > 0 \Longleftrightarrow V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ) - V _ { s } ^ { i } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) > 0 ,
174
+ $$
175
+
176
+ 166 then the MPD, $\mathcal { G }$ , is called an Ordinal Markov Potential Game (OMPG).
177
+
178
+ 167 Similarly to normal-form games, such classes are naturally motivated also in the setting of multi-agent
179
+ 168 MDPs. As Example 2 shows, even simple potential-like settings, i.e., settings in which coordination is
180
+ 169 desirable for all agents, may fail to be exact MPGs (but may still be ordinal or weighted MPGs). From
181
+ 170 our current perspective, ordinal and weighted MPGs remain relevant, since our main convergence
182
+ 171 results on the convergence of policy gradient carry over (in an exact or asymptotic sense) also in these
183
+ 172 classes of games (see Remark 2). As with the rest of the proofs (and technical details) of Section 3,
184
+ 173 the proof of Theorem 3.1 is provided in Appendix B.
185
+ 174 Existence of Deterministic Nash Policies in MPGs. Before studying which types of MDPs are
186
+ 175 captured by Definition 2, we first show that MPGs always possess deterministic Nash policies
187
+ 176 (similarly to their single-state counterparts, i.e., normal-form potential games [22]). This is established
188
+ 177 in Theorem 3.1, which settles part (a) of Theorem 1.2
189
+ 178 Theorem 3.1 (Deterministic Optimal Policy Profile). Let $\mathcal { G }$ be a Markov Potential Game (MPG).
190
+ 179 Then, there exists a Nash policy $\pi ^ { * } \in \Delta ( \mathcal { A } ) ^ { \bar { S } }$ which is deterministic, i.e., for each agent $i \in \mathcal N$ and
191
+ 180 each state $s \in S$ , there exists an action $a _ { i } \in { \mathcal { A } } _ { i }$ so that $\pi _ { i } ^ { * } ( a _ { i } \mid s ) = 1$ .
192
+ 181 Starting from an arbitrary Nash policy profile that is also a global maximizer of the potential function,
193
+ 182 the proof of Theorem 3.1 (which is deferred to Appendix B) relies on an iterative reduction process
194
+ 183 of its non-deterministic components. At each iteration, we isolate an agent $i \in \mathcal N$ , and find a
195
+ 184 deterministic (optimal) policy for that agent in the (single-agent) MDP in which the policies of all
196
+ 185 other agents but $i$ remain fixed. The important observation is that the resulting profile is again a
197
+ 186 global maximizer of the potential and hence, a Nash policy profile. This argument critically relies on
198
+ 187 the MPG structure and does not seem directly generalizable to MDPs that do not satisfy Definition 2.
199
+ 188 Sufficient Conditions for MPGs. Based on the above, it is tempting to think that MDPs which
200
+ 189 are potential at every state (meaning that the immediate rewards at every state are captured by a
201
+ 190 (normal-form) potential game at that state) are trivially MPGs. As we show in Examples 1 and 2,
202
+ 191 this intuition fails in the most straightforward way: we can construct simple MDPs that are potential
203
+ 192 at every state but which are purely competitive (do not possess a deterministic Nash policy) overall
204
+ 193 (Example 1) or which are cooperative in nature overall but which do not possess an exact potential
205
+ 194 function (Example 2).
206
+ 195 Example 1. Consider the MDP in Figure 1. To show that $\mathcal { G }$ is not a MPG, it suffices to show that
207
+ 196 it cannot have a deterministic optimal policy as should be the case according to Theorem 3.1. To
208
+ 197 obtain a contradiction, assume that agent $A$ is using a deterministic action $\bar { a _ { A } ^ { 0 } } \in \{ 0 , 1 \}$ at state 0.
209
+ 198 Then, agent $B$ , who prefers to move to state 1, will optimize their utility by choosing the action
210
+ 199 $a _ { B } ^ { 0 } \in \{ \bar { 0 } , 1 \}$ that yields $a _ { A } ^ { 0 } \oplus a _ { B } ^ { 0 } = 1$ . In other words, given any deterministic action of agent $A$ at
211
+ 200 state 0, agent can choose an action that always moves the sequence of play to state 1. Thus, such
212
+ 201 an action cannot be optimal for agent $A$ which implies that the MDP $\mathcal { G }$ does not have a deterministic
213
+ 202 optimal policy profile as claimed.
214
+ 203 Intuitively, competition arises in Example 1 because the two agents play a game of matching pennies
215
+ 204 in terms of the states that they prefer (which can be determined by the actions that they choose)
216
+ 205 despite the fact that the immediate rewards at each state are determined by normal form potential
217
+ 206 games. Example 2 shows that a state-based potential game may fail to be a MPG even if agents have
218
+ 207 similar preferences over states.
219
+
220
+ ![](images/25eebbe0f304e858ef30497a0424e6699307c9f7b0026115cdb5c3ff8ee0e999.jpg)
221
+ Figure 1: A MDP with normal-from potential games at each state (shown in matrix form below each state) but which is not a MPG due to conflicting preferences over states.
222
+
223
+ ![](images/379464134e3be8df89bc525d5bad6939a364104c0c03c5ada11db47cde21f67e.jpg)
224
+ Figure 2: A MDP with normal-form potential games at each state which is an ordinal MPG but not a MPG despite common preferences over states.
225
+
226
+ Example 2. In $s _ { 0 }$ the agents play a Battle of the Sexes game and hence a potential game, while in $s _ { 1 }$ they receive no reward (which is trivially a potential game). A simple calculation shows that there is not an exact potential function due to the dependence of the transitions on agents’ actions (thus, this MDP is not a MPG). However, in the case of Example 2, it is straightforward to show that the game is an ordinal potential game, cf. Appendix B.1.
227
+
228
+ 13 The previous discussion focuses on games that consist of normal-form potential games at every state,
229
+ 14 which leaves an important question unanswered: are there games which are not potential at every
230
+ 15 state but which are captured by the current definition of MPGs? Example 3 (see Figure 3) answers
231
+ 16 this question affirmatively. Together with Example 1, this settles the claim in Theorem 1.2, part (b).
232
+
233
+ Proposition 3.2 (Sufficient Conditions for MPGs). Consider a MDP $\mathcal { G }$ in which every state $s \in S$ is a potential game, i.e., the immediate rewards $R ( s , \mathbf { a } ) = ( R _ { i } ( s , \mathbf { a } ) ) _ { i \in \mathcal { N } }$ for each state $s \in S$ are captured by the utilities of a potential game with potential function $\phi _ { s }$ . Additionally, assume that one of the following conditions holds
234
+
235
+ C1. Agent-Independent Transitions: $P ( s ^ { \prime } \mid s , \mathbf { a } )$ does not depend on a, that is, $P ( s ^ { \prime } \mid s , \mathbf { a } ) = P ( s ^ { \prime } \mid$ s) is just a function of the present state for all states $s , s ^ { \prime } \in S$ .
236
+
237
+ ![](images/a20aa384317ec73757b9c06d5b6ef1aed0728c901971924c71eb5202cfeec416.jpg)
238
+ Figure 3: A 2-player MDP which is not potential at every state but which is overall an MPG. While state $s _ { 1 }$ corresponds to a zero-sum game, the states inside the dotted rectangle do form a potential game which can be used to show the MPG property whenever $p _ { 0 }$ does not depend on agents’ actions.
239
+
240
+ C2. Equality of Individual Dummy Terms: $P ( s ^ { \prime } \mid s , \mathbf { a } )$ is arbitrary but the dummy terms of each agent’s immediate rewards are equal across all states, i.e., there exists a function $u ^ { i } : \Delta ( \bar { \mathcal { A } } _ { - i } ) ^ { S } \mathbb { R }$ such that $R _ { i } ( s , a _ { i } , \bar { \mathbf { a } _ { - i } } ) = \phi _ { s } ( \pi _ { i } , \pi _ { - i } ) + u ^ { i } ( \pi _ { - i } )$ , for all states $s \in S$ .
241
+
242
+ 26 If either C1 or $C 2$ are true, then $\mathcal { G }$ is a MPG.
243
+
244
+ Relation to Other Works on MPGs Condition C2 (or variations of it) is also known as statetransitivity and is present as requirement in the existing definitions of potential-like MDPs, see e.g., [16, 19, 20] and along with some additional conditions on the transitions also in [32]. Example 3 shows that such conditions are restrictive, in the sense that they do not capture simple MDPs that intuitively have a cooperative structure. Similarly, Example 2 motivates the study of weighted or ordinal MPGs (cf. Remark 1). As we show, our convergence results about independent policy gradient naturally apply to these classes as well (see Remark 2).
245
+
246
+ 234 Another sufficient condition for a MPD that is potential at every state to be a MPG is that the
247
+ 235 instantaneous rewards of all agents are the same at each state, i.e., that $R _ { i } ( s , a _ { i } , \mathbf { a } _ { - i } ) = \phi _ { s } ( a _ { i } , \mathbf { a } _ { - i } )$
248
+ 236 for all agents $i \in \mathcal N$ , all actions $a _ { i } \in { \mathcal { A } } _ { i }$ and all states $s \in S$ . MDPs that satisfy this condition are
249
+ 237 called Team Markov Games and their analysis trivially boils down to single agent settings. However,
250
+ 238 they constitute the only (to the best of our knowledge) cooperative multi-agent setting (covered by
251
+ 239 MPGs) that have been successfully addressed in terms of convergence of independent policy gradient
252
+ 240 prior to this work, [35].
253
+
254
+ # 241 4 Convergence of Policy Gradient in Markov Potential Games
255
+
256
+ 242 The current section presents the main lemmas and steps for the proof of convergence of (projected)
257
+ 243 policy gradient (and its stochastic variant) to approximate Nash policies in Markov Potential Games
258
+ 244 (MPGs). We analyze these cases using direct and $\alpha$ -greedy parameterization, respectively. All proofs
259
+ 245 and auxiliary materials are deferred to the supplementary material (full version).
260
+ 246 Independent Policy Gradient and Direct Parameterization. We assume that all agents update
261
+ 247 their policies independently according to the projected gradient ascent $( P G A )$ or policy gradient
262
+ 248 algorithm. Independence here refers to the fact that (PGA) requires only local information (each
263
+ 249 agent’s own rewards, actions and view of the environment) to determine the updates. Such protocols
264
+ 250 are naturally motivated in distributed AI settings in which all information about the interacting agents,
265
+ 251 the type of interaction and the agent’s actions (policies) is encoded in the environment of each agent.3
266
+ 252 The PGA algorithm is given by
267
+
268
+ $$
269
+ \pi _ { i } ^ { ( t + 1 ) } : = P _ { \Delta ( A _ { i } ) ^ { S } } \left( \pi _ { i } ^ { ( t ) } + \eta \nabla _ { \pi _ { i } } V _ { \rho } ^ { i } ( \pi ^ { ( t ) } ) \right) ,
270
+ $$
271
+
272
+ for each agent $i \in \mathcal N$ , where $P _ { \Delta } ( \mathcal { A } _ { i } ) ^ { S }$ is the projection onto $\Delta ( \mathcal { A } _ { i } ) ^ { S }$ in the Euclidean norm. Here, the additional argument $t \geq 0$ denotes time. We also assume that all players $i \in \mathcal N$ use direct policy parameterizations, i.e., $\pi _ { i } ( a \mid s ) = x _ { i , s , a }$ , with $x _ { i , s , a } ~ \geq ~ 0$ for all $s \in \mathcal { S } , a \in \mathcal { A } _ { i }$ and $\textstyle \sum _ { a \in { \mathcal { A } } _ { i } } x _ { i , s , a } = 1$ for all $s \in S$ . This parameterization is complete in the sense that any stochastic policy can be represented in this class [1].
273
+
274
+ 258 In practice, agents use projected stochastic gradient ascent (PSGA), according to which, the actual
275
+ 259 gradient, $\nabla _ { \pi _ { i } } V _ { \rho } ^ { i } ( \pi ^ { ( t ) } )$ , is replaced by an estimate thereof that is calculated from a randomly selected
276
+ 260 (yet finite) sample of trajectories of the MDP. This estimate, $\hat { \nabla } _ { \pi _ { i } } ^ { ( t ) }$ may be derived from a single or a
277
+ 261 batch of observations which in expectation behave as the actual gradient. We choose the estimate of
278
+ 262 the gradient of $V _ { \rho } ^ { i }$ to be
279
+
280
+ $$
281
+ \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } = R _ { i } ^ { ( T , t ) } \sum _ { k = 0 } ^ { T } \nabla \log \pi _ { i } ( a _ { k } ^ { ( t ) } \mid s _ { k } ^ { ( t ) } ) ,
282
+ $$
283
+
284
+ where st0 ∼ ρ, and R(T ,t)i 263 $\begin{array} { r } { R _ { i } ^ { ( T , t ) } = \sum _ { k = 0 } ^ { T } r _ { i , t } ^ { k } } \end{array}$ is the sum of rewards of agent $i$ for a bat h of time horizon $T$ 264 along the trajectory generated by the stochastic gradient ascent algorithm at its $t$
285
+
286
+ 265 The direct parameterization is not sufficient to ensure that the variance of the gradient estimator is
287
+ 266 bounded (as policies approach the boundary). In this case, we will require that each agent $i \in \mathcal N$
288
+ 267 uses instead direct parameterization with $\alpha$ -greedy exploration as follows
289
+
290
+ $$
291
+ \pi _ { i } ( a \mid s ) = ( 1 - \alpha _ { i } ) x _ { i , s , a } + \alpha / A _ { i } ,
292
+ $$
293
+
294
+ 268 where $\alpha$ is the exploration parameter for all agents. Under greedy exploration, it can be shown that
295
+ 269 (2) is unbiased and has bounded variance for $\alpha$ -greedy exploration (see Lemma 4.3). The form of
296
+ 270 PSGA is given below:
297
+
298
+ $$
299
+ \pi _ { i } ^ { ( t + 1 ) } : = P _ { \Delta ( A _ { i } ) ^ { S } } \left( \pi _ { i } ^ { ( t ) } + \eta \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } \right) .
300
+ $$
301
+
302
+ 271 Proofs of main results. The first step is to observe that, in MPGs, the (partial) derivatives of
303
+ 272 the value functions and the potential function are equal, i.e., $\nabla _ { \pi _ { i } } V _ { s } ^ { i } ( \pi ) = \bar { \nabla } _ { \pi _ { i } } \Phi ( \pi )$ for all $i \in \mathcal N$
304
+ 273 (property P2 in Proposition B.1). Together with the separability of the projection operator, i.e., the fact
305
+ 274 that projecting independently for each agent $i$ on $\Delta ( \dot { A } _ { i } ) ^ { S }$ is the same as jointly projecting on $\Delta ( { \mathcal { A } } ) ^ { S }$
306
+ 275 (see Lemma 4.1), this establishes that running (PGA) or (PSGA) on each agent’s value function is
307
+ 276 equivalent to running (PGA) or (PSGA) on the potential function $\Phi$ .
308
+
309
+ 277 Based on the above, the next step is to study the stationary points of $\Phi$ . Lemma 4.1 suggests that 278 as long as policy gradient reaches a point $\pi ^ { ( \dot { t } ) }$ with small gradient along the directions in $\Delta ( { \mathcal { A } } ) ^ { S }$ , it must be the case that 279 $\pi ^ { ( t ) }$ is an approximate Nash policy.
310
+
311
+ Lemma 4.1 (Stationarity of $\Phi$ implies Nash). Let √ $\epsilon \geq 0$ , $\pi$ be an $\epsilon$ -stationary point of $\Phi$ (see Definition 4). Then, it holds that $\pi$ is a SD -Nash policy.
312
+
313
+ 282 Lemma 4.1 will be the one of two mains ingredients to establish convergence of (PGA) and (PSGA).
314
+ 283 To prove Lemma 4.1, we will use an agent-wise version of the “Gradient Domination property”, that
315
+ 284 has been shown to hold in single-agent MDPs [1] (see Lemma 4.3). The second main ingredient is
316
+ 285 the fact that $\Phi$ is a $\beta$ -smooth function (its gradient is Lipschitz) with parameter $\begin{array} { r } { \beta = \frac { 2 n \gamma \bar { A } _ { \mathrm { m a x } } } { ( 1 - \gamma ) ^ { 3 } } } \end{array}$ .
317
+ 286 Exact gradients case. Theorem 1.1 (restated formally below) about rates of convergence of (PGA)
318
+ 287 can now be proved following standard arguments (in particular an ascent property, Lemma D.1),
319
+ 288 on analysis of convergence of gradient descent to approximate stationary points in non-convex
320
+ 289 optimization [11]. The ascent lemma suggests that for any $\beta$ -smooth function, $f$ , it holds that
321
+ 290 $\begin{array} { r } { f ( x ^ { \prime } ) - f ( x ) \geq \frac { 1 } { 2 \beta } \left\| x ^ { \prime } - x \right\| _ { 2 } ^ { 2 } } \end{array}$ , where $x ^ { \prime }$ is the next iterate of (PGA). Thus, having shown that $\Phi$ is a
322
+ 291 $\beta$ -smooth function, the ascent lemma implies in our setting that
323
+
324
+ $$
325
+ \Phi _ { \mu } ( \pi ^ { ( t + 1 ) } ) - \Phi _ { \mu } ( \pi ^ { ( t ) } ) \geq \frac { ( 1 - \gamma ) ^ { 3 } } { 4 \gamma A _ { \operatorname* { m a x } } n } \left\| \pi ^ { ( t + 1 ) } - \pi ^ { ( t ) } \right\| _ { 2 } ^ { 2 } .
326
+ $$
327
+
328
+ 292 Putting everything together, we can show the following theorem.
329
+
330
+ 93 Theorem 4.2 (Formal Theorem 1.1, part (a)). Let $\mathcal { G }$ be a MPG and let $s _ { 0 } \in S$ denote an arbitrary 4 initial state. Let also Amax = maxi |Ai|, and set the number of iterations to be T = 16γnD2SAmax(1−γ)52 and the learning rate (step-size) to be 5 $\begin{array} { r } { \eta = \frac { ( 1 - \gamma ) ^ { 3 } } { 2 \gamma A _ { \mathrm { m a x } } n } } \end{array}$ . If the agents run independent projected policy gradient $( P G A )$ starting from arbitrarily initialized policies, then there exists a $t \in \{ 1 , \ldots , T \}$ such that 97 $\pi ^ { ( t ) }$ is an $\epsilon$ -approximate Nash policy.
331
+
332
+ 298 Finite samples case. In the case of finite samples, we analyze (PSGA) on the value $V ^ { i }$ of each
333
+ 299 agent $i$ which (as was the case for PGA) can be shown to be the same as applying projected gradient
334
+ 300 ascent on $\Phi$ . In this case, we choose $\alpha$ -greedy parametrization with $\alpha$ chosen appropriately. The
335
+ 301 key is to get an estimate of the gradient of $\Phi$ (see (2)) at every iterate. Lemma 4.3 argues that the
336
+ 302 estimator of equation (2) is unbiased and has bounded variance.
337
+
338
+ Lemma 4.3 (Unbiased estimator with bounded variance ). It holds that 303 $\hat { \nabla } _ { \pi _ { i } } ^ { ( t ) }$ is an unbiased estimator 304 of $\nabla _ { \pi _ { i } } \Phi$ with bounded variance for all $i \in \mathcal N$ , i.e.,
339
+
340
+ $$
341
+ \mathbb { E } _ { \pi ^ { ( t ) } } \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } = \nabla _ { \pi _ { i } } \Phi _ { \mu } \big ( \pi ^ { ( t ) } \big ) , w i t h \mathbb { E } _ { \pi ^ { ( t ) } } \left. \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } \right. _ { 2 } ^ { 2 } \leq \frac { 2 4 A _ { \operatorname* { m a x } } ^ { 2 } } { \epsilon ( 1 - \gamma ) ^ { 4 } } , f o r a
342
+ $$
343
+
344
+ 305 In this case, $1 - \gamma$ captures the probability for the MDP to terminate after each round since we
345
+ 306 consider finite length trajectories. Using the above, we can now state part (b) of Theorem 1.1.
346
+ 307 Together with Lemma 4.3 and the stationarity-Lemma (Lemma 4.1), i.e., that stationary points of $\Phi$
347
+ 308 are Nash policies, its proof uses the smoothness of $\Phi$ and existing tools for the analysis of stochastic
348
+ 309 gradient descent for non-convex functions.
349
+
350
+ Theorem 4.4 (Formal Theorem 1.1, part (b)). Let $\mathcal { G }$ be a MPG and let $s _ { 0 } \in S$ denote an arbitrary initial state. Let Amax = maxi |Ai|, and set the number of iterations to be T = 48(1−γ)AmaxD4S2δ46γ3 and the learning rate (step-size) to be $\begin{array} { r } { \eta = \frac { \epsilon ^ { 4 } ( 1 - \gamma ) ^ { 3 } \gamma } { 4 8 n D ^ { 2 } A _ { \mathrm { m a x } } ^ { 2 } S \delta ^ { 2 } } } \end{array}$ . If the agents run projected stochastic policy gradient (PSGA) starting from arbitrarily initialized policies and using $\alpha$ -greedy parametrization with $\bar { \alpha } = \epsilon ^ { 2 }$ , then with probability $1 - \delta$ there exists a $t \in \{ 1 , \ldots , T \}$ such that $\pi ^ { ( \dot { t } ) ^ { \dag } }$ is an -approximate Nash policy.
351
+
352
+ 316 Remark 2 (Weighted and ordinal MPGs). We conclude this section with a remark on Weighted and
353
+ 317 Ordinal MPGs (cf. Definition in 1). It is rather straightforward to see that our results carry over for
354
+ 318 WMPGs. The only difference in the running time of (PGA) is to account for the weights (which are
355
+ 319 just multiplicative constants).
356
+ 320 By contrast, the extension to OMPGs is not immediate and the reason is that we cannot prove any
357
+ 321 bound on the smoothness of $\Phi$ in that case. Therefore, we cannot have rates of convergence of policy
358
+ 322 gradient. Nevertheless, it is quite straightforward that (PGA) converges asymptotically to critical
359
+ 323 points (in bounded domains) for differentiable functions. Thus, as long as $\Phi$ is differentiable, it is
360
+ 324 guaranteed that (PGA) will asymptotically converge to a critical point of $\Phi$ . By Lemma 4.1, this
361
+ 325 point will be a Nash policy.
362
+
363
+ # 5 Experiments: Congestion Games
364
+
365
+ We next study the performance of policy gradient in a general class of MPGs that are congestion games at every state (cf. [4]). The setting of the current experiment is illustrated in Figure 4.
366
+
367
+ Experimental setup. There are 8 agents, 4 facilities and 2 states: a safe state and a distancing state. In both states, all agents prefer to be in the same facility with as many other agents as possible (follow the crowd) [12]. In particular, the reward of each agent for being at facility $k = A , B , C , D$ is equal to a predefined positive weight $w _ { k } ^ { \mathrm { s a f e } }$ times the number of agents at that facility. kThe weights satisfy $w _ { A } ^ { \mathrm { s a f e } } < w _ { B } ^ { \mathrm { s a f e } } < w _ { C } ^ { \mathrm { s a f e } } < w _ { D } ^ { \mathrm { s a f e } }$ , i.e., facility $D$ is the most preferable by all agents. If more than $4 = N / 2$ agents find themselves in the same facility, then the game transitions to
368
+
369
+ ![](images/bc27199bfe3990035863fad67552a519702ab7a356182fe9e7f03e1bb6f0311a.jpg)
370
+ Figure 4: The 2-state MPG.
371
+
372
+ 339 340 the distancing state. At tby a constant factor, i.e., $w _ { k } ^ { \mathrm { d i s t } } = w _ { k } ^ { \mathrm { s a f e } } - c$ rd struc, where $c > 0$ mains the same, but the weights are reducedis a (considerably large) constant. To return
373
+ 341 to the safe state, the agents need to achieve maximum distribution over the facilities, i.e., no more
374
+ 342 than $2 = N / 4$ agents may be in the same facility.
375
+ 343 To see that this MDP is a MPG, it suffices to check that every state is a potential game and that
376
+ 344 condition C2 (i.e., equality of individual dummy terms) of Proposition 3.2 is satisfied. The first claim
377
+ 345 is straightforward since at each state, the agents play a congestion game [22, 25]. The second claim
378
+ 346 follows from the fact that the rewards of all agents in all facilities at the distancing state are shifted by
379
+ 347 the same constant amount, $c$ .
380
+
381
+ ![](images/59dd653e089895cc35a146ab47cdb8a7100be3acea91461c0204f46c95334326.jpg)
382
+ Figure 5: Policy gradient in the 2-state MPG with 8 agents of Section 5. In all runs, the 8 agents learn one of the deterministic Nash policies that leads to the optimal distribution among states (left). Individual trajectories of the L1-accuracy and averages (with 1-standard deviation error bars) show fast convergence in all cases (middle and right columns).
383
+
384
+ Paremeters. We perform episodic updates with $T = 2 0$ steps. At each iteration, we estimate the policy gradients using the average of mini-batches of size 20. We use $\gamma = 0 . 9 9$ and a common learning rate $\eta = 0 . 0 0 0 1$ (this $\eta$ is (several orders of magnitude) larger than the theoretical guarantee, $\begin{array} { r } { \eta = \frac { ( 1 - \gamma ) ^ { 3 } } { 2 \gamma A _ { \mathrm { m a x } } n } \approx 1 e - 0 8 } \end{array}$ , of Theorem 4.2). Experiments with randomly generated learning rates (different for each agent), non-deterministic transitions between states and with different weights at each facility in the distancing state (that result in non- MPG structure) produce qualitatively equivalent results and are presented in Appendix E.
385
+
386
+ Results. The left panel of Figure 5 shows that the agents learn the expected Nash profile in both states in all runs. Importantly, this (Nash) policy profile is deterministic in line with Theorem 4.2. The panels in the middle and right columns depict the L1-accuracy in the policy space at each iteration which is defined as the average distance between the current policy and the final policy of all 8 agents, i.e., L1-accuracy $\begin{array} { r } { = \frac { 1 } { N } \sum _ { i \in \mathcal { N } } \left| \pi _ { i } - \pi _ { i } ^ { \mathrm { f n a l } } \right| = \frac { 1 } { N } \sum _ { i \in \mathcal { N } } \sum _ { s } \dot { \sum _ { a } } \left| \tilde { \pi } _ { i } ( a \mid s ) - \pi _ { i } ^ { \mathrm { f n a l } } ( a \stackrel { . } { | } s ) \right| } \end{array}$ .
387
+
388
+ # 0 6 Further Discussion and Conclusions
389
+
390
+ We presented positive results (both structural and algorithmic) about the performance of independent policy gradient in Markov Potential Games (MPGs). We showed that MPGs always possess deterministic Nash policies and that independent policy gradient is guaranteed to converge (polynomially fast in the approximation error) to (deterministic) Nash policy profiles even in the case of finite samples (assuming a direct parameterization with greedy exploration). Our definition of MPGs generalizes prior works on state-based potential MDPs (importantly, by encompassing MDPs that are not necessarily potential at each state) and demonstrates the effectiveness of simultaneous policy gradient in learning Nash policies even without the need to impose additional assumptions on state-based potential functions (cf. [16, 32]). Given these positive results, several interesting questions emerge.
391
+
392
+ 370 Open questions. When it comes to online learning in normal form potential games, it is possible to
393
+ 371 prove that many naturally motivated dynamics converge to deterministic Nash equilibria with certain
394
+ 372 desirable stability properties for most initial conditions [13, 24, 7, 17]. To produce such equilibrium
395
+ 373 selection results, standard Lyapunov arguments do not suffice and one needs to apply more advanced
396
+ 374 techniques such as the Center-Stable-Manifold theorem [15]. Studying such techniques in the context
397
+ 375 of MPGs is a fascinating direction for future work.
398
+ 376 On the other hand, given the complexities of multi-agent, state-based environments, it is highly
399
+ 377 unlikely to expect that practical algorithms can always guarantee convergence to equilibrium. This is
400
+ 378 already the case even for the more restricted settings of normal-form games [34, 2]. Nevertheless,
401
+ 379 deriving strong theoretical guarantees in the sense of cyclic/recurrent orbits, invariant functions [18]
402
+ 380 or social welfare [31] in the context of exact, weighted or ordinal MPGs is another stimulating
403
+ 381 direction for future work. As a measurement of the inefficiency due to lack of coordination between
404
+ 382 agents, it would also be interesting to perform a Price of Anarchy type of analysis [14] as has been
405
+ 383 excessively done in the context of normal-form potential (congestion) games (e.g., [26]).
406
+ 384 Finally, other natural directions for future work involve the study of policy gradient or variations
407
+ 385 thereof (such as Natural Policy Gradient) in MPGs under different policy parametrizations, cf. [1], or
408
+ 386 the study of settings that fruitfully combine tools from both cooperative and competitive settings (as
409
+ 387 in [10, 36, 38]) that have (up to now) produced results in orthogonal directions.
410
+
411
+ # References
412
+
413
+ [1] A. Agarwal, S. M. Kakade, J. D. Lee, and G. Mahajan. Optimality and Approximation with Policy Gradient Methods in Markov Decision Processes. In J. Abernethy and S. Agarwal, editors, Proceedings of 33rd Conference on Learning Theory, volume 125 of PMLR, pages 64–66, 2020.
414
+ [2] Gabriel P Andrade, Rafael Frongillo, and Georgios Piliouras. Learning in matrix games can be arbitrarily complex. arXiv preprint arXiv:2103.03405, 2021. [3] Dimitri P. Bertsekas. Dynamic Programming and Optimal Control. Athena Scientific, 2nd edition, 2000.
415
+ [4] I. Bistritz and N. Bambos. Cooperative multi-player bandit optimization. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 2016–2027. Curran Associates, Inc., 2020.
416
+ [5] Noam Brown and Tuomas Sandholm. Superhuman ai for multiplayer poker. Science, 365(6456):885–890, 2019.
417
+ [6] Lucian Busoniu, Robert Babuska, and Bart De Schutter. A comprehensive survey of multiagent reinforcement learning. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 38(2):156–172, 2008.
418
+ [7] Johanne Cohen, Amélie Héliou, and Panayotis Mertikopoulos. Learning with bandit feedback in potential games. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6372–6381, 2017.
419
+ [8] A. Dafoe, Y. Bachrach, G. Hadfield, E. Horvitz, K. Larson, and T. Graepel. Cooperative ai: machines must learn to find common ground. Nature, 7857:33–36, 2021.
420
+ [9] A. Dafoe, E. Hughes, Y. Bachrach, T. Collins, K. R. McKee, J. Z. Leibo, K. Larson, and T. Graepel. Open Problems in Cooperative AI. arXiv e-prints, December 2020.
421
+ [10] C. Daskalakis, D.J. Foster, and N. Golowich. Independent Policy Gradient Methods for Competitive Reinforcement Learning. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 5527–5540. Curran Associates, Inc., 2020.
422
+ [11] Saeed Ghadimi and Guanghui Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM J. Optim., 23(4):2341–2368, 2013.
423
+ [12] R. Hassin and M. Haviv. To queue or not to queue: Equilibrium behavior in queueing systems. Kluwer Academic Publishers, Boston, USA, 2003.
424
+ [13] Robert Kleinberg, Georgios Piliouras, and Éva Tardos. Multiplicative updates outperform generic no-regret learning in congestion games. In ACM Symposium on Theory of Computing (STOC), 2009.
425
+ [14] E. Koutsoupias and C. Papadimitriou. Worst-case equilibria. In (STACS), pages 404–413. Springer-Verlag, 1999.
426
+ [15] Jason D Lee, Ioannis Panageas, Georgios Piliouras, Max Simchowitz, Michael I Jordan, and Benjamin Recht. First-order methods almost always avoid strict saddle points. Mathematical programming, 176(1):311–337, 2019.
427
+ [16] J. R. Marden. State based potential games. Automatica, 48(12):3075–3088, 2012.
428
+ [17] Ruta Mehta, Ioannis Panageas, and Georgios Piliouras. Natural selection as an inhibitor of genetic diversity: Multiplicative weights updates algorithm and a conjecture of haploid genetics. In Innovations in Theoretical Computer Science, 2015.
429
+ [18] Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2703–2717. SIAM, 2018.
430
+ 435 [19] D. Mguni. Stochastic Potential Games. arXiv e-prints, page arXiv:2005.13527, May 2020.
431
+ 436 [20] D. Mguni, Y. Wu, Y. Du, Y. Yang, Z. Wang, M. Li, Y. Wen, J. Jennings, and J. Wang. Learning in Nonzero-Sum Stochastic Games with Potentials. arXiv e-prints, page arXiv:2103.09284, March 2021. [21] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, Feb 2015. [22] D. Monderer and L. S. Shapley. Potential Games. Games and Economic Behavior, 14(1):124– 143, 1996.
432
+ 446 [23] OpenAI. Openai five. openai.com, 2018.
433
+ 447 [24] Ioannis Panageas, Georgios Piliouras, and Xiao Wang. Multiplicative weights update as a distributed constrained optimization algorithm: Convergence to second-order stationary points almost always. In ICML, 2018.
434
+ [25] T. Roughgarden. Intrinsic robustness of the price of anarchy. J. ACM, 62(5), November 2015.
435
+ 451 [26] Tim Roughgarden and Éva Tardos. How bad is selfish routing? Journal of the ACM (JACM), 49(2):236–259, 2002. [27] L. S. Shapley. Stochastic games. PNAS, 1953. [28] David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, Jan 2016. [29] David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, Timothy Lillicrap, Karen Simonyan, and Demis Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140–1144, 2018. [30] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018.
436
+ 465 [31] Vasilis Syrgkanis, Alekh Agarwal, Haipeng Luo, and Robert E. Schapire. Fast convergence of regularized learning in games. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 2989–2997, Cambridge, MA, USA, 2015. MIT Press. [32] S. Valcarcel Macua, J. Zazo, and S. Zazo. Learning Parametric Closed-Loop Policies for Markov Potential Games. In International Conference on Learning Representations, 2018. [33] Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H. Choi, Richard Powell, Timo Ewalds, Petko Georgiev, Junhyuk Oh, Dan Horgan, Manuel Kroiss, Ivo Danihelka, Aja Huang, Laurent Sifre, Trevor Cai, John P. Agapiou, Max Jaderberg, Alexander S. Vezhnevets, Rémi Leblond, Tobias Pohlen, Valentin Dalibard, David Budden, Yury Sulsky, James Molloy, Tom L. Paine, Caglar Gulcehre, Ziyu Wang, Tobias Pfaff, Yuhuai Wu, Roman Ring, Dani Yogatama, Dario Wünsch, Katrina McKinney, Oliver Smith, Tom Schaul, Timothy Lillicrap, Koray Kavukcuoglu, Demis Hassabis, Chris Apps, and David Silver. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, Nov 2019.
437
+ 480 [34] Emmanouil-Vasileios Vlatakis-Gkaragkounis, Lampros Flokas, Panayotis Mertikopoulos, and Georgios Piliouras. No-regret learning and mixed nash equilibria: They do not mix. In Annual Conference on Neural Information Processing Systems, 2020.
438
+ [35] X. Wang and T. Sandholm. Reinforcement Learning to Play an Optimal Nash Equilibrium in Team Markov Games. In Proceedings of the 15th International Conference on Neural Information Processing Systems, NIPS’02, page 1603–1610, Cambridge, MA, USA, 2002. MIT Press.
439
+ [36] Chen-Yu Wei, Chung-Wei Lee, Mengxiao Zhang, and Haipeng Luo. Last-iterate convergence of decentralized optimistic gradient descent/ascent in infinite-horizon competitive markov games. CoRR, abs/2102.04540, 2021.
440
+ [37] K. Zhang, Z. Yang, and T. Ba¸sar. Multi-Agent Reinforcement Learning: A Selective Overview of Theories and Algorithms. arXiv e-prints, page arXiv:1911.10635, 2019.
441
+ [38] Yulai Zhao, Yuandong Tian, Jason D. Lee, and Simon S. Du. Provably efficient policy gradient methods for two-player zero-sum markov games. CoRR, abs/2102.08903, 2021.
442
+
443
+ # Checklist
444
+
445
+ 1. For all authors...
446
+
447
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] • Our introduction contains an informal presentation of our main results and an overview of our techniques to make the better accessible to a wider audience.
448
+
449
+ (b) Did you describe the limitations of your work? [Yes] • Our work is mainly methodological. Its limitations in terms of the results are clearly described throughout the paper (in the sense that the results hold within the class of MPGs and not for general MDPs) and its limitations in terms of the techniques are described in the technical sections.
450
+
451
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
452
+
453
+ 2. If you are including theoretical results...
454
+
455
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes]
456
+ (b) Did you include complete proofs of all theoretical results? [Yes] • In the main paper, we have included both a high-level technical overview (Introduction) and a sketch of the proof of the main results (Sections 3 and 4). In the supplementary material, we provide detailed proofs.
457
+
458
+ 3. If you ran experiments...
459
+
460
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
461
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
462
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
463
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] • Our experiments can be reproduced in any conventional computer in reasonable time. The code is freely accessible on GitHub (links to the repository are provided in the supplementary materials).
464
+
465
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
466
+
467
+ (a) If your work uses existing assets, did you cite the creators? [N/A]
468
+ (b) Did you mention the license of the assets? [N/A]
469
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
470
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
471
+
472
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
473
+
474
+ 5. If you used crowdsourcing or conducted research with human subjects...
475
+
476
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
477
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
478
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/train/n646avOVJ7q/n646avOVJ7q_content_list.json ADDED
@@ -0,0 +1,1383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Global Convergence of Multi-Agent Policy Gradient in Markov Potential Games ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 184,
8
+ 122,
9
+ 815,
10
+ 171
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous Author(s) \nAffiliation \nAddress \nemail ",
17
+ "bbox": [
18
+ 423,
19
+ 222,
20
+ 578,
21
+ 276
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 313,
32
+ 535,
33
+ 329
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Potential games are arguably one of the most important and widely studied classes of normal form games. They define the archetypal setting of multi-agent coordination as all agent utilities are perfectly aligned with each other via a common potential function. Can this intuitive framework be transplanted in the setting of Markov Games? What are the similarities and differences between multi-agent coordination with and without state dependence? We present a novel definition of Markov Potential Games (MPG) that generalizes prior attempts at capturing complex stateful multi-agent coordination. Counter-intuitively, insights from normal-form potential games do not carry over as MPGs can consist of settings where state-games can be zero-sum games. In the opposite direction, Markov games where every state-game is a potential game are not necessarily MPGs. Nevertheless, MPGs showcase standard desirable properties such as the existence of deterministic Nash policies. In our main technical result, we prove fast convergence of independent policy gradient to Nash policies by adapting recent gradient dominance property arguments developed for single agent MDPs to multi-agent learning settings. ",
40
+ "bbox": [
41
+ 148,
42
+ 344,
43
+ 767,
44
+ 553
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "16 1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 148,
54
+ 579,
55
+ 312,
56
+ 597
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "17 Reinforcement learning (RL) has been a fundamental driver of numerous recent advances in Artificial \n18 Intelligence (AI) applications that range from super-human performance in competitive game-playing \n19 [28, 29, 5] and strategic decision-making in multiple tasks [21, 23, 33] to robotics, autonomous \n20 driving and cyber-physical systems [6, 37]. A core ingredient for the success of single-agent RL \n21 systems, which are typically modelled as Markov Decision Processes (MDPs), is the guarantee of \n22 existence of stationary deterministic optimal policies [3, 30]. This allows for the design of efficient \n23 algorithms that provably converge towards the optimal policy [1]. However, a majority of the above \n24 systems involve multi-agent interactions and despite the notable empirical advancements, there is \n25 a lack of understanding about the theoretical convergence guarantees of the existing multi-agent \n26 reinforcement learning (MARL) algorithms. \n27 The main challenge in the transition from single to multi-agent RL settings is the computation of \n28 Nash policies. A Nash policy for $n > 1$ agents is defined to be a profile of policies $( \\pi _ { 1 } ^ { * } , . . . , \\pi _ { n } ^ { * } )$ so \n29 that by fixing the stationary policies of all agents but $i$ , $\\pi _ { i } ^ { * }$ is an optimal policy for the resulting \n30 single-agent MDP and this is true for all $1 \\leq i \\leq n ^ { \\mathrm { ~ 1 ~ } }$ (see Definition 1). Note that in multi-agent \n31 settings, Nash policies may not be unique in principle. \n32 A common approach for computing Nash policies in MDPs is the use of policy gradient methods. \n33 The significant progress in the analysis of such methods during the last couple of years, including \n34 [1] (and references therein), mainly concerns the single-agent case: the convergence properties of \n35 policy gradient in MARL remain poorly understood. Existing steps towards a theory for multi-agent \n36 settings involve the papers of [10] who show convergence of independent policy gradient to the \n37 optimal policy, for two-agent zero-sum stochastic games, of [36] who improve the result of [10] using \n38 optimistic policy gradient and of [38] who study extensions of Natural Policy Gradient using function \n39 approximation. It is worth noting that the positive results of [10, 36] and [38] depend on the fact that \n40 two-agent stochastic zero-sum games satisfy the “min-max equals max-min” property [27] (even \n41 though the value-function landscape may not be convex-concave, which implies that Von Neumann’s \n42 celebrated minimax theorem may not be applicable). \n43 Model and Informal Statement of Results. While the previous works make progress in competi \n44 tive interactions, i.e., interactions in which gains can only come at the expense of others, MARL in \n45 cooperative settings remains largely under-explored and constitutes one of the current frontiers in AI \n46 research [9, 8]. Based on this, our work is motivated by the following natural question: ",
63
+ "bbox": [
64
+ 147,
65
+ 611,
66
+ 825,
67
+ 750
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "",
74
+ "bbox": [
75
+ 148,
76
+ 756,
77
+ 825,
78
+ 827
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "",
85
+ "bbox": [
86
+ 148,
87
+ 832,
88
+ 825,
89
+ 875
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "",
96
+ "bbox": [
97
+ 147,
98
+ 90,
99
+ 825,
100
+ 203
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 147,
109
+ 218,
110
+ 825,
111
+ 273
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Can we get (provably) fast convergence guarantees for multi-agent RL settings in which cooperation is desirable? ",
118
+ "bbox": [
119
+ 240,
120
+ 279,
121
+ 756,
122
+ 308
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "49 To address this question, we define and study a class of $n$ -agent MDPs that naturally generalize \n50 normal form potential games [22], called Markov Potential Games (MPGs). In words, a multi-agent \n51 MDP is a MPG as long as there exists a (state-dependent) real-valued potential function $\\Phi$ so that if an \n52 agent $i$ changes their policy (and the rest of the agents keep their policy unchanged), the difference in \n53 agent $i$ ’s value/utility, $V ^ { i }$ , is captured by the difference in the value of $\\Phi$ (see Definition 2). Weighted \n54 and ordinal MPGs are defined similar to the normal form counterparts (see Remark 1). \n55 Under our definition, we answer the above motivating question in the affirmative. In particular, we \n56 show that if every agent $i$ independently runs (with simultaneous updates) policy gradient on his \n57 utility/value $V ^ { i }$ , after ${ \\cal O } ( 1 / \\epsilon ^ { 2 } )$ iterations, the system will reach an $\\epsilon$ -approximate Nash policy (see \n58 informal Theorem 1.1 and formal Theorem 4.2). Moreover, we show the finite sample analogue, that \n59 is if every agent $i$ independently runs (with simultaneous updates) stochastic policy gradient, then \n60 with high probability, the system will reach an $\\epsilon$ -approximate Nash policy after ${ \\cal O } ( 1 \\bar { 1 } / \\bar { \\epsilon } ^ { 6 } )$ iterations. \n61 Along the way, we prove several properties about the structure of MPGs and their Nash policies (see \n62 Theorem 1.2 and Section 3). Our results can be summarized in the following two Theorems. \n63 Theorem 1.1 (Convergence of Policy Gradient (Informal)). Consider a MPG with n agents and let \n64 $\\epsilon > 0$ . (a) If each agent i runs independent policy gradient using direct parameterization on his policy \n65 and that the updates are simultaneous, then, the learning dynamics reach an $\\epsilon$ -Nash policy after \n66 $\\mathcal { O } ( 1 / \\epsilon ^ { 2 } )$ iterations. $( b )$ If each agent $i$ runs stochastic policy gradient using greedy parameterization \n67 (see (3)) on his policy and the updates are simultaneous, then the learning dynamics reach an $\\epsilon$ -Nash \n68 policy after $\\bar { \\mathcal { O } } ( \\bar { 1 } / \\epsilon ^ { 6 } )$ iterations. ",
129
+ "bbox": [
130
+ 147,
131
+ 313,
132
+ 825,
133
+ 396
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "",
140
+ "bbox": [
141
+ 147,
142
+ 404,
143
+ 825,
144
+ 487
145
+ ],
146
+ "page_idx": 1
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "",
151
+ "bbox": [
152
+ 155,
153
+ 492,
154
+ 821,
155
+ 521
156
+ ],
157
+ "page_idx": 1
158
+ },
159
+ {
160
+ "type": "text",
161
+ "text": "",
162
+ "bbox": [
163
+ 147,
164
+ 525,
165
+ 825,
166
+ 609
167
+ ],
168
+ "page_idx": 1
169
+ },
170
+ {
171
+ "type": "text",
172
+ "text": "69 This result holds trivially for weighted MPGs and asymptotically also for ordinal MPGs, see Remark 2. ",
173
+ "bbox": [
174
+ 156,
175
+ 619,
176
+ 825,
177
+ 636
178
+ ],
179
+ "page_idx": 1
180
+ },
181
+ {
182
+ "type": "text",
183
+ "text": "Theorem 1.2 (Structural Properties of MPGs). The following facts are true for MPGs with $n$ -agents: ",
184
+ "bbox": [
185
+ 158,
186
+ 640,
187
+ 823,
188
+ 655
189
+ ],
190
+ "page_idx": 1
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "(a) There always exists a Nash policy profile $( \\pi _ { 1 } ^ { * } , \\ldots , \\pi _ { n } ^ { * } )$ so that $\\pi _ { i } ^ { * }$ is deterministic for each agent i (see Theorem 3.1). ",
195
+ "bbox": [
196
+ 165,
197
+ 660,
198
+ 823,
199
+ 688
200
+ ],
201
+ "page_idx": 1
202
+ },
203
+ {
204
+ "type": "text",
205
+ "text": "(b) We can construct MDPs for which each state is an underlying potential game but the MDPs are not MPGs. This can be true regardless of whether the whole MDP is competitive or cooperative in nature (see Examples 1 and 2, respectively). On the opposite side, we can construct MDPs that are MPGs but which include states that are purely competitive (i.e., zero-sum games), see Example 3. (c) We provide sufficient conditions so that a MDP is a MPG. These include cases where each state is an underlying potential game and the transition probabilities are not affected by agents actions or the reward functions satisfy certain regularity conditions between different states (see conditions C1 and C2 in Proposition 3.2). ",
206
+ "bbox": [
207
+ 161,
208
+ 688,
209
+ 825,
210
+ 799
211
+ ],
212
+ "page_idx": 1
213
+ },
214
+ {
215
+ "type": "text",
216
+ "text": "81 Technical Overview. The first challenge in the proof of Theorem 1.1 is that multi-agent settings \n82 (MPGs) do not satisfy the gradient dominance property, which is an important part in the proof of \n83 convergence of policy gradient in single-agent settings [1]. In particular, there is no uniqueness of \n84 optimal policies and as a result, there is not a properly defined notion of value in MPGs (in contrast to \n85 zero-sum stochastic games [10]). On the positive side, we show that agent-wise (i.e., after fixing the \n86 policy of all agents but $i$ ), the value function, $V ^ { i }$ , satisfies the gradient dominance property along the \n87 direction of $\\pi _ { i }$ (policy of agent $i$ ). This can be leveraged to show that every (approximate) stationary \n88 point (Definition 4) of the potential function $\\Phi$ is an (approximate) Nash policy (Lemma 4.1). As a \n89 result, convergence to an approximate Nash policy is established by showing that $\\Phi$ is smooth and \n90 then applying Projected Gradient Ascent (PGA) on $\\Phi$ . This step uses the rather well-known fact that \n91 (PGA) converges to $\\epsilon$ -stationary points in ${ \\cal O } ( 1 / \\epsilon ^ { 2 } )$ iterations for smooth functions. As a result, by \n92 applying PGA on the potential $\\Phi$ , one gets an approximate Nash policy. Our convergence result then \n93 follows by showing that PGA on the potential function, $\\Phi$ , generates the same dynamics as if each \n94 agent $i$ runs independent PGA on their value function, $V ^ { i }$ . \n95 In the case that agents do not have access to exact gradients, we derive a similar result for finite \n96 samples. In this case, we apply Projected Stochastic Gradient Ascent (PSGA) on $\\Phi$ which (as was \n97 the case for PGA) can be shown to be the same as when agents apply PSGA independently on their \n98 individual value functions. The key is to get an unbiased sample for the gradient of the value functions \n99 and prove that it has bounded variance (in terms of the parameters of the MPG). This comes from the \n100 discount factor, $\\gamma$ ; in this case, $1 - \\gamma$ can be interpreted as the probability to terminate the MDP at \n101 a particular state (and $\\gamma$ to continue). This can be used to show that a trajectory of the MDP is an \n102 unbiased sample for the gradient of the value functions. To guarantee that the estimate has bounded \n103 variance, we apply the approach of [10] which requires that agents perform PSGA with $\\alpha$ -greedy \n104 exploration (see (3)). The main idea is that this parameterization stays away from the boundary of the \n105 simplex throughout its trajectory. \n106 Concerning our structural results in Theorem 1.2, the main challenge is (again) the lack of a value in \n107 general multi-agent settings and the dependence of state-transitions (in addition to agents’ rewards) \n108 on agents’ actions. The proof of Theorem 3.1 shows that these issues can be still successfully handled \n109 within the class of MPGs by studying single-agent deviations (to deterministic optimal policies) \n110 which keep the value of the potential constant (at its global maximum). Our examples in this part \n111 show that the class of MPGs can be significantly larger than state based potential games but also that \n112 even simple coordination games may fail to satisfy the (exact) MPG property. ",
217
+ "bbox": [
218
+ 147,
219
+ 814,
220
+ 825,
221
+ 911
222
+ ],
223
+ "page_idx": 1
224
+ },
225
+ {
226
+ "type": "text",
227
+ "text": "",
228
+ "bbox": [
229
+ 145,
230
+ 92,
231
+ 825,
232
+ 188
233
+ ],
234
+ "page_idx": 2
235
+ },
236
+ {
237
+ "type": "text",
238
+ "text": "",
239
+ "bbox": [
240
+ 142,
241
+ 195,
242
+ 825,
243
+ 347
244
+ ],
245
+ "page_idx": 2
246
+ },
247
+ {
248
+ "type": "text",
249
+ "text": "",
250
+ "bbox": [
251
+ 142,
252
+ 353,
253
+ 825,
254
+ 450
255
+ ],
256
+ "page_idx": 2
257
+ },
258
+ {
259
+ "type": "text",
260
+ "text": "113 2 Preliminaries ",
261
+ "text_level": 1,
262
+ "bbox": [
263
+ 142,
264
+ 469,
265
+ 318,
266
+ 487
267
+ ],
268
+ "page_idx": 2
269
+ },
270
+ {
271
+ "type": "text",
272
+ "text": "114 Markov Decision Process (MDP). The following notation is standard and largely follows [1] and \n115 [10]. We consider a setting with $n$ agents who repeatedly select actions in a shared Markov Decision \n116 Process (MDP). The goal of each agent is to maximize their respective value function. Formally, a \n117 MDP is defined as a tuple $\\mathcal { G } = ( \\mathcal { S } , \\mathcal { \\bar { N } } , \\{ A _ { i } , R _ { i } \\} _ { i \\in \\mathcal { N } } , P , \\gamma , \\rho )$ , where $s$ is a finite state space of size \n118 $S = | S |$ , $\\mathcal { N } = \\{ 1 , 2 , \\dots , n \\}$ is a the set of active agents in the MDP and $\\mathbf { \\mathcal { A } } _ { i }$ is a finite action space of \n119 size $A _ { i } = | { \\mathcal { A } } _ { i } |$ for each agent $i \\in \\mathcal N$ with generic element $a _ { i } \\in { \\mathcal { A } } _ { i }$ . We will write $\\begin{array} { r } { \\mathcal { A } = \\prod _ { i \\in \\mathcal { N } } \\mathcal { A } _ { i } } \\end{array}$ \n120 and $\\begin{array} { r } { \\mathcal { A } _ { - i } = \\prod _ { j \\neq i } \\mathcal { A } _ { j } } \\end{array}$ to denote the joint action spaces of all agents and of all agents other than $i$ \n121 with generic elements $\\mathbf { a } = ( a _ { i } ) _ { i \\in \\mathcal { N } }$ and $\\mathbf { a } _ { - \\mathbf { i } } = ( a _ { j } ) _ { j \\neq i }$ , respectively. $R _ { i } : S \\times A \\to [ - 1 , 1 ]$ is the \n122 individual reward function of agent $i \\in \\mathcal N$ , i.e., $R _ { i } \\mathbf { \\bar { ( } } s , a _ { i } , \\mathbf { a } _ { - i } )$ is the instantaneous reward of agent $i$ \n123 when agent $i$ takes action $a _ { i }$ and all other agents take actions $\\mathbf { a } _ { - i }$ at state $s \\in S$ . $P$ is the transition \n124 probability function, for which $P ( s ^ { \\prime } \\mid s , \\bar { \\mathbf { a } } )$ is the probability of transitioning from $s$ to $s ^ { \\prime }$ when \n125 $\\mathbf { a } \\in { \\mathcal { A } }$ is the action profile chosen by the agents. Finally, $\\gamma$ is a discount factor for future rewards of \n126 the MDP, shared by all agents and $\\rho \\in \\Delta ( \\mathcal { S } )$ is a distribution for the initial state at time $t = 0$ . 2 \n127 Whenever time is relevant, we will index the above terms with $t$ . In particular, at each time step \n128 $t \\geq 0$ , all agents observe the state $s _ { t } ~ \\in ~ S$ , select actions $\\mathbf { a } _ { t } ~ = ~ ( a _ { i , t } , \\mathbf { a } _ { - i , t } )$ , receive rewards \n129 $r _ { i , t } : = R _ { i } ( s _ { t } , \\mathbf { a } _ { t } ) , i \\in \\mathcal { N }$ and transition to the next state $s _ { t + 1 } \\sim P ( \\cdot \\mid s _ { t } , \\mathbf { a } _ { t } )$ . We will write \n130 $\\boldsymbol { \\tau } = ( s _ { t } , \\mathbf { a } _ { t } , \\mathbf { r } _ { t } ) _ { t \\geq 0 }$ to denote the trajectories of the system, where $\\mathbf { r } _ { t } : = ( r _ { i , t } ) , i \\in \\mathcal { N }$ . ",
273
+ "bbox": [
274
+ 140,
275
+ 501,
276
+ 825,
277
+ 685
278
+ ],
279
+ "page_idx": 2
280
+ },
281
+ {
282
+ "type": "text",
283
+ "text": "",
284
+ "bbox": [
285
+ 142,
286
+ 690,
287
+ 825,
288
+ 747
289
+ ],
290
+ "page_idx": 2
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "Policies and Value Functions. For each agent $i \\in \\mathcal N$ , a deterministic, stationary policy $\\pi _ { i } : { \\cal { S } } $ $A _ { i }$ specifies the action of agent $i$ at each state $s \\in S$ , i.e., $\\pi _ { i } ( s ) = a _ { i } \\in { \\mathcal { A } } _ { i }$ for each $s \\in S$ . A stochastic, stationary policy $\\pi _ { i } : { \\mathcal { S } } \\Pi _ { i }$ , where $\\Pi _ { i } : = \\Delta ( { \\mathcal { A } } _ { i } ) ^ { S }$ , specifies a probability distribution over the actions of agent $i$ for each state $s \\in S$ . In this case, we will write $a _ { i } \\sim \\pi _ { i } ( \\cdot \\mid s )$ to denote the randomized action of agent $i$ at state $s \\in S$ . As above, we will write $\\pi = ( \\pi _ { i } ) _ { i \\in \\mathcal { N } } \\in \\Pi : =$ $\\times _ { i \\in \\mathcal { N } } \\Delta ( \\mathcal { A } _ { i } ) ^ { S }$ and $\\pi _ { - i } = ( \\pi _ { j } ) _ { i \\neq j \\in N } \\in \\Pi _ { - i } : = \\times _ { i \\neq j \\in N } \\Delta ( \\mathcal { A } _ { j } ) ^ { S }$ to denote the joint policies of all agents and of all agents other than $i$ , respectively. A joint policy $\\pi$ induces a distribution $\\mathrm { P r } ^ { \\pi }$ over trajectories $\\boldsymbol { \\tau } = ( s _ { t } , \\mathbf { a } _ { t } , \\mathbf { r } _ { t } ) _ { t \\geq 0 }$ , where $s _ { 0 }$ is drawn from the initial state distribution $\\rho$ and $a _ { i , t }$ is drawn from $\\pi _ { i } ( \\cdot \\mid s _ { t } )$ for all $i \\in \\mathcal N$ . ",
295
+ "bbox": [
296
+ 158,
297
+ 761,
298
+ 825,
299
+ 887
300
+ ],
301
+ "page_idx": 2
302
+ },
303
+ {
304
+ "type": "text",
305
+ "text": "140 The value function, $V _ { s } ^ { i } : \\Pi \\mathbb { R }$ , gives the expected reward of agent $i \\in \\mathcal N$ when $s _ { 0 } = s$ and the agents draw their actions, 141 $\\mathbf { a } _ { t } = \\left( a _ { i , t } , \\mathbf { a } _ { - i , t } \\right)$ , at time $t \\geq 0$ from policies $\\pi = ( \\pi _ { i } , \\pi _ { - i } )$ ",
306
+ "bbox": [
307
+ 142,
308
+ 90,
309
+ 825,
310
+ 121
311
+ ],
312
+ "page_idx": 3
313
+ },
314
+ {
315
+ "type": "equation",
316
+ "img_path": "images/7d8d5bf72c128bb96cd162dc5bf4b9d9b1e92b3b1726dc22b7d7d1c2f9093299.jpg",
317
+ "text": "$$\nV _ { s } ^ { i } ( \\pi ) : = \\mathbb { E } _ { \\pi } \\left[ \\sum _ { t = 0 } ^ { \\infty } \\gamma ^ { t } r _ { i , t } \\mid s _ { 0 } = s \\right] .\n$$",
318
+ "text_format": "latex",
319
+ "bbox": [
320
+ 369,
321
+ 128,
322
+ 629,
323
+ 156
324
+ ],
325
+ "page_idx": 3
326
+ },
327
+ {
328
+ "type": "text",
329
+ "text": "142 We also denote $V _ { \\rho } ^ { i } ( \\pi ) = \\mathbb { E } _ { s \\sim \\rho } \\left[ V _ { s } ^ { i } ( \\pi ) \\right]$ if the initial state is random and follows distribution $\\rho$ . The \n143 solution concept that we will be focusing on are the Nash Policies. Formally: \n144 Definition 1 ( $\\epsilon$ -Nash Policy). A joint policy $\\pi ^ { * } = ( \\pi _ { i } ^ { * } ) _ { i \\in \\mathcal { N } }$ is an $\\epsilon$ -Nash policy if there exists an $\\epsilon \\geq 0$ \n145 so that for each agent $i \\in \\mathcal N$ , $V _ { s } ^ { i } ( \\pi _ { i } ^ { * } , \\pi _ { - i } ^ { * } ) \\geq V _ { s } ^ { i } ( \\pi _ { i } , \\pi _ { - i } ^ { * } ) - \\epsilon .$ , for all $\\pi _ { i } \\in \\Delta ( \\mathcal { A } _ { i } ) ^ { S }$ , and all $s \\in S$ . \n146 If $\\epsilon = 0$ , then $\\pi ^ { * }$ is a called a Nash policy. In this case, $\\pi _ { i } ^ { * }$ maximizes each agent $i$ ’s value function \n147 for each starting state $s \\in S$ given the policies, $\\pi _ { - i } ^ { * } = ( \\pi _ { j } ^ { * } ) _ { j \\neq i }$ , of all other agents $j \\neq i \\in \\mathcal { N }$ . The \n148 definition of a Nash policy remains the same if $s \\sim \\rho$ (random starting state). ",
330
+ "bbox": [
331
+ 143,
332
+ 164,
333
+ 825,
334
+ 194
335
+ ],
336
+ "page_idx": 3
337
+ },
338
+ {
339
+ "type": "text",
340
+ "text": "",
341
+ "bbox": [
342
+ 142,
343
+ 198,
344
+ 825,
345
+ 270
346
+ ],
347
+ "page_idx": 3
348
+ },
349
+ {
350
+ "type": "text",
351
+ "text": "3 Markov Potential Games ",
352
+ "text_level": 1,
353
+ "bbox": [
354
+ 158,
355
+ 290,
356
+ 415,
357
+ 308
358
+ ],
359
+ "page_idx": 3
360
+ },
361
+ {
362
+ "type": "text",
363
+ "text": "50 We are now ready to define the class of MDPs that we will focus on for the rest of the paper, i.e., \n51 Markov Potential Games. \n52 Definition 2 (Markov Potential Game). A Markov Decision Process (MDP), $\\mathcal { G }$ , is called a Markov \n153 Potential Game (MPG) if there exists a (state-dependent) function $\\Phi _ { s } : \\Pi \\mathbb { R }$ for $s \\in S$ so that ",
364
+ "bbox": [
365
+ 155,
366
+ 321,
367
+ 828,
368
+ 351
369
+ ],
370
+ "page_idx": 3
371
+ },
372
+ {
373
+ "type": "text",
374
+ "text": "",
375
+ "bbox": [
376
+ 151,
377
+ 354,
378
+ 825,
379
+ 385
380
+ ],
381
+ "page_idx": 3
382
+ },
383
+ {
384
+ "type": "equation",
385
+ "img_path": "images/4b90e0a8367eddc68444cfd3cf4fca854d2619ffa23760007b06a045b613fbc1.jpg",
386
+ "text": "$$\n\\Phi _ { s } ( \\pi _ { i } , \\pi _ { - i } ) - \\Phi _ { s } ( \\pi _ { i } ^ { \\prime } , \\pi _ { - i } ) = V _ { s } ^ { i } ( \\pi _ { i } , \\pi _ { - i } ) - V _ { s } ^ { i } ( \\pi _ { i } ^ { \\prime } , \\pi _ { - i } ) ,\n$$",
387
+ "text_format": "latex",
388
+ "bbox": [
389
+ 308,
390
+ 391,
391
+ 687,
392
+ 410
393
+ ],
394
+ "page_idx": 3
395
+ },
396
+ {
397
+ "type": "text",
398
+ "text": "for all agents 154 $i \\in \\mathcal N$ , all states $s \\in S$ and all policies $\\pi _ { i } , \\pi _ { i } ^ { \\prime } \\in \\Pi _ { i } , \\pi _ { - i } \\in \\Pi _ { - i }$ . We should note that 155 by linearity of expectation, it follows that $\\Phi _ { \\rho } ( { \\bar { \\pi } } _ { i } , { \\pi } _ { - i } ) - \\Phi _ { \\rho } ( \\pi _ { i } ^ { \\prime } , { \\pi } _ { - i } ) = V _ { \\rho } ^ { i } ( \\pi _ { i } , { \\pi } _ { - i } ) - V _ { \\rho } ^ { i } ( \\pi _ { i } ^ { \\prime } , { \\pi } _ { - i } )$ , 156 where $\\Phi _ { \\rho } ( \\pi ) : = \\mathbb { E } _ { s \\sim \\rho } \\left[ \\Phi _ { s } ( \\pi ) \\right]$ . ",
399
+ "bbox": [
400
+ 142,
401
+ 417,
402
+ 825,
403
+ 463
404
+ ],
405
+ "page_idx": 3
406
+ },
407
+ {
408
+ "type": "text",
409
+ "text": "157 As in normal-form games, an immediate consequence of this definition is that the value function of \n158 each agent in a MPG can be written as a sum of the potential (common term) and a term that does not \n159 depend on that agent’s policy (dummy term), cf. Proposition B.1 in Appendix B, i.e., for each agent \n160 $i \\in \\mathcal N$ there exists a function $U _ { s } ^ { i } : \\Pi _ { - i } \\xrightarrow { } \\mathbb { R }$ so that $\\begin{array} { r } { \\dot { V } _ { s } ^ { i } ( \\pi ) = \\Phi _ { s } ( \\pi ) \\dot { + } \\dot { U } _ { s } ^ { i } ( \\pi _ { - i } ) } \\end{array}$ , for all $\\pi \\in \\Pi$ . \n161 Remark 1 (Ordinal and Weighted Potential Games). Similar to normal-form games, we may also \n162 define more general notions of MPGs, such as weighted or ordinal MPGs. Specifically, if there exist \n163 positive constants $w _ { i } > 0 , i \\in \\mathcal { N }$ so that ",
410
+ "bbox": [
411
+ 140,
412
+ 473,
413
+ 825,
414
+ 530
415
+ ],
416
+ "page_idx": 3
417
+ },
418
+ {
419
+ "type": "text",
420
+ "text": "",
421
+ "bbox": [
422
+ 142,
423
+ 531,
424
+ 825,
425
+ 574
426
+ ],
427
+ "page_idx": 3
428
+ },
429
+ {
430
+ "type": "equation",
431
+ "img_path": "images/66a3b650ba566a4075cd2cb2173ca9cfcd03aad5de6caf3e9bea387a51637137.jpg",
432
+ "text": "$$\n\\Phi _ { s } ( \\pi _ { i } , \\pi _ { - i } ) - \\Phi _ { s } ( \\pi _ { i } ^ { \\prime } , \\pi _ { - i } ) = w _ { i } ( V _ { s } ^ { i } ( \\pi _ { i } , \\pi _ { - i } ) - V _ { s } ^ { i } ( \\pi _ { i } ^ { \\prime } , \\pi _ { - i } ) ) ,\n$$",
433
+ "text_format": "latex",
434
+ "bbox": [
435
+ 292,
436
+ 580,
437
+ 702,
438
+ 599
439
+ ],
440
+ "page_idx": 3
441
+ },
442
+ {
443
+ "type": "text",
444
+ "text": "164 then $\\mathcal { G }$ is called a Weighted Markov Potential Game (WMPG). If for all agents $i \\in \\mathcal N$ , all states $s \\in S$ and all policies165 $\\pi _ { i } , \\pi _ { i } ^ { \\prime } \\in \\Pi _ { i } , \\pi _ { - i } \\in \\Pi _ { - i }$ , the function $\\Phi _ { s } , s \\in { \\cal S }$ satisfies ",
445
+ "bbox": [
446
+ 143,
447
+ 607,
448
+ 825,
449
+ 637
450
+ ],
451
+ "page_idx": 3
452
+ },
453
+ {
454
+ "type": "equation",
455
+ "img_path": "images/dff8326634859984143e9c3877bfb0f316defe0c52812008843b8254f8358bfd.jpg",
456
+ "text": "$$\n\\Phi _ { s } ( \\pi _ { i } , \\pi _ { - i } ) - \\Phi _ { s } ( \\pi _ { i } ^ { \\prime } , \\pi _ { - i } ) > 0 \\Longleftrightarrow V _ { s } ^ { i } ( \\pi _ { i } , \\pi _ { - i } ) - V _ { s } ^ { i } ( \\pi _ { i } ^ { \\prime } , \\pi _ { - i } ) > 0 ,\n$$",
457
+ "text_format": "latex",
458
+ "bbox": [
459
+ 264,
460
+ 643,
461
+ 732,
462
+ 664
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "166 then the MPD, $\\mathcal { G }$ , is called an Ordinal Markov Potential Game (OMPG). ",
469
+ "bbox": [
470
+ 147,
471
+ 671,
472
+ 648,
473
+ 686
474
+ ],
475
+ "page_idx": 3
476
+ },
477
+ {
478
+ "type": "text",
479
+ "text": "167 Similarly to normal-form games, such classes are naturally motivated also in the setting of multi-agent \n168 MDPs. As Example 2 shows, even simple potential-like settings, i.e., settings in which coordination is \n169 desirable for all agents, may fail to be exact MPGs (but may still be ordinal or weighted MPGs). From \n170 our current perspective, ordinal and weighted MPGs remain relevant, since our main convergence \n171 results on the convergence of policy gradient carry over (in an exact or asymptotic sense) also in these \n172 classes of games (see Remark 2). As with the rest of the proofs (and technical details) of Section 3, \n173 the proof of Theorem 3.1 is provided in Appendix B. \n174 Existence of Deterministic Nash Policies in MPGs. Before studying which types of MDPs are \n175 captured by Definition 2, we first show that MPGs always possess deterministic Nash policies \n176 (similarly to their single-state counterparts, i.e., normal-form potential games [22]). This is established \n177 in Theorem 3.1, which settles part (a) of Theorem 1.2 \n178 Theorem 3.1 (Deterministic Optimal Policy Profile). Let $\\mathcal { G }$ be a Markov Potential Game (MPG). \n179 Then, there exists a Nash policy $\\pi ^ { * } \\in \\Delta ( \\mathcal { A } ) ^ { \\bar { S } }$ which is deterministic, i.e., for each agent $i \\in \\mathcal N$ and \n180 each state $s \\in S$ , there exists an action $a _ { i } \\in { \\mathcal { A } } _ { i }$ so that $\\pi _ { i } ^ { * } ( a _ { i } \\mid s ) = 1$ . \n181 Starting from an arbitrary Nash policy profile that is also a global maximizer of the potential function, \n182 the proof of Theorem 3.1 (which is deferred to Appendix B) relies on an iterative reduction process \n183 of its non-deterministic components. At each iteration, we isolate an agent $i \\in \\mathcal N$ , and find a \n184 deterministic (optimal) policy for that agent in the (single-agent) MDP in which the policies of all \n185 other agents but $i$ remain fixed. The important observation is that the resulting profile is again a \n186 global maximizer of the potential and hence, a Nash policy profile. This argument critically relies on \n187 the MPG structure and does not seem directly generalizable to MDPs that do not satisfy Definition 2. \n188 Sufficient Conditions for MPGs. Based on the above, it is tempting to think that MDPs which \n189 are potential at every state (meaning that the immediate rewards at every state are captured by a \n190 (normal-form) potential game at that state) are trivially MPGs. As we show in Examples 1 and 2, \n191 this intuition fails in the most straightforward way: we can construct simple MDPs that are potential \n192 at every state but which are purely competitive (do not possess a deterministic Nash policy) overall \n193 (Example 1) or which are cooperative in nature overall but which do not possess an exact potential \n194 function (Example 2). \n195 Example 1. Consider the MDP in Figure 1. To show that $\\mathcal { G }$ is not a MPG, it suffices to show that \n196 it cannot have a deterministic optimal policy as should be the case according to Theorem 3.1. To \n197 obtain a contradiction, assume that agent $A$ is using a deterministic action $\\bar { a _ { A } ^ { 0 } } \\in \\{ 0 , 1 \\}$ at state 0. \n198 Then, agent $B$ , who prefers to move to state 1, will optimize their utility by choosing the action \n199 $a _ { B } ^ { 0 } \\in \\{ \\bar { 0 } , 1 \\}$ that yields $a _ { A } ^ { 0 } \\oplus a _ { B } ^ { 0 } = 1$ . In other words, given any deterministic action of agent $A$ at \n200 state 0, agent can choose an action that always moves the sequence of play to state 1. Thus, such \n201 an action cannot be optimal for agent $A$ which implies that the MDP $\\mathcal { G }$ does not have a deterministic \n202 optimal policy profile as claimed. \n203 Intuitively, competition arises in Example 1 because the two agents play a game of matching pennies \n204 in terms of the states that they prefer (which can be determined by the actions that they choose) \n205 despite the fact that the immediate rewards at each state are determined by normal form potential \n206 games. Example 2 shows that a state-based potential game may fail to be a MPG even if agents have \n207 similar preferences over states. ",
480
+ "bbox": [
481
+ 140,
482
+ 694,
483
+ 826,
484
+ 792
485
+ ],
486
+ "page_idx": 3
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "",
491
+ "bbox": [
492
+ 142,
493
+ 808,
494
+ 825,
495
+ 864
496
+ ],
497
+ "page_idx": 3
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "",
502
+ "bbox": [
503
+ 142,
504
+ 868,
505
+ 825,
506
+ 912
507
+ ],
508
+ "page_idx": 3
509
+ },
510
+ {
511
+ "type": "image",
512
+ "img_path": "images/25eebbe0f304e858ef30497a0424e6699307c9f7b0026115cdb5c3ff8ee0e999.jpg",
513
+ "image_caption": [
514
+ "Figure 1: A MDP with normal-from potential games at each state (shown in matrix form below each state) but which is not a MPG due to conflicting preferences over states. "
515
+ ],
516
+ "image_footnote": [],
517
+ "bbox": [
518
+ 199,
519
+ 69,
520
+ 468,
521
+ 185
522
+ ],
523
+ "page_idx": 4
524
+ },
525
+ {
526
+ "type": "image",
527
+ "img_path": "images/379464134e3be8df89bc525d5bad6939a364104c0c03c5ada11db47cde21f67e.jpg",
528
+ "image_caption": [
529
+ "Figure 2: A MDP with normal-form potential games at each state which is an ordinal MPG but not a MPG despite common preferences over states. "
530
+ ],
531
+ "image_footnote": [],
532
+ "bbox": [
533
+ 527,
534
+ 71,
535
+ 810,
536
+ 185
537
+ ],
538
+ "page_idx": 4
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "",
543
+ "bbox": [
544
+ 140,
545
+ 276,
546
+ 825,
547
+ 375
548
+ ],
549
+ "page_idx": 4
550
+ },
551
+ {
552
+ "type": "text",
553
+ "text": "",
554
+ "bbox": [
555
+ 140,
556
+ 387,
557
+ 825,
558
+ 484
559
+ ],
560
+ "page_idx": 4
561
+ },
562
+ {
563
+ "type": "text",
564
+ "text": "",
565
+ "bbox": [
566
+ 140,
567
+ 487,
568
+ 825,
569
+ 598
570
+ ],
571
+ "page_idx": 4
572
+ },
573
+ {
574
+ "type": "text",
575
+ "text": "",
576
+ "bbox": [
577
+ 143,
578
+ 608,
579
+ 825,
580
+ 676
581
+ ],
582
+ "page_idx": 4
583
+ },
584
+ {
585
+ "type": "text",
586
+ "text": "Example 2. In $s _ { 0 }$ the agents play a Battle of the Sexes game and hence a potential game, while in $s _ { 1 }$ they receive no reward (which is trivially a potential game). A simple calculation shows that there is not an exact potential function due to the dependence of the transitions on agents’ actions (thus, this MDP is not a MPG). However, in the case of Example 2, it is straightforward to show that the game is an ordinal potential game, cf. Appendix B.1. ",
587
+ "bbox": [
588
+ 168,
589
+ 680,
590
+ 825,
591
+ 750
592
+ ],
593
+ "page_idx": 4
594
+ },
595
+ {
596
+ "type": "text",
597
+ "text": "13 The previous discussion focuses on games that consist of normal-form potential games at every state, \n14 which leaves an important question unanswered: are there games which are not potential at every \n15 state but which are captured by the current definition of MPGs? Example 3 (see Figure 3) answers \n16 this question affirmatively. Together with Example 1, this settles the claim in Theorem 1.2, part (b). ",
598
+ "bbox": [
599
+ 151,
600
+ 758,
601
+ 825,
602
+ 815
603
+ ],
604
+ "page_idx": 4
605
+ },
606
+ {
607
+ "type": "text",
608
+ "text": "Proposition 3.2 (Sufficient Conditions for MPGs). Consider a MDP $\\mathcal { G }$ in which every state $s \\in S$ is a potential game, i.e., the immediate rewards $R ( s , \\mathbf { a } ) = ( R _ { i } ( s , \\mathbf { a } ) ) _ { i \\in \\mathcal { N } }$ for each state $s \\in S$ are captured by the utilities of a potential game with potential function $\\phi _ { s }$ . Additionally, assume that one of the following conditions holds ",
609
+ "bbox": [
610
+ 174,
611
+ 818,
612
+ 823,
613
+ 873
614
+ ],
615
+ "page_idx": 4
616
+ },
617
+ {
618
+ "type": "text",
619
+ "text": "C1. Agent-Independent Transitions: $P ( s ^ { \\prime } \\mid s , \\mathbf { a } )$ does not depend on a, that is, $P ( s ^ { \\prime } \\mid s , \\mathbf { a } ) = P ( s ^ { \\prime } \\mid$ s) is just a function of the present state for all states $s , s ^ { \\prime } \\in S$ . ",
620
+ "bbox": [
621
+ 171,
622
+ 882,
623
+ 820,
624
+ 911
625
+ ],
626
+ "page_idx": 4
627
+ },
628
+ {
629
+ "type": "image",
630
+ "img_path": "images/a20aa384317ec73757b9c06d5b6ef1aed0728c901971924c71eb5202cfeec416.jpg",
631
+ "image_caption": [
632
+ "Figure 3: A 2-player MDP which is not potential at every state but which is overall an MPG. While state $s _ { 1 }$ corresponds to a zero-sum game, the states inside the dotted rectangle do form a potential game which can be used to show the MPG property whenever $p _ { 0 }$ does not depend on agents’ actions. "
633
+ ],
634
+ "image_footnote": [],
635
+ "bbox": [
636
+ 269,
637
+ 65,
638
+ 725,
639
+ 166
640
+ ],
641
+ "page_idx": 5
642
+ },
643
+ {
644
+ "type": "text",
645
+ "text": "C2. Equality of Individual Dummy Terms: $P ( s ^ { \\prime } \\mid s , \\mathbf { a } )$ is arbitrary but the dummy terms of each agent’s immediate rewards are equal across all states, i.e., there exists a function $u ^ { i } : \\Delta ( \\bar { \\mathcal { A } } _ { - i } ) ^ { S } \\mathbb { R }$ such that $R _ { i } ( s , a _ { i } , \\bar { \\mathbf { a } _ { - i } } ) = \\phi _ { s } ( \\pi _ { i } , \\pi _ { - i } ) + u ^ { i } ( \\pi _ { - i } )$ , for all states $s \\in S$ . ",
646
+ "bbox": [
647
+ 176,
648
+ 234,
649
+ 826,
650
+ 279
651
+ ],
652
+ "page_idx": 5
653
+ },
654
+ {
655
+ "type": "text",
656
+ "text": "26 If either C1 or $C 2$ are true, then $\\mathcal { G }$ is a MPG. ",
657
+ "bbox": [
658
+ 153,
659
+ 289,
660
+ 467,
661
+ 304
662
+ ],
663
+ "page_idx": 5
664
+ },
665
+ {
666
+ "type": "text",
667
+ "text": "Relation to Other Works on MPGs Condition C2 (or variations of it) is also known as statetransitivity and is present as requirement in the existing definitions of potential-like MDPs, see e.g., [16, 19, 20] and along with some additional conditions on the transitions also in [32]. Example 3 shows that such conditions are restrictive, in the sense that they do not capture simple MDPs that intuitively have a cooperative structure. Similarly, Example 2 motivates the study of weighted or ordinal MPGs (cf. Remark 1). As we show, our convergence results about independent policy gradient naturally apply to these classes as well (see Remark 2). ",
668
+ "bbox": [
669
+ 171,
670
+ 320,
671
+ 825,
672
+ 417
673
+ ],
674
+ "page_idx": 5
675
+ },
676
+ {
677
+ "type": "text",
678
+ "text": "234 Another sufficient condition for a MPD that is potential at every state to be a MPG is that the \n235 instantaneous rewards of all agents are the same at each state, i.e., that $R _ { i } ( s , a _ { i } , \\mathbf { a } _ { - i } ) = \\phi _ { s } ( a _ { i } , \\mathbf { a } _ { - i } )$ \n236 for all agents $i \\in \\mathcal N$ , all actions $a _ { i } \\in { \\mathcal { A } } _ { i }$ and all states $s \\in S$ . MDPs that satisfy this condition are \n237 called Team Markov Games and their analysis trivially boils down to single agent settings. However, \n238 they constitute the only (to the best of our knowledge) cooperative multi-agent setting (covered by \n239 MPGs) that have been successfully addressed in terms of convergence of independent policy gradient \n240 prior to this work, [35]. ",
679
+ "bbox": [
680
+ 140,
681
+ 424,
682
+ 826,
683
+ 522
684
+ ],
685
+ "page_idx": 5
686
+ },
687
+ {
688
+ "type": "text",
689
+ "text": "241 4 Convergence of Policy Gradient in Markov Potential Games ",
690
+ "text_level": 1,
691
+ "bbox": [
692
+ 147,
693
+ 541,
694
+ 705,
695
+ 560
696
+ ],
697
+ "page_idx": 5
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "242 The current section presents the main lemmas and steps for the proof of convergence of (projected) \n243 policy gradient (and its stochastic variant) to approximate Nash policies in Markov Potential Games \n244 (MPGs). We analyze these cases using direct and $\\alpha$ -greedy parameterization, respectively. All proofs \n245 and auxiliary materials are deferred to the supplementary material (full version). \n246 Independent Policy Gradient and Direct Parameterization. We assume that all agents update \n247 their policies independently according to the projected gradient ascent $( P G A )$ or policy gradient \n248 algorithm. Independence here refers to the fact that (PGA) requires only local information (each \n249 agent’s own rewards, actions and view of the environment) to determine the updates. Such protocols \n250 are naturally motivated in distributed AI settings in which all information about the interacting agents, \n251 the type of interaction and the agent’s actions (policies) is encoded in the environment of each agent.3 \n252 The PGA algorithm is given by ",
702
+ "bbox": [
703
+ 140,
704
+ 574,
705
+ 825,
706
+ 631
707
+ ],
708
+ "page_idx": 5
709
+ },
710
+ {
711
+ "type": "text",
712
+ "text": "",
713
+ "bbox": [
714
+ 140,
715
+ 647,
716
+ 825,
717
+ 744
718
+ ],
719
+ "page_idx": 5
720
+ },
721
+ {
722
+ "type": "equation",
723
+ "img_path": "images/1ae3d8b76a9240a62574925a612eac227db4d759b56f347c024f8fe2704a095d.jpg",
724
+ "text": "$$\n\\pi _ { i } ^ { ( t + 1 ) } : = P _ { \\Delta ( A _ { i } ) ^ { S } } \\left( \\pi _ { i } ^ { ( t ) } + \\eta \\nabla _ { \\pi _ { i } } V _ { \\rho } ^ { i } ( \\pi ^ { ( t ) } ) \\right) ,\n$$",
725
+ "text_format": "latex",
726
+ "bbox": [
727
+ 349,
728
+ 752,
729
+ 647,
730
+ 780
731
+ ],
732
+ "page_idx": 5
733
+ },
734
+ {
735
+ "type": "text",
736
+ "text": "for each agent $i \\in \\mathcal N$ , where $P _ { \\Delta } ( \\mathcal { A } _ { i } ) ^ { S }$ is the projection onto $\\Delta ( \\mathcal { A } _ { i } ) ^ { S }$ in the Euclidean norm. Here, the additional argument $t \\geq 0$ denotes time. We also assume that all players $i \\in \\mathcal N$ use direct policy parameterizations, i.e., $\\pi _ { i } ( a \\mid s ) = x _ { i , s , a }$ , with $x _ { i , s , a } ~ \\geq ~ 0$ for all $s \\in \\mathcal { S } , a \\in \\mathcal { A } _ { i }$ and $\\textstyle \\sum _ { a \\in { \\mathcal { A } } _ { i } } x _ { i , s , a } = 1$ for all $s \\in S$ . This parameterization is complete in the sense that any stochastic policy can be represented in this class [1]. ",
737
+ "bbox": [
738
+ 160,
739
+ 787,
740
+ 825,
741
+ 859
742
+ ],
743
+ "page_idx": 5
744
+ },
745
+ {
746
+ "type": "text",
747
+ "text": "258 In practice, agents use projected stochastic gradient ascent (PSGA), according to which, the actual \n259 gradient, $\\nabla _ { \\pi _ { i } } V _ { \\rho } ^ { i } ( \\pi ^ { ( t ) } )$ , is replaced by an estimate thereof that is calculated from a randomly selected \n260 (yet finite) sample of trajectories of the MDP. This estimate, $\\hat { \\nabla } _ { \\pi _ { i } } ^ { ( t ) }$ may be derived from a single or a \n261 batch of observations which in expectation behave as the actual gradient. We choose the estimate of \n262 the gradient of $V _ { \\rho } ^ { i }$ to be ",
748
+ "bbox": [
749
+ 138,
750
+ 90,
751
+ 826,
752
+ 169
753
+ ],
754
+ "page_idx": 6
755
+ },
756
+ {
757
+ "type": "equation",
758
+ "img_path": "images/6c5634957545174cc5a7e4ce9cf9c3ee3b359bb96a578357b6f0b1b17ae02feb.jpg",
759
+ "text": "$$\n\\hat { \\nabla } _ { \\pi _ { i } } ^ { ( t ) } = R _ { i } ^ { ( T , t ) } \\sum _ { k = 0 } ^ { T } \\nabla \\log \\pi _ { i } ( a _ { k } ^ { ( t ) } \\mid s _ { k } ^ { ( t ) } ) ,\n$$",
760
+ "text_format": "latex",
761
+ "bbox": [
762
+ 369,
763
+ 167,
764
+ 627,
765
+ 212
766
+ ],
767
+ "page_idx": 6
768
+ },
769
+ {
770
+ "type": "text",
771
+ "text": "where st0 ∼ ρ, and R(T ,t)i 263 $\\begin{array} { r } { R _ { i } ^ { ( T , t ) } = \\sum _ { k = 0 } ^ { T } r _ { i , t } ^ { k } } \\end{array}$ is the sum of rewards of agent $i$ for a bat h of time horizon $T$ 264 along the trajectory generated by the stochastic gradient ascent algorithm at its $t$ ",
772
+ "bbox": [
773
+ 145,
774
+ 215,
775
+ 825,
776
+ 247
777
+ ],
778
+ "page_idx": 6
779
+ },
780
+ {
781
+ "type": "text",
782
+ "text": "265 The direct parameterization is not sufficient to ensure that the variance of the gradient estimator is \n266 bounded (as policies approach the boundary). In this case, we will require that each agent $i \\in \\mathcal N$ \n267 uses instead direct parameterization with $\\alpha$ -greedy exploration as follows ",
783
+ "bbox": [
784
+ 147,
785
+ 251,
786
+ 826,
787
+ 295
788
+ ],
789
+ "page_idx": 6
790
+ },
791
+ {
792
+ "type": "equation",
793
+ "img_path": "images/554153526d2b542dcee1f7e74100f2f2252374977b587a7a5dbfdcbed60ce922.jpg",
794
+ "text": "$$\n\\pi _ { i } ( a \\mid s ) = ( 1 - \\alpha _ { i } ) x _ { i , s , a } + \\alpha / A _ { i } ,\n$$",
795
+ "text_format": "latex",
796
+ "bbox": [
797
+ 382,
798
+ 300,
799
+ 614,
800
+ 318
801
+ ],
802
+ "page_idx": 6
803
+ },
804
+ {
805
+ "type": "text",
806
+ "text": "268 where $\\alpha$ is the exploration parameter for all agents. Under greedy exploration, it can be shown that \n269 (2) is unbiased and has bounded variance for $\\alpha$ -greedy exploration (see Lemma 4.3). The form of \n270 PSGA is given below: ",
807
+ "bbox": [
808
+ 140,
809
+ 321,
810
+ 826,
811
+ 364
812
+ ],
813
+ "page_idx": 6
814
+ },
815
+ {
816
+ "type": "equation",
817
+ "img_path": "images/d6dfd2b9f0736aa3dded5e96d95a057d109e6b4ac7c860689a6915c3650fa667.jpg",
818
+ "text": "$$\n\\pi _ { i } ^ { ( t + 1 ) } : = P _ { \\Delta ( A _ { i } ) ^ { S } } \\left( \\pi _ { i } ^ { ( t ) } + \\eta \\hat { \\nabla } _ { \\pi _ { i } } ^ { ( t ) } \\right) .\n$$",
819
+ "text_format": "latex",
820
+ "bbox": [
821
+ 377,
822
+ 363,
823
+ 619,
824
+ 390
825
+ ],
826
+ "page_idx": 6
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "271 Proofs of main results. The first step is to observe that, in MPGs, the (partial) derivatives of \n272 the value functions and the potential function are equal, i.e., $\\nabla _ { \\pi _ { i } } V _ { s } ^ { i } ( \\pi ) = \\bar { \\nabla } _ { \\pi _ { i } } \\Phi ( \\pi )$ for all $i \\in \\mathcal N$ \n273 (property P2 in Proposition B.1). Together with the separability of the projection operator, i.e., the fact \n274 that projecting independently for each agent $i$ on $\\Delta ( \\dot { A } _ { i } ) ^ { S }$ is the same as jointly projecting on $\\Delta ( { \\mathcal { A } } ) ^ { S }$ \n275 (see Lemma 4.1), this establishes that running (PGA) or (PSGA) on each agent’s value function is \n276 equivalent to running (PGA) or (PSGA) on the potential function $\\Phi$ . ",
831
+ "bbox": [
832
+ 140,
833
+ 401,
834
+ 825,
835
+ 486
836
+ ],
837
+ "page_idx": 6
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "277 Based on the above, the next step is to study the stationary points of $\\Phi$ . Lemma 4.1 suggests that 278 as long as policy gradient reaches a point $\\pi ^ { ( \\dot { t } ) }$ with small gradient along the directions in $\\Delta ( { \\mathcal { A } } ) ^ { S }$ , it must be the case that 279 $\\pi ^ { ( t ) }$ is an approximate Nash policy. ",
842
+ "bbox": [
843
+ 142,
844
+ 491,
845
+ 825,
846
+ 537
847
+ ],
848
+ "page_idx": 6
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "Lemma 4.1 (Stationarity of $\\Phi$ implies Nash). Let √ $\\epsilon \\geq 0$ , $\\pi$ be an $\\epsilon$ -stationary point of $\\Phi$ (see Definition 4). Then, it holds that $\\pi$ is a SD\u000f -Nash policy. ",
853
+ "bbox": [
854
+ 161,
855
+ 540,
856
+ 823,
857
+ 577
858
+ ],
859
+ "page_idx": 6
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "282 Lemma 4.1 will be the one of two mains ingredients to establish convergence of (PGA) and (PSGA). \n283 To prove Lemma 4.1, we will use an agent-wise version of the “Gradient Domination property”, that \n284 has been shown to hold in single-agent MDPs [1] (see Lemma 4.3). The second main ingredient is \n285 the fact that $\\Phi$ is a $\\beta$ -smooth function (its gradient is Lipschitz) with parameter $\\begin{array} { r } { \\beta = \\frac { 2 n \\gamma \\bar { A } _ { \\mathrm { m a x } } } { ( 1 - \\gamma ) ^ { 3 } } } \\end{array}$ . \n286 Exact gradients case. Theorem 1.1 (restated formally below) about rates of convergence of (PGA) \n287 can now be proved following standard arguments (in particular an ascent property, Lemma D.1), \n288 on analysis of convergence of gradient descent to approximate stationary points in non-convex \n289 optimization [11]. The ascent lemma suggests that for any $\\beta$ -smooth function, $f$ , it holds that \n290 $\\begin{array} { r } { f ( x ^ { \\prime } ) - f ( x ) \\geq \\frac { 1 } { 2 \\beta } \\left\\| x ^ { \\prime } - x \\right\\| _ { 2 } ^ { 2 } } \\end{array}$ , where $x ^ { \\prime }$ is the next iterate of (PGA). Thus, having shown that $\\Phi$ is a \n291 $\\beta$ -smooth function, the ascent lemma implies in our setting that ",
864
+ "bbox": [
865
+ 140,
866
+ 584,
867
+ 826,
868
+ 645
869
+ ],
870
+ "page_idx": 6
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "",
875
+ "bbox": [
876
+ 138,
877
+ 660,
878
+ 826,
879
+ 750
880
+ ],
881
+ "page_idx": 6
882
+ },
883
+ {
884
+ "type": "equation",
885
+ "img_path": "images/6fc7ef2d5ae60cd91376c26b109866815223379f673ef3d38c745ad83edf6a76.jpg",
886
+ "text": "$$\n\\Phi _ { \\mu } ( \\pi ^ { ( t + 1 ) } ) - \\Phi _ { \\mu } ( \\pi ^ { ( t ) } ) \\geq \\frac { ( 1 - \\gamma ) ^ { 3 } } { 4 \\gamma A _ { \\operatorname* { m a x } } n } \\left\\| \\pi ^ { ( t + 1 ) } - \\pi ^ { ( t ) } \\right\\| _ { 2 } ^ { 2 } .\n$$",
887
+ "text_format": "latex",
888
+ "bbox": [
889
+ 313,
890
+ 763,
891
+ 684,
892
+ 799
893
+ ],
894
+ "page_idx": 6
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "292 Putting everything together, we can show the following theorem. ",
899
+ "bbox": [
900
+ 148,
901
+ 806,
902
+ 598,
903
+ 821
904
+ ],
905
+ "page_idx": 6
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "93 Theorem 4.2 (Formal Theorem 1.1, part (a)). Let $\\mathcal { G }$ be a MPG and let $s _ { 0 } \\in S$ denote an arbitrary 4 initial state. Let also Amax = maxi |Ai|, and set the number of iterations to be T = 16γnD2SAmax(1−γ)5\u000f2 and the learning rate (step-size) to be 5 $\\begin{array} { r } { \\eta = \\frac { ( 1 - \\gamma ) ^ { 3 } } { 2 \\gamma A _ { \\mathrm { m a x } } n } } \\end{array}$ . If the agents run independent projected policy gradient $( P G A )$ starting from arbitrarily initialized policies, then there exists a $t \\in \\{ 1 , \\ldots , T \\}$ such that 97 $\\pi ^ { ( t ) }$ is an $\\epsilon$ -approximate Nash policy. ",
910
+ "bbox": [
911
+ 155,
912
+ 825,
913
+ 826,
914
+ 912
915
+ ],
916
+ "page_idx": 6
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "298 Finite samples case. In the case of finite samples, we analyze (PSGA) on the value $V ^ { i }$ of each \n299 agent $i$ which (as was the case for PGA) can be shown to be the same as applying projected gradient \n300 ascent on $\\Phi$ . In this case, we choose $\\alpha$ -greedy parametrization with $\\alpha$ chosen appropriately. The \n301 key is to get an estimate of the gradient of $\\Phi$ (see (2)) at every iterate. Lemma 4.3 argues that the \n302 estimator of equation (2) is unbiased and has bounded variance. ",
921
+ "bbox": [
922
+ 140,
923
+ 90,
924
+ 825,
925
+ 161
926
+ ],
927
+ "page_idx": 7
928
+ },
929
+ {
930
+ "type": "text",
931
+ "text": "Lemma 4.3 (Unbiased estimator with bounded variance ). It holds that 303 $\\hat { \\nabla } _ { \\pi _ { i } } ^ { ( t ) }$ is an unbiased estimator 304 of $\\nabla _ { \\pi _ { i } } \\Phi$ with bounded variance for all $i \\in \\mathcal N$ , i.e., ",
932
+ "bbox": [
933
+ 145,
934
+ 165,
935
+ 825,
936
+ 195
937
+ ],
938
+ "page_idx": 7
939
+ },
940
+ {
941
+ "type": "equation",
942
+ "img_path": "images/86100967870e150c7ec8aaf91caa78005ffbe200f735b32225e6454c19c37ac3.jpg",
943
+ "text": "$$\n\\mathbb { E } _ { \\pi ^ { ( t ) } } \\hat { \\nabla } _ { \\pi _ { i } } ^ { ( t ) } = \\nabla _ { \\pi _ { i } } \\Phi _ { \\mu } \\big ( \\pi ^ { ( t ) } \\big ) , w i t h \\mathbb { E } _ { \\pi ^ { ( t ) } } \\left. \\hat { \\nabla } _ { \\pi _ { i } } ^ { ( t ) } \\right. _ { 2 } ^ { 2 } \\leq \\frac { 2 4 A _ { \\operatorname* { m a x } } ^ { 2 } } { \\epsilon ( 1 - \\gamma ) ^ { 4 } } , f o r a\n$$",
944
+ "text_format": "latex",
945
+ "bbox": [
946
+ 243,
947
+ 200,
948
+ 687,
949
+ 234
950
+ ],
951
+ "page_idx": 7
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "305 In this case, $1 - \\gamma$ captures the probability for the MDP to terminate after each round since we \n306 consider finite length trajectories. Using the above, we can now state part (b) of Theorem 1.1. \n307 Together with Lemma 4.3 and the stationarity-Lemma (Lemma 4.1), i.e., that stationary points of $\\Phi$ \n308 are Nash policies, its proof uses the smoothness of $\\Phi$ and existing tools for the analysis of stochastic \n309 gradient descent for non-convex functions. ",
956
+ "bbox": [
957
+ 140,
958
+ 243,
959
+ 825,
960
+ 314
961
+ ],
962
+ "page_idx": 7
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "Theorem 4.4 (Formal Theorem 1.1, part (b)). Let $\\mathcal { G }$ be a MPG and let $s _ { 0 } \\in S$ denote an arbitrary initial state. Let Amax = maxi |Ai|, and set the number of iterations to be T = 48(1−γ)AmaxD4S2δ4\u000f6γ3 and the learning rate (step-size) to be $\\begin{array} { r } { \\eta = \\frac { \\epsilon ^ { 4 } ( 1 - \\gamma ) ^ { 3 } \\gamma } { 4 8 n D ^ { 2 } A _ { \\mathrm { m a x } } ^ { 2 } S \\delta ^ { 2 } } } \\end{array}$ . If the agents run projected stochastic policy gradient (PSGA) starting from arbitrarily initialized policies and using $\\alpha$ -greedy parametrization with $\\bar { \\alpha } = \\epsilon ^ { 2 }$ , then with probability $1 - \\delta$ there exists a $t \\in \\{ 1 , \\ldots , T \\}$ such that $\\pi ^ { ( \\dot { t } ) ^ { \\dag } }$ is an \u000f-approximate Nash policy. ",
967
+ "bbox": [
968
+ 169,
969
+ 316,
970
+ 825,
971
+ 415
972
+ ],
973
+ "page_idx": 7
974
+ },
975
+ {
976
+ "type": "text",
977
+ "text": "316 Remark 2 (Weighted and ordinal MPGs). We conclude this section with a remark on Weighted and \n317 Ordinal MPGs (cf. Definition in 1). It is rather straightforward to see that our results carry over for \n318 WMPGs. The only difference in the running time of (PGA) is to account for the weights (which are \n319 just multiplicative constants). \n320 By contrast, the extension to OMPGs is not immediate and the reason is that we cannot prove any \n321 bound on the smoothness of $\\Phi$ in that case. Therefore, we cannot have rates of convergence of policy \n322 gradient. Nevertheless, it is quite straightforward that (PGA) converges asymptotically to critical \n323 points (in bounded domains) for differentiable functions. Thus, as long as $\\Phi$ is differentiable, it is \n324 guaranteed that (PGA) will asymptotically converge to a critical point of $\\Phi$ . By Lemma 4.1, this \n325 point will be a Nash policy. ",
978
+ "bbox": [
979
+ 140,
980
+ 417,
981
+ 825,
982
+ 474
983
+ ],
984
+ "page_idx": 7
985
+ },
986
+ {
987
+ "type": "text",
988
+ "text": "",
989
+ "bbox": [
990
+ 142,
991
+ 479,
992
+ 825,
993
+ 564
994
+ ],
995
+ "page_idx": 7
996
+ },
997
+ {
998
+ "type": "text",
999
+ "text": "5 Experiments: Congestion Games ",
1000
+ "text_level": 1,
1001
+ "bbox": [
1002
+ 168,
1003
+ 582,
1004
+ 480,
1005
+ 599
1006
+ ],
1007
+ "page_idx": 7
1008
+ },
1009
+ {
1010
+ "type": "text",
1011
+ "text": "We next study the performance of policy gradient in a general class of MPGs that are congestion games at every state (cf. [4]). The setting of the current experiment is illustrated in Figure 4. ",
1012
+ "bbox": [
1013
+ 171,
1014
+ 613,
1015
+ 823,
1016
+ 641
1017
+ ],
1018
+ "page_idx": 7
1019
+ },
1020
+ {
1021
+ "type": "text",
1022
+ "text": "Experimental setup. There are 8 agents, 4 facilities and 2 states: a safe state and a distancing state. In both states, all agents prefer to be in the same facility with as many other agents as possible (follow the crowd) [12]. In particular, the reward of each agent for being at facility $k = A , B , C , D$ is equal to a predefined positive weight $w _ { k } ^ { \\mathrm { s a f e } }$ times the number of agents at that facility. kThe weights satisfy $w _ { A } ^ { \\mathrm { s a f e } } < w _ { B } ^ { \\mathrm { s a f e } } < w _ { C } ^ { \\mathrm { s a f e } } < w _ { D } ^ { \\mathrm { s a f e } }$ , i.e., facility $D$ is the most preferable by all agents. If more than $4 = N / 2$ agents find themselves in the same facility, then the game transitions to ",
1023
+ "bbox": [
1024
+ 171,
1025
+ 655,
1026
+ 601,
1027
+ 781
1028
+ ],
1029
+ "page_idx": 7
1030
+ },
1031
+ {
1032
+ "type": "image",
1033
+ "img_path": "images/bc27199bfe3990035863fad67552a519702ab7a356182fe9e7f03e1bb6f0311a.jpg",
1034
+ "image_caption": [
1035
+ "Figure 4: The 2-state MPG. "
1036
+ ],
1037
+ "image_footnote": [],
1038
+ "bbox": [
1039
+ 617,
1040
+ 657,
1041
+ 820,
1042
+ 753
1043
+ ],
1044
+ "page_idx": 7
1045
+ },
1046
+ {
1047
+ "type": "text",
1048
+ "text": "339 340 the distancing state. At tby a constant factor, i.e., $w _ { k } ^ { \\mathrm { d i s t } } = w _ { k } ^ { \\mathrm { s a f e } } - c$ rd struc, where $c > 0$ mains the same, but the weights are reducedis a (considerably large) constant. To return \n341 to the safe state, the agents need to achieve maximum distribution over the facilities, i.e., no more \n342 than $2 = N / 4$ agents may be in the same facility. \n343 To see that this MDP is a MPG, it suffices to check that every state is a potential game and that \n344 condition C2 (i.e., equality of individual dummy terms) of Proposition 3.2 is satisfied. The first claim \n345 is straightforward since at each state, the agents play a congestion game [22, 25]. The second claim \n346 follows from the fact that the rewards of all agents in all facilities at the distancing state are shifted by \n347 the same constant amount, $c$ . ",
1049
+ "bbox": [
1050
+ 140,
1051
+ 781,
1052
+ 825,
1053
+ 835
1054
+ ],
1055
+ "page_idx": 7
1056
+ },
1057
+ {
1058
+ "type": "text",
1059
+ "text": "",
1060
+ "bbox": [
1061
+ 140,
1062
+ 842,
1063
+ 825,
1064
+ 911
1065
+ ],
1066
+ "page_idx": 7
1067
+ },
1068
+ {
1069
+ "type": "image",
1070
+ "img_path": "images/59dd653e089895cc35a146ab47cdb8a7100be3acea91461c0204f46c95334326.jpg",
1071
+ "image_caption": [
1072
+ "Figure 5: Policy gradient in the 2-state MPG with 8 agents of Section 5. In all runs, the 8 agents learn one of the deterministic Nash policies that leads to the optimal distribution among states (left). Individual trajectories of the L1-accuracy and averages (with 1-standard deviation error bars) show fast convergence in all cases (middle and right columns). "
1073
+ ],
1074
+ "image_footnote": [],
1075
+ "bbox": [
1076
+ 176,
1077
+ 89,
1078
+ 815,
1079
+ 204
1080
+ ],
1081
+ "page_idx": 8
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "Paremeters. We perform episodic updates with $T = 2 0$ steps. At each iteration, we estimate the policy gradients using the average of mini-batches of size 20. We use $\\gamma = 0 . 9 9$ and a common learning rate $\\eta = 0 . 0 0 0 1$ (this $\\eta$ is (several orders of magnitude) larger than the theoretical guarantee, $\\begin{array} { r } { \\eta = \\frac { ( 1 - \\gamma ) ^ { 3 } } { 2 \\gamma A _ { \\mathrm { m a x } } n } \\approx 1 e - 0 8 } \\end{array}$ , of Theorem 4.2). Experiments with randomly generated learning rates (different for each agent), non-deterministic transitions between states and with different weights at each facility in the distancing state (that result in non- MPG structure) produce qualitatively equivalent results and are presented in Appendix E. ",
1086
+ "bbox": [
1087
+ 168,
1088
+ 277,
1089
+ 825,
1090
+ 382
1091
+ ],
1092
+ "page_idx": 8
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "Results. The left panel of Figure 5 shows that the agents learn the expected Nash profile in both states in all runs. Importantly, this (Nash) policy profile is deterministic in line with Theorem 4.2. The panels in the middle and right columns depict the L1-accuracy in the policy space at each iteration which is defined as the average distance between the current policy and the final policy of all 8 agents, i.e., L1-accuracy $\\begin{array} { r } { = \\frac { 1 } { N } \\sum _ { i \\in \\mathcal { N } } \\left| \\pi _ { i } - \\pi _ { i } ^ { \\mathrm { f n a l } } \\right| = \\frac { 1 } { N } \\sum _ { i \\in \\mathcal { N } } \\sum _ { s } \\dot { \\sum _ { a } } \\left| \\tilde { \\pi } _ { i } ( a \\mid s ) - \\pi _ { i } ^ { \\mathrm { f n a l } } ( a \\stackrel { . } { | } s ) \\right| } \\end{array}$ . ",
1097
+ "bbox": [
1098
+ 173,
1099
+ 388,
1100
+ 825,
1101
+ 460
1102
+ ],
1103
+ "page_idx": 8
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "0 6 Further Discussion and Conclusions ",
1108
+ "text_level": 1,
1109
+ "bbox": [
1110
+ 158,
1111
+ 477,
1112
+ 508,
1113
+ 494
1114
+ ],
1115
+ "page_idx": 8
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "We presented positive results (both structural and algorithmic) about the performance of independent policy gradient in Markov Potential Games (MPGs). We showed that MPGs always possess deterministic Nash policies and that independent policy gradient is guaranteed to converge (polynomially fast in the approximation error) to (deterministic) Nash policy profiles even in the case of finite samples (assuming a direct parameterization with greedy exploration). Our definition of MPGs generalizes prior works on state-based potential MDPs (importantly, by encompassing MDPs that are not necessarily potential at each state) and demonstrates the effectiveness of simultaneous policy gradient in learning Nash policies even without the need to impose additional assumptions on state-based potential functions (cf. [16, 32]). Given these positive results, several interesting questions emerge. ",
1120
+ "bbox": [
1121
+ 171,
1122
+ 508,
1123
+ 825,
1124
+ 633
1125
+ ],
1126
+ "page_idx": 8
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "370 Open questions. When it comes to online learning in normal form potential games, it is possible to \n371 prove that many naturally motivated dynamics converge to deterministic Nash equilibria with certain \n372 desirable stability properties for most initial conditions [13, 24, 7, 17]. To produce such equilibrium \n373 selection results, standard Lyapunov arguments do not suffice and one needs to apply more advanced \n374 techniques such as the Center-Stable-Manifold theorem [15]. Studying such techniques in the context \n375 of MPGs is a fascinating direction for future work. \n376 On the other hand, given the complexities of multi-agent, state-based environments, it is highly \n377 unlikely to expect that practical algorithms can always guarantee convergence to equilibrium. This is \n378 already the case even for the more restricted settings of normal-form games [34, 2]. Nevertheless, \n379 deriving strong theoretical guarantees in the sense of cyclic/recurrent orbits, invariant functions [18] \n380 or social welfare [31] in the context of exact, weighted or ordinal MPGs is another stimulating \n381 direction for future work. As a measurement of the inefficiency due to lack of coordination between \n382 agents, it would also be interesting to perform a Price of Anarchy type of analysis [14] as has been \n383 excessively done in the context of normal-form potential (congestion) games (e.g., [26]). \n384 Finally, other natural directions for future work involve the study of policy gradient or variations \n385 thereof (such as Natural Policy Gradient) in MPGs under different policy parametrizations, cf. [1], or \n386 the study of settings that fruitfully combine tools from both cooperative and competitive settings (as \n387 in [10, 36, 38]) that have (up to now) produced results in orthogonal directions. ",
1131
+ "bbox": [
1132
+ 140,
1133
+ 648,
1134
+ 825,
1135
+ 733
1136
+ ],
1137
+ "page_idx": 8
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "",
1142
+ "bbox": [
1143
+ 140,
1144
+ 738,
1145
+ 825,
1146
+ 849
1147
+ ],
1148
+ "page_idx": 8
1149
+ },
1150
+ {
1151
+ "type": "text",
1152
+ "text": "",
1153
+ "bbox": [
1154
+ 142,
1155
+ 856,
1156
+ 823,
1157
+ 911
1158
+ ],
1159
+ "page_idx": 8
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "References ",
1164
+ "text_level": 1,
1165
+ "bbox": [
1166
+ 145,
1167
+ 90,
1168
+ 267,
1169
+ 106
1170
+ ],
1171
+ "page_idx": 9
1172
+ },
1173
+ {
1174
+ "type": "text",
1175
+ "text": "[1] A. Agarwal, S. M. Kakade, J. D. Lee, and G. Mahajan. Optimality and Approximation with Policy Gradient Methods in Markov Decision Processes. In J. Abernethy and S. Agarwal, editors, Proceedings of 33rd Conference on Learning Theory, volume 125 of PMLR, pages 64–66, 2020. \n[2] Gabriel P Andrade, Rafael Frongillo, and Georgios Piliouras. Learning in matrix games can be arbitrarily complex. arXiv preprint arXiv:2103.03405, 2021. [3] Dimitri P. Bertsekas. Dynamic Programming and Optimal Control. Athena Scientific, 2nd edition, 2000. \n[4] I. Bistritz and N. Bambos. Cooperative multi-player bandit optimization. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 2016–2027. Curran Associates, Inc., 2020. \n[5] Noam Brown and Tuomas Sandholm. Superhuman ai for multiplayer poker. Science, 365(6456):885–890, 2019. \n[6] Lucian Busoniu, Robert Babuska, and Bart De Schutter. A comprehensive survey of multiagent reinforcement learning. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 38(2):156–172, 2008. \n[7] Johanne Cohen, Amélie Héliou, and Panayotis Mertikopoulos. Learning with bandit feedback in potential games. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6372–6381, 2017. \n[8] A. Dafoe, Y. Bachrach, G. Hadfield, E. Horvitz, K. Larson, and T. Graepel. Cooperative ai: machines must learn to find common ground. Nature, 7857:33–36, 2021. \n[9] A. Dafoe, E. Hughes, Y. Bachrach, T. Collins, K. R. McKee, J. Z. Leibo, K. Larson, and T. Graepel. Open Problems in Cooperative AI. arXiv e-prints, December 2020. \n[10] C. Daskalakis, D.J. Foster, and N. Golowich. Independent Policy Gradient Methods for Competitive Reinforcement Learning. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 5527–5540. Curran Associates, Inc., 2020. \n[11] Saeed Ghadimi and Guanghui Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM J. Optim., 23(4):2341–2368, 2013. \n[12] R. Hassin and M. Haviv. To queue or not to queue: Equilibrium behavior in queueing systems. Kluwer Academic Publishers, Boston, USA, 2003. \n[13] Robert Kleinberg, Georgios Piliouras, and Éva Tardos. Multiplicative updates outperform generic no-regret learning in congestion games. In ACM Symposium on Theory of Computing (STOC), 2009. \n[14] E. Koutsoupias and C. Papadimitriou. Worst-case equilibria. In (STACS), pages 404–413. Springer-Verlag, 1999. \n[15] Jason D Lee, Ioannis Panageas, Georgios Piliouras, Max Simchowitz, Michael I Jordan, and Benjamin Recht. First-order methods almost always avoid strict saddle points. Mathematical programming, 176(1):311–337, 2019. \n[16] J. R. Marden. State based potential games. Automatica, 48(12):3075–3088, 2012. \n[17] Ruta Mehta, Ioannis Panageas, and Georgios Piliouras. Natural selection as an inhibitor of genetic diversity: Multiplicative weights updates algorithm and a conjecture of haploid genetics. In Innovations in Theoretical Computer Science, 2015. \n[18] Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2703–2717. SIAM, 2018. \n435 [19] D. Mguni. Stochastic Potential Games. arXiv e-prints, page arXiv:2005.13527, May 2020. \n436 [20] D. Mguni, Y. Wu, Y. Du, Y. Yang, Z. Wang, M. Li, Y. Wen, J. Jennings, and J. Wang. Learning in Nonzero-Sum Stochastic Games with Potentials. arXiv e-prints, page arXiv:2103.09284, March 2021. [21] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, Feb 2015. [22] D. Monderer and L. S. Shapley. Potential Games. Games and Economic Behavior, 14(1):124– 143, 1996. \n446 [23] OpenAI. Openai five. openai.com, 2018. \n447 [24] Ioannis Panageas, Georgios Piliouras, and Xiao Wang. Multiplicative weights update as a distributed constrained optimization algorithm: Convergence to second-order stationary points almost always. In ICML, 2018. \n[25] T. Roughgarden. Intrinsic robustness of the price of anarchy. J. ACM, 62(5), November 2015. \n451 [26] Tim Roughgarden and Éva Tardos. How bad is selfish routing? Journal of the ACM (JACM), 49(2):236–259, 2002. [27] L. S. Shapley. Stochastic games. PNAS, 1953. [28] David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, Jan 2016. [29] David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, Timothy Lillicrap, Karen Simonyan, and Demis Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140–1144, 2018. [30] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018. \n465 [31] Vasilis Syrgkanis, Alekh Agarwal, Haipeng Luo, and Robert E. Schapire. Fast convergence of regularized learning in games. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 2989–2997, Cambridge, MA, USA, 2015. MIT Press. [32] S. Valcarcel Macua, J. Zazo, and S. Zazo. Learning Parametric Closed-Loop Policies for Markov Potential Games. In International Conference on Learning Representations, 2018. [33] Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H. Choi, Richard Powell, Timo Ewalds, Petko Georgiev, Junhyuk Oh, Dan Horgan, Manuel Kroiss, Ivo Danihelka, Aja Huang, Laurent Sifre, Trevor Cai, John P. Agapiou, Max Jaderberg, Alexander S. Vezhnevets, Rémi Leblond, Tobias Pohlen, Valentin Dalibard, David Budden, Yury Sulsky, James Molloy, Tom L. Paine, Caglar Gulcehre, Ziyu Wang, Tobias Pfaff, Yuhuai Wu, Roman Ring, Dani Yogatama, Dario Wünsch, Katrina McKinney, Oliver Smith, Tom Schaul, Timothy Lillicrap, Koray Kavukcuoglu, Demis Hassabis, Chris Apps, and David Silver. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, Nov 2019. \n480 [34] Emmanouil-Vasileios Vlatakis-Gkaragkounis, Lampros Flokas, Panayotis Mertikopoulos, and Georgios Piliouras. No-regret learning and mixed nash equilibria: They do not mix. In Annual Conference on Neural Information Processing Systems, 2020. \n[35] X. Wang and T. Sandholm. Reinforcement Learning to Play an Optimal Nash Equilibrium in Team Markov Games. In Proceedings of the 15th International Conference on Neural Information Processing Systems, NIPS’02, page 1603–1610, Cambridge, MA, USA, 2002. MIT Press. \n[36] Chen-Yu Wei, Chung-Wei Lee, Mengxiao Zhang, and Haipeng Luo. Last-iterate convergence of decentralized optimistic gradient descent/ascent in infinite-horizon competitive markov games. CoRR, abs/2102.04540, 2021. \n[37] K. Zhang, Z. Yang, and T. Ba¸sar. Multi-Agent Reinforcement Learning: A Selective Overview of Theories and Algorithms. arXiv e-prints, page arXiv:1911.10635, 2019. \n[38] Yulai Zhao, Yuandong Tian, Jason D. Lee, and Simon S. Du. Provably efficient policy gradient methods for two-player zero-sum markov games. CoRR, abs/2102.08903, 2021. ",
1176
+ "bbox": [
1177
+ 158,
1178
+ 94,
1179
+ 828,
1180
+ 925
1181
+ ],
1182
+ "page_idx": 9
1183
+ },
1184
+ {
1185
+ "type": "text",
1186
+ "text": "",
1187
+ "bbox": [
1188
+ 150,
1189
+ 59,
1190
+ 828,
1191
+ 924
1192
+ ],
1193
+ "page_idx": 10
1194
+ },
1195
+ {
1196
+ "type": "text",
1197
+ "text": "",
1198
+ "bbox": [
1199
+ 151,
1200
+ 90,
1201
+ 826,
1202
+ 273
1203
+ ],
1204
+ "page_idx": 11
1205
+ },
1206
+ {
1207
+ "type": "text",
1208
+ "text": "Checklist ",
1209
+ "text_level": 1,
1210
+ "bbox": [
1211
+ 169,
1212
+ 296,
1213
+ 253,
1214
+ 313
1215
+ ],
1216
+ "page_idx": 11
1217
+ },
1218
+ {
1219
+ "type": "text",
1220
+ "text": "1. For all authors... ",
1221
+ "bbox": [
1222
+ 214,
1223
+ 324,
1224
+ 339,
1225
+ 338
1226
+ ],
1227
+ "page_idx": 11
1228
+ },
1229
+ {
1230
+ "type": "text",
1231
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] • Our introduction contains an informal presentation of our main results and an overview of our techniques to make the better accessible to a wider audience. ",
1232
+ "bbox": [
1233
+ 240,
1234
+ 342,
1235
+ 825,
1236
+ 400
1237
+ ],
1238
+ "page_idx": 11
1239
+ },
1240
+ {
1241
+ "type": "text",
1242
+ "text": "(b) Did you describe the limitations of your work? [Yes] • Our work is mainly methodological. Its limitations in terms of the results are clearly described throughout the paper (in the sense that the results hold within the class of MPGs and not for general MDPs) and its limitations in terms of the techniques are described in the technical sections. ",
1243
+ "bbox": [
1244
+ 236,
1245
+ 401,
1246
+ 614,
1247
+ 415
1248
+ ],
1249
+ "page_idx": 11
1250
+ },
1251
+ {
1252
+ "type": "text",
1253
+ "text": "",
1254
+ "bbox": [
1255
+ 243,
1256
+ 416,
1257
+ 823,
1258
+ 472
1259
+ ],
1260
+ "page_idx": 11
1261
+ },
1262
+ {
1263
+ "type": "text",
1264
+ "text": "(c) Did you discuss any potential negative societal impacts of your work? [N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1265
+ "bbox": [
1266
+ 238,
1267
+ 474,
1268
+ 769,
1269
+ 489
1270
+ ],
1271
+ "page_idx": 11
1272
+ },
1273
+ {
1274
+ "type": "text",
1275
+ "text": "",
1276
+ "bbox": [
1277
+ 240,
1278
+ 491,
1279
+ 823,
1280
+ 520
1281
+ ],
1282
+ "page_idx": 11
1283
+ },
1284
+ {
1285
+ "type": "text",
1286
+ "text": "2. If you are including theoretical results... ",
1287
+ "bbox": [
1288
+ 215,
1289
+ 523,
1290
+ 493,
1291
+ 537
1292
+ ],
1293
+ "page_idx": 11
1294
+ },
1295
+ {
1296
+ "type": "text",
1297
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] \n(b) Did you include complete proofs of all theoretical results? [Yes] • In the main paper, we have included both a high-level technical overview (Introduction) and a sketch of the proof of the main results (Sections 3 and 4). In the supplementary material, we provide detailed proofs. ",
1298
+ "bbox": [
1299
+ 238,
1300
+ 541,
1301
+ 825,
1302
+ 616
1303
+ ],
1304
+ "page_idx": 11
1305
+ },
1306
+ {
1307
+ "type": "text",
1308
+ "text": "3. If you ran experiments... ",
1309
+ "bbox": [
1310
+ 214,
1311
+ 619,
1312
+ 393,
1313
+ 633
1314
+ ],
1315
+ "page_idx": 11
1316
+ },
1317
+ {
1318
+ "type": "text",
1319
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] • Our experiments can be reproduced in any conventional computer in reasonable time. The code is freely accessible on GitHub (links to the repository are provided in the supplementary materials). ",
1320
+ "bbox": [
1321
+ 238,
1322
+ 638,
1323
+ 825,
1324
+ 799
1325
+ ],
1326
+ "page_idx": 11
1327
+ },
1328
+ {
1329
+ "type": "text",
1330
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1331
+ "bbox": [
1332
+ 215,
1333
+ 803,
1334
+ 823,
1335
+ 818
1336
+ ],
1337
+ "page_idx": 11
1338
+ },
1339
+ {
1340
+ "type": "text",
1341
+ "text": "(a) If your work uses existing assets, did you cite the creators? [N/A] \n(b) Did you mention the license of the assets? [N/A] \n(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] ",
1342
+ "bbox": [
1343
+ 236,
1344
+ 821,
1345
+ 825,
1346
+ 912
1347
+ ],
1348
+ "page_idx": 11
1349
+ },
1350
+ {
1351
+ "type": "text",
1352
+ "text": "(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
1353
+ "bbox": [
1354
+ 235,
1355
+ 92,
1356
+ 825,
1357
+ 119
1358
+ ],
1359
+ "page_idx": 12
1360
+ },
1361
+ {
1362
+ "type": "text",
1363
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1364
+ "bbox": [
1365
+ 214,
1366
+ 123,
1367
+ 707,
1368
+ 138
1369
+ ],
1370
+ "page_idx": 12
1371
+ },
1372
+ {
1373
+ "type": "text",
1374
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1375
+ "bbox": [
1376
+ 236,
1377
+ 142,
1378
+ 826,
1379
+ 232
1380
+ ],
1381
+ "page_idx": 12
1382
+ }
1383
+ ]
parse/train/n646avOVJ7q/n646avOVJ7q_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/n646avOVJ7q/n646avOVJ7q_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/r1lWUoA9FQ/r1lWUoA9FQ.md ADDED
@@ -0,0 +1,596 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ARE ADVERSARIAL EXAMPLES INEVITABLE?
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ A wide range of defenses have been proposed to harden neural networks against adversarial attacks. However, a pattern has emerged in which the majority of adversarial defenses are quickly broken by new attacks. Given the lack of success at generating robust defenses, we are led to ask a fundamental question: Are adversarial attacks inevitable?
8
+
9
+ This paper analyzes adversarial examples from a theoretical perspective, and identifies fundamental bounds on the susceptibility of a classifier to adversarial attacks. We show that, for certain classes of problems, adversarial examples are inescapable. Using experiments, we explore the implications of theoretical guarantees for real-world problems and discuss how factors such as dimensionality and image complexity limit a classifier’s robustness against adversarial examples.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ A number of adversarial attacks on neural networks have been recently proposed. To counter these attacks, a number of authors have proposed a range of defenses. However, these defenses are often quickly broken by new and revised attacks. Given the lack of success at generating robust defenses, we are led to ask a fundamental question: Are adversarial attacks inevitable?
14
+
15
+ In this paper, we identify a broad class of problems for which adversarial examples cannot be avoided. We also derive fundamental limits on the susceptibility of a classifier to adversarial attacks that depend on properties of the data distribution as well as the dimensionality of the dataset.
16
+
17
+ Adversarial examples occur when a small perturbation to an image changes its class label. There are different ways of measuring what it means for a perturbation to be “small”; as such, our analysis considers a range of different norms. While the $\ell _ { \infty }$ -norm is commonly used, adversarial examples can be crafted in any $\ell _ { p }$ -norm (see Figure 1). We will see that the choice of norm can have a dramatic effect on the strength of theoretical guarantees for the existence of adversarial examples. Our analysis also extends to the $\ell _ { 0 }$ -norm, which yields “sparse” adversarial examples that only perturb a small subset of image pixels (Figure 2).
18
+
19
+ ![](images/aab2cca670abfcf6574b1081a02b9c665e958d75ffd647bfbdbb2224763319d9.jpg)
20
+ Figure 1: Adversarial examples with different norm constraints formed via the projected gradient method (Madry et al., 2017) on Resnet50, along with the distance between the base image and the adversarial example, and the top class label.
21
+
22
+ As a simple example result, consider a classification problem with $n$ -dimensional images with pixels scaled between 0 and 1 (in this case images live inside the unit hypercube). If the image classes each occupy a fraction of the cube greater than $\textstyle { \frac { 1 } { 2 } } \exp ( - \pi \epsilon ^ { 2 } )$ , then images exist that are susceptible to adversarial perturbations of $\ell _ { 2 }$ -norm at most $\epsilon$ . Note that $\epsilon = 1 0$ was used in Figure 1, and larger values are typical for larger images.
23
+
24
+ Finally, in Section 8, we explore the causes of adversarial susceptibility in real datasets, and the effect of dimensionality. We present an example image class for which there is no fundamental link between dimensionality and robustness, and argue that the data distribution, and not dimensionality, is the primary cause of adversarial susceptibility.
25
+
26
+ # 1.1 BACKGROUND: A BRIEF HISTORY OF ADVERSARIAL EXAMPLES
27
+
28
+ Adversarial examples, first demonstrated in Szegedy et al. (2013) and Biggio et al. (2013), change the label of an image using small and often imperceptible perturbations to its pixels. A number of defenses have been proposed to harden networks against attacks, but historically, these defenses have been quickly broken. Adversarial training, one of the earliest defenses, successfully thwarted the fast gradient sign method (FGSM) (Goodfellow et al., 2014), one of the earliest and simplest attacks. However, adversarial training with FGSM examples was quickly shown to be vulnerable to more sophisticated multi-stage attacks (Kurakin et al., 2016; Tramer et al., 2017a). More sophisticated defenses that rely on network distillation (Papernot et al., 2016b) \` and specialized activation functions (Zantedeschi et al., 2017) were also toppled by strong attacks (Papernot et al., 2016a; Tramer et al., 2017b; Carlini & Wagner, 2016; 2017a). \`
29
+
30
+ The ongoing vulnerability of classifiers was highlighted in recent work by Athalye et al. (2018) and Athalye & Sutskever (2017) that broke an entire suite of defenses presented in ICLR 2018 including thermometer encoding (Buckman et al., 2018), detection using local intrinsic dimensionality (Ma et al., 2018), input transformations such as compression and image quilting (Guo et al., 2017), stochastic activation pruning (Dhillon et al., 2018), adding randomization at inference time (Xie et al., 2017), enhancing the confidence of image labels (Song et al., 2017), and using a generative model as a defense (Samangouei et al., 2018).
31
+
32
+ Rather than hardening classifiers to attacks, some authors have proposed sanitizing datasets to remove adversarial perturbations before classification. Approaches based on auto-encoders (Meng & Chen, 2017) and GANs (Shen et al., 2017) were broken using optimization-based attacks (Carlini & Wagner, 2017b;a).
33
+
34
+ A number of “certifiable” defense mechanisms have been developed for certain classifiers. Raghunathan et al. (2018) harden a two-layer classifier using semidefinite programming, and Sinha et al. (2018) propose a convex duality-based approach to adversarial training that works on sufficiently small adversarial perturbations with a quadratic adversarial loss. Kolter & Wong (2017) consider training a robust classifier using the convex outer adversarial polytope. All of these methods only consider robustness of the classifier on the training set, and robustness properties often fail to generalize reliably to test examples.
35
+
36
+ One place where researchers have enjoyed success is at training classifiers on low-dimensional datasets like MNIST (Madry et al., 2017; Sinha et al., 2018). The robustness achieved on more complicated datasets such as CIFAR-10 and ImageNet are nowhere near that of MNIST, which leads some researchers to speculate that adversarial defense is fundamentally harder in higher dimensions – an issue we address in Section 8.
37
+
38
+ ![](images/6ddd75fd53a9fc4b49de87358f7e597db9a66ba38a3b2e7c9f112263ea1a93b5.jpg)
39
+ Figure 2: Sparse adversarial examples perturb a small subset of pixels and can hide adversarial “fuzz” inside highfrequency image regions. The original image (left) is classified as an “ox.” Under $\ell _ { \infty }$ -norm perturbations, it is classified as “traffic light”, but the perturbations visibly distort smooth regions of the image (the sky). These effects are hidden in the grass using $\ell _ { 0 }$ -norm (sparse) perturbations limited to a small subset of pixels.
40
+
41
+ This paper uses well-known results from high-dimensional geometry, specifically isoperimetric inequalities, to provide bounds on the robustness of classifiers. Several other authors have investigated adversarial susceptibility through the lens of geometry. Fawzi et al. (2018) study adversarial susceptibility of datasets under the assumption that they are produced by a generative model that maps random Gaussian vectors onto images. Gilmer et al. (2018) do a detailed case study, including empirical and theoretical results, of classifiers for a synthetic dataset that lies on two concentric spheres. Simon-Gabriel et al. (2018) show that the Lipschitz constant of untrained networks with random weights gets large in high dimensions. Shortly after the original appearance of our work, Mahloujifar et al. (2018) presented a study of adversarial susceptibility that included both evasion and poisoning attacks. Our work is distinct in that it studies adversarial robustness for arbitrary data distributions, and also that it rigorously looks at the effect of dimensionality on robustness limits.
42
+
43
+ # 1.2 NOTATION
44
+
45
+ We use $[ 0 , 1 ] ^ { n }$ to denote the unit hypercube in $n$ dimensions, and $\operatorname { v o l } ( \mathcal { A } )$ to denote the volume (i.e., ndimensional Lebesgue measure) of a subset ${ \mathcal { A } } \subset [ 0 , 1 ] ^ { n }$ . We use $\mathbb { S } ^ { n - 1 } = \left\{ x \in \mathbb { R } ^ { n } | \| x \| _ { 2 } = 1 \right\}$ to denote the unit sphere embedded in $\mathbb { R } ^ { n }$ , and $s _ { n - 1 }$ to denote its surface area. The size of a subset $\mathcal { A } \in \mathbb { S } ^ { n - 1 }$ can be quantified by its $( n - 1$ dimensional) measure $\mu [ \mathcal { A } ]$ , which is simply the surface area the set covers. Because the surface area of the unit sphere varies greatly with $n$ , it is much easier in practice to work with the normalized measure, which we denote $\mu _ { 1 } [ \mathcal { A } ] = \mu [ \mathcal { A } ] / s _ { n - 1 }$ . This normalized measure has the property that $\mu _ { 1 } [ \mathbb { S } ^ { n - 1 } ] = 1$ , and so we can interpret $\mu _ { 1 } [ \mathcal { A } ]$ as the probability of a uniform random point from the sphere lying in $\mathcal { A }$ . When working with points on a sphere, we often use geodesic distance, which is always somewhat larger than (but comparable to) the Euclidean distance. In the cube, we measure distance between points using $\ell _ { p }$ -norms, which are denoted
46
+
47
+ $$
48
+ \| z \| _ { p } = \left( \sum _ { i } | z _ { i } | ^ { p } \right) ^ { 1 / p } { \mathrm { ~ i f ~ } } p > 0 , { \mathrm { a n d ~ } } \| z \| _ { 0 } = \operatorname { c a r d } \{ z _ { i } | z _ { i } \neq 0 \} .
49
+ $$
50
+
51
+ Note that $\| \cdot \| _ { p }$ is not truly a norm for $p < 1$ , but rather a semi-norm. Such metrics are still commonly used, particularly the $^ { 6 6 } \ell _ { 0 }$ -norm” which counts the number of non-zero entries in a vector.
52
+
53
+ # 2 PROBLEM SETUP
54
+
55
+ We consider the problem of classifying data points that lie in a space $\Omega$ (either a sphere or a hypercube) into $m$ different object classes. The $m$ object classes are defined by probability density functions $\{ \bar { \rho } _ { c } \} _ { c = 1 } ^ { m }$ , where $\rho _ { c } : \Omega \to \mathbb { R }$ . A “random” point from class $c$ is a random variable with density $\rho _ { c }$ . We assume $\rho _ { c }$ to be bounded (i.e., we don’t allow delta functions or other generalized functions), and denote its upper bound by $U _ { c } = \operatorname* { s u p } _ { x } \rho _ { c } ( x )$ .
56
+
57
+ We also consider a “classifier” function $\mathcal { C } : \Omega \{ 1 , 2 , \dots , m \}$ that partitions $\Omega$ into disjoint measurable subsets, one for each class label. The classifier we consider is discrete valued – it provides a label for each data point but not a confidence level.
58
+
59
+ With this setup, we can give a formal definition of an adversarial example.
60
+
61
+ Definition 1. Consider a point $x \in \Omega$ drawn from class $c$ , a scalar $\epsilon > 0$ , and a metric $d$ . We say that $x$ admits an $\epsilon$ -adversarial example in the metric $d$ if there exists a point ${ \hat { x } } \in \Omega$ with $\mathcal { C } ( \hat { x } ) \neq c$ , and $d ( x , { \hat { x } } ) \leq \epsilon$
62
+
63
+ In plain words, a point has an $\epsilon$ -adversarial example if we can sneak it into a different class by moving it at most $\epsilon$ units in the distance $d$ .
64
+
65
+ We consider adversarial examples with respect to different $\ell _ { p }$ -norm metrics. These metrics are written $d _ { p } ( x , { \hat { x } } ) = \| x - { \hat { x } } \| _ { p }$ . A common choice is $p = \infty$ , which limits the absolute change that can be made to any one pixel. However, $\ell _ { 2 }$ -norm and $\ell _ { 1 }$ -norm adversarial examples are also used, as it is frequently easier to create adversarial examples in these less restrictive metrics.
66
+
67
+ ![](images/bec453d8b88a06db74ab1cc8b4677e5f64e6711c700b0e65e5afb10aeb6e93f7.jpg)
68
+ Figure 3: The $\epsilon$ -expansion of a half sphere nearly covers the whole sphere for small $\epsilon$ and large $n$ . Visualizations show the fraction of the sphere captured within $\epsilon$ units of a half sphere in different dimensions. Results from a near-exact experimental method are compared to the theoretical lower bound in Lemma 2.
69
+
70
+ We also consider sparse adversarial examples in which only a small subset of pixels are manipulated. This corresponds to the metric $d _ { 0 }$ , in which case the constraint $\| x - { \hat { x } } \| _ { 0 } \leq \epsilon$ means that an adversarial example was crafted by changing at most $\epsilon$ pixels, and leaving the others alone.
71
+
72
+ # 3 THE SIMPLE CASE: ADVERSARIAL EXAMPLES ON THE UNIT SPHERE
73
+
74
+ We begin by looking at the case of classifiers for data on the sphere. While this data model may be less relevant than the other models studied below, it provides a straightforward case where results can be proven using simple, geometric lemmas. The more realistic case of images with pixels in $[ 0 , 1 ]$ will be studied in Section 4.
75
+
76
+ The idea is to show that, provided a class of data points takes up enough space, nearly every point in the class lies close to the class boundary. To show this, we begin with a simple definition.
77
+
78
+ Definition 2. The $\epsilon$ -expansion of a subset $A \subset \Omega$ with respect to distance metric $d$ , denoted $A ( \epsilon , d )$ , contains all points that are at most $\epsilon$ units away from $\mathcal { A }$ . To be precise
79
+
80
+ $$
81
+ \begin{array} { r } { A ( \epsilon , d ) = \{ x \in \Omega | d ( x , y ) \leq \epsilon f o r s o m e y \in \mathcal { A } \} . } \end{array}
82
+ $$
83
+
84
+ We sometimes simply write $\boldsymbol { \mathcal { A } } ( \boldsymbol { \epsilon } )$ when the distance metric is clear from context.
85
+
86
+ Our result provides bounds on the probability of adversarial examples that are independent of the shape of the class boundary. This independence is a simple consequence of an isoperimetric inequality. The classical isoperimetric inequality states that, of all closed surfaces that enclose a unit volume, the sphere has the smallest surface area. This simple fact is intuitive but famously difficult to prove. For a historical review of the isoperimetric inequality and its variants, see Osserman et al. (1978). We will use a special variant of the isoperimetric inequality first proved by Levy & Pellegrino (1951) and simplified by Talagrand (1995). ´
87
+
88
+ Lemma 1 (Isoperimetric inequality). Consider a subset of the sphere $\mathcal { A } \subset \mathbb { S } ^ { n - 1 } \subset \mathbb { R } ^ { n }$ with normalized measure $\mu _ { 1 } ( \mathcal { A } ) \ge 1 / 2$ . When using the geodesic metric, the -expansion $\boldsymbol { \mathcal { A } } ( \boldsymbol { \epsilon } )$ is at least as large as the $\epsilon$ -expansion of a half sphere.
89
+
90
+ The classical isoperimetric inequality is a simple geometric statement, and frequently appears without absolute bounds on the size of the $\epsilon$ -expansion of a half-sphere, or with bounds that involve unspecified constants (Vershynin, 2017). A tight bound derived by Milman $\&$ Schechtman (1986) is given below. The asymptotic blow-up of the $\epsilon$ -expansion of a half sphere predicted by this bound is shown in Figure 3.
91
+
92
+ Lemma 2 ( $\epsilon$ -expansion of half sphere). The geodesic $\epsilon$ -expansion of a half sphere has normalized measure at least
93
+
94
+ $$
95
+ 1 - \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
96
+ $$
97
+
98
+ Lemmas 1 and 2 together can be taken to mean that, if a set is not too small, then in high dimensions almost all points on the sphere are reachable within a short $\epsilon$ jump from that set. These lemmas have immediate implications for adversarial examples, which are formed by mapping one class into another using small perturbations. Despite its complex appearance, the result below is a consequence of the (relatively simple) isoperimetric inequality.
99
+
100
+ Theorem 1 (Existence of Adversarial Examples). Consider a classification problem with m object classes, each distributed over the unit sphere ${ \mathbb { S } } ^ { n - 1 } \subset { \overline { { \mathbb { R } } } } ^ { n }$ with density functions $\{ \rho _ { c } \} _ { c = 1 } ^ { m }$ . Choose a classifier function $\mathcal { C } : \mathbb { S } ^ { n - 1 } \to \{ 1 , 2 , \dots , m \}$ that partitions the sphere into disjoint measurable subsets. Define the following scalar constants:
101
+
102
+ • Let $V _ { c }$ denote the magnitude of the supremum of $\rho _ { c }$ relative to the uniform density. This can be written $V _ { c } : = s _ { n - 1 } \cdot \operatorname* { s u p } _ { x } \rho _ { c } ( x )$ . • Let $f _ { c } = \mu _ { 1 } \{ x | \mathcal { C } ( x ) = c \}$ be the fraction of the sphere labeled as c by classifier $\mathcal { C }$ .
103
+
104
+ Choose some class c with $f _ { c } \leq \frac { 1 } { 2 }$ . Sample a random data point $x$ from $\rho _ { c }$ . Then with probability at least
105
+
106
+ $$
107
+ 1 - V _ { c } \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right)
108
+ $$
109
+
110
+ one of the following conditions holds:
111
+
112
+ 1. x is misclassified by $\mathcal { C }$ , or
113
+ 2. x admits an $\epsilon$ -adversarial example in the geodesic distance.
114
+
115
+ Proof. Choose a class $c$ with $f _ { c } \leq \frac { 1 } { 2 }$ . Let ${ \mathcal { R } } = \{ x | { \mathcal { C } } ( x ) = c \}$ denote the region of the sphere labeled as class $c$ by $\mathcal { C }$ , and let $\overline { { \mathcal { R } } }$ be its complement. $\overline { { \mathcal { R } } } ( \epsilon )$ is the $\epsilon$ -expansion of $\overline { { \mathcal { R } } }$ in the geodesic metric. Because $\overline { { \mathcal { R } } }$ covers at least half the sphere, the isoperimetric inequality (Lemma 1) tells us that the epsilon expansion is at least as great as the epsilon expansion of a half sphere. We thus have
116
+
117
+ $$
118
+ \mu _ { 1 } [ \overline { { { R } } } ( \epsilon ) ] \geq 1 - \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
119
+ $$
120
+
121
+ Now, consider the set $ { \boldsymbol { S } } _ { c }$ of “safe” points from class $c$ that are correctly classified and do not admit adversarial perturbations. A point is correctly classified only if it lies inside $\mathcal { R }$ , and therefore outside of $\overline { { \mathcal { R } } }$ . To be safe from adversarial perturbations, a point cannot lie within $\epsilon$ distance from the class boundary, and so it cannot lie within $\overline { { R } } ( \epsilon )$ . It is clear that the set $ { \boldsymbol { S } } _ { c }$ of safe points is exactly the complement of $\dot { \overline { { R } } } ( \epsilon )$ . This set has normalized measure
122
+
123
+ $$
124
+ \mu _ { 1 } [ S _ { c } ] \leq \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
125
+ $$
126
+
127
+ The probability of a random point lying in $ { \boldsymbol { S } } _ { c }$ is bounded above by the normalized supremum of $\rho _ { c }$ times the normalized measure $\mu _ { 1 } [ S _ { c } ]$ . This product is given by
128
+
129
+ $$
130
+ V _ { c } \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
131
+ $$
132
+
133
+ We then subtract this probability from 1 to obtain the probability of a point lying outside the safe region, and arrive at equation 1. □
134
+
135
+ In the above result, we measure the size of adversarial perturbations using the geodesic distance. Most studies of adversarial examples measure the size of perturbation in either the $\ell _ { 2 }$ (Euclidean) norm or the $\ell _ { \infty }$ (max) norm, and so it is natural to wonder whether Theorem 1 depends strongly on the distance metric. Fortunately (or, rather unfortunately) it does not.
136
+
137
+ It is easily observed that, for any two points $x$ and $y$ on a sphere,
138
+
139
+ $$
140
+ d _ { \infty } ( x , y ) \leq d _ { 2 } ( x , y ) \leq d _ { g } ( x , y ) ,
141
+ $$
142
+
143
+ where $d _ { \infty } ( x , y )$ , $d _ { 2 } ( x , y )$ , and $d _ { g } ( x , y )$ denote the $l _ { \infty }$ , Euclidean, and geodesic distance, respectively. From this, we see that Theorem 1 is actually fairly conservative; any $\epsilon$ -adversarial example in the geodesic metric would also be adversarial in the other two metrics, and the bound in Theorem 1 holds regardless of which of the three metrics we choose (although different values of $\epsilon$ will be appropriate depending on the norm).
144
+
145
+ # 4 WHAT ABOUT THE UNIT CUBE?
146
+
147
+ The above result about the sphere is simple and easy to prove using classical results. However, real world images do not lie on the sphere. In a more typical situation, images will be scaled so that their pixels lie in [0, 1], and data lies inside a high-dimensional hypercube (but, unlike the sphere, data is not confined to its surface). The proof of Theorem 1 makes extensive use of properties that are exclusive to the sphere, and is not applicable to this more realistic setting. Are there still problem classes on the cube where adversarial examples are inevitable?
148
+
149
+ This question is complicated by the fact that geometric isoperimetric inequalities do not exist for the cube, as the shapes that achieve minimal $\epsilon$ -expansion (if they exist) depend on the volume they enclose and the choice of $\epsilon$ (Ros, 2001). Fortunately, researchers have been able to derive “algebraic” isoperimetric inequalities that provide lower bounds on the size of the $\epsilon$ -expansion of sets without identifying the shape that achieves this minimum (Talagrand, 1996; Milman & Schechtman, 1986). The result below about the unit cube is analogous to Proposition 2.8 in Ledoux (2001), except with tighter constants. For completeness, a proof (which utilizes methods from Ledoux) is provided in Appendix A.
150
+
151
+ Lemma 3 (Isoperimetric inequality on a cube). Consider a measurable subset of the cube $\mathcal { A } \subset [ 0 , 1 ] ^ { n }$ , and a p-norm distance metric dp(x, y) = kx − ykp for p > 0. Let Φ(z) = (2π)− 12 R z−∞ e , and let α be the scalar that satisfies $\Phi ( \alpha ) = \mathrm { v o l } [ \mathcal { A } ]$ . Then
152
+
153
+ $$
154
+ \mathrm { v o l } [ A ( \epsilon , d _ { p } ) ] \geq \Phi \left( \alpha + \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon \right)
155
+ $$
156
+
157
+ where $p ^ { * } = \operatorname* { m i n } ( p , 2 )$ . In particular, $i f \mathrm { v o l } ( \mathcal { A } ) \geq 1 / 2$ , then we simply have
158
+
159
+ $$
160
+ \mathrm { v o l } [ { \cal A } ( \epsilon , d _ { p } ) ] \ge 1 - \frac { \exp ( - \pi { n ^ { 1 - 2 / p ^ { * } } } \epsilon ^ { 2 } ) } { 2 \pi { n ^ { 1 / 2 - 1 / p ^ { * } } } } .
161
+ $$
162
+
163
+ Using this result, we can show that most data samples in a cube admit adversarial examples, provided the data distribution is not excessively concentrated.
164
+
165
+ Theorem 2 (Adversarial examples on the cube). Consider a classification problem with m classes, each distributed over the unit hypercube $[ 0 , 1 ] ^ { n }$ with density functions $\{ \rho _ { c } \} _ { c = 1 } ^ { m }$ . Choose a classifier function $\mathcal { C } : [ 0 , 1 ] ^ { n } \to \{ 1 , 2 , . . . , m \}$ that partitions the hypercube into disjoint measurable subsets. Define the following scalar constants:
166
+
167
+ • Let $U _ { c }$ denote the supremum of $\rho _ { c }$ .
168
+ • Let $f _ { c }$ be the fraction of hypercube partitioned into class c by $\mathcal { C }$ .
169
+
170
+ Choose some class $c$ with $f _ { c } \ \leq \ { \frac { 1 } { 2 } }$ , and select an $\ell _ { p }$ -norm with $p > 0$ . Define $p ^ { * } = \operatorname* { m i n } ( p , 2 )$ . Sample a random data point $x$ from the class distribution $\rho _ { c }$ . Then with probability at least
171
+
172
+ $$
173
+ 1 - U _ { c } \frac { \exp ( - \pi { n ^ { 1 - 2 / p ^ { * } } \epsilon ^ { 2 } } ) } { 2 \pi { n ^ { 1 / 2 - 1 / p ^ { * } } } } .
174
+ $$
175
+
176
+ one of the following conditions holds:
177
+
178
+ 1. x is misclassified by $\mathcal { C }$ , or
179
+ 2. x has an adversarial example $\hat { x }$ , with $\| x - { \hat { x } } \| _ { p } \leq \epsilon$ .
180
+
181
+ When adversarial examples are defined in the $\ell _ { 2 }$ -norm (or for any $p \geq 2$ ), the bound in equation 4 becomes
182
+
183
+ $$
184
+ 1 - U _ { c } \exp ( - \pi \epsilon ^ { 2 } ) / ( 2 \pi ) .
185
+ $$
186
+
187
+ Provided the class distribution is not overly concentrated, equation 5 guarantees adversarial examples with relatively “small” $\epsilon$ relative to a typical vector. In $n$ dimensions, the $\ell _ { 2 }$ diameter of the cube is $\sqrt { n }$ , and so it is reasonable to choose $\epsilon = O ( { \sqrt { n } } )$ in equation 5. In Figure 1, we chose $\epsilon = 1 0$ . A similarly strong bound of $1 - U _ { c } \sqrt { n } \exp ( - \pi \epsilon ^ { 2 } / n ) / ( 2 \pi )$ holds for the case of the $\ell _ { 1 }$ -norm, in which case the diameter is $n$ .
188
+
189
+ Oddly, equation 4 seems particularly weak when the $\ell _ { \infty }$ norm is used. In this case, the bound on the right side of equation 4 becomes equation 5 just like in the $\ell _ { 2 }$ case. However, $\ell _ { \infty }$ adversarial examples are only interesting if we take $\epsilon < 1$ , in which case equation 5 becomes vacuous for large $n$ . This bound can be tightened up in certain situations. If we prove Theorem 2 using the tighter (but messier) bound of equation 2 instead of equation 3, we can replace equation 4 with
190
+
191
+ $$
192
+ 1 - U _ { c } \hat { \Phi } \left( \alpha + \sqrt { 2 \pi } \epsilon \right)
193
+ $$
194
+
195
+ for $p \geq 2$ , where $\begin{array} { r } { \hat { \Phi } ( z ) = \frac { 1 } { \sqrt { 2 \pi } } \int _ { z } ^ { \infty } e ^ { - t ^ { 2 } / 2 } d t \ge \frac { 1 } { \sqrt { 2 \pi } z } e ^ { - z ^ { 2 } / 2 } } \end{array}$ (for $z > 0$ ), and $\alpha = \Phi ^ { - 1 } ( 1 - f _ { c } )$ . For this bound to be meaningful with $\epsilon < 1$ , we need $f _ { c }$ to be relatively small, and $\epsilon$ to be roughly $f _ { c }$ or smaller. This is realistic for some problems; ImageNet has 1000 classes, and so $f _ { c } < 1 0 ^ { - 3 }$ for at least one class.
196
+
197
+ Interestingly, under $\ell _ { \infty }$ -norm attacks, guarantees of adversarial examples are much stronger on the sphere (Section 3) than on the cube. One might wonder whether the weakness of Theorem 4 in the $\ell _ { \infty }$ case is fundamental, or if this is a failure of our approach. One can construct examples of sets with $\ell _ { \infty }$ expansions that nearly match the behavior of equation 5, and so our theorems in this case are actually quite tight. It seems to be inherently more difficult to prove the existence of adversarial examples in the cube using the $\ell _ { \infty }$ -norm.
198
+
199
+ # 5 WHAT ABOUT SPARSE ADVERSARIAL EXAMPLES?
200
+
201
+ A number of papers have looked at sparse adversarial examples, in which a small number of image pixels, in some cases only one (Su et al., 2017), are changed to manipulate the class label. To study this case, we would like to investigate adversarial examples under the $\ell _ { 0 }$ metric. The $\ell _ { 0 }$ distance is defined as
202
+
203
+ $$
204
+ d ( x , y ) = \| x - y \| _ { 0 } = \mathrm { c a r d } \{ i | x _ { i } \neq y _ { i } \} .
205
+ $$
206
+
207
+ If a point $x$ has an $\epsilon$ -adversarial example in this norm, then it can be perturbed into a different class by modifying at most $\epsilon$ pixels (in this case $\epsilon$ is taken to be a positive integer).
208
+
209
+ Theorem 2 is fairly tight for $p = 1$ or 2. However, the bound becomes quite loose for small $p$ , and in particular it fails completely for the important case of $p = 0$ . For this reason, we present a different bound that is considerably tighter for small $p$ (although slightly looser for large $p$ ).
210
+
211
+ The case $p = 0$ was studied by Milman & Schechtman (1986) (Section 6.2) and McDiarmid (1989), and later by Talagrand (1995; 1996). The proof of the following theorem (appendix B) follows the method used in Section 5 of Talagrand (1996), with modifications made to extend the proof to arbitrary $p$ .
212
+
213
+ Lemma 4 (Isoperimetric inequality on the cube: small $p$ ). Consider a measurable subset of the cube ${ \mathcal { A } } \subset$ $[ 0 , 1 ] ^ { n }$ , and a $p$ -norm distance metric $d ( x , y ) = \| x - y \| _ { p }$ for any $p \geq 0$ . We have
214
+
215
+ $$
216
+ \begin{array} { l } { \displaystyle \mathrm { v o l } [ \mathcal { A } ( \epsilon , d _ { p } ) ] \ge 1 - \frac { \exp { \left( - \epsilon ^ { 2 p } / n \right) } } { \mathrm { v o l } [ \mathcal { A } ] } , f o r p > 0 a n d } \\ { \displaystyle \mathrm { v o l } [ \mathcal { A } ( \epsilon , d _ { 0 } ) ] \ge 1 - \frac { \exp { \left( - \epsilon ^ { 2 } / n \right) } } { \mathrm { v o l } [ \mathcal { A } ] } , f o r p = 0 . } \end{array}
217
+ $$
218
+
219
+ Using this result, we can prove a statement analogous to Theorem 2, but for sparse adversarial examples. We present only the case of $p = 0$ , but the generalization to the case of other small $p$ using Lemma 4 is straightforward.
220
+
221
+ Theorem 3 (Sparse adversarial examples). Consider the problem setup of Theorem 2. Choose some class c with $f _ { c } \leq \frac { 1 } { 2 }$ , and sample a random data point $x$ from the class distribution $\rho _ { c }$ . Then with probability at least
222
+
223
+ $$
224
+ 1 - 2 U _ { c } \exp ( - \epsilon ^ { 2 } / n )
225
+ $$
226
+
227
+ one of the following conditions holds:
228
+
229
+ 1. x is misclassified by $\mathcal { C }$ , or
230
+
231
+ 2. x can be adversarially perturbed by modifying at most  pixels, while still remaining in the unit hypercube.
232
+
233
+ Tighter bounds can be obtained if we only guarantee that adversarial examples exist for some data points in a class, without bounding the probability of this event.
234
+
235
+ Theorem 4 (Condition for existence of adversarial examples). Consider the setup of Theorem 2. Choose a class c that occupies a fraction of the cube $f _ { c } < \frac { 1 } { 2 }$ . Pick an $\ell _ { p }$ norm and set $p ^ { * } = \operatorname* { m i n } ( p , 2 )$ .
236
+
237
+ Let $\operatorname { s u p p } ( \rho _ { c } )$ denote the support of $\rho _ { c }$ . Then there is a point $x$ with $\rho _ { c } ( x ) > 0$ that admits an $\epsilon$ -adversarial example if
238
+
239
+ $$
240
+ \begin{array} { r } { \operatorname { v o l } [ \operatorname { s u p p } ( \rho _ { c } ) ] \geq \left\{ \begin{array} { l l } { \frac { 1 } { 2 } \exp \bigl ( - \pi \epsilon ^ { 2 } n ^ { 1 - 2 / p ^ { * } } \bigr ) , } & { f o r p > 0 o r } \\ { \exp \left( - 2 \left( \epsilon - \sqrt { \frac { n \log 2 } { 2 } } \right) ^ { 2 } / n \right) , } & { f o r p = 0 . } \end{array} \right. } \end{array}
241
+ $$
242
+
243
+ The bound for the case $p = 0$ is valid only if $\epsilon \geq \sqrt { n \log { 2 / 2 } }$ .
244
+
245
+ It is interesting to consider when Theorem 4 produces non-vacuous bounds. When the $\ell _ { 2 }$ -norm is used, the bound becomes √ $\mathrm { v o l } [ \mathrm { s u p p } ( \rho _ { c } ) ] \geq \exp ( - \pi \epsilon ^ { 2 } ) \dot { / } 2$ . The diameter of the cube is $\sqrt { n }$ , and so the bound becomes active for $\epsilon = \sqrt { n }$ . Plugging this in, we see that the bound is active whenever the size of the support satisfies $\begin{array} { r } { \mathrm { v o l } [ \mathrm { s u p p } ( \rho _ { c } ) ] > \frac { 1 } { 2 e ^ { \pi n } } } \end{array}$ . Remarkably, this holds for large $n$ whenever the support of class $c$ is larger than (or contains) a hypercube of side length at least $e ^ { - \pi } \approx 0 . 0 4 3$ . Note, however, that the bound being “active” does not guarantee adversarial examples with a “small” $\epsilon$ .
246
+
247
+ # 7 DISCUSSION: CAN WE ESCAPE FUNDAMENTAL BOUNDS?
248
+
249
+ There are a number of ways to escape the guarantees of adversarial examples made by Theorems 1-4. One potential escape is for the class density functions to take on extremely large values (i.e., exponentially large $U _ { c , }$ ); the dependence of $U _ { c }$ on $n$ is addressed separately in Section 8.
250
+
251
+ Unbounded density functions and low-dimensional data manifolds In practice, image datasets might lie on low-dimensional manifolds within the cube, and the support of these distributions could have measure zero, making the density function infinite (i.e., $U _ { c } = \infty$ ). The arguments above are still relevant (at least in theory) in this case; we can expand the data manifold by adding a uniform random noise to each image pixel of magnitude at most $\epsilon _ { 1 }$ . The expanded dataset has positive volume. Then, adversarial examples of this expanded dataset can be crafted with perturbations of size $\epsilon _ { 2 }$ . This method of expanding the manifold before crafting adversarial examples is often used in practice. Tramer et al. (2017a) proposed adding a small \` perturbation to step off the image manifold before crafting adversarial examples. This strategy is also used during adversarial training (Madry et al., 2017).
252
+
253
+ Adding a “don’t know” class The analysis above assumes the classifier assigns a label to every point in the cube. If a classifier has the ability to say “I don’t know,” rather than assign a label to every input, then the region of the cube that is assigned class labels might be very small, and adversarial examples could be escaped even if the other assumptions of Theorem 4 are satisfied. In this case, it would still be easy for the adversary to degrade classifier performance by perturbing images into the “don’t know” class.
254
+
255
+ Feature squeezing If decreasing the dimensionality of data does not lead to substantially increased values for $U _ { c }$ (we see in Section 8 that this is a reasonable assumption) or loss in accuracy (a stronger assumption), measuring data in lower dimensions could increase robustness. This can be done via an auto-encoder (Meng & Chen, 2017; Shen et al., 2017), JPEG encoding (Das et al., 2018), or quantization (Xu et al., 2017).
256
+
257
+ Computational hardness It may be computationally hard to craft adversarial examples because of local flatness of the classification function, obscurity of the classifier function, or other computational difficulties. Computational hardness could prevent adversarial attacks in practice, even if adversarial examples still exist.
258
+
259
+ # 8 EXPERIMENTS & EFFECT OF DIMENSIONALITY
260
+
261
+ In this section, we discuss the relationship between dimensionality and adversarial robustness, and explore how the predictions made by the theorems above are reflected in experiments.
262
+
263
+ It is commonly thought that high-dimensional classifiers are more susceptible to adversarial examples than low-dimensional classifiers. This perception is partially motivated by the observation that classifiers on highresolution image distributions like ImageNet are more easily fooled than low resolution classifiers on MNIST (Tramer et al., 2017a). Indeed, Theorem 2 predicts that high-dimensional classifiers should be much easier \` to fool than low-dimensional classifiers, assuming the datasets they classify have comparable probability density limits $U _ { c }$ . However, this is not a reasonable assumption; we will see below that high dimensional distributions may be more concentrated than their low-dimensional counterparts.
264
+
265
+ We study the effects of dimensionality with a thought experiment involving a “big MNIST” image distribution. Given an integer expansion factor $b$ , we can make a big MNIST distribution, denoted $b$ -MNIST, by replacing each pixel in an MNIST image with a $b \times b$ array of identical pixels. This expands an original $2 8 \times 2 8$ image into a $2 8 b \times 2 8 b$ image. Figure 4a shows that, without adversarial training, a classifier on big MNIST is far more susceptible to attacks than a classifier trained on the original MNIST1.
266
+
267
+ However, each curve in Figure 4a only shows the attack susceptibility of one particular classifier. In contrast, Theorems 1-4 describe the fundamental limits of susceptibility for all classifiers. These limits are an inherent property of the data distribution. The theorem below shows that these fundamental limits do not depend in a non-trivial way on the dimensionality of the images in big MNIST, and so the relationship between dimensionality and susceptibility in Figure 4a results from the weakness of the training process.
268
+
269
+ Theorem 5. Suppose  and p are such that, for all MNIST classifiers, a random image from class c has an $\epsilon$ -adversarial example (in the $\ell _ { 2 }$ -norm) with probability at least $p$ . Then for all classifiers on $b$ -MNIST, with integer $b \geq 1$ , a random image from c has a b-adversarial example with probability at least $p$ .
270
+
271
+ Likewise, if all $b$ -MNIST classifiers have b-adversarial examples with probability $p$ for some $b \geq 1$ , then all classifiers on the original MNIST distribution have $\epsilon$ -adversarial examples with probability $p$ .
272
+
273
+ Theorem 5 predicts that the perturbation needed to fool all $5 6 \times 5 6$ classifiers is twice that needed to fool all $2 8 \times 2 8$ classifiers. This is reasonable since the $\ell _ { 2 }$ -norm of a $5 6 \times 5 6$ image is twice that of its $2 8 \times 2 8$ counterpart. Put simply, fooling big MNIST is just as hard/easy as fooling the original MNIST regardless of resolution. This also shows that for big MNIST, as the expansion factor $b$ gets larger and $\epsilon$ is expanded to match, the concentration bound $U _ { c }$ grows at exactly the same rate as the exponential term in equation 2 shrinks, and there is no net effect on fundamental susceptibility. Also note that an analogous result could be based on any image classification problem (we chose MNIST only for illustration), and any $p \geq 0$ .
274
+
275
+ We get a better picture of the fundamental limits of MNIST by considering classifiers that are hardened by adversarial training2 (Figure 4b). These curves display several properties of fundamental limits predicted by our theorems. As predicted by Theorem 5, the $1 1 2 \times 1 1 2$ classifer curve is twice as wide as the $5 6 \times 5 6$ curve, which in turn is twice as wide as the $2 8 \times 2 8$ curve. In addition, we see the kind of “phase transition” behavior predicted by Theorem 2, in which the classifier suddenly changes from being highly robust to being highly susceptible as $\epsilon$ passes a critical threshold. For these reasons, it is reasonable to suspect that the adversarially trained classifiers in Figure 4b are operating near the fundamental limit predicted by Theorem 2.
276
+
277
+ Theorem 5 shows that increased dimensionality does not increase adversarial susceptibility in a fundamental way. But then why are high-dimensional classifiers so easy to fool? To answer this question, we look at the concentration bound $U _ { c }$ for object classes. The smallest possible value of $U _ { c }$ is 1, which only occurs when images are “spread out” with uniform, uncorrelated pixels. In contrast, adjacent pixels in MNIST (and especially big MNIST) are very highly correlated, and images are concentrated near simple, low-dimensional manifolds, resulting in highly concentrated image classes with large $U _ { c }$ . Theory predicts that such highly concentrated datasets can be relatively safe from adversarial examples.
278
+
279
+ ![](images/7156f6da0989991e35b2cf03ea4ff4f32e1b6a8d1b3ee00fe588d06e040a3e1c.jpg)
280
+ Figure 4: (a) Robustness of MNIST and “big” MNIST classifiers as a function of $\epsilon$ . Naturally trained classifiers are less robust with increased dimensionality. (b) With adversarial training, susceptibility curves behave as predicted by Theorems 2 and 5. (c) The susceptibility of CIFAR-10 is compared to big MNIST. Both datasets have similar dimension, but the higher complexity of CIFAR-10 results in far worse susceptibility. Perturbations are measured in the $\ell _ { 2 }$ -norm.
281
+
282
+ We can reduce $U _ { c }$ and dramatically increase susceptibility by choosing a more “spread out” dataset, like CIFAR-10, in which adjacent pixels are less strongly correlated and images appear to concentrate near complex, higher-dimensional manifolds. We observe the effect of decreasing $U _ { c }$ by plotting the susceptibility of a $5 6 \times 5 6$ MNIST classifier against a classifier for CIFAR-10 (Figure 4, right). The former problem lives in 3136 dimensions, while the latter lives in 3072, and both have 10 classes. Despite the structural similarities between these problems, the decreased concentration of CIFAR-10 results in vastly more susceptibility to attacks, regardless of whether adversarial training is used. The theory above suggests that this increased susceptibility is caused at least in part by a shift in the fundamental limits for CIFAR-10, rather than the weakness of the particular classifiers we chose.
283
+
284
+ Informally, the concentration limit $U _ { c }$ can be interpreted as a measure of image complexity. Image classes with smaller $U _ { c }$ are likely concentrated near high-dimensional complex manifolds, have more intra-class variation, and thus more apparent complexity. An informal interpretation of Theorem 2 is that “high complexity” image classes are fundamentally more susceptible to adversarial examples, and Figure 4 suggests that complexity (rather than dimensionality) is largely responsible for differences we observe in the effectiveness of adversarial training for different datasets.
285
+
286
+ # 9 SO...ARE ADVERSARIAL EXAMPLES INEVITABLE?
287
+
288
+ The question of whether adversarial examples are inevitable is an ill-posed one. Clearly, any classification problem has a fundamental limit on robustness to adversarial attacks that cannot be escaped by any classifier. However, we have seen that these limits depend not only on fundamental properties of the dataset, but also on the strength of the adversary and the metric used to measure perturbations. This paper provides a characterization of these limits and how they depend on properties of the data distribution. Unfortunately, it is impossible to know the exact properties of real-world image distributions or the resulting fundamental limits of adversarial training for specific datasets. However, the analysis and experiments in this paper suggest that, especially for complex image classes in high-dimensional spaces, these limits may be far worse than our intuition tells us.
289
+
290
+ # REFERENCES
291
+
292
+ Milton Abramowitz and Irene A Stegun. Handbook of mathematical functions: with formulas, graphs, and mathematical tables, volume 55. Courier Corporation, 1965.
293
+
294
+ Anish Athalye and Ilya Sutskever. Synthesizing robust adversarial examples. arXiv preprint arXiv:1707.07397, 2017.
295
+
296
+ Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
297
+
298
+ Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Giorgio Giac- ´ into, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pp. 387–402. Springer, 2013.
299
+
300
+ Sergey G Bobkov et al. An isoperimetric inequality on the discrete cube, and an elementary proof of the isoperimetric inequality in gauss space. The Annals of Probability, 25(1):206–214, 1997.
301
+
302
+ Jacob Buckman, Aurko Roy, Colin Raffel, and Ian Goodfellow. Thermometer encoding: One hot way to resist adversarial examples. OpenReview, 2018.
303
+
304
+ Nicholas Carlini and David Wagner. Defensive distillation is not robust to adversarial examples. arXiv preprint arXiv:1607.04311, 2016.
305
+
306
+ Nicholas Carlini and David Wagner. Magnet and “efficient defenses against adversarial attacks” are not robust to adversarial examples. arXiv preprint arXiv:1711.08478, 2017a.
307
+
308
+ Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017b.
309
+
310
+ Nilaksh Das, Madhuri Shanbhogue, Shang-Tse Chen, Fred Hohman, Siwei Li, Li Chen, Michael E Kounavis, and Duen Horng Chau. Shield: Fast, practical defense and vaccination for deep learning using JPEG compression. arXiv preprint arXiv:1802.06816, 2018.
311
+
312
+ Guneet S Dhillon, Kamyar Azizzadenesheli, Zachary C Lipton, Jeremy Bernstein, Jean Kossaifi, Aran Khanna, and Anima Anandkumar. Stochastic activation pruning for robust adversarial defense. arXiv preprint arXiv:1803.01442, 2018.
313
+
314
+ Alhussein Fawzi, Hamza Fawzi, and Omar Fawzi. Adversarial vulnerability for any classifier. arXiv preprint arXiv:1802.08686, 2018.
315
+
316
+ Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018.
317
+
318
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
319
+
320
+ Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. arXiv preprint arXiv:1711.00117, 2017.
321
+
322
+ J Zico Kolter and Eric Wong. Provable defenses against adversarial examples via the convex outer adversarial polytope. arXiv preprint arXiv:1711.00851, 2017.
323
+
324
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
325
+
326
+ Michel Ledoux. The concentration of measure phenomenon. Number 89. American Mathematical Soc., 2001.
327
+
328
+ Paul Levy and Franco Pellegrino. ´ Problemes concrets d’analyse fonctionnelle ´ . Gauthier-Villars, Paris, 1951.
329
+
330
+ Xingjun Ma, Bo Li, Yisen Wang, Sarah M Erfani, Sudanthi Wijewickrema, Michael E Houle, Grant Schoenebeck, Dawn Song, and James Bailey. Characterizing adversarial subspaces using local intrinsic dimensionality. arXiv preprint arXiv:1801.02613, 2018.
331
+
332
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
333
+
334
+ Saeed Mahloujifar, Dimitrios I Diochnos, and Mohammad Mahmoody. The curse of concentration in robust learning: Evasion and poisoning attacks from concentration of measure. arXiv preprint arXiv:1809.03063, 2018.
335
+
336
+ C McDiarmid. On the method of bounded differences. London Mathematical Society Lecture Notes, 141: 148–188, 1989.
337
+
338
+ Dongyu Meng and Hao Chen. MagNet: a two-pronged defense against adversarial examples. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 135–147. ACM, 2017.
339
+
340
+ Vitali D Milman and Gideon Schechtman. Asymptotic Theory of Finite Dimensional Normed Spaces. Springer-Verlag, Berlin, Heidelberg, 1986. ISBN 0-387-16769-2.
341
+
342
+ Robert Osserman et al. The isoperimetric inequality. Bulletin of the American Mathematical Society, 84(6): 1182–1238, 1978.
343
+
344
+ Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016a.
345
+
346
+ Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pp. 582–597. IEEE, 2016b.
347
+
348
+ Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. arXiv preprint arXiv:1801.09344, 2018.
349
+
350
+ Antonio Ros. The isoperimetric problem. Global theory of minimal surfaces, 2:175–209, 2001.
351
+
352
+ Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. arXiv preprint arXiv:1805.06605, 2018.
353
+
354
+ Shiwei Shen, Guoqing Jin, Ke Gao, and Yongdong Zhang. APE-GAN: Adversarial perturbation elimination with GAN. ICLR Submission, available on OpenReview, 4, 2017.
355
+
356
+ Carl-Johann Simon-Gabriel, Yann Ollivier, Bernhard Scholkopf, L ¨ eon Bottou, and David Lopez-Paz. Adver- ´ sarial vulnerability of neural networks increases with input dimension. arXiv preprint arXiv:1802.01421, 2018.
357
+
358
+ Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying some distributional robustness with principled adversarial training. OpenReview, 2018.
359
+
360
+ Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. PixelDefend: Leveraging generative models to understand and defend against adversarial examples. arXiv preprint arXiv:1710.10766, 2017.
361
+
362
+ Jiawei Su, Danilo Vasconcellos Vargas, and Sakurai Kouichi. One pixel attack for fooling deep neural networks. arXiv preprint arXiv:1710.08864, 2017.
363
+
364
+ Vladimir Sudakov and Boris Tsirelson. Extremal properties of half-spaces for spherically invariant measures. J. Soviet Math., 41, 1974.
365
+
366
+ Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
367
+
368
+ Michel Talagrand. Concentration of measure and isoperimetric inequalities in product spaces. Publications Mathematiques de l’Institut des Hautes Etudes Scientifiques ´ , 81(1):73–205, 1995.
369
+
370
+ Michel Talagrand. A new look at independence. The Annals of probability, pp. 1–34, 1996.
371
+
372
+ Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. \` Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017a.
373
+
374
+ Florian Tramer, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space of trans- \` ferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017b.
375
+
376
+ Roman Vershynin. High-Dimensional Probability. Cambridge University Press, 2017.
377
+
378
+ Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. arXiv preprint arXiv:1711.01991, 2017.
379
+
380
+ Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
381
+
382
+ Valentina Zantedeschi, Maria-Irina Nicolae, and Ambrish Rawat. Efficient defenses against adversarial attacks. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 39–49. ACM, 2017.
383
+
384
+ # A PROOF OF LEMMA 3
385
+
386
+ We now prove Lemma 3. To do this, we begin with a classical isoperimetric inequality for random Gaussian variables. Unlike the case of a cube, tight geometric isoperimetric inequalities exist in this case. We then prove results about the cube by creating a mapping between uniform random variables on the cube and random Gaussian vectors.
387
+
388
+ In the lemma below, we consider the standard Gaussian density in $\mathbb { R } ^ { n }$ given by 1(2π)n/2 e−nx2/2 and corresponding Gaussian measure $\mu$ . We also define
389
+
390
+ $$
391
+ \Phi ( z ) = \frac { 1 } { \sqrt { 2 \pi } } \int _ { - \infty } ^ { z } e ^ { - t ^ { 2 } / 2 } d t ,
392
+ $$
393
+
394
+ which is the cumulative density of a Gaussian curve.
395
+
396
+ The following Lemma was first proved in Sudakov & Tsirelson (1974), and an elementary proof was given in Bobkov et al. (1997).
397
+
398
+ Lemma 5 (Gaussian Isoperimetric Inequality). Of all sets with the same Gaussian measure, the set with $\ell _ { 2 }$ $\epsilon$ -expansion of smallest measure is a half space. Furthermore, for any measurable set $\mathcal A \subset \mathbb { R } ^ { n }$ , and scalar constant a such that $\Phi ( a ) = \mu [ \mathcal { A } ]$ ,
399
+
400
+ $$
401
+ \mu [ { \cal A } ( \epsilon , d _ { 2 } ) ] \geq \Phi ( a + \epsilon ) .
402
+ $$
403
+
404
+ Using this result we can now give a proof of Lemma 3.
405
+
406
+ This function $\Phi$ maps a random Guassian vector $z \in N ( 0 , I )$ onto a random uniform vector in the unit cube. To see why, consider a measurable subset $B \subset R ^ { n }$ . If $\mu$ is the Gaussian measure on $\mathbb { R } ^ { n }$ and $\sigma$ is the uniform measure on the cube, then
407
+
408
+ $$
409
+ \sigma [ \Phi ( \mathcal { B } ) ] = \int \chi _ { \Phi ( \mathcal { B } ) } ( s ) d \sigma = \int \chi _ { \Phi ( \mathcal { B } ) } ( \Phi ( z ) ) \frac { 1 } { \operatorname* { d e t } ( J \Phi ) } d z = \int \chi _ { \mathcal { B } } ( z ) d \mu = \mu [ \mathcal { B } ] .
410
+ $$
411
+
412
+ Since $\textstyle { \frac { \partial } { \partial z _ { i } } } \Phi ( z ) \leq { \frac { 1 } { \sqrt { 2 \pi } } }$ , we also have
413
+
414
+ $$
415
+ \| \Phi ( z ) - \Phi ( w ) \| _ { p } \leq \| \frac { 1 } { \sqrt { 2 \pi } } ( x - w ) \| _ { p } = \frac { 1 } { \sqrt { 2 \pi } } \| z - w \| _ { p }
416
+ $$
417
+
418
+ for any $z , w \in \mathbb { R } ^ { n }$ . From this, we see that for $p ^ { * } = \operatorname* { m i n } ( p , 2 )$
419
+
420
+ $$
421
+ \| \Phi ( z ) - \Phi ( w ) \| _ { p } \leq n ^ { 1 / p ^ { * } - 1 / 2 } \| \Phi ( z ) - \Phi ( w ) \| _ { 2 } \leq \frac { n ^ { 1 / p ^ { * } } } { \sqrt { 2 \pi n } } \| z - w \| _ { 2 }
422
+ $$
423
+
424
+ where we have used the identity $\| u \| _ { p } \leq n ^ { 1 / \operatorname* { m i n } ( p , 2 ) - 1 / 2 } \| u \| _ { 2 }$
425
+
426
+ Now, consider any set $\mathcal { A }$ in the cube, and let $\ b { B } = \ b { \Phi } ^ { - 1 } ( \ b { A } )$ . From equation 10, we see that
427
+
428
+ $$
429
+ \Phi \mathcal { B } \left( \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon , d _ { 2 } \right) \subset \mathcal { A } ( \epsilon , d _ { p } ) .
430
+ $$
431
+
432
+ It follows from equation 10 that
433
+
434
+ $$
435
+ \sigma [ A ( \epsilon , d _ { p } ) ] \geq \mu \left[ B \left( \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon , d _ { 2 } \right) \right] .
436
+ $$
437
+
438
+ Applying Lemma 5, we see that
439
+
440
+ $$
441
+ \sigma [ A ( \epsilon , d _ { p } ) ] \geq \Phi \left( \alpha + \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon \right)
442
+ $$
443
+
444
+ where $\alpha = \Phi ^ { - 1 } ( \sigma [ \mathcal { A } ] )$ .
445
+
446
+ To obtain the simplified formula in the theorem, we use the identity
447
+
448
+ $$
449
+ \frac { 1 } { \sqrt { 2 \pi } } \int _ { x } ^ { \infty } e ^ { - t ^ { 2 } } d t < \frac { e ^ { - x ^ { 2 } } } { \sqrt { 2 \pi } x }
450
+ $$
451
+
452
+ which is valid for $x > 0$ , and can be found in Abramowitz & Stegun (1965).
453
+
454
+ # B PROOF OF LEMMA 4
455
+
456
+ Our proof emulates the method of Talagrand, with minor modifications that extend the result to other $\ell _ { p }$ norms. We need the following standard inequality. Proof can be found in Talagrand (1995; 1996).
457
+
458
+ Lemma 6 (Talagrand). Consider a probability space $\Omega$ with measure $\mu$ . For $g : \Omega \to [ 0 , 1 ]$ , we have
459
+
460
+ $$
461
+ \int _ { \Omega } \operatorname* { m i n } \left( e ^ { t } , \frac { 1 } { g ^ { \alpha } } \right) d \mu \times \left( \int _ { \Omega } g d \mu \right) ^ { \alpha } \leq \exp \left( \frac { t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } \right) .
462
+ $$
463
+
464
+ Our proof of Lemma 3 follows the three-step process of Talagrand illustrated in Talagrand (1995). We begin by proving the bound
465
+
466
+ $$
467
+ \int e ^ { t f ( x , A ) } d x \leq { \frac { 1 } { \sigma ^ { \alpha } [ { \mathcal { A } } ] } } \exp \left( { \frac { n t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } } \right)
468
+ $$
469
+
470
+ where $\begin{array} { r } { f ( x , \mathcal { A } ) = \operatorname* { m i n } _ { y \in \mathcal { A } } \sum _ { i } | x _ { i } - y _ { i } | ^ { p } = d _ { p } ^ { p } ( x , \mathcal { A } ) } \end{array}$ is a measure of distance from $\mathcal { A }$ to $x$ , and $\alpha , t$ are arbitrary positive constants. Once this bound is established, a Markov bound can be used to obtain the final result. Finally, constants are tuned in order to optimize the tightness of the bound.
471
+
472
+ We start by proving the bound in equation 12 using induction on the dimension. The base case for the induction is $n = 1$ , and we have
473
+
474
+ $$
475
+ ^ { t } ( x , 4 ) d x \leq \sigma [ A ] + \int _ { A ^ { c } } e ^ { t f ( x , A ) } d x \leq \sigma [ A ] + \int _ { A ^ { c } } 1 d x \leq \sigma [ A ] + ( 1 - \sigma [ A ] ) e ^ { t } \leq \frac { 1 } { \sigma ^ { \alpha } [ A ] } \exp \left( \frac { t ^ { 2 } ( \alpha + 1 ) ( 1 - \sigma ) } { 8 \alpha } \right) e ^ { \alpha } .
476
+ $$
477
+
478
+ We now prove the result for $n$ dimensions using the inductive hypothesis. We can upper bound the integral by integrating over “slices” along one dimension. Let $\mathcal { A } \subset [ 0 , 1 ] ^ { n }$ . Define
479
+
480
+ $$
481
+ \mathcal { B } = \{ z \in \mathbb { R } ^ { n - 1 } | ( \omega , z ) \in \mathcal { A } \mathrm { f o r } \mathrm { s o m e } \omega \} .
482
+ $$
483
+
484
+ Clearly, the distance from $( \omega , z )$ to $\mathcal { A }$ is at most the distance from $z$ to $A _ { \omega }$ , and so
485
+
486
+ $$
487
+ \int e ^ { t f ( x , A ) } d x \leq \int _ { \omega \in [ 0 , 1 ] } \int _ { z \in [ 0 , 1 ] ^ { n - 1 } } e ^ { t f ( z , A _ { \omega } ) } d z d x \leq \int _ { \omega \in [ 0 , 1 ] } { \frac { 1 } { \sigma ^ { \alpha } [ A _ { \omega } ] } } \exp \left( { \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } } \right) .
488
+ $$
489
+
490
+ We also have that the distance from $x$ to $\mathcal { A }$ is at most one unit greater than the distance from $x$ to $\boldsymbol { B }$ . This gives us
491
+
492
+ $$
493
+ t f ( x , A ) d \boldsymbol { x } \leq \int _ { ( \omega , z ) \in [ 0 , 1 ] ^ { n } } e ^ { t ( f ( x , B ) + 1 ) } \leq e ^ { t } \int _ { ( \omega , z ) \in [ 0 , 1 ] ^ { n } } e ^ { t f ( x , B ) } \leq \frac { e ^ { t } } { \sigma ^ { \alpha } [ B ] } \exp \left( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } \right)
494
+ $$
495
+
496
+ Applying equation 6 gives us
497
+
498
+ $$
499
+ \begin{array} { r l } & { \int e ^ { t f ( x , A ) } d x \le \displaystyle \int _ { \omega \in [ 0 , 1 ] } \operatorname* { m i n } ( \frac { e ^ { t } } { \sigma ^ { \alpha } [ B ] } \exp ( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } ) , \frac { 1 } { \sigma ^ { \alpha } [ A _ { \omega } ] } \exp ( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } ) } \\ & { \qquad = \exp ( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } ) \frac { 1 } { \sigma ^ { \alpha } [ B ] } \int _ { \omega \in [ 0 , 1 ] } \operatorname* { m i n } ( e ^ { t } , \frac { \sigma ^ { \alpha } [ B ] } { \sigma ^ { \alpha } [ A _ { \omega } ] } ) . } \end{array}
500
+ $$
501
+
502
+ Now, we apply lemma 6 to equation 13 with $g ( \omega ) = \alpha [ \mathcal { A } _ { \omega } ] / \alpha [ B ]$ to arrive at equation 12.
503
+
504
+ The second step of the proof is to produce a Markov inequality from equation 12. For the bound in equation 12 to hold, we need
505
+
506
+ $$
507
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] = \sigma \{ x | f ( x ) > \epsilon ^ { p } \} \leq \frac { \int e ^ { t f ( x , A ) } d x } { e ^ { t \epsilon ^ { p } } } \leq \frac { \exp \left( \frac { n t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } \right) } { \sigma ^ { \alpha } [ A ] e ^ { t \epsilon ^ { p } } } .
508
+ $$
509
+
510
+ The third step is to optimize the bound by choosing constants. We minimize the right hand side by choosing $\begin{array} { r } { t = \frac { 4 \alpha \epsilon ^ { p } } { n ( \alpha + 1 ) } } \end{array}$ to get
511
+
512
+ $$
513
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] \leq \frac { \exp \left( - \frac { 2 \alpha \epsilon ^ { 2 p } } { n ( \alpha + 1 ) } \right) } { \sigma ^ { \alpha } [ A ] } .
514
+ $$
515
+
516
+ Now, we can simply choose $\alpha = 1$ to get the simple bound
517
+
518
+ $$
519
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] \leq \frac { \exp \left( - \epsilon ^ { 2 p } / n \right) } { \sigma [ A ] } ,
520
+ $$
521
+
522
+ or we can choose the optimal value of $\begin{array} { r } { \alpha = \sqrt { \frac { 2 \epsilon ^ { 2 p } } { n \log ( 1 / \sigma ) } } - 1 } \end{array}$ , which optimizes the bound in the case $\epsilon ^ { 2 p } \geq$ $\textstyle { \frac { n } { 2 } } \log ( 1 / \sigma ( { \mathcal { A } } ) )$ . We arrive at
523
+
524
+ $$
525
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] \leq \exp \left( - \frac { 2 } { n } \left( \epsilon ^ { p } - \sqrt { n \log ( \sigma ^ { - 1 } [ A ] ) / 2 } \right) ^ { 2 } \right) .
526
+ $$
527
+
528
+ This latter bound is stronger than we need to prove Lemma 3, but it will come in handy later to prove Theorem 4.
529
+
530
+ # C PROOF OF THEOREMS 2 AND 3
531
+
532
+ We combine the proofs of these results since their proofs are nearly identical. The proofs closely follow the argument of Theorem 1.
533
+
534
+ Choose a class $c$ with $f _ { c } \ \leq \ { \frac { 1 } { 2 } }$ and let ${ \mathcal R } = \{ x | { \mathcal C } ( x ) = c \}$ denote the subset of the cube lying in class $c$ according to the classifier $\mathcal { C }$ . Let $\overline { { \mathcal { R } } }$ be the complement, who’s $\ell _ { p }$ expansion is denoted $\overline { { \mathcal { R } } } ( \epsilon ; d _ { p } )$ . Because $\overline { { \mathcal { R } } }$ covers at least half the cube, we can invoke Lemma 3. We have that
535
+
536
+ $$
537
+ \mathrm { v o l } [ \overline { { \mathcal { R } } } ( \epsilon ; h ) ] \geq 1 - \delta ,
538
+ $$
539
+
540
+ where
541
+
542
+ The set $\overline { { \mathcal { R } } } ( \epsilon ; h )$ contains all points that are correctly classified and safe from adversarial perturbations. This region has volume at most $\delta$ , and the probability of a sample from the class distribution $\rho _ { c }$ lying in this region is at most $U _ { c } \delta$ . We then subtract this from 1 to obtain the mass of the class distribution lying in the “unsafe” region $\overline { { \mathcal { R } } } _ { c }$ .
543
+
544
+ # D PROOF OF THEOREM 4
545
+
546
+ Let $\mathcal { A }$ denote the support of $p _ { c }$ , and suppose that this support has measure $\mathrm { v o l } [ \mathcal { A } ] = \eta$ . We want to show that, for large enough $\epsilon$ , the expansion $\boldsymbol { \mathcal { A } } ( \epsilon , d _ { p } )$ is larger than half the cube. Since class $c$ occupies less than half the cube, this would imply that $A ( \epsilon , d _ { p } )$ overlaps with other classes, and so there must be data points in $\mathcal { A }$ with $\epsilon$ -adversarial examples.
547
+
548
+ We start with the case $p > 0$ , where we bound $\boldsymbol { \mathcal { A } } ( \epsilon , d _ { p } )$ using equation 2 of Lemma 3. To do this, we need to approximate $\Phi ^ { - 1 } ( \eta )$ . This can be done using the inequality
549
+
550
+ $$
551
+ \Phi ( \alpha ) = \frac { 1 } { 2 \pi } \int _ { - \infty } ^ { \alpha } e ^ { - t ^ { 2 } / 2 } d t \le \frac { 1 } { 2 } e ^ { - \alpha ^ { 2 } / 2 } ,
552
+ $$
553
+
554
+ which holds for $\alpha < 0$ . Rearranging, we obtain
555
+
556
+ $$
557
+ \alpha \geq - \sqrt { \log \frac { 1 } { 4 \Phi ( \alpha ) ^ { 2 } } } .
558
+ $$
559
+
560
+ Now, if $\alpha = \Phi ^ { - 1 } ( \eta )$ , then $\Phi ( \alpha ) = \eta$ , and equation 19 gives us $\alpha \geq - \sqrt { \log { \frac { 1 } { 4 \eta ^ { 2 } } } }$ . Plugging this into equation 2 of Lemma 3, we get
561
+
562
+ $$
563
+ \mathrm { v o l } [ { \cal A } ( \epsilon , d _ { p } ) ] \ge \Phi ( \alpha + \epsilon ) \ge \Phi \left( - \sqrt { \log \frac { 1 } { 4 \eta ^ { 2 } } } + \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon \right) .
564
+ $$
565
+
566
+ The quantity on the left will be greater than $\frac { 1 } { 2 }$ , thus guaranteeing adversarial examples, if
567
+
568
+ $$
569
+ \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon > \sqrt { \log \frac { 1 } { 4 \eta ^ { 2 } } } .
570
+ $$
571
+
572
+ This can be re-arranged to obtain the desired result.
573
+
574
+ In the case $p = 0$ , we need to use equation 17 from the proof of Lemma 3 in Appendix B, which we restate here
575
+
576
+ $$
577
+ \mathrm { v o l } [ \boldsymbol { A } ( \epsilon , d _ { 0 } ) ] \ge 1 - \exp \left( - \frac { 2 } { n } \left( \epsilon - \sqrt { n \log ( 1 / \eta ) / 2 } \right) ^ { 2 } \right) .
578
+ $$
579
+
580
+ This bound is valid, and produces a non-vacuous guarantee of adversarial examples, if
581
+
582
+ $$
583
+ \exp \left( - \frac { 2 } { n } \left( \epsilon - \sqrt { n \log ( 1 / \eta ) / 2 } \right) ^ { 2 } \right) < \frac { 1 } { 2 } .
584
+ $$
585
+
586
+ which holds if
587
+
588
+ $$
589
+ \eta > \exp \left( - \frac { 2 \left( \epsilon - \sqrt { n \log { 2 / 2 } } \right) ^ { 2 } } { n } \right) .
590
+ $$
591
+
592
+ # E PROOF OF THEOREM 5
593
+
594
+ Assume that any MNIST classifier can be fooled by perturbations of size at most $\epsilon$ with probability at least $p$ . To begin, we put a bound on the susceptibility of any $b$ -MNIST classifier (for $b \geq 1$ ) under this assumption. We can classify MNIST images by upsampling them to resolution $2 8 b \times 2 8 b$ and feeding them into a highresolution “back-end” classifier. After upsampling, an MNIST image with perturbation of norm $\epsilon$ becomes a $2 8 b \times 2 8 b$ image with perturbation of norm $b \epsilon$ . The classifier we have constructed takes low-resolution images as inputs, and so by assumption it is fooled with probability at least $p$ . However, the low-resolution classifier is fooled only when the high-resolution “back-end” classifier is fooled, and so the high-resolution classifier is fooled with probability at least $p$ at well. Note that we can build this two-scale classifier using any high-resolution classifier as a back-end, and so this bound holds uniformly over all high-resolution classifiers.
595
+
596
+ Likewise, suppose we classify $b$ -MNIST images (for integer $b \geq 1$ ) by downsampling them to the original $2 8 \times 2 8$ resolution (by averaging pixel blocks) and feeding them into a “back-end” low-resolution classifier. After downsampling, a $2 8 b \times 2 8 b$ image with perturbation of norm $b \epsilon$ becomes a $2 8 \times 2 8$ image with perturbation of norm at most $\epsilon$ . Whenever the high-resolution classifier is fooled, it is only because the back-end classifier is fooled by a perturbation of size at most $\epsilon$ , and this happens with probability at least $p$ .
parse/train/r1lWUoA9FQ/r1lWUoA9FQ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/r1lWUoA9FQ/r1lWUoA9FQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/r1lWUoA9FQ/r1lWUoA9FQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkxacs0qY7/rkxacs0qY7.md ADDED
@@ -0,0 +1,689 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FUNCTIONAL VARIATIONAL BAYESIAN NEURAL NETWORKS
2
+
3
+ Shengyang $\mathbf { S u n ^ { * \dagger } }$ , Guodong Zhang∗†, Jiaxin $\mathbf { S h i ^ { * \dagger } }$ , Roger Grosse†
4
+ †University of Toronto, †Vector Institute, ‡Tsinghua University
5
+ {ssy, gdzhang, rgrosse}@cs.toronto.edu, shijx15@mails.tsinghua.edu.cn
6
+
7
+ # ABSTRACT
8
+
9
+ Variational Bayesian neural networks (BNNs) perform variational inference over weights, but it is difficult to specify meaningful priors and approximate posteriors in a high-dimensional weight space. We introduce functional variational Bayesian neural networks (fBNNs), which maximize an Evidence Lower BOund (ELBO) defined directly on stochastic processes, i.e. distributions over functions. We prove that the KL divergence between stochastic processes equals the supremum of marginal KL divergences over all finite sets of inputs. Based on this, we introduce a practical training objective which approximates the functional ELBO using finite measurement sets and the spectral Stein gradient estimator. With fBNNs, we can specify priors entailing rich structures, including Gaussian processes and implicit stochastic processes. Empirically, we find fBNNs extrapolate well using various structured priors, provide reliable uncertainty estimates, and scale to large datasets.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Bayesian neural networks (BNNs) (Hinton & Van Camp, 1993; Neal, 1995) have the potential to combine the scalability, flexibility, and predictive performance of neural networks with principled Bayesian uncertainty modelling. However, the practical effectiveness of BNNs is limited by our ability to specify meaningful prior distributions and by the intractability of posterior inference. Choosing a meaningful prior distribution over network weights is difficult because the weights have a complicated relationship to the function computed by the network. Stochastic variational inference is appealing because the update rules resemble ordinary backprop (Graves, 2011; Blundell et al., 2015), but fitting accurate posterior distributions is difficult due to strong and complicated posterior dependencies (Louizos & Welling, 2016; Zhang et al., 2018; Shi et al., 2018a).
14
+
15
+ In a classic result, Neal (1995) showed that under certain assumptions, as the width of a shallow BNN was increased, the limiting distribution is a Gaussian process (GP). Lee et al. (2018) recently extended this result to deep BNNs. Deep Gaussian Processes (DGP) (Cutajar et al., 2017; Salimbeni & Deisenroth, 2017) have close connections to BNNs due to similar deep structures. However, the relationship of finite BNNs to GPs is unclear, and practical variational BNN approximations fail to match the predictions of the corresponding GP. Furthermore, because the previous analyses related specific BNN architectures to specific GP kernels, it’s not clear how to design BNN architectures for a given kernel. Given the rich variety of structural assumptions that GP kernels can represent (Rasmussen & Williams, 2006; Lloyd et al., 2014; Sun et al., 2018), there remains a significant gap in expressive power between BNNs and GPs (not to mention stochastic processes more broadly).
16
+
17
+ In this paper, we perform variational inference directly on the distribution of functions. Specifically, we introduce functional variational BNNs (fBNNs), where a BNN is trained to produce a distribution of functions with small KL divergence to the true posterior over functions. We prove that the KL divergence between stochastic processes can be expressed as the supremum of marginal KL divergences at finite sets of points. Based on this, we present functional ELBO (fELBO) training objective. Then we introduce a GAN-like minimax formulation and a sampling-based approximation for functional variational inference. To approximate the marginal KL divergence gradients, we adopt the recently proposed spectral Stein gradient estimator (SSGE) (Shi et al., 2018b).
18
+
19
+ ![](images/e2a9c9f47e26b4abb7c4b2c6b1c8a9d761ceef7f8d84833f66e8e46a95434419.jpg)
20
+ Figure 1: Predictions on the toy funcction $y = x ^ { 3 }$ . Here $a \times b$ represents $a$ hidden layers of $b$ units. Red dots are 20 training points. The blue curve is the mean of final prediction, and the shaded areas represent standard derivations. We compare fBNNs and Bayes-by-Backprop (BBB). For BBB, which performs weight-space inference, varying the network size leads to drastically different predictions. For fBNNs, which perform functionspace inference, we observe consistent predictions for the larger networks. Note that the $1 \times 1 0 0$ factorized Gaussian fBNNs network is not expressive enough to generate diverse predictions.
21
+
22
+ Our fBNNs make it possible to specify stochastic process priors which encode richly structured dependencies between function values. This includes stochastic processes with explicit densities, such as GPs which can model various structures like smoothness and periodicity (Lloyd et al., 2014; Sun et al., 2018). We can also use stochastic processes with implicit densities, such as distributions over piecewise linear or piecewise constant functions. Furthermore, in contrast with GPs, fBNNs efficiently yield explicit posterior samples of the function. This enables fBNNs to be used in settings that require explicit minimization of sampled functions, such as Thompson sampling (Thompson, 1933; Russo & Van Roy, 2016) or predictive entropy search (Hernández-Lobato et al., 2014; Wang & Jegelka, 2017).
23
+
24
+ One desideratum of Bayesian models is that they behave gracefully as their capacity is increased (Rasmussen & Ghahramani, 2001). Unfortunately, ordinary BNNs don’t meet this basic requirement: unless the asymptotic regime is chosen very carefully (e.g. Neal (1995)), BNN priors may have undesirable behaviors as more units or layers are added. Furthermore, larger BNNs entail more difficult posterior inference and larger description length for the posterior, causing degeneracy for large networks, as shown in Figure 1. In contrast, the prior of fBNNs is defined directly over the space of functions, thus the BNN can be made arbitrarily large without changing the functional variational inference problem. Hence, the predictions behave well as the capacity increases.
25
+
26
+ Empirically, we demonstrate that fBNNs generate sensible extrapolations for both explicit periodic priors and implicit piecewise priors. We show fBNNs outperform competing approaches on both small scale and large scale regression datasets. fBNNs’ reliable uncertainty estimates enable state-of-art performance on the contextual bandits benchmark of Riquelme et al. (2018).
27
+
28
+ # 2 BACKGROUND
29
+
30
+ # 2.1 VARIATIONAL INFERENCE FOR BAYESIAN NEURAL NETWORKS
31
+
32
+ Given a dataset $\mathbf { \mathcal { D } } = \{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ , a Bayesian neural network (BNN) is defined in terms of a prior $p ( \mathbf { w } )$ on the weights, as well as the likelihood $p ( \mathcal { D } | \mathbf { w } )$ . Variational Bayesian methods (Hinton $\&$ Van Camp, 1993; Graves, 2011; Blundell et al., 2015) attempt to fit an approximate posterior $q ( \mathbf { w } )$ to maximize the evidence lower bound (ELBO):
33
+
34
+ $$
35
+ \mathcal { L } _ { q } = \mathbb { E } _ { q } [ \log p ( \mathcal { D } | \mathbf { w } ) ] - \mathrm { K L } [ q ( \mathbf { w } ) | | p ( \mathbf { w } ) ] .
36
+ $$
37
+
38
+ The most commonly used variational BNN training method is Bayes By Backprop (BBB) (Blundell et al., 2015), which uses a fully factorized Gaussian approximation to the posterior, i.e. $q ( \mathbf { w } ) =$ $\mathcal { N } ( \mathbf { w } ; \pmb { \mu } , \mathrm { d i a g } ( \pmb { \sigma } ^ { 2 } ) )$ . Using the reparameterization trick (Kingma & Welling, 2013), the gradients of ELBO towards $\mu , \sigma$ can be computed by backpropagation, and then be used for updates.
39
+
40
+ Most commonly, the prior $p ( \mathbf { w } )$ is chosen for computational convenience; for instance, independent Gaussian or Gaussian mixture distributions. Other priors, including log-uniform priors (Kingma et al., 2015; Louizos et al., 2017) and horseshoe priors (Ghosh et al., 2018; Louizos et al., 2017), were proposed for specific purposes such as model compression and model selection. But the relationships of weight-space priors to the functions computed by networks are difficult to characterize.
41
+
42
+ # 2.2 STOCHASTIC PROCESSES
43
+
44
+ A stochastic process (Lamperti, 2012) $F$ is typically defined as a collection of random variables, on a probability space $( \Omega , { \mathcal { F } } , P )$ . The random variables, indexed by some set $\mathcal { X }$ , all take values in the same mathematical space $\mathcal { V }$ . In other words, given a probability space $( \Omega , \Sigma , P )$ , a stochastic process can be simply written as $\{ F ( \mathbf { x } ) : \mathbf { x } \in \mathcal { X } \}$ . For any point $\omega \in \Omega$ , $F ( \cdot , \omega )$ is a sample function mapping index space $\mathcal { X }$ to space $\mathcal { V }$ , which we denote as $f$ for notational simplicity.
45
+
46
+ For any finite index set $\mathbf { x } _ { 1 : n } = \{ { \mathbf { x } } _ { 1 } , . . . , { \mathbf { x } } _ { n } \}$ , we can define the finite-dimensional marginal joint distribution over function values $\{ F ( \mathbf { x } _ { 1 } ) , \dot { \mathbf { \Omega } } \cdot \cdot \cdot \mathbf { \Omega } , F ( \mathbf { x } _ { n } ) \}$ . For example, Gaussian Processes have marginal distributions as multivariate Gaussians.
47
+
48
+ The Kolmogorov Extension Theorem (Øksendal, 2003) shows that a stochastic process can be characterized by marginals over all finite index sets. Specifically, for a collection of joint distributions $\rho _ { \mathbf { x } _ { 1 : n } }$ , we can define a stochastic process $F$ such that for all $\mathbf { x } _ { 1 : n } , \ \rho _ { \mathbf { x } _ { 1 : n } }$ is the marginal joint distribution of $F$ at $\mathbf { x } _ { 1 : n }$ , as long as $\rho$ satisfies the following two conditions:
49
+
50
+ Exchangeability. For any permutation $\pi$ of $\{ 1 , \cdots , n \}$ $\cdot \cdot , n \} , \rho _ { \pi ( \mathbf { x } _ { 1 : n } ) } ( \pi ( y _ { 1 : n } ) ) = \rho _ { \mathbf { x } _ { 1 : n } } ( y _ { 1 : n } ) .$
51
+
52
+ # 2.3 SPECTRAL STEIN GRADIENT ESTIMATOR (SSGE)
53
+
54
+ When applying Bayesian methods to modern probabilistic models, especially those with neural networks as components (e.g., BNNs and deep generative models), it is often the case that we have to deal with intractable densities. Examples include the marginal distribution of a non-conjugate model (e.g., the output distribution of a BNN), and neural samplers such as GANs (Goodfellow et al., 2014). A shared property of these distributions is that they are defined through a tractable sampling process, despite the intractable density. Such distributions are called implicit distributions (Huszár, 2017).
55
+
56
+ The Spectral Stein Gradient Estimator (SSGE) (Shi et al., 2018b) is a recently proposed method for estimating the log density derivative function of an implicit distribution, only requiring samples from the distribution. Specifically, given a continuous differentiable density $q ( \mathbf { x } )$ , and a positive definite kernel $k ( \mathbf { x } , \mathbf { x } ^ { \prime } )$ in the Stein class (Liu et al., 2016) of $q$ , they show
57
+
58
+ $$
59
+ \nabla _ { x _ { i } } \log { q ( \mathbf { x } ) } = - \sum _ { j = 1 } ^ { \infty } \Big [ \mathbb { E } _ { q } \nabla _ { x _ { i } } \psi _ { j } ( \mathbf { x } ) \Big ] \psi _ { j } ( \mathbf { x } ) ,
60
+ $$
61
+
62
+ where $\{ \psi _ { j } \} _ { j \ge 1 }$ is a series of eigenfunctions of $k$ given by Mercer’s theorem: $k ( \mathbf { x } , \mathbf { x } ^ { \prime } ) ~ =$ $\begin{array} { r } { \sum _ { j } \mu _ { j } \psi _ { j } ( \mathbf { x } ) \bar { \psi } _ { j } ( \mathbf { x } ^ { \prime } ) } \end{array}$ . The Nyström method (Baker, 1997; Williams & Seeger, 2001) is used to approximate the eigenfunctions $\psi _ { j } ( \mathbf { x } )$ and their derivatives. The final estimator is given by truncating the sum in Equation (2) and replacing the expectation by Monte Carlo estimates.
63
+
64
+ # 3 FUNCTIONAL VARIATIONAL BAYESIAN NEURAL NETWORKS
65
+
66
+ # 3.1 FUNCTIONAL EVIDENCE LOWER BOUND (fELBO)
67
+
68
+ We introduce function space variational inference analogously to weight space variational inference (see Section 2.1), except that the distributions are over functions rather than weights. We assume a stochastic process prior $p$ over functions $f : \mathcal { X } \mathcal { Y }$ . This could be a GP, but we also allow stochastic processes without closed-form marginal densities, such as distributions over piecewise linear functions. For the variational posterior $q _ { \phi } \in \mathcal { Q }$ , we consider a neural network architecture with stochastic weights and/or stochastic inputs. Specifically, we sample a function from $q$ by sampling a random noise vector $\xi$ and defining $f ( { \bf x } ) { \bar { \bf \phi } } = g _ { \phi } ( { \bf x } , \xi )$ for some function $g _ { \phi }$ . For example, standard weight space BNNs with factorial Gaussian posteriors can be viewed this way using the reparameterization trick (Kingma & Welling, 2013; Blundell et al., 2015). (In this case, $\phi$ corresponds to the means and variances of all the weights.) Note that because a single vector $\xi$ is shared among all input locations, it corresponds to randomness in the function, rather than observation noise; hence, the sampling of $\xi$ corresponds to epistemic, rather than aleatoric, uncertainty (Depeweg et al., 2017).
69
+
70
+ Functional variational inference maximizes the functional ELBO (fELBO), akin to the weight space ELBO in Equation (1), except that the distributions are over functions rather than weights.
71
+
72
+ $$
73
+ \mathcal { L } ( q ) : = \mathbb { E } _ { q } [ \log p ( \mathcal { D } | f ) ] - \mathrm { K L } [ q | | p ] .
74
+ $$
75
+
76
+ Here $\mathrm { K L } [ q \| p ]$ is the KL divergence between two stochastic processes. As pointed out in Matthews et al. (2016), it does not have a convenient form as g q(f)p(f) q(f )df due to there is no infinitedimensional Lebesgue measure (Eldredge, 2016). Since the KL divergence between stochastic processes is difficult to work with, we reduce it to a more familiar object: KL divergence between the marginal distributions of function values at finite sets of points, which we term measurement sets. Specifically, let $\mathbf { X } \in { \mathcal { X } } ^ { n }$ denote a finite measurement set and $P _ { \mathbf { X } }$ the marginal distribution of function values at $\mathbf { X }$ . We equate the function space KL divergence to the supremum of marginal KL divergences over all finite measurement sets:
77
+
78
+ Theorem 1. For two stochastic processes $P$ and $Q$ ,
79
+
80
+ $$
81
+ \mathrm { K L } [ P \| Q ] = \operatorname* { s u p } _ { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } \mathrm { K L } [ P _ { \mathbf { X } } \| Q _ { \mathbf { X } } ] .
82
+ $$
83
+
84
+ Roughly speaking, this result follows because the $\sigma$ -algebra constructed with the Kolmogorov Extension Theorem (Section 2.2) is generated by cylinder sets which depend only on finite sets of points. A full proof is given in Appendix A.
85
+
86
+ fELBO. Using this characterization of the functional $\mathrm { K L }$ divergence, we rewrite the fELBO:
87
+
88
+ $$
89
+ \begin{array} { r l } & { \mathcal { L } ( q ) = \mathbb { E } _ { q } [ \log p ( \mathcal { D } | f ) ] - \underset { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } { \operatorname* { s u p } } \mathrm { K L } [ q ( \mathbf { f } ^ { \mathbf { X } } ) | | p ( \mathbf { f } ^ { \mathbf { X } } ) ] } \\ & { \quad \quad = \underset { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } { \operatorname* { i n f } } \ \underset { ( \mathbf { x } _ { i } , y _ { i } ) \in \mathcal { D } } { \sum } \mathbb { E } _ { q } [ \log p ( y _ { i } | f ( \mathbf { x } _ { i } ) ) ] - \mathrm { K L } [ q ( \mathbf { f } ^ { \mathbf { X } } ) | | p ( \mathbf { f } ^ { \mathbf { X } } ) ] } \\ & { \quad : = \underset { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } { \operatorname* { i n f } } \mathcal { L } _ { \mathbf { X } } ( q ) . } \end{array}
90
+ $$
91
+
92
+ We also denote $\mathcal { L } _ { n } ( q ) : = \operatorname* { i n f } _ { \mathbf { X } \in \mathcal { X } ^ { n } } \mathcal { L } _ { \mathbf { X } } ( q )$ for the restriction to sets of $n$ points. This casts maximizing the fELBO as a two-player zero-sum game analogous to a generative adversarial network (GAN) (Goodfellow et al., 2014): one player chooses the stochastic network, and the adversary chooses the measurement set. Note that the infimum may not be attainable, because the size of the measurement sets is unbounded. In fact, the function space KL divergence may be infinite, for instance if the prior assigns measure zero to the set of functions representable by a neural network (Arjovsky & Bottou, 2017). Observe that GANs face the same issue: because a generator network is typically limited to a submanifold of the input domain, an ideal discriminator could discriminate real and fake images perfectly. However, by limiting the capacity of the discriminator, one obtains a useful training objective. By analogy, we obtain a well-defined and practically useful training objective by restricting the measurement sets to a fixed finite size. This is discussed further in the next section.
93
+
94
+ # 3.2 CHOOSING THE MEASUREMENT SET
95
+
96
+ As discussed above, we approximate the fELBO using finite measurement sets to have a well-defined and practical optimization objective. We now discuss how to choose the measurement sets.
97
+
98
+ Adversarial Measurement Sets. The minimax formulation of the fELBO naturally suggests a two-player zero-sum game, analogous to GANs, whereby one player chooses the stochastic network representing the posterior, and the adversary chooses the measurement set.
99
+
100
+ $$
101
+ \operatorname* { m a x } _ { q \in \mathcal { Q } } \mathcal { L } _ { m } ( q ) : = \operatorname* { m a x } _ { q \in \mathcal { Q } } \ \operatorname* { m i n } _ { \mathbf { x } \in \mathcal { X } ^ { m } } \mathcal { L } _ { \mathbf { X } } ( q ) .
102
+ $$
103
+
104
+ We adopt concurrent optimization akin to GANs (Goodfellow et al., 2014). In the inner loop, we minimize $\mathcal { L } _ { \mathbf { X } } ( q )$ with respect to $\mathbf { X }$ ; in the outer loop, we maximize $\mathcal { L } _ { \mathbf { X } } ( q )$ with respect to $q$ .
105
+
106
+ Unfortunately, this approach did not perform well in terms of generalization. The measurement set which maximizes the KL term is likely to be close to the training data, since these are the points where one has the most information about the function. But the KL term is the only part of the fELBO encouraging the network to match the prior structure. Hence, if the measurement set is close to the training data, then nothing will encourage the network to exploit the structured prior for extrapolation.
107
+
108
+ Sampling-Based Measurement Sets. Instead, we adopt a sampling-based approach. In order to use a structured prior for extrapolation, the network needs to match the prior structure both near the training data and in the regions where it must make predictions. Therefore, we sample measurement sets which include both (a) random training inputs, and (b) random points from the domain where one is interested in making predictions. We replace the minimization in Equation (6) with a sampling distribution $c$ , and then maximize the expected $\mathcal { L } _ { \mathbf { X } } ( q )$ :
109
+
110
+ $$
111
+ \operatorname* { m a x } _ { \boldsymbol { q } \in \mathcal { Q } } \mathbb { E } _ { \mathcal { D } _ { s } } \mathbb { E } _ { \mathbf { X } ^ { M } \sim c } \mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D _ { s } } } ( \boldsymbol { q } ) .
112
+ $$
113
+
114
+ where $\mathbf { X } ^ { M }$ are $M$ points independently drawn from $c$
115
+
116
+ Consistency. With the restriction to finite measurement sets, one only has an upper bound on the true fELBO. Unfortunately, this means the approximation is not a lower bound on the log marginal likelihood (log-ML) $\log p ( \mathcal { D } )$ . Interestingly, if the measurement set is chosen to include all of the training inputs, then $\mathcal { L } ( q )$ is in fact a log-ML lower bound:
117
+
118
+ Theorem 2 (Lower Bound). If the measurement set $\mathbf { X }$ contains all the training inputs $\mathbf { X } ^ { D }$ , then
119
+
120
+ $$
121
+ \begin{array} { r } { \mathcal { L } _ { \mathbf { X } } ( q ) = \log p ( \mathcal { D } ) - \mathrm { K L } [ q ( \mathbf { f } ^ { \mathbf { X } } ) \lVert p ( \mathbf { f } ^ { \mathbf { X } } | \mathcal { D } ) ] \leq \log p ( \mathcal { D } ) . } \end{array}
122
+ $$
123
+
124
+ The proof is given in Appendix B.1.
125
+
126
+ To better understand the relationship between adversarial and sampling-based inference, we consider the idealized scenario where the measurement points in both approaches include all training locations, i.e., $\mathbf { X } = \{ \mathbf { X } ^ { D } , \mathbf { X } ^ { M } \}$ . Let $\mathbf { f } ^ { M } , \mathbf { f } ^ { D }$ be the function values at $\dot { \mathbf { X } } ^ { M } , \mathbf { X } ^ { D }$ , respectively. By Theorem 2,
127
+
128
+ $$
129
+ \mathcal { L } _ { { \bf X } ^ { M } , { \bf X } ^ { D } } ( q ) = \log p ( \mathcal { D } ) - \mathrm { K L } [ q ( { \bf f } ^ { M } , { \bf f } ^ { D } ) \| p ( { \bf f } ^ { M } , { \bf f } ^ { D } | \mathcal { D } ) ] .
130
+ $$
131
+
132
+ So maximizing $\mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D } } ( q )$ is equivalent to minimizing the KL divergence from the true posterior on points $\mathbf { X } ^ { M } , \mathbf { X } ^ { D }$ . Based on this, we have the following consistency theorem that helps justify the use of adversarial and sampling-based objectives with finite measurement points.
133
+
134
+ Corollary 3 (Consistency under finite measurement points). Assume that the true posterior $p ( f | \mathcal { D } )$ is a Gaussian process and the variational family $\mathcal { Q }$ is all Gaussian processes. We have the following results if $M > 1$ and $\operatorname { s u p p } ( c ) = \mathcal { X }$ :
135
+
136
+ $$
137
+ \underbrace { \underset { q \in \mathcal { Q } } { \operatorname { a r g m a x } } \left\{ \underset { \mathbf { X } ^ { M } } { \operatorname* { m i n } } \mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D } } ( q ) \right\} } _ { A d v e r s a r i a l } = \underbrace { \underset { q \in \mathcal { Q } } { \operatorname { a r g m a x } } \left\{ \mathbb { E } _ { \mathbf { X } ^ { M } \sim \mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D } } } ( q ) \right\} } _ { S a m p l i n g . B a s e d } = p ( f | \mathcal { D } ) .
138
+ $$
139
+
140
+ The proof is given in Appendix B.2. While it is usually impractical for the measurement set to contain all the training inputs, it is still reassuring that a proper lower bound can be obtained with a finite measurement set.
141
+
142
+ # 3.3 KL DIVERGENCE GRADIENTS
143
+
144
+ While the likelihood term of the fELBO is tractable, the KL divergence term remains intractable because we don’t have an explicit formula for the variational posterior density $q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } )$ . (Even if $q _ { \phi }$ is chosen to have a tractable density in weight space (Louizos $\&$ Welling, 2017), the marginal distribution over $\mathbf { f } ^ { \mathbf { X } }$ is likely intractable.) To derive an approximation, we first observe that
145
+
146
+ $$
147
+ \nabla _ { \phi } \mathrm { K L } \big [ q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } ) \| p ( \mathbf { f } ^ { \mathbf { X } } ) \big ] = \mathbb { E } _ { q } \left[ \nabla _ { \phi } \log q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } ) \right] + \mathbb { E } _ { \xi } \left[ \nabla _ { \phi } \mathbf { f } ^ { \mathbf { X } } \big ( \nabla _ { \mathbf { f } } \log q ( \mathbf { f } ^ { \mathbf { X } } ) - \mathrm { ~ ~ \xi ~ } \big ~ \right) \big ] .
148
+ $$
149
+
150
+ The first term (expected score function) in Equation (11) is zero, so we discard it.1 The Jacobian $\nabla _ { \phi } \mathbf { f } ^ { \mathbf { X } }$ can be exactly multiplied by a vector using backpropagation. Therefore, it remains to estimate the log-density derivatives $\nabla _ { \mathbf { f } } \log q ( \mathbf { f } ^ { \mathbf { X } } )$ and $\cdot$ .
151
+
152
+ The entropy derivative $\nabla _ { \mathbf { f } } \log { q ( \mathbf { f } ^ { \mathbf { X } } ) }$ is generally intractable. For priors with tractable marginal densities such as GPs (Rasmussen & Williams, $\dot { 2 0 0 6 } ) ^ { 2 }$ and Student-t Processes (Shah et al., 2014), $\nabla _ { \mathbf { f } } \log { p ( \mathbf { f } ^ { \mathbf { X } } ) }$ is tractable. However, we are also interested in implicit stochastic process priors, i.e. $\nabla _ { \mathbf { f } } \log { p ( \mathbf { f } ^ { \mathbf { X } } ) }$ is also intractable. Because the SSGE (see Section 2.3) can estimate score functions for both in-distribution and out-of-distribution samples, we use it to estimate both derivative terms in all our experiments. (We compute $\cdot$ exactly whenever it is tractable.)
153
+
154
+ # Algorithm 1 Functional Variational Bayesian Neural Networks (fBNNs)
155
+
156
+ Require: Dataset $\mathcal { D }$ , variational posterior $g ( \cdot )$ , prior $p$ (explicit or implicit), KL weight $\lambda$ .
157
+ Require: Sampling distribution $c$ for random measurement points.
158
+
159
+ 1: while $\phi$ not converged do
160
+ 2: $\mathbf { X } ^ { M } \sim c$ ; $D _ { S } \subset { \mathcal { D } }$
161
+ 3: $\mathbf { f } _ { i } = g ( [ \mathbf { X } ^ { M } , \mathbf { X } ^ { D _ { S } } ] , \xi _ { i } ; \phi ) , i = 1 \cdot \cdot \cdot k .$
162
+ 4: $\begin{array} { r } { \Delta _ { 1 } = \frac { 1 } { k } \frac { 1 } { | D _ { s } | } \sum _ { i } \sum _ { ( x , y ) } \nabla _ { \phi } \log p ( y | \mathbf { f } _ { i } ( x ) ) } \end{array}$
163
+ 5: $\Delta _ { 2 } = \mathrm { S S G E } ( p , \mathbf { f } _ { 1 : k } )$
164
+ 6: $\phi \gets \mathrm { O p t i m i z e r } ( \phi , \Delta _ { 1 } - \lambda \Delta _ { 2 } )$
165
+ 7: end while
166
+
167
+ . sample measurement points $\triangleright$ sample $k$ function values . compute log likelihood gradients $\triangleright$ estimate KL gradients $\triangleright$ update the parameters
168
+
169
+ # 3.4 THE ALGORITHM
170
+
171
+ Now we present the whole algorithm for fBNNs in Algorithm 1. In each iteration, our measurement points include a mini-batch $\mathcal { D } _ { s }$ from the training data and random points $\mathbf { X } ^ { M }$ from a distribution $c$ . We forward ${ \bf X } ^ { D _ { s } }$ and $\mathbf { X } ^ { M }$ together through the network $g ( \cdot ; \phi )$ which defines the variational posterior $q _ { \phi }$ . Then we try to maximize the following objective corresponding to fELBO:
172
+
173
+ $$
174
+ \frac { 1 } { | { \mathcal D } _ { s } | } \sum _ { ( { \bf x } , y ) \in { \mathcal D } _ { s } } \mathrm { E } _ { q _ { \phi } } \left[ \log p ( y | f ( { \bf x } ) ) \right] - \lambda \mathrm { K L } [ q ( { \bf f } ^ { { \mathcal D } _ { s } } , { \bf f } ^ { M } ) \| p ( { \bf f } ^ { { \mathcal D } _ { s } } , { \bf f } ^ { M } ) ] .
175
+ $$
176
+
177
+ Here $\lambda$ is a regularization hyperparameter. In principle, $\lambda$ should be set as $\frac { 1 } { | { \mathcal { D } } | }$ to match fELBO in Equation (5). However, because the KL in Equation (12) uses a restricted number of measurement points, it only terms a lower bound of the functional KL divergence $\mathrm { K L } [ q ( f ) | | p ( f ) ]$ , thus bigger $\lambda$ is favored to control overfitting. We used $\begin{array} { r } { \lambda = \frac { 1 } { \left| \mathcal { D } _ { s } \right| } } \end{array}$ in practice, in which case Equation (12) is a proper lower bound of $\log p ( \mathcal { D } _ { s } )$ , as shown in Theorem 2. Moreover, when using GP priors, we injected Gaussian noise on the function outputs for stability consideration (see Appendix D.1 for details).
178
+
179
+ # 4 RELATED WORK
180
+
181
+ Bayesian neural networks. Variational inference was first applied to neural networks by Peterson (1987) and Hinton & Van Camp (1993). More recently, Graves (2011) proposed a practical method for variational inference with fully factorized Gaussian posteriors which used a simple (but biased) gradient estimator. Improving on that work, Blundell et al. (2015) proposed an unbiased gradient estimator using the reparameterization trick of Kingma & Welling (2013). There has also been much work (Louizos & Welling, 2016; Sun et al., 2017; Zhang et al., 2018; Bae et al., 2018) on modelling the correlations between weights using more complex Gaussian variational posteriors. Some non-Gaussian variational posteriors have been proposed, such as multiplicative normalizing flows (Louizos & Welling, 2017) and implicit distributions (Shi et al., 2018a). Neural networks with dropout were also interpreted as BNNs (Gal & Ghahramani, 2016; Gal et al., 2017). Local reparameterization trick (Kingma et al., 2015) and Flipout (Wen et al., 2018) try to decorrelate the gradients within a mini-batch for reducing variances during training. However, all these methods place priors over the network parameters. Often, spherical Gaussian priors are placed over the weights for convenience. Other priors, including log-uniform priors (Kingma et al., 2015; Louizos et al., 2017) and horseshoe priors (Ghosh et al., 2018; Louizos et al., 2017), were proposed for specific purposes such as model compression and model selection. But the relationships of weight-space priors to the functions computed by networks are difficult to characterize.
182
+
183
+ Functional Priors. There have been other recent attempts to train BNNs in the spirit of functional priors. Flam-Shepherd et al. (2017) trained a BNN prior to mimic a GP prior, but they still required variational inference in weight space. Noise Contrastive Priors (Hafner et al., 2018) are somewhat similar in spirit to our work in that they use a random noise prior in the function space. The prior is incorporated by adding a regularization term to the weight-space ELBO, and is not rich enough to encourage extrapolation and pattern discovery. Neural Processes (NP) (Garnelo et al., 2018) try to model any conditional distribution given arbitrary data points, whose prior is specified implicitly by prior samples. However, in high dimensional spaces, conditional distributions become increasingly complicated to model. Variational Implicit Processes (VIP) (Ma et al., 2018) are, in a sense, the reverse of fBNNs: they specify BNN priors and use GPs to approximate the posterior. But the use of BNN priors means they can’t exploit richly structured GP priors or other stochastic processes.
184
+
185
+ ![](images/b8635efe5d53ddc9755238d46c6d89bd1d9092878dbabee158c30d2c37d98522.jpg)
186
+ Figure 2: Extrapolating periodic structure. Red dots denote 20 training points. The green and blue lines represent ground truth and mean prediction, respectively. Shaded areas correspond to standard deviations. We considered GP priors with two kernels: RBF (which does not model the periodic structure), and $\mathrm { P E R + R B F }$ (which does). In each case, the fBNN makes similar predictions to the exact GP. In contrast, the standard BBB (BBB-1) cannot even fit the training data, while BBB with scaling down KL by 0.001 (BBB-0.001) manages to fit training data, but fails to provide sensible extrapolations.
187
+
188
+ Scalable Gaussian Processes. Gaussian processes are difficult to apply exactly to large datasets since the computational requirements scale as $O ( N ^ { 3 } )$ time, and as $O ( \bar { N } ^ { 2 } )$ memory, where $N$ is the number of training cases. Multiple approaches have been proposed to reduce the computational complexity. However, sparse GP methods (Lázaro-Gredilla et al., 2010; Snelson & Ghahramani, 2006; Titsias, 2009; Hensman et al., 2013; 2015; Krauth et al., 2016) still suffer for very large dataset, while random feature methods (Rahimi & Recht, 2008; Le et al., 2013) and KISS-GP (Wilson & Nickisch, 2015; Izmailov et al., 2017) must be hand-tailored to a given kernel.
189
+
190
+ # 5 EXPERIMENTS
191
+
192
+ Our experiments had two main aims: (1) to test the ability of fBNNs to extrapolate using various structural motifs, including both implicit and explicit priors, and (2) to test if they perform competitively with other BNNs on standard benchmark tasks such as regression and contextual bandits.
193
+
194
+ In all of our experiments, the variational posterior is represented as a stochastic neural network with independent Gaussian distributions over the weights, i.e. $q ( \mathbf { w } ) = \mathcal { N } ( \mathbf { w } ; \pmb { \mu } , \mathrm { d i a g } ( \pmb { \sigma } ^ { 2 } ) )$ . 3 We always used the ReLU activation function unless otherwise specified. Measurement points were sampled uniformly from a rectangle containing the training inputs. More precisely, each coordinate was sampled from the interval $\begin{array} { r } { [ \bar { x } _ { \mathrm { m i n } } - \frac { d } { 2 } , x _ { \mathrm { m a x } } + \frac { d } { 2 } ] } \end{array}$ , where $x _ { \mathrm { m i n } }$ and $x _ { \mathrm { m a x } }$ are the minimum and maximum input values along that coordinate, and $d = x _ { \operatorname* { m a x } } - x _ { \operatorname* { m i n } }$ . For experiments where we used GP priors, we first fit the GP hyperparameters to maximize the marginal likelihood on subsets of the training examples, and then fixed those hyperparameters to obtain the prior for the fBNNs.
195
+
196
+ # 5.1 EXTRAPOLATION USING STRUCTURED PRIORS
197
+
198
+ Making sensible predictions outside the range of the observed data requires exploiting the underlying structure. In this section, we consider some illustrative examples where fBNNs are able to use structured priors to make sensible extrapolations. Appendix C.2 also shows the extrapolation of fBNNs for a time-series problem.
199
+
200
+ # 5.1.1 LEARNING PERIODIC STRUCTURES
201
+
202
+ Gaussian processes can model periodic structure using a periodic kernel plus a RBF kernel:
203
+
204
+ $$
205
+ k ( x , x ^ { \prime } ) = \sigma _ { 1 } ^ { 2 } \exp \left\{ - \frac { 2 \sin ^ { 2 } ( \pi | x - x ^ { \prime } | / p ) } { l _ { 1 } ^ { 2 } } \right\} + \sigma _ { 2 } ^ { 2 } \exp \left( - \frac { ( x - x ^ { \prime } ) ^ { 2 } } { 2 l _ { 2 } ^ { 2 } } \right)
206
+ $$
207
+
208
+ where $p$ is the period. In this experiment, we consider 20 inputs randomly sampled from the interval $[ - 2 , - 0 . 5 ] \cup [ 0 . 5 , 2 ] \ :$ , and targets $y$ which are noisy observations of a periodic function: $y = 2 * \sin ( 4 x ) + \epsilon$ with $\epsilon \sim \mathcal { N } ( 0 , 0 . 0 4 )$ . We compared our method with Bayes By Backprop (BBB) (Blundell et al., 2015) (with a spherical Gaussian prior on w) and Gaussian Processes. For fBNNs and GPs, we considered both a single RBF kernel (which does not capture the periodic structure) and $\mathrm { P E R + R B F }$ as in eq. (13) (which does).4
209
+
210
+ ![](images/95c2ee86077fa399ecbd42f5d2d3f2ad2b2e8f36d4ce81cd6e1bc8ac6af74242.jpg)
211
+ Figure 3: Implicit function priors and fBNN approximate posteriors. The leftmost column shows 3 prior samples. The other three columns show independent runs of the experiment. The red dots denote 40 training samples. We plot 4 posterior samples and show multiples of the predictive standard derivation as shaded areas.
212
+
213
+ As shown in Fig. 2, BBB failed to fit the training data, let alone recover the periodic pattern (since its prior does not encode any periodic structure). For this example, we view the GP with $\mathrm { P E R + R B F }$ as the gold standard, since its kernel structure is designed to model periodic functions. Reassuringly, the fBNNs made very similar predictions to the GPs with the corresponding kernels, though they predicted slightly smaller uncertainty. We emphasize that the extrapolation results from the functional prior, rather than the network architecture, which does not encode periodicity, and which is not well suited to model smooth functions due to the ReLU activation function.
214
+
215
+ # 5.1.2 IMPLICIT PRIORS
216
+
217
+ Because the KL term in the fELBO is estimated using the SSGE, an implicit variational inference algorithm (as discussed in Section 2.3), the functional prior need not have a tractable marginal density. In this section, we examine approximate posterior samples and marginals for two implicit priors: a distribution over piecewise constant functions, and a distribution over piecewise linear functions. Prior samples are shown in Figure 3; see Appendix D.2 for the precise definitions. In each run of the experiment, we first sampled a random function from the prior, and then sampled 20 points from $[ 0 , 0 . 2 ]$ and another 20 points from [0.8, 1], giving a training set of 40 data points. To make the task more difficult for the fBNN, we used the tanh activation function, which is not well suited for piecewise constant or piecewise linear functions.5
218
+
219
+ Posterior predictive samples and marginals are shown for three different runs in Figure 3. We observe that fBNNs made predictions with roughly piecewise constant or piecewise linear structure, although their posterior samples did not seem to capture the full diversity of possible explanations of the data. Even though the tanh activation function encourages smoothness, the network learned to generate functions with sharp transitions.
220
+
221
+ # 5.2 PREDICTIVE PERFORMANCE
222
+
223
+ # 5.2.1 SMALL SCALE DATASETS
224
+
225
+ Following previous work (Hernández-Lobato & Adams, 2015), we then experimented with standard regression benchmark datasets from the UCI collection (Asuncion & Newman, 2007). In particular, we only used the datasets with less than 2000 data points so that we could fit GP hyperparameters by maximizing marginal likelihood exactly. Each dataset was randomly split into training and test sets, comprising $90 \%$ and $10 \%$ of the data respectively. This splitting process was repeated 10 times to reduce variability.6
226
+
227
+ Table 1: Averaged test RMSE and log-likelihood for the regression benchmarks.
228
+
229
+ <table><tr><td></td><td></td><td>Test RMSE</td><td></td><td></td><td>Test log-likelihood</td><td></td></tr><tr><td>Dataset</td><td>BBB</td><td>Noisy K-FAC</td><td>FBNN</td><td>BBB</td><td>Noisy K-FAC</td><td>FBNN</td></tr><tr><td>Boston</td><td>3.171±0.149</td><td>2.742±0.125</td><td>2.378±0.104</td><td>-2.602±0.031</td><td>-2.446±0.029</td><td>-2.301±0.038</td></tr><tr><td>Concrete</td><td>5.678±0.087</td><td>5.019±0.127</td><td>4.935±0.180</td><td>-3.149±0.018</td><td>-3.039±0.025</td><td>-3.096±0.016</td></tr><tr><td>Energy</td><td>0.565±0.018</td><td>0.485±0.023</td><td>0.412±0.017</td><td>-1.500±0.006</td><td>-1.421±0.005</td><td>-0.684±0.020</td></tr><tr><td>Wine</td><td>0.643±0.012</td><td>0.637±0.011</td><td>0.673±0.014</td><td>-0.977±0.017</td><td>-0.969±0.014</td><td>-1.040±0.013</td></tr><tr><td>Yacht</td><td>1.174±0.086</td><td>0.979±0.077</td><td>0.607±0.068</td><td>-2.408±0.007</td><td>-2.316±0.006</td><td>-1.033±0.033</td></tr></table>
230
+
231
+ We compared our fBNNs with Bayes By Backprop (BBB) (Blundell et al., 2015) and Noisy K-FAC (Zhang et al., 2018). In accordance with Zhang et al. (2018), we report root mean square error (RMSE) and test log-likelihood. The results are shown in Table 1. On most datasets, our fBNNs outperformed both BBB and NNG, sometimes by a significant margin.
232
+
233
+ # 5.2.2 LARGE SCALE DATASETS
234
+
235
+ Observe that fBNNs are naturally scalable to large datasets because they access the data only through the expected log-likelihood term, which can be estimated stochastically. In this section, we verify this experimentally. We compared fBNNs and BBB with large scale UCI datasets, including Naval, Protein Structures, Video Transcoding (Memory, Time) and GPU kernel performance. We randomly split the datasets into $80 \%$ training, $10 \%$ validation, and $10 \%$ test. We used the validating set to select the hyperparameters and performed early stopping.
236
+
237
+ Table 2: Averaged test RMSE and log-likelihood for the regression benchmarks.
238
+
239
+ <table><tr><td></td><td></td><td colspan="2">Test RMSE</td><td colspan="2">Test log-likelihood</td></tr><tr><td>Dataset</td><td>N</td><td>BBB</td><td>FBNN</td><td>BBB</td><td>FBNN</td></tr><tr><td>Naval</td><td>11934</td><td>1.6E-4±0.000</td><td>1.2E-4±0.000</td><td>6.950±0.052</td><td>7.130±0.024</td></tr><tr><td>Protein</td><td>45730</td><td>4.331±0.033</td><td>4.326±0.019</td><td>-2.892±0.007</td><td>-2.892±0.004</td></tr><tr><td>Video Memory</td><td>68784</td><td>1.879±0.265</td><td>1.858±0.036</td><td>-1.999±0.054</td><td>-2.038±0.021</td></tr><tr><td>Video Time</td><td>68784</td><td>3.632±1.974</td><td>3.007±0.127</td><td>-2.390±0.040</td><td>-2.471±0.018</td></tr><tr><td>GPU</td><td>241600</td><td>21.886±0.673</td><td>19.50±0.171</td><td>-4.505±0.031</td><td>-4.400±0.009</td></tr></table>
240
+
241
+ Both methods were trained for 80,000 iterations.7 We used 1 hidden layer with 100 hidden units for all datasets. For the prior of fBNNs, we used a GP with Neural Kernel Network (NKN) kernels as used in Sun et al. (2018). We note that GP hyperparameters were fit using mini-batches of size 1000 with 10000 iterations. In each iteration, measurement sets consist of 500 training samples and 5 or 50 points from the sampling distribution $c$ , tuned by validation performance. We ran each experiment 5 times, and report the mean and standard deviation in Table 2. More large scale regression results with bigger networks can be found at Appendix C.4 and Appendix C.5.
242
+
243
+ # 5.3 CONTEXTUAL BANDITS
244
+
245
+ One of the most important applications of uncertainty modelling is to guide exploration in settings such as bandits, Bayesian optimization (BO), and reinforcement learning. In this section, we evaluate fBNNs on a recently introduced contextual bandits benchmark (Riquelme et al., 2018). In contextual bandits problems, the agent tries to select the action with highest reward given some input context. Because the agent learns about the model gradually, it should balance between exploration and exploitation to maximize the cumulative reward. Thompson sampling (Thompson, 1933) is one promising approach which repeatedly samples from the posterior distribution over parameters, choosing the optimal action according to the posterior sample.
246
+
247
+ Table 3: Contextual bandits regret. Results are relative to the cumulative regret of the Uniform algorithm. Numbers after the algorithm are the network sizes. We report the mean and standard derivation over 10 trials.
248
+
249
+ <table><tr><td></td><td>M. RANK</td><td>M.VALUE</td><td>MUSHROOM</td><td>STATLOG</td><td>COVERTYPE</td><td>FINANCIAL</td><td>JESTER</td><td>ADULT</td></tr><tr><td>FBNN1×50</td><td>4.7</td><td>41.9</td><td>21.38± 7.00</td><td>8.85±4.55</td><td>47.16± 2.39</td><td>9.90±2.40</td><td>75.55 ±5.51</td><td>88.43±1.95</td></tr><tr><td>FBNN2×50</td><td>6.5</td><td>43.0</td><td>24.57 ± 10.81</td><td>10.08 ± 5.66</td><td>49.04± 3.75</td><td>11.83 ± 2.95</td><td>73.85 ± 6.82</td><td>88.81±3.29</td></tr><tr><td>FBNN3×50</td><td>7</td><td>45.0</td><td>34.03 ±13.95</td><td>7.73±4.37</td><td>50.14 ± 3.13</td><td>14.14 ± 1.99</td><td>74.27 ± 6.54</td><td>89.68 ± 1.66</td></tr><tr><td>FBNN1× 500</td><td>3.8</td><td>41.3</td><td>21.90 ±9.95</td><td>6.50± 2.97</td><td>47.45 ± 1.86</td><td>7.83± 0.77</td><td>74.81 ± 5.57</td><td>89.03 ±1.78</td></tr><tr><td>FBNN2× 500</td><td>4.2</td><td>41.2</td><td>23.93 ± 11.59</td><td>7.98 ±3.08</td><td>46.00±2.01</td><td>10.67 ± 3.52</td><td>68.88 ± 7.09</td><td>89.70± 2.01</td></tr><tr><td>FBNN3×500</td><td>4.2</td><td>40.9</td><td>19.07 ± 4.97</td><td>10.04 ± 5.09</td><td>45.24 ± 2.11</td><td>11.48 ± 2.20</td><td>69.42 ± 7.56</td><td>90.01 ± 1.70</td></tr><tr><td>MULTITASKGP</td><td>4.3</td><td>41.7</td><td>20.75 ± 2.08</td><td>7.25 ± 1.80</td><td>48.37 ± 3.50</td><td>8.07 ± 1.13</td><td>76.99 ± 6.01</td><td>88.64 ± 3.20</td></tr><tr><td>BBB1×50</td><td>10.8</td><td>52.7</td><td>24.41 ± 6.70</td><td>25.67 ± 3.46</td><td>58.25 ±5.00</td><td>37.69 ± 15.34</td><td>75.39 ± 6.32</td><td>95.07 ± 1.57</td></tr><tr><td>BBB1×500</td><td>13.7</td><td>66.2</td><td>26.41 ± 8.71</td><td>51.29 ± 11.27</td><td>83.91 ± 4.62</td><td>57.20 ± 7.19</td><td>78.94 ± 4.98</td><td>99.21 ± 0.79</td></tr><tr><td>BBALPHADIV</td><td>15</td><td>83.8</td><td>61.00 ± 6.47</td><td>70.91 ± 10.22</td><td>97.63 ± 3.21</td><td>85.94 ± 4.88</td><td>87.80 ±5.08</td><td>99.60 ± 1.06</td></tr><tr><td>PARAMNOISE</td><td>10</td><td>47.9</td><td>20.33 ± 13.12</td><td>13.27 ± 2.85</td><td>65.07 ± 3.47</td><td>17.63 ± 4.27</td><td>74.94 ± 7.24</td><td>95.90 ± 2.20</td></tr><tr><td>NEURALLINEAR</td><td>10.8</td><td>48.8</td><td>16.56 ± 11.60</td><td>13.96 ± 1.51</td><td>64.96 ± 2.54</td><td>18.57 ± 2.02</td><td>82.14 ± 3.64</td><td>96.87±0.92</td></tr><tr><td>LINFULLPOST</td><td>8.3</td><td>46.0</td><td>14.71 ± 0.67</td><td>19.24 ± 0.77</td><td>58.69 ± 1.17</td><td>10.69 ± 0.92</td><td>77.76± 5.67</td><td>95.00 ± 1.26</td></tr><tr><td>DROPOUT</td><td>5.5</td><td>41.7</td><td>12.53 ± 1.82</td><td>12.01 ± 6.11</td><td>48.95 ±2.19</td><td>14.64 ± 3.95</td><td>71.38 ± 7.11</td><td>90.62 ± 2.21</td></tr><tr><td>RMS</td><td>6.5 4.7</td><td>43.9</td><td>15.29 ± 3.06</td><td>11.38 ± 5.63</td><td>58.96±4.97</td><td>10.46 ± 1.61</td><td>72.09 ± 6.98</td><td>95.29 ± 1.50</td></tr><tr><td>BOOTRMS</td><td></td><td>42.6</td><td>18.05 ± 11.20</td><td>6.13 ±1.03</td><td>53.63±2.15</td><td>8.69 ± 1.30</td><td>74.71 ±6.00</td><td>94.18 ± 1.94</td></tr><tr><td>UNIFORM</td><td>16</td><td>100</td><td>100.0 ±0.0</td><td>100.0±0.0</td><td>100.0±0.0</td><td>100.0±0.0</td><td>100.0±0.0</td><td>100.0±0.0</td></tr></table>
250
+
251
+ We compared our fBNNs with the algorithms benchmarked in (Riquelme et al., 2018). We ran the experiments for all algorithms and tasks using the default settings open sourced by Riquelme et al. (2018). For fBNNs, we kept the same settings, including batchsize (512), training epochs (100) and training frequency (50). For the prior, we use the multi-task GP of Riquelme et al. (2018). Measurement sets consisted of training batches, combined with 10 points sampled from data regions. We ran each experiment 10 times; the mean and standard derivation are reported in Table 3 (Appendix C.1 has the full results for all experiments.). Similarly to Riquelme et al. (2018), we also report the mean rank and mean regret.
252
+
253
+ As shown in Table 3, fBNNs outperformed other methods by a wide margin. Additionally, fBNNs maintained consistent performance even with deeper and wider networks. By comparison, BBB suffered significant performance degradation when the hidden size was increased from 50 to 500. This is consistent with our hypothesis that functional variational inference can gracefully handle networks with high capacity.
254
+
255
+ # 5.4 BAYESIAN OPTIMIZATION
256
+
257
+ Another domain where efficient exploration requires accurate uncertainty modeling is Bayesian optimization. Our experiments with Bayesian optimization are described in App C.3. We compared BBB, RBF Random Feature (Rahimi & Recht, 2008) and our fBNNs in the context of Max-value Entropy Search (MES) (Wang & Jegelka, 2017), which requires explicit function samples for Bayesian Optimization. We performed BO over functions sampled from Gaussian Processes corresponding to RBF, Matern12 and ArcCosine kernels, and found our fBNNs achieved comparable or better performance than RBF Random Feature.
258
+
259
+ # 6 CONCLUSIONS
260
+
261
+ In this paper we investigated variational inference between stochastic processes. We proved that the KL divergence between stochastic processes equals the supremum of KL divergence for marginal distributions over all finite measurement sets. Then we presented two practical functional variational inference approaches: adversarial and sampling-based. Adopting BNNs as the variational posterior yields our functional variational Bayesian neural networks. Empirically, we demonstrated that fBNNs extrapolate well over various structures, estimate reliable uncertainties, and scale to large datasets.
262
+
263
+ # ACKNOWLEDGEMENTS
264
+
265
+ We thank Ricky Chen, Kevin Luk and Xuechen Li for their helpful comments on this project. SS was supported by a Connaught New Researcher Award and a Connaught Fellowship. GZ was supported by an MRIS Early Researcher Award. RG acknowledges funding from the CIFAR Canadian AI Chairs program.
266
+
267
+ # REFERENCES
268
+
269
+ Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017.
270
+
271
+ Arthur Asuncion and David Newman. UCI machine learning repository, 2007.
272
+
273
+ Juhan Bae, Guodong Zhang, and Roger Grosse. Eigenvalue corrected noisy natural gradient. arXiv preprint arXiv:1811.12565, 2018.
274
+
275
+ Christopher T. Baker. The Numerical Treatment of Integral Equations. Clarendon Press, Oxford, 1997.
276
+
277
+ Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International Conference on Machine Learning, pp. 1613–1622, 2015.
278
+
279
+ Kurt Cutajar, Edwin V Bonilla, Pietro Michiardi, and Maurizio Filippone. Random feature expansions for deep Gaussian processes. In International Conference on Machine Learning, pp. 884–893, 2017.
280
+
281
+ Stefan Depeweg, José Miguel Hernández-Lobato, Finale Doshi-Velez, and Steffen Udluft. Uncertainty decomposition in Bayesian neural networks with latent variables. arXiv preprint arXiv:1706.08495, 2017.
282
+
283
+ Nathaniel Eldredge. Analysis and probability on infinite-dimensional spaces. arXiv preprint arXiv:1607.03591, 2016.
284
+
285
+ Daniel Flam-Shepherd, James Requeima, and David Duvenaud. Mapping Gaussian process priors to Bayesian neural networks. In NIPS Bayesian deep learning workshop, 2017.
286
+
287
+ Gerald B Folland. Real analysis: modern techniques and their applications. John Wiley & Sons, 2013.
288
+
289
+ Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In International Conference on Machine Learning, pp. 1050–1059, 2016.
290
+
291
+ Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Advances in Neural Information Processing Systems, pp. 3581–3590, 2017.
292
+
293
+ M. Garnelo, J. Schwarz, D. Rosenbaum, F. Viola, D. J. Rezende, S. M. A. Eslami, and Y. Whye Teh. Neural processes. arXiv preprint arXiv:1807.01622, 2018.
294
+
295
+ Soumya Ghosh, Jiayu Yao, and Finale Doshi-Velez. Structured variational learning of Bayesian neural networks with horseshoe priors. In International Conference on Machine Learning, pp. 1744–1753, 2018.
296
+
297
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
298
+
299
+ Alex Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, pp. 2348–2356, 2011.
300
+
301
+ Robert M. Gray. Entropy and Infomation Theory. Springer, 2011.
302
+
303
+ Danijar Hafner, Dustin Tran, Alex Irpan, Timothy Lillicrap, and James Davidson. Reliable uncertainty estimates in deep neural networks using noise contrastive priors. arXiv preprint arXiv:1807.09289, 2018.
304
+
305
+ James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. In Uncertainty in Artificial Intelligence, pp. 282, 2013.
306
+
307
+ James Hensman, Alexander Matthews, and Zoubin Ghahramani. Scalable variational Gaussian process classification. In Artificial Intelligence and Statistics, pp. 351–360, 2015.
308
+
309
+ José Miguel Hernández-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learning of Bayesian neural networks. In International Conference on Machine Learning, pp. 1861–1869, 2015.
310
+
311
+ José Miguel Hernández-Lobato, Matthew W Hoffman, and Zoubin Ghahramani. Predictive entropy search for efficient global optimization of black-box functions. In Advances in Neural Information Processing Systems, pp. 918–926, 2014.
312
+
313
+ Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Conference on Computational Learning Theory, pp. 5–13, 1993.
314
+
315
+ Ferenc Huszár. Variational inference using implicit distributions. arXiv preprint arXiv:1702.08235, 2017.
316
+
317
+ Pavel Izmailov, Alexander Novikov, and Dmitry Kropotov. Scalable gaussian processes with billions of inducing inputs via tensor train decomposition. arXiv preprint arXiv:1710.07324, 2017.
318
+
319
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
320
+
321
+ Diederik P Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. In Advances in Neural Information Processing Systems, pp. 2575–2583, 2015.
322
+
323
+ Karl Krauth, Edwin V Bonilla, Kurt Cutajar, and Maurizio Filippone. AutoGP: Exploring the capabilities and limitations of Gaussian process models. arXiv preprint arXiv:1610.05392, 2016.
324
+
325
+ John Lamperti. Stochastic processes: a survey of the mathematical theory, volume 23. Springer Science & Business Media, 2012.
326
+
327
+ Miguel Lázaro-Gredilla, Joaquin Quiñonero Candela, Carl Edward Rasmussen, and Aníbal R Figueiras-Vidal. Sparse spectrum Gaussian process regression. Journal of Machine Learning Research, 11(Jun):1865–1881, 2010.
328
+
329
+ Quoc Le, Tamás Sarlós, and Alex Smola. Fastfood — approximating kernel expansions in loglinear time. In International Conference on Machine Learning, volume 85, 2013.
330
+
331
+ Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as Gaussian processes. In International Conference on Learning Representations, 2018.
332
+
333
+ Qiang Liu, Jason Lee, and Michael Jordan. A kernelized Stein discrepancy for goodness-of-fit tests. In International Conference on Machine Learning, pp. 276–284, 2016.
334
+
335
+ James Robert Lloyd, David K Duvenaud, Roger B Grosse, Joshua B Tenenbaum, and Zoubin Ghahramani. Automatic construction and natural-language description of nonparametric regression models. In AAAI, pp. 1242–1250, 2014.
336
+
337
+ Christos Louizos and Max Welling. Structured and efficient variational deep learning with matrix Gaussian posteriors. In International Conference on Machine Learning, pp. 1708–1716, 2016.
338
+
339
+ Christos Louizos and Max Welling. Multiplicative normalizing flows for variational Bayesian neural networks. In International Conference on Machine Learning, pp. 2218–2227, 2017.
340
+
341
+ Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pp. 3288–3298, 2017.
342
+
343
+ Chao Ma, Yingzhen Li, and José Miguel Hernández-Lobato. Variational implicit processes. arXiv preprint arXiv:1806.02390, 2018.
344
+
345
+ Anton Mallasto and Aasa Feragen. Learning from uncertain curves: The 2-wasserstein metric for Gaussian processes. In Advances in Neural Information Processing Systems, pp. 5660–5670, 2017.
346
+
347
+ Alexander G de G Matthews, James Hensman, Richard Turner, and Zoubin Ghahramani. On sparse variational methods and the Kullback-Leibler divergence between stochastic processes. In Artificial Intelligence and Statistics, pp. 231–239, 2016.
348
+
349
+ Radford M Neal. Bayesian Learning for Neural Networks. PhD thesis, University of Toronto, 1995.
350
+
351
+ Bernt Øksendal. Stochastic differential equations. In Stochastic differential equations, pp. 65–84. Springer, 2003.
352
+
353
+ Carsten Peterson. A mean field theory learning algorithm for neural networks. Complex systems, 1: 995–1019, 1987.
354
+
355
+ Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems, pp. 1177–1184, 2008.
356
+
357
+ Carl Edward Rasmussen and Zoubin Ghahramani. Occam’s razor. In Advances in Neural Information Processing Systems, pp. 294–300, 2001.
358
+
359
+ Carl Edward Rasmussen and Christopher KI Williams. Gaussian Processes for Machine Learning. MIT Press, 2006.
360
+
361
+ Carlos Riquelme, George Tucker, and Jasper Snoek. Deep Bayesian bandits showdown: An empirical comparison of Bayesian deep networks for thompson sampling. In International Conference on Learning Representations, 2018.
362
+
363
+ Geoffrey Roeder, Yuhuai Wu, and David K Duvenaud. Sticking the landing: Simple, lower-variance gradient estimators for variational inference. In Advances in Neural Information Processing Systems, pp. 6925–6934, 2017.
364
+
365
+ Daniel Russo and Benjamin Van Roy. An information-theoretic analysis of thompson sampling. The Journal of Machine Learning Research, 17(1):2442–2471, 2016.
366
+
367
+ Hugh Salimbeni and Marc Deisenroth. Doubly stochastic variational inference for deep Gaussian processes. In Advances in Neural Information Processing Systems, pp. 4588–4599, 2017.
368
+
369
+ Amar Shah, Andrew Wilson, and Zoubin Ghahramani. Student-t processes as alternatives to Gaussian processes. In Artificial Intelligence and Statistics, pp. 877–885, 2014.
370
+
371
+ Jiaxin Shi, Shengyang Sun, and Jun Zhu. Kernel implicit variational inference. In International Conference on Learning Representations, 2018a.
372
+
373
+ Jiaxin Shi, Shengyang Sun, and Jun Zhu. A spectral approach to gradient estimation for implicit distributions. International Conference on Machine Learning, 2018b.
374
+
375
+ Edward Snelson and Zoubin Ghahramani. Sparse Gaussian processes using pseudo-inputs. In Advances in Neural Information Processing Systems, pp. 1257–1264, 2006.
376
+
377
+ Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszár. Amortised map inference for image super-resolution. arXiv preprint arXiv:1610.04490, 2016.
378
+
379
+ Shengyang Sun, Changyou Chen, and Lawrence Carin. Learning structured weight uncertainty in Bayesian neural networks. In Artificial Intelligence and Statistics, pp. 1283–1292, 2017.
380
+
381
+ Shengyang Sun, Guodong Zhang, Chaoqi Wang, Wenyuan Zeng, Jiaman Li, and Roger Grosse. Differentiable compositional kernel learning for Gaussian processes. In International Conference on Machine Learning, pp. 4828–4837, 2018.
382
+
383
+ William R Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285–294, 1933.
384
+
385
+ Michalis Titsias. Variational learning of inducing variables in sparse Gaussian processes. In Artificial Intelligence and Statistics, pp. 567–574, 2009.
386
+
387
+ Zi Wang and Stefanie Jegelka. Max-value entropy search for efficient Bayesian optimization. In International Conference on Machine Learning, pp. 3627–3635, 2017.
388
+
389
+ Yeming Wen, Paul Vicol, Jimmy Ba, Dustin Tran, and Roger Grosse. Flipout: Efficient pseudoindependent weight perturbations on mini-batches. arXiv preprint arXiv:1803.04386, 2018.
390
+
391
+ Christopher KI Williams and Matthias Seeger. Using the Nyström method to speed up kernel machines. In Advances in Neural Information Processing Systems, pp. 682–688, 2001.
392
+
393
+ Andrew Wilson and Hannes Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In International Conference on Machine Learning, pp. 1775–1784, 2015.
394
+
395
+ Guodong Zhang, Shengyang Sun, David Duvenaud, and Roger Grosse. Noisy natural gradient as variational inference. In International Conference on Machine Learning, pp. 5852–5861, 2018.
396
+
397
+ # A FUNCTIONAL KL DIVERGENCE
398
+
399
+ # A.1 BACKGROUND
400
+
401
+ We begin with some basic terminology and classical results. See Gray (2011) and Folland (2013) for more details.
402
+
403
+ Definition 1 (KL divergence). Given a probability measure space $( \Omega , { \mathcal { F } } , P )$ and another probability measure $M$ on the smae space, the $K L$ divergence of $P$ with respect to $M$ is defined as
404
+
405
+ $$
406
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { \mathcal { Q } } \mathrm { K L } [ P _ { \mathcal { Q } } \| M _ { \mathcal { Q } } ] .
407
+ $$
408
+
409
+ where the supremum is taken over all finite measurable partitions $\mathcal { Q } = \{ Q _ { i } \} _ { i = 1 } ^ { n }$ of $\Omega$ , and $P _ { \mathcal { Q } } , M _ { \mathcal { Q } }$ represent the discrete measures over the partition $\mathcal { Q } ,$ respectively.
410
+
411
+ Definition 2 (Pushforward measure). Given probability spaces $( X , { \mathcal { F } } _ { X } , \mu )$ and $( Y , { \mathcal { F } } _ { Y } , \nu )$ , we say that measure $\nu$ is a pushforward of $\mu$ if $\nu ( A ) = \mu ( f ^ { - 1 } ( A ) )$ for a measurable $f : X \to Y$ and any $A \in { \mathcal { F } } _ { Y }$ . This relationship is denoted by $\nu = \mu \circ f ^ { - 1 }$ .
412
+
413
+ Definition 3 (Canonical projection map). Let $T$ be an arbitrary index set, and $\{ ( \Omega _ { t } , { \mathcal { F } } _ { t } ) \} _ { t \in T }$ be some collection of measurable spaces. For each subset $J \subset I \subset T$ , define $\Omega ^ { J } = \textstyle \prod _ { t \in J } \Omega _ { t }$ . We call $\pi _ { I J }$ the canonical projection map from $I$ to $J$ if
414
+
415
+ $$
416
+ \pi _ { I \to J } ( w ) = w | _ { J } \in \Omega ^ { J } , \forall w \in \Omega ^ { I } .
417
+ $$
418
+
419
+ Where $w | _ { J }$ is defined as, if $w = ( w _ { i } ) _ { i \in I }$ , then $w | _ { J } = ( w _ { i } ) _ { i \in J }$ .
420
+
421
+ Definition 4 (Cylindrical $\sigma$ -algebra). Let $T$ be an arbitrary index set, $( \Omega , { \mathcal { F } } )$ be a measurable space. Suppose
422
+
423
+ $$
424
+ \Omega ^ { T } = \{ f : f ( t ) \in \Omega , t \in T \} .
425
+ $$
426
+
427
+ is the set of $\Omega$ -valued functions. A cylinder subset is a finitely restricted set defined as
428
+
429
+ $$
430
+ C _ { t _ { 1 } , \cdots , t _ { n } } ( B _ { 1 } , \cdots , B _ { n } ) = \{ f \in \Omega ^ { T } : f ( t _ { i } ) \in B _ { i } , 1 \leq i \leq n \} .
431
+ $$
432
+
433
+ $$
434
+ \begin{array} { r l } & { \mathcal { G } _ { t _ { 1 } , \cdots , t _ { n } } = \{ C _ { t _ { 1 } , \cdots , t _ { n } } ( B _ { 1 } , \cdots , B _ { n } ) : B _ { i } \in \mathcal { F } , 1 \leq i \leq n \} } \\ & { \qquad \mathcal { G } _ { \Omega ^ { \mathbb { T } } } = \overset { \infty } { \underset { n = 1 } { \cup } } \bigcup _ { t _ { i } \in T , i \leq n } \mathcal { G } _ { t _ { 1 } , \cdots , t _ { n } } } \end{array}
435
+ $$
436
+
437
+ We call the $\sigma$ -algebra $\mathcal { F } ^ { T } : = \sigma ( \mathcal { G } _ { \Omega ^ { T } } )$ as the cylindrical $\sigma$ -algebra of $\Omega ^ { T }$ , and $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ the cylindrical measurable space.
438
+
439
+ The Kolmogorov Extension Theorem is the foundational result used to construct many stochastic processes, such as Gaussian processes. A particularly relevant fact for our purposes is that this theorem defines a measure on a cylindrical measurable space, using only canonical projection measures on finite sets of points.
440
+
441
+ Theorem 4 (Kolmogorov extension theorem (Øksendal, 2003)). Let $T$ be an arbitrary index set. $( \Omega , { \mathcal { F } } )$ is a standard measurable space, whose cylindrical measurable space on $T$ is $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ . Suppose that for each finite subset $I \subset T$ , we have a probability measure $\mu _ { I }$ on $\Omega ^ { I }$ , and these measures satisfy the following compatibility relationship: for each subset $J \subset I$ , we have
442
+
443
+ $$
444
+ \mu _ { J } = \mu _ { I } \circ \pi _ { I J } ^ { - 1 } .
445
+ $$
446
+
447
+ Then there exists a unique probability measure $\mu$ on $\Omega ^ { T }$ such that for all finite subsets $I \subset T$
448
+
449
+ $$
450
+ \mu _ { I } = \mu \circ \pi _ { T I } ^ { - 1 } .
451
+ $$
452
+
453
+ In the context of Gaussian processes, $\mu$ is a Gaussian measure on a separable Banach space, and the $\mu _ { I }$ are marginal Gaussian measures at finite sets of input positions (Mallasto & Feragen, 2017).
454
+
455
+ Theorem 5. Suppose that $M$ and $P$ are measures on the sequence space corresponding to outcomes of a sequence of random variables $X _ { 0 } , X _ { 1 } , \cdot \cdot \cdot$ with alphabet $A$ . Let $\mathcal { F } _ { n } = \sigma ( X _ { 0 } , \cdots , X _ { n - 1 } )$ , which asymptotically generates the $\sigma$ -algebra $\sigma ( X _ { 0 } , X _ { 1 } , \cdots )$ . Then
456
+
457
+ $$
458
+ \mathrm { K L } [ P \| M ] = \operatorname* { l i m } _ { n \to \infty } \mathrm { K L } [ P _ { \mathcal { F } _ { n } } \| M _ { \mathcal { F } _ { n } } ]
459
+ $$
460
+
461
+ Where $P _ { \mathcal { F } _ { n } } , M _ { \mathcal { F } _ { n } }$ denote the pushforward measures with $f : f ( X _ { 0 } , X _ { 1 } , \cdots ) = f ( X _ { 0 } , \cdots , X _ { n - 1 } )$ , respectively.
462
+
463
+ Here we clarify what it means for the measurable sets to only depend on the values at a countable set of points. To begin with, we firstly introduce some definitions.
464
+
465
+ Definition 5 (Replacing function). For $f \in \Omega ^ { T } , t _ { 0 } \in T , v \in \Omega ,$ , a replacing function $f _ { t _ { 0 } , v } ^ { r }$ is,
466
+
467
+ $$
468
+ f _ { t _ { 0 } , v } ^ { r } ( t ) = { \left\{ \begin{array} { l l } { f ( t ) , } & { \ t \neq t _ { 0 } } \\ { v , } & { \ t = t _ { 0 } } \end{array} \right. } .
469
+ $$
470
+
471
+ Definition 6 (Restricted Indices). For $H \in \mathcal { F } ^ { T }$ , we define the free indices $\tau ^ { c } ( H )$
472
+
473
+ $$
474
+ \tau ^ { c } ( H ) = \{ t | f o r a n y f \in H , w e h a \nu e f _ { t , v } ^ { r } \in H f o r a l l v \in \Omega \}
475
+ $$
476
+
477
+ The complement $\tau ( H ) = T \backslash \tau ^ { c } ( H )$ is the set of restricted indices. For example, for the set $H =$ $\{ f | f \in \mathbb { R } ^ { T } , f ( 0 ) \in ( - 1 , 2 ) , f ( 1 ) \in ( 0 , 1 ) \}$ , the restricted indices are $\tau ( H ) = \{ 0 , 1 \}$ .
478
+
479
+ Restricted index sets satisfy the following properties:
480
+
481
+ • for any $H \in \mathcal { F } ^ { T }$ , $\tau ( H ) = \tau ( H ^ { c } )$ . • for any indices set $I$ and measureable sets $\{ H _ { i } ; H _ { i } \in \mathcal { F } ^ { T } \} _ { i \in I } , \tau \big ( \underset { i \in I } { \cup } H _ { i } \big ) \subseteq \underset { i \in I } { \cup } \tau ( H _ { i } ) .$
482
+
483
+ Having defined restricted indices, a key step in our proof is to show that, for any measureable set $H$ in a cylindrical measureable space $( \Omega ^ { \check { T } } , \mathcal { F } ^ { \check { T } } )$ , its set of restricted indices $\tau ( H )$ is countable.
484
+
485
+ Lemma 6. Given a cylindrical measureable space $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ , for any $H \in \mathcal { F } ^ { T }$ , $\tau ( H )$ is countable.
486
+
487
+ Proof. Define $\mathcal { H } = \{ H \vert H \in \mathcal { F } ^ { T } , \tau ( H )$ is countable}, $\mathcal { H } \subseteq \mathcal { F } ^ { T }$ . By the two properties of restricted indices in Definition 6, $\mathcal { H }$ is a $\sigma$ -algebra on $\Omega ^ { T }$ .
488
+
489
+ On the other hand, $\mathcal { F } ^ { T } = \sigma ( \mathcal { G } _ { \Omega ^ { T } } )$ . Because any set in $\mathcal { G } _ { \Omega ^ { T } }$ has finite restricted indices, $\mathcal G _ { \Omega ^ { T } } \subseteq \mathcal H$ Therefore $\mathcal { H }$ is a $\sigma$ -algebra containing $\mathcal { G } _ { \Omega ^ { T } }$ . Thus $\mathcal { H } \supseteq \sigma ( \mathcal { G } _ { \Omega ^ { T } } ) = \mathcal { F } ^ { T }$ .
490
+
491
+ Overall, we conclude $\mathcal { H } = \mathcal { F } ^ { T }$ . For any $H \in \mathcal { F } ^ { T }$ , $\tau ( H )$ is countable.
492
+
493
+ Theorem 7. For two stochastic processes $P , M$ on a cylindrical measurable space $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ , the $K L$ divergence of $P$ with respect to $M$ satisfies,
494
+
495
+ $$
496
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { T _ { d } } \mathrm { K L } [ P _ { T _ { d } } \| M _ { T _ { d } } ] ,
497
+ $$
498
+
499
+ where the supremum is over all finite indices subsets $T _ { d } \subseteq T$ , and $P _ { T _ { d } } , M _ { T _ { d } }$ represent the canonical projection maps $\pi _ { T \to T _ { d } }$ of $P , M$ , respectively.
500
+
501
+ Proof. Recall that stochastic processes are defined over a cylindrical $\sigma$ -algebra $\mathcal { F } ^ { T }$ . By Lemma 6, for every set $H \in \mathcal { F } ^ { T }$ , the restricted index set $\tau ( H )$ is countable. Our proof proceeds in two steps:
502
+
503
+ 1. Any finite measurable partition of $\Omega ^ { T }$ corresponds to a finite measurable partition over some $\Omega ^ { T _ { c } }$ , where $T _ { c }$ is a countable index set.
504
+ 2. Correspondence between partitions implies correspondence between KL divergences.
505
+ 3. KL divergences over a countable indices set can be represented as supremum of KL divergences over finite indices sets.
506
+
507
+ Step 1. By Definition 1,
508
+
509
+ $$
510
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { \mathcal { Q } _ { \Omega ^ { T } } } \mathrm { K L } [ P _ { \mathcal { Q } _ { \Omega ^ { T } } } \| M _ { \mathcal { Q } _ { \Omega ^ { T } } } ] ,
511
+ $$
512
+
513
+ where the sup is over all finite measurable partitions of the function space $\Omega ^ { T }$ , denoted by ${ \mathcal { Q } } _ { \Omega ^ { T } }$
514
+
515
+ $$
516
+ \mathcal { Q } _ { \Omega ^ { T } } = \{ Q _ { \Omega ^ { T } } ^ { ( 1 ) } , \dots , Q _ { \Omega ^ { T } } ^ { ( k ) } | \bigcup _ { i = 1 } ^ { k } Q _ { \Omega ^ { T } } ^ { ( i ) } = \Omega ^ { T } , Q _ { \Omega ^ { T } } ^ { ( i ) } \in \mathcal { F } ^ { T } \mathrm { ~ a r e ~ d i s j o i n t ~ s e t s } , k \in \mathbb { N } ^ { + } \} .
517
+ $$
518
+
519
+ By Lemma 6, each $\tau ( Q _ { \Omega ^ { T } } ^ { ( i ) } )$ is countable. So the combined restricted index set $T _ { c } : = \bigcup _ { i = 1 } ^ { k } \tau ( Q _ { \Omega ^ { T } } ^ { ( i ) } )$ is countable.
520
+
521
+ Consider the canonical projection mapping $\pi _ { T T _ { c } }$ , which induces a partition on $\Omega ^ { T _ { c } }$ , denoted by $\mathcal { Q } _ { \Omega ^ { T _ { c } } }$ :
522
+
523
+ $$
524
+ Q _ { \Omega ^ { T _ { c } } } ^ { ( i ) } = \pi _ { T T _ { c } } ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) .
525
+ $$
526
+
527
+ The pushforward measure defined by this mapping is
528
+
529
+ $$
530
+ P _ { T _ { c } } = P \circ \pi _ { T T _ { c } } ^ { - 1 } , \quad M _ { T _ { c } } = M \circ \pi _ { T T _ { c } } ^ { - 1 } .
531
+ $$
532
+
533
+ Step 2. Then we have
534
+
535
+ $$
536
+ \begin{array} { r l } & { \mathrm { K L } [ P \| M ] = \underset { \mathbf { Q } _ { \Omega ^ { T } } } { \operatorname* { s u p } } \mathrm { K L } [ P _ { \mathbf { Q } _ { \Omega ^ { T } } } ] | M _ { Q _ { \Omega ^ { T } } } ] } \\ & { \quad \quad \quad = \underset { \mathbf { Q } _ { \Omega ^ { T } } } { \operatorname* { s u p } } \sum _ { i } P ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) \log \frac { P ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) } { M ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) } } \\ & { \quad \quad \quad = \underset { T _ { c } } { \operatorname* { s u p } } \underset { \mathbf { Q } _ { \Omega ^ { T } } } { \operatorname* { s u p } } \sum _ { i } P _ { T _ { c } } ( Q _ { \Omega ^ { T } c } ^ { ( i ) } ) \log \frac { P _ { T _ { c } } ( Q _ { \Omega ^ { T } c } ^ { ( i ) } ) } { M _ { T _ { c } } ( Q _ { \Omega ^ { T } c } ^ { ( i ) } ) } } \\ & { \quad \quad \quad = \underset { T _ { c } } { \operatorname* { s u p } } \mathrm { K L } [ P _ { T _ { c } } \| M _ { T _ { c } } ] , } \end{array}
537
+ $$
538
+
539
+ Step 3. Denote $\mathcal { D } ( T _ { c } )$ as the collection of all finite subsets of $T _ { c }$ . For any finite set $T _ { d } \in \mathcal { D } ( T _ { c } )$ , we denote $P _ { T _ { d } }$ as the pushforward measure of $P _ { T _ { c } }$ on $\Omega ^ { T _ { d } }$ . From the Kolmogorov Extension Theorem (Theorem 4), we know that $P _ { T _ { d } }$ corresponds to the finite marginals of $P$ at $\Omega ^ { T _ { d } }$ . Because $T _ { c }$ is countable, based on Theorem 5, we have,
540
+
541
+ $$
542
+ \begin{array} { r l } & { \mathrm { K L } [ P \| M ] = \underset { T _ { c } } { \operatorname* { s u p } } \mathrm { K L } [ P _ { T _ { c } } \| M _ { T _ { c } } ] } \\ & { \qquad = \underset { T _ { c } } { \operatorname* { s u p } } \underset { T _ { d } \in \mathcal { D } ( T _ { c } ) } { \operatorname* { s u p } } \mathrm { K L } [ P _ { T _ { d } } \| M _ { T _ { d } } ] . } \end{array}
543
+ $$
544
+
545
+ We are left with the last question: whether each $T _ { d }$ is contained in some $\mathcal { D } ( T _ { c } )$ ?
546
+
547
+ For any finite indices set $T _ { d }$ , we build a finite measureable partition $Q$ . Let $\Omega = \Omega _ { 0 } \cup \Omega _ { 1 } , \Omega _ { 0 } \cap \Omega _ { 1 } = \emptyset$ . Assume $| T _ { d } | = K , T _ { d } = \{ T _ { d } ( k ) \} _ { k = 1 : K }$ , let $I = \{ I ^ { i } | I ^ { i } \stackrel { } { = } ( I _ { 1 } ^ { i } , I _ { 2 } ^ { i } , \stackrel { } { \cdot } \cdot I _ { K } ^ { i } ) \} _ { i = 1 : 2 ^ { K } }$ to be all $K$ -length binary vectors. We define the partition,
548
+
549
+ $$
550
+ \begin{array} { r l } & { \mathcal { Q } = \{ Q ^ { i } \} _ { i = 1 : 2 ^ { K } } , } \\ & { Q ^ { i } = \underset { k = 1 } { \overset { K } { \cap } } \{ f \} \{ { f ( T _ { f } ( k ) ) \in \Omega _ { 0 } , \ I ^ { i } ( k ) = 0 } \ } \end{array}
551
+ $$
552
+
553
+ Through this settting, $\mathcal { Q }$ is a finite parition of $\Omega ^ { T }$ , and $T _ { c } ( \mathcal { Q } ) = T _ { d }$ . Therefore $T _ { d }$ in Equation (28) can range over all finite index sets, and we have proven the theorem.
554
+
555
+ $$
556
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { T _ { d } } \mathrm { K L } [ P _ { T _ { d } } \| M _ { T _ { d } } ] .
557
+ $$
558
+
559
+ # A.3 KL DIVERGENCE BETWEEN CONDITIONAL STOCHASTIC PROCESSES
560
+
561
+ In this section, we give an example of computing the $\mathrm { K L }$ divergence between two conditional stochastic processes. Consider two datasets $\mathcal { D } _ { 1 } , \mathcal { D } _ { 2 }$ , the KL divergence between two conditional
562
+
563
+ stochastic processes is
564
+
565
+ $$
566
+ \begin{array} { r l } { \mathrm { K L } [ p ( f | \mathcal { D } _ { 1 } ) \| p ( f | \mathcal { D } _ { 2 } ) ] = } & { \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { K L } [ p ( \mathbf { f } ^ { \mathbf { x } } | \mathcal { D } _ { 1 } ) \| p ( \mathbf { f } ^ { \mathbf { x } } | \mathcal { D } _ { 2 } ) ] } \\ & { = \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { E } _ { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } \log \frac { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 2 } ) } } \\ & { = \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { E } _ { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } \log \frac { p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) p ( \mathbf { f } ^ { \mathbf { x } } | \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } , \mathcal { D } _ { 1 } ) } { p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 2 } ) p ( \mathbf { f } ^ { \mathbf { x } } | \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } , \mathcal { D } _ { 2 } ) } } \\ & = \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { E } _ { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } \log \frac { p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) p ( \mathbf { f } ^ { \mathbf { x } } | \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } ) } p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ \end{array}
567
+ $$
568
+
569
+ Therefore, the KL divergence between these two stochastic processes equals to the marginal KL divergence on the observed locations. When $\mathcal { D } _ { 2 } = \varnothing$ , $p ( f | \mathcal { D } _ { 2 } ) \dot { = } p ( f )$ , this shows the KL divergence between posterior process and prior process are the marginal KL divergence on observed locations.
570
+
571
+ This also justifies our usage of $M$ measurement points in the adversarial functional VI and samplingbased functional VI of Section 3.
572
+
573
+ # B ADDITIONAL PROOFS
574
+
575
+ B.1 PROOF FOR EVIDENCE LOWER BOUND
576
+
577
+ This section provides proof for Theorem 2.
578
+
579
+ Proof of Theorem 2. Let $\mathbf { X } ^ { M } = \mathbf { X } \backslash \mathbf { X } ^ { D }$ be measurement points which aren’t in the training data.
580
+
581
+ $$
582
+ \begin{array} { r l } & { \mathcal { L } _ { { \mathbf { X } } } ( q ) = \mathbb { E } _ { q } [ \log p ( \mathbf { y } ^ { D } | \mathbf { f } ^ { D } ) + \log p ( \mathbf { f } ^ { \mathbf { X } } ) - \log q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } ) ] } \\ & { \quad \quad \quad \quad \quad \quad = \mathbb { E } _ { q } [ \log p ( \mathbf { y } ^ { D } | \mathbf { f } ^ { D } ) + \log p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) - \log q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) ] } \\ & { \quad \quad \quad \quad \quad = \log p ( \mathcal { D } ) - \mathbb { E } _ { q } \left[ \log \frac { q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) p ( \mathcal { D } ) } { p ( \mathbf { y } ^ { D } | \mathbf { f } ^ { D } ) p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) } \right] } \\ & { \quad \quad \quad \quad = \log p ( \mathcal { D } ) - \mathbb { E } _ { q } \left[ \log \frac { q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) } { p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } | \mathcal { D } ) } \right] } \\ & { \quad \quad \quad \quad = \log p ( \mathcal { D } ) - \mathrm { K L } [ q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) \Vert p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } | \mathcal { D } ) ] } \end{array}
583
+ $$
584
+
585
+ # B.2 CONSISTENCY FOR GAUSSIAN PROCESSES
586
+
587
+ This section provides proof for consistency in Corollary 3.
588
+
589
+ Proof of Corollary 3. By the assumption that both $q ( \mathcal D )$ and $p ( f | \mathcal { D } )$ are Gaussian processes:
590
+
591
+ $$
592
+ \begin{array} { r l } { p ( f ( \cdot ) | \mathcal { D } ) : } & { { } \mathcal { G P } ( m _ { p } ( \cdot ) , k _ { p } ( \cdot , \cdot ) ) , } \\ { q ( f ( \cdot ) ) : } & { { } \mathcal { G P } ( m _ { q } ( \cdot ) , k _ { q } ( \cdot , \cdot ) ) , } \end{array}
593
+ $$
594
+
595
+ where $m$ and $k$ denote the mean and covariance functions, respectively.
596
+
597
+ In this theorem, we also assume the measurement points cover all training locations as in Equation (9), where we have (based on Theorem 2):
598
+
599
+ $$
600
+ \begin{array} { r } { \mathcal { L } _ { { \bf X } } ( q ) = \log p ( \mathcal { D } ) - \mathrm { K L } [ q ( { \bf f } ^ { D } , { \bf f } ^ { M } ) \| p ( { \bf f } ^ { D } , { \bf f } ^ { M } | \mathcal { D } ) ] \leq \log p ( \mathcal { D } ) . } \end{array}
601
+ $$
602
+
603
+ Therefore, when the variational posterior process is sufficiently expressive and reaches its optimum, we must have $\mathrm { K L } [ q ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) | | \dot { p } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } | \mathbf { \dot { \mathcal { D } } } ) ] = 0$ and thus $\bar { \mathrm { K L } } [ \bar { q } ( { \bf f } ^ { M } ) | | p ( { \bf f } ^ { M } | \mathcal { D } ) ] = 0$ at $\mathbf { \bar { X } } ^ { M } \mathbf { \Phi } =$ $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { M } \right] ^ { \top } \in \bar { \mathcal { X } } ^ { \dot { M } }$ , which implies
604
+
605
+ $$
606
+ \begin{array} { r } { \mathcal { N } ( m _ { p } ( \mathbf { X } ^ { M } ) , k _ { p } ( \mathbf { X } ^ { M } , \mathbf { X } ^ { M } ) ) = \mathcal { N } ( m _ { q } ( \mathbf { X } ^ { M } ) , k _ { q } ( \mathbf { X } ^ { M } , \mathbf { X } ^ { M } ) ) . } \end{array}
607
+ $$
608
+
609
+ ![](images/8a1630262062ab3fc6a68816ba5e001ecd573227fdfcf3118337ff516392c3a0.jpg)
610
+ Figure 4: Predictions on Mauna datasets. Red dots are training points. The blue line is the mean prediction and shaded areas correspond to standard deviations.
611
+
612
+ $$
613
+ \begin{array} { r } { m ( { \mathbf { X } } ) = [ m ( { \mathbf { x } } _ { 1 } ) , \ldots , m ( { \mathbf { x } } _ { M } ) ] ^ { \top } , \mathrm { a n d } \left[ k ( { \mathbf { X } } ^ { M } , { \mathbf { X } } ^ { M } ) \right] _ { i j } = k ( { \mathbf { x } } _ { i } , { \mathbf { x } } _ { j } ) . } \end{array}
614
+ $$
615
+
616
+ Remember that in sampling-based functional variational inference, $\mathbf { X } ^ { M }$ are randomly sampled from $c ( \mathbf { x } )$ , and $\operatorname { s u p p } ( c ) = \bar { \mathcal { X } }$ . Thus when it reaches optimum, we have $\mathbb { E } _ { \mathbf { X } ^ { M } \sim c } \mathrm { K L } [ q ( \mathbf { f } ^ { M } ) \dot { \lVert } p ( \mathbf { f } ^ { M } | \mathcal { D } ) ] = 0$ Because the KL divergence is always non-negative, we have that $\mathrm { K L } [ q ( { \bf f } ^ { M } ) | | p ( { \bf f } ^ { M } | { \mathcal D } ) ] = 0$ for any $\mathbf { X } ^ { M } \in \mathbf { \Omega } { \mathcal { X } } ^ { M }$ . For adversarial functional variational inference, this is also obvious due to $\underset { { \bf { X } } ^ { M } } { \operatorname* { s u p } } \mathrm { { K L } } [ q ( { \bf { f } } ^ { M } ) \| p ( { \bf { f } } ^ { M } | \mathcal { D } ) ] = 0$ .
617
+
618
+ So we have that Equation (37) holds for any $\mathbf { X } ^ { M } \in \mathcal { X } ^ { M }$ . Given $M > 1$ , then for $\forall 1 \leq i < j \leq M$ we have $m _ { p } ( \mathbf { x } _ { i } ) = m _ { q } ( \mathbf { x } _ { i } )$ , and $k _ { p } ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) = k _ { q } ( \mathbf { x } _ { i } , \mathbf { x } _ { j } )$ , which implies
619
+
620
+ $$
621
+ m _ { p } ( \cdot ) = m _ { q } ( \cdot ) , \quad k _ { p } ( \cdot , \cdot ) = k _ { q } ( \cdot , \cdot ) .
622
+ $$
623
+
624
+ Because GPs are uniquely determined by their mean and covariance functions, we arrive at the conclusion. □
625
+
626
+ # C ADDITIONAL EXPERIMENTS
627
+
628
+ # C.1 CONTEXTUAL BANDITS
629
+
630
+ Here we present the full table for the contextual bandits experiment.
631
+
632
+ Table 4: Contextual bandits regret. Results are relative to the cumulative regret of the Uniform algorithm. Numbers after the algorithm are the network sizes. We report the mean and standard derivation over 10 trials.
633
+
634
+ <table><tr><td></td><td>M. RANK</td><td>M. VALUE</td><td>MUSHROOM</td><td>STATLOG</td><td>COVERTYPE</td><td>FINANCIAL</td><td>JESTER</td><td>ADULT</td><td>CENSUS</td><td>WHEEL</td></tr><tr><td>FBNN1×50</td><td>5.875</td><td>46.0</td><td>21.38 ± 7.00</td><td>8.85 ± 4.55</td><td>47.16 ± 2.39</td><td>9.90 ± 2.40</td><td>75.55± 5.51</td><td>88.43 ± 1.95</td><td>51.43 ± 2.34</td><td>65.05 ± 20.10</td></tr><tr><td>FBNN 2× 50</td><td>7.125</td><td>47.0</td><td>24.57 ± 10.81</td><td>10.08 ± 5.66</td><td>49.04 ± 3.75</td><td>11.83 ± 2.95</td><td>73.85 ± 6.82</td><td>88.81 ±3.29</td><td>50.09 ± 2.74</td><td>67.76 ± 25.74</td></tr><tr><td>FBNN3×50</td><td>8.125</td><td>48.9</td><td>34.03 ± 13.95</td><td>7.73 ± 4.37</td><td>50.14 ± 3.13</td><td>14.14 ± 1.99</td><td>74.27 ± 6.54</td><td>89.68 ± 1.66</td><td>52.37 ± 3.03</td><td>68.60 ± 22.24</td></tr><tr><td>FBNN 1 × 500</td><td>4.875</td><td>45.3</td><td>21.90 ± 9.95</td><td>6.50 ± 2.97</td><td>47.45 ± 1.86</td><td>7.83 ± 0.77</td><td>74.81 ± 5.57</td><td>89.03 ± 1.78</td><td>50.73 ± 1.53</td><td>63.77 ± 25.80</td></tr><tr><td>FBNN2× 500</td><td>5.0</td><td>44.2</td><td>23.93 ± 11.59</td><td>7.98 ± 3.08</td><td>46.00 ± 2.01</td><td>10.67 ± 3.52</td><td>68.88 ± 7.09</td><td>89.70 ± 2.01</td><td>51.87 ± 2.38</td><td>54.57 ± 32.92</td></tr><tr><td>FBNN 3× 500</td><td>4.75</td><td>44.6</td><td>19.07 ± 4.97</td><td>10.04 ± 5.09</td><td>45.24 ± 2.11</td><td>11.48 ± 2.20</td><td>69.42 ± 7.56</td><td>90.01 ± 1.70</td><td>49.73 ± 1.35</td><td>61.57 ± 21.73</td></tr><tr><td>MULTITASKGP</td><td>5.875</td><td>46.5</td><td>20.75 ± 2.08</td><td>7.25 ± 1.80</td><td>48.37 ± 3.50</td><td>8.07 ± 1.13</td><td>76.99 ± 6.01</td><td>88.64 ± 3.20</td><td>57.86 ± 8.19</td><td>64.15 ± 27.08</td></tr><tr><td>BBB1× 50</td><td>11.5</td><td>56.6</td><td>24.41 ± 6.70</td><td>25.67 ± 3.46</td><td>58.25 ± 5.00</td><td>37.69 ± 15.34</td><td>75.39 ± 6.32</td><td>95.07 ± 1.57</td><td>63.96 ± 3.95</td><td>72.37 ± 16.87</td></tr><tr><td>BBB1× 500</td><td>13.375</td><td>68.1</td><td>26.41 ± 8.71</td><td>51.29 ± 11.27</td><td>83.91 ± 4.62</td><td>57.20 ± 7.19</td><td>78.94 ± 4.98</td><td>99.21 ± 0.79</td><td>92.73 ± 9.13</td><td>55.09 ± 13.82</td></tr><tr><td>BBALPHADIV</td><td>16.0</td><td>87.4</td><td>61.00 ± 6.47</td><td>70.91 ± 10.22</td><td>97.63 ± 3.21</td><td>85.94 ± 4.88</td><td>87.80 ± 5.08</td><td>99.60 ± 1.06</td><td>100.41 ± 1.54</td><td>95.75 ± 12.31</td></tr><tr><td>PARAMNOISE</td><td>10.125</td><td>53.0</td><td>20.33 ± 13.12</td><td>13.27 ± 2.85</td><td>65.07 ± 3.47</td><td>17.63 ± 4.27</td><td>74.94 ± 7.24</td><td>95.90± 2.20</td><td>82.67 ± 3.86</td><td>54.38 ± 16.20</td></tr><tr><td>NEURALLINEAR</td><td>10.375</td><td>52.3</td><td>16.56 ± 11.60</td><td>13.96 ± 1.51</td><td>64.96 ± 2.54</td><td>18.57 ± 2.02</td><td>82.14 ± 3.64</td><td>96.87 ± 0.92</td><td>78.94 ± 1.87</td><td>46.26 ± 8.40</td></tr><tr><td>LINFULLPOST</td><td>9.25</td><td></td><td>14.71 ± 0.67</td><td>19.24 ± 0.77</td><td>58.69 ± 1.17</td><td>10.69 ± 0.92</td><td>77.76 ± 5.67</td><td>95.00 ± 1.26</td><td>CRASH</td><td>33.88 ± 15.15</td></tr><tr><td>DROPOUT</td><td>7.625</td><td>48.3</td><td>12.53 ± 1.82</td><td>12.01 ± 6.11</td><td>48.95 ± 2.19</td><td>14.64 ± 3.95</td><td>71.38 ± 7.11</td><td>90.62 ± 2.21</td><td>58.53 ± 2.35</td><td>77.46 ± 27.58</td></tr><tr><td>RMS</td><td>8.875</td><td>53.0</td><td>15.29 ± 3.06</td><td>11.38 ± 5.63</td><td>58.96 ± 4.97</td><td>10.46 ± 1.61</td><td>72.09 ± 6.98</td><td>95.29 ± 1.50</td><td>85.29 ± 5.85</td><td>75.62 ± 30.43</td></tr><tr><td>BOOTRMS</td><td>7.5</td><td>51.9</td><td>18.05 ± 11.20</td><td>6.13 ± 1.03</td><td>53.63 ± 2.15</td><td>8.69 ± 1.30</td><td>74.71 ± 6.00</td><td>94.18 ± 1.94</td><td>82.27 ± 1.84</td><td>77.80 ± 29.55</td></tr><tr><td>UNIFORM</td><td>16.75</td><td>100</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr></table>
635
+
636
+ # C.2 TIME-SERIES EXTRAPOLATION
637
+
638
+ Besides the toy experiments, we would like to examine the extrapolation behavior of our method on real-world datasets. Here we consider a classic time-series prediction problem concerning the concentration of $\mathrm { C O _ { 2 } }$ in the atmosphere at the Mauna Loa Observatory, Hawaii (Rasmussen & Williams, 2006). The training data is given from 1958 to 2003 (with some missing values). Our goal is to model the prediction for an equally long period after 2003 (2004-2048). In Figure 4 we draw the prediction results given by BBB, fBNN, and GP. We used the same BNN architecture for BBB and fBNN: a ReLU network with 2 hidden layers, each with 100 units, and the input is a normalized year number augmented by its sin transformation, whose period is set to be one year. This special design allows both BBB and fBNN to fit the periodic structure more easily. Both models are trained for $3 0 \mathrm { k }$ iterations by the Adam optimizer, with learning rate 0.01 and batch size 20. For fBNN the prior is the same as the GP experiment, whose kernel is a combination of RBF, RBF $\mathrm { \Delta ^ { \prime } \times }$ PER (period set to one year), and RQ kernels, as suggested in Rasmussen & Williams (2006). Measurement points include 20 training samples and 10 points sampled from U[1958, 2048], and we jointly train the prior GP hyperparameters with fBNN.
639
+
640
+ In Figure 4 we could see that the performance of fBNN closely matches the exact prediction by GP. Both of them give visually good extrapolation results that successfully model the long-term trend, local variations, and periodic structures. In contrast, weight-space prior and inference (BBB) neither captures the right periodic structure, nor does it give meaningful uncertainty estimates.
641
+
642
+ # C.3 BAYESIAN OPTIMIZATION
643
+
644
+ ![](images/ec17f7d83b737d67a948d569b4cd12f88f66af955ed2bbcaea275ed459fc4939.jpg)
645
+ Figure 5: Bayesian Optimization. We plot the minimal value found along iterations. We compare fBNN, BBB and Random Feature methods for three kinds of functions corresponding to RBF, Order-1 ArcCosine and Matern12 GP kernels. We plot mean and 0.2 standard derivation over 10 independent runs.
646
+
647
+ In this section, we adopt Bayesian Optimization to explore the advantage of coherent posteriors. Specifically, we use Max Value Entropy Search (MES) (Wang $\&$ Jegelka, 2017), which tries to maximize the information gain about the minimum value $y ^ { \star }$ ,
648
+
649
+ $$
650
+ \alpha _ { t } ( \mathbf { x } ) = \mathbb { H } ( p ( y | D _ { t } , \mathbf { x } ) ) - \mathbb { H } ( p ( y | D _ { t } , \mathbf { x } , y ^ { \star } ) ) \approx \frac { 1 } { K } { \sum _ { y ^ { \star } } } [ \frac { \gamma _ { y ^ { \star } } ( \mathbf { x } ) \phi ( \gamma _ { y ^ { \star } } ( \mathbf { x } ) ) } { \Psi ( \gamma _ { y ^ { \star } } ( \mathbf { x } ) ) } - \log ( \Psi ( \gamma _ { y ^ { \star } } ( \mathbf { x } ) ) ) ]
651
+ $$
652
+
653
+ Where $\phi$ and $\Psi$ are probability density function and cumulative density function of a standard normal distribution, respectively. The $y ^ { \star }$ is the minimum of a random function from the posterior, and $\begin{array} { r } { \gamma _ { y ^ { \star } } ( \mathbf { x } ) = \frac { \mu _ { t } ( \mathbf { x } ) - \bar { y } ^ { \star } } { \sigma _ { t } ( \mathbf { x } ) } . } \end{array}$
654
+
655
+ With a probabilistic model, we can compute or estimate the mean $\mu _ { t } ( \mathbf { x } )$ and the standard deviation $\sigma _ { t } ( \mathbf { x } )$ . However, to compute the MES acquisition function, samples $y ^ { \star }$ of function minima are required as well, which leads to difficulties. Typically when we model the data with a GP, we can get the posterior on a specific set of points but we don’t have access to the extremes of the underlying function. In comparison, if the function posterior is represented in a parametric form, we can perform gradient decent easily and search for the minima.
656
+
657
+ We use 3-dim functions sampled from some Gaussian process prior for Bayesian optimization. Concretely, we experiment with samples from RBF, Order-1 ArcCosine and Matern12 kernels. We compare three parametric approaches: fBNN, BBB and Random Feature (Rahimi & Recht, 2008). For fBNN, we use the true kernel as functional priors. In contrast, ArcCosine and Matern12 kernels do not have simple explicit random feature expressions, therefore we use RBF random features for all three kernels. When looking for minima, we sample $1 0 \ y ^ { \star }$ . For each $y ^ { \star }$ , we perform gradient descent along the sampled parametric function posterior with 30 different starting points. We use 500 dimensions for random feature. We use network with $5 \times 1 0 0$ for fBNN. For BBB, we select the network within $1 \times 1 0 0 , 3 \times 1 0 0$ . Because of the similar issue in Figure 1, using larger networks won’t help for BBB. We use batch size 30 for both fBNN and BBB. The measurement points contain 30 training points and 30 points uniformly sampled from the known input domain of functions. For training, we rescale the inputs to $[ 0 , 1 ]$ , and we normalize outputs to have zero mean and unit variance. We train fBNN and BBB for 20000 iterations and anneal the coefficient of log likelihood term linearly from 0 to 1 for the first 10000 iterations. The results with 10 runs are shown in Figure 5.
658
+
659
+ As seen from Figure 5, fBNN and Random feature outperform BBB by a large margin on all three functions. We also observe fBNN performs slightly worse than random feature in terms of RBF priors. Because random feature method is exactly a GP with RBF kernel asymptotically, it sets a high standard for the parametric approaches. In contrast, fBNN outperforms random feature for both ArcCosine and Matern12 functions. This is because of the big discrepancy between such kernels and RBF random features. Because fBNN use true kernels, it models the function structures better. This experiment highlights a key advantage of fBNN, that fBNN can learn parametric function posteriors for various priors.
660
+
661
+ # C.4 VARYING DEPTH
662
+
663
+ Table 5: Averaged test RMSE and log-likelihood for the regression benchmarks. We compared BBB, fBNNs and VFE. The numbers $a \times b$ represent networks with $a$ hidden layers of $b$ units.
664
+
665
+ <table><tr><td></td><td></td><td colspan="3">TestRMSE</td><td colspan="3">Test log-likelihood</td></tr><tr><td>Dataset</td><td>N</td><td>BBB</td><td>FBNN</td><td>VFE</td><td>BBB</td><td>FBNN</td><td>VFE</td></tr><tr><td>Kin8nm (1×100)</td><td>8192</td><td>0.082±0.001</td><td>0.079±0.001</td><td>0.071±0.001</td><td>1.082±0.008</td><td>1.112±0.007</td><td>1.241±0.005</td></tr><tr><td>Kin8nm (2×100)</td><td>8192</td><td>0.074±0.001</td><td>0.075±0.001</td><td>0.071±0.001</td><td>1.191±0.006</td><td>1.151±0.007</td><td>1.241±0.005</td></tr><tr><td>Kin8nm (5×500)</td><td>8192</td><td>0.266±0.003</td><td>0.076±0.001</td><td>0.071±0.001</td><td>-0.279±0.007</td><td>1.144±0.008</td><td>1.241±0.005</td></tr><tr><td>Power Plant (1×100)</td><td>9568</td><td>4.127±0.057</td><td>4.099±0.051</td><td>3.092±0.052</td><td>-2.837±0.013</td><td>-2.833±0.012</td><td>-2.531±0.018</td></tr><tr><td>Power Plant (2×100)</td><td>9568</td><td>4.081±0.054</td><td>3.830±0.055</td><td>3.092±0.052</td><td>-2.826±0.013</td><td>-2.763±0.013</td><td>-2.531±0.018</td></tr><tr><td>Power Plant (5×500)</td><td>9568</td><td>17.166±0.099</td><td>3.542±0.054</td><td>3.092±0.052</td><td>-4.286±0.007</td><td>-2.691±0.016</td><td>-2.531±0.018</td></tr></table>
666
+
667
+ To compare with Variational Free Energy (VFE) (Titsias, 2009), we experimented with two mediumsize datasets so that we can afford to use VFE with full batch. For VFE, we used 1000 inducing points initialized by $\mathbf { k }$ -means of training point. For BBB and FBNNs, we used batch size 500 with a budget of 2000 epochs. As shown in Table 5, FBNNs performed slightly worse than VFE, but the gap became smaller as we used larger networks. By contrast, BBB totally failed with large networks (5 hidden layers with 500 hidden units each layer). Finally, we note that the gap between FBNNs and VFE diminishes if we use fewer inducing points (e.g., 300 inducing points).
668
+
669
+ # C.5 LARGE SCALE REGRESSION WITH DEEPER NETWORKS
670
+
671
+ Table 6: Large scale regression. BBB and FBNN used networks with 5 hidden layers of 100 units.
672
+
673
+ <table><tr><td rowspan="2">Dataset</td><td rowspan="2"></td><td colspan="3">TestRMSE</td><td colspan="3">Test log-likelihood</td></tr><tr><td>BBB</td><td>FBNN</td><td>SVGP</td><td>BBB</td><td>FBNN</td><td>SVGP</td></tr><tr><td>Naval</td><td>11934</td><td>1.3E-4±0.000</td><td>0.7E-4±0.000</td><td>0.3E-4±0.000</td><td>6.968±0.014</td><td>7.237±0.009</td><td>8.523±0.06</td></tr><tr><td>Protein</td><td>45730</td><td>3.684±0.041</td><td>3.659±0.026</td><td>3.740±0.015</td><td>-2.715±0.012</td><td>-2.721±0.010</td><td>-2.736±0.003</td></tr><tr><td>Video Memory</td><td>68784</td><td>0.984±0.074</td><td>0.967±0.040</td><td>1.417±0.234</td><td>-1.231±0.078</td><td>-1.337±0.058</td><td>-1.723±0.179</td></tr><tr><td>Video Time</td><td>68784</td><td>1.056±.0.178</td><td>1.083±0.288</td><td>3.216±1.154</td><td>-1.180±0.070</td><td>-1.468±0.279</td><td>-2.475±0.409</td></tr><tr><td>GPU</td><td>241600</td><td>5.136±0.087</td><td>4.806±0.116</td><td>21.287±0.571</td><td>-2.992±0.013</td><td>-2.973±0.019</td><td>-4.557±0.021</td></tr></table>
674
+
675
+ In this section we experimented on large scale regression datasets with deeper networks. For BBB and fBNNs, we used a network with 5 hidden layers of 100 units, and kept all other settings the same as Section 5.2.2. We also compared with the stochastic variational Gaussian processes (SVGP) (Hensman et al., 2013), which provides a principled mini-batch training for sparse GP methods, thus enabling GP to scale up to large scale datasets. For SVGP, we used 1000 inducing points initialized by $\mathbf { k }$ -means of training points (Note we cannot afford larger size of inducing points because of the cubic computational cost). We used batch size 2000 and iterations 60000 to match the training time with fBNNs. Likewise for BNNs, we used validation set to tune the learning rate from $\{ 0 . 0 1 , \bar { 0 . 0 0 1 } \}$ . We also tuned between not annealing the learning rate or annealing it by 0.1 at 30000 iterations. We evaluated the validating set in each epoch, and selected the epoch for testing based on the validation performance. The averaged results over 5 runs are shown in Table 6.
676
+
677
+ As shown in Table 6, SVGP performs better than BBB and fBNNs in terms of the smallest naval dataset. However, with dataset size increasing, SVGP performs worse than BBB and fBNNs by a large margin. This stems from the limited capacity of 1000 inducing points, which fails to act as sufficient statistics for large datasets. In contrast, BNNs including BBB and fBNNs can use larger networks freely without the intractable computational cost.
678
+
679
+ # D IMPLEMENTATION DETAILS
680
+
681
+ D.1 INJECTED NOISES FOR GAUSSIAN PROCESS PRIORS
682
+
683
+ For Gaussian process priors, $p ( \mathbf { f } ^ { \mathbf { X } } )$ is a multivariate Gaussian distribution, which has an explicit density. Therefore, we can compute the gradients $\nabla _ { \mathbf { f } } \log p _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } )$ analytically.
684
+
685
+ In practice, we found that the GP kernel matrix suffers from stability issues. To stabilize the gradient computation, we propose to inject a small amount of Gaussian noise on the function values, i.e., to instead estimate the gradients of $\nabla _ { \phi } \mathrm { K L } [ q _ { \phi } * p _ { \gamma } \| p * p _ { \gamma } ]$ , where $p _ { \gamma } = \mathcal { N } ( 0 , \gamma ^ { 2 } )$ is the noise distribution. This is like the instance-noise trick that is commonly used for stabilizing GAN training (Sønderby et al., 2016). Note that injecting the noise on the GP prior is equivalent to have a kernel matrix $\mathbf { K } + \gamma ^ { 2 } \mathbf { I }$ . Beyond that, injecting the noise on the parametric variational posterior does not affect the reparameterization trick either. Therefore all the previous estimation formulas still apply.
686
+
687
+ # D.2 IMPLICIT PRIORS
688
+
689
+ Our method is applicable to implicit priors. We experiment with piecewise constant prior and piecewise linear prior. Concretely, we randomly generate a function $f : [ 0 , 1 ] \to R$ with the specific structure. To sample piecewise functions, we first sample $n \sim$ Poisson(3.), then we have $n + 1$ pieces within $[ 0 , 1 ]$ . We uniformly sample $n$ locations from $[ 0 , 1 ]$ as the changing points. For piecewise constant functions, we uniformly sample $n + 1$ values from $[ 0 , 1 ]$ as the function values in each piece; For piecewise linear functions, we uniformly sample $n + 1$ values for the values at first $n + 1$ locations, we force $f ( 1 ) = 0 .$ . Then we connect together each piece by a straight line.
parse/train/rkxacs0qY7/rkxacs0qY7_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkxacs0qY7/rkxacs0qY7_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkxacs0qY7/rkxacs0qY7_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/uV7hcsjqM-/uV7hcsjqM-.md ADDED
@@ -0,0 +1,506 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CONTRASTIVE CODE REPRESENTATION LEARNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Machine-aided programming tools such as automated type predictors and autocomplete are increasingly learning-based. However, current approaches predominantly rely on supervised learning with task-specific datasets. We propose Contrastive Code Representation Learning (ContraCode), a self-supervised algorithm for learning task-agnostic semantic representations of programs via contrastive learning. Our approach uses no human-provided labels, only the raw text of programs. ContraCode optimizes for a representation that is invariant to semantic-preserving code transformations. We develop an automated source-to-source compiler that generates textually divergent variants of source programs. We then train a neural network to identify variants of anchor programs within a large batch of non-equivalent negatives. To solve this task, the network must extract features representing the functionality, not form, of the program. In experiments, we pre-train ContraCode with $1 . 8 \mathbf { M }$ unannotated JavaScript methods mined from GitHub, then transfer to downstream tasks by fine-tuning. Pre-training with ContraCode consistently improves the F1 score of code summarization baselines and top-1 accuracy of type inference baselines by $2 \%$ to $13 \%$ . ContraCode achieves $9 \%$ higher top-1 accuracy than the current state-of-the-art static type analyzer for TypeScript. Finally, representations learned through a hybrid contrastive and reconstruction objective transfer in zero-shot to code clone detection with $+ 1 0 \%$ AUROC over a static text similarity measure and $+ 5 \%$ over reconstruction alone.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Programmers increasingly rely on machine-aided programming tools to aid software development (Kim et al., 2012). However, the wide diversity of programs encountered in practice limits the generalization of hand-written rules. Catching semantic bugs such as naming errors requires deeper language understanding, motivating learning-based programming tools. Recent work uses machine learning for bug detection (Pradel & Sen, 2018) and optimization (Mendis et al., 2019). Consider predicting the type of the variable declaration “var median $\mathbf { \Phi } = \mathbf { \Phi } \ldots ; \mathbf { \vec { \psi } }$ . Static analysis fails as the type is underspecified, but the variable name indicates the statement is a float.
12
+
13
+ Programming language datasets suffer from scarce annotations due to the time and expertise required to label. State-of-the-art approaches generally rely on either (1) synthetic supervised datasets or (2) self-supervised pre-training. Synthetic auto-generated labels have been used for method naming (Alon et al., 2019a;b) and bug detection (Ferenc et al., 2018; Benton et al., 2019; Pradel & Sen, 2018). However, synthetic code datasets suffer from duplication issues (Allamanis, 2019) and biases (Shin et al., 2019) which degrade generalization. Moreover, auto-generated data does not cover the diverse program behaviors encountered in the wild.
14
+
15
+ In contrast, self-supervised learning can leverage large open-source repositories such as GitHub with limited or no annotations. Inspired by the success of pre-training in natural language processing, recent work uses self-supervision to learn code representations. Authors have explored context-based token embeddings (Ben-Nun et al., 2018) and masked language modeling, where tokens are corrupted and reconstructed (Feng et al., 2020; Kanade et al., 2020) However, reconstruction focuses on superficial language reasoning and does not explicitly address the underlying program functionality. The resulting models attend to program implementation specifics such as variable names.
16
+
17
+ We hypothesize that programs with the same functionality should have the same underlying representation for downstream code understanding tasks, a principle illustrated in Fig. 1. While it is time intensive to identify equivalent programs in a large corpus, it is cheap to leverage static compiler transformations to automatically generate many equivalent versions of a particular source program.
18
+
19
+ ![](images/1c5eca6b0eaaf4fccb06cf9139d19822c2219f57b3eaaf6a911c9142df17e40b.jpg)
20
+ Figure 1: Programs with the same functionality should have the same underlying representation. ContraCode learns such representations with contrastive learning: the network is trained to find equivalent programs among many distractors, encoding semantics into the representation.
21
+
22
+ In this work, we develop ContraCode, a self-supervised representation learning algorithm that uses source-to-source compiler transformation techniques (e.g., dead code elimination, obfuscation and constant folding) to generate syntactically diverse but functionally equivalent programs. ContraCode uses these equivalent programs to construct a challenging discriminative pretext task that requires the model to identify equivalent programs out of a large dataset of distractors. In doing so, it has to embed the functionality, not the form, of the code. In essence, the domain knowledge from our code transformations induces the knowledge of the structure of programs onto learned representations. The contributions of our work include:
23
+
24
+ 1. the novel use of compiler-inspired transformations as data augmentations for code, 2. the concept of program representation learning based on functional equivalence, and 3. a detailed analysis of architectures, code transforms and pre-train strategies, where ContraCode improves static type inference top-1 accuracy by $9 \%$ , learned inference by $2 \% -$ $13 \%$ , summarization F1 score by up to $8 \%$ and clone detection AUROC by $5 \% - 1 0 \%$ .
25
+
26
+ # 2 RELATED WORK
27
+
28
+ Self-supervised learning (SSL) is a general representation learning strategy where some dimensions or attributes of a datapoint are predicted from the remaining parts. These methods are unsupervised in the sense that they do not rely on labels, but SSL tasks often adapt losses and architectures designed for supervised learning. Self-supervised pre-training has yielded large improvements in both NLP (Howard & Ruder, 2018; Devlin et al., 2018; Radford et al., 2018; 2019) and computer vision (Mahajan et al., 2018) by improving generalization (Erhan et al., 2010; Hao et al., 2019). Weak visual features, such as orientation (Gidaris et al., 2018), color (Zhang et al., 2016), and context (Pathak et al., 2016), are meaningful signals for representations (Mahajan et al., 2018).
29
+
30
+ Contrastive learning unifies many past SSL approaches that compare pairs or collections of similar and dissimilar items (Hadsell et al., 2006). Rather than training the network to predict labels or reconstruct data, contrastive methods minimize the distance between the representations of similar examples (positives) while maximizing the distance between dissimilar examples (negatives). Examples include Siamese networks (Bromley et al., 1994) and triplet losses (Schroff et al., 2015). Contrastive predictive coding (Oord et al., 2018; Hénaff et al., 2019) learns to encode chunks of sequential data to predict of future chunks with the InfoNCE loss, a variational lower bound on mutual information between views of the data (Tian et al., 2019; Wu et al., 2020) inspired by noiseconstrastive estimation (Gutmann & Hyvärinen, 2010). In instance discrimination tasks (Wu et al., 2018), views and not pieces of an entire image are compared. SimCLR (Chen et al., 2020a) and Momentum Contrast (He et al., 2019; Chen et al., 2020b) recently made progress by using many negatives for dense loss signal. Beyond images, InfoNCE has been applied to NLP (Chuang et al., 2020; Giorgi et al., 2020), but may require supervision (Fang & Xie, 2020).
31
+
32
+ Code representation learning There has been substantial work on architectures and tasks for machine learning on code (Allamanis et al., 2018). We adopt the summarization task of Alon et al.
33
+
34
+ function x(maxLine) { const section $= \ \ell$ text: data }; for (; $\mathrm { ~ i ~ } <$ maxLine; $\mathrm { ~ i ~ } + = \mathrm { ~ } 1 \mathrm { ~ } .$ ) { section.text $+ =$ \`\${lines[i]}\n\`; } if (section) { parsingCtx.sections.push(section); }
35
+ }
36
+ function x(t) { const n = { 'text': 'data': data }; for (;i < t; $\mathrm { ~ i ~ } + = \mathrm { ~ } 1 \mathrm { ~ } \cdot$ ) { n.text $+ =$ lines[i] + '\n'; } n && parsingCtx.sections.push(n);
37
+ } function x(t){const
38
+ n={'text':'', 'data':data};for(;i<t;i+= 1)n.text+=lines[i]
39
+ $+ \prime \prime \boldsymbol { \mathrm { n } } \prime$ ;n&&parsingCtx.sections.push(n)}
40
+
41
+ Original JavaScript method
42
+
43
+ Renamed variables, explicit object style, explicit concatenation, inline conditional
44
+
45
+ (2019a), and the variable type inference task of DeepTyper (Hellendoorn et al., 2018). Other authors have explored summarization (Movshovitz-Attias & Cohen, 2013; Allamanis et al., 2016; Iyer et al., 2016) and type inference (Pradel et al., 2019; Pandi et al., 2020; Wei et al., 2020; Allamanis et al., 2020; Bielik & Vechev, 2020) with different languages and datasets. The tree or graph structure of code can be exploited to encode invariances in the representation. Inst2vec (Ben-Nun et al., 2018) locally embeds individual statements in LLVM IR by processing a contextual flow graph with a context prediction objective (Mikolov et al., 2013). Tree-Based CNN embeds the Abstract Syntax Tree (AST) nodes of high-level source code. Code2seq (Alon et al., 2019a) embeds AST paths with an attention-based encoder and LSTM decoder for supervised sequence-to-sequence tasks. Kanade et al. (2020); Feng et al. (2020) pre-train the Transformer (Vaswani et al., 2017) on code using the masked language modeling objective (Devlin et al., 2018), an instance of the cloze task (Taylor, 1953) where the model reconstructs corrupted tokens. Recurrent networks have also been pre-trained on code (Hussain et al., 2020) as language models (Peters et al., 2018; Karampatsis & Sutton, 2020). Wang & Christodorescu (2019); Wang & Su (2019) assess the stability of program analyzers under semi-automated program transformations. Concurrent work by Rabin & Alipour (2020) found that code2vec and code2seq often change their classifications when statements are permuted, variables are renamed, or other-semantic preserving transformations are applied.
46
+
47
+ # 3 METHOD: CONTRASTIVE CODE REPRESENTATION LEARNING
48
+
49
+ Understanding program functionality and global structure is important for difficult tasks like summarizing code in natural language. For these problems, learned code representations should be similar for functionally equivalent programs and dissimilar for non-equivalent programs (Figure 1). The principle of contrastive learning offers a simple objective for learning such representations if data can be organized into pairs of positives and negatives. We use each pair to shape representation space, drawing positives together and pushing negatives apart. However, a major question remains: given an unlabeled corpus of programs, how do we identify or generate similar programs? We address this question in Sec. 3.1, then introduce our learning framework in Sec. 3.2.
50
+
51
+ # 3.1 COMPILATION AS DATA AUGMENTATION
52
+
53
+ Modern programming languages afford great flexibility to software developers, allowing them to implement the same desired functionality in different ways. Crowdsourced datasets mined from developers, such as GitHub repositories, have many near-duplicates in terms of textual similarity (Allamanis, 2019), and are bound to contain even more functional equivalences for common tasks. Satisfiability solvers can identify these equivalent programs (Joshi et al., 2002; Bansal & Aiken, 2006), but functional equivalence is also undecidable in general (Rice, 1953). Also, formal documentation of semantics is required. Programs can instead be compared approximately using test-cases (Massalin, 1987), but this is costly and requires executing untrusted code.
54
+
55
+ Instead of searching for equivalences, we propose correct by construction data augmentation. Our insight is to apply source-to-source compiler transformations to unlabeled code to generate many variants with the same functionality. For example, dead-code elimination (DCE) is a common compiler optimization that removes operations that leave the output of a function unchanged. While
56
+
57
+ Table 1: We augment programs with 11 automated source-tosource compiler transformations. 10 of the 11 transformations are correct-by-construction and do not modify operational semantics. More details are in Section A.3.
58
+
59
+ <table><tr><td></td><td>Code compression</td><td>Identifier modification</td></tr><tr><td>v√</td><td>Reformatting (R)</td><td>Variable renaming (VR)</td></tr><tr><td></td><td>Beautification (B)</td><td>Identifier mangling (IM)</td></tr><tr><td></td><td>Compression (C)</td><td>Regularization</td></tr><tr><td></td><td>Dead-code elimination (DCE)</td><td>√ Dead-code insertion (DCI)</td></tr><tr><td></td><td>Type upconversion (T)</td><td>√ Subword regularization (SW) X</td></tr><tr><td></td><td>Constant folding (CF)</td><td>Line subsampling (LS)</td></tr></table>
60
+
61
+ $\checkmark =$ semantics-preserving transformation $\pmb { \chi } =$ lossy transformation
62
+
63
+ ![](images/0fc69a31c4c9e4bfa025d964e52cf6fdf1754cb22f07022ea552d052783a176d.jpg)
64
+ Figure 3: Histogram of the number of transformed variants per method during pre-training.
65
+
66
+ DCE preserves program functionality, Wang & Christodorescu (2019) find that up to $1 2 . 7 \%$ of the predictions of current algorithm classification models change after DCE—supervised datasets were not enough to acquire the domain knowledge that DCE does not matter.
67
+
68
+ A particular source code sequence, e.g. “W\*x $^ +$ b” is parsed unambiguously into a tree-structured representation ${ } ^ { \textit { \textbf { u } } } ( + \mathrm { ~ \textbf ~ { ~ ( ~ \star ~ \textsf ~ { ~ W ~ } ~ x ~ ) ~ } ~ } \mathsf { b } ) ^ { \prime \prime }$ . This tree is then transformed by automated traversal algorithms. A rich body of prior programming language work explores parsing then tranforming Abstract Syntax Trees to optimize a program prior to machine code generation. If source code is output rather than machine code, this is called source-to-source transformation. Source-to-source transformations are common for optimization and obfuscation purposes in dynamic languages like JavaScript. If each transformation preserves code functionality, then any composition also preserves code functionality.
69
+
70
+ We leverage the Babel and Terser compiler infrastructure tools for JavaScript (McKenzie et al., 2020; Santos et al., 2020) to parse code into an Abstract Syntax Tree (AST) and then perform correctnesspreserving transformations on method bodies. Table 1 and Appendix A.3 list all transformations, but we broadly group program transformations into three categories. Code compression changes the syntactic structure of code and performs correct-by-construction transformations such as precomputing constant expressions at compile time. Identifier modification substitutes method and variable names with random tokens, thereby masking part of the semantic information in programs. Finally, transformations for Regularization improve model generalization by reducing the number of trivial positive pairs with high text overlap; this group potentially modifies program semantics through the line subsampling pass.
71
+
72
+ # 3.2 CONTRASTIVE PRE-TRAINING
73
+
74
+ Representations of semantically equivalent programs (positives) should have representations that each are closer to each other than semantically dissimilar programs (negatives). Contrastive learning is a natural framework to induce invariances into a model by attracting positives while repelling negatives. To adapt recent contrastive learning objectives for images to code representation learning, we leverage the augmentations discussed in Section 3.1.
75
+
76
+ We extend the Momentum Contrast method (He et al., 2019) that was designed for image representation learning. Our training procedure is depicted in Figure 4. Each transformation is a function $\tau : \mathcal { P } \to \mathcal { P }$ , where the space of programs $\mathcal { P }$ is composed of both the set of valid ASTs and the set of programs in source form. At the beginning of an iteration, a batch of programs is sampled from a large database. Each program $x$ in the batch is transformed twice using two different, random subsets of transformations to derive textually different query programs and key programs according to Algorithm 1. Unlike computer vision data augmentations such as random cropping that are stochastic, our compiler-based transformations are deterministic.
77
+
78
+ To produce a diverse set of transformed programs, we randomly apply a subset of available compiler passes in a pre-specified order, applying transform $\tau _ { i }$ with probability $p _ { i }$ . Intermediate programs are converted between AST and source form as needed. As all augmentations are precomputed, we deduplicate programs variants before pre-training. Figure 3 measures this diversity. $89 \%$ of the JavaScript functions in our dataset have more than one alternative after applying 20 random sequences of transformations. The remaining programs without syntactically distinct alternatives include one-line functions that are obfuscated. We apply subword regularization (Kudo, 2018) as a final transformation to derive different tokenizations every batch, so pairs will still differ. All transformations are fast; our compiler transforms 300 functions per second on a single CPU core.
79
+
80
+ ![](images/65fec17c05938cea3050e5e621335df3369ce037d8abdb83281a6f6fb2cdbf6c.jpg)
81
+ Figure 4: ContraCode pre-trains a neural program encoder $f _ { q }$ and transfers it to downstream tasks. A-B. Unlabeled programs are transformed C. into augmented variants. D. We pre-train $f _ { q }$ by maximizing similarity of embeddings of positive program pairs–variants of the same program–and minimizing similarity with queue of cached negatives. E. $f _ { q }$ is fine-tuned on smaller labeled datasets.
82
+
83
+ To reduce memory consumption during pre-training, we enqueue past batches to cache activations for negative samples. These cached samples are valid negatives if the queue is smaller than the dataset size. Following He et al. (2019), the query encoder $f _ { q }$ is trained via gradient descent while the key encoder $f _ { k }$ is trained slowly via an exponential moving average (EMA) of the query encoder parameters. The EMA update stabilizes the pre-computed key embeddings across training iterations. Since keys are only embedded once per epoch, we use a very large set of negatives, over 100K, with minimal additional computational cost and no explicit hard negative mining.
84
+
85
+ ContraCode supports different encoder architectures. We evaluate contrastive pre-training of Transformer (Vaswani et al., 2017) and BiLSTM (Schuster & Paliwal, 1997; Huang et al., 2015) architectures, with specific details in Section 4.
86
+
87
+ Pre-training objective The contrastive objective maximizes the similarity of positives without collapsing onto a single representation. Like He et al. (2019), we use InfoNCE (Oord et al., 2018), a tractable objective that frames contrastive learning as a classification task: can the positives be identified among a batch of sampled negatives? InfoNCE computes the probability of classifying the positive (transformed program) by taking the softmax of representation similarities across a batch of negatives. Equation (1) shows the InfoNCE loss for instance discrimination from He et al. (2019), a function whose value is low when $q$ is similar to the positive key embedding $k ^ { + }$ and dissimilar to negative key embeddings $k ^ { - }$ . $t$ is a temperature hyperparameter proposed by Wu et al. (2018).
88
+
89
+ $$
90
+ \mathcal { L } _ { q , k ^ { + } , k ^ { - } } = - \log \frac { \exp ( q \cdot k ^ { + } / t ) } { \exp ( q \cdot k ^ { + } / t ) + \sum _ { k ^ { - } } \exp ( q \cdot k ^ { - } / t ) }
91
+ $$
92
+
93
+ The query representation $q = f _ { q } ( x ^ { q } )$ is computed by the encoder network $f _ { q }$ , and $x ^ { q }$ is a query program. Likewise, $k = f _ { k } ( x ^ { k } )$ using the EMA key encoder $f _ { k }$ . Views $x ^ { q } , x ^ { k }$ depend on the specific domain and pretext task. In our case, the views are tokenized representations of the augmented programs, and the summation $\sum _ { k ^ { - } }$ in the normalizing denominator is taken over the queue of pre-computed negatives as well as other non-matching keys in the batch.
94
+
95
+ Transfer learning After pre-training converges, the encoder $f _ { q }$ is transferred to downstream tasks. As the output space of the task can differ from the encoder, we add a task-specific MLP or Transformer decoder after $f _ { q }$ , then train the resulting network end-to-end on task data.
96
+
97
+ # 4 EXPERIMENTS
98
+
99
+ We evaluate whether self-supervised pre-training with ContraCode improves JavaScript and TypeScript code analysis. We benchmark on (1) extreme code summarization (Allamanis et al., 2016)
100
+
101
+ 1: Input: Program source $_ x$ , transformation functions $\tau _ { 1 } , \dots \tau _ { k }$ , transform probabilities $p 1 , \ldots p _ { k }$
102
+ 2: $\nu \{ x \}$ , a set of augmented program variants
103
+ 3: for SAMPLE $i 1 \ldots N$ do
104
+ 4: $x ^ { \prime } \gets x$
105
+ 5: for transform $t 1 \ldots k$ do
106
+ 6: Sample $y _ { t } \sim \mathrm { B e r n o u l l i } ( p _ { t } )$
107
+ 7: if $y _ { t } = 1$ then
108
+ 8: if REQUIRESAST $( \tau _ { t } ( \cdot ) )$ and $\neg \mathrm { I s A S T } ( x ^ { \prime } )$ then $x ^ { \prime } \gets$ PARSETOAST $( x ^ { \prime } )$
109
+ 9: else if ¬REQUIRESAST $( \tau _ { t } ( \cdot ) )$ and ISAST $( x ^ { \prime } )$ then $x ^ { \prime } \gets$ LOWERTOSOURCE $( x ^ { \prime } )$
110
+ 10: $x ^ { \prime } \gets \tau _ { t } ( x ^ { \prime } )$
111
+ 11: end if
112
+ 12: end for
113
+ 13: i $\mathbf { f } \ \mathrm { I s } \mathbf { A } \mathbf { S } \mathrm { T } ( \boldsymbol { x } ^ { \prime } )$ then $x ^ { \prime } \gets$ LOWERTOSOURCE $( x ^ { \prime } )$
114
+ 14: $\mathcal { V } \mathcal { V } \cup \{ x ^ { \prime } \}$
115
+ 15: end for
116
+ 16: return V
117
+
118
+ and (2) TypeScript type inference (Hellendoorn et al., 2018). ContraCode improves accuracy on both tasks. As a baseline self-supervised approach, we pre-train a RoBERTa model with the masked language modeling (MLM) loss on our augmented dataset, then fine-tune it on each downstream task. Contrastive pre-training with our compiler-based augmentations outperforms baseline supervised learning methods as well as MLM self-supervision. To probe the semantic content of representations learned with MLM, ContraCode, and a hybrid model combining both objectives, we evaluate zero-shot performance of code clone detection (Kamiya et al., 2002), a binary classification task that reveals that contrastive and hybrid representations are highly predictive of program functionality in-the-wild. Further, we find it is better to augment the large set of unlabeled programs during pretraining rather than augmenting smaller supervised datasets. As ContraCode makes no modifications to model architecture, we find that contrastive pre-training can be applied to diverse baselines while improving accuracy across the board.
119
+
120
+ We pre-train over a large corpus of methods extracted from popular GitHub repositories. The CodeSearchNet dataset collected by Husain et al. (2019) contains 1,843,099 JavaScript programs. Only 81,487 methods have both a documentation string and a method name. The asymmetry between labeled and unlabeled programs stems from JavaScript coding practices where anonymous functions are widespread. The pre-training dataset described in Section 3.1 is the result of augmenting CodeSearchNet’s $1 . 8 \mathrm { m }$ programs.
121
+
122
+ # 4.1 IMPACT OF CONTRACODE PRE-TRAINING ON TYPE INFERENCE
123
+
124
+ JavaScript is a dynamically typed language, where variable types are determined at runtime based on the values they represent. However, annotating code with types helps tools flag possible bugs before runtime by statically detecting incompatible types. These annotations also help programmers document and understand code. However, maintaining type annotations is tedious. Type inference tools automatically predict variable types from context.
125
+
126
+ To learn to infer types, we use the same annotated dataset of TypeScript programs from DeepTyper (Hellendoorn et al., 2018), without GitHub repos that were made private or deleted since publication. The training set consists of 15,570 TypeScript files from 187 projects with 6,902,642 total tokens. Validation and test sets are from held-out repositories. For additional supervision during training, additional types are inferred by static analysis to augment user-defined types as targets. All type annotations are removed from the input to the model. We evaluate a 2-layer Bidirectional LSTM, as used by DeepTyper, and a 6-layer Transformer, modified from RoBERTa to have a comparable parameter count. A 2-layer MLP head predicts types from the model’s embedding of each token. We perform early stopping based on validation set top-1 accuracy.
127
+
128
+ Benefiting from pre-training is challenging because it requires knowledge transfer across dialects. Our models are pre-trained on JavaScript, not TypeScript. TypeScript supports a superset of the JavaScript grammar, adding type annotations and syntactic sugar that must be learned during finetuning. Further, the pre-training dataset consists of methods, while the DeepTyper dataset includes entire modules. Table 2 summarizes results. Contrastive pre-training outperforms all baseline learned methods, showing meaningful transfer. Our best-performing model (bottom row) achieves $+ 8 . 3 \%$ higher top-1 accuracy than a supervised Transformer model trained from scratch, $+ 1 3 . 2 \%$ higher than a pre-trained RoBERTa model and $+ 2 . 3 \%$ higher than DeepTyper.
129
+
130
+ Table 2: Type inference accuracy on TypeScript programs in the Hellendoorn et al. (2018) dataset. ContraCode (BiLSTM) outperforms baseline top-1 accuracies by $2 . 2 8 \%$ to $1 3 . 1 6 \%$ . As ContraCode does not modify model architecture, contrastive pre-training can be combined with each baseline. Compared with TypeScript’s built-in type inference, ContraCode improves top-1 accuracy by $8 . 9 \%$ .
131
+
132
+ <table><tr><td>Baseline</td><td>Method</td><td>Acc@1</td><td>Acc@5 (all types) (all types)</td></tr><tr><td> Static analysis</td><td>TypeScript CheckJS (Bierman et al., 2014) Name only (Helendoorn et al.,2018)</td><td>45.11% 28.94%</td><td>70.07%</td></tr><tr><td>Transformer</td><td>Transformer (supervised) with ContraCode pre-training</td><td>45.66% 46.86%</td><td>80.08% 81.85 %</td></tr><tr><td>RoBERTa</td><td>Transformer (RoBERTa MLM pre-training) with ContraCode pre-training</td><td>40.85% 47.16%</td><td>75.76% 81.44%</td></tr><tr><td>DeepTyper (BiLSTM)</td><td>DeepTyper (supervised) with RoBERTa MLM pre-training (10K steps) with ContraCode pre-training</td><td>51.73% 50.24% 52.65% with ContraCode pre-training (w/ subword reg. ft.) 54.01%</td><td>82.71% 82.85% 84.60% 85.55%</td></tr></table>
133
+
134
+ ContraCode can also be applied in a drop-in fashion to each of the baselines without modifying model architecture. Simply pre-training each baseline with our contrastive objective and data augmentations yields absolute accuracy improvements of $+ 1 . 2 \%$ , $+ 6 . 3 \%$ , $+ 2 . 3 \%$ top-1 and $+ 1 . 8 \%$ , $+ 5 . 7 \%$ , $+ 2 . 8 \%$ top-5 over the Transformer, RoBERTa, and DeepTyper, respectively. The RoBERTa baseline may perform poorly since its masked language modeling (MLM) objective focuses on token reconstruction that is overly sensitive to local syntactic structure. To combine the approaches, we minimized our loss in addition to MLM as a hybrid local-global objective during pre-training.
135
+
136
+ Learning outperforms static analysis by a large margin. Overall, ContraCode achieves $+ 8 . 9 \%$ higher top-1 accuracy than the best static type inference system, the built-in TypeScript CheckJS system, showing the promise of learned code analysis. Surfacing multiple candidate types can be useful to users. While CheckJS only produces a single prediction which is often incorrect, one of the top-5 predictions of ContraCode is correct for $8 5 . 5 5 \%$ of labeled tokens.
137
+
138
+ # 4.2 IMPACT OF CONTRACODE PRE-TRAINING ON EXTREME CODE SUMMARIZATION
139
+
140
+ The extreme code summarization task asks a model to predict the name of a method given its body (Allamanis et al., 2016). Tokenized method names often contain a short summary of functionality, such as reverseString(...). Summarization models could explain obfuscated or poorly documented code. We create a JavaScript summarization dataset using the 81,487 labeled methods in the CodeSearchNet dataset. The method name is masked in the declaration of the function and then predicted by a sequence-to-sequence model with an autoregressive decoder trained to maximize log likelihood of the ground-truth name, a form of abstractive summarization. All models overfit, so we use early stopping according to validation loss. As proposed by Allamanis et al. (2016), we evaluate model predictions by precision, recall and F1 scores over the set of method name tokens.
141
+
142
+ Table 3 shows code summarization results in four settings: (1) supervised training using baseline tree-structured architectures that analyze the AST (code2vec, code2seq), (2) pre-training on all 1.84M programs using masked language modeling followed by fine-tuning on the labeled programs (RoBERTa), (3) supervised training from scratch with a Transformer architecture and (4) contrastive pre-training with all 1.84M programs followed by fine-tuning with augmentations (ContraCode).
143
+
144
+ Contrastive pre-training with fine-tuning outperforms the prior code2seq model, a competitive supervised baseline, by ${ \bar { 8 . 2 \% } }$ in test precision, ${ \bar { 7 } } . 3 \%$ in recall, and $7 . 9 \%$ in F1 score. The tree-based code2seq architecture is a way to encode code-specific invariances into the model, while contrastive pre-training induces domain invariances through data augmentation; reduced inductive biases in the Transformer model architecture leads to better performance. ContraCode outperforms self-supervised pre-training with RoBERTa by $4 . 8 \%$ F1. ContraCode also achieves higher performance than the Transformer learned from scratch with the same network architecture. While this improvement is relatively smaller, code summarization is a difficult task. Naming conventions aren’t consistent between programmers, and the metric measures exact token matches.
145
+
146
+ Table 3: Results for different settings of the code summarization task: supervised training with 81k functions, masked language model pre-training and contrastive pre-training with fine-tuning.
147
+
148
+ <table><tr><td>Method</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>code2vec (Alon et al.,2019b)</td><td>10.78%</td><td>8.24%</td><td>9.34%</td></tr><tr><td>code2seq (Alon et al., 2019a)</td><td>12.17%</td><td>7.65%</td><td>9.39%</td></tr><tr><td>RoBERTa MLM (Liu et al., 2019)</td><td>15.13%</td><td>11.47%</td><td>12.45%</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>18.11%</td><td>15.78%</td><td>16.86%</td></tr><tr><td>Transformer + ContraCode + augmentation</td><td>20.34%</td><td>14.96%</td><td>17.24%</td></tr></table>
149
+
150
+ 4.3 PROBING REPRESENTATIONS OF FUNCTIONALITY: ZERO-SHOT CODE CLONE DETECTION
151
+
152
+ ContraCode learns to match variants of programs with similar functionality. While these transformations produce highly diverse token sequences (Section A.4), they are artificial and do not change the underlying algorithm. Human programmers can solve a problem with many data structures, algorithms and programming models. Are pre-trained representations consistent across programs written by different people? We benchmark on the code clone detection task, a binary classification task to distinguish pairs of programs solving the same problem from pairs solving different ones. This is useful for deduplicating and refactoring code, or checking approximate code correctness.
153
+
154
+ Table 4: Code clone detection results with cosine similarity probe. Contrastive and hybrid representations are predictive of functionality, with $+ 6 . 2 \%$ , $+ 1 0 \%$ AUROC over textual similarity (edit distance).
155
+
156
+ <table><tr><td>Representation</td><td>AUROC</td><td>AP</td></tr><tr><td>Edit distance heuristic</td><td>69.55</td><td>73.75</td></tr><tr><td>Transformer w/o pre-train</td><td>74.28</td><td>76.40</td></tr><tr><td>+ MLM pre-train</td><td>74.41</td><td>75.96</td></tr><tr><td>+ ContraCode pre-train</td><td>75.76</td><td>78.16</td></tr><tr><td>+ ContraCode+MLM</td><td>79.55</td><td>81.74</td></tr></table>
157
+
158
+ Datasets exist like BigCloneBench (Svajlenko et al., 2014), but to the best of our knowledge, there is no benchmark for the JavaScript programming language. We collected 274 in-the-wild JavaScript programs correctly solving 33 problems from the HackerRank interview preparation website. There are 2065 pairs solving the same problem and 70K pairs solving different problems, which we randomly subsample to 2065 to balance the classes. Since we probe zero-shot performance, there is no training set. Traditional code analysis methods for clone detection measure textual similarity. As a baseline heuristic classifier, we threshold the dissimilarity score (Eq. 2), a scaled edit distance between two normalized and tokenized programs (to exclude formatting changes). For continuous representations, we threshold cosine similarity $u ^ { T } \dot { v } / \| u \| \| v \|$ .
159
+
160
+ Table 4 shows results according to the area under the ROC curve (AUROC) and average precision (AP, area under precision-recall). Continuous representation improves clone detection over the heuristic. However, self-supervision through masked language modeling for nearly 100 epochs of pre-training does not help, indicating that MLM is a poor fit for representing functionality. Contrastive pre-training achieves $+ 6 . 2 1 \%$ higher AUROC than the baseline. A hybrid objective combining both the contrastive loss and MLM has the best performance with $+ 1 0 \%$ AUROC $+ 5 . 1 4 \%$ over MLM alone).
161
+
162
+ # 4.4 UNDERSTANDING THE IMPORTANCE OF DATA AUGMENTATION
163
+
164
+ We first analyze the effect of our proposed augmentations on supervised learning without a pre-training phase. We then study the importance of individual augmentations during pre-training.
165
+
166
+ Supervised learning with data augmentation As a baseline, we re-train models from scratch with compiler transforms during supervised learning rather than pre-training. Data augmentation artificially expands labeled training sets. For sequence-tosequence summarization, we apply a variety of augmentations; these all preserve the method name label. For type inference, labels are aligned to input tokens, so they must be realigned after transformation. We apply all token-level transformations that track label locations.
167
+
168
+ Table 6: Ablating compiler transformations used during contrastive pre-training. The DeepTyper BiLSTM is pre-trained with constrastive learning for 20K steps, then fine-tuned for type inference. Augmentations are only used during pre-training. Each transformation contributes to accuracy.
169
+
170
+ <table><tr><td>Augmentations used during pre-training</td><td>Acc@1</td><td>Acc@5</td></tr><tr><td>All augmentations (Table 2)</td><td>52.65%</td><td>84.60%</td></tr><tr><td>without identifier modification (-VR, -IM)</td><td>51.94%</td><td>84.43%</td></tr><tr><td>without line subsampling (-LS)</td><td>51.05%</td><td>81.63%</td></tr><tr><td>without code compression (-T,C,DCE,CF)</td><td>50.69%</td><td>81.95%</td></tr></table>
171
+
172
+ Table 5: Compiler data augmentations degrade performance when training supervised models from scratch.
173
+
174
+ <table><tr><td>Code summarization</td><td>F1</td></tr><tr><td>Transformer (Table 3) w/ LS,SW,VR,DCI aug.</td><td>16.86 15.65</td></tr><tr><td>Type Inference</td><td>Acc@1</td></tr><tr><td>Transformer (Table 2)</td><td>45.66</td></tr><tr><td>w/ SW reg. w/ LS,SW aug.</td><td>43.96</td></tr><tr><td>DeepTyper (Table 2)</td><td>44.14 51.73</td></tr><tr><td>w/ SW reg.</td><td>49.93</td></tr><tr><td>w/ LS,SW aug.</td><td>50.93</td></tr><tr><td>w/ stronger LS,SW aug.</td><td>50.33</td></tr></table>
175
+
176
+ Table 5 shows results. Compiler-based data augmentations degrade supervised models, perhaps by creating a training distribution not reflective of evaluation programs. However, as shown in 4.1 – 4.3, augmenting during ContraCode pre-training yields a more robust model. Our contrastive learning framework also allows learning over large numbers of unlabeled programs that supervised learning alone cannot leverage. The ablation indicates that augmentations do not suffice, and contrastive learning is important.
177
+
178
+ Ablating data pre-training augmentations Some data augmentations may be more valuable than others for learning a representation via instance discrimination. Empirically, pre-training converges faster with a smaller set of augmentations at the same batch size since the positives are syntactically more similar, but this hurts downstream performance. Table 6 shows that type inference accuracy degrades when different groups of augmentations are removed. Semantics-preserving code compression passes that require code analysis are the most important, improving top-1 accuracy by $1 . 9 5 \%$ when included. Line subsampling serves as a regularizer, but changes program semantics. LS is relatively less important, but does help accuracy. Identifier modification passes preserve semantics, but remove potentially useful naming information. Removing these hurts accuracy the least.
179
+
180
+ Additional results We perform additional ablations in Section A.1 by transferring different parts of the network to downstream tasks, computing the contrastive objective with representations taken from different encoder layers, varying architecture, and tuning the pre-training procedure. These experiments suggest that as many parameters as possible should be transferred to the downstream task. Details of the pre-training strategy are also important. Computing the contrastive objective using a “global” representation $q$ summarizing the whole input sequence $x ^ { q }$ outperforms more a “local” representation based on aggregating token representations. Further, a large batch size is helpful to stabilize pre-training. Section A.2 includes qualitative results.
181
+
182
+ # 5 CONCLUSIONS
183
+
184
+ Large-scale unannotated repositories of code like GitHub are a powerful resource for learning machine-aided programming tools. However, most current approaches to code representation learning do not leverage unannotated data. We propose ContraCode, a contrastive self-supervised algorithm that learns representations that are invariant to code transformations. Our method optimizes for this invariance via novel compiler-based data augmentations for code. ContraCode significantly improves the accuracy of extreme code summarization baselines $( + 2 . 3 \%$ to $+ 1 3 . 2 \%$ ), TypeScript type inference models (up to $+ 7 . 9 \%$ F1) and code clone detection $+ 5$ to $+ 1 0 \%$ AUROC). ContraCode outperforms self-supervised RoBERTa pre-training. Moreover, contrastive pre-training outperforms supervised training with our augmentations. As ContraCode makes no modifications to model architecture and simply adds a training phase, it consistently improves accuracies when applied to diverse baselines.
185
+
186
+ # REFERENCES
187
+
188
+ Miltiadis Allamanis. The adverse effects of code duplication in machine learning models of code. In Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2019, pp. 143–153, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450369954. doi: 10.1145/3359591. 3359735.
189
+
190
+ Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning (ICML), 2016.
191
+
192
+ Miltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. ACM Computing Surveys (CSUR), 51(4):81, 2018.
193
+
194
+ Miltiadis Allamanis, Earl T. Barr, Soline Ducousso, and Zheng Gao. Typilus: Neural type hints. In Programming Language Design and Implementation (PLDI), 2020.
195
+
196
+ Uri Alon, Shaked Brody, Omer Levy, and Eran Yahav. code2seq: Generating sequences from structured representations of code. In International Conference on Learning Representations, 2019a.
197
+
198
+ Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. code2vec: Learning distributed representations of code. Proceedings of the ACM on Programming Languages, 2019b.
199
+
200
+ Sorav Bansal and Alex Aiken. Automatic generation of peephole superoptimizers. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS XII, pp. 394–403, New York, NY, USA, 2006. Association for Computing Machinery. ISBN 1595934510. doi: 10.1145/1168857.1168906.
201
+
202
+ Tal Ben-Nun, Alice Shoshana Jakobovits, and Torsten Hoefler. Neural code comprehension: A learnable representation of code semantics. In NeurIPS, 2018.
203
+
204
+ Samuel Benton, Ali Ghanbari, and Lingming Zhang. Defexts: A curated dataset of reproducible real-world bugs for modern jvm languages. In 2019 IEEE/ACM 41st International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), pp. 47–50. IEEE, 2019.
205
+
206
+ Pavol Bielik and Martin Vechev. Adversarial robustness for code. CoRR, 2020.
207
+
208
+ Gavin Bierman, Martín Abadi, and Mads Torgersen. Understanding typescript. In European Conference on Object-Oriented Programming (ECOOP), 2014.
209
+
210
+ Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a" siamese" time delay neural network. In Advances in neural information processing systems, pp. 737–744, 1994.
211
+
212
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Conference on Macnine Learning, 2020a.
213
+
214
+ Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b.
215
+
216
+ Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning, 2020.
217
+
218
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Annual Conference of the North American Chapter of the Association for Computational Linguistics, 2018.
219
+
220
+ Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11(Feb):625–660, 2010.
221
+
222
+ Hongchao Fang and Pengtao Xie. CERT: Contrastive self-supervised learning for language understanding. arXiv preprint arXiv:2005.12766, May 2020.
223
+
224
+ Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. CodeBERT: A pre-trained model for programming and natural languages. arXiv preprint arXiv:2002.08155, 2020.
225
+
226
+ Rudolf Ferenc, Zoltán Tóth, Gergely Ladányi, István Siket, and Tibor Gyimóthy. A public unified bug dataset for Java. In Proceedings of the 14th International Conference on Predictive Models and Data Analytics in Software Engineering, pp. 12–21, 2018.
227
+
228
+ Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
229
+
230
+ John M. Giorgi, Osvald Nitski, Gary D. Bader, and Bo Wang. DeCLUTR: Deep contrastive learning for unsupervised textual representations. arXiv preprint arXiv:2006.03659, 2020.
231
+
232
+ Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 297–304, 2010.
233
+
234
+ Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), volume 2, pp. 1735–1742. IEEE, 2006.
235
+
236
+ Yaru Hao, Li Dong, Furu Wei, and Ke Xu. Visualizing and understanding the effectiveness of bert. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4134–4143, 2019.
237
+
238
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
239
+
240
+ Vincent J Hellendoorn, Christian Bird, Earl T Barr, and Miltiadis Allamanis. Deep learning type inference. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 152–162, 2018.
241
+
242
+ Olivier J Hénaff, 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. In International Conference on Machine Learning, 2019.
243
+
244
+ Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, pp. 328–339, 2018.
245
+
246
+ Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991, 2015.
247
+
248
+ Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis, and Marc Brockschmidt. CodeSearchNet challenge: Evaluating the state of semantic code search. arXiv preprint arXiv:1909.09436, 2019.
249
+
250
+ Yasir Hussain, Zhiqiu Huang, Yu Zhou, and Senzhang Wang. Deep transfer learning for source code modeling. International Journal of Software Engineering and Knowledge Engineering, 30(05): 649–668, May 2020. ISSN 1793-6403. doi: 10.1142/s0218194020500230.
251
+
252
+ Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, and Luke Zettlemoyer. Summarizing source code using a neural attention model. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2073–2083, 2016.
253
+
254
+ Rajeev Joshi, Greg Nelson, and Keith Randall. Denali: A goal-directed superoptimizer. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, PLDI ’02, pp. 304–314, New York, NY, USA, 2002. Association for Computing Machinery. ISBN 1581134630. doi: 10.1145/512529.512566.
255
+
256
+ T. Kamiya, S. Kusumoto, and K. Inoue. Ccfinder: a multilinguistic token-based code clone detection system for large scale source code. IEEE Transactions on Software Engineering, 28(7):654–670, 2002. doi: 10.1109/TSE.2002.1019480.
257
+
258
+ Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. Pre-trained contextual embedding of source code. ArXiv, abs/2001.00059, 2020.
259
+
260
+ Rafael-Michael Karampatsis and Charles Sutton. SCELMo: Source code embeddings from language models. arXiv preprint arXiv:2004.13214, 2020.
261
+
262
+ Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. A field study of refactoring challenges and benefits. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, pp. 1–11, 2012.
263
+
264
+ Taku Kudo. Subword regularization: Improving neural network translation models with multiple subword candidates. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 66–75, 2018.
265
+
266
+ 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.
267
+
268
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
269
+
270
+ Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. In Proceedings of the European Conference on Computer Vision, pp. 181–196, 2018.
271
+
272
+ Henry Massalin. Superoptimizer: A look at the smallest program. In Proceedings of the Second International Conference on Architectual Support for Programming Languages and Operating Systems, ASPLOS II, pp. 122–126, Washington, DC, USA, 1987. IEEE Computer Society Press. ISBN 0818608056. doi: 10.1145/36206.36194.
273
+
274
+ Sebastian McKenzie et al. Babel: compiler for writing next generation javascript. https://github. com/babel/babel, 2020.
275
+
276
+ Charith Mendis, Alex Renda, Saman Amarasinghe, and Michael Carbin. Ithemal: Accurate, portable and fast basic block throughput estimation using deep neural networks. In International Conference on Machine Learning, pp. 4505–4515, 2019.
277
+
278
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
279
+
280
+ Dana Movshovitz-Attias and William Cohen. Natural language models for predicting programming comments. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 35–40, 2013.
281
+
282
+ Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
283
+
284
+ Irene Vlassi Pandi, Earl T. Barr, Andrew D. Gordon, and Charles Sutton. Opttyper: Probabilistic type inference by optimising logical and natural constraints, 2020.
285
+
286
+ 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.
287
+
288
+ Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proc. of NAACL, 2018.
289
+
290
+ Michael Pradel and Koushik Sen. Deepbugs: A learning approach to name-based bug detection. Proceedings of the ACM on Programming Languages, 2(OOPSLA):1–25, 2018.
291
+
292
+ Michael Pradel, Georgios Gousios, Jason Liu, and Satish Chandra. Typewriter: Neural type prediction with search-based validation. arXiv preprint arXiv:1912.03768, 2019.
293
+
294
+ Md. Rafiqul Islam Rabin and Mohammad Amin Alipour. Evaluation of generalizability of neural program analyzers under semantic-preserving transformations, 2020.
295
+
296
+ Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. ArXiv, 2018.
297
+
298
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. ArXiv, 2019.
299
+
300
+ Henry Gordon Rice. Classes of recursively enumerable sets and their decision problems. Transactions of the American Mathematical Society, 74(2):358–366, 1953.
301
+
302
+ Fábio Santos et al. Terser: Javascript parser, mangler and compressor toolkit for $\mathrm { e s 6 + }$ . https: //github.com/terser/terser, 2020.
303
+
304
+ Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 815–823, 2015.
305
+
306
+ Mike Schuster and Kuldip Paliwal. Bidirectional recurrent neural networks. Signal Processing, IEEE Transactions on, 45:2673 – 2681, 12 1997. doi: 10.1109/78.650093.
307
+
308
+ Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015.
309
+
310
+ Richard Shin, Neel Kant, Kavi Gupta, Christopher Bender, Brandon Trabucco, Rishabh Singh, and Dawn Song. Synthetic datasets for neural program synthesis. arXiv preprint arXiv:1912.12345, 2019.
311
+
312
+ Jeffrey Svajlenko, Judith F. Islam, Iman Keivanloo, Chanchal K. Roy, and Mohammad Mamun Mia. Towards a big data curated benchmark of inter-project code clones. In Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, ICSME ’14, pp. 476–480, USA, 2014. IEEE Computer Society. ISBN 9781479961467. doi: 10.1109/ICSME.2014.77. URL https://doi.org/10.1109/ICSME.2014.77.
313
+
314
+ Wilson L Taylor. “Cloze procedure”: A new tool for measuring readability. Journalism Quarterly, 30(4):415–433, 1953.
315
+
316
+ Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. CoRR, 2019.
317
+
318
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
319
+
320
+ Ke Wang and Mihai Christodorescu. COSET: A benchmark for evaluating neural program embeddings. arXiv preprint arXiv:1905.11445, 2019.
321
+
322
+ Ke Wang and Zhendong Su. Learning blended, precise semantic program embeddings. ArXiv, 2019.
323
+
324
+ Jiayi Wei, Maruth Goyal, Greg Durrett, and Isil Dillig. Lambdanet: Probabilistic type inference using graph neural networks. In International Conference on Learning Representations, 2020.
325
+
326
+ Mike Wu, Chengxu Zhuang, Milan Mosse, Daniel Yamins, and Noah Goodman. On mutual information in contrastive learning for visual representations, 2020.
327
+
328
+ 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.
329
+
330
+ Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European Conference on Computer Vision, pp. 649–666. Springer, 2016.
331
+
332
+ # A APPENDIX
333
+
334
+ # A.1 ADDITIONAL RESULTS AND ABLATIONS
335
+
336
+ Code clone detection ROC and PR curves Figure 5 plots true postive rate vs false positive rate and precision vs recall for different zero-shot classifiers on the code clone detection downstream tasks. These classifiers threshold a similarity score given by token-level edit distance for the heuristic approach or cosine similarity for the neural network representations. The hybrid self-supervised model combining ContraCode’s contrastive objective and masked language modeling achieves better tradeoffs than the other approaches.
337
+
338
+ ![](images/acaddd7d700e3abab9e31a9f68f5f210a638012cbe6b80f13f0eb9661b61a9d5.jpg)
339
+ Figure 5: Receiver Operating Characteristic (ROC, left) and Precision-Recall (PR, right) curves for zero-shot classifiers on the code clone detection task. Equal F1 score curves are shown on right.
340
+
341
+ Which part of the model should be transferred? SimCLR (Chen et al., 2020a) proposed using a small MLP head to reduce the dimensionality of the representation used in the InfoNCE loss during pre-training, and did not transfer the MLP to the downstream image-classification task. In contrast, we find it beneficial to transfer part of the contrastive MLP head to type inference, showing a $2 \%$ improvement in top-5 accuracy over transferring the encoder only (Table 7). We believe the improvement stems from fine-tuning both the encoder and MLP which allows feature adaptation, while SimCLR trained a linear model on top of frozen features. We only transferred the MLP when contrasting the mean of token embeddings during pre-training, not the terminal hidden states, as the dimensionality of the MLP head differs. These representations are compared next.
342
+
343
+ Table 7: If local representations are learned, transferring part of the Contrastive MLP head improves type inference. The encoder is a 2-layer BiLSTM $\scriptstyle ( \mathrm { d } = 5 1 2 )$ , with a 2-layer MLP head for both pre-training purposes and type inference. The mean hidden state representation is optimized for 10K iterations for the purposes of this ablation.
344
+
345
+ <table><tr><td>Transferred from pre-training</td><td></td><td>Acc@1 Acc@5</td></tr><tr><td>Transfer BiLSTM</td><td></td><td>49.32%80.03%</td></tr><tr><td>Transfer BiLSTM,1layer of MLP 49.15%</td><td></td><td>82.58%</td></tr></table>
346
+
347
+ Should we pre-train global or local representations? We compare pre-training DeepTyper with two variants of ContraCode. We either use the mean of token hidden states across the program (averaging local features), or the terminal hidden states as input to the MLP used to extract the contrastive representation $q = f _ { q } ( x )$ (global features). Token-level features might capture more syntactic details, but averaging pooling ignores order. Table 8 shows the accuracy of a BiLSTM pre-trained with each strategy. Using the global features for pre-training yields significantly improved performance, $+ 2 . 3 8 \%$ acc $@ 1$ after 10K iterations of pre-training (not converged for the purposes of ablation). The global pre-training strategy achieves the best results in Table 2.
348
+
349
+ Do pre-trained encoders help more with shallow decoders? For the sequence-to-sequence code summarization task, ContraCode only pre-trains the encoder of the Transformer. In Table 9, we ablate the depth of the decoder to understand how much shallow decoders benefit from contrastive pre-training of the encoder. Similar experiments were performed in a vision context by Erhan et al.
350
+
351
+ Table 8: Contrasting global, sequence-level representations outperforms contrasting local representations. We compare using the terminal (global) hidden states of the DeepTyper BiLSTM and the mean pooled token-level (local) hidden states.
352
+
353
+ <table><tr><td>Representation</td><td>Optimization</td><td>Acc@1</td><td>Acc@5</td></tr><tr><td rowspan="2">Global</td><td>InfoNCE with terminal hidden state, 20k steps (Table 2)</td><td>52.65%</td><td>84.60%</td></tr><tr><td>InfoNCE with terminal hidden state,10K steps</td><td>51.70%</td><td>83.03%</td></tr><tr><td>Local</td><td>InfoNCE with mean token rep.,10K steps</td><td>49.32%</td><td>80.03%</td></tr></table>
354
+
355
+ Table 9: Training time and decoder depth ablation on the method name prediction task. Longer pre-training significantly improves downstream performance when a shallow, 1 layer decoder is used.
356
+
357
+ <table><tr><td>Decoder</td><td>Pre-training (1.8M programs)</td><td>Supervision (81k programs)</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Transformer,1 layer</td><td>MoCo,10k steps</td><td>Original set</td><td>11.91%</td><td>5.96%</td><td>7.49%</td></tr><tr><td>Transformer,1 layer</td><td>MoCo,45k steps</td><td>Original set</td><td>17.71%</td><td>12.57%</td><td>13.79%</td></tr><tr><td>Transformer,4 layers</td><td>MoCo,45k steps</td><td>Original set</td><td>18.21%</td><td>13.21%</td><td>14.56%</td></tr></table>
358
+
359
+ (2010), where different numbers of layers of a classifier are pretrained. After $4 5 \mathrm { k }$ pre-training steps, the 4-layer decoder achieves $0 . 5 0 \%$ higher precision, $0 . 6 4 \%$ higher recall and $0 . 7 7 \%$ higher F1 score than the 1-layer model, so additional decoder depth is helpful for the downstream task. The 1-layer decoder model also benefits significantly from longer pre-training, with a $6 . 3 \%$ increase in F1 from 10k to 45k iterations. This large of an improvement indicates that ContraCode could be more helpful for pre-training when the number of randomly initialized parameters at the start of fine-tuning is small. For larger decoders, more parameters must be optimized during-finetuning, and the value of pre-training is diminished.
360
+
361
+ Contrastive representation learning strategies In Figure 6, we compare two strategies of refreshing the MoCo queue of key embeddings (the dictionary of negative program representations assumed to be non-equivalent to the batch of positives). In the first strategy, we add 8 items out of the batch to the queue $( 1 \times )$ , while in the second we add 96 items $( 1 2 \times )$ . In addition, we use a larger queue (65k versus $1 2 5 \mathrm { k }$ keys) and a slightly larger batch size (64 versus 96). We observe that for the baseline queue fill rate, the accuracy decreases for the first 8125 iterations as the queue fills. This decrease in accuracy is expected as the task becomes more difficult due to the increasing number of negatives during queue warmup. However, it is surprising that accuracy grows so slowly once the queue is filled. We suspect this is because the key encoder changes significantly over thousands of iterations: with a momentum term $m = 0 . 9 9 9$ , the original key encoder parameters are decayed by a factor of $2 . 9 \times 1 0 ^ { - 4 }$ by the moving average. If the queue is rapidly refreshed, queue embeddings are predicted by recent key encoders, not old parameters. This also indicates that a large diversity of negative, non-equivalent programs are helpful for rapid convergence of ContraCode pre-training.
362
+
363
+ ![](images/e579d3191c48e24dfefbbdafb08fe07b81493b181a2f9f1082ca9e3f8fcf61c2.jpg)
364
+ Top 5 accuracy
365
+ Figure 6: Pre-training quickly converges if negative programs in the queue are frequently changed.
366
+
367
+ # A.2 QUALITATIVE RESULTS
368
+
369
+ t-SNE visualization of representations We qualitatively inspect the structure of the learned representation space by visualizing self-supervised representations of variants of 28 programs using t-SNE (Maaten & Hinton, 2008) in Figure 7. Representations of transformed variants of the same program are plotted with the same color. ContraCode (BiLSTM) clusters variants closely together. Indeed, contrastive learning learns representations that are invariant to a wide class of automated compiler-based transformations. In comparison, the representations learned by masked language modeling (RoBERTa) show more overlap between different programs, and variants do not cleanly cluster.
370
+
371
+ ![](images/922f388084aa32779ca63532f5e7b536d109a948a592e399702c1de1ed0f630a.jpg)
372
+ Figure 7: t-SNE (Maaten & Hinton, 2008) plot of program representations learned with masked language modeling (RoBERTa), contrastive learning (ContraCode), and a hybrid loss (RoBERTa $^ +$ ContraCode). Transformed variants of the same program share the same color, though colors may be similar across different programs.
373
+ Figure 8: A JavaScript program from the CodeSearchNet dataset not seen during training and the predicted method names from a Transformer pre-trained with ContraCode. ContraCode predicts the correct method name as its most likely decoding.
374
+
375
+ With a hybrid loss combining masked language modeling and contrastive learning, representations of variants of the same program once again cluster.
376
+
377
+ Code summaries Figure 8 shows a qualitative example of predictions for the code summarization task. The JavaScript method is not seen during training. A Transformer pretrained with ContraCode predicts the correct method name as the most likely decoding through beam search. The next four predictions are reasonable, capturing that the method processes an image. The 2nd and 3rd most likely decodings, getImageItem and createImage, use get and create as synonyms for load, though the final two unlikely decodings include terms not mentioned in the method body.
378
+
379
+ function x(url, callback, error) { var img $=$ new Image(); img.src $=$ url; if(img.complete){ return callback(img); } img.onload $=$ function(){ img.onload $=$ null; callback(img); $\}$ ; img.onerror $=$ function(e){ img.onerror $=$ null; error(e); };
380
+ }
381
+
382
+ 1. getImageItem
383
+ 2. createImage
384
+ 3. loadImageForBreakpoint
385
+ 4. getImageSrcCSS
386
+
387
+ Type inferences We can also visualize outputs of the type inference model. Figure 9 shows two TypeScript programs from the held-out test set. User-provided type annotations are removed from the programs, and the model is provided with a tokenized form without access to dependencies. We visualize predictions from a variant of DeepTyper pretrained with ContraCode, the best-performing model in Table 8. In the first program, our model consistently predicts the correct return and parameter type. While a tool based on static analysis could infer the void return types, the type of the message argument is ambiguous without access to the imported write method signature. Still, the model correctly predicts with high confidence that the variable message is a string. In the second program, ContraCode correctly predicts 4 of 8 types including the ViewContainerRef and ChangeDetectorRef types, each imported from the AngularJS library. As this sample is held-out from the training set, these predictions show generalization from other repositories using AngularJS.
388
+
389
+ import { write, categories, messageType
390
+ } from "s";
391
+ export const animationsTraceCategory $=$ "s";
392
+ export const rendererTraceCategory $\scriptstyle \mathbf { \mu } = { \mathbf { \mu } } " \mathbf { s } "$ ;
393
+ export const viewUtilCategory $=$ "s";
394
+ export const routerTraceCategory $\scriptstyle \mathbf { \mu } = { \mathbf { \mu } } " \mathbf { s } "$ ;
395
+ export const routeReuseStrategyTraceCategory $=$ "s";
396
+ export const listViewTraceCategory $=$ "s";
397
+ export function animationsLog ( message: string 100.0% ): void 99.9% { write(message, animationsTraceCategory);
398
+ }
399
+ export function rendererLog (msg) $\ast$ void 53.7% { write(msg, rendererTraceCategory);
400
+ }
401
+ export function rendererError ( message: string 99.5% ): void 99.7% { write(message, rendererTraceCategory, messageType.error);
402
+ }
403
+ export function viewUtilLog (msg): void 100.0% { write(msg, viewUtilCategory);
404
+ }
405
+ export function routerLog ( message: string 99.9% ): void 100.0% { write(message, routerTraceCategory);
406
+ }
407
+ export function routeReuseStrategyLog ( message: string 99.8% ): void 99.98% { write(message, routeReuseStrategyTraceCategory);
408
+ }
409
+ export function styleError ( message: string 99.97% ): void 100.0% { write(message, categories.Style, messageType.error);
410
+ }
411
+ export function listViewLog ( message: string 100.0% ): void 100.0% { write(message, listViewTraceCategory);
412
+ }
413
+ export function listViewError ( message: string 99.93% ): void 100.0% ...
414
+ import { ComponentRef, ComponentFactory, ViewContainerRef, Component, Type, ComponentFactoryResolver, ChangeDetectorRef
415
+ } from "s";
416
+ import { write
417
+ } from "s";
418
+ export const CATEGORY $=$ "s";
419
+ function log( message: string 56.95 ) { write(message, CATEGORY);
420
+ }
421
+ @ Component({ selector: "s", template: \`template\`
422
+ }) export class DetachedLoader { constructor(private resolver: ViewContainerRef 63.85% (GT: ComponentFactoryResolver) , private changeDetector: ChangeDetectorRef 100.0% private containerRef: ViewContainerRef 100.0% ) {} private loadInLocation ( componentType<any>: TemplateRef 99.6% (GT: Type)) <ComponentRef<any>>: Promise 100.0% { const factory $=$ this.resolver.resolveComponentFactory(componentType); const componentRef $=$ this.containerRef.createComponent( factory, this.containerRef.length, this.containerRef.parentInjector); log("s"); return Promise.resolve(componentRef); } public detectChanges() { this.changeDetector.markForCheck(); } public loadComponent ( componentType<any>: TemplateRef 99.9% (GT: Type)) <ComponentRef<any>>: Promise 100.0% { log("s"); return this.loadInLocation(componentType); } ...
423
+
424
+ Figure 9: Our model, a variant of DeepTyper pretrained with ContraCode, generates type annotations for two programs in the held-out set. The model consistently predicts the correct return type of functions, and even predicts project-specific types imported at the top of the file. The model corresponds to the top row of Table 8, though is not our best performing model.
425
+
426
+ # A.3 PROGRAM TRANSFORMATION DETAILS
427
+
428
+ We use the Babel compiler infrastructure (McKenzie et al., 2020) and the terser JavaScript library for AST-based program transformations. We perform variable renaming and dead code insertion (variable declaration insertion) using custom Babel transforms, subword regularization with sentencepiece Python tokenization library, line subsampling using JavaScript string manipulation primatives and other transformations with terser. Terser has two high-level transformation modes, mangling and compression, each with finer grained controls such as formatting, comment and log removal, and dead code elimination. We show an example merge sort with example equivalent variants in Figure 11.
429
+
430
+ Reformatting, beautification, compression (R, B, C): Personal coding conventions do not affect the semantics of code; auto-formatting normalizes according to a style convention.
431
+
432
+ Dead-code elimination (DCE): In this pass, all unused code with no side effects are removed.
433
+ Various statements can be inlined or removed as stale or unneeded functionality.
434
+
435
+ Type upconversion (T): In JavaScript, some types are polymorphic & can be converted between each other. As an example, booleans can be represented as true or as 1.
436
+
437
+ Constant folding (CF): During constant folding, all expressions that can be pre-computed at compilation time can be inlined. For example, the expression $( 2 ~ + ~ 3 ) ~ \star ~ 4$ is replaced with 20.
438
+
439
+ Variable renaming, identifier mangling (VR, IM): Arguments can be renamed with random word sequences and identifiers can be replaced with short tokens to make the model robust to naming choices. Program behavior is preserved despite obfuscation.
440
+
441
+ Dead-code insertion (DCI): Commonly used no-ops such as comments and logging are inserted.
442
+
443
+ Subword regularization (SW): From Kudo (2018), text is tokenized in several different ways, with a single word (_function) or subtokens (_func tion).
444
+
445
+ Line subsampling (LS): We randomly sample $\mathit { p } = 0 . 9 $ ) lines from a method body. While not semantics-preserving, line subsampling serves as a regularizer.
446
+
447
+ While compilers are generally deterministic, we require a variety of alternatives to each program for contrastive representation learning. Algorithm 1 samples $N$ augmented variants of a source program $x$ using a set of deterministic compiler transformations $\tau _ { i }$ . Stochasticity is introduced by randomly toggling each transformation according to Bernoulli samples with probabilities $p _ { i }$ . When adding a program to the set of variants $\nu$ , uniqueness is determined by string comparison.
448
+
449
+ # A.4 HOW SIMILAR ARE TRANSFORMED PROGRAMS?
450
+
451
+ To understand the diversity created by program transformations, we compute the Levenshtein minimum edit distance between positive pairs in the precomputed pre-training dataset, i.e. transformed variants of the same source method. For comparison, we also compute the edit distance between negative pairs, i.e. transformed variants of different programs. The edit distance $D ( x _ { q } , x _ { k } )$ computes the minimum number of token insertions, deletions or substitutions needed to transform the tokenized query progrm $x _ { q }$ into the key program $x _ { k }$ . To normalize by sequence length $| \cdot |$ , let
452
+
453
+ $$
454
+ \mathrm { d i s s i m i l a r i t y } _ { D } ( x _ { q } , x _ { k } ) = \frac { D ( x _ { q } , x _ { k } ) } { \operatorname* { m a x } ( | x _ { q } | , | x _ { k } | ) }
455
+ $$
456
+
457
+ Dissimilarity ranges from $0 \%$ for programs with the same token sequence such as positives before applying our transformations, to $100 \%$ for programs without any shared tokens. Note that whitespace transformations do not affect the metric because the tokenizer collapses repeated whitespace. For the positives, we estimate dissimilarity by sampling one pair per source program in the CodeSearchNet dataset (1.6M source programs with at least one pair). We sample the same number of negative pairs.
458
+
459
+ Figure 10 shows a histogram of token dissimilarity. Positive pairs have $6 5 \%$ mean dissimilarity, while negatives have $8 6 \%$ mean dissimilarity. Negatives are more dissimilar on average as source sequences could have different lengths, idioms and functionality. Still, the transformations generated quite different positive sequences, with less than half of their tokens shared. The 25th, median and 75th percentile dissimilarity is $59 \%$ , $6 6 \%$ and $73 \%$ for positives, and $82 \%$ , $87 \%$ and $90 \%$ for negatives.
460
+
461
+ ![](images/377eee8ee63cb4e1f9a4fd884a06241395de9a91322b92365dc26b89517b11a7.jpg)
462
+ Figure 10: Histogram of pairwise token dissimilarity for contrastive positives (transformed variants of the same method) and negatives (transformed variants of different methods). Code transformations produce positives with dissimilar token sequences.
463
+
464
+ # A.5 EXPERIMENTAL SETUP
465
+
466
+ Architectures The Transformer has 6 encoder layers (23M parameters) in all experiments, and 4 decoder layers for method name prediction in Table 3. We leverage the default positional embedding function (sin, cos) as used in the original Transformer architecture. The network originally proposed in DeepTyper (Hellendoorn et al., 2018) had 11M parameters with a 300 dimensional hidden state. We increase the hidden state size to 512 to increase model capacity, so our BiLSTM for type prediction has $1 7 . 5 \mathbf { M }$ parameters. During fine-tuning, across all experiments, we optimize parameters using Adam with linear learning rate warmup and decay. For the Transformer, the learning rate is linearly increased for 5,000 steps from 0 to a maximum of $1 0 ^ { - 4 }$ . For the bidirectional LSTM, the learning rate is increased for between 2,500 and 10,000 steps to a maximum of $1 0 ^ { - 3 }$ . Type inference hyperparameters are selected by validation top-1 accuracy.
467
+
468
+ ContraCode pretraining The InfoNCE objective (1) is minimized with temperature $t = 0 . 0 7$ following He et al. (2019). Also following He et al. (2019), the key encoder’s parameters are computed with the momentum update equation $\theta _ { k } \gets m \theta _ { k } + ( 1 - m ) \theta _ { q }$ , equivalent to an EMA of the query encoder parameters $\theta _ { q }$ . To pretrain a Transformer using the ContraCode objective, we first embed each token in the program using the Transformer. However, the InfoNCE objective is defined in terms of a single embedding for the full program. The ContraCode Transformer is pretrained with a batch size of 96. Our model averages the 512-dimensional token embeddings across the sequence, then applies a two-layer MLP with 512 hidden units and a ReLU activation to extract a 128-dimensional program embedding for the loss.
469
+
470
+ The DeepTyper bidirectional LSTM architecture offers two choices for extracting a global program representation. We aggregate a 1024-dimensional global representation of the program by concatenating its four terminal hidden states (from two sequence processing directions and two stacked LSTM layers), then apply the same MLP architecture as before to extract a 128-dimensional program representation. Alternatively, we can average the hidden state concatenated from each direction across the tokens in the sequence before applying the MLP head. We refer to the hidden-state configuration as a global representation and the sequence averaging configuration as a local representation in Table 8. We pre-train the BiLSTM with large batch size of 512 and apply weight decay.
471
+
472
+ Type prediction Following DeepTyper (Hellendoorn et al., 2018), our regenerated dataset for type prediction has 187 training projects with 15,570 TypeScript files, totaling 6,902,642 tokens. We tune hyperparameters on a validation set of 23 distinct projects with 1,803 files and 490,335 tokens, and evaluate on a held-out test set of 24 projects with 2,206 files and 958,821. The training set is smaller than originally used in DeepTyper as several projects were made private or deleted from GitHub before May 2020 when we downloaded the data, but we used the same commit hashes for available projects so our splits are a subset of the original. We have released the data with our open-source code to facilitate further work on a stable benchmark as more repositories are deleted over time. We perform early stopping to select the number of training epochs. We train each model for 100 epochs and select the checkpoint with the minimum accuracy $@ 1$ metric (all types, including
473
+
474
+ // Split the array into halves and merge them recursively
475
+ function mergeSort (arr) { if (arr.length $= = = ~ 1$ ) { // return once we hit an array with a single item return arr } const middle $=$ Math.floor(arr.length / 2) // get the middle item of the array rounded down const left $=$ arr.slice(0, middle) // items on the left side const right $=$ arr.slice(middle) // items on the right side return merge( mergeSort(left), mergeSort(right) )
476
+ }
477
+
478
+ # Original merge sort program
479
+
480
+ function mergeSort(e) { if (e.length $\scriptstyle = = = \ 1$ ) { return e; } const t $=$ Math.floor(e.length / 2); const $1 \ =$ e.slice(0, t); const $\rceil =$ e.slice(t); return merge(mergeSort(l), mergeSort(n));
481
+ }
482
+
483
+ # After variable renaming, comment removal, reformatting (mangling)
484
+
485
+ function mergeSort(e) { if ( $1 \ = = =$ e.length) return e;
486
+ const t $=$ Math.floor(e.length / 2), r = e.slice(0, t), n $=$ e.slice(t); return merge(mergeSort(r), mergeSort(n));
487
+ }
488
+
489
+ # After combining variable declarations, inlining conditional (mangling and compression)
490
+
491
+ any) on the validation set. Except for the model learned from scratch, the Transformer architectures are pre-trained for 240K steps. Models with the DeepTyper architecture converge faster on the pre-training tasks and are pre-trained for $2 0 \mathrm { K }$ iterations (unless otherwise noted).
492
+
493
+ Extreme code summarization by method name prediction We train method prediction models using the labeled subset of CodeSearchNet. Neither method names nor docstrings are provided as input to the model: the docstring is deleted, and the method name is replaced with the token $\cdot _ { \mathsf { X } } ,$ . Thus, the task is to predict the method name using the method body and comments alone. To decode method names from all models except the code2vec and code2seq baselines which implement their own decoding procedures, we use a beam search with a beam of size 5 and a maximum target sequence length of 20 subword tokens. We detail the cumulative distribution of program lengths in Figure 12. The ContraCode summarization Transformer only needed to be pre-trained for 20K iterations, with substantially faster convergence than RoBERTa (240K iterations). During fine-tuning, we apply the LS,SW,VR,DCI augmentations to ContraCode.
494
+
495
+ ![](images/d8073f6c7d83c86be34933625180fb1dba7fc8497f3a35b29287838e330da4a2.jpg)
496
+ Figure 12: CodeSearchNet code summarization dataset statistics: (a) The majority of code sequences are under 2000 characters, but there is long tail of programs that span up to 15000 characters long, (b) JavaScript method names are relatively short compared to languages like $C ^ { \sharp }$ and Java.
497
+
498
+ # A.6 BASELINES
499
+
500
+ Baselines for code summarization and type prediction trained their models on an inconsistent set of programming languages and datasets. In order to normalize the effect of datasets, we selected several diverse state-of-the-art baselines and reimplemented them on the JavaScript dataset.
501
+
502
+ AST-based models The authors of code2vec (Alon et al., 2019b) and code2seq (Alon et al., 2019a), AST-based code understanding models, made both data and code available, but train their model on the Java programming language. In order to extend the results in their paper to JavaScript for comparison with our approach, we generated an AST path dataset for the CodeSearchNet dataset. The sensitivity of path-mining embeddings to different datasets is documented in prior work, so published F1 scores are not directly comparable; F1 scores for code2vec (Alon et al., 2019b) vary between 19 (Alon et al., 2019a) and 43 (Alon et al., 2019b) depending on the dataset used. Therefore, we use the same dataset generation code as the authors for fair comparison. We first parse the source functions using the Babel compiler infrastructure. Using the original code on these ASTs, up to 300 token-to-token (leaf-to-leaf) paths are extracted from each function’s AST as a precomputed dataset. Then, we generate a token and AST node vocabulary using the same author-provided code, and train the models for 20 epochs, using early stopping for code2seq. We observed that code2vec overfits after 20 epochs, and longer training was not beneficial.
503
+
504
+ DeepTyper (Hellendoorn et al., 2018) DeepTyper uses a two layer GRU with a projection over possible classes, with an embedding size of 300 and hidden dimension of 650. However, we found improved performance by replacing the GRU with a bidirectional LSTM (BiLSTM). We normalize the LSTM parameter count to match our model, and therefore use a hidden dimension size of 512. We also use subword tokenization rather than space delimited tokens according to Kudo (2018), as subword tokenization is a key part of state-of-the-art models for NLP (Sennrich et al., 2015).
505
+
506
+ RoBERTa We pre-trained an encoder using RoBERTa’s masked language modeling loss on our augmented version of CodeSearchNet, the same data used to pretrain ContraCode. This model is then fine-tuned on downstream datasets. Unlike the original BERT paper which cuBERT (Kanade et al., 2020) is based on, hyperparameters from RoBERTa have been found to produce better results during pre-training. RoBERTa pre-trains using a masked language modeling (MLM) objective, where $15 \%$ of tokens in a sentence are masked or replaced and are reconstructed by the model. We did not use the BERT Next Sentence Prediction (NSP) loss which RoBERTa finds to be unnecessary. We normalize baseline parameter count by reducing the number of Transformer layers from 24 to 6 for a total of 23M parameters.
parse/train/uV7hcsjqM-/uV7hcsjqM-_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/uV7hcsjqM-/uV7hcsjqM-_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/uV7hcsjqM-/uV7hcsjqM-_model.json ADDED
The diff for this file is too large to render. See raw diff